eligius 1.5.1 → 1.5.3
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/LICENSE +21 -21
- package/README.md +309 -311
- package/dist/chunk-C6wwvPpM.mjs +18 -0
- package/dist/index.d.mts +168 -181
- package/dist/index.mjs +896 -955
- package/dist/index.mjs.map +1 -1
- package/jsonschema/eligius-configuration.json +122 -122
- package/jsonschema/engine-config.json +21 -21
- package/jsonschema/mediaplayer-timeline-provider-settings.json +40 -40
- package/jsonschema/operation-templates/animate-with-class.json +1 -3
- package/jsonschema/operation-templates/break-for-each.json +1 -1
- package/jsonschema/operation-templates/clear-operation-data.json +1 -3
- package/jsonschema/operation-templates/clear-storage.json +1 -3
- package/jsonschema/operation-templates/concatenate-strings.json +1 -3
- package/jsonschema/operation-templates/continue-for-each.json +1 -1
- package/jsonschema/operation-templates/create-element.json +1 -3
- package/jsonschema/operation-templates/filter-array.json +2 -6
- package/jsonschema/operation-templates/find-in-array.json +2 -6
- package/jsonschema/operation-templates/get-query-params.json +1 -3
- package/jsonschema/operation-templates/http-delete.json +1 -3
- package/jsonschema/operation-templates/http-post.json +1 -3
- package/jsonschema/operation-templates/http-put.json +1 -3
- package/jsonschema/operation-templates/invoke-object-method.json +1 -3
- package/jsonschema/operation-templates/load-json.json +1 -3
- package/jsonschema/operation-templates/log.json +1 -3
- package/jsonschema/operation-templates/select-element.json +1 -3
- package/jsonschema/operation-templates/set-operation-data.json +1 -3
- package/jsonschema/operation-templates/sort-array.json +2 -6
- package/jsonschema/operation-templates/split-string.json +1 -3
- package/jsonschema/operation-templates/substring-text.json +1 -3
- package/jsonschema/operation-templates/validate-form.json +1 -3
- package/jsonschema/operations/animate-with-class.json +1 -3
- package/jsonschema/operations/break-for-each.json +1 -1
- package/jsonschema/operations/clear-operation-data.json +1 -3
- package/jsonschema/operations/clear-storage.json +1 -3
- package/jsonschema/operations/concatenate-strings.json +1 -3
- package/jsonschema/operations/continue-for-each.json +1 -1
- package/jsonschema/operations/create-element.json +1 -3
- package/jsonschema/operations/filter-array.json +2 -6
- package/jsonschema/operations/find-in-array.json +2 -6
- package/jsonschema/operations/get-query-params.json +1 -3
- package/jsonschema/operations/http-delete.json +1 -3
- package/jsonschema/operations/http-post.json +1 -3
- package/jsonschema/operations/http-put.json +1 -3
- package/jsonschema/operations/invoke-object-method.json +1 -3
- package/jsonschema/operations/load-json.json +1 -3
- package/jsonschema/operations/log.json +1 -3
- package/jsonschema/operations/select-element.json +1 -3
- package/jsonschema/operations/set-operation-data.json +1 -3
- package/jsonschema/operations/sort-array.json +2 -6
- package/jsonschema/operations/split-string.json +1 -3
- package/jsonschema/operations/substring-text.json +1 -3
- package/jsonschema/operations/validate-form.json +1 -3
- package/jsonschema/raf-timeline-provider-settings.json +29 -29
- package/jsonschema/timeline-provider-settings.json +16 -16
- package/jsonschema/timeline.json +52 -52
- package/package.json +13 -16
- package/dist/chunk-z5eko27R.mjs +0 -13
package/dist/index.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.mjs","names":["jQuery","agent: IDiagnosticsAgent","active: boolean","cache: TGlobalCache","cache","getGlobals: (name?: string) => TGlobalCache | any","setGlobals: (newValues: TGlobalCache) => void","clearGlobals: () => void","forEach: TOperation<IForEachOperationData>","when: TOperation<\r\n IWhenOperationData,\r\n Omit<IWhenOperationData, 'expression'>\r\n>","evaluations: Record<\r\n TOperator,\r\n (left: string | number, right: string | number) => boolean\r\n>","name: string","startOperations: IResolvedOperation[]","eventbus: IEventbus","operations","endOperations: IResolvedOperation[]","duration: IStrictDuration","lookup: Record<string, true>","addClass: TOperation<\r\n IAddClassOperationData,\r\n Omit<IAddClassOperationData, 'className'>\r\n>","controllers","addControllerToElement: TOperation<IAddControllerToElementOperationData>","addGlobalsToOperation: TOperation<\r\n IAddGlobalsToOperationData,\r\n Omit<IAddGlobalsToOperationData, 'globalProperties'>\r\n>","animate: TOperation<\r\n IAnimateOperationData,\r\n Omit<\r\n IAnimateOperationData,\r\n 'animationEasing' | 'animationProperties' | 'animationDuration'\r\n >\r\n>","animateWithClass: TOperation<\r\n IAnimateWithClassOperationData,\r\n Promise<IAnimateWithClassOperationData>\r\n>","removeClass","announceToScreenReader: TOperation<\r\n IAnnounceToScreenReaderOperationData,\r\n Omit<IAnnounceToScreenReaderOperationData, 'message' | 'priority'>\r\n>","breakForEach: TOperation<TOperationData>","broadcastEvent: TOperation<\r\n IBroadcastEventOperationData,\r\n Omit<IBroadcastEventOperationData, 'eventArgs' | 'eventTopic' | 'eventName'>\r\n>","cache: any[]","resolvePropertyChain","calcFunctions: Record<\r\n TCalculationOperator,\r\n (left: number, right: number) => number\r\n>","calc: TOperation<\r\n ICalcOperationData,\r\n Omit<ICalcOperationData, 'left' | 'right' | 'operator'>\r\n>","clearElement: TOperation<IClearElementOperationData>","clearOperationData: TOperation<\r\n IClearOperationDataOperationData,\r\n Omit<IClearOperationDataOperationData, 'properties'>\r\n>","clearStorage: TOperation<\r\n IClearStorageOperationData,\r\n Omit<IClearStorageOperationData, 'key' | 'storageType'>\r\n>","compareDate: TOperation<\r\n ICompareDateOperationData,\r\n Omit<ICompareDateOperationData, 'date1' | 'date2'>\r\n>","concatenateStrings: TOperation<\r\n IConcatenateStringsOperationData,\r\n Omit<IConcatenateStringsOperationData, 'strings' | 'separator'>\r\n>","continueForEach: TOperation<TOperationData>","createElement: TOperation<\r\n ICreateElementOperationData<TTagNames>,\r\n Omit<\r\n RequireKeys<ICreateElementOperationData<TTagNames>, 'template'>,\r\n 'elementName' | 'text' | 'attributes'\r\n >\r\n>","customFunction: TOperation<\r\n ICustomFunctionOperationData,\r\n Omit<ICustomFunctionOperationData, 'systemName'>\r\n>","endAction: TOperation<\r\n IEndActionOperationData,\r\n Omit<IEndActionOperationData, 'actionOperationData'>\r\n>","endForEach: TOperation<TOperationData>","endWhen: TOperation<Record<string, unknown>>","extendController: TOperation<\r\n IExtendControllerOperationData,\r\n Omit<IExtendControllerOperationData, 'controllerExtension'>\r\n>","filterArray: TOperation<\r\n IFilterArrayOperationData,\r\n Omit<\r\n IFilterArrayOperationData,\r\n 'filterProperty' | 'filterValue' | 'filterPredicate'\r\n >\r\n>","filtered: any[]","findInArray: TOperation<\r\n IFindInArrayOperationData,\r\n Omit<\r\n IFindInArrayOperationData,\r\n 'findProperty' | 'findValue' | 'findPredicate'\r\n >\r\n>","foundItem: any | undefined","formatDate: TOperation<\r\n IFormatDateOperationData,\r\n Omit<IFormatDateOperationData, 'format'>\r\n>","formatText: TOperation<\r\n IFormatTextOperationData,\r\n Omit<IFormatTextOperationData, 'transformation'>\r\n>","getAttributesFromElement: TOperation<\r\n IGetAttributesFromElementOperationData,\r\n Omit<IGetAttributesFromElementOperationData, 'attributeNames'>\r\n>","getControllerFromElement: TOperation<\r\n IGetControllerFromElementOperationData,\r\n Omit<IGetControllerFromElementOperationData, 'controllerName'>\r\n>","getControllerInstance: TOperation<\r\n IGetControllerInstanceOperationData,\r\n Omit<IGetControllerInstanceOperationData, 'systemName'>\r\n>","getCurrentTime: TOperation<\r\n IGetCurrentTimeOperationData,\r\n IGetCurrentTimeOperationData\r\n>","suffix: string | null","ratioModifier: string | null","getElementDimensions: TOperation<\r\n IGetElementDimensionsOperationData,\r\n Omit<IGetElementDimensionsOperationData, 'modifier'>\r\n>","getFocusedElement: TOperation<\r\n IGetFocusedElementOperationData,\r\n IGetFocusedElementOperationData\r\n>","getFormData: TOperation<\r\n IGetFormDataOperationData,\r\n IGetFormDataOperationData\r\n>","formData: Record<string, any>","getImport: TOperation<\r\n IGetImportOperationData,\r\n Omit<RequireKeys<IGetImportOperationData, 'importedInstance'>, 'systemName'>\r\n>","getQueryParams: TOperation<\r\n IGetQueryParamsOperationData,\r\n Omit<IGetQueryParamsOperationData, 'defaultValues'>\r\n>","getScrollPosition: TOperation<\r\n IGetScrollPositionOperationData,\r\n IGetScrollPositionOperationData\r\n>","getTextContent: TOperation<\r\n IGetTextContentOperationData,\r\n IGetTextContentOperationData\r\n>","httpDelete: TOperation<\r\n IHttpDeleteOperationData,\r\n Omit<IHttpDeleteOperationData, 'url' | 'headers'>\r\n>","httpPost: TOperation<\r\n IHttpPostOperationData,\r\n Omit<IHttpPostOperationData, 'url' | 'body' | 'headers'>\r\n>","httpPut: TOperation<\r\n IHttpPutOperationData,\r\n Omit<IHttpPutOperationData, 'url' | 'body' | 'headers'>\r\n>","invokeObjectMethod: TOperation<\r\n IInvokeObjectMethodOperationData,\r\n Omit<IInvokeObjectMethodOperationData, 'methodName' | 'methodArguments'>\r\n>","isElementInViewport: TOperation<\r\n IIsElementInViewportOperationData,\r\n IIsElementInViewportOperationData\r\n>","loadFromStorage: TOperation<\r\n ILoadFromStorageOperationData,\r\n Omit<ILoadFromStorageOperationData, 'storageType'>\r\n>","jsonCache: Record<string, unknown>","loadJson: TOperation<\r\n ILoadJSONOperationData,\r\n Omit<ILoadJSONOperationData, 'url' | 'cache'>\r\n>","cache","log: TOperation<\r\n ILogOperationData,\r\n Omit<ILogOperationData, 'logValue' | 'logName'>\r\n>","mapArray: TOperation<\r\n IMapArrayOperationData,\r\n Omit<IMapArrayOperationData, 'mapFunction'>\r\n>","math: TOperation<\r\n IMathOperationData,\r\n Omit<IMathOperationData, 'args' | 'functionName'>\r\n>","otherwise: TOperation<Record<string, unknown>>","removeClass: TOperation<\r\n IRemoveClassOperationData,\r\n Omit<IRemoveClassOperationData, 'className'>\r\n>","removeControllerFromElement: TOperation<\r\n IRemoveControllerFromElementOperationData,\r\n Omit<IRemoveControllerFromElementOperationData, 'controllerName'>\r\n>","controllers","removeElement: TOperation<IRemoveElementOperationData>","removePropertiesFromOperationData: TOperation<\r\n IRemovePropertiesFromOperationDataOperationData,\r\n Omit<IRemovePropertiesFromOperationDataOperationData, 'propertyNames'>\r\n>","reparentElement: TOperation<\r\n IReparentElementOperationData,\r\n Omit<IReparentElementOperationData, 'newParentSelector'>\r\n>","replaceString: TOperation<\r\n IReplaceStringOperationData,\r\n Omit<IReplaceStringOperationData, 'pattern' | 'replacement'>\r\n>","replaceText: TOperation<\r\n IReplaceTextOperationData,\r\n Omit<IReplaceTextOperationData, 'searchPattern' | 'replacement'>\r\n>","newText: string","requestAction: TOperation<\r\n IRequestActionOperationData,\r\n Omit<Required<IRequestActionOperationData>, 'systemName'>\r\n>","saveToStorage: TOperation<\r\n ISaveToStorageOperationData,\r\n Omit<ISaveToStorageOperationData, 'value' | 'storageType'>\r\n>","scrollToElement: TOperation<\r\n IScrollToElementOperationData,\r\n Omit<IScrollToElementOperationData, 'behavior' | 'block' | 'inline'>\r\n>","scrollToPosition: TOperation<\r\n IScrollToPositionOperationData,\r\n Omit<IScrollToPositionOperationData, 'x' | 'y' | 'behavior'>\r\n>","selectElement: TOperation<\r\n ISelectElementOperationData,\r\n Omit<ISelectElementOperationData, 'selector' | 'useSelectedElementAsRoot'>\r\n>","setData: TOperation<\r\n ISetDataOperationData,\r\n Omit<ISetDataOperationData, 'properties'>\r\n>","path","setElementAttributes: TOperation<\r\n ISetElementAttributesOperationData,\r\n Omit<ISetElementAttributesOperationData, 'attributes'>\r\n>","setElementContent: TOperation<\r\n ISetElementContentOperationData,\r\n Omit<ISetElementContentOperationData, 'template' | 'insertionType'>\r\n>","setFocus: TOperation<\r\n ISetFocusOperationData,\r\n ISetFocusOperationData\r\n>","setFormValue: TOperation<\r\n ISetFormValueOperationData,\r\n Omit<ISetFormValueOperationData, 'value'>\r\n>","setGlobalData: TOperation<\r\n ISetGlobalDataOperationData,\r\n Omit<ISetGlobalDataOperationData, 'propertyNames'>\r\n>","setOperationData: TOperation<\r\n ISetOperationData,\r\n Omit<ISetOperationData, 'override' | 'properties'>\r\n>","setStyle: TOperation<\r\n ISetStyleOperationData,\r\n Omit<ISetStyleOperationData, 'properties'>\r\n>","setVariable: TOperation<\r\n ISetVariableOperationData,\r\n Omit<ISetVariableOperationData, 'name' | 'value'>\r\n>","sortArray: TOperation<\r\n ISortArrayOperationData,\r\n Omit<ISortArrayOperationData, 'sortProperty' | 'sortOrder' | 'sortComparator'>\r\n>","splitString: TOperation<\r\n ISplitStringOperationData,\r\n Omit<ISplitStringOperationData, 'delimiter' | 'limit'>\r\n>","startAction: TOperation<\r\n IStartActionOperationData,\r\n Omit<IStartActionOperationData, 'actionOperationData'>\r\n>","substringText: TOperation<\r\n ISubstringTextOperationData,\r\n Omit<ISubstringTextOperationData, 'start' | 'end'>\r\n>","toggleClass: TOperation<\r\n IToggleClassOperationData,\r\n Omit<IToggleClassOperationData, 'className'>\r\n>","toggleElement: TOperation<IToggleElementOperationData>","toggleElement","toggleFormElement: TOperation<\r\n IToggleFormElementOperationData,\r\n Omit<IToggleFormElementOperationData, 'enabled'>\r\n>","validateForm: TOperation<\r\n IValidateFormOperationData,\r\n Omit<IValidateFormOperationData, 'validationRules'>\r\n>","validationErrors: Record<string, string>","wait: TOperation<\r\n IWaitOperationData,\r\n Omit<IWaitOperationData, 'milliseconds'>\r\n>","configurationfactory: ConfigurationFactory","factory: ActionCreatorFactory","uuidv4","operations","actionConfig: T","configurationFactory: ConfigurationFactory","operations","uuidv4","duration: IDuration","operationConfig: IOperationConfiguration<\r\n ExtractOperationDataType<O>\r\n >","actionEditor: T","configurationFactory: ConfigurationFactory","languageLabel: ILanguageLabel","item","uuidv4","config: IResolvedEngineConfiguration","providersSettings: TTimelineProviderSettings","configurationFactory: ConfigurationFactory","settings: ITimelineProviderSettings","uuidv4","providerSettings: ITimelineProviderSettings","providersSettingsEditor: TimelineProvidersSettingsEditor","timelineProviders","configuration: IEngineConfiguration","newConfiguration: IEngineConfiguration","uuidv4","timelineConfig: ITimelineConfiguration","eventbus","eventbus","currentLanguage: TLanguageCode","labelCollections: any[]","eventbus","animationSettings: AnimationConfigWithData<'svg'>","eventbus","payload: IMutationEventPayload","eventbus","labelCtrl: LabelController","result: any[]","eventbus","eventbus","result: any[]","eventbus","subtitleTimeLookup: Record<number, () => void>","titleLanguageLookup: Record<string, string>","addClass","addControllerToElement","addGlobalsToOperation","animateWithClass","animate","announceToScreenReader","breakForEach","broadcastEvent","calc","clearElement","clearOperationData","clearStorage","compareDate","concatenateStrings","continueForEach","createElement","customFunction","endAction","endForEach","endWhen","extendController","filterArray","findInArray","forEach","formatDate","formatText","getAttributesFromElement","getControllerFromElement","getControllerInstance","getCurrentTime","getElementDimensions","getFocusedElement","getFormData","getImport","getQueryParams","getScrollPosition","getTextContent","httpDelete","httpPost","httpPut","invokeObjectMethod","isElementInViewport","loadFromStorage","loadJson","log","mapArray","math","otherwise","removeClass","removeControllerFromElement","removeElement","removePropertiesFromOperationData","reparentElement","replaceString","replaceText","requestAction","saveToStorage","scrollToElement","scrollToPosition","selectElement","setData","setElementAttributes","setElementContent","setFocus","setFormValue","setGlobalData","setOperationData","setStyle","setVariable","sortArray","splitString","startAction","substringText","toggleClass","toggleElement","toggleFormElement","validateForm","wait","when","operations","controllers","operationMetadata","result: ISubtitle[]","lines: string[]","i: number","l: number","rawLine: string","caption: Partial<ISubtitle> | null","res: string","times: string[]","parts: string[]","collection: ISubtitleCollection[]","newLanguage: ISubtitleCollection","uuidv4","importer: ISimpleResourceImporter","eventbus: IEventbus","resolvedConfig: IResolvedEngineConfiguration","eventActions: IAction[]","eventbus","DOMEventListenerController","LabelController","LottieController","MutationObserverController","NavigationController","ProgressbarController","RoutingController","SubtitlesController","configuration: IResolvedEngineConfiguration","eventbus: IEventbus","timelineProviders: Record<TimelineTypes, ITimelineProviderInfo>","languageManager: LanguageManager","eventbus: IEventbus","cache","_currentLanguage: TLanguageCode","_eventbus: IEventbus","eventbus","eventbus","actionRegistryListener: ActionRegistryEventbusListener | undefined","requestAction","operations: Record<string, TOperation<any>>","ops","controllers: Record<string, any>","ctrls","providers: Record<string, any>","prvdrs","eventbus: Record<string, any>","evtb"],"sources":["../src/util/guards/is-function.ts","../src/util/guards/is-object.ts","../src/util/prepare-value-for-serialization.ts","../src/diagnostics/devtool-event-listener.ts","../src/diagnostics/diagnostics.ts","../src/diagnostics/types.ts","../src/operation/helper/find-matching-operation-index.ts","../src/operation/helper/get-property-chain-value.ts","../src/operation/helper/deep-copy.ts","../src/operation/helper/globals.ts","../src/operation/helper/resolve-external-property-chain.ts","../src/operation/for-each.ts","../src/operation/helper/remove-operation-properties.ts","../src/operation/when.ts","../src/util/guards/is-promise.ts","../src/action/action.ts","../src/action/endable-action.ts","../src/action/timeline-action.ts","../src/util/dash-to-camel-case.ts","../src/build/generate-importer-source-code.ts","../src/operation/add-class.ts","../src/operation/helper/get-element-data.ts","../src/operation/helper/attach-controller-to-element.ts","../src/operation/helper/merge-operation-data.ts","../src/operation/helper/internal-resolve.ts","../src/operation/add-controller-to-element.ts","../src/operation/add-globals-to-operation.ts","../src/operation/animate.ts","../src/operation/animate-with-class.ts","../src/operation/announce-to-screen-reader.ts","../src/operation/break-for-each.ts","../src/operation/helper/resolve-event-arguments.ts","../src/operation/broadcast-event.ts","../src/operation/helper/resolve-property-values.ts","../src/operation/calc.ts","../src/operation/clear-element.ts","../src/operation/clear-operation-data.ts","../src/operation/clear-storage.ts","../src/operation/compare-date.ts","../src/operation/concatenate-strings.ts","../src/operation/continue-for-each.ts","../src/operation/create-element.ts","../src/operation/custom-function.ts","../src/operation/end-action.ts","../src/operation/end-for-each.ts","../src/operation/end-when.ts","../src/operation/extend-controller.ts","../src/operation/filter-array.ts","../src/operation/find-in-array.ts","../src/operation/format-date.ts","../src/operation/format-text.ts","../src/operation/get-attributes-from-element.ts","../src/operation/get-controller-from-element.ts","../src/operation/get-controller-instance.ts","../src/operation/get-current-time.ts","../src/operation/helper/modify-dimensions.ts","../src/operation/get-element-dimensions.ts","../src/operation/get-focused-element.ts","../src/operation/get-form-data.ts","../src/operation/get-import.ts","../src/operation/get-query-params.ts","../src/operation/get-scroll-position.ts","../src/operation/get-text-content.ts","../src/operation/http-delete.ts","../src/operation/http-post.ts","../src/operation/http-put.ts","../src/operation/invoke-object-method.ts","../src/operation/is-element-in-viewport.ts","../src/operation/load-from-storage.ts","../src/operation/load-json.ts","../src/operation/log.ts","../src/operation/map-array.ts","../src/util/guards/is-string.ts","../src/operation/math.ts","../src/operation/otherwise.ts","../src/operation/remove-class.ts","../src/operation/remove-controller-from-element.ts","../src/operation/remove-element.ts","../src/operation/remove-properties-from-operation-data.ts","../src/operation/reparent-element.ts","../src/operation/replace-string.ts","../src/operation/replace-text.ts","../src/operation/request-action.ts","../src/operation/save-to-storage.ts","../src/operation/scroll-to-element.ts","../src/operation/scroll-to-position.ts","../src/operation/select-element.ts","../src/operation/set-data.ts","../src/operation/set-element-attributes.ts","../src/operation/set-element-content.ts","../src/operation/set-focus.ts","../src/operation/set-form-value.ts","../src/operation/set-global-data.ts","../src/operation/set-operation-data.ts","../src/operation/set-style.ts","../src/operation/set-variable.ts","../src/operation/sort-array.ts","../src/operation/split-string.ts","../src/operation/start-action.ts","../src/operation/substring-text.ts","../src/operation/toggle-class.ts","../src/operation/toggle-element.ts","../src/operation/toggle-form-element.ts","../src/operation/validate-form.ts","../src/operation/wait.ts","../src/operation/index.ts","../src/configuration/api/action-creator-factory.ts","../src/configuration/api/action-editor.ts","../src/util/merge-if-missing.ts","../src/configuration/api/label-editor.ts","../src/util/animation-interval.ts","../src/timelineproviders/request-animation-frame-timeline-provider.ts","../src/timelineproviders/video-js-timeline-provider.ts","../src/timelineproviders/index.ts","../src/configuration/api/timeline-provider-settings-editor.ts","../src/configuration/api/configuration-factory.ts","../src/controllers/dom-event-listener-controller.ts","../src/controllers/base-controller.ts","../src/controllers/label-controller.ts","../src/controllers/lottie-controller.ts","../src/controllers/mutation-observer-controller.ts","../src/controllers/navigation-controller.ts","../src/controllers/progressbar-controller.ts","../src/controllers/routing-controller.ts","../src/controllers/subtitles-controller.ts","../src/controllers/index.ts","../src/operation/metadata/add-class.ts","../src/operation/metadata/add-controller-to-element.ts","../src/operation/metadata/add-globals-to-operation.ts","../src/operation/metadata/animate-with-class.ts","../src/operation/metadata/animate.ts","../src/operation/metadata/announce-to-screen-reader.ts","../src/operation/metadata/break-for-each.ts","../src/operation/metadata/broadcast-event.ts","../src/operation/metadata/calc.ts","../src/operation/metadata/clear-element.ts","../src/operation/metadata/clear-operation-data.ts","../src/operation/metadata/clear-storage.ts","../src/operation/metadata/compare-date.ts","../src/operation/metadata/concatenate-strings.ts","../src/operation/metadata/continue-for-each.ts","../src/operation/metadata/create-element.ts","../src/operation/metadata/custom-function.ts","../src/operation/metadata/end-action.ts","../src/operation/metadata/end-for-each.ts","../src/operation/metadata/end-when.ts","../src/operation/metadata/extend-controller.ts","../src/operation/metadata/filter-array.ts","../src/operation/metadata/find-in-array.ts","../src/operation/metadata/for-each.ts","../src/operation/metadata/format-date.ts","../src/operation/metadata/format-text.ts","../src/operation/metadata/get-attributes-from-element.ts","../src/operation/metadata/get-controller-from-element.ts","../src/operation/metadata/get-controller-instance.ts","../src/operation/metadata/get-current-time.ts","../src/operation/metadata/get-element-dimensions.ts","../src/operation/metadata/get-focused-element.ts","../src/operation/metadata/get-form-data.ts","../src/operation/metadata/get-import.ts","../src/operation/metadata/get-query-params.ts","../src/operation/metadata/get-scroll-position.ts","../src/operation/metadata/get-text-content.ts","../src/operation/metadata/http-delete.ts","../src/operation/metadata/http-post.ts","../src/operation/metadata/http-put.ts","../src/operation/metadata/invoke-object-method.ts","../src/operation/metadata/is-element-in-viewport.ts","../src/operation/metadata/load-from-storage.ts","../src/operation/metadata/load-json.ts","../src/operation/metadata/log.ts","../src/operation/metadata/map-array.ts","../src/operation/metadata/math.ts","../src/operation/metadata/otherwise.ts","../src/operation/metadata/remove-class.ts","../src/operation/metadata/remove-controller-from-element.ts","../src/operation/metadata/remove-element.ts","../src/operation/metadata/remove-properties-from-operation-data.ts","../src/operation/metadata/reparent-element.ts","../src/operation/metadata/replace-string.ts","../src/operation/metadata/replace-text.ts","../src/operation/metadata/request-action.ts","../src/operation/metadata/save-to-storage.ts","../src/operation/metadata/scroll-to-element.ts","../src/operation/metadata/scroll-to-position.ts","../src/operation/metadata/select-element.ts","../src/operation/metadata/set-data.ts","../src/operation/metadata/set-element-attributes.ts","../src/operation/metadata/set-element-content.ts","../src/operation/metadata/set-focus.ts","../src/operation/metadata/set-form-value.ts","../src/operation/metadata/set-global-data.ts","../src/operation/metadata/set-operation-data.ts","../src/operation/metadata/set-style.ts","../src/operation/metadata/set-variable.ts","../src/operation/metadata/sort-array.ts","../src/operation/metadata/split-string.ts","../src/operation/metadata/start-action.ts","../src/operation/metadata/substring-text.ts","../src/operation/metadata/toggle-class.ts","../src/operation/metadata/toggle-element.ts","../src/operation/metadata/toggle-form-element.ts","../src/operation/metadata/validate-form.ts","../src/operation/metadata/wait.ts","../src/operation/metadata/when.ts","../src/operation/metadata/index.ts","../src/configuration/api/name-providers.ts","../src/configuration/api/subtitle-converter.ts","../src/configuration/api/subtitle-editor.ts","../src/operation/helper/resolve-property-chain.ts","../src/configuration/configuration-resolver.ts","../src/controllers/metadata/dom-event-listener-controller.ts","../src/controllers/metadata/label-controller.ts","../src/controllers/metadata/lottie-controller.ts","../src/controllers/metadata/mutation-observer-controller.ts","../src/controllers/metadata/navigation-controller.ts","../src/controllers/metadata/progressbar-controller.ts","../src/controllers/metadata/routing-controller.ts","../src/controllers/metadata/subtitles-controller.ts","../src/controllers/metadata/index.ts","../src/eligius-engine.ts","../src/eventbus/actionregistry-eventbus-listener.ts","../src/eventbus/eventbus.ts","../src/eventbus/request-video-uri-interceptor.ts","../src/eventbus/index.ts","../src/operation/helper/set-global.ts","../src/language-manager.ts","../src/engine-factory.ts","../src/eventbus/events/metadata/before-request-timeline-uri.ts","../src/eventbus/events/metadata/before-request-video-url.ts","../src/eventbus/events/metadata/dom-mutation.ts","../src/eventbus/events/metadata/highlight-navigation.ts","../src/eventbus/events/metadata/language-change.ts","../src/eventbus/events/metadata/navigate-to-video-url.ts","../src/eventbus/events/metadata/push-history-state.ts","../src/eventbus/events/metadata/request-action.ts","../src/eventbus/events/metadata/request-current-language.ts","../src/eventbus/events/metadata/request-current-navigation.ts","../src/eventbus/events/metadata/request-current-timeline-position.ts","../src/eventbus/events/metadata/request-current-video-position.ts","../src/eventbus/events/metadata/request-engine-root.ts","../src/eventbus/events/metadata/request-function.ts","../src/eventbus/events/metadata/request-instance.ts","../src/eventbus/events/metadata/request-label-collection.ts","../src/eventbus/events/metadata/request-label-collections.ts","../src/eventbus/events/metadata/request-timeline-cleanup.ts","../src/eventbus/events/metadata/request-timeline-uri.ts","../src/eventbus/events/metadata/request-video-cleanup.ts","../src/eventbus/events/metadata/request-video-url.ts","../src/eventbus/events/metadata/timeline-complete.ts","../src/eventbus/events/metadata/timeline-container-request.ts","../src/eventbus/events/metadata/timeline-current-timeline-change.ts","../src/eventbus/events/metadata/timeline-duration-request.ts","../src/eventbus/events/metadata/timeline-duration.ts","../src/eventbus/events/metadata/timeline-firstframe.ts","../src/eventbus/events/metadata/timeline-pause-request.ts","../src/eventbus/events/metadata/timeline-pause.ts","../src/eventbus/events/metadata/timeline-play-request.ts","../src/eventbus/events/metadata/timeline-play-toggle-request.ts","../src/eventbus/events/metadata/timeline-play.ts","../src/eventbus/events/metadata/timeline-request-current-timeline.ts","../src/eventbus/events/metadata/timeline-resize-request.ts","../src/eventbus/events/metadata/timeline-resize.ts","../src/eventbus/events/metadata/timeline-restart.ts","../src/eventbus/events/metadata/timeline-seek-request.ts","../src/eventbus/events/metadata/timeline-seek.ts","../src/eventbus/events/metadata/timeline-seeked.ts","../src/eventbus/events/metadata/timeline-stop-request.ts","../src/eventbus/events/metadata/timeline-stop.ts","../src/eventbus/events/metadata/timeline-time.ts","../src/eventbus/events/metadata/video-complete.ts","../src/eventbus/events/metadata/index.ts","../src/importer/eligius-resource-importer.ts"],"sourcesContent":["export function isFunction(value: any): value is (...arg: any) => any {\r\n return typeof value === 'function';\r\n}\r\n","export function isObject(\r\n value: unknown\r\n): value is Record<PropertyKey, unknown> {\r\n return !!value && typeof value === 'object' && !Array.isArray(value);\r\n}\r\n","import jQuery from 'jquery';\r\nimport {isFunction} from './guards/is-function.ts';\r\nimport {isObject} from './guards/is-object.ts';\r\n\r\nexport function prepareValueForSerialization(value: unknown): any {\r\n if (Array.isArray(value)) {\r\n return (value as Array<any>).map(prepareValueForSerialization);\r\n } else if (value instanceof jQuery) {\r\n return '[jQuery object]';\r\n } else if (isObject(value)) {\r\n if (\r\n value.constructor.toString().substring(0, 5) === 'class' ||\r\n !value.constructor.toString().startsWith('function Object()')\r\n ) {\r\n const funcString = value.constructor.toString();\r\n return funcString.substring(0, funcString.indexOf('{') + 1);\r\n }\r\n return Object.fromEntries(\r\n Object.entries(value).map(([propName, propValue]) => [\r\n propName,\r\n prepareValueForSerialization(propValue),\r\n ])\r\n );\r\n } else if (isFunction(value)) {\r\n const funcString = value.toString();\r\n const parenIndex = funcString.indexOf('{');\r\n if (parenIndex > -1) {\r\n return funcString.substring(0, funcString.indexOf('{') + 1);\r\n }\r\n return funcString;\r\n }\r\n return value;\r\n}\r\n","import type {IEventbusListener} from '../eventbus/index.ts';\r\nimport {prepareValueForSerialization} from '../util/prepare-value-for-serialization.ts';\r\nimport type {IDiagnosticsAgent} from './types.ts';\r\n\r\nexport class DevToolEventListener implements IEventbusListener {\r\n constructor(private agent: IDiagnosticsAgent) {}\r\n\r\n handleEvent(\r\n eventName: string,\r\n eventTopic: string | undefined,\r\n args: any[]\r\n ): void {\r\n const message = {\r\n eventName,\r\n eventTopic,\r\n args: prepareValueForSerialization(args),\r\n };\r\n try {\r\n this.agent.postMessage('eligius-diagnostics-event', message);\r\n } catch (e) {\r\n console.error('postmessage failed');\r\n console.error(e);\r\n console.info('message', message);\r\n }\r\n }\r\n}\r\n","import type {TDiagnosticType} from './types.ts';\r\n\r\nlet active: boolean;\r\n\r\nexport function send(_name: TDiagnosticType, _data: any): void {\r\n console.log(_name, _data);\r\n}\r\n\r\nexport function setActive(value: boolean): void {\r\n active = value;\r\n}\r\n\r\nexport function isActive(): boolean {\r\n return active;\r\n}\r\n\r\nexport const Diagnostics = {\r\n send,\r\n get active() {\r\n return active;\r\n },\r\n set active(value: boolean) {\r\n active = value;\r\n },\r\n};\r\n","export type TDevToolsEventSubscriber = (event: TEventData) => void;\r\n\r\nexport type TPlayControlEventKind = 'play' | 'stop' | 'pause' | 'seek';\r\nexport const DEV_TOOLS_KEY = '__ELIGIUS_DEV_TOOLS__';\r\n\r\nexport type TWindowWithDevtools = Window & {\r\n [DEV_TOOLS_KEY]: IDiagnosticsInfo | undefined;\r\n};\r\n\r\nexport type TDevToolsMessage = {\r\n source: 'eligius-inspect-devtools';\r\n name: 'event';\r\n data: TEventData;\r\n};\r\n\r\nexport type TEventData = {\r\n type: 'playcontrol';\r\n data: IPlayControlEvent;\r\n};\r\n\r\nexport interface IPlayControlEvent {\r\n kind: TPlayControlEventKind;\r\n args?: any[];\r\n}\r\n\r\nexport interface IDiagnosticsAgent {\r\n postMessage(name: TDiagnosticType, messageData: any): void;\r\n subscribe(subscriber: TDevToolsEventSubscriber): () => void;\r\n}\r\n\r\nexport interface IDiagnosticsInfo {\r\n get agent(): IDiagnosticsAgent;\r\n}\r\n\r\nexport type TDiagnosticType =\r\n | 'eligius-diagnostics-factory'\r\n | 'eligius-diagnostics-engine'\r\n | 'eligius-diagnostics-event'\r\n | 'eligius-diagnostics-action'\r\n | 'eligius-diagnostics-action-error'\r\n | 'eligius-diagnostics-operation';\r\n\r\nexport type TDiagnosticsMessageSource =\r\n | 'eligius-inspect-agent'\r\n | 'eligius-inspect-devtools';\r\n","import type {IResolvedOperation} from '../../configuration/types.ts';\r\n\r\n/**\r\n * This function can be used to find the index of a matching closing operation within a list of operations.\r\n *\r\n * Assume the following array of operations:\r\n * ```ts\r\n * [\r\n * {systemName:'name1'}, // index 0\r\n * {systemName:'forEach'}, // index 1\r\n * {systemName:'name2'}, // index 2\r\n * {systemName:'forEach'} // index 3\r\n * {systemName:'name3'} // index 4\r\n * {systemName:'endForEach'} // index 5\r\n * {systemName:'endForEach'} // index 6\r\n * {systemName:'name3'} // index 7\r\n * ]\r\n * ```\r\n *\r\n * Given the `forEach` instance at index 1, this function will return index 6. Given the `forEach` at index 3, it will yield index 5.\r\n *\r\n * Returns `true` when the given `operation.systemName` equals the specified `matchingName` and the current counter value is zero.\r\n *\r\n * If the `matchingName` matches `operation.systemName` but the counter is greater than zero, the counter is decremented.\r\n *\r\n * If the `operation.systemName` equals `self` (the name of the operation that requires to find its match), then counter is incremented.\r\n *\r\n * @param this\r\n * @param operation\r\n *\r\n */\r\nexport function findMatchingOperationIndex(\r\n this: {counter: number; self: string; matchingName: string},\r\n operation: IResolvedOperation\r\n) {\r\n if (operation.systemName === this.self) {\r\n this.counter = this.counter + 1;\r\n return false;\r\n }\r\n\r\n if (operation.systemName === this.matchingName && this.counter === 0) {\r\n return true;\r\n }\r\n\r\n if (operation.systemName === this.matchingName && this.counter > 0) {\r\n this.counter = this.counter - 1;\r\n }\r\n\r\n return false;\r\n}\r\n","/**\r\n /**\r\n * Gets the value for the given property chain. A property chain is defined by a string array.\r\n *\r\n * For example, this property chain: `[mySource, subSource, element, value]` should be extracted from an object of this shape:\r\n * ```ts\r\n * const foo = {\r\n * mySource: {\r\n * subSource: {\r\n * element: {\r\n * value: 'bar'\r\n * }\r\n * }\r\n * }\r\n * }\r\n * ```\r\n *\r\n * The result of the invocation `getPropertyChainValue([mySource, subSource, element, value], foo)` would then yield the value `bar`.\r\n */\r\nexport function getPropertyChainValue(\r\n propertyChain: string[],\r\n sourceObject: Record<string, any>\r\n) {\r\n let suffix = null;\r\n\r\n const result = propertyChain.reduce((currentInstance, prop, index) => {\r\n if (!currentInstance) {\r\n throw new Error(\r\n `Property chain '${propertyChain.join('.')}' cannot be resolved.`\r\n );\r\n }\r\n\r\n if (index === propertyChain.length - 1) {\r\n const parts = prop.split('+');\r\n if (parts.length > 1) {\r\n prop = parts[0];\r\n suffix = parts[1];\r\n }\r\n }\r\n return currentInstance[prop];\r\n }, sourceObject);\r\n\r\n return suffix ? `${result}${suffix}` : result;\r\n}\r\n","import {isDefined} from 'ts-is-present';\r\n\r\nconst copyFunction =\r\n typeof structuredClone !== 'undefined'\r\n ? structuredClone\r\n : <T>(original: any) => JSON.parse(JSON.stringify(original)) as T;\r\n\r\nexport function deepCopy<T>(original: T): T {\r\n if (isDefined(original)) {\r\n return copyFunction<T>(original);\r\n }\r\n return original;\r\n}\r\n","import {deepCopy} from './deep-copy.ts';\r\nexport type TGlobalCache = Record<string, any>;\r\nconst cache: TGlobalCache = {};\r\n\r\nfunction _getGlobals(\r\n cache: TGlobalCache,\r\n name?: string\r\n): Record<string, any> | any {\r\n const value = name ? cache[name] : cache;\r\n return value && value !== cache ? deepCopy(value) : value;\r\n}\r\n\r\nfunction _setGlobals(cache: TGlobalCache, newValues: TGlobalCache): void {\r\n Object.entries(newValues).forEach(([name, value]) => (cache[name] = value));\r\n}\r\n\r\nfunction _clearGlobals(cache: TGlobalCache): void {\r\n const keys = Object.keys(cache);\r\n keys.forEach(key => delete cache[key]);\r\n}\r\n\r\nexport const getGlobals: (name?: string) => TGlobalCache | any =\r\n _getGlobals.bind(null, cache);\r\n\r\nexport const setGlobals: (newValues: TGlobalCache) => void = _setGlobals.bind(\r\n null,\r\n cache\r\n);\r\n\r\nexport const clearGlobals: () => void = _clearGlobals.bind(null, cache);\r\n","import type {IOperationScope, TOperationData} from '../types.ts';\r\nimport {getPropertyChainValue} from './get-property-chain-value.ts';\r\nimport {getGlobals} from './globals.ts';\r\n\r\n/**\r\n * Resolves operation and global data property chains.\r\n *\r\n * An operation data property chain is designated by a `operationdata.` suffix, followed by an arbitrary property chain.\r\n * For global data the suffix should be `globaldata.`\r\n *\r\n * If the propertyChainOrRegularObject is not a property chain, this value is returned instead.\r\n */\r\nexport function resolveExternalPropertyChain(\r\n sourceObject: TOperationData,\r\n operationScope: IOperationScope,\r\n propertyChainOrRegularObject:\r\n | ExternalProperty\r\n | Record<string, any>\r\n | null\r\n | undefined\r\n) {\r\n if (\r\n propertyChainOrRegularObject === null ||\r\n propertyChainOrRegularObject === undefined\r\n ) {\r\n return null;\r\n }\r\n\r\n if (isExternalProperty(propertyChainOrRegularObject)) {\r\n const propNames = propertyChainOrRegularObject.split('.');\r\n const prefix = propNames.shift()!.toLowerCase();\r\n switch (prefix) {\r\n case '$operationdata':\r\n return getPropertyChainValue(propNames, sourceObject);\r\n case '$globaldata':\r\n return getPropertyChainValue(propNames, getGlobals());\r\n case '$scope':\r\n return getPropertyChainValue(propNames, operationScope);\r\n }\r\n }\r\n\r\n return propertyChainOrRegularObject;\r\n}\r\n\r\nexport function isExternalProperty(\r\n value: ExternalProperty | Record<string, any>\r\n): value is ExternalProperty {\r\n return (\r\n typeof value === 'string' &&\r\n (value.toLocaleLowerCase().startsWith('$operationdata.') ||\r\n value.toLocaleLowerCase().startsWith('$globaldata.') ||\r\n value.toLocaleLowerCase().startsWith('$scope.'))\r\n );\r\n}\r\n\r\nexport type ExternalProperty =\r\n | `$operationdata.${string}`\r\n | `$globaldata.${string}`\r\n | `$scope.${string}`;\r\n","import type {breakForEach} from './break-for-each.ts';\r\nimport type {continueForEach} from './continue-for-each.ts';\r\nimport {findMatchingOperationIndex} from './helper/find-matching-operation-index.ts';\r\nimport {\r\n type ExternalProperty,\r\n resolveExternalPropertyChain,\r\n} from './helper/resolve-external-property-chain.ts';\r\nimport type {IOperationScope, TOperation} from './types.ts';\r\n\r\nexport interface IForEachOperationData {\r\n /**\r\n * @type=ParameterType:array|ParameterType:string\r\n * @required\r\n */\r\n collection: unknown[] | string;\r\n}\r\n\r\n/**\r\n * This operation iterates over the given collection.\r\n *\r\n * Each iteration the current item from the specified collection is\r\n * assigned to the {@link IOperationScope.currentItem|currentItem} property on the {@link IOperationScope|operation scope}.\r\n *\r\n * At the start of the loop, the associated {@link endForEach} operation is determined and when\r\n * the last iteration is completed the flow control is set to the index of that operation.\r\n *\r\n * The {@link continueForEach|continue} and {@link breakForEach|break} operations can be used to control the\r\n * loop iterations.\r\n *\r\n * @category Control Flow\r\n */\r\nexport const forEach: TOperation<IForEachOperationData> = function (\r\n operationData: IForEachOperationData\r\n) {\r\n const {collection} = operationData;\r\n const resolvedCollection =\r\n typeof collection === 'string'\r\n ? (resolveExternalPropertyChain(\r\n operationData,\r\n this,\r\n collection as ExternalProperty\r\n ) as any[])\r\n : collection;\r\n\r\n if (\r\n resolvedCollection !== null &&\r\n resolvedCollection !== undefined &&\r\n !Array.isArray(resolvedCollection)\r\n ) {\r\n throw new Error(\r\n 'Expected resolved collection property to be array type, string value was probably not resolved correctly'\r\n );\r\n }\r\n\r\n // First iteration of the loop\r\n if (this.loopIndex === undefined) {\r\n this.loopEndIndex = findEndForEachIndex(this);\r\n if (resolvedCollection?.length) {\r\n this.loopIndex = 0;\r\n this.loopLength = resolvedCollection.length - 1;\r\n this.loopStartIndex = this.currentIndex;\r\n } else {\r\n this.newIndex = this.loopEndIndex;\r\n\r\n delete this.loopIndex;\r\n delete this.loopLength;\r\n delete this.loopStartIndex;\r\n delete this.loopEndIndex;\r\n }\r\n }\r\n\r\n if (resolvedCollection?.length && this.loopIndex !== undefined) {\r\n this.currentItem = resolvedCollection[this.loopIndex];\r\n }\r\n\r\n return operationData;\r\n};\r\n\r\nfunction findEndForEachIndex(scope: IOperationScope) {\r\n const currentIndex = scope.currentIndex + 1;\r\n const list = scope.operations.slice(currentIndex);\r\n\r\n const index = list.findIndex(\r\n findMatchingOperationIndex.bind({\r\n counter: 0,\r\n self: forEachSystemName,\r\n matchingName: endForEachSystemName,\r\n })\r\n );\r\n const endLoopIndex =\r\n index > -1 ? index + currentIndex : scope.operations.length;\r\n\r\n return endLoopIndex;\r\n}\r\n\r\nexport const forEachSystemName = 'forEach';\r\nexport const endForEachSystemName = 'endForEach';\r\n","/**\r\n * Removes specified properties from an operation data object.\r\n * This is a helper function to eliminate repetitive property deletion code across operations.\r\n *\r\n * @template T - The type of the operation data object\r\n * @template K - The keys to remove from the object (must be keys of T)\r\n * @param operationData - The operation data object to mutate\r\n * @param keys - The property keys to delete from the object\r\n * @returns The mutated operation data object with specified properties removed (typed as Omit<T, K>)\r\n *\r\n * @example\r\n * ```typescript\r\n * interface IMyOperationData {\r\n * selectedElement: JQuery;\r\n * animationDuration: number;\r\n * animationEasing: string;\r\n * }\r\n *\r\n * const data: IMyOperationData = {\r\n * selectedElement: $element,\r\n * animationDuration: 500,\r\n * animationEasing: 'ease-in'\r\n * };\r\n *\r\n * // Remove multiple properties at once\r\n * const result = removeProperties(data, 'animationDuration', 'animationEasing');\r\n * // result is typed as Omit<IMyOperationData, 'animationDuration' | 'animationEasing'>\r\n * // result = { selectedElement: $element }\r\n * ```\r\n */\r\nexport function removeProperties<T extends object, K extends keyof T>(\r\n operationData: T,\r\n ...keys: K[]\r\n): Omit<T, K> {\r\n for (const key of keys) {\r\n delete (operationData as any)[key];\r\n }\r\n return operationData as Omit<T, K>;\r\n}\r\n","import {findMatchingOperationIndex} from './helper/find-matching-operation-index.ts';\r\nimport {removeProperties} from './helper/remove-operation-properties.ts';\r\nimport {\r\n type ExternalProperty,\r\n resolveExternalPropertyChain,\r\n} from './helper/resolve-external-property-chain.ts';\r\nimport type {IOperationScope, TOperation} from './types.ts';\r\n\r\ntype TOperator = '!=' | '==' | '>=' | '<=' | '>' | '<';\r\ntype TValue =\r\n | `'${string}'`\r\n | number\r\n | `$operationdata.${string}`\r\n | `$globaldata.${string}`\r\n | `$scope.${string}`;\r\n\r\ntype TExpression = `${TValue}${TOperator}${TValue}`;\r\n\r\nexport interface IWhenOperationData {\r\n /**\r\n * @type=ParameterType:expression\r\n * @required\r\n * @erased\r\n */\r\n expression: TExpression;\r\n}\r\n\r\n/**\r\n * When the given expression evaluates to false, subsequent operations will be skipped\r\n * until an {@link endWhen} or {@link otherwise} operation is encountered.\r\n *\r\n * Practically, this means an `if` or `if`/`else` statement control flow implementation in a list of operations.\r\n *\r\n * The expression is passed in as a formatted string.\r\n * The left and right values of the expression can be defined like this:\r\n *\r\n * 'constant': for a constant string\r\n * 100: for a constant number\r\n * $operationData.foo: for an operation data value\r\n * $globaldata.foo: for a global data value\r\n * $scope.loopIndex: for a scope value\r\n * @foo: for a variable value\r\n *\r\n * @example\r\n * $scope.variables.foo=='bar'\r\n * @example\r\n * $globalData.foo>$scope.variables.bar\r\n * @example\r\n * $operationData.foo!=100\r\n *\r\n * @param operationData\r\n * @returns\r\n *\r\n * @category Control Flow\r\n */\r\nexport const when: TOperation<\r\n IWhenOperationData,\r\n Omit<IWhenOperationData, 'expression'>\r\n> = function (operationData: IWhenOperationData) {\r\n const [left, operator, right] = parseExpression(\r\n operationData.expression,\r\n operationData,\r\n this\r\n );\r\n\r\n removeProperties(operationData, 'expression');\r\n\r\n this.whenEvaluation = evaluations[operator](left, right);\r\n\r\n if (!this.whenEvaluation) {\r\n this.newIndex = findNextFlowControlIndex(this);\r\n }\r\n\r\n return operationData;\r\n};\r\n\r\nfunction parseExpression(\r\n expression: TExpression,\r\n operationData: IWhenOperationData,\r\n operationScope: IOperationScope\r\n): [TValue, TOperator, TValue] {\r\n const [left, right] = expression.split(/!=|==|>=|<=|>|</);\r\n\r\n const operator = expression.substring(\r\n left.length,\r\n expression.length - right.length\r\n ) as TOperator;\r\n\r\n const leftNr = parseFloat(left);\r\n const rightNr = parseFloat(right);\r\n\r\n return [\r\n (Number.isNaN(leftNr)\r\n ? resolveExternalPropertyChain(\r\n operationData,\r\n operationScope,\r\n left as ExternalProperty\r\n )\r\n : leftNr) as TValue,\r\n operator,\r\n (Number.isNaN(rightNr)\r\n ? resolveExternalPropertyChain(\r\n operationData,\r\n operationScope,\r\n right as ExternalProperty\r\n )\r\n : rightNr) as TValue,\r\n ];\r\n}\r\n\r\nconst evaluations: Record<\r\n TOperator,\r\n (left: string | number, right: string | number) => boolean\r\n> = {\r\n '==': (left: string | number, right: string | number) => left === right,\r\n '!=': (left: string | number, right: string | number) => left !== right,\r\n '>=': (left: string | number, right: string | number) => left >= right,\r\n '<=': (left: string | number, right: string | number) => left <= right,\r\n '>': (left: string | number, right: string | number) => left > right,\r\n '<': (left: string | number, right: string | number) => left < right,\r\n};\r\n\r\nfunction findNextFlowControlIndex(scope: IOperationScope) {\r\n const currentIndex = scope.currentIndex + 1;\r\n const list = scope.operations.slice(currentIndex);\r\n\r\n const otherWiseIndex = list.findIndex(\r\n findMatchingOperationIndex.bind({\r\n counter: 0,\r\n self: whenSystemName,\r\n matchingName: otherwiseSystemName,\r\n })\r\n );\r\n if (otherWiseIndex > -1) {\r\n return otherWiseIndex + currentIndex;\r\n }\r\n\r\n const endWhenIndex = list.findIndex(\r\n findMatchingOperationIndex.bind({\r\n counter: 0,\r\n self: whenSystemName,\r\n matchingName: endWhenSystemName,\r\n })\r\n );\r\n\r\n return endWhenIndex > -1\r\n ? endWhenIndex + currentIndex\r\n : scope.operations.length;\r\n}\r\n\r\nexport const whenSystemName = 'when';\r\nexport const otherwiseSystemName = 'otherwise';\r\nexport const endWhenSystemName = 'endWhen';\r\n","export function isPromise(obj: any): obj is Promise<unknown> {\r\n return typeof obj === 'object' && typeof obj.then === 'function';\r\n}\r\n","import type {IResolvedOperation} from '../configuration/types.ts';\r\nimport {Diagnostics} from '../diagnostics/index.ts';\r\nimport type {IEventbus} from '../eventbus/types.ts';\r\nimport {\r\n endForEachSystemName,\r\n forEachSystemName,\r\n} from '../operation/for-each.ts';\r\nimport {deepCopy} from '../operation/helper/deep-copy.ts';\r\nimport type {IOperationScope, TOperationData} from '../operation/types.ts';\r\nimport {endWhenSystemName, whenSystemName} from '../operation/when.ts';\r\nimport {isPromise} from '../util/guards/is-promise.ts';\r\nimport type {IAction} from './types.ts';\r\n\r\nexport class Action implements IAction {\r\n public id = '';\r\n protected _scopeStack: IOperationScope[] = [];\r\n\r\n constructor(\r\n public name: string,\r\n public startOperations: IResolvedOperation[],\r\n protected eventbus: IEventbus\r\n ) {}\r\n\r\n start(initOperationData?: TOperationData): Promise<TOperationData> {\r\n Diagnostics.active &&\r\n Diagnostics.send(\r\n 'eligius-diagnostics-action',\r\n `${this.name ?? 'Action'} begins executing start operations`\r\n );\r\n\r\n this._initializeScopeStack();\r\n\r\n const result = new Promise<TOperationData>((resolve, reject) => {\r\n this.executeOperation(\r\n this.startOperations,\r\n 0,\r\n resolve,\r\n reject,\r\n initOperationData\r\n );\r\n }).catch(e => {\r\n Diagnostics.active &&\r\n Diagnostics.send('eligius-diagnostics-action-error', {\r\n name: this.name,\r\n error: e,\r\n });\r\n console.error(`Error in action start '${this.name}'`);\r\n console.error(e);\r\n throw e;\r\n });\r\n return !Diagnostics.active\r\n ? result\r\n : result.then(operationsResult => {\r\n Diagnostics.send(\r\n 'eligius-diagnostics-action',\r\n `${this.name ?? 'Action'} finished executing start operations`\r\n );\r\n return operationsResult;\r\n });\r\n }\r\n\r\n protected _initializeScopeStack() {\r\n this._scopeStack = [\r\n {\r\n currentIndex: -1,\r\n eventbus: this.eventbus,\r\n operations: this.startOperations,\r\n },\r\n ];\r\n }\r\n\r\n private _pushScope(parentScope: IOperationScope): IOperationScope {\r\n const newScope = {\r\n get currentIndex() {\r\n return parentScope.currentIndex;\r\n },\r\n set currentIndex(value: number) {\r\n parentScope.currentIndex = value;\r\n },\r\n get eventbus() {\r\n return parentScope.eventbus;\r\n },\r\n get operations() {\r\n return parentScope.operations;\r\n },\r\n parent: parentScope,\r\n };\r\n this._scopeStack.push(newScope);\r\n return newScope;\r\n }\r\n\r\n private _popScope() {\r\n this._scopeStack.pop();\r\n }\r\n\r\n executeOperation(\r\n operations: IResolvedOperation[],\r\n operationIndex: number,\r\n resolve: (value?: any | PromiseLike<any>) => void,\r\n reject: (reason?: any) => void,\r\n previousOperationData: TOperationData | undefined = {}\r\n ): void {\r\n let scope = this._scopeStack[this._scopeStack.length - 1];\r\n if (scope.newIndex !== undefined) {\r\n operationIndex = scope.newIndex;\r\n delete scope.newIndex;\r\n }\r\n\r\n scope.currentIndex = operationIndex;\r\n\r\n if (operationIndex < operations.length) {\r\n const operationInfo = operations[operationIndex];\r\n\r\n const copy = deepCopy(operationInfo.operationData ?? {});\r\n\r\n const mergedOperationData = Object.assign(previousOperationData, copy);\r\n\r\n if (operationInfo.systemName === whenSystemName) {\r\n scope = this._pushScope(scope);\r\n } else if (\r\n operationInfo.systemName === forEachSystemName &&\r\n scope.owner !== operationInfo\r\n ) {\r\n scope = this._pushScope(scope);\r\n scope.owner = operationInfo;\r\n }\r\n\r\n Diagnostics.active &&\r\n Diagnostics.send('eligius-diagnostics-operation', {\r\n systemName: operationInfo.systemName,\r\n operationData: mergedOperationData,\r\n scope: {\r\n ...scope,\r\n eventbus: undefined,\r\n },\r\n });\r\n\r\n const operationResult = operationInfo.instance.call(\r\n scope,\r\n mergedOperationData\r\n );\r\n\r\n if (\r\n operationInfo.systemName === endWhenSystemName ||\r\n (operationInfo.systemName === endForEachSystemName &&\r\n scope.newIndex === undefined)\r\n ) {\r\n this._popScope();\r\n }\r\n\r\n if (isPromise(operationResult)) {\r\n operationResult\r\n .then(promisedOperationResult =>\r\n this.executeOperation(\r\n operations,\r\n ++operationIndex,\r\n resolve,\r\n reject,\r\n promisedOperationResult as TOperationData\r\n )\r\n )\r\n .catch((error: any) => {\r\n reject(error);\r\n });\r\n } else {\r\n this.executeOperation(\r\n operations,\r\n ++operationIndex,\r\n resolve,\r\n reject,\r\n operationResult\r\n );\r\n }\r\n } else {\r\n resolve(previousOperationData);\r\n }\r\n }\r\n}\r\n","import type {IResolvedOperation} from '../configuration/types.ts';\r\nimport {Diagnostics} from '../diagnostics/index.ts';\r\nimport type {IEventbus} from '../eventbus/types.ts';\r\nimport type {TOperationData} from '../operation/types.ts';\r\nimport {Action} from './action.ts';\r\n\r\nexport class EndableAction extends Action {\r\n constructor(\r\n name: string,\r\n startOperations: IResolvedOperation[],\r\n public endOperations: IResolvedOperation[],\r\n eventBus: IEventbus\r\n ) {\r\n super(name, startOperations, eventBus);\r\n }\r\n\r\n end(initOperationData?: TOperationData): Promise<TOperationData> {\r\n Diagnostics.active &&\r\n Diagnostics.send(\r\n 'eligius-diagnostics-action',\r\n `${this.name ?? 'Action'} begins executing end operations`\r\n );\r\n\r\n if (!this.endOperations.length) {\r\n return Promise.resolve(initOperationData ?? {});\r\n }\r\n\r\n this._initializeScopeStack();\r\n\r\n const result = new Promise<TOperationData>((resolve, reject) => {\r\n this.executeOperation(\r\n this.endOperations,\r\n 0,\r\n resolve,\r\n reject,\r\n initOperationData\r\n );\r\n }).catch(e => {\r\n Diagnostics.active &&\r\n Diagnostics.send('eligius-diagnostics-action-error', {\r\n name: this.name,\r\n error: e,\r\n });\r\n console.error(`Error in action end '${this.name}'`);\r\n throw e;\r\n });\r\n\r\n return !Diagnostics.active\r\n ? result\r\n : result.then(operationsResult => {\r\n Diagnostics.send(\r\n 'eligius-diagnostics-action',\r\n `${this.name ?? 'Action'} finished executing start operations`\r\n );\r\n return operationsResult;\r\n });\r\n }\r\n}\r\n","import type {IResolvedOperation} from '../configuration/types.ts';\r\nimport type {IEventbus} from '../eventbus/types.ts';\r\nimport type {TOperationData} from '../operation/types.ts';\r\nimport type {IStrictDuration} from '../types.ts';\r\nimport {EndableAction} from './endable-action.ts';\r\nimport type {ITimelineAction} from './types.ts';\r\n\r\nexport class TimelineAction extends EndableAction implements ITimelineAction {\r\n private _active: boolean = false;\r\n public get active() {\r\n return this._active;\r\n }\r\n\r\n constructor(\r\n name: string,\r\n startOperations: IResolvedOperation[],\r\n endOperations: IResolvedOperation[],\r\n public duration: IStrictDuration,\r\n eventBus: IEventbus\r\n ) {\r\n super(name, startOperations, endOperations, eventBus);\r\n }\r\n\r\n start(initOperationData?: TOperationData): Promise<TOperationData> {\r\n if (!this.active) {\r\n this._active = Boolean(this.endOperations.length);\r\n return super.start(initOperationData);\r\n }\r\n\r\n return Promise.resolve({});\r\n }\r\n\r\n end(initOperationData: TOperationData): Promise<TOperationData> {\r\n return super.end(initOperationData).then(result => {\r\n this._active = false;\r\n return result;\r\n });\r\n }\r\n}\r\n","export default function dashToCamelCase(input: string) {\r\n return input.replace(/-([a-z])/g, g => g[1].toUpperCase());\r\n}\r\n","import fs from 'node:fs';\r\nimport path from 'node:path';\r\nimport type {TOperationData} from 'operation/types.ts';\r\nimport type {\r\n IActionConfiguration,\r\n IEndableActionConfiguration,\r\n IEngineConfiguration,\r\n IOperationConfiguration,\r\n} from '../configuration/types.ts';\r\nimport dashToCamelCase from '../util/dash-to-camel-case.ts';\r\n\r\ninterface ImportInfo {\r\n systemName: string;\r\n path?: string;\r\n defaultImport?: boolean;\r\n}\r\n\r\nexport interface IAssetInfo {\r\n path: string;\r\n extension: string;\r\n}\r\n\r\n/**\r\n * This function takes an Eligius engine configuration, a root path for the configuration file and an arbitrary list of asset info.\r\n * The asset info determines a number of subdirectories in the root path that contain the different assets used by the presentation.\r\n * I.e. html, json, etc.\r\n *\r\n * @param config\r\n * @param configPath\r\n * @param assetInfo\r\n */\r\nexport function generateImporterSourceCode(\r\n config: IEngineConfiguration,\r\n configPath: string,\r\n assetInfo: IAssetInfo[]\r\n) {\r\n const importPaths = _gatherImportPaths(config, configPath, assetInfo);\r\n\r\n const importerSourceCode = _generateSourceCode(importPaths);\r\n\r\n return importerSourceCode;\r\n}\r\n\r\nfunction _generateSourceCode(importPaths: ImportInfo[]) {\r\n const result = importPaths\r\n .filter(x => x.defaultImport)\r\n .map(imp => `import ${imp.systemName} from '${imp.path}';`)\r\n .concat(\r\n importPaths\r\n .filter(x => !x.defaultImport)\r\n .map(\r\n imp => `import {${imp.systemName}} from '${imp.path ?? 'eligius'}';`\r\n )\r\n );\r\n result.push(`import { ISimpleResourceImporter } from 'eligius';`);\r\n result.push('');\r\n\r\n result.push('const imports: Record<string, any> = {');\r\n result.push(\r\n ...importPaths.map(\r\n imp => `${imp.systemName}: { '${imp.systemName}': ${imp.systemName} },`\r\n )\r\n );\r\n result.push('};');\r\n result.push('');\r\n result.push(\r\n 'class EligiusResourceImporter implements ISimpleResourceImporter {'\r\n );\r\n result.push('import(name: string): Record<string, any> {');\r\n result.push('if (imports.hasOwnProperty(name)) { return imports[name]; }');\r\n result.push('throw Error(\"Unknown systemName: \" + name);');\r\n result.push('}}');\r\n result.push('');\r\n result.push('export default EligiusResourceImporter;');\r\n\r\n return result.join('\\n');\r\n}\r\n\r\nfunction _gatherImportPaths(\r\n config: IEngineConfiguration,\r\n configPath: string,\r\n assetInfo: IAssetInfo[]\r\n): ImportInfo[] {\r\n return [\r\n ..._gatherOperations(config),\r\n ...assetInfo.flatMap(info =>\r\n _gatherAssets(configPath, info.path, info.extension)\r\n ),\r\n ..._gatherControllers(config),\r\n ..._gatherProviders(config),\r\n ..._gatherEngines(config),\r\n ];\r\n}\r\n\r\nfunction _gatherAssets(assetPath: string, subdir: string, extension: string) {\r\n const entries = fs.readdirSync(path.join(assetPath, subdir));\r\n return entries.map(file => {\r\n const importName = `${dashToCamelCase(path.basename(file, extension))}`;\r\n return {\r\n systemName: importName,\r\n path: `./${subdir}/${file}`,\r\n defaultImport: true,\r\n };\r\n });\r\n}\r\n\r\nfunction _gatherControllers(config: IEngineConfiguration) {\r\n let importPaths = [] as [] as ImportInfo[];\r\n importPaths.push(\r\n ..._gatherControllerImportPathsFromActions(config.initActions)\r\n );\r\n importPaths.push(..._gatherControllerImportPathsFromActions(config.actions));\r\n importPaths.push(\r\n ..._gatherControllerImportPathsFromActions(\r\n config.timelines.flatMap(x => x.timelineActions)\r\n )\r\n );\r\n importPaths.push(\r\n ..._gatherControllerImportPathsFromActions(config.eventActions)\r\n );\r\n importPaths = _deduplicate(importPaths);\r\n return importPaths;\r\n}\r\n\r\nfunction _gatherProviders(config: any) {\r\n if (config.timelineProviderSettings) {\r\n return Object.values(config.timelineProviderSettings).map<ImportInfo>(\r\n (settings: any) => {\r\n return {\r\n systemName: settings.systemName,\r\n };\r\n }\r\n );\r\n }\r\n return [] as ImportInfo[];\r\n}\r\n\r\nfunction _gatherEngines(config: any) {\r\n if (config.engine) {\r\n const {systemName} = config.engine;\r\n return [\r\n {\r\n systemName,\r\n },\r\n ];\r\n }\r\n return [];\r\n}\r\n\r\nfunction _gatherOperations(config: IEngineConfiguration): ImportInfo[] {\r\n let importPaths = _gatherOperationImportPathsFromActions(\r\n config.initActions\r\n .concat(config.actions)\r\n .concat(config.eventActions ?? ([] as any[]))\r\n );\r\n\r\n if (config.timelines) {\r\n const timelineActions = config.timelines.flatMap(x => x.timelineActions);\r\n\r\n importPaths = importPaths.concat(\r\n _gatherOperationImportPathsFromActions(timelineActions)\r\n );\r\n }\r\n\r\n return _deduplicate(importPaths);\r\n}\r\n\r\nfunction _gatherControllerImportPathsFromActions(\r\n actionsConfig?: IActionConfiguration[] | IEndableActionConfiguration[]\r\n): ImportInfo[] {\r\n if (!actionsConfig) {\r\n return [] as ImportInfo[];\r\n }\r\n\r\n const operations = actionsConfig.flatMap(x => [\r\n ...x.startOperations,\r\n ...((x as any).endOperations ?? []),\r\n ]);\r\n\r\n return _gatherControllerImportPaths(operations);\r\n}\r\n\r\nfunction _gatherOperationImportPathsFromActions(\r\n actionsConfig?: IActionConfiguration[] | IEndableActionConfiguration[]\r\n): ImportInfo[] {\r\n if (!actionsConfig) {\r\n return [] as ImportInfo[];\r\n }\r\n\r\n const operations = actionsConfig.flatMap(x => [\r\n ...x.startOperations,\r\n ...((x as any).endOperations ?? []),\r\n ]);\r\n\r\n return _gatherOperationImportPaths(operations);\r\n}\r\n\r\nfunction _gatherControllerImportPaths(\r\n operationConfigs: IOperationConfiguration<TOperationData>[]\r\n): ImportInfo[] {\r\n if (!operationConfigs) {\r\n return [] as ImportInfo[];\r\n }\r\n\r\n return operationConfigs\r\n .filter(operationConfig => {\r\n if (Object.hasOwn(operationConfig.operationData ?? {}, 'systemName')) {\r\n return operationConfig.operationData!.systemName.endsWith('Controller');\r\n }\r\n return false;\r\n })\r\n .map(operationConfig => {\r\n const {systemName} = operationConfig.operationData ?? {};\r\n return {\r\n systemName,\r\n };\r\n });\r\n}\r\n\r\nfunction _gatherOperationImportPaths(operationConfigs: any[]): ImportInfo[] {\r\n if (!operationConfigs) {\r\n return [] as ImportInfo[];\r\n }\r\n\r\n return operationConfigs.map(operationConfig => {\r\n const {systemName} = operationConfig;\r\n return {\r\n systemName,\r\n };\r\n });\r\n}\r\n\r\nfunction _deduplicate(importPaths: ImportInfo[]): ImportInfo[] {\r\n const lookup: Record<string, true> = {};\r\n return importPaths.filter(imp => {\r\n if (lookup[imp.systemName]) {\r\n return false;\r\n }\r\n return (lookup[imp.systemName] = true);\r\n });\r\n}\r\n","import type {TOperation} from './types.ts';\r\n\r\nexport interface IAddClassOperationData {\r\n /**\r\n * @dependency\r\n */\r\n selectedElement: JQuery;\r\n /**\r\n * @type=ParameterType:className\r\n * @required\r\n * @erased\r\n */\r\n className: string;\r\n}\r\n\r\n/**\r\n * This operation adds the specified class name to the specified selected element.\r\n *\r\n * @category DOM\r\n */\r\nexport const addClass: TOperation<\r\n IAddClassOperationData,\r\n Omit<IAddClassOperationData, 'className'>\r\n> = operationData => {\r\n const {selectedElement, className} = operationData;\r\n delete (operationData as any).className;\r\n selectedElement.addClass(className);\r\n\r\n return operationData;\r\n};\r\n","import type {IController} from '../../controllers/types.ts';\r\n\r\nconst controllersDataName = 'eligiusEngineControllers';\r\n\r\nfunction getElementData(\r\n name: string,\r\n element: JQuery\r\n): IController<any>[] | undefined {\r\n return element.data(name);\r\n}\r\n\r\nconst getElementControllers = getElementData.bind(null, controllersDataName);\r\n\r\nexport {getElementData, getElementControllers, controllersDataName};\r\n","import {\r\n controllersDataName,\r\n getElementControllers,\r\n} from './get-element-data.ts';\r\n\r\nexport function attachControllerToElement(element: JQuery, controller: any) {\r\n if (!element.data(controllersDataName)) {\r\n element.data(controllersDataName, []);\r\n }\r\n const controllers = getElementControllers(element);\r\n if (controllers) {\r\n controllers.push(controller);\r\n }\r\n}\r\n","import type {TOperationData} from '../types.ts';\r\n\r\nexport function mergeOperationData<T extends TOperationData>(\r\n operationData: T,\r\n newOperationData: TOperationData\r\n): T & TOperationData {\r\n return {...operationData, ...newOperationData};\r\n}\r\n","import type {TOperationData} from '../types.ts';\r\nimport {mergeOperationData} from './merge-operation-data.ts';\r\n\r\nexport function internalResolve<T extends TOperationData = TOperationData>(\r\n resolve: (data: T | PromiseLike<T>) => void,\r\n operationData: TOperationData,\r\n newOperationData?: TOperationData\r\n) {\r\n if (newOperationData) {\r\n resolve(mergeOperationData(operationData, newOperationData) as T);\r\n } else {\r\n resolve(operationData as T);\r\n }\r\n}\r\n","import type {IController} from '../controllers/types.ts';\r\nimport {attachControllerToElement} from './helper/attach-controller-to-element.ts';\r\nimport {internalResolve} from './helper/internal-resolve.ts';\r\nimport type {IOperationScope, TOperation, TOperationData} from './types.ts';\r\n\r\nexport type IAddControllerToElementOperationData<\r\n T extends TOperationData = TOperationData,\r\n> = {\r\n /**\r\n * @dependency\r\n */\r\n selectedElement: JQuery;\r\n /**\r\n * @dependency\r\n */\r\n controllerInstance: IController<T>;\r\n} & T;\r\n\r\n/**\r\n * This operation adds the specified controller instance to the given selected element.\r\n *\r\n * @category Controller\r\n */\r\nexport const addControllerToElement: TOperation<IAddControllerToElementOperationData> =\r\n function <T extends TOperationData = TOperationData>(\r\n this: IOperationScope,\r\n operationData: IAddControllerToElementOperationData<T>\r\n ) {\r\n const {selectedElement, controllerInstance} = operationData;\r\n\r\n attachControllerToElement(selectedElement, controllerInstance);\r\n\r\n controllerInstance.init(operationData);\r\n\r\n const promise = controllerInstance.attach(this.eventbus);\r\n\r\n if (promise) {\r\n return new Promise((resolve, reject) => {\r\n promise.then((newOperationData: TOperationData) => {\r\n internalResolve(resolve, operationData, newOperationData);\r\n }, reject);\r\n });\r\n } else {\r\n return operationData;\r\n }\r\n };\r\n","import {getGlobals} from './helper/globals.ts';\r\nimport {removeProperties} from './helper/remove-operation-properties.ts';\r\nimport type {TOperation} from './types.ts';\r\n\r\nexport interface IAddGlobalsToOperationData {\r\n /**\r\n * The names of the global properties that will be copied onto the current operation data\r\n *\r\n * @required\r\n * @erased\r\n */\r\n globalProperties: string[];\r\n}\r\n\r\n/**\r\n * This operation adds the specified global property names to the current operation data.\r\n * It finally removes the `globalProperties` property from the current operation data.\r\n *\r\n * @category Data\r\n */\r\nexport const addGlobalsToOperation: TOperation<\r\n IAddGlobalsToOperationData,\r\n Omit<IAddGlobalsToOperationData, 'globalProperties'>\r\n> = (operationData: IAddGlobalsToOperationData) => {\r\n const {globalProperties} = operationData;\r\n\r\n const globalValues = globalProperties.reduce<Record<string, any>>(\r\n (prev, current) => {\r\n prev[current] = getGlobals(current);\r\n return prev;\r\n },\r\n {}\r\n );\r\n removeProperties(operationData, 'globalProperties');\r\n\r\n return Object.assign(operationData, globalValues);\r\n};\r\n","import {internalResolve} from './helper/internal-resolve.ts';\r\nimport {removeProperties} from './helper/remove-operation-properties.ts';\r\nimport type {TOperation} from './types.ts';\r\n\r\nexport interface IAnimateOperationData {\r\n /**\r\n * @type=ParameterType:boolean\r\n * @erased\r\n */\r\n animationEasing?: string;\r\n /**\r\n * @dependency\r\n */\r\n selectedElement: JQuery;\r\n /**\r\n * @required\r\n * @erased\r\n */\r\n animationProperties: Record<string, unknown>;\r\n /**\r\n * @type=ParameterType:number\r\n * @required\r\n * @erased\r\n */\r\n animationDuration: JQuery.Duration;\r\n}\r\n\r\n/**\r\n * This operation animates the specified selected element with the given [jQuery animation](https://api.jquery.com/animate/) properties, duration and easing.\r\n * It resolves after the animation completes.\r\n *\r\n * @param operationData\r\n * @returns\r\n *\r\n * @category Animation\r\n */\r\nexport const animate: TOperation<\r\n IAnimateOperationData,\r\n Omit<\r\n IAnimateOperationData,\r\n 'animationEasing' | 'animationProperties' | 'animationDuration'\r\n >\r\n> = (operationData: IAnimateOperationData) => {\r\n const {\r\n selectedElement,\r\n animationEasing,\r\n animationProperties,\r\n animationDuration,\r\n } = operationData;\r\n\r\n removeProperties(\r\n operationData,\r\n 'animationEasing',\r\n 'animationProperties',\r\n 'animationDuration'\r\n );\r\n\r\n const promise = new Promise<IAnimateOperationData>((resolve, reject) => {\r\n try {\r\n if (animationEasing) {\r\n selectedElement.animate(\r\n animationProperties,\r\n animationDuration,\r\n animationEasing,\r\n () => {\r\n internalResolve(resolve, {}, operationData);\r\n }\r\n );\r\n } else {\r\n selectedElement.animate(animationProperties, animationDuration, () => {\r\n internalResolve(resolve, {}, operationData);\r\n });\r\n }\r\n } catch (e) {\r\n reject(e);\r\n }\r\n });\r\n return promise;\r\n};\r\n","import {internalResolve} from './helper/internal-resolve.ts';\r\nimport type {TOperation} from './types.ts';\r\n\r\nexport interface IAnimateWithClassOperationData {\r\n /**\r\n * @dependency\r\n */\r\n selectedElement: JQuery;\r\n /**\r\n * @type=ParameterType:className\r\n * @required\r\n */\r\n className: string;\r\n removeClass?: boolean;\r\n}\r\n\r\n/**\r\n * This operation adds the specified class name to the specified selected element and assumes that this\r\n * class triggers and animation on the selected element. It then waits for this animation to complete\r\n * before it resolves.\r\n *\r\n * @category Animation\r\n */\r\nexport const animateWithClass: TOperation<\r\n IAnimateWithClassOperationData,\r\n Promise<IAnimateWithClassOperationData>\r\n> = (operationData: IAnimateWithClassOperationData) => {\r\n let {selectedElement, className, removeClass} = operationData;\r\n removeClass = removeClass !== undefined ? removeClass : true;\r\n\r\n const promise = new Promise<IAnimateWithClassOperationData>(\r\n (resolve, reject) => {\r\n try {\r\n selectedElement.one(\r\n 'webkitAnimationEnd oanimationend oAnimationEnd msAnimationEnd animationEnd',\r\n () => {\r\n if (removeClass) {\r\n selectedElement.removeClass(className);\r\n }\r\n internalResolve(resolve, {}, operationData);\r\n }\r\n );\r\n } catch (e) {\r\n reject(e);\r\n }\r\n }\r\n );\r\n\r\n selectedElement.addClass(className);\r\n\r\n return promise;\r\n};\r\n","import {removeProperties} from './helper/remove-operation-properties.ts';\r\nimport type {TOperation} from './types.ts';\r\n\r\nexport interface IAnnounceToScreenReaderOperationData {\r\n /**\r\n * @required\r\n * @erased\r\n */\r\n message: string;\r\n /**\r\n * @optional\r\n * @erased\r\n */\r\n priority?: 'polite' | 'assertive';\r\n}\r\n\r\n/**\r\n * Announces a message to screen readers using an ARIA live region.\r\n *\r\n * @category Accessibility\r\n */\r\nexport const announceToScreenReader: TOperation<\r\n IAnnounceToScreenReaderOperationData,\r\n Omit<IAnnounceToScreenReaderOperationData, 'message' | 'priority'>\r\n> = (operationData: IAnnounceToScreenReaderOperationData) => {\r\n const {message, priority = 'polite'} = operationData;\r\n\r\n if (!message || message.trim() === '') {\r\n throw new Error('announceToScreenReader: message is required');\r\n }\r\n\r\n // Create or get existing live region\r\n let liveRegion = document.getElementById('aria-live-region');\r\n if (!liveRegion) {\r\n liveRegion = document.createElement('div');\r\n liveRegion.id = 'aria-live-region';\r\n liveRegion.setAttribute('aria-live', priority);\r\n liveRegion.style.position = 'absolute';\r\n liveRegion.style.left = '-10000px';\r\n liveRegion.style.width = '1px';\r\n liveRegion.style.height = '1px';\r\n liveRegion.style.overflow = 'hidden';\r\n document.body.appendChild(liveRegion);\r\n } else {\r\n liveRegion.setAttribute('aria-live', priority);\r\n }\r\n\r\n liveRegion.textContent = message;\r\n\r\n removeProperties(operationData, 'message', 'priority');\r\n\r\n return operationData;\r\n};\r\n","import type {endForEach} from './end-for-each.ts';\r\nimport type {forEach} from './for-each.ts';\r\nimport type {TOperation, TOperationData} from './types.ts';\r\n\r\n/**\r\n *\r\n * This operation should only be used within a loop, so between a {@link forEach} and {@link endForEach}\r\n * operation. This operation immediately moves to the loop end index, effectively stopping the loop.\r\n *\r\n * @category Control Flow\r\n */\r\nexport const breakForEach: TOperation<TOperationData> = function (\r\n operationData: TOperationData\r\n) {\r\n if (this.loopIndex !== undefined && this.loopLength !== undefined) {\r\n this.newIndex = this.loopEndIndex;\r\n\r\n delete this.loopIndex;\r\n delete this.loopLength;\r\n delete this.loopStartIndex;\r\n delete this.loopEndIndex;\r\n delete this.currentItem;\r\n }\r\n return operationData;\r\n};\r\n","import type {IOperationScope, TOperationData} from '../../operation/types.ts';\r\nimport {resolveExternalPropertyChain} from './resolve-external-property-chain.ts';\r\n\r\nexport function resolveEventArguments(\r\n operationData: TOperationData,\r\n operationScope: IOperationScope,\r\n eventArgs?: any[]\r\n) {\r\n if (!eventArgs) {\r\n return;\r\n }\r\n const resolve = resolveExternalPropertyChain.bind(\r\n null,\r\n operationData,\r\n operationScope\r\n );\r\n return eventArgs.map(resolve);\r\n}\r\n","import type {EventName} from '../eventbus/types.ts';\r\nimport {removeProperties} from './helper/remove-operation-properties.ts';\r\nimport {resolveEventArguments} from './helper/resolve-event-arguments.ts';\r\nimport type {TOperation} from './types.ts';\r\n\r\nexport interface IBroadcastEventOperationData {\r\n /**\r\n * @required\r\n * @erased\r\n */\r\n eventArgs: unknown[];\r\n /**\r\n * @type=ParameterType:eventTopic\r\n * @erased\r\n */\r\n eventTopic?: string;\r\n /**\r\n * @type=ParameterType:eventName\r\n * @required\r\n * @erased\r\n */\r\n eventName: string;\r\n}\r\n\r\n/**\r\n * This operation broadcasts the given event through the eventbus, along with the\r\n * event arguments and optional event topic.\r\n *\r\n * @category Utility\r\n */\r\nexport const broadcastEvent: TOperation<\r\n IBroadcastEventOperationData,\r\n Omit<IBroadcastEventOperationData, 'eventArgs' | 'eventTopic' | 'eventName'>\r\n> = function (operationData: IBroadcastEventOperationData) {\r\n const {eventArgs, eventTopic, eventName} = operationData;\r\n\r\n removeProperties(operationData, 'eventArgs', 'eventTopic', 'eventName');\r\n\r\n const eventArguments = resolveEventArguments(operationData, this, eventArgs);\r\n if (eventTopic) {\r\n this.eventbus.broadcastForTopic(\r\n eventName as EventName,\r\n eventTopic,\r\n eventArguments as any\r\n );\r\n } else {\r\n this.eventbus.broadcast(eventName as EventName, eventArguments as any);\r\n }\r\n\r\n return operationData;\r\n};\r\n","import $ from 'jquery';\r\nimport type {IOperationScope, TOperationData} from '../../operation/types.ts';\r\nimport {isObject} from '../../util/guards/is-object.ts';\r\nimport {deepCopy} from './deep-copy.ts';\r\nimport type {ExternalProperty} from './resolve-external-property-chain.ts';\r\nimport {\r\n isExternalProperty,\r\n resolveExternalPropertyChain,\r\n} from './resolve-external-property-chain.ts';\r\n\r\nconst cache: any[] = [];\r\n\r\n/**\r\n * This takes a `newProperties` instance, resolves all of the properties on this object and then\r\n * assigns these properties to the given operationData.\r\n */\r\nexport function resolvePropertyValues<T extends TOperationData>(\r\n operationData: T,\r\n operationScope: IOperationScope,\r\n newProperties: Record<string, any>\r\n): T {\r\n const copy =\r\n newProperties !== operationData ? deepCopy(newProperties) : newProperties;\r\n\r\n const resolvePropertyChain = resolveExternalPropertyChain.bind(\r\n null,\r\n operationData,\r\n operationScope\r\n );\r\n\r\n resolveNewProperties(newProperties, copy, resolvePropertyChain);\r\n\r\n return copy as T;\r\n}\r\n\r\nfunction resolveNewProperties(\r\n properties: Record<string, any>,\r\n copy: Record<string, any>,\r\n resolvePropertyChain: (\r\n propertyChain: ExternalProperty | Record<string, any>\r\n ) => any\r\n) {\r\n // Prevent recursive looping\r\n if (cache.indexOf(properties) > -1) {\r\n return;\r\n }\r\n\r\n cache.push(properties);\r\n\r\n try {\r\n Object.entries(properties).forEach(([key, value]) => {\r\n if (value instanceof $) {\r\n return;\r\n }\r\n\r\n if (isExternalProperty(value)) {\r\n copy[key] = resolvePropertyChain(value);\r\n } else if (Array.isArray(value)) {\r\n value.forEach((item, index, arr) => {\r\n if (isExternalProperty(item)) {\r\n arr[index] = resolvePropertyChain(item);\r\n } else if (isObject(item)) {\r\n resolveNewProperties(item, item, resolvePropertyChain);\r\n }\r\n });\r\n } else if (isObject(value)) {\r\n resolveNewProperties(value, value, resolvePropertyChain);\r\n } else {\r\n copy[key] = value;\r\n }\r\n });\r\n } finally {\r\n const index = cache.indexOf(properties);\r\n cache.splice(index, 1);\r\n }\r\n}\r\n","import {removeProperties} from './helper/remove-operation-properties.ts';\r\nimport {resolvePropertyValues} from './helper/resolve-property-values.ts';\r\nimport type {TOperation} from './types.ts';\r\n\r\nexport type TCalculationOperator = '+' | '-' | '*' | '/' | '%' | '**';\r\n\r\nexport interface ICalcOperationData {\r\n /**\r\n * The left operand\r\n * @type=ParameterType:number\r\n * @required\r\n * @erased\r\n */\r\n left: string | number;\r\n /**\r\n * The right operand\r\n * @type=ParameterType:number\r\n * @required\r\n * @erased\r\n */\r\n right: string | number;\r\n /**\r\n * @required\r\n * @erased\r\n */\r\n operator: TCalculationOperator;\r\n /**\r\n * @output\r\n */\r\n calculationResult?: number;\r\n}\r\n\r\nconst calcFunctions: Record<\r\n TCalculationOperator,\r\n (left: number, right: number) => number\r\n> = {\r\n '+': (left: number, right: number) => left + right,\r\n '-': (left: number, right: number) => left - right,\r\n '*': (left: number, right: number) => left * right,\r\n '/': (left: number, right: number) => left / right,\r\n '%': (left: number, right: number) => left % right,\r\n '**': (left: number, right: number) => left ** right,\r\n};\r\n\r\n/**\r\n * This operation calculates the given left and right hand operands using the specified operator.\r\n *\r\n * @param operationData\r\n *\r\n * @category Utility\r\n */\r\nexport const calc: TOperation<\r\n ICalcOperationData,\r\n Omit<ICalcOperationData, 'left' | 'right' | 'operator'>\r\n> = function (operationData: ICalcOperationData) {\r\n operationData = resolvePropertyValues(operationData, this, operationData);\r\n\r\n const {left, right, operator} = operationData;\r\n\r\n removeProperties(operationData, 'left', 'right', 'operator');\r\n\r\n operationData.calculationResult = calcFunctions[operator](+left, +right);\r\n\r\n return operationData;\r\n};\r\n","import type {TOperation} from './types.ts';\r\n\r\nexport interface IClearElementOperationData {\r\n /**\r\n * @dependency\r\n */\r\n selectedElement: JQuery;\r\n}\r\n\r\n/**\r\n * This operation removes all of the children from the given selected element.\r\n *\r\n * @category DOM\r\n */\r\nexport const clearElement: TOperation<IClearElementOperationData> = (\r\n operationData: IClearElementOperationData\r\n) => {\r\n const {selectedElement} = operationData;\r\n selectedElement.empty();\r\n return operationData;\r\n};\r\n","import {removeProperties} from './helper/remove-operation-properties.ts';\r\nimport type {TOperation} from './types.ts';\r\n\r\nexport interface IClearOperationDataOperationData {\r\n /**\r\n * @erased\r\n */\r\n properties?: string[];\r\n}\r\n\r\n/**\r\n * This operation removes all of the properties on the current operation date.\r\n * Or, if the `properties` property is set only removes the properties defined by that list.\r\n *\r\n * @category Data\r\n */\r\nexport const clearOperationData: TOperation<\r\n IClearOperationDataOperationData,\r\n Omit<IClearOperationDataOperationData, 'properties'>\r\n> = (operationData: IClearOperationDataOperationData) => {\r\n const {properties} = operationData;\r\n\r\n if (properties) {\r\n properties.forEach(name => {\r\n delete (operationData as any)[name];\r\n });\r\n removeProperties(operationData, 'properties');\r\n return operationData;\r\n }\r\n\r\n return {};\r\n};\r\n","import {removeProperties} from './helper/remove-operation-properties.ts';\r\nimport type {TOperation} from './types.ts';\r\n\r\nexport type StorageType = 'local' | 'session';\r\n\r\nexport interface IClearStorageOperationData {\r\n /**\r\n * @optional\r\n * @erased\r\n */\r\n key?: string;\r\n /**\r\n * @required\r\n * @erased\r\n */\r\n storageType: StorageType;\r\n}\r\n\r\n/**\r\n * Clears data from browser storage (localStorage or sessionStorage).\r\n *\r\n * If `key` is provided, removes only that key. If `key` is omitted, clears all storage.\r\n *\r\n * @returns Operation data with storage properties erased\r\n *\r\n * @example\r\n * ```typescript\r\n * // Clear specific key\r\n * const result = clearStorage({\r\n * key: 'user-settings',\r\n * storageType: 'local'\r\n * });\r\n * ```\r\n *\r\n * @example\r\n * ```typescript\r\n * // Clear all localStorage\r\n * const result = clearStorage({\r\n * storageType: 'local'\r\n * });\r\n * ```\r\n *\r\n * @category Data\r\n */\r\nexport const clearStorage: TOperation<\r\n IClearStorageOperationData,\r\n Omit<IClearStorageOperationData, 'key' | 'storageType'>\r\n> = (operationData: IClearStorageOperationData) => {\r\n const {key, storageType} = operationData;\r\n\r\n const storage = storageType === 'session' ? sessionStorage : localStorage;\r\n\r\n if (key && key.trim() !== '') {\r\n storage.removeItem(key);\r\n } else {\r\n storage.clear();\r\n }\r\n\r\n removeProperties(operationData, 'key', 'storageType');\r\n\r\n return operationData;\r\n};\r\n","import {removeProperties} from './helper/remove-operation-properties.ts';\r\nimport type {TOperation} from './types.ts';\r\n\r\nexport interface ICompareDateOperationData {\r\n /**\r\n * @required\r\n * @erased\r\n */\r\n date1: Date | string | number;\r\n /**\r\n * @required\r\n * @erased\r\n */\r\n date2: Date | string | number;\r\n /**\r\n * @output\r\n */\r\n comparison: number;\r\n /**\r\n * @output\r\n */\r\n isEqual: boolean;\r\n /**\r\n * @output\r\n */\r\n isBefore: boolean;\r\n /**\r\n * @output\r\n */\r\n isAfter: boolean;\r\n}\r\n\r\n/**\r\n * Compares two dates.\r\n * comparison: -1 (before), 0 (equal), 1 (after)\r\n *\r\n * @category Date\r\n */\r\nexport const compareDate: TOperation<\r\n ICompareDateOperationData,\r\n Omit<ICompareDateOperationData, 'date1' | 'date2'>\r\n> = (operationData: ICompareDateOperationData) => {\r\n const {date1, date2} = operationData;\r\n\r\n if (!date1 || !date2) {\r\n throw new Error('compareDate: both dates are required');\r\n }\r\n\r\n const dateObj1 = date1 instanceof Date ? date1 : new Date(date1);\r\n const dateObj2 = date2 instanceof Date ? date2 : new Date(date2);\r\n\r\n if (Number.isNaN(dateObj1.getTime()) || Number.isNaN(dateObj2.getTime())) {\r\n throw new Error('compareDate: invalid date');\r\n }\r\n\r\n const time1 = dateObj1.getTime();\r\n const time2 = dateObj2.getTime();\r\n\r\n operationData.comparison = time1 < time2 ? -1 : time1 > time2 ? 1 : 0;\r\n operationData.isEqual = time1 === time2;\r\n operationData.isBefore = time1 < time2;\r\n operationData.isAfter = time1 > time2;\r\n\r\n removeProperties(operationData, 'date1', 'date2');\r\n\r\n return operationData;\r\n};\r\n","import {removeProperties} from './helper/remove-operation-properties.ts';\r\nimport type {TOperation} from './types.ts';\r\n\r\nexport interface IConcatenateStringsOperationData {\r\n /**\r\n * @required\r\n * @erased\r\n */\r\n strings: string[];\r\n /**\r\n * @optional\r\n * @erased\r\n */\r\n separator?: string;\r\n /**\r\n * @output\r\n */\r\n result: string;\r\n}\r\n\r\n/**\r\n * Concatenates multiple strings with an optional separator.\r\n *\r\n * @returns Operation data with `result` containing the concatenated string\r\n *\r\n * @example\r\n * ```typescript\r\n * const result = concatenateStrings({\r\n * strings: ['Hello', 'World'],\r\n * separator: ' '\r\n * });\r\n * // result.result = \"Hello World\"\r\n * ```\r\n *\r\n * @category String\r\n */\r\nexport const concatenateStrings: TOperation<\r\n IConcatenateStringsOperationData,\r\n Omit<IConcatenateStringsOperationData, 'strings' | 'separator'>\r\n> = (operationData: IConcatenateStringsOperationData) => {\r\n const {strings, separator = ''} = operationData;\r\n\r\n if (!Array.isArray(strings)) {\r\n throw new Error('concatenateStrings: strings must be an array');\r\n }\r\n\r\n operationData.result = strings.join(separator);\r\n\r\n removeProperties(operationData, 'strings', 'separator');\r\n\r\n return operationData;\r\n};\r\n","import type {endForEach} from './end-for-each.ts';\r\nimport type {forEach} from './for-each.ts';\r\nimport type {TOperation, TOperationData} from './types.ts';\r\n\r\n/**\r\n *\r\n * This operation should only be used within a loop, so between a {@link forEach} and {@link endForEach}\r\n * operation. This operation immediately moves to the next loop index, effectively canceling the rest\r\n * of the operations in the current iteration.\r\n *\r\n * @category Control Flow\r\n */\r\nexport const continueForEach: TOperation<TOperationData> = function (\r\n operationData: TOperationData\r\n) {\r\n if (this.loopIndex !== undefined && this.loopLength !== undefined) {\r\n this.newIndex = this.loopEndIndex;\r\n delete this.currentItem;\r\n }\r\n return operationData;\r\n};\r\n","import $ from 'jquery';\r\nimport type {RequireKeys} from 'types.ts';\r\nimport {removeProperties} from './helper/remove-operation-properties.ts';\r\nimport {resolvePropertyValues} from './helper/resolve-property-values.ts';\r\nimport type {IOperationScope, TOperation} from './types.ts';\r\n\r\nexport type TTagNames = keyof HTMLElementTagNameMap;\r\n\r\nexport interface ICreateElementOperationData<T extends TTagNames> {\r\n /**\r\n * @type=ParameterType:htmlElementName\r\n * @required\r\n * @erased\r\n */\r\n elementName: T;\r\n /**\r\n * @erased\r\n */\r\n text?: string;\r\n /**\r\n * @type=ParameterType:object\r\n * @erased\r\n */\r\n attributes?: Partial<HTMLElementTagNameMap[T]>;\r\n /**\r\n * @type=ParameterType:object\r\n * @output\r\n */\r\n template?: JQuery;\r\n}\r\n\r\n/**\r\n * This operation creates the DOM element described by the given elementName and attributes and assigns\r\n * the instance to the `template` property on the current operation data.\r\n *\r\n * @param operationData\r\n * @returns\r\n * @category DOM\r\n */\r\nexport const createElement: TOperation<\r\n ICreateElementOperationData<TTagNames>,\r\n Omit<\r\n RequireKeys<ICreateElementOperationData<TTagNames>, 'template'>,\r\n 'elementName' | 'text' | 'attributes'\r\n >\r\n> = function <T extends TTagNames>(\r\n this: IOperationScope,\r\n operationData: ICreateElementOperationData<T>\r\n) {\r\n operationData = resolvePropertyValues(operationData, this, operationData);\r\n\r\n const {elementName, attributes, text} = operationData;\r\n\r\n removeProperties(operationData, 'elementName', 'attributes', 'text');\r\n\r\n const serializedAttrs = attributes\r\n ? ` ${Object.entries(attributes)\r\n .filter(([_, value]) => Boolean(value))\r\n .map(([key, value]) => `${key}=\"${value}\"`)\r\n .join(' ')}`\r\n : '';\r\n\r\n const template = text\r\n ? $(`<${elementName}${serializedAttrs}>${text}</${elementName}>`)\r\n : $(`<${elementName}${serializedAttrs}/>`);\r\n\r\n operationData.template = template;\r\n\r\n return operationData as RequireKeys<\r\n ICreateElementOperationData<TTagNames>,\r\n 'template'\r\n >;\r\n};\r\n","import {internalResolve} from './helper/internal-resolve.ts';\r\nimport {removeProperties} from './helper/remove-operation-properties.ts';\r\nimport type {TOperation} from './types.ts';\r\n\r\nexport interface ICustomFunctionOperationData {\r\n /**\r\n * @type=ParameterType:systemName\r\n * @erased\r\n * @required\r\n */\r\n systemName: string;\r\n}\r\n\r\n/**\r\n * This operation retrieves a custom function defined by the given system name\r\n * and invokes it with the current operation data and eventbus.\r\n *\r\n * @param operationData\r\n *\r\n * @category Utility\r\n */\r\nexport const customFunction: TOperation<\r\n ICustomFunctionOperationData,\r\n Omit<ICustomFunctionOperationData, 'systemName'>\r\n> = function (operationData: ICustomFunctionOperationData) {\r\n const {systemName} = operationData;\r\n\r\n removeProperties(operationData, 'systemName');\r\n\r\n return new Promise<ICustomFunctionOperationData>((resolve, reject) => {\r\n const resultCallback = (func: TOperation) => {\r\n const promise = func.apply(this, [operationData]);\r\n if (promise) {\r\n promise.then(() => {\r\n internalResolve(resolve, {}, operationData);\r\n }, reject);\r\n } else {\r\n internalResolve(resolve, {}, operationData);\r\n }\r\n };\r\n this.eventbus.broadcast('request-function', [systemName, resultCallback]);\r\n });\r\n};\r\n","import type {IEndableAction} from '../action/types.ts';\r\nimport {internalResolve} from './helper/internal-resolve.ts';\r\nimport {mergeOperationData} from './helper/merge-operation-data.ts';\r\nimport type {TOperation} from './types.ts';\r\n\r\nexport interface IEndActionOperationData {\r\n /**\r\n * @dependency\r\n */\r\n actionInstance: IEndableAction;\r\n /**\r\n * @required\r\n * @erased\r\n */\r\n actionOperationData: Record<string, unknown>;\r\n}\r\n\r\n/**\r\n * This operation invokes the {@link EndableAction}.end method on the specified action instance.\r\n *\r\n * The action operation data is first merged with the current operation data before it is\r\n * passed on to the action. After the action has completed the action operation data properties\r\n * are removed from the current operation data.\r\n *\r\n * @category Action\r\n */\r\nexport const endAction: TOperation<\r\n IEndActionOperationData,\r\n Omit<IEndActionOperationData, 'actionOperationData'>\r\n> = (operationData: IEndActionOperationData) => {\r\n let {actionOperationData, ...newOperationData} = operationData;\r\n\r\n return new Promise<IEndActionOperationData>((resolve, reject) => {\r\n newOperationData = mergeOperationData(\r\n newOperationData,\r\n actionOperationData\r\n );\r\n\r\n newOperationData.actionInstance.end(newOperationData).then(() => {\r\n const sanitizedData = Object.keys(newOperationData)\r\n .filter(key => !(key in actionOperationData))\r\n .reduce(\r\n (acc, key) => {\r\n (acc as any)[key] = (newOperationData as any)[key];\r\n return acc;\r\n },\r\n {} as typeof newOperationData\r\n );\r\n internalResolve(resolve, sanitizedData);\r\n }, reject);\r\n });\r\n};\r\n","import type {TOperation, TOperationData} from './types.ts';\r\n\r\n/**\r\n * This operation checks if the current loop should end or start the next iteration.\r\n *\r\n * @category Control Flow\r\n */\r\nexport const endForEach: TOperation<TOperationData> = function (\r\n operationData: TOperationData\r\n) {\r\n if (\r\n this.loopIndex !== undefined &&\r\n this.loopLength !== undefined &&\r\n this.loopIndex < this.loopLength\r\n ) {\r\n this.loopIndex = this.loopIndex + 1;\r\n this.newIndex = this.loopStartIndex;\r\n delete this.currentItem;\r\n }\r\n\r\n return operationData;\r\n};\r\n","import type {TOperation} from './types.ts';\r\n\r\n/**\r\n * This operation cleans up after the {@link when}/{@link otherwise}/{@link endWhen} control flow ends.\r\n *\r\n * @category Control Flow\r\n */\r\nexport const endWhen: TOperation<Record<string, unknown>> = function (\r\n operationData: Record<string, unknown>\r\n) {\r\n delete this.whenEvaluation;\r\n return operationData;\r\n};\r\n","import type {IController} from '../controllers/types.ts';\r\nimport {removeProperties} from './helper/remove-operation-properties.ts';\r\nimport type {TOperation, TOperationData} from './types.ts';\r\n\r\n/**\r\n * This operation extends the specified controller instance with the specified extension.\r\n */\r\nexport interface IExtendControllerOperationData {\r\n /**\r\n * @dependency\r\n */\r\n controllerInstance: IController<TOperationData>;\r\n /**\r\n * @erased\r\n * @required\r\n */\r\n controllerExtension: Record<PropertyKey, unknown>;\r\n}\r\n\r\n/**\r\n * Extends the current controller with given extension.\r\n *\r\n * @category Controller\r\n */\r\nexport const extendController: TOperation<\r\n IExtendControllerOperationData,\r\n Omit<IExtendControllerOperationData, 'controllerExtension'>\r\n> = (operationData: IExtendControllerOperationData) => {\r\n const {controllerInstance, controllerExtension} = operationData;\r\n\r\n removeProperties(operationData, 'controllerExtension');\r\n\r\n operationData.controllerInstance = Object.assign(\r\n controllerInstance,\r\n controllerExtension\r\n );\r\n\r\n return operationData;\r\n};\r\n","import {removeProperties} from './helper/remove-operation-properties.ts';\r\nimport type {TOperation} from './types.ts';\r\n\r\nexport interface IFilterArrayOperationData {\r\n /**\r\n * @required\r\n * @dependency\r\n */\r\n arrayData: any[];\r\n /**\r\n * @optional\r\n * @erased\r\n */\r\n filterProperty?: string;\r\n /**\r\n * @optional\r\n * @erased\r\n */\r\n filterValue?: any;\r\n /**\r\n * @optional\r\n * @erased\r\n */\r\n filterPredicate?: (item: any, index?: number) => boolean;\r\n /**\r\n * @output\r\n */\r\n filteredArray: any[];\r\n}\r\n\r\n/**\r\n * Filters an array based on property equality or custom predicate function.\r\n *\r\n * Operates on arrayData passed from previous operations.\r\n * Supports two filtering modes:\r\n * 1. Property equality: `filterProperty` and `filterValue` to filter by property match\r\n * 2. Custom predicate: `filterPredicate` function for complex filtering logic\r\n *\r\n * @returns Operation data with `filteredArray` containing filtered results\r\n *\r\n * @example\r\n * ```typescript\r\n * // Filter by property equality\r\n * const result = filterArray({\r\n * arrayData: [{name: 'Alice', age: 25}, {name: 'Bob', age: 30}],\r\n * filterProperty: 'age',\r\n * filterValue: 25\r\n * });\r\n * // result.filteredArray = [{name: 'Alice', age: 25}]\r\n * ```\r\n *\r\n * @example\r\n * ```typescript\r\n * // Filter with custom predicate\r\n * const result = filterArray({\r\n * arrayData: [1, 2, 3, 4, 5],\r\n * filterPredicate: (item) => item % 2 === 0\r\n * });\r\n * // result.filteredArray = [2, 4]\r\n * ```\r\n *\r\n * @category Array\r\n */\r\nexport const filterArray: TOperation<\r\n IFilterArrayOperationData,\r\n Omit<\r\n IFilterArrayOperationData,\r\n 'filterProperty' | 'filterValue' | 'filterPredicate'\r\n >\r\n> = (operationData: IFilterArrayOperationData) => {\r\n const {arrayData, filterProperty, filterValue, filterPredicate} =\r\n operationData;\r\n\r\n if (!Array.isArray(arrayData)) {\r\n throw new Error('filterArray: arrayData is required and must be an array');\r\n }\r\n\r\n if (!filterPredicate && (!filterProperty || filterValue === undefined)) {\r\n throw new Error(\r\n 'filterArray: filterProperty/filterValue or filterPredicate is required'\r\n );\r\n }\r\n\r\n let filtered: any[];\r\n\r\n if (filterPredicate) {\r\n filtered = arrayData.filter(filterPredicate);\r\n } else {\r\n filtered = arrayData.filter(item => {\r\n if (typeof item === 'object' && item !== null) {\r\n return item[filterProperty!] === filterValue;\r\n }\r\n return false;\r\n });\r\n }\r\n\r\n operationData.filteredArray = filtered;\r\n\r\n removeProperties(\r\n operationData,\r\n 'filterProperty',\r\n 'filterValue',\r\n 'filterPredicate'\r\n );\r\n\r\n return operationData;\r\n};\r\n","import {removeProperties} from './helper/remove-operation-properties.ts';\r\nimport type {TOperation} from './types.ts';\r\n\r\nexport interface IFindInArrayOperationData {\r\n /**\r\n * @required\r\n * @dependency\r\n */\r\n arrayData: any[];\r\n /**\r\n * @optional\r\n * @erased\r\n */\r\n findProperty?: string;\r\n /**\r\n * @optional\r\n * @erased\r\n */\r\n findValue?: any;\r\n /**\r\n * @optional\r\n * @erased\r\n */\r\n findPredicate?: (item: any, index?: number) => boolean;\r\n /**\r\n * @output\r\n */\r\n foundItem: any | undefined;\r\n /**\r\n * @output\r\n */\r\n foundIndex: number;\r\n}\r\n\r\n/**\r\n * Finds the first element in an array matching criteria.\r\n *\r\n * Operates on arrayData passed from previous operations.\r\n * Supports two search modes:\r\n * 1. Property equality: `findProperty` and `findValue` to find by property match\r\n * 2. Custom predicate: `findPredicate` function for complex search logic\r\n *\r\n * Returns `undefined` for `foundItem` and `-1` for `foundIndex` if no match found.\r\n *\r\n * @returns Operation data with `foundItem` (the matching element) and `foundIndex` (its position)\r\n *\r\n * @example\r\n * ```typescript\r\n * // Find by property equality\r\n * const result = findInArray({\r\n * arrayData: [{id: 1, name: 'Alice'}, {id: 2, name: 'Bob'}],\r\n * findProperty: 'id',\r\n * findValue: 2\r\n * });\r\n * // result.foundItem = {id: 2, name: 'Bob'}\r\n * // result.foundIndex = 1\r\n * ```\r\n *\r\n * @example\r\n * ```typescript\r\n * // Find with custom predicate\r\n * const result = findInArray({\r\n * arrayData: [10, 25, 30, 45],\r\n * findPredicate: (item) => item > 30\r\n * });\r\n * // result.foundItem = 45\r\n * // result.foundIndex = 3\r\n * ```\r\n *\r\n * @category Array\r\n */\r\nexport const findInArray: TOperation<\r\n IFindInArrayOperationData,\r\n Omit<\r\n IFindInArrayOperationData,\r\n 'findProperty' | 'findValue' | 'findPredicate'\r\n >\r\n> = (operationData: IFindInArrayOperationData) => {\r\n const {arrayData, findProperty, findValue, findPredicate} = operationData;\r\n\r\n if (!Array.isArray(arrayData)) {\r\n throw new Error('findInArray: arrayData is required and must be an array');\r\n }\r\n\r\n if (!findPredicate && (!findProperty || findValue === undefined)) {\r\n throw new Error(\r\n 'findInArray: findProperty/findValue or findPredicate is required'\r\n );\r\n }\r\n\r\n let foundItem: any | undefined;\r\n let foundIndex = -1;\r\n\r\n if (findPredicate) {\r\n foundIndex = arrayData.findIndex(findPredicate);\r\n foundItem = foundIndex !== -1 ? arrayData[foundIndex] : undefined;\r\n } else {\r\n foundIndex = arrayData.findIndex(item => {\r\n if (typeof item === 'object' && item !== null) {\r\n return item[findProperty!] === findValue;\r\n }\r\n return item === findValue;\r\n });\r\n foundItem = foundIndex !== -1 ? arrayData[foundIndex] : undefined;\r\n }\r\n\r\n operationData.foundItem = foundItem;\r\n operationData.foundIndex = foundIndex;\r\n\r\n removeProperties(operationData, 'findProperty', 'findValue', 'findPredicate');\r\n\r\n return operationData;\r\n};\r\n","import {removeProperties} from './helper/remove-operation-properties.ts';\r\nimport type {TOperation} from './types.ts';\r\n\r\nexport interface IFormatDateOperationData {\r\n /**\r\n * @required\r\n * @dependency\r\n */\r\n date: Date | string | number;\r\n /**\r\n * @required\r\n * @erased\r\n */\r\n format: string;\r\n /**\r\n * @output\r\n */\r\n formattedDate: string;\r\n}\r\n\r\n/**\r\n * Formats a date using Intl.DateTimeFormat or simple patterns.\r\n *\r\n * @category Date\r\n */\r\nexport const formatDate: TOperation<\r\n IFormatDateOperationData,\r\n Omit<IFormatDateOperationData, 'format'>\r\n> = (operationData: IFormatDateOperationData) => {\r\n const {date, format} = operationData;\r\n\r\n if (!date) {\r\n throw new Error('formatDate: date is required');\r\n }\r\n\r\n const dateObj = date instanceof Date ? date : new Date(date);\r\n\r\n if (Number.isNaN(dateObj.getTime())) {\r\n throw new Error('formatDate: invalid date');\r\n }\r\n\r\n // Simple format patterns\r\n const year = dateObj.getFullYear();\r\n const month = String(dateObj.getMonth() + 1).padStart(2, '0');\r\n const day = String(dateObj.getDate()).padStart(2, '0');\r\n const hours = String(dateObj.getHours()).padStart(2, '0');\r\n const minutes = String(dateObj.getMinutes()).padStart(2, '0');\r\n const seconds = String(dateObj.getSeconds()).padStart(2, '0');\r\n\r\n let formatted = format;\r\n formatted = formatted.replace('YYYY', String(year));\r\n formatted = formatted.replace('MM', month);\r\n formatted = formatted.replace('DD', day);\r\n formatted = formatted.replace('HH', hours);\r\n formatted = formatted.replace('mm', minutes);\r\n formatted = formatted.replace('ss', seconds);\r\n\r\n operationData.formattedDate = formatted;\r\n\r\n removeProperties(operationData, 'format');\r\n\r\n return operationData;\r\n};\r\n","import {removeProperties} from './helper/remove-operation-properties.ts';\r\nimport type {TOperation} from './types.ts';\r\n\r\nexport type TextTransformation =\r\n | 'uppercase'\r\n | 'lowercase'\r\n | 'capitalize'\r\n | 'titlecase'\r\n | 'trim';\r\n\r\nexport interface IFormatTextOperationData {\r\n /**\r\n * @required\r\n * @dependency\r\n */\r\n textContent: string;\r\n /**\r\n * @required\r\n * @erased\r\n */\r\n transformation: TextTransformation;\r\n /**\r\n * @output\r\n */\r\n formattedText: string;\r\n}\r\n\r\n/**\r\n * Transforms text using format operations: uppercase, lowercase, capitalize, titlecase, or trim.\r\n *\r\n * Operates on textContent passed from previous operations (e.g., getTextContent).\r\n *\r\n * Transformations:\r\n * - `uppercase`: Convert all characters to uppercase\r\n * - `lowercase`: Convert all characters to lowercase\r\n * - `capitalize`: Capitalize only the first letter\r\n * - `titlecase`: Capitalize first letter of each word\r\n * - `trim`: Remove leading and trailing whitespace\r\n *\r\n * @returns Operation data with `formattedText` containing the transformed text\r\n *\r\n * @example\r\n * ```typescript\r\n * // Convert to uppercase\r\n * const result = formatText({\r\n * textContent: 'hello',\r\n * transformation: 'uppercase'\r\n * });\r\n * // result.formattedText = \"HELLO\"\r\n * ```\r\n *\r\n * @example\r\n * ```typescript\r\n * // Title case\r\n * const result = formatText({\r\n * textContent: 'hello world',\r\n * transformation: 'titlecase'\r\n * });\r\n * // result.formattedText = \"Hello World\"\r\n * ```\r\n *\r\n * @category Text\r\n */\r\nexport const formatText: TOperation<\r\n IFormatTextOperationData,\r\n Omit<IFormatTextOperationData, 'transformation'>\r\n> = (operationData: IFormatTextOperationData) => {\r\n const {textContent, transformation} = operationData;\r\n\r\n if (textContent === undefined || textContent === null) {\r\n throw new Error('formatText: textContent is required');\r\n }\r\n\r\n let text = textContent;\r\n\r\n switch (transformation) {\r\n case 'uppercase':\r\n text = text.toUpperCase();\r\n break;\r\n case 'lowercase':\r\n text = text.toLowerCase();\r\n break;\r\n case 'capitalize':\r\n text = text.charAt(0).toUpperCase() + text.slice(1);\r\n break;\r\n case 'titlecase':\r\n text = text.replace(/\\b\\w/g, char => char.toUpperCase());\r\n break;\r\n case 'trim':\r\n text = text.trim();\r\n break;\r\n default:\r\n throw new Error(\r\n `formatText: unknown transformation type \"${transformation}\"`\r\n );\r\n }\r\n\r\n operationData.formattedText = text;\r\n\r\n removeProperties(operationData, 'transformation');\r\n\r\n return operationData;\r\n};\r\n","import {removeProperties} from './helper/remove-operation-properties.ts';\r\nimport type {TOperation} from './types.ts';\r\n\r\nexport interface IGetAttributesFromElementOperationData {\r\n /**\r\n * The HTML element whose attributes will be retrieved\r\n * @dependency\r\n */\r\n selectedElement: JQuery;\r\n /**\r\n * The specified attribute names that will be retrieved\r\n * @required\r\n * @erased\r\n */\r\n attributeNames: string[];\r\n /**\r\n * The retrieved attributes\r\n * @output\r\n */\r\n attributeValues?: Record<string, unknown>;\r\n}\r\n\r\n/**\r\n * This operation retrieves the values for the specified attribute names from the given selected element.\r\n *\r\n * @category DOM\r\n */\r\nexport const getAttributesFromElement: TOperation<\r\n IGetAttributesFromElementOperationData,\r\n Omit<IGetAttributesFromElementOperationData, 'attributeNames'>\r\n> = (operationData: IGetAttributesFromElementOperationData) => {\r\n const {selectedElement, attributeNames} = operationData;\r\n\r\n removeProperties(operationData, 'attributeNames');\r\n\r\n operationData.attributeValues = attributeNames.reduce(\r\n (acc, attrName) => {\r\n if (attrName !== 'value') {\r\n acc[attrName] = selectedElement.attr(attrName);\r\n } else {\r\n acc[attrName] = selectedElement.val();\r\n }\r\n return acc;\r\n },\r\n {} as Record<string, unknown>\r\n );\r\n\r\n return operationData;\r\n};\r\n","import type {IController} from '../controllers/types.ts';\r\nimport {getElementControllers} from './helper/get-element-data.ts';\r\nimport {removeProperties} from './helper/remove-operation-properties.ts';\r\nimport type {TOperation} from './types.ts';\r\n\r\nexport interface IGetControllerFromElementOperationData {\r\n /**\r\n * @dependency\r\n */\r\n selectedElement: JQuery;\r\n /**\r\n * @type=ParameterType:controllerName\r\n * @required\r\n * @erased\r\n */\r\n controllerName: string;\r\n /**\r\n * @type=ParameterType:object\r\n * @output\r\n */\r\n controllerInstance?: IController<any>;\r\n}\r\n\r\n/**\r\n * This operation retrieves the controller instance with the specified name that is assigned to the given selected element.\r\n *\r\n * @param operationData\r\n * @returns\r\n *\r\n * @category Controller\r\n */\r\nexport const getControllerFromElement: TOperation<\r\n IGetControllerFromElementOperationData,\r\n Omit<IGetControllerFromElementOperationData, 'controllerName'>\r\n> = (operationData: IGetControllerFromElementOperationData) => {\r\n const {selectedElement, controllerName} = operationData;\r\n\r\n removeProperties(operationData, 'controllerName');\r\n\r\n const controllers = getElementControllers(selectedElement);\r\n const controller = controllers?.find(ctrl => ctrl.name === controllerName);\r\n\r\n if (!controller) {\r\n console.warn(\r\n `controller for name '${controllerName}' was not found on the given element`\r\n );\r\n }\r\n\r\n operationData.controllerInstance = controller;\r\n return operationData;\r\n};\r\n","import type * as controllers from '../controllers/index.ts';\r\nimport type {IController} from '../controllers/types.ts';\r\nimport {removeProperties} from './helper/remove-operation-properties.ts';\r\nimport type {TOperation, TOperationData} from './types.ts';\r\n\r\ntype TSystemName = keyof typeof controllers;\r\nexport interface IGetControllerInstanceOperationData {\r\n /**\r\n * @required\r\n * @erased\r\n */\r\n systemName: TSystemName;\r\n /**\r\n * @type=ParameterType:object\r\n * @output\r\n */\r\n controllerInstance?: IController<TOperationData>;\r\n}\r\n\r\n/**\r\n * This operation retrieves an instance of the given controller name.\r\n * It assigns this instance to the `controllerInstance` property on the current operation data\r\n *\r\n * @category Controller\r\n */\r\nexport const getControllerInstance: TOperation<\r\n IGetControllerInstanceOperationData,\r\n Omit<IGetControllerInstanceOperationData, 'systemName'>\r\n> = function (operationData: IGetControllerInstanceOperationData) {\r\n const {systemName} = operationData;\r\n\r\n removeProperties(operationData, 'systemName');\r\n\r\n operationData.controllerInstance = undefined;\r\n const resultCallback = (instance: IController<TOperationData>) => {\r\n operationData.controllerInstance = instance;\r\n };\r\n this.eventbus.broadcast('request-instance', [systemName, resultCallback]);\r\n return operationData;\r\n};\r\n","import type {TOperation} from './types.ts';\r\n\r\nexport interface IGetCurrentTimeOperationData {\r\n /**\r\n * @output\r\n */\r\n timestamp: number;\r\n /**\r\n * @output\r\n */\r\n date: Date;\r\n}\r\n\r\n/**\r\n * Gets the current time as timestamp and Date object.\r\n *\r\n * @category Date\r\n */\r\nexport const getCurrentTime: TOperation<\r\n IGetCurrentTimeOperationData,\r\n IGetCurrentTimeOperationData\r\n> = (operationData: IGetCurrentTimeOperationData) => {\r\n const now = new Date();\r\n operationData.timestamp = now.getTime();\r\n operationData.date = now;\r\n return operationData;\r\n};\r\n","import type {IDimensions} from '../../types.ts';\r\n\r\nfunction _modifyDimensionsByRatio(\r\n ratioModifier: string,\r\n dimensions: IDimensions\r\n) {\r\n const modifiedDimensions = {...dimensions};\r\n //h[ar=8-1]\r\n const prefix = ratioModifier.substring(0, 1);\r\n\r\n const ratio = ratioModifier.substring(\r\n ratioModifier.indexOf('[') + 1,\r\n ratioModifier.indexOf(']') - (ratioModifier.indexOf('[') - 1)\r\n );\r\n\r\n const ratios = ratio.split('=')[1].split('-');\r\n\r\n if (ratios.filter(Boolean).length !== 2) {\r\n throw new Error(`Badly formatted modifier, expect two ratios: ${ratio}`);\r\n }\r\n\r\n if (prefix === 'h') {\r\n modifiedDimensions.height =\r\n (modifiedDimensions.width / +ratios[0]) * +ratios[1];\r\n } else if (prefix === 'w') {\r\n modifiedDimensions.width =\r\n (modifiedDimensions.height / +ratios[1]) * +ratios[0];\r\n }\r\n\r\n return modifiedDimensions;\r\n}\r\n\r\nfunction _getModifierSuffix(\r\n modifier: string //*100h%\r\n): [string | null, number, boolean] {\r\n const endIdx = 1;\r\n let suffix: string | null = modifier.substring(\r\n modifier.length - endIdx,\r\n modifier.length\r\n );\r\n\r\n if (suffix !== 'h' && suffix !== 'w' && suffix !== '%') {\r\n suffix = null;\r\n }\r\n\r\n const isPercent = suffix === '%';\r\n\r\n if (isPercent) {\r\n suffix = modifier.substring(\r\n modifier.length - endIdx,\r\n modifier.length - (endIdx + 1)\r\n );\r\n\r\n if (suffix !== 'h' && suffix !== 'w') {\r\n suffix = null;\r\n }\r\n }\r\n\r\n return [suffix, endIdx, isPercent];\r\n}\r\n\r\nfunction _modifyDimensions(\r\n dimensions: IDimensions,\r\n prefix: string,\r\n suffix: string | null,\r\n widthModifier: number,\r\n heightModifier: number\r\n) {\r\n const modifiedDimension = {...dimensions};\r\n switch (prefix) {\r\n case '+':\r\n switch (suffix) {\r\n case 'h':\r\n modifiedDimension.height += heightModifier;\r\n break;\r\n case 'w':\r\n modifiedDimension.width += widthModifier;\r\n break;\r\n default:\r\n modifiedDimension.height += heightModifier;\r\n modifiedDimension.width += widthModifier;\r\n }\r\n break;\r\n case '-':\r\n switch (suffix) {\r\n case 'h':\r\n modifiedDimension.height -= heightModifier;\r\n break;\r\n case 'w':\r\n modifiedDimension.width -= widthModifier;\r\n break;\r\n default:\r\n modifiedDimension.height -= heightModifier;\r\n modifiedDimension.width -= widthModifier;\r\n }\r\n break;\r\n case '/':\r\n switch (suffix) {\r\n case 'h':\r\n modifiedDimension.height /= heightModifier;\r\n break;\r\n case 'w':\r\n modifiedDimension.width /= widthModifier;\r\n break;\r\n default:\r\n modifiedDimension.height /= heightModifier;\r\n modifiedDimension.width /= widthModifier;\r\n }\r\n break;\r\n case '*':\r\n switch (suffix) {\r\n case 'h':\r\n modifiedDimension.height *= heightModifier;\r\n break;\r\n case 'w':\r\n modifiedDimension.width *= widthModifier;\r\n break;\r\n default:\r\n modifiedDimension.height *= heightModifier;\r\n modifiedDimension.width *= widthModifier;\r\n }\r\n break;\r\n default:\r\n console.error(`Unknown operator found: ${prefix}`);\r\n }\r\n return modifiedDimension;\r\n}\r\n\r\n/**\r\n * Modifies the given dimensions using the given modifier string.\r\n * The modifier string is formatted in the following way:\r\n *\r\n * <operator><amount><optional-side><optional-precentage>|<ratio-definition>\r\n *\r\n * Where the ratio modifier is formatted in the following way:\r\n * <side>[ar=<ratio-left>-<ratio-right>]\r\n *\r\n * For example, this modifier '+100h|w[ar=8-1]' will modifiy the dimensions like this:\r\n * it will add a value of 100 to the height and modify the width by a ration of 8 to 1 relative to the height.\r\n *\r\n * @param dimensions\r\n * @param modifier\r\n */\r\nexport function modifyDimensions(dimensions: IDimensions, modifier: string) {\r\n const clonedDimensions = {...dimensions};\r\n let ratioModifier: string | null = null;\r\n if (modifier.indexOf('|') > -1) {\r\n [modifier, ratioModifier] = modifier.split('|');\r\n }\r\n\r\n const prefix = modifier.substring(0, 1);\r\n const [suffix, endIdx, isPercent] = _getModifierSuffix(modifier);\r\n\r\n const value = parseInt(\r\n suffix !== null\r\n ? modifier.substring(1, modifier.length - (endIdx - 1))\r\n : modifier.substring(1),\r\n 10\r\n );\r\n\r\n let widthModifier = value;\r\n let heightModifier = value;\r\n if (isPercent) {\r\n widthModifier = (clonedDimensions.width / 100) * value;\r\n heightModifier = (clonedDimensions.height / 100) * value;\r\n }\r\n\r\n const modifiedDimension = _modifyDimensions(\r\n clonedDimensions,\r\n prefix,\r\n suffix,\r\n widthModifier,\r\n heightModifier\r\n );\r\n\r\n if (ratioModifier) {\r\n return _modifyDimensionsByRatio(ratioModifier, modifiedDimension);\r\n }\r\n\r\n return modifiedDimension;\r\n}\r\n","import {modifyDimensions} from './helper/modify-dimensions.ts';\r\nimport {removeProperties} from './helper/remove-operation-properties.ts';\r\nimport type {TOperation} from './types.ts';\r\n\r\nexport interface IGetElementDimensionsOperationData {\r\n /**\r\n * @dependency\r\n */\r\n selectedElement: JQuery;\r\n /**\r\n * @type=ParameterType:dimensionsModifier\r\n * @erased\r\n */\r\n modifier?: string;\r\n /**\r\n * @type=ParameterType:object\r\n * @output\r\n */\r\n dimensions?: {width?: number; height?: number};\r\n}\r\n\r\n/**\r\n * This operation calculates the width and height of the given selected element.\r\n * It assigns this struct to the dimensions property on the current operation data.\r\n * Optionally the width and height can be modified using the given modifier string.\r\n *\r\n * The modifier string is formatted in the following way:\r\n *\r\n * <operator><amount><optional-side><optional-precentage>|<ratio-definition>\r\n *\r\n * Where the ratio modifier is formatted in the following way:\r\n * <side>[ar=<ratio-left>-<ratio-right>]\r\n *\r\n * For example, this modifier '+100h|w[ar=8-1]' will modifiy the dimensions like this:\r\n * it will add a value of 100 to the height and modify the width by a ratio of 8 to 1 relative to the height.\r\n *\r\n * @category DOM\r\n */\r\nexport const getElementDimensions: TOperation<\r\n IGetElementDimensionsOperationData,\r\n Omit<IGetElementDimensionsOperationData, 'modifier'>\r\n> = (operationData: IGetElementDimensionsOperationData) => {\r\n const {selectedElement, modifier} = operationData;\r\n\r\n removeProperties(operationData, 'modifier');\r\n\r\n let dimensions = {\r\n width: selectedElement.innerWidth() ?? 0,\r\n height: selectedElement.innerHeight() ?? 0,\r\n };\r\n\r\n if (dimensions.height === 0) {\r\n dimensions.height = dimensions.width;\r\n }\r\n\r\n if (modifier) {\r\n dimensions = modifyDimensions(dimensions, modifier);\r\n }\r\n\r\n operationData.dimensions = dimensions;\r\n return operationData;\r\n};\r\n","import $ from 'jquery';\r\nimport type {TOperation} from './types.ts';\r\n\r\nexport interface IGetFocusedElementOperationData {\r\n /**\r\n * @type=ParameterType:jQuery\r\n * @output\r\n */\r\n focusedElement: JQuery;\r\n}\r\n\r\n/**\r\n * Gets the currently focused element.\r\n *\r\n * @category Focus\r\n */\r\nexport const getFocusedElement: TOperation<\r\n IGetFocusedElementOperationData,\r\n IGetFocusedElementOperationData\r\n> = (operationData: IGetFocusedElementOperationData) => {\r\n operationData.focusedElement = document.activeElement\r\n ? $(document.activeElement as HTMLElement)\r\n : $();\r\n return operationData;\r\n};\r\n","import type {TOperation} from './types.ts';\r\n\r\nexport interface IGetFormDataOperationData {\r\n /**\r\n * @required\r\n * @dependency\r\n */\r\n selectedElement: JQuery;\r\n /**\r\n * @output\r\n * @type=ParameterType:object\r\n */\r\n formData?: Record<string, any>;\r\n}\r\n\r\n/**\r\n * Extracts all input, select, and textarea values from form element into operation data.\r\n *\r\n * This operation reads form field values and returns them as an object with field names as keys.\r\n * Only processes form elements that are enabled and not hidden. Handles checkboxes, radio buttons,\r\n * select elements, textareas, and text inputs.\r\n *\r\n * @returns Operation data with `formData` object containing field values\r\n *\r\n * @example\r\n * ```typescript\r\n * // Given a form with fields: name=\"John\", email=\"john@example.com\"\r\n * const result = getFormData({selectedElement: $form});\r\n * // Returns: {selectedElement: $form, formData: {name: \"John\", email: \"john@example.com\"}}\r\n * ```\r\n *\r\n * @category Form\r\n */\r\nexport const getFormData: TOperation<\r\n IGetFormDataOperationData,\r\n IGetFormDataOperationData\r\n> = (operationData: IGetFormDataOperationData) => {\r\n const {selectedElement} = operationData;\r\n\r\n // Validate selectedElement exists\r\n if (!selectedElement || selectedElement.length === 0) {\r\n throw new Error('getFormData: selectedElement is required');\r\n }\r\n\r\n // Validate selectedElement is a form\r\n if (!selectedElement.is('form')) {\r\n throw new Error('getFormData: selectedElement must be a form element');\r\n }\r\n\r\n // Use jQuery's serializeArray to get form data\r\n const formArray = selectedElement.serializeArray();\r\n const formData: Record<string, any> = {};\r\n\r\n // Convert array format to object format\r\n for (const field of formArray) {\r\n // Handle multiple values for same name (checkboxes)\r\n if (formData[field.name] !== undefined) {\r\n // Convert to array if not already\r\n if (!Array.isArray(formData[field.name])) {\r\n formData[field.name] = [formData[field.name]];\r\n }\r\n formData[field.name].push(field.value);\r\n } else {\r\n formData[field.name] = field.value;\r\n }\r\n }\r\n\r\n operationData.formData = formData;\r\n\r\n return operationData;\r\n};\r\n","import type {RequireKeys} from 'types.ts';\r\nimport type {TOperation} from './types.ts';\r\n\r\nexport interface IGetImportOperationData {\r\n /**\r\n * @type=ParameterType:systemName\r\n * @required\r\n * @erased\r\n */\r\n systemName: string;\r\n /**\r\n * @output\r\n */\r\n importedInstance?: unknown;\r\n}\r\n\r\n/**\r\n * This operation retrieves the import specified by the given `systemName` and\r\n * assigns it to the `importedInstance` property on the current operaton date.\r\n *\r\n * @param operationData\r\n *\r\n * @category Utility\r\n */\r\nexport const getImport: TOperation<\r\n IGetImportOperationData,\r\n Omit<RequireKeys<IGetImportOperationData, 'importedInstance'>, 'systemName'>\r\n> = function (operationData: IGetImportOperationData) {\r\n const {systemName} = operationData;\r\n\r\n delete (operationData as any).systemName;\r\n\r\n const callBack = (instance: unknown) => {\r\n operationData.importedInstance = instance;\r\n };\r\n this.eventbus.broadcast('request-function', [systemName, callBack]);\r\n delete (operationData as any).systemName;\r\n return operationData as Omit<\r\n RequireKeys<IGetImportOperationData, 'importedInstance'>,\r\n 'systemName'\r\n >;\r\n};\r\n","import {removeProperties} from './helper/remove-operation-properties.ts';\r\nimport type {TOperation} from './types.ts';\r\n\r\nexport interface IGetQueryParamsOperationData {\r\n /**\r\n * The query params will be added as property/values to this object.\r\n * So, the query string `?foo=bar&bar=foo` will result in:\r\n * ```json\r\n * {\r\n * foo: \"bar\",\r\n * bar: \"foo\"\r\n * }\r\n * ```\r\n * This object will be assigned to the `queryParams` property.\r\n * @output\r\n */\r\n queryParams?: Record<string, string>;\r\n /**\r\n * The properties on this object will be assigned to the queryParams result\r\n * when the given property name is not part of the query string.\r\n *\r\n * @erased\r\n *\r\n */\r\n defaultValues?: Record<string, string>;\r\n}\r\n\r\n/**\r\n * This operation retrieves the current query parameters from the browser's address bar and places\r\n * them on the returned operation data.\r\n *\r\n * @category Utility\r\n */\r\nexport const getQueryParams: TOperation<\r\n IGetQueryParamsOperationData,\r\n Omit<IGetQueryParamsOperationData, 'defaultValues'>\r\n> = (operationData: IGetQueryParamsOperationData) => {\r\n const searchParams = new URLSearchParams(window.location.search);\r\n const queryParams = Object.fromEntries(searchParams.entries());\r\n\r\n const {defaultValues = {}} = operationData;\r\n\r\n removeProperties(operationData, 'defaultValues');\r\n\r\n operationData.queryParams = {\r\n ...defaultValues,\r\n ...queryParams,\r\n };\r\n\r\n return operationData;\r\n};\r\n","import type {TOperation} from './types.ts';\r\n\r\nexport interface IGetScrollPositionOperationData {\r\n /**\r\n * @output\r\n */\r\n scrollX: number;\r\n /**\r\n * @output\r\n */\r\n scrollY: number;\r\n}\r\n\r\n/**\r\n * Gets the current scroll position of the viewport.\r\n *\r\n * Returns x (horizontal) and y (vertical) scroll positions in pixels.\r\n * Uses cross-browser compatible methods to retrieve scroll position.\r\n *\r\n * @returns Operation data with `scrollX` and `scrollY` values\r\n *\r\n * @example\r\n * ```typescript\r\n * // Get current scroll position\r\n * const result = getScrollPosition({});\r\n * // result.scrollX = 150\r\n * // result.scrollY = 400\r\n * ```\r\n *\r\n * @category Scroll\r\n */\r\nexport const getScrollPosition: TOperation<\r\n IGetScrollPositionOperationData,\r\n IGetScrollPositionOperationData\r\n> = (operationData: IGetScrollPositionOperationData) => {\r\n // Cross-browser scroll position detection\r\n const scrollX =\r\n window.pageXOffset !== undefined\r\n ? window.pageXOffset\r\n : (window as any).scrollX !== undefined\r\n ? (window as any).scrollX\r\n : document.documentElement?.scrollLeft || 0;\r\n\r\n const scrollY =\r\n window.pageYOffset !== undefined\r\n ? window.pageYOffset\r\n : (window as any).scrollY !== undefined\r\n ? (window as any).scrollY\r\n : document.documentElement?.scrollTop || 0;\r\n\r\n operationData.scrollX = scrollX;\r\n operationData.scrollY = scrollY;\r\n\r\n return operationData;\r\n};\r\n","import type {TOperation} from './types.ts';\r\n\r\nexport interface IGetTextContentOperationData {\r\n /**\r\n * @required\r\n * @dependency\r\n */\r\n selectedElement: JQuery;\r\n /**\r\n * @output\r\n */\r\n textContent?: string;\r\n}\r\n\r\n/**\r\n * Extracts text content from element, stripping all HTML markup.\r\n *\r\n * Uses jQuery's `.text()` method which is XSS-safe and returns only the text content\r\n * without any HTML tags. Preserves whitespace and text from nested elements.\r\n *\r\n * @returns Operation data with `textContent` containing the extracted plain text\r\n *\r\n * @example\r\n * ```typescript\r\n * // Extract text from element with HTML\r\n * const result = getTextContent({selectedElement: $div});\r\n * // Given: <div>Hello <strong>World</strong>!</div>\r\n * // Returns: {textContent: \"Hello World!\"}\r\n * ```\r\n *\r\n * @category Text\r\n */\r\nexport const getTextContent: TOperation<\r\n IGetTextContentOperationData,\r\n IGetTextContentOperationData\r\n> = (operationData: IGetTextContentOperationData) => {\r\n const {selectedElement} = operationData;\r\n\r\n if (!selectedElement || selectedElement.length === 0) {\r\n throw new Error('getTextContent: selectedElement is required');\r\n }\r\n\r\n operationData.textContent = selectedElement.text();\r\n\r\n return operationData;\r\n};\r\n","import {removeProperties} from './helper/remove-operation-properties.ts';\r\nimport type {TOperation} from './types.ts';\r\n\r\nexport interface IHttpDeleteOperationData {\r\n /**\r\n * @required\r\n * @erased\r\n */\r\n url: string;\r\n /**\r\n * @optional\r\n * @erased\r\n */\r\n headers?: Record<string, string>;\r\n /**\r\n * @output\r\n */\r\n response: any;\r\n /**\r\n * @output\r\n */\r\n status: number;\r\n}\r\n\r\n/**\r\n * Performs an HTTP DELETE request to the specified URL.\r\n *\r\n * @returns Operation data with `response` (parsed JSON or empty) and `status` (HTTP status code)\r\n *\r\n * @example\r\n * ```typescript\r\n * const result = await httpDelete({\r\n * url: 'https://api.example.com/users/123',\r\n * headers: { 'Authorization': 'Bearer token' }\r\n * });\r\n * // result.response = {} or null\r\n * // result.status = 204\r\n * ```\r\n *\r\n * @category HTTP\r\n */\r\nexport const httpDelete: TOperation<\r\n IHttpDeleteOperationData,\r\n Omit<IHttpDeleteOperationData, 'url' | 'headers'>\r\n> = async (operationData: IHttpDeleteOperationData) => {\r\n const {url, headers = {}} = operationData;\r\n\r\n if (!url || url.trim() === '') {\r\n throw new Error('httpDelete: url is required');\r\n }\r\n\r\n try {\r\n const response = await fetch(url, {\r\n method: 'DELETE',\r\n headers,\r\n });\r\n\r\n operationData.status = response.status;\r\n\r\n if (!response.ok) {\r\n throw new Error(\r\n `httpDelete: HTTP error ${response.status} ${response.statusText}`\r\n );\r\n }\r\n\r\n // DELETE may return empty body (204 No Content)\r\n const contentType = response.headers.get('content-type');\r\n if (contentType?.includes('application/json')) {\r\n const data = await response.json();\r\n operationData.response = data;\r\n } else {\r\n operationData.response = null;\r\n }\r\n\r\n removeProperties(operationData, 'url', 'headers');\r\n\r\n return operationData;\r\n } catch (error) {\r\n throw new Error(`httpDelete: ${(error as Error).message}`);\r\n }\r\n};\r\n","import {removeProperties} from './helper/remove-operation-properties.ts';\r\nimport type {TOperation} from './types.ts';\r\n\r\nexport interface IHttpPostOperationData {\r\n /**\r\n * @required\r\n * @erased\r\n */\r\n url: string;\r\n /**\r\n * @optional\r\n * @erased\r\n */\r\n body?: any;\r\n /**\r\n * @optional\r\n * @erased\r\n */\r\n headers?: Record<string, string>;\r\n /**\r\n * @output\r\n */\r\n response: any;\r\n /**\r\n * @output\r\n */\r\n status: number;\r\n}\r\n\r\n/**\r\n * Performs an HTTP POST request to the specified URL.\r\n *\r\n * @returns Operation data with `response` (parsed JSON) and `status` (HTTP status code)\r\n *\r\n * @example\r\n * ```typescript\r\n * const result = await httpPost({\r\n * url: 'https://api.example.com/users',\r\n * body: { name: 'John', email: 'john@example.com' },\r\n * headers: { 'Content-Type': 'application/json' }\r\n * });\r\n * // result.response = { id: 123, name: 'John', ... }\r\n * // result.status = 201\r\n * ```\r\n *\r\n * @category HTTP\r\n */\r\nexport const httpPost: TOperation<\r\n IHttpPostOperationData,\r\n Omit<IHttpPostOperationData, 'url' | 'body' | 'headers'>\r\n> = async (operationData: IHttpPostOperationData) => {\r\n const {url, body, headers = {}} = operationData;\r\n\r\n if (!url || url.trim() === '') {\r\n throw new Error('httpPost: url is required');\r\n }\r\n\r\n try {\r\n const response = await fetch(url, {\r\n method: 'POST',\r\n headers: {\r\n 'Content-Type': 'application/json',\r\n ...headers,\r\n },\r\n body: JSON.stringify(body),\r\n });\r\n\r\n operationData.status = response.status;\r\n\r\n if (!response.ok) {\r\n throw new Error(\r\n `httpPost: HTTP error ${response.status} ${response.statusText}`\r\n );\r\n }\r\n\r\n const data = await response.json();\r\n operationData.response = data;\r\n\r\n removeProperties(operationData, 'url', 'body', 'headers');\r\n\r\n return operationData;\r\n } catch (error) {\r\n throw new Error(`httpPost: ${(error as Error).message}`);\r\n }\r\n};\r\n","import {removeProperties} from './helper/remove-operation-properties.ts';\r\nimport type {TOperation} from './types.ts';\r\n\r\nexport interface IHttpPutOperationData {\r\n /**\r\n * @required\r\n * @erased\r\n */\r\n url: string;\r\n /**\r\n * @optional\r\n * @erased\r\n */\r\n body?: any;\r\n /**\r\n * @optional\r\n * @erased\r\n */\r\n headers?: Record<string, string>;\r\n /**\r\n * @output\r\n */\r\n response: any;\r\n /**\r\n * @output\r\n */\r\n status: number;\r\n}\r\n\r\n/**\r\n * Performs an HTTP PUT request to the specified URL.\r\n *\r\n * @returns Operation data with `response` (parsed JSON) and `status` (HTTP status code)\r\n *\r\n * @example\r\n * ```typescript\r\n * const result = await httpPut({\r\n * url: 'https://api.example.com/users/123',\r\n * body: { name: 'John Updated', email: 'john.new@example.com' },\r\n * headers: { 'Content-Type': 'application/json' }\r\n * });\r\n * // result.response = { id: 123, name: 'John Updated', ... }\r\n * // result.status = 200\r\n * ```\r\n *\r\n * @category HTTP\r\n */\r\nexport const httpPut: TOperation<\r\n IHttpPutOperationData,\r\n Omit<IHttpPutOperationData, 'url' | 'body' | 'headers'>\r\n> = async (operationData: IHttpPutOperationData) => {\r\n const {url, body, headers = {}} = operationData;\r\n\r\n if (!url || url.trim() === '') {\r\n throw new Error('httpPut: url is required');\r\n }\r\n\r\n try {\r\n const response = await fetch(url, {\r\n method: 'PUT',\r\n headers: {\r\n 'Content-Type': 'application/json',\r\n ...headers,\r\n },\r\n body: JSON.stringify(body),\r\n });\r\n\r\n operationData.status = response.status;\r\n\r\n if (!response.ok) {\r\n throw new Error(\r\n `httpPut: HTTP error ${response.status} ${response.statusText}`\r\n );\r\n }\r\n\r\n const data = await response.json();\r\n operationData.response = data;\r\n\r\n removeProperties(operationData, 'url', 'body', 'headers');\r\n\r\n return operationData;\r\n } catch (error) {\r\n throw new Error(`httpPut: ${(error as Error).message}`);\r\n }\r\n};\r\n","import type {TOperation} from './types.ts';\r\n\r\nexport interface IInvokeObjectMethodOperationData {\r\n /**\r\n *\r\n * The given object instance\r\n * @dependency\r\n *\r\n */\r\n instance: any;\r\n /**\r\n * The method name on the given object that will be invoked\r\n * @required\r\n * @erased\r\n */\r\n methodName: string;\r\n /**\r\n * Arguments that will be passed to the specified method\r\n * @erased\r\n */\r\n methodArguments?: unknown[];\r\n /**\r\n * If any, the results of the method invocation are assigned to the property\r\n * @output\r\n */\r\n methodResult?: unknown;\r\n}\r\n\r\n/**\r\n * This operation invokes the specified method on the given object with the given optional arguments\r\n * and assigns the result to the `methodResult` operationdata property.\r\n *\r\n * @param operationData\r\n *\r\n * @category Utility\r\n */\r\nexport const invokeObjectMethod: TOperation<\r\n IInvokeObjectMethodOperationData,\r\n Omit<IInvokeObjectMethodOperationData, 'methodName' | 'methodArguments'>\r\n> = (operationData: IInvokeObjectMethodOperationData) => {\r\n const {methodName, methodArguments, ...newOperationData} = operationData;\r\n\r\n delete (operationData as any).methodName;\r\n delete (operationData as any).methodArguments;\r\n\r\n const func = operationData.instance[methodName];\r\n if (typeof func === 'function') {\r\n newOperationData.methodResult = func.apply(\r\n operationData.instance,\r\n methodArguments ?? []\r\n );\r\n } else {\r\n console.error(`The given member name ${methodName} is not a function`);\r\n }\r\n\r\n return newOperationData;\r\n};\r\n","import type {TOperation} from './types.ts';\r\n\r\nexport interface IIsElementInViewportOperationData {\r\n /**\r\n * @required\r\n * @dependency\r\n */\r\n selectedElement: JQuery;\r\n /**\r\n * @output\r\n */\r\n isInViewport: boolean;\r\n}\r\n\r\n/**\r\n * Checks if an element is currently visible within the viewport.\r\n *\r\n * Uses `getBoundingClientRect()` to determine if the element is within the viewport boundaries.\r\n *\r\n * @returns Operation data with `isInViewport` boolean indicating visibility\r\n *\r\n * @example\r\n * ```typescript\r\n * // Check if element is in view\r\n * const result = isElementInViewport({\r\n * selectedElement: $targetElement\r\n * });\r\n * // result.isInViewport = true or false\r\n * ```\r\n *\r\n * @category DOM\r\n */\r\nexport const isElementInViewport: TOperation<\r\n IIsElementInViewportOperationData,\r\n IIsElementInViewportOperationData\r\n> = (operationData: IIsElementInViewportOperationData) => {\r\n const {selectedElement} = operationData;\r\n\r\n if (!selectedElement || selectedElement.length === 0) {\r\n throw new Error('isElementInViewport: selectedElement is required');\r\n }\r\n\r\n const element = selectedElement[0];\r\n const rect = element.getBoundingClientRect();\r\n\r\n const isInViewport =\r\n rect.top >= 0 &&\r\n rect.left >= 0 &&\r\n rect.bottom <=\r\n (window.innerHeight || document.documentElement.clientHeight) &&\r\n rect.right <= (window.innerWidth || document.documentElement.clientWidth);\r\n\r\n operationData.isInViewport = isInViewport;\r\n\r\n return operationData;\r\n};\r\n","import {removeProperties} from './helper/remove-operation-properties.ts';\r\nimport type {TOperation} from './types.ts';\r\n\r\nexport type StorageType = 'local' | 'session';\r\n\r\nexport interface ILoadFromStorageOperationData {\r\n /**\r\n * @required\r\n * @erased\r\n */\r\n key: string;\r\n /**\r\n * @required\r\n * @erased\r\n */\r\n storageType: StorageType;\r\n /**\r\n * @output\r\n */\r\n loadedValue: any;\r\n}\r\n\r\n/**\r\n * Loads data from browser storage (localStorage or sessionStorage).\r\n *\r\n * Deserializes the stored JSON value. Returns `null` if key doesn't exist.\r\n *\r\n * @returns Operation data with `loadedValue` containing the deserialized data\r\n *\r\n * @example\r\n * ```typescript\r\n * // Load user settings from localStorage\r\n * const result = loadFromStorage({\r\n * key: 'user-settings',\r\n * storageType: 'local'\r\n * });\r\n * // result.loadedValue = { theme: 'dark', language: 'en' }\r\n * ```\r\n *\r\n * @example\r\n * ```typescript\r\n * // Load session data\r\n * const result = loadFromStorage({\r\n * key: 'session-id',\r\n * storageType: 'session'\r\n * });\r\n * // result.loadedValue = 'abc123' or null if not found\r\n * ```\r\n *\r\n * @category Data\r\n */\r\nexport const loadFromStorage: TOperation<\r\n ILoadFromStorageOperationData,\r\n Omit<ILoadFromStorageOperationData, 'storageType'>\r\n> = (operationData: ILoadFromStorageOperationData) => {\r\n const {key, storageType} = operationData;\r\n\r\n if (!key || key.trim() === '') {\r\n throw new Error('loadFromStorage: key is required');\r\n }\r\n\r\n const storage = storageType === 'session' ? sessionStorage : localStorage;\r\n const stored = storage.getItem(key);\r\n\r\n if (stored === null) {\r\n operationData.loadedValue = null;\r\n } else {\r\n try {\r\n operationData.loadedValue = JSON.parse(stored);\r\n } catch {\r\n throw new Error(\r\n `loadFromStorage: failed to parse stored value for key \"${key}\"`\r\n );\r\n }\r\n }\r\n\r\n removeProperties(operationData, 'storageType');\r\n\r\n return operationData;\r\n};\r\n","import {removeProperties} from './helper/remove-operation-properties.ts';\r\nimport type {TOperation} from './types.ts';\r\n\r\nconst jsonCache: Record<string, unknown> = {};\r\n\r\nexport interface ILoadJSONOperationData {\r\n /**\r\n * The URL where the JSON will be retrieved from\r\n * @required\r\n * @erased\r\n */\r\n url: string;\r\n /**\r\n * If true, the results will be added to the cache and any subsequent call will use this cache\r\n * @erased\r\n */\r\n cache?: boolean;\r\n /**\r\n * The JSON retrieved from the given URL\r\n * @output\r\n */\r\n json?: any;\r\n}\r\n\r\nconst addToCache = (key: string, value: any) => {\r\n jsonCache[key] = value;\r\n};\r\n\r\n/**\r\n * This operation loads a JSON file from the specified url and assigns it to the json\r\n * property on the current operation data.\r\n *\r\n * If the cache property is set to true and a cached value already exists, this is assigned\r\n * instead of re-retrieving it from the url.\r\n *\r\n * @category Utility\r\n */\r\nexport const loadJson: TOperation<\r\n ILoadJSONOperationData,\r\n Omit<ILoadJSONOperationData, 'url' | 'cache'>\r\n> = async (operationData: ILoadJSONOperationData) => {\r\n const {url, cache} = operationData;\r\n\r\n removeProperties(operationData, 'url', 'cache');\r\n\r\n if (cache && jsonCache[url]) {\r\n operationData.json = jsonCache[url];\r\n return operationData;\r\n }\r\n\r\n const response = await fetch(url);\r\n const json = await response.json();\r\n const cacheValue = (operationData.json = json);\r\n\r\n if (cache) {\r\n addToCache(url, cacheValue);\r\n }\r\n\r\n return operationData;\r\n};\r\n\r\nexport const clearCache = () => {\r\n for (const p in jsonCache) {\r\n delete jsonCache[p];\r\n }\r\n};\r\n","import {getGlobals} from './helper/globals.ts';\r\nimport {removeProperties} from './helper/remove-operation-properties.ts';\r\nimport type {TOperation} from './types.ts';\r\n\r\nexport interface ILogOperationData {\r\n /**\r\n * @type=ParameterType:object|ParameterType:string|ParameterType:number|ParameterType:boolean|ParameterType:array\r\n * @erased\r\n */\r\n logValue?: any;\r\n /**\r\n * @erased\r\n */\r\n logName?: string;\r\n}\r\n\r\n/**\r\n * This operation logs the specified value, or, when no logValue property has been assigned\r\n * it will log the current operation data, global data and scope to the console\r\n *\r\n * @category Utility\r\n */\r\nexport const log: TOperation<\r\n ILogOperationData,\r\n Omit<ILogOperationData, 'logValue' | 'logName'>\r\n> = function (operationData: ILogOperationData) {\r\n if ('logValue' in operationData) {\r\n console.log(operationData.logName ?? 'logValue', operationData.logValue);\r\n removeProperties(operationData, 'logValue', 'logName');\r\n } else {\r\n const globalData = getGlobals();\r\n\r\n console.group('Operation info');\r\n console.log('scope', this);\r\n console.log('operationData', operationData);\r\n console.log('globalData', globalData);\r\n console.groupEnd();\r\n }\r\n\r\n return operationData;\r\n};\r\n","import {removeProperties} from './helper/remove-operation-properties.ts';\r\nimport type {TOperation} from './types.ts';\r\n\r\nexport interface IMapArrayOperationData {\r\n /**\r\n * @required\r\n * @dependency\r\n */\r\n arrayData: any[];\r\n /**\r\n * @required\r\n * @erased\r\n */\r\n mapFunction: (item: any, index?: number) => any;\r\n /**\r\n * @output\r\n */\r\n mappedArray?: any[];\r\n}\r\n\r\n/**\r\n * Transforms each element of an array using a mapping function.\r\n *\r\n * Operates on arrayData passed from previous operations.\r\n * The mapFunction receives each item and optionally its index.\r\n *\r\n * @returns Operation data with `mappedArray` containing transformed elements\r\n *\r\n * @example\r\n * ```typescript\r\n * // Double each number\r\n * const result = mapArray({\r\n * arrayData: [1, 2, 3, 4],\r\n * mapFunction: (item) => item * 2\r\n * });\r\n * // result.mappedArray = [2, 4, 6, 8]\r\n * ```\r\n *\r\n * @example\r\n * ```typescript\r\n * // Extract property from objects\r\n * const result = mapArray({\r\n * arrayData: [{name: 'Alice', age: 25}, {name: 'Bob', age: 30}],\r\n * mapFunction: (item) => item.name\r\n * });\r\n * // result.mappedArray = ['Alice', 'Bob']\r\n * ```\r\n *\r\n * @example\r\n * ```typescript\r\n * // Use index in transformation\r\n * const result = mapArray({\r\n * arrayData: ['a', 'b', 'c'],\r\n * mapFunction: (item, index) => `${index}-${item}`\r\n * });\r\n * // result.mappedArray = ['0-a', '1-b', '2-c']\r\n * ```\r\n *\r\n * @category Array\r\n */\r\nexport const mapArray: TOperation<\r\n IMapArrayOperationData,\r\n Omit<IMapArrayOperationData, 'mapFunction'>\r\n> = (operationData: IMapArrayOperationData) => {\r\n const {arrayData, mapFunction} = operationData;\r\n\r\n if (!Array.isArray(arrayData)) {\r\n throw new Error('mapArray: arrayData is required and must be an array');\r\n }\r\n\r\n if (typeof mapFunction !== 'function') {\r\n throw new Error('mapArray: mapFunction is required and must be a function');\r\n }\r\n\r\n operationData.mappedArray = arrayData.map(mapFunction);\r\n\r\n removeProperties(operationData, 'mapFunction');\r\n\r\n return operationData;\r\n};\r\n","export function isString(value: any): value is string {\r\n return typeof value === 'string';\r\n}\r\n","import {isFunction} from '../util/guards/is-function.ts';\r\nimport {isString} from '../util/guards/is-string.ts';\r\nimport {resolvePropertyValues} from './helper/resolve-property-values.ts';\r\nimport type {TOperation} from './types.ts';\r\n\r\nexport type MathFunctionKeys = {\r\n [K in keyof Math]: Math[K] extends (...args: any) => any ? K : never;\r\n}[keyof Math];\r\n\r\nexport type MathNonFunctionKeys = {\r\n [K in keyof Math]: Math[K] extends (...args: any) => any ? never : K;\r\n}[keyof Math];\r\n\r\nexport interface IMathOperationData {\r\n /**\r\n * @type=ParameterType:array\r\n * @required\r\n * @erased\r\n */\r\n args: (number | string | MathNonFunctionKeys)[];\r\n /**\r\n * @type=ParameterType:mathfunction\r\n * @required\r\n * @erased\r\n */\r\n functionName: MathFunctionKeys;\r\n /**\r\n * @output\r\n */\r\n mathResult?: number;\r\n}\r\n\r\n/**\r\n * This operation performs the given math function with the specified arguments.\r\n *\r\n * @category Utility\r\n */\r\nexport const math: TOperation<\r\n IMathOperationData,\r\n Omit<IMathOperationData, 'args' | 'functionName'>\r\n> = function (operationData: IMathOperationData) {\r\n operationData = resolvePropertyValues(operationData, this, operationData);\r\n operationData.args = resolveMathConstants(operationData.args);\r\n\r\n const {args, functionName, ...newOperationData} = operationData;\r\n\r\n newOperationData.mathResult = (Math[functionName] as (...args: any[]) => any).apply(\r\n null,\r\n args\r\n );\r\n\r\n return newOperationData;\r\n};\r\n\r\nfunction resolveMathConstants(args: any[]) {\r\n return args.map((arg: any) => {\r\n if (isMathProperty(arg)) {\r\n return Math[arg];\r\n }\r\n return arg;\r\n });\r\n}\r\n\r\nfunction isMathProperty(value: string | symbol): value is keyof Math {\r\n return (\r\n isString(value) && value in Math && !isFunction(Math[value as keyof Math])\r\n );\r\n}\r\n","import {findMatchingOperationIndex} from './helper/find-matching-operation-index.ts';\r\nimport type {IOperationScope, TOperation} from './types.ts';\r\n\r\n/**\r\n * If the preceeding {@link when} operation evaluates to `true` subsequent operations will\r\n * be skipped until an {@link endWhen} operation is encountered.\r\n *\r\n * @category Control Flow\r\n */\r\nexport const otherwise: TOperation<Record<string, unknown>> = function (\r\n operationData: Record<string, unknown>\r\n) {\r\n if (this.whenEvaluation) {\r\n this.newIndex = findEndWhenIndex(this);\r\n }\r\n return operationData;\r\n};\r\n\r\nfunction findEndWhenIndex(scope: IOperationScope) {\r\n const currentIndex = scope.currentIndex + 1;\r\n const list = scope.operations.slice(currentIndex);\r\n\r\n const endWhenIndex = list.findIndex(\r\n findMatchingOperationIndex.bind({\r\n counter: 0,\r\n self: 'when',\r\n matchingName: 'endWhen',\r\n })\r\n );\r\n\r\n return endWhenIndex > -1\r\n ? endWhenIndex + currentIndex\r\n : scope.operations.length;\r\n}\r\n","import type {TOperation} from './types.ts';\r\n\r\nexport interface IRemoveClassOperationData {\r\n /**\r\n * @dependency\r\n */\r\n selectedElement: JQuery;\r\n /**\r\n * @type=ParameterType:className\r\n * @required\r\n * @erased\r\n */\r\n className: string;\r\n}\r\n\r\n/**\r\n * This operation removes the spcified class name from the given selected element.\r\n *\r\n * @param operationData\r\n * @returns\r\n * @category DOM\r\n */\r\nexport const removeClass: TOperation<\r\n IRemoveClassOperationData,\r\n Omit<IRemoveClassOperationData, 'className'>\r\n> = (operationData: IRemoveClassOperationData) => {\r\n const {selectedElement, className} = operationData;\r\n delete (operationData as any).className;\r\n selectedElement.removeClass(className);\r\n return operationData;\r\n};\r\n","import type {IController} from '../controllers/types.ts';\r\nimport {getElementControllers} from './helper/get-element-data.ts';\r\nimport type {TOperation} from './types.ts';\r\n\r\nexport interface IRemoveControllerFromElementOperationData {\r\n /**\r\n * @dependency\r\n */\r\n selectedElement: JQuery;\r\n /**\r\n * @type=ParameterType:controllerName\r\n * @required\r\n * @erased\r\n */\r\n controllerName: string;\r\n}\r\n\r\n/**\r\n * This operation removes the controller with the specified name from the given selected element.\r\n *\r\n * @param operationData\r\n * @returns\r\n *\r\n * @category Controller\r\n */\r\nexport const removeControllerFromElement: TOperation<\r\n IRemoveControllerFromElementOperationData,\r\n Omit<IRemoveControllerFromElementOperationData, 'controllerName'>\r\n> = function (operationData: IRemoveControllerFromElementOperationData) {\r\n const {selectedElement, controllerName} = operationData;\r\n\r\n delete (operationData as any).controllerName;\r\n\r\n const controllers = getElementControllers(selectedElement);\r\n const controller = controllers?.find(\r\n (ctrl: IController<any>) => ctrl.name === controllerName\r\n );\r\n\r\n if (controller && controllers) {\r\n const idx = controllers.indexOf(controller);\r\n controllers.splice(idx, 1);\r\n controller.detach(this.eventbus);\r\n } else {\r\n console.warn(\r\n `controller for name '${controllerName}' was not found on the given element`\r\n );\r\n }\r\n\r\n return operationData;\r\n};\r\n","import type {TOperation} from './types.ts';\r\n\r\nexport interface IRemoveElementOperationData {\r\n /**\r\n * @dependency\r\n */\r\n selectedElement: JQuery;\r\n}\r\n\r\n/**\r\n * This operation removes the given selected element from the DOM.\r\n *\r\n * @category DOM\r\n */\r\nexport const removeElement: TOperation<IRemoveElementOperationData> = (\r\n operationData: IRemoveElementOperationData\r\n) => {\r\n const {selectedElement} = operationData;\r\n selectedElement.remove();\r\n return operationData;\r\n};\r\n","import type {TOperation} from './types.ts';\r\n\r\nexport interface IRemovePropertiesFromOperationDataOperationData {\r\n /**\r\n * @required\r\n * @erased\r\n */\r\n propertyNames: string[];\r\n}\r\n\r\n/**\r\n * This operation removes the given list of properties from the current operation data.\r\n * It will also remove the property `propertyNames` from the result.\r\n *\r\n * @category Data\r\n */\r\nexport const removePropertiesFromOperationData: TOperation<\r\n IRemovePropertiesFromOperationDataOperationData,\r\n Omit<IRemovePropertiesFromOperationDataOperationData, 'propertyNames'>\r\n> = (operationData: IRemovePropertiesFromOperationDataOperationData) => {\r\n const {propertyNames} = operationData;\r\n if (propertyNames.indexOf('propertyNames') < 0) {\r\n propertyNames.push('propertyNames');\r\n }\r\n\r\n return Object.fromEntries(\r\n Object.entries(operationData).filter(\r\n ([name, _value]) => !propertyNames.includes(name)\r\n )\r\n );\r\n};\r\n","import {removeProperties} from './helper/remove-operation-properties.ts';\r\nimport type {TOperation} from './types.ts';\r\n\r\nexport interface IReparentElementOperationData {\r\n /**\r\n * @dependency\r\n */\r\n selectedElement: JQuery;\r\n /**\r\n * @type=ParameterType:selector\r\n * @required\r\n * @erased\r\n */\r\n newParentSelector: string;\r\n}\r\n\r\n/**\r\n * This operation moves the given selected element to the new parent that is defined\r\n * by the specified `newParentSelector`.\r\n *\r\n * @param operationData\r\n * @returns\r\n *\r\n * @category DOM\r\n */\r\nexport const reparentElement: TOperation<\r\n IReparentElementOperationData,\r\n Omit<IReparentElementOperationData, 'newParentSelector'>\r\n> = (operationData: IReparentElementOperationData) => {\r\n const {selectedElement, newParentSelector} = operationData;\r\n removeProperties(operationData, 'newParentSelector');\r\n selectedElement.remove().appendTo(newParentSelector);\r\n return operationData;\r\n};\r\n","import {removeProperties} from './helper/remove-operation-properties.ts';\r\nimport type {TOperation} from './types.ts';\r\n\r\nexport interface IReplaceStringOperationData {\r\n /**\r\n * @required\r\n * @dependency\r\n */\r\n textContent: string;\r\n /**\r\n * @required\r\n * @erased\r\n */\r\n pattern: string | RegExp;\r\n /**\r\n * @required\r\n * @erased\r\n */\r\n replacement: string;\r\n /**\r\n * @output\r\n */\r\n result: string;\r\n}\r\n\r\n/**\r\n * Replaces occurrences of a pattern in a string (alias for replaceText for string context).\r\n *\r\n * @returns Operation data with `result` containing the replaced string\r\n *\r\n * @example\r\n * ```typescript\r\n * const result = replaceString({\r\n * textContent: 'Hello World',\r\n * pattern: 'World',\r\n * replacement: 'Universe'\r\n * });\r\n * // result.result = \"Hello Universe\"\r\n * ```\r\n *\r\n * @category String\r\n */\r\nexport const replaceString: TOperation<\r\n IReplaceStringOperationData,\r\n Omit<IReplaceStringOperationData, 'pattern' | 'replacement'>\r\n> = (operationData: IReplaceStringOperationData) => {\r\n const {textContent, pattern, replacement} = operationData;\r\n\r\n if (textContent === undefined || textContent === null) {\r\n throw new Error('replaceString: textContent is required');\r\n }\r\n\r\n operationData.result = textContent.replace(pattern, replacement);\r\n\r\n removeProperties(operationData, 'pattern', 'replacement');\r\n\r\n return operationData;\r\n};\r\n","import {removeProperties} from './helper/remove-operation-properties.ts';\r\nimport type {TOperation} from './types.ts';\r\n\r\nexport interface IReplaceTextOperationData {\r\n /**\r\n * @required\r\n * @dependency\r\n */\r\n textContent: string;\r\n /**\r\n * @required\r\n * @erased\r\n */\r\n searchPattern: string | RegExp;\r\n /**\r\n * @required\r\n * @erased\r\n */\r\n replacement: string;\r\n /**\r\n * @output\r\n */\r\n replacementCount: number;\r\n}\r\n\r\n/**\r\n * Finds and replaces text using literal string or regex pattern.\r\n *\r\n * Operates on textContent passed from previous operations (e.g., getTextContent).\r\n * Supports regex patterns with global flag for multiple replacements.\r\n * Updates textContent with replaced text and sets replacementCount.\r\n *\r\n * @returns Operation data with updated `textContent` and `replacementCount` indicating number of replacements made\r\n *\r\n * @example\r\n * ```typescript\r\n * // Replace placeholder with value\r\n * const result = replaceText({\r\n * textContent: 'Hello {{name}}',\r\n * searchPattern: '{{name}}',\r\n * replacement: 'John'\r\n * });\r\n * // result.textContent = \"Hello John\"\r\n * // result.replacementCount = 1\r\n * ```\r\n *\r\n * @example\r\n * ```typescript\r\n * // Replace with regex pattern\r\n * const result = replaceText({\r\n * textContent: 'Test 123 and 456',\r\n * searchPattern: /\\d+/g,\r\n * replacement: 'NUM'\r\n * });\r\n * // result.textContent = \"Test NUM and NUM\"\r\n * // result.replacementCount = 2\r\n * ```\r\n *\r\n * @category Text\r\n */\r\nexport const replaceText: TOperation<\r\n IReplaceTextOperationData,\r\n Omit<IReplaceTextOperationData, 'searchPattern' | 'replacement'>\r\n> = (operationData: IReplaceTextOperationData) => {\r\n const {textContent, searchPattern, replacement} = operationData;\r\n\r\n if (textContent === undefined || textContent === null) {\r\n throw new Error('replaceText: textContent is required');\r\n }\r\n\r\n let newText: string;\r\n let count = 0;\r\n\r\n if (searchPattern instanceof RegExp) {\r\n // Count matches for regex\r\n const matches = textContent.match(searchPattern);\r\n count = matches ? matches.length : 0;\r\n newText = textContent.replace(searchPattern, replacement);\r\n } else {\r\n // Count matches for string\r\n const parts = textContent.split(searchPattern);\r\n count = parts.length - 1;\r\n newText = parts.join(replacement);\r\n }\r\n\r\n operationData.textContent = newText;\r\n operationData.replacementCount = count;\r\n\r\n removeProperties(operationData, 'searchPattern', 'replacement');\r\n\r\n return operationData;\r\n};\r\n","import type {IAction} from '../action/types.ts';\r\nimport {removeProperties} from './helper/remove-operation-properties.ts';\r\nimport type {TOperation} from './types.ts';\r\n\r\nexport interface IRequestActionOperationData {\r\n /**\r\n * @type=ParameterType:actionName\r\n * @required\r\n * @erased\r\n */\r\n systemName: string;\r\n /**\r\n * @type=ParameterType:object\r\n * @output\r\n */\r\n actionInstance?: IAction;\r\n}\r\n\r\n/**\r\n * This operation requests an action instance with the specified name and assigns it\r\n * to the `actionInstance` property on the current operation data.\r\n *\r\n * @category Action\r\n */\r\nexport const requestAction: TOperation<\r\n IRequestActionOperationData,\r\n Omit<Required<IRequestActionOperationData>, 'systemName'>\r\n> = function (operationData: IRequestActionOperationData) {\r\n const {systemName} = operationData;\r\n\r\n removeProperties(operationData, 'systemName');\r\n\r\n const resultCallback = (action: IAction) => {\r\n operationData.actionInstance = action;\r\n };\r\n\r\n this.eventbus.broadcast('request-action', [systemName, resultCallback]);\r\n return operationData as Required<IRequestActionOperationData>;\r\n};\r\n","import {removeProperties} from './helper/remove-operation-properties.ts';\r\nimport type {TOperation} from './types.ts';\r\n\r\nexport type StorageType = 'local' | 'session';\r\n\r\nexport interface ISaveToStorageOperationData {\r\n /**\r\n * @required\r\n * @erased\r\n */\r\n key: string;\r\n /**\r\n * @required\r\n * @erased\r\n */\r\n value: any;\r\n /**\r\n * @required\r\n * @erased\r\n */\r\n storageType: StorageType;\r\n}\r\n\r\n/**\r\n * Saves data to browser storage (localStorage or sessionStorage).\r\n *\r\n * Serializes the value as JSON before storing. Supports any JSON-serializable data type.\r\n *\r\n * @returns Operation data with storage properties erased\r\n *\r\n * @example\r\n * ```typescript\r\n * // Save user settings to localStorage\r\n * const result = saveToStorage({\r\n * key: 'user-settings',\r\n * value: { theme: 'dark', language: 'en' },\r\n * storageType: 'local'\r\n * });\r\n * ```\r\n *\r\n * @example\r\n * ```typescript\r\n * // Save session data\r\n * const result = saveToStorage({\r\n * key: 'session-id',\r\n * value: 'abc123',\r\n * storageType: 'session'\r\n * });\r\n * ```\r\n *\r\n * @category Data\r\n */\r\nexport const saveToStorage: TOperation<\r\n ISaveToStorageOperationData,\r\n Omit<ISaveToStorageOperationData, 'value' | 'storageType'>\r\n> = (operationData: ISaveToStorageOperationData) => {\r\n const {key, value, storageType} = operationData;\r\n\r\n if (!key || key.trim() === '') {\r\n throw new Error('saveToStorage: key is required');\r\n }\r\n\r\n const storage = storageType === 'session' ? sessionStorage : localStorage;\r\n const serialized = JSON.stringify(value);\r\n storage.setItem(key, serialized);\r\n\r\n removeProperties(operationData, 'value', 'storageType');\r\n\r\n return operationData;\r\n};\r\n","import {removeProperties} from './helper/remove-operation-properties.ts';\r\nimport type {TOperation} from './types.ts';\r\n\r\nexport type ScrollBehavior = 'auto' | 'smooth';\r\nexport type ScrollLogicalPosition = 'start' | 'center' | 'end' | 'nearest';\r\n\r\nexport interface IScrollToElementOperationData {\r\n /**\r\n * @required\r\n * @dependency\r\n */\r\n selectedElement: JQuery;\r\n /**\r\n * @optional\r\n * @erased\r\n */\r\n behavior?: ScrollBehavior;\r\n /**\r\n * @optional\r\n * @erased\r\n */\r\n block?: ScrollLogicalPosition;\r\n /**\r\n * @optional\r\n * @erased\r\n */\r\n inline?: ScrollLogicalPosition;\r\n}\r\n\r\n/**\r\n * Scrolls the viewport to bring the selected element into view.\r\n *\r\n * Uses the browser's `scrollIntoView` API with configurable behavior.\r\n *\r\n * @returns Operation data with scroll properties erased\r\n *\r\n * @example\r\n * ```typescript\r\n * // Smooth scroll to element at top of viewport\r\n * const result = scrollToElement({\r\n * selectedElement: $targetElement,\r\n * behavior: 'smooth',\r\n * block: 'start'\r\n * });\r\n * ```\r\n *\r\n * @example\r\n * ```typescript\r\n * // Center element in viewport\r\n * const result = scrollToElement({\r\n * selectedElement: $targetElement,\r\n * behavior: 'smooth',\r\n * block: 'center'\r\n * });\r\n * ```\r\n *\r\n * @category Scroll\r\n */\r\nexport const scrollToElement: TOperation<\r\n IScrollToElementOperationData,\r\n Omit<IScrollToElementOperationData, 'behavior' | 'block' | 'inline'>\r\n> = (operationData: IScrollToElementOperationData) => {\r\n const {\r\n selectedElement,\r\n behavior = 'auto',\r\n block = 'start',\r\n inline = 'nearest',\r\n } = operationData;\r\n\r\n if (!selectedElement || selectedElement.length === 0) {\r\n throw new Error('scrollToElement: selectedElement is required');\r\n }\r\n\r\n const element = selectedElement[0];\r\n element.scrollIntoView({\r\n behavior,\r\n block,\r\n inline,\r\n });\r\n\r\n removeProperties(operationData, 'behavior', 'block', 'inline');\r\n\r\n return operationData;\r\n};\r\n","import {removeProperties} from './helper/remove-operation-properties.ts';\r\nimport type {TOperation} from './types.ts';\r\n\r\nexport type ScrollBehavior = 'auto' | 'smooth';\r\n\r\nexport interface IScrollToPositionOperationData {\r\n /**\r\n * @required\r\n * @erased\r\n */\r\n x: number;\r\n /**\r\n * @required\r\n * @erased\r\n */\r\n y: number;\r\n /**\r\n * @optional\r\n * @erased\r\n */\r\n behavior?: ScrollBehavior;\r\n}\r\n\r\n/**\r\n * Scrolls the viewport to a specific x,y coordinate position.\r\n *\r\n * Uses the browser's `window.scrollTo` API with configurable behavior.\r\n *\r\n * @returns Operation data with scroll properties erased\r\n *\r\n * @example\r\n * ```typescript\r\n * // Smooth scroll to position\r\n * const result = scrollToPosition({\r\n * x: 0,\r\n * y: 500,\r\n * behavior: 'smooth'\r\n * });\r\n * ```\r\n *\r\n * @example\r\n * ```typescript\r\n * // Instant scroll to top\r\n * const result = scrollToPosition({\r\n * x: 0,\r\n * y: 0\r\n * });\r\n * ```\r\n *\r\n * @category Scroll\r\n */\r\nexport const scrollToPosition: TOperation<\r\n IScrollToPositionOperationData,\r\n Omit<IScrollToPositionOperationData, 'x' | 'y' | 'behavior'>\r\n> = (operationData: IScrollToPositionOperationData) => {\r\n const {x, y, behavior = 'auto'} = operationData;\r\n\r\n if (typeof x !== 'number' || typeof y !== 'number') {\r\n throw new Error('scrollToPosition: x and y coordinates are required');\r\n }\r\n\r\n window.scrollTo({\r\n left: x,\r\n top: y,\r\n behavior,\r\n });\r\n\r\n removeProperties(operationData, 'x', 'y', 'behavior');\r\n\r\n return operationData;\r\n};\r\n","import {removeProperties} from './helper/remove-operation-properties.ts';\r\nimport {\r\n type ExternalProperty,\r\n resolveExternalPropertyChain,\r\n} from './helper/resolve-external-property-chain.ts';\r\nimport type {TOperation} from './types.ts';\r\n\r\nfunction findElementBySelector(root: JQuery, selector: string) {\r\n const element = root.find(selector);\r\n if (!element.length) {\r\n console.warn(`selector '${selector}' wasn't found!`);\r\n }\r\n return element;\r\n}\r\n\r\nexport interface ISelectElementOperationData {\r\n /**\r\n * @type=ParameterType:selector\r\n * @required\r\n * @erased\r\n */\r\n selector: string;\r\n /**\r\n * @erased\r\n */\r\n useSelectedElementAsRoot?: boolean;\r\n /**\r\n * @type=ParameterType:object\r\n * @output\r\n */\r\n selectedElement?: JQuery;\r\n}\r\n\r\n/**\r\n * This operation selects one or more elements using the specified selector.\r\n *\r\n * If `useSelectedElementAsRoot` is set to true and a valid DOM element is assigned\r\n * to the current operation data's `selectedElement` property\r\n * then the element will be looked for only in the descendant elements of this DOM element.\r\n *\r\n * @category DOM\r\n */\r\nexport const selectElement: TOperation<\r\n ISelectElementOperationData,\r\n Omit<ISelectElementOperationData, 'selector' | 'useSelectedElementAsRoot'>\r\n> = function (operationData: ISelectElementOperationData) {\r\n operationData.selector = resolveExternalPropertyChain(\r\n operationData,\r\n this,\r\n operationData.selector as ExternalProperty\r\n ) as string;\r\n\r\n const {selector, useSelectedElementAsRoot = false} = operationData;\r\n\r\n removeProperties(operationData, 'selector', 'useSelectedElementAsRoot');\r\n\r\n if (!selector) {\r\n throw new Error('selectElement: selector is either empty or not defined.');\r\n }\r\n\r\n if (useSelectedElementAsRoot && operationData.selectedElement) {\r\n const currentRoot = operationData.selectedElement;\r\n operationData.selectedElement = findElementBySelector(\r\n currentRoot,\r\n selector\r\n );\r\n return operationData;\r\n }\r\n\r\n const rootCallback = (root: JQuery) => {\r\n operationData.selectedElement = findElementBySelector(root, selector);\r\n };\r\n this.eventbus.broadcast('request-engine-root', [rootCallback]);\r\n\r\n return operationData;\r\n};\r\n","import {getPropertyChainValue} from './helper/get-property-chain-value.ts';\r\nimport {getGlobals, type TGlobalCache} from './helper/globals.ts';\r\nimport {removeProperties} from './helper/remove-operation-properties.ts';\r\nimport {resolveExternalPropertyChain} from './helper/resolve-external-property-chain.ts';\r\nimport type {IOperationScope, TOperation, TOperationData} from './types.ts';\r\n\r\nexport type TDataTarget =\r\n | `$scope.${string}`\r\n | `$operationdata.${string}`\r\n | `$globaldata.${string}`;\r\n\r\nexport interface ISetDataOperationData {\r\n /**\r\n * @required\r\n * @erased\r\n */\r\n properties: Record<TDataTarget, any>;\r\n}\r\n\r\n/**\r\n * This operation assigns the specified properties to the specified data targets.\r\n *\r\n * @example The various ways of assigning data\r\n * ```ts\r\n * setData({\r\n * '$operationdata.foo': '$scope.currentItem', // $scope.currentItem will be assigned to $operationdata.foo\r\n * '$globaldata.foo': '$scope.currentItem', // $scope.currentItem will be assigned to $globaldata.foo\r\n * '$scope.newIndex': 100, // The constant 100 will be assigned to $scope.newIndex\r\n * })\r\n * ```\r\n *\r\n * @category Data\r\n */\r\nexport const setData: TOperation<\r\n ISetDataOperationData,\r\n Omit<ISetDataOperationData, 'properties'>\r\n> = function (operationData: ISetDataOperationData) {\r\n const {properties} = operationData;\r\n removeProperties(operationData, 'properties');\r\n\r\n resolveTargets(properties, operationData, this);\r\n\r\n return operationData;\r\n};\r\n\r\nfunction resolveTargets(\r\n data: Record<TDataTarget, any>,\r\n operationData: Record<string, any>,\r\n scope: IOperationScope\r\n) {\r\n const propertyChains = Object.keys(data);\r\n\r\n return propertyChains.forEach(item => {\r\n const path = item.split('.');\r\n const rootTarget = path.shift()?.toLowerCase().substring(1) ?? '';\r\n if (!isDataTarget(rootTarget)) {\r\n throw new Error(\r\n `Unrecognized target: ${rootTarget}, known targets are: ${knownTargets.join(\r\n ', '\r\n )}`\r\n );\r\n }\r\n const property = path.pop() ?? '';\r\n const propertyValue = resolveExternalPropertyChain(\r\n operationData,\r\n scope,\r\n (data as any)[item]\r\n );\r\n\r\n const targets: {\r\n scope: IOperationScope;\r\n operationdata: TOperationData;\r\n globaldata: TGlobalCache;\r\n } = {\r\n scope,\r\n operationdata: operationData,\r\n globaldata: getGlobals(),\r\n };\r\n\r\n const propertyTarget = getPropertyChainValue(\r\n path,\r\n (targets as any)[rootTarget]\r\n ) as Record<string, any>;\r\n\r\n propertyTarget[property] = propertyValue;\r\n });\r\n}\r\n\r\nconst knownTargets = ['scope', 'operationdata', 'globaldata'];\r\nfunction isDataTarget(value: string): value is TDataTarget {\r\n return knownTargets.includes(value);\r\n}\r\n","import {removeProperties} from './helper/remove-operation-properties.ts';\r\nimport type {TOperation} from './types.ts';\r\n\r\nexport interface ISetElementAttributesOperationData {\r\n /**\r\n * @required\r\n * @erased\r\n */\r\n attributes: Record<string, unknown>;\r\n /**\r\n * @dependency\r\n */\r\n selectedElement: JQuery;\r\n}\r\n\r\n/**\r\n * This operation sets the specified set of attributes on the given selected element.\r\n *\r\n * @category DOM\r\n */\r\nexport const setElementAttributes: TOperation<\r\n ISetElementAttributesOperationData,\r\n Omit<ISetElementAttributesOperationData, 'attributes'>\r\n> = (operationData: ISetElementAttributesOperationData) => {\r\n const {attributes, selectedElement} = operationData;\r\n removeProperties(operationData, 'attributes');\r\n selectedElement.attr(attributes);\r\n return operationData;\r\n};\r\n","import {removeProperties} from './helper/remove-operation-properties.ts';\r\nimport type {TOperation} from './types.ts';\r\n\r\nexport interface ISetElementContentOperationData {\r\n /**\r\n * @dependency\r\n */\r\n selectedElement: JQuery;\r\n /**\r\n * @erased\r\n */\r\n template: string | JQuery.Node;\r\n /**\r\n * overwite = the contents of the selected element are replaced by the given template\r\n *\r\n * append = the new content will be inserted after the current content\r\n *\r\n * prepend = the new content will be inserted before the current content\r\n *\r\n * @erased\r\n */\r\n insertionType: 'overwrite' | 'append' | 'prepend';\r\n}\r\n\r\n/**\r\n * This operation sets the specified content defined by the value assigned to the template property\r\n * to the given selected element.\r\n *\r\n * When the `insertionType` is set to `overwrite` the contents of the selected element are replaced\r\n * by the given template.\r\n * When set to `append` the new content will be inserted after the current content.\r\n * When set to `prepend` the new content will be inserted before the current content.\r\n *\r\n * @category DOM\r\n */\r\nexport const setElementContent: TOperation<\r\n ISetElementContentOperationData,\r\n Omit<ISetElementContentOperationData, 'template' | 'insertionType'>\r\n> = (operationData: ISetElementContentOperationData) => {\r\n const {\r\n insertionType = 'overwrite',\r\n selectedElement,\r\n template,\r\n } = operationData;\r\n\r\n switch (true) {\r\n case insertionType === 'overwrite':\r\n selectedElement.html(template);\r\n break;\r\n case insertionType === 'append':\r\n selectedElement.append(template);\r\n break;\r\n case insertionType === 'prepend':\r\n selectedElement.prepend(template);\r\n break;\r\n }\r\n\r\n removeProperties(operationData, 'insertionType', 'template');\r\n\r\n return operationData;\r\n};\r\n","import type {TOperation} from './types.ts';\r\n\r\nexport interface ISetFocusOperationData {\r\n /**\r\n * @required\r\n * @dependency\r\n */\r\n selectedElement: JQuery;\r\n}\r\n\r\n/**\r\n * Sets focus to the selected element.\r\n *\r\n * @category Focus\r\n */\r\nexport const setFocus: TOperation<\r\n ISetFocusOperationData,\r\n ISetFocusOperationData\r\n> = (operationData: ISetFocusOperationData) => {\r\n const {selectedElement} = operationData;\r\n\r\n if (!selectedElement || selectedElement.length === 0) {\r\n throw new Error('setFocus: selectedElement is required');\r\n }\r\n\r\n selectedElement[0].focus();\r\n\r\n return operationData;\r\n};\r\n","import {removeProperties} from './helper/remove-operation-properties.ts';\r\nimport type {TOperation} from './types.ts';\r\n\r\nexport interface ISetFormValueOperationData {\r\n /**\r\n * @required\r\n * @dependency\r\n */\r\n selectedElement: JQuery;\r\n /**\r\n * @required\r\n * @erased\r\n */\r\n value: string | number | boolean;\r\n}\r\n\r\n/**\r\n * Sets the value of an input, select, or textarea element.\r\n *\r\n * Handles different input types appropriately:\r\n * - Text inputs, textareas, selects: sets value directly\r\n * - Checkboxes: sets checked property for boolean values\r\n * - Radio buttons: sets checked property for boolean values\r\n * - Number inputs: converts to string\r\n *\r\n * @example\r\n * ```typescript\r\n * // Set text input value\r\n * const result = setFormValue({selectedElement: $input, value: 'test@example.com'});\r\n * // Element value is now 'test@example.com'\r\n * ```\r\n *\r\n * @example\r\n * ```typescript\r\n * // Set checkbox checked state\r\n * const result = setFormValue({selectedElement: $checkbox, value: true});\r\n * // Checkbox is now checked\r\n * ```\r\n *\r\n * @category Form\r\n */\r\nexport const setFormValue: TOperation<\r\n ISetFormValueOperationData,\r\n Omit<ISetFormValueOperationData, 'value'>\r\n> = (operationData: ISetFormValueOperationData) => {\r\n const {selectedElement, value} = operationData;\r\n\r\n // Validate selectedElement exists\r\n if (!selectedElement || selectedElement.length === 0) {\r\n throw new Error('setFormValue: selectedElement is required');\r\n }\r\n\r\n // Handle checkboxes and radio buttons with boolean values\r\n if (\r\n typeof value === 'boolean' &&\r\n (selectedElement.is(':checkbox') || selectedElement.is(':radio'))\r\n ) {\r\n selectedElement.prop('checked', value);\r\n } else {\r\n // Handle all other inputs with val()\r\n selectedElement.val(value as any);\r\n }\r\n\r\n removeProperties(operationData, 'value');\r\n\r\n return operationData;\r\n};\r\n","import {setGlobals} from './helper/globals.ts';\r\nimport type {TOperation} from './types.ts';\r\n\r\nexport interface ISetGlobalDataOperationData {\r\n /**\r\n * @required\r\n * @erased\r\n */\r\n propertyNames: string[];\r\n}\r\n\r\n/**\r\n * This operation copies the specified properties from the operationData to the global data.\r\n *\r\n * @category Data\r\n */\r\nexport const setGlobalData: TOperation<\r\n ISetGlobalDataOperationData,\r\n Omit<ISetGlobalDataOperationData, 'propertyNames'>\r\n> = (operationData: ISetGlobalDataOperationData) => {\r\n const {propertyNames, ...newOperationData} = operationData;\r\n const newGlobals = Object.fromEntries(\r\n Object.entries(operationData).filter(([name, _value]) =>\r\n propertyNames.includes(name)\r\n )\r\n );\r\n\r\n setGlobals(newGlobals);\r\n\r\n return newOperationData;\r\n};\r\n","import {resolvePropertyValues} from './helper/resolve-property-values.ts';\r\nimport type {TOperation} from './types.ts';\r\n\r\nexport interface ISetOperationData {\r\n /**\r\n * If set to true, the plucked properties replace the current operation data.\r\n * @erased\r\n */\r\n override?: boolean;\r\n /**\r\n * @required\r\n * @erased\r\n */\r\n properties: Record<string, any>;\r\n}\r\n\r\n/**\r\n * This operation assigns the specified properties to the current operation data.\r\n * When override is set to true the properties replace the current operation data entirely.\r\n *\r\n * @category Data\r\n */\r\nexport const setOperationData: TOperation<\r\n ISetOperationData,\r\n Omit<ISetOperationData, 'override' | 'properties'>\r\n> = function (operationData: ISetOperationData) {\r\n const {override = false, properties, ...newOperationData} = operationData;\r\n\r\n const resolvedProperties = resolvePropertyValues(\r\n newOperationData,\r\n this,\r\n properties\r\n );\r\n\r\n if (override) {\r\n return resolvedProperties;\r\n }\r\n\r\n return {\r\n ...newOperationData,\r\n ...resolvedProperties,\r\n };\r\n};\r\n","import {removeProperties} from './helper/remove-operation-properties.ts';\r\nimport {resolvePropertyValues} from './helper/resolve-property-values.ts';\r\nimport type {TOperation} from './types.ts';\r\n\r\nexport interface ISetStyleOperationData {\r\n /**\r\n * @type=ParameterType:cssProperties\r\n * @required\r\n * @erased\r\n */\r\n properties: Record<string, any>;\r\n /**\r\n * @dependency\r\n */\r\n selectedElement: JQuery;\r\n}\r\n\r\n/**\r\n * This operation assigns the specified CSS style properties to the\r\n * given selected element.\r\n *\r\n * @category DOM\r\n */\r\nexport const setStyle: TOperation<\r\n ISetStyleOperationData,\r\n Omit<ISetStyleOperationData, 'properties'>\r\n> = function (operationData: ISetStyleOperationData) {\r\n const properties = resolvePropertyValues(\r\n operationData,\r\n this,\r\n operationData.properties\r\n );\r\n operationData.selectedElement.css(properties as JQuery.PlainObject);\r\n\r\n removeProperties(operationData, 'properties');\r\n\r\n return operationData;\r\n};\r\n","import {removeProperties} from './helper/remove-operation-properties.ts';\r\nimport type {TOperation} from './types.ts';\r\n\r\nexport interface ISetVariableOperationData {\r\n /**\r\n * @required\r\n * @erased\r\n */\r\n name: string;\r\n /**\r\n * @type=ParameterType:object|ParameterType:string|ParameterType:number|ParameterType:boolean|ParameterType:array\r\n * @required\r\n * @erased\r\n */\r\n value: any;\r\n}\r\n\r\n/**\r\n * This operation sets a variable with the specified name on the scope with the specified value.\r\n *\r\n * @category Data\r\n */\r\nexport const setVariable: TOperation<\r\n ISetVariableOperationData,\r\n Omit<ISetVariableOperationData, 'name' | 'value'>\r\n> = function (operationData: ISetVariableOperationData) {\r\n const {name, value} = operationData;\r\n\r\n if (!this.variables) {\r\n this.variables = {};\r\n }\r\n\r\n this.variables[name] = value;\r\n\r\n removeProperties(operationData, 'name', 'value');\r\n\r\n return operationData;\r\n};\r\n","import {removeProperties} from './helper/remove-operation-properties.ts';\r\nimport type {TOperation} from './types.ts';\r\n\r\nexport type SortOrder = 'asc' | 'desc';\r\n\r\nexport interface ISortArrayOperationData {\r\n /**\r\n * @required\r\n * @dependency\r\n */\r\n arrayData: any[];\r\n /**\r\n * @optional\r\n * @erased\r\n */\r\n sortProperty?: string;\r\n /**\r\n * @optional\r\n * @erased\r\n */\r\n sortOrder?: SortOrder;\r\n /**\r\n * @optional\r\n * @erased\r\n */\r\n sortComparator?: (a: any, b: any) => number;\r\n /**\r\n * @output\r\n */\r\n sortedArray: any[];\r\n}\r\n\r\n/**\r\n * Sorts an array by property, natural order, or custom comparator function.\r\n *\r\n * Operates on arrayData passed from previous operations.\r\n * Supports three sorting modes:\r\n * 1. Property sort: `sortProperty` and `sortOrder` to sort objects by property\r\n * 2. Natural sort: `sortOrder` alone for primitive arrays\r\n * 3. Custom comparator: `sortComparator` function for complex sorting logic\r\n *\r\n * @returns Operation data with `sortedArray` containing sorted results\r\n *\r\n * @example\r\n * ```typescript\r\n * // Sort objects by property\r\n * const result = sortArray({\r\n * arrayData: [{name: 'Bob', age: 30}, {name: 'Alice', age: 25}],\r\n * sortProperty: 'age',\r\n * sortOrder: 'asc'\r\n * });\r\n * // result.sortedArray = [{name: 'Alice', age: 25}, {name: 'Bob', age: 30}]\r\n * ```\r\n *\r\n * @example\r\n * ```typescript\r\n * // Sort primitives\r\n * const result = sortArray({\r\n * arrayData: [5, 2, 8, 1],\r\n * sortOrder: 'desc'\r\n * });\r\n * // result.sortedArray = [8, 5, 2, 1]\r\n * ```\r\n *\r\n * @example\r\n * ```typescript\r\n * // Custom comparator\r\n * const result = sortArray({\r\n * arrayData: ['apple', 'Banana', 'cherry'],\r\n * sortComparator: (a, b) => a.toLowerCase().localeCompare(b.toLowerCase())\r\n * });\r\n * ```\r\n *\r\n * @category Array\r\n */\r\nexport const sortArray: TOperation<\r\n ISortArrayOperationData,\r\n Omit<ISortArrayOperationData, 'sortProperty' | 'sortOrder' | 'sortComparator'>\r\n> = (operationData: ISortArrayOperationData) => {\r\n const {arrayData, sortProperty, sortOrder, sortComparator} = operationData;\r\n\r\n if (!Array.isArray(arrayData)) {\r\n throw new Error('sortArray: arrayData is required and must be an array');\r\n }\r\n\r\n // Create a copy to avoid mutating original\r\n const sorted = [...arrayData];\r\n\r\n if (sortComparator) {\r\n sorted.sort(sortComparator);\r\n } else if (sortProperty) {\r\n sorted.sort((a, b) => {\r\n const aVal = a[sortProperty];\r\n const bVal = b[sortProperty];\r\n\r\n if (aVal < bVal) return sortOrder === 'desc' ? 1 : -1;\r\n if (aVal > bVal) return sortOrder === 'desc' ? -1 : 1;\r\n return 0;\r\n });\r\n } else {\r\n // Natural sort for primitives\r\n sorted.sort((a, b) => {\r\n if (a < b) return sortOrder === 'desc' ? 1 : -1;\r\n if (a > b) return sortOrder === 'desc' ? -1 : 1;\r\n return 0;\r\n });\r\n }\r\n\r\n operationData.sortedArray = sorted;\r\n\r\n removeProperties(\r\n operationData,\r\n 'sortProperty',\r\n 'sortOrder',\r\n 'sortComparator'\r\n );\r\n\r\n return operationData;\r\n};\r\n","import {removeProperties} from './helper/remove-operation-properties.ts';\r\nimport type {TOperation} from './types.ts';\r\n\r\nexport interface ISplitStringOperationData {\r\n /**\r\n * @required\r\n * @dependency\r\n */\r\n textContent: string;\r\n /**\r\n * @required\r\n * @erased\r\n */\r\n delimiter: string | RegExp;\r\n /**\r\n * @optional\r\n * @erased\r\n */\r\n limit?: number;\r\n /**\r\n * @output\r\n */\r\n resultArray: string[];\r\n}\r\n\r\n/**\r\n * Splits a string into an array by delimiter (string or regex).\r\n *\r\n * @returns Operation data with `resultArray` containing the split strings\r\n *\r\n * @example\r\n * ```typescript\r\n * const result = splitString({\r\n * textContent: 'apple,banana,cherry',\r\n * delimiter: ','\r\n * });\r\n * // result.resultArray = ['apple', 'banana', 'cherry']\r\n * ```\r\n *\r\n * @category String\r\n */\r\nexport const splitString: TOperation<\r\n ISplitStringOperationData,\r\n Omit<ISplitStringOperationData, 'delimiter' | 'limit'>\r\n> = (operationData: ISplitStringOperationData) => {\r\n const {textContent, delimiter, limit} = operationData;\r\n\r\n if (textContent === undefined || textContent === null) {\r\n throw new Error('splitString: textContent is required');\r\n }\r\n\r\n operationData.resultArray = textContent.split(delimiter, limit);\r\n\r\n removeProperties(operationData, 'delimiter', 'limit');\r\n\r\n return operationData;\r\n};\r\n","import type {IAction} from '../action/types.ts';\r\nimport {internalResolve} from './helper/internal-resolve.ts';\r\nimport {mergeOperationData} from './helper/merge-operation-data.ts';\r\nimport type {TOperation, TOperationData} from './types.ts';\r\n\r\nexport interface IStartActionOperationData {\r\n /**\r\n * @dependency\r\n */\r\n actionInstance: IAction;\r\n /**\r\n * @type=ParameterType:object\r\n * @erased\r\n */\r\n actionOperationData: TOperationData;\r\n}\r\n\r\n/**\r\n * This operation starts the specified action instance using the given action operation data.\r\n *\r\n * The action operation data is first merged with the current operation data before it is\r\n * passed on to the action. After the action has completed the action operation data properties\r\n * are removed from the current operation data.\r\n *\r\n * @category Action\r\n */\r\nexport const startAction: TOperation<\r\n IStartActionOperationData,\r\n Omit<IStartActionOperationData, 'actionOperationData'>\r\n> = (operationData: IStartActionOperationData) => {\r\n let {actionInstance, actionOperationData, ...newOperationData} =\r\n operationData;\r\n\r\n return new Promise((resolve, reject) => {\r\n newOperationData = mergeOperationData(\r\n newOperationData,\r\n actionOperationData\r\n );\r\n\r\n actionInstance.start(newOperationData).then(() => {\r\n Object.keys(actionOperationData).forEach(key => {\r\n delete (newOperationData as any)[key];\r\n });\r\n internalResolve(resolve, {...newOperationData, actionInstance});\r\n }, reject);\r\n });\r\n};\r\n","import {removeProperties} from './helper/remove-operation-properties.ts';\r\nimport type {TOperation} from './types.ts';\r\n\r\nexport interface ISubstringTextOperationData {\r\n /**\r\n * @required\r\n * @dependency\r\n */\r\n textContent: string;\r\n /**\r\n * @required\r\n * @erased\r\n */\r\n start: number;\r\n /**\r\n * @optional\r\n * @erased\r\n */\r\n end?: number;\r\n /**\r\n * @output\r\n */\r\n substring: string;\r\n}\r\n\r\n/**\r\n * Extracts a substring from text between start and end indices.\r\n *\r\n * @returns Operation data with `substring` containing the extracted text\r\n *\r\n * @example\r\n * ```typescript\r\n * const result = substringText({\r\n * textContent: 'Hello World',\r\n * start: 0,\r\n * end: 5\r\n * });\r\n * // result.substring = \"Hello\"\r\n * ```\r\n *\r\n * @category Text\r\n */\r\nexport const substringText: TOperation<\r\n ISubstringTextOperationData,\r\n Omit<ISubstringTextOperationData, 'start' | 'end'>\r\n> = (operationData: ISubstringTextOperationData) => {\r\n const {textContent, start, end} = operationData;\r\n\r\n if (textContent === undefined || textContent === null) {\r\n throw new Error('substringText: textContent is required');\r\n }\r\n\r\n if (typeof start !== 'number') {\r\n throw new Error('substringText: start must be a number');\r\n }\r\n\r\n operationData.substring = textContent.substring(start, end);\r\n\r\n removeProperties(operationData, 'start', 'end');\r\n\r\n return operationData;\r\n};\r\n","import type {TOperation} from './types.ts';\r\n\r\nexport interface IToggleClassOperationData {\r\n /**\r\n * The element on which the class will be toggled\r\n * @dependency\r\n */\r\n selectedElement: JQuery;\r\n /**\r\n * The class that will be toggled\r\n * @type=ParameterType:className\r\n * @required\r\n * @erased\r\n */\r\n className: string;\r\n}\r\n\r\n/**\r\n * This operation toggles the specfied class name on the given selected element.\r\n *\r\n * Meaning, if the specified class name exists on the given element it will be removed,\r\n * otherwise it will be added.\r\n *\r\n * @category DOM\r\n */\r\nexport const toggleClass: TOperation<\r\n IToggleClassOperationData,\r\n Omit<IToggleClassOperationData, 'className'>\r\n> = (operationData: IToggleClassOperationData) => {\r\n const {selectedElement, className} = operationData;\r\n selectedElement.toggleClass(className);\r\n delete (operationData as any).className;\r\n return operationData;\r\n};\r\n","import type {TOperation} from './types.ts';\r\n\r\nexport interface IToggleElementOperationData {\r\n /**\r\n * The element whose visibility will be toggled\r\n * @dependency\r\n */\r\n selectedElement: JQuery;\r\n}\r\n\r\n/**\r\n * This operation toggles the visibility of the given selected element.\r\n *\r\n * Meaning, if the element is hidden, it will be made visible, otherwise\r\n * it will be hidden.\r\n *\r\n * @category DOM\r\n */\r\nexport const toggleElement: TOperation<IToggleElementOperationData> =\r\n function toggleElement(operationData: IToggleElementOperationData) {\r\n operationData.selectedElement.toggle();\r\n return operationData;\r\n };\r\n","import {removeProperties} from './helper/remove-operation-properties.ts';\r\nimport type {TOperation} from './types.ts';\r\n\r\nexport interface IToggleFormElementOperationData {\r\n /**\r\n * @required\r\n * @dependency\r\n */\r\n selectedElement: JQuery;\r\n /**\r\n * @required\r\n * @erased\r\n */\r\n enabled: boolean;\r\n}\r\n\r\n/**\r\n * Enables or disables form input elements (inputs, selects, textareas, buttons).\r\n *\r\n * Sets the `disabled` property on the element. When `enabled` is true, removes the disabled\r\n * attribute; when false, adds the disabled attribute.\r\n *\r\n * @example\r\n * ```typescript\r\n * // Disable an input field\r\n * toggleFormElement({selectedElement: $input, enabled: false});\r\n * // Input is now disabled\r\n * ```\r\n *\r\n * @example\r\n * ```typescript\r\n * // Enable a previously disabled button\r\n * toggleFormElement({selectedElement: $button, enabled: true});\r\n * // Button is now enabled\r\n * ```\r\n *\r\n * @category Form\r\n */\r\nexport const toggleFormElement: TOperation<\r\n IToggleFormElementOperationData,\r\n Omit<IToggleFormElementOperationData, 'enabled'>\r\n> = (operationData: IToggleFormElementOperationData) => {\r\n const {selectedElement, enabled} = operationData;\r\n\r\n if (!selectedElement || selectedElement.length === 0) {\r\n throw new Error('toggleFormElement: selectedElement is required');\r\n }\r\n\r\n // Set disabled property (disabled = !enabled)\r\n selectedElement.prop('disabled', !enabled);\r\n\r\n removeProperties(operationData, 'enabled');\r\n\r\n return operationData;\r\n};\r\n","import $ from 'jquery';\r\nimport {removeProperties} from './helper/remove-operation-properties.ts';\r\nimport type {TOperation} from './types.ts';\r\n\r\nexport interface IValidationRules {\r\n required?: boolean;\r\n minLength?: number;\r\n maxLength?: number;\r\n pattern?: string | RegExp;\r\n email?: boolean;\r\n}\r\n\r\nexport interface IValidateFormOperationData {\r\n /**\r\n * @required\r\n * @dependency\r\n */\r\n selectedElement: JQuery;\r\n /**\r\n * @erased\r\n */\r\n validationRules?: Record<string, IValidationRules>;\r\n /**\r\n * @output\r\n * @type=ParameterType:object\r\n */\r\n validationErrors?: Record<string, string>;\r\n /**\r\n * @output\r\n */\r\n isValid?: boolean;\r\n}\r\n\r\n/**\r\n * Validates form fields against HTML5 validation and custom rules.\r\n *\r\n * Uses HTML5 validation API (checkValidity()) for native validation, and supports\r\n * custom validation rules for: required, minLength, maxLength, pattern (regex), and email format.\r\n *\r\n * @returns Operation data with `validationErrors` object (field names → error messages) and `isValid` boolean\r\n *\r\n * @example\r\n * ```typescript\r\n * // Validate with HTML5 validation\r\n * const result = validateForm({selectedElement: $form});\r\n * // Returns: {isValid: true, validationErrors: {}}\r\n * ```\r\n *\r\n * @example\r\n * ```typescript\r\n * // Validate with custom rules\r\n * const result = validateForm({\r\n * selectedElement: $form,\r\n * validationRules: {\r\n * password: { required: true, minLength: 8 },\r\n * email: { email: true }\r\n * }\r\n * });\r\n * // Returns: {isValid: false, validationErrors: {password: \"Must be at least 8 characters\"}}\r\n * ```\r\n *\r\n * @category Form\r\n */\r\nexport const validateForm: TOperation<\r\n IValidateFormOperationData,\r\n Omit<IValidateFormOperationData, 'validationRules'>\r\n> = (operationData: IValidateFormOperationData) => {\r\n const {selectedElement, validationRules} = operationData;\r\n\r\n if (!selectedElement || selectedElement.length === 0) {\r\n throw new Error('validateForm: selectedElement is required');\r\n }\r\n\r\n if (!selectedElement.is('form')) {\r\n throw new Error('validateForm: selectedElement must be a form element');\r\n }\r\n\r\n const validationErrors: Record<string, string> = {};\r\n const emailRegex = /^[^\\s@]+@[^\\s@]+\\.[^\\s@]+$/;\r\n\r\n // Get all form inputs\r\n const inputs = selectedElement.find('input, select, textarea');\r\n\r\n inputs.each((_, element) => {\r\n const $input = $(element);\r\n const name = $input.attr('name');\r\n\r\n if (!name) return; // Skip inputs without name attribute\r\n\r\n const value = $input.val() as string;\r\n const rules = validationRules?.[name];\r\n\r\n // HTML5 validation first\r\n const inputElement = element as\r\n | HTMLInputElement\r\n | HTMLTextAreaElement\r\n | HTMLSelectElement;\r\n if (inputElement.checkValidity && !inputElement.checkValidity()) {\r\n validationErrors[name] =\r\n inputElement.validationMessage || 'Invalid value';\r\n return;\r\n }\r\n\r\n // Custom validation rules\r\n if (rules) {\r\n if (rules.required && (!value || value.trim() === '')) {\r\n validationErrors[name] = 'This field is required';\r\n return;\r\n }\r\n\r\n if (rules.minLength && value.length < rules.minLength) {\r\n validationErrors[name] =\r\n `Must be at least ${rules.minLength} characters`;\r\n return;\r\n }\r\n\r\n if (rules.maxLength && value.length > rules.maxLength) {\r\n validationErrors[name] =\r\n `Must be no more than ${rules.maxLength} characters`;\r\n return;\r\n }\r\n\r\n if (rules.pattern) {\r\n const pattern =\r\n typeof rules.pattern === 'string'\r\n ? new RegExp(rules.pattern)\r\n : rules.pattern;\r\n if (!pattern.test(value)) {\r\n validationErrors[name] = 'Invalid format';\r\n return;\r\n }\r\n }\r\n\r\n if (rules.email && !emailRegex.test(value)) {\r\n validationErrors[name] = 'Must be a valid email address';\r\n return;\r\n }\r\n }\r\n });\r\n\r\n operationData.validationErrors = validationErrors;\r\n operationData.isValid = Object.keys(validationErrors).length === 0;\r\n\r\n removeProperties(operationData, 'validationRules');\r\n\r\n return operationData;\r\n};\r\n","import {internalResolve} from './helper/internal-resolve.ts';\r\nimport type {TOperation} from './types.ts';\r\n\r\nexport interface IWaitOperationData {\r\n /**\r\n * The amount of milliseconds the operation will wait for.\r\n * @required\r\n * @erased\r\n */\r\n milliseconds: number;\r\n}\r\n\r\n/**\r\n * This operation waits for the specified amount of milliseconds.\r\n *\r\n * @category Utility\r\n */\r\nexport const wait: TOperation<\r\n IWaitOperationData,\r\n Omit<IWaitOperationData, 'milliseconds'>\r\n> = (operationData: IWaitOperationData) => {\r\n const {milliseconds, ...newOperationData} = operationData;\r\n\r\n return new Promise(resolve => {\r\n setTimeout(() => {\r\n internalResolve(resolve, newOperationData);\r\n }, milliseconds);\r\n });\r\n};\r\n","export type {IAddClassOperationData} from './add-class.ts';\r\nexport {addClass} from './add-class.ts';\r\nexport type {IAddControllerToElementOperationData} from './add-controller-to-element.ts';\r\nexport {addControllerToElement} from './add-controller-to-element.ts';\r\nexport {addGlobalsToOperation} from './add-globals-to-operation.ts';\r\nexport type {IAnimateOperationData} from './animate.ts';\r\nexport {animate} from './animate.ts';\r\nexport type {IAnimateWithClassOperationData} from './animate-with-class.ts';\r\nexport {animateWithClass} from './animate-with-class.ts';\r\nexport type {IAnnounceToScreenReaderOperationData} from './announce-to-screen-reader.ts';\r\nexport {announceToScreenReader} from './announce-to-screen-reader.ts';\r\nexport {breakForEach} from './break-for-each.ts';\r\nexport type {IBroadcastEventOperationData} from './broadcast-event.ts';\r\nexport {broadcastEvent} from './broadcast-event.ts';\r\nexport type {ICalcOperationData} from './calc.ts';\r\nexport {calc} from './calc.ts';\r\nexport type {IClearElementOperationData} from './clear-element.ts';\r\nexport {clearElement} from './clear-element.ts';\r\nexport type {IClearOperationDataOperationData} from './clear-operation-data.ts';\r\nexport {clearOperationData} from './clear-operation-data.ts';\r\nexport type {IClearStorageOperationData, StorageType} from './clear-storage.ts';\r\nexport {clearStorage} from './clear-storage.ts';\r\nexport type {ICompareDateOperationData} from './compare-date.ts';\r\nexport {compareDate} from './compare-date.ts';\r\nexport type {IConcatenateStringsOperationData} from './concatenate-strings.ts';\r\nexport {concatenateStrings} from './concatenate-strings.ts';\r\nexport {continueForEach} from './continue-for-each.ts';\r\nexport type {ICreateElementOperationData} from './create-element.ts';\r\nexport {createElement} from './create-element.ts';\r\nexport type {ICustomFunctionOperationData} from './custom-function.ts';\r\nexport {customFunction} from './custom-function.ts';\r\nexport type {IEndActionOperationData} from './end-action.ts';\r\nexport {endAction} from './end-action.ts';\r\nexport {endForEach} from './end-for-each.ts';\r\nexport {endWhen} from './end-when.ts';\r\nexport type {IExtendControllerOperationData} from './extend-controller.ts';\r\nexport {extendController} from './extend-controller.ts';\r\nexport type {IFilterArrayOperationData} from './filter-array.ts';\r\nexport {filterArray} from './filter-array.ts';\r\nexport type {IFindInArrayOperationData} from './find-in-array.ts';\r\nexport {findInArray} from './find-in-array.ts';\r\nexport type {IForEachOperationData} from './for-each.ts';\r\nexport {forEach} from './for-each.ts';\r\nexport type {IFormatDateOperationData} from './format-date.ts';\r\nexport {formatDate} from './format-date.ts';\r\nexport type {IFormatTextOperationData} from './format-text.ts';\r\nexport {formatText} from './format-text.ts';\r\nexport type {IGetAttributesFromElementOperationData} from './get-attributes-from-element.ts';\r\nexport {getAttributesFromElement} from './get-attributes-from-element.ts';\r\nexport type {IGetControllerFromElementOperationData} from './get-controller-from-element.ts';\r\nexport {getControllerFromElement} from './get-controller-from-element.ts';\r\nexport type {IGetControllerInstanceOperationData} from './get-controller-instance.ts';\r\nexport {getControllerInstance} from './get-controller-instance.ts';\r\nexport type {IGetCurrentTimeOperationData} from './get-current-time.ts';\r\nexport {getCurrentTime} from './get-current-time.ts';\r\nexport type {IGetElementDimensionsOperationData} from './get-element-dimensions.ts';\r\nexport {getElementDimensions} from './get-element-dimensions.ts';\r\nexport type {IGetFocusedElementOperationData} from './get-focused-element.ts';\r\nexport {getFocusedElement} from './get-focused-element.ts';\r\nexport type {IGetFormDataOperationData} from './get-form-data.ts';\r\nexport {getFormData} from './get-form-data.ts';\r\nexport type {IGetImportOperationData} from './get-import.ts';\r\nexport {getImport} from './get-import.ts';\r\nexport type {IGetQueryParamsOperationData} from './get-query-params.ts';\r\nexport {getQueryParams} from './get-query-params.ts';\r\nexport type {IGetScrollPositionOperationData} from './get-scroll-position.ts';\r\nexport {getScrollPosition} from './get-scroll-position.ts';\r\nexport type {IGetTextContentOperationData} from './get-text-content.ts';\r\nexport {getTextContent} from './get-text-content.ts';\r\nexport type {IHttpDeleteOperationData} from './http-delete.ts';\r\nexport {httpDelete} from './http-delete.ts';\r\nexport type {IHttpPostOperationData} from './http-post.ts';\r\nexport {httpPost} from './http-post.ts';\r\nexport type {IHttpPutOperationData} from './http-put.ts';\r\nexport {httpPut} from './http-put.ts';\r\nexport type {IInvokeObjectMethodOperationData} from './invoke-object-method.ts';\r\nexport {invokeObjectMethod} from './invoke-object-method.ts';\r\nexport type {IIsElementInViewportOperationData} from './is-element-in-viewport.ts';\r\nexport {isElementInViewport} from './is-element-in-viewport.ts';\r\nexport type {ILoadFromStorageOperationData} from './load-from-storage.ts';\r\nexport {loadFromStorage} from './load-from-storage.ts';\r\nexport type {ILoadJSONOperationData} from './load-json.ts';\r\nexport {loadJson} from './load-json.ts';\r\nexport type {ILogOperationData} from './log.ts';\r\nexport {log} from './log.ts';\r\nexport type {IMapArrayOperationData} from './map-array.ts';\r\nexport {mapArray} from './map-array.ts';\r\nexport type {IMathOperationData} from './math.ts';\r\nexport {math} from './math.ts';\r\nexport {otherwise} from './otherwise.ts';\r\nexport type {IRemoveClassOperationData} from './remove-class.ts';\r\nexport {removeClass} from './remove-class.ts';\r\nexport type {IRemoveControllerFromElementOperationData} from './remove-controller-from-element.ts';\r\nexport {removeControllerFromElement} from './remove-controller-from-element.ts';\r\nexport type {IRemoveElementOperationData} from './remove-element.ts';\r\nexport {removeElement} from './remove-element.ts';\r\nexport type {IRemovePropertiesFromOperationDataOperationData} from './remove-properties-from-operation-data.ts';\r\nexport {removePropertiesFromOperationData} from './remove-properties-from-operation-data.ts';\r\nexport type {IReparentElementOperationData} from './reparent-element.ts';\r\nexport {reparentElement} from './reparent-element.ts';\r\nexport type {IReplaceStringOperationData} from './replace-string.ts';\r\nexport {replaceString} from './replace-string.ts';\r\nexport type {IReplaceTextOperationData} from './replace-text.ts';\r\nexport {replaceText} from './replace-text.ts';\r\nexport type {IRequestActionOperationData} from './request-action.ts';\r\nexport {requestAction} from './request-action.ts';\r\nexport type {ISaveToStorageOperationData} from './save-to-storage.ts';\r\nexport {saveToStorage} from './save-to-storage.ts';\r\nexport type {IScrollToElementOperationData} from './scroll-to-element.ts';\r\nexport {scrollToElement} from './scroll-to-element.ts';\r\nexport type {IScrollToPositionOperationData} from './scroll-to-position.ts';\r\nexport {scrollToPosition} from './scroll-to-position.ts';\r\nexport type {ISelectElementOperationData} from './select-element.ts';\r\nexport {selectElement} from './select-element.ts';\r\nexport type {ISetDataOperationData} from './set-data.ts';\r\nexport {setData} from './set-data.ts';\r\nexport type {ISetElementAttributesOperationData} from './set-element-attributes.ts';\r\nexport {setElementAttributes} from './set-element-attributes.ts';\r\nexport type {ISetElementContentOperationData} from './set-element-content.ts';\r\nexport {setElementContent} from './set-element-content.ts';\r\nexport type {ISetFocusOperationData} from './set-focus.ts';\r\nexport {setFocus} from './set-focus.ts';\r\nexport type {ISetFormValueOperationData} from './set-form-value.ts';\r\nexport {setFormValue} from './set-form-value.ts';\r\nexport type {ISetGlobalDataOperationData} from './set-global-data.ts';\r\nexport {setGlobalData} from './set-global-data.ts';\r\nexport type {ISetOperationData} from './set-operation-data.ts';\r\nexport {setOperationData} from './set-operation-data.ts';\r\nexport type {ISetStyleOperationData} from './set-style.ts';\r\nexport {setStyle} from './set-style.ts';\r\nexport type {ISetVariableOperationData} from './set-variable.ts';\r\nexport {setVariable} from './set-variable.ts';\r\nexport type {ISortArrayOperationData} from './sort-array.ts';\r\nexport {sortArray} from './sort-array.ts';\r\nexport type {ISplitStringOperationData} from './split-string.ts';\r\nexport {splitString} from './split-string.ts';\r\nexport type {IStartActionOperationData} from './start-action.ts';\r\nexport {startAction} from './start-action.ts';\r\nexport type {ISubstringTextOperationData} from './substring-text.ts';\r\nexport {substringText} from './substring-text.ts';\r\nexport type {IToggleClassOperationData} from './toggle-class.ts';\r\nexport {toggleClass} from './toggle-class.ts';\r\nexport type {IToggleElementOperationData} from './toggle-element.ts';\r\nexport {toggleElement} from './toggle-element.ts';\r\nexport type {IToggleFormElementOperationData} from './toggle-form-element.ts';\r\nexport {toggleFormElement} from './toggle-form-element.ts';\r\nexport type * from './types.ts';\r\nexport type {IValidateFormOperationData} from './validate-form.ts';\r\nexport {validateForm} from './validate-form.ts';\r\nexport type {IWaitOperationData} from './wait.ts';\r\nexport {wait} from './wait.ts';\r\nexport type {IWhenOperationData} from './when.ts';\r\nexport {when} from './when.ts';\r\n","import {v4 as uuidv4} from 'uuid';\r\nimport {deepCopy} from '../../operation/helper/deep-copy.ts';\r\nimport * as operations from '../../operation/index.ts';\r\nimport type {\r\n ExtractOperationDataType,\r\n GetOperationByName,\r\n IActionConfiguration,\r\n IEndableActionConfiguration,\r\n ITimelineActionConfiguration,\r\n TOperationName,\r\n TOperationType,\r\n} from '../types.ts';\r\nimport type {ConfigurationFactory} from './configuration-factory.ts';\r\n\r\n/**\r\n *\r\n * Container factory capable of creating the different kinds of actions.\r\n * For each type of action a dedicated factory will be returned.\r\n *\r\n */\r\nexport class ActionCreatorFactory {\r\n constructor(private readonly configurationfactory: ConfigurationFactory) {}\r\n\r\n /**\r\n *\r\n * Starts the creation of an action in the `actions` list with the specified name\r\n *\r\n * @param name\r\n * @returns\r\n */\r\n createAction(name: string): EndableActionCreator {\r\n const creator = new EndableActionCreator(name, this);\r\n this.configurationfactory.addAction(creator.actionConfig);\r\n return creator;\r\n }\r\n\r\n /**\r\n *\r\n * Starts the creation of an action in the `initActions` list with the specified name\r\n *\r\n * @param name\r\n * @returns\r\n */\r\n createInitAction(name: string): EndableActionCreator {\r\n const creator = new EndableActionCreator(name, this);\r\n this.configurationfactory.addInitAction(creator.actionConfig);\r\n return creator;\r\n }\r\n\r\n /**\r\n *\r\n * Starts the creation of an action in the `eventActions` list with the specified name\r\n *\r\n * @param name\r\n * @returns\r\n */\r\n createEventAction(name: string): ActionCreator {\r\n const creator = new ActionCreator(name, this);\r\n this.configurationfactory.addEventAction(creator.actionConfig);\r\n return creator;\r\n }\r\n\r\n /**\r\n *\r\n * Starts the creation of an action in the `timelineActions` list with the specified name and uri\r\n *\r\n * @param uri\r\n * @param name\r\n * @returns\r\n */\r\n createTimelineAction(uri: string, name: string): TimelineActionCreator {\r\n const creator = new TimelineActionCreator(name, this);\r\n this.configurationfactory.addTimelineAction(uri, creator.actionConfig);\r\n return creator;\r\n }\r\n\r\n /**\r\n *\r\n * Returns the fluent scope back to the `Configurationfactory`\r\n *\r\n * @returns\r\n */\r\n end() {\r\n return this.configurationfactory;\r\n }\r\n}\r\n\r\n/**\r\n *\r\n * A factory that assists in creating an action\r\n *\r\n */\r\nexport class ActionCreator<\r\n T extends IActionConfiguration = IActionConfiguration,\r\n> {\r\n actionConfig: T;\r\n\r\n /**\r\n *\r\n * Initializes an action configuration with the given name\r\n *\r\n * @param name\r\n * @param factory\r\n */\r\n constructor(\r\n name: string | undefined,\r\n private readonly factory: ActionCreatorFactory\r\n ) {\r\n this.actionConfig = {\r\n name: name ?? '',\r\n id: uuidv4(),\r\n startOperations: [],\r\n } as unknown as T;\r\n }\r\n\r\n /**\r\n *\r\n * The unique id of the action\r\n *\r\n * @returns\r\n */\r\n getId() {\r\n return this.actionConfig.id;\r\n }\r\n\r\n /**\r\n *\r\n * Sets the name of the action\r\n *\r\n * @param name\r\n * @returns\r\n */\r\n setName(name: string) {\r\n this.actionConfig.name = name;\r\n return this;\r\n }\r\n\r\n /**\r\n *\r\n * Returns a copy of the internal state of the `ActionCreator`\r\n *\r\n * @param callBack\r\n * @returns\r\n */\r\n getConfiguration(callBack: (config: T) => T) {\r\n const copy = deepCopy(this.actionConfig);\r\n const newConfig = callBack.call(this, copy);\r\n if (newConfig) {\r\n this.actionConfig = newConfig;\r\n }\r\n return this;\r\n }\r\n\r\n /**\r\n *\r\n * Adds the operation data for a start operation specified by the given type\r\n *\r\n * @param operationClass\r\n * @param operationData\r\n * @returns\r\n */\r\n addStartOperationByType<\r\n T extends TOperationType,\r\n Dt extends Partial<ExtractOperationDataType<T>>,\r\n >(operationClass: T, operationData: Dt) {\r\n const entries = Object.entries(operations).find(\r\n ([, value]) => value === operationClass\r\n );\r\n\r\n if (entries) {\r\n return this.addStartOperation(\r\n entries[0] as TOperationName,\r\n operationData\r\n );\r\n }\r\n\r\n throw new Error(`Operation class not found: ${operationClass.toString()}`);\r\n }\r\n\r\n /**\r\n *\r\n * Adds the operation data for a start operation specified by the given system name\r\n *\r\n * @param systemName\r\n * @param operationData\r\n * @returns\r\n */\r\n addStartOperation<\r\n T extends TOperationName,\r\n O extends Partial<ExtractOperationDataType<GetOperationByName<T>>>,\r\n >(systemName: T, operationData: O) {\r\n if (!(operations as Record<string, any>)[systemName]) {\r\n throw Error(`Unknown operation: ${systemName}`);\r\n }\r\n\r\n const {startOperations} = this.actionConfig;\r\n startOperations.push({\r\n id: uuidv4(),\r\n systemName: systemName,\r\n operationData: operationData,\r\n });\r\n return this;\r\n }\r\n\r\n /**\r\n *\r\n * Returns the fluent scope back to the `ActionCreatorFactory`\r\n *\r\n * @returns\r\n */\r\n next() {\r\n return this.factory;\r\n }\r\n}\r\n\r\n/**\r\n *\r\n * A factory that assists in creating an endable action\r\n *\r\n */\r\nexport class EndableActionCreator<\r\n T extends IEndableActionConfiguration = IEndableActionConfiguration,\r\n> extends ActionCreator<T> {\r\n constructor(name: string | undefined, factory: ActionCreatorFactory) {\r\n super(name, factory);\r\n this.actionConfig.endOperations = [];\r\n }\r\n\r\n /**\r\n *\r\n * Adds the operation data for an end operation specified by the given type\r\n *\r\n * @param operationClass\r\n * @param operationData\r\n * @returns\r\n */\r\n addEndOperationByType<\r\n T extends TOperationType,\r\n Dt extends Partial<ExtractOperationDataType<T>>,\r\n >(operationClass: T, operationData: Dt) {\r\n const entries = Object.entries(operations).find(\r\n ([, value]) => value === operationClass\r\n );\r\n\r\n if (entries) {\r\n return this.addEndOperation(entries[0] as TOperationName, operationData);\r\n }\r\n\r\n throw new Error(`Operation class not found: ${operationClass.toString()}`);\r\n }\r\n\r\n /**\r\n *\r\n * Adds the operation data for an end operation specified by the given system name\r\n *\r\n * @param systemName\r\n * @param operationData\r\n * @returns\r\n */\r\n addEndOperation<\r\n T extends TOperationName,\r\n O extends Partial<ExtractOperationDataType<GetOperationByName<T>>>,\r\n >(systemName: TOperationName, operationData: O) {\r\n // biome-ignore lint/performance/noDynamicNamespaceImportAccess: Dynamic operation lookup is intentional for configuration API\r\n if (!operations[systemName]) {\r\n throw Error(`Unknown operation: ${systemName}`);\r\n }\r\n\r\n let {endOperations} = this.actionConfig;\r\n if (!endOperations) {\r\n endOperations = this.actionConfig.endOperations = [];\r\n }\r\n endOperations.push({\r\n id: uuidv4(),\r\n systemName: systemName,\r\n operationData: operationData,\r\n });\r\n return this;\r\n }\r\n}\r\n\r\n/**\r\n *\r\n * A factory that assists in creating a timeline action\r\n *\r\n */\r\nexport class TimelineActionCreator extends EndableActionCreator<ITimelineActionConfiguration> {\r\n /**\r\n *\r\n * Sets the duration specified by the given start and optional end positions\r\n *\r\n * @param start\r\n * @param end\r\n * @returns\r\n */\r\n addDuration(start: number, end?: number) {\r\n this.actionConfig.duration = {\r\n start: start,\r\n };\r\n if (end) {\r\n this.actionConfig.duration.end = end;\r\n }\r\n return this;\r\n }\r\n}\r\n","import {isDefined} from 'ts-is-present';\r\nimport {v4 as uuidv4} from 'uuid';\r\nimport {deepCopy} from '../../operation/helper/deep-copy.ts';\r\nimport * as operations from '../../operation/index.ts';\r\nimport type {TOperation, TOperationData} from '../../operation/types.ts';\r\nimport type {IDuration} from '../../types.ts';\r\nimport type {\r\n ExtractOperationDataType,\r\n GetOperationByName,\r\n IActionConfiguration,\r\n IEndableActionConfiguration,\r\n IOperationConfiguration,\r\n ITimelineActionConfiguration,\r\n TOperationName,\r\n TOperationType,\r\n} from '../types.ts';\r\nimport type {ConfigurationFactory} from './configuration-factory.ts';\r\n\r\nfunction array_move(arr: any[], old_index: number, new_index: number) {\r\n if (new_index >= arr.length) {\r\n new_index = 0;\r\n } else if (new_index < 0) {\r\n new_index = arr.length - 1;\r\n }\r\n arr.splice(new_index, 0, arr.splice(old_index, 1)[0]);\r\n}\r\n\r\n/**\r\n *\r\n * A factory that assists in editing an action\r\n *\r\n */\r\nexport class ActionEditor<\r\n T extends IActionConfiguration = IActionConfiguration,\r\n> {\r\n constructor(\r\n protected actionConfig: T,\r\n protected readonly configurationFactory: ConfigurationFactory\r\n ) {}\r\n\r\n updateConfiguration() {\r\n this.actionConfig = structuredClone(this.actionConfig);\r\n }\r\n\r\n /**\r\n *\r\n * Returns a copy of the current internal state of the factory\r\n *\r\n * @param callBack\r\n * @returns\r\n */\r\n getConfiguration(callBack: (config: T) => T | undefined) {\r\n const copy = deepCopy(this.actionConfig);\r\n const newConfig = callBack.call(this, copy);\r\n if (newConfig) {\r\n this.actionConfig = newConfig;\r\n }\r\n return this;\r\n }\r\n\r\n /**\r\n *\r\n * Sets the action name\r\n *\r\n * @param name\r\n * @returns\r\n */\r\n setName(name: string) {\r\n this.actionConfig = {\r\n ...this.actionConfig,\r\n name,\r\n };\r\n return this;\r\n }\r\n\r\n /**\r\n *\r\n * Gets the action name\r\n *\r\n * @returns\r\n */\r\n getName() {\r\n return this.actionConfig.name;\r\n }\r\n\r\n /**\r\n *\r\n * Adds the operation data for a start operation specified by the given type\r\n *\r\n * @param operationClass\r\n * @param operationData\r\n * @returns\r\n */\r\n addStartOperationByType<T extends TOperation<TOperationData>>(\r\n operationClass: T,\r\n operationData: Partial<ExtractOperationDataType<T>>\r\n ): OperationEditor<this, T> {\r\n const entries = Object.entries(operations).find(\r\n ([, value]) => value === operationClass\r\n );\r\n\r\n if (entries) {\r\n return this.addStartOperation(\r\n entries[0] as TOperationName,\r\n operationData\r\n ) as OperationEditor<this, T>;\r\n }\r\n\r\n throw new Error(`Operation class not found: ${operationClass.toString()}`);\r\n }\r\n\r\n /**\r\n *\r\n * Adds the operation data for a start operation specified by the given system name\r\n *\r\n * @param systemName\r\n * @param operationData\r\n * @param id\r\n * @returns\r\n */\r\n addStartOperation(\r\n systemName: TOperationName,\r\n operationData: TOperationData,\r\n id: string = uuidv4()\r\n ): OperationEditor<this, TOperation<TOperationData>> {\r\n if (!(operations as any)[systemName]) {\r\n throw Error(`Unknown operation: ${systemName}`);\r\n }\r\n\r\n const startOperations = this.actionConfig.startOperations\r\n ? this.actionConfig.startOperations.slice()\r\n : [];\r\n\r\n const newConfig = {\r\n id,\r\n systemName: systemName,\r\n operationData: operationData,\r\n } as IOperationConfiguration<TOperation<TOperationData>>;\r\n\r\n startOperations.push(newConfig);\r\n\r\n this.actionConfig = {\r\n ...this.actionConfig,\r\n startOperations,\r\n };\r\n\r\n return new OperationEditor<this, TOperation<TOperationData>>(\r\n newConfig,\r\n this\r\n );\r\n }\r\n\r\n /**\r\n *\r\n * Starts an editor for the start operation associated with the given id\r\n *\r\n * @param id\r\n * @returns\r\n */\r\n editStartOperation(id: string) {\r\n const {startOperations} = this.actionConfig;\r\n const operation = startOperations.find(o => o.id === id);\r\n\r\n if (isDefined(operation)) {\r\n return new OperationEditor<ActionEditor<T>, TOperation<TOperationData>>(\r\n operation,\r\n this\r\n );\r\n }\r\n\r\n throw new Error(`start operation not found for id ${id}`);\r\n }\r\n\r\n /**\r\n *\r\n * Removes the start operation associated with the given id\r\n *\r\n * @param id\r\n * @returns\r\n */\r\n removeStartOperation(id: string) {\r\n const startOperations = this.actionConfig.startOperations\r\n ? this.actionConfig.startOperations.slice()\r\n : [];\r\n const operation = startOperations.find(o => o.id === id);\r\n\r\n if (!operation) {\r\n throw new Error(`start operation not found for id ${id}`);\r\n }\r\n\r\n const idx = startOperations.indexOf(operation);\r\n\r\n if (idx > -1) {\r\n startOperations.splice(idx, 1);\r\n this.actionConfig = {\r\n ...this.actionConfig,\r\n startOperations,\r\n };\r\n }\r\n\r\n return this;\r\n }\r\n\r\n /**\r\n *\r\n * Moves the start operation associated with the given id in the given direction\r\n *\r\n * @param id\r\n * @param direction\r\n * @returns\r\n */\r\n moveStartOperation(id: string, direction: 'up' | 'down') {\r\n const startOperations = this.actionConfig.startOperations\r\n ? this.actionConfig.startOperations.slice()\r\n : [];\r\n const operation = startOperations.find(o => o.id === id);\r\n\r\n if (!operation) {\r\n throw new Error(`start operation not found for id ${id}`);\r\n }\r\n\r\n const idx = startOperations.indexOf(operation);\r\n\r\n if (idx > -1) {\r\n const newIdx = direction === 'up' ? idx + 1 : idx - 1;\r\n array_move(startOperations, idx, newIdx);\r\n this.actionConfig = {\r\n ...this.actionConfig,\r\n startOperations,\r\n };\r\n }\r\n\r\n return this;\r\n }\r\n\r\n /**\r\n *\r\n * Return the fluent scopt to the `ConfigurationFactory`\r\n *\r\n * @returns\r\n */\r\n next() {\r\n return this.configurationFactory;\r\n }\r\n}\r\n\r\n/**\r\n *\r\n * A factory that assists in editing an endable action\r\n *\r\n */\r\nexport class EndableActionEditor<\r\n T extends IEndableActionConfiguration = IEndableActionConfiguration,\r\n> extends ActionEditor<T> {\r\n /**\r\n *\r\n * Adds the operation data for a end operation specified by the given type\r\n *\r\n * @param operationClass\r\n * @param operationData\r\n * @returns\r\n */\r\n addEndOperationByType<\r\n T extends TOperationType,\r\n Dt extends Partial<ExtractOperationDataType<T>>,\r\n >(\r\n operationClass: T,\r\n operationData: Dt\r\n ): OperationEditor<this, TOperationType> {\r\n const entries = Object.entries(operations).find(\r\n ([, value]) => value === operationClass\r\n );\r\n\r\n if (entries) {\r\n return this.addEndOperation(entries[0] as TOperationName, operationData);\r\n }\r\n\r\n throw new Error(`Operation class not found: ${operationClass.toString()}`);\r\n }\r\n\r\n /**\r\n *\r\n * Adds the operation data for a start operation specified by the given system name\r\n *\r\n * @param systemName\r\n * @param operationData\r\n * @returns\r\n */\r\n addEndOperation<\r\n T extends TOperationName,\r\n O extends Partial<ExtractOperationDataType<GetOperationByName<T>>>,\r\n >(systemName: TOperationName, operationData: O) {\r\n // biome-ignore lint/performance/noDynamicNamespaceImportAccess: Dynamic operation lookup is intentional for configuration API\r\n if (!operations[systemName]) {\r\n throw Error(`Unknown operation: ${systemName}`);\r\n }\r\n\r\n const endOperations = this.actionConfig.endOperations\r\n ? this.actionConfig.endOperations.slice()\r\n : [];\r\n\r\n const newConfig = {\r\n id: uuidv4(),\r\n systemName: systemName,\r\n operationData: operationData,\r\n };\r\n\r\n endOperations.push(newConfig);\r\n\r\n this.actionConfig.endOperations = endOperations;\r\n\r\n // biome-ignore lint/performance/noDynamicNamespaceImportAccess: Dynamic operation lookup is intentional for configuration API\r\n const operationCsl = operations[systemName];\r\n return new OperationEditor<this, typeof operationCsl>(newConfig, this);\r\n }\r\n\r\n /**\r\n *\r\n * Starts an editor for the end operation associated with the given id\r\n *\r\n * @param id\r\n * @returns\r\n */\r\n editEndOperation(id: string) {\r\n const {endOperations} = this.actionConfig;\r\n const operationConfig = endOperations.find(o => o.id === id);\r\n\r\n if (isDefined(operationConfig)) {\r\n return new OperationEditor<this>(operationConfig, this);\r\n }\r\n\r\n throw new Error(`operation not found for id ${id}`);\r\n }\r\n\r\n /**\r\n *\r\n * Removes the end operation associated with the given id\r\n *\r\n * @param id\r\n * @returns\r\n */\r\n removeEndOperation(id: string) {\r\n const endOperations = this.actionConfig.endOperations\r\n ? this.actionConfig.endOperations.slice()\r\n : [];\r\n const operation = endOperations.find(o => o.id === id);\r\n\r\n if (!isDefined(operation)) {\r\n throw new Error(`operation not found for id ${id}`);\r\n }\r\n\r\n const idx = endOperations.indexOf(operation);\r\n\r\n if (idx > -1) {\r\n endOperations.splice(idx, 1);\r\n this.actionConfig = {\r\n ...this.actionConfig,\r\n endOperations,\r\n };\r\n }\r\n\r\n return this;\r\n }\r\n\r\n /**\r\n *\r\n * Moves the end operation associated with the given id in the specified direction\r\n *\r\n * @param id\r\n * @param direction\r\n * @returns\r\n */\r\n moveEndOperation(id: string, direction: 'up' | 'down') {\r\n const endOperations = this.actionConfig.endOperations\r\n ? this.actionConfig.endOperations.slice()\r\n : [];\r\n const operation = endOperations.find(o => o.id === id);\r\n\r\n if (!isDefined(operation)) {\r\n throw new Error(`operation not found for id ${id}`);\r\n }\r\n\r\n const idx = endOperations.indexOf(operation);\r\n\r\n if (idx > -1) {\r\n const newIdx = direction === 'up' ? idx + 1 : idx - 1;\r\n array_move(endOperations, idx, newIdx);\r\n this.actionConfig = {\r\n ...this.actionConfig,\r\n endOperations,\r\n };\r\n }\r\n return this;\r\n }\r\n}\r\n\r\n/**\r\n *\r\n * A factory that assists in editing a timeline action\r\n *\r\n */\r\nexport class TimelineActionEditor extends EndableActionEditor<ITimelineActionConfiguration> {\r\n /**\r\n *\r\n * Sets the duration specified by the given start and optional end positions\r\n *\r\n * @param start\r\n * @param end\r\n * @returns\r\n */\r\n setDuration(start: number, end?: number) {\r\n if (end !== undefined && start > end) {\r\n throw Error('start position cannot be higher than end position');\r\n }\r\n\r\n const duration: IDuration = {\r\n start,\r\n };\r\n\r\n if (end) {\r\n duration.end = end;\r\n }\r\n\r\n this.actionConfig = {\r\n ...this.actionConfig,\r\n duration,\r\n };\r\n return this;\r\n }\r\n}\r\n\r\n/**\r\n *\r\n * A factory that assists in editing an operation\r\n *\r\n */\r\nexport class OperationEditor<\r\n T extends ActionEditor,\r\n O extends TOperationType = TOperation<TOperationData>,\r\n> {\r\n constructor(\r\n private operationConfig: IOperationConfiguration<\r\n ExtractOperationDataType<O>\r\n >,\r\n private actionEditor: T\r\n ) {}\r\n\r\n /**\r\n *\r\n * Invokes the given callback with a copy of the internal state of the factory\r\n *\r\n * @param callBack\r\n * @returns\r\n */\r\n getConfiguration(\r\n callBack: (\r\n config: IOperationConfiguration<ExtractOperationDataType<O>>\r\n ) => IOperationConfiguration<ExtractOperationDataType<O>>\r\n ) {\r\n const copy = deepCopy(this.operationConfig);\r\n const newConfig = callBack.call(this, copy);\r\n\r\n if (newConfig) {\r\n this.operationConfig = newConfig;\r\n }\r\n\r\n return this;\r\n }\r\n\r\n /**\r\n *\r\n * Gets the system name\r\n *\r\n * @returns\r\n */\r\n getSystemName() {\r\n return this.operationConfig.systemName;\r\n }\r\n\r\n /**\r\n *\r\n * Sets the system name\r\n *\r\n * @param systemName\r\n * @returns\r\n */\r\n setSystemName(systemName: TOperationName) {\r\n // biome-ignore lint/performance/noDynamicNamespaceImportAccess: Dynamic operation lookup is intentional for configuration API\r\n if (!operations[systemName]) {\r\n throw Error(`Unknown operation: ${systemName}`);\r\n }\r\n\r\n this.operationConfig.systemName = systemName;\r\n this.actionEditor.updateConfiguration();\r\n return this;\r\n }\r\n\r\n /**\r\n *\r\n * Sets the operation data\r\n *\r\n * @param operationData\r\n * @returns\r\n */\r\n setOperationData(operationData: ExtractOperationDataType<O>) {\r\n this.operationConfig.operationData = operationData;\r\n this.actionEditor.updateConfiguration();\r\n return this;\r\n }\r\n\r\n /**\r\n *\r\n * Sets the value on the current `operationData` with the given key\r\n *\r\n * @param key\r\n * @param value\r\n * @returns\r\n */\r\n setOperationDataItem(\r\n key: keyof ExtractOperationDataType<O>,\r\n value: ExtractOperationDataType<O>[keyof ExtractOperationDataType<O>]\r\n ) {\r\n let {operationData} = this.operationConfig;\r\n if (!operationData) {\r\n operationData = {} as ExtractOperationDataType<O>;\r\n }\r\n operationData[key] = value;\r\n return this.setOperationData(operationData);\r\n }\r\n\r\n /**\r\n *\r\n * returns all of the defined property names on the current `operationData`\r\n *\r\n * @returns\r\n */\r\n getOperationDataKeys(): keyof ExtractOperationDataType<O> {\r\n const {operationData} = this.operationConfig;\r\n return (operationData\r\n ? Object.keys(operationData)\r\n : []) as unknown as keyof ExtractOperationDataType<O>;\r\n }\r\n\r\n /**\r\n *\r\n * Gets the value of the given key on the current `operationData`\r\n *\r\n * @param key\r\n * @returns\r\n */\r\n getOperationDataValue(key: keyof ExtractOperationDataType<O>) {\r\n const {operationData} = this.operationConfig;\r\n return operationData?.[key];\r\n }\r\n\r\n /**\r\n *\r\n * Returns the fluent scope back to the action editor\r\n *\r\n * @returns\r\n */\r\n next() {\r\n return this.actionEditor;\r\n }\r\n}\r\n","/**\r\n *\r\n * Merges the properties of the target object into the source object, only the properties that do not exist yet on the source.\r\n *\r\n * This function is pure, so it returns a new instance that reflects the merging of the two objects.\r\n *\r\n * The merge is shallow.\r\n *\r\n * @param target\r\n * @param source\r\n * @returns\r\n */\r\nexport const mergeIfMissing = <\r\n Src extends Record<PropertyKey, any>,\r\n Trg extends Partial<Src> & Record<PropertyKey, any>,\r\n>(\r\n target: Src,\r\n source: Trg\r\n): Src & Trg =>\r\n Object.entries(source).reduce(\r\n (acc, [key, value]) => (key in acc ? acc : {...acc, [key]: value}),\r\n target\r\n );\r\n","import type {ILanguageLabel, TLanguageCode} from '../../types.ts';\r\nimport type {ConfigurationFactory} from './configuration-factory.ts';\r\n\r\n/**\r\n * Factory that assists with editing a label\r\n */\r\nexport class LabelEditor {\r\n constructor(\r\n private configurationFactory: ConfigurationFactory,\r\n private languageLabel: ILanguageLabel\r\n ) {}\r\n\r\n private _internalGetLabel(languageCode: string) {\r\n return this.languageLabel.labels.find(x => x.languageCode === languageCode);\r\n }\r\n\r\n /**\r\n *\r\n * Set the translation associated with the given language code\r\n *\r\n * @param languageCode\r\n * @param translation\r\n * @returns\r\n */\r\n setLabel(languageCode: TLanguageCode, translation: string) {\r\n const label = this._internalGetLabel(languageCode);\r\n if (label) {\r\n label.label === translation;\r\n } else {\r\n throw new Error(`No label found for language code '${languageCode}'`);\r\n }\r\n return this;\r\n }\r\n\r\n /**\r\n *\r\n * Remove all of the translations for the given language code\r\n *\r\n * @param languageCode\r\n * @returns\r\n */\r\n removeLabel(languageCode: TLanguageCode) {\r\n const idx = this.languageLabel.labels.findIndex(\r\n x => x.languageCode === languageCode\r\n );\r\n if (idx > -1) {\r\n this.languageLabel.labels.splice(idx, 1);\r\n } else {\r\n throw new Error(`No label found for language code '${languageCode}'`);\r\n }\r\n return this;\r\n }\r\n\r\n /**\r\n *\r\n * Returns the fluent scope back to the `ConfigurationFactory`\r\n *\r\n * @returns\r\n */\r\n end() {\r\n return this.configurationFactory;\r\n }\r\n}\r\n","// https://gist.github.com/jakearchibald/cb03f15670817001b1157e62a076fe95\r\nexport function animationInterval(\r\n ms: number,\r\n signal: AbortSignal,\r\n callback: (time: number) => void\r\n) {\r\n // Prefer currentTime, as it'll better sync animations queued in the\r\n // same frame, but if it isn't supported, performance.now() is fine.\r\n const currentTime = document?.timeline?.currentTime;\r\n const start = currentTime ? Number(currentTime) : performance.now();\r\n\r\n const frame = (time: number) => {\r\n if (signal.aborted) return;\r\n callback(time);\r\n scheduleFrame(time);\r\n };\r\n\r\n const {round} = Math;\r\n const scheduleFrame = (time: number) => {\r\n const elapsed = time - start;\r\n const roundedElapsed = round(elapsed / ms) * ms;\r\n const targetNext = start + roundedElapsed + ms;\r\n const delay = targetNext - performance.now();\r\n setTimeout(() => requestAnimationFrame(frame), delay);\r\n };\r\n\r\n scheduleFrame(start);\r\n}\r\n","import $ from 'jquery';\r\nimport type {\r\n IResolvedEngineConfiguration,\r\n IResolvedTimelineConfiguration,\r\n} from '../configuration/types.ts';\r\nimport {animationInterval} from '../util/animation-interval.ts';\r\nimport type {ITimelineProvider, TPlayState} from './types.ts';\r\n\r\ntype TUpdateMethod = (now: number) => void;\r\n\r\nexport class RequestAnimationFrameTimelineProvider\r\n implements ITimelineProvider\r\n{\r\n private _currentPosition: number = 0;\r\n private _updateBound: TUpdateMethod = this._update.bind(this);\r\n private _firstFramePending = true;\r\n private _currentPlaylistItem: IResolvedTimelineConfiguration;\r\n private _tickInterval = 1000;\r\n private _playlist: IResolvedTimelineConfiguration[];\r\n private _containerElement: JQuery<HTMLElement> | undefined;\r\n private _abortController: AbortController | undefined;\r\n private _onTime: ((position: number) => void) | undefined;\r\n private _onComplete: (() => void) | undefined;\r\n private _onRestart: (() => void) | undefined;\r\n private _onFirstFrame: (() => void) | undefined;\r\n loop: boolean = false;\r\n\r\n private _playState: TPlayState = 'stopped';\r\n public get playState(): TPlayState {\r\n return this._playState;\r\n }\r\n\r\n constructor(config: IResolvedEngineConfiguration) {\r\n this._playlist = this._extractPlaylist(config);\r\n this._currentPlaylistItem = this._playlist[0];\r\n }\r\n\r\n private _extractPlaylist(\r\n configuration: IResolvedEngineConfiguration\r\n ): IResolvedTimelineConfiguration[] {\r\n const playlist = configuration.timelines.filter(\r\n timeline => timeline.type === 'animation'\r\n );\r\n return playlist;\r\n }\r\n\r\n onTime(callback: (position: number) => void) {\r\n this._onTime = callback;\r\n }\r\n\r\n onComplete(callback: () => void) {\r\n this._onComplete = callback;\r\n }\r\n\r\n onRestart(callback: () => void) {\r\n this._onRestart = callback;\r\n }\r\n\r\n onFirstFrame(callback: () => void) {\r\n this._onFirstFrame = callback;\r\n }\r\n\r\n playlistItem(uri: string): void {\r\n if (uri === null || !uri.length || this._playlist.length === 0) {\r\n return;\r\n }\r\n\r\n const item = this._playlist.find(item => {\r\n return item.uri === uri;\r\n });\r\n\r\n if (!item) {\r\n throw new Error(`Unknown playlist uri: ${uri}`);\r\n }\r\n\r\n this._currentPlaylistItem = item;\r\n }\r\n\r\n private _update(_now: number): void {\r\n if (this.playState !== 'running') {\r\n return;\r\n }\r\n\r\n this._currentPosition++;\r\n\r\n if (this._currentPosition > this._currentPlaylistItem.duration) {\r\n if (this.loop) {\r\n this._resetToStartPosition();\r\n this._onRestart?.();\r\n this._callbackPosition();\r\n } else {\r\n this.stop();\r\n this._onComplete?.();\r\n return;\r\n }\r\n }\r\n\r\n this._callbackPosition();\r\n }\r\n\r\n private _callbackPosition() {\r\n this._onTime?.(this._currentPosition);\r\n }\r\n\r\n start() {\r\n if (this.playState === 'running') {\r\n if (this._currentPosition === 0) {\r\n this._callbackPosition();\r\n }\r\n return;\r\n }\r\n\r\n this._playState = 'running';\r\n this._abortController?.abort();\r\n this._abortController = new AbortController();\r\n\r\n if (this._firstFramePending) {\r\n this._firstFramePending = false;\r\n this._onFirstFrame?.();\r\n }\r\n if (this._currentPosition === 0) {\r\n this._callbackPosition();\r\n }\r\n\r\n animationInterval(\r\n this._tickInterval,\r\n this._abortController.signal,\r\n this._updateBound\r\n );\r\n }\r\n\r\n private _resetToStartPosition() {\r\n this._currentPosition = 0;\r\n }\r\n\r\n getContainer() {\r\n return this._containerElement;\r\n }\r\n\r\n private _stopAnimationInterval(resetPosition: boolean = true) {\r\n this._abortController?.abort();\r\n this._abortController = undefined;\r\n\r\n if (resetPosition) {\r\n this._resetToStartPosition();\r\n }\r\n }\r\n\r\n init(): Promise<void> {\r\n this._currentPlaylistItem = this._playlist[0];\r\n this._containerElement = $(this._currentPlaylistItem.selector);\r\n\r\n if (!this._containerElement.length) {\r\n throw new Error(\r\n `timeline selector '${this._currentPlaylistItem.selector}' not found`\r\n );\r\n }\r\n\r\n return Promise.resolve();\r\n }\r\n\r\n destroy() {\r\n this.stop();\r\n this._containerElement = undefined;\r\n }\r\n\r\n stop() {\r\n this._stopAnimationInterval();\r\n this._playState = 'stopped';\r\n }\r\n\r\n pause() {\r\n this._stopAnimationInterval(false);\r\n this._playState = 'stopped';\r\n }\r\n\r\n seek(position: number) {\r\n if (position < 0 || position > this._currentPlaylistItem.duration) {\r\n return Promise.resolve(this._currentPosition);\r\n }\r\n this._currentPosition = position;\r\n return Promise.resolve(position);\r\n }\r\n\r\n getPosition() {\r\n return this._currentPosition;\r\n }\r\n\r\n getDuration() {\r\n return this._currentPlaylistItem.duration;\r\n }\r\n}\r\n","import $ from 'jquery';\r\nimport {v4 as uuidv4} from 'uuid';\r\nimport vjs from 'video.js';\r\nimport type {IResolvedEngineConfiguration} from '../configuration/types.ts';\r\nimport type {ITimelineProvider, TPlayState} from './types.ts';\r\n\r\nconst videojs = vjs.default ?? vjs;\r\n\r\nexport class VideoJsTimelineProvider implements ITimelineProvider {\r\n private _videoElementId: string = uuidv4();\r\n private _eventHandlers: (() => void)[] = [];\r\n\r\n private _playState: TPlayState = 'stopped';\r\n public get playState(): TPlayState {\r\n return this._playState;\r\n }\r\n loop = false;\r\n private _urls: string[] = [];\r\n private _onTime: ((position: number) => void) | undefined;\r\n private _onComplete: (() => void) | undefined;\r\n private _onRestart: (() => void) | undefined;\r\n private _onFirstFrame: (() => void) | undefined;\r\n private _player: any | undefined;\r\n\r\n constructor(private config: IResolvedEngineConfiguration) {}\r\n\r\n init(): Promise<void> {\r\n videojs.log.level('all');\r\n\r\n const selector =\r\n this.config.timelineProviderSettings.mediaplayer?.selector ?? '';\r\n this._urls = this._extractUrls(this.config);\r\n this._addVideoElements(selector, this._urls);\r\n\r\n const self = this;\r\n\r\n const promise = new Promise<void>(resolve => {\r\n setTimeout(() => {\r\n this._player = videojs(\r\n this._videoElementId,\r\n {\r\n controls: false,\r\n controlBar: false,\r\n liveui: false,\r\n autoplay: false,\r\n preload: 'auto',\r\n loop: this.loop,\r\n src: this._urls[0],\r\n },\r\n function onPlayerReady(this: any) {\r\n this.one('firstplay', () => self._onFirstFrame?.());\r\n this.one('canplay', () => resolve());\r\n self._addPlayerListener(\r\n this,\r\n 'ended',\r\n self._handleEnded.bind(self)\r\n );\r\n self._addPlayerListener(\r\n this,\r\n 'timeupdate',\r\n self._handleTimeUpdate.bind(self)\r\n );\r\n this.load();\r\n }\r\n ); //as PlayerReadyCallback\r\n }, 0);\r\n });\r\n\r\n return promise;\r\n }\r\n\r\n private _addPlayerListener(\r\n instance: any,\r\n type: string,\r\n eventHandler: (...args: any[]) => void\r\n ) {\r\n instance.on(type, eventHandler);\r\n this._eventHandlers.push(() => instance.off(type, eventHandler));\r\n }\r\n\r\n private _handleEnded() {\r\n if (!this._player?.loop) {\r\n this._onComplete?.();\r\n } else {\r\n this._onRestart?.();\r\n }\r\n }\r\n\r\n private _handleTimeUpdate() {\r\n if (this._player) {\r\n const time = this._player.currentTime();\r\n if (time !== undefined) {\r\n this._onTime?.(time);\r\n }\r\n }\r\n }\r\n\r\n start(): void {\r\n this._player?.play();\r\n }\r\n\r\n stop(): void {\r\n this._player?.pause();\r\n this._player?.currentTime(0);\r\n }\r\n\r\n pause(): void {\r\n this._player?.pause();\r\n }\r\n\r\n seek(position: number): Promise<number> {\r\n return new Promise<number>(resolve => {\r\n (this._player as any).one('seeked', () => {\r\n resolve(this._player?.currentTime() ?? 0);\r\n });\r\n this._player?.currentTime(position);\r\n });\r\n }\r\n\r\n playlistItem(uri: string): void {\r\n if (this._urls.includes(uri)) {\r\n this._player?.selectSource([uri]);\r\n }\r\n }\r\n\r\n getPosition(): number {\r\n return this._player?.currentTime() ?? 0;\r\n }\r\n\r\n getDuration(): number {\r\n return this._player?.duration() ?? 0;\r\n }\r\n\r\n getContainer(): JQuery<HTMLElement> | undefined {\r\n const selector =\r\n this.config.timelineProviderSettings.mediaplayer?.selector ?? '';\r\n return $(selector);\r\n }\r\n\r\n destroy(): void {\r\n this._eventHandlers.forEach(remover => remover());\r\n this._eventHandlers.length = 0;\r\n }\r\n\r\n onTime(callback: (position: number) => void): void {\r\n this._onTime = callback;\r\n }\r\n\r\n onComplete(callback: () => void): void {\r\n this._onComplete = callback;\r\n }\r\n\r\n onRestart(callback: () => void): void {\r\n this._onRestart = callback;\r\n }\r\n\r\n onFirstFrame(callback: () => void): void {\r\n this._onFirstFrame = callback;\r\n }\r\n\r\n private _extractUrls(configuration: IResolvedEngineConfiguration) {\r\n const urls = configuration.timelines\r\n .filter(timeline => timeline.type === 'mediaplayer')\r\n .map(timeline => timeline.uri);\r\n return urls;\r\n }\r\n\r\n private _addVideoElements(selector: string, urls: string[]) {\r\n const videoElm = [`<video id=${this._videoElementId}>`];\r\n urls.forEach(url => {\r\n videoElm.push(\r\n `<source src='${url}' type='${this._extractFileType(url)}'/>`\r\n );\r\n });\r\n videoElm.push('</video>');\r\n $(selector).append(videoElm.join(''));\r\n }\r\n\r\n _extractFileType(url: string) {\r\n const lastIdx = url.lastIndexOf('.');\r\n return `video/${url.substring(lastIdx + 1)}`;\r\n }\r\n}\r\n","// export { MediaElementTimelineProvider } from './media-element-timeline-provider';\r\nexport {RequestAnimationFrameTimelineProvider} from './request-animation-frame-timeline-provider.ts';\r\nexport {VideoJsTimelineProvider} from './video-js-timeline-provider.ts';\r\n","import {v4 as uuidv4} from 'uuid';\r\nimport * as timelineProviders from '../../timelineproviders/index.ts';\r\nimport type {TimelineTypes} from '../../types.ts';\r\nimport type {\r\n ITimelineProviderSettings,\r\n TTimelineProviderSettings,\r\n} from '../types.ts';\r\nimport type {ConfigurationFactory} from './configuration-factory.ts';\r\n\r\nexport class TimelineProvidersSettingsEditor {\r\n constructor(\r\n private providersSettings: TTimelineProviderSettings,\r\n private configurationFactory: ConfigurationFactory\r\n ) {}\r\n\r\n addProvider(timelineType: TimelineTypes) {\r\n if (this.providersSettings[timelineType]) {\r\n throw new Error(\r\n `Settings for a '${timelineType}' provider already exist`\r\n );\r\n }\r\n const settings: ITimelineProviderSettings = {\r\n id: uuidv4(),\r\n poster: undefined,\r\n selector: undefined,\r\n systemName: '',\r\n vendor: '',\r\n };\r\n this.providersSettings[timelineType] = settings;\r\n return new TimelineProviderSettingsEditor(\r\n settings,\r\n this,\r\n this.configurationFactory\r\n );\r\n }\r\n\r\n editProvider(timelineType: TimelineTypes) {\r\n if (!this.providersSettings[timelineType]) {\r\n throw new Error(`No settings for a '${timelineType}' provider exist yet`);\r\n }\r\n\r\n return new TimelineProviderSettingsEditor(\r\n this.providersSettings[timelineType] as ITimelineProviderSettings,\r\n this,\r\n this.configurationFactory\r\n );\r\n }\r\n\r\n next() {\r\n return this.configurationFactory;\r\n }\r\n}\r\n\r\nexport class TimelineProviderSettingsEditor {\r\n constructor(\r\n private providerSettings: ITimelineProviderSettings,\r\n private providersSettingsEditor: TimelineProvidersSettingsEditor,\r\n private configurationFactory: ConfigurationFactory\r\n ) {}\r\n\r\n setVendor(vendor: string) {\r\n this.providerSettings.vendor = vendor;\r\n return this;\r\n }\r\n\r\n setSelector(selector: string) {\r\n this.providerSettings.selector = selector;\r\n return this;\r\n }\r\n\r\n setSystemName(systemName: string) {\r\n if (!(timelineProviders as any)[systemName]) {\r\n throw new Error(`Unknown timeline provider system name: ${systemName}`);\r\n }\r\n this.providerSettings.systemName = systemName;\r\n return this;\r\n }\r\n\r\n next() {\r\n return this.providersSettingsEditor;\r\n }\r\n\r\n end() {\r\n return this.configurationFactory;\r\n }\r\n}\r\n","import {v4 as uuidv4} from 'uuid';\r\nimport {deepCopy} from '../../operation/helper/deep-copy.ts';\r\nimport type {\r\n ILabel,\r\n ILanguageLabel,\r\n KeysOfType,\r\n TimelineTypes,\r\n TLanguageCode,\r\n} from '../../types.ts';\r\nimport {mergeIfMissing} from '../../util/merge-if-missing.ts';\r\nimport type {\r\n IActionConfiguration,\r\n IEngineConfiguration,\r\n ITimelineActionConfiguration,\r\n ITimelineConfiguration,\r\n} from '../types.ts';\r\nimport {ActionCreatorFactory} from './action-creator-factory.ts';\r\nimport {\r\n ActionEditor,\r\n EndableActionEditor,\r\n TimelineActionEditor,\r\n} from './action-editor.ts';\r\nimport {LabelEditor} from './label-editor.ts';\r\nimport {TimelineProvidersSettingsEditor} from './timeline-provider-settings-editor.ts';\r\n\r\n/** */\r\nexport type TEngineConfigurationLists = KeysOfType<IEngineConfiguration, any[]>;\r\n\r\ntype ConfigurationFactoryExtension<NewFactory extends ConfigurationFactory> = (\r\n this: NewFactory,\r\n ...rest: any[]\r\n) => void;\r\n\r\n/**\r\n * This class offers a fluent, extensible and strongly typed DSL for creating Eligius configurations.\r\n *\r\n * @example Building a configuration using the factory\r\n * To initialize a basic configuration to start off of:\r\n * ```ts\r\n * const factory = new ConfigurationFactory()\r\n * .init(\"en-US\") // Define the default language\r\n * .addLanguage(\"en-US\", \"English\") // Add English as a supported language\r\n * .addLanguage(\"nl-NL\", \"Nederlands\") // Add Dutch as a supported language\r\n * .setLayoutTemplate(\"<div class=\\\"main.container\\\"></div>\") // Add the main container for the presentation\r\n * .setContainerSelector(\"#ct-container\") // Selector for the element in the body that will contain the presentation\r\n * .addTimeline( // Add a first timeline\r\n * 'timeline-1', // Give it a name\r\n * \"animation\", // This is RAF based timeline\r\n * 200, // The duration of the timeline in seconds\r\n * false, // The presentation does NOT play in a loop\r\n * \".timeline-container\" // The element within the main layout (defined by the layoutTemplate) in which the timeline will be rendered\r\n * )\r\n * .editTimelineProviderSettings() // Add a timeline provider\r\n * .addProvider(\"animation\") // One that provides timelines for type 'animation'\r\n * .setSystemName(\"RequestAnimationFrameTimelineProvider\") // The system name of the provider\r\n * .setVendor(\"eligius\") // Eligius is the vendor in this case\r\n * .end(); // This finally returns the ConfigurationFactory instance\r\n * ```\r\n *\r\n * Then to add an init action:\r\n * ```ts\r\n * factory\r\n * .createInitAction(\"GetUserName\")\r\n * .addStartOperationByType(getQueryParams, {\r\n * defaultValues: { username: \"guest\" },\r\n * })\r\n * .addStartOperationByType(setGlobalData, { properties: [\"queryParams\"] });\r\n * ```\r\n *\r\n * After that, add a timeline action:\r\n * ```ts\r\n * factory.createTimelineAction(\"timeline-1\", \"AddIntroContainer\")\r\n * .addDuration(0, 10)\r\n * .addStartOperationByType(selectElement, { selector: \".timeline-container\" })\r\n * .addStartOperationByType(setElementContent, {\r\n * template: '<div class=\"intro-text\"></div>',\r\n * })\r\n * .addEndOperationByType(selectElement, { selector: \".intro-text\" })\r\n * .addEndOperationByType(removeElement, {});\r\n * ```\r\n *\r\n * It also possible to extend the factory with specialized creation methods for the particular\r\n * configuration you are building:\r\n * ```ts\r\n * function addImage(this: ConfigurationFactory, actionName: string, imageSrc: string, imageId: string) {\r\n * this.createInitAction(actionName)\r\n * .addStartOperationByType(selectElement, { selector: \".timeline-container\" })\r\n * .addStartOperationByType(createElement, { element: 'img', attributes: {src: imageSrc, imageId} })\r\n * .addStartOperationByType(setElementContent, { insertionType: \"append\" })\r\n * .addEndOperationByType(selectElement, { selector: `#${imageId}` })\r\n * .addEndOperationByType(removeElement, {});\r\n * }\r\n *\r\n * const customFactory = ConfigurationFactory.extend(factory, \"addImage\", addImage);\r\n *\r\n * customFactory.addImage(\"MyImageActionName\", \"my-image.png\", \"my-image-id\");\r\n * ```\r\n *\r\n * Finally, retrieve the configuration and save it:\r\n * ```ts\r\n * import fs from \"node:fs\";\r\n *\r\n * const configuration = customFactory.getConfiguration();\r\n *\r\n * fs.writeFileSync(\"/my/path/configuration.json\", JSON.stringify(configuration), {encoding:'utf-8'})\r\n * ```\r\n *\r\n * The `ConfigurationFactory` can also be used to edit an existing configuration. In this case, simply\r\n * pass the JSON configuration to the `ConfigurationFactory`'s constructor:\r\n * ```ts\r\n * import myConfiguration from './my-configuration.json';\r\n *\r\n * const factory = new ConfigurationFactory(myConfiguration);\r\n *\r\n * factory.editInitAction(\"existingActionName\")\r\n * .removeEndOperation(\"475fd0ab-5755-4e60-8f7c-e1988a109678\");\r\n * ```\r\n */\r\nexport class ConfigurationFactory {\r\n actionCreatorFactory: ActionCreatorFactory;\r\n\r\n /**\r\n * Constructs a new `ConfigurationFactory`\r\n * @param config an optional existing configuration that will be used as a starting point\r\n */\r\n constructor(public configuration: IEngineConfiguration = {} as any) {\r\n this.actionCreatorFactory = new ActionCreatorFactory(this);\r\n }\r\n\r\n /**\r\n * Add specialized method to a factory\r\n *\r\n * @param factory\r\n * @param extensionMethodName\r\n * @param extensionMethod\r\n * @returns\r\n */\r\n static extend<\r\n T extends ConfigurationFactory,\r\n K extends PropertyKey,\r\n C extends (this: T & {[P in K]: C}, ...args: any[]) => any,\r\n >(factory: T, extensionMethodName: K, extensionMethod: C): T & {[P in K]: C} {\r\n return Object.defineProperty<T & {[P in K]: C}>(\r\n factory as any,\r\n extensionMethodName,\r\n {\r\n value: function (this: T & {[P in K]: C}, ...args: Parameters<C>) {\r\n return extensionMethod.apply(this, args);\r\n },\r\n writable: true,\r\n configurable: true,\r\n }\r\n );\r\n }\r\n\r\n /**\r\n * Add specialized methods to a factory\r\n *\r\n * @param factory\r\n * @param extensions\r\n * @returns\r\n */\r\n static extendMultiple<\r\n T extends ConfigurationFactory,\r\n C extends ConfigurationFactoryExtension<T>,\r\n D extends {[name: string]: C},\r\n >(factory: T, extensions: D) {\r\n return Object.entries(extensions).reduce<T & typeof extensions>(\r\n (acc, [name, method]) =>\r\n ConfigurationFactory.extend(acc, name, method) as T & typeof extensions,\r\n factory as T & typeof extensions\r\n );\r\n }\r\n\r\n /**\r\n * Initialize the configuration with a minimal shape.\r\n *\r\n * It assigns an ID, sets the engine to `EligiusEngine`, default the containerSelector `[data-ct-container=true]`\r\n * and initializes all of the list properties with empty arrays.\r\n * @param defaultLanguage\r\n * @returns\r\n */\r\n init(defaultLanguage: TLanguageCode) {\r\n const newConfiguration: IEngineConfiguration = {\r\n id: uuidv4(),\r\n engine: {\r\n systemName: 'EligiusEngine',\r\n },\r\n containerSelector: '[data-ct-container=true]',\r\n cssFiles: [],\r\n timelineProviderSettings: {},\r\n language: defaultLanguage,\r\n availableLanguages: [],\r\n layoutTemplate: '',\r\n initActions: [],\r\n actions: [],\r\n timelines: [],\r\n labels: [],\r\n };\r\n\r\n this.configuration = mergeIfMissing(this.configuration, newConfiguration);\r\n\r\n return this;\r\n }\r\n\r\n /**\r\n * Assigns the engine system name\r\n * @param systemName\r\n * @returns\r\n */\r\n setEngine(systemName: string) {\r\n this.configuration.engine.systemName = systemName;\r\n return this;\r\n }\r\n\r\n /**\r\n * Assigns a string representation of the HTML layout template for the engine.\r\n *\r\n * @param layoutTemplate\r\n * @returns\r\n */\r\n setLayoutTemplate(layoutTemplate: string) {\r\n this.configuration.layoutTemplate = layoutTemplate;\r\n return this;\r\n }\r\n\r\n /**\r\n *\r\n * Assigns the default language\r\n *\r\n * @param defaultLanguage\r\n * @returns\r\n */\r\n setDefaultLanguage(defaultLanguage: TLanguageCode) {\r\n this.configuration.language = defaultLanguage;\r\n return this;\r\n }\r\n\r\n /**\r\n *\r\n * Assign the css selector that specifies the DOM location where the engine renders its output\r\n *\r\n * @param selector\r\n * @returns\r\n */\r\n setContainerSelector(selector: string) {\r\n this.configuration.containerSelector = selector;\r\n return this;\r\n }\r\n\r\n /**\r\n *\r\n * Starts an editing process for the timeline provider settings.\r\n *\r\n * @returns\r\n */\r\n editTimelineProviderSettings() {\r\n return new TimelineProvidersSettingsEditor(\r\n this.configuration.timelineProviderSettings || {},\r\n this\r\n );\r\n }\r\n\r\n /**\r\n *\r\n * Return a copy of the current state of the configuration\r\n *\r\n * @param callBack the callback receives the configuration as well and can return a mutated version wich will be assigned to the factory's internal state\r\n * @returns\r\n */\r\n getConfiguration(\r\n callBack?: (copy: IEngineConfiguration) => IEngineConfiguration\r\n ) {\r\n const copy = deepCopy<IEngineConfiguration>(this.configuration);\r\n if (callBack) {\r\n const newConfig = callBack.call(this, copy);\r\n this.configuration = deepCopy<IEngineConfiguration>(newConfig);\r\n }\r\n return copy;\r\n }\r\n\r\n /**\r\n *\r\n * Adds a language to the `availableLanguages` list.\r\n * The label represents the name of the language.\r\n *\r\n * An error is thrown if a language with the given language code already exists\r\n *\r\n * @example\r\n * factory.addLanguage('en-GB', 'English');\r\n *\r\n * @param languageCode The given alnguage code\r\n * @param languageLabel The human readable name of the language\r\n * @returns\r\n */\r\n addLanguage(languageCode: TLanguageCode, languageLabel: string) {\r\n const languages = this._initializeCollection(\r\n this.configuration,\r\n 'availableLanguages'\r\n );\r\n const existing = languages.find(lang => lang.languageCode === languageCode);\r\n\r\n if (existing) {\r\n throw new Error(`Language code '${languageCode}' already exists`);\r\n }\r\n\r\n languages.push({\r\n id: uuidv4(),\r\n languageCode: languageCode,\r\n label: languageLabel,\r\n });\r\n return this;\r\n }\r\n\r\n private _internalAddAction(\r\n collectionName: TEngineConfigurationLists,\r\n action: IActionConfiguration\r\n ) {\r\n const actions = this._initializeCollection(\r\n this.configuration,\r\n collectionName\r\n );\r\n actions?.push(action as any);\r\n }\r\n\r\n private _initializeCollection<T, K extends keyof T>(\r\n parent: T,\r\n name: K\r\n ): T[K] {\r\n if (!parent[name]) {\r\n (parent[name] as any) = [];\r\n }\r\n return parent[name] as T[K];\r\n }\r\n\r\n /**\r\n *\r\n * Adds the specified action to the `actions` list.\r\n *\r\n * @param action\r\n */\r\n addAction(action: IActionConfiguration) {\r\n this._internalAddAction('actions', action);\r\n }\r\n\r\n /**\r\n *\r\n * Adds the specified action to the `initActions` list\r\n *\r\n * @param action\r\n */\r\n addInitAction(action: IActionConfiguration) {\r\n this._internalAddAction('initActions', action);\r\n }\r\n\r\n /**\r\n *\r\n * Adds the specified action to the `eventActions` list\r\n *\r\n * @param action\r\n */\r\n addEventAction(action: IActionConfiguration) {\r\n this._internalAddAction('eventActions', action);\r\n }\r\n\r\n /**\r\n *\r\n * Adds the given actions to `timelineActions` list that is associated with the specified uri\r\n *\r\n * @param uri\r\n * @param action\r\n */\r\n addTimelineAction(uri: string, action: ITimelineActionConfiguration) {\r\n const timeline = this.getTimeline(uri);\r\n if (timeline) {\r\n const timelineActions = this._initializeCollection(\r\n timeline,\r\n 'timelineActions'\r\n );\r\n timelineActions.push(action);\r\n } else {\r\n throw Error(`No timeline found for uri '${uri}'`);\r\n }\r\n }\r\n\r\n /**\r\n *\r\n * Starts the creation of a new action with the specified name that gets added to the `actions` list\r\n *\r\n * @param name\r\n * @returns\r\n */\r\n createAction(name: string) {\r\n return this.actionCreatorFactory.createAction(name);\r\n }\r\n\r\n /**\r\n *\r\n * Starts the creation of a new action with the specified name that gets added to the `initActions` list\r\n *\r\n * @param name\r\n * @returns\r\n */\r\n createInitAction(name: string) {\r\n return this.actionCreatorFactory.createInitAction(name);\r\n }\r\n\r\n /**\r\n *\r\n * Starts the creation of a new action with the specified name that gets added to the `eventActions` list\r\n *\r\n * @param name\r\n * @returns\r\n */\r\n createEventAction(name: string) {\r\n return this.actionCreatorFactory.createEventAction(name);\r\n }\r\n\r\n /**\r\n *\r\n * Starts the creation of a new action with the specified name that gets added to the `timelineActions` list that is associated with the specified uri\r\n *\r\n * @param uri\r\n * @param name\r\n * @returns\r\n */\r\n createTimelineAction(uri: string, name: string) {\r\n return this.actionCreatorFactory.createTimelineAction(uri, name);\r\n }\r\n\r\n /**\r\n * Add a timeline with the given data\r\n *\r\n * @param uri identifier for the timeline\r\n * @param type animation or mediaplayer\r\n * @param duration the duration of the timeline in seconds\r\n * @param isLooped True if the timeline should automatically restart at the end\r\n * @param selector css selector for the container where the timeline will be rendered\r\n * @returns\r\n */\r\n addTimeline(\r\n uri: string,\r\n type: TimelineTypes,\r\n duration: number,\r\n isLooped: boolean,\r\n selector: string\r\n ) {\r\n const timelines = this._initializeCollection(\r\n this.configuration,\r\n 'timelines'\r\n );\r\n const timeline = this.getTimeline(uri);\r\n if (timeline) {\r\n throw Error(`timeline for uri ${uri} already exists`);\r\n }\r\n const timelineConfig: ITimelineConfiguration = {\r\n id: uuidv4(),\r\n type: type,\r\n uri: uri,\r\n duration: duration,\r\n loop: isLooped,\r\n selector: selector,\r\n timelineActions: [],\r\n };\r\n timelines.push(timelineConfig);\r\n return this;\r\n }\r\n\r\n /**\r\n *\r\n * Gets the timeline associated with the specified uri\r\n *\r\n * @param uri\r\n * @returns\r\n */\r\n getTimeline(uri: string) {\r\n return this.configuration.timelines.find(t => t.uri === uri);\r\n }\r\n\r\n /**\r\n *\r\n * Removes the timeline associated with the specified uri\r\n *\r\n * @param uri\r\n * @returns\r\n */\r\n removeTimeline(uri: string) {\r\n const timelineConfig = this.getTimeline(uri);\r\n if (timelineConfig) {\r\n const idx = this.configuration.timelines.indexOf(timelineConfig);\r\n if (idx > -1) {\r\n this.configuration.timelines.splice(idx, 1);\r\n }\r\n }\r\n return this;\r\n }\r\n\r\n private _initializeLabel(id: string, labels: ILanguageLabel[]) {\r\n let label = labels.find(l => l.id === id);\r\n if (!label) {\r\n labels.push({\r\n id: id,\r\n labels: [],\r\n });\r\n label = labels[labels.length - 1];\r\n }\r\n return label;\r\n }\r\n\r\n private _getLabelTranslation(\r\n labelTranslations: ILabel[],\r\n languageCode: TLanguageCode\r\n ) {\r\n let translation = labelTranslations.find(\r\n l => l.languageCode === languageCode\r\n );\r\n if (!translation) {\r\n translation = {\r\n id: uuidv4(),\r\n languageCode: languageCode,\r\n label: '',\r\n };\r\n labelTranslations.push(translation);\r\n }\r\n return translation;\r\n }\r\n\r\n /**\r\n *\r\n * Starts an editor for the label that is associated with the specified id\r\n *\r\n * @param id\r\n * @returns\r\n */\r\n editLabel(id: string) {\r\n const label = this.configuration.labels?.find(x => x.id === id);\r\n if (label) {\r\n return new LabelEditor(this, label);\r\n } else {\r\n throw new Error(`Language label with id '${id}' not found`);\r\n }\r\n }\r\n\r\n /**\r\n *\r\n * Adds a label translation with the specified data\r\n *\r\n * @param id The id for the label\r\n * @param languageCode The language code associated with the label\r\n * @param translation The label text in the language specified by the language code\r\n * @returns\r\n */\r\n addLabel(id: string, languageCode: TLanguageCode, translation: string) {\r\n const labels = this._initializeCollection(this.configuration, 'labels');\r\n const labelConfig = this._initializeLabel(id, labels);\r\n const labelTranslation = this._getLabelTranslation(\r\n labelConfig.labels,\r\n languageCode\r\n );\r\n labelTranslation.label = translation;\r\n return this;\r\n }\r\n\r\n /**\r\n *\r\n * Adds multiple translations with the specified data\r\n *\r\n * @param id The id for the label\r\n * @param translations A record that holds language code to translations lookups\r\n * @returns\r\n */\r\n addLabels(id: string, translations: Record<TLanguageCode, string>) {\r\n Object.entries(translations).forEach(([code, translation]) =>\r\n this.addLabel(id, code as TLanguageCode, translation)\r\n );\r\n return this;\r\n }\r\n\r\n /**\r\n *\r\n * Removes all translations with the given id\r\n *\r\n * @param id the id for the label\r\n * @returns\r\n */\r\n removeLabel(id: string) {\r\n const idx = this.configuration.labels.findIndex(x => x.id === id);\r\n if (idx > -1) {\r\n this.configuration.labels.splice(idx, 1);\r\n } else {\r\n throw new Error(`Label with id '${id}' not found!`);\r\n }\r\n return this;\r\n }\r\n\r\n /**\r\n *\r\n * Starts an editor for the action from the `actions` list associated with the given id\r\n *\r\n * @param id\r\n * @returns\r\n */\r\n editAction(id: string) {\r\n const actionConfig = this.configuration.actions.find(a => a.id === id);\r\n if (actionConfig) {\r\n return new EndableActionEditor(actionConfig, this);\r\n }\r\n throw new Error(`Action not found for id ${id}`);\r\n }\r\n\r\n /**\r\n *\r\n * Starts an editor for the action from the `eventActions` list associated with the given id\r\n *\r\n * @param id\r\n * @returns\r\n */\r\n editEventAction(id: string) {\r\n const actionConfig = this.configuration.eventActions?.find(\r\n a => a.id === id\r\n );\r\n if (actionConfig) {\r\n return new ActionEditor(actionConfig, this);\r\n }\r\n throw new Error(`Event action not found for id ${id}`);\r\n }\r\n\r\n /**\r\n *\r\n * Starts an editor for the action from the `initActions` list associated with the given id\r\n *\r\n * @param id\r\n * @returns\r\n */\r\n editInitAction(id: string) {\r\n const actionConfig = this.configuration.initActions.find(a => a.id === id);\r\n if (actionConfig) {\r\n return new EndableActionEditor(actionConfig, this);\r\n }\r\n throw new Error(`Init action not found for id ${id}`);\r\n }\r\n\r\n /**\r\n *\r\n * Starts an editor for the action from the `timelineActions` list associated with the given uri and id\r\n *\r\n * @param uri\r\n * @param id\r\n * @returns\r\n */\r\n editTimelineAction(uri: string, id: string) {\r\n const timeline = this.getTimeline(uri);\r\n if (!timeline) {\r\n throw new Error(`Timeline not found for id ${id}`);\r\n }\r\n const actionConfig = timeline.timelineActions.find(a => a.id === id);\r\n if (actionConfig) {\r\n return new TimelineActionEditor(actionConfig, this);\r\n }\r\n throw new Error(`Timeline action not found for id ${id}`);\r\n }\r\n}\r\n","import type {IEndableAction} from '../action/types.ts';\r\nimport type {IEventbus} from '../eventbus/types.ts';\r\nimport {deepCopy} from '../operation/helper/deep-copy.ts';\r\nimport type {TOperationData} from '../operation/types.ts';\r\nimport type {IController} from './types.ts';\r\n\r\ninterface IActionInstanceInfo {\r\n start: boolean;\r\n action: IEndableAction;\r\n}\r\n\r\nexport interface IDOMEventListenerControllerOperationData {\r\n /**\r\n * @dependency\r\n */\r\n selectedElement: JQuery;\r\n /**\r\n * @type=ParameterType:eventName\r\n * @required\r\n */\r\n eventName: string;\r\n actions: string[];\r\n /**\r\n * @type=ParameterType:object\r\n */\r\n actionOperationData?: TOperationData;\r\n}\r\n\r\n/**\r\n * This controller attaches to the given selected element and adds a DOM event listener for the specified event name that\r\n * executes the given actions with the given operation data.\r\n *\r\n * By default the `start` operations of the specified actions are executed. To execute the `end` operations instead,\r\n * prefix the action name with `end:`.\r\n */\r\nexport class DOMEventListenerController\r\n implements IController<IDOMEventListenerControllerOperationData>\r\n{\r\n operationData?: IDOMEventListenerControllerOperationData;\r\n actionInstanceInfos?: IActionInstanceInfo[];\r\n name = 'DOMEventListenerController';\r\n\r\n init(operationData: IDOMEventListenerControllerOperationData) {\r\n this.operationData = {\r\n selectedElement: operationData.selectedElement,\r\n eventName: operationData.eventName,\r\n actions: operationData.actions.slice(),\r\n actionOperationData: deepCopy(operationData.actionOperationData),\r\n };\r\n }\r\n\r\n attach(eventbus: IEventbus) {\r\n if (!this.operationData) {\r\n return;\r\n }\r\n\r\n const {selectedElement, actions, eventName} = this.operationData;\r\n if (!this.actionInstanceInfos) {\r\n this.actionInstanceInfos = [];\r\n\r\n const resultCallback =\r\n (isStart: boolean) => (actionInstance: IEndableAction) => {\r\n this.actionInstanceInfos?.push({\r\n start: isStart,\r\n action: actionInstance,\r\n });\r\n };\r\n\r\n actions.forEach((actionName: string) => {\r\n const [isStart, name] = this._isStartAction(actionName);\r\n eventbus.broadcast('request-action', [name, resultCallback(isStart)]);\r\n });\r\n\r\n selectedElement.on(eventName, this._eventHandler.bind(this));\r\n }\r\n }\r\n\r\n private _isStartAction(actionName: string): [boolean, string] {\r\n const prefix = actionName.substring(0, 'end:'.length);\r\n if (prefix === 'end:') {\r\n return [false, actionName.substring('end:'.length)];\r\n } else {\r\n return [true, actionName];\r\n }\r\n }\r\n\r\n private _eventHandler(event: any) {\r\n if (!this.operationData || !this.actionInstanceInfos) {\r\n return;\r\n }\r\n\r\n const actionOperationData = this.operationData.actionOperationData\r\n ? deepCopy(this.operationData.actionOperationData)\r\n : {};\r\n\r\n if (event.target) {\r\n actionOperationData.eventTarget = event.target;\r\n }\r\n\r\n this._executeAction(this.actionInstanceInfos, actionOperationData, 0);\r\n }\r\n\r\n private async _executeAction(\r\n actions: IActionInstanceInfo[],\r\n operationData: TOperationData,\r\n idx: number\r\n ) {\r\n if (idx < actions.length) {\r\n const actionInfo = actions[idx];\r\n const {action} = actionInfo;\r\n const method = actionInfo.start\r\n ? action.start.bind(action)\r\n : action.end.bind(action);\r\n const resultOperationData = await method(operationData);\r\n this._executeAction(\r\n actions,\r\n Object.assign(operationData, resultOperationData),\r\n ++idx\r\n );\r\n }\r\n }\r\n\r\n detach(_eventbus: IEventbus) {\r\n this.operationData?.selectedElement.off(this.operationData.eventName);\r\n }\r\n}\r\n","import type {\r\n EventName,\r\n IEventbus,\r\n TEventbusRemover,\r\n} from '../eventbus/types.js';\r\nimport type {TOperationData} from '../operation/types.js';\r\nimport type {IController} from './types.js';\r\n\r\n/**\r\n * Abstract base class for controllers providing standardized event listener management\r\n *\r\n * Benefits:\r\n * - Eliminates boilerplate event listener tracking code\r\n * - Automatic binding of event handlers to controller instance\r\n * - Centralized cleanup preventing memory leaks\r\n * - Consistent event management pattern across all controllers\r\n *\r\n * @example\r\n * ```typescript\r\n * class MyController extends BaseController<IMyOperationData> {\r\n * name = 'MyController';\r\n *\r\n * init(operationData: IMyOperationData): void {\r\n * this.operationData = operationData;\r\n * }\r\n *\r\n * attach(eventbus: IEventbus): void {\r\n * this.addListener(eventbus, 'my-event', this.handleMyEvent);\r\n * // Handler automatically bound, cleanup tracked\r\n * }\r\n *\r\n * private handleMyEvent(): void {\r\n * // 'this' context preserved\r\n * }\r\n * }\r\n * ```\r\n */\r\nexport abstract class BaseController<T extends TOperationData>\r\n implements IController<T>\r\n{\r\n // Public properties (required by IController)\r\n public operationData: T | null = null;\r\n public abstract name: string;\r\n\r\n // Protected state\r\n protected eventListeners: TEventbusRemover[] = [];\r\n\r\n /**\r\n * Register event listener with automatic binding and cleanup tracking\r\n *\r\n * @param eventbus - The eventbus to register with\r\n * @param eventName - Name of the event to listen for\r\n * @param handler - Event handler function (will be bound to this controller)\r\n */\r\n protected addListener(\r\n eventbus: IEventbus,\r\n eventName: EventName,\r\n handler: (...args: any[]) => void\r\n ): void {\r\n const boundHandler = handler.bind(this);\r\n const remover = eventbus.on(eventName, boundHandler as any);\r\n this.eventListeners.push(remover);\r\n }\r\n\r\n /**\r\n * Register multiple event listeners at once\r\n *\r\n * @param eventbus - The eventbus to register with\r\n * @param listeners - Array of {eventName, handler} pairs\r\n */\r\n protected attachMultiple(\r\n eventbus: IEventbus,\r\n listeners: Array<{eventName: string; handler: (...args: any[]) => void}>\r\n ): void {\r\n listeners.forEach(({eventName, handler}) => {\r\n this.addListener(eventbus, eventName as EventName, handler);\r\n });\r\n }\r\n\r\n /**\r\n * Clean up all tracked event listeners\r\n * Prevents memory leaks by removing all registered handlers\r\n *\r\n * @param _eventbus - The eventbus (ignored, included for IController compatibility)\r\n */\r\n public detach(_eventbus: IEventbus): void {\r\n this.eventListeners.forEach(remover => remover());\r\n this.eventListeners = [];\r\n }\r\n\r\n // Abstract methods (must be implemented by subclasses)\r\n public abstract init(operationData: T): void;\r\n public abstract attach(eventbus: IEventbus): Promise<any> | void;\r\n}\r\n","import type {IEventbus} from '../eventbus/types.ts';\r\nimport type {ILabel} from '../types.ts';\r\nimport {BaseController} from './base-controller.ts';\r\n\r\nexport interface ILabelControllerMetadata {\r\n /**\r\n * @dependency\r\n */\r\n selectedElement: JQuery;\r\n /**\r\n * @type=ParameterType:labelId\r\n * @required\r\n */\r\n labelId: string;\r\n /**\r\n * By default the label is added to the inner HTML of the `selectedElement`,\r\n * otherwise if this property is set, the label text is added to the specified attribute\r\n * of the `selectedElement`.\r\n */\r\n attributeName?: string;\r\n}\r\n\r\n/**\r\n * This controller attaches to the given selected element and renders the text associated with the given label id in it.\r\n *\r\n * The controller also listen for the `LANGUAGE_CHANGE` event and re-renders the text with the new language after such an event.\r\n *\r\n */\r\nexport class LabelController extends BaseController<ILabelControllerMetadata> {\r\n currentLanguage: string | null = null;\r\n labelData: Record<string, string> = {};\r\n name = 'LabelController';\r\n requestLabelDataBound?: (labelId: string) => void;\r\n\r\n init(operationData: ILabelControllerMetadata) {\r\n this.operationData = Object.assign({}, operationData);\r\n }\r\n\r\n setLabelId(newLabelId: string) {\r\n if (this.requestLabelDataBound) {\r\n this.requestLabelDataBound(newLabelId);\r\n this._setLabel();\r\n }\r\n }\r\n\r\n attach(eventbus: IEventbus) {\r\n if (!this.operationData) {\r\n return;\r\n }\r\n\r\n eventbus.broadcast('request-current-language', [\r\n (language: string) => {\r\n this.currentLanguage = language;\r\n },\r\n ]);\r\n\r\n this.requestLabelDataBound = this._requestLabelData.bind(this, eventbus);\r\n this.requestLabelDataBound(this.operationData.labelId);\r\n\r\n this._setLabel();\r\n this.addListener(eventbus, 'language-change', this._handleLanguageChange);\r\n }\r\n\r\n private _requestLabelData(eventbus: IEventbus, labelId: string) {\r\n eventbus.broadcast('request-label-collection', [\r\n labelId,\r\n (labelCollection: ILabel[]) => {\r\n if (labelCollection) {\r\n this._createTextDataLookup(labelCollection);\r\n } else {\r\n throw new Error(`Label id '${labelId}' does not exist!`);\r\n }\r\n },\r\n ]);\r\n }\r\n\r\n private _setLabel() {\r\n if (this.currentLanguage) {\r\n const text = this.labelData[this.currentLanguage];\r\n if (!this.operationData?.attributeName) {\r\n this.operationData?.selectedElement.html(text);\r\n } else {\r\n this.operationData?.selectedElement.attr(\r\n this.operationData?.attributeName,\r\n text\r\n );\r\n }\r\n }\r\n }\r\n\r\n detach(eventbus: IEventbus) {\r\n super.detach(eventbus);\r\n this.requestLabelDataBound = undefined;\r\n }\r\n\r\n private _handleLanguageChange(code: string) {\r\n this.currentLanguage = code;\r\n this._setLabel();\r\n }\r\n\r\n private _createTextDataLookup(data: ILabel[]) {\r\n data.forEach(d => {\r\n this.labelData[d.languageCode] = d.label;\r\n });\r\n }\r\n}\r\n","import type {\r\n AnimationConfigWithData,\r\n AnimationItem,\r\n CanvasRendererConfig,\r\n HTMLRendererConfig,\r\n SVGRendererConfig,\r\n} from 'lottie-web';\r\nimport lt from 'lottie-web';\r\nimport type {IEventbus} from '../eventbus/types.ts';\r\nimport type {TLanguageCode} from '../types.ts';\r\nimport {BaseController} from './base-controller.ts';\r\n\r\nconst lottie = lt.default ?? lt;\r\n\r\nexport interface IInnerMetadata {\r\n /**\r\n * @dependency\r\n */\r\n selectedElement: JQuery;\r\n /**\r\n * @type=ParameterType:string\r\n */\r\n renderer: SVGRendererConfig | CanvasRendererConfig | HTMLRendererConfig;\r\n loop: boolean;\r\n autoplay: boolean;\r\n /**\r\n * ParameterType:object\r\n */\r\n animationData: any;\r\n /**\r\n * @required\r\n */\r\n json: any;\r\n /**\r\n * @type=ParameterType:array\r\n * @itemType=ParameterType:labelId\r\n */\r\n labelIds: string[];\r\n viewBox: string;\r\n iefallback: any;\r\n}\r\n\r\nexport interface ILottieControllerMetadata extends IInnerMetadata {\r\n /**\r\n * @type=ParameterType:url\r\n * @required\r\n */\r\n url: string;\r\n}\r\n\r\n/**\r\n * This controller renders a [lottie-web](https://github.com/airbnb/lottie-web) animation inside the given selected element.\r\n *\r\n * The url may encode freeze and end positions like this: my-url/filename[freeze=10,end=21].json\r\n *\r\n */\r\nexport class LottieController extends BaseController<ILottieControllerMetadata> {\r\n name = 'LottieController';\r\n currentLanguage: TLanguageCode = 'nl-NL';\r\n labelData: Record<string, Record<string, string>> = {};\r\n animationItem: AnimationItem | null = null;\r\n serializedData: string | null = null;\r\n serializedIEData: string | null = null;\r\n freezePosition = -1;\r\n endPosition = -1;\r\n\r\n init(operationData: ILottieControllerMetadata) {\r\n this.operationData = {...operationData};\r\n\r\n if (operationData.url.indexOf('[') > -1) {\r\n this._parseFilename(operationData.url);\r\n }\r\n\r\n this.serializedData = this.operationData.json\r\n ? JSON.stringify(this.operationData.json)\r\n : JSON.stringify(this.operationData.animationData);\r\n\r\n if (this.operationData.iefallback) {\r\n this.serializedIEData = JSON.stringify(this.operationData.iefallback);\r\n }\r\n }\r\n\r\n private _parseFilename(name: string) {\r\n const startIndex = name.indexOf('[') + 1;\r\n const endIndex = name.indexOf(']');\r\n const params = name.substring(startIndex, endIndex);\r\n\r\n const settings = params.split(',');\r\n\r\n settings.forEach(setting => {\r\n const values = setting.split('=');\r\n if (values[0] === 'freeze') {\r\n this.freezePosition = +values[1];\r\n } else if (values[0] === 'end') {\r\n this.endPosition = +values[1];\r\n }\r\n });\r\n }\r\n\r\n attach(eventbus: IEventbus) {\r\n if (!this.operationData) {\r\n return;\r\n }\r\n\r\n const {labelIds} = this.operationData;\r\n if (labelIds?.length) {\r\n let currentLanguage: TLanguageCode = 'en-US';\r\n let labelCollections: any[] = [];\r\n\r\n eventbus.broadcast('request-current-language', [\r\n (language: TLanguageCode) => {\r\n currentLanguage = language;\r\n },\r\n ]);\r\n this.currentLanguage = currentLanguage;\r\n this.addListener(eventbus, 'language-change', this._handleLanguageChange);\r\n eventbus.broadcast('request-label-collections', [\r\n this.operationData.labelIds,\r\n (collections: any) => {\r\n labelCollections = collections;\r\n },\r\n ]);\r\n this._createTextDataLookup(labelCollections);\r\n }\r\n this._createAnimation();\r\n this._createAnimation();\r\n }\r\n\r\n detach(eventbus: IEventbus) {\r\n super.detach(eventbus);\r\n\r\n if (this.animationItem) {\r\n if (this.endPosition > -1) {\r\n this.animationItem.addEventListener(\r\n 'complete',\r\n this._destroy.bind(this)\r\n );\r\n this.animationItem.playSegments(\r\n [this.freezePosition, this.endPosition],\r\n true\r\n );\r\n } else {\r\n this.animationItem.destroy();\r\n }\r\n }\r\n }\r\n\r\n private _destroy() {\r\n if (this.animationItem) {\r\n this.animationItem.destroy();\r\n this.animationItem = null;\r\n }\r\n }\r\n\r\n private _createAnimation() {\r\n if (!this.operationData || !this.serializedData) {\r\n return;\r\n }\r\n\r\n this.animationItem?.destroy();\r\n let serialized =\r\n this._isIE() && this.serializedIEData\r\n ? this.serializedIEData\r\n : this.serializedData;\r\n\r\n const {labelIds} = this.operationData;\r\n if (labelIds?.length) {\r\n // O(n) regex-based replacement - single pass through string\r\n // Replaces all !!labelId!! patterns in one operation\r\n serialized = serialized.replace(/!!([^!]+)!!/g, (match, labelId) => {\r\n return this.labelData[labelId]?.[this.currentLanguage] ?? match;\r\n });\r\n }\r\n const animationData = JSON.parse(serialized);\r\n\r\n const animationSettings: AnimationConfigWithData<'svg'> = {\r\n autoplay: this.operationData.autoplay,\r\n container: this.operationData.selectedElement[0],\r\n loop: this.operationData.loop,\r\n rendererSettings: this.operationData.renderer,\r\n animationData,\r\n };\r\n\r\n this.animationItem = lottie.loadAnimation(animationSettings);\r\n if (this.endPosition < 0) {\r\n this.endPosition = this.animationItem.timeCompleted;\r\n }\r\n\r\n if (this.freezePosition > -1) {\r\n this.animationItem.playSegments([0, this.freezePosition], true);\r\n }\r\n if (this.operationData.viewBox) {\r\n this.operationData.selectedElement\r\n .find('svg')\r\n .attr('viewBox', this.operationData.viewBox);\r\n }\r\n }\r\n\r\n private _createTextDataLookup(data: any[]) {\r\n data.forEach((infos, index) => {\r\n infos.forEach((d: any) => {\r\n if (this.operationData) {\r\n this.labelData[this.operationData.labelIds[index]][d.code] = d.label;\r\n }\r\n });\r\n });\r\n }\r\n\r\n private _handleLanguageChange(code: TLanguageCode) {\r\n this.currentLanguage = code;\r\n this._createAnimation();\r\n }\r\n\r\n private _isIE() {\r\n const isIE = false || !!(window.document as any).documentMode;\r\n\r\n // Edge 20+\r\n const isEdge = !isIE && !!(window as any).StyleMedia;\r\n\r\n return isEdge || isIE;\r\n }\r\n}\r\n","import type {IEventbus} from '../eventbus/types.ts';\r\nimport {BaseController} from './base-controller.ts';\r\n\r\n/**\r\n * Metadata configuration for MutationObserverController\r\n *\r\n * Configures what types of DOM mutations to observe and how to observe them.\r\n */\r\nexport interface IMutationObserverControllerMetadata {\r\n /**\r\n * jQuery-wrapped DOM element to observe for mutations\r\n * @dependency\r\n * @required\r\n */\r\n selectedElement: JQuery;\r\n\r\n /**\r\n * Observe changes to element attributes\r\n * @optional\r\n * @default true\r\n */\r\n observeAttributes?: boolean;\r\n\r\n /**\r\n * Observe additions and removals of child nodes\r\n * @optional\r\n * @default true\r\n */\r\n observeChildList?: boolean;\r\n\r\n /**\r\n * Observe changes to text content (character data)\r\n * @optional\r\n * @default true\r\n */\r\n observeCharacterData?: boolean;\r\n\r\n /**\r\n * Observe mutations in the entire subtree (all descendants)\r\n * @optional\r\n * @default false\r\n */\r\n observeSubtree?: boolean;\r\n\r\n /**\r\n * Record the previous value of attributes that change\r\n * Requires observeAttributes to be true\r\n * @optional\r\n * @default false\r\n */\r\n attributeOldValue?: boolean;\r\n\r\n /**\r\n * Record the previous value of text content that changes\r\n * Requires observeCharacterData to be true\r\n * @optional\r\n * @default false\r\n */\r\n characterDataOldValue?: boolean;\r\n\r\n /**\r\n * Array of specific attribute local names to observe\r\n * If omitted, all attribute changes are observed when observeAttributes is true\r\n * @optional\r\n */\r\n attributeFilter?: string[];\r\n}\r\n\r\n/**\r\n * Mutation event payload broadcasted through Eligius eventbus\r\n */\r\nexport interface IMutationEventPayload {\r\n /**\r\n * Array of mutation records from the MutationObserver callback\r\n */\r\n mutations: MutationRecord[];\r\n\r\n /**\r\n * Reference to the observed element (native DOM node)\r\n */\r\n target: Element;\r\n\r\n /**\r\n * Timestamp when the mutations were detected\r\n */\r\n timestamp: number;\r\n}\r\n\r\n/**\r\n * Controller that observes DOM mutations on a selected element and broadcasts events.\r\n *\r\n * This controller creates a MutationObserver to monitor DOM changes (attributes, child nodes,\r\n * text content) on a specified element. All detected mutations are broadcasted through the\r\n * Eligius eventbus, enabling reactive behavior in response to DOM changes.\r\n *\r\n * The controller follows the standard Eligius lifecycle:\r\n * - init(): Store configuration metadata\r\n * - attach(): Create and start the MutationObserver\r\n * - detach(): Disconnect the observer and clean up resources\r\n *\r\n * @example\r\n * ```typescript\r\n * // JSON configuration\r\n * {\r\n * \"systemName\": \"addControllerToElement\",\r\n * \"operationData\": {\r\n * \"controllerName\": \"MutationObserverController\",\r\n * \"observeAttributes\": true,\r\n * \"observeChildList\": true,\r\n * \"observeCharacterData\": false\r\n * }\r\n * }\r\n *\r\n * // Listen for mutations\r\n * eventbus.on('dom-mutation', (payload: IMutationEventPayload) => {\r\n * console.log('Mutations detected:', payload.mutations);\r\n * });\r\n * ```\r\n */\r\nexport class MutationObserverController extends BaseController<IMutationObserverControllerMetadata> {\r\n name = 'MutationObserverController';\r\n private observer: MutationObserver | null = null;\r\n\r\n /**\r\n * Initialize the controller with configuration metadata.\r\n *\r\n * @param operationData - Configuration for observation behavior\r\n */\r\n init(operationData: IMutationObserverControllerMetadata): void {\r\n this.operationData = Object.assign({}, operationData);\r\n }\r\n\r\n /**\r\n * Attach the controller and start observing mutations.\r\n * Creates MutationObserver instance and begins monitoring the target element.\r\n *\r\n * @param eventbus - Eligius eventbus for broadcasting mutation events\r\n */\r\n attach(eventbus: IEventbus): void {\r\n if (!this.operationData) {\r\n return;\r\n }\r\n\r\n // Unwrap jQuery element to get native DOM node\r\n const nativeElement = this.operationData.selectedElement.get(0);\r\n if (!nativeElement) {\r\n return;\r\n }\r\n\r\n // Build observer options from metadata\r\n const options = this._buildObserverOptions();\r\n\r\n // Create MutationObserver with bound callback\r\n this.observer = new MutationObserver(\r\n this._handleMutations.bind(this, eventbus, nativeElement)\r\n );\r\n\r\n // Start observing the target element\r\n this.observer.observe(nativeElement, options);\r\n }\r\n\r\n /**\r\n * Detach the controller and stop observing mutations.\r\n * Disconnects MutationObserver and cleans up resources.\r\n *\r\n * @param eventbus - Eligius eventbus (used by BaseController for cleanup)\r\n */\r\n detach(eventbus: IEventbus): void {\r\n // Disconnect and clean up observer\r\n if (this.observer) {\r\n this.observer.disconnect();\r\n this.observer = null;\r\n }\r\n\r\n // Call parent detach for event listener cleanup\r\n super.detach(eventbus);\r\n }\r\n\r\n /**\r\n * Build MutationObserverInit options from controller metadata.\r\n * Applies default values for optional configuration properties.\r\n *\r\n * @returns MutationObserverInit options object\r\n * @private\r\n */\r\n private _buildObserverOptions(): MutationObserverInit {\r\n if (!this.operationData) {\r\n return {};\r\n }\r\n\r\n const {\r\n observeAttributes = true,\r\n observeChildList = true,\r\n observeCharacterData = true,\r\n observeSubtree = false,\r\n attributeOldValue = false,\r\n characterDataOldValue = false,\r\n attributeFilter,\r\n } = this.operationData;\r\n\r\n return {\r\n attributes: observeAttributes,\r\n childList: observeChildList,\r\n characterData: observeCharacterData,\r\n subtree: observeSubtree,\r\n attributeOldValue,\r\n characterDataOldValue,\r\n attributeFilter,\r\n };\r\n }\r\n\r\n /**\r\n * Handle mutations detected by the MutationObserver.\r\n * Broadcasts mutation events through the eventbus with mutation details.\r\n *\r\n * @param eventbus - Eligius eventbus for broadcasting\r\n * @param target - The observed element\r\n * @param mutations - Array of mutation records from observer callback\r\n * @private\r\n */\r\n private _handleMutations(\r\n eventbus: IEventbus,\r\n target: Element,\r\n mutations: MutationRecord[]\r\n ): void {\r\n const payload: IMutationEventPayload = {\r\n mutations,\r\n target,\r\n timestamp: Date.now(),\r\n };\r\n\r\n eventbus.broadcast('dom-mutation', [payload]);\r\n }\r\n}\r\n","import $ from 'jquery';\r\nimport type {IEventbus} from '../eventbus/types.ts';\r\nimport type {TOperationData} from '../operation/types.ts';\r\nimport type {TResultCallback} from '../types.ts';\r\nimport {BaseController} from './base-controller.ts';\r\nimport type {LabelController} from './label-controller.ts';\r\n\r\nexport interface INavigationControllerOperationData {\r\n /**\r\n * @dependency\r\n */\r\n selectedElement: JQuery;\r\n /**\r\n * @required\r\n */\r\n json: any;\r\n}\r\n\r\nexport class NavigationController extends BaseController<INavigationControllerOperationData> {\r\n name: string = 'NavigationController';\r\n navigation: any[] = [];\r\n navLookup: Record<string, any> = {};\r\n navVidIdLookup: Record<string, any> = {};\r\n ctrlLookup: Record<string, LabelController> = {};\r\n activeNavigationPoint: any | null = null;\r\n labelControllers: LabelController[] = [];\r\n eventbus: IEventbus | null = null;\r\n container: JQuery | null = null;\r\n\r\n init(operationData: TOperationData) {\r\n this.container = operationData.selectedElement;\r\n this.navigation = this._buildNavigationData(operationData.json);\r\n }\r\n\r\n attach(eventbus: IEventbus) {\r\n if (!this.container) {\r\n return;\r\n }\r\n\r\n this.eventbus = eventbus;\r\n\r\n this.addListener(\r\n eventbus,\r\n 'navigate-to-video-url',\r\n this._handleNavigateVideoUrl\r\n );\r\n this.addListener(eventbus, 'highlight-navigation', this._highlightMenu);\r\n this.addListener(\r\n eventbus,\r\n 'request-current-navigation',\r\n this._handleRequestCurrentNavigation\r\n );\r\n this.addListener(eventbus, 'video-complete', this._handleVideoComplete);\r\n\r\n this._buildHtml(this.container, this.navigation);\r\n this._initHistory.bind(this);\r\n }\r\n\r\n private _initHistory() {\r\n this.activeNavigationPoint = this.navVidIdLookup[0];\r\n const navId = this._getQueryVariable(0);\r\n let videoIndex = 0;\r\n if (navId) {\r\n const nav = this.navLookup[navId];\r\n videoIndex = nav.videoUrlIndex;\r\n }\r\n this._highlightMenu(videoIndex);\r\n }\r\n\r\n private _getQueryVariable(variableIdx: number) {\r\n const href = window.location.href;\r\n const hashIndex = href.indexOf('#');\r\n if (hashIndex > -1) {\r\n const query = href.substring(hashIndex + 2);\r\n if (query) {\r\n const vars = query.split('/');\r\n return vars[variableIdx];\r\n }\r\n }\r\n return null;\r\n }\r\n\r\n private _handleRequestCurrentNavigation(\r\n resultCallback: TResultCallback<{navigationData: any; title: string} | null>\r\n ) {\r\n if (this.activeNavigationPoint) {\r\n const labelCtrl = this.ctrlLookup[this.activeNavigationPoint.labelId];\r\n resultCallback({\r\n navigationData: this.activeNavigationPoint,\r\n title: labelCtrl.labelData[labelCtrl.currentLanguage || ''],\r\n });\r\n } else {\r\n resultCallback(null);\r\n }\r\n }\r\n\r\n detach(eventbus: IEventbus) {\r\n super.detach(eventbus);\r\n\r\n this.labelControllers.forEach(ctrl => {\r\n ctrl.detach(eventbus);\r\n });\r\n\r\n this.labelControllers.length = 0;\r\n this.eventbus = null;\r\n this.container = null;\r\n window.onpopstate = null;\r\n }\r\n\r\n private _pushCurrentState(position = -1) {\r\n if (!this.activeNavigationPoint) {\r\n return;\r\n }\r\n const labelCtrl: LabelController =\r\n this.ctrlLookup[this.activeNavigationPoint.labelId];\r\n\r\n if (!labelCtrl) {\r\n return;\r\n }\r\n\r\n const state = {\r\n navigationData: this.activeNavigationPoint,\r\n title: labelCtrl.labelData[labelCtrl.currentLanguage || ''],\r\n position: -1,\r\n };\r\n if (position > -1) {\r\n state.position = position;\r\n }\r\n this.eventbus?.broadcast('push-history-state', [state]);\r\n }\r\n\r\n private _buildHtml(parentElm: JQuery, data: any) {\r\n const ul = $('<ul/>');\r\n data.forEach(this._addNavElement.bind(this, ul));\r\n parentElm.append(ul);\r\n }\r\n\r\n private _addNavElement(parentElm: JQuery, data: any) {\r\n if (data.visible) {\r\n const li = $('<li/>');\r\n const a = $(`<a href='javascript:;' id='nav_${data.videoUrlIndex}'/>`);\r\n li.append(a);\r\n this._addLabel(a, data.labelId);\r\n this._addClickHandler(a, data.videoUrlIndex);\r\n\r\n if (data.children) {\r\n const ul = $('<ul/>');\r\n data.children.forEach(this._addNavElement.bind(this, ul));\r\n li.append(ul);\r\n }\r\n\r\n parentElm.append(li);\r\n }\r\n }\r\n\r\n private _addClickHandler(parentElm: JQuery, videoIndex: number) {\r\n parentElm.mouseup(this._menuMouseupHandler.bind(this, videoIndex));\r\n }\r\n\r\n private _menuMouseupHandler(videoIndex: number) {\r\n const navdata = this.navVidIdLookup[videoIndex];\r\n if (navdata) {\r\n this.eventbus?.broadcast('request-video-url', [navdata.videoUrlIndex]);\r\n this._handleNavigateVideoUrl(navdata.videoUrlIndex);\r\n }\r\n }\r\n\r\n private _handleNavigateVideoUrl(\r\n index: number,\r\n requestedVideoPosition: number = 0\r\n ) {\r\n this._highlightMenu(index);\r\n this.eventbus?.broadcast('request-video-url', [\r\n index,\r\n requestedVideoPosition,\r\n ]);\r\n this.activeNavigationPoint = this.navVidIdLookup[index];\r\n this._pushCurrentState(requestedVideoPosition);\r\n }\r\n\r\n private _highlightMenu(index: number) {\r\n const navElm = $(`#nav_${index}`);\r\n\r\n if (navElm.length) {\r\n $('.current-menu-item').removeClass('current-menu-item');\r\n navElm.addClass('current-menu-item');\r\n }\r\n }\r\n\r\n private _handleVideoComplete(index: number) {\r\n const navData = this.navVidIdLookup[index];\r\n if (navData.autoNext) {\r\n this.eventbus?.broadcast('request-video-url', [\r\n navData.next.videoUrlIndex,\r\n ]);\r\n } else {\r\n this.eventbus?.broadcast('request-video-cleanup', []);\r\n }\r\n }\r\n\r\n private _addLabel(parentElm: JQuery, labelId: string) {\r\n const data = {\r\n selectedElement: parentElm,\r\n labelId: labelId,\r\n };\r\n const resultCallback = (instance: LabelController) => {\r\n instance.init(data);\r\n instance.attach(this.eventbus as IEventbus);\r\n this.labelControllers.push(instance);\r\n this.ctrlLookup[labelId] = instance;\r\n };\r\n this.eventbus?.broadcast('request-instance', [\r\n 'LabelController',\r\n resultCallback,\r\n ]);\r\n }\r\n\r\n private _buildNavigationData(data: any) {\r\n const result: any[] = [];\r\n data.navigationData.forEach((nav: any, index: number) => {\r\n this.navLookup[nav.id] = nav;\r\n this.navVidIdLookup[nav.videoUrlIndex] = nav;\r\n nav.previous = data.navigationData[index - 1];\r\n });\r\n\r\n data.navigationData.forEach((nav: any, index: number) => {\r\n if (nav.nextId) {\r\n nav.next = this.navLookup[nav.nextId];\r\n delete nav.nextId;\r\n } else {\r\n nav.next = data.navigationData[index + 1];\r\n }\r\n });\r\n\r\n data.roots.forEach((id: string) => {\r\n const nav = this.navLookup[id];\r\n if (nav.children) {\r\n nav.children = nav.children.map((childId: string) => {\r\n return this.navLookup[childId];\r\n });\r\n }\r\n result.push(nav);\r\n });\r\n return result;\r\n }\r\n}\r\n","import type {IEventbus} from '../eventbus/types.ts';\r\nimport type {TOperationData} from '../operation/types.ts';\r\nimport {BaseController} from './base-controller.ts';\r\n\r\nexport interface IProgressbarControllerOperationData {\r\n /**\r\n * @dependency\r\n */\r\n selectedElement: JQuery;\r\n /**\r\n * @dependency\r\n */\r\n textElement: JQuery;\r\n}\r\n\r\n/**\r\n * This controller renders a progressbar that displays the progress of the current timeline in the given selected element.\r\n *\r\n * The current progress as a percentage is rendered in the given text element.\r\n */\r\nexport class ProgressbarController extends BaseController<IProgressbarControllerOperationData> {\r\n name: string = 'ProgressbarController';\r\n selectedElement: JQuery | null = null;\r\n textElement: JQuery | null = null;\r\n duration: number = 0;\r\n\r\n init(operationData: TOperationData) {\r\n this.selectedElement = operationData.selectedElement;\r\n this.textElement = operationData.textElement;\r\n }\r\n\r\n attach(eventbus: IEventbus) {\r\n this.addListener(eventbus, 'timeline-time', this._positionUpdateHandler);\r\n\r\n eventbus.broadcast('timeline-duration-request', [\r\n (duration: number) => (this.duration = duration),\r\n ]);\r\n\r\n this.selectedElement?.css({'pointer-events': 'none'});\r\n\r\n const container = this.selectedElement?.parent();\r\n\r\n if (container) {\r\n const clickHandler = this._clickHandler.bind(this, eventbus);\r\n container.on('click', clickHandler);\r\n this.eventListeners.push(() => container.off('click', clickHandler));\r\n }\r\n }\r\n\r\n detach(eventbus: IEventbus) {\r\n super.detach(eventbus);\r\n }\r\n\r\n private _positionUpdateHandler(position: number) {\r\n const percentage = (100 / this.duration) * position;\r\n this.selectedElement?.css('width', `${percentage}%`);\r\n this.textElement?.text(`${Math.floor(percentage)}%`);\r\n }\r\n\r\n private _clickHandler(eventbus: IEventbus, event: any) {\r\n const element = event.target as HTMLElement;\r\n const rect = element.getBoundingClientRect();\r\n\r\n const x = event.clientX - rect.left; //x position within the element.\r\n\r\n const percentage = (100 / rect.width) * x;\r\n\r\n eventbus.broadcast('timeline-seek-request', [\r\n Math.round((this.duration / 100) * percentage),\r\n ]);\r\n }\r\n}\r\n","import type {IEventbus} from '../eventbus/types.ts';\r\nimport type {TOperationData} from '../operation/types.ts';\r\nimport {BaseController} from './base-controller.ts';\r\n\r\nexport interface IRoutingControllerOperationData {\r\n /**\r\n * @required\r\n */\r\n json: any;\r\n}\r\n\r\n/**\r\n * This is a work in progress, do not use this yet please....\r\n */\r\nexport class RoutingController extends BaseController<IRoutingControllerOperationData> {\r\n name = 'RoutingController';\r\n navLookup: Record<string, any> = {};\r\n navVidIdLookup: Record<string, any> = {};\r\n navigation: any = null;\r\n eventbus: IEventbus | null = null;\r\n\r\n init(operationData: TOperationData) {\r\n this.navigation = this._buildNavigationData(operationData.json);\r\n }\r\n\r\n attach(eventbus: IEventbus) {\r\n this.addListener(\r\n eventbus,\r\n 'before-request-video-url',\r\n this._handleBeforeRequestVideoUrl\r\n );\r\n this.addListener(\r\n eventbus,\r\n 'push-history-state',\r\n this._handlePushHistoryState\r\n );\r\n this.eventbus = eventbus;\r\n window.onpopstate = this._handlePopstate.bind(this);\r\n\r\n const navId = this._getQueryVariable(0);\r\n if (navId) {\r\n const nav = this.navLookup[navId];\r\n const pos = +this._getQueryVariable(1);\r\n this.eventbus.broadcast('request-video-url', [\r\n nav.videoUrlIndex,\r\n pos,\r\n true,\r\n ]);\r\n } else {\r\n window.history.pushState(\r\n {navigationId: this.navigation[0].id},\r\n '',\r\n `#/${this.navigation[0].id}`\r\n );\r\n }\r\n }\r\n\r\n private _handlePopstate(event: any) {\r\n const navigationId = event.state\r\n ? event.state.navigationId\r\n : this.navigation[0].id;\r\n const position = event.state?.position ?? 0;\r\n const nav = this.navLookup[navigationId];\r\n this.eventbus?.broadcast('highlight-navigation', [nav.videoUrlIndex]);\r\n this.eventbus?.broadcast('request-video-url', [\r\n nav.videoUrlIndex,\r\n position,\r\n true,\r\n ]);\r\n }\r\n\r\n detach(eventbus: IEventbus) {\r\n super.detach(eventbus);\r\n window.onpopstate = null;\r\n this.eventbus = null;\r\n }\r\n\r\n private _handleBeforeRequestVideoUrl(\r\n _index: number,\r\n _requestedVideoPosition: number = 0,\r\n isHistoryRequest: boolean = false\r\n ) {\r\n isHistoryRequest =\r\n isHistoryRequest !== undefined ? isHistoryRequest : false;\r\n if (!isHistoryRequest) {\r\n const resultCallback = (item: any) => {\r\n this._pushState(item);\r\n };\r\n this.eventbus?.broadcast('request-current-navigation', [resultCallback]);\r\n }\r\n }\r\n\r\n private _getQueryVariable(variableIdx: number) {\r\n const href = window.location.href;\r\n const hashIndex = href.indexOf('#');\r\n if (hashIndex > -1) {\r\n const query = href.substring(hashIndex + 2);\r\n if (query) {\r\n const vars = query.split('/');\r\n return vars[variableIdx];\r\n }\r\n }\r\n return '';\r\n }\r\n\r\n private _handlePushHistoryState(state: any) {\r\n this._pushState(state);\r\n }\r\n\r\n private _pushState(state: any) {\r\n if (state?.navigationData?.visible) {\r\n let currentPosition = state.position !== undefined ? state.position : -1;\r\n if (currentPosition < 0) {\r\n const resultCallback = (position: number) => {\r\n currentPosition = position > 3 ? position - 3 : 0;\r\n };\r\n this.eventbus?.broadcast('request-current-video-position', [\r\n resultCallback,\r\n ]);\r\n }\r\n\r\n const currentState = window.history.state;\r\n if (\r\n currentState &&\r\n currentState.navigationId !== state.navigationData.id\r\n ) {\r\n window.history.pushState(\r\n {navigationId: state.navigationData.id, position: currentPosition},\r\n state.title,\r\n `#/${state.navigationData.id}/${currentPosition}`\r\n );\r\n } else if (\r\n currentState &&\r\n currentState.navigationId === state.navigationData.id\r\n ) {\r\n window.history.replaceState(\r\n {\r\n navigationId: currentState.navigationId,\r\n position: currentPosition,\r\n },\r\n state.title,\r\n `#/${currentState.navigationId}/${currentPosition}`\r\n );\r\n } else {\r\n window.history.pushState(\r\n {navigationId: state.navigationData.id, position: currentPosition},\r\n state.title,\r\n `#/${state.navigationData.id}/${currentPosition}`\r\n );\r\n }\r\n window.document.title = state.title;\r\n }\r\n }\r\n\r\n private _buildNavigationData(data: any) {\r\n const result: any[] = [];\r\n data.navigationData.forEach((nav: any, index: any) => {\r\n this.navLookup[nav.id] = nav;\r\n this.navVidIdLookup[nav.videoUrlIndex] = nav;\r\n nav.previous = data.navigationData[index - 1];\r\n });\r\n\r\n data.navigationData.forEach((nav: any, index: number) => {\r\n if (nav.nextId) {\r\n nav.next = this.navLookup[nav.nextId];\r\n delete nav.nextId;\r\n } else {\r\n nav.next = data.navigationData[index + 1];\r\n }\r\n });\r\n\r\n data.roots.forEach((id: string) => {\r\n const nav = this.navLookup[id];\r\n if (nav.children) {\r\n nav.children = nav.children.map((childId: string) => {\r\n return this.navLookup[childId];\r\n });\r\n }\r\n result.push(nav);\r\n });\r\n return result;\r\n }\r\n}\r\n","import type {IEventbus} from '../eventbus/types.ts';\r\nimport type {\r\n IStrictDuration,\r\n ISubtitleCollection,\r\n TLanguageCode,\r\n} from '../types.ts';\r\nimport {BaseController} from './base-controller.ts';\r\n\r\nexport interface ISubtitlesControllerOperationData {\r\n /**\r\n * @dependency\r\n */\r\n selectedElement: JQuery;\r\n language: TLanguageCode;\r\n /**\r\n * @type=ParameterType:array\r\n * @itemType=ParameterType:object\r\n */\r\n subtitleData: ISubtitleCollection[];\r\n}\r\n\r\nexport class SubtitlesController extends BaseController<ISubtitlesControllerOperationData> {\r\n actionLookup: Record<string, any> = {};\r\n currentLanguage: TLanguageCode | null = null;\r\n lastFunc: (() => void) | null = null;\r\n name = 'SubtitlesController';\r\n subtitleDurations: IStrictDuration[] | null = null;\r\n\r\n attach(eventbus: IEventbus) {\r\n this.addListener(eventbus, 'timeline-time', this.onTimeHandler);\r\n this.addListener(eventbus, 'timeline-seeked', this.onSeekedHandler);\r\n this.addListener(eventbus, 'language-change', this.languageChangeHandler);\r\n }\r\n\r\n detach(eventbus: IEventbus) {\r\n super.detach(eventbus);\r\n }\r\n\r\n languageChangeHandler(newLanguage: TLanguageCode) {\r\n this.currentLanguage = newLanguage;\r\n if (this.lastFunc) {\r\n this.lastFunc();\r\n }\r\n }\r\n\r\n removeTitle(container?: JQuery) {\r\n container?.empty();\r\n this.lastFunc = null;\r\n }\r\n\r\n onTimeHandler(position: number) {\r\n const func = this.actionLookup[position];\r\n if (func && this.lastFunc !== func) {\r\n this.lastFunc = func;\r\n func();\r\n }\r\n }\r\n\r\n onSeekedHandler(position: number, _duration: number) {\r\n const subtitleDuration = this.subtitleDurations?.find(\r\n x => x.start <= position && x.end >= position\r\n );\r\n\r\n const func = subtitleDuration ? this.actionLookup[subtitleDuration.start ?? -1] : undefined;\r\n if (func && this.lastFunc !== func) {\r\n this.lastFunc = func;\r\n func();\r\n } else if (!func) {\r\n this.removeTitle();\r\n }\r\n }\r\n\r\n setTitle(\r\n container: JQuery,\r\n titleLanguageLookup: Record<string, string>\r\n ) {\r\n if (this.currentLanguage) {\r\n container.html(titleLanguageLookup[this.currentLanguage]);\r\n }\r\n }\r\n\r\n createActionLookup(\r\n operationData: ISubtitlesControllerOperationData,\r\n container: JQuery\r\n ) {\r\n const subtitleData = operationData.subtitleData;\r\n const titles = subtitleData[0].titles;\r\n const subtitleTimeLookup: Record<number, () => void> = {};\r\n\r\n for (let i = 0, ii = titles.length; i < ii; i++) {\r\n const titleLanguageLookup: Record<string, string> = {};\r\n\r\n for (let j = 0, jj = subtitleData.length; j < jj; j++) {\r\n const subs = subtitleData[j];\r\n titleLanguageLookup[subs.languageCode] = subs.titles[i].text;\r\n }\r\n\r\n subtitleTimeLookup[titles[i].duration.start] = this.setTitle.bind(\r\n this,\r\n container,\r\n titleLanguageLookup\r\n );\r\n subtitleTimeLookup[titles[i].duration.end] = this.removeTitle.bind(\r\n this,\r\n container\r\n );\r\n }\r\n\r\n return subtitleTimeLookup;\r\n }\r\n\r\n init(operationData: ISubtitlesControllerOperationData) {\r\n const container = operationData.selectedElement;\r\n this.removeTitle = this.removeTitle.bind(this, container);\r\n this.currentLanguage = operationData.language;\r\n this.actionLookup = this.createActionLookup(operationData, container);\r\n this.subtitleDurations = operationData.subtitleData?.[0].titles.map(\r\n x => x.duration\r\n );\r\n }\r\n}\r\n","export type {IDOMEventListenerControllerOperationData} from './dom-event-listener-controller.ts';\r\nexport {DOMEventListenerController} from './dom-event-listener-controller.ts';\r\nexport type {ILabelControllerMetadata} from './label-controller.ts';\r\nexport {LabelController} from './label-controller.ts';\r\nexport type {ILottieControllerMetadata} from './lottie-controller.ts';\r\nexport {LottieController} from './lottie-controller.ts';\r\nexport type {\r\n IMutationEventPayload,\r\n IMutationObserverControllerMetadata,\r\n} from './mutation-observer-controller.ts';\r\nexport {MutationObserverController} from './mutation-observer-controller.ts';\r\nexport type {INavigationControllerOperationData} from './navigation-controller.ts';\r\nexport {NavigationController} from './navigation-controller.ts';\r\nexport type {IProgressbarControllerOperationData} from './progressbar-controller.ts';\r\nexport {ProgressbarController} from './progressbar-controller.ts';\r\nexport type {IRoutingControllerOperationData} from './routing-controller.ts';\r\nexport {RoutingController} from './routing-controller.ts';\r\nexport type {ISubtitlesControllerOperationData} from './subtitles-controller.ts';\r\nexport {SubtitlesController} from './subtitles-controller.ts';\r\n","import { type IAddClassOperationData } from \"../add-class.ts\";\nimport { type IOperationMetadata } from \"./types.ts\";\n\nexport function addClass(): IOperationMetadata<IAddClassOperationData> {\n return {\n description: `This operation adds the specified class name to the specified selected element.`,\n category: `DOM`,\n dependentProperties: ['selectedElement'],\n properties: {\n className: {\n type: 'ParameterType:className',\n required: true,\n erased: true\n }\n },\n };\n}\n","import { type IAddControllerToElementOperationData } from \"../add-controller-to-element.ts\";\nimport { type TOperationData } from \"../types.ts\";\nimport { type IOperationMetadata } from \"./types.ts\";\n\nexport function addControllerToElement(): IOperationMetadata<IAddControllerToElementOperationData<TOperationData>> {\n return {\n description: `This operation adds the specified controller instance to the given selected element.`,\n category: `Controller`,\n dependentProperties: ['selectedElement', 'controllerInstance'],\n };\n}\n","import { type IAddGlobalsToOperationData } from \"../add-globals-to-operation.ts\";\nimport { type IOperationMetadata } from \"./types.ts\";\n\nexport function addGlobalsToOperation(): IOperationMetadata<IAddGlobalsToOperationData> {\n return {\n description: `This operation adds the specified global property names to the current operation data.\nIt finally removes the \\`globalProperties\\` property from the current operation data.`,\n category: `Data`,\n properties: {\n globalProperties: {\n type: 'ParameterType:array',\n itemType: 'ParameterType:string',\n required: true,\n erased: true\n }\n },\n };\n}\n","import { type IAnimateWithClassOperationData } from \"../animate-with-class.ts\";\nimport { type IOperationMetadata } from \"./types.ts\";\n\nexport function animateWithClass(): IOperationMetadata<IAnimateWithClassOperationData> {\n return {\n description: `This operation adds the specified class name to the specified selected element and assumes that this\nclass triggers and animation on the selected element. It then waits for this animation to complete\nbefore it resolves.`,\n category: `Animation`,\n dependentProperties: ['selectedElement'],\n properties: {\n className: {\n type: 'ParameterType:className',\n required: true\n },\n removeClass: {\n type: 'ParameterType:boolean'\n }\n },\n };\n}\n","import { type IAnimateOperationData } from \"../animate.ts\";\nimport { type IOperationMetadata } from \"./types.ts\";\n\nexport function animate(): IOperationMetadata<IAnimateOperationData> {\n return {\n description: `This operation animates the specified selected element with the given [jQuery animation](https://api.jquery.com/animate/) properties, duration and easing.\nIt resolves after the animation completes.`,\n category: `Animation`,\n dependentProperties: ['selectedElement'],\n properties: {\n animationEasing: {\n type: 'ParameterType:boolean',\n erased: true\n },\n animationProperties: {\n type: 'ParameterType:object',\n required: true,\n erased: true\n },\n animationDuration: {\n type: 'ParameterType:number',\n required: true,\n erased: true\n }\n },\n };\n}\n","import { type IAnnounceToScreenReaderOperationData } from \"../announce-to-screen-reader.ts\";\nimport { type IOperationMetadata } from \"./types.ts\";\n\nexport function announceToScreenReader(): IOperationMetadata<IAnnounceToScreenReaderOperationData> {\n return {\n description: `Announces a message to screen readers using an ARIA live region.`,\n category: `Accessibility`,\n properties: {\n message: {\n type: 'ParameterType:string',\n required: true,\n erased: true\n },\n priority: {\n type: [\n { value: 'polite' },\n { value: 'assertive' }\n ],\n erased: true\n }\n },\n };\n}\n","import { type IOperationMetadata } from \"./types.ts\";\n\nexport function breakForEach(): IOperationMetadata<undefined> {\n return {\n description: `\nThis operation should only be used within a loop, so between a {@link forEach} and {@link endForEach}\noperation. This operation immediately moves to the loop end index, effectively stopping the loop.`,\n category: `Control Flow`,\n };\n}\n","import { type IBroadcastEventOperationData } from \"../broadcast-event.ts\";\nimport { type IOperationMetadata } from \"./types.ts\";\n\nexport function broadcastEvent(): IOperationMetadata<IBroadcastEventOperationData> {\n return {\n description: `This operation broadcasts the given event through the eventbus, along with the\nevent arguments and optional event topic.`,\n category: `Utility`,\n properties: {\n eventArgs: {\n type: 'ParameterType:array',\n required: true,\n erased: true\n },\n eventTopic: {\n type: 'ParameterType:eventTopic',\n erased: true\n },\n eventName: {\n type: 'ParameterType:eventName',\n required: true,\n erased: true\n }\n },\n };\n}\n","import { type ICalcOperationData } from \"../calc.ts\";\nimport { type IOperationMetadata } from \"./types.ts\";\n\nexport function calc(): IOperationMetadata<ICalcOperationData> {\n return {\n description: `This operation calculates the given left and right hand operands using the specified operator.`,\n category: `Utility`,\n properties: {\n left: {\n type: 'ParameterType:number',\n required: true,\n erased: true\n },\n right: {\n type: 'ParameterType:number',\n required: true,\n erased: true\n },\n operator: {\n type: [\n { value: '+' },\n { value: '-' },\n { value: '*' },\n { value: '/' },\n { value: '%' },\n { value: '**' }\n ],\n required: true,\n erased: true\n }\n },\n outputProperties: {\n calculationResult: {\n type: 'ParameterType:number'\n }\n }\n };\n}\n","import { type IClearElementOperationData } from \"../clear-element.ts\";\nimport { type IOperationMetadata } from \"./types.ts\";\n\nexport function clearElement(): IOperationMetadata<IClearElementOperationData> {\n return {\n description: `This operation removes all of the children from the given selected element.`,\n category: `DOM`,\n dependentProperties: ['selectedElement'],\n };\n}\n","import { type IClearOperationDataOperationData } from \"../clear-operation-data.ts\";\nimport { type IOperationMetadata } from \"./types.ts\";\n\nexport function clearOperationData(): IOperationMetadata<IClearOperationDataOperationData> {\n return {\n description: `This operation removes all of the properties on the current operation date.\nOr, if the \\`properties\\` property is set only removes the properties defined by that list.`,\n category: `Data`,\n properties: {\n properties: {\n type: 'ParameterType:array',\n itemType: 'ParameterType:string',\n erased: true\n }\n },\n };\n}\n","import { type IClearStorageOperationData } from \"../clear-storage.ts\";\nimport { type IOperationMetadata } from \"./types.ts\";\n\nexport function clearStorage(): IOperationMetadata<IClearStorageOperationData> {\n return {\n description: `Clears data from browser storage (localStorage or sessionStorage).\n\nIf \\`key\\` is provided, removes only that key. If \\`key\\` is omitted, clears all storage.`,\n category: `Data`,\n properties: {\n key: {\n type: 'ParameterType:string',\n erased: true\n },\n storageType: {\n type: [\n { value: 'local' },\n { value: 'session' }\n ],\n required: true,\n erased: true\n }\n },\n };\n}\n","import { type ICompareDateOperationData } from \"../compare-date.ts\";\nimport { type IOperationMetadata } from \"./types.ts\";\n\nexport function compareDate(): IOperationMetadata<ICompareDateOperationData> {\n return {\n description: `Compares two dates.\ncomparison: -1 (before), 0 (equal), 1 (after)`,\n category: `Date`,\n properties: {\n date1: {\n type: [\n { value: 'string' },\n { value: 'number' },\n { value: 'Date' }\n ],\n required: true,\n erased: true\n },\n date2: {\n type: [\n { value: 'string' },\n { value: 'number' },\n { value: 'Date' }\n ],\n required: true,\n erased: true\n }\n },\n outputProperties: {\n comparison: {\n type: 'ParameterType:number'\n },\n isEqual: {\n type: 'ParameterType:boolean'\n },\n isBefore: {\n type: 'ParameterType:boolean'\n },\n isAfter: {\n type: 'ParameterType:boolean'\n }\n }\n };\n}\n","import { type IConcatenateStringsOperationData } from \"../concatenate-strings.ts\";\nimport { type IOperationMetadata } from \"./types.ts\";\n\nexport function concatenateStrings(): IOperationMetadata<IConcatenateStringsOperationData> {\n return {\n description: `Concatenates multiple strings with an optional separator.`,\n category: `String`,\n properties: {\n strings: {\n type: 'ParameterType:array',\n itemType: 'ParameterType:string',\n required: true,\n erased: true\n },\n separator: {\n type: 'ParameterType:string',\n erased: true\n }\n },\n outputProperties: {\n result: {\n type: 'ParameterType:string'\n }\n }\n };\n}\n","import { type IOperationMetadata } from \"./types.ts\";\n\nexport function continueForEach(): IOperationMetadata<undefined> {\n return {\n description: `\nThis operation should only be used within a loop, so between a {@link forEach} and {@link endForEach}\noperation. This operation immediately moves to the next loop index, effectively canceling the rest\nof the operations in the current iteration.`,\n category: `Control Flow`,\n };\n}\n","import { type ICreateElementOperationData, type TTagNames } from \"../create-element.ts\";\nimport { type IOperationMetadata } from \"./types.ts\";\n\nexport function createElement(): IOperationMetadata<ICreateElementOperationData<TTagNames>> {\n return {\n description: `This operation creates the DOM element described by the given elementName and attributes and assigns\nthe instance to the \\`template\\` property on the current operation data.`,\n category: `DOM`,\n properties: {\n elementName: {\n type: 'ParameterType:htmlElementName',\n required: true,\n erased: true\n },\n text: {\n type: 'ParameterType:string',\n erased: true\n },\n attributes: {\n type: 'ParameterType:object',\n erased: true\n }\n },\n outputProperties: {\n template: {\n type: 'ParameterType:object'\n }\n }\n };\n}\n","import { type ICustomFunctionOperationData } from \"../custom-function.ts\";\nimport { type IOperationMetadata } from \"./types.ts\";\n\nexport function customFunction(): IOperationMetadata<ICustomFunctionOperationData> {\n return {\n description: `This operation retrieves a custom function defined by the given system name\nand invokes it with the current operation data and eventbus.`,\n category: `Utility`,\n properties: {\n systemName: {\n type: 'ParameterType:systemName',\n required: true,\n erased: true\n }\n },\n };\n}\n","import { type IEndActionOperationData } from \"../end-action.ts\";\nimport { type IOperationMetadata } from \"./types.ts\";\n\nexport function endAction(): IOperationMetadata<IEndActionOperationData> {\n return {\n description: `This operation invokes the {@link EndableAction}.end method on the specified action instance.\n\nThe action operation data is first merged with the current operation data before it is\npassed on to the action. After the action has completed the action operation data properties\nare removed from the current operation data.`,\n category: `Action`,\n dependentProperties: ['actionInstance'],\n properties: {\n actionOperationData: {\n type: 'ParameterType:object',\n required: true,\n erased: true\n }\n },\n };\n}\n","import { type IOperationMetadata } from \"./types.ts\";\n\nexport function endForEach(): IOperationMetadata<undefined> {\n return {\n description: `This operation checks if the current loop should end or start the next iteration.`,\n category: `Control Flow`,\n };\n}\n","import { type IOperationMetadata } from \"./types.ts\";\n\nexport function endWhen(): IOperationMetadata<undefined> {\n return {\n description: `This operation cleans up after the {@link when}/{@link otherwise}/{@link endWhen} control flow ends.`,\n category: `Control Flow`,\n };\n}\n","import { type IExtendControllerOperationData } from \"../extend-controller.ts\";\nimport { type IOperationMetadata } from \"./types.ts\";\n\nexport function extendController(): IOperationMetadata<IExtendControllerOperationData> {\n return {\n description: `Extends the current controller with given extension.`,\n category: `Controller`,\n dependentProperties: ['controllerInstance'],\n properties: {\n controllerExtension: {\n type: 'ParameterType:object',\n required: true,\n erased: true\n }\n },\n };\n}\n","import { type IFilterArrayOperationData } from \"../filter-array.ts\";\nimport { type IOperationMetadata } from \"./types.ts\";\n\nexport function filterArray(): IOperationMetadata<IFilterArrayOperationData> {\n return {\n description: `Filters an array based on property equality or custom predicate function.\n\nOperates on arrayData passed from previous operations.\nSupports two filtering modes:\n1. Property equality: \\`filterProperty\\` and \\`filterValue\\` to filter by property match\n2. Custom predicate: \\`filterPredicate\\` function for complex filtering logic`,\n category: `Array`,\n dependentProperties: ['arrayData'],\n properties: {\n filterProperty: {\n type: 'ParameterType:string',\n erased: true\n },\n filterValue: {\n type: 'ParameterType:object',\n erased: true\n },\n filterPredicate: {\n type: 'ParameterType:function',\n erased: true\n }\n },\n outputProperties: {\n filteredArray: {\n type: 'ParameterType:array'\n }\n }\n };\n}\n","import { type IFindInArrayOperationData } from \"../find-in-array.ts\";\nimport { type IOperationMetadata } from \"./types.ts\";\n\nexport function findInArray(): IOperationMetadata<IFindInArrayOperationData> {\n return {\n description: `Finds the first element in an array matching criteria.\n\nOperates on arrayData passed from previous operations.\nSupports two search modes:\n1. Property equality: \\`findProperty\\` and \\`findValue\\` to find by property match\n2. Custom predicate: \\`findPredicate\\` function for complex search logic\n\nReturns \\`undefined\\` for \\`foundItem\\` and \\`-1\\` for \\`foundIndex\\` if no match found.`,\n category: `Array`,\n dependentProperties: ['arrayData'],\n properties: {\n findProperty: {\n type: 'ParameterType:string',\n erased: true\n },\n findValue: {\n type: 'ParameterType:object',\n erased: true\n },\n findPredicate: {\n type: 'ParameterType:function',\n erased: true\n }\n },\n outputProperties: {\n foundItem: {\n type: 'ParameterType:object'\n },\n foundIndex: {\n type: 'ParameterType:number'\n }\n }\n };\n}\n","import { type IForEachOperationData } from \"../for-each.ts\";\nimport { type IOperationMetadata } from \"./types.ts\";\n\nexport function forEach(): IOperationMetadata<IForEachOperationData> {\n return {\n description: `This operation iterates over the given collection.\n\nEach iteration the current item from the specified collection is\nassigned to the {@link IOperationScope.currentItem |currentItem} property on the {@link IOperationScope |operation scope}.\n\nAt the start of the loop, the associated {@link endForEach} operation is determined and when\nthe last iteration is completed the flow control is set to the index of that operation.\n\nThe {@link continueForEach |continue} and {@link breakForEach |break} operations can be used to control the\nloop iterations.`,\n category: `Control Flow`,\n properties: {\n collection: {\n type: 'ParameterType:array|ParameterType:string',\n required: true\n }\n },\n };\n}\n","import { type IFormatDateOperationData } from \"../format-date.ts\";\nimport { type IOperationMetadata } from \"./types.ts\";\n\nexport function formatDate(): IOperationMetadata<IFormatDateOperationData> {\n return {\n description: `Formats a date using Intl.DateTimeFormat or simple patterns.`,\n category: `Date`,\n dependentProperties: ['date'],\n properties: {\n format: {\n type: 'ParameterType:string',\n required: true,\n erased: true\n }\n },\n outputProperties: {\n formattedDate: {\n type: 'ParameterType:string'\n }\n }\n };\n}\n","import { type IFormatTextOperationData } from \"../format-text.ts\";\nimport { type IOperationMetadata } from \"./types.ts\";\n\nexport function formatText(): IOperationMetadata<IFormatTextOperationData> {\n return {\n description: `Transforms text using format operations: uppercase, lowercase, capitalize, titlecase, or trim.\n\nOperates on textContent passed from previous operations (e.g., getTextContent).\n\nTransformations:\n- \\`uppercase\\`: Convert all characters to uppercase\n- \\`lowercase\\`: Convert all characters to lowercase\n- \\`capitalize\\`: Capitalize only the first letter\n- \\`titlecase\\`: Capitalize first letter of each word\n- \\`trim\\`: Remove leading and trailing whitespace`,\n category: `Text`,\n dependentProperties: ['textContent'],\n properties: {\n transformation: {\n type: [\n { value: 'uppercase' },\n { value: 'lowercase' },\n { value: 'capitalize' },\n { value: 'titlecase' },\n { value: 'trim' }\n ],\n required: true,\n erased: true\n }\n },\n outputProperties: {\n formattedText: {\n type: 'ParameterType:string'\n }\n }\n };\n}\n","import { type IGetAttributesFromElementOperationData } from \"../get-attributes-from-element.ts\";\nimport { type IOperationMetadata } from \"./types.ts\";\n\nexport function getAttributesFromElement(): IOperationMetadata<IGetAttributesFromElementOperationData> {\n return {\n description: `This operation retrieves the values for the specified attribute names from the given selected element.`,\n category: `DOM`,\n dependentProperties: ['selectedElement'],\n properties: {\n attributeNames: {\n type: 'ParameterType:array',\n itemType: 'ParameterType:string',\n required: true,\n erased: true\n }\n },\n outputProperties: {\n attributeValues: {\n type: 'ParameterType:object'\n }\n }\n };\n}\n","import { type IGetControllerFromElementOperationData } from \"../get-controller-from-element.ts\";\nimport { type IOperationMetadata } from \"./types.ts\";\n\nexport function getControllerFromElement(): IOperationMetadata<IGetControllerFromElementOperationData> {\n return {\n description: `This operation retrieves the controller instance with the specified name that is assigned to the given selected element.`,\n category: `Controller`,\n dependentProperties: ['selectedElement'],\n properties: {\n controllerName: {\n type: 'ParameterType:controllerName',\n required: true,\n erased: true\n }\n },\n outputProperties: {\n controllerInstance: {\n type: 'ParameterType:object'\n }\n }\n };\n}\n","import { type IGetControllerInstanceOperationData } from \"../get-controller-instance.ts\";\nimport { type IOperationMetadata } from \"./types.ts\";\n\nexport function getControllerInstance(): IOperationMetadata<IGetControllerInstanceOperationData> {\n return {\n description: `This operation retrieves an instance of the given controller name.\nIt assigns this instance to the \\`controllerInstance\\` property on the current operation data`,\n category: `Controller`,\n properties: {\n systemName: {\n type: [\n { value: 'DOMEventListenerController' },\n { value: 'LabelController' },\n { value: 'LottieController' },\n { value: 'MutationObserverController' },\n { value: 'NavigationController' },\n { value: 'ProgressbarController' },\n { value: 'RoutingController' },\n { value: 'SubtitlesController' }\n ],\n required: true,\n erased: true\n }\n },\n outputProperties: {\n controllerInstance: {\n type: 'ParameterType:object'\n }\n }\n };\n}\n","import { type IGetCurrentTimeOperationData } from \"../get-current-time.ts\";\nimport { type IOperationMetadata } from \"./types.ts\";\n\nexport function getCurrentTime(): IOperationMetadata<IGetCurrentTimeOperationData> {\n return {\n description: `Gets the current time as timestamp and Date object.`,\n category: `Date`,\n outputProperties: {\n timestamp: {\n type: 'ParameterType:number'\n },\n date: {\n type: 'ParameterType:Date'\n }\n }\n };\n}\n","import { type IGetElementDimensionsOperationData } from \"../get-element-dimensions.ts\";\nimport { type IOperationMetadata } from \"./types.ts\";\n\nexport function getElementDimensions(): IOperationMetadata<IGetElementDimensionsOperationData> {\n return {\n description: `This operation calculates the width and height of the given selected element.\nIt assigns this struct to the dimensions property on the current operation data.\nOptionally the width and height can be modified using the given modifier string.\n\nThe modifier string is formatted in the following way:\n\n<operator><amount><optional-side><optional-precentage>|<ratio-definition>\n\nWhere the ratio modifier is formatted in the following way:\n<side>[ar=<ratio-left>-<ratio-right>]\n\nFor example, this modifier '+100h|w[ar=8-1]' will modifiy the dimensions like this:\nit will add a value of 100 to the height and modify the width by a ratio of 8 to 1 relative to the height.`,\n category: `DOM`,\n dependentProperties: ['selectedElement'],\n properties: {\n modifier: {\n type: 'ParameterType:dimensionsModifier',\n erased: true\n }\n },\n outputProperties: {\n dimensions: {\n type: 'ParameterType:object'\n }\n }\n };\n}\n","import { type IGetFocusedElementOperationData } from \"../get-focused-element.ts\";\nimport { type IOperationMetadata } from \"./types.ts\";\n\nexport function getFocusedElement(): IOperationMetadata<IGetFocusedElementOperationData> {\n return {\n description: `Gets the currently focused element.`,\n category: `Focus`,\n outputProperties: {\n focusedElement: {\n type: 'ParameterType:jQuery'\n }\n }\n };\n}\n","import { type IGetFormDataOperationData } from \"../get-form-data.ts\";\nimport { type IOperationMetadata } from \"./types.ts\";\n\nexport function getFormData(): IOperationMetadata<IGetFormDataOperationData> {\n return {\n description: `Extracts all input, select, and textarea values from form element into operation data.\n\nThis operation reads form field values and returns them as an object with field names as keys.\nOnly processes form elements that are enabled and not hidden. Handles checkboxes, radio buttons,\nselect elements, textareas, and text inputs.`,\n category: `Form`,\n dependentProperties: ['selectedElement'],\n outputProperties: {\n formData: {\n type: 'ParameterType:object'\n }\n }\n };\n}\n","import { type IGetImportOperationData } from \"../get-import.ts\";\nimport { type IOperationMetadata } from \"./types.ts\";\n\nexport function getImport(): IOperationMetadata<IGetImportOperationData> {\n return {\n description: `This operation retrieves the import specified by the given \\`systemName\\` and\nassigns it to the \\`importedInstance\\` property on the current operaton date.`,\n category: `Utility`,\n properties: {\n systemName: {\n type: 'ParameterType:systemName',\n required: true,\n erased: true\n }\n },\n outputProperties: {\n importedInstance: {\n type: 'ParameterType:object'\n }\n }\n };\n}\n","import { type IGetQueryParamsOperationData } from \"../get-query-params.ts\";\nimport { type IOperationMetadata } from \"./types.ts\";\n\nexport function getQueryParams(): IOperationMetadata<IGetQueryParamsOperationData> {\n return {\n description: `This operation retrieves the current query parameters from the browser's address bar and places\nthem on the returned operation data.`,\n category: `Utility`,\n properties: {\n defaultValues: {\n type: 'ParameterType:object',\n erased: true\n }\n },\n outputProperties: {\n queryParams: {\n type: 'ParameterType:object'\n }\n }\n };\n}\n","import { type IGetScrollPositionOperationData } from \"../get-scroll-position.ts\";\nimport { type IOperationMetadata } from \"./types.ts\";\n\nexport function getScrollPosition(): IOperationMetadata<IGetScrollPositionOperationData> {\n return {\n description: `Gets the current scroll position of the viewport.\n\nReturns x (horizontal) and y (vertical) scroll positions in pixels.\nUses cross-browser compatible methods to retrieve scroll position.`,\n category: `Scroll`,\n outputProperties: {\n scrollX: {\n type: 'ParameterType:number'\n },\n scrollY: {\n type: 'ParameterType:number'\n }\n }\n };\n}\n","import { type IGetTextContentOperationData } from \"../get-text-content.ts\";\nimport { type IOperationMetadata } from \"./types.ts\";\n\nexport function getTextContent(): IOperationMetadata<IGetTextContentOperationData> {\n return {\n description: `Extracts text content from element, stripping all HTML markup.\n\nUses jQuery's \\`.text()\\` method which is XSS-safe and returns only the text content\nwithout any HTML tags. Preserves whitespace and text from nested elements.`,\n category: `Text`,\n dependentProperties: ['selectedElement'],\n outputProperties: {\n textContent: {\n type: 'ParameterType:string'\n }\n }\n };\n}\n","import { type IHttpDeleteOperationData } from \"../http-delete.ts\";\nimport { type IOperationMetadata } from \"./types.ts\";\n\nexport function httpDelete(): IOperationMetadata<IHttpDeleteOperationData> {\n return {\n description: `Performs an HTTP DELETE request to the specified URL.`,\n category: `HTTP`,\n properties: {\n url: {\n type: 'ParameterType:string',\n required: true,\n erased: true\n },\n headers: {\n type: 'ParameterType:object',\n erased: true\n }\n },\n outputProperties: {\n response: {\n type: 'ParameterType:object'\n },\n status: {\n type: 'ParameterType:number'\n }\n }\n };\n}\n","import { type IHttpPostOperationData } from \"../http-post.ts\";\nimport { type IOperationMetadata } from \"./types.ts\";\n\nexport function httpPost(): IOperationMetadata<IHttpPostOperationData> {\n return {\n description: `Performs an HTTP POST request to the specified URL.`,\n category: `HTTP`,\n properties: {\n url: {\n type: 'ParameterType:string',\n required: true,\n erased: true\n },\n body: {\n type: 'ParameterType:object',\n erased: true\n },\n headers: {\n type: 'ParameterType:object',\n erased: true\n }\n },\n outputProperties: {\n response: {\n type: 'ParameterType:object'\n },\n status: {\n type: 'ParameterType:number'\n }\n }\n };\n}\n","import { type IHttpPutOperationData } from \"../http-put.ts\";\nimport { type IOperationMetadata } from \"./types.ts\";\n\nexport function httpPut(): IOperationMetadata<IHttpPutOperationData> {\n return {\n description: `Performs an HTTP PUT request to the specified URL.`,\n category: `HTTP`,\n properties: {\n url: {\n type: 'ParameterType:string',\n required: true,\n erased: true\n },\n body: {\n type: 'ParameterType:object',\n erased: true\n },\n headers: {\n type: 'ParameterType:object',\n erased: true\n }\n },\n outputProperties: {\n response: {\n type: 'ParameterType:object'\n },\n status: {\n type: 'ParameterType:number'\n }\n }\n };\n}\n","import { type IInvokeObjectMethodOperationData } from \"../invoke-object-method.ts\";\nimport { type IOperationMetadata } from \"./types.ts\";\n\nexport function invokeObjectMethod(): IOperationMetadata<IInvokeObjectMethodOperationData> {\n return {\n description: `This operation invokes the specified method on the given object with the given optional arguments\nand assigns the result to the \\`methodResult\\` operationdata property.`,\n category: `Utility`,\n dependentProperties: ['instance'],\n properties: {\n methodName: {\n type: 'ParameterType:string',\n required: true,\n erased: true\n },\n methodArguments: {\n type: 'ParameterType:array',\n erased: true\n }\n },\n outputProperties: {\n methodResult: {\n type: 'ParameterType:object'\n }\n }\n };\n}\n","import { type IIsElementInViewportOperationData } from \"../is-element-in-viewport.ts\";\nimport { type IOperationMetadata } from \"./types.ts\";\n\nexport function isElementInViewport(): IOperationMetadata<IIsElementInViewportOperationData> {\n return {\n description: `Checks if an element is currently visible within the viewport.\n\nUses \\`getBoundingClientRect()\\` to determine if the element is within the viewport boundaries.`,\n category: `DOM`,\n dependentProperties: ['selectedElement'],\n outputProperties: {\n isInViewport: {\n type: 'ParameterType:boolean'\n }\n }\n };\n}\n","import { type ILoadFromStorageOperationData } from \"../load-from-storage.ts\";\nimport { type IOperationMetadata } from \"./types.ts\";\n\nexport function loadFromStorage(): IOperationMetadata<ILoadFromStorageOperationData> {\n return {\n description: `Loads data from browser storage (localStorage or sessionStorage).\n\nDeserializes the stored JSON value. Returns \\`null\\` if key doesn't exist.`,\n category: `Data`,\n properties: {\n key: {\n type: 'ParameterType:string',\n required: true,\n erased: true\n },\n storageType: {\n type: [\n { value: 'local' },\n { value: 'session' }\n ],\n required: true,\n erased: true\n }\n },\n outputProperties: {\n loadedValue: {\n type: 'ParameterType:object'\n }\n }\n };\n}\n","import { type ILoadJSONOperationData } from \"../load-json.ts\";\nimport { type IOperationMetadata } from \"./types.ts\";\n\nexport function loadJson(): IOperationMetadata<ILoadJSONOperationData> {\n return {\n description: `This operation loads a JSON file from the specified url and assigns it to the json\nproperty on the current operation data.\n\nIf the cache property is set to true and a cached value already exists, this is assigned\ninstead of re-retrieving it from the url.`,\n category: `Utility`,\n properties: {\n url: {\n type: 'ParameterType:string',\n required: true,\n erased: true\n },\n cache: {\n type: 'ParameterType:boolean',\n erased: true\n }\n },\n outputProperties: {\n json: {\n type: 'ParameterType:object'\n }\n }\n };\n}\n","import { type ILogOperationData } from \"../log.ts\";\nimport { type IOperationMetadata } from \"./types.ts\";\n\nexport function log(): IOperationMetadata<ILogOperationData> {\n return {\n description: `This operation logs the specified value, or, when no logValue property has been assigned\nit will log the current operation data, global data and scope to the console`,\n category: `Utility`,\n properties: {\n logValue: {\n type: 'ParameterType:object|ParameterType:string|ParameterType:number|ParameterType:boolean|ParameterType:array',\n erased: true\n },\n logName: {\n type: 'ParameterType:string',\n erased: true\n }\n },\n };\n}\n","import { type IMapArrayOperationData } from \"../map-array.ts\";\nimport { type IOperationMetadata } from \"./types.ts\";\n\nexport function mapArray(): IOperationMetadata<IMapArrayOperationData> {\n return {\n description: `Transforms each element of an array using a mapping function.\n\nOperates on arrayData passed from previous operations.\nThe mapFunction receives each item and optionally its index.`,\n category: `Array`,\n dependentProperties: ['arrayData'],\n properties: {\n mapFunction: {\n type: 'ParameterType:function',\n required: true,\n erased: true\n }\n },\n outputProperties: {\n mappedArray: {\n type: 'ParameterType:array'\n }\n }\n };\n}\n","import { type IMathOperationData } from \"../math.ts\";\nimport { type IOperationMetadata } from \"./types.ts\";\n\nexport function math(): IOperationMetadata<IMathOperationData> {\n return {\n description: `This operation performs the given math function with the specified arguments.`,\n category: `Utility`,\n properties: {\n args: {\n type: 'ParameterType:array',\n required: true,\n erased: true\n },\n functionName: {\n type: 'ParameterType:mathfunction',\n required: true,\n erased: true\n }\n },\n outputProperties: {\n mathResult: {\n type: 'ParameterType:number'\n }\n }\n };\n}\n","import { type IOperationMetadata } from \"./types.ts\";\n\nexport function otherwise(): IOperationMetadata<undefined> {\n return {\n description: `If the preceeding {@link when} operation evaluates to \\`true\\` subsequent operations will\nbe skipped until an {@link endWhen} operation is encountered.`,\n category: `Control Flow`,\n };\n}\n","import { type IRemoveClassOperationData } from \"../remove-class.ts\";\nimport { type IOperationMetadata } from \"./types.ts\";\n\nexport function removeClass(): IOperationMetadata<IRemoveClassOperationData> {\n return {\n description: `This operation removes the spcified class name from the given selected element.`,\n category: `DOM`,\n dependentProperties: ['selectedElement'],\n properties: {\n className: {\n type: 'ParameterType:className',\n required: true,\n erased: true\n }\n },\n };\n}\n","import { type IRemoveControllerFromElementOperationData } from \"../remove-controller-from-element.ts\";\nimport { type IOperationMetadata } from \"./types.ts\";\n\nexport function removeControllerFromElement(): IOperationMetadata<IRemoveControllerFromElementOperationData> {\n return {\n description: `This operation removes the controller with the specified name from the given selected element.`,\n category: `Controller`,\n dependentProperties: ['selectedElement'],\n properties: {\n controllerName: {\n type: 'ParameterType:controllerName',\n required: true,\n erased: true\n }\n },\n };\n}\n","import { type IRemoveElementOperationData } from \"../remove-element.ts\";\nimport { type IOperationMetadata } from \"./types.ts\";\n\nexport function removeElement(): IOperationMetadata<IRemoveElementOperationData> {\n return {\n description: `This operation removes the given selected element from the DOM.`,\n category: `DOM`,\n dependentProperties: ['selectedElement'],\n };\n}\n","import { type IRemovePropertiesFromOperationDataOperationData } from \"../remove-properties-from-operation-data.ts\";\nimport { type IOperationMetadata } from \"./types.ts\";\n\nexport function removePropertiesFromOperationData(): IOperationMetadata<IRemovePropertiesFromOperationDataOperationData> {\n return {\n description: `This operation removes the given list of properties from the current operation data.\nIt will also remove the property \\`propertyNames\\` from the result.`,\n category: `Data`,\n properties: {\n propertyNames: {\n type: 'ParameterType:array',\n itemType: 'ParameterType:string',\n required: true,\n erased: true\n }\n },\n };\n}\n","import { type IReparentElementOperationData } from \"../reparent-element.ts\";\nimport { type IOperationMetadata } from \"./types.ts\";\n\nexport function reparentElement(): IOperationMetadata<IReparentElementOperationData> {\n return {\n description: `This operation moves the given selected element to the new parent that is defined\nby the specified \\`newParentSelector\\`.`,\n category: `DOM`,\n dependentProperties: ['selectedElement'],\n properties: {\n newParentSelector: {\n type: 'ParameterType:selector',\n required: true,\n erased: true\n }\n },\n };\n}\n","import { type IReplaceStringOperationData } from \"../replace-string.ts\";\nimport { type IOperationMetadata } from \"./types.ts\";\n\nexport function replaceString(): IOperationMetadata<IReplaceStringOperationData> {\n return {\n description: `Replaces occurrences of a pattern in a string (alias for replaceText for string context).`,\n category: `String`,\n dependentProperties: ['textContent'],\n properties: {\n pattern: {\n type: [\n { value: 'string' },\n { value: 'RegExp' }\n ],\n required: true,\n erased: true\n },\n replacement: {\n type: 'ParameterType:string',\n required: true,\n erased: true\n }\n },\n outputProperties: {\n result: {\n type: 'ParameterType:string'\n }\n }\n };\n}\n","import { type IReplaceTextOperationData } from \"../replace-text.ts\";\nimport { type IOperationMetadata } from \"./types.ts\";\n\nexport function replaceText(): IOperationMetadata<IReplaceTextOperationData> {\n return {\n description: `Finds and replaces text using literal string or regex pattern.\n\nOperates on textContent passed from previous operations (e.g., getTextContent).\nSupports regex patterns with global flag for multiple replacements.\nUpdates textContent with replaced text and sets replacementCount.`,\n category: `Text`,\n dependentProperties: ['textContent'],\n properties: {\n searchPattern: {\n type: [\n { value: 'string' },\n { value: 'RegExp' }\n ],\n required: true,\n erased: true\n },\n replacement: {\n type: 'ParameterType:string',\n required: true,\n erased: true\n }\n },\n outputProperties: {\n replacementCount: {\n type: 'ParameterType:number'\n }\n }\n };\n}\n","import { type IRequestActionOperationData } from \"../request-action.ts\";\nimport { type IOperationMetadata } from \"./types.ts\";\n\nexport function requestAction(): IOperationMetadata<IRequestActionOperationData> {\n return {\n description: `This operation requests an action instance with the specified name and assigns it\nto the \\`actionInstance\\` property on the current operation data.`,\n category: `Action`,\n properties: {\n systemName: {\n type: 'ParameterType:actionName',\n required: true,\n erased: true\n }\n },\n outputProperties: {\n actionInstance: {\n type: 'ParameterType:object'\n }\n }\n };\n}\n","import { type ISaveToStorageOperationData } from \"../save-to-storage.ts\";\nimport { type IOperationMetadata } from \"./types.ts\";\n\nexport function saveToStorage(): IOperationMetadata<ISaveToStorageOperationData> {\n return {\n description: `Saves data to browser storage (localStorage or sessionStorage).\n\nSerializes the value as JSON before storing. Supports any JSON-serializable data type.`,\n category: `Data`,\n properties: {\n key: {\n type: 'ParameterType:string',\n required: true,\n erased: true\n },\n value: {\n type: 'ParameterType:object',\n required: true,\n erased: true\n },\n storageType: {\n type: [\n { value: 'local' },\n { value: 'session' }\n ],\n required: true,\n erased: true\n }\n },\n };\n}\n","import { type IScrollToElementOperationData } from \"../scroll-to-element.ts\";\nimport { type IOperationMetadata } from \"./types.ts\";\n\nexport function scrollToElement(): IOperationMetadata<IScrollToElementOperationData> {\n return {\n description: `Scrolls the viewport to bring the selected element into view.\n\nUses the browser's \\`scrollIntoView\\` API with configurable behavior.`,\n category: `Scroll`,\n dependentProperties: ['selectedElement'],\n properties: {\n behavior: {\n type: [\n { value: 'auto' },\n { value: 'smooth' }\n ],\n erased: true\n },\n block: {\n type: [\n { value: 'start' },\n { value: 'center' },\n { value: 'end' },\n { value: 'nearest' }\n ],\n erased: true\n },\n inline: {\n type: [\n { value: 'start' },\n { value: 'center' },\n { value: 'end' },\n { value: 'nearest' }\n ],\n erased: true\n }\n },\n };\n}\n","import { type IScrollToPositionOperationData } from \"../scroll-to-position.ts\";\nimport { type IOperationMetadata } from \"./types.ts\";\n\nexport function scrollToPosition(): IOperationMetadata<IScrollToPositionOperationData> {\n return {\n description: `Scrolls the viewport to a specific x,y coordinate position.\n\nUses the browser's \\`window.scrollTo\\` API with configurable behavior.`,\n category: `Scroll`,\n properties: {\n x: {\n type: 'ParameterType:number',\n required: true,\n erased: true\n },\n y: {\n type: 'ParameterType:number',\n required: true,\n erased: true\n },\n behavior: {\n type: [\n { value: 'auto' },\n { value: 'smooth' }\n ],\n erased: true\n }\n },\n };\n}\n","import { type ISelectElementOperationData } from \"../select-element.ts\";\nimport { type IOperationMetadata } from \"./types.ts\";\n\nexport function selectElement(): IOperationMetadata<ISelectElementOperationData> {\n return {\n description: `This operation selects one or more elements using the specified selector.\n\nIf \\`useSelectedElementAsRoot\\` is set to true and a valid DOM element is assigned\nto the current operation data's \\`selectedElement\\` property\nthen the element will be looked for only in the descendant elements of this DOM element.`,\n category: `DOM`,\n properties: {\n selector: {\n type: 'ParameterType:selector',\n required: true,\n erased: true\n },\n useSelectedElementAsRoot: {\n type: 'ParameterType:boolean',\n erased: true\n }\n },\n outputProperties: {\n selectedElement: {\n type: 'ParameterType:object'\n }\n }\n };\n}\n","import { type ISetDataOperationData } from \"../set-data.ts\";\nimport { type IOperationMetadata } from \"./types.ts\";\n\nexport function setData(): IOperationMetadata<ISetDataOperationData> {\n return {\n description: `This operation assigns the specified properties to the specified data targets.`,\n category: `Data`,\n properties: {\n properties: {\n type: 'ParameterType:object',\n required: true,\n erased: true\n }\n },\n };\n}\n","import { type ISetElementAttributesOperationData } from \"../set-element-attributes.ts\";\nimport { type IOperationMetadata } from \"./types.ts\";\n\nexport function setElementAttributes(): IOperationMetadata<ISetElementAttributesOperationData> {\n return {\n description: `This operation sets the specified set of attributes on the given selected element.`,\n category: `DOM`,\n dependentProperties: ['selectedElement'],\n properties: {\n attributes: {\n type: 'ParameterType:object',\n required: true,\n erased: true\n }\n },\n };\n}\n","import { type ISetElementContentOperationData } from \"../set-element-content.ts\";\nimport { type IOperationMetadata } from \"./types.ts\";\n\nexport function setElementContent(): IOperationMetadata<ISetElementContentOperationData> {\n return {\n description: `This operation sets the specified content defined by the value assigned to the template property\nto the given selected element.\n\nWhen the \\`insertionType\\` is set to \\`overwrite\\` the contents of the selected element are replaced\nby the given template.\nWhen set to \\`append\\` the new content will be inserted after the current content.\nWhen set to \\`prepend\\` the new content will be inserted before the current content.`,\n category: `DOM`,\n dependentProperties: ['selectedElement'],\n properties: {\n template: {\n type: [\n { value: 'string' },\n { value: 'Element' },\n { value: 'Text' },\n { value: 'Comment' },\n { value: 'Document' },\n { value: 'DocumentFragment' }\n ],\n erased: true\n },\n insertionType: {\n type: [\n { value: 'overwrite' },\n { value: 'append' },\n { value: 'prepend' }\n ],\n erased: true\n }\n },\n };\n}\n","import { type ISetFocusOperationData } from \"../set-focus.ts\";\nimport { type IOperationMetadata } from \"./types.ts\";\n\nexport function setFocus(): IOperationMetadata<ISetFocusOperationData> {\n return {\n description: `Sets focus to the selected element.`,\n category: `Focus`,\n dependentProperties: ['selectedElement'],\n };\n}\n","import { type ISetFormValueOperationData } from \"../set-form-value.ts\";\nimport { type IOperationMetadata } from \"./types.ts\";\n\nexport function setFormValue(): IOperationMetadata<ISetFormValueOperationData> {\n return {\n description: `Sets the value of an input, select, or textarea element.\n\nHandles different input types appropriately:\n- Text inputs, textareas, selects: sets value directly\n- Checkboxes: sets checked property for boolean values\n- Radio buttons: sets checked property for boolean values\n- Number inputs: converts to string`,\n category: `Form`,\n dependentProperties: ['selectedElement'],\n properties: {\n value: {\n type: [\n { value: 'string' },\n { value: 'number' },\n { value: 'false' },\n { value: 'true' }\n ],\n required: true,\n erased: true\n }\n },\n };\n}\n","import { type ISetGlobalDataOperationData } from \"../set-global-data.ts\";\nimport { type IOperationMetadata } from \"./types.ts\";\n\nexport function setGlobalData(): IOperationMetadata<ISetGlobalDataOperationData> {\n return {\n description: `This operation copies the specified properties from the operationData to the global data.`,\n category: `Data`,\n properties: {\n propertyNames: {\n type: 'ParameterType:array',\n itemType: 'ParameterType:string',\n required: true,\n erased: true\n }\n },\n };\n}\n","import { type ISetOperationData } from \"../set-operation-data.ts\";\nimport { type IOperationMetadata } from \"./types.ts\";\n\nexport function setOperationData(): IOperationMetadata<ISetOperationData> {\n return {\n description: `This operation assigns the specified properties to the current operation data.\nWhen override is set to true the properties replace the current operation data entirely.`,\n category: `Data`,\n properties: {\n override: {\n type: 'ParameterType:boolean',\n erased: true\n },\n properties: {\n type: 'ParameterType:object',\n required: true,\n erased: true\n }\n },\n };\n}\n","import { type ISetStyleOperationData } from \"../set-style.ts\";\nimport { type IOperationMetadata } from \"./types.ts\";\n\nexport function setStyle(): IOperationMetadata<ISetStyleOperationData> {\n return {\n description: `This operation assigns the specified CSS style properties to the\ngiven selected element.`,\n category: `DOM`,\n dependentProperties: ['selectedElement'],\n properties: {\n properties: {\n type: 'ParameterType:cssProperties',\n required: true,\n erased: true\n }\n },\n };\n}\n","import { type ISetVariableOperationData } from \"../set-variable.ts\";\nimport { type IOperationMetadata } from \"./types.ts\";\n\nexport function setVariable(): IOperationMetadata<ISetVariableOperationData> {\n return {\n description: `This operation sets a variable with the specified name on the scope with the specified value.`,\n category: `Data`,\n properties: {\n name: {\n type: 'ParameterType:string',\n required: true,\n erased: true\n },\n value: {\n type: 'ParameterType:object|ParameterType:string|ParameterType:number|ParameterType:boolean|ParameterType:array',\n required: true,\n erased: true\n }\n },\n };\n}\n","import { type ISortArrayOperationData } from \"../sort-array.ts\";\nimport { type IOperationMetadata } from \"./types.ts\";\n\nexport function sortArray(): IOperationMetadata<ISortArrayOperationData> {\n return {\n description: `Sorts an array by property, natural order, or custom comparator function.\n\nOperates on arrayData passed from previous operations.\nSupports three sorting modes:\n1. Property sort: \\`sortProperty\\` and \\`sortOrder\\` to sort objects by property\n2. Natural sort: \\`sortOrder\\` alone for primitive arrays\n3. Custom comparator: \\`sortComparator\\` function for complex sorting logic`,\n category: `Array`,\n dependentProperties: ['arrayData'],\n properties: {\n sortProperty: {\n type: 'ParameterType:string',\n erased: true\n },\n sortOrder: {\n type: [\n { value: 'asc' },\n { value: 'desc' }\n ],\n erased: true\n },\n sortComparator: {\n type: 'ParameterType:function',\n erased: true\n }\n },\n outputProperties: {\n sortedArray: {\n type: 'ParameterType:array'\n }\n }\n };\n}\n","import { type ISplitStringOperationData } from \"../split-string.ts\";\nimport { type IOperationMetadata } from \"./types.ts\";\n\nexport function splitString(): IOperationMetadata<ISplitStringOperationData> {\n return {\n description: `Splits a string into an array by delimiter (string or regex).`,\n category: `String`,\n dependentProperties: ['textContent'],\n properties: {\n delimiter: {\n type: [\n { value: 'string' },\n { value: 'RegExp' }\n ],\n required: true,\n erased: true\n },\n limit: {\n type: 'ParameterType:number',\n erased: true\n }\n },\n outputProperties: {\n resultArray: {\n type: 'ParameterType:array',\n itemType: 'ParameterType:string'\n }\n }\n };\n}\n","import { type IStartActionOperationData } from \"../start-action.ts\";\nimport { type IOperationMetadata } from \"./types.ts\";\n\nexport function startAction(): IOperationMetadata<IStartActionOperationData> {\n return {\n description: `This operation starts the specified action instance using the given action operation data.\n\nThe action operation data is first merged with the current operation data before it is\npassed on to the action. After the action has completed the action operation data properties\nare removed from the current operation data.`,\n category: `Action`,\n dependentProperties: ['actionInstance'],\n properties: {\n actionOperationData: {\n type: 'ParameterType:object',\n erased: true\n }\n },\n };\n}\n","import { type ISubstringTextOperationData } from \"../substring-text.ts\";\nimport { type IOperationMetadata } from \"./types.ts\";\n\nexport function substringText(): IOperationMetadata<ISubstringTextOperationData> {\n return {\n description: `Extracts a substring from text between start and end indices.`,\n category: `Text`,\n dependentProperties: ['textContent'],\n properties: {\n start: {\n type: 'ParameterType:number',\n required: true,\n erased: true\n },\n end: {\n type: 'ParameterType:number',\n erased: true\n }\n },\n outputProperties: {\n substring: {\n type: 'ParameterType:string'\n }\n }\n };\n}\n","import { type IToggleClassOperationData } from \"../toggle-class.ts\";\nimport { type IOperationMetadata } from \"./types.ts\";\n\nexport function toggleClass(): IOperationMetadata<IToggleClassOperationData> {\n return {\n description: `This operation toggles the specfied class name on the given selected element.\n\nMeaning, if the specified class name exists on the given element it will be removed,\notherwise it will be added.`,\n category: `DOM`,\n dependentProperties: ['selectedElement'],\n properties: {\n className: {\n type: 'ParameterType:className',\n required: true,\n erased: true\n }\n },\n };\n}\n","import { type IToggleElementOperationData } from \"../toggle-element.ts\";\nimport { type IOperationMetadata } from \"./types.ts\";\n\nexport function toggleElement(): IOperationMetadata<IToggleElementOperationData> {\n return {\n description: `This operation toggles the visibility of the given selected element.\n\nMeaning, if the element is hidden, it will be made visible, otherwise\nit will be hidden.`,\n category: `DOM`,\n dependentProperties: ['selectedElement'],\n };\n}\n","import { type IToggleFormElementOperationData } from \"../toggle-form-element.ts\";\nimport { type IOperationMetadata } from \"./types.ts\";\n\nexport function toggleFormElement(): IOperationMetadata<IToggleFormElementOperationData> {\n return {\n description: `Enables or disables form input elements (inputs, selects, textareas, buttons).\n\nSets the \\`disabled\\` property on the element. When \\`enabled\\` is true, removes the disabled\nattribute; when false, adds the disabled attribute.`,\n category: `Form`,\n dependentProperties: ['selectedElement'],\n properties: {\n enabled: {\n type: 'ParameterType:boolean',\n required: true,\n erased: true\n }\n },\n };\n}\n","import { type IValidateFormOperationData } from \"../validate-form.ts\";\nimport { type IOperationMetadata } from \"./types.ts\";\n\nexport function validateForm(): IOperationMetadata<IValidateFormOperationData> {\n return {\n description: `Validates form fields against HTML5 validation and custom rules.\n\nUses HTML5 validation API (checkValidity()) for native validation, and supports\ncustom validation rules for: required, minLength, maxLength, pattern (regex), and email format.`,\n category: `Form`,\n dependentProperties: ['selectedElement'],\n properties: {\n validationRules: {\n type: 'ParameterType:object',\n erased: true\n }\n },\n outputProperties: {\n validationErrors: {\n type: 'ParameterType:object'\n },\n isValid: {\n type: 'ParameterType:boolean'\n }\n }\n };\n}\n","import { type IWaitOperationData } from \"../wait.ts\";\nimport { type IOperationMetadata } from \"./types.ts\";\n\nexport function wait(): IOperationMetadata<IWaitOperationData> {\n return {\n description: `This operation waits for the specified amount of milliseconds.`,\n category: `Utility`,\n properties: {\n milliseconds: {\n type: 'ParameterType:number',\n required: true,\n erased: true\n }\n },\n };\n}\n","import { type IWhenOperationData } from \"../when.ts\";\nimport { type IOperationMetadata } from \"./types.ts\";\n\nexport function when(): IOperationMetadata<IWhenOperationData> {\n return {\n description: `When the given expression evaluates to false, subsequent operations will be skipped\nuntil an {@link endWhen} or {@link otherwise} operation is encountered.\n\nPractically, this means an \\`if\\` or \\`if\\`/\\`else\\` statement control flow implementation in a list of operations.\n\nThe expression is passed in as a formatted string.\nThe left and right values of the expression can be defined like this:\n\n'constant': for a constant string\n100: for a constant number\n$operationData.foo: for an operation data value\n$globaldata.foo: for a global data value\n$scope.loopIndex: for a scope value`,\n category: `Control Flow`,\n properties: {\n expression: {\n type: 'ParameterType:expression',\n required: true,\n erased: true\n }\n },\n };\n}\n","export { addClass } from \"./add-class.ts\";\nexport { addControllerToElement } from \"./add-controller-to-element.ts\";\nexport { addGlobalsToOperation } from \"./add-globals-to-operation.ts\";\nexport { animateWithClass } from \"./animate-with-class.ts\";\nexport { animate } from \"./animate.ts\";\nexport { announceToScreenReader } from \"./announce-to-screen-reader.ts\";\nexport { breakForEach } from \"./break-for-each.ts\";\nexport { broadcastEvent } from \"./broadcast-event.ts\";\nexport { calc } from \"./calc.ts\";\nexport { clearElement } from \"./clear-element.ts\";\nexport { clearOperationData } from \"./clear-operation-data.ts\";\nexport { clearStorage } from \"./clear-storage.ts\";\nexport { compareDate } from \"./compare-date.ts\";\nexport { concatenateStrings } from \"./concatenate-strings.ts\";\nexport { continueForEach } from \"./continue-for-each.ts\";\nexport { createElement } from \"./create-element.ts\";\nexport { customFunction } from \"./custom-function.ts\";\nexport { endAction } from \"./end-action.ts\";\nexport { endForEach } from \"./end-for-each.ts\";\nexport { endWhen } from \"./end-when.ts\";\nexport { extendController } from \"./extend-controller.ts\";\nexport { filterArray } from \"./filter-array.ts\";\nexport { findInArray } from \"./find-in-array.ts\";\nexport { forEach } from \"./for-each.ts\";\nexport { formatDate } from \"./format-date.ts\";\nexport { formatText } from \"./format-text.ts\";\nexport { getAttributesFromElement } from \"./get-attributes-from-element.ts\";\nexport { getControllerFromElement } from \"./get-controller-from-element.ts\";\nexport { getControllerInstance } from \"./get-controller-instance.ts\";\nexport { getCurrentTime } from \"./get-current-time.ts\";\nexport { getElementDimensions } from \"./get-element-dimensions.ts\";\nexport { getFocusedElement } from \"./get-focused-element.ts\";\nexport { getFormData } from \"./get-form-data.ts\";\nexport { getImport } from \"./get-import.ts\";\nexport { getQueryParams } from \"./get-query-params.ts\";\nexport { getScrollPosition } from \"./get-scroll-position.ts\";\nexport { getTextContent } from \"./get-text-content.ts\";\nexport { httpDelete } from \"./http-delete.ts\";\nexport { httpPost } from \"./http-post.ts\";\nexport { httpPut } from \"./http-put.ts\";\nexport { invokeObjectMethod } from \"./invoke-object-method.ts\";\nexport { isElementInViewport } from \"./is-element-in-viewport.ts\";\nexport { loadFromStorage } from \"./load-from-storage.ts\";\nexport { loadJson } from \"./load-json.ts\";\nexport { log } from \"./log.ts\";\nexport { mapArray } from \"./map-array.ts\";\nexport { math } from \"./math.ts\";\nexport { otherwise } from \"./otherwise.ts\";\nexport { removeClass } from \"./remove-class.ts\";\nexport { removeControllerFromElement } from \"./remove-controller-from-element.ts\";\nexport { removeElement } from \"./remove-element.ts\";\nexport { removePropertiesFromOperationData } from \"./remove-properties-from-operation-data.ts\";\nexport { reparentElement } from \"./reparent-element.ts\";\nexport { replaceString } from \"./replace-string.ts\";\nexport { replaceText } from \"./replace-text.ts\";\nexport { requestAction } from \"./request-action.ts\";\nexport { saveToStorage } from \"./save-to-storage.ts\";\nexport { scrollToElement } from \"./scroll-to-element.ts\";\nexport { scrollToPosition } from \"./scroll-to-position.ts\";\nexport { selectElement } from \"./select-element.ts\";\nexport { setData } from \"./set-data.ts\";\nexport { setElementAttributes } from \"./set-element-attributes.ts\";\nexport { setElementContent } from \"./set-element-content.ts\";\nexport { setFocus } from \"./set-focus.ts\";\nexport { setFormValue } from \"./set-form-value.ts\";\nexport { setGlobalData } from \"./set-global-data.ts\";\nexport { setOperationData } from \"./set-operation-data.ts\";\nexport { setStyle } from \"./set-style.ts\";\nexport { setVariable } from \"./set-variable.ts\";\nexport { sortArray } from \"./sort-array.ts\";\nexport { splitString } from \"./split-string.ts\";\nexport { startAction } from \"./start-action.ts\";\nexport { substringText } from \"./substring-text.ts\";\nexport { toggleClass } from \"./toggle-class.ts\";\nexport { toggleElement } from \"./toggle-element.ts\";\nexport { toggleFormElement } from \"./toggle-form-element.ts\";\nexport { validateForm } from \"./validate-form.ts\";\nexport { wait } from \"./wait.ts\";\nexport { when } from \"./when.ts\";\nexport * from \"./types.ts\";\n","import type {TControllerName, TOperationName} from 'configuration/types.ts';\r\nimport * as controllers from '../../controllers/index.ts';\r\nimport type {EventName} from '../../eventbus/events/types.ts';\r\nimport * as operations from '../../operation/index.ts';\r\nimport * as operationMetadata from '../../operation/metadata/index.ts';\r\nimport type {IOperationMetadata} from '../../operation/metadata/types.ts';\r\n\r\n/**\r\n *\r\n * Provider for all the available operation names\r\n *\r\n */\r\nexport class OperationNamesProvider {\r\n getOperationNames(): TOperationName {\r\n return Object.keys(operations) as unknown as TOperationName;\r\n }\r\n}\r\n\r\n/**\r\n *\r\n * Provider for all the available controller names\r\n *\r\n */\r\nexport class ControllerNamesProvider {\r\n getControllerNames(): TControllerName {\r\n return Object.keys(controllers) as unknown as TControllerName;\r\n }\r\n}\r\n\r\n/**\r\n *\r\n * Provider that can retrieve the metadata associated with a given operation name\r\n *\r\n */\r\nexport class OperationMetadataProvider {\r\n getOperationMetadata(operationName: TOperationName) {\r\n const getMetadata = (\r\n operationMetadata as Record<\r\n TOperationName,\r\n () => IOperationMetadata<operations.TOperationData>\r\n >\r\n )[operationName];\r\n if (!getMetadata) {\r\n throw new Error(\r\n `Could not find metadata for operation called ${operationName}`\r\n );\r\n }\r\n return getMetadata();\r\n }\r\n}\r\n\r\n/**\r\n *\r\n * Provider for all the available event names\r\n *\r\n */\r\nexport class TimeLineEventNamesProvider {\r\n getEventNames() {\r\n return [\r\n 'timeline-play-toggle-request',\r\n 'timeline-play-request',\r\n 'timeline-stop-request',\r\n 'timeline-pause-request',\r\n 'timeline-seek-request',\r\n 'timeline-resize-request',\r\n 'timeline-container-request',\r\n 'timeline-duration-request',\r\n 'timeline-request-current-timeline',\r\n 'timeline-duration',\r\n 'timeline-time',\r\n 'timeline-seeked',\r\n 'timeline-complete',\r\n 'timeline-restart',\r\n 'timeline-play',\r\n 'timeline-stop',\r\n 'timeline-pause',\r\n 'timeline-seek',\r\n 'timeline-resize',\r\n 'timeline-current-timeline-change',\r\n 'timeline-firstframe',\r\n 'request-instance',\r\n 'request-action',\r\n 'request-function',\r\n 'request-timeline-uri',\r\n 'before-request-timeline-uri',\r\n 'request-engine-root',\r\n 'request-current-timeline-position',\r\n 'request-timeline-cleanup',\r\n 'request-label-collection',\r\n 'request-label-collections',\r\n 'request-current-language',\r\n 'language-change',\r\n 'dom-mutation',\r\n ] as unknown as EventName[];\r\n }\r\n}\r\n","import type {IStrictDuration, ISubtitle} from '../../types.ts';\r\n\r\n/**\r\n * This class converts an AVID subtitle file to an `ISubtitle` array.\r\n */\r\nexport class SubtitleImporter {\r\n importSubtitles(rawLines: string[]): ISubtitle[] {\r\n const result: ISubtitle[] = [];\r\n const lines: string[] = [];\r\n for (let i: number = 0, l: number = rawLines.length; i < l; i++) {\r\n const rawLine: string = this.stripNewlineChars(rawLines[i].toString());\r\n if (this.isValidLine(rawLine)) {\r\n lines.push(rawLine);\r\n }\r\n }\r\n if (lines[0] === '') {\r\n lines.splice(0, 1);\r\n }\r\n while (lines[lines.length - 1] === '') {\r\n lines.pop();\r\n }\r\n let caption: Partial<ISubtitle> | null = null;\r\n lines.forEach((line: string) => {\r\n if (line.length === 0 || !caption) {\r\n caption = {text: ''};\r\n if (line.length) {\r\n //this happens for first caption only\r\n caption.duration = this.convertDuration(line);\r\n }\r\n result.push(caption as ISubtitle);\r\n } else {\r\n if (!Object.hasOwn(caption, 'duration')) {\r\n caption.duration = this.convertDuration(line);\r\n } else {\r\n caption.text += line;\r\n }\r\n }\r\n });\r\n return result;\r\n }\r\n\r\n stripNewlineChars(str: string): string {\r\n let res: string = '';\r\n for (let i: number = 0, l: number = str.length; i < l; i++) {\r\n if (str.charCodeAt(i) !== 13 && str.charCodeAt(i) !== 0) {\r\n res += str.charAt(i);\r\n }\r\n }\r\n return res;\r\n }\r\n\r\n isValidLine(line: string): boolean {\r\n return (\r\n !line.startsWith('@') &&\r\n !line.startsWith('<begin subtitles>') &&\r\n !line.startsWith('<end subtitles>')\r\n );\r\n }\r\n\r\n convertDuration(time: string): IStrictDuration {\r\n const times: string[] = time.split(' ');\r\n return {\r\n start: this.convertTimeToSeconds(times[0]),\r\n end: this.convertTimeToSeconds(times[1]),\r\n };\r\n }\r\n\r\n convertTimeToSeconds(time: string): number {\r\n const parts: string[] = time.split(':');\r\n return (\r\n parseInt(parts[0], 10) * 3600 +\r\n parseInt(parts[1], 10) * 60 +\r\n parseInt(parts[2], 10)\r\n );\r\n }\r\n}\r\n","import {v4 as uuidv4} from 'uuid';\r\nimport type {\r\n IStrictDuration,\r\n ISubtitle,\r\n ISubtitleCollection,\r\n TLanguageCode,\r\n} from '../../types.ts';\r\n\r\n/**\r\n * Used to edit and add to an {@link ISubtitleCollection}.\r\n */\r\nexport class SubtitleEditor {\r\n constructor(private collection: ISubtitleCollection[] = []) {}\r\n\r\n private _getLanguage(languageCode: string) {\r\n return this.collection.find(x => x.languageCode === languageCode);\r\n }\r\n\r\n /**\r\n * Adds a new {@link ISubtitleCollection} for the given `languageCode`.\r\n *\r\n * If collections already exist for existing language codes then a duplicate\r\n * of these collections is created with the same duration info but all of the\r\n * text is left empty.\r\n *\r\n * @param languageCode\r\n * @returns\r\n */\r\n addLanguage(languageCode: TLanguageCode) {\r\n const language = this._getLanguage(languageCode);\r\n if (language) {\r\n throw new Error(`Language ${languageCode} already exists.`);\r\n }\r\n const newLanguage: ISubtitleCollection = this.collection.length\r\n ? {\r\n ...this.collection[0],\r\n languageCode,\r\n titles: this.collection[0].titles.map(x => ({\r\n id: uuidv4(),\r\n duration: {...x.duration},\r\n text: '',\r\n })),\r\n }\r\n : {\r\n languageCode,\r\n titles: [],\r\n };\r\n this.collection.push(newLanguage);\r\n return this;\r\n }\r\n\r\n /**\r\n *\r\n * Add a single subtitle line that is associated with the given `languageCode`\r\n *\r\n * @param languageCode\r\n * @param subtitle\r\n * @returns\r\n */\r\n addSubtitle(languageCode: TLanguageCode, subtitle: ISubtitle) {\r\n const language = this._getLanguage(languageCode);\r\n if (!language) {\r\n throw new Error(`Language ${languageCode} does not exist.`);\r\n }\r\n language.titles.push(subtitle);\r\n return this;\r\n }\r\n\r\n addSubtitles(\r\n duration: IStrictDuration,\r\n subtitles: Record<TLanguageCode, string>\r\n ) {\r\n Object.entries(subtitles).forEach(([languageCode, subtitle]) =>\r\n this.addSubtitle(languageCode as TLanguageCode, {\r\n id: uuidv4(),\r\n duration: {...duration},\r\n text: subtitle,\r\n })\r\n );\r\n return this;\r\n }\r\n\r\n setSubtitle(languageCode: TLanguageCode, subtitle: ISubtitle) {\r\n const language = this._getLanguage(languageCode);\r\n if (!language) {\r\n throw new Error(`Language ${languageCode} does not exist.`);\r\n }\r\n\r\n const titleIdx = language.titles.findIndex(x => x.id === subtitle.id);\r\n if (titleIdx < 0) {\r\n throw new Error(\r\n `Subtitle with id '${subtitle.id}' was not found in language with code ${languageCode}.`\r\n );\r\n }\r\n\r\n language.titles[titleIdx] = {\r\n ...subtitle,\r\n duration: {...subtitle.duration},\r\n };\r\n return this;\r\n }\r\n\r\n export() {\r\n return this.collection;\r\n }\r\n}\r\n","import {getPropertyChainValue} from './get-property-chain-value.ts';\r\n\r\n/**\r\n * Gets the value for the given property chain. A property chain is defined by a period delimited string.\r\n *\r\n * For example, this property chain: `mySource.subSource.element.value` should be extracted from an object of this shape:\r\n * ```ts\r\n * const foo = {\r\n * mySource: {\r\n * subSource: {\r\n * element: {\r\n * value: 'bar'\r\n * }\r\n * }\r\n * }\r\n * }\r\n * ```\r\n *\r\n * The result of the invocation `resolvePropertyChain('mySource.subSource.element.value', foo)` would then yield the value `bar`.\r\n */\r\nexport function resolvePropertyChain(propertyChain: string, sourceObject: any) {\r\n const properties = propertyChain.split('.');\r\n return getPropertyChainValue(properties, sourceObject);\r\n}\r\n","import type {TOperationData} from 'operation/types.ts';\r\nimport {isDefined} from 'ts-is-present';\r\nimport {Action, EndableAction, TimelineAction} from '../action/index.ts';\r\nimport type {IAction} from '../action/types.ts';\r\nimport type {ActionRegistryEventbusListener} from '../eventbus/index.ts';\r\nimport type {IEventbus} from '../eventbus/types.ts';\r\nimport {deepCopy} from '../operation/helper/deep-copy.ts';\r\nimport {resolvePropertyChain} from '../operation/helper/resolve-property-chain.ts';\r\nimport type {\r\n IConfigurationResolver,\r\n ISimpleResourceImporter,\r\n} from '../types.ts';\r\nimport {isObject} from '../util/guards/is-object.ts';\r\nimport {isString} from '../util/guards/is-string.ts';\r\nimport type {\r\n IActionConfiguration,\r\n IEndableActionConfiguration,\r\n IEngineConfiguration,\r\n IEventActionConfiguration,\r\n IOperationConfiguration,\r\n IResolvedActionConfiguration,\r\n IResolvedEndableActionConfiguration,\r\n IResolvedEngineConfiguration,\r\n IResolvedOperation,\r\n IResolvedTimelineConfiguration,\r\n ITimelineActionConfiguration,\r\n ITimelineConfiguration,\r\n} from './types.ts';\r\n\r\n/**\r\n * Takes an `IEngineConfiguration` instance and return an `IResolvedEngineConfiguration`.\r\n * This means all system names within the configuration will be resolved to their associated instances.\r\n *\r\n * If the given configuration includes event actions, then those will be registered in the given `ActionRegistryEventbusListener`.\r\n *\r\n */\r\nexport class ConfigurationResolver implements IConfigurationResolver {\r\n constructor(\r\n private importer: ISimpleResourceImporter,\r\n private eventbus: IEventbus\r\n ) {}\r\n\r\n process(\r\n configuration: IEngineConfiguration,\r\n actionRegistryListener?: ActionRegistryEventbusListener\r\n ): [Record<string, IAction>, IResolvedEngineConfiguration] {\r\n resolvePlaceholders(configuration, configuration, this.importer);\r\n\r\n if (!isDefined(configuration.timelineProviderSettings)) {\r\n throw new Error(\r\n 'Configuration incomplete: it needs to have at least one timeline provider setting'\r\n );\r\n }\r\n\r\n const resolvedConfig: IResolvedEngineConfiguration = {\r\n id: configuration.id,\r\n engine: {...configuration.engine},\r\n timelineProviderSettings: deepCopy(\r\n configuration.timelineProviderSettings\r\n ),\r\n containerSelector: configuration.containerSelector,\r\n cssFiles: configuration.cssFiles,\r\n language: configuration.language,\r\n layoutTemplate: configuration.layoutTemplate,\r\n availableLanguages: deepCopy(configuration.availableLanguages),\r\n actions: resolveActions(\r\n configuration.actions,\r\n this.importer,\r\n this.eventbus\r\n ),\r\n initActions: resolveActions(\r\n configuration.initActions,\r\n this.importer,\r\n this.eventbus\r\n ),\r\n labels: deepCopy(configuration.labels),\r\n timelineFlow: deepCopy(configuration.timelineFlow),\r\n timelines: resolveTimelines(\r\n configuration.timelines,\r\n this.importer,\r\n this.eventbus\r\n ),\r\n };\r\n\r\n let eventActions: IAction[] = [];\r\n if (configuration.eventActions?.length && actionRegistryListener) {\r\n eventActions = resolveEventActions(\r\n configuration.eventActions,\r\n actionRegistryListener,\r\n this.importer,\r\n this.eventbus\r\n );\r\n }\r\n\r\n const actionsLookup = (resolvedConfig.actions as IAction[])\r\n .concat(eventActions)\r\n .reduce<Record<string, IAction>>(\r\n (aggr, action) => ({\r\n ...aggr,\r\n [action.name]: action,\r\n }),\r\n {}\r\n );\r\n\r\n return [actionsLookup, resolvedConfig];\r\n }\r\n}\r\n\r\nfunction resolveEventActions(\r\n eventActionConfigurations: IEventActionConfiguration[],\r\n actionRegistryListener: ActionRegistryEventbusListener,\r\n importer: ISimpleResourceImporter,\r\n eventbus: IEventbus\r\n) {\r\n const resolvedConfigs =\r\n eventActionConfigurations.map<IResolvedActionConfiguration>(config =>\r\n resolveActionConfiguration(config, importer)\r\n );\r\n\r\n return resolvedConfigs.map((config, index) => {\r\n const {eventName, eventTopic} = eventActionConfigurations[index];\r\n const eventAction = new Action(\r\n config.name,\r\n config.startOperations,\r\n eventbus\r\n );\r\n actionRegistryListener.registerAction(eventAction, eventName, eventTopic);\r\n return eventAction;\r\n });\r\n}\r\n\r\nfunction resolveTimelines(\r\n timelines: ITimelineConfiguration[],\r\n importer: ISimpleResourceImporter,\r\n eventbus: IEventbus\r\n) {\r\n const resolve = resolveTimelineAction.bind(null, importer, eventbus);\r\n\r\n return timelines.map<IResolvedTimelineConfiguration>(config => ({\r\n ...config,\r\n timelineActions: config.timelineActions.map(resolve),\r\n }));\r\n}\r\n\r\nfunction resolveOperation(\r\n importer: ISimpleResourceImporter,\r\n operationConfig: IOperationConfiguration<TOperationData>\r\n): IResolvedOperation {\r\n return {\r\n id: operationConfig.id,\r\n systemName: operationConfig.systemName,\r\n operationData: deepCopy(operationConfig.operationData) ?? {},\r\n instance: importer.import(operationConfig.systemName)[\r\n operationConfig.systemName\r\n ],\r\n };\r\n}\r\n\r\nfunction resolveActionConfiguration(\r\n config: IActionConfiguration,\r\n importer: ISimpleResourceImporter\r\n): IResolvedActionConfiguration {\r\n const resolve = resolveOperation.bind(null, importer);\r\n\r\n return {\r\n id: config.id,\r\n name: config.name,\r\n startOperations: config.startOperations.map(resolve),\r\n };\r\n}\r\n\r\nfunction resolveEndableActionConfiguration(\r\n config: IEndableActionConfiguration,\r\n importer: ISimpleResourceImporter\r\n): IResolvedEndableActionConfiguration {\r\n const resolve = resolveOperation.bind(null, importer);\r\n\r\n const action = resolveActionConfiguration(config, importer);\r\n\r\n return {\r\n ...action,\r\n endOperations: config.endOperations.map(resolve),\r\n };\r\n}\r\n\r\nfunction resolveTimelineAction(\r\n importer: ISimpleResourceImporter,\r\n eventbus: IEventbus,\r\n actionConfiguration: ITimelineActionConfiguration\r\n) {\r\n const resolvedConfig = resolveEndableActionConfiguration(\r\n actionConfiguration,\r\n importer\r\n );\r\n const duration = {\r\n end: actionConfiguration.duration.end ?? -1,\r\n start: actionConfiguration.duration.start,\r\n };\r\n\r\n const {id, name, endOperations, startOperations} = resolvedConfig;\r\n const action = new TimelineAction(\r\n name,\r\n startOperations,\r\n endOperations,\r\n duration,\r\n eventbus\r\n );\r\n action.id = id;\r\n return action;\r\n}\r\n\r\nfunction resolveActions(\r\n actionConfigurations: IEndableActionConfiguration[],\r\n importer: ISimpleResourceImporter,\r\n eventbus: IEventbus\r\n) {\r\n const resolvedConfigs =\r\n actionConfigurations.map<IResolvedEndableActionConfiguration>(config => {\r\n return resolveEndableActionConfiguration(config, importer);\r\n });\r\n\r\n return resolvedConfigs.map<EndableAction>(resolvedConfig => {\r\n const {name, endOperations, startOperations} = resolvedConfig;\r\n const action = new EndableAction(\r\n name,\r\n startOperations,\r\n endOperations,\r\n eventbus\r\n );\r\n action.id = resolvedConfig.id;\r\n return action;\r\n });\r\n}\r\n\r\nfunction resolvePlaceholders(\r\n configFragment: Record<string, any> | any[],\r\n rootConfig: any,\r\n importer: ISimpleResourceImporter\r\n) {\r\n if (!isDefined(configFragment)) {\r\n return;\r\n }\r\n\r\n if (Array.isArray(configFragment)) {\r\n configFragment.forEach(item => {\r\n resolvePlaceholders(item, rootConfig, importer);\r\n });\r\n } else if (isObject(configFragment)) {\r\n Object.keys(configFragment).forEach(key => {\r\n resolvePlaceholder(key, configFragment, rootConfig, importer);\r\n });\r\n }\r\n}\r\n\r\nfunction resolvePlaceholder(\r\n key: PropertyKey,\r\n configFragment: any,\r\n rootConfig: any,\r\n importer: ISimpleResourceImporter\r\n) {\r\n const configValue = configFragment[key];\r\n if (isString(configValue)) {\r\n if (configValue.startsWith('config:')) {\r\n const configProperty = configValue.substring(7, configValue.length);\r\n configFragment[key] = resolvePropertyChain(configProperty, rootConfig);\r\n } else if (configValue.startsWith('template:')) {\r\n const templateKey = configValue.substring(9, configValue.length);\r\n const template = importer.import(templateKey)[templateKey];\r\n configFragment[key] = template;\r\n } else if (configValue.startsWith('json:')) {\r\n const jsonKey = configValue.substring(5, configValue.length);\r\n const json = importer.import(jsonKey)[jsonKey];\r\n configFragment[key] = json;\r\n }\r\n } else if (isObject(configValue) || Array.isArray(configValue)) {\r\n resolvePlaceholders(configValue, rootConfig, importer);\r\n }\r\n}\r\n","import { type IDOMEventListenerControllerOperationData } from \"../dom-event-listener-controller.ts\";\nimport { type IControllerMetadata } from \"./types.ts\";\n\nexport function DOMEventListenerController(): IControllerMetadata<IDOMEventListenerControllerOperationData> {\n return {\n description: `This controller attaches to the given selected element and adds a DOM event listener for the specified event name that\nexecutes the given actions with the given operation data.\n\nBy default the \\`start\\` operations of the specified actions are executed. To execute the \\`end\\` operations instead,\nprefix the action name with \\`end:\\`.`,\n dependentProperties: ['selectedElement'],\n properties: {\n eventName: {\n type: 'ParameterType:eventName',\n required: true,\n },\n actions: {\n type: 'ParameterType:array',\n itemType: 'ParameterType:string',\n },\n actionOperationData: {\n type: 'ParameterType:object',\n }\n },\n };\n}\n","import { type ILabelControllerMetadata } from \"../label-controller.ts\";\nimport { type IControllerMetadata } from \"./types.ts\";\n\nexport function LabelController(): IControllerMetadata<ILabelControllerMetadata> {\n return {\n description: `This controller attaches to the given selected element and renders the text associated with the given label id in it.\n\nThe controller also listen for the \\`LANGUAGE_CHANGE\\` event and re-renders the text with the new language after such an event.`,\n dependentProperties: ['selectedElement'],\n properties: {\n labelId: {\n type: 'ParameterType:labelId',\n required: true,\n },\n attributeName: {\n type: 'ParameterType:string',\n }\n },\n };\n}\n","import { type ILottieControllerMetadata } from \"../lottie-controller.ts\";\nimport { type IControllerMetadata } from \"./types.ts\";\n\nexport function LottieController(): IControllerMetadata<ILottieControllerMetadata> {\n return {\n description: `This controller renders a [lottie-web](https://github.com/airbnb/lottie-web) animation inside the given selected element.\n\nThe url may encode freeze and end positions like this: my-url/filename[freeze=10,end=21].json`,\n properties: {\n url: {\n type: 'ParameterType:url',\n required: true,\n }\n },\n };\n}\n","import { type IMutationObserverControllerMetadata } from \"../mutation-observer-controller.ts\";\nimport { type IControllerMetadata } from \"./types.ts\";\n\nexport function MutationObserverController(): IControllerMetadata<IMutationObserverControllerMetadata> {\n return {\n description: `Controller that observes DOM mutations on a selected element and broadcasts events.\n\nThis controller creates a MutationObserver to monitor DOM changes (attributes, child nodes,\ntext content) on a specified element. All detected mutations are broadcasted through the\nEligius eventbus, enabling reactive behavior in response to DOM changes.\n\nThe controller follows the standard Eligius lifecycle:\n- init(): Store configuration metadata\n- attach(): Create and start the MutationObserver\n- detach(): Disconnect the observer and clean up resources`,\n dependentProperties: ['selectedElement'],\n properties: {\n observeAttributes: {\n type: 'ParameterType:boolean',\n },\n observeChildList: {\n type: 'ParameterType:boolean',\n },\n observeCharacterData: {\n type: 'ParameterType:boolean',\n },\n observeSubtree: {\n type: 'ParameterType:boolean',\n },\n attributeOldValue: {\n type: 'ParameterType:boolean',\n },\n characterDataOldValue: {\n type: 'ParameterType:boolean',\n },\n attributeFilter: {\n type: 'ParameterType:array',\n itemType: 'ParameterType:string',\n }\n },\n };\n}\n","import { type INavigationControllerOperationData } from \"../navigation-controller.ts\";\nimport { type IControllerMetadata } from \"./types.ts\";\n\nexport function NavigationController(): IControllerMetadata<INavigationControllerOperationData> {\n return {\n description: ``,\n dependentProperties: ['selectedElement'],\n properties: {\n json: {\n type: 'ParameterType:object',\n required: true,\n }\n },\n };\n}\n","import { type IProgressbarControllerOperationData } from \"../progressbar-controller.ts\";\nimport { type IControllerMetadata } from \"./types.ts\";\n\nexport function ProgressbarController(): IControllerMetadata<IProgressbarControllerOperationData> {\n return {\n description: `This controller renders a progressbar that displays the progress of the current timeline in the given selected element.\n\nThe current progress as a percentage is rendered in the given text element.`,\n dependentProperties: ['selectedElement', 'textElement'],\n };\n}\n","import { type IRoutingControllerOperationData } from \"../routing-controller.ts\";\nimport { type IControllerMetadata } from \"./types.ts\";\n\nexport function RoutingController(): IControllerMetadata<IRoutingControllerOperationData> {\n return {\n description: `This is a work in progress, do not use this yet please....`,\n properties: {\n json: {\n type: 'ParameterType:object',\n required: true,\n }\n },\n };\n}\n","import { type ISubtitlesControllerOperationData } from \"../subtitles-controller.ts\";\nimport { type IControllerMetadata } from \"./types.ts\";\n\nexport function SubtitlesController(): IControllerMetadata<ISubtitlesControllerOperationData> {\n return {\n description: ``,\n dependentProperties: ['selectedElement'],\n properties: {\n language: {\n type: 'ParameterType:`${Lowercase<string>}-${Uppercase<string>}`',\n },\n subtitleData: {\n type: 'ParameterType:array',\n }\n },\n };\n}\n","export { DOMEventListenerController } from \"./dom-event-listener-controller.ts\";\nexport { LabelController } from \"./label-controller.ts\";\nexport { LottieController } from \"./lottie-controller.ts\";\nexport { MutationObserverController } from \"./mutation-observer-controller.ts\";\nexport { NavigationController } from \"./navigation-controller.ts\";\nexport { ProgressbarController } from \"./progressbar-controller.ts\";\nexport { RoutingController } from \"./routing-controller.ts\";\nexport { SubtitlesController } from \"./subtitles-controller.ts\";\nexport * from \"./types.ts\";\n","import $ from 'jquery';\r\nimport type {IEndableAction, ITimelineAction} from './action/types.ts';\r\nimport type {\r\n IResolvedEngineConfiguration,\r\n IResolvedTimelineConfiguration,\r\n} from './configuration/types.ts';\r\nimport type {\r\n EventName,\r\n IEventbus,\r\n TEventbusRemover,\r\n TEventHandler,\r\n} from './eventbus/types.ts';\r\nimport type {LanguageManager} from './language-manager.ts';\r\nimport type {ITimelineProvider} from './timelineproviders/types.ts';\r\nimport type {\r\n IEligiusEngine,\r\n ITimelineProviderInfo,\r\n TimelineTypes,\r\n TResultCallback,\r\n} from './types.ts';\r\n\r\ntype ActionMethod =\r\n | (IEndableAction['start'] & ActionMethodMetadata)\r\n | (IEndableAction['end'] & ActionMethodMetadata);\r\n\r\ninterface ActionMethodMetadata {\r\n id: string;\r\n isStart: boolean;\r\n startPosition?: number;\r\n}\r\n\r\n/**\r\n * This is where the magic happens. The engine is responsible for starting and stopping\r\n * the given timeline provider and triggering the actions associated with the positions along the timeline.\r\n */\r\nexport class EligiusEngine implements IEligiusEngine {\r\n private _timeLineActionsLookup: Record<\r\n string,\r\n Record<number, ActionMethod[]>\r\n > = {};\r\n private _timelineLookupCache: Map<string, IResolvedTimelineConfiguration> =\r\n new Map();\r\n private _eventbusRemovers: TEventbusRemover[] = [];\r\n private _currentTimelineUri: string = '';\r\n private _activeTimelineProvider: ITimelineProvider | undefined = undefined;\r\n private _lastPosition: number = -1;\r\n\r\n constructor(\r\n private configuration: IResolvedEngineConfiguration,\r\n private eventbus: IEventbus,\r\n private timelineProviders: Record<TimelineTypes, ITimelineProviderInfo>,\r\n private languageManager: LanguageManager\r\n ) {}\r\n\r\n /**\r\n * Initializes the engine by creating the HTML layout and the first time line\r\n * by executing its initActions.\r\n */\r\n init(): Promise<ITimelineProvider> {\r\n this._createLayoutTemplate();\r\n\r\n this._addEventbusListeners();\r\n\r\n const {timelines} = this.configuration;\r\n\r\n this._currentTimelineUri = timelines?.[0].uri ?? '';\r\n\r\n this._createTimelineLookup();\r\n\r\n return this._initializeTimelineProvider();\r\n }\r\n\r\n private _createLayoutTemplate() {\r\n const {containerSelector} = this.configuration;\r\n const container = $(containerSelector);\r\n\r\n if (!container || !container.length) {\r\n throw new Error(`Container selector not found: ${containerSelector}`);\r\n }\r\n\r\n const {layoutTemplate} = this.configuration;\r\n\r\n if (layoutTemplate?.length) {\r\n container.html(layoutTemplate);\r\n } else {\r\n console.warn('layoutTemplate is empty, unable to create layout');\r\n }\r\n }\r\n\r\n private async _initializeTimelineProvider() {\r\n if (!this.configuration.timelines?.length) {\r\n throw new Error('No timelines present');\r\n }\r\n\r\n const firstTimeline = this.configuration.timelines[0];\r\n const providerSettings = this.timelineProviders[firstTimeline.type];\r\n\r\n if (!providerSettings) {\r\n throw new Error(\r\n `No timeline provider configured for type ${firstTimeline.type}`\r\n );\r\n }\r\n\r\n this._activeTimelineProvider?.destroy();\r\n this._activeTimelineProvider = providerSettings.provider;\r\n\r\n if (!this._activeTimelineProvider) {\r\n throw new Error('NO ACTIVE TIMELINE PROVIDER');\r\n }\r\n\r\n this._activeTimelineProvider.onTime(\r\n this._onTimeHandler.bind(this, Math.floor)\r\n );\r\n this._activeTimelineProvider.onComplete(\r\n this._onCompleteCallback.bind(this)\r\n );\r\n this._activeTimelineProvider.onFirstFrame(\r\n this._onFirstFrameCallback.bind(this)\r\n );\r\n this._activeTimelineProvider.onRestart(this._onRestartCallback.bind(this));\r\n\r\n await this._activeTimelineProvider.init();\r\n await this._executeActions(this.configuration.initActions, 'start');\r\n return this._activeTimelineProvider;\r\n }\r\n\r\n private _onCompleteCallback() {\r\n this.eventbus.broadcast('timeline-complete', []);\r\n }\r\n\r\n private _onFirstFrameCallback() {\r\n this.eventbus.broadcast('timeline-firstframe', []);\r\n this.eventbus.broadcast('timeline-duration', [\r\n this._activeTimelineProvider?.getDuration,\r\n ]);\r\n }\r\n\r\n private _onRestartCallback() {\r\n this.eventbus.broadcast('timeline-restart', []);\r\n }\r\n\r\n private async _cleanUp() {\r\n await this._cleanUpTimeline();\r\n await this._executeActions(\r\n [...this.configuration.initActions].reverse(),\r\n 'end'\r\n );\r\n }\r\n\r\n /**\r\n * Cleans up all the necessary parts that the engine initialized.\r\n * - It ends the currently active operations and the init actions.\r\n * - It removes all its eventbus listeners, handlers and interceptors.\r\n * - It destroys all of its timeline providers\r\n * - It empties the HTML element indicated by the containerSelector configuration property.\r\n *\r\n */\r\n async destroy() {\r\n await this._cleanUp();\r\n\r\n this.languageManager.destroy();\r\n\r\n this._activeTimelineProvider = undefined;\r\n this._eventbusRemovers.forEach(remover => remover());\r\n\r\n if (this.timelineProviders) {\r\n Object.values(this.timelineProviders).forEach(providerInfo =>\r\n providerInfo.provider.destroy()\r\n );\r\n }\r\n\r\n const {containerSelector} = this.configuration;\r\n const container = $(containerSelector);\r\n container.empty();\r\n }\r\n\r\n private _addEventListener(\r\n eventName: string,\r\n eventHandler: TEventHandler,\r\n eventTopic?: string\r\n ) {\r\n this._eventbusRemovers.push(\r\n this.eventbus.on(eventName as EventName, eventHandler, eventTopic)\r\n );\r\n }\r\n\r\n private _addEventbusListeners() {\r\n this._addEventListener(\r\n 'request-engine-root',\r\n this._handleRequestEngineRoot.bind(\r\n this,\r\n this.configuration.containerSelector\r\n )\r\n );\r\n this._addEventListener(\r\n 'request-timeline-uri',\r\n this._handleRequestTimelineUri.bind(this)\r\n );\r\n this._addEventListener(\r\n 'request-current-timeline-position',\r\n this._handleRequestTimelinePosition.bind(this, Math.floor)\r\n );\r\n this._addEventListener(\r\n 'request-timeline-cleanup',\r\n this._handleTimelineComplete.bind(this)\r\n );\r\n this._addEventListener(\r\n 'timeline-request-current-timeline',\r\n this._requestCurrentTimeline.bind(this)\r\n );\r\n this._addEventListener(\r\n 'timeline-play-toggle-request',\r\n this._toggleplay.bind(this)\r\n );\r\n\r\n this._addEventListener(\r\n 'timeline-play-request',\r\n this._playRequest.bind(this)\r\n );\r\n\r\n this._addEventListener(\r\n 'timeline-stop-request',\r\n this._stopRequest.bind(this)\r\n );\r\n\r\n this._addEventListener(\r\n 'timeline-pause-request',\r\n this._pauseRequest.bind(this)\r\n );\r\n\r\n this._addEventListener(\r\n 'timeline-container-request',\r\n this.containerRequest.bind(this)\r\n );\r\n\r\n this._addEventListener(\r\n 'timeline-duration-request',\r\n this.durationRequest.bind(this)\r\n );\r\n\r\n this._addEventListener(\r\n 'timeline-seek-request',\r\n this.seekRequest.bind(this)\r\n );\r\n }\r\n\r\n private async seekRequest(position: number) {\r\n if (!this._activeTimelineProvider) {\r\n return;\r\n }\r\n const seekPosition = Math.floor(position);\r\n\r\n const duration = this._activeTimelineProvider.getDuration();\r\n const currentPosition = this._activeTimelineProvider.getPosition();\r\n\r\n if (seekPosition < 0 || seekPosition > duration) {\r\n return;\r\n }\r\n\r\n this.eventbus.broadcast('timeline-seek', [\r\n seekPosition,\r\n currentPosition,\r\n duration,\r\n ]);\r\n\r\n await this._activeTimelineProvider.seek(seekPosition);\r\n await this._executeSeekActions(seekPosition);\r\n\r\n this.eventbus.broadcast('timeline-seeked', [\r\n this._activeTimelineProvider.getPosition(),\r\n duration,\r\n ]);\r\n\r\n this.eventbus.broadcast('timeline-time', [\r\n this._activeTimelineProvider.getPosition(),\r\n ]);\r\n\r\n if (this._activeTimelineProvider?.playState === 'running') {\r\n this._activeTimelineProvider?.start();\r\n }\r\n }\r\n\r\n private durationRequest(callBack: TResultCallback<number | undefined>) {\r\n callBack(this._activeTimelineProvider?.getDuration());\r\n }\r\n\r\n private containerRequest(\r\n callBack: TResultCallback<JQuery<HTMLElement> | undefined>\r\n ) {\r\n callBack(this._activeTimelineProvider?.getContainer());\r\n }\r\n\r\n private _pauseRequest() {\r\n if (!this._activeTimelineProvider) {\r\n return;\r\n }\r\n\r\n this._activeTimelineProvider.pause();\r\n this.eventbus.broadcast('timeline-pause', []);\r\n }\r\n\r\n private _stopRequest() {\r\n if (!this._activeTimelineProvider) {\r\n return;\r\n }\r\n\r\n this._activeTimelineProvider.stop();\r\n this.eventbus.broadcast('timeline-stop', []);\r\n }\r\n\r\n private _playRequest() {\r\n if (!this._activeTimelineProvider) {\r\n return;\r\n }\r\n\r\n this._activeTimelineProvider.start();\r\n this.eventbus.broadcast('timeline-play', []);\r\n }\r\n\r\n private _toggleplay() {\r\n if (!this._activeTimelineProvider) {\r\n return;\r\n }\r\n\r\n if (this._activeTimelineProvider.playState === 'running') {\r\n this._activeTimelineProvider.pause();\r\n } else {\r\n this._activeTimelineProvider.start();\r\n }\r\n }\r\n\r\n private _createTimelineLookup() {\r\n if (!this.configuration.timelines) {\r\n return;\r\n }\r\n\r\n // Consolidated loop: process both start and end actions in a single pass\r\n this.configuration.timelines.forEach(timelineInfo => {\r\n // Populate timeline lookup cache for O(1) access\r\n this._timelineLookupCache.set(timelineInfo.uri, timelineInfo);\r\n\r\n timelineInfo.timelineActions.forEach(timelineAction => {\r\n this._addTimelineActionStart(timelineInfo.uri, timelineAction);\r\n this._addTimelineActionEnd(timelineInfo.uri, timelineAction);\r\n });\r\n });\r\n\r\n EligiusEngine.sortTimelines(Object.values(this._timeLineActionsLookup));\r\n }\r\n\r\n static sortTimelines(timelines: Record<number, ActionMethod[]>[]) {\r\n timelines.forEach(timelineActions => {\r\n Object.keys(timelineActions).forEach(key => {\r\n const numericKey = Number(key);\r\n timelineActions[numericKey] = EligiusEngine.sortActionsPerPosition(\r\n timelineActions[numericKey]\r\n );\r\n });\r\n });\r\n }\r\n\r\n static sortActionsPerPosition(actions: ActionMethod[]) {\r\n const [startMethods, endMethods] = actions.reduce(\r\n (acc, item) => {\r\n if (item.isStart) {\r\n acc[0].push(item);\r\n } else {\r\n acc[1].push(item);\r\n }\r\n return acc;\r\n },\r\n [[], []] as [ActionMethod[], ActionMethod[]]\r\n );\r\n return [\r\n ...endMethods.sort(sortActionMethodsHighestStartPositionFirst),\r\n ...startMethods,\r\n ];\r\n }\r\n\r\n private _addTimelineActionStart(\r\n uri: string,\r\n timeLineAction: ITimelineAction\r\n ) {\r\n const startPosition = timeLineAction.duration.start;\r\n const timelineStartPositions = this._initializeTimelinePosition(\r\n this._initializeUriLookup(this._timeLineActionsLookup, uri),\r\n startPosition\r\n );\r\n const startMethod = timeLineAction.start.bind(\r\n timeLineAction\r\n ) as ActionMethod;\r\n\r\n if (timeLineAction.id?.length) {\r\n startMethod.id = timeLineAction.id;\r\n }\r\n startMethod.isStart = true;\r\n\r\n timelineStartPositions.push(startMethod);\r\n }\r\n\r\n private _addTimelineActionEnd(uri: string, timeLineAction: ITimelineAction) {\r\n let end = timeLineAction.duration.end;\r\n if (end < 0) {\r\n end = timeLineAction.duration.end = Infinity;\r\n }\r\n\r\n if (Number.isFinite(end)) {\r\n const timelineEndPositions = this._initializeTimelinePosition(\r\n this._timeLineActionsLookup[uri],\r\n end\r\n );\r\n const endMethod = timeLineAction.end.bind(timeLineAction) as ActionMethod;\r\n\r\n if (timeLineAction.id?.length) {\r\n endMethod.id = timeLineAction.id;\r\n endMethod.startPosition = timeLineAction.duration.start;\r\n }\r\n endMethod.isStart = false;\r\n\r\n timelineEndPositions.push(endMethod);\r\n }\r\n }\r\n\r\n private _initializeUriLookup(\r\n lookup: Record<string, Record<number, ActionMethod[]>>,\r\n uri: string\r\n ): Record<number, ActionMethod[]> {\r\n if (!lookup[uri]) {\r\n lookup[uri] = {};\r\n }\r\n\r\n return lookup[uri];\r\n }\r\n\r\n private _initializeTimelinePosition(\r\n lookup: Record<number, ActionMethod[]>,\r\n position: number\r\n ): ActionMethod[] {\r\n if (!lookup[position]) {\r\n lookup[position] = [] as ActionMethod[];\r\n }\r\n\r\n return lookup[position];\r\n }\r\n\r\n private async _executeActions(\r\n actions: IEndableAction[],\r\n methodName: 'start' | 'end'\r\n ): Promise<void> {\r\n // Iterative implementation (converted from recursive)\r\n if (actions.length === 0) {\r\n return;\r\n }\r\n\r\n for (const action of actions) {\r\n await action[methodName]();\r\n }\r\n }\r\n\r\n private _handleRequestEngineRoot(\r\n engineRootSelector: string,\r\n resultCallback: TResultCallback<JQuery<HTMLElement>>\r\n ) {\r\n resultCallback($(engineRootSelector));\r\n }\r\n\r\n private async _handleRequestTimelineUri(uri: string, position: number = 0) {\r\n if (!this._activeTimelineProvider) {\r\n return;\r\n }\r\n\r\n this._activeTimelineProvider.stop();\r\n\r\n await this._cleanUpTimeline();\r\n\r\n const timelineConfig = this._timelineLookupCache.get(uri);\r\n if (\r\n !timelineConfig ||\r\n !this._activeTimelineProvider ||\r\n this._currentTimelineUri === timelineConfig.uri\r\n ) {\r\n return;\r\n }\r\n this._currentTimelineUri = timelineConfig.uri;\r\n\r\n this.eventbus.broadcast('timeline-current-timeline-change', [\r\n this._currentTimelineUri,\r\n ]);\r\n\r\n const newProviderSettings = this.timelineProviders[timelineConfig.type];\r\n\r\n if (this._activeTimelineProvider !== newProviderSettings.provider) {\r\n this._activeTimelineProvider.destroy();\r\n this._activeTimelineProvider = newProviderSettings.provider;\r\n }\r\n\r\n this._activeTimelineProvider.loop = timelineConfig.loop;\r\n\r\n if (!this._activeTimelineProvider.loop && position > 0) {\r\n this.eventbus.once('timeline-firstframe', async () => {\r\n if (!this._activeTimelineProvider) {\r\n return;\r\n }\r\n\r\n this._activeTimelineProvider.pause();\r\n this.eventbus.broadcast('timeline-duration', [\r\n this._activeTimelineProvider.getDuration,\r\n ]);\r\n\r\n await this._executeStartActions();\r\n\r\n const seekPosition = await this._activeTimelineProvider.seek(position);\r\n this.seekRequest(seekPosition);\r\n });\r\n }\r\n\r\n this._activeTimelineProvider.playlistItem(uri);\r\n }\r\n\r\n private _cleanUpTimeline() {\r\n return this._executeRelevantActions(this._getActiveActions, 'end');\r\n }\r\n\r\n private _executeStartActions() {\r\n return this._executeRelevantActions(\r\n this._getActionsForPosition.bind(this, 0),\r\n 'start'\r\n );\r\n }\r\n\r\n /**\r\n * Gets all of the inactive actions whose duration falls within the given timeline position.\r\n *\r\n * @param position the given position\r\n * @param actions all of the relevant actions\r\n * @returns\r\n */\r\n private _getActionsForPosition(position: number, actions: ITimelineAction[]) {\r\n return actions.filter(\r\n action =>\r\n !action.active &&\r\n action.duration.start <= position &&\r\n action.duration.end >= position\r\n );\r\n }\r\n\r\n private _getActiveActions(allActions: ITimelineAction[]) {\r\n const actions = allActions.filter(action => action.active);\r\n return actions.sort(sortActionsHighestStartPositionFirst);\r\n }\r\n\r\n private _executeRelevantActions(\r\n filter: (actions: ITimelineAction[]) => ITimelineAction[],\r\n executionType: 'start' | 'end'\r\n ) {\r\n const timelineActions = this._getTimelineActionsForCurrentTimeline();\r\n const currentActions = filter.apply(this, [timelineActions]);\r\n return this._executeActions(currentActions, executionType);\r\n }\r\n\r\n private _handleRequestTimelinePosition(\r\n floor: (x: number) => number,\r\n resultCallback: TResultCallback<number>\r\n ) {\r\n resultCallback(floor(this._activeTimelineProvider?.getPosition() || -1));\r\n }\r\n\r\n private _handleTimelineComplete() {\r\n this._cleanUpTimeline();\r\n }\r\n\r\n private _getTimelineActionsForCurrentTimeline() {\r\n return this._getTimelineActionsForUri(this._currentTimelineUri);\r\n }\r\n\r\n private _requestCurrentTimeline(resultCallback: TResultCallback<string>) {\r\n resultCallback(this._currentTimelineUri);\r\n }\r\n\r\n private _getTimelineActionsForUri(uri: string): ITimelineAction[] {\r\n const info = this._timelineLookupCache.get(uri);\r\n return info?.timelineActions ?? [];\r\n }\r\n\r\n private _onTimeHandler(floor: (x: number) => number, position: number) {\r\n if (!Number.isNaN(position)) {\r\n const pos = floor(position);\r\n\r\n if (this._lastPosition !== pos) {\r\n this._executeActionsForPosition(pos);\r\n this.eventbus.broadcast('timeline-time', [pos]);\r\n }\r\n }\r\n }\r\n\r\n private _executeActionsForPosition(position: number) {\r\n this._lastPosition = position;\r\n const actions = this._timeLineActionsLookup[this._currentTimelineUri];\r\n\r\n if (actions) {\r\n const executions = actions[position];\r\n executions?.forEach(exec => exec());\r\n }\r\n }\r\n\r\n private async _executeSeekActions(position: number) {\r\n const timelineActions = this._getTimelineActionsForCurrentTimeline();\r\n\r\n if (!timelineActions) {\r\n return Promise.resolve();\r\n }\r\n\r\n const currentActions = this._getActiveActions(timelineActions).filter(\r\n action =>\r\n !(action.duration.start <= position && action.duration.end >= position)\r\n );\r\n const newActions = this._getActionsForPosition(position, timelineActions);\r\n await this._executeActions(currentActions, 'end');\r\n return this._executeActions(newActions, 'start');\r\n }\r\n}\r\n\r\nconst sortActionsHighestStartPositionFirst = (\r\n a: ITimelineAction,\r\n b: ITimelineAction\r\n) => {\r\n if (b.duration.start < a.duration.start) {\r\n return -1;\r\n } else if (b.duration.start > a.duration.start) {\r\n return 1;\r\n } else {\r\n return 0;\r\n }\r\n};\r\n\r\nconst sortActionMethodsHighestStartPositionFirst = (\r\n a: ActionMethod,\r\n b: ActionMethod\r\n) => {\r\n if (b.startPosition === undefined || a.startPosition === undefined) {\r\n return 0;\r\n }\r\n if (b.startPosition < a.startPosition) {\r\n return -1;\r\n } else if (b.startPosition > a.startPosition) {\r\n return 1;\r\n } else {\r\n return 0;\r\n }\r\n};\r\n","import type {IAction} from '../action/types.ts';\r\nimport type {IEventbusListener} from './types.ts';\r\n\r\n/**\r\n * The `IEventbusListener` first registers a number of actions that are then\r\n * executed when the specified event is broadcast.\r\n */\r\nexport class ActionRegistryEventbusListener implements IEventbusListener {\r\n private _actionRegistry = new Map<string, IAction[]>();\r\n\r\n registerAction(\r\n action: IAction,\r\n eventName: string,\r\n eventTopic?: string\r\n ): void {\r\n if (eventTopic?.length) {\r\n eventName = `${eventName}:${eventTopic}`;\r\n }\r\n if (!this._actionRegistry.has(eventName)) {\r\n this._actionRegistry.set(eventName, []);\r\n }\r\n this._actionRegistry.get(eventName)?.push(action);\r\n }\r\n\r\n handleEvent(\r\n eventName: string,\r\n eventTopic: string | undefined,\r\n args: any[]\r\n ): void {\r\n if (eventTopic) {\r\n eventName = `${eventName}:${eventTopic}`;\r\n }\r\n const actions = this._actionRegistry.get(eventName);\r\n if (actions) {\r\n const operationData = {\r\n eventArgs: args,\r\n };\r\n actions.forEach(action => {\r\n action.start(operationData);\r\n });\r\n }\r\n }\r\n}\r\n","import type {\r\n IEventbus,\r\n IEventbusInterceptor,\r\n IEventbusListener,\r\n TEventbusRemover,\r\n TEventHandler,\r\n} from './types.ts';\r\n\r\nexport class Eventbus implements IEventbus {\r\n private eventHandlers = new Map<string, TEventHandler[]>();\r\n private eventInterceptors = new Map<string, IEventbusInterceptor[]>();\r\n private eventListeners: IEventbusListener[] = [];\r\n\r\n constructor() {\r\n this.clear();\r\n }\r\n\r\n clear() {\r\n this.eventHandlers = new Map<string, TEventHandler[]>();\r\n this.eventListeners = [];\r\n this.eventInterceptors = new Map<string, IEventbusInterceptor[]>();\r\n }\r\n\r\n _getEventInterceptors(\r\n eventName: string,\r\n eventTopic?: string\r\n ): IEventbusInterceptor[] {\r\n if (eventTopic) {\r\n eventName = `${eventName}:${eventTopic}`;\r\n }\r\n if (!this.eventInterceptors.has(eventName)) {\r\n this.eventInterceptors.set(eventName, []);\r\n }\r\n return this.eventInterceptors.get(eventName) as IEventbusInterceptor[];\r\n }\r\n\r\n _getEventHandlers(eventName: string, eventTopic?: string): TEventHandler[] {\r\n if (eventTopic) {\r\n eventName = `${eventName}:${eventTopic}`;\r\n }\r\n if (!this.eventHandlers.has(eventName)) {\r\n this.eventHandlers.set(eventName, []);\r\n }\r\n return this.eventHandlers.get(eventName) as TEventHandler[];\r\n }\r\n\r\n on(\r\n eventName: string,\r\n eventHandler: TEventHandler,\r\n eventTopic?: string\r\n ): TEventbusRemover {\r\n this._getEventHandlers(eventName, eventTopic).push(eventHandler);\r\n return () => {\r\n this.off(eventName, eventHandler, eventTopic);\r\n };\r\n }\r\n\r\n once(\r\n eventName: string,\r\n eventHandler: TEventHandler,\r\n eventTopic?: string\r\n ): TEventbusRemover {\r\n const eventHandlerDecorator = (...args: any[]) => {\r\n eventHandler(...args);\r\n this.off(eventName, eventHandlerDecorator, eventTopic);\r\n };\r\n this.on(eventName, eventHandlerDecorator, eventTopic);\r\n return () => {\r\n this.off(eventName, eventHandlerDecorator, eventTopic);\r\n };\r\n }\r\n\r\n off(\r\n eventName: string,\r\n eventHandler: TEventHandler,\r\n eventTopic?: string\r\n ): void {\r\n const handlers = this._getEventHandlers(eventName, eventTopic);\r\n if (handlers) {\r\n const idx = handlers.indexOf(eventHandler);\r\n if (idx > -1) {\r\n handlers.splice(idx, 1);\r\n }\r\n }\r\n }\r\n\r\n broadcast(eventName: string, args: any[]): void {\r\n this._callHandlers(eventName, undefined, args);\r\n }\r\n\r\n broadcastForTopic(eventName: string, eventTopic: string, args: any[]): void {\r\n this._callHandlers(eventName, eventTopic, args);\r\n }\r\n\r\n registerEventlistener(eventbusListener: IEventbusListener): TEventbusRemover {\r\n this.eventListeners.push(eventbusListener);\r\n return () => {\r\n const index = this.eventListeners.indexOf(eventbusListener);\r\n if (index > -1) {\r\n this.eventListeners.splice(index, 1);\r\n }\r\n };\r\n }\r\n\r\n registerInterceptor(\r\n eventName: string,\r\n interceptor: IEventbusInterceptor,\r\n eventTopic?: string\r\n ): TEventbusRemover {\r\n const interceptors = this._getEventInterceptors(eventName, eventTopic);\r\n interceptors.push(interceptor);\r\n return () => {\r\n const index = interceptors.indexOf(interceptor);\r\n if (index > -1) {\r\n interceptors.splice(index, 1);\r\n }\r\n };\r\n }\r\n\r\n _callHandlers(\r\n eventName: string,\r\n eventTopic: string | undefined,\r\n args: any = []\r\n ): void {\r\n const handlers = this._getEventHandlers(eventName, eventTopic);\r\n\r\n if (handlers) {\r\n const interceptors = this._getEventInterceptors(eventName, eventTopic);\r\n\r\n interceptors.forEach(interceptor => {\r\n args = interceptor.intercept(args);\r\n });\r\n\r\n this.eventListeners.forEach((listener: IEventbusListener) => {\r\n listener.handleEvent(eventName, eventTopic, args);\r\n });\r\n\r\n if (args?.length) {\r\n handlers.forEach((handler: TEventHandler) => handler(...args));\r\n } else {\r\n handlers.forEach((handler: TEventHandler) => handler());\r\n }\r\n }\r\n }\r\n}\r\n","import type {IEventbus, IEventbusInterceptor} from './types.ts';\r\n\r\nexport class RequestVideoUriInterceptor implements IEventbusInterceptor {\r\n constructor(private eventbus: IEventbus) {}\r\n\r\n intercept(args: any[]): any[] {\r\n this.eventbus.broadcast('before-request-timeline-uri', args.slice() as any);\r\n return args;\r\n }\r\n}\r\n","export {ActionRegistryEventbusListener} from './actionregistry-eventbus-listener.ts';\r\nexport {Eventbus} from './eventbus.ts';\r\nexport * from './events/index.ts';\r\nexport type {IEventMetadata} from './events/metadata/types.ts';\r\nexport {RequestVideoUriInterceptor} from './request-video-uri-interceptor.ts';\r\nexport * from './types.ts';\r\n","import {getGlobals} from './globals.ts';\r\n\r\nexport function setGlobal(name: string, value: any) {\r\n const cache = getGlobals();\r\n cache[name] = value;\r\n}\r\n","import $ from 'jquery';\r\nimport type {IEventbus, TEventbusRemover} from './eventbus/types.ts';\r\nimport {setGlobal} from './operation/helper/set-global.ts';\r\nimport type {\r\n ILabel,\r\n ILanguageLabel,\r\n TLanguageCode,\r\n TResultCallback,\r\n} from './types.ts';\r\n\r\n/**\r\n * This class manages the labels for an {@link IEligiusEngine} instance.\r\n *\r\n * It handles the request-label-collection, request-label-collections, request-current-language and language-change events.\r\n *\r\n */\r\nexport class LanguageManager {\r\n private _labelLookup: Record<string, ILabel[]>;\r\n private _eventbusRemovers: TEventbusRemover[] = [];\r\n\r\n constructor(\r\n private _currentLanguage: TLanguageCode,\r\n labels: ILanguageLabel[],\r\n private _eventbus: IEventbus\r\n ) {\r\n if (!_currentLanguage) {\r\n throw new Error('language ctor arg cannot have zero length');\r\n }\r\n setGlobal('defaultLanguage', _currentLanguage);\r\n this._setRootElementLang(_currentLanguage);\r\n this._labelLookup = this._createLabelLookup(labels);\r\n this._addEventbusListeners(_eventbus);\r\n }\r\n\r\n destroy() {\r\n this._eventbusRemovers.forEach(x => x());\r\n }\r\n\r\n _addEventbusListeners(eventbus: IEventbus) {\r\n this._eventbusRemovers.push(\r\n eventbus.on(\r\n 'request-label-collection',\r\n this._handleRequestLabelCollection.bind(this)\r\n )\r\n );\r\n this._eventbusRemovers.push(\r\n eventbus.on(\r\n 'request-label-collections',\r\n this._handleRequestLabelCollections.bind(this)\r\n )\r\n );\r\n this._eventbusRemovers.push(\r\n eventbus.on(\r\n 'request-current-language',\r\n this._handleRequestCurrentLanguage.bind(this)\r\n )\r\n );\r\n this._eventbusRemovers.push(\r\n eventbus.on(\r\n 'language-change',\r\n this._handleLanguageChange.bind(this) as any\r\n )\r\n );\r\n }\r\n\r\n _handleRequestCurrentLanguage(\r\n resultCallback: TResultCallback<TLanguageCode>\r\n ) {\r\n resultCallback(this._currentLanguage);\r\n }\r\n\r\n _handleRequestLabelCollection(\r\n labelId: string,\r\n resultCallback: TResultCallback<ILabel[]>\r\n ) {\r\n resultCallback(this._labelLookup[labelId]);\r\n }\r\n\r\n _handleRequestLabelCollections(\r\n labelIds: string[],\r\n resultCallback: TResultCallback<ILabel[][]>\r\n ) {\r\n const labelCollections = labelIds.map(labelId => {\r\n return this._labelLookup[labelId];\r\n });\r\n resultCallback(labelCollections);\r\n }\r\n\r\n _handleLanguageChange(language: TLanguageCode) {\r\n this._currentLanguage = language;\r\n this._setRootElementLang(this._currentLanguage);\r\n }\r\n\r\n _setRootElementLang(language: TLanguageCode) {\r\n const callBack = (rootSelector: string) => {\r\n const lang = this._extractPrimaryLanguage(language);\r\n $(rootSelector).attr('lang', lang);\r\n };\r\n this._eventbus.broadcast('request-engine-root', [callBack]);\r\n }\r\n\r\n _extractPrimaryLanguage(culture: TLanguageCode) {\r\n return culture.split('-').shift() as string;\r\n }\r\n\r\n _createLabelLookup(labels: ILanguageLabel[]) {\r\n return labels.reduce<Record<string, ILabel[]>>((acc, label) => {\r\n acc[label.id] = label.labels;\r\n return acc;\r\n }, {});\r\n }\r\n}\r\n","import hk, {type HotkeysEvent} from 'hotkeys-js';\r\nimport $ from 'jquery';\r\nimport type {IAction} from './action/types.ts';\r\nimport {ConfigurationResolver} from './configuration/configuration-resolver.ts';\r\nimport type {\r\n IEngineConfiguration,\r\n IResolvedEngineConfiguration,\r\n} from './configuration/types.ts';\r\nimport {DevToolEventListener} from './diagnostics/devtool-event-listener.ts';\r\nimport {Diagnostics} from './diagnostics/diagnostics.ts';\r\nimport {\r\n DEV_TOOLS_KEY,\r\n type TDiagnosticType,\r\n type TWindowWithDevtools,\r\n} from './diagnostics/types.ts';\r\nimport {\r\n ActionRegistryEventbusListener,\r\n Eventbus,\r\n type IEventbus,\r\n RequestVideoUriInterceptor,\r\n type TEventbusRemover,\r\n} from './eventbus/index.ts';\r\nimport {LanguageManager} from './language-manager.ts';\r\nimport type {\r\n IConfigurationResolver,\r\n IEligiusEngine,\r\n IEngineFactory,\r\n IEngineFactoryOptions,\r\n ISimpleResourceImporter,\r\n ITimelineProviderInfo,\r\n TimelineTypes,\r\n TResultCallback,\r\n} from './types.ts';\r\nimport {prepareValueForSerialization} from './util/prepare-value-for-serialization.ts';\r\n\r\nconst hotkeys = hk.default || hk;\r\n\r\n/**\r\n * The EngineFactory is used to create and initialize an {@link IEligiusEngine} instance.\r\n *\r\n * It prepares a resolved configuration and creates the engine based on the class defined in the configuration.\r\n *\r\n * @example Loading a configuration and creating an IEligiusEngine instance\r\n * ```ts\r\n * import { IEngineConfiguration, EngineFactory, WebpackResourceImporter } from 'eligius';\r\n * import * as engineConfig from './my-eligius-config.json';\r\n *\r\n * const factory = new EngineFactory(new WebpackResourceImporter(), window);\r\n *\r\n * const engine = factory.createEngine((engineConfig as unknown) as IEngineConfiguration);\r\n *\r\n * engine.init().then(()=> {console.log('Eligius engine ready for business');});\r\n * ```\r\n */\r\nexport class EngineFactory implements IEngineFactory {\r\n private _actionsLookup: Record<string, IAction> = {};\r\n private _eventbus: IEventbus;\r\n private _eventRemovers: TEventbusRemover[] = [];\r\n private _importer: ISimpleResourceImporter;\r\n private _resizeTimeout: any = -1;\r\n\r\n constructor(\r\n importer: ISimpleResourceImporter,\r\n windowRef: Window,\r\n options?: IEngineFactoryOptions\r\n ) {\r\n this._importer = importer;\r\n this._eventbus = options?.eventbus ?? new Eventbus();\r\n\r\n Diagnostics.active = options?.devtools ?? false;\r\n if (Diagnostics.active) {\r\n this._initializeDevtools(this._eventbus);\r\n }\r\n\r\n this._eventRemovers.push(\r\n this._eventbus.on(\r\n 'request-instance',\r\n this._requestInstanceHandler.bind(this)\r\n )\r\n );\r\n this._eventRemovers.push(\r\n this._eventbus.on('request-action', this._requestActionHandler.bind(this))\r\n );\r\n this._eventRemovers.push(\r\n this._eventbus.on(\r\n 'request-function',\r\n this._requestFunctionHandler.bind(this)\r\n )\r\n );\r\n\r\n const handleSpaceBound = this._handleSpacePress.bind(this);\r\n hotkeys('space', handleSpaceBound);\r\n this._eventRemovers.push(() => hotkeys.unbind('space', handleSpaceBound));\r\n\r\n const resizeBound = this._resizeHandler.bind(this);\r\n const jqWin = $(windowRef);\r\n jqWin.on('resize', resizeBound);\r\n this._eventRemovers.push(() => jqWin.off('resize', resizeBound));\r\n }\r\n\r\n private _handleSpacePress(\r\n keyboardEvent: KeyboardEvent,\r\n _hotkeysEvent: HotkeysEvent\r\n ): void | boolean {\r\n keyboardEvent.preventDefault();\r\n this._eventbus.broadcast('timeline-play-toggle-request', []);\r\n return false;\r\n }\r\n\r\n private _initializeDevtools(eventbus: IEventbus) {\r\n const diagnosticInfo = (window as unknown as TWindowWithDevtools)[\r\n DEV_TOOLS_KEY\r\n ];\r\n\r\n if (diagnosticInfo) {\r\n const {agent} = diagnosticInfo;\r\n\r\n this._eventRemovers.push(\r\n eventbus.registerEventlistener(new DevToolEventListener(agent))\r\n );\r\n\r\n this._eventRemovers.push(\r\n agent.subscribe(message => {\r\n if (message.type === 'playcontrol') {\r\n switch (message.data.kind) {\r\n case 'play':\r\n this._eventbus.broadcast('timeline-play-request', []);\r\n break;\r\n case 'stop':\r\n this._eventbus.broadcast('timeline-stop-request', []);\r\n break;\r\n case 'pause':\r\n this._eventbus.broadcast('timeline-pause-request', []);\r\n break;\r\n case 'seek':\r\n this._eventbus.broadcast('timeline-seek-request', [\r\n (message.data.args ?? 0) as number,\r\n ]);\r\n break;\r\n }\r\n }\r\n })\r\n );\r\n\r\n Diagnostics.send = (name: TDiagnosticType, messageData: any) => {\r\n const message = prepareValueForSerialization(messageData);\r\n try {\r\n agent.postMessage(name, message);\r\n } catch (e) {\r\n console.error('postmessage failed');\r\n console.error(e);\r\n console.log('message', message);\r\n }\r\n };\r\n\r\n Diagnostics.send(\r\n 'eligius-diagnostics-factory',\r\n 'Diagnostics initialized'\r\n );\r\n } else {\r\n console.warn(\r\n `${DEV_TOOLS_KEY} property not found on window, please install the Eligius Devtools extension.`\r\n );\r\n }\r\n }\r\n\r\n destroy() {\r\n this._eventRemovers.forEach(x => x());\r\n }\r\n\r\n private _resizeHandler() {\r\n if (this._resizeTimeout) {\r\n clearTimeout(this._resizeTimeout);\r\n this._resizeTimeout = -1;\r\n }\r\n this._resizeTimeout = setTimeout(() => {\r\n this._eventbus.broadcast('timeline-resize', []);\r\n }, 200);\r\n }\r\n\r\n private _importSystemEntryWithEventbusDependency(systemName: string): any {\r\n const ctor = this._importSystemEntry(systemName);\r\n return new ctor(this._eventbus);\r\n }\r\n\r\n private _importSystemEntry(systemName: string): any {\r\n return this._importer.import(systemName)[systemName];\r\n }\r\n\r\n private _requestInstanceHandler(\r\n systemName: string,\r\n resultCallback: TResultCallback<any>\r\n ) {\r\n resultCallback(this._importSystemEntryWithEventbusDependency(systemName));\r\n }\r\n\r\n private _requestFunctionHandler(\r\n systemName: string,\r\n resultCallback: TResultCallback<any>\r\n ) {\r\n resultCallback(this._importSystemEntry(systemName));\r\n }\r\n\r\n private _requestActionHandler(\r\n systemName: string,\r\n resultCallback: TResultCallback<IAction | null>\r\n ) {\r\n const action = this._actionsLookup[systemName];\r\n if (action) {\r\n resultCallback(action);\r\n } else {\r\n console.error(`Unknown action: ${systemName}`);\r\n resultCallback(null);\r\n }\r\n }\r\n\r\n createEngine(\r\n configuration: IEngineConfiguration,\r\n resolver?: IConfigurationResolver\r\n ): IEligiusEngine {\r\n const {systemName} = configuration.engine;\r\n const EngineClass = this._importSystemEntry(systemName);\r\n\r\n let actionRegistryListener: ActionRegistryEventbusListener | undefined;\r\n if (configuration.eventActions?.length) {\r\n actionRegistryListener = new ActionRegistryEventbusListener();\r\n this._eventRemovers.push(\r\n this._eventbus.registerEventlistener(actionRegistryListener)\r\n );\r\n }\r\n\r\n this._eventRemovers.push(\r\n this._eventbus.registerInterceptor(\r\n 'request-timeline-uri',\r\n new RequestVideoUriInterceptor(this._eventbus)\r\n )\r\n );\r\n\r\n resolver =\r\n resolver || new ConfigurationResolver(this._importer, this._eventbus);\r\n const [actionLookup, resolvedConfiguration] = resolver.process(\r\n configuration,\r\n actionRegistryListener\r\n );\r\n this._actionsLookup = actionLookup;\r\n\r\n const timelineProviders = this._createTimelineProviders(\r\n resolvedConfiguration\r\n );\r\n\r\n const {language, labels} = configuration;\r\n const languageManager = new LanguageManager(\r\n language,\r\n labels,\r\n this._eventbus\r\n );\r\n\r\n const engineInstance = new EngineClass(\r\n resolvedConfiguration,\r\n this._eventbus,\r\n timelineProviders,\r\n languageManager\r\n );\r\n\r\n return engineInstance;\r\n }\r\n\r\n private _createTimelineProviders(\r\n configuration: IResolvedEngineConfiguration\r\n ): Record<TimelineTypes, ITimelineProviderInfo> {\r\n const {timelineProviderSettings} = configuration;\r\n\r\n const result = Object.entries(timelineProviderSettings).reduce<\r\n Record<TimelineTypes, ITimelineProviderInfo>\r\n >(\r\n (acc, [timelineType, settings]) => {\r\n if (!settings) {\r\n return acc;\r\n }\r\n\r\n const TimelineProviderClass = this._importSystemEntry(\r\n settings.systemName\r\n );\r\n acc[timelineType as TimelineTypes] = {\r\n id: settings.id,\r\n vendor: settings.vendor,\r\n provider: new TimelineProviderClass(configuration),\r\n };\r\n return acc;\r\n },\r\n {} as Record<TimelineTypes, ITimelineProviderInfo>\r\n );\r\n\r\n return result;\r\n }\r\n}\r\n","import { type BeforeRequestTimelineUriEvent } from \"../before-request-timeline-uri.ts\";\nimport { type IEventMetadata } from \"./types.ts\";\n\nexport function beforeRequestTimelineUri(): IEventMetadata<BeforeRequestTimelineUriEvent['args']> {\n return {\n description: `Event: before-request-timeline-uri`,\n category: `Timeline`,\n args: []\n };\n}\n","import { type BeforeRequestVideoUrlEvent } from \"../before-request-video-url.ts\";\nimport { type IEventMetadata } from \"./types.ts\";\n\nexport function beforeRequestVideoUrl(): IEventMetadata<BeforeRequestVideoUrlEvent['args']> {\n return {\n description: `Event: before-request-video-url`,\n category: `Navigation`,\n args: [\n {\n name: 'index',\n type: 'number'\n },\n {\n name: 'requestedVideoPosition',\n type: 'number'\n },\n {\n name: 'isHistoryRequest',\n type: 'boolean'\n }]\n };\n}\n","import { type DomMutationEvent } from \"../dom-mutation.ts\";\nimport { type IEventMetadata } from \"./types.ts\";\n\nexport function domMutation(): IEventMetadata<DomMutationEvent['args']> {\n return {\n description: `Event: dom-mutation`,\n category: `Controller`,\n args: [\n {\n name: 'payload',\n type: 'any'\n }]\n };\n}\n","import { type HighlightNavigationEvent } from \"../highlight-navigation.ts\";\nimport { type IEventMetadata } from \"./types.ts\";\n\nexport function highlightNavigation(): IEventMetadata<HighlightNavigationEvent['args']> {\n return {\n description: `Event: highlight-navigation`,\n category: `Navigation`,\n args: [\n {\n name: 'videoUrlIndex',\n type: 'number'\n }]\n };\n}\n","import { type LanguageChangeEvent } from \"../language-change.ts\";\nimport { type IEventMetadata } from \"./types.ts\";\n\nexport function languageChange(): IEventMetadata<LanguageChangeEvent['args']> {\n return {\n description: `Event: language-change`,\n category: `Language Manager`,\n args: [\n {\n name: 'language',\n type: 'TLanguageCode'\n }]\n };\n}\n","import { type NavigateToVideoUrlEvent } from \"../navigate-to-video-url.ts\";\nimport { type IEventMetadata } from \"./types.ts\";\n\nexport function navigateToVideoUrl(): IEventMetadata<NavigateToVideoUrlEvent['args']> {\n return {\n description: `Event: navigate-to-video-url`,\n category: `Navigation`,\n args: [\n {\n name: 'index',\n type: 'number'\n },\n {\n name: 'requestedVideoPosition',\n type: 'number'\n }]\n };\n}\n","import { type PushHistoryStateEvent } from \"../push-history-state.ts\";\nimport { type IEventMetadata } from \"./types.ts\";\n\nexport function pushHistoryState(): IEventMetadata<PushHistoryStateEvent['args']> {\n return {\n description: `Event: push-history-state`,\n category: `Navigation`,\n args: [\n {\n name: 'state',\n type: 'any'\n }]\n };\n}\n","import { type RequestActionEvent } from \"../request-action.ts\";\nimport { type IEventMetadata } from \"./types.ts\";\n\nexport function requestAction(): IEventMetadata<RequestActionEvent['args']> {\n return {\n description: `Event: request-action`,\n category: `Engine Request`,\n args: [\n {\n name: 'actionName',\n type: 'string'\n },\n {\n name: 'callback',\n type: '(actionInstance: any) => void'\n }]\n };\n}\n","import { type RequestCurrentLanguageEvent } from \"../request-current-language.ts\";\nimport { type IEventMetadata } from \"./types.ts\";\n\nexport function requestCurrentLanguage(): IEventMetadata<RequestCurrentLanguageEvent['args']> {\n return {\n description: `Event: request-current-language`,\n category: `Engine Request`,\n args: [\n {\n name: 'callback',\n type: '(language: TLanguageCode) => void'\n }]\n };\n}\n","import { type RequestCurrentNavigationEvent } from \"../request-current-navigation.ts\";\nimport { type IEventMetadata } from \"./types.ts\";\n\nexport function requestCurrentNavigation(): IEventMetadata<RequestCurrentNavigationEvent['args']> {\n return {\n description: `Event: request-current-navigation`,\n category: `Navigation`,\n args: [\n {\n name: 'callback',\n type: '(navigation: any) => void'\n }]\n };\n}\n","import { type RequestCurrentTimelinePositionEvent } from \"../request-current-timeline-position.ts\";\nimport { type IEventMetadata } from \"./types.ts\";\n\nexport function requestCurrentTimelinePosition(): IEventMetadata<RequestCurrentTimelinePositionEvent['args']> {\n return {\n description: `Event: request-current-timeline-position`,\n category: `Engine Request`,\n args: []\n };\n}\n","import { type RequestCurrentVideoPositionEvent } from \"../request-current-video-position.ts\";\nimport { type IEventMetadata } from \"./types.ts\";\n\nexport function requestCurrentVideoPosition(): IEventMetadata<RequestCurrentVideoPositionEvent['args']> {\n return {\n description: `Event: request-current-video-position`,\n category: `Navigation`,\n args: [\n {\n name: 'callback',\n type: '(position: number) => void'\n }]\n };\n}\n","import { type RequestEngineRootEvent } from \"../request-engine-root.ts\";\nimport { type IEventMetadata } from \"./types.ts\";\n\nexport function requestEngineRoot(): IEventMetadata<RequestEngineRootEvent['args']> {\n return {\n description: `Event: request-engine-root`,\n category: `Engine Request`,\n args: [\n {\n name: 'callback',\n type: '(root: any) => void'\n }]\n };\n}\n","import { type RequestFunctionEvent } from \"../request-function.ts\";\nimport { type IEventMetadata } from \"./types.ts\";\n\nexport function requestFunction(): IEventMetadata<RequestFunctionEvent['args']> {\n return {\n description: `Event: request-function`,\n category: `Engine Request`,\n args: [\n {\n name: 'systemName',\n type: 'string'\n },\n {\n name: 'callback',\n type: '(fn: any) => void'\n }]\n };\n}\n","import { type RequestInstanceEvent } from \"../request-instance.ts\";\nimport { type IEventMetadata } from \"./types.ts\";\n\nexport function requestInstance(): IEventMetadata<RequestInstanceEvent['args']> {\n return {\n description: `Event: request-instance`,\n category: `Engine Request`,\n args: [\n {\n name: 'instanceName',\n type: 'string'\n },\n {\n name: 'callback',\n type: '(instance: any) => void'\n }]\n };\n}\n","import { type RequestLabelCollectionEvent } from \"../request-label-collection.ts\";\nimport { type IEventMetadata } from \"./types.ts\";\n\nexport function requestLabelCollection(): IEventMetadata<RequestLabelCollectionEvent['args']> {\n return {\n description: `Event: request-label-collection`,\n category: `Engine Request`,\n args: [\n {\n name: 'language',\n type: 'string'\n },\n {\n name: 'callback',\n type: '(collection: any) => void'\n }]\n };\n}\n","import { type RequestLabelCollectionsEvent } from \"../request-label-collections.ts\";\nimport { type IEventMetadata } from \"./types.ts\";\n\nexport function requestLabelCollections(): IEventMetadata<RequestLabelCollectionsEvent['args']> {\n return {\n description: `Event: request-label-collections`,\n category: `Engine Request`,\n args: [\n {\n name: 'labelIds',\n type: 'string[]'\n },\n {\n name: 'callback',\n type: '(collections: any) => void'\n }]\n };\n}\n","import { type RequestTimelineCleanupEvent } from \"../request-timeline-cleanup.ts\";\nimport { type IEventMetadata } from \"./types.ts\";\n\nexport function requestTimelineCleanup(): IEventMetadata<RequestTimelineCleanupEvent['args']> {\n return {\n description: `Event: request-timeline-cleanup`,\n category: `Engine Request`,\n args: []\n };\n}\n","import { type RequestTimelineUriEvent } from \"../request-timeline-uri.ts\";\nimport { type IEventMetadata } from \"./types.ts\";\n\nexport function requestTimelineUri(): IEventMetadata<RequestTimelineUriEvent['args']> {\n return {\n description: `Event: request-timeline-uri`,\n category: `Engine Request`,\n args: []\n };\n}\n","import { type RequestVideoCleanupEvent } from \"../request-video-cleanup.ts\";\nimport { type IEventMetadata } from \"./types.ts\";\n\nexport function requestVideoCleanup(): IEventMetadata<RequestVideoCleanupEvent['args']> {\n return {\n description: `Event: request-video-cleanup`,\n category: `Navigation`,\n args: []\n };\n}\n","import { type RequestVideoUrlEvent } from \"../request-video-url.ts\";\nimport { type IEventMetadata } from \"./types.ts\";\n\nexport function requestVideoUrl(): IEventMetadata<RequestVideoUrlEvent['args']> {\n return {\n description: `Event: request-video-url`,\n category: `Navigation`,\n args: [\n {\n name: 'videoUrlIndex',\n type: 'number'\n },\n {\n name: 'requestedVideoPosition',\n type: 'number'\n },\n {\n name: 'fromRouting',\n type: 'boolean'\n }]\n };\n}\n","import { type CompleteEvent } from \"../timeline-complete.ts\";\nimport { type IEventMetadata } from \"./types.ts\";\n\nexport function timelineComplete(): IEventMetadata<CompleteEvent['args']> {\n return {\n description: `Event: timeline-complete`,\n category: `Timeline`,\n args: []\n };\n}\n","import { type ContainerRequestEvent } from \"../timeline-container-request.ts\";\nimport { type IEventMetadata } from \"./types.ts\";\n\nexport function timelineContainerRequest(): IEventMetadata<ContainerRequestEvent['args']> {\n return {\n description: `Event: timeline-container-request`,\n category: `Timeline`,\n args: [\n {\n name: 'callback',\n type: '(element: HTMLElement) => void'\n }]\n };\n}\n","import { type CurrentTimelineChangeEvent } from \"../timeline-current-timeline-change.ts\";\nimport { type IEventMetadata } from \"./types.ts\";\n\nexport function timelineCurrentTimelineChange(): IEventMetadata<CurrentTimelineChangeEvent['args']> {\n return {\n description: `Event: timeline-current-timeline-change`,\n category: `Timeline`,\n args: [\n {\n name: 'timelineUri',\n type: 'string'\n }]\n };\n}\n","import { type DurationRequestEvent } from \"../timeline-duration-request.ts\";\nimport { type IEventMetadata } from \"./types.ts\";\n\nexport function timelineDurationRequest(): IEventMetadata<DurationRequestEvent['args']> {\n return {\n description: `Event: timeline-duration-request`,\n category: `Timeline`,\n args: [\n {\n name: 'callback',\n type: '(duration: number) => void'\n }]\n };\n}\n","import { type DurationEvent } from \"../timeline-duration.ts\";\nimport { type IEventMetadata } from \"./types.ts\";\n\nexport function timelineDuration(): IEventMetadata<DurationEvent['args']> {\n return {\n description: `Event: timeline-duration`,\n category: `Timeline`,\n args: [\n {\n name: 'getDuration',\n type: '(() => number) | undefined'\n }]\n };\n}\n","import { type FirstFrameEvent } from \"../timeline-firstframe.ts\";\nimport { type IEventMetadata } from \"./types.ts\";\n\nexport function timelineFirstframe(): IEventMetadata<FirstFrameEvent['args']> {\n return {\n description: `Event: timeline-firstframe`,\n category: `Timeline`,\n args: []\n };\n}\n","import { type PauseRequestEvent } from \"../timeline-pause-request.ts\";\nimport { type IEventMetadata } from \"./types.ts\";\n\nexport function timelinePauseRequest(): IEventMetadata<PauseRequestEvent['args']> {\n return {\n description: `Event: timeline-pause-request`,\n category: `Timeline`,\n args: []\n };\n}\n","import { type PauseEvent } from \"../timeline-pause.ts\";\nimport { type IEventMetadata } from \"./types.ts\";\n\nexport function timelinePause(): IEventMetadata<PauseEvent['args']> {\n return {\n description: `Event: timeline-pause`,\n category: `Timeline`,\n args: []\n };\n}\n","import { type PlayRequestEvent } from \"../timeline-play-request.ts\";\nimport { type IEventMetadata } from \"./types.ts\";\n\nexport function timelinePlayRequest(): IEventMetadata<PlayRequestEvent['args']> {\n return {\n description: `Event: timeline-play-request`,\n category: `Timeline`,\n args: []\n };\n}\n","import { type PlayToggleRequestEvent } from \"../timeline-play-toggle-request.ts\";\nimport { type IEventMetadata } from \"./types.ts\";\n\nexport function timelinePlayToggleRequest(): IEventMetadata<PlayToggleRequestEvent['args']> {\n return {\n description: `Event: timeline-play-toggle-request`,\n category: `Timeline`,\n args: []\n };\n}\n","import { type PlayEvent } from \"../timeline-play.ts\";\nimport { type IEventMetadata } from \"./types.ts\";\n\nexport function timelinePlay(): IEventMetadata<PlayEvent['args']> {\n return {\n description: `Event: timeline-play`,\n category: `Timeline`,\n args: []\n };\n}\n","import { type RequestCurrentTimelineEvent } from \"../timeline-request-current-timeline.ts\";\nimport { type IEventMetadata } from \"./types.ts\";\n\nexport function timelineRequestCurrentTimeline(): IEventMetadata<RequestCurrentTimelineEvent['args']> {\n return {\n description: `Event: timeline-request-current-timeline`,\n category: `Engine Request`,\n args: []\n };\n}\n","import { type ResizeRequestEvent } from \"../timeline-resize-request.ts\";\nimport { type IEventMetadata } from \"./types.ts\";\n\nexport function timelineResizeRequest(): IEventMetadata<ResizeRequestEvent['args']> {\n return {\n description: `Event: timeline-resize-request`,\n category: `Timeline`,\n args: []\n };\n}\n","import { type ResizeEvent } from \"../timeline-resize.ts\";\nimport { type IEventMetadata } from \"./types.ts\";\n\nexport function timelineResize(): IEventMetadata<ResizeEvent['args']> {\n return {\n description: `Event: timeline-resize`,\n category: `Timeline`,\n args: []\n };\n}\n","import { type RestartEvent } from \"../timeline-restart.ts\";\nimport { type IEventMetadata } from \"./types.ts\";\n\nexport function timelineRestart(): IEventMetadata<RestartEvent['args']> {\n return {\n description: `Event: timeline-restart`,\n category: `Timeline`,\n args: []\n };\n}\n","import { type SeekRequestEvent } from \"../timeline-seek-request.ts\";\nimport { type IEventMetadata } from \"./types.ts\";\n\nexport function timelineSeekRequest(): IEventMetadata<SeekRequestEvent['args']> {\n return {\n description: `Event: timeline-seek-request`,\n category: `Timeline`,\n args: [\n {\n name: 'position',\n type: 'number'\n }]\n };\n}\n","import { type SeekEvent } from \"../timeline-seek.ts\";\nimport { type IEventMetadata } from \"./types.ts\";\n\nexport function timelineSeek(): IEventMetadata<SeekEvent['args']> {\n return {\n description: `Event: timeline-seek`,\n category: `Timeline`,\n args: [\n {\n name: 'seekPosition',\n type: 'number'\n },\n {\n name: 'currentPosition',\n type: 'number'\n },\n {\n name: 'duration',\n type: 'number'\n }]\n };\n}\n","import { type SeekedEvent } from \"../timeline-seeked.ts\";\nimport { type IEventMetadata } from \"./types.ts\";\n\nexport function timelineSeeked(): IEventMetadata<SeekedEvent['args']> {\n return {\n description: `Event: timeline-seeked`,\n category: `Timeline`,\n args: [\n {\n name: 'position',\n type: 'number'\n },\n {\n name: 'duration',\n type: 'number'\n }]\n };\n}\n","import { type StopRequestEvent } from \"../timeline-stop-request.ts\";\nimport { type IEventMetadata } from \"./types.ts\";\n\nexport function timelineStopRequest(): IEventMetadata<StopRequestEvent['args']> {\n return {\n description: `Event: timeline-stop-request`,\n category: `Timeline`,\n args: []\n };\n}\n","import { type StopEvent } from \"../timeline-stop.ts\";\nimport { type IEventMetadata } from \"./types.ts\";\n\nexport function timelineStop(): IEventMetadata<StopEvent['args']> {\n return {\n description: `Event: timeline-stop`,\n category: `Timeline`,\n args: []\n };\n}\n","import { type TimeEvent } from \"../timeline-time.ts\";\nimport { type IEventMetadata } from \"./types.ts\";\n\nexport function timelineTime(): IEventMetadata<TimeEvent['args']> {\n return {\n description: `Event: timeline-time`,\n category: `Timeline`,\n args: [\n {\n name: 'position',\n type: 'number'\n }]\n };\n}\n","import { type VideoCompleteEvent } from \"../video-complete.ts\";\nimport { type IEventMetadata } from \"./types.ts\";\n\nexport function videoComplete(): IEventMetadata<VideoCompleteEvent['args']> {\n return {\n description: `Event: video-complete`,\n category: `Navigation`,\n args: [\n {\n name: 'index',\n type: 'number'\n }]\n };\n}\n","export { beforeRequestTimelineUri } from \"./before-request-timeline-uri.ts\";\nexport { beforeRequestVideoUrl } from \"./before-request-video-url.ts\";\nexport { domMutation } from \"./dom-mutation.ts\";\nexport { highlightNavigation } from \"./highlight-navigation.ts\";\nexport { languageChange } from \"./language-change.ts\";\nexport { navigateToVideoUrl } from \"./navigate-to-video-url.ts\";\nexport { pushHistoryState } from \"./push-history-state.ts\";\nexport { requestAction } from \"./request-action.ts\";\nexport { requestCurrentLanguage } from \"./request-current-language.ts\";\nexport { requestCurrentNavigation } from \"./request-current-navigation.ts\";\nexport { requestCurrentTimelinePosition } from \"./request-current-timeline-position.ts\";\nexport { requestCurrentVideoPosition } from \"./request-current-video-position.ts\";\nexport { requestEngineRoot } from \"./request-engine-root.ts\";\nexport { requestFunction } from \"./request-function.ts\";\nexport { requestInstance } from \"./request-instance.ts\";\nexport { requestLabelCollection } from \"./request-label-collection.ts\";\nexport { requestLabelCollections } from \"./request-label-collections.ts\";\nexport { requestTimelineCleanup } from \"./request-timeline-cleanup.ts\";\nexport { requestTimelineUri } from \"./request-timeline-uri.ts\";\nexport { requestVideoCleanup } from \"./request-video-cleanup.ts\";\nexport { requestVideoUrl } from \"./request-video-url.ts\";\nexport { timelineComplete } from \"./timeline-complete.ts\";\nexport { timelineContainerRequest } from \"./timeline-container-request.ts\";\nexport { timelineCurrentTimelineChange } from \"./timeline-current-timeline-change.ts\";\nexport { timelineDurationRequest } from \"./timeline-duration-request.ts\";\nexport { timelineDuration } from \"./timeline-duration.ts\";\nexport { timelineFirstframe } from \"./timeline-firstframe.ts\";\nexport { timelinePauseRequest } from \"./timeline-pause-request.ts\";\nexport { timelinePause } from \"./timeline-pause.ts\";\nexport { timelinePlayRequest } from \"./timeline-play-request.ts\";\nexport { timelinePlayToggleRequest } from \"./timeline-play-toggle-request.ts\";\nexport { timelinePlay } from \"./timeline-play.ts\";\nexport { timelineRequestCurrentTimeline } from \"./timeline-request-current-timeline.ts\";\nexport { timelineResizeRequest } from \"./timeline-resize-request.ts\";\nexport { timelineResize } from \"./timeline-resize.ts\";\nexport { timelineRestart } from \"./timeline-restart.ts\";\nexport { timelineSeekRequest } from \"./timeline-seek-request.ts\";\nexport { timelineSeek } from \"./timeline-seek.ts\";\nexport { timelineSeeked } from \"./timeline-seeked.ts\";\nexport { timelineStopRequest } from \"./timeline-stop-request.ts\";\nexport { timelineStop } from \"./timeline-stop.ts\";\nexport { timelineTime } from \"./timeline-time.ts\";\nexport { videoComplete } from \"./video-complete.ts\";\nexport * from \"./types.ts\";\n","import * as ctrls from '../controllers/index.ts';\r\nimport {EligiusEngine} from '../eligius-engine.ts';\r\nimport * as evtb from '../eventbus/index.ts';\r\nimport * as ops from '../operation/index.ts';\r\nimport type {TOperation} from '../operation/types.ts';\r\nimport * as prvdrs from '../timelineproviders/index.ts';\r\nimport type {IResourceImporter} from '../types.ts';\r\n\r\nconst operations: Record<string, TOperation<any>> = ops as any;\r\nconst controllers: Record<string, any> = ctrls;\r\nconst providers: Record<string, any> = prvdrs;\r\nconst eventbus: Record<string, any> = evtb;\r\n\r\nexport class EligiusResourceImporter implements IResourceImporter {\r\n engines = new Map();\r\n constructor() {\r\n this.engines.set('EligiusEngine', EligiusEngine);\r\n }\r\n\r\n getOperationNames(): string[] {\r\n return Object.keys(operations);\r\n }\r\n\r\n getControllerNames(): string[] {\r\n return Object.keys(controllers);\r\n }\r\n\r\n getProviderNames(): string[] {\r\n return Object.keys(providers);\r\n }\r\n\r\n import(name: string): Record<string, any> {\r\n const value =\r\n operations[name] ??\r\n controllers[name] ??\r\n providers[name] ??\r\n eventbus[name] ??\r\n this.engines.get(name);\r\n\r\n return {[name]: value};\r\n }\r\n}\r\n"],"mappings":";;;;;;;;;;;AAAA,SAAgB,WAAW,OAA2C;AACpE,QAAO,OAAO,UAAU;;;;;ACD1B,SAAgB,SACd,OACuC;AACvC,QAAO,CAAC,CAAC,SAAS,OAAO,UAAU,YAAY,CAAC,MAAM,QAAQ,MAAM;;;;;ACCtE,SAAgB,6BAA6B,OAAqB;AAChE,KAAI,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;;;ACjBH,SAAgB,iBAAsD;AACpE,QAAO;EACL,aAAa;EACb,UAAU;EACV,MAAM,CACJ;GACE,MAAM;GACN,MAAM;GACP,EACD;GACE,MAAM;GACN,MAAM;GACP,CAAC;EACL;;;;;ACbH,SAAgB,sBAAgE;AAC9E,QAAO;EACL,aAAa;EACb,UAAU;EACV,MAAM,EAAE;EACT;;;;;ACLH,SAAgB,eAAkD;AAChE,QAAO;EACL,aAAa;EACb,UAAU;EACV,MAAM,EAAE;EACT;;;;;ACLH,SAAgB,eAAkD;AAChE,QAAO;EACL,aAAa;EACb,UAAU;EACV,MAAM,CACJ;GACE,MAAM;GACN,MAAM;GACP,CAAC;EACL;;;;;ACTH,SAAgB,gBAA4D;AAC1E,QAAO;EACL,aAAa;EACb,UAAU;EACV,MAAM,CACJ;GACE,MAAM;GACN,MAAM;GACP,CAAC;EACL;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AEJH,MAAMC,aAA8CC;AACpD,MAAMC,cAAmCC;AACzC,MAAMC,YAAiCC;AACvC,MAAMC,WAAgCC;AAEtC,IAAa,0BAAb,MAAkE;CAChE,0BAAU,IAAI,KAAK;CACnB,cAAc;AACZ,OAAK,QAAQ,IAAI,iBAAiB,cAAc;;CAGlD,oBAA8B;AAC5B,SAAO,OAAO,KAAK,WAAW;;CAGhC,qBAA+B;AAC7B,SAAO,OAAO,KAAK,YAAY;;CAGjC,mBAA6B;AAC3B,SAAO,OAAO,KAAK,UAAU;;CAG/B,OAAO,MAAmC;EACxC,MAAM,QACJ,WAAW,SACX,YAAY,SACZ,UAAU,SACV,SAAS,SACT,KAAK,QAAQ,IAAI,KAAK;AAExB,SAAO,GAAE,OAAO,OAAM"}
|
|
1
|
+
{"version":3,"file":"index.mjs","names":["jQuery","agent: IDiagnosticsAgent","active: boolean","cache: TGlobalCache","cache","getGlobals: (name?: string) => TGlobalCache | any","setGlobals: (newValues: TGlobalCache) => void","clearGlobals: () => void","forEach: TOperation<IForEachOperationData>","when: TOperation<\n IWhenOperationData,\n Omit<IWhenOperationData, 'expression'>\n>","evaluations: Record<\n TOperator,\n (left: string | number, right: string | number) => boolean\n>","name: string","startOperations: IResolvedOperation[]","eventbus: IEventbus","operations","endOperations: IResolvedOperation[]","duration: IStrictDuration","addClass: TOperation<\n IAddClassOperationData,\n Omit<IAddClassOperationData, 'className'>\n>","controllers","addControllerToElement: TOperation<IAddControllerToElementOperationData>","addGlobalsToOperation: TOperation<\n IAddGlobalsToOperationData,\n Omit<IAddGlobalsToOperationData, 'globalProperties'>\n>","animate: TOperation<\n IAnimateOperationData,\n Omit<\n IAnimateOperationData,\n 'animationEasing' | 'animationProperties' | 'animationDuration'\n >\n>","animateWithClass: TOperation<\n IAnimateWithClassOperationData,\n Promise<IAnimateWithClassOperationData>\n>","removeClass","announceToScreenReader: TOperation<\n IAnnounceToScreenReaderOperationData,\n Omit<IAnnounceToScreenReaderOperationData, 'message' | 'priority'>\n>","breakForEach: TOperation<TOperationData>","broadcastEvent: TOperation<\n IBroadcastEventOperationData,\n Omit<IBroadcastEventOperationData, 'eventArgs' | 'eventTopic' | 'eventName'>\n>","cache: any[]","resolvePropertyChain","calcFunctions: Record<\n TCalculationOperator,\n (left: number, right: number) => number\n>","calc: TOperation<\n ICalcOperationData,\n Omit<ICalcOperationData, 'left' | 'right' | 'operator'>\n>","clearElement: TOperation<IClearElementOperationData>","clearOperationData: TOperation<\n IClearOperationDataOperationData,\n Omit<IClearOperationDataOperationData, 'properties'>\n>","clearStorage: TOperation<\n IClearStorageOperationData,\n Omit<IClearStorageOperationData, 'key' | 'storageType'>\n>","compareDate: TOperation<\n ICompareDateOperationData,\n Omit<ICompareDateOperationData, 'date1' | 'date2'>\n>","concatenateStrings: TOperation<\n IConcatenateStringsOperationData,\n Omit<IConcatenateStringsOperationData, 'strings' | 'separator'>\n>","continueForEach: TOperation<TOperationData>","createElement: TOperation<\n ICreateElementOperationData<TTagNames>,\n Omit<\n RequireKeys<ICreateElementOperationData<TTagNames>, 'template'>,\n 'elementName' | 'text' | 'attributes'\n >\n>","customFunction: TOperation<\n ICustomFunctionOperationData,\n Omit<ICustomFunctionOperationData, 'systemName'>\n>","endAction: TOperation<\n IEndActionOperationData,\n Omit<IEndActionOperationData, 'actionOperationData'>\n>","endForEach: TOperation<TOperationData>","endWhen: TOperation<Record<string, unknown>>","extendController: TOperation<\n IExtendControllerOperationData,\n Omit<IExtendControllerOperationData, 'controllerExtension'>\n>","filterArray: TOperation<\n IFilterArrayOperationData,\n Omit<\n IFilterArrayOperationData,\n 'filterProperty' | 'filterValue' | 'filterPredicate'\n >\n>","filtered: any[]","findInArray: TOperation<\n IFindInArrayOperationData,\n Omit<\n IFindInArrayOperationData,\n 'findProperty' | 'findValue' | 'findPredicate'\n >\n>","foundItem: any | undefined","formatDate: TOperation<\n IFormatDateOperationData,\n Omit<IFormatDateOperationData, 'format'>\n>","formatText: TOperation<\n IFormatTextOperationData,\n Omit<IFormatTextOperationData, 'transformation'>\n>","getAttributesFromElement: TOperation<\n IGetAttributesFromElementOperationData,\n Omit<IGetAttributesFromElementOperationData, 'attributeNames'>\n>","getControllerFromElement: TOperation<\n IGetControllerFromElementOperationData,\n Omit<IGetControllerFromElementOperationData, 'controllerName'>\n>","getControllerInstance: TOperation<\n IGetControllerInstanceOperationData,\n Omit<IGetControllerInstanceOperationData, 'systemName'>\n>","getCurrentTime: TOperation<\n IGetCurrentTimeOperationData,\n IGetCurrentTimeOperationData\n>","suffix: string | null","ratioModifier: string | null","getElementDimensions: TOperation<\n IGetElementDimensionsOperationData,\n Omit<IGetElementDimensionsOperationData, 'modifier'>\n>","getFocusedElement: TOperation<\n IGetFocusedElementOperationData,\n IGetFocusedElementOperationData\n>","getFormData: TOperation<\n IGetFormDataOperationData,\n IGetFormDataOperationData\n>","formData: Record<string, any>","getImport: TOperation<\n IGetImportOperationData,\n Omit<RequireKeys<IGetImportOperationData, 'importedInstance'>, 'systemName'>\n>","getQueryParams: TOperation<\n IGetQueryParamsOperationData,\n Omit<IGetQueryParamsOperationData, 'defaultValues'>\n>","getScrollPosition: TOperation<\n IGetScrollPositionOperationData,\n IGetScrollPositionOperationData\n>","getTextContent: TOperation<\n IGetTextContentOperationData,\n IGetTextContentOperationData\n>","httpDelete: TOperation<\n IHttpDeleteOperationData,\n Omit<IHttpDeleteOperationData, 'url' | 'headers'>\n>","httpPost: TOperation<\n IHttpPostOperationData,\n Omit<IHttpPostOperationData, 'url' | 'body' | 'headers'>\n>","httpPut: TOperation<\n IHttpPutOperationData,\n Omit<IHttpPutOperationData, 'url' | 'body' | 'headers'>\n>","invokeObjectMethod: TOperation<\n IInvokeObjectMethodOperationData,\n Omit<IInvokeObjectMethodOperationData, 'methodName' | 'methodArguments'>\n>","isElementInViewport: TOperation<\n IIsElementInViewportOperationData,\n IIsElementInViewportOperationData\n>","loadFromStorage: TOperation<\n ILoadFromStorageOperationData,\n Omit<ILoadFromStorageOperationData, 'storageType'>\n>","jsonCache: Record<string, unknown>","loadJson: TOperation<\n ILoadJSONOperationData,\n Omit<ILoadJSONOperationData, 'url' | 'cache'>\n>","cache","log: TOperation<\n ILogOperationData,\n Omit<ILogOperationData, 'logValue' | 'logName'>\n>","mapArray: TOperation<\n IMapArrayOperationData,\n Omit<IMapArrayOperationData, 'mapFunction'>\n>","math: TOperation<\n IMathOperationData,\n Omit<IMathOperationData, 'args' | 'functionName'>\n>","otherwise: TOperation<Record<string, unknown>>","removeClass: TOperation<\n IRemoveClassOperationData,\n Omit<IRemoveClassOperationData, 'className'>\n>","removeControllerFromElement: TOperation<\n IRemoveControllerFromElementOperationData,\n Omit<IRemoveControllerFromElementOperationData, 'controllerName'>\n>","controllers","removeElement: TOperation<IRemoveElementOperationData>","removePropertiesFromOperationData: TOperation<\n IRemovePropertiesFromOperationDataOperationData,\n Omit<IRemovePropertiesFromOperationDataOperationData, 'propertyNames'>\n>","reparentElement: TOperation<\n IReparentElementOperationData,\n Omit<IReparentElementOperationData, 'newParentSelector'>\n>","replaceString: TOperation<\n IReplaceStringOperationData,\n Omit<IReplaceStringOperationData, 'pattern' | 'replacement'>\n>","replaceText: TOperation<\n IReplaceTextOperationData,\n Omit<IReplaceTextOperationData, 'searchPattern' | 'replacement'>\n>","newText: string","requestAction: TOperation<\n IRequestActionOperationData,\n Omit<Required<IRequestActionOperationData>, 'systemName'>\n>","saveToStorage: TOperation<\n ISaveToStorageOperationData,\n Omit<ISaveToStorageOperationData, 'value' | 'storageType'>\n>","scrollToElement: TOperation<\n IScrollToElementOperationData,\n Omit<IScrollToElementOperationData, 'behavior' | 'block' | 'inline'>\n>","scrollToPosition: TOperation<\n IScrollToPositionOperationData,\n Omit<IScrollToPositionOperationData, 'x' | 'y' | 'behavior'>\n>","selectElement: TOperation<\n ISelectElementOperationData,\n Omit<ISelectElementOperationData, 'selector' | 'useSelectedElementAsRoot'>\n>","setData: TOperation<\n ISetDataOperationData,\n Omit<ISetDataOperationData, 'properties'>\n>","setElementAttributes: TOperation<\n ISetElementAttributesOperationData,\n Omit<ISetElementAttributesOperationData, 'attributes'>\n>","setElementContent: TOperation<\n ISetElementContentOperationData,\n Omit<ISetElementContentOperationData, 'template' | 'insertionType'>\n>","setFocus: TOperation<\n ISetFocusOperationData,\n ISetFocusOperationData\n>","setFormValue: TOperation<\n ISetFormValueOperationData,\n Omit<ISetFormValueOperationData, 'value'>\n>","setGlobalData: TOperation<\n ISetGlobalDataOperationData,\n Omit<ISetGlobalDataOperationData, 'propertyNames'>\n>","setOperationData: TOperation<\n ISetOperationData,\n Omit<ISetOperationData, 'override' | 'properties'>\n>","setStyle: TOperation<\n ISetStyleOperationData,\n Omit<ISetStyleOperationData, 'properties'>\n>","setVariable: TOperation<\n ISetVariableOperationData,\n Omit<ISetVariableOperationData, 'name' | 'value'>\n>","sortArray: TOperation<\n ISortArrayOperationData,\n Omit<ISortArrayOperationData, 'sortProperty' | 'sortOrder' | 'sortComparator'>\n>","splitString: TOperation<\n ISplitStringOperationData,\n Omit<ISplitStringOperationData, 'delimiter' | 'limit'>\n>","startAction: TOperation<\n IStartActionOperationData,\n Omit<IStartActionOperationData, 'actionOperationData'>\n>","substringText: TOperation<\n ISubstringTextOperationData,\n Omit<ISubstringTextOperationData, 'start' | 'end'>\n>","toggleClass: TOperation<\n IToggleClassOperationData,\n Omit<IToggleClassOperationData, 'className'>\n>","toggleElement: TOperation<IToggleElementOperationData>","toggleElement","toggleFormElement: TOperation<\n IToggleFormElementOperationData,\n Omit<IToggleFormElementOperationData, 'enabled'>\n>","validateForm: TOperation<\n IValidateFormOperationData,\n Omit<IValidateFormOperationData, 'validationRules'>\n>","validationErrors: Record<string, string>","wait: TOperation<\n IWaitOperationData,\n Omit<IWaitOperationData, 'milliseconds'>\n>","configurationfactory: ConfigurationFactory","factory: ActionCreatorFactory","uuidv4","operations","actionConfig: T","configurationFactory: ConfigurationFactory","operations","uuidv4","duration: IDuration","operationConfig: IOperationConfiguration<\n ExtractOperationDataType<O>\n >","actionEditor: T","configurationFactory: ConfigurationFactory","languageLabel: ILanguageLabel","item","uuidv4","config: IResolvedEngineConfiguration","providersSettings: TTimelineProviderSettings","configurationFactory: ConfigurationFactory","settings: ITimelineProviderSettings","uuidv4","providerSettings: ITimelineProviderSettings","providersSettingsEditor: TimelineProvidersSettingsEditor","timelineProviders","configuration: IEngineConfiguration","newConfiguration: IEngineConfiguration","uuidv4","timelineConfig: ITimelineConfiguration","eventbus","eventbus","currentLanguage: TLanguageCode","labelCollections: any[]","eventbus","animationSettings: AnimationConfigWithData<'svg'>","eventbus","payload: IMutationEventPayload","eventbus","labelCtrl: LabelController","result: any[]","eventbus","eventbus","result: any[]","eventbus","subtitleTimeLookup: Record<number, () => void>","titleLanguageLookup: Record<string, string>","addClass","addControllerToElement","addGlobalsToOperation","animateWithClass","animate","announceToScreenReader","breakForEach","broadcastEvent","calc","clearElement","clearOperationData","clearStorage","compareDate","concatenateStrings","continueForEach","createElement","customFunction","endAction","endForEach","endWhen","extendController","filterArray","findInArray","forEach","formatDate","formatText","getAttributesFromElement","getControllerFromElement","getControllerInstance","getCurrentTime","getElementDimensions","getFocusedElement","getFormData","getImport","getQueryParams","getScrollPosition","getTextContent","httpDelete","httpPost","httpPut","invokeObjectMethod","isElementInViewport","loadFromStorage","loadJson","log","mapArray","math","otherwise","removeClass","removeControllerFromElement","removeElement","removePropertiesFromOperationData","reparentElement","replaceString","replaceText","requestAction","saveToStorage","scrollToElement","scrollToPosition","selectElement","setData","setElementAttributes","setElementContent","setFocus","setFormValue","setGlobalData","setOperationData","setStyle","setVariable","sortArray","splitString","startAction","substringText","toggleClass","toggleElement","toggleFormElement","validateForm","wait","when","operations","controllers","operationMetadata","result: ISubtitle[]","lines: string[]","i: number","l: number","rawLine: string","caption: Partial<ISubtitle> | null","res: string","times: string[]","parts: string[]","collection: ISubtitleCollection[]","newLanguage: ISubtitleCollection","uuidv4","importer: ISimpleResourceImporter","eventbus: IEventbus","resolvedConfig: IResolvedEngineConfiguration","eventActions: IAction[]","eventbus","DOMEventListenerController","LabelController","LottieController","MutationObserverController","NavigationController","ProgressbarController","RoutingController","SubtitlesController","requestAction","eventbus: IEventbus","configuration: IResolvedEngineConfiguration","eventbus: IEventbus","timelineProviders: Record<TimelineTypes, ITimelineProviderInfo>","languageManager: LanguageManager","operations: Record<string, TOperation<any>>","ops","controllers: Record<string, any>","ctrls","providers: Record<string, any>","prvdrs","eventbus: Record<string, any>","evtb","cache","_currentLanguage: TLanguageCode","_eventbus: IEventbus","eventbus","eventbus","actionRegistryListener: ActionRegistryEventbusListener | undefined"],"sources":["../src/util/guards/is-function.ts","../src/util/guards/is-object.ts","../src/util/prepare-value-for-serialization.ts","../src/diagnostics/devtool-event-listener.ts","../src/diagnostics/diagnostics.ts","../src/diagnostics/types.ts","../src/operation/helper/find-matching-operation-index.ts","../src/operation/helper/get-property-chain-value.ts","../src/operation/helper/deep-copy.ts","../src/operation/helper/globals.ts","../src/operation/helper/resolve-external-property-chain.ts","../src/operation/for-each.ts","../src/operation/helper/remove-operation-properties.ts","../src/operation/when.ts","../src/util/guards/is-promise.ts","../src/action/action.ts","../src/action/endable-action.ts","../src/action/timeline-action.ts","../src/operation/add-class.ts","../src/operation/helper/get-element-data.ts","../src/operation/helper/attach-controller-to-element.ts","../src/operation/helper/merge-operation-data.ts","../src/operation/helper/internal-resolve.ts","../src/operation/add-controller-to-element.ts","../src/operation/add-globals-to-operation.ts","../src/operation/animate.ts","../src/operation/animate-with-class.ts","../src/operation/announce-to-screen-reader.ts","../src/operation/break-for-each.ts","../src/operation/helper/resolve-event-arguments.ts","../src/operation/broadcast-event.ts","../src/operation/helper/resolve-property-values.ts","../src/operation/calc.ts","../src/operation/clear-element.ts","../src/operation/clear-operation-data.ts","../src/operation/clear-storage.ts","../src/operation/compare-date.ts","../src/operation/concatenate-strings.ts","../src/operation/continue-for-each.ts","../src/operation/create-element.ts","../src/operation/custom-function.ts","../src/operation/end-action.ts","../src/operation/end-for-each.ts","../src/operation/end-when.ts","../src/operation/extend-controller.ts","../src/operation/filter-array.ts","../src/operation/find-in-array.ts","../src/operation/format-date.ts","../src/operation/format-text.ts","../src/operation/get-attributes-from-element.ts","../src/operation/get-controller-from-element.ts","../src/operation/get-controller-instance.ts","../src/operation/get-current-time.ts","../src/operation/helper/modify-dimensions.ts","../src/operation/get-element-dimensions.ts","../src/operation/get-focused-element.ts","../src/operation/get-form-data.ts","../src/operation/get-import.ts","../src/operation/get-query-params.ts","../src/operation/get-scroll-position.ts","../src/operation/get-text-content.ts","../src/operation/http-delete.ts","../src/operation/http-post.ts","../src/operation/http-put.ts","../src/operation/invoke-object-method.ts","../src/operation/is-element-in-viewport.ts","../src/operation/load-from-storage.ts","../src/operation/load-json.ts","../src/operation/log.ts","../src/operation/map-array.ts","../src/util/guards/is-string.ts","../src/operation/math.ts","../src/operation/otherwise.ts","../src/operation/remove-class.ts","../src/operation/remove-controller-from-element.ts","../src/operation/remove-element.ts","../src/operation/remove-properties-from-operation-data.ts","../src/operation/reparent-element.ts","../src/operation/replace-string.ts","../src/operation/replace-text.ts","../src/operation/request-action.ts","../src/operation/save-to-storage.ts","../src/operation/scroll-to-element.ts","../src/operation/scroll-to-position.ts","../src/operation/select-element.ts","../src/operation/set-data.ts","../src/operation/set-element-attributes.ts","../src/operation/set-element-content.ts","../src/operation/set-focus.ts","../src/operation/set-form-value.ts","../src/operation/set-global-data.ts","../src/operation/set-operation-data.ts","../src/operation/set-style.ts","../src/operation/set-variable.ts","../src/operation/sort-array.ts","../src/operation/split-string.ts","../src/operation/start-action.ts","../src/operation/substring-text.ts","../src/operation/toggle-class.ts","../src/operation/toggle-element.ts","../src/operation/toggle-form-element.ts","../src/operation/validate-form.ts","../src/operation/wait.ts","../src/operation/index.ts","../src/configuration/api/action-creator-factory.ts","../src/configuration/api/action-editor.ts","../src/configuration/api/label-editor.ts","../src/util/animation-interval.ts","../src/timelineproviders/request-animation-frame-timeline-provider.ts","../src/timelineproviders/video-js-timeline-provider.ts","../src/timelineproviders/index.ts","../src/configuration/api/timeline-provider-settings-editor.ts","../src/util/merge-if-missing.ts","../src/configuration/api/configuration-factory.ts","../src/controllers/dom-event-listener-controller.ts","../src/controllers/base-controller.ts","../src/controllers/label-controller.ts","../src/controllers/lottie-controller.ts","../src/controllers/mutation-observer-controller.ts","../src/controllers/navigation-controller.ts","../src/controllers/progressbar-controller.ts","../src/controllers/routing-controller.ts","../src/controllers/subtitles-controller.ts","../src/controllers/index.ts","../src/operation/metadata/add-class.ts","../src/operation/metadata/add-controller-to-element.ts","../src/operation/metadata/add-globals-to-operation.ts","../src/operation/metadata/animate-with-class.ts","../src/operation/metadata/animate.ts","../src/operation/metadata/announce-to-screen-reader.ts","../src/operation/metadata/break-for-each.ts","../src/operation/metadata/broadcast-event.ts","../src/operation/metadata/calc.ts","../src/operation/metadata/clear-element.ts","../src/operation/metadata/clear-operation-data.ts","../src/operation/metadata/clear-storage.ts","../src/operation/metadata/compare-date.ts","../src/operation/metadata/concatenate-strings.ts","../src/operation/metadata/continue-for-each.ts","../src/operation/metadata/create-element.ts","../src/operation/metadata/custom-function.ts","../src/operation/metadata/end-action.ts","../src/operation/metadata/end-for-each.ts","../src/operation/metadata/end-when.ts","../src/operation/metadata/extend-controller.ts","../src/operation/metadata/filter-array.ts","../src/operation/metadata/find-in-array.ts","../src/operation/metadata/for-each.ts","../src/operation/metadata/format-date.ts","../src/operation/metadata/format-text.ts","../src/operation/metadata/get-attributes-from-element.ts","../src/operation/metadata/get-controller-from-element.ts","../src/operation/metadata/get-controller-instance.ts","../src/operation/metadata/get-current-time.ts","../src/operation/metadata/get-element-dimensions.ts","../src/operation/metadata/get-focused-element.ts","../src/operation/metadata/get-form-data.ts","../src/operation/metadata/get-import.ts","../src/operation/metadata/get-query-params.ts","../src/operation/metadata/get-scroll-position.ts","../src/operation/metadata/get-text-content.ts","../src/operation/metadata/http-delete.ts","../src/operation/metadata/http-post.ts","../src/operation/metadata/http-put.ts","../src/operation/metadata/invoke-object-method.ts","../src/operation/metadata/is-element-in-viewport.ts","../src/operation/metadata/load-from-storage.ts","../src/operation/metadata/load-json.ts","../src/operation/metadata/log.ts","../src/operation/metadata/map-array.ts","../src/operation/metadata/math.ts","../src/operation/metadata/otherwise.ts","../src/operation/metadata/remove-class.ts","../src/operation/metadata/remove-controller-from-element.ts","../src/operation/metadata/remove-element.ts","../src/operation/metadata/remove-properties-from-operation-data.ts","../src/operation/metadata/reparent-element.ts","../src/operation/metadata/replace-string.ts","../src/operation/metadata/replace-text.ts","../src/operation/metadata/request-action.ts","../src/operation/metadata/save-to-storage.ts","../src/operation/metadata/scroll-to-element.ts","../src/operation/metadata/scroll-to-position.ts","../src/operation/metadata/select-element.ts","../src/operation/metadata/set-data.ts","../src/operation/metadata/set-element-attributes.ts","../src/operation/metadata/set-element-content.ts","../src/operation/metadata/set-focus.ts","../src/operation/metadata/set-form-value.ts","../src/operation/metadata/set-global-data.ts","../src/operation/metadata/set-operation-data.ts","../src/operation/metadata/set-style.ts","../src/operation/metadata/set-variable.ts","../src/operation/metadata/sort-array.ts","../src/operation/metadata/split-string.ts","../src/operation/metadata/start-action.ts","../src/operation/metadata/substring-text.ts","../src/operation/metadata/toggle-class.ts","../src/operation/metadata/toggle-element.ts","../src/operation/metadata/toggle-form-element.ts","../src/operation/metadata/validate-form.ts","../src/operation/metadata/wait.ts","../src/operation/metadata/when.ts","../src/operation/metadata/index.ts","../src/configuration/api/name-providers.ts","../src/configuration/api/subtitle-converter.ts","../src/configuration/api/subtitle-editor.ts","../src/operation/helper/resolve-property-chain.ts","../src/configuration/configuration-resolver.ts","../src/controllers/metadata/dom-event-listener-controller.ts","../src/controllers/metadata/label-controller.ts","../src/controllers/metadata/lottie-controller.ts","../src/controllers/metadata/mutation-observer-controller.ts","../src/controllers/metadata/navigation-controller.ts","../src/controllers/metadata/progressbar-controller.ts","../src/controllers/metadata/routing-controller.ts","../src/controllers/metadata/subtitles-controller.ts","../src/controllers/metadata/index.ts","../src/eventbus/events/metadata/before-request-timeline-uri.ts","../src/eventbus/events/metadata/before-request-video-url.ts","../src/eventbus/events/metadata/dom-mutation.ts","../src/eventbus/events/metadata/highlight-navigation.ts","../src/eventbus/events/metadata/language-change.ts","../src/eventbus/events/metadata/navigate-to-video-url.ts","../src/eventbus/events/metadata/push-history-state.ts","../src/eventbus/events/metadata/request-action.ts","../src/eventbus/events/metadata/request-current-language.ts","../src/eventbus/events/metadata/request-current-navigation.ts","../src/eventbus/events/metadata/request-current-timeline-position.ts","../src/eventbus/events/metadata/request-current-video-position.ts","../src/eventbus/events/metadata/request-engine-root.ts","../src/eventbus/events/metadata/request-function.ts","../src/eventbus/events/metadata/request-instance.ts","../src/eventbus/events/metadata/request-label-collection.ts","../src/eventbus/events/metadata/request-label-collections.ts","../src/eventbus/events/metadata/request-timeline-cleanup.ts","../src/eventbus/events/metadata/request-timeline-uri.ts","../src/eventbus/events/metadata/request-video-cleanup.ts","../src/eventbus/events/metadata/request-video-url.ts","../src/eventbus/events/metadata/timeline-complete.ts","../src/eventbus/events/metadata/timeline-container-request.ts","../src/eventbus/events/metadata/timeline-current-timeline-change.ts","../src/eventbus/events/metadata/timeline-duration-request.ts","../src/eventbus/events/metadata/timeline-duration.ts","../src/eventbus/events/metadata/timeline-firstframe.ts","../src/eventbus/events/metadata/timeline-pause-request.ts","../src/eventbus/events/metadata/timeline-pause.ts","../src/eventbus/events/metadata/timeline-play-request.ts","../src/eventbus/events/metadata/timeline-play-toggle-request.ts","../src/eventbus/events/metadata/timeline-play.ts","../src/eventbus/events/metadata/timeline-request-current-timeline.ts","../src/eventbus/events/metadata/timeline-resize-request.ts","../src/eventbus/events/metadata/timeline-resize.ts","../src/eventbus/events/metadata/timeline-restart.ts","../src/eventbus/events/metadata/timeline-seek-request.ts","../src/eventbus/events/metadata/timeline-seek.ts","../src/eventbus/events/metadata/timeline-seeked.ts","../src/eventbus/events/metadata/timeline-stop-request.ts","../src/eventbus/events/metadata/timeline-stop.ts","../src/eventbus/events/metadata/timeline-time.ts","../src/eventbus/events/metadata/video-complete.ts","../src/eventbus/events/metadata/index.ts","../src/eventbus/actionregistry-eventbus-listener.ts","../src/eventbus/eventbus.ts","../src/eventbus/request-video-uri-interceptor.ts","../src/eventbus/index.ts","../src/eligius-engine.ts","../src/importer/eligius-resource-importer.ts","../src/operation/helper/set-global.ts","../src/language-manager.ts","../src/engine-factory.ts"],"sourcesContent":["export function isFunction(value: any): value is (...arg: any) => any {\n return typeof value === 'function';\n}\n","export function isObject(\n value: unknown\n): value is Record<PropertyKey, unknown> {\n return !!value && typeof value === 'object' && !Array.isArray(value);\n}\n","import {isFunction} from '@util/guards/is-function.ts';\nimport {isObject} from '@util/guards/is-object.ts';\nimport jQuery from 'jquery';\n\nexport function prepareValueForSerialization(value: unknown): any {\n if (Array.isArray(value)) {\n return (value as Array<any>).map(prepareValueForSerialization);\n } else if (value instanceof jQuery) {\n return '[jQuery object]';\n } else if (isObject(value)) {\n if (\n value.constructor.toString().substring(0, 5) === 'class' ||\n !value.constructor.toString().startsWith('function Object()')\n ) {\n const funcString = value.constructor.toString();\n return funcString.substring(0, funcString.indexOf('{') + 1);\n }\n return Object.fromEntries(\n Object.entries(value).map(([propName, propValue]) => [\n propName,\n prepareValueForSerialization(propValue),\n ])\n );\n } else if (isFunction(value)) {\n const funcString = value.toString();\n const parenIndex = funcString.indexOf('{');\n if (parenIndex > -1) {\n return funcString.substring(0, funcString.indexOf('{') + 1);\n }\n return funcString;\n }\n return value;\n}\n","import type {IDiagnosticsAgent} from '@diagnostics/types.ts';\nimport type {IEventbusListener} from '@eventbus/index.ts';\nimport {prepareValueForSerialization} from '@util/prepare-value-for-serialization.ts';\n\nexport class DevToolEventListener implements IEventbusListener {\n constructor(private agent: IDiagnosticsAgent) {}\n\n handleEvent(\n eventName: string,\n eventTopic: string | undefined,\n args: any[]\n ): void {\n const message = {\n eventName,\n eventTopic,\n args: prepareValueForSerialization(args),\n };\n try {\n this.agent.postMessage('eligius-diagnostics-event', message);\n } catch (e) {\n console.error('postmessage failed');\n console.error(e);\n console.info('message', message);\n }\n }\n}\n","import type {TDiagnosticType} from '@diagnostics/types.ts';\n\nlet active: boolean;\n\nexport function send(_name: TDiagnosticType, _data: any): void {\n console.log(_name, _data);\n}\n\nexport function setActive(value: boolean): void {\n active = value;\n}\n\nexport function isActive(): boolean {\n return active;\n}\n\nexport const Diagnostics = {\n send,\n get active() {\n return active;\n },\n set active(value: boolean) {\n active = value;\n },\n};\n","export type TDevToolsEventSubscriber = (event: TEventData) => void;\n\nexport type TPlayControlEventKind = 'play' | 'stop' | 'pause' | 'seek';\nexport const DEV_TOOLS_KEY = '__ELIGIUS_DEV_TOOLS__';\n\nexport type TWindowWithDevtools = Window & {\n [DEV_TOOLS_KEY]: IDiagnosticsInfo | undefined;\n};\n\nexport type TDevToolsMessage = {\n source: 'eligius-inspect-devtools';\n name: 'event';\n data: TEventData;\n};\n\nexport type TEventData = {\n type: 'playcontrol';\n data: IPlayControlEvent;\n};\n\nexport interface IPlayControlEvent {\n kind: TPlayControlEventKind;\n args?: any[];\n}\n\nexport interface IDiagnosticsAgent {\n postMessage(name: TDiagnosticType, messageData: any): void;\n subscribe(subscriber: TDevToolsEventSubscriber): () => void;\n}\n\nexport interface IDiagnosticsInfo {\n get agent(): IDiagnosticsAgent;\n}\n\nexport type TDiagnosticType =\n | 'eligius-diagnostics-factory'\n | 'eligius-diagnostics-engine'\n | 'eligius-diagnostics-event'\n | 'eligius-diagnostics-action'\n | 'eligius-diagnostics-action-error'\n | 'eligius-diagnostics-operation';\n\nexport type TDiagnosticsMessageSource =\n | 'eligius-inspect-agent'\n | 'eligius-inspect-devtools';\n","import type {IResolvedOperation} from '@configuration/types.ts';\n\n/**\n * This function can be used to find the index of a matching closing operation within a list of operations.\n *\n * Assume the following array of operations:\n * ```ts\n * [\n * {systemName:'name1'}, // index 0\n * {systemName:'forEach'}, // index 1\n * {systemName:'name2'}, // index 2\n * {systemName:'forEach'} // index 3\n * {systemName:'name3'} // index 4\n * {systemName:'endForEach'} // index 5\n * {systemName:'endForEach'} // index 6\n * {systemName:'name3'} // index 7\n * ]\n * ```\n *\n * Given the `forEach` instance at index 1, this function will return index 6. Given the `forEach` at index 3, it will yield index 5.\n *\n * Returns `true` when the given `operation.systemName` equals the specified `matchingName` and the current counter value is zero.\n *\n * If the `matchingName` matches `operation.systemName` but the counter is greater than zero, the counter is decremented.\n *\n * If the `operation.systemName` equals `self` (the name of the operation that requires to find its match), then counter is incremented.\n *\n * @param this\n * @param operation\n *\n */\nexport function findMatchingOperationIndex(\n this: {counter: number; self: string; matchingName: string},\n operation: IResolvedOperation\n) {\n if (operation.systemName === this.self) {\n this.counter = this.counter + 1;\n return false;\n }\n\n if (operation.systemName === this.matchingName && this.counter === 0) {\n return true;\n }\n\n if (operation.systemName === this.matchingName && this.counter > 0) {\n this.counter = this.counter - 1;\n }\n\n return false;\n}\n","/**\n /**\n * Gets the value for the given property chain. A property chain is defined by a string array.\n *\n * For example, this property chain: `[mySource, subSource, element, value]` should be extracted from an object of this shape:\n * ```ts\n * const foo = {\n * mySource: {\n * subSource: {\n * element: {\n * value: 'bar'\n * }\n * }\n * }\n * }\n * ```\n *\n * The result of the invocation `getPropertyChainValue([mySource, subSource, element, value], foo)` would then yield the value `bar`.\n */\nexport function getPropertyChainValue(\n propertyChain: string[],\n sourceObject: Record<string, any>\n) {\n let suffix = null;\n\n const result = propertyChain.reduce((currentInstance, prop, index) => {\n if (!currentInstance) {\n throw new Error(\n `Property chain '${propertyChain.join('.')}' cannot be resolved.`\n );\n }\n\n if (index === propertyChain.length - 1) {\n const parts = prop.split('+');\n if (parts.length > 1) {\n prop = parts[0];\n suffix = parts[1];\n }\n }\n return currentInstance[prop];\n }, sourceObject);\n\n return suffix ? `${result}${suffix}` : result;\n}\n","import {isDefined} from 'ts-is-present';\n\nconst copyFunction =\n typeof structuredClone !== 'undefined'\n ? structuredClone\n : <T>(original: any) => JSON.parse(JSON.stringify(original)) as T;\n\nexport function deepCopy<T>(original: T): T {\n if (isDefined(original)) {\n return copyFunction<T>(original);\n }\n return original;\n}\n","import {deepCopy} from '@operation/helper/deep-copy.ts';\nexport type TGlobalCache = Record<string, any>;\nconst cache: TGlobalCache = {};\n\nfunction _getGlobals(\n cache: TGlobalCache,\n name?: string\n): Record<string, any> | any {\n const value = name ? cache[name] : cache;\n return value && value !== cache ? deepCopy(value) : value;\n}\n\nfunction _setGlobals(cache: TGlobalCache, newValues: TGlobalCache): void {\n Object.entries(newValues).forEach(([name, value]) => (cache[name] = value));\n}\n\nfunction _clearGlobals(cache: TGlobalCache): void {\n const keys = Object.keys(cache);\n keys.forEach(key => delete cache[key]);\n}\n\nexport const getGlobals: (name?: string) => TGlobalCache | any =\n _getGlobals.bind(null, cache);\n\nexport const setGlobals: (newValues: TGlobalCache) => void = _setGlobals.bind(\n null,\n cache\n);\n\nexport const clearGlobals: () => void = _clearGlobals.bind(null, cache);\n","import {getPropertyChainValue} from '@operation/helper/get-property-chain-value.ts';\nimport {getGlobals} from '@operation/helper/globals.ts';\nimport type {IOperationScope, TOperationData} from '@operation/types.ts';\n\n/**\n * Resolves operation and global data property chains.\n *\n * An operation data property chain is designated by a `operationdata.` suffix, followed by an arbitrary property chain.\n * For global data the suffix should be `globaldata.`\n *\n * If the propertyChainOrRegularObject is not a property chain, this value is returned instead.\n */\nexport function resolveExternalPropertyChain(\n sourceObject: TOperationData,\n operationScope: IOperationScope,\n propertyChainOrRegularObject:\n | ExternalProperty\n | Record<string, any>\n | null\n | undefined\n) {\n if (\n propertyChainOrRegularObject === null ||\n propertyChainOrRegularObject === undefined\n ) {\n return null;\n }\n\n if (isExternalProperty(propertyChainOrRegularObject)) {\n const propNames = propertyChainOrRegularObject.split('.');\n const prefix = propNames.shift()!.toLowerCase();\n switch (prefix) {\n case '$operationdata':\n return getPropertyChainValue(propNames, sourceObject);\n case '$globaldata':\n return getPropertyChainValue(propNames, getGlobals());\n case '$scope':\n return getPropertyChainValue(propNames, operationScope);\n }\n }\n\n return propertyChainOrRegularObject;\n}\n\nexport function isExternalProperty(\n value: ExternalProperty | Record<string, any>\n): value is ExternalProperty {\n return (\n typeof value === 'string' &&\n (value.toLocaleLowerCase().startsWith('$operationdata.') ||\n value.toLocaleLowerCase().startsWith('$globaldata.') ||\n value.toLocaleLowerCase().startsWith('$scope.'))\n );\n}\n\nexport type ExternalProperty =\n | `$operationdata.${string}`\n | `$globaldata.${string}`\n | `$scope.${string}`;\n","import type {breakForEach} from '@operation/break-for-each.ts';\nimport type {continueForEach} from '@operation/continue-for-each.ts';\nimport {findMatchingOperationIndex} from '@operation/helper/find-matching-operation-index.ts';\nimport {\n type ExternalProperty,\n resolveExternalPropertyChain,\n} from '@operation/helper/resolve-external-property-chain.ts';\nimport type {IOperationScope, TOperation} from '@operation/types.ts';\n\nexport interface IForEachOperationData {\n /**\n * @type=ParameterType:array|ParameterType:string\n * @required\n */\n collection: unknown[] | string;\n}\n\n/**\n * This operation iterates over the given collection.\n *\n * Each iteration the current item from the specified collection is\n * assigned to the {@link IOperationScope.currentItem|currentItem} property on the {@link IOperationScope|operation scope}.\n *\n * At the start of the loop, the associated {@link endForEach} operation is determined and when\n * the last iteration is completed the flow control is set to the index of that operation.\n *\n * The {@link continueForEach|continue} and {@link breakForEach|break} operations can be used to control the\n * loop iterations.\n *\n * @category Control Flow\n */\nexport const forEach: TOperation<IForEachOperationData> = function (\n operationData: IForEachOperationData\n) {\n const {collection} = operationData;\n const resolvedCollection =\n typeof collection === 'string'\n ? (resolveExternalPropertyChain(\n operationData,\n this,\n collection as ExternalProperty\n ) as any[])\n : collection;\n\n if (\n resolvedCollection !== null &&\n resolvedCollection !== undefined &&\n !Array.isArray(resolvedCollection)\n ) {\n throw new Error(\n 'Expected resolved collection property to be array type, string value was probably not resolved correctly'\n );\n }\n\n // First iteration of the loop\n if (this.loopIndex === undefined) {\n this.loopEndIndex = findEndForEachIndex(this);\n if (resolvedCollection?.length) {\n this.loopIndex = 0;\n this.loopLength = resolvedCollection.length - 1;\n this.loopStartIndex = this.currentIndex;\n } else {\n this.newIndex = this.loopEndIndex;\n\n delete this.loopIndex;\n delete this.loopLength;\n delete this.loopStartIndex;\n delete this.loopEndIndex;\n }\n }\n\n if (resolvedCollection?.length && this.loopIndex !== undefined) {\n this.currentItem = resolvedCollection[this.loopIndex];\n }\n\n return operationData;\n};\n\nfunction findEndForEachIndex(scope: IOperationScope) {\n const currentIndex = scope.currentIndex + 1;\n const list = scope.operations.slice(currentIndex);\n\n const index = list.findIndex(\n findMatchingOperationIndex.bind({\n counter: 0,\n self: forEachSystemName,\n matchingName: endForEachSystemName,\n })\n );\n const endLoopIndex =\n index > -1 ? index + currentIndex : scope.operations.length;\n\n return endLoopIndex;\n}\n\nexport const forEachSystemName = 'forEach';\nexport const endForEachSystemName = 'endForEach';\n","/**\n * Removes specified properties from an operation data object.\n * This is a helper function to eliminate repetitive property deletion code across operations.\n *\n * @template T - The type of the operation data object\n * @template K - The keys to remove from the object (must be keys of T)\n * @param operationData - The operation data object to mutate\n * @param keys - The property keys to delete from the object\n * @returns The mutated operation data object with specified properties removed (typed as Omit<T, K>)\n *\n * @example\n * ```typescript\n * interface IMyOperationData {\n * selectedElement: JQuery;\n * animationDuration: number;\n * animationEasing: string;\n * }\n *\n * const data: IMyOperationData = {\n * selectedElement: $element,\n * animationDuration: 500,\n * animationEasing: 'ease-in'\n * };\n *\n * // Remove multiple properties at once\n * const result = removeProperties(data, 'animationDuration', 'animationEasing');\n * // result is typed as Omit<IMyOperationData, 'animationDuration' | 'animationEasing'>\n * // result = { selectedElement: $element }\n * ```\n */\nexport function removeProperties<T extends object, K extends keyof T>(\n operationData: T,\n ...keys: K[]\n): Omit<T, K> {\n for (const key of keys) {\n delete (operationData as any)[key];\n }\n return operationData as Omit<T, K>;\n}\n","import {findMatchingOperationIndex} from '@operation/helper/find-matching-operation-index.ts';\nimport {removeProperties} from '@operation/helper/remove-operation-properties.ts';\nimport {\n type ExternalProperty,\n resolveExternalPropertyChain,\n} from '@operation/helper/resolve-external-property-chain.ts';\nimport type {IOperationScope, TOperation} from '@operation/types.ts';\n\ntype TOperator = '!=' | '==' | '>=' | '<=' | '>' | '<';\ntype TValue =\n | `'${string}'`\n | number\n | `$operationdata.${string}`\n | `$globaldata.${string}`\n | `$scope.${string}`;\n\ntype TExpression = `${TValue}${TOperator}${TValue}`;\n\nexport interface IWhenOperationData {\n /**\n * @type=ParameterType:expression\n * @required\n * @erased\n */\n expression: TExpression;\n}\n\n/**\n * When the given expression evaluates to false, subsequent operations will be skipped\n * until an {@link endWhen} or {@link otherwise} operation is encountered.\n *\n * Practically, this means an `if` or `if`/`else` statement control flow implementation in a list of operations.\n *\n * The expression is passed in as a formatted string.\n * The left and right values of the expression can be defined like this:\n *\n * 'constant': for a constant string\n * 100: for a constant number\n * $operationData.foo: for an operation data value\n * $globaldata.foo: for a global data value\n * $scope.loopIndex: for a scope value\n * @foo: for a variable value\n *\n * @example\n * $scope.variables.foo=='bar'\n * @example\n * $globalData.foo>$scope.variables.bar\n * @example\n * $operationData.foo!=100\n *\n * @param operationData\n * @returns\n *\n * @category Control Flow\n */\nexport const when: TOperation<\n IWhenOperationData,\n Omit<IWhenOperationData, 'expression'>\n> = function (operationData: IWhenOperationData) {\n const [left, operator, right] = parseExpression(\n operationData.expression,\n operationData,\n this\n );\n\n removeProperties(operationData, 'expression');\n\n this.whenEvaluation = evaluations[operator](left, right);\n\n if (!this.whenEvaluation) {\n this.newIndex = findNextFlowControlIndex(this);\n }\n\n return operationData;\n};\n\nfunction parseExpression(\n expression: TExpression,\n operationData: IWhenOperationData,\n operationScope: IOperationScope\n): [TValue, TOperator, TValue] {\n const [left, right] = expression.split(/!=|==|>=|<=|>|</);\n\n const operator = expression.substring(\n left.length,\n expression.length - right.length\n ) as TOperator;\n\n const leftNr = parseFloat(left);\n const rightNr = parseFloat(right);\n\n return [\n (Number.isNaN(leftNr)\n ? resolveExternalPropertyChain(\n operationData,\n operationScope,\n left as ExternalProperty\n )\n : leftNr) as TValue,\n operator,\n (Number.isNaN(rightNr)\n ? resolveExternalPropertyChain(\n operationData,\n operationScope,\n right as ExternalProperty\n )\n : rightNr) as TValue,\n ];\n}\n\nconst evaluations: Record<\n TOperator,\n (left: string | number, right: string | number) => boolean\n> = {\n '==': (left: string | number, right: string | number) => left === right,\n '!=': (left: string | number, right: string | number) => left !== right,\n '>=': (left: string | number, right: string | number) => left >= right,\n '<=': (left: string | number, right: string | number) => left <= right,\n '>': (left: string | number, right: string | number) => left > right,\n '<': (left: string | number, right: string | number) => left < right,\n};\n\nfunction findNextFlowControlIndex(scope: IOperationScope) {\n const currentIndex = scope.currentIndex + 1;\n const list = scope.operations.slice(currentIndex);\n\n const otherWiseIndex = list.findIndex(\n findMatchingOperationIndex.bind({\n counter: 0,\n self: whenSystemName,\n matchingName: otherwiseSystemName,\n })\n );\n if (otherWiseIndex > -1) {\n return otherWiseIndex + currentIndex;\n }\n\n const endWhenIndex = list.findIndex(\n findMatchingOperationIndex.bind({\n counter: 0,\n self: whenSystemName,\n matchingName: endWhenSystemName,\n })\n );\n\n return endWhenIndex > -1\n ? endWhenIndex + currentIndex\n : scope.operations.length;\n}\n\nexport const whenSystemName = 'when';\nexport const otherwiseSystemName = 'otherwise';\nexport const endWhenSystemName = 'endWhen';\n","export function isPromise(obj: any): obj is Promise<unknown> {\n return typeof obj === 'object' && typeof obj.then === 'function';\n}\n","import type {IAction} from '@action/types.ts';\nimport type {IResolvedOperation} from '@configuration/types.ts';\nimport {Diagnostics} from '@diagnostics/index.ts';\nimport type {IEventbus} from '@eventbus/types.ts';\nimport {endForEachSystemName, forEachSystemName} from '@operation/for-each.ts';\nimport {deepCopy} from '@operation/helper/deep-copy.ts';\nimport type {IOperationScope, TOperationData} from '@operation/types.ts';\nimport {endWhenSystemName, whenSystemName} from '@operation/when.ts';\nimport {isPromise} from '@util/guards/is-promise.ts';\n\nexport class Action implements IAction {\n public id = '';\n protected _scopeStack: IOperationScope[] = [];\n\n constructor(\n public name: string,\n public startOperations: IResolvedOperation[],\n protected eventbus: IEventbus\n ) {}\n\n start(initOperationData?: TOperationData): Promise<TOperationData> {\n Diagnostics.active &&\n Diagnostics.send(\n 'eligius-diagnostics-action',\n `${this.name ?? 'Action'} begins executing start operations`\n );\n\n this._initializeScopeStack();\n\n const result = new Promise<TOperationData>((resolve, reject) => {\n this.executeOperation(\n this.startOperations,\n 0,\n resolve,\n reject,\n initOperationData\n );\n }).catch(e => {\n Diagnostics.active &&\n Diagnostics.send('eligius-diagnostics-action-error', {\n name: this.name,\n error: e,\n });\n console.error(`Error in action start '${this.name}'`);\n console.error(e);\n throw e;\n });\n return !Diagnostics.active\n ? result\n : result.then(operationsResult => {\n Diagnostics.send(\n 'eligius-diagnostics-action',\n `${this.name ?? 'Action'} finished executing start operations`\n );\n return operationsResult;\n });\n }\n\n protected _initializeScopeStack() {\n this._scopeStack = [\n {\n currentIndex: -1,\n eventbus: this.eventbus,\n operations: this.startOperations,\n },\n ];\n }\n\n private _pushScope(parentScope: IOperationScope): IOperationScope {\n const newScope = {\n get currentIndex() {\n return parentScope.currentIndex;\n },\n set currentIndex(value: number) {\n parentScope.currentIndex = value;\n },\n get eventbus() {\n return parentScope.eventbus;\n },\n get operations() {\n return parentScope.operations;\n },\n parent: parentScope,\n };\n this._scopeStack.push(newScope);\n return newScope;\n }\n\n private _popScope() {\n this._scopeStack.pop();\n }\n\n executeOperation(\n operations: IResolvedOperation[],\n operationIndex: number,\n resolve: (value?: any | PromiseLike<any>) => void,\n reject: (reason?: any) => void,\n previousOperationData: TOperationData | undefined = {}\n ): void {\n let scope = this._scopeStack[this._scopeStack.length - 1];\n if (scope.newIndex !== undefined) {\n operationIndex = scope.newIndex;\n delete scope.newIndex;\n }\n\n scope.currentIndex = operationIndex;\n\n if (operationIndex < operations.length) {\n const operationInfo = operations[operationIndex];\n\n const copy = deepCopy(operationInfo.operationData ?? {});\n\n const mergedOperationData = Object.assign(previousOperationData, copy);\n\n if (operationInfo.systemName === whenSystemName) {\n scope = this._pushScope(scope);\n } else if (\n operationInfo.systemName === forEachSystemName &&\n scope.owner !== operationInfo\n ) {\n scope = this._pushScope(scope);\n scope.owner = operationInfo;\n }\n\n Diagnostics.active &&\n Diagnostics.send('eligius-diagnostics-operation', {\n systemName: operationInfo.systemName,\n operationData: mergedOperationData,\n scope: {\n ...scope,\n eventbus: undefined,\n },\n });\n\n const operationResult = operationInfo.instance.call(\n scope,\n mergedOperationData\n );\n\n if (\n operationInfo.systemName === endWhenSystemName ||\n (operationInfo.systemName === endForEachSystemName &&\n scope.newIndex === undefined)\n ) {\n this._popScope();\n }\n\n if (isPromise(operationResult)) {\n operationResult\n .then(promisedOperationResult =>\n this.executeOperation(\n operations,\n ++operationIndex,\n resolve,\n reject,\n promisedOperationResult as TOperationData\n )\n )\n .catch((error: any) => {\n reject(error);\n });\n } else {\n this.executeOperation(\n operations,\n ++operationIndex,\n resolve,\n reject,\n operationResult\n );\n }\n } else {\n resolve(previousOperationData);\n }\n }\n}\n","import {Action} from '@action/action.ts';\nimport type {IResolvedOperation} from '@configuration/types.ts';\nimport {Diagnostics} from '@diagnostics/index.ts';\nimport type {IEventbus} from '@eventbus/types.ts';\nimport type {TOperationData} from '@operation/types.ts';\n\nexport class EndableAction extends Action {\n constructor(\n name: string,\n startOperations: IResolvedOperation[],\n public endOperations: IResolvedOperation[],\n eventBus: IEventbus\n ) {\n super(name, startOperations, eventBus);\n }\n\n end(initOperationData?: TOperationData): Promise<TOperationData> {\n Diagnostics.active &&\n Diagnostics.send(\n 'eligius-diagnostics-action',\n `${this.name ?? 'Action'} begins executing end operations`\n );\n\n if (!this.endOperations.length) {\n return Promise.resolve(initOperationData ?? {});\n }\n\n this._initializeScopeStack();\n\n const result = new Promise<TOperationData>((resolve, reject) => {\n this.executeOperation(\n this.endOperations,\n 0,\n resolve,\n reject,\n initOperationData\n );\n }).catch(e => {\n Diagnostics.active &&\n Diagnostics.send('eligius-diagnostics-action-error', {\n name: this.name,\n error: e,\n });\n console.error(`Error in action end '${this.name}'`);\n throw e;\n });\n\n return !Diagnostics.active\n ? result\n : result.then(operationsResult => {\n Diagnostics.send(\n 'eligius-diagnostics-action',\n `${this.name ?? 'Action'} finished executing start operations`\n );\n return operationsResult;\n });\n }\n}\n","import {EndableAction} from '@action/endable-action.ts';\nimport type {ITimelineAction} from '@action/types.ts';\nimport type {IResolvedOperation} from '@configuration/types.ts';\nimport type {IEventbus} from '@eventbus/types.ts';\nimport type {TOperationData} from '@operation/types.ts';\nimport type {IStrictDuration} from '../types.ts';\n\nexport class TimelineAction extends EndableAction implements ITimelineAction {\n private _active: boolean = false;\n public get active() {\n return this._active;\n }\n\n constructor(\n name: string,\n startOperations: IResolvedOperation[],\n endOperations: IResolvedOperation[],\n public duration: IStrictDuration,\n eventBus: IEventbus\n ) {\n super(name, startOperations, endOperations, eventBus);\n }\n\n start(initOperationData?: TOperationData): Promise<TOperationData> {\n if (!this.active) {\n this._active = Boolean(this.endOperations.length);\n return super.start(initOperationData);\n }\n\n return Promise.resolve({});\n }\n\n end(initOperationData: TOperationData): Promise<TOperationData> {\n return super.end(initOperationData).then(result => {\n this._active = false;\n return result;\n });\n }\n}\n","import type {TOperation} from '@operation/types.ts';\n\nexport interface IAddClassOperationData {\n /**\n * @dependency\n */\n selectedElement: JQuery;\n /**\n * @type=ParameterType:className\n * @required\n * @erased\n */\n className: string;\n}\n\n/**\n * This operation adds the specified class name to the specified selected element.\n *\n * @category DOM\n */\nexport const addClass: TOperation<\n IAddClassOperationData,\n Omit<IAddClassOperationData, 'className'>\n> = operationData => {\n const {selectedElement, className} = operationData;\n delete (operationData as any).className;\n selectedElement.addClass(className);\n\n return operationData;\n};\n","import type {IController} from '@controllers/types.ts';\n\nconst controllersDataName = 'eligiusEngineControllers';\n\nfunction getElementData(\n name: string,\n element: JQuery\n): IController<any>[] | undefined {\n return element.data(name);\n}\n\nconst getElementControllers = getElementData.bind(null, controllersDataName);\n\nexport {getElementData, getElementControllers, controllersDataName};\n","import {\n controllersDataName,\n getElementControllers,\n} from '@operation/helper/get-element-data.ts';\n\nexport function attachControllerToElement(element: JQuery, controller: any) {\n if (!element.data(controllersDataName)) {\n element.data(controllersDataName, []);\n }\n const controllers = getElementControllers(element);\n if (controllers) {\n controllers.push(controller);\n }\n}\n","import type {TOperationData} from '@operation/types.ts';\n\nexport function mergeOperationData<T extends TOperationData>(\n operationData: T,\n newOperationData: TOperationData\n): T & TOperationData {\n return {...operationData, ...newOperationData};\n}\n","import {mergeOperationData} from '@operation/helper/merge-operation-data.ts';\nimport type {TOperationData} from '@operation/types.ts';\n\nexport function internalResolve<T extends TOperationData = TOperationData>(\n resolve: (data: T | PromiseLike<T>) => void,\n operationData: TOperationData,\n newOperationData?: TOperationData\n) {\n if (newOperationData) {\n resolve(mergeOperationData(operationData, newOperationData) as T);\n } else {\n resolve(operationData as T);\n }\n}\n","import type {IController} from '@controllers/types.ts';\nimport {attachControllerToElement} from '@operation/helper/attach-controller-to-element.ts';\nimport {internalResolve} from '@operation/helper/internal-resolve.ts';\nimport type {\n IOperationScope,\n TOperation,\n TOperationData,\n} from '@operation/types.ts';\n\nexport type IAddControllerToElementOperationData<\n T extends TOperationData = TOperationData,\n> = {\n /**\n * @dependency\n */\n selectedElement: JQuery;\n /**\n * @dependency\n */\n controllerInstance: IController<T>;\n} & T;\n\n/**\n * This operation adds the specified controller instance to the given selected element.\n *\n * @category Controller\n */\nexport const addControllerToElement: TOperation<IAddControllerToElementOperationData> =\n function <T extends TOperationData = TOperationData>(\n this: IOperationScope,\n operationData: IAddControllerToElementOperationData<T>\n ) {\n const {selectedElement, controllerInstance} = operationData;\n\n attachControllerToElement(selectedElement, controllerInstance);\n\n controllerInstance.init(operationData);\n\n const promise = controllerInstance.attach(this.eventbus);\n\n if (promise) {\n return new Promise((resolve, reject) => {\n promise.then((newOperationData: TOperationData) => {\n internalResolve(resolve, operationData, newOperationData);\n }, reject);\n });\n } else {\n return operationData;\n }\n };\n","import {getGlobals} from '@operation/helper/globals.ts';\nimport {removeProperties} from '@operation/helper/remove-operation-properties.ts';\nimport type {TOperation} from '@operation/types.ts';\n\nexport interface IAddGlobalsToOperationData {\n /**\n * The names of the global properties that will be copied onto the current operation data\n *\n * @required\n * @erased\n */\n globalProperties: string[];\n}\n\n/**\n * This operation adds the specified global property names to the current operation data.\n * It finally removes the `globalProperties` property from the current operation data.\n *\n * @category Data\n */\nexport const addGlobalsToOperation: TOperation<\n IAddGlobalsToOperationData,\n Omit<IAddGlobalsToOperationData, 'globalProperties'>\n> = (operationData: IAddGlobalsToOperationData) => {\n const {globalProperties} = operationData;\n\n const globalValues = globalProperties.reduce<Record<string, any>>(\n (prev, current) => {\n prev[current] = getGlobals(current);\n return prev;\n },\n {}\n );\n removeProperties(operationData, 'globalProperties');\n\n return Object.assign(operationData, globalValues);\n};\n","import {internalResolve} from '@operation/helper/internal-resolve.ts';\nimport {removeProperties} from '@operation/helper/remove-operation-properties.ts';\nimport type {TOperation} from '@operation/types.ts';\n\nexport interface IAnimateOperationData {\n /**\n * @type=ParameterType:boolean\n * @erased\n */\n animationEasing?: string;\n /**\n * @dependency\n */\n selectedElement: JQuery;\n /**\n * @required\n * @erased\n */\n animationProperties: Record<string, unknown>;\n /**\n * @type=ParameterType:number\n * @required\n * @erased\n */\n animationDuration: JQuery.Duration;\n}\n\n/**\n * This operation animates the specified selected element with the given [jQuery animation](https://api.jquery.com/animate/) properties, duration and easing.\n * It resolves after the animation completes.\n *\n * @param operationData\n * @returns\n *\n * @category Animation\n */\nexport const animate: TOperation<\n IAnimateOperationData,\n Omit<\n IAnimateOperationData,\n 'animationEasing' | 'animationProperties' | 'animationDuration'\n >\n> = (operationData: IAnimateOperationData) => {\n const {\n selectedElement,\n animationEasing,\n animationProperties,\n animationDuration,\n } = operationData;\n\n removeProperties(\n operationData,\n 'animationEasing',\n 'animationProperties',\n 'animationDuration'\n );\n\n const promise = new Promise<IAnimateOperationData>((resolve, reject) => {\n try {\n if (animationEasing) {\n selectedElement.animate(\n animationProperties,\n animationDuration,\n animationEasing,\n () => {\n internalResolve(resolve, {}, operationData);\n }\n );\n } else {\n selectedElement.animate(animationProperties, animationDuration, () => {\n internalResolve(resolve, {}, operationData);\n });\n }\n } catch (e) {\n reject(e);\n }\n });\n return promise;\n};\n","import {internalResolve} from '@operation/helper/internal-resolve.ts';\nimport type {TOperation} from '@operation/types.ts';\n\nexport interface IAnimateWithClassOperationData {\n /**\n * @dependency\n */\n selectedElement: JQuery;\n /**\n * @type=ParameterType:className\n * @required\n */\n className: string;\n removeClass?: boolean;\n}\n\n/**\n * This operation adds the specified class name to the specified selected element and assumes that this\n * class triggers and animation on the selected element. It then waits for this animation to complete\n * before it resolves.\n *\n * @category Animation\n */\nexport const animateWithClass: TOperation<\n IAnimateWithClassOperationData,\n Promise<IAnimateWithClassOperationData>\n> = (operationData: IAnimateWithClassOperationData) => {\n let {selectedElement, className, removeClass} = operationData;\n removeClass = removeClass !== undefined ? removeClass : true;\n\n const promise = new Promise<IAnimateWithClassOperationData>(\n (resolve, reject) => {\n try {\n selectedElement.one(\n 'webkitAnimationEnd oanimationend oAnimationEnd msAnimationEnd animationEnd',\n () => {\n if (removeClass) {\n selectedElement.removeClass(className);\n }\n internalResolve(resolve, {}, operationData);\n }\n );\n } catch (e) {\n reject(e);\n }\n }\n );\n\n selectedElement.addClass(className);\n\n return promise;\n};\n","import {removeProperties} from '@operation/helper/remove-operation-properties.ts';\nimport type {TOperation} from '@operation/types.ts';\n\nexport interface IAnnounceToScreenReaderOperationData {\n /**\n * @required\n * @erased\n */\n message: string;\n /**\n * @optional\n * @erased\n */\n priority?: 'polite' | 'assertive';\n}\n\n/**\n * Announces a message to screen readers using an ARIA live region.\n *\n * @category Accessibility\n */\nexport const announceToScreenReader: TOperation<\n IAnnounceToScreenReaderOperationData,\n Omit<IAnnounceToScreenReaderOperationData, 'message' | 'priority'>\n> = (operationData: IAnnounceToScreenReaderOperationData) => {\n const {message, priority = 'polite'} = operationData;\n\n if (!message || message.trim() === '') {\n throw new Error('announceToScreenReader: message is required');\n }\n\n // Create or get existing live region\n let liveRegion = document.getElementById('aria-live-region');\n if (!liveRegion) {\n liveRegion = document.createElement('div');\n liveRegion.id = 'aria-live-region';\n liveRegion.setAttribute('aria-live', priority);\n liveRegion.style.position = 'absolute';\n liveRegion.style.left = '-10000px';\n liveRegion.style.width = '1px';\n liveRegion.style.height = '1px';\n liveRegion.style.overflow = 'hidden';\n document.body.appendChild(liveRegion);\n } else {\n liveRegion.setAttribute('aria-live', priority);\n }\n\n liveRegion.textContent = message;\n\n removeProperties(operationData, 'message', 'priority');\n\n return operationData;\n};\n","import type {endForEach} from '@operation/end-for-each.ts';\nimport type {forEach} from '@operation/for-each.ts';\nimport type {TOperation, TOperationData} from '@operation/types.ts';\n\n/**\n *\n * This operation should only be used within a loop, so between a {@link forEach} and {@link endForEach}\n * operation. This operation immediately moves to the loop end index, effectively stopping the loop.\n *\n * @category Control Flow\n */\nexport const breakForEach: TOperation<TOperationData> = function (\n operationData: TOperationData\n) {\n if (this.loopIndex !== undefined && this.loopLength !== undefined) {\n this.newIndex = this.loopEndIndex;\n\n delete this.loopIndex;\n delete this.loopLength;\n delete this.loopStartIndex;\n delete this.loopEndIndex;\n delete this.currentItem;\n }\n return operationData;\n};\n","import {resolveExternalPropertyChain} from '@operation/helper/resolve-external-property-chain.ts';\nimport type {IOperationScope, TOperationData} from '@operation/types.ts';\n\nexport function resolveEventArguments(\n operationData: TOperationData,\n operationScope: IOperationScope,\n eventArgs?: any[]\n) {\n if (!eventArgs) {\n return;\n }\n const resolve = resolveExternalPropertyChain.bind(\n null,\n operationData,\n operationScope\n );\n return eventArgs.map(resolve);\n}\n","import type {EventName} from '@eventbus/types.ts';\nimport {removeProperties} from '@operation/helper/remove-operation-properties.ts';\nimport {resolveEventArguments} from '@operation/helper/resolve-event-arguments.ts';\nimport type {TOperation} from '@operation/types.ts';\n\nexport interface IBroadcastEventOperationData {\n /**\n * @required\n * @erased\n */\n eventArgs: unknown[];\n /**\n * @type=ParameterType:eventTopic\n * @erased\n */\n eventTopic?: string;\n /**\n * @type=ParameterType:eventName\n * @required\n * @erased\n */\n eventName: string;\n}\n\n/**\n * This operation broadcasts the given event through the eventbus, along with the\n * event arguments and optional event topic.\n *\n * @category Utility\n */\nexport const broadcastEvent: TOperation<\n IBroadcastEventOperationData,\n Omit<IBroadcastEventOperationData, 'eventArgs' | 'eventTopic' | 'eventName'>\n> = function (operationData: IBroadcastEventOperationData) {\n const {eventArgs, eventTopic, eventName} = operationData;\n\n removeProperties(operationData, 'eventArgs', 'eventTopic', 'eventName');\n\n const eventArguments = resolveEventArguments(operationData, this, eventArgs);\n if (eventTopic) {\n this.eventbus.broadcastForTopic(\n eventName as EventName,\n eventTopic,\n eventArguments as any\n );\n } else {\n this.eventbus.broadcast(eventName as EventName, eventArguments as any);\n }\n\n return operationData;\n};\n","import {deepCopy} from '@operation/helper/deep-copy.ts';\nimport type {ExternalProperty} from '@operation/helper/resolve-external-property-chain.ts';\nimport {\n isExternalProperty,\n resolveExternalPropertyChain,\n} from '@operation/helper/resolve-external-property-chain.ts';\nimport type {IOperationScope, TOperationData} from '@operation/types.ts';\nimport {isObject} from '@util/guards/is-object.ts';\nimport $ from 'jquery';\n\nconst cache: any[] = [];\n\n/**\n * This takes a `newProperties` instance, resolves all of the properties on this object and then\n * assigns these properties to the given operationData.\n */\nexport function resolvePropertyValues<T extends TOperationData>(\n operationData: T,\n operationScope: IOperationScope,\n newProperties: Record<string, any>\n): T {\n const copy =\n newProperties !== operationData ? deepCopy(newProperties) : newProperties;\n\n const resolvePropertyChain = resolveExternalPropertyChain.bind(\n null,\n operationData,\n operationScope\n );\n\n resolveNewProperties(newProperties, copy, resolvePropertyChain);\n\n return copy as T;\n}\n\nfunction resolveNewProperties(\n properties: Record<string, any>,\n copy: Record<string, any>,\n resolvePropertyChain: (\n propertyChain: ExternalProperty | Record<string, any>\n ) => any\n) {\n // Prevent recursive looping\n if (cache.indexOf(properties) > -1) {\n return;\n }\n\n cache.push(properties);\n\n try {\n Object.entries(properties).forEach(([key, value]) => {\n if (value instanceof $) {\n return;\n }\n\n if (isExternalProperty(value)) {\n copy[key] = resolvePropertyChain(value);\n } else if (Array.isArray(value)) {\n value.forEach((item, index, arr) => {\n if (isExternalProperty(item)) {\n arr[index] = resolvePropertyChain(item);\n } else if (isObject(item)) {\n resolveNewProperties(item, item, resolvePropertyChain);\n }\n });\n } else if (isObject(value)) {\n resolveNewProperties(value, value, resolvePropertyChain);\n } else {\n copy[key] = value;\n }\n });\n } finally {\n const index = cache.indexOf(properties);\n cache.splice(index, 1);\n }\n}\n","import {removeProperties} from '@operation/helper/remove-operation-properties.ts';\nimport {resolvePropertyValues} from '@operation/helper/resolve-property-values.ts';\nimport type {TOperation} from '@operation/types.ts';\n\nexport type TCalculationOperator = '+' | '-' | '*' | '/' | '%' | '**';\n\nexport interface ICalcOperationData {\n /**\n * The left operand\n * @type=ParameterType:number\n * @required\n * @erased\n */\n left: string | number;\n /**\n * The right operand\n * @type=ParameterType:number\n * @required\n * @erased\n */\n right: string | number;\n /**\n * @required\n * @erased\n */\n operator: TCalculationOperator;\n /**\n * @output\n */\n calculationResult?: number;\n}\n\nconst calcFunctions: Record<\n TCalculationOperator,\n (left: number, right: number) => number\n> = {\n '+': (left: number, right: number) => left + right,\n '-': (left: number, right: number) => left - right,\n '*': (left: number, right: number) => left * right,\n '/': (left: number, right: number) => left / right,\n '%': (left: number, right: number) => left % right,\n '**': (left: number, right: number) => left ** right,\n};\n\n/**\n * This operation calculates the given left and right hand operands using the specified operator.\n *\n * @param operationData\n *\n * @category Utility\n */\nexport const calc: TOperation<\n ICalcOperationData,\n Omit<ICalcOperationData, 'left' | 'right' | 'operator'>\n> = function (operationData: ICalcOperationData) {\n operationData = resolvePropertyValues(operationData, this, operationData);\n\n const {left, right, operator} = operationData;\n\n removeProperties(operationData, 'left', 'right', 'operator');\n\n operationData.calculationResult = calcFunctions[operator](+left, +right);\n\n return operationData;\n};\n","import type {TOperation} from '@operation/types.ts';\n\nexport interface IClearElementOperationData {\n /**\n * @dependency\n */\n selectedElement: JQuery;\n}\n\n/**\n * This operation removes all of the children from the given selected element.\n *\n * @category DOM\n */\nexport const clearElement: TOperation<IClearElementOperationData> = (\n operationData: IClearElementOperationData\n) => {\n const {selectedElement} = operationData;\n selectedElement.empty();\n return operationData;\n};\n","import {removeProperties} from '@operation/helper/remove-operation-properties.ts';\nimport type {TOperation} from '@operation/types.ts';\n\nexport interface IClearOperationDataOperationData {\n /**\n * @erased\n */\n properties?: string[];\n}\n\n/**\n * This operation removes all of the properties on the current operation date.\n * Or, if the `properties` property is set only removes the properties defined by that list.\n *\n * @category Data\n */\nexport const clearOperationData: TOperation<\n IClearOperationDataOperationData,\n Omit<IClearOperationDataOperationData, 'properties'>\n> = (operationData: IClearOperationDataOperationData) => {\n const {properties} = operationData;\n\n if (properties) {\n properties.forEach(name => {\n delete (operationData as any)[name];\n });\n removeProperties(operationData, 'properties');\n return operationData;\n }\n\n return {};\n};\n","import {removeProperties} from '@operation/helper/remove-operation-properties.ts';\nimport type {TOperation} from '@operation/types.ts';\n\nexport type StorageType = 'local' | 'session';\n\nexport interface IClearStorageOperationData {\n /**\n * @optional\n * @erased\n */\n key?: string;\n /**\n * @required\n * @erased\n */\n storageType: StorageType;\n}\n\n/**\n * Clears data from browser storage (localStorage or sessionStorage).\n *\n * If `key` is provided, removes only that key. If `key` is omitted, clears all storage.\n *\n * @returns Operation data with storage properties erased\n *\n * @example\n * ```typescript\n * // Clear specific key\n * const result = clearStorage({\n * key: 'user-settings',\n * storageType: 'local'\n * });\n * ```\n *\n * @example\n * ```typescript\n * // Clear all localStorage\n * const result = clearStorage({\n * storageType: 'local'\n * });\n * ```\n *\n * @category Data\n */\nexport const clearStorage: TOperation<\n IClearStorageOperationData,\n Omit<IClearStorageOperationData, 'key' | 'storageType'>\n> = (operationData: IClearStorageOperationData) => {\n const {key, storageType} = operationData;\n\n const storage = storageType === 'session' ? sessionStorage : localStorage;\n\n if (key && key.trim() !== '') {\n storage.removeItem(key);\n } else {\n storage.clear();\n }\n\n removeProperties(operationData, 'key', 'storageType');\n\n return operationData;\n};\n","import {removeProperties} from '@operation/helper/remove-operation-properties.ts';\nimport type {TOperation} from '@operation/types.ts';\n\nexport interface ICompareDateOperationData {\n /**\n * @required\n * @erased\n */\n date1: Date | string | number;\n /**\n * @required\n * @erased\n */\n date2: Date | string | number;\n /**\n * @output\n */\n comparison: number;\n /**\n * @output\n */\n isEqual: boolean;\n /**\n * @output\n */\n isBefore: boolean;\n /**\n * @output\n */\n isAfter: boolean;\n}\n\n/**\n * Compares two dates.\n * comparison: -1 (before), 0 (equal), 1 (after)\n *\n * @category Date\n */\nexport const compareDate: TOperation<\n ICompareDateOperationData,\n Omit<ICompareDateOperationData, 'date1' | 'date2'>\n> = (operationData: ICompareDateOperationData) => {\n const {date1, date2} = operationData;\n\n if (!date1 || !date2) {\n throw new Error('compareDate: both dates are required');\n }\n\n const dateObj1 = date1 instanceof Date ? date1 : new Date(date1);\n const dateObj2 = date2 instanceof Date ? date2 : new Date(date2);\n\n if (Number.isNaN(dateObj1.getTime()) || Number.isNaN(dateObj2.getTime())) {\n throw new Error('compareDate: invalid date');\n }\n\n const time1 = dateObj1.getTime();\n const time2 = dateObj2.getTime();\n\n operationData.comparison = time1 < time2 ? -1 : time1 > time2 ? 1 : 0;\n operationData.isEqual = time1 === time2;\n operationData.isBefore = time1 < time2;\n operationData.isAfter = time1 > time2;\n\n removeProperties(operationData, 'date1', 'date2');\n\n return operationData;\n};\n","import {removeProperties} from '@operation/helper/remove-operation-properties.ts';\nimport type {TOperation} from '@operation/types.ts';\n\nexport interface IConcatenateStringsOperationData {\n /**\n * @required\n * @erased\n */\n strings: string[];\n /**\n * @optional\n * @erased\n */\n separator?: string;\n /**\n * @output\n */\n result: string;\n}\n\n/**\n * Concatenates multiple strings with an optional separator.\n *\n * @returns Operation data with `result` containing the concatenated string\n *\n * @example\n * ```typescript\n * const result = concatenateStrings({\n * strings: ['Hello', 'World'],\n * separator: ' '\n * });\n * // result.result = \"Hello World\"\n * ```\n *\n * @category String\n */\nexport const concatenateStrings: TOperation<\n IConcatenateStringsOperationData,\n Omit<IConcatenateStringsOperationData, 'strings' | 'separator'>\n> = (operationData: IConcatenateStringsOperationData) => {\n const {strings, separator = ''} = operationData;\n\n if (!Array.isArray(strings)) {\n throw new Error('concatenateStrings: strings must be an array');\n }\n\n operationData.result = strings.join(separator);\n\n removeProperties(operationData, 'strings', 'separator');\n\n return operationData;\n};\n","import type {endForEach} from '@operation/end-for-each.ts';\nimport type {forEach} from '@operation/for-each.ts';\nimport type {TOperation, TOperationData} from '@operation/types.ts';\n\n/**\n *\n * This operation should only be used within a loop, so between a {@link forEach} and {@link endForEach}\n * operation. This operation immediately moves to the next loop index, effectively canceling the rest\n * of the operations in the current iteration.\n *\n * @category Control Flow\n */\nexport const continueForEach: TOperation<TOperationData> = function (\n operationData: TOperationData\n) {\n if (this.loopIndex !== undefined && this.loopLength !== undefined) {\n this.newIndex = this.loopEndIndex;\n delete this.currentItem;\n }\n return operationData;\n};\n","import {removeProperties} from '@operation/helper/remove-operation-properties.ts';\nimport {resolvePropertyValues} from '@operation/helper/resolve-property-values.ts';\nimport type {IOperationScope, TOperation} from '@operation/types.ts';\nimport $ from 'jquery';\nimport type {RequireKeys} from '@/types.ts';\n\nexport type TTagNames = keyof HTMLElementTagNameMap;\n\nexport interface ICreateElementOperationData<T extends TTagNames> {\n /**\n * @type=ParameterType:htmlElementName\n * @required\n * @erased\n */\n elementName: T;\n /**\n * @erased\n */\n text?: string;\n /**\n * @type=ParameterType:object\n * @erased\n */\n attributes?: Partial<HTMLElementTagNameMap[T]>;\n /**\n * @type=ParameterType:object\n * @output\n */\n template?: JQuery;\n}\n\n/**\n * This operation creates the DOM element described by the given elementName and attributes and assigns\n * the instance to the `template` property on the current operation data.\n *\n * @param operationData\n * @returns\n * @category DOM\n */\nexport const createElement: TOperation<\n ICreateElementOperationData<TTagNames>,\n Omit<\n RequireKeys<ICreateElementOperationData<TTagNames>, 'template'>,\n 'elementName' | 'text' | 'attributes'\n >\n> = function <T extends TTagNames>(\n this: IOperationScope,\n operationData: ICreateElementOperationData<T>\n) {\n operationData = resolvePropertyValues(operationData, this, operationData);\n\n const {elementName, attributes, text} = operationData;\n\n removeProperties(operationData, 'elementName', 'attributes', 'text');\n\n const serializedAttrs = attributes\n ? ` ${Object.entries(attributes)\n .filter(([_, value]) => Boolean(value))\n .map(([key, value]) => `${key}=\"${value}\"`)\n .join(' ')}`\n : '';\n\n const template = text\n ? $(`<${elementName}${serializedAttrs}>${text}</${elementName}>`)\n : $(`<${elementName}${serializedAttrs}/>`);\n\n operationData.template = template;\n\n return operationData as RequireKeys<\n ICreateElementOperationData<TTagNames>,\n 'template'\n >;\n};\n","import {internalResolve} from '@operation/helper/internal-resolve.ts';\nimport {removeProperties} from '@operation/helper/remove-operation-properties.ts';\nimport type {TOperation} from '@operation/types.ts';\n\nexport interface ICustomFunctionOperationData {\n /**\n * @type=ParameterType:systemName\n * @erased\n * @required\n */\n systemName: string;\n}\n\n/**\n * This operation retrieves a custom function defined by the given system name\n * and invokes it with the current operation data and eventbus.\n *\n * @param operationData\n *\n * @category Utility\n */\nexport const customFunction: TOperation<\n ICustomFunctionOperationData,\n Omit<ICustomFunctionOperationData, 'systemName'>\n> = function (operationData: ICustomFunctionOperationData) {\n const {systemName} = operationData;\n\n removeProperties(operationData, 'systemName');\n\n return new Promise<ICustomFunctionOperationData>((resolve, reject) => {\n const resultCallback = (func: TOperation) => {\n const promise = func.apply(this, [operationData]);\n if (promise) {\n promise.then(() => {\n internalResolve(resolve, {}, operationData);\n }, reject);\n } else {\n internalResolve(resolve, {}, operationData);\n }\n };\n this.eventbus.broadcast('request-function', [systemName, resultCallback]);\n });\n};\n","import type {IEndableAction} from '@action/types.ts';\nimport {internalResolve} from '@operation/helper/internal-resolve.ts';\nimport {mergeOperationData} from '@operation/helper/merge-operation-data.ts';\nimport type {TOperation} from '@operation/types.ts';\n\nexport interface IEndActionOperationData {\n /**\n * @dependency\n */\n actionInstance: IEndableAction;\n /**\n * @required\n * @erased\n */\n actionOperationData: Record<string, unknown>;\n}\n\n/**\n * This operation invokes the {@link EndableAction}.end method on the specified action instance.\n *\n * The action operation data is first merged with the current operation data before it is\n * passed on to the action. After the action has completed the action operation data properties\n * are removed from the current operation data.\n *\n * @category Action\n */\nexport const endAction: TOperation<\n IEndActionOperationData,\n Omit<IEndActionOperationData, 'actionOperationData'>\n> = (operationData: IEndActionOperationData) => {\n let {actionOperationData, ...newOperationData} = operationData;\n\n return new Promise<IEndActionOperationData>((resolve, reject) => {\n newOperationData = mergeOperationData(\n newOperationData,\n actionOperationData\n );\n\n newOperationData.actionInstance.end(newOperationData).then(() => {\n const sanitizedData = Object.keys(newOperationData)\n .filter(key => !(key in actionOperationData))\n .reduce(\n (acc, key) => {\n (acc as any)[key] = (newOperationData as any)[key];\n return acc;\n },\n {} as typeof newOperationData\n );\n internalResolve(resolve, sanitizedData);\n }, reject);\n });\n};\n","import type {TOperation, TOperationData} from '@operation/types.ts';\n\n/**\n * This operation checks if the current loop should end or start the next iteration.\n *\n * @category Control Flow\n */\nexport const endForEach: TOperation<TOperationData> = function (\n operationData: TOperationData\n) {\n if (\n this.loopIndex !== undefined &&\n this.loopLength !== undefined &&\n this.loopIndex < this.loopLength\n ) {\n this.loopIndex = this.loopIndex + 1;\n this.newIndex = this.loopStartIndex;\n delete this.currentItem;\n }\n\n return operationData;\n};\n","import type {TOperation} from '@operation/types.ts';\n\n/**\n * This operation cleans up after the {@link when}/{@link otherwise}/{@link endWhen} control flow ends.\n *\n * @category Control Flow\n */\nexport const endWhen: TOperation<Record<string, unknown>> = function (\n operationData: Record<string, unknown>\n) {\n delete this.whenEvaluation;\n return operationData;\n};\n","import type {IController} from '@controllers/types.ts';\nimport {removeProperties} from '@operation/helper/remove-operation-properties.ts';\nimport type {TOperation, TOperationData} from '@operation/types.ts';\n\n/**\n * This operation extends the specified controller instance with the specified extension.\n */\nexport interface IExtendControllerOperationData {\n /**\n * @dependency\n */\n controllerInstance: IController<TOperationData>;\n /**\n * @erased\n * @required\n */\n controllerExtension: Record<PropertyKey, unknown>;\n}\n\n/**\n * Extends the current controller with given extension.\n *\n * @category Controller\n */\nexport const extendController: TOperation<\n IExtendControllerOperationData,\n Omit<IExtendControllerOperationData, 'controllerExtension'>\n> = (operationData: IExtendControllerOperationData) => {\n const {controllerInstance, controllerExtension} = operationData;\n\n removeProperties(operationData, 'controllerExtension');\n\n operationData.controllerInstance = Object.assign(\n controllerInstance,\n controllerExtension\n );\n\n return operationData;\n};\n","import {removeProperties} from '@operation/helper/remove-operation-properties.ts';\nimport type {TOperation} from '@operation/types.ts';\n\nexport interface IFilterArrayOperationData {\n /**\n * @required\n * @dependency\n */\n arrayData: any[];\n /**\n * @optional\n * @erased\n */\n filterProperty?: string;\n /**\n * @optional\n * @erased\n */\n filterValue?: any;\n /**\n * @optional\n * @erased\n */\n filterPredicate?: (item: any, index?: number) => boolean;\n /**\n * @output\n */\n filteredArray: any[];\n}\n\n/**\n * Filters an array based on property equality or custom predicate function.\n *\n * Operates on arrayData passed from previous operations.\n * Supports two filtering modes:\n * 1. Property equality: `filterProperty` and `filterValue` to filter by property match\n * 2. Custom predicate: `filterPredicate` function for complex filtering logic\n *\n * @returns Operation data with `filteredArray` containing filtered results\n *\n * @example\n * ```typescript\n * // Filter by property equality\n * const result = filterArray({\n * arrayData: [{name: 'Alice', age: 25}, {name: 'Bob', age: 30}],\n * filterProperty: 'age',\n * filterValue: 25\n * });\n * // result.filteredArray = [{name: 'Alice', age: 25}]\n * ```\n *\n * @example\n * ```typescript\n * // Filter with custom predicate\n * const result = filterArray({\n * arrayData: [1, 2, 3, 4, 5],\n * filterPredicate: (item) => item % 2 === 0\n * });\n * // result.filteredArray = [2, 4]\n * ```\n *\n * @category Array\n */\nexport const filterArray: TOperation<\n IFilterArrayOperationData,\n Omit<\n IFilterArrayOperationData,\n 'filterProperty' | 'filterValue' | 'filterPredicate'\n >\n> = (operationData: IFilterArrayOperationData) => {\n const {arrayData, filterProperty, filterValue, filterPredicate} =\n operationData;\n\n if (!Array.isArray(arrayData)) {\n throw new Error('filterArray: arrayData is required and must be an array');\n }\n\n if (!filterPredicate && (!filterProperty || filterValue === undefined)) {\n throw new Error(\n 'filterArray: filterProperty/filterValue or filterPredicate is required'\n );\n }\n\n let filtered: any[];\n\n if (filterPredicate) {\n filtered = arrayData.filter(filterPredicate);\n } else {\n filtered = arrayData.filter(item => {\n if (typeof item === 'object' && item !== null) {\n return item[filterProperty!] === filterValue;\n }\n return false;\n });\n }\n\n operationData.filteredArray = filtered;\n\n removeProperties(\n operationData,\n 'filterProperty',\n 'filterValue',\n 'filterPredicate'\n );\n\n return operationData;\n};\n","import {removeProperties} from '@operation/helper/remove-operation-properties.ts';\nimport type {TOperation} from '@operation/types.ts';\n\nexport interface IFindInArrayOperationData {\n /**\n * @required\n * @dependency\n */\n arrayData: any[];\n /**\n * @optional\n * @erased\n */\n findProperty?: string;\n /**\n * @optional\n * @erased\n */\n findValue?: any;\n /**\n * @optional\n * @erased\n */\n findPredicate?: (item: any, index?: number) => boolean;\n /**\n * @output\n */\n foundItem: any | undefined;\n /**\n * @output\n */\n foundIndex: number;\n}\n\n/**\n * Finds the first element in an array matching criteria.\n *\n * Operates on arrayData passed from previous operations.\n * Supports two search modes:\n * 1. Property equality: `findProperty` and `findValue` to find by property match\n * 2. Custom predicate: `findPredicate` function for complex search logic\n *\n * Returns `undefined` for `foundItem` and `-1` for `foundIndex` if no match found.\n *\n * @returns Operation data with `foundItem` (the matching element) and `foundIndex` (its position)\n *\n * @example\n * ```typescript\n * // Find by property equality\n * const result = findInArray({\n * arrayData: [{id: 1, name: 'Alice'}, {id: 2, name: 'Bob'}],\n * findProperty: 'id',\n * findValue: 2\n * });\n * // result.foundItem = {id: 2, name: 'Bob'}\n * // result.foundIndex = 1\n * ```\n *\n * @example\n * ```typescript\n * // Find with custom predicate\n * const result = findInArray({\n * arrayData: [10, 25, 30, 45],\n * findPredicate: (item) => item > 30\n * });\n * // result.foundItem = 45\n * // result.foundIndex = 3\n * ```\n *\n * @category Array\n */\nexport const findInArray: TOperation<\n IFindInArrayOperationData,\n Omit<\n IFindInArrayOperationData,\n 'findProperty' | 'findValue' | 'findPredicate'\n >\n> = (operationData: IFindInArrayOperationData) => {\n const {arrayData, findProperty, findValue, findPredicate} = operationData;\n\n if (!Array.isArray(arrayData)) {\n throw new Error('findInArray: arrayData is required and must be an array');\n }\n\n if (!findPredicate && (!findProperty || findValue === undefined)) {\n throw new Error(\n 'findInArray: findProperty/findValue or findPredicate is required'\n );\n }\n\n let foundItem: any | undefined;\n let foundIndex = -1;\n\n if (findPredicate) {\n foundIndex = arrayData.findIndex(findPredicate);\n foundItem = foundIndex !== -1 ? arrayData[foundIndex] : undefined;\n } else {\n foundIndex = arrayData.findIndex(item => {\n if (typeof item === 'object' && item !== null) {\n return item[findProperty!] === findValue;\n }\n return item === findValue;\n });\n foundItem = foundIndex !== -1 ? arrayData[foundIndex] : undefined;\n }\n\n operationData.foundItem = foundItem;\n operationData.foundIndex = foundIndex;\n\n removeProperties(operationData, 'findProperty', 'findValue', 'findPredicate');\n\n return operationData;\n};\n","import {removeProperties} from '@operation/helper/remove-operation-properties.ts';\nimport type {TOperation} from '@operation/types.ts';\n\nexport interface IFormatDateOperationData {\n /**\n * @required\n * @dependency\n */\n date: Date | string | number;\n /**\n * @required\n * @erased\n */\n format: string;\n /**\n * @output\n */\n formattedDate: string;\n}\n\n/**\n * Formats a date using Intl.DateTimeFormat or simple patterns.\n *\n * @category Date\n */\nexport const formatDate: TOperation<\n IFormatDateOperationData,\n Omit<IFormatDateOperationData, 'format'>\n> = (operationData: IFormatDateOperationData) => {\n const {date, format} = operationData;\n\n if (!date) {\n throw new Error('formatDate: date is required');\n }\n\n const dateObj = date instanceof Date ? date : new Date(date);\n\n if (Number.isNaN(dateObj.getTime())) {\n throw new Error('formatDate: invalid date');\n }\n\n // Simple format patterns\n const year = dateObj.getFullYear();\n const month = String(dateObj.getMonth() + 1).padStart(2, '0');\n const day = String(dateObj.getDate()).padStart(2, '0');\n const hours = String(dateObj.getHours()).padStart(2, '0');\n const minutes = String(dateObj.getMinutes()).padStart(2, '0');\n const seconds = String(dateObj.getSeconds()).padStart(2, '0');\n\n let formatted = format;\n formatted = formatted.replace('YYYY', String(year));\n formatted = formatted.replace('MM', month);\n formatted = formatted.replace('DD', day);\n formatted = formatted.replace('HH', hours);\n formatted = formatted.replace('mm', minutes);\n formatted = formatted.replace('ss', seconds);\n\n operationData.formattedDate = formatted;\n\n removeProperties(operationData, 'format');\n\n return operationData;\n};\n","import {removeProperties} from '@operation/helper/remove-operation-properties.ts';\nimport type {TOperation} from '@operation/types.ts';\n\nexport type TextTransformation =\n | 'uppercase'\n | 'lowercase'\n | 'capitalize'\n | 'titlecase'\n | 'trim';\n\nexport interface IFormatTextOperationData {\n /**\n * @required\n * @dependency\n */\n textContent: string;\n /**\n * @required\n * @erased\n */\n transformation: TextTransformation;\n /**\n * @output\n */\n formattedText: string;\n}\n\n/**\n * Transforms text using format operations: uppercase, lowercase, capitalize, titlecase, or trim.\n *\n * Operates on textContent passed from previous operations (e.g., getTextContent).\n *\n * Transformations:\n * - `uppercase`: Convert all characters to uppercase\n * - `lowercase`: Convert all characters to lowercase\n * - `capitalize`: Capitalize only the first letter\n * - `titlecase`: Capitalize first letter of each word\n * - `trim`: Remove leading and trailing whitespace\n *\n * @returns Operation data with `formattedText` containing the transformed text\n *\n * @example\n * ```typescript\n * // Convert to uppercase\n * const result = formatText({\n * textContent: 'hello',\n * transformation: 'uppercase'\n * });\n * // result.formattedText = \"HELLO\"\n * ```\n *\n * @example\n * ```typescript\n * // Title case\n * const result = formatText({\n * textContent: 'hello world',\n * transformation: 'titlecase'\n * });\n * // result.formattedText = \"Hello World\"\n * ```\n *\n * @category Text\n */\nexport const formatText: TOperation<\n IFormatTextOperationData,\n Omit<IFormatTextOperationData, 'transformation'>\n> = (operationData: IFormatTextOperationData) => {\n const {textContent, transformation} = operationData;\n\n if (textContent === undefined || textContent === null) {\n throw new Error('formatText: textContent is required');\n }\n\n let text = textContent;\n\n switch (transformation) {\n case 'uppercase':\n text = text.toUpperCase();\n break;\n case 'lowercase':\n text = text.toLowerCase();\n break;\n case 'capitalize':\n text = text.charAt(0).toUpperCase() + text.slice(1);\n break;\n case 'titlecase':\n text = text.replace(/\\b\\w/g, char => char.toUpperCase());\n break;\n case 'trim':\n text = text.trim();\n break;\n default:\n throw new Error(\n `formatText: unknown transformation type \"${transformation}\"`\n );\n }\n\n operationData.formattedText = text;\n\n removeProperties(operationData, 'transformation');\n\n return operationData;\n};\n","import {removeProperties} from '@operation/helper/remove-operation-properties.ts';\nimport type {TOperation} from '@operation/types.ts';\n\nexport interface IGetAttributesFromElementOperationData {\n /**\n * The HTML element whose attributes will be retrieved\n * @dependency\n */\n selectedElement: JQuery;\n /**\n * The specified attribute names that will be retrieved\n * @required\n * @erased\n */\n attributeNames: string[];\n /**\n * The retrieved attributes\n * @output\n */\n attributeValues?: Record<string, unknown>;\n}\n\n/**\n * This operation retrieves the values for the specified attribute names from the given selected element.\n *\n * @category DOM\n */\nexport const getAttributesFromElement: TOperation<\n IGetAttributesFromElementOperationData,\n Omit<IGetAttributesFromElementOperationData, 'attributeNames'>\n> = (operationData: IGetAttributesFromElementOperationData) => {\n const {selectedElement, attributeNames} = operationData;\n\n removeProperties(operationData, 'attributeNames');\n\n operationData.attributeValues = attributeNames.reduce(\n (acc, attrName) => {\n if (attrName !== 'value') {\n acc[attrName] = selectedElement.attr(attrName);\n } else {\n acc[attrName] = selectedElement.val();\n }\n return acc;\n },\n {} as Record<string, unknown>\n );\n\n return operationData;\n};\n","import type {IController} from '@controllers/types.ts';\nimport {getElementControllers} from '@operation/helper/get-element-data.ts';\nimport {removeProperties} from '@operation/helper/remove-operation-properties.ts';\nimport type {TOperation} from '@operation/types.ts';\n\nexport interface IGetControllerFromElementOperationData {\n /**\n * @dependency\n */\n selectedElement: JQuery;\n /**\n * @type=ParameterType:controllerName\n * @required\n * @erased\n */\n controllerName: string;\n /**\n * @type=ParameterType:object\n * @output\n */\n controllerInstance?: IController<any>;\n}\n\n/**\n * This operation retrieves the controller instance with the specified name that is assigned to the given selected element.\n *\n * @param operationData\n * @returns\n *\n * @category Controller\n */\nexport const getControllerFromElement: TOperation<\n IGetControllerFromElementOperationData,\n Omit<IGetControllerFromElementOperationData, 'controllerName'>\n> = (operationData: IGetControllerFromElementOperationData) => {\n const {selectedElement, controllerName} = operationData;\n\n removeProperties(operationData, 'controllerName');\n\n const controllers = getElementControllers(selectedElement);\n const controller = controllers?.find(ctrl => ctrl.name === controllerName);\n\n if (!controller) {\n console.warn(\n `controller for name '${controllerName}' was not found on the given element`\n );\n }\n\n operationData.controllerInstance = controller;\n return operationData;\n};\n","import type * as controllers from '@controllers/index.ts';\nimport type {IController} from '@controllers/types.ts';\nimport {removeProperties} from '@operation/helper/remove-operation-properties.ts';\nimport type {TOperation, TOperationData} from '@operation/types.ts';\n\ntype TSystemName = keyof typeof controllers;\nexport interface IGetControllerInstanceOperationData {\n /**\n * @required\n * @erased\n */\n systemName: TSystemName;\n /**\n * @type=ParameterType:object\n * @output\n */\n controllerInstance?: IController<TOperationData>;\n}\n\n/**\n * This operation retrieves an instance of the given controller name.\n * It assigns this instance to the `controllerInstance` property on the current operation data\n *\n * @category Controller\n */\nexport const getControllerInstance: TOperation<\n IGetControllerInstanceOperationData,\n Omit<IGetControllerInstanceOperationData, 'systemName'>\n> = function (operationData: IGetControllerInstanceOperationData) {\n const {systemName} = operationData;\n\n removeProperties(operationData, 'systemName');\n\n operationData.controllerInstance = undefined;\n const resultCallback = (instance: IController<TOperationData>) => {\n operationData.controllerInstance = instance;\n };\n this.eventbus.broadcast('request-instance', [systemName, resultCallback]);\n return operationData;\n};\n","import type {TOperation} from '@operation/types.ts';\n\nexport interface IGetCurrentTimeOperationData {\n /**\n * @output\n */\n timestamp: number;\n /**\n * @output\n */\n date: Date;\n}\n\n/**\n * Gets the current time as timestamp and Date object.\n *\n * @category Date\n */\nexport const getCurrentTime: TOperation<\n IGetCurrentTimeOperationData,\n IGetCurrentTimeOperationData\n> = (operationData: IGetCurrentTimeOperationData) => {\n const now = new Date();\n operationData.timestamp = now.getTime();\n operationData.date = now;\n return operationData;\n};\n","import type {IDimensions} from '../../types.ts';\n\nfunction _modifyDimensionsByRatio(\n ratioModifier: string,\n dimensions: IDimensions\n) {\n const modifiedDimensions = {...dimensions};\n //h[ar=8-1]\n const prefix = ratioModifier.substring(0, 1);\n\n const ratio = ratioModifier.substring(\n ratioModifier.indexOf('[') + 1,\n ratioModifier.indexOf(']') - (ratioModifier.indexOf('[') - 1)\n );\n\n const ratios = ratio.split('=')[1].split('-');\n\n if (ratios.filter(Boolean).length !== 2) {\n throw new Error(`Badly formatted modifier, expect two ratios: ${ratio}`);\n }\n\n if (prefix === 'h') {\n modifiedDimensions.height =\n (modifiedDimensions.width / +ratios[0]) * +ratios[1];\n } else if (prefix === 'w') {\n modifiedDimensions.width =\n (modifiedDimensions.height / +ratios[1]) * +ratios[0];\n }\n\n return modifiedDimensions;\n}\n\nfunction _getModifierSuffix(\n modifier: string //*100h%\n): [string | null, number, boolean] {\n const endIdx = 1;\n let suffix: string | null = modifier.substring(\n modifier.length - endIdx,\n modifier.length\n );\n\n if (suffix !== 'h' && suffix !== 'w' && suffix !== '%') {\n suffix = null;\n }\n\n const isPercent = suffix === '%';\n\n if (isPercent) {\n suffix = modifier.substring(\n modifier.length - endIdx,\n modifier.length - (endIdx + 1)\n );\n\n if (suffix !== 'h' && suffix !== 'w') {\n suffix = null;\n }\n }\n\n return [suffix, endIdx, isPercent];\n}\n\nfunction _modifyDimensions(\n dimensions: IDimensions,\n prefix: string,\n suffix: string | null,\n widthModifier: number,\n heightModifier: number\n) {\n const modifiedDimension = {...dimensions};\n switch (prefix) {\n case '+':\n switch (suffix) {\n case 'h':\n modifiedDimension.height += heightModifier;\n break;\n case 'w':\n modifiedDimension.width += widthModifier;\n break;\n default:\n modifiedDimension.height += heightModifier;\n modifiedDimension.width += widthModifier;\n }\n break;\n case '-':\n switch (suffix) {\n case 'h':\n modifiedDimension.height -= heightModifier;\n break;\n case 'w':\n modifiedDimension.width -= widthModifier;\n break;\n default:\n modifiedDimension.height -= heightModifier;\n modifiedDimension.width -= widthModifier;\n }\n break;\n case '/':\n switch (suffix) {\n case 'h':\n modifiedDimension.height /= heightModifier;\n break;\n case 'w':\n modifiedDimension.width /= widthModifier;\n break;\n default:\n modifiedDimension.height /= heightModifier;\n modifiedDimension.width /= widthModifier;\n }\n break;\n case '*':\n switch (suffix) {\n case 'h':\n modifiedDimension.height *= heightModifier;\n break;\n case 'w':\n modifiedDimension.width *= widthModifier;\n break;\n default:\n modifiedDimension.height *= heightModifier;\n modifiedDimension.width *= widthModifier;\n }\n break;\n default:\n console.error(`Unknown operator found: ${prefix}`);\n }\n return modifiedDimension;\n}\n\n/**\n * Modifies the given dimensions using the given modifier string.\n * The modifier string is formatted in the following way:\n *\n * <operator><amount><optional-side><optional-precentage>|<ratio-definition>\n *\n * Where the ratio modifier is formatted in the following way:\n * <side>[ar=<ratio-left>-<ratio-right>]\n *\n * For example, this modifier '+100h|w[ar=8-1]' will modifiy the dimensions like this:\n * it will add a value of 100 to the height and modify the width by a ration of 8 to 1 relative to the height.\n *\n * @param dimensions\n * @param modifier\n */\nexport function modifyDimensions(dimensions: IDimensions, modifier: string) {\n const clonedDimensions = {...dimensions};\n let ratioModifier: string | null = null;\n if (modifier.indexOf('|') > -1) {\n [modifier, ratioModifier] = modifier.split('|');\n }\n\n const prefix = modifier.substring(0, 1);\n const [suffix, endIdx, isPercent] = _getModifierSuffix(modifier);\n\n const value = parseInt(\n suffix !== null\n ? modifier.substring(1, modifier.length - (endIdx - 1))\n : modifier.substring(1),\n 10\n );\n\n let widthModifier = value;\n let heightModifier = value;\n if (isPercent) {\n widthModifier = (clonedDimensions.width / 100) * value;\n heightModifier = (clonedDimensions.height / 100) * value;\n }\n\n const modifiedDimension = _modifyDimensions(\n clonedDimensions,\n prefix,\n suffix,\n widthModifier,\n heightModifier\n );\n\n if (ratioModifier) {\n return _modifyDimensionsByRatio(ratioModifier, modifiedDimension);\n }\n\n return modifiedDimension;\n}\n","import {modifyDimensions} from '@operation/helper/modify-dimensions.ts';\nimport {removeProperties} from '@operation/helper/remove-operation-properties.ts';\nimport type {TOperation} from '@operation/types.ts';\n\nexport interface IGetElementDimensionsOperationData {\n /**\n * @dependency\n */\n selectedElement: JQuery;\n /**\n * @type=ParameterType:dimensionsModifier\n * @erased\n */\n modifier?: string;\n /**\n * @type=ParameterType:object\n * @output\n */\n dimensions?: {width?: number; height?: number};\n}\n\n/**\n * This operation calculates the width and height of the given selected element.\n * It assigns this struct to the dimensions property on the current operation data.\n * Optionally the width and height can be modified using the given modifier string.\n *\n * The modifier string is formatted in the following way:\n *\n * <operator><amount><optional-side><optional-precentage>|<ratio-definition>\n *\n * Where the ratio modifier is formatted in the following way:\n * <side>[ar=<ratio-left>-<ratio-right>]\n *\n * For example, this modifier '+100h|w[ar=8-1]' will modifiy the dimensions like this:\n * it will add a value of 100 to the height and modify the width by a ratio of 8 to 1 relative to the height.\n *\n * @category DOM\n */\nexport const getElementDimensions: TOperation<\n IGetElementDimensionsOperationData,\n Omit<IGetElementDimensionsOperationData, 'modifier'>\n> = (operationData: IGetElementDimensionsOperationData) => {\n const {selectedElement, modifier} = operationData;\n\n removeProperties(operationData, 'modifier');\n\n let dimensions = {\n width: selectedElement.innerWidth() ?? 0,\n height: selectedElement.innerHeight() ?? 0,\n };\n\n if (dimensions.height === 0) {\n dimensions.height = dimensions.width;\n }\n\n if (modifier) {\n dimensions = modifyDimensions(dimensions, modifier);\n }\n\n operationData.dimensions = dimensions;\n return operationData;\n};\n","import type {TOperation} from '@operation/types.ts';\nimport $ from 'jquery';\n\nexport interface IGetFocusedElementOperationData {\n /**\n * @type=ParameterType:jQuery\n * @output\n */\n focusedElement: JQuery;\n}\n\n/**\n * Gets the currently focused element.\n *\n * @category Focus\n */\nexport const getFocusedElement: TOperation<\n IGetFocusedElementOperationData,\n IGetFocusedElementOperationData\n> = (operationData: IGetFocusedElementOperationData) => {\n operationData.focusedElement = document.activeElement\n ? $(document.activeElement as HTMLElement)\n : $();\n return operationData;\n};\n","import type {TOperation} from '@operation/types.ts';\n\nexport interface IGetFormDataOperationData {\n /**\n * @required\n * @dependency\n */\n selectedElement: JQuery;\n /**\n * @output\n * @type=ParameterType:object\n */\n formData?: Record<string, any>;\n}\n\n/**\n * Extracts all input, select, and textarea values from form element into operation data.\n *\n * This operation reads form field values and returns them as an object with field names as keys.\n * Only processes form elements that are enabled and not hidden. Handles checkboxes, radio buttons,\n * select elements, textareas, and text inputs.\n *\n * @returns Operation data with `formData` object containing field values\n *\n * @example\n * ```typescript\n * // Given a form with fields: name=\"John\", email=\"john@example.com\"\n * const result = getFormData({selectedElement: $form});\n * // Returns: {selectedElement: $form, formData: {name: \"John\", email: \"john@example.com\"}}\n * ```\n *\n * @category Form\n */\nexport const getFormData: TOperation<\n IGetFormDataOperationData,\n IGetFormDataOperationData\n> = (operationData: IGetFormDataOperationData) => {\n const {selectedElement} = operationData;\n\n // Validate selectedElement exists\n if (!selectedElement || selectedElement.length === 0) {\n throw new Error('getFormData: selectedElement is required');\n }\n\n // Validate selectedElement is a form\n if (!selectedElement.is('form')) {\n throw new Error('getFormData: selectedElement must be a form element');\n }\n\n // Use jQuery's serializeArray to get form data\n const formArray = selectedElement.serializeArray();\n const formData: Record<string, any> = {};\n\n // Convert array format to object format\n for (const field of formArray) {\n // Handle multiple values for same name (checkboxes)\n if (formData[field.name] !== undefined) {\n // Convert to array if not already\n if (!Array.isArray(formData[field.name])) {\n formData[field.name] = [formData[field.name]];\n }\n formData[field.name].push(field.value);\n } else {\n formData[field.name] = field.value;\n }\n }\n\n operationData.formData = formData;\n\n return operationData;\n};\n","import type {TOperation} from '@operation/types.ts';\nimport type {RequireKeys} from '@/types.ts';\n\nexport interface IGetImportOperationData {\n /**\n * @type=ParameterType:systemName\n * @required\n * @erased\n */\n systemName: string;\n /**\n * @output\n */\n importedInstance?: unknown;\n}\n\n/**\n * This operation retrieves the import specified by the given `systemName` and\n * assigns it to the `importedInstance` property on the current operaton date.\n *\n * @param operationData\n *\n * @category Utility\n */\nexport const getImport: TOperation<\n IGetImportOperationData,\n Omit<RequireKeys<IGetImportOperationData, 'importedInstance'>, 'systemName'>\n> = function (operationData: IGetImportOperationData) {\n const {systemName} = operationData;\n\n delete (operationData as any).systemName;\n\n const callBack = (instance: unknown) => {\n operationData.importedInstance = instance;\n };\n this.eventbus.broadcast('request-function', [systemName, callBack]);\n delete (operationData as any).systemName;\n return operationData as Omit<\n RequireKeys<IGetImportOperationData, 'importedInstance'>,\n 'systemName'\n >;\n};\n","import {removeProperties} from '@operation/helper/remove-operation-properties.ts';\nimport type {TOperation} from '@operation/types.ts';\n\nexport interface IGetQueryParamsOperationData {\n /**\n * The query params will be added as property/values to this object.\n * So, the query string `?foo=bar&bar=foo` will result in:\n * ```json\n * {\n * foo: \"bar\",\n * bar: \"foo\"\n * }\n * ```\n * This object will be assigned to the `queryParams` property.\n * @output\n */\n queryParams?: Record<string, string>;\n /**\n * The properties on this object will be assigned to the queryParams result\n * when the given property name is not part of the query string.\n *\n * @erased\n *\n */\n defaultValues?: Record<string, string>;\n}\n\n/**\n * This operation retrieves the current query parameters from the browser's address bar and places\n * them on the returned operation data.\n *\n * @category Utility\n */\nexport const getQueryParams: TOperation<\n IGetQueryParamsOperationData,\n Omit<IGetQueryParamsOperationData, 'defaultValues'>\n> = (operationData: IGetQueryParamsOperationData) => {\n const searchParams = new URLSearchParams(window.location.search);\n const queryParams = Object.fromEntries(searchParams.entries());\n\n const {defaultValues = {}} = operationData;\n\n removeProperties(operationData, 'defaultValues');\n\n operationData.queryParams = {\n ...defaultValues,\n ...queryParams,\n };\n\n return operationData;\n};\n","import type {TOperation} from '@operation/types.ts';\n\nexport interface IGetScrollPositionOperationData {\n /**\n * @output\n */\n scrollX: number;\n /**\n * @output\n */\n scrollY: number;\n}\n\n/**\n * Gets the current scroll position of the viewport.\n *\n * Returns x (horizontal) and y (vertical) scroll positions in pixels.\n * Uses cross-browser compatible methods to retrieve scroll position.\n *\n * @returns Operation data with `scrollX` and `scrollY` values\n *\n * @example\n * ```typescript\n * // Get current scroll position\n * const result = getScrollPosition({});\n * // result.scrollX = 150\n * // result.scrollY = 400\n * ```\n *\n * @category Scroll\n */\nexport const getScrollPosition: TOperation<\n IGetScrollPositionOperationData,\n IGetScrollPositionOperationData\n> = (operationData: IGetScrollPositionOperationData) => {\n // Cross-browser scroll position detection\n const scrollX =\n window.pageXOffset !== undefined\n ? window.pageXOffset\n : (window as any).scrollX !== undefined\n ? (window as any).scrollX\n : document.documentElement?.scrollLeft || 0;\n\n const scrollY =\n window.pageYOffset !== undefined\n ? window.pageYOffset\n : (window as any).scrollY !== undefined\n ? (window as any).scrollY\n : document.documentElement?.scrollTop || 0;\n\n operationData.scrollX = scrollX;\n operationData.scrollY = scrollY;\n\n return operationData;\n};\n","import type {TOperation} from '@operation/types.ts';\n\nexport interface IGetTextContentOperationData {\n /**\n * @required\n * @dependency\n */\n selectedElement: JQuery;\n /**\n * @output\n */\n textContent?: string;\n}\n\n/**\n * Extracts text content from element, stripping all HTML markup.\n *\n * Uses jQuery's `.text()` method which is XSS-safe and returns only the text content\n * without any HTML tags. Preserves whitespace and text from nested elements.\n *\n * @returns Operation data with `textContent` containing the extracted plain text\n *\n * @example\n * ```typescript\n * // Extract text from element with HTML\n * const result = getTextContent({selectedElement: $div});\n * // Given: <div>Hello <strong>World</strong>!</div>\n * // Returns: {textContent: \"Hello World!\"}\n * ```\n *\n * @category Text\n */\nexport const getTextContent: TOperation<\n IGetTextContentOperationData,\n IGetTextContentOperationData\n> = (operationData: IGetTextContentOperationData) => {\n const {selectedElement} = operationData;\n\n if (!selectedElement || selectedElement.length === 0) {\n throw new Error('getTextContent: selectedElement is required');\n }\n\n operationData.textContent = selectedElement.text();\n\n return operationData;\n};\n","import {removeProperties} from '@operation/helper/remove-operation-properties.ts';\nimport type {TOperation} from '@operation/types.ts';\n\nexport interface IHttpDeleteOperationData {\n /**\n * @required\n * @erased\n */\n url: string;\n /**\n * @optional\n * @erased\n */\n headers?: Record<string, string>;\n /**\n * @output\n */\n response: any;\n /**\n * @output\n */\n status: number;\n}\n\n/**\n * Performs an HTTP DELETE request to the specified URL.\n *\n * @returns Operation data with `response` (parsed JSON or empty) and `status` (HTTP status code)\n *\n * @example\n * ```typescript\n * const result = await httpDelete({\n * url: 'https://api.example.com/users/123',\n * headers: { 'Authorization': 'Bearer token' }\n * });\n * // result.response = {} or null\n * // result.status = 204\n * ```\n *\n * @category HTTP\n */\nexport const httpDelete: TOperation<\n IHttpDeleteOperationData,\n Omit<IHttpDeleteOperationData, 'url' | 'headers'>\n> = async (operationData: IHttpDeleteOperationData) => {\n const {url, headers = {}} = operationData;\n\n if (!url || url.trim() === '') {\n throw new Error('httpDelete: url is required');\n }\n\n try {\n const response = await fetch(url, {\n method: 'DELETE',\n headers,\n });\n\n operationData.status = response.status;\n\n if (!response.ok) {\n throw new Error(\n `httpDelete: HTTP error ${response.status} ${response.statusText}`\n );\n }\n\n // DELETE may return empty body (204 No Content)\n const contentType = response.headers.get('content-type');\n if (contentType?.includes('application/json')) {\n const data = await response.json();\n operationData.response = data;\n } else {\n operationData.response = null;\n }\n\n removeProperties(operationData, 'url', 'headers');\n\n return operationData;\n } catch (error) {\n throw new Error(`httpDelete: ${(error as Error).message}`);\n }\n};\n","import {removeProperties} from '@operation/helper/remove-operation-properties.ts';\nimport type {TOperation} from '@operation/types.ts';\n\nexport interface IHttpPostOperationData {\n /**\n * @required\n * @erased\n */\n url: string;\n /**\n * @optional\n * @erased\n */\n body?: any;\n /**\n * @optional\n * @erased\n */\n headers?: Record<string, string>;\n /**\n * @output\n */\n response: any;\n /**\n * @output\n */\n status: number;\n}\n\n/**\n * Performs an HTTP POST request to the specified URL.\n *\n * @returns Operation data with `response` (parsed JSON) and `status` (HTTP status code)\n *\n * @example\n * ```typescript\n * const result = await httpPost({\n * url: 'https://api.example.com/users',\n * body: { name: 'John', email: 'john@example.com' },\n * headers: { 'Content-Type': 'application/json' }\n * });\n * // result.response = { id: 123, name: 'John', ... }\n * // result.status = 201\n * ```\n *\n * @category HTTP\n */\nexport const httpPost: TOperation<\n IHttpPostOperationData,\n Omit<IHttpPostOperationData, 'url' | 'body' | 'headers'>\n> = async (operationData: IHttpPostOperationData) => {\n const {url, body, headers = {}} = operationData;\n\n if (!url || url.trim() === '') {\n throw new Error('httpPost: url is required');\n }\n\n try {\n const response = await fetch(url, {\n method: 'POST',\n headers: {\n 'Content-Type': 'application/json',\n ...headers,\n },\n body: JSON.stringify(body),\n });\n\n operationData.status = response.status;\n\n if (!response.ok) {\n throw new Error(\n `httpPost: HTTP error ${response.status} ${response.statusText}`\n );\n }\n\n const data = await response.json();\n operationData.response = data;\n\n removeProperties(operationData, 'url', 'body', 'headers');\n\n return operationData;\n } catch (error) {\n throw new Error(`httpPost: ${(error as Error).message}`);\n }\n};\n","import {removeProperties} from '@operation/helper/remove-operation-properties.ts';\nimport type {TOperation} from '@operation/types.ts';\n\nexport interface IHttpPutOperationData {\n /**\n * @required\n * @erased\n */\n url: string;\n /**\n * @optional\n * @erased\n */\n body?: any;\n /**\n * @optional\n * @erased\n */\n headers?: Record<string, string>;\n /**\n * @output\n */\n response: any;\n /**\n * @output\n */\n status: number;\n}\n\n/**\n * Performs an HTTP PUT request to the specified URL.\n *\n * @returns Operation data with `response` (parsed JSON) and `status` (HTTP status code)\n *\n * @example\n * ```typescript\n * const result = await httpPut({\n * url: 'https://api.example.com/users/123',\n * body: { name: 'John Updated', email: 'john.new@example.com' },\n * headers: { 'Content-Type': 'application/json' }\n * });\n * // result.response = { id: 123, name: 'John Updated', ... }\n * // result.status = 200\n * ```\n *\n * @category HTTP\n */\nexport const httpPut: TOperation<\n IHttpPutOperationData,\n Omit<IHttpPutOperationData, 'url' | 'body' | 'headers'>\n> = async (operationData: IHttpPutOperationData) => {\n const {url, body, headers = {}} = operationData;\n\n if (!url || url.trim() === '') {\n throw new Error('httpPut: url is required');\n }\n\n try {\n const response = await fetch(url, {\n method: 'PUT',\n headers: {\n 'Content-Type': 'application/json',\n ...headers,\n },\n body: JSON.stringify(body),\n });\n\n operationData.status = response.status;\n\n if (!response.ok) {\n throw new Error(\n `httpPut: HTTP error ${response.status} ${response.statusText}`\n );\n }\n\n const data = await response.json();\n operationData.response = data;\n\n removeProperties(operationData, 'url', 'body', 'headers');\n\n return operationData;\n } catch (error) {\n throw new Error(`httpPut: ${(error as Error).message}`);\n }\n};\n","import type {TOperation} from '@operation/types.ts';\n\nexport interface IInvokeObjectMethodOperationData {\n /**\n *\n * The given object instance\n * @dependency\n *\n */\n instance: any;\n /**\n * The method name on the given object that will be invoked\n * @required\n * @erased\n */\n methodName: string;\n /**\n * Arguments that will be passed to the specified method\n * @erased\n */\n methodArguments?: unknown[];\n /**\n * If any, the results of the method invocation are assigned to the property\n * @output\n */\n methodResult?: unknown;\n}\n\n/**\n * This operation invokes the specified method on the given object with the given optional arguments\n * and assigns the result to the `methodResult` operationdata property.\n *\n * @param operationData\n *\n * @category Utility\n */\nexport const invokeObjectMethod: TOperation<\n IInvokeObjectMethodOperationData,\n Omit<IInvokeObjectMethodOperationData, 'methodName' | 'methodArguments'>\n> = (operationData: IInvokeObjectMethodOperationData) => {\n const {methodName, methodArguments, ...newOperationData} = operationData;\n\n delete (operationData as any).methodName;\n delete (operationData as any).methodArguments;\n\n const func = operationData.instance[methodName];\n if (typeof func === 'function') {\n newOperationData.methodResult = func.apply(\n operationData.instance,\n methodArguments ?? []\n );\n } else {\n console.error(`The given member name ${methodName} is not a function`);\n }\n\n return newOperationData;\n};\n","import type {TOperation} from '@operation/types.ts';\n\nexport interface IIsElementInViewportOperationData {\n /**\n * @required\n * @dependency\n */\n selectedElement: JQuery;\n /**\n * @output\n */\n isInViewport: boolean;\n}\n\n/**\n * Checks if an element is currently visible within the viewport.\n *\n * Uses `getBoundingClientRect()` to determine if the element is within the viewport boundaries.\n *\n * @returns Operation data with `isInViewport` boolean indicating visibility\n *\n * @example\n * ```typescript\n * // Check if element is in view\n * const result = isElementInViewport({\n * selectedElement: $targetElement\n * });\n * // result.isInViewport = true or false\n * ```\n *\n * @category DOM\n */\nexport const isElementInViewport: TOperation<\n IIsElementInViewportOperationData,\n IIsElementInViewportOperationData\n> = (operationData: IIsElementInViewportOperationData) => {\n const {selectedElement} = operationData;\n\n if (!selectedElement || selectedElement.length === 0) {\n throw new Error('isElementInViewport: selectedElement is required');\n }\n\n const element = selectedElement[0];\n const rect = element.getBoundingClientRect();\n\n const isInViewport =\n rect.top >= 0 &&\n rect.left >= 0 &&\n rect.bottom <=\n (window.innerHeight || document.documentElement.clientHeight) &&\n rect.right <= (window.innerWidth || document.documentElement.clientWidth);\n\n operationData.isInViewport = isInViewport;\n\n return operationData;\n};\n","import {removeProperties} from '@operation/helper/remove-operation-properties.ts';\nimport type {TOperation} from '@operation/types.ts';\n\nexport type StorageType = 'local' | 'session';\n\nexport interface ILoadFromStorageOperationData {\n /**\n * @required\n * @erased\n */\n key: string;\n /**\n * @required\n * @erased\n */\n storageType: StorageType;\n /**\n * @output\n */\n loadedValue: any;\n}\n\n/**\n * Loads data from browser storage (localStorage or sessionStorage).\n *\n * Deserializes the stored JSON value. Returns `null` if key doesn't exist.\n *\n * @returns Operation data with `loadedValue` containing the deserialized data\n *\n * @example\n * ```typescript\n * // Load user settings from localStorage\n * const result = loadFromStorage({\n * key: 'user-settings',\n * storageType: 'local'\n * });\n * // result.loadedValue = { theme: 'dark', language: 'en' }\n * ```\n *\n * @example\n * ```typescript\n * // Load session data\n * const result = loadFromStorage({\n * key: 'session-id',\n * storageType: 'session'\n * });\n * // result.loadedValue = 'abc123' or null if not found\n * ```\n *\n * @category Data\n */\nexport const loadFromStorage: TOperation<\n ILoadFromStorageOperationData,\n Omit<ILoadFromStorageOperationData, 'storageType'>\n> = (operationData: ILoadFromStorageOperationData) => {\n const {key, storageType} = operationData;\n\n if (!key || key.trim() === '') {\n throw new Error('loadFromStorage: key is required');\n }\n\n const storage = storageType === 'session' ? sessionStorage : localStorage;\n const stored = storage.getItem(key);\n\n if (stored === null) {\n operationData.loadedValue = null;\n } else {\n try {\n operationData.loadedValue = JSON.parse(stored);\n } catch {\n throw new Error(\n `loadFromStorage: failed to parse stored value for key \"${key}\"`\n );\n }\n }\n\n removeProperties(operationData, 'storageType');\n\n return operationData;\n};\n","import {removeProperties} from '@operation/helper/remove-operation-properties.ts';\nimport type {TOperation} from '@operation/types.ts';\n\nconst jsonCache: Record<string, unknown> = {};\n\nexport interface ILoadJSONOperationData {\n /**\n * The URL where the JSON will be retrieved from\n * @required\n * @erased\n */\n url: string;\n /**\n * If true, the results will be added to the cache and any subsequent call will use this cache\n * @erased\n */\n cache?: boolean;\n /**\n * The JSON retrieved from the given URL\n * @output\n */\n json?: any;\n}\n\nconst addToCache = (key: string, value: any) => {\n jsonCache[key] = value;\n};\n\n/**\n * This operation loads a JSON file from the specified url and assigns it to the json\n * property on the current operation data.\n *\n * If the cache property is set to true and a cached value already exists, this is assigned\n * instead of re-retrieving it from the url.\n *\n * @category Utility\n */\nexport const loadJson: TOperation<\n ILoadJSONOperationData,\n Omit<ILoadJSONOperationData, 'url' | 'cache'>\n> = async (operationData: ILoadJSONOperationData) => {\n const {url, cache} = operationData;\n\n removeProperties(operationData, 'url', 'cache');\n\n if (cache && jsonCache[url]) {\n operationData.json = jsonCache[url];\n return operationData;\n }\n\n const response = await fetch(url);\n const json = await response.json();\n const cacheValue = (operationData.json = json);\n\n if (cache) {\n addToCache(url, cacheValue);\n }\n\n return operationData;\n};\n\nexport const clearCache = () => {\n for (const p in jsonCache) {\n delete jsonCache[p];\n }\n};\n","import {getGlobals} from '@operation/helper/globals.ts';\nimport {removeProperties} from '@operation/helper/remove-operation-properties.ts';\nimport type {TOperation} from '@operation/types.ts';\n\nexport interface ILogOperationData {\n /**\n * @type=ParameterType:object|ParameterType:string|ParameterType:number|ParameterType:boolean|ParameterType:array\n * @erased\n */\n logValue?: any;\n /**\n * @erased\n */\n logName?: string;\n}\n\n/**\n * This operation logs the specified value, or, when no logValue property has been assigned\n * it will log the current operation data, global data and scope to the console\n *\n * @category Utility\n */\nexport const log: TOperation<\n ILogOperationData,\n Omit<ILogOperationData, 'logValue' | 'logName'>\n> = function (operationData: ILogOperationData) {\n if ('logValue' in operationData) {\n console.log(operationData.logName ?? 'logValue', operationData.logValue);\n removeProperties(operationData, 'logValue', 'logName');\n } else {\n const globalData = getGlobals();\n\n console.group('Operation info');\n console.log('scope', this);\n console.log('operationData', operationData);\n console.log('globalData', globalData);\n console.groupEnd();\n }\n\n return operationData;\n};\n","import {removeProperties} from '@operation/helper/remove-operation-properties.ts';\nimport type {TOperation} from '@operation/types.ts';\n\nexport interface IMapArrayOperationData {\n /**\n * @required\n * @dependency\n */\n arrayData: any[];\n /**\n * @required\n * @erased\n */\n mapFunction: (item: any, index?: number) => any;\n /**\n * @output\n */\n mappedArray?: any[];\n}\n\n/**\n * Transforms each element of an array using a mapping function.\n *\n * Operates on arrayData passed from previous operations.\n * The mapFunction receives each item and optionally its index.\n *\n * @returns Operation data with `mappedArray` containing transformed elements\n *\n * @example\n * ```typescript\n * // Double each number\n * const result = mapArray({\n * arrayData: [1, 2, 3, 4],\n * mapFunction: (item) => item * 2\n * });\n * // result.mappedArray = [2, 4, 6, 8]\n * ```\n *\n * @example\n * ```typescript\n * // Extract property from objects\n * const result = mapArray({\n * arrayData: [{name: 'Alice', age: 25}, {name: 'Bob', age: 30}],\n * mapFunction: (item) => item.name\n * });\n * // result.mappedArray = ['Alice', 'Bob']\n * ```\n *\n * @example\n * ```typescript\n * // Use index in transformation\n * const result = mapArray({\n * arrayData: ['a', 'b', 'c'],\n * mapFunction: (item, index) => `${index}-${item}`\n * });\n * // result.mappedArray = ['0-a', '1-b', '2-c']\n * ```\n *\n * @category Array\n */\nexport const mapArray: TOperation<\n IMapArrayOperationData,\n Omit<IMapArrayOperationData, 'mapFunction'>\n> = (operationData: IMapArrayOperationData) => {\n const {arrayData, mapFunction} = operationData;\n\n if (!Array.isArray(arrayData)) {\n throw new Error('mapArray: arrayData is required and must be an array');\n }\n\n if (typeof mapFunction !== 'function') {\n throw new Error('mapArray: mapFunction is required and must be a function');\n }\n\n operationData.mappedArray = arrayData.map(mapFunction);\n\n removeProperties(operationData, 'mapFunction');\n\n return operationData;\n};\n","export function isString(value: any): value is string {\n return typeof value === 'string';\n}\n","import {resolvePropertyValues} from '@operation/helper/resolve-property-values.ts';\nimport type {TOperation} from '@operation/types.ts';\nimport {isFunction} from '@util/guards/is-function.ts';\nimport {isString} from '@util/guards/is-string.ts';\n\nexport type MathFunctionKeys = {\n [K in keyof Math]: Math[K] extends (...args: any) => any ? K : never;\n}[keyof Math];\n\nexport type MathNonFunctionKeys = {\n [K in keyof Math]: Math[K] extends (...args: any) => any ? never : K;\n}[keyof Math];\n\nexport interface IMathOperationData {\n /**\n * @type=ParameterType:array\n * @required\n * @erased\n */\n args: (number | string | MathNonFunctionKeys)[];\n /**\n * @type=ParameterType:mathfunction\n * @required\n * @erased\n */\n functionName: MathFunctionKeys;\n /**\n * @output\n */\n mathResult?: number;\n}\n\n/**\n * This operation performs the given math function with the specified arguments.\n *\n * @category Utility\n */\nexport const math: TOperation<\n IMathOperationData,\n Omit<IMathOperationData, 'args' | 'functionName'>\n> = function (operationData: IMathOperationData) {\n operationData = resolvePropertyValues(operationData, this, operationData);\n operationData.args = resolveMathConstants(operationData.args);\n\n const {args, functionName, ...newOperationData} = operationData;\n\n newOperationData.mathResult = (\n Math[functionName] as (...args: any[]) => any\n ).apply(null, args);\n\n return newOperationData;\n};\n\nfunction resolveMathConstants(args: any[]) {\n return args.map((arg: any) => {\n if (isMathProperty(arg)) {\n return Math[arg];\n }\n return arg;\n });\n}\n\nfunction isMathProperty(value: string | symbol): value is keyof Math {\n return (\n isString(value) && value in Math && !isFunction(Math[value as keyof Math])\n );\n}\n","import {findMatchingOperationIndex} from '@operation/helper/find-matching-operation-index.ts';\nimport type {IOperationScope, TOperation} from '@operation/types.ts';\n\n/**\n * If the preceeding {@link when} operation evaluates to `true` subsequent operations will\n * be skipped until an {@link endWhen} operation is encountered.\n *\n * @category Control Flow\n */\nexport const otherwise: TOperation<Record<string, unknown>> = function (\n operationData: Record<string, unknown>\n) {\n if (this.whenEvaluation) {\n this.newIndex = findEndWhenIndex(this);\n }\n return operationData;\n};\n\nfunction findEndWhenIndex(scope: IOperationScope) {\n const currentIndex = scope.currentIndex + 1;\n const list = scope.operations.slice(currentIndex);\n\n const endWhenIndex = list.findIndex(\n findMatchingOperationIndex.bind({\n counter: 0,\n self: 'when',\n matchingName: 'endWhen',\n })\n );\n\n return endWhenIndex > -1\n ? endWhenIndex + currentIndex\n : scope.operations.length;\n}\n","import type {TOperation} from '@operation/types.ts';\n\nexport interface IRemoveClassOperationData {\n /**\n * @dependency\n */\n selectedElement: JQuery;\n /**\n * @type=ParameterType:className\n * @required\n * @erased\n */\n className: string;\n}\n\n/**\n * This operation removes the spcified class name from the given selected element.\n *\n * @param operationData\n * @returns\n * @category DOM\n */\nexport const removeClass: TOperation<\n IRemoveClassOperationData,\n Omit<IRemoveClassOperationData, 'className'>\n> = (operationData: IRemoveClassOperationData) => {\n const {selectedElement, className} = operationData;\n delete (operationData as any).className;\n selectedElement.removeClass(className);\n return operationData;\n};\n","import type {IController} from '@controllers/types.ts';\nimport {getElementControllers} from '@operation/helper/get-element-data.ts';\nimport type {TOperation} from '@operation/types.ts';\n\nexport interface IRemoveControllerFromElementOperationData {\n /**\n * @dependency\n */\n selectedElement: JQuery;\n /**\n * @type=ParameterType:controllerName\n * @required\n * @erased\n */\n controllerName: string;\n}\n\n/**\n * This operation removes the controller with the specified name from the given selected element.\n *\n * @param operationData\n * @returns\n *\n * @category Controller\n */\nexport const removeControllerFromElement: TOperation<\n IRemoveControllerFromElementOperationData,\n Omit<IRemoveControllerFromElementOperationData, 'controllerName'>\n> = function (operationData: IRemoveControllerFromElementOperationData) {\n const {selectedElement, controllerName} = operationData;\n\n delete (operationData as any).controllerName;\n\n const controllers = getElementControllers(selectedElement);\n const controller = controllers?.find(\n (ctrl: IController<any>) => ctrl.name === controllerName\n );\n\n if (controller && controllers) {\n const idx = controllers.indexOf(controller);\n controllers.splice(idx, 1);\n controller.detach(this.eventbus);\n } else {\n console.warn(\n `controller for name '${controllerName}' was not found on the given element`\n );\n }\n\n return operationData;\n};\n","import type {TOperation} from '@operation/types.ts';\n\nexport interface IRemoveElementOperationData {\n /**\n * @dependency\n */\n selectedElement: JQuery;\n}\n\n/**\n * This operation removes the given selected element from the DOM.\n *\n * @category DOM\n */\nexport const removeElement: TOperation<IRemoveElementOperationData> = (\n operationData: IRemoveElementOperationData\n) => {\n const {selectedElement} = operationData;\n selectedElement.remove();\n return operationData;\n};\n","import type {TOperation} from '@operation/types.ts';\n\nexport interface IRemovePropertiesFromOperationDataOperationData {\n /**\n * @required\n * @erased\n */\n propertyNames: string[];\n}\n\n/**\n * This operation removes the given list of properties from the current operation data.\n * It will also remove the property `propertyNames` from the result.\n *\n * @category Data\n */\nexport const removePropertiesFromOperationData: TOperation<\n IRemovePropertiesFromOperationDataOperationData,\n Omit<IRemovePropertiesFromOperationDataOperationData, 'propertyNames'>\n> = (operationData: IRemovePropertiesFromOperationDataOperationData) => {\n const {propertyNames} = operationData;\n if (propertyNames.indexOf('propertyNames') < 0) {\n propertyNames.push('propertyNames');\n }\n\n return Object.fromEntries(\n Object.entries(operationData).filter(\n ([name, _value]) => !propertyNames.includes(name)\n )\n );\n};\n","import {removeProperties} from '@operation/helper/remove-operation-properties.ts';\nimport type {TOperation} from '@operation/types.ts';\n\nexport interface IReparentElementOperationData {\n /**\n * @dependency\n */\n selectedElement: JQuery;\n /**\n * @type=ParameterType:selector\n * @required\n * @erased\n */\n newParentSelector: string;\n}\n\n/**\n * This operation moves the given selected element to the new parent that is defined\n * by the specified `newParentSelector`.\n *\n * @param operationData\n * @returns\n *\n * @category DOM\n */\nexport const reparentElement: TOperation<\n IReparentElementOperationData,\n Omit<IReparentElementOperationData, 'newParentSelector'>\n> = (operationData: IReparentElementOperationData) => {\n const {selectedElement, newParentSelector} = operationData;\n removeProperties(operationData, 'newParentSelector');\n selectedElement.remove().appendTo(newParentSelector);\n return operationData;\n};\n","import {removeProperties} from '@operation/helper/remove-operation-properties.ts';\nimport type {TOperation} from '@operation/types.ts';\n\nexport interface IReplaceStringOperationData {\n /**\n * @required\n * @dependency\n */\n textContent: string;\n /**\n * @required\n * @erased\n */\n pattern: string | RegExp;\n /**\n * @required\n * @erased\n */\n replacement: string;\n /**\n * @output\n */\n result: string;\n}\n\n/**\n * Replaces occurrences of a pattern in a string (alias for replaceText for string context).\n *\n * @returns Operation data with `result` containing the replaced string\n *\n * @example\n * ```typescript\n * const result = replaceString({\n * textContent: 'Hello World',\n * pattern: 'World',\n * replacement: 'Universe'\n * });\n * // result.result = \"Hello Universe\"\n * ```\n *\n * @category String\n */\nexport const replaceString: TOperation<\n IReplaceStringOperationData,\n Omit<IReplaceStringOperationData, 'pattern' | 'replacement'>\n> = (operationData: IReplaceStringOperationData) => {\n const {textContent, pattern, replacement} = operationData;\n\n if (textContent === undefined || textContent === null) {\n throw new Error('replaceString: textContent is required');\n }\n\n operationData.result = textContent.replace(pattern, replacement);\n\n removeProperties(operationData, 'pattern', 'replacement');\n\n return operationData;\n};\n","import {removeProperties} from '@operation/helper/remove-operation-properties.ts';\nimport type {TOperation} from '@operation/types.ts';\n\nexport interface IReplaceTextOperationData {\n /**\n * @required\n * @dependency\n */\n textContent: string;\n /**\n * @required\n * @erased\n */\n searchPattern: string | RegExp;\n /**\n * @required\n * @erased\n */\n replacement: string;\n /**\n * @output\n */\n replacementCount: number;\n}\n\n/**\n * Finds and replaces text using literal string or regex pattern.\n *\n * Operates on textContent passed from previous operations (e.g., getTextContent).\n * Supports regex patterns with global flag for multiple replacements.\n * Updates textContent with replaced text and sets replacementCount.\n *\n * @returns Operation data with updated `textContent` and `replacementCount` indicating number of replacements made\n *\n * @example\n * ```typescript\n * // Replace placeholder with value\n * const result = replaceText({\n * textContent: 'Hello {{name}}',\n * searchPattern: '{{name}}',\n * replacement: 'John'\n * });\n * // result.textContent = \"Hello John\"\n * // result.replacementCount = 1\n * ```\n *\n * @example\n * ```typescript\n * // Replace with regex pattern\n * const result = replaceText({\n * textContent: 'Test 123 and 456',\n * searchPattern: /\\d+/g,\n * replacement: 'NUM'\n * });\n * // result.textContent = \"Test NUM and NUM\"\n * // result.replacementCount = 2\n * ```\n *\n * @category Text\n */\nexport const replaceText: TOperation<\n IReplaceTextOperationData,\n Omit<IReplaceTextOperationData, 'searchPattern' | 'replacement'>\n> = (operationData: IReplaceTextOperationData) => {\n const {textContent, searchPattern, replacement} = operationData;\n\n if (textContent === undefined || textContent === null) {\n throw new Error('replaceText: textContent is required');\n }\n\n let newText: string;\n let count = 0;\n\n if (searchPattern instanceof RegExp) {\n // Count matches for regex\n const matches = textContent.match(searchPattern);\n count = matches ? matches.length : 0;\n newText = textContent.replace(searchPattern, replacement);\n } else {\n // Count matches for string\n const parts = textContent.split(searchPattern);\n count = parts.length - 1;\n newText = parts.join(replacement);\n }\n\n operationData.textContent = newText;\n operationData.replacementCount = count;\n\n removeProperties(operationData, 'searchPattern', 'replacement');\n\n return operationData;\n};\n","import type {IAction} from '@action/types.ts';\nimport {removeProperties} from '@operation/helper/remove-operation-properties.ts';\nimport type {TOperation} from '@operation/types.ts';\n\nexport interface IRequestActionOperationData {\n /**\n * @type=ParameterType:actionName\n * @required\n * @erased\n */\n systemName: string;\n /**\n * @type=ParameterType:object\n * @output\n */\n actionInstance?: IAction;\n}\n\n/**\n * This operation requests an action instance with the specified name and assigns it\n * to the `actionInstance` property on the current operation data.\n *\n * @category Action\n */\nexport const requestAction: TOperation<\n IRequestActionOperationData,\n Omit<Required<IRequestActionOperationData>, 'systemName'>\n> = function (operationData: IRequestActionOperationData) {\n const {systemName} = operationData;\n\n removeProperties(operationData, 'systemName');\n\n const resultCallback = (action: IAction) => {\n operationData.actionInstance = action;\n };\n\n this.eventbus.broadcast('request-action', [systemName, resultCallback]);\n return operationData as Required<IRequestActionOperationData>;\n};\n","import {removeProperties} from '@operation/helper/remove-operation-properties.ts';\nimport type {TOperation} from '@operation/types.ts';\n\nexport type StorageType = 'local' | 'session';\n\nexport interface ISaveToStorageOperationData {\n /**\n * @required\n * @erased\n */\n key: string;\n /**\n * @required\n * @erased\n */\n value: any;\n /**\n * @required\n * @erased\n */\n storageType: StorageType;\n}\n\n/**\n * Saves data to browser storage (localStorage or sessionStorage).\n *\n * Serializes the value as JSON before storing. Supports any JSON-serializable data type.\n *\n * @returns Operation data with storage properties erased\n *\n * @example\n * ```typescript\n * // Save user settings to localStorage\n * const result = saveToStorage({\n * key: 'user-settings',\n * value: { theme: 'dark', language: 'en' },\n * storageType: 'local'\n * });\n * ```\n *\n * @example\n * ```typescript\n * // Save session data\n * const result = saveToStorage({\n * key: 'session-id',\n * value: 'abc123',\n * storageType: 'session'\n * });\n * ```\n *\n * @category Data\n */\nexport const saveToStorage: TOperation<\n ISaveToStorageOperationData,\n Omit<ISaveToStorageOperationData, 'value' | 'storageType'>\n> = (operationData: ISaveToStorageOperationData) => {\n const {key, value, storageType} = operationData;\n\n if (!key || key.trim() === '') {\n throw new Error('saveToStorage: key is required');\n }\n\n const storage = storageType === 'session' ? sessionStorage : localStorage;\n const serialized = JSON.stringify(value);\n storage.setItem(key, serialized);\n\n removeProperties(operationData, 'value', 'storageType');\n\n return operationData;\n};\n","import {removeProperties} from '@operation/helper/remove-operation-properties.ts';\nimport type {TOperation} from '@operation/types.ts';\n\nexport type ScrollBehavior = 'auto' | 'smooth';\nexport type ScrollLogicalPosition = 'start' | 'center' | 'end' | 'nearest';\n\nexport interface IScrollToElementOperationData {\n /**\n * @required\n * @dependency\n */\n selectedElement: JQuery;\n /**\n * @optional\n * @erased\n */\n behavior?: ScrollBehavior;\n /**\n * @optional\n * @erased\n */\n block?: ScrollLogicalPosition;\n /**\n * @optional\n * @erased\n */\n inline?: ScrollLogicalPosition;\n}\n\n/**\n * Scrolls the viewport to bring the selected element into view.\n *\n * Uses the browser's `scrollIntoView` API with configurable behavior.\n *\n * @returns Operation data with scroll properties erased\n *\n * @example\n * ```typescript\n * // Smooth scroll to element at top of viewport\n * const result = scrollToElement({\n * selectedElement: $targetElement,\n * behavior: 'smooth',\n * block: 'start'\n * });\n * ```\n *\n * @example\n * ```typescript\n * // Center element in viewport\n * const result = scrollToElement({\n * selectedElement: $targetElement,\n * behavior: 'smooth',\n * block: 'center'\n * });\n * ```\n *\n * @category Scroll\n */\nexport const scrollToElement: TOperation<\n IScrollToElementOperationData,\n Omit<IScrollToElementOperationData, 'behavior' | 'block' | 'inline'>\n> = (operationData: IScrollToElementOperationData) => {\n const {\n selectedElement,\n behavior = 'auto',\n block = 'start',\n inline = 'nearest',\n } = operationData;\n\n if (!selectedElement || selectedElement.length === 0) {\n throw new Error('scrollToElement: selectedElement is required');\n }\n\n const element = selectedElement[0];\n element.scrollIntoView({\n behavior,\n block,\n inline,\n });\n\n removeProperties(operationData, 'behavior', 'block', 'inline');\n\n return operationData;\n};\n","import {removeProperties} from '@operation/helper/remove-operation-properties.ts';\nimport type {TOperation} from '@operation/types.ts';\n\nexport type ScrollBehavior = 'auto' | 'smooth';\n\nexport interface IScrollToPositionOperationData {\n /**\n * @required\n * @erased\n */\n x: number;\n /**\n * @required\n * @erased\n */\n y: number;\n /**\n * @optional\n * @erased\n */\n behavior?: ScrollBehavior;\n}\n\n/**\n * Scrolls the viewport to a specific x,y coordinate position.\n *\n * Uses the browser's `window.scrollTo` API with configurable behavior.\n *\n * @returns Operation data with scroll properties erased\n *\n * @example\n * ```typescript\n * // Smooth scroll to position\n * const result = scrollToPosition({\n * x: 0,\n * y: 500,\n * behavior: 'smooth'\n * });\n * ```\n *\n * @example\n * ```typescript\n * // Instant scroll to top\n * const result = scrollToPosition({\n * x: 0,\n * y: 0\n * });\n * ```\n *\n * @category Scroll\n */\nexport const scrollToPosition: TOperation<\n IScrollToPositionOperationData,\n Omit<IScrollToPositionOperationData, 'x' | 'y' | 'behavior'>\n> = (operationData: IScrollToPositionOperationData) => {\n const {x, y, behavior = 'auto'} = operationData;\n\n if (typeof x !== 'number' || typeof y !== 'number') {\n throw new Error('scrollToPosition: x and y coordinates are required');\n }\n\n window.scrollTo({\n left: x,\n top: y,\n behavior,\n });\n\n removeProperties(operationData, 'x', 'y', 'behavior');\n\n return operationData;\n};\n","import {removeProperties} from '@operation/helper/remove-operation-properties.ts';\nimport {\n type ExternalProperty,\n resolveExternalPropertyChain,\n} from '@operation/helper/resolve-external-property-chain.ts';\nimport type {TOperation} from '@operation/types.ts';\n\nfunction findElementBySelector(root: JQuery, selector: string) {\n const element = root.find(selector);\n if (!element.length) {\n console.warn(`selector '${selector}' wasn't found!`);\n }\n return element;\n}\n\nexport interface ISelectElementOperationData {\n /**\n * @type=ParameterType:selector\n * @required\n * @erased\n */\n selector: string;\n /**\n * @erased\n */\n useSelectedElementAsRoot?: boolean;\n /**\n * @type=ParameterType:object\n * @output\n */\n selectedElement?: JQuery;\n}\n\n/**\n * This operation selects one or more elements using the specified selector.\n *\n * If `useSelectedElementAsRoot` is set to true and a valid DOM element is assigned\n * to the current operation data's `selectedElement` property\n * then the element will be looked for only in the descendant elements of this DOM element.\n *\n * @category DOM\n */\nexport const selectElement: TOperation<\n ISelectElementOperationData,\n Omit<ISelectElementOperationData, 'selector' | 'useSelectedElementAsRoot'>\n> = function (operationData: ISelectElementOperationData) {\n operationData.selector = resolveExternalPropertyChain(\n operationData,\n this,\n operationData.selector as ExternalProperty\n ) as string;\n\n const {selector, useSelectedElementAsRoot = false} = operationData;\n\n removeProperties(operationData, 'selector', 'useSelectedElementAsRoot');\n\n if (!selector) {\n throw new Error('selectElement: selector is either empty or not defined.');\n }\n\n if (useSelectedElementAsRoot && operationData.selectedElement) {\n const currentRoot = operationData.selectedElement;\n operationData.selectedElement = findElementBySelector(\n currentRoot,\n selector\n );\n return operationData;\n }\n\n const rootCallback = (root: JQuery) => {\n operationData.selectedElement = findElementBySelector(root, selector);\n };\n this.eventbus.broadcast('request-engine-root', [rootCallback]);\n\n return operationData;\n};\n","import {getPropertyChainValue} from '@operation/helper/get-property-chain-value.ts';\nimport {getGlobals, type TGlobalCache} from '@operation/helper/globals.ts';\nimport {removeProperties} from '@operation/helper/remove-operation-properties.ts';\nimport {resolveExternalPropertyChain} from '@operation/helper/resolve-external-property-chain.ts';\nimport type {\n IOperationScope,\n TOperation,\n TOperationData,\n} from '@operation/types.ts';\n\nexport type TDataTarget =\n | `$scope.${string}`\n | `$operationdata.${string}`\n | `$globaldata.${string}`;\n\nexport interface ISetDataOperationData {\n /**\n * @required\n * @erased\n */\n properties: Record<TDataTarget, any>;\n}\n\n/**\n * This operation assigns the specified properties to the specified data targets.\n *\n * @example The various ways of assigning data\n * ```ts\n * setData({\n * '$operationdata.foo': '$scope.currentItem', // $scope.currentItem will be assigned to $operationdata.foo\n * '$globaldata.foo': '$scope.currentItem', // $scope.currentItem will be assigned to $globaldata.foo\n * '$scope.newIndex': 100, // The constant 100 will be assigned to $scope.newIndex\n * })\n * ```\n *\n * @category Data\n */\nexport const setData: TOperation<\n ISetDataOperationData,\n Omit<ISetDataOperationData, 'properties'>\n> = function (operationData: ISetDataOperationData) {\n const {properties} = operationData;\n removeProperties(operationData, 'properties');\n\n resolveTargets(properties, operationData, this);\n\n return operationData;\n};\n\nfunction resolveTargets(\n data: Record<TDataTarget, any>,\n operationData: Record<string, any>,\n scope: IOperationScope\n) {\n const propertyChains = Object.keys(data);\n\n return propertyChains.forEach(item => {\n const path = item.split('.');\n const rootTarget = path.shift()?.toLowerCase().substring(1) ?? '';\n if (!isDataTarget(rootTarget)) {\n throw new Error(\n `Unrecognized target: ${rootTarget}, known targets are: ${knownTargets.join(\n ', '\n )}`\n );\n }\n const property = path.pop() ?? '';\n const propertyValue = resolveExternalPropertyChain(\n operationData,\n scope,\n (data as any)[item]\n );\n\n const targets: {\n scope: IOperationScope;\n operationdata: TOperationData;\n globaldata: TGlobalCache;\n } = {\n scope,\n operationdata: operationData,\n globaldata: getGlobals(),\n };\n\n const propertyTarget = getPropertyChainValue(\n path,\n (targets as any)[rootTarget]\n ) as Record<string, any>;\n\n propertyTarget[property] = propertyValue;\n });\n}\n\nconst knownTargets = ['scope', 'operationdata', 'globaldata'];\nfunction isDataTarget(value: string): value is TDataTarget {\n return knownTargets.includes(value);\n}\n","import {removeProperties} from '@operation/helper/remove-operation-properties.ts';\nimport type {TOperation} from '@operation/types.ts';\n\nexport interface ISetElementAttributesOperationData {\n /**\n * @required\n * @erased\n */\n attributes: Record<string, unknown>;\n /**\n * @dependency\n */\n selectedElement: JQuery;\n}\n\n/**\n * This operation sets the specified set of attributes on the given selected element.\n *\n * @category DOM\n */\nexport const setElementAttributes: TOperation<\n ISetElementAttributesOperationData,\n Omit<ISetElementAttributesOperationData, 'attributes'>\n> = (operationData: ISetElementAttributesOperationData) => {\n const {attributes, selectedElement} = operationData;\n removeProperties(operationData, 'attributes');\n selectedElement.attr(attributes);\n return operationData;\n};\n","import {removeProperties} from '@operation/helper/remove-operation-properties.ts';\nimport type {TOperation} from '@operation/types.ts';\n\nexport interface ISetElementContentOperationData {\n /**\n * @dependency\n */\n selectedElement: JQuery;\n /**\n * @erased\n */\n template: string | JQuery.Node;\n /**\n * overwite = the contents of the selected element are replaced by the given template\n *\n * append = the new content will be inserted after the current content\n *\n * prepend = the new content will be inserted before the current content\n *\n * @erased\n */\n insertionType: 'overwrite' | 'append' | 'prepend';\n}\n\n/**\n * This operation sets the specified content defined by the value assigned to the template property\n * to the given selected element.\n *\n * When the `insertionType` is set to `overwrite` the contents of the selected element are replaced\n * by the given template.\n * When set to `append` the new content will be inserted after the current content.\n * When set to `prepend` the new content will be inserted before the current content.\n *\n * @category DOM\n */\nexport const setElementContent: TOperation<\n ISetElementContentOperationData,\n Omit<ISetElementContentOperationData, 'template' | 'insertionType'>\n> = (operationData: ISetElementContentOperationData) => {\n const {\n insertionType = 'overwrite',\n selectedElement,\n template,\n } = operationData;\n\n switch (true) {\n case insertionType === 'overwrite':\n selectedElement.html(template);\n break;\n case insertionType === 'append':\n selectedElement.append(template);\n break;\n case insertionType === 'prepend':\n selectedElement.prepend(template);\n break;\n }\n\n removeProperties(operationData, 'insertionType', 'template');\n\n return operationData;\n};\n","import type {TOperation} from '@operation/types.ts';\n\nexport interface ISetFocusOperationData {\n /**\n * @required\n * @dependency\n */\n selectedElement: JQuery;\n}\n\n/**\n * Sets focus to the selected element.\n *\n * @category Focus\n */\nexport const setFocus: TOperation<\n ISetFocusOperationData,\n ISetFocusOperationData\n> = (operationData: ISetFocusOperationData) => {\n const {selectedElement} = operationData;\n\n if (!selectedElement || selectedElement.length === 0) {\n throw new Error('setFocus: selectedElement is required');\n }\n\n selectedElement[0].focus();\n\n return operationData;\n};\n","import {removeProperties} from '@operation/helper/remove-operation-properties.ts';\nimport type {TOperation} from '@operation/types.ts';\n\nexport interface ISetFormValueOperationData {\n /**\n * @required\n * @dependency\n */\n selectedElement: JQuery;\n /**\n * @required\n * @erased\n */\n value: string | number | boolean;\n}\n\n/**\n * Sets the value of an input, select, or textarea element.\n *\n * Handles different input types appropriately:\n * - Text inputs, textareas, selects: sets value directly\n * - Checkboxes: sets checked property for boolean values\n * - Radio buttons: sets checked property for boolean values\n * - Number inputs: converts to string\n *\n * @example\n * ```typescript\n * // Set text input value\n * const result = setFormValue({selectedElement: $input, value: 'test@example.com'});\n * // Element value is now 'test@example.com'\n * ```\n *\n * @example\n * ```typescript\n * // Set checkbox checked state\n * const result = setFormValue({selectedElement: $checkbox, value: true});\n * // Checkbox is now checked\n * ```\n *\n * @category Form\n */\nexport const setFormValue: TOperation<\n ISetFormValueOperationData,\n Omit<ISetFormValueOperationData, 'value'>\n> = (operationData: ISetFormValueOperationData) => {\n const {selectedElement, value} = operationData;\n\n // Validate selectedElement exists\n if (!selectedElement || selectedElement.length === 0) {\n throw new Error('setFormValue: selectedElement is required');\n }\n\n // Handle checkboxes and radio buttons with boolean values\n if (\n typeof value === 'boolean' &&\n (selectedElement.is(':checkbox') || selectedElement.is(':radio'))\n ) {\n selectedElement.prop('checked', value);\n } else {\n // Handle all other inputs with val()\n selectedElement.val(value as any);\n }\n\n removeProperties(operationData, 'value');\n\n return operationData;\n};\n","import {setGlobals} from '@operation/helper/globals.ts';\nimport type {TOperation} from '@operation/types.ts';\n\nexport interface ISetGlobalDataOperationData {\n /**\n * @required\n * @erased\n */\n propertyNames: string[];\n}\n\n/**\n * This operation copies the specified properties from the operationData to the global data.\n *\n * @category Data\n */\nexport const setGlobalData: TOperation<\n ISetGlobalDataOperationData,\n Omit<ISetGlobalDataOperationData, 'propertyNames'>\n> = (operationData: ISetGlobalDataOperationData) => {\n const {propertyNames, ...newOperationData} = operationData;\n const newGlobals = Object.fromEntries(\n Object.entries(operationData).filter(([name, _value]) =>\n propertyNames.includes(name)\n )\n );\n\n setGlobals(newGlobals);\n\n return newOperationData;\n};\n","import {resolvePropertyValues} from '@operation/helper/resolve-property-values.ts';\nimport type {TOperation} from '@operation/types.ts';\n\nexport interface ISetOperationData {\n /**\n * If set to true, the plucked properties replace the current operation data.\n * @erased\n */\n override?: boolean;\n /**\n * @required\n * @erased\n */\n properties: Record<string, any>;\n}\n\n/**\n * This operation assigns the specified properties to the current operation data.\n * When override is set to true the properties replace the current operation data entirely.\n *\n * @category Data\n */\nexport const setOperationData: TOperation<\n ISetOperationData,\n Omit<ISetOperationData, 'override' | 'properties'>\n> = function (operationData: ISetOperationData) {\n const {override = false, properties, ...newOperationData} = operationData;\n\n const resolvedProperties = resolvePropertyValues(\n newOperationData,\n this,\n properties\n );\n\n if (override) {\n return resolvedProperties;\n }\n\n return {\n ...newOperationData,\n ...resolvedProperties,\n };\n};\n","import {removeProperties} from '@operation/helper/remove-operation-properties.ts';\nimport {resolvePropertyValues} from '@operation/helper/resolve-property-values.ts';\nimport type {TOperation} from '@operation/types.ts';\n\nexport interface ISetStyleOperationData {\n /**\n * @type=ParameterType:cssProperties\n * @required\n * @erased\n */\n properties: Record<string, any>;\n /**\n * @dependency\n */\n selectedElement: JQuery;\n}\n\n/**\n * This operation assigns the specified CSS style properties to the\n * given selected element.\n *\n * @category DOM\n */\nexport const setStyle: TOperation<\n ISetStyleOperationData,\n Omit<ISetStyleOperationData, 'properties'>\n> = function (operationData: ISetStyleOperationData) {\n const properties = resolvePropertyValues(\n operationData,\n this,\n operationData.properties\n );\n operationData.selectedElement.css(properties as JQuery.PlainObject);\n\n removeProperties(operationData, 'properties');\n\n return operationData;\n};\n","import {removeProperties} from '@operation/helper/remove-operation-properties.ts';\nimport type {TOperation} from '@operation/types.ts';\n\nexport interface ISetVariableOperationData {\n /**\n * @required\n * @erased\n */\n name: string;\n /**\n * @type=ParameterType:object|ParameterType:string|ParameterType:number|ParameterType:boolean|ParameterType:array\n * @required\n * @erased\n */\n value: any;\n}\n\n/**\n * This operation sets a variable with the specified name on the scope with the specified value.\n *\n * @category Data\n */\nexport const setVariable: TOperation<\n ISetVariableOperationData,\n Omit<ISetVariableOperationData, 'name' | 'value'>\n> = function (operationData: ISetVariableOperationData) {\n const {name, value} = operationData;\n\n if (!this.variables) {\n this.variables = {};\n }\n\n this.variables[name] = value;\n\n removeProperties(operationData, 'name', 'value');\n\n return operationData;\n};\n","import {removeProperties} from '@operation/helper/remove-operation-properties.ts';\nimport type {TOperation} from '@operation/types.ts';\n\nexport type SortOrder = 'asc' | 'desc';\n\nexport interface ISortArrayOperationData {\n /**\n * @required\n * @dependency\n */\n arrayData: any[];\n /**\n * @optional\n * @erased\n */\n sortProperty?: string;\n /**\n * @optional\n * @erased\n */\n sortOrder?: SortOrder;\n /**\n * @optional\n * @erased\n */\n sortComparator?: (a: any, b: any) => number;\n /**\n * @output\n */\n sortedArray: any[];\n}\n\n/**\n * Sorts an array by property, natural order, or custom comparator function.\n *\n * Operates on arrayData passed from previous operations.\n * Supports three sorting modes:\n * 1. Property sort: `sortProperty` and `sortOrder` to sort objects by property\n * 2. Natural sort: `sortOrder` alone for primitive arrays\n * 3. Custom comparator: `sortComparator` function for complex sorting logic\n *\n * @returns Operation data with `sortedArray` containing sorted results\n *\n * @example\n * ```typescript\n * // Sort objects by property\n * const result = sortArray({\n * arrayData: [{name: 'Bob', age: 30}, {name: 'Alice', age: 25}],\n * sortProperty: 'age',\n * sortOrder: 'asc'\n * });\n * // result.sortedArray = [{name: 'Alice', age: 25}, {name: 'Bob', age: 30}]\n * ```\n *\n * @example\n * ```typescript\n * // Sort primitives\n * const result = sortArray({\n * arrayData: [5, 2, 8, 1],\n * sortOrder: 'desc'\n * });\n * // result.sortedArray = [8, 5, 2, 1]\n * ```\n *\n * @example\n * ```typescript\n * // Custom comparator\n * const result = sortArray({\n * arrayData: ['apple', 'Banana', 'cherry'],\n * sortComparator: (a, b) => a.toLowerCase().localeCompare(b.toLowerCase())\n * });\n * ```\n *\n * @category Array\n */\nexport const sortArray: TOperation<\n ISortArrayOperationData,\n Omit<ISortArrayOperationData, 'sortProperty' | 'sortOrder' | 'sortComparator'>\n> = (operationData: ISortArrayOperationData) => {\n const {arrayData, sortProperty, sortOrder, sortComparator} = operationData;\n\n if (!Array.isArray(arrayData)) {\n throw new Error('sortArray: arrayData is required and must be an array');\n }\n\n // Create a copy to avoid mutating original\n const sorted = [...arrayData];\n\n if (sortComparator) {\n sorted.sort(sortComparator);\n } else if (sortProperty) {\n sorted.sort((a, b) => {\n const aVal = a[sortProperty];\n const bVal = b[sortProperty];\n\n if (aVal < bVal) return sortOrder === 'desc' ? 1 : -1;\n if (aVal > bVal) return sortOrder === 'desc' ? -1 : 1;\n return 0;\n });\n } else {\n // Natural sort for primitives\n sorted.sort((a, b) => {\n if (a < b) return sortOrder === 'desc' ? 1 : -1;\n if (a > b) return sortOrder === 'desc' ? -1 : 1;\n return 0;\n });\n }\n\n operationData.sortedArray = sorted;\n\n removeProperties(\n operationData,\n 'sortProperty',\n 'sortOrder',\n 'sortComparator'\n );\n\n return operationData;\n};\n","import {removeProperties} from '@operation/helper/remove-operation-properties.ts';\nimport type {TOperation} from '@operation/types.ts';\n\nexport interface ISplitStringOperationData {\n /**\n * @required\n * @dependency\n */\n textContent: string;\n /**\n * @required\n * @erased\n */\n delimiter: string | RegExp;\n /**\n * @optional\n * @erased\n */\n limit?: number;\n /**\n * @output\n */\n resultArray: string[];\n}\n\n/**\n * Splits a string into an array by delimiter (string or regex).\n *\n * @returns Operation data with `resultArray` containing the split strings\n *\n * @example\n * ```typescript\n * const result = splitString({\n * textContent: 'apple,banana,cherry',\n * delimiter: ','\n * });\n * // result.resultArray = ['apple', 'banana', 'cherry']\n * ```\n *\n * @category String\n */\nexport const splitString: TOperation<\n ISplitStringOperationData,\n Omit<ISplitStringOperationData, 'delimiter' | 'limit'>\n> = (operationData: ISplitStringOperationData) => {\n const {textContent, delimiter, limit} = operationData;\n\n if (textContent === undefined || textContent === null) {\n throw new Error('splitString: textContent is required');\n }\n\n operationData.resultArray = textContent.split(delimiter, limit);\n\n removeProperties(operationData, 'delimiter', 'limit');\n\n return operationData;\n};\n","import type {IAction} from '@action/types.ts';\nimport {internalResolve} from '@operation/helper/internal-resolve.ts';\nimport {mergeOperationData} from '@operation/helper/merge-operation-data.ts';\nimport type {TOperation, TOperationData} from '@operation/types.ts';\n\nexport interface IStartActionOperationData {\n /**\n * @dependency\n */\n actionInstance: IAction;\n /**\n * @type=ParameterType:object\n * @erased\n */\n actionOperationData: TOperationData;\n}\n\n/**\n * This operation starts the specified action instance using the given action operation data.\n *\n * The action operation data is first merged with the current operation data before it is\n * passed on to the action. After the action has completed the action operation data properties\n * are removed from the current operation data.\n *\n * @category Action\n */\nexport const startAction: TOperation<\n IStartActionOperationData,\n Omit<IStartActionOperationData, 'actionOperationData'>\n> = (operationData: IStartActionOperationData) => {\n let {actionInstance, actionOperationData, ...newOperationData} =\n operationData;\n\n return new Promise((resolve, reject) => {\n newOperationData = mergeOperationData(\n newOperationData,\n actionOperationData\n );\n\n actionInstance.start(newOperationData).then(() => {\n Object.keys(actionOperationData).forEach(key => {\n delete (newOperationData as any)[key];\n });\n internalResolve(resolve, {...newOperationData, actionInstance});\n }, reject);\n });\n};\n","import {removeProperties} from '@operation/helper/remove-operation-properties.ts';\nimport type {TOperation} from '@operation/types.ts';\n\nexport interface ISubstringTextOperationData {\n /**\n * @required\n * @dependency\n */\n textContent: string;\n /**\n * @required\n * @erased\n */\n start: number;\n /**\n * @optional\n * @erased\n */\n end?: number;\n /**\n * @output\n */\n substring: string;\n}\n\n/**\n * Extracts a substring from text between start and end indices.\n *\n * @returns Operation data with `substring` containing the extracted text\n *\n * @example\n * ```typescript\n * const result = substringText({\n * textContent: 'Hello World',\n * start: 0,\n * end: 5\n * });\n * // result.substring = \"Hello\"\n * ```\n *\n * @category Text\n */\nexport const substringText: TOperation<\n ISubstringTextOperationData,\n Omit<ISubstringTextOperationData, 'start' | 'end'>\n> = (operationData: ISubstringTextOperationData) => {\n const {textContent, start, end} = operationData;\n\n if (textContent === undefined || textContent === null) {\n throw new Error('substringText: textContent is required');\n }\n\n if (typeof start !== 'number') {\n throw new Error('substringText: start must be a number');\n }\n\n operationData.substring = textContent.substring(start, end);\n\n removeProperties(operationData, 'start', 'end');\n\n return operationData;\n};\n","import type {TOperation} from '@operation/types.ts';\n\nexport interface IToggleClassOperationData {\n /**\n * The element on which the class will be toggled\n * @dependency\n */\n selectedElement: JQuery;\n /**\n * The class that will be toggled\n * @type=ParameterType:className\n * @required\n * @erased\n */\n className: string;\n}\n\n/**\n * This operation toggles the specfied class name on the given selected element.\n *\n * Meaning, if the specified class name exists on the given element it will be removed,\n * otherwise it will be added.\n *\n * @category DOM\n */\nexport const toggleClass: TOperation<\n IToggleClassOperationData,\n Omit<IToggleClassOperationData, 'className'>\n> = (operationData: IToggleClassOperationData) => {\n const {selectedElement, className} = operationData;\n selectedElement.toggleClass(className);\n delete (operationData as any).className;\n return operationData;\n};\n","import type {TOperation} from '@operation/types.ts';\n\nexport interface IToggleElementOperationData {\n /**\n * The element whose visibility will be toggled\n * @dependency\n */\n selectedElement: JQuery;\n}\n\n/**\n * This operation toggles the visibility of the given selected element.\n *\n * Meaning, if the element is hidden, it will be made visible, otherwise\n * it will be hidden.\n *\n * @category DOM\n */\nexport const toggleElement: TOperation<IToggleElementOperationData> =\n function toggleElement(operationData: IToggleElementOperationData) {\n operationData.selectedElement.toggle();\n return operationData;\n };\n","import {removeProperties} from '@operation/helper/remove-operation-properties.ts';\nimport type {TOperation} from '@operation/types.ts';\n\nexport interface IToggleFormElementOperationData {\n /**\n * @required\n * @dependency\n */\n selectedElement: JQuery;\n /**\n * @required\n * @erased\n */\n enabled: boolean;\n}\n\n/**\n * Enables or disables form input elements (inputs, selects, textareas, buttons).\n *\n * Sets the `disabled` property on the element. When `enabled` is true, removes the disabled\n * attribute; when false, adds the disabled attribute.\n *\n * @example\n * ```typescript\n * // Disable an input field\n * toggleFormElement({selectedElement: $input, enabled: false});\n * // Input is now disabled\n * ```\n *\n * @example\n * ```typescript\n * // Enable a previously disabled button\n * toggleFormElement({selectedElement: $button, enabled: true});\n * // Button is now enabled\n * ```\n *\n * @category Form\n */\nexport const toggleFormElement: TOperation<\n IToggleFormElementOperationData,\n Omit<IToggleFormElementOperationData, 'enabled'>\n> = (operationData: IToggleFormElementOperationData) => {\n const {selectedElement, enabled} = operationData;\n\n if (!selectedElement || selectedElement.length === 0) {\n throw new Error('toggleFormElement: selectedElement is required');\n }\n\n // Set disabled property (disabled = !enabled)\n selectedElement.prop('disabled', !enabled);\n\n removeProperties(operationData, 'enabled');\n\n return operationData;\n};\n","import {removeProperties} from '@operation/helper/remove-operation-properties.ts';\nimport type {TOperation} from '@operation/types.ts';\nimport $ from 'jquery';\n\nexport interface IValidationRules {\n required?: boolean;\n minLength?: number;\n maxLength?: number;\n pattern?: string | RegExp;\n email?: boolean;\n}\n\nexport interface IValidateFormOperationData {\n /**\n * @required\n * @dependency\n */\n selectedElement: JQuery;\n /**\n * @erased\n */\n validationRules?: Record<string, IValidationRules>;\n /**\n * @output\n * @type=ParameterType:object\n */\n validationErrors?: Record<string, string>;\n /**\n * @output\n */\n isValid?: boolean;\n}\n\n/**\n * Validates form fields against HTML5 validation and custom rules.\n *\n * Uses HTML5 validation API (checkValidity()) for native validation, and supports\n * custom validation rules for: required, minLength, maxLength, pattern (regex), and email format.\n *\n * @returns Operation data with `validationErrors` object (field names → error messages) and `isValid` boolean\n *\n * @example\n * ```typescript\n * // Validate with HTML5 validation\n * const result = validateForm({selectedElement: $form});\n * // Returns: {isValid: true, validationErrors: {}}\n * ```\n *\n * @example\n * ```typescript\n * // Validate with custom rules\n * const result = validateForm({\n * selectedElement: $form,\n * validationRules: {\n * password: { required: true, minLength: 8 },\n * email: { email: true }\n * }\n * });\n * // Returns: {isValid: false, validationErrors: {password: \"Must be at least 8 characters\"}}\n * ```\n *\n * @category Form\n */\nexport const validateForm: TOperation<\n IValidateFormOperationData,\n Omit<IValidateFormOperationData, 'validationRules'>\n> = (operationData: IValidateFormOperationData) => {\n const {selectedElement, validationRules} = operationData;\n\n if (!selectedElement || selectedElement.length === 0) {\n throw new Error('validateForm: selectedElement is required');\n }\n\n if (!selectedElement.is('form')) {\n throw new Error('validateForm: selectedElement must be a form element');\n }\n\n const validationErrors: Record<string, string> = {};\n const emailRegex = /^[^\\s@]+@[^\\s@]+\\.[^\\s@]+$/;\n\n // Get all form inputs\n const inputs = selectedElement.find('input, select, textarea');\n\n inputs.each((_, element) => {\n const $input = $(element);\n const name = $input.attr('name');\n\n if (!name) return; // Skip inputs without name attribute\n\n const value = $input.val() as string;\n const rules = validationRules?.[name];\n\n // HTML5 validation first\n const inputElement = element as\n | HTMLInputElement\n | HTMLTextAreaElement\n | HTMLSelectElement;\n if (inputElement.checkValidity && !inputElement.checkValidity()) {\n validationErrors[name] =\n inputElement.validationMessage || 'Invalid value';\n return;\n }\n\n // Custom validation rules\n if (rules) {\n if (rules.required && (!value || value.trim() === '')) {\n validationErrors[name] = 'This field is required';\n return;\n }\n\n if (rules.minLength && value.length < rules.minLength) {\n validationErrors[name] =\n `Must be at least ${rules.minLength} characters`;\n return;\n }\n\n if (rules.maxLength && value.length > rules.maxLength) {\n validationErrors[name] =\n `Must be no more than ${rules.maxLength} characters`;\n return;\n }\n\n if (rules.pattern) {\n const pattern =\n typeof rules.pattern === 'string'\n ? new RegExp(rules.pattern)\n : rules.pattern;\n if (!pattern.test(value)) {\n validationErrors[name] = 'Invalid format';\n return;\n }\n }\n\n if (rules.email && !emailRegex.test(value)) {\n validationErrors[name] = 'Must be a valid email address';\n return;\n }\n }\n });\n\n operationData.validationErrors = validationErrors;\n operationData.isValid = Object.keys(validationErrors).length === 0;\n\n removeProperties(operationData, 'validationRules');\n\n return operationData;\n};\n","import {internalResolve} from '@operation/helper/internal-resolve.ts';\nimport type {TOperation} from '@operation/types.ts';\n\nexport interface IWaitOperationData {\n /**\n * The amount of milliseconds the operation will wait for.\n * @required\n * @erased\n */\n milliseconds: number;\n}\n\n/**\n * This operation waits for the specified amount of milliseconds.\n *\n * @category Utility\n */\nexport const wait: TOperation<\n IWaitOperationData,\n Omit<IWaitOperationData, 'milliseconds'>\n> = (operationData: IWaitOperationData) => {\n const {milliseconds, ...newOperationData} = operationData;\n\n return new Promise(resolve => {\n setTimeout(() => {\n internalResolve(resolve, newOperationData);\n }, milliseconds);\n });\n};\n","export type {IAddClassOperationData} from '@operation/add-class.ts';\nexport {addClass} from '@operation/add-class.ts';\nexport type {IAddControllerToElementOperationData} from '@operation/add-controller-to-element.ts';\nexport {addControllerToElement} from '@operation/add-controller-to-element.ts';\nexport {addGlobalsToOperation} from '@operation/add-globals-to-operation.ts';\nexport type {IAnimateOperationData} from '@operation/animate.ts';\nexport {animate} from '@operation/animate.ts';\nexport type {IAnimateWithClassOperationData} from '@operation/animate-with-class.ts';\nexport {animateWithClass} from '@operation/animate-with-class.ts';\nexport type {IAnnounceToScreenReaderOperationData} from '@operation/announce-to-screen-reader.ts';\nexport {announceToScreenReader} from '@operation/announce-to-screen-reader.ts';\nexport {breakForEach} from '@operation/break-for-each.ts';\nexport type {IBroadcastEventOperationData} from '@operation/broadcast-event.ts';\nexport {broadcastEvent} from '@operation/broadcast-event.ts';\nexport type {ICalcOperationData} from '@operation/calc.ts';\nexport {calc} from '@operation/calc.ts';\nexport type {IClearElementOperationData} from '@operation/clear-element.ts';\nexport {clearElement} from '@operation/clear-element.ts';\nexport type {IClearOperationDataOperationData} from '@operation/clear-operation-data.ts';\nexport {clearOperationData} from '@operation/clear-operation-data.ts';\nexport type {\n IClearStorageOperationData,\n StorageType,\n} from '@operation/clear-storage.ts';\nexport {clearStorage} from '@operation/clear-storage.ts';\nexport type {ICompareDateOperationData} from '@operation/compare-date.ts';\nexport {compareDate} from '@operation/compare-date.ts';\nexport type {IConcatenateStringsOperationData} from '@operation/concatenate-strings.ts';\nexport {concatenateStrings} from '@operation/concatenate-strings.ts';\nexport {continueForEach} from '@operation/continue-for-each.ts';\nexport type {ICreateElementOperationData} from '@operation/create-element.ts';\nexport {createElement} from '@operation/create-element.ts';\nexport type {ICustomFunctionOperationData} from '@operation/custom-function.ts';\nexport {customFunction} from '@operation/custom-function.ts';\nexport type {IEndActionOperationData} from '@operation/end-action.ts';\nexport {endAction} from '@operation/end-action.ts';\nexport {endForEach} from '@operation/end-for-each.ts';\nexport {endWhen} from '@operation/end-when.ts';\nexport type {IExtendControllerOperationData} from '@operation/extend-controller.ts';\nexport {extendController} from '@operation/extend-controller.ts';\nexport type {IFilterArrayOperationData} from '@operation/filter-array.ts';\nexport {filterArray} from '@operation/filter-array.ts';\nexport type {IFindInArrayOperationData} from '@operation/find-in-array.ts';\nexport {findInArray} from '@operation/find-in-array.ts';\nexport type {IForEachOperationData} from '@operation/for-each.ts';\nexport {forEach} from '@operation/for-each.ts';\nexport type {IFormatDateOperationData} from '@operation/format-date.ts';\nexport {formatDate} from '@operation/format-date.ts';\nexport type {IFormatTextOperationData} from '@operation/format-text.ts';\nexport {formatText} from '@operation/format-text.ts';\nexport type {IGetAttributesFromElementOperationData} from '@operation/get-attributes-from-element.ts';\nexport {getAttributesFromElement} from '@operation/get-attributes-from-element.ts';\nexport type {IGetControllerFromElementOperationData} from '@operation/get-controller-from-element.ts';\nexport {getControllerFromElement} from '@operation/get-controller-from-element.ts';\nexport type {IGetControllerInstanceOperationData} from '@operation/get-controller-instance.ts';\nexport {getControllerInstance} from '@operation/get-controller-instance.ts';\nexport type {IGetCurrentTimeOperationData} from '@operation/get-current-time.ts';\nexport {getCurrentTime} from '@operation/get-current-time.ts';\nexport type {IGetElementDimensionsOperationData} from '@operation/get-element-dimensions.ts';\nexport {getElementDimensions} from '@operation/get-element-dimensions.ts';\nexport type {IGetFocusedElementOperationData} from '@operation/get-focused-element.ts';\nexport {getFocusedElement} from '@operation/get-focused-element.ts';\nexport type {IGetFormDataOperationData} from '@operation/get-form-data.ts';\nexport {getFormData} from '@operation/get-form-data.ts';\nexport type {IGetImportOperationData} from '@operation/get-import.ts';\nexport {getImport} from '@operation/get-import.ts';\nexport type {IGetQueryParamsOperationData} from '@operation/get-query-params.ts';\nexport {getQueryParams} from '@operation/get-query-params.ts';\nexport type {IGetScrollPositionOperationData} from '@operation/get-scroll-position.ts';\nexport {getScrollPosition} from '@operation/get-scroll-position.ts';\nexport type {IGetTextContentOperationData} from '@operation/get-text-content.ts';\nexport {getTextContent} from '@operation/get-text-content.ts';\nexport type {IHttpDeleteOperationData} from '@operation/http-delete.ts';\nexport {httpDelete} from '@operation/http-delete.ts';\nexport type {IHttpPostOperationData} from '@operation/http-post.ts';\nexport {httpPost} from '@operation/http-post.ts';\nexport type {IHttpPutOperationData} from '@operation/http-put.ts';\nexport {httpPut} from '@operation/http-put.ts';\nexport type {IInvokeObjectMethodOperationData} from '@operation/invoke-object-method.ts';\nexport {invokeObjectMethod} from '@operation/invoke-object-method.ts';\nexport type {IIsElementInViewportOperationData} from '@operation/is-element-in-viewport.ts';\nexport {isElementInViewport} from '@operation/is-element-in-viewport.ts';\nexport type {ILoadFromStorageOperationData} from '@operation/load-from-storage.ts';\nexport {loadFromStorage} from '@operation/load-from-storage.ts';\nexport type {ILoadJSONOperationData} from '@operation/load-json.ts';\nexport {loadJson} from '@operation/load-json.ts';\nexport type {ILogOperationData} from '@operation/log.ts';\nexport {log} from '@operation/log.ts';\nexport type {IMapArrayOperationData} from '@operation/map-array.ts';\nexport {mapArray} from '@operation/map-array.ts';\nexport type {IMathOperationData} from '@operation/math.ts';\nexport {math} from '@operation/math.ts';\nexport {otherwise} from '@operation/otherwise.ts';\nexport type {IRemoveClassOperationData} from '@operation/remove-class.ts';\nexport {removeClass} from '@operation/remove-class.ts';\nexport type {IRemoveControllerFromElementOperationData} from '@operation/remove-controller-from-element.ts';\nexport {removeControllerFromElement} from '@operation/remove-controller-from-element.ts';\nexport type {IRemoveElementOperationData} from '@operation/remove-element.ts';\nexport {removeElement} from '@operation/remove-element.ts';\nexport type {IRemovePropertiesFromOperationDataOperationData} from '@operation/remove-properties-from-operation-data.ts';\nexport {removePropertiesFromOperationData} from '@operation/remove-properties-from-operation-data.ts';\nexport type {IReparentElementOperationData} from '@operation/reparent-element.ts';\nexport {reparentElement} from '@operation/reparent-element.ts';\nexport type {IReplaceStringOperationData} from '@operation/replace-string.ts';\nexport {replaceString} from '@operation/replace-string.ts';\nexport type {IReplaceTextOperationData} from '@operation/replace-text.ts';\nexport {replaceText} from '@operation/replace-text.ts';\nexport type {IRequestActionOperationData} from '@operation/request-action.ts';\nexport {requestAction} from '@operation/request-action.ts';\nexport type {ISaveToStorageOperationData} from '@operation/save-to-storage.ts';\nexport {saveToStorage} from '@operation/save-to-storage.ts';\nexport type {IScrollToElementOperationData} from '@operation/scroll-to-element.ts';\nexport {scrollToElement} from '@operation/scroll-to-element.ts';\nexport type {IScrollToPositionOperationData} from '@operation/scroll-to-position.ts';\nexport {scrollToPosition} from '@operation/scroll-to-position.ts';\nexport type {ISelectElementOperationData} from '@operation/select-element.ts';\nexport {selectElement} from '@operation/select-element.ts';\nexport type {ISetDataOperationData} from '@operation/set-data.ts';\nexport {setData} from '@operation/set-data.ts';\nexport type {ISetElementAttributesOperationData} from '@operation/set-element-attributes.ts';\nexport {setElementAttributes} from '@operation/set-element-attributes.ts';\nexport type {ISetElementContentOperationData} from '@operation/set-element-content.ts';\nexport {setElementContent} from '@operation/set-element-content.ts';\nexport type {ISetFocusOperationData} from '@operation/set-focus.ts';\nexport {setFocus} from '@operation/set-focus.ts';\nexport type {ISetFormValueOperationData} from '@operation/set-form-value.ts';\nexport {setFormValue} from '@operation/set-form-value.ts';\nexport type {ISetGlobalDataOperationData} from '@operation/set-global-data.ts';\nexport {setGlobalData} from '@operation/set-global-data.ts';\nexport type {ISetOperationData} from '@operation/set-operation-data.ts';\nexport {setOperationData} from '@operation/set-operation-data.ts';\nexport type {ISetStyleOperationData} from '@operation/set-style.ts';\nexport {setStyle} from '@operation/set-style.ts';\nexport type {ISetVariableOperationData} from '@operation/set-variable.ts';\nexport {setVariable} from '@operation/set-variable.ts';\nexport type {ISortArrayOperationData} from '@operation/sort-array.ts';\nexport {sortArray} from '@operation/sort-array.ts';\nexport type {ISplitStringOperationData} from '@operation/split-string.ts';\nexport {splitString} from '@operation/split-string.ts';\nexport type {IStartActionOperationData} from '@operation/start-action.ts';\nexport {startAction} from '@operation/start-action.ts';\nexport type {ISubstringTextOperationData} from '@operation/substring-text.ts';\nexport {substringText} from '@operation/substring-text.ts';\nexport type {IToggleClassOperationData} from '@operation/toggle-class.ts';\nexport {toggleClass} from '@operation/toggle-class.ts';\nexport type {IToggleElementOperationData} from '@operation/toggle-element.ts';\nexport {toggleElement} from '@operation/toggle-element.ts';\nexport type {IToggleFormElementOperationData} from '@operation/toggle-form-element.ts';\nexport {toggleFormElement} from '@operation/toggle-form-element.ts';\nexport type * from '@operation/types.ts';\nexport type {IValidateFormOperationData} from '@operation/validate-form.ts';\nexport {validateForm} from '@operation/validate-form.ts';\nexport type {IWaitOperationData} from '@operation/wait.ts';\nexport {wait} from '@operation/wait.ts';\nexport type {IWhenOperationData} from '@operation/when.ts';\nexport {when} from '@operation/when.ts';\n","import type {ConfigurationFactory} from '@configuration/api/configuration-factory.ts';\nimport type {\n ExtractOperationDataType,\n GetOperationByName,\n IActionConfiguration,\n IEndableActionConfiguration,\n ITimelineActionConfiguration,\n TOperationName,\n TOperationType,\n} from '@configuration/types.ts';\nimport {deepCopy} from '@operation/helper/deep-copy.ts';\nimport * as operations from '@operation/index.ts';\nimport {v4 as uuidv4} from 'uuid';\n\n/**\n *\n * Container factory capable of creating the different kinds of actions.\n * For each type of action a dedicated factory will be returned.\n *\n */\nexport class ActionCreatorFactory {\n constructor(private readonly configurationfactory: ConfigurationFactory) {}\n\n /**\n *\n * Starts the creation of an action in the `actions` list with the specified name\n *\n * @param name\n * @returns\n */\n createAction(name: string): EndableActionCreator {\n const creator = new EndableActionCreator(name, this);\n this.configurationfactory.addAction(creator.actionConfig);\n return creator;\n }\n\n /**\n *\n * Starts the creation of an action in the `initActions` list with the specified name\n *\n * @param name\n * @returns\n */\n createInitAction(name: string): EndableActionCreator {\n const creator = new EndableActionCreator(name, this);\n this.configurationfactory.addInitAction(creator.actionConfig);\n return creator;\n }\n\n /**\n *\n * Starts the creation of an action in the `eventActions` list with the specified name\n *\n * @param name\n * @returns\n */\n createEventAction(name: string): ActionCreator {\n const creator = new ActionCreator(name, this);\n this.configurationfactory.addEventAction(creator.actionConfig);\n return creator;\n }\n\n /**\n *\n * Starts the creation of an action in the `timelineActions` list with the specified name and uri\n *\n * @param uri\n * @param name\n * @returns\n */\n createTimelineAction(uri: string, name: string): TimelineActionCreator {\n const creator = new TimelineActionCreator(name, this);\n this.configurationfactory.addTimelineAction(uri, creator.actionConfig);\n return creator;\n }\n\n /**\n *\n * Returns the fluent scope back to the `Configurationfactory`\n *\n * @returns\n */\n end() {\n return this.configurationfactory;\n }\n}\n\n/**\n *\n * A factory that assists in creating an action\n *\n */\nexport class ActionCreator<\n T extends IActionConfiguration = IActionConfiguration,\n> {\n actionConfig: T;\n\n /**\n *\n * Initializes an action configuration with the given name\n *\n * @param name\n * @param factory\n */\n constructor(\n name: string | undefined,\n private readonly factory: ActionCreatorFactory\n ) {\n this.actionConfig = {\n name: name ?? '',\n id: uuidv4(),\n startOperations: [],\n } as unknown as T;\n }\n\n /**\n *\n * The unique id of the action\n *\n * @returns\n */\n getId() {\n return this.actionConfig.id;\n }\n\n /**\n *\n * Sets the name of the action\n *\n * @param name\n * @returns\n */\n setName(name: string) {\n this.actionConfig.name = name;\n return this;\n }\n\n /**\n *\n * Returns a copy of the internal state of the `ActionCreator`\n *\n * @param callBack\n * @returns\n */\n getConfiguration(callBack: (config: T) => T) {\n const copy = deepCopy(this.actionConfig);\n const newConfig = callBack.call(this, copy);\n if (newConfig) {\n this.actionConfig = newConfig;\n }\n return this;\n }\n\n /**\n *\n * Adds the operation data for a start operation specified by the given type\n *\n * @param operationClass\n * @param operationData\n * @returns\n */\n addStartOperationByType<\n T extends TOperationType,\n Dt extends Partial<ExtractOperationDataType<T>>,\n >(operationClass: T, operationData: Dt) {\n const entries = Object.entries(operations).find(\n ([, value]) => value === operationClass\n );\n\n if (entries) {\n return this.addStartOperation(\n entries[0] as TOperationName,\n operationData\n );\n }\n\n throw new Error(`Operation class not found: ${operationClass.toString()}`);\n }\n\n /**\n *\n * Adds the operation data for a start operation specified by the given system name\n *\n * @param systemName\n * @param operationData\n * @returns\n */\n addStartOperation<\n T extends TOperationName,\n O extends Partial<ExtractOperationDataType<GetOperationByName<T>>>,\n >(systemName: T, operationData: O) {\n if (!(operations as Record<string, any>)[systemName]) {\n throw Error(`Unknown operation: ${systemName}`);\n }\n\n const {startOperations} = this.actionConfig;\n startOperations.push({\n id: uuidv4(),\n systemName: systemName,\n operationData: operationData,\n });\n return this;\n }\n\n /**\n *\n * Returns the fluent scope back to the `ActionCreatorFactory`\n *\n * @returns\n */\n next() {\n return this.factory;\n }\n}\n\n/**\n *\n * A factory that assists in creating an endable action\n *\n */\nexport class EndableActionCreator<\n T extends IEndableActionConfiguration = IEndableActionConfiguration,\n> extends ActionCreator<T> {\n constructor(name: string | undefined, factory: ActionCreatorFactory) {\n super(name, factory);\n this.actionConfig.endOperations = [];\n }\n\n /**\n *\n * Adds the operation data for an end operation specified by the given type\n *\n * @param operationClass\n * @param operationData\n * @returns\n */\n addEndOperationByType<\n T extends TOperationType,\n Dt extends Partial<ExtractOperationDataType<T>>,\n >(operationClass: T, operationData: Dt) {\n const entries = Object.entries(operations).find(\n ([, value]) => value === operationClass\n );\n\n if (entries) {\n return this.addEndOperation(entries[0] as TOperationName, operationData);\n }\n\n throw new Error(`Operation class not found: ${operationClass.toString()}`);\n }\n\n /**\n *\n * Adds the operation data for an end operation specified by the given system name\n *\n * @param systemName\n * @param operationData\n * @returns\n */\n addEndOperation<\n T extends TOperationName,\n O extends Partial<ExtractOperationDataType<GetOperationByName<T>>>,\n >(systemName: TOperationName, operationData: O) {\n // biome-ignore lint/performance/noDynamicNamespaceImportAccess: Dynamic operation lookup is intentional for configuration API\n if (!operations[systemName]) {\n throw Error(`Unknown operation: ${systemName}`);\n }\n\n let {endOperations} = this.actionConfig;\n if (!endOperations) {\n endOperations = this.actionConfig.endOperations = [];\n }\n endOperations.push({\n id: uuidv4(),\n systemName: systemName,\n operationData: operationData,\n });\n return this;\n }\n}\n\n/**\n *\n * A factory that assists in creating a timeline action\n *\n */\nexport class TimelineActionCreator extends EndableActionCreator<ITimelineActionConfiguration> {\n /**\n *\n * Sets the duration specified by the given start and optional end positions\n *\n * @param start\n * @param end\n * @returns\n */\n addDuration(start: number, end?: number) {\n this.actionConfig.duration = {\n start: start,\n };\n if (end) {\n this.actionConfig.duration.end = end;\n }\n return this;\n }\n}\n","import type {ConfigurationFactory} from '@configuration/api/configuration-factory.ts';\nimport type {\n ExtractOperationDataType,\n GetOperationByName,\n IActionConfiguration,\n IEndableActionConfiguration,\n IOperationConfiguration,\n ITimelineActionConfiguration,\n TOperationName,\n TOperationType,\n} from '@configuration/types.ts';\nimport {deepCopy} from '@operation/helper/deep-copy.ts';\nimport * as operations from '@operation/index.ts';\nimport type {TOperation, TOperationData} from '@operation/types.ts';\nimport {isDefined} from 'ts-is-present';\nimport {v4 as uuidv4} from 'uuid';\nimport type {IDuration} from '../../types.ts';\n\nfunction array_move(arr: any[], old_index: number, new_index: number) {\n if (new_index >= arr.length) {\n new_index = 0;\n } else if (new_index < 0) {\n new_index = arr.length - 1;\n }\n arr.splice(new_index, 0, arr.splice(old_index, 1)[0]);\n}\n\n/**\n *\n * A factory that assists in editing an action\n *\n */\nexport class ActionEditor<\n T extends IActionConfiguration = IActionConfiguration,\n> {\n constructor(\n protected actionConfig: T,\n protected readonly configurationFactory: ConfigurationFactory\n ) {}\n\n updateConfiguration() {\n this.actionConfig = structuredClone(this.actionConfig);\n }\n\n /**\n *\n * Returns a copy of the current internal state of the factory\n *\n * @param callBack\n * @returns\n */\n getConfiguration(callBack: (config: T) => T | undefined) {\n const copy = deepCopy(this.actionConfig);\n const newConfig = callBack.call(this, copy);\n if (newConfig) {\n this.actionConfig = newConfig;\n }\n return this;\n }\n\n /**\n *\n * Sets the action name\n *\n * @param name\n * @returns\n */\n setName(name: string) {\n this.actionConfig = {\n ...this.actionConfig,\n name,\n };\n return this;\n }\n\n /**\n *\n * Gets the action name\n *\n * @returns\n */\n getName() {\n return this.actionConfig.name;\n }\n\n /**\n *\n * Adds the operation data for a start operation specified by the given type\n *\n * @param operationClass\n * @param operationData\n * @returns\n */\n addStartOperationByType<T extends TOperation<TOperationData>>(\n operationClass: T,\n operationData: Partial<ExtractOperationDataType<T>>\n ): OperationEditor<this, T> {\n const entries = Object.entries(operations).find(\n ([, value]) => value === operationClass\n );\n\n if (entries) {\n return this.addStartOperation(\n entries[0] as TOperationName,\n operationData\n ) as OperationEditor<this, T>;\n }\n\n throw new Error(`Operation class not found: ${operationClass.toString()}`);\n }\n\n /**\n *\n * Adds the operation data for a start operation specified by the given system name\n *\n * @param systemName\n * @param operationData\n * @param id\n * @returns\n */\n addStartOperation(\n systemName: TOperationName,\n operationData: TOperationData,\n id: string = uuidv4()\n ): OperationEditor<this, TOperation<TOperationData>> {\n if (!(operations as any)[systemName]) {\n throw Error(`Unknown operation: ${systemName}`);\n }\n\n const startOperations = this.actionConfig.startOperations\n ? this.actionConfig.startOperations.slice()\n : [];\n\n const newConfig = {\n id,\n systemName: systemName,\n operationData: operationData,\n } as IOperationConfiguration<TOperation<TOperationData>>;\n\n startOperations.push(newConfig);\n\n this.actionConfig = {\n ...this.actionConfig,\n startOperations,\n };\n\n return new OperationEditor<this, TOperation<TOperationData>>(\n newConfig,\n this\n );\n }\n\n /**\n *\n * Starts an editor for the start operation associated with the given id\n *\n * @param id\n * @returns\n */\n editStartOperation(id: string) {\n const {startOperations} = this.actionConfig;\n const operation = startOperations.find(o => o.id === id);\n\n if (isDefined(operation)) {\n return new OperationEditor<ActionEditor<T>, TOperation<TOperationData>>(\n operation,\n this\n );\n }\n\n throw new Error(`start operation not found for id ${id}`);\n }\n\n /**\n *\n * Removes the start operation associated with the given id\n *\n * @param id\n * @returns\n */\n removeStartOperation(id: string) {\n const startOperations = this.actionConfig.startOperations\n ? this.actionConfig.startOperations.slice()\n : [];\n const operation = startOperations.find(o => o.id === id);\n\n if (!operation) {\n throw new Error(`start operation not found for id ${id}`);\n }\n\n const idx = startOperations.indexOf(operation);\n\n if (idx > -1) {\n startOperations.splice(idx, 1);\n this.actionConfig = {\n ...this.actionConfig,\n startOperations,\n };\n }\n\n return this;\n }\n\n /**\n *\n * Moves the start operation associated with the given id in the given direction\n *\n * @param id\n * @param direction\n * @returns\n */\n moveStartOperation(id: string, direction: 'up' | 'down') {\n const startOperations = this.actionConfig.startOperations\n ? this.actionConfig.startOperations.slice()\n : [];\n const operation = startOperations.find(o => o.id === id);\n\n if (!operation) {\n throw new Error(`start operation not found for id ${id}`);\n }\n\n const idx = startOperations.indexOf(operation);\n\n if (idx > -1) {\n const newIdx = direction === 'up' ? idx + 1 : idx - 1;\n array_move(startOperations, idx, newIdx);\n this.actionConfig = {\n ...this.actionConfig,\n startOperations,\n };\n }\n\n return this;\n }\n\n /**\n *\n * Return the fluent scopt to the `ConfigurationFactory`\n *\n * @returns\n */\n next() {\n return this.configurationFactory;\n }\n}\n\n/**\n *\n * A factory that assists in editing an endable action\n *\n */\nexport class EndableActionEditor<\n T extends IEndableActionConfiguration = IEndableActionConfiguration,\n> extends ActionEditor<T> {\n /**\n *\n * Adds the operation data for a end operation specified by the given type\n *\n * @param operationClass\n * @param operationData\n * @returns\n */\n addEndOperationByType<\n T extends TOperationType,\n Dt extends Partial<ExtractOperationDataType<T>>,\n >(\n operationClass: T,\n operationData: Dt\n ): OperationEditor<this, TOperationType> {\n const entries = Object.entries(operations).find(\n ([, value]) => value === operationClass\n );\n\n if (entries) {\n return this.addEndOperation(entries[0] as TOperationName, operationData);\n }\n\n throw new Error(`Operation class not found: ${operationClass.toString()}`);\n }\n\n /**\n *\n * Adds the operation data for a start operation specified by the given system name\n *\n * @param systemName\n * @param operationData\n * @returns\n */\n addEndOperation<\n T extends TOperationName,\n O extends Partial<ExtractOperationDataType<GetOperationByName<T>>>,\n >(systemName: TOperationName, operationData: O) {\n // biome-ignore lint/performance/noDynamicNamespaceImportAccess: Dynamic operation lookup is intentional for configuration API\n if (!operations[systemName]) {\n throw Error(`Unknown operation: ${systemName}`);\n }\n\n const endOperations = this.actionConfig.endOperations\n ? this.actionConfig.endOperations.slice()\n : [];\n\n const newConfig = {\n id: uuidv4(),\n systemName: systemName,\n operationData: operationData,\n };\n\n endOperations.push(newConfig);\n\n this.actionConfig.endOperations = endOperations;\n\n // biome-ignore lint/performance/noDynamicNamespaceImportAccess: Dynamic operation lookup is intentional for configuration API\n const operationCsl = operations[systemName];\n return new OperationEditor<this, typeof operationCsl>(newConfig, this);\n }\n\n /**\n *\n * Starts an editor for the end operation associated with the given id\n *\n * @param id\n * @returns\n */\n editEndOperation(id: string) {\n const {endOperations} = this.actionConfig;\n const operationConfig = endOperations.find(o => o.id === id);\n\n if (isDefined(operationConfig)) {\n return new OperationEditor<this>(operationConfig, this);\n }\n\n throw new Error(`operation not found for id ${id}`);\n }\n\n /**\n *\n * Removes the end operation associated with the given id\n *\n * @param id\n * @returns\n */\n removeEndOperation(id: string) {\n const endOperations = this.actionConfig.endOperations\n ? this.actionConfig.endOperations.slice()\n : [];\n const operation = endOperations.find(o => o.id === id);\n\n if (!isDefined(operation)) {\n throw new Error(`operation not found for id ${id}`);\n }\n\n const idx = endOperations.indexOf(operation);\n\n if (idx > -1) {\n endOperations.splice(idx, 1);\n this.actionConfig = {\n ...this.actionConfig,\n endOperations,\n };\n }\n\n return this;\n }\n\n /**\n *\n * Moves the end operation associated with the given id in the specified direction\n *\n * @param id\n * @param direction\n * @returns\n */\n moveEndOperation(id: string, direction: 'up' | 'down') {\n const endOperations = this.actionConfig.endOperations\n ? this.actionConfig.endOperations.slice()\n : [];\n const operation = endOperations.find(o => o.id === id);\n\n if (!isDefined(operation)) {\n throw new Error(`operation not found for id ${id}`);\n }\n\n const idx = endOperations.indexOf(operation);\n\n if (idx > -1) {\n const newIdx = direction === 'up' ? idx + 1 : idx - 1;\n array_move(endOperations, idx, newIdx);\n this.actionConfig = {\n ...this.actionConfig,\n endOperations,\n };\n }\n return this;\n }\n}\n\n/**\n *\n * A factory that assists in editing a timeline action\n *\n */\nexport class TimelineActionEditor extends EndableActionEditor<ITimelineActionConfiguration> {\n /**\n *\n * Sets the duration specified by the given start and optional end positions\n *\n * @param start\n * @param end\n * @returns\n */\n setDuration(start: number, end?: number) {\n if (end !== undefined && start > end) {\n throw Error('start position cannot be higher than end position');\n }\n\n const duration: IDuration = {\n start,\n };\n\n if (end) {\n duration.end = end;\n }\n\n this.actionConfig = {\n ...this.actionConfig,\n duration,\n };\n return this;\n }\n}\n\n/**\n *\n * A factory that assists in editing an operation\n *\n */\nexport class OperationEditor<\n T extends ActionEditor,\n O extends TOperationType = TOperation<TOperationData>,\n> {\n constructor(\n private operationConfig: IOperationConfiguration<\n ExtractOperationDataType<O>\n >,\n private actionEditor: T\n ) {}\n\n /**\n *\n * Invokes the given callback with a copy of the internal state of the factory\n *\n * @param callBack\n * @returns\n */\n getConfiguration(\n callBack: (\n config: IOperationConfiguration<ExtractOperationDataType<O>>\n ) => IOperationConfiguration<ExtractOperationDataType<O>>\n ) {\n const copy = deepCopy(this.operationConfig);\n const newConfig = callBack.call(this, copy);\n\n if (newConfig) {\n this.operationConfig = newConfig;\n }\n\n return this;\n }\n\n /**\n *\n * Gets the system name\n *\n * @returns\n */\n getSystemName() {\n return this.operationConfig.systemName;\n }\n\n /**\n *\n * Sets the system name\n *\n * @param systemName\n * @returns\n */\n setSystemName(systemName: TOperationName) {\n // biome-ignore lint/performance/noDynamicNamespaceImportAccess: Dynamic operation lookup is intentional for configuration API\n if (!operations[systemName]) {\n throw Error(`Unknown operation: ${systemName}`);\n }\n\n this.operationConfig.systemName = systemName;\n this.actionEditor.updateConfiguration();\n return this;\n }\n\n /**\n *\n * Sets the operation data\n *\n * @param operationData\n * @returns\n */\n setOperationData(operationData: ExtractOperationDataType<O>) {\n this.operationConfig.operationData = operationData;\n this.actionEditor.updateConfiguration();\n return this;\n }\n\n /**\n *\n * Sets the value on the current `operationData` with the given key\n *\n * @param key\n * @param value\n * @returns\n */\n setOperationDataItem(\n key: keyof ExtractOperationDataType<O>,\n value: ExtractOperationDataType<O>[keyof ExtractOperationDataType<O>]\n ) {\n let {operationData} = this.operationConfig;\n if (!operationData) {\n operationData = {} as ExtractOperationDataType<O>;\n }\n operationData[key] = value;\n return this.setOperationData(operationData);\n }\n\n /**\n *\n * returns all of the defined property names on the current `operationData`\n *\n * @returns\n */\n getOperationDataKeys(): keyof ExtractOperationDataType<O> {\n const {operationData} = this.operationConfig;\n return (operationData\n ? Object.keys(operationData)\n : []) as unknown as keyof ExtractOperationDataType<O>;\n }\n\n /**\n *\n * Gets the value of the given key on the current `operationData`\n *\n * @param key\n * @returns\n */\n getOperationDataValue(key: keyof ExtractOperationDataType<O>) {\n const {operationData} = this.operationConfig;\n return operationData?.[key];\n }\n\n /**\n *\n * Returns the fluent scope back to the action editor\n *\n * @returns\n */\n next() {\n return this.actionEditor;\n }\n}\n","import type {ConfigurationFactory} from '@configuration/api/configuration-factory.ts';\nimport type {ILanguageLabel, TLanguageCode} from '../../types.ts';\n\n/**\n * Factory that assists with editing a label\n */\nexport class LabelEditor {\n constructor(\n private configurationFactory: ConfigurationFactory,\n private languageLabel: ILanguageLabel\n ) {}\n\n private _internalGetLabel(languageCode: string) {\n return this.languageLabel.labels.find(x => x.languageCode === languageCode);\n }\n\n /**\n *\n * Set the translation associated with the given language code\n *\n * @param languageCode\n * @param translation\n * @returns\n */\n setLabel(languageCode: TLanguageCode, translation: string) {\n const label = this._internalGetLabel(languageCode);\n if (label) {\n label.label === translation;\n } else {\n throw new Error(`No label found for language code '${languageCode}'`);\n }\n return this;\n }\n\n /**\n *\n * Remove all of the translations for the given language code\n *\n * @param languageCode\n * @returns\n */\n removeLabel(languageCode: TLanguageCode) {\n const idx = this.languageLabel.labels.findIndex(\n x => x.languageCode === languageCode\n );\n if (idx > -1) {\n this.languageLabel.labels.splice(idx, 1);\n } else {\n throw new Error(`No label found for language code '${languageCode}'`);\n }\n return this;\n }\n\n /**\n *\n * Returns the fluent scope back to the `ConfigurationFactory`\n *\n * @returns\n */\n end() {\n return this.configurationFactory;\n }\n}\n","// https://gist.github.com/jakearchibald/cb03f15670817001b1157e62a076fe95\nexport function animationInterval(\n ms: number,\n signal: AbortSignal,\n callback: (time: number) => void\n) {\n // Prefer currentTime, as it'll better sync animations queued in the\n // same frame, but if it isn't supported, performance.now() is fine.\n const currentTime = document?.timeline?.currentTime;\n const start = currentTime ? Number(currentTime) : performance.now();\n\n const frame = (time: number) => {\n if (signal.aborted) return;\n callback(time);\n scheduleFrame(time);\n };\n\n const {round} = Math;\n const scheduleFrame = (time: number) => {\n const elapsed = time - start;\n const roundedElapsed = round(elapsed / ms) * ms;\n const targetNext = start + roundedElapsed + ms;\n const delay = targetNext - performance.now();\n setTimeout(() => requestAnimationFrame(frame), delay);\n };\n\n scheduleFrame(start);\n}\n","import type {\n IResolvedEngineConfiguration,\n IResolvedTimelineConfiguration,\n} from '@configuration/types.ts';\nimport type {ITimelineProvider, TPlayState} from '@timelineproviders/types.ts';\nimport {animationInterval} from '@util/animation-interval.ts';\nimport $ from 'jquery';\n\ntype TUpdateMethod = (now: number) => void;\n\nexport class RequestAnimationFrameTimelineProvider\n implements ITimelineProvider\n{\n private _currentPosition: number = 0;\n private _updateBound: TUpdateMethod = this._update.bind(this);\n private _firstFramePending = true;\n private _currentPlaylistItem: IResolvedTimelineConfiguration;\n private _tickInterval = 1000;\n private _playlist: IResolvedTimelineConfiguration[];\n private _containerElement: JQuery<HTMLElement> | undefined;\n private _abortController: AbortController | undefined;\n private _onTime: ((position: number) => void) | undefined;\n private _onComplete: (() => void) | undefined;\n private _onRestart: (() => void) | undefined;\n private _onFirstFrame: (() => void) | undefined;\n loop: boolean = false;\n\n private _playState: TPlayState = 'stopped';\n public get playState(): TPlayState {\n return this._playState;\n }\n\n constructor(config: IResolvedEngineConfiguration) {\n this._playlist = this._extractPlaylist(config);\n this._currentPlaylistItem = this._playlist[0];\n }\n\n private _extractPlaylist(\n configuration: IResolvedEngineConfiguration\n ): IResolvedTimelineConfiguration[] {\n const playlist = configuration.timelines.filter(\n timeline => timeline.type === 'animation'\n );\n return playlist;\n }\n\n onTime(callback: (position: number) => void) {\n this._onTime = callback;\n }\n\n onComplete(callback: () => void) {\n this._onComplete = callback;\n }\n\n onRestart(callback: () => void) {\n this._onRestart = callback;\n }\n\n onFirstFrame(callback: () => void) {\n this._onFirstFrame = callback;\n }\n\n playlistItem(uri: string): void {\n if (uri === null || !uri.length || this._playlist.length === 0) {\n return;\n }\n\n const item = this._playlist.find(item => {\n return item.uri === uri;\n });\n\n if (!item) {\n throw new Error(`Unknown playlist uri: ${uri}`);\n }\n\n this._currentPlaylistItem = item;\n }\n\n private _update(_now: number): void {\n if (this.playState !== 'running') {\n return;\n }\n\n this._currentPosition++;\n\n if (this._currentPosition > this._currentPlaylistItem.duration) {\n if (this.loop) {\n this._resetToStartPosition();\n this._onRestart?.();\n this._callbackPosition();\n } else {\n this.stop();\n this._onComplete?.();\n return;\n }\n }\n\n this._callbackPosition();\n }\n\n private _callbackPosition() {\n this._onTime?.(this._currentPosition);\n }\n\n start() {\n if (this.playState === 'running') {\n if (this._currentPosition === 0) {\n this._callbackPosition();\n }\n return;\n }\n\n this._playState = 'running';\n this._abortController?.abort();\n this._abortController = new AbortController();\n\n if (this._firstFramePending) {\n this._firstFramePending = false;\n this._onFirstFrame?.();\n }\n if (this._currentPosition === 0) {\n this._callbackPosition();\n }\n\n animationInterval(\n this._tickInterval,\n this._abortController.signal,\n this._updateBound\n );\n }\n\n private _resetToStartPosition() {\n this._currentPosition = 0;\n }\n\n getContainer() {\n return this._containerElement;\n }\n\n private _stopAnimationInterval(resetPosition: boolean = true) {\n this._abortController?.abort();\n this._abortController = undefined;\n\n if (resetPosition) {\n this._resetToStartPosition();\n }\n }\n\n init(): Promise<void> {\n this._currentPlaylistItem = this._playlist[0];\n this._containerElement = $(this._currentPlaylistItem.selector);\n\n if (!this._containerElement.length) {\n throw new Error(\n `timeline selector '${this._currentPlaylistItem.selector}' not found`\n );\n }\n\n return Promise.resolve();\n }\n\n destroy() {\n this.stop();\n this._containerElement = undefined;\n }\n\n stop() {\n this._stopAnimationInterval();\n this._playState = 'stopped';\n }\n\n pause() {\n this._stopAnimationInterval(false);\n this._playState = 'stopped';\n }\n\n seek(position: number) {\n if (position < 0 || position > this._currentPlaylistItem.duration) {\n return Promise.resolve(this._currentPosition);\n }\n this._currentPosition = position;\n return Promise.resolve(position);\n }\n\n getPosition() {\n return this._currentPosition;\n }\n\n getDuration() {\n return this._currentPlaylistItem.duration;\n }\n}\n","import type {IResolvedEngineConfiguration} from '@configuration/types.ts';\nimport type {ITimelineProvider, TPlayState} from '@timelineproviders/types.ts';\nimport $ from 'jquery';\nimport {v4 as uuidv4} from 'uuid';\nimport vjs from 'video.js';\n\nconst videojs = vjs.default ?? vjs;\n\nexport class VideoJsTimelineProvider implements ITimelineProvider {\n private _videoElementId: string = uuidv4();\n private _eventHandlers: (() => void)[] = [];\n\n private _playState: TPlayState = 'stopped';\n public get playState(): TPlayState {\n return this._playState;\n }\n loop = false;\n private _urls: string[] = [];\n private _onTime: ((position: number) => void) | undefined;\n private _onComplete: (() => void) | undefined;\n private _onRestart: (() => void) | undefined;\n private _onFirstFrame: (() => void) | undefined;\n private _player: any | undefined;\n\n constructor(private config: IResolvedEngineConfiguration) {}\n\n init(): Promise<void> {\n videojs.log.level('all');\n\n const selector =\n this.config.timelineProviderSettings.mediaplayer?.selector ?? '';\n this._urls = this._extractUrls(this.config);\n this._addVideoElements(selector, this._urls);\n\n const self = this;\n\n const promise = new Promise<void>(resolve => {\n setTimeout(() => {\n this._player = videojs(\n this._videoElementId,\n {\n controls: false,\n controlBar: false,\n liveui: false,\n autoplay: false,\n preload: 'auto',\n loop: this.loop,\n src: this._urls[0],\n },\n function onPlayerReady(this: any) {\n this.one('firstplay', () => self._onFirstFrame?.());\n this.one('canplay', () => resolve());\n self._addPlayerListener(\n this,\n 'ended',\n self._handleEnded.bind(self)\n );\n self._addPlayerListener(\n this,\n 'timeupdate',\n self._handleTimeUpdate.bind(self)\n );\n this.load();\n }\n ); //as PlayerReadyCallback\n }, 0);\n });\n\n return promise;\n }\n\n private _addPlayerListener(\n instance: any,\n type: string,\n eventHandler: (...args: any[]) => void\n ) {\n instance.on(type, eventHandler);\n this._eventHandlers.push(() => instance.off(type, eventHandler));\n }\n\n private _handleEnded() {\n if (!this._player?.loop) {\n this._onComplete?.();\n } else {\n this._onRestart?.();\n }\n }\n\n private _handleTimeUpdate() {\n if (this._player) {\n const time = this._player.currentTime();\n if (time !== undefined) {\n this._onTime?.(time);\n }\n }\n }\n\n start(): void {\n this._player?.play();\n this._playState = 'running';\n }\n\n stop(): void {\n this._player?.pause();\n this._player?.currentTime(0);\n this._playState = 'stopped';\n }\n\n pause(): void {\n this._player?.pause();\n this._playState = 'stopped';\n }\n\n seek(position: number): Promise<number> {\n return new Promise<number>(resolve => {\n (this._player as any).one('seeked', () => {\n resolve(this._player?.currentTime() ?? 0);\n });\n this._player?.currentTime(position);\n });\n }\n\n playlistItem(uri: string): void {\n if (uri === null || !uri.length || this._urls.length === 0) {\n return;\n }\n\n if (!this._urls.includes(uri)) {\n throw new Error(`Unknown playlist uri: ${uri}`);\n }\n\n this._player?.selectSource([uri]);\n }\n\n getPosition(): number {\n return this._player?.currentTime() ?? 0;\n }\n\n getDuration(): number {\n return this._player?.duration() ?? 0;\n }\n\n getContainer(): JQuery<HTMLElement> | undefined {\n const selector =\n this.config.timelineProviderSettings.mediaplayer?.selector ?? '';\n return $(selector);\n }\n\n destroy(): void {\n this._eventHandlers.forEach(remover => remover());\n this._eventHandlers.length = 0;\n }\n\n onTime(callback: (position: number) => void): void {\n this._onTime = callback;\n }\n\n onComplete(callback: () => void): void {\n this._onComplete = callback;\n }\n\n onRestart(callback: () => void): void {\n this._onRestart = callback;\n }\n\n onFirstFrame(callback: () => void): void {\n this._onFirstFrame = callback;\n }\n\n private _extractUrls(configuration: IResolvedEngineConfiguration) {\n const urls = configuration.timelines\n .filter(timeline => timeline.type === 'mediaplayer')\n .map(timeline => timeline.uri);\n return urls;\n }\n\n private _addVideoElements(selector: string, urls: string[]) {\n const videoElm = [`<video id=${this._videoElementId}>`];\n urls.forEach(url => {\n videoElm.push(\n `<source src='${url}' type='${this._extractFileType(url)}'/>`\n );\n });\n videoElm.push('</video>');\n $(selector).append(videoElm.join(''));\n }\n\n _extractFileType(url: string) {\n const lastIdx = url.lastIndexOf('.');\n return `video/${url.substring(lastIdx + 1)}`;\n }\n}\n","// export { MediaElementTimelineProvider } from './media-element-timeline-provider';\nexport {RequestAnimationFrameTimelineProvider} from '@timelineproviders/request-animation-frame-timeline-provider.ts';\nexport {VideoJsTimelineProvider} from '@timelineproviders/video-js-timeline-provider.ts';\n","import type {ConfigurationFactory} from '@configuration/api/configuration-factory.ts';\nimport type {\n ITimelineProviderSettings,\n TTimelineProviderSettings,\n} from '@configuration/types.ts';\nimport * as timelineProviders from '@timelineproviders/index.ts';\nimport {v4 as uuidv4} from 'uuid';\nimport type {TimelineTypes} from '../../types.ts';\n\nexport class TimelineProvidersSettingsEditor {\n constructor(\n private providersSettings: TTimelineProviderSettings,\n private configurationFactory: ConfigurationFactory\n ) {}\n\n addProvider(timelineType: TimelineTypes) {\n if (this.providersSettings[timelineType]) {\n throw new Error(\n `Settings for a '${timelineType}' provider already exist`\n );\n }\n const settings: ITimelineProviderSettings = {\n id: uuidv4(),\n poster: undefined,\n selector: undefined,\n systemName: '',\n vendor: '',\n };\n this.providersSettings[timelineType] = settings;\n return new TimelineProviderSettingsEditor(\n settings,\n this,\n this.configurationFactory\n );\n }\n\n editProvider(timelineType: TimelineTypes) {\n if (!this.providersSettings[timelineType]) {\n throw new Error(`No settings for a '${timelineType}' provider exist yet`);\n }\n\n return new TimelineProviderSettingsEditor(\n this.providersSettings[timelineType] as ITimelineProviderSettings,\n this,\n this.configurationFactory\n );\n }\n\n next() {\n return this.configurationFactory;\n }\n}\n\nexport class TimelineProviderSettingsEditor {\n constructor(\n private providerSettings: ITimelineProviderSettings,\n private providersSettingsEditor: TimelineProvidersSettingsEditor,\n private configurationFactory: ConfigurationFactory\n ) {}\n\n setVendor(vendor: string) {\n this.providerSettings.vendor = vendor;\n return this;\n }\n\n setSelector(selector: string) {\n this.providerSettings.selector = selector;\n return this;\n }\n\n setSystemName(systemName: string) {\n if (!(timelineProviders as any)[systemName]) {\n throw new Error(`Unknown timeline provider system name: ${systemName}`);\n }\n this.providerSettings.systemName = systemName;\n return this;\n }\n\n next() {\n return this.providersSettingsEditor;\n }\n\n end() {\n return this.configurationFactory;\n }\n}\n","/**\n *\n * Merges the properties of the target object into the source object, only the properties that do not exist yet on the source.\n *\n * This function is pure, so it returns a new instance that reflects the merging of the two objects.\n *\n * The merge is shallow.\n *\n * @param target\n * @param source\n * @returns\n */\nexport const mergeIfMissing = <\n Src extends Record<PropertyKey, any>,\n Trg extends Partial<Src> & Record<PropertyKey, any>,\n>(\n target: Src,\n source: Trg\n): Src & Trg =>\n Object.entries(source).reduce(\n (acc, [key, value]) => (key in acc ? acc : {...acc, [key]: value}),\n target\n );\n","import {ActionCreatorFactory} from '@configuration/api/action-creator-factory.ts';\nimport {\n ActionEditor,\n EndableActionEditor,\n TimelineActionEditor,\n} from '@configuration/api/action-editor.ts';\nimport {LabelEditor} from '@configuration/api/label-editor.ts';\nimport {TimelineProvidersSettingsEditor} from '@configuration/api/timeline-provider-settings-editor.ts';\nimport type {\n IActionConfiguration,\n IEngineConfiguration,\n ITimelineActionConfiguration,\n ITimelineConfiguration,\n} from '@configuration/types.ts';\nimport {deepCopy} from '@operation/helper/deep-copy.ts';\nimport {mergeIfMissing} from '@util/merge-if-missing.ts';\nimport {v4 as uuidv4} from 'uuid';\nimport type {\n ILabel,\n ILanguageLabel,\n KeysOfType,\n TimelineTypes,\n TLanguageCode,\n} from '../../types.ts';\n\n/** */\nexport type TEngineConfigurationLists = KeysOfType<IEngineConfiguration, any[]>;\n\ntype ConfigurationFactoryExtension<NewFactory extends ConfigurationFactory> = (\n this: NewFactory,\n ...rest: any[]\n) => void;\n\n/**\n * This class offers a fluent, extensible and strongly typed DSL for creating Eligius configurations.\n *\n * @example Building a configuration using the factory\n * To initialize a basic configuration to start off of:\n * ```ts\n * const factory = new ConfigurationFactory()\n * .init(\"en-US\") // Define the default language\n * .addLanguage(\"en-US\", \"English\") // Add English as a supported language\n * .addLanguage(\"nl-NL\", \"Nederlands\") // Add Dutch as a supported language\n * .setLayoutTemplate(\"<div class=\\\"main.container\\\"></div>\") // Add the main container for the presentation\n * .setContainerSelector(\"#ct-container\") // Selector for the element in the body that will contain the presentation\n * .addTimeline( // Add a first timeline\n * 'timeline-1', // Give it a name\n * \"animation\", // This is RAF based timeline\n * 200, // The duration of the timeline in seconds\n * false, // The presentation does NOT play in a loop\n * \".timeline-container\" // The element within the main layout (defined by the layoutTemplate) in which the timeline will be rendered\n * )\n * .editTimelineProviderSettings() // Add a timeline provider\n * .addProvider(\"animation\") // One that provides timelines for type 'animation'\n * .setSystemName(\"RequestAnimationFrameTimelineProvider\") // The system name of the provider\n * .setVendor(\"eligius\") // Eligius is the vendor in this case\n * .end(); // This finally returns the ConfigurationFactory instance\n * ```\n *\n * Then to add an init action:\n * ```ts\n * factory\n * .createInitAction(\"GetUserName\")\n * .addStartOperationByType(getQueryParams, {\n * defaultValues: { username: \"guest\" },\n * })\n * .addStartOperationByType(setGlobalData, { properties: [\"queryParams\"] });\n * ```\n *\n * After that, add a timeline action:\n * ```ts\n * factory.createTimelineAction(\"timeline-1\", \"AddIntroContainer\")\n * .addDuration(0, 10)\n * .addStartOperationByType(selectElement, { selector: \".timeline-container\" })\n * .addStartOperationByType(setElementContent, {\n * template: '<div class=\"intro-text\"></div>',\n * })\n * .addEndOperationByType(selectElement, { selector: \".intro-text\" })\n * .addEndOperationByType(removeElement, {});\n * ```\n *\n * It also possible to extend the factory with specialized creation methods for the particular\n * configuration you are building:\n * ```ts\n * function addImage(this: ConfigurationFactory, actionName: string, imageSrc: string, imageId: string) {\n * this.createInitAction(actionName)\n * .addStartOperationByType(selectElement, { selector: \".timeline-container\" })\n * .addStartOperationByType(createElement, { element: 'img', attributes: {src: imageSrc, imageId} })\n * .addStartOperationByType(setElementContent, { insertionType: \"append\" })\n * .addEndOperationByType(selectElement, { selector: `#${imageId}` })\n * .addEndOperationByType(removeElement, {});\n * }\n *\n * const customFactory = ConfigurationFactory.extend(factory, \"addImage\", addImage);\n *\n * customFactory.addImage(\"MyImageActionName\", \"my-image.png\", \"my-image-id\");\n * ```\n *\n * Finally, retrieve the configuration and save it:\n * ```ts\n * import fs from \"node:fs\";\n *\n * const configuration = customFactory.getConfiguration();\n *\n * fs.writeFileSync(\"/my/path/configuration.json\", JSON.stringify(configuration), {encoding:'utf-8'})\n * ```\n *\n * The `ConfigurationFactory` can also be used to edit an existing configuration. In this case, simply\n * pass the JSON configuration to the `ConfigurationFactory`'s constructor:\n * ```ts\n * import myConfiguration from './my-configuration.json';\n *\n * const factory = new ConfigurationFactory(myConfiguration);\n *\n * factory.editInitAction(\"existingActionName\")\n * .removeEndOperation(\"475fd0ab-5755-4e60-8f7c-e1988a109678\");\n * ```\n */\nexport class ConfigurationFactory {\n actionCreatorFactory: ActionCreatorFactory;\n\n /**\n * Constructs a new `ConfigurationFactory`\n * @param config an optional existing configuration that will be used as a starting point\n */\n constructor(public configuration: IEngineConfiguration = {} as any) {\n this.actionCreatorFactory = new ActionCreatorFactory(this);\n }\n\n /**\n * Add specialized method to a factory\n *\n * @param factory\n * @param extensionMethodName\n * @param extensionMethod\n * @returns\n */\n static extend<\n T extends ConfigurationFactory,\n K extends PropertyKey,\n C extends (this: T & {[P in K]: C}, ...args: any[]) => any,\n >(factory: T, extensionMethodName: K, extensionMethod: C): T & {[P in K]: C} {\n return Object.defineProperty<T & {[P in K]: C}>(\n factory as any,\n extensionMethodName,\n {\n value: function (this: T & {[P in K]: C}, ...args: Parameters<C>) {\n return extensionMethod.apply(this, args);\n },\n writable: true,\n configurable: true,\n }\n );\n }\n\n /**\n * Add specialized methods to a factory\n *\n * @param factory\n * @param extensions\n * @returns\n */\n static extendMultiple<\n T extends ConfigurationFactory,\n C extends ConfigurationFactoryExtension<T>,\n D extends {[name: string]: C},\n >(factory: T, extensions: D) {\n return Object.entries(extensions).reduce<T & typeof extensions>(\n (acc, [name, method]) =>\n ConfigurationFactory.extend(acc, name, method) as T & typeof extensions,\n factory as T & typeof extensions\n );\n }\n\n /**\n * Initialize the configuration with a minimal shape.\n *\n * It assigns an ID, sets the engine to `EligiusEngine`, default the containerSelector `[data-ct-container=true]`\n * and initializes all of the list properties with empty arrays.\n * @param defaultLanguage\n * @returns\n */\n init(defaultLanguage: TLanguageCode) {\n const newConfiguration: IEngineConfiguration = {\n id: uuidv4(),\n engine: {\n systemName: 'EligiusEngine',\n },\n containerSelector: '[data-ct-container=true]',\n cssFiles: [],\n timelineProviderSettings: {},\n language: defaultLanguage,\n availableLanguages: [],\n layoutTemplate: '',\n initActions: [],\n actions: [],\n timelines: [],\n labels: [],\n };\n\n this.configuration = mergeIfMissing(this.configuration, newConfiguration);\n\n return this;\n }\n\n /**\n * Assigns the engine system name\n * @param systemName\n * @returns\n */\n setEngine(systemName: string) {\n this.configuration.engine.systemName = systemName;\n return this;\n }\n\n /**\n * Assigns a string representation of the HTML layout template for the engine.\n *\n * @param layoutTemplate\n * @returns\n */\n setLayoutTemplate(layoutTemplate: string) {\n this.configuration.layoutTemplate = layoutTemplate;\n return this;\n }\n\n /**\n *\n * Assigns the default language\n *\n * @param defaultLanguage\n * @returns\n */\n setDefaultLanguage(defaultLanguage: TLanguageCode) {\n this.configuration.language = defaultLanguage;\n return this;\n }\n\n /**\n *\n * Assign the css selector that specifies the DOM location where the engine renders its output\n *\n * @param selector\n * @returns\n */\n setContainerSelector(selector: string) {\n this.configuration.containerSelector = selector;\n return this;\n }\n\n /**\n *\n * Starts an editing process for the timeline provider settings.\n *\n * @returns\n */\n editTimelineProviderSettings() {\n return new TimelineProvidersSettingsEditor(\n this.configuration.timelineProviderSettings || {},\n this\n );\n }\n\n /**\n *\n * Return a copy of the current state of the configuration\n *\n * @param callBack the callback receives the configuration as well and can return a mutated version wich will be assigned to the factory's internal state\n * @returns\n */\n getConfiguration(\n callBack?: (copy: IEngineConfiguration) => IEngineConfiguration\n ) {\n const copy = deepCopy<IEngineConfiguration>(this.configuration);\n if (callBack) {\n const newConfig = callBack.call(this, copy);\n this.configuration = deepCopy<IEngineConfiguration>(newConfig);\n }\n return copy;\n }\n\n /**\n *\n * Adds a language to the `availableLanguages` list.\n * The label represents the name of the language.\n *\n * An error is thrown if a language with the given language code already exists\n *\n * @example\n * factory.addLanguage('en-GB', 'English');\n *\n * @param languageCode The given alnguage code\n * @param languageLabel The human readable name of the language\n * @returns\n */\n addLanguage(languageCode: TLanguageCode, languageLabel: string) {\n const languages = this._initializeCollection(\n this.configuration,\n 'availableLanguages'\n );\n const existing = languages.find(lang => lang.languageCode === languageCode);\n\n if (existing) {\n throw new Error(`Language code '${languageCode}' already exists`);\n }\n\n languages.push({\n id: uuidv4(),\n languageCode: languageCode,\n label: languageLabel,\n });\n return this;\n }\n\n private _internalAddAction(\n collectionName: TEngineConfigurationLists,\n action: IActionConfiguration\n ) {\n const actions = this._initializeCollection(\n this.configuration,\n collectionName\n );\n actions?.push(action as any);\n }\n\n private _initializeCollection<T, K extends keyof T>(\n parent: T,\n name: K\n ): T[K] {\n if (!parent[name]) {\n (parent[name] as any) = [];\n }\n return parent[name] as T[K];\n }\n\n /**\n *\n * Adds the specified action to the `actions` list.\n *\n * @param action\n */\n addAction(action: IActionConfiguration) {\n this._internalAddAction('actions', action);\n }\n\n /**\n *\n * Adds the specified action to the `initActions` list\n *\n * @param action\n */\n addInitAction(action: IActionConfiguration) {\n this._internalAddAction('initActions', action);\n }\n\n /**\n *\n * Adds the specified action to the `eventActions` list\n *\n * @param action\n */\n addEventAction(action: IActionConfiguration) {\n this._internalAddAction('eventActions', action);\n }\n\n /**\n *\n * Adds the given actions to `timelineActions` list that is associated with the specified uri\n *\n * @param uri\n * @param action\n */\n addTimelineAction(uri: string, action: ITimelineActionConfiguration) {\n const timeline = this.getTimeline(uri);\n if (timeline) {\n const timelineActions = this._initializeCollection(\n timeline,\n 'timelineActions'\n );\n timelineActions.push(action);\n } else {\n throw Error(`No timeline found for uri '${uri}'`);\n }\n }\n\n /**\n *\n * Starts the creation of a new action with the specified name that gets added to the `actions` list\n *\n * @param name\n * @returns\n */\n createAction(name: string) {\n return this.actionCreatorFactory.createAction(name);\n }\n\n /**\n *\n * Starts the creation of a new action with the specified name that gets added to the `initActions` list\n *\n * @param name\n * @returns\n */\n createInitAction(name: string) {\n return this.actionCreatorFactory.createInitAction(name);\n }\n\n /**\n *\n * Starts the creation of a new action with the specified name that gets added to the `eventActions` list\n *\n * @param name\n * @returns\n */\n createEventAction(name: string) {\n return this.actionCreatorFactory.createEventAction(name);\n }\n\n /**\n *\n * Starts the creation of a new action with the specified name that gets added to the `timelineActions` list that is associated with the specified uri\n *\n * @param uri\n * @param name\n * @returns\n */\n createTimelineAction(uri: string, name: string) {\n return this.actionCreatorFactory.createTimelineAction(uri, name);\n }\n\n /**\n * Add a timeline with the given data\n *\n * @param uri identifier for the timeline\n * @param type animation or mediaplayer\n * @param duration the duration of the timeline in seconds\n * @param isLooped True if the timeline should automatically restart at the end\n * @param selector css selector for the container where the timeline will be rendered\n * @returns\n */\n addTimeline(\n uri: string,\n type: TimelineTypes,\n duration: number,\n isLooped: boolean,\n selector: string\n ) {\n const timelines = this._initializeCollection(\n this.configuration,\n 'timelines'\n );\n const timeline = this.getTimeline(uri);\n if (timeline) {\n throw Error(`timeline for uri ${uri} already exists`);\n }\n const timelineConfig: ITimelineConfiguration = {\n id: uuidv4(),\n type: type,\n uri: uri,\n duration: duration,\n loop: isLooped,\n selector: selector,\n timelineActions: [],\n };\n timelines.push(timelineConfig);\n return this;\n }\n\n /**\n *\n * Gets the timeline associated with the specified uri\n *\n * @param uri\n * @returns\n */\n getTimeline(uri: string) {\n return this.configuration.timelines.find(t => t.uri === uri);\n }\n\n /**\n *\n * Removes the timeline associated with the specified uri\n *\n * @param uri\n * @returns\n */\n removeTimeline(uri: string) {\n const timelineConfig = this.getTimeline(uri);\n if (timelineConfig) {\n const idx = this.configuration.timelines.indexOf(timelineConfig);\n if (idx > -1) {\n this.configuration.timelines.splice(idx, 1);\n }\n }\n return this;\n }\n\n private _initializeLabel(id: string, labels: ILanguageLabel[]) {\n let label = labels.find(l => l.id === id);\n if (!label) {\n labels.push({\n id: id,\n labels: [],\n });\n label = labels[labels.length - 1];\n }\n return label;\n }\n\n private _getLabelTranslation(\n labelTranslations: ILabel[],\n languageCode: TLanguageCode\n ) {\n let translation = labelTranslations.find(\n l => l.languageCode === languageCode\n );\n if (!translation) {\n translation = {\n id: uuidv4(),\n languageCode: languageCode,\n label: '',\n };\n labelTranslations.push(translation);\n }\n return translation;\n }\n\n /**\n *\n * Starts an editor for the label that is associated with the specified id\n *\n * @param id\n * @returns\n */\n editLabel(id: string) {\n const label = this.configuration.labels?.find(x => x.id === id);\n if (label) {\n return new LabelEditor(this, label);\n } else {\n throw new Error(`Language label with id '${id}' not found`);\n }\n }\n\n /**\n *\n * Adds a label translation with the specified data\n *\n * @param id The id for the label\n * @param languageCode The language code associated with the label\n * @param translation The label text in the language specified by the language code\n * @returns\n */\n addLabel(id: string, languageCode: TLanguageCode, translation: string) {\n const labels = this._initializeCollection(this.configuration, 'labels');\n const labelConfig = this._initializeLabel(id, labels);\n const labelTranslation = this._getLabelTranslation(\n labelConfig.labels,\n languageCode\n );\n labelTranslation.label = translation;\n return this;\n }\n\n /**\n *\n * Adds multiple translations with the specified data\n *\n * @param id The id for the label\n * @param translations A record that holds language code to translations lookups\n * @returns\n */\n addLabels(id: string, translations: Record<TLanguageCode, string>) {\n Object.entries(translations).forEach(([code, translation]) =>\n this.addLabel(id, code as TLanguageCode, translation)\n );\n return this;\n }\n\n /**\n *\n * Removes all translations with the given id\n *\n * @param id the id for the label\n * @returns\n */\n removeLabel(id: string) {\n const idx = this.configuration.labels.findIndex(x => x.id === id);\n if (idx > -1) {\n this.configuration.labels.splice(idx, 1);\n } else {\n throw new Error(`Label with id '${id}' not found!`);\n }\n return this;\n }\n\n /**\n *\n * Starts an editor for the action from the `actions` list associated with the given id\n *\n * @param id\n * @returns\n */\n editAction(id: string) {\n const actionConfig = this.configuration.actions.find(a => a.id === id);\n if (actionConfig) {\n return new EndableActionEditor(actionConfig, this);\n }\n throw new Error(`Action not found for id ${id}`);\n }\n\n /**\n *\n * Starts an editor for the action from the `eventActions` list associated with the given id\n *\n * @param id\n * @returns\n */\n editEventAction(id: string) {\n const actionConfig = this.configuration.eventActions?.find(\n a => a.id === id\n );\n if (actionConfig) {\n return new ActionEditor(actionConfig, this);\n }\n throw new Error(`Event action not found for id ${id}`);\n }\n\n /**\n *\n * Starts an editor for the action from the `initActions` list associated with the given id\n *\n * @param id\n * @returns\n */\n editInitAction(id: string) {\n const actionConfig = this.configuration.initActions.find(a => a.id === id);\n if (actionConfig) {\n return new EndableActionEditor(actionConfig, this);\n }\n throw new Error(`Init action not found for id ${id}`);\n }\n\n /**\n *\n * Starts an editor for the action from the `timelineActions` list associated with the given uri and id\n *\n * @param uri\n * @param id\n * @returns\n */\n editTimelineAction(uri: string, id: string) {\n const timeline = this.getTimeline(uri);\n if (!timeline) {\n throw new Error(`Timeline not found for id ${id}`);\n }\n const actionConfig = timeline.timelineActions.find(a => a.id === id);\n if (actionConfig) {\n return new TimelineActionEditor(actionConfig, this);\n }\n throw new Error(`Timeline action not found for id ${id}`);\n }\n}\n","import type {IEndableAction} from '@action/types.ts';\nimport type {IController} from '@controllers/types.ts';\nimport type {IEventbus} from '@eventbus/types.ts';\nimport {deepCopy} from '@operation/helper/deep-copy.ts';\nimport type {TOperationData} from '@operation/types.ts';\n\ninterface IActionInstanceInfo {\n start: boolean;\n action: IEndableAction;\n}\n\nexport interface IDOMEventListenerControllerOperationData {\n /**\n * @dependency\n */\n selectedElement: JQuery;\n /**\n * @type=ParameterType:eventName\n * @required\n */\n eventName: string;\n actions: string[];\n /**\n * @type=ParameterType:object\n */\n actionOperationData?: TOperationData;\n}\n\n/**\n * This controller attaches to the given selected element and adds a DOM event listener for the specified event name that\n * executes the given actions with the given operation data.\n *\n * By default the `start` operations of the specified actions are executed. To execute the `end` operations instead,\n * prefix the action name with `end:`.\n */\nexport class DOMEventListenerController\n implements IController<IDOMEventListenerControllerOperationData>\n{\n operationData?: IDOMEventListenerControllerOperationData;\n actionInstanceInfos?: IActionInstanceInfo[];\n name = 'DOMEventListenerController';\n\n init(operationData: IDOMEventListenerControllerOperationData) {\n this.operationData = {\n selectedElement: operationData.selectedElement,\n eventName: operationData.eventName,\n actions: operationData.actions.slice(),\n actionOperationData: deepCopy(operationData.actionOperationData),\n };\n }\n\n attach(eventbus: IEventbus) {\n if (!this.operationData) {\n return;\n }\n\n const {selectedElement, actions, eventName} = this.operationData;\n if (!this.actionInstanceInfos) {\n this.actionInstanceInfos = [];\n\n const resultCallback =\n (isStart: boolean) => (actionInstance: IEndableAction) => {\n this.actionInstanceInfos?.push({\n start: isStart,\n action: actionInstance,\n });\n };\n\n actions.forEach((actionName: string) => {\n const [isStart, name] = this._isStartAction(actionName);\n eventbus.broadcast('request-action', [name, resultCallback(isStart)]);\n });\n\n selectedElement.on(eventName, this._eventHandler.bind(this));\n }\n }\n\n private _isStartAction(actionName: string): [boolean, string] {\n const prefix = actionName.substring(0, 'end:'.length);\n if (prefix === 'end:') {\n return [false, actionName.substring('end:'.length)];\n } else {\n return [true, actionName];\n }\n }\n\n private _eventHandler(event: any) {\n if (!this.operationData || !this.actionInstanceInfos) {\n return;\n }\n\n const actionOperationData = this.operationData.actionOperationData\n ? deepCopy(this.operationData.actionOperationData)\n : {};\n\n if (event.target) {\n actionOperationData.eventTarget = event.target;\n }\n\n this._executeAction(this.actionInstanceInfos, actionOperationData, 0);\n }\n\n private async _executeAction(\n actions: IActionInstanceInfo[],\n operationData: TOperationData,\n idx: number\n ) {\n if (idx < actions.length) {\n const actionInfo = actions[idx];\n const {action} = actionInfo;\n const method = actionInfo.start\n ? action.start.bind(action)\n : action.end.bind(action);\n const resultOperationData = await method(operationData);\n this._executeAction(\n actions,\n Object.assign(operationData, resultOperationData),\n ++idx\n );\n }\n }\n\n detach(_eventbus: IEventbus) {\n this.operationData?.selectedElement.off(this.operationData.eventName);\n }\n}\n","import type {IController} from '@controllers/types.js';\nimport type {EventName, IEventbus, TEventbusRemover} from '@eventbus/types.js';\nimport type {TOperationData} from '@operation/types.js';\n\n/**\n * Abstract base class for controllers providing standardized event listener management\n *\n * Benefits:\n * - Eliminates boilerplate event listener tracking code\n * - Automatic binding of event handlers to controller instance\n * - Centralized cleanup preventing memory leaks\n * - Consistent event management pattern across all controllers\n *\n * @example\n * ```typescript\n * class MyController extends BaseController<IMyOperationData> {\n * name = 'MyController';\n *\n * init(operationData: IMyOperationData): void {\n * this.operationData = operationData;\n * }\n *\n * attach(eventbus: IEventbus): void {\n * this.addListener(eventbus, 'my-event', this.handleMyEvent);\n * // Handler automatically bound, cleanup tracked\n * }\n *\n * private handleMyEvent(): void {\n * // 'this' context preserved\n * }\n * }\n * ```\n */\nexport abstract class BaseController<T extends TOperationData>\n implements IController<T>\n{\n // Public properties (required by IController)\n public operationData: T | null = null;\n public abstract name: string;\n\n // Protected state\n protected eventListeners: TEventbusRemover[] = [];\n\n /**\n * Register event listener with automatic binding and cleanup tracking\n *\n * @param eventbus - The eventbus to register with\n * @param eventName - Name of the event to listen for\n * @param handler - Event handler function (will be bound to this controller)\n */\n protected addListener(\n eventbus: IEventbus,\n eventName: EventName,\n handler: (...args: any[]) => void\n ): void {\n const boundHandler = handler.bind(this);\n const remover = eventbus.on(eventName, boundHandler as any);\n this.eventListeners.push(remover);\n }\n\n /**\n * Register multiple event listeners at once\n *\n * @param eventbus - The eventbus to register with\n * @param listeners - Array of {eventName, handler} pairs\n */\n protected attachMultiple(\n eventbus: IEventbus,\n listeners: Array<{eventName: string; handler: (...args: any[]) => void}>\n ): void {\n listeners.forEach(({eventName, handler}) => {\n this.addListener(eventbus, eventName as EventName, handler);\n });\n }\n\n /**\n * Clean up all tracked event listeners\n * Prevents memory leaks by removing all registered handlers\n *\n * @param _eventbus - The eventbus (ignored, included for IController compatibility)\n */\n public detach(_eventbus: IEventbus): void {\n this.eventListeners.forEach(remover => remover());\n this.eventListeners = [];\n }\n\n // Abstract methods (must be implemented by subclasses)\n public abstract init(operationData: T): void;\n public abstract attach(eventbus: IEventbus): Promise<any> | void;\n}\n","import {BaseController} from '@controllers/base-controller.ts';\nimport type {IEventbus} from '@eventbus/types.ts';\nimport type {ILabel} from '../types.ts';\n\nexport interface ILabelControllerMetadata {\n /**\n * @dependency\n */\n selectedElement: JQuery;\n /**\n * @type=ParameterType:labelId\n * @required\n */\n labelId: string;\n /**\n * By default the label is added to the inner HTML of the `selectedElement`,\n * otherwise if this property is set, the label text is added to the specified attribute\n * of the `selectedElement`.\n */\n attributeName?: string;\n}\n\n/**\n * This controller attaches to the given selected element and renders the text associated with the given label id in it.\n *\n * The controller also listen for the `LANGUAGE_CHANGE` event and re-renders the text with the new language after such an event.\n *\n */\nexport class LabelController extends BaseController<ILabelControllerMetadata> {\n currentLanguage: string | null = null;\n labelData: Record<string, string> = {};\n name = 'LabelController';\n requestLabelDataBound?: (labelId: string) => void;\n\n init(operationData: ILabelControllerMetadata) {\n this.operationData = Object.assign({}, operationData);\n }\n\n setLabelId(newLabelId: string) {\n if (this.requestLabelDataBound) {\n this.requestLabelDataBound(newLabelId);\n this._setLabel();\n }\n }\n\n attach(eventbus: IEventbus) {\n if (!this.operationData) {\n return;\n }\n\n eventbus.broadcast('request-current-language', [\n (language: string) => {\n this.currentLanguage = language;\n },\n ]);\n\n this.requestLabelDataBound = this._requestLabelData.bind(this, eventbus);\n this.requestLabelDataBound(this.operationData.labelId);\n\n this._setLabel();\n this.addListener(eventbus, 'language-change', this._handleLanguageChange);\n }\n\n private _requestLabelData(eventbus: IEventbus, labelId: string) {\n eventbus.broadcast('request-label-collection', [\n labelId,\n (labelCollection: ILabel[]) => {\n if (labelCollection) {\n this._createTextDataLookup(labelCollection);\n } else {\n throw new Error(`Label id '${labelId}' does not exist!`);\n }\n },\n ]);\n }\n\n private _setLabel() {\n if (this.currentLanguage) {\n const text = this.labelData[this.currentLanguage];\n if (!this.operationData?.attributeName) {\n this.operationData?.selectedElement.html(text);\n } else {\n this.operationData?.selectedElement.attr(\n this.operationData?.attributeName,\n text\n );\n }\n }\n }\n\n detach(eventbus: IEventbus) {\n super.detach(eventbus);\n this.requestLabelDataBound = undefined;\n }\n\n private _handleLanguageChange(code: string) {\n this.currentLanguage = code;\n this._setLabel();\n }\n\n private _createTextDataLookup(data: ILabel[]) {\n data.forEach(d => {\n this.labelData[d.languageCode] = d.label;\n });\n }\n}\n","import {BaseController} from '@controllers/base-controller.ts';\nimport type {IEventbus} from '@eventbus/types.ts';\nimport type {\n AnimationConfigWithData,\n AnimationItem,\n CanvasRendererConfig,\n HTMLRendererConfig,\n SVGRendererConfig,\n} from 'lottie-web';\nimport lt from 'lottie-web';\nimport type {TLanguageCode} from '../types.ts';\n\nconst lottie = lt.default ?? lt;\n\nexport interface IInnerMetadata {\n /**\n * @dependency\n */\n selectedElement: JQuery;\n /**\n * @type=ParameterType:string\n */\n renderer: SVGRendererConfig | CanvasRendererConfig | HTMLRendererConfig;\n loop: boolean;\n autoplay: boolean;\n /**\n * ParameterType:object\n */\n animationData: any;\n /**\n * @required\n */\n json: any;\n /**\n * @type=ParameterType:array\n * @itemType=ParameterType:labelId\n */\n labelIds: string[];\n viewBox: string;\n iefallback: any;\n}\n\nexport interface ILottieControllerMetadata extends IInnerMetadata {\n /**\n * @type=ParameterType:url\n * @required\n */\n url: string;\n}\n\n/**\n * This controller renders a [lottie-web](https://github.com/airbnb/lottie-web) animation inside the given selected element.\n *\n * The url may encode freeze and end positions like this: my-url/filename[freeze=10,end=21].json\n *\n */\nexport class LottieController extends BaseController<ILottieControllerMetadata> {\n name = 'LottieController';\n currentLanguage: TLanguageCode = 'nl-NL';\n labelData: Record<string, Record<string, string>> = {};\n animationItem: AnimationItem | null = null;\n serializedData: string | null = null;\n serializedIEData: string | null = null;\n freezePosition = -1;\n endPosition = -1;\n\n init(operationData: ILottieControllerMetadata) {\n this.operationData = {...operationData};\n\n if (operationData.url.indexOf('[') > -1) {\n this._parseFilename(operationData.url);\n }\n\n this.serializedData = this.operationData.json\n ? JSON.stringify(this.operationData.json)\n : JSON.stringify(this.operationData.animationData);\n\n if (this.operationData.iefallback) {\n this.serializedIEData = JSON.stringify(this.operationData.iefallback);\n }\n }\n\n private _parseFilename(name: string) {\n const startIndex = name.indexOf('[') + 1;\n const endIndex = name.indexOf(']');\n const params = name.substring(startIndex, endIndex);\n\n const settings = params.split(',');\n\n settings.forEach(setting => {\n const values = setting.split('=');\n if (values[0] === 'freeze') {\n this.freezePosition = +values[1];\n } else if (values[0] === 'end') {\n this.endPosition = +values[1];\n }\n });\n }\n\n attach(eventbus: IEventbus) {\n if (!this.operationData) {\n return;\n }\n\n const {labelIds} = this.operationData;\n if (labelIds?.length) {\n let currentLanguage: TLanguageCode = 'en-US';\n let labelCollections: any[] = [];\n\n eventbus.broadcast('request-current-language', [\n (language: TLanguageCode) => {\n currentLanguage = language;\n },\n ]);\n this.currentLanguage = currentLanguage;\n this.addListener(eventbus, 'language-change', this._handleLanguageChange);\n eventbus.broadcast('request-label-collections', [\n this.operationData.labelIds,\n (collections: any) => {\n labelCollections = collections;\n },\n ]);\n this._createTextDataLookup(labelCollections);\n }\n this._createAnimation();\n this._createAnimation();\n }\n\n detach(eventbus: IEventbus) {\n super.detach(eventbus);\n\n if (this.animationItem) {\n if (this.endPosition > -1) {\n this.animationItem.addEventListener(\n 'complete',\n this._destroy.bind(this)\n );\n this.animationItem.playSegments(\n [this.freezePosition, this.endPosition],\n true\n );\n } else {\n this.animationItem.destroy();\n }\n }\n }\n\n private _destroy() {\n if (this.animationItem) {\n this.animationItem.destroy();\n this.animationItem = null;\n }\n }\n\n private _createAnimation() {\n if (!this.operationData || !this.serializedData) {\n return;\n }\n\n this.animationItem?.destroy();\n let serialized =\n this._isIE() && this.serializedIEData\n ? this.serializedIEData\n : this.serializedData;\n\n const {labelIds} = this.operationData;\n if (labelIds?.length) {\n // O(n) regex-based replacement - single pass through string\n // Replaces all !!labelId!! patterns in one operation\n serialized = serialized.replace(/!!([^!]+)!!/g, (match, labelId) => {\n return this.labelData[labelId]?.[this.currentLanguage] ?? match;\n });\n }\n const animationData = JSON.parse(serialized);\n\n const animationSettings: AnimationConfigWithData<'svg'> = {\n autoplay: this.operationData.autoplay,\n container: this.operationData.selectedElement[0],\n loop: this.operationData.loop,\n rendererSettings: this.operationData.renderer,\n animationData,\n };\n\n this.animationItem = lottie.loadAnimation(animationSettings);\n if (this.endPosition < 0) {\n this.endPosition = this.animationItem.timeCompleted;\n }\n\n if (this.freezePosition > -1) {\n this.animationItem.playSegments([0, this.freezePosition], true);\n }\n if (this.operationData.viewBox) {\n this.operationData.selectedElement\n .find('svg')\n .attr('viewBox', this.operationData.viewBox);\n }\n }\n\n private _createTextDataLookup(data: any[]) {\n data.forEach((infos, index) => {\n infos.forEach((d: any) => {\n if (this.operationData) {\n this.labelData[this.operationData.labelIds[index]][d.code] = d.label;\n }\n });\n });\n }\n\n private _handleLanguageChange(code: TLanguageCode) {\n this.currentLanguage = code;\n this._createAnimation();\n }\n\n private _isIE() {\n const isIE = false || !!(window.document as any).documentMode;\n\n // Edge 20+\n const isEdge = !isIE && !!(window as any).StyleMedia;\n\n return isEdge || isIE;\n }\n}\n","import {BaseController} from '@controllers/base-controller.ts';\nimport type {IEventbus} from '@eventbus/types.ts';\n\n/**\n * Metadata configuration for MutationObserverController\n *\n * Configures what types of DOM mutations to observe and how to observe them.\n */\nexport interface IMutationObserverControllerMetadata {\n /**\n * jQuery-wrapped DOM element to observe for mutations\n * @dependency\n * @required\n */\n selectedElement: JQuery;\n\n /**\n * Observe changes to element attributes\n * @optional\n * @default true\n */\n observeAttributes?: boolean;\n\n /**\n * Observe additions and removals of child nodes\n * @optional\n * @default true\n */\n observeChildList?: boolean;\n\n /**\n * Observe changes to text content (character data)\n * @optional\n * @default true\n */\n observeCharacterData?: boolean;\n\n /**\n * Observe mutations in the entire subtree (all descendants)\n * @optional\n * @default false\n */\n observeSubtree?: boolean;\n\n /**\n * Record the previous value of attributes that change\n * Requires observeAttributes to be true\n * @optional\n * @default false\n */\n attributeOldValue?: boolean;\n\n /**\n * Record the previous value of text content that changes\n * Requires observeCharacterData to be true\n * @optional\n * @default false\n */\n characterDataOldValue?: boolean;\n\n /**\n * Array of specific attribute local names to observe\n * If omitted, all attribute changes are observed when observeAttributes is true\n * @optional\n */\n attributeFilter?: string[];\n}\n\n/**\n * Mutation event payload broadcasted through Eligius eventbus\n */\nexport interface IMutationEventPayload {\n /**\n * Array of mutation records from the MutationObserver callback\n */\n mutations: MutationRecord[];\n\n /**\n * Reference to the observed element (native DOM node)\n */\n target: Element;\n\n /**\n * Timestamp when the mutations were detected\n */\n timestamp: number;\n}\n\n/**\n * Controller that observes DOM mutations on a selected element and broadcasts events.\n *\n * This controller creates a MutationObserver to monitor DOM changes (attributes, child nodes,\n * text content) on a specified element. All detected mutations are broadcasted through the\n * Eligius eventbus, enabling reactive behavior in response to DOM changes.\n *\n * The controller follows the standard Eligius lifecycle:\n * - init(): Store configuration metadata\n * - attach(): Create and start the MutationObserver\n * - detach(): Disconnect the observer and clean up resources\n *\n * @example\n * ```typescript\n * // JSON configuration\n * {\n * \"systemName\": \"addControllerToElement\",\n * \"operationData\": {\n * \"controllerName\": \"MutationObserverController\",\n * \"observeAttributes\": true,\n * \"observeChildList\": true,\n * \"observeCharacterData\": false\n * }\n * }\n *\n * // Listen for mutations\n * eventbus.on('dom-mutation', (payload: IMutationEventPayload) => {\n * console.log('Mutations detected:', payload.mutations);\n * });\n * ```\n */\nexport class MutationObserverController extends BaseController<IMutationObserverControllerMetadata> {\n name = 'MutationObserverController';\n private observer: MutationObserver | null = null;\n\n /**\n * Initialize the controller with configuration metadata.\n *\n * @param operationData - Configuration for observation behavior\n */\n init(operationData: IMutationObserverControllerMetadata): void {\n this.operationData = Object.assign({}, operationData);\n }\n\n /**\n * Attach the controller and start observing mutations.\n * Creates MutationObserver instance and begins monitoring the target element.\n *\n * @param eventbus - Eligius eventbus for broadcasting mutation events\n */\n attach(eventbus: IEventbus): void {\n if (!this.operationData) {\n return;\n }\n\n // Unwrap jQuery element to get native DOM node\n const nativeElement = this.operationData.selectedElement.get(0);\n if (!nativeElement) {\n return;\n }\n\n // Build observer options from metadata\n const options = this._buildObserverOptions();\n\n // Create MutationObserver with bound callback\n this.observer = new MutationObserver(\n this._handleMutations.bind(this, eventbus, nativeElement)\n );\n\n // Start observing the target element\n this.observer.observe(nativeElement, options);\n }\n\n /**\n * Detach the controller and stop observing mutations.\n * Disconnects MutationObserver and cleans up resources.\n *\n * @param eventbus - Eligius eventbus (used by BaseController for cleanup)\n */\n detach(eventbus: IEventbus): void {\n // Disconnect and clean up observer\n if (this.observer) {\n this.observer.disconnect();\n this.observer = null;\n }\n\n // Call parent detach for event listener cleanup\n super.detach(eventbus);\n }\n\n /**\n * Build MutationObserverInit options from controller metadata.\n * Applies default values for optional configuration properties.\n *\n * @returns MutationObserverInit options object\n * @private\n */\n private _buildObserverOptions(): MutationObserverInit {\n if (!this.operationData) {\n return {};\n }\n\n const {\n observeAttributes = true,\n observeChildList = true,\n observeCharacterData = true,\n observeSubtree = false,\n attributeOldValue = false,\n characterDataOldValue = false,\n attributeFilter,\n } = this.operationData;\n\n return {\n attributes: observeAttributes,\n childList: observeChildList,\n characterData: observeCharacterData,\n subtree: observeSubtree,\n attributeOldValue,\n characterDataOldValue,\n attributeFilter,\n };\n }\n\n /**\n * Handle mutations detected by the MutationObserver.\n * Broadcasts mutation events through the eventbus with mutation details.\n *\n * @param eventbus - Eligius eventbus for broadcasting\n * @param target - The observed element\n * @param mutations - Array of mutation records from observer callback\n * @private\n */\n private _handleMutations(\n eventbus: IEventbus,\n target: Element,\n mutations: MutationRecord[]\n ): void {\n const payload: IMutationEventPayload = {\n mutations,\n target,\n timestamp: Date.now(),\n };\n\n eventbus.broadcast('dom-mutation', [payload]);\n }\n}\n","import {BaseController} from '@controllers/base-controller.ts';\nimport type {LabelController} from '@controllers/label-controller.ts';\nimport type {IEventbus} from '@eventbus/types.ts';\nimport type {TOperationData} from '@operation/types.ts';\nimport $ from 'jquery';\nimport type {TResultCallback} from '../types.ts';\n\nexport interface INavigationControllerOperationData {\n /**\n * @dependency\n */\n selectedElement: JQuery;\n /**\n * @required\n */\n json: any;\n}\n\nexport class NavigationController extends BaseController<INavigationControllerOperationData> {\n name: string = 'NavigationController';\n navigation: any[] = [];\n navLookup: Record<string, any> = {};\n navVidIdLookup: Record<string, any> = {};\n ctrlLookup: Record<string, LabelController> = {};\n activeNavigationPoint: any | null = null;\n labelControllers: LabelController[] = [];\n eventbus: IEventbus | null = null;\n container: JQuery | null = null;\n\n init(operationData: TOperationData) {\n this.container = operationData.selectedElement;\n this.navigation = this._buildNavigationData(operationData.json);\n }\n\n attach(eventbus: IEventbus) {\n if (!this.container) {\n return;\n }\n\n this.eventbus = eventbus;\n\n this.addListener(\n eventbus,\n 'navigate-to-video-url',\n this._handleNavigateVideoUrl\n );\n this.addListener(eventbus, 'highlight-navigation', this._highlightMenu);\n this.addListener(\n eventbus,\n 'request-current-navigation',\n this._handleRequestCurrentNavigation\n );\n this.addListener(eventbus, 'video-complete', this._handleVideoComplete);\n\n this._buildHtml(this.container, this.navigation);\n this._initHistory.bind(this);\n }\n\n private _initHistory() {\n this.activeNavigationPoint = this.navVidIdLookup[0];\n const navId = this._getQueryVariable(0);\n let videoIndex = 0;\n if (navId) {\n const nav = this.navLookup[navId];\n videoIndex = nav.videoUrlIndex;\n }\n this._highlightMenu(videoIndex);\n }\n\n private _getQueryVariable(variableIdx: number) {\n const href = window.location.href;\n const hashIndex = href.indexOf('#');\n if (hashIndex > -1) {\n const query = href.substring(hashIndex + 2);\n if (query) {\n const vars = query.split('/');\n return vars[variableIdx];\n }\n }\n return null;\n }\n\n private _handleRequestCurrentNavigation(\n resultCallback: TResultCallback<{navigationData: any; title: string} | null>\n ) {\n if (this.activeNavigationPoint) {\n const labelCtrl = this.ctrlLookup[this.activeNavigationPoint.labelId];\n resultCallback({\n navigationData: this.activeNavigationPoint,\n title: labelCtrl.labelData[labelCtrl.currentLanguage || ''],\n });\n } else {\n resultCallback(null);\n }\n }\n\n detach(eventbus: IEventbus) {\n super.detach(eventbus);\n\n this.labelControllers.forEach(ctrl => {\n ctrl.detach(eventbus);\n });\n\n this.labelControllers.length = 0;\n this.eventbus = null;\n this.container = null;\n window.onpopstate = null;\n }\n\n private _pushCurrentState(position = -1) {\n if (!this.activeNavigationPoint) {\n return;\n }\n const labelCtrl: LabelController =\n this.ctrlLookup[this.activeNavigationPoint.labelId];\n\n if (!labelCtrl) {\n return;\n }\n\n const state = {\n navigationData: this.activeNavigationPoint,\n title: labelCtrl.labelData[labelCtrl.currentLanguage || ''],\n position: -1,\n };\n if (position > -1) {\n state.position = position;\n }\n this.eventbus?.broadcast('push-history-state', [state]);\n }\n\n private _buildHtml(parentElm: JQuery, data: any) {\n const ul = $('<ul/>');\n data.forEach(this._addNavElement.bind(this, ul));\n parentElm.append(ul);\n }\n\n private _addNavElement(parentElm: JQuery, data: any) {\n if (data.visible) {\n const li = $('<li/>');\n const a = $(`<a href='javascript:;' id='nav_${data.videoUrlIndex}'/>`);\n li.append(a);\n this._addLabel(a, data.labelId);\n this._addClickHandler(a, data.videoUrlIndex);\n\n if (data.children) {\n const ul = $('<ul/>');\n data.children.forEach(this._addNavElement.bind(this, ul));\n li.append(ul);\n }\n\n parentElm.append(li);\n }\n }\n\n private _addClickHandler(parentElm: JQuery, videoIndex: number) {\n parentElm.mouseup(this._menuMouseupHandler.bind(this, videoIndex));\n }\n\n private _menuMouseupHandler(videoIndex: number) {\n const navdata = this.navVidIdLookup[videoIndex];\n if (navdata) {\n this.eventbus?.broadcast('request-video-url', [navdata.videoUrlIndex]);\n this._handleNavigateVideoUrl(navdata.videoUrlIndex);\n }\n }\n\n private _handleNavigateVideoUrl(\n index: number,\n requestedVideoPosition: number = 0\n ) {\n this._highlightMenu(index);\n this.eventbus?.broadcast('request-video-url', [\n index,\n requestedVideoPosition,\n ]);\n this.activeNavigationPoint = this.navVidIdLookup[index];\n this._pushCurrentState(requestedVideoPosition);\n }\n\n private _highlightMenu(index: number) {\n const navElm = $(`#nav_${index}`);\n\n if (navElm.length) {\n $('.current-menu-item').removeClass('current-menu-item');\n navElm.addClass('current-menu-item');\n }\n }\n\n private _handleVideoComplete(index: number) {\n const navData = this.navVidIdLookup[index];\n if (navData.autoNext) {\n this.eventbus?.broadcast('request-video-url', [\n navData.next.videoUrlIndex,\n ]);\n } else {\n this.eventbus?.broadcast('request-video-cleanup', []);\n }\n }\n\n private _addLabel(parentElm: JQuery, labelId: string) {\n const data = {\n selectedElement: parentElm,\n labelId: labelId,\n };\n const resultCallback = (instance: LabelController) => {\n instance.init(data);\n instance.attach(this.eventbus as IEventbus);\n this.labelControllers.push(instance);\n this.ctrlLookup[labelId] = instance;\n };\n this.eventbus?.broadcast('request-instance', [\n 'LabelController',\n resultCallback,\n ]);\n }\n\n private _buildNavigationData(data: any) {\n const result: any[] = [];\n data.navigationData.forEach((nav: any, index: number) => {\n this.navLookup[nav.id] = nav;\n this.navVidIdLookup[nav.videoUrlIndex] = nav;\n nav.previous = data.navigationData[index - 1];\n });\n\n data.navigationData.forEach((nav: any, index: number) => {\n if (nav.nextId) {\n nav.next = this.navLookup[nav.nextId];\n delete nav.nextId;\n } else {\n nav.next = data.navigationData[index + 1];\n }\n });\n\n data.roots.forEach((id: string) => {\n const nav = this.navLookup[id];\n if (nav.children) {\n nav.children = nav.children.map((childId: string) => {\n return this.navLookup[childId];\n });\n }\n result.push(nav);\n });\n return result;\n }\n}\n","import {BaseController} from '@controllers/base-controller.ts';\nimport type {IEventbus} from '@eventbus/types.ts';\nimport type {TOperationData} from '@operation/types.ts';\n\nexport interface IProgressbarControllerOperationData {\n /**\n * @dependency\n */\n selectedElement: JQuery;\n /**\n * @dependency\n */\n textElement: JQuery;\n}\n\n/**\n * This controller renders a progressbar that displays the progress of the current timeline in the given selected element.\n *\n * The current progress as a percentage is rendered in the given text element.\n */\nexport class ProgressbarController extends BaseController<IProgressbarControllerOperationData> {\n name: string = 'ProgressbarController';\n selectedElement: JQuery | null = null;\n textElement: JQuery | null = null;\n duration: number = 0;\n\n init(operationData: TOperationData) {\n this.selectedElement = operationData.selectedElement;\n this.textElement = operationData.textElement;\n }\n\n attach(eventbus: IEventbus) {\n this.addListener(eventbus, 'timeline-time', this._positionUpdateHandler);\n\n eventbus.broadcast('timeline-duration-request', [\n (duration: number) => (this.duration = duration),\n ]);\n\n this.selectedElement?.css({'pointer-events': 'none'});\n\n const container = this.selectedElement?.parent();\n\n if (container) {\n const clickHandler = this._clickHandler.bind(this, eventbus);\n container.on('click', clickHandler);\n this.eventListeners.push(() => container.off('click', clickHandler));\n }\n }\n\n detach(eventbus: IEventbus) {\n super.detach(eventbus);\n }\n\n private _positionUpdateHandler(position: number) {\n const percentage = (100 / this.duration) * position;\n this.selectedElement?.css('width', `${percentage}%`);\n this.textElement?.text(`${Math.floor(percentage)}%`);\n }\n\n private _clickHandler(eventbus: IEventbus, event: any) {\n const element = event.target as HTMLElement;\n const rect = element.getBoundingClientRect();\n\n const x = event.clientX - rect.left; //x position within the element.\n\n const percentage = (100 / rect.width) * x;\n\n eventbus.broadcast('timeline-seek-request', [\n Math.round((this.duration / 100) * percentage),\n ]);\n }\n}\n","import {BaseController} from '@controllers/base-controller.ts';\nimport type {IEventbus} from '@eventbus/types.ts';\nimport type {TOperationData} from '@operation/types.ts';\n\nexport interface IRoutingControllerOperationData {\n /**\n * @required\n */\n json: any;\n}\n\n/**\n * This is a work in progress, do not use this yet please....\n */\nexport class RoutingController extends BaseController<IRoutingControllerOperationData> {\n name = 'RoutingController';\n navLookup: Record<string, any> = {};\n navVidIdLookup: Record<string, any> = {};\n navigation: any = null;\n eventbus: IEventbus | null = null;\n\n init(operationData: TOperationData) {\n this.navigation = this._buildNavigationData(operationData.json);\n }\n\n attach(eventbus: IEventbus) {\n this.addListener(\n eventbus,\n 'before-request-video-url',\n this._handleBeforeRequestVideoUrl\n );\n this.addListener(\n eventbus,\n 'push-history-state',\n this._handlePushHistoryState\n );\n this.eventbus = eventbus;\n window.onpopstate = this._handlePopstate.bind(this);\n\n const navId = this._getQueryVariable(0);\n if (navId) {\n const nav = this.navLookup[navId];\n const pos = +this._getQueryVariable(1);\n this.eventbus.broadcast('request-video-url', [\n nav.videoUrlIndex,\n pos,\n true,\n ]);\n } else {\n window.history.pushState(\n {navigationId: this.navigation[0].id},\n '',\n `#/${this.navigation[0].id}`\n );\n }\n }\n\n private _handlePopstate(event: any) {\n const navigationId = event.state\n ? event.state.navigationId\n : this.navigation[0].id;\n const position = event.state?.position ?? 0;\n const nav = this.navLookup[navigationId];\n this.eventbus?.broadcast('highlight-navigation', [nav.videoUrlIndex]);\n this.eventbus?.broadcast('request-video-url', [\n nav.videoUrlIndex,\n position,\n true,\n ]);\n }\n\n detach(eventbus: IEventbus) {\n super.detach(eventbus);\n window.onpopstate = null;\n this.eventbus = null;\n }\n\n private _handleBeforeRequestVideoUrl(\n _index: number,\n _requestedVideoPosition: number = 0,\n isHistoryRequest: boolean = false\n ) {\n isHistoryRequest =\n isHistoryRequest !== undefined ? isHistoryRequest : false;\n if (!isHistoryRequest) {\n const resultCallback = (item: any) => {\n this._pushState(item);\n };\n this.eventbus?.broadcast('request-current-navigation', [resultCallback]);\n }\n }\n\n private _getQueryVariable(variableIdx: number) {\n const href = window.location.href;\n const hashIndex = href.indexOf('#');\n if (hashIndex > -1) {\n const query = href.substring(hashIndex + 2);\n if (query) {\n const vars = query.split('/');\n return vars[variableIdx];\n }\n }\n return '';\n }\n\n private _handlePushHistoryState(state: any) {\n this._pushState(state);\n }\n\n private _pushState(state: any) {\n if (state?.navigationData?.visible) {\n let currentPosition = state.position !== undefined ? state.position : -1;\n if (currentPosition < 0) {\n const resultCallback = (position: number) => {\n currentPosition = position > 3 ? position - 3 : 0;\n };\n this.eventbus?.broadcast('request-current-video-position', [\n resultCallback,\n ]);\n }\n\n const currentState = window.history.state;\n if (\n currentState &&\n currentState.navigationId !== state.navigationData.id\n ) {\n window.history.pushState(\n {navigationId: state.navigationData.id, position: currentPosition},\n state.title,\n `#/${state.navigationData.id}/${currentPosition}`\n );\n } else if (\n currentState &&\n currentState.navigationId === state.navigationData.id\n ) {\n window.history.replaceState(\n {\n navigationId: currentState.navigationId,\n position: currentPosition,\n },\n state.title,\n `#/${currentState.navigationId}/${currentPosition}`\n );\n } else {\n window.history.pushState(\n {navigationId: state.navigationData.id, position: currentPosition},\n state.title,\n `#/${state.navigationData.id}/${currentPosition}`\n );\n }\n window.document.title = state.title;\n }\n }\n\n private _buildNavigationData(data: any) {\n const result: any[] = [];\n data.navigationData.forEach((nav: any, index: any) => {\n this.navLookup[nav.id] = nav;\n this.navVidIdLookup[nav.videoUrlIndex] = nav;\n nav.previous = data.navigationData[index - 1];\n });\n\n data.navigationData.forEach((nav: any, index: number) => {\n if (nav.nextId) {\n nav.next = this.navLookup[nav.nextId];\n delete nav.nextId;\n } else {\n nav.next = data.navigationData[index + 1];\n }\n });\n\n data.roots.forEach((id: string) => {\n const nav = this.navLookup[id];\n if (nav.children) {\n nav.children = nav.children.map((childId: string) => {\n return this.navLookup[childId];\n });\n }\n result.push(nav);\n });\n return result;\n }\n}\n","import {BaseController} from '@controllers/base-controller.ts';\nimport type {IEventbus} from '@eventbus/types.ts';\nimport type {\n IStrictDuration,\n ISubtitleCollection,\n TLanguageCode,\n} from '../types.ts';\n\nexport interface ISubtitlesControllerOperationData {\n /**\n * @dependency\n */\n selectedElement: JQuery;\n /**\n * @type=ParameterType:languagecode\n */\n language: TLanguageCode;\n /**\n * @type=ParameterType:array\n * @itemType=ParameterType:object\n */\n subtitleData: ISubtitleCollection[];\n}\n\nexport class SubtitlesController extends BaseController<ISubtitlesControllerOperationData> {\n actionLookup: Record<string, any> = {};\n currentLanguage: TLanguageCode | null = null;\n lastFunc: (() => void) | null = null;\n name = 'SubtitlesController';\n subtitleDurations: IStrictDuration[] | null = null;\n\n attach(eventbus: IEventbus) {\n this.addListener(eventbus, 'timeline-time', this.onTimeHandler);\n this.addListener(eventbus, 'timeline-seeked', this.onSeekedHandler);\n this.addListener(eventbus, 'language-change', this.languageChangeHandler);\n }\n\n detach(eventbus: IEventbus) {\n super.detach(eventbus);\n }\n\n languageChangeHandler(newLanguage: TLanguageCode) {\n this.currentLanguage = newLanguage;\n if (this.lastFunc) {\n this.lastFunc();\n }\n }\n\n removeTitle(container?: JQuery) {\n container?.empty();\n this.lastFunc = null;\n }\n\n onTimeHandler(position: number) {\n const func = this.actionLookup[position];\n if (func && this.lastFunc !== func) {\n this.lastFunc = func;\n func();\n }\n }\n\n onSeekedHandler(position: number, _duration: number) {\n const subtitleDuration = this.subtitleDurations?.find(\n x => x.start <= position && x.end >= position\n );\n\n const func = subtitleDuration\n ? this.actionLookup[subtitleDuration.start ?? -1]\n : undefined;\n if (func && this.lastFunc !== func) {\n this.lastFunc = func;\n func();\n } else if (!func) {\n this.removeTitle();\n }\n }\n\n setTitle(container: JQuery, titleLanguageLookup: Record<string, string>) {\n if (this.currentLanguage) {\n container.html(titleLanguageLookup[this.currentLanguage]);\n }\n }\n\n createActionLookup(\n operationData: ISubtitlesControllerOperationData,\n container: JQuery\n ) {\n const subtitleData = operationData.subtitleData;\n const titles = subtitleData[0].titles;\n const subtitleTimeLookup: Record<number, () => void> = {};\n\n for (let i = 0, ii = titles.length; i < ii; i++) {\n const titleLanguageLookup: Record<string, string> = {};\n\n for (let j = 0, jj = subtitleData.length; j < jj; j++) {\n const subs = subtitleData[j];\n titleLanguageLookup[subs.languageCode] = subs.titles[i].text;\n }\n\n subtitleTimeLookup[titles[i].duration.start] = this.setTitle.bind(\n this,\n container,\n titleLanguageLookup\n );\n subtitleTimeLookup[titles[i].duration.end] = this.removeTitle.bind(\n this,\n container\n );\n }\n\n return subtitleTimeLookup;\n }\n\n init(operationData: ISubtitlesControllerOperationData) {\n const container = operationData.selectedElement;\n this.removeTitle = this.removeTitle.bind(this, container);\n this.currentLanguage = operationData.language;\n this.actionLookup = this.createActionLookup(operationData, container);\n this.subtitleDurations = operationData.subtitleData?.[0].titles.map(\n x => x.duration\n );\n }\n}\n","export type {IDOMEventListenerControllerOperationData} from '@controllers/dom-event-listener-controller.ts';\nexport {DOMEventListenerController} from '@controllers/dom-event-listener-controller.ts';\nexport type {ILabelControllerMetadata} from '@controllers/label-controller.ts';\nexport {LabelController} from '@controllers/label-controller.ts';\nexport type {ILottieControllerMetadata} from '@controllers/lottie-controller.ts';\nexport {LottieController} from '@controllers/lottie-controller.ts';\nexport type {\n IMutationEventPayload,\n IMutationObserverControllerMetadata,\n} from '@controllers/mutation-observer-controller.ts';\nexport {MutationObserverController} from '@controllers/mutation-observer-controller.ts';\nexport type {INavigationControllerOperationData} from '@controllers/navigation-controller.ts';\nexport {NavigationController} from '@controllers/navigation-controller.ts';\nexport type {IProgressbarControllerOperationData} from '@controllers/progressbar-controller.ts';\nexport {ProgressbarController} from '@controllers/progressbar-controller.ts';\nexport type {IRoutingControllerOperationData} from '@controllers/routing-controller.ts';\nexport {RoutingController} from '@controllers/routing-controller.ts';\nexport type {ISubtitlesControllerOperationData} from '@controllers/subtitles-controller.ts';\nexport {SubtitlesController} from '@controllers/subtitles-controller.ts';\n","import { type IAddClassOperationData } from \"@operation/add-class.ts\";\nimport { type IOperationMetadata } from \"@operation/metadata/types.ts\";\n\nexport function addClass(): IOperationMetadata<IAddClassOperationData> {\n return {\n description: `This operation adds the specified class name to the specified selected element.`,\n category: `DOM`,\n dependentProperties: ['selectedElement'],\n properties: {\n className: {\n type: 'ParameterType:className',\n required: true,\n erased: true\n }\n },\n };\n}\n","import { type IAddControllerToElementOperationData } from \"@operation/add-controller-to-element.ts\";\nimport { type IOperationMetadata } from \"@operation/metadata/types.ts\";\nimport { type TOperationData } from \"@operation/types.ts\";\n\nexport function addControllerToElement(): IOperationMetadata<IAddControllerToElementOperationData<TOperationData>> {\n return {\n description: `This operation adds the specified controller instance to the given selected element.`,\n category: `Controller`,\n dependentProperties: ['selectedElement', 'controllerInstance'],\n };\n}\n","import { type IAddGlobalsToOperationData } from \"@operation/add-globals-to-operation.ts\";\nimport { type IOperationMetadata } from \"@operation/metadata/types.ts\";\n\nexport function addGlobalsToOperation(): IOperationMetadata<IAddGlobalsToOperationData> {\n return {\n description: `This operation adds the specified global property names to the current operation data.\nIt finally removes the \\`globalProperties\\` property from the current operation data.`,\n category: `Data`,\n properties: {\n globalProperties: {\n type: 'ParameterType:array',\n itemType: 'ParameterType:string',\n required: true,\n erased: true\n }\n },\n };\n}\n","import { type IAnimateWithClassOperationData } from \"@operation/animate-with-class.ts\";\nimport { type IOperationMetadata } from \"@operation/metadata/types.ts\";\n\nexport function animateWithClass(): IOperationMetadata<IAnimateWithClassOperationData> {\n return {\n description: `This operation adds the specified class name to the specified selected element and assumes that this\nclass triggers and animation on the selected element. It then waits for this animation to complete\nbefore it resolves.`,\n category: `Animation`,\n dependentProperties: ['selectedElement'],\n properties: {\n className: {\n type: 'ParameterType:className',\n required: true\n },\n removeClass: {\n type: [\n { value: 'undefined' },\n { value: 'false' },\n { value: 'true' }\n ]\n }\n },\n };\n}\n","import { type IAnimateOperationData } from \"@operation/animate.ts\";\nimport { type IOperationMetadata } from \"@operation/metadata/types.ts\";\n\nexport function animate(): IOperationMetadata<IAnimateOperationData> {\n return {\n description: `This operation animates the specified selected element with the given [jQuery animation](https://api.jquery.com/animate/) properties, duration and easing.\nIt resolves after the animation completes.`,\n category: `Animation`,\n dependentProperties: ['selectedElement'],\n properties: {\n animationEasing: {\n type: 'ParameterType:boolean',\n erased: true\n },\n animationProperties: {\n type: 'ParameterType:object',\n required: true,\n erased: true\n },\n animationDuration: {\n type: 'ParameterType:number',\n required: true,\n erased: true\n }\n },\n };\n}\n","import { type IAnnounceToScreenReaderOperationData } from \"@operation/announce-to-screen-reader.ts\";\nimport { type IOperationMetadata } from \"@operation/metadata/types.ts\";\n\nexport function announceToScreenReader(): IOperationMetadata<IAnnounceToScreenReaderOperationData> {\n return {\n description: `Announces a message to screen readers using an ARIA live region.`,\n category: `Accessibility`,\n properties: {\n message: {\n type: 'ParameterType:string',\n required: true,\n erased: true\n },\n priority: {\n type: [\n { value: 'undefined' },\n { value: 'polite' },\n { value: 'assertive' }\n ],\n erased: true\n }\n },\n };\n}\n","import { type IOperationMetadata } from \"@operation/metadata/types.ts\";\n\nexport function breakForEach(): IOperationMetadata<undefined> {\n return {\n description: `This operation should only be used within a loop, so between a {@link forEach} and {@link endForEach}\noperation. This operation immediately moves to the loop end index, effectively stopping the loop.`,\n category: `Control Flow`,\n };\n}\n","import { type IBroadcastEventOperationData } from \"@operation/broadcast-event.ts\";\nimport { type IOperationMetadata } from \"@operation/metadata/types.ts\";\n\nexport function broadcastEvent(): IOperationMetadata<IBroadcastEventOperationData> {\n return {\n description: `This operation broadcasts the given event through the eventbus, along with the\nevent arguments and optional event topic.`,\n category: `Utility`,\n properties: {\n eventArgs: {\n type: 'ParameterType:array',\n required: true,\n erased: true\n },\n eventTopic: {\n type: 'ParameterType:eventTopic',\n erased: true\n },\n eventName: {\n type: 'ParameterType:eventName',\n required: true,\n erased: true\n }\n },\n };\n}\n","import { type ICalcOperationData } from \"@operation/calc.ts\";\nimport { type IOperationMetadata } from \"@operation/metadata/types.ts\";\n\nexport function calc(): IOperationMetadata<ICalcOperationData> {\n return {\n description: `This operation calculates the given left and right hand operands using the specified operator.`,\n category: `Utility`,\n properties: {\n left: {\n type: 'ParameterType:number',\n required: true,\n erased: true\n },\n right: {\n type: 'ParameterType:number',\n required: true,\n erased: true\n },\n operator: {\n type: [\n { value: '+' },\n { value: '-' },\n { value: '*' },\n { value: '/' },\n { value: '%' },\n { value: '**' }\n ],\n required: true,\n erased: true\n }\n },\n outputProperties: {\n calculationResult: {\n type: [\n { value: 'undefined' },\n { value: 'number' }\n ]\n }\n }\n };\n}\n","import { type IClearElementOperationData } from \"@operation/clear-element.ts\";\nimport { type IOperationMetadata } from \"@operation/metadata/types.ts\";\n\nexport function clearElement(): IOperationMetadata<IClearElementOperationData> {\n return {\n description: `This operation removes all of the children from the given selected element.`,\n category: `DOM`,\n dependentProperties: ['selectedElement'],\n };\n}\n","import { type IClearOperationDataOperationData } from \"@operation/clear-operation-data.ts\";\nimport { type IOperationMetadata } from \"@operation/metadata/types.ts\";\n\nexport function clearOperationData(): IOperationMetadata<IClearOperationDataOperationData> {\n return {\n description: `This operation removes all of the properties on the current operation date.\nOr, if the \\`properties\\` property is set only removes the properties defined by that list.`,\n category: `Data`,\n properties: {\n properties: {\n type: [\n { value: 'undefined' },\n { value: 'string[]' }\n ],\n erased: true\n }\n },\n };\n}\n","import { type IClearStorageOperationData } from \"@operation/clear-storage.ts\";\nimport { type IOperationMetadata } from \"@operation/metadata/types.ts\";\n\nexport function clearStorage(): IOperationMetadata<IClearStorageOperationData> {\n return {\n description: `Clears data from browser storage (localStorage or sessionStorage).\n\nIf \\`key\\` is provided, removes only that key. If \\`key\\` is omitted, clears all storage.`,\n category: `Data`,\n properties: {\n key: {\n type: [\n { value: 'undefined' },\n { value: 'string' }\n ],\n erased: true\n },\n storageType: {\n type: [\n { value: 'local' },\n { value: 'session' }\n ],\n required: true,\n erased: true\n }\n },\n };\n}\n","import { type ICompareDateOperationData } from \"@operation/compare-date.ts\";\nimport { type IOperationMetadata } from \"@operation/metadata/types.ts\";\n\nexport function compareDate(): IOperationMetadata<ICompareDateOperationData> {\n return {\n description: `Compares two dates.\ncomparison: -1 (before), 0 (equal), 1 (after)`,\n category: `Date`,\n properties: {\n date1: {\n type: [\n { value: 'string' },\n { value: 'number' },\n { value: 'Date' }\n ],\n required: true,\n erased: true\n },\n date2: {\n type: [\n { value: 'string' },\n { value: 'number' },\n { value: 'Date' }\n ],\n required: true,\n erased: true\n }\n },\n outputProperties: {\n comparison: {\n type: 'ParameterType:number'\n },\n isEqual: {\n type: 'ParameterType:boolean'\n },\n isBefore: {\n type: 'ParameterType:boolean'\n },\n isAfter: {\n type: 'ParameterType:boolean'\n }\n }\n };\n}\n","import { type IConcatenateStringsOperationData } from \"@operation/concatenate-strings.ts\";\nimport { type IOperationMetadata } from \"@operation/metadata/types.ts\";\n\nexport function concatenateStrings(): IOperationMetadata<IConcatenateStringsOperationData> {\n return {\n description: `Concatenates multiple strings with an optional separator.`,\n category: `String`,\n properties: {\n strings: {\n type: 'ParameterType:array',\n itemType: 'ParameterType:string',\n required: true,\n erased: true\n },\n separator: {\n type: [\n { value: 'undefined' },\n { value: 'string' }\n ],\n erased: true\n }\n },\n outputProperties: {\n result: {\n type: 'ParameterType:string'\n }\n }\n };\n}\n","import { type IOperationMetadata } from \"@operation/metadata/types.ts\";\n\nexport function continueForEach(): IOperationMetadata<undefined> {\n return {\n description: `This operation should only be used within a loop, so between a {@link forEach} and {@link endForEach}\noperation. This operation immediately moves to the next loop index, effectively canceling the rest\nof the operations in the current iteration.`,\n category: `Control Flow`,\n };\n}\n","import { type ICreateElementOperationData, type TTagNames } from \"@operation/create-element.ts\";\nimport { type IOperationMetadata } from \"@operation/metadata/types.ts\";\n\nexport function createElement(): IOperationMetadata<ICreateElementOperationData<TTagNames>> {\n return {\n description: `This operation creates the DOM element described by the given elementName and attributes and assigns\nthe instance to the \\`template\\` property on the current operation data.`,\n category: `DOM`,\n properties: {\n elementName: {\n type: 'ParameterType:htmlElementName',\n required: true,\n erased: true\n },\n text: {\n type: [\n { value: 'undefined' },\n { value: 'string' }\n ],\n erased: true\n },\n attributes: {\n type: 'ParameterType:object',\n erased: true\n }\n },\n outputProperties: {\n template: {\n type: 'ParameterType:object'\n }\n }\n };\n}\n","import { type ICustomFunctionOperationData } from \"@operation/custom-function.ts\";\nimport { type IOperationMetadata } from \"@operation/metadata/types.ts\";\n\nexport function customFunction(): IOperationMetadata<ICustomFunctionOperationData> {\n return {\n description: `This operation retrieves a custom function defined by the given system name\nand invokes it with the current operation data and eventbus.`,\n category: `Utility`,\n properties: {\n systemName: {\n type: 'ParameterType:systemName',\n required: true,\n erased: true\n }\n },\n };\n}\n","import { type IEndActionOperationData } from \"@operation/end-action.ts\";\nimport { type IOperationMetadata } from \"@operation/metadata/types.ts\";\n\nexport function endAction(): IOperationMetadata<IEndActionOperationData> {\n return {\n description: `This operation invokes the {@link EndableAction}.end method on the specified action instance.\n\nThe action operation data is first merged with the current operation data before it is\npassed on to the action. After the action has completed the action operation data properties\nare removed from the current operation data.`,\n category: `Action`,\n dependentProperties: ['actionInstance'],\n properties: {\n actionOperationData: {\n type: 'ParameterType:object',\n required: true,\n erased: true\n }\n },\n };\n}\n","import { type IOperationMetadata } from \"@operation/metadata/types.ts\";\n\nexport function endForEach(): IOperationMetadata<undefined> {\n return {\n description: `This operation checks if the current loop should end or start the next iteration.`,\n category: `Control Flow`,\n };\n}\n","import { type IOperationMetadata } from \"@operation/metadata/types.ts\";\n\nexport function endWhen(): IOperationMetadata<undefined> {\n return {\n description: `This operation cleans up after the {@link when}/{@link otherwise}/{@link endWhen} control flow ends.`,\n category: `Control Flow`,\n };\n}\n","import { type IExtendControllerOperationData } from \"@operation/extend-controller.ts\";\nimport { type IOperationMetadata } from \"@operation/metadata/types.ts\";\n\nexport function extendController(): IOperationMetadata<IExtendControllerOperationData> {\n return {\n description: `Extends the current controller with given extension.`,\n category: `Controller`,\n dependentProperties: ['controllerInstance'],\n properties: {\n controllerExtension: {\n type: 'ParameterType:object',\n required: true,\n erased: true\n }\n },\n };\n}\n","import { type IFilterArrayOperationData } from \"@operation/filter-array.ts\";\nimport { type IOperationMetadata } from \"@operation/metadata/types.ts\";\n\nexport function filterArray(): IOperationMetadata<IFilterArrayOperationData> {\n return {\n description: `Filters an array based on property equality or custom predicate function.\n\nOperates on arrayData passed from previous operations.\nSupports two filtering modes:\n1. Property equality: \\`filterProperty\\` and \\`filterValue\\` to filter by property match\n2. Custom predicate: \\`filterPredicate\\` function for complex filtering logic`,\n category: `Array`,\n dependentProperties: ['arrayData'],\n properties: {\n filterProperty: {\n type: [\n { value: 'undefined' },\n { value: 'string' }\n ],\n erased: true\n },\n filterValue: {\n type: 'ParameterType:object',\n erased: true\n },\n filterPredicate: {\n type: [\n { value: 'undefined' },\n { value: '(item: any, index?: number | undefined) => boolean' }\n ],\n erased: true\n }\n },\n outputProperties: {\n filteredArray: {\n type: 'ParameterType:array'\n }\n }\n };\n}\n","import { type IFindInArrayOperationData } from \"@operation/find-in-array.ts\";\nimport { type IOperationMetadata } from \"@operation/metadata/types.ts\";\n\nexport function findInArray(): IOperationMetadata<IFindInArrayOperationData> {\n return {\n description: `Finds the first element in an array matching criteria.\n\nOperates on arrayData passed from previous operations.\nSupports two search modes:\n1. Property equality: \\`findProperty\\` and \\`findValue\\` to find by property match\n2. Custom predicate: \\`findPredicate\\` function for complex search logic\n\nReturns \\`undefined\\` for \\`foundItem\\` and \\`-1\\` for \\`foundIndex\\` if no match found.`,\n category: `Array`,\n dependentProperties: ['arrayData'],\n properties: {\n findProperty: {\n type: [\n { value: 'undefined' },\n { value: 'string' }\n ],\n erased: true\n },\n findValue: {\n type: 'ParameterType:object',\n erased: true\n },\n findPredicate: {\n type: [\n { value: 'undefined' },\n { value: '(item: any, index?: number | undefined) => boolean' }\n ],\n erased: true\n }\n },\n outputProperties: {\n foundItem: {\n type: 'ParameterType:object'\n },\n foundIndex: {\n type: 'ParameterType:number'\n }\n }\n };\n}\n","import { type IForEachOperationData } from \"@operation/for-each.ts\";\nimport { type IOperationMetadata } from \"@operation/metadata/types.ts\";\n\nexport function forEach(): IOperationMetadata<IForEachOperationData> {\n return {\n description: `This operation iterates over the given collection.\n\nEach iteration the current item from the specified collection is\nassigned to the {@link IOperationScope.currentItem |currentItem} property on the {@link IOperationScope |operation scope}.\n\nAt the start of the loop, the associated {@link endForEach} operation is determined and when\nthe last iteration is completed the flow control is set to the index of that operation.\n\nThe {@link continueForEach |continue} and {@link breakForEach |break} operations can be used to control the\nloop iterations.`,\n category: `Control Flow`,\n properties: {\n collection: {\n type: 'ParameterType:array|ParameterType:string',\n required: true\n }\n },\n };\n}\n","import { type IFormatDateOperationData } from \"@operation/format-date.ts\";\nimport { type IOperationMetadata } from \"@operation/metadata/types.ts\";\n\nexport function formatDate(): IOperationMetadata<IFormatDateOperationData> {\n return {\n description: `Formats a date using Intl.DateTimeFormat or simple patterns.`,\n category: `Date`,\n dependentProperties: ['date'],\n properties: {\n format: {\n type: 'ParameterType:string',\n required: true,\n erased: true\n }\n },\n outputProperties: {\n formattedDate: {\n type: 'ParameterType:string'\n }\n }\n };\n}\n","import { type IFormatTextOperationData } from \"@operation/format-text.ts\";\nimport { type IOperationMetadata } from \"@operation/metadata/types.ts\";\n\nexport function formatText(): IOperationMetadata<IFormatTextOperationData> {\n return {\n description: `Transforms text using format operations: uppercase, lowercase, capitalize, titlecase, or trim.\n\nOperates on textContent passed from previous operations (e.g., getTextContent).\n\nTransformations:\n- \\`uppercase\\`: Convert all characters to uppercase\n- \\`lowercase\\`: Convert all characters to lowercase\n- \\`capitalize\\`: Capitalize only the first letter\n- \\`titlecase\\`: Capitalize first letter of each word\n- \\`trim\\`: Remove leading and trailing whitespace`,\n category: `Text`,\n dependentProperties: ['textContent'],\n properties: {\n transformation: {\n type: [\n { value: 'uppercase' },\n { value: 'lowercase' },\n { value: 'capitalize' },\n { value: 'titlecase' },\n { value: 'trim' }\n ],\n required: true,\n erased: true\n }\n },\n outputProperties: {\n formattedText: {\n type: 'ParameterType:string'\n }\n }\n };\n}\n","import { type IGetAttributesFromElementOperationData } from \"@operation/get-attributes-from-element.ts\";\nimport { type IOperationMetadata } from \"@operation/metadata/types.ts\";\n\nexport function getAttributesFromElement(): IOperationMetadata<IGetAttributesFromElementOperationData> {\n return {\n description: `This operation retrieves the values for the specified attribute names from the given selected element.`,\n category: `DOM`,\n dependentProperties: ['selectedElement'],\n properties: {\n attributeNames: {\n type: 'ParameterType:array',\n itemType: 'ParameterType:string',\n required: true,\n erased: true\n }\n },\n outputProperties: {\n attributeValues: {\n type: [\n { value: 'undefined' },\n { value: 'Record<string, unknown>' }\n ]\n }\n }\n };\n}\n","import { type IGetControllerFromElementOperationData } from \"@operation/get-controller-from-element.ts\";\nimport { type IOperationMetadata } from \"@operation/metadata/types.ts\";\n\nexport function getControllerFromElement(): IOperationMetadata<IGetControllerFromElementOperationData> {\n return {\n description: `This operation retrieves the controller instance with the specified name that is assigned to the given selected element.`,\n category: `Controller`,\n dependentProperties: ['selectedElement'],\n properties: {\n controllerName: {\n type: 'ParameterType:controllerName',\n required: true,\n erased: true\n }\n },\n outputProperties: {\n controllerInstance: {\n type: 'ParameterType:object'\n }\n }\n };\n}\n","import { type IGetControllerInstanceOperationData } from \"@operation/get-controller-instance.ts\";\nimport { type IOperationMetadata } from \"@operation/metadata/types.ts\";\n\nexport function getControllerInstance(): IOperationMetadata<IGetControllerInstanceOperationData> {\n return {\n description: `This operation retrieves an instance of the given controller name.\nIt assigns this instance to the \\`controllerInstance\\` property on the current operation data`,\n category: `Controller`,\n properties: {\n systemName: {\n type: [\n { value: 'DOMEventListenerController' },\n { value: 'LabelController' },\n { value: 'LottieController' },\n { value: 'MutationObserverController' },\n { value: 'NavigationController' },\n { value: 'ProgressbarController' },\n { value: 'RoutingController' },\n { value: 'SubtitlesController' }\n ],\n required: true,\n erased: true\n }\n },\n outputProperties: {\n controllerInstance: {\n type: 'ParameterType:object'\n }\n }\n };\n}\n","import { type IGetCurrentTimeOperationData } from \"@operation/get-current-time.ts\";\nimport { type IOperationMetadata } from \"@operation/metadata/types.ts\";\n\nexport function getCurrentTime(): IOperationMetadata<IGetCurrentTimeOperationData> {\n return {\n description: `Gets the current time as timestamp and Date object.`,\n category: `Date`,\n outputProperties: {\n timestamp: {\n type: 'ParameterType:number'\n },\n date: {\n type: 'ParameterType:Date'\n }\n }\n };\n}\n","import { type IGetElementDimensionsOperationData } from \"@operation/get-element-dimensions.ts\";\nimport { type IOperationMetadata } from \"@operation/metadata/types.ts\";\n\nexport function getElementDimensions(): IOperationMetadata<IGetElementDimensionsOperationData> {\n return {\n description: `This operation calculates the width and height of the given selected element.\nIt assigns this struct to the dimensions property on the current operation data.\nOptionally the width and height can be modified using the given modifier string.\n\nThe modifier string is formatted in the following way:\n\n<operator><amount><optional-side><optional-precentage>|<ratio-definition>\n\nWhere the ratio modifier is formatted in the following way:\n<side>[ar=<ratio-left>-<ratio-right>]\n\nFor example, this modifier '+100h|w[ar=8-1]' will modifiy the dimensions like this:\nit will add a value of 100 to the height and modify the width by a ratio of 8 to 1 relative to the height.`,\n category: `DOM`,\n dependentProperties: ['selectedElement'],\n properties: {\n modifier: {\n type: 'ParameterType:dimensionsModifier',\n erased: true\n }\n },\n outputProperties: {\n dimensions: {\n type: 'ParameterType:object'\n }\n }\n };\n}\n","import { type IGetFocusedElementOperationData } from \"@operation/get-focused-element.ts\";\nimport { type IOperationMetadata } from \"@operation/metadata/types.ts\";\n\nexport function getFocusedElement(): IOperationMetadata<IGetFocusedElementOperationData> {\n return {\n description: `Gets the currently focused element.`,\n category: `Focus`,\n outputProperties: {\n focusedElement: {\n type: 'ParameterType:jQuery'\n }\n }\n };\n}\n","import { type IGetFormDataOperationData } from \"@operation/get-form-data.ts\";\nimport { type IOperationMetadata } from \"@operation/metadata/types.ts\";\n\nexport function getFormData(): IOperationMetadata<IGetFormDataOperationData> {\n return {\n description: `Extracts all input, select, and textarea values from form element into operation data.\n\nThis operation reads form field values and returns them as an object with field names as keys.\nOnly processes form elements that are enabled and not hidden. Handles checkboxes, radio buttons,\nselect elements, textareas, and text inputs.`,\n category: `Form`,\n dependentProperties: ['selectedElement'],\n outputProperties: {\n formData: {\n type: 'ParameterType:object'\n }\n }\n };\n}\n","import { type IGetImportOperationData } from \"@operation/get-import.ts\";\nimport { type IOperationMetadata } from \"@operation/metadata/types.ts\";\n\nexport function getImport(): IOperationMetadata<IGetImportOperationData> {\n return {\n description: `This operation retrieves the import specified by the given \\`systemName\\` and\nassigns it to the \\`importedInstance\\` property on the current operaton date.`,\n category: `Utility`,\n properties: {\n systemName: {\n type: 'ParameterType:systemName',\n required: true,\n erased: true\n }\n },\n outputProperties: {\n importedInstance: {\n type: 'ParameterType:object'\n }\n }\n };\n}\n","import { type IGetQueryParamsOperationData } from \"@operation/get-query-params.ts\";\nimport { type IOperationMetadata } from \"@operation/metadata/types.ts\";\n\nexport function getQueryParams(): IOperationMetadata<IGetQueryParamsOperationData> {\n return {\n description: `This operation retrieves the current query parameters from the browser's address bar and places\nthem on the returned operation data.`,\n category: `Utility`,\n properties: {\n defaultValues: {\n type: [\n { value: 'undefined' },\n { value: 'Record<string, string>' }\n ],\n erased: true\n }\n },\n outputProperties: {\n queryParams: {\n type: [\n { value: 'undefined' },\n { value: 'Record<string, string>' }\n ]\n }\n }\n };\n}\n","import { type IGetScrollPositionOperationData } from \"@operation/get-scroll-position.ts\";\nimport { type IOperationMetadata } from \"@operation/metadata/types.ts\";\n\nexport function getScrollPosition(): IOperationMetadata<IGetScrollPositionOperationData> {\n return {\n description: `Gets the current scroll position of the viewport.\n\nReturns x (horizontal) and y (vertical) scroll positions in pixels.\nUses cross-browser compatible methods to retrieve scroll position.`,\n category: `Scroll`,\n outputProperties: {\n scrollX: {\n type: 'ParameterType:number'\n },\n scrollY: {\n type: 'ParameterType:number'\n }\n }\n };\n}\n","import { type IGetTextContentOperationData } from \"@operation/get-text-content.ts\";\nimport { type IOperationMetadata } from \"@operation/metadata/types.ts\";\n\nexport function getTextContent(): IOperationMetadata<IGetTextContentOperationData> {\n return {\n description: `Extracts text content from element, stripping all HTML markup.\n\nUses jQuery's \\`.text()\\` method which is XSS-safe and returns only the text content\nwithout any HTML tags. Preserves whitespace and text from nested elements.`,\n category: `Text`,\n dependentProperties: ['selectedElement'],\n outputProperties: {\n textContent: {\n type: [\n { value: 'undefined' },\n { value: 'string' }\n ]\n }\n }\n };\n}\n","import { type IHttpDeleteOperationData } from \"@operation/http-delete.ts\";\nimport { type IOperationMetadata } from \"@operation/metadata/types.ts\";\n\nexport function httpDelete(): IOperationMetadata<IHttpDeleteOperationData> {\n return {\n description: `Performs an HTTP DELETE request to the specified URL.`,\n category: `HTTP`,\n properties: {\n url: {\n type: 'ParameterType:string',\n required: true,\n erased: true\n },\n headers: {\n type: [\n { value: 'undefined' },\n { value: 'Record<string, string>' }\n ],\n erased: true\n }\n },\n outputProperties: {\n response: {\n type: 'ParameterType:object'\n },\n status: {\n type: 'ParameterType:number'\n }\n }\n };\n}\n","import { type IHttpPostOperationData } from \"@operation/http-post.ts\";\nimport { type IOperationMetadata } from \"@operation/metadata/types.ts\";\n\nexport function httpPost(): IOperationMetadata<IHttpPostOperationData> {\n return {\n description: `Performs an HTTP POST request to the specified URL.`,\n category: `HTTP`,\n properties: {\n url: {\n type: 'ParameterType:string',\n required: true,\n erased: true\n },\n body: {\n type: 'ParameterType:object',\n erased: true\n },\n headers: {\n type: [\n { value: 'undefined' },\n { value: 'Record<string, string>' }\n ],\n erased: true\n }\n },\n outputProperties: {\n response: {\n type: 'ParameterType:object'\n },\n status: {\n type: 'ParameterType:number'\n }\n }\n };\n}\n","import { type IHttpPutOperationData } from \"@operation/http-put.ts\";\nimport { type IOperationMetadata } from \"@operation/metadata/types.ts\";\n\nexport function httpPut(): IOperationMetadata<IHttpPutOperationData> {\n return {\n description: `Performs an HTTP PUT request to the specified URL.`,\n category: `HTTP`,\n properties: {\n url: {\n type: 'ParameterType:string',\n required: true,\n erased: true\n },\n body: {\n type: 'ParameterType:object',\n erased: true\n },\n headers: {\n type: [\n { value: 'undefined' },\n { value: 'Record<string, string>' }\n ],\n erased: true\n }\n },\n outputProperties: {\n response: {\n type: 'ParameterType:object'\n },\n status: {\n type: 'ParameterType:number'\n }\n }\n };\n}\n","import { type IInvokeObjectMethodOperationData } from \"@operation/invoke-object-method.ts\";\nimport { type IOperationMetadata } from \"@operation/metadata/types.ts\";\n\nexport function invokeObjectMethod(): IOperationMetadata<IInvokeObjectMethodOperationData> {\n return {\n description: `This operation invokes the specified method on the given object with the given optional arguments\nand assigns the result to the \\`methodResult\\` operationdata property.`,\n category: `Utility`,\n dependentProperties: ['instance'],\n properties: {\n methodName: {\n type: 'ParameterType:string',\n required: true,\n erased: true\n },\n methodArguments: {\n type: [\n { value: 'undefined' },\n { value: 'unknown[]' }\n ],\n erased: true\n }\n },\n outputProperties: {\n methodResult: {\n type: 'ParameterType:object'\n }\n }\n };\n}\n","import { type IIsElementInViewportOperationData } from \"@operation/is-element-in-viewport.ts\";\nimport { type IOperationMetadata } from \"@operation/metadata/types.ts\";\n\nexport function isElementInViewport(): IOperationMetadata<IIsElementInViewportOperationData> {\n return {\n description: `Checks if an element is currently visible within the viewport.\n\nUses \\`getBoundingClientRect()\\` to determine if the element is within the viewport boundaries.`,\n category: `DOM`,\n dependentProperties: ['selectedElement'],\n outputProperties: {\n isInViewport: {\n type: 'ParameterType:boolean'\n }\n }\n };\n}\n","import { type ILoadFromStorageOperationData } from \"@operation/load-from-storage.ts\";\nimport { type IOperationMetadata } from \"@operation/metadata/types.ts\";\n\nexport function loadFromStorage(): IOperationMetadata<ILoadFromStorageOperationData> {\n return {\n description: `Loads data from browser storage (localStorage or sessionStorage).\n\nDeserializes the stored JSON value. Returns \\`null\\` if key doesn't exist.`,\n category: `Data`,\n properties: {\n key: {\n type: 'ParameterType:string',\n required: true,\n erased: true\n },\n storageType: {\n type: [\n { value: 'local' },\n { value: 'session' }\n ],\n required: true,\n erased: true\n }\n },\n outputProperties: {\n loadedValue: {\n type: 'ParameterType:object'\n }\n }\n };\n}\n","import { type ILoadJSONOperationData } from \"@operation/load-json.ts\";\nimport { type IOperationMetadata } from \"@operation/metadata/types.ts\";\n\nexport function loadJson(): IOperationMetadata<ILoadJSONOperationData> {\n return {\n description: `This operation loads a JSON file from the specified url and assigns it to the json\nproperty on the current operation data.\n\nIf the cache property is set to true and a cached value already exists, this is assigned\ninstead of re-retrieving it from the url.`,\n category: `Utility`,\n properties: {\n url: {\n type: 'ParameterType:string',\n required: true,\n erased: true\n },\n cache: {\n type: [\n { value: 'undefined' },\n { value: 'false' },\n { value: 'true' }\n ],\n erased: true\n }\n },\n outputProperties: {\n json: {\n type: 'ParameterType:object'\n }\n }\n };\n}\n","import { type ILogOperationData } from \"@operation/log.ts\";\nimport { type IOperationMetadata } from \"@operation/metadata/types.ts\";\n\nexport function log(): IOperationMetadata<ILogOperationData> {\n return {\n description: `This operation logs the specified value, or, when no logValue property has been assigned\nit will log the current operation data, global data and scope to the console`,\n category: `Utility`,\n properties: {\n logValue: {\n type: 'ParameterType:object|ParameterType:string|ParameterType:number|ParameterType:boolean|ParameterType:array',\n erased: true\n },\n logName: {\n type: [\n { value: 'undefined' },\n { value: 'string' }\n ],\n erased: true\n }\n },\n };\n}\n","import { type IMapArrayOperationData } from \"@operation/map-array.ts\";\nimport { type IOperationMetadata } from \"@operation/metadata/types.ts\";\n\nexport function mapArray(): IOperationMetadata<IMapArrayOperationData> {\n return {\n description: `Transforms each element of an array using a mapping function.\n\nOperates on arrayData passed from previous operations.\nThe mapFunction receives each item and optionally its index.`,\n category: `Array`,\n dependentProperties: ['arrayData'],\n properties: {\n mapFunction: {\n type: 'ParameterType:function',\n required: true,\n erased: true\n }\n },\n outputProperties: {\n mappedArray: {\n type: [\n { value: 'undefined' },\n { value: 'any[]' }\n ]\n }\n }\n };\n}\n","import { type IMathOperationData } from \"@operation/math.ts\";\nimport { type IOperationMetadata } from \"@operation/metadata/types.ts\";\n\nexport function math(): IOperationMetadata<IMathOperationData> {\n return {\n description: `This operation performs the given math function with the specified arguments.`,\n category: `Utility`,\n properties: {\n args: {\n type: 'ParameterType:array',\n required: true,\n erased: true\n },\n functionName: {\n type: 'ParameterType:mathfunction',\n required: true,\n erased: true\n }\n },\n outputProperties: {\n mathResult: {\n type: [\n { value: 'undefined' },\n { value: 'number' }\n ]\n }\n }\n };\n}\n","import { type IOperationMetadata } from \"@operation/metadata/types.ts\";\n\nexport function otherwise(): IOperationMetadata<undefined> {\n return {\n description: `If the preceeding {@link when} operation evaluates to \\`true\\` subsequent operations will\nbe skipped until an {@link endWhen} operation is encountered.`,\n category: `Control Flow`,\n };\n}\n","import { type IOperationMetadata } from \"@operation/metadata/types.ts\";\nimport { type IRemoveClassOperationData } from \"@operation/remove-class.ts\";\n\nexport function removeClass(): IOperationMetadata<IRemoveClassOperationData> {\n return {\n description: `This operation removes the spcified class name from the given selected element.`,\n category: `DOM`,\n dependentProperties: ['selectedElement'],\n properties: {\n className: {\n type: 'ParameterType:className',\n required: true,\n erased: true\n }\n },\n };\n}\n","import { type IOperationMetadata } from \"@operation/metadata/types.ts\";\nimport { type IRemoveControllerFromElementOperationData } from \"@operation/remove-controller-from-element.ts\";\n\nexport function removeControllerFromElement(): IOperationMetadata<IRemoveControllerFromElementOperationData> {\n return {\n description: `This operation removes the controller with the specified name from the given selected element.`,\n category: `Controller`,\n dependentProperties: ['selectedElement'],\n properties: {\n controllerName: {\n type: 'ParameterType:controllerName',\n required: true,\n erased: true\n }\n },\n };\n}\n","import { type IOperationMetadata } from \"@operation/metadata/types.ts\";\nimport { type IRemoveElementOperationData } from \"@operation/remove-element.ts\";\n\nexport function removeElement(): IOperationMetadata<IRemoveElementOperationData> {\n return {\n description: `This operation removes the given selected element from the DOM.`,\n category: `DOM`,\n dependentProperties: ['selectedElement'],\n };\n}\n","import { type IOperationMetadata } from \"@operation/metadata/types.ts\";\nimport { type IRemovePropertiesFromOperationDataOperationData } from \"@operation/remove-properties-from-operation-data.ts\";\n\nexport function removePropertiesFromOperationData(): IOperationMetadata<IRemovePropertiesFromOperationDataOperationData> {\n return {\n description: `This operation removes the given list of properties from the current operation data.\nIt will also remove the property \\`propertyNames\\` from the result.`,\n category: `Data`,\n properties: {\n propertyNames: {\n type: 'ParameterType:array',\n itemType: 'ParameterType:string',\n required: true,\n erased: true\n }\n },\n };\n}\n","import { type IOperationMetadata } from \"@operation/metadata/types.ts\";\nimport { type IReparentElementOperationData } from \"@operation/reparent-element.ts\";\n\nexport function reparentElement(): IOperationMetadata<IReparentElementOperationData> {\n return {\n description: `This operation moves the given selected element to the new parent that is defined\nby the specified \\`newParentSelector\\`.`,\n category: `DOM`,\n dependentProperties: ['selectedElement'],\n properties: {\n newParentSelector: {\n type: 'ParameterType:selector',\n required: true,\n erased: true\n }\n },\n };\n}\n","import { type IOperationMetadata } from \"@operation/metadata/types.ts\";\nimport { type IReplaceStringOperationData } from \"@operation/replace-string.ts\";\n\nexport function replaceString(): IOperationMetadata<IReplaceStringOperationData> {\n return {\n description: `Replaces occurrences of a pattern in a string (alias for replaceText for string context).`,\n category: `String`,\n dependentProperties: ['textContent'],\n properties: {\n pattern: {\n type: [\n { value: 'string' },\n { value: 'RegExp' }\n ],\n required: true,\n erased: true\n },\n replacement: {\n type: 'ParameterType:string',\n required: true,\n erased: true\n }\n },\n outputProperties: {\n result: {\n type: 'ParameterType:string'\n }\n }\n };\n}\n","import { type IOperationMetadata } from \"@operation/metadata/types.ts\";\nimport { type IReplaceTextOperationData } from \"@operation/replace-text.ts\";\n\nexport function replaceText(): IOperationMetadata<IReplaceTextOperationData> {\n return {\n description: `Finds and replaces text using literal string or regex pattern.\n\nOperates on textContent passed from previous operations (e.g., getTextContent).\nSupports regex patterns with global flag for multiple replacements.\nUpdates textContent with replaced text and sets replacementCount.`,\n category: `Text`,\n dependentProperties: ['textContent'],\n properties: {\n searchPattern: {\n type: [\n { value: 'string' },\n { value: 'RegExp' }\n ],\n required: true,\n erased: true\n },\n replacement: {\n type: 'ParameterType:string',\n required: true,\n erased: true\n }\n },\n outputProperties: {\n replacementCount: {\n type: 'ParameterType:number'\n }\n }\n };\n}\n","import { type IOperationMetadata } from \"@operation/metadata/types.ts\";\nimport { type IRequestActionOperationData } from \"@operation/request-action.ts\";\n\nexport function requestAction(): IOperationMetadata<IRequestActionOperationData> {\n return {\n description: `This operation requests an action instance with the specified name and assigns it\nto the \\`actionInstance\\` property on the current operation data.`,\n category: `Action`,\n properties: {\n systemName: {\n type: 'ParameterType:actionName',\n required: true,\n erased: true\n }\n },\n outputProperties: {\n actionInstance: {\n type: 'ParameterType:object'\n }\n }\n };\n}\n","import { type IOperationMetadata } from \"@operation/metadata/types.ts\";\nimport { type ISaveToStorageOperationData } from \"@operation/save-to-storage.ts\";\n\nexport function saveToStorage(): IOperationMetadata<ISaveToStorageOperationData> {\n return {\n description: `Saves data to browser storage (localStorage or sessionStorage).\n\nSerializes the value as JSON before storing. Supports any JSON-serializable data type.`,\n category: `Data`,\n properties: {\n key: {\n type: 'ParameterType:string',\n required: true,\n erased: true\n },\n value: {\n type: 'ParameterType:object',\n required: true,\n erased: true\n },\n storageType: {\n type: [\n { value: 'local' },\n { value: 'session' }\n ],\n required: true,\n erased: true\n }\n },\n };\n}\n","import { type IOperationMetadata } from \"@operation/metadata/types.ts\";\nimport { type IScrollToElementOperationData } from \"@operation/scroll-to-element.ts\";\n\nexport function scrollToElement(): IOperationMetadata<IScrollToElementOperationData> {\n return {\n description: `Scrolls the viewport to bring the selected element into view.\n\nUses the browser's \\`scrollIntoView\\` API with configurable behavior.`,\n category: `Scroll`,\n dependentProperties: ['selectedElement'],\n properties: {\n behavior: {\n type: [\n { value: 'undefined' },\n { value: 'auto' },\n { value: 'smooth' }\n ],\n erased: true\n },\n block: {\n type: [\n { value: 'undefined' },\n { value: 'start' },\n { value: 'center' },\n { value: 'end' },\n { value: 'nearest' }\n ],\n erased: true\n },\n inline: {\n type: [\n { value: 'undefined' },\n { value: 'start' },\n { value: 'center' },\n { value: 'end' },\n { value: 'nearest' }\n ],\n erased: true\n }\n },\n };\n}\n","import { type IOperationMetadata } from \"@operation/metadata/types.ts\";\nimport { type IScrollToPositionOperationData } from \"@operation/scroll-to-position.ts\";\n\nexport function scrollToPosition(): IOperationMetadata<IScrollToPositionOperationData> {\n return {\n description: `Scrolls the viewport to a specific x,y coordinate position.\n\nUses the browser's \\`window.scrollTo\\` API with configurable behavior.`,\n category: `Scroll`,\n properties: {\n x: {\n type: 'ParameterType:number',\n required: true,\n erased: true\n },\n y: {\n type: 'ParameterType:number',\n required: true,\n erased: true\n },\n behavior: {\n type: [\n { value: 'undefined' },\n { value: 'auto' },\n { value: 'smooth' }\n ],\n erased: true\n }\n },\n };\n}\n","import { type IOperationMetadata } from \"@operation/metadata/types.ts\";\nimport { type ISelectElementOperationData } from \"@operation/select-element.ts\";\n\nexport function selectElement(): IOperationMetadata<ISelectElementOperationData> {\n return {\n description: `This operation selects one or more elements using the specified selector.\n\nIf \\`useSelectedElementAsRoot\\` is set to true and a valid DOM element is assigned\nto the current operation data's \\`selectedElement\\` property\nthen the element will be looked for only in the descendant elements of this DOM element.`,\n category: `DOM`,\n properties: {\n selector: {\n type: 'ParameterType:selector',\n required: true,\n erased: true\n },\n useSelectedElementAsRoot: {\n type: [\n { value: 'undefined' },\n { value: 'false' },\n { value: 'true' }\n ],\n erased: true\n }\n },\n outputProperties: {\n selectedElement: {\n type: 'ParameterType:object'\n }\n }\n };\n}\n","import { type IOperationMetadata } from \"@operation/metadata/types.ts\";\nimport { type ISetDataOperationData } from \"@operation/set-data.ts\";\n\nexport function setData(): IOperationMetadata<ISetDataOperationData> {\n return {\n description: `This operation assigns the specified properties to the specified data targets.`,\n category: `Data`,\n properties: {\n properties: {\n type: 'ParameterType:object',\n required: true,\n erased: true\n }\n },\n };\n}\n","import { type IOperationMetadata } from \"@operation/metadata/types.ts\";\nimport { type ISetElementAttributesOperationData } from \"@operation/set-element-attributes.ts\";\n\nexport function setElementAttributes(): IOperationMetadata<ISetElementAttributesOperationData> {\n return {\n description: `This operation sets the specified set of attributes on the given selected element.`,\n category: `DOM`,\n dependentProperties: ['selectedElement'],\n properties: {\n attributes: {\n type: 'ParameterType:object',\n required: true,\n erased: true\n }\n },\n };\n}\n","import { type IOperationMetadata } from \"@operation/metadata/types.ts\";\nimport { type ISetElementContentOperationData } from \"@operation/set-element-content.ts\";\n\nexport function setElementContent(): IOperationMetadata<ISetElementContentOperationData> {\n return {\n description: `This operation sets the specified content defined by the value assigned to the template property\nto the given selected element.\n\nWhen the \\`insertionType\\` is set to \\`overwrite\\` the contents of the selected element are replaced\nby the given template.\nWhen set to \\`append\\` the new content will be inserted after the current content.\nWhen set to \\`prepend\\` the new content will be inserted before the current content.`,\n category: `DOM`,\n dependentProperties: ['selectedElement'],\n properties: {\n template: {\n type: [\n { value: 'string' },\n { value: 'Element' },\n { value: 'Text' },\n { value: 'Comment' },\n { value: 'Document' },\n { value: 'DocumentFragment' }\n ],\n erased: true\n },\n insertionType: {\n type: [\n { value: 'overwrite' },\n { value: 'append' },\n { value: 'prepend' }\n ],\n erased: true\n }\n },\n };\n}\n","import { type IOperationMetadata } from \"@operation/metadata/types.ts\";\nimport { type ISetFocusOperationData } from \"@operation/set-focus.ts\";\n\nexport function setFocus(): IOperationMetadata<ISetFocusOperationData> {\n return {\n description: `Sets focus to the selected element.`,\n category: `Focus`,\n dependentProperties: ['selectedElement'],\n };\n}\n","import { type IOperationMetadata } from \"@operation/metadata/types.ts\";\nimport { type ISetFormValueOperationData } from \"@operation/set-form-value.ts\";\n\nexport function setFormValue(): IOperationMetadata<ISetFormValueOperationData> {\n return {\n description: `Sets the value of an input, select, or textarea element.\n\nHandles different input types appropriately:\n- Text inputs, textareas, selects: sets value directly\n- Checkboxes: sets checked property for boolean values\n- Radio buttons: sets checked property for boolean values\n- Number inputs: converts to string`,\n category: `Form`,\n dependentProperties: ['selectedElement'],\n properties: {\n value: {\n type: [\n { value: 'string' },\n { value: 'number' },\n { value: 'false' },\n { value: 'true' }\n ],\n required: true,\n erased: true\n }\n },\n };\n}\n","import { type IOperationMetadata } from \"@operation/metadata/types.ts\";\nimport { type ISetGlobalDataOperationData } from \"@operation/set-global-data.ts\";\n\nexport function setGlobalData(): IOperationMetadata<ISetGlobalDataOperationData> {\n return {\n description: `This operation copies the specified properties from the operationData to the global data.`,\n category: `Data`,\n properties: {\n propertyNames: {\n type: 'ParameterType:array',\n itemType: 'ParameterType:string',\n required: true,\n erased: true\n }\n },\n };\n}\n","import { type IOperationMetadata } from \"@operation/metadata/types.ts\";\nimport { type ISetOperationData } from \"@operation/set-operation-data.ts\";\n\nexport function setOperationData(): IOperationMetadata<ISetOperationData> {\n return {\n description: `This operation assigns the specified properties to the current operation data.\nWhen override is set to true the properties replace the current operation data entirely.`,\n category: `Data`,\n properties: {\n override: {\n type: [\n { value: 'undefined' },\n { value: 'false' },\n { value: 'true' }\n ],\n erased: true\n },\n properties: {\n type: 'ParameterType:object',\n required: true,\n erased: true\n }\n },\n };\n}\n","import { type IOperationMetadata } from \"@operation/metadata/types.ts\";\nimport { type ISetStyleOperationData } from \"@operation/set-style.ts\";\n\nexport function setStyle(): IOperationMetadata<ISetStyleOperationData> {\n return {\n description: `This operation assigns the specified CSS style properties to the\ngiven selected element.`,\n category: `DOM`,\n dependentProperties: ['selectedElement'],\n properties: {\n properties: {\n type: 'ParameterType:cssProperties',\n required: true,\n erased: true\n }\n },\n };\n}\n","import { type IOperationMetadata } from \"@operation/metadata/types.ts\";\nimport { type ISetVariableOperationData } from \"@operation/set-variable.ts\";\n\nexport function setVariable(): IOperationMetadata<ISetVariableOperationData> {\n return {\n description: `This operation sets a variable with the specified name on the scope with the specified value.`,\n category: `Data`,\n properties: {\n name: {\n type: 'ParameterType:string',\n required: true,\n erased: true\n },\n value: {\n type: 'ParameterType:object|ParameterType:string|ParameterType:number|ParameterType:boolean|ParameterType:array',\n required: true,\n erased: true\n }\n },\n };\n}\n","import { type IOperationMetadata } from \"@operation/metadata/types.ts\";\nimport { type ISortArrayOperationData } from \"@operation/sort-array.ts\";\n\nexport function sortArray(): IOperationMetadata<ISortArrayOperationData> {\n return {\n description: `Sorts an array by property, natural order, or custom comparator function.\n\nOperates on arrayData passed from previous operations.\nSupports three sorting modes:\n1. Property sort: \\`sortProperty\\` and \\`sortOrder\\` to sort objects by property\n2. Natural sort: \\`sortOrder\\` alone for primitive arrays\n3. Custom comparator: \\`sortComparator\\` function for complex sorting logic`,\n category: `Array`,\n dependentProperties: ['arrayData'],\n properties: {\n sortProperty: {\n type: [\n { value: 'undefined' },\n { value: 'string' }\n ],\n erased: true\n },\n sortOrder: {\n type: [\n { value: 'undefined' },\n { value: 'asc' },\n { value: 'desc' }\n ],\n erased: true\n },\n sortComparator: {\n type: [\n { value: 'undefined' },\n { value: '(a: any, b: any) => number' }\n ],\n erased: true\n }\n },\n outputProperties: {\n sortedArray: {\n type: 'ParameterType:array'\n }\n }\n };\n}\n","import { type IOperationMetadata } from \"@operation/metadata/types.ts\";\nimport { type ISplitStringOperationData } from \"@operation/split-string.ts\";\n\nexport function splitString(): IOperationMetadata<ISplitStringOperationData> {\n return {\n description: `Splits a string into an array by delimiter (string or regex).`,\n category: `String`,\n dependentProperties: ['textContent'],\n properties: {\n delimiter: {\n type: [\n { value: 'string' },\n { value: 'RegExp' }\n ],\n required: true,\n erased: true\n },\n limit: {\n type: [\n { value: 'undefined' },\n { value: 'number' }\n ],\n erased: true\n }\n },\n outputProperties: {\n resultArray: {\n type: 'ParameterType:array',\n itemType: 'ParameterType:string'\n }\n }\n };\n}\n","import { type IOperationMetadata } from \"@operation/metadata/types.ts\";\nimport { type IStartActionOperationData } from \"@operation/start-action.ts\";\n\nexport function startAction(): IOperationMetadata<IStartActionOperationData> {\n return {\n description: `This operation starts the specified action instance using the given action operation data.\n\nThe action operation data is first merged with the current operation data before it is\npassed on to the action. After the action has completed the action operation data properties\nare removed from the current operation data.`,\n category: `Action`,\n dependentProperties: ['actionInstance'],\n properties: {\n actionOperationData: {\n type: 'ParameterType:object',\n erased: true\n }\n },\n };\n}\n","import { type IOperationMetadata } from \"@operation/metadata/types.ts\";\nimport { type ISubstringTextOperationData } from \"@operation/substring-text.ts\";\n\nexport function substringText(): IOperationMetadata<ISubstringTextOperationData> {\n return {\n description: `Extracts a substring from text between start and end indices.`,\n category: `Text`,\n dependentProperties: ['textContent'],\n properties: {\n start: {\n type: 'ParameterType:number',\n required: true,\n erased: true\n },\n end: {\n type: [\n { value: 'undefined' },\n { value: 'number' }\n ],\n erased: true\n }\n },\n outputProperties: {\n substring: {\n type: 'ParameterType:string'\n }\n }\n };\n}\n","import { type IOperationMetadata } from \"@operation/metadata/types.ts\";\nimport { type IToggleClassOperationData } from \"@operation/toggle-class.ts\";\n\nexport function toggleClass(): IOperationMetadata<IToggleClassOperationData> {\n return {\n description: `This operation toggles the specfied class name on the given selected element.\n\nMeaning, if the specified class name exists on the given element it will be removed,\notherwise it will be added.`,\n category: `DOM`,\n dependentProperties: ['selectedElement'],\n properties: {\n className: {\n type: 'ParameterType:className',\n required: true,\n erased: true\n }\n },\n };\n}\n","import { type IOperationMetadata } from \"@operation/metadata/types.ts\";\nimport { type IToggleElementOperationData } from \"@operation/toggle-element.ts\";\n\nexport function toggleElement(): IOperationMetadata<IToggleElementOperationData> {\n return {\n description: `This operation toggles the visibility of the given selected element.\n\nMeaning, if the element is hidden, it will be made visible, otherwise\nit will be hidden.`,\n category: `DOM`,\n dependentProperties: ['selectedElement'],\n };\n}\n","import { type IOperationMetadata } from \"@operation/metadata/types.ts\";\nimport { type IToggleFormElementOperationData } from \"@operation/toggle-form-element.ts\";\n\nexport function toggleFormElement(): IOperationMetadata<IToggleFormElementOperationData> {\n return {\n description: `Enables or disables form input elements (inputs, selects, textareas, buttons).\n\nSets the \\`disabled\\` property on the element. When \\`enabled\\` is true, removes the disabled\nattribute; when false, adds the disabled attribute.`,\n category: `Form`,\n dependentProperties: ['selectedElement'],\n properties: {\n enabled: {\n type: 'ParameterType:boolean',\n required: true,\n erased: true\n }\n },\n };\n}\n","import { type IOperationMetadata } from \"@operation/metadata/types.ts\";\nimport { type IValidateFormOperationData } from \"@operation/validate-form.ts\";\n\nexport function validateForm(): IOperationMetadata<IValidateFormOperationData> {\n return {\n description: `Validates form fields against HTML5 validation and custom rules.\n\nUses HTML5 validation API (checkValidity()) for native validation, and supports\ncustom validation rules for: required, minLength, maxLength, pattern (regex), and email format.`,\n category: `Form`,\n dependentProperties: ['selectedElement'],\n properties: {\n validationRules: {\n type: [\n { value: 'undefined' },\n { value: 'Record<string, import(\"/home/runner/work/eligius/eligius/src/operation/validate-form\").IValidationRules>' }\n ],\n erased: true\n }\n },\n outputProperties: {\n validationErrors: {\n type: 'ParameterType:object'\n },\n isValid: {\n type: [\n { value: 'undefined' },\n { value: 'false' },\n { value: 'true' }\n ]\n }\n }\n };\n}\n","import { type IOperationMetadata } from \"@operation/metadata/types.ts\";\nimport { type IWaitOperationData } from \"@operation/wait.ts\";\n\nexport function wait(): IOperationMetadata<IWaitOperationData> {\n return {\n description: `This operation waits for the specified amount of milliseconds.`,\n category: `Utility`,\n properties: {\n milliseconds: {\n type: 'ParameterType:number',\n required: true,\n erased: true\n }\n },\n };\n}\n","import { type IOperationMetadata } from \"@operation/metadata/types.ts\";\nimport { type IWhenOperationData } from \"@operation/when.ts\";\n\nexport function when(): IOperationMetadata<IWhenOperationData> {\n return {\n description: `When the given expression evaluates to false, subsequent operations will be skipped\nuntil an {@link endWhen} or {@link otherwise} operation is encountered.\n\nPractically, this means an \\`if\\` or \\`if\\`/\\`else\\` statement control flow implementation in a list of operations.\n\nThe expression is passed in as a formatted string.\nThe left and right values of the expression can be defined like this:\n\n'constant': for a constant string\n100: for a constant number\n$operationData.foo: for an operation data value\n$globaldata.foo: for a global data value\n$scope.loopIndex: for a scope value`,\n category: `Control Flow`,\n properties: {\n expression: {\n type: 'ParameterType:expression',\n required: true,\n erased: true\n }\n },\n };\n}\n","export { addClass } from \"@operation/metadata/add-class.ts\";\nexport { addControllerToElement } from \"@operation/metadata/add-controller-to-element.ts\";\nexport { addGlobalsToOperation } from \"@operation/metadata/add-globals-to-operation.ts\";\nexport { animateWithClass } from \"@operation/metadata/animate-with-class.ts\";\nexport { animate } from \"@operation/metadata/animate.ts\";\nexport { announceToScreenReader } from \"@operation/metadata/announce-to-screen-reader.ts\";\nexport { breakForEach } from \"@operation/metadata/break-for-each.ts\";\nexport { broadcastEvent } from \"@operation/metadata/broadcast-event.ts\";\nexport { calc } from \"@operation/metadata/calc.ts\";\nexport { clearElement } from \"@operation/metadata/clear-element.ts\";\nexport { clearOperationData } from \"@operation/metadata/clear-operation-data.ts\";\nexport { clearStorage } from \"@operation/metadata/clear-storage.ts\";\nexport { compareDate } from \"@operation/metadata/compare-date.ts\";\nexport { concatenateStrings } from \"@operation/metadata/concatenate-strings.ts\";\nexport { continueForEach } from \"@operation/metadata/continue-for-each.ts\";\nexport { createElement } from \"@operation/metadata/create-element.ts\";\nexport { customFunction } from \"@operation/metadata/custom-function.ts\";\nexport { endAction } from \"@operation/metadata/end-action.ts\";\nexport { endForEach } from \"@operation/metadata/end-for-each.ts\";\nexport { endWhen } from \"@operation/metadata/end-when.ts\";\nexport { extendController } from \"@operation/metadata/extend-controller.ts\";\nexport { filterArray } from \"@operation/metadata/filter-array.ts\";\nexport { findInArray } from \"@operation/metadata/find-in-array.ts\";\nexport { forEach } from \"@operation/metadata/for-each.ts\";\nexport { formatDate } from \"@operation/metadata/format-date.ts\";\nexport { formatText } from \"@operation/metadata/format-text.ts\";\nexport { getAttributesFromElement } from \"@operation/metadata/get-attributes-from-element.ts\";\nexport { getControllerFromElement } from \"@operation/metadata/get-controller-from-element.ts\";\nexport { getControllerInstance } from \"@operation/metadata/get-controller-instance.ts\";\nexport { getCurrentTime } from \"@operation/metadata/get-current-time.ts\";\nexport { getElementDimensions } from \"@operation/metadata/get-element-dimensions.ts\";\nexport { getFocusedElement } from \"@operation/metadata/get-focused-element.ts\";\nexport { getFormData } from \"@operation/metadata/get-form-data.ts\";\nexport { getImport } from \"@operation/metadata/get-import.ts\";\nexport { getQueryParams } from \"@operation/metadata/get-query-params.ts\";\nexport { getScrollPosition } from \"@operation/metadata/get-scroll-position.ts\";\nexport { getTextContent } from \"@operation/metadata/get-text-content.ts\";\nexport { httpDelete } from \"@operation/metadata/http-delete.ts\";\nexport { httpPost } from \"@operation/metadata/http-post.ts\";\nexport { httpPut } from \"@operation/metadata/http-put.ts\";\nexport { invokeObjectMethod } from \"@operation/metadata/invoke-object-method.ts\";\nexport { isElementInViewport } from \"@operation/metadata/is-element-in-viewport.ts\";\nexport { loadFromStorage } from \"@operation/metadata/load-from-storage.ts\";\nexport { loadJson } from \"@operation/metadata/load-json.ts\";\nexport { log } from \"@operation/metadata/log.ts\";\nexport { mapArray } from \"@operation/metadata/map-array.ts\";\nexport { math } from \"@operation/metadata/math.ts\";\nexport { otherwise } from \"@operation/metadata/otherwise.ts\";\nexport { removeClass } from \"@operation/metadata/remove-class.ts\";\nexport { removeControllerFromElement } from \"@operation/metadata/remove-controller-from-element.ts\";\nexport { removeElement } from \"@operation/metadata/remove-element.ts\";\nexport { removePropertiesFromOperationData } from \"@operation/metadata/remove-properties-from-operation-data.ts\";\nexport { reparentElement } from \"@operation/metadata/reparent-element.ts\";\nexport { replaceString } from \"@operation/metadata/replace-string.ts\";\nexport { replaceText } from \"@operation/metadata/replace-text.ts\";\nexport { requestAction } from \"@operation/metadata/request-action.ts\";\nexport { saveToStorage } from \"@operation/metadata/save-to-storage.ts\";\nexport { scrollToElement } from \"@operation/metadata/scroll-to-element.ts\";\nexport { scrollToPosition } from \"@operation/metadata/scroll-to-position.ts\";\nexport { selectElement } from \"@operation/metadata/select-element.ts\";\nexport { setData } from \"@operation/metadata/set-data.ts\";\nexport { setElementAttributes } from \"@operation/metadata/set-element-attributes.ts\";\nexport { setElementContent } from \"@operation/metadata/set-element-content.ts\";\nexport { setFocus } from \"@operation/metadata/set-focus.ts\";\nexport { setFormValue } from \"@operation/metadata/set-form-value.ts\";\nexport { setGlobalData } from \"@operation/metadata/set-global-data.ts\";\nexport { setOperationData } from \"@operation/metadata/set-operation-data.ts\";\nexport { setStyle } from \"@operation/metadata/set-style.ts\";\nexport { setVariable } from \"@operation/metadata/set-variable.ts\";\nexport { sortArray } from \"@operation/metadata/sort-array.ts\";\nexport { splitString } from \"@operation/metadata/split-string.ts\";\nexport { startAction } from \"@operation/metadata/start-action.ts\";\nexport { substringText } from \"@operation/metadata/substring-text.ts\";\nexport { toggleClass } from \"@operation/metadata/toggle-class.ts\";\nexport { toggleElement } from \"@operation/metadata/toggle-element.ts\";\nexport { toggleFormElement } from \"@operation/metadata/toggle-form-element.ts\";\nexport { validateForm } from \"@operation/metadata/validate-form.ts\";\nexport { wait } from \"@operation/metadata/wait.ts\";\nexport { when } from \"@operation/metadata/when.ts\";\nexport * from \"@operation/metadata/types.ts\";\n","import type {TControllerName, TOperationName} from '@configuration/types.ts';\nimport * as controllers from '@controllers/index.ts';\nimport type {EventName} from '@eventbus/events/types.ts';\nimport * as operations from '@operation/index.ts';\nimport * as operationMetadata from '@operation/metadata/index.ts';\nimport type {IOperationMetadata} from '@operation/metadata/types.ts';\n\n/**\n *\n * Provider for all the available operation names\n *\n */\nexport class OperationNamesProvider {\n getOperationNames(): TOperationName {\n return Object.keys(operations) as unknown as TOperationName;\n }\n}\n\n/**\n *\n * Provider for all the available controller names\n *\n */\nexport class ControllerNamesProvider {\n getControllerNames(): TControllerName {\n return Object.keys(controllers) as unknown as TControllerName;\n }\n}\n\n/**\n *\n * Provider that can retrieve the metadata associated with a given operation name\n *\n */\nexport class OperationMetadataProvider {\n getOperationMetadata(operationName: TOperationName) {\n const getMetadata = (\n operationMetadata as Record<\n TOperationName,\n () => IOperationMetadata<operations.TOperationData>\n >\n )[operationName];\n if (!getMetadata) {\n throw new Error(\n `Could not find metadata for operation called ${operationName}`\n );\n }\n return getMetadata();\n }\n}\n\n/**\n *\n * Provider for all the available event names\n *\n */\nexport class TimeLineEventNamesProvider {\n getEventNames() {\n return [\n 'timeline-play-toggle-request',\n 'timeline-play-request',\n 'timeline-stop-request',\n 'timeline-pause-request',\n 'timeline-seek-request',\n 'timeline-resize-request',\n 'timeline-container-request',\n 'timeline-duration-request',\n 'timeline-request-current-timeline',\n 'timeline-duration',\n 'timeline-time',\n 'timeline-seeked',\n 'timeline-complete',\n 'timeline-restart',\n 'timeline-play',\n 'timeline-stop',\n 'timeline-pause',\n 'timeline-seek',\n 'timeline-resize',\n 'timeline-current-timeline-change',\n 'timeline-firstframe',\n 'request-instance',\n 'request-action',\n 'request-function',\n 'request-timeline-uri',\n 'before-request-timeline-uri',\n 'request-engine-root',\n 'request-current-timeline-position',\n 'request-timeline-cleanup',\n 'request-label-collection',\n 'request-label-collections',\n 'request-current-language',\n 'language-change',\n 'dom-mutation',\n ] as unknown as EventName[];\n }\n}\n","import type {IStrictDuration, ISubtitle} from '../../types.ts';\n\n/**\n * This class converts an AVID subtitle file to an `ISubtitle` array.\n */\nexport class SubtitleImporter {\n importSubtitles(rawLines: string[]): ISubtitle[] {\n const result: ISubtitle[] = [];\n const lines: string[] = [];\n for (let i: number = 0, l: number = rawLines.length; i < l; i++) {\n const rawLine: string = this.stripNewlineChars(rawLines[i].toString());\n if (this.isValidLine(rawLine)) {\n lines.push(rawLine);\n }\n }\n if (lines[0] === '') {\n lines.splice(0, 1);\n }\n while (lines[lines.length - 1] === '') {\n lines.pop();\n }\n let caption: Partial<ISubtitle> | null = null;\n lines.forEach((line: string) => {\n if (line.length === 0 || !caption) {\n caption = {text: ''};\n if (line.length) {\n //this happens for first caption only\n caption.duration = this.convertDuration(line);\n }\n result.push(caption as ISubtitle);\n } else {\n if (!Object.hasOwn(caption, 'duration')) {\n caption.duration = this.convertDuration(line);\n } else {\n caption.text += line;\n }\n }\n });\n return result;\n }\n\n stripNewlineChars(str: string): string {\n let res: string = '';\n for (let i: number = 0, l: number = str.length; i < l; i++) {\n if (str.charCodeAt(i) !== 13 && str.charCodeAt(i) !== 0) {\n res += str.charAt(i);\n }\n }\n return res;\n }\n\n isValidLine(line: string): boolean {\n return (\n !line.startsWith('@') &&\n !line.startsWith('<begin subtitles>') &&\n !line.startsWith('<end subtitles>')\n );\n }\n\n convertDuration(time: string): IStrictDuration {\n const times: string[] = time.split(' ');\n return {\n start: this.convertTimeToSeconds(times[0]),\n end: this.convertTimeToSeconds(times[1]),\n };\n }\n\n convertTimeToSeconds(time: string): number {\n const parts: string[] = time.split(':');\n return (\n parseInt(parts[0], 10) * 3600 +\n parseInt(parts[1], 10) * 60 +\n parseInt(parts[2], 10)\n );\n }\n}\n","import {v4 as uuidv4} from 'uuid';\nimport type {\n IStrictDuration,\n ISubtitle,\n ISubtitleCollection,\n TLanguageCode,\n} from '../../types.ts';\n\n/**\n * Used to edit and add to an {@link ISubtitleCollection}.\n */\nexport class SubtitleEditor {\n constructor(private collection: ISubtitleCollection[] = []) {}\n\n private _getLanguage(languageCode: string) {\n return this.collection.find(x => x.languageCode === languageCode);\n }\n\n /**\n * Adds a new {@link ISubtitleCollection} for the given `languageCode`.\n *\n * If collections already exist for existing language codes then a duplicate\n * of these collections is created with the same duration info but all of the\n * text is left empty.\n *\n * @param languageCode\n * @returns\n */\n addLanguage(languageCode: TLanguageCode) {\n const language = this._getLanguage(languageCode);\n if (language) {\n throw new Error(`Language ${languageCode} already exists.`);\n }\n const newLanguage: ISubtitleCollection = this.collection.length\n ? {\n ...this.collection[0],\n languageCode,\n titles: this.collection[0].titles.map(x => ({\n id: uuidv4(),\n duration: {...x.duration},\n text: '',\n })),\n }\n : {\n languageCode,\n titles: [],\n };\n this.collection.push(newLanguage);\n return this;\n }\n\n /**\n *\n * Add a single subtitle line that is associated with the given `languageCode`\n *\n * @param languageCode\n * @param subtitle\n * @returns\n */\n addSubtitle(languageCode: TLanguageCode, subtitle: ISubtitle) {\n const language = this._getLanguage(languageCode);\n if (!language) {\n throw new Error(`Language ${languageCode} does not exist.`);\n }\n language.titles.push(subtitle);\n return this;\n }\n\n addSubtitles(\n duration: IStrictDuration,\n subtitles: Record<TLanguageCode, string>\n ) {\n Object.entries(subtitles).forEach(([languageCode, subtitle]) =>\n this.addSubtitle(languageCode as TLanguageCode, {\n id: uuidv4(),\n duration: {...duration},\n text: subtitle,\n })\n );\n return this;\n }\n\n setSubtitle(languageCode: TLanguageCode, subtitle: ISubtitle) {\n const language = this._getLanguage(languageCode);\n if (!language) {\n throw new Error(`Language ${languageCode} does not exist.`);\n }\n\n const titleIdx = language.titles.findIndex(x => x.id === subtitle.id);\n if (titleIdx < 0) {\n throw new Error(\n `Subtitle with id '${subtitle.id}' was not found in language with code ${languageCode}.`\n );\n }\n\n language.titles[titleIdx] = {\n ...subtitle,\n duration: {...subtitle.duration},\n };\n return this;\n }\n\n export() {\n return this.collection;\n }\n}\n","import {getPropertyChainValue} from '@operation/helper/get-property-chain-value.ts';\n\n/**\n * Gets the value for the given property chain. A property chain is defined by a period delimited string.\n *\n * For example, this property chain: `mySource.subSource.element.value` should be extracted from an object of this shape:\n * ```ts\n * const foo = {\n * mySource: {\n * subSource: {\n * element: {\n * value: 'bar'\n * }\n * }\n * }\n * }\n * ```\n *\n * The result of the invocation `resolvePropertyChain('mySource.subSource.element.value', foo)` would then yield the value `bar`.\n */\nexport function resolvePropertyChain(propertyChain: string, sourceObject: any) {\n const properties = propertyChain.split('.');\n return getPropertyChainValue(properties, sourceObject);\n}\n","import {Action, EndableAction, TimelineAction} from '@action/index.ts';\nimport type {IAction} from '@action/types.ts';\nimport type {\n IActionConfiguration,\n IEndableActionConfiguration,\n IEngineConfiguration,\n IEventActionConfiguration,\n IOperationConfiguration,\n IResolvedActionConfiguration,\n IResolvedEndableActionConfiguration,\n IResolvedEngineConfiguration,\n IResolvedOperation,\n IResolvedTimelineConfiguration,\n ITimelineActionConfiguration,\n ITimelineConfiguration,\n} from '@configuration/types.ts';\nimport type {ActionRegistryEventbusListener} from '@eventbus/index.ts';\nimport type {IEventbus} from '@eventbus/types.ts';\nimport {deepCopy} from '@operation/helper/deep-copy.ts';\nimport {resolvePropertyChain} from '@operation/helper/resolve-property-chain.ts';\nimport type {TOperationData} from '@operation/types.ts';\nimport {isObject} from '@util/guards/is-object.ts';\nimport {isString} from '@util/guards/is-string.ts';\nimport {isDefined} from 'ts-is-present';\nimport type {\n IConfigurationResolver,\n ISimpleResourceImporter,\n} from '../types.ts';\n\n/**\n * Takes an `IEngineConfiguration` instance and return an `IResolvedEngineConfiguration`.\n * This means all system names within the configuration will be resolved to their associated instances.\n *\n * If the given configuration includes event actions, then those will be registered in the given `ActionRegistryEventbusListener`.\n *\n */\nexport class ConfigurationResolver implements IConfigurationResolver {\n constructor(\n private importer: ISimpleResourceImporter,\n private eventbus: IEventbus\n ) {}\n\n process(\n configuration: IEngineConfiguration,\n actionRegistryListener?: ActionRegistryEventbusListener\n ): [Record<string, IAction>, IResolvedEngineConfiguration] {\n resolvePlaceholders(configuration, configuration, this.importer);\n\n if (!isDefined(configuration.timelineProviderSettings)) {\n throw new Error(\n 'Configuration incomplete: it needs to have at least one timeline provider setting'\n );\n }\n\n const resolvedConfig: IResolvedEngineConfiguration = {\n id: configuration.id,\n engine: {...configuration.engine},\n timelineProviderSettings: deepCopy(\n configuration.timelineProviderSettings\n ),\n containerSelector: configuration.containerSelector,\n cssFiles: configuration.cssFiles,\n language: configuration.language,\n layoutTemplate: configuration.layoutTemplate,\n availableLanguages: deepCopy(configuration.availableLanguages),\n actions: resolveActions(\n configuration.actions,\n this.importer,\n this.eventbus\n ),\n initActions: resolveActions(\n configuration.initActions,\n this.importer,\n this.eventbus\n ),\n labels: deepCopy(configuration.labels),\n timelineFlow: deepCopy(configuration.timelineFlow),\n timelines: resolveTimelines(\n configuration.timelines,\n this.importer,\n this.eventbus\n ),\n };\n\n let eventActions: IAction[] = [];\n if (configuration.eventActions?.length && actionRegistryListener) {\n eventActions = resolveEventActions(\n configuration.eventActions,\n actionRegistryListener,\n this.importer,\n this.eventbus\n );\n }\n\n const actionsLookup = (resolvedConfig.actions as IAction[])\n .concat(eventActions)\n .reduce<Record<string, IAction>>(\n (aggr, action) => ({\n ...aggr,\n [action.name]: action,\n }),\n {}\n );\n\n return [actionsLookup, resolvedConfig];\n }\n}\n\nfunction resolveEventActions(\n eventActionConfigurations: IEventActionConfiguration[],\n actionRegistryListener: ActionRegistryEventbusListener,\n importer: ISimpleResourceImporter,\n eventbus: IEventbus\n) {\n const resolvedConfigs =\n eventActionConfigurations.map<IResolvedActionConfiguration>(config =>\n resolveActionConfiguration(config, importer)\n );\n\n return resolvedConfigs.map((config, index) => {\n const {eventName, eventTopic} = eventActionConfigurations[index];\n const eventAction = new Action(\n config.name,\n config.startOperations,\n eventbus\n );\n actionRegistryListener.registerAction(eventAction, eventName, eventTopic);\n return eventAction;\n });\n}\n\nfunction resolveTimelines(\n timelines: ITimelineConfiguration[],\n importer: ISimpleResourceImporter,\n eventbus: IEventbus\n) {\n const resolve = resolveTimelineAction.bind(null, importer, eventbus);\n\n return timelines.map<IResolvedTimelineConfiguration>(config => ({\n ...config,\n timelineActions: config.timelineActions.map(resolve),\n }));\n}\n\nfunction resolveOperation(\n importer: ISimpleResourceImporter,\n operationConfig: IOperationConfiguration<TOperationData>\n): IResolvedOperation {\n return {\n id: operationConfig.id,\n systemName: operationConfig.systemName,\n operationData: deepCopy(operationConfig.operationData) ?? {},\n instance: importer.import(operationConfig.systemName)[\n operationConfig.systemName\n ],\n };\n}\n\nfunction resolveActionConfiguration(\n config: IActionConfiguration,\n importer: ISimpleResourceImporter\n): IResolvedActionConfiguration {\n const resolve = resolveOperation.bind(null, importer);\n\n return {\n id: config.id,\n name: config.name,\n startOperations: config.startOperations.map(resolve),\n };\n}\n\nfunction resolveEndableActionConfiguration(\n config: IEndableActionConfiguration,\n importer: ISimpleResourceImporter\n): IResolvedEndableActionConfiguration {\n const resolve = resolveOperation.bind(null, importer);\n\n const action = resolveActionConfiguration(config, importer);\n\n return {\n ...action,\n endOperations: config.endOperations.map(resolve),\n };\n}\n\nfunction resolveTimelineAction(\n importer: ISimpleResourceImporter,\n eventbus: IEventbus,\n actionConfiguration: ITimelineActionConfiguration\n) {\n const resolvedConfig = resolveEndableActionConfiguration(\n actionConfiguration,\n importer\n );\n const duration = {\n end: actionConfiguration.duration.end ?? -1,\n start: actionConfiguration.duration.start,\n };\n\n const {id, name, endOperations, startOperations} = resolvedConfig;\n const action = new TimelineAction(\n name,\n startOperations,\n endOperations,\n duration,\n eventbus\n );\n action.id = id;\n return action;\n}\n\nfunction resolveActions(\n actionConfigurations: IEndableActionConfiguration[],\n importer: ISimpleResourceImporter,\n eventbus: IEventbus\n) {\n const resolvedConfigs =\n actionConfigurations.map<IResolvedEndableActionConfiguration>(config => {\n return resolveEndableActionConfiguration(config, importer);\n });\n\n return resolvedConfigs.map<EndableAction>(resolvedConfig => {\n const {name, endOperations, startOperations} = resolvedConfig;\n const action = new EndableAction(\n name,\n startOperations,\n endOperations,\n eventbus\n );\n action.id = resolvedConfig.id;\n return action;\n });\n}\n\nfunction resolvePlaceholders(\n configFragment: Record<string, any> | any[],\n rootConfig: any,\n importer: ISimpleResourceImporter\n) {\n if (!isDefined(configFragment)) {\n return;\n }\n\n if (Array.isArray(configFragment)) {\n configFragment.forEach(item => {\n resolvePlaceholders(item, rootConfig, importer);\n });\n } else if (isObject(configFragment)) {\n Object.keys(configFragment).forEach(key => {\n resolvePlaceholder(key, configFragment, rootConfig, importer);\n });\n }\n}\n\nfunction resolvePlaceholder(\n key: PropertyKey,\n configFragment: any,\n rootConfig: any,\n importer: ISimpleResourceImporter\n) {\n const configValue = configFragment[key];\n if (isString(configValue)) {\n if (configValue.startsWith('config:')) {\n const configProperty = configValue.substring(7, configValue.length);\n configFragment[key] = resolvePropertyChain(configProperty, rootConfig);\n } else if (configValue.startsWith('template:')) {\n const templateKey = configValue.substring(9, configValue.length);\n const template = importer.import(templateKey)[templateKey];\n configFragment[key] = template;\n } else if (configValue.startsWith('json:')) {\n const jsonKey = configValue.substring(5, configValue.length);\n const json = importer.import(jsonKey)[jsonKey];\n configFragment[key] = json;\n }\n } else if (isObject(configValue) || Array.isArray(configValue)) {\n resolvePlaceholders(configValue, rootConfig, importer);\n }\n}\n","import { type IDOMEventListenerControllerOperationData } from \"@controllers/dom-event-listener-controller.ts\";\nimport { type IControllerMetadata } from \"@controllers/metadata/types.ts\";\n\nexport function DOMEventListenerController(): IControllerMetadata<IDOMEventListenerControllerOperationData> {\n return {\n description: `This controller attaches to the given selected element and adds a DOM event listener for the specified event name that\nexecutes the given actions with the given operation data.\n\nBy default the \\`start\\` operations of the specified actions are executed. To execute the \\`end\\` operations instead,\nprefix the action name with \\`end:\\`.`,\n dependentProperties: ['selectedElement'],\n properties: {\n eventName: {\n type: 'ParameterType:eventName',\n required: true,\n },\n actions: {\n type: 'ParameterType:array',\n itemType: 'ParameterType:string',\n },\n actionOperationData: {\n type: 'ParameterType:object',\n }\n },\n };\n}\n","import { type ILabelControllerMetadata } from \"@controllers/label-controller.ts\";\nimport { type IControllerMetadata } from \"@controllers/metadata/types.ts\";\n\nexport function LabelController(): IControllerMetadata<ILabelControllerMetadata> {\n return {\n description: `This controller attaches to the given selected element and renders the text associated with the given label id in it.\n\nThe controller also listen for the \\`LANGUAGE_CHANGE\\` event and re-renders the text with the new language after such an event.`,\n dependentProperties: ['selectedElement'],\n properties: {\n labelId: {\n type: 'ParameterType:labelId',\n required: true,\n },\n attributeName: {\n type: [\n { value: 'undefined' },\n { value: 'string' }\n ],\n }\n },\n };\n}\n","import { type ILottieControllerMetadata } from \"@controllers/lottie-controller.ts\";\nimport { type IControllerMetadata } from \"@controllers/metadata/types.ts\";\n\nexport function LottieController(): IControllerMetadata<ILottieControllerMetadata> {\n return {\n description: `This controller renders a [lottie-web](https://github.com/airbnb/lottie-web) animation inside the given selected element.\n\nThe url may encode freeze and end positions like this: my-url/filename[freeze=10,end=21].json`,\n properties: {\n url: {\n type: 'ParameterType:url',\n required: true,\n }\n },\n };\n}\n","import { type IControllerMetadata } from \"@controllers/metadata/types.ts\";\nimport { type IMutationObserverControllerMetadata } from \"@controllers/mutation-observer-controller.ts\";\n\nexport function MutationObserverController(): IControllerMetadata<IMutationObserverControllerMetadata> {\n return {\n description: `Controller that observes DOM mutations on a selected element and broadcasts events.\n\nThis controller creates a MutationObserver to monitor DOM changes (attributes, child nodes,\ntext content) on a specified element. All detected mutations are broadcasted through the\nEligius eventbus, enabling reactive behavior in response to DOM changes.\n\nThe controller follows the standard Eligius lifecycle:\n- init(): Store configuration metadata\n- attach(): Create and start the MutationObserver\n- detach(): Disconnect the observer and clean up resources`,\n dependentProperties: ['selectedElement'],\n properties: {\n observeAttributes: {\n type: [\n { value: 'undefined' },\n { value: 'false' },\n { value: 'true' }\n ],\n },\n observeChildList: {\n type: [\n { value: 'undefined' },\n { value: 'false' },\n { value: 'true' }\n ],\n },\n observeCharacterData: {\n type: [\n { value: 'undefined' },\n { value: 'false' },\n { value: 'true' }\n ],\n },\n observeSubtree: {\n type: [\n { value: 'undefined' },\n { value: 'false' },\n { value: 'true' }\n ],\n },\n attributeOldValue: {\n type: [\n { value: 'undefined' },\n { value: 'false' },\n { value: 'true' }\n ],\n },\n characterDataOldValue: {\n type: [\n { value: 'undefined' },\n { value: 'false' },\n { value: 'true' }\n ],\n },\n attributeFilter: {\n type: [\n { value: 'undefined' },\n { value: 'string[]' }\n ],\n }\n },\n };\n}\n","import { type IControllerMetadata } from \"@controllers/metadata/types.ts\";\nimport { type INavigationControllerOperationData } from \"@controllers/navigation-controller.ts\";\n\nexport function NavigationController(): IControllerMetadata<INavigationControllerOperationData> {\n return {\n description: ``,\n dependentProperties: ['selectedElement'],\n properties: {\n json: {\n type: 'ParameterType:object',\n required: true,\n }\n },\n };\n}\n","import { type IControllerMetadata } from \"@controllers/metadata/types.ts\";\nimport { type IProgressbarControllerOperationData } from \"@controllers/progressbar-controller.ts\";\n\nexport function ProgressbarController(): IControllerMetadata<IProgressbarControllerOperationData> {\n return {\n description: `This controller renders a progressbar that displays the progress of the current timeline in the given selected element.\n\nThe current progress as a percentage is rendered in the given text element.`,\n dependentProperties: ['selectedElement', 'textElement'],\n };\n}\n","import { type IControllerMetadata } from \"@controllers/metadata/types.ts\";\nimport { type IRoutingControllerOperationData } from \"@controllers/routing-controller.ts\";\n\nexport function RoutingController(): IControllerMetadata<IRoutingControllerOperationData> {\n return {\n description: `This is a work in progress, do not use this yet please....`,\n properties: {\n json: {\n type: 'ParameterType:object',\n required: true,\n }\n },\n };\n}\n","import { type IControllerMetadata } from \"@controllers/metadata/types.ts\";\nimport { type ISubtitlesControllerOperationData } from \"@controllers/subtitles-controller.ts\";\n\nexport function SubtitlesController(): IControllerMetadata<ISubtitlesControllerOperationData> {\n return {\n description: ``,\n dependentProperties: ['selectedElement'],\n properties: {\n language: {\n type: 'ParameterType:languagecode',\n },\n subtitleData: {\n type: 'ParameterType:array',\n }\n },\n };\n}\n","export { DOMEventListenerController } from \"@controllers/metadata/dom-event-listener-controller.ts\";\nexport { LabelController } from \"@controllers/metadata/label-controller.ts\";\nexport { LottieController } from \"@controllers/metadata/lottie-controller.ts\";\nexport { MutationObserverController } from \"@controllers/metadata/mutation-observer-controller.ts\";\nexport { NavigationController } from \"@controllers/metadata/navigation-controller.ts\";\nexport { ProgressbarController } from \"@controllers/metadata/progressbar-controller.ts\";\nexport { RoutingController } from \"@controllers/metadata/routing-controller.ts\";\nexport { SubtitlesController } from \"@controllers/metadata/subtitles-controller.ts\";\nexport * from \"@controllers/metadata/types.ts\";\n","import { type BeforeRequestTimelineUriEvent } from \"@eventbus/events/before-request-timeline-uri.ts\";\nimport { type IEventMetadata } from \"@eventbus/events/metadata/types.ts\";\n\nexport function beforeRequestTimelineUri(): IEventMetadata<BeforeRequestTimelineUriEvent['args']> {\n return {\n description: `Event: before-request-timeline-uri`,\n category: `Timeline`,\n args: []\n };\n}\n","import { type BeforeRequestVideoUrlEvent } from \"@eventbus/events/before-request-video-url.ts\";\nimport { type IEventMetadata } from \"@eventbus/events/metadata/types.ts\";\n\nexport function beforeRequestVideoUrl(): IEventMetadata<BeforeRequestVideoUrlEvent['args']> {\n return {\n description: `Event: before-request-video-url`,\n category: `Navigation`,\n args: [\n {\n name: 'index',\n type: 'number'\n },\n {\n name: 'requestedVideoPosition',\n type: 'number'\n },\n {\n name: 'isHistoryRequest',\n type: 'boolean'\n }]\n };\n}\n","import { type DomMutationEvent } from \"@eventbus/events/dom-mutation.ts\";\nimport { type IEventMetadata } from \"@eventbus/events/metadata/types.ts\";\n\nexport function domMutation(): IEventMetadata<DomMutationEvent['args']> {\n return {\n description: `Event: dom-mutation`,\n category: `Controller`,\n args: [\n {\n name: 'payload',\n type: 'any'\n }]\n };\n}\n","import { type HighlightNavigationEvent } from \"@eventbus/events/highlight-navigation.ts\";\nimport { type IEventMetadata } from \"@eventbus/events/metadata/types.ts\";\n\nexport function highlightNavigation(): IEventMetadata<HighlightNavigationEvent['args']> {\n return {\n description: `Event: highlight-navigation`,\n category: `Navigation`,\n args: [\n {\n name: 'videoUrlIndex',\n type: 'number'\n }]\n };\n}\n","import { type LanguageChangeEvent } from \"@eventbus/events/language-change.ts\";\nimport { type IEventMetadata } from \"@eventbus/events/metadata/types.ts\";\n\nexport function languageChange(): IEventMetadata<LanguageChangeEvent['args']> {\n return {\n description: `Event: language-change`,\n category: `Language Manager`,\n args: [\n {\n name: 'language',\n type: 'TLanguageCode'\n }]\n };\n}\n","import { type IEventMetadata } from \"@eventbus/events/metadata/types.ts\";\nimport { type NavigateToVideoUrlEvent } from \"@eventbus/events/navigate-to-video-url.ts\";\n\nexport function navigateToVideoUrl(): IEventMetadata<NavigateToVideoUrlEvent['args']> {\n return {\n description: `Event: navigate-to-video-url`,\n category: `Navigation`,\n args: [\n {\n name: 'index',\n type: 'number'\n },\n {\n name: 'requestedVideoPosition',\n type: 'number'\n }]\n };\n}\n","import { type IEventMetadata } from \"@eventbus/events/metadata/types.ts\";\nimport { type PushHistoryStateEvent } from \"@eventbus/events/push-history-state.ts\";\n\nexport function pushHistoryState(): IEventMetadata<PushHistoryStateEvent['args']> {\n return {\n description: `Event: push-history-state`,\n category: `Navigation`,\n args: [\n {\n name: 'state',\n type: 'any'\n }]\n };\n}\n","import { type IEventMetadata } from \"@eventbus/events/metadata/types.ts\";\nimport { type RequestActionEvent } from \"@eventbus/events/request-action.ts\";\n\nexport function requestAction(): IEventMetadata<RequestActionEvent['args']> {\n return {\n description: `Event: request-action`,\n category: `Engine Request`,\n args: [\n {\n name: 'actionName',\n type: 'string'\n },\n {\n name: 'callback',\n type: '(actionInstance: any) => void'\n }]\n };\n}\n","import { type IEventMetadata } from \"@eventbus/events/metadata/types.ts\";\nimport { type RequestCurrentLanguageEvent } from \"@eventbus/events/request-current-language.ts\";\n\nexport function requestCurrentLanguage(): IEventMetadata<RequestCurrentLanguageEvent['args']> {\n return {\n description: `Event: request-current-language`,\n category: `Engine Request`,\n args: [\n {\n name: 'callback',\n type: '(language: TLanguageCode) => void'\n }]\n };\n}\n","import { type IEventMetadata } from \"@eventbus/events/metadata/types.ts\";\nimport { type RequestCurrentNavigationEvent } from \"@eventbus/events/request-current-navigation.ts\";\n\nexport function requestCurrentNavigation(): IEventMetadata<RequestCurrentNavigationEvent['args']> {\n return {\n description: `Event: request-current-navigation`,\n category: `Navigation`,\n args: [\n {\n name: 'callback',\n type: '(navigation: any) => void'\n }]\n };\n}\n","import { type IEventMetadata } from \"@eventbus/events/metadata/types.ts\";\nimport { type RequestCurrentTimelinePositionEvent } from \"@eventbus/events/request-current-timeline-position.ts\";\n\nexport function requestCurrentTimelinePosition(): IEventMetadata<RequestCurrentTimelinePositionEvent['args']> {\n return {\n description: `Event: request-current-timeline-position`,\n category: `Engine Request`,\n args: []\n };\n}\n","import { type IEventMetadata } from \"@eventbus/events/metadata/types.ts\";\nimport { type RequestCurrentVideoPositionEvent } from \"@eventbus/events/request-current-video-position.ts\";\n\nexport function requestCurrentVideoPosition(): IEventMetadata<RequestCurrentVideoPositionEvent['args']> {\n return {\n description: `Event: request-current-video-position`,\n category: `Navigation`,\n args: [\n {\n name: 'callback',\n type: '(position: number) => void'\n }]\n };\n}\n","import { type IEventMetadata } from \"@eventbus/events/metadata/types.ts\";\nimport { type RequestEngineRootEvent } from \"@eventbus/events/request-engine-root.ts\";\n\nexport function requestEngineRoot(): IEventMetadata<RequestEngineRootEvent['args']> {\n return {\n description: `Event: request-engine-root`,\n category: `Engine Request`,\n args: [\n {\n name: 'callback',\n type: '(root: any) => void'\n }]\n };\n}\n","import { type IEventMetadata } from \"@eventbus/events/metadata/types.ts\";\nimport { type RequestFunctionEvent } from \"@eventbus/events/request-function.ts\";\n\nexport function requestFunction(): IEventMetadata<RequestFunctionEvent['args']> {\n return {\n description: `Event: request-function`,\n category: `Engine Request`,\n args: [\n {\n name: 'systemName',\n type: 'string'\n },\n {\n name: 'callback',\n type: '(fn: any) => void'\n }]\n };\n}\n","import { type IEventMetadata } from \"@eventbus/events/metadata/types.ts\";\nimport { type RequestInstanceEvent } from \"@eventbus/events/request-instance.ts\";\n\nexport function requestInstance(): IEventMetadata<RequestInstanceEvent['args']> {\n return {\n description: `Event: request-instance`,\n category: `Engine Request`,\n args: [\n {\n name: 'instanceName',\n type: 'string'\n },\n {\n name: 'callback',\n type: '(instance: any) => void'\n }]\n };\n}\n","import { type IEventMetadata } from \"@eventbus/events/metadata/types.ts\";\nimport { type RequestLabelCollectionEvent } from \"@eventbus/events/request-label-collection.ts\";\n\nexport function requestLabelCollection(): IEventMetadata<RequestLabelCollectionEvent['args']> {\n return {\n description: `Event: request-label-collection`,\n category: `Engine Request`,\n args: [\n {\n name: 'language',\n type: 'string'\n },\n {\n name: 'callback',\n type: '(collection: any) => void'\n }]\n };\n}\n","import { type IEventMetadata } from \"@eventbus/events/metadata/types.ts\";\nimport { type RequestLabelCollectionsEvent } from \"@eventbus/events/request-label-collections.ts\";\n\nexport function requestLabelCollections(): IEventMetadata<RequestLabelCollectionsEvent['args']> {\n return {\n description: `Event: request-label-collections`,\n category: `Engine Request`,\n args: [\n {\n name: 'labelIds',\n type: 'string[]'\n },\n {\n name: 'callback',\n type: '(collections: any) => void'\n }]\n };\n}\n","import { type IEventMetadata } from \"@eventbus/events/metadata/types.ts\";\nimport { type RequestTimelineCleanupEvent } from \"@eventbus/events/request-timeline-cleanup.ts\";\n\nexport function requestTimelineCleanup(): IEventMetadata<RequestTimelineCleanupEvent['args']> {\n return {\n description: `Event: request-timeline-cleanup`,\n category: `Engine Request`,\n args: []\n };\n}\n","import { type IEventMetadata } from \"@eventbus/events/metadata/types.ts\";\nimport { type RequestTimelineUriEvent } from \"@eventbus/events/request-timeline-uri.ts\";\n\nexport function requestTimelineUri(): IEventMetadata<RequestTimelineUriEvent['args']> {\n return {\n description: `Event: request-timeline-uri`,\n category: `Engine Request`,\n args: []\n };\n}\n","import { type IEventMetadata } from \"@eventbus/events/metadata/types.ts\";\nimport { type RequestVideoCleanupEvent } from \"@eventbus/events/request-video-cleanup.ts\";\n\nexport function requestVideoCleanup(): IEventMetadata<RequestVideoCleanupEvent['args']> {\n return {\n description: `Event: request-video-cleanup`,\n category: `Navigation`,\n args: []\n };\n}\n","import { type IEventMetadata } from \"@eventbus/events/metadata/types.ts\";\nimport { type RequestVideoUrlEvent } from \"@eventbus/events/request-video-url.ts\";\n\nexport function requestVideoUrl(): IEventMetadata<RequestVideoUrlEvent['args']> {\n return {\n description: `Event: request-video-url`,\n category: `Navigation`,\n args: [\n {\n name: 'videoUrlIndex',\n type: 'number'\n },\n {\n name: 'requestedVideoPosition',\n type: 'number'\n },\n {\n name: 'fromRouting',\n type: 'boolean'\n }]\n };\n}\n","import { type IEventMetadata } from \"@eventbus/events/metadata/types.ts\";\nimport { type CompleteEvent } from \"@eventbus/events/timeline-complete.ts\";\n\nexport function timelineComplete(): IEventMetadata<CompleteEvent['args']> {\n return {\n description: `Event: timeline-complete`,\n category: `Timeline`,\n args: []\n };\n}\n","import { type IEventMetadata } from \"@eventbus/events/metadata/types.ts\";\nimport { type ContainerRequestEvent } from \"@eventbus/events/timeline-container-request.ts\";\n\nexport function timelineContainerRequest(): IEventMetadata<ContainerRequestEvent['args']> {\n return {\n description: `Event: timeline-container-request`,\n category: `Timeline`,\n args: [\n {\n name: 'callback',\n type: '(element: HTMLElement) => void'\n }]\n };\n}\n","import { type IEventMetadata } from \"@eventbus/events/metadata/types.ts\";\nimport { type CurrentTimelineChangeEvent } from \"@eventbus/events/timeline-current-timeline-change.ts\";\n\nexport function timelineCurrentTimelineChange(): IEventMetadata<CurrentTimelineChangeEvent['args']> {\n return {\n description: `Event: timeline-current-timeline-change`,\n category: `Timeline`,\n args: [\n {\n name: 'timelineUri',\n type: 'string'\n }]\n };\n}\n","import { type IEventMetadata } from \"@eventbus/events/metadata/types.ts\";\nimport { type DurationRequestEvent } from \"@eventbus/events/timeline-duration-request.ts\";\n\nexport function timelineDurationRequest(): IEventMetadata<DurationRequestEvent['args']> {\n return {\n description: `Event: timeline-duration-request`,\n category: `Timeline`,\n args: [\n {\n name: 'callback',\n type: '(duration: number) => void'\n }]\n };\n}\n","import { type IEventMetadata } from \"@eventbus/events/metadata/types.ts\";\nimport { type DurationEvent } from \"@eventbus/events/timeline-duration.ts\";\n\nexport function timelineDuration(): IEventMetadata<DurationEvent['args']> {\n return {\n description: `Event: timeline-duration`,\n category: `Timeline`,\n args: [\n {\n name: 'getDuration',\n type: '(() => number) | undefined'\n }]\n };\n}\n","import { type IEventMetadata } from \"@eventbus/events/metadata/types.ts\";\nimport { type FirstFrameEvent } from \"@eventbus/events/timeline-firstframe.ts\";\n\nexport function timelineFirstframe(): IEventMetadata<FirstFrameEvent['args']> {\n return {\n description: `Event: timeline-firstframe`,\n category: `Timeline`,\n args: []\n };\n}\n","import { type IEventMetadata } from \"@eventbus/events/metadata/types.ts\";\nimport { type PauseRequestEvent } from \"@eventbus/events/timeline-pause-request.ts\";\n\nexport function timelinePauseRequest(): IEventMetadata<PauseRequestEvent['args']> {\n return {\n description: `Event: timeline-pause-request`,\n category: `Timeline`,\n args: []\n };\n}\n","import { type IEventMetadata } from \"@eventbus/events/metadata/types.ts\";\nimport { type PauseEvent } from \"@eventbus/events/timeline-pause.ts\";\n\nexport function timelinePause(): IEventMetadata<PauseEvent['args']> {\n return {\n description: `Event: timeline-pause`,\n category: `Timeline`,\n args: []\n };\n}\n","import { type IEventMetadata } from \"@eventbus/events/metadata/types.ts\";\nimport { type PlayRequestEvent } from \"@eventbus/events/timeline-play-request.ts\";\n\nexport function timelinePlayRequest(): IEventMetadata<PlayRequestEvent['args']> {\n return {\n description: `Event: timeline-play-request`,\n category: `Timeline`,\n args: []\n };\n}\n","import { type IEventMetadata } from \"@eventbus/events/metadata/types.ts\";\nimport { type PlayToggleRequestEvent } from \"@eventbus/events/timeline-play-toggle-request.ts\";\n\nexport function timelinePlayToggleRequest(): IEventMetadata<PlayToggleRequestEvent['args']> {\n return {\n description: `Event: timeline-play-toggle-request`,\n category: `Timeline`,\n args: []\n };\n}\n","import { type IEventMetadata } from \"@eventbus/events/metadata/types.ts\";\nimport { type PlayEvent } from \"@eventbus/events/timeline-play.ts\";\n\nexport function timelinePlay(): IEventMetadata<PlayEvent['args']> {\n return {\n description: `Event: timeline-play`,\n category: `Timeline`,\n args: []\n };\n}\n","import { type IEventMetadata } from \"@eventbus/events/metadata/types.ts\";\nimport { type RequestCurrentTimelineEvent } from \"@eventbus/events/timeline-request-current-timeline.ts\";\n\nexport function timelineRequestCurrentTimeline(): IEventMetadata<RequestCurrentTimelineEvent['args']> {\n return {\n description: `Event: timeline-request-current-timeline`,\n category: `Engine Request`,\n args: []\n };\n}\n","import { type IEventMetadata } from \"@eventbus/events/metadata/types.ts\";\nimport { type ResizeRequestEvent } from \"@eventbus/events/timeline-resize-request.ts\";\n\nexport function timelineResizeRequest(): IEventMetadata<ResizeRequestEvent['args']> {\n return {\n description: `Event: timeline-resize-request`,\n category: `Timeline`,\n args: []\n };\n}\n","import { type IEventMetadata } from \"@eventbus/events/metadata/types.ts\";\nimport { type ResizeEvent } from \"@eventbus/events/timeline-resize.ts\";\n\nexport function timelineResize(): IEventMetadata<ResizeEvent['args']> {\n return {\n description: `Event: timeline-resize`,\n category: `Timeline`,\n args: []\n };\n}\n","import { type IEventMetadata } from \"@eventbus/events/metadata/types.ts\";\nimport { type RestartEvent } from \"@eventbus/events/timeline-restart.ts\";\n\nexport function timelineRestart(): IEventMetadata<RestartEvent['args']> {\n return {\n description: `Event: timeline-restart`,\n category: `Timeline`,\n args: []\n };\n}\n","import { type IEventMetadata } from \"@eventbus/events/metadata/types.ts\";\nimport { type SeekRequestEvent } from \"@eventbus/events/timeline-seek-request.ts\";\n\nexport function timelineSeekRequest(): IEventMetadata<SeekRequestEvent['args']> {\n return {\n description: `Event: timeline-seek-request`,\n category: `Timeline`,\n args: [\n {\n name: 'position',\n type: 'number'\n }]\n };\n}\n","import { type IEventMetadata } from \"@eventbus/events/metadata/types.ts\";\nimport { type SeekEvent } from \"@eventbus/events/timeline-seek.ts\";\n\nexport function timelineSeek(): IEventMetadata<SeekEvent['args']> {\n return {\n description: `Event: timeline-seek`,\n category: `Timeline`,\n args: [\n {\n name: 'seekPosition',\n type: 'number'\n },\n {\n name: 'currentPosition',\n type: 'number'\n },\n {\n name: 'duration',\n type: 'number'\n }]\n };\n}\n","import { type IEventMetadata } from \"@eventbus/events/metadata/types.ts\";\nimport { type SeekedEvent } from \"@eventbus/events/timeline-seeked.ts\";\n\nexport function timelineSeeked(): IEventMetadata<SeekedEvent['args']> {\n return {\n description: `Event: timeline-seeked`,\n category: `Timeline`,\n args: [\n {\n name: 'position',\n type: 'number'\n },\n {\n name: 'duration',\n type: 'number'\n }]\n };\n}\n","import { type IEventMetadata } from \"@eventbus/events/metadata/types.ts\";\nimport { type StopRequestEvent } from \"@eventbus/events/timeline-stop-request.ts\";\n\nexport function timelineStopRequest(): IEventMetadata<StopRequestEvent['args']> {\n return {\n description: `Event: timeline-stop-request`,\n category: `Timeline`,\n args: []\n };\n}\n","import { type IEventMetadata } from \"@eventbus/events/metadata/types.ts\";\nimport { type StopEvent } from \"@eventbus/events/timeline-stop.ts\";\n\nexport function timelineStop(): IEventMetadata<StopEvent['args']> {\n return {\n description: `Event: timeline-stop`,\n category: `Timeline`,\n args: []\n };\n}\n","import { type IEventMetadata } from \"@eventbus/events/metadata/types.ts\";\nimport { type TimeEvent } from \"@eventbus/events/timeline-time.ts\";\n\nexport function timelineTime(): IEventMetadata<TimeEvent['args']> {\n return {\n description: `Event: timeline-time`,\n category: `Timeline`,\n args: [\n {\n name: 'position',\n type: 'number'\n }]\n };\n}\n","import { type IEventMetadata } from \"@eventbus/events/metadata/types.ts\";\nimport { type VideoCompleteEvent } from \"@eventbus/events/video-complete.ts\";\n\nexport function videoComplete(): IEventMetadata<VideoCompleteEvent['args']> {\n return {\n description: `Event: video-complete`,\n category: `Navigation`,\n args: [\n {\n name: 'index',\n type: 'number'\n }]\n };\n}\n","export { beforeRequestTimelineUri } from \"@eventbus/events/metadata/before-request-timeline-uri.ts\";\nexport { beforeRequestVideoUrl } from \"@eventbus/events/metadata/before-request-video-url.ts\";\nexport { domMutation } from \"@eventbus/events/metadata/dom-mutation.ts\";\nexport { highlightNavigation } from \"@eventbus/events/metadata/highlight-navigation.ts\";\nexport { languageChange } from \"@eventbus/events/metadata/language-change.ts\";\nexport { navigateToVideoUrl } from \"@eventbus/events/metadata/navigate-to-video-url.ts\";\nexport { pushHistoryState } from \"@eventbus/events/metadata/push-history-state.ts\";\nexport { requestAction } from \"@eventbus/events/metadata/request-action.ts\";\nexport { requestCurrentLanguage } from \"@eventbus/events/metadata/request-current-language.ts\";\nexport { requestCurrentNavigation } from \"@eventbus/events/metadata/request-current-navigation.ts\";\nexport { requestCurrentTimelinePosition } from \"@eventbus/events/metadata/request-current-timeline-position.ts\";\nexport { requestCurrentVideoPosition } from \"@eventbus/events/metadata/request-current-video-position.ts\";\nexport { requestEngineRoot } from \"@eventbus/events/metadata/request-engine-root.ts\";\nexport { requestFunction } from \"@eventbus/events/metadata/request-function.ts\";\nexport { requestInstance } from \"@eventbus/events/metadata/request-instance.ts\";\nexport { requestLabelCollection } from \"@eventbus/events/metadata/request-label-collection.ts\";\nexport { requestLabelCollections } from \"@eventbus/events/metadata/request-label-collections.ts\";\nexport { requestTimelineCleanup } from \"@eventbus/events/metadata/request-timeline-cleanup.ts\";\nexport { requestTimelineUri } from \"@eventbus/events/metadata/request-timeline-uri.ts\";\nexport { requestVideoCleanup } from \"@eventbus/events/metadata/request-video-cleanup.ts\";\nexport { requestVideoUrl } from \"@eventbus/events/metadata/request-video-url.ts\";\nexport { timelineComplete } from \"@eventbus/events/metadata/timeline-complete.ts\";\nexport { timelineContainerRequest } from \"@eventbus/events/metadata/timeline-container-request.ts\";\nexport { timelineCurrentTimelineChange } from \"@eventbus/events/metadata/timeline-current-timeline-change.ts\";\nexport { timelineDurationRequest } from \"@eventbus/events/metadata/timeline-duration-request.ts\";\nexport { timelineDuration } from \"@eventbus/events/metadata/timeline-duration.ts\";\nexport { timelineFirstframe } from \"@eventbus/events/metadata/timeline-firstframe.ts\";\nexport { timelinePauseRequest } from \"@eventbus/events/metadata/timeline-pause-request.ts\";\nexport { timelinePause } from \"@eventbus/events/metadata/timeline-pause.ts\";\nexport { timelinePlayRequest } from \"@eventbus/events/metadata/timeline-play-request.ts\";\nexport { timelinePlayToggleRequest } from \"@eventbus/events/metadata/timeline-play-toggle-request.ts\";\nexport { timelinePlay } from \"@eventbus/events/metadata/timeline-play.ts\";\nexport { timelineRequestCurrentTimeline } from \"@eventbus/events/metadata/timeline-request-current-timeline.ts\";\nexport { timelineResizeRequest } from \"@eventbus/events/metadata/timeline-resize-request.ts\";\nexport { timelineResize } from \"@eventbus/events/metadata/timeline-resize.ts\";\nexport { timelineRestart } from \"@eventbus/events/metadata/timeline-restart.ts\";\nexport { timelineSeekRequest } from \"@eventbus/events/metadata/timeline-seek-request.ts\";\nexport { timelineSeek } from \"@eventbus/events/metadata/timeline-seek.ts\";\nexport { timelineSeeked } from \"@eventbus/events/metadata/timeline-seeked.ts\";\nexport { timelineStopRequest } from \"@eventbus/events/metadata/timeline-stop-request.ts\";\nexport { timelineStop } from \"@eventbus/events/metadata/timeline-stop.ts\";\nexport { timelineTime } from \"@eventbus/events/metadata/timeline-time.ts\";\nexport { videoComplete } from \"@eventbus/events/metadata/video-complete.ts\";\nexport * from \"@eventbus/events/metadata/types.ts\";\n","import type {IAction} from '@action/types.ts';\nimport type {IEventbusListener} from '@eventbus/types.ts';\n\n/**\n * The `IEventbusListener` first registers a number of actions that are then\n * executed when the specified event is broadcast.\n */\nexport class ActionRegistryEventbusListener implements IEventbusListener {\n private _actionRegistry = new Map<string, IAction[]>();\n\n registerAction(\n action: IAction,\n eventName: string,\n eventTopic?: string\n ): void {\n if (eventTopic?.length) {\n eventName = `${eventName}:${eventTopic}`;\n }\n if (!this._actionRegistry.has(eventName)) {\n this._actionRegistry.set(eventName, []);\n }\n this._actionRegistry.get(eventName)?.push(action);\n }\n\n handleEvent(\n eventName: string,\n eventTopic: string | undefined,\n args: any[]\n ): void {\n if (eventTopic) {\n eventName = `${eventName}:${eventTopic}`;\n }\n const actions = this._actionRegistry.get(eventName);\n if (actions) {\n const operationData = {\n eventArgs: args,\n };\n actions.forEach(action => {\n action.start(operationData);\n });\n }\n }\n}\n","import type {\n IEventbus,\n IEventbusInterceptor,\n IEventbusListener,\n TEventbusRemover,\n TEventHandler,\n} from '@eventbus/types.ts';\n\nexport class Eventbus implements IEventbus {\n private eventHandlers = new Map<string, TEventHandler[]>();\n private eventInterceptors = new Map<string, IEventbusInterceptor[]>();\n private eventListeners: IEventbusListener[] = [];\n\n constructor() {\n this.clear();\n }\n\n clear() {\n this.eventHandlers = new Map<string, TEventHandler[]>();\n this.eventListeners = [];\n this.eventInterceptors = new Map<string, IEventbusInterceptor[]>();\n }\n\n _getEventInterceptors(\n eventName: string,\n eventTopic?: string\n ): IEventbusInterceptor[] {\n if (eventTopic) {\n eventName = `${eventName}:${eventTopic}`;\n }\n if (!this.eventInterceptors.has(eventName)) {\n this.eventInterceptors.set(eventName, []);\n }\n return this.eventInterceptors.get(eventName) as IEventbusInterceptor[];\n }\n\n _getEventHandlers(eventName: string, eventTopic?: string): TEventHandler[] {\n if (eventTopic) {\n eventName = `${eventName}:${eventTopic}`;\n }\n if (!this.eventHandlers.has(eventName)) {\n this.eventHandlers.set(eventName, []);\n }\n return this.eventHandlers.get(eventName) as TEventHandler[];\n }\n\n on(\n eventName: string,\n eventHandler: TEventHandler,\n eventTopic?: string\n ): TEventbusRemover {\n this._getEventHandlers(eventName, eventTopic).push(eventHandler);\n return () => {\n this.off(eventName, eventHandler, eventTopic);\n };\n }\n\n once(\n eventName: string,\n eventHandler: TEventHandler,\n eventTopic?: string\n ): TEventbusRemover {\n const eventHandlerDecorator = (...args: any[]) => {\n eventHandler(...args);\n this.off(eventName, eventHandlerDecorator, eventTopic);\n };\n this.on(eventName, eventHandlerDecorator, eventTopic);\n return () => {\n this.off(eventName, eventHandlerDecorator, eventTopic);\n };\n }\n\n off(\n eventName: string,\n eventHandler: TEventHandler,\n eventTopic?: string\n ): void {\n const handlers = this._getEventHandlers(eventName, eventTopic);\n if (handlers) {\n const idx = handlers.indexOf(eventHandler);\n if (idx > -1) {\n handlers.splice(idx, 1);\n }\n }\n }\n\n broadcast(eventName: string, args: any[]): void {\n this._callHandlers(eventName, undefined, args);\n }\n\n broadcastForTopic(eventName: string, eventTopic: string, args: any[]): void {\n this._callHandlers(eventName, eventTopic, args);\n }\n\n registerEventlistener(eventbusListener: IEventbusListener): TEventbusRemover {\n this.eventListeners.push(eventbusListener);\n return () => {\n const index = this.eventListeners.indexOf(eventbusListener);\n if (index > -1) {\n this.eventListeners.splice(index, 1);\n }\n };\n }\n\n registerInterceptor(\n eventName: string,\n interceptor: IEventbusInterceptor,\n eventTopic?: string\n ): TEventbusRemover {\n const interceptors = this._getEventInterceptors(eventName, eventTopic);\n interceptors.push(interceptor);\n return () => {\n const index = interceptors.indexOf(interceptor);\n if (index > -1) {\n interceptors.splice(index, 1);\n }\n };\n }\n\n _callHandlers(\n eventName: string,\n eventTopic: string | undefined,\n args: any = []\n ): void {\n const handlers = this._getEventHandlers(eventName, eventTopic);\n\n if (handlers) {\n const interceptors = this._getEventInterceptors(eventName, eventTopic);\n\n interceptors.forEach(interceptor => {\n args = interceptor.intercept(args);\n });\n\n this.eventListeners.forEach((listener: IEventbusListener) => {\n listener.handleEvent(eventName, eventTopic, args);\n });\n\n if (args?.length) {\n handlers.forEach((handler: TEventHandler) => handler(...args));\n } else {\n handlers.forEach((handler: TEventHandler) => handler());\n }\n }\n }\n}\n","import type {IEventbus, IEventbusInterceptor} from '@eventbus/types.ts';\n\nexport class RequestVideoUriInterceptor implements IEventbusInterceptor {\n constructor(private eventbus: IEventbus) {}\n\n intercept(args: any[]): any[] {\n this.eventbus.broadcast('before-request-timeline-uri', args.slice() as any);\n return args;\n }\n}\n","export {ActionRegistryEventbusListener} from '@eventbus/actionregistry-eventbus-listener.ts';\nexport {Eventbus} from '@eventbus/eventbus.ts';\nexport * from '@eventbus/events/index.ts';\nexport type {IEventMetadata} from '@eventbus/events/metadata/types.ts';\nexport {RequestVideoUriInterceptor} from '@eventbus/request-video-uri-interceptor.ts';\nexport * from '@eventbus/types.ts';\n","import type {IEndableAction, ITimelineAction} from '@action/types.ts';\nimport type {\n IResolvedEngineConfiguration,\n IResolvedTimelineConfiguration,\n} from '@configuration/types.ts';\nimport type {\n EventName,\n IEventbus,\n TEventbusRemover,\n TEventHandler,\n} from '@eventbus/types.ts';\nimport type {ITimelineProvider} from '@timelineproviders/types.ts';\nimport $ from 'jquery';\nimport type {LanguageManager} from './language-manager.ts';\nimport type {\n IEligiusEngine,\n ITimelineProviderInfo,\n TimelineTypes,\n TResultCallback,\n} from './types.ts';\n\ntype ActionMethod =\n | (IEndableAction['start'] & ActionMethodMetadata)\n | (IEndableAction['end'] & ActionMethodMetadata);\n\ninterface ActionMethodMetadata {\n id: string;\n isStart: boolean;\n startPosition?: number;\n}\n\n/**\n * This is where the magic happens. The engine is responsible for starting and stopping\n * the given timeline provider and triggering the actions associated with the positions along the timeline.\n */\nexport class EligiusEngine implements IEligiusEngine {\n private _timeLineActionsLookup: Record<\n string,\n Record<number, ActionMethod[]>\n > = {};\n private _timelineLookupCache: Map<string, IResolvedTimelineConfiguration> =\n new Map();\n private _eventbusRemovers: TEventbusRemover[] = [];\n private _currentTimelineUri: string = '';\n private _activeTimelineProvider: ITimelineProvider | undefined = undefined;\n private _lastPosition: number = -1;\n\n constructor(\n private configuration: IResolvedEngineConfiguration,\n private eventbus: IEventbus,\n private timelineProviders: Record<TimelineTypes, ITimelineProviderInfo>,\n private languageManager: LanguageManager\n ) {}\n\n /**\n * Initializes the engine by creating the HTML layout and the first time line\n * by executing its initActions.\n */\n init(): Promise<ITimelineProvider> {\n this._createLayoutTemplate();\n\n this._addEventbusListeners();\n\n const {timelines} = this.configuration;\n\n this._currentTimelineUri = timelines?.[0].uri ?? '';\n\n this._createTimelineLookup();\n\n return this._initializeTimelineProvider();\n }\n\n private _createLayoutTemplate() {\n const {containerSelector} = this.configuration;\n const container = $(containerSelector);\n\n if (!container || !container.length) {\n throw new Error(`Container selector not found: ${containerSelector}`);\n }\n\n const {layoutTemplate} = this.configuration;\n\n if (layoutTemplate?.length) {\n container.html(layoutTemplate);\n } else {\n console.warn('layoutTemplate is empty, unable to create layout');\n }\n }\n\n private async _initializeTimelineProvider() {\n if (!this.configuration.timelines?.length) {\n throw new Error('No timelines present');\n }\n\n const firstTimeline = this.configuration.timelines[0];\n const providerSettings = this.timelineProviders[firstTimeline.type];\n\n if (!providerSettings) {\n throw new Error(\n `No timeline provider configured for type ${firstTimeline.type}`\n );\n }\n\n this._activeTimelineProvider?.destroy();\n this._activeTimelineProvider = providerSettings.provider;\n\n if (!this._activeTimelineProvider) {\n throw new Error('NO ACTIVE TIMELINE PROVIDER');\n }\n\n this._activeTimelineProvider.onTime(\n this._onTimeHandler.bind(this, Math.floor)\n );\n this._activeTimelineProvider.onComplete(\n this._onCompleteCallback.bind(this)\n );\n this._activeTimelineProvider.onFirstFrame(\n this._onFirstFrameCallback.bind(this)\n );\n this._activeTimelineProvider.onRestart(this._onRestartCallback.bind(this));\n\n await this._activeTimelineProvider.init();\n await this._executeActions(this.configuration.initActions, 'start');\n return this._activeTimelineProvider;\n }\n\n private _onCompleteCallback() {\n this.eventbus.broadcast('timeline-complete', []);\n }\n\n private _onFirstFrameCallback() {\n this.eventbus.broadcast('timeline-firstframe', []);\n this.eventbus.broadcast('timeline-duration', [\n this._activeTimelineProvider?.getDuration,\n ]);\n }\n\n private _onRestartCallback() {\n this.eventbus.broadcast('timeline-restart', []);\n }\n\n private async _cleanUp() {\n await this._cleanUpTimeline();\n await this._executeActions(\n [...this.configuration.initActions].reverse(),\n 'end'\n );\n }\n\n /**\n * Cleans up all the necessary parts that the engine initialized.\n * - It ends the currently active operations and the init actions.\n * - It removes all its eventbus listeners, handlers and interceptors.\n * - It destroys all of its timeline providers\n * - It empties the HTML element indicated by the containerSelector configuration property.\n *\n */\n async destroy() {\n await this._cleanUp();\n\n this.languageManager.destroy();\n\n this._activeTimelineProvider = undefined;\n this._eventbusRemovers.forEach(remover => remover());\n\n if (this.timelineProviders) {\n Object.values(this.timelineProviders).forEach(providerInfo =>\n providerInfo.provider.destroy()\n );\n }\n\n const {containerSelector} = this.configuration;\n const container = $(containerSelector);\n container.empty();\n }\n\n private _addEventListener(\n eventName: string,\n eventHandler: TEventHandler,\n eventTopic?: string\n ) {\n this._eventbusRemovers.push(\n this.eventbus.on(eventName as EventName, eventHandler, eventTopic)\n );\n }\n\n private _addEventbusListeners() {\n this._addEventListener(\n 'request-engine-root',\n this._handleRequestEngineRoot.bind(\n this,\n this.configuration.containerSelector\n )\n );\n this._addEventListener(\n 'request-timeline-uri',\n this._handleRequestTimelineUri.bind(this)\n );\n this._addEventListener(\n 'request-current-timeline-position',\n this._handleRequestTimelinePosition.bind(this, Math.floor)\n );\n this._addEventListener(\n 'request-timeline-cleanup',\n this._handleTimelineComplete.bind(this)\n );\n this._addEventListener(\n 'timeline-request-current-timeline',\n this._requestCurrentTimeline.bind(this)\n );\n this._addEventListener(\n 'timeline-play-toggle-request',\n this._toggleplay.bind(this)\n );\n\n this._addEventListener(\n 'timeline-play-request',\n this._playRequest.bind(this)\n );\n\n this._addEventListener(\n 'timeline-stop-request',\n this._stopRequest.bind(this)\n );\n\n this._addEventListener(\n 'timeline-pause-request',\n this._pauseRequest.bind(this)\n );\n\n this._addEventListener(\n 'timeline-container-request',\n this.containerRequest.bind(this)\n );\n\n this._addEventListener(\n 'timeline-duration-request',\n this.durationRequest.bind(this)\n );\n\n this._addEventListener(\n 'timeline-seek-request',\n this.seekRequest.bind(this)\n );\n }\n\n private async seekRequest(position: number) {\n if (!this._activeTimelineProvider) {\n return;\n }\n const seekPosition = Math.floor(position);\n\n const duration = this._activeTimelineProvider.getDuration();\n const currentPosition = this._activeTimelineProvider.getPosition();\n\n if (seekPosition < 0 || seekPosition > duration) {\n return;\n }\n\n this.eventbus.broadcast('timeline-seek', [\n seekPosition,\n currentPosition,\n duration,\n ]);\n\n await this._activeTimelineProvider.seek(seekPosition);\n await this._executeSeekActions(seekPosition);\n\n this.eventbus.broadcast('timeline-seeked', [\n this._activeTimelineProvider.getPosition(),\n duration,\n ]);\n\n this.eventbus.broadcast('timeline-time', [\n this._activeTimelineProvider.getPosition(),\n ]);\n\n if (this._activeTimelineProvider?.playState === 'running') {\n this._activeTimelineProvider?.start();\n }\n }\n\n private durationRequest(callBack: TResultCallback<number | undefined>) {\n callBack(this._activeTimelineProvider?.getDuration());\n }\n\n private containerRequest(\n callBack: TResultCallback<JQuery<HTMLElement> | undefined>\n ) {\n callBack(this._activeTimelineProvider?.getContainer());\n }\n\n private _pauseRequest() {\n if (!this._activeTimelineProvider) {\n return;\n }\n\n this._activeTimelineProvider.pause();\n this.eventbus.broadcast('timeline-pause', []);\n }\n\n private _stopRequest() {\n if (!this._activeTimelineProvider) {\n return;\n }\n\n this._activeTimelineProvider.stop();\n this.eventbus.broadcast('timeline-stop', []);\n }\n\n private _playRequest() {\n if (!this._activeTimelineProvider) {\n return;\n }\n\n this._activeTimelineProvider.start();\n this.eventbus.broadcast('timeline-play', []);\n }\n\n private _toggleplay() {\n if (!this._activeTimelineProvider) {\n return;\n }\n\n if (this._activeTimelineProvider.playState === 'running') {\n this._activeTimelineProvider.pause();\n } else {\n this._activeTimelineProvider.start();\n }\n }\n\n private _createTimelineLookup() {\n if (!this.configuration.timelines) {\n return;\n }\n\n // Consolidated loop: process both start and end actions in a single pass\n this.configuration.timelines.forEach(timelineInfo => {\n // Populate timeline lookup cache for O(1) access\n this._timelineLookupCache.set(timelineInfo.uri, timelineInfo);\n\n timelineInfo.timelineActions.forEach(timelineAction => {\n this._addTimelineActionStart(timelineInfo.uri, timelineAction);\n this._addTimelineActionEnd(timelineInfo.uri, timelineAction);\n });\n });\n\n EligiusEngine.sortTimelines(Object.values(this._timeLineActionsLookup));\n }\n\n static sortTimelines(timelines: Record<number, ActionMethod[]>[]) {\n timelines.forEach(timelineActions => {\n Object.keys(timelineActions).forEach(key => {\n const numericKey = Number(key);\n timelineActions[numericKey] = EligiusEngine.sortActionsPerPosition(\n timelineActions[numericKey]\n );\n });\n });\n }\n\n static sortActionsPerPosition(actions: ActionMethod[]) {\n const [startMethods, endMethods] = actions.reduce(\n (acc, item) => {\n if (item.isStart) {\n acc[0].push(item);\n } else {\n acc[1].push(item);\n }\n return acc;\n },\n [[], []] as [ActionMethod[], ActionMethod[]]\n );\n return [\n ...endMethods.sort(sortActionMethodsHighestStartPositionFirst),\n ...startMethods,\n ];\n }\n\n private _addTimelineActionStart(\n uri: string,\n timeLineAction: ITimelineAction\n ) {\n const startPosition = timeLineAction.duration.start;\n const timelineStartPositions = this._initializeTimelinePosition(\n this._initializeUriLookup(this._timeLineActionsLookup, uri),\n startPosition\n );\n const startMethod = timeLineAction.start.bind(\n timeLineAction\n ) as ActionMethod;\n\n if (timeLineAction.id?.length) {\n startMethod.id = timeLineAction.id;\n }\n startMethod.isStart = true;\n\n timelineStartPositions.push(startMethod);\n }\n\n private _addTimelineActionEnd(uri: string, timeLineAction: ITimelineAction) {\n let end = timeLineAction.duration.end;\n if (end < 0) {\n end = timeLineAction.duration.end = Infinity;\n }\n\n if (Number.isFinite(end)) {\n const timelineEndPositions = this._initializeTimelinePosition(\n this._timeLineActionsLookup[uri],\n end\n );\n const endMethod = timeLineAction.end.bind(timeLineAction) as ActionMethod;\n\n if (timeLineAction.id?.length) {\n endMethod.id = timeLineAction.id;\n endMethod.startPosition = timeLineAction.duration.start;\n }\n endMethod.isStart = false;\n\n timelineEndPositions.push(endMethod);\n }\n }\n\n private _initializeUriLookup(\n lookup: Record<string, Record<number, ActionMethod[]>>,\n uri: string\n ): Record<number, ActionMethod[]> {\n if (!lookup[uri]) {\n lookup[uri] = {};\n }\n\n return lookup[uri];\n }\n\n private _initializeTimelinePosition(\n lookup: Record<number, ActionMethod[]>,\n position: number\n ): ActionMethod[] {\n if (!lookup[position]) {\n lookup[position] = [] as ActionMethod[];\n }\n\n return lookup[position];\n }\n\n private async _executeActions(\n actions: IEndableAction[],\n methodName: 'start' | 'end'\n ): Promise<void> {\n // Iterative implementation (converted from recursive)\n if (actions.length === 0) {\n return;\n }\n\n for (const action of actions) {\n await action[methodName]();\n }\n }\n\n private _handleRequestEngineRoot(\n engineRootSelector: string,\n resultCallback: TResultCallback<JQuery<HTMLElement>>\n ) {\n resultCallback($(engineRootSelector));\n }\n\n private async _handleRequestTimelineUri(uri: string, position: number = 0) {\n if (!this._activeTimelineProvider) {\n return;\n }\n\n this._activeTimelineProvider.stop();\n\n await this._cleanUpTimeline();\n\n const timelineConfig = this._timelineLookupCache.get(uri);\n if (\n !timelineConfig ||\n !this._activeTimelineProvider ||\n this._currentTimelineUri === timelineConfig.uri\n ) {\n return;\n }\n this._currentTimelineUri = timelineConfig.uri;\n\n this.eventbus.broadcast('timeline-current-timeline-change', [\n this._currentTimelineUri,\n ]);\n\n const newProviderSettings = this.timelineProviders[timelineConfig.type];\n\n if (this._activeTimelineProvider !== newProviderSettings.provider) {\n this._activeTimelineProvider.destroy();\n this._activeTimelineProvider = newProviderSettings.provider;\n }\n\n this._activeTimelineProvider.loop = timelineConfig.loop;\n\n if (!this._activeTimelineProvider.loop && position > 0) {\n this.eventbus.once('timeline-firstframe', async () => {\n if (!this._activeTimelineProvider) {\n return;\n }\n\n this._activeTimelineProvider.pause();\n this.eventbus.broadcast('timeline-duration', [\n this._activeTimelineProvider.getDuration,\n ]);\n\n await this._executeStartActions();\n\n const seekPosition = await this._activeTimelineProvider.seek(position);\n this.seekRequest(seekPosition);\n });\n }\n\n this._activeTimelineProvider.playlistItem(uri);\n }\n\n private _cleanUpTimeline() {\n return this._executeRelevantActions(this._getActiveActions, 'end');\n }\n\n private _executeStartActions() {\n return this._executeRelevantActions(\n this._getActionsForPosition.bind(this, 0),\n 'start'\n );\n }\n\n /**\n * Gets all of the inactive actions whose duration falls within the given timeline position.\n *\n * @param position the given position\n * @param actions all of the relevant actions\n * @returns\n */\n private _getActionsForPosition(position: number, actions: ITimelineAction[]) {\n return actions.filter(\n action =>\n !action.active &&\n action.duration.start <= position &&\n action.duration.end >= position\n );\n }\n\n private _getActiveActions(allActions: ITimelineAction[]) {\n const actions = allActions.filter(action => action.active);\n return actions.sort(sortActionsHighestStartPositionFirst);\n }\n\n private _executeRelevantActions(\n filter: (actions: ITimelineAction[]) => ITimelineAction[],\n executionType: 'start' | 'end'\n ) {\n const timelineActions = this._getTimelineActionsForCurrentTimeline();\n const currentActions = filter.apply(this, [timelineActions]);\n return this._executeActions(currentActions, executionType);\n }\n\n private _handleRequestTimelinePosition(\n floor: (x: number) => number,\n resultCallback: TResultCallback<number>\n ) {\n resultCallback(floor(this._activeTimelineProvider?.getPosition() || -1));\n }\n\n private _handleTimelineComplete() {\n this._cleanUpTimeline();\n }\n\n private _getTimelineActionsForCurrentTimeline() {\n return this._getTimelineActionsForUri(this._currentTimelineUri);\n }\n\n private _requestCurrentTimeline(resultCallback: TResultCallback<string>) {\n resultCallback(this._currentTimelineUri);\n }\n\n private _getTimelineActionsForUri(uri: string): ITimelineAction[] {\n const info = this._timelineLookupCache.get(uri);\n return info?.timelineActions ?? [];\n }\n\n private _onTimeHandler(floor: (x: number) => number, position: number) {\n if (!Number.isNaN(position)) {\n const pos = floor(position);\n\n if (this._lastPosition !== pos) {\n this._executeActionsForPosition(pos);\n this.eventbus.broadcast('timeline-time', [pos]);\n }\n }\n }\n\n private _executeActionsForPosition(position: number) {\n this._lastPosition = position;\n const actions = this._timeLineActionsLookup[this._currentTimelineUri];\n\n if (actions) {\n const executions = actions[position];\n executions?.forEach(exec => exec());\n }\n }\n\n private async _executeSeekActions(position: number) {\n const timelineActions = this._getTimelineActionsForCurrentTimeline();\n\n if (!timelineActions) {\n return Promise.resolve();\n }\n\n const currentActions = this._getActiveActions(timelineActions).filter(\n action =>\n !(action.duration.start <= position && action.duration.end >= position)\n );\n const newActions = this._getActionsForPosition(position, timelineActions);\n await this._executeActions(currentActions, 'end');\n return this._executeActions(newActions, 'start');\n }\n}\n\nconst sortActionsHighestStartPositionFirst = (\n a: ITimelineAction,\n b: ITimelineAction\n) => {\n if (b.duration.start < a.duration.start) {\n return -1;\n } else if (b.duration.start > a.duration.start) {\n return 1;\n } else {\n return 0;\n }\n};\n\nconst sortActionMethodsHighestStartPositionFirst = (\n a: ActionMethod,\n b: ActionMethod\n) => {\n if (b.startPosition === undefined || a.startPosition === undefined) {\n return 0;\n }\n if (b.startPosition < a.startPosition) {\n return -1;\n } else if (b.startPosition > a.startPosition) {\n return 1;\n } else {\n return 0;\n }\n};\n","import * as ctrls from '@controllers/index.ts';\nimport * as evtb from '@eventbus/index.ts';\nimport * as ops from '@operation/index.ts';\nimport type {TOperation} from '@operation/types.ts';\nimport * as prvdrs from '@timelineproviders/index.ts';\nimport {EligiusEngine} from '../eligius-engine.ts';\nimport type {IResourceImporter} from '../types.ts';\n\nconst operations: Record<string, TOperation<any>> = ops as any;\nconst controllers: Record<string, any> = ctrls;\nconst providers: Record<string, any> = prvdrs;\nconst eventbus: Record<string, any> = evtb;\n\nexport class EligiusResourceImporter implements IResourceImporter {\n engines = new Map();\n constructor() {\n this.engines.set('EligiusEngine', EligiusEngine);\n }\n\n getOperationNames(): string[] {\n return Object.keys(operations);\n }\n\n getControllerNames(): string[] {\n return Object.keys(controllers);\n }\n\n getProviderNames(): string[] {\n return Object.keys(providers);\n }\n\n import(name: string): Record<string, any> {\n const value =\n operations[name] ??\n controllers[name] ??\n providers[name] ??\n eventbus[name] ??\n this.engines.get(name);\n\n return {[name]: value};\n }\n}\n","import {getGlobals} from '@operation/helper/globals.ts';\n\nexport function setGlobal(name: string, value: any) {\n const cache = getGlobals();\n cache[name] = value;\n}\n","import type {IEventbus, TEventbusRemover} from '@eventbus/types.ts';\nimport {setGlobal} from '@operation/helper/set-global.ts';\nimport $ from 'jquery';\nimport type {\n ILabel,\n ILanguageLabel,\n TLanguageCode,\n TResultCallback,\n} from './types.ts';\n\n/**\n * This class manages the labels for an {@link IEligiusEngine} instance.\n *\n * It handles the request-label-collection, request-label-collections, request-current-language and language-change events.\n *\n */\nexport class LanguageManager {\n private _labelLookup: Record<string, ILabel[]>;\n private _eventbusRemovers: TEventbusRemover[] = [];\n\n constructor(\n private _currentLanguage: TLanguageCode,\n labels: ILanguageLabel[],\n private _eventbus: IEventbus\n ) {\n if (!_currentLanguage) {\n throw new Error('language ctor arg cannot have zero length');\n }\n setGlobal('defaultLanguage', _currentLanguage);\n this._setRootElementLang(_currentLanguage);\n this._labelLookup = this._createLabelLookup(labels);\n this._addEventbusListeners(_eventbus);\n }\n\n destroy() {\n this._eventbusRemovers.forEach(x => x());\n }\n\n _addEventbusListeners(eventbus: IEventbus) {\n this._eventbusRemovers.push(\n eventbus.on(\n 'request-label-collection',\n this._handleRequestLabelCollection.bind(this)\n )\n );\n this._eventbusRemovers.push(\n eventbus.on(\n 'request-label-collections',\n this._handleRequestLabelCollections.bind(this)\n )\n );\n this._eventbusRemovers.push(\n eventbus.on(\n 'request-current-language',\n this._handleRequestCurrentLanguage.bind(this)\n )\n );\n this._eventbusRemovers.push(\n eventbus.on(\n 'language-change',\n this._handleLanguageChange.bind(this) as any\n )\n );\n }\n\n _handleRequestCurrentLanguage(\n resultCallback: TResultCallback<TLanguageCode>\n ) {\n resultCallback(this._currentLanguage);\n }\n\n _handleRequestLabelCollection(\n labelId: string,\n resultCallback: TResultCallback<ILabel[]>\n ) {\n resultCallback(this._labelLookup[labelId]);\n }\n\n _handleRequestLabelCollections(\n labelIds: string[],\n resultCallback: TResultCallback<ILabel[][]>\n ) {\n const labelCollections = labelIds.map(labelId => {\n return this._labelLookup[labelId];\n });\n resultCallback(labelCollections);\n }\n\n _handleLanguageChange(language: TLanguageCode) {\n this._currentLanguage = language;\n this._setRootElementLang(this._currentLanguage);\n }\n\n _setRootElementLang(language: TLanguageCode) {\n const callBack = (rootSelector: string) => {\n const lang = this._extractPrimaryLanguage(language);\n $(rootSelector).attr('lang', lang);\n };\n this._eventbus.broadcast('request-engine-root', [callBack]);\n }\n\n _extractPrimaryLanguage(culture: TLanguageCode) {\n return culture.split('-').shift() as string;\n }\n\n _createLabelLookup(labels: ILanguageLabel[]) {\n return labels.reduce<Record<string, ILabel[]>>((acc, label) => {\n acc[label.id] = label.labels;\n return acc;\n }, {});\n }\n}\n","import type {IAction} from '@action/types.ts';\nimport {ConfigurationResolver} from '@configuration/configuration-resolver.ts';\nimport type {\n IEngineConfiguration,\n IResolvedEngineConfiguration,\n} from '@configuration/types.ts';\nimport {DevToolEventListener} from '@diagnostics/devtool-event-listener.ts';\nimport {Diagnostics} from '@diagnostics/diagnostics.ts';\nimport {\n DEV_TOOLS_KEY,\n type TDiagnosticType,\n type TWindowWithDevtools,\n} from '@diagnostics/types.ts';\nimport {\n ActionRegistryEventbusListener,\n Eventbus,\n type IEventbus,\n RequestVideoUriInterceptor,\n type TEventbusRemover,\n} from '@eventbus/index.ts';\nimport {prepareValueForSerialization} from '@util/prepare-value-for-serialization.ts';\nimport hk, {type HotkeysEvent} from 'hotkeys-js';\nimport $ from 'jquery';\nimport {LanguageManager} from './language-manager.ts';\nimport type {\n IConfigurationResolver,\n IEligiusEngine,\n IEngineFactory,\n IEngineFactoryOptions,\n ISimpleResourceImporter,\n ITimelineProviderInfo,\n TimelineTypes,\n TResultCallback,\n} from './types.ts';\n\nconst hotkeys = hk.default || hk;\n\n/**\n * The EngineFactory is used to create and initialize an {@link IEligiusEngine} instance.\n *\n * It prepares a resolved configuration and creates the engine based on the class defined in the configuration.\n *\n * @example Loading a configuration and creating an IEligiusEngine instance\n * ```ts\n * import { IEngineConfiguration, EngineFactory, WebpackResourceImporter } from 'eligius';\n * import * as engineConfig from './my-eligius-config.json';\n *\n * const factory = new EngineFactory(new WebpackResourceImporter(), window);\n *\n * const engine = factory.createEngine((engineConfig as unknown) as IEngineConfiguration);\n *\n * engine.init().then(()=> {console.log('Eligius engine ready for business');});\n * ```\n */\nexport class EngineFactory implements IEngineFactory {\n private _actionsLookup: Record<string, IAction> = {};\n private _eventbus: IEventbus;\n private _eventRemovers: TEventbusRemover[] = [];\n private _importer: ISimpleResourceImporter;\n private _resizeTimeout: any = -1;\n\n constructor(\n importer: ISimpleResourceImporter,\n windowRef: Window,\n options?: IEngineFactoryOptions\n ) {\n this._importer = importer;\n this._eventbus = options?.eventbus ?? new Eventbus();\n\n Diagnostics.active = options?.devtools ?? false;\n if (Diagnostics.active) {\n this._initializeDevtools(this._eventbus);\n }\n\n this._eventRemovers.push(\n this._eventbus.on(\n 'request-instance',\n this._requestInstanceHandler.bind(this)\n )\n );\n this._eventRemovers.push(\n this._eventbus.on('request-action', this._requestActionHandler.bind(this))\n );\n this._eventRemovers.push(\n this._eventbus.on(\n 'request-function',\n this._requestFunctionHandler.bind(this)\n )\n );\n\n const handleSpaceBound = this._handleSpacePress.bind(this);\n hotkeys('space', handleSpaceBound);\n this._eventRemovers.push(() => hotkeys.unbind('space', handleSpaceBound));\n\n const resizeBound = this._resizeHandler.bind(this);\n const jqWin = $(windowRef);\n jqWin.on('resize', resizeBound);\n this._eventRemovers.push(() => jqWin.off('resize', resizeBound));\n }\n\n private _handleSpacePress(\n keyboardEvent: KeyboardEvent,\n _hotkeysEvent: HotkeysEvent\n ): void | boolean {\n keyboardEvent.preventDefault();\n this._eventbus.broadcast('timeline-play-toggle-request', []);\n return false;\n }\n\n private _initializeDevtools(eventbus: IEventbus) {\n const diagnosticInfo = (window as unknown as TWindowWithDevtools)[\n DEV_TOOLS_KEY\n ];\n\n if (diagnosticInfo) {\n const {agent} = diagnosticInfo;\n\n this._eventRemovers.push(\n eventbus.registerEventlistener(new DevToolEventListener(agent))\n );\n\n this._eventRemovers.push(\n agent.subscribe(message => {\n if (message.type === 'playcontrol') {\n switch (message.data.kind) {\n case 'play':\n this._eventbus.broadcast('timeline-play-request', []);\n break;\n case 'stop':\n this._eventbus.broadcast('timeline-stop-request', []);\n break;\n case 'pause':\n this._eventbus.broadcast('timeline-pause-request', []);\n break;\n case 'seek':\n this._eventbus.broadcast('timeline-seek-request', [\n (message.data.args ?? 0) as number,\n ]);\n break;\n }\n }\n })\n );\n\n Diagnostics.send = (name: TDiagnosticType, messageData: any) => {\n const message = prepareValueForSerialization(messageData);\n try {\n agent.postMessage(name, message);\n } catch (e) {\n console.error('postmessage failed');\n console.error(e);\n console.log('message', message);\n }\n };\n\n Diagnostics.send(\n 'eligius-diagnostics-factory',\n 'Diagnostics initialized'\n );\n } else {\n console.warn(\n `${DEV_TOOLS_KEY} property not found on window, please install the Eligius Devtools extension.`\n );\n }\n }\n\n destroy() {\n this._eventRemovers.forEach(x => x());\n }\n\n private _resizeHandler() {\n if (this._resizeTimeout) {\n clearTimeout(this._resizeTimeout);\n this._resizeTimeout = -1;\n }\n this._resizeTimeout = setTimeout(() => {\n this._eventbus.broadcast('timeline-resize', []);\n }, 200);\n }\n\n private _importSystemEntryWithEventbusDependency(systemName: string): any {\n const ctor = this._importSystemEntry(systemName);\n return new ctor(this._eventbus);\n }\n\n private _importSystemEntry(systemName: string): any {\n return this._importer.import(systemName)[systemName];\n }\n\n private _requestInstanceHandler(\n systemName: string,\n resultCallback: TResultCallback<any>\n ) {\n resultCallback(this._importSystemEntryWithEventbusDependency(systemName));\n }\n\n private _requestFunctionHandler(\n systemName: string,\n resultCallback: TResultCallback<any>\n ) {\n resultCallback(this._importSystemEntry(systemName));\n }\n\n private _requestActionHandler(\n systemName: string,\n resultCallback: TResultCallback<IAction | null>\n ) {\n const action = this._actionsLookup[systemName];\n if (action) {\n resultCallback(action);\n } else {\n console.error(`Unknown action: ${systemName}`);\n resultCallback(null);\n }\n }\n\n createEngine(\n configuration: IEngineConfiguration,\n resolver?: IConfigurationResolver\n ): IEligiusEngine {\n const {systemName} = configuration.engine;\n const EngineClass = this._importSystemEntry(systemName);\n\n let actionRegistryListener: ActionRegistryEventbusListener | undefined;\n if (configuration.eventActions?.length) {\n actionRegistryListener = new ActionRegistryEventbusListener();\n this._eventRemovers.push(\n this._eventbus.registerEventlistener(actionRegistryListener)\n );\n }\n\n this._eventRemovers.push(\n this._eventbus.registerInterceptor(\n 'request-timeline-uri',\n new RequestVideoUriInterceptor(this._eventbus)\n )\n );\n\n resolver =\n resolver || new ConfigurationResolver(this._importer, this._eventbus);\n const [actionLookup, resolvedConfiguration] = resolver.process(\n configuration,\n actionRegistryListener\n );\n this._actionsLookup = actionLookup;\n\n const timelineProviders = this._createTimelineProviders(\n resolvedConfiguration\n );\n\n const {language, labels} = configuration;\n const languageManager = new LanguageManager(\n language,\n labels,\n this._eventbus\n );\n\n const engineInstance = new EngineClass(\n resolvedConfiguration,\n this._eventbus,\n timelineProviders,\n languageManager\n );\n\n return engineInstance;\n }\n\n private _createTimelineProviders(\n configuration: IResolvedEngineConfiguration\n ): Record<TimelineTypes, ITimelineProviderInfo> {\n const {timelineProviderSettings} = configuration;\n\n const result = Object.entries(timelineProviderSettings).reduce<\n Record<TimelineTypes, ITimelineProviderInfo>\n >(\n (acc, [timelineType, settings]) => {\n if (!settings) {\n return acc;\n }\n\n const TimelineProviderClass = this._importSystemEntry(\n settings.systemName\n );\n acc[timelineType as TimelineTypes] = {\n id: settings.id,\n vendor: settings.vendor,\n provider: new TimelineProviderClass(configuration),\n };\n return acc;\n },\n {} as Record<TimelineTypes, ITimelineProviderInfo>\n );\n\n return result;\n }\n}\n"],"mappings":";;;;;;;;;AAAA,SAAgB,WAAW,OAA2C;AACpE,QAAO,OAAO,UAAU;;;;;ACD1B,SAAgB,SACd,OACuC;AACvC,QAAO,CAAC,CAAC,SAAS,OAAO,UAAU,YAAY,CAAC,MAAM,QAAQ,MAAM;;;;;ACCtE,SAAgB,6BAA6B,OAAqB;AAChE,KAAI,MAAM,QAAQ,MAAM,CACtB,QAAQ,MAAqB,IAAI,6BAA6B;UACrD,iBAAiBA,EAC1B,QAAO;UACE,SAAS,MAAM,EAAE;AAC1B,MACE,MAAM,YAAY,UAAU,CAAC,UAAU,GAAG,EAAE,KAAK,WACjD,CAAC,MAAM,YAAY,UAAU,CAAC,WAAW,oBAAoB,EAC7D;GACA,MAAM,aAAa,MAAM,YAAY,UAAU;AAC/C,UAAO,WAAW,UAAU,GAAG,WAAW,QAAQ,IAAI,GAAG,EAAE;;AAE7D,SAAO,OAAO,YACZ,OAAO,QAAQ,MAAM,CAAC,KAAK,CAAC,UAAU,eAAe,CACnD,UACA,6BAA6B,UAAU,CACxC,CAAC,CACH;YACQ,WAAW,MAAM,EAAE;EAC5B,MAAM,aAAa,MAAM,UAAU;AAEnC,MADmB,WAAW,QAAQ,IAAI,GACzB,GACf,QAAO,WAAW,UAAU,GAAG,WAAW,QAAQ,IAAI,GAAG,EAAE;AAE7D,SAAO;;AAET,QAAO;;;;;AC3BT,IAAa,uBAAb,MAA+D;CAC7D,YAAY,AAAQC,OAA0B;EAA1B;;CAEpB,YACE,WACA,YACA,MACM;EACN,MAAM,UAAU;GACd;GACA;GACA,MAAM,6BAA6B,KAAK;GACzC;AACD,MAA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