feat: Reinitialize frontend with SvelteKit and TypeScript

- Delete old Vite+Svelte frontend
- Initialize new SvelteKit project with TypeScript
- Configure Tailwind CSS v4 + DaisyUI
- Implement JWT authentication with auto-refresh
- Create login page with form validation (Zod)
- Add protected route guards
- Update Docker configuration for single-stage build
- Add E2E tests with Playwright (6/11 passing)
- Fix Svelte 5 reactivity with $state() runes

Known issues:
- 5 E2E tests failing (timing/async issues)
- Token refresh implementation needs debugging
- Validation error display timing
This commit is contained in:
2026-02-17 16:19:59 -05:00
parent 54df6018f5
commit de2d83092e
28274 changed files with 3816354 additions and 90 deletions

77
frontend/node_modules/happy-dom/lib/svg/SVGAngle.d.ts generated vendored Normal file
View File

@@ -0,0 +1,77 @@
import SVGAngleTypeEnum from './SVGAngleTypeEnum.js';
import * as PropertySymbol from '../PropertySymbol.js';
import BrowserWindow from '../window/BrowserWindow.js';
/**
* SVG angle.
*
* @see https://developer.mozilla.org/en-US/docs/Web/API/SVGAngle
*/
export default class SVGAngle {
static SVG_ANGLETYPE_UNKNOWN: SVGAngleTypeEnum;
static SVG_ANGLETYPE_UNSPECIFIED: SVGAngleTypeEnum;
static SVG_ANGLETYPE_DEG: SVGAngleTypeEnum;
static SVG_ANGLETYPE_RAD: SVGAngleTypeEnum;
static SVG_ANGLETYPE_GRAD: SVGAngleTypeEnum;
[PropertySymbol.window]: BrowserWindow;
[PropertySymbol.getAttribute]: (() => string | null) | null;
[PropertySymbol.setAttribute]: ((value: string) => void) | null;
[PropertySymbol.attributeValue]: string;
[PropertySymbol.readOnly]: boolean;
/**
* Constructor.
*
* @param illegalConstructorSymbol Illegal constructor symbol.
* @param window Window.
* @param [options] Options.
* @param [options.readOnly] Read only.
* @param [options.getAttribute] Get attribute.
* @param [options.setAttribute] Set attribute.
*/
constructor(illegalConstructorSymbol: symbol, window: BrowserWindow, options?: {
readOnly?: boolean;
getAttribute?: () => string | null;
setAttribute?: (value: string) => void;
});
/**
* Returns unit type.
*
* @returns Unit type.
*/
get unitType(): SVGAngleTypeEnum;
/**
* Returns value.
*
* @returns Value.
*/
get value(): number;
/**
* Sets value.
*
* @param value Value in pixels.
*/
set value(value: number);
/**
* Returns value as string.
*
* @returns Value as string.
*/
get valueAsString(): string;
/**
* Returns value in specified units.
*
* @returns Value in specified units.
*/
get valueInSpecifiedUnits(): number;
/**
* New value specific units.
* @param unitType
* @param value
*/
newValueSpecifiedUnits(unitType: number, value: number): void;
/**
* Convert to specific units.
* @param unitType
*/
convertToSpecifiedUnits(unitType: SVGAngleTypeEnum): void;
}
//# sourceMappingURL=SVGAngle.d.ts.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"SVGAngle.d.ts","sourceRoot":"","sources":["../../src/svg/SVGAngle.ts"],"names":[],"mappings":"AAAA,OAAO,gBAAgB,MAAM,uBAAuB,CAAC;AACrD,OAAO,KAAK,cAAc,MAAM,sBAAsB,CAAC;AACvD,OAAO,aAAa,MAAM,4BAA4B,CAAC;AAIvD;;;;GAIG;AACH,MAAM,CAAC,OAAO,OAAO,QAAQ;IAE5B,OAAc,qBAAqB,mBAA4B;IAC/D,OAAc,yBAAyB,mBAAgC;IACvE,OAAc,iBAAiB,mBAAwB;IACvD,OAAc,iBAAiB,mBAAwB;IACvD,OAAc,kBAAkB,mBAAyB;IAGlD,CAAC,cAAc,CAAC,MAAM,CAAC,EAAE,aAAa,CAAC;IACvC,CAAC,cAAc,CAAC,YAAY,CAAC,EAAE,CAAC,MAAM,MAAM,GAAG,IAAI,CAAC,GAAG,IAAI,CAAQ;IACnE,CAAC,cAAc,CAAC,YAAY,CAAC,EAAE,CAAC,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC,GAAG,IAAI,CAAQ;IACvE,CAAC,cAAc,CAAC,cAAc,CAAC,EAAE,MAAM,CAAM;IAC7C,CAAC,cAAc,CAAC,QAAQ,CAAC,EAAE,OAAO,CAAS;IAElD;;;;;;;;;OASG;gBAEF,wBAAwB,EAAE,MAAM,EAChC,MAAM,EAAE,aAAa,EACrB,OAAO,CAAC,EAAE;QACT,QAAQ,CAAC,EAAE,OAAO,CAAC;QACnB,YAAY,CAAC,EAAE,MAAM,MAAM,GAAG,IAAI,CAAC;QACnC,YAAY,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;KACvC;IAeF;;;;OAIG;IACH,IAAW,QAAQ,IAAI,gBAAgB,CA4BtC;IAED;;;;OAIG;IACH,IAAW,KAAK,IAAI,MAAM,CA8BzB;IAED;;;;OAIG;IACH,IAAW,KAAK,CAAC,KAAK,EAAE,MAAM,EA+C7B;IAED;;;;OAIG;IACH,IAAW,aAAa,IAAI,MAAM,CAIjC;IAED;;;;OAIG;IACH,IAAW,qBAAqB,IAAI,MAAM,CAGzC;IAED;;;;OAIG;IACI,sBAAsB,CAAC,QAAQ,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,IAAI;IAkDpE;;;OAGG;IACI,uBAAuB,CAAC,QAAQ,EAAE,gBAAgB,GAAG,IAAI;CA6ChE"}

251
frontend/node_modules/happy-dom/lib/svg/SVGAngle.js generated vendored Normal file
View File

@@ -0,0 +1,251 @@
import SVGAngleTypeEnum from './SVGAngleTypeEnum.js';
import * as PropertySymbol from '../PropertySymbol.js';
const ATTRIBUTE_REGEXP = /^(\d+|\d+\.\d+)(deg|rad|grad|turn|)$/;
/**
* SVG angle.
*
* @see https://developer.mozilla.org/en-US/docs/Web/API/SVGAngle
*/
export default class SVGAngle {
// Static properties
static SVG_ANGLETYPE_UNKNOWN = SVGAngleTypeEnum.unknown;
static SVG_ANGLETYPE_UNSPECIFIED = SVGAngleTypeEnum.unspecified;
static SVG_ANGLETYPE_DEG = SVGAngleTypeEnum.deg;
static SVG_ANGLETYPE_RAD = SVGAngleTypeEnum.rad;
static SVG_ANGLETYPE_GRAD = SVGAngleTypeEnum.grad;
// Internal properties
[PropertySymbol.window];
[PropertySymbol.getAttribute] = null;
[PropertySymbol.setAttribute] = null;
[PropertySymbol.attributeValue] = '';
[PropertySymbol.readOnly] = false;
/**
* Constructor.
*
* @param illegalConstructorSymbol Illegal constructor symbol.
* @param window Window.
* @param [options] Options.
* @param [options.readOnly] Read only.
* @param [options.getAttribute] Get attribute.
* @param [options.setAttribute] Set attribute.
*/
constructor(illegalConstructorSymbol, window, options) {
if (illegalConstructorSymbol !== PropertySymbol.illegalConstructor) {
throw new TypeError('Illegal constructor');
}
this[PropertySymbol.window] = window;
if (options) {
this[PropertySymbol.readOnly] = !!options.readOnly;
this[PropertySymbol.getAttribute] = options.getAttribute || null;
this[PropertySymbol.setAttribute] = options.setAttribute || null;
}
}
/**
* Returns unit type.
*
* @returns Unit type.
*/
get unitType() {
const attributeValue = this[PropertySymbol.getAttribute]
? this[PropertySymbol.getAttribute]()
: this[PropertySymbol.attributeValue];
const match = attributeValue?.match(ATTRIBUTE_REGEXP);
if (!match) {
return SVGAngleTypeEnum.unknown;
}
if (isNaN(parseFloat(match[1]))) {
return SVGAngleTypeEnum.unknown;
}
switch (match[2]) {
case '':
return SVGAngleTypeEnum.unspecified;
case 'deg':
return SVGAngleTypeEnum.deg;
case 'rad':
return SVGAngleTypeEnum.rad;
case 'grad':
return SVGAngleTypeEnum.grad;
case 'turn':
return SVGAngleTypeEnum.unknown;
default:
return SVGAngleTypeEnum.unspecified;
}
}
/**
* Returns value.
*
* @returns Value.
*/
get value() {
const attributeValue = this[PropertySymbol.getAttribute]
? this[PropertySymbol.getAttribute]()
: this[PropertySymbol.attributeValue];
const match = attributeValue?.match(ATTRIBUTE_REGEXP);
if (!match) {
return 0;
}
const parsedValue = parseFloat(match[1]);
if (isNaN(parsedValue)) {
return 0;
}
switch (match[2]) {
case '':
return parsedValue;
case 'deg':
return parsedValue;
case 'rad':
return parsedValue * (180 / Math.PI);
case 'grad':
return parsedValue * (180 / 200);
case 'turn':
return parsedValue * 360;
default:
return parsedValue;
}
}
/**
* Sets value.
*
* @param value Value in pixels.
*/
set value(value) {
if (this[PropertySymbol.readOnly]) {
throw new this[PropertySymbol.window].TypeError(`Failed to set the 'value' property on 'SVGAngle': The object is read-only.`);
}
// Value in pixels
value = typeof value !== 'number' ? parseFloat(String(value)) : value;
if (isNaN(value)) {
throw new this[PropertySymbol.window].TypeError(`Failed to set the 'value' property on 'SVGAngle': The provided float value is non-finite.`);
}
let unitType = '';
let valueInSpecifiedUnits = value;
switch (this.unitType) {
case SVGAngleTypeEnum.unspecified:
valueInSpecifiedUnits = value;
unitType = '';
break;
case SVGAngleTypeEnum.deg:
valueInSpecifiedUnits = value;
unitType = 'deg';
break;
case SVGAngleTypeEnum.rad:
valueInSpecifiedUnits = value / (180 / Math.PI);
unitType = 'rad';
break;
case SVGAngleTypeEnum.grad:
valueInSpecifiedUnits = value / (180 / 200);
unitType = 'grad';
break;
case SVGAngleTypeEnum.unknown:
valueInSpecifiedUnits = value / 360;
unitType = 'turn';
default:
break;
}
this[PropertySymbol.attributeValue] = String(valueInSpecifiedUnits) + unitType;
if (this[PropertySymbol.setAttribute]) {
this[PropertySymbol.setAttribute](this[PropertySymbol.attributeValue]);
}
}
/**
* Returns value as string.
*
* @returns Value as string.
*/
get valueAsString() {
return this[PropertySymbol.getAttribute]
? this[PropertySymbol.getAttribute]() || '0'
: this[PropertySymbol.attributeValue] || '0';
}
/**
* Returns value in specified units.
*
* @returns Value in specified units.
*/
get valueInSpecifiedUnits() {
const attributeValue = this.valueAsString;
return parseFloat(attributeValue) || 0;
}
/**
* New value specific units.
* @param unitType
* @param value
*/
newValueSpecifiedUnits(unitType, value) {
if (this[PropertySymbol.readOnly]) {
throw new this[PropertySymbol.window].TypeError(`Failed to execute 'newValueSpecifiedUnits' on 'SVGAngle': The object is read-only.`);
}
if (typeof unitType !== 'number') {
throw new this[PropertySymbol.window].TypeError(`Failed to execute 'newValueSpecifiedUnits' on 'SVGAngle': parameter 1 ('unitType') is not of type 'number'.`);
}
value = typeof value !== 'number' ? parseFloat(value) : value;
if (isNaN(value)) {
throw new this[PropertySymbol.window].TypeError(`Failed to execute 'newValueSpecifiedUnits' on 'SVGAngle': The provided float value is non-finite.`);
}
let unit = '';
switch (unitType) {
case SVGAngleTypeEnum.unspecified:
unit = '';
break;
case SVGAngleTypeEnum.deg:
unit = 'deg';
break;
case SVGAngleTypeEnum.rad:
unit = 'rad';
break;
case SVGAngleTypeEnum.grad:
unit = 'grad';
break;
case SVGAngleTypeEnum.unknown:
unit = 'turn';
break;
default:
break;
}
this[PropertySymbol.attributeValue] = String(value) + unit;
if (this[PropertySymbol.setAttribute]) {
this[PropertySymbol.setAttribute](this[PropertySymbol.attributeValue]);
}
}
/**
* Convert to specific units.
* @param unitType
*/
convertToSpecifiedUnits(unitType) {
if (this[PropertySymbol.readOnly]) {
throw new this[PropertySymbol.window].TypeError(`Failed to execute 'convertToSpecifiedUnits' on 'SVGAngle': The object is read-only.`);
}
if (typeof unitType !== 'number') {
throw new this[PropertySymbol.window].TypeError(`Failed to execute 'convertToSpecifiedUnits' on 'SVGAngle': parameter 1 ('unitType') is not of type 'number'.`);
}
let value = this.value;
let unit = '';
switch (unitType) {
case SVGAngleTypeEnum.unspecified:
unit = '';
break;
case SVGAngleTypeEnum.deg:
unit = 'deg';
break;
case SVGAngleTypeEnum.rad:
unit = 'rad';
value = value / (180 / Math.PI);
break;
case SVGAngleTypeEnum.grad:
unit = 'grad';
value = value / (180 / 200);
break;
case SVGAngleTypeEnum.unknown:
unit = 'turn';
value = value / 360;
break;
default:
break;
}
this[PropertySymbol.attributeValue] = String(value) + unit;
if (this[PropertySymbol.setAttribute]) {
this[PropertySymbol.setAttribute](this[PropertySymbol.attributeValue]);
}
}
}
//# sourceMappingURL=SVGAngle.js.map

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1,9 @@
declare enum SVGAngleTypeEnum {
unknown = 0,
unspecified = 1,
deg = 2,
rad = 3,
grad = 4
}
export default SVGAngleTypeEnum;
//# sourceMappingURL=SVGAngleTypeEnum.d.ts.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"SVGAngleTypeEnum.d.ts","sourceRoot":"","sources":["../../src/svg/SVGAngleTypeEnum.ts"],"names":[],"mappings":"AAAA,aAAK,gBAAgB;IACpB,OAAO,IAAI;IACX,WAAW,IAAI;IACf,GAAG,IAAI;IACP,GAAG,IAAI;IACP,IAAI,IAAI;CACR;AAED,eAAe,gBAAgB,CAAC"}

View File

@@ -0,0 +1,10 @@
var SVGAngleTypeEnum;
(function (SVGAngleTypeEnum) {
SVGAngleTypeEnum[SVGAngleTypeEnum["unknown"] = 0] = "unknown";
SVGAngleTypeEnum[SVGAngleTypeEnum["unspecified"] = 1] = "unspecified";
SVGAngleTypeEnum[SVGAngleTypeEnum["deg"] = 2] = "deg";
SVGAngleTypeEnum[SVGAngleTypeEnum["rad"] = 3] = "rad";
SVGAngleTypeEnum[SVGAngleTypeEnum["grad"] = 4] = "grad";
})(SVGAngleTypeEnum || (SVGAngleTypeEnum = {}));
export default SVGAngleTypeEnum;
//# sourceMappingURL=SVGAngleTypeEnum.js.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"SVGAngleTypeEnum.js","sourceRoot":"","sources":["../../src/svg/SVGAngleTypeEnum.ts"],"names":[],"mappings":"AAAA,IAAK,gBAMJ;AAND,WAAK,gBAAgB;IACpB,6DAAW,CAAA;IACX,qEAAe,CAAA;IACf,qDAAO,CAAA;IACP,qDAAO,CAAA;IACP,uDAAQ,CAAA;AACT,CAAC,EANI,gBAAgB,KAAhB,gBAAgB,QAMpB;AAED,eAAe,gBAAgB,CAAC"}

View File

@@ -0,0 +1,53 @@
import * as PropertySymbol from '../PropertySymbol.js';
import SVGAngle from './SVGAngle.js';
import BrowserWindow from '../window/BrowserWindow.js';
/**
* SVG Animated Angle.
*
* @see https://developer.mozilla.org/en-US/docs/Web/API/SVGAnimatedAngle
*/
export default class SVGAnimatedAngle {
[PropertySymbol.window]: BrowserWindow;
[PropertySymbol.getAttribute]: () => string;
[PropertySymbol.setAttribute]: (value: string) => void;
[PropertySymbol.baseVal]: SVGAngle | null;
[PropertySymbol.animVal]: SVGAngle | null;
/**
* Constructor.
*
* @param illegalConstructorSymbol Illegal constructor symbol.
* @param window Window.
* @param options Options.
* @param options.getAttribute Get attribute.
* @param options.setAttribute Set attribute.
*/
constructor(illegalConstructorSymbol: symbol, window: BrowserWindow, options: {
getAttribute: () => string | null;
setAttribute: (value: string) => void;
});
/**
* Returns animated value.
*
* @returns Animated value.
*/
get animVal(): SVGAngle;
/**
* Sets animated value.
*
* @param value Animated value.
*/
set animVal(_value: SVGAngle);
/**
* Returns base value.
*
* @returns Base value.
*/
get baseVal(): SVGAngle;
/**
* Sets base value.
*
* @param value Base value.
*/
set baseVal(_value: SVGAngle);
}
//# sourceMappingURL=SVGAnimatedAngle.d.ts.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"SVGAnimatedAngle.d.ts","sourceRoot":"","sources":["../../src/svg/SVGAnimatedAngle.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,cAAc,MAAM,sBAAsB,CAAC;AACvD,OAAO,QAAQ,MAAM,eAAe,CAAC;AACrC,OAAO,aAAa,MAAM,4BAA4B,CAAC;AAEvD;;;;GAIG;AACH,MAAM,CAAC,OAAO,OAAO,gBAAgB;IAE7B,CAAC,cAAc,CAAC,MAAM,CAAC,EAAE,aAAa,CAAC;IACvC,CAAC,cAAc,CAAC,YAAY,CAAC,EAAE,MAAM,MAAM,CAAC;IAC5C,CAAC,cAAc,CAAC,YAAY,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IACvD,CAAC,cAAc,CAAC,OAAO,CAAC,EAAE,QAAQ,GAAG,IAAI,CAAQ;IACjD,CAAC,cAAc,CAAC,OAAO,CAAC,EAAE,QAAQ,GAAG,IAAI,CAAQ;IAExD;;;;;;;;OAQG;gBAEF,wBAAwB,EAAE,MAAM,EAChC,MAAM,EAAE,aAAa,EACrB,OAAO,EAAE;QACR,YAAY,EAAE,MAAM,MAAM,GAAG,IAAI,CAAC;QAClC,YAAY,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;KACtC;IAYF;;;;OAIG;IACH,IAAW,OAAO,IAAI,QAAQ,CAY7B;IAED;;;;OAIG;IACH,IAAW,OAAO,CAAC,MAAM,EAnBH,QAmBG,EAExB;IAED;;;;OAIG;IACH,IAAW,OAAO,IAAI,QAAQ,CAY7B;IAED;;;;OAIG;IACH,IAAW,OAAO,CAAC,MAAM,EAnBH,QAmBG,EAExB;CACD"}

View File

@@ -0,0 +1,77 @@
import * as PropertySymbol from '../PropertySymbol.js';
import SVGAngle from './SVGAngle.js';
/**
* SVG Animated Angle.
*
* @see https://developer.mozilla.org/en-US/docs/Web/API/SVGAnimatedAngle
*/
export default class SVGAnimatedAngle {
// Internal properties
[PropertySymbol.window];
[PropertySymbol.getAttribute];
[PropertySymbol.setAttribute];
[PropertySymbol.baseVal] = null;
[PropertySymbol.animVal] = null;
/**
* Constructor.
*
* @param illegalConstructorSymbol Illegal constructor symbol.
* @param window Window.
* @param options Options.
* @param options.getAttribute Get attribute.
* @param options.setAttribute Set attribute.
*/
constructor(illegalConstructorSymbol, window, options) {
if (illegalConstructorSymbol !== PropertySymbol.illegalConstructor) {
throw new TypeError('Illegal constructor');
}
this[PropertySymbol.window] = window;
this[PropertySymbol.getAttribute] = options.getAttribute;
this[PropertySymbol.setAttribute] = options.setAttribute;
}
/**
* Returns animated value.
*
* @returns Animated value.
*/
get animVal() {
if (!this[PropertySymbol.animVal]) {
this[PropertySymbol.animVal] = new SVGAngle(PropertySymbol.illegalConstructor, this[PropertySymbol.window], {
readOnly: true,
getAttribute: this[PropertySymbol.getAttribute]
});
}
return this[PropertySymbol.animVal];
}
/**
* Sets animated value.
*
* @param value Animated value.
*/
set animVal(_value) {
// Do nothing
}
/**
* Returns base value.
*
* @returns Base value.
*/
get baseVal() {
if (!this[PropertySymbol.baseVal]) {
this[PropertySymbol.baseVal] = new SVGAngle(PropertySymbol.illegalConstructor, this[PropertySymbol.window], {
getAttribute: this[PropertySymbol.getAttribute],
setAttribute: this[PropertySymbol.setAttribute]
});
}
return this[PropertySymbol.baseVal];
}
/**
* Sets base value.
*
* @param value Base value.
*/
set baseVal(_value) {
// Do nothing
}
}
//# sourceMappingURL=SVGAnimatedAngle.js.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"SVGAnimatedAngle.js","sourceRoot":"","sources":["../../src/svg/SVGAnimatedAngle.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,cAAc,MAAM,sBAAsB,CAAC;AACvD,OAAO,QAAQ,MAAM,eAAe,CAAC;AAGrC;;;;GAIG;AACH,MAAM,CAAC,OAAO,OAAO,gBAAgB;IACpC,sBAAsB;IACf,CAAC,cAAc,CAAC,MAAM,CAAC,CAAgB;IACvC,CAAC,cAAc,CAAC,YAAY,CAAC,CAAe;IAC5C,CAAC,cAAc,CAAC,YAAY,CAAC,CAA0B;IACvD,CAAC,cAAc,CAAC,OAAO,CAAC,GAAoB,IAAI,CAAC;IACjD,CAAC,cAAc,CAAC,OAAO,CAAC,GAAoB,IAAI,CAAC;IAExD;;;;;;;;OAQG;IACH,YACC,wBAAgC,EAChC,MAAqB,EACrB,OAGC;QAED,IAAI,wBAAwB,KAAK,cAAc,CAAC,kBAAkB,EAAE,CAAC;YACpE,MAAM,IAAI,SAAS,CAAC,qBAAqB,CAAC,CAAC;QAC5C,CAAC;QAED,IAAI,CAAC,cAAc,CAAC,MAAM,CAAC,GAAG,MAAM,CAAC;QAErC,IAAI,CAAC,cAAc,CAAC,YAAY,CAAC,GAAG,OAAO,CAAC,YAAY,CAAC;QACzD,IAAI,CAAC,cAAc,CAAC,YAAY,CAAC,GAAG,OAAO,CAAC,YAAY,CAAC;IAC1D,CAAC;IAED;;;;OAIG;IACH,IAAW,OAAO;QACjB,IAAI,CAAC,IAAI,CAAC,cAAc,CAAC,OAAO,CAAC,EAAE,CAAC;YACnC,IAAI,CAAC,cAAc,CAAC,OAAO,CAAC,GAAG,IAAI,QAAQ,CAC1C,cAAc,CAAC,kBAAkB,EACjC,IAAI,CAAC,cAAc,CAAC,MAAM,CAAC,EAC3B;gBACC,QAAQ,EAAE,IAAI;gBACd,YAAY,EAAE,IAAI,CAAC,cAAc,CAAC,YAAY,CAAC;aAC/C,CACD,CAAC;QACH,CAAC;QACD,OAAO,IAAI,CAAC,cAAc,CAAC,OAAO,CAAC,CAAC;IACrC,CAAC;IAED;;;;OAIG;IACH,IAAW,OAAO,CAAC,MAAM;QACxB,aAAa;IACd,CAAC;IAED;;;;OAIG;IACH,IAAW,OAAO;QACjB,IAAI,CAAC,IAAI,CAAC,cAAc,CAAC,OAAO,CAAC,EAAE,CAAC;YACnC,IAAI,CAAC,cAAc,CAAC,OAAO,CAAC,GAAG,IAAI,QAAQ,CAC1C,cAAc,CAAC,kBAAkB,EACjC,IAAI,CAAC,cAAc,CAAC,MAAM,CAAC,EAC3B;gBACC,YAAY,EAAE,IAAI,CAAC,cAAc,CAAC,YAAY,CAAC;gBAC/C,YAAY,EAAE,IAAI,CAAC,cAAc,CAAC,YAAY,CAAC;aAC/C,CACD,CAAC;QACH,CAAC;QACD,OAAO,IAAI,CAAC,cAAc,CAAC,OAAO,CAAC,CAAC;IACrC,CAAC;IAED;;;;OAIG;IACH,IAAW,OAAO,CAAC,MAAM;QACxB,aAAa;IACd,CAAC;CACD"}

View File

@@ -0,0 +1,50 @@
import * as PropertySymbol from '../PropertySymbol.js';
import BrowserWindow from '../window/BrowserWindow.js';
/**
* SVG Animated Boolean.
*
* @see https://developer.mozilla.org/en-US/docs/Web/API/SVGAnimatedBoolean
*/
export default class SVGAnimatedBoolean {
[PropertySymbol.window]: BrowserWindow;
[PropertySymbol.getAttribute]: (() => string | null) | null;
[PropertySymbol.setAttribute]: ((value: string) => void) | null;
/**
* Constructor.
*
* @param illegalConstructorSymbol Illegal constructor symbol.
* @param window Window.
* @param options Options.
* @param options.getAttribute Get attribute.
* @param options.setAttribute Set attribute.
*/
constructor(illegalConstructorSymbol: symbol, window: BrowserWindow, options: {
getAttribute: () => string | null;
setAttribute: (value: string) => void;
});
/**
* Returns animated value.
*
* @returns Animated value.
*/
get animVal(): boolean;
/**
* Returns animated value.
*
* @param value Animated value.
*/
set animVal(_value: boolean);
/**
* Returns base value.
*
* @returns Base value.
*/
get baseVal(): boolean;
/**
* Sets base value.
*
* @param value Base value.
*/
set baseVal(value: boolean);
}
//# sourceMappingURL=SVGAnimatedBoolean.d.ts.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"SVGAnimatedBoolean.d.ts","sourceRoot":"","sources":["../../src/svg/SVGAnimatedBoolean.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,cAAc,MAAM,sBAAsB,CAAC;AACvD,OAAO,aAAa,MAAM,4BAA4B,CAAC;AAEvD;;;;GAIG;AACH,MAAM,CAAC,OAAO,OAAO,kBAAkB;IAE/B,CAAC,cAAc,CAAC,MAAM,CAAC,EAAE,aAAa,CAAC;IACvC,CAAC,cAAc,CAAC,YAAY,CAAC,EAAE,CAAC,MAAM,MAAM,GAAG,IAAI,CAAC,GAAG,IAAI,CAAQ;IACnE,CAAC,cAAc,CAAC,YAAY,CAAC,EAAE,CAAC,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC,GAAG,IAAI,CAAQ;IAE9E;;;;;;;;OAQG;gBAEF,wBAAwB,EAAE,MAAM,EAChC,MAAM,EAAE,aAAa,EACrB,OAAO,EAAE;QACR,YAAY,EAAE,MAAM,MAAM,GAAG,IAAI,CAAC;QAClC,YAAY,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;KACtC;IAYF;;;;OAIG;IACH,IAAW,OAAO,IAAI,OAAO,CAE5B;IAED;;;;OAIG;IACH,IAAW,OAAO,CAAC,MAAM,EATH,OASG,EAExB;IAED;;;;OAIG;IACH,IAAW,OAAO,IAAI,OAAO,CAG5B;IAED;;;;OAIG;IACH,IAAW,OAAO,CAAC,KAAK,EAAE,OAAO,EAIhC;CACD"}

View File

@@ -0,0 +1,63 @@
import * as PropertySymbol from '../PropertySymbol.js';
/**
* SVG Animated Boolean.
*
* @see https://developer.mozilla.org/en-US/docs/Web/API/SVGAnimatedBoolean
*/
export default class SVGAnimatedBoolean {
// Internal properties
[PropertySymbol.window];
[PropertySymbol.getAttribute] = null;
[PropertySymbol.setAttribute] = null;
/**
* Constructor.
*
* @param illegalConstructorSymbol Illegal constructor symbol.
* @param window Window.
* @param options Options.
* @param options.getAttribute Get attribute.
* @param options.setAttribute Set attribute.
*/
constructor(illegalConstructorSymbol, window, options) {
if (illegalConstructorSymbol !== PropertySymbol.illegalConstructor) {
throw new TypeError('Illegal constructor');
}
this[PropertySymbol.window] = window;
this[PropertySymbol.getAttribute] = options.getAttribute;
this[PropertySymbol.setAttribute] = options.setAttribute;
}
/**
* Returns animated value.
*
* @returns Animated value.
*/
get animVal() {
return this.baseVal;
}
/**
* Returns animated value.
*
* @param value Animated value.
*/
set animVal(_value) {
// Do nothing
}
/**
* Returns base value.
*
* @returns Base value.
*/
get baseVal() {
const attributeValue = this[PropertySymbol.getAttribute]();
return attributeValue === 'true';
}
/**
* Sets base value.
*
* @param value Base value.
*/
set baseVal(value) {
this[PropertySymbol.setAttribute](typeof value !== 'boolean' ? String(Boolean(value)) : String(value));
}
}
//# sourceMappingURL=SVGAnimatedBoolean.js.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"SVGAnimatedBoolean.js","sourceRoot":"","sources":["../../src/svg/SVGAnimatedBoolean.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,cAAc,MAAM,sBAAsB,CAAC;AAGvD;;;;GAIG;AACH,MAAM,CAAC,OAAO,OAAO,kBAAkB;IACtC,sBAAsB;IACf,CAAC,cAAc,CAAC,MAAM,CAAC,CAAgB;IACvC,CAAC,cAAc,CAAC,YAAY,CAAC,GAAiC,IAAI,CAAC;IACnE,CAAC,cAAc,CAAC,YAAY,CAAC,GAAqC,IAAI,CAAC;IAE9E;;;;;;;;OAQG;IACH,YACC,wBAAgC,EAChC,MAAqB,EACrB,OAGC;QAED,IAAI,wBAAwB,KAAK,cAAc,CAAC,kBAAkB,EAAE,CAAC;YACpE,MAAM,IAAI,SAAS,CAAC,qBAAqB,CAAC,CAAC;QAC5C,CAAC;QAED,IAAI,CAAC,cAAc,CAAC,MAAM,CAAC,GAAG,MAAM,CAAC;QAErC,IAAI,CAAC,cAAc,CAAC,YAAY,CAAC,GAAG,OAAO,CAAC,YAAY,CAAC;QACzD,IAAI,CAAC,cAAc,CAAC,YAAY,CAAC,GAAG,OAAO,CAAC,YAAY,CAAC;IAC1D,CAAC;IAED;;;;OAIG;IACH,IAAW,OAAO;QACjB,OAAO,IAAI,CAAC,OAAO,CAAC;IACrB,CAAC;IAED;;;;OAIG;IACH,IAAW,OAAO,CAAC,MAAM;QACxB,aAAa;IACd,CAAC;IAED;;;;OAIG;IACH,IAAW,OAAO;QACjB,MAAM,cAAc,GAAG,IAAI,CAAC,cAAc,CAAC,YAAY,CAAC,EAAE,CAAC;QAC3D,OAAO,cAAc,KAAK,MAAM,CAAC;IAClC,CAAC;IAED;;;;OAIG;IACH,IAAW,OAAO,CAAC,KAAc;QAChC,IAAI,CAAC,cAAc,CAAC,YAAY,CAAC,CAChC,OAAO,KAAK,KAAK,SAAS,CAAC,CAAC,CAAC,MAAM,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CACnE,CAAC;IACH,CAAC;CACD"}

View File

@@ -0,0 +1,56 @@
import * as PropertySymbol from '../PropertySymbol.js';
import BrowserWindow from '../window/BrowserWindow.js';
/**
* SVG Animated Enumaration.
*
* @see https://developer.mozilla.org/en-US/docs/Web/API/SVGAnimatedEnumeration
*/
export default class SVGAnimatedEnumeration {
[PropertySymbol.window]: BrowserWindow;
[PropertySymbol.getAttribute]: () => string;
[PropertySymbol.setAttribute]: (value: string) => void;
[PropertySymbol.values]: Array<string | null>;
[PropertySymbol.defaultValue]: string;
/**
* Constructor.
*
* @param illegalConstructorSymbol Illegal constructor symbol.
* @param window Window.
* @param options Options.
* @param options.getAttribute Get attribute.
* @param options.setAttribute Set attribute.
* @param options.values Values.
* @param options.defaultValue Default value.
*/
constructor(illegalConstructorSymbol: symbol, window: BrowserWindow, options: {
getAttribute: () => string | null;
setAttribute: (value: string) => void;
values: Array<string | null>;
defaultValue: string;
});
/**
* Returns animated value.
*
* @returns Animated value.
*/
get animVal(): number;
/**
* Returns animated value.
*
* @param _value Animated value.
*/
set animVal(_value: number);
/**
* Returns base value.
*
* @returns Base value.
*/
get baseVal(): number;
/**
* Sets base value.
*
* @param value Base value.
*/
set baseVal(value: number);
}
//# sourceMappingURL=SVGAnimatedEnumeration.d.ts.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"SVGAnimatedEnumeration.d.ts","sourceRoot":"","sources":["../../src/svg/SVGAnimatedEnumeration.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,cAAc,MAAM,sBAAsB,CAAC;AACvD,OAAO,aAAa,MAAM,4BAA4B,CAAC;AAEvD;;;;GAIG;AACH,MAAM,CAAC,OAAO,OAAO,sBAAsB;IAEnC,CAAC,cAAc,CAAC,MAAM,CAAC,EAAE,aAAa,CAAC;IACvC,CAAC,cAAc,CAAC,YAAY,CAAC,EAAE,MAAM,MAAM,CAAC;IAC5C,CAAC,cAAc,CAAC,YAAY,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IACvD,CAAC,cAAc,CAAC,MAAM,CAAC,EAAE,KAAK,CAAC,MAAM,GAAG,IAAI,CAAC,CAAC;IAC9C,CAAC,cAAc,CAAC,YAAY,CAAC,EAAE,MAAM,CAAC;IAE7C;;;;;;;;;;OAUG;gBAEF,wBAAwB,EAAE,MAAM,EAChC,MAAM,EAAE,aAAa,EACrB,OAAO,EAAE;QACR,YAAY,EAAE,MAAM,MAAM,GAAG,IAAI,CAAC;QAClC,YAAY,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;QACtC,MAAM,EAAE,KAAK,CAAC,MAAM,GAAG,IAAI,CAAC,CAAC;QAC7B,YAAY,EAAE,MAAM,CAAC;KACrB;IAcF;;;;OAIG;IACH,IAAW,OAAO,IAAI,MAAM,CAE3B;IAED;;;;OAIG;IACH,IAAW,OAAO,CAAC,MAAM,EATH,MASG,EAExB;IAED;;;;OAIG;IACH,IAAW,OAAO,IAAI,MAAM,CAW3B;IAED;;;;OAIG;IACH,IAAW,OAAO,CAAC,KAAK,EAAE,MAAM,EA2B/B;CACD"}

View File

@@ -0,0 +1,94 @@
import * as PropertySymbol from '../PropertySymbol.js';
/**
* SVG Animated Enumaration.
*
* @see https://developer.mozilla.org/en-US/docs/Web/API/SVGAnimatedEnumeration
*/
export default class SVGAnimatedEnumeration {
// Internal properties
[PropertySymbol.window];
[PropertySymbol.getAttribute];
[PropertySymbol.setAttribute];
[PropertySymbol.values];
[PropertySymbol.defaultValue];
/**
* Constructor.
*
* @param illegalConstructorSymbol Illegal constructor symbol.
* @param window Window.
* @param options Options.
* @param options.getAttribute Get attribute.
* @param options.setAttribute Set attribute.
* @param options.values Values.
* @param options.defaultValue Default value.
*/
constructor(illegalConstructorSymbol, window, options) {
if (illegalConstructorSymbol !== PropertySymbol.illegalConstructor) {
throw new TypeError('Illegal constructor');
}
this[PropertySymbol.window] = window;
this[PropertySymbol.getAttribute] = options.getAttribute;
this[PropertySymbol.setAttribute] = options.setAttribute;
this[PropertySymbol.values] = options.values;
this[PropertySymbol.defaultValue] = options.defaultValue;
}
/**
* Returns animated value.
*
* @returns Animated value.
*/
get animVal() {
return this.baseVal;
}
/**
* Returns animated value.
*
* @param _value Animated value.
*/
set animVal(_value) {
// Do nothing
}
/**
* Returns base value.
*
* @returns Base value.
*/
get baseVal() {
const value = this[PropertySymbol.getAttribute]();
if (!value) {
return this[PropertySymbol.values].indexOf(this[PropertySymbol.defaultValue]) + 1;
}
const index = this[PropertySymbol.values].indexOf(value);
if (index === -1) {
const anyValueIndex = this[PropertySymbol.values].indexOf(null);
return anyValueIndex !== -1 ? anyValueIndex + 1 : 0;
}
return index + 1;
}
/**
* Sets base value.
*
* @param value Base value.
*/
set baseVal(value) {
let parsedValue = Number(value);
if (isNaN(parsedValue)) {
parsedValue = 0;
}
if (parsedValue < 1) {
throw new TypeError(`Failed to set the 'baseVal' property on 'SVGAnimatedEnumeration': The enumeration value provided is ${parsedValue}, which is not settable.`);
}
if (parsedValue > this[PropertySymbol.values].length) {
throw new TypeError(`Failed to set the 'baseVal' property on 'SVGAnimatedEnumeration': The enumeration value provided (${parsedValue}) is larger than the largest allowed value (${this[PropertySymbol.values].length}).`);
}
const currentValue = this[PropertySymbol.getAttribute]();
const isAnyValue = this[PropertySymbol.values][parsedValue - 1] === null;
const newValue = isAnyValue ? '0' : this[PropertySymbol.values][parsedValue - 1];
if (!currentValue ||
(isAnyValue && this[PropertySymbol.values].includes(currentValue)) ||
(!isAnyValue && currentValue !== newValue)) {
this[PropertySymbol.setAttribute](newValue);
}
}
}
//# sourceMappingURL=SVGAnimatedEnumeration.js.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"SVGAnimatedEnumeration.js","sourceRoot":"","sources":["../../src/svg/SVGAnimatedEnumeration.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,cAAc,MAAM,sBAAsB,CAAC;AAGvD;;;;GAIG;AACH,MAAM,CAAC,OAAO,OAAO,sBAAsB;IAC1C,sBAAsB;IACf,CAAC,cAAc,CAAC,MAAM,CAAC,CAAgB;IACvC,CAAC,cAAc,CAAC,YAAY,CAAC,CAAe;IAC5C,CAAC,cAAc,CAAC,YAAY,CAAC,CAA0B;IACvD,CAAC,cAAc,CAAC,MAAM,CAAC,CAAuB;IAC9C,CAAC,cAAc,CAAC,YAAY,CAAC,CAAS;IAE7C;;;;;;;;;;OAUG;IACH,YACC,wBAAgC,EAChC,MAAqB,EACrB,OAKC;QAED,IAAI,wBAAwB,KAAK,cAAc,CAAC,kBAAkB,EAAE,CAAC;YACpE,MAAM,IAAI,SAAS,CAAC,qBAAqB,CAAC,CAAC;Q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AC,KAAa;QAC/B,IAAI,WAAW,GAAG,MAAM,CAAC,KAAK,CAAC,CAAC;QAChC,IAAI,KAAK,CAAC,WAAW,CAAC,EAAE,CAAC;YACxB,WAAW,GAAG,CAAC,CAAC;QACjB,CAAC;QACD,IAAI,WAAW,GAAG,CAAC,EAAE,CAAC;YACrB,MAAM,IAAI,SAAS,CAClB,uGAAuG,WAAW,0BAA0B,CAC5I,CAAC;QACH,CAAC;QACD,IAAI,WAAW,GAAG,IAAI,CAAC,cAAc,CAAC,MAAM,CAAC,CAAC,MAAM,EAAE,CAAC;YACtD,MAAM,IAAI,SAAS,CAClB,qGAAqG,WAAW,+CAC/G,IAAI,CAAC,cAAc,CAAC,MAAM,CAAC,CAAC,MAC7B,IAAI,CACJ,CAAC;QACH,CAAC;QACD,MAAM,YAAY,GAAG,IAAI,CAAC,cAAc,CAAC,YAAY,CAAC,EAAE,CAAC;QACzD,MAAM,UAAU,GAAG,IAAI,CAAC,cAAc,CAAC,MAAM,CAAC,CAAC,WAAW,GAAG,CAAC,CAAC,KAAK,IAAI,CAAC;QACzE,MAAM,QAAQ,GAAG,UAAU,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,IAAI,CAAC,cAAc,CAAC,MAAM,CAAC,CAAC,WAAW,GAAG,CAAC,CAAC,CAAC;QACjF,IACC,CAAC,YAAY;YACb,CAAC,UAAU,IAAI,IAAI,CAAC,cAAc,CAAC,MAAM,CAAC,CAAC,QAAQ,CAAC,YAAY,CAAC,CAAC;YAClE,CAAC,CAAC,UAAU,IAAI,YAAY,KAAK,QAAQ,CAAC,EACzC,CAAC;YACF,IAAI,CAAC,cAAc,CAAC,YAAY,CAAC,CAAC,QAAQ,CAAC,CAAC;QAC7C,CAAC;IACF,CAAC;CACD"}

View File

@@ -0,0 +1,50 @@
import * as PropertySymbol from '../PropertySymbol.js';
import BrowserWindow from '../window/BrowserWindow.js';
/**
* SVG Animated Integer.
*
* @see https://developer.mozilla.org/en-US/docs/Web/API/SVGAnimatedInteger
*/
export default class SVGAnimatedInteger {
[PropertySymbol.window]: BrowserWindow;
[PropertySymbol.getAttribute]: (() => string | null) | null;
[PropertySymbol.setAttribute]: ((value: string) => void) | null;
/**
* Constructor.
*
* @param illegalConstructorSymbol Illegal constructor symbol.
* @param window Window.
* @param options Options.
* @param options.getAttribute Get attribute.
* @param options.setAttribute Set attribute.
*/
constructor(illegalConstructorSymbol: symbol, window: BrowserWindow, options: {
getAttribute: () => string | null;
setAttribute: (value: string) => void;
});
/**
* Returns animated value.
*
* @returns Animated value.
*/
get animVal(): number;
/**
* Returns animated value.
*
* @param value Animated value.
*/
set animVal(_value: number);
/**
* Returns base value.
*
* @returns Base value.
*/
get baseVal(): number;
/**
* Sets base value.
*
* @param value Base value.
*/
set baseVal(value: number);
}
//# sourceMappingURL=SVGAnimatedInteger.d.ts.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"SVGAnimatedInteger.d.ts","sourceRoot":"","sources":["../../src/svg/SVGAnimatedInteger.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,cAAc,MAAM,sBAAsB,CAAC;AACvD,OAAO,aAAa,MAAM,4BAA4B,CAAC;AAEvD;;;;GAIG;AACH,MAAM,CAAC,OAAO,OAAO,kBAAkB;IAE/B,CAAC,cAAc,CAAC,MAAM,CAAC,EAAE,aAAa,CAAC;IACvC,CAAC,cAAc,CAAC,YAAY,CAAC,EAAE,CAAC,MAAM,MAAM,GAAG,IAAI,CAAC,GAAG,IAAI,CAAQ;IACnE,CAAC,cAAc,CAAC,YAAY,CAAC,EAAE,CAAC,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC,GAAG,IAAI,CAAQ;IAE9E;;;;;;;;OAQG;gBAEF,wBAAwB,EAAE,MAAM,EAChC,MAAM,EAAE,aAAa,EACrB,OAAO,EAAE;QACR,YAAY,EAAE,MAAM,MAAM,GAAG,IAAI,CAAC;QAClC,YAAY,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;KACtC;IAYF;;;;OAIG;IACH,IAAW,OAAO,IAAI,MAAM,CAE3B;IAED;;;;OAIG;IACH,IAAW,OAAO,CAAC,MAAM,EATH,MASG,EAExB;IAED;;;;OAIG;IACH,IAAW,OAAO,IAAI,MAAM,CAc3B;IAED;;;;OAIG;IACH,IAAW,OAAO,CAAC,KAAK,EAAE,MAAM,EAU/B;CACD"}

View File

@@ -0,0 +1,74 @@
import * as PropertySymbol from '../PropertySymbol.js';
/**
* SVG Animated Integer.
*
* @see https://developer.mozilla.org/en-US/docs/Web/API/SVGAnimatedInteger
*/
export default class SVGAnimatedInteger {
// Internal properties
[PropertySymbol.window];
[PropertySymbol.getAttribute] = null;
[PropertySymbol.setAttribute] = null;
/**
* Constructor.
*
* @param illegalConstructorSymbol Illegal constructor symbol.
* @param window Window.
* @param options Options.
* @param options.getAttribute Get attribute.
* @param options.setAttribute Set attribute.
*/
constructor(illegalConstructorSymbol, window, options) {
if (illegalConstructorSymbol !== PropertySymbol.illegalConstructor) {
throw new TypeError('Illegal constructor');
}
this[PropertySymbol.window] = window;
this[PropertySymbol.getAttribute] = options.getAttribute;
this[PropertySymbol.setAttribute] = options.setAttribute;
}
/**
* Returns animated value.
*
* @returns Animated value.
*/
get animVal() {
return this.baseVal;
}
/**
* Returns animated value.
*
* @param value Animated value.
*/
set animVal(_value) {
// Do nothing
}
/**
* Returns base value.
*
* @returns Base value.
*/
get baseVal() {
const attributeValue = this[PropertySymbol.getAttribute]();
if (!attributeValue) {
return 0;
}
const value = parseInt(attributeValue);
if (isNaN(value)) {
return 0;
}
return value;
}
/**
* Sets base value.
*
* @param value Base value.
*/
set baseVal(value) {
const parsedValue = parseInt(String(value));
if (isNaN(parsedValue)) {
throw new this[PropertySymbol.window].TypeError(`TypeError: Failed to set the 'baseVal' property on 'SVGAnimatedInteger': The provided float value is non-finite.`);
}
this[PropertySymbol.setAttribute](String(parsedValue));
}
}
//# sourceMappingURL=SVGAnimatedInteger.js.map

View File

@@ -0,0 +1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AK,CAAC;IACd,CAAC;IAED;;;;OAIG;IACH,IAAW,OAAO,CAAC,KAAa;QAC/B,MAAM,WAAW,GAAG,QAAQ,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC;QAE5C,IAAI,KAAK,CAAC,WAAW,CAAC,EAAE,CAAC;YACxB,MAAM,IAAI,IAAI,CAAC,cAAc,CAAC,MAAM,CAAC,CAAC,SAAS,CAC9C,kHAAkH,CAClH,CAAC;QACH,CAAC;QAED,IAAI,CAAC,cAAc,CAAC,YAAY,CAAC,CAAC,MAAM,CAAC,WAAW,CAAC,CAAC,CAAC;IACxD,CAAC;CACD"}

View File

@@ -0,0 +1,53 @@
import * as PropertySymbol from '../PropertySymbol.js';
import SVGLength from './SVGLength.js';
import BrowserWindow from '../window/BrowserWindow.js';
/**
* SVG Animated Length.
*
* @see https://developer.mozilla.org/en-US/docs/Web/API/SVGAnimatedLength
*/
export default class SVGAnimatedLength {
[PropertySymbol.window]: BrowserWindow;
[PropertySymbol.getAttribute]: () => string;
[PropertySymbol.setAttribute]: (value: string) => void;
[PropertySymbol.baseVal]: SVGLength | null;
[PropertySymbol.animVal]: SVGLength | null;
/**
* Constructor.
*
* @param illegalConstructorSymbol Illegal constructor symbol.
* @param window Window.
* @param options Options.
* @param options.getAttribute Get attribute.
* @param options.setAttribute Set attribute.
*/
constructor(illegalConstructorSymbol: symbol, window: BrowserWindow, options: {
getAttribute: () => string | null;
setAttribute: (value: string) => void;
});
/**
* Returns animated value.
*
* @returns Animated value.
*/
get animVal(): SVGLength;
/**
* Returns animated value.
*
* @param value Animated value.
*/
set animVal(_value: SVGLength);
/**
* Returns base value.
*
* @returns Base value.
*/
get baseVal(): SVGLength;
/**
* Returns base value.
*
* @param value Base value.
*/
set baseVal(_value: SVGLength);
}
//# sourceMappingURL=SVGAnimatedLength.d.ts.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"SVGAnimatedLength.d.ts","sourceRoot":"","sources":["../../src/svg/SVGAnimatedLength.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,cAAc,MAAM,sBAAsB,CAAC;AACvD,OAAO,SAAS,MAAM,gBAAgB,CAAC;AACvC,OAAO,aAAa,MAAM,4BAA4B,CAAC;AAEvD;;;;GAIG;AACH,MAAM,CAAC,OAAO,OAAO,iBAAiB;IAE9B,CAAC,cAAc,CAAC,MAAM,CAAC,EAAE,aAAa,CAAC;IACvC,CAAC,cAAc,CAAC,YAAY,CAAC,EAAE,MAAM,MAAM,CAAC;IAC5C,CAAC,cAAc,CAAC,YAAY,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IACvD,CAAC,cAAc,CAAC,OAAO,CAAC,EAAE,SAAS,GAAG,IAAI,CAAQ;IAClD,CAAC,cAAc,CAAC,OAAO,CAAC,EAAE,SAAS,GAAG,IAAI,CAAQ;IAEzD;;;;;;;;OAQG;gBAEF,wBAAwB,EAAE,MAAM,EAChC,MAAM,EAAE,aAAa,EACrB,OAAO,EAAE;QACR,YAAY,EAAE,MAAM,MAAM,GAAG,IAAI,CAAC;QAClC,YAAY,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;KACtC;IAYF;;;;OAIG;IACH,IAAW,OAAO,IAAI,SAAS,CAY9B;IAED;;;;OAIG;IACH,IAAW,OAAO,CAAC,MAAM,EAnBH,SAmBG,EAExB;IAED;;;;OAIG;IACH,IAAW,OAAO,IAAI,SAAS,CAY9B;IAED;;;;OAIG;IACH,IAAW,OAAO,CAAC,MAAM,EAnBH,SAmBG,EAExB;CACD"}

View File

@@ -0,0 +1,77 @@
import * as PropertySymbol from '../PropertySymbol.js';
import SVGLength from './SVGLength.js';
/**
* SVG Animated Length.
*
* @see https://developer.mozilla.org/en-US/docs/Web/API/SVGAnimatedLength
*/
export default class SVGAnimatedLength {
// Internal properties
[PropertySymbol.window];
[PropertySymbol.getAttribute];
[PropertySymbol.setAttribute];
[PropertySymbol.baseVal] = null;
[PropertySymbol.animVal] = null;
/**
* Constructor.
*
* @param illegalConstructorSymbol Illegal constructor symbol.
* @param window Window.
* @param options Options.
* @param options.getAttribute Get attribute.
* @param options.setAttribute Set attribute.
*/
constructor(illegalConstructorSymbol, window, options) {
if (illegalConstructorSymbol !== PropertySymbol.illegalConstructor) {
throw new TypeError('Illegal constructor');
}
this[PropertySymbol.window] = window;
this[PropertySymbol.getAttribute] = options.getAttribute;
this[PropertySymbol.setAttribute] = options.setAttribute;
}
/**
* Returns animated value.
*
* @returns Animated value.
*/
get animVal() {
if (!this[PropertySymbol.animVal]) {
this[PropertySymbol.animVal] = new SVGLength(PropertySymbol.illegalConstructor, this[PropertySymbol.window], {
readOnly: true,
getAttribute: this[PropertySymbol.getAttribute]
});
}
return this[PropertySymbol.animVal];
}
/**
* Returns animated value.
*
* @param value Animated value.
*/
set animVal(_value) {
// Do nothing
}
/**
* Returns base value.
*
* @returns Base value.
*/
get baseVal() {
if (!this[PropertySymbol.baseVal]) {
this[PropertySymbol.baseVal] = new SVGLength(PropertySymbol.illegalConstructor, this[PropertySymbol.window], {
getAttribute: this[PropertySymbol.getAttribute],
setAttribute: this[PropertySymbol.setAttribute]
});
}
return this[PropertySymbol.baseVal];
}
/**
* Returns base value.
*
* @param value Base value.
*/
set baseVal(_value) {
// Do nothing
}
}
//# sourceMappingURL=SVGAnimatedLength.js.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"SVGAnimatedLength.js","sourceRoot":"","sources":["../../src/svg/SVGAnimatedLength.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,cAAc,MAAM,sBAAsB,CAAC;AACvD,OAAO,SAAS,MAAM,gBAAgB,CAAC;AAGvC;;;;GAIG;AACH,MAAM,CAAC,OAAO,OAAO,iBAAiB;IACrC,sBAAsB;IACf,CAAC,cAAc,CAAC,MAAM,CAAC,CAAgB;IACvC,CAAC,cAAc,CAAC,YAAY,CAAC,CAAe;IAC5C,CAAC,cAAc,CAAC,YAAY,CAAC,CAA0B;IACvD,CAAC,cAAc,CAAC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Ac,CAAC,YAAY,CAAC;gBAC/C,YAAY,EAAE,IAAI,CAAC,cAAc,CAAC,YAAY,CAAC;aAC/C,CACD,CAAC;QACH,CAAC;QACD,OAAO,IAAI,CAAC,cAAc,CAAC,OAAO,CAAC,CAAC;IACrC,CAAC;IAED;;;;OAIG;IACH,IAAW,OAAO,CAAC,MAAM;QACxB,aAAa;IACd,CAAC;CACD"}

View File

@@ -0,0 +1,53 @@
import * as PropertySymbol from '../PropertySymbol.js';
import BrowserWindow from '../window/BrowserWindow.js';
import SVGLengthList from './SVGLengthList.js';
/**
* SVG Animated Length.
*
* @see https://developer.mozilla.org/en-US/docs/Web/API/SVGAnimatedLengthList
*/
export default class SVGAnimatedLengthList {
[PropertySymbol.window]: BrowserWindow;
[PropertySymbol.getAttribute]: () => string;
[PropertySymbol.setAttribute]: (value: string) => void;
[PropertySymbol.baseVal]: SVGLengthList | null;
[PropertySymbol.animVal]: SVGLengthList | null;
/**
* Constructor.
*
* @param illegalConstructorSymbol Illegal constructor symbol.
* @param window Window.
* @param options Options.
* @param options.getAttribute Get attribute.
* @param options.setAttribute Set attribute.
*/
constructor(illegalConstructorSymbol: symbol, window: BrowserWindow, options: {
getAttribute: () => string | null;
setAttribute: (value: string) => void;
});
/**
* Returns animated value.
*
* @returns Animated value.
*/
get animVal(): SVGLengthList;
/**
* Returns animated value.
*
* @param value Animated value.
*/
set animVal(_value: SVGLengthList);
/**
* Returns base value.
*
* @returns Base value.
*/
get baseVal(): SVGLengthList;
/**
* Returns base value.
*
* @param value Base value.
*/
set baseVal(_value: SVGLengthList);
}
//# sourceMappingURL=SVGAnimatedLengthList.d.ts.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"SVGAnimatedLengthList.d.ts","sourceRoot":"","sources":["../../src/svg/SVGAnimatedLengthList.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,cAAc,MAAM,sBAAsB,CAAC;AACvD,OAAO,aAAa,MAAM,4BAA4B,CAAC;AACvD,OAAO,aAAa,MAAM,oBAAoB,CAAC;AAE/C;;;;GAIG;AACH,MAAM,CAAC,OAAO,OAAO,qBAAqB;IAElC,CAAC,cAAc,CAAC,MAAM,CAAC,EAAE,aAAa,CAAC;IACvC,CAAC,cAAc,CAAC,YAAY,CAAC,EAAE,MAAM,MAAM,CAAC;IAC5C,CAAC,cAAc,CAAC,YAAY,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IACvD,CAAC,cAAc,CAAC,OAAO,CAAC,EAAE,aAAa,GAAG,IAAI,CAAQ;IACtD,CAAC,cAAc,CAAC,OAAO,CAAC,EAAE,aAAa,GAAG,IAAI,CAAQ;IAE7D;;;;;;;;OAQG;gBAEF,wBAAwB,EAAE,MAAM,EAChC,MAAM,EAAE,aAAa,EACrB,OAAO,EAAE;QACR,YAAY,EAAE,MAAM,MAAM,GAAG,IAAI,CAAC;QAClC,YAAY,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;KACtC;IAYF;;;;OAIG;IACH,IAAW,OAAO,IAAI,aAAa,CAalC;IAED;;;;OAIG;IACH,IAAW,OAAO,CAAC,MAAM,EApBH,aAoBG,EAExB;IAED;;;;OAIG;IACH,IAAW,OAAO,IAAI,aAAa,CAYlC;IAED;;;;OAIG;IACH,IAAW,OAAO,CAAC,MAAM,EAnBH,aAmBG,EAExB;CACD"}

View File

@@ -0,0 +1,78 @@
import * as PropertySymbol from '../PropertySymbol.js';
import SVGLengthList from './SVGLengthList.js';
/**
* SVG Animated Length.
*
* @see https://developer.mozilla.org/en-US/docs/Web/API/SVGAnimatedLengthList
*/
export default class SVGAnimatedLengthList {
// Internal properties
[PropertySymbol.window];
[PropertySymbol.getAttribute];
[PropertySymbol.setAttribute];
[PropertySymbol.baseVal] = null;
[PropertySymbol.animVal] = null;
/**
* Constructor.
*
* @param illegalConstructorSymbol Illegal constructor symbol.
* @param window Window.
* @param options Options.
* @param options.getAttribute Get attribute.
* @param options.setAttribute Set attribute.
*/
constructor(illegalConstructorSymbol, window, options) {
if (illegalConstructorSymbol !== PropertySymbol.illegalConstructor) {
throw new TypeError('Illegal constructor');
}
this[PropertySymbol.window] = window;
this[PropertySymbol.getAttribute] = options.getAttribute;
this[PropertySymbol.setAttribute] = options.setAttribute;
}
/**
* Returns animated value.
*
* @returns Animated value.
*/
get animVal() {
if (!this[PropertySymbol.animVal]) {
this[PropertySymbol.animVal] = new SVGLengthList(PropertySymbol.illegalConstructor, this[PropertySymbol.window], {
readOnly: true,
getAttribute: this[PropertySymbol.getAttribute],
setAttribute: this[PropertySymbol.setAttribute]
});
}
return this[PropertySymbol.animVal];
}
/**
* Returns animated value.
*
* @param value Animated value.
*/
set animVal(_value) {
// Do nothing
}
/**
* Returns base value.
*
* @returns Base value.
*/
get baseVal() {
if (!this[PropertySymbol.baseVal]) {
this[PropertySymbol.baseVal] = new SVGLengthList(PropertySymbol.illegalConstructor, this[PropertySymbol.window], {
getAttribute: this[PropertySymbol.getAttribute],
setAttribute: this[PropertySymbol.setAttribute]
});
}
return this[PropertySymbol.baseVal];
}
/**
* Returns base value.
*
* @param value Base value.
*/
set baseVal(_value) {
// Do nothing
}
}
//# sourceMappingURL=SVGAnimatedLengthList.js.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"SVGAnimatedLengthList.js","sourceRoot":"","sources":["../../src/svg/SVGAnimatedLengthList.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,cAAc,MAAM,sBAAsB,CAAC;AAEvD,OAAO,aAAa,MAAM,oBAAoB,CAAC;AAE/C;;;;GAIG;AACH,MAAM,CAAC,OAAO,OAAO,qBAAqB;IACzC,sBAAsB;IACf,CAAC,cAAc,CAAC,MAAM,CAAC,CAAgB;IACvC,CAAC,cAAc,CAAC,YAAY,CAAC,CAAe;IAC5C,CAAC,cAAc,CAAC,YAAY,CAAC,CAA0B;IACvD,CAAC,cAAc,CAAC,OAAO,CAAC,GAAyB,IAAI,CAAC;IACtD,CAAC,cAAc,CAAC,OAAO,CAAC,GA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,CAAC;gBAC/C,YAAY,EAAE,IAAI,CAAC,cAAc,CAAC,YAAY,CAAC;aAC/C,CACD,CAAC;QACH,CAAC;QACD,OAAO,IAAI,CAAC,cAAc,CAAC,OAAO,CAAC,CAAC;IACrC,CAAC;IAED;;;;OAIG;IACH,IAAW,OAAO,CAAC,MAAM;QACxB,aAAa;IACd,CAAC;CACD"}

View File

@@ -0,0 +1,53 @@
import * as PropertySymbol from '../PropertySymbol.js';
import BrowserWindow from '../window/BrowserWindow.js';
/**
* SVG Animated Number.
*
* @see https://developer.mozilla.org/en-US/docs/Web/API/SVGAnimatedNumber
*/
export default class SVGAnimatedNumber {
[PropertySymbol.window]: BrowserWindow;
[PropertySymbol.getAttribute]: (() => string | null) | null;
[PropertySymbol.setAttribute]: ((value: string) => void) | null;
[PropertySymbol.defaultValue]: number;
/**
* Constructor.
*
* @param illegalConstructorSymbol Illegal constructor symbol.
* @param window Window.
* @param options Options.
* @param options.getAttribute Get attribute.
* @param options.setAttribute Set attribute.
* @param options.defaultValue
*/
constructor(illegalConstructorSymbol: symbol, window: BrowserWindow, options: {
getAttribute: () => string | null;
setAttribute: (value: string) => void;
defaultValue?: number;
});
/**
* Returns animated value.
*
* @returns Animated value.
*/
get animVal(): number;
/**
* Returns animated value.
*
* @param value Animated value.
*/
set animVal(_value: number);
/**
* Returns base value.
*
* @returns Base value.
*/
get baseVal(): number;
/**
* Sets base value.
*
* @param value Base value.
*/
set baseVal(value: number);
}
//# sourceMappingURL=SVGAnimatedNumber.d.ts.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"SVGAnimatedNumber.d.ts","sourceRoot":"","sources":["../../src/svg/SVGAnimatedNumber.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,cAAc,MAAM,sBAAsB,CAAC;AACvD,OAAO,aAAa,MAAM,4BAA4B,CAAC;AAEvD;;;;GAIG;AACH,MAAM,CAAC,OAAO,OAAO,iBAAiB;IAE9B,CAAC,cAAc,CAAC,MAAM,CAAC,EAAE,aAAa,CAAC;IACvC,CAAC,cAAc,CAAC,YAAY,CAAC,EAAE,CAAC,MAAM,MAAM,GAAG,IAAI,CAAC,GAAG,IAAI,CAAQ;IACnE,CAAC,cAAc,CAAC,YAAY,CAAC,EAAE,CAAC,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC,GAAG,IAAI,CAAQ;IACvE,CAAC,cAAc,CAAC,YAAY,CAAC,EAAE,MAAM,CAAK;IAEjD;;;;;;;;;OASG;gBAEF,wBAAwB,EAAE,MAAM,EAChC,MAAM,EAAE,aAAa,EACrB,OAAO,EAAE;QACR,YAAY,EAAE,MAAM,MAAM,GAAG,IAAI,CAAC;QAClC,YAAY,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;QACtC,YAAY,CAAC,EAAE,MAAM,CAAC;KACtB;IAaF;;;;OAIG;IACH,IAAW,OAAO,IAAI,MAAM,CAE3B;IAED;;;;OAIG;IACH,IAAW,OAAO,CAAC,MAAM,EATH,MASG,EAExB;IAED;;;;OAIG;IACH,IAAW,OAAO,IAAI,MAAM,CAc3B;IAED;;;;OAIG;IACH,IAAW,OAAO,CAAC,KAAK,EAAE,MAAM,EAU/B;CACD"}

View File

@@ -0,0 +1,77 @@
import * as PropertySymbol from '../PropertySymbol.js';
/**
* SVG Animated Number.
*
* @see https://developer.mozilla.org/en-US/docs/Web/API/SVGAnimatedNumber
*/
export default class SVGAnimatedNumber {
// Internal properties
[PropertySymbol.window];
[PropertySymbol.getAttribute] = null;
[PropertySymbol.setAttribute] = null;
[PropertySymbol.defaultValue] = 0;
/**
* Constructor.
*
* @param illegalConstructorSymbol Illegal constructor symbol.
* @param window Window.
* @param options Options.
* @param options.getAttribute Get attribute.
* @param options.setAttribute Set attribute.
* @param options.defaultValue
*/
constructor(illegalConstructorSymbol, window, options) {
if (illegalConstructorSymbol !== PropertySymbol.illegalConstructor) {
throw new TypeError('Illegal constructor');
}
this[PropertySymbol.window] = window;
this[PropertySymbol.getAttribute] = options.getAttribute;
this[PropertySymbol.setAttribute] = options.setAttribute;
this[PropertySymbol.defaultValue] = options.defaultValue || 0;
}
/**
* Returns animated value.
*
* @returns Animated value.
*/
get animVal() {
return this.baseVal;
}
/**
* Returns animated value.
*
* @param value Animated value.
*/
set animVal(_value) {
// Do nothing
}
/**
* Returns base value.
*
* @returns Base value.
*/
get baseVal() {
const attributeValue = this[PropertySymbol.getAttribute]();
if (!attributeValue) {
return this[PropertySymbol.defaultValue];
}
const value = parseFloat(attributeValue);
if (isNaN(value)) {
return this[PropertySymbol.defaultValue];
}
return value;
}
/**
* Sets base value.
*
* @param value Base value.
*/
set baseVal(value) {
const parsedValue = typeof value !== 'number' ? parseFloat(value) : value;
if (isNaN(parsedValue)) {
throw new this[PropertySymbol.window].TypeError(`TypeError: Failed to set the 'baseVal' property on 'SVGAnimatedNumber': The provided float value is non-finite.`);
}
this[PropertySymbol.setAttribute](String(parsedValue));
}
}
//# sourceMappingURL=SVGAnimatedNumber.js.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"SVGAnimatedNumber.js","sourceRoot":"","sources":["../../src/svg/SVGAnimatedNumber.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,cAAc,MAAM,sBAAsB,CAAC;AAGvD;;;;GAIG;AACH,MAAM,CAAC,OAAO,OAAO,iBAAiB;IACrC,sBAAsB;IACf,CAAC,cAAc,CAAC,MAAM,CAAC,CAAgB;IACvC,CAAC,cAAc,CAAC,YAAY,CAAC,GAAiC,IAAI,CAAC;IACnE,CAAC,cAAc,CAAC,YAAY,CAAC,GAAqC,IAAI,CAAC;IACvE,CAAC,cAAc,CAAC,YAAY,CAAC,GAAW,CAAC,CAAC;IAEjD;;;;;;;;;OASG;IACH,YACC,wBAAgC,EAChC,MAAqB,EACrB,OAIC;QAED,IAAI,wBAAwB,KAAK,cAAc,CAAC,kBAAkB,EAAE,CAAC;YACpE,MAAM,IAAI,SAAS,CAAC,qBAAqB,CAAC,CAAC;QAC5C,CAAC;QAED,IAAI,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,CAAC,CAAC,CAAC;IACxD,CAAC;CACD"}

View File

@@ -0,0 +1,53 @@
import SVGNumberList from './SVGNumberList.js';
import * as PropertySymbol from '../PropertySymbol.js';
import BrowserWindow from '../window/BrowserWindow.js';
/**
* The SVGAnimatedNumberList interface is used for attributes which take a list of numbers and which can be animated.
*
* @see https://developer.mozilla.org/en-US/docs/Web/API/SVGAnimatedNumberList
*/
export default class SVGAnimatedNumberList {
[PropertySymbol.window]: BrowserWindow;
[PropertySymbol.getAttribute]: () => string;
[PropertySymbol.setAttribute]: (value: string) => void;
[PropertySymbol.baseVal]: SVGNumberList | null;
[PropertySymbol.animVal]: SVGNumberList | null;
/**
* Constructor.
*
* @param illegalConstructorSymbol Illegal constructor symbol.
* @param window Window.
* @param options Options.
* @param options.getAttribute Get attribute.
* @param options.setAttribute Set attribute.
*/
constructor(illegalConstructorSymbol: symbol, window: BrowserWindow, options: {
getAttribute: () => string | null;
setAttribute: (value: string) => void;
});
/**
* Returns animated value.
*
* @returns Animated value.
*/
get animVal(): SVGNumberList;
/**
* Returns animated value.
*
* @param value Animated value.
*/
set animVal(_value: SVGNumberList);
/**
* Returns base value.
*
* @returns Base value.
*/
get baseVal(): SVGNumberList;
/**
* Sets base value.
*
* @param value Base value.
*/
set baseVal(_value: SVGNumberList);
}
//# sourceMappingURL=SVGAnimatedNumberList.d.ts.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"SVGAnimatedNumberList.d.ts","sourceRoot":"","sources":["../../src/svg/SVGAnimatedNumberList.ts"],"names":[],"mappings":"AAAA,OAAO,aAAa,MAAM,oBAAoB,CAAC;AAC/C,OAAO,KAAK,cAAc,MAAM,sBAAsB,CAAC;AACvD,OAAO,aAAa,MAAM,4BAA4B,CAAC;AAEvD;;;;GAIG;AACH,MAAM,CAAC,OAAO,OAAO,qBAAqB;IAElC,CAAC,cAAc,CAAC,MAAM,CAAC,EAAE,aAAa,CAAC;IACvC,CAAC,cAAc,CAAC,YAAY,CAAC,EAAE,MAAM,MAAM,CAAC;IAC5C,CAAC,cAAc,CAAC,YAAY,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IACvD,CAAC,cAAc,CAAC,OAAO,CAAC,EAAE,aAAa,GAAG,IAAI,CAAQ;IACtD,CAAC,cAAc,CAAC,OAAO,CAAC,EAAE,aAAa,GAAG,IAAI,CAAQ;IAE7D;;;;;;;;OAQG;gBAEF,wBAAwB,EAAE,MAAM,EAChC,MAAM,EAAE,aAAa,EACrB,OAAO,EAAE;QACR,YAAY,EAAE,MAAM,MAAM,GAAG,IAAI,CAAC;QAClC,YAAY,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;KACtC;IAYF;;;;OAIG;IACH,IAAW,OAAO,IAAI,aAAa,CAalC;IAED;;;;OAIG;IACH,IAAW,OAAO,CAAC,MAAM,EApBH,aAoBG,EAExB;IAED;;;;OAIG;IACH,IAAW,OAAO,IAAI,aAAa,CAYlC;IAED;;;;OAIG;IACH,IAAW,OAAO,CAAC,MAAM,EAnBH,aAmBG,EAExB;CACD"}

View File

@@ -0,0 +1,78 @@
import SVGNumberList from './SVGNumberList.js';
import * as PropertySymbol from '../PropertySymbol.js';
/**
* The SVGAnimatedNumberList interface is used for attributes which take a list of numbers and which can be animated.
*
* @see https://developer.mozilla.org/en-US/docs/Web/API/SVGAnimatedNumberList
*/
export default class SVGAnimatedNumberList {
// Internal properties
[PropertySymbol.window];
[PropertySymbol.getAttribute];
[PropertySymbol.setAttribute];
[PropertySymbol.baseVal] = null;
[PropertySymbol.animVal] = null;
/**
* Constructor.
*
* @param illegalConstructorSymbol Illegal constructor symbol.
* @param window Window.
* @param options Options.
* @param options.getAttribute Get attribute.
* @param options.setAttribute Set attribute.
*/
constructor(illegalConstructorSymbol, window, options) {
if (illegalConstructorSymbol !== PropertySymbol.illegalConstructor) {
throw new TypeError('Illegal constructor');
}
this[PropertySymbol.window] = window;
this[PropertySymbol.getAttribute] = options.getAttribute;
this[PropertySymbol.setAttribute] = options.setAttribute;
}
/**
* Returns animated value.
*
* @returns Animated value.
*/
get animVal() {
if (!this[PropertySymbol.animVal]) {
this[PropertySymbol.animVal] = new SVGNumberList(PropertySymbol.illegalConstructor, this[PropertySymbol.window], {
readOnly: true,
getAttribute: this[PropertySymbol.getAttribute],
setAttribute: () => { }
});
}
return this[PropertySymbol.animVal];
}
/**
* Returns animated value.
*
* @param value Animated value.
*/
set animVal(_value) {
// Do nothing
}
/**
* Returns base value.
*
* @returns Base value.
*/
get baseVal() {
if (!this[PropertySymbol.baseVal]) {
this[PropertySymbol.baseVal] = new SVGNumberList(PropertySymbol.illegalConstructor, this[PropertySymbol.window], {
getAttribute: this[PropertySymbol.getAttribute],
setAttribute: this[PropertySymbol.setAttribute]
});
}
return this[PropertySymbol.baseVal];
}
/**
* Sets base value.
*
* @param value Base value.
*/
set baseVal(_value) {
// Do nothing
}
}
//# sourceMappingURL=SVGAnimatedNumberList.js.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"SVGAnimatedNumberList.js","sourceRoot":"","sources":["../../src/svg/SVGAnimatedNumberList.ts"],"names":[],"mappings":"AAAA,OAAO,aAAa,MAAM,oBAAoB,CAAC;AAC/C,OAAO,KAAK,cAAc,MAAM,sBAAsB,CAAC;AAGvD;;;;GAIG;AACH,MAAM,CAAC,OAAO,OAAO,qBAAqB;IACzC,sBAAsB;IACf,CAAC,cAAc,CAAC,MAAM,CAAC,CAAgB;IACvC,CAAC,cAAc,CAAC,YAAY,CAAC,CAAe;IAC5C,CAAC,cAAc,CAAC,YAAY,CAAC,CAA0B;IACvD,CAAC,cAAc,CAAC,OAAO,CAAC,GAAyB,IAAI,CAAC;IACtD,CAAC,cAAc,CAAC,OAAO,CAAC,GAAyB,IAAI,CAAC;IAE7D;;;;;;;;OAQG;IACH,YACC,wBAAgC,EAChC,MAAqB,EACrB,OAGC;QAED,IAAI,wBAAwB,KAAK,cAAc,CAAC,kBAAkB,EAAE,CAAC;YACpE,MAAM,IAA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IG;IACH,IAAW,OAAO,CAAC,MAAM;QACxB,aAAa;IACd,CAAC;CACD"}

View File

@@ -0,0 +1,53 @@
import * as PropertySymbol from '../PropertySymbol.js';
import BrowserWindow from '../window/BrowserWindow.js';
import SVGPreserveAspectRatio from './SVGPreserveAspectRatio.js';
/**
* SVG Animated Preserve Aspect Ratio
*
* @see https://developer.mozilla.org/en-US/docs/Web/API/SVGAnimatedPreserveAspectRatio
*/
export default class SVGAnimatedPreserveAspectRatio {
[PropertySymbol.window]: BrowserWindow;
[PropertySymbol.getAttribute]: () => string;
[PropertySymbol.setAttribute]: (value: string) => void;
[PropertySymbol.baseVal]: SVGPreserveAspectRatio | null;
[PropertySymbol.animVal]: SVGPreserveAspectRatio | null;
/**
* Constructor.
*
* @param illegalConstructorSymbol Illegal constructor symbol.
* @param window Window.
* @param options Options.
* @param options.getAttribute Get attribute.
* @param options.setAttribute Set attribute
*/
constructor(illegalConstructorSymbol: symbol, window: BrowserWindow, options: {
getAttribute: () => string | null;
setAttribute: (value: string) => void;
});
/**
* Returns animated value.
*
* @returns Animated value.
*/
get animVal(): SVGPreserveAspectRatio;
/**
* Returns animated value.
*
* @param value Animated value.
*/
set animVal(_value: SVGPreserveAspectRatio);
/**
* Returns base value.
*
* @returns Base value.
*/
get baseVal(): SVGPreserveAspectRatio;
/**
* Returns base value.
*
* @param value Base value.
*/
set baseVal(_value: SVGPreserveAspectRatio);
}
//# sourceMappingURL=SVGAnimatedPreserveAspectRatio.d.ts.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"SVGAnimatedPreserveAspectRatio.d.ts","sourceRoot":"","sources":["../../src/svg/SVGAnimatedPreserveAspectRatio.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,cAAc,MAAM,sBAAsB,CAAC;AACvD,OAAO,aAAa,MAAM,4BAA4B,CAAC;AACvD,OAAO,sBAAsB,MAAM,6BAA6B,CAAC;AAEjE;;;;GAIG;AACH,MAAM,CAAC,OAAO,OAAO,8BAA8B;IAE3C,CAAC,cAAc,CAAC,MAAM,CAAC,EAAE,aAAa,CAAC;IACvC,CAAC,cAAc,CAAC,YAAY,CAAC,EAAE,MAAM,MAAM,CAAC;IAC5C,CAAC,cAAc,CAAC,YAAY,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IACvD,CAAC,cAAc,CAAC,OAAO,CAAC,EAAE,sBAAsB,GAAG,IAAI,CAAQ;IAC/D,CAAC,cAAc,CAAC,OAAO,CAAC,EAAE,sBAAsB,GAAG,IAAI,CAAQ;IAEtE;;;;;;;;OAQG;gBAEF,wBAAwB,EAAE,MAAM,EAChC,MAAM,EAAE,aAAa,EACrB,OAAO,EAAE;QACR,YAAY,EAAE,MAAM,MAAM,GAAG,IAAI,CAAC;QAClC,YAAY,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;KACtC;IAYF;;;;OAIG;IACH,IAAW,OAAO,IAAI,sBAAsB,CAY3C;IAED;;;;OAIG;IACH,IAAW,OAAO,CAAC,MAAM,EAnBH,sBAmBG,EAExB;IAED;;;;OAIG;IACH,IAAW,OAAO,IAAI,sBAAsB,CAY3C;IAED;;;;OAIG;IACH,IAAW,OAAO,CAAC,MAAM,EAnBH,sBAmBG,EAExB;CACD"}

View File

@@ -0,0 +1,77 @@
import * as PropertySymbol from '../PropertySymbol.js';
import SVGPreserveAspectRatio from './SVGPreserveAspectRatio.js';
/**
* SVG Animated Preserve Aspect Ratio
*
* @see https://developer.mozilla.org/en-US/docs/Web/API/SVGAnimatedPreserveAspectRatio
*/
export default class SVGAnimatedPreserveAspectRatio {
// Internal properties
[PropertySymbol.window];
[PropertySymbol.getAttribute];
[PropertySymbol.setAttribute];
[PropertySymbol.baseVal] = null;
[PropertySymbol.animVal] = null;
/**
* Constructor.
*
* @param illegalConstructorSymbol Illegal constructor symbol.
* @param window Window.
* @param options Options.
* @param options.getAttribute Get attribute.
* @param options.setAttribute Set attribute
*/
constructor(illegalConstructorSymbol, window, options) {
if (illegalConstructorSymbol !== PropertySymbol.illegalConstructor) {
throw new TypeError('Illegal constructor');
}
this[PropertySymbol.window] = window;
this[PropertySymbol.getAttribute] = options.getAttribute;
this[PropertySymbol.setAttribute] = options.setAttribute;
}
/**
* Returns animated value.
*
* @returns Animated value.
*/
get animVal() {
if (!this[PropertySymbol.animVal]) {
this[PropertySymbol.animVal] = new SVGPreserveAspectRatio(PropertySymbol.illegalConstructor, this[PropertySymbol.window], {
readOnly: true,
getAttribute: this[PropertySymbol.getAttribute]
});
}
return this[PropertySymbol.animVal];
}
/**
* Returns animated value.
*
* @param value Animated value.
*/
set animVal(_value) {
// Do nothing
}
/**
* Returns base value.
*
* @returns Base value.
*/
get baseVal() {
if (!this[PropertySymbol.baseVal]) {
this[PropertySymbol.baseVal] = new SVGPreserveAspectRatio(PropertySymbol.illegalConstructor, this[PropertySymbol.window], {
getAttribute: this[PropertySymbol.getAttribute],
setAttribute: this[PropertySymbol.setAttribute]
});
}
return this[PropertySymbol.baseVal];
}
/**
* Returns base value.
*
* @param value Base value.
*/
set baseVal(_value) {
// Do nothing
}
}
//# sourceMappingURL=SVGAnimatedPreserveAspectRatio.js.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"SVGAnimatedPreserveAspectRatio.js","sourceRoot":"","sources":["../../src/svg/SVGAnimatedPreserveAspectRatio.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,cAAc,MAAM,sBAAsB,CAAC;AAEvD,OAAO,sBAAsB,MAAM,6BAA6B,CAAC;AAEjE;;;;GAIG;AACH,MAAM,CAAC,OAAO,OAAO,8BAA8B;IAClD,sBAAsB;IACf,CAAC,cAAc,CAAC,MAAM,CAAC,CAAgB;IACvC,CAAC,cAAc,CAAC,YAAY,CAAC,CAAe;IAC5C,CAAC,cAAc,CAAC,YAAY,CAAC,CAA0B;IACvD,CAAC,cAAc,CAAC,OAAO,CAAC,GAAkC,IAAI,CAAC;IAC/D,CAAC,cAAc,CAAC,OAAO,CAAC,GAAkC,IAAI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aAC/C,CACD,CAAC;QACH,CAAC;QACD,OAAO,IAAI,CAAC,cAAc,CAAC,OAAO,CAAC,CAAC;IACrC,CAAC;IAED;;;;OAIG;IACH,IAAW,OAAO,CAAC,MAAM;QACxB,aAAa;IACd,CAAC;CACD"}

View File

@@ -0,0 +1,53 @@
import * as PropertySymbol from '../PropertySymbol.js';
import SVGRect from './SVGRect.js';
import BrowserWindow from '../window/BrowserWindow.js';
/**
* SVG Animated Number.
*
* @see https://developer.mozilla.org/en-US/docs/Web/API/SVGAnimatedRect
*/
export default class SVGAnimatedRect {
[PropertySymbol.window]: BrowserWindow;
[PropertySymbol.getAttribute]: () => string;
[PropertySymbol.setAttribute]: (value: string) => void;
[PropertySymbol.baseVal]: SVGRect | null;
[PropertySymbol.animVal]: SVGRect | null;
/**
* Constructor.
*
* @param illegalConstructorSymbol Illegal constructor symbol.
* @param window Window.
* @param options Options.
* @param options.getAttribute Get attribute.
* @param options.setAttribute Set attribute.
*/
constructor(illegalConstructorSymbol: symbol, window: BrowserWindow, options: {
getAttribute: () => string | null;
setAttribute: (value: string) => void;
});
/**
* Returns animated value.
*
* @returns Animated value.
*/
get animVal(): SVGRect;
/**
* Returns animated value.
*
* @param value Animated value.
*/
set animVal(_value: SVGRect);
/**
* Returns base value.
*
* @returns Base value.
*/
get baseVal(): SVGRect;
/**
* Returns base value.
*
* @param value Base value.
*/
set baseVal(_value: SVGRect);
}
//# sourceMappingURL=SVGAnimatedRect.d.ts.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"SVGAnimatedRect.d.ts","sourceRoot":"","sources":["../../src/svg/SVGAnimatedRect.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,cAAc,MAAM,sBAAsB,CAAC;AACvD,OAAO,OAAO,MAAM,cAAc,CAAC;AACnC,OAAO,aAAa,MAAM,4BAA4B,CAAC;AAEvD;;;;GAIG;AACH,MAAM,CAAC,OAAO,OAAO,eAAe;IAE5B,CAAC,cAAc,CAAC,MAAM,CAAC,EAAE,aAAa,CAAC;IACvC,CAAC,cAAc,CAAC,YAAY,CAAC,EAAE,MAAM,MAAM,CAAC;IAC5C,CAAC,cAAc,CAAC,YAAY,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IACvD,CAAC,cAAc,CAAC,OAAO,CAAC,EAAE,OAAO,GAAG,IAAI,CAAQ;IAChD,CAAC,cAAc,CAAC,OAAO,CAAC,EAAE,OAAO,GAAG,IAAI,CAAQ;IAEvD;;;;;;;;OAQG;gBAEF,wBAAwB,EAAE,MAAM,EAChC,MAAM,EAAE,aAAa,EACrB,OAAO,EAAE;QACR,YAAY,EAAE,MAAM,MAAM,GAAG,IAAI,CAAC;QAClC,YAAY,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;KACtC;IAYF;;;;OAIG;IACH,IAAW,OAAO,IAAI,OAAO,CAY5B;IAED;;;;OAIG;IACH,IAAW,OAAO,CAAC,MAAM,EAnBH,OAmBG,EAExB;IAED;;;;OAIG;IACH,IAAW,OAAO,IAAI,OAAO,CAY5B;IAED;;;;OAIG;IACH,IAAW,OAAO,CAAC,MAAM,EAnBH,OAmBG,EAExB;CACD"}

View File

@@ -0,0 +1,77 @@
import * as PropertySymbol from '../PropertySymbol.js';
import SVGRect from './SVGRect.js';
/**
* SVG Animated Number.
*
* @see https://developer.mozilla.org/en-US/docs/Web/API/SVGAnimatedRect
*/
export default class SVGAnimatedRect {
// Internal properties
[PropertySymbol.window];
[PropertySymbol.getAttribute];
[PropertySymbol.setAttribute];
[PropertySymbol.baseVal] = null;
[PropertySymbol.animVal] = null;
/**
* Constructor.
*
* @param illegalConstructorSymbol Illegal constructor symbol.
* @param window Window.
* @param options Options.
* @param options.getAttribute Get attribute.
* @param options.setAttribute Set attribute.
*/
constructor(illegalConstructorSymbol, window, options) {
if (illegalConstructorSymbol !== PropertySymbol.illegalConstructor) {
throw new TypeError('Illegal constructor');
}
this[PropertySymbol.window] = window;
this[PropertySymbol.getAttribute] = options.getAttribute;
this[PropertySymbol.setAttribute] = options.setAttribute;
}
/**
* Returns animated value.
*
* @returns Animated value.
*/
get animVal() {
if (!this[PropertySymbol.animVal]) {
this[PropertySymbol.animVal] = new SVGRect(PropertySymbol.illegalConstructor, this[PropertySymbol.window], {
readOnly: true,
getAttribute: this[PropertySymbol.getAttribute]
});
}
return this[PropertySymbol.animVal];
}
/**
* Returns animated value.
*
* @param value Animated value.
*/
set animVal(_value) {
// Do nothing
}
/**
* Returns base value.
*
* @returns Base value.
*/
get baseVal() {
if (!this[PropertySymbol.baseVal]) {
this[PropertySymbol.baseVal] = new SVGRect(PropertySymbol.illegalConstructor, this[PropertySymbol.window], {
getAttribute: this[PropertySymbol.getAttribute],
setAttribute: this[PropertySymbol.setAttribute]
});
}
return this[PropertySymbol.baseVal];
}
/**
* Returns base value.
*
* @param value Base value.
*/
set baseVal(_value) {
// Do nothing
}
}
//# sourceMappingURL=SVGAnimatedRect.js.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"SVGAnimatedRect.js","sourceRoot":"","sources":["../../src/svg/SVGAnimatedRect.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,cAAc,MAAM,sBAAsB,CAAC;AACvD,OAAO,OAAO,MAAM,cAAc,CAAC;AAGnC;;;;GAIG;AACH,MAAM,CAAC,OAAO,OAAO,eAAe;IACnC,sBAAsB;IACf,CAAC,cAAc,CAAC,MAAM,CAAC,CAAgB;IACvC,CAAC,cAAc,CAAC,YAAY,CAAC,CAAe;IAC5C,CAAC,cAAc,CAAC,YAAY,CAAC,CAA0B;IACvD,CAAC,cAAc,CAAC,OAAO,CAAC,GAAmB,IAAI,CAAC;IAChD,CAAC,cAAc,CAAC,OAAO,CAAC,GAAmB,IAAI,CAAC;IAEvD;;;;;;;;OAQG;IACH,YACC,wBAAgC,EAChC,MAAqB,EACrB,OAGC;QAED,IAAI,wBAAwB,KAAK,cAAc,CAAC,kBAAkB,EAAE,CAAC;YACpE,MAAM,IAAI,SAAS,CA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ACD"}

View File

@@ -0,0 +1,50 @@
import * as PropertySymbol from '../PropertySymbol.js';
import BrowserWindow from '../window/BrowserWindow.js';
/**
* SVG Animated String.
*
* @see https://developer.mozilla.org/en-US/docs/Web/API/SVGAnimatedString
*/
export default class SVGAnimatedString {
[PropertySymbol.window]: BrowserWindow;
[PropertySymbol.getAttribute]: (() => string | null) | null;
[PropertySymbol.setAttribute]: ((value: string) => void) | null;
/**
* Constructor.
*
* @param illegalConstructorSymbol Illegal constructor symbol.
* @param window Window.
* @param options Options.
* @param options.getAttribute Get attribute.
* @param options.setAttribute Set attribute.
*/
constructor(illegalConstructorSymbol: symbol, window: BrowserWindow, options: {
getAttribute: () => string | null;
setAttribute: (value: string) => void;
});
/**
* Returns animated value.
*
* @returns Animated value.
*/
get animVal(): string;
/**
* Returns animated value.
*
* @param value Animated value.
*/
set animVal(_value: string);
/**
* Returns base value.
*
* @returns Base value.
*/
get baseVal(): string;
/**
* Sets base value.
*
* @param value Base value.
*/
set baseVal(value: string);
}
//# sourceMappingURL=SVGAnimatedString.d.ts.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"SVGAnimatedString.d.ts","sourceRoot":"","sources":["../../src/svg/SVGAnimatedString.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,cAAc,MAAM,sBAAsB,CAAC;AACvD,OAAO,aAAa,MAAM,4BAA4B,CAAC;AAEvD;;;;GAIG;AACH,MAAM,CAAC,OAAO,OAAO,iBAAiB;IAE9B,CAAC,cAAc,CAAC,MAAM,CAAC,EAAE,aAAa,CAAC;IACvC,CAAC,cAAc,CAAC,YAAY,CAAC,EAAE,CAAC,MAAM,MAAM,GAAG,IAAI,CAAC,GAAG,IAAI,CAAQ;IACnE,CAAC,cAAc,CAAC,YAAY,CAAC,EAAE,CAAC,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC,GAAG,IAAI,CAAQ;IAE9E;;;;;;;;OAQG;gBAEF,wBAAwB,EAAE,MAAM,EAChC,MAAM,EAAE,aAAa,EACrB,OAAO,EAAE;QACR,YAAY,EAAE,MAAM,MAAM,GAAG,IAAI,CAAC;QAClC,YAAY,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;KACtC;IAYF;;;;OAIG;IACH,IAAW,OAAO,IAAI,MAAM,CAE3B;IAED;;;;OAIG;IACH,IAAW,OAAO,CAAC,MAAM,EATH,MASG,EAExB;IAED;;;;OAIG;IACH,IAAW,OAAO,IAAI,MAAM,CAQ3B;IAED;;;;OAIG;IACH,IAAW,OAAO,CAAC,KAAK,EAAE,MAAM,EAE/B;CACD"}

View File

@@ -0,0 +1,66 @@
import * as PropertySymbol from '../PropertySymbol.js';
/**
* SVG Animated String.
*
* @see https://developer.mozilla.org/en-US/docs/Web/API/SVGAnimatedString
*/
export default class SVGAnimatedString {
// Internal properties
[PropertySymbol.window];
[PropertySymbol.getAttribute] = null;
[PropertySymbol.setAttribute] = null;
/**
* Constructor.
*
* @param illegalConstructorSymbol Illegal constructor symbol.
* @param window Window.
* @param options Options.
* @param options.getAttribute Get attribute.
* @param options.setAttribute Set attribute.
*/
constructor(illegalConstructorSymbol, window, options) {
if (illegalConstructorSymbol !== PropertySymbol.illegalConstructor) {
throw new TypeError('Illegal constructor');
}
this[PropertySymbol.window] = window;
this[PropertySymbol.getAttribute] = options.getAttribute;
this[PropertySymbol.setAttribute] = options.setAttribute;
}
/**
* Returns animated value.
*
* @returns Animated value.
*/
get animVal() {
return this.baseVal;
}
/**
* Returns animated value.
*
* @param value Animated value.
*/
set animVal(_value) {
// Do nothing
}
/**
* Returns base value.
*
* @returns Base value.
*/
get baseVal() {
const attributeValue = this[PropertySymbol.getAttribute]();
if (!attributeValue) {
return '';
}
return attributeValue;
}
/**
* Sets base value.
*
* @param value Base value.
*/
set baseVal(value) {
this[PropertySymbol.setAttribute](String(value));
}
}
//# sourceMappingURL=SVGAnimatedString.js.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"SVGAnimatedString.js","sourceRoot":"","sources":["../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
import SVGTransformList from './SVGTransformList.js';
import * as PropertySymbol from '../PropertySymbol.js';
import BrowserWindow from '../window/BrowserWindow.js';
/**
* The SVGAnimatedTransformList interface is used for attributes which take a list of numbers and which can be animated.
*
* @see https://developer.mozilla.org/en-US/docs/Web/API/SVGAnimatedTransformList
*/
export default class SVGAnimatedTransformList {
[PropertySymbol.window]: BrowserWindow;
[PropertySymbol.getAttribute]: () => string;
[PropertySymbol.setAttribute]: (value: string) => void;
[PropertySymbol.baseVal]: SVGTransformList | null;
[PropertySymbol.animVal]: SVGTransformList | null;
/**
* Constructor.
*
* @param illegalConstructorSymbol Illegal constructor symbol.
* @param window Window.
* @param options Options.
* @param options.getAttribute Get attribute.
* @param options.setAttribute Set attribute.
*/
constructor(illegalConstructorSymbol: symbol, window: BrowserWindow, options: {
getAttribute: () => string | null;
setAttribute: (value: string) => void;
});
/**
* Returns animated value.
*
* @returns Animated value.
*/
get animVal(): SVGTransformList;
/**
* Returns animated value.
*
* @param value Animated value.
*/
set animVal(_value: SVGTransformList);
/**
* Returns base value.
*
* @returns Base value.
*/
get baseVal(): SVGTransformList;
/**
* Returns base value.
*
* @param value Base value.
*/
set baseVal(_value: SVGTransformList);
}
//# sourceMappingURL=SVGAnimatedTransformList.d.ts.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"SVGAnimatedTransformList.d.ts","sourceRoot":"","sources":["../../src/svg/SVGAnimatedTransformList.ts"],"names":[],"mappings":"AAAA,OAAO,gBAAgB,MAAM,uBAAuB,CAAC;AACrD,OAAO,KAAK,cAAc,MAAM,sBAAsB,CAAC;AACvD,OAAO,aAAa,MAAM,4BAA4B,CAAC;AAEvD;;;;GAIG;AACH,MAAM,CAAC,OAAO,OAAO,wBAAwB;IAErC,CAAC,cAAc,CAAC,MAAM,CAAC,EAAE,aAAa,CAAC;IACvC,CAAC,cAAc,CAAC,YAAY,CAAC,EAAE,MAAM,MAAM,CAAC;IAC5C,CAAC,cAAc,CAAC,YAAY,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IACvD,CAAC,cAAc,CAAC,OAAO,CAAC,EAAE,gBAAgB,GAAG,IAAI,CAAQ;IACzD,CAAC,cAAc,CAAC,OAAO,CAAC,EAAE,gBAAgB,GAAG,IAAI,CAAQ;IAEhE;;;;;;;;OAQG;gBAEF,wBAAwB,EAAE,MAAM,EAChC,MAAM,EAAE,aAAa,EACrB,OAAO,EAAE;QACR,YAAY,EAAE,MAAM,MAAM,GAAG,IAAI,CAAC;QAClC,YAAY,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;KACtC;IAYF;;;;OAIG;IACH,IAAW,OAAO,IAAI,gBAAgB,CAarC;IAED;;;;OAIG;IACH,IAAW,OAAO,CAAC,MAAM,EApBH,gBAoBG,EAExB;IAED;;;;OAIG;IACH,IAAW,OAAO,IAAI,gBAAgB,CAYrC;IAED;;;;OAIG;IACH,IAAW,OAAO,CAAC,MAAM,EAnBH,gBAmBG,EAExB;CACD"}

View File

@@ -0,0 +1,78 @@
import SVGTransformList from './SVGTransformList.js';
import * as PropertySymbol from '../PropertySymbol.js';
/**
* The SVGAnimatedTransformList interface is used for attributes which take a list of numbers and which can be animated.
*
* @see https://developer.mozilla.org/en-US/docs/Web/API/SVGAnimatedTransformList
*/
export default class SVGAnimatedTransformList {
// Internal properties
[PropertySymbol.window];
[PropertySymbol.getAttribute];
[PropertySymbol.setAttribute];
[PropertySymbol.baseVal] = null;
[PropertySymbol.animVal] = null;
/**
* Constructor.
*
* @param illegalConstructorSymbol Illegal constructor symbol.
* @param window Window.
* @param options Options.
* @param options.getAttribute Get attribute.
* @param options.setAttribute Set attribute.
*/
constructor(illegalConstructorSymbol, window, options) {
if (illegalConstructorSymbol !== PropertySymbol.illegalConstructor) {
throw new TypeError('Illegal constructor');
}
this[PropertySymbol.window] = window;
this[PropertySymbol.getAttribute] = options.getAttribute;
this[PropertySymbol.setAttribute] = options.setAttribute;
}
/**
* Returns animated value.
*
* @returns Animated value.
*/
get animVal() {
if (!this[PropertySymbol.animVal]) {
this[PropertySymbol.animVal] = new SVGTransformList(PropertySymbol.illegalConstructor, this[PropertySymbol.window], {
readOnly: true,
getAttribute: this[PropertySymbol.getAttribute],
setAttribute: () => { }
});
}
return this[PropertySymbol.animVal];
}
/**
* Returns animated value.
*
* @param value Animated value.
*/
set animVal(_value) {
// Do nothing
}
/**
* Returns base value.
*
* @returns Base value.
*/
get baseVal() {
if (!this[PropertySymbol.baseVal]) {
this[PropertySymbol.baseVal] = new SVGTransformList(PropertySymbol.illegalConstructor, this[PropertySymbol.window], {
getAttribute: this[PropertySymbol.getAttribute],
setAttribute: this[PropertySymbol.setAttribute]
});
}
return this[PropertySymbol.baseVal];
}
/**
* Returns base value.
*
* @param value Base value.
*/
set baseVal(_value) {
// Do nothing
}
}
//# sourceMappingURL=SVGAnimatedTransformList.js.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"SVGAnimatedTransformList.js","sourceRoot":"","sources":["../../src/svg/SVGAnimatedTransformList.ts"],"names":[],"mappings":"AAAA,OAAO,gBAAgB,MAAM,uBAAuB,CAAC;AACrD,OAAO,KAAK,cAAc,MAAM,sBAAsB,CAAC;AAGvD;;;;GAIG;AACH,MAAM,CAAC,OAAO,OAAO,wBAAwB;IAC5C,sBAAsB;IACf,CAAC,cAAc,CAAC,MAAM,CAAC,CAAgB;IACvC,CAAC,cAAc,CAAC,YAAY,CAAC,CAAe;IAC5C,CAAC,cAAc,CAAC,YAAY,CAAC,CAA0B;IACvD,CAAC,cAAc,CAAC,OAAO,CAAC,GAA4B,IAAI,CAAC;IACzD,CAAC,cAAc,CAAC,OAAO,CAAC,GAA4B,IAAI,CAAC;IAEhE;;;;;;;;OAQG;IACH,YACC,wBAAgC,EAChC,MAAqB,EACrB,OAGC;QAED,IAAI,wBAAwB,KAAK,cAAc,CAAC,kBAAkB,EAAE,CAAC;YACpE,MAAM,IAAI,SAAS,CAAC,qBAAqB,CAAC,CAAC;QAC5C,CA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a;IACd,CAAC;CACD"}

84
frontend/node_modules/happy-dom/lib/svg/SVGLength.d.ts generated vendored Normal file
View File

@@ -0,0 +1,84 @@
import * as PropertySymbol from '../PropertySymbol.js';
import SVGLengthTypeEnum from './SVGLengthTypeEnum.js';
import BrowserWindow from '../window/BrowserWindow.js';
/**
* SVG length.
*
* @see https://developer.mozilla.org/en-US/docs/Web/API/SVGLength
*/
export default class SVGLength {
static SVG_LENGTHTYPE_UNKNOWN: SVGLengthTypeEnum;
static SVG_LENGTHTYPE_NUMBER: SVGLengthTypeEnum;
static SVG_LENGTHTYPE_PERCENTAGE: SVGLengthTypeEnum;
static SVG_LENGTHTYPE_EMS: SVGLengthTypeEnum;
static SVG_LENGTHTYPE_EXS: SVGLengthTypeEnum;
static SVG_LENGTHTYPE_PX: SVGLengthTypeEnum;
static SVG_LENGTHTYPE_CM: SVGLengthTypeEnum;
static SVG_LENGTHTYPE_MM: SVGLengthTypeEnum;
static SVG_LENGTHTYPE_IN: SVGLengthTypeEnum;
static SVG_LENGTHTYPE_PT: SVGLengthTypeEnum;
static SVG_LENGTHTYPE_PC: SVGLengthTypeEnum;
[PropertySymbol.window]: BrowserWindow;
[PropertySymbol.getAttribute]: (() => string | null) | null;
[PropertySymbol.setAttribute]: ((value: string) => void) | null;
[PropertySymbol.attributeValue]: string | null;
[PropertySymbol.readOnly]: boolean;
/**
* Constructor.
*
* @param illegalConstructorSymbol Illegal constructor symbol.
* @param window Window.
* @param [options] Options.
* @param [options.readOnly] Read only.
* @param [options.getAttribute] Get attribute.
* @param [options.setAttribute] Set attribute.
*/
constructor(illegalConstructorSymbol: symbol, window: BrowserWindow, options?: {
readOnly?: boolean;
getAttribute?: () => string | null;
setAttribute?: (value: string) => void;
});
/**
* Returns unit type.
*
* @returns Unit type.
*/
get unitType(): SVGLengthTypeEnum;
/**
* Returns value.
*
* @returns Value.
*/
get value(): number;
/**
* Sets value.
*
* @param value Value in pixels.
*/
set value(value: number);
/**
* Returns value as string.
*
* @returns Value as string.
*/
get valueAsString(): string;
/**
* Returns value in specified units.
*
* @returns Value in specified units.
*/
get valueInSpecifiedUnits(): number;
/**
* New value specific units.
*
* @param unitType
* @param value
*/
newValueSpecifiedUnits(unitType: number, value: number): void;
/**
* Convert to specific units.
* @param unitType
*/
convertToSpecifiedUnits(unitType: SVGLengthTypeEnum): void;
}
//# sourceMappingURL=SVGLength.d.ts.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"SVGLength.d.ts","sourceRoot":"","sources":["../../src/svg/SVGLength.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,cAAc,MAAM,sBAAsB,CAAC;AACvD,OAAO,iBAAiB,MAAM,wBAAwB,CAAC;AACvD,OAAO,aAAa,MAAM,4BAA4B,CAAC;AAIvD;;;;GAIG;AACH,MAAM,CAAC,OAAO,OAAO,SAAS;IAE7B,OAAc,sBAAsB,oBAA6B;IACjE,OAAc,qBAAqB,oBAA4B;IAC/D,OAAc,yBAAyB,oBAAgC;IACvE,OAAc,kBAAkB,oBAAyB;IACzD,OAAc,kBAAkB,oBAAyB;IACzD,OAAc,iBAAiB,oBAAwB;IACvD,OAAc,iBAAiB,oBAAwB;IACvD,OAAc,iBAAiB,oBAAwB;IACvD,OAAc,iBAAiB,oBAAwB;IACvD,OAAc,iBAAiB,oBAAwB;IACvD,OAAc,iBAAiB,oBAAwB;IAGhD,CAAC,cAAc,CAAC,MAAM,CAAC,EAAE,aAAa,CAAC;IACvC,CAAC,cAAc,CAAC,YAAY,CAAC,EAAE,CAAC,MAAM,MAAM,GAAG,IAAI,CAAC,GAAG,IAAI,CAAQ;IACnE,CAAC,cAAc,CAAC,YAAY,CAAC,EAAE,CAAC,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC,GAAG,IAAI,CAAQ;IACvE,CAAC,cAAc,CAAC,cAAc,CAAC,EAAE,MAAM,GAAG,IAAI,CAAQ;IACtD,CAAC,cAAc,CAAC,QAAQ,CAAC,EAAE,OAAO,CAAS;IAElD;;;;;;;;;OASG;gBAEF,wBAAwB,EAAE,MAAM,EAChC,MAAM,EAAE,aAAa,EACrB,OAAO,CAAC,EAAE;QACT,QAAQ,CAAC,EAAE,OAAO,CAAC;QACnB,YAAY,CAAC,EAAE,MAAM,MAAM,GAAG,IAAI,CAAC;QACnC,YAAY,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;KACvC;IAeF;;;;OAIG;IACH,IAAW,QAAQ,IAAI,iBAAiB,CAsCvC;IAED;;;;OAIG;IACH,IAAW,KAAK,IAAI,MAAM,CAwCzB;IAED;;;;OAIG;IACH,IAAW,KAAK,CAAC,KAAK,EAAE,MAAM,EA4D7B;IAED;;;;OAIG;IACH,IAAW,aAAa,IAAI,MAAM,CAIjC;IAED;;;;OAIG;IACH,IAAW,qBAAqB,IAAI,MAAM,CAGzC;IAED;;;;;OAKG;IACI,sBAAsB,CAAC,QAAQ,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,IAAI;IA6DpE;;;OAGG;IACI,uBAAuB,CAAC,QAAQ,EAAE,iBAAiB,GAAG,IAAI;CA2DjE"}

309
frontend/node_modules/happy-dom/lib/svg/SVGLength.js generated vendored Normal file
View File

@@ -0,0 +1,309 @@
import * as PropertySymbol from '../PropertySymbol.js';
import SVGLengthTypeEnum from './SVGLengthTypeEnum.js';
const ATTRIBUTE_REGEXP = /^(\d+|\d+\.\d+)(px|em|ex|cm|mm|in|pt|pc|%|)$/;
/**
* SVG length.
*
* @see https://developer.mozilla.org/en-US/docs/Web/API/SVGLength
*/
export default class SVGLength {
// Static properties
static SVG_LENGTHTYPE_UNKNOWN = SVGLengthTypeEnum.unknown;
static SVG_LENGTHTYPE_NUMBER = SVGLengthTypeEnum.number;
static SVG_LENGTHTYPE_PERCENTAGE = SVGLengthTypeEnum.percentage;
static SVG_LENGTHTYPE_EMS = SVGLengthTypeEnum.ems;
static SVG_LENGTHTYPE_EXS = SVGLengthTypeEnum.exs;
static SVG_LENGTHTYPE_PX = SVGLengthTypeEnum.px;
static SVG_LENGTHTYPE_CM = SVGLengthTypeEnum.cm;
static SVG_LENGTHTYPE_MM = SVGLengthTypeEnum.mm;
static SVG_LENGTHTYPE_IN = SVGLengthTypeEnum.in;
static SVG_LENGTHTYPE_PT = SVGLengthTypeEnum.pt;
static SVG_LENGTHTYPE_PC = SVGLengthTypeEnum.pc;
// Internal properties
[PropertySymbol.window];
[PropertySymbol.getAttribute] = null;
[PropertySymbol.setAttribute] = null;
[PropertySymbol.attributeValue] = null;
[PropertySymbol.readOnly] = false;
/**
* Constructor.
*
* @param illegalConstructorSymbol Illegal constructor symbol.
* @param window Window.
* @param [options] Options.
* @param [options.readOnly] Read only.
* @param [options.getAttribute] Get attribute.
* @param [options.setAttribute] Set attribute.
*/
constructor(illegalConstructorSymbol, window, options) {
if (illegalConstructorSymbol !== PropertySymbol.illegalConstructor) {
throw new TypeError('Illegal constructor');
}
this[PropertySymbol.window] = window;
if (options) {
this[PropertySymbol.readOnly] = !!options.readOnly;
this[PropertySymbol.getAttribute] = options.getAttribute || null;
this[PropertySymbol.setAttribute] = options.setAttribute || null;
}
}
/**
* Returns unit type.
*
* @returns Unit type.
*/
get unitType() {
const attributeValue = this[PropertySymbol.getAttribute]
? this[PropertySymbol.getAttribute]() || ''
: this[PropertySymbol.attributeValue] || '';
const match = attributeValue.match(ATTRIBUTE_REGEXP);
if (!match) {
return SVGLengthTypeEnum.unknown;
}
if (isNaN(parseFloat(match[1]))) {
return SVGLengthTypeEnum.unknown;
}
switch (match[2]) {
case '':
return SVGLengthTypeEnum.number;
case 'px':
return SVGLengthTypeEnum.px;
case 'cm':
return SVGLengthTypeEnum.cm;
case 'mm':
return SVGLengthTypeEnum.mm;
case 'in':
return SVGLengthTypeEnum.in;
case 'pt':
return SVGLengthTypeEnum.pt;
case 'pc':
return SVGLengthTypeEnum.pc;
case 'em':
case 'ex':
case '%':
throw new this[PropertySymbol.window].TypeError(`Failed to execute 'value' on 'SVGLength': Could not resolve relative length.`);
default:
return SVGLengthTypeEnum.unknown;
}
}
/**
* Returns value.
*
* @returns Value.
*/
get value() {
const attributeValue = this[PropertySymbol.getAttribute]
? this[PropertySymbol.getAttribute]() || ''
: this[PropertySymbol.attributeValue] || '';
const match = attributeValue.match(ATTRIBUTE_REGEXP);
if (!match) {
return 0;
}
const parsedValue = parseFloat(match[1]);
if (isNaN(parsedValue)) {
return 0;
}
switch (match[2]) {
case '':
return parsedValue;
case 'px':
return parsedValue;
case 'cm':
return (parsedValue / 2.54) * 96;
case 'mm':
return (parsedValue / 25.4) * 96;
case 'in':
return parsedValue * 96;
case 'pt':
return parsedValue * 72;
case 'pc':
return parsedValue * 6;
case 'em':
case 'ex':
case '%':
throw new this[PropertySymbol.window].TypeError(`Failed to execute 'value' on 'SVGLength': Could not resolve relative length.`);
default:
return 0;
}
}
/**
* Sets value.
*
* @param value Value in pixels.
*/
set value(value) {
if (this[PropertySymbol.readOnly]) {
throw new this[PropertySymbol.window].TypeError(`Failed to set the 'value' property on 'SVGLength': The object is read-only.`);
}
// Value in pixels
value = typeof value !== 'number' ? parseFloat(String(value)) : value;
if (isNaN(value)) {
throw new this[PropertySymbol.window].TypeError(`Failed to set the 'value' property on 'SVGLength': The provided float value is non-finite.`);
}
let unitType = '';
let valueInSpecifiedUnits = value;
switch (this.unitType) {
case SVGLengthTypeEnum.number:
valueInSpecifiedUnits = value;
unitType = '';
break;
case SVGLengthTypeEnum.px:
valueInSpecifiedUnits = value;
unitType = 'px';
break;
case SVGLengthTypeEnum.cm:
valueInSpecifiedUnits = (value / 96) * 2.54;
unitType = 'cm';
break;
case SVGLengthTypeEnum.mm:
valueInSpecifiedUnits = (value / 96) * 25.4;
unitType = 'mm';
break;
case SVGLengthTypeEnum.in:
valueInSpecifiedUnits = value / 96;
unitType = 'in';
break;
case SVGLengthTypeEnum.pt:
valueInSpecifiedUnits = value / 72;
unitType = 'pt';
break;
case SVGLengthTypeEnum.pc:
valueInSpecifiedUnits = value / 6;
unitType = 'pc';
break;
case SVGLengthTypeEnum.percentage:
case SVGLengthTypeEnum.ems:
case SVGLengthTypeEnum.exs:
throw new this[PropertySymbol.window].TypeError(`Failed to set the 'value' property on 'SVGLength': Could not resolve relative length.`);
default:
break;
}
this[PropertySymbol.attributeValue] = String(valueInSpecifiedUnits) + unitType;
if (this[PropertySymbol.setAttribute]) {
this[PropertySymbol.setAttribute](this[PropertySymbol.attributeValue]);
}
}
/**
* Returns value as string.
*
* @returns Value as string.
*/
get valueAsString() {
return this[PropertySymbol.getAttribute]
? this[PropertySymbol.getAttribute]() || '0'
: this[PropertySymbol.attributeValue] || '0';
}
/**
* Returns value in specified units.
*
* @returns Value in specified units.
*/
get valueInSpecifiedUnits() {
const attributeValue = this.valueAsString;
return parseFloat(attributeValue) || 0;
}
/**
* New value specific units.
*
* @param unitType
* @param value
*/
newValueSpecifiedUnits(unitType, value) {
if (this[PropertySymbol.readOnly]) {
throw new this[PropertySymbol.window].TypeError(`Failed to execute 'newValueSpecifiedUnits' on 'SVGLength': The object is read-only.`);
}
if (typeof unitType !== 'number') {
throw new this[PropertySymbol.window].TypeError(`Failed to execute 'newValueSpecifiedUnits' on 'SVGLength': parameter 1 ('unitType') is not of type 'number'.`);
}
value = typeof value !== 'number' ? parseFloat(String(value)) : value;
if (isNaN(value)) {
throw new this[PropertySymbol.window].TypeError(`Failed to execute 'newValueSpecifiedUnits' on 'SVGLength': The provided float value is non-finite.`);
}
let unit = '';
switch (unitType) {
case SVGLengthTypeEnum.number:
unit = '';
break;
case SVGLengthTypeEnum.px:
unit = 'px';
break;
case SVGLengthTypeEnum.cm:
unit = 'cm';
break;
case SVGLengthTypeEnum.mm:
unit = 'mm';
break;
case SVGLengthTypeEnum.in:
unit = 'in';
break;
case SVGLengthTypeEnum.pt:
unit = 'pt';
break;
case SVGLengthTypeEnum.pc:
unit = 'pc';
break;
case SVGLengthTypeEnum.ems:
case SVGLengthTypeEnum.exs:
case SVGLengthTypeEnum.percentage:
throw new this[PropertySymbol.window].TypeError(`Failed to execute 'newValueSpecifiedUnits' on 'SVGLength': Could not resolve relative length.`);
default:
break;
}
this[PropertySymbol.attributeValue] = String(value) + unit;
if (this[PropertySymbol.setAttribute]) {
this[PropertySymbol.setAttribute](this[PropertySymbol.attributeValue]);
}
}
/**
* Convert to specific units.
* @param unitType
*/
convertToSpecifiedUnits(unitType) {
if (this[PropertySymbol.readOnly]) {
throw new this[PropertySymbol.window].TypeError(`Failed to execute 'convertToSpecifiedUnits' on 'SVGLength': The object is read-only.`);
}
if (typeof unitType !== 'number') {
throw new this[PropertySymbol.window].TypeError(`Failed to execute 'convertToSpecifiedUnits' on 'SVGLength': parameter 1 ('unitType') is not of type 'number'.`);
}
let value = this.value;
let unit = '';
switch (unitType) {
case SVGLengthTypeEnum.number:
unit = '';
break;
case SVGLengthTypeEnum.px:
unit = 'px';
break;
case SVGLengthTypeEnum.cm:
value = (value / 96) * 2.54;
unit = 'cm';
break;
case SVGLengthTypeEnum.mm:
value = (value / 96) * 25.4;
unit = 'mm';
break;
case SVGLengthTypeEnum.in:
value = value / 96;
unit = 'in';
break;
case SVGLengthTypeEnum.pt:
value = value / 72;
unit = 'pt';
break;
case SVGLengthTypeEnum.pc:
value = value / 6;
unit = 'pc';
break;
case SVGLengthTypeEnum.percentage:
case SVGLengthTypeEnum.ems:
case SVGLengthTypeEnum.exs:
throw new this[PropertySymbol.window].TypeError(`Failed to execute 'convertToSpecifiedUnits' on 'SVGLength': Could not resolve relative length.`);
default:
break;
}
this[PropertySymbol.attributeValue] = String(value) + unit;
if (this[PropertySymbol.setAttribute]) {
this[PropertySymbol.setAttribute](this[PropertySymbol.attributeValue]);
}
}
}
//# sourceMappingURL=SVGLength.js.map

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1,102 @@
import * as PropertySymbol from '../PropertySymbol.js';
import BrowserWindow from '../window/BrowserWindow.js';
import SVGLength from './SVGLength.js';
/**
* SVG Length List.
*
* @see https://developer.mozilla.org/en-US/docs/Web/API/SVGLengthList
*/
export default class SVGLengthList {
[index: number]: SVGLength;
[PropertySymbol.window]: BrowserWindow;
[PropertySymbol.getAttribute]: (() => string | null) | null;
[PropertySymbol.setAttribute]: ((value: string) => void) | null;
[PropertySymbol.readOnly]: boolean;
private [PropertySymbol.cache];
/**
* Constructor.
*
* @param illegalConstructorSymbol Illegal constructor symbol.
* @param window Window.
* @param options Options.
* @param options.getAttribute Get attribute.
* @param options.setAttribute Set attribute.
* @param [options.readOnly] Read only.
*/
constructor(illegalConstructorSymbol: symbol, window: BrowserWindow, options: {
readOnly?: boolean;
getAttribute: () => string | null;
setAttribute: (value: string) => void;
});
/**
* Returns length.
*
* @returns Length.
*/
get length(): number;
/**
* Returns length.
*
* @returns Length.
*/
get numberOfItems(): number;
/**
* Returns an iterator, allowing you to go through all values of the key/value pairs contained in this object.
*/
[Symbol.iterator](): IterableIterator<SVGLength>;
/**
* Clears all items from the list.
*/
clear(): void;
/**
* Replace Token.
*
* @param newItem New item.
* @returns The item being replaced.
*/
initialize(newItem: SVGLength): SVGLength;
/**
* Returns item at index.
*
* @param index Index.
* @returns The item at the index.
**/
getItem(index: number | string): SVGLength;
/**
* Inserts a new item into the list at the specified position. The first item is number 0. If newItem is already in a list, it is removed from its previous list before it is inserted into this list. The inserted item is the item itself and not a copy. If the item is already in this list, note that the index of the item to insert before is before the removal of the item. If the index is equal to 0, then the new item is inserted at the front of the list. If the index is greater than or equal to numberOfItems, then the new item is appended to the end of the list.
*
* @param newItem The item to insert into the list.
* @param index Index.
* @returns The item being inserted.
*/
insertItemBefore(newItem: SVGLength, index: number): SVGLength;
/**
* Replaces an existing item in the list with a new item. If newItem is already in a list, it is removed from its previous list before it is inserted into this list. The inserted item is the item itself and not a copy. If the item is already in this list, note that the index of the item to replace is before the removal of the item.
*
* @param newItem The item to insert into the list.
* @param index Index.
* @returns The item being replaced.
*/
replaceItem(newItem: SVGLength, index: number): SVGLength;
/**
* Removes an existing item from the list.
*
* @param index Index.
* @returns The removed item.
*/
removeItem(index: number): SVGLength;
/**
* Appends an item to the end of the list.
*
* @param newItem The item to add to the list.
* @returns The item being appended.
*/
appendItem(newItem: SVGLength): SVGLength;
/**
* Returns item list from attribute value.
*
* @see https://infra.spec.whatwg.org/#split-on-ascii-whitespace
*/
[PropertySymbol.getItemList](): SVGLength[];
}
//# sourceMappingURL=SVGLengthList.d.ts.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"SVGLengthList.d.ts","sourceRoot":"","sources":["../../src/svg/SVGLengthList.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,cAAc,MAAM,sBAAsB,CAAC;AACvD,OAAO,aAAa,MAAM,4BAA4B,CAAC;AACvD,OAAO,SAAS,MAAM,gBAAgB,CAAC;AAIvC;;;;GAIG;AACH,MAAM,CAAC,OAAO,OAAO,aAAa;IACjC,CAAC,KAAK,EAAE,MAAM,GAAG,SAAS,CAAC;IAEpB,CAAC,cAAc,CAAC,MAAM,CAAC,EAAE,aAAa,CAAC;IACvC,CAAC,cAAc,CAAC,YAAY,CAAC,EAAE,CAAC,MAAM,MAAM,GAAG,IAAI,CAAC,GAAG,IAAI,CAAQ;IACnE,CAAC,cAAc,CAAC,YAAY,CAAC,EAAE,CAAC,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC,GAAG,IAAI,CAAQ;IACvE,CAAC,cAAc,CAAC,QAAQ,CAAC,EAAE,OAAO,CAAS;IAClD,OAAO,CAAC,CAAC,cAAc,CAAC,KAAK,CAAC,CAG5B;IAEF;;;;;;;;;OASG;gBAEF,wBAAwB,EAAE,MAAM,EAChC,MAAM,EAAE,aAAa,EACrB,OAAO,EAAE;QACR,QAAQ,CAAC,EAAE,OAAO,CAAC;QACnB,YAAY,EAAE,MAAM,MAAM,GAAG,IAAI,CAAC;QAClC,YAAY,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;KACtC;IA+FF;;;;OAIG;IACH,IAAW,MAAM,IAAI,MAAM,CAE1B;IAED;;;;OAIG;IACH,IAAW,aAAa,IAAI,MAAM,CAEjC;IAED;;OAEG;IACI,CAAC,MAAM,CAAC,QAAQ,CAAC,IAAI,gBAAgB,CAAC,SAAS,CAAC;IAIvD;;OAEG;IACI,KAAK,IAAI,IAAI;IAIpB;;;;;OAKG;IACI,UAAU,CAAC,OAAO,EAAE,SAAS,GAAG,SAAS;IAiChD;;;;;QAKI;IACG,OAAO,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS;IAUjD;;;;;;OAMG;IACI,gBAAgB,CAAC,OAAO,EAAE,SAAS,EAAE,KAAK,EAAE,MAAM,GAAG,SAAS;IA4CrE;;;;;;OAMG;IACI,WAAW,CAAC,OAAO,EAAE,SAAS,EAAE,KAAK,EAAE,MAAM,GAAG,SAAS;IAuDhE;;;;;OAKG;IACI,UAAU,CAAC,KAAK,EAAE,MAAM,GAAG,SAAS;IAmD3C;;;;;OAKG;IACI,UAAU,CAAC,OAAO,EAAE,SAAS,GAAG,SAAS;IAsChD;;;;OAIG;IACI,CAAC,cAAc,CAAC,WAAW,CAAC,IAAI,SAAS,EAAE;CA6ClD"}

View File

@@ -0,0 +1,381 @@
import ClassMethodBinder from '../utilities/ClassMethodBinder.js';
import DOMExceptionNameEnum from '../exception/DOMExceptionNameEnum.js';
import * as PropertySymbol from '../PropertySymbol.js';
import SVGLength from './SVGLength.js';
const ATTRIBUTE_SEPARATOR_REGEXP = /[\t\f\n\r, ]+/;
/**
* SVG Length List.
*
* @see https://developer.mozilla.org/en-US/docs/Web/API/SVGLengthList
*/
export default class SVGLengthList {
[PropertySymbol.window];
[PropertySymbol.getAttribute] = null;
[PropertySymbol.setAttribute] = null;
[PropertySymbol.readOnly] = false;
[PropertySymbol.cache] = {
items: [],
attributeValue: ''
};
/**
* Constructor.
*
* @param illegalConstructorSymbol Illegal constructor symbol.
* @param window Window.
* @param options Options.
* @param options.getAttribute Get attribute.
* @param options.setAttribute Set attribute.
* @param [options.readOnly] Read only.
*/
constructor(illegalConstructorSymbol, window, options) {
if (illegalConstructorSymbol !== PropertySymbol.illegalConstructor) {
throw new TypeError('Illegal constructor');
}
this[PropertySymbol.window] = window;
this[PropertySymbol.readOnly] = !!options.readOnly;
this[PropertySymbol.getAttribute] = options.getAttribute;
this[PropertySymbol.setAttribute] = options.setAttribute;
const methodBinder = new ClassMethodBinder(this, [SVGLengthList]);
return new Proxy(this, {
get: (target, property) => {
if (property === 'length' || property === 'numberOfItems') {
return target[PropertySymbol.getItemList]().length;
}
if (property in target || typeof property === 'symbol') {
methodBinder.bind(property);
return target[property];
}
const index = Number(property);
if (!isNaN(index)) {
return target[PropertySymbol.getItemList]()[index];
}
},
set(target, property, newValue) {
methodBinder.bind(property);
if (typeof property === 'symbol') {
target[property] = newValue;
return true;
}
const index = Number(property);
if (isNaN(index)) {
target[property] = newValue;
}
return true;
},
deleteProperty(target, property) {
if (typeof property === 'symbol') {
delete target[property];
return true;
}
const index = Number(property);
if (isNaN(index)) {
delete target[property];
}
return true;
},
ownKeys(target) {
return Object.keys(target[PropertySymbol.getItemList]());
},
has(target, property) {
if (property in target) {
return true;
}
if (typeof property === 'symbol') {
return false;
}
const index = Number(property);
return !isNaN(index) && index >= 0 && index < target[PropertySymbol.getItemList]().length;
},
defineProperty(target, property, descriptor) {
methodBinder.preventBinding(property);
if (property in target) {
Object.defineProperty(target, property, descriptor);
return true;
}
return false;
},
getOwnPropertyDescriptor(target, property) {
if (property in target || typeof property === 'symbol') {
return;
}
const index = Number(property);
const items = target[PropertySymbol.getItemList]();
if (!isNaN(index) && items[index]) {
return {
value: items[index],
writable: false,
enumerable: true,
configurable: true
};
}
}
});
}
/**
* Returns length.
*
* @returns Length.
*/
get length() {
return this[PropertySymbol.getItemList]().length;
}
/**
* Returns length.
*
* @returns Length.
*/
get numberOfItems() {
return this[PropertySymbol.getItemList]().length;
}
/**
* Returns an iterator, allowing you to go through all values of the key/value pairs contained in this object.
*/
[Symbol.iterator]() {
return this[PropertySymbol.getItemList]().values();
}
/**
* Clears all items from the list.
*/
clear() {
this[PropertySymbol.setAttribute]('');
}
/**
* Replace Token.
*
* @param newItem New item.
* @returns The item being replaced.
*/
initialize(newItem) {
if (this[PropertySymbol.readOnly]) {
throw new this[PropertySymbol.window].TypeError(`Failed to execute 'initialize' on 'SVGLengthList': The object is read-only.`);
}
if (arguments.length < 1) {
throw new this[PropertySymbol.window].TypeError(`Failed to execute 'initialize' on 'SVGLengthList': 1 arguments required, but only ${arguments.length} present.`);
}
for (const item of this[PropertySymbol.cache].items) {
item[PropertySymbol.getAttribute] = null;
item[PropertySymbol.setAttribute] = null;
}
newItem[PropertySymbol.getAttribute] = () => newItem[PropertySymbol.attributeValue];
newItem[PropertySymbol.setAttribute] = () => {
this[PropertySymbol.cache].attributeValue = this[PropertySymbol.getItemList]()
.map((item) => item[PropertySymbol.attributeValue] ?? '0')
.join(' ');
this[PropertySymbol.setAttribute](this[PropertySymbol.cache].attributeValue);
};
this[PropertySymbol.cache].items = [newItem];
this[PropertySymbol.cache].attributeValue = newItem[PropertySymbol.attributeValue];
this[PropertySymbol.setAttribute](newItem[PropertySymbol.attributeValue]);
return newItem;
}
/**
* Returns item at index.
*
* @param index Index.
* @returns The item at the index.
**/
getItem(index) {
const items = this[PropertySymbol.getItemList]();
if (typeof index === 'number') {
return items[index] ? items[index] : null;
}
index = Number(index);
index = isNaN(index) ? 0 : index;
return items[index] ? items[index] : null;
}
/**
* Inserts a new item into the list at the specified position. The first item is number 0. If newItem is already in a list, it is removed from its previous list before it is inserted into this list. The inserted item is the item itself and not a copy. If the item is already in this list, note that the index of the item to insert before is before the removal of the item. If the index is equal to 0, then the new item is inserted at the front of the list. If the index is greater than or equal to numberOfItems, then the new item is appended to the end of the list.
*
* @param newItem The item to insert into the list.
* @param index Index.
* @returns The item being inserted.
*/
insertItemBefore(newItem, index) {
if (this[PropertySymbol.readOnly]) {
throw new this[PropertySymbol.window].TypeError(`Failed to execute 'insertItemBefore' on 'SVGLengthList': The object is read-only.`);
}
if (arguments.length < 2) {
throw new this[PropertySymbol.window].TypeError(`Failed to execute 'insertItemBefore' on 'SVGLengthList': 2 arguments required, but only ${arguments.length} present.`);
}
const items = this[PropertySymbol.getItemList]();
const existingIndex = items.indexOf(newItem);
if (existingIndex !== -1) {
items.splice(existingIndex, 1);
}
if (index < 0) {
index = 0;
}
else if (index > items.length) {
index = items.length;
}
items.splice(index, 0, newItem);
newItem[PropertySymbol.getAttribute] = () => newItem[PropertySymbol.attributeValue];
newItem[PropertySymbol.setAttribute] = () => {
this[PropertySymbol.cache].attributeValue = this[PropertySymbol.getItemList]()
.map((item) => item[PropertySymbol.attributeValue] ?? '0')
.join(' ');
this[PropertySymbol.setAttribute](this[PropertySymbol.cache].attributeValue);
};
this[PropertySymbol.cache].attributeValue = items
.map((item) => item[PropertySymbol.attributeValue] ?? '0')
.join(' ');
this[PropertySymbol.setAttribute](this[PropertySymbol.cache].attributeValue);
return newItem;
}
/**
* Replaces an existing item in the list with a new item. If newItem is already in a list, it is removed from its previous list before it is inserted into this list. The inserted item is the item itself and not a copy. If the item is already in this list, note that the index of the item to replace is before the removal of the item.
*
* @param newItem The item to insert into the list.
* @param index Index.
* @returns The item being replaced.
*/
replaceItem(newItem, index) {
if (this[PropertySymbol.readOnly]) {
throw new this[PropertySymbol.window].TypeError(`Failed to execute 'replaceItem' on 'SVGLengthList': The object is read-only.`);
}
if (arguments.length < 2) {
throw new this[PropertySymbol.window].TypeError(`Failed to execute 'replaceItem' on 'SVGLengthList': 2 arguments required, but only ${arguments.length} present.`);
}
const items = this[PropertySymbol.getItemList]();
const existingIndex = items.indexOf(newItem);
if (existingIndex === index) {
return newItem;
}
if (existingIndex !== -1) {
items.splice(existingIndex, 1);
}
if (index < 0) {
index = 0;
}
else if (index >= items.length) {
index = items.length - 1;
}
if (items[index]) {
items[index][PropertySymbol.getAttribute] = null;
items[index][PropertySymbol.setAttribute] = null;
}
const replacedItem = items[index];
items[index] = newItem;
newItem[PropertySymbol.getAttribute] = () => newItem[PropertySymbol.attributeValue];
newItem[PropertySymbol.setAttribute] = () => {
this[PropertySymbol.cache].attributeValue = this[PropertySymbol.getItemList]()
.map((item) => item[PropertySymbol.attributeValue] ?? '0')
.join(' ');
this[PropertySymbol.setAttribute](this[PropertySymbol.cache].attributeValue);
};
this[PropertySymbol.cache].attributeValue = items
.map((item) => item[PropertySymbol.attributeValue] ?? '0')
.join(' ');
this[PropertySymbol.setAttribute](this[PropertySymbol.cache].attributeValue);
return replacedItem;
}
/**
* Removes an existing item from the list.
*
* @param index Index.
* @returns The removed item.
*/
removeItem(index) {
if (this[PropertySymbol.readOnly]) {
throw new this[PropertySymbol.window].TypeError(`Failed to execute 'removeItem' on 'SVGLengthList': The object is read-only.`);
}
if (arguments.length < 1) {
throw new this[PropertySymbol.window].TypeError(`Failed to execute 'removeItem' on 'SVGLengthList': 1 argument required, but only ${arguments.length} present.`);
}
const items = this[PropertySymbol.getItemList]();
index = Number(index);
if (isNaN(index)) {
index = 0;
}
if (index >= items.length) {
throw new this[PropertySymbol.window].DOMException(`Failed to execute 'removeItem' on 'SVGLengthList': The index provided (${index}) is greater than the maximum bound.`, DOMExceptionNameEnum.indexSizeError);
}
if (index < 0) {
throw new this[PropertySymbol.window].DOMException(`Failed to execute 'removeItem' on 'SVGLengthList': The index provided (${index}) is negative.`, DOMExceptionNameEnum.indexSizeError);
}
const removedItem = items[index];
if (removedItem) {
removedItem[PropertySymbol.getAttribute] = null;
removedItem[PropertySymbol.setAttribute] = null;
}
items.splice(index, 1);
this[PropertySymbol.setAttribute](items.map((item) => item[PropertySymbol.attributeValue] ?? '0').join(' '));
return removedItem;
}
/**
* Appends an item to the end of the list.
*
* @param newItem The item to add to the list.
* @returns The item being appended.
*/
appendItem(newItem) {
if (this[PropertySymbol.readOnly]) {
throw new this[PropertySymbol.window].TypeError(`Failed to execute 'appendItem' on 'SVGLengthList': The object is read-only.`);
}
if (arguments.length < 1) {
throw new this[PropertySymbol.window].TypeError(`Failed to execute 'appendItem' on 'SVGLengthList': 1 argument required, but only ${arguments.length} present.`);
}
const items = this[PropertySymbol.getItemList]();
const existingIndex = items.indexOf(newItem);
if (existingIndex !== -1) {
items.splice(existingIndex, 1);
}
items.push(newItem);
newItem[PropertySymbol.getAttribute] = () => newItem[PropertySymbol.attributeValue];
newItem[PropertySymbol.setAttribute] = () => {
this[PropertySymbol.cache].attributeValue = this[PropertySymbol.getItemList]()
.map((item) => item[PropertySymbol.attributeValue] ?? '0')
.join(' ');
this[PropertySymbol.setAttribute](this[PropertySymbol.cache].attributeValue);
};
this[PropertySymbol.cache].attributeValue = items
.map((item) => item[PropertySymbol.attributeValue] ?? '0')
.join(' ');
this[PropertySymbol.setAttribute](this[PropertySymbol.cache].attributeValue);
return newItem;
}
/**
* Returns item list from attribute value.
*
* @see https://infra.spec.whatwg.org/#split-on-ascii-whitespace
*/
[PropertySymbol.getItemList]() {
const attributeValue = this[PropertySymbol.getAttribute]() ?? '';
const cache = this[PropertySymbol.cache];
if (cache.attributeValue === attributeValue) {
return cache.items;
}
if (cache.items.length) {
for (const item of cache.items) {
item[PropertySymbol.getAttribute] = null;
item[PropertySymbol.setAttribute] = null;
}
}
// It is possible to make this statement shorter by using Array.from() and Set, but this is faster when comparing using a bench test.
const items = [];
const trimmed = attributeValue.trim();
if (trimmed) {
const parts = trimmed.split(ATTRIBUTE_SEPARATOR_REGEXP);
for (let i = 0, max = parts.length; i < max; i++) {
const item = new SVGLength(PropertySymbol.illegalConstructor, this[PropertySymbol.window], {
readOnly: this[PropertySymbol.readOnly],
getAttribute: () => item[PropertySymbol.attributeValue],
setAttribute: (value) => {
item[PropertySymbol.attributeValue] = value;
const newAttributeValue = items
.map((item) => item[PropertySymbol.attributeValue] ?? '0')
.join(' ');
cache.attributeValue = newAttributeValue;
this[PropertySymbol.setAttribute](newAttributeValue);
}
});
item[PropertySymbol.attributeValue] = parts[i];
items.push(item);
}
}
cache.attributeValue = attributeValue;
cache.items = items;
return items;
}
}
//# sourceMappingURL=SVGLengthList.js.map

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1,15 @@
declare enum SVGLengthTypeEnum {
unknown = 0,
number = 1,
percentage = 2,
ems = 3,
exs = 4,
px = 5,
cm = 6,
mm = 7,
in = 8,
pt = 9,
pc = 10
}
export default SVGLengthTypeEnum;
//# sourceMappingURL=SVGLengthTypeEnum.d.ts.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"SVGLengthTypeEnum.d.ts","sourceRoot":"","sources":["../../src/svg/SVGLengthTypeEnum.ts"],"names":[],"mappings":"AAAA,aAAK,iBAAiB;IACrB,OAAO,IAAI;IACX,MAAM,IAAI;IACV,UAAU,IAAI;IACd,GAAG,IAAI;IACP,GAAG,IAAI;IACP,EAAE,IAAI;IACN,EAAE,IAAI;IACN,EAAE,IAAI;IACN,EAAE,IAAI;IACN,EAAE,IAAI;IACN,EAAE,KAAK;CACP;AAED,eAAe,iBAAiB,CAAC"}

View File

@@ -0,0 +1,16 @@
var SVGLengthTypeEnum;
(function (SVGLengthTypeEnum) {
SVGLengthTypeEnum[SVGLengthTypeEnum["unknown"] = 0] = "unknown";
SVGLengthTypeEnum[SVGLengthTypeEnum["number"] = 1] = "number";
SVGLengthTypeEnum[SVGLengthTypeEnum["percentage"] = 2] = "percentage";
SVGLengthTypeEnum[SVGLengthTypeEnum["ems"] = 3] = "ems";
SVGLengthTypeEnum[SVGLengthTypeEnum["exs"] = 4] = "exs";
SVGLengthTypeEnum[SVGLengthTypeEnum["px"] = 5] = "px";
SVGLengthTypeEnum[SVGLengthTypeEnum["cm"] = 6] = "cm";
SVGLengthTypeEnum[SVGLengthTypeEnum["mm"] = 7] = "mm";
SVGLengthTypeEnum[SVGLengthTypeEnum["in"] = 8] = "in";
SVGLengthTypeEnum[SVGLengthTypeEnum["pt"] = 9] = "pt";
SVGLengthTypeEnum[SVGLengthTypeEnum["pc"] = 10] = "pc";
})(SVGLengthTypeEnum || (SVGLengthTypeEnum = {}));
export default SVGLengthTypeEnum;
//# sourceMappingURL=SVGLengthTypeEnum.js.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"SVGLengthTypeEnum.js","sourceRoot":"","sources":["../../src/svg/SVGLengthTypeEnum.ts"],"names":[],"mappings":"AAAA,IAAK,iBAYJ;AAZD,WAAK,iBAAiB;IACrB,+DAAW,CAAA;IACX,6DAAU,CAAA;IACV,qEAAc,CAAA;IACd,uDAAO,CAAA;IACP,uDAAO,CAAA;IACP,qDAAM,CAAA;IACN,qDAAM,CAAA;IACN,qDAAM,CAAA;IACN,qDAAM,CAAA;IACN,qDAAM,CAAA;IACN,sDAAO,CAAA;AACR,CAAC,EAZI,iBAAiB,KAAjB,iBAAiB,QAYrB;AAED,eAAe,iBAAiB,CAAC"}

163
frontend/node_modules/happy-dom/lib/svg/SVGMatrix.d.ts generated vendored Normal file
View File

@@ -0,0 +1,163 @@
import * as PropertySymbol from '../PropertySymbol.js';
import BrowserWindow from '../window/BrowserWindow.js';
import DOMMatrix from '../dom/dom-matrix/DOMMatrix.js';
/**
* SVG Matrix.
*
* Documentation missing at developer.mozilla.org.
*/
export default class SVGMatrix {
[PropertySymbol.window]: BrowserWindow;
[PropertySymbol.getAttribute]: (() => string | null) | null;
[PropertySymbol.setAttribute]: ((value: string) => void) | null;
[PropertySymbol.attributeValue]: string | null;
[PropertySymbol.readOnly]: boolean;
/**
* Constructor.
*
* @param illegalConstructorSymbol Illegal constructor symbol.
* @param window Window.
* @param [options] Options.
* @param [options.readOnly] Read only.
* @param [options.getAttribute] Get attribute.
* @param [options.setAttribute] Set attribute.
*/
constructor(illegalConstructorSymbol: symbol, window: BrowserWindow, options?: {
readOnly?: boolean;
getAttribute?: () => string | null;
setAttribute?: (value: string) => void;
});
/**
* Returns the `a` value of the matrix.
*/
get a(): number;
/**
* Sets the `a` value of the matrix.
*/
set a(value: number);
/**
* Returns the `b` value of the matrix.
*/
get b(): number;
/**
* Sets the `b` value of the matrix.
*/
set b(value: number);
/**
* Returns the `c` value of the matrix.
*/
get c(): number;
/**
* Sets the `c` value of the matrix.
*/
set c(value: number);
/**
* Returns the `d` value of the matrix.
*/
get d(): number;
/**
* Sets the `d` value of the matrix.
*/
set d(value: number);
/**
* Returns the `e` value of the matrix.
*/
get e(): number;
/**
* Sets the `e` value of the matrix.
*/
set e(value: number);
/**
* Returns the `f` value of the matrix.
*/
get f(): number;
/**
* Sets the `f` value of the matrix.
*/
set f(value: number);
/**
* Returns a new SVGMatrix instance which is the result of this matrix multiplied by the passed matrix.
*
* @param secondMatrix Matrix object.
* @returns A new SVGMatrix object.
*/
multiply(secondMatrix: SVGMatrix): SVGMatrix;
/**
* Returns a new SVGMatrix instance which is this matrix post multiplied by a translation matrix containing the passed values.
*
* @param [x=0] X component of the translation value.
* @param [y=0] Y component of the translation value.
* @returns The resulted matrix
*/
translate(x?: number, y?: number): SVGMatrix;
/**
* Returns a new SVGMatrix instance which is this matrix post multiplied by a scale 2D matrix containing the passed values.
*
* @param scale The scale factor.
* @returns The resulted matrix
*/
scale(scale: number): SVGMatrix;
/**
* Returns a new SVGMatrix instance which is this matrix post multiplied by a scale 3D matrix containing the passed values.
*
* @param [scaleX] X-Axis scale.
* @param [scaleY] Y-Axis scale.
* @returns The resulted matrix
*/
scaleNonUniform(scaleX?: number, scaleY?: number): SVGMatrix;
/**
* Returns a new SVGMatrix instance which is this matrix post multiplied by each of 3 rotation matrices about the major axes, first X, then Y, then Z.
*
* @param angle Angle of rotation in degrees.
* @returns The resulted matrix
*/
rotate(angle: number): SVGMatrix;
/**
* Returns a new SVGMatrix instance which is this matrix post multiplied by a skew matrix along the X axis by the given angle.
*
* Not implemented in Happy DOM yet.
*
* @param [x] X-Axis skew.
* @param [y] Y-Axis skew.
*/
rotateFromVector(x?: number, y?: number): SVGMatrix;
/**
* Returns a new SVGMatrix instance that specifies a skew transformation along X-Axis by the given angle.
*
* @param angle Angle amount in degrees to skew.
* @returns The resulted matrix
*/
skewX(angle: number): SVGMatrix;
/**
* Returns a new SVGMatrix instance that specifies a skew transformation along Y-Axis by the given angle.
*
* @param angle Angle amount in degrees to skew.
* @returns The resulted matrix
*/
skewY(angle: number): SVGMatrix;
/**
* Returns a new SVGMatrix instance which is this matrix flipped on X-axis.
*/
flipX(): SVGMatrix;
/**
* Returns a new SVGMatrix instance which is this matrix flipped on Y-axis.
*/
flipY(): SVGMatrix;
/**
* Returns a new SVGMatrix instance which is this matrix inverted.
*/
inverse(): SVGMatrix;
/**
* Returns DOM matrix.
*
* @returns DOM matrix.
*/
[PropertySymbol.getDOMMatrix](): DOMMatrix;
/**
* Sets DOM matrix.
*
* @param domMatrix DOM matrix.
*/
[PropertySymbol.setDOMMatrix](domMatrix: DOMMatrix): void;
}
//# sourceMappingURL=SVGMatrix.d.ts.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"SVGMatrix.d.ts","sourceRoot":"","sources":["../../src/svg/SVGMatrix.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,cAAc,MAAM,sBAAsB,CAAC;AACvD,OAAO,aAAa,MAAM,4BAA4B,CAAC;AACvD,OAAO,SAAS,MAAM,gCAAgC,CAAC;AAKvD;;;;GAIG;AACH,MAAM,CAAC,OAAO,OAAO,SAAS;IAEtB,CAAC,cAAc,CAAC,MAAM,CAAC,EAAE,aAAa,CAAC;IACvC,CAAC,cAAc,CAAC,YAAY,CAAC,EAAE,CAAC,MAAM,MAAM,GAAG,IAAI,CAAC,GAAG,IAAI,CAAQ;IACnE,CAAC,cAAc,CAAC,YAAY,CAAC,EAAE,CAAC,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC,GAAG,IAAI,CAAQ;IACvE,CAAC,cAAc,CAAC,cAAc,CAAC,EAAE,MAAM,GAAG,IAAI,CAAQ;IACtD,CAAC,cAAc,CAAC,QAAQ,CAAC,EAAE,OAAO,CAAS;IAElD;;;;;;;;;OASG;gBAEF,wBAAwB,EAAE,MAAM,EAChC,MAAM,EAAE,aAAa,EACrB,OAAO,CAAC,EAAE;QACT,QAAQ,CAAC,EAAE,OAAO,CAAC;QACn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;OAKG;IACI,KAAK,CAAC,KAAK,EAAE,MAAM,GAAG,SAAS;IAQtC;;;;;OAKG;IACI,KAAK,CAAC,KAAK,EAAE,MAAM,GAAG,SAAS;IAQtC;;OAEG;IACI,KAAK,IAAI,SAAS;IAQzB;;OAEG;IACI,KAAK,IAAI,SAAS;IAQzB;;OAEG;IACI,OAAO,IAAI,SAAS;IAQ3B;;;;OAIG;IACI,CAAC,cAAc,CAAC,YAAY,CAAC,IAAI,SAAS;IA0FjD;;;;OAIG;IACI,CAAC,cAAc,CAAC,YAAY,CAAC,CAAC,SAAS,EAAE,SAAS,GAAG,IAAI;CAOhE"}

362
frontend/node_modules/happy-dom/lib/svg/SVGMatrix.js generated vendored Normal file
View File

@@ -0,0 +1,362 @@
import * as PropertySymbol from '../PropertySymbol.js';
import DOMMatrix from '../dom/dom-matrix/DOMMatrix.js';
const TRANSFORM_REGEXP = /([a-zA-Z0-9]+)\(([^)]+)\)/;
const TRANSFORM_PARAMETER_SPLIT_REGEXP = /[\s,]+/;
/**
* SVG Matrix.
*
* Documentation missing at developer.mozilla.org.
*/
export default class SVGMatrix {
// Internal properties
[PropertySymbol.window];
[PropertySymbol.getAttribute] = null;
[PropertySymbol.setAttribute] = null;
[PropertySymbol.attributeValue] = null;
[PropertySymbol.readOnly] = false;
/**
* Constructor.
*
* @param illegalConstructorSymbol Illegal constructor symbol.
* @param window Window.
* @param [options] Options.
* @param [options.readOnly] Read only.
* @param [options.getAttribute] Get attribute.
* @param [options.setAttribute] Set attribute.
*/
constructor(illegalConstructorSymbol, window, options) {
if (illegalConstructorSymbol !== PropertySymbol.illegalConstructor) {
throw new TypeError('Illegal constructor');
}
this[PropertySymbol.window] = window;
if (options) {
this[PropertySymbol.readOnly] = !!options.readOnly;
this[PropertySymbol.getAttribute] = options.getAttribute || null;
this[PropertySymbol.setAttribute] = options.setAttribute || null;
}
}
/**
* Returns the `a` value of the matrix.
*/
get a() {
return this[PropertySymbol.getDOMMatrix]().a;
}
/**
* Sets the `a` value of the matrix.
*/
set a(value) {
if (this[PropertySymbol.readOnly]) {
return;
}
const domMatrix = this[PropertySymbol.getDOMMatrix]();
domMatrix.a = value;
this[PropertySymbol.setDOMMatrix](domMatrix);
}
/**
* Returns the `b` value of the matrix.
*/
get b() {
return this[PropertySymbol.getDOMMatrix]().b;
}
/**
* Sets the `b` value of the matrix.
*/
set b(value) {
if (this[PropertySymbol.readOnly]) {
return;
}
const domMatrix = this[PropertySymbol.getDOMMatrix]();
domMatrix.b = value;
this[PropertySymbol.setDOMMatrix](domMatrix);
}
/**
* Returns the `c` value of the matrix.
*/
get c() {
return this[PropertySymbol.getDOMMatrix]().c;
}
/**
* Sets the `c` value of the matrix.
*/
set c(value) {
if (this[PropertySymbol.readOnly]) {
return;
}
const domMatrix = this[PropertySymbol.getDOMMatrix]();
domMatrix.c = value;
this[PropertySymbol.setDOMMatrix](domMatrix);
}
/**
* Returns the `d` value of the matrix.
*/
get d() {
return this[PropertySymbol.getDOMMatrix]().d;
}
/**
* Sets the `d` value of the matrix.
*/
set d(value) {
if (this[PropertySymbol.readOnly]) {
return;
}
const domMatrix = this[PropertySymbol.getDOMMatrix]();
domMatrix.d = value;
this[PropertySymbol.setDOMMatrix](domMatrix);
}
/**
* Returns the `e` value of the matrix.
*/
get e() {
return this[PropertySymbol.getDOMMatrix]().e;
}
/**
* Sets the `e` value of the matrix.
*/
set e(value) {
if (this[PropertySymbol.readOnly]) {
return;
}
const domMatrix = this[PropertySymbol.getDOMMatrix]();
domMatrix.e = value;
this[PropertySymbol.setDOMMatrix](domMatrix);
}
/**
* Returns the `f` value of the matrix.
*/
get f() {
return this[PropertySymbol.getDOMMatrix]().f;
}
/**
* Sets the `f` value of the matrix.
*/
set f(value) {
if (this[PropertySymbol.readOnly]) {
return;
}
const domMatrix = this[PropertySymbol.getDOMMatrix]();
domMatrix.f = value;
this[PropertySymbol.setDOMMatrix](domMatrix);
}
/**
* Returns a new SVGMatrix instance which is the result of this matrix multiplied by the passed matrix.
*
* @param secondMatrix Matrix object.
* @returns A new SVGMatrix object.
*/
multiply(secondMatrix) {
if (!(secondMatrix instanceof SVGMatrix)) {
throw new this[PropertySymbol.window].TypeError("Failed to execute 'multiply' on 'SVGMatrix': parameter 1 is not of type 'SVGMatrix'.");
}
const domMatrix = this[PropertySymbol.getDOMMatrix]();
const svgMatrix = new SVGMatrix(PropertySymbol.illegalConstructor, this[PropertySymbol.window]);
domMatrix.multiplySelf(secondMatrix[PropertySymbol.getDOMMatrix]());
svgMatrix[PropertySymbol.setDOMMatrix](domMatrix);
return svgMatrix;
}
/**
* Returns a new SVGMatrix instance which is this matrix post multiplied by a translation matrix containing the passed values.
*
* @param [x=0] X component of the translation value.
* @param [y=0] Y component of the translation value.
* @returns The resulted matrix
*/
translate(x = 0, y = 0) {
const domMatrix = this[PropertySymbol.getDOMMatrix]();
const svgMatrix = new SVGMatrix(PropertySymbol.illegalConstructor, this[PropertySymbol.window]);
domMatrix.translateSelf(x, y);
svgMatrix[PropertySymbol.setDOMMatrix](domMatrix);
return svgMatrix;
}
/**
* Returns a new SVGMatrix instance which is this matrix post multiplied by a scale 2D matrix containing the passed values.
*
* @param scale The scale factor.
* @returns The resulted matrix
*/
scale(scale) {
const domMatrix = this[PropertySymbol.getDOMMatrix]();
const svgMatrix = new SVGMatrix(PropertySymbol.illegalConstructor, this[PropertySymbol.window]);
domMatrix.scaleSelf(scale);
svgMatrix[PropertySymbol.setDOMMatrix](domMatrix);
return svgMatrix;
}
/**
* Returns a new SVGMatrix instance which is this matrix post multiplied by a scale 3D matrix containing the passed values.
*
* @param [scaleX] X-Axis scale.
* @param [scaleY] Y-Axis scale.
* @returns The resulted matrix
*/
scaleNonUniform(scaleX = 1, scaleY = 1) {
const domMatrix = this[PropertySymbol.getDOMMatrix]();
const svgMatrix = new SVGMatrix(PropertySymbol.illegalConstructor, this[PropertySymbol.window]);
domMatrix.scaleNonUniformSelf(scaleX, scaleY);
svgMatrix[PropertySymbol.setDOMMatrix](domMatrix);
return svgMatrix;
}
/**
* Returns a new SVGMatrix instance which is this matrix post multiplied by each of 3 rotation matrices about the major axes, first X, then Y, then Z.
*
* @param angle Angle of rotation in degrees.
* @returns The resulted matrix
*/
rotate(angle) {
const domMatrix = this[PropertySymbol.getDOMMatrix]();
const svgMatrix = new SVGMatrix(PropertySymbol.illegalConstructor, this[PropertySymbol.window]);
domMatrix.rotateSelf(angle);
svgMatrix[PropertySymbol.setDOMMatrix](domMatrix);
return svgMatrix;
}
/**
* Returns a new SVGMatrix instance which is this matrix post multiplied by a skew matrix along the X axis by the given angle.
*
* Not implemented in Happy DOM yet.
*
* @param [x] X-Axis skew.
* @param [y] Y-Axis skew.
*/
rotateFromVector(x = 0, y = 0) {
const domMatrix = this[PropertySymbol.getDOMMatrix]();
const svgMatrix = new SVGMatrix(PropertySymbol.illegalConstructor, this[PropertySymbol.window]);
domMatrix.rotateFromVectorSelf(x, y);
svgMatrix[PropertySymbol.setDOMMatrix](domMatrix);
return svgMatrix;
}
/**
* Returns a new SVGMatrix instance that specifies a skew transformation along X-Axis by the given angle.
*
* @param angle Angle amount in degrees to skew.
* @returns The resulted matrix
*/
skewX(angle) {
const domMatrix = this[PropertySymbol.getDOMMatrix]();
const svgMatrix = new SVGMatrix(PropertySymbol.illegalConstructor, this[PropertySymbol.window]);
domMatrix.skewXSelf(angle);
svgMatrix[PropertySymbol.setDOMMatrix](domMatrix);
return svgMatrix;
}
/**
* Returns a new SVGMatrix instance that specifies a skew transformation along Y-Axis by the given angle.
*
* @param angle Angle amount in degrees to skew.
* @returns The resulted matrix
*/
skewY(angle) {
const domMatrix = this[PropertySymbol.getDOMMatrix]();
const svgMatrix = new SVGMatrix(PropertySymbol.illegalConstructor, this[PropertySymbol.window]);
domMatrix.skewYSelf(angle);
svgMatrix[PropertySymbol.setDOMMatrix](domMatrix);
return svgMatrix;
}
/**
* Returns a new SVGMatrix instance which is this matrix flipped on X-axis.
*/
flipX() {
const domMatrix = this[PropertySymbol.getDOMMatrix]();
const svgMatrix = new SVGMatrix(PropertySymbol.illegalConstructor, this[PropertySymbol.window]);
domMatrix.flipXSelf();
svgMatrix[PropertySymbol.setDOMMatrix](domMatrix);
return svgMatrix;
}
/**
* Returns a new SVGMatrix instance which is this matrix flipped on Y-axis.
*/
flipY() {
const domMatrix = this[PropertySymbol.getDOMMatrix]();
const svgMatrix = new SVGMatrix(PropertySymbol.illegalConstructor, this[PropertySymbol.window]);
domMatrix.flipYSelf();
svgMatrix[PropertySymbol.setDOMMatrix](domMatrix);
return svgMatrix;
}
/**
* Returns a new SVGMatrix instance which is this matrix inverted.
*/
inverse() {
const domMatrix = this[PropertySymbol.getDOMMatrix]();
const svgMatrix = new SVGMatrix(PropertySymbol.illegalConstructor, this[PropertySymbol.window]);
domMatrix.invertSelf();
svgMatrix[PropertySymbol.setDOMMatrix](domMatrix);
return svgMatrix;
}
/**
* Returns DOM matrix.
*
* @returns DOM matrix.
*/
[PropertySymbol.getDOMMatrix]() {
const attribute = this[PropertySymbol.getAttribute]
? this[PropertySymbol.getAttribute]()
: this[PropertySymbol.attributeValue];
if (!attribute) {
return new DOMMatrix();
}
const match = attribute.match(TRANSFORM_REGEXP);
if (!match) {
return new DOMMatrix();
}
const parameters = [];
for (const parameter of match[2].trim().split(TRANSFORM_PARAMETER_SPLIT_REGEXP)) {
const value = Number(parameter);
if (isNaN(value)) {
throw new this[PropertySymbol.window].TypeError(`Failed to parse transform attribute: Expected number, but got "${parameter}" in "${attribute}".`);
}
parameters.push(value);
}
switch (match[1]) {
case 'matrix':
if (parameters.length !== 6) {
throw new this[PropertySymbol.window].TypeError(`Failed to parse transform attribute: Expected 6 parameters in "${attribute}".`);
}
return DOMMatrix[PropertySymbol.fromString](attribute);
case 'scale':
case 'translate':
if (parameters.length !== 1 && parameters.length !== 2) {
throw new this[PropertySymbol.window].TypeError(`Failed to parse transform attribute: Expected 1 or 2 parameters in "${attribute}".`);
}
return DOMMatrix[PropertySymbol.fromString](attribute);
case 'skewY':
case 'skewX':
if (parameters.length !== 1) {
throw new this[PropertySymbol.window].TypeError(`Failed to parse transform attribute: Expected 1 parameter in "${attribute}".`);
}
return DOMMatrix[PropertySymbol.fromString](attribute);
case 'rotate':
const domMatrix = new DOMMatrix();
if (parameters.length !== 1 && parameters.length !== 3) {
throw new this[PropertySymbol.window].TypeError(`Failed to parse transform attribute: Expected 1 or 3 parameters in "${attribute}".`);
}
const [angle, x, y] = parameters;
if (x || y) {
domMatrix.translateSelf(x, y);
}
const radian = (angle * Math.PI) / 180;
/**
* @see https://www.w3.org/TR/SVG11/coords.html#TransformAttribute
**/
domMatrix.multiplySelf(
// prettier-ignore
new DOMMatrix([
Math.cos(radian), Math.sin(radian), -Math.sin(radian),
Math.cos(radian), 0, 0
]));
if (x || y) {
domMatrix.translateSelf(-x, -y);
}
return domMatrix;
default:
throw new this[PropertySymbol.window].TypeError(`Failed to parse transform attribute: Unknown transformation "${attribute}".`);
}
}
/**
* Sets DOM matrix.
*
* @param domMatrix DOM matrix.
*/
[PropertySymbol.setDOMMatrix](domMatrix) {
this[PropertySymbol.attributeValue] = domMatrix.toString().replace(/, /g, ' ');
if (this[PropertySymbol.setAttribute]) {
this[PropertySymbol.setAttribute](this[PropertySymbol.attributeValue]);
}
}
}
//# sourceMappingURL=SVGMatrix.js.map

File diff suppressed because one or more lines are too long

42
frontend/node_modules/happy-dom/lib/svg/SVGNumber.d.ts generated vendored Normal file
View File

@@ -0,0 +1,42 @@
import * as PropertySymbol from '../PropertySymbol.js';
import BrowserWindow from '../window/BrowserWindow.js';
/**
* SVG number.
*
* @see https://developer.mozilla.org/en-US/docs/Web/API/SVGNumber
*/
export default class SVGNumber {
[PropertySymbol.window]: BrowserWindow;
[PropertySymbol.getAttribute]: (() => string | null) | null;
[PropertySymbol.setAttribute]: ((value: string) => void) | null;
[PropertySymbol.attributeValue]: string | null;
[PropertySymbol.readOnly]: boolean;
/**
* Constructor.
*
* @param illegalConstructorSymbol Illegal constructor symbol.
* @param window Window.
* @param [options] Options.
* @param [options.readOnly] Read only.
* @param [options.getAttribute] Get attribute.
* @param [options.setAttribute] Set attribute
*/
constructor(illegalConstructorSymbol: symbol, window: BrowserWindow, options?: {
readOnly?: boolean;
getAttribute?: () => string | null;
setAttribute?: (value: string) => void;
});
/**
* Returns value.
*
* @returns Value.
*/
get value(): number;
/**
* Sets value.
*
* @param value Value.
*/
set value(value: number);
}
//# sourceMappingURL=SVGNumber.d.ts.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"SVGNumber.d.ts","sourceRoot":"","sources":["../../src/svg/SVGNumber.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,cAAc,MAAM,sBAAsB,CAAC;AACvD,OAAO,aAAa,MAAM,4BAA4B,CAAC;AAEvD;;;;GAIG;AACH,MAAM,CAAC,OAAO,OAAO,SAAS;IAEtB,CAAC,cAAc,CAAC,MAAM,CAAC,EAAE,aAAa,CAAC;IACvC,CAAC,cAAc,CAAC,YAAY,CAAC,EAAE,CAAC,MAAM,MAAM,GAAG,IAAI,CAAC,GAAG,IAAI,CAAQ;IACnE,CAAC,cAAc,CAAC,YAAY,CAAC,EAAE,CAAC,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC,GAAG,IAAI,CAAQ;IACvE,CAAC,cAAc,CAAC,cAAc,CAAC,EAAE,MAAM,GAAG,IAAI,CAAQ;IACtD,CAAC,cAAc,CAAC,QAAQ,CAAC,EAAE,OAAO,CAAS;IAElD;;;;;;;;;OASG;gBAEF,wBAAwB,EAAE,MAAM,EAChC,MAAM,EAAE,aAAa,EACrB,OAAO,CAAC,EAAE;QACT,QAAQ,CAAC,EAAE,OAAO,CAAC;QACnB,YAAY,CAAC,EAAE,MAAM,MAAM,GAAG,IAAI,CAAC;QACnC,YAAY,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;KACvC;IAeF;;;;OAIG;IACH,IAAW,KAAK,IAAI,MAAM,CAKzB;IAED;;;;OAIG;IACH,IAAW,KAAK,CAAC,KAAK,EAAE,MAAM,EAgB7B;CACD"}

65
frontend/node_modules/happy-dom/lib/svg/SVGNumber.js generated vendored Normal file
View File

@@ -0,0 +1,65 @@
import * as PropertySymbol from '../PropertySymbol.js';
/**
* SVG number.
*
* @see https://developer.mozilla.org/en-US/docs/Web/API/SVGNumber
*/
export default class SVGNumber {
// Internal properties
[PropertySymbol.window];
[PropertySymbol.getAttribute] = null;
[PropertySymbol.setAttribute] = null;
[PropertySymbol.attributeValue] = null;
[PropertySymbol.readOnly] = false;
/**
* Constructor.
*
* @param illegalConstructorSymbol Illegal constructor symbol.
* @param window Window.
* @param [options] Options.
* @param [options.readOnly] Read only.
* @param [options.getAttribute] Get attribute.
* @param [options.setAttribute] Set attribute
*/
constructor(illegalConstructorSymbol, window, options) {
if (illegalConstructorSymbol !== PropertySymbol.illegalConstructor) {
throw new TypeError('Illegal constructor');
}
this[PropertySymbol.window] = window;
if (options) {
this[PropertySymbol.readOnly] = !!options.readOnly;
this[PropertySymbol.getAttribute] = options.getAttribute || null;
this[PropertySymbol.setAttribute] = options.setAttribute || null;
}
}
/**
* Returns value.
*
* @returns Value.
*/
get value() {
const attributeValue = this[PropertySymbol.getAttribute]
? this[PropertySymbol.getAttribute]()
: this[PropertySymbol.attributeValue];
return parseFloat(attributeValue || '0');
}
/**
* Sets value.
*
* @param value Value.
*/
set value(value) {
if (this[PropertySymbol.readOnly]) {
throw new TypeError(`Failed to set the 'value' property on 'SVGNumber': The object is read-only.`);
}
const parsedValue = typeof value !== 'number' ? parseFloat(String(value)) : value;
if (isNaN(parsedValue)) {
throw new TypeError(`Failed to set the 'value' property on 'SVGNumber': The provided value is not a number.`);
}
this[PropertySymbol.attributeValue] = String(value);
if (this[PropertySymbol.setAttribute]) {
this[PropertySymbol.setAttribute](this[PropertySymbol.attributeValue] || '');
}
}
}
//# sourceMappingURL=SVGNumber.js.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"SVGNumber.js","sourceRoot":"","sources":["../../src/svg/SVGNum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;OAIG;IACH,IAAW,KAAK,CAAC,KAAa;QAC7B,IAAI,IAAI,CAAC,cAAc,CAAC,QAAQ,CAAC,EAAE,CAAC;YACnC,MAAM,IAAI,SAAS,CAClB,6EAA6E,CAC7E,CAAC;QACH,CAAC;QACD,MAAM,WAAW,GAAG,OAAO,KAAK,KAAK,QAAQ,CAAC,CAAC,CAAC,UAAU,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC;QAClF,IAAI,KAAK,CAAC,WAAW,CAAC,EAAE,CAAC;YACxB,MAAM,IAAI,SAAS,CAClB,wFAAwF,CACxF,CAAC;QACH,CAAC;QACD,IAAI,CAAC,cAAc,CAAC,cAAc,CAAC,GAAG,MAAM,CAAC,KAAK,CAAC,CAAC;QACpD,IAAI,IAAI,CAAC,cAAc,CAAC,YAAY,CAAC,EAAE,CAAC;YACvC,IAAI,CAAC,cAAc,CAAC,YAAY,CAAC,CAAC,IAAI,CAAC,cAAc,CAAC,cAAc,CAAC,IAAI,EAAE,CAAC,CAAC;QAC9E,CAAC;IACF,CAAC;CACD"}

View File

@@ -0,0 +1,102 @@
import * as PropertySymbol from '../PropertySymbol.js';
import BrowserWindow from '../window/BrowserWindow.js';
import SVGNumber from './SVGNumber.js';
/**
* SVGNumberList.
*
* @see https://developer.mozilla.org/en-US/docs/Web/API/SVGNumberList
*/
export default class SVGNumberList {
[index: number]: SVGNumber;
[PropertySymbol.window]: BrowserWindow;
[PropertySymbol.getAttribute]: (() => string | null) | null;
[PropertySymbol.setAttribute]: ((value: string) => void) | null;
[PropertySymbol.readOnly]: boolean;
private [PropertySymbol.cache];
/**
* Constructor.
*
* @param illegalConstructorSymbol Illegal constructor symbol.
* @param window Window.
* @param options Options.
* @param [options.readOnly] Read only.
* @param options.getAttribute Get attribute.
* @param options.setAttribute Set attribute.
*/
constructor(illegalConstructorSymbol: symbol, window: BrowserWindow, options: {
readOnly?: boolean;
getAttribute: () => string | null;
setAttribute: (value: string) => void;
});
/**
* Returns length.
*
* @returns Length.
*/
get length(): number;
/**
* Returns length.
*
* @returns Length.
*/
get numberOfItems(): number;
/**
* Returns an iterator, allowing you to go through all values of the key/value pairs contained in this object.
*/
[Symbol.iterator](): IterableIterator<SVGNumber>;
/**
* Clears all items from the list.
*/
clear(): void;
/**
* Replace Token.
*
* @param newItem New item.
* @returns The item being replaced.
*/
initialize(newItem: SVGNumber): SVGNumber;
/**
* Returns item at index.
*
* @param index Index.
* @returns The item at the index.
**/
getItem(index: number | string): SVGNumber;
/**
* Inserts a new item into the list at the specified position. The first item is number 0. If newItem is already in a list, it is removed from its previous list before it is inserted into this list. The inserted item is the item itself and not a copy. If the item is already in this list, note that the index of the item to insert before is before the removal of the item. If the index is equal to 0, then the new item is inserted at the front of the list. If the index is greater than or equal to numberOfItems, then the new item is appended to the end of the list.
*
* @param newItem The item to insert into the list.
* @param index Index.
* @returns The item being inserted.
*/
insertItemBefore(newItem: SVGNumber, index: number): SVGNumber;
/**
* Replaces an existing item in the list with a new item. If newItem is already in a list, it is removed from its previous list before it is inserted into this list. The inserted item is the item itself and not a copy. If the item is already in this list, note that the index of the item to replace is before the removal of the item.
*
* @param newItem The item to insert into the list.
* @param index Index.
* @returns The item being replaced.
*/
replaceItem(newItem: SVGNumber, index: number): SVGNumber;
/**
* Removes an existing item from the list.
*
* @param index Index.
* @returns The removed item.
*/
removeItem(index: number): SVGNumber;
/**
* Appends an item to the end of the list.
*
* @param newItem The item to add to the list.
* @returns The item being appended.
*/
appendItem(newItem: SVGNumber): SVGNumber;
/**
* Returns item list from attribute value.
*
* @see https://infra.spec.whatwg.org/#split-on-ascii-whitespace
*/
[PropertySymbol.getItemList](): SVGNumber[];
}
//# sourceMappingURL=SVGNumberList.d.ts.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"SVGNumberList.d.ts","sourceRoot":"","sources":["../../src/svg/SVGNumberList.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,cAAc,MAAM,sBAAsB,CAAC;A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M,GAAG,SAAS;IAkDrE;;;;;;OAMG;IACI,WAAW,CAAC,OAAO,EAAE,SAAS,EAAE,KAAK,EAAE,MAAM,GAAG,SAAS;IA6DhE;;;;;OAKG;IACI,UAAU,CAAC,KAAK,EAAE,MAAM,GAAG,SAAS;IAmD3C;;;;;OAKG;IACI,UAAU,CAAC,OAAO,EAAE,SAAS,GAAG,SAAS;IA4ChD;;;;OAIG;IACI,CAAC,cAAc,CAAC,WAAW,CAAC,IAAI,SAAS,EAAE;CA2ClD"}

View File

@@ -0,0 +1,400 @@
import ClassMethodBinder from '../utilities/ClassMethodBinder.js';
import DOMExceptionNameEnum from '../exception/DOMExceptionNameEnum.js';
import * as PropertySymbol from '../PropertySymbol.js';
import SVGNumber from './SVGNumber.js';
const ATTRIBUTE_SEPARATOR_REGEXP = /[\t\f\n\r, ]+/;
/**
* SVGNumberList.
*
* @see https://developer.mozilla.org/en-US/docs/Web/API/SVGNumberList
*/
export default class SVGNumberList {
[PropertySymbol.window];
[PropertySymbol.getAttribute] = null;
[PropertySymbol.setAttribute] = null;
[PropertySymbol.readOnly] = false;
[PropertySymbol.cache] = {
items: [],
attributeValue: ''
};
/**
* Constructor.
*
* @param illegalConstructorSymbol Illegal constructor symbol.
* @param window Window.
* @param options Options.
* @param [options.readOnly] Read only.
* @param options.getAttribute Get attribute.
* @param options.setAttribute Set attribute.
*/
constructor(illegalConstructorSymbol, window, options) {
if (illegalConstructorSymbol !== PropertySymbol.illegalConstructor) {
throw new TypeError('Illegal constructor');
}
this[PropertySymbol.window] = window;
this[PropertySymbol.readOnly] = !!options.readOnly;
this[PropertySymbol.getAttribute] = options.getAttribute || null;
this[PropertySymbol.setAttribute] = options.setAttribute || null;
if (illegalConstructorSymbol !== PropertySymbol.illegalConstructor) {
throw new TypeError('Illegal constructor');
}
const methodBinder = new ClassMethodBinder(this, [SVGNumberList]);
return new Proxy(this, {
get: (target, property) => {
if (property === 'length' || property === 'numberOfItems') {
return target[PropertySymbol.getItemList]().length;
}
if (property in target || typeof property === 'symbol') {
methodBinder.bind(property);
return target[property];
}
const index = Number(property);
if (!isNaN(index)) {
return target[PropertySymbol.getItemList]()[index];
}
},
set(target, property, newValue) {
methodBinder.bind(property);
if (typeof property === 'symbol') {
target[property] = newValue;
return true;
}
const index = Number(property);
if (isNaN(index)) {
target[property] = newValue;
}
return true;
},
deleteProperty(target, property) {
if (typeof property === 'symbol') {
delete target[property];
return true;
}
const index = Number(property);
if (isNaN(index)) {
delete target[property];
}
return true;
},
ownKeys(target) {
return Object.keys(target[PropertySymbol.getItemList]());
},
has(target, property) {
if (property in target) {
return true;
}
if (typeof property === 'symbol') {
return false;
}
const index = Number(property);
return !isNaN(index) && index >= 0 && index < target[PropertySymbol.getItemList]().length;
},
defineProperty(target, property, descriptor) {
methodBinder.preventBinding(property);
if (property in target) {
Object.defineProperty(target, property, descriptor);
return true;
}
return false;
},
getOwnPropertyDescriptor(target, property) {
if (property in target || typeof property === 'symbol') {
return;
}
const index = Number(property);
const items = target[PropertySymbol.getItemList]();
if (!isNaN(index) && items[index]) {
return {
value: items[index],
writable: false,
enumerable: true,
configurable: true
};
}
}
});
}
/**
* Returns length.
*
* @returns Length.
*/
get length() {
return this[PropertySymbol.getItemList]().length;
}
/**
* Returns length.
*
* @returns Length.
*/
get numberOfItems() {
return this[PropertySymbol.getItemList]().length;
}
/**
* Returns an iterator, allowing you to go through all values of the key/value pairs contained in this object.
*/
[Symbol.iterator]() {
return this[PropertySymbol.getItemList]().values();
}
/**
* Clears all items from the list.
*/
clear() {
if (this[PropertySymbol.readOnly]) {
throw new this[PropertySymbol.window].TypeError(`Failed to execute 'clear' on 'SVGNumberList': The object is read-only.`);
}
for (const item of this[PropertySymbol.cache].items) {
item[PropertySymbol.getAttribute] = null;
item[PropertySymbol.setAttribute] = null;
}
this[PropertySymbol.cache].items = [];
this[PropertySymbol.cache].attributeValue = '';
this[PropertySymbol.setAttribute]('');
}
/**
* Replace Token.
*
* @param newItem New item.
* @returns The item being replaced.
*/
initialize(newItem) {
if (arguments.length < 1) {
throw new this[PropertySymbol.window].TypeError(`Failed to execute 'initialize' on 'SVGNumberList': 1 arguments required, but only ${arguments.length} present.`);
}
if (this[PropertySymbol.readOnly]) {
throw new this[PropertySymbol.window].TypeError(`Failed to execute 'initialize' on 'SVGNumberList': The object is read-only.`);
}
for (const item of this[PropertySymbol.cache].items) {
item[PropertySymbol.getAttribute] = null;
item[PropertySymbol.setAttribute] = null;
}
newItem[PropertySymbol.getAttribute] = () => newItem[PropertySymbol.attributeValue];
newItem[PropertySymbol.setAttribute] = () => {
this[PropertySymbol.cache].attributeValue = this[PropertySymbol.getItemList]()
.map((item) => item[PropertySymbol.attributeValue] || '0')
.join(' ');
this[PropertySymbol.setAttribute](this[PropertySymbol.cache].attributeValue);
};
this[PropertySymbol.cache].items = [newItem];
this[PropertySymbol.cache].attributeValue = newItem[PropertySymbol.attributeValue];
this[PropertySymbol.setAttribute](newItem[PropertySymbol.attributeValue]);
return newItem;
}
/**
* Returns item at index.
*
* @param index Index.
* @returns The item at the index.
**/
getItem(index) {
const items = this[PropertySymbol.getItemList]();
if (typeof index === 'number') {
return items[index] ? items[index] : null;
}
index = Number(index);
index = isNaN(index) ? 0 : index;
return items[index] ? items[index] : null;
}
/**
* Inserts a new item into the list at the specified position. The first item is number 0. If newItem is already in a list, it is removed from its previous list before it is inserted into this list. The inserted item is the item itself and not a copy. If the item is already in this list, note that the index of the item to insert before is before the removal of the item. If the index is equal to 0, then the new item is inserted at the front of the list. If the index is greater than or equal to numberOfItems, then the new item is appended to the end of the list.
*
* @param newItem The item to insert into the list.
* @param index Index.
* @returns The item being inserted.
*/
insertItemBefore(newItem, index) {
if (this[PropertySymbol.readOnly]) {
throw new this[PropertySymbol.window].TypeError(`Failed to execute 'insertItemBefore' on 'SVGNumberList': The object is read-only.`);
}
if (arguments.length < 2) {
throw new this[PropertySymbol.window].TypeError(`Failed to execute 'insertItemBefore' on 'SVGNumberList': 2 arguments required, but only ${arguments.length} present.`);
}
if (!(newItem instanceof SVGNumber)) {
throw new this[PropertySymbol.window].TypeError(`Failed to execute 'insertItemBefore' on 'SVGNumberList': parameter 1 is not of type 'SVGNumber'.`);
}
const items = this[PropertySymbol.getItemList]();
const existingIndex = items.indexOf(newItem);
if (existingIndex !== -1) {
items.splice(existingIndex, 1);
}
if (index < 0) {
index = 0;
}
else if (index > items.length) {
index = items.length;
}
items.splice(index, 0, newItem);
newItem[PropertySymbol.getAttribute] = () => newItem[PropertySymbol.attributeValue];
newItem[PropertySymbol.setAttribute] = () => {
this[PropertySymbol.cache].attributeValue = this[PropertySymbol.getItemList]()
.map((item) => item[PropertySymbol.attributeValue] || '0')
.join(' ');
this[PropertySymbol.setAttribute](this[PropertySymbol.cache].attributeValue);
};
this[PropertySymbol.cache].attributeValue = items
.map((item) => item[PropertySymbol.attributeValue] || '0')
.join(' ');
this[PropertySymbol.setAttribute](this[PropertySymbol.cache].attributeValue);
return newItem;
}
/**
* Replaces an existing item in the list with a new item. If newItem is already in a list, it is removed from its previous list before it is inserted into this list. The inserted item is the item itself and not a copy. If the item is already in this list, note that the index of the item to replace is before the removal of the item.
*
* @param newItem The item to insert into the list.
* @param index Index.
* @returns The item being replaced.
*/
replaceItem(newItem, index) {
if (this[PropertySymbol.readOnly]) {
throw new this[PropertySymbol.window].TypeError(`Failed to execute 'replaceItem' on 'SVGNumberList': The object is read-only.`);
}
if (arguments.length < 2) {
throw new this[PropertySymbol.window].TypeError(`Failed to execute 'replaceItem' on 'SVGNumberList': 2 arguments required, but only ${arguments.length} present.`);
}
if (!(newItem instanceof SVGNumber)) {
throw new this[PropertySymbol.window].TypeError(`Failed to execute 'replaceItem' on 'SVGNumberList': parameter 1 is not of type 'SVGNumber'.`);
}
const items = this[PropertySymbol.getItemList]();
const existingIndex = items.indexOf(newItem);
if (existingIndex === index) {
return newItem;
}
if (existingIndex !== -1) {
items.splice(existingIndex, 1);
}
if (index < 0) {
index = 0;
}
else if (index >= items.length) {
index = items.length - 1;
}
if (items[index]) {
items[index][PropertySymbol.getAttribute] = null;
items[index][PropertySymbol.setAttribute] = null;
}
const replacedItem = items[index];
items[index] = newItem;
newItem[PropertySymbol.getAttribute] = () => newItem[PropertySymbol.attributeValue];
newItem[PropertySymbol.setAttribute] = () => {
this[PropertySymbol.cache].attributeValue = this[PropertySymbol.getItemList]()
.map((item) => item[PropertySymbol.attributeValue] || '0')
.join(' ');
this[PropertySymbol.setAttribute](this[PropertySymbol.cache].attributeValue);
};
this[PropertySymbol.cache].attributeValue = items
.map((item) => item[PropertySymbol.attributeValue] || '0')
.join(' ');
this[PropertySymbol.setAttribute](this[PropertySymbol.cache].attributeValue);
return replacedItem;
}
/**
* Removes an existing item from the list.
*
* @param index Index.
* @returns The removed item.
*/
removeItem(index) {
if (this[PropertySymbol.readOnly]) {
throw new this[PropertySymbol.window].TypeError(`Failed to execute 'removeItem' on 'SVGNumberList': The object is read-only.`);
}
if (arguments.length < 1) {
throw new this[PropertySymbol.window].TypeError(`Failed to execute 'removeItem' on 'SVGNumberList': 1 argument required, but only ${arguments.length} present.`);
}
const items = this[PropertySymbol.getItemList]();
index = Number(index);
if (isNaN(index)) {
index = 0;
}
if (index >= items.length) {
throw new this[PropertySymbol.window].DOMException(`Failed to execute 'removeItem' on 'SVGNumberList': The index provided (${index}) is greater than the maximum bound.`, DOMExceptionNameEnum.indexSizeError);
}
if (index < 0) {
throw new this[PropertySymbol.window].DOMException(`Failed to execute 'removeItem' on 'SVGNumberList': The index provided (${index}) is negative.`, DOMExceptionNameEnum.indexSizeError);
}
const removedItem = items[index];
if (removedItem) {
removedItem[PropertySymbol.getAttribute] = null;
removedItem[PropertySymbol.setAttribute] = null;
}
items.splice(index, 1);
this[PropertySymbol.setAttribute](items.map((item) => item[PropertySymbol.attributeValue] || '0').join(' '));
return removedItem;
}
/**
* Appends an item to the end of the list.
*
* @param newItem The item to add to the list.
* @returns The item being appended.
*/
appendItem(newItem) {
if (this[PropertySymbol.readOnly]) {
throw new this[PropertySymbol.window].TypeError(`Failed to execute 'appendItem' on 'SVGNumberList': The object is read-only.`);
}
if (arguments.length < 1) {
throw new this[PropertySymbol.window].TypeError(`Failed to execute 'appendItem' on 'SVGNumberList': 1 argument required, but only ${arguments.length} present.`);
}
if (!(newItem instanceof SVGNumber)) {
throw new this[PropertySymbol.window].TypeError(`Failed to execute 'appendItem' on 'SVGNumberList': parameter 1 is not of type 'SVGNumber'.`);
}
const items = this[PropertySymbol.getItemList]();
const existingIndex = items.indexOf(newItem);
if (existingIndex !== -1) {
items.splice(existingIndex, 1);
}
items.push(newItem);
newItem[PropertySymbol.getAttribute] = () => newItem[PropertySymbol.attributeValue];
newItem[PropertySymbol.setAttribute] = () => {
this[PropertySymbol.cache].attributeValue = this[PropertySymbol.getItemList]()
.map((item) => item[PropertySymbol.attributeValue] || '0')
.join(' ');
this[PropertySymbol.setAttribute](this[PropertySymbol.cache].attributeValue);
};
this[PropertySymbol.cache].attributeValue = items
.map((item) => item[PropertySymbol.attributeValue] || '0')
.join(' ');
this[PropertySymbol.setAttribute](this[PropertySymbol.cache].attributeValue);
return newItem;
}
/**
* Returns item list from attribute value.
*
* @see https://infra.spec.whatwg.org/#split-on-ascii-whitespace
*/
[PropertySymbol.getItemList]() {
const attributeValue = this[PropertySymbol.getAttribute]() ?? '';
const cache = this[PropertySymbol.cache];
if (cache.attributeValue === attributeValue) {
return cache.items;
}
if (cache.items.length) {
for (const item of cache.items) {
item[PropertySymbol.getAttribute] = null;
item[PropertySymbol.setAttribute] = null;
}
}
// It is possible to make this statement shorter by using Array.from() and Set, but this is faster when comparing using a bench test.
const items = [];
const trimmed = attributeValue.trim();
if (trimmed) {
const parts = trimmed.split(ATTRIBUTE_SEPARATOR_REGEXP);
for (let i = 0, max = parts.length; i < max; i++) {
const item = new SVGNumber(PropertySymbol.illegalConstructor, this[PropertySymbol.window], {
readOnly: this[PropertySymbol.readOnly],
getAttribute: () => item[PropertySymbol.attributeValue],
setAttribute: () => {
this[PropertySymbol.cache].attributeValue = this[PropertySymbol.getItemList]()
.map((item) => item[PropertySymbol.attributeValue] || '0')
.join(' ');
this[PropertySymbol.setAttribute](this[PropertySymbol.cache].attributeValue);
}
});
item[PropertySymbol.attributeValue] = String(parseFloat(parts[i]));
items.push(item);
}
}
cache.attributeValue = attributeValue;
cache.items = items;
return items;
}
}
//# sourceMappingURL=SVGNumberList.js.map

File diff suppressed because one or more lines are too long

54
frontend/node_modules/happy-dom/lib/svg/SVGPoint.d.ts generated vendored Normal file
View File

@@ -0,0 +1,54 @@
import * as PropertySymbol from '../PropertySymbol.js';
import BrowserWindow from '../window/BrowserWindow.js';
/**
* SVG point.
*
* @see https://developer.mozilla.org/en-US/docs/Web/API/SVGPoint
*/
export default class SVGPoint {
[PropertySymbol.window]: BrowserWindow;
[PropertySymbol.getAttribute]: (() => string | null) | null;
[PropertySymbol.setAttribute]: ((value: string) => void) | null;
[PropertySymbol.attributeValue]: string | null;
[PropertySymbol.readOnly]: boolean;
/**
* Constructor.
*
* @param illegalConstructorSymbol Illegal constructor symbol.
* @param window Window.
* @param [options] Options.
* @param [options.readOnly] Read only.
* @param [options.getAttribute] Get attribute.
* @param [options.setAttribute] Set attribute
*/
constructor(illegalConstructorSymbol: symbol, window: BrowserWindow, options?: {
readOnly?: boolean;
getAttribute?: () => string | null;
setAttribute?: (value: string) => void;
});
/**
* Returns x.
*
* @returns X.
*/
get x(): number;
/**
* Sets x.
*
* @param value X.
*/
set x(value: number);
/**
* Returns y.
*
* @returns Y.
*/
get y(): number;
/**
* Sets y.
*
* @param value Y.
*/
set y(value: number);
}
//# sourceMappingURL=SVGPoint.d.ts.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"SVGPoint.d.ts","sourceRoot":"","sources":["../../src/svg/SVGPoint.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,cAAc,MAAM,sBAAsB,CAAC;AACvD,OAAO,aAAa,MAAM,4BAA4B,CAAC;AAIvD;;;;GAIG;AACH,MAAM,CAAC,OAAO,OAAO,QAAQ;IAErB,CAAC,cAAc,CAAC,MAAM,CAAC,EAAE,aAAa,CAAC;IACvC,CAAC,cAAc,CAAC,YAAY,CAAC,EAAE,CAAC,MAAM,MAAM,GAAG,IAAI,CAAC,GAAG,IAAI,CAAQ;IACnE,CAAC,cAAc,CAAC,YAAY,CAAC,EAAE,CAAC,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC,GAAG,IAAI,CAAQ;IACvE,CAAC,cAAc,CAAC,cAAc,CAAC,EAAE,MAAM,GAAG,IAAI,CAAQ;IACtD,CAAC,cAAc,CAAC,QAAQ,CAAC,EAAE,OAAO,CAAS;IAElD;;;;;;;;;OASG;gBAEF,wBAAwB,EAAE,MAAM,EAChC,MAAM,EAAE,aAAa,EACrB,OAAO,CAAC,EAAE;QACT,QAAQ,CAAC,EAAE,OAAO,CAAC;QACnB,YAAY,CAAC,EAAE,MAAM,MAAM,GAAG,IAAI,CAAC;QACnC,YAAY,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;KACvC;IAeF;;;;OAIG;IACH,IAAW,CAAC,IAAI,MAAM,CAMrB;IAED;;;;OAIG;IACH,IAAW,CAAC,CAAC,KAAK,EAAE,MAAM,EAYzB;IAED;;;;OAIG;IACH,IAAW,CAAC,IAAI,MAAM,CAMrB;IAED;;;;OAIG;IACH,IAAW,CAAC,CAAC,KAAK,EAAE,MAAM,EAYzB;CACD"}

89
frontend/node_modules/happy-dom/lib/svg/SVGPoint.js generated vendored Normal file
View File

@@ -0,0 +1,89 @@
import * as PropertySymbol from '../PropertySymbol.js';
const ATTRIBUTE_SEPARATOR_REGEXP = /[\t\f\n\r, ]+/;
/**
* SVG point.
*
* @see https://developer.mozilla.org/en-US/docs/Web/API/SVGPoint
*/
export default class SVGPoint {
// Internal properties
[PropertySymbol.window];
[PropertySymbol.getAttribute] = null;
[PropertySymbol.setAttribute] = null;
[PropertySymbol.attributeValue] = null;
[PropertySymbol.readOnly] = false;
/**
* Constructor.
*
* @param illegalConstructorSymbol Illegal constructor symbol.
* @param window Window.
* @param [options] Options.
* @param [options.readOnly] Read only.
* @param [options.getAttribute] Get attribute.
* @param [options.setAttribute] Set attribute
*/
constructor(illegalConstructorSymbol, window, options) {
if (illegalConstructorSymbol !== PropertySymbol.illegalConstructor) {
throw new TypeError('Illegal constructor');
}
this[PropertySymbol.window] = window;
if (options) {
this[PropertySymbol.readOnly] = !!options.readOnly;
this[PropertySymbol.getAttribute] = options.getAttribute || null;
this[PropertySymbol.setAttribute] = options.setAttribute || null;
}
}
/**
* Returns x.
*
* @returns X.
*/
get x() {
const attributeValue = this[PropertySymbol.getAttribute]
? this[PropertySymbol.getAttribute]()
: this[PropertySymbol.attributeValue];
const parts = (attributeValue || '').split(ATTRIBUTE_SEPARATOR_REGEXP);
return !!parts[0] ? parseFloat(parts[0]) : 0;
}
/**
* Sets x.
*
* @param value X.
*/
set x(value) {
if (this[PropertySymbol.readOnly]) {
throw new this[PropertySymbol.window].TypeError(`Failed to set the 'x' property on 'SVGPoint': The object is read-only.`);
}
this[PropertySymbol.attributeValue] = `${value} ${this.y}`;
if (this[PropertySymbol.setAttribute]) {
this[PropertySymbol.setAttribute](this[PropertySymbol.attributeValue]);
}
}
/**
* Returns y.
*
* @returns Y.
*/
get y() {
const attributeValue = this[PropertySymbol.getAttribute]
? this[PropertySymbol.getAttribute]()
: this[PropertySymbol.attributeValue];
const parts = (attributeValue || '').split(ATTRIBUTE_SEPARATOR_REGEXP);
return !!parts[1] ? parseFloat(parts[1]) : 0;
}
/**
* Sets y.
*
* @param value Y.
*/
set y(value) {
if (this[PropertySymbol.readOnly]) {
throw new this[PropertySymbol.window].TypeError(`Failed to set the 'y' property on 'SVGPoint': The object is read-only.`);
}
this[PropertySymbol.attributeValue] = `${this.x} ${value}`;
if (this[PropertySymbol.setAttribute]) {
this[PropertySymbol.setAttribute](this[PropertySymbol.attributeValue]);
}
}
}
//# sourceMappingURL=SVGPoint.js.map

View File

@@ -0,0 +1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,CAAC,CAAC,KAAa;QACzB,IAAI,IAAI,CAAC,cAAc,CAAC,QAAQ,CAAC,EAAE,CAAC;YACnC,MAAM,IAAI,IAAI,CAAC,cAAc,CAAC,MAAM,CAAC,CAAC,SAAS,CAC9C,wEAAwE,CACxE,CAAC;QACH,CAAC;QAED,IAAI,CAAC,cAAc,CAAC,cAAc,CAAC,GAAG,GAAG,IAAI,CAAC,CAAC,IAAI,KAAK,EAAE,CAAC;QAE3D,IAAI,IAAI,CAAC,cAAc,CAAC,YAAY,CAAC,EAAE,CAAC;YACvC,IAAI,CAAC,cAAc,CAAC,YAAY,CAAC,CAAC,IAAI,CAAC,cAAc,CAAC,cAAc,CAAC,CAAC,CAAC;QACxE,CAAC;IACF,CAAC;CACD"}

View File

@@ -0,0 +1,102 @@
import * as PropertySymbol from '../PropertySymbol.js';
import BrowserWindow from '../window/BrowserWindow.js';
import SVGPoint from './SVGPoint.js';
/**
* SVGPointList.
*
* @see https://developer.mozilla.org/en-US/docs/Web/API/SVGPointList
*/
export default class SVGPointList {
[index: number]: SVGPoint;
[PropertySymbol.window]: BrowserWindow;
[PropertySymbol.getAttribute]: (() => string | null) | null;
[PropertySymbol.setAttribute]: ((value: string) => void) | null;
[PropertySymbol.readOnly]: boolean;
private [PropertySymbol.cache];
/**
* Constructor.
*
* @param illegalConstructorSymbol Illegal constructor symbol.
* @param window Window.
* @param options Options.
* @param options.getAttribute Get attribute.
* @param options.setAttribute Set attribute.
* @param [options.readOnly] Read only.
*/
constructor(illegalConstructorSymbol: symbol, window: BrowserWindow, options: {
readOnly?: boolean;
getAttribute: () => string | null;
setAttribute: (value: string) => void;
});
/**
* Returns length.
*
* @returns Length.
*/
get length(): number;
/**
* Returns length.
*
* @returns Length.
*/
get numberOfItems(): number;
/**
* Returns an iterator, allowing you to go through all values of the key/value pairs contained in this object.
*/
[Symbol.iterator](): IterableIterator<SVGPoint>;
/**
* Clears all items from the list.
*/
clear(): void;
/**
* Replace Token.
*
* @param newItem New item.
* @returns The item being replaced.
*/
initialize(newItem: SVGPoint): SVGPoint;
/**
* Returns item at index.
*
* @param index Index.
* @returns The item at the index.
**/
getItem(index: number | string): SVGPoint;
/**
* Inserts a new item into the list at the specified position. The first item is number 0. If newItem is already in a list, it is removed from its previous list before it is inserted into this list. The inserted item is the item itself and not a copy. If the item is already in this list, note that the index of the item to insert before is before the removal of the item. If the index is equal to 0, then the new item is inserted at the front of the list. If the index is greater than or equal to numberOfItems, then the new item is appended to the end of the list.
*
* @param newItem The item to insert into the list.
* @param index Index.
* @returns The item being inserted.
*/
insertItemBefore(newItem: SVGPoint, index: number): SVGPoint;
/**
* Replaces an existing item in the list with a new item. If newItem is already in a list, it is removed from its previous list before it is inserted into this list. The inserted item is the item itself and not a copy. If the item is already in this list, note that the index of the item to replace is before the removal of the item.
*
* @param newItem The item to insert into the list.
* @param index Index.
* @returns The item being replaced.
*/
replaceItem(newItem: SVGPoint, index: number): SVGPoint;
/**
* Removes an existing item from the list.
*
* @param index Index.
* @returns The removed item.
*/
removeItem(index: number): SVGPoint;
/**
* Appends an item to the end of the list.
*
* @param newItem The item to add to the list.
* @returns The item being appended.
*/
appendItem(newItem: SVGPoint): SVGPoint;
/**
* Returns item list from attribute value.
*
* @see https://infra.spec.whatwg.org/#split-on-ascii-whitespace
*/
[PropertySymbol.getItemList](): SVGPoint[];
}
//# sourceMappingURL=SVGPointList.d.ts.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"SVGPointList.d.ts","sourceRoot":"","sources":["../../src/svg/SVGPointList.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,cAAc,MAAM,sBAAsB,CAAC;AACvD,OAAO,aAAa,MAAM,4BAA4B,CAAC;AACvD,OAAO,QAAQ,MAAM,eAAe,CAAC;AAIrC;;;;GAIG;AACH,MAAM,CAAC,OAAO,OAAO,YAAY;IAChC,CAAC,KAAK,EAAE,MAAM,GAAG,QAAQ,CAAC;IAEnB,CAAC,cAAc,CAAC,MAAM,CAAC,EAAE,aAAa,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EAAE,QAAQ,GAAG,QAAQ;IA4C9C;;;;OAIG;IACI,CAAC,cAAc,CAAC,WAAW,CAAC,IAAI,QAAQ,EAAE;CA6CjD"}

402
frontend/node_modules/happy-dom/lib/svg/SVGPointList.js generated vendored Normal file
View File

@@ -0,0 +1,402 @@
import ClassMethodBinder from '../utilities/ClassMethodBinder.js';
import DOMExceptionNameEnum from '../exception/DOMExceptionNameEnum.js';
import * as PropertySymbol from '../PropertySymbol.js';
import SVGPoint from './SVGPoint.js';
const ATTRIBUTE_SEPARATOR_REGEXP = /[\t\f\n\r, ]+/;
/**
* SVGPointList.
*
* @see https://developer.mozilla.org/en-US/docs/Web/API/SVGPointList
*/
export default class SVGPointList {
[PropertySymbol.window];
[PropertySymbol.getAttribute] = null;
[PropertySymbol.setAttribute] = null;
[PropertySymbol.readOnly] = false;
[PropertySymbol.cache] = {
items: [],
attributeValue: ''
};
/**
* Constructor.
*
* @param illegalConstructorSymbol Illegal constructor symbol.
* @param window Window.
* @param options Options.
* @param options.getAttribute Get attribute.
* @param options.setAttribute Set attribute.
* @param [options.readOnly] Read only.
*/
constructor(illegalConstructorSymbol, window, options) {
if (illegalConstructorSymbol !== PropertySymbol.illegalConstructor) {
throw new TypeError('Illegal constructor');
}
this[PropertySymbol.window] = window;
this[PropertySymbol.readOnly] = !!options.readOnly;
this[PropertySymbol.getAttribute] = options.getAttribute || null;
this[PropertySymbol.setAttribute] = options.setAttribute || null;
const methodBinder = new ClassMethodBinder(this, [SVGPointList]);
return new Proxy(this, {
get: (target, property) => {
if (property === 'length' || property === 'numberOfItems') {
return target[PropertySymbol.getItemList]().length;
}
if (property in target || typeof property === 'symbol') {
methodBinder.bind(property);
return target[property];
}
const index = Number(property);
if (!isNaN(index)) {
return target[PropertySymbol.getItemList]()[index];
}
},
set(target, property, newValue) {
methodBinder.bind(property);
if (typeof property === 'symbol') {
target[property] = newValue;
return true;
}
const index = Number(property);
if (isNaN(index)) {
target[property] = newValue;
}
return true;
},
deleteProperty(target, property) {
if (typeof property === 'symbol') {
delete target[property];
return true;
}
const index = Number(property);
if (isNaN(index)) {
delete target[property];
}
return true;
},
ownKeys(target) {
return Object.keys(target[PropertySymbol.getItemList]());
},
has(target, property) {
if (property in target) {
return true;
}
if (typeof property === 'symbol') {
return false;
}
const index = Number(property);
return !isNaN(index) && index >= 0 && index < target[PropertySymbol.getItemList]().length;
},
defineProperty(target, property, descriptor) {
methodBinder.preventBinding(property);
if (property in target) {
Object.defineProperty(target, property, descriptor);
return true;
}
return false;
},
getOwnPropertyDescriptor(target, property) {
if (property in target || typeof property === 'symbol') {
return;
}
const index = Number(property);
const items = target[PropertySymbol.getItemList]();
if (!isNaN(index) && items[index]) {
return {
value: items[index],
writable: false,
enumerable: true,
configurable: true
};
}
}
});
}
/**
* Returns length.
*
* @returns Length.
*/
get length() {
return this[PropertySymbol.getItemList]().length;
}
/**
* Returns length.
*
* @returns Length.
*/
get numberOfItems() {
return this[PropertySymbol.getItemList]().length;
}
/**
* Returns an iterator, allowing you to go through all values of the key/value pairs contained in this object.
*/
[Symbol.iterator]() {
return this[PropertySymbol.getItemList]().values();
}
/**
* Clears all items from the list.
*/
clear() {
if (this[PropertySymbol.readOnly]) {
throw new this[PropertySymbol.window].TypeError(`Failed to execute 'clear' on 'SVGPointList': The object is read-only.`);
}
for (const item of this[PropertySymbol.cache].items) {
item[PropertySymbol.getAttribute] = null;
item[PropertySymbol.setAttribute] = null;
}
this[PropertySymbol.cache].items = [];
this[PropertySymbol.cache].attributeValue = '';
this[PropertySymbol.setAttribute]('');
}
/**
* Replace Token.
*
* @param newItem New item.
* @returns The item being replaced.
*/
initialize(newItem) {
if (this[PropertySymbol.readOnly]) {
throw new this[PropertySymbol.window].TypeError(`Failed to execute 'initialize' on 'SVGPointList': The object is read-only.`);
}
if (arguments.length < 1) {
throw new this[PropertySymbol.window].TypeError(`Failed to execute 'initialize' on 'SVGPointList': 1 arguments required, but only ${arguments.length} present.`);
}
if (!(newItem instanceof SVGPoint)) {
throw new this[PropertySymbol.window].TypeError(`Failed to execute 'appendItem' on 'SVGPointList': parameter 1 is not of type 'SVGPoint'.`);
}
for (const item of this[PropertySymbol.cache].items) {
item[PropertySymbol.getAttribute] = null;
item[PropertySymbol.setAttribute] = null;
}
newItem[PropertySymbol.getAttribute] = () => newItem[PropertySymbol.attributeValue];
newItem[PropertySymbol.setAttribute] = () => {
this[PropertySymbol.cache].attributeValue = this[PropertySymbol.getItemList]()
.map((item) => item[PropertySymbol.attributeValue] || '0 0')
.join(' ');
this[PropertySymbol.setAttribute](this[PropertySymbol.cache].attributeValue);
};
this[PropertySymbol.cache].items = [newItem];
this[PropertySymbol.cache].attributeValue = newItem[PropertySymbol.attributeValue];
this[PropertySymbol.setAttribute](newItem[PropertySymbol.attributeValue]);
return newItem;
}
/**
* Returns item at index.
*
* @param index Index.
* @returns The item at the index.
**/
getItem(index) {
const items = this[PropertySymbol.getItemList]();
if (typeof index === 'number') {
return items[index] ? items[index] : null;
}
index = Number(index);
index = isNaN(index) ? 0 : index;
return items[index] ? items[index] : null;
}
/**
* Inserts a new item into the list at the specified position. The first item is number 0. If newItem is already in a list, it is removed from its previous list before it is inserted into this list. The inserted item is the item itself and not a copy. If the item is already in this list, note that the index of the item to insert before is before the removal of the item. If the index is equal to 0, then the new item is inserted at the front of the list. If the index is greater than or equal to numberOfItems, then the new item is appended to the end of the list.
*
* @param newItem The item to insert into the list.
* @param index Index.
* @returns The item being inserted.
*/
insertItemBefore(newItem, index) {
if (this[PropertySymbol.readOnly]) {
throw new this[PropertySymbol.window].TypeError(`Failed to execute 'insertItemBefore' on 'SVGPointList': The object is read-only.`);
}
if (arguments.length < 2) {
throw new this[PropertySymbol.window].TypeError(`Failed to execute 'insertItemBefore' on 'SVGPointList': 2 arguments required, but only ${arguments.length} present.`);
}
if (!(newItem instanceof SVGPoint)) {
throw new this[PropertySymbol.window].TypeError(`Failed to execute 'insertItemBefore' on 'SVGPointList': parameter 1 is not of type 'SVGPoint'.`);
}
const items = this[PropertySymbol.getItemList]();
const existingIndex = items.indexOf(newItem);
if (existingIndex !== -1) {
items.splice(existingIndex, 1);
}
if (index < 0) {
index = 0;
}
else if (index > items.length) {
index = items.length;
}
items.splice(index, 0, newItem);
newItem[PropertySymbol.getAttribute] = () => newItem[PropertySymbol.attributeValue];
newItem[PropertySymbol.setAttribute] = () => {
this[PropertySymbol.cache].attributeValue = this[PropertySymbol.getItemList]()
.map((item) => item[PropertySymbol.attributeValue] || '0 0')
.join(' ');
this[PropertySymbol.setAttribute](this[PropertySymbol.cache].attributeValue);
};
this[PropertySymbol.cache].attributeValue = items
.map((item) => item[PropertySymbol.attributeValue] || '0 0')
.join(' ');
this[PropertySymbol.setAttribute](this[PropertySymbol.cache].attributeValue);
return newItem;
}
/**
* Replaces an existing item in the list with a new item. If newItem is already in a list, it is removed from its previous list before it is inserted into this list. The inserted item is the item itself and not a copy. If the item is already in this list, note that the index of the item to replace is before the removal of the item.
*
* @param newItem The item to insert into the list.
* @param index Index.
* @returns The item being replaced.
*/
replaceItem(newItem, index) {
if (this[PropertySymbol.readOnly]) {
throw new this[PropertySymbol.window].TypeError(`Failed to execute 'replaceItem' on 'SVGPointList': The object is read-only.`);
}
if (arguments.length < 2) {
throw new this[PropertySymbol.window].TypeError(`Failed to execute 'replaceItem' on 'SVGPointList': 2 arguments required, but only ${arguments.length} present.`);
}
if (!(newItem instanceof SVGPoint)) {
throw new this[PropertySymbol.window].TypeError(`Failed to execute 'replaceItem' on 'SVGPointList': parameter 1 is not of type 'SVGPoint'.`);
}
const items = this[PropertySymbol.getItemList]();
const existingIndex = items.indexOf(newItem);
if (existingIndex === index) {
return newItem;
}
if (existingIndex !== -1) {
items.splice(existingIndex, 1);
}
if (index < 0) {
index = 0;
}
else if (index >= items.length) {
index = items.length - 1;
}
if (items[index]) {
items[index][PropertySymbol.getAttribute] = null;
items[index][PropertySymbol.setAttribute] = null;
}
const replacedItem = items[index];
items[index] = newItem;
newItem[PropertySymbol.getAttribute] = () => newItem[PropertySymbol.attributeValue];
newItem[PropertySymbol.setAttribute] = () => {
this[PropertySymbol.cache].attributeValue = this[PropertySymbol.getItemList]()
.map((item) => item[PropertySymbol.attributeValue] || '0 0')
.join(' ');
this[PropertySymbol.setAttribute](this[PropertySymbol.cache].attributeValue);
};
this[PropertySymbol.cache].attributeValue = items
.map((item) => item[PropertySymbol.attributeValue] || '0 0')
.join(' ');
this[PropertySymbol.setAttribute](this[PropertySymbol.cache].attributeValue);
return replacedItem;
}
/**
* Removes an existing item from the list.
*
* @param index Index.
* @returns The removed item.
*/
removeItem(index) {
if (this[PropertySymbol.readOnly]) {
throw new this[PropertySymbol.window].TypeError(`Failed to execute 'removeItem' on 'SVGPointList': The object is read-only.`);
}
if (arguments.length < 1) {
throw new this[PropertySymbol.window].TypeError(`Failed to execute 'removeItem' on 'SVGPointList': 1 argument required, but only ${arguments.length} present.`);
}
const items = this[PropertySymbol.getItemList]();
index = Number(index);
if (isNaN(index)) {
index = 0;
}
if (index >= items.length) {
throw new this[PropertySymbol.window].DOMException(`Failed to execute 'removeItem' on 'SVGPointList': The index provided (${index}) is greater than the maximum bound.`, DOMExceptionNameEnum.indexSizeError);
}
if (index < 0) {
throw new this[PropertySymbol.window].DOMException(`Failed to execute 'removeItem' on 'SVGPointList': The index provided (${index}) is negative.`, DOMExceptionNameEnum.indexSizeError);
}
const removedItem = items[index];
if (removedItem) {
removedItem[PropertySymbol.getAttribute] = null;
removedItem[PropertySymbol.setAttribute] = null;
}
items.splice(index, 1);
this[PropertySymbol.setAttribute](items.map((item) => item[PropertySymbol.attributeValue] || '0 0').join(' '));
return removedItem;
}
/**
* Appends an item to the end of the list.
*
* @param newItem The item to add to the list.
* @returns The item being appended.
*/
appendItem(newItem) {
if (this[PropertySymbol.readOnly]) {
throw new this[PropertySymbol.window].TypeError(`Failed to execute 'appendItem' on 'SVGPointList': The object is read-only.`);
}
if (arguments.length < 1) {
throw new this[PropertySymbol.window].TypeError(`Failed to execute 'appendItem' on 'SVGPointList': 1 argument required, but only ${arguments.length} present.`);
}
if (!(newItem instanceof SVGPoint)) {
throw new this[PropertySymbol.window].TypeError(`Failed to execute 'appendItem' on 'SVGPointList': parameter 1 is not of type 'SVGPoint'.`);
}
const items = this[PropertySymbol.getItemList]();
const existingIndex = items.indexOf(newItem);
if (existingIndex !== -1) {
items.splice(existingIndex, 1);
}
items.push(newItem);
newItem[PropertySymbol.getAttribute] = () => newItem[PropertySymbol.attributeValue];
newItem[PropertySymbol.setAttribute] = () => {
this[PropertySymbol.cache].attributeValue = this[PropertySymbol.getItemList]()
.map((item) => item[PropertySymbol.attributeValue] || '0 0')
.join(' ');
this[PropertySymbol.setAttribute](this[PropertySymbol.cache].attributeValue);
};
this[PropertySymbol.cache].attributeValue = items
.map((item) => item[PropertySymbol.attributeValue] || '0 0')
.join(' ');
this[PropertySymbol.setAttribute](this[PropertySymbol.cache].attributeValue);
return newItem;
}
/**
* Returns item list from attribute value.
*
* @see https://infra.spec.whatwg.org/#split-on-ascii-whitespace
*/
[PropertySymbol.getItemList]() {
const attributeValue = this[PropertySymbol.getAttribute]() ?? '';
const cache = this[PropertySymbol.cache];
if (cache.attributeValue === attributeValue) {
return cache.items;
}
if (cache.items.length) {
for (const item of cache.items) {
item[PropertySymbol.getAttribute] = null;
item[PropertySymbol.setAttribute] = null;
}
}
// It is possible to make this statement shorter by using Array.from() and Set, but this is faster when comparing using a bench test.
const items = [];
const trimmed = attributeValue.trim();
if (trimmed) {
const parts = trimmed.split(ATTRIBUTE_SEPARATOR_REGEXP);
for (let i = 0, max = parts.length; i < max; i += 2) {
const x = parseFloat(parts[i]);
const y = parts[i + 1] !== undefined ? ' ' + parseFloat(parts[i + 1]) : '';
const item = new SVGPoint(PropertySymbol.illegalConstructor, this[PropertySymbol.window], {
readOnly: this[PropertySymbol.readOnly],
getAttribute: () => item[PropertySymbol.attributeValue],
setAttribute: () => {
this[PropertySymbol.cache].attributeValue = this[PropertySymbol.getItemList]()
.map((item) => item[PropertySymbol.attributeValue] || '0 0')
.join(' ');
this[PropertySymbol.setAttribute](this[PropertySymbol.cache].attributeValue);
}
});
item[PropertySymbol.attributeValue] = `${x}${y}`;
items.push(item);
}
}
cache.attributeValue = attributeValue;
cache.items = items;
return items;
}
}
//# sourceMappingURL=SVGPointList.js.map

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1,70 @@
import * as PropertySymbol from '../PropertySymbol.js';
import SVGPreserveAspectRatioMeetOrSliceEnum from './SVGPreserveAspectRatioMeetOrSliceEnum.js';
import SVGPreserveAspectRatioAlignEnum from './SVGPreserveAspectRatioAlignEnum.js';
import BrowserWindow from '../window/BrowserWindow.js';
/**
* SVG preserve aspect ratio.
*
* @see https://developer.mozilla.org/en-US/docs/Web/API/SVGPreserveAspectRatio
*/
export default class SVGPreserveAspectRatio {
static SVG_MEETORSLICE_UNKNOWN: SVGPreserveAspectRatioMeetOrSliceEnum;
static SVG_MEETORSLICE_MEET: SVGPreserveAspectRatioMeetOrSliceEnum;
static SVG_MEETORSLICE_SLICE: SVGPreserveAspectRatioMeetOrSliceEnum;
static SVG_PRESERVEASPECTRATIO_UNKNOWN: SVGPreserveAspectRatioAlignEnum;
static SVG_PRESERVEASPECTRATIO_NONE: SVGPreserveAspectRatioAlignEnum;
static SVG_PRESERVEASPECTRATIO_XMINYMIN: SVGPreserveAspectRatioAlignEnum;
static SVG_PRESERVEASPECTRATIO_XMIDYMIN: SVGPreserveAspectRatioAlignEnum;
static SVG_PRESERVEASPECTRATIO_XMAXYMIN: SVGPreserveAspectRatioAlignEnum;
static SVG_PRESERVEASPECTRATIO_XMINYMID: SVGPreserveAspectRatioAlignEnum;
static SVG_PRESERVEASPECTRATIO_XMIDYMID: SVGPreserveAspectRatioAlignEnum;
static SVG_PRESERVEASPECTRATIO_XMAXYMID: SVGPreserveAspectRatioAlignEnum;
static SVG_PRESERVEASPECTRATIO_XMINYMAX: SVGPreserveAspectRatioAlignEnum;
static SVG_PRESERVEASPECTRATIO_XMIDYMAX: SVGPreserveAspectRatioAlignEnum;
static SVG_PRESERVEASPECTRATIO_XMAXYMAX: SVGPreserveAspectRatioAlignEnum;
[PropertySymbol.window]: BrowserWindow;
[PropertySymbol.getAttribute]: (() => string | null) | null;
[PropertySymbol.setAttribute]: ((value: string) => void) | null;
[PropertySymbol.attributeValue]: string | null;
[PropertySymbol.readOnly]: boolean;
/**
* Constructor.
*
* @param illegalConstructorSymbol Illegal constructor symbol.
* @param window Window.
* @param [options] Options.
* @param [options.readOnly] Read only.
* @param [options.getAttribute] Get attribute.
* @param [options.setAttribute] Set attribute.
*/
constructor(illegalConstructorSymbol: symbol, window: BrowserWindow, options?: {
readOnly?: boolean;
getAttribute?: () => string | null;
setAttribute?: (value: string) => void;
});
/**
* Returns align.
*
* @returns Align.
*/
get align(): SVGPreserveAspectRatioAlignEnum;
/**
* Sets align.
*
* @param value Align.
*/
set align(value: SVGPreserveAspectRatioAlignEnum);
/**
* Returns meet or slice.
*
* @returns Meet or slice.
*/
get meetOrSlice(): SVGPreserveAspectRatioMeetOrSliceEnum;
/**
* Sets meet or slice.
*
* @param value Meet or slice.
*/
set meetOrSlice(value: SVGPreserveAspectRatioMeetOrSliceEnum);
}
//# sourceMappingURL=SVGPreserveAspectRatio.d.ts.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"SVGPreserveAspectRatio.d.ts","sourceRoot":"","sources":["../../src/svg/SVGPreserveAspectRatio.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,cAAc,MAAM,sBAAsB,CAAC;AACvD,OAAO,qCAAqC,MAAM,4CAA4C,CAAC;AAC/F,OAAO,+BAA+B,MAAM,sCAAsC,CAAC;AACnF,OAAO,aAAa,MAAM,4BAA4B,CAAC;AAQvD;;;;GAIG;AACH,MAAM,CAAC,OAAO,OAAO,sBAAsB;IAE1C,OAAc,uBAAuB,wCAAiD;IACtF,OAAc,oBAAoB,wCAA8C;IAChF,OAAc,qBAAqB,wCAA+C;IAClF,OAAc,+BAA+B,kCAA2C;IACxF,O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js';
import SVGPreserveAspectRatioMeetOrSliceEnum from './SVGPreserveAspectRatioMeetOrSliceEnum.js';
import SVGPreserveAspectRatioAlignEnum from './SVGPreserveAspectRatioAlignEnum.js';
const ALIGN_KEYS = Object.values(SVGPreserveAspectRatioAlignEnum);
ALIGN_KEYS.length = ALIGN_KEYS.indexOf(0);
const MEET_OR_SLICE_KEYS = Object.values(SVGPreserveAspectRatioMeetOrSliceEnum);
MEET_OR_SLICE_KEYS.length = MEET_OR_SLICE_KEYS.indexOf(0);
/**
* SVG preserve aspect ratio.
*
* @see https://developer.mozilla.org/en-US/docs/Web/API/SVGPreserveAspectRatio
*/
export default class SVGPreserveAspectRatio {
// Static properties
static SVG_MEETORSLICE_UNKNOWN = SVGPreserveAspectRatioMeetOrSliceEnum.unknown;
static SVG_MEETORSLICE_MEET = SVGPreserveAspectRatioMeetOrSliceEnum.meet;
static SVG_MEETORSLICE_SLICE = SVGPreserveAspectRatioMeetOrSliceEnum.slice;
static SVG_PRESERVEASPECTRATIO_UNKNOWN = SVGPreserveAspectRatioAlignEnum.unknown;
static SVG_PRESERVEASPECTRATIO_NONE = SVGPreserveAspectRatioAlignEnum.none;
static SVG_PRESERVEASPECTRATIO_XMINYMIN = SVGPreserveAspectRatioAlignEnum.xMinYMin;
static SVG_PRESERVEASPECTRATIO_XMIDYMIN = SVGPreserveAspectRatioAlignEnum.xMidYMin;
static SVG_PRESERVEASPECTRATIO_XMAXYMIN = SVGPreserveAspectRatioAlignEnum.xMaxYMin;
static SVG_PRESERVEASPECTRATIO_XMINYMID = SVGPreserveAspectRatioAlignEnum.xMinYMid;
static SVG_PRESERVEASPECTRATIO_XMIDYMID = SVGPreserveAspectRatioAlignEnum.xMidYMid;
static SVG_PRESERVEASPECTRATIO_XMAXYMID = SVGPreserveAspectRatioAlignEnum.xMaxYMid;
static SVG_PRESERVEASPECTRATIO_XMINYMAX = SVGPreserveAspectRatioAlignEnum.xMinYMax;
static SVG_PRESERVEASPECTRATIO_XMIDYMAX = SVGPreserveAspectRatioAlignEnum.xMidYMax;
static SVG_PRESERVEASPECTRATIO_XMAXYMAX = SVGPreserveAspectRatioAlignEnum.xMaxYMax;
// Internal properties
[PropertySymbol.window];
[PropertySymbol.getAttribute] = null;
[PropertySymbol.setAttribute] = null;
[PropertySymbol.attributeValue] = null;
[PropertySymbol.readOnly] = false;
/**
* Constructor.
*
* @param illegalConstructorSymbol Illegal constructor symbol.
* @param window Window.
* @param [options] Options.
* @param [options.readOnly] Read only.
* @param [options.getAttribute] Get attribute.
* @param [options.setAttribute] Set attribute.
*/
constructor(illegalConstructorSymbol, window, options) {
if (illegalConstructorSymbol !== PropertySymbol.illegalConstructor) {
throw new TypeError('Illegal constructor');
}
this[PropertySymbol.window] = window;
if (options) {
this[PropertySymbol.readOnly] = !!options.readOnly;
this[PropertySymbol.getAttribute] = options.getAttribute || null;
this[PropertySymbol.setAttribute] = options.setAttribute || null;
}
}
/**
* Returns align.
*
* @returns Align.
*/
get align() {
const attributeValue = this[PropertySymbol.getAttribute]
? this[PropertySymbol.getAttribute]()
: this[PropertySymbol.attributeValue];
if (!attributeValue) {
return SVGPreserveAspectRatioAlignEnum.xMidYMid;
}
const align = attributeValue.split(/\s+/)[0];
if (SVGPreserveAspectRatioAlignEnum[align] === undefined) {
return SVGPreserveAspectRatioAlignEnum.xMidYMid;
}
return SVGPreserveAspectRatioAlignEnum[align];
}
/**
* Sets align.
*
* @param value Align.
*/
set align(value) {
if (this[PropertySymbol.readOnly]) {
throw new this[PropertySymbol.window].TypeError(`Failed to set the 'align' property on 'SVGPreserveAspectRatio': The object is read-only.`);
}
const parsedValue = Number(value);
if (isNaN(parsedValue) || parsedValue < 1 || parsedValue > ALIGN_KEYS.length) {
throw new this[PropertySymbol.window].TypeError(`Failed to set the 'align' property on 'SVGPreserveAspectRatio': The alignment provided is invalid.`);
}
this[PropertySymbol.attributeValue] = `${ALIGN_KEYS[parsedValue]} ${MEET_OR_SLICE_KEYS[this.meetOrSlice]}`;
if (this[PropertySymbol.setAttribute]) {
this[PropertySymbol.setAttribute](this[PropertySymbol.attributeValue]);
}
}
/**
* Returns meet or slice.
*
* @returns Meet or slice.
*/
get meetOrSlice() {
const attributeValue = this[PropertySymbol.getAttribute]
? this[PropertySymbol.getAttribute]()
: this[PropertySymbol.attributeValue];
if (!attributeValue) {
return SVGPreserveAspectRatioMeetOrSliceEnum.meet;
}
const meetOrSlice = attributeValue.split(/\s+/)[1];
if (!meetOrSlice || SVGPreserveAspectRatioMeetOrSliceEnum[meetOrSlice] === undefined) {
return SVGPreserveAspectRatioMeetOrSliceEnum.meet;
}
return SVGPreserveAspectRatioMeetOrSliceEnum[meetOrSlice];
}
/**
* Sets meet or slice.
*
* @param value Meet or slice.
*/
set meetOrSlice(value) {
if (this[PropertySymbol.readOnly]) {
throw new this[PropertySymbol.window].TypeError(`Failed to set the 'meetOrSlice' property on 'SVGPreserveAspectRatio': The object is read-only.`);
}
const parsedValue = Number(value);
if (isNaN(parsedValue) || parsedValue < 1 || parsedValue > 2) {
throw new this[PropertySymbol.window].TypeError(`Failed to set the 'meetOrSlice' property on 'SVGPreserveAspectRatio': The meetOrSlice provided is invalid.`);
}
this[PropertySymbol.attributeValue] = `${ALIGN_KEYS[this.align]} ${MEET_OR_SLICE_KEYS[parsedValue]}`;
if (this[PropertySymbol.setAttribute]) {
this[PropertySymbol.setAttribute](this[PropertySymbol.attributeValue]);
}
}
}
//# sourceMappingURL=SVGPreserveAspectRatio.js.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"SVGPreserveAspectRatio.js","sourceRoot":"","sources":["../../src/svg/SVGPreserveAspectRatio.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,cAAc,MAAM,sBAAsB,CAAC;AACvD,OAAO,qCAAqC,MAAM,4CAA4C,CAAC;AAC/F,OAAO,+BAA+B,MAAM,sCAAsC,CAAC;AAGnF,MAAM,UAAU,GAAG,MAAM,CAAC,MAAM,CAAC,+BAA+B,CAAC,CAAC;AAClE,UAAU,CA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WAAW,IAAI,qCAAqC,CAAC,WAAW,CAAC,KAAK,SAAS,EAAE,CAAC;YACtF,OAAO,qCAAqC,CAAC,IAAI,CAAC;QACnD,CAAC;QAED,OAAO,qCAAqC,CAAC,WAAW,CAAC,CAAC;IAC3D,CAAC;IAED;;;;OAIG;IACH,IAAW,WAAW,CAAC,KAA4C;QAClE,IAAI,IAAI,CAAC,cAAc,CAAC,QAAQ,CAAC,EAAE,CAAC;YACnC,MAAM,IAAI,IAAI,CAAC,cAAc,CAAC,MAAM,CAAC,CAAC,SAAS,CAC9C,gGAAgG,CAChG,CAAC;QACH,CAAC;QAED,MAAM,WAAW,GAAG,MAAM,CAAC,KAAK,CAAC,CAAC;QAElC,IAAI,KAAK,CAAC,WAAW,CAAC,IAAI,WAAW,GAAG,CAAC,IAAI,WAAW,GAAG,CAAC,EAAE,CAAC;YAC9D,MAAM,IAAI,IAAI,CAAC,cAAc,CAAC,MAAM,CAAC,CAAC,SAAS,CAC9C,4GAA4G,CAC5G,CAAC;QACH,CAAC;QAED,IAAI,CAAC,cAAc,CAAC,cAAc,CAAC,GAAG,GAAG,UAAU,CAAC,IAAI,CAAC,KAAK,CAAC,IAC9D,kBAAkB,CAAC,WAAW,CAC/B,EAAE,CAAC;QAEH,IAAI,IAAI,CAAC,cAAc,CAAC,YAAY,CAAC,EAAE,CAAC;YACvC,IAAI,CAAC,cAAc,CAAC,YAAY,CAAC,CAAC,IAAI,CAAC,cAAc,CAAC,cAAc,CAAC,CAAC,CAAC;QACxE,CAAC;IACF,CAAC"}

View File

@@ -0,0 +1,15 @@
declare enum SVGPreserveAspectRatioAlignEnum {
unknown = 0,
none = 1,
xMinYMin = 2,
xMidYMin = 3,
xMaxYMin = 4,
xMinYMid = 5,
xMidYMid = 6,
xMaxYMid = 7,
xMinYMax = 8,
xMidYMax = 9,
xMaxYMax = 10
}
export default SVGPreserveAspectRatioAlignEnum;
//# sourceMappingURL=SVGPreserveAspectRatioAlignEnum.d.ts.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"SVGPreserveAspectRatioAlignEnum.d.ts","sourceRoot":"","sources":["../../src/svg/SVGPreserveAspectRatioAlignEnum.ts"],"names":[],"mappings":"AAAA,aAAK,+BAA+B;IACnC,OAAO,IAAI;IACX,IAAI,IAAI;IACR,QAAQ,IAAI;IACZ,QAAQ,IAAI;IACZ,QAAQ,IAAI;IACZ,QAAQ,IAAI;IACZ,QAAQ,IAAI;IACZ,QAAQ,IAAI;IACZ,QAAQ,IAAI;IACZ,QAAQ,IAAI;IACZ,QAAQ,KAAK;CACb;AAED,eAAe,+BAA+B,CAAC"}

View File

@@ -0,0 +1,16 @@
var SVGPreserveAspectRatioAlignEnum;
(function (SVGPreserveAspectRatioAlignEnum) {
SVGPreserveAspectRatioAlignEnum[SVGPreserveAspectRatioAlignEnum["unknown"] = 0] = "unknown";
SVGPreserveAspectRatioAlignEnum[SVGPreserveAspectRatioAlignEnum["none"] = 1] = "none";
SVGPreserveAspectRatioAlignEnum[SVGPreserveAspectRatioAlignEnum["xMinYMin"] = 2] = "xMinYMin";
SVGPreserveAspectRatioAlignEnum[SVGPreserveAspectRatioAlignEnum["xMidYMin"] = 3] = "xMidYMin";
SVGPreserveAspectRatioAlignEnum[SVGPreserveAspectRatioAlignEnum["xMaxYMin"] = 4] = "xMaxYMin";
SVGPreserveAspectRatioAlignEnum[SVGPreserveAspectRatioAlignEnum["xMinYMid"] = 5] = "xMinYMid";
SVGPreserveAspectRatioAlignEnum[SVGPreserveAspectRatioAlignEnum["xMidYMid"] = 6] = "xMidYMid";
SVGPreserveAspectRatioAlignEnum[SVGPreserveAspectRatioAlignEnum["xMaxYMid"] = 7] = "xMaxYMid";
SVGPreserveAspectRatioAlignEnum[SVGPreserveAspectRatioAlignEnum["xMinYMax"] = 8] = "xMinYMax";
SVGPreserveAspectRatioAlignEnum[SVGPreserveAspectRatioAlignEnum["xMidYMax"] = 9] = "xMidYMax";
SVGPreserveAspectRatioAlignEnum[SVGPreserveAspectRatioAlignEnum["xMaxYMax"] = 10] = "xMaxYMax";
})(SVGPreserveAspectRatioAlignEnum || (SVGPreserveAspectRatioAlignEnum = {}));
export default SVGPreserveAspectRatioAlignEnum;
//# sourceMappingURL=SVGPreserveAspectRatioAlignEnum.js.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"SVGPreserveAspectRatioAlignEnum.js","sourceRoot":"","sources":["../../src/svg/SVGPreserveAspectRatioAlignEnum.ts"],"names":[],"mappings":"AAAA,IAAK,+BAYJ;AAZD,WAAK,+BAA+B;IACnC,2FAAW,CAAA;IACX,qFAAQ,CAAA;IACR,6FAAY,CAAA;IACZ,6FAAY,CAAA;IACZ,6FAAY,CAAA;IACZ,6FAAY,CAAA;IACZ,6FAAY,CAAA;IACZ,6FAAY,CAAA;IACZ,6FAAY,CAAA;IACZ,6FAAY,CAAA;IACZ,8FAAa,CAAA;AACd,CAAC,EAZI,+BAA+B,KAA/B,+BAA+B,QAYnC;AAED,eAAe,+BAA+B,CAAC"}

View File

@@ -0,0 +1,7 @@
declare enum SVGPreserveAspectRatioMeetOrSliceEnum {
unknown = 0,
meet = 1,
slice = 2
}
export default SVGPreserveAspectRatioMeetOrSliceEnum;
//# sourceMappingURL=SVGPreserveAspectRatioMeetOrSliceEnum.d.ts.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"SVGPreserveAspectRatioMeetOrSliceEnum.d.ts","sourceRoot":"","sources":["../../src/svg/SVGPreserveAspectRatioMeetOrSliceEnum.ts"],"names":[],"mappings":"AAAA,aAAK,qCAAqC;IACzC,OAAO,IAAI;IACX,IAAI,IAAI;IACR,KAAK,IAAI;CACT;AAED,eAAe,qCAAqC,CAAC"}

View File

@@ -0,0 +1,8 @@
var SVGPreserveAspectRatioMeetOrSliceEnum;
(function (SVGPreserveAspectRatioMeetOrSliceEnum) {
SVGPreserveAspectRatioMeetOrSliceEnum[SVGPreserveAspectRatioMeetOrSliceEnum["unknown"] = 0] = "unknown";
SVGPreserveAspectRatioMeetOrSliceEnum[SVGPreserveAspectRatioMeetOrSliceEnum["meet"] = 1] = "meet";
SVGPreserveAspectRatioMeetOrSliceEnum[SVGPreserveAspectRatioMeetOrSliceEnum["slice"] = 2] = "slice";
})(SVGPreserveAspectRatioMeetOrSliceEnum || (SVGPreserveAspectRatioMeetOrSliceEnum = {}));
export default SVGPreserveAspectRatioMeetOrSliceEnum;
//# sourceMappingURL=SVGPreserveAspectRatioMeetOrSliceEnum.js.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"SVGPreserveAspectRatioMeetOrSliceEnum.js","sourceRoot":"","sources":["../../src/svg/SVGPreserveAspectRatioMeetOrSliceEnum.ts"],"names":[],"mappings":"AAAA,IAAK,qCAIJ;AAJD,WAAK,qCAAqC;IACzC,uGAAW,CAAA;IACX,iGAAQ,CAAA;IACR,mGAAS,CAAA;AACV,CAAC,EAJI,qCAAqC,KAArC,qCAAqC,QAIzC;AAED,eAAe,qCAAqC,CAAC"}

Some files were not shown because too many files have changed in this diff Show More