x_ite 10.1.0 → 10.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (95) hide show
  1. package/README.md +18 -18
  2. package/dist/LICENSE.md +4 -0
  3. package/dist/X3DUOM.xml +69 -11
  4. package/dist/assets/components/{Annotation.js → AnnotationComponent.js} +138 -260
  5. package/dist/assets/components/AnnotationComponent.min.js +2 -0
  6. package/dist/assets/components/{CADGeometry.js → CADGeometryComponent.js} +177 -299
  7. package/dist/assets/components/CADGeometryComponent.min.js +2 -0
  8. package/dist/assets/components/{CubeMapTexturing.js → CubeMapTexturingComponent.js} +218 -257
  9. package/dist/assets/components/CubeMapTexturingComponent.min.js +2 -0
  10. package/dist/assets/components/DISComponent.js +994 -0
  11. package/dist/assets/components/DISComponent.min.js +2 -0
  12. package/dist/assets/components/{EventUtilities.js → EventUtilitiesComponent.js} +121 -274
  13. package/dist/assets/components/EventUtilitiesComponent.min.js +2 -0
  14. package/dist/assets/components/{Geometry2D.js → Geometry2DComponent.js} +233 -371
  15. package/dist/assets/components/Geometry2DComponent.min.js +2 -0
  16. package/dist/assets/components/{Geospatial.js → GeospatialComponent.js} +449 -676
  17. package/dist/assets/components/GeospatialComponent.min.js +2 -0
  18. package/dist/assets/components/{HAnim.js → HAnimComponent.js} +277 -387
  19. package/dist/assets/components/HAnimComponent.min.js +2 -0
  20. package/dist/assets/components/{KeyDeviceSensor.js → KeyDeviceSensorComponent.js} +71 -114
  21. package/dist/assets/components/KeyDeviceSensorComponent.min.js +2 -0
  22. package/dist/assets/components/{Layout.js → LayoutComponent.js} +234 -339
  23. package/dist/assets/components/LayoutComponent.min.js +2 -0
  24. package/dist/assets/components/{NURBS.js → NURBSComponent.js} +351 -654
  25. package/dist/assets/components/NURBSComponent.min.js +2 -0
  26. package/dist/assets/components/{ParticleSystems.js → ParticleSystemsComponent.js} +345 -674
  27. package/dist/assets/components/ParticleSystemsComponent.min.js +2 -0
  28. package/dist/assets/components/{Picking.js → PickingComponent.js} +245 -472
  29. package/dist/assets/components/PickingComponent.min.js +2 -0
  30. package/dist/assets/components/{RigidBodyPhysics.js → RigidBodyPhysicsComponent.js} +496 -804
  31. package/dist/assets/components/RigidBodyPhysicsComponent.min.js +2 -0
  32. package/dist/assets/components/ScriptingComponent.js +899 -0
  33. package/dist/assets/components/ScriptingComponent.min.js +2 -0
  34. package/dist/assets/components/{Text.js → TextComponent.js} +199 -251
  35. package/dist/assets/components/TextComponent.min.js +2 -0
  36. package/dist/assets/components/{TextureProjection.js → TextureProjectionComponent.js} +144 -190
  37. package/dist/assets/components/TextureProjectionComponent.min.js +2 -0
  38. package/dist/assets/components/{Texturing3D.js → Texturing3DComponent.js} +224 -386
  39. package/dist/assets/components/Texturing3DComponent.min.js +2 -0
  40. package/dist/assets/components/{VolumeRendering.js → VolumeRenderingComponent.js} +316 -603
  41. package/dist/assets/components/VolumeRenderingComponent.min.js +2 -0
  42. package/dist/assets/components/{X_ITE.js → X_ITEComponent.js} +1250 -1347
  43. package/dist/assets/components/X_ITEComponent.min.js +2 -0
  44. package/dist/assets/fonts/PT_Sans/OFL.txt +94 -0
  45. package/dist/assets/fonts/PT_Sans/PTSans-Bold.ttf +0 -0
  46. package/dist/assets/fonts/PT_Sans/PTSans-BoldItalic.ttf +0 -0
  47. package/dist/assets/fonts/PT_Sans/PTSans-Italic.ttf +0 -0
  48. package/dist/assets/fonts/PT_Sans/PTSans-Regular.ttf +0 -0
  49. package/dist/assets/images/XR.svg +74 -0
  50. package/dist/assets/lib/mikktspace_bg.wasm +0 -0
  51. package/dist/example.html +1 -1
  52. package/dist/x_ite.css +1 -1
  53. package/dist/x_ite.d.ts +128 -22
  54. package/dist/x_ite.js +3575 -6278
  55. package/dist/x_ite.min.js +2 -1
  56. package/dist/x_ite.min.mjs +2 -1
  57. package/dist/x_ite.mjs +3575 -6278
  58. package/dist/x_ite.zip +0 -0
  59. package/package.json +7 -5
  60. package/dist/assets/components/Annotation.min.js +0 -1
  61. package/dist/assets/components/CADGeometry.min.js +0 -1
  62. package/dist/assets/components/CubeMapTexturing.min.js +0 -1
  63. package/dist/assets/components/DIS.js +0 -1104
  64. package/dist/assets/components/DIS.min.js +0 -1
  65. package/dist/assets/components/EventUtilities.min.js +0 -1
  66. package/dist/assets/components/Geometry2D.min.js +0 -1
  67. package/dist/assets/components/Geospatial.min.js +0 -1
  68. package/dist/assets/components/HAnim.min.js +0 -1
  69. package/dist/assets/components/KeyDeviceSensor.min.js +0 -1
  70. package/dist/assets/components/Layout.min.js +0 -1
  71. package/dist/assets/components/NURBS.min.js +0 -1
  72. package/dist/assets/components/ParticleSystems.min.js +0 -1
  73. package/dist/assets/components/Picking.min.js +0 -1
  74. package/dist/assets/components/RigidBodyPhysics.min.js +0 -1
  75. package/dist/assets/components/Scripting.js +0 -927
  76. package/dist/assets/components/Scripting.min.js +0 -1
  77. package/dist/assets/components/Text.min.js +0 -1
  78. package/dist/assets/components/TextureProjection.min.js +0 -1
  79. package/dist/assets/components/Texturing3D.min.js +0 -1
  80. package/dist/assets/components/VolumeRendering.min.js +0 -1
  81. package/dist/assets/components/X_ITE.min.js +0 -1
  82. /package/dist/assets/fonts/{DroidSerif Apache License.txt → Droid/DroidSerif Apache License.txt} +0 -0
  83. /package/dist/assets/fonts/{DroidSerif-Bold.ttf → Droid/DroidSerif-Bold.ttf} +0 -0
  84. /package/dist/assets/fonts/{DroidSerif-BoldItalic.ttf → Droid/DroidSerif-BoldItalic.ttf} +0 -0
  85. /package/dist/assets/fonts/{DroidSerif-Italic.ttf → Droid/DroidSerif-Italic.ttf} +0 -0
  86. /package/dist/assets/fonts/{DroidSerif-Regular.ttf → Droid/DroidSerif-Regular.ttf} +0 -0
  87. /package/dist/assets/fonts/{Ubuntu LICENCE.txt → Ubuntu/Ubuntu LICENCE.txt} +0 -0
  88. /package/dist/assets/fonts/{Ubuntu-B.ttf → Ubuntu/Ubuntu-B.ttf} +0 -0
  89. /package/dist/assets/fonts/{Ubuntu-BI.ttf → Ubuntu/Ubuntu-BI.ttf} +0 -0
  90. /package/dist/assets/fonts/{Ubuntu-R.ttf → Ubuntu/Ubuntu-R.ttf} +0 -0
  91. /package/dist/assets/fonts/{Ubuntu-RI.ttf → Ubuntu/Ubuntu-RI.ttf} +0 -0
  92. /package/dist/assets/fonts/{UbuntuMono-B.ttf → Ubuntu/UbuntuMono-B.ttf} +0 -0
  93. /package/dist/assets/fonts/{UbuntuMono-BI.ttf → Ubuntu/UbuntuMono-BI.ttf} +0 -0
  94. /package/dist/assets/fonts/{UbuntuMono-R.ttf → Ubuntu/UbuntuMono-R.ttf} +0 -0
  95. /package/dist/assets/fonts/{UbuntuMono-RI.ttf → Ubuntu/UbuntuMono-RI.ttf} +0 -0
@@ -0,0 +1,899 @@
1
+ /* X_ITE v10.3.0 */
2
+ const __X_ITE_X3D__ = window [Symbol .for ("X_ITE.X3D-10.3.0")];
3
+ /******/ (() => { // webpackBootstrap
4
+ /******/ "use strict";
5
+ /******/ var __webpack_modules__ = ({
6
+
7
+ /***/ 254:
8
+ /***/ ((module) => {
9
+
10
+ module.exports = __X_ITE_X3D__ .jquery;
11
+
12
+ /***/ })
13
+
14
+ /******/ });
15
+ /************************************************************************/
16
+ /******/ // The module cache
17
+ /******/ var __webpack_module_cache__ = {};
18
+ /******/
19
+ /******/ // The require function
20
+ /******/ function __webpack_require__(moduleId) {
21
+ /******/ // Check if module is in cache
22
+ /******/ var cachedModule = __webpack_module_cache__[moduleId];
23
+ /******/ if (cachedModule !== undefined) {
24
+ /******/ return cachedModule.exports;
25
+ /******/ }
26
+ /******/ // Create a new module (and put it into the cache)
27
+ /******/ var module = __webpack_module_cache__[moduleId] = {
28
+ /******/ // no module.id needed
29
+ /******/ // no module.loaded needed
30
+ /******/ exports: {}
31
+ /******/ };
32
+ /******/
33
+ /******/ // Execute the module function
34
+ /******/ __webpack_modules__[moduleId](module, module.exports, __webpack_require__);
35
+ /******/
36
+ /******/ // Return the exports of the module
37
+ /******/ return module.exports;
38
+ /******/ }
39
+ /******/
40
+ /************************************************************************/
41
+ /******/ /* webpack/runtime/compat get default export */
42
+ /******/ (() => {
43
+ /******/ // getDefaultExport function for compatibility with non-harmony modules
44
+ /******/ __webpack_require__.n = (module) => {
45
+ /******/ var getter = module && module.__esModule ?
46
+ /******/ () => (module['default']) :
47
+ /******/ () => (module);
48
+ /******/ __webpack_require__.d(getter, { a: getter });
49
+ /******/ return getter;
50
+ /******/ };
51
+ /******/ })();
52
+ /******/
53
+ /******/ /* webpack/runtime/define property getters */
54
+ /******/ (() => {
55
+ /******/ // define getter functions for harmony exports
56
+ /******/ __webpack_require__.d = (exports, definition) => {
57
+ /******/ for(var key in definition) {
58
+ /******/ if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {
59
+ /******/ Object.defineProperty(exports, key, { enumerable: true, get: definition[key] });
60
+ /******/ }
61
+ /******/ }
62
+ /******/ };
63
+ /******/ })();
64
+ /******/
65
+ /******/ /* webpack/runtime/hasOwnProperty shorthand */
66
+ /******/ (() => {
67
+ /******/ __webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))
68
+ /******/ })();
69
+ /******/
70
+ /************************************************************************/
71
+
72
+ // UNUSED EXPORTS: default
73
+
74
+ ;// CONCATENATED MODULE: external "__X_ITE_X3D__ .Components"
75
+ const external_X_ITE_X3D_Components_namespaceObject = __X_ITE_X3D__ .Components;
76
+ var external_X_ITE_X3D_Components_default = /*#__PURE__*/__webpack_require__.n(external_X_ITE_X3D_Components_namespaceObject);
77
+ ;// CONCATENATED MODULE: external "__X_ITE_X3D__ .X3DBaseNode"
78
+ const external_X_ITE_X3D_X3DBaseNode_namespaceObject = __X_ITE_X3D__ .X3DBaseNode;
79
+ var external_X_ITE_X3D_X3DBaseNode_default = /*#__PURE__*/__webpack_require__.n(external_X_ITE_X3D_X3DBaseNode_namespaceObject);
80
+ ;// CONCATENATED MODULE: external "__X_ITE_X3D__ .X3DFieldDefinition"
81
+ const external_X_ITE_X3D_X3DFieldDefinition_namespaceObject = __X_ITE_X3D__ .X3DFieldDefinition;
82
+ var external_X_ITE_X3D_X3DFieldDefinition_default = /*#__PURE__*/__webpack_require__.n(external_X_ITE_X3D_X3DFieldDefinition_namespaceObject);
83
+ ;// CONCATENATED MODULE: external "__X_ITE_X3D__ .FieldDefinitionArray"
84
+ const external_X_ITE_X3D_FieldDefinitionArray_namespaceObject = __X_ITE_X3D__ .FieldDefinitionArray;
85
+ var external_X_ITE_X3D_FieldDefinitionArray_default = /*#__PURE__*/__webpack_require__.n(external_X_ITE_X3D_FieldDefinitionArray_namespaceObject);
86
+ ;// CONCATENATED MODULE: external "__X_ITE_X3D__ .X3DField"
87
+ const external_X_ITE_X3D_X3DField_namespaceObject = __X_ITE_X3D__ .X3DField;
88
+ var external_X_ITE_X3D_X3DField_default = /*#__PURE__*/__webpack_require__.n(external_X_ITE_X3D_X3DField_namespaceObject);
89
+ ;// CONCATENATED MODULE: external "__X_ITE_X3D__ .X3DArrayField"
90
+ const external_X_ITE_X3D_X3DArrayField_namespaceObject = __X_ITE_X3D__ .X3DArrayField;
91
+ var external_X_ITE_X3D_X3DArrayField_default = /*#__PURE__*/__webpack_require__.n(external_X_ITE_X3D_X3DArrayField_namespaceObject);
92
+ ;// CONCATENATED MODULE: external "__X_ITE_X3D__ .Fields"
93
+ const external_X_ITE_X3D_Fields_namespaceObject = __X_ITE_X3D__ .Fields;
94
+ var external_X_ITE_X3D_Fields_default = /*#__PURE__*/__webpack_require__.n(external_X_ITE_X3D_Fields_namespaceObject);
95
+ ;// CONCATENATED MODULE: external "__X_ITE_X3D__ .X3DBrowser"
96
+ const external_X_ITE_X3D_X3DBrowser_namespaceObject = __X_ITE_X3D__ .X3DBrowser;
97
+ var external_X_ITE_X3D_X3DBrowser_default = /*#__PURE__*/__webpack_require__.n(external_X_ITE_X3D_X3DBrowser_namespaceObject);
98
+ ;// CONCATENATED MODULE: external "__X_ITE_X3D__ .ComponentInfo"
99
+ const external_X_ITE_X3D_ComponentInfo_namespaceObject = __X_ITE_X3D__ .ComponentInfo;
100
+ var external_X_ITE_X3D_ComponentInfo_default = /*#__PURE__*/__webpack_require__.n(external_X_ITE_X3D_ComponentInfo_namespaceObject);
101
+ ;// CONCATENATED MODULE: external "__X_ITE_X3D__ .ComponentInfoArray"
102
+ const external_X_ITE_X3D_ComponentInfoArray_namespaceObject = __X_ITE_X3D__ .ComponentInfoArray;
103
+ var external_X_ITE_X3D_ComponentInfoArray_default = /*#__PURE__*/__webpack_require__.n(external_X_ITE_X3D_ComponentInfoArray_namespaceObject);
104
+ ;// CONCATENATED MODULE: external "__X_ITE_X3D__ .ProfileInfo"
105
+ const external_X_ITE_X3D_ProfileInfo_namespaceObject = __X_ITE_X3D__ .ProfileInfo;
106
+ var external_X_ITE_X3D_ProfileInfo_default = /*#__PURE__*/__webpack_require__.n(external_X_ITE_X3D_ProfileInfo_namespaceObject);
107
+ ;// CONCATENATED MODULE: external "__X_ITE_X3D__ .ProfileInfoArray"
108
+ const external_X_ITE_X3D_ProfileInfoArray_namespaceObject = __X_ITE_X3D__ .ProfileInfoArray;
109
+ var external_X_ITE_X3D_ProfileInfoArray_default = /*#__PURE__*/__webpack_require__.n(external_X_ITE_X3D_ProfileInfoArray_namespaceObject);
110
+ ;// CONCATENATED MODULE: external "__X_ITE_X3D__ .ConcreteNodesArray"
111
+ const external_X_ITE_X3D_ConcreteNodesArray_namespaceObject = __X_ITE_X3D__ .ConcreteNodesArray;
112
+ var external_X_ITE_X3D_ConcreteNodesArray_default = /*#__PURE__*/__webpack_require__.n(external_X_ITE_X3D_ConcreteNodesArray_namespaceObject);
113
+ ;// CONCATENATED MODULE: external "__X_ITE_X3D__ .AbstractNodesArray"
114
+ const external_X_ITE_X3D_AbstractNodesArray_namespaceObject = __X_ITE_X3D__ .AbstractNodesArray;
115
+ var external_X_ITE_X3D_AbstractNodesArray_default = /*#__PURE__*/__webpack_require__.n(external_X_ITE_X3D_AbstractNodesArray_namespaceObject);
116
+ ;// CONCATENATED MODULE: external "__X_ITE_X3D__ .UnitInfo"
117
+ const external_X_ITE_X3D_UnitInfo_namespaceObject = __X_ITE_X3D__ .UnitInfo;
118
+ var external_X_ITE_X3D_UnitInfo_default = /*#__PURE__*/__webpack_require__.n(external_X_ITE_X3D_UnitInfo_namespaceObject);
119
+ ;// CONCATENATED MODULE: external "__X_ITE_X3D__ .UnitInfoArray"
120
+ const external_X_ITE_X3D_UnitInfoArray_namespaceObject = __X_ITE_X3D__ .UnitInfoArray;
121
+ var external_X_ITE_X3D_UnitInfoArray_default = /*#__PURE__*/__webpack_require__.n(external_X_ITE_X3D_UnitInfoArray_namespaceObject);
122
+ ;// CONCATENATED MODULE: external "__X_ITE_X3D__ .NamedNodesArray"
123
+ const external_X_ITE_X3D_NamedNodesArray_namespaceObject = __X_ITE_X3D__ .NamedNodesArray;
124
+ var external_X_ITE_X3D_NamedNodesArray_default = /*#__PURE__*/__webpack_require__.n(external_X_ITE_X3D_NamedNodesArray_namespaceObject);
125
+ ;// CONCATENATED MODULE: external "__X_ITE_X3D__ .ImportedNodesArray"
126
+ const external_X_ITE_X3D_ImportedNodesArray_namespaceObject = __X_ITE_X3D__ .ImportedNodesArray;
127
+ var external_X_ITE_X3D_ImportedNodesArray_default = /*#__PURE__*/__webpack_require__.n(external_X_ITE_X3D_ImportedNodesArray_namespaceObject);
128
+ ;// CONCATENATED MODULE: external "__X_ITE_X3D__ .X3DImportedNode"
129
+ const external_X_ITE_X3D_X3DImportedNode_namespaceObject = __X_ITE_X3D__ .X3DImportedNode;
130
+ var external_X_ITE_X3D_X3DImportedNode_default = /*#__PURE__*/__webpack_require__.n(external_X_ITE_X3D_X3DImportedNode_namespaceObject);
131
+ ;// CONCATENATED MODULE: external "__X_ITE_X3D__ .ExportedNodesArray"
132
+ const external_X_ITE_X3D_ExportedNodesArray_namespaceObject = __X_ITE_X3D__ .ExportedNodesArray;
133
+ var external_X_ITE_X3D_ExportedNodesArray_default = /*#__PURE__*/__webpack_require__.n(external_X_ITE_X3D_ExportedNodesArray_namespaceObject);
134
+ ;// CONCATENATED MODULE: external "__X_ITE_X3D__ .X3DExportedNode"
135
+ const external_X_ITE_X3D_X3DExportedNode_namespaceObject = __X_ITE_X3D__ .X3DExportedNode;
136
+ var external_X_ITE_X3D_X3DExportedNode_default = /*#__PURE__*/__webpack_require__.n(external_X_ITE_X3D_X3DExportedNode_namespaceObject);
137
+ ;// CONCATENATED MODULE: external "__X_ITE_X3D__ .X3DExecutionContext"
138
+ const external_X_ITE_X3D_X3DExecutionContext_namespaceObject = __X_ITE_X3D__ .X3DExecutionContext;
139
+ var external_X_ITE_X3D_X3DExecutionContext_default = /*#__PURE__*/__webpack_require__.n(external_X_ITE_X3D_X3DExecutionContext_namespaceObject);
140
+ ;// CONCATENATED MODULE: external "__X_ITE_X3D__ .X3DScene"
141
+ const external_X_ITE_X3D_X3DScene_namespaceObject = __X_ITE_X3D__ .X3DScene;
142
+ var external_X_ITE_X3D_X3DScene_default = /*#__PURE__*/__webpack_require__.n(external_X_ITE_X3D_X3DScene_namespaceObject);
143
+ ;// CONCATENATED MODULE: external "__X_ITE_X3D__ .ExternProtoDeclarationArray"
144
+ const external_X_ITE_X3D_ExternProtoDeclarationArray_namespaceObject = __X_ITE_X3D__ .ExternProtoDeclarationArray;
145
+ var external_X_ITE_X3D_ExternProtoDeclarationArray_default = /*#__PURE__*/__webpack_require__.n(external_X_ITE_X3D_ExternProtoDeclarationArray_namespaceObject);
146
+ ;// CONCATENATED MODULE: external "__X_ITE_X3D__ .ProtoDeclarationArray"
147
+ const external_X_ITE_X3D_ProtoDeclarationArray_namespaceObject = __X_ITE_X3D__ .ProtoDeclarationArray;
148
+ var external_X_ITE_X3D_ProtoDeclarationArray_default = /*#__PURE__*/__webpack_require__.n(external_X_ITE_X3D_ProtoDeclarationArray_namespaceObject);
149
+ ;// CONCATENATED MODULE: external "__X_ITE_X3D__ .X3DExternProtoDeclaration"
150
+ const external_X_ITE_X3D_X3DExternProtoDeclaration_namespaceObject = __X_ITE_X3D__ .X3DExternProtoDeclaration;
151
+ var external_X_ITE_X3D_X3DExternProtoDeclaration_default = /*#__PURE__*/__webpack_require__.n(external_X_ITE_X3D_X3DExternProtoDeclaration_namespaceObject);
152
+ ;// CONCATENATED MODULE: external "__X_ITE_X3D__ .X3DProtoDeclaration"
153
+ const external_X_ITE_X3D_X3DProtoDeclaration_namespaceObject = __X_ITE_X3D__ .X3DProtoDeclaration;
154
+ var external_X_ITE_X3D_X3DProtoDeclaration_default = /*#__PURE__*/__webpack_require__.n(external_X_ITE_X3D_X3DProtoDeclaration_namespaceObject);
155
+ ;// CONCATENATED MODULE: external "__X_ITE_X3D__ .X3DProtoDeclarationNode"
156
+ const external_X_ITE_X3D_X3DProtoDeclarationNode_namespaceObject = __X_ITE_X3D__ .X3DProtoDeclarationNode;
157
+ var external_X_ITE_X3D_X3DProtoDeclarationNode_default = /*#__PURE__*/__webpack_require__.n(external_X_ITE_X3D_X3DProtoDeclarationNode_namespaceObject);
158
+ ;// CONCATENATED MODULE: external "__X_ITE_X3D__ .RouteArray"
159
+ const external_X_ITE_X3D_RouteArray_namespaceObject = __X_ITE_X3D__ .RouteArray;
160
+ var external_X_ITE_X3D_RouteArray_default = /*#__PURE__*/__webpack_require__.n(external_X_ITE_X3D_RouteArray_namespaceObject);
161
+ ;// CONCATENATED MODULE: external "__X_ITE_X3D__ .X3DRoute"
162
+ const external_X_ITE_X3D_X3DRoute_namespaceObject = __X_ITE_X3D__ .X3DRoute;
163
+ var external_X_ITE_X3D_X3DRoute_default = /*#__PURE__*/__webpack_require__.n(external_X_ITE_X3D_X3DRoute_namespaceObject);
164
+ ;// CONCATENATED MODULE: external "__X_ITE_X3D__ .Namespace"
165
+ const external_X_ITE_X3D_Namespace_namespaceObject = __X_ITE_X3D__ .Namespace;
166
+ var external_X_ITE_X3D_Namespace_default = /*#__PURE__*/__webpack_require__.n(external_X_ITE_X3D_Namespace_namespaceObject);
167
+ ;// CONCATENATED MODULE: ./src/x_ite/Browser/Scripting/evaluate.js
168
+ /*******************************************************************************
169
+ *
170
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
171
+ *
172
+ * Copyright create3000, Scheffelstraße 31a, Leipzig, Germany 2011 - 2022.
173
+ *
174
+ * All rights reserved. Holger Seelig <holger.seelig@yahoo.de>.
175
+ *
176
+ * The copyright notice above does not evidence any actual of intended
177
+ * publication of such source code, and is an unpublished work by create3000.
178
+ * This material contains CONFIDENTIAL INFORMATION that is the property of
179
+ * create3000.
180
+ *
181
+ * No permission is granted to copy, distribute, or create derivative works from
182
+ * the contents of this software, in whole or in part, without the prior written
183
+ * permission of create3000.
184
+ *
185
+ * NON-MILITARY USE ONLY
186
+ *
187
+ * All create3000 software are effectively free software with a non-military use
188
+ * restriction. It is free. Well commented source is provided. You may reuse the
189
+ * source in any way you please with the exception anything that uses it must be
190
+ * marked to indicate is contains 'non-military use only' components.
191
+ *
192
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
193
+ *
194
+ * Copyright 2011 - 2022, Holger Seelig <holger.seelig@yahoo.de>.
195
+ *
196
+ * This file is part of the X_ITE Project.
197
+ *
198
+ * X_ITE is free software: you can redistribute it and/or modify it under the
199
+ * terms of the GNU General Public License version 3 only, as published by the
200
+ * Free Software Foundation.
201
+ *
202
+ * X_ITE is distributed in the hope that it will be useful, but WITHOUT ANY
203
+ * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
204
+ * A PARTICULAR PURPOSE. See the GNU General Public License version 3 for more
205
+ * details (a copy is included in the LICENSE file that accompanied this code).
206
+ *
207
+ * You should have received a copy of the GNU General Public License version 3
208
+ * along with X_ITE. If not, see <https://www.gnu.org/licenses/gpl.html> for a
209
+ * copy of the GPLv3 License.
210
+ *
211
+ * For Silvio, Joy and Adi.
212
+ *
213
+ ******************************************************************************/
214
+
215
+ function evaluate (thisArg, globalObject, sourceText)
216
+ {
217
+ return new Function (/* js */ `with (arguments [0])
218
+ {
219
+ return eval ((() =>
220
+ {
221
+ const sourceText = arguments [1];
222
+
223
+ delete arguments [0];
224
+ delete arguments [1];
225
+
226
+ arguments .length = 0;
227
+
228
+ return sourceText;
229
+ })
230
+ ());
231
+ }`)
232
+ .call (thisArg, globalObject, sourceText);
233
+ }
234
+
235
+ const __default__ = evaluate;
236
+ ;
237
+
238
+ /* harmony default export */ const Scripting_evaluate = (external_X_ITE_X3D_Namespace_default().add ("evaluate", __default__));
239
+ ;// CONCATENATED MODULE: external "__X_ITE_X3D__ .X3DNode"
240
+ const external_X_ITE_X3D_X3DNode_namespaceObject = __X_ITE_X3D__ .X3DNode;
241
+ var external_X_ITE_X3D_X3DNode_default = /*#__PURE__*/__webpack_require__.n(external_X_ITE_X3D_X3DNode_namespaceObject);
242
+ ;// CONCATENATED MODULE: external "__X_ITE_X3D__ .X3DChildNode"
243
+ const external_X_ITE_X3D_X3DChildNode_namespaceObject = __X_ITE_X3D__ .X3DChildNode;
244
+ var external_X_ITE_X3D_X3DChildNode_default = /*#__PURE__*/__webpack_require__.n(external_X_ITE_X3D_X3DChildNode_namespaceObject);
245
+ ;// CONCATENATED MODULE: external "__X_ITE_X3D__ .X3DUrlObject"
246
+ const external_X_ITE_X3D_X3DUrlObject_namespaceObject = __X_ITE_X3D__ .X3DUrlObject;
247
+ var external_X_ITE_X3D_X3DUrlObject_default = /*#__PURE__*/__webpack_require__.n(external_X_ITE_X3D_X3DUrlObject_namespaceObject);
248
+ ;// CONCATENATED MODULE: external "__X_ITE_X3D__ .X3DConstants"
249
+ const external_X_ITE_X3D_X3DConstants_namespaceObject = __X_ITE_X3D__ .X3DConstants;
250
+ var external_X_ITE_X3D_X3DConstants_default = /*#__PURE__*/__webpack_require__.n(external_X_ITE_X3D_X3DConstants_namespaceObject);
251
+ ;// CONCATENATED MODULE: ./src/x_ite/Components/Scripting/X3DScriptNode.js
252
+ /*******************************************************************************
253
+ *
254
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
255
+ *
256
+ * Copyright create3000, Scheffelstraße 31a, Leipzig, Germany 2011 - 2022.
257
+ *
258
+ * All rights reserved. Holger Seelig <holger.seelig@yahoo.de>.
259
+ *
260
+ * The copyright notice above does not evidence any actual of intended
261
+ * publication of such source code, and is an unpublished work by create3000.
262
+ * This material contains CONFIDENTIAL INFORMATION that is the property of
263
+ * create3000.
264
+ *
265
+ * No permission is granted to copy, distribute, or create derivative works from
266
+ * the contents of this software, in whole or in part, without the prior written
267
+ * permission of create3000.
268
+ *
269
+ * NON-MILITARY USE ONLY
270
+ *
271
+ * All create3000 software are effectively free software with a non-military use
272
+ * restriction. It is free. Well commented source is provided. You may reuse the
273
+ * source in any way you please with the exception anything that uses it must be
274
+ * marked to indicate is contains 'non-military use only' components.
275
+ *
276
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
277
+ *
278
+ * Copyright 2011 - 2022, Holger Seelig <holger.seelig@yahoo.de>.
279
+ *
280
+ * This file is part of the X_ITE Project.
281
+ *
282
+ * X_ITE is free software: you can redistribute it and/or modify it under the
283
+ * terms of the GNU General Public License version 3 only, as published by the
284
+ * Free Software Foundation.
285
+ *
286
+ * X_ITE is distributed in the hope that it will be useful, but WITHOUT ANY
287
+ * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
288
+ * A PARTICULAR PURPOSE. See the GNU General Public License version 3 for more
289
+ * details (a copy is included in the LICENSE file that accompanied this code).
290
+ *
291
+ * You should have received a copy of the GNU General Public License version 3
292
+ * along with X_ITE. If not, see <https://www.gnu.org/licenses/gpl.html> for a
293
+ * copy of the GPLv3 License.
294
+ *
295
+ * For Silvio, Joy and Adi.
296
+ *
297
+ ******************************************************************************/
298
+
299
+
300
+
301
+
302
+
303
+
304
+ function X3DScriptNode (executionContext)
305
+ {
306
+ external_X_ITE_X3D_X3DChildNode_default().call (this, executionContext);
307
+ external_X_ITE_X3D_X3DUrlObject_default().call (this, executionContext);
308
+
309
+ this .addType ((external_X_ITE_X3D_X3DConstants_default()).X3DScriptNode);
310
+ }
311
+
312
+ Object .assign (Object .setPrototypeOf (X3DScriptNode .prototype, (external_X_ITE_X3D_X3DChildNode_default()).prototype),
313
+ (external_X_ITE_X3D_X3DUrlObject_default()).prototype,
314
+ {
315
+ initialize ()
316
+ {
317
+ external_X_ITE_X3D_X3DChildNode_default().prototype .initialize .call (this);
318
+ external_X_ITE_X3D_X3DUrlObject_default().prototype .initialize .call (this);
319
+ },
320
+ dispose ()
321
+ {
322
+ external_X_ITE_X3D_X3DUrlObject_default().prototype .dispose .call (this);
323
+ external_X_ITE_X3D_X3DChildNode_default().prototype .dispose .call (this);
324
+ },
325
+ });
326
+
327
+ Object .defineProperties (X3DScriptNode, external_X_ITE_X3D_X3DNode_default().getStaticProperties ("X3DScriptNode", "Scripting", 1));
328
+
329
+ const X3DScriptNode_default_ = X3DScriptNode;
330
+ ;
331
+
332
+ /* harmony default export */ const Scripting_X3DScriptNode = (external_X_ITE_X3D_Namespace_default().add ("X3DScriptNode", X3DScriptNode_default_));
333
+ ;// CONCATENATED MODULE: external "__X_ITE_X3D__ .FileLoader"
334
+ const external_X_ITE_X3D_FileLoader_namespaceObject = __X_ITE_X3D__ .FileLoader;
335
+ var external_X_ITE_X3D_FileLoader_default = /*#__PURE__*/__webpack_require__.n(external_X_ITE_X3D_FileLoader_namespaceObject);
336
+ ;// CONCATENATED MODULE: external "__X_ITE_X3D__ .SFNodeCache"
337
+ const external_X_ITE_X3D_SFNodeCache_namespaceObject = __X_ITE_X3D__ .SFNodeCache;
338
+ var external_X_ITE_X3D_SFNodeCache_default = /*#__PURE__*/__webpack_require__.n(external_X_ITE_X3D_SFNodeCache_namespaceObject);
339
+ ;// CONCATENATED MODULE: ./src/x_ite/Components/Scripting/Script.js
340
+ /* provided dependency */ var $ = __webpack_require__(254);
341
+ /*******************************************************************************
342
+ *
343
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
344
+ *
345
+ * Copyright create3000, Scheffelstraße 31a, Leipzig, Germany 2011 - 2022.
346
+ *
347
+ * All rights reserved. Holger Seelig <holger.seelig@yahoo.de>.
348
+ *
349
+ * The copyright notice above does not evidence any actual of intended
350
+ * publication of such source code, and is an unpublished work by create3000.
351
+ * This material contains CONFIDENTIAL INFORMATION that is the property of
352
+ * create3000.
353
+ *
354
+ * No permission is granted to copy, distribute, or create derivative works from
355
+ * the contents of this software, in whole or in part, without the prior written
356
+ * permission of create3000.
357
+ *
358
+ * NON-MILITARY USE ONLY
359
+ *
360
+ * All create3000 software are effectively free software with a non-military use
361
+ * restriction. It is free. Well commented source is provided. You may reuse the
362
+ * source in any way you please with the exception anything that uses it must be
363
+ * marked to indicate is contains 'non-military use only' components.
364
+ *
365
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
366
+ *
367
+ * Copyright 2011 - 2022, Holger Seelig <holger.seelig@yahoo.de>.
368
+ *
369
+ * This file is part of the X_ITE Project.
370
+ *
371
+ * X_ITE is free software: you can redistribute it and/or modify it under the
372
+ * terms of the GNU General Public License version 3 only, as published by the
373
+ * Free Software Foundation.
374
+ *
375
+ * X_ITE is distributed in the hope that it will be useful, but WITHOUT ANY
376
+ * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
377
+ * A PARTICULAR PURPOSE. See the GNU General Public License version 3 for more
378
+ * details (a copy is included in the LICENSE file that accompanied this code).
379
+ *
380
+ * You should have received a copy of the GNU General Public License version 3
381
+ * along with X_ITE. If not, see <https://www.gnu.org/licenses/gpl.html> for a
382
+ * copy of the GPLv3 License.
383
+ *
384
+ * For Silvio, Joy and Adi.
385
+ *
386
+ ******************************************************************************/
387
+
388
+
389
+
390
+
391
+
392
+
393
+
394
+
395
+
396
+
397
+
398
+
399
+
400
+
401
+
402
+
403
+
404
+
405
+
406
+
407
+
408
+
409
+
410
+
411
+
412
+
413
+
414
+
415
+
416
+
417
+
418
+
419
+
420
+
421
+
422
+
423
+
424
+ function Script (executionContext)
425
+ {
426
+ Scripting_X3DScriptNode .call (this, executionContext);
427
+
428
+ this .addType ((external_X_ITE_X3D_X3DConstants_default()).Script);
429
+ }
430
+
431
+ Object .assign (Object .setPrototypeOf (Script .prototype, Scripting_X3DScriptNode .prototype),
432
+ {
433
+ initialize ()
434
+ {
435
+ Scripting_X3DScriptNode .prototype .initialize .call (this);
436
+
437
+ this .requestImmediateLoad () .catch (Function .prototype);
438
+ },
439
+ getExtendedEventHandling ()
440
+ {
441
+ return false;
442
+ },
443
+ canUserDefinedFields ()
444
+ {
445
+ return true;
446
+ },
447
+ addUserDefinedField (accessType, name, field)
448
+ {
449
+ Scripting_X3DScriptNode .prototype .addUserDefinedField .call (this, accessType, name, field);
450
+
451
+ if (!this .isInitialized ())
452
+ return;
453
+
454
+ this .setLoadState ((external_X_ITE_X3D_X3DConstants_default()).NOT_STARTED_STATE);
455
+ this .requestImmediateLoad () .catch (Function .prototype);
456
+ },
457
+ removeUserDefinedField (name)
458
+ {
459
+ this .getUserDefinedFields () .get (name) ?.removeInterest ("set_field__", this);
460
+
461
+ Scripting_X3DScriptNode .prototype .removeUserDefinedField .call (this, name);
462
+
463
+ if (!this .isInitialized ())
464
+ return;
465
+
466
+ this .setLoadState ((external_X_ITE_X3D_X3DConstants_default()).NOT_STARTED_STATE);
467
+ this .requestImmediateLoad () .catch (Function .prototype);
468
+ },
469
+ getSourceText ()
470
+ {
471
+ return this ._url;
472
+ },
473
+ unloadData ()
474
+ {
475
+ // Call shutdown.
476
+
477
+ const shutdown = this .context ?.get ("shutdown");
478
+
479
+ if (typeof shutdown === "function")
480
+ this .call__ (shutdown, "shutdown");
481
+
482
+ // Disconnect shutdown.
483
+
484
+ $(window) .off (`.Script-${this .getId ()}`);
485
+
486
+ // Disconnect prepareEvents.
487
+
488
+ this .getBrowser () .prepareEvents () .removeInterest ("call__", this);
489
+
490
+ // Disconnect eventsProcessed.
491
+
492
+ this .removeInterest ("call__", this);
493
+
494
+ // Disconnect fields.
495
+
496
+ for (const field of this .getUserDefinedFields ())
497
+ field .removeInterest ("set_field__", this);
498
+ },
499
+ async loadData ()
500
+ {
501
+ // See: 29.2.2 Script execution
502
+ await this .unloadData ();
503
+
504
+ new (external_X_ITE_X3D_FileLoader_default()) (this) .loadDocument (this ._url, data =>
505
+ {
506
+ if (data === null)
507
+ {
508
+ // No URL could be loaded.
509
+ this .setLoadState ((external_X_ITE_X3D_X3DConstants_default()).FAILED_STATE);
510
+ }
511
+ else
512
+ {
513
+ this .initialize__ ($.decodeText (data));
514
+ this .setLoadState ((external_X_ITE_X3D_X3DConstants_default()).COMPLETE_STATE);
515
+ }
516
+ });
517
+ },
518
+ createGlobalObject ()
519
+ {
520
+ const getScriptNode = () => this;
521
+
522
+ const handler =
523
+ {
524
+ get (target, key)
525
+ {
526
+ switch (key)
527
+ {
528
+ case "getScriptNode":
529
+ return getScriptNode;
530
+ case "currentScene":
531
+ return getScriptNode () .getExecutionContext ();
532
+ default:
533
+ return target [key];
534
+ }
535
+ },
536
+ };
537
+
538
+ const browser = new Proxy (this .getBrowser (), handler);
539
+
540
+ function SFNode (vrmlSyntax)
541
+ {
542
+ const nodes = browser .createVrmlFromString (vrmlSyntax);
543
+
544
+ if (nodes .length && nodes [0])
545
+ return nodes [0];
546
+
547
+ throw new Error ("SFNode.new: invalid argument.");
548
+ }
549
+
550
+ SFNode .prototype = (external_X_ITE_X3D_Fields_default()).SFNode .prototype;
551
+
552
+ const globalObject =
553
+ {
554
+ NULL: { value: null },
555
+ FALSE: { value: false },
556
+ TRUE: { value: true },
557
+ print: { value: browser .println .bind (browser) },
558
+ trace: { value: browser .println .bind (browser) },
559
+
560
+ Browser: { value: browser },
561
+
562
+ X3DConstants: { value: (external_X_ITE_X3D_X3DConstants_default()) },
563
+ X3DBrowser: { value: (external_X_ITE_X3D_X3DBrowser_default()) },
564
+ X3DExecutionContext: { value: (external_X_ITE_X3D_X3DExecutionContext_default()) },
565
+ X3DScene: { value: (external_X_ITE_X3D_X3DScene_default()) },
566
+ ComponentInfo: { value: (external_X_ITE_X3D_ComponentInfo_default()) },
567
+ ComponentInfoArray: { value: (external_X_ITE_X3D_ComponentInfoArray_default()) },
568
+ ProfileInfo: { value: (external_X_ITE_X3D_ProfileInfo_default()) },
569
+ ProfileInfoArray: { value: (external_X_ITE_X3D_ProfileInfoArray_default()) },
570
+ ConcreteNodesArray: { value: (external_X_ITE_X3D_ConcreteNodesArray_default()) }, // non-standard
571
+ AbstractNodesArray: { value: (external_X_ITE_X3D_AbstractNodesArray_default()) }, // non-standard
572
+ UnitInfo: { value: (external_X_ITE_X3D_UnitInfo_default()) },
573
+ UnitInfoArray: { value: (external_X_ITE_X3D_UnitInfoArray_default()) },
574
+ NamedNodesArray: { value: (external_X_ITE_X3D_NamedNodesArray_default()) }, // non-standard
575
+ ImportedNodesArray: { value: (external_X_ITE_X3D_ImportedNodesArray_default()) }, // non-standard
576
+ X3DImportedNode: { value: (external_X_ITE_X3D_X3DImportedNode_default()) }, // non-standard
577
+ ExportedNodesArray: { value: (external_X_ITE_X3D_ExportedNodesArray_default()) }, // non-standard
578
+ X3DExportedNode: { value: (external_X_ITE_X3D_X3DExportedNode_default()) }, // non-standard
579
+ ExternProtoDeclarationArray: { value: (external_X_ITE_X3D_ExternProtoDeclarationArray_default()) },
580
+ ProtoDeclarationArray: { value: (external_X_ITE_X3D_ProtoDeclarationArray_default()) },
581
+ X3DExternProtoDeclaration: { value: (external_X_ITE_X3D_X3DExternProtoDeclaration_default()) },
582
+ X3DProtoDeclaration: { value: (external_X_ITE_X3D_X3DProtoDeclaration_default()) },
583
+ X3DProtoDeclarationNode: { value: (external_X_ITE_X3D_X3DProtoDeclarationNode_default()) }, // non-standard
584
+ RouteArray: { value: (external_X_ITE_X3D_RouteArray_default()) },
585
+ X3DRoute: { value: (external_X_ITE_X3D_X3DRoute_default()) },
586
+
587
+ X3DBaseNode: { value: (external_X_ITE_X3D_X3DBaseNode_default()) }, // non-standard
588
+
589
+ X3DFieldDefinition: { value: (external_X_ITE_X3D_X3DFieldDefinition_default()) },
590
+ FieldDefinitionArray: { value: (external_X_ITE_X3D_FieldDefinitionArray_default()) },
591
+
592
+ X3DField: { value: (external_X_ITE_X3D_X3DField_default()) },
593
+ X3DArrayField: { value: (external_X_ITE_X3D_X3DArrayField_default()) },
594
+
595
+ SFColor: { value: (external_X_ITE_X3D_Fields_default()).SFColor },
596
+ SFColorRGBA: { value: (external_X_ITE_X3D_Fields_default()).SFColorRGBA },
597
+ SFImage: { value: (external_X_ITE_X3D_Fields_default()).SFImage },
598
+ SFMatrix3d: { value: (external_X_ITE_X3D_Fields_default()).SFMatrix3d },
599
+ SFMatrix3f: { value: (external_X_ITE_X3D_Fields_default()).SFMatrix3f },
600
+ SFMatrix4d: { value: (external_X_ITE_X3D_Fields_default()).SFMatrix4d },
601
+ SFMatrix4f: { value: (external_X_ITE_X3D_Fields_default()).SFMatrix4f },
602
+ SFNode: { value: SFNode },
603
+ SFRotation: { value: (external_X_ITE_X3D_Fields_default()).SFRotation },
604
+ SFString: { value: (external_X_ITE_X3D_Fields_default()).SFString },
605
+ SFVec2d: { value: (external_X_ITE_X3D_Fields_default()).SFVec2d },
606
+ SFVec2f: { value: (external_X_ITE_X3D_Fields_default()).SFVec2f },
607
+ SFVec3d: { value: (external_X_ITE_X3D_Fields_default()).SFVec3d },
608
+ SFVec3f: { value: (external_X_ITE_X3D_Fields_default()).SFVec3f },
609
+ SFVec4d: { value: (external_X_ITE_X3D_Fields_default()).SFVec4d },
610
+ SFVec4f: { value: (external_X_ITE_X3D_Fields_default()).SFVec4f },
611
+ VrmlMatrix: { value: (external_X_ITE_X3D_Fields_default()).VrmlMatrix },
612
+
613
+ MFBool: { value: (external_X_ITE_X3D_Fields_default()).MFBool },
614
+ MFColor: { value: (external_X_ITE_X3D_Fields_default()).MFColor },
615
+ MFColorRGBA: { value: (external_X_ITE_X3D_Fields_default()).MFColorRGBA },
616
+ MFDouble: { value: (external_X_ITE_X3D_Fields_default()).MFDouble },
617
+ MFFloat: { value: (external_X_ITE_X3D_Fields_default()).MFFloat },
618
+ MFImage: { value: (external_X_ITE_X3D_Fields_default()).MFImage },
619
+ MFInt32: { value: (external_X_ITE_X3D_Fields_default()).MFInt32 },
620
+ MFMatrix3d: { value: (external_X_ITE_X3D_Fields_default()).MFMatrix3d },
621
+ MFMatrix3f: { value: (external_X_ITE_X3D_Fields_default()).MFMatrix3f },
622
+ MFMatrix4d: { value: (external_X_ITE_X3D_Fields_default()).MFMatrix4d },
623
+ MFMatrix4f: { value: (external_X_ITE_X3D_Fields_default()).MFMatrix4f },
624
+ MFNode: { value: (external_X_ITE_X3D_Fields_default()).MFNode },
625
+ MFRotation: { value: (external_X_ITE_X3D_Fields_default()).MFRotation },
626
+ MFString: { value: (external_X_ITE_X3D_Fields_default()).MFString },
627
+ MFTime: { value: (external_X_ITE_X3D_Fields_default()).MFTime },
628
+ MFVec2d: { value: (external_X_ITE_X3D_Fields_default()).MFVec2d },
629
+ MFVec2f: { value: (external_X_ITE_X3D_Fields_default()).MFVec2f },
630
+ MFVec3d: { value: (external_X_ITE_X3D_Fields_default()).MFVec3d },
631
+ MFVec3f: { value: (external_X_ITE_X3D_Fields_default()).MFVec3f },
632
+ MFVec4d: { value: (external_X_ITE_X3D_Fields_default()).MFVec4d },
633
+ MFVec4f: { value: (external_X_ITE_X3D_Fields_default()).MFVec4f },
634
+ };
635
+
636
+ for (const field of this .getUserDefinedFields ())
637
+ {
638
+ if (field .getAccessType () === (external_X_ITE_X3D_X3DConstants_default()).inputOnly)
639
+ continue;
640
+
641
+ const names = [field .getName ()];
642
+
643
+ if (field .getAccessType () === (external_X_ITE_X3D_X3DConstants_default()).inputOutput)
644
+ names .push (field .getName () + "_changed");
645
+
646
+ for (const name of names)
647
+ {
648
+ if (name in globalObject)
649
+ continue;
650
+
651
+ globalObject [name] =
652
+ {
653
+ get: field .valueOf .bind (field),
654
+ set: field .setValue .bind (field),
655
+ };
656
+ }
657
+ }
658
+
659
+ return Object .create (Object .prototype, globalObject);
660
+ },
661
+ createContext (sourceText)
662
+ {
663
+ const callbacks = ["initialize", "prepareEvents", "eventsProcessed", "shutdown"];
664
+
665
+ for (const field of this .getUserDefinedFields ())
666
+ {
667
+ switch (field .getAccessType ())
668
+ {
669
+ case (external_X_ITE_X3D_X3DConstants_default()).inputOnly:
670
+ callbacks .push (field .getName ());
671
+ break;
672
+ case (external_X_ITE_X3D_X3DConstants_default()).inputOutput:
673
+ callbacks .push ("set_" + field .getName ());
674
+ break;
675
+ }
676
+ }
677
+
678
+ sourceText += ";\n[" + callbacks .map (c => `typeof ${c} !== "undefined" ? ${c} : undefined`) .join (",") + "];";
679
+
680
+ const
681
+ result = this .evaluate (sourceText),
682
+ context = new Map ();
683
+
684
+ for (let i = 0; i < callbacks .length; ++ i)
685
+ context .set (callbacks [i], result [i]);
686
+
687
+ return context;
688
+ },
689
+ evaluate (sourceText)
690
+ {
691
+ if (!this .globalObject)
692
+ this .globalObject = this .createGlobalObject ();
693
+
694
+ return Scripting_evaluate (external_X_ITE_X3D_SFNodeCache_default().get (this), this .globalObject, sourceText);
695
+ },
696
+ async initialize__ (sourceText)
697
+ {
698
+ const browser = this .getBrowser ();
699
+
700
+ // Create context.
701
+
702
+ this .globalObject = this .createGlobalObject ();
703
+ this .context = this .createContext (sourceText);
704
+
705
+ // Connect shutdown.
706
+
707
+ const shutdown = this .context .get ("shutdown");
708
+
709
+ if (typeof shutdown === "function")
710
+ $(window) .on (`unload.Script-${this .getId ()}`, () => this .call__ (shutdown, "shutdown"));
711
+
712
+ // Connect prepareEvents.
713
+
714
+ const prepareEvents = this .context .get ("prepareEvents");
715
+
716
+ if (typeof prepareEvents === "function")
717
+ browser .prepareEvents () .addInterest ("call__", this, prepareEvents, "prepareEvents");
718
+
719
+ // Connect eventsProcessed.
720
+
721
+ const eventsProcessed = this .context .get ("eventsProcessed");
722
+
723
+ if (typeof eventsProcessed === "function")
724
+ this .addInterest ("call__", this, eventsProcessed, "eventsProcessed");
725
+
726
+ // Connect fields.
727
+
728
+ for (const field of this .getUserDefinedFields ())
729
+ {
730
+ switch (field .getAccessType ())
731
+ {
732
+ case (external_X_ITE_X3D_X3DConstants_default()).inputOnly:
733
+ {
734
+ const callback = this .context .get (field .getName ());
735
+
736
+ if (typeof callback === "function")
737
+ field .addInterest ("set_field__", this, callback, [ ]);
738
+
739
+ break;
740
+ }
741
+ case (external_X_ITE_X3D_X3DConstants_default()).inputOutput:
742
+ {
743
+ const callback = this .context .get ("set_" + field .getName ());
744
+
745
+ if (typeof callback === "function")
746
+ field .addInterest ("set_field__", this, callback, [ ]);
747
+
748
+ break;
749
+ }
750
+ }
751
+ }
752
+
753
+ // Call initialize function.
754
+
755
+ const initialize = this .context .get ("initialize");
756
+
757
+ if (typeof initialize === "function")
758
+ await this .call__ (initialize, "initialize");
759
+ },
760
+ async call__ (callback, name)
761
+ {
762
+ try
763
+ {
764
+ await callback .call (external_X_ITE_X3D_SFNodeCache_default().get (this), this .getBrowser () .getCurrentTime ());
765
+ }
766
+ catch (error)
767
+ {
768
+ this .setError (`in function '${name}'`, error);
769
+ }
770
+ },
771
+ async set_field__ (callback, cache, field)
772
+ {
773
+ const copy = cache .pop () ?? field .create ();
774
+
775
+ try
776
+ {
777
+ copy .assign (field);
778
+
779
+ await callback .call (external_X_ITE_X3D_SFNodeCache_default().get (this), copy .valueOf (), this .getBrowser () .getCurrentTime ());
780
+ }
781
+ catch (error)
782
+ {
783
+ this .setError (`in function '${field .getName ()}'`, error);
784
+ }
785
+ finally
786
+ {
787
+ cache .push (copy);
788
+ }
789
+ },
790
+ setError (reason, error)
791
+ {
792
+ const worldURL = this .getExecutionContext () .getWorldURL () .startsWith ("data:")
793
+ ? "data:"
794
+ : this .getExecutionContext () .getWorldURL ();
795
+
796
+ console .error (`JavaScript Error in Script '${this .getName ()}', ${reason}\nworld url is '${worldURL}':`);
797
+ console .error (error);
798
+ },
799
+ dispose ()
800
+ {
801
+ this .unloadData ();
802
+
803
+ Scripting_X3DScriptNode .prototype .dispose .call (this);
804
+ },
805
+ });
806
+
807
+ Object .defineProperties (Script,
808
+ {
809
+ ... external_X_ITE_X3D_X3DNode_default().getStaticProperties ("Script", "Scripting", 1, "children", "2.0"),
810
+ fieldDefinitions:
811
+ {
812
+ value: new (external_X_ITE_X3D_FieldDefinitionArray_default()) ([
813
+ new (external_X_ITE_X3D_X3DFieldDefinition_default()) ((external_X_ITE_X3D_X3DConstants_default()).inputOutput, "metadata", new (external_X_ITE_X3D_Fields_default()).SFNode ()),
814
+ new (external_X_ITE_X3D_X3DFieldDefinition_default()) ((external_X_ITE_X3D_X3DConstants_default()).inputOutput, "description", new (external_X_ITE_X3D_Fields_default()).SFString ()),
815
+ new (external_X_ITE_X3D_X3DFieldDefinition_default()) ((external_X_ITE_X3D_X3DConstants_default()).inputOutput, "load", new (external_X_ITE_X3D_Fields_default()).SFBool (true)),
816
+ new (external_X_ITE_X3D_X3DFieldDefinition_default()) ((external_X_ITE_X3D_X3DConstants_default()).inputOutput, "url", new (external_X_ITE_X3D_Fields_default()).MFString ()),
817
+ new (external_X_ITE_X3D_X3DFieldDefinition_default()) ((external_X_ITE_X3D_X3DConstants_default()).inputOutput, "autoRefresh", new (external_X_ITE_X3D_Fields_default()).SFTime ()),
818
+ new (external_X_ITE_X3D_X3DFieldDefinition_default()) ((external_X_ITE_X3D_X3DConstants_default()).inputOutput, "autoRefreshTimeLimit", new (external_X_ITE_X3D_Fields_default()).SFTime (3600)),
819
+ new (external_X_ITE_X3D_X3DFieldDefinition_default()) ((external_X_ITE_X3D_X3DConstants_default()).initializeOnly, "directOutput", new (external_X_ITE_X3D_Fields_default()).SFBool ()),
820
+ new (external_X_ITE_X3D_X3DFieldDefinition_default()) ((external_X_ITE_X3D_X3DConstants_default()).initializeOnly, "mustEvaluate", new (external_X_ITE_X3D_Fields_default()).SFBool ()),
821
+ ]),
822
+ enumerable: true,
823
+ },
824
+ });
825
+
826
+ const Script_default_ = Script;
827
+ ;
828
+
829
+ /* harmony default export */ const Scripting_Script = (external_X_ITE_X3D_Namespace_default().add ("Script", Script_default_));
830
+ ;// CONCATENATED MODULE: ./src/assets/components/ScriptingComponent.js
831
+ /*******************************************************************************
832
+ *
833
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
834
+ *
835
+ * Copyright create3000, Scheffelstraße 31a, Leipzig, Germany 2011 - 2022.
836
+ *
837
+ * All rights reserved. Holger Seelig <holger.seelig@yahoo.de>.
838
+ *
839
+ * The copyright notice above does not evidence any actual of intended
840
+ * publication of such source code, and is an unpublished work by create3000.
841
+ * This material contains CONFIDENTIAL INFORMATION that is the property of
842
+ * create3000.
843
+ *
844
+ * No permission is granted to copy, distribute, or create derivative works from
845
+ * the contents of this software, in whole or in part, without the prior written
846
+ * permission of create3000.
847
+ *
848
+ * NON-MILITARY USE ONLY
849
+ *
850
+ * All create3000 software are effectively free software with a non-military use
851
+ * restriction. It is free. Well commented source is provided. You may reuse the
852
+ * source in any way you please with the exception anything that uses it must be
853
+ * marked to indicate is contains 'non-military use only' components.
854
+ *
855
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
856
+ *
857
+ * Copyright 2011 - 2022, Holger Seelig <holger.seelig@yahoo.de>.
858
+ *
859
+ * This file is part of the X_ITE Project.
860
+ *
861
+ * X_ITE is free software: you can redistribute it and/or modify it under the
862
+ * terms of the GNU General Public License version 3 only, as published by the
863
+ * Free Software Foundation.
864
+ *
865
+ * X_ITE is distributed in the hope that it will be useful, but WITHOUT ANY
866
+ * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
867
+ * A PARTICULAR PURPOSE. See the GNU General Public License version 3 for more
868
+ * details (a copy is included in the LICENSE file that accompanied this code).
869
+ *
870
+ * You should have received a copy of the GNU General Public License version 3
871
+ * along with X_ITE. If not, see <https://www.gnu.org/licenses/gpl.html> for a
872
+ * copy of the GPLv3 License.
873
+ *
874
+ * For Silvio, Joy and Adi.
875
+ *
876
+ ******************************************************************************/
877
+
878
+
879
+
880
+
881
+
882
+ external_X_ITE_X3D_Components_default().add ({
883
+ name: "Scripting",
884
+ concreteNodes:
885
+ [
886
+ Scripting_Script,
887
+ ],
888
+ abstractNodes:
889
+ [
890
+ Scripting_X3DScriptNode,
891
+ ],
892
+ });
893
+
894
+ const ScriptingComponent_default_ = undefined;
895
+ ;
896
+
897
+ /* harmony default export */ const ScriptingComponent = (external_X_ITE_X3D_Namespace_default().add ("ScriptingComponent", ScriptingComponent_default_));
898
+ /******/ })()
899
+ ;