getfloorplan-gltf-widget 1.11.29
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/README.md +346 -0
- package/build/AIXSolutionsVendor.css +1 -0
- package/build/Api.js +54 -0
- package/build/ClassMaker-DarbH_-a.js +14268 -0
- package/build/DebugPanelPlugin.css +1 -0
- package/build/Waiter-DTIFLXLw.js +190 -0
- package/build/createWidget.css +1 -0
- package/build/createWidget.js +34244 -0
- package/build/index.js +6 -0
- package/build/plugins/DebugPanelPlugin.js +8395 -0
- package/build/plugins/SentryPlugin.js +16228 -0
- package/build/preventDefault-CoB0CvuT.js +5956 -0
- package/build/types/Widget.d.ts +8 -0
- package/build/types/api/Api.d.ts +11 -0
- package/build/types/api/lib/ApiConstructor.d.ts +8 -0
- package/build/types/api/lib/NetworkFallback/index.d.ts +13 -0
- package/build/types/api/lib/NetworkFallback/types/TNetworkFallbackConfig.d.ts +59 -0
- package/build/types/api/stores/ApiStore/ApiBranding.d.ts +15 -0
- package/build/types/api/stores/ApiStore/ApiExplorer.d.ts +34 -0
- package/build/types/api/stores/ApiStore/ApiFallback.d.ts +8 -0
- package/build/types/api/stores/ApiStore/ApiJson.d.ts +8 -0
- package/build/types/api/stores/ApiStore/index.d.ts +29 -0
- package/build/types/api/types/TApi/TAperture.d.ts +15 -0
- package/build/types/api/types/TApi/TCameraPoint.d.ts +10 -0
- package/build/types/api/types/TApi/TCapabilities.d.ts +16 -0
- package/build/types/api/types/TApi/TDoor.d.ts +20 -0
- package/build/types/api/types/TApi/TFloorData.d.ts +35 -0
- package/build/types/api/types/TApi/TIsometricViewData.d.ts +5 -0
- package/build/types/api/types/TApi/TLosslessFormat.d.ts +1 -0
- package/build/types/api/types/TApi/TLossyFormat.d.ts +1 -0
- package/build/types/api/types/TApi/TPanoramaViewData.d.ts +5 -0
- package/build/types/api/types/TApi/TPortal.d.ts +11 -0
- package/build/types/api/types/TApi/TRenderingSettings.d.ts +14 -0
- package/build/types/api/types/TApi/TSceneGeometry.d.ts +7 -0
- package/build/types/api/types/TApi/TStair.d.ts +7 -0
- package/build/types/api/types/TApi/TTopViewData.d.ts +5 -0
- package/build/types/api/types/TApi/TVariant.d.ts +20 -0
- package/build/types/api/types/TApi/TWidgetBranding.d.ts +23 -0
- package/build/types/api/types/TApi/index.d.ts +8 -0
- package/build/types/api/types/TApiError.d.ts +6 -0
- package/build/types/api/types/TGLTFData/TGLTFDataV0.d.ts +5 -0
- package/build/types/api/types/TGLTFData/TGLTFDataV1.d.ts +21 -0
- package/build/types/api/types/TGLTFData/index.d.ts +3 -0
- package/build/types/assets/img/index.d.ts +2 -0
- package/build/types/components/ApplicationWrapper.d.ts +2 -0
- package/build/types/components/EditorApplication/index.d.ts +4 -0
- package/build/types/components/WidgetApplication/AdditionalFrame/index.d.ts +2 -0
- package/build/types/components/WidgetApplication/ControlPanel/ButtonsContainer/SettingsButton/index.d.ts +3 -0
- package/build/types/components/WidgetApplication/ControlPanel/ButtonsContainer/VisibilityButton/index.d.ts +3 -0
- package/build/types/components/WidgetApplication/ControlPanel/ButtonsContainer/index.d.ts +3 -0
- package/build/types/components/WidgetApplication/ControlPanel/ControlButtons/index.d.ts +3 -0
- package/build/types/components/WidgetApplication/ControlPanel/SettingsFrame/index.d.ts +3 -0
- package/build/types/components/WidgetApplication/ControlPanel/index.d.ts +3 -0
- package/build/types/components/WidgetApplication/ErrorScreen/ErrorScreenWrapper.d.ts +2 -0
- package/build/types/components/WidgetApplication/ErrorScreen/index.d.ts +8 -0
- package/build/types/components/WidgetApplication/FullscreenButton/index.d.ts +2 -0
- package/build/types/components/WidgetApplication/LoadingScreen/index.d.ts +3 -0
- package/build/types/components/WidgetApplication/Logger/index.d.ts +3 -0
- package/build/types/components/WidgetApplication/Logo/index.d.ts +3 -0
- package/build/types/components/WidgetApplication/MadeBy/index.d.ts +3 -0
- package/build/types/components/WidgetApplication/MapOverlay/index.d.ts +3 -0
- package/build/types/components/WidgetApplication/RoomLabel/index.d.ts +8 -0
- package/build/types/components/WidgetApplication/Tabs/Tab2D/index.d.ts +3 -0
- package/build/types/components/WidgetApplication/Tabs/Tab360/index.d.ts +3 -0
- package/build/types/components/WidgetApplication/Tabs/index.d.ts +3 -0
- package/build/types/components/WidgetApplication/index.d.ts +5 -0
- package/build/types/components/WidgetApplication/shared/DoorLinkRenderer/DoorLink.d.ts +10 -0
- package/build/types/components/WidgetApplication/shared/DoorLinkRenderer/index.d.ts +3 -0
- package/build/types/components/WidgetApplication/shared/Map/Camera.d.ts +10 -0
- package/build/types/components/WidgetApplication/shared/Map/CurrentCamera.d.ts +8 -0
- package/build/types/components/WidgetApplication/shared/Map/index.d.ts +9 -0
- package/build/types/components/WidgetApplication/shared/RoomLinkRenderer/RoomLink.d.ts +10 -0
- package/build/types/components/WidgetApplication/shared/RoomLinkRenderer/index.d.ts +3 -0
- package/build/types/components/WidgetApplication/shared/TransformImage/index.d.ts +5 -0
- package/build/types/components/WidgetApplication/ui/BorderFrame/index.d.ts +5 -0
- package/build/types/components/WidgetApplication/ui/FloatButton/index.d.ts +7 -0
- package/build/types/config/2d/TTab2DConfig.d.ts +6 -0
- package/build/types/config/2d/Tab2DDefaults.d.ts +2 -0
- package/build/types/config/360/TTab360Config.d.ts +28 -0
- package/build/types/config/360/Tab360Defaults.d.ts +2 -0
- package/build/types/config/360/camera/CameraDefaults.d.ts +2 -0
- package/build/types/config/360/camera/TCameraConfig.d.ts +5 -0
- package/build/types/config/360/collider/ColliderDefaults.d.ts +2 -0
- package/build/types/config/360/collider/TColliderConfig.d.ts +4 -0
- package/build/types/config/3d/TTab3DConfig.d.ts +24 -0
- package/build/types/config/3d/Tab3DDefaults.d.ts +2 -0
- package/build/types/config/TConfig.d.ts +65 -0
- package/build/types/config/TExternalConfig.d.ts +3 -0
- package/build/types/config/defaultConfig.d.ts +2 -0
- package/build/types/config/doorLink/DoorLinkDefaults.d.ts +2 -0
- package/build/types/config/doorLink/TDoorLinkConfig.d.ts +18 -0
- package/build/types/config/loader/LoaderConfig.d.ts +2 -0
- package/build/types/config/loader/TLoaderConfig.d.ts +6 -0
- package/build/types/config/material/MaterialConfig.d.ts +5 -0
- package/build/types/config/query/QueryDefaults.d.ts +2 -0
- package/build/types/config/query/TQueryConfig.d.ts +14 -0
- package/build/types/config/roomLink/RoomLinkDefaults.d.ts +2 -0
- package/build/types/config/roomLink/TRoomLinkConfig.d.ts +20 -0
- package/build/types/config/topView/TTabTopViewConfig.d.ts +16 -0
- package/build/types/config/topView/TabTopViewDefaults.d.ts +2 -0
- package/build/types/config/watermark/TWatermarkConfig.d.ts +12 -0
- package/build/types/config/watermark/WatermarkDefaults.d.ts +2 -0
- package/build/types/controllers/CameraController/Handler360/index.d.ts +52 -0
- package/build/types/controllers/CameraController/Handler3D/Events3D.d.ts +31 -0
- package/build/types/controllers/CameraController/Handler3D/index.d.ts +50 -0
- package/build/types/controllers/CameraController/HandlerTopView/EventsTopView.d.ts +26 -0
- package/build/types/controllers/CameraController/HandlerTopView/index.d.ts +49 -0
- package/build/types/controllers/CameraController/index.d.ts +49 -0
- package/build/types/controllers/PanZoomController/index.d.ts +40 -0
- package/build/types/controllers/Scene360Controller/RaycastHandler.d.ts +57 -0
- package/build/types/controllers/Scene360Controller/SceneAnimationHandler.d.ts +23 -0
- package/build/types/controllers/Scene360Controller/index.d.ts +34 -0
- package/build/types/createWidget/TWidgetInputParams.d.ts +11 -0
- package/build/types/createWidget/WidgetBuilder.d.ts +20 -0
- package/build/types/createWidget/WidgetDirector.d.ts +4 -0
- package/build/types/createWidget/createWidget.d.ts +6 -0
- package/build/types/enums/MouseButton.d.ts +5 -0
- package/build/types/enums/RoomIcons.d.ts +1 -0
- package/build/types/lib/Arrayf.d.ts +10 -0
- package/build/types/lib/ClassMaker.d.ts +5 -0
- package/build/types/lib/CollisionResolver.d.ts +6 -0
- package/build/types/lib/ColorRgba.d.ts +63 -0
- package/build/types/lib/Device.d.ts +6 -0
- package/build/types/lib/Line2.d.ts +21 -0
- package/build/types/lib/Mathf.d.ts +30 -0
- package/build/types/lib/Objectf.d.ts +5 -0
- package/build/types/lib/Polygon2.d.ts +41 -0
- package/build/types/lib/RoomApertureResolver.d.ts +12 -0
- package/build/types/lib/Sprintf.d.ts +3 -0
- package/build/types/lib/TemplateDecoder.d.ts +20 -0
- package/build/types/lib/ThreeNormal.d.ts +7 -0
- package/build/types/lib/TopViewHelper.d.ts +7 -0
- package/build/types/lib/TypedObserver.d.ts +14 -0
- package/build/types/lib/UnrealToThree.d.ts +10 -0
- package/build/types/lib/V3.d.ts +45 -0
- package/build/types/lib/Vector2.d.ts +67 -0
- package/build/types/lib/Waiter.d.ts +4 -0
- package/build/types/lib/preventDefault.d.ts +1 -0
- package/build/types/lib/unused.d.ts +3 -0
- package/build/types/locale/index.d.ts +53 -0
- package/build/types/locale/types/TLocaleOverrides.d.ts +23 -0
- package/build/types/plugins/IPlugin.d.ts +12 -0
- package/build/types/plugins/PluginManager.d.ts +21 -0
- package/build/types/resources/GLTFResource/GLTFNormalizer.d.ts +19 -0
- package/build/types/resources/GLTFResource/index.d.ts +17 -0
- package/build/types/resources/TextureResource.d.ts +9 -0
- package/build/types/scenes/Scene360/core/Camera.d.ts +13 -0
- package/build/types/scenes/Scene360/core/Renderer.d.ts +11 -0
- package/build/types/scenes/Scene360/core/SideRenderer.d.ts +5 -0
- package/build/types/scenes/Scene360/core/ViewPoint.d.ts +8 -0
- package/build/types/scenes/Scene360/index.d.ts +27 -0
- package/build/types/scenes/Scene360/objects/Cursor3D.d.ts +16 -0
- package/build/types/scenes/Scene360/objects/EnvMap.d.ts +15 -0
- package/build/types/scenes/Scene360/objects/GLTFObject.d.ts +22 -0
- package/build/types/solid-js/makeStore.d.ts +1 -0
- package/build/types/store/ConfigStore/index.d.ts +43 -0
- package/build/types/store/ContainerStore/index.d.ts +39 -0
- package/build/types/store/DoorLinkStore/index.d.ts +41 -0
- package/build/types/store/EditorStore/index.d.ts +13 -0
- package/build/types/store/ErrorScreenStore/index.d.ts +19 -0
- package/build/types/store/ErrorStore/index.d.ts +14 -0
- package/build/types/store/FurnitureStore/index.d.ts +24 -0
- package/build/types/store/IndexStore/IndexResolver.d.ts +17 -0
- package/build/types/store/IndexStore/index.d.ts +34 -0
- package/build/types/store/LoadingStore/index.d.ts +22 -0
- package/build/types/store/LocaleStore/index.d.ts +29 -0
- package/build/types/store/LoggerStore/index.d.ts +13 -0
- package/build/types/store/MapStore/index.d.ts +23 -0
- package/build/types/store/OverrideStore/index.d.ts +31 -0
- package/build/types/store/RaycastStore/index.d.ts +13 -0
- package/build/types/store/RoomLinkStore/index.d.ts +47 -0
- package/build/types/store/SettingsStore/index.d.ts +16 -0
- package/build/types/store/TabStore/Tab2DStore/index.d.ts +12 -0
- package/build/types/store/TabStore/Tab360Store/index.d.ts +37 -0
- package/build/types/store/TabStore/index.d.ts +32 -0
- package/build/types/store/TexturePackStore/index.d.ts +16 -0
- package/build/types/store/VertexStore/index.d.ts +21 -0
- package/build/types/store/VisibilityStore/index.d.ts +17 -0
- package/build/types/store/WallStore/index.d.ts +22 -0
- package/build/types/store/index.d.ts +55 -0
- package/build/types/three/EnvMapMaterial/index.d.ts +15 -0
- package/build/types/three/GFPGLTFLoader/GLTFParser.d.ts +226 -0
- package/build/types/three/GFPGLTFLoader/GLTFRegistry.d.ts +7 -0
- package/build/types/three/GFPGLTFLoader/constants/ALPHA_MODES.d.ts +5 -0
- package/build/types/three/GFPGLTFLoader/constants/ATTRIBUTES.d.ts +1 -0
- package/build/types/three/GFPGLTFLoader/constants/EXTENSIONS.d.ts +24 -0
- package/build/types/three/GFPGLTFLoader/constants/INTERPOLATION.d.ts +1 -0
- package/build/types/three/GFPGLTFLoader/constants/PATH_PROPERTIES.d.ts +1 -0
- package/build/types/three/GFPGLTFLoader/constants/WEBGL_COMPONENT_TYPES.d.ts +1 -0
- package/build/types/three/GFPGLTFLoader/constants/WEBGL_CONSTANTS.d.ts +20 -0
- package/build/types/three/GFPGLTFLoader/constants/WEBGL_FILTERS.d.ts +1 -0
- package/build/types/three/GFPGLTFLoader/constants/WEBGL_TYPE_SIZES.d.ts +1 -0
- package/build/types/three/GFPGLTFLoader/constants/WEBGL_WRAPPINGS.d.ts +1 -0
- package/build/types/three/GFPGLTFLoader/extensions/GLTFBinaryExtension.d.ts +13 -0
- package/build/types/three/GFPGLTFLoader/extensions/GLTFDracoMeshCompressionExtension.d.ts +16 -0
- package/build/types/three/GFPGLTFLoader/extensions/GLTFMaterialsEmissiveStrengthExtension.d.ts +14 -0
- package/build/types/three/GFPGLTFLoader/extensions/GLTFMaterialsTransmissionExtension.d.ts +17 -0
- package/build/types/three/GFPGLTFLoader/extensions/GLTFMaterialsUnlitExtension.d.ts +15 -0
- package/build/types/three/GFPGLTFLoader/extensions/GLTFMeshGpuInstancing.d.ts +14 -0
- package/build/types/three/GFPGLTFLoader/extensions/GLTFMeshQuantizationExtension.d.ts +11 -0
- package/build/types/three/GFPGLTFLoader/extensions/GLTFMeshoptCompression.d.ts +14 -0
- package/build/types/three/GFPGLTFLoader/extensions/GLTFTextureAVIFExtension.d.ts +14 -0
- package/build/types/three/GFPGLTFLoader/extensions/GLTFTextureBasisUExtension.d.ts +14 -0
- package/build/types/three/GFPGLTFLoader/extensions/GLTFTextureTransformExtension.d.ts +13 -0
- package/build/types/three/GFPGLTFLoader/extensions/GLTFTextureWebPExtension.d.ts +14 -0
- package/build/types/three/GFPGLTFLoader/index.d.ts +24 -0
- package/build/types/three/GFPGLTFLoader/lib/GLTFCubicSplineInterpolant.d.ts +6 -0
- package/build/types/three/GFPGLTFLoader/lib/GLTFCubicSplineQuaternionInterpolant.d.ts +4 -0
- package/build/types/three/GFPGLTFLoader/utils/addMorphTargets.d.ts +12 -0
- package/build/types/three/GFPGLTFLoader/utils/addPrimitiveAttributes.d.ts +9 -0
- package/build/types/three/GFPGLTFLoader/utils/addUnknownExtensionsToUserData.d.ts +1 -0
- package/build/types/three/GFPGLTFLoader/utils/assignExtrasToUserData.d.ts +7 -0
- package/build/types/three/GFPGLTFLoader/utils/computeBounds.d.ts +8 -0
- package/build/types/three/GFPGLTFLoader/utils/createAttributesKey.d.ts +1 -0
- package/build/types/three/GFPGLTFLoader/utils/createDefaultMaterial.d.ts +10 -0
- package/build/types/three/GFPGLTFLoader/utils/createPrimitiveKey.d.ts +1 -0
- package/build/types/three/GFPGLTFLoader/utils/getImageURIMimeType.d.ts +1 -0
- package/build/types/three/GFPGLTFLoader/utils/getNormalizedComponentScale.d.ts +1 -0
- package/build/types/three/GFPGLTFLoader/utils/updateMorphTargets.d.ts +7 -0
- package/build/types/three/SmartGLTFLoader.d.ts +11 -0
- package/build/types/three/UnrealMaterial/index.d.ts +91 -0
- package/build/types/types/DeepPartial.d.ts +3 -0
- package/build/types/types/DeepRequired.d.ts +3 -0
- package/build/types/types/IStoreProps.d.ts +4 -0
- package/build/types/types/Nullable.d.ts +1 -0
- package/build/types/types/TBuilding.d.ts +218 -0
- package/build/types/types/TGLTF.d.ts +14 -0
- package/build/types/types/TGLTFJson.d.ts +52 -0
- package/build/types/types/TTelemetry.d.ts +19 -0
- package/build/types/types/Tuple.d.ts +4 -0
- package/build/types/vendors/AIXSolutionsVendor/config/TAIXSolutionsConfig.d.ts +16 -0
- package/build/types/vendors/TVendorsConfig.d.ts +4 -0
- package/build/vendors/AIXSolutionsVendor.js +763 -0
- package/package.json +93 -0
package/README.md
ADDED
|
@@ -0,0 +1,346 @@
|
|
|
1
|
+
# gltf-widget
|
|
2
|
+
|
|
3
|
+
## Install dependencies
|
|
4
|
+
```shell
|
|
5
|
+
bun ci
|
|
6
|
+
```
|
|
7
|
+
|
|
8
|
+
## Run dev server
|
|
9
|
+
```shell
|
|
10
|
+
bun dev
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
## Run production server
|
|
14
|
+
```shell
|
|
15
|
+
bun start
|
|
16
|
+
```
|
|
17
|
+
|
|
18
|
+
## Build
|
|
19
|
+
```shell
|
|
20
|
+
bun run build
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
## Configuration
|
|
24
|
+
|
|
25
|
+
```json
|
|
26
|
+
{
|
|
27
|
+
/** Base API Url */
|
|
28
|
+
"baseUrl": "https://backend-stage.estate.hart-digital.com",
|
|
29
|
+
/** Logo image url */
|
|
30
|
+
"logoUrl": "",
|
|
31
|
+
/** Logo link url */
|
|
32
|
+
"logoLinkUrl": "",
|
|
33
|
+
/** Widget language */
|
|
34
|
+
"locale": "en",
|
|
35
|
+
/** Show fullscreen button (if available) */
|
|
36
|
+
"isFullscreenButtonVisible": true,
|
|
37
|
+
/** Widget main aspect color */
|
|
38
|
+
"mainColor": "#FFA900",
|
|
39
|
+
/** Widget scene background color */
|
|
40
|
+
"backgroundColor": "#FFFFFF",
|
|
41
|
+
/** Enable editor drag n drop field on error */
|
|
42
|
+
"isEditor": false,
|
|
43
|
+
/** Render pixel ratio (0 = get from device) */
|
|
44
|
+
"renderPixelRatio": 0,
|
|
45
|
+
/** Mobile render pixel ratio (0 = get from device) */
|
|
46
|
+
"mobileRenderPixelRatio": 1,
|
|
47
|
+
/** Primary widget tab */
|
|
48
|
+
"primaryTab": "360",
|
|
49
|
+
/** Invert selected tab button */
|
|
50
|
+
"invertSelectedTab": false,
|
|
51
|
+
/** Invert rest button on select */
|
|
52
|
+
"invertRestButtons": false,
|
|
53
|
+
|
|
54
|
+
"tab2D": {
|
|
55
|
+
/** Show original or miniplan on 2D tab */
|
|
56
|
+
"source": "miniplan",
|
|
57
|
+
/** Pinch zoom speed */
|
|
58
|
+
"zoomSpeed": 5
|
|
59
|
+
},
|
|
60
|
+
|
|
61
|
+
"tabTopView": {
|
|
62
|
+
/** Position delta speed */
|
|
63
|
+
"moveDeltaSpeed": 15,
|
|
64
|
+
/** Rotation delta speed */
|
|
65
|
+
"rotationDeltaSpeed": 15,
|
|
66
|
+
/** Zoom delta speed */
|
|
67
|
+
"zoomDeltaSpeed": 15,
|
|
68
|
+
/** Move speed */
|
|
69
|
+
"moveSpeed": 3,
|
|
70
|
+
/** Mobile move speed */
|
|
71
|
+
"mobileMoveSpeed": 5,
|
|
72
|
+
/** Show settings button */
|
|
73
|
+
"showSettingsButton": true,
|
|
74
|
+
/** Show visibility button */
|
|
75
|
+
"showVisibilityButton": true
|
|
76
|
+
},
|
|
77
|
+
|
|
78
|
+
"tab3D": {
|
|
79
|
+
/** Position delta speed */
|
|
80
|
+
"moveDeltaSpeed": 15,
|
|
81
|
+
/** Rotation delta speed */
|
|
82
|
+
"rotationDeltaSpeed": 15,
|
|
83
|
+
/** Zoom delta speed */
|
|
84
|
+
"zoomDeltaSpeed": 15,
|
|
85
|
+
/** Move speed */
|
|
86
|
+
"moveSpeed": 3,
|
|
87
|
+
/** Mobile move speed */
|
|
88
|
+
"mobileMoveSpeed": 5,
|
|
89
|
+
/** Rotation speed */
|
|
90
|
+
"rotationSpeed": 5,
|
|
91
|
+
/** Mobile rotation speed */
|
|
92
|
+
"mobileRotationSpeed": 5,
|
|
93
|
+
/** Minimal pitch angle */
|
|
94
|
+
"minPitch": 0,
|
|
95
|
+
/** Maximum pitch angle */
|
|
96
|
+
"maxPitch": 90,
|
|
97
|
+
/** Show settings button */
|
|
98
|
+
"showSettingsButton": true,
|
|
99
|
+
/** Show visibility button */
|
|
100
|
+
"showVisibilityButton": true
|
|
101
|
+
},
|
|
102
|
+
|
|
103
|
+
"tab360": {
|
|
104
|
+
/** Rotate camera towards navigation direction */
|
|
105
|
+
"isDirectionalDoorLink": true,
|
|
106
|
+
/** Rotate camera towards door target direction */
|
|
107
|
+
"isDirectionalNavigation": true,
|
|
108
|
+
/** Roof objects template */
|
|
109
|
+
"roofObjectsTemplate": "(ProceduralBeamId|CeilingMesh|RoofMesh|CeilingLayersMesh|CeilingLightsMesh)",
|
|
110
|
+
|
|
111
|
+
/** Position speed */
|
|
112
|
+
"moveSpeed": 5,
|
|
113
|
+
/** Rotation speed */
|
|
114
|
+
"rotationSpeed": 15,
|
|
115
|
+
/** Zoom speed */
|
|
116
|
+
"zoomSpeed": 5,
|
|
117
|
+
/** Enable scroll and pinch zooming */
|
|
118
|
+
"enableZoom": true,
|
|
119
|
+
/** Minimal zoom */
|
|
120
|
+
"minZoom": 0.3,
|
|
121
|
+
/** Maximum zoom */
|
|
122
|
+
"maxZoom": 3,
|
|
123
|
+
|
|
124
|
+
/** Show settings button */
|
|
125
|
+
"showSettingsButton": true,
|
|
126
|
+
/** Show visibility button */
|
|
127
|
+
"showVisibilityButton": true,
|
|
128
|
+
|
|
129
|
+
/** Always check 3D cursor visibility */
|
|
130
|
+
"forceCursorVisibilityCheck": false,
|
|
131
|
+
|
|
132
|
+
"camera": {
|
|
133
|
+
/** Camera offset from view point */
|
|
134
|
+
"offsetPosition": { "x": 0, "y": 0, "z": 0.1 }
|
|
135
|
+
},
|
|
136
|
+
|
|
137
|
+
"collider": {
|
|
138
|
+
/** Collider radius in meters */
|
|
139
|
+
"radius": 0.2
|
|
140
|
+
},
|
|
141
|
+
},
|
|
142
|
+
|
|
143
|
+
/** Room link config */
|
|
144
|
+
"roomLink": {
|
|
145
|
+
/** Template for raycast mesh names */
|
|
146
|
+
"raycastTemplate": "baked",
|
|
147
|
+
/** Show area in label */
|
|
148
|
+
"showArea": false,
|
|
149
|
+
/** Area text template */
|
|
150
|
+
"areaTemplate": "{area} m²",
|
|
151
|
+
/** Show size in label */
|
|
152
|
+
"showSize": true,
|
|
153
|
+
/** Size text template */
|
|
154
|
+
"sizeTemplate": "{width} x {length} m",
|
|
155
|
+
/** Size text without metrics template */
|
|
156
|
+
"noMetricSizeTemplate": "{width} x {length}",
|
|
157
|
+
/** Enable visibility check */
|
|
158
|
+
"checkVisibility": true,
|
|
159
|
+
/** Size display precision */
|
|
160
|
+
"sizePrecision": 1,
|
|
161
|
+
/** Area display precision */
|
|
162
|
+
"areaPrecision": 1
|
|
163
|
+
},
|
|
164
|
+
|
|
165
|
+
/** Door link config */
|
|
166
|
+
"doorLink": {
|
|
167
|
+
/** Template for raycast mesh names */
|
|
168
|
+
"raycastTemplate": "baked",
|
|
169
|
+
/** Show area in label */
|
|
170
|
+
"showArea": false,
|
|
171
|
+
/** Area text template */
|
|
172
|
+
"areaTemplate": "{area} m²",
|
|
173
|
+
/** Show size in label */
|
|
174
|
+
"showSize": true,
|
|
175
|
+
/** Size text template */
|
|
176
|
+
"sizeTemplate": "{width} x {length} m",
|
|
177
|
+
/** Enable visibility check */
|
|
178
|
+
"checkVisibility": true,
|
|
179
|
+
/** Size display precision */
|
|
180
|
+
"sizePrecision": 1,
|
|
181
|
+
/** Area display precision */
|
|
182
|
+
"areaPrecision": 1
|
|
183
|
+
},
|
|
184
|
+
|
|
185
|
+
/** Watermark config */
|
|
186
|
+
"watermark": {
|
|
187
|
+
/** Watermark objects name patters */
|
|
188
|
+
"watermarkObjectsPattern": "(FloorMesh)",
|
|
189
|
+
/** Watermark url */
|
|
190
|
+
"url": "https://path.to/image.png",
|
|
191
|
+
/** Watermark rotation in degrees */
|
|
192
|
+
"rotation": 0,
|
|
193
|
+
/** Watermark scale */
|
|
194
|
+
"scale": 1,
|
|
195
|
+
/** Watermark opacity */
|
|
196
|
+
"opacity": 1
|
|
197
|
+
},
|
|
198
|
+
|
|
199
|
+
/** Material config */
|
|
200
|
+
"material": {
|
|
201
|
+
/** Opacity override on all transparent materials */
|
|
202
|
+
"minOpacity": 0.1
|
|
203
|
+
},
|
|
204
|
+
|
|
205
|
+
/** Network fallback config */
|
|
206
|
+
"networkFallback": {
|
|
207
|
+
"version": 1,
|
|
208
|
+
"strategy": {
|
|
209
|
+
"order": ["origin", "group:same", "group:other"]
|
|
210
|
+
},
|
|
211
|
+
"failurePolicy": {
|
|
212
|
+
"http": [403, 404, 410, 429, 451, 500, 502, 503, 504],
|
|
213
|
+
"network": true,
|
|
214
|
+
"cors": true,
|
|
215
|
+
"contentMismatch": true,
|
|
216
|
+
"timeout": 2000
|
|
217
|
+
},
|
|
218
|
+
"keyExtraction": {
|
|
219
|
+
"patterns": [
|
|
220
|
+
{ "re": "^https?://[^/]+/app_storage_production/public/(.*)$" },
|
|
221
|
+
{ "re": "^https?://[^/]+/storage/(.*)$" }
|
|
222
|
+
],
|
|
223
|
+
"fallback": "pathname-after-first-segment"
|
|
224
|
+
},
|
|
225
|
+
"routes": {
|
|
226
|
+
"cdn2.getfloorplan.tech": {
|
|
227
|
+
"template": "https://cdn2.getfloorplan.tech/app_storage_production/public/{key}",
|
|
228
|
+
"probe": "range",
|
|
229
|
+
"cors": true
|
|
230
|
+
},
|
|
231
|
+
"d3u9de4hv6rhm1.cloudfront.net": {
|
|
232
|
+
"template": "https://d3u9de4hv6rhm1.cloudfront.net/app_storage_production/public/{key}",
|
|
233
|
+
"probe": "range",
|
|
234
|
+
"cors": true
|
|
235
|
+
},
|
|
236
|
+
"cdn2ru.getfloorplan.tech": {
|
|
237
|
+
"template": "https://cdn2ru.getfloorplan.tech/app_storage_production/public/{key}",
|
|
238
|
+
"probe": "range",
|
|
239
|
+
"cors": true
|
|
240
|
+
},
|
|
241
|
+
"backend-stage.estate.hart-digital.com": {
|
|
242
|
+
"template": "https://backend-stage.estate.hart-digital.com/storage/{key}",
|
|
243
|
+
"probe": "head",
|
|
244
|
+
"cors": true
|
|
245
|
+
},
|
|
246
|
+
"api.getfloorplan.com": {
|
|
247
|
+
"template": "https://api.getfloorplan.com/storage/{key}",
|
|
248
|
+
"probe": "head",
|
|
249
|
+
"cors": true
|
|
250
|
+
},
|
|
251
|
+
"api.ru.getfloorplan.com": {
|
|
252
|
+
"template": "https://api.ru.getfloorplan.com/storage/{key}",
|
|
253
|
+
"probe": "head",
|
|
254
|
+
"cors": true
|
|
255
|
+
}
|
|
256
|
+
},
|
|
257
|
+
"groups": {
|
|
258
|
+
"int": [
|
|
259
|
+
"cdn2.getfloorplan.tech",
|
|
260
|
+
"d3u9de4hv6rhm1.cloudfront.net",
|
|
261
|
+
"backend-stage.estate.hart-digital.com"
|
|
262
|
+
],
|
|
263
|
+
"ru": [
|
|
264
|
+
"cdn2ru.getfloorplan.tech",
|
|
265
|
+
"backend-stage.estate.hart-digital.com"
|
|
266
|
+
]
|
|
267
|
+
}
|
|
268
|
+
},
|
|
269
|
+
|
|
270
|
+
/** Overrides for translation */
|
|
271
|
+
"localeOverrides": {
|
|
272
|
+
"editor": {
|
|
273
|
+
/** Drag n drop editor text */
|
|
274
|
+
"dragPlaceholder": "Drag json and glb files"
|
|
275
|
+
},
|
|
276
|
+
|
|
277
|
+
/** Made by settings */
|
|
278
|
+
"madeByTemplate": "$0 $1",
|
|
279
|
+
"madeByPrefix": "made by",
|
|
280
|
+
"madeByLink": "",
|
|
281
|
+
"madeByText": "",
|
|
282
|
+
|
|
283
|
+
"noGLTFErrorTitle": "No GLTF Content",
|
|
284
|
+
"noGLTFErrorMessage": "It looks like this plan doesn’t have any GLTF data.",
|
|
285
|
+
"initError": "Init error",
|
|
286
|
+
"networkError": "Network error",
|
|
287
|
+
"unknownError": "Unknown error",
|
|
288
|
+
"emptyCrmPlanIdError": "Empty or Invalid CRM plan ID",
|
|
289
|
+
"emptyPlanIdError": "Empty or Invalid Plan ID",
|
|
290
|
+
"failedToFetchError": "Failed to fetch: $0 $1",
|
|
291
|
+
|
|
292
|
+
/** Floor selector settings */
|
|
293
|
+
"floor": "$0 floor",
|
|
294
|
+
"floorNumberEndings": {
|
|
295
|
+
"1": "",
|
|
296
|
+
"2": "",
|
|
297
|
+
"3": "",
|
|
298
|
+
"rest": ""
|
|
299
|
+
},
|
|
300
|
+
|
|
301
|
+
/** Override room names */
|
|
302
|
+
"roomTypes": {
|
|
303
|
+
"Kitchen": "Meow meow meow",
|
|
304
|
+
"CombinedBathroom": "Bark bark bark"
|
|
305
|
+
},
|
|
306
|
+
},
|
|
307
|
+
|
|
308
|
+
/** Query parameters, only on custom */
|
|
309
|
+
"query": {
|
|
310
|
+
/** Primary floor number starting from 1 */
|
|
311
|
+
"primaryFloorNumber": 1,
|
|
312
|
+
/** Primary variant id */
|
|
313
|
+
"primaryVariantId": "<plan_id>",
|
|
314
|
+
/** Primary style name (overrides primaryVariantId) */
|
|
315
|
+
"primaryStyleName": "Scandy",
|
|
316
|
+
/** Overrides preferred texture pack, case insensitive substring in texture_pack.name */
|
|
317
|
+
"quality": "optimized",
|
|
318
|
+
/** Show logger */
|
|
319
|
+
"showLogs": false
|
|
320
|
+
},
|
|
321
|
+
|
|
322
|
+
/** Configuration for vendors */
|
|
323
|
+
"vendors": {
|
|
324
|
+
|
|
325
|
+
"aixSolutions": {
|
|
326
|
+
/** Line width of the ruler */
|
|
327
|
+
"lineWidth": 2,
|
|
328
|
+
/** Minimal distance between wall vertices for display a ruler */
|
|
329
|
+
"minWallLength": 0.4,
|
|
330
|
+
/** Ruler line hex color */
|
|
331
|
+
"rulerColor": "#FFFFFF",
|
|
332
|
+
/** How far to zoom on room focus (x * FloorHeight) */
|
|
333
|
+
"focusZoom": 1,
|
|
334
|
+
/** Scale points with text */
|
|
335
|
+
"scalePoints": [
|
|
336
|
+
{ "value": 1, "text": "1.0" },
|
|
337
|
+
{ "value": 2, "text": "1.5" },
|
|
338
|
+
{ "value": 3, "text": "2.0" },
|
|
339
|
+
]
|
|
340
|
+
}
|
|
341
|
+
|
|
342
|
+
}
|
|
343
|
+
};
|
|
344
|
+
```
|
|
345
|
+
|
|
346
|
+
### [GLTF Config Example](https://docs.getfloorplan.tech/doc/ot-19-sentyabrya-CPCpr3teg6)
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
.aixsolutions-pinchInstruction{display:flex;justify-content:center;align-items:center;width:100%;height:100%;position:absolute;left:0;top:0;-webkit-backdrop-filter:blur(3px);backdrop-filter:blur(3px);background-color:#0000004d;z-index:200100;transition:opacity .5s}.aixsolutions-pinchInstruction--disappear{opacity:0;pointer-events:none}.aixsolutions-pinchInstruction--disappear .pinchInstruction__icon{filter:blur(10px)}.pinchInstruction__icon{display:flex;justify-content:center;align-items:center;pointer-events:none;transition:filter .5s}.pinchInstruction__icon{width:280px;height:280px}.widget-application--tablet.pinchInstruction__icon{width:240px;height:240px}.widget-application--mobile.pinchInstruction__icon{width:200px;height:200px}.pinchInstruction__icon svg{stroke:#fff;stroke-width:16px}#ArrowUp{animation:pinchArrowUp 2s infinite ease-in-out}#ArrowDown{animation:pinchArrowDown 2s infinite ease-in-out}#Dynamic1{animation:pinchDynamic1 2s infinite ease-in-out}#Dynamic2{animation:pinchDynamic2 2s infinite ease-in-out}@keyframes pinchArrowUp{0%{transform:translate(0)}50%{transform:translate(6%,-10%)}to{transform:translate(0)}}@keyframes pinchArrowDown{0%{transform:translate(0)}50%{transform:translate(-6%,10%)}to{transform:translate(0)}}@keyframes pinchDynamic1{0%{d:path("M251 352.999C255 299 260.277 242.638 251 248C251 248 237 256.501 227 258C217 259.499 208.5 249.499 210.001 233.5C211.501 217.501 227 207.501 248 202C269 196.499 294.458 202.045 305.5 225.999")}50%{d:path("M251.001 353.001C251.001 309 251.001 277 251.001 250C251.001 250 246.501 152 254.001 141.001C261.501 130.002 273.5 123 287 129.5C300.5 135.999 303 141.001 305.501 163.999C305.501 192.5 303.5 250 303.5 281.5")}to{d:path("M251 352.999C255 299 260.277 242.638 251 248C251 248 237 256.501 227 258C217 259.499 208.5 249.499 210.001 233.5C211.501 217.501 227 207.501 248 202C269 196.499 294.458 202.045 305.5 225.999")}}@keyframes pinchDynamic2{0%{d:path("M251 353.5L203 263C183.5 249 148.129 270 166.499 302.5C184.87 335 232.412 416.714 251 445")}50%{d:path("M250.999 353.5L172.498 292.501C152.999 278.501 119 302 135.499 331.999C157.5 360.5 229 419.5 250.999 445")}to{d:path("M251 353.5L203 263C183.5 249 148.129 270 166.499 302.5C184.87 335 232.412 416.714 251 445")}}.widget-application .aixsolutions-roomSelector{display:flex;align-items:center;position:absolute;background-color:#fff;transition:all .1s;pointer-events:all;box-shadow:0 0 16px #0000000d;border:1px solid var(--main-color)}.widget-application .aixsolutions-roomSelector{gap:24px;padding:10px;bottom:42px;right:50%;transform:translate(50%);border-radius:12px}@media screen and (max-width: 1600px){.widget-application .aixsolutions-roomSelector{right:630px;transform:unset}}.widget-application--laptop.widget-application .aixsolutions-roomSelector{gap:24px;padding:8px;border-radius:8px;bottom:37px;right:540px}.widget-application--tablet.widget-application .aixsolutions-roomSelector{gap:24px;padding:8px;border-radius:8px;bottom:40px;right:425px}.widget-application--mobile.widget-application .aixsolutions-roomSelector{gap:24px;padding:8px;border-radius:8px;bottom:82px;right:calc(50% - 70px)}.widget-application--smallMobile.widget-application .aixsolutions-roomSelector{gap:10px;padding:4px 8px;border-radius:8px;bottom:128px;right:50%;transform:translate(50%)}.widget-application .aixsolutions-selectorArrow{display:block;cursor:pointer;-webkit-user-select:none;user-select:none;background-image:url("data:image/svg+xml,%3csvg%20width='24'%20height='24'%20viewBox='0%200%2024%2024'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M20.25%2012H3.75'%20stroke='%23413E3E'%20stroke-width='1.5'%20stroke-linecap='round'%20stroke-linejoin='round'/%3e%3cpath%20d='M10.5%205.25L3.75%2012L10.5%2018.75'%20stroke='%23413E3E'%20stroke-width='1.5'%20stroke-linecap='round'%20stroke-linejoin='round'/%3e%3c/svg%3e");background-size:contain;transition:all .1s}.widget-application .aixsolutions-selectorArrow{width:24px;height:24px}.widget-application--tablet.widget-application .aixsolutions-selectorArrow,.widget-application--mobile.widget-application .aixsolutions-selectorArrow{width:18px;height:18px}.widget-application--smallMobile.widget-application .aixsolutions-selectorArrow{width:16px;height:16px}.widget-application .aixsolutions-selectorText{display:block;text-align:center;line-height:120%;font-weight:600}.widget-application .aixsolutions-selectorText{min-width:200px;font-size:18px}.widget-application--tablet.widget-application .aixsolutions-selectorText,.widget-application--mobile.widget-application .aixsolutions-selectorText{min-width:150px;font-size:14px}.widget-application--smallMobile.widget-application .aixsolutions-selectorText{min-width:110px;font-size:10px}.widget-application .aixsolutions-selectorArrow--right{transform:rotate(180deg)}.widget-application .aixsolutions-roomSelector--hidden{opacity:0;pointer-events:none}.widget-application .aix-scaleButtons{display:flex;gap:8px;position:absolute;pointer-events:all}.widget-application .aix-scaleButtons{bottom:30px;right:30px}.widget-application--laptop.widget-application .aix-scaleButtons{bottom:30px;right:24px}.widget-application--tablet.widget-application .aix-scaleButtons{bottom:90px;right:32px}.widget-application--mobile.widget-application .aix-scaleButtons{bottom:80px;right:calc(50% - 164px)}.widget-application--smallMobile.widget-application .aix-scaleButtons{bottom:30px;right:calc(50% - 136px)}.widget-application .aix-scaleButton{display:flex;justify-content:center;align-items:center;background-color:var(--main-color);border-radius:50%;cursor:pointer}.widget-application .aix-scaleButton{width:60px;height:60px}.widget-application--laptop.widget-application .aix-scaleButton{width:52px;height:52px}.widget-application--tablet.widget-application .aix-scaleButton{width:48px;height:48px}.widget-application--mobile.widget-application .aix-scaleButton{width:36px;height:36px}.widget-application .aix-scaleButton img{display:block;pointer-events:none}.widget-application .aix-scaleButton img{width:40px;height:40px}.widget-application--laptop.widget-application .aix-scaleButton img{width:36px;height:36px}.widget-application--tablet.widget-application .aix-scaleButton img{width:32px;height:32px}.widget-application--mobile.widget-application .aix-scaleButton img{width:24px;height:24px}.widget-application .aixsolutions-frame{display:block;width:100%;height:100%;position:absolute;left:0;top:0;z-index:200006;pointer-events:none}.widget-application .aixsolutions-doorLink{-webkit-user-select:none;user-select:none;cursor:pointer;pointer-events:all;display:flex;position:absolute;--linkSize: 44px}.widget-application--mobile.widget-application .aixsolutions-doorLink{--linkSize: 32px}.widget-application .aixsolutions-doorLink:hover{z-index:20000!important}.widget-application .aixsolutions-doorLink__container{display:flex;flex-direction:column;align-items:center;justify-content:center;width:var(--linkSize);height:var(--linkSize);border-radius:100px;background-color:#eaeaea;gap:6px}.widget-application--mobile.widget-application .aixsolutions-doorLink__container{gap:3px}.widget-application .aixsolutions-doorLink__title{display:none;color:#413e3e;font-weight:600;line-height:100%;font-size:14px}.widget-application--mobile.widget-application .aixsolutions-doorLink__title{font-size:10px}.widget-application .aixsolutions-doorLink__subtitle{display:none;gap:7px;font-size:10px}.widget-application--mobile.widget-application .aixsolutions-doorLink__subtitle{gap:3px;font-size:8px}.widget-application .aixsolutions-doorLink__subtitle>span{display:block;color:#717171;font-weight:500;line-height:100%}.widget-application .aixsolutions-doorLink__subtitle>i{display:block;width:1px;height:1em;background-color:#413e3e}.widget-application .aixsolutions-doorLink--hover .aixsolutions-doorLink__container{width:100%;padding:0 14px 0 calc(var(--linkSize) + 6px)}.widget-application .aixsolutions-doorLink--hover .aixsolutions-doorLink__title{display:block}.widget-application .aixsolutions-doorLink--hover .aixsolutions-doorLink__subtitle{display:flex}.widget-application .aixsolutions-doorLink__icon{display:flex;justify-content:center;align-items:center;width:var(--linkSize);height:var(--linkSize);position:absolute;left:0;top:0;border-radius:50%;overflow:hidden;background-color:#fff}.widget-application .aixsolutions-doorLink__icon img{display:block;object-fit:contain;width:100%;height:100%}.widget-application .aixsolutions-doorLinkRenderer{display:block;pointer-events:none;position:absolute;left:0;top:0;width:100%;height:100%}.widget-application .aixsolutions-doorLinkRenderer--hidden{display:none}.widget-application .aixsolutions-doorLinkRenderer--no-pointer .aixsolutions-doorLink{pointer-events:none}.widget-application .aixsolutions-rulerLink{display:flex;align-items:center;justify-content:center;position:absolute;padding:4px 8px;border-radius:4px;color:#717171;background-color:#fff;font-size:14px;font-weight:400;line-height:120%}.widget-application .aixsolutions-rulerLinkRenderer{display:block;pointer-events:none;position:absolute;left:0;top:0;width:100%;height:100%}.widget-application .aixsolutions-rulerLinkRenderer--hidden{display:none}.widget-application .aixsolutions-rulerLinkRenderer--no-pointer .aixsolutions-rulerLink{pointer-events:none}.widget-application .aixsolutions-roomLink{-webkit-user-select:none;user-select:none;cursor:pointer;pointer-events:all;display:flex;position:absolute;--linkSize: 44px}.widget-application--mobile.widget-application .aixsolutions-roomLink{--linkSize: 32px}.widget-application .aixsolutions-roomLink:hover{z-index:20000!important}.widget-application .aixsolutions-roomLink--hidden{display:none}.widget-application .aixsolutions-roomLink--selected .aixsolutions-roomLink__container{border:2px solid red}.widget-application .aixsolutions-roomLink__container{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:6px;width:var(--linkSize);height:var(--linkSize);border-radius:100px;background-color:#eaeaea}.widget-application--mobile.widget-application .aixsolutions-roomLink__container{padding:0;gap:2px}.widget-application .aixsolutions-roomLink__title{display:none;color:#000;font-weight:600;line-height:100%;font-size:14px}.widget-application--mobile.widget-application .aixsolutions-roomLink__title{font-size:8px}.widget-application .aixsolutions-roomLink__subtitle{display:none;gap:7px;font-size:10px}.widget-application .aixsolutions-roomLink__subtitle>span{display:block;color:#000;font-weight:500;line-height:100%}.widget-application .aixsolutions-roomLink__subtitle>i{display:block;width:1px;height:1em;background-color:#413e3e}.widget-application .aixsolutions-roomLink__index{display:flex;justify-content:center;align-items:center;width:var(--linkSize);height:var(--linkSize);position:absolute;left:0;top:0;border-radius:50%;overflow:hidden;background-color:#fff}.widget-application .aixsolutions-roomLink--current .aixsolutions-roomLink__index{background-color:var(--main-color);color:#fff}.widget-application .aixsolutions-roomLink--hover .aixsolutions-roomLink__container{width:100%;padding:0 14px 0 calc(var(--linkSize) + 6px)}.widget-application .aixsolutions-roomLink--hover .aixsolutions-roomLink__title{display:block}.widget-application .aixsolutions-roomLink--hover .aixsolutions-roomLink__subtitle{display:flex}.widget-application .aixsolutions-roomLinkRenderer{display:block;pointer-events:none;position:absolute;left:0;top:0;width:100%;height:100%}.widget-application .aixsolutions-roomLinkRenderer--hidden{display:none}.widget-application .aixsolutions-roomLinkRenderer--no-pointer .aixsolutions-roomLink{pointer-events:none}
|
package/build/Api.js
ADDED
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
var c = Object.defineProperty;
|
|
2
|
+
var u = (e, s, t) => s in e ? c(e, s, { enumerable: !0, configurable: !0, writable: !0, value: t }) : e[s] = t;
|
|
3
|
+
var a = (e, s, t) => u(e, typeof s != "symbol" ? s + "" : s, t);
|
|
4
|
+
class h {
|
|
5
|
+
constructor(s) {
|
|
6
|
+
a(this, "baseUrl");
|
|
7
|
+
a(this, "loadCrmWidgetData", async (s) => {
|
|
8
|
+
if (typeof s != "string" || !s)
|
|
9
|
+
return { isError: !0, source: "loadCrmWidgetData", status: 404, message: "crmPlanId is invalid!" };
|
|
10
|
+
try {
|
|
11
|
+
const t = await this.fetch(`/api/crm/plans/${s}/v4/widget`), r = await this.checkError(t);
|
|
12
|
+
return r || await t.json();
|
|
13
|
+
} catch (t) {
|
|
14
|
+
return console.error(t), { isError: !0, source: t, status: 404, message: t instanceof Error ? t.message : "" };
|
|
15
|
+
}
|
|
16
|
+
});
|
|
17
|
+
a(this, "loadWidgetData", async (s) => {
|
|
18
|
+
if (typeof s != "string" || !s)
|
|
19
|
+
return { isError: !0, source: "loadWidgetData", status: 404, message: "planId is invalid!" };
|
|
20
|
+
try {
|
|
21
|
+
const t = await this.fetch(`/api/plans/${s}/v4/widget`), r = await this.checkError(t);
|
|
22
|
+
return r || await t.json();
|
|
23
|
+
} catch (t) {
|
|
24
|
+
return console.error(t), { isError: !0, source: t, status: 404, message: t instanceof Error ? t.message : "" };
|
|
25
|
+
}
|
|
26
|
+
});
|
|
27
|
+
this.baseUrl = s;
|
|
28
|
+
}
|
|
29
|
+
get headers() {
|
|
30
|
+
const s = ["application/json"];
|
|
31
|
+
return s.push("gltf-widget-version=1.11.29"), { Accept: s.join(";") };
|
|
32
|
+
}
|
|
33
|
+
async fetch(s, t) {
|
|
34
|
+
const r = `${this.baseUrl}${s}`;
|
|
35
|
+
return fetch(r, t ?? { headers: this.headers });
|
|
36
|
+
}
|
|
37
|
+
async checkError(s) {
|
|
38
|
+
var n;
|
|
39
|
+
if (s.ok) return;
|
|
40
|
+
if (!!!((n = s.headers.get("Content-Type")) != null && n.includes("application/json"))) {
|
|
41
|
+
const o = await s.text();
|
|
42
|
+
return { isError: !0, source: s, status: s.status, message: o };
|
|
43
|
+
}
|
|
44
|
+
const r = await s.json();
|
|
45
|
+
if (!(typeof r.message == "string")) {
|
|
46
|
+
const o = JSON.stringify(r, null, 2);
|
|
47
|
+
return { isError: !0, source: s, status: s.status, message: o };
|
|
48
|
+
}
|
|
49
|
+
return { isError: !0, source: s, status: s.status, message: r.message };
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
export {
|
|
53
|
+
h as Api
|
|
54
|
+
};
|