laymur 0.8.1 → 0.9.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sources":["../src/miscellaneous/UIExpression.ts","../node_modules/eventail/dist/index.min.js","../src/miscellaneous/UIMode.ts","../src/miscellaneous/UIOrientation.ts","../node_modules/@lume/kiwi/dist/maptype.js","../node_modules/@lume/kiwi/dist/variable.js","../node_modules/@lume/kiwi/dist/expression.js","../node_modules/@lume/kiwi/dist/strength.js","../node_modules/@lume/kiwi/dist/constraint.js","../node_modules/@lume/kiwi/dist/solver.js","../src/miscellaneous/UIPriority.ts","../src/miscellaneous/UIColor.ts","../src/miscellaneous/UITransparencyMode.ts","../src/wrappers/UISceneWrapper.ts","../src/miscellaneous/UIRelation.ts","../src/wrappers/UISolverWrapper.ts","../src/layers/UILayer.ts","../src/constraints/UIConstraint.ts","../src/constraints/UISingleParameterConstraint.ts","../src/constraints/UIHeightConstraint.ts","../src/miscellaneous/asserts.ts","../src/constraints/UIHorizontalDistanceConstraint.ts","../src/constraints/UIHorizontalProportionConstraint.ts","../src/constraints/UIVerticalDistanceConstraint.ts","../src/constraints/UIVerticalProportionConstraint.ts","../src/constraints/UIWidthConstraint.ts","../src/builders/UIConstraint2DBuilder.ts","../src/constraints/UIAspectConstraint.ts","../src/builders/UICoverConstraintBuilder.ts","../src/builders/UIFitConstraintBuilder.ts","../src/constraints/UICustomConstraint.ts","../src/elements/UIAnchor.ts","../src/miscellaneous/UIInputEvent.ts","../src/miscellaneous/UIMicroAnchorMode.ts","../src/miscellaneous/UIMicro.ts","../src/elements/UIElement.ts","../src/elements/UIAnimatedImage.ts","../src/elements/UIDummy.ts","../src/elements/UIGraphics.ts","../src/elements/UIImage.ts","../src/miscellaneous/UINineSliceBorder.ts","../src/elements/UINineSline.ts","../src/elements/UIProgress.ts","../src/elements/UIScene.ts","../src/miscellaneous/UITextStyle.ts","../src/miscellaneous/textTools.ts","../src/miscellaneous/UITextPadding.ts","../src/elements/UIText.ts","../src/miscellaneous/UIResizePolicy.ts","../src/miscellaneous/UIResizePolicyNone.ts","../src/layers/UIFullscreenLayer.ts","../src/miscellaneous/UIGenericInstancedPlane.ts","../src/miscellaneous/UIResizePolicyCross.ts","../src/miscellaneous/UIResizePolicyCrossInverted.ts","../src/miscellaneous/UIResizePolicyFixedHeight.ts","../src/miscellaneous/UIResizePolicyFixedWidth.ts","../src/miscellaneous/UITextSpan.ts"],"sourcesContent":["/**\n * Mathematical expression builder for constraint equations in the UI layout system.\n *\n * UIExpression represents linear mathematical expressions of the form:\n * constant + coefficient₁ × variable₁ + coefficient₂ × variable₂ + ... + coefficientₙ × variableₙ\n *\n * These expressions are used to build constraint equations for the Kiwi solver,\n * enabling complex mathematical relationships between UI element properties.\n * Variables are referenced by their numeric descriptors from the solver system.\n *\n * @see {@link UIConstraint} - Constraints that use expressions\n * @see {@link UISolverWrapper} - Solver integration that creates variables\n */\nexport class UIExpression {\n /** The constant term of the expression. */\n public constant: number;\n /** Map of variable descriptors to their coefficients in the expression. */\n private readonly terms: Map<number, number>;\n\n /**\n * Creates a new UIExpression instance.\n *\n * @param constant - The constant term of the expression (defaults to 0)\n * @param terms - Optional array of [variableDescriptor, coefficient] pairs\n */\n constructor(constant = 0, terms?: [number, number][]) {\n this.constant = constant;\n this.terms = terms ? new Map(terms) : new Map();\n }\n\n /**\n * Creates a new expression that represents the sum of two expressions.\n *\n * Performs mathematical addition: (a.constant + a.terms) + (b.constant + b.terms)\n * Coefficients for the same variables are combined.\n *\n * @param a - The first expression\n * @param b - The second expression\n * @returns A new expression representing a + b\n */\n public static plus(a: UIExpression, b: UIExpression): UIExpression {\n const result = new UIExpression(\n a.constant + b.constant,\n Array.from(a.terms.entries()),\n );\n for (const [variableIndex, coefficient] of b.terms) {\n result.plus(variableIndex, coefficient);\n }\n return result;\n }\n\n /**\n * Creates a new expression that represents the difference of two expressions.\n *\n * Performs mathematical subtraction: (a.constant + a.terms) - (b.constant + b.terms)\n * Coefficients for the same variables are combined with subtraction.\n *\n * @param a - The first expression (minuend)\n * @param b - The second expression (subtrahend)\n * @returns A new expression representing a - b\n */\n public static minus(a: UIExpression, b: UIExpression): UIExpression {\n const result = new UIExpression(\n a.constant - b.constant,\n Array.from(a.terms.entries()),\n );\n for (const [variableIndex, coefficient] of b.terms) {\n result.minus(variableIndex, coefficient);\n }\n return result;\n }\n\n /**\n * Adds a variable term to this expression (mutating operation).\n *\n * If the variable already exists in the expression, its coefficient is\n * increased by the specified amount. Otherwise, a new term is added.\n *\n * @param variableIndex - The variable descriptor from the solver\n * @param coefficient - The coefficient to add for this variable\n * @returns This expression instance for method chaining\n */\n public plus(variableIndex: number, coefficient: number): this {\n this.terms.set(\n variableIndex,\n (this.terms.get(variableIndex) ?? 0) + coefficient,\n );\n return this;\n }\n\n /**\n * Subtracts a variable term from this expression (mutating operation).\n *\n * If the variable already exists in the expression, its coefficient is\n * decreased by the specified amount. Otherwise, a new term with negative\n * coefficient is added.\n *\n * @param variableIndex - The variable descriptor from the solver\n * @param coefficient - The coefficient to subtract for this variable\n * @returns This expression instance for method chaining\n */\n public minus(variableIndex: number, coefficient: number): this {\n return this.plus(variableIndex, -coefficient);\n }\n\n /**\n * Multiplies all terms in this expression by a scalar value (mutating operation).\n *\n * Both the constant term and all variable coefficients are multiplied\n * by the specified value.\n *\n * @param value - The scalar value to multiply by\n * @returns This expression instance for method chaining\n */\n public multiply(value: number): this {\n this.constant *= value;\n for (const [variableIndex, coefficient] of this.terms) {\n this.terms.set(variableIndex, coefficient * value);\n }\n return this;\n }\n\n /**\n * Divides all terms in this expression by a scalar value (mutating operation).\n *\n * Both the constant term and all variable coefficients are divided\n * by the specified value.\n *\n * @param value - The scalar value to divide by (must not be zero)\n * @returns This expression instance for method chaining\n */\n public divide(value: number): this {\n return this.multiply(1 / value);\n }\n\n /**\n * Checks if the expression contains a term for the specified variable.\n *\n * @param variableIndex - The variable descriptor to check for\n * @returns True if the expression has a term for this variable, false otherwise\n */\n public hasTerm(variableIndex: number): boolean {\n return this.terms.has(variableIndex);\n }\n\n /**\n * Copies the content of another expression into this expression (mutating operation).\n *\n * Replaces all terms and the constant of this expression with those\n * from the source expression.\n *\n * @param expression - The source expression to copy from\n * @returns This expression instance for method chaining\n */\n public copy(expression: UIExpression): this {\n this.constant = expression.constant;\n this.terms.clear();\n for (const [variableIndex, coefficient] of expression.terms) {\n this.terms.set(variableIndex, coefficient);\n }\n return this;\n }\n\n /**\n * Creates a deep copy of this expression.\n *\n * The returned expression is completely independent and can be modified\n * without affecting the original.\n *\n * @returns A new UIExpression instance with the same content\n */\n public clone(): UIExpression {\n return new UIExpression(this.constant, Array.from(this.terms.entries()));\n }\n\n /**\n * Prepares the variable terms for internal solver operations.\n *\n * Converts the internal terms map to an array format suitable for\n * integration with the constraint solver system.\n *\n * @returns Array of [variableDescriptor, coefficient] pairs\n * @internal\n */\n protected [\"prepareTermsInternal\"](): [number, number][] {\n return Array.from(this.terms.entries());\n }\n}\n","class t{constructor(t,i,r=0){this.t=new WeakMap,this.i=new Map,void 0!==t&&(void 0===i?this.i.set(t,r):this.t.set(i,new Map([[t,r]])))}insert(t,i,r=0){if(void 0===i){if(this.i.has(t))return;return void this.i.set(t,r)}const s=this.t.get(i);void 0===s?this.t.set(i,new Map([[t,r]])):s.has(t)||s.set(t,r)}remove(t,i){if(void 0===i)return void this.i.delete(t);const r=this.t.get(i);void 0!==r&&(r.delete(t),0===r.size&&this.t.delete(i))}has(t,i){if(void 0===i)return this.i.has(t);const r=this.t.get(i);return void 0!==r&&r.has(t)}getPriority(t,i){if(void 0===i)return this.i.get(t);const r=this.t.get(i);return void 0!==r?r.get(t):void 0}}class i{constructor(){this.o=new Map}on(t,i,r,s=0){return this.h(t,!1,s,i,r),this}once(t,i,r,s=0){return this.h(t,!0,s,i,r),this}off(t,i,r){const s=this.o.get(t);if(void 0===s)return this;s.u&&(s.u=!1,s.v=s.v.slice());const o=s.v;if(0===o.length)return this.o.delete(t),this;if(void 0===i){this.o.delete(t);for(let t=0;t<o.length;t++){const i=o[t];s.l.remove(i._,i.p)}return this}{const e=o.length;if(o[0]._===i&&o[0].p===r)return 1===e?this.o.delete(t):o.shift(),this;const n=e-1;if(o[n]._===i&&o[n].p===r)return o.pop(),this;if(e<10||o[0].M===o[n].M)for(let t=1;t<n;t++){const s=o[t];if(s._===i&&s.p===r)return o.splice(t,1),this}else{const t=s.l.getPriority(i,r);if(void 0===t)return this;let e=0,n=o.length-1;for(;e<=n;){const i=e+n>>>1;o[i].M<t?e=i+1:n=i-1}const c=e;for(n=o.length-1;e<=n;){const i=e+n>>>1;o[i].M<=t?e=i+1:n=i-1}const h=n;for(let t=c;t<=h;t++)if(o[t]._===i&&o[t].p===r)return o.splice(t,1),this}}return this}emit(t,...i){const r=this.o.get(t);if(void 0===r)return!1;if(0===r.v.length)return!1;r.u?r.v=r.v.slice():r.u=!0;const s=r.v;let o=!1;for(let t=0;t<s.length;t++){const r=s[t];r._.apply(r.p,i),r.k&&(o=!0,r.m=!0)}const e=this.o.get(t);if(void 0===e)return!0;e.v===s&&(e.u=!1);const n=e.v;if(o){let i=0;for(let t=0;t<n.length;t++){const r=n[t];r.m?e.l.remove(r._,r.p):n[i++]=r}0===i?this.o.delete(t):n.length=i}return!0}h(i,r,s,o,e){let n=this.o.get(i);if(void 0===n)return void this.o.set(i,{v:[{_:o,p:e,M:s,k:r,m:!1}],u:!1,l:new t(o,e,s)});if(n.l.has(o,e))throw Error(\"Event listener already exists\");n.l.insert(o,e,s);const c={_:o,p:e,M:s,k:r,m:!1};n.u&&(n.u=!1,n.v=n.v.slice());{const t=n.v,i=c.M;if(0===t.length||t[t.length-1].M<=i)return void t.push(c);if(t[0].M>=i)return void t.unshift(c);{let r=0,s=t.length;for(;r<s;){const o=r+s>>>1;t[o].M<i?r=o+1:s=o}t.splice(r,0,c)}}}}export{i as Eventail};\n//# sourceMappingURL=index.min.js.map\n","/**\n * Defines the visibility and interactivity state of UI elements.\n *\n * UI elements can be in one of three states:\n * - Hidden: Element is not visible and does not receive input\n * - Visible: Element is visible but does not receive input\n * - Interactive: Element is visible and can receive input events\n */\nexport enum UIMode {\n /**\n * Element is not rendered and does not receive input events.\n * Equivalent to setting `display: none` in CSS.\n */\n HIDDEN = 0,\n\n /**\n * Element is rendered but does not receive input events.\n * Equivalent to setting `pointer-events: none` in CSS.\n */\n VISIBLE = 1,\n\n /**\n * Element is rendered and can receive input events.\n * This is the fully active state for UI elements.\n */\n INTERACTIVE = 2,\n}\n","/**\n * Defines the screen orientation states for UI constraints.\n *\n * This enum is used to specify when certain UI constraints should be active\n * based on the current device/screen orientation.\n */\nexport enum UIOrientation {\n /**\n * Indicates a landscape orientation (width > height).\n * Constraints using this value will only be active in landscape mode.\n */\n HORIZONTAL = 0,\n\n /**\n * Indicates a portrait orientation (height > width).\n * Constraints using this value will only be active in portrait mode.\n */\n VERTICAL = 1,\n\n /**\n * Indicates that the constraint should always be active,\n * regardless of screen orientation.\n */\n ALWAYS = 2,\n}\n\n/**\n * Resolves an optional orientation to a definite value.\n *\n * @param orientation - The orientation to resolve, or undefined\n * @returns The provided orientation, or ALWAYS if none was provided\n */\nexport function resolveOrientation(orientation?: UIOrientation): UIOrientation {\n return orientation ?? UIOrientation.ALWAYS;\n}\n","export function createMap() {\n return new IndexedMap();\n}\nclass IndexedMap {\n index = {};\n array = [];\n /**\n * Returns the number of items in the array.\n */\n size() {\n return this.array.length;\n }\n /**\n * Returns true if the array is empty.\n */\n empty() {\n return this.array.length === 0;\n }\n /**\n * Returns the item at the given array index.\n *\n * @param index The integer index of the desired item.\n */\n itemAt(index) {\n return this.array[index];\n }\n /**\n * Returns true if the key is in the array, false otherwise.\n *\n * @param key The key to locate in the array.\n */\n contains(key) {\n return this.index[key.id()] !== undefined;\n }\n /**\n * Returns the pair associated with the given key, or undefined.\n *\n * @param key The key to locate in the array.\n */\n find(key) {\n const i = this.index[key.id()];\n return i === undefined ? undefined : this.array[i];\n }\n /**\n * Returns the pair associated with the key if it exists.\n *\n * If the key does not exist, a new pair will be created and\n * inserted using the value created by the given factory.\n *\n * @param key The key to locate in the array.\n * @param factory The function which creates the default value.\n */\n setDefault(key, factory) {\n const i = this.index[key.id()];\n if (i === undefined) {\n const pair = new Pair(key, factory());\n this.index[key.id()] = this.array.length;\n this.array.push(pair);\n return pair;\n }\n else {\n return this.array[i];\n }\n }\n /**\n * Insert the pair into the array and return the pair.\n *\n * This will overwrite any existing entry in the array.\n *\n * @param key The key portion of the pair.\n * @param value The value portion of the pair.\n */\n insert(key, value) {\n const pair = new Pair(key, value);\n const i = this.index[key.id()];\n if (i === undefined) {\n this.index[key.id()] = this.array.length;\n this.array.push(pair);\n }\n else {\n this.array[i] = pair;\n }\n return pair;\n }\n /**\n * Removes and returns the pair for the given key, or undefined.\n *\n * @param key The key to remove from the map.\n */\n erase(key) {\n const i = this.index[key.id()];\n if (i === undefined) {\n return undefined;\n }\n this.index[key.id()] = undefined;\n const pair = this.array[i];\n const last = this.array.pop();\n if (pair !== last) {\n this.array[i] = last;\n this.index[last.first.id()] = i;\n }\n return pair;\n }\n /**\n * Create a copy of this associative array.\n */\n copy() {\n const copy = new IndexedMap();\n for (let i = 0; i < this.array.length; i++) {\n const pair = this.array[i].copy();\n copy.array[i] = pair;\n copy.index[pair.first.id()] = i;\n }\n return copy;\n }\n}\n/**\n * A class which defines a generic pair object.\n * @private\n */\n// tslint:disable: max-classes-per-file\nclass Pair {\n first;\n second;\n /**\n * Construct a new Pair object.\n *\n * @param first The first item of the pair.\n * @param second The second item of the pair.\n */\n constructor(first, second) {\n this.first = first;\n this.second = second;\n }\n /**\n * Create a copy of the pair.\n */\n copy() {\n return new Pair(this.first, this.second);\n }\n}\n","import { Expression } from './expression.js';\n/**\n * The primary user constraint variable.\n *\n * @class\n * @param {String} [name=\"\"] The name to associated with the variable.\n */\nexport class Variable {\n constructor(name = '') {\n this._name = name;\n }\n /**\n * Returns the unique id number of the variable.\n * @private\n */\n id() {\n return this._id;\n }\n /**\n * Returns the name of the variable.\n *\n * @return {String} name of the variable\n */\n name() {\n return this._name;\n }\n /**\n * Set the name of the variable.\n *\n * @param {String} name Name of the variable\n */\n setName(name) {\n this._name = name;\n }\n /**\n * Returns the user context object of the variable.\n * @private\n */\n context() {\n return this._context;\n }\n /**\n * Set the user context object of the variable.\n * @private\n */\n setContext(context) {\n this._context = context;\n }\n /**\n * Returns the value of the variable.\n *\n * @return {Number} Calculated value\n */\n value() {\n return this._value;\n }\n /**\n * Set the value of the variable.\n * @private\n */\n setValue(value) {\n this._value = value;\n }\n /**\n * Creates a new Expression by adding a number, variable or expression\n * to the variable.\n *\n * @param {Number|Variable|Expression} value Value to add.\n * @return {Expression} expression\n */\n plus(value) {\n return new Expression(this, value);\n }\n /**\n * Creates a new Expression by substracting a number, variable or expression\n * from the variable.\n *\n * @param {Number|Variable|Expression} value Value to substract.\n * @return {Expression} expression\n */\n minus(value) {\n return new Expression(this, typeof value === 'number' ? -value : [-1, value]);\n }\n /**\n * Creates a new Expression by multiplying with a fixed number.\n *\n * @param {Number} coefficient Coefficient to multiply with.\n * @return {Expression} expression\n */\n multiply(coefficient) {\n return new Expression([coefficient, this]);\n }\n /**\n * Creates a new Expression by dividing with a fixed number.\n *\n * @param {Number} coefficient Coefficient to divide by.\n * @return {Expression} expression\n */\n divide(coefficient) {\n return new Expression([1 / coefficient, this]);\n }\n /**\n * Returns the JSON representation of the variable.\n * @private\n */\n toJSON() {\n return {\n name: this._name,\n value: this._value,\n };\n }\n toString() {\n return this._context + '[' + this._name + ':' + this._value + ']';\n }\n _name;\n _value = 0.0;\n _context = null;\n _id = VarId++;\n}\n/**\n * The internal variable id counter.\n * @private\n */\nlet VarId = 0;\n","import { createMap } from './maptype.js';\nimport { Variable } from './variable.js';\n/**\n * An expression of variable terms and a constant.\n *\n * The constructor accepts an arbitrary number of parameters,\n * each of which must be one of the following types:\n * - number\n * - Variable\n * - Expression\n * - 2-tuple of [number, Variable|Expression]\n *\n * The parameters are summed. The tuples are multiplied.\n *\n * @class\n * @param {...(number|Variable|Expression|Array)} args\n */\nexport class Expression {\n constructor() {\n let parsed = parseArgs(arguments);\n this._terms = parsed.terms;\n this._constant = parsed.constant;\n }\n /**\n * Returns the mapping of terms in the expression.\n *\n * This *must* be treated as const.\n * @private\n */\n terms() {\n return this._terms;\n }\n /**\n * Returns the constant of the expression.\n * @private\n */\n constant() {\n return this._constant;\n }\n /**\n * Returns the computed value of the expression.\n *\n * @private\n * @return {Number} computed value of the expression\n */\n value() {\n let result = this._constant;\n for (let i = 0, n = this._terms.size(); i < n; i++) {\n let pair = this._terms.itemAt(i);\n result += pair.first.value() * pair.second;\n }\n return result;\n }\n /**\n * Creates a new Expression by adding a number, variable or expression\n * to the expression.\n *\n * @param {Number|Variable|Expression} value Value to add.\n * @return {Expression} expression\n */\n plus(value) {\n return new Expression(this, value);\n }\n /**\n * Creates a new Expression by substracting a number, variable or expression\n * from the expression.\n *\n * @param {Number|Variable|Expression} value Value to substract.\n * @return {Expression} expression\n */\n minus(value) {\n return new Expression(this, typeof value === 'number' ? -value : [-1, value]);\n }\n /**\n * Creates a new Expression by multiplying with a fixed number.\n *\n * @param {Number} coefficient Coefficient to multiply with.\n * @return {Expression} expression\n */\n multiply(coefficient) {\n return new Expression([coefficient, this]);\n }\n /**\n * Creates a new Expression by dividing with a fixed number.\n *\n * @param {Number} coefficient Coefficient to divide by.\n * @return {Expression} expression\n */\n divide(coefficient) {\n return new Expression([1 / coefficient, this]);\n }\n isConstant() {\n return this._terms.size() == 0;\n }\n toString() {\n let result = this._terms.array\n .map(function (pair) {\n return pair.second + '*' + pair.first.toString();\n })\n .join(' + ');\n if (!this.isConstant() && this._constant !== 0) {\n result += ' + ';\n }\n result += this._constant;\n return result;\n }\n _terms;\n _constant;\n}\n/**\n * An internal argument parsing function.\n * @private\n */\nfunction parseArgs(args) {\n let constant = 0.0;\n let factory = () => 0.0;\n let terms = createMap();\n for (let i = 0, n = args.length; i < n; ++i) {\n let item = args[i];\n if (typeof item === 'number') {\n constant += item;\n }\n else if (item instanceof Variable) {\n terms.setDefault(item, factory).second += 1.0;\n }\n else if (item instanceof Expression) {\n constant += item.constant();\n let terms2 = item.terms();\n for (let j = 0, k = terms2.size(); j < k; j++) {\n let termPair = terms2.itemAt(j);\n terms.setDefault(termPair.first, factory).second += termPair.second;\n }\n }\n else if (item instanceof Array) {\n if (item.length !== 2) {\n throw new Error('array must have length 2');\n }\n let value = item[0];\n let value2 = item[1];\n if (typeof value !== 'number') {\n throw new Error('array item 0 must be a number');\n }\n if (value2 instanceof Variable) {\n terms.setDefault(value2, factory).second += value;\n }\n else if (value2 instanceof Expression) {\n constant += value2.constant() * value;\n let terms2 = value2.terms();\n for (let j = 0, k = terms2.size(); j < k; j++) {\n let termPair = terms2.itemAt(j);\n terms.setDefault(termPair.first, factory).second += termPair.second * value;\n }\n }\n else {\n throw new Error('array item 1 must be a variable or expression');\n }\n }\n else {\n throw new Error('invalid Expression argument: ' + item);\n }\n }\n return { terms, constant };\n}\n","/**\n * @class Strength\n */\nexport class Strength {\n /**\n * Create a new symbolic strength.\n *\n * @param a strong\n * @param b medium\n * @param c weak\n * @param [w] weight\n * @return strength\n */\n static create(a, b, c, w = 1.0) {\n let result = 0.0;\n result += Math.max(0.0, Math.min(1000.0, a * w)) * 1000000.0;\n result += Math.max(0.0, Math.min(1000.0, b * w)) * 1000.0;\n result += Math.max(0.0, Math.min(1000.0, c * w));\n return result;\n }\n /**\n * The 'required' symbolic strength.\n */\n static required = Strength.create(1000.0, 1000.0, 1000.0);\n /**\n * The 'strong' symbolic strength.\n */\n static strong = Strength.create(1.0, 0.0, 0.0);\n /**\n * The 'medium' symbolic strength.\n */\n static medium = Strength.create(0.0, 1.0, 0.0);\n /**\n * The 'weak' symbolic strength.\n */\n static weak = Strength.create(0.0, 0.0, 1.0);\n /**\n * Clip a symbolic strength to the allowed min and max.\n * @private\n */\n static clip(value) {\n return Math.max(0.0, Math.min(Strength.required, value));\n }\n}\n","import { Expression } from './expression.js';\nimport { Strength } from './strength.js';\n/**\n * An enum defining the linear constraint operators.\n *\n * |Value|Operator|Description|\n * |----|-----|-----|\n * |`Le`|<=|Less than equal|\n * |`Ge`|>=|Greater than equal|\n * |`Eq`|==|Equal|\n *\n * @enum {Number}\n */\nexport var Operator;\n(function (Operator) {\n Operator[Operator[\"Le\"] = 0] = \"Le\";\n Operator[Operator[\"Ge\"] = 1] = \"Ge\";\n Operator[Operator[\"Eq\"] = 2] = \"Eq\";\n})(Operator || (Operator = {}));\n/**\n * A linear constraint equation.\n *\n * A constraint equation is composed of an expression, an operator,\n * and a strength. The RHS of the equation is implicitly zero.\n *\n * @class\n * @param {Expression} expression The constraint expression (LHS).\n * @param {Operator} operator The equation operator.\n * @param {Expression} [rhs] Right hand side of the expression.\n * @param {Number} [strength=Strength.required] The strength of the constraint.\n */\nexport class Constraint {\n constructor(expression, operator, rhs, strength = Strength.required) {\n this._operator = operator;\n this._strength = Strength.clip(strength);\n if (rhs === undefined && expression instanceof Expression) {\n this._expression = expression;\n }\n else {\n this._expression = expression.minus(rhs);\n }\n }\n /**\n * Returns the unique id number of the constraint.\n * @private\n */\n id() {\n return this._id;\n }\n /**\n * Returns the expression of the constraint.\n *\n * @return {Expression} expression\n */\n expression() {\n return this._expression;\n }\n /**\n * Returns the relational operator of the constraint.\n *\n * @return {Operator} linear constraint operator\n */\n op() {\n return this._operator;\n }\n /**\n * Returns the strength of the constraint.\n *\n * @return {Number} strength\n */\n strength() {\n return this._strength;\n }\n toString() {\n return (this._expression.toString() + ' ' + ['<=', '>=', '='][this._operator] + ' 0 (' + this._strength.toString() + ')');\n }\n _expression;\n _operator;\n _strength;\n _id = CnId++;\n}\n/**\n * The internal constraint id counter.\n * @private\n */\nlet CnId = 0;\n","import { Constraint, Operator } from './constraint.js';\nimport { Expression } from './expression.js';\nimport { createMap } from './maptype.js';\nimport { Strength } from './strength.js';\n/**\n * The constraint solver class.\n *\n * @class\n */\nexport class Solver {\n /**\n * @type {number} - The max number of solver iterations before an error\n * is thrown, in order to prevent infinite iteration. Default: `10,000`.\n */\n maxIterations = 1000;\n /**\n * Construct a new Solver.\n */\n constructor() { }\n /**\n * Creates and add a constraint to the solver.\n *\n * @param {Expression|Variable} lhs Left hand side of the expression\n * @param {Operator} operator Operator\n * @param {Expression|Variable|Number} rhs Right hand side of the expression\n * @param {Number} [strength=Strength.required] Strength\n */\n createConstraint(lhs, operator, rhs, strength = Strength.required) {\n let cn = new Constraint(lhs, operator, rhs, strength);\n this.addConstraint(cn);\n return cn;\n }\n /**\n * Add a constraint to the solver.\n *\n * @param {Constraint} constraint Constraint to add to the solver\n */\n addConstraint(constraint) {\n let cnPair = this._cnMap.find(constraint);\n if (cnPair !== undefined) {\n throw new Error('duplicate constraint');\n }\n // Creating a row causes symbols to be reserved for the variables\n // in the constraint. If this method exits with an exception,\n // then its possible those variables will linger in the var map.\n // Since its likely that those variables will be used in other\n // constraints and since exceptional conditions are uncommon,\n // i'm not too worried about aggressive cleanup of the var map.\n let data = this._createRow(constraint);\n let row = data.row;\n let tag = data.tag;\n let subject = this._chooseSubject(row, tag);\n // If chooseSubject couldnt find a valid entering symbol, one\n // last option is available if the entire row is composed of\n // dummy variables. If the constant of the row is zero, then\n // this represents redundant constraints and the new dummy\n // marker can enter the basis. If the constant is non-zero,\n // then it represents an unsatisfiable constraint.\n if (subject.type() === SymbolType.Invalid && row.allDummies()) {\n if (!nearZero(row.constant())) {\n throw new Error('unsatisfiable constraint');\n }\n else {\n subject = tag.marker;\n }\n }\n // If an entering symbol still isn't found, then the row must\n // be added using an artificial variable. If that fails, then\n // the row represents an unsatisfiable constraint.\n if (subject.type() === SymbolType.Invalid) {\n if (!this._addWithArtificialVariable(row)) {\n throw new Error('unsatisfiable constraint');\n }\n }\n else {\n row.solveFor(subject);\n this._substitute(subject, row);\n this._rowMap.insert(subject, row);\n }\n this._cnMap.insert(constraint, tag);\n // Optimizing after each constraint is added performs less\n // aggregate work due to a smaller average system size. It\n // also ensures the solver remains in a consistent state.\n this._optimize(this._objective);\n }\n /**\n * Remove a constraint from the solver.\n *\n * @param {Constraint} constraint Constraint to remove from the solver\n */\n removeConstraint(constraint) {\n let cnPair = this._cnMap.erase(constraint);\n if (cnPair === undefined) {\n throw new Error('unknown constraint');\n }\n // Remove the error effects from the objective function\n // *before* pivoting, or substitutions into the objective\n // will lead to incorrect solver results.\n this._removeConstraintEffects(constraint, cnPair.second);\n // If the marker is basic, simply drop the row. Otherwise,\n // pivot the marker into the basis and then drop the row.\n let marker = cnPair.second.marker;\n let rowPair = this._rowMap.erase(marker);\n if (rowPair === undefined) {\n let leaving = this._getMarkerLeavingSymbol(marker);\n if (leaving.type() === SymbolType.Invalid) {\n throw new Error('failed to find leaving row');\n }\n rowPair = this._rowMap.erase(leaving);\n rowPair.second.solveForEx(leaving, marker);\n this._substitute(marker, rowPair.second);\n }\n // Optimizing after each constraint is removed ensures that the\n // solver remains consistent. It makes the solver api easier to\n // use at a small tradeoff for speed.\n this._optimize(this._objective);\n }\n /**\n * Test whether the solver contains the constraint.\n *\n * @param {Constraint} constraint Constraint to test for\n * @return {Bool} true or false\n */\n hasConstraint(constraint) {\n return this._cnMap.contains(constraint);\n }\n /**\n * Get an array of the current constraints.\n *\n * @return {Constraint[]}\n */\n getConstraints() {\n return this._cnMap.array.map(({ first }) => first);\n }\n /**\n * Add an edit variable to the solver.\n *\n * @param {Variable} variable Edit variable to add to the solver\n * @param {Number} strength Strength, should be less than `Strength.required`\n */\n addEditVariable(variable, strength) {\n let editPair = this._editMap.find(variable);\n if (editPair !== undefined) {\n throw new Error('duplicate edit variable');\n }\n strength = Strength.clip(strength);\n if (strength === Strength.required) {\n throw new Error('bad required strength');\n }\n let expr = new Expression(variable);\n let cn = new Constraint(expr, Operator.Eq, undefined, strength);\n this.addConstraint(cn);\n let tag = this._cnMap.find(cn).second;\n let info = { tag, constraint: cn, constant: 0.0 };\n this._editMap.insert(variable, info);\n }\n /**\n * Remove an edit variable from the solver.\n *\n * @param {Variable} variable Edit variable to remove from the solver\n */\n removeEditVariable(variable) {\n let editPair = this._editMap.erase(variable);\n if (editPair === undefined) {\n throw new Error('unknown edit variable');\n }\n this.removeConstraint(editPair.second.constraint);\n }\n /**\n * Test whether the solver contains the edit variable.\n *\n * @param {Variable} variable Edit variable to test for\n * @return {Bool} true or false\n */\n hasEditVariable(variable) {\n return this._editMap.contains(variable);\n }\n /**\n * Suggest the value of an edit variable.\n *\n * @param {Variable} variable Edit variable to suggest a value for\n * @param {Number} value Suggested value\n */\n suggestValue(variable, value) {\n let editPair = this._editMap.find(variable);\n if (editPair === undefined) {\n throw new Error('unknown edit variable');\n }\n let rows = this._rowMap;\n let info = editPair.second;\n let delta = value - info.constant;\n info.constant = value;\n // Check first if the positive error variable is basic.\n let marker = info.tag.marker;\n let rowPair = rows.find(marker);\n if (rowPair !== undefined) {\n if (rowPair.second.add(-delta) < 0.0) {\n this._infeasibleRows.push(marker);\n }\n this._dualOptimize();\n return;\n }\n // Check next if the negative error variable is basic.\n let other = info.tag.other;\n rowPair = rows.find(other);\n if (rowPair !== undefined) {\n if (rowPair.second.add(delta) < 0.0) {\n this._infeasibleRows.push(other);\n }\n this._dualOptimize();\n return;\n }\n // Otherwise update each row where the error variables exist.\n for (let i = 0, n = rows.size(); i < n; ++i) {\n let rowPair = rows.itemAt(i);\n let row = rowPair.second;\n let coeff = row.coefficientFor(marker);\n if (coeff !== 0.0 && row.add(delta * coeff) < 0.0 && rowPair.first.type() !== SymbolType.External) {\n this._infeasibleRows.push(rowPair.first);\n }\n }\n this._dualOptimize();\n }\n /**\n * Update the values of the variables.\n */\n updateVariables() {\n let vars = this._varMap;\n let rows = this._rowMap;\n for (let i = 0, n = vars.size(); i < n; ++i) {\n let pair = vars.itemAt(i);\n let rowPair = rows.find(pair.second);\n if (rowPair !== undefined) {\n pair.first.setValue(rowPair.second.constant());\n }\n else {\n pair.first.setValue(0.0);\n }\n }\n }\n /**\n * Get the symbol for the given variable.\n *\n * If a symbol does not exist for the variable, one will be created.\n * @private\n */\n _getVarSymbol(variable) {\n let factory = () => this._makeSymbol(SymbolType.External);\n return this._varMap.setDefault(variable, factory).second;\n }\n /**\n * Create a new Row object for the given constraint.\n *\n * The terms in the constraint will be converted to cells in the row.\n * Any term in the constraint with a coefficient of zero is ignored.\n * This method uses the `_getVarSymbol` method to get the symbol for\n * the variables added to the row. If the symbol for a given cell\n * variable is basic, the cell variable will be substituted with the\n * basic row.\n *\n * The necessary slack and error variables will be added to the row.\n * If the constant for the row is negative, the sign for the row\n * will be inverted so the constant becomes positive.\n *\n * Returns the created Row and the tag for tracking the constraint.\n * @private\n */\n _createRow(constraint) {\n let expr = constraint.expression();\n let row = new Row(expr.constant());\n // Substitute the current basic variables into the row.\n let terms = expr.terms();\n for (let i = 0, n = terms.size(); i < n; ++i) {\n let termPair = terms.itemAt(i);\n if (!nearZero(termPair.second)) {\n let symbol = this._getVarSymbol(termPair.first);\n let basicPair = this._rowMap.find(symbol);\n if (basicPair !== undefined) {\n row.insertRow(basicPair.second, termPair.second);\n }\n else {\n row.insertSymbol(symbol, termPair.second);\n }\n }\n }\n // Add the necessary slack, error, and dummy variables.\n let objective = this._objective;\n let strength = constraint.strength();\n let tag = { marker: INVALID_SYMBOL, other: INVALID_SYMBOL };\n switch (constraint.op()) {\n case Operator.Le:\n case Operator.Ge: {\n let coeff = constraint.op() === Operator.Le ? 1.0 : -1.0;\n let slack = this._makeSymbol(SymbolType.Slack);\n tag.marker = slack;\n row.insertSymbol(slack, coeff);\n if (strength < Strength.required) {\n let error = this._makeSymbol(SymbolType.Error);\n tag.other = error;\n row.insertSymbol(error, -coeff);\n objective.insertSymbol(error, strength);\n }\n break;\n }\n case Operator.Eq: {\n if (strength < Strength.required) {\n let errplus = this._makeSymbol(SymbolType.Error);\n let errminus = this._makeSymbol(SymbolType.Error);\n tag.marker = errplus;\n tag.other = errminus;\n row.insertSymbol(errplus, -1.0); // v = eplus - eminus\n row.insertSymbol(errminus, 1.0); // v - eplus + eminus = 0\n objective.insertSymbol(errplus, strength);\n objective.insertSymbol(errminus, strength);\n }\n else {\n let dummy = this._makeSymbol(SymbolType.Dummy);\n tag.marker = dummy;\n row.insertSymbol(dummy);\n }\n break;\n }\n }\n // Ensure the row has a positive constant.\n if (row.constant() < 0.0) {\n row.reverseSign();\n }\n return { row, tag };\n }\n /**\n * Choose the subject for solving for the row.\n *\n * This method will choose the best subject for using as the solve\n * target for the row. An invalid symbol will be returned if there\n * is no valid target.\n *\n * The symbols are chosen according to the following precedence:\n *\n * 1) The first symbol representing an external variable.\n * 2) A negative slack or error tag variable.\n *\n * If a subject cannot be found, an invalid symbol will be returned.\n *\n * @private\n */\n _chooseSubject(row, tag) {\n let cells = row.cells();\n for (let i = 0, n = cells.size(); i < n; ++i) {\n let pair = cells.itemAt(i);\n if (pair.first.type() === SymbolType.External) {\n return pair.first;\n }\n }\n let type = tag.marker.type();\n if (type === SymbolType.Slack || type === SymbolType.Error) {\n if (row.coefficientFor(tag.marker) < 0.0) {\n return tag.marker;\n }\n }\n type = tag.other.type();\n if (type === SymbolType.Slack || type === SymbolType.Error) {\n if (row.coefficientFor(tag.other) < 0.0) {\n return tag.other;\n }\n }\n return INVALID_SYMBOL;\n }\n /**\n * Add the row to the tableau using an artificial variable.\n *\n * This will return false if the constraint cannot be satisfied.\n *\n * @private\n */\n _addWithArtificialVariable(row) {\n // Create and add the artificial variable to the tableau.\n let art = this._makeSymbol(SymbolType.Slack);\n this._rowMap.insert(art, row.copy());\n this._artificial = row.copy();\n // Optimize the artificial objective. This is successful\n // only if the artificial objective is optimized to zero.\n this._optimize(this._artificial);\n let success = nearZero(this._artificial.constant());\n this._artificial = null;\n // If the artificial variable is basic, pivot the row so that\n // it becomes non-basic. If the row is constant, exit early.\n let pair = this._rowMap.erase(art);\n if (pair !== undefined) {\n let basicRow = pair.second;\n if (basicRow.isConstant()) {\n return success;\n }\n let entering = this._anyPivotableSymbol(basicRow);\n if (entering.type() === SymbolType.Invalid) {\n return false; // unsatisfiable (will this ever happen?)\n }\n basicRow.solveForEx(art, entering);\n this._substitute(entering, basicRow);\n this._rowMap.insert(entering, basicRow);\n }\n // Remove the artificial variable from the tableau.\n let rows = this._rowMap;\n for (let i = 0, n = rows.size(); i < n; ++i) {\n rows.itemAt(i).second.removeSymbol(art);\n }\n this._objective.removeSymbol(art);\n return success;\n }\n /**\n * Substitute the parametric symbol with the given row.\n *\n * This method will substitute all instances of the parametric symbol\n * in the tableau and the objective function with the given row.\n *\n * @private\n */\n _substitute(symbol, row) {\n let rows = this._rowMap;\n for (let i = 0, n = rows.size(); i < n; ++i) {\n let pair = rows.itemAt(i);\n pair.second.substitute(symbol, row);\n if (pair.second.constant() < 0.0 && pair.first.type() !== SymbolType.External) {\n this._infeasibleRows.push(pair.first);\n }\n }\n this._objective.substitute(symbol, row);\n if (this._artificial) {\n this._artificial.substitute(symbol, row);\n }\n }\n /**\n * Optimize the system for the given objective function.\n *\n * This method performs iterations of Phase 2 of the simplex method\n * until the objective function reaches a minimum.\n *\n * @private\n */\n _optimize(objective) {\n let iterations = 0;\n while (iterations < this.maxIterations) {\n let entering = this._getEnteringSymbol(objective);\n if (entering.type() === SymbolType.Invalid) {\n return;\n }\n let leaving = this._getLeavingSymbol(entering);\n if (leaving.type() === SymbolType.Invalid) {\n throw new Error('the objective is unbounded');\n }\n // pivot the entering symbol into the basis\n let row = this._rowMap.erase(leaving).second;\n row.solveForEx(leaving, entering);\n this._substitute(entering, row);\n this._rowMap.insert(entering, row);\n iterations++;\n }\n throw new Error('solver iterations exceeded');\n }\n /**\n * Optimize the system using the dual of the simplex method.\n *\n * The current state of the system should be such that the objective\n * function is optimal, but not feasible. This method will perform\n * an iteration of the dual simplex method to make the solution both\n * optimal and feasible.\n *\n * @private\n */\n _dualOptimize() {\n let rows = this._rowMap;\n let infeasible = this._infeasibleRows;\n while (infeasible.length !== 0) {\n let leaving = infeasible.pop();\n let pair = rows.find(leaving);\n if (pair !== undefined && pair.second.constant() < 0.0) {\n let entering = this._getDualEnteringSymbol(pair.second);\n if (entering.type() === SymbolType.Invalid) {\n throw new Error('dual optimize failed');\n }\n // pivot the entering symbol into the basis\n let row = pair.second;\n rows.erase(leaving);\n row.solveForEx(leaving, entering);\n this._substitute(entering, row);\n rows.insert(entering, row);\n }\n }\n }\n /**\n * Compute the entering variable for a pivot operation.\n *\n * This method will return first symbol in the objective function which\n * is non-dummy and has a coefficient less than zero. If no symbol meets\n * the criteria, it means the objective function is at a minimum, and an\n * invalid symbol is returned.\n *\n * @private\n */\n _getEnteringSymbol(objective) {\n let cells = objective.cells();\n for (let i = 0, n = cells.size(); i < n; ++i) {\n let pair = cells.itemAt(i);\n let symbol = pair.first;\n if (pair.second < 0.0 && symbol.type() !== SymbolType.Dummy) {\n return symbol;\n }\n }\n return INVALID_SYMBOL;\n }\n /**\n * Compute the entering symbol for the dual optimize operation.\n *\n * This method will return the symbol in the row which has a positive\n * coefficient and yields the minimum ratio for its respective symbol\n * in the objective function. The provided row *must* be infeasible.\n * If no symbol is found which meats the criteria, an invalid symbol\n * is returned.\n *\n * @private\n */\n _getDualEnteringSymbol(row) {\n let ratio = Number.MAX_VALUE;\n let entering = INVALID_SYMBOL;\n let cells = row.cells();\n for (let i = 0, n = cells.size(); i < n; ++i) {\n let pair = cells.itemAt(i);\n let symbol = pair.first;\n let c = pair.second;\n if (c > 0.0 && symbol.type() !== SymbolType.Dummy) {\n let coeff = this._objective.coefficientFor(symbol);\n let r = coeff / c;\n if (r < ratio) {\n ratio = r;\n entering = symbol;\n }\n }\n }\n return entering;\n }\n /**\n * Compute the symbol for pivot exit row.\n *\n * This method will return the symbol for the exit row in the row\n * map. If no appropriate exit symbol is found, an invalid symbol\n * will be returned. This indicates that the objective function is\n * unbounded.\n *\n * @private\n */\n _getLeavingSymbol(entering) {\n let ratio = Number.MAX_VALUE;\n let found = INVALID_SYMBOL;\n let rows = this._rowMap;\n for (let i = 0, n = rows.size(); i < n; ++i) {\n let pair = rows.itemAt(i);\n let symbol = pair.first;\n if (symbol.type() !== SymbolType.External) {\n let row = pair.second;\n let temp = row.coefficientFor(entering);\n if (temp < 0.0) {\n let temp_ratio = -row.constant() / temp;\n if (temp_ratio < ratio) {\n ratio = temp_ratio;\n found = symbol;\n }\n }\n }\n }\n return found;\n }\n /**\n * Compute the leaving symbol for a marker variable.\n *\n * This method will return a symbol corresponding to a basic row\n * which holds the given marker variable. The row will be chosen\n * according to the following precedence:\n *\n * 1) The row with a restricted basic varible and a negative coefficient\n * for the marker with the smallest ratio of -constant / coefficient.\n *\n * 2) The row with a restricted basic variable and the smallest ratio\n * of constant / coefficient.\n *\n * 3) The last unrestricted row which contains the marker.\n *\n * If the marker does not exist in any row, an invalid symbol will be\n * returned. This indicates an internal solver error since the marker\n * *should* exist somewhere in the tableau.\n *\n * @private\n */\n _getMarkerLeavingSymbol(marker) {\n let dmax = Number.MAX_VALUE;\n let r1 = dmax;\n let r2 = dmax;\n let invalid = INVALID_SYMBOL;\n let first = invalid;\n let second = invalid;\n let third = invalid;\n let rows = this._rowMap;\n for (let i = 0, n = rows.size(); i < n; ++i) {\n let pair = rows.itemAt(i);\n let row = pair.second;\n let c = row.coefficientFor(marker);\n if (c === 0.0) {\n continue;\n }\n let symbol = pair.first;\n if (symbol.type() === SymbolType.External) {\n third = symbol;\n }\n else if (c < 0.0) {\n let r = -row.constant() / c;\n if (r < r1) {\n r1 = r;\n first = symbol;\n }\n }\n else {\n let r = row.constant() / c;\n if (r < r2) {\n r2 = r;\n second = symbol;\n }\n }\n }\n if (first !== invalid) {\n return first;\n }\n if (second !== invalid) {\n return second;\n }\n return third;\n }\n /**\n * Remove the effects of a constraint on the objective function.\n *\n * @private\n */\n _removeConstraintEffects(cn, tag) {\n if (tag.marker.type() === SymbolType.Error) {\n this._removeMarkerEffects(tag.marker, cn.strength());\n }\n if (tag.other.type() === SymbolType.Error) {\n this._removeMarkerEffects(tag.other, cn.strength());\n }\n }\n /**\n * Remove the effects of an error marker on the objective function.\n *\n * @private\n */\n _removeMarkerEffects(marker, strength) {\n let pair = this._rowMap.find(marker);\n if (pair !== undefined) {\n this._objective.insertRow(pair.second, -strength);\n }\n else {\n this._objective.insertSymbol(marker, -strength);\n }\n }\n /**\n * Get the first Slack or Error symbol in the row.\n *\n * If no such symbol is present, an invalid symbol will be returned.\n *\n * @private\n */\n _anyPivotableSymbol(row) {\n let cells = row.cells();\n for (let i = 0, n = cells.size(); i < n; ++i) {\n let pair = cells.itemAt(i);\n let type = pair.first.type();\n if (type === SymbolType.Slack || type === SymbolType.Error) {\n return pair.first;\n }\n }\n return INVALID_SYMBOL;\n }\n /**\n * Returns a new Symbol of the given type.\n *\n * @private\n */\n _makeSymbol(type) {\n return new Symbol(type, this._idTick++);\n }\n _cnMap = createCnMap();\n _rowMap = createRowMap();\n _varMap = createVarMap();\n _editMap = createEditMap();\n _infeasibleRows = [];\n _objective = new Row();\n _artificial = null;\n _idTick = 0;\n}\n/**\n * Test whether a value is approximately zero.\n * @private\n */\nfunction nearZero(value) {\n let eps = 1.0e-8;\n return value < 0.0 ? -value < eps : value < eps;\n}\n/**\n * An internal function for creating a constraint map.\n * @private\n */\nfunction createCnMap() {\n return createMap();\n}\n/**\n * An internal function for creating a row map.\n * @private\n */\nfunction createRowMap() {\n return createMap();\n}\n/**\n * An internal function for creating a variable map.\n * @private\n */\nfunction createVarMap() {\n return createMap();\n}\n/**\n * An internal function for creating an edit map.\n * @private\n */\nfunction createEditMap() {\n return createMap();\n}\n/**\n * An enum defining the available symbol types.\n * @private\n */\nvar SymbolType;\n(function (SymbolType) {\n SymbolType[SymbolType[\"Invalid\"] = 0] = \"Invalid\";\n SymbolType[SymbolType[\"External\"] = 1] = \"External\";\n SymbolType[SymbolType[\"Slack\"] = 2] = \"Slack\";\n SymbolType[SymbolType[\"Error\"] = 3] = \"Error\";\n SymbolType[SymbolType[\"Dummy\"] = 4] = \"Dummy\";\n})(SymbolType || (SymbolType = {}));\n/**\n * An internal class representing a symbol in the solver.\n * @private\n */\nclass Symbol {\n /**\n * Construct a new Symbol\n *\n * @param [type] The type of the symbol.\n * @param [id] The unique id number of the symbol.\n */\n constructor(type, id) {\n this._id = id;\n this._type = type;\n }\n /**\n * Returns the unique id number of the symbol.\n */\n id() {\n return this._id;\n }\n /**\n * Returns the type of the symbol.\n */\n type() {\n return this._type;\n }\n _id;\n _type;\n}\n/**\n * A static invalid symbol\n * @private\n */\nlet INVALID_SYMBOL = new Symbol(SymbolType.Invalid, -1);\n/**\n * An internal row class used by the solver.\n * @private\n */\nclass Row {\n /**\n * Construct a new Row.\n */\n constructor(constant = 0.0) {\n this._constant = constant;\n }\n /**\n * Returns the mapping of symbols to coefficients.\n */\n cells() {\n return this._cellMap;\n }\n /**\n * Returns the constant for the row.\n */\n constant() {\n return this._constant;\n }\n /**\n * Returns true if the row is a constant value.\n */\n isConstant() {\n return this._cellMap.empty();\n }\n /**\n * Returns true if the Row has all dummy symbols.\n */\n allDummies() {\n let cells = this._cellMap;\n for (let i = 0, n = cells.size(); i < n; ++i) {\n let pair = cells.itemAt(i);\n if (pair.first.type() !== SymbolType.Dummy) {\n return false;\n }\n }\n return true;\n }\n /**\n * Create a copy of the row.\n */\n copy() {\n let theCopy = new Row(this._constant);\n theCopy._cellMap = this._cellMap.copy();\n return theCopy;\n }\n /**\n * Add a constant value to the row constant.\n *\n * Returns the new value of the constant.\n */\n add(value) {\n return (this._constant += value);\n }\n /**\n * Insert the symbol into the row with the given coefficient.\n *\n * If the symbol already exists in the row, the coefficient\n * will be added to the existing coefficient. If the resulting\n * coefficient is zero, the symbol will be removed from the row.\n */\n insertSymbol(symbol, coefficient = 1.0) {\n let pair = this._cellMap.setDefault(symbol, () => 0.0);\n if (nearZero((pair.second += coefficient))) {\n this._cellMap.erase(symbol);\n }\n }\n /**\n * Insert a row into this row with a given coefficient.\n *\n * The constant and the cells of the other row will be\n * multiplied by the coefficient and added to this row. Any\n * cell with a resulting coefficient of zero will be removed\n * from the row.\n */\n insertRow(other, coefficient = 1.0) {\n this._constant += other._constant * coefficient;\n let cells = other._cellMap;\n for (let i = 0, n = cells.size(); i < n; ++i) {\n let pair = cells.itemAt(i);\n this.insertSymbol(pair.first, pair.second * coefficient);\n }\n }\n /**\n * Remove a symbol from the row.\n */\n removeSymbol(symbol) {\n this._cellMap.erase(symbol);\n }\n /**\n * Reverse the sign of the constant and cells in the row.\n */\n reverseSign() {\n this._constant = -this._constant;\n let cells = this._cellMap;\n for (let i = 0, n = cells.size(); i < n; ++i) {\n let pair = cells.itemAt(i);\n pair.second = -pair.second;\n }\n }\n /**\n * Solve the row for the given symbol.\n *\n * This method assumes the row is of the form\n * a * x + b * y + c = 0 and (assuming solve for x) will modify\n * the row to represent the right hand side of\n * x = -b/a * y - c / a. The target symbol will be removed from\n * the row, and the constant and other cells will be multiplied\n * by the negative inverse of the target coefficient.\n *\n * The given symbol *must* exist in the row.\n */\n solveFor(symbol) {\n let cells = this._cellMap;\n let pair = cells.erase(symbol);\n let coeff = -1.0 / pair.second;\n this._constant *= coeff;\n for (let i = 0, n = cells.size(); i < n; ++i) {\n cells.itemAt(i).second *= coeff;\n }\n }\n /**\n * Solve the row for the given symbols.\n *\n * This method assumes the row is of the form\n * x = b * y + c and will solve the row such that\n * y = x / b - c / b. The rhs symbol will be removed from the\n * row, the lhs added, and the result divided by the negative\n * inverse of the rhs coefficient.\n *\n * The lhs symbol *must not* exist in the row, and the rhs\n * symbol must* exist in the row.\n */\n solveForEx(lhs, rhs) {\n this.insertSymbol(lhs, -1.0);\n this.solveFor(rhs);\n }\n /**\n * Returns the coefficient for the given symbol.\n */\n coefficientFor(symbol) {\n let pair = this._cellMap.find(symbol);\n return pair !== undefined ? pair.second : 0.0;\n }\n /**\n * Substitute a symbol with the data from another row.\n *\n * Given a row of the form a * x + b and a substitution of the\n * form x = 3 * y + c the row will be updated to reflect the\n * expression 3 * a * y + a * c + b.\n *\n * If the symbol does not exist in the row, this is a no-op.\n */\n substitute(symbol, row) {\n let pair = this._cellMap.erase(symbol);\n if (pair !== undefined) {\n this.insertRow(row, pair.second);\n }\n }\n _cellMap = createMap();\n _constant;\n}\n","import { Strength } from \"@lume/kiwi\";\n\n/** High priority value for constraint solver strength calculations. */\nconst HIGH_PRIORITY = 1000;\n/** Medium priority value for constraint solver strength calculations. */\nconst MEDIUM_PRIORITY = 100;\n/** Low priority value for constraint solver strength calculations. */\nconst LOW_PRIORITY = 10;\n\n/**\n * Priority levels for UI layout constraints and variables.\n *\n * UIPriority defines a hierarchical system of priority levels used by the\n * constraint solver to determine which constraints should take precedence\n * when conflicts arise. Lower numeric values represent higher priority,\n * with P0 being the highest priority and P7 being the lowest.\n *\n * The priority system maps to Kiwi solver strength values with different\n * strength components (required, strong, medium, weak) to create a nuanced\n * priority hierarchy for layout solving.\n *\n * @see {@link convertPriority} - Converts to Kiwi solver strength values\n */\nexport enum UIPriority {\n /** Highest priority - required constraints that must be satisfied. */\n P0 = 0,\n /** High priority - strong constraints with medium strength. */\n P1 = 1,\n /** Medium-high priority - strong constraints with low strength. */\n P2 = 2,\n /** Medium priority - medium strength constraints. */\n P3 = 3,\n /** Medium-low priority - medium strength constraints with low weight. */\n P4 = 4,\n /** Low priority - weak strength constraints with medium weight. */\n P5 = 5,\n /** Very low priority - weak strength constraints with low weight. */\n P6 = 6,\n /** Lowest priority - weak strength constraints with minimal weight. */\n P7 = 7,\n}\n\n/**\n * Converts UIPriority enum values to Kiwi solver strength values.\n *\n * This function maps the UI priority levels to the three-component strength\n * system used by the Kiwi constraint solver (required, strong, medium, weak).\n * Higher priority levels get stronger constraint strength values.\n *\n * @param priority - The UI priority level to convert\n * @returns The corresponding Kiwi solver strength value\n * @throws Will throw an error if an invalid priority is provided\n * @see {@link UIPriority} - Priority level definitions\n */\nexport function convertPriority(priority: UIPriority): number {\n switch (priority) {\n case UIPriority.P0:\n return Strength.create(HIGH_PRIORITY, HIGH_PRIORITY, HIGH_PRIORITY);\n case UIPriority.P1:\n return Strength.create(MEDIUM_PRIORITY, 0, 0);\n case UIPriority.P2:\n return Strength.create(LOW_PRIORITY, 0, 0);\n case UIPriority.P3:\n return Strength.create(0, MEDIUM_PRIORITY, 0);\n case UIPriority.P4:\n return Strength.create(0, LOW_PRIORITY, 0);\n case UIPriority.P5:\n return Strength.create(0, 0, MEDIUM_PRIORITY);\n case UIPriority.P6:\n return Strength.create(0, 0, LOW_PRIORITY);\n case UIPriority.P7:\n return Strength.create(0, 0, 1);\n default:\n throw new Error(`Invalid priority: ${priority}`);\n }\n}\n\n/**\n * Resolves an optional priority value to a concrete UIPriority.\n *\n * If no priority is provided, returns the default highest priority (P0).\n * This function is commonly used in constraint creation where priority\n * is an optional parameter.\n *\n * @param priority - The optional priority value to resolve\n * @returns The resolved priority, defaulting to P0 if undefined\n */\nexport function resolvePriority(priority?: UIPriority): UIPriority {\n return priority ?? UIPriority.P0;\n}\n","import { Eventail } from \"eventail\";\nimport type { Color } from \"three\";\n\nconst COLORS: Record<string, number | undefined> = {\n black: 0x000000,\n white: 0xffffff,\n red: 0xff0000,\n green: 0x008000,\n blue: 0x0000ff,\n yellow: 0xffff00,\n cyan: 0x00ffff,\n magenta: 0xff00ff,\n\n gray: 0x808080,\n grey: 0x808080,\n silver: 0xc0c0c0,\n maroon: 0x800000,\n olive: 0x808000,\n lime: 0x00ff00,\n aqua: 0x00ffff,\n teal: 0x008080,\n navy: 0x000080,\n fuchsia: 0xff00ff,\n purple: 0x800080,\n\n orange: 0xffa500,\n pink: 0xffc0cb,\n brown: 0xa52a2a,\n gold: 0xffd700,\n violet: 0xee82ee,\n indigo: 0x4b0082,\n coral: 0xff7f50,\n salmon: 0xfa8072,\n khaki: 0xf0e68c,\n plum: 0xdda0dd,\n orchid: 0xda70d6,\n tan: 0xd2b48c,\n beige: 0xf5f5dc,\n mint: 0x98fb98,\n lavender: 0xe6e6fa,\n crimson: 0xdc143c,\n azure: 0xf0ffff,\n ivory: 0xfffff0,\n snow: 0xfffafa,\n};\n\n/**\n * Predefined color names supported by UIColor.\n */\nexport type UIColorName =\n | \"black\"\n | \"white\"\n | \"red\"\n | \"green\"\n | \"blue\"\n | \"yellow\"\n | \"cyan\"\n | \"magenta\"\n | \"gray\"\n | \"grey\"\n | \"silver\"\n | \"maroon\"\n | \"olive\"\n | \"lime\"\n | \"aqua\"\n | \"teal\"\n | \"navy\"\n | \"fuchsia\"\n | \"purple\"\n | \"orange\"\n | \"pink\"\n | \"brown\"\n | \"gold\"\n | \"violet\"\n | \"indigo\"\n | \"coral\"\n | \"salmon\"\n | \"khaki\"\n | \"plum\"\n | \"orchid\"\n | \"tan\"\n | \"beige\"\n | \"mint\"\n | \"lavender\"\n | \"crimson\"\n | \"azure\"\n | \"ivory\"\n | \"snow\";\n\n/**\n * Events emitted by UIColor.\n */\nexport enum UIColorEvent {\n /** Emitted when color components change. */\n CHANGE = \"change\",\n}\n\n/**\n * Event-based RGBA color with support for RGB, HSL, hex, and named colors.\n * Color components are stored as normalized values (0-1).\n */\nexport class UIColor extends Eventail {\n private rInternal = 1;\n private gInternal = 1;\n private bInternal = 1;\n private aInternal = 1;\n\n constructor();\n /**\n * @param colorName - Named color\n * @param a - Alpha (0-1)\n */\n // eslint-disable-next-line @typescript-eslint/unified-signatures -- Separate overloads make the different constructor patterns more clear\n constructor(colorName: UIColorName, a?: number);\n /**\n * @param r - Red (0-1)\n * @param g - Green (0-1)\n * @param b - Blue (0-1)\n * @param a - Alpha (0-1)\n */\n // eslint-disable-next-line @typescript-eslint/unified-signatures -- Separate overloads make the different constructor patterns more clear\n constructor(r: number, g: number, b: number, a?: number);\n /**\n * @param hexRGB - Hex RGB value (e.g., 0xFF0000)\n * @param a - Alpha (0-1)\n */\n // eslint-disable-next-line @typescript-eslint/unified-signatures -- Separate overloads make the different constructor patterns more clear\n constructor(hexRGB: number, a?: number);\n constructor(...args: unknown[]) {\n super();\n\n if (args.length >= 3 && typeof args[0] === \"number\") {\n const [r, g, b, a = 1] = args as number[];\n this.rInternal = r;\n this.gInternal = g;\n this.bInternal = b;\n this.aInternal = a;\n } else if (args.length >= 1) {\n const [first, a = 1] = args;\n if (typeof first === \"string\") {\n this.setName(first as UIColorName, a as number);\n } else {\n this.setHexRGB(first as number, a as number);\n }\n }\n }\n\n /** Red component (0-1). */\n public get r(): number {\n return this.rInternal;\n }\n\n /** Green component (0-1). */\n public get g(): number {\n return this.gInternal;\n }\n\n /** Blue component (0-1). */\n public get b(): number {\n return this.bInternal;\n }\n\n /** Alpha component (0-1). */\n public get a(): number {\n return this.aInternal;\n }\n\n public set r(value: number) {\n if (value !== this.rInternal) {\n this.rInternal = value;\n this.emit(UIColorEvent.CHANGE, this);\n }\n }\n\n public set g(value: number) {\n if (value !== this.gInternal) {\n this.gInternal = value;\n this.emit(UIColorEvent.CHANGE, this);\n }\n }\n\n public set b(value: number) {\n if (value !== this.bInternal) {\n this.bInternal = value;\n this.emit(UIColorEvent.CHANGE, this);\n }\n }\n\n public set a(value: number) {\n if (value !== this.aInternal) {\n this.aInternal = value;\n this.emit(UIColorEvent.CHANGE, this);\n }\n }\n\n /**\n * Sets all color components.\n *\n * @param r - Red (0-1)\n * @param g - Green (0-1)\n * @param b - Blue (0-1)\n * @param a - Alpha (0-1)\n * @returns This instance\n */\n public set(\n r: number,\n g: number,\n b: number,\n a: number = this.aInternal,\n ): this {\n if (\n r !== this.rInternal ||\n g !== this.gInternal ||\n b !== this.bInternal ||\n a !== this.aInternal\n ) {\n this.rInternal = r;\n this.gInternal = g;\n this.bInternal = b;\n this.aInternal = a;\n this.emit(UIColorEvent.CHANGE, this);\n }\n return this;\n }\n\n /**\n * Returns 32-bit hex RGBA value (alpha in MSB).\n */\n public getHexRGBA(): number {\n return (\n (Math.round(this.rInternal * 255) << 24) |\n (Math.round(this.gInternal * 255) << 16) |\n (Math.round(this.bInternal * 255) << 8) |\n Math.round(this.aInternal * 255)\n );\n }\n\n /**\n * Returns 24-bit hex RGB value.\n */\n public getHexRGB(): number {\n return (\n (Math.round(this.rInternal * 255) << 16) |\n (Math.round(this.gInternal * 255) << 8) |\n Math.round(this.bInternal * 255)\n );\n }\n\n /**\n * Converts to HSL format.\n *\n * @returns Object with h (0-360), s (0-1), l (0-1)\n */\n public getHSL(): { h: number; s: number; l: number } {\n const { rInternal: r, gInternal: g, bInternal: b } = this;\n const max = Math.max(r, g, b);\n const min = Math.min(r, g, b);\n const d = max - min;\n const l = (max + min) / 2;\n\n let h = 0;\n if (d !== 0) {\n if (max === r) {\n h = (g - b) / d + (g < b ? 6 : 0);\n } else if (max === g) {\n h = (b - r) / d + 2;\n } else {\n h = (r - g) / d + 4;\n }\n h *= 60;\n }\n\n const s = d === 0 ? 0 : d / (1 - Math.abs(2 * l - 1));\n return { h, s, l };\n }\n\n /**\n * Sets color from 32-bit hex RGBA value.\n *\n * @param hex - Hex RGBA (alpha in MSB)\n * @returns This instance\n */\n public setHexRGBA(hex: number): this {\n const r = ((hex >> 16) & 0xff) / 255;\n const g = ((hex >> 8) & 0xff) / 255;\n const b = (hex & 0xff) / 255;\n const a = ((hex >> 24) & 0xff) / 255;\n if (\n r !== this.rInternal ||\n g !== this.gInternal ||\n b !== this.bInternal ||\n a !== this.aInternal\n ) {\n this.rInternal = r;\n this.gInternal = g;\n this.bInternal = b;\n this.aInternal = a;\n this.emit(UIColorEvent.CHANGE, this);\n }\n return this;\n }\n\n /**\n * Sets color from 24-bit hex RGB value.\n *\n * @param hex - Hex RGB (e.g., 0xFF0000)\n * @param a - Alpha (0-1)\n * @returns This instance\n */\n public setHexRGB(hex: number, a = this.aInternal): this {\n const r = ((hex >> 16) & 0xff) / 255;\n const g = ((hex >> 8) & 0xff) / 255;\n const b = (hex & 0xff) / 255;\n if (\n r !== this.rInternal ||\n g !== this.gInternal ||\n b !== this.bInternal ||\n a !== this.aInternal\n ) {\n this.rInternal = r;\n this.gInternal = g;\n this.bInternal = b;\n this.aInternal = a;\n this.emit(UIColorEvent.CHANGE, this);\n }\n return this;\n }\n\n /**\n * Sets color from HSL values.\n *\n * @param h - Hue (0-360)\n * @param s - Saturation (0-1)\n * @param l - Lightness (0-1)\n * @param a - Alpha (0-1)\n * @returns This instance\n */\n public setHSL(h: number, s: number, l: number, a = this.aInternal): this {\n const c = (1 - Math.abs(2 * l - 1)) * s;\n const hp = h / 60;\n const x = c * (1 - Math.abs((hp % 2) - 1));\n let [r, g, b] =\n hp < 1\n ? [c, x, 0]\n : hp < 2\n ? [x, c, 0]\n : hp < 3\n ? [0, c, x]\n : hp < 4\n ? [0, x, c]\n : hp < 5\n ? [x, 0, c]\n : [c, 0, x];\n\n const m = l - c / 2;\n return this.set(r + m, g + m, b + m, a);\n }\n\n /**\n * Sets color from predefined name.\n *\n * @param colorName - Color name\n * @param a - Alpha (0-1)\n * @returns This instance\n * @throws Error if color name is unknown\n */\n public setName(colorName: UIColorName, a = this.aInternal): this {\n const normalizedName = colorName.toLowerCase().trim();\n const hex = COLORS[normalizedName];\n\n if (hex === undefined) {\n throw new Error(`Unknown color name: \"${colorName}\".`);\n }\n\n return this.setHexRGB(hex, a);\n }\n\n /**\n * Returns CSS rgba() string.\n */\n public toCSSColor(): string {\n const r = Math.round(this.rInternal * 255);\n const g = Math.round(this.gInternal * 255);\n const b = Math.round(this.bInternal * 255);\n return `rgba(${r}, ${g}, ${b}, ${this.aInternal})`;\n }\n\n /**\n * Copies values from another color.\n *\n * @param color - UIColor or Three.js Color\n * @returns This instance\n */\n public copy(color: UIColor | Color): this {\n if (color instanceof UIColor) {\n if (\n this.rInternal !== color.rInternal ||\n this.gInternal !== color.gInternal ||\n this.bInternal !== color.bInternal ||\n this.aInternal !== color.aInternal\n ) {\n this.rInternal = color.rInternal;\n this.gInternal = color.gInternal;\n this.bInternal = color.bInternal;\n this.aInternal = color.aInternal;\n this.emit(UIColorEvent.CHANGE, this);\n }\n } else {\n if (\n this.rInternal !== color.r ||\n this.gInternal !== color.g ||\n this.bInternal !== color.b ||\n this.aInternal !== 1\n ) {\n this.rInternal = color.r;\n this.gInternal = color.g;\n this.bInternal = color.b;\n this.aInternal = 1;\n this.emit(UIColorEvent.CHANGE, this);\n }\n }\n\n return this;\n }\n\n /**\n * Creates a copy of this color.\n */\n public clone(): UIColor {\n return new UIColor(\n this.rInternal,\n this.gInternal,\n this.bInternal,\n this.aInternal,\n );\n }\n}\n","/**\n * Transparency rendering modes for UI elements.\n *\n * Controls how transparent and semi-transparent pixels are handled during rendering.\n * Each mode offers different performance and visual quality trade-offs.\n */\nexport enum UITransparencyMode {\n /**\n * Clip mode - pixels are either fully opaque or fully transparent.\n * Uses alpha testing to discard pixels below a threshold.\n * Best performance but no smooth transparency gradients.\n */\n CLIP = 0,\n\n /**\n * Hash mode - dithered transparency using screen-door transparency.\n * Creates transparency illusion through pixel patterns.\n * Good performance with better visual quality than CLIP.\n */\n HASH = 1,\n\n /**\n * Blend mode - true alpha blending with smooth transparency.\n * Supports full range of transparency values with smooth gradients.\n * Best visual quality but requires depth sorting and impacts performance.\n */\n BLEND = 2,\n}\n","import type { Object3D, WebGLRenderer } from \"three\";\nimport {\n Color,\n Matrix2,\n Matrix3,\n Matrix4,\n Mesh,\n OrthographicCamera,\n PlaneGeometry,\n Scene,\n ShaderMaterial,\n Texture,\n Vector2,\n Vector3,\n Vector4,\n} from \"three\";\nimport { UIColor } from \"../miscellaneous/UIColor\";\nimport type { UISceneWrapperClientAPI } from \"../miscellaneous/UISceneWrapperClientAPI\";\nimport { UITransparencyMode } from \"../miscellaneous/UITransparencyMode\";\nimport fragmentShader from \"../shaders/UIPlane.fs\";\nimport vertexShader from \"../shaders/UIPlane.vs\";\n\nconst DEFAULT_ALPHA_TEST = 0.25;\nconst COLOR = new Color();\n\n// eslint-disable-next-line @typescript-eslint/no-explicit-any -- Constructor type needs to accept any arguments for generic type mapping\ntype Constructor = new (...args: any[]) => any;\n\nconst UNIFROM_TYPE_MAP = new Map<Constructor, string>([\n [UIColor, \"vec4\"],\n [Color, \"vec3\"],\n [Texture, \"sampler2D\"],\n [Vector2, \"vec2\"],\n [Vector3, \"vec3\"],\n [Vector4, \"vec4\"],\n [Matrix2, \"mat2\"],\n [Matrix3, \"mat3\"],\n [Matrix4, \"mat4\"],\n]);\n\ntype UIPropertyType =\n | UIColor\n | Color\n | Texture\n | Vector2\n | Vector3\n | Vector4\n | Matrix2\n | Matrix3\n | Matrix4;\n\nfunction buildUniformDeclaraction(name: string, value: unknown): string {\n if (typeof value === \"number\") {\n return `uniform float ${name};`;\n }\n for (const [objectType, glslType] of UNIFROM_TYPE_MAP) {\n if (value instanceof objectType) {\n return `uniform ${glslType} ${name};`;\n }\n }\n throw new Error(`Unsupported uniform type for key \"${name}\"`);\n}\n\nconst Z_LIMIT = 1024;\nconst GEOMETRY_SIZE = 1;\nconst GEOMETRY_OFFSET = GEOMETRY_SIZE / 2;\n\nexport const geometry = new PlaneGeometry(\n GEOMETRY_SIZE,\n GEOMETRY_SIZE,\n).translate(GEOMETRY_OFFSET, GEOMETRY_OFFSET, 0);\n\nlet originalClearColor: Color = new Color();\nlet originalClearAlpha = 0;\nlet originalAutoClear = false;\nlet originalAutoClearColor = false;\nlet originalAutoClearDepth = false;\nlet originalAutoClearStencil = false;\n\ninterface Descriptor {\n plane: Mesh;\n material: ShaderMaterial;\n}\n\nexport class UISceneWrapper implements UISceneWrapperClientAPI {\n private readonly scene = new Scene();\n private readonly camera: OrthographicCamera;\n\n private readonly descriptors = new Map<number, Descriptor>();\n private lastPlaneIndex = 0;\n\n constructor(w: number, h: number) {\n this.camera = new OrthographicCamera(0, w, h, 0, -Z_LIMIT, Z_LIMIT);\n }\n\n public createPlane(\n source: string,\n uniforms: Record<string, UIPropertyType>,\n ): number {\n const entries = Object.entries(uniforms);\n const material = new ShaderMaterial({\n uniforms: {\n alphaTest: { value: DEFAULT_ALPHA_TEST },\n ...Object.fromEntries(\n entries.map(([k, v]) => [\n k,\n {\n value: v instanceof UIColor ? new Vector4(v.r, v.g, v.b, v.a) : v,\n },\n ]),\n ),\n },\n vertexShader,\n fragmentShader:\n fragmentShader +\n entries.map(([k, v]) => buildUniformDeclaraction(k, v)).join(\"\\n\") +\n source,\n transparent: false,\n alphaTest: DEFAULT_ALPHA_TEST,\n alphaHash: false,\n lights: false,\n fog: false,\n depthWrite: false,\n depthTest: true,\n });\n\n const plane = new Mesh(geometry, material);\n plane.frustumCulled = false;\n plane.matrixAutoUpdate = false;\n this.scene.add(plane);\n\n const index = this.lastPlaneIndex++;\n this.descriptors.set(index, { plane, material });\n\n return index;\n }\n\n public destroyPlane(handler: number): this {\n const descriptor = this.resolveDescriptor(handler);\n this.scene.remove(descriptor.plane);\n this.descriptors.delete(handler);\n return this;\n }\n\n public setTransform(handler: number, value: Matrix4): this {\n const descriptor = this.resolveDescriptor(handler);\n descriptor.plane.matrix.copy(value);\n descriptor.plane.matrixWorldNeedsUpdate = true;\n return this;\n }\n\n public setUniform(\n handler: number,\n uniform: string,\n value: UIPropertyType,\n ): this {\n const descriptor = this.resolveDescriptor(handler);\n if (!(uniform in descriptor.material.uniforms)) {\n throw new Error(`Uniform ${uniform} not found in material`);\n }\n if (value instanceof UIColor) {\n const linear = COLOR.set(value.r, value.g, value.b);\n linear.convertSRGBToLinear();\n\n descriptor.material.uniforms[uniform].value.set(\n linear.r,\n linear.g,\n linear.b,\n value.a,\n );\n } else {\n descriptor.material.uniforms[uniform].value = value;\n }\n return this;\n }\n\n public setTransparency(handler: number, mode: UITransparencyMode): this {\n const descriptor = this.resolveDescriptor(handler);\n if (mode === UITransparencyMode.BLEND) {\n descriptor.material.transparent = true;\n descriptor.material.alphaTest = 0;\n descriptor.material.uniforms[\"alphaTest\"].value = 0;\n descriptor.material.alphaHash = false;\n } else if (mode === UITransparencyMode.CLIP) {\n descriptor.material.transparent = false;\n descriptor.material.alphaTest = DEFAULT_ALPHA_TEST;\n descriptor.material.uniforms[\"alphaTest\"].value = DEFAULT_ALPHA_TEST;\n descriptor.material.alphaHash = false;\n } else {\n descriptor.material.transparent = false;\n descriptor.material.alphaTest = 0;\n descriptor.material.uniforms[\"alphaTest\"].value = 0;\n descriptor.material.alphaHash = true;\n }\n descriptor.material.uniformsNeedUpdate = true;\n descriptor.material.needsUpdate = true;\n return this;\n }\n\n public setVisibility(handler: number, visible: boolean): this {\n const descriptor = this.resolveDescriptor(handler);\n descriptor.plane.visible = visible;\n return this;\n }\n\n public insertCustomObject(object: Object3D): this {\n this.scene.add(object);\n return this;\n }\n\n public removeCustomObject(object: Object3D): this {\n this.scene.remove(object);\n return this;\n }\n\n public resize(width: number, height: number): this {\n this.camera.right = width;\n this.camera.top = height;\n this.camera.updateProjectionMatrix();\n return this;\n }\n\n public render(renderer: WebGLRenderer): this {\n originalClearColor = renderer.getClearColor(originalClearColor);\n originalClearAlpha = renderer.getClearAlpha();\n originalAutoClear = renderer.autoClear;\n originalAutoClearColor = renderer.autoClearColor;\n originalAutoClearDepth = renderer.autoClearDepth;\n originalAutoClearStencil = renderer.autoClearStencil;\n\n renderer.autoClear = false;\n renderer.autoClearColor = false;\n renderer.autoClearDepth = false;\n renderer.autoClearStencil = false;\n renderer.setClearColor(0x000000, 1);\n\n renderer.clear(false, true, true);\n renderer.render(this.scene, this.camera);\n\n renderer.setClearColor(originalClearColor);\n renderer.setClearAlpha(originalClearAlpha);\n renderer.autoClear = originalAutoClear;\n renderer.autoClearColor = originalAutoClearColor;\n renderer.autoClearDepth = originalAutoClearDepth;\n renderer.autoClearStencil = originalAutoClearStencil;\n return this;\n }\n\n private resolveDescriptor(handler: number): Descriptor {\n const descriptor = this.descriptors.get(handler);\n if (!descriptor) {\n throw new Error(`No descriptor found for handler ${handler}`);\n }\n return descriptor;\n }\n}\n","import { Operator } from \"@lume/kiwi\";\n\n/**\n * Relational operators for UI layout constraints.\n *\n * UIRelation defines the mathematical relationship between the left-hand\n * and right-hand sides of constraint equations. These relations are used\n * by the constraint solver to determine how expressions should be compared\n * when solving layout constraints.\n *\n * @see {@link convertRelation} - Converts to Kiwi solver operators\n */\nexport enum UIRelation {\n /** Equality relation: left-hand side equals right-hand side. */\n EQUAL = 0,\n /** Less than or equal relation: left-hand side ≤ right-hand side. */\n LESS_THAN = 1,\n /** Greater than or equal relation: left-hand side ≥ right-hand side. */\n GREATER_THAN = 2,\n}\n\n/**\n * Converts UIRelation enum values to Kiwi solver operator values.\n *\n * This function maps the UI relation types to the corresponding operators\n * used by the Kiwi constraint solver for mathematical comparisons in\n * constraint equations.\n *\n * @param relation - The UI relation type to convert\n * @returns The corresponding Kiwi solver operator\n * @throws Will throw an error if an invalid relation is provided\n * @see {@link UIRelation} - Relation type definitions\n */\nexport function convertRelation(relation: UIRelation): Operator {\n switch (relation) {\n case UIRelation.EQUAL:\n return Operator.Eq;\n case UIRelation.LESS_THAN:\n return Operator.Le;\n case UIRelation.GREATER_THAN:\n return Operator.Ge;\n default:\n throw new Error(`Invalid relation: ${relation}`);\n }\n}\n\n/**\n * Resolves an optional relation value to a concrete UIRelation.\n *\n * If no relation is provided, returns the default equality relation.\n * This function is commonly used in constraint creation where relation\n * is an optional parameter.\n *\n * @param relation - The optional relation value to resolve\n * @returns The resolved relation, defaulting to EQUAL if undefined\n */\nexport function resolveRelation(relation?: UIRelation): UIRelation {\n return relation ?? UIRelation.EQUAL;\n}\n","import { Constraint, Expression, Solver, Variable } from \"@lume/kiwi\";\nimport { UIExpression } from \"../miscellaneous/UIExpression\";\nimport { convertPriority, UIPriority } from \"../miscellaneous/UIPriority\";\nimport { convertRelation, UIRelation } from \"../miscellaneous/UIRelation\";\n\n/**\n * Internal description of a solver variable with its associated properties.\n */\ninterface VariableDescription {\n /** The underlying Kiwi variable instance. */\n variable: Variable;\n /** Priority level for constraint solving. */\n priority: UIPriority;\n /** Current suggested value for the variable. */\n value: number;\n /** Optional constraint for P0 priority variables (required variables). */\n constraint?: Constraint;\n}\n\n/**\n * Internal description of a solver constraint with its configuration.\n */\ninterface ConstraintDescription {\n /** The underlying Kiwi constraint instance. */\n constraint: Constraint;\n /** Left-hand side expression of the constraint. */\n lhs: UIExpression;\n /** Right-hand side expression of the constraint. */\n rhs: UIExpression;\n /** Priority level for constraint solving. */\n priority: UIPriority;\n /** Relational operator (equal, less than, greater than). */\n relation: UIRelation;\n /** Whether the constraint is currently active. */\n enabled: boolean;\n}\n\n/**\n * Wrapper around the Kiwi constraint solver providing enhanced UI-specific functionality.\n *\n * UISolverWrapper abstracts the Kiwi (Cassowary) constraint solver to provide a more\n * UI-friendly interface with additional features like dynamic constraint modification,\n * required variables (P0 priority), partial constraint updates, and automatic solver\n * recovery. It manages variables and constraints through index-based references,\n * allowing for easy tracking and modification of layout constraints.\n *\n * Key features:\n * - Index-based variable and constraint management\n * - Required variables with P0 priority (always satisfied)\n * - Dynamic constraint modification without full rebuilds\n * - Automatic solver recovery on constraint conflicts\n * - Lazy evaluation with recalculation flags\n *\n * @see {@link UIExpression} - Expression system for constraint definitions\n * @see {@link UIPriority} - Priority levels for variables and constraints\n * @see {@link UIRelation} - Relational operators for constraints\n */\nexport class UISolverWrapper {\n /** The underlying Kiwi solver instance, undefined when solver needs rebuilding. */\n private solver? = new Solver();\n /** Flag indicating whether variable values need recalculation. */\n private recalculationRequired = false;\n\n /** Map of variable indices to their descriptions. */\n private readonly variables = new Map<number, VariableDescription>();\n /** Counter for generating unique variable indices. */\n private lastVariableIndex = 0;\n\n /** Map of constraint indices to their descriptions. */\n private readonly constraints = new Map<number, ConstraintDescription>();\n /** Counter for generating unique constraint indices. */\n private lastConstraintIndex = 0;\n\n /**\n * Creates a new solver variable with the specified value and priority.\n *\n * Variables with P0 priority are treated as required (must be satisfied exactly)\n * and are implemented using equality constraints. Other priorities use edit\n * variables that can be adjusted by the solver.\n *\n * @param value - Initial value for the variable\n * @param priority - Priority level for constraint solving\n * @returns Unique index identifier for the created variable\n */\n public createVariable(value: number, priority: UIPriority): number {\n const index = this.lastVariableIndex++;\n const variable = new Variable();\n\n if (priority === UIPriority.P0) {\n const description: VariableDescription = { variable, priority, value };\n this.variables.set(index, description);\n\n description.constraint = this.buildConstraint(\n new UIExpression(0, [[index, 1]]),\n new UIExpression(value),\n UIRelation.EQUAL,\n priority,\n );\n try {\n this.solver?.addConstraint(description.constraint);\n } catch {\n this.solver = undefined;\n }\n } else {\n this.variables.set(index, { variable, priority, value });\n\n try {\n this.solver?.addEditVariable(variable, convertPriority(priority));\n this.solver?.suggestValue(variable, value);\n } catch {\n this.solver = undefined;\n }\n }\n\n this.recalculationRequired = true;\n return index;\n }\n\n /**\n * Removes a variable from the solver system.\n *\n * The variable must not be referenced by any existing constraints.\n * Cleans up both the variable itself and any associated required constraint.\n *\n * @param index - Index of the variable to remove\n * @throws Will throw an error if the variable doesn't exist or is still in use\n */\n public removeVariable(index: number): void {\n const description = this.variables.get(index);\n if (description === undefined) {\n throw new Error(`Variable ${index} does not exist`);\n }\n\n for (const cDescription of this.constraints.values()) {\n if (cDescription.lhs.hasTerm(index) || cDescription.rhs.hasTerm(index)) {\n throw new Error(`Variable ${index} is used in constraint`);\n }\n }\n\n try {\n description.constraint\n ? this.solver?.removeConstraint(description.constraint)\n : this.solver?.removeEditVariable(description.variable);\n } catch {\n this.solver = undefined;\n }\n\n this.variables.delete(index);\n this.recalculationRequired = true;\n }\n\n /**\n * Suggests a new value for an existing variable.\n *\n * For P0 priority variables, rebuilds the associated constraint.\n * For other priorities, suggests the value to the solver's edit system.\n * Only triggers updates if the value actually changes.\n *\n * @param index - Index of the variable to update\n * @param value - New suggested value\n * @throws Will throw an error if the variable doesn't exist\n */\n public suggestVariableValue(index: number, value: number): void {\n const description = this.variables.get(index);\n if (description === undefined) {\n throw new Error(`Variable ${index} does not exist`);\n }\n\n if (description.value !== value) {\n description.value = value;\n\n if (description.constraint) {\n description.constraint = this.rebuildConstraint(\n description.constraint,\n new UIExpression().plus(index, 1),\n new UIExpression(description.value),\n UIRelation.EQUAL,\n description.priority,\n );\n } else {\n this.solver?.suggestValue(description.variable, value);\n }\n\n this.recalculationRequired = true;\n }\n }\n\n /**\n * Changes the priority of an existing variable.\n *\n * Switching to/from P0 priority changes how the variable is handled:\n * - P0: Creates required constraint (must be satisfied exactly)\n * - Other: Uses edit variable system (can be adjusted by solver)\n *\n * @param index - Index of the variable to modify\n * @param priority - New priority level\n * @throws Will throw an error if the variable doesn't exist\n */\n public setVariablePriority(index: number, priority: UIPriority): void {\n const description = this.variables.get(index);\n if (description === undefined) {\n throw new Error(`Variable ${index} does not exist`);\n }\n\n if (priority !== description.priority) {\n description.priority = priority;\n\n if (description.priority === UIPriority.P0) {\n const lhs = new UIExpression().plus(index, 1);\n const rhs = new UIExpression(description.value);\n\n description.constraint = this.buildConstraint(\n lhs,\n rhs,\n UIRelation.EQUAL,\n description.priority,\n );\n\n try {\n this.solver?.addConstraint(description.constraint);\n } catch {\n this.solver = undefined;\n }\n } else {\n if (description.constraint) {\n try {\n this.solver?.removeConstraint(description.constraint);\n } catch {\n this.solver = undefined;\n }\n }\n\n description.constraint = undefined;\n this.rebuildVariable(index, description);\n }\n\n this.recalculationRequired = true;\n }\n }\n\n /**\n * Reads the current solved value of a variable.\n *\n * Triggers solver recalculation if needed and rebuilds the solver\n * if it was invalidated due to constraint conflicts.\n *\n * @param index - Index of the variable to read\n * @returns Current solved value of the variable\n * @throws Will throw an error if the variable doesn't exist\n */\n public readVariableValue(index: number): number {\n const description = this.variables.get(index);\n if (description === undefined) {\n throw new Error(`Variable ${index} does not exist`);\n }\n\n if (this.solver === undefined) {\n this.rebuildSolver();\n }\n\n if (this.recalculationRequired) {\n this.solver?.updateVariables();\n this.recalculationRequired = false;\n }\n\n return description.variable.value();\n }\n\n /**\n * Creates a new constraint between two expressions.\n *\n * Constraints can be enabled or disabled, and all properties can be\n * modified later without recreating the constraint.\n *\n * @param lhs - Left-hand side expression\n * @param rhs - Right-hand side expression\n * @param relation - Relational operator (equal, less than, greater than)\n * @param priority - Priority level for constraint solving\n * @param enabled - Whether the constraint is initially active\n * @returns Unique index identifier for the created constraint\n */\n public createConstraint(\n lhs: UIExpression,\n rhs: UIExpression,\n relation: UIRelation,\n priority: UIPriority,\n enabled: boolean,\n ): number {\n const index = this.lastConstraintIndex++;\n const constraint = this.buildConstraint(lhs, rhs, relation, priority);\n this.constraints.set(index, {\n constraint,\n lhs: lhs.clone(),\n rhs: rhs.clone(),\n priority,\n relation,\n enabled,\n });\n if (enabled) {\n try {\n this.solver?.addConstraint(constraint);\n } catch {\n this.solver = undefined;\n }\n this.recalculationRequired = true;\n }\n return index;\n }\n\n /**\n * Removes a constraint from the solver system.\n *\n * If the constraint is currently enabled, it will be removed from\n * the active solver before deletion.\n *\n * @param index - Index of the constraint to remove\n * @throws Will throw an error if the constraint doesn't exist\n */\n public removeConstraint(index: number): void {\n const description = this.constraints.get(index);\n if (description === undefined) {\n throw new Error(`Constraint ${index} does not exist`);\n }\n\n if (description.enabled) {\n try {\n this.solver?.removeConstraint(description.constraint);\n } catch {\n this.solver = undefined;\n }\n }\n\n this.constraints.delete(index);\n this.recalculationRequired = true;\n }\n\n /**\n * Updates the left-hand side expression of an existing constraint.\n *\n * Rebuilds the underlying constraint with the new expression while\n * preserving all other properties.\n *\n * @param index - Index of the constraint to modify\n * @param lhs - New left-hand side expression\n * @throws Will throw an error if the constraint doesn't exist\n */\n public setConstraintLHS(index: number, lhs: UIExpression): void {\n const description = this.constraints.get(index);\n if (description === undefined) {\n throw new Error(`Constraint ${index} does not exist`);\n }\n\n description.lhs.copy(lhs);\n this.rebuildConstraintByDescription(description);\n this.recalculationRequired = true;\n }\n\n /**\n * Updates the right-hand side expression of an existing constraint.\n *\n * Rebuilds the underlying constraint with the new expression while\n * preserving all other properties.\n *\n * @param index - Index of the constraint to modify\n * @param rhs - New right-hand side expression\n * @throws Will throw an error if the constraint doesn't exist\n */\n public setConstraintRHS(index: number, rhs: UIExpression): void {\n const description = this.constraints.get(index);\n if (description === undefined) {\n throw new Error(`Constraint ${index} does not exist`);\n }\n\n description.rhs.copy(rhs);\n this.rebuildConstraintByDescription(description);\n this.recalculationRequired = true;\n }\n\n /**\n * Updates the relational operator of an existing constraint.\n *\n * Changes how the left and right expressions are compared\n * (equal, less than, greater than).\n *\n * @param index - Index of the constraint to modify\n * @param relation - New relational operator\n * @throws Will throw an error if the constraint doesn't exist\n */\n public setConstraintRelation(index: number, relation: UIRelation): void {\n const description = this.constraints.get(index);\n if (description === undefined) {\n throw new Error(`Constraint ${index} does not exist`);\n }\n\n if (description.relation !== relation) {\n description.relation = relation;\n this.rebuildConstraintByDescription(description);\n this.recalculationRequired = true;\n }\n }\n\n /**\n * Updates the priority level of an existing constraint.\n *\n * Higher priority constraints are more likely to be satisfied\n * when conflicts arise.\n *\n * @param index - Index of the constraint to modify\n * @param priority - New priority level\n * @throws Will throw an error if the constraint doesn't exist\n */\n public setConstraintPriority(index: number, priority: UIPriority): void {\n const description = this.constraints.get(index);\n if (description === undefined) {\n throw new Error(`Constraint ${index} does not exist`);\n }\n\n if (description.priority !== priority) {\n description.priority = priority;\n this.rebuildConstraintByDescription(description);\n this.recalculationRequired = true;\n }\n }\n\n /**\n * Enables or disables an existing constraint.\n *\n * Disabled constraints are not considered during solving but\n * remain in the system for potential re-enabling.\n *\n * @param index - Index of the constraint to modify\n * @param enabled - Whether the constraint should be active\n * @throws Will throw an error if the constraint doesn't exist\n */\n public setConstraintEnabled(index: number, enabled: boolean): void {\n const description = this.constraints.get(index);\n if (description === undefined) {\n throw new Error(`Constraint ${index} does not exist`);\n }\n\n if (enabled !== description.enabled) {\n description.enabled = enabled;\n try {\n description.enabled\n ? this.solver?.addConstraint(description.constraint)\n : this.solver?.removeConstraint(description.constraint);\n } catch {\n this.solver = undefined;\n }\n this.recalculationRequired = true;\n }\n }\n\n /**\n * Rebuilds a variable in the solver system with new properties.\n *\n * Temporarily removes all constraints that reference the variable,\n * updates the variable configuration, then rebuilds and re-adds\n * the dependent constraints.\n */\n private rebuildVariable(\n index: number,\n description: VariableDescription,\n ): void {\n const dependConstraints: ConstraintDescription[] = [];\n\n for (const cDescription of this.constraints.values()) {\n if (cDescription.lhs.hasTerm(index) || cDescription.rhs.hasTerm(index)) {\n try {\n this.solver?.removeConstraint(cDescription.constraint);\n } catch {\n this.solver = undefined;\n }\n dependConstraints.push(cDescription);\n }\n }\n\n this.solver?.removeEditVariable(description.variable);\n this.solver?.addEditVariable(\n description.variable,\n convertPriority(description.priority),\n );\n\n for (const cDescription of dependConstraints) {\n cDescription.constraint = this.buildConstraint(\n cDescription.lhs,\n cDescription.rhs,\n cDescription.relation,\n cDescription.priority,\n );\n }\n\n for (const cDescription of dependConstraints) {\n try {\n this.solver?.addConstraint(cDescription.constraint);\n } catch {\n this.solver = undefined;\n break;\n }\n }\n }\n\n /**\n * Rebuilds a constraint based on its current description.\n *\n * Uses different rebuild strategies depending on whether the\n * constraint is currently enabled.\n */\n private rebuildConstraintByDescription(\n description: ConstraintDescription,\n ): void {\n description.constraint = description.enabled\n ? this.rebuildConstraint(\n description.constraint,\n description.lhs,\n description.rhs,\n description.relation,\n description.priority,\n )\n : this.buildConstraint(\n description.lhs,\n description.rhs,\n description.relation,\n description.priority,\n );\n }\n\n /**\n * Rebuilds a constraint by removing the old one and creating a new one.\n *\n * Safely handles solver state transitions and constraint replacement.\n */\n private rebuildConstraint(\n oldConstraint: Constraint,\n lhs: UIExpression,\n rhs: UIExpression,\n relation: UIRelation,\n priority: UIPriority,\n ): Constraint {\n try {\n this.solver?.removeConstraint(oldConstraint);\n } catch {\n this.solver = undefined;\n }\n\n const constraint = this.buildConstraint(lhs, rhs, relation, priority);\n\n try {\n this.solver?.addConstraint(constraint);\n } catch {\n this.solver = undefined;\n }\n\n return constraint;\n }\n\n /**\n * Creates a new Kiwi constraint from UI expressions and parameters.\n *\n * Converts UI-level expressions and enums to Kiwi-compatible formats.\n */\n private buildConstraint(\n lhs: UIExpression,\n rhs: UIExpression,\n relation: UIRelation,\n priority: UIPriority,\n ): Constraint {\n return new Constraint(\n this.convertExpression(lhs),\n convertRelation(relation),\n this.convertExpression(rhs),\n convertPriority(priority),\n );\n }\n\n /**\n * Converts a UIExpression to a Kiwi Expression.\n *\n * Maps variable indices to their corresponding Kiwi Variable instances\n * and preserves coefficients and constants.\n */\n private convertExpression(expression: UIExpression): Expression {\n return new Expression(\n ...expression[\"prepareTermsInternal\"]().map(\n ([variableIndex, coefficient]): [number, Variable] => {\n const description = this.variables.get(variableIndex);\n if (description === undefined) {\n throw new Error(`Variable ${variableIndex} does not exist`);\n }\n return [coefficient, description.variable];\n },\n ),\n expression.constant,\n );\n }\n\n /**\n * Completely rebuilds the solver from scratch.\n *\n * Re-adds all variables and constraints to a fresh solver instance.\n * Used for recovery when the solver enters an invalid state.\n */\n private rebuildSolver(): void {\n if (this.solver) {\n throw new Error(\"Solver already exists\");\n }\n\n this.solver = new Solver();\n\n for (const description of this.variables.values()) {\n if (description.constraint) {\n this.solver.addConstraint(description.constraint);\n } else {\n this.solver.addEditVariable(\n description.variable,\n convertPriority(description.priority),\n );\n this.solver.suggestValue(description.variable, description.value);\n }\n }\n\n for (const description of this.constraints.values()) {\n if (description.enabled) {\n this.solver.addConstraint(description.constraint);\n }\n }\n\n this.recalculationRequired = true;\n }\n}\n","import { Eventail } from \"eventail\";\nimport type { WebGLRenderer } from \"three\";\nimport type { UIPlaneElement } from \"../miscellaneous/asserts\";\nimport { UIMode } from \"../miscellaneous/UIMode\";\nimport { UIOrientation } from \"../miscellaneous/UIOrientation\";\nimport { UIPriority } from \"../miscellaneous/UIPriority\";\nimport type { UISceneWrapperClientAPI } from \"../miscellaneous/UISceneWrapperClientAPI\";\nimport { UISceneWrapper } from \"../wrappers/UISceneWrapper\";\nimport { UISolverWrapper } from \"../wrappers/UISolverWrapper\";\n\n/**\n * Interface for handling input events within UI layers.\n */\nexport interface UILayerInputListener {\n zIndex: number;\n catchPointerDown(x: number, y: number, identifier: number): boolean;\n catchPointerMove(x: number, y: number, identifier: number): boolean;\n catchPointerUp(x: number, y: number, identifier: number): boolean;\n}\n\n/**\n * Events that can be emitted by UI layers.\n */\nexport enum UILayerEvent {\n /** Emitted when the layer's orientation changes between horizontal and vertical. */\n ORIENTATION_CHANGE = \"orientation_change\",\n /** Emitted when the layer's visibility/interaction mode changes. */\n MODE_CHANGE = \"mode_change\",\n /** Emitted before the layer is rendered. */\n WILL_RENDER = \"will_render\",\n}\n\n/**\n * Abstract base class for UI layout containers with constraint solving and rendering.\n *\n * UILayer serves as the fundamental container for UI elements, providing constraint-based\n * layout solving, 3D scene management, and event handling. It manages the layer's\n * dimensions through solver variables, handles orientation changes, and coordinates\n * rendering and interaction for all contained elements.\n *\n * Each layer maintains its own constraint solver and scene graph, allowing for\n * independent layout calculation and rendering optimization.\n *\n * @see {@link UIElement} - Elements contained within layers\n * @see {@link UISolverWrapper} - Constraint solving system\n * @see {@link UISceneWrapper} - 3D scene management\n * @see {@link UIOrientation} - Layer orientation states\n */\nexport abstract class UILayer extends Eventail implements UIPlaneElement {\n /** Optional name identifier for the layer. */\n public name = \"\";\n\n /**\n * Solver variable descriptor for the x-coordinate position.\n * This variable is managed by the constraint solver system.\n */\n public readonly xVariable: number;\n\n /**\n * Solver variable descriptor for the y-coordinate position.\n * This variable is managed by the constraint solver system.\n */\n public readonly yVariable: number;\n\n /**\n * Solver variable descriptor for the width dimension.\n * This variable is managed by the constraint solver system.\n */\n public readonly wVariable: number;\n\n /**\n * Solver variable descriptor for the height dimension.\n * This variable is managed by the constraint solver system.\n */\n public readonly hVariable: number;\n\n /**\n * Constraint solver wrapper for managing layout calculations.\n * @see {@link UISolverWrapper}\n */\n protected readonly solverWrapper = new UISolverWrapper();\n\n /**\n * 3D scene wrapper for managing rendering and element hierarchy.\n * @see {@link UISceneWrapper}\n */\n protected readonly sceneWrapper: UISceneWrapper;\n\n /** Internal storage for the current visibility/interaction mode. */\n protected modeInternal: UIMode = UIMode.VISIBLE;\n\n /** Internal storage for the current orientation state. */\n protected orientationInternal: UIOrientation;\n\n /** Collection of input listeners for handling user interactions, sorted by z-index. */\n\n private readonly inputListeners: UILayerInputListener[] = [];\n\n /**\n * Creates a new UILayer instance with specified dimensions.\n *\n * Initializes the constraint solver with position and dimension variables,\n * sets up the 3D scene wrapper, and determines the initial orientation\n * based on the width-to-height ratio.\n *\n * @param w - Initial width of the layer\n * @param h - Initial height of the layer\n */\n constructor(w: number, h: number) {\n super();\n this.sceneWrapper = new UISceneWrapper(w, h);\n this.xVariable = this.solverWrapper.createVariable(0, UIPriority.P0);\n this.yVariable = this.solverWrapper.createVariable(0, UIPriority.P0);\n this.wVariable = this.solverWrapper.createVariable(w, UIPriority.P0);\n this.hVariable = this.solverWrapper.createVariable(h, UIPriority.P0);\n this.orientationInternal =\n w > h ? UIOrientation.HORIZONTAL : UIOrientation.VERTICAL;\n }\n\n /**\n * Gets the current x position value from the constraint solver.\n * @returns The current x position in pixels\n */\n public get x(): number {\n return this.solverWrapper.readVariableValue(this.xVariable);\n }\n\n /**\n * Gets the current y position value from the constraint solver.\n * @returns The current y position in pixels\n */\n public get y(): number {\n return this.solverWrapper.readVariableValue(this.yVariable);\n }\n\n /**\n * Gets the current width value from the constraint solver.\n * @returns The current layer width in pixels\n */\n public get width(): number {\n return this.solverWrapper.readVariableValue(this.wVariable);\n }\n\n /**\n * Gets the current height value from the constraint solver.\n * @returns The current layer height in pixels\n */\n public get height(): number {\n return this.solverWrapper.readVariableValue(this.hVariable);\n }\n\n /**\n * Gets the current visibility and interaction mode.\n * @returns The current UIMode setting\n * @see {@link UIMode}\n */\n public get mode(): UIMode {\n return this.modeInternal;\n }\n\n /**\n * Gets the current orientation state.\n * @returns The current orientation (horizontal or vertical)\n * @see {@link UIOrientation}\n */\n public get orientation(): UIOrientation {\n return this.orientationInternal;\n }\n\n /**\n * Sets the visibility and interaction mode and emits change event.\n * @param value - The new UIMode setting\n * @see {@link UIMode}\n */\n public set mode(value: UIMode) {\n if (value !== this.modeInternal) {\n this.modeInternal = value;\n this.emit(UILayerEvent.MODE_CHANGE, this.modeInternal, this);\n }\n }\n\n /**\n * Internal method for resizing the layer and updating orientation.\n *\n * Updates the solver variables for width and height, resizes the scene wrapper,\n * and determines if the orientation has changed based on the new dimensions.\n * Emits an orientation change event if the orientation has changed.\n *\n * @param width - The new layer width\n * @param height - The new layer height\n * @protected\n */\n protected resizeInternal(width: number, height: number): void {\n this.solverWrapper.suggestVariableValue(this.wVariable, width);\n this.solverWrapper.suggestVariableValue(this.hVariable, height);\n this.sceneWrapper.resize(width, height);\n\n const orientation =\n width > height ? UIOrientation.HORIZONTAL : UIOrientation.VERTICAL;\n\n if (orientation !== this.orientationInternal) {\n this.orientationInternal = orientation;\n this.emit(\n UILayerEvent.ORIENTATION_CHANGE,\n this.orientationInternal,\n this,\n );\n }\n }\n\n /**\n * Internal method for rendering the layer and its elements.\n *\n * Delegates rendering to the scene wrapper if the layer is not hidden.\n * This method is called during the rendering loop to update and draw\n * all elements contained within the layer.\n *\n * @param renderer - The WebGL renderer instance\n * @param deltaTime - Time elapsed since the last frame in seconds\n * @protected\n */\n protected renderInternal(renderer: WebGLRenderer, deltaTime: number): void {\n if (this.mode !== UIMode.HIDDEN) {\n this.emit(UILayerEvent.WILL_RENDER, renderer, deltaTime, this);\n this.sceneWrapper.render(renderer);\n }\n }\n\n protected onPointerDownInternal(\n x: number,\n y: number,\n identifier: number,\n ): void {\n this.handleInputEvent(x, y, \"catchPointerDown\", identifier);\n }\n\n protected onPointerMoveInternal(\n x: number,\n y: number,\n identifier: number,\n ): void {\n this.handleInputEvent(x, y, \"catchPointerMove\", identifier);\n }\n\n protected onPointerUpInternal(\n x: number,\n y: number,\n identifier: number,\n ): void {\n this.handleInputEvent(x, y, \"catchPointerUp\", identifier);\n }\n\n /**\n * Internal method for accessing the constraint solver wrapper.\n *\n * Provides access to the layer's constraint solver for elements and\n * constraints that need to create variables or constraints.\n *\n * @returns The constraint solver wrapper instance\n */\n protected [\"getSolverWrapperInternal\"](): UISolverWrapper {\n return this.solverWrapper;\n }\n\n /**\n * Internal method for accessing the 3D scene wrapper.\n *\n * Provides access to the layer's scene management system for elements\n * that need to be added to or removed from the 3D scene.\n *\n * @returns The scene wrapper instance\n */\n protected [\"getSceneWrapperClientAPI\"](): UISceneWrapperClientAPI {\n return this.sceneWrapper;\n }\n\n /**\n * Internal method for registering an input listener for pointer events.\n *\n * Adds a listener to handle click events with the specified z-index priority.\n * Higher z-index listeners are processed first during event handling.\n *\n * @param listener - The input listener to register\n * @param zIndex - The z-index priority for event handling order\n * @throws Will throw an error if the listener is already registered\n */\n\n protected [\"subscribePointerInput\"](listener: UILayerInputListener): void {\n if (this.inputListeners.find((l) => l === listener)) {\n throw new Error(\"Listener already exists\");\n }\n this.inputListeners.push(listener);\n }\n\n /**\n * Internal method for unregistering an input listener.\n *\n * Removes the specified listener from the event handling system.\n * The listener will no longer receive click events.\n *\n * @param listener - The input listener to remove\n * @throws Will throw an error if the listener is not found\n */\n\n protected [\"unsubscribePointerInput\"](listener: UILayerInputListener): void {\n const index = this.inputListeners.findIndex((l) => l === listener);\n if (index === -1) {\n throw new Error(\"Listener not found\");\n }\n this.inputListeners.splice(index, 1);\n }\n\n private handleInputEvent(\n x: number,\n y: number,\n catchFunctionName:\n | \"catchPointerDown\"\n | \"catchPointerMove\"\n | \"catchPointerUp\",\n identifier: number,\n ): void {\n if (this.mode === UIMode.INTERACTIVE) {\n this.inputListeners.sort((a, b) => b.zIndex - a.zIndex);\n for (const listener of this.inputListeners) {\n if (listener[catchFunctionName](x, y, identifier)) {\n return;\n }\n }\n }\n }\n}\n","import { type UILayer } from \"../layers/UILayer\";\n\nimport type { UISolverWrapper } from \"../wrappers/UISolverWrapper\";\n\n/**\n * Abstract base class for all UI layout constraints.\n *\n * UIConstraint serves as the fundamental building block for the constraint-based\n * layout system. It provides access to the solver wrapper for creating and\n * managing constraint relationships between UI elements. All concrete constraint\n * implementations must extend this class to participate in the layout solving process.\n *\n * @see {@link UILayer} - Container layer for constraints\n * @see {@link UISolverWrapper} - Constraint solver integration\n */\nexport abstract class UIConstraint {\n /** Optional name identifier for the constraint. */\n public name = \"\";\n\n /**\n * Reference to the constraint solver wrapper for managing solver operations.\n * @see {@link UISolverWrapper}\n */\n protected readonly solverWrapper: UISolverWrapper;\n\n /**\n * Creates a new UIConstraint instance.\n *\n * Automatically connects to the layer's constraint solver for managing\n * layout relationships and constraint operations.\n *\n * @param layer - The UI layer that contains this constraint\n */\n constructor(public readonly layer: UILayer) {\n this.solverWrapper = this.layer[\"getSolverWrapperInternal\"]();\n }\n}\n","import type { UILayer } from \"../layers/UILayer\";\nimport { UILayerEvent } from \"../layers/UILayer\";\nimport {\n resolveOrientation,\n UIOrientation,\n} from \"../miscellaneous/UIOrientation\";\nimport { resolvePriority, type UIPriority } from \"../miscellaneous/UIPriority\";\nimport { resolveRelation, type UIRelation } from \"../miscellaneous/UIRelation\";\nimport { UIConstraint } from \"./UIConstraint\";\n\n/**\n * Configuration options for UISingleParameterConstraint creation.\n */\nexport interface UISingleParameterConstraintOptions {\n /** Priority level for the constraint in the solver hierarchy. */\n priority: UIPriority;\n /** Mathematical relation type for the constraint equation. */\n relation: UIRelation;\n /** Orientation context for when the constraint should be active. */\n orientation: UIOrientation;\n}\n\n/**\n * Abstract base class for constraints that operate with configurable parameters.\n *\n * UISingleParameterConstraint extends UIConstraint with common functionality\n * for constraints that need priority, relation, and orientation configuration.\n * It provides automatic orientation-based enabling/disabling of constraints\n * and manages the lifecycle of solver constraint descriptors.\n *\n * @see {@link UIConstraint} - Base constraint class\n * @see {@link UIPriority} - Priority level configuration\n * @see {@link UIRelation} - Mathematical relation types\n * @see {@link UIOrientation} - Orientation-based activation\n */\nexport abstract class UISingleParameterConstraint extends UIConstraint {\n /** Internal storage for the constraint priority level. */\n protected priorityInternal: UIPriority;\n /** Internal storage for the constraint relation type. */\n protected relationInternal: UIRelation;\n /** Internal storage for the constraint orientation setting. */\n protected orientationInternal: UIOrientation;\n\n /** The constraint descriptor managed by the solver system. */\n protected abstract readonly constraint: number;\n\n /**\n * Creates a new UISingleParameterConstraint instance.\n *\n * Initializes the constraint with resolved default values and sets up\n * orientation change event handling for dynamic constraint activation.\n *\n * @param layer - The UI layer that contains this constraint\n * @param priority - Optional priority level (defaults to P0)\n * @param relation - Optional relation type (defaults to EQUAL)\n * @param orientation - Optional orientation setting (defaults to ALWAYS)\n */\n constructor(\n layer: UILayer,\n priority?: UIPriority,\n relation?: UIRelation,\n orientation?: UIOrientation,\n ) {\n super(layer);\n this.priorityInternal = resolvePriority(priority);\n this.relationInternal = resolveRelation(relation);\n this.orientationInternal = resolveOrientation(orientation);\n this.layer.on(UILayerEvent.ORIENTATION_CHANGE, this.onOrientationChange);\n }\n\n /**\n * Gets the current priority level of the constraint.\n * @returns The constraint priority level\n */\n public get priority(): UIPriority {\n return this.priorityInternal;\n }\n\n /**\n * Gets the current mathematical relation type of the constraint.\n * @returns The constraint relation type\n */\n public get relation(): UIRelation {\n return this.relationInternal;\n }\n\n /**\n * Gets the current orientation setting of the constraint.\n * @returns The constraint orientation setting\n */\n public get orientation(): UIOrientation {\n return this.orientationInternal;\n }\n\n /**\n * Sets a new priority level for the constraint.\n * @param value - The new priority level\n */\n public set priority(value: UIPriority) {\n if (value !== this.priorityInternal) {\n this.priorityInternal = value;\n this.solverWrapper.setConstraintPriority(\n this.constraint,\n this.priorityInternal,\n );\n }\n }\n\n /**\n * Sets a new mathematical relation type for the constraint.\n * @param value - The new relation type\n */\n public set relation(value: UIRelation) {\n if (value !== this.relationInternal) {\n this.relationInternal = value;\n this.solverWrapper.setConstraintRelation(\n this.constraint,\n this.relationInternal,\n );\n }\n }\n\n /**\n * Sets a new orientation setting for the constraint.\n * @param value - The new orientation setting\n */\n public set orientation(value: UIOrientation) {\n if (value !== this.orientationInternal) {\n this.orientationInternal = value;\n this.onOrientationChange();\n }\n }\n\n /**\n * Destroys the constraint by cleaning up event listeners and solver resources.\n *\n * This method removes the orientation change event listener and removes\n * the constraint from the solver system. After calling this method,\n * the constraint should not be used anymore.\n */\n public destroy(): void {\n this.layer.off(UILayerEvent.ORIENTATION_CHANGE, this.onOrientationChange);\n this.solverWrapper.removeConstraint(this.constraint);\n }\n\n /**\n * Determines if the constraint should be enabled based on orientation.\n *\n * The constraint is enabled if its orientation is set to ALWAYS or if\n * it matches the current layer orientation.\n *\n * @returns True if the constraint should be enabled, false otherwise\n * @protected\n */\n protected isConstraintEnabled(): boolean {\n return (\n this.orientationInternal === UIOrientation.ALWAYS ||\n this.orientationInternal === this.layer.orientation\n );\n }\n\n /**\n * Event handler for layer orientation changes.\n *\n * Updates the constraint's enabled state in the solver based on the\n * current orientation and the constraint's orientation setting.\n */\n private readonly onOrientationChange = (): void => {\n this.solverWrapper.setConstraintEnabled(\n this.constraint,\n this.isConstraintEnabled(),\n );\n };\n}\n","import type { UILayerElement, UIPlaneElement } from \"../miscellaneous/asserts\";\nimport { UIExpression } from \"../miscellaneous/UIExpression\";\nimport type { UISingleParameterConstraintOptions } from \"./UISingleParameterConstraint\";\nimport { UISingleParameterConstraint } from \"./UISingleParameterConstraint\";\n\n/**\n * Configuration options for UIHeightConstraint creation.\n */\nexport interface UIHeightConstraintOptions\n extends UISingleParameterConstraintOptions {\n /** The desired height value for the element. */\n height: number;\n}\n\n/**\n * Constraint that enforces a specific height value for UI elements.\n *\n * UIHeightConstraint creates a mathematical relationship that fixes an element's\n * height to a constant value. The constraint equation is: element.height = height.\n * This is useful for ensuring elements maintain a specific height regardless of\n * other layout changes or for setting fixed dimensions in responsive layouts.\n *\n * @see {@link UISingleParameterConstraint} - Base class for single-parameter constraints\n * @see {@link UIPlaneElement} - Elements that can have height constraints applied\n * @see {@link UIExpression} - Mathematical expressions for constraint equations\n */\nexport class UIHeightConstraint extends UISingleParameterConstraint {\n /** The constraint descriptor managed by the solver system. */\n protected override readonly constraint: number;\n\n /** Internal storage for the current height value. */\n private heightInternal: number;\n\n /**\n * Creates a new UIHeightConstraint instance.\n *\n * If no height is specified in options, the constraint will use the\n * element's current height as the target height value.\n *\n * @param element - The UI element to apply the height constraint to\n * @param options - Configuration options for the constraint\n */\n constructor(\n private readonly element: UIPlaneElement & UILayerElement,\n options: Partial<UIHeightConstraintOptions> = {},\n ) {\n super(\n element.layer,\n options.priority,\n options.relation,\n options.orientation,\n );\n\n this.heightInternal = options.height ?? element.height;\n\n this.constraint = this.solverWrapper.createConstraint(\n new UIExpression(0, [[this.element.hVariable, 1]]),\n new UIExpression(this.heightInternal),\n this.relation,\n this.priority,\n this.isConstraintEnabled(),\n );\n }\n\n /**\n * Gets the current height value being enforced.\n * @returns The height value in pixels\n */\n public get height(): number {\n return this.heightInternal;\n }\n\n /**\n * Sets a new height value and updates the constraint equation.\n * @param value - The new height value in pixels\n */\n public set height(value: number) {\n if (this.heightInternal !== value) {\n this.heightInternal = value;\n this.solverWrapper.setConstraintRHS(\n this.constraint,\n new UIExpression(value),\n );\n }\n }\n}\n","import { UILayer } from \"../layers/UILayer\";\n\n/** Small epsilon value for floating-point comparisons and minimum positive number validation. */\nexport const EPSILON = 1e-6;\n\n/**\n * Interface for objects that belong to a UI layer.\n *\n * Elements implementing this interface are associated with a specific layer\n * for constraint solving and rendering management.\n */\nexport interface UILayerElement {\n /** The UI layer that contains this element. */\n readonly layer: UILayer;\n}\n\n/**\n * Interface for UI elements that have a position in 2D space.\n *\n * Point elements are characterized by x and y coordinates represented\n * as solver variable descriptors for constraint-based positioning.\n */\nexport interface UIPointElement {\n /** Solver variable descriptor for the x-coordinate. */\n readonly xVariable: number;\n /** Solver variable descriptor for the y-coordinate. */\n readonly yVariable: number;\n\n /** The x-coordinate of the element. */\n readonly x: number;\n /** The y-coordinate of the element. */\n readonly y: number;\n}\n\n/**\n * Interface for UI elements that have both position and dimensions in 2D space.\n *\n * Plane elements extend point elements with width and height properties,\n * enabling rectangular area constraints and positioning.\n */\nexport interface UIPlaneElement extends UIPointElement {\n /** Solver variable descriptor for the width dimension. */\n readonly wVariable: number;\n /** Solver variable descriptor for the height dimension. */\n readonly hVariable: number;\n\n /** The width of the element. */\n readonly width: number;\n /** The height of the element. */\n readonly height: number;\n}\n\n/**\n * Type guard to check if an object implements the UILayerElement interface.\n *\n * @param obj - The object to check\n * @returns True if the object has a valid layer property, false otherwise\n */\nexport function isUILayerElement(obj: unknown): obj is UILayerElement {\n return (\n typeof obj === \"object\" &&\n obj !== null &&\n \"layer\" in obj &&\n obj.layer instanceof UILayer\n );\n}\n\n/**\n * Type guard to check if an object implements the UIPointElement interface.\n *\n * @param obj - The object to check\n * @returns True if the object has valid xVariable and yVariable properties, false otherwise\n */\nexport function isUIPointElement(obj: unknown): obj is UIPointElement {\n return (\n typeof obj === \"object\" &&\n obj !== null &&\n \"xVariable\" in obj &&\n typeof obj.xVariable === \"number\" &&\n \"yVariable\" in obj &&\n typeof obj.yVariable === \"number\" &&\n \"width\" in obj &&\n typeof obj.width === \"number\" &&\n \"height\" in obj &&\n typeof obj.height === \"number\"\n );\n}\n\n/**\n * Type guard to check if an object implements the UIPlaneElement interface.\n *\n * Note: This function only checks for width and height variables. Objects\n * should also satisfy UIPointElement requirements for complete validation.\n *\n * @param obj - The object to check\n * @returns True if the object has valid wVariable and hVariable properties, false otherwise\n */\nexport function isUIPlaneElement(obj: unknown): obj is UIPlaneElement {\n return (\n typeof obj === \"object\" &&\n obj !== null &&\n \"wVariable\" in obj &&\n typeof obj.wVariable === \"number\" &&\n \"hVariable\" in obj &&\n typeof obj.hVariable === \"number\" &&\n \"width\" in obj &&\n typeof obj.width === \"number\" &&\n \"height\" in obj &&\n typeof obj.height === \"number\"\n );\n}\n\n/**\n * Validates that two objects are valid constraint subjects from the same layer.\n *\n * Ensures that both objects are either UILayer instances or UILayerElement instances,\n * that they are not both layers (which cannot be constrained to each other),\n * and that they belong to the same layer for constraint solving.\n *\n * @param a - The first constraint subject\n * @param b - The second constraint subject\n * @param subject - The name of the constraint for error messages\n * @returns The common layer that both subjects belong to\n * @throws Will throw an error if subjects are invalid or from different layers\n */\nexport function assertValidConstraintSubjects(\n a: unknown,\n b: unknown,\n subject: string,\n): UILayer {\n if (a instanceof UILayer && b instanceof UILayer) {\n throw new Error(`${subject}: layer cannot be snapped to another layer`);\n }\n\n let layerA: UILayer;\n let layerB: UILayer;\n\n if (a instanceof UILayer || isUILayerElement(a)) {\n layerA = a instanceof UILayer ? a : a.layer;\n } else {\n throw new Error(`${subject}: A must be a UILayer or a UIPointElement`);\n }\n\n if (b instanceof UILayer || isUILayerElement(b)) {\n layerB = b instanceof UILayer ? b : b.layer;\n } else {\n throw new Error(`${subject}: B must be a UILayer or a UIPointElement`);\n }\n\n if (layerA !== layerB) {\n throw new Error(`${subject}: elements must be on the same layer`);\n }\n\n return layerA;\n}\n\n/**\n * Validates that a value is a finite number within safe integer range.\n *\n * Checks that the value is finite (not NaN, Infinity, or -Infinity) and\n * within the safe integer range for reliable mathematical operations.\n *\n * @param value - The number to validate\n * @param subject - The name of the value for error messages\n * @throws Will throw an error if the value is not finite or exceeds safe range\n */\nexport function assertValidNumber(value: number, subject: string): void {\n if (!Number.isFinite(value)) {\n throw new Error(`${subject}: value must be a finite number`);\n }\n\n if (Math.abs(value) > Number.MAX_SAFE_INTEGER) {\n throw new Error(`${subject}: value exceeds maximum safe integer range`);\n }\n}\n\n/**\n * Validates that a value is a positive number above the epsilon threshold.\n *\n * First validates that the value is a finite number, then ensures it is\n * greater than or equal to EPSILON to avoid numerical precision issues\n * with very small positive values.\n *\n * @param value - The number to validate\n * @param subject - The name of the value for error messages\n * @throws Will throw an error if the value is invalid or not sufficiently positive\n * @see {@link assertValidNumber}\n */\nexport function assertValidPositiveNumber(\n value: number,\n subject: string,\n): void {\n assertValidNumber(value, subject);\n\n if (value < EPSILON) {\n throw new Error(\n `${subject}: value must be greater than or equal to ${EPSILON}`,\n );\n }\n}\n\n/**\n * Validates that a value is a non-negative number (including zero).\n *\n * First validates that the value is a finite number, then ensures it is\n * greater than or equal to zero. Unlike assertValidPositiveNumber, this\n * function allows zero as a valid value.\n *\n * @param value - The number to validate\n * @param subject - The name of the value for error messages\n * @throws Will throw an error if the value is invalid or negative\n * @see {@link assertValidNumber}\n */\nexport function assertValidNonNegativeNumber(\n value: number,\n subject: string,\n): void {\n assertValidNumber(value, subject);\n if (value < 0) {\n throw new Error(`${subject}: value must be greater than or equal to 0`);\n }\n}\n","import type { UIPlaneElement, UIPointElement } from \"../miscellaneous/asserts\";\nimport {\n assertValidConstraintSubjects,\n isUIPlaneElement,\n isUIPointElement,\n} from \"../miscellaneous/asserts\";\nimport { UIExpression } from \"../miscellaneous/UIExpression\";\nimport type { UISingleParameterConstraintOptions } from \"./UISingleParameterConstraint\";\nimport { UISingleParameterConstraint } from \"./UISingleParameterConstraint\";\n\n/** Default anchor point (0.5 = center) for elements when not specified. */\nconst DEFAULT_ANCHOR = 0.5;\n\n/**\n * Configuration options for UIHorizontalDistanceConstraint creation.\n */\nexport interface UIHorizontalDistanceConstraintOptions\n extends UISingleParameterConstraintOptions {\n /** Anchor point for element A (0.0 = left edge, 0.5 = center, 1.0 = right edge). */\n anchorA: number;\n /** Anchor point for element B (0.0 = left edge, 0.5 = center, 1.0 = right edge). */\n anchorB: number;\n /** The desired horizontal distance between the elements. */\n distance: number;\n}\n\n/**\n * Constraint that enforces horizontal distance between two UI elements.\n *\n * UIHorizontalDistanceConstraint creates a mathematical relationship that maintains\n * a specific horizontal distance between two elements using configurable anchor points.\n * For plane elements, anchors determine the reference point (0.0 = left, 0.5 = center, 1.0 = right).\n * For point elements, the anchor is always the element's position. The constraint equation is:\n * (elementB.x + elementB.width * anchorB) - (elementA.x + elementA.width * anchorA) = distance\n *\n * @see {@link UISingleParameterConstraint} - Base class for single-parameter constraints\n * @see {@link UIPointElement} - Point elements that can be constrained\n * @see {@link UIPlaneElement} - Plane elements that can be constrained\n * @see {@link UIExpression} - Mathematical expressions for constraint equations\n */\nexport class UIHorizontalDistanceConstraint extends UISingleParameterConstraint {\n /** The constraint descriptor managed by the solver system. */\n protected override readonly constraint: number;\n\n /** Internal storage for element A's anchor point. */\n private anchorAInternal: number;\n /** Internal storage for element B's anchor point. */\n private anchorBInternal: number;\n /** Internal storage for the horizontal distance value. */\n private distanceInternal: number;\n\n /**\n * Creates a new UIHorizontalDistanceConstraint instance.\n *\n * The constraint will use default anchor points (0.5 = center) and zero distance\n * if not specified in options. Both elements must be from the same layer.\n *\n * @param a - The first UI element (point or plane element)\n * @param b - The second UI element (point or plane element)\n * @param options - Configuration options for the constraint\n * @throws Will throw an error if elements are not from the same layer\n * @see {@link assertValidConstraintSubjects}\n */\n constructor(\n private readonly a: UIPointElement | UIPlaneElement,\n private readonly b: UIPointElement | UIPlaneElement,\n options: Partial<UIHorizontalDistanceConstraintOptions> = {},\n ) {\n super(\n assertValidConstraintSubjects(a, b, \"UIHorizontalDistanceConstraint\"),\n options.priority,\n options.relation,\n options.orientation,\n );\n\n this.anchorAInternal = options.anchorA ?? DEFAULT_ANCHOR;\n this.anchorBInternal = options.anchorB ?? DEFAULT_ANCHOR;\n this.distanceInternal = options.distance ?? 0;\n\n this.constraint = this.solverWrapper.createConstraint(\n this.buildLHS(),\n new UIExpression(this.distanceInternal),\n this.relationInternal,\n this.priorityInternal,\n this.isConstraintEnabled(),\n );\n }\n\n /**\n * Gets the current horizontal distance being enforced.\n * @returns The horizontal distance in pixels\n */\n public get distance(): number {\n return this.distanceInternal;\n }\n\n /**\n * Gets the anchor point for element A.\n * @returns The anchor value (0.0 = left, 0.5 = center, 1.0 = right)\n */\n public get anchorA(): number {\n return this.anchorAInternal;\n }\n\n /**\n * Gets the anchor point for element B.\n * @returns The anchor value (0.0 = left, 0.5 = center, 1.0 = right)\n */\n public get anchorB(): number {\n return this.anchorBInternal;\n }\n\n /**\n * Sets a new horizontal distance and updates the constraint equation.\n * @param value - The new horizontal distance in pixels\n */\n public set distance(value: number) {\n if (this.distanceInternal !== value) {\n this.distanceInternal = value;\n this.solverWrapper.setConstraintRHS(\n this.constraint,\n new UIExpression(this.distanceInternal),\n );\n }\n }\n\n /**\n * Sets a new anchor point for element A and updates the constraint equation.\n * @param value - The new anchor value (0.0 = left, 0.5 = center, 1.0 = right)\n */\n public set anchorA(value: number) {\n if (this.anchorAInternal !== value) {\n this.anchorAInternal = value;\n this.solverWrapper.setConstraintLHS(this.constraint, this.buildLHS());\n }\n }\n\n /**\n * Sets a new anchor point for element B and updates the constraint equation.\n * @param value - The new anchor value (0.0 = left, 0.5 = center, 1.0 = right)\n */\n public set anchorB(value: number) {\n if (this.anchorBInternal !== value) {\n this.anchorBInternal = value;\n this.solverWrapper.setConstraintLHS(this.constraint, this.buildLHS());\n }\n }\n\n /**\n * Builds the left-hand side expression for the constraint equation.\n *\n * Creates the expression: (elementB.x + elementB.width * anchorB) - (elementA.x + elementA.width * anchorA)\n * For point elements, only the x position is used since they have no width.\n * For plane elements, the anchor determines the reference point within the element's width.\n *\n * @returns The UIExpression representing the horizontal distance calculation\n */\n private buildLHS(): UIExpression {\n let aExpression: UIExpression;\n let bExpression: UIExpression;\n\n if (isUIPlaneElement(this.a)) {\n aExpression = new UIExpression(0, [\n [this.a.xVariable, 1],\n [this.a.wVariable, this.anchorAInternal],\n ]);\n } else if (isUIPointElement(this.a)) {\n aExpression = new UIExpression().plus(this.a.xVariable, 1);\n } else {\n throw new Error(\"A is not a valid element type\");\n }\n\n if (isUIPlaneElement(this.b)) {\n bExpression = new UIExpression(0, [\n [this.b.xVariable, 1],\n [this.b.wVariable, this.anchorBInternal],\n ]);\n } else if (isUIPointElement(this.b)) {\n bExpression = new UIExpression().plus(this.b.xVariable, 1);\n } else {\n throw new Error(\"B is not a valid element type\");\n }\n\n return UIExpression.minus(bExpression, aExpression);\n }\n}\n","import type { UIPlaneElement } from \"../miscellaneous/asserts\";\nimport { assertValidConstraintSubjects } from \"../miscellaneous/asserts\";\nimport { UIExpression } from \"../miscellaneous/UIExpression\";\nimport type { UISingleParameterConstraintOptions } from \"./UISingleParameterConstraint\";\nimport { UISingleParameterConstraint } from \"./UISingleParameterConstraint\";\n\n/**\n * Configuration options for UIHorizontalProportionConstraint creation.\n */\nexport interface UIHorizontalProportionConstraintOptions\n extends UISingleParameterConstraintOptions {\n /** The proportional relationship between element widths (elementA.width * proportion = elementB.width). */\n proportion: number;\n}\n\n/**\n * Constraint that enforces proportional width relationships between two UI elements.\n *\n * UIHorizontalProportionConstraint creates a mathematical relationship that maintains\n * a proportional ratio between the widths of two plane elements. The constraint equation is:\n * elementA.width * proportion = elementB.width, which can be rearranged as:\n * elementA.width * proportion - elementB.width = 0\n *\n * This is useful for creating responsive layouts where elements need to maintain\n * specific width ratios, such as sidebar-to-content ratios or grid column proportions.\n *\n * @see {@link UISingleParameterConstraint} - Base class for single-parameter constraints\n * @see {@link UIPlaneElement} - Plane elements that can have proportional constraints applied\n * @see {@link UIExpression} - Mathematical expressions for constraint equations\n */\nexport class UIHorizontalProportionConstraint extends UISingleParameterConstraint {\n /** The constraint descriptor managed by the solver system. */\n protected override readonly constraint: number;\n /** Internal storage for the current proportion value. */\n private proportionInternal: number;\n\n /**\n * Creates a new UIHorizontalProportionConstraint instance.\n *\n * The constraint will enforce the relationship: elementA.width * proportion = elementB.width.\n * If no proportion is specified, it defaults to 1.0 (equal widths).\n * Both elements must be from the same layer.\n *\n * @param a - The first UI plane element (whose width will be multiplied by proportion)\n * @param b - The second UI plane element (target width for the proportion)\n * @param options - Configuration options for the constraint\n * @throws Will throw an error if elements are not from the same layer\n * @see {@link assertValidConstraintSubjects}\n */\n constructor(\n private readonly a: UIPlaneElement,\n private readonly b: UIPlaneElement,\n options: Partial<UIHorizontalProportionConstraintOptions> = {},\n ) {\n super(\n assertValidConstraintSubjects(a, b, \"UIHorizontalProportionConstraint\"),\n options.priority,\n options.relation,\n options.orientation,\n );\n\n this.proportionInternal = options.proportion ?? 1;\n\n this.constraint = this.solverWrapper.createConstraint(\n new UIExpression(0),\n this.buildRHS(),\n this.relationInternal,\n this.priorityInternal,\n this.isConstraintEnabled(),\n );\n }\n\n /**\n * Gets the current proportion value being enforced.\n * @returns The proportion ratio (elementA.width * proportion = elementB.width)\n */\n public get proportion(): number {\n return this.proportionInternal;\n }\n\n /**\n * Sets a new proportion value and updates the constraint equation.\n * @param value - The new proportion ratio\n */\n public set proportion(value: number) {\n if (this.proportionInternal !== value) {\n this.proportionInternal = value;\n this.solverWrapper.setConstraintRHS(this.constraint, this.buildRHS());\n }\n }\n\n /**\n * Builds the right-hand side expression for the constraint equation.\n *\n * Creates the expression: (elementA.width * proportion) - elementB.width = 0\n * This enforces the relationship: elementA.width * proportion = elementB.width\n *\n * @returns The UIExpression representing the proportional width relationship\n */\n private buildRHS(): UIExpression {\n return UIExpression.minus(\n new UIExpression(0, [[this.a.wVariable, this.proportionInternal]]),\n new UIExpression(0, [[this.b.wVariable, 1]]),\n );\n }\n}\n","import type { UIPlaneElement, UIPointElement } from \"../miscellaneous/asserts\";\nimport {\n assertValidConstraintSubjects,\n isUIPlaneElement,\n isUIPointElement,\n} from \"../miscellaneous/asserts\";\nimport { UIExpression } from \"../miscellaneous/UIExpression\";\nimport type { UISingleParameterConstraintOptions } from \"./UISingleParameterConstraint\";\nimport { UISingleParameterConstraint } from \"./UISingleParameterConstraint\";\n\n/** Default anchor point (0.5 = center) for elements when not specified. */\nconst DEFAULT_ANCHOR = 0.5;\n\n/**\n * Configuration options for UIVerticalDistanceConstraint creation.\n */\nexport interface UIVerticalDistanceConstraintOptions\n extends UISingleParameterConstraintOptions {\n /** Anchor point for element A (0.0 = top edge, 0.5 = center, 1.0 = bottom edge). */\n anchorA: number;\n /** Anchor point for element B (0.0 = top edge, 0.5 = center, 1.0 = bottom edge). */\n anchorB: number;\n /** The desired vertical distance between the elements. */\n distance: number;\n}\n\n/**\n * Constraint that enforces vertical distance between two UI elements.\n *\n * UIVerticalDistanceConstraint creates a mathematical relationship that maintains\n * a specific vertical distance between two elements using configurable anchor points.\n * For plane elements, anchors determine the reference point (0.0 = top, 0.5 = center, 1.0 = bottom).\n * For point elements, the anchor is always the element's position. The constraint equation is:\n * (elementB.y + elementB.height * anchorB) - (elementA.y + elementA.height * anchorA) = distance\n *\n * @see {@link UISingleParameterConstraint} - Base class for single-parameter constraints\n * @see {@link UIPointElement} - Point elements that can be constrained\n * @see {@link UIPlaneElement} - Plane elements that can be constrained\n * @see {@link UIExpression} - Mathematical expressions for constraint equations\n */\nexport class UIVerticalDistanceConstraint extends UISingleParameterConstraint {\n /** The constraint descriptor managed by the solver system. */\n protected override readonly constraint: number;\n\n /** Internal storage for element A's anchor point. */\n private anchorAInternal: number;\n /** Internal storage for element B's anchor point. */\n private anchorBInternal: number;\n /** Internal storage for the vertical distance value. */\n private distanceInternal: number;\n\n /**\n * Creates a new UIVerticalDistanceConstraint instance.\n *\n * The constraint will use default anchor points (0.5 = center) and zero distance\n * if not specified in options. Both elements must be from the same layer.\n *\n * @param a - The first UI element (point or plane element)\n * @param b - The second UI element (point or plane element)\n * @param options - Configuration options for the constraint\n * @throws Will throw an error if elements are not from the same layer\n * @see {@link assertValidConstraintSubjects}\n */\n constructor(\n private readonly a: UIPointElement | UIPlaneElement,\n private readonly b: UIPointElement | UIPlaneElement,\n options: Partial<UIVerticalDistanceConstraintOptions> = {},\n ) {\n super(\n assertValidConstraintSubjects(a, b, \"UIVerticalDistanceConstraint\"),\n options.priority,\n options.relation,\n options.orientation,\n );\n\n this.anchorAInternal = options.anchorA ?? DEFAULT_ANCHOR;\n this.anchorBInternal = options.anchorB ?? DEFAULT_ANCHOR;\n this.distanceInternal = options.distance ?? 0;\n\n this.constraint = this.solverWrapper.createConstraint(\n this.buildLHS(),\n new UIExpression(this.distanceInternal),\n this.relationInternal,\n this.priorityInternal,\n this.isConstraintEnabled(),\n );\n }\n\n /**\n * Gets the current vertical distance being enforced.\n * @returns The vertical distance in pixels\n */\n public get distance(): number {\n return this.distanceInternal;\n }\n\n /**\n * Gets the anchor point for element A.\n * @returns The anchor value (0.0 = top, 0.5 = center, 1.0 = bottom)\n */\n public get anchorA(): number {\n return this.anchorAInternal;\n }\n\n /**\n * Gets the anchor point for element B.\n * @returns The anchor value (0.0 = top, 0.5 = center, 1.0 = bottom)\n */\n public get anchorB(): number {\n return this.anchorBInternal;\n }\n\n /**\n * Sets a new vertical distance and updates the constraint equation.\n * @param value - The new vertical distance in pixels\n */\n public set distance(value: number) {\n if (this.distanceInternal !== value) {\n this.distanceInternal = value;\n this.solverWrapper.setConstraintRHS(\n this.constraint,\n new UIExpression(this.distanceInternal),\n );\n }\n }\n\n /**\n * Sets a new anchor point for element A and updates the constraint equation.\n * @param value - The new anchor value (0.0 = top, 0.5 = center, 1.0 = bottom)\n */\n public set anchorA(value: number) {\n if (this.anchorAInternal !== value) {\n this.anchorAInternal = value;\n this.solverWrapper.setConstraintLHS(this.constraint, this.buildLHS());\n }\n }\n\n /**\n * Sets a new anchor point for element B and updates the constraint equation.\n * @param value - The new anchor value (0.0 = top, 0.5 = center, 1.0 = bottom)\n */\n public set anchorB(value: number) {\n if (this.anchorBInternal !== value) {\n this.anchorBInternal = value;\n this.solverWrapper.setConstraintLHS(this.constraint, this.buildLHS());\n }\n }\n\n /**\n * Builds the left-hand side expression for the constraint equation.\n *\n * Creates the expression: (elementB.y + elementB.height * anchorB) - (elementA.y + elementA.height * anchorA)\n * For point elements, only the y position is used since they have no height.\n * For plane elements, the anchor determines the reference point within the element's height.\n *\n * @returns The UIExpression representing the vertical distance calculation\n */\n private buildLHS(): UIExpression {\n let aExpression: UIExpression;\n let bExpression: UIExpression;\n\n if (isUIPlaneElement(this.a)) {\n aExpression = new UIExpression(0, [\n [this.a.yVariable, 1],\n [this.a.hVariable, this.anchorAInternal],\n ]);\n } else if (isUIPointElement(this.a)) {\n aExpression = new UIExpression().plus(this.a.yVariable, 1);\n } else {\n throw new Error(\"A is not a valid element type\");\n }\n\n if (isUIPlaneElement(this.b)) {\n bExpression = new UIExpression(0, [\n [this.b.yVariable, 1],\n [this.b.hVariable, this.anchorBInternal],\n ]);\n } else if (isUIPointElement(this.b)) {\n bExpression = new UIExpression().plus(this.b.yVariable, 1);\n } else {\n throw new Error(\"B is not a valid element type\");\n }\n\n return UIExpression.minus(bExpression, aExpression);\n }\n}\n","import type { UIPlaneElement } from \"../miscellaneous/asserts\";\nimport { assertValidConstraintSubjects } from \"../miscellaneous/asserts\";\nimport { UIExpression } from \"../miscellaneous/UIExpression\";\nimport type { UISingleParameterConstraintOptions } from \"./UISingleParameterConstraint\";\nimport { UISingleParameterConstraint } from \"./UISingleParameterConstraint\";\n\n/**\n * Configuration options for UIVerticalProportionConstraint creation.\n */\nexport interface UIVerticalProportionConstraintOptions\n extends UISingleParameterConstraintOptions {\n /** The proportional relationship between element heights (elementA.height * proportion = elementB.height). */\n proportion: number;\n}\n\n/**\n * Constraint that enforces proportional height relationships between two UI elements.\n *\n * UIVerticalProportionConstraint creates a mathematical relationship that maintains\n * a proportional ratio between the heights of two plane elements. The constraint equation is:\n * elementA.height * proportion = elementB.height, which can be rearranged as:\n * elementA.height * proportion - elementB.height = 0\n *\n * This is useful for creating responsive layouts where elements need to maintain\n * specific height ratios, such as header-to-content ratios or row height proportions.\n *\n * @see {@link UISingleParameterConstraint} - Base class for single-parameter constraints\n * @see {@link UIPlaneElement} - Plane elements that can have proportional constraints applied\n * @see {@link UIExpression} - Mathematical expressions for constraint equations\n */\nexport class UIVerticalProportionConstraint extends UISingleParameterConstraint {\n /** The constraint descriptor managed by the solver system. */\n protected override readonly constraint: number;\n /** Internal storage for the current proportion value. */\n private proportionInternal: number;\n\n /**\n * Creates a new UIVerticalProportionConstraint instance.\n *\n * The constraint will enforce the relationship: elementA.height * proportion = elementB.height.\n * If no proportion is specified, it defaults to 1.0 (equal heights).\n * Both elements must be from the same layer.\n *\n * @param a - The first UI plane element (whose height will be multiplied by proportion)\n * @param b - The second UI plane element (target height for the proportion)\n * @param options - Configuration options for the constraint\n * @throws Will throw an error if elements are not from the same layer\n * @see {@link assertValidConstraintSubjects}\n */\n constructor(\n private readonly a: UIPlaneElement,\n private readonly b: UIPlaneElement,\n options: Partial<UIVerticalProportionConstraintOptions> = {},\n ) {\n super(\n assertValidConstraintSubjects(a, b, \"UIVerticalProportionConstraint\"),\n options.priority,\n options.relation,\n options.orientation,\n );\n\n this.proportionInternal = options.proportion ?? 1;\n\n this.constraint = this.solverWrapper.createConstraint(\n new UIExpression(0),\n this.buildRHS(),\n this.relationInternal,\n this.priorityInternal,\n this.isConstraintEnabled(),\n );\n }\n\n /**\n * Gets the current proportion value being enforced.\n * @returns The proportion ratio (elementA.height * proportion = elementB.height)\n */\n public get proportion(): number {\n return this.proportionInternal;\n }\n\n /**\n * Sets a new proportion value and updates the constraint equation.\n * @param value - The new proportion ratio\n */\n public set proportion(value: number) {\n if (this.proportionInternal !== value) {\n this.proportionInternal = value;\n this.solverWrapper.setConstraintRHS(this.constraint, this.buildRHS());\n }\n }\n\n /**\n * Builds the right-hand side expression for the constraint equation.\n *\n * Creates the expression: (elementA.height * proportion) - elementB.height = 0\n * This enforces the relationship: elementA.height * proportion = elementB.height\n *\n * @returns The UIExpression representing the proportional height relationship\n */\n private buildRHS(): UIExpression {\n return UIExpression.minus(\n new UIExpression(0, [[this.a.hVariable, this.proportionInternal]]),\n new UIExpression(0, [[this.b.hVariable, 1]]),\n );\n }\n}\n","import type { UILayerElement, UIPlaneElement } from \"../miscellaneous/asserts\";\nimport { UIExpression } from \"../miscellaneous/UIExpression\";\nimport type { UISingleParameterConstraintOptions } from \"./UISingleParameterConstraint\";\nimport { UISingleParameterConstraint } from \"./UISingleParameterConstraint\";\n\n/**\n * Configuration options for UIWidthConstraint creation.\n */\nexport interface UIWidthConstraintOptions\n extends UISingleParameterConstraintOptions {\n /** The desired width value for the element. */\n width: number;\n}\n\n/**\n * Constraint that enforces a specific width value for UI elements.\n *\n * UIWidthConstraint creates a mathematical relationship that fixes an element's\n * width to a constant value. The constraint equation is: element.width = width.\n * This is useful for ensuring elements maintain a specific width regardless of\n * other layout changes or for setting fixed dimensions in responsive layouts.\n *\n * @see {@link UISingleParameterConstraint} - Base class for single-parameter constraints\n * @see {@link UIPlaneElement} - Elements that can have width constraints applied\n * @see {@link UIExpression} - Mathematical expressions for constraint equations\n */\nexport class UIWidthConstraint extends UISingleParameterConstraint {\n /** The constraint descriptor managed by the solver system. */\n protected override readonly constraint: number;\n\n /** Internal storage for the current width value. */\n private widthInternal: number;\n\n /**\n * Creates a new UIWidthConstraint instance.\n *\n * If no width is specified in options, the constraint will use the\n * element's current width as the target width value.\n *\n * @param element - The UI element to apply the width constraint to\n * @param options - Configuration options for the constraint\n */\n constructor(\n private readonly element: UIPlaneElement & UILayerElement,\n options: Partial<UIWidthConstraintOptions> = {},\n ) {\n super(\n element.layer,\n options.priority,\n options.relation,\n options.orientation,\n );\n\n this.widthInternal = options.width ?? element.width;\n\n this.constraint = this.solverWrapper.createConstraint(\n new UIExpression(0, [[this.element.wVariable, 1]]),\n new UIExpression(this.widthInternal),\n this.relation,\n this.priority,\n this.isConstraintEnabled(),\n );\n }\n\n /**\n * Gets the current width value being enforced.\n * @returns The width value in pixels\n */\n public get width(): number {\n return this.widthInternal;\n }\n\n /**\n * Sets a new width value and updates the constraint equation.\n * @param value - The new width value in pixels\n */\n public set width(value: number) {\n if (this.widthInternal !== value) {\n this.widthInternal = value;\n this.solverWrapper.setConstraintRHS(\n this.constraint,\n new UIExpression(value),\n );\n }\n }\n}\n","import { UIHeightConstraint } from \"../constraints/UIHeightConstraint\";\nimport { UIHorizontalDistanceConstraint } from \"../constraints/UIHorizontalDistanceConstraint\";\nimport { UIHorizontalProportionConstraint } from \"../constraints/UIHorizontalProportionConstraint\";\nimport { UIVerticalDistanceConstraint } from \"../constraints/UIVerticalDistanceConstraint\";\nimport { UIVerticalProportionConstraint } from \"../constraints/UIVerticalProportionConstraint\";\nimport { UIWidthConstraint } from \"../constraints/UIWidthConstraint\";\nimport type { UIElement } from \"../elements/UIElement\";\nimport type { UIPlaneElement, UIPointElement } from \"../miscellaneous/asserts\";\nimport type { UIOrientation } from \"../miscellaneous/UIOrientation\";\nimport type { UIPriority } from \"../miscellaneous/UIPriority\";\nimport type { UIRelation } from \"../miscellaneous/UIRelation\";\n\n/**\n * Generic 2D type for specifying horizontal and vertical values.\n *\n * This interface allows configuration of properties that can have\n * different values for horizontal and vertical directions.\n *\n * @template T - The type of values for horizontal and vertical properties\n */\ninterface UIType2D<T> {\n /** Horizontal (x-axis) value. */\n h?: T;\n /** Vertical (y-axis) value. */\n v?: T;\n}\n\n/**\n * Base options for 2D constraint configuration.\n */\ninterface UIConstraint2DOptions {\n /** Priority levels for horizontal and vertical constraints. */\n priority: UIType2D<UIPriority>;\n /** Mathematical relations for horizontal and vertical constraints. */\n relation: UIType2D<UIRelation>;\n /** Orientation settings for horizontal and vertical constraints. */\n orientation: UIType2D<UIOrientation>;\n}\n\n/**\n * Configuration options for 2D size constraints.\n */\nexport interface UIConstraintSize2DOptions extends UIConstraint2DOptions {\n /** Size values for horizontal (width) and vertical (height) dimensions. */\n size: UIType2D<number>;\n}\n\n/**\n * Configuration options for 2D distance constraints.\n */\nexport interface UIConstraintDistance2DOptions extends UIConstraint2DOptions {\n /** Anchor points for element A in horizontal and vertical directions. */\n anchorA: UIType2D<number>;\n /** Anchor points for element B in horizontal and vertical directions. */\n anchorB: UIType2D<number>;\n /** Distance values for horizontal and vertical spacing. */\n distance: UIType2D<number>;\n}\n\n/**\n * Configuration options for 2D proportion constraints.\n */\nexport interface UIConstraintProportion2DOptions extends UIConstraint2DOptions {\n /** Proportion ratios for horizontal and vertical relationships. */\n proportion: UIType2D<number>;\n}\n\n/**\n * Result object containing horizontal and vertical constraint instances.\n *\n * @template TH - The type of the horizontal constraint\n * @template TV - The type of the vertical constraint\n */\nexport interface UIConstraint2DResult<TH, TV> {\n /** The horizontal constraint instance. */\n h: TH;\n /** The vertical constraint instance. */\n v: TV;\n}\n\n/**\n * Builder utility for creating paired horizontal and vertical constraints.\n *\n * UIConstraint2DBuilder simplifies the creation of constraint pairs that work\n * together to define 2D relationships between UI elements. Instead of manually\n * creating separate horizontal and vertical constraints, this builder allows\n * you to specify both dimensions at once with a unified interface.\n *\n * This is particularly useful for creating consistent spacing, sizing, and\n * proportional relationships across both axes simultaneously.\n *\n * @see {@link UIWidthConstraint} - Horizontal size constraints\n * @see {@link UIHeightConstraint} - Vertical size constraints\n * @see {@link UIHorizontalDistanceConstraint} - Horizontal spacing constraints\n * @see {@link UIVerticalDistanceConstraint} - Vertical spacing constraints\n */\nexport class UIConstraint2DBuilder {\n /**\n * Creates paired width and height constraints for an element.\n *\n * This method generates both horizontal (width) and vertical (height)\n * size constraints simultaneously, allowing you to set fixed dimensions\n * for both axes with a single call.\n *\n * @param element - The UI element to apply size constraints to\n * @param options - Configuration options for both width and height constraints\n * @returns Object containing the created width and height constraint instances\n */\n public static size(\n element: UIElement,\n options: Partial<UIConstraintSize2DOptions> = {},\n ): UIConstraint2DResult<UIWidthConstraint, UIHeightConstraint> {\n return {\n h: new UIWidthConstraint(element, {\n width: options.size?.h,\n priority: options.priority?.h,\n relation: options.relation?.h,\n orientation: options.orientation?.h,\n }),\n v: new UIHeightConstraint(element, {\n height: options.size?.v,\n priority: options.priority?.v,\n relation: options.relation?.v,\n orientation: options.orientation?.v,\n }),\n };\n }\n\n /**\n * Creates paired horizontal and vertical distance constraints between two elements.\n *\n * This method generates both horizontal and vertical spacing constraints\n * simultaneously, allowing you to define 2D spacing relationships with\n * configurable anchor points for both axes.\n *\n * @param a - The first UI element (point or plane element)\n * @param b - The second UI element (point or plane element)\n * @param options - Configuration options for both horizontal and vertical distance constraints\n * @returns Object containing the created horizontal and vertical distance constraint instances\n */\n public static distance(\n a: UIPointElement | UIPlaneElement,\n b: UIPointElement | UIPlaneElement,\n options: Partial<UIConstraintDistance2DOptions> = {},\n ): UIConstraint2DResult<\n UIHorizontalDistanceConstraint,\n UIVerticalDistanceConstraint\n > {\n return {\n h: new UIHorizontalDistanceConstraint(a, b, {\n anchorA: options.anchorA?.h,\n anchorB: options.anchorB?.h,\n distance: options.distance?.h,\n priority: options.priority?.h,\n relation: options.relation?.h,\n orientation: options.orientation?.h,\n }),\n v: new UIVerticalDistanceConstraint(a, b, {\n anchorA: options.anchorA?.v,\n anchorB: options.anchorB?.v,\n distance: options.distance?.v,\n priority: options.priority?.v,\n relation: options.relation?.v,\n orientation: options.orientation?.v,\n }),\n };\n }\n\n /**\n * Creates paired horizontal and vertical proportion constraints between two elements.\n *\n * This method generates both horizontal (width) and vertical (height)\n * proportion constraints simultaneously, allowing you to define proportional\n * relationships for both dimensions with a single call.\n *\n * @param a - The first UI plane element (whose dimensions will be multiplied by proportion)\n * @param b - The second UI plane element (target dimensions for the proportion)\n * @param options - Configuration options for both horizontal and vertical proportion constraints\n * @returns Object containing the created horizontal and vertical proportion constraint instances\n */\n public static proportion(\n a: UIPlaneElement,\n b: UIPlaneElement,\n options: Partial<UIConstraintProportion2DOptions> = {},\n ): UIConstraint2DResult<\n UIHorizontalProportionConstraint,\n UIVerticalProportionConstraint\n > {\n return {\n h: new UIHorizontalProportionConstraint(a, b, {\n proportion: options.proportion?.h,\n priority: options.priority?.h,\n relation: options.relation?.h,\n orientation: options.orientation?.h,\n }),\n v: new UIVerticalProportionConstraint(a, b, {\n proportion: options.proportion?.v,\n priority: options.priority?.v,\n relation: options.relation?.v,\n orientation: options.orientation?.v,\n }),\n };\n }\n}\n","import type { UILayerElement, UIPlaneElement } from \"../miscellaneous/asserts\";\nimport { UIExpression } from \"../miscellaneous/UIExpression\";\nimport type { UISingleParameterConstraintOptions } from \"./UISingleParameterConstraint\";\nimport { UISingleParameterConstraint } from \"./UISingleParameterConstraint\";\n\n/**\n * Configuration options for UIAspectConstraint creation.\n */\nexport interface UIAspectConstraintOptions\n extends UISingleParameterConstraintOptions {\n /** The desired aspect ratio (width/height) for the element. */\n aspect: number;\n}\n\n/**\n * Constraint that maintains a specific aspect ratio for UI elements.\n *\n * UIAspectConstraint enforces a mathematical relationship between an element's\n * width and height to maintain a constant aspect ratio. The constraint equation\n * is: width = height * aspect. This is useful for ensuring elements maintain\n * their proportions during layout changes or for enforcing specific aspect\n * ratios like 16:9 for video content.\n *\n * @see {@link UISingleParameterConstraint} - Base class for single-parameter constraints\n * @see {@link UIPlaneElement} - Elements that can have aspect constraints applied\n * @see {@link UIExpression} - Mathematical expressions for constraint equations\n */\nexport class UIAspectConstraint extends UISingleParameterConstraint {\n /** The constraint descriptor managed by the solver system. */\n protected override readonly constraint: number;\n\n /** Internal storage for the current aspect ratio value. */\n private aspectInternal: number;\n\n /**\n * Creates a new UIAspectConstraint instance.\n *\n * If no aspect ratio is specified in options, the constraint will use the\n * element's current width-to-height ratio as the target aspect ratio.\n *\n * @param element - The UI element to apply the aspect constraint to\n * @param options - Configuration options for the constraint\n */\n constructor(\n private readonly element: UIPlaneElement & UILayerElement,\n options: Partial<UIAspectConstraintOptions> = {},\n ) {\n super(\n element.layer,\n options.priority,\n options.relation,\n options.orientation,\n );\n\n this.aspectInternal = options.aspect ?? element.width / element.height;\n\n this.constraint = this.solverWrapper.createConstraint(\n this.buildLHS(),\n new UIExpression(0),\n this.relation,\n this.priority,\n this.isConstraintEnabled(),\n );\n }\n\n /**\n * Gets the current aspect ratio being enforced.\n * @returns The aspect ratio (width/height)\n */\n public get aspect(): number {\n return this.aspectInternal;\n }\n\n /**\n * Sets a new aspect ratio and updates the constraint equation.\n * @param value - The new aspect ratio (width/height)\n */\n public set aspect(value: number) {\n if (this.aspectInternal !== value) {\n this.aspectInternal = value;\n this.solverWrapper.setConstraintLHS(this.constraint, this.buildLHS());\n }\n }\n\n /**\n * Builds the left-hand side expression for the constraint equation.\n *\n * Creates the expression: width - (height * aspect) = 0\n * This enforces the relationship: width = height * aspect\n *\n * @returns The UIExpression representing the constraint equation\n */\n private buildLHS(): UIExpression {\n return new UIExpression(0, [\n [this.element.wVariable, 1],\n [this.element.hVariable, -this.aspectInternal],\n ]);\n }\n}\n","import { UIAspectConstraint } from \"../constraints/UIAspectConstraint\";\nimport { UIHorizontalDistanceConstraint } from \"../constraints/UIHorizontalDistanceConstraint\";\nimport { UIHorizontalProportionConstraint } from \"../constraints/UIHorizontalProportionConstraint\";\nimport { UIVerticalDistanceConstraint } from \"../constraints/UIVerticalDistanceConstraint\";\nimport { UIVerticalProportionConstraint } from \"../constraints/UIVerticalProportionConstraint\";\nimport type { UILayerElement, UIPlaneElement } from \"../miscellaneous/asserts\";\nimport { type UIOrientation } from \"../miscellaneous/UIOrientation\";\nimport { UIPriority } from \"../miscellaneous/UIPriority\";\nimport { UIRelation } from \"../miscellaneous/UIRelation\";\n\nconst DEFAULT_ANCHOR = 0.5;\n\n/**\n * Configuration options for the UICoverConstraintBuilder.\n */\nexport interface UICoverConstraintBuilderOptions {\n /** Whether to maintain the aspect ratio of the active (content) element */\n keepActiveAspect: boolean;\n /** Horizontal anchor point (0.0 = left, 0.5 = center, 1.0 = right) */\n anchorH: number;\n /** Vertical anchor point (0.0 = top, 0.5 = center, 1.0 = bottom) */\n anchorV: number;\n /** Orientation context for constraint calculations */\n orientation: UIOrientation;\n}\n\n/**\n * Builder for creating \"cover\" layout constraints that make an element cover its container.\n *\n * Cover layout ensures the active element is large enough to completely cover the passive\n * element while maintaining proportions. This is similar to CSS `background-size: cover`\n * or `object-fit: cover` behavior.\n *\n * The active element will be:\n * - Positioned at the specified anchor point within the passive element\n * - Sized to be at least as large as the passive element in both dimensions\n * - Scaled proportionally to maintain aspect ratio (if enabled)\n *\n * The constraints ensure: passive.dimension * 1 ≤ active.dimension (active covers passive)\n */\nexport class UICoverConstraintBuilder {\n /**\n * Creates a set of constraints for cover layout behavior.\n *\n * @param passive - The container element (what gets covered)\n * @param active - The content element (what does the covering)\n * @param options - Configuration options for the cover layout\n * @returns Object containing all created constraints\n */\n public static build(\n passive: UIPlaneElement,\n active: UIPlaneElement & UILayerElement,\n options: Partial<UICoverConstraintBuilderOptions> = {},\n ): {\n /** Aspect constraint for the active element (if keepActiveAspect is true) */\n activeAspectConstraint?: UIAspectConstraint;\n /** Horizontal positioning constraint */\n xConstraint: UIHorizontalDistanceConstraint;\n /** Vertical positioning constraint */\n yConstraint: UIVerticalDistanceConstraint;\n /** Width proportion constraint (ensures coverage) */\n widthConstraint: UIHorizontalProportionConstraint;\n /** Height proportion constraint (ensures coverage) */\n heightConstraint: UIVerticalProportionConstraint;\n } {\n let activeAspectConstraint: UIAspectConstraint | undefined;\n if (options.keepActiveAspect === true) {\n activeAspectConstraint = new UIAspectConstraint(active, {\n orientation: options.orientation,\n });\n }\n\n const xConstraint = new UIHorizontalDistanceConstraint(passive, active, {\n anchorA: options.anchorH ?? DEFAULT_ANCHOR,\n anchorB: options.anchorH ?? DEFAULT_ANCHOR,\n orientation: options.orientation,\n });\n\n const yConstraint = new UIVerticalDistanceConstraint(passive, active, {\n anchorA: options.anchorV ?? DEFAULT_ANCHOR,\n anchorB: options.anchorV ?? DEFAULT_ANCHOR,\n orientation: options.orientation,\n });\n\n const widthConstraint = new UIHorizontalProportionConstraint(\n passive,\n active,\n {\n proportion: 1,\n relation: UIRelation.GREATER_THAN,\n orientation: options.orientation,\n },\n );\n\n const heightConstraint = new UIVerticalProportionConstraint(\n passive,\n active,\n {\n proportion: 1,\n priority: UIPriority.P1,\n orientation: options.orientation,\n },\n );\n\n return {\n activeAspectConstraint,\n xConstraint,\n yConstraint,\n widthConstraint,\n heightConstraint,\n };\n }\n}\n","import { UIAspectConstraint } from \"../constraints/UIAspectConstraint\";\nimport { UIHorizontalDistanceConstraint } from \"../constraints/UIHorizontalDistanceConstraint\";\nimport { UIHorizontalProportionConstraint } from \"../constraints/UIHorizontalProportionConstraint\";\nimport { UIVerticalDistanceConstraint } from \"../constraints/UIVerticalDistanceConstraint\";\nimport { UIVerticalProportionConstraint } from \"../constraints/UIVerticalProportionConstraint\";\nimport type { UILayerElement, UIPlaneElement } from \"../miscellaneous/asserts\";\nimport { type UIOrientation } from \"../miscellaneous/UIOrientation\";\nimport { UIPriority } from \"../miscellaneous/UIPriority\";\nimport { UIRelation } from \"../miscellaneous/UIRelation\";\n\nconst DEFAULT_ANCHOR = 0.5;\n\n/**\n * Configuration options for the UIFitConstraintBuilder.\n */\nexport interface UIFitConstraintBuilderOptions {\n /** Whether to maintain the aspect ratio of the active (content) element */\n keepActiveAspect: boolean;\n /** Horizontal anchor point (0.0 = left, 0.5 = center, 1.0 = right) */\n anchorH: number;\n /** Vertical anchor point (0.0 = top, 0.5 = center, 1.0 = bottom) */\n anchorV: number;\n /** Orientation context for constraint calculations */\n orientation: UIOrientation;\n}\n\n/**\n * Builder for creating \"fit\" layout constraints that make an element fit within its container.\n *\n * Fit layout ensures the active element is sized to completely fit within the passive\n * element while maintaining proportions. This is similar to CSS `background-size: contain`\n * or `object-fit: contain` behavior.\n *\n * The active element will be:\n * - Positioned at the specified anchor point within the passive element\n * - Sized to fit entirely within the passive element in both dimensions\n * - Scaled proportionally to maintain aspect ratio (if enabled)\n *\n * The constraints ensure: passive.dimension * 1 ≥ active.dimension (active fits within passive)\n */\nexport class UIFitConstraintBuilder {\n /**\n * Creates a set of constraints for fit layout behavior.\n *\n * @param passive - The container element (what contains the content)\n * @param active - The content element (what gets fitted within the container)\n * @param options - Configuration options for the fit layout\n * @returns Object containing all created constraints\n */\n public static build(\n passive: UIPlaneElement,\n active: UIPlaneElement & UILayerElement,\n options: Partial<UIFitConstraintBuilderOptions> = {},\n ): {\n /** Aspect constraint for the active element (if keepActiveAspect is true) */\n activeAspectConstraint?: UIAspectConstraint;\n /** Horizontal positioning constraint */\n xConstraint: UIHorizontalDistanceConstraint;\n /** Vertical positioning constraint */\n yConstraint: UIVerticalDistanceConstraint;\n /** Width proportion constraint (ensures fitting) */\n widthConstraint: UIHorizontalProportionConstraint;\n /** Height proportion constraint (ensures fitting) */\n heightConstraint: UIVerticalProportionConstraint;\n } {\n let activeAspectConstraint: UIAspectConstraint | undefined;\n if (options.keepActiveAspect === true) {\n activeAspectConstraint = new UIAspectConstraint(active, {\n orientation: options.orientation,\n });\n }\n\n const xConstraint = new UIHorizontalDistanceConstraint(passive, active, {\n anchorA: options.anchorH ?? DEFAULT_ANCHOR,\n anchorB: options.anchorH ?? DEFAULT_ANCHOR,\n orientation: options.orientation,\n });\n\n const yConstraint = new UIVerticalDistanceConstraint(passive, active, {\n anchorA: options.anchorV ?? DEFAULT_ANCHOR,\n anchorB: options.anchorV ?? DEFAULT_ANCHOR,\n orientation: options.orientation,\n });\n\n const widthConstraint = new UIHorizontalProportionConstraint(\n passive,\n active,\n {\n proportion: 1,\n relation: UIRelation.LESS_THAN,\n orientation: options.orientation,\n },\n );\n\n const heightConstraint = new UIVerticalProportionConstraint(\n passive,\n active,\n {\n proportion: 1,\n priority: UIPriority.P1,\n orientation: options.orientation,\n },\n );\n\n return {\n activeAspectConstraint,\n xConstraint,\n yConstraint,\n widthConstraint,\n heightConstraint,\n };\n }\n}\n","import type { UILayer } from \"../layers/UILayer\";\nimport type { UIExpression } from \"../miscellaneous/UIExpression\";\nimport type { UISingleParameterConstraintOptions } from \"./UISingleParameterConstraint\";\nimport { UISingleParameterConstraint } from \"./UISingleParameterConstraint\";\n\n/**\n * Constraint that allows custom mathematical relationships between UI elements.\n *\n * UICustomConstraint provides maximum flexibility by allowing direct specification\n * of the left-hand side (LHS) and right-hand side (RHS) expressions for constraint\n * equations. This enables creation of complex mathematical relationships that may\n * not be covered by the specialized constraint types. The constraint equation is:\n * LHS relation RHS (e.g., LHS = RHS, LHS ≤ RHS, or LHS ≥ RHS)\n *\n * This is useful for implementing custom layout logic, complex mathematical\n * relationships between multiple elements, or prototype new constraint types.\n *\n * @see {@link UISingleParameterConstraint} - Base class for single-parameter constraints\n * @see {@link UIExpression} - Mathematical expressions for constraint equations\n * @see {@link UILayer} - Container layer for constraints\n */\nexport class UICustomConstraint extends UISingleParameterConstraint {\n /** The constraint descriptor managed by the solver system. */\n protected override readonly constraint: number;\n /** Internal storage for the left-hand side expression. */\n private lhsInternal: UIExpression;\n /** Internal storage for the right-hand side expression. */\n private rhsInternal: UIExpression;\n\n /**\n * Creates a new UICustomConstraint instance with custom expressions.\n *\n * The constraint will enforce the relationship: LHS relation RHS, where\n * the relation is determined by the options (defaults to equality).\n *\n * @param layer - The UI layer that contains this constraint\n * @param lhs - The left-hand side expression of the constraint equation\n * @param rhs - The right-hand side expression of the constraint equation\n * @param options - Configuration options for the constraint\n */\n constructor(\n layer: UILayer,\n lhs: UIExpression,\n rhs: UIExpression,\n options: Partial<UISingleParameterConstraintOptions> = {},\n ) {\n super(layer, options.priority, options.relation, options.orientation);\n\n this.lhsInternal = lhs;\n this.rhsInternal = rhs;\n\n this.constraint = this.solverWrapper.createConstraint(\n this.lhsInternal,\n this.rhsInternal,\n this.relation,\n this.priority,\n this.isConstraintEnabled(),\n );\n }\n\n /**\n * Gets the current left-hand side expression.\n * @returns The LHS expression of the constraint equation\n */\n public get lhs(): UIExpression {\n return this.lhsInternal;\n }\n\n /**\n * Gets the current right-hand side expression.\n * @returns The RHS expression of the constraint equation\n */\n public get rhs(): UIExpression {\n return this.rhsInternal;\n }\n\n /**\n * Sets a new left-hand side expression and updates the constraint.\n * @param value - The new LHS expression for the constraint equation\n */\n public setLHS(value: UIExpression): void {\n this.lhsInternal = value;\n this.solverWrapper.setConstraintLHS(this.constraint, this.lhsInternal);\n }\n\n /**\n * Sets a new right-hand side expression and updates the constraint.\n * @param value - The new RHS expression for the constraint equation\n */\n public setRHS(value: UIExpression): void {\n this.rhsInternal = value;\n this.solverWrapper.setConstraintRHS(this.constraint, this.rhsInternal);\n }\n}\n","import { Eventail } from \"eventail\";\nimport type { UILayer } from \"../layers/UILayer\";\nimport type { UIPointElement } from \"../miscellaneous/asserts\";\nimport { assertValidNumber } from \"../miscellaneous/asserts\";\nimport { UIPriority } from \"../miscellaneous/UIPriority\";\nimport type { UISolverWrapper } from \"../wrappers/UISolverWrapper\";\n\n/**\n * Base class representing a minimal UI element as a point in 2D space.\n *\n * A UIAnchor serves as the fundamental building block for UI layout systems,\n * representing a single point with x and y coordinates. It provides constraint-based\n * positioning through solver variables and serves as an anchor point for more\n * complex UI elements.\n *\n * @see {@link UIPointElement} - Interface defining point element behavior\n * @see {@link UILayer} - Container layer for UI elements\n * @see {@link UISolverWrapper} - Constraint solver integration\n */\nexport class UIAnchor extends Eventail implements UIPointElement {\n /** Optional name identifier for the anchor. */\n public name = \"\";\n\n /**\n * Solver variable descriptor for the x-coordinate.\n * This variable is managed by the constraint solver system.\n */\n public readonly xVariable: number;\n\n /**\n * Solver variable descriptor for the y-coordinate.\n * This variable is managed by the constraint solver system.\n */\n public readonly yVariable: number;\n\n /**\n * Reference to the constraint solver wrapper for variable management.\n * @see {@link UISolverWrapper}\n */\n protected readonly solverWrapper: UISolverWrapper;\n\n /**\n * Creates a new UIAnchor instance.\n *\n * @param layer - The UI layer that contains this anchor\n * @param x - Initial x-coordinate position\n * @param y - Initial y-coordinate position\n * @throws Will throw an error if x or y are not valid numbers\n * @see {@link assertValidNumber}\n */\n constructor(\n public readonly layer: UILayer,\n x: number,\n y: number,\n ) {\n assertValidNumber(x, \"UIAnchor x\");\n assertValidNumber(y, \"UIAnchor y\");\n\n super();\n this.solverWrapper = this.layer[\"getSolverWrapperInternal\"]();\n this.xVariable = this.solverWrapper.createVariable(x, UIPriority.P7);\n this.yVariable = this.solverWrapper.createVariable(y, UIPriority.P7);\n }\n\n /**\n * Gets the current x-coordinate value from the solver.\n * @returns The current x-coordinate position\n */\n public get x(): number {\n return this.solverWrapper.readVariableValue(this.xVariable);\n }\n\n /**\n * Gets the current y-coordinate value from the solver.\n * @returns The current y-coordinate position\n */\n public get y(): number {\n return this.solverWrapper.readVariableValue(this.yVariable);\n }\n\n /**\n * Sets the x-coordinate value through the solver system.\n * @param value - The new x-coordinate value\n * @throws Will throw an error if value is not a valid number\n * @see {@link assertValidNumber}\n */\n public set x(value: number) {\n assertValidNumber(value, \"UIAnchor x\");\n this.solverWrapper.suggestVariableValue(this.xVariable, value);\n }\n\n /**\n * Sets the y-coordinate value through the solver system.\n * @param value - The new y-coordinate value\n * @throws Will throw an error if value is not a valid number\n * @see {@link assertValidNumber}\n */\n public set y(value: number) {\n assertValidNumber(value, \"UIAnchor y\");\n this.solverWrapper.suggestVariableValue(this.yVariable, value);\n }\n\n /**\n * Destroys the anchor by removing its solver variables.\n *\n * This method cleans up the solver variables associated with this anchor,\n * effectively removing it from the constraint solving system. After calling\n * this method, the anchor should not be used anymore.\n */\n public destroy(): void {\n this.solverWrapper.removeVariable(this.yVariable);\n this.solverWrapper.removeVariable(this.xVariable);\n }\n}\n","/**\n * Events that can be emitted by UI elements.\n */\nexport enum UIInputEvent {\n DOWN = \"pointerdown\",\n MOVE = \"pointermove\",\n UP = \"pointerup\",\n ENTER = \"pointerenter\",\n LEAVE = \"pointerleave\",\n}\n","/**\n * Defines the anchor mode for UIMicro, determining which transformations are applied around the anchor point.\n */\nexport enum UIMicroAnchorMode {\n /** Rotation and scaling are applied around the anchor point */\n ROTATION_SCALE = 0,\n /** Position, rotation, and scaling transformations are all applied around the anchor point */\n POSITION_ROTATION_SCALE = 1,\n}\n","import { Eventail } from \"eventail\";\nimport { MathUtils } from \"three\";\nimport { UIMicroAnchorMode } from \"./UIMicroAnchorMode\";\n\nexport enum UIMicroEvent {\n CHANGE = 0,\n}\n\n/** Default position value for x and y coordinates. */\nconst DEFAULT_POSITION = 0;\n/** Default anchor point value for anchorX and anchorY. */\nconst DEFAULT_ANCHOR = 0.5;\n/** Default scale value for scaleX and scaleY. */\nconst DEFAULT_SCALE = 1;\n/** Default rotation value in radians. */\nconst DEFAULT_ROTATION = 0;\n\n/**\n * Micro-transformation system for non-constraint based UI element adjustments.\n *\n * UIMicro provides a lightweight transformation system that operates independently\n * of the constraint solver. It manages position offsets, anchor points, scaling,\n * and rotation transformations that can be applied to UI elements for animations,\n * visual effects, or fine-tuned positioning without affecting the constraint-based\n * layout system.\n *\n * All transformations are tracked with change detection to optimize rendering\n * performance by only recalculating when properties have actually changed.\n *\n * @see {@link UIElement} - Elements that use micro transformations\n */\nexport class UIMicro extends Eventail {\n /** Internal storage for x-coordinate offset. */\n private xInternal: number = DEFAULT_POSITION;\n /** Internal storage for y-coordinate offset. */\n private yInternal: number = DEFAULT_POSITION;\n /** Internal storage for x-axis anchor point. */\n private anchorXInternal: number = DEFAULT_ANCHOR;\n /** Internal storage for y-axis anchor point. */\n private anchorYInternal: number = DEFAULT_ANCHOR;\n /** Internal storage for x-axis scale factor. */\n private scaleXInternal: number = DEFAULT_SCALE;\n /** Internal storage for y-axis scale factor. */\n private scaleYInternal: number = DEFAULT_SCALE;\n /** Internal storage for rotation in radians. */\n private rotationInternal: number = DEFAULT_ROTATION;\n /** Internal storage for anchor mode determining which transformations are applied around the anchor point. */\n private anchorModeInternal: UIMicroAnchorMode =\n UIMicroAnchorMode.ROTATION_SCALE;\n /** Flag indicating if any transformation properties have changed. */\n private recalculationRequired = false;\n\n /**\n * Gets the x-coordinate offset for micro positioning.\n * @returns The x-offset value\n */\n public get x(): number {\n return this.xInternal;\n }\n\n /**\n * Gets the y-coordinate offset for micro positioning.\n * @returns The y-offset value\n */\n public get y(): number {\n return this.yInternal;\n }\n\n /**\n * Gets the x-axis anchor point for transformations.\n * @returns The anchor point (0.0 = left, 0.5 = center, 1.0 = right)\n */\n public get anchorX(): number {\n return this.anchorXInternal;\n }\n\n /**\n * Gets the y-axis anchor point for transformations.\n * @returns The anchor point (0.0 = top, 0.5 = center, 1.0 = bottom)\n */\n public get anchorY(): number {\n return this.anchorYInternal;\n }\n\n /**\n * Gets the x-axis scale factor.\n * @returns The scale factor (1.0 = normal size)\n */\n public get scaleX(): number {\n return this.scaleXInternal;\n }\n\n /**\n * Gets the y-axis scale factor.\n * @returns The scale factor (1.0 = normal size)\n */\n public get scaleY(): number {\n return this.scaleYInternal;\n }\n\n /**\n * Gets the uniform scale factor (maximum of scaleX and scaleY).\n * @returns The larger of the two scale factors\n */\n public get size(): number {\n return Math.max(this.scaleXInternal, this.scaleYInternal);\n }\n\n /**\n * Gets the rotation angle in degrees.\n * @returns The rotation angle in degrees\n */\n public get angle(): number {\n return MathUtils.radToDeg(this.rotationInternal);\n }\n\n /**\n * Gets the current anchor mode determining which transformations are applied around the anchor point.\n * @returns The anchor mode (ROTATION_SCALE or POSITION_ROTATION_SCALE)\n */\n public get anchorMode(): UIMicroAnchorMode {\n return this.anchorModeInternal;\n }\n\n /**\n * Gets the rotation angle in radians.\n * @returns The rotation angle in radians\n */\n public get rotation(): number {\n return this.rotationInternal;\n }\n\n /**\n * Sets the x-coordinate offset for micro positioning.\n * @param value - The new x-offset value\n */\n public set x(value: number) {\n if (value !== this.xInternal) {\n this.xInternal = value;\n this.recalculationRequired = true;\n this.emit(UIMicroEvent.CHANGE, this);\n }\n }\n\n /**\n * Sets the y-coordinate offset for micro positioning.\n * @param value - The new y-offset value\n */\n public set y(value: number) {\n if (value !== this.yInternal) {\n this.yInternal = value;\n this.recalculationRequired = true;\n this.emit(UIMicroEvent.CHANGE, this);\n }\n }\n\n /**\n * Sets the x-axis anchor point for transformations.\n * @param value - The anchor point (0.0 = left, 0.5 = center, 1.0 = right)\n */\n public set anchorX(value: number) {\n if (value !== this.anchorXInternal) {\n this.anchorXInternal = value;\n this.recalculationRequired = true;\n this.emit(UIMicroEvent.CHANGE, this);\n }\n }\n\n /**\n * Sets the y-axis anchor point for transformations.\n * @param value - The anchor point (0.0 = top, 0.5 = center, 1.0 = bottom)\n */\n public set anchorY(value: number) {\n if (value !== this.anchorYInternal) {\n this.anchorYInternal = value;\n this.recalculationRequired = true;\n this.emit(UIMicroEvent.CHANGE, this);\n }\n }\n\n /**\n * Sets the x-axis scale factor.\n * @param value - The scale factor (1.0 = normal size)\n */\n public set scaleX(value: number) {\n if (value !== this.scaleXInternal) {\n this.scaleXInternal = value;\n this.recalculationRequired = true;\n this.emit(UIMicroEvent.CHANGE, this);\n }\n }\n\n /**\n * Sets the y-axis scale factor.\n * @param value - The scale factor (1.0 = normal size)\n */\n public set scaleY(value: number) {\n if (value !== this.scaleYInternal) {\n this.scaleYInternal = value;\n this.recalculationRequired = true;\n this.emit(UIMicroEvent.CHANGE, this);\n }\n }\n\n /**\n * Sets both scale factors to the same value for uniform scaling.\n * @param value - The uniform scale factor (1.0 = normal size)\n */\n public set size(value: number) {\n if (value !== this.scaleXInternal || value !== this.scaleYInternal) {\n this.scaleXInternal = value;\n this.scaleYInternal = value;\n this.recalculationRequired = true;\n this.emit(UIMicroEvent.CHANGE, this);\n }\n }\n\n /**\n * Sets the rotation angle in degrees.\n * @param value - The rotation angle in degrees\n */\n public set angle(value: number) {\n const rotation = MathUtils.degToRad(value);\n if (rotation !== this.rotationInternal) {\n this.rotationInternal = rotation;\n this.recalculationRequired = true;\n this.emit(UIMicroEvent.CHANGE, this);\n }\n }\n\n /**\n * Sets the rotation angle in radians.\n * @param value - The rotation angle in radians\n */\n public set rotation(value: number) {\n if (value !== this.rotationInternal) {\n this.rotationInternal = value;\n this.recalculationRequired = true;\n this.emit(UIMicroEvent.CHANGE, this);\n }\n }\n\n /**\n * Sets the anchor mode determining which transformations are applied around the anchor point.\n * @param value - The anchor mode (ROTATION_SCALE or POSITION_ROTATION_SCALE)\n */\n public set anchorMode(value: UIMicroAnchorMode) {\n if (value !== this.anchorModeInternal) {\n this.anchorModeInternal = value;\n this.recalculationRequired = true;\n this.emit(UIMicroEvent.CHANGE, this);\n }\n }\n\n /**\n * Resets all transformation properties to their default values.\n *\n * This method restores position (0,0), anchor (0,0), scale (1,1),\n * and rotation (0) to their initial states. Only triggers recalculation\n * if any values actually change.\n */\n public reset(): void {\n if (\n this.xInternal !== DEFAULT_POSITION ||\n this.yInternal !== DEFAULT_POSITION ||\n this.anchorXInternal !== DEFAULT_ANCHOR ||\n this.anchorYInternal !== DEFAULT_ANCHOR ||\n this.scaleXInternal !== DEFAULT_SCALE ||\n this.scaleYInternal !== DEFAULT_SCALE ||\n this.rotationInternal !== DEFAULT_ROTATION\n ) {\n this.xInternal = DEFAULT_POSITION;\n this.yInternal = DEFAULT_POSITION;\n this.anchorXInternal = DEFAULT_ANCHOR;\n this.anchorYInternal = DEFAULT_ANCHOR;\n this.scaleXInternal = DEFAULT_SCALE;\n this.scaleYInternal = DEFAULT_SCALE;\n this.rotationInternal = DEFAULT_ROTATION;\n this.recalculationRequired = true;\n this.emit(UIMicroEvent.CHANGE, this);\n }\n }\n\n public copy(value: UIMicro): void {\n if (\n this.xInternal !== value.xInternal &&\n this.yInternal !== value.yInternal &&\n this.anchorXInternal !== value.anchorXInternal &&\n this.anchorYInternal !== value.anchorYInternal &&\n this.scaleXInternal !== value.scaleXInternal &&\n this.scaleYInternal !== value.scaleYInternal &&\n this.rotationInternal !== value.rotationInternal &&\n this.anchorModeInternal !== value.anchorModeInternal\n ) {\n this.xInternal = value.xInternal;\n this.yInternal = value.yInternal;\n this.anchorXInternal = value.anchorXInternal;\n this.anchorYInternal = value.anchorYInternal;\n this.scaleXInternal = value.scaleXInternal;\n this.scaleYInternal = value.scaleYInternal;\n this.rotationInternal = value.rotationInternal;\n this.anchorModeInternal = value.anchorModeInternal;\n\n this.emit(UIMicroEvent.CHANGE, this);\n this.recalculationRequired = true;\n }\n }\n\n /**\n * Gets whether any transformation properties have changed since last reset.\n *\n * This method is used internally by the rendering system to determine\n * if transformation matrices need to be recalculated.\n *\n * @returns True if recalculation is required, false otherwise\n * @internal\n */\n protected [\"getRecalculationRequiredInternal\"](): boolean {\n return this.recalculationRequired;\n }\n\n /**\n * Resets the recalculation flag after transformations have been applied.\n *\n * This method is called internally by the rendering system after\n * transformation matrices have been updated.\n *\n * @internal\n */\n protected [\"resetRecalculationRequiredInternal\"](): void {\n this.recalculationRequired = false;\n }\n}\n","import type { WebGLRenderer } from \"three\";\nimport { Matrix4, Quaternion, Vector3 } from \"three\";\nimport type { UILayerInputListener } from \"../layers/UILayer\";\nimport { UILayerEvent, type UILayer } from \"../layers/UILayer\";\nimport type { UILayerElement, UIPlaneElement } from \"../miscellaneous/asserts\";\nimport {\n assertValidNumber,\n assertValidPositiveNumber,\n} from \"../miscellaneous/asserts\";\nimport { UIInputEvent } from \"../miscellaneous/UIInputEvent\";\nimport { UIMicro } from \"../miscellaneous/UIMicro\";\nimport { UIMicroAnchorMode } from \"../miscellaneous/UIMicroAnchorMode\";\nimport { UIMode } from \"../miscellaneous/UIMode\";\nimport { UIPriority } from \"../miscellaneous/UIPriority\";\nimport type { UISceneWrapperClientAPI } from \"../miscellaneous/UISceneWrapperClientAPI\";\nimport { UITransparencyMode } from \"../miscellaneous/UITransparencyMode\";\nimport { UIAnchor } from \"./UIAnchor\";\n\nconst position = new Vector3();\nconst quaternion = new Quaternion();\nconst scale = new Vector3();\nconst matrix = new Matrix4();\nconst axis = new Vector3(0, 0, 1);\n\n/**\n * Abstract base class for all renderable UI elements with dimensions.\n *\n * UIElement serves as the fundamental building block for all other UI elements\n * that need to be visually rendered. It extends UIAnchor with dimensional properties\n * and integrates with the Three.js rendering system through shader-based planes. This class\n * provides essential functionality for positioning, sizing, rendering, visibility,\n * z-index management, and user interaction.\n *\n * @see {@link UIAnchor} - Base class providing position functionality\n * @see {@link UIPlaneElement} - Interface defining dimensional element behavior\n * @see {@link UIMicro} - Micro-optimization utilities\n */\nexport abstract class UIElement\n extends UIAnchor\n implements UIPlaneElement, UILayerElement\n{\n /** Micro-transformation system for non-constraint based positioning, scaling, and rotation adjustments. */\n public readonly micro = new UIMicro();\n\n /**\n * Solver variable descriptor for the width dimension.\n * This variable is managed by the constraint solver system.\n */\n public readonly wVariable: number;\n\n /**\n * Solver variable descriptor for the height dimension.\n * This variable is managed by the constraint solver system.\n */\n public readonly hVariable: number;\n\n /** Internal storage for the current visibility/interaction mode. */\n protected modeInternal: UIMode = UIMode.VISIBLE;\n\n /** Internal storage for the transparency rendering mode. */\n protected transparencyInternal: UITransparencyMode = UITransparencyMode.BLEND;\n\n /** Internal storage for the z-index (depth) value. */\n protected zIndexInternal = 0;\n\n /** Optional input listener for handling user interactions when in interactive mode. */\n protected listener?: UILayerInputListener;\n\n protected isPointerInside = false;\n\n /** Client API for interacting with the scene wrapper (rendering system). */\n protected readonly sceneWrapper: UISceneWrapperClientAPI;\n /** Handle to the plane object in the rendering system. */\n protected readonly planeHandler: number;\n\n /**\n * Creates a new UIElement instance with rendering capabilities.\n *\n * @param layer - The UI layer that contains this element\n * @param x - Initial x-coordinate position\n * @param y - Initial y-coordinate position\n * @param width - Initial width dimension (must be positive)\n * @param height - Initial height dimension (must be positive)\n * @param source - GLSL shader source code for rendering this element\n * @param uniforms - Uniform values to pass to the shader\n * @throws Will throw an error if width or height are not valid positive numbers\n * @see {@link assertValidPositiveNumber}\n */\n constructor(\n layer: UILayer,\n x: number,\n y: number,\n width: number,\n height: number,\n source: string,\n uniforms: Record<string, unknown>,\n ) {\n assertValidPositiveNumber(width, \"UIElement width\");\n assertValidPositiveNumber(height, \"UIElement height\");\n\n super(layer, x, y);\n this.layer.on(UILayerEvent.WILL_RENDER, this.onWillRender, this);\n\n this.wVariable = this.solverWrapper.createVariable(width, UIPriority.P6);\n this.hVariable = this.solverWrapper.createVariable(height, UIPriority.P6);\n\n this.sceneWrapper = layer[\"getSceneWrapperClientAPI\"]();\n this.planeHandler = this.sceneWrapper.createPlane(source, uniforms);\n this.sceneWrapper.setTransparency(\n this.planeHandler,\n this.transparencyInternal,\n );\n }\n\n /**\n * Gets the current width value from the solver.\n * @returns The current width dimension\n */\n public get width(): number {\n return this.solverWrapper.readVariableValue(this.wVariable);\n }\n\n /**\n * Gets the current height value from the solver.\n * @returns The current height dimension\n */\n public get height(): number {\n return this.solverWrapper.readVariableValue(this.hVariable);\n }\n\n /**\n * Gets the current z-index (depth) value.\n * @returns The current z-index value\n */\n public get zIndex(): number {\n return this.zIndexInternal;\n }\n\n /**\n * The right edge X coordinate of this element (x + width).\n */\n public get oppositeX(): number {\n return this.x + this.width;\n }\n\n /**\n * The bottom edge Y coordinate of this element (y + height).\n */\n public get oppositeY(): number {\n return this.y + this.height;\n }\n\n /**\n * The X coordinate of the center of this element.\n */\n public get centerX(): number {\n return this.x + this.width / 2;\n }\n\n /**\n * The Y coordinate of the center of this element.\n */\n public get centerY(): number {\n return this.y + this.height / 2;\n }\n\n /**\n * Gets the current visibility and interaction mode.\n * @returns The current UIMode setting\n * @see {@link UIMode}\n */\n public get mode(): UIMode {\n return this.modeInternal;\n }\n\n /**\n * Gets the current transparency rendering mode.\n * @returns The current transparency mode\n * @see {@link UITransparencyMode}\n */\n public get transparency(): UITransparencyMode {\n return this.transparencyInternal;\n }\n\n /**\n * Sets the width value through the solver system.\n * @param value - The new width dimension (must be positive)\n * @throws Will throw an error if value is not a valid positive number\n * @see {@link assertValidPositiveNumber}\n */\n public set width(value: number) {\n assertValidPositiveNumber(value, \"UIElement width\");\n this.solverWrapper.suggestVariableValue(this.wVariable, value);\n }\n\n /**\n * Sets the height value through the solver system.\n * @param value - The new height dimension (must be positive)\n * @throws Will throw an error if value is not a valid positive number\n * @see {@link assertValidPositiveNumber}\n */\n public set height(value: number) {\n assertValidPositiveNumber(value, \"UIElement height\");\n this.solverWrapper.suggestVariableValue(this.hVariable, value);\n }\n\n /**\n * Sets the z-index (depth) value for rendering order and input handling.\n * @param value - The new z-index value\n * @throws Will throw an error if value is not a valid number\n * @see {@link assertValidNumber}\n */\n public set zIndex(value: number) {\n assertValidNumber(value, \"UIElement zIndex\");\n this.zIndexInternal = value;\n if (this.listener) {\n this.listener.zIndex = this.zIndexInternal;\n }\n }\n\n /**\n * The right edge X coordinate of this element (x + width).\n */\n public set oppositeX(value: number) {\n this.x = value - this.width;\n }\n\n /**\n * The bottom edge Y coordinate of this element (y + height).\n */\n public set oppositeY(value: number) {\n this.y = value - this.height;\n }\n\n /**\n * The X coordinate of the center of this element.\n */\n public set centerX(value: number) {\n this.x = value - this.width / 2;\n }\n\n /**\n * The Y coordinate of the center of this element.\n */\n public set centerY(value: number) {\n this.y = value - this.height / 2;\n }\n\n /**\n * Sets the current visibility and interaction mode.\n * @param value - The new UIMode setting\n * @see {@link UIMode}\n */\n public set mode(value: UIMode) {\n if (this.modeInternal !== value) {\n if (value === UIMode.INTERACTIVE) {\n this.listener = {\n catchPointerDown: this.catchPointerDown,\n catchPointerMove: this.catchPointerMove,\n catchPointerUp: this.catchPointerUp,\n zIndex: this.zIndexInternal,\n };\n this.layer[\"subscribePointerInput\"](this.listener);\n } else if (this.modeInternal === UIMode.INTERACTIVE && this.listener) {\n this.layer[\"unsubscribePointerInput\"](this.listener);\n this.listener = undefined;\n }\n\n this.modeInternal = value;\n this.sceneWrapper.setVisibility(\n this.planeHandler,\n value !== UIMode.HIDDEN,\n );\n }\n }\n\n /**\n * Sets the transparency rendering mode.\n * @param value - The new transparency mode\n * @see {@link UITransparencyMode}\n */\n public set transparency(value: UITransparencyMode) {\n this.transparencyInternal = value;\n this.sceneWrapper.setTransparency(this.planeHandler, value);\n }\n\n /**\n * Destroys the UI element by cleaning up all associated resources.\n *\n * This method removes the element from the rendering scene, cleans up\n * dimension solver variables, removes input listeners, and calls the parent\n * destroy method to clean up position variables. After calling this method,\n * the element should not be used anymore.\n */\n public override destroy(): void {\n this.layer.off(UILayerEvent.WILL_RENDER, this.onWillRender, this);\n if (this.listener) {\n this.layer[\"unsubscribePointerInput\"](this.listener);\n }\n this.solverWrapper.removeVariable(this.hVariable);\n this.solverWrapper.removeVariable(this.wVariable);\n this.sceneWrapper.destroyPlane(this.planeHandler);\n super.destroy();\n }\n\n protected readonly catchPointerDown = (\n x: number,\n y: number,\n identifier: number,\n ): boolean => {\n return this.handleInputEvent(x, y, identifier, UIInputEvent.DOWN);\n };\n\n protected readonly catchPointerMove = (\n x: number,\n y: number,\n identifier: number,\n ): boolean => {\n return this.handleInputEvent(x, y, identifier, UIInputEvent.MOVE);\n };\n\n protected readonly catchPointerUp = (\n x: number,\n y: number,\n identifier: number,\n ): boolean => {\n return this.handleInputEvent(x, y, identifier, UIInputEvent.UP);\n };\n\n protected handleInputEvent(\n x: number,\n y: number,\n identifier: number,\n inputEvent: UIInputEvent,\n ): boolean {\n const isPointerInside =\n x > this.x && x < this.oppositeX && y > this.y && y < this.oppositeY;\n\n if (isPointerInside) {\n this.emit(inputEvent, x, y, identifier, this);\n }\n\n if (this.isPointerInside && !isPointerInside) {\n this.emit(UIInputEvent.LEAVE, x, y, identifier, this);\n } else if (!this.isPointerInside && isPointerInside) {\n this.emit(UIInputEvent.ENTER, x, y, identifier, this);\n }\n\n this.isPointerInside = isPointerInside;\n return isPointerInside;\n }\n\n /**\n * Called before each render frame to update the element's transform matrix.\n * Applies micro-transformations (position, rotation, scale, anchor) and updates\n * the rendering system with the final transformation matrix.\n * @param renderer - The WebGL renderer (unused in base implementation)\n * @param deltaTime - Time since last frame in seconds (unused in base implementation)\n */\n protected onWillRender(\n // eslint-disable-next-line @typescript-eslint/no-unused-vars -- Required by UILayer event interface but not used in base implementation\n renderer: WebGLRenderer,\n // eslint-disable-next-line @typescript-eslint/no-unused-vars -- Required by UILayer event interface but not used in base implementation\n deltaTime: number,\n ): void {\n const micro = this.micro;\n\n const width = this.width * micro.scaleX;\n const height = this.height * micro.scaleY;\n\n const anchorOffsetX = micro.anchorX * width;\n const anchorOffsetY = micro.anchorY * height;\n\n const cos = Math.cos(micro.rotation);\n const sin = Math.sin(micro.rotation);\n\n const rotatedAnchorX = anchorOffsetX * cos - anchorOffsetY * sin;\n const rotatedAnchorY = anchorOffsetX * sin + anchorOffsetY * cos;\n\n if (micro.anchorMode === UIMicroAnchorMode.POSITION_ROTATION_SCALE) {\n position.x = this.x + micro.x - rotatedAnchorX;\n position.y = this.y + micro.y - rotatedAnchorY;\n } else {\n const rawAnchorOffsetX = micro.anchorX * this.width;\n const rawAnchorOffsetY = micro.anchorY * this.height;\n position.x = this.x + rawAnchorOffsetX - rotatedAnchorX + micro.x;\n position.y = this.y + rawAnchorOffsetY - rotatedAnchorY + micro.y;\n }\n\n position.z = this.zIndexInternal;\n scale.x = width;\n scale.y = height;\n quaternion.setFromAxisAngle(axis, micro.rotation);\n\n matrix.compose(position, quaternion, scale);\n this.sceneWrapper.setTransform(this.planeHandler, matrix);\n }\n}\n","import type { Matrix3, Texture } from \"three\";\nimport type { UILayer } from \"../layers/UILayer\";\nimport { UIColor, UIColorEvent } from \"../miscellaneous/UIColor\";\nimport source from \"../shaders/UIDefaultShader.glsl\";\nimport { UIElement } from \"./UIElement\";\n\nexport enum UIAnimatedImageEvent {\n PLAY = 0,\n PAUSE = 1,\n STOP = 2,\n}\n\nexport type UIAnimatedImageSequence =\n | { texture: Texture; transforms: Matrix3[] }\n | Texture[];\n\n/**\n * Configuration options for creating a UIAnimatedImage element.\n */\nexport interface UIAnimatedImageOptions {\n /** X position of the element */\n x: number;\n /** Y position of the element */\n y: number;\n /** Width of the element */\n width: number;\n /** Height of the element */\n height: number;\n /** Color tint applied to the image */\n color: UIColor;\n /** Frame rate for animation */\n frameRate: number;\n /** Whether animation should loop */\n loop: boolean;\n}\n\n/**\n * UI element for displaying textured images.\n *\n * UIAnimatedImage is a concrete implementation of UIElement that renders a textured\n * image using shader-based planes. It automatically sizes itself\n * to match the texture dimensions and provides control over visual properties\n * such as color tinting.\n *\n * @see {@link UIElement} - Base class providing UI element functionality\n * @see {@link Texture} - Three.js texture for image data\n */\nexport class UIAnimatedImage extends UIElement {\n /** Internal storage for the current texture */\n private readonly sequenceInternal: {\n texture: Texture;\n uvTransform: Matrix3;\n }[];\n\n /** Internal storage for the color tint */\n private readonly colorInternal: UIColor;\n private frameRateInternal: number;\n private loopInternal: boolean;\n\n private intervalHandler?: ReturnType<typeof setInterval> = undefined;\n private currentFrameIndex = 0;\n\n /**\n * Creates a new UIAnimatedImage instance.\n *\n * The image will automatically size itself to match the texture's dimensions.\n * All options have default values if not specified.\n *\n * @param layer - The UI layer that contains this image\n * @param texture - The Three.js texture to display\n * @param options - Configuration options for the image\n * @throws Will throw an error if the texture dimensions are not valid positive numbers\n */\n constructor(\n layer: UILayer,\n sequence: UIAnimatedImageSequence,\n options: Partial<UIAnimatedImageOptions> = {},\n ) {\n const w = options.width ?? 100;\n const h = options.height ?? 100;\n const color = options.color ?? new UIColor();\n\n let tempSequence: {\n texture: Texture;\n uvTransform: Matrix3;\n }[];\n\n if (Array.isArray(sequence)) {\n tempSequence = sequence.map((texture) => {\n texture.updateMatrix();\n return {\n texture,\n uvTransform: texture.matrix,\n };\n });\n } else {\n tempSequence = sequence.transforms.map((transform) => {\n return {\n texture: sequence.texture,\n uvTransform: transform,\n };\n });\n }\n\n super(layer, options.x ?? 0, options.y ?? 0, w, h, source, {\n map: tempSequence[0].texture,\n uvTransform: tempSequence[0].uvTransform,\n color,\n });\n\n this.sequenceInternal = tempSequence;\n this.colorInternal = color;\n const defaultFrameRate = 24;\n this.frameRateInternal = options.frameRate ?? defaultFrameRate;\n this.loopInternal = options.loop ?? true;\n this.colorInternal.on(UIColorEvent.CHANGE, this.onColorChange);\n }\n\n /**\n * Gets the current color tint applied to the image.\n * @returns The UIColor instance\n */\n public get color(): UIColor {\n return this.colorInternal;\n }\n\n /**\n * Gets the frame rate for animation.\n * @returns The frame rate in frames per second\n */\n public get frameRate(): number {\n return this.frameRateInternal;\n }\n\n /**\n * Gets whether the animation loops.\n * @returns True if animation loops\n */\n public get loop(): boolean {\n return this.loopInternal;\n }\n\n /**\n * Gets the total duration of the animation in seconds.\n * @returns The duration in seconds\n */\n public get duration(): number {\n return this.sequenceInternal.length / this.frameRateInternal;\n }\n\n /**\n * Sets the color tint applied to the image.\n * @param value - The UIColor instance\n */\n public set color(value: UIColor) {\n this.colorInternal.copy(value);\n }\n\n /**\n * Sets the frame rate for animation.\n * @param value - The frame rate in frames per second\n */\n public set frameRate(value: number) {\n if (value <= 0) {\n throw new Error(\"Frame rate must be greater than zero\");\n }\n\n const wasPlaying = this.intervalHandler !== undefined;\n if (wasPlaying) {\n this.pause();\n }\n\n this.frameRateInternal = value;\n\n if (wasPlaying) {\n this.play();\n }\n }\n\n /**\n * Sets whether the animation loops.\n * @param value - True to enable looping\n */\n public set loop(value: boolean) {\n this.loopInternal = value;\n }\n\n /**\n * Starts or resumes playback of the animation.\n */\n public play(): void {\n if (this.intervalHandler !== undefined) {\n return;\n }\n\n this.intervalHandler = setInterval(() => {\n this.currentFrameIndex++;\n\n if (this.loopInternal) {\n this.currentFrameIndex %= this.sequenceInternal.length;\n } else if (this.currentFrameIndex >= this.sequenceInternal.length) {\n this.currentFrameIndex = this.sequenceInternal.length - 1;\n this.pause();\n return;\n }\n\n this.updateFrame();\n }, 1000 / this.frameRateInternal);\n this.emit(UIAnimatedImageEvent.PLAY);\n }\n\n /**\n * Pauses the animation at the current frame.\n */\n public pause(): void {\n if (this.intervalHandler === undefined) {\n return;\n }\n\n clearInterval(this.intervalHandler);\n this.intervalHandler = undefined;\n this.emit(UIAnimatedImageEvent.PAUSE);\n }\n\n /**\n * Stops the animation and resets to the first frame.\n */\n public stop(): void {\n if (this.intervalHandler !== undefined) {\n clearInterval(this.intervalHandler);\n this.intervalHandler = undefined;\n }\n\n this.currentFrameIndex = 0;\n this.updateFrame();\n this.emit(UIAnimatedImageEvent.STOP);\n }\n\n /**\n * Destroys the UI image by cleaning up color event listeners and all associated resources.\n */\n public override destroy(): void {\n this.stop();\n this.colorInternal.off(UIColorEvent.CHANGE, this.onColorChange);\n super.destroy();\n }\n\n /** Event handler for when the color changes */\n private readonly onColorChange = (color: UIColor): void => {\n this.sceneWrapper.setUniform(this.planeHandler, \"color\", color);\n };\n\n private updateFrame(): void {\n const frame = this.sequenceInternal[this.currentFrameIndex];\n this.sceneWrapper.setUniform(this.planeHandler, \"map\", frame.texture);\n this.sceneWrapper.setUniform(\n this.planeHandler,\n \"uvTransform\",\n frame.uvTransform,\n );\n }\n}\n","import type { UILayer } from \"../layers/UILayer\";\nimport {\n assertValidPositiveNumber,\n type UIPlaneElement,\n} from \"../miscellaneous/asserts\";\nimport { UIPriority } from \"../miscellaneous/UIPriority\";\nimport { UIAnchor } from \"./UIAnchor\";\n\n/** Default width and height value for UIDummy elements. */\nconst DEFAULT_SIZE = 100;\n\nexport interface UIDummyOptions {\n x: number;\n y: number;\n width: number;\n height: number;\n}\n\n/**\n * UI element that extends UIAnchor with dimensions but without rendering.\n *\n * UIDummy represents a rectangular area in the UI layout system that has position\n * and dimensions (width and height) but does not perform any visual rendering.\n * It serves as a placeholder or spacer element in constraint-based layouts,\n * useful for defining layout structure without visual content.\n *\n * @see {@link UIAnchor} - Base class providing position functionality\n * @see {@link UIPlaneElement} - Interface defining dimensional element behavior\n * @see {@link UILayer} - Container layer for UI elements\n */\nexport class UIDummy extends UIAnchor implements UIPlaneElement {\n /**\n * Solver variable descriptor for the width dimension.\n * This variable is managed by the constraint solver system.\n */\n public readonly wVariable: number;\n\n /**\n * Solver variable descriptor for the height dimension.\n * This variable is managed by the constraint solver system.\n */\n public readonly hVariable: number;\n\n /**\n * Creates a new UIDummy instance with position and dimensions.\n *\n * @param layer - The UI layer that contains this dummy element\n * @param x - Initial x-coordinate position\n * @param y - Initial y-coordinate position\n * @param width - Initial width dimension (defaults to 100)\n * @param height - Initial height dimension (defaults to 100)\n * @throws Will throw an error if width or height are not valid positive numbers\n * @see {@link assertValidPositiveNumber}\n */\n constructor(layer: UILayer, options: Partial<UIDummyOptions> = {}) {\n const x = options.x ?? 0;\n const y = options.y ?? 0;\n const w = options.width ?? DEFAULT_SIZE;\n const h = options.height ?? DEFAULT_SIZE;\n\n assertValidPositiveNumber(w, \"UIDummy width\");\n assertValidPositiveNumber(h, \"UIDummy height\");\n\n super(layer, x, y);\n this.wVariable = this.solverWrapper.createVariable(w, UIPriority.P6);\n this.hVariable = this.solverWrapper.createVariable(h, UIPriority.P6);\n }\n\n /**\n * Gets the current width value from the solver.\n * @returns The current width dimension\n */\n public get width(): number {\n return this.solverWrapper.readVariableValue(this.wVariable);\n }\n\n /**\n * Gets the current height value from the solver.\n * @returns The current height dimension\n */\n public get height(): number {\n return this.solverWrapper.readVariableValue(this.hVariable);\n }\n\n /**\n * Sets the width value through the solver system.\n * @param value - The new width dimension (must be positive)\n * @throws Will throw an error if value is not a valid positive number\n * @see {@link assertValidPositiveNumber}\n */\n public set width(value: number) {\n assertValidPositiveNumber(value, \"UIDummy width\");\n this.solverWrapper.suggestVariableValue(this.wVariable, value);\n }\n\n /**\n * Sets the height value through the solver system.\n * @param value - The new height dimension (must be positive)\n * @throws Will throw an error if value is not a valid positive number\n * @see {@link assertValidPositiveNumber}\n */\n public set height(value: number) {\n assertValidPositiveNumber(value, \"UIDummy height\");\n this.solverWrapper.suggestVariableValue(this.hVariable, value);\n }\n\n /**\n * Destroys the dummy element by removing its solver variables.\n *\n * This method cleans up the dimension solver variables (width and height)\n * associated with this dummy element, then calls the parent destroy method\n * to clean up position variables. After calling this method, the dummy\n * element should not be used anymore.\n */\n public override destroy(): void {\n this.solverWrapper.removeVariable(this.hVariable);\n this.solverWrapper.removeVariable(this.wVariable);\n super.destroy();\n }\n}\n","import { CanvasTexture, LinearFilter } from \"three\";\nimport type { UILayer } from \"../layers/UILayer\";\nimport { UIColor, UIColorEvent } from \"../miscellaneous/UIColor\";\nimport type { UIMode } from \"../miscellaneous/UIMode\";\nimport source from \"../shaders/UIDefaultShader.glsl\";\nimport { UIElement } from \"./UIElement\";\n\n/**\n * Configuration options for creating a UIGraphics element.\n */\nexport interface UIGraphicsOptions {\n /** X position of the element */\n x: number;\n /** Y position of the element */\n y: number;\n /** Width of the canvas (default: 512) */\n width: number;\n /** Height of the canvas (default: 512) */\n height: number;\n /** Color tint applied to the graphics */\n color: UIColor;\n /** Default UIMode */\n mode: UIMode;\n}\n\n/**\n * UI element for drawing graphics using 2D canvas API.\n *\n * UIGraphics uses an OffscreenCanvas for rendering 2D graphics and converts it\n * to a Three.js texture for display. It provides access to the canvas context\n * for custom drawing operations.\n */\nexport class UIGraphics extends UIElement {\n /** OffscreenCanvas for rendering graphics */\n private readonly canvas: OffscreenCanvas;\n /** 2D rendering context */\n private readonly ctx: OffscreenCanvasRenderingContext2D;\n /** Three.js texture created from the canvas */\n private readonly canvasTexture: CanvasTexture;\n /** Internal storage for the color tint */\n private readonly colorInternal: UIColor;\n\n /**\n * Creates a new UIGraphics instance.\n *\n * @param layer - The UI layer that contains this graphics element\n * @param options - Configuration options for the graphics element\n */\n constructor(layer: UILayer, options: Partial<UIGraphicsOptions> = {}) {\n const defaultCanvasSize = 512;\n const width = options.width ?? defaultCanvasSize;\n const height = options.height ?? defaultCanvasSize;\n const color = options.color ?? new UIColor();\n\n // Create OffscreenCanvas\n const canvas = new OffscreenCanvas(width, height);\n const ctx = canvas.getContext(\"2d\");\n\n if (!ctx) {\n throw new Error(\"Failed to get 2D context from OffscreenCanvas\");\n }\n\n // Create texture from canvas\n const canvasTexture = new CanvasTexture(canvas);\n canvasTexture.minFilter = LinearFilter;\n canvasTexture.magFilter = LinearFilter;\n\n super(layer, options.x ?? 0, options.y ?? 0, width, height, source, {\n map: canvasTexture,\n uvTransform: canvasTexture.matrix,\n color,\n });\n\n this.canvas = canvas;\n this.ctx = ctx;\n this.canvasTexture = canvasTexture;\n this.colorInternal = color;\n this.colorInternal.on(UIColorEvent.CHANGE, this.onColorChange);\n\n if (options.mode !== undefined) {\n this.mode = options.mode;\n }\n }\n\n /**\n * Gets the current color tint applied to the graphics.\n */\n public get color(): UIColor {\n return this.colorInternal;\n }\n\n /**\n * Sets the color tint applied to the graphics.\n */\n public set color(value: UIColor) {\n this.colorInternal.copy(value);\n }\n\n /**\n * Clears the canvas with optional fill color.\n *\n * @param fillColor - Optional color to fill after clearing\n */\n public clear(fillColor?: UIColor): this {\n this.ctx.clearRect(0, 0, this.canvas.width, this.canvas.height);\n if (fillColor !== undefined) {\n this.ctx.fillStyle = fillColor.toCSSColor();\n this.ctx.fillRect(0, 0, this.canvas.width, this.canvas.height);\n }\n this.canvasTexture.needsUpdate = true;\n return this;\n }\n\n /**\n * Draws a rectangle on the canvas.\n */\n public rect(x: number, y: number, width: number, height: number): this {\n this.ctx.rect(x, y, width, height);\n this.canvasTexture.needsUpdate = true;\n return this;\n }\n\n /**\n * Draws a filled rectangle on the canvas.\n */\n public fillRect(x: number, y: number, width: number, height: number): this {\n this.ctx.fillRect(x, y, width, height);\n this.canvasTexture.needsUpdate = true;\n return this;\n }\n\n /**\n * Draws a stroked rectangle on the canvas.\n */\n public strokeRect(x: number, y: number, width: number, height: number): this {\n this.ctx.strokeRect(x, y, width, height);\n this.canvasTexture.needsUpdate = true;\n return this;\n }\n\n /**\n * Draws a circle on the canvas.\n */\n public circle(x: number, y: number, radius: number): this {\n this.ctx.beginPath();\n this.ctx.arc(x, y, radius, 0, Math.PI * 2);\n this.ctx.closePath();\n this.canvasTexture.needsUpdate = true;\n return this;\n }\n\n /**\n * Begins a new path.\n */\n public beginPath(): this {\n this.ctx.beginPath();\n this.canvasTexture.needsUpdate = true;\n return this;\n }\n\n /**\n * Closes the current path.\n */\n public closePath(): this {\n this.ctx.closePath();\n this.canvasTexture.needsUpdate = true;\n return this;\n }\n\n /**\n * Fills the current path.\n */\n public fill(): this {\n this.ctx.fill();\n this.canvasTexture.needsUpdate = true;\n return this;\n }\n\n /**\n * Strokes the current path.\n */\n public stroke(): this {\n this.ctx.stroke();\n this.canvasTexture.needsUpdate = true;\n return this;\n }\n\n /**\n * Moves the path to a point.\n */\n public moveTo(x: number, y: number): this {\n this.ctx.moveTo(x, y);\n return this;\n }\n\n /**\n * Draws a line to a point.\n */\n public lineTo(x: number, y: number): this {\n this.ctx.lineTo(x, y);\n this.canvasTexture.needsUpdate = true;\n return this;\n }\n\n /**\n * Sets the fill style.\n */\n public setFillStyle(style: UIColor | CanvasGradient | CanvasPattern): this {\n this.ctx.fillStyle = style instanceof UIColor ? style.toCSSColor() : style;\n return this;\n }\n\n /**\n * Sets the stroke style.\n */\n public setStrokeStyle(style: UIColor | CanvasGradient | CanvasPattern): this {\n this.ctx.strokeStyle =\n style instanceof UIColor ? style.toCSSColor() : style;\n return this;\n }\n\n /**\n * Sets the line width.\n */\n public setLineWidth(width: number): this {\n this.ctx.lineWidth = width;\n return this;\n }\n\n /**\n * Destroys the graphics element by cleaning up resources.\n */\n public override destroy(): void {\n this.colorInternal.off(UIColorEvent.CHANGE, this.onColorChange);\n this.canvasTexture.dispose();\n super.destroy();\n }\n\n /** Event handler for when the color changes */\n private readonly onColorChange = (color: UIColor): void => {\n this.sceneWrapper.setUniform(this.planeHandler, \"color\", color);\n };\n}\n","import type { Texture } from \"three\";\nimport type { UILayer } from \"../layers/UILayer\";\nimport { assertValidPositiveNumber } from \"../miscellaneous/asserts\";\nimport { UIColor, UIColorEvent } from \"../miscellaneous/UIColor\";\nimport type { UIMode } from \"../miscellaneous/UIMode\";\nimport source from \"../shaders/UIDefaultShader.glsl\";\nimport { UIElement } from \"./UIElement\";\n\n/**\n * Configuration options for creating a UIImage element.\n */\nexport interface UIImageOptions {\n /** X position of the element */\n x: number;\n /** Y position of the element */\n y: number;\n /** Width of the element */\n width: number;\n /** Height of the element */\n height: number;\n /** Color tint applied to the image */\n color: UIColor;\n /** Default UIMode */\n mode: UIMode;\n}\n\n/**\n * UI element for displaying textured images.\n *\n * UIImage is a concrete implementation of UIElement that renders a textured\n * image using shader-based planes. It automatically sizes itself\n * to match the texture dimensions and provides control over visual properties\n * such as color tinting.\n *\n * @see {@link UIElement} - Base class providing UI element functionality\n * @see {@link Texture} - Three.js texture for image data\n */\nexport class UIImage extends UIElement {\n /** Internal storage for the current texture */\n private textureInternal: Texture;\n /** Internal storage for the color tint */\n private readonly colorInternal: UIColor;\n\n /**\n * Creates a new UIImage instance.\n *\n * The image will automatically size itself to match the texture's dimensions.\n * All options have default values if not specified.\n *\n * @param layer - The UI layer that contains this image\n * @param texture - The Three.js texture to display\n * @param options - Configuration options for the image\n * @throws Will throw an error if the texture dimensions are not valid positive numbers\n */\n constructor(\n layer: UILayer,\n texture: Texture,\n options: Partial<UIImageOptions> = {},\n ) {\n const w = options.width ?? texture.image.width;\n const h = options.height ?? texture.image.height;\n\n const color = options.color ?? new UIColor();\n\n super(layer, options.x ?? 0, options.y ?? 0, w, h, source, {\n map: texture,\n uvTransform: texture.matrix,\n color,\n });\n\n this.textureInternal = texture;\n this.colorInternal = color;\n this.colorInternal.on(UIColorEvent.CHANGE, this.onColorChange);\n\n if (options.mode !== undefined) {\n this.mode = options.mode;\n }\n }\n\n /**\n * Gets the current texture being displayed.\n * @returns The current Three.js texture\n */\n public get texture(): Texture {\n return this.textureInternal;\n }\n\n /**\n * Gets the current color tint applied to the image.\n * @returns The UIColor instance\n */\n public get color(): UIColor {\n return this.colorInternal;\n }\n\n /**\n * Sets a new texture for the image.\n *\n * When setting a new texture, the image will automatically resize to match\n * the new texture's dimensions.\n *\n * @param value - The new Three.js texture to display\n * @throws Will throw an error if the texture dimensions are not valid positive numbers\n * @see {@link assertValidPositiveNumber}\n */\n public set texture(value: Texture) {\n const w = value.image.width;\n const h = value.image.height;\n\n assertValidPositiveNumber(w, \"UIImage texture width\");\n assertValidPositiveNumber(h, \"UIImage texture height\");\n\n this.solverWrapper.suggestVariableValue(this.wVariable, w);\n this.solverWrapper.suggestVariableValue(this.hVariable, h);\n\n this.textureInternal = value;\n this.sceneWrapper.setUniform(this.planeHandler, \"map\", value);\n this.sceneWrapper.setUniform(\n this.planeHandler,\n \"uvTransform\",\n value.matrix,\n );\n }\n\n /**\n * Sets the color tint applied to the image.\n * @param value - The UIColor instance\n */\n public set color(value: UIColor) {\n this.colorInternal.copy(value);\n }\n\n /**\n * Destroys the UI image by cleaning up color event listeners and all associated resources.\n */\n public override destroy(): void {\n this.colorInternal.off(UIColorEvent.CHANGE, this.onColorChange);\n super.destroy();\n }\n\n /** Event handler for when the color changes */\n private readonly onColorChange = (color: UIColor): void => {\n this.sceneWrapper.setUniform(this.planeHandler, \"color\", color);\n };\n}\n","const DEFAULT_SLICE_BORDER = 0.25;\n\nexport type UINineSliceBorders =\n | { left: number; right: number; top: number; bottom: number }\n | { horizontal: number; vertical: number }\n | number;\n\n/**\n * Resolves various nine-slice border inputs into a normalized border object.\n *\n * @param value - The border value to resolve (can be number, partial object, or full object)\n * @returns Normalized border object with left, right, top, bottom properties\n */\nexport function resolveNineSliceBorders(value: unknown): {\n l: number;\n r: number;\n t: number;\n b: number;\n} {\n // Handle null/undefined\n if (value === null || value === undefined) {\n return {\n l: DEFAULT_SLICE_BORDER,\n r: DEFAULT_SLICE_BORDER,\n t: DEFAULT_SLICE_BORDER,\n b: DEFAULT_SLICE_BORDER,\n };\n }\n\n // Handle number\n if (typeof value === \"number\") {\n return {\n l: value,\n r: value,\n t: value,\n b: value,\n };\n }\n\n // Handle object\n if (typeof value === \"object\") {\n const obj = value as Record<string, unknown>;\n\n // Handle { horizontal, vertical } format\n if (\"horizontal\" in obj && \"vertical\" in obj) {\n const horizontal =\n typeof obj.horizontal === \"number\"\n ? obj.horizontal\n : DEFAULT_SLICE_BORDER;\n const vertical =\n typeof obj.vertical === \"number\" ? obj.vertical : DEFAULT_SLICE_BORDER;\n\n return {\n l: horizontal,\n r: horizontal,\n t: vertical,\n b: vertical,\n };\n }\n\n // Handle { left, right, top, bottom } format\n const left = typeof obj.left === \"number\" ? obj.left : DEFAULT_SLICE_BORDER;\n const right =\n typeof obj.right === \"number\" ? obj.right : DEFAULT_SLICE_BORDER;\n const top = typeof obj.top === \"number\" ? obj.top : DEFAULT_SLICE_BORDER;\n const bottom =\n typeof obj.bottom === \"number\" ? obj.bottom : DEFAULT_SLICE_BORDER;\n\n return { l: left, r: right, t: top, b: bottom };\n }\n\n // Fallback to default\n return {\n l: DEFAULT_SLICE_BORDER,\n r: DEFAULT_SLICE_BORDER,\n t: DEFAULT_SLICE_BORDER,\n b: DEFAULT_SLICE_BORDER,\n };\n}\n","import type { Texture, WebGLRenderer } from \"three\";\nimport { Vector4 } from \"three\";\nimport { type UILayer } from \"../layers/UILayer\";\nimport { assertValidPositiveNumber } from \"../miscellaneous/asserts\";\nimport { UIColor, UIColorEvent } from \"../miscellaneous/UIColor\";\nimport type { UIMode } from \"../miscellaneous/UIMode\";\nimport {\n resolveNineSliceBorders,\n type UINineSliceBorders,\n} from \"../miscellaneous/UINineSliceBorder\";\nimport source from \"../shaders/UINineSliceShader.glsl\";\nimport { UIElement } from \"./UIElement\";\n\n/**\n * Configuration options for creating a UINineSlice element.\n */\nexport interface UINineSliceOptions {\n /** X position of the element */\n x: number;\n /** Y position of the element */\n y: number;\n /** Color tint applied to the nine-slice element */\n color: UIColor;\n /** Nine-slice border configuration (can be number, object with horizontal/vertical, or full border object) */\n sliceBorders: UINineSliceBorders;\n /** Default UIMode */\n mode: UIMode;\n}\n\n/**\n * Nine-slice UI element for scalable images with preserved border regions.\n *\n * Nine-slice scaling divides an image into 9 regions: 4 corners, 4 edges, and 1 center.\n * The corners maintain their original size, edges scale in one dimension, and the center\n * scales in both dimensions. This technique is commonly used for creating scalable UI\n * panels, buttons, and borders that maintain visual quality at any size.\n */\nexport class UINineSlice extends UIElement {\n /** Internal storage for the current texture */\n private readonly textureInternal: Texture;\n /** Internal storage for the color tint */\n private readonly colorInternal: UIColor;\n /** Internal storage for the nine-slice border values (left, right, top, bottom) */\n private readonly sliceBordersInternal: Vector4;\n /** Internal storage for texture and world dimensions (texture width, texture height, world width, world height) */\n private readonly dimensions: Vector4;\n\n /**\n * Creates a new nine-slice UI element.\n *\n * The element initially sizes itself to match the texture's dimensions.\n * Border regions are defined by the slice borders configuration.\n *\n * @param layer - The UI layer to add this element to\n * @param texture - The texture to use for nine-slice rendering\n * @param options - Configuration options for the nine-slice element\n * @throws Will throw an error if the texture dimensions are not valid positive numbers\n */\n constructor(\n layer: UILayer,\n texture: Texture,\n options: Partial<UINineSliceOptions> = {},\n ) {\n const width = texture.image.width;\n const height = texture.image.height;\n\n const color = options.color ?? new UIColor();\n const resolvedSliceBorders = resolveNineSliceBorders(options.sliceBorders);\n const sliceBorders = new Vector4(\n resolvedSliceBorders.l,\n resolvedSliceBorders.r,\n resolvedSliceBorders.t,\n resolvedSliceBorders.b,\n );\n const dimensions = new Vector4(width, height, width, height);\n\n super(layer, options.x ?? 0, options.y ?? 0, width, height, source, {\n map: texture,\n color,\n sliceBorders,\n dimensions,\n });\n\n this.textureInternal = texture;\n this.sliceBordersInternal = sliceBorders;\n this.dimensions = dimensions;\n\n this.colorInternal = color;\n this.colorInternal.on(UIColorEvent.CHANGE, this.onColorChange);\n\n if (options.mode !== undefined) {\n this.mode = options.mode;\n }\n }\n\n /**\n * Gets the current texture being displayed.\n * @returns The current Three.js texture\n */\n public get texture(): Texture {\n return this.textureInternal;\n }\n\n /**\n * Gets the current color tint applied to the nine-slice element.\n * @returns The UIColor instance\n */\n public get color(): UIColor {\n return this.colorInternal;\n }\n\n /**\n * Gets the left border size for nine-slice scaling.\n * @returns The left border size as a percentage (0-1) of texture width\n */\n public get sliceBorderLeft(): number {\n return this.sliceBordersInternal.x;\n }\n\n /**\n * Gets the right border size for nine-slice scaling.\n * @returns The right border size as a percentage (0-1) of texture width\n */\n public get sliceBorderRight(): number {\n return this.sliceBordersInternal.y;\n }\n\n /**\n * Gets the top border size for nine-slice scaling.\n * @returns The top border size as a percentage (0-1) of texture height\n */\n public get sliceBorderTop(): number {\n return this.sliceBordersInternal.z;\n }\n\n /**\n * Gets the bottom border size for nine-slice scaling.\n * @returns The bottom border size as a percentage (0-1) of texture height\n */\n public get sliceBorderBottom(): number {\n return this.sliceBordersInternal.w;\n }\n\n /**\n * Sets a new texture for the nine-slice element.\n *\n * When setting a new texture, the element will update its internal dimensions\n * but maintain the current world size. The nine-slice borders remain unchanged.\n *\n * @param value - The new Three.js texture to display\n * @throws Will throw an error if the texture dimensions are not valid positive numbers\n * @see {@link assertValidPositiveNumber}\n */\n public set texture(value: Texture) {\n const w = value.image.width;\n const h = value.image.height;\n\n assertValidPositiveNumber(w, \"UINineSlice texture width\");\n assertValidPositiveNumber(h, \"UINineSlice texture height\");\n\n this.solverWrapper.suggestVariableValue(this.wVariable, w);\n this.solverWrapper.suggestVariableValue(this.hVariable, h);\n\n this.dimensions.x = w;\n this.dimensions.y = h;\n this.sceneWrapper.setUniform(\n this.planeHandler,\n \"dimensions\",\n this.dimensions,\n );\n this.sceneWrapper.setUniform(this.planeHandler, \"map\", value);\n }\n\n /**\n * Sets the color tint applied to the nine-slice element.\n * @param value - The UIColor instance\n */\n public set color(value: UIColor) {\n this.colorInternal.copy(value);\n }\n\n /**\n * Sets the left border size for nine-slice scaling.\n * @param value - The left border size as a percentage (0-1) of texture width\n */\n public set sliceBorderLeft(value: number) {\n this.sliceBordersInternal.x = value;\n this.sceneWrapper.setUniform(\n this.planeHandler,\n \"sliceBorders\",\n this.sliceBordersInternal,\n );\n }\n\n /**\n * Sets the right border size for nine-slice scaling.\n * @param value - The right border size as a percentage (0-1) of texture width\n */\n public set sliceBorderRight(value: number) {\n this.sliceBordersInternal.y = value;\n this.sceneWrapper.setUniform(\n this.planeHandler,\n \"sliceBorders\",\n this.sliceBordersInternal,\n );\n }\n\n /**\n * Sets the top border size for nine-slice scaling.\n * @param value - The top border size as a percentage (0-1) of texture height\n */\n public set sliceBorderTop(value: number) {\n this.sliceBordersInternal.z = value;\n this.sceneWrapper.setUniform(\n this.planeHandler,\n \"sliceBorders\",\n this.sliceBordersInternal,\n );\n }\n\n /**\n * Sets the bottom border size for nine-slice scaling.\n * @param value - The bottom border size as a percentage (0-1) of texture height\n */\n public set sliceBorderBottom(value: number) {\n this.sliceBordersInternal.w = value;\n this.sceneWrapper.setUniform(\n this.planeHandler,\n \"sliceBorders\",\n this.sliceBordersInternal,\n );\n }\n\n /**\n * Sets all four border sizes for nine-slice scaling at once.\n *\n * @param left - The left border size as a percentage (0-1) of texture width\n * @param right - The right border size as a percentage (0-1) of texture width\n * @param top - The top border size as a percentage (0-1) of texture height\n * @param bottom - The bottom border size as a percentage (0-1) of texture height\n */\n public setSliceBorders(\n left: number,\n right: number,\n top: number,\n bottom: number,\n ): void {\n this.sliceBordersInternal.set(left, right, top, bottom);\n this.sceneWrapper.setUniform(\n this.planeHandler,\n \"sliceBorders\",\n this.sliceBordersInternal,\n );\n }\n\n /**\n * Destroys the nine-slice UI element by cleaning up color event listeners and all associated resources.\n */\n public override destroy(): void {\n this.colorInternal.off(UIColorEvent.CHANGE, this.onColorChange);\n super.destroy();\n }\n\n /**\n * Called before each render frame to update the element's dimensions for nine-slice scaling.\n * Updates the world dimensions (z, w components) based on current width, height, and micro scaling.\n * @param renderer - The WebGL renderer\n * @param deltaTime - Time since last frame in seconds\n */\n protected override onWillRender(\n renderer: WebGLRenderer,\n deltaTime: number,\n ): void {\n super.onWillRender(renderer, deltaTime);\n\n this.dimensions.z = this.width * this.micro.scaleX;\n this.dimensions.w = this.height * this.micro.scaleY;\n this.sceneWrapper.setUniform(\n this.planeHandler,\n \"dimensions\",\n this.dimensions,\n );\n }\n\n /** Event handler for when the color changes */\n private readonly onColorChange = (color: UIColor): void => {\n this.sceneWrapper.setUniform(this.planeHandler, \"color\", color);\n };\n}\n","import { Texture } from \"three\";\nimport type { UILayer } from \"../layers/UILayer\";\nimport { assertValidPositiveNumber } from \"../miscellaneous/asserts\";\nimport { UIColor, UIColorEvent } from \"../miscellaneous/UIColor\";\nimport type { UIMode } from \"../miscellaneous/UIMode\";\nimport source from \"../shaders/UIProgressShader.glsl\";\nimport { UIElement } from \"./UIElement\";\n\nconst DEFAULT_TEXTURE = new Texture();\n\n/**\n * Predefined mask functions that control how the progress bar fills.\n * Each function defines a different fill pattern using GLSL shader code.\n */\nexport enum UIProgressMaskFunction {\n /** Fill horizontally from left to right (or right to left if inverse) */\n HORIZONTAL = `float calculateMask() {\n return step((direction * io_UV.x + (1.0 - direction) * 0.5), progress);\n }`,\n\n /** Fill vertically from bottom to top (or top to bottom if inverse) */\n VERTICAL = `float calculateMask() {\n return step((direction * io_UV.y + (1.0 - direction) * 0.5), progress);\n }`,\n\n /** Fill diagonally from bottom-left to top-right */\n DIAGONAL = `float calculateMask() {\n float d = (io_UV.x + io_UV.y) * (0.1);\n return step((direction * d + (1.0 - direction) * 0.5), progress);\n }`,\n\n /** Fill in a circular pattern around the center, starting from the left */\n CIRCLE_LEFT = `float calculateMask() {\n vec2 p = io_UV - 0.5;\n float angle = atan(p.y, p.x);\n angle = (angle + 3.14159265) / 3.14159265;\n angle *= 0.5;\n return step((direction * angle + (1.0 - direction) * 0.5), progress);\n }`,\n\n /** Fill in a circular pattern around the center, starting from the top */\n CIRCLE_TOP = `float calculateMask() {\n vec2 p = io_UV - 0.5;\n float angle = atan(p.y, p.x);\n angle = (angle + 3.14159265) / (2.0 * 3.14159265);\n angle = mod(angle + 0.25, 1.0);\n return step((direction * angle + (1.0 - direction) * 0.5), progress);\n }`,\n}\n\n/**\n * Configuration options for creating a UIProgress element.\n */\nexport interface UIProgressOptions {\n /** X position of the element */\n x: number;\n /** Y position of the element */\n y: number;\n /** Optional background texture (if not provided, default texture is used) */\n backgroundTexture: Texture;\n /** Overall color tint applied to the entire progress bar */\n color: UIColor;\n /** Foreground color tint applied to the filled portion */\n foregroundColor: UIColor;\n /** Background color tint applied to the unfilled portion */\n backgroundColor: UIColor;\n /** Mask function that defines how the progress bar fills (predefined enum or custom GLSL code) */\n maskFunction: UIProgressMaskFunction | string;\n /** Progress value between 0.0 (empty) and 1.0 (full) */\n progress: number;\n /** Whether to fill in reverse direction (true for reverse, false for normal) */\n inverseDirection: boolean;\n /** Default UIMode */\n mode: UIMode;\n}\n\n/**\n * Progress bar UI element with customizable fill direction and appearance.\n *\n * UIProgress displays a progress bar that can be filled in various directions\n * (horizontal, vertical, or at custom angles). It supports separate background\n * and foreground textures with independent color tinting and opacity control.\n *\n * The progress value ranges from 0.0 (empty) to 1.0 (completely filled).\n * The fill direction can be controlled both by angle and forward/reverse direction.\n */\nexport class UIProgress extends UIElement {\n /** Internal storage for the foreground texture */\n private foregroundTextureInternal: Texture;\n /** Internal storage for the optional background texture */\n private backgroundTextureInternal?: Texture;\n\n /** Internal storage for the overall color tint */\n private readonly colorInternal: UIColor;\n /** Internal storage for the foreground color tint */\n private readonly foregroundColorInternal: UIColor;\n /** Internal storage for the background color tint */\n private readonly backgroundColorInternal: UIColor;\n\n /** Internal storage for the current progress value */\n private progressInternal: number;\n /** Internal storage for the fill direction flag */\n private inverseDirectionInternal: boolean;\n\n /**\n * Creates a new progress bar UI element.\n *\n * @param layer - The UI layer to add this element to\n * @param foregroundTexture - The texture used for the progress fill\n * @param options - Configuration options for the progress bar\n */\n constructor(\n layer: UILayer,\n foregroundTexture: Texture,\n options: Partial<UIProgressOptions> = {},\n ) {\n const w = foregroundTexture.image?.width;\n const h = foregroundTexture.image?.height;\n\n assertValidPositiveNumber(w, \"UIProgress foreground texture width\");\n assertValidPositiveNumber(h, \"UIProgress foreground texture height\");\n\n if (options.backgroundTexture) {\n assertValidPositiveNumber(\n options.backgroundTexture.image.width,\n \"UIProgress background texture width\",\n );\n assertValidPositiveNumber(\n options.backgroundTexture.image.height,\n \"UIProgress background texture height\",\n );\n }\n\n const color = options.color ?? new UIColor();\n const foregroundColor = options.foregroundColor ?? new UIColor();\n const backgroundColor = options.backgroundColor ?? new UIColor();\n const progress = options.progress ?? 1;\n const inverseDirection = options.inverseDirection ?? false;\n\n super(\n layer,\n options.x ?? 0,\n options.y ?? 0,\n w,\n h,\n (options.maskFunction ?? UIProgressMaskFunction.HORIZONTAL) + source,\n {\n foregroundTexture,\n backgroundTexture: options.backgroundTexture ?? DEFAULT_TEXTURE,\n color,\n foregroundColor,\n backgroundColor,\n progress,\n direction: inverseDirection ? -1 : 1,\n },\n );\n\n this.foregroundTextureInternal = foregroundTexture;\n this.backgroundTextureInternal = options.backgroundTexture;\n\n this.colorInternal = color;\n this.foregroundColorInternal = foregroundColor;\n this.backgroundColorInternal = backgroundColor;\n\n this.progressInternal = progress;\n this.inverseDirectionInternal = inverseDirection;\n\n this.colorInternal.on(UIColorEvent.CHANGE, this.onColorChange);\n this.foregroundColorInternal.on(\n UIColorEvent.CHANGE,\n this.onForegroundColorChange,\n );\n this.backgroundColorInternal.on(\n UIColorEvent.CHANGE,\n this.onBackgroundColorChange,\n );\n\n if (options.mode !== undefined) {\n this.mode = options.mode;\n }\n }\n\n /**\n * Gets the foreground (fill) texture.\n * @returns The foreground texture\n */\n public get foregroundTexture(): Texture {\n return this.foregroundTextureInternal;\n }\n\n /**\n * Gets the background texture.\n * @returns The background texture, or undefined if none is set\n */\n public get backgroundTexture(): Texture | undefined {\n return this.backgroundTextureInternal;\n }\n\n /**\n * Gets the color tint.\n * @returns The UIColor instance\n */\n public get color(): UIColor {\n return this.colorInternal;\n }\n\n /**\n * Gets the foreground color tint.\n * @returns The foreground color UIColor instance\n */\n public get foregroundColor(): UIColor {\n return this.foregroundColorInternal;\n }\n\n /**\n * Gets the background color tint.\n * @returns The background color UIColor instance\n */\n public get backgroundColor(): UIColor {\n return this.backgroundColorInternal;\n }\n\n /**\n * Gets the current progress value.\n * @returns Progress value between 0.0 (empty) and 1.0 (full)\n */\n public get progress(): number {\n return this.progressInternal;\n }\n\n /**\n * Gets whether the progress fills in reverse direction.\n * @returns True if filling in reverse, false if filling forward\n */\n public get inverseDirection(): boolean {\n return this.inverseDirectionInternal;\n }\n\n /**\n * Sets the foreground (fill) texture.\n *\n * When setting a new texture, the progress bar will automatically resize\n * to match the new texture's dimensions.\n *\n * @param value - The new foreground texture\n * @throws Will throw an error if the texture dimensions are not valid positive numbers\n */\n public set foregroundTexture(value: Texture) {\n const w = value.image.width;\n const h = value.image.height;\n\n assertValidPositiveNumber(w, \"UIProgress foreground texture width\");\n assertValidPositiveNumber(h, \"UIProgress foreground texture height\");\n\n this.solverWrapper.suggestVariableValue(this.wVariable, w);\n this.solverWrapper.suggestVariableValue(this.hVariable, h);\n\n this.foregroundTextureInternal = value;\n this.sceneWrapper.setUniform(this.planeHandler, \"foregroundTexture\", value);\n }\n\n /**\n * Sets the background texture.\n * @param value - The background texture, or undefined to remove background\n */\n public set backgroundTexture(value: Texture | undefined) {\n if (value !== undefined) {\n assertValidPositiveNumber(\n value.image.width,\n \"UIProgress background texture width\",\n );\n assertValidPositiveNumber(\n value.image.height,\n \"UIProgress background texture height\",\n );\n }\n\n this.backgroundTextureInternal = value;\n this.sceneWrapper.setUniform(this.planeHandler, \"backgroundTexture\", value);\n }\n\n /**\n * Sets the color tint.\n * @param value - The UIColor instance\n */\n public set color(value: UIColor) {\n this.colorInternal.copy(value);\n }\n\n /**\n * Sets the foreground color tint.\n * @param value - The foreground color UIColor instance\n */\n public set foregroundColor(value: UIColor) {\n this.foregroundColorInternal.copy(value);\n }\n\n /**\n * Sets the background color tint.\n * @param value - The background color UIColor instance\n */\n public set backgroundColor(value: UIColor) {\n this.backgroundColorInternal.copy(value);\n }\n\n /**\n * Sets the progress fill direction.\n * @param value - True for reverse direction, false for forward\n */\n public set inverseDirection(value: boolean) {\n this.inverseDirectionInternal = value;\n this.sceneWrapper.setUniform(\n this.planeHandler,\n \"direction\",\n value ? -1 : 1,\n );\n }\n\n /**\n * Sets the progress value.\n * @param value - Progress value between 0.0 (empty) and 1.0 (full)\n */\n public set progress(value: number) {\n this.progressInternal = value;\n this.sceneWrapper.setUniform(this.planeHandler, \"progress\", value);\n }\n\n public override destroy(): void {\n this.colorInternal.off(UIColorEvent.CHANGE, this.onColorChange);\n this.foregroundColorInternal.off(\n UIColorEvent.CHANGE,\n this.onForegroundColorChange,\n );\n this.backgroundColorInternal.off(\n UIColorEvent.CHANGE,\n this.onBackgroundColorChange,\n );\n super.destroy();\n }\n\n /** Event handler for when the overall color changes */\n private readonly onColorChange = (color: UIColor): void => {\n this.sceneWrapper.setUniform(this.planeHandler, \"color\", color);\n };\n\n /** Event handler for when the foreground color changes */\n private readonly onForegroundColorChange = (color: UIColor): void => {\n this.sceneWrapper.setUniform(this.planeHandler, \"foregroundColor\", color);\n };\n\n /** Event handler for when the background color changes */\n private readonly onBackgroundColorChange = (color: UIColor): void => {\n this.sceneWrapper.setUniform(this.planeHandler, \"backgroundColor\", color);\n };\n}\n","import type { Camera, WebGLRenderer } from \"three\";\nimport {\n LinearFilter,\n Matrix3,\n PerspectiveCamera,\n RGBAFormat,\n Scene,\n UnsignedByteType,\n WebGLRenderTarget,\n} from \"three\";\nimport { type UILayer } from \"../layers/UILayer\";\nimport { UIColor, UIColorEvent } from \"../miscellaneous/UIColor\";\nimport type { UIMode } from \"../miscellaneous/UIMode\";\nimport source from \"../shaders/UIDefaultShader.glsl\";\nimport { UIElement } from \"./UIElement\";\n\n/**\n * Update modes for controlling when the 3D scene should be re-rendered.\n */\nexport enum UISceneUpdateMode {\n /** Re-render the scene every frame. */\n EACH_FRAME = 1,\n /** Re-render the scene every second frame for performance. */\n EACH_SECOND_FRAME = 2,\n /** Re-render the scene only when properties change. */\n PROPERTY_CHANGED = 3,\n /** Re-render the scene only when manually requested. */\n MANUAL = 4,\n}\n\n/** Default resolution factor for render target sizing. */\nconst DEFAULT_RESOLUTION_FACTOR = 0.5;\n/** Minimum allowed resolution factor to prevent performance issues. */\nconst MIN_RESOLUTION_FACTOR = 0.1;\n/** Maximum allowed resolution factor to prevent memory issues. */\nconst MAX_RESOLUTION_FACTOR = 2;\n/** Default width for the scene render target in pixels. */\nconst DEFAULT_WIDTH = 512;\n/** Default height for the scene render target in pixels. */\nconst DEFAULT_HEIGHT = 512;\n/** Default field of view for the perspective camera in degrees. */\nconst DEFAULT_CAMERA_FOV = 75;\n/** Default near clipping plane distance for the camera. */\nconst DEFAULT_CAMERA_NEAR = 0.1;\n/** Default far clipping plane distance for the camera. */\nconst DEFAULT_CAMERA_FAR = 100;\n/** Default update mode for scene rendering. */\nconst DEFAULT_UPDATE_MODE = UISceneUpdateMode.PROPERTY_CHANGED;\n/** Default clear color for the render target. */\nconst DEFAULT_CLEAR_COLOR = 0x000000;\n/** Default clear alpha for the render target. */\nconst DEFAULT_CLEAR_ALPHA = 0;\n/** Default depth buffer usage setting. */\nconst DEFAULT_USE_DEPTH = true;\n\n/**\n * Configuration options for UIScene element creation.\n */\nexport interface UISceneOptions {\n /** Initial x-coordinate position. */\n x: number;\n /** Initial y-coordinate position. */\n y: number;\n /** Width of the scene render target in pixels. */\n width: number;\n /** Height of the scene render target in pixels. */\n height: number;\n /** Color tint applied to the scene texture. */\n color: UIColor;\n /** Three.js scene to render. */\n scene: Scene;\n /** Camera to use for rendering the scene. */\n camera: Camera;\n /** Update mode controlling when the scene is re-rendered. */\n updateMode: UISceneUpdateMode;\n /** Resolution factor for render target sizing (0.1 to 2.0). */\n resolutionFactor: number;\n /** Clear color for the render target background. */\n clearColor: number;\n /** Clear alpha for the render target background. */\n clearAlpha: number;\n /** Whether to enable depth buffer for the render target. */\n enableDepthBuffer: boolean;\n /** Default UIMode */\n mode: UIMode;\n}\n\n/**\n * UI element for rendering 3D scenes to texture within the UI system.\n *\n * UIScene is a concrete implementation of UIElement that renders a Three.js\n * scene to a WebGL render target and displays it as a texture. It provides\n * control over rendering frequency, resolution, and visual properties. This\n * allows embedding complex 3D content within the 2D UI layout system with\n * performance optimizations through configurable update modes.\n *\n * @see {@link UIElement} - Base class providing UI element functionality\n * @see {@link UISceneUpdateMode} - Update mode configuration\n * @see {@link Scene} - Three.js scene for 3D content\n * @see {@link Camera} - Three.js camera for scene rendering\n */\nexport class UIScene extends UIElement {\n /** The WebGL render target for off-screen scene rendering. */\n private readonly renderTarget: WebGLRenderTarget;\n\n /** Internal storage for the color tint. */\n private readonly colorInternal: UIColor;\n /** Internal storage for the current Three.js scene. */\n private sceneInternal: Scene;\n /** Internal storage for the current camera. */\n private cameraInternal: Camera;\n /** Internal storage for the current update mode. */\n private updateModeInternal: UISceneUpdateMode;\n /** Internal storage for the current resolution factor. */\n private resolutionFactorInternal: number;\n /** Internal storage for the current clear color. */\n private clearColorInternal: number;\n /** Internal storage for the current clear alpha. */\n private clearAlphaInternal: number;\n\n /** Frame alternation boolean for EACH_SECOND_FRAME update mode. */\n private frameBoolean = true;\n /** Flag indicating if properties have changed requiring a re-render. */\n private propertyChanged = false;\n /** Flag indicating if a manual render has been requested. */\n private renderRequired = false;\n\n /**\n * Creates a new UIScene instance with 3D scene rendering capabilities.\n *\n * The scene element creates a WebGL render target for off-screen rendering\n * and displays the result as a texture. A default perspective camera is\n * created if none is provided.\n *\n * @param layer - The UI layer that contains this scene element\n * @param options - Configuration options for scene rendering\n * @throws Will throw an error if resolution factor is outside valid range (0.1-2.0)\n */\n constructor(layer: UILayer, options: Partial<UISceneOptions> = {}) {\n const resolutionFactor =\n options.resolutionFactor ?? DEFAULT_RESOLUTION_FACTOR;\n\n if (\n resolutionFactor < MIN_RESOLUTION_FACTOR ||\n resolutionFactor > MAX_RESOLUTION_FACTOR\n ) {\n throw new Error(\n `Invalid resolution factor: ${resolutionFactor}. Must be between ${MIN_RESOLUTION_FACTOR} and ${MAX_RESOLUTION_FACTOR}.`,\n );\n }\n\n const w = options.width ?? DEFAULT_WIDTH;\n const h = options.height ?? DEFAULT_HEIGHT;\n\n const renderTarget = new WebGLRenderTarget(\n w * resolutionFactor,\n h * resolutionFactor,\n {\n format: RGBAFormat,\n minFilter: LinearFilter,\n magFilter: LinearFilter,\n type: UnsignedByteType,\n depthBuffer: options.enableDepthBuffer ?? DEFAULT_USE_DEPTH,\n stencilBuffer: false,\n },\n );\n\n const color = options.color ?? new UIColor();\n\n super(layer, 0, 0, w, h, source, {\n map: renderTarget.texture,\n uvTransform: new Matrix3(),\n color,\n });\n\n this.renderTarget = renderTarget;\n\n this.sceneInternal = options.scene ?? new Scene();\n this.cameraInternal =\n options.camera ??\n new PerspectiveCamera(\n DEFAULT_CAMERA_FOV,\n w / h,\n DEFAULT_CAMERA_NEAR,\n DEFAULT_CAMERA_FAR,\n );\n\n this.resolutionFactorInternal = resolutionFactor;\n this.updateModeInternal = options.updateMode ?? DEFAULT_UPDATE_MODE;\n\n this.clearColorInternal = options.clearColor ?? DEFAULT_CLEAR_COLOR;\n this.clearAlphaInternal = options.clearAlpha ?? DEFAULT_CLEAR_ALPHA;\n\n if (options.updateMode === UISceneUpdateMode.PROPERTY_CHANGED) {\n this.renderRequired = true;\n }\n\n this.colorInternal = color;\n this.colorInternal.on(UIColorEvent.CHANGE, this.onColorChange);\n\n if (options.mode !== undefined) {\n this.mode = options.mode;\n }\n }\n\n /**\n * Gets the current color tint applied to the scene texture.\n * @returns The UIColor instance\n */\n public get color(): UIColor {\n return this.colorInternal;\n }\n\n /**\n * Gets the Three.js scene being rendered.\n * @returns The current Three.js scene\n */\n public get scene(): Scene {\n return this.sceneInternal;\n }\n\n /**\n * Gets the camera used for rendering the scene.\n * @returns The current Three.js camera\n */\n public get camera(): Camera {\n return this.cameraInternal;\n }\n\n /**\n * Gets the current update mode controlling render frequency.\n * @returns The current update mode\n */\n public get updateMode(): UISceneUpdateMode {\n return this.updateModeInternal;\n }\n\n /**\n * Gets the resolution factor for render target sizing.\n * @returns The resolution factor between 0.1 and 2.0\n */\n public get resolutionFactor(): number {\n return this.resolutionFactorInternal;\n }\n\n /**\n * Gets the clear color used for the render target background.\n * @returns The clear color as a number\n */\n public get clearColor(): number {\n return this.clearColorInternal;\n }\n\n /**\n * Gets the clear alpha used for the render target background.\n * @returns The clear alpha value between 0.0 and 1.0\n */\n public get clearAlpha(): number {\n return this.clearAlphaInternal;\n }\n\n /**\n * Sets the color tint applied to the scene texture.\n * @param value - The UIColor instance\n */\n public set color(value: UIColor) {\n this.colorInternal.copy(value);\n }\n\n /**\n * Sets a new Three.js scene to render and marks for re-render.\n * @param value - The new Three.js scene\n */\n public set scene(value: Scene) {\n if (this.sceneInternal !== value) {\n this.sceneInternal = value;\n this.propertyChanged = true;\n }\n }\n\n /**\n * Sets a new camera for rendering and marks for re-render.\n * @param value - The new Three.js camera\n */\n public set camera(value: Camera) {\n if (this.cameraInternal !== value) {\n this.cameraInternal = value;\n this.propertyChanged = true;\n }\n }\n\n /**\n * Sets the update mode controlling render frequency and marks for re-render.\n * @param value - The new update mode\n */\n public set updateMode(value: UISceneUpdateMode) {\n if (this.updateModeInternal !== value) {\n this.updateModeInternal = value;\n this.propertyChanged = true;\n }\n }\n\n /**\n * Sets the resolution factor and resizes the render target accordingly.\n * @param value - The new resolution factor between 0.1 and 2.0\n */\n public set resolutionFactor(value: number) {\n if (this.resolutionFactorInternal !== value) {\n this.resolutionFactorInternal = value;\n this.renderTarget.setSize(\n this.width * this.resolutionFactorInternal,\n this.height * this.resolutionFactorInternal,\n );\n this.propertyChanged = true;\n }\n }\n\n /**\n * Sets the clear color for the render target background and marks for re-render.\n * @param value - The new clear color as a number\n */\n public set clearColor(value: number) {\n if (this.clearColorInternal !== value) {\n this.clearColorInternal = value;\n this.propertyChanged = true;\n }\n }\n\n /**\n * Sets the clear alpha for the render target background and marks for re-render.\n * @param value - The new clear alpha value between 0.0 and 1.0\n */\n public set clearAlpha(value: number) {\n if (this.clearAlphaInternal !== value) {\n this.clearAlphaInternal = value;\n this.propertyChanged = true;\n }\n }\n\n /**\n * Destroys the scene element by cleaning up all associated resources.\n *\n * This method disposes of the material and render target resources,\n * and calls the parent destroy method to clean up the underlying UI element.\n * After calling this method, the scene element should not be used anymore.\n */\n public override destroy(): void {\n this.colorInternal.off(UIColorEvent.CHANGE, this.onColorChange);\n this.renderTarget.dispose();\n super.destroy();\n }\n\n /**\n * Manually requests a re-render of the scene.\n *\n * This method is useful when the update mode is set to MANUAL and you\n * want to trigger a scene re-render without changing any properties.\n */\n public requestRender(): void {\n this.renderRequired = true;\n }\n\n /**\n * Called before each render frame to update the 3D scene rendering.\n * Handles different update modes and renders the 3D scene to the render target\n * based on the current update mode and property change state.\n * @param renderer - The WebGL renderer used for scene rendering\n */\n protected override onWillRender(renderer: WebGLRenderer): void {\n if (\n this.updateModeInternal === UISceneUpdateMode.EACH_FRAME ||\n (this.updateModeInternal === UISceneUpdateMode.EACH_SECOND_FRAME &&\n this.frameBoolean) ||\n (this.updateModeInternal === UISceneUpdateMode.PROPERTY_CHANGED &&\n this.propertyChanged) ||\n (this.updateModeInternal === UISceneUpdateMode.MANUAL &&\n this.renderRequired)\n ) {\n this.renderRequired = false;\n this.propertyChanged = false;\n this.frameBoolean = !this.frameBoolean;\n\n this.renderTarget.setSize(\n this.width * this.resolutionFactorInternal,\n this.height * this.resolutionFactorInternal,\n );\n renderer.setClearColor(this.clearColorInternal, this.clearAlpha);\n renderer.setRenderTarget(this.renderTarget);\n renderer.clear(true, true, false);\n renderer.render(this.sceneInternal, this.cameraInternal);\n }\n }\n\n /** Event handler for when the color changes */\n private readonly onColorChange = (color: UIColor): void => {\n this.sceneWrapper.setUniform(this.planeHandler, \"color\", color);\n };\n}\n","import {\n assertValidNonNegativeNumber,\n assertValidNumber,\n assertValidPositiveNumber,\n} from \"./asserts\";\n\nexport interface UITextStyle {\n color: string;\n align: \"left\" | \"center\" | \"right\";\n\n fontFamily: string;\n fontSize: number;\n fontStyle: \"normal\" | \"italic\" | \"oblique\";\n fontWeight: \"normal\" | \"bold\" | \"bolder\" | \"lighter\" | number;\n lineHeight: number;\n\n enableShadow: boolean;\n shadowOffsetX: number;\n shadowOffsetY: number;\n shadowBlur: number;\n shadowColor: string;\n\n enableStroke: boolean;\n strokeColor: string;\n strokeWidth: number;\n}\n\nexport function isUITextStyle(obj: unknown): obj is UITextStyle {\n if (typeof obj !== \"object\" || obj === null) {\n return false;\n }\n\n const candidate = obj as Record<string, unknown>;\n\n return (\n typeof candidate.color === \"string\" &&\n (candidate.align === \"left\" ||\n candidate.align === \"center\" ||\n candidate.align === \"right\") &&\n typeof candidate.fontFamily === \"string\" &&\n typeof candidate.fontSize === \"number\" &&\n (candidate.fontStyle === \"normal\" ||\n candidate.fontStyle === \"italic\" ||\n candidate.fontStyle === \"oblique\") &&\n (candidate.fontWeight === \"normal\" ||\n candidate.fontWeight === \"bold\" ||\n candidate.fontWeight === \"bolder\" ||\n candidate.fontWeight === \"lighter\" ||\n typeof candidate.fontWeight === \"number\") &&\n typeof candidate.lineHeight === \"number\" &&\n typeof candidate.enableShadow === \"boolean\" &&\n typeof candidate.shadowOffsetX === \"number\" &&\n typeof candidate.shadowOffsetY === \"number\" &&\n typeof candidate.shadowBlur === \"number\" &&\n typeof candidate.shadowColor === \"string\" &&\n typeof candidate.enableStroke === \"boolean\" &&\n typeof candidate.strokeColor === \"string\" &&\n typeof candidate.strokeWidth === \"number\"\n );\n}\n\nexport const DEFAULT_TEXT_STYLE: UITextStyle = {\n color: \"#000000\",\n align: \"left\",\n\n fontFamily: \"Arial\",\n fontSize: 16,\n fontStyle: \"normal\",\n fontWeight: \"normal\",\n lineHeight: 1.2,\n\n enableShadow: false,\n shadowOffsetX: 0,\n shadowOffsetY: 0,\n shadowBlur: 0,\n shadowColor: \"transparent\",\n\n enableStroke: false,\n strokeColor: \"#000000\",\n strokeWidth: 0,\n};\n\nexport function resolveTextStyle(\n style?: Partial<UITextStyle>,\n commonStyle?: Partial<UITextStyle>,\n): UITextStyle {\n const fontSize =\n style?.fontSize ?? commonStyle?.fontSize ?? DEFAULT_TEXT_STYLE.fontSize;\n assertValidPositiveNumber(fontSize, \"Font size\");\n\n const fontWeight = style?.fontWeight ?? commonStyle?.fontWeight ?? \"normal\";\n if (typeof fontWeight === \"number\") {\n assertValidPositiveNumber(fontWeight, \"Font weight\");\n }\n\n const lineHeight =\n style?.lineHeight ??\n commonStyle?.lineHeight ??\n fontSize * DEFAULT_TEXT_STYLE.lineHeight;\n assertValidNumber(lineHeight, \"Line height\");\n\n const shadowOffsetX =\n style?.shadowOffsetX ??\n commonStyle?.shadowOffsetX ??\n DEFAULT_TEXT_STYLE.shadowOffsetX;\n assertValidNonNegativeNumber(shadowOffsetX, \"Shadow offset X\");\n\n const shadowOffsetY =\n style?.shadowOffsetY ??\n commonStyle?.shadowOffsetY ??\n DEFAULT_TEXT_STYLE.shadowOffsetY;\n assertValidNonNegativeNumber(shadowOffsetY, \"Shadow offset Y\");\n\n const shadowBlur =\n style?.shadowBlur ??\n commonStyle?.shadowBlur ??\n DEFAULT_TEXT_STYLE.shadowBlur;\n assertValidNonNegativeNumber(shadowBlur, \"Shadow blur\");\n\n const strokeWidth =\n style?.strokeWidth ??\n commonStyle?.strokeWidth ??\n DEFAULT_TEXT_STYLE.strokeWidth;\n assertValidNonNegativeNumber(strokeWidth, \"Stroke width\");\n\n return {\n color: style?.color ?? commonStyle?.color ?? DEFAULT_TEXT_STYLE.color,\n align: style?.align ?? commonStyle?.align ?? DEFAULT_TEXT_STYLE.align,\n\n fontFamily:\n style?.fontFamily ??\n commonStyle?.fontFamily ??\n DEFAULT_TEXT_STYLE.fontFamily,\n fontSize,\n fontStyle:\n style?.fontStyle ??\n commonStyle?.fontStyle ??\n DEFAULT_TEXT_STYLE.fontStyle,\n fontWeight,\n lineHeight,\n\n enableShadow:\n style?.enableShadow ??\n commonStyle?.enableShadow ??\n DEFAULT_TEXT_STYLE.enableShadow,\n shadowOffsetX,\n shadowOffsetY,\n shadowBlur,\n shadowColor:\n style?.shadowColor ??\n commonStyle?.shadowColor ??\n DEFAULT_TEXT_STYLE.shadowColor,\n\n enableStroke:\n style?.enableStroke ??\n commonStyle?.enableStroke ??\n DEFAULT_TEXT_STYLE.enableStroke,\n strokeColor:\n style?.strokeColor ??\n commonStyle?.strokeColor ??\n DEFAULT_TEXT_STYLE.strokeColor,\n strokeWidth,\n };\n}\n","import type {\n UIChunkMetrics,\n UITextChunk,\n UITextContent,\n UITextLine,\n UITextSize,\n} from \"./textInterfaces\";\nimport {\n DEFAULT_TEXT_STYLE,\n resolveTextStyle,\n type UITextStyle,\n} from \"./UITextStyle\";\n\nexport function splitText(text: string): string[] {\n return text.match(/\\S+|\\s|\\n/g) ?? [];\n}\n\nexport function measureTextChunk(\n context: OffscreenCanvasRenderingContext2D,\n chunk: string,\n style: UITextStyle,\n): UIChunkMetrics {\n context.font = `${style.fontStyle} ${style.fontWeight} ${style.fontSize}px ${style.fontFamily}`;\n\n if (chunk === \"\\n\") {\n return {\n width: Math.ceil(1),\n height: style.lineHeight,\n baseline: 0,\n lineHeight: style.lineHeight,\n };\n }\n\n const metrics = context.measureText(chunk);\n const width = Math.ceil(metrics.width);\n const height = Math.ceil(\n metrics.actualBoundingBoxAscent + metrics.actualBoundingBoxDescent,\n );\n\n return {\n width,\n height,\n baseline: metrics.actualBoundingBoxDescent,\n lineHeight: style.lineHeight,\n };\n}\n\nexport function buildLines(\n maxWidth: number,\n chunks: UITextChunk[],\n): UITextLine[] {\n const lines: UITextLine[] = [];\n let currentLine: UITextChunk[] = [];\n let currentWidth = 0;\n let currentHeight = 0;\n let currentBaseline = 0;\n let currentLineHeight = 0;\n\n for (const chunk of chunks) {\n if (chunk.text === \"\\n\") {\n if (currentLine.length > 0) {\n lines.push({\n chunks: currentLine,\n width: currentWidth,\n height: currentHeight,\n baseline: currentBaseline,\n lineHeight: currentLineHeight,\n });\n }\n currentLine = [];\n currentWidth = 0;\n currentHeight = 0;\n currentBaseline = 0;\n currentLineHeight = 0;\n continue;\n }\n\n if (\n currentWidth + chunk.metrics.width <= maxWidth ||\n currentLine.length === 0\n ) {\n currentLine.push(chunk);\n currentWidth += chunk.metrics.width;\n currentHeight = Math.max(currentHeight, chunk.metrics.height);\n currentBaseline = Math.max(currentBaseline, chunk.metrics.baseline);\n currentLineHeight = Math.max(currentLineHeight, chunk.metrics.lineHeight);\n } else {\n lines.push({\n chunks: currentLine,\n width: currentWidth,\n height: currentHeight,\n baseline: currentBaseline,\n lineHeight: currentLineHeight,\n });\n currentLine = [chunk];\n currentWidth = chunk.metrics.width;\n currentHeight = chunk.metrics.height;\n currentBaseline = chunk.metrics.baseline;\n currentLineHeight = chunk.metrics.lineHeight;\n }\n }\n\n if (currentLine.length > 0) {\n lines.push({\n chunks: currentLine,\n width: currentWidth,\n height: currentHeight,\n baseline: currentBaseline,\n lineHeight: currentLineHeight,\n });\n }\n\n return lines;\n}\n\nexport function calculateTextSize(lines: UITextLine[]): UITextSize {\n if (lines.length === 0) {\n return { width: 0, height: 0 };\n }\n\n const maxLineWidth = Math.max(...lines.map((line) => line.width));\n let totalHeight = 0;\n\n for (let i = 0; i < lines.length; i++) {\n const line = lines[i];\n totalHeight += i === 0 ? line.height : line.lineHeight;\n }\n\n return { width: maxLineWidth, height: totalHeight };\n}\n\nexport function renderText(\n x: number,\n y: number,\n text: string,\n style: UITextStyle,\n context: OffscreenCanvasRenderingContext2D,\n): void {\n context.font = `${style.fontStyle} ${style.fontWeight} ${style.fontSize}px ${style.fontFamily}`;\n\n if (style.enableShadow) {\n context.shadowOffsetX = style.shadowOffsetX;\n context.shadowOffsetY = style.shadowOffsetY;\n context.shadowBlur = style.shadowBlur;\n context.shadowColor = style.shadowColor;\n }\n\n if (style.enableStroke) {\n context.strokeStyle = style.strokeColor;\n context.lineWidth = style.strokeWidth;\n context.strokeText(text, x, y);\n }\n\n context.fillStyle = style.color;\n context.fillText(text, x, y);\n}\n\nexport function renderTextLines(\n paddingTop: number,\n paddingLeft: number,\n lines: UITextLine[],\n context: OffscreenCanvasRenderingContext2D,\n): void {\n let currentY = paddingTop;\n\n let textWidth = 0;\n for (const line of lines) {\n textWidth = Math.max(line.width, textWidth);\n }\n\n for (let i = 0; i < lines.length; i++) {\n const line = lines[i];\n\n const firstAlign = line.chunks[0]?.style.align ?? DEFAULT_TEXT_STYLE.align;\n const isUniformAlign = line.chunks.every(\n (c) => c.style.align === firstAlign,\n );\n const lineAlign = isUniformAlign ? firstAlign : DEFAULT_TEXT_STYLE.align;\n\n let offsetX = 0;\n\n if (lineAlign === \"center\") {\n offsetX = (textWidth - line.width) / 2;\n } else if (lineAlign === \"right\") {\n offsetX = textWidth - line.width;\n }\n\n let currentX = paddingLeft + offsetX;\n currentY += i === 0 ? line.height : line.lineHeight;\n\n for (const chunk of line.chunks) {\n renderText(currentX, currentY, chunk.text, chunk.style, context);\n currentX += chunk.metrics.width;\n }\n }\n}\n\nexport function calculateTextContentParameters(\n context: OffscreenCanvasRenderingContext2D,\n content: UITextContent,\n maxLineWidth: number,\n commonStyle?: Partial<UITextStyle>,\n): { lines: UITextLine[]; size: UITextSize } {\n const chunks: UITextChunk[] = [];\n\n for (const span of Array.isArray(content) ? content : [content]) {\n const isSpanString = typeof span === \"string\";\n const spanString = isSpanString ? span : span.text;\n const style = resolveTextStyle(\n isSpanString ? undefined : span.style,\n commonStyle,\n );\n\n for (const text of splitText(spanString)) {\n const metrics = measureTextChunk(context, text, style);\n chunks.push({ text, style, metrics });\n }\n }\n\n const lines = buildLines(maxLineWidth, chunks);\n return { lines, size: calculateTextSize(lines) };\n}\n","import { assertValidNonNegativeNumber } from \"./asserts\";\n\nexport interface UIPadding {\n left: number;\n right: number;\n top: number;\n bottom: number;\n}\n\nexport function resolveTextPadding(value: unknown): UIPadding {\n if (typeof value === \"number\") {\n return { left: value, right: value, top: value, bottom: value };\n }\n\n if (typeof value === \"object\" && value !== null) {\n const left =\n \"left\" in value && typeof value.left === \"number\" ? value.left : 0;\n const right =\n \"right\" in value && typeof value.right === \"number\" ? value.right : 0;\n const top = \"top\" in value && typeof value.top === \"number\" ? value.top : 0;\n const bottom =\n \"bottom\" in value && typeof value.bottom === \"number\" ? value.bottom : 0;\n\n assertValidNonNegativeNumber(left, \"Padding left\");\n assertValidNonNegativeNumber(right, \"Padding right\");\n assertValidNonNegativeNumber(top, \"Padding top\");\n assertValidNonNegativeNumber(bottom, \"Padding bottom\");\n\n return { left, right, top, bottom };\n }\n\n return { left: 0, right: 0, top: 0, bottom: 0 };\n}\n","import type { WebGLRenderer } from \"three\";\nimport { CanvasTexture, Matrix3 } from \"three\";\nimport { type UILayer } from \"../layers/UILayer\";\nimport type { UITextContent } from \"../miscellaneous/textInterfaces\";\nimport {\n calculateTextContentParameters,\n renderTextLines,\n} from \"../miscellaneous/textTools\";\nimport { UIColor, UIColorEvent } from \"../miscellaneous/UIColor\";\nimport type { UIMode } from \"../miscellaneous/UIMode\";\nimport {\n resolveTextPadding,\n type UIPadding,\n} from \"../miscellaneous/UITextPadding\";\nimport { type UITextStyle } from \"../miscellaneous/UITextStyle\";\nimport source from \"../shaders/UIDefaultShader.glsl\";\nimport { UIElement } from \"./UIElement\";\n\n/** Default maximum width for text elements in pixels. */\nconst DEFAULT_MAX_WIDTH = 1024;\n\n/**\n * Configuration options for UIText element creation.\n */\nexport interface UITextOptions {\n /** X-coordinate of the text element. */\n x: number;\n /** Y-coordinate of the text element. */\n y: number;\n /** Color tint applied to the text. */\n color: UIColor;\n /** Maximum width in pixels before text wrapping occurs. */\n maxWidth: number;\n /** Padding configuration for text content. */\n padding: Partial<UIPadding>;\n /** Common style properties applied to all text content. */\n commonStyle: Partial<UITextStyle>;\n /** Default UIMode */\n mode: UIMode;\n}\n\n/**\n * UI element for rendering dynamic text with canvas-based rendering.\n *\n * UIText is a concrete implementation of UIElement that renders text content\n * using HTML5 Canvas and displays it as a texture. It supports rich text\n * formatting, automatic text wrapping, padding, and dynamic resizing based\n * on content. The text is rendered to a canvas texture which is then applied\n * to a Three.js mesh for display in the 3D scene.\n *\n * @see {@link UIElement} - Base class providing UI element functionality\n * @see {@link UITextContent} - Text content structure\n * @see {@link UITextStyle} - Text styling options\n * @see {@link UIPadding} - Padding configuration\n */\nexport class UIText extends UIElement {\n /** The HTML canvas element used for text rendering. */\n private readonly canvas: OffscreenCanvas;\n\n /** The 2D rendering context for drawing text on the canvas. */\n private readonly context: OffscreenCanvasRenderingContext2D;\n\n /** The canvas texture containing the rendered text. */\n private texture: CanvasTexture;\n\n /** Internal storage for the color tint. */\n private readonly colorInternal: UIColor;\n\n /** Internal storage for the current text content. */\n private contentInternal: UITextContent;\n\n /** Internal storage for the maximum width before text wrapping. */\n private maxWidthInternal: number;\n\n /** Internal storage for the current padding configuration. */\n private paddingInternal: UIPadding;\n\n /** Internal storage for the common text style properties. */\n private commonStyleInternal: Partial<UITextStyle>;\n\n /** Target aspect ratio for the text element based on content. */\n private targetAspectRatio = 1;\n\n /**\n * Creates a new UIText instance with dynamic text rendering.\n *\n * The text element will automatically size itself based on the content\n * and specified options. A canvas is created for rendering the text,\n * which is then used as a texture for the 3D mesh.\n *\n * @param layer - The UI layer that contains this text element\n * @param content - The text content to display\n * @param options - Configuration options for text rendering\n * @throws Will throw an error if canvas context creation fails\n */\n constructor(\n layer: UILayer,\n content: UITextContent,\n options: Partial<UITextOptions> = {},\n ) {\n const canvas = new OffscreenCanvas(2, 2);\n const context = canvas.getContext(\"2d\");\n\n if (!context) {\n throw new Error(\"UIText failed to create canvas context\");\n }\n\n const texture = new CanvasTexture(canvas);\n const color = options.color ?? new UIColor();\n\n super(layer, options.x ?? 0, options.y ?? 0, 2, 2, source, {\n map: texture,\n uvTransform: new Matrix3(),\n color,\n });\n\n this.canvas = canvas;\n this.context = context;\n this.texture = texture;\n\n this.contentInternal = content;\n this.maxWidthInternal = options.maxWidth ?? DEFAULT_MAX_WIDTH;\n this.paddingInternal = resolveTextPadding(options.padding);\n this.commonStyleInternal = options.commonStyle ?? {};\n\n this.colorInternal = color;\n this.colorInternal.on(UIColorEvent.CHANGE, this.onColorChange);\n this.rebuildText();\n\n if (options.mode !== undefined) {\n this.mode = options.mode;\n }\n }\n\n /**\n * Gets the current color tint applied to the text.\n * @returns The UIColor instance\n */\n public get color(): UIColor {\n return this.colorInternal;\n }\n\n /**\n * Gets the current text content being displayed.\n * @returns The current text content structure\n */\n public get content(): UITextContent {\n return this.contentInternal;\n }\n\n /**\n * Gets the maximum width before text wrapping occurs.\n * @returns The maximum width in pixels\n */\n public get maxWidth(): number {\n return this.maxWidthInternal;\n }\n\n /**\n * Gets the current padding configuration.\n * @returns The padding configuration for all sides\n */\n public get padding(): UIPadding {\n return this.paddingInternal;\n }\n\n /**\n * Gets the common style properties applied to the text.\n * @returns The partial text style configuration\n */\n public get commonStyle(): Partial<UITextStyle> {\n return this.commonStyleInternal;\n }\n\n /**\n * Sets the color tint applied to the text.\n * @param value - The UIColor instance\n */\n public set color(value: UIColor) {\n this.colorInternal.copy(value);\n }\n\n /**\n * Sets new text content and triggers a rebuild.\n * @param value - The new text content structure\n */\n public set content(value: UITextContent) {\n this.contentInternal = value;\n this.rebuildText();\n }\n\n /**\n * Sets the maximum width before text wrapping and triggers a rebuild.\n * @param value - The new maximum width in pixels\n */\n public set maxWidth(value: number) {\n this.maxWidthInternal = value;\n this.rebuildText();\n }\n\n /**\n * Sets new padding configuration and triggers a rebuild.\n * @param value - The new padding configuration\n */\n public set padding(value: UIPadding) {\n this.paddingInternal = value;\n this.rebuildText();\n }\n\n /**\n * Sets new common style properties and triggers a rebuild.\n * @param value - The new partial text style configuration\n */\n public set commonStyle(value: Partial<UITextStyle>) {\n this.commonStyleInternal = value;\n this.rebuildText();\n }\n\n /**\n * Destroys the text element by cleaning up all associated resources.\n *\n * This method disposes of the texture resources and calls the parent destroy method\n * to clean up the underlying UI element. After calling this method,\n * the text element should not be used anymore.\n */\n public override destroy(): void {\n this.colorInternal.off(UIColorEvent.CHANGE, this.onColorChange);\n this.texture.dispose();\n super.destroy();\n }\n\n /**\n * Called before each render frame to maintain proper text aspect ratio.\n * Adjusts the height based on the target aspect ratio calculated from text content.\n * @param renderer - The WebGL renderer\n * @param deltaTime - Time since last frame in seconds\n */\n protected override onWillRender(\n renderer: WebGLRenderer,\n deltaTime: number,\n ): void {\n super.onWillRender(renderer, deltaTime);\n if (this.targetAspectRatio !== this.width / this.height) {\n this.height = this.width / this.targetAspectRatio;\n }\n }\n\n /**\n * Rebuilds the text canvas and texture based on current content and settings.\n *\n * This method calculates the text layout, resizes the canvas to fit the content\n * with padding, renders the text lines to the canvas, and updates the texture.\n * It also calculates and sets the target aspect ratio for proper display.\n */\n private rebuildText(): void {\n const { lines, size } = calculateTextContentParameters(\n this.context,\n this.content,\n this.maxWidthInternal,\n this.commonStyleInternal,\n );\n\n this.canvas.width =\n size.width + this.paddingInternal.left + this.paddingInternal.right;\n this.canvas.height =\n size.height + this.paddingInternal.top + this.paddingInternal.bottom;\n\n this.width = this.canvas.width;\n this.height = this.canvas.height;\n\n this.targetAspectRatio = this.canvas.width / this.canvas.height;\n\n renderTextLines(\n this.paddingInternal.top,\n this.paddingInternal.left,\n lines,\n this.context,\n );\n\n this.texture.dispose();\n this.texture = new CanvasTexture(this.canvas);\n this.texture.needsUpdate = true;\n this.sceneWrapper.setUniform(this.planeHandler, \"map\", this.texture);\n }\n\n /** Event handler for when the color changes */\n private readonly onColorChange = (color: UIColor): void => {\n this.sceneWrapper.setUniform(this.planeHandler, \"color\", color);\n };\n}\n","import { Eventail } from \"eventail\";\n\nexport enum UIResizePolicyEvent {\n CHANGE = 0,\n}\n\n/**\n * Base class for UI resize policies.\n *\n * Calculates scale factors based on viewport dimensions. Different policies\n * implement different scaling strategies.\n */\nexport abstract class UIResizePolicy extends Eventail {\n /**\n * Calculates scale factor for given dimensions.\n *\n * @param width - Viewport width in pixels\n * @param height - Viewport height in pixels\n * @returns Scale factor to apply\n * @protected\n */\n protected abstract calculateScaleInternal(\n width: number,\n height: number,\n ): number;\n}\n","import { UIResizePolicy } from \"./UIResizePolicy\";\n\n/**\n * No scaling applied, always returns 1:1 scale.\n */\nexport class UIResizePolicyNone extends UIResizePolicy {\n protected calculateScaleInternal(width: number, height: number): number {\n void width;\n void height;\n return 1;\n }\n}\n","import {\n MathUtils,\n Vector2,\n Vector3,\n type Camera,\n type WebGLRenderer,\n} from \"three\";\nimport { assertValidNumber } from \"../miscellaneous/asserts\";\nimport { UIInputEvent } from \"../miscellaneous/UIInputEvent\";\nimport { UIMode } from \"../miscellaneous/UIMode\";\nimport type { UIResizePolicy } from \"../miscellaneous/UIResizePolicy\";\nimport { UIResizePolicyEvent } from \"../miscellaneous/UIResizePolicy\";\nimport { UIResizePolicyNone } from \"../miscellaneous/UIResizePolicyNone\";\nimport { UILayer } from \"./UILayer\";\n\nconst TEMP_POSITION = new Vector3();\n\n/**\n * UI layer that covers the full browser window.\n *\n * Handles window resize and pointer events automatically. Scaling is controlled\n * by the assigned resize policy.\n *\n * @see {@link UILayer}\n * @see {@link UIResizePolicy}\n */\nexport class UIFullscreenLayer extends UILayer {\n private resizePolicyInternal: UIResizePolicy;\n\n /**\n * Creates a fullscreen layer and sets up window event listeners.\n */\n constructor(\n resizePolicy: UIResizePolicy = new UIResizePolicyNone(),\n mode: UIMode = UIMode.VISIBLE,\n ) {\n super(window.innerWidth, window.innerHeight);\n window.addEventListener(\"resize\", this.onResize);\n window.addEventListener(\"pointerdown\", this.onDown);\n window.addEventListener(\"pointermove\", this.onMove);\n window.addEventListener(\"pointerup\", this.onUp);\n this.mode = mode;\n this.resizePolicyInternal = resizePolicy;\n this.resizePolicyInternal.on(UIResizePolicyEvent.CHANGE, this.onResize);\n this.onResize();\n }\n\n /**\n * Gets the current resize policy.\n */\n public get resizePolicy(): UIResizePolicy {\n return this.resizePolicyInternal;\n }\n\n /**\n * Sets a new resize policy. Unsubscribes from old policy and subscribes to new one.\n */\n public set resizePolicy(value: UIResizePolicy) {\n if (this.resizePolicyInternal !== value) {\n this.resizePolicyInternal.off(UIResizePolicyEvent.CHANGE, this.onResize);\n this.resizePolicyInternal = value;\n this.resizePolicyInternal.on(UIResizePolicyEvent.CHANGE, this.onResize);\n this.onResize();\n }\n }\n\n /**\n * Removes window event listeners. The layer should not be used after this.\n */\n public destroy(): void {\n window.removeEventListener(\"resize\", this.onResize);\n window.removeEventListener(\"pointerdown\", this.onDown);\n window.removeEventListener(\"pointermove\", this.onMove);\n window.removeEventListener(\"pointerup\", this.onUp);\n this.resizePolicyInternal.off(UIResizePolicyEvent.CHANGE, this.onResize);\n }\n\n /**\n * Renders the layer.\n *\n * @param renderer - WebGL renderer\n * @param deltaTime - Time since last frame in seconds\n */\n public render(renderer: WebGLRenderer, deltaTime: number): void {\n assertValidNumber(deltaTime, \"UIFullscreenLayer.deltaTime\");\n super.renderInternal(renderer, deltaTime);\n }\n\n /**\n * Projects 3D world position to 2D layer coordinates.\n *\n * @param position - 3D world position\n * @param camera - Camera for projection\n * @returns 2D position in layer space\n */\n public projectWorldPosition(position: Vector3, camera: Camera): Vector2 {\n const projectedPosition = TEMP_POSITION.copy(position).project(camera);\n projectedPosition.x = MathUtils.mapLinear(\n projectedPosition.x,\n -1,\n 1,\n this.x,\n this.width,\n );\n projectedPosition.y = MathUtils.mapLinear(\n projectedPosition.y,\n -1,\n 1,\n this.y,\n this.height,\n );\n return new Vector2(projectedPosition.x, projectedPosition.y);\n }\n\n /**\n * Projects 2D layer position to 3D world coordinates.\n *\n * @param position - 2D position in layer space\n * @param camera - Camera for unprojection\n * @param z - z in NDC space (defaults to -1)\n * @returns 3D position in world space\n */\n public projectLayerPosition(\n position: Vector2,\n camera: Camera,\n z = -1,\n ): Vector3 {\n TEMP_POSITION.x = MathUtils.mapLinear(\n position.x,\n this.x,\n this.width,\n -1,\n 1,\n );\n TEMP_POSITION.y = MathUtils.mapLinear(\n position.y,\n this.y,\n this.height,\n -1,\n 1,\n );\n TEMP_POSITION.z = z;\n\n return TEMP_POSITION.unproject(camera);\n }\n\n /**\n * Handles window resize. Updates layer dimensions according to resize policy.\n */\n private readonly onResize = (): void => {\n const scale = this.resizePolicyInternal[\"calculateScaleInternal\"](\n window.innerWidth,\n window.innerHeight,\n );\n this.resizeInternal(window.innerWidth * scale, window.innerHeight * scale);\n };\n\n private readonly onDown = (event: PointerEvent): void => {\n this.handleWindowInput(event, \"onPointerDownInternal\", UIInputEvent.DOWN);\n };\n\n private readonly onMove = (event: PointerEvent): void => {\n this.handleWindowInput(event, \"onPointerMoveInternal\", UIInputEvent.MOVE);\n };\n\n private readonly onUp = (event: PointerEvent): void => {\n this.handleWindowInput(event, \"onPointerUpInternal\", UIInputEvent.UP);\n };\n\n private handleWindowInput(\n event: PointerEvent,\n pointerFunctionName:\n | \"onPointerDownInternal\"\n | \"onPointerMoveInternal\"\n | \"onPointerUpInternal\",\n inputEvent: UIInputEvent,\n ): void {\n const rect =\n event.target instanceof HTMLElement\n ? event.target.getBoundingClientRect()\n : null;\n\n const x = rect ? event.clientX - rect.left : event.clientX;\n const y = rect\n ? rect.bottom - event.clientY\n : window.innerHeight - event.clientY;\n\n const scale = this.resizePolicyInternal[\"calculateScaleInternal\"](\n window.innerWidth,\n window.innerHeight,\n );\n const scaledX = x * scale;\n const scaledY = y * scale;\n\n if (this.mode === UIMode.INTERACTIVE) {\n this.emit(inputEvent, scaledX, scaledY, event.pointerId);\n }\n\n this[pointerFunctionName](scaledX, scaledY, event.pointerId);\n }\n}\n","import type { IUniform } from \"three\";\nimport {\n InstancedBufferAttribute,\n InstancedBufferGeometry,\n Matrix2,\n Matrix3,\n Matrix4,\n Mesh,\n PlaneGeometry,\n ShaderMaterial,\n Texture,\n Vector2,\n Vector3,\n Vector4,\n} from \"three\";\nimport { UIColor } from \"../miscellaneous/UIColor\";\nimport { UITransparencyMode } from \"./UITransparencyMode\";\nimport { assertValidNonNegativeNumber } from \"./asserts\";\n\nexport type UIPropertyType =\n | Texture\n | UIColor\n | Vector2\n | Vector3\n | Vector4\n | Matrix2\n | Matrix3\n | Matrix4\n | number;\n\nexport type UIPropertyTypeName =\n | \"Texture\"\n | \"UIColor\"\n | \"Vector2\"\n | \"Vector3\"\n | \"Vector4\"\n | \"Matrix2\"\n | \"Matrix3\"\n | \"Matrix4\"\n | \"number\";\n\ninterface Descriptor {\n firstIndex: number;\n count: number;\n}\n\nconst INSTANCED_GEOMETRY = ((): InstancedBufferGeometry => {\n const planeGeometry = new PlaneGeometry(1, 1);\n const geometry = new InstancedBufferGeometry();\n geometry.index = planeGeometry.index;\n geometry.setAttribute(\"position\", planeGeometry.attributes[\"position\"]);\n geometry.setAttribute(\"uv\", planeGeometry.attributes[\"uv\"]);\n planeGeometry.dispose();\n return geometry;\n})();\n\nconst ITEM_1_OFFSET = 1;\nconst ITEM_2_OFFSET = 2;\nconst ITEM_3_OFFSET = 3;\n\nconst CAPACITY_STEP = 16;\nconst ALPHA_TEST = 0.5;\n\nfunction resolveTypeInfo(property: UIPropertyType | UIPropertyTypeName): {\n instantiable: boolean;\n glslType: string;\n itemSize: number;\n} {\n if (property === \"Texture\" || property instanceof Texture) {\n return { glslType: \"sampler2D\", instantiable: false, itemSize: -1 };\n } else if (property === \"UIColor\" || property instanceof UIColor) {\n return { glslType: \"vec4\", instantiable: true, itemSize: 4 };\n } else if (property === \"Vector2\" || property instanceof Vector2) {\n return { glslType: \"vec2\", instantiable: true, itemSize: 2 };\n } else if (property === \"Vector3\" || property instanceof Vector3) {\n return { glslType: \"vec3\", instantiable: true, itemSize: 3 };\n } else if (property === \"Vector4\" || property instanceof Vector4) {\n return { glslType: \"vec4\", instantiable: true, itemSize: 4 };\n } else if (property === \"Matrix2\" || property instanceof Matrix2) {\n return { glslType: \"mat2\", instantiable: true, itemSize: 4 };\n } else if (property === \"Matrix3\" || property instanceof Matrix3) {\n return { glslType: \"mat3\", instantiable: true, itemSize: 9 };\n } else if (property === \"Matrix4\" || property instanceof Matrix4) {\n return { glslType: \"mat4\", instantiable: true, itemSize: 16 };\n } else if (property === \"number\" || typeof property === \"number\") {\n return { glslType: \"float\", instantiable: true, itemSize: 1 };\n } else {\n throw new Error(`Unsupported property type: ${property}`);\n }\n}\n\nfunction udpateProperty(\n value: UIPropertyType,\n attribute: InstancedBufferAttribute,\n itemOffset: number,\n): void {\n const array = attribute.array as Float32Array;\n\n if (value instanceof UIColor) {\n array[itemOffset] = value.r;\n array[itemOffset + ITEM_1_OFFSET] = value.g;\n array[itemOffset + ITEM_2_OFFSET] = value.b;\n array[itemOffset + ITEM_3_OFFSET] = value.a;\n } else if (value instanceof Vector2) {\n array[itemOffset] = value.x;\n array[itemOffset + ITEM_1_OFFSET] = value.y;\n } else if (value instanceof Vector3) {\n array[itemOffset] = value.x;\n array[itemOffset + ITEM_1_OFFSET] = value.y;\n array[itemOffset + ITEM_2_OFFSET] = value.z;\n } else if (value instanceof Vector4) {\n array[itemOffset] = value.x;\n array[itemOffset + ITEM_1_OFFSET] = value.y;\n array[itemOffset + ITEM_2_OFFSET] = value.z;\n array[itemOffset + ITEM_3_OFFSET] = value.w;\n } else if (value instanceof Matrix2) {\n const elements = value.elements;\n for (let j = 0; j < elements.length; j++) {\n array[itemOffset + j] = elements[j];\n }\n } else if (value instanceof Matrix3) {\n const elements = value.elements;\n for (let j = 0; j < elements.length; j++) {\n array[itemOffset + j] = elements[j];\n }\n } else if (value instanceof Matrix4) {\n const elements = value.elements;\n for (let j = 0; j < elements.length; j++) {\n array[itemOffset + j] = elements[j];\n }\n } else if (typeof value === \"number\") {\n array[itemOffset] = value;\n }\n\n attribute.needsUpdate = true;\n}\n\nfunction buildEmptyInstancedBufferAttribute(\n property: UIPropertyType | UIPropertyTypeName,\n capacity: number,\n): InstancedBufferAttribute {\n const info = resolveTypeInfo(property);\n if (!info.instantiable) {\n throw new Error(`Invalid property type: ${property}`);\n }\n return new InstancedBufferAttribute(\n new Float32Array(capacity * info.itemSize),\n info.itemSize,\n );\n}\n\nfunction buildMaterial(\n source: string,\n uniformLayout: Record<string, UIPropertyTypeName>,\n varyingLayout: Record<string, UIPropertyTypeName>,\n transparency: UITransparencyMode,\n): ShaderMaterial {\n const uniforms: Record<string, { value: null }> = {};\n\n const uniformDeclarations: string[] = [];\n const attributeDeclarations: string[] = [];\n const varyingDeclarations: string[] = [];\n const vertexAssignments: string[] = [];\n\n for (const [name, propertyTypeName] of Object.entries(uniformLayout)) {\n const glslType = resolveTypeInfo(propertyTypeName).glslType;\n uniforms[`u_${name}`] = { value: null };\n uniformDeclarations.push(`uniform ${glslType} u_${name};`);\n }\n\n for (const [name, propertyTypeName] of Object.entries(varyingLayout)) {\n const glslType = resolveTypeInfo(propertyTypeName).glslType;\n attributeDeclarations.push(`attribute ${glslType} a_${name};`);\n varyingDeclarations.push(`varying ${glslType} v_${name};`);\n vertexAssignments.push(`v_${name} = a_${name};`);\n }\n\n const vertexShader = `\n ${attributeDeclarations.join(\"\\n\")}\n\n ${uniformDeclarations.join(\"\\n\")}\n\n ${varyingDeclarations.join(\"\\n\")}\n varying vec3 v_position;\n varying vec2 v_uv;\n\n void main() {\n if (a_visibility < 0.5) {\n gl_Position = vec4(2.0, 2.0, 2.0, 2.0);\n return;\n }\n\n ${vertexAssignments.join(\"\\n\")}\n\n v_position = position;\n v_uv = (a_uvTransform * vec3(uv, 1.0)).xy;\n\n gl_Position = projectionMatrix * modelViewMatrix * a_instanceTransform * vec4(position, 1.0);\n }\n `;\n\n const fragmentShader = `\n ${uniformDeclarations.join(\"\\n\")}\n\n ${varyingDeclarations.join(\"\\n\")}\n varying vec3 v_position;\n varying vec2 v_uv;\n\n #include <alphahash_pars_fragment>\n\n // Source have to define 'draw' function\n ${source}\n\n void main() {\n vec4 diffuseColor = draw();\n\n #ifdef USE_ALPHATEST\n if (diffuseColor.a < v_alphaTest) {\n discard;\n }\n #endif\n\n #ifdef USE_ALPHAHASH\n if (diffuseColor.a < getAlphaHashThreshold(v_position)) {\n discard;\n }\n #endif\n\n gl_FragColor = linearToOutputTexel(diffuseColor);\n }\n `;\n\n return new ShaderMaterial({\n uniforms,\n vertexShader,\n fragmentShader,\n transparent: transparency === UITransparencyMode.BLEND,\n alphaTest: transparency === UITransparencyMode.CLIP ? ALPHA_TEST : 0.0,\n alphaHash: transparency === UITransparencyMode.HASH,\n });\n}\n\nexport class UIGenericInstancedPlane extends Mesh {\n protected handlerToDescriptor: Map<number, Descriptor> = new Map();\n\n protected lastHandler = 0;\n protected capacity = 0;\n protected propertyBuffers: Map<string, InstancedBufferAttribute> = new Map();\n\n private readonly instancedGeometry: InstancedBufferGeometry;\n private readonly shaderMaterial: ShaderMaterial;\n\n constructor(\n source: string,\n layout: Record<string, UIPropertyTypeName>,\n transparency: UITransparencyMode = UITransparencyMode.CLIP,\n capacity: number = CAPACITY_STEP,\n ) {\n const uniformLayout: Record<string, UIPropertyTypeName> = {};\n const varyingLayout: Record<string, UIPropertyTypeName> = {\n instanceTransform: \"Matrix4\",\n uvTransform: \"Matrix3\",\n ...(transparency === UITransparencyMode.CLIP\n ? { alphaTest: \"number\" }\n : {}),\n };\n\n for (const [name, propertyTypeName] of Object.entries(layout)) {\n (resolveTypeInfo(propertyTypeName).instantiable\n ? varyingLayout\n : uniformLayout)[name] = propertyTypeName;\n }\n\n const instancedGeometry = INSTANCED_GEOMETRY.clone();\n const shaderMaterial = buildMaterial(\n source,\n uniformLayout,\n varyingLayout,\n transparency,\n );\n\n super(instancedGeometry, shaderMaterial);\n\n this.instancedGeometry = instancedGeometry;\n this.instancedGeometry.instanceCount = 0;\n\n this.shaderMaterial = shaderMaterial;\n this.capacity = Math.max(capacity, CAPACITY_STEP);\n\n for (const [name, propertyTypeName] of Object.entries(varyingLayout)) {\n const attribute = buildEmptyInstancedBufferAttribute(\n propertyTypeName,\n this.capacity,\n );\n\n this.instancedGeometry.setAttribute(`a_${name}`, attribute);\n this.propertyBuffers.set(`a_${name}`, attribute);\n }\n }\n\n public createInstances(count: number): number {\n const handler = this.lastHandler++;\n\n if (this.instancedGeometry.instanceCount + count > this.capacity) {\n this.resizeGeometry(\n Math.ceil((this.capacity + count) / CAPACITY_STEP) * CAPACITY_STEP,\n );\n }\n\n this.handlerToDescriptor.set(handler, {\n firstIndex: this.instancedGeometry.instanceCount,\n count,\n });\n\n this.instancedGeometry.instanceCount += count;\n return handler;\n }\n\n public destroyInstances(handler: number): void {\n const releasedDescriptor = this.handlerToDescriptor.get(handler);\n if (releasedDescriptor === undefined) {\n throw new Error(`No range found for userIndex: ${handler}`);\n }\n\n this.handlerToDescriptor.delete(handler);\n\n const values = Array.from(this.handlerToDescriptor.values());\n const edge = releasedDescriptor.firstIndex + releasedDescriptor.count;\n let replacementDescriptor: Descriptor | undefined;\n\n for (let i = values.length - 1; i > edge; i--) {\n const descriptor = values[i];\n if (descriptor.count === releasedDescriptor.count) {\n replacementDescriptor = descriptor;\n break;\n }\n }\n\n if (replacementDescriptor) {\n this.copyRangeData(replacementDescriptor, releasedDescriptor);\n replacementDescriptor.firstIndex = releasedDescriptor.firstIndex;\n\n this.shiftRangesDown(\n replacementDescriptor.firstIndex + replacementDescriptor.count,\n replacementDescriptor.count,\n );\n } else {\n this.shiftRangesDown(\n releasedDescriptor.firstIndex + releasedDescriptor.count,\n releasedDescriptor.count,\n );\n }\n\n this.instancedGeometry.instanceCount -= releasedDescriptor.count;\n }\n\n public updateProperties(\n handler: number,\n offset: number,\n instancesProperties: Record<string, UIPropertyType>[],\n ): void {\n assertValidNonNegativeNumber(\n offset,\n \"UIGenericInstancedPlane updateProperties offset\",\n );\n\n const descriptor = this.resolveDescriptor(handler);\n\n if (instancesProperties.length + offset > descriptor.count) {\n throw new Error(\n `Too many instances for handler: ${handler}, offset: ${offset}, and count: ${instancesProperties.length}`,\n );\n }\n\n for (let i = 0; i < instancesProperties.length; i++) {\n const instanceProperties = instancesProperties[i];\n const instanceOffset = descriptor.firstIndex + offset + i;\n\n for (const [name, value] of Object.entries(instanceProperties)) {\n if (resolveTypeInfo(value).instantiable) {\n const attribute = this.resolveBufferAttribute(name);\n const itemOffset = instanceOffset * attribute.itemSize;\n udpateProperty(value, attribute, itemOffset);\n } else {\n const uniform = this.resolveUniform(name);\n uniform.value = value;\n this.shaderMaterial.uniformsNeedUpdate = true;\n }\n }\n }\n }\n\n public updateTransforms(\n handler: number,\n offset: number,\n instancesTransforms: Matrix4[],\n ): void {\n assertValidNonNegativeNumber(\n offset,\n \"UIGenericInstancedPlane updateTransforms offset\",\n );\n\n const descriptor = this.resolveDescriptor(handler);\n\n if (instancesTransforms.length + offset > descriptor.count) {\n throw new Error(\n `Too many instances for handler: ${handler}, offset: ${offset}, and count: ${instancesTransforms.length}`,\n );\n }\n\n for (let i = 0; i < instancesTransforms.length; i++) {\n const attribute = this.resolveBufferAttribute(\"instanceTransform\");\n const instanceOffset = descriptor.firstIndex + offset + i;\n\n const array = attribute.array as Float32Array;\n const itemOffset = instanceOffset * attribute.itemSize;\n const elements = instancesTransforms[i].elements;\n for (let j = 0; j < elements.length; j++) {\n array[itemOffset + j] = elements[j];\n }\n attribute.needsUpdate = true;\n }\n }\n\n public updateUVTransforms(\n handler: number,\n offset: number,\n uvTransforms: Matrix3[],\n ): void {\n assertValidNonNegativeNumber(\n offset,\n \"UIGenericInstancedPlane updateUVTransforms offset\",\n );\n\n const descriptor = this.resolveDescriptor(handler);\n\n if (uvTransforms.length + offset > descriptor.count) {\n throw new Error(\n `Too many instances for handler: ${handler}, offset: ${offset}, and count: ${uvTransforms.length}`,\n );\n }\n\n for (let i = 0; i < uvTransforms.length; i++) {\n const attribute = this.resolveBufferAttribute(\"uvTransform\");\n const instanceOffset = descriptor.firstIndex + offset + i;\n\n const array = attribute.array as Float32Array;\n const itemOffset = instanceOffset * attribute.itemSize;\n const elements = uvTransforms[i].elements;\n for (let j = 0; j < elements.length; j++) {\n array[itemOffset + j] = elements[j];\n }\n attribute.needsUpdate = true;\n }\n }\n\n public updateVisibility(\n handler: number,\n offset: number,\n instancesVisibility: boolean[],\n ): void {\n assertValidNonNegativeNumber(\n offset,\n \"UIGenericInstancedPlane updateVisibility offset\",\n );\n\n const descriptor = this.resolveDescriptor(handler);\n\n if (instancesVisibility.length + offset > descriptor.count) {\n throw new Error(\n `Too many instances for handler: ${handler}, offset: ${offset}, and count: ${instancesVisibility.length}`,\n );\n }\n\n for (let i = 0; i < instancesVisibility.length; i++) {\n const attribute = this.resolveBufferAttribute(\"visibility\");\n const instanceOffset = descriptor.firstIndex + offset + i;\n\n const array = attribute.array as Float32Array;\n const itemOffset = instanceOffset * attribute.itemSize;\n array[itemOffset] = instancesVisibility[i] ? 1 : 0;\n attribute.needsUpdate = true;\n }\n }\n\n public destroy(): void {\n this.instancedGeometry.dispose();\n this.shaderMaterial.dispose();\n }\n\n private resolveDescriptor(handler: number): Descriptor {\n const descriptor = this.handlerToDescriptor.get(handler);\n if (descriptor === undefined) {\n throw new Error(`No active range found for handler: ${handler}`);\n }\n return descriptor;\n }\n\n private resolveBufferAttribute(name: string): InstancedBufferAttribute {\n const attribute = this.propertyBuffers.get(`a_${name}`);\n if (attribute === undefined) {\n throw new Error(`No attribute found for property: ${name} (a_${name})`);\n }\n return attribute;\n }\n\n private resolveUniform(name: string): IUniform<unknown> {\n const uniform = this.shaderMaterial.uniforms[`u_${name}`] as\n | IUniform<unknown>\n | undefined;\n\n if (uniform === undefined) {\n throw new Error(`No uniform found for handler: ${name}`);\n }\n return uniform;\n }\n\n private resizeGeometry(newCapacity: number): void {\n for (const [name, oldAttribute] of this.propertyBuffers.entries()) {\n const itemSize = oldAttribute.itemSize;\n const newArray = new Float32Array(newCapacity * itemSize);\n\n newArray.set(oldAttribute.array as Float32Array);\n const newAttribute = new InstancedBufferAttribute(newArray, itemSize);\n\n this.instancedGeometry.setAttribute(`a_${name}`, newAttribute);\n this.propertyBuffers.set(`a_${name}`, newAttribute);\n }\n\n this.capacity = newCapacity;\n }\n\n private copyRangeData(\n sourceRange: Descriptor,\n targetRange: Descriptor,\n ): void {\n for (const attribute of this.propertyBuffers.values()) {\n const array = attribute.array as Float32Array;\n const itemSize = attribute.itemSize;\n\n const sourceStart = sourceRange.firstIndex * itemSize;\n const targetStart = targetRange.firstIndex * itemSize;\n const dataLength = sourceRange.count * itemSize;\n\n for (let i = 0; i < dataLength; i++) {\n array[targetStart + i] = array[sourceStart + i];\n }\n\n attribute.needsUpdate = true;\n }\n }\n\n private shiftRangesDown(startIndex: number, shiftAmount: number): void {\n for (const descriptor of this.handlerToDescriptor.values()) {\n if (descriptor.firstIndex >= startIndex) {\n descriptor.firstIndex -= shiftAmount;\n }\n }\n\n for (const attribute of this.propertyBuffers.values()) {\n const array = attribute.array as Float32Array;\n const itemSize = attribute.itemSize;\n\n const startByteIndex = startIndex * itemSize;\n const endByteIndex = this.instancedGeometry.instanceCount * itemSize;\n const shiftByteAmount = shiftAmount * itemSize;\n\n for (let i = startByteIndex; i < endByteIndex - shiftByteAmount; i++) {\n array[i] = array[i + shiftByteAmount];\n }\n\n attribute.needsUpdate = true;\n }\n }\n}\n","import { assertValidPositiveNumber } from \"./asserts\";\nimport { UIResizePolicy, UIResizePolicyEvent } from \"./UIResizePolicy\";\n\n/**\n * Scales by width in landscape, by height in portrait.\n */\nexport class UIResizePolicyCross extends UIResizePolicy {\n private fixedWidthLandscapeInternal: number;\n private fixedHeightPortraitInternal: number;\n\n constructor(fixedWidthLandscape: number, fixedHeightPortrait: number) {\n super();\n assertValidPositiveNumber(\n fixedWidthLandscape,\n \"UIResizePolicyCross.fixedWidthLandscape\",\n );\n assertValidPositiveNumber(\n fixedHeightPortrait,\n \"UIResizePolicyCross.fixedHeightPortrait\",\n );\n\n this.fixedWidthLandscapeInternal = fixedWidthLandscape;\n this.fixedHeightPortraitInternal = fixedHeightPortrait;\n }\n\n public get fixedWidthLandscape(): number {\n return this.fixedWidthLandscapeInternal;\n }\n public get fixedHeightPortrait(): number {\n return this.fixedHeightPortraitInternal;\n }\n\n public set fixedWidthLandscape(value: number) {\n assertValidPositiveNumber(value, \"UIResizePolicyCross.fixedWidthLandscape\");\n if (value !== this.fixedWidthLandscapeInternal) {\n this.fixedWidthLandscapeInternal = value;\n this.emit(UIResizePolicyEvent.CHANGE);\n }\n }\n\n public set fixedHeightPortrait(value: number) {\n assertValidPositiveNumber(value, \"UIResizePolicyCross.fixedHeightPortrait\");\n if (value !== this.fixedHeightPortraitInternal) {\n this.fixedHeightPortraitInternal = value;\n this.emit(UIResizePolicyEvent.CHANGE);\n }\n }\n\n public calculateScaleInternal(width: number, height: number): number {\n return width > height\n ? this.fixedWidthLandscapeInternal / width\n : this.fixedHeightPortraitInternal / height;\n }\n}\n","import { assertValidPositiveNumber } from \"./asserts\";\nimport { UIResizePolicy, UIResizePolicyEvent } from \"./UIResizePolicy\";\n\n/**\n * Scales by height in landscape, by width in portrait.\n */\nexport class UIResizePolicyCrossInverted extends UIResizePolicy {\n private fixedHeightLandscapeInternal: number;\n private fixedWidthPortraitInternal: number;\n\n constructor(fixedHeightLandscape: number, fixedWidthPortrait: number) {\n super();\n assertValidPositiveNumber(\n fixedHeightLandscape,\n \"UIResizePolicyCrossInverted.fixedHeightLandscape\",\n );\n assertValidPositiveNumber(\n fixedWidthPortrait,\n \"UIResizePolicyCrossInverted.fixedWidthPortrait\",\n );\n\n this.fixedHeightLandscapeInternal = fixedHeightLandscape;\n this.fixedWidthPortraitInternal = fixedWidthPortrait;\n }\n\n public get fixedHeightLandscape(): number {\n return this.fixedHeightLandscapeInternal;\n }\n public get fixedWidthPortrait(): number {\n return this.fixedWidthPortraitInternal;\n }\n\n public set fixedHeightLandscape(value: number) {\n assertValidPositiveNumber(\n value,\n \"UIResizePolicyCrossInverted.fixedHeightLandscape\",\n );\n if (value !== this.fixedHeightLandscapeInternal) {\n this.fixedHeightLandscapeInternal = value;\n this.emit(UIResizePolicyEvent.CHANGE);\n }\n }\n\n public set fixedWidthPortrait(value: number) {\n assertValidPositiveNumber(\n value,\n \"UIResizePolicyCrossInverted.fixedWidthPortrait\",\n );\n if (value !== this.fixedWidthPortraitInternal) {\n this.fixedWidthPortraitInternal = value;\n this.emit(UIResizePolicyEvent.CHANGE);\n }\n }\n\n protected calculateScaleInternal(width: number, height: number): number {\n return width > height\n ? this.fixedHeightLandscapeInternal / height\n : this.fixedWidthPortraitInternal / width;\n }\n}\n","import { assertValidPositiveNumber } from \"./asserts\";\nimport { UIResizePolicy, UIResizePolicyEvent } from \"./UIResizePolicy\";\n\n/**\n * Maintains fixed height, scales based on window height.\n *\n * Uses different heights for landscape vs portrait orientation,\n * and optionally for near-square aspect ratios.\n */\nexport class UIResizePolicyFixedHeight extends UIResizePolicy {\n private fixedHeightLandscapeInternal: number;\n private fixedHeightPortraitInternal: number;\n private fixedHeightSquareInternal: number;\n private squareEpsilonInternal: number;\n\n constructor(\n fixedHeightLandscape: number,\n fixedHeightPortrait: number,\n fixedHeightSquare: number = fixedHeightPortrait,\n squareEpsilon = 0.1,\n ) {\n super();\n assertValidPositiveNumber(\n fixedHeightLandscape,\n \"UIResizePolicyFixedHeight.fixedHeightLandscape\",\n );\n assertValidPositiveNumber(\n fixedHeightPortrait,\n \"UIResizePolicyFixedHeight.fixedHeightPortrait\",\n );\n assertValidPositiveNumber(\n fixedHeightSquare,\n \"UIResizePolicyFixedHeight.fixedHeightSquare\",\n );\n assertValidPositiveNumber(squareEpsilon, \"UIResizePolicy.squareEpsilon\");\n\n this.fixedHeightLandscapeInternal = fixedHeightLandscape;\n this.fixedHeightPortraitInternal = fixedHeightPortrait;\n this.fixedHeightSquareInternal = fixedHeightSquare;\n this.squareEpsilonInternal = squareEpsilon;\n }\n\n public get fixedHeightLandscape(): number {\n return this.fixedHeightLandscapeInternal;\n }\n public get fixedHeightPortrait(): number {\n return this.fixedHeightPortraitInternal;\n }\n public get fixedHeightSquare(): number {\n return this.fixedHeightSquareInternal;\n }\n public get squareEpsilon(): number {\n return this.squareEpsilonInternal;\n }\n\n public set fixedHeightLandscape(value: number) {\n assertValidPositiveNumber(\n value,\n \"UIResizePolicyFixedHeight.fixedHeightLandscape\",\n );\n if (value !== this.fixedHeightLandscapeInternal) {\n this.fixedHeightLandscapeInternal = value;\n this.emit(UIResizePolicyEvent.CHANGE);\n }\n }\n\n public set fixedHeightPortrait(value: number) {\n assertValidPositiveNumber(\n value,\n \"UIResizePolicyFixedHeight.fixedHeightPortrait\",\n );\n if (value !== this.fixedHeightPortraitInternal) {\n this.fixedHeightPortraitInternal = value;\n this.emit(UIResizePolicyEvent.CHANGE);\n }\n }\n\n public set fixedHeightSquare(value: number) {\n assertValidPositiveNumber(\n value,\n \"UIResizePolicyFixedHeight.fixedHeightSquare\",\n );\n if (value !== this.fixedHeightSquareInternal) {\n this.fixedHeightSquareInternal = value;\n this.emit(UIResizePolicyEvent.CHANGE);\n }\n }\n\n public set squareEpsilon(value: number) {\n assertValidPositiveNumber(value, \"UIResizePolicy.squareEpsilon\");\n if (value !== this.squareEpsilonInternal) {\n this.squareEpsilonInternal = value;\n this.emit(UIResizePolicyEvent.CHANGE);\n }\n }\n\n protected calculateScaleInternal(width: number, height: number): number {\n if (this.isSquare(width, height)) {\n return this.fixedHeightSquareInternal / height;\n }\n return width > height\n ? this.fixedHeightLandscapeInternal / height\n : this.fixedHeightPortraitInternal / height;\n }\n\n private isSquare(width: number, height: number): boolean {\n const ratio = width / height;\n return Math.abs(ratio - 1) <= this.squareEpsilonInternal;\n }\n}\n","import { assertValidPositiveNumber } from \"./asserts\";\nimport { UIResizePolicy, UIResizePolicyEvent } from \"./UIResizePolicy\";\n\n/**\n * Maintains fixed width, scales based on window width.\n *\n * Uses different widths for landscape vs portrait orientation, and optionally\n * a third width for near-square aspect ratios.\n */\nexport class UIResizePolicyFixedWidth extends UIResizePolicy {\n private fixedWidthLandscapeInternal: number;\n private fixedWidthPortraitInternal: number;\n private fixedWidthSquareInternal: number;\n private squareEpsilonInternal: number;\n\n constructor(\n fixedWidthLandscape: number,\n fixedWidthPortrait: number,\n fixedWidthSquare: number = fixedWidthPortrait,\n squareEpsilon = 0.1,\n ) {\n super();\n assertValidPositiveNumber(\n fixedWidthLandscape,\n \"UIResizePolicyFixedWidth.fixedWidthLandscape\",\n );\n assertValidPositiveNumber(\n fixedWidthPortrait,\n \"UIResizePolicyFixedWidth.fixedWidthPortrait\",\n );\n assertValidPositiveNumber(\n fixedWidthSquare,\n \"UIResizePolicyFixedWidth.fixedWidthSquare\",\n );\n assertValidPositiveNumber(squareEpsilon, \"UIResizePolicy.squareEpsilon\");\n\n this.fixedWidthLandscapeInternal = fixedWidthLandscape;\n this.fixedWidthPortraitInternal = fixedWidthPortrait;\n this.fixedWidthSquareInternal = fixedWidthSquare;\n this.squareEpsilonInternal = squareEpsilon;\n }\n\n public get fixedWidthLandscape(): number {\n return this.fixedWidthLandscapeInternal;\n }\n public get fixedWidthPortrait(): number {\n return this.fixedWidthPortraitInternal;\n }\n public get fixedWidthSquare(): number {\n return this.fixedWidthSquareInternal;\n }\n public get squareEpsilon(): number {\n return this.squareEpsilonInternal;\n }\n\n public set fixedWidthLandscape(value: number) {\n assertValidPositiveNumber(\n value,\n \"UIResizePolicyFixedWidth.fixedWidthLandscape\",\n );\n if (value !== this.fixedWidthLandscapeInternal) {\n this.fixedWidthLandscapeInternal = value;\n this.emit(UIResizePolicyEvent.CHANGE);\n }\n }\n\n public set fixedWidthPortrait(value: number) {\n assertValidPositiveNumber(\n value,\n \"UIResizePolicyFixedWidth.fixedWidthPortrait\",\n );\n if (value !== this.fixedWidthPortraitInternal) {\n this.fixedWidthPortraitInternal = value;\n this.emit(UIResizePolicyEvent.CHANGE);\n }\n }\n\n public set fixedWidthSquare(value: number) {\n assertValidPositiveNumber(\n value,\n \"UIResizePolicyFixedWidth.fixedWidthSquare\",\n );\n if (value !== this.fixedWidthSquareInternal) {\n this.fixedWidthSquareInternal = value;\n this.emit(UIResizePolicyEvent.CHANGE);\n }\n }\n\n public set squareEpsilon(value: number) {\n assertValidPositiveNumber(value, \"UIResizePolicy.squareEpsilon\");\n if (value !== this.squareEpsilonInternal) {\n this.squareEpsilonInternal = value;\n this.emit(UIResizePolicyEvent.CHANGE);\n }\n }\n\n protected calculateScaleInternal(width: number, height: number): number {\n if (this.isSquare(width, height)) {\n return this.fixedWidthSquareInternal / width;\n }\n return width > height\n ? this.fixedWidthLandscapeInternal / width\n : this.fixedWidthPortraitInternal / width;\n }\n\n /**\n * Determines if viewport aspect ratio is close to 1:1.\n */\n private isSquare(width: number, height: number): boolean {\n const ratio = width / height;\n return Math.abs(ratio - 1) <= this.squareEpsilonInternal;\n }\n}\n","import { isUITextStyle, type UITextStyle } from \"./UITextStyle\";\n\nexport interface UITextSpan {\n text: string;\n style?: Partial<UITextStyle>;\n}\n\nexport function isUITextSpan(obj?: unknown): obj is UITextSpan {\n return (\n obj !== null &&\n typeof obj === \"object\" &&\n \"text\" in obj &&\n typeof obj.text === \"string\" &&\n (!(\"style\" in obj) || isUITextStyle(obj.style))\n );\n}\n"],"names":["Eventail","DEFAULT_ANCHOR","source"],"mappings":";;AAAA;;;;;;;;;;;;AAYG;MACU,YAAY,CAAA;AAMvB;;;;;AAKG;AACH,IAAA,WAAA,CAAY,QAAQ,GAAG,CAAC,EAAE,KAA0B,EAAA;AAClD,QAAA,IAAI,CAAC,QAAQ,GAAG,QAAQ;AACxB,QAAA,IAAI,kBAAS,KAAK,GAAG,IAAI,GAAG,CAAC,KAAK,CAAC,GAAG,IAAI,GAAG,EAAE;IACjD;AAEA;;;;;;;;;AASG;AACI,IAAA,OAAO,IAAI,CAAC,CAAe,EAAE,CAAe,EAAA;QACjD,MAAM,MAAM,GAAG,IAAI,YAAY,CAC7B,CAAC,CAAC,QAAQ,GAAG,CAAC,CAAC,QAAQ,EACvB,KAAK,CAAC,IAAI,CAAC,CAAC,gBAAO,OAAO,EAAE,CAAC,CAC9B;QACD,KAAK,MAAM,CAAC,aAAa,EAAE,WAAW,CAAC,IAAI,CAAC,CAAA,cAAA,EAAQ;AAClD,YAAA,MAAM,CAAC,IAAI,CAAC,aAAa,EAAE,WAAW,CAAC;QACzC;AACA,QA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;AAC5B,SAAC,EAAE,OAAO,IAAI,GAAG,CAAC,IAAI,aAAa,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;AAEnD;;;;","x_google_ignoreList":[1,4,5,6,7,8,9]}
1
+ {"version":3,"file":"index.js","sources":["../src/miscellaneous/UIExpression.ts","../node_modules/eventail/dist/index.min.js","../src/miscellaneous/UIMode.ts","../src/miscellaneous/UIOrientation.ts","../node_modules/@lume/kiwi/dist/maptype.js","../node_modules/@lume/kiwi/dist/variable.js","../node_modules/@lume/kiwi/dist/expression.js","../node_modules/@lume/kiwi/dist/strength.js","../node_modules/@lume/kiwi/dist/constraint.js","../node_modules/@lume/kiwi/dist/solver.js","../src/miscellaneous/UIPriority.ts","../src/miscellaneous/UIColor.ts","../src/miscellaneous/UITransparencyMode.ts","../src/wrappers/UISceneWrapper.ts","../src/miscellaneous/UIRelation.ts","../src/wrappers/UISolverWrapper.ts","../src/layers/UILayer.ts","../src/constraints/UIConstraint.ts","../src/constraints/UISingleParameterConstraint.ts","../src/constraints/UIHeightConstraint.ts","../src/miscellaneous/asserts.ts","../src/constraints/UIHorizontalDistanceConstraint.ts","../src/constraints/UIHorizontalProportionConstraint.ts","../src/constraints/UIVerticalDistanceConstraint.ts","../src/constraints/UIVerticalProportionConstraint.ts","../src/constraints/UIWidthConstraint.ts","../src/builders/UIConstraint2DBuilder.ts","../src/constraints/UIAspectConstraint.ts","../src/builders/UICoverConstraintBuilder.ts","../src/builders/UIFitConstraintBuilder.ts","../src/constraints/UICustomConstraint.ts","../src/elements/UIAnchor.ts","../src/miscellaneous/UIInputEvent.ts","../src/miscellaneous/UIMicroAnchorMode.ts","../src/miscellaneous/UIMicro.ts","../src/elements/UIElement.ts","../src/elements/UIAnimatedImage.ts","../src/elements/UIDummy.ts","../src/elements/UIGraphics.ts","../src/elements/UIImage.ts","../src/miscellaneous/UINineSliceBorder.ts","../src/elements/UINineSline.ts","../src/elements/UIProgress.ts","../src/elements/UIScene.ts","../src/miscellaneous/UITextStyle.ts","../src/miscellaneous/textTools.ts","../src/miscellaneous/UITextPadding.ts","../src/elements/UIText.ts","../src/miscellaneous/UIResizePolicy.ts","../src/miscellaneous/UIResizePolicyNone.ts","../src/layers/UIFullscreenLayer.ts","../src/miscellaneous/UIGenericInstancedPlane.ts","../src/miscellaneous/UIResizePolicyCross.ts","../src/miscellaneous/UIResizePolicyCrossInverted.ts","../src/miscellaneous/UIResizePolicyFixedHeight.ts","../src/miscellaneous/UIResizePolicyFixedWidth.ts","../src/miscellaneous/UITextSpan.ts"],"sourcesContent":["/**\n * Mathematical expression builder for constraint equations in the UI layout system.\n *\n * UIExpression represents linear mathematical expressions of the form:\n * constant + coefficient₁ × variable₁ + coefficient₂ × variable₂ + ... + coefficientₙ × variableₙ\n *\n * These expressions are used to build constraint equations for the Kiwi solver,\n * enabling complex mathematical relationships between UI element properties.\n * Variables are referenced by their numeric descriptors from the solver system.\n *\n * @see {@link UIConstraint} - Constraints that use expressions\n * @see {@link UISolverWrapper} - Solver integration that creates variables\n */\nexport class UIExpression {\n /** The constant term of the expression. */\n public constant: number;\n /** Map of variable descriptors to their coefficients in the expression. */\n private readonly terms: Map<number, number>;\n\n /**\n * Creates a new UIExpression instance.\n *\n * @param constant - The constant term of the expression (defaults to 0)\n * @param terms - Optional array of [variableDescriptor, coefficient] pairs\n */\n constructor(constant = 0, terms?: [number, number][]) {\n this.constant = constant;\n this.terms = terms ? new Map(terms) : new Map();\n }\n\n /**\n * Creates a new expression that represents the sum of two expressions.\n *\n * Performs mathematical addition: (a.constant + a.terms) + (b.constant + b.terms)\n * Coefficients for the same variables are combined.\n *\n * @param a - The first expression\n * @param b - The second expression\n * @returns A new expression representing a + b\n */\n public static plus(a: UIExpression, b: UIExpression): UIExpression {\n const result = new UIExpression(\n a.constant + b.constant,\n Array.from(a.terms.entries()),\n );\n for (const [variableIndex, coefficient] of b.terms) {\n result.plus(variableIndex, coefficient);\n }\n return result;\n }\n\n /**\n * Creates a new expression that represents the difference of two expressions.\n *\n * Performs mathematical subtraction: (a.constant + a.terms) - (b.constant + b.terms)\n * Coefficients for the same variables are combined with subtraction.\n *\n * @param a - The first expression (minuend)\n * @param b - The second expression (subtrahend)\n * @returns A new expression representing a - b\n */\n public static minus(a: UIExpression, b: UIExpression): UIExpression {\n const result = new UIExpression(\n a.constant - b.constant,\n Array.from(a.terms.entries()),\n );\n for (const [variableIndex, coefficient] of b.terms) {\n result.minus(variableIndex, coefficient);\n }\n return result;\n }\n\n /**\n * Adds a variable term to this expression (mutating operation).\n *\n * If the variable already exists in the expression, its coefficient is\n * increased by the specified amount. Otherwise, a new term is added.\n *\n * @param variableIndex - The variable descriptor from the solver\n * @param coefficient - The coefficient to add for this variable\n * @returns This expression instance for method chaining\n */\n public plus(variableIndex: number, coefficient: number): this {\n this.terms.set(\n variableIndex,\n (this.terms.get(variableIndex) ?? 0) + coefficient,\n );\n return this;\n }\n\n /**\n * Subtracts a variable term from this expression (mutating operation).\n *\n * If the variable already exists in the expression, its coefficient is\n * decreased by the specified amount. Otherwise, a new term with negative\n * coefficient is added.\n *\n * @param variableIndex - The variable descriptor from the solver\n * @param coefficient - The coefficient to subtract for this variable\n * @returns This expression instance for method chaining\n */\n public minus(variableIndex: number, coefficient: number): this {\n return this.plus(variableIndex, -coefficient);\n }\n\n /**\n * Multiplies all terms in this expression by a scalar value (mutating operation).\n *\n * Both the constant term and all variable coefficients are multiplied\n * by the specified value.\n *\n * @param value - The scalar value to multiply by\n * @returns This expression instance for method chaining\n */\n public multiply(value: number): this {\n this.constant *= value;\n for (const [variableIndex, coefficient] of this.terms) {\n this.terms.set(variableIndex, coefficient * value);\n }\n return this;\n }\n\n /**\n * Divides all terms in this expression by a scalar value (mutating operation).\n *\n * Both the constant term and all variable coefficients are divided\n * by the specified value.\n *\n * @param value - The scalar value to divide by (must not be zero)\n * @returns This expression instance for method chaining\n */\n public divide(value: number): this {\n return this.multiply(1 / value);\n }\n\n /**\n * Checks if the expression contains a term for the specified variable.\n *\n * @param variableIndex - The variable descriptor to check for\n * @returns True if the expression has a term for this variable, false otherwise\n */\n public hasTerm(variableIndex: number): boolean {\n return this.terms.has(variableIndex);\n }\n\n /**\n * Copies the content of another expression into this expression (mutating operation).\n *\n * Replaces all terms and the constant of this expression with those\n * from the source expression.\n *\n * @param expression - The source expression to copy from\n * @returns This expression instance for method chaining\n */\n public copy(expression: UIExpression): this {\n this.constant = expression.constant;\n this.terms.clear();\n for (const [variableIndex, coefficient] of expression.terms) {\n this.terms.set(variableIndex, coefficient);\n }\n return this;\n }\n\n /**\n * Creates a deep copy of this expression.\n *\n * The returned expression is completely independent and can be modified\n * without affecting the original.\n *\n * @returns A new UIExpression instance with the same content\n */\n public clone(): UIExpression {\n return new UIExpression(this.constant, Array.from(this.terms.entries()));\n }\n\n /**\n * Prepares the variable terms for internal solver operations.\n *\n * Converts the internal terms map to an array format suitable for\n * integration with the constraint solver system.\n *\n * @returns Array of [variableDescriptor, coefficient] pairs\n * @internal\n */\n protected [\"prepareTermsInternal\"](): [number, number][] {\n return Array.from(this.terms.entries());\n }\n}\n","class t{constructor(t,i,r=0){this.t=new WeakMap,this.i=new Map,void 0!==t&&(void 0===i?this.i.set(t,r):this.t.set(i,new Map([[t,r]])))}insert(t,i,r=0){if(void 0===i){if(this.i.has(t))return;return void this.i.set(t,r)}const s=this.t.get(i);void 0===s?this.t.set(i,new Map([[t,r]])):s.has(t)||s.set(t,r)}remove(t,i){if(void 0===i)return void this.i.delete(t);const r=this.t.get(i);void 0!==r&&(r.delete(t),0===r.size&&this.t.delete(i))}has(t,i){if(void 0===i)return this.i.has(t);const r=this.t.get(i);return void 0!==r&&r.has(t)}getPriority(t,i){if(void 0===i)return this.i.get(t);const r=this.t.get(i);return void 0!==r?r.get(t):void 0}}class i{constructor(){this.o=new Map}on(t,i,r,s=0){return this.h(t,!1,s,i,r),this}once(t,i,r,s=0){return this.h(t,!0,s,i,r),this}off(t,i,r){const s=this.o.get(t);if(void 0===s)return this;s.u&&(s.u=!1,s.v=s.v.slice());const o=s.v;if(0===o.length)return this.o.delete(t),this;if(void 0===i){this.o.delete(t);for(let t=0;t<o.length;t++){const i=o[t];s.l.remove(i._,i.p)}return this}{const e=o.length;if(o[0]._===i&&o[0].p===r)return 1===e?this.o.delete(t):o.shift(),this;const n=e-1;if(o[n]._===i&&o[n].p===r)return o.pop(),this;if(e<10||o[0].M===o[n].M)for(let t=1;t<n;t++){const s=o[t];if(s._===i&&s.p===r)return o.splice(t,1),this}else{const t=s.l.getPriority(i,r);if(void 0===t)return this;let e=0,n=o.length-1;for(;e<=n;){const i=e+n>>>1;o[i].M<t?e=i+1:n=i-1}const c=e;for(n=o.length-1;e<=n;){const i=e+n>>>1;o[i].M<=t?e=i+1:n=i-1}const h=n;for(let t=c;t<=h;t++)if(o[t]._===i&&o[t].p===r)return o.splice(t,1),this}}return this}emit(t,...i){const r=this.o.get(t);if(void 0===r)return!1;if(0===r.v.length)return!1;r.u?r.v=r.v.slice():r.u=!0;const s=r.v;let o=!1;for(let t=0;t<s.length;t++){const r=s[t];r._.apply(r.p,i),r.k&&(o=!0,r.m=!0)}const e=this.o.get(t);if(void 0===e)return!0;e.v===s&&(e.u=!1);const n=e.v;if(o){let i=0;for(let t=0;t<n.length;t++){const r=n[t];r.m?e.l.remove(r._,r.p):n[i++]=r}0===i?this.o.delete(t):n.length=i}return!0}h(i,r,s,o,e){let n=this.o.get(i);if(void 0===n)return void this.o.set(i,{v:[{_:o,p:e,M:s,k:r,m:!1}],u:!1,l:new t(o,e,s)});if(n.l.has(o,e))throw Error(\"Event listener already exists\");n.l.insert(o,e,s);const c={_:o,p:e,M:s,k:r,m:!1};n.u&&(n.u=!1,n.v=n.v.slice());{const t=n.v,i=c.M;if(0===t.length||t[t.length-1].M<=i)return void t.push(c);if(t[0].M>=i)return void t.unshift(c);{let r=0,s=t.length;for(;r<s;){const o=r+s>>>1;t[o].M<i?r=o+1:s=o}t.splice(r,0,c)}}}}export{i as Eventail};\n//# sourceMappingURL=index.min.js.map\n","/**\n * Defines the visibility and interactivity state of UI elements.\n *\n * UI elements can be in one of three states:\n * - Hidden: Element is not visible and does not receive input\n * - Visible: Element is visible but does not receive input\n * - Interactive: Element is visible and can receive input events\n */\nexport enum UIMode {\n /**\n * Element is not rendered and does not receive input events.\n * Equivalent to setting `display: none` in CSS.\n */\n HIDDEN = 0,\n\n /**\n * Element is rendered but does not receive input events.\n * Equivalent to setting `pointer-events: none` in CSS.\n */\n VISIBLE = 1,\n\n /**\n * Element is rendered and can receive input events.\n * This is the fully active state for UI elements.\n */\n INTERACTIVE = 2,\n}\n","/**\n * Defines the screen orientation states for UI constraints.\n *\n * This enum is used to specify when certain UI constraints should be active\n * based on the current device/screen orientation.\n */\nexport enum UIOrientation {\n /**\n * Indicates a landscape orientation (width > height).\n * Constraints using this value will only be active in landscape mode.\n */\n HORIZONTAL = 0,\n\n /**\n * Indicates a portrait orientation (height > width).\n * Constraints using this value will only be active in portrait mode.\n */\n VERTICAL = 1,\n\n /**\n * Indicates that the constraint should always be active,\n * regardless of screen orientation.\n */\n ALWAYS = 2,\n}\n\n/**\n * Resolves an optional orientation to a definite value.\n *\n * @param orientation - The orientation to resolve, or undefined\n * @returns The provided orientation, or ALWAYS if none was provided\n */\nexport function resolveOrientation(orientation?: UIOrientation): UIOrientation {\n return orientation ?? UIOrientation.ALWAYS;\n}\n","export function createMap() {\n return new IndexedMap();\n}\nclass IndexedMap {\n index = {};\n array = [];\n /**\n * Returns the number of items in the array.\n */\n size() {\n return this.array.length;\n }\n /**\n * Returns true if the array is empty.\n */\n empty() {\n return this.array.length === 0;\n }\n /**\n * Returns the item at the given array index.\n *\n * @param index The integer index of the desired item.\n */\n itemAt(index) {\n return this.array[index];\n }\n /**\n * Returns true if the key is in the array, false otherwise.\n *\n * @param key The key to locate in the array.\n */\n contains(key) {\n return this.index[key.id()] !== undefined;\n }\n /**\n * Returns the pair associated with the given key, or undefined.\n *\n * @param key The key to locate in the array.\n */\n find(key) {\n const i = this.index[key.id()];\n return i === undefined ? undefined : this.array[i];\n }\n /**\n * Returns the pair associated with the key if it exists.\n *\n * If the key does not exist, a new pair will be created and\n * inserted using the value created by the given factory.\n *\n * @param key The key to locate in the array.\n * @param factory The function which creates the default value.\n */\n setDefault(key, factory) {\n const i = this.index[key.id()];\n if (i === undefined) {\n const pair = new Pair(key, factory());\n this.index[key.id()] = this.array.length;\n this.array.push(pair);\n return pair;\n }\n else {\n return this.array[i];\n }\n }\n /**\n * Insert the pair into the array and return the pair.\n *\n * This will overwrite any existing entry in the array.\n *\n * @param key The key portion of the pair.\n * @param value The value portion of the pair.\n */\n insert(key, value) {\n const pair = new Pair(key, value);\n const i = this.index[key.id()];\n if (i === undefined) {\n this.index[key.id()] = this.array.length;\n this.array.push(pair);\n }\n else {\n this.array[i] = pair;\n }\n return pair;\n }\n /**\n * Removes and returns the pair for the given key, or undefined.\n *\n * @param key The key to remove from the map.\n */\n erase(key) {\n const i = this.index[key.id()];\n if (i === undefined) {\n return undefined;\n }\n this.index[key.id()] = undefined;\n const pair = this.array[i];\n const last = this.array.pop();\n if (pair !== last) {\n this.array[i] = last;\n this.index[last.first.id()] = i;\n }\n return pair;\n }\n /**\n * Create a copy of this associative array.\n */\n copy() {\n const copy = new IndexedMap();\n for (let i = 0; i < this.array.length; i++) {\n const pair = this.array[i].copy();\n copy.array[i] = pair;\n copy.index[pair.first.id()] = i;\n }\n return copy;\n }\n}\n/**\n * A class which defines a generic pair object.\n * @private\n */\n// tslint:disable: max-classes-per-file\nclass Pair {\n first;\n second;\n /**\n * Construct a new Pair object.\n *\n * @param first The first item of the pair.\n * @param second The second item of the pair.\n */\n constructor(first, second) {\n this.first = first;\n this.second = second;\n }\n /**\n * Create a copy of the pair.\n */\n copy() {\n return new Pair(this.first, this.second);\n }\n}\n","import { Expression } from './expression.js';\n/**\n * The primary user constraint variable.\n *\n * @class\n * @param {String} [name=\"\"] The name to associated with the variable.\n */\nexport class Variable {\n constructor(name = '') {\n this._name = name;\n }\n /**\n * Returns the unique id number of the variable.\n * @private\n */\n id() {\n return this._id;\n }\n /**\n * Returns the name of the variable.\n *\n * @return {String} name of the variable\n */\n name() {\n return this._name;\n }\n /**\n * Set the name of the variable.\n *\n * @param {String} name Name of the variable\n */\n setName(name) {\n this._name = name;\n }\n /**\n * Returns the user context object of the variable.\n * @private\n */\n context() {\n return this._context;\n }\n /**\n * Set the user context object of the variable.\n * @private\n */\n setContext(context) {\n this._context = context;\n }\n /**\n * Returns the value of the variable.\n *\n * @return {Number} Calculated value\n */\n value() {\n return this._value;\n }\n /**\n * Set the value of the variable.\n * @private\n */\n setValue(value) {\n this._value = value;\n }\n /**\n * Creates a new Expression by adding a number, variable or expression\n * to the variable.\n *\n * @param {Number|Variable|Expression} value Value to add.\n * @return {Expression} expression\n */\n plus(value) {\n return new Expression(this, value);\n }\n /**\n * Creates a new Expression by substracting a number, variable or expression\n * from the variable.\n *\n * @param {Number|Variable|Expression} value Value to substract.\n * @return {Expression} expression\n */\n minus(value) {\n return new Expression(this, typeof value === 'number' ? -value : [-1, value]);\n }\n /**\n * Creates a new Expression by multiplying with a fixed number.\n *\n * @param {Number} coefficient Coefficient to multiply with.\n * @return {Expression} expression\n */\n multiply(coefficient) {\n return new Expression([coefficient, this]);\n }\n /**\n * Creates a new Expression by dividing with a fixed number.\n *\n * @param {Number} coefficient Coefficient to divide by.\n * @return {Expression} expression\n */\n divide(coefficient) {\n return new Expression([1 / coefficient, this]);\n }\n /**\n * Returns the JSON representation of the variable.\n * @private\n */\n toJSON() {\n return {\n name: this._name,\n value: this._value,\n };\n }\n toString() {\n return this._context + '[' + this._name + ':' + this._value + ']';\n }\n _name;\n _value = 0.0;\n _context = null;\n _id = VarId++;\n}\n/**\n * The internal variable id counter.\n * @private\n */\nlet VarId = 0;\n","import { createMap } from './maptype.js';\nimport { Variable } from './variable.js';\n/**\n * An expression of variable terms and a constant.\n *\n * The constructor accepts an arbitrary number of parameters,\n * each of which must be one of the following types:\n * - number\n * - Variable\n * - Expression\n * - 2-tuple of [number, Variable|Expression]\n *\n * The parameters are summed. The tuples are multiplied.\n *\n * @class\n * @param {...(number|Variable|Expression|Array)} args\n */\nexport class Expression {\n constructor() {\n let parsed = parseArgs(arguments);\n this._terms = parsed.terms;\n this._constant = parsed.constant;\n }\n /**\n * Returns the mapping of terms in the expression.\n *\n * This *must* be treated as const.\n * @private\n */\n terms() {\n return this._terms;\n }\n /**\n * Returns the constant of the expression.\n * @private\n */\n constant() {\n return this._constant;\n }\n /**\n * Returns the computed value of the expression.\n *\n * @private\n * @return {Number} computed value of the expression\n */\n value() {\n let result = this._constant;\n for (let i = 0, n = this._terms.size(); i < n; i++) {\n let pair = this._terms.itemAt(i);\n result += pair.first.value() * pair.second;\n }\n return result;\n }\n /**\n * Creates a new Expression by adding a number, variable or expression\n * to the expression.\n *\n * @param {Number|Variable|Expression} value Value to add.\n * @return {Expression} expression\n */\n plus(value) {\n return new Expression(this, value);\n }\n /**\n * Creates a new Expression by substracting a number, variable or expression\n * from the expression.\n *\n * @param {Number|Variable|Expression} value Value to substract.\n * @return {Expression} expression\n */\n minus(value) {\n return new Expression(this, typeof value === 'number' ? -value : [-1, value]);\n }\n /**\n * Creates a new Expression by multiplying with a fixed number.\n *\n * @param {Number} coefficient Coefficient to multiply with.\n * @return {Expression} expression\n */\n multiply(coefficient) {\n return new Expression([coefficient, this]);\n }\n /**\n * Creates a new Expression by dividing with a fixed number.\n *\n * @param {Number} coefficient Coefficient to divide by.\n * @return {Expression} expression\n */\n divide(coefficient) {\n return new Expression([1 / coefficient, this]);\n }\n isConstant() {\n return this._terms.size() == 0;\n }\n toString() {\n let result = this._terms.array\n .map(function (pair) {\n return pair.second + '*' + pair.first.toString();\n })\n .join(' + ');\n if (!this.isConstant() && this._constant !== 0) {\n result += ' + ';\n }\n result += this._constant;\n return result;\n }\n _terms;\n _constant;\n}\n/**\n * An internal argument parsing function.\n * @private\n */\nfunction parseArgs(args) {\n let constant = 0.0;\n let factory = () => 0.0;\n let terms = createMap();\n for (let i = 0, n = args.length; i < n; ++i) {\n let item = args[i];\n if (typeof item === 'number') {\n constant += item;\n }\n else if (item instanceof Variable) {\n terms.setDefault(item, factory).second += 1.0;\n }\n else if (item instanceof Expression) {\n constant += item.constant();\n let terms2 = item.terms();\n for (let j = 0, k = terms2.size(); j < k; j++) {\n let termPair = terms2.itemAt(j);\n terms.setDefault(termPair.first, factory).second += termPair.second;\n }\n }\n else if (item instanceof Array) {\n if (item.length !== 2) {\n throw new Error('array must have length 2');\n }\n let value = item[0];\n let value2 = item[1];\n if (typeof value !== 'number') {\n throw new Error('array item 0 must be a number');\n }\n if (value2 instanceof Variable) {\n terms.setDefault(value2, factory).second += value;\n }\n else if (value2 instanceof Expression) {\n constant += value2.constant() * value;\n let terms2 = value2.terms();\n for (let j = 0, k = terms2.size(); j < k; j++) {\n let termPair = terms2.itemAt(j);\n terms.setDefault(termPair.first, factory).second += termPair.second * value;\n }\n }\n else {\n throw new Error('array item 1 must be a variable or expression');\n }\n }\n else {\n throw new Error('invalid Expression argument: ' + item);\n }\n }\n return { terms, constant };\n}\n","/**\n * @class Strength\n */\nexport class Strength {\n /**\n * Create a new symbolic strength.\n *\n * @param a strong\n * @param b medium\n * @param c weak\n * @param [w] weight\n * @return strength\n */\n static create(a, b, c, w = 1.0) {\n let result = 0.0;\n result += Math.max(0.0, Math.min(1000.0, a * w)) * 1000000.0;\n result += Math.max(0.0, Math.min(1000.0, b * w)) * 1000.0;\n result += Math.max(0.0, Math.min(1000.0, c * w));\n return result;\n }\n /**\n * The 'required' symbolic strength.\n */\n static required = Strength.create(1000.0, 1000.0, 1000.0);\n /**\n * The 'strong' symbolic strength.\n */\n static strong = Strength.create(1.0, 0.0, 0.0);\n /**\n * The 'medium' symbolic strength.\n */\n static medium = Strength.create(0.0, 1.0, 0.0);\n /**\n * The 'weak' symbolic strength.\n */\n static weak = Strength.create(0.0, 0.0, 1.0);\n /**\n * Clip a symbolic strength to the allowed min and max.\n * @private\n */\n static clip(value) {\n return Math.max(0.0, Math.min(Strength.required, value));\n }\n}\n","import { Expression } from './expression.js';\nimport { Strength } from './strength.js';\n/**\n * An enum defining the linear constraint operators.\n *\n * |Value|Operator|Description|\n * |----|-----|-----|\n * |`Le`|<=|Less than equal|\n * |`Ge`|>=|Greater than equal|\n * |`Eq`|==|Equal|\n *\n * @enum {Number}\n */\nexport var Operator;\n(function (Operator) {\n Operator[Operator[\"Le\"] = 0] = \"Le\";\n Operator[Operator[\"Ge\"] = 1] = \"Ge\";\n Operator[Operator[\"Eq\"] = 2] = \"Eq\";\n})(Operator || (Operator = {}));\n/**\n * A linear constraint equation.\n *\n * A constraint equation is composed of an expression, an operator,\n * and a strength. The RHS of the equation is implicitly zero.\n *\n * @class\n * @param {Expression} expression The constraint expression (LHS).\n * @param {Operator} operator The equation operator.\n * @param {Expression} [rhs] Right hand side of the expression.\n * @param {Number} [strength=Strength.required] The strength of the constraint.\n */\nexport class Constraint {\n constructor(expression, operator, rhs, strength = Strength.required) {\n this._operator = operator;\n this._strength = Strength.clip(strength);\n if (rhs === undefined && expression instanceof Expression) {\n this._expression = expression;\n }\n else {\n this._expression = expression.minus(rhs);\n }\n }\n /**\n * Returns the unique id number of the constraint.\n * @private\n */\n id() {\n return this._id;\n }\n /**\n * Returns the expression of the constraint.\n *\n * @return {Expression} expression\n */\n expression() {\n return this._expression;\n }\n /**\n * Returns the relational operator of the constraint.\n *\n * @return {Operator} linear constraint operator\n */\n op() {\n return this._operator;\n }\n /**\n * Returns the strength of the constraint.\n *\n * @return {Number} strength\n */\n strength() {\n return this._strength;\n }\n toString() {\n return (this._expression.toString() + ' ' + ['<=', '>=', '='][this._operator] + ' 0 (' + this._strength.toString() + ')');\n }\n _expression;\n _operator;\n _strength;\n _id = CnId++;\n}\n/**\n * The internal constraint id counter.\n * @private\n */\nlet CnId = 0;\n","import { Constraint, Operator } from './constraint.js';\nimport { Expression } from './expression.js';\nimport { createMap } from './maptype.js';\nimport { Strength } from './strength.js';\n/**\n * The constraint solver class.\n *\n * @class\n */\nexport class Solver {\n /**\n * @type {number} - The max number of solver iterations before an error\n * is thrown, in order to prevent infinite iteration. Default: `10,000`.\n */\n maxIterations = 1000;\n /**\n * Construct a new Solver.\n */\n constructor() { }\n /**\n * Creates and add a constraint to the solver.\n *\n * @param {Expression|Variable} lhs Left hand side of the expression\n * @param {Operator} operator Operator\n * @param {Expression|Variable|Number} rhs Right hand side of the expression\n * @param {Number} [strength=Strength.required] Strength\n */\n createConstraint(lhs, operator, rhs, strength = Strength.required) {\n let cn = new Constraint(lhs, operator, rhs, strength);\n this.addConstraint(cn);\n return cn;\n }\n /**\n * Add a constraint to the solver.\n *\n * @param {Constraint} constraint Constraint to add to the solver\n */\n addConstraint(constraint) {\n let cnPair = this._cnMap.find(constraint);\n if (cnPair !== undefined) {\n throw new Error('duplicate constraint');\n }\n // Creating a row causes symbols to be reserved for the variables\n // in the constraint. If this method exits with an exception,\n // then its possible those variables will linger in the var map.\n // Since its likely that those variables will be used in other\n // constraints and since exceptional conditions are uncommon,\n // i'm not too worried about aggressive cleanup of the var map.\n let data = this._createRow(constraint);\n let row = data.row;\n let tag = data.tag;\n let subject = this._chooseSubject(row, tag);\n // If chooseSubject couldnt find a valid entering symbol, one\n // last option is available if the entire row is composed of\n // dummy variables. If the constant of the row is zero, then\n // this represents redundant constraints and the new dummy\n // marker can enter the basis. If the constant is non-zero,\n // then it represents an unsatisfiable constraint.\n if (subject.type() === SymbolType.Invalid && row.allDummies()) {\n if (!nearZero(row.constant())) {\n throw new Error('unsatisfiable constraint');\n }\n else {\n subject = tag.marker;\n }\n }\n // If an entering symbol still isn't found, then the row must\n // be added using an artificial variable. If that fails, then\n // the row represents an unsatisfiable constraint.\n if (subject.type() === SymbolType.Invalid) {\n if (!this._addWithArtificialVariable(row)) {\n throw new Error('unsatisfiable constraint');\n }\n }\n else {\n row.solveFor(subject);\n this._substitute(subject, row);\n this._rowMap.insert(subject, row);\n }\n this._cnMap.insert(constraint, tag);\n // Optimizing after each constraint is added performs less\n // aggregate work due to a smaller average system size. It\n // also ensures the solver remains in a consistent state.\n this._optimize(this._objective);\n }\n /**\n * Remove a constraint from the solver.\n *\n * @param {Constraint} constraint Constraint to remove from the solver\n */\n removeConstraint(constraint) {\n let cnPair = this._cnMap.erase(constraint);\n if (cnPair === undefined) {\n throw new Error('unknown constraint');\n }\n // Remove the error effects from the objective function\n // *before* pivoting, or substitutions into the objective\n // will lead to incorrect solver results.\n this._removeConstraintEffects(constraint, cnPair.second);\n // If the marker is basic, simply drop the row. Otherwise,\n // pivot the marker into the basis and then drop the row.\n let marker = cnPair.second.marker;\n let rowPair = this._rowMap.erase(marker);\n if (rowPair === undefined) {\n let leaving = this._getMarkerLeavingSymbol(marker);\n if (leaving.type() === SymbolType.Invalid) {\n throw new Error('failed to find leaving row');\n }\n rowPair = this._rowMap.erase(leaving);\n rowPair.second.solveForEx(leaving, marker);\n this._substitute(marker, rowPair.second);\n }\n // Optimizing after each constraint is removed ensures that the\n // solver remains consistent. It makes the solver api easier to\n // use at a small tradeoff for speed.\n this._optimize(this._objective);\n }\n /**\n * Test whether the solver contains the constraint.\n *\n * @param {Constraint} constraint Constraint to test for\n * @return {Bool} true or false\n */\n hasConstraint(constraint) {\n return this._cnMap.contains(constraint);\n }\n /**\n * Get an array of the current constraints.\n *\n * @return {Constraint[]}\n */\n getConstraints() {\n return this._cnMap.array.map(({ first }) => first);\n }\n /**\n * Add an edit variable to the solver.\n *\n * @param {Variable} variable Edit variable to add to the solver\n * @param {Number} strength Strength, should be less than `Strength.required`\n */\n addEditVariable(variable, strength) {\n let editPair = this._editMap.find(variable);\n if (editPair !== undefined) {\n throw new Error('duplicate edit variable');\n }\n strength = Strength.clip(strength);\n if (strength === Strength.required) {\n throw new Error('bad required strength');\n }\n let expr = new Expression(variable);\n let cn = new Constraint(expr, Operator.Eq, undefined, strength);\n this.addConstraint(cn);\n let tag = this._cnMap.find(cn).second;\n let info = { tag, constraint: cn, constant: 0.0 };\n this._editMap.insert(variable, info);\n }\n /**\n * Remove an edit variable from the solver.\n *\n * @param {Variable} variable Edit variable to remove from the solver\n */\n removeEditVariable(variable) {\n let editPair = this._editMap.erase(variable);\n if (editPair === undefined) {\n throw new Error('unknown edit variable');\n }\n this.removeConstraint(editPair.second.constraint);\n }\n /**\n * Test whether the solver contains the edit variable.\n *\n * @param {Variable} variable Edit variable to test for\n * @return {Bool} true or false\n */\n hasEditVariable(variable) {\n return this._editMap.contains(variable);\n }\n /**\n * Suggest the value of an edit variable.\n *\n * @param {Variable} variable Edit variable to suggest a value for\n * @param {Number} value Suggested value\n */\n suggestValue(variable, value) {\n let editPair = this._editMap.find(variable);\n if (editPair === undefined) {\n throw new Error('unknown edit variable');\n }\n let rows = this._rowMap;\n let info = editPair.second;\n let delta = value - info.constant;\n info.constant = value;\n // Check first if the positive error variable is basic.\n let marker = info.tag.marker;\n let rowPair = rows.find(marker);\n if (rowPair !== undefined) {\n if (rowPair.second.add(-delta) < 0.0) {\n this._infeasibleRows.push(marker);\n }\n this._dualOptimize();\n return;\n }\n // Check next if the negative error variable is basic.\n let other = info.tag.other;\n rowPair = rows.find(other);\n if (rowPair !== undefined) {\n if (rowPair.second.add(delta) < 0.0) {\n this._infeasibleRows.push(other);\n }\n this._dualOptimize();\n return;\n }\n // Otherwise update each row where the error variables exist.\n for (let i = 0, n = rows.size(); i < n; ++i) {\n let rowPair = rows.itemAt(i);\n let row = rowPair.second;\n let coeff = row.coefficientFor(marker);\n if (coeff !== 0.0 && row.add(delta * coeff) < 0.0 && rowPair.first.type() !== SymbolType.External) {\n this._infeasibleRows.push(rowPair.first);\n }\n }\n this._dualOptimize();\n }\n /**\n * Update the values of the variables.\n */\n updateVariables() {\n let vars = this._varMap;\n let rows = this._rowMap;\n for (let i = 0, n = vars.size(); i < n; ++i) {\n let pair = vars.itemAt(i);\n let rowPair = rows.find(pair.second);\n if (rowPair !== undefined) {\n pair.first.setValue(rowPair.second.constant());\n }\n else {\n pair.first.setValue(0.0);\n }\n }\n }\n /**\n * Get the symbol for the given variable.\n *\n * If a symbol does not exist for the variable, one will be created.\n * @private\n */\n _getVarSymbol(variable) {\n let factory = () => this._makeSymbol(SymbolType.External);\n return this._varMap.setDefault(variable, factory).second;\n }\n /**\n * Create a new Row object for the given constraint.\n *\n * The terms in the constraint will be converted to cells in the row.\n * Any term in the constraint with a coefficient of zero is ignored.\n * This method uses the `_getVarSymbol` method to get the symbol for\n * the variables added to the row. If the symbol for a given cell\n * variable is basic, the cell variable will be substituted with the\n * basic row.\n *\n * The necessary slack and error variables will be added to the row.\n * If the constant for the row is negative, the sign for the row\n * will be inverted so the constant becomes positive.\n *\n * Returns the created Row and the tag for tracking the constraint.\n * @private\n */\n _createRow(constraint) {\n let expr = constraint.expression();\n let row = new Row(expr.constant());\n // Substitute the current basic variables into the row.\n let terms = expr.terms();\n for (let i = 0, n = terms.size(); i < n; ++i) {\n let termPair = terms.itemAt(i);\n if (!nearZero(termPair.second)) {\n let symbol = this._getVarSymbol(termPair.first);\n let basicPair = this._rowMap.find(symbol);\n if (basicPair !== undefined) {\n row.insertRow(basicPair.second, termPair.second);\n }\n else {\n row.insertSymbol(symbol, termPair.second);\n }\n }\n }\n // Add the necessary slack, error, and dummy variables.\n let objective = this._objective;\n let strength = constraint.strength();\n let tag = { marker: INVALID_SYMBOL, other: INVALID_SYMBOL };\n switch (constraint.op()) {\n case Operator.Le:\n case Operator.Ge: {\n let coeff = constraint.op() === Operator.Le ? 1.0 : -1.0;\n let slack = this._makeSymbol(SymbolType.Slack);\n tag.marker = slack;\n row.insertSymbol(slack, coeff);\n if (strength < Strength.required) {\n let error = this._makeSymbol(SymbolType.Error);\n tag.other = error;\n row.insertSymbol(error, -coeff);\n objective.insertSymbol(error, strength);\n }\n break;\n }\n case Operator.Eq: {\n if (strength < Strength.required) {\n let errplus = this._makeSymbol(SymbolType.Error);\n let errminus = this._makeSymbol(SymbolType.Error);\n tag.marker = errplus;\n tag.other = errminus;\n row.insertSymbol(errplus, -1.0); // v = eplus - eminus\n row.insertSymbol(errminus, 1.0); // v - eplus + eminus = 0\n objective.insertSymbol(errplus, strength);\n objective.insertSymbol(errminus, strength);\n }\n else {\n let dummy = this._makeSymbol(SymbolType.Dummy);\n tag.marker = dummy;\n row.insertSymbol(dummy);\n }\n break;\n }\n }\n // Ensure the row has a positive constant.\n if (row.constant() < 0.0) {\n row.reverseSign();\n }\n return { row, tag };\n }\n /**\n * Choose the subject for solving for the row.\n *\n * This method will choose the best subject for using as the solve\n * target for the row. An invalid symbol will be returned if there\n * is no valid target.\n *\n * The symbols are chosen according to the following precedence:\n *\n * 1) The first symbol representing an external variable.\n * 2) A negative slack or error tag variable.\n *\n * If a subject cannot be found, an invalid symbol will be returned.\n *\n * @private\n */\n _chooseSubject(row, tag) {\n let cells = row.cells();\n for (let i = 0, n = cells.size(); i < n; ++i) {\n let pair = cells.itemAt(i);\n if (pair.first.type() === SymbolType.External) {\n return pair.first;\n }\n }\n let type = tag.marker.type();\n if (type === SymbolType.Slack || type === SymbolType.Error) {\n if (row.coefficientFor(tag.marker) < 0.0) {\n return tag.marker;\n }\n }\n type = tag.other.type();\n if (type === SymbolType.Slack || type === SymbolType.Error) {\n if (row.coefficientFor(tag.other) < 0.0) {\n return tag.other;\n }\n }\n return INVALID_SYMBOL;\n }\n /**\n * Add the row to the tableau using an artificial variable.\n *\n * This will return false if the constraint cannot be satisfied.\n *\n * @private\n */\n _addWithArtificialVariable(row) {\n // Create and add the artificial variable to the tableau.\n let art = this._makeSymbol(SymbolType.Slack);\n this._rowMap.insert(art, row.copy());\n this._artificial = row.copy();\n // Optimize the artificial objective. This is successful\n // only if the artificial objective is optimized to zero.\n this._optimize(this._artificial);\n let success = nearZero(this._artificial.constant());\n this._artificial = null;\n // If the artificial variable is basic, pivot the row so that\n // it becomes non-basic. If the row is constant, exit early.\n let pair = this._rowMap.erase(art);\n if (pair !== undefined) {\n let basicRow = pair.second;\n if (basicRow.isConstant()) {\n return success;\n }\n let entering = this._anyPivotableSymbol(basicRow);\n if (entering.type() === SymbolType.Invalid) {\n return false; // unsatisfiable (will this ever happen?)\n }\n basicRow.solveForEx(art, entering);\n this._substitute(entering, basicRow);\n this._rowMap.insert(entering, basicRow);\n }\n // Remove the artificial variable from the tableau.\n let rows = this._rowMap;\n for (let i = 0, n = rows.size(); i < n; ++i) {\n rows.itemAt(i).second.removeSymbol(art);\n }\n this._objective.removeSymbol(art);\n return success;\n }\n /**\n * Substitute the parametric symbol with the given row.\n *\n * This method will substitute all instances of the parametric symbol\n * in the tableau and the objective function with the given row.\n *\n * @private\n */\n _substitute(symbol, row) {\n let rows = this._rowMap;\n for (let i = 0, n = rows.size(); i < n; ++i) {\n let pair = rows.itemAt(i);\n pair.second.substitute(symbol, row);\n if (pair.second.constant() < 0.0 && pair.first.type() !== SymbolType.External) {\n this._infeasibleRows.push(pair.first);\n }\n }\n this._objective.substitute(symbol, row);\n if (this._artificial) {\n this._artificial.substitute(symbol, row);\n }\n }\n /**\n * Optimize the system for the given objective function.\n *\n * This method performs iterations of Phase 2 of the simplex method\n * until the objective function reaches a minimum.\n *\n * @private\n */\n _optimize(objective) {\n let iterations = 0;\n while (iterations < this.maxIterations) {\n let entering = this._getEnteringSymbol(objective);\n if (entering.type() === SymbolType.Invalid) {\n return;\n }\n let leaving = this._getLeavingSymbol(entering);\n if (leaving.type() === SymbolType.Invalid) {\n throw new Error('the objective is unbounded');\n }\n // pivot the entering symbol into the basis\n let row = this._rowMap.erase(leaving).second;\n row.solveForEx(leaving, entering);\n this._substitute(entering, row);\n this._rowMap.insert(entering, row);\n iterations++;\n }\n throw new Error('solver iterations exceeded');\n }\n /**\n * Optimize the system using the dual of the simplex method.\n *\n * The current state of the system should be such that the objective\n * function is optimal, but not feasible. This method will perform\n * an iteration of the dual simplex method to make the solution both\n * optimal and feasible.\n *\n * @private\n */\n _dualOptimize() {\n let rows = this._rowMap;\n let infeasible = this._infeasibleRows;\n while (infeasible.length !== 0) {\n let leaving = infeasible.pop();\n let pair = rows.find(leaving);\n if (pair !== undefined && pair.second.constant() < 0.0) {\n let entering = this._getDualEnteringSymbol(pair.second);\n if (entering.type() === SymbolType.Invalid) {\n throw new Error('dual optimize failed');\n }\n // pivot the entering symbol into the basis\n let row = pair.second;\n rows.erase(leaving);\n row.solveForEx(leaving, entering);\n this._substitute(entering, row);\n rows.insert(entering, row);\n }\n }\n }\n /**\n * Compute the entering variable for a pivot operation.\n *\n * This method will return first symbol in the objective function which\n * is non-dummy and has a coefficient less than zero. If no symbol meets\n * the criteria, it means the objective function is at a minimum, and an\n * invalid symbol is returned.\n *\n * @private\n */\n _getEnteringSymbol(objective) {\n let cells = objective.cells();\n for (let i = 0, n = cells.size(); i < n; ++i) {\n let pair = cells.itemAt(i);\n let symbol = pair.first;\n if (pair.second < 0.0 && symbol.type() !== SymbolType.Dummy) {\n return symbol;\n }\n }\n return INVALID_SYMBOL;\n }\n /**\n * Compute the entering symbol for the dual optimize operation.\n *\n * This method will return the symbol in the row which has a positive\n * coefficient and yields the minimum ratio for its respective symbol\n * in the objective function. The provided row *must* be infeasible.\n * If no symbol is found which meats the criteria, an invalid symbol\n * is returned.\n *\n * @private\n */\n _getDualEnteringSymbol(row) {\n let ratio = Number.MAX_VALUE;\n let entering = INVALID_SYMBOL;\n let cells = row.cells();\n for (let i = 0, n = cells.size(); i < n; ++i) {\n let pair = cells.itemAt(i);\n let symbol = pair.first;\n let c = pair.second;\n if (c > 0.0 && symbol.type() !== SymbolType.Dummy) {\n let coeff = this._objective.coefficientFor(symbol);\n let r = coeff / c;\n if (r < ratio) {\n ratio = r;\n entering = symbol;\n }\n }\n }\n return entering;\n }\n /**\n * Compute the symbol for pivot exit row.\n *\n * This method will return the symbol for the exit row in the row\n * map. If no appropriate exit symbol is found, an invalid symbol\n * will be returned. This indicates that the objective function is\n * unbounded.\n *\n * @private\n */\n _getLeavingSymbol(entering) {\n let ratio = Number.MAX_VALUE;\n let found = INVALID_SYMBOL;\n let rows = this._rowMap;\n for (let i = 0, n = rows.size(); i < n; ++i) {\n let pair = rows.itemAt(i);\n let symbol = pair.first;\n if (symbol.type() !== SymbolType.External) {\n let row = pair.second;\n let temp = row.coefficientFor(entering);\n if (temp < 0.0) {\n let temp_ratio = -row.constant() / temp;\n if (temp_ratio < ratio) {\n ratio = temp_ratio;\n found = symbol;\n }\n }\n }\n }\n return found;\n }\n /**\n * Compute the leaving symbol for a marker variable.\n *\n * This method will return a symbol corresponding to a basic row\n * which holds the given marker variable. The row will be chosen\n * according to the following precedence:\n *\n * 1) The row with a restricted basic varible and a negative coefficient\n * for the marker with the smallest ratio of -constant / coefficient.\n *\n * 2) The row with a restricted basic variable and the smallest ratio\n * of constant / coefficient.\n *\n * 3) The last unrestricted row which contains the marker.\n *\n * If the marker does not exist in any row, an invalid symbol will be\n * returned. This indicates an internal solver error since the marker\n * *should* exist somewhere in the tableau.\n *\n * @private\n */\n _getMarkerLeavingSymbol(marker) {\n let dmax = Number.MAX_VALUE;\n let r1 = dmax;\n let r2 = dmax;\n let invalid = INVALID_SYMBOL;\n let first = invalid;\n let second = invalid;\n let third = invalid;\n let rows = this._rowMap;\n for (let i = 0, n = rows.size(); i < n; ++i) {\n let pair = rows.itemAt(i);\n let row = pair.second;\n let c = row.coefficientFor(marker);\n if (c === 0.0) {\n continue;\n }\n let symbol = pair.first;\n if (symbol.type() === SymbolType.External) {\n third = symbol;\n }\n else if (c < 0.0) {\n let r = -row.constant() / c;\n if (r < r1) {\n r1 = r;\n first = symbol;\n }\n }\n else {\n let r = row.constant() / c;\n if (r < r2) {\n r2 = r;\n second = symbol;\n }\n }\n }\n if (first !== invalid) {\n return first;\n }\n if (second !== invalid) {\n return second;\n }\n return third;\n }\n /**\n * Remove the effects of a constraint on the objective function.\n *\n * @private\n */\n _removeConstraintEffects(cn, tag) {\n if (tag.marker.type() === SymbolType.Error) {\n this._removeMarkerEffects(tag.marker, cn.strength());\n }\n if (tag.other.type() === SymbolType.Error) {\n this._removeMarkerEffects(tag.other, cn.strength());\n }\n }\n /**\n * Remove the effects of an error marker on the objective function.\n *\n * @private\n */\n _removeMarkerEffects(marker, strength) {\n let pair = this._rowMap.find(marker);\n if (pair !== undefined) {\n this._objective.insertRow(pair.second, -strength);\n }\n else {\n this._objective.insertSymbol(marker, -strength);\n }\n }\n /**\n * Get the first Slack or Error symbol in the row.\n *\n * If no such symbol is present, an invalid symbol will be returned.\n *\n * @private\n */\n _anyPivotableSymbol(row) {\n let cells = row.cells();\n for (let i = 0, n = cells.size(); i < n; ++i) {\n let pair = cells.itemAt(i);\n let type = pair.first.type();\n if (type === SymbolType.Slack || type === SymbolType.Error) {\n return pair.first;\n }\n }\n return INVALID_SYMBOL;\n }\n /**\n * Returns a new Symbol of the given type.\n *\n * @private\n */\n _makeSymbol(type) {\n return new Symbol(type, this._idTick++);\n }\n _cnMap = createCnMap();\n _rowMap = createRowMap();\n _varMap = createVarMap();\n _editMap = createEditMap();\n _infeasibleRows = [];\n _objective = new Row();\n _artificial = null;\n _idTick = 0;\n}\n/**\n * Test whether a value is approximately zero.\n * @private\n */\nfunction nearZero(value) {\n let eps = 1.0e-8;\n return value < 0.0 ? -value < eps : value < eps;\n}\n/**\n * An internal function for creating a constraint map.\n * @private\n */\nfunction createCnMap() {\n return createMap();\n}\n/**\n * An internal function for creating a row map.\n * @private\n */\nfunction createRowMap() {\n return createMap();\n}\n/**\n * An internal function for creating a variable map.\n * @private\n */\nfunction createVarMap() {\n return createMap();\n}\n/**\n * An internal function for creating an edit map.\n * @private\n */\nfunction createEditMap() {\n return createMap();\n}\n/**\n * An enum defining the available symbol types.\n * @private\n */\nvar SymbolType;\n(function (SymbolType) {\n SymbolType[SymbolType[\"Invalid\"] = 0] = \"Invalid\";\n SymbolType[SymbolType[\"External\"] = 1] = \"External\";\n SymbolType[SymbolType[\"Slack\"] = 2] = \"Slack\";\n SymbolType[SymbolType[\"Error\"] = 3] = \"Error\";\n SymbolType[SymbolType[\"Dummy\"] = 4] = \"Dummy\";\n})(SymbolType || (SymbolType = {}));\n/**\n * An internal class representing a symbol in the solver.\n * @private\n */\nclass Symbol {\n /**\n * Construct a new Symbol\n *\n * @param [type] The type of the symbol.\n * @param [id] The unique id number of the symbol.\n */\n constructor(type, id) {\n this._id = id;\n this._type = type;\n }\n /**\n * Returns the unique id number of the symbol.\n */\n id() {\n return this._id;\n }\n /**\n * Returns the type of the symbol.\n */\n type() {\n return this._type;\n }\n _id;\n _type;\n}\n/**\n * A static invalid symbol\n * @private\n */\nlet INVALID_SYMBOL = new Symbol(SymbolType.Invalid, -1);\n/**\n * An internal row class used by the solver.\n * @private\n */\nclass Row {\n /**\n * Construct a new Row.\n */\n constructor(constant = 0.0) {\n this._constant = constant;\n }\n /**\n * Returns the mapping of symbols to coefficients.\n */\n cells() {\n return this._cellMap;\n }\n /**\n * Returns the constant for the row.\n */\n constant() {\n return this._constant;\n }\n /**\n * Returns true if the row is a constant value.\n */\n isConstant() {\n return this._cellMap.empty();\n }\n /**\n * Returns true if the Row has all dummy symbols.\n */\n allDummies() {\n let cells = this._cellMap;\n for (let i = 0, n = cells.size(); i < n; ++i) {\n let pair = cells.itemAt(i);\n if (pair.first.type() !== SymbolType.Dummy) {\n return false;\n }\n }\n return true;\n }\n /**\n * Create a copy of the row.\n */\n copy() {\n let theCopy = new Row(this._constant);\n theCopy._cellMap = this._cellMap.copy();\n return theCopy;\n }\n /**\n * Add a constant value to the row constant.\n *\n * Returns the new value of the constant.\n */\n add(value) {\n return (this._constant += value);\n }\n /**\n * Insert the symbol into the row with the given coefficient.\n *\n * If the symbol already exists in the row, the coefficient\n * will be added to the existing coefficient. If the resulting\n * coefficient is zero, the symbol will be removed from the row.\n */\n insertSymbol(symbol, coefficient = 1.0) {\n let pair = this._cellMap.setDefault(symbol, () => 0.0);\n if (nearZero((pair.second += coefficient))) {\n this._cellMap.erase(symbol);\n }\n }\n /**\n * Insert a row into this row with a given coefficient.\n *\n * The constant and the cells of the other row will be\n * multiplied by the coefficient and added to this row. Any\n * cell with a resulting coefficient of zero will be removed\n * from the row.\n */\n insertRow(other, coefficient = 1.0) {\n this._constant += other._constant * coefficient;\n let cells = other._cellMap;\n for (let i = 0, n = cells.size(); i < n; ++i) {\n let pair = cells.itemAt(i);\n this.insertSymbol(pair.first, pair.second * coefficient);\n }\n }\n /**\n * Remove a symbol from the row.\n */\n removeSymbol(symbol) {\n this._cellMap.erase(symbol);\n }\n /**\n * Reverse the sign of the constant and cells in the row.\n */\n reverseSign() {\n this._constant = -this._constant;\n let cells = this._cellMap;\n for (let i = 0, n = cells.size(); i < n; ++i) {\n let pair = cells.itemAt(i);\n pair.second = -pair.second;\n }\n }\n /**\n * Solve the row for the given symbol.\n *\n * This method assumes the row is of the form\n * a * x + b * y + c = 0 and (assuming solve for x) will modify\n * the row to represent the right hand side of\n * x = -b/a * y - c / a. The target symbol will be removed from\n * the row, and the constant and other cells will be multiplied\n * by the negative inverse of the target coefficient.\n *\n * The given symbol *must* exist in the row.\n */\n solveFor(symbol) {\n let cells = this._cellMap;\n let pair = cells.erase(symbol);\n let coeff = -1.0 / pair.second;\n this._constant *= coeff;\n for (let i = 0, n = cells.size(); i < n; ++i) {\n cells.itemAt(i).second *= coeff;\n }\n }\n /**\n * Solve the row for the given symbols.\n *\n * This method assumes the row is of the form\n * x = b * y + c and will solve the row such that\n * y = x / b - c / b. The rhs symbol will be removed from the\n * row, the lhs added, and the result divided by the negative\n * inverse of the rhs coefficient.\n *\n * The lhs symbol *must not* exist in the row, and the rhs\n * symbol must* exist in the row.\n */\n solveForEx(lhs, rhs) {\n this.insertSymbol(lhs, -1.0);\n this.solveFor(rhs);\n }\n /**\n * Returns the coefficient for the given symbol.\n */\n coefficientFor(symbol) {\n let pair = this._cellMap.find(symbol);\n return pair !== undefined ? pair.second : 0.0;\n }\n /**\n * Substitute a symbol with the data from another row.\n *\n * Given a row of the form a * x + b and a substitution of the\n * form x = 3 * y + c the row will be updated to reflect the\n * expression 3 * a * y + a * c + b.\n *\n * If the symbol does not exist in the row, this is a no-op.\n */\n substitute(symbol, row) {\n let pair = this._cellMap.erase(symbol);\n if (pair !== undefined) {\n this.insertRow(row, pair.second);\n }\n }\n _cellMap = createMap();\n _constant;\n}\n","import { Strength } from \"@lume/kiwi\";\n\n/** High priority value for constraint solver strength calculations. */\nconst HIGH_PRIORITY = 1000;\n/** Medium priority value for constraint solver strength calculations. */\nconst MEDIUM_PRIORITY = 100;\n/** Low priority value for constraint solver strength calculations. */\nconst LOW_PRIORITY = 10;\n\n/**\n * Priority levels for UI layout constraints and variables.\n *\n * UIPriority defines a hierarchical system of priority levels used by the\n * constraint solver to determine which constraints should take precedence\n * when conflicts arise. Lower numeric values represent higher priority,\n * with P0 being the highest priority and P7 being the lowest.\n *\n * The priority system maps to Kiwi solver strength values with different\n * strength components (required, strong, medium, weak) to create a nuanced\n * priority hierarchy for layout solving.\n *\n * @see {@link convertPriority} - Converts to Kiwi solver strength values\n */\nexport enum UIPriority {\n /** Highest priority - required constraints that must be satisfied. */\n P0 = 0,\n /** High priority - strong constraints with medium strength. */\n P1 = 1,\n /** Medium-high priority - strong constraints with low strength. */\n P2 = 2,\n /** Medium priority - medium strength constraints. */\n P3 = 3,\n /** Medium-low priority - medium strength constraints with low weight. */\n P4 = 4,\n /** Low priority - weak strength constraints with medium weight. */\n P5 = 5,\n /** Very low priority - weak strength constraints with low weight. */\n P6 = 6,\n /** Lowest priority - weak strength constraints with minimal weight. */\n P7 = 7,\n}\n\n/**\n * Converts UIPriority enum values to Kiwi solver strength values.\n *\n * This function maps the UI priority levels to the three-component strength\n * system used by the Kiwi constraint solver (required, strong, medium, weak).\n * Higher priority levels get stronger constraint strength values.\n *\n * @param priority - The UI priority level to convert\n * @returns The corresponding Kiwi solver strength value\n * @throws Will throw an error if an invalid priority is provided\n * @see {@link UIPriority} - Priority level definitions\n */\nexport function convertPriority(priority: UIPriority): number {\n switch (priority) {\n case UIPriority.P0:\n return Strength.create(HIGH_PRIORITY, HIGH_PRIORITY, HIGH_PRIORITY);\n case UIPriority.P1:\n return Strength.create(MEDIUM_PRIORITY, 0, 0);\n case UIPriority.P2:\n return Strength.create(LOW_PRIORITY, 0, 0);\n case UIPriority.P3:\n return Strength.create(0, MEDIUM_PRIORITY, 0);\n case UIPriority.P4:\n return Strength.create(0, LOW_PRIORITY, 0);\n case UIPriority.P5:\n return Strength.create(0, 0, MEDIUM_PRIORITY);\n case UIPriority.P6:\n return Strength.create(0, 0, LOW_PRIORITY);\n case UIPriority.P7:\n return Strength.create(0, 0, 1);\n default:\n throw new Error(`Invalid priority: ${priority}`);\n }\n}\n\n/**\n * Resolves an optional priority value to a concrete UIPriority.\n *\n * If no priority is provided, returns the default highest priority (P0).\n * This function is commonly used in constraint creation where priority\n * is an optional parameter.\n *\n * @param priority - The optional priority value to resolve\n * @returns The resolved priority, defaulting to P0 if undefined\n */\nexport function resolvePriority(priority?: UIPriority): UIPriority {\n return priority ?? UIPriority.P0;\n}\n","import { Eventail } from \"eventail\";\nimport type { Color } from \"three\";\n\nconst COLORS: Record<string, number | undefined> = {\n black: 0x000000,\n white: 0xffffff,\n red: 0xff0000,\n green: 0x008000,\n blue: 0x0000ff,\n yellow: 0xffff00,\n cyan: 0x00ffff,\n magenta: 0xff00ff,\n\n gray: 0x808080,\n grey: 0x808080,\n silver: 0xc0c0c0,\n maroon: 0x800000,\n olive: 0x808000,\n lime: 0x00ff00,\n aqua: 0x00ffff,\n teal: 0x008080,\n navy: 0x000080,\n fuchsia: 0xff00ff,\n purple: 0x800080,\n\n orange: 0xffa500,\n pink: 0xffc0cb,\n brown: 0xa52a2a,\n gold: 0xffd700,\n violet: 0xee82ee,\n indigo: 0x4b0082,\n coral: 0xff7f50,\n salmon: 0xfa8072,\n khaki: 0xf0e68c,\n plum: 0xdda0dd,\n orchid: 0xda70d6,\n tan: 0xd2b48c,\n beige: 0xf5f5dc,\n mint: 0x98fb98,\n lavender: 0xe6e6fa,\n crimson: 0xdc143c,\n azure: 0xf0ffff,\n ivory: 0xfffff0,\n snow: 0xfffafa,\n};\n\n/**\n * Predefined color names supported by UIColor.\n */\nexport type UIColorName =\n | \"black\"\n | \"white\"\n | \"red\"\n | \"green\"\n | \"blue\"\n | \"yellow\"\n | \"cyan\"\n | \"magenta\"\n | \"gray\"\n | \"grey\"\n | \"silver\"\n | \"maroon\"\n | \"olive\"\n | \"lime\"\n | \"aqua\"\n | \"teal\"\n | \"navy\"\n | \"fuchsia\"\n | \"purple\"\n | \"orange\"\n | \"pink\"\n | \"brown\"\n | \"gold\"\n | \"violet\"\n | \"indigo\"\n | \"coral\"\n | \"salmon\"\n | \"khaki\"\n | \"plum\"\n | \"orchid\"\n | \"tan\"\n | \"beige\"\n | \"mint\"\n | \"lavender\"\n | \"crimson\"\n | \"azure\"\n | \"ivory\"\n | \"snow\";\n\n/**\n * Events emitted by UIColor.\n */\nexport enum UIColorEvent {\n /** Emitted when color components change. */\n CHANGE = \"change\",\n}\n\n/**\n * Event-based RGBA color with support for RGB, HSL, hex, and named colors.\n * Color components are stored as normalized values (0-1).\n */\nexport class UIColor extends Eventail {\n private rInternal = 1;\n private gInternal = 1;\n private bInternal = 1;\n private aInternal = 1;\n\n constructor();\n /**\n * @param colorName - Named color\n * @param a - Alpha (0-1)\n */\n // eslint-disable-next-line @typescript-eslint/unified-signatures -- Separate overloads make the different constructor patterns more clear\n constructor(colorName: UIColorName, a?: number);\n /**\n * @param r - Red (0-1)\n * @param g - Green (0-1)\n * @param b - Blue (0-1)\n * @param a - Alpha (0-1)\n */\n // eslint-disable-next-line @typescript-eslint/unified-signatures -- Separate overloads make the different constructor patterns more clear\n constructor(r: number, g: number, b: number, a?: number);\n /**\n * @param hexRGB - Hex RGB value (e.g., 0xFF0000)\n * @param a - Alpha (0-1)\n */\n // eslint-disable-next-line @typescript-eslint/unified-signatures -- Separate overloads make the different constructor patterns more clear\n constructor(hexRGB: number, a?: number);\n constructor(...args: unknown[]) {\n super();\n\n if (args.length >= 3 && typeof args[0] === \"number\") {\n const [r, g, b, a = 1] = args as number[];\n this.rInternal = r;\n this.gInternal = g;\n this.bInternal = b;\n this.aInternal = a;\n } else if (args.length >= 1) {\n const [first, a = 1] = args;\n if (typeof first === \"string\") {\n this.setName(first as UIColorName, a as number);\n } else {\n this.setHexRGB(first as number, a as number);\n }\n }\n }\n\n /** Red component (0-1). */\n public get r(): number {\n return this.rInternal;\n }\n\n /** Green component (0-1). */\n public get g(): number {\n return this.gInternal;\n }\n\n /** Blue component (0-1). */\n public get b(): number {\n return this.bInternal;\n }\n\n /** Alpha component (0-1). */\n public get a(): number {\n return this.aInternal;\n }\n\n public set r(value: number) {\n if (value !== this.rInternal) {\n this.rInternal = value;\n this.emit(UIColorEvent.CHANGE, this);\n }\n }\n\n public set g(value: number) {\n if (value !== this.gInternal) {\n this.gInternal = value;\n this.emit(UIColorEvent.CHANGE, this);\n }\n }\n\n public set b(value: number) {\n if (value !== this.bInternal) {\n this.bInternal = value;\n this.emit(UIColorEvent.CHANGE, this);\n }\n }\n\n public set a(value: number) {\n if (value !== this.aInternal) {\n this.aInternal = value;\n this.emit(UIColorEvent.CHANGE, this);\n }\n }\n\n /**\n * Sets all color components.\n *\n * @param r - Red (0-1)\n * @param g - Green (0-1)\n * @param b - Blue (0-1)\n * @param a - Alpha (0-1)\n * @returns This instance\n */\n public set(\n r: number,\n g: number,\n b: number,\n a: number = this.aInternal,\n ): this {\n if (\n r !== this.rInternal ||\n g !== this.gInternal ||\n b !== this.bInternal ||\n a !== this.aInternal\n ) {\n this.rInternal = r;\n this.gInternal = g;\n this.bInternal = b;\n this.aInternal = a;\n this.emit(UIColorEvent.CHANGE, this);\n }\n return this;\n }\n\n /**\n * Returns 32-bit hex RGBA value (alpha in MSB).\n */\n public getHexRGBA(): number {\n return (\n (Math.round(this.rInternal * 255) << 24) |\n (Math.round(this.gInternal * 255) << 16) |\n (Math.round(this.bInternal * 255) << 8) |\n Math.round(this.aInternal * 255)\n );\n }\n\n /**\n * Returns 24-bit hex RGB value.\n */\n public getHexRGB(): number {\n return (\n (Math.round(this.rInternal * 255) << 16) |\n (Math.round(this.gInternal * 255) << 8) |\n Math.round(this.bInternal * 255)\n );\n }\n\n /**\n * Converts to HSL format.\n *\n * @returns Object with h (0-360), s (0-1), l (0-1)\n */\n public getHSL(): { h: number; s: number; l: number } {\n const { rInternal: r, gInternal: g, bInternal: b } = this;\n const max = Math.max(r, g, b);\n const min = Math.min(r, g, b);\n const d = max - min;\n const l = (max + min) / 2;\n\n let h = 0;\n if (d !== 0) {\n if (max === r) {\n h = (g - b) / d + (g < b ? 6 : 0);\n } else if (max === g) {\n h = (b - r) / d + 2;\n } else {\n h = (r - g) / d + 4;\n }\n h *= 60;\n }\n\n const s = d === 0 ? 0 : d / (1 - Math.abs(2 * l - 1));\n return { h, s, l };\n }\n\n /**\n * Sets color from 32-bit hex RGBA value.\n *\n * @param hex - Hex RGBA (alpha in MSB)\n * @returns This instance\n */\n public setHexRGBA(hex: number): this {\n const r = ((hex >> 16) & 0xff) / 255;\n const g = ((hex >> 8) & 0xff) / 255;\n const b = (hex & 0xff) / 255;\n const a = ((hex >> 24) & 0xff) / 255;\n if (\n r !== this.rInternal ||\n g !== this.gInternal ||\n b !== this.bInternal ||\n a !== this.aInternal\n ) {\n this.rInternal = r;\n this.gInternal = g;\n this.bInternal = b;\n this.aInternal = a;\n this.emit(UIColorEvent.CHANGE, this);\n }\n return this;\n }\n\n /**\n * Sets color from 24-bit hex RGB value.\n *\n * @param hex - Hex RGB (e.g., 0xFF0000)\n * @param a - Alpha (0-1)\n * @returns This instance\n */\n public setHexRGB(hex: number, a = this.aInternal): this {\n const r = ((hex >> 16) & 0xff) / 255;\n const g = ((hex >> 8) & 0xff) / 255;\n const b = (hex & 0xff) / 255;\n if (\n r !== this.rInternal ||\n g !== this.gInternal ||\n b !== this.bInternal ||\n a !== this.aInternal\n ) {\n this.rInternal = r;\n this.gInternal = g;\n this.bInternal = b;\n this.aInternal = a;\n this.emit(UIColorEvent.CHANGE, this);\n }\n return this;\n }\n\n /**\n * Sets color from HSL values.\n *\n * @param h - Hue (0-360)\n * @param s - Saturation (0-1)\n * @param l - Lightness (0-1)\n * @param a - Alpha (0-1)\n * @returns This instance\n */\n public setHSL(h: number, s: number, l: number, a = this.aInternal): this {\n const c = (1 - Math.abs(2 * l - 1)) * s;\n const hp = h / 60;\n const x = c * (1 - Math.abs((hp % 2) - 1));\n let [r, g, b] =\n hp < 1\n ? [c, x, 0]\n : hp < 2\n ? [x, c, 0]\n : hp < 3\n ? [0, c, x]\n : hp < 4\n ? [0, x, c]\n : hp < 5\n ? [x, 0, c]\n : [c, 0, x];\n\n const m = l - c / 2;\n return this.set(r + m, g + m, b + m, a);\n }\n\n /**\n * Sets color from predefined name.\n *\n * @param colorName - Color name\n * @param a - Alpha (0-1)\n * @returns This instance\n * @throws Error if color name is unknown\n */\n public setName(colorName: UIColorName, a = this.aInternal): this {\n const normalizedName = colorName.toLowerCase().trim();\n const hex = COLORS[normalizedName];\n\n if (hex === undefined) {\n throw new Error(`Unknown color name: \"${colorName}\".`);\n }\n\n return this.setHexRGB(hex, a);\n }\n\n /**\n * Returns CSS rgba() string.\n */\n public toCSSColor(): string {\n const r = Math.round(this.rInternal * 255);\n const g = Math.round(this.gInternal * 255);\n const b = Math.round(this.bInternal * 255);\n return `rgba(${r}, ${g}, ${b}, ${this.aInternal})`;\n }\n\n /**\n * Copies values from another color.\n *\n * @param color - UIColor or Three.js Color\n * @returns This instance\n */\n public copy(color: UIColor | Color): this {\n if (color instanceof UIColor) {\n if (\n this.rInternal !== color.rInternal ||\n this.gInternal !== color.gInternal ||\n this.bInternal !== color.bInternal ||\n this.aInternal !== color.aInternal\n ) {\n this.rInternal = color.rInternal;\n this.gInternal = color.gInternal;\n this.bInternal = color.bInternal;\n this.aInternal = color.aInternal;\n this.emit(UIColorEvent.CHANGE, this);\n }\n } else {\n if (\n this.rInternal !== color.r ||\n this.gInternal !== color.g ||\n this.bInternal !== color.b ||\n this.aInternal !== 1\n ) {\n this.rInternal = color.r;\n this.gInternal = color.g;\n this.bInternal = color.b;\n this.aInternal = 1;\n this.emit(UIColorEvent.CHANGE, this);\n }\n }\n\n return this;\n }\n\n /**\n * Creates a copy of this color.\n */\n public clone(): UIColor {\n return new UIColor(\n this.rInternal,\n this.gInternal,\n this.bInternal,\n this.aInternal,\n );\n }\n}\n","/**\n * Transparency rendering modes for UI elements.\n *\n * Controls how transparent and semi-transparent pixels are handled during rendering.\n * Each mode offers different performance and visual quality trade-offs.\n */\nexport enum UITransparencyMode {\n /**\n * Clip mode - pixels are either fully opaque or fully transparent.\n * Uses alpha testing to discard pixels below a threshold.\n * Best performance but no smooth transparency gradients.\n */\n CLIP = 0,\n\n /**\n * Hash mode - dithered transparency using screen-door transparency.\n * Creates transparency illusion through pixel patterns.\n * Good performance with better visual quality than CLIP.\n */\n HASH = 1,\n\n /**\n * Blend mode - true alpha blending with smooth transparency.\n * Supports full range of transparency values with smooth gradients.\n * Best visual quality but requires depth sorting and impacts performance.\n */\n BLEND = 2,\n}\n","import type { Object3D, WebGLRenderer } from \"three\";\nimport {\n Color,\n Matrix2,\n Matrix3,\n Matrix4,\n Mesh,\n OrthographicCamera,\n PlaneGeometry,\n Scene,\n ShaderMaterial,\n Texture,\n Vector2,\n Vector3,\n Vector4,\n} from \"three\";\nimport { UIColor } from \"../miscellaneous/UIColor\";\nimport type { UISceneWrapperClientAPI } from \"../miscellaneous/UISceneWrapperClientAPI\";\nimport { UITransparencyMode } from \"../miscellaneous/UITransparencyMode\";\nimport fragmentShader from \"../shaders/UIPlane.fs\";\nimport vertexShader from \"../shaders/UIPlane.vs\";\n\nconst DEFAULT_ALPHA_TEST = 0.25;\nconst COLOR = new Color();\n\n// eslint-disable-next-line @typescript-eslint/no-explicit-any -- Constructor type needs to accept any arguments for generic type mapping\ntype Constructor = new (...args: any[]) => any;\n\nconst UNIFROM_TYPE_MAP = new Map<Constructor, string>([\n [UIColor, \"vec4\"],\n [Color, \"vec3\"],\n [Texture, \"sampler2D\"],\n [Vector2, \"vec2\"],\n [Vector3, \"vec3\"],\n [Vector4, \"vec4\"],\n [Matrix2, \"mat2\"],\n [Matrix3, \"mat3\"],\n [Matrix4, \"mat4\"],\n]);\n\ntype UIPropertyType =\n | UIColor\n | Color\n | Texture\n | Vector2\n | Vector3\n | Vector4\n | Matrix2\n | Matrix3\n | Matrix4;\n\nfunction buildUniformDeclaraction(name: string, value: unknown): string {\n if (typeof value === \"number\") {\n return `uniform float ${name};`;\n }\n for (const [objectType, glslType] of UNIFROM_TYPE_MAP) {\n if (value instanceof objectType) {\n return `uniform ${glslType} ${name};`;\n }\n }\n throw new Error(`Unsupported uniform type for key \"${name}\"`);\n}\n\nconst Z_LIMIT = 1024;\nconst GEOMETRY_SIZE = 1;\nconst GEOMETRY_OFFSET = GEOMETRY_SIZE / 2;\n\nexport const geometry = new PlaneGeometry(\n GEOMETRY_SIZE,\n GEOMETRY_SIZE,\n).translate(GEOMETRY_OFFSET, GEOMETRY_OFFSET, 0);\n\nlet originalClearColor: Color = new Color();\nlet originalClearAlpha = 0;\nlet originalAutoClear = false;\nlet originalAutoClearColor = false;\nlet originalAutoClearDepth = false;\nlet originalAutoClearStencil = false;\n\ninterface Descriptor {\n plane: Mesh;\n material: ShaderMaterial;\n}\n\nexport class UISceneWrapper implements UISceneWrapperClientAPI {\n private readonly scene = new Scene();\n private readonly camera: OrthographicCamera;\n\n private readonly descriptors = new Map<number, Descriptor>();\n private lastPlaneIndex = 0;\n\n constructor(w: number, h: number) {\n this.camera = new OrthographicCamera(0, w, h, 0, -Z_LIMIT, Z_LIMIT);\n }\n\n public createPlane(\n source: string,\n uniforms: Record<string, UIPropertyType>,\n ): number {\n const entries = Object.entries(uniforms);\n const material = new ShaderMaterial({\n uniforms: {\n alphaTest: { value: DEFAULT_ALPHA_TEST },\n ...Object.fromEntries(\n entries.map(([k, v]) => [\n k,\n {\n value: v instanceof UIColor ? new Vector4(v.r, v.g, v.b, v.a) : v,\n },\n ]),\n ),\n },\n vertexShader,\n fragmentShader:\n fragmentShader +\n entries.map(([k, v]) => buildUniformDeclaraction(k, v)).join(\"\\n\") +\n source,\n transparent: false,\n alphaTest: DEFAULT_ALPHA_TEST,\n alphaHash: false,\n lights: false,\n fog: false,\n depthWrite: false,\n depthTest: true,\n });\n\n const plane = new Mesh(geometry, material);\n plane.frustumCulled = false;\n plane.matrixAutoUpdate = false;\n this.scene.add(plane);\n\n const index = this.lastPlaneIndex++;\n this.descriptors.set(index, { plane, material });\n\n return index;\n }\n\n public destroyPlane(handler: number): this {\n const descriptor = this.resolveDescriptor(handler);\n this.scene.remove(descriptor.plane);\n this.descriptors.delete(handler);\n return this;\n }\n\n public setTransform(handler: number, value: Matrix4): this {\n const descriptor = this.resolveDescriptor(handler);\n descriptor.plane.matrix.copy(value);\n descriptor.plane.matrixWorldNeedsUpdate = true;\n return this;\n }\n\n public setUniform(\n handler: number,\n uniform: string,\n value: UIPropertyType,\n ): this {\n const descriptor = this.resolveDescriptor(handler);\n if (!(uniform in descriptor.material.uniforms)) {\n throw new Error(`Uniform ${uniform} not found in material`);\n }\n if (value instanceof UIColor) {\n const linear = COLOR.set(value.r, value.g, value.b);\n linear.convertSRGBToLinear();\n\n descriptor.material.uniforms[uniform].value.set(\n linear.r,\n linear.g,\n linear.b,\n value.a,\n );\n } else {\n descriptor.material.uniforms[uniform].value = value;\n }\n return this;\n }\n\n public setTransparency(handler: number, mode: UITransparencyMode): this {\n const descriptor = this.resolveDescriptor(handler);\n if (mode === UITransparencyMode.BLEND) {\n descriptor.material.transparent = true;\n descriptor.material.alphaTest = 0;\n descriptor.material.uniforms[\"alphaTest\"].value = 0;\n descriptor.material.alphaHash = false;\n } else if (mode === UITransparencyMode.CLIP) {\n descriptor.material.transparent = false;\n descriptor.material.alphaTest = DEFAULT_ALPHA_TEST;\n descriptor.material.uniforms[\"alphaTest\"].value = DEFAULT_ALPHA_TEST;\n descriptor.material.alphaHash = false;\n } else {\n descriptor.material.transparent = false;\n descriptor.material.alphaTest = 0;\n descriptor.material.uniforms[\"alphaTest\"].value = 0;\n descriptor.material.alphaHash = true;\n }\n descriptor.material.uniformsNeedUpdate = true;\n descriptor.material.needsUpdate = true;\n return this;\n }\n\n public setVisibility(handler: number, visible: boolean): this {\n const descriptor = this.resolveDescriptor(handler);\n descriptor.plane.visible = visible;\n return this;\n }\n\n public insertCustomObject(object: Object3D): this {\n this.scene.add(object);\n return this;\n }\n\n public removeCustomObject(object: Object3D): this {\n this.scene.remove(object);\n return this;\n }\n\n public resize(width: number, height: number): this {\n this.camera.right = width;\n this.camera.top = height;\n this.camera.updateProjectionMatrix();\n return this;\n }\n\n public render(renderer: WebGLRenderer): this {\n originalClearColor = renderer.getClearColor(originalClearColor);\n originalClearAlpha = renderer.getClearAlpha();\n originalAutoClear = renderer.autoClear;\n originalAutoClearColor = renderer.autoClearColor;\n originalAutoClearDepth = renderer.autoClearDepth;\n originalAutoClearStencil = renderer.autoClearStencil;\n\n renderer.autoClear = false;\n renderer.autoClearColor = false;\n renderer.autoClearDepth = false;\n renderer.autoClearStencil = false;\n renderer.setClearColor(0x000000, 1);\n\n renderer.clear(false, true, true);\n renderer.render(this.scene, this.camera);\n\n renderer.setClearColor(originalClearColor);\n renderer.setClearAlpha(originalClearAlpha);\n renderer.autoClear = originalAutoClear;\n renderer.autoClearColor = originalAutoClearColor;\n renderer.autoClearDepth = originalAutoClearDepth;\n renderer.autoClearStencil = originalAutoClearStencil;\n return this;\n }\n\n private resolveDescriptor(handler: number): Descriptor {\n const descriptor = this.descriptors.get(handler);\n if (!descriptor) {\n throw new Error(`No descriptor found for handler ${handler}`);\n }\n return descriptor;\n }\n}\n","import { Operator } from \"@lume/kiwi\";\n\n/**\n * Relational operators for UI layout constraints.\n *\n * UIRelation defines the mathematical relationship between the left-hand\n * and right-hand sides of constraint equations. These relations are used\n * by the constraint solver to determine how expressions should be compared\n * when solving layout constraints.\n *\n * @see {@link convertRelation} - Converts to Kiwi solver operators\n */\nexport enum UIRelation {\n /** Equality relation: left-hand side equals right-hand side. */\n EQUAL = 0,\n /** Less than or equal relation: left-hand side ≤ right-hand side. */\n LESS_THAN = 1,\n /** Greater than or equal relation: left-hand side ≥ right-hand side. */\n GREATER_THAN = 2,\n}\n\n/**\n * Converts UIRelation enum values to Kiwi solver operator values.\n *\n * This function maps the UI relation types to the corresponding operators\n * used by the Kiwi constraint solver for mathematical comparisons in\n * constraint equations.\n *\n * @param relation - The UI relation type to convert\n * @returns The corresponding Kiwi solver operator\n * @throws Will throw an error if an invalid relation is provided\n * @see {@link UIRelation} - Relation type definitions\n */\nexport function convertRelation(relation: UIRelation): Operator {\n switch (relation) {\n case UIRelation.EQUAL:\n return Operator.Eq;\n case UIRelation.LESS_THAN:\n return Operator.Le;\n case UIRelation.GREATER_THAN:\n return Operator.Ge;\n default:\n throw new Error(`Invalid relation: ${relation}`);\n }\n}\n\n/**\n * Resolves an optional relation value to a concrete UIRelation.\n *\n * If no relation is provided, returns the default equality relation.\n * This function is commonly used in constraint creation where relation\n * is an optional parameter.\n *\n * @param relation - The optional relation value to resolve\n * @returns The resolved relation, defaulting to EQUAL if undefined\n */\nexport function resolveRelation(relation?: UIRelation): UIRelation {\n return relation ?? UIRelation.EQUAL;\n}\n","import { Constraint, Expression, Solver, Variable } from \"@lume/kiwi\";\nimport { UIExpression } from \"../miscellaneous/UIExpression\";\nimport { convertPriority, UIPriority } from \"../miscellaneous/UIPriority\";\nimport { convertRelation, UIRelation } from \"../miscellaneous/UIRelation\";\n\n/**\n * Internal description of a solver variable with its associated properties.\n */\ninterface VariableDescription {\n /** The underlying Kiwi variable instance. */\n variable: Variable;\n /** Priority level for constraint solving. */\n priority: UIPriority;\n /** Current suggested value for the variable. */\n value: number;\n /** Optional constraint for P0 priority variables (required variables). */\n constraint?: Constraint;\n}\n\n/**\n * Internal description of a solver constraint with its configuration.\n */\ninterface ConstraintDescription {\n /** The underlying Kiwi constraint instance. */\n constraint: Constraint;\n /** Left-hand side expression of the constraint. */\n lhs: UIExpression;\n /** Right-hand side expression of the constraint. */\n rhs: UIExpression;\n /** Priority level for constraint solving. */\n priority: UIPriority;\n /** Relational operator (equal, less than, greater than). */\n relation: UIRelation;\n /** Whether the constraint is currently active. */\n enabled: boolean;\n}\n\n/**\n * Wrapper around the Kiwi constraint solver providing enhanced UI-specific functionality.\n *\n * UISolverWrapper abstracts the Kiwi (Cassowary) constraint solver to provide a more\n * UI-friendly interface with additional features like dynamic constraint modification,\n * required variables (P0 priority), partial constraint updates, and automatic solver\n * recovery. It manages variables and constraints through index-based references,\n * allowing for easy tracking and modification of layout constraints.\n *\n * Key features:\n * - Index-based variable and constraint management\n * - Required variables with P0 priority (always satisfied)\n * - Dynamic constraint modification without full rebuilds\n * - Automatic solver recovery on constraint conflicts\n * - Lazy evaluation with recalculation flags\n *\n * @see {@link UIExpression} - Expression system for constraint definitions\n * @see {@link UIPriority} - Priority levels for variables and constraints\n * @see {@link UIRelation} - Relational operators for constraints\n */\nexport class UISolverWrapper {\n /** The underlying Kiwi solver instance, undefined when solver needs rebuilding. */\n private solver? = new Solver();\n /** Flag indicating whether variable values need recalculation. */\n private recalculationRequired = false;\n\n /** Map of variable indices to their descriptions. */\n private readonly variables = new Map<number, VariableDescription>();\n /** Counter for generating unique variable indices. */\n private lastVariableIndex = 0;\n\n /** Map of constraint indices to their descriptions. */\n private readonly constraints = new Map<number, ConstraintDescription>();\n /** Counter for generating unique constraint indices. */\n private lastConstraintIndex = 0;\n\n /**\n * Creates a new solver variable with the specified value and priority.\n *\n * Variables with P0 priority are treated as required (must be satisfied exactly)\n * and are implemented using equality constraints. Other priorities use edit\n * variables that can be adjusted by the solver.\n *\n * @param value - Initial value for the variable\n * @param priority - Priority level for constraint solving\n * @returns Unique index identifier for the created variable\n */\n public createVariable(value: number, priority: UIPriority): number {\n const index = this.lastVariableIndex++;\n const variable = new Variable();\n\n if (priority === UIPriority.P0) {\n const description: VariableDescription = { variable, priority, value };\n this.variables.set(index, description);\n\n description.constraint = this.buildConstraint(\n new UIExpression(0, [[index, 1]]),\n new UIExpression(value),\n UIRelation.EQUAL,\n priority,\n );\n try {\n this.solver?.addConstraint(description.constraint);\n } catch {\n this.solver = undefined;\n }\n } else {\n this.variables.set(index, { variable, priority, value });\n\n try {\n this.solver?.addEditVariable(variable, convertPriority(priority));\n this.solver?.suggestValue(variable, value);\n } catch {\n this.solver = undefined;\n }\n }\n\n this.recalculationRequired = true;\n return index;\n }\n\n /**\n * Removes a variable from the solver system.\n *\n * The variable must not be referenced by any existing constraints.\n * Cleans up both the variable itself and any associated required constraint.\n *\n * @param index - Index of the variable to remove\n * @throws Will throw an error if the variable doesn't exist or is still in use\n */\n public removeVariable(index: number): void {\n const description = this.variables.get(index);\n if (description === undefined) {\n throw new Error(`Variable ${index} does not exist`);\n }\n\n for (const cDescription of this.constraints.values()) {\n if (cDescription.lhs.hasTerm(index) || cDescription.rhs.hasTerm(index)) {\n throw new Error(`Variable ${index} is used in constraint`);\n }\n }\n\n try {\n description.constraint\n ? this.solver?.removeConstraint(description.constraint)\n : this.solver?.removeEditVariable(description.variable);\n } catch {\n this.solver = undefined;\n }\n\n this.variables.delete(index);\n this.recalculationRequired = true;\n }\n\n /**\n * Suggests a new value for an existing variable.\n *\n * For P0 priority variables, rebuilds the associated constraint.\n * For other priorities, suggests the value to the solver's edit system.\n * Only triggers updates if the value actually changes.\n *\n * @param index - Index of the variable to update\n * @param value - New suggested value\n * @throws Will throw an error if the variable doesn't exist\n */\n public suggestVariableValue(index: number, value: number): void {\n const description = this.variables.get(index);\n if (description === undefined) {\n throw new Error(`Variable ${index} does not exist`);\n }\n\n if (description.value !== value) {\n description.value = value;\n\n if (description.constraint) {\n description.constraint = this.rebuildConstraint(\n description.constraint,\n new UIExpression().plus(index, 1),\n new UIExpression(description.value),\n UIRelation.EQUAL,\n description.priority,\n );\n } else {\n this.solver?.suggestValue(description.variable, value);\n }\n\n this.recalculationRequired = true;\n }\n }\n\n /**\n * Changes the priority of an existing variable.\n *\n * Switching to/from P0 priority changes how the variable is handled:\n * - P0: Creates required constraint (must be satisfied exactly)\n * - Other: Uses edit variable system (can be adjusted by solver)\n *\n * @param index - Index of the variable to modify\n * @param priority - New priority level\n * @throws Will throw an error if the variable doesn't exist\n */\n public setVariablePriority(index: number, priority: UIPriority): void {\n const description = this.variables.get(index);\n if (description === undefined) {\n throw new Error(`Variable ${index} does not exist`);\n }\n\n if (priority !== description.priority) {\n description.priority = priority;\n\n if (description.priority === UIPriority.P0) {\n const lhs = new UIExpression().plus(index, 1);\n const rhs = new UIExpression(description.value);\n\n description.constraint = this.buildConstraint(\n lhs,\n rhs,\n UIRelation.EQUAL,\n description.priority,\n );\n\n try {\n this.solver?.addConstraint(description.constraint);\n } catch {\n this.solver = undefined;\n }\n } else {\n if (description.constraint) {\n try {\n this.solver?.removeConstraint(description.constraint);\n } catch {\n this.solver = undefined;\n }\n }\n\n description.constraint = undefined;\n this.rebuildVariable(index, description);\n }\n\n this.recalculationRequired = true;\n }\n }\n\n /**\n * Reads the current solved value of a variable.\n *\n * Triggers solver recalculation if needed and rebuilds the solver\n * if it was invalidated due to constraint conflicts.\n *\n * @param index - Index of the variable to read\n * @returns Current solved value of the variable\n * @throws Will throw an error if the variable doesn't exist\n */\n public readVariableValue(index: number): number {\n const description = this.variables.get(index);\n if (description === undefined) {\n throw new Error(`Variable ${index} does not exist`);\n }\n\n if (this.solver === undefined) {\n this.rebuildSolver();\n }\n\n if (this.recalculationRequired) {\n this.solver?.updateVariables();\n this.recalculationRequired = false;\n }\n\n return description.variable.value();\n }\n\n /**\n * Creates a new constraint between two expressions.\n *\n * Constraints can be enabled or disabled, and all properties can be\n * modified later without recreating the constraint.\n *\n * @param lhs - Left-hand side expression\n * @param rhs - Right-hand side expression\n * @param relation - Relational operator (equal, less than, greater than)\n * @param priority - Priority level for constraint solving\n * @param enabled - Whether the constraint is initially active\n * @returns Unique index identifier for the created constraint\n */\n public createConstraint(\n lhs: UIExpression,\n rhs: UIExpression,\n relation: UIRelation,\n priority: UIPriority,\n enabled: boolean,\n ): number {\n const index = this.lastConstraintIndex++;\n const constraint = this.buildConstraint(lhs, rhs, relation, priority);\n this.constraints.set(index, {\n constraint,\n lhs: lhs.clone(),\n rhs: rhs.clone(),\n priority,\n relation,\n enabled,\n });\n if (enabled) {\n try {\n this.solver?.addConstraint(constraint);\n } catch {\n this.solver = undefined;\n }\n this.recalculationRequired = true;\n }\n return index;\n }\n\n /**\n * Removes a constraint from the solver system.\n *\n * If the constraint is currently enabled, it will be removed from\n * the active solver before deletion.\n *\n * @param index - Index of the constraint to remove\n * @throws Will throw an error if the constraint doesn't exist\n */\n public removeConstraint(index: number): void {\n const description = this.constraints.get(index);\n if (description === undefined) {\n throw new Error(`Constraint ${index} does not exist`);\n }\n\n if (description.enabled) {\n try {\n this.solver?.removeConstraint(description.constraint);\n } catch {\n this.solver = undefined;\n }\n }\n\n this.constraints.delete(index);\n this.recalculationRequired = true;\n }\n\n /**\n * Updates the left-hand side expression of an existing constraint.\n *\n * Rebuilds the underlying constraint with the new expression while\n * preserving all other properties.\n *\n * @param index - Index of the constraint to modify\n * @param lhs - New left-hand side expression\n * @throws Will throw an error if the constraint doesn't exist\n */\n public setConstraintLHS(index: number, lhs: UIExpression): void {\n const description = this.constraints.get(index);\n if (description === undefined) {\n throw new Error(`Constraint ${index} does not exist`);\n }\n\n description.lhs.copy(lhs);\n this.rebuildConstraintByDescription(description);\n this.recalculationRequired = true;\n }\n\n /**\n * Updates the right-hand side expression of an existing constraint.\n *\n * Rebuilds the underlying constraint with the new expression while\n * preserving all other properties.\n *\n * @param index - Index of the constraint to modify\n * @param rhs - New right-hand side expression\n * @throws Will throw an error if the constraint doesn't exist\n */\n public setConstraintRHS(index: number, rhs: UIExpression): void {\n const description = this.constraints.get(index);\n if (description === undefined) {\n throw new Error(`Constraint ${index} does not exist`);\n }\n\n description.rhs.copy(rhs);\n this.rebuildConstraintByDescription(description);\n this.recalculationRequired = true;\n }\n\n /**\n * Updates the relational operator of an existing constraint.\n *\n * Changes how the left and right expressions are compared\n * (equal, less than, greater than).\n *\n * @param index - Index of the constraint to modify\n * @param relation - New relational operator\n * @throws Will throw an error if the constraint doesn't exist\n */\n public setConstraintRelation(index: number, relation: UIRelation): void {\n const description = this.constraints.get(index);\n if (description === undefined) {\n throw new Error(`Constraint ${index} does not exist`);\n }\n\n if (description.relation !== relation) {\n description.relation = relation;\n this.rebuildConstraintByDescription(description);\n this.recalculationRequired = true;\n }\n }\n\n /**\n * Updates the priority level of an existing constraint.\n *\n * Higher priority constraints are more likely to be satisfied\n * when conflicts arise.\n *\n * @param index - Index of the constraint to modify\n * @param priority - New priority level\n * @throws Will throw an error if the constraint doesn't exist\n */\n public setConstraintPriority(index: number, priority: UIPriority): void {\n const description = this.constraints.get(index);\n if (description === undefined) {\n throw new Error(`Constraint ${index} does not exist`);\n }\n\n if (description.priority !== priority) {\n description.priority = priority;\n this.rebuildConstraintByDescription(description);\n this.recalculationRequired = true;\n }\n }\n\n /**\n * Enables or disables an existing constraint.\n *\n * Disabled constraints are not considered during solving but\n * remain in the system for potential re-enabling.\n *\n * @param index - Index of the constraint to modify\n * @param enabled - Whether the constraint should be active\n * @throws Will throw an error if the constraint doesn't exist\n */\n public setConstraintEnabled(index: number, enabled: boolean): void {\n const description = this.constraints.get(index);\n if (description === undefined) {\n throw new Error(`Constraint ${index} does not exist`);\n }\n\n if (enabled !== description.enabled) {\n description.enabled = enabled;\n try {\n description.enabled\n ? this.solver?.addConstraint(description.constraint)\n : this.solver?.removeConstraint(description.constraint);\n } catch {\n this.solver = undefined;\n }\n this.recalculationRequired = true;\n }\n }\n\n /**\n * Rebuilds a variable in the solver system with new properties.\n *\n * Temporarily removes all constraints that reference the variable,\n * updates the variable configuration, then rebuilds and re-adds\n * the dependent constraints.\n */\n private rebuildVariable(\n index: number,\n description: VariableDescription,\n ): void {\n const dependConstraints: ConstraintDescription[] = [];\n\n for (const cDescription of this.constraints.values()) {\n if (cDescription.lhs.hasTerm(index) || cDescription.rhs.hasTerm(index)) {\n try {\n this.solver?.removeConstraint(cDescription.constraint);\n } catch {\n this.solver = undefined;\n }\n dependConstraints.push(cDescription);\n }\n }\n\n this.solver?.removeEditVariable(description.variable);\n this.solver?.addEditVariable(\n description.variable,\n convertPriority(description.priority),\n );\n\n for (const cDescription of dependConstraints) {\n cDescription.constraint = this.buildConstraint(\n cDescription.lhs,\n cDescription.rhs,\n cDescription.relation,\n cDescription.priority,\n );\n }\n\n for (const cDescription of dependConstraints) {\n try {\n this.solver?.addConstraint(cDescription.constraint);\n } catch {\n this.solver = undefined;\n break;\n }\n }\n }\n\n /**\n * Rebuilds a constraint based on its current description.\n *\n * Uses different rebuild strategies depending on whether the\n * constraint is currently enabled.\n */\n private rebuildConstraintByDescription(\n description: ConstraintDescription,\n ): void {\n description.constraint = description.enabled\n ? this.rebuildConstraint(\n description.constraint,\n description.lhs,\n description.rhs,\n description.relation,\n description.priority,\n )\n : this.buildConstraint(\n description.lhs,\n description.rhs,\n description.relation,\n description.priority,\n );\n }\n\n /**\n * Rebuilds a constraint by removing the old one and creating a new one.\n *\n * Safely handles solver state transitions and constraint replacement.\n */\n private rebuildConstraint(\n oldConstraint: Constraint,\n lhs: UIExpression,\n rhs: UIExpression,\n relation: UIRelation,\n priority: UIPriority,\n ): Constraint {\n try {\n this.solver?.removeConstraint(oldConstraint);\n } catch {\n this.solver = undefined;\n }\n\n const constraint = this.buildConstraint(lhs, rhs, relation, priority);\n\n try {\n this.solver?.addConstraint(constraint);\n } catch {\n this.solver = undefined;\n }\n\n return constraint;\n }\n\n /**\n * Creates a new Kiwi constraint from UI expressions and parameters.\n *\n * Converts UI-level expressions and enums to Kiwi-compatible formats.\n */\n private buildConstraint(\n lhs: UIExpression,\n rhs: UIExpression,\n relation: UIRelation,\n priority: UIPriority,\n ): Constraint {\n return new Constraint(\n this.convertExpression(lhs),\n convertRelation(relation),\n this.convertExpression(rhs),\n convertPriority(priority),\n );\n }\n\n /**\n * Converts a UIExpression to a Kiwi Expression.\n *\n * Maps variable indices to their corresponding Kiwi Variable instances\n * and preserves coefficients and constants.\n */\n private convertExpression(expression: UIExpression): Expression {\n return new Expression(\n ...expression[\"prepareTermsInternal\"]().map(\n ([variableIndex, coefficient]): [number, Variable] => {\n const description = this.variables.get(variableIndex);\n if (description === undefined) {\n throw new Error(`Variable ${variableIndex} does not exist`);\n }\n return [coefficient, description.variable];\n },\n ),\n expression.constant,\n );\n }\n\n /**\n * Completely rebuilds the solver from scratch.\n *\n * Re-adds all variables and constraints to a fresh solver instance.\n * Used for recovery when the solver enters an invalid state.\n */\n private rebuildSolver(): void {\n if (this.solver) {\n throw new Error(\"Solver already exists\");\n }\n\n this.solver = new Solver();\n\n for (const description of this.variables.values()) {\n if (description.constraint) {\n this.solver.addConstraint(description.constraint);\n } else {\n this.solver.addEditVariable(\n description.variable,\n convertPriority(description.priority),\n );\n this.solver.suggestValue(description.variable, description.value);\n }\n }\n\n for (const description of this.constraints.values()) {\n if (description.enabled) {\n this.solver.addConstraint(description.constraint);\n }\n }\n\n this.recalculationRequired = true;\n }\n}\n","import { Eventail } from \"eventail\";\nimport type { WebGLRenderer } from \"three\";\nimport type { UIPlaneElement } from \"../miscellaneous/asserts\";\nimport { UIMode } from \"../miscellaneous/UIMode\";\nimport { UIOrientation } from \"../miscellaneous/UIOrientation\";\nimport { UIPriority } from \"../miscellaneous/UIPriority\";\nimport type { UISceneWrapperClientAPI } from \"../miscellaneous/UISceneWrapperClientAPI\";\nimport { UISceneWrapper } from \"../wrappers/UISceneWrapper\";\nimport { UISolverWrapper } from \"../wrappers/UISolverWrapper\";\n\n/**\n * Interface for handling input events within UI layers.\n */\nexport interface UILayerInputListener {\n zIndex: number;\n catchPointerDown(x: number, y: number, identifier: number): boolean;\n catchPointerMove(x: number, y: number, identifier: number): boolean;\n catchPointerUp(x: number, y: number, identifier: number): boolean;\n}\n\n/**\n * Events that can be emitted by UI layers.\n */\nexport enum UILayerEvent {\n /** Emitted when the layer's orientation changes between horizontal and vertical. */\n ORIENTATION_CHANGE = \"orientation_change\",\n /** Emitted when the layer's visibility/interaction mode changes. */\n MODE_CHANGE = \"mode_change\",\n /** Emitted before the layer is rendered. */\n WILL_RENDER = \"will_render\",\n}\n\n/**\n * Abstract base class for UI layout containers with constraint solving and rendering.\n *\n * UILayer serves as the fundamental container for UI elements, providing constraint-based\n * layout solving, 3D scene management, and event handling. It manages the layer's\n * dimensions through solver variables, handles orientation changes, and coordinates\n * rendering and interaction for all contained elements.\n *\n * Each layer maintains its own constraint solver and scene graph, allowing for\n * independent layout calculation and rendering optimization.\n *\n * @see {@link UIElement} - Elements contained within layers\n * @see {@link UISolverWrapper} - Constraint solving system\n * @see {@link UISceneWrapper} - 3D scene management\n * @see {@link UIOrientation} - Layer orientation states\n */\nexport abstract class UILayer extends Eventail implements UIPlaneElement {\n /** Optional name identifier for the layer. */\n public name = \"\";\n\n /**\n * Solver variable descriptor for the x-coordinate position.\n * This variable is managed by the constraint solver system.\n */\n public readonly xVariable: number;\n\n /**\n * Solver variable descriptor for the y-coordinate position.\n * This variable is managed by the constraint solver system.\n */\n public readonly yVariable: number;\n\n /**\n * Solver variable descriptor for the width dimension.\n * This variable is managed by the constraint solver system.\n */\n public readonly wVariable: number;\n\n /**\n * Solver variable descriptor for the height dimension.\n * This variable is managed by the constraint solver system.\n */\n public readonly hVariable: number;\n\n /**\n * Constraint solver wrapper for managing layout calculations.\n * @see {@link UISolverWrapper}\n */\n protected readonly solverWrapper = new UISolverWrapper();\n\n /**\n * 3D scene wrapper for managing rendering and element hierarchy.\n * @see {@link UISceneWrapper}\n */\n protected readonly sceneWrapper: UISceneWrapper;\n\n /** Internal storage for the current visibility/interaction mode. */\n protected modeInternal: UIMode = UIMode.VISIBLE;\n\n /** Internal storage for the current orientation state. */\n protected orientationInternal: UIOrientation;\n\n /** Collection of input listeners for handling user interactions, sorted by z-index. */\n\n private readonly inputListeners: UILayerInputListener[] = [];\n\n /**\n * Creates a new UILayer instance with specified dimensions.\n *\n * Initializes the constraint solver with position and dimension variables,\n * sets up the 3D scene wrapper, and determines the initial orientation\n * based on the width-to-height ratio.\n *\n * @param w - Initial width of the layer\n * @param h - Initial height of the layer\n */\n constructor(w: number, h: number) {\n super();\n this.sceneWrapper = new UISceneWrapper(w, h);\n this.xVariable = this.solverWrapper.createVariable(0, UIPriority.P0);\n this.yVariable = this.solverWrapper.createVariable(0, UIPriority.P0);\n this.wVariable = this.solverWrapper.createVariable(w, UIPriority.P0);\n this.hVariable = this.solverWrapper.createVariable(h, UIPriority.P0);\n this.orientationInternal =\n w > h ? UIOrientation.HORIZONTAL : UIOrientation.VERTICAL;\n }\n\n /**\n * Gets the current x position value from the constraint solver.\n * @returns The current x position in pixels\n */\n public get x(): number {\n return this.solverWrapper.readVariableValue(this.xVariable);\n }\n\n /**\n * Gets the current y position value from the constraint solver.\n * @returns The current y position in pixels\n */\n public get y(): number {\n return this.solverWrapper.readVariableValue(this.yVariable);\n }\n\n /**\n * Gets the current width value from the constraint solver.\n * @returns The current layer width in pixels\n */\n public get width(): number {\n return this.solverWrapper.readVariableValue(this.wVariable);\n }\n\n /**\n * Gets the current height value from the constraint solver.\n * @returns The current layer height in pixels\n */\n public get height(): number {\n return this.solverWrapper.readVariableValue(this.hVariable);\n }\n\n /**\n * Gets the current visibility and interaction mode.\n * @returns The current UIMode setting\n * @see {@link UIMode}\n */\n public get mode(): UIMode {\n return this.modeInternal;\n }\n\n /**\n * Gets the current orientation state.\n * @returns The current orientation (horizontal or vertical)\n * @see {@link UIOrientation}\n */\n public get orientation(): UIOrientation {\n return this.orientationInternal;\n }\n\n /**\n * Sets the visibility and interaction mode and emits change event.\n * @param value - The new UIMode setting\n * @see {@link UIMode}\n */\n public set mode(value: UIMode) {\n if (value !== this.modeInternal) {\n this.modeInternal = value;\n this.emit(UILayerEvent.MODE_CHANGE, this.modeInternal, this);\n }\n }\n\n /**\n * Internal method for resizing the layer and updating orientation.\n *\n * Updates the solver variables for width and height, resizes the scene wrapper,\n * and determines if the orientation has changed based on the new dimensions.\n * Emits an orientation change event if the orientation has changed.\n *\n * @param width - The new layer width\n * @param height - The new layer height\n * @protected\n */\n protected resizeInternal(width: number, height: number): void {\n this.solverWrapper.suggestVariableValue(this.wVariable, width);\n this.solverWrapper.suggestVariableValue(this.hVariable, height);\n this.sceneWrapper.resize(width, height);\n\n const orientation =\n width > height ? UIOrientation.HORIZONTAL : UIOrientation.VERTICAL;\n\n if (orientation !== this.orientationInternal) {\n this.orientationInternal = orientation;\n this.emit(\n UILayerEvent.ORIENTATION_CHANGE,\n this.orientationInternal,\n this,\n );\n }\n }\n\n /**\n * Internal method for rendering the layer and its elements.\n *\n * Delegates rendering to the scene wrapper if the layer is not hidden.\n * This method is called during the rendering loop to update and draw\n * all elements contained within the layer.\n *\n * @param renderer - The WebGL renderer instance\n * @param deltaTime - Time elapsed since the last frame in seconds\n * @protected\n */\n protected renderInternal(renderer: WebGLRenderer, deltaTime: number): void {\n if (this.mode !== UIMode.HIDDEN) {\n this.emit(UILayerEvent.WILL_RENDER, renderer, deltaTime, this);\n this.sceneWrapper.render(renderer);\n }\n }\n\n protected onPointerDownInternal(\n x: number,\n y: number,\n identifier: number,\n ): void {\n this.handleInputEvent(x, y, \"catchPointerDown\", identifier);\n }\n\n protected onPointerMoveInternal(\n x: number,\n y: number,\n identifier: number,\n ): void {\n this.handleInputEvent(x, y, \"catchPointerMove\", identifier);\n }\n\n protected onPointerUpInternal(\n x: number,\n y: number,\n identifier: number,\n ): void {\n this.handleInputEvent(x, y, \"catchPointerUp\", identifier);\n }\n\n /**\n * Internal method for accessing the constraint solver wrapper.\n *\n * Provides access to the layer's constraint solver for elements and\n * constraints that need to create variables or constraints.\n *\n * @returns The constraint solver wrapper instance\n */\n protected [\"getSolverWrapperInternal\"](): UISolverWrapper {\n return this.solverWrapper;\n }\n\n /**\n * Internal method for accessing the 3D scene wrapper.\n *\n * Provides access to the layer's scene management system for elements\n * that need to be added to or removed from the 3D scene.\n *\n * @returns The scene wrapper instance\n */\n protected [\"getSceneWrapperClientAPI\"](): UISceneWrapperClientAPI {\n return this.sceneWrapper;\n }\n\n /**\n * Internal method for registering an input listener for pointer events.\n *\n * Adds a listener to handle click events with the specified z-index priority.\n * Higher z-index listeners are processed first during event handling.\n *\n * @param listener - The input listener to register\n * @param zIndex - The z-index priority for event handling order\n * @throws Will throw an error if the listener is already registered\n */\n\n protected [\"subscribePointerInput\"](listener: UILayerInputListener): void {\n if (this.inputListeners.find((l) => l === listener)) {\n throw new Error(\"Listener already exists\");\n }\n this.inputListeners.push(listener);\n }\n\n /**\n * Internal method for unregistering an input listener.\n *\n * Removes the specified listener from the event handling system.\n * The listener will no longer receive click events.\n *\n * @param listener - The input listener to remove\n * @throws Will throw an error if the listener is not found\n */\n\n protected [\"unsubscribePointerInput\"](listener: UILayerInputListener): void {\n const index = this.inputListeners.findIndex((l) => l === listener);\n if (index === -1) {\n throw new Error(\"Listener not found\");\n }\n this.inputListeners.splice(index, 1);\n }\n\n private handleInputEvent(\n x: number,\n y: number,\n catchFunctionName:\n | \"catchPointerDown\"\n | \"catchPointerMove\"\n | \"catchPointerUp\",\n identifier: number,\n ): void {\n if (this.mode === UIMode.INTERACTIVE) {\n this.inputListeners.sort((a, b) => b.zIndex - a.zIndex);\n for (const listener of this.inputListeners) {\n if (listener[catchFunctionName](x, y, identifier)) {\n return;\n }\n }\n }\n }\n}\n","import { type UILayer } from \"../layers/UILayer\";\n\nimport type { UISolverWrapper } from \"../wrappers/UISolverWrapper\";\n\n/**\n * Abstract base class for all UI layout constraints.\n *\n * UIConstraint serves as the fundamental building block for the constraint-based\n * layout system. It provides access to the solver wrapper for creating and\n * managing constraint relationships between UI elements. All concrete constraint\n * implementations must extend this class to participate in the layout solving process.\n *\n * @see {@link UILayer} - Container layer for constraints\n * @see {@link UISolverWrapper} - Constraint solver integration\n */\nexport abstract class UIConstraint {\n /** Optional name identifier for the constraint. */\n public name = \"\";\n\n /**\n * Reference to the constraint solver wrapper for managing solver operations.\n * @see {@link UISolverWrapper}\n */\n protected readonly solverWrapper: UISolverWrapper;\n\n /**\n * Creates a new UIConstraint instance.\n *\n * Automatically connects to the layer's constraint solver for managing\n * layout relationships and constraint operations.\n *\n * @param layer - The UI layer that contains this constraint\n */\n constructor(public readonly layer: UILayer) {\n this.solverWrapper = this.layer[\"getSolverWrapperInternal\"]();\n }\n}\n","import type { UILayer } from \"../layers/UILayer\";\nimport { UILayerEvent } from \"../layers/UILayer\";\nimport {\n resolveOrientation,\n UIOrientation,\n} from \"../miscellaneous/UIOrientation\";\nimport { resolvePriority, type UIPriority } from \"../miscellaneous/UIPriority\";\nimport { resolveRelation, type UIRelation } from \"../miscellaneous/UIRelation\";\nimport { UIConstraint } from \"./UIConstraint\";\n\n/**\n * Configuration options for UISingleParameterConstraint creation.\n */\nexport interface UISingleParameterConstraintOptions {\n /** Priority level for the constraint in the solver hierarchy. */\n priority: UIPriority;\n /** Mathematical relation type for the constraint equation. */\n relation: UIRelation;\n /** Orientation context for when the constraint should be active. */\n orientation: UIOrientation;\n}\n\n/**\n * Abstract base class for constraints that operate with configurable parameters.\n *\n * UISingleParameterConstraint extends UIConstraint with common functionality\n * for constraints that need priority, relation, and orientation configuration.\n * It provides automatic orientation-based enabling/disabling of constraints\n * and manages the lifecycle of solver constraint descriptors.\n *\n * @see {@link UIConstraint} - Base constraint class\n * @see {@link UIPriority} - Priority level configuration\n * @see {@link UIRelation} - Mathematical relation types\n * @see {@link UIOrientation} - Orientation-based activation\n */\nexport abstract class UISingleParameterConstraint extends UIConstraint {\n /** Internal storage for the constraint priority level. */\n protected priorityInternal: UIPriority;\n /** Internal storage for the constraint relation type. */\n protected relationInternal: UIRelation;\n /** Internal storage for the constraint orientation setting. */\n protected orientationInternal: UIOrientation;\n\n /** The constraint descriptor managed by the solver system. */\n protected abstract readonly constraint: number;\n\n /**\n * Creates a new UISingleParameterConstraint instance.\n *\n * Initializes the constraint with resolved default values and sets up\n * orientation change event handling for dynamic constraint activation.\n *\n * @param layer - The UI layer that contains this constraint\n * @param priority - Optional priority level (defaults to P0)\n * @param relation - Optional relation type (defaults to EQUAL)\n * @param orientation - Optional orientation setting (defaults to ALWAYS)\n */\n constructor(\n layer: UILayer,\n priority?: UIPriority,\n relation?: UIRelation,\n orientation?: UIOrientation,\n ) {\n super(layer);\n this.priorityInternal = resolvePriority(priority);\n this.relationInternal = resolveRelation(relation);\n this.orientationInternal = resolveOrientation(orientation);\n this.layer.on(UILayerEvent.ORIENTATION_CHANGE, this.onOrientationChange);\n }\n\n /**\n * Gets the current priority level of the constraint.\n * @returns The constraint priority level\n */\n public get priority(): UIPriority {\n return this.priorityInternal;\n }\n\n /**\n * Gets the current mathematical relation type of the constraint.\n * @returns The constraint relation type\n */\n public get relation(): UIRelation {\n return this.relationInternal;\n }\n\n /**\n * Gets the current orientation setting of the constraint.\n * @returns The constraint orientation setting\n */\n public get orientation(): UIOrientation {\n return this.orientationInternal;\n }\n\n /**\n * Sets a new priority level for the constraint.\n * @param value - The new priority level\n */\n public set priority(value: UIPriority) {\n if (value !== this.priorityInternal) {\n this.priorityInternal = value;\n this.solverWrapper.setConstraintPriority(\n this.constraint,\n this.priorityInternal,\n );\n }\n }\n\n /**\n * Sets a new mathematical relation type for the constraint.\n * @param value - The new relation type\n */\n public set relation(value: UIRelation) {\n if (value !== this.relationInternal) {\n this.relationInternal = value;\n this.solverWrapper.setConstraintRelation(\n this.constraint,\n this.relationInternal,\n );\n }\n }\n\n /**\n * Sets a new orientation setting for the constraint.\n * @param value - The new orientation setting\n */\n public set orientation(value: UIOrientation) {\n if (value !== this.orientationInternal) {\n this.orientationInternal = value;\n this.onOrientationChange();\n }\n }\n\n /**\n * Destroys the constraint by cleaning up event listeners and solver resources.\n *\n * This method removes the orientation change event listener and removes\n * the constraint from the solver system. After calling this method,\n * the constraint should not be used anymore.\n */\n public destroy(): void {\n this.layer.off(UILayerEvent.ORIENTATION_CHANGE, this.onOrientationChange);\n this.solverWrapper.removeConstraint(this.constraint);\n }\n\n /**\n * Determines if the constraint should be enabled based on orientation.\n *\n * The constraint is enabled if its orientation is set to ALWAYS or if\n * it matches the current layer orientation.\n *\n * @returns True if the constraint should be enabled, false otherwise\n * @protected\n */\n protected isConstraintEnabled(): boolean {\n return (\n this.orientationInternal === UIOrientation.ALWAYS ||\n this.orientationInternal === this.layer.orientation\n );\n }\n\n /**\n * Event handler for layer orientation changes.\n *\n * Updates the constraint's enabled state in the solver based on the\n * current orientation and the constraint's orientation setting.\n */\n private readonly onOrientationChange = (): void => {\n this.solverWrapper.setConstraintEnabled(\n this.constraint,\n this.isConstraintEnabled(),\n );\n };\n}\n","import type { UILayerElement, UIPlaneElement } from \"../miscellaneous/asserts\";\nimport { UIExpression } from \"../miscellaneous/UIExpression\";\nimport type { UISingleParameterConstraintOptions } from \"./UISingleParameterConstraint\";\nimport { UISingleParameterConstraint } from \"./UISingleParameterConstraint\";\n\n/**\n * Configuration options for UIHeightConstraint creation.\n */\nexport interface UIHeightConstraintOptions\n extends UISingleParameterConstraintOptions {\n /** The desired height value for the element. */\n height: number;\n}\n\n/**\n * Constraint that enforces a specific height value for UI elements.\n *\n * UIHeightConstraint creates a mathematical relationship that fixes an element's\n * height to a constant value. The constraint equation is: element.height = height.\n * This is useful for ensuring elements maintain a specific height regardless of\n * other layout changes or for setting fixed dimensions in responsive layouts.\n *\n * @see {@link UISingleParameterConstraint} - Base class for single-parameter constraints\n * @see {@link UIPlaneElement} - Elements that can have height constraints applied\n * @see {@link UIExpression} - Mathematical expressions for constraint equations\n */\nexport class UIHeightConstraint extends UISingleParameterConstraint {\n /** The constraint descriptor managed by the solver system. */\n protected override readonly constraint: number;\n\n /** Internal storage for the current height value. */\n private heightInternal: number;\n\n /**\n * Creates a new UIHeightConstraint instance.\n *\n * If no height is specified in options, the constraint will use the\n * element's current height as the target height value.\n *\n * @param element - The UI element to apply the height constraint to\n * @param options - Configuration options for the constraint\n */\n constructor(\n private readonly element: UIPlaneElement & UILayerElement,\n options: Partial<UIHeightConstraintOptions> = {},\n ) {\n super(\n element.layer,\n options.priority,\n options.relation,\n options.orientation,\n );\n\n this.heightInternal = options.height ?? element.height;\n\n this.constraint = this.solverWrapper.createConstraint(\n new UIExpression(0, [[this.element.hVariable, 1]]),\n new UIExpression(this.heightInternal),\n this.relation,\n this.priority,\n this.isConstraintEnabled(),\n );\n }\n\n /**\n * Gets the current height value being enforced.\n * @returns The height value in pixels\n */\n public get height(): number {\n return this.heightInternal;\n }\n\n /**\n * Sets a new height value and updates the constraint equation.\n * @param value - The new height value in pixels\n */\n public set height(value: number) {\n if (this.heightInternal !== value) {\n this.heightInternal = value;\n this.solverWrapper.setConstraintRHS(\n this.constraint,\n new UIExpression(value),\n );\n }\n }\n}\n","import { UILayer } from \"../layers/UILayer\";\n\n/** Small epsilon value for floating-point comparisons and minimum positive number validation. */\nexport const EPSILON = 1e-6;\n\n/**\n * Interface for objects that belong to a UI layer.\n *\n * Elements implementing this interface are associated with a specific layer\n * for constraint solving and rendering management.\n */\nexport interface UILayerElement {\n /** The UI layer that contains this element. */\n readonly layer: UILayer;\n}\n\n/**\n * Interface for UI elements that have a position in 2D space.\n *\n * Point elements are characterized by x and y coordinates represented\n * as solver variable descriptors for constraint-based positioning.\n */\nexport interface UIPointElement {\n /** Solver variable descriptor for the x-coordinate. */\n readonly xVariable: number;\n /** Solver variable descriptor for the y-coordinate. */\n readonly yVariable: number;\n\n /** The x-coordinate of the element. */\n readonly x: number;\n /** The y-coordinate of the element. */\n readonly y: number;\n}\n\n/**\n * Interface for UI elements that have both position and dimensions in 2D space.\n *\n * Plane elements extend point elements with width and height properties,\n * enabling rectangular area constraints and positioning.\n */\nexport interface UIPlaneElement extends UIPointElement {\n /** Solver variable descriptor for the width dimension. */\n readonly wVariable: number;\n /** Solver variable descriptor for the height dimension. */\n readonly hVariable: number;\n\n /** The width of the element. */\n readonly width: number;\n /** The height of the element. */\n readonly height: number;\n}\n\n/**\n * Type guard to check if an object implements the UILayerElement interface.\n *\n * @param obj - The object to check\n * @returns True if the object has a valid layer property, false otherwise\n */\nexport function isUILayerElement(obj: unknown): obj is UILayerElement {\n return (\n typeof obj === \"object\" &&\n obj !== null &&\n \"layer\" in obj &&\n obj.layer instanceof UILayer\n );\n}\n\n/**\n * Type guard to check if an object implements the UIPointElement interface.\n *\n * @param obj - The object to check\n * @returns True if the object has valid xVariable and yVariable properties, false otherwise\n */\nexport function isUIPointElement(obj: unknown): obj is UIPointElement {\n return (\n typeof obj === \"object\" &&\n obj !== null &&\n \"xVariable\" in obj &&\n typeof obj.xVariable === \"number\" &&\n \"yVariable\" in obj &&\n typeof obj.yVariable === \"number\" &&\n \"width\" in obj &&\n typeof obj.width === \"number\" &&\n \"height\" in obj &&\n typeof obj.height === \"number\"\n );\n}\n\n/**\n * Type guard to check if an object implements the UIPlaneElement interface.\n *\n * Note: This function only checks for width and height variables. Objects\n * should also satisfy UIPointElement requirements for complete validation.\n *\n * @param obj - The object to check\n * @returns True if the object has valid wVariable and hVariable properties, false otherwise\n */\nexport function isUIPlaneElement(obj: unknown): obj is UIPlaneElement {\n return (\n typeof obj === \"object\" &&\n obj !== null &&\n \"wVariable\" in obj &&\n typeof obj.wVariable === \"number\" &&\n \"hVariable\" in obj &&\n typeof obj.hVariable === \"number\" &&\n \"width\" in obj &&\n typeof obj.width === \"number\" &&\n \"height\" in obj &&\n typeof obj.height === \"number\"\n );\n}\n\n/**\n * Validates that two objects are valid constraint subjects from the same layer.\n *\n * Ensures that both objects are either UILayer instances or UILayerElement instances,\n * that they are not both layers (which cannot be constrained to each other),\n * and that they belong to the same layer for constraint solving.\n *\n * @param a - The first constraint subject\n * @param b - The second constraint subject\n * @param subject - The name of the constraint for error messages\n * @returns The common layer that both subjects belong to\n * @throws Will throw an error if subjects are invalid or from different layers\n */\nexport function assertValidConstraintSubjects(\n a: unknown,\n b: unknown,\n subject: string,\n): UILayer {\n if (a instanceof UILayer && b instanceof UILayer) {\n throw new Error(`${subject}: layer cannot be snapped to another layer`);\n }\n\n let layerA: UILayer;\n let layerB: UILayer;\n\n if (a instanceof UILayer || isUILayerElement(a)) {\n layerA = a instanceof UILayer ? a : a.layer;\n } else {\n throw new Error(`${subject}: A must be a UILayer or a UIPointElement`);\n }\n\n if (b instanceof UILayer || isUILayerElement(b)) {\n layerB = b instanceof UILayer ? b : b.layer;\n } else {\n throw new Error(`${subject}: B must be a UILayer or a UIPointElement`);\n }\n\n if (layerA !== layerB) {\n throw new Error(`${subject}: elements must be on the same layer`);\n }\n\n return layerA;\n}\n\n/**\n * Validates that a value is a finite number within safe integer range.\n *\n * Checks that the value is finite (not NaN, Infinity, or -Infinity) and\n * within the safe integer range for reliable mathematical operations.\n *\n * @param value - The number to validate\n * @param subject - The name of the value for error messages\n * @throws Will throw an error if the value is not finite or exceeds safe range\n */\nexport function assertValidNumber(value: number, subject: string): void {\n if (!Number.isFinite(value)) {\n throw new Error(`${subject}: value must be a finite number`);\n }\n\n if (Math.abs(value) > Number.MAX_SAFE_INTEGER) {\n throw new Error(`${subject}: value exceeds maximum safe integer range`);\n }\n}\n\n/**\n * Validates that a value is a positive number above the epsilon threshold.\n *\n * First validates that the value is a finite number, then ensures it is\n * greater than or equal to EPSILON to avoid numerical precision issues\n * with very small positive values.\n *\n * @param value - The number to validate\n * @param subject - The name of the value for error messages\n * @throws Will throw an error if the value is invalid or not sufficiently positive\n * @see {@link assertValidNumber}\n */\nexport function assertValidPositiveNumber(\n value: number,\n subject: string,\n): void {\n assertValidNumber(value, subject);\n\n if (value < EPSILON) {\n throw new Error(\n `${subject}: value must be greater than or equal to ${EPSILON}`,\n );\n }\n}\n\n/**\n * Validates that a value is a non-negative number (including zero).\n *\n * First validates that the value is a finite number, then ensures it is\n * greater than or equal to zero. Unlike assertValidPositiveNumber, this\n * function allows zero as a valid value.\n *\n * @param value - The number to validate\n * @param subject - The name of the value for error messages\n * @throws Will throw an error if the value is invalid or negative\n * @see {@link assertValidNumber}\n */\nexport function assertValidNonNegativeNumber(\n value: number,\n subject: string,\n): void {\n assertValidNumber(value, subject);\n if (value < 0) {\n throw new Error(`${subject}: value must be greater than or equal to 0`);\n }\n}\n","import type { UIPlaneElement, UIPointElement } from \"../miscellaneous/asserts\";\nimport {\n assertValidConstraintSubjects,\n isUIPlaneElement,\n isUIPointElement,\n} from \"../miscellaneous/asserts\";\nimport { UIExpression } from \"../miscellaneous/UIExpression\";\nimport type { UISingleParameterConstraintOptions } from \"./UISingleParameterConstraint\";\nimport { UISingleParameterConstraint } from \"./UISingleParameterConstraint\";\n\n/** Default anchor point (0.5 = center) for elements when not specified. */\nconst DEFAULT_ANCHOR = 0.5;\n\n/**\n * Configuration options for UIHorizontalDistanceConstraint creation.\n */\nexport interface UIHorizontalDistanceConstraintOptions\n extends UISingleParameterConstraintOptions {\n /** Anchor point for element A (0.0 = left edge, 0.5 = center, 1.0 = right edge). */\n anchorA: number;\n /** Anchor point for element B (0.0 = left edge, 0.5 = center, 1.0 = right edge). */\n anchorB: number;\n /** The desired horizontal distance between the elements. */\n distance: number;\n}\n\n/**\n * Constraint that enforces horizontal distance between two UI elements.\n *\n * UIHorizontalDistanceConstraint creates a mathematical relationship that maintains\n * a specific horizontal distance between two elements using configurable anchor points.\n * For plane elements, anchors determine the reference point (0.0 = left, 0.5 = center, 1.0 = right).\n * For point elements, the anchor is always the element's position. The constraint equation is:\n * (elementB.x + elementB.width * anchorB) - (elementA.x + elementA.width * anchorA) = distance\n *\n * @see {@link UISingleParameterConstraint} - Base class for single-parameter constraints\n * @see {@link UIPointElement} - Point elements that can be constrained\n * @see {@link UIPlaneElement} - Plane elements that can be constrained\n * @see {@link UIExpression} - Mathematical expressions for constraint equations\n */\nexport class UIHorizontalDistanceConstraint extends UISingleParameterConstraint {\n /** The constraint descriptor managed by the solver system. */\n protected override readonly constraint: number;\n\n /** Internal storage for element A's anchor point. */\n private anchorAInternal: number;\n /** Internal storage for element B's anchor point. */\n private anchorBInternal: number;\n /** Internal storage for the horizontal distance value. */\n private distanceInternal: number;\n\n /**\n * Creates a new UIHorizontalDistanceConstraint instance.\n *\n * The constraint will use default anchor points (0.5 = center) and zero distance\n * if not specified in options. Both elements must be from the same layer.\n *\n * @param a - The first UI element (point or plane element)\n * @param b - The second UI element (point or plane element)\n * @param options - Configuration options for the constraint\n * @throws Will throw an error if elements are not from the same layer\n * @see {@link assertValidConstraintSubjects}\n */\n constructor(\n private readonly a: UIPointElement | UIPlaneElement,\n private readonly b: UIPointElement | UIPlaneElement,\n options: Partial<UIHorizontalDistanceConstraintOptions> = {},\n ) {\n super(\n assertValidConstraintSubjects(a, b, \"UIHorizontalDistanceConstraint\"),\n options.priority,\n options.relation,\n options.orientation,\n );\n\n this.anchorAInternal = options.anchorA ?? DEFAULT_ANCHOR;\n this.anchorBInternal = options.anchorB ?? DEFAULT_ANCHOR;\n this.distanceInternal = options.distance ?? 0;\n\n this.constraint = this.solverWrapper.createConstraint(\n this.buildLHS(),\n new UIExpression(this.distanceInternal),\n this.relationInternal,\n this.priorityInternal,\n this.isConstraintEnabled(),\n );\n }\n\n /**\n * Gets the current horizontal distance being enforced.\n * @returns The horizontal distance in pixels\n */\n public get distance(): number {\n return this.distanceInternal;\n }\n\n /**\n * Gets the anchor point for element A.\n * @returns The anchor value (0.0 = left, 0.5 = center, 1.0 = right)\n */\n public get anchorA(): number {\n return this.anchorAInternal;\n }\n\n /**\n * Gets the anchor point for element B.\n * @returns The anchor value (0.0 = left, 0.5 = center, 1.0 = right)\n */\n public get anchorB(): number {\n return this.anchorBInternal;\n }\n\n /**\n * Sets a new horizontal distance and updates the constraint equation.\n * @param value - The new horizontal distance in pixels\n */\n public set distance(value: number) {\n if (this.distanceInternal !== value) {\n this.distanceInternal = value;\n this.solverWrapper.setConstraintRHS(\n this.constraint,\n new UIExpression(this.distanceInternal),\n );\n }\n }\n\n /**\n * Sets a new anchor point for element A and updates the constraint equation.\n * @param value - The new anchor value (0.0 = left, 0.5 = center, 1.0 = right)\n */\n public set anchorA(value: number) {\n if (this.anchorAInternal !== value) {\n this.anchorAInternal = value;\n this.solverWrapper.setConstraintLHS(this.constraint, this.buildLHS());\n }\n }\n\n /**\n * Sets a new anchor point for element B and updates the constraint equation.\n * @param value - The new anchor value (0.0 = left, 0.5 = center, 1.0 = right)\n */\n public set anchorB(value: number) {\n if (this.anchorBInternal !== value) {\n this.anchorBInternal = value;\n this.solverWrapper.setConstraintLHS(this.constraint, this.buildLHS());\n }\n }\n\n /**\n * Builds the left-hand side expression for the constraint equation.\n *\n * Creates the expression: (elementB.x + elementB.width * anchorB) - (elementA.x + elementA.width * anchorA)\n * For point elements, only the x position is used since they have no width.\n * For plane elements, the anchor determines the reference point within the element's width.\n *\n * @returns The UIExpression representing the horizontal distance calculation\n */\n private buildLHS(): UIExpression {\n let aExpression: UIExpression;\n let bExpression: UIExpression;\n\n if (isUIPlaneElement(this.a)) {\n aExpression = new UIExpression(0, [\n [this.a.xVariable, 1],\n [this.a.wVariable, this.anchorAInternal],\n ]);\n } else if (isUIPointElement(this.a)) {\n aExpression = new UIExpression().plus(this.a.xVariable, 1);\n } else {\n throw new Error(\"A is not a valid element type\");\n }\n\n if (isUIPlaneElement(this.b)) {\n bExpression = new UIExpression(0, [\n [this.b.xVariable, 1],\n [this.b.wVariable, this.anchorBInternal],\n ]);\n } else if (isUIPointElement(this.b)) {\n bExpression = new UIExpression().plus(this.b.xVariable, 1);\n } else {\n throw new Error(\"B is not a valid element type\");\n }\n\n return UIExpression.minus(bExpression, aExpression);\n }\n}\n","import type { UIPlaneElement } from \"../miscellaneous/asserts\";\nimport { assertValidConstraintSubjects } from \"../miscellaneous/asserts\";\nimport { UIExpression } from \"../miscellaneous/UIExpression\";\nimport type { UISingleParameterConstraintOptions } from \"./UISingleParameterConstraint\";\nimport { UISingleParameterConstraint } from \"./UISingleParameterConstraint\";\n\n/**\n * Configuration options for UIHorizontalProportionConstraint creation.\n */\nexport interface UIHorizontalProportionConstraintOptions\n extends UISingleParameterConstraintOptions {\n /** The proportional relationship between element widths (elementA.width * proportion = elementB.width). */\n proportion: number;\n}\n\n/**\n * Constraint that enforces proportional width relationships between two UI elements.\n *\n * UIHorizontalProportionConstraint creates a mathematical relationship that maintains\n * a proportional ratio between the widths of two plane elements. The constraint equation is:\n * elementA.width * proportion = elementB.width, which can be rearranged as:\n * elementA.width * proportion - elementB.width = 0\n *\n * This is useful for creating responsive layouts where elements need to maintain\n * specific width ratios, such as sidebar-to-content ratios or grid column proportions.\n *\n * @see {@link UISingleParameterConstraint} - Base class for single-parameter constraints\n * @see {@link UIPlaneElement} - Plane elements that can have proportional constraints applied\n * @see {@link UIExpression} - Mathematical expressions for constraint equations\n */\nexport class UIHorizontalProportionConstraint extends UISingleParameterConstraint {\n /** The constraint descriptor managed by the solver system. */\n protected override readonly constraint: number;\n /** Internal storage for the current proportion value. */\n private proportionInternal: number;\n\n /**\n * Creates a new UIHorizontalProportionConstraint instance.\n *\n * The constraint will enforce the relationship: elementA.width * proportion = elementB.width.\n * If no proportion is specified, it defaults to 1.0 (equal widths).\n * Both elements must be from the same layer.\n *\n * @param a - The first UI plane element (whose width will be multiplied by proportion)\n * @param b - The second UI plane element (target width for the proportion)\n * @param options - Configuration options for the constraint\n * @throws Will throw an error if elements are not from the same layer\n * @see {@link assertValidConstraintSubjects}\n */\n constructor(\n private readonly a: UIPlaneElement,\n private readonly b: UIPlaneElement,\n options: Partial<UIHorizontalProportionConstraintOptions> = {},\n ) {\n super(\n assertValidConstraintSubjects(a, b, \"UIHorizontalProportionConstraint\"),\n options.priority,\n options.relation,\n options.orientation,\n );\n\n this.proportionInternal = options.proportion ?? 1;\n\n this.constraint = this.solverWrapper.createConstraint(\n new UIExpression(0),\n this.buildRHS(),\n this.relationInternal,\n this.priorityInternal,\n this.isConstraintEnabled(),\n );\n }\n\n /**\n * Gets the current proportion value being enforced.\n * @returns The proportion ratio (elementA.width * proportion = elementB.width)\n */\n public get proportion(): number {\n return this.proportionInternal;\n }\n\n /**\n * Sets a new proportion value and updates the constraint equation.\n * @param value - The new proportion ratio\n */\n public set proportion(value: number) {\n if (this.proportionInternal !== value) {\n this.proportionInternal = value;\n this.solverWrapper.setConstraintRHS(this.constraint, this.buildRHS());\n }\n }\n\n /**\n * Builds the right-hand side expression for the constraint equation.\n *\n * Creates the expression: (elementA.width * proportion) - elementB.width = 0\n * This enforces the relationship: elementA.width * proportion = elementB.width\n *\n * @returns The UIExpression representing the proportional width relationship\n */\n private buildRHS(): UIExpression {\n return UIExpression.minus(\n new UIExpression(0, [[this.a.wVariable, this.proportionInternal]]),\n new UIExpression(0, [[this.b.wVariable, 1]]),\n );\n }\n}\n","import type { UIPlaneElement, UIPointElement } from \"../miscellaneous/asserts\";\nimport {\n assertValidConstraintSubjects,\n isUIPlaneElement,\n isUIPointElement,\n} from \"../miscellaneous/asserts\";\nimport { UIExpression } from \"../miscellaneous/UIExpression\";\nimport type { UISingleParameterConstraintOptions } from \"./UISingleParameterConstraint\";\nimport { UISingleParameterConstraint } from \"./UISingleParameterConstraint\";\n\n/** Default anchor point (0.5 = center) for elements when not specified. */\nconst DEFAULT_ANCHOR = 0.5;\n\n/**\n * Configuration options for UIVerticalDistanceConstraint creation.\n */\nexport interface UIVerticalDistanceConstraintOptions\n extends UISingleParameterConstraintOptions {\n /** Anchor point for element A (0.0 = top edge, 0.5 = center, 1.0 = bottom edge). */\n anchorA: number;\n /** Anchor point for element B (0.0 = top edge, 0.5 = center, 1.0 = bottom edge). */\n anchorB: number;\n /** The desired vertical distance between the elements. */\n distance: number;\n}\n\n/**\n * Constraint that enforces vertical distance between two UI elements.\n *\n * UIVerticalDistanceConstraint creates a mathematical relationship that maintains\n * a specific vertical distance between two elements using configurable anchor points.\n * For plane elements, anchors determine the reference point (0.0 = top, 0.5 = center, 1.0 = bottom).\n * For point elements, the anchor is always the element's position. The constraint equation is:\n * (elementB.y + elementB.height * anchorB) - (elementA.y + elementA.height * anchorA) = distance\n *\n * @see {@link UISingleParameterConstraint} - Base class for single-parameter constraints\n * @see {@link UIPointElement} - Point elements that can be constrained\n * @see {@link UIPlaneElement} - Plane elements that can be constrained\n * @see {@link UIExpression} - Mathematical expressions for constraint equations\n */\nexport class UIVerticalDistanceConstraint extends UISingleParameterConstraint {\n /** The constraint descriptor managed by the solver system. */\n protected override readonly constraint: number;\n\n /** Internal storage for element A's anchor point. */\n private anchorAInternal: number;\n /** Internal storage for element B's anchor point. */\n private anchorBInternal: number;\n /** Internal storage for the vertical distance value. */\n private distanceInternal: number;\n\n /**\n * Creates a new UIVerticalDistanceConstraint instance.\n *\n * The constraint will use default anchor points (0.5 = center) and zero distance\n * if not specified in options. Both elements must be from the same layer.\n *\n * @param a - The first UI element (point or plane element)\n * @param b - The second UI element (point or plane element)\n * @param options - Configuration options for the constraint\n * @throws Will throw an error if elements are not from the same layer\n * @see {@link assertValidConstraintSubjects}\n */\n constructor(\n private readonly a: UIPointElement | UIPlaneElement,\n private readonly b: UIPointElement | UIPlaneElement,\n options: Partial<UIVerticalDistanceConstraintOptions> = {},\n ) {\n super(\n assertValidConstraintSubjects(a, b, \"UIVerticalDistanceConstraint\"),\n options.priority,\n options.relation,\n options.orientation,\n );\n\n this.anchorAInternal = options.anchorA ?? DEFAULT_ANCHOR;\n this.anchorBInternal = options.anchorB ?? DEFAULT_ANCHOR;\n this.distanceInternal = options.distance ?? 0;\n\n this.constraint = this.solverWrapper.createConstraint(\n this.buildLHS(),\n new UIExpression(this.distanceInternal),\n this.relationInternal,\n this.priorityInternal,\n this.isConstraintEnabled(),\n );\n }\n\n /**\n * Gets the current vertical distance being enforced.\n * @returns The vertical distance in pixels\n */\n public get distance(): number {\n return this.distanceInternal;\n }\n\n /**\n * Gets the anchor point for element A.\n * @returns The anchor value (0.0 = top, 0.5 = center, 1.0 = bottom)\n */\n public get anchorA(): number {\n return this.anchorAInternal;\n }\n\n /**\n * Gets the anchor point for element B.\n * @returns The anchor value (0.0 = top, 0.5 = center, 1.0 = bottom)\n */\n public get anchorB(): number {\n return this.anchorBInternal;\n }\n\n /**\n * Sets a new vertical distance and updates the constraint equation.\n * @param value - The new vertical distance in pixels\n */\n public set distance(value: number) {\n if (this.distanceInternal !== value) {\n this.distanceInternal = value;\n this.solverWrapper.setConstraintRHS(\n this.constraint,\n new UIExpression(this.distanceInternal),\n );\n }\n }\n\n /**\n * Sets a new anchor point for element A and updates the constraint equation.\n * @param value - The new anchor value (0.0 = top, 0.5 = center, 1.0 = bottom)\n */\n public set anchorA(value: number) {\n if (this.anchorAInternal !== value) {\n this.anchorAInternal = value;\n this.solverWrapper.setConstraintLHS(this.constraint, this.buildLHS());\n }\n }\n\n /**\n * Sets a new anchor point for element B and updates the constraint equation.\n * @param value - The new anchor value (0.0 = top, 0.5 = center, 1.0 = bottom)\n */\n public set anchorB(value: number) {\n if (this.anchorBInternal !== value) {\n this.anchorBInternal = value;\n this.solverWrapper.setConstraintLHS(this.constraint, this.buildLHS());\n }\n }\n\n /**\n * Builds the left-hand side expression for the constraint equation.\n *\n * Creates the expression: (elementB.y + elementB.height * anchorB) - (elementA.y + elementA.height * anchorA)\n * For point elements, only the y position is used since they have no height.\n * For plane elements, the anchor determines the reference point within the element's height.\n *\n * @returns The UIExpression representing the vertical distance calculation\n */\n private buildLHS(): UIExpression {\n let aExpression: UIExpression;\n let bExpression: UIExpression;\n\n if (isUIPlaneElement(this.a)) {\n aExpression = new UIExpression(0, [\n [this.a.yVariable, 1],\n [this.a.hVariable, this.anchorAInternal],\n ]);\n } else if (isUIPointElement(this.a)) {\n aExpression = new UIExpression().plus(this.a.yVariable, 1);\n } else {\n throw new Error(\"A is not a valid element type\");\n }\n\n if (isUIPlaneElement(this.b)) {\n bExpression = new UIExpression(0, [\n [this.b.yVariable, 1],\n [this.b.hVariable, this.anchorBInternal],\n ]);\n } else if (isUIPointElement(this.b)) {\n bExpression = new UIExpression().plus(this.b.yVariable, 1);\n } else {\n throw new Error(\"B is not a valid element type\");\n }\n\n return UIExpression.minus(bExpression, aExpression);\n }\n}\n","import type { UIPlaneElement } from \"../miscellaneous/asserts\";\nimport { assertValidConstraintSubjects } from \"../miscellaneous/asserts\";\nimport { UIExpression } from \"../miscellaneous/UIExpression\";\nimport type { UISingleParameterConstraintOptions } from \"./UISingleParameterConstraint\";\nimport { UISingleParameterConstraint } from \"./UISingleParameterConstraint\";\n\n/**\n * Configuration options for UIVerticalProportionConstraint creation.\n */\nexport interface UIVerticalProportionConstraintOptions\n extends UISingleParameterConstraintOptions {\n /** The proportional relationship between element heights (elementA.height * proportion = elementB.height). */\n proportion: number;\n}\n\n/**\n * Constraint that enforces proportional height relationships between two UI elements.\n *\n * UIVerticalProportionConstraint creates a mathematical relationship that maintains\n * a proportional ratio between the heights of two plane elements. The constraint equation is:\n * elementA.height * proportion = elementB.height, which can be rearranged as:\n * elementA.height * proportion - elementB.height = 0\n *\n * This is useful for creating responsive layouts where elements need to maintain\n * specific height ratios, such as header-to-content ratios or row height proportions.\n *\n * @see {@link UISingleParameterConstraint} - Base class for single-parameter constraints\n * @see {@link UIPlaneElement} - Plane elements that can have proportional constraints applied\n * @see {@link UIExpression} - Mathematical expressions for constraint equations\n */\nexport class UIVerticalProportionConstraint extends UISingleParameterConstraint {\n /** The constraint descriptor managed by the solver system. */\n protected override readonly constraint: number;\n /** Internal storage for the current proportion value. */\n private proportionInternal: number;\n\n /**\n * Creates a new UIVerticalProportionConstraint instance.\n *\n * The constraint will enforce the relationship: elementA.height * proportion = elementB.height.\n * If no proportion is specified, it defaults to 1.0 (equal heights).\n * Both elements must be from the same layer.\n *\n * @param a - The first UI plane element (whose height will be multiplied by proportion)\n * @param b - The second UI plane element (target height for the proportion)\n * @param options - Configuration options for the constraint\n * @throws Will throw an error if elements are not from the same layer\n * @see {@link assertValidConstraintSubjects}\n */\n constructor(\n private readonly a: UIPlaneElement,\n private readonly b: UIPlaneElement,\n options: Partial<UIVerticalProportionConstraintOptions> = {},\n ) {\n super(\n assertValidConstraintSubjects(a, b, \"UIVerticalProportionConstraint\"),\n options.priority,\n options.relation,\n options.orientation,\n );\n\n this.proportionInternal = options.proportion ?? 1;\n\n this.constraint = this.solverWrapper.createConstraint(\n new UIExpression(0),\n this.buildRHS(),\n this.relationInternal,\n this.priorityInternal,\n this.isConstraintEnabled(),\n );\n }\n\n /**\n * Gets the current proportion value being enforced.\n * @returns The proportion ratio (elementA.height * proportion = elementB.height)\n */\n public get proportion(): number {\n return this.proportionInternal;\n }\n\n /**\n * Sets a new proportion value and updates the constraint equation.\n * @param value - The new proportion ratio\n */\n public set proportion(value: number) {\n if (this.proportionInternal !== value) {\n this.proportionInternal = value;\n this.solverWrapper.setConstraintRHS(this.constraint, this.buildRHS());\n }\n }\n\n /**\n * Builds the right-hand side expression for the constraint equation.\n *\n * Creates the expression: (elementA.height * proportion) - elementB.height = 0\n * This enforces the relationship: elementA.height * proportion = elementB.height\n *\n * @returns The UIExpression representing the proportional height relationship\n */\n private buildRHS(): UIExpression {\n return UIExpression.minus(\n new UIExpression(0, [[this.a.hVariable, this.proportionInternal]]),\n new UIExpression(0, [[this.b.hVariable, 1]]),\n );\n }\n}\n","import type { UILayerElement, UIPlaneElement } from \"../miscellaneous/asserts\";\nimport { UIExpression } from \"../miscellaneous/UIExpression\";\nimport type { UISingleParameterConstraintOptions } from \"./UISingleParameterConstraint\";\nimport { UISingleParameterConstraint } from \"./UISingleParameterConstraint\";\n\n/**\n * Configuration options for UIWidthConstraint creation.\n */\nexport interface UIWidthConstraintOptions\n extends UISingleParameterConstraintOptions {\n /** The desired width value for the element. */\n width: number;\n}\n\n/**\n * Constraint that enforces a specific width value for UI elements.\n *\n * UIWidthConstraint creates a mathematical relationship that fixes an element's\n * width to a constant value. The constraint equation is: element.width = width.\n * This is useful for ensuring elements maintain a specific width regardless of\n * other layout changes or for setting fixed dimensions in responsive layouts.\n *\n * @see {@link UISingleParameterConstraint} - Base class for single-parameter constraints\n * @see {@link UIPlaneElement} - Elements that can have width constraints applied\n * @see {@link UIExpression} - Mathematical expressions for constraint equations\n */\nexport class UIWidthConstraint extends UISingleParameterConstraint {\n /** The constraint descriptor managed by the solver system. */\n protected override readonly constraint: number;\n\n /** Internal storage for the current width value. */\n private widthInternal: number;\n\n /**\n * Creates a new UIWidthConstraint instance.\n *\n * If no width is specified in options, the constraint will use the\n * element's current width as the target width value.\n *\n * @param element - The UI element to apply the width constraint to\n * @param options - Configuration options for the constraint\n */\n constructor(\n private readonly element: UIPlaneElement & UILayerElement,\n options: Partial<UIWidthConstraintOptions> = {},\n ) {\n super(\n element.layer,\n options.priority,\n options.relation,\n options.orientation,\n );\n\n this.widthInternal = options.width ?? element.width;\n\n this.constraint = this.solverWrapper.createConstraint(\n new UIExpression(0, [[this.element.wVariable, 1]]),\n new UIExpression(this.widthInternal),\n this.relation,\n this.priority,\n this.isConstraintEnabled(),\n );\n }\n\n /**\n * Gets the current width value being enforced.\n * @returns The width value in pixels\n */\n public get width(): number {\n return this.widthInternal;\n }\n\n /**\n * Sets a new width value and updates the constraint equation.\n * @param value - The new width value in pixels\n */\n public set width(value: number) {\n if (this.widthInternal !== value) {\n this.widthInternal = value;\n this.solverWrapper.setConstraintRHS(\n this.constraint,\n new UIExpression(value),\n );\n }\n }\n}\n","import { UIHeightConstraint } from \"../constraints/UIHeightConstraint\";\nimport { UIHorizontalDistanceConstraint } from \"../constraints/UIHorizontalDistanceConstraint\";\nimport { UIHorizontalProportionConstraint } from \"../constraints/UIHorizontalProportionConstraint\";\nimport { UIVerticalDistanceConstraint } from \"../constraints/UIVerticalDistanceConstraint\";\nimport { UIVerticalProportionConstraint } from \"../constraints/UIVerticalProportionConstraint\";\nimport { UIWidthConstraint } from \"../constraints/UIWidthConstraint\";\nimport type { UIElement } from \"../elements/UIElement\";\nimport type { UIPlaneElement, UIPointElement } from \"../miscellaneous/asserts\";\nimport type { UIOrientation } from \"../miscellaneous/UIOrientation\";\nimport type { UIPriority } from \"../miscellaneous/UIPriority\";\nimport type { UIRelation } from \"../miscellaneous/UIRelation\";\n\n/**\n * Generic 2D type for specifying horizontal and vertical values.\n *\n * This interface allows configuration of properties that can have\n * different values for horizontal and vertical directions.\n *\n * @template T - The type of values for horizontal and vertical properties\n */\ninterface UIType2D<T> {\n /** Horizontal (x-axis) value. */\n h?: T;\n /** Vertical (y-axis) value. */\n v?: T;\n}\n\n/**\n * Base options for 2D constraint configuration.\n */\ninterface UIConstraint2DOptions {\n /** Priority levels for horizontal and vertical constraints. */\n priority: UIType2D<UIPriority>;\n /** Mathematical relations for horizontal and vertical constraints. */\n relation: UIType2D<UIRelation>;\n /** Orientation settings for horizontal and vertical constraints. */\n orientation: UIType2D<UIOrientation>;\n}\n\n/**\n * Configuration options for 2D size constraints.\n */\nexport interface UIConstraintSize2DOptions extends UIConstraint2DOptions {\n /** Size values for horizontal (width) and vertical (height) dimensions. */\n size: UIType2D<number>;\n}\n\n/**\n * Configuration options for 2D distance constraints.\n */\nexport interface UIConstraintDistance2DOptions extends UIConstraint2DOptions {\n /** Anchor points for element A in horizontal and vertical directions. */\n anchorA: UIType2D<number>;\n /** Anchor points for element B in horizontal and vertical directions. */\n anchorB: UIType2D<number>;\n /** Distance values for horizontal and vertical spacing. */\n distance: UIType2D<number>;\n}\n\n/**\n * Configuration options for 2D proportion constraints.\n */\nexport interface UIConstraintProportion2DOptions extends UIConstraint2DOptions {\n /** Proportion ratios for horizontal and vertical relationships. */\n proportion: UIType2D<number>;\n}\n\n/**\n * Result object containing horizontal and vertical constraint instances.\n *\n * @template TH - The type of the horizontal constraint\n * @template TV - The type of the vertical constraint\n */\nexport interface UIConstraint2DResult<TH, TV> {\n /** The horizontal constraint instance. */\n h: TH;\n /** The vertical constraint instance. */\n v: TV;\n}\n\n/**\n * Builder utility for creating paired horizontal and vertical constraints.\n *\n * UIConstraint2DBuilder simplifies the creation of constraint pairs that work\n * together to define 2D relationships between UI elements. Instead of manually\n * creating separate horizontal and vertical constraints, this builder allows\n * you to specify both dimensions at once with a unified interface.\n *\n * This is particularly useful for creating consistent spacing, sizing, and\n * proportional relationships across both axes simultaneously.\n *\n * @see {@link UIWidthConstraint} - Horizontal size constraints\n * @see {@link UIHeightConstraint} - Vertical size constraints\n * @see {@link UIHorizontalDistanceConstraint} - Horizontal spacing constraints\n * @see {@link UIVerticalDistanceConstraint} - Vertical spacing constraints\n */\nexport class UIConstraint2DBuilder {\n /**\n * Creates paired width and height constraints for an element.\n *\n * This method generates both horizontal (width) and vertical (height)\n * size constraints simultaneously, allowing you to set fixed dimensions\n * for both axes with a single call.\n *\n * @param element - The UI element to apply size constraints to\n * @param options - Configuration options for both width and height constraints\n * @returns Object containing the created width and height constraint instances\n */\n public static size(\n element: UIElement,\n options: Partial<UIConstraintSize2DOptions> = {},\n ): UIConstraint2DResult<UIWidthConstraint, UIHeightConstraint> {\n return {\n h: new UIWidthConstraint(element, {\n width: options.size?.h,\n priority: options.priority?.h,\n relation: options.relation?.h,\n orientation: options.orientation?.h,\n }),\n v: new UIHeightConstraint(element, {\n height: options.size?.v,\n priority: options.priority?.v,\n relation: options.relation?.v,\n orientation: options.orientation?.v,\n }),\n };\n }\n\n /**\n * Creates paired horizontal and vertical distance constraints between two elements.\n *\n * This method generates both horizontal and vertical spacing constraints\n * simultaneously, allowing you to define 2D spacing relationships with\n * configurable anchor points for both axes.\n *\n * @param a - The first UI element (point or plane element)\n * @param b - The second UI element (point or plane element)\n * @param options - Configuration options for both horizontal and vertical distance constraints\n * @returns Object containing the created horizontal and vertical distance constraint instances\n */\n public static distance(\n a: UIPointElement | UIPlaneElement,\n b: UIPointElement | UIPlaneElement,\n options: Partial<UIConstraintDistance2DOptions> = {},\n ): UIConstraint2DResult<\n UIHorizontalDistanceConstraint,\n UIVerticalDistanceConstraint\n > {\n return {\n h: new UIHorizontalDistanceConstraint(a, b, {\n anchorA: options.anchorA?.h,\n anchorB: options.anchorB?.h,\n distance: options.distance?.h,\n priority: options.priority?.h,\n relation: options.relation?.h,\n orientation: options.orientation?.h,\n }),\n v: new UIVerticalDistanceConstraint(a, b, {\n anchorA: options.anchorA?.v,\n anchorB: options.anchorB?.v,\n distance: options.distance?.v,\n priority: options.priority?.v,\n relation: options.relation?.v,\n orientation: options.orientation?.v,\n }),\n };\n }\n\n /**\n * Creates paired horizontal and vertical proportion constraints between two elements.\n *\n * This method generates both horizontal (width) and vertical (height)\n * proportion constraints simultaneously, allowing you to define proportional\n * relationships for both dimensions with a single call.\n *\n * @param a - The first UI plane element (whose dimensions will be multiplied by proportion)\n * @param b - The second UI plane element (target dimensions for the proportion)\n * @param options - Configuration options for both horizontal and vertical proportion constraints\n * @returns Object containing the created horizontal and vertical proportion constraint instances\n */\n public static proportion(\n a: UIPlaneElement,\n b: UIPlaneElement,\n options: Partial<UIConstraintProportion2DOptions> = {},\n ): UIConstraint2DResult<\n UIHorizontalProportionConstraint,\n UIVerticalProportionConstraint\n > {\n return {\n h: new UIHorizontalProportionConstraint(a, b, {\n proportion: options.proportion?.h,\n priority: options.priority?.h,\n relation: options.relation?.h,\n orientation: options.orientation?.h,\n }),\n v: new UIVerticalProportionConstraint(a, b, {\n proportion: options.proportion?.v,\n priority: options.priority?.v,\n relation: options.relation?.v,\n orientation: options.orientation?.v,\n }),\n };\n }\n}\n","import type { UILayerElement, UIPlaneElement } from \"../miscellaneous/asserts\";\nimport { UIExpression } from \"../miscellaneous/UIExpression\";\nimport type { UISingleParameterConstraintOptions } from \"./UISingleParameterConstraint\";\nimport { UISingleParameterConstraint } from \"./UISingleParameterConstraint\";\n\n/**\n * Configuration options for UIAspectConstraint creation.\n */\nexport interface UIAspectConstraintOptions\n extends UISingleParameterConstraintOptions {\n /** The desired aspect ratio (width/height) for the element. */\n aspect: number;\n}\n\n/**\n * Constraint that maintains a specific aspect ratio for UI elements.\n *\n * UIAspectConstraint enforces a mathematical relationship between an element's\n * width and height to maintain a constant aspect ratio. The constraint equation\n * is: width = height * aspect. This is useful for ensuring elements maintain\n * their proportions during layout changes or for enforcing specific aspect\n * ratios like 16:9 for video content.\n *\n * @see {@link UISingleParameterConstraint} - Base class for single-parameter constraints\n * @see {@link UIPlaneElement} - Elements that can have aspect constraints applied\n * @see {@link UIExpression} - Mathematical expressions for constraint equations\n */\nexport class UIAspectConstraint extends UISingleParameterConstraint {\n /** The constraint descriptor managed by the solver system. */\n protected override readonly constraint: number;\n\n /** Internal storage for the current aspect ratio value. */\n private aspectInternal: number;\n\n /**\n * Creates a new UIAspectConstraint instance.\n *\n * If no aspect ratio is specified in options, the constraint will use the\n * element's current width-to-height ratio as the target aspect ratio.\n *\n * @param element - The UI element to apply the aspect constraint to\n * @param options - Configuration options for the constraint\n */\n constructor(\n private readonly element: UIPlaneElement & UILayerElement,\n options: Partial<UIAspectConstraintOptions> = {},\n ) {\n super(\n element.layer,\n options.priority,\n options.relation,\n options.orientation,\n );\n\n this.aspectInternal = options.aspect ?? element.width / element.height;\n\n this.constraint = this.solverWrapper.createConstraint(\n this.buildLHS(),\n new UIExpression(0),\n this.relation,\n this.priority,\n this.isConstraintEnabled(),\n );\n }\n\n /**\n * Gets the current aspect ratio being enforced.\n * @returns The aspect ratio (width/height)\n */\n public get aspect(): number {\n return this.aspectInternal;\n }\n\n /**\n * Sets a new aspect ratio and updates the constraint equation.\n * @param value - The new aspect ratio (width/height)\n */\n public set aspect(value: number) {\n if (this.aspectInternal !== value) {\n this.aspectInternal = value;\n this.solverWrapper.setConstraintLHS(this.constraint, this.buildLHS());\n }\n }\n\n /**\n * Builds the left-hand side expression for the constraint equation.\n *\n * Creates the expression: width - (height * aspect) = 0\n * This enforces the relationship: width = height * aspect\n *\n * @returns The UIExpression representing the constraint equation\n */\n private buildLHS(): UIExpression {\n return new UIExpression(0, [\n [this.element.wVariable, 1],\n [this.element.hVariable, -this.aspectInternal],\n ]);\n }\n}\n","import { UIAspectConstraint } from \"../constraints/UIAspectConstraint\";\nimport { UIHorizontalDistanceConstraint } from \"../constraints/UIHorizontalDistanceConstraint\";\nimport { UIHorizontalProportionConstraint } from \"../constraints/UIHorizontalProportionConstraint\";\nimport { UIVerticalDistanceConstraint } from \"../constraints/UIVerticalDistanceConstraint\";\nimport { UIVerticalProportionConstraint } from \"../constraints/UIVerticalProportionConstraint\";\nimport type { UILayerElement, UIPlaneElement } from \"../miscellaneous/asserts\";\nimport { type UIOrientation } from \"../miscellaneous/UIOrientation\";\nimport { UIPriority } from \"../miscellaneous/UIPriority\";\nimport { UIRelation } from \"../miscellaneous/UIRelation\";\n\nconst DEFAULT_ANCHOR = 0.5;\n\n/**\n * Configuration options for the UICoverConstraintBuilder.\n */\nexport interface UICoverConstraintBuilderOptions {\n /** Whether to maintain the aspect ratio of the active (content) element */\n keepActiveAspect: boolean;\n /** Horizontal anchor point (0.0 = left, 0.5 = center, 1.0 = right) */\n anchorH: number;\n /** Vertical anchor point (0.0 = top, 0.5 = center, 1.0 = bottom) */\n anchorV: number;\n /** Orientation context for constraint calculations */\n orientation: UIOrientation;\n}\n\n/**\n * Builder for creating \"cover\" layout constraints that make an element cover its container.\n *\n * Cover layout ensures the active element is large enough to completely cover the passive\n * element while maintaining proportions. This is similar to CSS `background-size: cover`\n * or `object-fit: cover` behavior.\n *\n * The active element will be:\n * - Positioned at the specified anchor point within the passive element\n * - Sized to be at least as large as the passive element in both dimensions\n * - Scaled proportionally to maintain aspect ratio (if enabled)\n *\n * The constraints ensure: passive.dimension * 1 ≤ active.dimension (active covers passive)\n */\nexport class UICoverConstraintBuilder {\n /**\n * Creates a set of constraints for cover layout behavior.\n *\n * @param passive - The container element (what gets covered)\n * @param active - The content element (what does the covering)\n * @param options - Configuration options for the cover layout\n * @returns Object containing all created constraints\n */\n public static build(\n passive: UIPlaneElement,\n active: UIPlaneElement & UILayerElement,\n options: Partial<UICoverConstraintBuilderOptions> = {},\n ): {\n /** Aspect constraint for the active element (if keepActiveAspect is true) */\n activeAspectConstraint?: UIAspectConstraint;\n /** Horizontal positioning constraint */\n xConstraint: UIHorizontalDistanceConstraint;\n /** Vertical positioning constraint */\n yConstraint: UIVerticalDistanceConstraint;\n /** Width proportion constraint (ensures coverage) */\n widthConstraint: UIHorizontalProportionConstraint;\n /** Height proportion constraint (ensures coverage) */\n heightConstraint: UIVerticalProportionConstraint;\n } {\n let activeAspectConstraint: UIAspectConstraint | undefined;\n if (options.keepActiveAspect === true) {\n activeAspectConstraint = new UIAspectConstraint(active, {\n orientation: options.orientation,\n });\n }\n\n const xConstraint = new UIHorizontalDistanceConstraint(passive, active, {\n anchorA: options.anchorH ?? DEFAULT_ANCHOR,\n anchorB: options.anchorH ?? DEFAULT_ANCHOR,\n orientation: options.orientation,\n });\n\n const yConstraint = new UIVerticalDistanceConstraint(passive, active, {\n anchorA: options.anchorV ?? DEFAULT_ANCHOR,\n anchorB: options.anchorV ?? DEFAULT_ANCHOR,\n orientation: options.orientation,\n });\n\n const widthConstraint = new UIHorizontalProportionConstraint(\n passive,\n active,\n {\n proportion: 1,\n relation: UIRelation.GREATER_THAN,\n orientation: options.orientation,\n },\n );\n\n const heightConstraint = new UIVerticalProportionConstraint(\n passive,\n active,\n {\n proportion: 1,\n priority: UIPriority.P1,\n orientation: options.orientation,\n },\n );\n\n return {\n activeAspectConstraint,\n xConstraint,\n yConstraint,\n widthConstraint,\n heightConstraint,\n };\n }\n}\n","import { UIAspectConstraint } from \"../constraints/UIAspectConstraint\";\nimport { UIHorizontalDistanceConstraint } from \"../constraints/UIHorizontalDistanceConstraint\";\nimport { UIHorizontalProportionConstraint } from \"../constraints/UIHorizontalProportionConstraint\";\nimport { UIVerticalDistanceConstraint } from \"../constraints/UIVerticalDistanceConstraint\";\nimport { UIVerticalProportionConstraint } from \"../constraints/UIVerticalProportionConstraint\";\nimport type { UILayerElement, UIPlaneElement } from \"../miscellaneous/asserts\";\nimport { type UIOrientation } from \"../miscellaneous/UIOrientation\";\nimport { UIPriority } from \"../miscellaneous/UIPriority\";\nimport { UIRelation } from \"../miscellaneous/UIRelation\";\n\nconst DEFAULT_ANCHOR = 0.5;\n\n/**\n * Configuration options for the UIFitConstraintBuilder.\n */\nexport interface UIFitConstraintBuilderOptions {\n /** Whether to maintain the aspect ratio of the active (content) element */\n keepActiveAspect: boolean;\n /** Horizontal anchor point (0.0 = left, 0.5 = center, 1.0 = right) */\n anchorH: number;\n /** Vertical anchor point (0.0 = top, 0.5 = center, 1.0 = bottom) */\n anchorV: number;\n /** Orientation context for constraint calculations */\n orientation: UIOrientation;\n}\n\n/**\n * Builder for creating \"fit\" layout constraints that make an element fit within its container.\n *\n * Fit layout ensures the active element is sized to completely fit within the passive\n * element while maintaining proportions. This is similar to CSS `background-size: contain`\n * or `object-fit: contain` behavior.\n *\n * The active element will be:\n * - Positioned at the specified anchor point within the passive element\n * - Sized to fit entirely within the passive element in both dimensions\n * - Scaled proportionally to maintain aspect ratio (if enabled)\n *\n * The constraints ensure: passive.dimension * 1 ≥ active.dimension (active fits within passive)\n */\nexport class UIFitConstraintBuilder {\n /**\n * Creates a set of constraints for fit layout behavior.\n *\n * @param passive - The container element (what contains the content)\n * @param active - The content element (what gets fitted within the container)\n * @param options - Configuration options for the fit layout\n * @returns Object containing all created constraints\n */\n public static build(\n passive: UIPlaneElement,\n active: UIPlaneElement & UILayerElement,\n options: Partial<UIFitConstraintBuilderOptions> = {},\n ): {\n /** Aspect constraint for the active element (if keepActiveAspect is true) */\n activeAspectConstraint?: UIAspectConstraint;\n /** Horizontal positioning constraint */\n xConstraint: UIHorizontalDistanceConstraint;\n /** Vertical positioning constraint */\n yConstraint: UIVerticalDistanceConstraint;\n /** Width proportion constraint (ensures fitting) */\n widthConstraint: UIHorizontalProportionConstraint;\n /** Height proportion constraint (ensures fitting) */\n heightConstraint: UIVerticalProportionConstraint;\n } {\n let activeAspectConstraint: UIAspectConstraint | undefined;\n if (options.keepActiveAspect === true) {\n activeAspectConstraint = new UIAspectConstraint(active, {\n orientation: options.orientation,\n });\n }\n\n const xConstraint = new UIHorizontalDistanceConstraint(passive, active, {\n anchorA: options.anchorH ?? DEFAULT_ANCHOR,\n anchorB: options.anchorH ?? DEFAULT_ANCHOR,\n orientation: options.orientation,\n });\n\n const yConstraint = new UIVerticalDistanceConstraint(passive, active, {\n anchorA: options.anchorV ?? DEFAULT_ANCHOR,\n anchorB: options.anchorV ?? DEFAULT_ANCHOR,\n orientation: options.orientation,\n });\n\n const widthConstraint = new UIHorizontalProportionConstraint(\n passive,\n active,\n {\n proportion: 1,\n relation: UIRelation.LESS_THAN,\n orientation: options.orientation,\n },\n );\n\n const heightConstraint = new UIVerticalProportionConstraint(\n passive,\n active,\n {\n proportion: 1,\n priority: UIPriority.P1,\n orientation: options.orientation,\n },\n );\n\n return {\n activeAspectConstraint,\n xConstraint,\n yConstraint,\n widthConstraint,\n heightConstraint,\n };\n }\n}\n","import type { UILayer } from \"../layers/UILayer\";\nimport type { UIExpression } from \"../miscellaneous/UIExpression\";\nimport type { UISingleParameterConstraintOptions } from \"./UISingleParameterConstraint\";\nimport { UISingleParameterConstraint } from \"./UISingleParameterConstraint\";\n\n/**\n * Constraint that allows custom mathematical relationships between UI elements.\n *\n * UICustomConstraint provides maximum flexibility by allowing direct specification\n * of the left-hand side (LHS) and right-hand side (RHS) expressions for constraint\n * equations. This enables creation of complex mathematical relationships that may\n * not be covered by the specialized constraint types. The constraint equation is:\n * LHS relation RHS (e.g., LHS = RHS, LHS ≤ RHS, or LHS ≥ RHS)\n *\n * This is useful for implementing custom layout logic, complex mathematical\n * relationships between multiple elements, or prototype new constraint types.\n *\n * @see {@link UISingleParameterConstraint} - Base class for single-parameter constraints\n * @see {@link UIExpression} - Mathematical expressions for constraint equations\n * @see {@link UILayer} - Container layer for constraints\n */\nexport class UICustomConstraint extends UISingleParameterConstraint {\n /** The constraint descriptor managed by the solver system. */\n protected override readonly constraint: number;\n /** Internal storage for the left-hand side expression. */\n private lhsInternal: UIExpression;\n /** Internal storage for the right-hand side expression. */\n private rhsInternal: UIExpression;\n\n /**\n * Creates a new UICustomConstraint instance with custom expressions.\n *\n * The constraint will enforce the relationship: LHS relation RHS, where\n * the relation is determined by the options (defaults to equality).\n *\n * @param layer - The UI layer that contains this constraint\n * @param lhs - The left-hand side expression of the constraint equation\n * @param rhs - The right-hand side expression of the constraint equation\n * @param options - Configuration options for the constraint\n */\n constructor(\n layer: UILayer,\n lhs: UIExpression,\n rhs: UIExpression,\n options: Partial<UISingleParameterConstraintOptions> = {},\n ) {\n super(layer, options.priority, options.relation, options.orientation);\n\n this.lhsInternal = lhs;\n this.rhsInternal = rhs;\n\n this.constraint = this.solverWrapper.createConstraint(\n this.lhsInternal,\n this.rhsInternal,\n this.relation,\n this.priority,\n this.isConstraintEnabled(),\n );\n }\n\n /**\n * Gets the current left-hand side expression.\n * @returns The LHS expression of the constraint equation\n */\n public get lhs(): UIExpression {\n return this.lhsInternal;\n }\n\n /**\n * Gets the current right-hand side expression.\n * @returns The RHS expression of the constraint equation\n */\n public get rhs(): UIExpression {\n return this.rhsInternal;\n }\n\n /**\n * Sets a new left-hand side expression and updates the constraint.\n * @param value - The new LHS expression for the constraint equation\n */\n public setLHS(value: UIExpression): void {\n this.lhsInternal = value;\n this.solverWrapper.setConstraintLHS(this.constraint, this.lhsInternal);\n }\n\n /**\n * Sets a new right-hand side expression and updates the constraint.\n * @param value - The new RHS expression for the constraint equation\n */\n public setRHS(value: UIExpression): void {\n this.rhsInternal = value;\n this.solverWrapper.setConstraintRHS(this.constraint, this.rhsInternal);\n }\n}\n","import { Eventail } from \"eventail\";\nimport type { UILayer } from \"../layers/UILayer\";\nimport type { UIPointElement } from \"../miscellaneous/asserts\";\nimport { assertValidNumber } from \"../miscellaneous/asserts\";\nimport { UIPriority } from \"../miscellaneous/UIPriority\";\nimport type { UISolverWrapper } from \"../wrappers/UISolverWrapper\";\n\n/**\n * Base class representing a minimal UI element as a point in 2D space.\n *\n * A UIAnchor serves as the fundamental building block for UI layout systems,\n * representing a single point with x and y coordinates. It provides constraint-based\n * positioning through solver variables and serves as an anchor point for more\n * complex UI elements.\n *\n * @see {@link UIPointElement} - Interface defining point element behavior\n * @see {@link UILayer} - Container layer for UI elements\n * @see {@link UISolverWrapper} - Constraint solver integration\n */\nexport class UIAnchor extends Eventail implements UIPointElement {\n /** Optional name identifier for the anchor. */\n public name = \"\";\n\n /**\n * Solver variable descriptor for the x-coordinate.\n * This variable is managed by the constraint solver system.\n */\n public readonly xVariable: number;\n\n /**\n * Solver variable descriptor for the y-coordinate.\n * This variable is managed by the constraint solver system.\n */\n public readonly yVariable: number;\n\n /**\n * Reference to the constraint solver wrapper for variable management.\n * @see {@link UISolverWrapper}\n */\n protected readonly solverWrapper: UISolverWrapper;\n\n /**\n * Creates a new UIAnchor instance.\n *\n * @param layer - The UI layer that contains this anchor\n * @param x - Initial x-coordinate position\n * @param y - Initial y-coordinate position\n * @throws Will throw an error if x or y are not valid numbers\n * @see {@link assertValidNumber}\n */\n constructor(\n public readonly layer: UILayer,\n x: number,\n y: number,\n ) {\n assertValidNumber(x, \"UIAnchor x\");\n assertValidNumber(y, \"UIAnchor y\");\n\n super();\n this.solverWrapper = this.layer[\"getSolverWrapperInternal\"]();\n this.xVariable = this.solverWrapper.createVariable(x, UIPriority.P7);\n this.yVariable = this.solverWrapper.createVariable(y, UIPriority.P7);\n }\n\n /**\n * Gets the current x-coordinate value from the solver.\n * @returns The current x-coordinate position\n */\n public get x(): number {\n return this.solverWrapper.readVariableValue(this.xVariable);\n }\n\n /**\n * Gets the current y-coordinate value from the solver.\n * @returns The current y-coordinate position\n */\n public get y(): number {\n return this.solverWrapper.readVariableValue(this.yVariable);\n }\n\n /**\n * Sets the x-coordinate value through the solver system.\n * @param value - The new x-coordinate value\n * @throws Will throw an error if value is not a valid number\n * @see {@link assertValidNumber}\n */\n public set x(value: number) {\n assertValidNumber(value, \"UIAnchor x\");\n this.solverWrapper.suggestVariableValue(this.xVariable, value);\n }\n\n /**\n * Sets the y-coordinate value through the solver system.\n * @param value - The new y-coordinate value\n * @throws Will throw an error if value is not a valid number\n * @see {@link assertValidNumber}\n */\n public set y(value: number) {\n assertValidNumber(value, \"UIAnchor y\");\n this.solverWrapper.suggestVariableValue(this.yVariable, value);\n }\n\n /**\n * Destroys the anchor by removing its solver variables.\n *\n * This method cleans up the solver variables associated with this anchor,\n * effectively removing it from the constraint solving system. After calling\n * this method, the anchor should not be used anymore.\n */\n public destroy(): void {\n this.solverWrapper.removeVariable(this.yVariable);\n this.solverWrapper.removeVariable(this.xVariable);\n }\n}\n","/**\n * Events that can be emitted by UI elements.\n */\nexport enum UIInputEvent {\n DOWN = \"pointerdown\",\n MOVE = \"pointermove\",\n UP = \"pointerup\",\n ENTER = \"pointerenter\",\n LEAVE = \"pointerleave\",\n}\n","/**\n * Defines the anchor mode for UIMicro, determining which transformations are applied around the anchor point.\n */\nexport enum UIMicroAnchorMode {\n /** Rotation and scaling are applied around the anchor point */\n ROTATION_SCALE = 0,\n /** Position, rotation, and scaling transformations are all applied around the anchor point */\n POSITION_ROTATION_SCALE = 1,\n}\n","import { Eventail } from \"eventail\";\nimport { MathUtils } from \"three\";\nimport { UIMicroAnchorMode } from \"./UIMicroAnchorMode\";\n\nexport enum UIMicroEvent {\n CHANGE = 0,\n}\n\n/** Default position value for x and y coordinates. */\nconst DEFAULT_POSITION = 0;\n/** Default anchor point value for anchorX and anchorY. */\nconst DEFAULT_ANCHOR = 0.5;\n/** Default scale value for scaleX and scaleY. */\nconst DEFAULT_SCALE = 1;\n/** Default rotation value in radians. */\nconst DEFAULT_ROTATION = 0;\n\n/**\n * Micro-transformation system for non-constraint based UI element adjustments.\n *\n * UIMicro provides a lightweight transformation system that operates independently\n * of the constraint solver. It manages position offsets, anchor points, scaling,\n * and rotation transformations that can be applied to UI elements for animations,\n * visual effects, or fine-tuned positioning without affecting the constraint-based\n * layout system.\n *\n * All transformations are tracked with change detection to optimize rendering\n * performance by only recalculating when properties have actually changed.\n *\n * @see {@link UIElement} - Elements that use micro transformations\n */\nexport class UIMicro extends Eventail {\n /** Internal storage for x-coordinate offset. */\n private xInternal: number = DEFAULT_POSITION;\n /** Internal storage for y-coordinate offset. */\n private yInternal: number = DEFAULT_POSITION;\n /** Internal storage for x-axis anchor point. */\n private anchorXInternal: number = DEFAULT_ANCHOR;\n /** Internal storage for y-axis anchor point. */\n private anchorYInternal: number = DEFAULT_ANCHOR;\n /** Internal storage for x-axis scale factor. */\n private scaleXInternal: number = DEFAULT_SCALE;\n /** Internal storage for y-axis scale factor. */\n private scaleYInternal: number = DEFAULT_SCALE;\n /** Internal storage for rotation in radians. */\n private rotationInternal: number = DEFAULT_ROTATION;\n /** Internal storage for anchor mode determining which transformations are applied around the anchor point. */\n private anchorModeInternal: UIMicroAnchorMode =\n UIMicroAnchorMode.ROTATION_SCALE;\n /** Flag indicating if any transformation properties have changed. */\n private recalculationRequired = false;\n\n /**\n * Gets the x-coordinate offset for micro positioning.\n * @returns The x-offset value\n */\n public get x(): number {\n return this.xInternal;\n }\n\n /**\n * Gets the y-coordinate offset for micro positioning.\n * @returns The y-offset value\n */\n public get y(): number {\n return this.yInternal;\n }\n\n /**\n * Gets the x-axis anchor point for transformations.\n * @returns The anchor point (0.0 = left, 0.5 = center, 1.0 = right)\n */\n public get anchorX(): number {\n return this.anchorXInternal;\n }\n\n /**\n * Gets the y-axis anchor point for transformations.\n * @returns The anchor point (0.0 = top, 0.5 = center, 1.0 = bottom)\n */\n public get anchorY(): number {\n return this.anchorYInternal;\n }\n\n /**\n * Gets the x-axis scale factor.\n * @returns The scale factor (1.0 = normal size)\n */\n public get scaleX(): number {\n return this.scaleXInternal;\n }\n\n /**\n * Gets the y-axis scale factor.\n * @returns The scale factor (1.0 = normal size)\n */\n public get scaleY(): number {\n return this.scaleYInternal;\n }\n\n /**\n * Gets the uniform scale factor (maximum of scaleX and scaleY).\n * @returns The larger of the two scale factors\n */\n public get size(): number {\n return Math.max(this.scaleXInternal, this.scaleYInternal);\n }\n\n /**\n * Gets the rotation angle in degrees.\n * @returns The rotation angle in degrees\n */\n public get angle(): number {\n return MathUtils.radToDeg(this.rotationInternal);\n }\n\n /**\n * Gets the current anchor mode determining which transformations are applied around the anchor point.\n * @returns The anchor mode (ROTATION_SCALE or POSITION_ROTATION_SCALE)\n */\n public get anchorMode(): UIMicroAnchorMode {\n return this.anchorModeInternal;\n }\n\n /**\n * Gets the rotation angle in radians.\n * @returns The rotation angle in radians\n */\n public get rotation(): number {\n return this.rotationInternal;\n }\n\n /**\n * Sets the x-coordinate offset for micro positioning.\n * @param value - The new x-offset value\n */\n public set x(value: number) {\n if (value !== this.xInternal) {\n this.xInternal = value;\n this.recalculationRequired = true;\n this.emit(UIMicroEvent.CHANGE, this);\n }\n }\n\n /**\n * Sets the y-coordinate offset for micro positioning.\n * @param value - The new y-offset value\n */\n public set y(value: number) {\n if (value !== this.yInternal) {\n this.yInternal = value;\n this.recalculationRequired = true;\n this.emit(UIMicroEvent.CHANGE, this);\n }\n }\n\n /**\n * Sets the x-axis anchor point for transformations.\n * @param value - The anchor point (0.0 = left, 0.5 = center, 1.0 = right)\n */\n public set anchorX(value: number) {\n if (value !== this.anchorXInternal) {\n this.anchorXInternal = value;\n this.recalculationRequired = true;\n this.emit(UIMicroEvent.CHANGE, this);\n }\n }\n\n /**\n * Sets the y-axis anchor point for transformations.\n * @param value - The anchor point (0.0 = top, 0.5 = center, 1.0 = bottom)\n */\n public set anchorY(value: number) {\n if (value !== this.anchorYInternal) {\n this.anchorYInternal = value;\n this.recalculationRequired = true;\n this.emit(UIMicroEvent.CHANGE, this);\n }\n }\n\n /**\n * Sets the x-axis scale factor.\n * @param value - The scale factor (1.0 = normal size)\n */\n public set scaleX(value: number) {\n if (value !== this.scaleXInternal) {\n this.scaleXInternal = value;\n this.recalculationRequired = true;\n this.emit(UIMicroEvent.CHANGE, this);\n }\n }\n\n /**\n * Sets the y-axis scale factor.\n * @param value - The scale factor (1.0 = normal size)\n */\n public set scaleY(value: number) {\n if (value !== this.scaleYInternal) {\n this.scaleYInternal = value;\n this.recalculationRequired = true;\n this.emit(UIMicroEvent.CHANGE, this);\n }\n }\n\n /**\n * Sets both scale factors to the same value for uniform scaling.\n * @param value - The uniform scale factor (1.0 = normal size)\n */\n public set size(value: number) {\n if (value !== this.scaleXInternal || value !== this.scaleYInternal) {\n this.scaleXInternal = value;\n this.scaleYInternal = value;\n this.recalculationRequired = true;\n this.emit(UIMicroEvent.CHANGE, this);\n }\n }\n\n /**\n * Sets the rotation angle in degrees.\n * @param value - The rotation angle in degrees\n */\n public set angle(value: number) {\n const rotation = MathUtils.degToRad(value);\n if (rotation !== this.rotationInternal) {\n this.rotationInternal = rotation;\n this.recalculationRequired = true;\n this.emit(UIMicroEvent.CHANGE, this);\n }\n }\n\n /**\n * Sets the rotation angle in radians.\n * @param value - The rotation angle in radians\n */\n public set rotation(value: number) {\n if (value !== this.rotationInternal) {\n this.rotationInternal = value;\n this.recalculationRequired = true;\n this.emit(UIMicroEvent.CHANGE, this);\n }\n }\n\n /**\n * Sets the anchor mode determining which transformations are applied around the anchor point.\n * @param value - The anchor mode (ROTATION_SCALE or POSITION_ROTATION_SCALE)\n */\n public set anchorMode(value: UIMicroAnchorMode) {\n if (value !== this.anchorModeInternal) {\n this.anchorModeInternal = value;\n this.recalculationRequired = true;\n this.emit(UIMicroEvent.CHANGE, this);\n }\n }\n\n /**\n * Resets all transformation properties to their default values.\n *\n * This method restores position (0,0), anchor (0,0), scale (1,1),\n * and rotation (0) to their initial states. Only triggers recalculation\n * if any values actually change.\n */\n public reset(): void {\n if (\n this.xInternal !== DEFAULT_POSITION ||\n this.yInternal !== DEFAULT_POSITION ||\n this.anchorXInternal !== DEFAULT_ANCHOR ||\n this.anchorYInternal !== DEFAULT_ANCHOR ||\n this.scaleXInternal !== DEFAULT_SCALE ||\n this.scaleYInternal !== DEFAULT_SCALE ||\n this.rotationInternal !== DEFAULT_ROTATION\n ) {\n this.xInternal = DEFAULT_POSITION;\n this.yInternal = DEFAULT_POSITION;\n this.anchorXInternal = DEFAULT_ANCHOR;\n this.anchorYInternal = DEFAULT_ANCHOR;\n this.scaleXInternal = DEFAULT_SCALE;\n this.scaleYInternal = DEFAULT_SCALE;\n this.rotationInternal = DEFAULT_ROTATION;\n this.recalculationRequired = true;\n this.emit(UIMicroEvent.CHANGE, this);\n }\n }\n\n public copy(value: UIMicro): void {\n if (\n this.xInternal !== value.xInternal &&\n this.yInternal !== value.yInternal &&\n this.anchorXInternal !== value.anchorXInternal &&\n this.anchorYInternal !== value.anchorYInternal &&\n this.scaleXInternal !== value.scaleXInternal &&\n this.scaleYInternal !== value.scaleYInternal &&\n this.rotationInternal !== value.rotationInternal &&\n this.anchorModeInternal !== value.anchorModeInternal\n ) {\n this.xInternal = value.xInternal;\n this.yInternal = value.yInternal;\n this.anchorXInternal = value.anchorXInternal;\n this.anchorYInternal = value.anchorYInternal;\n this.scaleXInternal = value.scaleXInternal;\n this.scaleYInternal = value.scaleYInternal;\n this.rotationInternal = value.rotationInternal;\n this.anchorModeInternal = value.anchorModeInternal;\n\n this.emit(UIMicroEvent.CHANGE, this);\n this.recalculationRequired = true;\n }\n }\n\n /**\n * Gets whether any transformation properties have changed since last reset.\n *\n * This method is used internally by the rendering system to determine\n * if transformation matrices need to be recalculated.\n *\n * @returns True if recalculation is required, false otherwise\n * @internal\n */\n protected [\"getRecalculationRequiredInternal\"](): boolean {\n return this.recalculationRequired;\n }\n\n /**\n * Resets the recalculation flag after transformations have been applied.\n *\n * This method is called internally by the rendering system after\n * transformation matrices have been updated.\n *\n * @internal\n */\n protected [\"resetRecalculationRequiredInternal\"](): void {\n this.recalculationRequired = false;\n }\n}\n","import type { WebGLRenderer } from \"three\";\nimport { Matrix4, Quaternion, Vector3 } from \"three\";\nimport type { UILayerInputListener } from \"../layers/UILayer\";\nimport { UILayerEvent, type UILayer } from \"../layers/UILayer\";\nimport type { UILayerElement, UIPlaneElement } from \"../miscellaneous/asserts\";\nimport {\n assertValidNumber,\n assertValidPositiveNumber,\n} from \"../miscellaneous/asserts\";\nimport { UIInputEvent } from \"../miscellaneous/UIInputEvent\";\nimport { UIMicro } from \"../miscellaneous/UIMicro\";\nimport { UIMicroAnchorMode } from \"../miscellaneous/UIMicroAnchorMode\";\nimport { UIMode } from \"../miscellaneous/UIMode\";\nimport { UIPriority } from \"../miscellaneous/UIPriority\";\nimport type { UISceneWrapperClientAPI } from \"../miscellaneous/UISceneWrapperClientAPI\";\nimport { UITransparencyMode } from \"../miscellaneous/UITransparencyMode\";\nimport { UIAnchor } from \"./UIAnchor\";\n\nconst position = new Vector3();\nconst quaternion = new Quaternion();\nconst scale = new Vector3();\nconst matrix = new Matrix4();\nconst axis = new Vector3(0, 0, 1);\n\n/**\n * Abstract base class for all renderable UI elements with dimensions.\n *\n * UIElement serves as the fundamental building block for all other UI elements\n * that need to be visually rendered. It extends UIAnchor with dimensional properties\n * and integrates with the Three.js rendering system through shader-based planes. This class\n * provides essential functionality for positioning, sizing, rendering, visibility,\n * z-index management, and user interaction.\n *\n * @see {@link UIAnchor} - Base class providing position functionality\n * @see {@link UIPlaneElement} - Interface defining dimensional element behavior\n * @see {@link UIMicro} - Micro-optimization utilities\n */\nexport abstract class UIElement\n extends UIAnchor\n implements UIPlaneElement, UILayerElement\n{\n /** Micro-transformation system for non-constraint based positioning, scaling, and rotation adjustments. */\n public readonly micro = new UIMicro();\n\n /**\n * Solver variable descriptor for the width dimension.\n * This variable is managed by the constraint solver system.\n */\n public readonly wVariable: number;\n\n /**\n * Solver variable descriptor for the height dimension.\n * This variable is managed by the constraint solver system.\n */\n public readonly hVariable: number;\n\n /** Internal storage for the current visibility/interaction mode. */\n protected modeInternal: UIMode = UIMode.VISIBLE;\n\n /** Internal storage for the transparency rendering mode. */\n protected transparencyInternal: UITransparencyMode = UITransparencyMode.BLEND;\n\n /** Internal storage for the z-index (depth) value. */\n protected zIndexInternal = 0;\n\n /** Optional input listener for handling user interactions when in interactive mode. */\n protected listener?: UILayerInputListener;\n\n protected isPointerInside = false;\n\n /** Client API for interacting with the scene wrapper (rendering system). */\n protected readonly sceneWrapper: UISceneWrapperClientAPI;\n /** Handle to the plane object in the rendering system. */\n protected readonly planeHandler: number;\n\n /**\n * Creates a new UIElement instance with rendering capabilities.\n *\n * @param layer - The UI layer that contains this element\n * @param x - Initial x-coordinate position\n * @param y - Initial y-coordinate position\n * @param width - Initial width dimension (must be positive)\n * @param height - Initial height dimension (must be positive)\n * @param source - GLSL shader source code for rendering this element\n * @param uniforms - Uniform values to pass to the shader\n * @throws Will throw an error if width or height are not valid positive numbers\n * @see {@link assertValidPositiveNumber}\n */\n constructor(\n layer: UILayer,\n x: number,\n y: number,\n width: number,\n height: number,\n source: string,\n uniforms: Record<string, unknown>,\n ) {\n assertValidPositiveNumber(width, \"UIElement width\");\n assertValidPositiveNumber(height, \"UIElement height\");\n\n super(layer, x, y);\n this.layer.on(UILayerEvent.WILL_RENDER, this.onWillRender, this);\n\n this.wVariable = this.solverWrapper.createVariable(width, UIPriority.P6);\n this.hVariable = this.solverWrapper.createVariable(height, UIPriority.P6);\n\n this.sceneWrapper = layer[\"getSceneWrapperClientAPI\"]();\n this.planeHandler = this.sceneWrapper.createPlane(source, uniforms);\n this.sceneWrapper.setTransparency(\n this.planeHandler,\n this.transparencyInternal,\n );\n }\n\n /**\n * Gets the current width value from the solver.\n * @returns The current width dimension\n */\n public get width(): number {\n return this.solverWrapper.readVariableValue(this.wVariable);\n }\n\n /**\n * Gets the current height value from the solver.\n * @returns The current height dimension\n */\n public get height(): number {\n return this.solverWrapper.readVariableValue(this.hVariable);\n }\n\n /**\n * Gets the current z-index (depth) value.\n * @returns The current z-index value\n */\n public get zIndex(): number {\n return this.zIndexInternal;\n }\n\n /**\n * The right edge X coordinate of this element (x + width).\n */\n public get oppositeX(): number {\n return this.x + this.width;\n }\n\n /**\n * The bottom edge Y coordinate of this element (y + height).\n */\n public get oppositeY(): number {\n return this.y + this.height;\n }\n\n /**\n * The X coordinate of the center of this element.\n */\n public get centerX(): number {\n return this.x + this.width / 2;\n }\n\n /**\n * The Y coordinate of the center of this element.\n */\n public get centerY(): number {\n return this.y + this.height / 2;\n }\n\n /**\n * Gets the current visibility and interaction mode.\n * @returns The current UIMode setting\n * @see {@link UIMode}\n */\n public get mode(): UIMode {\n return this.modeInternal;\n }\n\n /**\n * Gets the current transparency rendering mode.\n * @returns The current transparency mode\n * @see {@link UITransparencyMode}\n */\n public get transparency(): UITransparencyMode {\n return this.transparencyInternal;\n }\n\n /**\n * Sets the width value through the solver system.\n * @param value - The new width dimension (must be positive)\n * @throws Will throw an error if value is not a valid positive number\n * @see {@link assertValidPositiveNumber}\n */\n public set width(value: number) {\n assertValidPositiveNumber(value, \"UIElement width\");\n this.solverWrapper.suggestVariableValue(this.wVariable, value);\n }\n\n /**\n * Sets the height value through the solver system.\n * @param value - The new height dimension (must be positive)\n * @throws Will throw an error if value is not a valid positive number\n * @see {@link assertValidPositiveNumber}\n */\n public set height(value: number) {\n assertValidPositiveNumber(value, \"UIElement height\");\n this.solverWrapper.suggestVariableValue(this.hVariable, value);\n }\n\n /**\n * Sets the z-index (depth) value for rendering order and input handling.\n * @param value - The new z-index value\n * @throws Will throw an error if value is not a valid number\n * @see {@link assertValidNumber}\n */\n public set zIndex(value: number) {\n assertValidNumber(value, \"UIElement zIndex\");\n this.zIndexInternal = value;\n if (this.listener) {\n this.listener.zIndex = this.zIndexInternal;\n }\n }\n\n /**\n * The right edge X coordinate of this element (x + width).\n */\n public set oppositeX(value: number) {\n this.x = value - this.width;\n }\n\n /**\n * The bottom edge Y coordinate of this element (y + height).\n */\n public set oppositeY(value: number) {\n this.y = value - this.height;\n }\n\n /**\n * The X coordinate of the center of this element.\n */\n public set centerX(value: number) {\n this.x = value - this.width / 2;\n }\n\n /**\n * The Y coordinate of the center of this element.\n */\n public set centerY(value: number) {\n this.y = value - this.height / 2;\n }\n\n /**\n * Sets the current visibility and interaction mode.\n * @param value - The new UIMode setting\n * @see {@link UIMode}\n */\n public set mode(value: UIMode) {\n if (this.modeInternal !== value) {\n if (value === UIMode.INTERACTIVE) {\n this.listener = {\n catchPointerDown: this.catchPointerDown,\n catchPointerMove: this.catchPointerMove,\n catchPointerUp: this.catchPointerUp,\n zIndex: this.zIndexInternal,\n };\n this.layer[\"subscribePointerInput\"](this.listener);\n } else if (this.modeInternal === UIMode.INTERACTIVE && this.listener) {\n this.layer[\"unsubscribePointerInput\"](this.listener);\n this.listener = undefined;\n }\n\n this.modeInternal = value;\n this.sceneWrapper.setVisibility(\n this.planeHandler,\n value !== UIMode.HIDDEN,\n );\n }\n }\n\n /**\n * Sets the transparency rendering mode.\n * @param value - The new transparency mode\n * @see {@link UITransparencyMode}\n */\n public set transparency(value: UITransparencyMode) {\n this.transparencyInternal = value;\n this.sceneWrapper.setTransparency(this.planeHandler, value);\n }\n\n /**\n * Destroys the UI element by cleaning up all associated resources.\n *\n * This method removes the element from the rendering scene, cleans up\n * dimension solver variables, removes input listeners, and calls the parent\n * destroy method to clean up position variables. After calling this method,\n * the element should not be used anymore.\n */\n public override destroy(): void {\n this.layer.off(UILayerEvent.WILL_RENDER, this.onWillRender, this);\n if (this.listener) {\n this.layer[\"unsubscribePointerInput\"](this.listener);\n }\n this.solverWrapper.removeVariable(this.hVariable);\n this.solverWrapper.removeVariable(this.wVariable);\n this.sceneWrapper.destroyPlane(this.planeHandler);\n super.destroy();\n }\n\n protected readonly catchPointerDown = (\n x: number,\n y: number,\n identifier: number,\n ): boolean => {\n return this.handleInputEvent(x, y, identifier, UIInputEvent.DOWN);\n };\n\n protected readonly catchPointerMove = (\n x: number,\n y: number,\n identifier: number,\n ): boolean => {\n return this.handleInputEvent(x, y, identifier, UIInputEvent.MOVE);\n };\n\n protected readonly catchPointerUp = (\n x: number,\n y: number,\n identifier: number,\n ): boolean => {\n return this.handleInputEvent(x, y, identifier, UIInputEvent.UP);\n };\n\n protected handleInputEvent(\n x: number,\n y: number,\n identifier: number,\n inputEvent: UIInputEvent,\n ): boolean {\n const isPointerInside =\n x > this.x && x < this.oppositeX && y > this.y && y < this.oppositeY;\n\n if (isPointerInside) {\n this.emit(inputEvent, x, y, identifier, this);\n }\n\n if (this.isPointerInside && !isPointerInside) {\n this.emit(UIInputEvent.LEAVE, x, y, identifier, this);\n } else if (!this.isPointerInside && isPointerInside) {\n this.emit(UIInputEvent.ENTER, x, y, identifier, this);\n }\n\n this.isPointerInside = isPointerInside;\n return isPointerInside;\n }\n\n /**\n * Called before each render frame to update the element's transform matrix.\n * Applies micro-transformations (position, rotation, scale, anchor) and updates\n * the rendering system with the final transformation matrix.\n * @param renderer - The WebGL renderer (unused in base implementation)\n * @param deltaTime - Time since last frame in seconds (unused in base implementation)\n */\n protected onWillRender(\n // eslint-disable-next-line @typescript-eslint/no-unused-vars -- Required by UILayer event interface but not used in base implementation\n renderer: WebGLRenderer,\n // eslint-disable-next-line @typescript-eslint/no-unused-vars -- Required by UILayer event interface but not used in base implementation\n deltaTime: number,\n ): void {\n const micro = this.micro;\n\n const width = this.width * micro.scaleX;\n const height = this.height * micro.scaleY;\n\n const anchorOffsetX = micro.anchorX * width;\n const anchorOffsetY = micro.anchorY * height;\n\n const cos = Math.cos(micro.rotation);\n const sin = Math.sin(micro.rotation);\n\n const rotatedAnchorX = anchorOffsetX * cos - anchorOffsetY * sin;\n const rotatedAnchorY = anchorOffsetX * sin + anchorOffsetY * cos;\n\n if (micro.anchorMode === UIMicroAnchorMode.POSITION_ROTATION_SCALE) {\n position.x = this.x + micro.x - rotatedAnchorX;\n position.y = this.y + micro.y - rotatedAnchorY;\n } else {\n const rawAnchorOffsetX = micro.anchorX * this.width;\n const rawAnchorOffsetY = micro.anchorY * this.height;\n position.x = this.x + rawAnchorOffsetX - rotatedAnchorX + micro.x;\n position.y = this.y + rawAnchorOffsetY - rotatedAnchorY + micro.y;\n }\n\n position.z = this.zIndexInternal;\n scale.x = width;\n scale.y = height;\n quaternion.setFromAxisAngle(axis, micro.rotation);\n\n matrix.compose(position, quaternion, scale);\n this.sceneWrapper.setTransform(this.planeHandler, matrix);\n }\n}\n","import type { Matrix3, Texture } from \"three\";\nimport type { UILayer } from \"../layers/UILayer\";\nimport { UIColor, UIColorEvent } from \"../miscellaneous/UIColor\";\nimport source from \"../shaders/UIDefaultShader.glsl\";\nimport { UIElement } from \"./UIElement\";\n\nexport enum UIAnimatedImageEvent {\n PLAY = 0,\n PAUSE = 1,\n STOP = 2,\n}\n\nexport type UIAnimatedImageSequence =\n | { texture: Texture; transforms: Matrix3[] }\n | Texture[];\n\n/**\n * Configuration options for creating a UIAnimatedImage element.\n */\nexport interface UIAnimatedImageOptions {\n /** X position of the element */\n x: number;\n /** Y position of the element */\n y: number;\n /** Width of the element */\n width: number;\n /** Height of the element */\n height: number;\n /** Color tint applied to the image */\n color: UIColor;\n /** Frame rate for animation */\n frameRate: number;\n /** Whether animation should loop */\n loop: boolean;\n}\n\n/**\n * UI element for displaying textured images.\n *\n * UIAnimatedImage is a concrete implementation of UIElement that renders a textured\n * image using shader-based planes. It automatically sizes itself\n * to match the texture dimensions and provides control over visual properties\n * such as color tinting.\n *\n * @see {@link UIElement} - Base class providing UI element functionality\n * @see {@link Texture} - Three.js texture for image data\n */\nexport class UIAnimatedImage extends UIElement {\n /** Internal storage for the current texture */\n private readonly sequenceInternal: {\n texture: Texture;\n uvTransform: Matrix3;\n }[];\n\n /** Internal storage for the color tint */\n private readonly colorInternal: UIColor;\n private frameRateInternal: number;\n private loopInternal: boolean;\n\n private intervalHandler?: ReturnType<typeof setInterval> = undefined;\n private currentFrameIndex = 0;\n\n /**\n * Creates a new UIAnimatedImage instance.\n *\n * The image will automatically size itself to match the texture's dimensions.\n * All options have default values if not specified.\n *\n * @param layer - The UI layer that contains this image\n * @param texture - The Three.js texture to display\n * @param options - Configuration options for the image\n * @throws Will throw an error if the texture dimensions are not valid positive numbers\n */\n constructor(\n layer: UILayer,\n sequence: UIAnimatedImageSequence,\n options: Partial<UIAnimatedImageOptions> = {},\n ) {\n const w = options.width ?? 100;\n const h = options.height ?? 100;\n const color = options.color ?? new UIColor();\n\n let tempSequence: {\n texture: Texture;\n uvTransform: Matrix3;\n }[];\n\n if (Array.isArray(sequence)) {\n tempSequence = sequence.map((texture) => {\n texture.updateMatrix();\n return {\n texture,\n uvTransform: texture.matrix,\n };\n });\n } else {\n tempSequence = sequence.transforms.map((transform) => {\n return {\n texture: sequence.texture,\n uvTransform: transform,\n };\n });\n }\n\n super(layer, options.x ?? 0, options.y ?? 0, w, h, source, {\n map: tempSequence[0].texture,\n uvTransform: tempSequence[0].uvTransform,\n color,\n });\n\n this.sequenceInternal = tempSequence;\n this.colorInternal = color;\n const defaultFrameRate = 24;\n this.frameRateInternal = options.frameRate ?? defaultFrameRate;\n this.loopInternal = options.loop ?? true;\n this.colorInternal.on(UIColorEvent.CHANGE, this.onColorChange);\n }\n\n /**\n * Gets the current color tint applied to the image.\n * @returns The UIColor instance\n */\n public get color(): UIColor {\n return this.colorInternal;\n }\n\n /**\n * Gets the frame rate for animation.\n * @returns The frame rate in frames per second\n */\n public get frameRate(): number {\n return this.frameRateInternal;\n }\n\n /**\n * Gets whether the animation loops.\n * @returns True if animation loops\n */\n public get loop(): boolean {\n return this.loopInternal;\n }\n\n /**\n * Gets the total duration of the animation in seconds.\n * @returns The duration in seconds\n */\n public get duration(): number {\n return this.sequenceInternal.length / this.frameRateInternal;\n }\n\n /**\n * Sets the color tint applied to the image.\n * @param value - The UIColor instance\n */\n public set color(value: UIColor) {\n this.colorInternal.copy(value);\n }\n\n /**\n * Sets the frame rate for animation.\n * @param value - The frame rate in frames per second\n */\n public set frameRate(value: number) {\n if (value <= 0) {\n throw new Error(\"Frame rate must be greater than zero\");\n }\n\n const wasPlaying = this.intervalHandler !== undefined;\n if (wasPlaying) {\n this.pause();\n }\n\n this.frameRateInternal = value;\n\n if (wasPlaying) {\n this.play();\n }\n }\n\n /**\n * Sets whether the animation loops.\n * @param value - True to enable looping\n */\n public set loop(value: boolean) {\n this.loopInternal = value;\n }\n\n /**\n * Starts or resumes playback of the animation.\n */\n public play(): void {\n if (this.intervalHandler !== undefined) {\n return;\n }\n\n this.intervalHandler = setInterval(() => {\n this.currentFrameIndex++;\n\n if (this.loopInternal) {\n this.currentFrameIndex %= this.sequenceInternal.length;\n } else if (this.currentFrameIndex >= this.sequenceInternal.length) {\n this.currentFrameIndex = this.sequenceInternal.length - 1;\n this.pause();\n return;\n }\n\n this.updateFrame();\n }, 1000 / this.frameRateInternal);\n this.emit(UIAnimatedImageEvent.PLAY);\n }\n\n /**\n * Pauses the animation at the current frame.\n */\n public pause(): void {\n if (this.intervalHandler === undefined) {\n return;\n }\n\n clearInterval(this.intervalHandler);\n this.intervalHandler = undefined;\n this.emit(UIAnimatedImageEvent.PAUSE);\n }\n\n /**\n * Stops the animation and resets to the first frame.\n */\n public stop(): void {\n if (this.intervalHandler !== undefined) {\n clearInterval(this.intervalHandler);\n this.intervalHandler = undefined;\n }\n\n this.currentFrameIndex = 0;\n this.updateFrame();\n this.emit(UIAnimatedImageEvent.STOP);\n }\n\n /**\n * Destroys the UI image by cleaning up color event listeners and all associated resources.\n */\n public override destroy(): void {\n this.stop();\n this.colorInternal.off(UIColorEvent.CHANGE, this.onColorChange);\n super.destroy();\n }\n\n /** Event handler for when the color changes */\n private readonly onColorChange = (color: UIColor): void => {\n this.sceneWrapper.setUniform(this.planeHandler, \"color\", color);\n };\n\n private updateFrame(): void {\n const frame = this.sequenceInternal[this.currentFrameIndex];\n this.sceneWrapper.setUniform(this.planeHandler, \"map\", frame.texture);\n this.sceneWrapper.setUniform(\n this.planeHandler,\n \"uvTransform\",\n frame.uvTransform,\n );\n }\n}\n","import type { UILayer } from \"../layers/UILayer\";\nimport {\n assertValidPositiveNumber,\n type UIPlaneElement,\n} from \"../miscellaneous/asserts\";\nimport { UIPriority } from \"../miscellaneous/UIPriority\";\nimport { UIAnchor } from \"./UIAnchor\";\n\n/** Default width and height value for UIDummy elements. */\nconst DEFAULT_SIZE = 100;\n\nexport interface UIDummyOptions {\n x: number;\n y: number;\n width: number;\n height: number;\n}\n\n/**\n * UI element that extends UIAnchor with dimensions but without rendering.\n *\n * UIDummy represents a rectangular area in the UI layout system that has position\n * and dimensions (width and height) but does not perform any visual rendering.\n * It serves as a placeholder or spacer element in constraint-based layouts,\n * useful for defining layout structure without visual content.\n *\n * @see {@link UIAnchor} - Base class providing position functionality\n * @see {@link UIPlaneElement} - Interface defining dimensional element behavior\n * @see {@link UILayer} - Container layer for UI elements\n */\nexport class UIDummy extends UIAnchor implements UIPlaneElement {\n /**\n * Solver variable descriptor for the width dimension.\n * This variable is managed by the constraint solver system.\n */\n public readonly wVariable: number;\n\n /**\n * Solver variable descriptor for the height dimension.\n * This variable is managed by the constraint solver system.\n */\n public readonly hVariable: number;\n\n /**\n * Creates a new UIDummy instance with position and dimensions.\n *\n * @param layer - The UI layer that contains this dummy element\n * @param x - Initial x-coordinate position\n * @param y - Initial y-coordinate position\n * @param width - Initial width dimension (defaults to 100)\n * @param height - Initial height dimension (defaults to 100)\n * @throws Will throw an error if width or height are not valid positive numbers\n * @see {@link assertValidPositiveNumber}\n */\n constructor(layer: UILayer, options: Partial<UIDummyOptions> = {}) {\n const x = options.x ?? 0;\n const y = options.y ?? 0;\n const w = options.width ?? DEFAULT_SIZE;\n const h = options.height ?? DEFAULT_SIZE;\n\n assertValidPositiveNumber(w, \"UIDummy width\");\n assertValidPositiveNumber(h, \"UIDummy height\");\n\n super(layer, x, y);\n this.wVariable = this.solverWrapper.createVariable(w, UIPriority.P6);\n this.hVariable = this.solverWrapper.createVariable(h, UIPriority.P6);\n }\n\n /**\n * Gets the current width value from the solver.\n * @returns The current width dimension\n */\n public get width(): number {\n return this.solverWrapper.readVariableValue(this.wVariable);\n }\n\n /**\n * Gets the current height value from the solver.\n * @returns The current height dimension\n */\n public get height(): number {\n return this.solverWrapper.readVariableValue(this.hVariable);\n }\n\n /**\n * Sets the width value through the solver system.\n * @param value - The new width dimension (must be positive)\n * @throws Will throw an error if value is not a valid positive number\n * @see {@link assertValidPositiveNumber}\n */\n public set width(value: number) {\n assertValidPositiveNumber(value, \"UIDummy width\");\n this.solverWrapper.suggestVariableValue(this.wVariable, value);\n }\n\n /**\n * Sets the height value through the solver system.\n * @param value - The new height dimension (must be positive)\n * @throws Will throw an error if value is not a valid positive number\n * @see {@link assertValidPositiveNumber}\n */\n public set height(value: number) {\n assertValidPositiveNumber(value, \"UIDummy height\");\n this.solverWrapper.suggestVariableValue(this.hVariable, value);\n }\n\n /**\n * Destroys the dummy element by removing its solver variables.\n *\n * This method cleans up the dimension solver variables (width and height)\n * associated with this dummy element, then calls the parent destroy method\n * to clean up position variables. After calling this method, the dummy\n * element should not be used anymore.\n */\n public override destroy(): void {\n this.solverWrapper.removeVariable(this.hVariable);\n this.solverWrapper.removeVariable(this.wVariable);\n super.destroy();\n }\n}\n","import { CanvasTexture, LinearFilter } from \"three\";\nimport type { UILayer } from \"../layers/UILayer\";\nimport { UIColor, UIColorEvent } from \"../miscellaneous/UIColor\";\nimport type { UIMode } from \"../miscellaneous/UIMode\";\nimport source from \"../shaders/UIDefaultShader.glsl\";\nimport { UIElement } from \"./UIElement\";\n\n/**\n * Configuration options for creating a UIGraphics element.\n */\nexport interface UIGraphicsOptions {\n /** X position of the element */\n x: number;\n /** Y position of the element */\n y: number;\n /** Width of the canvas (default: 512) */\n width: number;\n /** Height of the canvas (default: 512) */\n height: number;\n /** Color tint applied to the graphics */\n color: UIColor;\n /** Default UIMode */\n mode: UIMode;\n}\n\n/**\n * UI element for drawing graphics using 2D canvas API.\n *\n * UIGraphics uses an OffscreenCanvas for rendering 2D graphics and converts it\n * to a Three.js texture for display. It provides access to the canvas context\n * for custom drawing operations.\n */\nexport class UIGraphics extends UIElement {\n /** OffscreenCanvas for rendering graphics */\n private readonly canvas: OffscreenCanvas;\n /** 2D rendering context */\n private readonly ctx: OffscreenCanvasRenderingContext2D;\n /** Three.js texture created from the canvas */\n private readonly canvasTexture: CanvasTexture;\n /** Internal storage for the color tint */\n private readonly colorInternal: UIColor;\n\n /**\n * Creates a new UIGraphics instance.\n *\n * @param layer - The UI layer that contains this graphics element\n * @param options - Configuration options for the graphics element\n */\n constructor(layer: UILayer, options: Partial<UIGraphicsOptions> = {}) {\n const defaultCanvasSize = 512;\n const width = options.width ?? defaultCanvasSize;\n const height = options.height ?? defaultCanvasSize;\n const color = options.color ?? new UIColor();\n\n // Create OffscreenCanvas\n const canvas = new OffscreenCanvas(width, height);\n const ctx = canvas.getContext(\"2d\");\n\n if (!ctx) {\n throw new Error(\"Failed to get 2D context from OffscreenCanvas\");\n }\n\n // Create texture from canvas\n const canvasTexture = new CanvasTexture(canvas);\n canvasTexture.minFilter = LinearFilter;\n canvasTexture.magFilter = LinearFilter;\n\n super(layer, options.x ?? 0, options.y ?? 0, width, height, source, {\n map: canvasTexture,\n uvTransform: canvasTexture.matrix,\n color,\n });\n\n this.canvas = canvas;\n this.ctx = ctx;\n this.canvasTexture = canvasTexture;\n this.colorInternal = color;\n this.colorInternal.on(UIColorEvent.CHANGE, this.onColorChange);\n\n if (options.mode !== undefined) {\n this.mode = options.mode;\n }\n }\n\n /**\n * Gets the current color tint applied to the graphics.\n */\n public get color(): UIColor {\n return this.colorInternal;\n }\n\n /**\n * Sets the color tint applied to the graphics.\n */\n public set color(value: UIColor) {\n this.colorInternal.copy(value);\n }\n\n /**\n * Clears the canvas with optional fill color.\n *\n * @param fillColor - Optional color to fill after clearing\n */\n public clear(fillColor?: UIColor): this {\n this.ctx.clearRect(0, 0, this.canvas.width, this.canvas.height);\n if (fillColor !== undefined) {\n this.ctx.fillStyle = fillColor.toCSSColor();\n this.ctx.fillRect(0, 0, this.canvas.width, this.canvas.height);\n }\n this.canvasTexture.needsUpdate = true;\n return this;\n }\n\n /**\n * Draws a rectangle on the canvas.\n */\n public rect(x: number, y: number, width: number, height: number): this {\n this.ctx.rect(x, y, width, height);\n this.canvasTexture.needsUpdate = true;\n return this;\n }\n\n /**\n * Draws a filled rectangle on the canvas.\n */\n public fillRect(x: number, y: number, width: number, height: number): this {\n this.ctx.fillRect(x, y, width, height);\n this.canvasTexture.needsUpdate = true;\n return this;\n }\n\n /**\n * Draws a stroked rectangle on the canvas.\n */\n public strokeRect(x: number, y: number, width: number, height: number): this {\n this.ctx.strokeRect(x, y, width, height);\n this.canvasTexture.needsUpdate = true;\n return this;\n }\n\n /**\n * Draws a circle on the canvas.\n */\n public circle(x: number, y: number, radius: number): this {\n this.ctx.beginPath();\n this.ctx.arc(x, y, radius, 0, Math.PI * 2);\n this.ctx.closePath();\n this.canvasTexture.needsUpdate = true;\n return this;\n }\n\n /**\n * Begins a new path.\n */\n public beginPath(): this {\n this.ctx.beginPath();\n this.canvasTexture.needsUpdate = true;\n return this;\n }\n\n /**\n * Closes the current path.\n */\n public closePath(): this {\n this.ctx.closePath();\n this.canvasTexture.needsUpdate = true;\n return this;\n }\n\n /**\n * Fills the current path.\n */\n public fill(): this {\n this.ctx.fill();\n this.canvasTexture.needsUpdate = true;\n return this;\n }\n\n /**\n * Strokes the current path.\n */\n public stroke(): this {\n this.ctx.stroke();\n this.canvasTexture.needsUpdate = true;\n return this;\n }\n\n /**\n * Moves the path to a point.\n */\n public moveTo(x: number, y: number): this {\n this.ctx.moveTo(x, y);\n return this;\n }\n\n /**\n * Draws a line to a point.\n */\n public lineTo(x: number, y: number): this {\n this.ctx.lineTo(x, y);\n this.canvasTexture.needsUpdate = true;\n return this;\n }\n\n /**\n * Sets the fill style.\n */\n public setFillStyle(style: UIColor | CanvasGradient | CanvasPattern): this {\n this.ctx.fillStyle = style instanceof UIColor ? style.toCSSColor() : style;\n return this;\n }\n\n /**\n * Sets the stroke style.\n */\n public setStrokeStyle(style: UIColor | CanvasGradient | CanvasPattern): this {\n this.ctx.strokeStyle =\n style instanceof UIColor ? style.toCSSColor() : style;\n return this;\n }\n\n /**\n * Sets the line width.\n */\n public setLineWidth(width: number): this {\n this.ctx.lineWidth = width;\n return this;\n }\n\n /**\n * Destroys the graphics element by cleaning up resources.\n */\n public override destroy(): void {\n this.colorInternal.off(UIColorEvent.CHANGE, this.onColorChange);\n this.canvasTexture.dispose();\n super.destroy();\n }\n\n /** Event handler for when the color changes */\n private readonly onColorChange = (color: UIColor): void => {\n this.sceneWrapper.setUniform(this.planeHandler, \"color\", color);\n };\n}\n","import type { Texture } from \"three\";\nimport type { UILayer } from \"../layers/UILayer\";\nimport { assertValidPositiveNumber } from \"../miscellaneous/asserts\";\nimport { UIColor, UIColorEvent } from \"../miscellaneous/UIColor\";\nimport type { UIMode } from \"../miscellaneous/UIMode\";\nimport source from \"../shaders/UIDefaultShader.glsl\";\nimport { UIElement } from \"./UIElement\";\n\n/**\n * Configuration options for creating a UIImage element.\n */\nexport interface UIImageOptions {\n /** X position of the element */\n x: number;\n /** Y position of the element */\n y: number;\n /** Width of the element */\n width: number;\n /** Height of the element */\n height: number;\n /** Color tint applied to the image */\n color: UIColor;\n /** Default UIMode */\n mode: UIMode;\n}\n\n/**\n * UI element for displaying textured images.\n *\n * UIImage is a concrete implementation of UIElement that renders a textured\n * image using shader-based planes. It automatically sizes itself\n * to match the texture dimensions and provides control over visual properties\n * such as color tinting.\n *\n * @see {@link UIElement} - Base class providing UI element functionality\n * @see {@link Texture} - Three.js texture for image data\n */\nexport class UIImage extends UIElement {\n /** Internal storage for the current texture */\n private textureInternal: Texture;\n /** Internal storage for the color tint */\n private readonly colorInternal: UIColor;\n\n /**\n * Creates a new UIImage instance.\n *\n * The image will automatically size itself to match the texture's dimensions.\n * All options have default values if not specified.\n *\n * @param layer - The UI layer that contains this image\n * @param texture - The Three.js texture to display\n * @param options - Configuration options for the image\n * @throws Will throw an error if the texture dimensions are not valid positive numbers\n */\n constructor(\n layer: UILayer,\n texture: Texture,\n options: Partial<UIImageOptions> = {},\n ) {\n const w = options.width ?? texture.image.width;\n const h = options.height ?? texture.image.height;\n\n const color = options.color ?? new UIColor();\n\n super(layer, options.x ?? 0, options.y ?? 0, w, h, source, {\n map: texture,\n uvTransform: texture.matrix,\n color,\n });\n\n this.textureInternal = texture;\n this.colorInternal = color;\n this.colorInternal.on(UIColorEvent.CHANGE, this.onColorChange);\n\n if (options.mode !== undefined) {\n this.mode = options.mode;\n }\n }\n\n /**\n * Gets the current texture being displayed.\n * @returns The current Three.js texture\n */\n public get texture(): Texture {\n return this.textureInternal;\n }\n\n /**\n * Gets the current color tint applied to the image.\n * @returns The UIColor instance\n */\n public get color(): UIColor {\n return this.colorInternal;\n }\n\n /**\n * Sets a new texture for the image.\n *\n * When setting a new texture, the image will automatically resize to match\n * the new texture's dimensions.\n *\n * @param value - The new Three.js texture to display\n * @throws Will throw an error if the texture dimensions are not valid positive numbers\n * @see {@link assertValidPositiveNumber}\n */\n public set texture(value: Texture) {\n const w = value.image.width;\n const h = value.image.height;\n\n assertValidPositiveNumber(w, \"UIImage texture width\");\n assertValidPositiveNumber(h, \"UIImage texture height\");\n\n this.solverWrapper.suggestVariableValue(this.wVariable, w);\n this.solverWrapper.suggestVariableValue(this.hVariable, h);\n\n this.textureInternal = value;\n this.sceneWrapper.setUniform(this.planeHandler, \"map\", value);\n this.sceneWrapper.setUniform(\n this.planeHandler,\n \"uvTransform\",\n value.matrix,\n );\n }\n\n /**\n * Sets the color tint applied to the image.\n * @param value - The UIColor instance\n */\n public set color(value: UIColor) {\n this.colorInternal.copy(value);\n }\n\n /**\n * Destroys the UI image by cleaning up color event listeners and all associated resources.\n */\n public override destroy(): void {\n this.colorInternal.off(UIColorEvent.CHANGE, this.onColorChange);\n super.destroy();\n }\n\n /** Event handler for when the color changes */\n private readonly onColorChange = (color: UIColor): void => {\n this.sceneWrapper.setUniform(this.planeHandler, \"color\", color);\n };\n}\n","const DEFAULT_SLICE_BORDER = 0.25;\n\nexport type UINineSliceBorders =\n | { left: number; right: number; top: number; bottom: number }\n | { horizontal: number; vertical: number }\n | number;\n\n/**\n * Resolves various nine-slice border inputs into a normalized border object.\n *\n * @param value - The border value to resolve (can be number, partial object, or full object)\n * @returns Normalized border object with left, right, top, bottom properties\n */\nexport function resolveNineSliceBorders(value: unknown): {\n l: number;\n r: number;\n t: number;\n b: number;\n} {\n // Handle null/undefined\n if (value === null || value === undefined) {\n return {\n l: DEFAULT_SLICE_BORDER,\n r: DEFAULT_SLICE_BORDER,\n t: DEFAULT_SLICE_BORDER,\n b: DEFAULT_SLICE_BORDER,\n };\n }\n\n // Handle number\n if (typeof value === \"number\") {\n return {\n l: value,\n r: value,\n t: value,\n b: value,\n };\n }\n\n // Handle object\n if (typeof value === \"object\") {\n const obj = value as Record<string, unknown>;\n\n // Handle { horizontal, vertical } format\n if (\"horizontal\" in obj && \"vertical\" in obj) {\n const horizontal =\n typeof obj.horizontal === \"number\"\n ? obj.horizontal\n : DEFAULT_SLICE_BORDER;\n const vertical =\n typeof obj.vertical === \"number\" ? obj.vertical : DEFAULT_SLICE_BORDER;\n\n return {\n l: horizontal,\n r: horizontal,\n t: vertical,\n b: vertical,\n };\n }\n\n // Handle { left, right, top, bottom } format\n const left = typeof obj.left === \"number\" ? obj.left : DEFAULT_SLICE_BORDER;\n const right =\n typeof obj.right === \"number\" ? obj.right : DEFAULT_SLICE_BORDER;\n const top = typeof obj.top === \"number\" ? obj.top : DEFAULT_SLICE_BORDER;\n const bottom =\n typeof obj.bottom === \"number\" ? obj.bottom : DEFAULT_SLICE_BORDER;\n\n return { l: left, r: right, t: top, b: bottom };\n }\n\n // Fallback to default\n return {\n l: DEFAULT_SLICE_BORDER,\n r: DEFAULT_SLICE_BORDER,\n t: DEFAULT_SLICE_BORDER,\n b: DEFAULT_SLICE_BORDER,\n };\n}\n","import type { Texture, WebGLRenderer } from \"three\";\nimport { Vector4 } from \"three\";\nimport { type UILayer } from \"../layers/UILayer\";\nimport { assertValidPositiveNumber } from \"../miscellaneous/asserts\";\nimport { UIColor, UIColorEvent } from \"../miscellaneous/UIColor\";\nimport type { UIMode } from \"../miscellaneous/UIMode\";\nimport {\n resolveNineSliceBorders,\n type UINineSliceBorders,\n} from \"../miscellaneous/UINineSliceBorder\";\nimport source from \"../shaders/UINineSliceShader.glsl\";\nimport { UIElement } from \"./UIElement\";\n\n/**\n * Configuration options for creating a UINineSlice element.\n */\nexport interface UINineSliceOptions {\n /** X position of the element */\n x: number;\n /** Y position of the element */\n y: number;\n /** Color tint applied to the nine-slice element */\n color: UIColor;\n /** Nine-slice border configuration (can be number, object with horizontal/vertical, or full border object) */\n sliceBorders: UINineSliceBorders;\n /** Default UIMode */\n mode: UIMode;\n}\n\n/**\n * Nine-slice UI element for scalable images with preserved border regions.\n *\n * Nine-slice scaling divides an image into 9 regions: 4 corners, 4 edges, and 1 center.\n * The corners maintain their original size, edges scale in one dimension, and the center\n * scales in both dimensions. This technique is commonly used for creating scalable UI\n * panels, buttons, and borders that maintain visual quality at any size.\n */\nexport class UINineSlice extends UIElement {\n /** Internal storage for the current texture */\n private readonly textureInternal: Texture;\n /** Internal storage for the color tint */\n private readonly colorInternal: UIColor;\n /** Internal storage for the nine-slice border values (left, right, top, bottom) */\n private readonly sliceBordersInternal: Vector4;\n /** Internal storage for texture and world dimensions (texture width, texture height, world width, world height) */\n private readonly dimensions: Vector4;\n\n /**\n * Creates a new nine-slice UI element.\n *\n * The element initially sizes itself to match the texture's dimensions.\n * Border regions are defined by the slice borders configuration.\n *\n * @param layer - The UI layer to add this element to\n * @param texture - The texture to use for nine-slice rendering\n * @param options - Configuration options for the nine-slice element\n * @throws Will throw an error if the texture dimensions are not valid positive numbers\n */\n constructor(\n layer: UILayer,\n texture: Texture,\n options: Partial<UINineSliceOptions> = {},\n ) {\n const width = texture.image.width;\n const height = texture.image.height;\n\n const color = options.color ?? new UIColor();\n const resolvedSliceBorders = resolveNineSliceBorders(options.sliceBorders);\n const sliceBorders = new Vector4(\n resolvedSliceBorders.l,\n resolvedSliceBorders.r,\n resolvedSliceBorders.t,\n resolvedSliceBorders.b,\n );\n const dimensions = new Vector4(width, height, width, height);\n\n super(layer, options.x ?? 0, options.y ?? 0, width, height, source, {\n map: texture,\n color,\n sliceBorders,\n dimensions,\n });\n\n this.textureInternal = texture;\n this.sliceBordersInternal = sliceBorders;\n this.dimensions = dimensions;\n\n this.colorInternal = color;\n this.colorInternal.on(UIColorEvent.CHANGE, this.onColorChange);\n\n if (options.mode !== undefined) {\n this.mode = options.mode;\n }\n }\n\n /**\n * Gets the current texture being displayed.\n * @returns The current Three.js texture\n */\n public get texture(): Texture {\n return this.textureInternal;\n }\n\n /**\n * Gets the current color tint applied to the nine-slice element.\n * @returns The UIColor instance\n */\n public get color(): UIColor {\n return this.colorInternal;\n }\n\n /**\n * Gets the left border size for nine-slice scaling.\n * @returns The left border size as a percentage (0-1) of texture width\n */\n public get sliceBorderLeft(): number {\n return this.sliceBordersInternal.x;\n }\n\n /**\n * Gets the right border size for nine-slice scaling.\n * @returns The right border size as a percentage (0-1) of texture width\n */\n public get sliceBorderRight(): number {\n return this.sliceBordersInternal.y;\n }\n\n /**\n * Gets the top border size for nine-slice scaling.\n * @returns The top border size as a percentage (0-1) of texture height\n */\n public get sliceBorderTop(): number {\n return this.sliceBordersInternal.z;\n }\n\n /**\n * Gets the bottom border size for nine-slice scaling.\n * @returns The bottom border size as a percentage (0-1) of texture height\n */\n public get sliceBorderBottom(): number {\n return this.sliceBordersInternal.w;\n }\n\n /**\n * Sets a new texture for the nine-slice element.\n *\n * When setting a new texture, the element will update its internal dimensions\n * but maintain the current world size. The nine-slice borders remain unchanged.\n *\n * @param value - The new Three.js texture to display\n * @throws Will throw an error if the texture dimensions are not valid positive numbers\n * @see {@link assertValidPositiveNumber}\n */\n public set texture(value: Texture) {\n const w = value.image.width;\n const h = value.image.height;\n\n assertValidPositiveNumber(w, \"UINineSlice texture width\");\n assertValidPositiveNumber(h, \"UINineSlice texture height\");\n\n this.solverWrapper.suggestVariableValue(this.wVariable, w);\n this.solverWrapper.suggestVariableValue(this.hVariable, h);\n\n this.dimensions.x = w;\n this.dimensions.y = h;\n this.sceneWrapper.setUniform(\n this.planeHandler,\n \"dimensions\",\n this.dimensions,\n );\n this.sceneWrapper.setUniform(this.planeHandler, \"map\", value);\n }\n\n /**\n * Sets the color tint applied to the nine-slice element.\n * @param value - The UIColor instance\n */\n public set color(value: UIColor) {\n this.colorInternal.copy(value);\n }\n\n /**\n * Sets the left border size for nine-slice scaling.\n * @param value - The left border size as a percentage (0-1) of texture width\n */\n public set sliceBorderLeft(value: number) {\n this.sliceBordersInternal.x = value;\n this.sceneWrapper.setUniform(\n this.planeHandler,\n \"sliceBorders\",\n this.sliceBordersInternal,\n );\n }\n\n /**\n * Sets the right border size for nine-slice scaling.\n * @param value - The right border size as a percentage (0-1) of texture width\n */\n public set sliceBorderRight(value: number) {\n this.sliceBordersInternal.y = value;\n this.sceneWrapper.setUniform(\n this.planeHandler,\n \"sliceBorders\",\n this.sliceBordersInternal,\n );\n }\n\n /**\n * Sets the top border size for nine-slice scaling.\n * @param value - The top border size as a percentage (0-1) of texture height\n */\n public set sliceBorderTop(value: number) {\n this.sliceBordersInternal.z = value;\n this.sceneWrapper.setUniform(\n this.planeHandler,\n \"sliceBorders\",\n this.sliceBordersInternal,\n );\n }\n\n /**\n * Sets the bottom border size for nine-slice scaling.\n * @param value - The bottom border size as a percentage (0-1) of texture height\n */\n public set sliceBorderBottom(value: number) {\n this.sliceBordersInternal.w = value;\n this.sceneWrapper.setUniform(\n this.planeHandler,\n \"sliceBorders\",\n this.sliceBordersInternal,\n );\n }\n\n /**\n * Sets all four border sizes for nine-slice scaling at once.\n *\n * @param left - The left border size as a percentage (0-1) of texture width\n * @param right - The right border size as a percentage (0-1) of texture width\n * @param top - The top border size as a percentage (0-1) of texture height\n * @param bottom - The bottom border size as a percentage (0-1) of texture height\n */\n public setSliceBorders(\n left: number,\n right: number,\n top: number,\n bottom: number,\n ): void {\n this.sliceBordersInternal.set(left, right, top, bottom);\n this.sceneWrapper.setUniform(\n this.planeHandler,\n \"sliceBorders\",\n this.sliceBordersInternal,\n );\n }\n\n /**\n * Destroys the nine-slice UI element by cleaning up color event listeners and all associated resources.\n */\n public override destroy(): void {\n this.colorInternal.off(UIColorEvent.CHANGE, this.onColorChange);\n super.destroy();\n }\n\n /**\n * Called before each render frame to update the element's dimensions for nine-slice scaling.\n * Updates the world dimensions (z, w components) based on current width, height, and micro scaling.\n * @param renderer - The WebGL renderer\n * @param deltaTime - Time since last frame in seconds\n */\n protected override onWillRender(\n renderer: WebGLRenderer,\n deltaTime: number,\n ): void {\n super.onWillRender(renderer, deltaTime);\n\n this.dimensions.z = this.width * this.micro.scaleX;\n this.dimensions.w = this.height * this.micro.scaleY;\n this.sceneWrapper.setUniform(\n this.planeHandler,\n \"dimensions\",\n this.dimensions,\n );\n }\n\n /** Event handler for when the color changes */\n private readonly onColorChange = (color: UIColor): void => {\n this.sceneWrapper.setUniform(this.planeHandler, \"color\", color);\n };\n}\n","import { Texture } from \"three\";\nimport type { UILayer } from \"../layers/UILayer\";\nimport { assertValidPositiveNumber } from \"../miscellaneous/asserts\";\nimport { UIColor, UIColorEvent } from \"../miscellaneous/UIColor\";\nimport type { UIMode } from \"../miscellaneous/UIMode\";\nimport source from \"../shaders/UIProgressShader.glsl\";\nimport { UIElement } from \"./UIElement\";\n\nconst DEFAULT_TEXTURE = new Texture();\n\n/**\n * Predefined mask functions that control how the progress bar fills.\n * Each function defines a different fill pattern using GLSL shader code.\n */\nexport enum UIProgressMaskFunction {\n /** Fill horizontally from left to right (or right to left if inverse) */\n HORIZONTAL = `float calculateMask() {\n return step((direction * io_UV.x + (1.0 - direction) * 0.5), progress);\n }`,\n\n /** Fill vertically from bottom to top (or top to bottom if inverse) */\n VERTICAL = `float calculateMask() {\n return step((direction * io_UV.y + (1.0 - direction) * 0.5), progress);\n }`,\n\n /** Fill diagonally from bottom-left to top-right */\n DIAGONAL = `float calculateMask() {\n float d = (io_UV.x + io_UV.y) * (0.1);\n return step((direction * d + (1.0 - direction) * 0.5), progress);\n }`,\n\n /** Fill in a circular pattern around the center, starting from the left */\n CIRCLE_LEFT = `float calculateMask() {\n vec2 p = io_UV - 0.5;\n float angle = atan(p.y, p.x);\n angle = (angle + 3.14159265) / 3.14159265;\n angle *= 0.5;\n return step((direction * angle + (1.0 - direction) * 0.5), progress);\n }`,\n\n /** Fill in a circular pattern around the center, starting from the top */\n CIRCLE_TOP = `float calculateMask() {\n vec2 p = io_UV - 0.5;\n float angle = atan(p.y, p.x);\n angle = (angle + 3.14159265) / (2.0 * 3.14159265);\n angle = mod(angle + 0.25, 1.0);\n return step((direction * angle + (1.0 - direction) * 0.5), progress);\n }`,\n}\n\n/**\n * Configuration options for creating a UIProgress element.\n */\nexport interface UIProgressOptions {\n /** X position of the element */\n x: number;\n /** Y position of the element */\n y: number;\n /** Optional background texture (if not provided, default texture is used) */\n backgroundTexture: Texture;\n /** Overall color tint applied to the entire progress bar */\n color: UIColor;\n /** Foreground color tint applied to the filled portion */\n foregroundColor: UIColor;\n /** Background color tint applied to the unfilled portion */\n backgroundColor: UIColor;\n /** Mask function that defines how the progress bar fills (predefined enum or custom GLSL code) */\n maskFunction: UIProgressMaskFunction | string;\n /** Progress value between 0.0 (empty) and 1.0 (full) */\n progress: number;\n /** Whether to fill in reverse direction (true for reverse, false for normal) */\n inverseDirection: boolean;\n /** Default UIMode */\n mode: UIMode;\n}\n\n/**\n * Progress bar UI element with customizable fill direction and appearance.\n *\n * UIProgress displays a progress bar that can be filled in various directions\n * (horizontal, vertical, or at custom angles). It supports separate background\n * and foreground textures with independent color tinting and opacity control.\n *\n * The progress value ranges from 0.0 (empty) to 1.0 (completely filled).\n * The fill direction can be controlled both by angle and forward/reverse direction.\n */\nexport class UIProgress extends UIElement {\n /** Internal storage for the foreground texture */\n private foregroundTextureInternal: Texture;\n /** Internal storage for the optional background texture */\n private backgroundTextureInternal?: Texture;\n\n /** Internal storage for the overall color tint */\n private readonly colorInternal: UIColor;\n /** Internal storage for the foreground color tint */\n private readonly foregroundColorInternal: UIColor;\n /** Internal storage for the background color tint */\n private readonly backgroundColorInternal: UIColor;\n\n /** Internal storage for the current progress value */\n private progressInternal: number;\n /** Internal storage for the fill direction flag */\n private inverseDirectionInternal: boolean;\n\n /**\n * Creates a new progress bar UI element.\n *\n * @param layer - The UI layer to add this element to\n * @param foregroundTexture - The texture used for the progress fill\n * @param options - Configuration options for the progress bar\n */\n constructor(\n layer: UILayer,\n foregroundTexture: Texture,\n options: Partial<UIProgressOptions> = {},\n ) {\n const w = foregroundTexture.image?.width;\n const h = foregroundTexture.image?.height;\n\n assertValidPositiveNumber(w, \"UIProgress foreground texture width\");\n assertValidPositiveNumber(h, \"UIProgress foreground texture height\");\n\n if (options.backgroundTexture) {\n assertValidPositiveNumber(\n options.backgroundTexture.image.width,\n \"UIProgress background texture width\",\n );\n assertValidPositiveNumber(\n options.backgroundTexture.image.height,\n \"UIProgress background texture height\",\n );\n }\n\n const color = options.color ?? new UIColor();\n const foregroundColor = options.foregroundColor ?? new UIColor();\n const backgroundColor = options.backgroundColor ?? new UIColor();\n const progress = options.progress ?? 1;\n const inverseDirection = options.inverseDirection ?? false;\n\n super(\n layer,\n options.x ?? 0,\n options.y ?? 0,\n w,\n h,\n (options.maskFunction ?? UIProgressMaskFunction.HORIZONTAL) + source,\n {\n foregroundTexture,\n backgroundTexture: options.backgroundTexture ?? DEFAULT_TEXTURE,\n color,\n foregroundColor,\n backgroundColor,\n progress,\n direction: inverseDirection ? -1 : 1,\n },\n );\n\n this.foregroundTextureInternal = foregroundTexture;\n this.backgroundTextureInternal = options.backgroundTexture;\n\n this.colorInternal = color;\n this.foregroundColorInternal = foregroundColor;\n this.backgroundColorInternal = backgroundColor;\n\n this.progressInternal = progress;\n this.inverseDirectionInternal = inverseDirection;\n\n this.colorInternal.on(UIColorEvent.CHANGE, this.onColorChange);\n this.foregroundColorInternal.on(\n UIColorEvent.CHANGE,\n this.onForegroundColorChange,\n );\n this.backgroundColorInternal.on(\n UIColorEvent.CHANGE,\n this.onBackgroundColorChange,\n );\n\n if (options.mode !== undefined) {\n this.mode = options.mode;\n }\n }\n\n /**\n * Gets the foreground (fill) texture.\n * @returns The foreground texture\n */\n public get foregroundTexture(): Texture {\n return this.foregroundTextureInternal;\n }\n\n /**\n * Gets the background texture.\n * @returns The background texture, or undefined if none is set\n */\n public get backgroundTexture(): Texture | undefined {\n return this.backgroundTextureInternal;\n }\n\n /**\n * Gets the color tint.\n * @returns The UIColor instance\n */\n public get color(): UIColor {\n return this.colorInternal;\n }\n\n /**\n * Gets the foreground color tint.\n * @returns The foreground color UIColor instance\n */\n public get foregroundColor(): UIColor {\n return this.foregroundColorInternal;\n }\n\n /**\n * Gets the background color tint.\n * @returns The background color UIColor instance\n */\n public get backgroundColor(): UIColor {\n return this.backgroundColorInternal;\n }\n\n /**\n * Gets the current progress value.\n * @returns Progress value between 0.0 (empty) and 1.0 (full)\n */\n public get progress(): number {\n return this.progressInternal;\n }\n\n /**\n * Gets whether the progress fills in reverse direction.\n * @returns True if filling in reverse, false if filling forward\n */\n public get inverseDirection(): boolean {\n return this.inverseDirectionInternal;\n }\n\n /**\n * Sets the foreground (fill) texture.\n *\n * When setting a new texture, the progress bar will automatically resize\n * to match the new texture's dimensions.\n *\n * @param value - The new foreground texture\n * @throws Will throw an error if the texture dimensions are not valid positive numbers\n */\n public set foregroundTexture(value: Texture) {\n const w = value.image.width;\n const h = value.image.height;\n\n assertValidPositiveNumber(w, \"UIProgress foreground texture width\");\n assertValidPositiveNumber(h, \"UIProgress foreground texture height\");\n\n this.solverWrapper.suggestVariableValue(this.wVariable, w);\n this.solverWrapper.suggestVariableValue(this.hVariable, h);\n\n this.foregroundTextureInternal = value;\n this.sceneWrapper.setUniform(this.planeHandler, \"foregroundTexture\", value);\n }\n\n /**\n * Sets the background texture.\n * @param value - The background texture, or undefined to remove background\n */\n public set backgroundTexture(value: Texture | undefined) {\n if (value !== undefined) {\n assertValidPositiveNumber(\n value.image.width,\n \"UIProgress background texture width\",\n );\n assertValidPositiveNumber(\n value.image.height,\n \"UIProgress background texture height\",\n );\n }\n\n this.backgroundTextureInternal = value;\n this.sceneWrapper.setUniform(this.planeHandler, \"backgroundTexture\", value);\n }\n\n /**\n * Sets the color tint.\n * @param value - The UIColor instance\n */\n public set color(value: UIColor) {\n this.colorInternal.copy(value);\n }\n\n /**\n * Sets the foreground color tint.\n * @param value - The foreground color UIColor instance\n */\n public set foregroundColor(value: UIColor) {\n this.foregroundColorInternal.copy(value);\n }\n\n /**\n * Sets the background color tint.\n * @param value - The background color UIColor instance\n */\n public set backgroundColor(value: UIColor) {\n this.backgroundColorInternal.copy(value);\n }\n\n /**\n * Sets the progress fill direction.\n * @param value - True for reverse direction, false for forward\n */\n public set inverseDirection(value: boolean) {\n this.inverseDirectionInternal = value;\n this.sceneWrapper.setUniform(\n this.planeHandler,\n \"direction\",\n value ? -1 : 1,\n );\n }\n\n /**\n * Sets the progress value.\n * @param value - Progress value between 0.0 (empty) and 1.0 (full)\n */\n public set progress(value: number) {\n this.progressInternal = value;\n this.sceneWrapper.setUniform(this.planeHandler, \"progress\", value);\n }\n\n public override destroy(): void {\n this.colorInternal.off(UIColorEvent.CHANGE, this.onColorChange);\n this.foregroundColorInternal.off(\n UIColorEvent.CHANGE,\n this.onForegroundColorChange,\n );\n this.backgroundColorInternal.off(\n UIColorEvent.CHANGE,\n this.onBackgroundColorChange,\n );\n super.destroy();\n }\n\n /** Event handler for when the overall color changes */\n private readonly onColorChange = (color: UIColor): void => {\n this.sceneWrapper.setUniform(this.planeHandler, \"color\", color);\n };\n\n /** Event handler for when the foreground color changes */\n private readonly onForegroundColorChange = (color: UIColor): void => {\n this.sceneWrapper.setUniform(this.planeHandler, \"foregroundColor\", color);\n };\n\n /** Event handler for when the background color changes */\n private readonly onBackgroundColorChange = (color: UIColor): void => {\n this.sceneWrapper.setUniform(this.planeHandler, \"backgroundColor\", color);\n };\n}\n","import type { Camera, WebGLRenderer } from \"three\";\nimport {\n LinearFilter,\n Matrix3,\n PerspectiveCamera,\n RGBAFormat,\n Scene,\n UnsignedByteType,\n WebGLRenderTarget,\n} from \"three\";\nimport { type UILayer } from \"../layers/UILayer\";\nimport { UIColor, UIColorEvent } from \"../miscellaneous/UIColor\";\nimport type { UIMode } from \"../miscellaneous/UIMode\";\nimport source from \"../shaders/UIDefaultShader.glsl\";\nimport { UIElement } from \"./UIElement\";\n\n/**\n * Update modes for controlling when the 3D scene should be re-rendered.\n */\nexport enum UISceneUpdateMode {\n /** Re-render the scene every frame. */\n EACH_FRAME = 1,\n /** Re-render the scene every second frame for performance. */\n EACH_SECOND_FRAME = 2,\n /** Re-render the scene only when properties change. */\n PROPERTY_CHANGED = 3,\n /** Re-render the scene only when manually requested. */\n MANUAL = 4,\n}\n\n/** Default resolution factor for render target sizing. */\nconst DEFAULT_RESOLUTION_FACTOR = 0.5;\n/** Minimum allowed resolution factor to prevent performance issues. */\nconst MIN_RESOLUTION_FACTOR = 0.1;\n/** Maximum allowed resolution factor to prevent memory issues. */\nconst MAX_RESOLUTION_FACTOR = 2;\n/** Default width for the scene render target in pixels. */\nconst DEFAULT_WIDTH = 512;\n/** Default height for the scene render target in pixels. */\nconst DEFAULT_HEIGHT = 512;\n/** Default field of view for the perspective camera in degrees. */\nconst DEFAULT_CAMERA_FOV = 75;\n/** Default near clipping plane distance for the camera. */\nconst DEFAULT_CAMERA_NEAR = 0.1;\n/** Default far clipping plane distance for the camera. */\nconst DEFAULT_CAMERA_FAR = 100;\n/** Default update mode for scene rendering. */\nconst DEFAULT_UPDATE_MODE = UISceneUpdateMode.PROPERTY_CHANGED;\n/** Default clear color for the render target. */\nconst DEFAULT_CLEAR_COLOR = 0x000000;\n/** Default clear alpha for the render target. */\nconst DEFAULT_CLEAR_ALPHA = 0;\n/** Default depth buffer usage setting. */\nconst DEFAULT_USE_DEPTH = true;\n\n/**\n * Configuration options for UIScene element creation.\n */\nexport interface UISceneOptions {\n /** Initial x-coordinate position. */\n x: number;\n /** Initial y-coordinate position. */\n y: number;\n /** Width of the scene render target in pixels. */\n width: number;\n /** Height of the scene render target in pixels. */\n height: number;\n /** Color tint applied to the scene texture. */\n color: UIColor;\n /** Three.js scene to render. */\n scene: Scene;\n /** Camera to use for rendering the scene. */\n camera: Camera;\n /** Update mode controlling when the scene is re-rendered. */\n updateMode: UISceneUpdateMode;\n /** Resolution factor for render target sizing (0.1 to 2.0). */\n resolutionFactor: number;\n /** Clear color for the render target background. */\n clearColor: number;\n /** Clear alpha for the render target background. */\n clearAlpha: number;\n /** Whether to enable depth buffer for the render target. */\n enableDepthBuffer: boolean;\n /** Default UIMode */\n mode: UIMode;\n}\n\n/**\n * UI element for rendering 3D scenes to texture within the UI system.\n *\n * UIScene is a concrete implementation of UIElement that renders a Three.js\n * scene to a WebGL render target and displays it as a texture. It provides\n * control over rendering frequency, resolution, and visual properties. This\n * allows embedding complex 3D content within the 2D UI layout system with\n * performance optimizations through configurable update modes.\n *\n * @see {@link UIElement} - Base class providing UI element functionality\n * @see {@link UISceneUpdateMode} - Update mode configuration\n * @see {@link Scene} - Three.js scene for 3D content\n * @see {@link Camera} - Three.js camera for scene rendering\n */\nexport class UIScene extends UIElement {\n /** The WebGL render target for off-screen scene rendering. */\n private readonly renderTarget: WebGLRenderTarget;\n\n /** Internal storage for the color tint. */\n private readonly colorInternal: UIColor;\n /** Internal storage for the current Three.js scene. */\n private sceneInternal: Scene;\n /** Internal storage for the current camera. */\n private cameraInternal: Camera;\n /** Internal storage for the current update mode. */\n private updateModeInternal: UISceneUpdateMode;\n /** Internal storage for the current resolution factor. */\n private resolutionFactorInternal: number;\n /** Internal storage for the current clear color. */\n private clearColorInternal: number;\n /** Internal storage for the current clear alpha. */\n private clearAlphaInternal: number;\n\n /** Frame alternation boolean for EACH_SECOND_FRAME update mode. */\n private frameBoolean = true;\n /** Flag indicating if properties have changed requiring a re-render. */\n private propertyChanged = false;\n /** Flag indicating if a manual render has been requested. */\n private renderRequired = false;\n\n /**\n * Creates a new UIScene instance with 3D scene rendering capabilities.\n *\n * The scene element creates a WebGL render target for off-screen rendering\n * and displays the result as a texture. A default perspective camera is\n * created if none is provided.\n *\n * @param layer - The UI layer that contains this scene element\n * @param options - Configuration options for scene rendering\n * @throws Will throw an error if resolution factor is outside valid range (0.1-2.0)\n */\n constructor(layer: UILayer, options: Partial<UISceneOptions> = {}) {\n const resolutionFactor =\n options.resolutionFactor ?? DEFAULT_RESOLUTION_FACTOR;\n\n if (\n resolutionFactor < MIN_RESOLUTION_FACTOR ||\n resolutionFactor > MAX_RESOLUTION_FACTOR\n ) {\n throw new Error(\n `Invalid resolution factor: ${resolutionFactor}. Must be between ${MIN_RESOLUTION_FACTOR} and ${MAX_RESOLUTION_FACTOR}.`,\n );\n }\n\n const w = options.width ?? DEFAULT_WIDTH;\n const h = options.height ?? DEFAULT_HEIGHT;\n\n const renderTarget = new WebGLRenderTarget(\n w * resolutionFactor,\n h * resolutionFactor,\n {\n format: RGBAFormat,\n minFilter: LinearFilter,\n magFilter: LinearFilter,\n type: UnsignedByteType,\n depthBuffer: options.enableDepthBuffer ?? DEFAULT_USE_DEPTH,\n stencilBuffer: false,\n },\n );\n\n const color = options.color ?? new UIColor();\n\n super(layer, 0, 0, w, h, source, {\n map: renderTarget.texture,\n uvTransform: new Matrix3(),\n color,\n });\n\n this.renderTarget = renderTarget;\n\n this.sceneInternal = options.scene ?? new Scene();\n this.cameraInternal =\n options.camera ??\n new PerspectiveCamera(\n DEFAULT_CAMERA_FOV,\n w / h,\n DEFAULT_CAMERA_NEAR,\n DEFAULT_CAMERA_FAR,\n );\n\n this.resolutionFactorInternal = resolutionFactor;\n this.updateModeInternal = options.updateMode ?? DEFAULT_UPDATE_MODE;\n\n this.clearColorInternal = options.clearColor ?? DEFAULT_CLEAR_COLOR;\n this.clearAlphaInternal = options.clearAlpha ?? DEFAULT_CLEAR_ALPHA;\n\n if (options.updateMode === UISceneUpdateMode.PROPERTY_CHANGED) {\n this.renderRequired = true;\n }\n\n this.colorInternal = color;\n this.colorInternal.on(UIColorEvent.CHANGE, this.onColorChange);\n\n if (options.mode !== undefined) {\n this.mode = options.mode;\n }\n }\n\n /**\n * Gets the current color tint applied to the scene texture.\n * @returns The UIColor instance\n */\n public get color(): UIColor {\n return this.colorInternal;\n }\n\n /**\n * Gets the Three.js scene being rendered.\n * @returns The current Three.js scene\n */\n public get scene(): Scene {\n return this.sceneInternal;\n }\n\n /**\n * Gets the camera used for rendering the scene.\n * @returns The current Three.js camera\n */\n public get camera(): Camera {\n return this.cameraInternal;\n }\n\n /**\n * Gets the current update mode controlling render frequency.\n * @returns The current update mode\n */\n public get updateMode(): UISceneUpdateMode {\n return this.updateModeInternal;\n }\n\n /**\n * Gets the resolution factor for render target sizing.\n * @returns The resolution factor between 0.1 and 2.0\n */\n public get resolutionFactor(): number {\n return this.resolutionFactorInternal;\n }\n\n /**\n * Gets the clear color used for the render target background.\n * @returns The clear color as a number\n */\n public get clearColor(): number {\n return this.clearColorInternal;\n }\n\n /**\n * Gets the clear alpha used for the render target background.\n * @returns The clear alpha value between 0.0 and 1.0\n */\n public get clearAlpha(): number {\n return this.clearAlphaInternal;\n }\n\n /**\n * Sets the color tint applied to the scene texture.\n * @param value - The UIColor instance\n */\n public set color(value: UIColor) {\n this.colorInternal.copy(value);\n }\n\n /**\n * Sets a new Three.js scene to render and marks for re-render.\n * @param value - The new Three.js scene\n */\n public set scene(value: Scene) {\n if (this.sceneInternal !== value) {\n this.sceneInternal = value;\n this.propertyChanged = true;\n }\n }\n\n /**\n * Sets a new camera for rendering and marks for re-render.\n * @param value - The new Three.js camera\n */\n public set camera(value: Camera) {\n if (this.cameraInternal !== value) {\n this.cameraInternal = value;\n this.propertyChanged = true;\n }\n }\n\n /**\n * Sets the update mode controlling render frequency and marks for re-render.\n * @param value - The new update mode\n */\n public set updateMode(value: UISceneUpdateMode) {\n if (this.updateModeInternal !== value) {\n this.updateModeInternal = value;\n this.propertyChanged = true;\n }\n }\n\n /**\n * Sets the resolution factor and resizes the render target accordingly.\n * @param value - The new resolution factor between 0.1 and 2.0\n */\n public set resolutionFactor(value: number) {\n if (this.resolutionFactorInternal !== value) {\n this.resolutionFactorInternal = value;\n this.renderTarget.setSize(\n this.width * this.resolutionFactorInternal,\n this.height * this.resolutionFactorInternal,\n );\n this.propertyChanged = true;\n }\n }\n\n /**\n * Sets the clear color for the render target background and marks for re-render.\n * @param value - The new clear color as a number\n */\n public set clearColor(value: number) {\n if (this.clearColorInternal !== value) {\n this.clearColorInternal = value;\n this.propertyChanged = true;\n }\n }\n\n /**\n * Sets the clear alpha for the render target background and marks for re-render.\n * @param value - The new clear alpha value between 0.0 and 1.0\n */\n public set clearAlpha(value: number) {\n if (this.clearAlphaInternal !== value) {\n this.clearAlphaInternal = value;\n this.propertyChanged = true;\n }\n }\n\n /**\n * Destroys the scene element by cleaning up all associated resources.\n *\n * This method disposes of the material and render target resources,\n * and calls the parent destroy method to clean up the underlying UI element.\n * After calling this method, the scene element should not be used anymore.\n */\n public override destroy(): void {\n this.colorInternal.off(UIColorEvent.CHANGE, this.onColorChange);\n this.renderTarget.dispose();\n super.destroy();\n }\n\n /**\n * Manually requests a re-render of the scene.\n *\n * This method is useful when the update mode is set to MANUAL and you\n * want to trigger a scene re-render without changing any properties.\n */\n public requestRender(): void {\n this.renderRequired = true;\n }\n\n /**\n * Called before each render frame to update the 3D scene rendering.\n * Handles different update modes and renders the 3D scene to the render target\n * based on the current update mode and property change state.\n * @param renderer - The WebGL renderer used for scene rendering\n */\n protected override onWillRender(renderer: WebGLRenderer): void {\n if (\n this.updateModeInternal === UISceneUpdateMode.EACH_FRAME ||\n (this.updateModeInternal === UISceneUpdateMode.EACH_SECOND_FRAME &&\n this.frameBoolean) ||\n (this.updateModeInternal === UISceneUpdateMode.PROPERTY_CHANGED &&\n this.propertyChanged) ||\n (this.updateModeInternal === UISceneUpdateMode.MANUAL &&\n this.renderRequired)\n ) {\n this.renderRequired = false;\n this.propertyChanged = false;\n this.frameBoolean = !this.frameBoolean;\n\n this.renderTarget.setSize(\n this.width * this.resolutionFactorInternal,\n this.height * this.resolutionFactorInternal,\n );\n renderer.setClearColor(this.clearColorInternal, this.clearAlpha);\n renderer.setRenderTarget(this.renderTarget);\n renderer.clear(true, true, false);\n renderer.render(this.sceneInternal, this.cameraInternal);\n }\n }\n\n /** Event handler for when the color changes */\n private readonly onColorChange = (color: UIColor): void => {\n this.sceneWrapper.setUniform(this.planeHandler, \"color\", color);\n };\n}\n","import {\n assertValidNonNegativeNumber,\n assertValidNumber,\n assertValidPositiveNumber,\n} from \"./asserts\";\n\nexport interface UITextStyle {\n color: string;\n align: \"left\" | \"center\" | \"right\";\n\n fontFamily: string;\n fontSize: number;\n fontStyle: \"normal\" | \"italic\" | \"oblique\";\n fontWeight: \"normal\" | \"bold\" | \"bolder\" | \"lighter\" | number;\n lineHeight: number;\n\n enableShadow: boolean;\n shadowOffsetX: number;\n shadowOffsetY: number;\n shadowBlur: number;\n shadowColor: string;\n\n enableStroke: boolean;\n strokeColor: string;\n strokeWidth: number;\n}\n\nexport function isUITextStyle(obj: unknown): obj is UITextStyle {\n if (typeof obj !== \"object\" || obj === null) {\n return false;\n }\n\n const candidate = obj as Record<string, unknown>;\n\n return (\n typeof candidate.color === \"string\" &&\n (candidate.align === \"left\" ||\n candidate.align === \"center\" ||\n candidate.align === \"right\") &&\n typeof candidate.fontFamily === \"string\" &&\n typeof candidate.fontSize === \"number\" &&\n (candidate.fontStyle === \"normal\" ||\n candidate.fontStyle === \"italic\" ||\n candidate.fontStyle === \"oblique\") &&\n (candidate.fontWeight === \"normal\" ||\n candidate.fontWeight === \"bold\" ||\n candidate.fontWeight === \"bolder\" ||\n candidate.fontWeight === \"lighter\" ||\n typeof candidate.fontWeight === \"number\") &&\n typeof candidate.lineHeight === \"number\" &&\n typeof candidate.enableShadow === \"boolean\" &&\n typeof candidate.shadowOffsetX === \"number\" &&\n typeof candidate.shadowOffsetY === \"number\" &&\n typeof candidate.shadowBlur === \"number\" &&\n typeof candidate.shadowColor === \"string\" &&\n typeof candidate.enableStroke === \"boolean\" &&\n typeof candidate.strokeColor === \"string\" &&\n typeof candidate.strokeWidth === \"number\"\n );\n}\n\nexport const DEFAULT_TEXT_STYLE: UITextStyle = {\n color: \"#000000\",\n align: \"left\",\n\n fontFamily: \"Arial\",\n fontSize: 16,\n fontStyle: \"normal\",\n fontWeight: \"normal\",\n lineHeight: 1.2,\n\n enableShadow: false,\n shadowOffsetX: 0,\n shadowOffsetY: 0,\n shadowBlur: 0,\n shadowColor: \"transparent\",\n\n enableStroke: false,\n strokeColor: \"#000000\",\n strokeWidth: 0,\n};\n\nexport function resolveTextStyle(\n style?: Partial<UITextStyle>,\n commonStyle?: Partial<UITextStyle>,\n): UITextStyle {\n const fontSize =\n style?.fontSize ?? commonStyle?.fontSize ?? DEFAULT_TEXT_STYLE.fontSize;\n assertValidPositiveNumber(fontSize, \"Font size\");\n\n const fontWeight = style?.fontWeight ?? commonStyle?.fontWeight ?? \"normal\";\n if (typeof fontWeight === \"number\") {\n assertValidPositiveNumber(fontWeight, \"Font weight\");\n }\n\n const lineHeight =\n style?.lineHeight ??\n commonStyle?.lineHeight ??\n fontSize * DEFAULT_TEXT_STYLE.lineHeight;\n assertValidNumber(lineHeight, \"Line height\");\n\n const shadowOffsetX =\n style?.shadowOffsetX ??\n commonStyle?.shadowOffsetX ??\n DEFAULT_TEXT_STYLE.shadowOffsetX;\n assertValidNonNegativeNumber(shadowOffsetX, \"Shadow offset X\");\n\n const shadowOffsetY =\n style?.shadowOffsetY ??\n commonStyle?.shadowOffsetY ??\n DEFAULT_TEXT_STYLE.shadowOffsetY;\n assertValidNonNegativeNumber(shadowOffsetY, \"Shadow offset Y\");\n\n const shadowBlur =\n style?.shadowBlur ??\n commonStyle?.shadowBlur ??\n DEFAULT_TEXT_STYLE.shadowBlur;\n assertValidNonNegativeNumber(shadowBlur, \"Shadow blur\");\n\n const strokeWidth =\n style?.strokeWidth ??\n commonStyle?.strokeWidth ??\n DEFAULT_TEXT_STYLE.strokeWidth;\n assertValidNonNegativeNumber(strokeWidth, \"Stroke width\");\n\n return {\n color: style?.color ?? commonStyle?.color ?? DEFAULT_TEXT_STYLE.color,\n align: style?.align ?? commonStyle?.align ?? DEFAULT_TEXT_STYLE.align,\n\n fontFamily:\n style?.fontFamily ??\n commonStyle?.fontFamily ??\n DEFAULT_TEXT_STYLE.fontFamily,\n fontSize,\n fontStyle:\n style?.fontStyle ??\n commonStyle?.fontStyle ??\n DEFAULT_TEXT_STYLE.fontStyle,\n fontWeight,\n lineHeight,\n\n enableShadow:\n style?.enableShadow ??\n commonStyle?.enableShadow ??\n DEFAULT_TEXT_STYLE.enableShadow,\n shadowOffsetX,\n shadowOffsetY,\n shadowBlur,\n shadowColor:\n style?.shadowColor ??\n commonStyle?.shadowColor ??\n DEFAULT_TEXT_STYLE.shadowColor,\n\n enableStroke:\n style?.enableStroke ??\n commonStyle?.enableStroke ??\n DEFAULT_TEXT_STYLE.enableStroke,\n strokeColor:\n style?.strokeColor ??\n commonStyle?.strokeColor ??\n DEFAULT_TEXT_STYLE.strokeColor,\n strokeWidth,\n };\n}\n","import type {\n UIChunkMetrics,\n UITextChunk,\n UITextContent,\n UITextLine,\n UITextSize,\n} from \"./textInterfaces\";\nimport {\n DEFAULT_TEXT_STYLE,\n resolveTextStyle,\n type UITextStyle,\n} from \"./UITextStyle\";\n\nexport function splitText(text: string): string[] {\n return text.match(/\\S+|\\s|\\n/g) ?? [];\n}\n\nexport function measureTextChunk(\n context: OffscreenCanvasRenderingContext2D,\n chunk: string,\n style: UITextStyle,\n): UIChunkMetrics {\n context.font = `${style.fontStyle} ${style.fontWeight} ${style.fontSize}px ${style.fontFamily}`;\n\n if (chunk === \"\\n\") {\n return {\n width: Math.ceil(1),\n height: style.lineHeight,\n baseline: 0,\n lineHeight: style.lineHeight,\n };\n }\n\n const metrics = context.measureText(chunk);\n const width = Math.ceil(metrics.width);\n const height = Math.ceil(\n metrics.actualBoundingBoxAscent + metrics.actualBoundingBoxDescent,\n );\n\n return {\n width,\n height,\n baseline: metrics.actualBoundingBoxDescent,\n lineHeight: style.lineHeight,\n };\n}\n\nexport function buildLines(\n maxWidth: number,\n chunks: UITextChunk[],\n): UITextLine[] {\n const lines: UITextLine[] = [];\n let currentLine: UITextChunk[] = [];\n let currentWidth = 0;\n let currentHeight = 0;\n let currentBaseline = 0;\n let currentLineHeight = 0;\n\n for (const chunk of chunks) {\n if (chunk.text === \"\\n\") {\n if (currentLine.length > 0) {\n lines.push({\n chunks: currentLine,\n width: currentWidth,\n height: currentHeight,\n baseline: currentBaseline,\n lineHeight: currentLineHeight,\n });\n }\n currentLine = [];\n currentWidth = 0;\n currentHeight = 0;\n currentBaseline = 0;\n currentLineHeight = 0;\n continue;\n }\n\n if (\n currentWidth + chunk.metrics.width <= maxWidth ||\n currentLine.length === 0\n ) {\n currentLine.push(chunk);\n currentWidth += chunk.metrics.width;\n currentHeight = Math.max(currentHeight, chunk.metrics.height);\n currentBaseline = Math.max(currentBaseline, chunk.metrics.baseline);\n currentLineHeight = Math.max(currentLineHeight, chunk.metrics.lineHeight);\n } else {\n lines.push({\n chunks: currentLine,\n width: currentWidth,\n height: currentHeight,\n baseline: currentBaseline,\n lineHeight: currentLineHeight,\n });\n currentLine = [chunk];\n currentWidth = chunk.metrics.width;\n currentHeight = chunk.metrics.height;\n currentBaseline = chunk.metrics.baseline;\n currentLineHeight = chunk.metrics.lineHeight;\n }\n }\n\n if (currentLine.length > 0) {\n lines.push({\n chunks: currentLine,\n width: currentWidth,\n height: currentHeight,\n baseline: currentBaseline,\n lineHeight: currentLineHeight,\n });\n }\n\n return lines;\n}\n\nexport function calculateTextSize(lines: UITextLine[]): UITextSize {\n if (lines.length === 0) {\n return { width: 0, height: 0 };\n }\n\n const maxLineWidth = Math.max(...lines.map((line) => line.width));\n let totalHeight = 0;\n\n for (let i = 0; i < lines.length; i++) {\n const line = lines[i];\n totalHeight += i === 0 ? line.height : line.lineHeight;\n }\n\n return { width: maxLineWidth, height: totalHeight };\n}\n\nexport function renderText(\n x: number,\n y: number,\n text: string,\n style: UITextStyle,\n context: OffscreenCanvasRenderingContext2D,\n): void {\n context.font = `${style.fontStyle} ${style.fontWeight} ${style.fontSize}px ${style.fontFamily}`;\n\n if (style.enableShadow) {\n context.shadowOffsetX = style.shadowOffsetX;\n context.shadowOffsetY = style.shadowOffsetY;\n context.shadowBlur = style.shadowBlur;\n context.shadowColor = style.shadowColor;\n }\n\n if (style.enableStroke) {\n context.strokeStyle = style.strokeColor;\n context.lineWidth = style.strokeWidth;\n context.strokeText(text, x, y);\n }\n\n context.fillStyle = style.color;\n context.fillText(text, x, y);\n}\n\nexport function renderTextLines(\n paddingTop: number,\n paddingLeft: number,\n lines: UITextLine[],\n context: OffscreenCanvasRenderingContext2D,\n): void {\n let currentY = paddingTop;\n\n let textWidth = 0;\n for (const line of lines) {\n textWidth = Math.max(line.width, textWidth);\n }\n\n for (let i = 0; i < lines.length; i++) {\n const line = lines[i];\n\n const firstAlign = line.chunks[0]?.style.align ?? DEFAULT_TEXT_STYLE.align;\n const isUniformAlign = line.chunks.every(\n (c) => c.style.align === firstAlign,\n );\n const lineAlign = isUniformAlign ? firstAlign : DEFAULT_TEXT_STYLE.align;\n\n let offsetX = 0;\n\n if (lineAlign === \"center\") {\n offsetX = (textWidth - line.width) / 2;\n } else if (lineAlign === \"right\") {\n offsetX = textWidth - line.width;\n }\n\n let currentX = paddingLeft + offsetX;\n currentY += i === 0 ? line.height : line.lineHeight;\n\n for (const chunk of line.chunks) {\n renderText(currentX, currentY, chunk.text, chunk.style, context);\n currentX += chunk.metrics.width;\n }\n }\n}\n\nexport function calculateTextContentParameters(\n context: OffscreenCanvasRenderingContext2D,\n content: UITextContent,\n maxLineWidth: number,\n commonStyle?: Partial<UITextStyle>,\n): { lines: UITextLine[]; size: UITextSize } {\n const chunks: UITextChunk[] = [];\n\n for (const span of Array.isArray(content) ? content : [content]) {\n const isSpanString = typeof span === \"string\";\n const spanString = isSpanString ? span : span.text;\n const style = resolveTextStyle(\n isSpanString ? undefined : span.style,\n commonStyle,\n );\n\n for (const text of splitText(spanString)) {\n const metrics = measureTextChunk(context, text, style);\n chunks.push({ text, style, metrics });\n }\n }\n\n const lines = buildLines(maxLineWidth, chunks);\n return { lines, size: calculateTextSize(lines) };\n}\n","import { assertValidNonNegativeNumber } from \"./asserts\";\n\nexport interface UIPadding {\n left: number;\n right: number;\n top: number;\n bottom: number;\n}\n\nexport function resolveTextPadding(value: unknown): UIPadding {\n if (typeof value === \"number\") {\n return { left: value, right: value, top: value, bottom: value };\n }\n\n if (typeof value === \"object\" && value !== null) {\n const left =\n \"left\" in value && typeof value.left === \"number\" ? value.left : 0;\n const right =\n \"right\" in value && typeof value.right === \"number\" ? value.right : 0;\n const top = \"top\" in value && typeof value.top === \"number\" ? value.top : 0;\n const bottom =\n \"bottom\" in value && typeof value.bottom === \"number\" ? value.bottom : 0;\n\n assertValidNonNegativeNumber(left, \"Padding left\");\n assertValidNonNegativeNumber(right, \"Padding right\");\n assertValidNonNegativeNumber(top, \"Padding top\");\n assertValidNonNegativeNumber(bottom, \"Padding bottom\");\n\n return { left, right, top, bottom };\n }\n\n return { left: 0, right: 0, top: 0, bottom: 0 };\n}\n","import type { WebGLRenderer } from \"three\";\nimport { CanvasTexture, Matrix3 } from \"three\";\nimport { type UILayer } from \"../layers/UILayer\";\nimport type { UITextContent } from \"../miscellaneous/textInterfaces\";\nimport {\n calculateTextContentParameters,\n renderTextLines,\n} from \"../miscellaneous/textTools\";\nimport { UIColor, UIColorEvent } from \"../miscellaneous/UIColor\";\nimport type { UIMode } from \"../miscellaneous/UIMode\";\nimport {\n resolveTextPadding,\n type UIPadding,\n} from \"../miscellaneous/UITextPadding\";\nimport { type UITextStyle } from \"../miscellaneous/UITextStyle\";\nimport source from \"../shaders/UIDefaultShader.glsl\";\nimport { UIElement } from \"./UIElement\";\n\n/** Default maximum width for text elements in pixels. */\nconst DEFAULT_MAX_WIDTH = 1024;\n\n/**\n * Configuration options for UIText element creation.\n */\nexport interface UITextOptions {\n /** X-coordinate of the text element. */\n x: number;\n /** Y-coordinate of the text element. */\n y: number;\n /** Color tint applied to the text. */\n color: UIColor;\n /** Maximum width in pixels before text wrapping occurs. */\n maxWidth: number;\n /** Padding configuration for text content. */\n padding: Partial<UIPadding>;\n /** Common style properties applied to all text content. */\n commonStyle: Partial<UITextStyle>;\n /** Default UIMode */\n mode: UIMode;\n}\n\n/**\n * UI element for rendering dynamic text with canvas-based rendering.\n *\n * UIText is a concrete implementation of UIElement that renders text content\n * using HTML5 Canvas and displays it as a texture. It supports rich text\n * formatting, automatic text wrapping, padding, and dynamic resizing based\n * on content. The text is rendered to a canvas texture which is then applied\n * to a Three.js mesh for display in the 3D scene.\n *\n * @see {@link UIElement} - Base class providing UI element functionality\n * @see {@link UITextContent} - Text content structure\n * @see {@link UITextStyle} - Text styling options\n * @see {@link UIPadding} - Padding configuration\n */\nexport class UIText extends UIElement {\n /** The HTML canvas element used for text rendering. */\n private readonly canvas: OffscreenCanvas;\n\n /** The 2D rendering context for drawing text on the canvas. */\n private readonly context: OffscreenCanvasRenderingContext2D;\n\n /** The canvas texture containing the rendered text. */\n private texture: CanvasTexture;\n\n /** Internal storage for the color tint. */\n private readonly colorInternal: UIColor;\n\n /** Internal storage for the current text content. */\n private contentInternal: UITextContent;\n\n /** Internal storage for the maximum width before text wrapping. */\n private maxWidthInternal: number;\n\n /** Internal storage for the current padding configuration. */\n private paddingInternal: UIPadding;\n\n /** Internal storage for the common text style properties. */\n private commonStyleInternal: Partial<UITextStyle>;\n\n /** Target aspect ratio for the text element based on content. */\n private targetAspectRatio = 1;\n\n /**\n * Creates a new UIText instance with dynamic text rendering.\n *\n * The text element will automatically size itself based on the content\n * and specified options. A canvas is created for rendering the text,\n * which is then used as a texture for the 3D mesh.\n *\n * @param layer - The UI layer that contains this text element\n * @param content - The text content to display\n * @param options - Configuration options for text rendering\n * @throws Will throw an error if canvas context creation fails\n */\n constructor(\n layer: UILayer,\n content: UITextContent,\n options: Partial<UITextOptions> = {},\n ) {\n const canvas = new OffscreenCanvas(2, 2);\n const context = canvas.getContext(\"2d\");\n\n if (!context) {\n throw new Error(\"UIText failed to create canvas context\");\n }\n\n const texture = new CanvasTexture(canvas);\n const color = options.color ?? new UIColor();\n\n super(layer, options.x ?? 0, options.y ?? 0, 2, 2, source, {\n map: texture,\n uvTransform: new Matrix3(),\n color,\n });\n\n this.canvas = canvas;\n this.context = context;\n this.texture = texture;\n\n this.contentInternal = content;\n this.maxWidthInternal = options.maxWidth ?? DEFAULT_MAX_WIDTH;\n this.paddingInternal = resolveTextPadding(options.padding);\n this.commonStyleInternal = options.commonStyle ?? {};\n\n this.colorInternal = color;\n this.colorInternal.on(UIColorEvent.CHANGE, this.onColorChange);\n this.rebuildText();\n\n if (options.mode !== undefined) {\n this.mode = options.mode;\n }\n }\n\n /**\n * Gets the current color tint applied to the text.\n * @returns The UIColor instance\n */\n public get color(): UIColor {\n return this.colorInternal;\n }\n\n /**\n * Gets the current text content being displayed.\n * @returns The current text content structure\n */\n public get content(): UITextContent {\n return this.contentInternal;\n }\n\n /**\n * Gets the maximum width before text wrapping occurs.\n * @returns The maximum width in pixels\n */\n public get maxWidth(): number {\n return this.maxWidthInternal;\n }\n\n /**\n * Gets the current padding configuration.\n * @returns The padding configuration for all sides\n */\n public get padding(): UIPadding {\n return this.paddingInternal;\n }\n\n /**\n * Gets the common style properties applied to the text.\n * @returns The partial text style configuration\n */\n public get commonStyle(): Partial<UITextStyle> {\n return this.commonStyleInternal;\n }\n\n /**\n * Sets the color tint applied to the text.\n * @param value - The UIColor instance\n */\n public set color(value: UIColor) {\n this.colorInternal.copy(value);\n }\n\n /**\n * Sets new text content and triggers a rebuild.\n * @param value - The new text content structure\n */\n public set content(value: UITextContent) {\n this.contentInternal = value;\n this.rebuildText();\n }\n\n /**\n * Sets the maximum width before text wrapping and triggers a rebuild.\n * @param value - The new maximum width in pixels\n */\n public set maxWidth(value: number) {\n this.maxWidthInternal = value;\n this.rebuildText();\n }\n\n /**\n * Sets new padding configuration and triggers a rebuild.\n * @param value - The new padding configuration\n */\n public set padding(value: UIPadding) {\n this.paddingInternal = value;\n this.rebuildText();\n }\n\n /**\n * Sets new common style properties and triggers a rebuild.\n * @param value - The new partial text style configuration\n */\n public set commonStyle(value: Partial<UITextStyle>) {\n this.commonStyleInternal = value;\n this.rebuildText();\n }\n\n /**\n * Destroys the text element by cleaning up all associated resources.\n *\n * This method disposes of the texture resources and calls the parent destroy method\n * to clean up the underlying UI element. After calling this method,\n * the text element should not be used anymore.\n */\n public override destroy(): void {\n this.colorInternal.off(UIColorEvent.CHANGE, this.onColorChange);\n this.texture.dispose();\n super.destroy();\n }\n\n /**\n * Called before each render frame to maintain proper text aspect ratio.\n * Adjusts the height based on the target aspect ratio calculated from text content.\n * @param renderer - The WebGL renderer\n * @param deltaTime - Time since last frame in seconds\n */\n protected override onWillRender(\n renderer: WebGLRenderer,\n deltaTime: number,\n ): void {\n super.onWillRender(renderer, deltaTime);\n if (this.targetAspectRatio !== this.width / this.height) {\n this.height = this.width / this.targetAspectRatio;\n }\n }\n\n /**\n * Rebuilds the text canvas and texture based on current content and settings.\n *\n * This method calculates the text layout, resizes the canvas to fit the content\n * with padding, renders the text lines to the canvas, and updates the texture.\n * It also calculates and sets the target aspect ratio for proper display.\n */\n private rebuildText(): void {\n const { lines, size } = calculateTextContentParameters(\n this.context,\n this.content,\n this.maxWidthInternal,\n this.commonStyleInternal,\n );\n\n this.canvas.width =\n size.width + this.paddingInternal.left + this.paddingInternal.right;\n this.canvas.height =\n size.height + this.paddingInternal.top + this.paddingInternal.bottom;\n\n this.width = this.canvas.width;\n this.height = this.canvas.height;\n\n this.targetAspectRatio = this.canvas.width / this.canvas.height;\n\n renderTextLines(\n this.paddingInternal.top,\n this.paddingInternal.left,\n lines,\n this.context,\n );\n\n this.texture.dispose();\n this.texture = new CanvasTexture(this.canvas);\n this.texture.needsUpdate = true;\n this.sceneWrapper.setUniform(this.planeHandler, \"map\", this.texture);\n }\n\n /** Event handler for when the color changes */\n private readonly onColorChange = (color: UIColor): void => {\n this.sceneWrapper.setUniform(this.planeHandler, \"color\", color);\n };\n}\n","import { Eventail } from \"eventail\";\n\nexport enum UIResizePolicyEvent {\n CHANGE = 0,\n}\n\n/**\n * Base class for UI resize policies.\n *\n * Calculates scale factors based on viewport dimensions. Different policies\n * implement different scaling strategies.\n */\nexport abstract class UIResizePolicy extends Eventail {\n /**\n * Calculates scale factor for given dimensions.\n *\n * @param width - Viewport width in pixels\n * @param height - Viewport height in pixels\n * @returns Scale factor to apply\n * @protected\n */\n protected abstract calculateScaleInternal(\n width: number,\n height: number,\n ): number;\n}\n","import { UIResizePolicy } from \"./UIResizePolicy\";\n\n/**\n * No scaling applied, always returns 1:1 scale.\n */\nexport class UIResizePolicyNone extends UIResizePolicy {\n protected calculateScaleInternal(width: number, height: number): number {\n void width;\n void height;\n return 1;\n }\n}\n","import type { Vector2 } from \"three\";\nimport { MathUtils, Vector3, type Camera, type WebGLRenderer } from \"three\";\nimport { assertValidNumber } from \"../miscellaneous/asserts\";\nimport { UIInputEvent } from \"../miscellaneous/UIInputEvent\";\nimport { UIMode } from \"../miscellaneous/UIMode\";\nimport type { UIResizePolicy } from \"../miscellaneous/UIResizePolicy\";\nimport { UIResizePolicyEvent } from \"../miscellaneous/UIResizePolicy\";\nimport { UIResizePolicyNone } from \"../miscellaneous/UIResizePolicyNone\";\nimport { UILayer } from \"./UILayer\";\n\n/**\n * UI layer that covers the full browser window.\n *\n * Handles window resize and pointer events automatically. Scaling is controlled\n * by the assigned resize policy.\n *\n * @see {@link UILayer}\n * @see {@link UIResizePolicy}\n */\nexport class UIFullscreenLayer extends UILayer {\n private resizePolicyInternal: UIResizePolicy;\n\n /**\n * Creates a fullscreen layer and sets up window event listeners.\n */\n constructor(\n resizePolicy: UIResizePolicy = new UIResizePolicyNone(),\n mode: UIMode = UIMode.VISIBLE,\n ) {\n super(window.innerWidth, window.innerHeight);\n window.addEventListener(\"resize\", this.onResize);\n window.addEventListener(\"pointerdown\", this.onDown);\n window.addEventListener(\"pointermove\", this.onMove);\n window.addEventListener(\"pointerup\", this.onUp);\n this.mode = mode;\n this.resizePolicyInternal = resizePolicy;\n this.resizePolicyInternal.on(UIResizePolicyEvent.CHANGE, this.onResize);\n this.onResize();\n }\n\n /**\n * Gets the current resize policy.\n */\n public get resizePolicy(): UIResizePolicy {\n return this.resizePolicyInternal;\n }\n\n /**\n * Sets a new resize policy. Unsubscribes from old policy and subscribes to new one.\n */\n public set resizePolicy(value: UIResizePolicy) {\n if (this.resizePolicyInternal !== value) {\n this.resizePolicyInternal.off(UIResizePolicyEvent.CHANGE, this.onResize);\n this.resizePolicyInternal = value;\n this.resizePolicyInternal.on(UIResizePolicyEvent.CHANGE, this.onResize);\n this.onResize();\n }\n }\n\n /**\n * Removes window event listeners. The layer should not be used after this.\n */\n public destroy(): void {\n window.removeEventListener(\"resize\", this.onResize);\n window.removeEventListener(\"pointerdown\", this.onDown);\n window.removeEventListener(\"pointermove\", this.onMove);\n window.removeEventListener(\"pointerup\", this.onUp);\n this.resizePolicyInternal.off(UIResizePolicyEvent.CHANGE, this.onResize);\n }\n\n /**\n * Renders the layer.\n *\n * @param renderer - WebGL renderer\n * @param deltaTime - Time since last frame in seconds\n */\n public render(renderer: WebGLRenderer, deltaTime: number): void {\n assertValidNumber(deltaTime, \"UIFullscreenLayer.deltaTime\");\n super.renderInternal(renderer, deltaTime);\n }\n\n /**\n * Projects 3D world position to 2D layer coordinates.\n *\n * @param position - 3D world position\n * @param camera - Camera for projection\n * @returns 2D position in layer space\n */\n public projectWorldPosition(position: Vector3, camera: Camera): Vector3 {\n const projectedPosition = position.clone().project(camera);\n projectedPosition.x = MathUtils.mapLinear(\n projectedPosition.x,\n -1,\n 1,\n this.x,\n this.width,\n );\n projectedPosition.y = MathUtils.mapLinear(\n projectedPosition.y,\n -1,\n 1,\n this.y,\n this.height,\n );\n return projectedPosition;\n }\n\n /**\n * Projects 2D layer position to 3D world coordinates.\n *\n * @param position - 2D position in layer space\n * @param camera - Camera for unprojection\n * @param z - z in NDC space (defaults to -1)\n * @returns 3D position in world space\n */\n public projectLayerPosition(\n position: Vector2,\n camera: Camera,\n z = -1,\n ): Vector3 {\n return new Vector3(\n MathUtils.mapLinear(position.x, this.x, this.width, -1, 1),\n MathUtils.mapLinear(position.y, this.y, this.height, -1, 1),\n z,\n ).unproject(camera);\n }\n\n /**\n * Handles window resize. Updates layer dimensions according to resize policy.\n */\n private readonly onResize = (): void => {\n const scale = this.resizePolicyInternal[\"calculateScaleInternal\"](\n window.innerWidth,\n window.innerHeight,\n );\n this.resizeInternal(window.innerWidth * scale, window.innerHeight * scale);\n };\n\n private readonly onDown = (event: PointerEvent): void => {\n this.handleWindowInput(event, \"onPointerDownInternal\", UIInputEvent.DOWN);\n };\n\n private readonly onMove = (event: PointerEvent): void => {\n this.handleWindowInput(event, \"onPointerMoveInternal\", UIInputEvent.MOVE);\n };\n\n private readonly onUp = (event: PointerEvent): void => {\n this.handleWindowInput(event, \"onPointerUpInternal\", UIInputEvent.UP);\n };\n\n private handleWindowInput(\n event: PointerEvent,\n pointerFunctionName:\n | \"onPointerDownInternal\"\n | \"onPointerMoveInternal\"\n | \"onPointerUpInternal\",\n inputEvent: UIInputEvent,\n ): void {\n const rect =\n event.target instanceof HTMLElement\n ? event.target.getBoundingClientRect()\n : null;\n\n const x = rect ? event.clientX - rect.left : event.clientX;\n const y = rect\n ? rect.bottom - event.clientY\n : window.innerHeight - event.clientY;\n\n const scale = this.resizePolicyInternal[\"calculateScaleInternal\"](\n window.innerWidth,\n window.innerHeight,\n );\n const scaledX = x * scale;\n const scaledY = y * scale;\n\n if (this.mode === UIMode.INTERACTIVE) {\n this.emit(inputEvent, scaledX, scaledY, event.pointerId);\n }\n\n this[pointerFunctionName](scaledX, scaledY, event.pointerId);\n }\n}\n","import type { IUniform } from \"three\";\nimport {\n InstancedBufferAttribute,\n InstancedBufferGeometry,\n Matrix2,\n Matrix3,\n Matrix4,\n Mesh,\n PlaneGeometry,\n ShaderMaterial,\n Texture,\n Vector2,\n Vector3,\n Vector4,\n} from \"three\";\nimport { UIColor } from \"../miscellaneous/UIColor\";\nimport { UITransparencyMode } from \"./UITransparencyMode\";\nimport { assertValidNonNegativeNumber } from \"./asserts\";\n\nexport type UIPropertyType =\n | Texture\n | UIColor\n | Vector2\n | Vector3\n | Vector4\n | Matrix2\n | Matrix3\n | Matrix4\n | number;\n\nexport type UIPropertyTypeName =\n | \"Texture\"\n | \"UIColor\"\n | \"Vector2\"\n | \"Vector3\"\n | \"Vector4\"\n | \"Matrix2\"\n | \"Matrix3\"\n | \"Matrix4\"\n | \"number\";\n\ninterface Descriptor {\n firstIndex: number;\n count: number;\n}\n\nconst INSTANCED_GEOMETRY = ((): InstancedBufferGeometry => {\n const planeGeometry = new PlaneGeometry(1, 1);\n const geometry = new InstancedBufferGeometry();\n geometry.index = planeGeometry.index;\n geometry.setAttribute(\"position\", planeGeometry.attributes[\"position\"]);\n geometry.setAttribute(\"uv\", planeGeometry.attributes[\"uv\"]);\n planeGeometry.dispose();\n return geometry;\n})();\n\nconst ITEM_1_OFFSET = 1;\nconst ITEM_2_OFFSET = 2;\nconst ITEM_3_OFFSET = 3;\n\nconst CAPACITY_STEP = 16;\nconst ALPHA_TEST = 0.5;\n\nfunction resolveTypeInfo(property: UIPropertyType | UIPropertyTypeName): {\n instantiable: boolean;\n glslType: string;\n itemSize: number;\n} {\n if (property === \"Texture\" || property instanceof Texture) {\n return { glslType: \"sampler2D\", instantiable: false, itemSize: -1 };\n } else if (property === \"UIColor\" || property instanceof UIColor) {\n return { glslType: \"vec4\", instantiable: true, itemSize: 4 };\n } else if (property === \"Vector2\" || property instanceof Vector2) {\n return { glslType: \"vec2\", instantiable: true, itemSize: 2 };\n } else if (property === \"Vector3\" || property instanceof Vector3) {\n return { glslType: \"vec3\", instantiable: true, itemSize: 3 };\n } else if (property === \"Vector4\" || property instanceof Vector4) {\n return { glslType: \"vec4\", instantiable: true, itemSize: 4 };\n } else if (property === \"Matrix2\" || property instanceof Matrix2) {\n return { glslType: \"mat2\", instantiable: true, itemSize: 4 };\n } else if (property === \"Matrix3\" || property instanceof Matrix3) {\n return { glslType: \"mat3\", instantiable: true, itemSize: 9 };\n } else if (property === \"Matrix4\" || property instanceof Matrix4) {\n return { glslType: \"mat4\", instantiable: true, itemSize: 16 };\n } else if (property === \"number\" || typeof property === \"number\") {\n return { glslType: \"float\", instantiable: true, itemSize: 1 };\n } else {\n throw new Error(`Unsupported property type: ${property}`);\n }\n}\n\nfunction udpateProperty(\n value: UIPropertyType,\n attribute: InstancedBufferAttribute,\n itemOffset: number,\n): void {\n const array = attribute.array as Float32Array;\n\n if (value instanceof UIColor) {\n array[itemOffset] = value.r;\n array[itemOffset + ITEM_1_OFFSET] = value.g;\n array[itemOffset + ITEM_2_OFFSET] = value.b;\n array[itemOffset + ITEM_3_OFFSET] = value.a;\n } else if (value instanceof Vector2) {\n array[itemOffset] = value.x;\n array[itemOffset + ITEM_1_OFFSET] = value.y;\n } else if (value instanceof Vector3) {\n array[itemOffset] = value.x;\n array[itemOffset + ITEM_1_OFFSET] = value.y;\n array[itemOffset + ITEM_2_OFFSET] = value.z;\n } else if (value instanceof Vector4) {\n array[itemOffset] = value.x;\n array[itemOffset + ITEM_1_OFFSET] = value.y;\n array[itemOffset + ITEM_2_OFFSET] = value.z;\n array[itemOffset + ITEM_3_OFFSET] = value.w;\n } else if (value instanceof Matrix2) {\n const elements = value.elements;\n for (let j = 0; j < elements.length; j++) {\n array[itemOffset + j] = elements[j];\n }\n } else if (value instanceof Matrix3) {\n const elements = value.elements;\n for (let j = 0; j < elements.length; j++) {\n array[itemOffset + j] = elements[j];\n }\n } else if (value instanceof Matrix4) {\n const elements = value.elements;\n for (let j = 0; j < elements.length; j++) {\n array[itemOffset + j] = elements[j];\n }\n } else if (typeof value === \"number\") {\n array[itemOffset] = value;\n }\n\n attribute.needsUpdate = true;\n}\n\nfunction buildEmptyInstancedBufferAttribute(\n property: UIPropertyType | UIPropertyTypeName,\n capacity: number,\n): InstancedBufferAttribute {\n const info = resolveTypeInfo(property);\n if (!info.instantiable) {\n throw new Error(`Invalid property type: ${property}`);\n }\n return new InstancedBufferAttribute(\n new Float32Array(capacity * info.itemSize),\n info.itemSize,\n );\n}\n\nfunction buildMaterial(\n source: string,\n uniformLayout: Record<string, UIPropertyTypeName>,\n varyingLayout: Record<string, UIPropertyTypeName>,\n transparency: UITransparencyMode,\n): ShaderMaterial {\n const uniforms: Record<string, { value: null }> = {};\n\n const uniformDeclarations: string[] = [];\n const attributeDeclarations: string[] = [];\n const varyingDeclarations: string[] = [];\n const vertexAssignments: string[] = [];\n\n for (const [name, propertyTypeName] of Object.entries(uniformLayout)) {\n const glslType = resolveTypeInfo(propertyTypeName).glslType;\n uniforms[`u_${name}`] = { value: null };\n uniformDeclarations.push(`uniform ${glslType} u_${name};`);\n }\n\n for (const [name, propertyTypeName] of Object.entries(varyingLayout)) {\n const glslType = resolveTypeInfo(propertyTypeName).glslType;\n attributeDeclarations.push(`attribute ${glslType} a_${name};`);\n varyingDeclarations.push(`varying ${glslType} v_${name};`);\n vertexAssignments.push(`v_${name} = a_${name};`);\n }\n\n const vertexShader = `\n ${attributeDeclarations.join(\"\\n\")}\n\n ${uniformDeclarations.join(\"\\n\")}\n\n ${varyingDeclarations.join(\"\\n\")}\n varying vec3 v_position;\n varying vec2 v_uv;\n\n void main() {\n if (a_visibility < 0.5) {\n gl_Position = vec4(2.0, 2.0, 2.0, 2.0);\n return;\n }\n\n ${vertexAssignments.join(\"\\n\")}\n\n v_position = position;\n v_uv = (a_uvTransform * vec3(uv, 1.0)).xy;\n\n gl_Position = projectionMatrix * modelViewMatrix * a_instanceTransform * vec4(position, 1.0);\n }\n `;\n\n const fragmentShader = `\n ${uniformDeclarations.join(\"\\n\")}\n\n ${varyingDeclarations.join(\"\\n\")}\n varying vec3 v_position;\n varying vec2 v_uv;\n\n #include <alphahash_pars_fragment>\n\n // Source have to define 'draw' function\n ${source}\n\n void main() {\n vec4 diffuseColor = draw();\n\n #ifdef USE_ALPHATEST\n if (diffuseColor.a < v_alphaTest) {\n discard;\n }\n #endif\n\n #ifdef USE_ALPHAHASH\n if (diffuseColor.a < getAlphaHashThreshold(v_position)) {\n discard;\n }\n #endif\n\n gl_FragColor = linearToOutputTexel(diffuseColor);\n }\n `;\n\n return new ShaderMaterial({\n uniforms,\n vertexShader,\n fragmentShader,\n transparent: transparency === UITransparencyMode.BLEND,\n alphaTest: transparency === UITransparencyMode.CLIP ? ALPHA_TEST : 0.0,\n alphaHash: transparency === UITransparencyMode.HASH,\n });\n}\n\nexport class UIGenericInstancedPlane extends Mesh {\n protected handlerToDescriptor: Map<number, Descriptor> = new Map();\n\n protected lastHandler = 0;\n protected capacity = 0;\n protected propertyBuffers: Map<string, InstancedBufferAttribute> = new Map();\n\n private readonly instancedGeometry: InstancedBufferGeometry;\n private readonly shaderMaterial: ShaderMaterial;\n\n constructor(\n source: string,\n layout: Record<string, UIPropertyTypeName>,\n transparency: UITransparencyMode = UITransparencyMode.CLIP,\n capacity: number = CAPACITY_STEP,\n ) {\n const uniformLayout: Record<string, UIPropertyTypeName> = {};\n const varyingLayout: Record<string, UIPropertyTypeName> = {\n instanceTransform: \"Matrix4\",\n uvTransform: \"Matrix3\",\n ...(transparency === UITransparencyMode.CLIP\n ? { alphaTest: \"number\" }\n : {}),\n };\n\n for (const [name, propertyTypeName] of Object.entries(layout)) {\n (resolveTypeInfo(propertyTypeName).instantiable\n ? varyingLayout\n : uniformLayout)[name] = propertyTypeName;\n }\n\n const instancedGeometry = INSTANCED_GEOMETRY.clone();\n const shaderMaterial = buildMaterial(\n source,\n uniformLayout,\n varyingLayout,\n transparency,\n );\n\n super(instancedGeometry, shaderMaterial);\n\n this.instancedGeometry = instancedGeometry;\n this.instancedGeometry.instanceCount = 0;\n\n this.shaderMaterial = shaderMaterial;\n this.capacity = Math.max(capacity, CAPACITY_STEP);\n\n for (const [name, propertyTypeName] of Object.entries(varyingLayout)) {\n const attribute = buildEmptyInstancedBufferAttribute(\n propertyTypeName,\n this.capacity,\n );\n\n this.instancedGeometry.setAttribute(`a_${name}`, attribute);\n this.propertyBuffers.set(`a_${name}`, attribute);\n }\n }\n\n public createInstances(count: number): number {\n const handler = this.lastHandler++;\n\n if (this.instancedGeometry.instanceCount + count > this.capacity) {\n this.resizeGeometry(\n Math.ceil((this.capacity + count) / CAPACITY_STEP) * CAPACITY_STEP,\n );\n }\n\n this.handlerToDescriptor.set(handler, {\n firstIndex: this.instancedGeometry.instanceCount,\n count,\n });\n\n this.instancedGeometry.instanceCount += count;\n return handler;\n }\n\n public destroyInstances(handler: number): void {\n const releasedDescriptor = this.handlerToDescriptor.get(handler);\n if (releasedDescriptor === undefined) {\n throw new Error(`No range found for userIndex: ${handler}`);\n }\n\n this.handlerToDescriptor.delete(handler);\n\n const values = Array.from(this.handlerToDescriptor.values());\n const edge = releasedDescriptor.firstIndex + releasedDescriptor.count;\n let replacementDescriptor: Descriptor | undefined;\n\n for (let i = values.length - 1; i > edge; i--) {\n const descriptor = values[i];\n if (descriptor.count === releasedDescriptor.count) {\n replacementDescriptor = descriptor;\n break;\n }\n }\n\n if (replacementDescriptor) {\n this.copyRangeData(replacementDescriptor, releasedDescriptor);\n replacementDescriptor.firstIndex = releasedDescriptor.firstIndex;\n\n this.shiftRangesDown(\n replacementDescriptor.firstIndex + replacementDescriptor.count,\n replacementDescriptor.count,\n );\n } else {\n this.shiftRangesDown(\n releasedDescriptor.firstIndex + releasedDescriptor.count,\n releasedDescriptor.count,\n );\n }\n\n this.instancedGeometry.instanceCount -= releasedDescriptor.count;\n }\n\n public updateProperties(\n handler: number,\n offset: number,\n instancesProperties: Record<string, UIPropertyType>[],\n ): void {\n assertValidNonNegativeNumber(\n offset,\n \"UIGenericInstancedPlane updateProperties offset\",\n );\n\n const descriptor = this.resolveDescriptor(handler);\n\n if (instancesProperties.length + offset > descriptor.count) {\n throw new Error(\n `Too many instances for handler: ${handler}, offset: ${offset}, and count: ${instancesProperties.length}`,\n );\n }\n\n for (let i = 0; i < instancesProperties.length; i++) {\n const instanceProperties = instancesProperties[i];\n const instanceOffset = descriptor.firstIndex + offset + i;\n\n for (const [name, value] of Object.entries(instanceProperties)) {\n if (resolveTypeInfo(value).instantiable) {\n const attribute = this.resolveBufferAttribute(name);\n const itemOffset = instanceOffset * attribute.itemSize;\n udpateProperty(value, attribute, itemOffset);\n } else {\n const uniform = this.resolveUniform(name);\n uniform.value = value;\n this.shaderMaterial.uniformsNeedUpdate = true;\n }\n }\n }\n }\n\n public updateTransforms(\n handler: number,\n offset: number,\n instancesTransforms: Matrix4[],\n ): void {\n assertValidNonNegativeNumber(\n offset,\n \"UIGenericInstancedPlane updateTransforms offset\",\n );\n\n const descriptor = this.resolveDescriptor(handler);\n\n if (instancesTransforms.length + offset > descriptor.count) {\n throw new Error(\n `Too many instances for handler: ${handler}, offset: ${offset}, and count: ${instancesTransforms.length}`,\n );\n }\n\n for (let i = 0; i < instancesTransforms.length; i++) {\n const attribute = this.resolveBufferAttribute(\"instanceTransform\");\n const instanceOffset = descriptor.firstIndex + offset + i;\n\n const array = attribute.array as Float32Array;\n const itemOffset = instanceOffset * attribute.itemSize;\n const elements = instancesTransforms[i].elements;\n for (let j = 0; j < elements.length; j++) {\n array[itemOffset + j] = elements[j];\n }\n attribute.needsUpdate = true;\n }\n }\n\n public updateUVTransforms(\n handler: number,\n offset: number,\n uvTransforms: Matrix3[],\n ): void {\n assertValidNonNegativeNumber(\n offset,\n \"UIGenericInstancedPlane updateUVTransforms offset\",\n );\n\n const descriptor = this.resolveDescriptor(handler);\n\n if (uvTransforms.length + offset > descriptor.count) {\n throw new Error(\n `Too many instances for handler: ${handler}, offset: ${offset}, and count: ${uvTransforms.length}`,\n );\n }\n\n for (let i = 0; i < uvTransforms.length; i++) {\n const attribute = this.resolveBufferAttribute(\"uvTransform\");\n const instanceOffset = descriptor.firstIndex + offset + i;\n\n const array = attribute.array as Float32Array;\n const itemOffset = instanceOffset * attribute.itemSize;\n const elements = uvTransforms[i].elements;\n for (let j = 0; j < elements.length; j++) {\n array[itemOffset + j] = elements[j];\n }\n attribute.needsUpdate = true;\n }\n }\n\n public updateVisibility(\n handler: number,\n offset: number,\n instancesVisibility: boolean[],\n ): void {\n assertValidNonNegativeNumber(\n offset,\n \"UIGenericInstancedPlane updateVisibility offset\",\n );\n\n const descriptor = this.resolveDescriptor(handler);\n\n if (instancesVisibility.length + offset > descriptor.count) {\n throw new Error(\n `Too many instances for handler: ${handler}, offset: ${offset}, and count: ${instancesVisibility.length}`,\n );\n }\n\n for (let i = 0; i < instancesVisibility.length; i++) {\n const attribute = this.resolveBufferAttribute(\"visibility\");\n const instanceOffset = descriptor.firstIndex + offset + i;\n\n const array = attribute.array as Float32Array;\n const itemOffset = instanceOffset * attribute.itemSize;\n array[itemOffset] = instancesVisibility[i] ? 1 : 0;\n attribute.needsUpdate = true;\n }\n }\n\n public destroy(): void {\n this.instancedGeometry.dispose();\n this.shaderMaterial.dispose();\n }\n\n private resolveDescriptor(handler: number): Descriptor {\n const descriptor = this.handlerToDescriptor.get(handler);\n if (descriptor === undefined) {\n throw new Error(`No active range found for handler: ${handler}`);\n }\n return descriptor;\n }\n\n private resolveBufferAttribute(name: string): InstancedBufferAttribute {\n const attribute = this.propertyBuffers.get(`a_${name}`);\n if (attribute === undefined) {\n throw new Error(`No attribute found for property: ${name} (a_${name})`);\n }\n return attribute;\n }\n\n private resolveUniform(name: string): IUniform<unknown> {\n const uniform = this.shaderMaterial.uniforms[`u_${name}`] as\n | IUniform<unknown>\n | undefined;\n\n if (uniform === undefined) {\n throw new Error(`No uniform found for handler: ${name}`);\n }\n return uniform;\n }\n\n private resizeGeometry(newCapacity: number): void {\n for (const [name, oldAttribute] of this.propertyBuffers.entries()) {\n const itemSize = oldAttribute.itemSize;\n const newArray = new Float32Array(newCapacity * itemSize);\n\n newArray.set(oldAttribute.array as Float32Array);\n const newAttribute = new InstancedBufferAttribute(newArray, itemSize);\n\n this.instancedGeometry.setAttribute(`a_${name}`, newAttribute);\n this.propertyBuffers.set(`a_${name}`, newAttribute);\n }\n\n this.capacity = newCapacity;\n }\n\n private copyRangeData(\n sourceRange: Descriptor,\n targetRange: Descriptor,\n ): void {\n for (const attribute of this.propertyBuffers.values()) {\n const array = attribute.array as Float32Array;\n const itemSize = attribute.itemSize;\n\n const sourceStart = sourceRange.firstIndex * itemSize;\n const targetStart = targetRange.firstIndex * itemSize;\n const dataLength = sourceRange.count * itemSize;\n\n for (let i = 0; i < dataLength; i++) {\n array[targetStart + i] = array[sourceStart + i];\n }\n\n attribute.needsUpdate = true;\n }\n }\n\n private shiftRangesDown(startIndex: number, shiftAmount: number): void {\n for (const descriptor of this.handlerToDescriptor.values()) {\n if (descriptor.firstIndex >= startIndex) {\n descriptor.firstIndex -= shiftAmount;\n }\n }\n\n for (const attribute of this.propertyBuffers.values()) {\n const array = attribute.array as Float32Array;\n const itemSize = attribute.itemSize;\n\n const startByteIndex = startIndex * itemSize;\n const endByteIndex = this.instancedGeometry.instanceCount * itemSize;\n const shiftByteAmount = shiftAmount * itemSize;\n\n for (let i = startByteIndex; i < endByteIndex - shiftByteAmount; i++) {\n array[i] = array[i + shiftByteAmount];\n }\n\n attribute.needsUpdate = true;\n }\n }\n}\n","import { assertValidPositiveNumber } from \"./asserts\";\nimport { UIResizePolicy, UIResizePolicyEvent } from \"./UIResizePolicy\";\n\n/**\n * Scales by width in landscape, by height in portrait.\n */\nexport class UIResizePolicyCross extends UIResizePolicy {\n private fixedWidthLandscapeInternal: number;\n private fixedHeightPortraitInternal: number;\n\n constructor(fixedWidthLandscape: number, fixedHeightPortrait: number) {\n super();\n assertValidPositiveNumber(\n fixedWidthLandscape,\n \"UIResizePolicyCross.fixedWidthLandscape\",\n );\n assertValidPositiveNumber(\n fixedHeightPortrait,\n \"UIResizePolicyCross.fixedHeightPortrait\",\n );\n\n this.fixedWidthLandscapeInternal = fixedWidthLandscape;\n this.fixedHeightPortraitInternal = fixedHeightPortrait;\n }\n\n public get fixedWidthLandscape(): number {\n return this.fixedWidthLandscapeInternal;\n }\n public get fixedHeightPortrait(): number {\n return this.fixedHeightPortraitInternal;\n }\n\n public set fixedWidthLandscape(value: number) {\n assertValidPositiveNumber(value, \"UIResizePolicyCross.fixedWidthLandscape\");\n if (value !== this.fixedWidthLandscapeInternal) {\n this.fixedWidthLandscapeInternal = value;\n this.emit(UIResizePolicyEvent.CHANGE);\n }\n }\n\n public set fixedHeightPortrait(value: number) {\n assertValidPositiveNumber(value, \"UIResizePolicyCross.fixedHeightPortrait\");\n if (value !== this.fixedHeightPortraitInternal) {\n this.fixedHeightPortraitInternal = value;\n this.emit(UIResizePolicyEvent.CHANGE);\n }\n }\n\n public calculateScaleInternal(width: number, height: number): number {\n return width > height\n ? this.fixedWidthLandscapeInternal / width\n : this.fixedHeightPortraitInternal / height;\n }\n}\n","import { assertValidPositiveNumber } from \"./asserts\";\nimport { UIResizePolicy, UIResizePolicyEvent } from \"./UIResizePolicy\";\n\n/**\n * Scales by height in landscape, by width in portrait.\n */\nexport class UIResizePolicyCrossInverted extends UIResizePolicy {\n private fixedHeightLandscapeInternal: number;\n private fixedWidthPortraitInternal: number;\n\n constructor(fixedHeightLandscape: number, fixedWidthPortrait: number) {\n super();\n assertValidPositiveNumber(\n fixedHeightLandscape,\n \"UIResizePolicyCrossInverted.fixedHeightLandscape\",\n );\n assertValidPositiveNumber(\n fixedWidthPortrait,\n \"UIResizePolicyCrossInverted.fixedWidthPortrait\",\n );\n\n this.fixedHeightLandscapeInternal = fixedHeightLandscape;\n this.fixedWidthPortraitInternal = fixedWidthPortrait;\n }\n\n public get fixedHeightLandscape(): number {\n return this.fixedHeightLandscapeInternal;\n }\n public get fixedWidthPortrait(): number {\n return this.fixedWidthPortraitInternal;\n }\n\n public set fixedHeightLandscape(value: number) {\n assertValidPositiveNumber(\n value,\n \"UIResizePolicyCrossInverted.fixedHeightLandscape\",\n );\n if (value !== this.fixedHeightLandscapeInternal) {\n this.fixedHeightLandscapeInternal = value;\n this.emit(UIResizePolicyEvent.CHANGE);\n }\n }\n\n public set fixedWidthPortrait(value: number) {\n assertValidPositiveNumber(\n value,\n \"UIResizePolicyCrossInverted.fixedWidthPortrait\",\n );\n if (value !== this.fixedWidthPortraitInternal) {\n this.fixedWidthPortraitInternal = value;\n this.emit(UIResizePolicyEvent.CHANGE);\n }\n }\n\n protected calculateScaleInternal(width: number, height: number): number {\n return width > height\n ? this.fixedHeightLandscapeInternal / height\n : this.fixedWidthPortraitInternal / width;\n }\n}\n","import { assertValidPositiveNumber } from \"./asserts\";\nimport { UIResizePolicy, UIResizePolicyEvent } from \"./UIResizePolicy\";\n\n/**\n * Maintains fixed height, scales based on window height.\n *\n * Uses different heights for landscape vs portrait orientation,\n * and optionally for near-square aspect ratios.\n */\nexport class UIResizePolicyFixedHeight extends UIResizePolicy {\n private fixedHeightLandscapeInternal: number;\n private fixedHeightPortraitInternal: number;\n private fixedHeightSquareInternal: number;\n private squareEpsilonInternal: number;\n\n constructor(\n fixedHeightLandscape: number,\n fixedHeightPortrait: number,\n fixedHeightSquare: number = fixedHeightPortrait,\n squareEpsilon = 0.1,\n ) {\n super();\n assertValidPositiveNumber(\n fixedHeightLandscape,\n \"UIResizePolicyFixedHeight.fixedHeightLandscape\",\n );\n assertValidPositiveNumber(\n fixedHeightPortrait,\n \"UIResizePolicyFixedHeight.fixedHeightPortrait\",\n );\n assertValidPositiveNumber(\n fixedHeightSquare,\n \"UIResizePolicyFixedHeight.fixedHeightSquare\",\n );\n assertValidPositiveNumber(squareEpsilon, \"UIResizePolicy.squareEpsilon\");\n\n this.fixedHeightLandscapeInternal = fixedHeightLandscape;\n this.fixedHeightPortraitInternal = fixedHeightPortrait;\n this.fixedHeightSquareInternal = fixedHeightSquare;\n this.squareEpsilonInternal = squareEpsilon;\n }\n\n public get fixedHeightLandscape(): number {\n return this.fixedHeightLandscapeInternal;\n }\n public get fixedHeightPortrait(): number {\n return this.fixedHeightPortraitInternal;\n }\n public get fixedHeightSquare(): number {\n return this.fixedHeightSquareInternal;\n }\n public get squareEpsilon(): number {\n return this.squareEpsilonInternal;\n }\n\n public set fixedHeightLandscape(value: number) {\n assertValidPositiveNumber(\n value,\n \"UIResizePolicyFixedHeight.fixedHeightLandscape\",\n );\n if (value !== this.fixedHeightLandscapeInternal) {\n this.fixedHeightLandscapeInternal = value;\n this.emit(UIResizePolicyEvent.CHANGE);\n }\n }\n\n public set fixedHeightPortrait(value: number) {\n assertValidPositiveNumber(\n value,\n \"UIResizePolicyFixedHeight.fixedHeightPortrait\",\n );\n if (value !== this.fixedHeightPortraitInternal) {\n this.fixedHeightPortraitInternal = value;\n this.emit(UIResizePolicyEvent.CHANGE);\n }\n }\n\n public set fixedHeightSquare(value: number) {\n assertValidPositiveNumber(\n value,\n \"UIResizePolicyFixedHeight.fixedHeightSquare\",\n );\n if (value !== this.fixedHeightSquareInternal) {\n this.fixedHeightSquareInternal = value;\n this.emit(UIResizePolicyEvent.CHANGE);\n }\n }\n\n public set squareEpsilon(value: number) {\n assertValidPositiveNumber(value, \"UIResizePolicy.squareEpsilon\");\n if (value !== this.squareEpsilonInternal) {\n this.squareEpsilonInternal = value;\n this.emit(UIResizePolicyEvent.CHANGE);\n }\n }\n\n protected calculateScaleInternal(width: number, height: number): number {\n if (this.isSquare(width, height)) {\n return this.fixedHeightSquareInternal / height;\n }\n return width > height\n ? this.fixedHeightLandscapeInternal / height\n : this.fixedHeightPortraitInternal / height;\n }\n\n private isSquare(width: number, height: number): boolean {\n const ratio = width / height;\n return Math.abs(ratio - 1) <= this.squareEpsilonInternal;\n }\n}\n","import { assertValidPositiveNumber } from \"./asserts\";\nimport { UIResizePolicy, UIResizePolicyEvent } from \"./UIResizePolicy\";\n\n/**\n * Maintains fixed width, scales based on window width.\n *\n * Uses different widths for landscape vs portrait orientation, and optionally\n * a third width for near-square aspect ratios.\n */\nexport class UIResizePolicyFixedWidth extends UIResizePolicy {\n private fixedWidthLandscapeInternal: number;\n private fixedWidthPortraitInternal: number;\n private fixedWidthSquareInternal: number;\n private squareEpsilonInternal: number;\n\n constructor(\n fixedWidthLandscape: number,\n fixedWidthPortrait: number,\n fixedWidthSquare: number = fixedWidthPortrait,\n squareEpsilon = 0.1,\n ) {\n super();\n assertValidPositiveNumber(\n fixedWidthLandscape,\n \"UIResizePolicyFixedWidth.fixedWidthLandscape\",\n );\n assertValidPositiveNumber(\n fixedWidthPortrait,\n \"UIResizePolicyFixedWidth.fixedWidthPortrait\",\n );\n assertValidPositiveNumber(\n fixedWidthSquare,\n \"UIResizePolicyFixedWidth.fixedWidthSquare\",\n );\n assertValidPositiveNumber(squareEpsilon, \"UIResizePolicy.squareEpsilon\");\n\n this.fixedWidthLandscapeInternal = fixedWidthLandscape;\n this.fixedWidthPortraitInternal = fixedWidthPortrait;\n this.fixedWidthSquareInternal = fixedWidthSquare;\n this.squareEpsilonInternal = squareEpsilon;\n }\n\n public get fixedWidthLandscape(): number {\n return this.fixedWidthLandscapeInternal;\n }\n public get fixedWidthPortrait(): number {\n return this.fixedWidthPortraitInternal;\n }\n public get fixedWidthSquare(): number {\n return this.fixedWidthSquareInternal;\n }\n public get squareEpsilon(): number {\n return this.squareEpsilonInternal;\n }\n\n public set fixedWidthLandscape(value: number) {\n assertValidPositiveNumber(\n value,\n \"UIResizePolicyFixedWidth.fixedWidthLandscape\",\n );\n if (value !== this.fixedWidthLandscapeInternal) {\n this.fixedWidthLandscapeInternal = value;\n this.emit(UIResizePolicyEvent.CHANGE);\n }\n }\n\n public set fixedWidthPortrait(value: number) {\n assertValidPositiveNumber(\n value,\n \"UIResizePolicyFixedWidth.fixedWidthPortrait\",\n );\n if (value !== this.fixedWidthPortraitInternal) {\n this.fixedWidthPortraitInternal = value;\n this.emit(UIResizePolicyEvent.CHANGE);\n }\n }\n\n public set fixedWidthSquare(value: number) {\n assertValidPositiveNumber(\n value,\n \"UIResizePolicyFixedWidth.fixedWidthSquare\",\n );\n if (value !== this.fixedWidthSquareInternal) {\n this.fixedWidthSquareInternal = value;\n this.emit(UIResizePolicyEvent.CHANGE);\n }\n }\n\n public set squareEpsilon(value: number) {\n assertValidPositiveNumber(value, \"UIResizePolicy.squareEpsilon\");\n if (value !== this.squareEpsilonInternal) {\n this.squareEpsilonInternal = value;\n this.emit(UIResizePolicyEvent.CHANGE);\n }\n }\n\n protected calculateScaleInternal(width: number, height: number): number {\n if (this.isSquare(width, height)) {\n return this.fixedWidthSquareInternal / width;\n }\n return width > height\n ? this.fixedWidthLandscapeInternal / width\n : this.fixedWidthPortraitInternal / width;\n }\n\n /**\n * Determines if viewport aspect ratio is close to 1:1.\n */\n private isSquare(width: number, height: number): boolean {\n const ratio = width / height;\n return Math.abs(ratio - 1) <= this.squareEpsilonInternal;\n }\n}\n","import { isUITextStyle, type UITextStyle } from \"./UITextStyle\";\n\nexport interface UITextSpan {\n text: string;\n style?: Partial<UITextStyle>;\n}\n\nexport function isUITextSpan(obj?: unknown): obj is UITextSpan {\n return (\n obj !== null &&\n typeof obj === \"object\" &&\n \"text\" in obj &&\n typeof obj.text === \"string\" &&\n (!(\"style\" in obj) || isUITextStyle(obj.style))\n );\n}\n"],"names":["Eventail","DEFAULT_ANCHOR","source"],"mappings":";;AAAA;;;;;;;;;;;;AAYG;MACU,YAAY,CAAA;AAMvB;;;;;AAKG;AACH,IAAA,WAAA,CAAY,QAAQ,GAAG,CAAC,EAAE,KAA0B,EAAA;AAClD,QAAA,IAAI,CAAC,QAAQ,GAAG,QAAQ;AACxB,QAAA,IAAI,kBAAS,KAAK,GAAG,IAAI,GAAG,CAAC,KAAK,CAAC,GAAG,IAAI,GAAG,EAAE;IACjD;AAEA;;;;;;;;;AASG;AACI,IAAA,OAAO,IAAI,CAAC,CAAe,EAAE,CAAe,EAAA;QACjD,MAAM,MAAM,GAAG,IAAI,YAAY,CAC7B,CAAC,CAAC,QAAQ,GAAG,CAAC,CAAC,QAAQ,EACvB,KAAK,CAAC,IAAI,CAAC,CAAC,gBAAO,OAAO,EAAE,CAAC,CAC9B;QACD,KAAK,MAAM,CAAC,aAAa,EAAE,WAAW,CAAC,IAAI,CAAC,CAAA,cAAA,EAAQ;AAClD,YAAA,MAAM,CAAC,IAAI,CAAC,aAAa,EAAE,WAAW,CAAC;QACzC;AACA,QAAA,OAAO,MAAM;IACf;AAEA;;;;;;;;;AASG;AACI,IAAA,OAAO,KAAK,CAAC,CAAe,EAAE,CAAe,EAAA;QAClD,MAAM,MAAM,GAAG,IAAI,YAAY,CAC7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