@pixodesk/svg-animator-react 1.0.8 → 1.0.15
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.
- package/dist/index.cjs +40 -3
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +47 -6
- package/dist/index.d.ts +47 -6
- package/dist/index.js +38 -2
- package/dist/index.js.map +1 -1
- package/dist/index.umd.js +1995 -135
- package/dist/index.umd.js.map +1 -1
- package/package.json +2 -2
package/dist/index.umd.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../node_modules/.pnpm/react@19.2.4/node_modules/react/cjs/react.production.js","../../../node_modules/.pnpm/react@19.2.4/node_modules/react/cjs/react.development.js","../../../node_modules/.pnpm/react@19.2.4/node_modules/react/index.js","../../../node_modules/.pnpm/react@19.2.4/node_modules/react/cjs/react-jsx-runtime.production.js","../../../node_modules/.pnpm/react@19.2.4/node_modules/react/cjs/react-jsx-runtime.development.js","../../../node_modules/.pnpm/react@19.2.4/node_modules/react/jsx-runtime.js","../src/index.ts","../../svg-animator-web/src/PxAnimatorUtil.ts","../../svg-animator-web/src/PxAnimatorDOM.ts","../../svg-animator-web/src/PxAnimatorTriggers.ts","../../svg-animator-web/src/PxAnimatorTypes.ts","../../svg-animator-web/src/PxDefinitions.ts","../../svg-animator-web/src/PxAnimatorFrameLoop.ts","../../svg-animator-web/src/PxAnimatorWebApi.ts","../../svg-animator-web/src/PxAnimator.ts","../src/PixodeskSvgAnimator.tsx","../src/Utils.ts"],"sourcesContent":["/**\n * @license React\n * react.production.js\n *\n * Copyright (c) Meta Platforms, Inc. and affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\n\"use strict\";\nvar REACT_ELEMENT_TYPE = Symbol.for(\"react.transitional.element\"),\n REACT_PORTAL_TYPE = Symbol.for(\"react.portal\"),\n REACT_FRAGMENT_TYPE = Symbol.for(\"react.fragment\"),\n REACT_STRICT_MODE_TYPE = Symbol.for(\"react.strict_mode\"),\n REACT_PROFILER_TYPE = Symbol.for(\"react.profiler\"),\n REACT_CONSUMER_TYPE = Symbol.for(\"react.consumer\"),\n REACT_CONTEXT_TYPE = Symbol.for(\"react.context\"),\n REACT_FORWARD_REF_TYPE = Symbol.for(\"react.forward_ref\"),\n REACT_SUSPENSE_TYPE = Symbol.for(\"react.suspense\"),\n REACT_MEMO_TYPE = Symbol.for(\"react.memo\"),\n REACT_LAZY_TYPE = Symbol.for(\"react.lazy\"),\n REACT_ACTIVITY_TYPE = Symbol.for(\"react.activity\"),\n MAYBE_ITERATOR_SYMBOL = Symbol.iterator;\nfunction getIteratorFn(maybeIterable) {\n if (null === maybeIterable || \"object\" !== typeof maybeIterable) return null;\n maybeIterable =\n (MAYBE_ITERATOR_SYMBOL && maybeIterable[MAYBE_ITERATOR_SYMBOL]) ||\n maybeIterable[\"@@iterator\"];\n return \"function\" === typeof maybeIterable ? maybeIterable : null;\n}\nvar ReactNoopUpdateQueue = {\n isMounted: function () {\n return !1;\n },\n enqueueForceUpdate: function () {},\n enqueueReplaceState: function () {},\n enqueueSetState: function () {}\n },\n assign = Object.assign,\n emptyObject = {};\nfunction Component(props, context, updater) {\n this.props = props;\n this.context = context;\n this.refs = emptyObject;\n this.updater = updater || ReactNoopUpdateQueue;\n}\nComponent.prototype.isReactComponent = {};\nComponent.prototype.setState = function (partialState, callback) {\n if (\n \"object\" !== typeof partialState &&\n \"function\" !== typeof partialState &&\n null != partialState\n )\n throw Error(\n \"takes an object of state variables to update or a function which returns an object of state variables.\"\n );\n this.updater.enqueueSetState(this, partialState, callback, \"setState\");\n};\nComponent.prototype.forceUpdate = function (callback) {\n this.updater.enqueueForceUpdate(this, callback, \"forceUpdate\");\n};\nfunction ComponentDummy() {}\nComponentDummy.prototype = Component.prototype;\nfunction PureComponent(props, context, updater) {\n this.props = props;\n this.context = context;\n this.refs = emptyObject;\n this.updater = updater || ReactNoopUpdateQueue;\n}\nvar pureComponentPrototype = (PureComponent.prototype = new ComponentDummy());\npureComponentPrototype.constructor = PureComponent;\nassign(pureComponentPrototype, Component.prototype);\npureComponentPrototype.isPureReactComponent = !0;\nvar isArrayImpl = Array.isArray;\nfunction noop() {}\nvar ReactSharedInternals = { H: null, A: null, T: null, S: null },\n hasOwnProperty = Object.prototype.hasOwnProperty;\nfunction ReactElement(type, key, props) {\n var refProp = props.ref;\n return {\n $$typeof: REACT_ELEMENT_TYPE,\n type: type,\n key: key,\n ref: void 0 !== refProp ? refProp : null,\n props: props\n };\n}\nfunction cloneAndReplaceKey(oldElement, newKey) {\n return ReactElement(oldElement.type, newKey, oldElement.props);\n}\nfunction isValidElement(object) {\n return (\n \"object\" === typeof object &&\n null !== object &&\n object.$$typeof === REACT_ELEMENT_TYPE\n );\n}\nfunction escape(key) {\n var escaperLookup = { \"=\": \"=0\", \":\": \"=2\" };\n return (\n \"$\" +\n key.replace(/[=:]/g, function (match) {\n return escaperLookup[match];\n })\n );\n}\nvar userProvidedKeyEscapeRegex = /\\/+/g;\nfunction getElementKey(element, index) {\n return \"object\" === typeof element && null !== element && null != element.key\n ? escape(\"\" + element.key)\n : index.toString(36);\n}\nfunction resolveThenable(thenable) {\n switch (thenable.status) {\n case \"fulfilled\":\n return thenable.value;\n case \"rejected\":\n throw thenable.reason;\n default:\n switch (\n (\"string\" === typeof thenable.status\n ? thenable.then(noop, noop)\n : ((thenable.status = \"pending\"),\n thenable.then(\n function (fulfilledValue) {\n \"pending\" === thenable.status &&\n ((thenable.status = \"fulfilled\"),\n (thenable.value = fulfilledValue));\n },\n function (error) {\n \"pending\" === thenable.status &&\n ((thenable.status = \"rejected\"), (thenable.reason = error));\n }\n )),\n thenable.status)\n ) {\n case \"fulfilled\":\n return thenable.value;\n case \"rejected\":\n throw thenable.reason;\n }\n }\n throw thenable;\n}\nfunction mapIntoArray(children, array, escapedPrefix, nameSoFar, callback) {\n var type = typeof children;\n if (\"undefined\" === type || \"boolean\" === type) children = null;\n var invokeCallback = !1;\n if (null === children) invokeCallback = !0;\n else\n switch (type) {\n case \"bigint\":\n case \"string\":\n case \"number\":\n invokeCallback = !0;\n break;\n case \"object\":\n switch (children.$$typeof) {\n case REACT_ELEMENT_TYPE:\n case REACT_PORTAL_TYPE:\n invokeCallback = !0;\n break;\n case REACT_LAZY_TYPE:\n return (\n (invokeCallback = children._init),\n mapIntoArray(\n invokeCallback(children._payload),\n array,\n escapedPrefix,\n nameSoFar,\n callback\n )\n );\n }\n }\n if (invokeCallback)\n return (\n (callback = callback(children)),\n (invokeCallback =\n \"\" === nameSoFar ? \".\" + getElementKey(children, 0) : nameSoFar),\n isArrayImpl(callback)\n ? ((escapedPrefix = \"\"),\n null != invokeCallback &&\n (escapedPrefix =\n invokeCallback.replace(userProvidedKeyEscapeRegex, \"$&/\") + \"/\"),\n mapIntoArray(callback, array, escapedPrefix, \"\", function (c) {\n return c;\n }))\n : null != callback &&\n (isValidElement(callback) &&\n (callback = cloneAndReplaceKey(\n callback,\n escapedPrefix +\n (null == callback.key ||\n (children && children.key === callback.key)\n ? \"\"\n : (\"\" + callback.key).replace(\n userProvidedKeyEscapeRegex,\n \"$&/\"\n ) + \"/\") +\n invokeCallback\n )),\n array.push(callback)),\n 1\n );\n invokeCallback = 0;\n var nextNamePrefix = \"\" === nameSoFar ? \".\" : nameSoFar + \":\";\n if (isArrayImpl(children))\n for (var i = 0; i < children.length; i++)\n (nameSoFar = children[i]),\n (type = nextNamePrefix + getElementKey(nameSoFar, i)),\n (invokeCallback += mapIntoArray(\n nameSoFar,\n array,\n escapedPrefix,\n type,\n callback\n ));\n else if (((i = getIteratorFn(children)), \"function\" === typeof i))\n for (\n children = i.call(children), i = 0;\n !(nameSoFar = children.next()).done;\n\n )\n (nameSoFar = nameSoFar.value),\n (type = nextNamePrefix + getElementKey(nameSoFar, i++)),\n (invokeCallback += mapIntoArray(\n nameSoFar,\n array,\n escapedPrefix,\n type,\n callback\n ));\n else if (\"object\" === type) {\n if (\"function\" === typeof children.then)\n return mapIntoArray(\n resolveThenable(children),\n array,\n escapedPrefix,\n nameSoFar,\n callback\n );\n array = String(children);\n throw Error(\n \"Objects are not valid as a React child (found: \" +\n (\"[object Object]\" === array\n ? \"object with keys {\" + Object.keys(children).join(\", \") + \"}\"\n : array) +\n \"). If you meant to render a collection of children, use an array instead.\"\n );\n }\n return invokeCallback;\n}\nfunction mapChildren(children, func, context) {\n if (null == children) return children;\n var result = [],\n count = 0;\n mapIntoArray(children, result, \"\", \"\", function (child) {\n return func.call(context, child, count++);\n });\n return result;\n}\nfunction lazyInitializer(payload) {\n if (-1 === payload._status) {\n var ctor = payload._result;\n ctor = ctor();\n ctor.then(\n function (moduleObject) {\n if (0 === payload._status || -1 === payload._status)\n (payload._status = 1), (payload._result = moduleObject);\n },\n function (error) {\n if (0 === payload._status || -1 === payload._status)\n (payload._status = 2), (payload._result = error);\n }\n );\n -1 === payload._status && ((payload._status = 0), (payload._result = ctor));\n }\n if (1 === payload._status) return payload._result.default;\n throw payload._result;\n}\nvar reportGlobalError =\n \"function\" === typeof reportError\n ? reportError\n : function (error) {\n if (\n \"object\" === typeof window &&\n \"function\" === typeof window.ErrorEvent\n ) {\n var event = new window.ErrorEvent(\"error\", {\n bubbles: !0,\n cancelable: !0,\n message:\n \"object\" === typeof error &&\n null !== error &&\n \"string\" === typeof error.message\n ? String(error.message)\n : String(error),\n error: error\n });\n if (!window.dispatchEvent(event)) return;\n } else if (\n \"object\" === typeof process &&\n \"function\" === typeof process.emit\n ) {\n process.emit(\"uncaughtException\", error);\n return;\n }\n console.error(error);\n },\n Children = {\n map: mapChildren,\n forEach: function (children, forEachFunc, forEachContext) {\n mapChildren(\n children,\n function () {\n forEachFunc.apply(this, arguments);\n },\n forEachContext\n );\n },\n count: function (children) {\n var n = 0;\n mapChildren(children, function () {\n n++;\n });\n return n;\n },\n toArray: function (children) {\n return (\n mapChildren(children, function (child) {\n return child;\n }) || []\n );\n },\n only: function (children) {\n if (!isValidElement(children))\n throw Error(\n \"React.Children.only expected to receive a single React element child.\"\n );\n return children;\n }\n };\nexports.Activity = REACT_ACTIVITY_TYPE;\nexports.Children = Children;\nexports.Component = Component;\nexports.Fragment = REACT_FRAGMENT_TYPE;\nexports.Profiler = REACT_PROFILER_TYPE;\nexports.PureComponent = PureComponent;\nexports.StrictMode = REACT_STRICT_MODE_TYPE;\nexports.Suspense = REACT_SUSPENSE_TYPE;\nexports.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE =\n ReactSharedInternals;\nexports.__COMPILER_RUNTIME = {\n __proto__: null,\n c: function (size) {\n return ReactSharedInternals.H.useMemoCache(size);\n }\n};\nexports.cache = function (fn) {\n return function () {\n return fn.apply(null, arguments);\n };\n};\nexports.cacheSignal = function () {\n return null;\n};\nexports.cloneElement = function (element, config, children) {\n if (null === element || void 0 === element)\n throw Error(\n \"The argument must be a React element, but you passed \" + element + \".\"\n );\n var props = assign({}, element.props),\n key = element.key;\n if (null != config)\n for (propName in (void 0 !== config.key && (key = \"\" + config.key), config))\n !hasOwnProperty.call(config, propName) ||\n \"key\" === propName ||\n \"__self\" === propName ||\n \"__source\" === propName ||\n (\"ref\" === propName && void 0 === config.ref) ||\n (props[propName] = config[propName]);\n var propName = arguments.length - 2;\n if (1 === propName) props.children = children;\n else if (1 < propName) {\n for (var childArray = Array(propName), i = 0; i < propName; i++)\n childArray[i] = arguments[i + 2];\n props.children = childArray;\n }\n return ReactElement(element.type, key, props);\n};\nexports.createContext = function (defaultValue) {\n defaultValue = {\n $$typeof: REACT_CONTEXT_TYPE,\n _currentValue: defaultValue,\n _currentValue2: defaultValue,\n _threadCount: 0,\n Provider: null,\n Consumer: null\n };\n defaultValue.Provider = defaultValue;\n defaultValue.Consumer = {\n $$typeof: REACT_CONSUMER_TYPE,\n _context: defaultValue\n };\n return defaultValue;\n};\nexports.createElement = function (type, config, children) {\n var propName,\n props = {},\n key = null;\n if (null != config)\n for (propName in (void 0 !== config.key && (key = \"\" + config.key), config))\n hasOwnProperty.call(config, propName) &&\n \"key\" !== propName &&\n \"__self\" !== propName &&\n \"__source\" !== propName &&\n (props[propName] = config[propName]);\n var childrenLength = arguments.length - 2;\n if (1 === childrenLength) props.children = children;\n else if (1 < childrenLength) {\n for (var childArray = Array(childrenLength), i = 0; i < childrenLength; i++)\n childArray[i] = arguments[i + 2];\n props.children = childArray;\n }\n if (type && type.defaultProps)\n for (propName in ((childrenLength = type.defaultProps), childrenLength))\n void 0 === props[propName] &&\n (props[propName] = childrenLength[propName]);\n return ReactElement(type, key, props);\n};\nexports.createRef = function () {\n return { current: null };\n};\nexports.forwardRef = function (render) {\n return { $$typeof: REACT_FORWARD_REF_TYPE, render: render };\n};\nexports.isValidElement = isValidElement;\nexports.lazy = function (ctor) {\n return {\n $$typeof: REACT_LAZY_TYPE,\n _payload: { _status: -1, _result: ctor },\n _init: lazyInitializer\n };\n};\nexports.memo = function (type, compare) {\n return {\n $$typeof: REACT_MEMO_TYPE,\n type: type,\n compare: void 0 === compare ? null : compare\n };\n};\nexports.startTransition = function (scope) {\n var prevTransition = ReactSharedInternals.T,\n currentTransition = {};\n ReactSharedInternals.T = currentTransition;\n try {\n var returnValue = scope(),\n onStartTransitionFinish = ReactSharedInternals.S;\n null !== onStartTransitionFinish &&\n onStartTransitionFinish(currentTransition, returnValue);\n \"object\" === typeof returnValue &&\n null !== returnValue &&\n \"function\" === typeof returnValue.then &&\n returnValue.then(noop, reportGlobalError);\n } catch (error) {\n reportGlobalError(error);\n } finally {\n null !== prevTransition &&\n null !== currentTransition.types &&\n (prevTransition.types = currentTransition.types),\n (ReactSharedInternals.T = prevTransition);\n }\n};\nexports.unstable_useCacheRefresh = function () {\n return ReactSharedInternals.H.useCacheRefresh();\n};\nexports.use = function (usable) {\n return ReactSharedInternals.H.use(usable);\n};\nexports.useActionState = function (action, initialState, permalink) {\n return ReactSharedInternals.H.useActionState(action, initialState, permalink);\n};\nexports.useCallback = function (callback, deps) {\n return ReactSharedInternals.H.useCallback(callback, deps);\n};\nexports.useContext = function (Context) {\n return ReactSharedInternals.H.useContext(Context);\n};\nexports.useDebugValue = function () {};\nexports.useDeferredValue = function (value, initialValue) {\n return ReactSharedInternals.H.useDeferredValue(value, initialValue);\n};\nexports.useEffect = function (create, deps) {\n return ReactSharedInternals.H.useEffect(create, deps);\n};\nexports.useEffectEvent = function (callback) {\n return ReactSharedInternals.H.useEffectEvent(callback);\n};\nexports.useId = function () {\n return ReactSharedInternals.H.useId();\n};\nexports.useImperativeHandle = function (ref, create, deps) {\n return ReactSharedInternals.H.useImperativeHandle(ref, create, deps);\n};\nexports.useInsertionEffect = function (create, deps) {\n return ReactSharedInternals.H.useInsertionEffect(create, deps);\n};\nexports.useLayoutEffect = function (create, deps) {\n return ReactSharedInternals.H.useLayoutEffect(create, deps);\n};\nexports.useMemo = function (create, deps) {\n return ReactSharedInternals.H.useMemo(create, deps);\n};\nexports.useOptimistic = function (passthrough, reducer) {\n return ReactSharedInternals.H.useOptimistic(passthrough, reducer);\n};\nexports.useReducer = function (reducer, initialArg, init) {\n return ReactSharedInternals.H.useReducer(reducer, initialArg, init);\n};\nexports.useRef = function (initialValue) {\n return ReactSharedInternals.H.useRef(initialValue);\n};\nexports.useState = function (initialState) {\n return ReactSharedInternals.H.useState(initialState);\n};\nexports.useSyncExternalStore = function (\n subscribe,\n getSnapshot,\n getServerSnapshot\n) {\n return ReactSharedInternals.H.useSyncExternalStore(\n subscribe,\n getSnapshot,\n getServerSnapshot\n );\n};\nexports.useTransition = function () {\n return ReactSharedInternals.H.useTransition();\n};\nexports.version = \"19.2.4\";\n","/**\n * @license React\n * react.development.js\n *\n * Copyright (c) Meta Platforms, Inc. and affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\n\"use strict\";\n\"production\" !== process.env.NODE_ENV &&\n (function () {\n function defineDeprecationWarning(methodName, info) {\n Object.defineProperty(Component.prototype, methodName, {\n get: function () {\n console.warn(\n \"%s(...) is deprecated in plain JavaScript React classes. %s\",\n info[0],\n info[1]\n );\n }\n });\n }\n function getIteratorFn(maybeIterable) {\n if (null === maybeIterable || \"object\" !== typeof maybeIterable)\n return null;\n maybeIterable =\n (MAYBE_ITERATOR_SYMBOL && maybeIterable[MAYBE_ITERATOR_SYMBOL]) ||\n maybeIterable[\"@@iterator\"];\n return \"function\" === typeof maybeIterable ? maybeIterable : null;\n }\n function warnNoop(publicInstance, callerName) {\n publicInstance =\n ((publicInstance = publicInstance.constructor) &&\n (publicInstance.displayName || publicInstance.name)) ||\n \"ReactClass\";\n var warningKey = publicInstance + \".\" + callerName;\n didWarnStateUpdateForUnmountedComponent[warningKey] ||\n (console.error(\n \"Can't call %s on a component that is not yet mounted. This is a no-op, but it might indicate a bug in your application. Instead, assign to `this.state` directly or define a `state = {};` class property with the desired state in the %s component.\",\n callerName,\n publicInstance\n ),\n (didWarnStateUpdateForUnmountedComponent[warningKey] = !0));\n }\n function Component(props, context, updater) {\n this.props = props;\n this.context = context;\n this.refs = emptyObject;\n this.updater = updater || ReactNoopUpdateQueue;\n }\n function ComponentDummy() {}\n function PureComponent(props, context, updater) {\n this.props = props;\n this.context = context;\n this.refs = emptyObject;\n this.updater = updater || ReactNoopUpdateQueue;\n }\n function noop() {}\n function testStringCoercion(value) {\n return \"\" + value;\n }\n function checkKeyStringCoercion(value) {\n try {\n testStringCoercion(value);\n var JSCompiler_inline_result = !1;\n } catch (e) {\n JSCompiler_inline_result = !0;\n }\n if (JSCompiler_inline_result) {\n JSCompiler_inline_result = console;\n var JSCompiler_temp_const = JSCompiler_inline_result.error;\n var JSCompiler_inline_result$jscomp$0 =\n (\"function\" === typeof Symbol &&\n Symbol.toStringTag &&\n value[Symbol.toStringTag]) ||\n value.constructor.name ||\n \"Object\";\n JSCompiler_temp_const.call(\n JSCompiler_inline_result,\n \"The provided key is an unsupported type %s. This value must be coerced to a string before using it here.\",\n JSCompiler_inline_result$jscomp$0\n );\n return testStringCoercion(value);\n }\n }\n function getComponentNameFromType(type) {\n if (null == type) return null;\n if (\"function\" === typeof type)\n return type.$$typeof === REACT_CLIENT_REFERENCE\n ? null\n : type.displayName || type.name || null;\n if (\"string\" === typeof type) return type;\n switch (type) {\n case REACT_FRAGMENT_TYPE:\n return \"Fragment\";\n case REACT_PROFILER_TYPE:\n return \"Profiler\";\n case REACT_STRICT_MODE_TYPE:\n return \"StrictMode\";\n case REACT_SUSPENSE_TYPE:\n return \"Suspense\";\n case REACT_SUSPENSE_LIST_TYPE:\n return \"SuspenseList\";\n case REACT_ACTIVITY_TYPE:\n return \"Activity\";\n }\n if (\"object\" === typeof type)\n switch (\n (\"number\" === typeof type.tag &&\n console.error(\n \"Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue.\"\n ),\n type.$$typeof)\n ) {\n case REACT_PORTAL_TYPE:\n return \"Portal\";\n case REACT_CONTEXT_TYPE:\n return type.displayName || \"Context\";\n case REACT_CONSUMER_TYPE:\n return (type._context.displayName || \"Context\") + \".Consumer\";\n case REACT_FORWARD_REF_TYPE:\n var innerType = type.render;\n type = type.displayName;\n type ||\n ((type = innerType.displayName || innerType.name || \"\"),\n (type = \"\" !== type ? \"ForwardRef(\" + type + \")\" : \"ForwardRef\"));\n return type;\n case REACT_MEMO_TYPE:\n return (\n (innerType = type.displayName || null),\n null !== innerType\n ? innerType\n : getComponentNameFromType(type.type) || \"Memo\"\n );\n case REACT_LAZY_TYPE:\n innerType = type._payload;\n type = type._init;\n try {\n return getComponentNameFromType(type(innerType));\n } catch (x) {}\n }\n return null;\n }\n function getTaskName(type) {\n if (type === REACT_FRAGMENT_TYPE) return \"<>\";\n if (\n \"object\" === typeof type &&\n null !== type &&\n type.$$typeof === REACT_LAZY_TYPE\n )\n return \"<...>\";\n try {\n var name = getComponentNameFromType(type);\n return name ? \"<\" + name + \">\" : \"<...>\";\n } catch (x) {\n return \"<...>\";\n }\n }\n function getOwner() {\n var dispatcher = ReactSharedInternals.A;\n return null === dispatcher ? null : dispatcher.getOwner();\n }\n function UnknownOwner() {\n return Error(\"react-stack-top-frame\");\n }\n function hasValidKey(config) {\n if (hasOwnProperty.call(config, \"key\")) {\n var getter = Object.getOwnPropertyDescriptor(config, \"key\").get;\n if (getter && getter.isReactWarning) return !1;\n }\n return void 0 !== config.key;\n }\n function defineKeyPropWarningGetter(props, displayName) {\n function warnAboutAccessingKey() {\n specialPropKeyWarningShown ||\n ((specialPropKeyWarningShown = !0),\n console.error(\n \"%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://react.dev/link/special-props)\",\n displayName\n ));\n }\n warnAboutAccessingKey.isReactWarning = !0;\n Object.defineProperty(props, \"key\", {\n get: warnAboutAccessingKey,\n configurable: !0\n });\n }\n function elementRefGetterWithDeprecationWarning() {\n var componentName = getComponentNameFromType(this.type);\n didWarnAboutElementRef[componentName] ||\n ((didWarnAboutElementRef[componentName] = !0),\n console.error(\n \"Accessing element.ref was removed in React 19. ref is now a regular prop. It will be removed from the JSX Element type in a future release.\"\n ));\n componentName = this.props.ref;\n return void 0 !== componentName ? componentName : null;\n }\n function ReactElement(type, key, props, owner, debugStack, debugTask) {\n var refProp = props.ref;\n type = {\n $$typeof: REACT_ELEMENT_TYPE,\n type: type,\n key: key,\n props: props,\n _owner: owner\n };\n null !== (void 0 !== refProp ? refProp : null)\n ? Object.defineProperty(type, \"ref\", {\n enumerable: !1,\n get: elementRefGetterWithDeprecationWarning\n })\n : Object.defineProperty(type, \"ref\", { enumerable: !1, value: null });\n type._store = {};\n Object.defineProperty(type._store, \"validated\", {\n configurable: !1,\n enumerable: !1,\n writable: !0,\n value: 0\n });\n Object.defineProperty(type, \"_debugInfo\", {\n configurable: !1,\n enumerable: !1,\n writable: !0,\n value: null\n });\n Object.defineProperty(type, \"_debugStack\", {\n configurable: !1,\n enumerable: !1,\n writable: !0,\n value: debugStack\n });\n Object.defineProperty(type, \"_debugTask\", {\n configurable: !1,\n enumerable: !1,\n writable: !0,\n value: debugTask\n });\n Object.freeze && (Object.freeze(type.props), Object.freeze(type));\n return type;\n }\n function cloneAndReplaceKey(oldElement, newKey) {\n newKey = ReactElement(\n oldElement.type,\n newKey,\n oldElement.props,\n oldElement._owner,\n oldElement._debugStack,\n oldElement._debugTask\n );\n oldElement._store &&\n (newKey._store.validated = oldElement._store.validated);\n return newKey;\n }\n function validateChildKeys(node) {\n isValidElement(node)\n ? node._store && (node._store.validated = 1)\n : \"object\" === typeof node &&\n null !== node &&\n node.$$typeof === REACT_LAZY_TYPE &&\n (\"fulfilled\" === node._payload.status\n ? isValidElement(node._payload.value) &&\n node._payload.value._store &&\n (node._payload.value._store.validated = 1)\n : node._store && (node._store.validated = 1));\n }\n function isValidElement(object) {\n return (\n \"object\" === typeof object &&\n null !== object &&\n object.$$typeof === REACT_ELEMENT_TYPE\n );\n }\n function escape(key) {\n var escaperLookup = { \"=\": \"=0\", \":\": \"=2\" };\n return (\n \"$\" +\n key.replace(/[=:]/g, function (match) {\n return escaperLookup[match];\n })\n );\n }\n function getElementKey(element, index) {\n return \"object\" === typeof element &&\n null !== element &&\n null != element.key\n ? (checkKeyStringCoercion(element.key), escape(\"\" + element.key))\n : index.toString(36);\n }\n function resolveThenable(thenable) {\n switch (thenable.status) {\n case \"fulfilled\":\n return thenable.value;\n case \"rejected\":\n throw thenable.reason;\n default:\n switch (\n (\"string\" === typeof thenable.status\n ? thenable.then(noop, noop)\n : ((thenable.status = \"pending\"),\n thenable.then(\n function (fulfilledValue) {\n \"pending\" === thenable.status &&\n ((thenable.status = \"fulfilled\"),\n (thenable.value = fulfilledValue));\n },\n function (error) {\n \"pending\" === thenable.status &&\n ((thenable.status = \"rejected\"),\n (thenable.reason = error));\n }\n )),\n thenable.status)\n ) {\n case \"fulfilled\":\n return thenable.value;\n case \"rejected\":\n throw thenable.reason;\n }\n }\n throw thenable;\n }\n function mapIntoArray(children, array, escapedPrefix, nameSoFar, callback) {\n var type = typeof children;\n if (\"undefined\" === type || \"boolean\" === type) children = null;\n var invokeCallback = !1;\n if (null === children) invokeCallback = !0;\n else\n switch (type) {\n case \"bigint\":\n case \"string\":\n case \"number\":\n invokeCallback = !0;\n break;\n case \"object\":\n switch (children.$$typeof) {\n case REACT_ELEMENT_TYPE:\n case REACT_PORTAL_TYPE:\n invokeCallback = !0;\n break;\n case REACT_LAZY_TYPE:\n return (\n (invokeCallback = children._init),\n mapIntoArray(\n invokeCallback(children._payload),\n array,\n escapedPrefix,\n nameSoFar,\n callback\n )\n );\n }\n }\n if (invokeCallback) {\n invokeCallback = children;\n callback = callback(invokeCallback);\n var childKey =\n \"\" === nameSoFar ? \".\" + getElementKey(invokeCallback, 0) : nameSoFar;\n isArrayImpl(callback)\n ? ((escapedPrefix = \"\"),\n null != childKey &&\n (escapedPrefix =\n childKey.replace(userProvidedKeyEscapeRegex, \"$&/\") + \"/\"),\n mapIntoArray(callback, array, escapedPrefix, \"\", function (c) {\n return c;\n }))\n : null != callback &&\n (isValidElement(callback) &&\n (null != callback.key &&\n ((invokeCallback && invokeCallback.key === callback.key) ||\n checkKeyStringCoercion(callback.key)),\n (escapedPrefix = cloneAndReplaceKey(\n callback,\n escapedPrefix +\n (null == callback.key ||\n (invokeCallback && invokeCallback.key === callback.key)\n ? \"\"\n : (\"\" + callback.key).replace(\n userProvidedKeyEscapeRegex,\n \"$&/\"\n ) + \"/\") +\n childKey\n )),\n \"\" !== nameSoFar &&\n null != invokeCallback &&\n isValidElement(invokeCallback) &&\n null == invokeCallback.key &&\n invokeCallback._store &&\n !invokeCallback._store.validated &&\n (escapedPrefix._store.validated = 2),\n (callback = escapedPrefix)),\n array.push(callback));\n return 1;\n }\n invokeCallback = 0;\n childKey = \"\" === nameSoFar ? \".\" : nameSoFar + \":\";\n if (isArrayImpl(children))\n for (var i = 0; i < children.length; i++)\n (nameSoFar = children[i]),\n (type = childKey + getElementKey(nameSoFar, i)),\n (invokeCallback += mapIntoArray(\n nameSoFar,\n array,\n escapedPrefix,\n type,\n callback\n ));\n else if (((i = getIteratorFn(children)), \"function\" === typeof i))\n for (\n i === children.entries &&\n (didWarnAboutMaps ||\n console.warn(\n \"Using Maps as children is not supported. Use an array of keyed ReactElements instead.\"\n ),\n (didWarnAboutMaps = !0)),\n children = i.call(children),\n i = 0;\n !(nameSoFar = children.next()).done;\n\n )\n (nameSoFar = nameSoFar.value),\n (type = childKey + getElementKey(nameSoFar, i++)),\n (invokeCallback += mapIntoArray(\n nameSoFar,\n array,\n escapedPrefix,\n type,\n callback\n ));\n else if (\"object\" === type) {\n if (\"function\" === typeof children.then)\n return mapIntoArray(\n resolveThenable(children),\n array,\n escapedPrefix,\n nameSoFar,\n callback\n );\n array = String(children);\n throw Error(\n \"Objects are not valid as a React child (found: \" +\n (\"[object Object]\" === array\n ? \"object with keys {\" + Object.keys(children).join(\", \") + \"}\"\n : array) +\n \"). If you meant to render a collection of children, use an array instead.\"\n );\n }\n return invokeCallback;\n }\n function mapChildren(children, func, context) {\n if (null == children) return children;\n var result = [],\n count = 0;\n mapIntoArray(children, result, \"\", \"\", function (child) {\n return func.call(context, child, count++);\n });\n return result;\n }\n function lazyInitializer(payload) {\n if (-1 === payload._status) {\n var ioInfo = payload._ioInfo;\n null != ioInfo && (ioInfo.start = ioInfo.end = performance.now());\n ioInfo = payload._result;\n var thenable = ioInfo();\n thenable.then(\n function (moduleObject) {\n if (0 === payload._status || -1 === payload._status) {\n payload._status = 1;\n payload._result = moduleObject;\n var _ioInfo = payload._ioInfo;\n null != _ioInfo && (_ioInfo.end = performance.now());\n void 0 === thenable.status &&\n ((thenable.status = \"fulfilled\"),\n (thenable.value = moduleObject));\n }\n },\n function (error) {\n if (0 === payload._status || -1 === payload._status) {\n payload._status = 2;\n payload._result = error;\n var _ioInfo2 = payload._ioInfo;\n null != _ioInfo2 && (_ioInfo2.end = performance.now());\n void 0 === thenable.status &&\n ((thenable.status = \"rejected\"), (thenable.reason = error));\n }\n }\n );\n ioInfo = payload._ioInfo;\n if (null != ioInfo) {\n ioInfo.value = thenable;\n var displayName = thenable.displayName;\n \"string\" === typeof displayName && (ioInfo.name = displayName);\n }\n -1 === payload._status &&\n ((payload._status = 0), (payload._result = thenable));\n }\n if (1 === payload._status)\n return (\n (ioInfo = payload._result),\n void 0 === ioInfo &&\n console.error(\n \"lazy: Expected the result of a dynamic import() call. Instead received: %s\\n\\nYour code should look like: \\n const MyComponent = lazy(() => import('./MyComponent'))\\n\\nDid you accidentally put curly braces around the import?\",\n ioInfo\n ),\n \"default\" in ioInfo ||\n console.error(\n \"lazy: Expected the result of a dynamic import() call. Instead received: %s\\n\\nYour code should look like: \\n const MyComponent = lazy(() => import('./MyComponent'))\",\n ioInfo\n ),\n ioInfo.default\n );\n throw payload._result;\n }\n function resolveDispatcher() {\n var dispatcher = ReactSharedInternals.H;\n null === dispatcher &&\n console.error(\n \"Invalid hook call. Hooks can only be called inside of the body of a function component. This could happen for one of the following reasons:\\n1. You might have mismatching versions of React and the renderer (such as React DOM)\\n2. You might be breaking the Rules of Hooks\\n3. You might have more than one copy of React in the same app\\nSee https://react.dev/link/invalid-hook-call for tips about how to debug and fix this problem.\"\n );\n return dispatcher;\n }\n function releaseAsyncTransition() {\n ReactSharedInternals.asyncTransitions--;\n }\n function enqueueTask(task) {\n if (null === enqueueTaskImpl)\n try {\n var requireString = (\"require\" + Math.random()).slice(0, 7);\n enqueueTaskImpl = (module && module[requireString]).call(\n module,\n \"timers\"\n ).setImmediate;\n } catch (_err) {\n enqueueTaskImpl = function (callback) {\n !1 === didWarnAboutMessageChannel &&\n ((didWarnAboutMessageChannel = !0),\n \"undefined\" === typeof MessageChannel &&\n console.error(\n \"This browser does not have a MessageChannel implementation, so enqueuing tasks via await act(async () => ...) will fail. Please file an issue at https://github.com/facebook/react/issues if you encounter this warning.\"\n ));\n var channel = new MessageChannel();\n channel.port1.onmessage = callback;\n channel.port2.postMessage(void 0);\n };\n }\n return enqueueTaskImpl(task);\n }\n function aggregateErrors(errors) {\n return 1 < errors.length && \"function\" === typeof AggregateError\n ? new AggregateError(errors)\n : errors[0];\n }\n function popActScope(prevActQueue, prevActScopeDepth) {\n prevActScopeDepth !== actScopeDepth - 1 &&\n console.error(\n \"You seem to have overlapping act() calls, this is not supported. Be sure to await previous act() calls before making a new one. \"\n );\n actScopeDepth = prevActScopeDepth;\n }\n function recursivelyFlushAsyncActWork(returnValue, resolve, reject) {\n var queue = ReactSharedInternals.actQueue;\n if (null !== queue)\n if (0 !== queue.length)\n try {\n flushActQueue(queue);\n enqueueTask(function () {\n return recursivelyFlushAsyncActWork(returnValue, resolve, reject);\n });\n return;\n } catch (error) {\n ReactSharedInternals.thrownErrors.push(error);\n }\n else ReactSharedInternals.actQueue = null;\n 0 < ReactSharedInternals.thrownErrors.length\n ? ((queue = aggregateErrors(ReactSharedInternals.thrownErrors)),\n (ReactSharedInternals.thrownErrors.length = 0),\n reject(queue))\n : resolve(returnValue);\n }\n function flushActQueue(queue) {\n if (!isFlushing) {\n isFlushing = !0;\n var i = 0;\n try {\n for (; i < queue.length; i++) {\n var callback = queue[i];\n do {\n ReactSharedInternals.didUsePromise = !1;\n var continuation = callback(!1);\n if (null !== continuation) {\n if (ReactSharedInternals.didUsePromise) {\n queue[i] = callback;\n queue.splice(0, i);\n return;\n }\n callback = continuation;\n } else break;\n } while (1);\n }\n queue.length = 0;\n } catch (error) {\n queue.splice(0, i + 1), ReactSharedInternals.thrownErrors.push(error);\n } finally {\n isFlushing = !1;\n }\n }\n }\n \"undefined\" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ &&\n \"function\" ===\n typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart &&\n __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(Error());\n var REACT_ELEMENT_TYPE = Symbol.for(\"react.transitional.element\"),\n REACT_PORTAL_TYPE = Symbol.for(\"react.portal\"),\n REACT_FRAGMENT_TYPE = Symbol.for(\"react.fragment\"),\n REACT_STRICT_MODE_TYPE = Symbol.for(\"react.strict_mode\"),\n REACT_PROFILER_TYPE = Symbol.for(\"react.profiler\"),\n REACT_CONSUMER_TYPE = Symbol.for(\"react.consumer\"),\n REACT_CONTEXT_TYPE = Symbol.for(\"react.context\"),\n REACT_FORWARD_REF_TYPE = Symbol.for(\"react.forward_ref\"),\n REACT_SUSPENSE_TYPE = Symbol.for(\"react.suspense\"),\n REACT_SUSPENSE_LIST_TYPE = Symbol.for(\"react.suspense_list\"),\n REACT_MEMO_TYPE = Symbol.for(\"react.memo\"),\n REACT_LAZY_TYPE = Symbol.for(\"react.lazy\"),\n REACT_ACTIVITY_TYPE = Symbol.for(\"react.activity\"),\n MAYBE_ITERATOR_SYMBOL = Symbol.iterator,\n didWarnStateUpdateForUnmountedComponent = {},\n ReactNoopUpdateQueue = {\n isMounted: function () {\n return !1;\n },\n enqueueForceUpdate: function (publicInstance) {\n warnNoop(publicInstance, \"forceUpdate\");\n },\n enqueueReplaceState: function (publicInstance) {\n warnNoop(publicInstance, \"replaceState\");\n },\n enqueueSetState: function (publicInstance) {\n warnNoop(publicInstance, \"setState\");\n }\n },\n assign = Object.assign,\n emptyObject = {};\n Object.freeze(emptyObject);\n Component.prototype.isReactComponent = {};\n Component.prototype.setState = function (partialState, callback) {\n if (\n \"object\" !== typeof partialState &&\n \"function\" !== typeof partialState &&\n null != partialState\n )\n throw Error(\n \"takes an object of state variables to update or a function which returns an object of state variables.\"\n );\n this.updater.enqueueSetState(this, partialState, callback, \"setState\");\n };\n Component.prototype.forceUpdate = function (callback) {\n this.updater.enqueueForceUpdate(this, callback, \"forceUpdate\");\n };\n var deprecatedAPIs = {\n isMounted: [\n \"isMounted\",\n \"Instead, make sure to clean up subscriptions and pending requests in componentWillUnmount to prevent memory leaks.\"\n ],\n replaceState: [\n \"replaceState\",\n \"Refactor your code to use setState instead (see https://github.com/facebook/react/issues/3236).\"\n ]\n };\n for (fnName in deprecatedAPIs)\n deprecatedAPIs.hasOwnProperty(fnName) &&\n defineDeprecationWarning(fnName, deprecatedAPIs[fnName]);\n ComponentDummy.prototype = Component.prototype;\n deprecatedAPIs = PureComponent.prototype = new ComponentDummy();\n deprecatedAPIs.constructor = PureComponent;\n assign(deprecatedAPIs, Component.prototype);\n deprecatedAPIs.isPureReactComponent = !0;\n var isArrayImpl = Array.isArray,\n REACT_CLIENT_REFERENCE = Symbol.for(\"react.client.reference\"),\n ReactSharedInternals = {\n H: null,\n A: null,\n T: null,\n S: null,\n actQueue: null,\n asyncTransitions: 0,\n isBatchingLegacy: !1,\n didScheduleLegacyUpdate: !1,\n didUsePromise: !1,\n thrownErrors: [],\n getCurrentStack: null,\n recentlyCreatedOwnerStacks: 0\n },\n hasOwnProperty = Object.prototype.hasOwnProperty,\n createTask = console.createTask\n ? console.createTask\n : function () {\n return null;\n };\n deprecatedAPIs = {\n react_stack_bottom_frame: function (callStackForError) {\n return callStackForError();\n }\n };\n var specialPropKeyWarningShown, didWarnAboutOldJSXRuntime;\n var didWarnAboutElementRef = {};\n var unknownOwnerDebugStack = deprecatedAPIs.react_stack_bottom_frame.bind(\n deprecatedAPIs,\n UnknownOwner\n )();\n var unknownOwnerDebugTask = createTask(getTaskName(UnknownOwner));\n var didWarnAboutMaps = !1,\n userProvidedKeyEscapeRegex = /\\/+/g,\n reportGlobalError =\n \"function\" === typeof reportError\n ? reportError\n : function (error) {\n if (\n \"object\" === typeof window &&\n \"function\" === typeof window.ErrorEvent\n ) {\n var event = new window.ErrorEvent(\"error\", {\n bubbles: !0,\n cancelable: !0,\n message:\n \"object\" === typeof error &&\n null !== error &&\n \"string\" === typeof error.message\n ? String(error.message)\n : String(error),\n error: error\n });\n if (!window.dispatchEvent(event)) return;\n } else if (\n \"object\" === typeof process &&\n \"function\" === typeof process.emit\n ) {\n process.emit(\"uncaughtException\", error);\n return;\n }\n console.error(error);\n },\n didWarnAboutMessageChannel = !1,\n enqueueTaskImpl = null,\n actScopeDepth = 0,\n didWarnNoAwaitAct = !1,\n isFlushing = !1,\n queueSeveralMicrotasks =\n \"function\" === typeof queueMicrotask\n ? function (callback) {\n queueMicrotask(function () {\n return queueMicrotask(callback);\n });\n }\n : enqueueTask;\n deprecatedAPIs = Object.freeze({\n __proto__: null,\n c: function (size) {\n return resolveDispatcher().useMemoCache(size);\n }\n });\n var fnName = {\n map: mapChildren,\n forEach: function (children, forEachFunc, forEachContext) {\n mapChildren(\n children,\n function () {\n forEachFunc.apply(this, arguments);\n },\n forEachContext\n );\n },\n count: function (children) {\n var n = 0;\n mapChildren(children, function () {\n n++;\n });\n return n;\n },\n toArray: function (children) {\n return (\n mapChildren(children, function (child) {\n return child;\n }) || []\n );\n },\n only: function (children) {\n if (!isValidElement(children))\n throw Error(\n \"React.Children.only expected to receive a single React element child.\"\n );\n return children;\n }\n };\n exports.Activity = REACT_ACTIVITY_TYPE;\n exports.Children = fnName;\n exports.Component = Component;\n exports.Fragment = REACT_FRAGMENT_TYPE;\n exports.Profiler = REACT_PROFILER_TYPE;\n exports.PureComponent = PureComponent;\n exports.StrictMode = REACT_STRICT_MODE_TYPE;\n exports.Suspense = REACT_SUSPENSE_TYPE;\n exports.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE =\n ReactSharedInternals;\n exports.__COMPILER_RUNTIME = deprecatedAPIs;\n exports.act = function (callback) {\n var prevActQueue = ReactSharedInternals.actQueue,\n prevActScopeDepth = actScopeDepth;\n actScopeDepth++;\n var queue = (ReactSharedInternals.actQueue =\n null !== prevActQueue ? prevActQueue : []),\n didAwaitActCall = !1;\n try {\n var result = callback();\n } catch (error) {\n ReactSharedInternals.thrownErrors.push(error);\n }\n if (0 < ReactSharedInternals.thrownErrors.length)\n throw (\n (popActScope(prevActQueue, prevActScopeDepth),\n (callback = aggregateErrors(ReactSharedInternals.thrownErrors)),\n (ReactSharedInternals.thrownErrors.length = 0),\n callback)\n );\n if (\n null !== result &&\n \"object\" === typeof result &&\n \"function\" === typeof result.then\n ) {\n var thenable = result;\n queueSeveralMicrotasks(function () {\n didAwaitActCall ||\n didWarnNoAwaitAct ||\n ((didWarnNoAwaitAct = !0),\n console.error(\n \"You called act(async () => ...) without await. This could lead to unexpected testing behaviour, interleaving multiple act calls and mixing their scopes. You should - await act(async () => ...);\"\n ));\n });\n return {\n then: function (resolve, reject) {\n didAwaitActCall = !0;\n thenable.then(\n function (returnValue) {\n popActScope(prevActQueue, prevActScopeDepth);\n if (0 === prevActScopeDepth) {\n try {\n flushActQueue(queue),\n enqueueTask(function () {\n return recursivelyFlushAsyncActWork(\n returnValue,\n resolve,\n reject\n );\n });\n } catch (error$0) {\n ReactSharedInternals.thrownErrors.push(error$0);\n }\n if (0 < ReactSharedInternals.thrownErrors.length) {\n var _thrownError = aggregateErrors(\n ReactSharedInternals.thrownErrors\n );\n ReactSharedInternals.thrownErrors.length = 0;\n reject(_thrownError);\n }\n } else resolve(returnValue);\n },\n function (error) {\n popActScope(prevActQueue, prevActScopeDepth);\n 0 < ReactSharedInternals.thrownErrors.length\n ? ((error = aggregateErrors(\n ReactSharedInternals.thrownErrors\n )),\n (ReactSharedInternals.thrownErrors.length = 0),\n reject(error))\n : reject(error);\n }\n );\n }\n };\n }\n var returnValue$jscomp$0 = result;\n popActScope(prevActQueue, prevActScopeDepth);\n 0 === prevActScopeDepth &&\n (flushActQueue(queue),\n 0 !== queue.length &&\n queueSeveralMicrotasks(function () {\n didAwaitActCall ||\n didWarnNoAwaitAct ||\n ((didWarnNoAwaitAct = !0),\n console.error(\n \"A component suspended inside an `act` scope, but the `act` call was not awaited. When testing React components that depend on asynchronous data, you must await the result:\\n\\nawait act(() => ...)\"\n ));\n }),\n (ReactSharedInternals.actQueue = null));\n if (0 < ReactSharedInternals.thrownErrors.length)\n throw (\n ((callback = aggregateErrors(ReactSharedInternals.thrownErrors)),\n (ReactSharedInternals.thrownErrors.length = 0),\n callback)\n );\n return {\n then: function (resolve, reject) {\n didAwaitActCall = !0;\n 0 === prevActScopeDepth\n ? ((ReactSharedInternals.actQueue = queue),\n enqueueTask(function () {\n return recursivelyFlushAsyncActWork(\n returnValue$jscomp$0,\n resolve,\n reject\n );\n }))\n : resolve(returnValue$jscomp$0);\n }\n };\n };\n exports.cache = function (fn) {\n return function () {\n return fn.apply(null, arguments);\n };\n };\n exports.cacheSignal = function () {\n return null;\n };\n exports.captureOwnerStack = function () {\n var getCurrentStack = ReactSharedInternals.getCurrentStack;\n return null === getCurrentStack ? null : getCurrentStack();\n };\n exports.cloneElement = function (element, config, children) {\n if (null === element || void 0 === element)\n throw Error(\n \"The argument must be a React element, but you passed \" +\n element +\n \".\"\n );\n var props = assign({}, element.props),\n key = element.key,\n owner = element._owner;\n if (null != config) {\n var JSCompiler_inline_result;\n a: {\n if (\n hasOwnProperty.call(config, \"ref\") &&\n (JSCompiler_inline_result = Object.getOwnPropertyDescriptor(\n config,\n \"ref\"\n ).get) &&\n JSCompiler_inline_result.isReactWarning\n ) {\n JSCompiler_inline_result = !1;\n break a;\n }\n JSCompiler_inline_result = void 0 !== config.ref;\n }\n JSCompiler_inline_result && (owner = getOwner());\n hasValidKey(config) &&\n (checkKeyStringCoercion(config.key), (key = \"\" + config.key));\n for (propName in config)\n !hasOwnProperty.call(config, propName) ||\n \"key\" === propName ||\n \"__self\" === propName ||\n \"__source\" === propName ||\n (\"ref\" === propName && void 0 === config.ref) ||\n (props[propName] = config[propName]);\n }\n var propName = arguments.length - 2;\n if (1 === propName) props.children = children;\n else if (1 < propName) {\n JSCompiler_inline_result = Array(propName);\n for (var i = 0; i < propName; i++)\n JSCompiler_inline_result[i] = arguments[i + 2];\n props.children = JSCompiler_inline_result;\n }\n props = ReactElement(\n element.type,\n key,\n props,\n owner,\n element._debugStack,\n element._debugTask\n );\n for (key = 2; key < arguments.length; key++)\n validateChildKeys(arguments[key]);\n return props;\n };\n exports.createContext = function (defaultValue) {\n defaultValue = {\n $$typeof: REACT_CONTEXT_TYPE,\n _currentValue: defaultValue,\n _currentValue2: defaultValue,\n _threadCount: 0,\n Provider: null,\n Consumer: null\n };\n defaultValue.Provider = defaultValue;\n defaultValue.Consumer = {\n $$typeof: REACT_CONSUMER_TYPE,\n _context: defaultValue\n };\n defaultValue._currentRenderer = null;\n defaultValue._currentRenderer2 = null;\n return defaultValue;\n };\n exports.createElement = function (type, config, children) {\n for (var i = 2; i < arguments.length; i++)\n validateChildKeys(arguments[i]);\n i = {};\n var key = null;\n if (null != config)\n for (propName in (didWarnAboutOldJSXRuntime ||\n !(\"__self\" in config) ||\n \"key\" in config ||\n ((didWarnAboutOldJSXRuntime = !0),\n console.warn(\n \"Your app (or one of its dependencies) is using an outdated JSX transform. Update to the modern JSX transform for faster performance: https://react.dev/link/new-jsx-transform\"\n )),\n hasValidKey(config) &&\n (checkKeyStringCoercion(config.key), (key = \"\" + config.key)),\n config))\n hasOwnProperty.call(config, propName) &&\n \"key\" !== propName &&\n \"__self\" !== propName &&\n \"__source\" !== propName &&\n (i[propName] = config[propName]);\n var childrenLength = arguments.length - 2;\n if (1 === childrenLength) i.children = children;\n else if (1 < childrenLength) {\n for (\n var childArray = Array(childrenLength), _i = 0;\n _i < childrenLength;\n _i++\n )\n childArray[_i] = arguments[_i + 2];\n Object.freeze && Object.freeze(childArray);\n i.children = childArray;\n }\n if (type && type.defaultProps)\n for (propName in ((childrenLength = type.defaultProps), childrenLength))\n void 0 === i[propName] && (i[propName] = childrenLength[propName]);\n key &&\n defineKeyPropWarningGetter(\n i,\n \"function\" === typeof type\n ? type.displayName || type.name || \"Unknown\"\n : type\n );\n var propName = 1e4 > ReactSharedInternals.recentlyCreatedOwnerStacks++;\n return ReactElement(\n type,\n key,\n i,\n getOwner(),\n propName ? Error(\"react-stack-top-frame\") : unknownOwnerDebugStack,\n propName ? createTask(getTaskName(type)) : unknownOwnerDebugTask\n );\n };\n exports.createRef = function () {\n var refObject = { current: null };\n Object.seal(refObject);\n return refObject;\n };\n exports.forwardRef = function (render) {\n null != render && render.$$typeof === REACT_MEMO_TYPE\n ? console.error(\n \"forwardRef requires a render function but received a `memo` component. Instead of forwardRef(memo(...)), use memo(forwardRef(...)).\"\n )\n : \"function\" !== typeof render\n ? console.error(\n \"forwardRef requires a render function but was given %s.\",\n null === render ? \"null\" : typeof render\n )\n : 0 !== render.length &&\n 2 !== render.length &&\n console.error(\n \"forwardRef render functions accept exactly two parameters: props and ref. %s\",\n 1 === render.length\n ? \"Did you forget to use the ref parameter?\"\n : \"Any additional parameter will be undefined.\"\n );\n null != render &&\n null != render.defaultProps &&\n console.error(\n \"forwardRef render functions do not support defaultProps. Did you accidentally pass a React component?\"\n );\n var elementType = { $$typeof: REACT_FORWARD_REF_TYPE, render: render },\n ownName;\n Object.defineProperty(elementType, \"displayName\", {\n enumerable: !1,\n configurable: !0,\n get: function () {\n return ownName;\n },\n set: function (name) {\n ownName = name;\n render.name ||\n render.displayName ||\n (Object.defineProperty(render, \"name\", { value: name }),\n (render.displayName = name));\n }\n });\n return elementType;\n };\n exports.isValidElement = isValidElement;\n exports.lazy = function (ctor) {\n ctor = { _status: -1, _result: ctor };\n var lazyType = {\n $$typeof: REACT_LAZY_TYPE,\n _payload: ctor,\n _init: lazyInitializer\n },\n ioInfo = {\n name: \"lazy\",\n start: -1,\n end: -1,\n value: null,\n owner: null,\n debugStack: Error(\"react-stack-top-frame\"),\n debugTask: console.createTask ? console.createTask(\"lazy()\") : null\n };\n ctor._ioInfo = ioInfo;\n lazyType._debugInfo = [{ awaited: ioInfo }];\n return lazyType;\n };\n exports.memo = function (type, compare) {\n null == type &&\n console.error(\n \"memo: The first argument must be a component. Instead received: %s\",\n null === type ? \"null\" : typeof type\n );\n compare = {\n $$typeof: REACT_MEMO_TYPE,\n type: type,\n compare: void 0 === compare ? null : compare\n };\n var ownName;\n Object.defineProperty(compare, \"displayName\", {\n enumerable: !1,\n configurable: !0,\n get: function () {\n return ownName;\n },\n set: function (name) {\n ownName = name;\n type.name ||\n type.displayName ||\n (Object.defineProperty(type, \"name\", { value: name }),\n (type.displayName = name));\n }\n });\n return compare;\n };\n exports.startTransition = function (scope) {\n var prevTransition = ReactSharedInternals.T,\n currentTransition = {};\n currentTransition._updatedFibers = new Set();\n ReactSharedInternals.T = currentTransition;\n try {\n var returnValue = scope(),\n onStartTransitionFinish = ReactSharedInternals.S;\n null !== onStartTransitionFinish &&\n onStartTransitionFinish(currentTransition, returnValue);\n \"object\" === typeof returnValue &&\n null !== returnValue &&\n \"function\" === typeof returnValue.then &&\n (ReactSharedInternals.asyncTransitions++,\n returnValue.then(releaseAsyncTransition, releaseAsyncTransition),\n returnValue.then(noop, reportGlobalError));\n } catch (error) {\n reportGlobalError(error);\n } finally {\n null === prevTransition &&\n currentTransition._updatedFibers &&\n ((scope = currentTransition._updatedFibers.size),\n currentTransition._updatedFibers.clear(),\n 10 < scope &&\n console.warn(\n \"Detected a large number of updates inside startTransition. If this is due to a subscription please re-write it to use React provided hooks. Otherwise concurrent mode guarantees are off the table.\"\n )),\n null !== prevTransition &&\n null !== currentTransition.types &&\n (null !== prevTransition.types &&\n prevTransition.types !== currentTransition.types &&\n console.error(\n \"We expected inner Transitions to have transferred the outer types set and that you cannot add to the outer Transition while inside the inner.This is a bug in React.\"\n ),\n (prevTransition.types = currentTransition.types)),\n (ReactSharedInternals.T = prevTransition);\n }\n };\n exports.unstable_useCacheRefresh = function () {\n return resolveDispatcher().useCacheRefresh();\n };\n exports.use = function (usable) {\n return resolveDispatcher().use(usable);\n };\n exports.useActionState = function (action, initialState, permalink) {\n return resolveDispatcher().useActionState(\n action,\n initialState,\n permalink\n );\n };\n exports.useCallback = function (callback, deps) {\n return resolveDispatcher().useCallback(callback, deps);\n };\n exports.useContext = function (Context) {\n var dispatcher = resolveDispatcher();\n Context.$$typeof === REACT_CONSUMER_TYPE &&\n console.error(\n \"Calling useContext(Context.Consumer) is not supported and will cause bugs. Did you mean to call useContext(Context) instead?\"\n );\n return dispatcher.useContext(Context);\n };\n exports.useDebugValue = function (value, formatterFn) {\n return resolveDispatcher().useDebugValue(value, formatterFn);\n };\n exports.useDeferredValue = function (value, initialValue) {\n return resolveDispatcher().useDeferredValue(value, initialValue);\n };\n exports.useEffect = function (create, deps) {\n null == create &&\n console.warn(\n \"React Hook useEffect requires an effect callback. Did you forget to pass a callback to the hook?\"\n );\n return resolveDispatcher().useEffect(create, deps);\n };\n exports.useEffectEvent = function (callback) {\n return resolveDispatcher().useEffectEvent(callback);\n };\n exports.useId = function () {\n return resolveDispatcher().useId();\n };\n exports.useImperativeHandle = function (ref, create, deps) {\n return resolveDispatcher().useImperativeHandle(ref, create, deps);\n };\n exports.useInsertionEffect = function (create, deps) {\n null == create &&\n console.warn(\n \"React Hook useInsertionEffect requires an effect callback. Did you forget to pass a callback to the hook?\"\n );\n return resolveDispatcher().useInsertionEffect(create, deps);\n };\n exports.useLayoutEffect = function (create, deps) {\n null == create &&\n console.warn(\n \"React Hook useLayoutEffect requires an effect callback. Did you forget to pass a callback to the hook?\"\n );\n return resolveDispatcher().useLayoutEffect(create, deps);\n };\n exports.useMemo = function (create, deps) {\n return resolveDispatcher().useMemo(create, deps);\n };\n exports.useOptimistic = function (passthrough, reducer) {\n return resolveDispatcher().useOptimistic(passthrough, reducer);\n };\n exports.useReducer = function (reducer, initialArg, init) {\n return resolveDispatcher().useReducer(reducer, initialArg, init);\n };\n exports.useRef = function (initialValue) {\n return resolveDispatcher().useRef(initialValue);\n };\n exports.useState = function (initialState) {\n return resolveDispatcher().useState(initialState);\n };\n exports.useSyncExternalStore = function (\n subscribe,\n getSnapshot,\n getServerSnapshot\n ) {\n return resolveDispatcher().useSyncExternalStore(\n subscribe,\n getSnapshot,\n getServerSnapshot\n );\n };\n exports.useTransition = function () {\n return resolveDispatcher().useTransition();\n };\n exports.version = \"19.2.4\";\n \"undefined\" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ &&\n \"function\" ===\n typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop &&\n __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(Error());\n })();\n","'use strict';\n\nif (process.env.NODE_ENV === 'production') {\n module.exports = require('./cjs/react.production.js');\n} else {\n module.exports = require('./cjs/react.development.js');\n}\n","/**\n * @license React\n * react-jsx-runtime.production.js\n *\n * Copyright (c) Meta Platforms, Inc. and affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\n\"use strict\";\nvar REACT_ELEMENT_TYPE = Symbol.for(\"react.transitional.element\"),\n REACT_FRAGMENT_TYPE = Symbol.for(\"react.fragment\");\nfunction jsxProd(type, config, maybeKey) {\n var key = null;\n void 0 !== maybeKey && (key = \"\" + maybeKey);\n void 0 !== config.key && (key = \"\" + config.key);\n if (\"key\" in config) {\n maybeKey = {};\n for (var propName in config)\n \"key\" !== propName && (maybeKey[propName] = config[propName]);\n } else maybeKey = config;\n config = maybeKey.ref;\n return {\n $$typeof: REACT_ELEMENT_TYPE,\n type: type,\n key: key,\n ref: void 0 !== config ? config : null,\n props: maybeKey\n };\n}\nexports.Fragment = REACT_FRAGMENT_TYPE;\nexports.jsx = jsxProd;\nexports.jsxs = jsxProd;\n","/**\n * @license React\n * react-jsx-runtime.development.js\n *\n * Copyright (c) Meta Platforms, Inc. and affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\n\"use strict\";\n\"production\" !== process.env.NODE_ENV &&\n (function () {\n function getComponentNameFromType(type) {\n if (null == type) return null;\n if (\"function\" === typeof type)\n return type.$$typeof === REACT_CLIENT_REFERENCE\n ? null\n : type.displayName || type.name || null;\n if (\"string\" === typeof type) return type;\n switch (type) {\n case REACT_FRAGMENT_TYPE:\n return \"Fragment\";\n case REACT_PROFILER_TYPE:\n return \"Profiler\";\n case REACT_STRICT_MODE_TYPE:\n return \"StrictMode\";\n case REACT_SUSPENSE_TYPE:\n return \"Suspense\";\n case REACT_SUSPENSE_LIST_TYPE:\n return \"SuspenseList\";\n case REACT_ACTIVITY_TYPE:\n return \"Activity\";\n }\n if (\"object\" === typeof type)\n switch (\n (\"number\" === typeof type.tag &&\n console.error(\n \"Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue.\"\n ),\n type.$$typeof)\n ) {\n case REACT_PORTAL_TYPE:\n return \"Portal\";\n case REACT_CONTEXT_TYPE:\n return type.displayName || \"Context\";\n case REACT_CONSUMER_TYPE:\n return (type._context.displayName || \"Context\") + \".Consumer\";\n case REACT_FORWARD_REF_TYPE:\n var innerType = type.render;\n type = type.displayName;\n type ||\n ((type = innerType.displayName || innerType.name || \"\"),\n (type = \"\" !== type ? \"ForwardRef(\" + type + \")\" : \"ForwardRef\"));\n return type;\n case REACT_MEMO_TYPE:\n return (\n (innerType = type.displayName || null),\n null !== innerType\n ? innerType\n : getComponentNameFromType(type.type) || \"Memo\"\n );\n case REACT_LAZY_TYPE:\n innerType = type._payload;\n type = type._init;\n try {\n return getComponentNameFromType(type(innerType));\n } catch (x) {}\n }\n return null;\n }\n function testStringCoercion(value) {\n return \"\" + value;\n }\n function checkKeyStringCoercion(value) {\n try {\n testStringCoercion(value);\n var JSCompiler_inline_result = !1;\n } catch (e) {\n JSCompiler_inline_result = !0;\n }\n if (JSCompiler_inline_result) {\n JSCompiler_inline_result = console;\n var JSCompiler_temp_const = JSCompiler_inline_result.error;\n var JSCompiler_inline_result$jscomp$0 =\n (\"function\" === typeof Symbol &&\n Symbol.toStringTag &&\n value[Symbol.toStringTag]) ||\n value.constructor.name ||\n \"Object\";\n JSCompiler_temp_const.call(\n JSCompiler_inline_result,\n \"The provided key is an unsupported type %s. This value must be coerced to a string before using it here.\",\n JSCompiler_inline_result$jscomp$0\n );\n return testStringCoercion(value);\n }\n }\n function getTaskName(type) {\n if (type === REACT_FRAGMENT_TYPE) return \"<>\";\n if (\n \"object\" === typeof type &&\n null !== type &&\n type.$$typeof === REACT_LAZY_TYPE\n )\n return \"<...>\";\n try {\n var name = getComponentNameFromType(type);\n return name ? \"<\" + name + \">\" : \"<...>\";\n } catch (x) {\n return \"<...>\";\n }\n }\n function getOwner() {\n var dispatcher = ReactSharedInternals.A;\n return null === dispatcher ? null : dispatcher.getOwner();\n }\n function UnknownOwner() {\n return Error(\"react-stack-top-frame\");\n }\n function hasValidKey(config) {\n if (hasOwnProperty.call(config, \"key\")) {\n var getter = Object.getOwnPropertyDescriptor(config, \"key\").get;\n if (getter && getter.isReactWarning) return !1;\n }\n return void 0 !== config.key;\n }\n function defineKeyPropWarningGetter(props, displayName) {\n function warnAboutAccessingKey() {\n specialPropKeyWarningShown ||\n ((specialPropKeyWarningShown = !0),\n console.error(\n \"%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://react.dev/link/special-props)\",\n displayName\n ));\n }\n warnAboutAccessingKey.isReactWarning = !0;\n Object.defineProperty(props, \"key\", {\n get: warnAboutAccessingKey,\n configurable: !0\n });\n }\n function elementRefGetterWithDeprecationWarning() {\n var componentName = getComponentNameFromType(this.type);\n didWarnAboutElementRef[componentName] ||\n ((didWarnAboutElementRef[componentName] = !0),\n console.error(\n \"Accessing element.ref was removed in React 19. ref is now a regular prop. It will be removed from the JSX Element type in a future release.\"\n ));\n componentName = this.props.ref;\n return void 0 !== componentName ? componentName : null;\n }\n function ReactElement(type, key, props, owner, debugStack, debugTask) {\n var refProp = props.ref;\n type = {\n $$typeof: REACT_ELEMENT_TYPE,\n type: type,\n key: key,\n props: props,\n _owner: owner\n };\n null !== (void 0 !== refProp ? refProp : null)\n ? Object.defineProperty(type, \"ref\", {\n enumerable: !1,\n get: elementRefGetterWithDeprecationWarning\n })\n : Object.defineProperty(type, \"ref\", { enumerable: !1, value: null });\n type._store = {};\n Object.defineProperty(type._store, \"validated\", {\n configurable: !1,\n enumerable: !1,\n writable: !0,\n value: 0\n });\n Object.defineProperty(type, \"_debugInfo\", {\n configurable: !1,\n enumerable: !1,\n writable: !0,\n value: null\n });\n Object.defineProperty(type, \"_debugStack\", {\n configurable: !1,\n enumerable: !1,\n writable: !0,\n value: debugStack\n });\n Object.defineProperty(type, \"_debugTask\", {\n configurable: !1,\n enumerable: !1,\n writable: !0,\n value: debugTask\n });\n Object.freeze && (Object.freeze(type.props), Object.freeze(type));\n return type;\n }\n function jsxDEVImpl(\n type,\n config,\n maybeKey,\n isStaticChildren,\n debugStack,\n debugTask\n ) {\n var children = config.children;\n if (void 0 !== children)\n if (isStaticChildren)\n if (isArrayImpl(children)) {\n for (\n isStaticChildren = 0;\n isStaticChildren < children.length;\n isStaticChildren++\n )\n validateChildKeys(children[isStaticChildren]);\n Object.freeze && Object.freeze(children);\n } else\n console.error(\n \"React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.\"\n );\n else validateChildKeys(children);\n if (hasOwnProperty.call(config, \"key\")) {\n children = getComponentNameFromType(type);\n var keys = Object.keys(config).filter(function (k) {\n return \"key\" !== k;\n });\n isStaticChildren =\n 0 < keys.length\n ? \"{key: someKey, \" + keys.join(\": ..., \") + \": ...}\"\n : \"{key: someKey}\";\n didWarnAboutKeySpread[children + isStaticChildren] ||\n ((keys =\n 0 < keys.length ? \"{\" + keys.join(\": ..., \") + \": ...}\" : \"{}\"),\n console.error(\n 'A props object containing a \"key\" prop is being spread into JSX:\\n let props = %s;\\n <%s {...props} />\\nReact keys must be passed directly to JSX without using spread:\\n let props = %s;\\n <%s key={someKey} {...props} />',\n isStaticChildren,\n children,\n keys,\n children\n ),\n (didWarnAboutKeySpread[children + isStaticChildren] = !0));\n }\n children = null;\n void 0 !== maybeKey &&\n (checkKeyStringCoercion(maybeKey), (children = \"\" + maybeKey));\n hasValidKey(config) &&\n (checkKeyStringCoercion(config.key), (children = \"\" + config.key));\n if (\"key\" in config) {\n maybeKey = {};\n for (var propName in config)\n \"key\" !== propName && (maybeKey[propName] = config[propName]);\n } else maybeKey = config;\n children &&\n defineKeyPropWarningGetter(\n maybeKey,\n \"function\" === typeof type\n ? type.displayName || type.name || \"Unknown\"\n : type\n );\n return ReactElement(\n type,\n children,\n maybeKey,\n getOwner(),\n debugStack,\n debugTask\n );\n }\n function validateChildKeys(node) {\n isValidElement(node)\n ? node._store && (node._store.validated = 1)\n : \"object\" === typeof node &&\n null !== node &&\n node.$$typeof === REACT_LAZY_TYPE &&\n (\"fulfilled\" === node._payload.status\n ? isValidElement(node._payload.value) &&\n node._payload.value._store &&\n (node._payload.value._store.validated = 1)\n : node._store && (node._store.validated = 1));\n }\n function isValidElement(object) {\n return (\n \"object\" === typeof object &&\n null !== object &&\n object.$$typeof === REACT_ELEMENT_TYPE\n );\n }\n var React = require(\"react\"),\n REACT_ELEMENT_TYPE = Symbol.for(\"react.transitional.element\"),\n REACT_PORTAL_TYPE = Symbol.for(\"react.portal\"),\n REACT_FRAGMENT_TYPE = Symbol.for(\"react.fragment\"),\n REACT_STRICT_MODE_TYPE = Symbol.for(\"react.strict_mode\"),\n REACT_PROFILER_TYPE = Symbol.for(\"react.profiler\"),\n REACT_CONSUMER_TYPE = Symbol.for(\"react.consumer\"),\n REACT_CONTEXT_TYPE = Symbol.for(\"react.context\"),\n REACT_FORWARD_REF_TYPE = Symbol.for(\"react.forward_ref\"),\n REACT_SUSPENSE_TYPE = Symbol.for(\"react.suspense\"),\n REACT_SUSPENSE_LIST_TYPE = Symbol.for(\"react.suspense_list\"),\n REACT_MEMO_TYPE = Symbol.for(\"react.memo\"),\n REACT_LAZY_TYPE = Symbol.for(\"react.lazy\"),\n REACT_ACTIVITY_TYPE = Symbol.for(\"react.activity\"),\n REACT_CLIENT_REFERENCE = Symbol.for(\"react.client.reference\"),\n ReactSharedInternals =\n React.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,\n hasOwnProperty = Object.prototype.hasOwnProperty,\n isArrayImpl = Array.isArray,\n createTask = console.createTask\n ? console.createTask\n : function () {\n return null;\n };\n React = {\n react_stack_bottom_frame: function (callStackForError) {\n return callStackForError();\n }\n };\n var specialPropKeyWarningShown;\n var didWarnAboutElementRef = {};\n var unknownOwnerDebugStack = React.react_stack_bottom_frame.bind(\n React,\n UnknownOwner\n )();\n var unknownOwnerDebugTask = createTask(getTaskName(UnknownOwner));\n var didWarnAboutKeySpread = {};\n exports.Fragment = REACT_FRAGMENT_TYPE;\n exports.jsx = function (type, config, maybeKey) {\n var trackActualOwner =\n 1e4 > ReactSharedInternals.recentlyCreatedOwnerStacks++;\n return jsxDEVImpl(\n type,\n config,\n maybeKey,\n !1,\n trackActualOwner\n ? Error(\"react-stack-top-frame\")\n : unknownOwnerDebugStack,\n trackActualOwner ? createTask(getTaskName(type)) : unknownOwnerDebugTask\n );\n };\n exports.jsxs = function (type, config, maybeKey) {\n var trackActualOwner =\n 1e4 > ReactSharedInternals.recentlyCreatedOwnerStacks++;\n return jsxDEVImpl(\n type,\n config,\n maybeKey,\n !0,\n trackActualOwner\n ? Error(\"react-stack-top-frame\")\n : unknownOwnerDebugStack,\n trackActualOwner ? createTask(getTaskName(type)) : unknownOwnerDebugTask\n );\n };\n })();\n","'use strict';\n\nif (process.env.NODE_ENV === 'production') {\n module.exports = require('./cjs/react-jsx-runtime.production.js');\n} else {\n module.exports = require('./cjs/react-jsx-runtime.development.js');\n}\n","import PixodeskSvgAnimator from './PixodeskSvgAnimator';\nexport { PixodeskSvgAnimator as PixodeskSvgAnimator };\nexport type { ReactAnimatorApi } from './PixodeskSvgAnimator';","/*---------------------------------------------------------------------------------------\n * Copyright (c) Pixodesk LTD.\n * Licensed under the MIT License. See the LICENSE file in the project root for details.\n *---------------------------------------------------------------------------------------*/\n\nimport type { PxBezierPath } from './PxAnimatorTypes';\n\n\n/**\n * Converts a PxBezierPath to an SVG path string.\n * Control points (i, o) are treated as ABSOLUTE coordinates.\n * @param {PxBezierPath} path\n * @returns {string}\n */\nexport function bezierToSvgPath(path: PxBezierPath): string {\n const v = path.v;\n const i = path.i;\n const o = path.o;\n const c = path.c;\n\n if (!v.length) return \"\";\n\n const d: Array<string> = [];\n const len = v.length;\n d.push(\"M\" + v[0][0] + \",\" + v[0][1]);\n\n for (let idx = 1; idx < len; idx++) {\n const prevV = v[idx - 1];\n const prevO = o?.[idx - 1] ?? prevV;\n const currI = i?.[idx] ?? v[idx];\n const currV = v[idx];\n\n // Check if it's a straight line (control points coincide with vertices)\n const isLine = (prevO[0] === prevV[0] && prevO[1] === prevV[1]) &&\n (currI[0] === currV[0] && currI[1] === currV[1]);\n\n if (isLine) {\n d.push(\"L\" + currV[0] + \",\" + currV[1]);\n } else {\n // Control points are absolute coordinates\n d.push(\"C\" + prevO[0] + \",\" + prevO[1] + \",\" + currI[0] + \",\" + currI[1] + \",\" + currV[0] + \",\" + currV[1]);\n }\n }\n\n if (c && len > 0) {\n const lastV = v[len - 1];\n const lastO = o?.[len - 1] ?? lastV;\n const firstI = i?.[0] ?? v[0];\n const firstV = v[0];\n\n // Check if closing segment is a straight line\n const isLine = (lastO[0] === lastV[0] && lastO[1] === lastV[1]) &&\n (firstI[0] === firstV[0] && firstI[1] === firstV[1]);\n\n if (!isLine) {\n d.push(\"C\" + lastO[0] + \",\" + lastO[1] + \",\" + firstI[0] + \",\" + firstI[1] + \",\" + firstV[0] + \",\" + firstV[1]);\n }\n\n d.push(\"z\");\n }\n\n return d.join(\"\");\n}\n\n/**\n * @param {number} a \n * @param {number} b \n * @param {number} t \n * @returns {number}\n */\nexport function interpolateNum(a: number, b: number, t: number): number {\n return a + (b - a) * t;\n}\n\n\n/**\n * @param {Array<number>} a \n * @param {Array<number>} b \n * @param {number} t \n * @returns {Array<number>}\n */\nexport function interpolateVec(a: Array<number>, b: Array<number>, t: number): Array<number> {\n const res: Array<number> = [];\n const count = Math.max(a.length, b.length);\n for (let i = 0; i < count; i++) {\n res[i] = interpolateNum(a[i] || 0, b[i] || 0, t);\n }\n return res;\n}\n\n/**\n * Interpolates between two color arrays [r, g, b] or [r, g, b, a].\n * Normalizes both colors to 4 elements, defaulting alpha to 1 if missing.\n */\nexport function interpolateColor(a: Array<number>, b: Array<number>, t: number): Array<number> {\n return [\n interpolateNum(a[0] || 0, b[0] || 0, t),\n interpolateNum(a[1] || 0, b[1] || 0, t),\n interpolateNum(a[2] || 0, b[2] || 0, t),\n interpolateNum(a[3] === undefined ? 1 : a[3], b[3] === undefined ? 1 : b[3], t)\n ];\n}\n\n/**\n * Interpolates between two arrays of bezier paths.\n * @param paths1 The starting array of paths.\n * @param paths2 The ending array of paths.\n * @param progress The interpolation progress from 0.0 to 1.0.\n */\nexport function interpolateBeziers(\n paths1: Array<PxBezierPath>,\n paths2: Array<PxBezierPath>,\n progress: number\n): Array<PxBezierPath> {\n const count = Math.max(paths1.length, paths2.length);\n const res: Array<PxBezierPath> = [];\n for (let i = 0; i < count; i++) {\n res.push(interpolateBezier(paths1[i], paths2[i], progress));\n }\n return res;\n}\n\n/**\n * Interpolates between two bezier paths.\n * Control points (i, o) are treated as ABSOLUTE coordinates.\n * When control points are missing, they default to the vertex position.\n * @param {PxBezierPath} path1\n * @param {PxBezierPath} path2\n * @param {number} progress\n * @returns {PxBezierPath}\n */\nexport function interpolateBezier(\n path1: PxBezierPath | undefined,\n path2: PxBezierPath | undefined,\n progress: number\n): PxBezierPath {\n if (!path1 || !path2) return path1 || path2 || { v: [] };\n\n const t = Math.min(Math.max(progress, 0), 1);\n const len = Math.min(path1.v.length, path2.v.length);\n\n const v: Array<Array<number>> = [];\n const i: Array<Array<number>> = [];\n const o: Array<Array<number>> = [];\n\n for (let idx = 0; idx < len; idx++) {\n const v1 = path1.v[idx];\n const v2 = path2.v[idx];\n v.push(interpolateVec(v1, v2, t));\n\n // For absolute control points, default to vertex position (straight line)\n const i1 = path1.i?.[idx] ?? v1;\n const i2 = path2.i?.[idx] ?? v2;\n i.push(interpolateVec(i1, i2, t));\n\n const o1 = path1.o?.[idx] ?? v1;\n const o2 = path2.o?.[idx] ?? v2;\n o.push(interpolateVec(o1, o2, t));\n }\n\n return { v, i: i.length ? i : undefined, o: o.length ? o : undefined, c: path1.c ?? path2.c };\n}\n\n\n/**\n * Remap a number from one range to another.\n *\n * @param {number} value - The input value.\n * @param {number} inMin - Lower bound of the input range.\n * @param {number} inMax - Upper bound of the input range.\n * @param {number} outMin - Lower bound of the output range.\n * @param {number} outMax - Upper bound of the output range.\n * @returns The remapped value.\n */\nexport function remap(\n value: number,\n inMin: number,\n inMax: number,\n outMin: number,\n outMax: number\n): number {\n if (inMax === inMin) return outMin; // avoid divide-by-zero\n const t = (value - inMin) / (inMax - inMin);\n return outMin + t * (outMax - outMin);\n}\n\n/**\n * Creates a cubic-bezier easing function.\n * @param easing An array of four numbers [x1, y1, x2, y2] defining the bezier curve.\n * @returns A function that takes a progress value (0-1) and returns an eased value.\n */\nexport function cubicBezier(easing: [number, number, number, number]) {\n const [p1x, p1y, p2x, p2y] = easing;\n\n const cx = 3 * p1x;\n const bx = 3 * (p2x - p1x) - cx;\n const ax = 1 - cx - bx;\n const cy = 3 * p1y;\n const by = 3 * (p2y - p1y) - cy;\n const ay = 1 - cy - by;\n\n function sampleCurveX(t: number) { return ((ax * t + bx) * t + cx) * t; }\n function sampleCurveY(t: number) { return ((ay * t + by) * t + cy) * t; }\n function sampleCurveDerivativeX(t: number) { return (3 * ax * t + 2 * bx) * t + cx; }\n\n function solveCurveX(x: number) {\n // Handle edge cases\n if (x <= 0) return 0;\n if (x >= 1) return 1;\n\n // Use binary search as fallback when derivative is too small\n let t2 = x;\n let t0 = 0;\n let t1 = 1;\n\n // Try Newton-Raphson first\n for (let i = 0; i < 8; i++) {\n const x2 = sampleCurveX(t2) - x;\n if (Math.abs(x2) < 1e-6) return t2;\n\n const d2 = sampleCurveDerivativeX(t2);\n if (Math.abs(d2) < 1e-6) break; // Derivative too small, switch to bisection\n\n t2 -= x2 / d2;\n }\n\n // Fallback to binary search, e.g. solves such easings as [0, 0, 0, 1]\n t2 = x;\n while (t0 < t1) {\n const x2 = sampleCurveX(t2);\n if (Math.abs(x2 - x) < 1e-6) return t2;\n if (x > x2) t0 = t2;\n else t1 = t2;\n t2 = (t1 + t0) / 2;\n }\n\n return t2;\n }\n\n return function (x: number) {\n return sampleCurveY(solveCurveX(x));\n };\n}\n\n/**\n * Converts a color from a [r, g, b, a] array (where values are 0-1) to an rgba() or rgb() CSS string.\n * @param color The color array.\n */\nexport function toRGBA(color: Array<number>): string {\n const r = Math.round(color[0] * 255);\n const g = Math.round(color[1] * 255);\n const b = Math.round(color[2] * 255);\n return color.length === 4 ?\n 'rgba(' + r + ',' + g + ',' + b + ',' + color[3] + ')' :\n 'rgb(' + r + ',' + g + ',' + b + ')';\n}\n\n/** Parse rgb/rgba string to normalized array */\nexport function parseRgba(s: string): number[] {\n const inner = s.match(/rgba?\\((.*)\\)/)?.[1];\n if (!inner) throw new Error('Invalid rgb/rgba format');\n const parts = inner.split(',').map(v => +v.trim());\n return [parts[0] / 255, parts[1] / 255, parts[2] / 255, ...(parts[3] !== undefined ? [parts[3]] : [])];\n}\n\n/** Parse hex string to normalized array (#RGB, #RGBA, #RRGGBB, #RRGGBBAA) */\nfunction parseHex(s: string): number[] {\n const hex = s.slice(1); // Remove '#'\n const isShort = hex.length <= 4; // #RGB or #RGBA vs #RRGGBB or #RRGGBBAA\n\n const r = isShort ? hex[0] + hex[0] : hex.slice(0, 2);\n const g = isShort ? hex[1] + hex[1] : hex.slice(2, 4);\n const b = isShort ? hex[2] + hex[2] : hex.slice(4, 6);\n const a = hex.length === 4 ? hex[3] + hex[3] : hex.length === 8 ? hex.slice(6, 8) : null;\n\n const result = [\n parseInt(r, 16) / 255,\n parseInt(g, 16) / 255,\n parseInt(b, 16) / 255\n ];\n\n if (a !== null) {\n result.push(parseInt(a, 16) / 255);\n }\n\n return result;\n}\n\n//// FIXME - support normalisation of config from different formats\n/** Parse color string (hex or rgb/rgba) to normalized [r, g, b] or [r, g, b, a] array (0-1 range) */\nexport function parseColor(s: any): number[] | undefined {\n if (!s) return undefined;\n if (Array.isArray(s)) return s;\n if (typeof s !== 'string') return undefined;\n if (s.startsWith('#')) {\n return parseHex(s);\n } else if (s.startsWith('rgb')) {\n return parseRgba(s);\n } else {\n // FIXME - come up with some solution how to report errors...\n console.warn('Unsupported color format: ' + s);\n }\n return undefined;\n}\n\nexport const COLOUR_ATTR_NAMES = new Set([\"color\", \"fill\", \"flood-color\", \"lighting-color\", \"stop-color\", \"stroke\"]);\nexport const TRANSFORM_FN_NAMES = new Set([\"translate\", \"rotate\", \"scale\", \"skew\"]);\nexport const PCT_BASED_ATTR_NAMES = new Set([\"offset-distance\", \"offsetDistance\"]);\nexport const STYLE_ATTR_NAMES = new Set([\"offset-distance\", \"offsetDistance\"]); // Props that need to go to style\nexport const DEFAULT_DURATION_MS = 1000;\n\n/**\n * Converts a kebab-case string to camelCase.\n * @param kebab The kebab-case string.\n */\nexport function kebabToCamelCaseWord(kebab: string): string {\n return kebab.includes('-') ? kebab.replace(/-([a-z])/g, (_, letter) => letter.toUpperCase()) : kebab;\n}\n\n/**\n * Checks if a string is in camelCase.\n * @param word The string to check.\n */\nexport function isCamelCaseWord(word: string): boolean {\n return !word.includes('-') && /[a-z][A-Z]/.test(word);\n}\n\n// FIXME - docs, rename?\nconst SVG_CAMEL_CASE_ATTRS = new Set([\n // Transform/positioning\n 'viewBox',\n 'preserveAspectRatio',\n\n // Gradient\n 'gradientUnits',\n 'gradientTransform',\n 'spreadMethod',\n\n // Pattern\n 'patternUnits',\n 'patternContentUnits',\n 'patternTransform',\n\n // Clipping/masking\n 'clipPathUnits',\n 'maskUnits',\n 'maskContentUnits',\n\n // Text\n 'textLength',\n 'lengthAdjust',\n 'startOffset',\n\n // Filter\n 'filterUnits',\n 'primitiveUnits',\n 'stdDeviation',\n 'baseFrequency',\n 'numOctaves',\n 'surfaceScale',\n 'diffuseConstant',\n 'specularConstant',\n 'specularExponent',\n 'kernelMatrix',\n 'kernelUnitLength',\n 'edgeMode',\n 'preserveAlpha',\n 'targetX',\n 'targetY',\n\n // // Animation\n // 'attributeName',\n // 'attributeType',\n // 'calcMode',\n // 'keyTimes',\n // 'keySplines',\n // 'repeatCount',\n // 'repeatDur' \n]);\n\n/**\n * Converts a camelCase string to kebab-case.\n * @param camel The camelCase string.\n */\nexport function camelCaseToKebabWordIfNeeded(camel: string): string { // FIXME - docs, rename function?\n return SVG_CAMEL_CASE_ATTRS.has(camel) ?\n camel :\n camel.replace(/([a-z0-9])([A-Z])/g, '$1-$2').toLowerCase();\n}\n\n/**\n * Checks if a CSS property is set inline on an element's style.\n * \n * @param {!CSSStyleDeclaration} style - element.style (CSSStyleDeclaration)\n * @param {string} propName - property name (camelCase or kebab-case)\n * @return {boolean}\n */\nexport function hasStyleProp(\n style: CSSStyleDeclaration,\n propName: string\n): boolean {\n return style.getPropertyValue(propName) !== '';\n}\n\n/**\n * Clamps a number between a minimum and maximum value.\n * @param value The number to clamp.\n * @param min The minimum value.\n * @param max The maximum value.\n */\nexport function clamp(value: number, min: number, max: number): number {\n return Math.max(min, Math.min(value, max));\n}","/*---------------------------------------------------------------------------------------\n * Copyright (c) Pixodesk LTD.\n * Licensed under the MIT License. See the LICENSE file in the project root for details.\n *---------------------------------------------------------------------------------------*/\n\nimport type { PxDefs, PxNode } from './PxAnimatorTypes';\nimport { camelCaseToKebabWordIfNeeded, COLOUR_ATTR_NAMES, toRGBA, TRANSFORM_FN_NAMES } from './PxAnimatorUtil';\n\n\nconst SVG_NS = 'http://www.w3.org/2000/svg';\n\n// FIXME - do we need this?\n// Attributes that should not be set on DOM elements (internal use only)\nconst INTERNAL_ATTRS = new Set(['type', 'children', 'animate', 'style', 'animator', 'defs', 'bindings']);\n\nfunction createElement(\n tagName: string,\n props: { [k: string]: string },\n style?: Record<string, string | number>,\n children?: Array<Element>\n) {\n const element = document.createElementNS(SVG_NS, tagName);\n\n for (const propName in props) {\n element.setAttribute(camelCaseToKebabWordIfNeeded(propName), props[propName]);\n }\n\n // Apply style properties directly (avoids kebab-case issues)\n if (style) {\n for (const styleProp in style) {\n (element as any).style[styleProp] = String(style[styleProp]);\n }\n }\n\n if (children) {\n for (const child of children) {\n element.appendChild(child);\n }\n }\n\n return element;\n}\n\n\n/** FIXME - do we need this?\n * Resolves a style reference to an actual style object.\n */\nfunction resolveStyle(\n style: string | Record<string, string | number> | undefined,\n defs?: PxDefs\n): Record<string, string | number> | undefined {\n if (!style) return undefined;\n\n if (typeof style === 'string') {\n // Look up named style in defs\n return defs?.styles?.[style];\n }\n\n return style;\n}\n\n\nexport function getNormalizedProps(props: Record<string, any>) {\n const propsCopy: Record<string, any> = {};\n\n // Process regular attributes\n for (const key of Object.keys(props)) {\n if (INTERNAL_ATTRS.has(key)) continue;\n\n let value = props[key];\n\n if (COLOUR_ATTR_NAMES.has(key) && Array.isArray(value)) {\n propsCopy[key] = toRGBA(value);\n } else if (TRANSFORM_FN_NAMES.has(key)) {\n if (Array.isArray(value)) {\n if (key === 'translate') value = value.map((v: number) => v + 'px');\n value = value.join(',');\n }\n if (key === 'rotate') value = value + 'deg';\n propsCopy['transform'] = key + '(' + value + ')';\n } else if (value !== undefined && value !== null) {\n propsCopy[key] = String(value);\n }\n }\n\n return propsCopy;\n}\n\n/**\n * Renders a PxNode tree to DOM elements.\n */\nexport function renderNode(node: PxNode, defs?: PxDefs): Element | null {\n if (!node) return null;\n\n const { type, children, animate, style, ...props } = node;\n\n // Extract defs from root svg node\n const nodeDefs = (node as any).defs || defs;\n\n // Resolve style reference\n const resolvedStyle = resolveStyle(style, nodeDefs);\n\n // Process children\n let childElements: Array<Element> | undefined;\n if (children) {\n for (const ch of children) {\n const child = renderNode(ch, nodeDefs);\n if (child) {\n if (!childElements) childElements = [];\n childElements.push(child);\n }\n }\n }\n\n return createElement(\n type || 'g',\n getNormalizedProps(props),\n resolvedStyle,\n childElements\n );\n}\n","/*---------------------------------------------------------------------------------------\n * Copyright (c) Pixodesk LTD.\n * Licensed under the MIT License. See the LICENSE file in the project root for details.\n *---------------------------------------------------------------------------------------*/\n\nimport type { PxAnimatorAPI, PxTrigger } from './PxAnimatorTypes';\n\n\n/**\n * Sets up event-based triggers for an animation.\n *\n * This function attaches event listeners to the animation's root element based on the\n * provided configuration, allowing animations to be started by user interactions\n * or visibility changes.\n *\n * ### Trigger Options (startOn):\n * - 'load': Starts after the page loads.\n * - 'mouseOver': Starts on mouse enter.\n * - 'click': Toggles play/end action on click.\n * - 'scrollIntoView': Starts when the element scrolls into the viewport.\n * - 'programmatic': No automatic start. Must be controlled via the API.\n *\n * ### End Action Options (outAction):\n * Defines behavior when the trigger condition ends (e.g., mouse leave).\n * - 'continue': Animation continues playing.\n * - 'pause': Pauses the animation.\n * - 'reset': Cancels the animation, resetting it to the start.\n * - 'reverse': Reverses the animation playback.\n *\n * @param {!PxAnimatorAPI} api The animator API instance to control.\n * @param {!PxTrigger} config The trigger configuration object.\n * @returns {!PxAnimatorAPI} The same animator API instance, for chaining.\n */\nexport function setupAnimationTriggers(\n api: PxAnimatorAPI,\n config: PxTrigger\n): PxAnimatorAPI {\n const { startOn, outAction = 'continue', scrollIntoViewThreshold = 0.5 } = config;\n\n const root = api.getRootElement();\n\n if (!root) {\n console.warn('setupAnimationTriggers: No root element found for animation.');\n return api;\n }\n\n /** Ensures forward playback and starts or resumes the animation. */\n const start = () => {\n api.play();\n };\n\n /** Handles what to do when the element leaves the active trigger condition. */\n const handleEndAction = () => {\n switch (outAction) {\n case 'pause':\n api.pause();\n break;\n case 'reset':\n api.cancel();\n break;\n case 'reverse':\n // If reverse playback is implemented, this would set a negative playback rate.\n // For now we just call play() for compatibility.\n // api.setPlaybackRate(-1);\n api.play();\n break;\n case 'continue':\n default:\n // Do nothing\n break;\n }\n };\n\n // ---- Setup event-based start logic ----\n switch (startOn) {\n case 'load': {\n const startHandler = () => start();\n if (document.readyState === 'complete') {\n startHandler();\n } else {\n window.addEventListener('load', startHandler, { once: true });\n }\n break;\n }\n\n case 'mouseOver': {\n const mouseOverHandler = () => start();\n const mouseOutHandler = () => handleEndAction();\n\n root.addEventListener('mouseenter', mouseOverHandler);\n root.addEventListener('mouseleave', mouseOutHandler);\n break;\n }\n\n case 'click': {\n const clickHandler = () => {\n if (api.isPlaying()) {\n handleEndAction();\n } else {\n start();\n }\n };\n root.addEventListener('click', clickHandler);\n break;\n }\n\n case 'scrollIntoView': {\n const observer = new IntersectionObserver(\n entries => {\n entries.forEach(entry => {\n // If the element is at least partially visible\n if (entry.isIntersecting && entry.intersectionRatio >= scrollIntoViewThreshold) {\n start();\n } else {\n // Element scrolled off screen -> trigger handleEndAction\n handleEndAction();\n }\n });\n },\n { threshold: scrollIntoViewThreshold }\n );\n observer.observe(root);\n break;\n }\n\n case 'programmatic':\n // No auto-start; external code must call play()\n break;\n }\n\n return api;\n}\n","/*---------------------------------------------------------------------------------------\n * Copyright (c) Pixodesk LTD.\n * Licensed under the MIT License. See the LICENSE file in the project root for details.\n *---------------------------------------------------------------------------------------*/\n\nexport type FillMode = 'forwards' | 'backwards' | 'both' | 'none';\n\nexport type PlaybackDirection = 'normal' | 'reverse' | 'alternate' | 'alternate-reverse';\n\nexport const PX_ANIM_SRC_ATTR_NAME = 'data-px-animation-src';\n\nexport const PX_ANIM_ATTR_NAME = '_px_animator';\n\n\n/**\n * Easing function definition.\n * Can be a named reference to a predefined easing or a cubic-bezier array [x1, y1, x2, y2].\n *\n * @example \"ease-in\" | \"easeOut\" | [0.68, -0.55, 0.265, 1.55]\n */\nexport type PxEasingOrRef = string | [number, number, number, number];\n\n/**\n * A single animation keyframe defining the state at a specific point in time.\n * Supports both full property names and short aliases for compact notation.\n */\nexport interface PxKeyframe {\n /** Timestamp in milliseconds from animation start */\n time?: number;\n\n /** Short alias for \"time\" */\n t?: number;\n\n /** The value of the animated property at this keyframe */\n value?: any;\n\n /** Short alias for \"value\" */\n v?: any;\n\n /** Easing function to use when transitioning to this keyframe from the previous one */\n easing?: PxEasingOrRef;\n\n /** Short alias for \"easing\" */\n e?: PxEasingOrRef;\n}\n\n/**\n * Animation definition for a single CSS/SVG property.\n * Contains an array of keyframes that define how the property changes over time.\n */\nexport interface PxPropertyAnimation {\n /** Array of keyframes defining the animation timeline */\n keyframes?: PxKeyframe[];\n\n /** Short alias for \"keyframes\" */\n kfs?: PxKeyframe[];\n}\n\n/**\n * Complete animation definition containing one or more property animations.\n * Each key is a CSS/SVG property name (e.g., \"opacity\", \"scale\", \"rotate\").\n *\n * @example\n * {\n * \"opacity\": { keyframes: [...] },\n * \"scale\": { keyframes: [...] }\n * }\n */\nexport interface PxAnimationDefinition {\n [property: string]: PxPropertyAnimation;\n}\n\n/**\n * Defines when and how an animation should be triggered.\n */\nexport interface PxTrigger {\n /** Event that starts the animation */\n startOn?: 'load' | 'mouseOver' | 'click' | 'scrollIntoView' | 'programmatic';\n\n /** Action to take when the trigger condition is no longer met (e.g., mouse leaves) */\n outAction?: 'continue' | 'pause' | 'reset' | 'reverse';\n\n /** Percentage of element visibility required to trigger (0-1). Only applies to scrollIntoView. */\n scrollIntoViewThreshold?: number;\n}\n\n/**\n * Global animation configuration that applies to all animations in the document.\n * Defines timing, playback behavior, and rendering strategy.\n */\nexport interface PxAnimatorConfig {\n /** JavaScript animation implementation strategy */\n mode?: \"auto\" | \"webapi\" | \"frames\";\n\n /** Total animation duration in milliseconds */\n duration?: number;\n\n /** Delay before animation starts in milliseconds */\n delay?: number;\n\n /** Number of times to repeat the animation. Use \"infinite\" for endless loop. */\n iterations?: number | \"infinite\";\n\n /** Defines which values are applied before/after the animation */\n fill?: FillMode;\n\n /** Direction of animation playback */\n direction?: PlaybackDirection;\n\n /** Target frame rate for frame-based animations (only applicable when mode=\"frames\") */\n frameRate?: number;\n\n /** Trigger configuration for when animation should start */\n trigger?: PxTrigger;\n\n debug?: boolean; // FIXME - implement\n\n debugInstName?: string; // FIXME - implement\n}\n\n/**\n * Reusable definitions library for easings, animations, and styles.\n * Allows to define once and referencing by name.\n */\nexport interface PxDefs {\n /** Named cubic-bezier easing functions */\n easings?: {\n [name: string]: [number, number, number, number];\n };\n\n /** Named animation definitions that can be referenced by elements */\n animations?: {\n [name: string]: PxAnimationDefinition;\n };\n\n /** \n * FIXME - do we need it?\n * Named style presets for common styling patterns \n */\n styles?: {\n [name: string]: Record<string, string | number>;\n };\n}\n\n/**\n * Element animation specification.\n * Can be:\n * - A string referencing a named animation from defs\n * - An array of named animation references\n * - An inline PxAnimationDefinition object\n * - A mixed array of references and inline definitions\n *\n * @example\n * \"fadeIn\"\n * [\"fadeIn\", \"spin\"]\n * { opacity: { keyframes: [...] } }\n * [\"fadeIn\", { scale: { keyframes: [...] } }]\n */\nexport type PxElementAnimation =\n | string\n | string[]\n | PxAnimationDefinition\n | (string | PxAnimationDefinition)[];\n\n/**\n * Base interface for all SVG elements.\n * Represents a node in the SVG tree with optional animations and children.\n */\nexport interface PxNode {\n /** SVG element type (e.g., \"circle\", \"rect\", \"path\", \"g\") */\n type: string;\n\n /** Child elements (for container elements like <g>) */\n children?: PxNode[];\n\n /** Animation applied to this element */\n animate?: PxElementAnimation;\n\n /** \n * FIXME - do we need it?\n * Style applied to this element (named reference or inline object) \n */\n style?: string | Record<string, string | number>;\n\n /** All other SVG attributes (cx, cy, r, fill, stroke, etc.) */\n [key: string]: any;\n}\n\n/**\n * Binds animations to existing DOM elements via CSS selectors.\n * Used when the SVG tree is pre-rendered and animations are applied separately.\n */\nexport interface PxBinding {\n /** ID targeting elements in the DOM (data-px-id=\"...\") */\n id: string;\n\n /** Animation to apply to matched elements */\n animate: PxElementAnimation;\n}\n\n/**\n * Root SVG element containing the entire animated graphic.\n * Extends PxNode with SVG-specific properties and global configuration.\n */\nexport interface PxSvgNode extends PxNode {\n\n /** FIXME - do we need it? \n * SVG viewport width */\n width?: number;\n\n /** FIXME - do we need it? \n * SVG viewport height */\n height?: number;\n\n /** FIXME - do we need it? \n * SVG viewBox attribute defining coordinate system */\n viewBox?: string;\n\n /** Global animation configuration */\n animator?: PxAnimatorConfig;\n\n /** Reusable definitions library */\n defs?: PxDefs;\n\n /** Animation bindings for pre-rendered DOM elements */\n bindings?: PxBinding[];\n\n design?: PxNode;\n}\n\n/**\n * The complete animated SVG document.\n * This is the root type for the entire file format.\n */\nexport interface PxAnimatedSvgDocument extends PxSvgNode {\n}\n\n// ============================================================================\n// API INTERFACES\n// ============================================================================\n\n/** A configuration object for animation lifecycle callbacks. */\nexport interface PxAnimatorCallbacksConfig {\n\n /** Callback executed when the animation starts or resumes. */\n onPlay?: () => void;\n\n /** Callback executed when the animation is paused. */\n onPause?: () => void;\n\n /** Callback executed when the animation is cancelled. */\n onCancel?: () => void;\n\n /** Callback executed when the animation finishes naturally. */\n onFinish?: () => void;\n\n /** Callback executed when the animation is removed. */\n onRemove?: () => void;\n}\n\n\nexport type PxPoint2D = Array<number>;\n\n/** Represents a vector path for SVG shape animations. */\nexport interface PxBezierPath {\n\n /** An array of vertex points [[x, y], ...]. */\n v: Array<PxPoint2D>;\n\n /** An array of 'in' tangent handles for each vertex [[x, y], ...]. */\n i?: Array<PxPoint2D>;\n\n /** An array of 'out' tangent handles for each vertex [[x, y], ...]. */\n o?: Array<PxPoint2D>;\n\n /** A boolean indicating if the path is closed. */\n c?: boolean;\n}\n\n/** Basic animation controls common to all animator types. */\nexport interface PxBasicAnimatorAPI {\n\n isReady(): boolean;\n\n /** Returns the root HTML element for the animation. */\n getRootElement(): Element | null;\n\n /** Returns true if the animation is currently running. */\n isPlaying(): boolean;\n\n /** Starts or resumes the animation. */\n play(): void;\n\n /** Pauses the animation at its current state. */\n pause(): void;\n\n /** Stops the animation and resets it to its initial state. */\n cancel(): void;\n\n}\n\n/** The full programmatic control interface for an animation. */\nexport interface PxAnimatorAPI extends PxBasicAnimatorAPI {\n\n /** Jumps to the end of the animation and holds the final state. */\n finish(): void;\n\n /** Changes the speed of the animation. 1 is normal, 2 is double, -1 is reverse. */\n setPlaybackRate(rate: number): void;\n\n /** Returns the current playback time in milliseconds. */\n getCurrentTime(): number | null;\n\n /** Jumps to a specific time (in milliseconds) in the animation. */\n setCurrentTime(time: number): void;\n\n /** Stops the animation and cleans up all associated resources. */\n destroy(): void;\n}\n\n\n// ============================================================================\n// HELPER FUNCTIONS\n// ============================================================================\n\nexport function isPxElementFileFormat(fileJson: any): fileJson is PxAnimatedSvgDocument {\n if (!(\n fileJson &&\n typeof fileJson === 'object' &&\n !Array.isArray(fileJson)\n )) {\n return false;\n }\n\n return fileJson['type'] === 'svg' || fileJson['tagName'] === 'svg';\n}\n\n\n// ============================================================================\n// DEEP VALIDATION\n// ============================================================================\n\nexport interface PxValidationResult {\n valid: boolean;\n errors: string[];\n}\n\nfunction isObject(v: any): v is Record<string, any> {\n return v && typeof v === 'object' && !Array.isArray(v);\n}\n\nfunction validateFillMode(v: any, path: string, errors: string[]): boolean {\n if (v === 'forwards' || v === 'backwards' || v === 'both' || v === 'none') return true;\n errors.push(path + ': invalid FillMode \"' + v + '\", expected \\'forwards\\'|\\'backwards\\'|\\'both\\'|\\'none\\'');\n return false;\n}\n\nfunction validatePlaybackDirection(v: any, path: string, errors: string[]): boolean {\n if (v === 'normal' || v === 'reverse' || v === 'alternate' || v === 'alternate-reverse') return true;\n errors.push(path + ': invalid PlaybackDirection \"' + v + '\", expected \\'normal\\'|\\'reverse\\'|\\'alternate\\'|\\'alternate-reverse\\'');\n return false;\n}\n\nfunction validatePxEasingOrRef(v: any, path: string, errors: string[]): boolean {\n if (typeof v === 'string') return true;\n if (Array.isArray(v) && v.length === 4 && v.every(n => typeof n === 'number')) return true;\n errors.push(path + ': invalid easing, expected string or [number, number, number, number]');\n return false;\n}\n\nfunction validatePxKeyframe(v: any, path: string, errors: string[]): boolean {\n if (!isObject(v)) {\n errors.push(path + ': expected object');\n return false;\n }\n let valid = true;\n if (v.time !== undefined && typeof v.time !== 'number') {\n errors.push(path + '.time: expected number, got ' + typeof v.time);\n valid = false;\n }\n if (v.t !== undefined && typeof v.t !== 'number') {\n errors.push(path + '.t: expected number, got ' + typeof v.t);\n valid = false;\n }\n if (v.easing !== undefined && !validatePxEasingOrRef(v.easing, path + '.easing', errors)) valid = false;\n if (v.e !== undefined && !validatePxEasingOrRef(v.e, path + '.e', errors)) valid = false;\n return valid;\n}\n\nfunction validatePxPropertyAnimation(v: any, path: string, errors: string[]): boolean {\n if (!isObject(v)) {\n errors.push(path + ': expected object');\n return false;\n }\n let valid = true;\n if (v.keyframes !== undefined) {\n if (!Array.isArray(v.keyframes)) {\n errors.push(path + '.keyframes: expected array');\n valid = false;\n } else {\n v.keyframes.forEach((kf: any, i: number) => {\n if (!validatePxKeyframe(kf, path + '.keyframes[' + i + ']', errors)) valid = false;\n });\n }\n }\n if (v.kfs !== undefined) {\n if (!Array.isArray(v.kfs)) {\n errors.push(path + '.kfs: expected array');\n valid = false;\n } else {\n v.kfs.forEach((kf: any, i: number) => {\n if (!validatePxKeyframe(kf, path + '.kfs[' + i + ']', errors)) valid = false;\n });\n }\n }\n return valid;\n}\n\nfunction validatePxAnimationDefinition(v: any, path: string, errors: string[]): boolean {\n if (!isObject(v)) {\n errors.push(path + ': expected object');\n return false;\n }\n let valid = true;\n for (const key of Object.keys(v)) {\n if (!validatePxPropertyAnimation(v[key], path + '.' + key, errors)) valid = false;\n }\n return valid;\n}\n\nfunction validatePxElementAnimation(v: any, path: string, errors: string[]): boolean {\n if (typeof v === 'string') return true;\n if (Array.isArray(v)) {\n let valid = true;\n v.forEach((item, i) => {\n if (typeof item !== 'string' && !validatePxAnimationDefinition(item, path + '[' + i + ']', errors)) {\n valid = false;\n }\n });\n return valid;\n }\n if (isObject(v)) return validatePxAnimationDefinition(v, path, errors);\n errors.push(path + ': expected string, array, or PxAnimationDefinition object');\n return false;\n}\n\nfunction validatePxTrigger(v: any, path: string, errors: string[]): boolean {\n if (!isObject(v)) {\n errors.push(path + ': expected object');\n return false;\n }\n let valid = true;\n const validStartOn = ['load', 'mouseOver', 'click', 'scrollIntoView', 'programmatic'];\n if (!validStartOn.includes(v.startOn)) {\n errors.push(path + '.startOn: invalid value \"' + v.startOn + '\", expected ' + validStartOn.join('|'));\n valid = false;\n }\n if (v.outAction !== undefined) {\n const validOutAction = ['continue', 'pause', 'reset', 'reverse'];\n if (!validOutAction.includes(v.outAction)) {\n errors.push(path + '.outAction: invalid value \"' + v.outAction + '\", expected ' + validOutAction.join('|'));\n valid = false;\n }\n }\n if (v.scrollIntoViewThreshold !== undefined && typeof v.scrollIntoViewThreshold !== 'number') {\n errors.push(path + '.scrollIntoViewThreshold: expected number, got ' + typeof v.scrollIntoViewThreshold);\n valid = false;\n }\n return valid;\n}\n\nfunction validatePxAnimatorConfig(v: any, path: string, errors: string[]): boolean {\n if (!isObject(v)) {\n errors.push(path + ': expected object');\n return false;\n }\n let valid = true;\n if (v.mode !== undefined && !['auto', 'webapi', 'frames'].includes(v.mode)) {\n errors.push(path + '.mode: invalid value \"' + v.mode + '\", expected \\'auto\\'|\\'webapi\\'|\\'frames\\'');\n valid = false;\n }\n if (v.duration !== undefined && typeof v.duration !== 'number') {\n errors.push(path + '.duration: expected number, got ' + typeof v.duration);\n valid = false;\n }\n if (v.delay !== undefined && typeof v.delay !== 'number') {\n errors.push(path + '.delay: expected number, got ' + typeof v.delay);\n valid = false;\n }\n if (v.iterations !== undefined && typeof v.iterations !== 'number' && v.iterations !== 'infinite') {\n errors.push(path + '.iterations: expected number or \\'infinite\\', got ' + typeof v.iterations);\n valid = false;\n }\n if (v.fill !== undefined && !validateFillMode(v.fill, path + '.fill', errors)) valid = false;\n if (v.direction !== undefined && !validatePlaybackDirection(v.direction, path + '.direction', errors)) valid = false;\n if (v.frameRate !== undefined && typeof v.frameRate !== 'number') {\n errors.push(path + '.frameRate: expected number, got ' + typeof v.frameRate);\n valid = false;\n }\n if (v.trigger !== undefined && !validatePxTrigger(v.trigger, path + '.trigger', errors)) valid = false;\n return valid;\n}\n\nfunction validatePxDefs(v: any, path: string, errors: string[]): boolean {\n if (!isObject(v)) {\n errors.push(path + ': expected object');\n return false;\n }\n let valid = true;\n if (v.easings !== undefined) {\n if (!isObject(v.easings)) {\n errors.push(path + '.easings: expected object');\n valid = false;\n } else {\n for (const key of Object.keys(v.easings)) {\n if (!validatePxEasingOrRef(v.easings[key], path + '.easings.' + key, errors)) valid = false;\n }\n }\n }\n if (v.animations !== undefined) {\n if (!isObject(v.animations)) {\n errors.push(path + '.animations: expected object');\n valid = false;\n } else {\n for (const key of Object.keys(v.animations)) {\n if (!validatePxAnimationDefinition(v.animations[key], path + '.animations.' + key, errors)) valid = false;\n }\n }\n }\n if (v.styles !== undefined && !isObject(v.styles)) {\n errors.push(path + '.styles: expected object');\n valid = false;\n }\n return valid;\n}\n\nfunction validatePxBinding(v: any, path: string, errors: string[]): boolean {\n if (!isObject(v)) {\n errors.push(path + ': expected object');\n return false;\n }\n let valid = true;\n if (typeof v.id !== 'string') {\n errors.push(path + '.id: expected string, got ' + typeof v.id);\n valid = false;\n }\n if (!validatePxElementAnimation(v.animate, path + '.animate', errors)) valid = false;\n return valid;\n}\n\nfunction validatePxNode(v: any, path: string, errors: string[]): boolean {\n if (!isObject(v)) {\n errors.push(path + ': expected object');\n return false;\n }\n let valid = true;\n if (typeof v.type !== 'string') {\n errors.push(path + '.type: expected string, got ' + typeof v.type);\n valid = false;\n }\n if (v.children !== undefined) {\n if (!Array.isArray(v.children)) {\n errors.push(path + '.children: expected array');\n valid = false;\n } else {\n v.children.forEach((child: any, i: number) => {\n if (!validatePxNode(child, path + '.children[' + i + ']', errors)) valid = false;\n });\n }\n }\n if (v.animate !== undefined && !validatePxElementAnimation(v.animate, path + '.animate', errors)) valid = false;\n return valid;\n}\n\nfunction validatePxSvgNode(v: any, path: string, errors: string[]): boolean {\n if (!validatePxNode(v, path, errors)) return false;\n let valid = true;\n if (v.type !== 'svg') {\n errors.push(path + '.type: expected \\'svg\\', got \\'' + v.type + '\\'');\n valid = false;\n }\n if (v.width !== undefined && typeof v.width !== 'number') {\n errors.push(path + '.width: expected number, got ' + typeof v.width);\n valid = false;\n }\n if (v.height !== undefined && typeof v.height !== 'number') {\n errors.push(path + '.height: expected number, got ' + typeof v.height);\n valid = false;\n }\n if (v.viewBox !== undefined && typeof v.viewBox !== 'string') {\n errors.push(path + '.viewBox: expected string, got ' + typeof v.viewBox);\n valid = false;\n }\n if (v.animator !== undefined && !validatePxAnimatorConfig(v.animator, path + '.animator', errors)) valid = false;\n if (v.defs !== undefined && !validatePxDefs(v.defs, path + '.defs', errors)) valid = false;\n if (v.bindings !== undefined) {\n if (!Array.isArray(v.bindings)) {\n errors.push(path + '.bindings: expected array');\n valid = false;\n } else {\n v.bindings.forEach((binding: any, i: number) => {\n if (!validatePxBinding(binding, path + '.bindings[' + i + ']', errors)) valid = false;\n });\n }\n }\n if (v.design !== undefined && !validatePxNode(v.design, path + '.design', errors)) valid = false;\n return valid;\n}\n\n/**\n * Deep validation of PxAnimatedSvgDocument.\n * Validates all nested properties against their type definitions.\n * @returns PxValidationResult with valid flag and array of error messages\n */\nexport function isPxElementFileFormatDeep(fileJson: any): PxValidationResult {\n const errors: string[] = [];\n const valid = validatePxSvgNode(fileJson, 'root', errors);\n return { valid, errors };\n}\n\nexport function getAnimatorConfig(doc: PxAnimatedSvgDocument): PxAnimatorConfig | undefined {\n return (\n doc?.animator || doc?.meta?.animator || \n doc?.animation || doc?.meta?.animation // FIXME - decide on the name\n );\n}\n\nexport function getDefs(doc: PxAnimatedSvgDocument): PxDefs | undefined {\n if (!doc) return undefined;\n return doc.defs || doc.meta?.defs;\n}\n\nexport function getBindings(doc: PxAnimatedSvgDocument): PxBinding[] | undefined {\n if (!doc) return undefined;\n return doc.bindings || doc.meta?.bindings;\n}\n\n// FIXME - do we need it?\nexport function getChildren(doc: PxAnimatedSvgDocument): PxNode[] | undefined {\n return doc?.children;\n}\n","/*---------------------------------------------------------------------------------------\n * Copyright (c) Pixodesk LTD.\n * Licensed under the MIT License. See the LICENSE file in the project root for details.\n *---------------------------------------------------------------------------------------*/\n\nimport {\n getAnimatorConfig,\n getBindings,\n getDefs,\n type PxAnimatedSvgDocument,\n type PxAnimationDefinition,\n type PxBezierPath,\n type PxBinding,\n type PxDefs,\n type PxElementAnimation,\n type PxKeyframe,\n type PxNode,\n type PxPropertyAnimation\n} from './PxAnimatorTypes';\nimport { bezierToSvgPath, camelCaseToKebabWordIfNeeded, clamp, COLOUR_ATTR_NAMES, cubicBezier, interpolateBeziers, interpolateColor, interpolateNum, interpolateVec, isCamelCaseWord, parseColor, PCT_BASED_ATTR_NAMES, remap, toRGBA } from './PxAnimatorUtil';\n\n\n// ============================================================================\n// PATH PARSING: Convert \"path(...)\" strings to PxBezierPath format\n// ============================================================================\n\ninterface PathCommand {\n type: string;\n values: Array<number>;\n}\n\n/**\n * Parses an SVG path string into command tokens.\n * Supports M, L, C, Z commands (case-insensitive).\n */\nfunction parsePathCommands(d: string): Array<PathCommand> {\n const tokens = d.split(/([MLCZmlcz]|[\\s,]+)/).map(t => t.trim()).filter(t => t && t !== ',');\n\n const commands: Array<PathCommand> = [];\n let currentCommand: PathCommand | null = null;\n\n for (const token of tokens) {\n if (/[MLCZmlcz]/.test(token)) {\n currentCommand = { type: token, values: [] };\n commands.push(currentCommand);\n } else if (currentCommand) {\n const value = +token;\n currentCommand.values.push(Number.isNaN(value) ? 0 : value);\n }\n }\n\n return commands;\n}\n\n/**\n * Parses an internal SVG path string into PxBezierPath array.\n * Handles M (moveto), L (lineto), C (curveto), Z (close) commands.\n */\nfunction parseSvgPathToBezier(d: string): Array<PxBezierPath> {\n const res: Array<PxBezierPath> = [];\n let currentPath: PxBezierPath | undefined;\n\n const commands = parsePathCommands(d);\n\n for (const command of commands) {\n const type = command.type;\n const values = command.values;\n\n if (type === 'M' || type === 'm') {\n const x = values[0] || 0;\n const y = values[1] || 0;\n currentPath = {\n v: [[x, y]],\n i: [[x, y]],\n o: [[x, y]],\n c: false\n };\n res.push(currentPath);\n continue;\n }\n\n // Ensure we have a current path\n if (!currentPath) {\n currentPath = {\n v: [[0, 0]],\n i: [[0, 0]],\n o: [[0, 0]],\n c: false\n };\n res.push(currentPath);\n }\n\n if (type === 'L') {\n const x = values[0] || 0;\n const y = values[1] || 0;\n currentPath.v.push([x, y]);\n currentPath.i!.push([x, y]);\n currentPath.o!.push([x, y]);\n\n } else if (type === 'C') {\n const outX = values[0] || 0;\n const outY = values[1] || 0;\n const inX2 = values[2] || 0;\n const inY2 = values[3] || 0;\n const x2 = values[4] || 0;\n const y2 = values[5] || 0;\n\n // Update out-point of previous vertex\n currentPath.o![currentPath.o!.length - 1] = [outX, outY];\n\n // Add new vertex with its in-point\n currentPath.v.push([x2, y2]);\n currentPath.i!.push([inX2, inY2]);\n currentPath.o!.push([x2, y2]);\n\n } else if (type === 'Z' || type === 'z') {\n currentPath.c = true;\n }\n }\n\n return res;\n}\n\n/**\n * Extracts SVG path data from a string.\n * Handles both \"path(M...)\" wrapper format and raw \"M...\" format.\n * @returns The path data string, or undefined if not a valid path string\n */\nfunction extractPathData(str: string): string | undefined {\n if (str.startsWith('path(') && str.endsWith(')')) {\n return str.slice(5, -1); // Remove \"path(\" and \")\"\n }\n // Raw path string starting with a path command (M, m, or other commands)\n if (/^[MmZzLlHhVvCcSsQqTtAa]/.test(str)) {\n return str;\n }\n return undefined;\n}\n\n/**\n * Checks if the value is a path string (either \"path(...)\" or raw \"M...\").\n */\nfunction isPathString(value: any): value is string {\n return typeof value === 'string' && extractPathData(value) !== undefined;\n}\n\n/**\n * Normalizes a 'd' attribute value to { paths: PxBezierPath[] } format.\n * Handles:\n * - { paths: [\"path(...)\"] } -> { paths: [PxBezierPath] }\n * - { paths: [\"M...\"] } -> { paths: [PxBezierPath] }\n * - [\"path(...)\"] -> { paths: [PxBezierPath] }\n * - [\"M...\"] -> { paths: [PxBezierPath] }\n * - \"path(...)\" -> { paths: [PxBezierPath] }\n * - \"M...\" -> { paths: [PxBezierPath] }\n * - { paths: [PxBezierPath] } -> as-is\n */\nfunction normalizePathValue(value: any): { paths: Array<PxBezierPath> } | any {\n // If already in { paths: [...] } format\n if (value && typeof value === 'object' && 'paths' in value) {\n const pathsArray = value.paths;\n if (Array.isArray(pathsArray) && pathsArray.length > 0) {\n // Check if paths contain path strings that need parsing\n if (isPathString(pathsArray[0])) {\n const paths: Array<PxBezierPath> = [];\n for (const pathStr of pathsArray) {\n const d = extractPathData(pathStr);\n if (d) {\n paths.push(...parseSvgPathToBezier(d));\n }\n }\n return { paths };\n }\n }\n // Already in correct format\n return value;\n }\n\n // If it's an array of path strings\n if (Array.isArray(value)) {\n if (value.length > 0 && isPathString(value[0])) {\n const paths: Array<PxBezierPath> = [];\n for (const pathStr of value) {\n const d = extractPathData(pathStr);\n if (d) {\n paths.push(...parseSvgPathToBezier(d));\n }\n }\n return { paths };\n }\n // Already an array of PxBezierPath - wrap in { paths: }\n return { paths: value };\n }\n\n // If it's a single path string\n if (isPathString(value)) {\n const d = extractPathData(value)!;\n return { paths: parseSvgPathToBezier(d) };\n }\n\n return value;\n}\n\n\n// ============================================================================\n// NORMALIZATION: Convert new API format to internal normalized format\n// ============================================================================\n\n/**\n * Resolves an easing reference to a cubic-bezier array.\n * @param easing The easing reference (string name or bezier array)\n * @param defs The definitions containing named easings\n * @returns The resolved cubic-bezier array or undefined\n */\nfunction resolveEasing(\n easing: string | [number, number, number, number] | undefined,\n defs?: PxDefs\n): [number, number, number, number] | undefined {\n if (!easing) return undefined;\n\n if (Array.isArray(easing)) {\n return easing;\n }\n\n // Look up named easing in defs\n if (defs?.easings?.[easing]) {\n return defs.easings[easing];\n }\n\n // Unknown easing name - return undefined\n console.warn('Unknown easing name: ' + easing);\n return undefined;\n}\n\n/**\n * Resolves an animation reference to an AnimationDefinition.\n * @param animRef The animation reference (string name or inline definition)\n * @param defs The definitions containing named animations\n * @returns The resolved animation definition\n */\nfunction resolveAnimation(\n animRef: string | PxAnimationDefinition,\n defs?: PxDefs\n): PxAnimationDefinition | undefined {\n if (typeof animRef === 'string') {\n // Look up named animation in defs\n const resolved = defs?.animations?.[animRef];\n if (!resolved) {\n console.warn('Unknown animation name: ' + animRef);\n }\n return resolved;\n }\n\n // It's an inline definition\n return animRef;\n}\n\n/**\n * Resolves an element animation (which can be string, array, or inline) to an array of AnimationDefinitions.\n * @param animate The element animation specification\n * @param defs The definitions containing named animations\n * @returns Array of resolved animation definitions\n */\nfunction resolveElementAnimation(\n animate: PxElementAnimation | undefined,\n defs?: PxDefs\n): PxAnimationDefinition[] {\n if (!animate) return [];\n\n const results: PxAnimationDefinition[] = [];\n\n if (typeof animate === 'string') {\n const resolved = resolveAnimation(animate, defs);\n if (resolved) results.push(resolved);\n } else if (Array.isArray(animate)) {\n for (const item of animate) {\n const resolved = resolveAnimation(item, defs);\n if (resolved) results.push(resolved);\n }\n } else {\n // It's an inline AnimationDefinition\n results.push(animate);\n }\n\n return results;\n}\n\n/**\n * Normalizes keyframes from the new API format (time in ms) to internal format (time as 0-1 fraction).\n * Resolves easing references, normalizes times, and converts path strings for 'd' attribute.\n * @param propName The property name (e.g., 'd' for path)\n * @param propAnim The property animation with keyframes\n * @param duration The total animation duration in ms\n * @param defs The definitions containing named easings\n * @returns Array of normalized keyframes (same structure, resolved refs, normalized times)\n */\nfunction normalizeKeyframes(\n propName: string,\n propAnim: PxPropertyAnimation,\n duration: number,\n defs?: PxDefs\n): PxKeyframe[] {\n const keyframes = propAnim.keyframes || propAnim.kfs || [];\n const normalized: PxKeyframe[] = [];\n\n for (const kf of keyframes) {\n const timePct = kf.time ?? kf.t ?? 0;\n let value = kf.value ?? kf.v;\n const easing = kf.easing ?? kf.e;\n\n // Normalize path values for 'd' attribute\n if (propName === 'd') {\n value = normalizePathValue(value);\n }\n\n // Normalize color values (hex/rgb/rgba strings to [0-1] vectors)\n if (COLOUR_ATTR_NAMES.has(propName)) {\n value = parseColor(value) ?? value;\n }\n\n normalized.push({\n t: timePct,\n v: value,\n e: resolveEasing(easing, defs)\n });\n }\n\n // Sort by time\n normalized.sort((a, b) => (a.t ?? 0) - (b.t ?? 0));\n\n return normalized;\n}\n\n/**\n * Merges multiple animation definitions into a single combined definition.\n * Later definitions override earlier ones for the same property.\n */\nfunction mergeAnimationDefinitions(\n animations: PxAnimationDefinition[]\n): PxAnimationDefinition {\n const merged: PxAnimationDefinition = {};\n\n for (const anim of animations) {\n for (const [prop, propAnim] of Object.entries(anim)) {\n merged[prop] = propAnim;\n }\n }\n\n return merged;\n}\n\n/**\n * Generates a unique element ID for internal tracking during DOM rendering.\n */\nlet _elementIdCounter = 0;\nexport function generateElementId(): string {\n return '_px_el_' + (++_elementIdCounter);\n}\n\n/**\n * Resets the element ID counter (useful for testing).\n */\nexport function resetElementIdCounter(): void {\n _elementIdCounter = 0;\n}\n\n/**\n * Normalizes an animation definition by resolving easing references and normalizing keyframe times.\n * Keeps the key/value mapping structure.\n */\nfunction normalizeAnimationDefinition(\n animDef: PxAnimationDefinition,\n duration: number,\n defs?: PxDefs\n): PxAnimationDefinition {\n const normalized: PxAnimationDefinition = {};\n\n for (const [propName, propAnim] of Object.entries(animDef)) {\n const normalizedKfs = normalizeKeyframes(propName, propAnim, duration, defs);\n if (normalizedKfs.length > 0) {\n normalized[propName] = { kfs: normalizedKfs };\n }\n }\n\n return normalized;\n}\n\n/**\n * Normalizes a PxAnimatedSvgDocument to a PxAnimatorConfig for the animation engines.\n * This is the main entry point for converting the new API format to internal format.\n * Resolves animation/easing references.\n */\nexport function getNormalisedBindings(doc: PxAnimatedSvgDocument): PxBinding[] {\n const animatorConfig = getAnimatorConfig(doc) || {};\n const defs = getDefs(doc);\n const duration = animatorConfig.duration || 1000; // FIXME - get rid of 1000 here\n\n const bindings: PxBinding[] = [];\n\n // Helper to resolve and normalize animation for a binding\n const processAnimation = (\n id: string,\n animate: PxElementAnimation | undefined\n ): PxBinding | null => {\n if (!animate) return null;\n\n const animDefs = resolveElementAnimation(animate, defs);\n if (animDefs.length === 0) return null;\n\n const merged = mergeAnimationDefinitions(animDefs);\n const normalizedAnim = normalizeAnimationDefinition(merged, duration, defs);\n\n if (Object.keys(normalizedAnim).length === 0) return null;\n\n return {\n id,\n animate: normalizedAnim\n };\n };\n\n // Process bindings (for pre-rendered DOM)\n const docBindings = getBindings(doc);\n if (docBindings) {\n for (const binding of docBindings) {\n const normalized = processAnimation(binding.id, binding.animate);\n if (normalized) bindings.push(normalized);\n }\n }\n\n // Process children (for rendered DOM)\n const processNode = (node: PxNode) => {\n // Generate a selector for this node based on id\n if (node.animate) {\n const nodeId = node.id || generateElementId(); // FIXME - make sure that it wasn't in the config already\n node.id = nodeId; // Ensure the node has an ID\n const normalized = processAnimation(nodeId, node.animate);\n if (normalized) bindings.push(normalized);\n }\n\n // Process children\n if (node.children) {\n for (let i = 0; i < node.children.length; i++) {\n processNode(node.children[i]);\n }\n }\n };\n\n // Process children of the root\n if (doc.children) {\n for (let i = 0; i < doc.children.length; i++) {\n processNode(doc.children[i]);\n }\n }\n\n return bindings;\n}\n\n\n// ============================================================================\n// ATTRIBUTE VALUE CALCULATION (used by frame loop animator)\n// ============================================================================\n\n/**\n * Finds prev/next keyframes for a given progress.\n */\nfunction getKeyframesPair(keyframes: PxKeyframe[], progress: number) {\n let prevKf = keyframes[0];\n let nextKf = keyframes[keyframes.length - 1];\n\n for (let j = 0; j < keyframes.length - 1; j++) {\n const aOff = (keyframes[j].t ?? 0);\n const bOff = (keyframes[j + 1].t ?? 0);\n if (aOff <= progress && progress <= bOff) {\n prevKf = keyframes[j];\n nextKf = keyframes[j + 1];\n break;\n }\n }\n return { prevKf, nextKf };\n}\n\n/**\n * Calculates interpolated value for a single property animation.\n */\nfunction calcPropertyValue(\n propName: string,\n propAnim: PxPropertyAnimation,\n progress: number\n): { k: string, v: string } | null {\n const keyframes = propAnim.kfs || propAnim.keyframes || [];\n if (keyframes.length === 0) return null;\n\n const { prevKf, nextKf } = getKeyframesPair(keyframes, progress);\n\n // remap to local 0..1 within prevKf..nextKf\n let localProgress = (prevKf === nextKf) ? 0 : remap(progress, prevKf.t ?? 0, nextKf.t ?? 0, 0, 1);\n localProgress = clamp(localProgress, 0, 1);\n const easing = prevKf.e ?? prevKf.easing;\n if (easing && Array.isArray(easing)) {\n try {\n localProgress = cubicBezier(easing as [number, number, number, number])(localProgress);\n } catch (e) {\n // fallback: ignore easing if parsing fails\n }\n }\n\n let cssAttrName = isCamelCaseWord(propName) ? camelCaseToKebabWordIfNeeded(propName) : propName;\n let cssValue: string | number | null = null;\n\n const prevV = prevKf?.v ?? prevKf?.value;\n const nextV = nextKf?.v ?? nextKf?.value;\n\n if (cssAttrName === 'd') {\n // Extract paths from { paths: [...] } format\n const prevPaths = prevV?.paths ?? (Array.isArray(prevV) ? prevV : []);\n const nextPaths = nextV?.paths ?? (Array.isArray(nextV) ? nextV : []);\n cssValue = interpolateBeziers(\n prevPaths,\n nextPaths,\n localProgress\n ).map(bz => bezierToSvgPath(bz)).join('');\n } else if (COLOUR_ATTR_NAMES.has(cssAttrName)) {\n cssValue = toRGBA(interpolateColor(\n prevV || [0, 0, 0, 1],\n nextV || [0, 0, 0, 1],\n localProgress\n ));\n cssAttrName = propName;\n } else if (cssAttrName === 'stroke-dasharray') {\n cssValue = interpolateVec(\n prevV || [],\n nextV || [],\n localProgress\n ).join(' ');\n cssAttrName = propName;\n } else if (cssAttrName === 'translate') {\n const v = interpolateVec(\n prevV || [0, 0],\n nextV || [0, 0],\n localProgress\n );\n cssValue = 'translate(' + v.join(',') + ')';\n cssAttrName = 'transform';\n } else if (cssAttrName === 'rotate') {\n const v = interpolateNum(\n +(prevV || 0),\n +(nextV || 0),\n localProgress\n );\n cssValue = 'rotate(' + v + ')';\n cssAttrName = 'transform';\n } else if (cssAttrName === 'scale') {\n const v = interpolateVec(\n prevV || [1, 1],\n nextV || [1, 1],\n localProgress\n );\n cssValue = 'scale(' + v.join(',') + ')';\n cssAttrName = 'transform';\n } else {\n // numeric attr\n const num = interpolateNum(\n +(prevV || 0),\n +(nextV || 0),\n localProgress\n );\n cssValue = num;\n }\n\n if (PCT_BASED_ATTR_NAMES.has(cssAttrName) && typeof cssValue === 'number') {\n cssValue = (cssValue * 100) + '%';\n }\n\n return { k: cssAttrName, v: cssValue === null ? '' : '' + cssValue };\n}\n\n/**\n * Calculates interpolated attribute values for an animation definition.\n * @param animDef The animation definition (with resolved refs and normalized times)\n * @param progress The current animation progress (0-1)\n * @returns Object with computed attribute name/value pairs\n */\nexport function calcAnimationValues(\n animDef: PxAnimationDefinition,\n progress: number\n): Record<string, string> {\n const result: Record<string, string> = {};\n\n for (const [propName, propAnim] of Object.entries(animDef)) { \n const computed = calcPropertyValue(propName, propAnim, progress);\n if (computed) {\n result[computed.k] = computed.v;\n }\n }\n\n return result;\n}\n","/*---------------------------------------------------------------------------------------\n * Copyright (c) Pixodesk LTD.\n * Licensed under the MIT License. See the LICENSE file in the project root for details.\n *---------------------------------------------------------------------------------------*/\n\nimport { setupAnimationTriggers } from './PxAnimatorTriggers';\nimport { getAnimatorConfig, type PxAnimatedSvgDocument, type PxAnimatorAPI, type PxAnimatorCallbacksConfig } from './PxAnimatorTypes';\nimport { camelCaseToKebabWordIfNeeded, clamp, DEFAULT_DURATION_MS, STYLE_ATTR_NAMES } from './PxAnimatorUtil';\nimport { calcAnimationValues, getNormalisedBindings } from './PxDefinitions';\n\n\n/**\n * Platform adapter interface for abstracting DOM-specific operations.\n */\nexport interface PxPlatformAdapter {\n\n /** Check if the root element is still connected/mounted */\n isConnected(): boolean;\n\n /** Set an attribute on an element by id */\n setAttribute(id: string, attrName: string, value: string): void;\n}\n\nexport function getSelector(id: string) {\n // return `[data-px-id=\"${id}\"]`; FIXME\n return '#' + id;\n}\n\n\n/**\n * Creates an animator instance that uses a frame loop for animations.\n * This is the abstract/platform-agnostic version.\n *\n * @param adapter Platform adapter for DOM/environment operations.\n * @param callbacks Optional lifecycle callbacks.\n * @returns A PxAnimatorAPI instance.\n */\nexport function createBasicFrameLoopAnimator(\n doc: PxAnimatedSvgDocument,\n adapter: PxPlatformAdapter,\n callbacks?: PxAnimatorCallbacksConfig\n): PxAnimatorAPI {\n\n const config = getAnimatorConfig(doc) || {};\n\n const bindings = getNormalisedBindings(doc);\n\n // iterations: either number or Infinity\n const _iterations = config.iterations;\n let iterations: number = 1;\n if (typeof _iterations === 'number') iterations = _iterations || 1;\n if (_iterations === 'infinite') iterations = Infinity;\n if (iterations < 1) iterations = 1;\n\n const duration = +(config.duration || DEFAULT_DURATION_MS); // per-iteration duration (ms), cannot be 0!\n const totalDuration = duration && iterations ?\n duration * (iterations === Infinity ? Infinity : iterations) :\n (duration ? (iterations ?? 1) * duration : 0);\n\n // direction handling\n const direction = config.direction || 'normal'; // 'normal' | 'reverse' | 'alternate' | 'alternate-reverse'\n\n ////////////////////////////////////////////////////////////////\n\n let timerId: number | null = null;\n let playing = false;\n\n let timeBeforeLastStartMs = (config.delay || 0); // accumulated time before current run (ms)\n let lastStartedTs = 0; // timestamp when last started/resumed\n let playbackRate = 1;\n\n let finishCalled = false; // ensures onFinish called once\n\n // Frame rate throttling\n const frameRate = config.frameRate;\n const minFrameIntervalMs = frameRate && frameRate > 0 ? 1000 / frameRate : 0;\n let lastRenderTs = 0; // timestamp of last render\n\n const getAnimCurrentTime = () => {\n // compute effective elapsed time (ms), taking playbackRate into account\n const runningElapsed = lastStartedTs ? (Date.now() - lastStartedTs) * playbackRate : 0;\n let time = timeBeforeLastStartMs + runningElapsed;\n\n // clamp to totalDuration if finite\n if (Number.isFinite(totalDuration) && time > (totalDuration as number)) time = totalDuration as number;\n if (time < 0) time = 0;\n return time;\n };\n\n\n ////////////////////////////////////////////////////////////////\n\n\n // separate render function that uses a given currentTime (ms)\n function renderFrame(currentTimeMs: number) {\n\n function getEffectiveProgress() {\n // If no duration or duration === 0, set iteration/progress accordingly\n const safeDuration = duration > 0 ? duration : 1; // avoid division by zero\n\n let rawProgress = 0;\n let iteration = 0;\n if (duration > 0) {\n\n // rawProgress is normalized progress within the current iteration:\n // - first iteration: [0 .. 1]\n // - following iterations: (0 .. 1]\n //\n // iteration is the zero-based iteration index\n //\n // Examples (safeDuration = 3):\n // currentTimeMs = 0 → rawProgress = 0 , iteration = 0\n // currentTimeMs = 3 → rawProgress = 1 , iteration = 0\n // currentTimeMs = 3.0001 → rawProgress = 0.0001 , iteration = 1\n\n currentTimeMs = clamp(currentTimeMs, 0, iterations * safeDuration);\n\n iteration = Math.max(0, Math.ceil(currentTimeMs / safeDuration) - 1);\n iteration = Math.min(iteration, iterations - 1);\n\n // Time elapsed since the start of the current iteration\n const iterationTime = currentTimeMs - iteration * safeDuration;\n\n // Normalized progress (preserves fractional overflow after boundaries)\n rawProgress = clamp(iterationTime / safeDuration, 0, 1);\n } else {\n rawProgress = currentTimeMs; // We shouldn't be here\n }\n\n\n // compute per-iteration directional progress\n // start with baseProgress = rawProgress in [0,1)\n\n let baseProgress = rawProgress;\n // apply direction rules:\n // - normal: as is\n // - reverse: progress = 1 - baseProgress\n // - alternate: reverse on odd iterations\n // - alternate-reverse: reverse on even iterations\n const dir = direction || 'normal';\n let effectiveProgress = baseProgress;\n if (dir === 'reverse') {\n effectiveProgress = 1 - baseProgress;\n } else if (dir === 'alternate') {\n if (iteration % 2 === 1) effectiveProgress = 1 - baseProgress;\n } else if (dir === 'alternate-reverse') {\n // alternate-reverse: start reversed on iteration 0\n if (iteration % 2 === 0) effectiveProgress = 1 - baseProgress;\n } // else 'normal' -> keep\n return effectiveProgress;\n }\n let effectiveProgress = getEffectiveProgress(); // else 'normal' -> keep\n\n ////////////////////////////////////////////////////////////////\n\n // FIXME - pre-calc defs, then use\n\n for (const binding of bindings || []) {\n const animDef = binding.animate;\n if (!animDef || typeof animDef !== 'object' || Array.isArray(animDef)) {\n console.warn('Empty or unresolved binding', binding);\n continue;\n }\n\n // Calculate interpolated values for this binding's animation\n const computedValues = calcAnimationValues(animDef, effectiveProgress * duration);\n\n // Apply each computed attribute\n for (const [attrName, value] of Object.entries(computedValues)) {\n adapter.setAttribute(binding.id, attrName, value);\n }\n }\n }\n\n\n ////////////////////////////////////////////////////////////////\n\n const tick = () => {\n\n // if root element provided and detached, stop\n if (!adapter.isConnected()) {\n // stop animation loop (we'll let external code call play/resume)\n // do not call onFinish here. It's a detach situation.\n pauseAnim();\n return;\n }\n\n const currentTime = getAnimCurrentTime();\n\n // Frame rate throttling: skip render if not enough time has passed\n if (minFrameIntervalMs > 0) {\n const now = Date.now();\n if (lastRenderTs && (now - lastRenderTs) < minFrameIntervalMs) {\n // Not enough time elapsed, skip this frame but continue the loop\n return;\n }\n lastRenderTs = now;\n }\n\n // If animation duration is zero or iterations zero, apply final or initial frames depending\n // duration=0 handling: treat as progress 0 and iteration 0, but if totalDuration === 0 and iterations>0, consider finished.\n if (duration <= 0) {\n // Apply initial keyframe or final depending on configuration.\n // We'll treat it as single-frame animation: apply keyframes with progress 0, then finish.\n // loop through animations and apply first keyframe (progress=0)\n }\n\n // Detect finished (natural end)\n if (totalDuration && Number.isFinite(totalDuration) && currentTime >= (totalDuration as number)) {\n // render final frame at the very end and then stop\n renderFrame(totalDuration);\n // call onFinish once\n if (!finishCalled) {\n finishCalled = true;\n callbacks?.onFinish?.();\n }\n pauseAnim();\n return;\n }\n\n // Otherwise render normal frame\n renderFrame(currentTime);\n };\n\n\n ////////////////////////////////////////////////////////////////\n\n\n if (config.delay) {\n // If startTime provided, we start paused but with that offset; render first frame.\n renderFrame(getAnimCurrentTime());\n }\n\n ////////////////////////////////////////////////////////////////\n\n const _isPlaying = () => {\n if (!playing) return false;\n if (!adapter.isConnected()) { return false; }\n if (Number.isFinite(totalDuration) && getAnimCurrentTime() >= (totalDuration as number)) return false;\n return true;\n };\n\n const loopAnim = (isFirst?: boolean) => {\n if (timerId !== null) {\n cancelAnimationFrame(timerId);\n timerId = null;\n }\n\n if (!(isFirst || _isPlaying())) {\n // finished or not playing\n return;\n }\n\n timerId = requestAnimationFrame(() => {\n timerId = null;\n tick();\n loopAnim();\n });\n };\n\n const startAnim = () => {\n if (playing) return;\n playing = true;\n lastStartedTs = Date.now();\n loopAnim(true);\n };\n\n const pauseAnim = () => {\n if (!playing) return;\n // capture current time\n timeBeforeLastStartMs = getAnimCurrentTime();\n lastStartedTs = 0;\n playing = false;\n\n if (timerId !== null) {\n cancelAnimationFrame(timerId);\n timerId = null;\n }\n // render a final frame at the paused time to ensure DOM consistent\n renderFrame(timeBeforeLastStartMs);\n };\n\n const cancelAnim = () => {\n pauseAnim();\n\n timeBeforeLastStartMs = 0;\n lastStartedTs = 0;\n playing = false;\n finishCalled = false;\n\n renderFrame(timeBeforeLastStartMs);\n\n callbacks?.onCancel?.();\n };\n\n const finishAnim = (callOnFinish = true) => {\n // jump to the end\n if (Number.isFinite(totalDuration)) {\n timeBeforeLastStartMs = totalDuration as number;\n } else {\n // infinity animations: set to current time (no-op)\n timeBeforeLastStartMs = getAnimCurrentTime();\n }\n lastStartedTs = 0;\n playing = false;\n // render final frame\n renderFrame(timeBeforeLastStartMs);\n\n if (callOnFinish && !finishCalled) {\n finishCalled = true;\n callbacks?.onFinish?.();\n }\n };\n\n ////////////////////////////////////////////////////////////////\n\n const api: PxAnimatorAPI = {\n\n \"isReady\": () => true,\n\n \"getRootElement\": () => null,\n\n \"isPlaying\": (): boolean => { return _isPlaying(); },\n\n \"play\": () => {\n startAnim();\n callbacks?.onPlay?.();\n },\n \"pause\": () => {\n pauseAnim();\n callbacks?.onPause?.();\n },\n \"cancel\": () => {\n cancelAnim();\n // onCancel already called in cancelAnim\n },\n \"finish\": () => {\n finishAnim(true);\n },\n\n \"setPlaybackRate\": (rate: number) => {\n if (!isFinite(rate) || rate === 0) {\n console.warn('setPlaybackRate: rate must be finite and non-zero');\n return;\n }\n // preserve current logical time when changing rate\n const current = getAnimCurrentTime();\n playbackRate = rate;\n timeBeforeLastStartMs = current;\n if (playing) lastStartedTs = Date.now();\n },\n\n \"getCurrentTime\": (): number | null => { return getAnimCurrentTime(); },\n\n \"setCurrentTime\": (newTime: number) => {\n // clamp newTime\n if (newTime < 0) newTime = 0;\n if (Number.isFinite(totalDuration) && newTime > (totalDuration as number)) newTime = totalDuration as number;\n\n timeBeforeLastStartMs = newTime;\n if (playing) lastStartedTs = Date.now();\n // render immediately to reflect the change\n renderFrame(getAnimCurrentTime());\n },\n\n \"destroy\": () => { api.cancel(); }\n };\n\n ////////////////////////////////////////////////////////////////\n\n return api;\n}\n\n\n////////////////////////////////////////////////////////////////\n// Browser DOM implementation\n////////////////////////////////////////////////////////////////\n\n\n\n/**\n * Creates an animator instance that uses a requestAnimationFrame loop for animations.\n * This is the browser DOM-specific version.\n *\n * @param {PxAnimatorCallbacksConfig=} callbacks Optional lifecycle callbacks.\n * @param {Element=} rootElement Optional pre-rendered root element.\n * @returns {PxAnimatorAPI} A PxAnimatorAPI instance.\n */\nexport function createFrameLoopAnimator(\n doc: PxAnimatedSvgDocument,\n adapter?: PxPlatformAdapter,\n callbacks?: PxAnimatorCallbacksConfig,\n rootElement?: Element | null\n): PxAnimatorAPI {\n\n const config = getAnimatorConfig(doc) || {};\n\n // Use provided root element or try to find by selector\n if (!rootElement) {\n if (doc.id) {\n const rootSelector = getSelector(doc.id);\n rootElement = document.querySelector(rootSelector);\n if (!rootElement) console.warn(\"createFrameLoopAnimator: No root element found for selector: \", rootSelector);\n } else {\n console.warn(\"createFrameLoopAnimator: No root element provided\");\n }\n }\n\n let api = createBasicFrameLoopAnimator(\n doc, \n adapter || createDomAdapter(rootElement), \n callbacks\n );\n\n api = {\n ...api,\n \"getRootElement\": () => rootElement || null\n };\n if (config.trigger) setupAnimationTriggers(api, config.trigger);\n return api;\n}\n\nexport function createDomAdapter(rootElement?: Element | null) {\n // Track warnings to avoid spamming console\n const warnedSelectors = new Set<string>();\n\n const adapter: PxPlatformAdapter = {\n isConnected: () => {\n if (!rootElement) return true; // No root element means we're always \"connected\"\n return rootElement.isConnected;\n },\n setAttribute: (id, attrName, value) => {\n\n attrName = camelCaseToKebabWordIfNeeded(attrName);\n\n const selector = getSelector(id);\n\n // Query elements by selector within root (or document if no root)\n const elements = rootElement?.querySelectorAll(selector) || document.querySelectorAll(selector);\n\n if (elements.length === 0 && !warnedSelectors.has(selector)) {\n warnedSelectors.add(selector);\n console.warn('setAttribute: No elements found for selector \"' + selector + '\"');\n }\n\n for (let i = 0; i < elements.length; i++) {\n const element = elements[i];\n element.setAttribute(attrName, value);\n if (STYLE_ATTR_NAMES.has(attrName)) {\n (element as HTMLElement).style[attrName as any] = value;\n }\n }\n },\n };\n return adapter;\n}","/*---------------------------------------------------------------------------------------\n * Copyright (c) Pixodesk LTD.\n * Licensed under the MIT License. See the LICENSE file in the project root for details.\n *---------------------------------------------------------------------------------------*/\n\nimport { getSelector } from './PxAnimatorFrameLoop';\nimport { setupAnimationTriggers } from './PxAnimatorTriggers';\nimport { getAnimatorConfig, PxAnimatedSvgDocument, PxAnimatorConfig, type PxAnimationDefinition, type PxAnimatorAPI, type PxAnimatorCallbacksConfig } from './PxAnimatorTypes';\nimport { clamp, COLOUR_ATTR_NAMES, kebabToCamelCaseWord, toRGBA, TRANSFORM_FN_NAMES } from './PxAnimatorUtil';\nimport { getNormalisedBindings } from './PxDefinitions';\n\n\n/**\n * Converts an animation definition to Web Animation API keyframes.\n * Returns an array of keyframes for each property.\n */\nfunction convertToWebApiKeyframes(\n animDef: PxAnimationDefinition,\n unsupportedSet: Set<string>,\n config: PxAnimatorConfig\n): Map<string, Keyframe[]> {\n const result = new Map<string, Keyframe[]>();\n\n for (const [propName, propAnim] of Object.entries(animDef)) {\n const keyframes = propAnim.kfs || propAnim.keyframes || [];\n const cssKeyframes: Keyframe[] = [];\n\n for (const kf of keyframes) {\n let t = kf.t ?? kf.time ?? 0;\n t = clamp(t / (config.duration || 1), 0, 1);\n let value = kf.v ?? kf.value;\n const e = kf.e ?? kf.easing;\n\n const cssKf: Keyframe = {\n offset: t,\n easing: e && Array.isArray(e) ? \"cubic-bezier(\" + e.join(',') + \")\" : undefined\n };\n\n let cssValue: any;\n let cssKey = propName;\n\n if (COLOUR_ATTR_NAMES.has(propName) && Array.isArray(value)) {\n cssValue = toRGBA(value);\n } else if (TRANSFORM_FN_NAMES.has(propName)) {\n if (Array.isArray(value)) {\n if (propName === 'translate') value = value.map(v => v + 'px');\n value = value.join(',');\n }\n if (propName === 'rotate') value = value + 'deg';\n cssValue = propName + '(' + value + ')';\n cssKey = 'transform';\n } else {\n cssValue = '' + value;\n }\n\n if (!CSS.supports(cssKey, cssValue)) unsupportedSet.add(cssKey);\n\n cssKey = kebabToCamelCaseWord(cssKey);\n cssKf[cssKey] = cssValue;\n cssKeyframes.push(cssKf);\n }\n\n if (cssKeyframes.length > 0) {\n result.set(propName, cssKeyframes);\n }\n }\n\n return result;\n}\n\n\n/**\n * Creates an animator instance that uses the native Web Animations API.\n *\n * This is the preferred, more performant animator. It will return null if the\n * animation configuration contains properties not supported by the browser's\n * Web Animations API implementation, unless forceEvenIfHasUnsupportedAttrs is true.\n *\n * @param callbacks Optional lifecycle callbacks.\n * @param rootElement Root element.\n * @param forceEvenIfHasUnsupportedAttrs If true, an animator will be created even if some CSS properties are not supported.\n * @returns An PxAnimatorAPI instance, or null if unsupported features are used and not forced.\n */\nexport function createWebApiAnimator(\n doc: PxAnimatedSvgDocument,\n callbacks?: PxAnimatorCallbacksConfig,\n rootElement?: Element | null,\n forceEvenIfHasUnsupportedAttrs?: boolean\n): PxAnimatorAPI | null {\n\n const config = getAnimatorConfig(doc) || {};\n\n const bindings = getNormalisedBindings(doc);\n\n // Use provided root element or try to find by selector\n if (!rootElement) {\n if (doc.id) {\n const rootSelector = getSelector(doc.id);\n rootElement = document.querySelector(rootSelector);\n if (!rootElement) console.warn(\"createFrameLoopAnimator: No root element found for selector: \", rootSelector);\n } else {\n console.warn(\"createFrameLoopAnimator: No root element provided\");\n }\n }\n\n const animations: Array<Animation> = [];\n\n const _iterations = config.iterations;\n let iterations: number | undefined;\n if (typeof _iterations === 'number') iterations = _iterations;\n if (_iterations === 'infinite') iterations = Infinity;\n\n const unsupportedSet = new Set<string>();\n\n ////////////////////////////////////////////////////////////////\n\n // Warn if no bindings defined\n if (!bindings?.length) {\n console.warn('createWebApiAnimator: No animation bindings defined');\n }\n\n for (const binding of bindings || []) {\n const animDef = binding.animate;\n if (!animDef || typeof animDef !== 'object' || Array.isArray(animDef)) {\n console.warn('createWebApiAnimator: Empty or unresolved binding', binding);\n continue;\n }\n\n const selector = getSelector(binding.id);\n\n // Use CSS selector to find elements\n const elements = rootElement?.querySelectorAll(selector) || document.querySelectorAll(selector);\n\n if (elements.length === 0) {\n console.warn('createWebApiAnimator: No elements found for selector \"' + selector + '\"');\n }\n\n // Convert animation definition to Web API keyframes\n const keyframesMap = convertToWebApiKeyframes(animDef, unsupportedSet, config);\n\n for (let i = 0; i < elements.length; i++) {\n const element = elements[i];\n\n // Delay handling:\n // - Positive delay (e.g., 500): Wait before starting → use `delay` option\n // - Negative delay (e.g., -500): Start mid-animation → use `currentTime` to seek\n // (Web Animations API doesn't reliably support negative delay values)\n // - Negative delay is wrapped to duration (e.g., -5000 with duration 2000 → seek to 1000)\n const positiveDelay = config.delay && config.delay > 0 ? config.delay : undefined;\n const seekPosition = config.delay && config.delay < 0 && config.duration\n ? (-config.delay) % config.duration\n : undefined;\n\n const effectOptions: KeyframeEffectOptions = {\n duration: config.duration,\n delay: positiveDelay,\n fill: config.fill,\n direction: config.direction,\n iterations: iterations\n };\n\n for (const [, keyframes] of keyframesMap) {\n if (keyframes.length > 0) {\n try {\n const effect = new KeyframeEffect(element, keyframes, effectOptions);\n const anim = new Animation(effect, document.timeline);\n\n if (callbacks?.onFinish) anim.onfinish = () => callbacks.onFinish?.();\n if (callbacks?.onRemove) anim.onremove = () => callbacks.onRemove?.();\n\n // Seek forward for negative delay (e.g., delay=-500 → seek to 500ms)\n if (seekPosition) {\n anim.currentTime = seekPosition;\n }\n\n animations.push(anim);\n } catch (e) {\n console.warn(e);\n }\n }\n }\n }\n }\n\n ////////////////////////////////////////////////////////////////\n\n if (!forceEvenIfHasUnsupportedAttrs && unsupportedSet.size) {\n console.warn('Unsupported CSS attrs: ' + [...unsupportedSet].join(', '));\n return null;\n }\n\n ////////////////////////////////////////////////////////////////\n\n const api: PxAnimatorAPI = {\n\n \"isReady\": () => true,\n\n \"getRootElement\": () => rootElement || null,\n\n \"isPlaying\": (): boolean => { return animations[0]?.playState === 'running'; },\n\n \"play\": () => {\n animations.forEach(a => a.play());\n callbacks?.onPlay?.();\n },\n \"pause\": () => {\n animations.forEach(a => a.pause());\n callbacks?.onPause?.();\n },\n \"cancel\": () => {\n animations.forEach(a => a.cancel());\n callbacks?.onCancel?.(); // FIXME onFinished needs to be called when animation finishes, e.g. from animations, and some flag that it was triggered by user\n },\n \"finish\": () => {\n animations.forEach(a => a.finish()); // FIXME onFinished needs to be called when animation finishes, e.g. from animations, not only when you call finish manually\n },\n\n \"setPlaybackRate\": (rate: number) => {\n animations.forEach(a => (a.playbackRate = rate));\n return api;\n },\n \"getCurrentTime\": (): number | null => {\n const res = animations[0]?.currentTime ?? null;\n return res !== null ? +res : null;\n },\n \"setCurrentTime\": (time: number) => {\n animations.forEach(a => {\n a.currentTime = time;\n });\n },\n\n \"destroy\": () => {\n api.cancel();\n animations.splice(0, animations.length);\n }\n };\n\n ////////////////////////////////////////////////////////////////\n\n if (config.trigger) {\n setupAnimationTriggers(api, config.trigger);\n }\n\n return api;\n}\n","/*---------------------------------------------------------------------------------------\n * Copyright (c) Pixodesk LTD.\n * Licensed under the MIT License. See the LICENSE file in the project root for details.\n *---------------------------------------------------------------------------------------*/\n\nimport { renderNode } from './PxAnimatorDOM';\nimport { createFrameLoopAnimator, PxPlatformAdapter } from './PxAnimatorFrameLoop';\nimport { setupAnimationTriggers } from './PxAnimatorTriggers';\nimport { getAnimatorConfig, isPxElementFileFormat, PX_ANIM_ATTR_NAME, PX_ANIM_SRC_ATTR_NAME, type PxAnimatedSvgDocument, type PxAnimatorAPI, type PxAnimatorCallbacksConfig } from './PxAnimatorTypes';\nimport { createWebApiAnimator } from './PxAnimatorWebApi';\n\n\n/**\n * Creates an animator instance from a normalized player config.\n * This is the internal implementation that both engines use.\n */\nfunction createAnimatorFromConfig(\n doc: PxAnimatedSvgDocument,\n adapter?: PxPlatformAdapter,\n callbacks?: PxAnimatorCallbacksConfig,\n rootElement?: Element | null\n): PxAnimatorAPI {\n\n const animatorConfig = getAnimatorConfig(doc) || {};\n\n let res: PxAnimatorAPI;\n if (animatorConfig.mode === 'frames') {\n // Forcing \"frames\", even if \"webapi\" can be used\n res = createFrameLoopAnimator(doc, adapter, callbacks, rootElement);\n } else {\n // Trying \"webapi\" first\n res = (\n createWebApiAnimator(doc, callbacks, rootElement,\n animatorConfig.mode === 'webapi' // Forcing \"webapi\"\n ) ||\n createFrameLoopAnimator(doc, adapter, callbacks, rootElement) // \"webapi\" has unsupported attrs and wasn't forced, returned null, fallback to \"frames\"\n );\n }\n\n if (animatorConfig.debugInstName) {\n (window as any)[animatorConfig.debugInstName] = res; // Exposing as global variable for debug\n }\n\n return res;\n}\n\n\n/**\n * Generates a unique ID with a random suffix.\n * Format: _px_{random base36 string}\n */\nlet _idCounter = 0;\nfunction generateUniqueId(): string {\n const timestamp = Date.now().toString(36);\n const counter = (++_idCounter).toString(36);\n const random = Math.random().toString(36).substring(2, 6);\n return '_px_' + timestamp + counter + random;\n}\n\n/**\n * Deep clones a JSON-like value (objects, arrays, primitives).\n * Does not handle special types like Date, Map, Set, functions, etc.\n */\nfunction deepClone<T>(value: T): T {\n if (value === null || typeof value !== 'object') return value;\n if (Array.isArray(value)) return value.map(item => deepClone(item)) as T;\n\n const obj = value as Record<string, unknown>;\n\n const cloned: Record<string, unknown> = {};\n for (const key of Object.keys(obj)) {\n cloned[key] = deepClone(obj[key]);\n }\n return cloned as T;\n}\n\n/**\n * Regenerates all IDs in the document and updates references.\n *\n * This function:\n * 1. Deep clones the document to avoid mutating the original\n * 2. Traverses all nodes and regenerates IDs, keeping a mapping of old → new\n * 3. Updates all references to old IDs in attributes:\n * - Hash references: \"#old-id\" → \"#new-id\" (href, xlink:href)\n * - URL references: \"url(#old-id)\" → \"url(#new-id)\" (fill, clip-path, mask, marker, etc.)\n * - Style URL references: { offsetPath: \"url(#old-id)\" }\n *\n * @param doc - The animated SVG document to process\n * @returns A new document with regenerated IDs\n */\nexport function generateNewIds(doc: PxAnimatedSvgDocument): PxAnimatedSvgDocument {\n // Deep clone the document\n const cloned: PxAnimatedSvgDocument = deepClone(doc);\n\n // Map of old ID → new ID\n const idMap = new Map<string, string>();\n\n // Attributes that contain hash references (#id)\n const hashRefAttrs = new Set(['href', 'xlink:href']);\n\n // Attributes that contain url(#id) references\n const urlRefAttrs = new Set([\n 'fill', 'stroke', 'clip-path', 'clipPath', 'mask',\n 'marker', 'marker-start', 'marker-mid', 'marker-end',\n 'filter', 'flood-color', 'lighting-color'\n ]);\n\n // Attributes that contain direct ID references (no # or url())\n const directIdRefAttrs = new Set(['baseId', 'targetId', 'boundElementId']);\n\n // Phase 1: Collect all IDs and generate new ones\n function collectIds(node: any): void {\n if (!node || typeof node !== 'object') return;\n\n if (node.id && typeof node.id === 'string') {\n const oldId = node.id;\n const newId = generateUniqueId();\n idMap.set(oldId, newId);\n node.id = newId;\n }\n\n // Process children\n if (Array.isArray(node.children)) {\n for (const child of node.children) {\n collectIds(child);\n }\n }\n }\n\n // Phase 2: Update all references to old IDs\n function updateRefs(node: any): void {\n if (!node || typeof node !== 'object') return;\n\n for (const [key, value] of Object.entries(node)) {\n if (key === 'children') {\n if (Array.isArray(value)) {\n for (const child of value) {\n updateRefs(child);\n }\n }\n continue;\n }\n\n if (typeof value === 'string') {\n // Check for hash references: href=\"#old-id\"\n if (hashRefAttrs.has(key) && value.startsWith('#')) {\n const oldId = value.slice(1);\n const newId = idMap.get(oldId);\n if (newId) {\n node[key] = '#' + newId;\n }\n }\n // Check for url() references: fill=\"url(#old-id)\"\n else if (urlRefAttrs.has(key)) {\n node[key] = replaceUrlRefs(value, idMap);\n }\n // Check for direct ID references: baseId=\"_px_xxx\"\n else if (directIdRefAttrs.has(key)) {\n const newId = idMap.get(value);\n if (newId) {\n node[key] = newId;\n }\n }\n // Check for url() in any string value (e.g., in style strings)\n else if (value.includes('url(#')) {\n node[key] = replaceUrlRefs(value, idMap);\n }\n }\n // Check style object for url() references\n else if (key === 'style' && typeof value === 'object' && value !== null) {\n for (const [styleProp, styleValue] of Object.entries(value)) {\n if (typeof styleValue === 'string') {\n (value as any)[styleProp] = replaceUrlRefs(styleValue, idMap);\n }\n }\n }\n // Recursively process nested objects (meta contains baseId/targetId refs)\n // Skip 'animate' as it contains animation data, not ID references\n else if (typeof value === 'object' && value !== null && key !== 'animate') {\n updateRefs(value);\n }\n }\n }\n\n collectIds(cloned);\n updateRefs(cloned);\n\n // Update IDs in bindings\n const docBindings = cloned.bindings;\n if (Array.isArray(docBindings)) {\n for (const binding of docBindings) {\n if (binding.id) {\n const newId = idMap.get(binding.id);\n if (newId) {\n binding.id = newId;\n }\n }\n }\n }\n\n return cloned;\n}\n\n/**\n * Replaces url(#old-id) references in a string with new IDs from the map.\n */\nfunction replaceUrlRefs(value: string, idMap: Map<string, string>): string {\n return value.replace(/url\\(#([^)]+)\\)/g, (match, oldId) => {\n const newId = idMap.get(oldId);\n return newId ? 'url(#' + newId + ')' : match;\n });\n}\n\n/**\n * Creates an animator instance from an AnimatedSvgDocument.\n *\n * This function serves as the main entry point for the animation library. It automatically\n * chooses the best animation engine available ('webapi' or 'frames') or can be\n * forced to use a specific one.\n *\n * @param doc The animated SVG document.\n * @param callbacks Optional object with callback functions for animation lifecycle events (play, pause, finish, etc.).\n * @param containerElement Optional selector or element to render the SVG into.\n * @returns An PxAnimatorAPI instance to programmatically control the animation.\n */\nexport function createAnimatorImpl(\n doc: PxAnimatedSvgDocument,\n adapter?: PxPlatformAdapter,\n callbacks?: PxAnimatorCallbacksConfig,\n containerElement?: string | Element\n): PxAnimatorAPI {\n\n // Normalize the document to internal format\n const animatorConfig = getAnimatorConfig(doc) || {};\n\n animatorConfig.debug = true; // FIXME\n\n let rootElement: Element | null = null;\n\n // Render the SVG content if we have a container and children\n if (containerElement && doc.children) {\n\n doc = generateNewIds(doc); // Regenerate IDs so repeated calls to createAnimator(...) produce different ids in elements\n\n const containerEl = typeof containerElement === 'string' ?\n document.querySelector(containerElement) : containerElement;\n\n if (containerEl) {\n rootElement = renderNode(doc);\n if (rootElement) {\n containerEl.replaceChildren(rootElement);\n }\n }\n }\n\n return createAnimatorFromConfig(doc, adapter, callbacks, rootElement);\n}\n\n/**\n * Creates an animator instance to control SVG animations.\n * Accepts either a document object or a URL to fetch.\n *\n * @param docOrUrl The animated SVG document or URL to fetch it from.\n * @param callbacks Optional object with callback functions for animation lifecycle events.\n * @param containerElement Optional selector or element to render the SVG into.\n * @returns An PxAnimatorAPI instance to programmatically control the animation.\n */\nexport function createAnimator(\n docOrUrl: PxAnimatedSvgDocument | string,\n adapter?: PxPlatformAdapter,\n callbacks?: PxAnimatorCallbacksConfig,\n containerElement?: string | Element\n): PxAnimatorAPI {\n\n if (typeof docOrUrl === 'object') {\n return createAnimatorImpl(docOrUrl, adapter, callbacks, containerElement);\n }\n\n // URL provided - fetch and create animator\n let animator: PxAnimatorAPI | null = null;\n\n fetch(docOrUrl).then(res => res.json()).then(json => {\n if (isPxElementFileFormat(json)) {\n animator = createAnimatorImpl(json, adapter, callbacks, containerElement);\n } else {\n console.error('Invalid animation document format');\n }\n });\n\n // Return a proxy that forwards calls once loaded\n return {\n \"isReady\": () => !!animator,\n \"getRootElement\": () => animator ? animator.getRootElement() : null,\n \"isPlaying\": () => animator?.isPlaying() || false,\n \"play\": () => { animator?.play(); },\n \"pause\": () => { animator?.pause(); },\n \"cancel\": () => { animator?.cancel(); },\n \"finish\": () => { animator?.finish(); },\n \"setPlaybackRate\": (rate: number) => { animator?.setPlaybackRate(rate); },\n \"getCurrentTime\": () => animator?.getCurrentTime() || 0,\n \"setCurrentTime\": (time: number) => { animator?.setCurrentTime(time); },\n \"destroy\": () => { animator?.destroy(); }\n };\n}\n\n/**\n * Scan and load for tags, e.g.\n * <div data-px-animation-src=\"animation.json\"></div>\n */\nexport function loadTagAnimators() {\n const elements = document.querySelectorAll('[' + PX_ANIM_SRC_ATTR_NAME + ']');\n for (let i = 0; i < elements.length; i++) {\n const element = elements[i];\n if (!(element as any)[PX_ANIM_ATTR_NAME]) {\n const src = element.getAttribute(PX_ANIM_SRC_ATTR_NAME);\n if (src) {\n (element as any)[PX_ANIM_ATTR_NAME] = createAnimator(src, undefined, undefined, element);\n }\n }\n }\n}\n\nif (typeof window !== 'undefined') {\n (window as any)[\"loadTagAnimators\"] = loadTagAnimators;\n (window as any)[\"createAnimator\"] = createAnimator;\n (window as any)[\"setupAnimationTriggers\"] = setupAnimationTriggers;\n}","import type { PxAnimatedSvgDocument, PxAnimatorAPI, PxNode, PxPlatformAdapter, PxTrigger } from '@pixodesk/svg-animator-web';\nimport { camelCaseToKebabWordIfNeeded, createAnimator, FillMode, generateNewIds, getNormalizedProps, STYLE_ATTR_NAMES } from '@pixodesk/svg-animator-web';\nimport type { CSSProperties, FC, ReactElement } from 'react';\nimport React, { createElement, useEffect, useImperativeHandle, useRef } from 'react';\nimport { useDepsVersion } from './Utils';\n\n\n// -- Public types -----------------------------------------------------------\n\nexport interface ReactAnimatorApi {\n /** Returns true if the animation is currently running. */\n isPlaying(): boolean;\n\n /** Starts or resumes the animation. */\n play(): void;\n\n /** Pauses the animation at its current state. */\n pause(): void;\n\n /** Stops the animation and resets it to its initial state. */\n cancel(): void;\n\n /** Jumps to the end of the animation and holds the final state. */\n finish(): void;\n\n /** Returns the current playback time in milliseconds. */\n getCurrentTime(): number | null;\n\n /** Jumps to a specific time (in milliseconds) in the animation. */\n setCurrentTime(time: number): void;\n}\n\nexport interface PixodeskSvgAnimatorImplProps {\n className?: string;\n style?: CSSProperties;\n doc: PxAnimatedSvgDocument;\n compMode: PixodeskSvgAnimatorCompMode;\n\n /** Imperative API handle populated by the inner component. */\n apiHolderRef: React.RefObject<PxAnimatorAPI | null>;\n}\n\nexport interface PixodeskSvgAnimatorProps {\n\n className?: string;\n\n style?: CSSProperties;\n\n // -- Source ---------------------------------------------------------------\n\n /**\n * The animation document to render.\n *\n * TODO: Accept PxFileConfig | string to support URL-based loading, e.g.\n * <PixodeskSvgAnimator doc=\"/animation.json\" />\n */\n doc: PxAnimatedSvgDocument;\n\n // -- Timeline ------------------------------------------------------------\n\n timeline?: 'time' | 'scroll';\n\n // -- Rendering mode ------------------------------------------------------\n\n /** Forces a specific rendering engine. Defaults to 'auto'. */\n mode?: 'webapi' | 'frames' | 'auto';\n\n // -- Timing overrides ----------------------------------------------------\n\n /** Delay before the animation starts, in milliseconds. */\n delay?: number;\n\n /** Defines the element's style when the animation is not active. */\n fill?: FillMode;\n\n /** Number of iterations, or 'infinite' for endless looping. */\n iterations?: number | 'infinite';\n\n /** Duration of a single iteration in milliseconds. */\n duration?: number;\n\n /** Playback direction. */\n direction?: PlaybackDirection;\n\n /** Target frame rate (frames per second). */\n frameRate?: number;\n\n // -- Trigger overrides ---------------------------------------------------\n\n /** The event that starts the animation. When omitted, uses the value from the document config. */\n startOn?: 'load' | 'mouseOver' | 'click' | 'scrollIntoView' | 'programmatic';\n\n /** Behaviour when the trigger condition ends (e.g. mouse-out, second click). */\n outAction?: 'continue' | 'pause' | 'reset' | 'reverse';\n\n /** Visibility ratio (0.0–1.0) required to trigger a scrollIntoView animation. Defaults to 0.5. */\n scrollIntoViewThreshold?: number;\n\n // -- Declarative control -------------------------------------------------\n\n /** When true, uses triggers defined in the animation document. */\n autoplay?: boolean;\n\n /**\n * Starts the animation unconditionally, ignoring document triggers.\n * Equivalent to `startOn=\"load\"` / `outAction=\"continue\"`.\n */\n play?: boolean;\n\n /** Pauses current playback. Only meaningful when `play` or `autoplay` is set. */\n pause?: boolean;\n\n // -- Imperative control --------------------------------------------------\n\n /** Ref populated with the imperative playback API. */\n apiRef?: React.RefObject<ReactAnimatorApi | null>;\n\n // -- Controlled (external) time ------------------------------------------\n\n /** Seek to a specific point in the animation (fractional). */\n time?: number;\n\n /** Seek to a specific point in the animation (milliseconds). */\n timeMs?: number;\n\n // -- Callbacks -----------------------------------------------------------\n\n /** Called when the animation starts or resumes. */\n onPlay?: () => void;\n\n /** Called when the animation stops for any reason (pause / cancel / finish / removal). */\n onStop?: () => void; // FIXME: consider a more descriptive name\n\n /** Called when the animation is paused. */\n onPause?: () => void;\n\n /** Called when the animation is cancelled. */\n onCancel?: () => void;\n\n /** Called when the animation finishes naturally. */\n onFinish?: () => void;\n\n /** Called when the animation is removed. */\n onRemove?: () => void;\n\n // -- Diagnostics ---------------------------------------------------------\n\n onWarning?: (msg: string) => void;\n onError?: (msg: string) => void;\n}\n\n\n// -- Internal types ---------------------------------------------------------\n\nenum PixodeskSvgAnimatorCompMode {\n static = 'static',\n autoplay = 'autoplay',\n play = 'play',\n imperativeApi = 'imperativeApi',\n fixedTime = 'fixedTime'\n}\n\n\n// -- React ↔ Animator bridge ------------------------------------------------\n\n/**\n * Creates a platform adapter that routes animator attribute updates\n * to the corresponding React-managed DOM refs.\n */\nexport function createReactAdapter(elementRefs: React.RefObject<Map<string, any>>) {\n const warnedSelectors = new Set<string>();\n\n const adapter: PxPlatformAdapter = {\n isConnected: () => {\n return true;\n },\n setAttribute: (id, attrName, value) => {\n\n attrName = camelCaseToKebabWordIfNeeded(attrName);\n\n const selector = getSelector(id);\n\n const element = elementRefs.current.get(id);\n\n if (!element && !warnedSelectors.has(selector)) {\n warnedSelectors.add(selector);\n console.warn('setAttribute: No elements found for selector \"' + selector + '\"');\n console.warn(elementRefs.current);\n }\n\n if (element) {\n element.setAttribute(attrName, value);\n if (STYLE_ATTR_NAMES.has(attrName)) {\n (element as HTMLElement).style[attrName as any] = value;\n }\n }\n },\n };\n return adapter;\n}\n\nexport function getSelector(id: string) {\n return '#' + id;\n}\n\n// FIXME: add model validation (e.g. isElementFileJson check)\n\n\n// -- Inner component (memoised, never re-renders) ---------------------------\n\nconst PixodeskSvgAnimatorImpl: FC<PixodeskSvgAnimatorImplProps> = ({\n className, style, doc, compMode, apiHolderRef\n}) => {\n\n doc = generateNewIds(doc);\n\n const elementRefs = useRef(new Map<string, any>());\n\n const renderNode = (node: PxNode | undefined): ReactElement | null => {\n if (!node) return null;\n\n const { type, animate, meta, children, ...props } = node;\n\n const normProps = getNormalizedProps(props);\n\n normProps['ref'] = (domEl: any) => {\n if (node['id']) elementRefs.current.set(node['id'], domEl);\n // return () => {};\n };\n\n return createElement(type, normProps, children?.map(child => renderNode(child)));\n };\n\n const root = doc ? renderNode(doc) : null;\n\n // Create the animator once per document and tear it down on unmount.\n useEffect(() => {\n\n let api: PxAnimatorAPI | undefined = createAnimator(doc, createReactAdapter(elementRefs));\n apiHolderRef.current = api;\n\n return () => {\n api?.destroy();\n apiHolderRef.current = null;\n };\n }, [doc, apiHolderRef]);\n\n return root;\n};\n\n/** Memoised wrapper — the inner component never re-renders (props are stable by design). */\nconst PixodeskSvgAnimatorImplOnce = React.memo(\n PixodeskSvgAnimatorImpl,\n () => true // Don't re-render\n);\n\n\n// -- Main public component --------------------------------------------------\n\n/**\n * React component for rendering and controlling Pixodesk SVG animations.\n *\n * Supports four mutually-exclusive control modes:\n *\n * 1. **Autoplay** – uses triggers from the animation document.\n * ```tsx\n * <PixodeskSvgAnimator doc={animation} autoplay />\n * ```\n *\n * 2. **Declarative play/pause** – controlled via boolean props.\n * ```tsx\n * <PixodeskSvgAnimator doc={animation} play pause={false} />\n * ```\n *\n * 3. **Imperative** – exposes a ref-based API for full programmatic control.\n * ```tsx\n * const api = useRef<ReactAnimatorApi>(null);\n * <PixodeskSvgAnimator doc={animation} apiRef={api} />\n * <button onClick={() => api.current?.play()}>Play</button>\n * ```\n *\n * 4. **Controlled time** – renders a single frame at a given time.\n * ```tsx\n * <PixodeskSvgAnimator doc={animation} time={0.5} />\n * <PixodeskSvgAnimator doc={animation} timeMs={500} />\n * ```\n */\nconst PixodeskSvgAnimator: FC<PixodeskSvgAnimatorProps> = ({\n className, style,\n doc, autoplay, play, pause, time, timeMs, apiRef,\n timeline,\n\n // Overrides\n mode, delay, fill, iterations, duration, direction, frameRate,\n\n startOn, outAction, scrollIntoViewThreshold\n}) => {\n\n // Determine which control mode is active.\n let compMode = PixodeskSvgAnimatorCompMode.static;\n if (apiRef) {\n compMode = PixodeskSvgAnimatorCompMode.imperativeApi;\n } else if (autoplay) {\n compMode = PixodeskSvgAnimatorCompMode.autoplay;\n } else if (time !== undefined || timeMs !== undefined) {\n compMode = PixodeskSvgAnimatorCompMode.fixedTime;\n } else {\n compMode = PixodeskSvgAnimatorCompMode.play;\n }\n\n // In non-autoplay modes, override the document trigger to 'programmatic'\n // so the component can manage playback itself.\n if (compMode !== PixodeskSvgAnimatorCompMode.autoplay) {\n const startOn = doc.animator?.trigger?.startOn;\n if (\n startOn &&\n startOn !== 'programmatic' // FIXME: use enum\n ) {\n doc = {\n ...doc,\n animator: {\n ...doc.animator,\n trigger: {\n ...doc.animator?.trigger,\n startOn: 'programmatic' // FIXME: use enum\n }\n }\n };\n }\n }\n\n // Apply timing overrides from props onto the document config.\n if (\n mode !== undefined ||\n duration !== undefined ||\n delay !== undefined ||\n iterations !== undefined ||\n fill !== undefined ||\n direction !== undefined ||\n frameRate !== undefined\n ) {\n const animator = doc.animator || {};\n doc = {\n ...doc,\n animator: {\n ...animator,\n mode: mode !== undefined ? mode : animator.mode,\n duration: duration !== undefined ? duration : animator.duration,\n delay: delay !== undefined ? delay : animator.delay,\n iterations: iterations !== undefined ? iterations : animator.iterations,\n fill: fill !== undefined ? fill : animator.fill,\n direction: direction !== undefined ? direction : animator.direction,\n frameRate: frameRate !== undefined ? frameRate : animator.frameRate\n }\n };\n }\n\n // Apply trigger overrides from props.\n if (\n startOn !== undefined ||\n outAction !== undefined ||\n scrollIntoViewThreshold !== undefined\n ) {\n const trigger: PxTrigger = doc.animator?.trigger || {};\n doc = {\n ...doc,\n animator: {\n ...doc.animator,\n trigger: {\n ...trigger,\n startOn: startOn !== undefined ? startOn : trigger.startOn,\n outAction: outAction !== undefined ? outAction : trigger.outAction,\n scrollIntoViewThreshold: scrollIntoViewThreshold !== undefined ? scrollIntoViewThreshold : trigger.scrollIntoViewThreshold\n }\n }\n };\n }\n\n // In controlled-time mode, use a negative delay to seek to the given frame.\n if (compMode === PixodeskSvgAnimatorCompMode.fixedTime) {\n let delay = 0;\n if (time !== undefined) delay = -time; // FIXME: time as a fraction of total duration?\n if (timeMs !== undefined) delay = -timeMs;\n const animator = doc.animator || {};\n doc = {\n ...doc,\n animator: {\n ...animator,\n delay\n }\n };\n }\n\n const apiHolderRef = useRef<PxAnimatorAPI | null>(null);\n\n // Expose the imperative API via the consumer-provided ref.\n useImperativeHandle(apiRef, () => {\n return {\n isPlaying: () => apiHolderRef.current?.isPlaying() || false,\n play: () => apiHolderRef.current?.play(),\n pause: () => apiHolderRef.current?.pause(),\n cancel: () => apiHolderRef.current?.cancel(),\n finish: () => apiHolderRef.current?.finish(),\n getCurrentTime: () => apiHolderRef.current?.getCurrentTime() || null,\n setCurrentTime: (time: number) => apiHolderRef.current?.setCurrentTime(time),\n };\n }, []);\n\n // Sync declarative play/pause props with the animator.\n useEffect(() => {\n\n if (compMode === PixodeskSvgAnimatorCompMode.play) {\n if (play && !pause) {\n apiHolderRef.current?.play();\n } else if (pause) {\n apiHolderRef.current?.pause();\n } else {\n apiHolderRef.current?.finish();\n }\n }\n\n return () => {\n if (compMode === PixodeskSvgAnimatorCompMode.play) {\n apiHolderRef.current?.pause(); // FIXME - implement\n }\n };\n }, [compMode, play, pause]);\n\n // Increment key when the document or mode changes to force a full remount.\n const key = useDepsVersion(compMode, doc);\n\n return (\n <PixodeskSvgAnimatorImplOnce\n key={key}\n compMode={compMode}\n doc={doc}\n apiHolderRef={apiHolderRef}\n />\n );\n};\n\nexport default PixodeskSvgAnimator;","import { useRef } from 'react';\n\nexport function deepEquals(a: any, b: any): boolean {\n // Handle primitives and null\n if (a === b) return true;\n if (a == null || b == null) return false;\n if (typeof a !== 'object' || typeof b !== 'object') return false;\n\n // Check for cycles using WeakSet\n const seen = new WeakSet();\n\n function equals(x: any, y: any): boolean {\n // Primitive/null check\n if (x === y) return true;\n if (x == null || y == null) return false;\n if (typeof x !== 'object' || typeof y !== 'object') return false;\n\n // Cycle detection\n if (seen.has(x)) {\n throw new Error('Circular reference detected');\n }\n seen.add(x);\n\n // Array check\n const xIsArray = Array.isArray(x);\n const yIsArray = Array.isArray(y);\n if (xIsArray !== yIsArray) return false;\n\n if (xIsArray) {\n if (x.length !== y.length) return false;\n for (let i = 0; i < x.length; i++) {\n if (!equals(x[i], y[i])) return false;\n }\n return true;\n }\n\n // Object check\n const xKeys = Object.keys(x);\n const yKeys = Object.keys(y);\n if (xKeys.length !== yKeys.length) return false;\n\n for (const key of xKeys) {\n if (!yKeys.includes(key)) return false;\n if (!equals(x[key], y[key])) return false;\n }\n\n return true;\n }\n\n return equals(a, b);\n}\n\n\n/**\n * Compares two arrays of dependencies using identity check first (===),\n * falling back to deep equality if references differ.\n * This is optimized for immutable data that may be recreated with same values.\n */\nfunction areDepsEqual(prevDeps: Array<any>, nextDeps: Array<any>): boolean {\n if (prevDeps.length !== nextDeps.length) return false;\n\n for (let i = 0; i < prevDeps.length; i++) {\n // Fast path: same reference (common for immutable data)\n if (prevDeps[i] === nextDeps[i]) continue;\n\n // Slow path: different reference but possibly same content\n if (!deepEquals(prevDeps[i], nextDeps[i])) return false;\n }\n\n return true;\n}\n\n/**\n * Returns a stable numeric version ID that only increments when dependencies\n * actually change (by reference or deep equality).\n */\nexport function useDepsVersion(...deps: Array<any>): number {\n const cache = useRef<{\n versionId: number;\n deps: Array<any>;\n } | null>(null);\n\n // First render - initialize with version 1\n if (cache.current === null) {\n cache.current = {\n versionId: 1,\n deps: deps\n };\n return 1;\n }\n\n // Check if any dependency changed (by reference or value)\n if (!areDepsEqual(cache.current.deps, deps)) {\n // Dependencies changed - increment version and update cache\n cache.current = {\n versionId: cache.current.versionId + 1,\n deps: deps\n };\n }\n\n return cache.current.versionId;\n}"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAWA,UAAI,qBAAqB,uBAAO,IAAI,4BAA4B;AAAhE,UACE,oBAAoB,uBAAO,IAAI,cAAc;AAD/C,UAEE,sBAAsB,uBAAO,IAAI,gBAAgB;AAFnD,UAGE,yBAAyB,uBAAO,IAAI,mBAAmB;AAHzD,UAIE,sBAAsB,uBAA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AAO;AAChB,uBAAa,SAAS,KAAK;AAAA,QAC/B,WAAW,OAAO;AACd,uBAAa,SAAS,MAAM;AAAA,QAChC,OAAO;AACH,uBAAa,SAAS,OAAO;AAAA,QACjC;AAAA,MACJ;AAEA,aAAO,MAAM;AACT,YAAI,aAAa,mBAAkC;AAC/C,uBAAa,SAAS,MAAM;AAAA,QAChC;AAAA,MACJ;AAAA,IACJ,GAAG,CAAC,UAAU,MAAM,KAAK,CAAC;AAG1B,UAAM,MAAM,eAAe,UAAU,GAAG;AAExC,WACI;AAAA,MAAC;AAAA;AAAA,QAEG;AAAA,QACA;AAAA,QACA;AAAA;AAAA,MAHK;AAAA,IAIT;AAAA,EAER;AAEA,MAAO,8BAAQ;","names":["React","_a","_b","effectiveProgress","import_react","getSelector","renderNode","React","startOn","delay","time"]}
|
|
1
|
+
{"version":3,"sources":["../../../node_modules/.pnpm/react@19.2.4/node_modules/react/cjs/react.production.js","../../../node_modules/.pnpm/react@19.2.4/node_modules/react/cjs/react.development.js","../../../node_modules/.pnpm/react@19.2.4/node_modules/react/index.js","../../../node_modules/.pnpm/react@19.2.4/node_modules/react/cjs/react-jsx-runtime.production.js","../../../node_modules/.pnpm/react@19.2.4/node_modules/react/cjs/react-jsx-runtime.development.js","../../../node_modules/.pnpm/react@19.2.4/node_modules/react/jsx-runtime.js","../src/index.ts","../../svg-animator-web/src/effects/transformParts.ts","../../svg-animator-web/src/effects/transformationEffect.ts","../../svg-animator-web/src/effects/contentRefSplit.ts","../../svg-animator-web/src/effects/util.ts","../../svg-animator-web/src/effects/maskedByEffect.ts","../../svg-animator-web/src/effects/refEffect.ts","../../svg-animator-web/src/effects/repeaterEffect.ts","../../svg-animator-web/src/effects/retimeEffect.ts","../../svg-animator-web/src/effects/trimPathEffect.ts","../../svg-animator-web/src/effects/PlayerEffectsUtil.ts","../../svg-animator-web/src/PxSchema.ts","../../svg-animator-web/src/PxAnimatorTypes.ts","../../svg-animator-web/src/PxAnimatorUtil.ts","../../svg-animator-web/src/PxAnimatorDOM.ts","../../svg-animator-web/src/PxAnimatorTriggers.ts","../../svg-animator-web/src/PxMotionPath.ts","../../svg-animator-web/src/PxDefinitions.ts","../../svg-animator-web/src/PxAnimatorFrameLoop.ts","../../svg-animator-web/src/PxAnimatorWebApi.ts","../../svg-animator-web/src/PxAnimator.ts","../../svg-animator-web/src/effects/PlayerEffectsUtil.visualModel.ts","../src/PixodeskSvgAnimator.tsx","../src/Utils.ts","../src/PixodeskSvgCssAnimator.tsx"],"sourcesContent":["/**\n * @license React\n * react.production.js\n *\n * Copyright (c) Meta Platforms, Inc. and affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\n\"use strict\";\nvar REACT_ELEMENT_TYPE = Symbol.for(\"react.transitional.element\"),\n REACT_PORTAL_TYPE = Symbol.for(\"react.portal\"),\n REACT_FRAGMENT_TYPE = Symbol.for(\"react.fragment\"),\n REACT_STRICT_MODE_TYPE = Symbol.for(\"react.strict_mode\"),\n REACT_PROFILER_TYPE = Symbol.for(\"react.profiler\"),\n REACT_CONSUMER_TYPE = Symbol.for(\"react.consumer\"),\n REACT_CONTEXT_TYPE = Symbol.for(\"react.context\"),\n REACT_FORWARD_REF_TYPE = Symbol.for(\"react.forward_ref\"),\n REACT_SUSPENSE_TYPE = Symbol.for(\"react.suspense\"),\n REACT_MEMO_TYPE = Symbol.for(\"react.memo\"),\n REACT_LAZY_TYPE = Symbol.for(\"react.lazy\"),\n REACT_ACTIVITY_TYPE = Symbol.for(\"react.activity\"),\n MAYBE_ITERATOR_SYMBOL = Symbol.iterator;\nfunction getIteratorFn(maybeIterable) {\n if (null === maybeIterable || \"object\" !== typeof maybeIterable) return null;\n maybeIterable =\n (MAYBE_ITERATOR_SYMBOL && maybeIterable[MAYBE_ITERATOR_SYMBOL]) ||\n maybeIterable[\"@@iterator\"];\n return \"function\" === typeof maybeIterable ? maybeIterable : null;\n}\nvar ReactNoopUpdateQueue = {\n isMounted: function () {\n return !1;\n },\n enqueueForceUpdate: function () {},\n enqueueReplaceState: function () {},\n enqueueSetState: function () {}\n },\n assign = Object.assign,\n emptyObject = {};\nfunction Component(props, context, updater) {\n this.props = props;\n this.context = context;\n this.refs = emptyObject;\n this.updater = updater || ReactNoopUpdateQueue;\n}\nComponent.prototype.isReactComponent = {};\nComponent.prototype.setState = function (partialState, callback) {\n if (\n \"object\" !== typeof partialState &&\n \"function\" !== typeof partialState &&\n null != partialState\n )\n throw Error(\n \"takes an object of state variables to update or a function which returns an object of state variables.\"\n );\n this.updater.enqueueSetState(this, partialState, callback, \"setState\");\n};\nComponent.prototype.forceUpdate = function (callback) {\n this.updater.enqueueForceUpdate(this, callback, \"forceUpdate\");\n};\nfunction ComponentDummy() {}\nComponentDummy.prototype = Component.prototype;\nfunction PureComponent(props, context, updater) {\n this.props = props;\n this.context = context;\n this.refs = emptyObject;\n this.updater = updater || ReactNoopUpdateQueue;\n}\nvar pureComponentPrototype = (PureComponent.prototype = new ComponentDummy());\npureComponentPrototype.constructor = PureComponent;\nassign(pureComponentPrototype, Component.prototype);\npureComponentPrototype.isPureReactComponent = !0;\nvar isArrayImpl = Array.isArray;\nfunction noop() {}\nvar ReactSharedInternals = { H: null, A: null, T: null, S: null },\n hasOwnProperty = Object.prototype.hasOwnProperty;\nfunction ReactElement(type, key, props) {\n var refProp = props.ref;\n return {\n $$typeof: REACT_ELEMENT_TYPE,\n type: type,\n key: key,\n ref: void 0 !== refProp ? refProp : null,\n props: props\n };\n}\nfunction cloneAndReplaceKey(oldElement, newKey) {\n return ReactElement(oldElement.type, newKey, oldElement.props);\n}\nfunction isValidElement(object) {\n return (\n \"object\" === typeof object &&\n null !== object &&\n object.$$typeof === REACT_ELEMENT_TYPE\n );\n}\nfunction escape(key) {\n var escaperLookup = { \"=\": \"=0\", \":\": \"=2\" };\n return (\n \"$\" +\n key.replace(/[=:]/g, function (match) {\n return escaperLookup[match];\n })\n );\n}\nvar userProvidedKeyEscapeRegex = /\\/+/g;\nfunction getElementKey(element, index) {\n return \"object\" === typeof element && null !== element && null != element.key\n ? escape(\"\" + element.key)\n : index.toString(36);\n}\nfunction resolveThenable(thenable) {\n switch (thenable.status) {\n case \"fulfilled\":\n return thenable.value;\n case \"rejected\":\n throw thenable.reason;\n default:\n switch (\n (\"string\" === typeof thenable.status\n ? thenable.then(noop, noop)\n : ((thenable.status = \"pending\"),\n thenable.then(\n function (fulfilledValue) {\n \"pending\" === thenable.status &&\n ((thenable.status = \"fulfilled\"),\n (thenable.value = fulfilledValue));\n },\n function (error) {\n \"pending\" === thenable.status &&\n ((thenable.status = \"rejected\"), (thenable.reason = error));\n }\n )),\n thenable.status)\n ) {\n case \"fulfilled\":\n return thenable.value;\n case \"rejected\":\n throw thenable.reason;\n }\n }\n throw thenable;\n}\nfunction mapIntoArray(children, array, escapedPrefix, nameSoFar, callback) {\n var type = typeof children;\n if (\"undefined\" === type || \"boolean\" === type) children = null;\n var invokeCallback = !1;\n if (null === children) invokeCallback = !0;\n else\n switch (type) {\n case \"bigint\":\n case \"string\":\n case \"number\":\n invokeCallback = !0;\n break;\n case \"object\":\n switch (children.$$typeof) {\n case REACT_ELEMENT_TYPE:\n case REACT_PORTAL_TYPE:\n invokeCallback = !0;\n break;\n case REACT_LAZY_TYPE:\n return (\n (invokeCallback = children._init),\n mapIntoArray(\n invokeCallback(children._payload),\n array,\n escapedPrefix,\n nameSoFar,\n callback\n )\n );\n }\n }\n if (invokeCallback)\n return (\n (callback = callback(children)),\n (invokeCallback =\n \"\" === nameSoFar ? \".\" + getElementKey(children, 0) : nameSoFar),\n isArrayImpl(callback)\n ? ((escapedPrefix = \"\"),\n null != invokeCallback &&\n (escapedPrefix =\n invokeCallback.replace(userProvidedKeyEscapeRegex, \"$&/\") + \"/\"),\n mapIntoArray(callback, array, escapedPrefix, \"\", function (c) {\n return c;\n }))\n : null != callback &&\n (isValidElement(callback) &&\n (callback = cloneAndReplaceKey(\n callback,\n escapedPrefix +\n (null == callback.key ||\n (children && children.key === callback.key)\n ? \"\"\n : (\"\" + callback.key).replace(\n userProvidedKeyEscapeRegex,\n \"$&/\"\n ) + \"/\") +\n invokeCallback\n )),\n array.push(callback)),\n 1\n );\n invokeCallback = 0;\n var nextNamePrefix = \"\" === nameSoFar ? \".\" : nameSoFar + \":\";\n if (isArrayImpl(children))\n for (var i = 0; i < children.length; i++)\n (nameSoFar = children[i]),\n (type = nextNamePrefix + getElementKey(nameSoFar, i)),\n (invokeCallback += mapIntoArray(\n nameSoFar,\n array,\n escapedPrefix,\n type,\n callback\n ));\n else if (((i = getIteratorFn(children)), \"function\" === typeof i))\n for (\n children = i.call(children), i = 0;\n !(nameSoFar = children.next()).done;\n\n )\n (nameSoFar = nameSoFar.value),\n (type = nextNamePrefix + getElementKey(nameSoFar, i++)),\n (invokeCallback += mapIntoArray(\n nameSoFar,\n array,\n escapedPrefix,\n type,\n callback\n ));\n else if (\"object\" === type) {\n if (\"function\" === typeof children.then)\n return mapIntoArray(\n resolveThenable(children),\n array,\n escapedPrefix,\n nameSoFar,\n callback\n );\n array = String(children);\n throw Error(\n \"Objects are not valid as a React child (found: \" +\n (\"[object Object]\" === array\n ? \"object with keys {\" + Object.keys(children).join(\", \") + \"}\"\n : array) +\n \"). If you meant to render a collection of children, use an array instead.\"\n );\n }\n return invokeCallback;\n}\nfunction mapChildren(children, func, context) {\n if (null == children) return children;\n var result = [],\n count = 0;\n mapIntoArray(children, result, \"\", \"\", function (child) {\n return func.call(context, child, count++);\n });\n return result;\n}\nfunction lazyInitializer(payload) {\n if (-1 === payload._status) {\n var ctor = payload._result;\n ctor = ctor();\n ctor.then(\n function (moduleObject) {\n if (0 === payload._status || -1 === payload._status)\n (payload._status = 1), (payload._result = moduleObject);\n },\n function (error) {\n if (0 === payload._status || -1 === payload._status)\n (payload._status = 2), (payload._result = error);\n }\n );\n -1 === payload._status && ((payload._status = 0), (payload._result = ctor));\n }\n if (1 === payload._status) return payload._result.default;\n throw payload._result;\n}\nvar reportGlobalError =\n \"function\" === typeof reportError\n ? reportError\n : function (error) {\n if (\n \"object\" === typeof window &&\n \"function\" === typeof window.ErrorEvent\n ) {\n var event = new window.ErrorEvent(\"error\", {\n bubbles: !0,\n cancelable: !0,\n message:\n \"object\" === typeof error &&\n null !== error &&\n \"string\" === typeof error.message\n ? String(error.message)\n : String(error),\n error: error\n });\n if (!window.dispatchEvent(event)) return;\n } else if (\n \"object\" === typeof process &&\n \"function\" === typeof process.emit\n ) {\n process.emit(\"uncaughtException\", error);\n return;\n }\n console.error(error);\n },\n Children = {\n map: mapChildren,\n forEach: function (children, forEachFunc, forEachContext) {\n mapChildren(\n children,\n function () {\n forEachFunc.apply(this, arguments);\n },\n forEachContext\n );\n },\n count: function (children) {\n var n = 0;\n mapChildren(children, function () {\n n++;\n });\n return n;\n },\n toArray: function (children) {\n return (\n mapChildren(children, function (child) {\n return child;\n }) || []\n );\n },\n only: function (children) {\n if (!isValidElement(children))\n throw Error(\n \"React.Children.only expected to receive a single React element child.\"\n );\n return children;\n }\n };\nexports.Activity = REACT_ACTIVITY_TYPE;\nexports.Children = Children;\nexports.Component = Component;\nexports.Fragment = REACT_FRAGMENT_TYPE;\nexports.Profiler = REACT_PROFILER_TYPE;\nexports.PureComponent = PureComponent;\nexports.StrictMode = REACT_STRICT_MODE_TYPE;\nexports.Suspense = REACT_SUSPENSE_TYPE;\nexports.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE =\n ReactSharedInternals;\nexports.__COMPILER_RUNTIME = {\n __proto__: null,\n c: function (size) {\n return ReactSharedInternals.H.useMemoCache(size);\n }\n};\nexports.cache = function (fn) {\n return function () {\n return fn.apply(null, arguments);\n };\n};\nexports.cacheSignal = function () {\n return null;\n};\nexports.cloneElement = function (element, config, children) {\n if (null === element || void 0 === element)\n throw Error(\n \"The argument must be a React element, but you passed \" + element + \".\"\n );\n var props = assign({}, element.props),\n key = element.key;\n if (null != config)\n for (propName in (void 0 !== config.key && (key = \"\" + config.key), config))\n !hasOwnProperty.call(config, propName) ||\n \"key\" === propName ||\n \"__self\" === propName ||\n \"__source\" === propName ||\n (\"ref\" === propName && void 0 === config.ref) ||\n (props[propName] = config[propName]);\n var propName = arguments.length - 2;\n if (1 === propName) props.children = children;\n else if (1 < propName) {\n for (var childArray = Array(propName), i = 0; i < propName; i++)\n childArray[i] = arguments[i + 2];\n props.children = childArray;\n }\n return ReactElement(element.type, key, props);\n};\nexports.createContext = function (defaultValue) {\n defaultValue = {\n $$typeof: REACT_CONTEXT_TYPE,\n _currentValue: defaultValue,\n _currentValue2: defaultValue,\n _threadCount: 0,\n Provider: null,\n Consumer: null\n };\n defaultValue.Provider = defaultValue;\n defaultValue.Consumer = {\n $$typeof: REACT_CONSUMER_TYPE,\n _context: defaultValue\n };\n return defaultValue;\n};\nexports.createElement = function (type, config, children) {\n var propName,\n props = {},\n key = null;\n if (null != config)\n for (propName in (void 0 !== config.key && (key = \"\" + config.key), config))\n hasOwnProperty.call(config, propName) &&\n \"key\" !== propName &&\n \"__self\" !== propName &&\n \"__source\" !== propName &&\n (props[propName] = config[propName]);\n var childrenLength = arguments.length - 2;\n if (1 === childrenLength) props.children = children;\n else if (1 < childrenLength) {\n for (var childArray = Array(childrenLength), i = 0; i < childrenLength; i++)\n childArray[i] = arguments[i + 2];\n props.children = childArray;\n }\n if (type && type.defaultProps)\n for (propName in ((childrenLength = type.defaultProps), childrenLength))\n void 0 === props[propName] &&\n (props[propName] = childrenLength[propName]);\n return ReactElement(type, key, props);\n};\nexports.createRef = function () {\n return { current: null };\n};\nexports.forwardRef = function (render) {\n return { $$typeof: REACT_FORWARD_REF_TYPE, render: render };\n};\nexports.isValidElement = isValidElement;\nexports.lazy = function (ctor) {\n return {\n $$typeof: REACT_LAZY_TYPE,\n _payload: { _status: -1, _result: ctor },\n _init: lazyInitializer\n };\n};\nexports.memo = function (type, compare) {\n return {\n $$typeof: REACT_MEMO_TYPE,\n type: type,\n compare: void 0 === compare ? null : compare\n };\n};\nexports.startTransition = function (scope) {\n var prevTransition = ReactSharedInternals.T,\n currentTransition = {};\n ReactSharedInternals.T = currentTransition;\n try {\n var returnValue = scope(),\n onStartTransitionFinish = ReactSharedInternals.S;\n null !== onStartTransitionFinish &&\n onStartTransitionFinish(currentTransition, returnValue);\n \"object\" === typeof returnValue &&\n null !== returnValue &&\n \"function\" === typeof returnValue.then &&\n returnValue.then(noop, reportGlobalError);\n } catch (error) {\n reportGlobalError(error);\n } finally {\n null !== prevTransition &&\n null !== currentTransition.types &&\n (prevTransition.types = currentTransition.types),\n (ReactSharedInternals.T = prevTransition);\n }\n};\nexports.unstable_useCacheRefresh = function () {\n return ReactSharedInternals.H.useCacheRefresh();\n};\nexports.use = function (usable) {\n return ReactSharedInternals.H.use(usable);\n};\nexports.useActionState = function (action, initialState, permalink) {\n return ReactSharedInternals.H.useActionState(action, initialState, permalink);\n};\nexports.useCallback = function (callback, deps) {\n return ReactSharedInternals.H.useCallback(callback, deps);\n};\nexports.useContext = function (Context) {\n return ReactSharedInternals.H.useContext(Context);\n};\nexports.useDebugValue = function () {};\nexports.useDeferredValue = function (value, initialValue) {\n return ReactSharedInternals.H.useDeferredValue(value, initialValue);\n};\nexports.useEffect = function (create, deps) {\n return ReactSharedInternals.H.useEffect(create, deps);\n};\nexports.useEffectEvent = function (callback) {\n return ReactSharedInternals.H.useEffectEvent(callback);\n};\nexports.useId = function () {\n return ReactSharedInternals.H.useId();\n};\nexports.useImperativeHandle = function (ref, create, deps) {\n return ReactSharedInternals.H.useImperativeHandle(ref, create, deps);\n};\nexports.useInsertionEffect = function (create, deps) {\n return ReactSharedInternals.H.useInsertionEffect(create, deps);\n};\nexports.useLayoutEffect = function (create, deps) {\n return ReactSharedInternals.H.useLayoutEffect(create, deps);\n};\nexports.useMemo = function (create, deps) {\n return ReactSharedInternals.H.useMemo(create, deps);\n};\nexports.useOptimistic = function (passthrough, reducer) {\n return ReactSharedInternals.H.useOptimistic(passthrough, reducer);\n};\nexports.useReducer = function (reducer, initialArg, init) {\n return ReactSharedInternals.H.useReducer(reducer, initialArg, init);\n};\nexports.useRef = function (initialValue) {\n return ReactSharedInternals.H.useRef(initialValue);\n};\nexports.useState = function (initialState) {\n return ReactSharedInternals.H.useState(initialState);\n};\nexports.useSyncExternalStore = function (\n subscribe,\n getSnapshot,\n getServerSnapshot\n) {\n return ReactSharedInternals.H.useSyncExternalStore(\n subscribe,\n getSnapshot,\n getServerSnapshot\n );\n};\nexports.useTransition = function () {\n return ReactSharedInternals.H.useTransition();\n};\nexports.version = \"19.2.4\";\n","/**\n * @license React\n * react.development.js\n *\n * Copyright (c) Meta Platforms, Inc. and affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\n\"use strict\";\n\"production\" !== process.env.NODE_ENV &&\n (function () {\n function defineDeprecationWarning(methodName, info) {\n Object.defineProperty(Component.prototype, methodName, {\n get: function () {\n console.warn(\n \"%s(...) is deprecated in plain JavaScript React classes. %s\",\n info[0],\n info[1]\n );\n }\n });\n }\n function getIteratorFn(maybeIterable) {\n if (null === maybeIterable || \"object\" !== typeof maybeIterable)\n return null;\n maybeIterable =\n (MAYBE_ITERATOR_SYMBOL && maybeIterable[MAYBE_ITERATOR_SYMBOL]) ||\n maybeIterable[\"@@iterator\"];\n return \"function\" === typeof maybeIterable ? maybeIterable : null;\n }\n function warnNoop(publicInstance, callerName) {\n publicInstance =\n ((publicInstance = publicInstance.constructor) &&\n (publicInstance.displayName || publicInstance.name)) ||\n \"ReactClass\";\n var warningKey = publicInstance + \".\" + callerName;\n didWarnStateUpdateForUnmountedComponent[warningKey] ||\n (console.error(\n \"Can't call %s on a component that is not yet mounted. This is a no-op, but it might indicate a bug in your application. Instead, assign to `this.state` directly or define a `state = {};` class property with the desired state in the %s component.\",\n callerName,\n publicInstance\n ),\n (didWarnStateUpdateForUnmountedComponent[warningKey] = !0));\n }\n function Component(props, context, updater) {\n this.props = props;\n this.context = context;\n this.refs = emptyObject;\n this.updater = updater || ReactNoopUpdateQueue;\n }\n function ComponentDummy() {}\n function PureComponent(props, context, updater) {\n this.props = props;\n this.context = context;\n this.refs = emptyObject;\n this.updater = updater || ReactNoopUpdateQueue;\n }\n function noop() {}\n function testStringCoercion(value) {\n return \"\" + value;\n }\n function checkKeyStringCoercion(value) {\n try {\n testStringCoercion(value);\n var JSCompiler_inline_result = !1;\n } catch (e) {\n JSCompiler_inline_result = !0;\n }\n if (JSCompiler_inline_result) {\n JSCompiler_inline_result = console;\n var JSCompiler_temp_const = JSCompiler_inline_result.error;\n var JSCompiler_inline_result$jscomp$0 =\n (\"function\" === typeof Symbol &&\n Symbol.toStringTag &&\n value[Symbol.toStringTag]) ||\n value.constructor.name ||\n \"Object\";\n JSCompiler_temp_const.call(\n JSCompiler_inline_result,\n \"The provided key is an unsupported type %s. This value must be coerced to a string before using it here.\",\n JSCompiler_inline_result$jscomp$0\n );\n return testStringCoercion(value);\n }\n }\n function getComponentNameFromType(type) {\n if (null == type) return null;\n if (\"function\" === typeof type)\n return type.$$typeof === REACT_CLIENT_REFERENCE\n ? null\n : type.displayName || type.name || null;\n if (\"string\" === typeof type) return type;\n switch (type) {\n case REACT_FRAGMENT_TYPE:\n return \"Fragment\";\n case REACT_PROFILER_TYPE:\n return \"Profiler\";\n case REACT_STRICT_MODE_TYPE:\n return \"StrictMode\";\n case REACT_SUSPENSE_TYPE:\n return \"Suspense\";\n case REACT_SUSPENSE_LIST_TYPE:\n return \"SuspenseList\";\n case REACT_ACTIVITY_TYPE:\n return \"Activity\";\n }\n if (\"object\" === typeof type)\n switch (\n (\"number\" === typeof type.tag &&\n console.error(\n \"Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue.\"\n ),\n type.$$typeof)\n ) {\n case REACT_PORTAL_TYPE:\n return \"Portal\";\n case REACT_CONTEXT_TYPE:\n return type.displayName || \"Context\";\n case REACT_CONSUMER_TYPE:\n return (type._context.displayName || \"Context\") + \".Consumer\";\n case REACT_FORWARD_REF_TYPE:\n var innerType = type.render;\n type = type.displayName;\n type ||\n ((type = innerType.displayName || innerType.name || \"\"),\n (type = \"\" !== type ? \"ForwardRef(\" + type + \")\" : \"ForwardRef\"));\n return type;\n case REACT_MEMO_TYPE:\n return (\n (innerType = type.displayName || null),\n null !== innerType\n ? innerType\n : getComponentNameFromType(type.type) || \"Memo\"\n );\n case REACT_LAZY_TYPE:\n innerType = type._payload;\n type = type._init;\n try {\n return getComponentNameFromType(type(innerType));\n } catch (x) {}\n }\n return null;\n }\n function getTaskName(type) {\n if (type === REACT_FRAGMENT_TYPE) return \"<>\";\n if (\n \"object\" === typeof type &&\n null !== type &&\n type.$$typeof === REACT_LAZY_TYPE\n )\n return \"<...>\";\n try {\n var name = getComponentNameFromType(type);\n return name ? \"<\" + name + \">\" : \"<...>\";\n } catch (x) {\n return \"<...>\";\n }\n }\n function getOwner() {\n var dispatcher = ReactSharedInternals.A;\n return null === dispatcher ? null : dispatcher.getOwner();\n }\n function UnknownOwner() {\n return Error(\"react-stack-top-frame\");\n }\n function hasValidKey(config) {\n if (hasOwnProperty.call(config, \"key\")) {\n var getter = Object.getOwnPropertyDescriptor(config, \"key\").get;\n if (getter && getter.isReactWarning) return !1;\n }\n return void 0 !== config.key;\n }\n function defineKeyPropWarningGetter(props, displayName) {\n function warnAboutAccessingKey() {\n specialPropKeyWarningShown ||\n ((specialPropKeyWarningShown = !0),\n console.error(\n \"%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://react.dev/link/special-props)\",\n displayName\n ));\n }\n warnAboutAccessingKey.isReactWarning = !0;\n Object.defineProperty(props, \"key\", {\n get: warnAboutAccessingKey,\n configurable: !0\n });\n }\n function elementRefGetterWithDeprecationWarning() {\n var componentName = getComponentNameFromType(this.type);\n didWarnAboutElementRef[componentName] ||\n ((didWarnAboutElementRef[componentName] = !0),\n console.error(\n \"Accessing element.ref was removed in React 19. ref is now a regular prop. It will be removed from the JSX Element type in a future release.\"\n ));\n componentName = this.props.ref;\n return void 0 !== componentName ? componentName : null;\n }\n function ReactElement(type, key, props, owner, debugStack, debugTask) {\n var refProp = props.ref;\n type = {\n $$typeof: REACT_ELEMENT_TYPE,\n type: type,\n key: key,\n props: props,\n _owner: owner\n };\n null !== (void 0 !== refProp ? refProp : null)\n ? Object.defineProperty(type, \"ref\", {\n enumerable: !1,\n get: elementRefGetterWithDeprecationWarning\n })\n : Object.defineProperty(type, \"ref\", { enumerable: !1, value: null });\n type._store = {};\n Object.defineProperty(type._store, \"validated\", {\n configurable: !1,\n enumerable: !1,\n writable: !0,\n value: 0\n });\n Object.defineProperty(type, \"_debugInfo\", {\n configurable: !1,\n enumerable: !1,\n writable: !0,\n value: null\n });\n Object.defineProperty(type, \"_debugStack\", {\n configurable: !1,\n enumerable: !1,\n writable: !0,\n value: debugStack\n });\n Object.defineProperty(type, \"_debugTask\", {\n configurable: !1,\n enumerable: !1,\n writable: !0,\n value: debugTask\n });\n Object.freeze && (Object.freeze(type.props), Object.freeze(type));\n return type;\n }\n function cloneAndReplaceKey(oldElement, newKey) {\n newKey = ReactElement(\n oldElement.type,\n newKey,\n oldElement.props,\n oldElement._owner,\n oldElement._debugStack,\n oldElement._debugTask\n );\n oldElement._store &&\n (newKey._store.validated = oldElement._store.validated);\n return newKey;\n }\n function validateChildKeys(node) {\n isValidElement(node)\n ? node._store && (node._store.validated = 1)\n : \"object\" === typeof node &&\n null !== node &&\n node.$$typeof === REACT_LAZY_TYPE &&\n (\"fulfilled\" === node._payload.status\n ? isValidElement(node._payload.value) &&\n node._payload.value._store &&\n (node._payload.value._store.validated = 1)\n : node._store && (node._store.validated = 1));\n }\n function isValidElement(object) {\n return (\n \"object\" === typeof object &&\n null !== object &&\n object.$$typeof === REACT_ELEMENT_TYPE\n );\n }\n function escape(key) {\n var escaperLookup = { \"=\": \"=0\", \":\": \"=2\" };\n return (\n \"$\" +\n key.replace(/[=:]/g, function (match) {\n return escaperLookup[match];\n })\n );\n }\n function getElementKey(element, index) {\n return \"object\" === typeof element &&\n null !== element &&\n null != element.key\n ? (checkKeyStringCoercion(element.key), escape(\"\" + element.key))\n : index.toString(36);\n }\n function resolveThenable(thenable) {\n switch (thenable.status) {\n case \"fulfilled\":\n return thenable.value;\n case \"rejected\":\n throw thenable.reason;\n default:\n switch (\n (\"string\" === typeof thenable.status\n ? thenable.then(noop, noop)\n : ((thenable.status = \"pending\"),\n thenable.then(\n function (fulfilledValue) {\n \"pending\" === thenable.status &&\n ((thenable.status = \"fulfilled\"),\n (thenable.value = fulfilledValue));\n },\n function (error) {\n \"pending\" === thenable.status &&\n ((thenable.status = \"rejected\"),\n (thenable.reason = error));\n }\n )),\n thenable.status)\n ) {\n case \"fulfilled\":\n return thenable.value;\n case \"rejected\":\n throw thenable.reason;\n }\n }\n throw thenable;\n }\n function mapIntoArray(children, array, escapedPrefix, nameSoFar, callback) {\n var type = typeof children;\n if (\"undefined\" === type || \"boolean\" === type) children = null;\n var invokeCallback = !1;\n if (null === children) invokeCallback = !0;\n else\n switch (type) {\n case \"bigint\":\n case \"string\":\n case \"number\":\n invokeCallback = !0;\n break;\n case \"object\":\n switch (children.$$typeof) {\n case REACT_ELEMENT_TYPE:\n case REACT_PORTAL_TYPE:\n invokeCallback = !0;\n break;\n case REACT_LAZY_TYPE:\n return (\n (invokeCallback = children._init),\n mapIntoArray(\n invokeCallback(children._payload),\n array,\n escapedPrefix,\n nameSoFar,\n callback\n )\n );\n }\n }\n if (invokeCallback) {\n invokeCallback = children;\n callback = callback(invokeCallback);\n var childKey =\n \"\" === nameSoFar ? \".\" + getElementKey(invokeCallback, 0) : nameSoFar;\n isArrayImpl(callback)\n ? ((escapedPrefix = \"\"),\n null != childKey &&\n (escapedPrefix =\n childKey.replace(userProvidedKeyEscapeRegex, \"$&/\") + \"/\"),\n mapIntoArray(callback, array, escapedPrefix, \"\", function (c) {\n return c;\n }))\n : null != callback &&\n (isValidElement(callback) &&\n (null != callback.key &&\n ((invokeCallback && invokeCallback.key === callback.key) ||\n checkKeyStringCoercion(callback.key)),\n (escapedPrefix = cloneAndReplaceKey(\n callback,\n escapedPrefix +\n (null == callback.key ||\n (invokeCallback && invokeCallback.key === callback.key)\n ? \"\"\n : (\"\" + callback.key).replace(\n userProvidedKeyEscapeRegex,\n \"$&/\"\n ) + \"/\") +\n childKey\n )),\n \"\" !== nameSoFar &&\n null != invokeCallback &&\n isValidElement(invokeCallback) &&\n null == invokeCallback.key &&\n invokeCallback._store &&\n !invokeCallback._store.validated &&\n (escapedPrefix._store.validated = 2),\n (callback = escapedPrefix)),\n array.push(callback));\n return 1;\n }\n invokeCallback = 0;\n childKey = \"\" === nameSoFar ? \".\" : nameSoFar + \":\";\n if (isArrayImpl(children))\n for (var i = 0; i < children.length; i++)\n (nameSoFar = children[i]),\n (type = childKey + getElementKey(nameSoFar, i)),\n (invokeCallback += mapIntoArray(\n nameSoFar,\n array,\n escapedPrefix,\n type,\n callback\n ));\n else if (((i = getIteratorFn(children)), \"function\" === typeof i))\n for (\n i === children.entries &&\n (didWarnAboutMaps ||\n console.warn(\n \"Using Maps as children is not supported. Use an array of keyed ReactElements instead.\"\n ),\n (didWarnAboutMaps = !0)),\n children = i.call(children),\n i = 0;\n !(nameSoFar = children.next()).done;\n\n )\n (nameSoFar = nameSoFar.value),\n (type = childKey + getElementKey(nameSoFar, i++)),\n (invokeCallback += mapIntoArray(\n nameSoFar,\n array,\n escapedPrefix,\n type,\n callback\n ));\n else if (\"object\" === type) {\n if (\"function\" === typeof children.then)\n return mapIntoArray(\n resolveThenable(children),\n array,\n escapedPrefix,\n nameSoFar,\n callback\n );\n array = String(children);\n throw Error(\n \"Objects are not valid as a React child (found: \" +\n (\"[object Object]\" === array\n ? \"object with keys {\" + Object.keys(children).join(\", \") + \"}\"\n : array) +\n \"). If you meant to render a collection of children, use an array instead.\"\n );\n }\n return invokeCallback;\n }\n function mapChildren(children, func, context) {\n if (null == children) return children;\n var result = [],\n count = 0;\n mapIntoArray(children, result, \"\", \"\", function (child) {\n return func.call(context, child, count++);\n });\n return result;\n }\n function lazyInitializer(payload) {\n if (-1 === payload._status) {\n var ioInfo = payload._ioInfo;\n null != ioInfo && (ioInfo.start = ioInfo.end = performance.now());\n ioInfo = payload._result;\n var thenable = ioInfo();\n thenable.then(\n function (moduleObject) {\n if (0 === payload._status || -1 === payload._status) {\n payload._status = 1;\n payload._result = moduleObject;\n var _ioInfo = payload._ioInfo;\n null != _ioInfo && (_ioInfo.end = performance.now());\n void 0 === thenable.status &&\n ((thenable.status = \"fulfilled\"),\n (thenable.value = moduleObject));\n }\n },\n function (error) {\n if (0 === payload._status || -1 === payload._status) {\n payload._status = 2;\n payload._result = error;\n var _ioInfo2 = payload._ioInfo;\n null != _ioInfo2 && (_ioInfo2.end = performance.now());\n void 0 === thenable.status &&\n ((thenable.status = \"rejected\"), (thenable.reason = error));\n }\n }\n );\n ioInfo = payload._ioInfo;\n if (null != ioInfo) {\n ioInfo.value = thenable;\n var displayName = thenable.displayName;\n \"string\" === typeof displayName && (ioInfo.name = displayName);\n }\n -1 === payload._status &&\n ((payload._status = 0), (payload._result = thenable));\n }\n if (1 === payload._status)\n return (\n (ioInfo = payload._result),\n void 0 === ioInfo &&\n console.error(\n \"lazy: Expected the result of a dynamic import() call. Instead received: %s\\n\\nYour code should look like: \\n const MyComponent = lazy(() => import('./MyComponent'))\\n\\nDid you accidentally put curly braces around the import?\",\n ioInfo\n ),\n \"default\" in ioInfo ||\n console.error(\n \"lazy: Expected the result of a dynamic import() call. Instead received: %s\\n\\nYour code should look like: \\n const MyComponent = lazy(() => import('./MyComponent'))\",\n ioInfo\n ),\n ioInfo.default\n );\n throw payload._result;\n }\n function resolveDispatcher() {\n var dispatcher = ReactSharedInternals.H;\n null === dispatcher &&\n console.error(\n \"Invalid hook call. Hooks can only be called inside of the body of a function component. This could happen for one of the following reasons:\\n1. You might have mismatching versions of React and the renderer (such as React DOM)\\n2. You might be breaking the Rules of Hooks\\n3. You might have more than one copy of React in the same app\\nSee https://react.dev/link/invalid-hook-call for tips about how to debug and fix this problem.\"\n );\n return dispatcher;\n }\n function releaseAsyncTransition() {\n ReactSharedInternals.asyncTransitions--;\n }\n function enqueueTask(task) {\n if (null === enqueueTaskImpl)\n try {\n var requireString = (\"require\" + Math.random()).slice(0, 7);\n enqueueTaskImpl = (module && module[requireString]).call(\n module,\n \"timers\"\n ).setImmediate;\n } catch (_err) {\n enqueueTaskImpl = function (callback) {\n !1 === didWarnAboutMessageChannel &&\n ((didWarnAboutMessageChannel = !0),\n \"undefined\" === typeof MessageChannel &&\n console.error(\n \"This browser does not have a MessageChannel implementation, so enqueuing tasks via await act(async () => ...) will fail. Please file an issue at https://github.com/facebook/react/issues if you encounter this warning.\"\n ));\n var channel = new MessageChannel();\n channel.port1.onmessage = callback;\n channel.port2.postMessage(void 0);\n };\n }\n return enqueueTaskImpl(task);\n }\n function aggregateErrors(errors) {\n return 1 < errors.length && \"function\" === typeof AggregateError\n ? new AggregateError(errors)\n : errors[0];\n }\n function popActScope(prevActQueue, prevActScopeDepth) {\n prevActScopeDepth !== actScopeDepth - 1 &&\n console.error(\n \"You seem to have overlapping act() calls, this is not supported. Be sure to await previous act() calls before making a new one. \"\n );\n actScopeDepth = prevActScopeDepth;\n }\n function recursivelyFlushAsyncActWork(returnValue, resolve, reject) {\n var queue = ReactSharedInternals.actQueue;\n if (null !== queue)\n if (0 !== queue.length)\n try {\n flushActQueue(queue);\n enqueueTask(function () {\n return recursivelyFlushAsyncActWork(returnValue, resolve, reject);\n });\n return;\n } catch (error) {\n ReactSharedInternals.thrownErrors.push(error);\n }\n else ReactSharedInternals.actQueue = null;\n 0 < ReactSharedInternals.thrownErrors.length\n ? ((queue = aggregateErrors(ReactSharedInternals.thrownErrors)),\n (ReactSharedInternals.thrownErrors.length = 0),\n reject(queue))\n : resolve(returnValue);\n }\n function flushActQueue(queue) {\n if (!isFlushing) {\n isFlushing = !0;\n var i = 0;\n try {\n for (; i < queue.length; i++) {\n var callback = queue[i];\n do {\n ReactSharedInternals.didUsePromise = !1;\n var continuation = callback(!1);\n if (null !== continuation) {\n if (ReactSharedInternals.didUsePromise) {\n queue[i] = callback;\n queue.splice(0, i);\n return;\n }\n callback = continuation;\n } else break;\n } while (1);\n }\n queue.length = 0;\n } catch (error) {\n queue.splice(0, i + 1), ReactSharedInternals.thrownErrors.push(error);\n } finally {\n isFlushing = !1;\n }\n }\n }\n \"undefined\" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ &&\n \"function\" ===\n typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart &&\n __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(Error());\n var REACT_ELEMENT_TYPE = Symbol.for(\"react.transitional.element\"),\n REACT_PORTAL_TYPE = Symbol.for(\"react.portal\"),\n REACT_FRAGMENT_TYPE = Symbol.for(\"react.fragment\"),\n REACT_STRICT_MODE_TYPE = Symbol.for(\"react.strict_mode\"),\n REACT_PROFILER_TYPE = Symbol.for(\"react.profiler\"),\n REACT_CONSUMER_TYPE = Symbol.for(\"react.consumer\"),\n REACT_CONTEXT_TYPE = Symbol.for(\"react.context\"),\n REACT_FORWARD_REF_TYPE = Symbol.for(\"react.forward_ref\"),\n REACT_SUSPENSE_TYPE = Symbol.for(\"react.suspense\"),\n REACT_SUSPENSE_LIST_TYPE = Symbol.for(\"react.suspense_list\"),\n REACT_MEMO_TYPE = Symbol.for(\"react.memo\"),\n REACT_LAZY_TYPE = Symbol.for(\"react.lazy\"),\n REACT_ACTIVITY_TYPE = Symbol.for(\"react.activity\"),\n MAYBE_ITERATOR_SYMBOL = Symbol.iterator,\n didWarnStateUpdateForUnmountedComponent = {},\n ReactNoopUpdateQueue = {\n isMounted: function () {\n return !1;\n },\n enqueueForceUpdate: function (publicInstance) {\n warnNoop(publicInstance, \"forceUpdate\");\n },\n enqueueReplaceState: function (publicInstance) {\n warnNoop(publicInstance, \"replaceState\");\n },\n enqueueSetState: function (publicInstance) {\n warnNoop(publicInstance, \"setState\");\n }\n },\n assign = Object.assign,\n emptyObject = {};\n Object.freeze(emptyObject);\n Component.prototype.isReactComponent = {};\n Component.prototype.setState = function (partialState, callback) {\n if (\n \"object\" !== typeof partialState &&\n \"function\" !== typeof partialState &&\n null != partialState\n )\n throw Error(\n \"takes an object of state variables to update or a function which returns an object of state variables.\"\n );\n this.updater.enqueueSetState(this, partialState, callback, \"setState\");\n };\n Component.prototype.forceUpdate = function (callback) {\n this.updater.enqueueForceUpdate(this, callback, \"forceUpdate\");\n };\n var deprecatedAPIs = {\n isMounted: [\n \"isMounted\",\n \"Instead, make sure to clean up subscriptions and pending requests in componentWillUnmount to prevent memory leaks.\"\n ],\n replaceState: [\n \"replaceState\",\n \"Refactor your code to use setState instead (see https://github.com/facebook/react/issues/3236).\"\n ]\n };\n for (fnName in deprecatedAPIs)\n deprecatedAPIs.hasOwnProperty(fnName) &&\n defineDeprecationWarning(fnName, deprecatedAPIs[fnName]);\n ComponentDummy.prototype = Component.prototype;\n deprecatedAPIs = PureComponent.prototype = new ComponentDummy();\n deprecatedAPIs.constructor = PureComponent;\n assign(deprecatedAPIs, Component.prototype);\n deprecatedAPIs.isPureReactComponent = !0;\n var isArrayImpl = Array.isArray,\n REACT_CLIENT_REFERENCE = Symbol.for(\"react.client.reference\"),\n ReactSharedInternals = {\n H: null,\n A: null,\n T: null,\n S: null,\n actQueue: null,\n asyncTransitions: 0,\n isBatchingLegacy: !1,\n didScheduleLegacyUpdate: !1,\n didUsePromise: !1,\n thrownErrors: [],\n getCurrentStack: null,\n recentlyCreatedOwnerStacks: 0\n },\n hasOwnProperty = Object.prototype.hasOwnProperty,\n createTask = console.createTask\n ? console.createTask\n : function () {\n return null;\n };\n deprecatedAPIs = {\n react_stack_bottom_frame: function (callStackForError) {\n return callStackForError();\n }\n };\n var specialPropKeyWarningShown, didWarnAboutOldJSXRuntime;\n var didWarnAboutElementRef = {};\n var unknownOwnerDebugStack = deprecatedAPIs.react_stack_bottom_frame.bind(\n deprecatedAPIs,\n UnknownOwner\n )();\n var unknownOwnerDebugTask = createTask(getTaskName(UnknownOwner));\n var didWarnAboutMaps = !1,\n userProvidedKeyEscapeRegex = /\\/+/g,\n reportGlobalError =\n \"function\" === typeof reportError\n ? reportError\n : function (error) {\n if (\n \"object\" === typeof window &&\n \"function\" === typeof window.ErrorEvent\n ) {\n var event = new window.ErrorEvent(\"error\", {\n bubbles: !0,\n cancelable: !0,\n message:\n \"object\" === typeof error &&\n null !== error &&\n \"string\" === typeof error.message\n ? String(error.message)\n : String(error),\n error: error\n });\n if (!window.dispatchEvent(event)) return;\n } else if (\n \"object\" === typeof process &&\n \"function\" === typeof process.emit\n ) {\n process.emit(\"uncaughtException\", error);\n return;\n }\n console.error(error);\n },\n didWarnAboutMessageChannel = !1,\n enqueueTaskImpl = null,\n actScopeDepth = 0,\n didWarnNoAwaitAct = !1,\n isFlushing = !1,\n queueSeveralMicrotasks =\n \"function\" === typeof queueMicrotask\n ? function (callback) {\n queueMicrotask(function () {\n return queueMicrotask(callback);\n });\n }\n : enqueueTask;\n deprecatedAPIs = Object.freeze({\n __proto__: null,\n c: function (size) {\n return resolveDispatcher().useMemoCache(size);\n }\n });\n var fnName = {\n map: mapChildren,\n forEach: function (children, forEachFunc, forEachContext) {\n mapChildren(\n children,\n function () {\n forEachFunc.apply(this, arguments);\n },\n forEachContext\n );\n },\n count: function (children) {\n var n = 0;\n mapChildren(children, function () {\n n++;\n });\n return n;\n },\n toArray: function (children) {\n return (\n mapChildren(children, function (child) {\n return child;\n }) || []\n );\n },\n only: function (children) {\n if (!isValidElement(children))\n throw Error(\n \"React.Children.only expected to receive a single React element child.\"\n );\n return children;\n }\n };\n exports.Activity = REACT_ACTIVITY_TYPE;\n exports.Children = fnName;\n exports.Component = Component;\n exports.Fragment = REACT_FRAGMENT_TYPE;\n exports.Profiler = REACT_PROFILER_TYPE;\n exports.PureComponent = PureComponent;\n exports.StrictMode = REACT_STRICT_MODE_TYPE;\n exports.Suspense = REACT_SUSPENSE_TYPE;\n exports.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE =\n ReactSharedInternals;\n exports.__COMPILER_RUNTIME = deprecatedAPIs;\n exports.act = function (callback) {\n var prevActQueue = ReactSharedInternals.actQueue,\n prevActScopeDepth = actScopeDepth;\n actScopeDepth++;\n var queue = (ReactSharedInternals.actQueue =\n null !== prevActQueue ? prevActQueue : []),\n didAwaitActCall = !1;\n try {\n var result = callback();\n } catch (error) {\n ReactSharedInternals.thrownErrors.push(error);\n }\n if (0 < ReactSharedInternals.thrownErrors.length)\n throw (\n (popActScope(prevActQueue, prevActScopeDepth),\n (callback = aggregateErrors(ReactSharedInternals.thrownErrors)),\n (ReactSharedInternals.thrownErrors.length = 0),\n callback)\n );\n if (\n null !== result &&\n \"object\" === typeof result &&\n \"function\" === typeof result.then\n ) {\n var thenable = result;\n queueSeveralMicrotasks(function () {\n didAwaitActCall ||\n didWarnNoAwaitAct ||\n ((didWarnNoAwaitAct = !0),\n console.error(\n \"You called act(async () => ...) without await. This could lead to unexpected testing behaviour, interleaving multiple act calls and mixing their scopes. You should - await act(async () => ...);\"\n ));\n });\n return {\n then: function (resolve, reject) {\n didAwaitActCall = !0;\n thenable.then(\n function (returnValue) {\n popActScope(prevActQueue, prevActScopeDepth);\n if (0 === prevActScopeDepth) {\n try {\n flushActQueue(queue),\n enqueueTask(function () {\n return recursivelyFlushAsyncActWork(\n returnValue,\n resolve,\n reject\n );\n });\n } catch (error$0) {\n ReactSharedInternals.thrownErrors.push(error$0);\n }\n if (0 < ReactSharedInternals.thrownErrors.length) {\n var _thrownError = aggregateErrors(\n ReactSharedInternals.thrownErrors\n );\n ReactSharedInternals.thrownErrors.length = 0;\n reject(_thrownError);\n }\n } else resolve(returnValue);\n },\n function (error) {\n popActScope(prevActQueue, prevActScopeDepth);\n 0 < ReactSharedInternals.thrownErrors.length\n ? ((error = aggregateErrors(\n ReactSharedInternals.thrownErrors\n )),\n (ReactSharedInternals.thrownErrors.length = 0),\n reject(error))\n : reject(error);\n }\n );\n }\n };\n }\n var returnValue$jscomp$0 = result;\n popActScope(prevActQueue, prevActScopeDepth);\n 0 === prevActScopeDepth &&\n (flushActQueue(queue),\n 0 !== queue.length &&\n queueSeveralMicrotasks(function () {\n didAwaitActCall ||\n didWarnNoAwaitAct ||\n ((didWarnNoAwaitAct = !0),\n console.error(\n \"A component suspended inside an `act` scope, but the `act` call was not awaited. When testing React components that depend on asynchronous data, you must await the result:\\n\\nawait act(() => ...)\"\n ));\n }),\n (ReactSharedInternals.actQueue = null));\n if (0 < ReactSharedInternals.thrownErrors.length)\n throw (\n ((callback = aggregateErrors(ReactSharedInternals.thrownErrors)),\n (ReactSharedInternals.thrownErrors.length = 0),\n callback)\n );\n return {\n then: function (resolve, reject) {\n didAwaitActCall = !0;\n 0 === prevActScopeDepth\n ? ((ReactSharedInternals.actQueue = queue),\n enqueueTask(function () {\n return recursivelyFlushAsyncActWork(\n returnValue$jscomp$0,\n resolve,\n reject\n );\n }))\n : resolve(returnValue$jscomp$0);\n }\n };\n };\n exports.cache = function (fn) {\n return function () {\n return fn.apply(null, arguments);\n };\n };\n exports.cacheSignal = function () {\n return null;\n };\n exports.captureOwnerStack = function () {\n var getCurrentStack = ReactSharedInternals.getCurrentStack;\n return null === getCurrentStack ? null : getCurrentStack();\n };\n exports.cloneElement = function (element, config, children) {\n if (null === element || void 0 === element)\n throw Error(\n \"The argument must be a React element, but you passed \" +\n element +\n \".\"\n );\n var props = assign({}, element.props),\n key = element.key,\n owner = element._owner;\n if (null != config) {\n var JSCompiler_inline_result;\n a: {\n if (\n hasOwnProperty.call(config, \"ref\") &&\n (JSCompiler_inline_result = Object.getOwnPropertyDescriptor(\n config,\n \"ref\"\n ).get) &&\n JSCompiler_inline_result.isReactWarning\n ) {\n JSCompiler_inline_result = !1;\n break a;\n }\n JSCompiler_inline_result = void 0 !== config.ref;\n }\n JSCompiler_inline_result && (owner = getOwner());\n hasValidKey(config) &&\n (checkKeyStringCoercion(config.key), (key = \"\" + config.key));\n for (propName in config)\n !hasOwnProperty.call(config, propName) ||\n \"key\" === propName ||\n \"__self\" === propName ||\n \"__source\" === propName ||\n (\"ref\" === propName && void 0 === config.ref) ||\n (props[propName] = config[propName]);\n }\n var propName = arguments.length - 2;\n if (1 === propName) props.children = children;\n else if (1 < propName) {\n JSCompiler_inline_result = Array(propName);\n for (var i = 0; i < propName; i++)\n JSCompiler_inline_result[i] = arguments[i + 2];\n props.children = JSCompiler_inline_result;\n }\n props = ReactElement(\n element.type,\n key,\n props,\n owner,\n element._debugStack,\n element._debugTask\n );\n for (key = 2; key < arguments.length; key++)\n validateChildKeys(arguments[key]);\n return props;\n };\n exports.createContext = function (defaultValue) {\n defaultValue = {\n $$typeof: REACT_CONTEXT_TYPE,\n _currentValue: defaultValue,\n _currentValue2: defaultValue,\n _threadCount: 0,\n Provider: null,\n Consumer: null\n };\n defaultValue.Provider = defaultValue;\n defaultValue.Consumer = {\n $$typeof: REACT_CONSUMER_TYPE,\n _context: defaultValue\n };\n defaultValue._currentRenderer = null;\n defaultValue._currentRenderer2 = null;\n return defaultValue;\n };\n exports.createElement = function (type, config, children) {\n for (var i = 2; i < arguments.length; i++)\n validateChildKeys(arguments[i]);\n i = {};\n var key = null;\n if (null != config)\n for (propName in (didWarnAboutOldJSXRuntime ||\n !(\"__self\" in config) ||\n \"key\" in config ||\n ((didWarnAboutOldJSXRuntime = !0),\n console.warn(\n \"Your app (or one of its dependencies) is using an outdated JSX transform. Update to the modern JSX transform for faster performance: https://react.dev/link/new-jsx-transform\"\n )),\n hasValidKey(config) &&\n (checkKeyStringCoercion(config.key), (key = \"\" + config.key)),\n config))\n hasOwnProperty.call(config, propName) &&\n \"key\" !== propName &&\n \"__self\" !== propName &&\n \"__source\" !== propName &&\n (i[propName] = config[propName]);\n var childrenLength = arguments.length - 2;\n if (1 === childrenLength) i.children = children;\n else if (1 < childrenLength) {\n for (\n var childArray = Array(childrenLength), _i = 0;\n _i < childrenLength;\n _i++\n )\n childArray[_i] = arguments[_i + 2];\n Object.freeze && Object.freeze(childArray);\n i.children = childArray;\n }\n if (type && type.defaultProps)\n for (propName in ((childrenLength = type.defaultProps), childrenLength))\n void 0 === i[propName] && (i[propName] = childrenLength[propName]);\n key &&\n defineKeyPropWarningGetter(\n i,\n \"function\" === typeof type\n ? type.displayName || type.name || \"Unknown\"\n : type\n );\n var propName = 1e4 > ReactSharedInternals.recentlyCreatedOwnerStacks++;\n return ReactElement(\n type,\n key,\n i,\n getOwner(),\n propName ? Error(\"react-stack-top-frame\") : unknownOwnerDebugStack,\n propName ? createTask(getTaskName(type)) : unknownOwnerDebugTask\n );\n };\n exports.createRef = function () {\n var refObject = { current: null };\n Object.seal(refObject);\n return refObject;\n };\n exports.forwardRef = function (render) {\n null != render && render.$$typeof === REACT_MEMO_TYPE\n ? console.error(\n \"forwardRef requires a render function but received a `memo` component. Instead of forwardRef(memo(...)), use memo(forwardRef(...)).\"\n )\n : \"function\" !== typeof render\n ? console.error(\n \"forwardRef requires a render function but was given %s.\",\n null === render ? \"null\" : typeof render\n )\n : 0 !== render.length &&\n 2 !== render.length &&\n console.error(\n \"forwardRef render functions accept exactly two parameters: props and ref. %s\",\n 1 === render.length\n ? \"Did you forget to use the ref parameter?\"\n : \"Any additional parameter will be undefined.\"\n );\n null != render &&\n null != render.defaultProps &&\n console.error(\n \"forwardRef render functions do not support defaultProps. Did you accidentally pass a React component?\"\n );\n var elementType = { $$typeof: REACT_FORWARD_REF_TYPE, render: render },\n ownName;\n Object.defineProperty(elementType, \"displayName\", {\n enumerable: !1,\n configurable: !0,\n get: function () {\n return ownName;\n },\n set: function (name) {\n ownName = name;\n render.name ||\n render.displayName ||\n (Object.defineProperty(render, \"name\", { value: name }),\n (render.displayName = name));\n }\n });\n return elementType;\n };\n exports.isValidElement = isValidElement;\n exports.lazy = function (ctor) {\n ctor = { _status: -1, _result: ctor };\n var lazyType = {\n $$typeof: REACT_LAZY_TYPE,\n _payload: ctor,\n _init: lazyInitializer\n },\n ioInfo = {\n name: \"lazy\",\n start: -1,\n end: -1,\n value: null,\n owner: null,\n debugStack: Error(\"react-stack-top-frame\"),\n debugTask: console.createTask ? console.createTask(\"lazy()\") : null\n };\n ctor._ioInfo = ioInfo;\n lazyType._debugInfo = [{ awaited: ioInfo }];\n return lazyType;\n };\n exports.memo = function (type, compare) {\n null == type &&\n console.error(\n \"memo: The first argument must be a component. Instead received: %s\",\n null === type ? \"null\" : typeof type\n );\n compare = {\n $$typeof: REACT_MEMO_TYPE,\n type: type,\n compare: void 0 === compare ? null : compare\n };\n var ownName;\n Object.defineProperty(compare, \"displayName\", {\n enumerable: !1,\n configurable: !0,\n get: function () {\n return ownName;\n },\n set: function (name) {\n ownName = name;\n type.name ||\n type.displayName ||\n (Object.defineProperty(type, \"name\", { value: name }),\n (type.displayName = name));\n }\n });\n return compare;\n };\n exports.startTransition = function (scope) {\n var prevTransition = ReactSharedInternals.T,\n currentTransition = {};\n currentTransition._updatedFibers = new Set();\n ReactSharedInternals.T = currentTransition;\n try {\n var returnValue = scope(),\n onStartTransitionFinish = ReactSharedInternals.S;\n null !== onStartTransitionFinish &&\n onStartTransitionFinish(currentTransition, returnValue);\n \"object\" === typeof returnValue &&\n null !== returnValue &&\n \"function\" === typeof returnValue.then &&\n (ReactSharedInternals.asyncTransitions++,\n returnValue.then(releaseAsyncTransition, releaseAsyncTransition),\n returnValue.then(noop, reportGlobalError));\n } catch (error) {\n reportGlobalError(error);\n } finally {\n null === prevTransition &&\n currentTransition._updatedFibers &&\n ((scope = currentTransition._updatedFibers.size),\n currentTransition._updatedFibers.clear(),\n 10 < scope &&\n console.warn(\n \"Detected a large number of updates inside startTransition. If this is due to a subscription please re-write it to use React provided hooks. Otherwise concurrent mode guarantees are off the table.\"\n )),\n null !== prevTransition &&\n null !== currentTransition.types &&\n (null !== prevTransition.types &&\n prevTransition.types !== currentTransition.types &&\n console.error(\n \"We expected inner Transitions to have transferred the outer types set and that you cannot add to the outer Transition while inside the inner.This is a bug in React.\"\n ),\n (prevTransition.types = currentTransition.types)),\n (ReactSharedInternals.T = prevTransition);\n }\n };\n exports.unstable_useCacheRefresh = function () {\n return resolveDispatcher().useCacheRefresh();\n };\n exports.use = function (usable) {\n return resolveDispatcher().use(usable);\n };\n exports.useActionState = function (action, initialState, permalink) {\n return resolveDispatcher().useActionState(\n action,\n initialState,\n permalink\n );\n };\n exports.useCallback = function (callback, deps) {\n return resolveDispatcher().useCallback(callback, deps);\n };\n exports.useContext = function (Context) {\n var dispatcher = resolveDispatcher();\n Context.$$typeof === REACT_CONSUMER_TYPE &&\n console.error(\n \"Calling useContext(Context.Consumer) is not supported and will cause bugs. Did you mean to call useContext(Context) instead?\"\n );\n return dispatcher.useContext(Context);\n };\n exports.useDebugValue = function (value, formatterFn) {\n return resolveDispatcher().useDebugValue(value, formatterFn);\n };\n exports.useDeferredValue = function (value, initialValue) {\n return resolveDispatcher().useDeferredValue(value, initialValue);\n };\n exports.useEffect = function (create, deps) {\n null == create &&\n console.warn(\n \"React Hook useEffect requires an effect callback. Did you forget to pass a callback to the hook?\"\n );\n return resolveDispatcher().useEffect(create, deps);\n };\n exports.useEffectEvent = function (callback) {\n return resolveDispatcher().useEffectEvent(callback);\n };\n exports.useId = function () {\n return resolveDispatcher().useId();\n };\n exports.useImperativeHandle = function (ref, create, deps) {\n return resolveDispatcher().useImperativeHandle(ref, create, deps);\n };\n exports.useInsertionEffect = function (create, deps) {\n null == create &&\n console.warn(\n \"React Hook useInsertionEffect requires an effect callback. Did you forget to pass a callback to the hook?\"\n );\n return resolveDispatcher().useInsertionEffect(create, deps);\n };\n exports.useLayoutEffect = function (create, deps) {\n null == create &&\n console.warn(\n \"React Hook useLayoutEffect requires an effect callback. Did you forget to pass a callback to the hook?\"\n );\n return resolveDispatcher().useLayoutEffect(create, deps);\n };\n exports.useMemo = function (create, deps) {\n return resolveDispatcher().useMemo(create, deps);\n };\n exports.useOptimistic = function (passthrough, reducer) {\n return resolveDispatcher().useOptimistic(passthrough, reducer);\n };\n exports.useReducer = function (reducer, initialArg, init) {\n return resolveDispatcher().useReducer(reducer, initialArg, init);\n };\n exports.useRef = function (initialValue) {\n return resolveDispatcher().useRef(initialValue);\n };\n exports.useState = function (initialState) {\n return resolveDispatcher().useState(initialState);\n };\n exports.useSyncExternalStore = function (\n subscribe,\n getSnapshot,\n getServerSnapshot\n ) {\n return resolveDispatcher().useSyncExternalStore(\n subscribe,\n getSnapshot,\n getServerSnapshot\n );\n };\n exports.useTransition = function () {\n return resolveDispatcher().useTransition();\n };\n exports.version = \"19.2.4\";\n \"undefined\" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ &&\n \"function\" ===\n typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop &&\n __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(Error());\n })();\n","'use strict';\n\nif (process.env.NODE_ENV === 'production') {\n module.exports = require('./cjs/react.production.js');\n} else {\n module.exports = require('./cjs/react.development.js');\n}\n","/**\n * @license React\n * react-jsx-runtime.production.js\n *\n * Copyright (c) Meta Platforms, Inc. and affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\n\"use strict\";\nvar REACT_ELEMENT_TYPE = Symbol.for(\"react.transitional.element\"),\n REACT_FRAGMENT_TYPE = Symbol.for(\"react.fragment\");\nfunction jsxProd(type, config, maybeKey) {\n var key = null;\n void 0 !== maybeKey && (key = \"\" + maybeKey);\n void 0 !== config.key && (key = \"\" + config.key);\n if (\"key\" in config) {\n maybeKey = {};\n for (var propName in config)\n \"key\" !== propName && (maybeKey[propName] = config[propName]);\n } else maybeKey = config;\n config = maybeKey.ref;\n return {\n $$typeof: REACT_ELEMENT_TYPE,\n type: type,\n key: key,\n ref: void 0 !== config ? config : null,\n props: maybeKey\n };\n}\nexports.Fragment = REACT_FRAGMENT_TYPE;\nexports.jsx = jsxProd;\nexports.jsxs = jsxProd;\n","/**\n * @license React\n * react-jsx-runtime.development.js\n *\n * Copyright (c) Meta Platforms, Inc. and affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\n\"use strict\";\n\"production\" !== process.env.NODE_ENV &&\n (function () {\n function getComponentNameFromType(type) {\n if (null == type) return null;\n if (\"function\" === typeof type)\n return type.$$typeof === REACT_CLIENT_REFERENCE\n ? null\n : type.displayName || type.name || null;\n if (\"string\" === typeof type) return type;\n switch (type) {\n case REACT_FRAGMENT_TYPE:\n return \"Fragment\";\n case REACT_PROFILER_TYPE:\n return \"Profiler\";\n case REACT_STRICT_MODE_TYPE:\n return \"StrictMode\";\n case REACT_SUSPENSE_TYPE:\n return \"Suspense\";\n case REACT_SUSPENSE_LIST_TYPE:\n return \"SuspenseList\";\n case REACT_ACTIVITY_TYPE:\n return \"Activity\";\n }\n if (\"object\" === typeof type)\n switch (\n (\"number\" === typeof type.tag &&\n console.error(\n \"Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue.\"\n ),\n type.$$typeof)\n ) {\n case REACT_PORTAL_TYPE:\n return \"Portal\";\n case REACT_CONTEXT_TYPE:\n return type.displayName || \"Context\";\n case REACT_CONSUMER_TYPE:\n return (type._context.displayName || \"Context\") + \".Consumer\";\n case REACT_FORWARD_REF_TYPE:\n var innerType = type.render;\n type = type.displayName;\n type ||\n ((type = innerType.displayName || innerType.name || \"\"),\n (type = \"\" !== type ? \"ForwardRef(\" + type + \")\" : \"ForwardRef\"));\n return type;\n case REACT_MEMO_TYPE:\n return (\n (innerType = type.displayName || null),\n null !== innerType\n ? innerType\n : getComponentNameFromType(type.type) || \"Memo\"\n );\n case REACT_LAZY_TYPE:\n innerType = type._payload;\n type = type._init;\n try {\n return getComponentNameFromType(type(innerType));\n } catch (x) {}\n }\n return null;\n }\n function testStringCoercion(value) {\n return \"\" + value;\n }\n function checkKeyStringCoercion(value) {\n try {\n testStringCoercion(value);\n var JSCompiler_inline_result = !1;\n } catch (e) {\n JSCompiler_inline_result = !0;\n }\n if (JSCompiler_inline_result) {\n JSCompiler_inline_result = console;\n var JSCompiler_temp_const = JSCompiler_inline_result.error;\n var JSCompiler_inline_result$jscomp$0 =\n (\"function\" === typeof Symbol &&\n Symbol.toStringTag &&\n value[Symbol.toStringTag]) ||\n value.constructor.name ||\n \"Object\";\n JSCompiler_temp_const.call(\n JSCompiler_inline_result,\n \"The provided key is an unsupported type %s. This value must be coerced to a string before using it here.\",\n JSCompiler_inline_result$jscomp$0\n );\n return testStringCoercion(value);\n }\n }\n function getTaskName(type) {\n if (type === REACT_FRAGMENT_TYPE) return \"<>\";\n if (\n \"object\" === typeof type &&\n null !== type &&\n type.$$typeof === REACT_LAZY_TYPE\n )\n return \"<...>\";\n try {\n var name = getComponentNameFromType(type);\n return name ? \"<\" + name + \">\" : \"<...>\";\n } catch (x) {\n return \"<...>\";\n }\n }\n function getOwner() {\n var dispatcher = ReactSharedInternals.A;\n return null === dispatcher ? null : dispatcher.getOwner();\n }\n function UnknownOwner() {\n return Error(\"react-stack-top-frame\");\n }\n function hasValidKey(config) {\n if (hasOwnProperty.call(config, \"key\")) {\n var getter = Object.getOwnPropertyDescriptor(config, \"key\").get;\n if (getter && getter.isReactWarning) return !1;\n }\n return void 0 !== config.key;\n }\n function defineKeyPropWarningGetter(props, displayName) {\n function warnAboutAccessingKey() {\n specialPropKeyWarningShown ||\n ((specialPropKeyWarningShown = !0),\n console.error(\n \"%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://react.dev/link/special-props)\",\n displayName\n ));\n }\n warnAboutAccessingKey.isReactWarning = !0;\n Object.defineProperty(props, \"key\", {\n get: warnAboutAccessingKey,\n configurable: !0\n });\n }\n function elementRefGetterWithDeprecationWarning() {\n var componentName = getComponentNameFromType(this.type);\n didWarnAboutElementRef[componentName] ||\n ((didWarnAboutElementRef[componentName] = !0),\n console.error(\n \"Accessing element.ref was removed in React 19. ref is now a regular prop. It will be removed from the JSX Element type in a future release.\"\n ));\n componentName = this.props.ref;\n return void 0 !== componentName ? componentName : null;\n }\n function ReactElement(type, key, props, owner, debugStack, debugTask) {\n var refProp = props.ref;\n type = {\n $$typeof: REACT_ELEMENT_TYPE,\n type: type,\n key: key,\n props: props,\n _owner: owner\n };\n null !== (void 0 !== refProp ? refProp : null)\n ? Object.defineProperty(type, \"ref\", {\n enumerable: !1,\n get: elementRefGetterWithDeprecationWarning\n })\n : Object.defineProperty(type, \"ref\", { enumerable: !1, value: null });\n type._store = {};\n Object.defineProperty(type._store, \"validated\", {\n configurable: !1,\n enumerable: !1,\n writable: !0,\n value: 0\n });\n Object.defineProperty(type, \"_debugInfo\", {\n configurable: !1,\n enumerable: !1,\n writable: !0,\n value: null\n });\n Object.defineProperty(type, \"_debugStack\", {\n configurable: !1,\n enumerable: !1,\n writable: !0,\n value: debugStack\n });\n Object.defineProperty(type, \"_debugTask\", {\n configurable: !1,\n enumerable: !1,\n writable: !0,\n value: debugTask\n });\n Object.freeze && (Object.freeze(type.props), Object.freeze(type));\n return type;\n }\n function jsxDEVImpl(\n type,\n config,\n maybeKey,\n isStaticChildren,\n debugStack,\n debugTask\n ) {\n var children = config.children;\n if (void 0 !== children)\n if (isStaticChildren)\n if (isArrayImpl(children)) {\n for (\n isStaticChildren = 0;\n isStaticChildren < children.length;\n isStaticChildren++\n )\n validateChildKeys(children[isStaticChildren]);\n Object.freeze && Object.freeze(children);\n } else\n console.error(\n \"React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.\"\n );\n else validateChildKeys(children);\n if (hasOwnProperty.call(config, \"key\")) {\n children = getComponentNameFromType(type);\n var keys = Object.keys(config).filter(function (k) {\n return \"key\" !== k;\n });\n isStaticChildren =\n 0 < keys.length\n ? \"{key: someKey, \" + keys.join(\": ..., \") + \": ...}\"\n : \"{key: someKey}\";\n didWarnAboutKeySpread[children + isStaticChildren] ||\n ((keys =\n 0 < keys.length ? \"{\" + keys.join(\": ..., \") + \": ...}\" : \"{}\"),\n console.error(\n 'A props object containing a \"key\" prop is being spread into JSX:\\n let props = %s;\\n <%s {...props} />\\nReact keys must be passed directly to JSX without using spread:\\n let props = %s;\\n <%s key={someKey} {...props} />',\n isStaticChildren,\n children,\n keys,\n children\n ),\n (didWarnAboutKeySpread[children + isStaticChildren] = !0));\n }\n children = null;\n void 0 !== maybeKey &&\n (checkKeyStringCoercion(maybeKey), (children = \"\" + maybeKey));\n hasValidKey(config) &&\n (checkKeyStringCoercion(config.key), (children = \"\" + config.key));\n if (\"key\" in config) {\n maybeKey = {};\n for (var propName in config)\n \"key\" !== propName && (maybeKey[propName] = config[propName]);\n } else maybeKey = config;\n children &&\n defineKeyPropWarningGetter(\n maybeKey,\n \"function\" === typeof type\n ? type.displayName || type.name || \"Unknown\"\n : type\n );\n return ReactElement(\n type,\n children,\n maybeKey,\n getOwner(),\n debugStack,\n debugTask\n );\n }\n function validateChildKeys(node) {\n isValidElement(node)\n ? node._store && (node._store.validated = 1)\n : \"object\" === typeof node &&\n null !== node &&\n node.$$typeof === REACT_LAZY_TYPE &&\n (\"fulfilled\" === node._payload.status\n ? isValidElement(node._payload.value) &&\n node._payload.value._store &&\n (node._payload.value._store.validated = 1)\n : node._store && (node._store.validated = 1));\n }\n function isValidElement(object) {\n return (\n \"object\" === typeof object &&\n null !== object &&\n object.$$typeof === REACT_ELEMENT_TYPE\n );\n }\n var React = require(\"react\"),\n REACT_ELEMENT_TYPE = Symbol.for(\"react.transitional.element\"),\n REACT_PORTAL_TYPE = Symbol.for(\"react.portal\"),\n REACT_FRAGMENT_TYPE = Symbol.for(\"react.fragment\"),\n REACT_STRICT_MODE_TYPE = Symbol.for(\"react.strict_mode\"),\n REACT_PROFILER_TYPE = Symbol.for(\"react.profiler\"),\n REACT_CONSUMER_TYPE = Symbol.for(\"react.consumer\"),\n REACT_CONTEXT_TYPE = Symbol.for(\"react.context\"),\n REACT_FORWARD_REF_TYPE = Symbol.for(\"react.forward_ref\"),\n REACT_SUSPENSE_TYPE = Symbol.for(\"react.suspense\"),\n REACT_SUSPENSE_LIST_TYPE = Symbol.for(\"react.suspense_list\"),\n REACT_MEMO_TYPE = Symbol.for(\"react.memo\"),\n REACT_LAZY_TYPE = Symbol.for(\"react.lazy\"),\n REACT_ACTIVITY_TYPE = Symbol.for(\"react.activity\"),\n REACT_CLIENT_REFERENCE = Symbol.for(\"react.client.reference\"),\n ReactSharedInternals =\n React.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,\n hasOwnProperty = Object.prototype.hasOwnProperty,\n isArrayImpl = Array.isArray,\n createTask = console.createTask\n ? console.createTask\n : function () {\n return null;\n };\n React = {\n react_stack_bottom_frame: function (callStackForError) {\n return callStackForError();\n }\n };\n var specialPropKeyWarningShown;\n var didWarnAboutElementRef = {};\n var unknownOwnerDebugStack = React.react_stack_bottom_frame.bind(\n React,\n UnknownOwner\n )();\n var unknownOwnerDebugTask = createTask(getTaskName(UnknownOwner));\n var didWarnAboutKeySpread = {};\n exports.Fragment = REACT_FRAGMENT_TYPE;\n exports.jsx = function (type, config, maybeKey) {\n var trackActualOwner =\n 1e4 > ReactSharedInternals.recentlyCreatedOwnerStacks++;\n return jsxDEVImpl(\n type,\n config,\n maybeKey,\n !1,\n trackActualOwner\n ? Error(\"react-stack-top-frame\")\n : unknownOwnerDebugStack,\n trackActualOwner ? createTask(getTaskName(type)) : unknownOwnerDebugTask\n );\n };\n exports.jsxs = function (type, config, maybeKey) {\n var trackActualOwner =\n 1e4 > ReactSharedInternals.recentlyCreatedOwnerStacks++;\n return jsxDEVImpl(\n type,\n config,\n maybeKey,\n !0,\n trackActualOwner\n ? Error(\"react-stack-top-frame\")\n : unknownOwnerDebugStack,\n trackActualOwner ? createTask(getTaskName(type)) : unknownOwnerDebugTask\n );\n };\n })();\n","'use strict';\n\nif (process.env.NODE_ENV === 'production') {\n module.exports = require('./cjs/react-jsx-runtime.production.js');\n} else {\n module.exports = require('./cjs/react-jsx-runtime.development.js');\n}\n","/*---------------------------------------------------------------------------------------\n * Copyright (c) Pixodesk LTD.\n * Licensed under the MIT License. See the LICENSE file in the project root for details.\n *---------------------------------------------------------------------------------------*/\n\nimport PixodeskSvgAnimator from './PixodeskSvgAnimator';\nexport type { ReactAnimatorApi } from './PixodeskSvgAnimator';\nexport { PixodeskSvgAnimator };\n\nimport PixodeskSvgCssAnimator from './PixodeskSvgCssAnimator';\nexport { PixodeskSvgCssAnimator };\n","/*---------------------------------------------------------------------------------------\n * Copyright (c) Pixodesk LTD.\n * Licensed under the MIT License. See the LICENSE file in the project root for details.\n *---------------------------------------------------------------------------------------*/\n\n\n/**\n * Helpers for reading animatable transform parts and shaping them into the\n * player's `PxTransformParts` records. Shared by the transformation and\n * masked-by effects (the latter builds INVERSE parts).\n */\n\nimport type { ApplyContext, PxAnimatable, PxKeyframe, Vec2 } from './types';\n\n/** Builds a player `PxTransformParts` record for one part (+ optional origin). */\nexport function partsRecord(part: 'translate' | 'rotate' | 'scale', value: any, origin: Vec2 | undefined) {\n const rec: { translate?: Vec2; rotate?: number; scale?: Vec2; origin?: Vec2 } = {};\n if (part === 'translate') rec.translate = value;\n else if (part === 'rotate') rec.rotate = value;\n else rec.scale = value;\n if (origin && part !== 'translate') rec.origin = origin;\n return rec;\n}\n\nexport type ReadPart<T> =\n | { kind: 'absent' }\n | { kind: 'static'; value: T }\n | { kind: 'animated'; keyframes: Array<PxKeyframe<T>>; autoOrient?: boolean };\n\n/** Normalises an animatable field into a static value or a keyframe list (with\n * `autoOrient` propagated for motion-path translate). */\nexport function readAnimatable<T>(raw: PxAnimatable<T> | undefined): ReadPart<T> {\n if (raw === undefined) return { kind: 'absent' };\n if (Array.isArray(raw)) return { kind: 'static', value: raw as unknown as T };\n if (typeof raw === 'object') {\n const obj = raw as { value?: T; keyframes?: Array<PxKeyframe<T>>; autoOrient?: boolean };\n if (obj.keyframes) {\n return { kind: 'animated', keyframes: obj.keyframes, autoOrient: obj.autoOrient };\n }\n if (obj.value !== undefined) return { kind: 'static', value: obj.value };\n }\n return { kind: 'static', value: raw as T };\n}\n\n/** Origin used inside rotate/scale records. Animated origin falls back to frame 0. */\nexport function readStaticOrigin(raw: PxAnimatable<Vec2> | undefined, ctx: ApplyContext): Vec2 | undefined {\n const o = readAnimatable<Vec2>(raw);\n if (o.kind === 'absent') return undefined;\n if (o.kind === 'static') return o.value;\n ctx.warnings.push('transformation.origin: animated origin approximated by its first keyframe');\n return o.keyframes[0]?.value;\n}\n\n/** Copies a keyframe's time / easing / motion-path tangent handles onto a new parts-record value. */\nexport function keyframeWith(kf: PxKeyframe<any>, value: any): PxKeyframe<any> {\n const out: PxKeyframe<any> = { value };\n if (kf.time !== undefined) out.time = kf.time;\n if (kf.easing !== undefined) out.easing = kf.easing;\n if (kf.tangentOut !== undefined) out.tangentOut = kf.tangentOut;\n if (kf.tangentIn !== undefined) out.tangentIn = kf.tangentIn;\n return out;\n}\n","/*---------------------------------------------------------------------------------------\n * Copyright (c) Pixodesk LTD.\n * Licensed under the MIT License. See the LICENSE file in the project root for details.\n *---------------------------------------------------------------------------------------*/\n\n\nimport { keyframeWith, partsRecord, readAnimatable } from './transformParts';\nimport type { ApplyContext, PxAnimatable, PxNode, PxTransformationEffect, Vec2 } from './types';\n\n\n/**\n * TRANSFORMATION → one `<g>` wrapper per part (translate/rotate/scale/skew),\n * with origin emitted as SEPARATE `+origin` / `-origin` wrappers flanking the\n * rotate/scale pair (matches editor's `SvgTransformElementEffectRenderer`).\n *\n * Per-wrapper kfs:\n * - each wrapper carries ONE animatable quantity, so animated origin / rotate /\n * scale all play correctly per their own keyframe timelines — nothing is\n * baked into another part's wrapper.\n * - the `+o · ... · -o` sandwich pivots rotate+scale around the (possibly\n * animated) origin; translates compose flat (commute).\n *\n * Wrapper nesting (outer → inner):\n *\n * translate → +origin → rotate → scale → -origin → skew → element\n *\n * Composition: `M = translate(t) · +origin(t) · rotate(t) · scale(t) · -origin(t) · skew`\n * — equivalent to the editor's `getTransform` / `matrixFromParts` convention\n * (skew is appended innermost; editor doesn't compose skew here either).\n */\nexport function applyTransformationEffect(node: PxNode, fx: PxTransformationEffect | undefined, ctx: ApplyContext): PxNode {\n if (!fx) return node;\n\n // The element's own `transform` string is the frame-0 baseline; wrappers\n // carry the full (animated) transform, so the baseline is dropped.\n delete node.transform;\n\n // Innermost first. Order outer→inner: [+o, t, -o, +o, r, s, -o, skew] for\n // auto-orient (translate carries motion-path rotation that must pivot around\n // origin too), else [t, +o, r, s, -o, skew] (translate composes flat).\n let n = node;\n n = wrapTransformPart(n, 'skew', fx.skew, ctx);\n n = wrapOrigin(n, fx.origin, /*invert=*/true); // -origin (r/s sandwich)\n n = wrapTransformPart(n, 'scale', normalizeScale(fx.scale), ctx);\n n = wrapTransformPart(n, 'rotate', fx.rotate, ctx);\n n = wrapOrigin(n, fx.origin, /*invert=*/false); // +origin (r/s sandwich)\n\n if (translateHasAutoOrient(fx.translate)) {\n // Sandwich translate with its own +o/-o so the motion-path tangent\n // rotation built into the translate wrapper pivots around origin —\n // matches editor's `[+o, t_path_ao, -o]` branch.\n n = wrapOrigin(n, fx.origin, /*invert=*/true); // -origin (translate sandwich)\n n = wrapTransformPart(n, 'translate', fx.translate, ctx);\n n = wrapOrigin(n, fx.origin, /*invert=*/false); // +origin (translate sandwich)\n } else {\n n = wrapTransformPart(n, 'translate', fx.translate, ctx);\n }\n return n;\n}\n\n/** True when the translate animation carries motion-path tangent handles or\n * `autoOrient` — the path-tangent rotation needs origin-sandwich to pivot. */\nfunction translateHasAutoOrient(translate: PxAnimatable<Vec2> | undefined): boolean {\n if (!translate || typeof translate !== 'object') return false;\n const obj = translate as { autoOrient?: boolean; keyframes?: Array<{ tangentOut?: Vec2; tangentIn?: Vec2 }> };\n if (obj.autoOrient) return true;\n return Array.isArray(obj.keyframes) && obj.keyframes.some(kf => kf.tangentOut || kf.tangentIn);\n}\n\n/**\n * The writer's `effects.transformation.scale` emits **editor units** (150 = 150%)\n * for the bare-array static form, but emits **1.0-units** (1.5 = 150%) inside\n * `{keyframes: [...]}` (matching the body `transform` baseline and the walker's\n * `matrixFromParts`). The bare-array form is the one we have to convert.\n */\nfunction normalizeScale(raw: PxAnimatable<Vec2> | undefined): PxAnimatable<Vec2> | undefined {\n if (raw === undefined) return undefined;\n if (Array.isArray(raw)) return [raw[0] / 100, raw[1] / 100] as Vec2;\n return raw;\n}\n\n/** Wraps `inner` in a `<g>` carrying a single transform part, static or animated. */\nfunction wrapTransformPart(\n inner: PxNode, part: 'translate' | 'rotate' | 'scale' | 'skew',\n raw: PxAnimatable<any> | undefined, ctx: ApplyContext\n): PxNode {\n if (raw === undefined) return inner;\n\n if (part === 'skew') {\n const skew = readAnimatable<Vec2>(raw);\n if (skew.kind !== 'static') { ctx.warnings.push('transformation.skew: only static skew is supported'); return inner; }\n return { type: 'g', transform: 'skewX(' + skew.value[0] + ')skewY(' + skew.value[1] + ')', children: [inner] };\n }\n\n const v = readAnimatable<any>(raw);\n if (v.kind === 'static') {\n return { type: 'g', transform: { value: partsRecord(part, v.value, undefined) }, children: [inner] };\n }\n if (v.kind === 'animated') {\n const animTr: any = { keyframes: v.keyframes.map(kf => keyframeWith(kf, partsRecord(part, kf.value, undefined))) };\n if (v.autoOrient) animTr.autoOrient = true;\n return {\n type: 'g',\n animate: { transform: animTr },\n children: [inner],\n };\n }\n return inner;\n}\n\n/**\n * Wraps `inner` in a `<g translate>` that shifts by `+origin` (invert=false) or\n * `-origin` (invert=true). Origin is animatable — keyframes are carried through.\n *\n * Emitted as a `{translate}` PartsRecord (not the `{origin}` field) so a `+o`\n * wrapper is just a plain translate in the walker's eyes: the walker composes\n * the origin-sandwich rotation/scale around origin by stacking the wrappers,\n * NOT by reading `origin` off the rotate/scale wrapper's parts record.\n */\nfunction wrapOrigin(inner: PxNode, raw: PxAnimatable<Vec2> | undefined, invert: boolean): PxNode {\n if (raw === undefined) return inner;\n const v = readAnimatable<Vec2>(raw);\n const sign = (value: Vec2): Vec2 => invert ? [-value[0], -value[1]] : value;\n\n if (v.kind === 'absent') return inner;\n if (v.kind === 'static') {\n if (v.value[0] === 0 && v.value[1] === 0) return inner; // identity — skip\n return { type: 'g', transform: { value: { translate: sign(v.value) } }, children: [inner] };\n }\n if (v.kind === 'animated') {\n return {\n type: 'g',\n animate: { transform: { keyframes: v.keyframes.map(kf => keyframeWith(kf, { translate: sign(kf.value as Vec2) })) } },\n children: [inner],\n };\n }\n return inner;\n}\n","/*---------------------------------------------------------------------------------------\n * Copyright (c) Pixodesk LTD.\n * Licensed under the MIT License. See the LICENSE file in the project root for details.\n *---------------------------------------------------------------------------------------*/\n\n\n/**\n * CONTENT-REF SOURCE SPLIT — mirrors the editor's\n * `SvgTransformElementEffectRenderer.renderElementWrapper` (hasContentRef branch).\n *\n * When a `<use>` references another element with `ref:{type:'content'}` it wants\n * to render the source EXCLUDING the source's own translate (and along-path\n * positioning for auto-orient). The editor achieves this by materialising the\n * source as a wrapper tree\n *\n * <g translate> ← outer, holds translate (+ along-path/origin for autoOrient)\n * <g rotate scale +o-o> ← inner, holds rotate/scale (origin sandwich)\n * <element /> ← bare shape, no transform\n * </g>\n * </g>\n *\n * and points the `<use>` at the INNER `<g>`. The use's reference therefore\n * renders rotate/scale around the use's position — never the source's translate.\n *\n * In the lightweight format the source is emitted as a flat element (translate\n * baked onto the body or into `effects.transformation`). The applier's\n * `splitForContentRef` re-creates the multi-layer structure on the fly:\n * 1. extract translate parts from the source body (`transform` string,\n * `animate.transform.keyframes` PartsRecord) and from\n * `effects.transformation` → outer wrapper\n * 2. keep rotate / scale (with origin sandwich) on the inner wrapper\n * 3. assign the ORIGINAL id to the outer, a fresh id to the inner\n * 4. `applyRefAndTransformationEffect` then rewrites the use's `href`\n * to the inner id (see `ctx.contentRefInnerIds`).\n *\n * Auto-orient / motion-path: when the translate animation carries tangent\n * handles (`tangentOut`/`tangentIn`) or `autoOrient`, the path tangent produces\n * a rotation at the OUTER level — so the origin moves to the outer too, so the\n * tangent rotation pivots around it (matches editor's `[+o, t_path_ao, -o]`\n * branch).\n *\n * \"Always-split\" simplicity: even when a layer would be empty (e.g. source has\n * no rotate/scale), the inner wrapper is still emitted as an identity `<g>`.\n * The use needs a stable target regardless of which transform parts the source\n * carries, and an extra empty `<g>` is render-neutral.\n */\n\nimport { applyTransformationEffect } from './transformationEffect';\nimport type { ApplyContext, PxAnimatable, PxKeyframe, PxNode, PxTransformationEffect, Vec2 } from './types';\n\n\n/** Walks the tree and collects every id referenced by a `<use>` with `ref:{type:'content'}`. */\nexport function identifyContentRefTargets(node: PxNode, ctx: ApplyContext, allocator: (key: string) => string): void {\n if (node.type === 'use' && node.effects?.ref?.type === 'content') {\n const baseId = node.effects.ref.baseId;\n if (typeof baseId === 'string' && baseId && !ctx.contentRefInnerIds.has(baseId)) {\n ctx.contentRefInnerIds.set(baseId, allocator(baseId));\n }\n }\n node.children?.forEach(c => identifyContentRefTargets(c, ctx, allocator));\n}\n\n\n/**\n * Splits `node` into outer-translate + inner-rest + bare element. `node` is\n * mutated in place: its body translate is moved to the outer wrapper, leaving\n * the rotate/scale parts (and the element body) inside the inner wrapper.\n *\n * Outer wrapper gets `originalId` (so `idMap` and whole-element refs still\n * resolve correctly). Inner wrapper gets `innerId` (the use's `ref:content`\n * target). The returned node is the OUTER wrapper.\n */\nexport function splitForContentRef(\n node: PxNode,\n transformation: PxTransformationEffect | undefined,\n originalId: string,\n innerId: string,\n ctx: ApplyContext,\n): PxNode {\n\n // 1. Lift translate parts off the body (`transform` string + `animate.transform`)\n // onto a fresh outer-side bag. After this, `node` no longer carries them.\n // `transformation` is passed in so that when its `translate` part will go to\n // the outer wrapper, the body's baked-in translate baseline is stripped too\n // (otherwise it'd double-up against the outer wrapper's first keyframe).\n const outerBody = liftBodyTranslate(node, transformation);\n\n // Strip the bare element's `id` — the outer wrapper takes ownership of `originalId`,\n // and the inner wrapper carries `innerId`. The element itself doesn't need either;\n // leaving it would create a duplicate of `originalId` in the materialised tree.\n if (typeof node.id === 'string') delete node.id;\n\n // 2. Split `effects.transformation` between outer (translate, plus origin for\n // auto-orient/motion-path) and inner (rotate / scale, with origin sandwich).\n const { outer: outerTr, inner: innerTr } = splitTransformationEffect(transformation);\n\n // 3. Inner: apply inner transformation around the original element, then wrap\n // in an identity `<g>` with `innerId`. The extra wrapper guarantees the use\n // has a stable target regardless of what parts were present.\n let innerNode: PxNode = node;\n innerNode = applyTransformationEffect(innerNode, innerTr, ctx);\n const innerWrapper: PxNode = { type: 'g', id: innerId, children: [innerNode] };\n\n // 4. Outer: build a `<g>` carrying the lifted body translate, with `innerWrapper`\n // as its child. Then apply outer transformation (translate). Move id to the\n // outermost so whole-element refs still resolve to the full source.\n let outerWrapper: PxNode = { type: 'g', id: originalId, children: [innerWrapper] };\n if (outerBody.transform !== undefined) outerWrapper.transform = outerBody.transform;\n if (outerBody.animate !== undefined) outerWrapper.animate = outerBody.animate;\n if (outerTr) {\n delete outerWrapper.id;\n outerWrapper = applyTransformationEffect(outerWrapper, outerTr, ctx);\n outerWrapper.id = originalId;\n }\n return outerWrapper;\n}\n\n\n////////////////////////////////////////////////////////////////\n//// Body lifting (transform string + animate.transform)\n////////////////////////////////////////////////////////////////\n\ninterface OuterBody {\n transform?: string | { value?: any; keyframes?: Array<any> };\n animate?: { transform: any };\n}\n\n/** Removes translate parts from `node.transform` (string) and from `node.animate.transform`,\n * returning what was extracted (to live on the outer wrapper). When either\n * animate.transform is lifted OR `effects.transformation.translate` will be lifted\n * via the outer wrapper, the body `transform` translate becomes a redundant t=0\n * baseline and is stripped from `node` (otherwise it'd compose on top of the\n * outer's first keyframe / static translate). */\nfunction liftBodyTranslate(node: PxNode, transformation: PxTransformationEffect | undefined): OuterBody {\n const out: OuterBody = {};\n\n // 1. animate.transform — extract translate from every keyframe value.\n // `autoOrient` and `tangentOut`/`tangentIn` are motion-path metadata that\n // belong to translate; they go to the OUTER wrapper with translate, never\n // to the inner one (the inner has rotate/scale only).\n let didLiftAnimate = false;\n const animTr = node.animate?.transform;\n if (animTr && typeof animTr === 'object' && Array.isArray(animTr.keyframes)) {\n const kfs: Array<PxKeyframe<any>> = animTr.keyframes;\n const hasTranslate = kfs.some(kf => kf.value && (kf.value as any).translate);\n if (hasTranslate) {\n const outerHasOrigin = needsOriginOnOuter(animTr);\n const outerKfs = kfs.map(kf => {\n const v = (kf.value || {}) as any;\n const newValue: any = {};\n if (v.translate !== undefined) newValue.translate = v.translate;\n if (outerHasOrigin && v.origin !== undefined) newValue.origin = v.origin;\n const outerKf: any = { value: newValue };\n if (kf.time !== undefined) outerKf.time = kf.time;\n if (kf.easing !== undefined) outerKf.easing = kf.easing;\n if ((kf as any).tangentOut !== undefined) outerKf.tangentOut = (kf as any).tangentOut;\n if ((kf as any).tangentIn !== undefined) outerKf.tangentIn = (kf as any).tangentIn;\n return outerKf;\n });\n const outerAnimTr: any = { keyframes: outerKfs };\n if ((animTr as any).autoOrient) outerAnimTr.autoOrient = true;\n out.animate = { transform: outerAnimTr };\n\n const innerHasPivotedPart = kfs.some(kf => {\n const v = (kf.value || {}) as any;\n return v.rotate !== undefined || v.scale !== undefined;\n });\n const innerKfs = kfs.map(kf => {\n const v = (kf.value || {}) as any;\n const newValue: any = {};\n if (v.rotate !== undefined) newValue.rotate = v.rotate;\n if (v.scale !== undefined) newValue.scale = v.scale;\n // Origin lives on inner kfs whenever rotate/scale need a pivot —\n // matches the editor's separate origin sandwich at the inner layer\n // (even when origin is also on outer for the auto-orient sandwich).\n if (v.origin !== undefined && (!outerHasOrigin || innerHasPivotedPart)) newValue.origin = v.origin;\n // Inner kf intentionally drops tangentOut/tangentIn (translate-only).\n const innerKf: any = { value: newValue };\n if (kf.time !== undefined) innerKf.time = kf.time;\n if (kf.easing !== undefined) innerKf.easing = kf.easing;\n return innerKf;\n });\n const allInnerEmpty = innerKfs.every(kf => Object.keys(kf.value as object).length === 0);\n if (allInnerEmpty) {\n delete (node.animate as any).transform;\n if (node.animate && Object.keys(node.animate).length === 0) delete node.animate;\n } else {\n // Inner animate keeps non-translate kfs; autoOrient flag is intentionally dropped.\n (node.animate as any).transform = { keyframes: innerKfs };\n }\n didLiftAnimate = true;\n }\n }\n\n // 2. Body `transform` — only the string form carries baked translates. Object\n // forms ({value}/{keyframes}) come from the writer's transformation-effect\n // path and are handled via `effects.transformation`, not the body.\n const transformationHasTranslate = transformation?.translate !== undefined;\n const stripBodyTranslateOnly = didLiftAnimate || transformationHasTranslate;\n if (typeof node.transform === 'string') {\n const split = splitTransformString(node.transform);\n if (stripBodyTranslateOnly) {\n // Outer wrapper will carry the translate (via animate.transform or\n // effects.transformation); the body string is just a t=0 baseline.\n // Strip body translates so they don't double-up.\n if (split.translate !== undefined) {\n if (split.rest) node.transform = split.rest;\n else delete node.transform;\n } else if (isPureTranslateBody(node.transform)) {\n // Body is a single `matrix(...)` representing pure translate — same\n // redundancy as a `translate(...)` string. Wipe.\n delete node.transform;\n }\n } else if (split.translate) {\n out.transform = split.translate;\n if (split.rest) node.transform = split.rest;\n else delete node.transform;\n }\n }\n\n return out;\n}\n\n/** True when the body transform is a single op equivalent to pure translate\n * (either `translate(...)` or a `matrix(1,0,0,1,e,f)`). Used to decide whether\n * to wipe the body when `animate.transform.translate` has already been lifted. */\nfunction isPureTranslateBody(s: string): boolean {\n const re = /(translate|rotate|scale|matrix|skewX|skewY)\\(([^)]*)\\)/g;\n const ops: Array<{ name: string; full: string }> = [];\n let m: RegExpExecArray | null;\n while ((m = re.exec(s))) ops.push({ name: m[1], full: m[0] });\n if (ops.length !== 1) return false;\n if (ops[0].name === 'translate') return true;\n if (ops[0].name !== 'matrix') return false;\n const args = /matrix\\(([^)]*)\\)/.exec(ops[0].full);\n if (!args) return false;\n const nums = args[1].split(/[\\s,]+/).filter(Boolean).map(Number);\n return nums.length >= 4 && nums[0] === 1 && nums[1] === 0 && nums[2] === 0 && nums[3] === 1;\n}\n\n/**\n * Body-string lift heuristic. The body `transform=\"\"` is the t=0 baseline that\n * the WRITER bakes in the canonical order `translate · +origin · rotate · scale · -origin`.\n *\n * Lift LEADING `translate(...)` ops ONLY when the string does NOT end with a\n * `translate(...)`. A trailing translate is the `-origin` half of an origin\n * sandwich — leaving any translate inside the sandwich would break the pivot,\n * so we leave the whole body alone in that case (the corresponding\n * `effects.transformation` is the structured source we lift from instead).\n *\n * (`matrix(...)` and `skewX/Y` are not lifted — they don't carry \"user\n * translate\" semantics. If the leading op isn't `translate`, nothing is lifted.)\n */\nfunction splitTransformString(s: string): { translate?: string; rest?: string } {\n const ops: Array<{ name: string; full: string }> = [];\n const re = /(translate|rotate|scale|matrix|skewX|skewY)\\(([^)]*)\\)/g;\n let m: RegExpExecArray | null;\n while ((m = re.exec(s))) ops.push({ name: m[1], full: m[0] });\n\n if (!ops.length) return { rest: s || undefined };\n\n // All-translate string — no origin-sandwich without rotate/scale in the\n // middle. Lift everything.\n if (ops.every(o => o.name === 'translate')) {\n return { translate: ops.map(o => o.full).join('') };\n }\n\n const leading = ops[0];\n const trailing = ops[ops.length - 1];\n\n // Origin sandwich: writer's canonical order is `translate · +origin ·\n // rotate · scale · -origin`, with `translate + +origin` typically FUSED\n // into one leading translate. We can recover the user-translate by reading\n // the trailing `-origin` value and subtracting `+origin` from the leading.\n if (trailing.name === 'translate' && leading.name === 'translate') {\n const trailingVec = parseTranslateArgs(trailing.full);\n const leadingVec = parseTranslateArgs(leading.full);\n const ox = -trailingVec[0]; // -origin → +origin\n const oy = -trailingVec[1];\n const userTx = leadingVec[0] - ox;\n const userTy = leadingVec[1] - oy;\n\n // Pure origin sandwich (user-translate cancels to 0) — leave the body alone.\n if (userTx === 0 && userTy === 0) return { rest: s };\n\n // Replace the leading translate with the bare `+origin` (=ox,oy), keep\n // the rest of the sandwich unchanged, and lift `translate(userT)`.\n const middleAndTrailing = 'translate(' + ox + ',' + oy + ')' + ops.slice(1).map(o => o.full).join('');\n return { translate: 'translate(' + userTx + ',' + userTy + ')', rest: middleAndTrailing };\n }\n\n // Trailing translate without a matching leading translate — unusual. Be\n // conservative and don't lift.\n if (trailing.name === 'translate') return { rest: s };\n\n // No trailing translate → no origin sandwich; lift all leading translates.\n const lifted: Array<string> = [];\n let i = 0;\n while (i < ops.length && ops[i].name === 'translate') {\n lifted.push(ops[i].full);\n i++;\n }\n if (!lifted.length) return { rest: s };\n\n const rest = ops.slice(i).map(o => o.full).join('');\n return {\n translate: lifted.join(''),\n rest: rest || undefined,\n };\n}\n\nfunction parseTranslateArgs(translateOp: string): [number, number] {\n const m = /translate\\(([^)]*)\\)/.exec(translateOp);\n if (!m) return [0, 0];\n const nums = m[1].split(/[\\s,]+/).filter(Boolean).map(Number);\n return [nums[0] || 0, nums[1] || 0];\n}\n\n\n////////////////////////////////////////////////////////////////\n//// effects.transformation split\n////////////////////////////////////////////////////////////////\n\nfunction splitTransformationEffect(fx: PxTransformationEffect | undefined): {\n outer?: PxTransformationEffect;\n inner?: PxTransformationEffect;\n} {\n if (!fx) return {};\n const originOnOuter = needsOriginOnOuter(fx.translate);\n const innerHasPivotedPart = fx.rotate !== undefined || fx.scale !== undefined;\n\n const outer: PxTransformationEffect = {};\n const inner: PxTransformationEffect = {};\n\n if (fx.translate !== undefined) outer.translate = fx.translate;\n // Origin lives on outer when translate carries auto-orient (so the\n // path-tangent rotation pivots around origin too).\n if (originOnOuter && fx.origin !== undefined) outer.origin = fx.origin;\n\n if (fx.rotate !== undefined) inner.rotate = fx.rotate;\n if (fx.scale !== undefined) inner.scale = fx.scale;\n if (fx.skew !== undefined) inner.skew = fx.skew;\n // Origin also lives on inner whenever rotate/scale need a pivot — duplicate\n // origin across outer + inner is fine, matches editor's two separate origin\n // sandwiches ([+o, t, -o] outer + [+o, r, s, -o] inner).\n if (fx.origin !== undefined && (!originOnOuter || innerHasPivotedPart)) inner.origin = fx.origin;\n\n return {\n outer: Object.keys(outer).length ? outer : undefined,\n inner: Object.keys(inner).length ? inner : undefined,\n };\n}\n\n\n////////////////////////////////////////////////////////////////\n//// Auto-orient / motion-path detection\n////////////////////////////////////////////////////////////////\n\n/** True when the translate animation produces rotation at the outer level\n * (tangent handles or `autoOrient`) — meaning origin must sit on the outer\n * with translate so the path-tangent rotation pivots around it. */\nfunction needsOriginOnOuter(translateAnim: PxAnimatable<Vec2> | undefined): boolean {\n if (!translateAnim || typeof translateAnim !== 'object') return false;\n const obj = translateAnim as { autoOrient?: boolean; keyframes?: Array<PxKeyframe<Vec2> & { tangentOut?: Vec2; tangentIn?: Vec2 }> };\n if (obj.autoOrient) return true;\n if (Array.isArray(obj.keyframes)) {\n return obj.keyframes.some(kf => kf.tangentOut || kf.tangentIn);\n }\n return false;\n}\n","/*---------------------------------------------------------------------------------------\n * Copyright (c) Pixodesk LTD.\n * Licensed under the MIT License. See the LICENSE file in the project root for details.\n *---------------------------------------------------------------------------------------*/\n\n\n/** Generic, effect-agnostic helpers for the player-effects applier. */\n\nimport type { ApplyContext, PxNode, Vec2 } from './types';\n\n/** Mints a deterministic id for a generated node (`<mask>`, retimed `<symbol>`, …). */\nexport function genId(ctx: ApplyContext, prefix: string): string {\n return '_lw_' + prefix + '_' + (ctx.nextId++);\n}\n\nexport function stripHash(href: any): string | undefined {\n return typeof href === 'string' ? href.replace(/^#/, '') : undefined;\n}\n\n/** Reads the leading `translate(x,y)` from an SVG transform string. */\nexport function readTranslateFromTransform(transform: any): Vec2 | undefined {\n if (typeof transform !== 'string') return undefined;\n const m = transform.match(/translate\\(\\s*(-?[\\d.]+)\\s*,\\s*(-?[\\d.]+)\\s*\\)/);\n return m ? [Number(m[1]), Number(m[2])] : undefined;\n}\n\n/** Records every node carrying an `id` into the lookup map. */\nexport function indexById(node: PxNode, map: Map<string, PxNode>): void {\n if (typeof node.id === 'string') map.set(node.id, node);\n node.children?.forEach(child => indexById(child, map));\n}\n\n/** Inserts generated <defs> nodes at the front of the root's children. */\nexport function spliceDefs(root: PxNode, defs: Array<PxNode>): void {\n if (!defs.length) return;\n const existing = root.children || (root.children = []);\n existing.unshift({ type: 'defs', children: defs });\n}\n\n/** JSON-only deep clone (arrays + plain objects). */\nexport function clone<T>(value: T): T {\n if (value === null || typeof value !== 'object') return value;\n if (Array.isArray(value)) return value.map(clone) as unknown as T;\n const out: { [k: string]: any } = {};\n for (const k of Object.keys(value as object)) out[k] = clone((value as any)[k]);\n return out as T;\n}\n\n/**\n * Regenerates every `id` inside `root` (including root itself) using fresh `genId`s,\n * then rewrites internal DOM refs (`href=\"#oldId\"` and `url(#oldId)` inside string\n * attrs) to the new ids. References that point OUTSIDE the cloned subtree are left\n * untouched. `meta.*` is intentionally skipped — by the time retime runs in the\n * player, materialisation has already absorbed meta-driven structure.\n *\n * Returns the old→new id map so callers can rewrite their own outward-facing\n * references (e.g. a `<use>` href to the cloned subtree root).\n */\nexport function regenerateIdsInClone(root: PxNode, ctx: ApplyContext): Map<string, string> {\n const oldToNew = new Map<string, string>();\n\n const walkAssign = (n: PxNode): void => {\n if (typeof n.id === 'string') {\n const newId = genId(ctx, 'retimed');\n oldToNew.set(n.id, newId);\n n.id = newId;\n }\n n.children?.forEach(walkAssign);\n };\n walkAssign(root);\n\n const rewriteUrl = (s: string): string => s.replace(/url\\(#([^)]+)\\)/g, (m, oldId) => {\n const newId = oldToNew.get(oldId);\n return newId ? 'url(#' + newId + ')' : m;\n });\n\n const walkRewrite = (n: PxNode): void => {\n if (typeof n.href === 'string' && n.href.startsWith('#')) {\n const newId = oldToNew.get(n.href.slice(1));\n if (newId) n.href = '#' + newId;\n }\n for (const k of Object.keys(n)) {\n if (k === 'children' || k === 'effects' || k === 'meta' || k === 'href' || k === 'id') continue;\n const v = n[k];\n if (typeof v === 'string' && v.indexOf('url(#') !== -1) n[k] = rewriteUrl(v);\n }\n n.children?.forEach(walkRewrite);\n };\n walkRewrite(root);\n\n return oldToNew;\n}\n","/*---------------------------------------------------------------------------------------\n * Copyright (c) Pixodesk LTD.\n * Licensed under the MIT License. See the LICENSE file in the project root for details.\n *---------------------------------------------------------------------------------------*/\n\n\nimport { partsRecord, readAnimatable, readStaticOrigin, keyframeWith } from './transformParts';\nimport type { ApplyContext, PxAnimatable, PxMaskedByEffect, PxNode, PxTransformationEffect, Vec2 } from './types';\nimport { genId } from './util';\n\n\n/**\n * MASKED-BY → a `<mask>` in defs holding the source `<use>` wrapped in the\n * INVERSE of the masked element's transform, plus `mask=\"url(#…)\"` on the element.\n *\n * The mask source lives in root space; wrapping it in the inverse transform keeps\n * it aligned under the (possibly animated) target. Inverse = negate translate /\n * rotate, invert scale, with the wrapper nesting reversed.\n */\nexport function applyMaskedByEffect(\n node: PxNode, fx: PxMaskedByEffect | undefined, transformation: PxTransformationEffect | undefined, ctx: ApplyContext\n): PxNode {\n if (!fx) return node;\n if (!fx.href) { ctx.errors.push('maskedBy.href missing — cannot build mask'); return node; }\n\n const maskId = genId(ctx, 'mask');\n\n let content: PxNode = { type: 'use', href: '#' + fx.href };\n content = wrapInverseTransform(content, transformation, ctx);\n\n const mask: PxNode = { type: 'mask', id: maskId, children: [content] };\n if (fx.maskType) mask.maskType = fx.maskType;\n if (fx.maskUnits) mask.maskUnits = fx.maskUnits;\n if (fx.maskContentUnits) mask.maskContentUnits = fx.maskContentUnits;\n ctx.defs.push(mask);\n\n node.mask = 'url(#' + maskId + ')';\n return node;\n}\n\n/** Wraps `inner` in inverse-transform `<g>`s: translate(innermost) → rotate → scale(outermost). */\nfunction wrapInverseTransform(inner: PxNode, fx: PxTransformationEffect | undefined, ctx: ApplyContext): PxNode {\n if (!fx) return inner;\n const origin = readStaticOrigin(fx.origin, ctx);\n\n let n = inner;\n n = wrapInversePart(n, 'translate', fx.translate, undefined, ctx);\n n = wrapInversePart(n, 'rotate', fx.rotate, origin, ctx);\n n = wrapInversePart(n, 'scale', fx.scale, origin, ctx);\n return n;\n}\n\nfunction wrapInversePart(\n inner: PxNode, part: 'translate' | 'rotate' | 'scale',\n raw: PxAnimatable<any> | undefined, origin: Vec2 | undefined, ctx: ApplyContext\n): PxNode {\n if (raw === undefined) return inner;\n const v = readAnimatable<any>(raw);\n if (v.kind === 'static') {\n return { type: 'g', transform: { value: partsRecord(part, invertPartValue(part, v.value), origin) }, children: [inner] };\n }\n if (v.kind === 'animated') {\n return {\n type: 'g',\n animate: { transform: { keyframes: v.keyframes.map(kf => keyframeWith(kf, partsRecord(part, invertPartValue(part, kf.value), origin))) } },\n children: [inner],\n };\n }\n return inner;\n}\n\nfunction invertPartValue(part: 'translate' | 'rotate' | 'scale', value: any): any {\n if (part === 'translate') return [-value[0], -value[1]];\n if (part === 'rotate') return -value;\n return [1 / value[0], 1 / value[1]]; // scale\n}\n","/*---------------------------------------------------------------------------------------\n * Copyright (c) Pixodesk LTD.\n * Licensed under the MIT License. See the LICENSE file in the project root for details.\n *---------------------------------------------------------------------------------------*/\n\n\n/**\n * REF + TRANSFORMATION (combined) — mirrors the editor's\n * `SvgTransformElementEffectRenderer.renderElementWrapper`. The use's `href`\n * is set BEFORE `applyTransformationEffect` wraps the node so it lands on the\n * actual `<use>` rather than on an outer `<g>` wrapper.\n *\n * For `ref:{type:'content'}` the source is materialised as multi-layer by\n * `splitForContentRef` (see `contentRefSplit.ts`), and the use's `href` is\n * rewritten to point at the inner (no-translate) layer's id. No translate\n * cancellation is needed on the use side any more.\n */\n\nimport { applyTransformationEffect } from './transformationEffect';\nimport type { ApplyContext, PxNode, PxRefEffect, PxTransformationEffect } from './types';\n\nconst CONTENT_SUBREF = 'content';\n\nexport function applyRefAndTransformationEffect(\n node: PxNode,\n ref: PxRefEffect | undefined,\n transformation: PxTransformationEffect | undefined,\n ctx: ApplyContext,\n): PxNode {\n if (ref) {\n const baseId = ref.baseId;\n if (!baseId) {\n ctx.errors.push('ref: missing baseId');\n } else {\n // For content-ref, redirect href to the inner-layer id produced by\n // `splitForContentRef`. For whole-element ref (or when no split has\n // happened, e.g. target not in the tree), fall back to baseId.\n const targetId = ref.type === CONTENT_SUBREF\n ? (ctx.contentRefInnerIds.get(baseId) || baseId)\n : baseId;\n node.href = '#' + targetId;\n }\n }\n return applyTransformationEffect(node, transformation, ctx);\n}\n","/*---------------------------------------------------------------------------------------\n * Copyright (c) Pixodesk LTD.\n * Licensed under the MIT License. See the LICENSE file in the project root for details.\n *---------------------------------------------------------------------------------------*/\n\n\nimport type { ApplyContext, PxNode, PxRepeaterEffect, Vec2 } from './types';\nimport { clone } from './util';\n\n\n/**\n * REPEATER → N clones inside a `<g>` wrapper, each offset by a per-copy\n * translate/rotate/scale increment.\n */\nexport function applyRepeaterEffect(node: PxNode, fx: PxRepeaterEffect | undefined, ctx: ApplyContext): PxNode {\n if (!fx) return node;\n\n const copies = fx.copies ?? 1;\n if (copies < 1) { ctx.errors.push('repeater.copies invalid: ' + fx.copies); return node; }\n\n // The base element's SHARED transform (static baseline + any animation) is\n // lifted onto the wrapper so the per-copy increments compose in the wrapper's\n // coordinate space. Non-transform animations (opacity, fill) stay per copy.\n const sharedTransform = node.transform;\n const sharedAnimTransform = node.animate?.transform;\n\n const base = clone(node);\n delete base.transform;\n if (base.animate) {\n delete base.animate.transform;\n if (Object.keys(base.animate).length === 0) delete base.animate;\n }\n\n const children: Array<PxNode> = [base];\n for (let i = 1; i < copies; i++) {\n const copy = clone(base);\n copy.transform = { value: perCopyParts(fx, i) };\n children.push(copy);\n }\n\n const wrapper: PxNode = { type: 'g', children };\n if (sharedTransform !== undefined) wrapper.transform = sharedTransform;\n if (sharedAnimTransform !== undefined) wrapper.animate = { transform: sharedAnimTransform };\n return wrapper;\n}\n\n/** Transform parts for copy `i`: translate×i, rotate×i, scale^i (percent), origin×i. */\nfunction perCopyParts(fx: PxRepeaterEffect, i: number) {\n const parts: { translate?: Vec2; rotate?: number; scale?: Vec2; origin?: Vec2 } = {};\n if (fx.translate) parts.translate = [fx.translate[0] * i, fx.translate[1] * i];\n if (fx.rotate !== undefined) parts.rotate = fx.rotate * i;\n if (fx.scale) parts.scale = [(fx.scale[0] / 100) ** i, (fx.scale[1] / 100) ** i];\n if (fx.origin) parts.origin = [fx.origin[0] * i, fx.origin[1] * i];\n return parts;\n}\n","/*---------------------------------------------------------------------------------------\n * Copyright (c) Pixodesk LTD.\n * Licensed under the MIT License. See the LICENSE file in the project root for details.\n *---------------------------------------------------------------------------------------*/\n\n\n/**\n * RETIME (`<use>` timeline remap) → clone the source named by `retime.baseId`,\n * remap every keyframe time (`t' = start + t·stretch`, in ms), and either:\n * - (a) `RETIME_AS_SYMBOL=true` — emit the clone as a `<symbol>` in defs and point\n * the `<use>` at it (mirrors the editor's heavy materialisation), or\n * - (b) `RETIME_AS_SYMBOL=false` — replace the `<use>` with a `<g>` that copies the\n * use's own attrs (x/y → translate, transform, animate, …) and holds the\n * cloned content inline.\n *\n * Both share the clone + keyframe-remap core; only the wrapping differs.\n */\n\nimport type { ApplyContext, PxNode, PxRetimeEffect } from './types';\nimport { clone, genId, regenerateIdsInClone } from './util';\n\nconst RETIME_AS_SYMBOL = true;\n\nexport function applyRetimeEffect(node: PxNode, retime: PxRetimeEffect | undefined, ctx: ApplyContext): PxNode {\n if (!retime) return node;\n\n const baseId = retime.baseId;\n if (!baseId) { ctx.errors.push('retime: missing baseId'); return node; }\n\n const target = ctx.idMap.get(baseId);\n if (!target) { ctx.warnings.push('retime: target \"' + baseId + '\" not found'); return node; }\n\n const start = retime.start ?? 0;\n const stretch = retime.stretch ?? 1;\n\n if (RETIME_AS_SYMBOL) {\n const symbolClone = clone(target);\n regenerateIdsInClone(symbolClone, ctx); // fresh ids inside + internal href/url rewrites\n const cloneId = genId(ctx, 'retime');\n symbolClone.id = cloneId; // root id is the one we href to\n remapKeyframeTimes(symbolClone, start, stretch);\n ctx.defs.push(symbolClone);\n node.href = '#' + cloneId;\n return node;\n }\n\n // Inline replace: a <g> carrying the use's own attrs, holding the cloned content.\n // `<use href=#symbol>` renders the symbol's CHILDREN; `<use href=#element>` renders\n // a clone of the element itself.\n const sourceNodes = target.type === 'symbol' ? (target.children || []) : [target];\n const content = sourceNodes.map(child => {\n const c = clone(child);\n regenerateIdsInClone(c, ctx); // fresh ids inside + internal href/url rewrites\n remapKeyframeTimes(c, start, stretch);\n return c;\n });\n\n const g: PxNode = { ...node, type: 'g', children: content };\n delete g.href;\n\n // The use's x/y offset becomes a translate on the <g>.\n const x = Number(node.x ?? 0), y = Number(node.y ?? 0);\n if (x || y) {\n const offset = 'translate(' + x + ',' + y + ')';\n g.transform = typeof g.transform === 'string' ? offset + g.transform : offset;\n delete g.x; delete g.y;\n }\n return g;\n}\n\n/** Remaps every keyframe `time` in the subtree: `t' = start + t·stretch`. */\nfunction remapKeyframeTimes(node: PxNode, start: number, stretch: number): void {\n const remap = (kfs: Array<any>) => {\n for (const kf of kfs) if (typeof kf.time === 'number') kf.time = start + kf.time * stretch;\n };\n\n if (node.transform && typeof node.transform === 'object' && Array.isArray(node.transform.keyframes)) {\n remap(node.transform.keyframes);\n }\n if (node.animate && typeof node.animate === 'object') {\n for (const prop of Object.keys(node.animate)) {\n const anim = node.animate[prop];\n if (anim && Array.isArray(anim.keyframes)) remap(anim.keyframes);\n }\n }\n node.children?.forEach(child => remapKeyframeTimes(child, start, stretch));\n}\n","/*---------------------------------------------------------------------------------------\n * Copyright (c) Pixodesk LTD.\n * Licensed under the MIT License. See the LICENSE file in the project root for details.\n *---------------------------------------------------------------------------------------*/\n\n\nimport type { PxNode } from './types';\n\n\n/**\n * TRIM-PATH / COMBINED-SHAPE → wrap the shape in a `<g>` that keeps the\n * presentation attrs, move the geometry into a `<path>` child, and keep\n * `trimPath` / `isCombinedShape` under `meta.effects`.\n *\n * No dash geometry is computed here — the heavy path doesn't either; the trim\n * stays as meta for the renderer to apply.\n */\nexport function applyTrimPathEffect(node: PxNode, trimPath: object | undefined, isCombinedShape: boolean | undefined): PxNode {\n if (!trimPath && !isCombinedShape) return node;\n\n const d = node.d ?? rectToPathD(node);\n if (d === undefined) return node; // unsupported shape — leave it untouched\n\n const g: PxNode = { ...node, type: 'g' };\n delete g.d;\n\n const meta = (g.meta = { ...(g.meta || {}) });\n const effects = (meta.effects = { ...(meta.effects || {}) });\n if (trimPath) effects.trimPath = trimPath;\n effects.isCombinedShape = true;\n\n g.children = [{ type: 'path', d }];\n return g;\n}\n\n/** Converts a `<rect>` to its outline path `d`; returns undefined for other shapes. */\nfunction rectToPathD(node: PxNode): string | undefined {\n if (node.type !== 'rect') return undefined;\n const x = Number(node.x ?? 0), y = Number(node.y ?? 0);\n const w = Number(node.width ?? 0), h = Number(node.height ?? 0);\n return 'M' + (x + w) + ',' + y + 'L' + (x + w) + ',' + (y + h) + 'L' + x + ',' + (y + h) + 'L' + x + ',' + y + 'L' + (x + w) + ',' + y + 'z';\n}\n","/*---------------------------------------------------------------------------------------\n * Copyright (c) Pixodesk LTD.\n * Licensed under the MIT License. See the LICENSE file in the project root for details.\n *---------------------------------------------------------------------------------------*/\n\n\n/**\n * Lightweight, dependency-free applier for \"player-effects\" SVGA JSON.\n *\n * Input: the JSON produced by `SvgaJsonWithPlayerEffectsSerialisationUtil`, where\n * structure-creating effects are left UN-applied on `node.effects`. This module\n * reads those effects and MATERIALISES them into a plain node tree (extra `<g>`\n * wrappers, copies, mask defs) that renders identically to the heavy editor path.\n *\n * Design goals (intentional): minimal, transparent, no merging/optimisation. It\n * is fine to emit more nodes than strictly necessary — the only contract is \"same\n * result on screen\". Each effect lives in its own file; this module only wires\n * them into the recursion. Nothing here imports outside `effects/`, so the whole\n * folder can move into the Player codebase verbatim.\n */\n\nimport { identifyContentRefTargets, splitForContentRef } from './contentRefSplit';\nimport { applyMaskedByEffect } from './maskedByEffect';\nimport { applyRefAndTransformationEffect } from './refEffect';\nimport { applyRepeaterEffect } from './repeaterEffect';\nimport { applyRetimeEffect } from './retimeEffect';\nimport { applyTrimPathEffect } from './trimPathEffect';\nimport type { ApplyContext, ApplyResult, PxNode } from './types';\nimport { clone, genId, indexById, spliceDefs } from './util';\n\nexport type { ApplyResult, PxNode } from './types';\n\n\n/**\n * Applies all player-effects in `root` and returns a materialised copy plus any\n * generated <defs> nodes, warnings and errors. `root` is not mutated.\n *\n * Two passes:\n * 1. `applyPlayerEffects_exceptRetime` — materialises every effect except retime.\n * 2. `applyPlayerEffects_retime` — applies retime, cloning the NOW-materialised\n * subtrees so retimed `<use>`s see the same wrappers/animations the heavy\n * editor path would produce.\n *\n * Pre-pass identifies every element that is the target of a `<use>` with\n * `ref:{type:'content'}` and allocates a fresh \"inner\" id for it; pass 1 then\n * splits those sources into outer-translate + inner-content layers so the use\n * can target the inner layer (mirrors the editor's heavy materialisation).\n */\nexport function applyPlayerEffects(root: PxNode): ApplyResult {\n const ctx: ApplyContext = {\n defs: [], warnings: [], errors: [],\n idMap: new Map(), nextId: 0,\n contentRefInnerIds: new Map(),\n };\n\n const working = clone(root);\n indexById(working, ctx.idMap);\n identifyContentRefTargets(working, ctx, () => genId(ctx, 'inner'));\n\n const afterPass1 = applyPlayerEffects_exceptRetime(working, ctx);\n const out = applyPlayerEffects_retime(afterPass1, ctx);\n spliceDefs(out, ctx.defs);\n\n return { root: out, defs: ctx.defs, warnings: ctx.warnings, errors: ctx.errors };\n}\n\n/**\n * Pass 1 — materialise every effect except retime. Retime is preserved on the\n * original (now wrapped-inner) node so pass 2 can find and apply it.\n *\n * After wrapping, the outer-most wrapper for a node with `originalId` is written\n * back into `ctx.idMap` so retime's clone target picks up the FULL materialised\n * subtree, not the bare un-wrapped original.\n *\n * If the node is a content-ref target, `splitForContentRef` re-shapes the\n * materialised result into outer-translate + inner-rest layers — the outer keeps\n * the original id, the inner gets the pre-allocated inner id so the `<use>` can\n * target it.\n */\nfunction applyPlayerEffects_exceptRetime(node: PxNode, ctx: ApplyContext): PxNode {\n if (node.children) node.children = node.children.map(child => applyPlayerEffects_exceptRetime(child, ctx));\n\n const fx = node.effects;\n const originalId = typeof node.id === 'string' ? node.id : undefined;\n const innerIdForContentRef = originalId ? ctx.contentRefInnerIds.get(originalId) : undefined;\n\n if (!fx && !innerIdForContentRef) return node;\n\n const { transformation, repeater, maskedBy, trimPath, retime, ref } = fx ?? {};\n const isCombinedShape = fx?.isCombinedShape;\n if (fx) delete node.effects;\n\n let n = node;\n n = applyTrimPathEffect(n, trimPath, isCombinedShape); // innermost\n n = applyRepeaterEffect(n, repeater, ctx);\n n = applyMaskedByEffect(n, maskedBy, transformation, ctx); // mask sits on inner element\n\n if (innerIdForContentRef) {\n // Source of a content-ref `<use>`: split into outer-translate + inner-rest +\n // bare element so the use can target the inner layer.\n n = splitForContentRef(n, transformation, originalId!, innerIdForContentRef, ctx);\n } else {\n n = applyRefAndTransformationEffect(n, ref, transformation, ctx);\n }\n\n if (retime) node.effects = { retime }; // hand off to pass 2\n if (originalId) ctx.idMap.set(originalId, n); // outer wrapper is the clone target\n return n;\n}\n\n/** Pass 2 — apply retime to every node that carries it. */\nfunction applyPlayerEffects_retime(node: PxNode, ctx: ApplyContext): PxNode {\n if (node.children) node.children = node.children.map(child => applyPlayerEffects_retime(child, ctx));\n\n const retime = node.effects?.retime;\n if (!retime) return node;\n delete node.effects;\n return applyRetimeEffect(node, retime, ctx);\n}\n","/*---------------------------------------------------------------------------------------\n * Copyright (c) Pixodesk LTD.\n * Licensed under the MIT License. See the LICENSE file in the project root for details.\n *---------------------------------------------------------------------------------------*/\n\n/**\n * Lightweight Zod-like schema system — type declaration + runtime sanitization.\n *\n * Two operations per schema:\n * isValid(raw) — true only when raw already conforms; no repair needed.\n * sanitize(raw) — always returns T; fixes or replaces invalid input with defaults.\n *\n * Field rules inside px.object():\n * required field → if absent/invalid, field's declared default is used.\n * optional field → if absent/invalid (or wrong JS type), field becomes undefined.\n *\n * Array: items that cannot even be attempted are filtered out.\n * Record: values that cannot even be attempted are dropped.\n *\n * The distinction between isValid and _canSanitize:\n * isValid — strict; ALL fields must be correct, no repairs accepted.\n * _canSanitize — permissive; \"is the JS type right enough to attempt repair?\"\n * For containers (object/array/record) this is a structural check\n * so that partially-valid nested objects are sanitized rather than dropped.\n * For primitives it equals isValid (a wrong primitive type is unrecoverable).\n *\n * Validation context (optional):\n * Pass a PxValidationContext as the second arg to isValid() to collect per-field\n * error and warning messages with their dot-paths.\n * e.g. schema.isValid(raw, ctx, []) where ctx = { errors: [], warnings: [] }\n * Path segments are pushed/popped during recursion; join with '.' only when reporting.\n */\n\n// ─────────────────────────────────────────────────────────────────────────────\n// Public interfaces\n// ─────────────────────────────────────────────────────────────────────────────\n\n/** Collects structured validation feedback. Pass to isValid() as the second argument. */\nexport interface PxValidationContext {\n /** Per-field errors — each entry is \"<dot.path>: <reason>\". */\n errors: Array<string>;\n /** Per-field warnings — same format as errors but non-fatal. */\n warnings: Array<string>;\n /**\n * When true, closed objects (`px.object` / `px.extendedObject`) report any\n * extra (undeclared) keys as errors. Default `false` (or omitted) — extras\n * are ignored, matching `sanitize`'s strip-extras behaviour, which is what\n * production app code wants (forward-compat with unknown future fields).\n * Tests that want to lock the wire shape down to its declared schema\n * should pass `strict: true`.\n *\n * Open objects (`px.openObject`) are unaffected by `strict` — they accept\n * extras by design (used for SVG element nodes that carry arbitrary attrs).\n */\n strict?: boolean;\n}\n\nexport interface PxSchema<T, IsOptional extends boolean = false> {\n /** Phantom discriminator — `false` for required schemas, `true` for optional. Used by InferShape. */\n readonly _optional: IsOptional;\n sanitize(raw: unknown): T;\n /**\n * Returns true when raw already conforms to this schema.\n * Pass an optional PxValidationContext to collect per-field error messages.\n * Pass a mutable Array<string> as `path` — segments are pushed/popped during\n * recursion so only a single array allocation is needed per validation call.\n */\n isValid(raw: unknown, ctx?: PxValidationContext, path?: Array<string>): boolean;\n /** True if raw has the right structure to attempt sanitization (may still need repair). */\n _canSanitize(raw: unknown): boolean;\n readonly _default: T;\n /** Returns a new schema that marks this field as optional (?: in object shapes). */\n optional(): PxSchema<T | undefined, true>;\n}\n\n/** Extract the TypeScript type from a schema. */\nexport type PxInfer<S> = S extends PxSchema<infer T, any> ? T : never;\n\n/**\n * Removes string/number index signatures from T, leaving only explicitly named properties.\n * Useful for strict property-access checking on types that have an open `[key: string]: any`.\n *\n * @example\n * type Strict = RemoveIndex<PxAnimatedSvgDocument>;\n * Strict['animator'] // PxAnimatorConfig | undefined ✓\n * Strict['anything'] // compile error ✓\n */\nexport type RemoveIndex<T> = {\n [K in keyof T as string extends K ? never : number extends K ? never : K]: T[K]\n};\n\n\n// ─────────────────────────────────────────────────────────────────────────────\n// Internal path helper\n// ─────────────────────────────────────────────────────────────────────────────\n\n// Joins path segments into a dot-path string for error messages.\n// Segments starting with '[' are appended without a leading dot.\n// e.g. ['obj', 'key'] -> 'obj.key' ['arr', '[0]'] -> 'arr[0]' [] -> '.'\nfunction pathStr(path: Array<string>): string {\n if (!path.length) return '.';\n let result = '';\n for (const seg of path) {\n if (seg.startsWith('[')) result += seg;\n else result += (result ? '.' : '') + seg;\n }\n return result;\n}\n\n\n// ─────────────────────────────────────────────────────────────────────────────\n// Base — default _canSanitize = isValid (correct for primitives)\n// ─────────────────────────────────────────────────────────────────────────────\n\n/** Shared base; overrides _canSanitize only when the structural check must differ from isValid. */\nabstract class Base<T, IsOptional extends boolean = false> implements PxSchema<T, IsOptional> {\n // `declare` emits no runtime code; purely satisfies the interface's phantom _optional property.\n declare readonly _optional: IsOptional;\n abstract sanitize(raw: unknown): T;\n abstract isValid(raw: unknown, ctx?: PxValidationContext, path?: Array<string>): boolean;\n abstract readonly _default: T;\n\n _canSanitize(raw: unknown): boolean { return this.isValid(raw); }\n\n optional(): PxSchema<T | undefined, true> { return new Optional(this); }\n}\n\n\n// ─────────────────────────────────────────────────────────────────────────────\n// Optional wrapper\n// Uses _canSanitize (not isValid) so that partially-valid nested objects are\n// repaired rather than dropped entirely.\n// ─────────────────────────────────────────────────────────────────────────────\n\n/**\n * Wraps any schema to make its value optional.\n * sanitize uses _canSanitize (not isValid) so partially-valid objects are repaired, not dropped.\n */\nclass Optional<T> extends Base<T | undefined, true> {\n readonly _default = undefined as T | undefined;\n constructor(private readonly inner: PxSchema<T, any>) { super(); }\n\n sanitize(raw: unknown): T | undefined {\n if (raw === undefined || raw === null) return undefined;\n return this.inner._canSanitize(raw) ? this.inner.sanitize(raw) : undefined;\n }\n\n isValid(raw: unknown, ctx?: PxValidationContext, path?: Array<string>): boolean {\n if (raw === undefined || raw === null) return true;\n return this.inner.isValid(raw, ctx, path);\n }\n\n override _canSanitize(raw: unknown): boolean {\n return raw === undefined || raw === null || this.inner._canSanitize(raw);\n }\n}\n\n\n// ─────────────────────────────────────────────────────────────────────────────\n// Primitives — _canSanitize = isValid (a wrong primitive type is unrecoverable)\n// ─────────────────────────────────────────────────────────────────────────────\n\n/** String schema; wrong type is unrecoverable so _canSanitize = isValid (inherited default). */\nclass Str extends Base<string> {\n constructor(readonly _default: string = '') { super(); }\n sanitize(raw: unknown): string { return typeof raw === 'string' ? raw : this._default; }\n isValid(raw: unknown, ctx?: PxValidationContext, path?: Array<string>): boolean {\n if (typeof raw === 'string') return true;\n ctx?.errors.push(pathStr(path ?? []) + ': expected string, got ' + typeof raw);\n return false;\n }\n}\n\n/** Finite-number schema; rejects NaN and ±Infinity as unrecoverable. */\nclass Num extends Base<number> {\n constructor(readonly _default: number = 0) { super(); }\n sanitize(raw: unknown): number {\n return typeof raw === 'number' && isFinite(raw) ? raw : this._default;\n }\n isValid(raw: unknown, ctx?: PxValidationContext, path?: Array<string>): boolean {\n if (typeof raw === 'number' && isFinite(raw)) return true;\n ctx?.errors.push(pathStr(path ?? []) + ': expected finite number, got ' + JSON.stringify(raw));\n return false;\n }\n}\n\n/** Boolean schema. */\nclass Bool extends Base<boolean> {\n constructor(readonly _default: boolean = false) { super(); }\n sanitize(raw: unknown): boolean { return typeof raw === 'boolean' ? raw : this._default; }\n isValid(raw: unknown, ctx?: PxValidationContext, path?: Array<string>): boolean {\n if (typeof raw === 'boolean') return true;\n ctx?.errors.push(pathStr(path ?? []) + ': expected boolean, got ' + typeof raw);\n return false;\n }\n}\n\n\n// ─────────────────────────────────────────────────────────────────────────────\n// Literal — exact value match; default is the literal itself\n// ─────────────────────────────────────────────────────────────────────────────\n\n/** Matches one exact primitive value; its _default is the value itself. */\nclass Literal<T extends string | number | boolean> extends Base<T> {\n readonly _default: T;\n constructor(private readonly value: T) { super(); this._default = value; }\n sanitize(raw: unknown): T { return raw === this.value ? this.value : this._default; }\n isValid(raw: unknown, ctx?: PxValidationContext, path?: Array<string>): boolean {\n if (raw === this.value) return true;\n ctx?.errors.push(pathStr(path ?? []) + ': expected ' + JSON.stringify(this.value) + ', got ' + JSON.stringify(raw));\n return false;\n }\n}\n\n\n// ─────────────────────────────────────────────────────────────────────────────\n// Enum — union of string/number literals; default is first value\n// ─────────────────────────────────────────────────────────────────────────────\n\n/** Union of string/number literals; _default is the first value unless overridden. */\nclass Enum<T extends string | number> extends Base<T> {\n readonly _default: T;\n constructor(private readonly values: readonly T[], defaultVal?: T) {\n super();\n this._default = defaultVal ?? values[0];\n }\n sanitize(raw: unknown): T { return this.values.includes(raw as T) ? (raw as T) : this._default; }\n isValid(raw: unknown, ctx?: PxValidationContext, path?: Array<string>): boolean {\n if (this.values.includes(raw as T)) return true;\n ctx?.errors.push(pathStr(path ?? []) + ': expected one of ' + this.values.map(v => JSON.stringify(v)).join(' | ') + ', got ' + JSON.stringify(raw));\n return false;\n }\n}\n\n\n// ─────────────────────────────────────────────────────────────────────────────\n// Union — first matching schema wins\n// _canSanitize: true if any member can attempt sanitization\n// ─────────────────────────────────────────────────────────────────────────────\n\n/** Tries member schemas in order; first whose isValid passes wins. sanitize returns _default when none match. */\nclass Union<T> extends Base<T> {\n readonly _default: T;\n constructor(private readonly schemas: ReadonlyArray<PxSchema<T>>, defaultVal?: T) {\n super();\n this._default = defaultVal ?? schemas[0]._default;\n }\n sanitize(raw: unknown): T {\n for (const s of this.schemas) {\n if (s.isValid(raw)) return s.sanitize(raw);\n }\n return this._default;\n }\n isValid(raw: unknown, ctx?: PxValidationContext, path?: Array<string>): boolean {\n // Test members without ctx — avoids spurious errors from non-matching branches.\n if (this.schemas.some(s => s.isValid(raw))) return true;\n ctx?.errors.push(pathStr(path ?? []) + ': no union member matched for value ' + (JSON.stringify(raw) ?? '').slice(0, 60));\n return false;\n }\n override _canSanitize(raw: unknown): boolean { return this.schemas.some(s => s._canSanitize(raw)); }\n}\n\n// Infers the union of all member types from a tuple of schemas\ntype UnionMembers<T extends ReadonlyArray<PxSchema<any, any>>> =\n T extends ReadonlyArray<PxSchema<infer U, any>> ? U : never;\n\n\n// ─────────────────────────────────────────────────────────────────────────────\n// DiscriminatedUnion — routes by a literal key field, not first-match order\n// ─────────────────────────────────────────────────────────────────────────────\n\ntype AnyDiscriminantShape<K extends string> = Record<K, PxSchema<string | number | boolean, any>>;\n\n/**\n * Reads `raw[key]`, finds the member schema whose literal matches that value,\n * then delegates sanitize/isValid to that member. Falls back to the first\n * member for sanitize when no match is found.\n */\nclass DiscriminatedUnion<T> extends Base<T> {\n readonly _default: T;\n private readonly _map: Map<string | number | boolean, PxSchema<T>>;\n\n constructor(\n private readonly _key: string,\n private readonly _schemas: ReadonlyArray<PxSchema<T> & { readonly _shape: AnyDiscriminantShape<string> }>,\n defaultVal?: T\n ) {\n super();\n this._default = defaultVal ?? _schemas[0]._default;\n this._map = new Map();\n for (const s of _schemas) {\n const keySchema = s._shape[_key];\n if (keySchema) this._map.set(keySchema._default, s);\n }\n }\n\n private _findSchema(raw: unknown): PxSchema<T> | undefined {\n if (raw === null || typeof raw !== 'object' || Array.isArray(raw)) return undefined;\n const val = (raw as Record<string, unknown>)[this._key];\n if (val === undefined || val === null) return undefined;\n return this._map.get(val as string | number | boolean);\n }\n\n sanitize(raw: unknown): T {\n return (this._findSchema(raw) ?? this._schemas[0]).sanitize(raw);\n }\n\n isValid(raw: unknown, ctx?: PxValidationContext, path?: Array<string>): boolean {\n const schema = this._findSchema(raw);\n if (!schema) {\n const val = (raw !== null && typeof raw === 'object' && !Array.isArray(raw))\n ? (raw as Record<string, unknown>)[this._key] : undefined;\n ctx?.errors.push(pathStr(path ?? []) + ': no discriminated union member matched '\n + this._key + '=' + JSON.stringify(val));\n return false;\n }\n return schema.isValid(raw, ctx, path);\n }\n\n override _canSanitize(raw: unknown): boolean {\n if (raw === null || typeof raw !== 'object' || Array.isArray(raw)) return false;\n const schema = this._findSchema(raw);\n return schema ? schema._canSanitize(raw) : this._schemas[0]._canSanitize(raw);\n }\n}\n\n\n// ─────────────────────────────────────────────────────────────────────────────\n// Object — strips unknown keys; required fields use default, optional → undefined\n// _canSanitize: true when raw is a plain (non-array) object\n// ─────────────────────────────────────────────────────────────────────────────\n\ntype AnyShape = Record<string, PxSchema<any, any>>;\n\n// Required keys: IsOptional=false → plain property.\n// Optional keys: IsOptional=true → ?:, with Exclude<T,undefined> (?: already adds undefined).\ntype InferShape<S extends AnyShape> =\n { [K in keyof S as S[K] extends PxSchema<any, true> ? never : K]: PxInfer<S[K]> } &\n { [K in keyof S as S[K] extends PxSchema<any, true> ? K : never]?: Exclude<PxInfer<S[K]>, undefined> };\n\n/**\n * Typed object schema; strips unknown keys, repairs required fields via their defaults.\n * _canSanitize checks structure only (non-array object) so partially-valid objects are repaired.\n */\nclass Obj<S extends AnyShape> extends Base<InferShape<S>> {\n readonly _default: InferShape<S>;\n\n constructor(readonly _shape: S) {\n super();\n const d: any = {};\n for (const key of Object.keys(_shape)) d[key] = _shape[key]._default;\n this._default = d;\n }\n\n sanitize(raw: unknown): InferShape<S> {\n const src = (raw && typeof raw === 'object' && !Array.isArray(raw)) ? raw as any : {};\n const out: any = {};\n for (const key of Object.keys(this._shape)) {\n out[key] = this._shape[key].sanitize(src[key]);\n }\n return out;\n }\n\n isValid(raw: unknown, ctx?: PxValidationContext, path?: Array<string>): boolean {\n if (!raw || typeof raw !== 'object' || Array.isArray(raw)) {\n ctx?.errors.push(pathStr(path ?? []) + ': expected object, got ' + (Array.isArray(raw) ? 'array' : typeof raw));\n return false;\n }\n const obj = raw as any;\n const p = path ?? [];\n let ok = true;\n for (const key of Object.keys(this._shape)) {\n p.push(key);\n if (!this._shape[key].isValid(obj[key], ctx, p)) ok = false;\n p.pop();\n }\n // Strict mode: closed objects reject extra (undeclared) keys.\n // Default mode silently ignores them (matching `sanitize`'s strip-extras).\n if (ctx?.strict) {\n for (const key of Object.keys(obj)) {\n if (key in this._shape) continue;\n p.push(key);\n ctx.errors.push(pathStr(p) + ': unexpected extra key');\n p.pop();\n ok = false;\n }\n }\n return ok;\n }\n\n override _canSanitize(raw: unknown): boolean {\n return !!raw && typeof raw === 'object' && !Array.isArray(raw);\n }\n}\n\n\n// ─────────────────────────────────────────────────────────────────────────────\n// OpenObj — like Obj but passes unknown keys through unchanged (or validates/sanitizes\n// them against an optional open-value schema).\n// Known keys are validated/sanitized; unknown keys are passed through as-is when no\n// open schema is given, or validated/sanitized against the open schema when one is provided.\n// Inferred type: InferShape<S> & { [key: string]: V } where V defaults to any.\n// Note: TypeScript intersection semantics mean named-property access on the\n// derived type yields `any` rather than the specific declared type. For\n// type-precise access keep a hand-written interface alongside the schema.\n// ─────────────────────────────────────────────────────────────────────────────\n\ntype InferOpenShape<S extends AnyShape, _V = any> = InferShape<S> & { [key: string]: any };\n\n/**\n * Open object schema; validates/repairs known keys, passes unknown keys through unchanged.\n * Use when the object may carry arbitrary extra properties (e.g. SVG element attributes).\n *\n * @param shape Known key schemas (validated and type-inferred).\n * @param openSchema Optional schema applied to every unknown key's value.\n * When omitted, unknown values are passed through as-is (`any`).\n */\nclass OpenObj<S extends AnyShape, V = any> extends Base<InferOpenShape<S, V>> {\n readonly _default: InferOpenShape<S, V>;\n\n constructor(readonly _shape: S, private readonly _openSchema?: PxSchema<V>) {\n super();\n const d: any = {};\n for (const key of Object.keys(_shape)) d[key] = _shape[key]._default;\n this._default = d;\n }\n\n sanitize(raw: unknown): InferOpenShape<S, V> {\n const src: Record<string, unknown> = (raw && typeof raw === 'object' && !Array.isArray(raw))\n ? raw as Record<string, unknown>\n : {};\n const out: Record<string, unknown> = { ...src };\n for (const key of Object.keys(this._shape)) {\n out[key] = this._shape[key].sanitize(src[key]);\n }\n if (this._openSchema) {\n for (const key of Object.keys(src)) {\n if (!(key in this._shape)) out[key] = this._openSchema.sanitize(src[key]);\n }\n }\n return out as InferOpenShape<S, V>;\n }\n\n isValid(raw: unknown, ctx?: PxValidationContext, path?: Array<string>): boolean {\n if (!raw || typeof raw !== 'object' || Array.isArray(raw)) {\n ctx?.errors.push(pathStr(path ?? []) + ': expected object, got ' + (Array.isArray(raw) ? 'array' : typeof raw));\n return false;\n }\n const obj = raw as any;\n const p = path ?? [];\n let ok = true;\n for (const key of Object.keys(this._shape)) {\n p.push(key);\n if (!this._shape[key].isValid(obj[key], ctx, p)) ok = false;\n p.pop();\n }\n if (this._openSchema) {\n for (const key of Object.keys(obj)) {\n if (key in this._shape) continue;\n p.push(key);\n if (!this._openSchema.isValid(obj[key], ctx, p)) ok = false;\n p.pop();\n }\n }\n return ok;\n }\n\n override _canSanitize(raw: unknown): boolean {\n return !!raw && typeof raw === 'object' && !Array.isArray(raw);\n }\n}\n\n\n// ─────────────────────────────────────────────────────────────────────────────\n// Array — items that cannot be attempted are filtered out; default is []\n// Uses _canSanitize for filtering so partially-valid objects are repaired, not dropped.\n// ─────────────────────────────────────────────────────────────────────────────\n\n/** Array schema; items failing _canSanitize are filtered out rather than blocking the whole array. */\nclass Arr<T> extends Base<Array<T>> {\n readonly _default: Array<T> = [];\n constructor(private readonly item: PxSchema<T>) { super(); }\n\n sanitize(raw: unknown): Array<T> {\n if (!Array.isArray(raw)) return [];\n const out: Array<T> = [];\n for (const el of raw) {\n if (this.item._canSanitize(el)) out.push(this.item.sanitize(el));\n }\n return out;\n }\n\n isValid(raw: unknown, ctx?: PxValidationContext, path?: Array<string>): boolean {\n if (!Array.isArray(raw)) {\n ctx?.errors.push(pathStr(path ?? []) + ': expected array, got ' + typeof raw);\n return false;\n }\n const p = path ?? [];\n let ok = true;\n for (let i = 0; i < raw.length; i++) {\n p.push('[' + i + ']');\n if (!this.item.isValid(raw[i], ctx, p)) ok = false;\n p.pop();\n }\n return ok;\n }\n\n override _canSanitize(raw: unknown): boolean { return Array.isArray(raw); }\n}\n\n\n// ─────────────────────────────────────────────────────────────────────────────\n// Record — invalid values are dropped; default is {}\n// ─────────────────────────────────────────────────────────────────────────────\n\n/** String-keyed record; values failing _canSanitize are dropped rather than blocking the whole record. */\nclass Rec<T> extends Base<Record<string, T>> {\n readonly _default: Record<string, T> = {};\n constructor(private readonly value: PxSchema<T>) { super(); }\n\n sanitize(raw: unknown): Record<string, T> {\n if (!raw || typeof raw !== 'object' || Array.isArray(raw)) return {};\n const out: Record<string, T> = {};\n for (const [k, v] of Object.entries(raw)) {\n if (this.value._canSanitize(v)) out[k] = this.value.sanitize(v);\n }\n return out;\n }\n\n isValid(raw: unknown, ctx?: PxValidationContext, path?: Array<string>): boolean {\n if (!raw || typeof raw !== 'object' || Array.isArray(raw)) {\n ctx?.errors.push(pathStr(path ?? []) + ': expected object/record, got ' + (Array.isArray(raw) ? 'array' : typeof raw));\n return false;\n }\n const p = path ?? [];\n let ok = true;\n for (const [k, v] of Object.entries(raw as object)) {\n p.push(k);\n if (!this.value.isValid(v, ctx, p)) ok = false;\n p.pop();\n }\n return ok;\n }\n\n override _canSanitize(raw: unknown): boolean {\n return !!raw && typeof raw === 'object' && !Array.isArray(raw);\n }\n}\n\n\n// ─────────────────────────────────────────────────────────────────────────────\n// Any — passes raw through unchanged, always valid\n// ─────────────────────────────────────────────────────────────────────────────\n\n/** Passes any value through unchanged; always valid. Useful for opaque blobs with no schema. */\nclass Any extends Base<any> {\n readonly _default: any = undefined;\n sanitize(raw: unknown): any { return raw; }\n isValid(_raw: unknown, _ctx?: PxValidationContext, _path?: Array<string>): boolean { return true; }\n override _canSanitize(_raw: unknown): boolean { return true; }\n}\n\n\n// ─────────────────────────────────────────────────────────────────────────────\n// Lazy — resolves schema on first use, required for recursive types\n// ─────────────────────────────────────────────────────────────────────────────\n\n/** Defers schema resolution to first use; required to break circular references in recursive types. */\nclass Lazy<T> extends Base<T> {\n private resolved: PxSchema<T> | null = null;\n constructor(private readonly fn: () => PxSchema<T>, readonly _default: T) { super(); }\n\n private get schema(): PxSchema<T> {\n return this.resolved ?? (this.resolved = this.fn());\n }\n\n sanitize(raw: unknown): T { return this.schema.sanitize(raw); }\n isValid(raw: unknown, ctx?: PxValidationContext, path?: Array<string>): boolean { return this.schema.isValid(raw, ctx, path); }\n override _canSanitize(raw: unknown): boolean { return this.schema._canSanitize(raw); }\n}\n\n\n// ─────────────────────────────────────────────────────────────────────────────\n// Tuple — fixed-length array with per-position schemas; default is defaults of each position\n// _canSanitize: true only when raw is an array of the exact expected length\n// ─────────────────────────────────────────────────────────────────────────────\n\n// Maps a tuple of schemas to a tuple of their inferred types.\ntype TupleItems<T extends ReadonlyArray<PxSchema<any, any>>> =\n { -readonly [K in keyof T]: T[K] extends PxSchema<infer U, any> ? U : never };\n\n/** Fixed-length array schema; validates element count and each position individually. */\nclass Tuple<T extends ReadonlyArray<PxSchema<any, any>>> extends Base<TupleItems<T>> {\n readonly _default: TupleItems<T>;\n\n constructor(private readonly schemas: T) {\n super();\n this._default = schemas.map(s => s._default) as unknown as TupleItems<T>;\n }\n\n sanitize(raw: unknown): TupleItems<T> {\n if (!Array.isArray(raw) || raw.length !== this.schemas.length) return this._default;\n return this.schemas.map((s, i) => s.sanitize((raw as unknown[])[i])) as unknown as TupleItems<T>;\n }\n\n isValid(raw: unknown, ctx?: PxValidationContext, path?: Array<string>): boolean {\n if (!Array.isArray(raw) || raw.length !== this.schemas.length) {\n ctx?.errors.push(pathStr(path ?? []) + ': expected tuple of length ' + this.schemas.length + ', got ' + (Array.isArray(raw) ? 'array[' + (raw as unknown[]).length + ']' : typeof raw));\n return false;\n }\n const p = path ?? [];\n let ok = true;\n for (let i = 0; i < this.schemas.length; i++) {\n p.push('[' + i + ']');\n if (!(this.schemas as ReadonlyArray<PxSchema<any, any>>)[i].isValid((raw as unknown[])[i], ctx, p)) ok = false;\n p.pop();\n }\n return ok;\n }\n\n // Require exact length so wrong-length arrays are dropped rather than repaired to default.\n override _canSanitize(raw: unknown): boolean {\n return Array.isArray(raw) && raw.length === this.schemas.length;\n }\n}\n\n\n// ─────────────────────────────────────────────────────────────────────────────\n// implementsInterface — compile-time lock between a schema and an interface\n// ─────────────────────────────────────────────────────────────────────────────\n\n/**\n * Returns a pass-through wrapper that enforces at compile time that the schema's\n * inferred type is structurally assignable to `T`. Catches type mismatches on\n * required fields and value-type mismatches on optional fields.\n *\n * For key-level equality (catching optional field renames), pair with a\n * `KeysMatch` assertion after the inferred type alias:\n * ```ts\n * const _ck: KeysMatch<PxFoo, _PxFoo> = true;\n * ```\n *\n * @example\n * export const PxLoopSchema = implementsInterface<_PxLoop>()(px.object({ ... }));\n */\nexport function implementsInterface<T>() {\n return <S extends PxSchema<T>>(schema: S): S => schema;\n}\n\n/**\n * Evaluates to `true` when A and B have exactly the same set of keys; `false` otherwise.\n * Use with a `const` assertion to get a compile-time error on key renames:\n * ```ts\n * const _ck: KeysMatch<PxFoo, _PxFoo> = true;\n * ```\n */\nexport type KeysMatch<A, B> =\n [Exclude<keyof A, keyof B>] extends [never]\n ? [Exclude<keyof B, keyof A>] extends [never] ? true : false\n : false;\n\n/**\n * Builds a `{ key: 'key', ... }` object from a schema's shape.\n * Each value is typed as the literal key name, so `schemaKeys(PxFooSchema).bar`\n * is typed as `'bar'` — use in @serializable calls to get a compile-time error\n * if the field is renamed in the schema.\n */\nexport function schemaKeys<S extends { readonly _shape: Record<string, any> }>(schema: S) {\n return Object.fromEntries(\n Object.keys(schema['_shape']).map(k => [k, k])\n ) as { [K in keyof S['_shape']]: K };\n}\n\n/**\n * Describes the structural kind of a schema for traversal purposes.\n * Use with `getMissingCoveragePaths` or similar tree-walking utilities.\n *\n * - `shape` — object schema (Obj/OpenObj); `shape` maps key → sub-schema\n * - `array` — array schema; `item` is the element schema\n * - `optional` — optional wrapper; `inner` is the wrapped schema\n * - `lazy` — lazy/recursive schema; `resolved` is the resolved schema (cached)\n * - `leaf` — primitive, union, record, any, tuple — no traversable children\n */\nexport type PxSchemaDesc =\n | { kind: 'shape'; shape: Record<string, PxSchema<any, any>> }\n | { kind: 'array'; item: PxSchema<any, any> }\n | { kind: 'optional'; inner: PxSchema<any, any> }\n | { kind: 'lazy'; resolved: PxSchema<any, any> }\n | { kind: 'leaf' };\n\nexport function describeSchema(schema: PxSchema<any, any>): PxSchemaDesc {\n const s = schema as any;\n if ('_shape' in s) return { kind: 'shape', shape: s._shape };\n if ('item' in s) return { kind: 'array', item: s.item };\n if ('inner' in s) return { kind: 'optional', inner: s.inner };\n if ('fn' in s) return { kind: 'lazy', resolved: s.resolved ?? s.fn() };\n return { kind: 'leaf' };\n}\n\n\n// ─────────────────────────────────────────────────────────────────────────────\n// Public factory\n// ─────────────────────────────────────────────────────────────────────────────\n\nexport const px = {\n /** Matches a string. Default: '' or provided value. */\n string: (defaultVal = ''): PxSchema<string> => new Str(defaultVal),\n\n /** Matches a finite number. Default: 0 or provided value. */\n number: (defaultVal = 0): PxSchema<number> => new Num(defaultVal),\n\n /** Matches a boolean. Default: false or provided value. */\n boolean: (defaultVal = false): PxSchema<boolean> => new Bool(defaultVal),\n\n /** Matches one exact primitive value; its default is the value itself. */\n literal: <T extends string | number | boolean>(value: T): PxSchema<T> =>\n new Literal(value),\n\n /** Matches one of a fixed set of string/number values. Default: first value. */\n enum: <T extends string | number>(values: readonly T[], defaultVal?: T): PxSchema<T> =>\n new Enum(values, defaultVal),\n\n /**\n * Returns the first schema whose isValid passes.\n * TypeScript infers the union of all member types automatically.\n */\n union: <T extends ReadonlyArray<PxSchema<any, any>>>(\n schemas: T,\n defaultVal?: UnionMembers<T>\n ): PxSchema<UnionMembers<T>> =>\n new Union(schemas as any, defaultVal) as any,\n\n /**\n * Discriminated union — reads `raw[key]`, finds the member schema whose\n * literal at `key` matches, then delegates sanitize/isValid to that member.\n * Each member must be an object schema with a `px.literal(...)` at `key`.\n * TypeScript infers the union of all member types automatically.\n */\n discriminatedUnion: <\n K extends string,\n T extends ReadonlyArray<PxSchema<any, any> & { readonly _shape: Record<K, PxSchema<string | number | boolean, any>> }>\n >(key: K, schemas: T): PxSchema<UnionMembers<T>> =>\n new DiscriminatedUnion(key, schemas as any) as any,\n\n /** Typed object — unknown keys are stripped. Required fields fall back to their default. */\n object: <S extends AnyShape>(shape: S): PxSchema<InferShape<S>> & { readonly _shape: S } =>\n new Obj(shape),\n\n /**\n * Open object — validates known keys; passes unknown keys through as-is,\n * or validates/sanitizes them against `openSchema` when provided.\n */\n openObject: <S extends AnyShape, V = any>(\n shape: S,\n openSchema?: PxSchema<V>\n ): PxSchema<InferOpenShape<S, V>> & { readonly _shape: S } =>\n new OpenObj(shape, openSchema) as any,\n\n /**\n * Creates a new closed object schema by merging a base schema's shape with additional fields.\n * The base can be the result of px.object() or px.openObject() — anything with a _shape property.\n *\n * @example\n * const PxSvgNodeSchema = px.extendedObject(PxNodeBase, { width: px.number().optional() });\n */\n extendedObject: <B extends AnyShape, E extends AnyShape>(\n base: { readonly _shape: B },\n extra: E\n ): PxSchema<InferShape<B & E>> & { readonly _shape: B & E } =>\n new Obj({ ...base._shape, ...extra } as B & E),\n\n /** Array whose unrecoverable items are filtered out. Default: []. */\n array: <T>(item: PxSchema<T>): PxSchema<Array<T>> =>\n new Arr(item),\n\n /** String-keyed record whose unrecoverable values are dropped. Default: {}. */\n record: <T>(value: PxSchema<T>): PxSchema<Record<string, T>> =>\n new Rec(value),\n\n /** Passes anything through unchanged — always valid. */\n any: (): PxSchema<any> => new Any(),\n\n /** Fixed-length tuple — validates element count and each position individually. */\n tuple: <T extends ReadonlyArray<PxSchema<any, any>>>(schemas: T): PxSchema<TupleItems<T>> =>\n new Tuple(schemas),\n\n /** Defers schema creation — required for recursive types. Must supply a default value. */\n lazy: <T>(fn: () => PxSchema<T>, defaultVal: T): PxSchema<T> =>\n new Lazy(fn, defaultVal),\n} as const;\n","/*---------------------------------------------------------------------------------------\n * Copyright (c) Pixodesk LTD.\n * Licensed under the MIT License. See the LICENSE file in the project root for details.\n *---------------------------------------------------------------------------------------*/\n\nimport type { KeysMatch, PxInfer, PxSchema, PxValidationContext, RemoveIndex } from './PxSchema';\nimport { implementsInterface, px } from './PxSchema';\n\nexport type FillMode = 'forwards' | 'backwards' | 'both' | 'none';\n\nexport type PlaybackDirection = 'normal' | 'reverse' | 'alternate' | 'alternate-reverse';\n\nexport const PX_ANIM_SRC_ATTR_NAME = 'data-px-animation-src';\n\nexport const PX_ANIM_ATTR_NAME = '_px_animator';\n\nexport type StartOn = 'load' | 'mouseOver' | 'click' | 'scrollIntoView';\n\nexport type OutAction = 'continue' | 'pause' | 'reset' | 'reverse';\n\nexport type JsMode = \"auto\" | \"webapi\" | \"frames\";\n\n\nexport const TEXT_ATTR = 'text';\nexport const TEXT_CONTENT_ATTR = 'textContent';\n\n// Attributes that should not be set on DOM elements (internal use only)\nexport const INTERNAL_ATTRS = new Set([\n 'type', 'children', 'animator', 'meta', 'animate', TEXT_ATTR, TEXT_CONTENT_ATTR\n]);\n\n\n// ============================================================================\n// EASING\n// ============================================================================\n\n/**\n * Easing function definition.\n * Can be a named reference to a predefined easing or a cubic-bezier array [x1, y1, x2, y2].\n *\n * @example \"ease-in\" | [0.68, -0.55, 0.265, 1.55]\n *\n * `string | [x1, y1, x2, y2]`\n */\nexport const PxEasingOrRefSchema = px.union([\n px.string(),\n px.tuple([px.number(), px.number(), px.number(), px.number()] as const),\n]);\n\n/**\n * Easing function definition.\n * Can be a named reference to a predefined easing or a cubic-bezier array [x1, y1, x2, y2].\n *\n * @example \"ease-in\" | \"easeOut\" | [0.68, -0.55, 0.265, 1.55]\n */\nexport type PxEasingOrRef = PxInfer<typeof PxEasingOrRefSchema>;\n\n\n// ============================================================================\n// KEYFRAME\n// ============================================================================\n\n/**\n * A single animation keyframe defining the state at a specific point in time.\n * Supports both full property names and short aliases for compact notation.\n */\nexport interface _PxKeyframe {\n\n /** Timestamp in milliseconds from animation start */\n time?: number;\n\n /** Short alias for \"time\" */\n t?: number;\n\n /** The value of the animated property at this keyframe */\n value?: any;\n\n /** Short alias for \"value\" */\n v?: any;\n\n /** Easing function applied to the interval from this keyframe to the next */\n easing?: PxEasingOrRef;\n\n /** Short alias for \"easing\" */\n e?: PxEasingOrRef;\n\n /**\n * Outgoing spatial tangent `[dx, dy]` for motion-along-path interpolation\n * (translate animations only).\n *\n * Stored as a *delta relative to* this keyframe's translate position —\n * the cubic Bezier segment between this kf and the next is built from\n * `(P0=value, P1=value+tangentOut, P2=next.value+next.tangentIn, P3=next.value)`.\n *\n * Defined when the segment leaving this keyframe is curved.\n */\n tangentOut?: [number, number];\n\n /** Short alias for \"tangentOut\" */\n to?: [number, number];\n\n /**\n * Incoming spatial tangent `[dx, dy]` for motion-along-path interpolation\n * (translate animations only). Delta relative to this keyframe's translate\n * position. See `tangentOut` for the segment construction.\n *\n * Defined when the segment arriving at this keyframe is curved.\n */\n tangentIn?: [number, number];\n\n /** Short alias for \"tangentIn\" */\n ti?: [number, number];\n\n /**\n * Editor-side UI state (whether the keyframe is selected in the timeline).\n * Declared here so strict-mode schema validation accepts it on the wire —\n * the Player ignores it.\n */\n selected?: boolean;\n}\n\n/**\n * Allowed shapes for a single keyframe `value` across the wire schema:\n * - `number` — scalar properties (rotate-degree, opacity, offset-distance, …)\n * - `Array<number>` — vector properties (translate `[x,y]`, scale `[sx,sy]`, stroke-dasharray, RGBA …)\n * - `string` — color (hex / `url(#…)` / named) and other string-valued props\n * - `PxTransformParts` — unified body `transform` parts record\n * `{translate, rotate, scale, origin}`\n * - `{ paths: Array<PxBezierPath> }` — animated SVG path `d` value\n *\n * Used as documentation / explicit-validation entry point; `PxKeyframeSchema`\n * itself stores `value` as `any` to keep downstream interpolator code in\n * `PxDefinitions.ts` working with duck-typed access (`prevV?.paths`,\n * `Array.isArray(prevV)`, …) without per-shape narrowing.\n */\nexport type _PxKeyframeValue =\n | string\n | number\n | Array<number>\n | PxTransformParts\n | { path: string }\n | { paths: Array<PxBezierPath> };\n\n// `string | number | Array<number> | PxTransformParts | { path: string } | { paths: BezierPath[] }`\n//\n// `{ path: \"M…\" }` is the unified single-`d`-string form for animated paths\n// (compound shapes are one string with multiple `M…` sub-paths); `{ paths: […] }`\n// is the legacy bezier-array form, both accepted.\n//\n// `PxTransformPartsSchema` / `PxBezierPathSchema` are declared later in this\n// file — `px.lazy` defers the lookup until validation time so the declarations\n// stay in narrative order without a TDZ at module load.\nexport const PxKeyframeValueSchema = implementsInterface<_PxKeyframeValue>()(px.union([\n px.string(), // e.g. for colors\n px.number(),\n px.array(px.number()),\n px.lazy<PxTransformParts>(() => PxTransformPartsSchema, {}),\n px.object({ path: px.string() }),\n px.lazy<{ paths: Array<PxBezierPath> }>(() => px.object({ paths: px.array(PxBezierPathSchema) }), { paths: [] }),\n]));\n\n/** A single keyframe `value` — union of all wire-allowed shapes. */\nexport type PxKeyframeValue = PxInfer<typeof PxKeyframeValueSchema>;\n\n// `{ time?:number, t?:number, value?:any, v?:any, easing?:Easing, e?:Easing,\n// tangentOut?:[dx,dy], tangentIn?:[dx,dy] }`\n//\n// `value` / `v` are stored as `px.any()` to match the `_PxKeyframe` interface\n// (`value?: any`) and to keep the inferred `PxKeyframe.value` type permissive\n// for the duck-typed access in `PxDefinitions.ts`. The structured value-shape\n// union is still available via {@link PxKeyframeValueSchema} for callers that\n// want to validate or document the allowed shapes.\nexport const PxKeyframeSchema = implementsInterface<_PxKeyframe>()(px.object({\n time: px.number().optional(),\n t: px.number().optional(),\n value: px.any().optional(),\n v: px.any().optional(),\n easing: PxEasingOrRefSchema.optional(),\n e: PxEasingOrRefSchema.optional(),\n tangentOut: px.tuple([px.number(), px.number()] as const).optional(),\n to: px.tuple([px.number(), px.number()] as const).optional(), // short alias\n tangentIn: px.tuple([px.number(), px.number()] as const).optional(),\n ti: px.tuple([px.number(), px.number()] as const).optional(), // short alias\n selected: px.boolean().optional(), // editor-side UI state (Player ignores it)\n}));\n\n/** A single animation keyframe defining the state at a specific point in time. */\nexport type PxKeyframe = PxInfer<typeof PxKeyframeSchema>;\nconst _ck_PxKeyframe: KeysMatch<PxKeyframe, _PxKeyframe> = true; // the key sets are identical\n\n\n// ============================================================================\n// LOOP\n// ============================================================================\n\n/**\n * Defines how a property's keyframe animation is extended beyond its defined keyframe range\n * by continuously repeating a chosen segment of the sequence.\n *\n * The repeated segment is a contiguous run of keyframe *intervals* (gaps between consecutive\n * keyframes). Which end of the sequence is repeated is controlled by `before`, and whether\n * each repetition plays in the same direction or alternates is controlled by `alternate`.\n *\n * **Relationship to `animator.iterations`**\n *\n * `PxLoop` and `animator.iterations` are independent mechanisms operating at different levels:\n *\n * - `PxLoop` is a **pre-processing step**: it expands the property's keyframe list to fill the\n * full `animator.duration` before any playback begins. The runtime sees a single, fully\n * expanded keyframe sequence — it has no knowledge of the loop.\n *\n * - `animator.iterations` repeats the **entire document timeline** (all properties, all\n * elements) as a unit, after the expanded keyframes are already in place.\n *\n * The two compose independently: a property with `loop: true` inside a document with\n * `iterations: \"infinite\"` will cycle its own segment within each document iteration, and\n * that iteration will itself repeat forever — loop-within-loop.\n */\nexport interface _PxLoop {\n\n /**\n * Number of keyframe intervals (gaps between consecutive keyframes) that form the repeating\n * segment.\n *\n * - `undefined` → the entire keyframe sequence is used as the loop segment.\n * - `N` → only the first `N` intervals (when `before: true`) or the last `N` intervals\n * (when `before: false`) are looped. Clamped to `[1, keyframes.length - 1]`.\n */\n segmentCount?: number;\n\n /**\n * Selects which end of the keyframe sequence is looped.\n *\n * - `true` → the source segment is taken from the *start* of the keyframe sequence.\n * The animation is extended *before* the first keyframe — useful for intro loops\n * that run before the main timeline begins.\n *\n * - `false` (default) → the source segment is taken from the *end* of the keyframe sequence.\n * The animation is extended *after* the last keyframe — useful for idle or outro\n * loops that continue once the main timeline has finished.\n */\n before?: boolean;\n\n /**\n * Controls playback direction on each successive loop iteration.\n *\n * - `false` (default) → **cycle**: every iteration replays the segment in the same direction.\n *\n * - `true` → **pingpong**: iterations alternate between forward and backward playback\n * (even iterations play forward, odd iterations play in reverse).\n */\n alternate?: boolean;\n}\n\n// `{ segmentCount?:number, before?:boolean, alternate?:boolean }`\nexport const PxLoopSchema = implementsInterface<_PxLoop>()(px.object({\n segmentCount: px.number().optional(),\n before: px.boolean().optional(),\n alternate: px.boolean().optional(),\n}));\n\n/**\n * Defines how a property's keyframe animation is extended beyond its defined keyframe range\n * by continuously repeating a chosen segment of the sequence.\n */\nexport type PxLoop = PxInfer<typeof PxLoopSchema>;\nconst _ck_PxLoop: KeysMatch<PxLoop, _PxLoop> = true; // the key sets are identical\n\n\n// ============================================================================\n// PROPERTY ANIMATION\n// ============================================================================\n\n/**\n * Animation definition for a single CSS/SVG property.\n * Contains an array of keyframes that define how the property changes over time.\n */\nexport interface _PxPropertyAnimation {\n\n /** Array of keyframes defining the animation timeline */\n keyframes?: PxKeyframe[];\n\n /** Short alias for \"keyframes\" */\n kfs?: PxKeyframe[];\n\n /**\n * Optional loop configuration. When set, the keyframe sequence is expanded at pre-processing\n * time to fill the gap between the keyframe range and `animator.duration` by repeating a\n * chosen segment. `true` is shorthand for the default {@link PxLoop} (loop the last segment\n * after the final keyframe, cycling forward). See {@link PxLoop} for details.\n *\n * Note: this operates independently of `animator.iterations` — see {@link _PxLoop} for the\n * interaction between the two.\n */\n loop?: PxLoop | boolean;\n\n /**\n * Motion-along-path \"auto-orient\" flag. Only meaningful for translate\n * animations whose keyframes carry spatial tangents (`tangentIn` /\n * `tangentOut`): when true, the element rotates so its local X axis aligns\n * with the path tangent at the current position. The rotation is computed\n * from the cubic-Bezier derivative at the eased progress along the\n * arc-length-parametrised segment.\n */\n autoOrient?: boolean;\n}\n\n// `{ keyframes?:Keyframe[], kfs?:Keyframe[], loop?:Loop|boolean, autoOrient?:bool }`\nexport const PxPropertyAnimationSchema = implementsInterface<_PxPropertyAnimation>()(px.object({\n keyframes: px.array(PxKeyframeSchema).optional(),\n kfs: px.array(PxKeyframeSchema).optional(),\n loop: px.union([PxLoopSchema, px.boolean()]).optional(),\n autoOrient: px.boolean().optional(),\n}));\n\n/** Animation definition for a single CSS/SVG property. */\nexport type PxPropertyAnimation = PxInfer<typeof PxPropertyAnimationSchema>;\nconst _ck_PxPropertyAnimation: KeysMatch<PxPropertyAnimation, _PxPropertyAnimation> = true; // the key sets are identical\n\n\n// ============================================================================\n// TRANSFORM\n// ============================================================================\n\n/**\n * Names of the transform parts that can appear inside a transform value record.\n * The unified `transform` slot replaces the earlier per-part top-level keys\n * (`translate`, `rotate`, `scale`, `origin`) — those names now live as keys\n * inside a `PxTransformParts` record.\n */\nexport const PX_TRANSFORM_PART_KEYS = ['translate', 'rotate', 'scale', 'origin'] as const;\n\n/** One of the transform-part key strings. */\nexport type PxTransformPartKey = typeof PX_TRANSFORM_PART_KEYS[number];\n\n/**\n * Record of transform parts forming a single transform `value`. Each present\n * key contributes one segment of the composed CSS transform string at render /\n * interpolation time, in the canonical order\n * `translate, translate(+origin), rotate, scale, translate(-origin)`.\n *\n * `origin` is meaningful only when `rotate` or `scale` is also present in the\n * same record — see \"When does origin belong inside a keyframe value?\" in\n * `file-format-remaining-design-issues2.md`.\n */\nexport interface _PxTransformParts {\n\n /** Translation offset `[x, y]` in user units. */\n translate?: [number, number];\n\n /** Rotation in degrees. */\n rotate?: number;\n\n /** Scale factor `[sx, sy]`. */\n scale?: [number, number];\n\n /**\n * Pivot for rotate / scale `[x, y]`. Only meaningful alongside `rotate` or\n * `scale` in the same record.\n */\n origin?: [number, number];\n}\n\n// `{ translate?:[x,y], rotate?:deg, scale?:[sx,sy], origin?:[x,y] }`\nexport const PxTransformPartsSchema = implementsInterface<_PxTransformParts>()(px.object({\n translate: px.tuple([px.number(), px.number()] as const).optional(),\n rotate: px.number().optional(),\n scale: px.tuple([px.number(), px.number()] as const).optional(),\n origin: px.tuple([px.number(), px.number()] as const).optional(),\n}));\n\n/** Record of transform parts forming a single transform `value`. */\nexport type PxTransformParts = PxInfer<typeof PxTransformPartsSchema>;\nconst _ck_PxTransformParts: KeysMatch<PxTransformParts, _PxTransformParts> = true; // the key sets are identical\n\n/**\n * Unified `transform` slot value. Three valid shapes:\n *\n * - **SVG transform string** — `\"translate(10,10)rotate(45)scale(2,2)\"`. What\n * plain renderers consume directly.\n * - **Structured static** — `{value: PxTransformParts}`. Parametric record;\n * parts stay independently addressable.\n * - **Animated** — `{keyframes: [{time, value: PxTransformParts, …}, …]}`.\n * Each keyframe's `value` is a parts record. The interpolator composes the\n * parts into a single transform string per frame.\n *\n * Replaces the earlier convention of putting each animated transform part\n * under its own top-level attribute name (`translate`, `rotate`, `scale`,\n * `origin`).\n */\nexport const PxTransformValueSchema = px.union([\n px.string(),\n px.object({ value: PxTransformPartsSchema }),\n PxPropertyAnimationSchema,\n]);\n\n/** Unified `transform` slot value: string | structured static | animated. */\nexport type PxTransformValue = PxInfer<typeof PxTransformValueSchema>;\n\n\n// ============================================================================\n// ANIMATION DEFINITION\n// ============================================================================\n\n/**\n * Complete animation definition containing one or more property animations.\n * Each key is a CSS/SVG property name (e.g., \"opacity\", \"translate\", \"fill\").\n *\n * @example\n * { \"opacity\": { keyframes: [...] }, \"translate\": { keyframes: [...] } }\n */\nexport interface _PxAnimationDefinition {\n [property: string]: PxPropertyAnimation;\n}\n\n// `Record<propName, PropertyAnimation>`\nexport const PxAnimationDefinitionSchema = implementsInterface<_PxAnimationDefinition>()(\n px.record(PxPropertyAnimationSchema)\n);\n\n/**\n * Complete animation definition containing one or more property animations.\n * Each key is a CSS/SVG property name (e.g., \"opacity\", \"scale\", \"rotate\").\n */\nexport type PxAnimationDefinition = PxInfer<typeof PxAnimationDefinitionSchema>;\n\n\n// ============================================================================\n// ELEMENT ANIMATION\n// ============================================================================\n\n/**\n * Element animation specification. Can be:\n * - A string referencing a named animation from `definitions.animations`\n * - An array of named references\n * - An inline `AnimationDefinition` object\n * - A mixed array of references and inline definitions\n *\n * @example\n * \"fadeIn\"\n * [\"fadeIn\", \"spin\"]\n * { opacity: { keyframes: [...] } }\n * [\"fadeIn\", { scale: { keyframes: [...] } }]\n */\nexport type _PxElementAnimation =\n | string\n | string[]\n | PxAnimationDefinition\n | (string | PxAnimationDefinition)[];\n\n// `string | Array<string|AnimationDefinition> | AnimationDefinition`\nexport const PxElementAnimationSchema = implementsInterface<_PxElementAnimation>()(px.union([\n px.string(),\n px.array(px.union([px.string(), PxAnimationDefinitionSchema])),\n PxAnimationDefinitionSchema,\n]));\n\n/**\n * Element animation specification.\n * Can be a string reference, array of references, inline definition, or a mixed array.\n */\nexport type PxElementAnimation = PxInfer<typeof PxElementAnimationSchema>;\n\n\n// ============================================================================\n// TRIGGER\n// ============================================================================\n\ntype StartOnExtra = StartOn | 'programmatic';\n\n/**\n * Defines when and how an animation should be triggered.\n */\nexport interface _PxTrigger {\n\n /** Event that starts the animation */\n startOn?: StartOnExtra;\n\n /** Action to take when the trigger condition is no longer met (e.g., mouse leaves) */\n outAction?: 'continue' | 'pause' | 'reset' | 'reverse';\n\n /** Percentage of element visibility required to trigger (0–1). Only applies to scrollIntoView. */\n scrollIntoViewThreshold?: number;\n}\n\n// `{ startOn?:'load'|'mouseOver'|'click'|'scrollIntoView'|'programmatic', outAction?:..., scrollIntoViewThreshold?:number }`\nexport const PxTriggerSchema = implementsInterface<_PxTrigger>()(px.object({\n startOn: px.enum(['load', 'mouseOver', 'click', 'scrollIntoView', 'programmatic'] as const).optional(),\n outAction: px.enum(['continue', 'pause', 'reset', 'reverse'] as const).optional(),\n scrollIntoViewThreshold: px.number().optional(),\n}));\n\n/** Defines when and how an animation should be triggered. */\nexport type PxTrigger = PxInfer<typeof PxTriggerSchema>;\nconst _ck_PxTrigger: KeysMatch<PxTrigger, _PxTrigger> = true; // the key sets are identical\n\n\n// ============================================================================\n// DEFS\n// ============================================================================\n\n/**\n * Reusable definitions library for easings, animations, and styles.\n * Defined once here, referenced by name on elements.\n */\nexport interface _PxDefs {\n\n /** Named cubic-bezier easing functions */\n easings?: { [name: string]: [number, number, number, number]; };\n\n /** Named animation definitions that can be referenced by elements */\n animations?: { [name: string]: PxAnimationDefinition; };\n\n /**\n * FIXME - do we need it?\n * Named style presets for common styling patterns\n */\n styles?: { [name: string]: Record<string, string | number>; };\n}\n\n// `{ easings?:Record<name,[x1,y1,x2,y2]>, animations?:Record<name,AnimationDefinition>, styles?:Record<string,any> }`\nexport const PxDefsSchema = implementsInterface<_PxDefs>()(px.object({\n easings: px.record(px.tuple([px.number(), px.number(), px.number(), px.number()] as const)).optional(),\n animations: px.record(PxAnimationDefinitionSchema).optional(),\n styles: px.record(px.any()).optional(),\n}));\n\n/** Reusable definitions library for easings, animations, and styles. */\nexport type PxDefs = PxInfer<typeof PxDefsSchema>;\nconst _ck_PxDefs: KeysMatch<PxDefs, _PxDefs> = true; // the key sets are identical\n\n\n// ============================================================================\n// ANIMATOR CONFIG\n// ============================================================================\n\n/**\n * Global animation configuration that applies to all animations in the document.\n * Defines timing, playback behaviour, and rendering strategy.\n */\nexport interface _PxAnimatorConfig {\n\n /** JavaScript animation implementation strategy */\n mode?: JsMode;\n\n /** Total animation duration in milliseconds */\n duration?: number;\n\n /** Delay before animation starts in milliseconds */\n delay?: number;\n\n /**\n * Number of times to repeat the entire document timeline. Use `\"infinite\"` for endless loop.\n *\n * This repeats **all properties across all elements** as a unit. It is independent of\n * per-property `loop` configuration: if a property uses `loop`, its keyframes are already\n * expanded to fill `duration` before `iterations` takes effect — the two do not interfere,\n * but they do compose (a looping property inside an infinitely iterating document loops\n * within each iteration).\n */\n iterations?: number | \"infinite\";\n\n /**\n * Defines which values are applied before/after the active animation period\n * (maps directly to the Web Animations API `fill` option).\n * Defaults to `'forwards'` when not set so that elements hold their final\n * state after the animation ends — consistent with Lottie and other animation\n * runtimes. Without this default, seeking to the last frame would cause\n * elements to revert to their pre-animation state.\n */\n fill?: FillMode;\n\n /** Direction of animation playback */\n direction?: PlaybackDirection;\n\n /** Target frame rate for frame-based animations (only applicable when mode=\"frames\") */\n frameRate?: number;\n\n /** Trigger configuration for when animation should start */\n trigger?: PxTrigger;\n\n /** Named easings, animations, and styles — referenced by elements */\n definitions?: PxDefs;\n\n /**\n * Animation map for pre-rendered SVG elements (Mode B).\n * Maps element IDs to their animation specs. Used when the SVG DOM already exists\n * and the player only needs to animate existing elements.\n *\n * @example { \"_px_abc\": { opacity: { keyframes: [...] } }, \"_px_def\": [\"fadeIn\"] }\n */\n animate?: Record<string, PxElementAnimation>;\n\n debug?: boolean; // FIXME - implement\n\n debugInstName?: string; // FIXME - implement\n}\n\n// `{ mode?, duration?, delay?, iterations?, fill?, direction?, frameRate?, trigger?, definitions?, animate?, debug?, debugInstName? }`\nexport const PxAnimatorConfigSchema = implementsInterface<_PxAnimatorConfig>()(px.object({\n mode: px.enum(['auto', 'webapi', 'frames'] as const).optional(),\n duration: px.number().optional(),\n delay: px.number().optional(),\n iterations: px.union([px.number(), px.literal('infinite')]).optional(),\n fill: px.enum(['forwards', 'backwards', 'both', 'none'] as const).optional(),\n direction: px.enum(['normal', 'reverse', 'alternate', 'alternate-reverse'] as const).optional(),\n frameRate: px.number().optional(),\n trigger: PxTriggerSchema.optional(),\n definitions: PxDefsSchema.optional(),\n animate: px.record(PxElementAnimationSchema).optional(),\n debug: px.boolean().optional(),\n debugInstName: px.string().optional(),\n}));\n\n/**\n * Global animation configuration that applies to all animations in the document.\n * Defines timing, playback behavior, and rendering strategy.\n */\nexport type PxAnimatorConfig = PxInfer<typeof PxAnimatorConfigSchema>;\nconst _ck_PxAnimatorConfig: KeysMatch<PxAnimatorConfig, _PxAnimatorConfig> = true; // the key sets are identical\n\n\n// ============================================================================\n// BINDING\n// ============================================================================\n\n/**\n * Binds animations to existing DOM elements by ID.\n * Used when the SVG tree is pre-rendered and animations are applied separately.\n */\nexport interface _PxBinding {\n\n /** ID targeting elements in the DOM (data-px-id=\"...\") */\n id: string;\n\n /** Animation to apply to matched elements */\n animate: PxElementAnimation;\n}\n\n// `{ id:string, animate:ElementAnimation }`\nexport const PxBindingSchema = implementsInterface<_PxBinding>()(px.object({\n id: px.string(),\n animate: PxElementAnimationSchema,\n}));\n\n/**\n * Binds animations to existing DOM elements via CSS selectors.\n * Used when the SVG tree is pre-rendered and animations are applied separately.\n */\nexport type PxBinding = PxInfer<typeof PxBindingSchema>;\nconst _ck_PxBinding: KeysMatch<PxBinding, _PxBinding> = true; // the key sets are identical\n\n\n// ============================================================================\n// NODE\n// ============================================================================\n\n/**\n * Per-attribute value shape on the element body. A property key carries either:\n * - a primitive (string/number) — static SVG attribute\n * - a `{value: …}` object — structured static parametric source (record-shaped\n * static value, used by attributes whose static representation is itself a\n * record — notably `transform: {value: PxTransformParts}`)\n * - a `{keyframes}` / `{kfs}` object — inline property animation\n *\n * The unified rule (primitive | `{value}` | `{keyframes}`) applies across the\n * format. For most attributes the `{value}` form is rarely used on the body\n * (a primitive suffices for static); for `transform` it is the canonical\n * structured-static shape. See `PxTransformValueSchema`.\n */\nexport const PxAttrValueSchema = px.union([\n px.string(),\n px.number(),\n px.object({ value: px.any() }),\n PxPropertyAnimationSchema,\n]);\n\n/** Per-attribute value: primitive for static, `{value}` for structured static, `PxPropertyAnimation` for animated. */\nexport type PxAttrValue = string | number | { value: any } | PxPropertyAnimation;\n\n\n/**\n * Base interface for all SVG elements.\n * Named properties take precedence over the index signature when accessed.\n */\nexport interface _PxNode {\n\n /** SVG element type (e.g., \"circle\", \"rect\", \"path\", \"g\") */\n type: string;\n\n /** Child elements (for container elements like <g>) */\n children?: PxNode[];\n\n /** Meta informaion about this element */\n meta?: any;\n\n /**\n * Player-effects bucket (transformation/repeater/maskedBy/trimPath/retime/ref)\n * emitted by the Editor's lightweight design format. `applyPlayerEffects`\n * materialises and removes these before any other normalisation, so the\n * Player never observes a non-empty `effects` after entry-point processing.\n */\n effects?: any;\n\n /**\n * In-place property animations for this element, keyed by SVG/CSS property\n * name (e.g. \"transform\", \"fill\", \"opacity\"). Each value is a\n * PxPropertyAnimation (`{keyframes}` / `{kfs}`). The static initial value of\n * an animated property is still carried as a plain attribute on the body.\n */\n animate?: PxAnimationDefinition;\n\n /**\n * FIXME - do we need it?\n * Style applied to this element (named reference or inline object)\n */\n style?: string | Record<string, string | number>;\n\n /**\n * All other SVG attributes (cx, cy, r, fill, stroke, etc.).\n * A value is either a primitive (static) or a PxPropertyAnimation (in-place\n * animation `{keyframes: [...]}` / `{kfs: [...]}`).\n */\n [key: string]: any;\n}\n\n// ============================================================================\n// PLAYER-EFFECTS BUCKET SCHEMAS\n// ============================================================================\n//\n// Schemas for the `node.effects` payload emitted by the Editor's lightweight\n// design format. `applyPlayerEffects` (in `effects/PlayerEffectsUtil.ts`)\n// materialises and removes these before any other normalisation, so the Player\n// never observes a non-empty `effects` after entry-point processing.\n//\n// Schemas mirror the TS interfaces in `effects/types.ts`. The effects folder\n// itself stays portable (zero deps); these schemas + `validateNodeEffects`\n// live here so the lib provides shape validation as a service for callers\n// (the Player calls it in `createAnimatorImpl`; the Editor could too).\n//\n// Adjust `effects/types.ts` and these schemas together when a new effect is\n// introduced or an existing one grows a new field.\n\n// PxAnimatable<number> — static number OR `{value}` static OR `{keyframes}` animated.\nconst PxAnimatableNumberSchema = px.union([\n px.number(),\n px.object({ value: px.number() }),\n px.object({\n keyframes: px.array(PxKeyframeSchema),\n autoOrient: px.boolean().optional(),\n }),\n]);\n\n// PxAnimatable<Vec2> — static `[x,y]` OR `{value:[x,y]}` OR `{keyframes}` animated.\nconst PxAnimatableVec2Schema = px.union([\n px.tuple([px.number(), px.number()]),\n px.object({ value: px.tuple([px.number(), px.number()]) }),\n px.object({\n keyframes: px.array(PxKeyframeSchema),\n autoOrient: px.boolean().optional(),\n }),\n]);\n\n/** Per-part editor transform (`transformation` effect). All parts optional and animatable. */\nexport const PxTransformationEffectSchema = px.object({\n translate: PxAnimatableVec2Schema.optional(),\n rotate: PxAnimatableNumberSchema.optional(),\n scale: PxAnimatableVec2Schema.optional(),\n skew: PxAnimatableVec2Schema.optional(),\n origin: PxAnimatableVec2Schema.optional(),\n});\n\n/** Per-copy repeater offsets. All static (animated repeater not yet supported). */\nexport const PxRepeaterEffectSchema = px.object({\n copies: px.number().optional(),\n translate: px.tuple([px.number(), px.number()]).optional(),\n rotate: px.number().optional(),\n scale: px.tuple([px.number(), px.number()]).optional(), // per-copy scale, PERCENT (85 → 0.85)\n origin: px.tuple([px.number(), px.number()]).optional(),\n});\n\n/** Mask source ref + standard `<mask>` attributes. */\nexport const PxMaskedByEffectSchema = px.object({\n href: px.string().optional(),\n maskType: px.string().optional(),\n maskUnits: px.string().optional(),\n maskContentUnits: px.string().optional(),\n});\n\n/** Trim-path effect payload — opaque to the player materialiser; lives on `meta`. */\nexport const PxTrimPathEffectSchema = px.any();\n\n/** `<use>` retime: `baseId` = source; `start`/`timeCrop` in ms. */\nexport const PxRetimeEffectSchema = px.object({\n baseId: px.string().optional(),\n start: px.number().optional(),\n stretch: px.number().optional(),\n timeCrop: px.tuple([px.number(), px.number()]).optional(),\n});\n\n/** `<use>` ref: `baseId` = source; `type: 'content'` = exclude object-translate. */\nexport const PxRefEffectSchema = px.object({\n baseId: px.string().optional(),\n type: px.string().optional(),\n});\n\n/** The full `node.effects` bucket. Closed — each known effect is declared\n * (strict-mode validation flags an unknown effect key as a wire-format drift). */\nexport const PxEffectsSchema = px.object({\n transformation: PxTransformationEffectSchema.optional(),\n repeater: PxRepeaterEffectSchema.optional(),\n maskedBy: PxMaskedByEffectSchema.optional(),\n trimPath: PxTrimPathEffectSchema.optional(),\n retime: PxRetimeEffectSchema.optional(),\n isCombinedShape: px.boolean().optional(),\n ref: PxRefEffectSchema.optional(),\n});\n\n/**\n * Walks `root` and validates every `node.effects` bucket against `PxEffectsSchema`.\n * Returns an array of human-readable warning strings (empty when all good).\n * Doesn't mutate the tree. Called by `createAnimatorImpl` before applying effects.\n *\n * Pass `strict: true` to also flag undeclared keys (useful in dev / tests).\n */\nexport function validateNodeEffects(root: PxNode, opts?: { strict?: boolean }): Array<string> {\n const warnings: Array<string> = [];\n // `path` is a human-readable breadcrumb prepended to each warning so the\n // reader can locate the offending node in the tree (e.g.\n // `root.children[0].children[2].effects.transformation.translate: …`).\n const walk = (node: PxNode, path: string): void => {\n if (node && node.effects) {\n const ctx: PxValidationContext = { errors: [], warnings: [], strict: !!opts?.strict };\n const ok = PxEffectsSchema.isValid(node.effects, ctx, [path + '.effects']);\n if (!ok) {\n for (const err of ctx.errors) warnings.push(err);\n }\n }\n if (node && Array.isArray(node.children)) {\n node.children.forEach((c, i) => walk(c, path + '.children[' + i + ']'));\n }\n };\n walk(root, 'root');\n return warnings;\n}\n\n\n// ============================================================================\n// NODE\n// ============================================================================\n\n/**\n * Base shape for all SVG element nodes.\n * Open object: validated known keys + arbitrary SVG attributes whose values are\n * either primitives (static) or PxPropertyAnimation objects (in-place animation).\n * Non-recursive — excludes `children` (circular reference). Used for type extraction via PxInfer.\n *\n * `{ type:string, style?:…, [key:string]: string|number|PxPropertyAnimation }`\n */\nexport const PxNodeBase = px.openObject({\n type: px.string(),\n id: px.string().optional(),\n meta: px.any().optional(),\n // Player-effects bucket emitted by the Editor's lightweight design format.\n // Consumed and removed by `applyPlayerEffects` before any other normalisation\n // (see `createAnimatorImpl`), so downstream code never sees it.\n effects: PxEffectsSchema.optional(),\n animate: PxAnimationDefinitionSchema.optional(),\n style: px.union([px.string(), px.record(px.union([px.string(), px.number()]))]).optional(),\n}, PxAttrValueSchema);\n\n// `let` so the lazy closure can capture the variable reference after assignment.\n// By the time the lazy resolves (first isValid/sanitize call), PxNodeSchema is assigned.\n// `PxNodeBase & { children?:PxNode[] }`\nlet PxNodeSchema: PxSchema<any> = px.openObject({\n ...PxNodeBase._shape,\n children: px.lazy(() => px.array(PxNodeSchema), []).optional(),\n}, PxAttrValueSchema);\nexport { PxNodeSchema };\n\n/**\n * Base interface for all SVG elements.\n * Extends schema-derived typed fields; adds recursive children and the open\n * index signature for arbitrary SVG attributes (cx, cy, r, fill, etc.).\n * Named properties take precedence over the index signature when accessed.\n */\nexport interface PxNode extends PxInfer<typeof PxNodeBase> {\n children?: PxNode[];\n [key: string]: any;\n}\n\n\n// ============================================================================\n// SVG NODE (ROOT)\n// ============================================================================\n\n/**\n * Root SVG element containing the entire animated graphic.\n * Extends PxNode with SVG-specific properties and global configuration.\n */\nexport interface _PxSvgNode extends PxNode {\n\n /** FIXME - do we need it? SVG viewport width */\n width?: number;\n\n /** FIXME - do we need it? SVG viewport height */\n height?: number;\n\n /** FIXME - do we need it? SVG viewBox attribute defining coordinate system */\n viewBox?: string;\n\n /** Global animation configuration */\n animator?: PxAnimatorConfig;\n}\n\n/**\n * Extra fields present on the root SVG node, on top of PxNode.\n * Used for type extraction via PxInfer.\n *\n * `{ width?:number, height?:number, viewBox?:string, animator?:AnimatorConfig }`\n */\nexport const PxSvgNodeExtra = px.object({\n width: px.number().optional(),\n height: px.number().optional(),\n viewBox: px.string().optional(),\n animator: PxAnimatorConfigSchema.optional(),\n});\n\n/**\n * Root SVG element containing the entire animated graphic.\n * Extends PxNode (inheriting the open index signature) plus schema-derived\n * SVG-root fields.\n */\nexport interface PxSvgNode extends PxNode, PxInfer<typeof PxSvgNodeExtra> {\n}\n\n\n// ============================================================================\n// DOCUMENT\n// ============================================================================\n\n/**\n * Root SVG document schema. Enforces `type === 'svg'` to distinguish from child nodes.\n * This is the root type for the entire file format.\n *\n * `{ type:'svg', style?:…, width?:number, height?:number,\n * viewBox?:string, animator?:AnimatorConfig, children?:PxNode[],\n * [svgAttr]: string|number|PxPropertyAnimation }`\n */\nexport const PxAnimatedSvgDocumentSchema = px.openObject({\n ...PxNodeBase._shape,\n ...PxSvgNodeExtra._shape,\n type: px.literal('svg'), // override string → literal to require 'svg'\n children: px.array(PxNodeSchema).optional()\n}, PxAttrValueSchema);\n\n/**\n * The complete animated SVG document.\n * This is the root type for the entire file format.\n */\nexport interface PxAnimatedSvgDocument extends PxSvgNode {\n}\n\n\n// ============================================================================\n// API INTERFACES\n// ============================================================================\n\n/** A configuration object for animation lifecycle callbacks. */\nexport interface PxAnimatorCallbacksConfig {\n\n /** Callback executed when the animation starts or resumes. */\n onPlay?: () => void;\n\n /** Callback executed when the animation is paused. */\n onPause?: () => void;\n\n /** Callback executed when the animation is cancelled. */\n onCancel?: () => void;\n\n /** Callback executed when the animation finishes naturally. */\n onFinish?: () => void;\n\n /** Callback executed when the animation is removed. */\n onRemove?: () => void;\n}\n\n\nexport type PxPoint2D = Array<number>;\n\n\n// ============================================================================\n// BEZIER PATH\n// ============================================================================\n\n/** Represents a vector path for SVG shape animations. */\nexport interface _PxBezierPath {\n\n /** An array of vertex points [[x, y], ...]. */\n v: Array<PxPoint2D>;\n\n /** An array of 'in' tangent handles for each vertex [[x, y], ...]. */\n i?: Array<PxPoint2D>;\n\n /** An array of 'out' tangent handles for each vertex [[x, y], ...]. */\n o?: Array<PxPoint2D>;\n\n /** A boolean indicating if the path is closed. */\n c?: boolean;\n}\n\n// `{ v:number[][], i?:number[][], o?:number[][], c?:boolean }`\nexport const PxBezierPathSchema = implementsInterface<_PxBezierPath>()(px.object({\n v: px.array(px.array(px.number())),\n i: px.array(px.array(px.number())).optional(),\n o: px.array(px.array(px.number())).optional(),\n c: px.boolean().optional(),\n}));\n\n/** Represents a vector path for SVG shape animations. */\nexport type PxBezierPath = PxInfer<typeof PxBezierPathSchema>;\nconst _ck_PxBezierPath: KeysMatch<PxBezierPath, _PxBezierPath> = true; // the key sets are identical\n\n\n// ============================================================================\n// ANIMATOR API\n// ============================================================================\n\n/** Basic animation controls common to all animator types. */\nexport interface PxBasicAnimatorAPI {\n\n isReady(): boolean;\n\n /** Returns the root HTML element for the animation. */\n getRootElement(): Element | null;\n\n /** Returns true if the animation is currently running. */\n isPlaying(): boolean;\n\n /** Starts or resumes the animation. */\n play(): void;\n\n /** Pauses the animation at its current state. */\n pause(): void;\n\n /** Stops the animation and resets it to its initial state. */\n cancel(): void;\n\n}\n\n/** The full programmatic control interface for an animation. */\nexport interface PxAnimatorAPI extends PxBasicAnimatorAPI {\n\n /** Jumps to the end of the animation and holds the final state. */\n finish(): void;\n\n /** Changes the speed of the animation. 1 is normal, 2 is double, -1 is reverse. */\n setPlaybackRate(rate: number): void;\n\n /** Returns the current playback time in milliseconds. */\n getCurrentTime(): number | null;\n\n /** Jumps to a specific time (in milliseconds) in the animation. */\n setCurrentTime(time: number): void;\n\n /** Stops the animation and cleans up all associated resources. */\n destroy(): void;\n}\n\n\n// ============================================================================\n// HELPER FUNCTIONS\n// ============================================================================\n\nexport function isPxElementFileFormat(fileJson: any): fileJson is PxAnimatedSvgDocument {\n if (!(\n fileJson &&\n typeof fileJson === 'object' &&\n !Array.isArray(fileJson)\n )) {\n return false;\n }\n\n return fileJson['type'] === 'svg' || fileJson['tagName'] === 'svg';\n}\n\n\n// ============================================================================\n// DEEP VALIDATION\n// ============================================================================\n\nexport interface PxValidationResult {\n valid: boolean;\n errors: string[];\n}\n\n/**\n * Deep validation of PxAnimatedSvgDocument using the PxAnimatedSvgDocumentSchema.\n * @returns PxValidationResult with valid flag and array of error messages\n */\nexport function isPxElementFileFormatDeep(fileJson: any): PxValidationResult {\n const valid: boolean = PxAnimatedSvgDocumentSchema.isValid(fileJson);\n return { valid, errors: valid ? [] : ['Document failed schema validation'] };\n}\n\nexport function getAnimatorConfig(doc: PxAnimatedSvgDocument): PxAnimatorConfig | undefined {\n return (\n doc?.animator || doc?.meta?.animator ||\n doc?.animation || doc?.meta?.animation // FIXME - decide on the name\n );\n}\n\nexport function getDefs(doc: PxAnimatedSvgDocument): PxDefs | undefined {\n if (!doc) return undefined;\n return getAnimatorConfig(doc)?.definitions;\n}\n\nexport function getBindings(doc: PxAnimatedSvgDocument): PxBinding[] | undefined {\n if (!doc) return undefined;\n const animate = getAnimatorConfig(doc)?.animate;\n if (!animate) return undefined;\n return Object.entries(animate).map(([id, anim]) => ({ id, animate: anim }));\n}\n\n// FIXME - do we need it?\nexport function getChildren(doc: PxAnimatedSvgDocument): PxNode[] | undefined {\n return doc?.children;\n}","/*---------------------------------------------------------------------------------------\n * Copyright (c) Pixodesk LTD.\n * Licensed under the MIT License. See the LICENSE file in the project root for details.\n *---------------------------------------------------------------------------------------*/\n\nimport type { PxBezierPath, PxTransformParts } from './PxAnimatorTypes';\n\n\n/**\n * Converts a PxBezierPath to an SVG path string.\n * Control points (i, o) are treated as ABSOLUTE coordinates.\n * @param {PxBezierPath} path\n * @returns {string}\n */\nexport function bezierToSvgPath(path: PxBezierPath): string {\n const v = path.v;\n const i = path.i;\n const o = path.o;\n const c = path.c;\n\n if (!v.length) return \"\";\n\n const d: Array<string> = [];\n const len = v.length;\n d.push(\"M\" + v[0][0] + \",\" + v[0][1]);\n\n for (let idx = 1; idx < len; idx++) {\n const prevV = v[idx - 1];\n const prevO = o?.[idx - 1] ?? prevV;\n const currI = i?.[idx] ?? v[idx];\n const currV = v[idx];\n\n // Check if it's a straight line (control points coincide with vertices)\n const isLine = (prevO[0] === prevV[0] && prevO[1] === prevV[1]) &&\n (currI[0] === currV[0] && currI[1] === currV[1]);\n\n if (isLine) {\n d.push(\"L\" + currV[0] + \",\" + currV[1]);\n } else {\n // Control points are absolute coordinates\n d.push(\"C\" + prevO[0] + \",\" + prevO[1] + \",\" + currI[0] + \",\" + currI[1] + \",\" + currV[0] + \",\" + currV[1]);\n }\n }\n\n if (c && len > 0) {\n const lastV = v[len - 1];\n const lastO = o?.[len - 1] ?? lastV;\n const firstI = i?.[0] ?? v[0];\n const firstV = v[0];\n\n // Check if closing segment is a straight line\n const isLine = (lastO[0] === lastV[0] && lastO[1] === lastV[1]) &&\n (firstI[0] === firstV[0] && firstI[1] === firstV[1]);\n\n if (!isLine) {\n d.push(\"C\" + lastO[0] + \",\" + lastO[1] + \",\" + firstI[0] + \",\" + firstI[1] + \",\" + firstV[0] + \",\" + firstV[1]);\n }\n\n d.push(\"z\");\n }\n\n return d.join(\"\");\n}\n\n/**\n * @param {number} a \n * @param {number} b \n * @param {number} t \n * @returns {number}\n */\nexport function interpolateNum(a: number, b: number, t: number): number {\n return a + (b - a) * t;\n}\n\n\n/**\n * @param {Array<number>} a \n * @param {Array<number>} b \n * @param {number} t \n * @returns {Array<number>}\n */\nexport function interpolateVec(a: Array<number>, b: Array<number>, t: number): Array<number> {\n const res: Array<number> = [];\n const count = Math.max(a.length, b.length);\n for (let i = 0; i < count; i++) {\n res[i] = interpolateNum(a[i] || 0, b[i] || 0, t);\n }\n return res;\n}\n\n/**\n * Interpolates between two color arrays [r, g, b] or [r, g, b, a].\n * Normalizes both colors to 4 elements, defaulting alpha to 1 if missing.\n */\nexport function interpolateColor(a: Array<number>, b: Array<number>, t: number): Array<number> {\n return [\n interpolateNum(a[0] || 0, b[0] || 0, t),\n interpolateNum(a[1] || 0, b[1] || 0, t),\n interpolateNum(a[2] || 0, b[2] || 0, t),\n interpolateNum(a[3] === undefined ? 1 : a[3], b[3] === undefined ? 1 : b[3], t)\n ];\n}\n\n/**\n * Interpolates between two arrays of bezier paths.\n * @param paths1 The starting array of paths.\n * @param paths2 The ending array of paths.\n * @param progress The interpolation progress from 0.0 to 1.0.\n */\nexport function interpolateBeziers(\n paths1: Array<PxBezierPath>,\n paths2: Array<PxBezierPath>,\n progress: number\n): Array<PxBezierPath> {\n const count = Math.max(paths1.length, paths2.length);\n const res: Array<PxBezierPath> = [];\n for (let i = 0; i < count; i++) {\n res.push(interpolateBezier(paths1[i], paths2[i], progress));\n }\n return res;\n}\n\n/**\n * Interpolates between two bezier paths.\n * Control points (i, o) are treated as ABSOLUTE coordinates.\n * When control points are missing, they default to the vertex position.\n * @param {PxBezierPath} path1\n * @param {PxBezierPath} path2\n * @param {number} progress\n * @returns {PxBezierPath}\n */\nexport function interpolateBezier(\n path1: PxBezierPath | undefined,\n path2: PxBezierPath | undefined,\n progress: number\n): PxBezierPath {\n if (!path1 || !path2) return path1 || path2 || { v: [] };\n\n const t = Math.min(Math.max(progress, 0), 1);\n const len = Math.min(path1.v.length, path2.v.length);\n\n const v: Array<Array<number>> = [];\n const i: Array<Array<number>> = [];\n const o: Array<Array<number>> = [];\n\n for (let idx = 0; idx < len; idx++) {\n const v1 = path1.v[idx];\n const v2 = path2.v[idx];\n v.push(interpolateVec(v1, v2, t));\n\n // For absolute control points, default to vertex position (straight line)\n const i1 = path1.i?.[idx] ?? v1;\n const i2 = path2.i?.[idx] ?? v2;\n i.push(interpolateVec(i1, i2, t));\n\n const o1 = path1.o?.[idx] ?? v1;\n const o2 = path2.o?.[idx] ?? v2;\n o.push(interpolateVec(o1, o2, t));\n }\n\n return { v, i: i.length ? i : undefined, o: o.length ? o : undefined, c: path1.c ?? path2.c };\n}\n\n\n/**\n * Remap a number from one range to another.\n *\n * @param {number} value - The input value.\n * @param {number} inMin - Lower bound of the input range.\n * @param {number} inMax - Upper bound of the input range.\n * @param {number} outMin - Lower bound of the output range.\n * @param {number} outMax - Upper bound of the output range.\n * @returns The remapped value.\n */\nexport function remap(\n value: number,\n inMin: number,\n inMax: number,\n outMin: number,\n outMax: number\n): number {\n if (inMax === inMin) return outMin; // avoid divide-by-zero\n const t = (value - inMin) / (inMax - inMin);\n return outMin + t * (outMax - outMin);\n}\n\n/**\n * Solves for the parameter t such that the cubic bezier X(t) = x,\n * where the bezier has control point x-coordinates p1x and p2x\n * (endpoints are fixed at x=0 and x=1).\n * Uses Newton-Raphson with bisection fallback.\n */\nexport function solveCubicBezierX(p1x: number, p2x: number, x: number): number {\n if (x <= 0) return 0;\n if (x >= 1) return 1;\n\n const cx = 3 * p1x;\n const bx = 3 * (p2x - p1x) - cx;\n const ax = 1 - cx - bx;\n\n function sampleX(t: number) { return ((ax * t + bx) * t + cx) * t; }\n function sampleDX(t: number) { return (3 * ax * t + 2 * bx) * t + cx; }\n\n let t2 = x;\n let t0 = 0;\n let t1 = 1;\n\n for (let i = 0; i < 8; i++) {\n const x2 = sampleX(t2) - x;\n if (Math.abs(x2) < 1e-6) return t2;\n const d2 = sampleDX(t2);\n if (Math.abs(d2) < 1e-6) break;\n t2 -= x2 / d2;\n }\n\n t2 = x;\n while (t0 < t1) {\n const x2 = sampleX(t2);\n if (Math.abs(x2 - x) < 1e-6) return t2;\n if (x > x2) t0 = t2;\n else t1 = t2;\n t2 = (t1 + t0) / 2;\n }\n\n return t2;\n}\n\n/**\n * Creates a cubic-bezier easing function.\n * @param easing An array of four numbers [x1, y1, x2, y2] defining the bezier curve.\n * @returns A function that takes a progress value (0-1) and returns an eased value.\n */\nexport function cubicBezier(easing: [number, number, number, number]) {\n const [p1x, p1y, p2x, p2y] = easing;\n\n const cy = 3 * p1y;\n const by = 3 * (p2y - p1y) - cy;\n const ay = 1 - cy - by;\n\n function sampleCurveY(t: number) { return ((ay * t + by) * t + cy) * t; }\n\n return function (x: number) {\n return sampleCurveY(solveCubicBezierX(p1x, p2x, x));\n };\n}\n\ntype Point2 = [number, number];\n\nfunction lerp2(a: Point2, b: Point2, t: number): Point2 {\n return [a[0] + (b[0] - a[0]) * t, a[1] + (b[1] - a[1]) * t];\n}\n\n/**\n * Splits a cubic bezier curve at parameter t using De Casteljau's algorithm.\n * Returns the left and right sub-curves as 4-point tuples.\n */\nexport function subdivideCubicBezier(\n p0: Point2, p1: Point2, p2: Point2, p3: Point2, t: number\n): { left: [Point2, Point2, Point2, Point2], right: [Point2, Point2, Point2, Point2] } {\n const q0 = lerp2(p0, p1, t);\n const q1 = lerp2(p1, p2, t);\n const q2 = lerp2(p2, p3, t);\n const r0 = lerp2(q0, q1, t);\n const r1 = lerp2(q1, q2, t);\n const s = lerp2(r0, r1, t);\n return {\n left: [p0, q0, r0, s],\n right: [s, r1, q2, p3]\n };\n}\n\ntype Easing = [number, number, number, number];\n\n/**\n * Splits a CSS cubic-bezier easing [x1,y1,x2,y2] at a given x-axis fraction.\n * Each half is re-normalized to map [0,0]→[1,1].\n * Returns undefined for either half if the input is undefined (linear) or the split is degenerate.\n */\nexport function splitEasing(\n easing: Easing | undefined,\n xFraction: number\n): { left: Easing | undefined, right: Easing | undefined } {\n if (!easing) return { left: undefined, right: undefined };\n if (xFraction <= 0) return { left: undefined, right: easing };\n if (xFraction >= 1) return { left: easing, right: undefined };\n\n const [x1, y1, x2, y2] = easing;\n const t = solveCubicBezierX(x1, x2, xFraction);\n\n const p0: Point2 = [0, 0];\n const p1: Point2 = [x1, y1];\n const p2: Point2 = [x2, y2];\n const p3: Point2 = [1, 1];\n\n const { left, right } = subdivideCubicBezier(p0, p1, p2, p3, t);\n\n // Split point coordinates\n const sx = left[3][0];\n const sy = left[3][1];\n\n let leftEasing: Easing | undefined;\n if (sx > 1e-9 && Math.abs(sy) > 1e-9) {\n leftEasing = [\n left[1][0] / sx, left[1][1] / sy,\n left[2][0] / sx, left[2][1] / sy\n ];\n }\n\n let rightEasing: Easing | undefined;\n const rx = 1 - sx;\n const ry = 1 - sy;\n if (rx > 1e-9 && Math.abs(ry) > 1e-9) {\n rightEasing = [\n (right[1][0] - sx) / rx, (right[1][1] - sy) / ry,\n (right[2][0] - sx) / rx, (right[2][1] - sy) / ry\n ];\n }\n\n return { left: leftEasing, right: rightEasing };\n}\n\n/**\n * Reverses a cubic-bezier easing for backward playback.\n * [x1,y1,x2,y2] → [1-x2, 1-y2, 1-x1, 1-y1].\n */\nexport function reverseEasing(easing: Easing | undefined): Easing | undefined {\n if (!easing) return undefined;\n return [1 - easing[2], 1 - easing[3], 1 - easing[0], 1 - easing[1]];\n}\n\n/**\n * Converts a color from a [r, g, b, a] array (where values are 0-1) to an rgba() or rgb() CSS string.\n * @param color The color array.\n */\nexport function toRGBA(color: Array<number>): string {\n const r = Math.round(color[0] * 255);\n const g = Math.round(color[1] * 255);\n const b = Math.round(color[2] * 255);\n return color.length === 4 ?\n 'rgba(' + r + ',' + g + ',' + b + ',' + color[3] + ')' :\n 'rgb(' + r + ',' + g + ',' + b + ')';\n}\n\n/** Parse rgb/rgba string to normalized array */\nexport function parseRgba(s: string): number[] {\n const inner = s.match(/rgba?\\((.*)\\)/)?.[1];\n if (!inner) throw new Error('Invalid rgb/rgba format');\n const parts = inner.split(',').map(v => +v.trim());\n return [parts[0] / 255, parts[1] / 255, parts[2] / 255, ...(parts[3] !== undefined ? [parts[3]] : [])];\n}\n\n/** Parse hex string to normalized array (#RGB, #RGBA, #RRGGBB, #RRGGBBAA) */\nfunction parseHex(s: string): number[] {\n const hex = s.slice(1); // Remove '#'\n const isShort = hex.length <= 4; // #RGB or #RGBA vs #RRGGBB or #RRGGBBAA\n\n const r = isShort ? hex[0] + hex[0] : hex.slice(0, 2);\n const g = isShort ? hex[1] + hex[1] : hex.slice(2, 4);\n const b = isShort ? hex[2] + hex[2] : hex.slice(4, 6);\n const a = hex.length === 4 ? hex[3] + hex[3] : hex.length === 8 ? hex.slice(6, 8) : null;\n\n const result = [\n parseInt(r, 16) / 255,\n parseInt(g, 16) / 255,\n parseInt(b, 16) / 255\n ];\n\n if (a !== null) {\n result.push(parseInt(a, 16) / 255);\n }\n\n return result;\n}\n\n//// FIXME - support normalisation of config from different formats\n/** Parse color string (hex or rgb/rgba) to normalized [r, g, b] or [r, g, b, a] array (0-1 range) */\nexport function parseColor(s: any): number[] | undefined {\n if (!s) return undefined;\n if (Array.isArray(s)) return s;\n if (typeof s !== 'string') return undefined;\n if (s.startsWith('#')) {\n return parseHex(s);\n } else if (s.startsWith('rgb')) {\n return parseRgba(s);\n } else {\n // FIXME - come up with some solution how to report errors...\n console.warn('Unsupported color format: ' + s);\n }\n return undefined;\n}\n\nexport const COLOUR_ATTR_NAMES = new Set([\"color\", \"fill\", \"flood-color\", \"lighting-color\", \"stop-color\", \"stroke\"]);\nexport const TRANSFORM_FN_NAMES = new Set([\"translate\", \"rotate\", \"scale\", \"skew\"]);\nexport const PCT_BASED_ATTR_NAMES = new Set([\"offset-distance\", \"offsetDistance\"]);\n\n/**\n * Compose a `PxTransformParts` record into a single SVG/CSS transform string in\n * the canonical order:\n *\n * translate, translate(+origin), rotate, scale, translate(-origin)\n *\n * Each part is omitted when not present. `origin` becomes a `translate(+o)` /\n * `translate(-o)` pair surrounding the rotate/scale segment — the SVG-native\n * way to render a transform-origin pivot.\n *\n * @param parts the parts record (translate / rotate / scale / origin)\n * @param opts.withUnits when true (default), translates use `px` and rotate\n * uses `deg` — required for CSS / WebAnimations keyframes. When false, no\n * units are emitted — required for the SVG `transform` attribute.\n */\nexport function composeTransformParts(\n parts: PxTransformParts | null | undefined,\n opts?: { withUnits?: boolean }\n): string {\n if (!parts) return '';\n const withUnits = opts?.withUnits ?? true;\n const segs: Array<string> = [];\n const t = parts.translate;\n const o = parts.origin;\n const r = parts.rotate;\n const s = parts.scale;\n const tu = withUnits ? 'px' : '';\n const ru = withUnits ? 'deg' : '';\n if (t) segs.push('translate(' + t[0] + tu + ',' + t[1] + tu + ')');\n if (o) segs.push('translate(' + o[0] + tu + ',' + o[1] + tu + ')');\n if (r !== undefined && r !== null) segs.push('rotate(' + r + ru + ')');\n if (s) segs.push('scale(' + s[0] + ',' + s[1] + ')');\n if (o) segs.push('translate(' + (-o[0]) + tu + ',' + (-o[1]) + tu + ')');\n return segs.join('');\n}\nexport const STYLE_ATTR_NAMES = new Set([\"offset-distance\", \"offsetDistance\"]); // Props that need to go to style\nexport const DEFAULT_DURATION_MS = 1000;\n\n/**\n * Converts a kebab-case string to camelCase.\n * @param kebab The kebab-case string.\n */\nexport function kebabToCamelCaseWord(kebab: string): string {\n return kebab.includes('-') ? kebab.replace(/-([a-z])/g, (_, letter) => letter.toUpperCase()) : kebab;\n}\n\n/**\n * Checks if a string is in camelCase.\n * @param word The string to check.\n */\nexport function isCamelCaseWord(word: string): boolean {\n return !word.includes('-') && /[a-z][A-Z]/.test(word);\n}\n\n// FIXME - docs, rename?\nconst SVG_CAMEL_CASE_ATTRS = new Set([\n // Transform/positioning\n 'viewBox',\n 'preserveAspectRatio',\n\n // Gradient\n 'gradientUnits',\n 'gradientTransform',\n 'spreadMethod',\n\n // Pattern\n 'patternUnits',\n 'patternContentUnits',\n 'patternTransform',\n\n // Clipping/masking\n 'clipPathUnits',\n 'maskUnits',\n 'maskContentUnits',\n\n // Text\n 'textLength',\n 'lengthAdjust',\n 'startOffset',\n\n // Filter\n 'filterUnits',\n 'primitiveUnits',\n 'stdDeviation',\n 'baseFrequency',\n 'numOctaves',\n 'surfaceScale',\n 'diffuseConstant',\n 'specularConstant',\n 'specularExponent',\n 'kernelMatrix',\n 'kernelUnitLength',\n 'edgeMode',\n 'preserveAlpha',\n 'targetX',\n 'targetY',\n\n // // Animation\n // 'attributeName',\n // 'attributeType',\n // 'calcMode',\n // 'keyTimes',\n // 'keySplines',\n // 'repeatCount',\n // 'repeatDur' \n]);\n\n/**\n * Converts a camelCase string to kebab-case.\n * @param camel The camelCase string.\n */\nexport function camelCaseToKebabWordIfNeeded(camel: string): string { // FIXME - docs, rename function?\n return SVG_CAMEL_CASE_ATTRS.has(camel) ?\n camel :\n camel.replace(/([a-z0-9])([A-Z])/g, '$1-$2').toLowerCase();\n}\n\n/**\n * Checks if a CSS property is set inline on an element's style.\n * \n * @param {!CSSStyleDeclaration} style - element.style (CSSStyleDeclaration)\n * @param {string} propName - property name (camelCase or kebab-case)\n * @return {boolean}\n */\nexport function hasStyleProp(\n style: CSSStyleDeclaration,\n propName: string\n): boolean {\n return style.getPropertyValue(propName) !== '';\n}\n\n/**\n * Clamps a number between a minimum and maximum value.\n * @param value The number to clamp.\n * @param min The minimum value.\n * @param max The maximum value.\n */\nexport function clamp(value: number, min: number, max: number): number {\n return Math.max(min, Math.min(value, max));\n}\n\n\n// ============================================================================\n// 2D CUBIC BÉZIER PRIMITIVES — motion-along-path support\n// ============================================================================\n//\n// Hand-written, dependency-free 2D Bézier maths used by the motion-along-path\n// playback paths (both WAAPI normalisation and frames-mode direct compute).\n// See `fix-motion-along-path--fix-plan.md` for the wider plan.\n//\n// Conventions:\n// - Points are `[x, y]` tuples (`Point2`) — matches the wire format.\n// - A cubic segment is `(P0, P1, P2, P3)` where `P0` and `P3` are the\n// endpoints and `P1`, `P2` are the control points in ABSOLUTE coordinates.\n// - Editor's tangent storage convention (Lottie-style) is `kf.to` =\n// outgoing-from-kf-as-a-delta, `kf.ti` = incoming-at-the-next-kf-as-a-delta.\n// The wire format re-attaches them to the natural endpoints as\n// `tangentOut` on the FROM keyframe and `tangentIn` on the TO keyframe.\n// Caller is responsible for the position-to-control-point lift, i.e.\n// `P1 = fromKf.value + fromKf.tangentOut`, `P2 = toKf.value + toKf.tangentIn`.\n\n\n/**\n * Evaluate a 2D cubic Bézier at parameter `t ∈ [0, 1]` via Bernstein form:\n *\n * B(t) = (1-t)³ P0 + 3t(1-t)² P1 + 3t²(1-t) P2 + t³ P3\n *\n * `t` is the curve PARAMETER, not arc-length. For arc-length (CSS Motion Path\n * / `offset-distance`) semantics, use `bezier2D_tForDistance` first to convert\n * a distance to its parameter, then call this. Out-of-range `t` is clamped.\n */\nexport function bezier2D_pointAt(\n P0: Point2, P1: Point2, P2: Point2, P3: Point2,\n t: number\n): Point2 {\n if (t <= 0) return [P0[0], P0[1]];\n if (t >= 1) return [P3[0], P3[1]];\n const u = 1 - t;\n const u2 = u * u;\n const u3 = u2 * u;\n const t2 = t * t;\n const t3 = t2 * t;\n const w0 = u3;\n const w1 = 3 * t * u2;\n const w2 = 3 * t2 * u;\n const w3 = t3;\n return [\n w0 * P0[0] + w1 * P1[0] + w2 * P2[0] + w3 * P3[0],\n w0 * P0[1] + w1 * P1[1] + w2 * P2[1] + w3 * P3[1],\n ];\n}\n\n\n/**\n * Evaluate the derivative `B'(t)` of a 2D cubic Bézier at parameter `t`.\n *\n * B'(t) = 3(1-t)² (P1-P0) + 6t(1-t) (P2-P1) + 3t² (P3-P2)\n *\n * Returns the tangent VECTOR (not a unit vector). For auto-orient rotation,\n * caller computes `Math.atan2(d.y, d.x)`.\n *\n * Epsilon-nudge for degenerate endpoints: when a handle coincides with its\n * endpoint (e.g. `P1 === P0` and `t === 0`, common for the start/end of a\n * Lottie spatial-tangent path), the derivative collapses to zero. The\n * exact-endpoint value is then meaningless; we nudge `t` inward by `1e-4`\n * and retry. This mirrors the editor's `BezierExtra.derivative` workaround.\n */\nconst BEZIER_T_NUDGE = 1e-4;\nexport function bezier2D_derivativeAt(\n P0: Point2, P1: Point2, P2: Point2, P3: Point2,\n t: number\n): Point2 {\n const result = _bezier2D_derivativeAtRaw(P0, P1, P2, P3, t);\n if (result[0] === 0 && result[1] === 0) {\n // Degenerate (handle = endpoint). Nudge inward and retry.\n const nudgedT = t < 0.5 ? t + BEZIER_T_NUDGE : t - BEZIER_T_NUDGE;\n return _bezier2D_derivativeAtRaw(P0, P1, P2, P3, nudgedT);\n }\n return result;\n}\n\nfunction _bezier2D_derivativeAtRaw(\n P0: Point2, P1: Point2, P2: Point2, P3: Point2,\n t: number\n): Point2 {\n const u = 1 - t;\n const a = 3 * u * u;\n const b = 6 * t * u;\n const c = 3 * t * t;\n return [\n a * (P1[0] - P0[0]) + b * (P2[0] - P1[0]) + c * (P3[0] - P2[0]),\n a * (P1[1] - P0[1]) + b * (P2[1] - P1[1]) + c * (P3[1] - P2[1]),\n ];\n}\n\n\n/**\n * Arc-length lookup table for a 2D cubic Bézier.\n *\n * Samples the curve at `steps + 1` evenly-spaced parameter values\n * (`t = 0, 1/steps, 2/steps, …, 1`), computes the cumulative Euclidean\n * distance between consecutive samples, and returns parallel\n * `Float64Array`s for parameter (`ts`) and arc length (`ds`). `ds[steps]`\n * is the total arc length of the curve.\n *\n * The LUT shape is `{ts, ds}` with parallel Float64Arrays rather than\n * `Array<{t, d}>` because:\n * - One contiguous allocation per array instead of `steps+1` objects.\n * - Binary search in `bezier2D_tForDistance` reads `Float64Array` directly.\n * - The structure is read-only after construction — no need for per-sample\n * field access.\n *\n * Approximation error is roughly `O((1/steps)²)` for smooth curves; the\n * default 100 samples gives <1% error vs analytic arc length on typical\n * motion paths and matches the editor's `BezierExtra.getDLut` step count.\n */\nexport interface ArcLengthLUT {\n readonly ts: Float64Array;\n readonly ds: Float64Array;\n}\n\nexport function bezier2D_arcLengthLUT(\n P0: Point2, P1: Point2, P2: Point2, P3: Point2,\n steps: number = 100\n): ArcLengthLUT {\n const n = steps + 1;\n const ts = new Float64Array(n);\n const ds = new Float64Array(n);\n\n let prev = bezier2D_pointAt(P0, P1, P2, P3, 0);\n ts[0] = 0;\n ds[0] = 0;\n\n let cum = 0;\n for (let i = 1; i < n; i++) {\n const t = i / steps;\n const cur = bezier2D_pointAt(P0, P1, P2, P3, t);\n const dx = cur[0] - prev[0];\n const dy = cur[1] - prev[1];\n cum += Math.sqrt(dx * dx + dy * dy);\n ts[i] = t;\n ds[i] = cum;\n prev = cur;\n }\n return { ts, ds };\n}\n\n\n/**\n * Inverse of `bezier2D_arcLengthLUT` lookup: given a distance along the\n * curve, return the curve parameter `t` reached at that distance via\n * binary search on `lut.ds` + linear interpolation between adjacent\n * samples.\n *\n * Distance is clamped to `[0, lut.ds[last]]`. The returned `t` is in\n * `[0, 1]`. Pair with `bezier2D_pointAt` to get the point at that\n * arc-length distance:\n *\n * const t = bezier2D_tForDistance(lut, distance);\n * const point = bezier2D_pointAt(P0, P1, P2, P3, t);\n */\nexport function bezier2D_tForDistance(lut: ArcLengthLUT, distance: number): number {\n const { ts, ds } = lut;\n const last = ds.length - 1;\n if (distance <= 0) return ts[0];\n if (distance >= ds[last]) return ts[last];\n\n // Binary search for the upper-bound index `hi` such that ds[hi-1] <= distance < ds[hi].\n let lo = 1;\n let hi = last;\n while (lo < hi) {\n const mid = (lo + hi) >>> 1;\n if (ds[mid] < distance) lo = mid + 1;\n else hi = mid;\n }\n // Linear interpolate between the bracketing samples.\n const dPrev = ds[hi - 1];\n const dCur = ds[hi];\n const span = dCur - dPrev;\n const frac = span > 0 ? (distance - dPrev) / span : 0;\n return ts[hi - 1] + frac * (ts[hi] - ts[hi - 1]);\n}\n\n\n/**\n * `bezier2D_tForDistance` convenience taking a fraction of the total arc\n * length instead of an absolute distance. `pct` is in `[0, 1]` (CSS Motion\n * Path `offset-distance` semantics — `offset-distance: 50%` ≡\n * `bezier2D_tForDistancePct(lut, 0.5)`). Out-of-range values clamp.\n */\nexport function bezier2D_tForDistancePct(lut: ArcLengthLUT, pct: number): number {\n const total = lut.ds[lut.ds.length - 1];\n return bezier2D_tForDistance(lut, pct * total);\n}","/*---------------------------------------------------------------------------------------\n * Copyright (c) Pixodesk LTD.\n * Licensed under the MIT License. See the LICENSE file in the project root for details.\n *---------------------------------------------------------------------------------------*/\n\nimport { getDefs, INTERNAL_ATTRS, TEXT_ATTR, TEXT_CONTENT_ATTR, type PxAnimatedSvgDocument, type PxDefs, type PxNode } from './PxAnimatorTypes';\nimport { camelCaseToKebabWordIfNeeded, COLOUR_ATTR_NAMES, composeTransformParts, toRGBA, TRANSFORM_FN_NAMES } from './PxAnimatorUtil';\n\n\nconst SVG_NS = 'http://www.w3.org/2000/svg';\n\n// textPath\nconst ALLOWED_SVG_TAGS_LOWER_CASE = new Set([\n 'svg', 'g', 'path', 'circle', 'ellipse', 'rect', 'line', 'polyline', 'polygon',\n 'text', 'tspan', 'textPath', 'defs', 'clipPath', 'mask', 'pattern', 'linearGradient',\n 'radialGradient', 'stop', 'use', 'symbol', 'marker', 'filter', 'feGaussianBlur',\n 'feOffset', 'feBlend', 'feColorMatrix', 'feMerge', 'feMergeNode'\n].map(tagName => tagName.toLowerCase()));\n\n\nconst ALLOWED_RESOURCE_ATTRIBUTES = [\n\n 'href', // <use>\n\n 'src', // <image>\n\n 'filter', // url(#filterId)\n 'clipPath', // clip-path=\"url(#clipPathId)\"\n 'mask', // url(#maskId)\n 'markerStart', // marker-start=\"url(#markerId)\"\n 'markerMid', // marker-mid=\"url(#markerId)\"\n 'markerEnd', // marker-end=\"url(#markerId)\"\n\n // 'fill', // url(#gradientId) or url(#patternId)\n // 'stroke', // url(#gradientId) or url(#patternId)\n\n // Don't allow 'cursor', can use external SVG, // url(cursor.svg)\n];\nconst ALLOWED_RESOURCE_ATTRIBUTES_SET = new Set(ALLOWED_RESOURCE_ATTRIBUTES);\n\nconst ALLOWED_ATTRIBUTES = [\n 'href', 'src',\n\n // Presentation\n 'fill', 'fillOpacity', 'fillRule',\n\n 'stroke', 'strokeWidth' /*stroke-width*/,\n 'strokeOpacity', 'strokeLinecap', 'strokeLinejoin',\n 'strokeMiterlimit', 'strokeDasharray', 'strokeDashoffset',\n\n 'opacity', 'transform',\n\n // Geometry\n 'x', 'y', 'cx', 'cy', 'r', 'rx', 'ry', 'width', 'height', 'd',\n 'x1', 'y1', 'x2', 'y2', 'points',\n 'dx', 'dy',\n\n // Font\n 'fontSize' /*font-size*/, 'fontFamily' /*font-family*/, \n 'fontWeight', 'fontStyle',\n\n // Text\n 'textAnchor' /*text-anchor*/, \n 'letterSpacing', 'wordSpacing',\n 'space', 'xml:space', 'textDecoration', 'textTransform', 'whiteSpace', 'white-space',\n 'dominantBaseline', 'alignmentBaseline',\n 'rotate', // per-glyph rotation array, currently not supported\n\n // Structure\n 'id', 'class', 'viewBox', 'preserveAspectRatio',\n\n // Gradient/Pattern\n 'offset', 'stopColor' /*stop-color*/, 'stopOpacity' /*stop-opacity*/, 'gradientTransform',\n\n // Clippath/Mask\n 'clipPath' /*clip-path*/, 'mask',\n\n // Motion path\n 'offsetPath', 'offsetDistance', 'offsetRotate', 'offsetAnchor', 'offsetPosition',\n\n // Text path\n 'startOffset', 'textLength', 'lengthAdjust',\n\n // Filter\n 'filter', 'stdDeviation', 'in', 'in2', 'result', 'mode',\n\n ...ALLOWED_RESOURCE_ATTRIBUTES\n];\nconst ALLOWED_ATTRIBUTES_LOW_SET = new Set(ALLOWED_ATTRIBUTES.map(str => str.toLowerCase()));\n\nfunction sanitiseAttributeValue(name: string, value: any): any | undefined {\n const nameLower = name.toLowerCase();\n\n // Block dangerous attributes\n if (!ALLOWED_ATTRIBUTES_LOW_SET.has(nameLower)) {\n console.warn('Attribute not in whitelist: ', nameLower);\n return undefined;\n }\n\n // fill/stroke accept plain color values (e.g. \"red\", \"#ff0000\") in addition to\n // url(#id) references. If a url() is present it must reference an internal id.\n if (nameLower === 'fill' || nameLower === 'stroke' || nameLower === 'stopColor') {\n const str = String(value);\n if (str.includes('url(') && !/^url\\(#[^)]+\\)$/.test(str)) {\n console.warn('Attribute \"' + nameLower + '\" blocked: url() references must be internal url(#id), got:', value);\n return undefined;\n }\n return value;\n }\n\n if (ALLOWED_RESOURCE_ATTRIBUTES_SET.has(nameLower)) {\n const str = String(value);\n\n if (str.startsWith('#')) {\n // Allow internal fragment references: #id (e.g. href=\"#elementId\")\n return value;\n }\n\n if (/^url\\(#[^)]+\\)$/.test(str)) {\n // Allow internal URL references: url(#id)\n return value;\n }\n\n return undefined;\n }\n\n return value;\n}\n\nfunction createElement(\n tagName: string,\n normalisedProps: { [k: string]: string },\n style: Record<string, string | number> | undefined,\n children: Array<Element> | undefined,\n textContent?: string\n): SVGElement | null {\n if (!ALLOWED_SVG_TAGS_LOWER_CASE.has(tagName.toLowerCase())) {\n console.warn('Attribute not in whitelist: ', tagName);\n return null;\n }\n\n const element = document.createElementNS(SVG_NS, tagName);\n\n for (const propName in normalisedProps) {\n element.setAttribute(\n camelCaseToKebabWordIfNeeded(propName),\n sanitiseAttributeValue(propName, normalisedProps[propName])\n );\n }\n\n // Apply style properties directly (avoids kebab-case issues)\n if (style) {\n for (const styleProp in style) {\n (element as any).style[styleProp] = String(style[styleProp]);\n }\n }\n\n if (children) {\n for (const child of children) {\n element.appendChild(child);\n }\n }\n\n if (textContent) element.textContent = textContent;\n\n return element;\n}\n\n\n/** FIXME - do we need this?\n * Resolves a style reference to an actual style object.\n */\nfunction resolveStyle(\n style: string | Record<string, string | number> | undefined,\n defs?: PxDefs\n): Record<string, string | number> | undefined {\n if (!style) return undefined;\n\n if (typeof style === 'string') {\n // Look up named style in defs\n return defs?.styles?.[style];\n }\n\n return style;\n}\n\n\nexport function getNormalizedProps(props: Record<string, any>) {\n const propsCopy: Record<string, any> = {};\n\n // Process regular attributes\n for (const key of Object.keys(props)) {\n if (INTERNAL_ATTRS.has(key)) continue;\n if (key === 'style') continue;\n\n let value = props[key];\n\n if (COLOUR_ATTR_NAMES.has(key) && Array.isArray(value)) {\n propsCopy[key] = toRGBA(value);\n } else if (\n key === 'transform' && value !== null && typeof value === 'object' &&\n !Array.isArray(value) && value.value && typeof value.value === 'object'\n ) {\n // Unified transform structured-static form: { value: PxTransformParts }.\n // Compose into an SVG transform string (no units — SVG transform attribute).\n propsCopy['transform'] = composeTransformParts(value.value, { withUnits: false });\n } else if (TRANSFORM_FN_NAMES.has(key)) {\n if (Array.isArray(value)) {\n if (key === 'translate') value = value.map((v: number) => v + 'px');\n value = value.join(',');\n }\n if (key === 'rotate') value = value + 'deg';\n propsCopy['transform'] = key + '(' + value + ')';\n } else if (value !== undefined && value !== null) {\n propsCopy[key] = String(value);\n }\n }\n\n return propsCopy;\n}\n\n/**\n * Renders a PxNode tree to DOM elements.\n */\nexport function renderNode(node: PxNode, defs?: PxDefs): Element | null {\n if (!node) return null;\n\n const { type, children, style, ...props } = node;\n\n // Extract defs from root svg node\n const nodeDefs = getDefs(node as PxAnimatedSvgDocument) || defs;\n\n // Resolve style reference\n const resolvedStyle = resolveStyle(style, nodeDefs);\n\n // Process children\n let childElements: Array<Element> | undefined;\n if (children) {\n for (const ch of children) {\n const child = renderNode(ch, nodeDefs);\n if (child) {\n if (!childElements) childElements = [];\n childElements.push(child);\n }\n }\n }\n\n return createElement(\n type || 'g',\n getNormalizedProps(props),\n resolvedStyle,\n childElements,\n props[TEXT_ATTR] || props[TEXT_CONTENT_ATTR]\n );\n}","/*---------------------------------------------------------------------------------------\n * Copyright (c) Pixodesk LTD.\n * Licensed under the MIT License. See the LICENSE file in the project root for details.\n *---------------------------------------------------------------------------------------*/\n\nimport type { PxAnimatorAPI, PxTrigger } from './PxAnimatorTypes';\n\n\n/**\n * Sets up event-based triggers for an animation.\n *\n * This function attaches event listeners to the animation's root element based on the\n * provided configuration, allowing animations to be started by user interactions\n * or visibility changes.\n *\n * ### Trigger Options (startOn):\n * - 'load': Starts after the page loads.\n * - 'mouseOver': Starts on mouse enter.\n * - 'click': Toggles play/end action on click.\n * - 'scrollIntoView': Starts when the element scrolls into the viewport.\n * - 'programmatic': No automatic start. Must be controlled via the API.\n *\n * ### End Action Options (outAction):\n * Defines behavior when the trigger condition ends (e.g., mouse leave).\n * - 'continue': Animation continues playing.\n * - 'pause': Pauses the animation.\n * - 'reset': Cancels the animation, resetting it to the start.\n * - 'reverse': Reverses the animation playback.\n *\n * @param {!PxAnimatorAPI} api The animator API instance to control.\n * @param {!PxTrigger} config The trigger configuration object.\n * @returns {!PxAnimatorAPI} The same animator API instance, for chaining.\n */\nexport function setupAnimationTriggers(\n api: PxAnimatorAPI,\n config: PxTrigger\n): PxAnimatorAPI {\n const { startOn, outAction = 'continue', scrollIntoViewThreshold = 0.5 } = config;\n\n const root = api.getRootElement();\n\n if (!root) {\n console.warn('setupAnimationTriggers: No root element found for animation.');\n return api;\n }\n\n /** Ensures forward playback and starts or resumes the animation. */\n const start = () => {\n api.play();\n };\n\n /** Handles what to do when the element leaves the active trigger condition. */\n const handleEndAction = () => {\n switch (outAction) {\n case 'pause':\n api.pause();\n break;\n case 'reset':\n api.cancel();\n break;\n case 'reverse':\n // If reverse playback is implemented, this would set a negative playback rate.\n // For now we just call play() for compatibility.\n // api.setPlaybackRate(-1);\n api.play();\n break;\n case 'continue':\n default:\n // Do nothing\n break;\n }\n };\n\n // ---- Setup event-based start logic ----\n switch (startOn) {\n case 'load': {\n const startHandler = () => start();\n if (document.readyState === 'complete') {\n startHandler();\n } else {\n window.addEventListener('load', startHandler, { once: true });\n }\n break;\n }\n\n case 'mouseOver': {\n const mouseOverHandler = () => start();\n const mouseOutHandler = () => handleEndAction();\n\n root.addEventListener('mouseenter', mouseOverHandler);\n root.addEventListener('mouseleave', mouseOutHandler);\n break;\n }\n\n case 'click': {\n const clickHandler = () => {\n if (api.isPlaying()) {\n handleEndAction();\n } else {\n start();\n }\n };\n root.addEventListener('click', clickHandler);\n break;\n }\n\n case 'scrollIntoView': {\n const observer = new IntersectionObserver(\n entries => {\n entries.forEach(entry => {\n // If the element is at least partially visible\n if (entry.isIntersecting && entry.intersectionRatio >= scrollIntoViewThreshold) {\n start();\n } else {\n // Element scrolled off screen -> trigger handleEndAction\n handleEndAction();\n }\n });\n },\n { threshold: scrollIntoViewThreshold }\n );\n observer.observe(root);\n break;\n }\n\n case 'programmatic':\n // No auto-start; external code must call play()\n break;\n }\n\n return api;\n}\n","/*---------------------------------------------------------------------------------------\n * Copyright (c) Pixodesk LTD.\n * Licensed under the MIT License. See the LICENSE file in the project root for details.\n *---------------------------------------------------------------------------------------*/\n\n// Motion-along-path utilities for the player.\n//\n// Background: the editor saves two wire shapes for tangented-translate (and/or\n// autoOrient) animations:\n//\n// OUTPUT-A — `<defs><path d=…/>` + `style.offsetPath/...` + `offsetDistance`\n// keyframes on the element body. Player consumes directly via WAAPI;\n// the browser's CSS Motion Path implementation does arc-length\n// parametrisation + tangent rotation for free.\n//\n// OUTPUT-B — body-level `transform.keyframes[].value.{translate}` +\n// `tangentOut` / `tangentIn` on the natural endpoints +\n// animation-level `autoOrient`. Pure parametric — no DOM artefacts.\n// Used when the file is saved as SVGA-JSON only (no SVG twin).\n//\n// This module normalises an OUTPUT-B document into an OUTPUT-A document so the\n// player's existing WAAPI machinery can consume it unchanged. The transformation\n// is purely a JSON-to-JSON rewrite — no DOM mutation, no schema change.\n//\n// See `fix-motion-along-path--fix-plan.md` for the wider plan and the\n// canonical JSON examples for both shapes.\n\n\nimport { bezier2D_arcLengthLUT, bezier2D_derivativeAt, bezier2D_pointAt, bezier2D_tForDistance } from './PxAnimatorUtil';\nimport type { ArcLengthLUT } from './PxAnimatorUtil';\nimport type { PxAnimatedSvgDocument, PxKeyframe, PxNode, PxPropertyAnimation, PxTransformParts } from './PxAnimatorTypes';\n\n\ntype Point2 = [number, number];\n\n// Mirrors editor `Geometry2Util.formatNum` — round to 4 fractional digits,\n// re-coerce to number (strips trailing zeros), stringify. Keeps the path-`d`\n// output byte-identical to the editor's `SimpleBezierPath.writeToSvg`.\nfunction formatNum(value: number): string {\n return String(+value.toFixed(4));\n}\n\nfunction getKfTranslate(kf: PxKeyframe): Point2 | undefined {\n const v = kf.value ?? kf.v;\n if (!v) return undefined;\n if (Array.isArray(v) && v.length >= 2 && typeof v[0] === 'number' && typeof v[1] === 'number') {\n // Composite per-part shape: `value: [x, y]` directly.\n return [v[0], v[1]];\n }\n const tr = (v as PxTransformParts).translate;\n if (Array.isArray(tr) && tr.length >= 2) return [tr[0], tr[1]];\n return undefined;\n}\n\n\n/**\n * True when `anim` is a motion-along-path animation — at least one keyframe\n * carries spatial tangents (`tangentIn` / `tangentOut`) and/or the animation\n * has `autoOrient` set. Animation-level helper; works for either the body\n * `transform` slot or a composite per-part `translate` slot.\n */\nexport function propAnimIsMotionPath(anim: PxPropertyAnimation): boolean {\n const kfs: Array<PxKeyframe> | undefined = anim.keyframes ?? anim.kfs;\n if (!Array.isArray(kfs)) return false;\n if (anim.autoOrient) return true;\n for (const kf of kfs) {\n if (kf.tangentIn || kf.tangentOut) return true;\n }\n return false;\n}\n\n/**\n * True when `node.transform` is the OUTPUT-B parametric-translate-with-tangents\n * shape. Such a node needs to be lifted to OUTPUT-A form before WAAPI consumes it.\n *\n * Returns `false` for any animation that already looks like a plain unified\n * transform (no tangents and no autoOrient) — those are left untouched.\n */\nexport function nodeNeedsMotionPathNormalisation(node: PxNode): boolean {\n const transform = (node as { transform?: unknown }).transform;\n if (!transform || typeof transform !== 'object' || Array.isArray(transform)) return false;\n return propAnimIsMotionPath(transform as PxPropertyAnimation);\n}\n\n\n/**\n * Walks the whole doc tree and returns every node that needs motion-path\n * normalisation. Walks children recursively; the `<defs>` subtree is also\n * walked (theoretically a `<symbol>` or `<g>` inside defs could carry an\n * animated transform). Order is depth-first / pre-order.\n */\nexport function findMotionPathNodes(doc: PxAnimatedSvgDocument): Array<PxNode> {\n const found: Array<PxNode> = [];\n const visit = (node: PxNode): void => {\n if (nodeNeedsMotionPathNormalisation(node)) found.push(node);\n if (node.children) {\n for (const ch of node.children) visit(ch);\n }\n };\n if (doc.children) {\n for (const ch of doc.children) visit(ch);\n }\n return found;\n}\n\n\n/**\n * Builds the SVG `d`-attribute for a node's motion path, mirroring the editor's\n * `SimpleBezierPath.writeToSvg(isAbsolute=true)` output byte-for-byte.\n *\n * Wire convention for tangents (re-attached to natural ends, per OUTPUT-B):\n * segment kf[i] → kf[i+1]:\n * P0 = kf[i].value.translate\n * C1 = P0 + kf[i].tangentOut (relative → absolute)\n * C2 = P3 + kf[i+1].tangentIn (relative → absolute)\n * P3 = kf[i+1].value.translate\n *\n * Emits `L x,y` when both tangents are absent / zero (matches editor's\n * `isLine` check); `C cx1,cy1,cx2,cy2,x,y` otherwise. No spaces — `formatNum`\n * strips trailing zeros so e.g. 60.0000 prints as \"60\".\n *\n * Returns `undefined` if the node's transform shape is not a motion path\n * (no keyframes, no translate part, fewer than 2 kfs, etc.).\n */\nexport function buildMotionPathD(node: PxNode): string | undefined {\n const transform = (node as { transform?: unknown }).transform;\n if (!transform || typeof transform !== 'object' || Array.isArray(transform)) return undefined;\n const anim = transform as PxPropertyAnimation;\n const kfs: Array<PxKeyframe> | undefined = anim.keyframes ?? anim.kfs;\n if (!Array.isArray(kfs) || kfs.length < 2) return undefined;\n\n const positions: Array<Point2> = [];\n for (const kf of kfs) {\n const p = getKfTranslate(kf);\n if (!p) return undefined;\n positions.push(p);\n }\n\n const out: Array<string> = [];\n out.push('M', formatNum(positions[0][0]), ',', formatNum(positions[0][1]));\n\n for (let i = 1; i < kfs.length; i++) {\n const fromKf = kfs[i - 1];\n const toKf = kfs[i];\n const p0 = positions[i - 1];\n const p3 = positions[i];\n const to = fromKf.tangentOut;\n const ti = toKf.tangentIn;\n\n const hasOut = to && (to[0] !== 0 || to[1] !== 0);\n const hasIn = ti && (ti[0] !== 0 || ti[1] !== 0);\n\n if (!hasOut && !hasIn) {\n out.push('L', formatNum(p3[0]), ',', formatNum(p3[1]));\n } else {\n const c1x = p0[0] + (to ? to[0] : 0);\n const c1y = p0[1] + (to ? to[1] : 0);\n const c2x = p3[0] + (ti ? ti[0] : 0);\n const c2y = p3[1] + (ti ? ti[1] : 0);\n out.push(\n 'C',\n formatNum(c1x), ',', formatNum(c1y), ',',\n formatNum(c2x), ',', formatNum(c2y), ',',\n formatNum(p3[0]), ',', formatNum(p3[1]),\n );\n }\n }\n\n return out.join('');\n}\n\n\n// ── Defs emission (D3) ────────────────────────────────────────────────────────\n\n\n/**\n * Derives a deterministic `<path>` id for the given motion-path source node.\n * Same input → same id, so the normalisation pass is idempotent and tests\n * don't depend on time/random. Source `id` is assumed unique in the document\n * (an SVG invariant); appending a fixed suffix preserves that.\n */\nexport function motionPathIdForNode(node: PxNode): string {\n const baseId = node.id ?? 'unknown';\n return baseId + '_motion';\n}\n\n/**\n * Finds the first `<defs>` child at the top of `doc.children`, or creates one\n * (prepended) if missing. Returns the defs node; its `children` array is\n * guaranteed to exist after this call.\n */\nfunction findOrCreateDefs(doc: PxAnimatedSvgDocument): PxNode {\n if (!doc.children) doc.children = [];\n let defs = doc.children.find(ch => ch.type === 'defs');\n if (!defs) {\n defs = { type: 'defs', children: [] } as unknown as PxNode;\n doc.children.unshift(defs);\n }\n if (!defs.children) defs.children = [];\n return defs;\n}\n\nexport interface MotionPathEmission {\n /** Source node that carries the parametric translate (will be rewritten in D4). */\n readonly node: PxNode;\n /** Id of the `<defs><path>` entry just emitted. */\n readonly pathId: string;\n}\n\n/**\n * Walks `doc`, finds every node needing motion-path normalisation, builds its\n * `d` string, and pushes a `<defs><path id=... d=.../>` entry into the doc's\n * `<defs>` block (creating one if needed). Returns one record per emission for\n * the caller (D4) to use when rewriting the source element.\n *\n * Mutates `doc` in place. Idempotent: a second call with no source-side\n * changes is a no-op (deterministic ids; existing entries are not duplicated).\n */\nexport function emitMotionPathsToDefs(doc: PxAnimatedSvgDocument): Array<MotionPathEmission> {\n const sources = findMotionPathNodes(doc);\n if (sources.length === 0) return [];\n\n const defs = findOrCreateDefs(doc);\n const defsChildren = defs.children!;\n const existingIds = new Set<string>();\n for (const ch of defsChildren) {\n if (ch.id) existingIds.add(String(ch.id));\n }\n\n const emissions: Array<MotionPathEmission> = [];\n for (const node of sources) {\n const d = buildMotionPathD(node);\n if (d === undefined) continue;\n const pathId = motionPathIdForNode(node);\n if (!existingIds.has(pathId)) {\n defsChildren.push({ type: 'path', id: pathId, d } as unknown as PxNode);\n existingIds.add(pathId);\n }\n emissions.push({ node, pathId });\n }\n return emissions;\n}\n\n\n// ── Source-element rewrite (D4) ───────────────────────────────────────────────\n\n\n/**\n * Computes `offsetDistance` keyframe values per source keyframe — the\n * arc-length proportion along the full motion path. Mirrors the editor's\n * `getOffsetAlongPathForCss` step that sets `endPct = segment.end / totalLength`.\n *\n * For N source kfs there are N-1 segments. Returns an array of N values:\n * - position 0 is always 0\n * - position N-1 is always 1\n * - intermediate positions are cumulative-arc / total-arc (so equally-timed\n * kfs on a path whose first segment is twice as long as the second yield\n * offset values 0, 0.667, 1).\n */\nfunction computeOffsetDistances(kfs: Array<PxKeyframe>): Array<number> {\n const positions: Array<Point2> = [];\n for (const kf of kfs) {\n const p = getKfTranslate(kf);\n if (!p) return kfs.map((_, i) => i / Math.max(kfs.length - 1, 1));\n positions.push(p);\n }\n\n const arcs: Array<number> = [];\n for (let i = 1; i < kfs.length; i++) {\n const fromKf = kfs[i - 1];\n const toKf = kfs[i];\n const p0 = positions[i - 1];\n const p3 = positions[i];\n const to = fromKf.tangentOut;\n const ti = toKf.tangentIn;\n const c1: Point2 = [p0[0] + (to ? to[0] : 0), p0[1] + (to ? to[1] : 0)];\n const c2: Point2 = [p3[0] + (ti ? ti[0] : 0), p3[1] + (ti ? ti[1] : 0)];\n const lut = bezier2D_arcLengthLUT(p0, c1, c2, p3);\n arcs.push(lut.ds[lut.ds.length - 1]);\n }\n\n const total = arcs.reduce((s, a) => s + a, 0);\n const out: Array<number> = new Array(kfs.length);\n out[0] = 0;\n if (total === 0) {\n for (let i = 1; i < kfs.length; i++) out[i] = i / (kfs.length - 1);\n return out;\n }\n let cum = 0;\n for (let i = 1; i < kfs.length; i++) {\n cum += arcs[i - 1];\n out[i] = i === kfs.length - 1 ? 1 : cum / total;\n }\n return out;\n}\n\n/**\n * Rewrites a single OUTPUT-B source element into OUTPUT-A form using a\n * previously-emitted `<defs><path id=pathId>` reference:\n * - sets `node.style.{offsetPath, offsetAnchor, offsetDistance, offsetRotate}`\n * - replaces `node.transform` (parametric) with `node.offsetDistance`\n * (0 → 1 keyframes; intermediate values arc-length-proportional)\n *\n * Easing on each original keyframe is copied to the matching offsetDistance\n * keyframe (semantically: the easing of the segment leaving kf[i] applies to\n * the offsetDistance change from kf[i] to kf[i+1]).\n *\n * The animation's `loop` (if any) is carried across; the `autoOrient` flag\n * becomes `style.offsetRotate = 'auto'` (`'0deg'` otherwise).\n *\n * Idempotent: if `node.transform` is already absent or no longer a\n * motion-path animation, the call is a no-op.\n */\nexport function rewriteSourceForMotionPath(node: PxNode, pathId: string): void {\n if (!nodeNeedsMotionPathNormalisation(node)) return;\n const anim = node.transform as PxPropertyAnimation;\n const kfs: Array<PxKeyframe> = (anim.keyframes ?? anim.kfs) as Array<PxKeyframe>;\n if (!Array.isArray(kfs) || kfs.length < 2) return;\n\n const offsets = computeOffsetDistances(kfs);\n const offsetKfs: Array<PxKeyframe> = kfs.map((kf, i) => {\n const time = kf.time ?? kf.t;\n const easing = kf.easing ?? kf.e;\n const out: PxKeyframe = { time, value: offsets[i] };\n if (easing !== undefined) out.easing = easing;\n return out;\n });\n\n const offsetAnim: PxPropertyAnimation = { keyframes: offsetKfs };\n if (anim.loop !== undefined) offsetAnim.loop = anim.loop;\n node.offsetDistance = offsetAnim;\n\n const style = (node.style ?? {}) as Record<string, string>;\n style.offsetPath = 'url(#' + pathId + ')';\n style.offsetAnchor = '0 0';\n style.offsetDistance = '0%';\n style.offsetRotate = anim.autoOrient ? 'auto' : '0deg';\n node.style = style;\n\n delete node.transform;\n}\n\n\n/**\n * One-shot OUTPUT-B → OUTPUT-A normalisation pass for the whole doc.\n * Combines D3 (`emitMotionPathsToDefs`) + D4 (`rewriteSourceForMotionPath`).\n * Mutates `doc` in place.\n */\nexport function normaliseMotionPaths(doc: PxAnimatedSvgDocument): void {\n const emissions = emitMotionPathsToDefs(doc);\n for (const { node, pathId } of emissions) {\n rewriteSourceForMotionPath(node, pathId);\n }\n}\n\n\n// ── Frames-mode direct evaluation (E1–E6) ─────────────────────────────────────\n\n\n/**\n * Cached per-segment Bezier control points + arc-length LUT. Keyed by the\n * segment's FROM keyframe object identity (WeakMap), so cache entries vanish\n * automatically when keyframes are replaced; on the steady-state 60fps path\n * the same kf object is reused → cache hit, no LUT rebuild.\n */\ninterface MotionPathSegmentCache {\n readonly P0: Point2;\n readonly P1: Point2;\n readonly P2: Point2;\n readonly P3: Point2;\n readonly lut: ArcLengthLUT;\n readonly totalArc: number;\n}\n\nconst _segmentCache = new WeakMap<PxKeyframe, MotionPathSegmentCache>();\n\nfunction getSegmentCache(\n prevKf: PxKeyframe,\n nextKf: PxKeyframe,\n prevPos: Point2,\n nextPos: Point2,\n): MotionPathSegmentCache {\n const existing = _segmentCache.get(prevKf);\n if (existing) return existing;\n const to = prevKf.tangentOut;\n const ti = nextKf.tangentIn;\n const P1: Point2 = [prevPos[0] + (to ? to[0] : 0), prevPos[1] + (to ? to[1] : 0)];\n const P2: Point2 = [nextPos[0] + (ti ? ti[0] : 0), nextPos[1] + (ti ? ti[1] : 0)];\n const lut = bezier2D_arcLengthLUT(prevPos, P1, P2, nextPos);\n const entry: MotionPathSegmentCache = {\n P0: prevPos,\n P1,\n P2,\n P3: nextPos,\n lut,\n totalArc: lut.ds[lut.ds.length - 1],\n };\n _segmentCache.set(prevKf, entry);\n return entry;\n}\n\n/**\n * Test helper. Clears the per-segment cache. Don't use in production code —\n * the cache is content-addressed by kf object identity, so it self-invalidates\n * when kfs change. Only useful for tests that want to measure cache misses.\n */\nexport function _resetMotionPathSegmentCache(): void {\n // WeakMap has no `clear`. Best we can do is replace it, but the export\n // is `const`. Instead reset the WeakMap reference via a setter pattern.\n // For test purposes, individual entries can be evicted by mutating the\n // FROM keyframe (which the tests don't actually need). Leaving as a\n // documented no-op: tests that need this should use fresh keyframe\n // objects between assertions to force cache misses.\n}\n\nexport interface MotionPathSample {\n /** Translate at the current time (motion-path arc-length-parametrised). */\n readonly translate: Point2;\n /** Auto-orient rotation in degrees (only when `autoOrient` is set). */\n readonly rotateDeg?: number;\n}\n\n/**\n * Evaluates the motion-path position (and optional auto-orient rotation) for a\n * single segment kf[i] → kf[i+1], given the local progress already remapped\n * to `[0, 1]` and eased.\n *\n * - Builds (or reuses cached) Bezier control points: P0=prevPos, P1=P0+to,\n * P2=P3+ti, P3=nextPos.\n * - Maps `localProgress` (linear in time) to arc-length distance, then to\n * curve parameter `t` via the arc-length LUT.\n * - Returns the cubic point at `t`. If `autoOrient`, also returns the angle\n * `atan2(tangentY, tangentX)` in degrees.\n *\n * For a collapsed-tangent (degenerate) segment, the cubic reduces to a line;\n * the derivative epsilon-nudge in `bezier2D_derivativeAt` handles the\n * autoOrient case at the endpoints.\n */\nexport function evaluateMotionPathSegment(\n prevKf: PxKeyframe,\n nextKf: PxKeyframe,\n prevPos: Point2,\n nextPos: Point2,\n localProgress: number,\n autoOrient: boolean,\n): MotionPathSample {\n const seg = getSegmentCache(prevKf, nextKf, prevPos, nextPos);\n const t = seg.totalArc === 0 ? localProgress : bezier2D_tForDistance(seg.lut, localProgress * seg.totalArc);\n const point = bezier2D_pointAt(seg.P0, seg.P1, seg.P2, seg.P3, t);\n if (!autoOrient) return { translate: point };\n const tan = bezier2D_derivativeAt(seg.P0, seg.P1, seg.P2, seg.P3, t);\n const rotateDeg = Math.atan2(tan[1], tan[0]) * 180 / Math.PI;\n return { translate: point, rotateDeg };\n}\n","/*---------------------------------------------------------------------------------------\n * Copyright (c) Pixodesk LTD.\n * Licensed under the MIT License. See the LICENSE file in the project root for details.\n *---------------------------------------------------------------------------------------*/\n\nimport {\n getAnimatorConfig,\n getBindings,\n getDefs,\n type PxAnimatedSvgDocument,\n type PxAnimationDefinition,\n type PxBezierPath,\n type PxBinding,\n type PxDefs,\n type PxElementAnimation,\n type PxKeyframe,\n type PxLoop,\n type PxNode,\n type PxPropertyAnimation,\n type PxTransformParts\n} from './PxAnimatorTypes';\nimport { bezierToSvgPath, camelCaseToKebabWordIfNeeded, clamp, COLOUR_ATTR_NAMES, composeTransformParts, cubicBezier, interpolateBeziers, interpolateColor, interpolateNum, interpolateVec, isCamelCaseWord, parseColor, PCT_BASED_ATTR_NAMES, remap, reverseEasing, splitEasing, toRGBA, TRANSFORM_FN_NAMES } from './PxAnimatorUtil';\nimport { evaluateMotionPathSegment, propAnimIsMotionPath } from './PxMotionPath';\n\n\n// ============================================================================\n// PATH PARSING: Convert \"path(...)\" strings to PxBezierPath format\n// ============================================================================\n\ninterface PathCommand {\n type: string;\n values: Array<number>;\n}\n\n/**\n * Parses an SVG path string into command tokens.\n * Supports M, L, C, Z commands (case-insensitive).\n */\nfunction parsePathCommands(d: string): Array<PathCommand> {\n const tokens = d.split(/([MLCZmlcz]|[\\s,]+)/).map(t => t.trim()).filter(t => t && t !== ',');\n\n const commands: Array<PathCommand> = [];\n let currentCommand: PathCommand | null = null;\n\n for (const token of tokens) {\n if (/[MLCZmlcz]/.test(token)) {\n currentCommand = { type: token, values: [] };\n commands.push(currentCommand);\n } else if (currentCommand) {\n const value = +token;\n currentCommand.values.push(Number.isNaN(value) ? 0 : value);\n }\n }\n\n return commands;\n}\n\n/**\n * Parses an internal SVG path string into PxBezierPath array.\n * Handles M (moveto), L (lineto), C (curveto), Z (close) commands.\n */\nfunction parseSvgPathToBezier(d: string): Array<PxBezierPath> {\n const res: Array<PxBezierPath> = [];\n let currentPath: PxBezierPath | undefined;\n\n const commands = parsePathCommands(d);\n\n for (const command of commands) {\n const type = command.type;\n const values = command.values;\n\n if (type === 'M' || type === 'm') {\n const x = values[0] || 0;\n const y = values[1] || 0;\n currentPath = {\n v: [[x, y]],\n i: [[x, y]],\n o: [[x, y]],\n c: false\n };\n res.push(currentPath);\n continue;\n }\n\n // Ensure we have a current path\n if (!currentPath) {\n currentPath = {\n v: [[0, 0]],\n i: [[0, 0]],\n o: [[0, 0]],\n c: false\n };\n res.push(currentPath);\n }\n\n if (type === 'L') {\n const x = values[0] || 0;\n const y = values[1] || 0;\n currentPath.v.push([x, y]);\n currentPath.i!.push([x, y]);\n currentPath.o!.push([x, y]);\n\n } else if (type === 'C') {\n const outX = values[0] || 0;\n const outY = values[1] || 0;\n const inX2 = values[2] || 0;\n const inY2 = values[3] || 0;\n const x2 = values[4] || 0;\n const y2 = values[5] || 0;\n\n // Update out-point of previous vertex\n currentPath.o![currentPath.o!.length - 1] = [outX, outY];\n\n // Add new vertex with its in-point\n currentPath.v.push([x2, y2]);\n currentPath.i!.push([inX2, inY2]);\n currentPath.o!.push([x2, y2]);\n\n } else if (type === 'Z' || type === 'z') {\n currentPath.c = true;\n\n } else {\n console.warn('Unsupported path command \"' + type + '\"');\n }\n }\n\n return res;\n}\n\n/**\n * Extracts SVG path data from a string.\n * Handles both \"path(M...)\" wrapper format and raw \"M...\" format.\n * @returns The path data string, or undefined if not a valid path string\n */\nfunction extractPathData(str: string): string | undefined {\n if (str.startsWith('path(') && str.endsWith(')')) {\n return str.slice(5, -1); // Remove \"path(\" and \")\"\n }\n // Raw path string starting with a path command (M, m, or other commands)\n if (/^[MmZzLlHhVvCcSsQqTtAa]/.test(str)) {\n return str;\n }\n return undefined;\n}\n\n/**\n * Checks if the value is a path string (either \"path(...)\" or raw \"M...\").\n */\nfunction isPathString(value: any): value is string {\n return typeof value === 'string' && extractPathData(value) !== undefined;\n}\n\n/**\n * Normalizes a 'd' attribute value to { paths: PxBezierPath[] } format.\n * Handles:\n * - { path: \"M...\" } / { path: \"path(...)\" } -> { paths: [PxBezierPath] } (unified single-string form)\n * - { paths: [\"path(...)\"] } -> { paths: [PxBezierPath] }\n * - { paths: [\"M...\"] } -> { paths: [PxBezierPath] }\n * - [\"path(...)\"] -> { paths: [PxBezierPath] }\n * - [\"M...\"] -> { paths: [PxBezierPath] }\n * - \"path(...)\" -> { paths: [PxBezierPath] }\n * - \"M...\" -> { paths: [PxBezierPath] }\n * - { paths: [PxBezierPath] } -> as-is\n */\nfunction normalizePathValue(value: any): { paths: Array<PxBezierPath> } | any {\n // Unified single-string form: { path: \"M...\" } (compound = multiple `M…` sub-paths in one string).\n if (value && typeof value === 'object' && typeof value.path === 'string') {\n const d = extractPathData(value.path);\n return d ? { paths: parseSvgPathToBezier(d) } : value;\n }\n\n // If already in { paths: [...] } format\n if (value && typeof value === 'object' && 'paths' in value) {\n const pathsArray = value.paths;\n if (Array.isArray(pathsArray) && pathsArray.length > 0) {\n // Check if paths contain path strings that need parsing\n if (isPathString(pathsArray[0])) {\n const paths: Array<PxBezierPath> = [];\n for (const pathStr of pathsArray) {\n const d = extractPathData(pathStr);\n if (d) {\n paths.push(...parseSvgPathToBezier(d));\n }\n }\n return { paths };\n }\n }\n // Already in correct format\n return value;\n }\n\n // If it's an array of path strings\n if (Array.isArray(value)) {\n if (value.length > 0 && isPathString(value[0])) {\n const paths: Array<PxBezierPath> = [];\n for (const pathStr of value) {\n const d = extractPathData(pathStr);\n if (d) {\n paths.push(...parseSvgPathToBezier(d));\n }\n }\n return { paths };\n }\n // Already an array of PxBezierPath - wrap in { paths: }\n return { paths: value };\n }\n\n // If it's a single path string\n if (isPathString(value)) {\n const d = extractPathData(value)!;\n return { paths: parseSvgPathToBezier(d) };\n }\n\n return value;\n}\n\n\n// ============================================================================\n// NORMALIZATION: Convert new API format to internal normalized format\n// ============================================================================\n\n/**\n * Resolves an easing reference to a cubic-bezier array.\n * @param easing The easing reference (string name or bezier array)\n * @param defs The definitions containing named easings\n * @returns The resolved cubic-bezier array or undefined\n */\nfunction resolveEasing(\n easing: string | [number, number, number, number] | undefined,\n defs?: PxDefs\n): [number, number, number, number] | undefined {\n if (!easing) return undefined;\n\n if (Array.isArray(easing)) {\n return easing;\n }\n\n // Look up named easing in defs\n if (defs?.easings?.[easing]) {\n return defs.easings[easing];\n }\n\n // Unknown easing name - return undefined\n console.warn('Unknown easing name: ' + easing);\n return undefined;\n}\n\n/**\n * Resolves an animation reference to an AnimationDefinition.\n * @param animRef The animation reference (string name or inline definition)\n * @param defs The definitions containing named animations\n * @returns The resolved animation definition\n */\nfunction resolveAnimation(\n animRef: string | PxAnimationDefinition,\n defs?: PxDefs\n): PxAnimationDefinition | undefined {\n if (typeof animRef === 'string') {\n // Look up named animation in defs\n const resolved = defs?.animations?.[animRef];\n if (!resolved) {\n console.warn('Unknown animation name: ' + animRef);\n }\n return resolved;\n }\n\n // It's an inline definition\n return animRef;\n}\n\n/**\n * Resolves an element animation (which can be string, array, or inline) to an array of AnimationDefinitions.\n * @param animate The element animation specification\n * @param defs The definitions containing named animations\n * @returns Array of resolved animation definitions\n */\nfunction resolveElementAnimation(\n animate: PxElementAnimation | undefined,\n defs?: PxDefs\n): PxAnimationDefinition[] {\n if (!animate) return [];\n\n const results: PxAnimationDefinition[] = [];\n\n if (typeof animate === 'string') {\n const resolved = resolveAnimation(animate, defs);\n if (resolved) results.push(resolved);\n } else if (Array.isArray(animate)) {\n for (const item of animate) {\n const resolved = resolveAnimation(item, defs);\n if (resolved) results.push(resolved);\n }\n } else {\n // It's an inline AnimationDefinition\n results.push(animate);\n }\n\n return results;\n}\n\n// ============================================================================\n// LOOP EXPANSION: Duplicate keyframe segments to fill gaps in the timeline\n// ============================================================================\n\n/**\n * Interpolates between two keyframe values based on property type.\n * Returns the raw interpolated value (not a CSS string).\n */\nexport function interpolateValue(propName: string, a: any, b: any, t: number): any {\n if (propName === 'd') {\n const aPaths = a?.paths ?? (Array.isArray(a) ? a : []);\n const bPaths = b?.paths ?? (Array.isArray(b) ? b : []);\n return { paths: interpolateBeziers(aPaths, bPaths, t) };\n }\n if (COLOUR_ATTR_NAMES.has(propName)) {\n return interpolateColor(a || [0, 0, 0, 1], b || [0, 0, 0, 1], t);\n }\n if (TRANSFORM_FN_NAMES.has(propName) || propName === 'stroke-dasharray' || propName === 'strokeDasharray') {\n return interpolateVec(a || [], b || [], t);\n }\n return interpolateNum(+(a || 0), +(b || 0), t);\n}\n\ninterface LoopTemplateEntry {\n relT: number; // 0..1 relative position within segment\n v: any;\n e: [number, number, number, number] | undefined;\n}\n\n/**\n * Expands keyframes by repeating a segment to fill the gap between the keyframe\n * range and the global animation duration, implementing PxLoop \"local loop\" behavior.\n */\nfunction expandLoopKeyframes(\n propName: string,\n keyframes: PxKeyframe[],\n loop: PxLoop,\n duration: number\n): PxKeyframe[] {\n const totalIntervals = keyframes.length - 1;\n const segCount = clamp(loop.segmentCount ?? totalIntervals, 1, totalIntervals);\n\n // Extract segment keyframes\n let segKfs: PxKeyframe[];\n if (loop.before) {\n segKfs = keyframes.slice(0, segCount + 1);\n } else {\n segKfs = keyframes.slice(totalIntervals - segCount);\n }\n\n // Determine fill region\n const firstT = keyframes[0].t ?? 0;\n const lastT = keyframes[keyframes.length - 1].t ?? 0;\n\n let fillStart: number, fillEnd: number;\n if (loop.before) {\n fillStart = 0;\n fillEnd = firstT;\n } else {\n fillStart = lastT;\n fillEnd = duration;\n }\n\n const fillDuration = fillEnd - fillStart;\n if (fillDuration <= 0) return keyframes;\n\n // Segment timing\n const segStartT = segKfs[0].t ?? 0;\n const segEndT = segKfs[segKfs.length - 1].t ?? 0;\n const segDuration = segEndT - segStartT;\n if (segDuration <= 0) return keyframes;\n\n // Build template with relative offsets (0..1)\n const template: LoopTemplateEntry[] = segKfs.map(kf => ({\n relT: (kf.t! - segStartT) / segDuration,\n v: kf.v,\n e: kf.e as [number, number, number, number] | undefined\n }));\n\n const fullReps = Math.floor(fillDuration / segDuration);\n const remainder = fillDuration - fullReps * segDuration;\n const partialFraction = remainder / segDuration;\n\n const looped: PxKeyframe[] = [];\n\n // Helper: append one full or partial repetition\n function appendRep(repStart: number, isReversed: boolean, partial?: number) {\n let entries: LoopTemplateEntry[];\n if (isReversed) {\n // Reverse keyframe order and reverse easings\n entries = [];\n for (let i = template.length - 1; i >= 0; i--) {\n entries.push({\n relT: 1 - template[i].relT,\n v: template[i].v,\n // Easing for reversed transition: use reversed easing from the forward \"from\" keyframe\n e: i > 0 ? reverseEasing(template[i - 1].e) : undefined\n });\n }\n } else {\n entries = template;\n }\n\n const cutRelT = partial !== undefined ? partial : 1;\n\n for (let i = 0; i < entries.length; i++) {\n const entry = entries[i];\n if (entry.relT > cutRelT + 1e-9) {\n // Past the cut point — insert interpolated keyframe\n const prev = entries[i - 1];\n const intervalSpan = entry.relT - prev.relT;\n const localFrac = (cutRelT - prev.relT) / intervalSpan;\n\n // Apply easing to get the eased progress for value interpolation\n const easedFrac = prev.e ? cubicBezier(prev.e)(localFrac) : localFrac;\n const cutValue = interpolateValue(propName, prev.v, entry.v, easedFrac);\n\n // Split easing — use left portion for the truncated interval\n const { left: leftEasing } = splitEasing(prev.e, localFrac);\n\n // Update previous keyframe's easing to the left portion\n if (looped.length > 0 && prev.relT <= cutRelT) {\n looped[looped.length - 1].e = leftEasing;\n }\n\n looped.push({ t: repStart + cutRelT * segDuration, v: cutValue, e: undefined });\n return;\n }\n\n looped.push({\n t: repStart + entry.relT * segDuration,\n v: entry.v,\n e: i < entries.length - 1 ? entry.e : undefined\n });\n }\n }\n\n // Generate repetitions.\n // The rep closest to the original keyframes boundary must be reversed first\n // in pingpong mode (the animation just finished going forward, so the next\n // iteration goes backward). For loopOut, rep 0 is closest; for loopIn, reps\n // are laid out left-to-right so the last rep is closest.\n for (let rep = 0; rep < fullReps; rep++) {\n const distFromBoundary = loop.before ? fullReps - 1 - rep : rep;\n const isReversed = !!loop.alternate && (distFromBoundary % 2 === 0);\n const repStart = fillStart + rep * segDuration;\n appendRep(repStart, isReversed);\n }\n\n // Partial repetition\n if (partialFraction > 1e-9) {\n const isReversed = !!loop.alternate && (fullReps % 2 === 0);\n const repStart = fillStart + fullReps * segDuration;\n appendRep(repStart, isReversed, partialFraction);\n } \n\n // Assemble: looped keyframes go before or after the original keyframes.\n // No junction deduplication — cycle mode relies on value jumps at boundaries.\n if (loop.before) {\n return [...looped, ...keyframes];\n } else {\n return [...keyframes, ...looped];\n }\n}\n\n\n// ============================================================================\n// KEYFRAME NORMALIZATION\n// ============================================================================\n\n/**\n * Normalizes keyframes from the new API format (time in ms) to internal format (time as 0-1 fraction).\n * Resolves easing references, normalizes times, and converts path strings for 'd' attribute.\n * If a loop configuration is present, expands the keyframes to fill the global duration.\n * @param propName The property name (e.g., 'd' for path)\n * @param propAnim The property animation with keyframes\n * @param duration The total animation duration in ms\n * @param defs The definitions containing named easings\n * @returns Array of normalized keyframes (same structure, resolved refs, normalized times)\n */\nfunction normalizeKeyframes(\n propName: string,\n propAnim: PxPropertyAnimation,\n duration: number,\n defs?: PxDefs\n): PxKeyframe[] {\n const keyframes = propAnim.keyframes || propAnim.kfs || [];\n\n const normalized: PxKeyframe[] = [];\n\n for (const kf of keyframes) {\n const timePct = kf.time ?? kf.t ?? 0;\n let value = kf.value ?? kf.v;\n const easing = kf.easing ?? kf.e;\n\n // Normalize path values for 'd' attribute\n if (propName === 'd') {\n value = normalizePathValue(value);\n }\n\n // Normalize color values (hex/rgb/rgba strings to [0-1] vectors)\n if (COLOUR_ATTR_NAMES.has(propName)) {\n value = parseColor(value) ?? value;\n }\n\n normalized.push({\n t: timePct,\n v: value,\n e: resolveEasing(easing, defs)\n });\n }\n\n // Sort by time\n normalized.sort((a, b) => (a.t ?? 0) - (b.t ?? 0));\n\n // Expand loop if configured (loop:true is shorthand for default PxLoop)\n const loopRaw = propAnim.loop;\n const loop: PxLoop | undefined = loopRaw === true ? {} : loopRaw || undefined;\n if (loop && normalized.length >= 2) {\n return expandLoopKeyframes(propName, normalized, loop, duration);\n }\n\n return normalized;\n}\n\n/**\n * Merges multiple animation definitions into a single combined definition.\n * Later definitions override earlier ones for the same property.\n */\nfunction mergeAnimationDefinitions(\n animations: PxAnimationDefinition[]\n): PxAnimationDefinition {\n const merged: PxAnimationDefinition = {};\n\n for (const anim of animations) {\n for (const [prop, propAnim] of Object.entries(anim)) {\n merged[prop] = propAnim;\n }\n }\n\n return merged;\n}\n\n/**\n * Generates a unique element ID for internal tracking during DOM rendering.\n */\nlet _elementIdCounter = 0;\nexport function generateElementId(): string {\n return '_px_el_' + (++_elementIdCounter);\n}\n\n/**\n * Resets the element ID counter (useful for testing).\n */\nexport function resetElementIdCounter(): void {\n _elementIdCounter = 0;\n}\n\n/**\n * Normalizes an animation definition by resolving easing references and normalizing keyframe times.\n * Keeps the key/value mapping structure.\n */\nfunction normalizeAnimationDefinition(\n animDef: PxAnimationDefinition,\n duration: number,\n defs?: PxDefs\n): PxAnimationDefinition {\n const normalized: PxAnimationDefinition = {};\n\n for (const [propName, propAnim] of Object.entries(animDef)) {\n const normalizedKfs = normalizeKeyframes(propName, propAnim, duration, defs);\n if (normalizedKfs.length > 0) {\n normalized[propName] = { kfs: normalizedKfs };\n }\n }\n\n return normalized;\n}\n\n/**\n * Normalizes a PxAnimatedSvgDocument to a PxAnimatorConfig for the animation engines.\n * This is the main entry point for converting the new API format to internal format.\n * Resolves animation/easing references.\n */\nexport function getNormalisedBindings(doc: PxAnimatedSvgDocument): PxBinding[] {\n const animatorConfig = getAnimatorConfig(doc) || {};\n const defs = getDefs(doc);\n const duration = animatorConfig.duration || 1000; // FIXME - get rid of 1000 here\n\n const bindings: PxBinding[] = [];\n\n // Helper to resolve and normalize animation for a binding\n const processAnimation = (\n id: string,\n animate: PxElementAnimation | undefined\n ): PxBinding | null => {\n if (!animate) return null;\n\n const animDefs = resolveElementAnimation(animate, defs);\n if (animDefs.length === 0) return null;\n\n const merged = mergeAnimationDefinitions(animDefs);\n const normalizedAnim = normalizeAnimationDefinition(merged, duration, defs);\n\n if (Object.keys(normalizedAnim).length === 0) return null;\n\n return {\n id,\n animate: normalizedAnim\n };\n };\n\n // Process bindings (for pre-rendered DOM)\n const docBindings = getBindings(doc);\n if (docBindings) {\n for (const binding of docBindings) {\n const normalized = processAnimation(binding.id, binding.animate);\n if (normalized) bindings.push(normalized);\n }\n }\n\n // Process children (for rendered DOM).\n //\n // Per-element animations live under the node's `animate` bucket, keyed by\n // SVG/CSS property name — a PxAnimationDefinition (`{ transform: {keyframes},\n // fill: {keyframes}, … }`). The static initial value of each animated\n // property is carried separately as a plain attribute on the element body.\n // On-disk locations: top-level `node.animate` (JSON form).\n const processNode = (node: PxNode) => {\n const inlineAnim = node.animate;\n if (inlineAnim && Object.keys(inlineAnim).length > 0) {\n const nodeId = node.id || generateElementId();\n node.id = nodeId; // Ensure the node has an ID\n const normalized = processAnimation(nodeId, inlineAnim);\n if (normalized) bindings.push(normalized);\n }\n\n // Process children\n if (node.children) {\n for (let i = 0; i < node.children.length; i++) {\n processNode(node.children[i]);\n }\n }\n };\n\n // Process children of the root\n if (doc.children) {\n for (let i = 0; i < doc.children.length; i++) {\n processNode(doc.children[i]);\n }\n }\n\n return bindings;\n}\n\n\n// ============================================================================\n// ATTRIBUTE VALUE CALCULATION (used by frame loop animator)\n// ============================================================================\n\n/**\n * Finds prev/next keyframes for a given progress.\n */\nfunction getKeyframesPair(keyframes: PxKeyframe[], progress: number) {\n let prevKf = keyframes[0];\n let nextKf = keyframes[keyframes.length - 1];\n\n for (let j = 0; j < keyframes.length - 1; j++) {\n const aOff = (keyframes[j].t ?? 0);\n const bOff = (keyframes[j + 1].t ?? 0);\n if (aOff <= progress && progress <= bOff) {\n prevKf = keyframes[j];\n nextKf = keyframes[j + 1];\n break;\n }\n }\n return { prevKf, nextKf };\n}\n\n/**\n * Calculates interpolated value for a single property animation.\n */\nfunction calcPropertyValue(\n propName: string,\n propAnim: PxPropertyAnimation,\n progress: number\n): { k: string, v: string } | null {\n const keyframes = propAnim.kfs || propAnim.keyframes || [];\n if (keyframes.length === 0) return null;\n\n const { prevKf, nextKf } = getKeyframesPair(keyframes, progress);\n\n // remap to local 0..1 within prevKf..nextKf\n let localProgress = (prevKf === nextKf) ? 0 : remap(progress, prevKf.t ?? 0, nextKf.t ?? 0, 0, 1);\n localProgress = clamp(localProgress, 0, 1);\n const easing = prevKf.e ?? prevKf.easing; // e is on the source keyframe: applied from this KF to the next\n if (easing && Array.isArray(easing)) {\n try {\n localProgress = cubicBezier(easing as [number, number, number, number])(localProgress);\n } catch (e) {\n // fallback: ignore easing if parsing fails\n }\n }\n\n let cssAttrName = isCamelCaseWord(propName) ? camelCaseToKebabWordIfNeeded(propName) : propName;\n let cssValue: string | number | null = null;\n\n const prevV = prevKf?.v ?? prevKf?.value;\n const nextV = nextKf?.v ?? nextKf?.value;\n\n if (cssAttrName === 'd') {\n // Extract paths from { paths: [...] } format\n const prevPaths = prevV?.paths ?? (Array.isArray(prevV) ? prevV : []);\n const nextPaths = nextV?.paths ?? (Array.isArray(nextV) ? nextV : []);\n cssValue = interpolateBeziers(\n prevPaths,\n nextPaths,\n localProgress\n ).map(bz => bezierToSvgPath(bz)).join('');\n } else if (COLOUR_ATTR_NAMES.has(cssAttrName)) {\n cssValue = toRGBA(interpolateColor(\n prevV || [0, 0, 0, 1],\n nextV || [0, 0, 0, 1],\n localProgress\n ));\n cssAttrName = propName;\n } else if (cssAttrName === 'stroke-dasharray') {\n cssValue = interpolateVec(\n prevV || [],\n nextV || [],\n localProgress\n ).join(' ');\n cssAttrName = propName;\n } else if (\n cssAttrName === 'transform' &&\n prevV !== null && typeof prevV === 'object' && !Array.isArray(prevV)\n ) {\n // Unified transform: keyframe values are PxTransformParts records.\n // Interpolate each present part separately, then compose into a transform\n // string for the SVG `transform` attribute (no units).\n const partKeys = new Set<string>([\n ...(prevV ? Object.keys(prevV) : []),\n ...(nextV ? Object.keys(nextV) : []),\n ]);\n const partsResult: PxTransformParts = {};\n for (const partKey of partKeys) {\n const prevPart = prevV?.[partKey];\n const nextPart = nextV?.[partKey];\n if (partKey === 'rotate') {\n partsResult.rotate = interpolateNum(+(prevPart ?? 0), +(nextPart ?? 0), localProgress);\n } else if (partKey === 'translate' || partKey === 'scale' || partKey === 'origin') {\n const fallback = partKey === 'scale' ? [1, 1] : [0, 0];\n const interp = interpolateVec(prevPart || fallback, nextPart || fallback, localProgress);\n (partsResult as any)[partKey] = interp;\n }\n }\n // Motion-along-path override: when the animation carries tangents or\n // `autoOrient`, the translate part follows the 2D cubic Bezier defined\n // by `kf.tangentOut` / `next.tangentIn`, with arc-length parametrisation.\n // `autoOrient` injects a rotate derived from the curve tangent.\n if (propAnimIsMotionPath(propAnim)) {\n const prevTr = (prevV as any).translate;\n const nextTr = (nextV as any).translate;\n if (Array.isArray(prevTr) && Array.isArray(nextTr)) {\n const sample = evaluateMotionPathSegment(\n prevKf, nextKf,\n [+prevTr[0], +prevTr[1]],\n [+nextTr[0], +nextTr[1]],\n localProgress,\n !!propAnim.autoOrient,\n );\n partsResult.translate = [sample.translate[0], sample.translate[1]];\n if (sample.rotateDeg !== undefined) partsResult.rotate = sample.rotateDeg;\n }\n }\n cssValue = composeTransformParts(partsResult, { withUnits: false });\n cssAttrName = 'transform';\n } else if (cssAttrName === 'translate') {\n const v = interpolateVec(\n prevV || [0, 0],\n nextV || [0, 0],\n localProgress\n );\n cssValue = 'translate(' + v.join(',') + ')';\n cssAttrName = 'transform';\n } else if (cssAttrName === 'rotate') {\n const v = interpolateNum(\n +(prevV || 0),\n +(nextV || 0),\n localProgress\n );\n cssValue = 'rotate(' + v + ')';\n cssAttrName = 'transform';\n } else if (cssAttrName === 'scale') {\n const v = interpolateVec(\n prevV || [1, 1],\n nextV || [1, 1],\n localProgress\n );\n cssValue = 'scale(' + v.join(',') + ')';\n cssAttrName = 'transform';\n } else {\n // numeric attr\n const num = interpolateNum(\n +(prevV || 0),\n +(nextV || 0),\n localProgress\n );\n cssValue = num;\n }\n\n if (PCT_BASED_ATTR_NAMES.has(cssAttrName) && typeof cssValue === 'number') {\n cssValue = (cssValue * 100) + '%';\n }\n\n return { k: cssAttrName, v: cssValue === null ? '' : '' + cssValue };\n}\n\n/**\n * Calculates interpolated attribute values for an animation definition.\n * @param animDef The animation definition (with resolved refs and normalized times)\n * @param progress The current animation progress (0-1)\n * @returns Object with computed attribute name/value pairs\n */\nexport function calcAnimationValues(\n animDef: PxAnimationDefinition,\n progress: number\n): Record<string, string> {\n const result: Record<string, string> = {};\n\n for (const [propName, propAnim] of Object.entries(animDef)) { \n const computed = calcPropertyValue(propName, propAnim, progress);\n if (computed) {\n result[computed.k] = computed.v;\n }\n }\n\n return result;\n}\n","/*---------------------------------------------------------------------------------------\n * Copyright (c) Pixodesk LTD.\n * Licensed under the MIT License. See the LICENSE file in the project root for details.\n *---------------------------------------------------------------------------------------*/\n\nimport { setupAnimationTriggers } from './PxAnimatorTriggers';\nimport { getAnimatorConfig, type PxAnimatedSvgDocument, type PxAnimatorAPI, type PxAnimatorCallbacksConfig } from './PxAnimatorTypes';\nimport { camelCaseToKebabWordIfNeeded, clamp, DEFAULT_DURATION_MS, STYLE_ATTR_NAMES } from './PxAnimatorUtil';\nimport { calcAnimationValues, getNormalisedBindings } from './PxDefinitions';\n\n\n/**\n * Platform adapter interface for abstracting DOM-specific operations.\n */\nexport interface PxPlatformAdapter {\n\n /** Check if the root element is still connected/mounted */\n isConnected(): boolean;\n\n /** Set an attribute on an element by id */\n setAttribute(id: string, attrName: string, value: string): void;\n}\n\nexport function getSelector(id: string) {\n // return `[data-px-id=\"${id}\"]`; FIXME\n return '#' + id;\n}\n\n\n/**\n * Creates an animator instance that uses a frame loop for animations.\n * This is the abstract/platform-agnostic version.\n *\n * @param adapter Platform adapter for DOM/environment operations.\n * @param callbacks Optional lifecycle callbacks.\n * @returns A PxAnimatorAPI instance.\n */\nexport function createBasicFrameLoopAnimator(\n doc: PxAnimatedSvgDocument,\n adapter: PxPlatformAdapter,\n callbacks?: PxAnimatorCallbacksConfig\n): PxAnimatorAPI {\n\n const config = getAnimatorConfig(doc) || {};\n\n const bindings = getNormalisedBindings(doc);\n\n // iterations: either number or Infinity\n const _iterations = config.iterations;\n let iterations: number = 1;\n if (typeof _iterations === 'number') iterations = _iterations || 1;\n if (_iterations === 'infinite') iterations = Infinity;\n if (iterations < 1) iterations = 1;\n\n const duration = +(config.duration || DEFAULT_DURATION_MS); // per-iteration duration (ms), cannot be 0!\n const totalDuration = duration && iterations ?\n duration * (iterations === Infinity ? Infinity : iterations) :\n (duration ? (iterations ?? 1) * duration : 0);\n\n // direction handling\n const direction = config.direction || 'normal'; // 'normal' | 'reverse' | 'alternate' | 'alternate-reverse'\n\n ////////////////////////////////////////////////////////////////\n\n let timerId: number | null = null;\n let playing = false;\n\n let timeBeforeLastStartMs = (config.delay || 0); // accumulated time before current run (ms)\n let lastStartedTs = 0; // timestamp when last started/resumed\n let playbackRate = 1;\n\n let finishCalled = false; // ensures onFinish called once\n\n // Frame rate throttling\n const frameRate = config.frameRate;\n const minFrameIntervalMs = frameRate && frameRate > 0 ? 1000 / frameRate : 0;\n let lastRenderTs = 0; // timestamp of last render\n\n const getAnimCurrentTime = () => {\n // compute effective elapsed time (ms), taking playbackRate into account\n const runningElapsed = lastStartedTs ? (Date.now() - lastStartedTs) * playbackRate : 0;\n let time = timeBeforeLastStartMs + runningElapsed;\n\n // clamp to totalDuration if finite\n if (Number.isFinite(totalDuration) && time > (totalDuration as number)) time = totalDuration as number;\n if (time < 0) time = 0;\n return time;\n };\n\n\n ////////////////////////////////////////////////////////////////\n\n\n // separate render function that uses a given currentTime (ms)\n function renderFrame(currentTimeMs: number) {\n\n function getEffectiveProgress() {\n // If no duration or duration === 0, set iteration/progress accordingly\n const safeDuration = duration > 0 ? duration : 1; // avoid division by zero\n\n let rawProgress = 0;\n let iteration = 0;\n if (duration > 0) {\n\n // rawProgress is normalized progress within the current iteration:\n // - first iteration: [0 .. 1]\n // - following iterations: (0 .. 1]\n //\n // iteration is the zero-based iteration index\n //\n // Examples (safeDuration = 3):\n // currentTimeMs = 0 → rawProgress = 0 , iteration = 0\n // currentTimeMs = 3 → rawProgress = 1 , iteration = 0\n // currentTimeMs = 3.0001 → rawProgress = 0.0001 , iteration = 1\n\n currentTimeMs = clamp(currentTimeMs, 0, iterations * safeDuration);\n\n iteration = Math.max(0, Math.ceil(currentTimeMs / safeDuration) - 1);\n iteration = Math.min(iteration, iterations - 1);\n\n // Time elapsed since the start of the current iteration\n const iterationTime = currentTimeMs - iteration * safeDuration;\n\n // Normalized progress (preserves fractional overflow after boundaries)\n rawProgress = clamp(iterationTime / safeDuration, 0, 1);\n } else {\n rawProgress = currentTimeMs; // We shouldn't be here\n }\n\n\n // compute per-iteration directional progress\n // start with baseProgress = rawProgress in [0,1)\n\n let baseProgress = rawProgress;\n // apply direction rules:\n // - normal: as is\n // - reverse: progress = 1 - baseProgress\n // - alternate: reverse on odd iterations\n // - alternate-reverse: reverse on even iterations\n const dir = direction || 'normal';\n let effectiveProgress = baseProgress;\n if (dir === 'reverse') {\n effectiveProgress = 1 - baseProgress;\n } else if (dir === 'alternate') {\n if (iteration % 2 === 1) effectiveProgress = 1 - baseProgress;\n } else if (dir === 'alternate-reverse') {\n // alternate-reverse: start reversed on iteration 0\n if (iteration % 2 === 0) effectiveProgress = 1 - baseProgress;\n } // else 'normal' -> keep\n return effectiveProgress;\n }\n let effectiveProgress = getEffectiveProgress(); // else 'normal' -> keep\n\n ////////////////////////////////////////////////////////////////\n\n // FIXME - pre-calc defs, then use\n\n for (const binding of bindings || []) {\n const animDef = binding.animate;\n if (!animDef || typeof animDef !== 'object' || Array.isArray(animDef)) {\n console.warn('Empty or unresolved binding', binding);\n continue;\n }\n\n // Calculate interpolated values for this binding's animation\n const computedValues = calcAnimationValues(animDef, effectiveProgress * duration);\n\n // Apply each computed attribute\n for (const [attrName, value] of Object.entries(computedValues)) {\n adapter.setAttribute(binding.id, attrName, value);\n }\n }\n }\n\n\n ////////////////////////////////////////////////////////////////\n\n const tick = () => {\n\n // if root element provided and detached, stop\n if (!adapter.isConnected()) {\n // stop animation loop (we'll let external code call play/resume)\n // do not call onFinish here. It's a detach situation.\n pauseAnim();\n return;\n }\n\n const currentTime = getAnimCurrentTime();\n\n // Frame rate throttling: skip render if not enough time has passed\n if (minFrameIntervalMs > 0) {\n const now = Date.now();\n if (lastRenderTs && (now - lastRenderTs) < minFrameIntervalMs) {\n // Not enough time elapsed, skip this frame but continue the loop\n return;\n }\n lastRenderTs = now;\n }\n\n // If animation duration is zero or iterations zero, apply final or initial frames depending\n // duration=0 handling: treat as progress 0 and iteration 0, but if totalDuration === 0 and iterations>0, consider finished.\n if (duration <= 0) {\n // Apply initial keyframe or final depending on configuration.\n // We'll treat it as single-frame animation: apply keyframes with progress 0, then finish.\n // loop through animations and apply first keyframe (progress=0)\n }\n\n // Detect finished (natural end)\n if (totalDuration && Number.isFinite(totalDuration) && currentTime >= (totalDuration as number)) {\n // render final frame at the very end and then stop\n renderFrame(totalDuration);\n // call onFinish once\n if (!finishCalled) {\n finishCalled = true;\n callbacks?.onFinish?.();\n }\n pauseAnim();\n return;\n }\n\n // Otherwise render normal frame\n renderFrame(currentTime);\n };\n\n\n ////////////////////////////////////////////////////////////////\n\n\n if (config.delay) {\n // If startTime provided, we start paused but with that offset; render first frame.\n renderFrame(getAnimCurrentTime());\n }\n\n ////////////////////////////////////////////////////////////////\n\n const _isPlaying = () => {\n if (!playing) return false;\n if (!adapter.isConnected()) { return false; }\n if (Number.isFinite(totalDuration) && getAnimCurrentTime() >= (totalDuration as number)) return false;\n return true;\n };\n\n const loopAnim = (isFirst?: boolean) => {\n if (timerId !== null) {\n cancelAnimationFrame(timerId);\n timerId = null;\n }\n\n if (!(isFirst || _isPlaying())) {\n // finished or not playing\n return;\n }\n\n timerId = requestAnimationFrame(() => {\n timerId = null;\n tick();\n loopAnim();\n });\n };\n\n const startAnim = () => {\n if (playing) return;\n playing = true;\n lastStartedTs = Date.now();\n loopAnim(true);\n };\n\n const pauseAnim = () => {\n if (!playing) return;\n // capture current time\n timeBeforeLastStartMs = getAnimCurrentTime();\n lastStartedTs = 0;\n playing = false;\n\n if (timerId !== null) {\n cancelAnimationFrame(timerId);\n timerId = null;\n }\n // render a final frame at the paused time to ensure DOM consistent\n renderFrame(timeBeforeLastStartMs);\n };\n\n const cancelAnim = () => {\n pauseAnim();\n\n timeBeforeLastStartMs = 0;\n lastStartedTs = 0;\n playing = false;\n finishCalled = false;\n\n renderFrame(timeBeforeLastStartMs);\n\n callbacks?.onCancel?.();\n };\n\n const finishAnim = (callOnFinish = true) => {\n // jump to the end\n if (Number.isFinite(totalDuration)) {\n timeBeforeLastStartMs = totalDuration as number;\n } else {\n // infinity animations: set to current time (no-op)\n timeBeforeLastStartMs = getAnimCurrentTime();\n }\n lastStartedTs = 0;\n playing = false;\n // render final frame\n renderFrame(timeBeforeLastStartMs);\n\n if (callOnFinish && !finishCalled) {\n finishCalled = true;\n callbacks?.onFinish?.();\n }\n };\n\n ////////////////////////////////////////////////////////////////\n\n const api: PxAnimatorAPI = {\n\n \"isReady\": () => true,\n\n \"getRootElement\": () => null,\n\n \"isPlaying\": (): boolean => { return _isPlaying(); },\n\n \"play\": () => {\n startAnim();\n callbacks?.onPlay?.();\n },\n \"pause\": () => {\n pauseAnim();\n callbacks?.onPause?.();\n },\n \"cancel\": () => {\n cancelAnim();\n // onCancel already called in cancelAnim\n },\n \"finish\": () => {\n finishAnim(true);\n },\n\n \"setPlaybackRate\": (rate: number) => {\n if (!isFinite(rate) || rate === 0) {\n console.warn('setPlaybackRate: rate must be finite and non-zero');\n return;\n }\n // preserve current logical time when changing rate\n const current = getAnimCurrentTime();\n playbackRate = rate;\n timeBeforeLastStartMs = current;\n if (playing) lastStartedTs = Date.now();\n },\n\n \"getCurrentTime\": (): number | null => { return getAnimCurrentTime(); },\n\n \"setCurrentTime\": (newTime: number) => {\n // clamp newTime\n if (newTime < 0) newTime = 0;\n if (Number.isFinite(totalDuration) && newTime > (totalDuration as number)) newTime = totalDuration as number;\n\n timeBeforeLastStartMs = newTime;\n if (playing) lastStartedTs = Date.now();\n // render immediately to reflect the change\n renderFrame(getAnimCurrentTime());\n },\n\n \"destroy\": () => { api.cancel(); }\n };\n\n ////////////////////////////////////////////////////////////////\n\n return api;\n}\n\n\n////////////////////////////////////////////////////////////////\n// Browser DOM implementation\n////////////////////////////////////////////////////////////////\n\n\n\n/**\n * Creates an animator instance that uses a requestAnimationFrame loop for animations.\n * This is the browser DOM-specific version.\n *\n * @param {PxAnimatorCallbacksConfig=} callbacks Optional lifecycle callbacks.\n * @param {Element=} rootElement Optional pre-rendered root element.\n * @returns {PxAnimatorAPI} A PxAnimatorAPI instance.\n */\nexport function createFrameLoopAnimator(\n doc: PxAnimatedSvgDocument,\n adapter?: PxPlatformAdapter,\n callbacks?: PxAnimatorCallbacksConfig,\n rootElement?: Element | null\n): PxAnimatorAPI {\n\n const config = getAnimatorConfig(doc) || {};\n\n // Use provided root element or try to find by selector\n if (!rootElement) {\n if (doc.id) {\n const rootSelector = getSelector(doc.id);\n rootElement = document.querySelector(rootSelector);\n if (!rootElement) console.warn(\"createFrameLoopAnimator: No root element found for selector: \", rootSelector);\n } else {\n console.warn(\"createFrameLoopAnimator: No root element provided\");\n }\n }\n\n let api = createBasicFrameLoopAnimator(\n doc, \n adapter || createDomAdapter(rootElement), \n callbacks\n );\n\n api = {\n ...api,\n \"getRootElement\": () => rootElement || null\n };\n if (config.trigger) setupAnimationTriggers(api, config.trigger);\n return api;\n}\n\nexport function createDomAdapter(rootElement?: Element | null) {\n // Track warnings to avoid spamming console\n const warnedSelectors = new Set<string>();\n\n const adapter: PxPlatformAdapter = {\n isConnected: () => {\n if (!rootElement) return true; // No root element means we're always \"connected\"\n return rootElement.isConnected;\n },\n setAttribute: (id, attrName, value) => {\n\n attrName = camelCaseToKebabWordIfNeeded(attrName);\n\n const selector = getSelector(id);\n\n // Query elements by selector within root (or document if no root)\n const elements = rootElement?.querySelectorAll(selector) || document.querySelectorAll(selector);\n\n if (elements.length === 0 && !warnedSelectors.has(selector)) {\n warnedSelectors.add(selector);\n console.warn('setAttribute: No elements found for selector \"' + selector + '\"');\n }\n\n for (let i = 0; i < elements.length; i++) {\n const element = elements[i];\n element.setAttribute(attrName, value);\n if (STYLE_ATTR_NAMES.has(attrName)) {\n (element as HTMLElement).style[attrName as any] = value;\n }\n }\n },\n };\n return adapter;\n}","/*---------------------------------------------------------------------------------------\n * Copyright (c) Pixodesk LTD.\n * Licensed under the MIT License. See the LICENSE file in the project root for details.\n *---------------------------------------------------------------------------------------*/\n\nimport { getSelector } from './PxAnimatorFrameLoop';\nimport { setupAnimationTriggers } from './PxAnimatorTriggers';\nimport { getAnimatorConfig, PxAnimatedSvgDocument, PxAnimatorConfig, PxKeyframe, type PxAnimationDefinition, type PxAnimatorAPI, type PxAnimatorCallbacksConfig } from './PxAnimatorTypes';\nimport { clamp, COLOUR_ATTR_NAMES, composeTransformParts, cubicBezier, kebabToCamelCaseWord, splitEasing, toRGBA, TRANSFORM_FN_NAMES } from './PxAnimatorUtil';\nimport { getNormalisedBindings, interpolateValue } from './PxDefinitions';\n\n\n/**\n * Converts a single PxKeyframe into a Web Animations API Keyframe object.\n *\n * Handles three categories of CSS property:\n * - **Colour attributes** (e.g. fill, stroke): array values are converted to an rgba() string.\n * - **Transform functions** (e.g. translate, rotate, scale): values are formatted as a\n * CSS transform function string and mapped to the transform property.\n * - **All other properties**: the value is coerced to a string as-is.\n *\n * If the resulting (cssKey, cssValue) pair is not supported by the browser (CSS.supports returns\n * false), cssKey is added to unsupportedSet so the caller can decide whether to fall back to the\n * frame-loop animator.\n */\nfunction createCssKf(kf: PxKeyframe, t: number, propName: string, unsupportedSet: Set<string>) {\n let value = kf.v ?? kf.value;\n const e = kf.e ?? kf.easing; // e is on the source keyframe: applied from this KF to the next (matches WAAPI easing convention)\n\n const cssKf: Keyframe = {\n offset: t,\n easing: e && Array.isArray(e) ? \"cubic-bezier(\" + e.join(',') + \")\" : undefined\n };\n\n let cssValue: any;\n let cssKey = propName;\n\n if (COLOUR_ATTR_NAMES.has(propName) && Array.isArray(value)) {\n cssValue = toRGBA(value);\n } else if (propName === 'transform' && value !== null && typeof value === 'object' && !Array.isArray(value)) {\n // Unified transform: keyframe value is a parts record (PxTransformParts).\n // Compose all present parts into one CSS transform string.\n cssValue = composeTransformParts(value, { withUnits: true });\n cssKey = 'transform';\n } else if (TRANSFORM_FN_NAMES.has(propName)) {\n if (Array.isArray(value)) {\n if (propName === 'translate') value = value.map(v => v + 'px');\n value = value.join(',');\n }\n if (propName === 'rotate') value = value + 'deg';\n cssValue = propName + '(' + value + ')';\n cssKey = 'transform';\n } else {\n cssValue = '' + value;\n }\n\n if (!CSS.supports(cssKey, cssValue)) unsupportedSet.add(cssKey);\n\n cssKey = kebabToCamelCaseWord(cssKey);\n cssKf[cssKey] = cssValue;\n return cssKf;\n}\n\n/**\n * Clips keyframes to the [0, duration] range.\n * If a keyframe pair straddles a boundary (t=0 or t=duration), inserts an interpolated\n * keyframe at the boundary with the correct value and split easing, so WAAPI sees\n * exact start/end values rather than out-of-range ones.\n */\nfunction clipKeyframesToDuration(\n propName: string,\n keyframes: PxKeyframe[],\n duration: number\n): PxKeyframe[] {\n const result: PxKeyframe[] = [];\n\n for (let i = 0; i < keyframes.length; i++) {\n const kf = keyframes[i];\n const t = kf.t ?? 0;\n\n if (t < 0) {\n // If the next keyframe is in range, interpolate value at t=0\n const next = keyframes[i + 1];\n if (next && (next.t ?? 0) >= 0) {\n const nextT = next.t ?? 0;\n const localFrac = (0 - t) / (nextT - t);\n const easedFrac = kf.e ? cubicBezier(kf.e as [number, number, number, number])(localFrac) : localFrac;\n const { right: rightEasing } = splitEasing(kf.e as any, localFrac);\n result.push({ t: 0, v: interpolateValue(propName, kf.v, next.v, easedFrac), e: rightEasing });\n }\n continue;\n }\n\n if (t > duration) {\n // If the previous keyframe was in range, interpolate value at t=duration\n const prev = keyframes[i - 1];\n if (prev && (prev.t ?? 0) <= duration) {\n const prevT = prev.t ?? 0;\n const localFrac = (duration - prevT) / (t - prevT);\n const easedFrac = prev.e ? cubicBezier(prev.e as [number, number, number, number])(localFrac) : localFrac;\n const { left: leftEasing } = splitEasing(prev.e as any, localFrac);\n if (result.length > 0) result[result.length - 1] = { ...result[result.length - 1], e: leftEasing };\n result.push({ t: duration, v: interpolateValue(propName, prev.v, kf.v, easedFrac), e: undefined });\n }\n break;\n }\n\n result.push(kf);\n }\n\n return result;\n}\n\n/**\n * Converts a PxAnimationDefinition into a map of Web Animations API Keyframe arrays, one per\n * animated property.\n *\n * For each property in the definition the function:\n * 1. Clips keyframes to [0, duration], interpolating boundary values when a pair straddles an edge.\n * 2. Normalises keyframe time values to the [0, 1] offset range (time / duration).\n * 3. Delegates CSS value conversion to createCssKf.\n * 4. Ensures the keyframe sequence always starts at offset: 0 and ends at offset: 1 — a\n * requirement of the Web Animations API for correct looping behaviour. If the first keyframe\n * starts after 0 or the last keyframe ends before 1, a copy of that keyframe is inserted at the\n * boundary with the adjusted offset.\n */\nfunction convertToWebApiKeyframes(\n animDef: PxAnimationDefinition,\n unsupportedSet: Set<string>,\n config: PxAnimatorConfig\n): Map<string, Keyframe[]> {\n const result = new Map<string, Keyframe[]>();\n\n for (const [propName, propAnim] of Object.entries(animDef)) {\n const duration = config.duration || 1;\n const clippedKeyframes = clipKeyframesToDuration(propName, propAnim.kfs || propAnim.keyframes || [], duration);\n const cssKeyframes: Keyframe[] = [];\n\n for (let i = 0; i < clippedKeyframes.length; i++) {\n const kf = clippedKeyframes[i];\n\n const t = clamp((kf.t ?? 0) / duration, 0, 1);\n const cssKf: Keyframe = createCssKf(kf, t, propName, unsupportedSet);\n\n // Keyframes need to start with offset:0 to work correctly with loops\n if (i === 0 && (cssKf.offset || 0) > 0) {\n cssKeyframes.push({ ...cssKf, offset: 0 });\n }\n\n cssKeyframes.push(cssKf);\n }\n\n // Keyframes need to end with offset:1 to work correctly with loops\n if (cssKeyframes.length > 0 && (cssKeyframes[cssKeyframes.length - 1].offset || 0) < 1) {\n cssKeyframes.push({\n ...cssKeyframes[cssKeyframes.length - 1],\n offset: 1\n });\n }\n\n if (cssKeyframes.length > 0) {\n result.set(propName, cssKeyframes);\n }\n }\n\n return result;\n}\n\n/**\n * Creates an animator instance that uses the native Web Animations API.\n *\n * This is the preferred, more performant animator. It will return null if the\n * animation configuration contains properties not supported by the browser's\n * Web Animations API implementation, unless forceEvenIfHasUnsupportedAttrs is true.\n *\n * @param callbacks Optional lifecycle callbacks.\n * @param rootElement Root element.\n * @param forceEvenIfHasUnsupportedAttrs If true, an animator will be created even if some CSS properties are not supported.\n * @returns An PxAnimatorAPI instance, or null if unsupported features are used and not forced.\n */\nexport function createWebApiAnimator(\n doc: PxAnimatedSvgDocument,\n callbacks?: PxAnimatorCallbacksConfig,\n rootElement?: Element | null,\n forceEvenIfHasUnsupportedAttrs?: boolean\n): PxAnimatorAPI | null {\n\n const config = getAnimatorConfig(doc) || {};\n\n const bindings = getNormalisedBindings(doc);\n\n // Use provided root element or try to find by selector\n if (!rootElement) {\n if (doc.id) {\n const rootSelector = getSelector(doc.id);\n rootElement = document.querySelector(rootSelector);\n if (!rootElement) console.warn(\"createFrameLoopAnimator: No root element found for selector: \", rootSelector);\n } else {\n console.warn(\"createFrameLoopAnimator: No root element provided\");\n }\n }\n\n const animations: Array<Animation> = [];\n\n const _iterations = config.iterations;\n let iterations: number | undefined;\n if (typeof _iterations === 'number') iterations = _iterations;\n if (_iterations === 'infinite') iterations = Infinity;\n\n const unsupportedSet = new Set<string>();\n\n ////////////////////////////////////////////////////////////////\n\n // Warn if no bindings defined\n if (!bindings?.length) {\n console.warn('createWebApiAnimator: No animation bindings defined');\n }\n\n for (const binding of bindings || []) {\n const animDef = binding.animate;\n if (!animDef || typeof animDef !== 'object' || Array.isArray(animDef)) {\n console.warn('createWebApiAnimator: Empty or unresolved binding', binding);\n continue;\n }\n\n const selector = getSelector(binding.id);\n\n // Use CSS selector to find elements\n const elements = rootElement?.querySelectorAll(selector) || document.querySelectorAll(selector);\n\n if (elements.length === 0) {\n console.warn('createWebApiAnimator: No elements found for selector \"' + selector + '\"');\n }\n\n // Convert animation definition to Web API keyframes\n const keyframesMap = convertToWebApiKeyframes(animDef, unsupportedSet, config);\n\n\n // Delay handling:\n // - Positive delay (e.g., 500): Wait before starting → use delay option\n // - Negative delay (e.g., -500): Start mid-animation → use currentTime to seek\n // (Web Animations API doesn't reliably support negative delay values)\n // - Negative delay is wrapped to duration (e.g., -5000 with duration 2000 → seek to 1000)\n const positiveDelay = config.delay && config.delay > 0 ? config.delay : undefined;\n const seekPosition = config.delay && config.delay < 0 && config.duration\n ? (-config.delay) % config.duration\n : undefined;\n\n const effectOptions: KeyframeEffectOptions = {\n duration: config.duration,\n delay: positiveDelay,\n // Default to 'forwards' so elements hold their final state after the\n // animation ends — consistent with Lottie and other animation runtimes.\n // Without this, seeking to the last frame reverts elements to their\n // pre-animation state (the Web Animations API \"after\" phase with fill:'none').\n fill: config.fill ?? 'forwards',\n direction: config.direction,\n iterations: iterations\n };\n\n for (let i = 0; i < elements.length; i++) {\n const element = elements[i];\n\n for (const [, keyframes] of keyframesMap) {\n if (keyframes.length > 0) {\n try {\n const effect = new KeyframeEffect(element, keyframes, effectOptions);\n const anim = new Animation(effect, document.timeline);\n\n if (callbacks?.onFinish) anim.onfinish = () => callbacks.onFinish?.();\n if (callbacks?.onRemove) anim.onremove = () => callbacks.onRemove?.();\n\n // Seek forward for negative delay (e.g., delay=-500 → seek to 500ms)\n if (seekPosition) {\n anim.currentTime = seekPosition;\n }\n\n animations.push(anim);\n } catch (e) {\n console.warn(e);\n }\n }\n }\n }\n }\n\n ////////////////////////////////////////////////////////////////\n\n if (!forceEvenIfHasUnsupportedAttrs && unsupportedSet.size) {\n console.warn('Unsupported CSS attrs: ' + [...unsupportedSet].join(', '));\n return null;\n }\n\n ////////////////////////////////////////////////////////////////\n\n const api: PxAnimatorAPI = {\n\n \"isReady\": () => true,\n\n \"getRootElement\": () => rootElement || null,\n\n \"isPlaying\": (): boolean => { return animations[0]?.playState === 'running'; },\n\n \"play\": () => {\n animations.forEach(a => a.play());\n callbacks?.onPlay?.();\n },\n \"pause\": () => {\n animations.forEach(a => a.pause());\n callbacks?.onPause?.();\n },\n \"cancel\": () => {\n animations.forEach(a => a.cancel());\n callbacks?.onCancel?.(); // FIXME onFinished needs to be called when animation finishes, e.g. from animations, and some flag that it was triggered by user\n },\n \"finish\": () => {\n for (const a of animations) {\n try {\n if (a.effect?.getTiming().iterations === Infinity) {\n a.effect.updateTiming({ iterations: 1 });\n a.finish();\n a.effect.updateTiming({ iterations: Infinity });\n } else {\n a.finish();\n }\n } catch (e) {\n a.cancel();\n }\n }\n // FIXME onFinished needs to be called when animation finishes, e.g. from animations, not only when you call finish manually\n },\n\n \"setPlaybackRate\": (rate: number) => {\n animations.forEach(a => (a.playbackRate = rate));\n return api;\n },\n \"getCurrentTime\": (): number | null => {\n const res = animations[0]?.currentTime ?? null;\n return res !== null ? +res : null;\n },\n \"setCurrentTime\": (time: number) => {\n animations.forEach(a => {\n a.currentTime = time;\n });\n },\n\n \"destroy\": () => {\n api.cancel();\n animations.splice(0, animations.length);\n }\n };\n\n ////////////////////////////////////////////////////////////////\n\n if (config.trigger) {\n setupAnimationTriggers(api, config.trigger);\n }\n\n return api;\n}\n","/*---------------------------------------------------------------------------------------\n * Copyright (c) Pixodesk LTD.\n * Licensed under the MIT License. See the LICENSE file in the project root for details.\n *---------------------------------------------------------------------------------------*/\n\nimport { applyPlayerEffects } from './effects/PlayerEffectsUtil';\nimport { renderNode } from './PxAnimatorDOM';\nimport { createFrameLoopAnimator, PxPlatformAdapter } from './PxAnimatorFrameLoop';\nimport { setupAnimationTriggers } from './PxAnimatorTriggers';\nimport { getAnimatorConfig, isPxElementFileFormat, PX_ANIM_ATTR_NAME, PX_ANIM_SRC_ATTR_NAME, validateNodeEffects, type PxAnimatedSvgDocument, type PxAnimatorAPI, type PxAnimatorCallbacksConfig } from './PxAnimatorTypes';\nimport { createWebApiAnimator } from './PxAnimatorWebApi';\n\n\n/**\n * Creates an animator instance from a normalized player config.\n * This is the internal implementation that both engines use.\n */\nfunction createAnimatorFromConfig(\n doc: PxAnimatedSvgDocument,\n adapter?: PxPlatformAdapter,\n callbacks?: PxAnimatorCallbacksConfig,\n rootElement?: Element | null\n): PxAnimatorAPI {\n\n const animatorConfig = getAnimatorConfig(doc) || {};\n\n let res: PxAnimatorAPI;\n if (animatorConfig.mode === 'frames') {\n // Forcing \"frames\", even if \"webapi\" can be used\n res = createFrameLoopAnimator(doc, adapter, callbacks, rootElement);\n } else {\n // Trying \"webapi\" first\n res = (\n createWebApiAnimator(doc, callbacks, rootElement,\n animatorConfig.mode === 'webapi' // Forcing \"webapi\"\n ) ||\n createFrameLoopAnimator(doc, adapter, callbacks, rootElement) // \"webapi\" has unsupported attrs and wasn't forced, returned null, fallback to \"frames\"\n );\n }\n\n if (animatorConfig.debugInstName) {\n (window as any)[animatorConfig.debugInstName] = res; // Exposing as global variable for debug\n }\n\n return res;\n}\n\n\n/**\n * Generates a unique ID with a random suffix.\n * Format: _px_{random base36 string}\n */\nlet _idCounter = 0;\nfunction generateUniqueId(): string {\n const timestamp = Date.now().toString(36);\n const counter = (++_idCounter).toString(36);\n const random = Math.random().toString(36).substring(2, 6);\n return '_px_' + timestamp + counter + random;\n}\n\n/**\n * Deep clones a JSON-like value (objects, arrays, primitives).\n * Does not handle special types like Date, Map, Set, functions, etc.\n */\nfunction deepClone<T>(value: T): T {\n if (value === null || typeof value !== 'object') return value;\n if (Array.isArray(value)) return value.map(item => deepClone(item)) as T;\n\n const obj = value as Record<string, unknown>;\n\n const cloned: Record<string, unknown> = {};\n for (const key of Object.keys(obj)) {\n cloned[key] = deepClone(obj[key]);\n }\n return cloned as T;\n}\n\n/**\n * Regenerates all IDs in the document and updates references.\n *\n * This function:\n * 1. Deep clones the document to avoid mutating the original\n * 2. Traverses all nodes and regenerates IDs, keeping a mapping of old → new\n * 3. Updates all references to old IDs in attributes:\n * - Hash references: \"#old-id\" → \"#new-id\" (href, xlink:href)\n * - URL references: \"url(#old-id)\" → \"url(#new-id)\" (fill, clip-path, mask, marker, etc.)\n * - Style URL references: { offsetPath: \"url(#old-id)\" }\n *\n * @param doc - The animated SVG document to process\n * @returns A new document with regenerated IDs\n */\nexport function generateNewIds(doc: PxAnimatedSvgDocument): PxAnimatedSvgDocument {\n // Deep clone the document\n const cloned: PxAnimatedSvgDocument = deepClone(doc);\n\n // Map of old ID → new ID\n const idMap = new Map<string, string>();\n\n // Attributes that contain hash references (#id)\n const hashRefAttrs = new Set(['href', 'xlink:href']);\n\n // Attributes that contain url(#id) references\n const urlRefAttrs = new Set([\n 'fill', 'stroke', 'clip-path', 'clipPath', 'mask',\n 'marker', 'marker-start', 'marker-mid', 'marker-end',\n 'filter', 'flood-color', 'lighting-color'\n ]);\n\n // Attributes that contain direct ID references (no # or url())\n const directIdRefAttrs = new Set(['baseId', 'targetId', 'boundElementId']);\n\n // Phase 1: Collect all IDs and generate new ones\n function collectIds(node: any): void {\n if (!node || typeof node !== 'object') return;\n\n if (node.id && typeof node.id === 'string') {\n const oldId = node.id;\n const newId = generateUniqueId();\n idMap.set(oldId, newId);\n node.id = newId;\n } else if (node.animate) {\n // An animated node needs an id so the animation can bind to its rendered element.\n node.id = generateUniqueId();\n }\n\n // Process children\n if (Array.isArray(node.children)) {\n for (const child of node.children) {\n collectIds(child);\n }\n }\n }\n\n // Phase 2: Update all references to old IDs\n function updateRefs(node: any): void {\n if (!node || typeof node !== 'object') return;\n\n for (const [key, value] of Object.entries(node)) {\n if (key === 'children') {\n if (Array.isArray(value)) {\n for (const child of value) {\n updateRefs(child);\n }\n }\n continue;\n }\n\n if (typeof value === 'string') {\n // Check for hash references: href=\"#old-id\"\n if (hashRefAttrs.has(key) && value.startsWith('#')) {\n const oldId = value.slice(1);\n const newId = idMap.get(oldId);\n if (newId) {\n node[key] = '#' + newId;\n }\n }\n // Check for url() references: fill=\"url(#old-id)\"\n else if (urlRefAttrs.has(key)) {\n node[key] = replaceUrlRefs(value, idMap);\n }\n // Check for direct ID references: baseId=\"_px_xxx\"\n else if (directIdRefAttrs.has(key)) {\n const newId = idMap.get(value);\n if (newId) {\n node[key] = newId;\n }\n }\n // Check for url() in any string value (e.g., in style strings)\n else if (value.includes('url(#')) {\n node[key] = replaceUrlRefs(value, idMap);\n }\n }\n // Check style object for url() references\n else if (key === 'style' && typeof value === 'object' && value !== null) {\n for (const [styleProp, styleValue] of Object.entries(value)) {\n if (typeof styleValue === 'string') {\n (value as any)[styleProp] = replaceUrlRefs(styleValue, idMap);\n }\n }\n }\n // Recursively process nested objects (meta contains baseId/targetId refs;\n // in-place animated values like { keyframes: [{ value: \"url(#grad)\" }] }\n // also need ref rewriting on string values they contain).\n else if (typeof value === 'object' && value !== null) {\n updateRefs(value);\n }\n }\n }\n\n collectIds(cloned);\n updateRefs(cloned);\n\n // Update IDs in animator.animate map\n const docAnimate = cloned.animator?.animate;\n if (docAnimate && typeof docAnimate === 'object') {\n const updatedAnimate: Record<string, any> = {};\n for (const [id, anim] of Object.entries(docAnimate)) {\n const newId = idMap.get(id) ?? id;\n updatedAnimate[newId] = anim;\n }\n cloned.animator = { ...cloned.animator, animate: updatedAnimate };\n }\n\n return cloned;\n}\n\n/**\n * Replaces url(#old-id) references in a string with new IDs from the map.\n */\nfunction replaceUrlRefs(value: string, idMap: Map<string, string>): string {\n return value.replace(/url\\(#([^)]+)\\)/g, (match, oldId) => {\n const newId = idMap.get(oldId);\n return newId ? 'url(#' + newId + ')' : match;\n });\n}\n\n/**\n * Creates an animator instance from an AnimatedSvgDocument.\n *\n * This function serves as the main entry point for the animation library. It automatically\n * chooses the best animation engine available ('webapi' or 'frames') or can be\n * forced to use a specific one.\n *\n * @param doc The animated SVG document.\n * @param callbacks Optional object with callback functions for animation lifecycle events (play, pause, finish, etc.).\n * @param containerElement Optional selector or element to render the SVG into.\n * @returns An PxAnimatorAPI instance to programmatically control the animation.\n */\nexport function createAnimatorImpl(\n doc: PxAnimatedSvgDocument,\n adapter?: PxPlatformAdapter,\n callbacks?: PxAnimatorCallbacksConfig,\n containerElement?: string | Element\n): PxAnimatorAPI {\n\n // Validate every `node.effects` bucket against `PxEffectsSchema` and warn\n // about any shape drift. Doesn't mutate or block — the materialiser tries\n // its best even when shapes are off, but a warning helps spot wire-format\n // regressions early.\n const effectsWarnings = validateNodeEffects(doc as any);\n for (const w of effectsWarnings) console.warn('[PxAnimator] effects shape warning:', w);\n\n // Materialise the player-effects bucket (`node.effects`) FIRST, before any\n // other normalisation reads the tree. After this, `effects` is fully resolved\n // into wrappers / defs / clones and removed from every node. Everything\n // downstream (`getAnimatorConfig`, `generateNewIds`, `renderNode`, …) sees a\n // plain renderable tree.\n doc = applyPlayerEffects(doc as any).root as any;\n\n // Normalize the document to internal format\n const animatorConfig = getAnimatorConfig(doc) || {};\n\n animatorConfig.debug = true; // FIXME\n\n let rootElement: Element | null = null;\n\n // Render the SVG content if we have a container and children\n if (containerElement && doc.children) {\n\n doc = generateNewIds(doc); // Regenerate IDs so repeated calls to createAnimator(...) produce different ids in elements\n\n const containerEl = typeof containerElement === 'string' ?\n document.querySelector(containerElement) : containerElement;\n\n if (containerEl) {\n rootElement = renderNode(doc);\n if (rootElement) {\n containerEl.replaceChildren(rootElement);\n }\n }\n }\n\n return createAnimatorFromConfig(doc, adapter, callbacks, rootElement);\n}\n\nexport const PX_ANIMATOR_DATA_KEY = 'data';\n\nexport interface PxAnimatorOptions {\n /** URL to fetch the animation document from. Provide either this or `data`, not both. */\n src?: string;\n /** Inline animation document object. Provide either this or `src`, not both. */\n data?: PxAnimatedSvgDocument;\n /** Platform adapter for frame-loop rendering. */\n adapter?: PxPlatformAdapter;\n /** Callback functions for animation lifecycle events. */\n callbacks?: PxAnimatorCallbacksConfig;\n /** CSS selector or element to render the SVG into. */\n container?: string | Element;\n}\n\n/**\n * Creates an animator instance to control SVG animations.\n *\n * @param options.src URL to fetch the animation document from.\n * @param options.data Inline animation document object.\n * @param options.container CSS selector or element to render the SVG into.\n * @returns A PxAnimatorAPI instance to programmatically control the animation.\n */\nexport function createAnimator(options: PxAnimatorOptions): PxAnimatorAPI {\n\n const { src, data, adapter, callbacks, container } = options;\n\n if (data !== undefined && src !== undefined) {\n throw new Error('createAnimator: provide either `src` or `data`, not both');\n }\n if (data === undefined && src === undefined) {\n throw new Error('createAnimator: either `src` or `data` is required');\n }\n\n if (data !== undefined) {\n return createAnimatorImpl(data, adapter, callbacks, container);\n }\n\n // URL provided - fetch and create animator\n let animator: PxAnimatorAPI | null = null;\n\n fetch(src!).then(res => res.json()).then(json => {\n if (isPxElementFileFormat(json)) {\n animator = createAnimatorImpl(json, adapter, callbacks, container);\n } else {\n console.error('Invalid animation document format');\n }\n });\n\n // Return a proxy that forwards calls once loaded\n return {\n \"isReady\": () => !!animator,\n \"getRootElement\": () => animator ? animator.getRootElement() : null,\n \"isPlaying\": () => animator?.isPlaying() || false,\n \"play\": () => { animator?.play(); },\n \"pause\": () => { animator?.pause(); },\n \"cancel\": () => { animator?.cancel(); },\n \"finish\": () => { animator?.finish(); },\n \"setPlaybackRate\": (rate: number) => { animator?.setPlaybackRate(rate); },\n \"getCurrentTime\": () => animator?.getCurrentTime() || 0,\n \"setCurrentTime\": (time: number) => { animator?.setCurrentTime(time); },\n \"destroy\": () => { animator?.destroy(); }\n };\n}\n\n/**\n * Scan and load for tags, e.g.\n * <div data-px-animation-src=\"animation.json\"></div>\n */\nexport function loadTagAnimators() {\n const elements = document.querySelectorAll('[' + PX_ANIM_SRC_ATTR_NAME + ']');\n for (let i = 0; i < elements.length; i++) {\n const element = elements[i];\n if (!(element as any)[PX_ANIM_ATTR_NAME]) {\n const src = element.getAttribute(PX_ANIM_SRC_ATTR_NAME);\n if (src) {\n (element as any)[PX_ANIM_ATTR_NAME] = createAnimator({ src, container: element });\n }\n }\n }\n}\n\nif (typeof window !== 'undefined') {\n (window as any)[\"loadTagAnimators\"] = loadTagAnimators;\n (window as any)[\"createAnimator\"] = createAnimator;\n (window as any)[\"setupAnimationTriggers\"] = setupAnimationTriggers;\n}","/*---------------------------------------------------------------------------------------\n * Copyright (c) Pixodesk LTD.\n * Licensed under the MIT License. See the LICENSE file in the project root for details.\n *---------------------------------------------------------------------------------------*/\n\n\n/**\n * \"Equal-in-effect\" comparator for SVGA node trees.\n *\n * Two trees can render identically while differing structurally — extra `<g>`\n * wrappers, different ids, `<use>` clones vs inline copies, a transform expressed\n * as a baked string vs a parts record. This module reduces a tree to what is\n * actually painted: every drawable leaf, with its CUMULATIVE transform matrix\n * (resolved at a given time) and key visual attributes. Comparing those leaf\n * sets ignores representation and catches genuine visual differences.\n *\n * It is a deterministic function applied identically to both trees, so equal\n * inputs (in effect) yield equal output regardless of how each was encoded.\n *\n * Dependency-free on purpose (mirrors the applier's isolation). Scope: the node\n * types and transform forms the player-effects / heavy serialisers emit. Colour\n * animation is not interpolated — leaves are compared at keyframe instants where\n * sampled values are exact.\n */\n\ntype Mat = [number, number, number, number, number, number];\n\ninterface VmNode {\n type?: string;\n children?: Array<VmNode>;\n [attr: string]: any;\n}\n\n\n// ─────────────────────────────────────────────────────────────────────────────\n// MATRIX MATH (2x3 affine, SVG order: [a b c d e f])\n// ─────────────────────────────────────────────────────────────────────────────\n\nconst IDENTITY: Mat = [1, 0, 0, 1, 0, 0];\n\nfunction mul(m: Mat, n: Mat): Mat {\n return [\n m[0] * n[0] + m[2] * n[1],\n m[1] * n[0] + m[3] * n[1],\n m[0] * n[2] + m[2] * n[3],\n m[1] * n[2] + m[3] * n[3],\n m[0] * n[4] + m[2] * n[5] + m[4],\n m[1] * n[4] + m[3] * n[5] + m[5],\n ];\n}\n\nconst translateM = (x: number, y: number): Mat => [1, 0, 0, 1, x, y];\nconst scaleM = (sx: number, sy: number): Mat => [sx, 0, 0, sy, 0, 0];\nfunction rotateM(deg: number): Mat {\n const r = (deg * Math.PI) / 180;\n return [Math.cos(r), Math.sin(r), -Math.sin(r), Math.cos(r), 0, 0];\n}\nconst skewXM = (deg: number): Mat => [1, 0, Math.tan((deg * Math.PI) / 180), 1, 0, 0];\nconst skewYM = (deg: number): Mat => [1, Math.tan((deg * Math.PI) / 180), 0, 1, 0, 0];\n\n\n// ─────────────────────────────────────────────────────────────────────────────\n// TRANSFORM EVALUATION\n// ─────────────────────────────────────────────────────────────────────────────\n\n/** Parses an SVG transform string (\"translate(..)rotate(..)…\") into a matrix. */\nfunction parseTransformString(s: string): Mat {\n let m = IDENTITY;\n const re = /(translate|rotate|scale|matrix|skewX|skewY)\\(([^)]*)\\)/g;\n let hit: RegExpExecArray | null;\n while ((hit = re.exec(s))) {\n const fn = hit[1];\n const a = hit[2].split(/[\\s,]+/).filter(Boolean).map(Number);\n if (fn === 'translate') m = mul(m, translateM(a[0] || 0, a[1] || 0));\n else if (fn === 'scale') m = mul(m, scaleM(a[0], a.length > 1 ? a[1] : a[0]));\n else if (fn === 'rotate') m = mul(m, rotateM(a[0]));\n else if (fn === 'skewX') m = mul(m, skewXM(a[0]));\n else if (fn === 'skewY') m = mul(m, skewYM(a[0]));\n else if (fn === 'matrix') m = mul(m, [a[0], a[1], a[2], a[3], a[4], a[5]]);\n }\n return m;\n}\n\ninterface Parts { translate?: [number, number]; rotate?: number; scale?: [number, number]; origin?: [number, number]; }\n\n/** Composes a `PxTransformParts` record (player canonical order, origin-pivoted). */\nfunction partsToMatrix(p: Parts): Mat {\n let m = IDENTITY;\n if (p.translate) m = mul(m, translateM(p.translate[0], p.translate[1]));\n const pivot = p.origin && (p.rotate !== undefined || p.scale);\n if (pivot) m = mul(m, translateM(p.origin![0], p.origin![1]));\n if (p.rotate !== undefined) m = mul(m, rotateM(p.rotate));\n if (p.scale) m = mul(m, scaleM(p.scale[0], p.scale[1]));\n if (pivot) m = mul(m, translateM(-p.origin![0], -p.origin![1]));\n return m;\n}\n\nfunction lerp(a: number, b: number, f: number): number { return a + (b - a) * f; }\n\n/** Linear-interpolates a parts record between keyframes at time `t` (ms). */\nfunction interpParts(kfs: Array<any>, t: number): Parts {\n if (!kfs.length) return {};\n if (t <= (kfs[0].time ?? 0)) return kfs[0].value || {};\n if (t >= (kfs[kfs.length - 1].time ?? 0)) return kfs[kfs.length - 1].value || {};\n\n let i = 0;\n while (i < kfs.length - 1 && (kfs[i + 1].time ?? 0) < t) i++;\n const a = kfs[i], b = kfs[i + 1];\n const f = (t - (a.time ?? 0)) / ((b.time ?? 0) - (a.time ?? 0) || 1);\n const va: Parts = a.value || {}, vb: Parts = b.value || {};\n\n const out: Parts = {};\n if (va.translate && vb.translate) out.translate = [lerp(va.translate[0], vb.translate[0], f), lerp(va.translate[1], vb.translate[1], f)];\n else out.translate = va.translate || vb.translate;\n if (va.rotate !== undefined && vb.rotate !== undefined) out.rotate = lerp(va.rotate, vb.rotate, f);\n else out.rotate = va.rotate ?? vb.rotate;\n if (va.scale && vb.scale) out.scale = [lerp(va.scale[0], vb.scale[0], f), lerp(va.scale[1], vb.scale[1], f)];\n else out.scale = va.scale || vb.scale;\n out.origin = va.origin || vb.origin;\n return out;\n}\n\n/** Resolves any transform-slot form (string | {value} | {keyframes}) to a matrix at `t`. */\nfunction evalTransformValue(v: any, t: number): Mat {\n if (v === undefined || v === null) return IDENTITY;\n if (typeof v === 'string') return parseTransformString(v);\n if (v.keyframes) return partsToMatrix(interpParts(v.keyframes, t));\n if (v.value) return partsToMatrix(v.value);\n return IDENTITY;\n}\n\n/** The node's own transform at `t`: animated slot wins over the static baseline. */\nfunction nodeMatrix(node: VmNode, t: number): Mat {\n if (node.animate && node.animate.transform) return evalTransformValue(node.animate.transform, t);\n if (node.transform !== undefined) return evalTransformValue(node.transform, t);\n return IDENTITY;\n}\n\n/** Linear-interpolates a scalar animation (e.g. opacity); falls back to static / default. */\nfunction evalScalar(animated: any, staticVal: any, fallback: number, t: number): number {\n if (animated && animated.keyframes && animated.keyframes.length) {\n const kfs = animated.keyframes;\n if (t <= (kfs[0].time ?? 0)) return kfs[0].value;\n if (t >= (kfs[kfs.length - 1].time ?? 0)) return kfs[kfs.length - 1].value;\n let i = 0;\n while (i < kfs.length - 1 && (kfs[i + 1].time ?? 0) < t) i++;\n const a = kfs[i], b = kfs[i + 1];\n const f = (t - (a.time ?? 0)) / ((b.time ?? 0) - (a.time ?? 0) || 1);\n return lerp(a.value, b.value, f);\n }\n return staticVal !== undefined ? Number(staticVal) : fallback;\n}\n\n\n// ─────────────────────────────────────────────────────────────────────────────\n// FLATTEN → multiset of painted primitives\n// ─────────────────────────────────────────────────────────────────────────────\n\nconst CONTAINER_TYPES = new Set(['svg', 'g', 'symbol']);\nconst SKIP_TYPES = new Set(['defs', 'mask', 'clipPath', 'title']);\n\nfunction buildIdMap(node: VmNode, map: Map<string, VmNode>): void {\n if (typeof node.id === 'string') map.set(node.id, node);\n node.children?.forEach(c => buildIdMap(c, map));\n}\n\nfunction num(v: any): number { return v === undefined || v === null ? 0 : Number(v); }\n\n// 2-decimal rounding (sub-pixel). The heavy path bakes matrices into strings\n// rounded to ~4 decimals; comparing at 2 decimals avoids straddling a rounding\n// boundary against the applier's full-precision values, while staying visually exact.\nfunction round(n: number): number { return Math.round(n * 100) / 100 + 0; }\n\nfunction geomKey(node: VmNode): string {\n switch (node.type) {\n case 'rect': return num(node.width) + ',' + num(node.height) + ',' + num(node.x) + ',' + num(node.y);\n case 'ellipse': return num(node.rx) + ',' + num(node.ry) + ',' + num(node.cx) + ',' + num(node.cy);\n case 'circle': return num(node.r) + ',' + num(node.cx) + ',' + num(node.cy);\n case 'path': return String(node.d ?? '');\n default: return '';\n }\n}\n\nfunction describePrimitive(node: VmNode, m: Mat, t: number): string {\n const fill = node.fill ?? '';\n const stroke = node.stroke ?? '';\n const sw = node['stroke-width'] ?? node.strokeWidth ?? '';\n const opacity = round(evalScalar(node.animate?.opacity, node.opacity, 1, t));\n const masked = node.mask ? 1 : 0;\n const mat = m.map(round).join(',');\n return node.type + '|' + geomKey(node) + '|[' + mat + ']|f:' + fill + '|s:' + stroke + '|sw:' + (num(sw) || '') + '|o:' + opacity + '|m:' + masked;\n}\n\nfunction flatten(node: VmNode, parent: Mat, t: number, idMap: Map<string, VmNode>, out: Array<string>): void {\n const type = node.type || '';\n if (SKIP_TYPES.has(type)) return;\n\n const m = mul(parent, nodeMatrix(node, t));\n\n if (type === 'use') {\n const targetId = typeof node.href === 'string' ? node.href.replace(/^#/, '') : '';\n const target = idMap.get(targetId);\n const useM = mul(m, translateM(num(node.x), num(node.y)));\n if (target) flatten(target, useM, t, idMap, out);\n else out.push('UNRESOLVED_USE:#' + targetId);\n return;\n }\n\n if (CONTAINER_TYPES.has(type)) {\n node.children?.forEach(c => flatten(c, m, t, idMap, out));\n return;\n }\n\n out.push(describePrimitive(node, m, t));\n}\n\n\n// ─────────────────────────────────────────────────────────────────────────────\n// PUBLIC: sample times + visual model + comparison\n// ─────────────────────────────────────────────────────────────────────────────\n\n/** Every keyframe `time` found anywhere in the tree, plus 0. */\nexport function collectSampleTimes(node: VmNode, into: Set<number>): void {\n into.add(0);\n const scanAnim = (anim: any) => {\n if (!anim || typeof anim !== 'object') return;\n for (const key of Object.keys(anim)) {\n const kfs = anim[key]?.keyframes;\n if (Array.isArray(kfs)) kfs.forEach(kf => into.add(kf.time ?? 0));\n }\n };\n scanAnim(node.animate);\n if (node.transform && typeof node.transform === 'object' && (node.transform as any).keyframes) {\n (node.transform as any).keyframes.forEach((kf: any) => into.add(kf.time ?? 0));\n }\n node.children?.forEach(c => collectSampleTimes(c, into));\n}\n\n/** Sorted, painted-primitive multiset for the tree at time `t`. */\nexport function visualModelAt(root: VmNode, t: number): Array<string> {\n const idMap = new Map<string, VmNode>();\n buildIdMap(root, idMap);\n const out: Array<string> = [];\n flatten(root, IDENTITY, t, idMap, out);\n return out.sort();\n}\n\nexport interface EffectDiff {\n time: number;\n onlyInA: Array<string>;\n onlyInB: Array<string>;\n}\n\n/**\n * Compares two trees \"in effect\" across all keyframe instants found in either.\n * Returns one entry per time where the painted-primitive multisets differ.\n */\nexport function diffInEffect(a: VmNode, b: VmNode): Array<EffectDiff> {\n const times = new Set<number>();\n collectSampleTimes(a, times);\n collectSampleTimes(b, times);\n\n const diffs: Array<EffectDiff> = [];\n for (const t of Array.from(times).sort((x, y) => x - y)) {\n const ma = visualModelAt(a, t);\n const mb = visualModelAt(b, t);\n const onlyInA = subtractMultiset(ma, mb);\n const onlyInB = subtractMultiset(mb, ma);\n if (onlyInA.length || onlyInB.length) diffs.push({ time: t, onlyInA, onlyInB });\n }\n return diffs;\n}\n\n/** Items in `a` not matched one-for-one in `b` (multiset difference). */\nfunction subtractMultiset(a: Array<string>, b: Array<string>): Array<string> {\n const counts = new Map<string, number>();\n for (const x of b) counts.set(x, (counts.get(x) || 0) + 1);\n const extra: Array<string> = [];\n for (const x of a) {\n const c = counts.get(x) || 0;\n if (c > 0) counts.set(x, c - 1);\n else extra.push(x);\n }\n return extra;\n}\n","/*---------------------------------------------------------------------------------------\n * Copyright (c) Pixodesk LTD.\n * Licensed under the MIT License. See the LICENSE file in the project root for details.\n *---------------------------------------------------------------------------------------*/\n\nimport type { JsMode, OutAction, PxAnimatedSvgDocument, PxAnimatorAPI, PxNode, PxPlatformAdapter, PxTrigger, StartOn } from '@pixodesk/svg-animator-web';\nimport { camelCaseToKebabWordIfNeeded, createAnimator, FillMode, generateNewIds, getNormalizedProps, STYLE_ATTR_NAMES } from '@pixodesk/svg-animator-web';\nimport type { CSSProperties, FC, ReactElement } from 'react';\nimport React, { createElement, useEffect, useImperativeHandle, useRef } from 'react';\nimport { useDepsVersion } from './Utils';\n\n\n// -- Public types -----------------------------------------------------------\n\nexport interface ReactAnimatorApi {\n /** Returns true if the animation is currently running. */\n isPlaying(): boolean;\n\n /** Starts or resumes the animation. */\n play(): void;\n\n /** Pauses the animation at its current state. */\n pause(): void;\n\n /** Stops the animation and resets it to its initial state. */\n cancel(): void;\n\n /** Jumps to the end of the animation and holds the final state. */\n finish(): void;\n\n /** Returns the current playback time in milliseconds. */\n getCurrentTime(): number | null;\n\n /** Jumps to a specific time (in milliseconds) in the animation. */\n setCurrentTime(time: number): void;\n}\n\nexport interface PixodeskSvgAnimatorImplProps {\n className?: string;\n style?: CSSProperties;\n doc: PxAnimatedSvgDocument;\n compMode: PixodeskSvgAnimatorCompMode;\n\n /** Imperative API handle populated by the inner component. */\n apiHolderRef: React.RefObject<PxAnimatorAPI | null>;\n}\n\nexport interface PixodeskSvgAnimatorProps {\n\n className?: string;\n\n style?: CSSProperties;\n\n // -- Source ---------------------------------------------------------------\n\n /**\n * The animation document to render.\n *\n * TODO: Accept PxFileConfig | string to support URL-based loading, e.g.\n * <PixodeskSvgAnimator doc=\"/animation.json\" />\n */\n doc: PxAnimatedSvgDocument;\n\n // -- Timeline ------------------------------------------------------------\n\n timeline?: 'time' | 'scroll';\n\n // -- Rendering mode ------------------------------------------------------\n\n /** Forces a specific rendering engine. Defaults to 'auto'. */\n mode?: JsMode;\n\n // -- Timing overrides ----------------------------------------------------\n\n /** Delay before the animation starts, in milliseconds. */\n delay?: number;\n\n /** Defines the element's style when the animation is not active. */\n fill?: FillMode;\n\n /** Number of iterations, or 'infinite' for endless looping. */\n iterations?: number | 'infinite';\n\n /** Duration of a single iteration in milliseconds. */\n duration?: number;\n\n /** Playback direction. */\n direction?: PlaybackDirection;\n\n /** Target frame rate (frames per second). */\n frameRate?: number;\n\n // -- Trigger overrides ---------------------------------------------------\n\n /** The event that starts the animation. When omitted, uses the value from the document config. */\n startOn?: StartOn;\n\n /** Behaviour when the trigger condition ends (e.g. mouse-out, second click). */\n outAction?: OutAction;\n\n /** Visibility ratio (0.0–1.0) required to trigger a scrollIntoView animation. Defaults to 0.5. */\n scrollIntoViewThreshold?: number;\n\n // -- Declarative control -------------------------------------------------\n\n /** When true, uses triggers defined in the animation document. */\n autoplay?: boolean;\n\n /**\n * Starts the animation unconditionally, ignoring document triggers.\n * Equivalent to `startOn=\"load\"` / `outAction=\"continue\"`.\n */\n play?: boolean;\n\n /** Pauses current playback. Only meaningful when `play` or `autoplay` is set. */\n pause?: boolean;\n\n // -- Imperative control --------------------------------------------------\n\n /** Ref populated with the imperative playback API. */\n apiRef?: React.RefObject<ReactAnimatorApi | null>;\n\n // -- Controlled (external) time ------------------------------------------\n\n /** Seek to a specific point in the animation (fractional). */\n time?: number;\n\n /** Seek to a specific point in the animation (milliseconds). */\n timeMs?: number;\n\n // -- Callbacks -----------------------------------------------------------\n\n /** Called when the animation starts or resumes. */\n onPlay?: () => void;\n\n /** Called when the animation stops for any reason (pause / cancel / finish / removal). */\n onStop?: () => void; // FIXME: consider a more descriptive name\n\n /** Called when the animation is paused. */\n onPause?: () => void;\n\n /** Called when the animation is cancelled. */\n onCancel?: () => void;\n\n /** Called when the animation finishes naturally. */\n onFinish?: () => void;\n\n /** Called when the animation is removed. */\n onRemove?: () => void;\n\n // -- Diagnostics ---------------------------------------------------------\n\n onWarning?: (msg: string) => void;\n onError?: (msg: string) => void;\n}\n\n\n// -- Internal types ---------------------------------------------------------\n\nenum PixodeskSvgAnimatorCompMode {\n static = 'static',\n autoplay = 'autoplay',\n play = 'play',\n imperativeApi = 'imperativeApi',\n fixedTime = 'fixedTime'\n}\n\n\n// -- React ↔ Animator bridge ------------------------------------------------\n\n/**\n * Creates a platform adapter that routes animator attribute updates\n * to the corresponding React-managed DOM refs.\n */\nexport function createReactAdapter(elementRefs: React.RefObject<Map<string, any>>) {\n const warnedSelectors = new Set<string>();\n\n const adapter: PxPlatformAdapter = {\n isConnected: () => {\n return true;\n },\n setAttribute: (id, attrName, value) => {\n\n attrName = camelCaseToKebabWordIfNeeded(attrName);\n\n const selector = getSelector(id);\n\n const element = elementRefs.current.get(id);\n\n if (!element && !warnedSelectors.has(selector)) {\n warnedSelectors.add(selector);\n console.warn('setAttribute: No elements found for selector \"' + selector + '\"');\n console.warn(elementRefs.current);\n }\n\n if (element) {\n element.setAttribute(attrName, value);\n if (STYLE_ATTR_NAMES.has(attrName)) {\n (element as HTMLElement).style[attrName as any] = value;\n }\n }\n },\n };\n return adapter;\n}\n\nexport function getSelector(id: string) {\n return '#' + id;\n}\n\n// FIXME: add model validation (e.g. isElementFileJson check)\n\n\n// -- Inner component (memoised, never re-renders) ---------------------------\n\nconst PixodeskSvgAnimatorImpl: FC<PixodeskSvgAnimatorImplProps> = ({\n className, style, doc, compMode, apiHolderRef\n}) => {\n\n doc = generateNewIds(doc);\n\n const elementRefs = useRef(new Map<string, any>());\n\n const renderNode = (node: PxNode | undefined): ReactElement | null => {\n if (!node) return null;\n\n const { type, animate, meta, children, ...props } = node;\n\n const normProps = getNormalizedProps(props);\n\n normProps['ref'] = (domEl: any) => {\n if (node['id']) elementRefs.current.set(node['id'], domEl);\n // return () => {};\n };\n\n return createElement(type, normProps, children?.map(child => renderNode(child)));\n };\n\n const root = doc ? renderNode(doc) : null;\n\n // Create the animator once per document and tear it down on unmount.\n useEffect(() => {\n\n let api: PxAnimatorAPI | undefined = createAnimator({ data: doc, adapter: createReactAdapter(elementRefs) });\n apiHolderRef.current = api;\n\n return () => {\n api?.destroy();\n apiHolderRef.current = null;\n };\n }, [doc, apiHolderRef]);\n\n return root;\n};\n\n/** Memoised wrapper — the inner component never re-renders (props are stable by design). */\nconst PixodeskSvgAnimatorImplOnce = React.memo(\n PixodeskSvgAnimatorImpl,\n () => true // Don't re-render\n);\n\n\n// -- Main public component --------------------------------------------------\n\n/**\n * React component for rendering and controlling Pixodesk SVG animations.\n *\n * Supports four mutually-exclusive control modes:\n *\n * 1. **Autoplay** – uses triggers from the animation document.\n * ```tsx\n * <PixodeskSvgAnimator doc={animation} autoplay />\n * ```\n *\n * 2. **Declarative play/pause** – controlled via boolean props.\n * ```tsx\n * <PixodeskSvgAnimator doc={animation} play pause={false} />\n * ```\n *\n * 3. **Imperative** – exposes a ref-based API for full programmatic control.\n * ```tsx\n * const api = useRef<ReactAnimatorApi>(null);\n * <PixodeskSvgAnimator doc={animation} apiRef={api} />\n * <button onClick={() => api.current?.play()}>Play</button>\n * ```\n *\n * 4. **Controlled time** – renders a single frame at a given time.\n * ```tsx\n * <PixodeskSvgAnimator doc={animation} time={0.5} />\n * <PixodeskSvgAnimator doc={animation} timeMs={500} />\n * ```\n */\nconst PixodeskSvgAnimator: FC<PixodeskSvgAnimatorProps> = ({\n className, style,\n doc, autoplay, play, pause, time, timeMs, apiRef,\n timeline,\n\n // Overrides\n mode, delay, fill, iterations, duration, direction, frameRate,\n\n startOn, outAction, scrollIntoViewThreshold\n}) => {\n\n // Determine which control mode is active.\n let compMode = PixodeskSvgAnimatorCompMode.static;\n if (apiRef) {\n compMode = PixodeskSvgAnimatorCompMode.imperativeApi;\n } else if (autoplay) {\n compMode = PixodeskSvgAnimatorCompMode.autoplay;\n } else if (time !== undefined || timeMs !== undefined) {\n compMode = PixodeskSvgAnimatorCompMode.fixedTime;\n } else {\n compMode = PixodeskSvgAnimatorCompMode.play;\n }\n\n // In non-autoplay modes, override the document trigger to 'programmatic'\n // so the component can manage playback itself.\n if (compMode !== PixodeskSvgAnimatorCompMode.autoplay) {\n const startOn = doc.animator?.trigger?.startOn;\n if (\n startOn &&\n startOn !== 'programmatic' // FIXME: use enum\n ) {\n doc = {\n ...doc,\n animator: {\n ...doc.animator,\n trigger: {\n ...doc.animator?.trigger,\n startOn: 'programmatic' // FIXME: use enum\n }\n }\n };\n }\n }\n\n // Apply timing overrides from props onto the document config.\n if (\n mode !== undefined ||\n duration !== undefined ||\n delay !== undefined ||\n iterations !== undefined ||\n fill !== undefined ||\n direction !== undefined ||\n frameRate !== undefined\n ) {\n const animator = doc.animator || {};\n doc = {\n ...doc,\n animator: {\n ...animator,\n mode: mode !== undefined ? mode : animator.mode,\n duration: duration !== undefined ? duration : animator.duration,\n delay: delay !== undefined ? delay : animator.delay,\n iterations: iterations !== undefined ? iterations : animator.iterations,\n fill: fill !== undefined ? fill : animator.fill,\n direction: direction !== undefined ? direction : animator.direction,\n frameRate: frameRate !== undefined ? frameRate : animator.frameRate\n }\n };\n }\n\n // Apply trigger overrides from props.\n if (\n startOn !== undefined ||\n outAction !== undefined ||\n scrollIntoViewThreshold !== undefined\n ) {\n const trigger: PxTrigger = doc.animator?.trigger || {};\n doc = {\n ...doc,\n animator: {\n ...doc.animator,\n trigger: {\n ...trigger,\n startOn: startOn !== undefined ? startOn : trigger.startOn,\n outAction: outAction !== undefined ? outAction : trigger.outAction,\n scrollIntoViewThreshold: scrollIntoViewThreshold !== undefined ? scrollIntoViewThreshold : trigger.scrollIntoViewThreshold\n }\n }\n };\n }\n\n // In controlled-time mode, use a negative delay to seek to the given frame.\n if (compMode === PixodeskSvgAnimatorCompMode.fixedTime) {\n let delay = 0;\n if (time !== undefined) delay = -time; // FIXME: time as a fraction of total duration?\n if (timeMs !== undefined) delay = -timeMs;\n const animator = doc.animator || {};\n doc = {\n ...doc,\n animator: {\n ...animator,\n delay\n }\n };\n }\n\n const apiHolderRef = useRef<PxAnimatorAPI | null>(null);\n\n // Expose the imperative API via the consumer-provided ref.\n useImperativeHandle(apiRef, () => {\n return {\n isPlaying: () => apiHolderRef.current?.isPlaying() || false,\n play: () => apiHolderRef.current?.play(),\n pause: () => apiHolderRef.current?.pause(),\n cancel: () => apiHolderRef.current?.cancel(),\n finish: () => apiHolderRef.current?.finish(),\n getCurrentTime: () => apiHolderRef.current?.getCurrentTime() || null,\n setCurrentTime: (time: number) => apiHolderRef.current?.setCurrentTime(time),\n };\n }, []);\n\n // Sync declarative play/pause props with the animator.\n useEffect(() => {\n\n if (compMode === PixodeskSvgAnimatorCompMode.play) {\n if (play && !pause) {\n apiHolderRef.current?.play();\n } else if (pause) {\n apiHolderRef.current?.pause();\n } else {\n apiHolderRef.current?.finish();\n }\n }\n\n return () => {\n if (compMode === PixodeskSvgAnimatorCompMode.play) {\n apiHolderRef.current?.pause(); // FIXME - implement\n }\n };\n }, [compMode, play, pause]);\n\n // Increment key when the document or mode changes to force a full remount.\n const key = useDepsVersion(compMode, doc);\n\n return (\n <PixodeskSvgAnimatorImplOnce\n key={key}\n compMode={compMode}\n doc={doc}\n apiHolderRef={apiHolderRef}\n />\n );\n};\n\nexport default PixodeskSvgAnimator;","/*---------------------------------------------------------------------------------------\n * Copyright (c) Pixodesk LTD.\n * Licensed under the MIT License. See the LICENSE file in the project root for details.\n *---------------------------------------------------------------------------------------*/\n\nimport { useRef } from 'react';\n\nexport function deepEquals(a: any, b: any): boolean {\n // Handle primitives and null\n if (a === b) return true;\n if (a == null || b == null) return false;\n if (typeof a !== 'object' || typeof b !== 'object') return false;\n\n // Check for cycles using WeakSet\n const seen = new WeakSet();\n\n function equals(x: any, y: any): boolean {\n // Primitive/null check\n if (x === y) return true;\n if (x == null || y == null) return false;\n if (typeof x !== 'object' || typeof y !== 'object') return false;\n\n // Cycle detection\n if (seen.has(x)) {\n throw new Error('Circular reference detected');\n }\n seen.add(x);\n\n // Array check\n const xIsArray = Array.isArray(x);\n const yIsArray = Array.isArray(y);\n if (xIsArray !== yIsArray) return false;\n\n if (xIsArray) {\n if (x.length !== y.length) return false;\n for (let i = 0; i < x.length; i++) {\n if (!equals(x[i], y[i])) return false;\n }\n return true;\n }\n\n // Object check\n const xKeys = Object.keys(x);\n const yKeys = Object.keys(y);\n if (xKeys.length !== yKeys.length) return false;\n\n for (const key of xKeys) {\n if (!yKeys.includes(key)) return false;\n if (!equals(x[key], y[key])) return false;\n }\n\n return true;\n }\n\n return equals(a, b);\n}\n\n\n/**\n * Compares two arrays of dependencies using identity check first (===),\n * falling back to deep equality if references differ.\n * This is optimized for immutable data that may be recreated with same values.\n */\nfunction areDepsEqual(prevDeps: Array<any>, nextDeps: Array<any>): boolean {\n if (prevDeps.length !== nextDeps.length) return false;\n\n for (let i = 0; i < prevDeps.length; i++) {\n // Fast path: same reference (common for immutable data)\n if (prevDeps[i] === nextDeps[i]) continue;\n\n // Slow path: different reference but possibly same content\n if (!deepEquals(prevDeps[i], nextDeps[i])) return false;\n }\n\n return true;\n}\n\n/**\n * Returns a stable numeric version ID that only increments when dependencies\n * actually change (by reference or deep equality).\n */\nexport function useDepsVersion(...deps: Array<any>): number {\n const cache = useRef<{\n versionId: number;\n deps: Array<any>;\n } | null>(null);\n\n // First render - initialize with version 1\n if (cache.current === null) {\n cache.current = {\n versionId: 1,\n deps: deps\n };\n return 1;\n }\n\n // Check if any dependency changed (by reference or value)\n if (!areDepsEqual(cache.current.deps, deps)) {\n // Dependencies changed - increment version and update cache\n cache.current = {\n versionId: cache.current.versionId + 1,\n deps: deps\n };\n }\n\n return cache.current.versionId;\n}","/*---------------------------------------------------------------------------------------\n * Copyright (c) Pixodesk LTD.\n * Licensed under the MIT License. See the LICENSE file in the project root for details.\n *---------------------------------------------------------------------------------------*/\n\nimport { OutAction, StartOn } from \"@pixodesk/svg-animator-web\";\nimport { CSSProperties, FC, ReactNode, useEffect, useRef, useState } from \"react\";\n\n\ntype AnimState = 'idle' | 'paused' | 'playing';\n\n/**\n * Controls playback of a SVG+CSS animated files by toggling class names on a wrapper div.\n *\n * Intended for use with SVG files exported from the Pixodesk editor using the\n * **CSS Keyframes** (no `<script>` tag). Import the SVG as a React component\n * via SVGR (`vite-plugin-svgr` or `@svgr/webpack`) and pass it as `children`:\n *\n * ```tsx\n * import AnimationSvg from './animation.svg?react'; // SVGR\n *\n * <PixodeskSvgCssAnimator startOn=\"mouseOver\" outAction=\"pause\">\n * <AnimationSvg />\n * </PixodeskSvgCssAnimator>\n * ```\n *\n * The wrapper div carries one of three animation states via CSS class names:\n * - *(no class)* — idle, animation not started\n * - `px-anim-enabled` — started but paused\n * - `px-anim-enabled px-anim-playing` — actively playing\n *\n * @param children - The SVGR-imported SVG component to animate.\n * @param startOn - What triggers the animation to start:\n * - `'load'` — plays immediately on mount (default)\n * - `'mouseOver'` — plays on hover\n * - `'click'` — plays on click, toggles on second click\n * - `'scrollIntoView'` — plays when the element enters the viewport\n * @param outAction - What happens when the trigger ends (hover/scroll out, second click):\n * - `'continue'` — keeps playing (default)\n * - `'pause'` — pauses at the current frame\n * - `'reset'` — resets to the beginning\n * @param className - Additional CSS class names to apply to the wrapper div.\n * @param style - Inline styles for the wrapper div (e.g. `{ width: 400, height: 400 }`).\n */\nconst PixodeskSvgCssAnimator: FC<{\n className?: string;\n style?: CSSProperties;\n children: ReactNode;\n startOn?: StartOn;\n outAction?: OutAction;\n}> = ({ className, style, children, startOn = 'load', outAction = 'continue' }) => {\n\n const [state, setState] = useState<AnimState>(startOn === 'load' ? 'playing' : 'idle');\n\n const ref = useRef<HTMLDivElement>(null);\n\n useEffect(() => {\n if (startOn !== 'scrollIntoView') return;\n const el = ref.current;\n if (!el) return;\n const outState: AnimState = (\n outAction === 'reset' ? 'idle' :\n outAction === 'pause' ? 'paused' : 'playing'\n );\n const observer = new IntersectionObserver(\n ([entry]) => setState(entry.isIntersecting ? 'playing' : outState),\n { threshold: 0.1 }\n );\n observer.observe(el);\n return () => observer.disconnect();\n }, [startOn, outAction]);\n\n const goOut = () => setState(\n outAction === 'reset' ? 'idle' :\n outAction === 'pause' ? 'paused' : 'playing'\n );\n\n const handlers =\n startOn === 'mouseOver' ? { onMouseEnter: () => setState('playing'), onMouseLeave: goOut } :\n startOn === 'click' ? { onClick: () => state === 'playing' ? goOut() : setState('playing') } :\n {};\n\n return (\n <div\n ref={ref}\n className={className + (\n state === 'playing' ? 'px-anim-enabled px-anim-playing' :\n state === 'paused' ? 'px-anim-enabled' : ''\n )}\n style={style}\n {...handlers}\n >\n {children}\n </div>\n );\n};\nexport default PixodeskSvgCssAnimator;"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAWA,UAAI,qBAAqB,uBAAO,IAAI,4BAA4B;AAAhE,UACE,oBAAoB,uBAAO,IAAI,cAAc;AAD/C,UAEE,sBAAsB,uBAAO,IAAI,gBAAgB;AAFnD,UAGE,yBAAyB,uBAAO,IAAI,mBAAmB;AAHzD,UAIE,sBAAsB,uBAAO,IAAI,gBAAgB;AAJnD,UAKE,sBAAsB,uBAAO,IAAI,gBAAgB;AALnD,UAME,qBAAqB,uBAAO,IAAI,eAAe;AANjD,UAOE,yBAAyB,uBAAO,IAAI,mBAAmB;AAPzD,UAQE,sBAAsB,uBAAO,IAAI,gBAAgB;AARnD,UASE,kBAAkB,uBAAO,IAAI,YAAY;AAT3C,UAUE,kBAAkB,uBAAO,IAAI,YAAY;AAV3C,UAWE,sBAAsB,uBAAO,IAAI,gBAAgB;AAXnD,UAYE,wBAAwB,OAAO;AACjC,eAAS,cAAc,eAAe;AACpC,YAAI,SAAS,iBAAiB,aAAa,OAAO,cAAe,QAAO;AACxE,wBACG,yBAAyB,cAAc,qBAAqB,KAC7D,cAAc,YAAY;AAC5B,eAAO,e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UAAM,QAAQ,MAAM;AAAA,MAChB,cAAc,UAAU,SACpB,cAAc,UAAU,WAAW;AAAA,IAC3C;AAEA,UAAM,WACF,YAAY,cAAc,EAAE,cAAc,MAAM,SAAS,SAAS,GAAG,cAAc,MAAM,IACrF,YAAY,UAAU,EAAE,SAAS,MAAM,UAAU,YAAY,MAAM,IAAI,SAAS,SAAS,EAAE,IACvF,CAAC;AAEb,WACI;AAAA,MAAC;AAAA;AAAA,QACG;AAAA,QACA,WAAW,aACP,UAAU,YAAY,oCAClB,UAAU,WAAW,oBAAoB;AAAA,QAEjD;AAAA,QACC,GAAG;AAAA,QAEH;AAAA;AAAA,IACL;AAAA,EAER;AACA,MAAO,iCAAQ;","names":["React","remap","pathStr","_a","_b","num","effectiveProgress","import_react","getSelector","renderNode","React","startOn","delay","time","import_react","import_jsx_runtime"]}
|