kitchen-simulator 1.1.1-test.48 → 1.1.1-test.49
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/KitchenConfiguratorApp.js +3 -0
- package/package.json +1 -1
- package/es/@history.js +0 -2
- package/es/AppContext.js +0 -3
- package/es/KitchenConfigurator.js +0 -645
- package/es/KitchenConfiguratorApp.js +0 -478
- package/es/actions/area-actions.js +0 -14
- package/es/actions/export.js +0 -23
- package/es/actions/groups-actions.js +0 -89
- package/es/actions/holes-actions.js +0 -119
- package/es/actions/items-actions.js +0 -313
- package/es/actions/lines-actions.js +0 -81
- package/es/actions/project-actions.js +0 -281
- package/es/actions/scene-actions.js +0 -33
- package/es/actions/vertices-actions.js +0 -27
- package/es/actions/viewer2d-actions.js +0 -58
- package/es/actions/viewer3d-actions.js +0 -23
- package/es/catalog/areas/area/planner-element.js +0 -40
- package/es/catalog/areas/area/textures/ceramic-tile.jpg +0 -0
- package/es/catalog/areas/area/textures/grass.jpg +0 -0
- package/es/catalog/areas/area/textures/parquet.jpg +0 -0
- package/es/catalog/areas/area/textures/strand-porcelain.jpg +0 -0
- package/es/catalog/areas/area/textures/tile1.jpg +0 -0
- package/es/catalog/catalog.js +0 -277
- package/es/catalog/envMap/nx.hdr +0 -0
- package/es/catalog/envMap/ny.hdr +0 -0
- package/es/catalog/envMap/nz.hdr +0 -0
- package/es/catalog/envMap/px.hdr +0 -0
- package/es/catalog/envMap/py.hdr +0 -0
- package/es/catalog/envMap/pz.hdr +0 -0
- package/es/catalog/factories/area-factory-3d.js +0 -181
- package/es/catalog/factories/area-factory.js +0 -81
- package/es/catalog/factories/export.js +0 -7
- package/es/catalog/factories/wall-factory-3d.js +0 -202
- package/es/catalog/factories/wall-factory.js +0 -268
- package/es/catalog/holes/door-closet/planner-element.js +0 -222
- package/es/catalog/holes/door-double/door_double.png +0 -0
- package/es/catalog/holes/door-double/planner-element.js +0 -315
- package/es/catalog/holes/door-exterior/planner-element.js +0 -215
- package/es/catalog/holes/door-interior/planner-element.js +0 -227
- package/es/catalog/holes/door-panic/panicDoor.png +0 -0
- package/es/catalog/holes/door-panic/planner-element.js +0 -503
- package/es/catalog/holes/door-panic-double/panicDoorDouble.png +0 -0
- package/es/catalog/holes/door-panic-double/planner-element.js +0 -463
- package/es/catalog/holes/door-sliding/planner-element.js +0 -225
- package/es/catalog/holes/doorway-framed/planner-element.js +0 -145
- package/es/catalog/holes/doorway-frameless/planner-element.js +0 -104
- package/es/catalog/holes/export.js +0 -13
- package/es/catalog/holes/gate/gate.jpg +0 -0
- package/es/catalog/holes/window-clear/planner-element.js +0 -166
- package/es/catalog/holes/window-clear/texture.png +0 -0
- package/es/catalog/holes/window-cross/planner-element.js +0 -165
- package/es/catalog/holes/window-cross/texture.png +0 -0
- package/es/catalog/holes/window-double-hung/planner-element.js +0 -303
- package/es/catalog/holes/window-double-hung/texture.png +0 -0
- package/es/catalog/holes/window-vertical/planner-element.js +0 -276
- package/es/catalog/holes/window-vertical/texture.png +0 -0
- package/es/catalog/lines/wall/planner-element.js +0 -70
- package/es/catalog/lines/wall/textures/bricks-normal.jpg +0 -0
- package/es/catalog/lines/wall/textures/bricks-normal2.jpg +0 -0
- package/es/catalog/lines/wall/textures/bricks.jpg +0 -0
- package/es/catalog/lines/wall/textures/bricks2.jpg +0 -0
- package/es/catalog/lines/wall/textures/bricks3.jpg +0 -0
- package/es/catalog/lines/wall/textures/morden-normal.jpg +0 -0
- package/es/catalog/lines/wall/textures/morden.jpg +0 -0
- package/es/catalog/lines/wall/textures/painted-normal.jpg +0 -0
- package/es/catalog/lines/wall/textures/painted.jpg +0 -0
- package/es/catalog/lines/wall/textures/plaster-normal.jpg +0 -0
- package/es/catalog/lines/wall/textures/plaster.jpg +0 -0
- package/es/catalog/lines/wall/wall.png +0 -0
- package/es/catalog/molding/molding-dcm/planner-element.js +0 -28
- package/es/catalog/molding/molding-dcm/texture.png +0 -0
- package/es/catalog/molding/molding-fbm/planner-element.js +0 -28
- package/es/catalog/molding/molding-fbm/texture.png +0 -0
- package/es/catalog/molding/molding-lrm/planner-element.js +0 -28
- package/es/catalog/molding/molding-lrm/texture.png +0 -0
- package/es/catalog/properties/export.js +0 -21
- package/es/catalog/properties/property-checkbox.js +0 -116
- package/es/catalog/properties/property-color.js +0 -39
- package/es/catalog/properties/property-enum.js +0 -97
- package/es/catalog/properties/property-hidden.js +0 -19
- package/es/catalog/properties/property-lenght-measure.js +0 -101
- package/es/catalog/properties/property-length-measure.js +0 -134
- package/es/catalog/properties/property-length-measure_hole.js +0 -101
- package/es/catalog/properties/property-number.js +0 -48
- package/es/catalog/properties/property-read-only.js +0 -26
- package/es/catalog/properties/property-string.js +0 -48
- package/es/catalog/properties/property-toggle.js +0 -39
- package/es/catalog/properties/shared-property-style.js +0 -14
- package/es/catalog/utils/FuseUtils.js +0 -82
- package/es/catalog/utils/exporter.js +0 -148
- package/es/catalog/utils/geom-utils.js +0 -189
- package/es/catalog/utils/item-loader.js +0 -1521
- package/es/catalog/utils/load-obj.js +0 -91
- package/es/catalog/utils/mtl-loader.js +0 -358
- package/es/catalog/utils/obj-loader.js +0 -477
- package/es/class/FuseUtils.js +0 -82
- package/es/class/area.js +0 -145
- package/es/class/export.js +0 -24
- package/es/class/group.js +0 -440
- package/es/class/guide.js +0 -62
- package/es/class/hole.js +0 -929
- package/es/class/item.js +0 -1883
- package/es/class/layer.js +0 -667
- package/es/class/line.js +0 -1180
- package/es/class/project.js +0 -793
- package/es/class/vertex.js +0 -202
- package/es/components/content.js +0 -107
- package/es/components/disclaimer/disclaimer.js +0 -97
- package/es/components/export.js +0 -9
- package/es/components/style/button.js +0 -113
- package/es/components/style/cancel-button.js +0 -22
- package/es/components/style/content-container.js +0 -33
- package/es/components/style/content-title.js +0 -29
- package/es/components/style/delete-button.js +0 -25
- package/es/components/style/export.js +0 -31
- package/es/components/style/form-block.js +0 -24
- package/es/components/style/form-color-input.js +0 -27
- package/es/components/style/form-label.js +0 -26
- package/es/components/style/form-number-input.js +0 -213
- package/es/components/style/form-number-input_2.js +0 -206
- package/es/components/style/form-select.js +0 -68
- package/es/components/style/form-slider.js +0 -61
- package/es/components/style/form-submit-button.js +0 -26
- package/es/components/style/form-text-input.js +0 -95
- package/es/components/viewer2d/area.js +0 -81
- package/es/components/viewer2d/export.js +0 -31
- package/es/components/viewer2d/grids/grid-horizontal-streak.js +0 -37
- package/es/components/viewer2d/grids/grid-streak.js +0 -37
- package/es/components/viewer2d/grids/grid-vertical-streak.js +0 -37
- package/es/components/viewer2d/grids/grids.js +0 -35
- package/es/components/viewer2d/group.js +0 -53
- package/es/components/viewer2d/item.js +0 -513
- package/es/components/viewer2d/layer.js +0 -164
- package/es/components/viewer2d/line.js +0 -882
- package/es/components/viewer2d/ruler.js +0 -100
- package/es/components/viewer2d/rulerDist.js +0 -146
- package/es/components/viewer2d/rulerX.js +0 -151
- package/es/components/viewer2d/rulerY.js +0 -153
- package/es/components/viewer2d/scene.js +0 -140
- package/es/components/viewer2d/snap.js +0 -74
- package/es/components/viewer2d/state.js +0 -78
- package/es/components/viewer2d/utils.js +0 -198
- package/es/components/viewer2d/vertex.js +0 -65
- package/es/components/viewer2d/viewer2d.js +0 -1398
- package/es/components/viewer3d/camera-controls-module/camera-controls.module.js +0 -2592
- package/es/components/viewer3d/dcm.js +0 -401
- package/es/components/viewer3d/fbm.js +0 -414
- package/es/components/viewer3d/front3D.js +0 -66
- package/es/components/viewer3d/grid-creator.js +0 -25
- package/es/components/viewer3d/grids/grid-horizontal-streak.js +0 -36
- package/es/components/viewer3d/grids/grid-streak.js +0 -27
- package/es/components/viewer3d/grids/grid-vertical-streak.js +0 -36
- package/es/components/viewer3d/libs/first-person-controls.js +0 -67
- package/es/components/viewer3d/libs/helvetiker_regular.typeface.js +0 -1281
- package/es/components/viewer3d/libs/mtl-loader.js +0 -357
- package/es/components/viewer3d/libs/obj-loader.js +0 -462
- package/es/components/viewer3d/libs/orbit-controls.js +0 -699
- package/es/components/viewer3d/libs/pointer-lock-controls.js +0 -46
- package/es/components/viewer3d/lrm.js +0 -305
- package/es/components/viewer3d/model.js +0 -708
- package/es/components/viewer3d/pointer-lock-navigation.js +0 -115
- package/es/components/viewer3d/ruler-utils/itemRect.js +0 -61
- package/es/components/viewer3d/ruler-utils/layer3D.js +0 -495
- package/es/components/viewer3d/ruler-utils/ruler3D.js +0 -227
- package/es/components/viewer3d/ruler-utils/scene3D.js +0 -60
- package/es/components/viewer3d/ruler-utils/state3D.js +0 -18
- package/es/components/viewer3d/scene-creator.js +0 -3608
- package/es/components/viewer3d/three-memory-cleaner.js +0 -51
- package/es/components/viewer3d/viewer3d-first-person.js +0 -315
- package/es/components/viewer3d/viewer3d.js +0 -2527
- package/es/constants.js +0 -636
- package/es/index.js +0 -16
- package/es/models.js +0 -510
- package/es/plugins/SVGLoader.js +0 -1412
- package/es/plugins/autosave.js +0 -33
- package/es/plugins/console-debugger.js +0 -37
- package/es/plugins/export.js +0 -9
- package/es/plugins/keyboard.js +0 -101
- package/es/reducers/areas-reducer.js +0 -12
- package/es/reducers/export.js +0 -25
- package/es/reducers/groups-reducer.js +0 -38
- package/es/reducers/holes-reducer.js +0 -62
- package/es/reducers/items-reducer.js +0 -140
- package/es/reducers/lines-reducer.js +0 -45
- package/es/reducers/project-reducer.js +0 -129
- package/es/reducers/reducer.js +0 -19
- package/es/reducers/scene-reducer.js +0 -28
- package/es/reducers/user-reducer.js +0 -40
- package/es/reducers/vertices-reducer.js +0 -19
- package/es/reducers/viewer2d-reducer.js +0 -75
- package/es/reducers/viewer3d-reducer.js +0 -56
- package/es/shared-style.js +0 -66
- package/es/styles/export.js +0 -5
- package/es/styles/tabs.css +0 -40
- package/es/translator/en.js +0 -104
- package/es/translator/it.js +0 -79
- package/es/translator/ru.js +0 -79
- package/es/translator/translator.js +0 -84
- package/es/utils/browser.js +0 -33
- package/es/utils/email-validator.js +0 -4
- package/es/utils/export.js +0 -25
- package/es/utils/geometry.js +0 -2420
- package/es/utils/get-edges-of-subgraphs.js +0 -27
- package/es/utils/graph-cycles.js +0 -237
- package/es/utils/graph-inner-cycles.js +0 -46
- package/es/utils/graph.js +0 -150
- package/es/utils/helper.js +0 -268
- package/es/utils/history.js +0 -29
- package/es/utils/id-broker.js +0 -19
- package/es/utils/logger.js +0 -8
- package/es/utils/math.js +0 -50
- package/es/utils/molding.js +0 -871
- package/es/utils/name-generator.js +0 -18
- package/es/utils/objects-utils.js +0 -50
- package/es/utils/phone-validator.js +0 -4
- package/es/utils/process-black-list.js +0 -18
- package/es/utils/react-if.js +0 -18
- package/es/utils/snap-scene.js +0 -99
- package/es/utils/snap.js +0 -237
- package/es/utils/summarizeCart.js +0 -24
- package/es/utils/threeCSG.es6.js +0 -498
- package/es/version.js +0 -2
- package/lib/catalog/properties/property-string.js +0 -55
- package/lib/catalog/properties/property-toggle.js +0 -46
- package/lib/catalog/properties/shared-property-style.js +0 -20
- package/lib/catalog/utils/FuseUtils.js +0 -88
- package/lib/catalog/utils/exporter.js +0 -155
- package/lib/catalog/utils/geom-utils.js +0 -205
- package/lib/catalog/utils/item-loader.js +0 -1533
- package/lib/catalog/utils/load-obj.js +0 -99
- package/lib/catalog/utils/mtl-loader.js +0 -363
- package/lib/catalog/utils/obj-loader.js +0 -482
- package/lib/class/FuseUtils.js +0 -88
- package/lib/class/area.js +0 -150
- package/lib/class/export.js +0 -96
- package/lib/class/group.js +0 -445
- package/lib/class/guide.js +0 -67
- package/lib/class/hole.js +0 -934
- package/lib/class/item.js +0 -1889
- package/lib/class/layer.js +0 -672
- package/lib/class/line.js +0 -1186
- package/lib/class/project.js +0 -799
- package/lib/class/vertex.js +0 -207
- package/lib/components/content.js +0 -116
- package/lib/components/disclaimer/disclaimer.js +0 -105
- package/lib/components/export.js +0 -33
- package/lib/components/style/button.js +0 -120
- package/lib/components/style/cancel-button.js +0 -29
- package/lib/components/style/content-container.js +0 -40
- package/lib/components/style/content-title.js +0 -37
- package/lib/components/style/delete-button.js +0 -34
- package/lib/components/style/export.js +0 -121
- package/lib/components/style/form-block.js +0 -31
- package/lib/components/style/form-color-input.js +0 -34
- package/lib/components/style/form-label.js +0 -33
- package/lib/components/style/form-number-input.js +0 -220
- package/lib/components/style/form-number-input_2.js +0 -213
- package/lib/components/style/form-select.js +0 -75
- package/lib/components/style/form-slider.js +0 -68
- package/lib/components/style/form-submit-button.js +0 -35
- package/lib/components/style/form-text-input.js +0 -101
- package/lib/components/viewer2d/area.js +0 -88
- package/lib/components/viewer2d/export.js +0 -121
- package/lib/components/viewer2d/grids/grid-horizontal-streak.js +0 -44
- package/lib/components/viewer2d/grids/grid-streak.js +0 -44
- package/lib/components/viewer2d/grids/grid-vertical-streak.js +0 -44
- package/lib/components/viewer2d/grids/grids.js +0 -44
- package/lib/components/viewer2d/group.js +0 -62
- package/lib/components/viewer2d/item.js +0 -521
- package/lib/components/viewer2d/layer.js +0 -171
- package/lib/components/viewer2d/line.js +0 -892
- package/lib/components/viewer2d/ruler.js +0 -107
- package/lib/components/viewer2d/rulerDist.js +0 -153
- package/lib/components/viewer2d/rulerX.js +0 -158
- package/lib/components/viewer2d/rulerY.js +0 -160
- package/lib/components/viewer2d/scene.js +0 -147
- package/lib/components/viewer2d/snap.js +0 -83
- package/lib/components/viewer2d/state.js +0 -87
- package/lib/components/viewer2d/utils.js +0 -210
- package/lib/components/viewer2d/vertex.js +0 -74
- package/lib/components/viewer2d/viewer2d.js +0 -1405
- package/lib/components/viewer3d/camera-controls-module/camera-controls.module.js +0 -2597
- package/lib/components/viewer3d/dcm.js +0 -407
- package/lib/components/viewer3d/fbm.js +0 -420
- package/lib/components/viewer3d/front3D.js +0 -75
- package/lib/components/viewer3d/grid-creator.js +0 -34
- package/lib/components/viewer3d/grids/grid-horizontal-streak.js +0 -44
- package/lib/components/viewer3d/grids/grid-streak.js +0 -35
- package/lib/components/viewer3d/grids/grid-vertical-streak.js +0 -44
- package/lib/components/viewer3d/libs/first-person-controls.js +0 -74
- package/lib/components/viewer3d/libs/helvetiker_regular.typeface.js +0 -1287
- package/lib/components/viewer3d/libs/mtl-loader.js +0 -363
- package/lib/components/viewer3d/libs/obj-loader.js +0 -468
- package/lib/components/viewer3d/libs/orbit-controls.js +0 -705
- package/lib/components/viewer3d/libs/pointer-lock-controls.js +0 -52
- package/lib/components/viewer3d/lrm.js +0 -311
- package/lib/components/viewer3d/model.js +0 -714
- package/lib/components/viewer3d/pointer-lock-navigation.js +0 -122
- package/lib/components/viewer3d/ruler-utils/itemRect.js +0 -68
- package/lib/components/viewer3d/ruler-utils/layer3D.js +0 -502
- package/lib/components/viewer3d/ruler-utils/ruler3D.js +0 -234
- package/lib/components/viewer3d/ruler-utils/scene3D.js +0 -68
- package/lib/components/viewer3d/ruler-utils/state3D.js +0 -25
- package/lib/components/viewer3d/scene-creator.js +0 -3642
- package/lib/components/viewer3d/three-memory-cleaner.js +0 -60
- package/lib/components/viewer3d/viewer3d-first-person.js +0 -320
- package/lib/components/viewer3d/viewer3d.js +0 -2532
- package/lib/constants.js +0 -645
- package/lib/index.js +0 -96
- package/lib/models.js +0 -517
- package/lib/plugins/SVGLoader.js +0 -1417
- package/lib/plugins/autosave.js +0 -39
- package/lib/plugins/console-debugger.js +0 -44
- package/lib/plugins/export.js +0 -33
- package/lib/plugins/keyboard.js +0 -107
- package/lib/reducers/areas-reducer.js +0 -18
- package/lib/reducers/export.js +0 -97
- package/lib/reducers/groups-reducer.js +0 -44
- package/lib/reducers/holes-reducer.js +0 -68
- package/lib/reducers/items-reducer.js +0 -146
- package/lib/reducers/lines-reducer.js +0 -51
- package/lib/reducers/project-reducer.js +0 -135
- package/lib/reducers/reducer.js +0 -26
- package/lib/reducers/scene-reducer.js +0 -34
- package/lib/reducers/user-reducer.js +0 -46
- package/lib/reducers/vertices-reducer.js +0 -25
- package/lib/reducers/viewer2d-reducer.js +0 -82
- package/lib/reducers/viewer3d-reducer.js +0 -63
- package/lib/shared-style.js +0 -72
- package/lib/styles/export.js +0 -13
- package/lib/translator/en.js +0 -110
- package/lib/translator/it.js +0 -85
- package/lib/translator/ru.js +0 -85
- package/lib/translator/translator.js +0 -90
- package/lib/utils/browser.js +0 -40
- package/lib/utils/email-validator.js +0 -10
- package/lib/utils/export.js +0 -56
- package/lib/utils/geometry.js +0 -2516
- package/lib/utils/get-edges-of-subgraphs.js +0 -34
- package/lib/utils/graph-cycles.js +0 -240
- package/lib/utils/graph-inner-cycles.js +0 -54
- package/lib/utils/graph.js +0 -157
- package/lib/utils/helper.js +0 -291
- package/lib/utils/history.js +0 -36
- package/lib/utils/id-broker.js +0 -25
- package/lib/utils/logger.js +0 -14
- package/lib/utils/math.js +0 -57
- package/lib/utils/molding.js +0 -895
- package/lib/utils/name-generator.js +0 -23
- package/lib/utils/objects-utils.js +0 -60
- package/lib/utils/phone-validator.js +0 -10
- package/lib/utils/process-black-list.js +0 -24
- package/lib/utils/react-if.js +0 -24
- package/lib/utils/snap-scene.js +0 -105
- package/lib/utils/snap.js +0 -249
- package/lib/utils/summarizeCart.js +0 -30
- package/lib/utils/threeCSG.es6.js +0 -503
- package/lib/version.js +0 -8
package/lib/utils/helper.js
DELETED
|
@@ -1,291 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.animateDoor = void 0;
|
|
7
|
-
exports.applyEdges = applyEdges;
|
|
8
|
-
exports.base64Decode = void 0;
|
|
9
|
-
exports.debugUtil = debugUtil;
|
|
10
|
-
exports.getPathInfo = exports.getPath = void 0;
|
|
11
|
-
exports.handleCamRect = handleCamRect;
|
|
12
|
-
exports.isCeilLimitation = isCeilLimitation;
|
|
13
|
-
exports.isElevationView = isElevationView;
|
|
14
|
-
exports.isEmpty = void 0;
|
|
15
|
-
exports.isImmutable = isImmutable;
|
|
16
|
-
exports.isValidNumber = isValidNumber;
|
|
17
|
-
exports.refineProductForSummaryPdf = exports.refineMoldingForSummaryPdf = void 0;
|
|
18
|
-
exports.replaceMeshesWithLineSegments = replaceMeshesWithLineSegments;
|
|
19
|
-
exports.textureCube = void 0;
|
|
20
|
-
exports.toPlainObject = toPlainObject;
|
|
21
|
-
exports.translateDrawer = void 0;
|
|
22
|
-
var _HDRCubeTextureLoader = require("three/examples/jsm/loaders/HDRCubeTextureLoader.js");
|
|
23
|
-
var _constants = require("../constants");
|
|
24
|
-
var Three = _interopRequireWildcard(require("three"));
|
|
25
|
-
var _utils = require("./../components/viewer2d/utils");
|
|
26
|
-
var _convertUnits = _interopRequireDefault(require("convert-units"));
|
|
27
|
-
var _math = require("./math");
|
|
28
|
-
function _interopRequireDefault(e) { return e && e.__esModule ? e : { "default": e }; }
|
|
29
|
-
function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function _interopRequireWildcard(e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, "default": e }; if (null === e || "object" != _typeof(e) && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (var _t in e) "default" !== _t && {}.hasOwnProperty.call(e, _t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, _t)) && (i.get || i.set) ? o(f, _t, i) : f[_t] = e[_t]); return f; })(e, t); }
|
|
30
|
-
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
|
|
31
|
-
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
32
|
-
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
33
|
-
function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
|
|
34
|
-
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
|
|
35
|
-
function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
36
|
-
var textureCube = exports.textureCube = new _HDRCubeTextureLoader.HDRCubeTextureLoader().setPath('/catalog/envMap/').load(_constants.HDR_URLS, function () {
|
|
37
|
-
textureCube.magFilter = Three.LinearFilter;
|
|
38
|
-
textureCube.needsUpdate = true;
|
|
39
|
-
});
|
|
40
|
-
var base64Decode = exports.base64Decode = function base64Decode(targetStr) {
|
|
41
|
-
if (!targetStr) return null;
|
|
42
|
-
try {
|
|
43
|
-
// If URL-encoded, decode first
|
|
44
|
-
var base64Str = targetStr.includes('%') ? decodeURIComponent(targetStr) : targetStr;
|
|
45
|
-
var binaryStr = atob(base64Str);
|
|
46
|
-
// Convert binary string to UTF-8 string
|
|
47
|
-
return decodeURIComponent(binaryStr.split('').map(function (_char) {
|
|
48
|
-
return "%".concat(_char.charCodeAt(0).toString(16).padStart(2, '0'));
|
|
49
|
-
}).join(''));
|
|
50
|
-
} catch (e) {
|
|
51
|
-
console.log('Invalid Base64 or UTF-8 string: ', e);
|
|
52
|
-
return null;
|
|
53
|
-
}
|
|
54
|
-
};
|
|
55
|
-
var refineProductForSummaryPdf = exports.refineProductForSummaryPdf = function refineProductForSummaryPdf(refinedProductList, catalog, categoryData, itemSKU, suffix, item, product, measurementUnit, count) {
|
|
56
|
-
var _doorColor;
|
|
57
|
-
var review;
|
|
58
|
-
var doorColor = item.doorStyle;
|
|
59
|
-
if (doorColor.size) {
|
|
60
|
-
doorColor = doorColor.toJS();
|
|
61
|
-
}
|
|
62
|
-
var doorStyleName = (_doorColor = doorColor) === null || _doorColor === void 0 ? void 0 : _doorColor.name;
|
|
63
|
-
if (catalog !== undefined) {
|
|
64
|
-
var _doorColor2, _doorColor4;
|
|
65
|
-
if (!((_doorColor2 = doorColor) !== null && _doorColor2 !== void 0 && _doorColor2.install)) {
|
|
66
|
-
categoryData.data.doorStyles.items.forEach(function (category) {
|
|
67
|
-
category.items.forEach(function (element) {
|
|
68
|
-
if (element.items.filter(function (it) {
|
|
69
|
-
var _doorColor3;
|
|
70
|
-
return it.id === ((_doorColor3 = doorColor) === null || _doorColor3 === void 0 ? void 0 : _doorColor3.id);
|
|
71
|
-
})) {
|
|
72
|
-
doorColor = _objectSpread(_objectSpread({}, doorColor), {}, {
|
|
73
|
-
install: category.name
|
|
74
|
-
});
|
|
75
|
-
}
|
|
76
|
-
});
|
|
77
|
-
});
|
|
78
|
-
}
|
|
79
|
-
review = catalog.elements[item.type];
|
|
80
|
-
if (!review) {
|
|
81
|
-
review = catalog.elements[(0, _utils.returnReplaceableDeepSearchType)(item.type)];
|
|
82
|
-
}
|
|
83
|
-
if (((_doorColor4 = doorColor) === null || _doorColor4 === void 0 || (_doorColor4 = _doorColor4.install) === null || _doorColor4 === void 0 ? void 0 : _doorColor4.toLowerCase()) === 'pre-assembled') {
|
|
84
|
-
itemSKU += '-assembled';
|
|
85
|
-
} else {
|
|
86
|
-
itemSKU += '-rta';
|
|
87
|
-
}
|
|
88
|
-
var refinedData = {
|
|
89
|
-
thumbnail: review.img,
|
|
90
|
-
sku: itemSKU,
|
|
91
|
-
sizeInfo: {
|
|
92
|
-
width: Math.round((0, _convertUnits["default"])(review.info.sizeinfo.width).from('in').to(measurementUnit._unit) * 100) / 100,
|
|
93
|
-
depth: Math.round((0, _convertUnits["default"])(review.info.sizeinfo.depth).from('in').to(measurementUnit._unit) * 100) / 100,
|
|
94
|
-
height: Math.round((0, _convertUnits["default"])(review.info.sizeinfo.height).from('in').to(measurementUnit._unit) * 100) / 100,
|
|
95
|
-
_unit: measurementUnit._unit
|
|
96
|
-
},
|
|
97
|
-
doorstyle: doorStyleName,
|
|
98
|
-
installation: suffix,
|
|
99
|
-
subTotal: product && product.discounted_price ? product && Number(product.discounted_price * (count || 1)) : 0
|
|
100
|
-
};
|
|
101
|
-
var index = (refinedProductList || []).findIndex(function (row) {
|
|
102
|
-
return row.sku === itemSKU;
|
|
103
|
-
});
|
|
104
|
-
if (index !== -1) {
|
|
105
|
-
refinedProductList[index] = refinedData;
|
|
106
|
-
} else {
|
|
107
|
-
refinedProductList.push(refinedData);
|
|
108
|
-
}
|
|
109
|
-
}
|
|
110
|
-
};
|
|
111
|
-
var refineMoldingForSummaryPdf = exports.refineMoldingForSummaryPdf = function refineMoldingForSummaryPdf(refinedProductList, molding, product, newSKU) {
|
|
112
|
-
if (molding) {
|
|
113
|
-
var review = {
|
|
114
|
-
img: molding.thumbnail,
|
|
115
|
-
name: molding.name,
|
|
116
|
-
count: molding.count
|
|
117
|
-
};
|
|
118
|
-
var subTotalPrice = product && product.discounted_price ? (0, _math.formatNumber)(product.discounted_price * review.count, _constants.DECIMAL_PLACES_2) : 0;
|
|
119
|
-
var refinedData = {
|
|
120
|
-
id: newSKU,
|
|
121
|
-
thumbnail: review.img,
|
|
122
|
-
sku: review.name,
|
|
123
|
-
sizeInfo: null,
|
|
124
|
-
subTotal: Number(subTotalPrice)
|
|
125
|
-
};
|
|
126
|
-
var index = (refinedProductList || []).findIndex(function (row) {
|
|
127
|
-
return row.sku === newSKU;
|
|
128
|
-
});
|
|
129
|
-
if (index !== -1) {
|
|
130
|
-
refinedProductList[index] = refinedData;
|
|
131
|
-
} else {
|
|
132
|
-
refinedProductList.push(refinedData);
|
|
133
|
-
}
|
|
134
|
-
}
|
|
135
|
-
};
|
|
136
|
-
function applyEdges(object) {
|
|
137
|
-
if (object && object.isMesh && !(object instanceof Three.LineSegments)) {
|
|
138
|
-
var parent = object.parent;
|
|
139
|
-
if (!isEmpty(parent)) {
|
|
140
|
-
if (object.name.match('interior_drawer') || object.name.match('interior') || object.name.match('soul')) {
|
|
141
|
-
parent.remove(object);
|
|
142
|
-
} else {
|
|
143
|
-
// Create a replacement
|
|
144
|
-
var edges = new Three.EdgesGeometry(object.geometry, 10);
|
|
145
|
-
var lineMaterial = new Three.LineBasicMaterial({
|
|
146
|
-
color: 0x000000,
|
|
147
|
-
depthTest: true,
|
|
148
|
-
depthFunc: Three.LessEqualDepth,
|
|
149
|
-
depthWrite: false
|
|
150
|
-
});
|
|
151
|
-
var line = new Three.LineSegments(edges, lineMaterial);
|
|
152
|
-
line.position.copy(object.position);
|
|
153
|
-
line.scale.copy(object.scale);
|
|
154
|
-
line.rotation.copy(object.rotation);
|
|
155
|
-
line.name = object.name;
|
|
156
|
-
|
|
157
|
-
// Replace in parent
|
|
158
|
-
parent.remove(object);
|
|
159
|
-
parent.add(line);
|
|
160
|
-
}
|
|
161
|
-
}
|
|
162
|
-
}
|
|
163
|
-
}
|
|
164
|
-
function replaceMeshesWithLineSegments(object) {
|
|
165
|
-
if (object && object.children.length > 0) {
|
|
166
|
-
for (var i = object.children.length - 1; i >= 0; i--) {
|
|
167
|
-
var child = object.children[i];
|
|
168
|
-
// Recursively process children first
|
|
169
|
-
replaceMeshesWithLineSegments(child);
|
|
170
|
-
}
|
|
171
|
-
} else {
|
|
172
|
-
//
|
|
173
|
-
// Check if the child is a THREE.Mesh
|
|
174
|
-
applyEdges(object);
|
|
175
|
-
}
|
|
176
|
-
}
|
|
177
|
-
var isEmpty = exports.isEmpty = function isEmpty(value) {
|
|
178
|
-
return value === undefined || value === null || typeof value === 'array' && value.length === 0 || _typeof(value) === 'object' && Object.keys(value).length === 0 || typeof value === 'string' && value.trim().length === 0;
|
|
179
|
-
};
|
|
180
|
-
|
|
181
|
-
// animate the Opening or Closing Door action
|
|
182
|
-
var animateDoor = exports.animateDoor = function animateDoor(offsetData, doorObj, open_doors, item, isCorner, mode) {
|
|
183
|
-
var offset = new Three.Vector3(offsetData.x, offsetData.y, offsetData === null || offsetData === void 0 ? void 0 : offsetData.z);
|
|
184
|
-
doorObj.translateOnAxis(offset, 1);
|
|
185
|
-
var rotation = doorObj.name.match(/\d_(door[^LR1-9]*)(_[LR])?(_[1-9])?$/)[2] === '_L' ? -_constants.ANIMATE_OBJECT_OPEN_DOOR_ROTATION_UNIT : _constants.ANIMATE_OBJECT_OPEN_DOOR_ROTATION_UNIT;
|
|
186
|
-
var isflip = item.properties.flip_doorhandle;
|
|
187
|
-
rotation = isflip ? -rotation : rotation;
|
|
188
|
-
if (isCorner == 1) {
|
|
189
|
-
if (!doorObj.name.includes('base_end')) {
|
|
190
|
-
rotation *= 2;
|
|
191
|
-
}
|
|
192
|
-
var tmp = doorObj.children[0].children.filter(function (item) {
|
|
193
|
-
return item.children.length != 0;
|
|
194
|
-
});
|
|
195
|
-
if (tmp.length != 0) {
|
|
196
|
-
rotation = open_doors ? -rotation : rotation;
|
|
197
|
-
} else {
|
|
198
|
-
rotation = open_doors ? rotation : -rotation;
|
|
199
|
-
}
|
|
200
|
-
} else {
|
|
201
|
-
rotation = open_doors ? rotation : -rotation;
|
|
202
|
-
}
|
|
203
|
-
if (mode === 'Opened2D') rotation *= _constants.ANIMATE_STEP_MAX; // Check whether the object's door is opened in 2D.
|
|
204
|
-
doorObj.rotateY(rotation);
|
|
205
|
-
doorObj.translateOnAxis(offset, -1);
|
|
206
|
-
};
|
|
207
|
-
|
|
208
|
-
// Opening or Closing the drawer action
|
|
209
|
-
var translateDrawer = exports.translateDrawer = function translateDrawer(item, drawerObj, open_doors, mode) {
|
|
210
|
-
var animate_translate_unit = (0, _convertUnits["default"])(item.properties.depth._length).from(item.properties.depth._unit).to('cm') * (1 / 2) / _constants.ANIMATE_STEP_MAX * 0.01;
|
|
211
|
-
// Check whether the object's drawer is opened in 2D.
|
|
212
|
-
if (mode === 'Opened2D') animate_translate_unit *= _constants.ANIMATE_STEP_MAX;
|
|
213
|
-
drawerObj.translateZ(open_doors ? -animate_translate_unit : animate_translate_unit);
|
|
214
|
-
};
|
|
215
|
-
var getPath = exports.getPath = function getPath() {
|
|
216
|
-
return window.location.pathname;
|
|
217
|
-
};
|
|
218
|
-
var getPathInfo = exports.getPathInfo = function getPathInfo(num) {
|
|
219
|
-
var paths = window.location.pathname.split('/');
|
|
220
|
-
if (paths.length >= num + 1) {
|
|
221
|
-
return paths[num];
|
|
222
|
-
} else {
|
|
223
|
-
return paths[num - 1 >= 0 ? num - 1 : 0];
|
|
224
|
-
}
|
|
225
|
-
};
|
|
226
|
-
|
|
227
|
-
// determine if elevation mode or not
|
|
228
|
-
function isElevationView(mode) {
|
|
229
|
-
if (mode === _constants.MODE_ELEVATION_VIEW) return true;else return false;
|
|
230
|
-
}
|
|
231
|
-
|
|
232
|
-
// calculate camera rect in elevation mode
|
|
233
|
-
/**
|
|
234
|
-
*
|
|
235
|
-
* @param {number} width width of elevation view - canvas
|
|
236
|
-
* @param {number} height height of elevation view - canvas
|
|
237
|
-
* @param {number} ceilHeight ceiling Height
|
|
238
|
-
* @param {number} lineLength wall's length
|
|
239
|
-
* @returns {object}
|
|
240
|
-
*/
|
|
241
|
-
|
|
242
|
-
//** elevation view (canvas) **//
|
|
243
|
-
|
|
244
|
-
//// h /////////////////////// width //////////////////////// h ////
|
|
245
|
-
//// e //// **c***************lineLength*************c** //// e ////
|
|
246
|
-
//// i //// **e e** //// i ////
|
|
247
|
-
//// g //// **i i** //// g ////
|
|
248
|
-
//// h //// **l***************lineLength*************l** //// h ////
|
|
249
|
-
//// t /////////////////////// width //////////////////////// t ////
|
|
250
|
-
function handleCamRect(width, height, ceilHeight, lineLength) {
|
|
251
|
-
var scale = Math.min(width * 0.6 / lineLength, height * 0.6 / ceilHeight); // scale is min value
|
|
252
|
-
var cameraRect = {
|
|
253
|
-
width: width / scale,
|
|
254
|
-
height: height / scale
|
|
255
|
-
};
|
|
256
|
-
return cameraRect;
|
|
257
|
-
}
|
|
258
|
-
|
|
259
|
-
/**
|
|
260
|
-
*
|
|
261
|
-
* @param {*} layer
|
|
262
|
-
* @param {*} ceilHeight
|
|
263
|
-
* @param {*} ceilUnit
|
|
264
|
-
* @returns true ceilingHeight is bigger than totalHeight(item's height + altitude), otherwise false
|
|
265
|
-
*/
|
|
266
|
-
function isCeilLimitation(layer, ceilHeight, ceilUnit) {
|
|
267
|
-
var items = layer.getIn(['layers', layer.selectedLayer, 'items']);
|
|
268
|
-
return items.some(function (item) {
|
|
269
|
-
var height = item.properties.getIn(['height', '_length']);
|
|
270
|
-
var heightUnit = item.properties.getIn(['height', '_unit']);
|
|
271
|
-
var altitude = item.properties.getIn(['altitude', '_length']);
|
|
272
|
-
var altitudeUnit = item.properties.getIn(['altitude', '_unit']);
|
|
273
|
-
var totalHeight = (0, _convertUnits["default"])(height).from(heightUnit).to(ceilUnit._unit) + (0, _convertUnits["default"])(altitude).from(altitudeUnit).to(ceilUnit._unit);
|
|
274
|
-
return totalHeight > ceilHeight;
|
|
275
|
-
});
|
|
276
|
-
}
|
|
277
|
-
function isValidNumber(n) {
|
|
278
|
-
return !isNaN(n) && isFinite(n);
|
|
279
|
-
}
|
|
280
|
-
function toPlainObject(maybeImmutable) {
|
|
281
|
-
if (maybeImmutable && typeof maybeImmutable.toJS === 'function') {
|
|
282
|
-
return maybeImmutable.toJS();
|
|
283
|
-
}
|
|
284
|
-
return maybeImmutable; // already a plain JS object
|
|
285
|
-
}
|
|
286
|
-
function isImmutable(maybeImmutable) {
|
|
287
|
-
return !!(maybeImmutable && typeof maybeImmutable.toJS === 'function');
|
|
288
|
-
}
|
|
289
|
-
function debugUtil() {
|
|
290
|
-
return new Date();
|
|
291
|
-
}
|
package/lib/utils/history.js
DELETED
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.historyPush = exports.historyPop = void 0;
|
|
7
|
-
var _immutable = require("immutable");
|
|
8
|
-
var _immutablediff = _interopRequireDefault(require("immutablediff"));
|
|
9
|
-
var _immutablepatch = _interopRequireDefault(require("immutablepatch"));
|
|
10
|
-
function _interopRequireDefault(e) { return e && e.__esModule ? e : { "default": e }; }
|
|
11
|
-
var historyPush = exports.historyPush = function historyPush(historyStructure, item) {
|
|
12
|
-
if (historyStructure.last) {
|
|
13
|
-
if (historyStructure.last.hashCode() !== item.hashCode()) {
|
|
14
|
-
var toPush = new _immutable.Map({
|
|
15
|
-
time: Date.now(),
|
|
16
|
-
diff: (0, _immutablediff["default"])(historyStructure.last, item)
|
|
17
|
-
});
|
|
18
|
-
historyStructure = historyStructure.set('last', item).set('list', historyStructure.list.push(toPush));
|
|
19
|
-
}
|
|
20
|
-
} else {
|
|
21
|
-
historyStructure = historyStructure.set('last', item);
|
|
22
|
-
}
|
|
23
|
-
return historyStructure;
|
|
24
|
-
};
|
|
25
|
-
var historyPop = exports.historyPop = function historyPop(historyStructure) {
|
|
26
|
-
if (historyStructure.last) {
|
|
27
|
-
if (historyStructure.list.size) {
|
|
28
|
-
var last = historyStructure.first;
|
|
29
|
-
for (var x = 0; x < historyStructure.list.size - 1; x++) {
|
|
30
|
-
last = (0, _immutablepatch["default"])(last, historyStructure.list.get(x).get('diff'));
|
|
31
|
-
}
|
|
32
|
-
historyStructure = historyStructure.set('last', last).set('list', historyStructure.list.pop());
|
|
33
|
-
}
|
|
34
|
-
}
|
|
35
|
-
return historyStructure;
|
|
36
|
-
};
|
package/lib/utils/id-broker.js
DELETED
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports["default"] = exports.IDBroker = void 0;
|
|
7
|
-
var _nanoid = require("nanoid");
|
|
8
|
-
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
|
|
9
|
-
function _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); }
|
|
10
|
-
function _defineProperties(e, r) { for (var t = 0; t < r.length; t++) { var o = r[t]; o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e, _toPropertyKey(o.key), o); } }
|
|
11
|
-
function _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e; }
|
|
12
|
-
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
|
|
13
|
-
function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
14
|
-
var IDBroker = exports.IDBroker = /*#__PURE__*/function () {
|
|
15
|
-
function IDBroker() {
|
|
16
|
-
_classCallCheck(this, IDBroker);
|
|
17
|
-
}
|
|
18
|
-
return _createClass(IDBroker, null, [{
|
|
19
|
-
key: "acquireID",
|
|
20
|
-
value: function acquireID() {
|
|
21
|
-
return (0, _nanoid.nanoid)();
|
|
22
|
-
}
|
|
23
|
-
}]);
|
|
24
|
-
}();
|
|
25
|
-
var _default = exports["default"] = IDBroker;
|
package/lib/utils/logger.js
DELETED
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.LogLine = LogLine;
|
|
7
|
-
function LogLine(state, layerID, lineID) {
|
|
8
|
-
var layer = state.getIn(['scene', 'layers', layerID]);
|
|
9
|
-
var line = state.getIn(['scene', 'layers', layerID, 'lines', lineID]);
|
|
10
|
-
var vertex0 = layer.vertices.get(line.vertices.get(0));
|
|
11
|
-
var vertex1 = layer.vertices.get(line.vertices.get(1));
|
|
12
|
-
console.log('updateDrawingLine: vertex0', vertex0.x, vertex0.y);
|
|
13
|
-
console.log('updateDrawingLine: vertex1', vertex1.x, vertex1.y);
|
|
14
|
-
}
|
package/lib/utils/math.js
DELETED
|
@@ -1,57 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.multiplyMatrices = exports.isNonZeroText = exports.formatNumber = exports.fAbs = void 0;
|
|
7
|
-
exports.toFixedFloat = toFixedFloat;
|
|
8
|
-
/** @description Return float fixed to desired precision
|
|
9
|
-
* @param {number} num Float to fix
|
|
10
|
-
* @param {number} precision Desired precision, or 6 if not specified
|
|
11
|
-
* @return {number}
|
|
12
|
-
*/
|
|
13
|
-
function toFixedFloat(num) {
|
|
14
|
-
var precision = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 6;
|
|
15
|
-
if (num && precision) {
|
|
16
|
-
return parseFloat(parseFloat(num).toFixed(precision));
|
|
17
|
-
}
|
|
18
|
-
return 0;
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
/** @description Return absolute value of a number
|
|
22
|
-
* @param {number} n Number of wich get value without sign
|
|
23
|
-
* @return {number}
|
|
24
|
-
*/
|
|
25
|
-
var fAbs = exports.fAbs = function fAbs(n) {
|
|
26
|
-
return Math.abs(n);
|
|
27
|
-
// let x = n;
|
|
28
|
-
// x < 0 && (x = ~x + 1);
|
|
29
|
-
// return x;
|
|
30
|
-
};
|
|
31
|
-
|
|
32
|
-
/** @description Multiply two matrices
|
|
33
|
-
* @param {Array} m1 Matrix 1
|
|
34
|
-
* @param {Array} m2 Matrix 2
|
|
35
|
-
* @return {Array}
|
|
36
|
-
*/
|
|
37
|
-
var multiplyMatrices = exports.multiplyMatrices = function multiplyMatrices(m1, m2) {
|
|
38
|
-
var result = [];
|
|
39
|
-
for (var i = 0; i < m1.length; i++) {
|
|
40
|
-
result[i] = [];
|
|
41
|
-
for (var j = 0; j < m2[0].length; j++) {
|
|
42
|
-
var sum = 0;
|
|
43
|
-
for (var k = 0; k < m1[0].length; k++) {
|
|
44
|
-
sum += m1[i][k] * m2[k][j];
|
|
45
|
-
}
|
|
46
|
-
result[i][j] = sum;
|
|
47
|
-
}
|
|
48
|
-
}
|
|
49
|
-
return result;
|
|
50
|
-
};
|
|
51
|
-
var formatNumber = exports.formatNumber = function formatNumber(value, digits) {
|
|
52
|
-
if (value == null || isNaN(Number(value))) return value; // guard for null/undefined/non-numeric
|
|
53
|
-
return Number(value).toFixed(digits);
|
|
54
|
-
};
|
|
55
|
-
var isNonZeroText = exports.isNonZeroText = function isNonZeroText(text) {
|
|
56
|
-
return parseFloat(text) !== 0;
|
|
57
|
-
};
|