@kosdev-code/kos-freestyle-sdk 2.0.31 → 2.0.32

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (26) hide show
  1. package/{extension-utils-C8jLUyb0.cjs → extension-utils-VVeh-q52.cjs} +2 -2
  2. package/{extension-utils-C8jLUyb0.cjs.map → extension-utils-VVeh-q52.cjs.map} +1 -1
  3. package/{extension-utils-DKTFNnoj.js → extension-utils-ua-l7F5-.js} +2 -2
  4. package/{extension-utils-DKTFNnoj.js.map → extension-utils-ua-l7F5-.js.map} +1 -1
  5. package/freestyle-registration-manager-BNSA2Xyl.cjs +2 -0
  6. package/freestyle-registration-manager-BNSA2Xyl.cjs.map +1 -0
  7. package/{freestyle-registration-manager-NQwdiplh.js → freestyle-registration-manager-CBMdfM3_.js} +49 -52
  8. package/freestyle-registration-manager-CBMdfM3_.js.map +1 -0
  9. package/index.cjs +1 -1
  10. package/index.js +3 -3
  11. package/models/models/cartridge-agitator/cartridge-agitator-model.d.ts +4 -5
  12. package/models/models/cartridge-agitator/cartridge-agitator-model.d.ts.map +1 -1
  13. package/models/models/cartridge-agitator/cartridge-agitator-registration.d.ts +2 -0
  14. package/models/models/cartridge-agitator/cartridge-agitator-registration.d.ts.map +1 -1
  15. package/models.cjs +1 -1
  16. package/models.js +2 -2
  17. package/package.json +4 -4
  18. package/ui.cjs +1 -1
  19. package/ui.js +2 -2
  20. package/{use-nutrition-info-DIfeVwFs.cjs → use-nutrition-info-CnB4QbnQ.cjs} +2 -2
  21. package/{use-nutrition-info-DIfeVwFs.cjs.map → use-nutrition-info-CnB4QbnQ.cjs.map} +1 -1
  22. package/{use-nutrition-info-Cc2lyc0t.js → use-nutrition-info-i7otBVPd.js} +2 -2
  23. package/{use-nutrition-info-Cc2lyc0t.js.map → use-nutrition-info-i7otBVPd.js.map} +1 -1
  24. package/freestyle-registration-manager-CqOQC8rw.cjs +0 -2
  25. package/freestyle-registration-manager-CqOQC8rw.cjs.map +0 -1
  26. package/freestyle-registration-manager-NQwdiplh.js.map +0 -1
@@ -0,0 +1 @@
1
+ {"version":3,"file":"freestyle-registration-manager-BNSA2Xyl.cjs","sources":["../../../../packages/sdk/kos-freestyle-sdk/src/models/models/carb-agitator/carb-agitator-model.ts","../../../../packages/sdk/kos-freestyle-sdk/src/models/models/carb-agitator/carb-agitator-registration.ts","../../../../packages/sdk/kos-freestyle-sdk/src/models/models/cartridge-agitator/cartridge-agitator-container-model.ts","../../../../packages/sdk/kos-freestyle-sdk/src/models/models/cartridge-agitator/services/cartridge-agitator-services.ts","../../../../packages/sdk/kos-freestyle-sdk/src/models/models/cartridge-agitator/cartridge-agitator-model.ts","../../../../packages/sdk/kos-freestyle-sdk/src/models/models/cartridge-agitator/cartridge-agitator-registration.ts","../../../../packages/sdk/kos-freestyle-sdk/src/models/models/cartridge-agitator/cartridge-agitator-container-registration.ts","../../../../packages/sdk/kos-freestyle-sdk/src/models/models/freestyle-assembly/freestyle-assembly-model.ts","../../../../packages/sdk/kos-freestyle-sdk/src/models/models/freestyle-assembly/freestyle-assembly-registration.ts","../../../../packages/sdk/kos-freestyle-sdk/src/models/models/freestyle-holder/freestyle-holder-model.ts","../../../../packages/sdk/kos-freestyle-sdk/src/models/models/freestyle-holder/freestyle-holder-registration.ts","../../../../packages/sdk/kos-freestyle-sdk/src/models/models/freestyle-nozzle/services/freestyle-nozzle-services.ts","../../../../packages/sdk/kos-freestyle-sdk/src/models/models/freestyle-nozzle/freestyle-nozzle-model.ts","../../../../packages/sdk/kos-freestyle-sdk/src/models/models/freestyle-nozzle/freestyle-nozzle-registration.ts","../../../../packages/sdk/kos-freestyle-sdk/src/models/models/freestyle-pump/services/freestyle-pump-services.ts","../../../../packages/sdk/kos-freestyle-sdk/src/models/models/freestyle-pump/freestyle-pump-model.ts","../../../../packages/sdk/kos-freestyle-sdk/src/models/models/freestyle-pump/freestyle-pump-registration.ts","../../../../packages/sdk/kos-freestyle-sdk/src/models/models/ice-agitator/services/ice-agitator-services.ts","../../../../packages/sdk/kos-freestyle-sdk/src/models/models/ice-agitator/ice-agitator-model.ts","../../../../packages/sdk/kos-freestyle-sdk/src/models/models/ice-agitator/ice-agitator-registration.ts","../../../../packages/sdk/kos-freestyle-sdk/src/models/models/agitation-required-trouble/agitation-required-trouble-model.ts","../../../../packages/sdk/kos-freestyle-sdk/src/models/models/agitation-required-trouble/agitation-required-trouble-registration.ts","../../../../packages/sdk/kos-freestyle-sdk/src/models/utils/extensions/assembly/assembly-data-mapper.ts","../../../../packages/sdk/kos-freestyle-sdk/src/models/utils/freestyle-registration-manager.ts"],"sourcesContent":["import type {\n IKosDataModel,\n KosContextLogger,\n KosCreationContext,\n} from \"@kosdev-code/kos-ui-sdk\";\nimport { kosModel } from \"@kosdev-code/kos-ui-sdk\";\nimport type { CarbAgitatorModel, CarbAgitatorOptions } from \"./types\";\n\nexport const MODEL_TYPE = \"carb-agitator-model\";\n\n@kosModel(MODEL_TYPE)\nexport class CarbAgitatorModelImpl implements CarbAgitatorModel, IKosDataModel {\n id: string;\n name: string;\n path: string;\n\n private logger: KosContextLogger;\n constructor(\n modelId: string,\n options: CarbAgitatorOptions,\n context: KosCreationContext\n ) {\n this.id = modelId;\n this.name = options.name;\n this.path = options.path;\n this.logger = context.logger;\n if (options) {\n // Assign options properties here.\n }\n }\n\n // -------------------LIFECYCLE----------------------------\n\n async init(): Promise<void> {\n this.logger.debug(`initializing carb-agitator ${this.id}`);\n }\n\n async load(): Promise<void> {\n this.logger.debug(`loading carb-agitator ${this.id}`);\n }\n}\n","import { KosModelRegistrationFactory } from \"@kosdev-code/kos-ui-sdk\";\nimport { CarbAgitatorModelImpl, MODEL_TYPE } from \"./carb-agitator-model\";\nimport type { CarbAgitatorModel, CarbAgitatorOptions } from \"./types\";\n\n/**\n * # CarbAgitator\n *\n * The registration bean includes convenience methods for creating and working with CarbAgitatorModel instances.\n *\n * ## type\n * The type property is a string that identifies the model type.\n * The type is used to identify the model type in the model registry and to narrow down the model type in type predicates. It's most frequently\n * used when declaring dependencies on models.\n *\n * @example\n * ```typescript\n *\n * @kosDependency({modelType: CarbAgitator.type, id: \"carbAgitatorId\"})\n * private carbAgitatorModel: CarbAgitatorModel;\n * ```\n *\n *\n * ## factory\n *\n * The factory method creates a factory function that can be used to create new CarbAgitatorModel instances.\n *\n \n * The factory function is a curried function that takes the model id as the first argument and the options as the second argument.\n *\n * If a model with the specified id already exists, the factory function will return the existing model. The options will be ignored\n * in this case and the existing model will be returned in its current state.\n *\n * @example\n * ```typescript\n * const model = CarbAgitator.factory(\"carbAgitatorId\")({\n * // Add option data\n * });\n * ```\n \n\n *\n * ## predicate\n *\n * [Typescript type predicate](https://www.typescriptlang.org/docs/handbook/2/narrowing.html#using-type-predicates) function that will identify and narrow down a model to a CarbAgitatorModel.\n *\n * @example\n * ```typescript\n *\n * const model: IKosDataModel = ...; // some model\n *\n * if (CarbAgitator.predicate(model)) {\n * // if the function evaluates to true, the model is narrowed down to CarbAgitatorModel\n * // and the compiler will know that the model has the CarbAgitatorModel interface\n * model.updateAvailability(false);\n * }\n * ```\n *\n * ## registration\n *\n * The registration property is an object that can be used to simplify registration of the model with the model registry. The registration object\n * can be spread into the model registration and provides all of the required information to register the model implementation class against the model type.\n *\n *\n * @example\n *\n * In an application registration file you can declare the model registration as follows:\n *\n * **registration.ts**\n * ```typescript\n * import { CarbAgitator } from \"@kos-ui/kos-dispenser-model\";\n * ...\n * import { ExtensionManager, IKosRegistry } from \"@kosdev-code/kos-ui-sdk\";\n * export const kosModels: IKosRegistry[\"models\"] = {\n * ...CarbAgitator.registration,\n * };\n * ```\n *\n * ## registration.singleton\n \n * The carbAgitator model is NOT a singleton model. This means that each time the factory function is called with a unique ID, a new model instance will be created.\n * If the factory function is called with an ID that already exists, the existing model will be returned.\n \n * */\n\nexport const CarbAgitator = new KosModelRegistrationFactory<\n CarbAgitatorModel,\n CarbAgitatorOptions\n>({\n class: CarbAgitatorModelImpl,\n type: MODEL_TYPE,\n});\n","import type {\n IKosDataModel,\n IKosIdentifiable,\n IKosModelContainer,\n IKosModelHolder,\n KosContextLogger,\n KosCreationContext,\n PublicModelInterface,\n} from \"@kosdev-code/kos-ui-sdk\";\nimport { kosChild, kosModel, KosModelContainer } from \"@kosdev-code/kos-ui-sdk\";\nimport type { CartridgeAgitatorModel } from \"./cartridge-agitator-model\";\nimport type { CartridgeAgitatorContainerOptions } from \"./types\";\n\nexport const MODEL_TYPE = \"cartridge-agitator-container-model\";\n\nexport type CartridgeAgitatorContainerModel =\n PublicModelInterface<CartridgeAgitatorContainerModelImpl>;\n\n@kosModel(MODEL_TYPE)\nexport class CartridgeAgitatorContainerModelImpl\n implements\n IKosIdentifiable,\n IKosModelHolder<CartridgeAgitatorModel>,\n IKosDataModel\n{\n id: string;\n private logger: KosContextLogger;\n @kosChild private _models: IKosModelContainer<CartridgeAgitatorModel>;\n constructor(\n modelId: string,\n options: CartridgeAgitatorContainerOptions,\n context: KosCreationContext\n ) {\n this.id = modelId;\n this.logger = context.logger;\n this._models = new KosModelContainer<CartridgeAgitatorModel>({\n parentId: modelId,\n });\n if (options) {\n // Assign options properties here.\n }\n }\n\n getModel(id: string) {\n return this._models.getModel(id);\n }\n get models() {\n return this._models;\n }\n get data() {\n return this._models.data;\n }\n\n addModel(model: CartridgeAgitatorModel) {\n this._models.addModel(model);\n }\n\n removeModel(id: string) {\n this._models.removeModel(id);\n }\n // -------------------LIFECYCLE----------------------------\n\n async init(): Promise<void> {\n this.logger.debug(\n `initializing cartridge-agitator-container container ${this.id}`\n );\n }\n\n async load(): Promise<void> {\n this.logger.debug(\n `loading cartridge-agitator-container container ${this.id}`\n );\n }\n}\n","import type {\n FutureResponse,\n KosServiceResponse,\n} from \"@kosdev-code/kos-ui-sdk\";\nimport { resolveServiceUrl, ServiceFactory } from \"@kosdev-code/kos-ui-sdk\";\n\nconst { URL } = resolveServiceUrl(\"CARTRIDGE_AGITATOR_SERVICE\");\nconst { postModel } = ServiceFactory.build({\n basePath: `${URL}/api/ext/freestyle/freestyle/ice`,\n});\n/**\n * @category Service\n * Retrieves the initial screen data.\n */\nexport const agitate = async (path: string, tracker: string) => {\n const response: KosServiceResponse<FutureResponse> | undefined =\n await postModel({\n model: {},\n tracker,\n urlOverride: `${URL}/api/handle/${path}/test`,\n });\n\n if (!response?.data) {\n throw new Error(\"No response from server\");\n }\n return response.data;\n};\n","import type {\n ExternalFutureInterface,\n FutureAwareContainer,\n IKosDataModel,\n IKosIdentifiable,\n KosContextLogger,\n KosCreationContext,\n KosStateProp,\n PublicModelInterface,\n} from \"@kosdev-code/kos-ui-sdk\";\nimport {\n createPropKey,\n EventBus,\n kosEffect,\n kosFuture,\n kosModel,\n kosStateProp,\n setupMinimalFutureSupport,\n} from \"@kosdev-code/kos-ui-sdk\";\nimport { agitate } from \"./services/cartridge-agitator-services\";\nimport type { CartridgeAgitatorOptions } from \"./types\";\n\nexport const MODEL_TYPE = \"cartridge-agitator-model\";\n\nexport type CartridgeAgitatorModel =\n PublicModelInterface<CartridgeAgitatorModelImpl> & ExternalFutureInterface;\n\nexport class CartridgeAgitatorEvents {\n static TOPIC_AGITATION_STARTED = \"/kos/events/ddk/agitation-started\";\n static TOPIC_AGITATION_ENDED = \"/kos/events/ddk/agitation-ended\";\n}\nconst PROP_PATH = createPropKey<CartridgeAgitatorModel>(\"statePath\");\n@kosModel(MODEL_TYPE)\nexport class CartridgeAgitatorModelImpl\n implements IKosDataModel, IKosIdentifiable\n{\n id: string;\n public futureHandler!: FutureAwareContainer;\n private logger: KosContextLogger;\n private disposer?: VoidFunction;\n @kosStateProp({ path: PROP_PATH, attribute: \"agitating\" })\n private agitating!: KosStateProp<boolean>;\n path: string;\n statePath: string;\n name: string;\n constructor(\n modelId: string,\n options: CartridgeAgitatorOptions,\n context: KosCreationContext\n ) {\n this.id = modelId;\n this.logger = context.logger;\n this.path = options.path;\n this.name = options.name;\n this.statePath = options.statePath;\n\n // ONE LINE replaces all the Future boilerplate!\n setupMinimalFutureSupport(this);\n }\n\n get isAgitating(): boolean {\n return !!this.agitating.value;\n }\n\n @kosFuture()\n async testAgitate(tracker?: string) {\n // should be handed in by the `kosFuture` decorator\n if (!tracker) {\n throw new Error(\"No tracker provided\");\n }\n\n this.logger.info(`agitating cartridge-agitator ${this.id}`);\n\n return agitate(this.path, tracker);\n }\n // -------------------LIFECYCLE----------------------------\n\n async init(): Promise<void> {\n this.logger.debug(`initializing cartridge-agitator ${this.id}`);\n }\n\n unload() {\n this.disposer?.();\n }\n\n async load(): Promise<void> {\n this.logger.debug(`loading cartridge-agitator ${this.id}`);\n this.disposer = kosEffect(\n () => this.isAgitating,\n () => {\n if (this.isAgitating) {\n this.logger.info(`agitating cartridge-agitator ${this.id}`);\n EventBus.publish(CartridgeAgitatorEvents.TOPIC_AGITATION_STARTED, {\n path: this.path,\n futureId: this.futureHandler.future?.futureId,\n });\n } else {\n EventBus.publish(CartridgeAgitatorEvents.TOPIC_AGITATION_ENDED, {\n path: this.path,\n });\n }\n },\n {}\n );\n }\n}\n","import { KosModelRegistrationFactory } from \"@kosdev-code/kos-ui-sdk\";\nimport {\n CartridgeAgitatorModel,\n CartridgeAgitatorModelImpl,\n MODEL_TYPE,\n} from \"./cartridge-agitator-model\";\nimport type { CartridgeAgitatorOptions } from \"./types\";\n\n/**\n * # CartridgeAgitator\n *\n * The registration bean includes convenience methods for creating and working with CartridgeAgitatorModel instances.\n *\n * ## type\n * The type property is a string that identifies the model type.\n * The type is used to identify the model type in the model registry and to narrow down the model type in type predicates. It's most frequently\n * used when declaring dependencies on models.\n *\n * @example\n * ```typescript\n *\n * import type { CartridgeAgitatorModel } from \"./cartridge-agitator-model\";\n * \n * @kosDependency({modelType: CartridgeAgitator.type, id: \"cartridgeAgitatorId\"})\n * private cartridgeAgitatorModel: CartridgeAgitatorModel;\n * ```\n *\n *\n * ## factory\n *\n * The factory method creates a factory function that can be used to create new CartridgeAgitatorModel instances.\n *\n \n * The factory function is a curried function that takes the model id as the first argument and the options as the second argument.\n *\n * If a model with the specified id already exists, the factory function will return the existing model. The options will be ignored\n * in this case and the existing model will be returned in its current state.\n *\n * @example\n * ```typescript\n * const model = CartridgeAgitator.factory(\"cartridgeAgitatorId\")({\n * // Add option data\n * });\n * ```\n \n\n *\n * ## predicate\n *\n * [Typescript type predicate](https://www.typescriptlang.org/docs/handbook/2/narrowing.html#using-type-predicates) function that will identify and narrow down a model to a CartridgeAgitatorModel.\n *\n * @example\n * ```typescript\n *\n * const model: IKosDataModel = ...; // some model\n *\n * if (CartridgeAgitator.predicate(model)) {\n * // if the function evaluates to true, the model is narrowed down to CartridgeAgitatorModel\n * // and the compiler will know that the model has the CartridgeAgitatorModel interface\n * model.updateAvailability(false);\n * }\n * ```\n *\n * ## registration\n *\n * The registration property is an object that can be used to simplify registration of the model with the model registry. The registration object\n * can be spread into the model registration and provides all of the required information to register the model implementation class against the model type.\n *\n *\n * @example\n *\n * In an application registration file you can declare the model registration as follows:\n *\n * **registration.ts**\n * ```typescript\n * import { CartridgeAgitator } from \"@kos-ui/project-models\";\n * import { KosModelRegistry } from \"@kosdev-code/kos-dispense-sdk\";\n *\n * import { initKosProvider } from \"@kosdev-code/kos-ui-sdk\";\n *\n * KosModelRegistry.dispense\n * .models()\n * .model(CartridgeAgitator);\n * ```\n *\n * ## registration.singleton\n \n * The cartridgeAgitator model is NOT a singleton model. This means that each time the factory function is called with a unique ID, a new model instance will be created.\n * If the factory function is called with an ID that already exists, the existing model will be returned.\n \n * */\nexport const CartridgeAgitator = new KosModelRegistrationFactory<\n CartridgeAgitatorModel,\n CartridgeAgitatorOptions\n>({\n class: CartridgeAgitatorModelImpl as any,\n type: MODEL_TYPE,\n});\n","import { SingletonKosModelRegistrationFactory } from \"@kosdev-code/kos-ui-sdk\";\nimport type { CartridgeAgitatorContainerModel } from \"./cartridge-agitator-container-model\";\nimport {\n CartridgeAgitatorContainerModelImpl,\n MODEL_TYPE,\n} from \"./cartridge-agitator-container-model\";\nimport { CartridgeAgitator } from \"./cartridge-agitator-registration\";\nimport type { CartridgeAgitatorContainerOptions } from \"./types\";\n\n/**\n * # CartridgeAgitatorContainer\n *\n * The registration bean includes convenience methods for creating and working with CartridgeAgitatorContainerModel instances.\n *\n * ## type\n * The type property is a string that identifies the model type.\n * The type is used to identify the model type in the model registry and to narrow down the model type in type predicates. It's most frequently\n * used when declaring dependencies on models.\n *\n * @example\n * ```typescript\n *\n * @kosDependency({modelType: CartridgeAgitatorContainer.type, id: \"cartridgeAgitatorContainerId\"})\n * private cartridgeAgitatorContainerModel: CartridgeAgitatorContainerModel;\n * ```\n *\n *\n * ## factory\n *\n * The factory method creates a factory function that can be used to create new CartridgeAgitatorContainerModel instances.\n *\n \n * As this is a singleton model, the factory function accepts the model options as its argument.\n *\n * If a model with the same model type already exists, the factory function will return the existing model. The options will be ignored\n * in this case and the existing model will be returned in its current state.\n *\n * @example\n * ```typescript\n * const model = CartridgeAgitatorContainer.factory({\n * // Add option data\n * });\n * ```\n \n\n *\n * ## predicate\n *\n * [Typescript type predicate](https://www.typescriptlang.org/docs/handbook/2/narrowing.html#using-type-predicates) function that will identify and narrow down a model to a CartridgeAgitatorContainerModel.\n *\n * @example\n * ```typescript\n *\n * const model: IKosDataModel = ...; // some model\n *\n * if (CartridgeAgitatorContainer.predicate(model)) {\n * // if the function evaluates to true, the model is narrowed down to CartridgeAgitatorContainerModel\n * // and the compiler will know that the model has the CartridgeAgitatorContainerModel interface\n * model.updateAvailability(false);\n * }\n * ```\n *\n * ## registration\n *\n * The registration property is an object that can be used to simplify registration of the model with the model registry. The registration object\n * can be spread into the model registration and provides all of the required information to register the model implementation class against the model type.\n *\n *\n * @example\n *\n * In an application registration file you can declare the model registration as follows:\n *\n * **registration.ts**\n * ```typescript\n * import { CartridgeAgitatorContainer } from \"@kosdev-code/kos-dispense-sdk\";\n * ...\n * import { ExtensionManager, IKosRegistry } from \"@kosdev-code/kos-ui-sdk\";\n * export const kosModels: IKosRegistry[\"models\"] = {\n * ...CartridgeAgitatorContainer.registration,\n * };\n * ```\n *\n * ## registration.singleton\n \n * The cartridgeAgitatorContainer model is a singleton model. This means that each time the factory function is called , the same instance will be returned.\n * If the model does not yet exist, it will be created passing in the provided options to initialize it.\n *\n * Singleton models don't require an ID as they will use the model type as their ID to guarantee uniqueness throughout the system.\n \n * */\nexport const CartridgeAgitatorContainer =\n new SingletonKosModelRegistrationFactory<\n CartridgeAgitatorContainerModel,\n CartridgeAgitatorContainerOptions\n >({\n class: CartridgeAgitatorContainerModelImpl,\n type: MODEL_TYPE,\n });\n\nCartridgeAgitatorContainer.addRelatedModel(CartridgeAgitator);\n","import type {\n IKosDataModel,\n IKosIdentifiable,\n KosContextLogger,\n KosCreationContext,\n PublicModelInterface,\n} from \"@kosdev-code/kos-ui-sdk\";\nimport { KosFeatureFlags, kosModel } from \"@kosdev-code/kos-ui-sdk\";\nimport type { FreestyleAssemblyOptions } from \"./types\";\n\nimport type {\n AssemblyModel,\n AssemblyOptions,\n BoardModel,\n HolderModel,\n PumpModel,\n} from \"@kosdev-code/kos-dispense-sdk\";\nimport type { CarbAgitatorModel } from \"../carb-agitator\";\nimport {\n type CartridgeAgitatorContainerModel,\n type CartridgeAgitatorModel,\n} from \"../cartridge-agitator\";\nimport type { IceAgitatorModel } from \"../ice-agitator\";\nimport type {\n FreestyleHolderModelExt,\n FreestyleModelAssemblyExt,\n} from \"../types/assembly\";\n\nexport const MODEL_TYPE = \"freestyle-assembly-model\";\n\nexport const FEATURE_SUPPORTS_ICE = \"iceAgitator\";\nexport const FEATURE_SUPPORTS_CARB = \"carbAgitator\";\n\nexport type FreestyleAssemblyModel =\n PublicModelInterface<FreestyleAssemblyModelImpl> &\n AssemblyModel<FreestyleModelAssemblyExt, FreestyleHolderModelExt>;\n\n@kosModel(MODEL_TYPE)\nexport class FreestyleAssemblyModelImpl\n implements\n IKosDataModel,\n IKosIdentifiable,\n AssemblyModel<FreestyleModelAssemblyExt, FreestyleHolderModelExt>\n{\n id: string;\n private logger: KosContextLogger;\n private assembly: AssemblyModel<\n FreestyleModelAssemblyExt,\n FreestyleHolderModelExt\n >;\n\n constructor(\n modelId: string,\n options: FreestyleAssemblyOptions,\n context: KosCreationContext\n ) {\n this.id = modelId;\n this.logger = context.logger;\n\n this.assembly = options.companionParent;\n\n if (options) {\n // Assign options properties here.\n }\n }\n get holderGroups(): string[] {\n return this.assembly.holderGroups;\n }\n get nozzlePaths(): string[] {\n return this.assembly.nozzlePaths;\n }\n get allHolders(): HolderModel<FreestyleHolderModelExt>[] {\n return this.assembly.allHolders;\n }\n getHoldersByGroup(group: string): HolderModel<FreestyleHolderModelExt>[] {\n return this.assembly.getHoldersByGroup(group);\n }\n getHoldersByNozzle(\n nozzlePath: string\n ): HolderModel<FreestyleHolderModelExt>[] {\n return this.assembly.getHoldersByNozzle(nozzlePath);\n }\n get pumpsByNozzle(): Record<string, PumpModel<any>[]> {\n return this.assembly.pumpsByNozzle;\n }\n get pumpPaths(): string[] {\n return this.assembly.pumpPaths;\n }\n\n get boards(): BoardModel<any>[] {\n return this.assembly.boards;\n }\n updateModel(options: AssemblyOptions): void {\n return this.assembly.updateModel(options);\n }\n get iceAgitator(): IceAgitatorModel {\n return this.assembly.iceAgitator;\n }\n get carbAgitator(): CarbAgitatorModel {\n return this.assembly.carbAgitator;\n }\n\n get cartridgeAgitators(): CartridgeAgitatorContainerModel {\n return this.assembly.cartridgeAgitators;\n }\n\n get defaultCartridgeAgitator(): CartridgeAgitatorModel {\n return this.assembly.cartridgeAgitators.data[0];\n }\n get cartridgeAgitatorModels(): CartridgeAgitatorModel[] {\n return this.assembly.cartridgeAgitators.data;\n }\n\n get hasCartridgeAgitators(): boolean {\n return this.assembly.cartridgeAgitators.data.length > 0;\n }\n\n // -------------------LIFECYCLE----------------------------\n\n get supportsIce() {\n return KosFeatureFlags.isFeatureEnabled(FEATURE_SUPPORTS_ICE);\n }\n\n get supportsCarb() {\n return KosFeatureFlags.isFeatureEnabled(FEATURE_SUPPORTS_CARB);\n }\n\n async init(): Promise<void> {\n this.logger.debug(`initializing freestyle-assembly ${this.id}`);\n }\n\n async load(): Promise<void> {\n this.logger.debug(`loading freestyle-assembly ${this.id}`);\n }\n}\n","import { SingletonKosModelRegistrationFactory } from \"@kosdev-code/kos-ui-sdk\";\nimport type { FreestyleAssemblyModel } from \"./freestyle-assembly-model\";\nimport {\n FreestyleAssemblyModelImpl,\n MODEL_TYPE,\n} from \"./freestyle-assembly-model\";\nimport type { FreestyleAssemblyOptions } from \"./types\";\n\n/**\n * # FreestyleAssembly\n *\n * The registration bean includes convenience methods for creating and working with FreestyleAssemblyModel instances.\n *\n * ## type\n * The type property is a string that identifies the model type.\n * The type is used to identify the model type in the model registry and to narrow down the model type in type predicates. It's most frequently\n * used when declaring dependencies on models.\n *\n * @example\n * ```typescript\n *\n * @kosDependency({modelType: FreestyleAssembly.type, id: \"freestyleAssemblyId\"})\n * private freestyleAssemblyModel: FreestyleAssemblyModel;\n * ```\n *\n *\n * ## factory\n *\n * The factory method creates a factory function that can be used to create new FreestyleAssemblyModel instances.\n *\n \n * As this is a singleton model, the factory function accepts the model options as its argument.\n *\n * If a model with the same model type already exists, the factory function will return the existing model. The options will be ignored\n * in this case and the existing model will be returned in its current state.\n *\n * @example\n * ```typescript\n * const model = FreestyleAssembly.factory({\n * // Add option data\n * });\n * ```\n \n\n *\n * ## predicate\n *\n * [Typescript type predicate](https://www.typescriptlang.org/docs/handbook/2/narrowing.html#using-type-predicates) function that will identify and narrow down a model to a FreestyleAssemblyModel.\n *\n * @example\n * ```typescript\n *\n * const model: IKosDataModel = ...; // some model\n *\n * if (FreestyleAssembly.predicate(model)) {\n * // if the function evaluates to true, the model is narrowed down to FreestyleAssemblyModel\n * // and the compiler will know that the model has the FreestyleAssemblyModel interface\n * model.updateAvailability(false);\n * }\n * ```\n *\n * ## registration\n *\n * The registration property is an object that can be used to simplify registration of the model with the model registry. The registration object\n * can be spread into the model registration and provides all of the required information to register the model implementation class against the model type.\n *\n *\n * @example\n *\n * In an application registration file you can declare the model registration as follows:\n *\n * **registration.ts**\n * ```typescript\n * import { FreestyleAssembly } from \"@kos-ui/project-models\";\n * import { KosModelRegistry } from \"@kosdev-code/kos-dispense-sdk\";\n *\n * import { initKosProvider } from \"@kosdev-code/kos-ui-sdk\";\n *\n * KosModelRegistry.dispense\n * .models()\n * .model(FreestyleAssembly);\n * ```\n *\n * ## registration.singleton\n \n * The freestyleAssembly model is a singleton model. This means that each time the factory function is called , the same instance will be returned.\n * If the model does not yet exist, it will be created passing in the provided options to initialize it.\n *\n * Singleton models don't require an ID as they will use the model type as their ID to guarantee uniqueness throughout the system.\n \n * */\nexport const FreestyleAssembly = new SingletonKosModelRegistrationFactory<\n FreestyleAssemblyModel,\n FreestyleAssemblyOptions\n>({\n class: FreestyleAssemblyModelImpl,\n type: MODEL_TYPE,\n});\n","import type {\n FutureContainer,\n FutureDelegate,\n FutureResponse,\n IFutureModel,\n IKosDataModel,\n IKosIdentifiable,\n KosContextLogger,\n KosCreationContext,\n PublicModelInterface,\n} from \"@kosdev-code/kos-ui-sdk\";\nimport {\n FutureManager,\n KosContextManager,\n KosLog,\n kosModel,\n} from \"@kosdev-code/kos-ui-sdk\";\nimport type { FreestyleHolderOptions } from \"./types\";\n\nimport type { HolderModel } from \"@kosdev-code/kos-dispense-sdk\";\nimport type { FreestyleHolderExt } from \"../../utils/extensions/assembly/types\";\nimport type { CartridgeAgitatorModel } from \"../cartridge-agitator\";\nimport {\n FreestyleAssembly,\n type FreestyleAssemblyModel,\n} from \"../freestyle-assembly\";\n\nexport const MODEL_TYPE = \"freestyle-holder-model\";\ntype MethodsReturningType<T, ReturnType> = {\n [K in keyof T]: T[K] extends (...args: any[]) => ReturnType ? K : never;\n}[keyof T];\n\ntype FutureDelegateType = MethodsReturningType<\n CartridgeAgitatorModel,\n Promise<FutureResponse>\n>;\n\nfunction resolveFreestyleAssembly(\n id: string\n): FreestyleAssemblyModel | undefined {\n const context = KosContextManager.getContext(id);\n const freestyleAssembly: FreestyleAssemblyModel = context?.get(\n FreestyleAssembly.type\n );\n if (!freestyleAssembly) {\n KosLog.error(\"Freestyle assembly not found\");\n return undefined;\n }\n return freestyleAssembly;\n}\nasync function futureDelegate(\n model?: FutureContainer,\n method?: FutureDelegateType\n): Promise<IFutureModel | undefined> {\n if (!model || !method) {\n return undefined;\n }\n const response = (await model[method]()) as FutureResponse;\n if (response?.tracker) {\n return FutureManager.getFuture(response.tracker);\n }\n return undefined;\n}\nexport const freestyleHolderFactory = (holder: HolderModel) => {\n if (holder.data.agitated) {\n return MODEL_TYPE;\n }\n return undefined;\n};\nexport type FreestyleHolderModel =\n PublicModelInterface<FreestyleHolderModelImpl>;\n\n@kosModel(MODEL_TYPE)\nexport class FreestyleHolderModelImpl\n implements IKosDataModel, IKosIdentifiable, FutureDelegate\n{\n id: string;\n private logger: KosContextLogger;\n private holder: HolderModel<FreestyleHolderExt>;\n future?: IFutureModel;\n constructor(\n modelId: string,\n options: FreestyleHolderOptions,\n context: KosCreationContext\n ) {\n this.id = modelId;\n this.logger = context.logger;\n\n this.holder = options.companionParent;\n }\n\n get agitated() {\n return this.holder.data.agitated;\n }\n async agitate() {\n if (!this.holder.data.agitated) {\n return undefined;\n }\n this.future = undefined;\n const freestyleAssembly = resolveFreestyleAssembly(this.id);\n\n if (!freestyleAssembly) {\n return undefined;\n }\n const agitator = freestyleAssembly.defaultCartridgeAgitator;\n if (!agitator) {\n this.logger.error(\"Agitator not found\");\n return undefined;\n }\n this.future = await futureDelegate(\n freestyleAssembly.defaultCartridgeAgitator,\n \"testAgitate\"\n );\n\n return this.future;\n }\n\n // -------------------LIFECYCLE----------------------------\n\n async init(): Promise<void> {\n this.logger.debug(`initializing freestyle-holder ${this.id}`);\n }\n\n async load(): Promise<void> {\n this.logger.debug(`loading freestyle-holder ${this.id}`);\n }\n}\n","import { KosModelRegistrationFactory } from \"@kosdev-code/kos-ui-sdk\";\nimport type { FreestyleHolderModel } from \"./freestyle-holder-model\";\nimport { FreestyleHolderModelImpl, MODEL_TYPE } from \"./freestyle-holder-model\";\nimport type { FreestyleHolderOptions } from \"./types\";\n\n/**\n * # FreestyleHolder\n *\n * The registration bean includes convenience methods for creating and working with FreestyleHolderModel instances.\n *\n * ## type\n * The type property is a string that identifies the model type.\n * The type is used to identify the model type in the model registry and to narrow down the model type in type predicates. It's most frequently\n * used when declaring dependencies on models.\n *\n * @example\n * ```typescript\n *\n * @kosDependency({modelType: FreestyleHolder.type, id: \"freestyleHolderId\"})\n * private freestyleHolderModel: FreestyleHolderModel;\n * ```\n *\n *\n * ## factory\n *\n * The factory method creates a factory function that can be used to create new FreestyleHolderModel instances.\n *\n \n * The factory function is a curried function that takes the model id as the first argument and the options as the second argument.\n *\n * If a model with the specified id already exists, the factory function will return the existing model. The options will be ignored\n * in this case and the existing model will be returned in its current state.\n *\n * @example\n * ```typescript\n * const model = FreestyleHolder.factory(\"freestyleHolderId\")({\n * // Add option data\n * });\n * ```\n \n\n *\n * ## predicate\n *\n * [Typescript type predicate](https://www.typescriptlang.org/docs/handbook/2/narrowing.html#using-type-predicates) function that will identify and narrow down a model to a FreestyleHolderModel.\n *\n * @example\n * ```typescript\n *\n * const model: IKosDataModel = ...; // some model\n *\n * if (FreestyleHolder.predicate(model)) {\n * // if the function evaluates to true, the model is narrowed down to FreestyleHolderModel\n * // and the compiler will know that the model has the FreestyleHolderModel interface\n * model.updateAvailability(false);\n * }\n * ```\n *\n * ## registration\n *\n * The registration property is an object that can be used to simplify registration of the model with the model registry. The registration object\n * can be spread into the model registration and provides all of the required information to register the model implementation class against the model type.\n *\n *\n * @example\n *\n * In an application registration file you can declare the model registration as follows:\n *\n * **registration.ts**\n * ```typescript\n * import { FreestyleHolder } from \"@kos-ui/project-models\";\n * import { KosModelRegistry } from \"@kosdev-code/kos-dispense-sdk\";\n *\n * import { initKosProvider } from \"@kosdev-code/kos-ui-sdk\";\n *\n * KosModelRegistry.dispense\n * .models()\n * .model(FreestyleHolder);\n * ```\n *\n * ## registration.singleton\n \n * The freestyleHolder model is NOT a singleton model. This means that each time the factory function is called with a unique ID, a new model instance will be created.\n * If the factory function is called with an ID that already exists, the existing model will be returned.\n \n * */\nexport const FreestyleHolder = new KosModelRegistrationFactory<\n FreestyleHolderModel,\n FreestyleHolderOptions\n>({\n class: FreestyleHolderModelImpl,\n type: MODEL_TYPE,\n});\n","import {\n KosLog,\n ServiceFactory,\n resolveServiceUrl,\n} from \"@kosdev-code/kos-ui-sdk\";\nconst { URL } = resolveServiceUrl(\"FREESTYLE-NOZZLE_SERVICE\");\nconst { getOne } = ServiceFactory.build({\n basePath: `${URL}/api/freestyle-nozzle`,\n});\n\nconst log = KosLog.createLogger({\n name: \"freestyle-nozzle-service\",\n group: \"Services\",\n});\n\ninterface NutritionValue {\n displayValue: string;\n units: string;\n type: string;\n}\ninterface NutritionVolume {\n volume: number;\n values: NutritionValue[];\n}\nexport interface FreestyleNutritionInfoResponse {\n labels?: {\n allergens: string;\n legalDescriptor: string;\n ingredients: string;\n ingredientsHeading: string;\n };\n volumes: NutritionVolume[];\n error?: string;\n}\n\nexport class NutritionInfoError extends Error {\n constructor(message: string) {\n super(message);\n this.name = \"NutritionInfoError\";\n }\n}\n\nexport class InvalidRequestError extends Error {\n constructor(message: string) {\n super(message);\n this.name = \"InvalidRequestError\";\n }\n}\n/**\n * @category Service\n * Retrieves the initial freestyle-nozzle data.\n */\nexport const getFreestyleNutritionInfo = async (\n nozzleUrlPrefix: string,\n beverageId: string,\n volumes: number[],\n baseUrl = \"http://localhost:8081\"\n) => {\n log.debug(\"sending GET for freestyle-nozzle\");\n\n if (!beverageId) {\n log.error(\"Invalid freestyle-nozzle request: beverageId is required\");\n throw new InvalidRequestError(\"No beverageId provided\");\n }\n\n if (!volumes || volumes.length === 0) {\n log.error(\"Invalid freestyle-nozzle request: volumes are required\");\n throw new InvalidRequestError(\"No volumes provided\");\n }\n const response = await getOne<FreestyleNutritionInfoResponse>({\n urlOverride: `${baseUrl}${nozzleUrlPrefix}/pipeline/beverage/engine/nutrition/${beverageId}?volumes=${volumes.join(\n \",\"\n )}`,\n });\n\n if (!response?.data) {\n log.error(\"Failed to retrieve freestyle-nozzle data\");\n throw new Error(\"Failed to retrieve freestyle-nozzle data\");\n }\n\n if (response.data.error) {\n throw new NutritionInfoError(response.data.error);\n }\n\n return response.data;\n};\n","import type { NozzleModel } from \"@kosdev-code/kos-dispense-sdk\";\nimport type {\n IKosDataModel,\n IKosIdentifiable,\n KosContextLogger,\n KosCreationContext,\n PublicModelInterface,\n} from \"@kosdev-code/kos-ui-sdk\";\nimport {\n kosAction,\n kosAutoEffect,\n kosModel,\n kosParentAware,\n} from \"@kosdev-code/kos-ui-sdk\";\n\nimport {\n getFreestyleNutritionInfo,\n type FreestyleNutritionInfoResponse,\n} from \"./services\";\nimport type { FreestyleNozzleOptions } from \"./types\";\n\nexport const MODEL_TYPE = \"freestyle-nozzle-model\";\n\nexport type FreestyleNozzleModel =\n PublicModelInterface<FreestyleNozzleModelImpl>;\n\n@kosParentAware()\n@kosModel(MODEL_TYPE)\nexport class FreestyleNozzleModelImpl\n implements IKosDataModel, IKosIdentifiable\n{\n id: string;\n private logger: KosContextLogger;\n private nozzleModel: NozzleModel;\n private _cupSizes: number[];\n private _nutritionInfo?: FreestyleNutritionInfoResponse;\n private _disposer: VoidFunction | null = null;\n constructor(\n modelId: string,\n options: FreestyleNozzleOptions,\n context: KosCreationContext\n ) {\n this.id = modelId;\n this.logger = context.logger;\n this.nozzleModel = options.companionParent;\n this._cupSizes = [100];\n }\n\n set cupSizes(cupSizes: number[]) {\n this._cupSizes = cupSizes;\n }\n get nutritionInfo() {\n return this._nutritionInfo;\n }\n\n // -------------------LIFECYCLE----------------------------\n\n async init(): Promise<void> {\n this.logger.debug(`initializing freestyle-nozzle ${this.id}`);\n this._disposer = kosAutoEffect(async () => {\n if (this.nozzleModel.selectedPourable.beverage && this._cupSizes.length) {\n this.logger.debug(\n `selected beverage: ${\n this.nozzleModel.selectedPourable.beverage.rawId\n }. Volume: ${this._cupSizes.join(\", \")}`\n );\n const beverageId = this.nozzleModel.selectedPourable.beverage.rawId;\n const prefix = this.nozzleModel.urlPrefix;\n try {\n const response = await getFreestyleNutritionInfo(\n prefix,\n beverageId,\n this._cupSizes\n );\n kosAction(() => {\n this._nutritionInfo = response;\n });\n } catch (error) {\n this.logger.error(`Error fetching nutrition info: ${error}`);\n }\n }\n });\n }\n\n unload(): void {\n this.logger.debug(`unloading freestyle-nozzle ${this.id}`);\n if (this._disposer) {\n this._disposer();\n }\n }\n async load(): Promise<void> {\n this.logger.debug(`loading freestyle-nozzle ${this.id}`);\n }\n}\n","import { KosModelRegistrationFactory } from \"@kosdev-code/kos-ui-sdk\";\nimport type { FreestyleNozzleModel } from \"./freestyle-nozzle-model\";\nimport { FreestyleNozzleModelImpl, MODEL_TYPE } from \"./freestyle-nozzle-model\";\nimport type { FreestyleNozzleOptions } from \"./types\";\n\n/**\n * # FreestyleNozzle\n *\n * The registration bean includes convenience methods for creating and working with FreestyleNozzleModel instances.\n *\n * ## type\n * The type property is a string that identifies the model type.\n * The type is used to identify the model type in the model registry and to narrow down the model type in type predicates. It's most frequently\n * used when declaring dependencies on models.\n *\n * @example\n * ```typescript\n *\n * @kosDependency({modelType: FreestyleNozzle.type, id: \"freestyleNozzleId\"})\n * private freestyleNozzleModel: FreestyleNozzleModel;\n * ```\n *\n *\n * ## factory\n *\n * The factory method creates a factory function that can be used to create new FreestyleNozzleModel instances.\n *\n \n * The factory function is a curried function that takes the model id as the first argument and the options as the second argument.\n *\n * If a model with the specified id already exists, the factory function will return the existing model. The options will be ignored\n * in this case and the existing model will be returned in its current state.\n *\n * @example\n * ```typescript\n * const model = FreestyleNozzle.factory(\"freestyleNozzleId\")({\n * // Add option data\n * });\n * ```\n \n\n *\n * ## predicate\n *\n * [Typescript type predicate](https://www.typescriptlang.org/docs/handbook/2/narrowing.html#using-type-predicates) function that will identify and narrow down a model to a FreestyleNozzleModel.\n *\n * @example\n * ```typescript\n *\n * const model: IKosDataModel = ...; // some model\n *\n * if (FreestyleNozzle.predicate(model)) {\n * // if the function evaluates to true, the model is narrowed down to FreestyleNozzleModel\n * // and the compiler will know that the model has the FreestyleNozzleModel interface\n * model.updateAvailability(false);\n * }\n * ```\n *\n * ## registration\n *\n * The registration property is an object that can be used to simplify registration of the model with the model registry. The registration object\n * can be spread into the model registration and provides all of the required information to register the model implementation class against the model type.\n *\n *\n * @example\n *\n * In an application registration file you can declare the model registration as follows:\n *\n * **registration.ts**\n * ```typescript\n * import { FreestyleNozzle } from \"@kos-ui/project-models\";\n * import { KosModelRegistry } from \"@kosdev-code/kos-dispense-sdk\";\n *\n * import { initKosProvider } from \"@kosdev-code/kos-ui-sdk\";\n *\n * KosModelRegistry.dispense\n * .models()\n * .model(FreestyleNozzle);\n * ```\n *\n * ## registration.singleton\n \n * The freestyleNozzle model is NOT a singleton model. This means that each time the factory function is called with a unique ID, a new model instance will be created.\n * If the factory function is called with an ID that already exists, the existing model will be returned.\n \n * */\nexport const FreestyleNozzle = new KosModelRegistrationFactory<\n FreestyleNozzleModel,\n FreestyleNozzleOptions\n>({\n class: FreestyleNozzleModelImpl,\n type: MODEL_TYPE,\n});\n","import {\n FetchError,\n KosLog,\n ServiceFactory,\n resolveServiceUrl,\n} from \"@kosdev-code/kos-ui-sdk\";\nconst { URL } = resolveServiceUrl(\"PUMP_SERVICE\");\nconst { postModel } = ServiceFactory.build({\n basePath: `${URL}/api/ext/freestyle/microCalibration`,\n});\n\nconst log = KosLog.createLogger({\n name: \"freestyle-pump-service\",\n group: \"Services\",\n});\nexport type ReplacePumpErrorType = \"unknownError\" | undefined;\nexport type ReplacePumpData = {\n error?: ReplacePumpErrorType;\n};\nexport type ReplacePumpResponse = [\n ReplacePumpErrorType | undefined,\n ReplacePumpData\n];\nexport const replacePump = async (\n pumpId: string,\n code: string\n): Promise<ReplacePumpResponse> => {\n log.debug(\n `replacePump - sending POST request to /api/ext/freestyle/microCalibration/cal/${pumpId}/code/${code}`\n );\n\n try {\n const response = await postModel({\n model: {},\n urlOverride: `${URL}/api/ext/freestyle/microCalibration/cal/${pumpId}/code/${code}`,\n });\n\n log.debug(\"replacePump - response:\", response);\n\n if (\n (response?.status === 200 || response?.status === 499) &&\n response.data?.error\n ) {\n return [response.data.error || \"unknownError\", response.data];\n }\n\n return [undefined, response?.data];\n } catch (error) {\n log.error(\n `replacePump - sending POST request to /api/cal/${pumpId}/code/${code}`,\n error\n );\n\n if (error instanceof FetchError) {\n const errorCode =\n error.payload?.data?.error || error.payload?.error || \"unknownError\";\n\n return [errorCode, error.payload?.data || { error: errorCode }];\n }\n }\n\n return [\"unknownError\", { error: \"unknownError\" }];\n};\n","import type {\n IKosDataModel,\n IKosIdentifiable,\n KosContextLogger,\n KosCreationContext,\n PublicModelInterface,\n} from \"@kosdev-code/kos-ui-sdk\";\nimport { kosModel } from \"@kosdev-code/kos-ui-sdk\";\nimport type { FreestylePumpOptions } from \"./types\";\n\nimport type { PumpModel } from \"@kosdev-code/kos-dispense-sdk\";\nimport {\n replacePump,\n type ReplacePumpData,\n type ReplacePumpErrorType,\n} from \"./services\";\n\nexport const MODEL_TYPE = \"freestyle-pump-model\";\n\nexport type FreestylePumpModel = PublicModelInterface<FreestylePumpModelImpl>;\n\n@kosModel(MODEL_TYPE)\nexport class FreestylePumpModelImpl implements IKosDataModel, IKosIdentifiable {\n id: string;\n private logger: KosContextLogger;\n private pump: PumpModel;\n constructor(\n modelId: string,\n options: FreestylePumpOptions,\n context: KosCreationContext\n ) {\n this.id = modelId;\n this.logger = context.logger;\n this.pump = options.companionParent;\n }\n\n // -------------------LIFECYCLE----------------------------\n\n async replacePump(\n code: string\n ): Promise<[ReplacePumpErrorType, ReplacePumpData]> {\n const [error, data] = await replacePump(this.pump.path, code);\n if (error) {\n this.logger.error(`Failed to replace the pump, ${this.pump.id}`, error);\n }\n\n return [error, data];\n }\n}\n","import { KosModelRegistrationFactory } from \"@kosdev-code/kos-ui-sdk\";\nimport type { FreestylePumpModel } from \"./freestyle-pump-model\";\nimport { FreestylePumpModelImpl, MODEL_TYPE } from \"./freestyle-pump-model\";\nimport type { FreestylePumpOptions } from \"./types\";\n\n/**\n * # FreestylePump\n *\n * The registration bean includes convenience methods for creating and working with FreestylePumpModel instances.\n *\n * ## type\n * The type property is a string that identifies the model type.\n * The type is used to identify the model type in the model registry and to narrow down the model type in type predicates. It's most frequently\n * used when declaring dependencies on models.\n *\n * @example\n * ```typescript\n *\n * @kosDependency({modelType: FreestylePump.type, id: \"freestylePumpId\"})\n * private freestylePumpModel: FreestylePumpModel;\n * ```\n *\n *\n * ## factory\n *\n * The factory method creates a factory function that can be used to create new FreestylePumpModel instances.\n *\n \n * The factory function is a curried function that takes the model id as the first argument and the options as the second argument.\n *\n * If a model with the specified id already exists, the factory function will return the existing model. The options will be ignored\n * in this case and the existing model will be returned in its current state.\n *\n * @example\n * ```typescript\n * const model = FreestylePump.factory(\"freestylePumpId\")({\n * // Add option data\n * });\n * ```\n \n\n *\n * ## predicate\n *\n * [Typescript type predicate](https://www.typescriptlang.org/docs/handbook/2/narrowing.html#using-type-predicates) function that will identify and narrow down a model to a FreestylePumpModel.\n *\n * @example\n * ```typescript\n *\n * const model: IKosDataModel = ...; // some model\n *\n * if (FreestylePump.predicate(model)) {\n * // if the function evaluates to true, the model is narrowed down to FreestylePumpModel\n * // and the compiler will know that the model has the FreestylePumpModel interface\n * model.updateAvailability(false);\n * }\n * ```\n *\n * ## registration\n *\n * The registration property is an object that can be used to simplify registration of the model with the model registry. The registration object\n * can be spread into the model registration and provides all of the required information to register the model implementation class against the model type.\n *\n *\n * @example\n *\n * In an application registration file you can declare the model registration as follows:\n *\n * **registration.ts**\n * ```typescript\n * import { FreestylePump } from \"@kos-ui/project-models\";\n * import { KosModelRegistry } from \"@kosdev-code/kos-dispense-sdk\";\n *\n * import { initKosProvider } from \"@kosdev-code/kos-ui-sdk\";\n *\n * KosModelRegistry.dispense\n * .models()\n * .model(FreestylePump);\n * ```\n *\n * ## registration.singleton\n \n * The freestylePump model is NOT a singleton model. This means that each time the factory function is called with a unique ID, a new model instance will be created.\n * If the factory function is called with an ID that already exists, the existing model will be returned.\n \n * */\nexport const FreestylePump = new KosModelRegistrationFactory<\n FreestylePumpModel,\n FreestylePumpOptions\n>({\n class: FreestylePumpModelImpl,\n type: MODEL_TYPE,\n});\n","import {\n KosLog,\n ServiceFactory,\n resolveServiceUrl,\n type FutureResponse,\n type KosServiceResponse,\n} from \"@kosdev-code/kos-ui-sdk\";\nconst { URL } = resolveServiceUrl(\"ICE_AGITATOR_SERVICE\");\nconst { getAll, postModel } = ServiceFactory.build({\n basePath: `${URL}/api/ext/freestyle/ice`,\n});\n\nconst log = KosLog.createLogger({\n name: \"ice-agitator-service\",\n group: \"Services\",\n});\n\n/**\n * @category Service\n * Retrieves the initial dispenser data.\n */\nexport const getIceTypes = async (path: string) => {\n log.debug(\"sending GET for ice types\");\n const response = await getAll<string>({\n urlOverride: `${URL}/api/handle/${path}/types`,\n });\n return response;\n};\n\nexport const updateIceType = async (agitator: string, type: string) => {\n log.debug(\"sending POST for ice types\");\n const response = await postModel({\n urlOverride: `${URL}/api/handle/${agitator}/type/${type}`,\n model: {},\n });\n return response;\n};\n\nexport const resetIceSetting = async (path: string) => {\n const response = await getAll({\n urlOverride: `${URL}/api/kos/config/details/${path}/4`,\n });\n return response;\n};\n\nexport const pour = async (path: string, tracker: string) => {\n const response: KosServiceResponse<FutureResponse> | undefined =\n await postModel({\n model: {},\n tracker,\n urlOverride: `${URL}/api/handle/${path}/pour`,\n });\n\n if (!response?.data) {\n throw new Error(\"No response from server\");\n }\n return response?.data as FutureResponse;\n};\n\nexport const agitate = async (path: string, tracker: string) => {\n const response: KosServiceResponse<FutureResponse> | undefined =\n await postModel({\n model: {},\n tracker,\n urlOverride: `${URL}/api/handle/${path}/test/agitation`,\n });\n\n if (!response?.data) {\n throw new Error(\"No response from server\");\n }\n return response?.data as FutureResponse;\n};\n\nexport const testGate = async (path: string, tracker: string) => {\n const response: KosServiceResponse<FutureResponse> | undefined =\n await postModel({\n model: {},\n tracker,\n urlOverride: `${URL}/api/handle/${path}/test/gate`,\n });\n\n if (!response?.data) {\n throw new Error(\"No response from server\");\n }\n return response?.data as FutureResponse;\n};\n","import type {\n FutureAwareContainer,\n FutureContainer,\n IKosDataModel,\n KosConfigProperty,\n KosContextLogger,\n KosCreationContext,\n KosStateProp,\n MultiFutureAware,\n PublicModelInterface,\n} from \"@kosdev-code/kos-ui-sdk\";\nimport {\n createPropKey,\n EventBus,\n KOS_MODEL_ID,\n kosAction,\n kosConfigProperty,\n kosFuture,\n kosModel,\n kosModelEffect,\n kosStateProp,\n MultipleFutureHandler,\n} from \"@kosdev-code/kos-ui-sdk\";\n\nimport { PourState } from \"@kosdev-code/kos-dispense-sdk\";\nimport {\n agitate,\n getIceTypes,\n pour,\n resetIceSetting,\n testGate,\n updateIceType,\n} from \"./services/ice-agitator-services\";\nimport type { IceAgitatorOptions } from \"./types\";\n\nexport type IceAgitatorModel = PublicModelInterface<IceAgitatorModelImpl>;\n\nexport class IceAgitatorEvents {\n static TOPIC_AGITATION_STARTED = \"/kos/events/ddk/ice-agitation-started\";\n static TOPIC_AGITATION_ENDED = \"/kos/events/ddk/ice-agitation-ended\";\n}\nexport const MODEL_TYPE = \"ice-agitator-model\";\nconst PROP_PATH = createPropKey<IceAgitatorModel>(\"statePath\");\n@kosModel(MODEL_TYPE)\nexport class IceAgitatorModelImpl implements IKosDataModel, FutureContainer {\n id: string;\n name: string;\n path: string;\n futureHandler: FutureAwareContainer<Record<string, unknown>> &\n MultiFutureAware<Record<string, unknown>>;\n @kosConfigProperty({\n path: KOS_MODEL_ID,\n attribute: \"settings.volWithoutIceMl\",\n })\n volWithoutIceMl!: KosConfigProperty<number>;\n\n @kosConfigProperty({\n path: KOS_MODEL_ID,\n attribute: \"settings.durationSec\",\n converter: {\n to: \"second\",\n },\n })\n durationSec!: KosConfigProperty<number>;\n\n @kosConfigProperty({\n path: KOS_MODEL_ID,\n attribute: \"enableIceChuteClear\",\n })\n enableIceChuteClear!: KosConfigProperty<boolean>;\n\n @kosConfigProperty({\n path: KOS_MODEL_ID,\n attribute: \"iceChuteClearDurationMs\",\n })\n iceChuteClearDurationMs!: KosConfigProperty<number>;\n\n @kosConfigProperty({\n path: KOS_MODEL_ID,\n attribute: \"iceChuteClearIntervalSec\",\n })\n iceChuteClearIntervalSec!: KosConfigProperty<number>;\n\n @kosConfigProperty({\n path: KOS_MODEL_ID,\n attribute: \"iceChuteClearRetryIntervalSec\",\n })\n iceChuteClearRetryIntervalSec!: KosConfigProperty<number>;\n\n @kosConfigProperty({\n path: KOS_MODEL_ID,\n attribute: \"maxDispenseSec\",\n })\n maxDispenseSec!: KosConfigProperty<number>;\n\n @kosConfigProperty({\n path: KOS_MODEL_ID,\n attribute: \"type\",\n })\n type!: KosConfigProperty<string>;\n\n @kosConfigProperty({\n path: KOS_MODEL_ID,\n attribute: \"settings.dilutionOffset\",\n })\n dilutionOffset!: KosConfigProperty<number>;\n\n @kosConfigProperty({\n path: KOS_MODEL_ID,\n attribute: \"settings.inactivitySec\",\n converter: {\n to: \"minute\",\n },\n })\n inactivitySec!: KosConfigProperty<number>;\n @kosStateProp({ path: PROP_PATH, attribute: \"agitating\" })\n private agitating!: KosStateProp<boolean>;\n\n @kosStateProp({ path: PROP_PATH, attribute: \"iceChuteOpen\" })\n private iceChuteOpen!: KosStateProp<boolean>;\n\n statePath: string;\n private _allIceTypes: string[];\n private logger: KosContextLogger;\n currentState: PourState = PourState.IDLE;\n constructor(\n modelId: string,\n options: IceAgitatorOptions,\n context: KosCreationContext\n ) {\n this.id = modelId;\n this.name = options.name;\n this.path = options.path;\n this.statePath = options.statePath;\n this._allIceTypes = [];\n this.logger = context.logger;\n\n this.futureHandler = new MultipleFutureHandler(this);\n }\n\n get iceTypes(): string[] {\n return this._allIceTypes;\n }\n\n get isAgitating(): boolean {\n return !!this.agitating.value;\n }\n\n get isIceChuteOpen(): boolean {\n return !!this.iceChuteOpen.value;\n }\n\n get future() {\n return this.futureHandler.future;\n }\n\n get pourFuture() {\n return this.futureHandler.futureMap.get(\"pour\");\n }\n\n get agitateFuture() {\n return this.futureHandler.futureMap.get(\"agitate\");\n }\n get gateFuture() {\n return this.futureHandler.futureMap.get(\"gate\");\n }\n\n /**\n * A derived value that indicates if the nozzle is currently pouring a beverage.\n * @readonly\n */\n get isPouring() {\n return (\n !!(this.pourFuture && !this.pourFuture?.endState) ||\n this.currentState === PourState.POUR_STARTING ||\n this.currentState === PourState.POURING ||\n this.currentState === PourState.POUR_CANCELING\n );\n }\n\n /**\n * A derived value that indicates if it is possible to dispense ice.\n *\n * The value is observable and will change as the current dispense state changes\n * @readonly\n * */\n get canPour() {\n return this.currentState === PourState.IDLE;\n }\n private updateIfCurrent(currentState: PourState, nextState: PourState) {\n if (this.currentState === currentState) {\n kosAction(() => {\n this.currentState = nextState;\n });\n }\n }\n @kosFuture({ alias: \"pour\" })\n public async pourIce(tracker?: string) {\n try {\n if (this.currentState === PourState.IDLE) {\n this.updateIfCurrent(PourState.IDLE, PourState.POUR_STARTING);\n if (!tracker) {\n throw new Error(\"No tracker provided\");\n }\n\n const result = await pour(this.path, tracker);\n this.updateIfCurrent(PourState.POUR_STARTING, PourState.POURING);\n\n if (result?.endState) {\n this.updateIfCurrent(PourState.POURING, PourState.IDLE);\n }\n return result as unknown as Promise<void>;\n } else {\n throw new Error(`Cannot pour in state ${this.currentState}`);\n }\n } catch (e) {\n this.logger.error(e);\n this.currentState = PourState.IDLE;\n throw e;\n }\n }\n\n /**\n * An action that will cancel the ice dispense if it is currently in progress.\n * */\n public async cancelIceDispense() {\n if (\n this.currentState === PourState.POURING ||\n this.currentState === PourState.POUR_STARTING\n ) {\n this.currentState = PourState.POUR_CANCELING;\n await this.pourFuture?.cancelFuture();\n kosAction(() => {\n this.currentState = PourState.IDLE;\n });\n } else {\n this.logger.warn(\n `Cannot cancel ice dispense in state ${this.currentState}`\n );\n }\n }\n @kosFuture({ alias: \"agitate\" })\n async testAgitate(tracker?: string) {\n // should be handed in by the `kosFuture` decorator\n if (!tracker) {\n throw new Error(\"No tracker provided\");\n }\n\n this.logger.info(`agitating ice-agitator ${this.id}`);\n\n return agitate(this.path, tracker);\n }\n\n @kosFuture({\n alias: \"gate\",\n })\n async testGate(tracker?: string) {\n // should be handed in by the `kosFuture` decorator\n if (!tracker) {\n throw new Error(\"No tracker provided\");\n }\n\n this.logger.info(`testing ice gate: ${this.id}`);\n\n return testGate(this.path, tracker);\n }\n @kosModelEffect({\n dependencies: (model) => [model.isAgitating],\n })\n handleAgitationChange() {\n if (this.isAgitating) {\n this.logger.info(`agitating ice-agitator ${this.id}`);\n EventBus.publish(IceAgitatorEvents.TOPIC_AGITATION_STARTED, {\n path: this.path,\n futureId: this.futureHandler.future?.futureId,\n });\n } else {\n EventBus.publish(IceAgitatorEvents.TOPIC_AGITATION_ENDED, {\n path: this.path,\n });\n }\n }\n async updateIceType(type: string) {\n await updateIceType(this.path, type);\n }\n\n resetDefaultValues = async () => {\n const defaults = await resetIceSetting(this.path);\n return defaults;\n };\n\n async init(): Promise<void> {\n this.logger.debug(`initializing ice-agitator ${this.id}`);\n }\n\n async load(): Promise<void> {\n this.logger.debug(`loading ice-agitator ${this.id}`);\n const iceTypes = await getIceTypes(this.path);\n if (iceTypes?.status === 200) {\n kosAction(() => {\n this._allIceTypes = iceTypes.data || [];\n });\n }\n }\n}\n","import { KosModelRegistrationFactory } from \"@kosdev-code/kos-ui-sdk\";\nimport {\n IceAgitatorModelImpl,\n MODEL_TYPE,\n type IceAgitatorModel,\n} from \"./ice-agitator-model\";\nimport type { IceAgitatorOptions } from \"./types\";\n\n/**\n * # IceAgitator\n *\n * The registration bean includes convenience methods for creating and working with IceAgitatorModel instances.\n *\n * ## type\n * The type property is a string that identifies the model type.\n * The type is used to identify the model type in the model registry and to narrow down the model type in type predicates. It's most frequently\n * used when declaring dependencies on models.\n *\n * @example\n * ```typescript\n *\n * @kosDependency({modelType: IceAgitator.type, id: \"iceAgitatorId\"})\n * private iceAgitatorModel: IceAgitatorModel;\n * ```\n *\n *\n * ## factory\n *\n * The factory method creates a factory function that can be used to create new IceAgitatorModel instances.\n *\n \n * The factory function is a curried function that takes the model id as the first argument and the options as the second argument.\n *\n * If a model with the specified id already exists, the factory function will return the existing model. The options will be ignored\n * in this case and the existing model will be returned in its current state.\n *\n * @example\n * ```typescript\n * const model = IceAgitator.factory(\"iceAgitatorId\")({\n * // Add option data\n * });\n * ```\n \n\n *\n * ## predicate\n *\n * [Typescript type predicate](https://www.typescriptlang.org/docs/handbook/2/narrowing.html#using-type-predicates) function that will identify and narrow down a model to a IceAgitatorModel.\n *\n * @example\n * ```typescript\n *\n * const model: IKosDataModel = ...; // some model\n *\n * if (IceAgitator.predicate(model)) {\n * // if the function evaluates to true, the model is narrowed down to IceAgitatorModel\n * // and the compiler will know that the model has the IceAgitatorModel interface\n * model.updateAvailability(false);\n * }\n * ```\n *\n * ## registration\n *\n * The registration property is an object that can be used to simplify registration of the model with the model registry. The registration object\n * can be spread into the model registration and provides all of the required information to register the model implementation class against the model type.\n *\n *\n * @example\n *\n * In an application registration file you can declare the model registration as follows:\n *\n * **registration.ts**\n * ```typescript\n * import { IceAgitator } from \"@kos-ui/kos-dispenser-model\";\n * ...\n * import { ExtensionManager, IKosRegistry } from \"@kosdev-code/kos-ui-sdk\";\n * export const kosModels: IKosRegistry[\"models\"] = {\n * ...IceAgitator.registration,\n * };\n * ```\n *\n * ## registration.singleton\n \n * The iceAgitator model is NOT a singleton model. This means that each time the factory function is called with a unique ID, a new model instance will be created.\n * If the factory function is called with an ID that already exists, the existing model will be returned.\n \n * */\n\nexport const IceAgitator = new KosModelRegistrationFactory<\n IceAgitatorModel,\n IceAgitatorOptions\n>({\n class: IceAgitatorModelImpl,\n type: MODEL_TYPE,\n});\n","import {\n Assembly,\n HolderModel,\n type HolderTroubleData,\n} from \"@kosdev-code/kos-dispense-sdk\";\nimport type {\n DeferAware,\n FutureResponse,\n IKosDataModel,\n IKosIdentifiable,\n KosConfigProperty,\n KosContextLogger,\n KosCreationContext,\n PublicModelInterface,\n ResolveAware,\n TroubleModel,\n} from \"@kosdev-code/kos-ui-sdk\";\nimport {\n DependencyLifecycle,\n getKosModelSync,\n kosConfigProperty,\n kosModel,\n kosTopicHandler,\n modelTypeEventTopicFactory,\n} from \"@kosdev-code/kos-ui-sdk\";\nimport type { AgitationRequiredTroubleOptions } from \"./types\";\n\nexport const MODEL_TYPE = \"agitation-required-trouble-model\";\n\nexport type AgitationRequiredTroubleModel =\n PublicModelInterface<AgitationRequiredTroubleModelImpl>;\n\nexport const agitationModelFactory = (troubleModel: TroubleModel) => {\n if (troubleModel.data.agitationRequired) {\n return MODEL_TYPE;\n }\n return undefined;\n};\n\nexport const AGITATION_REQUIRED_TROUBLE = \"InsufficientAgitationTrouble\";\n@kosModel(MODEL_TYPE)\nexport class AgitationRequiredTroubleModelImpl\n implements IKosDataModel, IKosIdentifiable, ResolveAware, DeferAware\n{\n id: string;\n private logger: KosContextLogger;\n private trouble: TroubleModel<HolderTroubleData>;\n private _deferred: boolean;\n private _holdersLoaded = false;\n\n @kosConfigProperty({\n path: \"app:kosdev.ddk:app\",\n attribute: \"ncui.agitateBeforePour\",\n })\n agitateBeforePour!: KosConfigProperty<boolean>;\n\n constructor(\n modelId: string,\n options: AgitationRequiredTroubleOptions,\n context: KosCreationContext\n ) {\n this.id = modelId;\n this.logger = context.logger;\n this._deferred = false;\n this.trouble = options.companionParent;\n }\n\n async resolve(): Promise<FutureResponse | undefined> {\n // Resolve the trouble here.\n return this.trouble.resolve();\n }\n\n get holder() {\n const holderPath = this.trouble.data.holderPaths[0];\n const holderModel = getKosModelSync<HolderModel>(holderPath);\n\n if (!this._holdersLoaded && !holderModel.model) {\n return undefined;\n }\n\n return holderModel?.model;\n }\n\n @kosTopicHandler({\n topic: modelTypeEventTopicFactory(Assembly.type),\n lifecycle: DependencyLifecycle.INIT,\n })\n updateHolder() {\n if (!this._holdersLoaded) {\n const holderPath = this.trouble.data.holderPaths[0];\n const holderModel = getKosModelSync<HolderModel>(holderPath);\n if (holderModel.model) {\n this._holdersLoaded = true;\n }\n }\n }\n\n get shouldDefer() {\n if (!this.holder) {\n return true;\n }\n const troubleList =\n this.holder?.troublesByType[AGITATION_REQUIRED_TROUBLE] || [];\n const hasInsufficientAgitationTrouble = troubleList.length > 0;\n const waitForAgitation = !!this.agitateBeforePour?.value;\n return waitForAgitation && hasInsufficientAgitationTrouble;\n }\n\n get deferred() {\n return this._deferred;\n }\n defer() {\n this._deferred = true;\n }\n\n clearDefer() {\n this._deferred = false;\n }\n}\n","import { KosModelRegistrationFactory } from \"@kosdev-code/kos-ui-sdk\";\nimport type { AgitationRequiredTroubleModel } from \"./agitation-required-trouble-model\";\nimport {\n AgitationRequiredTroubleModelImpl,\n MODEL_TYPE,\n} from \"./agitation-required-trouble-model\";\nimport type { AgitationRequiredTroubleOptions } from \"./types\";\n\n/**\n * # AgitationRequiredTrouble\n *\n * The registration bean includes convenience methods for creating and working with AgitationRequiredTroubleModel instances.\n *\n * ## type\n * The type property is a string that identifies the model type.\n * The type is used to identify the model type in the model registry and to narrow down the model type in type predicates. It's most frequently\n * used when declaring dependencies on models.\n *\n * @example\n * ```typescript\n *\n * @kosDependency({modelType: AgitationRequiredTrouble.type, id: \"agitationRequiredTroubleId\"})\n * private agitationRequiredTroubleModel: AgitationRequiredTroubleModel;\n * ```\n *\n *\n * ## factory\n *\n * The factory method creates a factory function that can be used to create new AgitationRequiredTroubleModel instances.\n *\n \n * The factory function is a curried function that takes the model id as the first argument and the options as the second argument.\n *\n * If a model with the specified id already exists, the factory function will return the existing model. The options will be ignored\n * in this case and the existing model will be returned in its current state.\n *\n * @example\n * ```typescript\n * const model = AgitationRequiredTrouble.factory(\"agitationRequiredTroubleId\")({\n * // Add option data\n * });\n * ```\n \n\n *\n * ## predicate\n *\n * [Typescript type predicate](https://www.typescriptlang.org/docs/handbook/2/narrowing.html#using-type-predicates) function that will identify and narrow down a model to a AgitationRequiredTroubleModel.\n *\n * @example\n * ```typescript\n *\n * const model: IKosDataModel = ...; // some model\n *\n * if (AgitationRequiredTrouble.predicate(model)) {\n * // if the function evaluates to true, the model is narrowed down to AgitationRequiredTroubleModel\n * // and the compiler will know that the model has the AgitationRequiredTroubleModel interface\n * model.updateAvailability(false);\n * }\n * ```\n *\n * ## registration\n *\n * The registration property is an object that can be used to simplify registration of the model with the model registry. The registration object\n * can be spread into the model registration and provides all of the required information to register the model implementation class against the model type.\n *\n *\n * @example\n *\n * In an application registration file you can declare the model registration as follows:\n *\n * **registration.ts**\n * ```typescript\n * import { AgitationRequiredTrouble } from \"@kos-ui/project-models\";\n * import { KosModelRegistry } from \"@kosdev-code/kos-dispense-sdk\";\n *\n * import { initKosProvider } from \"@kosdev-code/kos-ui-sdk\";\n *\n * KosModelRegistry.dispense\n * .models()\n * .model(AgitationRequiredTrouble);\n * ```\n *\n * ## registration.singleton\n \n * The agitationRequiredTrouble model is NOT a singleton model. This means that each time the factory function is called with a unique ID, a new model instance will be created.\n * If the factory function is called with an ID that already exists, the existing model will be returned.\n \n * */\nexport const AgitationRequiredTrouble = new KosModelRegistrationFactory<\n AgitationRequiredTroubleModel,\n AgitationRequiredTroubleOptions\n>({\n class: AgitationRequiredTroubleModelImpl,\n type: MODEL_TYPE,\n});\n","import type { DataMapper } from \"@kosdev-code/kos-ui-sdk\";\nimport {\n CarbAgitator,\n type CarbAgitatorModel,\n} from \"../../../models/carb-agitator\";\nimport {\n IceAgitator,\n type IceAgitatorModel,\n} from \"../../../models/ice-agitator\";\n\nimport {\n CartridgeAgitator,\n CartridgeAgitatorContainer,\n} from \"../../../models/cartridge-agitator\";\nimport type { FreestyleModelAssemblyExt } from \"../../../models/types/assembly\";\nimport type { FreestyleAssemblyResponse } from \"./types\";\n\ntype AgitatorModel = CarbAgitatorModel | IceAgitatorModel;\nexport type AgitatorTypes = \"iceAgitator\" | \"carbAgitator\";\nexport const AGITATOR_KEYS: AgitatorTypes[] = [\"iceAgitator\", \"carbAgitator\"];\nexport const AGITATOR_FACTORY_MAP = {\n iceAgitator: IceAgitator.factory,\n carbAgitator: CarbAgitator.factory,\n};\nexport const AGITATOR_NAME_MAP = {\n iceAgitator: \"Ice Agitator\",\n carbAgitator: \"Carb Agitator\",\n cartridgeAgitator: \"Cartridge Agitator\",\n};\n\nexport const freestyleAssemblyDataMapper: DataMapper<\n FreestyleAssemblyResponse,\n FreestyleModelAssemblyExt\n> = async (data) => {\n const cartridgeAgitators = CartridgeAgitatorContainer.instance()\n .options({})\n .build();\n const response = data.assemblies.reduce((acc, assembly) => {\n AGITATOR_KEYS.forEach((key) => {\n const agitator = assembly[key];\n if (agitator) {\n const factory = AGITATOR_FACTORY_MAP[key](agitator.path);\n acc[key] = factory({\n name: agitator.name,\n path: agitator.path,\n statePath: agitator.state?.path || \"\",\n });\n }\n });\n\n assembly.cartridgeAgitators?.forEach((cartridgeAgitatorData) => {\n const cartridgeAgitator = CartridgeAgitator.instance(\n cartridgeAgitatorData.path\n )\n .options({\n name: cartridgeAgitatorData.name,\n path: cartridgeAgitatorData.path,\n statePath: cartridgeAgitatorData.state?.path || \"\",\n })\n .build();\n cartridgeAgitators.addModel(cartridgeAgitator);\n });\n return acc;\n }, {} as { [key in AgitatorTypes]?: AgitatorModel });\n\n const supportsIce = !!response.iceAgitator;\n const supportsCarb = !!response.carbAgitator;\n\n return {\n ...response,\n cartridgeAgitators,\n supportsCarb,\n supportsIce,\n } as FreestyleModelAssemblyExt;\n};\n","import {\n Assembly,\n KosModelRegistry as DispenseModelRegistration,\n Holder,\n Nozzle,\n Pump,\n PumpContainer,\n PumpContainerModel,\n PumpIndex,\n registerDispenseModels,\n type IngredientModel,\n type PumpModel,\n} from \"@kosdev-code/kos-dispense-sdk\";\n\nimport {\n EXTENSION_TROUBLE_DATA_MAPPER,\n ExtensionManager,\n getKosModelSync,\n registerCoreModels,\n RegistrationManager,\n Trouble,\n type RegistrationResult,\n type TroubleModel,\n} from \"@kosdev-code/kos-ui-sdk\";\nimport { agitationModelFactory } from \"../models/agitation-required-trouble/agitation-required-trouble-model\";\nimport { AgitationRequiredTrouble } from \"../models/agitation-required-trouble/agitation-required-trouble-registration\";\nimport { CarbAgitator } from \"../models/carb-agitator\";\nimport { CartridgeAgitatorContainer } from \"../models/cartridge-agitator\";\nimport { FreestyleAssembly } from \"../models/freestyle-assembly\";\nimport { FreestyleHolder } from \"../models/freestyle-holder\";\nimport { FreestyleNozzle } from \"../models/freestyle-nozzle\";\nimport { FreestylePump } from \"../models/freestyle-pump\";\nimport { IceAgitator } from \"../models/ice-agitator\";\n\nexport const registerFreestyleModels =\n <R>(root: R) =>\n () => {\n registerCoreModels(root)();\n registerDispenseModels(root)();\n FreestyleNozzle.register();\n FreestyleAssembly.register();\n IceAgitator.register();\n CarbAgitator.register();\n CartridgeAgitatorContainer.register();\n FreestylePump.register();\n FreestyleHolder.register();\n RegistrationManager.companion.register(root)(\n Nozzle.type,\n FreestyleNozzle.type\n );\n\n RegistrationManager.companion.register(root)(\n Assembly.type,\n FreestyleAssembly.type\n );\n\n AgitationRequiredTrouble.register();\n RegistrationManager.companion.register(root)(\n Trouble.type,\n agitationModelFactory\n );\n\n RegistrationManager.companion.register(root)(Pump.type, FreestylePump.type);\n RegistrationManager.companion.register(root)(\n Holder.type,\n FreestyleHolder.type\n );\n\n ExtensionManager[EXTENSION_TROUBLE_DATA_MAPPER].register(\n \"EnjoyByTrouble\",\n async (trouble: TroubleModel) => {\n // If the trouble has an enjoy by date, we can calculate the days since\n if (trouble.data.enjoyByDate) {\n const enjoyByDate = new Date(trouble.data.enjoyByDate);\n const now = new Date();\n const daysSinceEnjoyBy = Math.floor(\n (now.getTime() - enjoyByDate.getTime()) / (1000 * 60 * 60 * 24)\n );\n return {\n enjoyByDays: daysSinceEnjoyBy || \"\",\n };\n }\n\n return {};\n }\n );\n\n ExtensionManager[EXTENSION_TROUBLE_DATA_MAPPER].register(\n \"SuperPumpRequiredTrouble\", // This is the trouble type\n async (_trouble: TroubleModel) => {\n const { model: pumpContainer } = getKosModelSync<PumpContainerModel>(\n PumpContainer.type\n );\n\n if (pumpContainer) {\n const superPumpModels = pumpContainer.models.getIndexByKey(\n PumpIndex.byType,\n \"microSuper\"\n );\n const superPumps = superPumpModels\n .map((model) => model.name)\n .join(\", \");\n return {\n superPumps,\n };\n }\n return {};\n }\n );\n ExtensionManager[EXTENSION_TROUBLE_DATA_MAPPER].register(\n \"MicroPumpAirDetectTrouble\",\n async (trouble: TroubleModel) => {\n // If the trouble is related to a container, we don't need to map the data\n if (trouble.ifaces.includes(\"container\")) {\n return {};\n }\n if (trouble.data.pumpPath) {\n const { model: pumpModel } = getKosModelSync<PumpModel>(\n trouble.data.pumpPath\n );\n\n if (pumpModel) {\n const ingredientModel = pumpModel.ingredientId\n ? getKosModelSync<IngredientModel>(pumpModel.ingredientId).model\n : undefined;\n return {\n ingredientId: pumpModel.ingredientId,\n ingredientName: ingredientModel?.name || \"\",\n };\n }\n }\n return {};\n }\n );\n return {\n preload: RegistrationManager.model.preloadModel(root),\n model: RegistrationManager.model.register(root),\n companion: RegistrationManager.companion.register(root),\n legacy: RegistrationManager.model.registerLegacyModel(root),\n };\n };\n\ntype ModelRegistry<R> = typeof DispenseModelRegistration & {\n freestyle: { models: () => RegistrationResult<R> };\n preload: ReturnType<typeof RegistrationManager.model.preloadModel>;\n model: ReturnType<typeof RegistrationManager.model.register>;\n companion: ReturnType<typeof RegistrationManager.companion.register>;\n};\n\nconst _KosModelRegistry = {\n ...DispenseModelRegistration,\n};\n\n(_KosModelRegistry as any).freestyle = {\n models: registerFreestyleModels(_KosModelRegistry),\n};\n(_KosModelRegistry as any).preload =\n RegistrationManager.model.preloadModel(_KosModelRegistry);\n(_KosModelRegistry as any).model =\n RegistrationManager.model.register(_KosModelRegistry);\n(_KosModelRegistry as any).companion =\n RegistrationManager.companion.register(_KosModelRegistry);\n(_KosModelRegistry as any).legacy =\n RegistrationManager.model.registerLegacyModel(_KosModelRegistry);\n\ntype KosModelRegistryType = ModelRegistry<typeof _KosModelRegistry>;\n\nconst KosModelRegistry: KosModelRegistryType = _KosModelRegistry as any;\n\nexport { KosModelRegistry };\n"],"names":["MODEL_TYPE","CarbAgitatorModelImpl","modelId","options","context","__publicField","__decorateClass","kosModel","CarbAgitator","KosModelRegistrationFactory","CartridgeAgitatorContainerModelImpl","KosModelContainer","id","model","kosChild","URL","resolveServiceUrl","postModel","ServiceFactory","agitate","path","tracker","response","CartridgeAgitatorEvents","PROP_PATH","createPropKey","CartridgeAgitatorModelImpl","setupMinimalFutureSupport","_a","kosEffect","EventBus","kosStateProp","kosFuture","CartridgeAgitator","CartridgeAgitatorContainer","SingletonKosModelRegistrationFactory","FEATURE_SUPPORTS_ICE","FEATURE_SUPPORTS_CARB","FreestyleAssemblyModelImpl","group","nozzlePath","KosFeatureFlags","FreestyleAssembly","resolveFreestyleAssembly","KosContextManager","freestyleAssembly","KosLog","futureDelegate","method","FutureManager","FreestyleHolderModelImpl","FreestyleHolder","getOne","log","NutritionInfoError","message","InvalidRequestError","getFreestyleNutritionInfo","nozzleUrlPrefix","beverageId","volumes","baseUrl","FreestyleNozzleModelImpl","cupSizes","kosAutoEffect","prefix","kosAction","error","kosParentAware","FreestyleNozzle","replacePump","pumpId","code","FetchError","errorCode","_c","_b","_d","_e","FreestylePumpModelImpl","data","FreestylePump","getAll","getIceTypes","updateIceType","agitator","type","resetIceSetting","pour","testGate","IceAgitatorEvents","IceAgitatorModelImpl","PourState","MultipleFutureHandler","currentState","nextState","result","e","iceTypes","kosConfigProperty","KOS_MODEL_ID","kosModelEffect","IceAgitator","agitationModelFactory","troubleModel","AGITATION_REQUIRED_TROUBLE","AgitationRequiredTroubleModelImpl","holderPath","holderModel","getKosModelSync","hasInsufficientAgitationTrouble","kosTopicHandler","modelTypeEventTopicFactory","Assembly","DependencyLifecycle","AgitationRequiredTrouble","AGITATOR_KEYS","AGITATOR_FACTORY_MAP","freestyleAssemblyDataMapper","cartridgeAgitators","acc","assembly","key","factory","cartridgeAgitatorData","cartridgeAgitator","supportsIce","supportsCarb","registerFreestyleModels","root","registerCoreModels","registerDispenseModels","RegistrationManager","Nozzle","Trouble","Pump","Holder","ExtensionManager","EXTENSION_TROUBLE_DATA_MAPPER","trouble","enjoyByDate","_trouble","pumpContainer","PumpContainer","PumpIndex","pumpModel","ingredientModel","_KosModelRegistry","DispenseModelRegistration","KosModelRegistry"],"mappings":"odAQO,MAAMA,EAAa,sBAGnB,IAAMC,EAAN,KAAwE,CAM7E,YACEC,EACAC,EACAC,EACA,CATFC,EAAA,WACAA,EAAA,aACAA,EAAA,aAEQA,EAAA,eAMN,KAAK,GAAKH,EACV,KAAK,KAAOC,EAAQ,KACpB,KAAK,KAAOA,EAAQ,KACpB,KAAK,OAASC,EAAQ,MAIxB,CAIA,MAAM,MAAsB,CAC1B,KAAK,OAAO,MAAM,8BAA8B,KAAK,EAAE,EAAE,CAC3D,CAEA,MAAM,MAAsB,CAC1B,KAAK,OAAO,MAAM,yBAAyB,KAAK,EAAE,EAAE,CACtD,CACF,EA7BaH,EAANK,GAAA,CADNC,EAAAA,SAASP,CAAU,CAAA,EACPC,CAAA,ECyEA,MAAAO,EAAe,IAAIC,EAAAA,4BAG9B,CACA,MAAOR,EACP,KAAMD,CACR,CAAC,sMC7EM,MAAMA,EAAa,qCAMnB,IAAMU,EAAN,KAKP,CAIE,YACER,EACAC,EACAC,EACA,CAPFC,EAAA,WACQA,EAAA,eACUA,EAAA,gBAMhB,KAAK,GAAKH,EACV,KAAK,OAASE,EAAQ,OACjB,KAAA,QAAU,IAAIO,oBAA0C,CAC3D,SAAUT,CAAA,CACX,CAIH,CAEA,SAASU,EAAY,CACZ,OAAA,KAAK,QAAQ,SAASA,CAAE,CACjC,CACA,IAAI,QAAS,CACX,OAAO,KAAK,OACd,CACA,IAAI,MAAO,CACT,OAAO,KAAK,QAAQ,IACtB,CAEA,SAASC,EAA+B,CACjC,KAAA,QAAQ,SAASA,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AMC,EAAkBD,EAAU,aAC9BpC,kBAAiCoC,EAAU,YAAY,EAAE,MACzD,OACG,MAAA,CACL,aAAcA,EAAU,aACxB,gBAAgBC,GAAA,YAAAA,EAAiB,OAAQ,EAAA,CAE7C,CACF,CACA,MAAO,EACT,CAAA,EAEK,CACL,QAASd,EAAA,oBAAoB,MAAM,aAAaH,CAAI,EACpD,MAAOG,EAAA,oBAAoB,MAAM,SAASH,CAAI,EAC9C,UAAWG,EAAA,oBAAoB,UAAU,SAASH,CAAI,EACtD,OAAQG,EAAA,oBAAoB,MAAM,oBAAoBH,CAAI,CAAA,GAW1DkB,EAAoB,CACxB,GAAGC,EAAA,gBACL,EAECD,EAA0B,UAAY,CACrC,OAAQnB,GAAwBmB,CAAiB,CACnD,EACCA,EAA0B,QACzBf,EAAA,oBAAoB,MAAM,aAAae,CAAiB,EACzDA,EAA0B,MACzBf,EAAA,oBAAoB,MAAM,SAASe,CAAiB,EACrDA,EAA0B,UACzBf,EAAA,oBAAoB,UAAU,SAASe,CAAiB,EACzDA,EAA0B,OACzBf,EAAA,oBAAoB,MAAM,oBAAoBe,CAAiB,EAIjE,MAAME,GAAyCF"}
@@ -2,7 +2,7 @@ var Ie = Object.defineProperty;
2
2
  var Ae = (e, t, r) => t in e ? Ie(e, t, { enumerable: !0, configurable: !0, writable: !0, value: r }) : e[t] = r;
3
3
  var i = (e, t, r) => (Ae(e, typeof t != "symbol" ? t + "" : t, r), r);
4
4
  import { PourState as d, Assembly as te, KosModelRegistry as Oe, registerDispenseModels as Ee, Nozzle as Te, Pump as $e, Holder as Ce, PumpContainer as we, PumpIndex as Me } from "@kosdev-code/kos-dispense-sdk";
5
- import { kosModel as m, KosModelRegistrationFactory as _, KosModelContainer as Se, kosChild as De, resolveServiceUrl as S, ServiceFactory as D, createPropKey as re, kosStateProp as q, kosFuture as z, FutureHandler as ze, kosEffect as Re, EventBus as $, SingletonKosModelRegistrationFactory as ae, KosFeatureFlags as Q, KosContextManager as Ne, KosLog as R, FutureManager as Fe, kosParentAware as Le, kosAutoEffect as Ge, kosAction as T, FetchError as je, kosConfigProperty as f, KOS_MODEL_ID as y, kosModelEffect as He, MultipleFutureHandler as Ue, kosTopicHandler as Be, modelTypeEventTopicFactory as xe, DependencyLifecycle as Ke, getKosModelSync as I, RegistrationManager as g, registerCoreModels as qe, Trouble as Ye, ExtensionManager as F, EXTENSION_TROUBLE_DATA_MAPPER as L } from "@kosdev-code/kos-ui-sdk";
5
+ import { kosModel as m, KosModelRegistrationFactory as _, KosModelContainer as Se, kosChild as De, resolveServiceUrl as S, ServiceFactory as D, createPropKey as re, kosStateProp as q, kosFuture as z, setupMinimalFutureSupport as ze, kosEffect as Re, EventBus as $, SingletonKosModelRegistrationFactory as ae, KosFeatureFlags as Q, KosContextManager as Ne, KosLog as R, FutureManager as Fe, kosParentAware as Le, kosAutoEffect as Ge, kosAction as T, FetchError as je, kosConfigProperty as y, KOS_MODEL_ID as f, kosModelEffect as Ue, MultipleFutureHandler as He, kosTopicHandler as Be, modelTypeEventTopicFactory as xe, DependencyLifecycle as Ke, getKosModelSync as I, RegistrationManager as g, registerCoreModels as qe, Trouble as Ye, ExtensionManager as F, EXTENSION_TROUBLE_DATA_MAPPER as L } from "@kosdev-code/kos-ui-sdk";
6
6
  var Ve = Object.defineProperty, We = Object.getOwnPropertyDescriptor, Ze = (e, t, r, s) => {
7
7
  for (var a = s > 1 ? void 0 : s ? We(t, r) : t, o = e.length - 1, n; o >= 0; o--)
8
8
  (n = e[o]) && (a = (s ? n(t, r, a) : n(a)) || a);
@@ -112,14 +112,11 @@ let A = class {
112
112
  i(this, "path");
113
113
  i(this, "statePath");
114
114
  i(this, "name");
115
- this.id = e, this.logger = r.logger, this.futureHandler = new ze(this), this.path = t.path, this.name = t.name, this.statePath = t.statePath;
115
+ this.id = e, this.logger = r.logger, this.path = t.path, this.name = t.name, this.statePath = t.statePath, ze(this);
116
116
  }
117
117
  get isAgitating() {
118
118
  return !!this.agitating.value;
119
119
  }
120
- get future() {
121
- return this.futureHandler.future;
122
- }
123
120
  async testAgitate(e) {
124
121
  if (!e)
125
122
  throw new Error("No tracker provided");
@@ -172,7 +169,7 @@ var at = Object.defineProperty, it = Object.getOwnPropertyDescriptor, st = (e, t
172
169
  return s && a && at(t, r, a), a;
173
170
  };
174
171
  const ce = "freestyle-assembly-model", ot = "iceAgitator", nt = "carbAgitator";
175
- let H = class {
172
+ let U = class {
176
173
  constructor(e, t, r) {
177
174
  i(this, "id");
178
175
  i(this, "logger");
@@ -238,11 +235,11 @@ let H = class {
238
235
  this.logger.debug(`loading freestyle-assembly ${this.id}`);
239
236
  }
240
237
  };
241
- H = st([
238
+ U = st([
242
239
  m(ce)
243
- ], H);
244
- const U = new ae({
245
- class: H,
240
+ ], U);
241
+ const H = new ae({
242
+ class: U,
246
243
  type: ce
247
244
  });
248
245
  var lt = Object.defineProperty, ut = Object.getOwnPropertyDescriptor, dt = (e, t, r, s) => {
@@ -253,7 +250,7 @@ var lt = Object.defineProperty, ut = Object.getOwnPropertyDescriptor, dt = (e, t
253
250
  const ge = "freestyle-holder-model";
254
251
  function ct(e) {
255
252
  const t = Ne.getContext(e), r = t == null ? void 0 : t.get(
256
- U.type
253
+ H.type
257
254
  );
258
255
  if (!r) {
259
256
  R.error("Freestyle assembly not found");
@@ -315,7 +312,7 @@ const X = new _({
315
312
  name: "freestyle-nozzle-service",
316
313
  group: "Services"
317
314
  });
318
- class ft extends Error {
315
+ class yt extends Error {
319
316
  constructor(t) {
320
317
  super(t), this.name = "NutritionInfoError";
321
318
  }
@@ -325,7 +322,7 @@ class J extends Error {
325
322
  super(t), this.name = "InvalidRequestError";
326
323
  }
327
324
  }
328
- const yt = async (e, t, r, s = "http://localhost:8081") => {
325
+ const ft = async (e, t, r, s = "http://localhost:8081") => {
329
326
  if (E.debug("sending GET for freestyle-nozzle"), !t)
330
327
  throw E.error("Invalid freestyle-nozzle request: beverageId is required"), new J("No beverageId provided");
331
328
  if (!r || r.length === 0)
@@ -338,7 +335,7 @@ const yt = async (e, t, r, s = "http://localhost:8081") => {
338
335
  if (!(a != null && a.data))
339
336
  throw E.error("Failed to retrieve freestyle-nozzle data"), new Error("Failed to retrieve freestyle-nozzle data");
340
337
  if (a.data.error)
341
- throw new ft(a.data.error);
338
+ throw new yt(a.data.error);
342
339
  return a.data;
343
340
  };
344
341
  var mt = Object.defineProperty, bt = Object.getOwnPropertyDescriptor, _t = (e, t, r, s) => {
@@ -372,7 +369,7 @@ let x = class {
372
369
  );
373
370
  const e = this.nozzleModel.selectedPourable.beverage.rawId, t = this.nozzleModel.urlPrefix;
374
371
  try {
375
- const r = await yt(
372
+ const r = await ft(
376
373
  t,
377
374
  e,
378
375
  this._cupSizes
@@ -432,7 +429,7 @@ var It = Object.defineProperty, At = Object.getOwnPropertyDescriptor, Ot = (e, t
432
429
  (n = e[o]) && (a = (s ? n(t, r, a) : n(a)) || a);
433
430
  return s && a && It(t, r, a), a;
434
431
  };
435
- const fe = "freestyle-pump-model";
432
+ const ye = "freestyle-pump-model";
436
433
  let K = class {
437
434
  constructor(e, t, r) {
438
435
  i(this, "id");
@@ -447,22 +444,22 @@ let K = class {
447
444
  }
448
445
  };
449
446
  K = Ot([
450
- m(fe)
447
+ m(ye)
451
448
  ], K);
452
449
  const ee = new _({
453
450
  class: K,
454
- type: fe
455
- }), { URL: P } = S("ICE_AGITATOR_SERVICE"), { getAll: ye, postModel: N } = D.build({
451
+ type: ye
452
+ }), { URL: P } = S("ICE_AGITATOR_SERVICE"), { getAll: fe, postModel: N } = D.build({
456
453
  basePath: `${P}/api/ext/freestyle/ice`
457
454
  }), me = R.createLogger({
458
455
  name: "ice-agitator-service",
459
456
  group: "Services"
460
- }), Et = async (e) => (me.debug("sending GET for ice types"), await ye({
457
+ }), Et = async (e) => (me.debug("sending GET for ice types"), await fe({
461
458
  urlOverride: `${P}/api/handle/${e}/types`
462
459
  })), Tt = async (e, t) => (me.debug("sending POST for ice types"), await N({
463
460
  urlOverride: `${P}/api/handle/${e}/type/${t}`,
464
461
  model: {}
465
- })), $t = async (e) => await ye({
462
+ })), $t = async (e) => await fe({
466
463
  urlOverride: `${P}/api/kos/config/details/${e}/4`
467
464
  }), Ct = async (e, t) => {
468
465
  const r = await N({
@@ -524,7 +521,7 @@ let u = class {
524
521
  i(this, "logger");
525
522
  i(this, "currentState", d.IDLE);
526
523
  i(this, "resetDefaultValues", async () => await $t(this.path));
527
- this.id = e, this.name = t.name, this.path = t.path, this.statePath = t.statePath, this._allIceTypes = [], this.logger = r.logger, this.futureHandler = new Ue(this);
524
+ this.id = e, this.name = t.name, this.path = t.path, this.statePath = t.statePath, this._allIceTypes = [], this.logger = r.logger, this.futureHandler = new He(this);
528
525
  }
529
526
  get iceTypes() {
530
527
  return this._allIceTypes;
@@ -627,14 +624,14 @@ let u = class {
627
624
  }
628
625
  };
629
626
  c([
630
- f({
631
- path: y,
627
+ y({
628
+ path: f,
632
629
  attribute: "settings.volWithoutIceMl"
633
630
  })
634
631
  ], u.prototype, "volWithoutIceMl", 2);
635
632
  c([
636
- f({
637
- path: y,
633
+ y({
634
+ path: f,
638
635
  attribute: "settings.durationSec",
639
636
  converter: {
640
637
  to: "second"
@@ -642,50 +639,50 @@ c([
642
639
  })
643
640
  ], u.prototype, "durationSec", 2);
644
641
  c([
645
- f({
646
- path: y,
642
+ y({
643
+ path: f,
647
644
  attribute: "enableIceChuteClear"
648
645
  })
649
646
  ], u.prototype, "enableIceChuteClear", 2);
650
647
  c([
651
- f({
652
- path: y,
648
+ y({
649
+ path: f,
653
650
  attribute: "iceChuteClearDurationMs"
654
651
  })
655
652
  ], u.prototype, "iceChuteClearDurationMs", 2);
656
653
  c([
657
- f({
658
- path: y,
654
+ y({
655
+ path: f,
659
656
  attribute: "iceChuteClearIntervalSec"
660
657
  })
661
658
  ], u.prototype, "iceChuteClearIntervalSec", 2);
662
659
  c([
663
- f({
664
- path: y,
660
+ y({
661
+ path: f,
665
662
  attribute: "iceChuteClearRetryIntervalSec"
666
663
  })
667
664
  ], u.prototype, "iceChuteClearRetryIntervalSec", 2);
668
665
  c([
669
- f({
670
- path: y,
666
+ y({
667
+ path: f,
671
668
  attribute: "maxDispenseSec"
672
669
  })
673
670
  ], u.prototype, "maxDispenseSec", 2);
674
671
  c([
675
- f({
676
- path: y,
672
+ y({
673
+ path: f,
677
674
  attribute: "type"
678
675
  })
679
676
  ], u.prototype, "type", 2);
680
677
  c([
681
- f({
682
- path: y,
678
+ y({
679
+ path: f,
683
680
  attribute: "settings.dilutionOffset"
684
681
  })
685
682
  ], u.prototype, "dilutionOffset", 2);
686
683
  c([
687
- f({
688
- path: y,
684
+ y({
685
+ path: f,
689
686
  attribute: "settings.inactivitySec",
690
687
  converter: {
691
688
  to: "minute"
@@ -710,7 +707,7 @@ c([
710
707
  })
711
708
  ], u.prototype, "testGate", 1);
712
709
  c([
713
- He({
710
+ Ue({
714
711
  dependencies: (e) => [e.isAgitating]
715
712
  })
716
713
  ], u.prototype, "handleAgitationChange", 1);
@@ -772,7 +769,7 @@ let O = class {
772
769
  }
773
770
  };
774
771
  W([
775
- f({
772
+ y({
776
773
  path: "app:kosdev.ddk:app",
777
774
  attribute: "ncui.agitateBeforePour"
778
775
  })
@@ -824,12 +821,12 @@ const Lt = new _({
824
821
  supportsCarb: a,
825
822
  supportsIce: s
826
823
  };
827
- }, Ht = (e) => () => (qe(e)(), Ee(e)(), k.register(), U.register(), Pe.register(), se.register(), V.register(), ee.register(), X.register(), g.companion.register(e)(
824
+ }, Ut = (e) => () => (qe(e)(), Ee(e)(), k.register(), H.register(), Pe.register(), se.register(), V.register(), ee.register(), X.register(), g.companion.register(e)(
828
825
  Te.type,
829
826
  k.type
830
827
  ), g.companion.register(e)(
831
828
  te.type,
832
- U.type
829
+ H.type
833
830
  ), Lt.register(), g.companion.register(e)(
834
831
  Ye.type,
835
832
  Nt
@@ -891,7 +888,7 @@ const Lt = new _({
891
888
  ...Oe
892
889
  };
893
890
  h.freestyle = {
894
- models: Ht(h)
891
+ models: Ut(h)
895
892
  };
896
893
  h.preload = g.model.preloadModel(h);
897
894
  h.model = g.model.register(h);
@@ -901,10 +898,10 @@ const qt = h;
901
898
  export {
902
899
  Ft as A,
903
900
  se as C,
904
- U as F,
901
+ H as F,
905
902
  M as I,
906
903
  qt as K,
907
- ft as N,
904
+ yt as N,
908
905
  V as a,
909
906
  w as b,
910
907
  de as c,
@@ -914,10 +911,10 @@ export {
914
911
  Pe as g,
915
912
  Lt as h,
916
913
  J as i,
917
- yt as j,
914
+ ft as j,
918
915
  vt as k,
919
916
  Kt as l,
920
917
  ot as m,
921
- Ht as r
918
+ Ut as r
922
919
  };
923
- //# sourceMappingURL=freestyle-registration-manager-NQwdiplh.js.map
920
+ //# sourceMappingURL=freestyle-registration-manager-CBMdfM3_.js.map