@imagineio/configurator-sdk 0.1.0-beta.1
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/LICENSE.md +294 -0
- package/README.md +103 -0
- package/dist/00a41227ff.js +1 -0
- package/dist/00ab3dcbb5.js +1 -0
- package/dist/01a664fa9f.css +51 -0
- package/dist/04746bff9a.js +1 -0
- package/dist/04931f795e.js +1 -0
- package/dist/05973a4da2.js +3 -0
- package/dist/061b81ad81.js +1 -0
- package/dist/066fc9aa40.js +1 -0
- package/dist/09c4973968.js +1 -0
- package/dist/0a35b2c5f4.js +1 -0
- package/dist/0af28430ab.js +1 -0
- package/dist/0e2dedae0d.js +1 -0
- package/dist/0f7c8345a8.js +1 -0
- package/dist/12b8165d6d.js +1 -0
- package/dist/1458417bdb.js +1 -0
- package/dist/14c83bc57a.js +1 -0
- package/dist/15d6bec3b5.css +150 -0
- package/dist/16a399703e.js +1 -0
- package/dist/17876f4322.css +114 -0
- package/dist/1870fc037b.js +1 -0
- package/dist/1a2629800a.css +196 -0
- package/dist/1e243363f6.js +1 -0
- package/dist/1fac915f8b.js +1 -0
- package/dist/1fff100656.js +1 -0
- package/dist/205827c5c8.js +1 -0
- package/dist/20b0104576.js +1 -0
- package/dist/2239b22616.js +1 -0
- package/dist/22bd38ddcf.js +1 -0
- package/dist/239b619005.css +1849 -0
- package/dist/23dc0ccf32.js +1 -0
- package/dist/26155bf68c.js +1 -0
- package/dist/2774152dd2.js +1 -0
- package/dist/27fee7007f.js +1 -0
- package/dist/281cf952fa.js +1 -0
- package/dist/28a9d58274.js +1 -0
- package/dist/28d887bf8a.js +1 -0
- package/dist/28df2aa12f.js +1 -0
- package/dist/297e653adf.js +1 -0
- package/dist/2990ba64d6.js +1 -0
- package/dist/2b6aa27f6d.js +1 -0
- package/dist/2c7c1bcef1.js +1 -0
- package/dist/2cab5c5c23.js +1 -0
- package/dist/2cafe3274b.js +1 -0
- package/dist/2e366d7386.js +1 -0
- package/dist/2f8cc8b292.js +1 -0
- package/dist/30be653f00.css +110 -0
- package/dist/31ea036f5c.js +1 -0
- package/dist/32861ea2b0.js +1 -0
- package/dist/33fa2c8ca2.js +1 -0
- package/dist/35d8449ed8.js +1 -0
- package/dist/3656ffa1b8.js +1 -0
- package/dist/367a479d3a.js +1 -0
- package/dist/371ed78aa2.js +1 -0
- package/dist/37596ace72.js +1 -0
- package/dist/37addc7fb3.js +1 -0
- package/dist/388cadacbd.js +1 -0
- package/dist/39a62ef7b8.js +1 -0
- package/dist/3bbcee0334.js +1 -0
- package/dist/3c916f744f.js +1 -0
- package/dist/3f37665dd1.js +1 -0
- package/dist/3fb3ab6757.js +1 -0
- package/dist/40d6aeb28c.js +1 -0
- package/dist/41ed5985ad.js +1 -0
- package/dist/431a2d8618.js +1 -0
- package/dist/44a229099f.js +1 -0
- package/dist/4741e5d07d.css +263 -0
- package/dist/4910c07ca8.css +411 -0
- package/dist/4a99ddb3fd.js +1 -0
- package/dist/4aa671f9f6.js +1 -0
- package/dist/4b8958aa4c.js +1 -0
- package/dist/4ba4f544b9.js +1 -0
- package/dist/4c24338793.js +1 -0
- package/dist/4d7a0d1897.js +1 -0
- package/dist/4e1db1e3b0.js +1 -0
- package/dist/4e7d0a0d4a.js +1 -0
- package/dist/51b23203e5.css +1447 -0
- package/dist/52436e0169.js +1 -0
- package/dist/54413c1eae.js +1 -0
- package/dist/54f0fcf38b.js +1 -0
- package/dist/55ab45ada4.css +370 -0
- package/dist/561dc3f1ab.js +1 -0
- package/dist/58e6419ba8.js +1 -0
- package/dist/5c9fd9201c.js +1 -0
- package/dist/5d05e8982e.js +1 -0
- package/dist/5d5e8a9c58.js +3 -0
- package/dist/5e4f2349ff.js +1 -0
- package/dist/609e5e5d28.js +1 -0
- package/dist/60d697292c.js +1 -0
- package/dist/61e0c0c9b5.js +1 -0
- package/dist/631a9f7fac.js +1 -0
- package/dist/64e9020b49.js +1 -0
- package/dist/66c461dc2c.js +1 -0
- package/dist/672404d987.js +1 -0
- package/dist/67f6338a4a.js +1 -0
- package/dist/6855e6a3b1.js +1 -0
- package/dist/6b0a81e4f8.js +1 -0
- package/dist/6ba86aa3b8.js +1 -0
- package/dist/6bff84d27e.js +1 -0
- package/dist/6c0a2572dd.js +1 -0
- package/dist/6d238282c1.js +1 -0
- package/dist/6e2595aa36.js +1 -0
- package/dist/6f9ae59d6c.js +1 -0
- package/dist/70dd811d74.js +1 -0
- package/dist/710c1ab641.js +1 -0
- package/dist/7206ce49c6.js +1 -0
- package/dist/7281d77ed9.js +1 -0
- package/dist/73f7d65985.js +1 -0
- package/dist/776277593f.js +1 -0
- package/dist/79a397bb92.js +1 -0
- package/dist/7a748aae59.js +1 -0
- package/dist/7bfb0ecfbb.css +572 -0
- package/dist/7bfcd0a517.js +1 -0
- package/dist/7d9ddaeb47.js +1 -0
- package/dist/7f833bc5af.js +1 -0
- package/dist/811b403d43.js +1 -0
- package/dist/817d930a49.js +1 -0
- package/dist/81802759ca.js +1 -0
- package/dist/81eb433604.js +1 -0
- package/dist/82a8a4bc35.js +1 -0
- package/dist/85af90fade.js +1 -0
- package/dist/872c4302e0.js +1 -0
- package/dist/87bb469216.js +1 -0
- package/dist/87dcc12b65.js +1 -0
- package/dist/87f511c4a8.js +1 -0
- package/dist/88251d6671.js +1 -0
- package/dist/882bc739c8.js +1 -0
- package/dist/89ab18ebc5.js +1 -0
- package/dist/8a22e8944f.css +563 -0
- package/dist/8a3a57c008.js +1 -0
- package/dist/8ade32d067.js +1 -0
- package/dist/8bf6d26ad6.css +233 -0
- package/dist/8c27edda0f.js +1 -0
- package/dist/8db8655f21.js +24 -0
- package/dist/8f60e5059a.js +1 -0
- package/dist/91707f5ca0.css +78 -0
- package/dist/921bf270dd.js +20 -0
- package/dist/9326c23506.js +1 -0
- package/dist/94a0a79c65.js +1 -0
- package/dist/9526094bb7.js +1 -0
- package/dist/9544661159.js +1 -0
- package/dist/95a44ebec2.js +1 -0
- package/dist/970313b92b.js +1 -0
- package/dist/9794652102.js +1 -0
- package/dist/983cbed22c.js +1 -0
- package/dist/9840b9ce12.js +1 -0
- package/dist/98f3644031.js +1 -0
- package/dist/992778075d.css +353 -0
- package/dist/9c6c598569.js +1 -0
- package/dist/9f474b5d1a.js +1 -0
- package/dist/a0f71d0bf5.js +1 -0
- package/dist/a3c983d431.js +1 -0
- package/dist/a3f18e76fe.js +1 -0
- package/dist/a493e9aa8f.js +1 -0
- package/dist/a77b15c0d6.js +1 -0
- package/dist/a811c90bd5.js +1 -0
- package/dist/a822c5e4f2.js +1 -0
- package/dist/aaa0e82d7f.css +69 -0
- package/dist/ab6c80484f.js +1 -0
- package/dist/ae96f219e3.js +1 -0
- package/dist/b11b38869d.css +427 -0
- package/dist/b1349d5a21.js +4 -0
- package/dist/b14379d31b.css +151 -0
- package/dist/b3efb26fd7.js +1 -0
- package/dist/b59b0dde17.js +1 -0
- package/dist/b5c372377f.js +1 -0
- package/dist/b976df09ec.js +1 -0
- package/dist/baeaed46c9.js +1 -0
- package/dist/bb719febc6.js +1 -0
- package/dist/bcd44b4040.js +1 -0
- package/dist/bdc4e4c5b9.css +209 -0
- package/dist/bdec200d00.js +1 -0
- package/dist/be0cfe2236.js +1 -0
- package/dist/be337ddda5.js +1 -0
- package/dist/c12c112c6f.js +1 -0
- package/dist/c2a14a77ae.js +1 -0
- package/dist/c3b8f1973b.js +1 -0
- package/dist/c44d37da7a.js +1 -0
- package/dist/c4790179f1.js +1 -0
- package/dist/c5e990946e.js +1 -0
- package/dist/c71892453b.js +1 -0
- package/dist/c9a1656c62.js +1 -0
- package/dist/ca497b066c.js +1 -0
- package/dist/cdb4a0f7b3.js +3 -0
- package/dist/ce663020e4.js +60 -0
- package/dist/cec035efb1.js +1 -0
- package/dist/d0f9681634.js +1 -0
- package/dist/d118c2e7ba.js +1 -0
- package/dist/d20718159b.js +3 -0
- package/dist/d30f1f506e.js +1 -0
- package/dist/d3cd7f1bc1.js +1 -0
- package/dist/d4378d9afa.js +1 -0
- package/dist/d464da28a5.js +1 -0
- package/dist/d566d3874b.js +1 -0
- package/dist/d617bbb9f5.js +26 -0
- package/dist/d65f32e004.js +1 -0
- package/dist/d6851ea979.js +1 -0
- package/dist/d7c9500ba9.js +1 -0
- package/dist/d803155241.js +1 -0
- package/dist/d903df4e0d.js +1 -0
- package/dist/d94df858ea.js +1 -0
- package/dist/da7b5f450d.js +1 -0
- package/dist/daa11edd01.js +1 -0
- package/dist/db4afd43c9.js +1 -0
- package/dist/dbd5ba1d07.js +1 -0
- package/dist/dc2a1a0e13.js +1 -0
- package/dist/dc812f3e14.js +1 -0
- package/dist/dcbf419090.css +122 -0
- package/dist/dcdba78ddf.js +1 -0
- package/dist/de408c4516.js +1 -0
- package/dist/e1cd279733.js +1 -0
- package/dist/e379e0039b.js +1 -0
- package/dist/e4fe0551fd.js +1 -0
- package/dist/e6eed481cc.css +28 -0
- package/dist/e75f1e5992.js +1 -0
- package/dist/ea8577d22b.js +1 -0
- package/dist/ec4a34fc80.css +313 -0
- package/dist/ed6a54cdf6.js +1 -0
- package/dist/ee242c0099.js +1 -0
- package/dist/ee9b9fd7d1.js +1 -0
- package/dist/f0c3d8a28a.js +1 -0
- package/dist/f11a45a150.js +1 -0
- package/dist/f1b3b2622a.js +1 -0
- package/dist/f7b4a178e3.js +1 -0
- package/dist/f89d7cd931.js +1 -0
- package/dist/f8cb80a93c.js +1 -0
- package/dist/f8fec86f10.js +1 -0
- package/dist/fbd844f2d1.js +1 -0
- package/dist/fe235d7160.js +1 -0
- package/dist/fe58a84b85.js +1 -0
- package/dist/fe68b361ba.js +1 -0
- package/dist/ff5b3d17e2.js +1 -0
- package/dist/styles/globals.css +442 -0
- package/dist/styles/themes.css +532 -0
- package/dist/styles/variables.css +299 -0
- package/package.json +68 -0
- package/static/assets/draco/README.md +32 -0
- package/static/assets/draco/draco_decoder.js +34 -0
- package/static/assets/draco/draco_decoder.wasm +0 -0
- package/static/assets/draco/draco_encoder.js +35 -0
- package/static/assets/draco/draco_encoder.wasm +0 -0
- package/static/assets/draco/draco_encoder_wrapper.js +98 -0
- package/static/assets/draco/draco_wasm_wrapper.js +117 -0
- package/static/favicon.svg +28 -0
- package/static/version.txt +1 -0
package/LICENSE.md
ADDED
|
@@ -0,0 +1,294 @@
|
|
|
1
|
+
PROPRIETARY SOFTWARE LICENCE
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 imagine.io. All rights reserved.
|
|
4
|
+
|
|
5
|
+
This software and its accompanying files (the "Software") are the confidential
|
|
6
|
+
and proprietary property of imagine.io. The Software is licensed, not sold.
|
|
7
|
+
|
|
8
|
+
1. GRANT. Subject to a separate written agreement with imagine.io ("Agreement"),
|
|
9
|
+
and only for the term and scope that Agreement states, you are granted a
|
|
10
|
+
non-exclusive, non-transferable, revocable right to install and use the
|
|
11
|
+
Software solely to build and operate your own application. Absent such an
|
|
12
|
+
Agreement, no rights are granted and any use is unauthorised.
|
|
13
|
+
|
|
14
|
+
2. RESTRICTIONS. You may not, in whole or in part: (a) copy, publish,
|
|
15
|
+
redistribute, sublicense, sell, rent, or lease the Software; (b) reverse
|
|
16
|
+
engineer, decompile, deobfuscate, or otherwise attempt to derive source code,
|
|
17
|
+
except to the extent this restriction is unenforceable under applicable law;
|
|
18
|
+
(c) modify, adapt, or create derivative works, including patching, hot-
|
|
19
|
+
patching, or runtime monkey-patching of the distributed files; (d) remove,
|
|
20
|
+
obscure, or alter any proprietary notice, attribution, watermark, licence
|
|
21
|
+
check, or integrity mechanism; (e) use the Software to build a product that
|
|
22
|
+
competes with imagine.io; or (f) permit any third party to do the foregoing.
|
|
23
|
+
|
|
24
|
+
3. NO OPEN SOURCE. Minification, bundling, or obfuscation of the distributed
|
|
25
|
+
files is a technical measure, not a grant. The absence of readable source
|
|
26
|
+
does not imply permission, and the presence of readable source does not
|
|
27
|
+
waive any restriction in Section 2.
|
|
28
|
+
|
|
29
|
+
4. OWNERSHIP. imagine.io retains all right, title, and interest in the Software,
|
|
30
|
+
including all intellectual property rights. No rights are granted by
|
|
31
|
+
implication, estoppel, or otherwise.
|
|
32
|
+
|
|
33
|
+
5. TERMINATION. This licence terminates automatically and immediately upon any
|
|
34
|
+
breach of Section 2, or upon termination of the Agreement. On termination you
|
|
35
|
+
must cease all use and destroy all copies.
|
|
36
|
+
|
|
37
|
+
6. NO WARRANTY. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
|
38
|
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
|
39
|
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, AND NONINFRINGEMENT.
|
|
40
|
+
|
|
41
|
+
7. LIMITATION OF LIABILITY. IN NO EVENT SHALL IMAGINE.IO BE LIABLE FOR ANY
|
|
42
|
+
CLAIM, DAMAGES, OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT,
|
|
43
|
+
OR OTHERWISE, ARISING FROM, OUT OF, OR IN CONNECTION WITH THE SOFTWARE OR THE
|
|
44
|
+
USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
45
|
+
|
|
46
|
+
8. THIRD-PARTY SOFTWARE. This package contains and depends on third-party
|
|
47
|
+
software licensed separately from this licence. That software remains subject
|
|
48
|
+
to its own terms, which this licence does not modify or override. Appendix A
|
|
49
|
+
gives the notice required by the one component redistributed inside this
|
|
50
|
+
package; Appendix B is the full text of the licence that component carries.
|
|
51
|
+
|
|
52
|
+
================================================================================
|
|
53
|
+
APPENDIX A — THIRD-PARTY NOTICE
|
|
54
|
+
================================================================================
|
|
55
|
+
|
|
56
|
+
One component requires attribution: it is the only third-party code shipped
|
|
57
|
+
INSIDE this package, so its licence terms bind us directly and the notice has to
|
|
58
|
+
travel with the package.
|
|
59
|
+
|
|
60
|
+
Nothing else is listed because nothing else is redistributed. The build compiles
|
|
61
|
+
each of our own files in place (bundle: false) and follows nothing, so no
|
|
62
|
+
dependency code is copied into dist/. Every dependency arrives in the consumer's
|
|
63
|
+
own node_modules carrying its own licence file, which is what satisfies its
|
|
64
|
+
terms — there is no obligation here for this file to discharge.
|
|
65
|
+
|
|
66
|
+
--------------------------------------------------------------------------------
|
|
67
|
+
GOOGLE DRACO
|
|
68
|
+
--------------------------------------------------------------------------------
|
|
69
|
+
|
|
70
|
+
static/assets/draco/ — the Draco decoder and encoder builds
|
|
71
|
+
(draco_decoder.js, draco_decoder.wasm, draco_encoder.js,
|
|
72
|
+
draco_encoder_wrapper.js, draco_wasm_wrapper.js), used to decompress
|
|
73
|
+
KHR_draco_mesh_compression geometry and to compress the AR export.
|
|
74
|
+
|
|
75
|
+
Project: https://github.com/google/draco
|
|
76
|
+
Copyright: The Draco Authors
|
|
77
|
+
Licence: Apache License, Version 2.0
|
|
78
|
+
|
|
79
|
+
A copy of the Apache License 2.0 is reproduced in Appendix B of this file, as
|
|
80
|
+
required by section 4(a) of that licence. You may not use these files except
|
|
81
|
+
in compliance with the License. Unless required by applicable law or agreed to
|
|
82
|
+
in writing, software distributed under the License is distributed on an
|
|
83
|
+
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
|
84
|
+
implied.
|
|
85
|
+
|
|
86
|
+
UNMODIFIED. These are prebuilt binaries vendored from a three.js distribution
|
|
87
|
+
(three/examples/jsm/libs/draco/); the accompanying README.md is Google's, word
|
|
88
|
+
for word, differing only where a repo-wide Markdown formatter changed bullet
|
|
89
|
+
characters and quote style. Every binary is byte-identical to the day it
|
|
90
|
+
entered version control — nothing here is a modified build, so the
|
|
91
|
+
statement-of-changes requirement in section 4(b) of the Apache License does
|
|
92
|
+
not arise. If a Draco build is ever rebuilt or patched, that changes and this
|
|
93
|
+
paragraph must be replaced with a description of the changes.
|
|
94
|
+
|
|
95
|
+
--------------------------------------------------------------------------------
|
|
96
|
+
MAINTAINING THIS APPENDIX
|
|
97
|
+
--------------------------------------------------------------------------------
|
|
98
|
+
|
|
99
|
+
What triggers an entry is a file being COPIED INTO this package from a
|
|
100
|
+
third-party project — not a dependency being added, which changes nothing here.
|
|
101
|
+
If a newly vendored component's licence requires its full text to be
|
|
102
|
+
distributed, that text goes into a further appendix of this file, as Apache-2.0
|
|
103
|
+
does in Appendix B.
|
|
104
|
+
|
|
105
|
+
|
|
106
|
+
================================================================================
|
|
107
|
+
APPENDIX B — APACHE LICENSE, VERSION 2.0
|
|
108
|
+
================================================================================
|
|
109
|
+
|
|
110
|
+
Reproduced in full for the component named in Appendix A. This licence applies
|
|
111
|
+
to that component ONLY, and grants no rights in the rest of the Software.
|
|
112
|
+
|
|
113
|
+
|
|
114
|
+
Apache License
|
|
115
|
+
Version 2.0, January 2004
|
|
116
|
+
http://www.apache.org/licenses/
|
|
117
|
+
|
|
118
|
+
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
|
119
|
+
|
|
120
|
+
1. Definitions.
|
|
121
|
+
|
|
122
|
+
"License" shall mean the terms and conditions for use, reproduction,
|
|
123
|
+
and distribution as defined by Sections 1 through 9 of this document.
|
|
124
|
+
|
|
125
|
+
"Licensor" shall mean the copyright owner or entity authorized by
|
|
126
|
+
the copyright owner that is granting the License.
|
|
127
|
+
|
|
128
|
+
"Legal Entity" shall mean the union of the acting entity and all
|
|
129
|
+
other entities that control, are controlled by, or are under common
|
|
130
|
+
control with that entity. For the purposes of this definition,
|
|
131
|
+
"control" means (i) the power, direct or indirect, to cause the
|
|
132
|
+
direction or management of such entity, whether by contract or
|
|
133
|
+
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
|
134
|
+
outstanding shares, or (iii) beneficial ownership of such entity.
|
|
135
|
+
|
|
136
|
+
"You" (or "Your") shall mean an individual or Legal Entity
|
|
137
|
+
exercising permissions granted by this License.
|
|
138
|
+
|
|
139
|
+
"Source" form shall mean the preferred form for making modifications,
|
|
140
|
+
including but not limited to software source code, documentation
|
|
141
|
+
source, and configuration files.
|
|
142
|
+
|
|
143
|
+
"Object" form shall mean any form resulting from mechanical
|
|
144
|
+
transformation or translation of a Source form, including but
|
|
145
|
+
not limited to compiled object code, generated documentation,
|
|
146
|
+
and conversions to other media types.
|
|
147
|
+
|
|
148
|
+
"Work" shall mean the work of authorship, whether in Source or
|
|
149
|
+
Object form, made available under the License, as indicated by a
|
|
150
|
+
copyright notice that is included in or attached to the work
|
|
151
|
+
(an example is provided in the Appendix below).
|
|
152
|
+
|
|
153
|
+
"Derivative Works" shall mean any work, whether in Source or Object
|
|
154
|
+
form, that is based on (or derived from) the Work and for which the
|
|
155
|
+
editorial revisions, annotations, elaborations, or other modifications
|
|
156
|
+
represent, as a whole, an original work of authorship. For the purposes
|
|
157
|
+
of this License, Derivative Works shall not include works that remain
|
|
158
|
+
separable from, or merely link (or bind by name) to the interfaces of,
|
|
159
|
+
the Work and Derivative Works thereof.
|
|
160
|
+
|
|
161
|
+
"Contribution" shall mean any work of authorship, including
|
|
162
|
+
the original version of the Work and any modifications or additions
|
|
163
|
+
to that Work or Derivative Works thereof, that is intentionally
|
|
164
|
+
submitted to Licensor for inclusion in the Work by the copyright owner
|
|
165
|
+
or by an individual or Legal Entity authorized to submit on behalf of
|
|
166
|
+
the copyright owner. For the purposes of this definition, "submitted"
|
|
167
|
+
means any form of electronic, verbal, or written communication sent
|
|
168
|
+
to the Licensor or its representatives, including but not limited to
|
|
169
|
+
communication on electronic mailing lists, source code control systems,
|
|
170
|
+
and issue tracking systems that are managed by, or on behalf of, the
|
|
171
|
+
Licensor for the purpose of discussing and improving the Work, but
|
|
172
|
+
excluding communication that is conspicuously marked or otherwise
|
|
173
|
+
designated in writing by the copyright owner as "Not a Contribution."
|
|
174
|
+
|
|
175
|
+
"Contributor" shall mean Licensor and any individual or Legal Entity
|
|
176
|
+
on behalf of whom a Contribution has been received by Licensor and
|
|
177
|
+
subsequently incorporated within the Work.
|
|
178
|
+
|
|
179
|
+
2. Grant of Copyright License. Subject to the terms and conditions of
|
|
180
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
181
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
182
|
+
copyright license to reproduce, prepare Derivative Works of,
|
|
183
|
+
publicly display, publicly perform, sublicense, and distribute the
|
|
184
|
+
Work and such Derivative Works in Source or Object form.
|
|
185
|
+
|
|
186
|
+
3. Grant of Patent License. Subject to the terms and conditions of
|
|
187
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
188
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
189
|
+
(except as stated in this section) patent license to make, have made,
|
|
190
|
+
use, offer to sell, sell, import, and otherwise transfer the Work,
|
|
191
|
+
where such license applies only to those patent claims licensable
|
|
192
|
+
by such Contributor that are necessarily infringed by their
|
|
193
|
+
Contribution(s) alone or by combination of their Contribution(s)
|
|
194
|
+
with the Work to which such Contribution(s) was submitted. If You
|
|
195
|
+
institute patent litigation against any entity (including a
|
|
196
|
+
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
|
197
|
+
or a Contribution incorporated within the Work constitutes direct
|
|
198
|
+
or contributory patent infringement, then any patent licenses
|
|
199
|
+
granted to You under this License for that Work shall terminate
|
|
200
|
+
as of the date such litigation is filed.
|
|
201
|
+
|
|
202
|
+
4. Redistribution. You may reproduce and distribute copies of the
|
|
203
|
+
Work or Derivative Works thereof in any medium, with or without
|
|
204
|
+
modifications, and in Source or Object form, provided that You
|
|
205
|
+
meet the following conditions:
|
|
206
|
+
|
|
207
|
+
(a) You must give any other recipients of the Work or
|
|
208
|
+
Derivative Works a copy of this License; and
|
|
209
|
+
|
|
210
|
+
(b) You must cause any modified files to carry prominent notices
|
|
211
|
+
stating that You changed the files; and
|
|
212
|
+
|
|
213
|
+
(c) You must retain, in the Source form of any Derivative Works
|
|
214
|
+
that You distribute, all copyright, patent, trademark, and
|
|
215
|
+
attribution notices from the Source form of the Work,
|
|
216
|
+
excluding those notices that do not pertain to any part of
|
|
217
|
+
the Derivative Works; and
|
|
218
|
+
|
|
219
|
+
(d) If the Work includes a "NOTICE" text file as part of its
|
|
220
|
+
distribution, then any Derivative Works that You distribute must
|
|
221
|
+
include a readable copy of the attribution notices contained
|
|
222
|
+
within such NOTICE file, excluding those notices that do not
|
|
223
|
+
pertain to any part of the Derivative Works, in at least one
|
|
224
|
+
of the following places: within a NOTICE text file distributed
|
|
225
|
+
as part of the Derivative Works; within the Source form or
|
|
226
|
+
documentation, if provided along with the Derivative Works; or,
|
|
227
|
+
within a display generated by the Derivative Works, if and
|
|
228
|
+
wherever such third-party notices normally appear. The contents
|
|
229
|
+
of the NOTICE file are for informational purposes only and
|
|
230
|
+
do not modify the License. You may add Your own attribution
|
|
231
|
+
notices within Derivative Works that You distribute, alongside
|
|
232
|
+
or as an addendum to the NOTICE text from the Work, provided
|
|
233
|
+
that such additional attribution notices cannot be construed
|
|
234
|
+
as modifying the License.
|
|
235
|
+
|
|
236
|
+
You may add Your own copyright statement to Your modifications and
|
|
237
|
+
may provide additional or different license terms and conditions
|
|
238
|
+
for use, reproduction, or distribution of Your modifications, or
|
|
239
|
+
for any such Derivative Works as a whole, provided Your use,
|
|
240
|
+
reproduction, and distribution of the Work otherwise complies with
|
|
241
|
+
the conditions stated in this License.
|
|
242
|
+
|
|
243
|
+
5. Submission of Contributions. Unless You explicitly state otherwise,
|
|
244
|
+
any Contribution intentionally submitted for inclusion in the Work
|
|
245
|
+
by You to the Licensor shall be under the terms and conditions of
|
|
246
|
+
this License, without any additional terms or conditions.
|
|
247
|
+
Notwithstanding the above, nothing herein shall supersede or modify
|
|
248
|
+
the terms of any separate license agreement you may have executed
|
|
249
|
+
with Licensor regarding such Contributions.
|
|
250
|
+
|
|
251
|
+
6. Trademarks. This License does not grant permission to use the trade
|
|
252
|
+
names, trademarks, service marks, or product names of the Licensor,
|
|
253
|
+
except as required for reasonable and customary use in describing the
|
|
254
|
+
origin of the Work and reproducing the content of the NOTICE file.
|
|
255
|
+
|
|
256
|
+
7. Disclaimer of Warranty. Unless required by applicable law or
|
|
257
|
+
agreed to in writing, Licensor provides the Work (and each
|
|
258
|
+
Contributor provides its Contributions) on an "AS IS" BASIS,
|
|
259
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
|
260
|
+
implied, including, without limitation, any warranties or conditions
|
|
261
|
+
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
|
262
|
+
PARTICULAR PURPOSE. You are solely responsible for determining the
|
|
263
|
+
appropriateness of using or redistributing the Work and assume any
|
|
264
|
+
risks associated with Your exercise of permissions under this License.
|
|
265
|
+
|
|
266
|
+
8. Limitation of Liability. In no event and under no legal theory,
|
|
267
|
+
whether in tort (including negligence), contract, or otherwise,
|
|
268
|
+
unless required by applicable law (such as deliberate and grossly
|
|
269
|
+
negligent acts) or agreed to in writing, shall any Contributor be
|
|
270
|
+
liable to You for damages, including any direct, indirect, special,
|
|
271
|
+
incidental, or consequential damages of any character arising as a
|
|
272
|
+
result of this License or out of the use or inability to use the
|
|
273
|
+
Work (including but not limited to damages for loss of goodwill,
|
|
274
|
+
work stoppage, computer failure or malfunction, or any and all
|
|
275
|
+
other commercial damages or losses), even if such Contributor
|
|
276
|
+
has been advised of the possibility of such damages.
|
|
277
|
+
|
|
278
|
+
9. Accepting Warranty or Additional Liability. While redistributing
|
|
279
|
+
the Work or Derivative Works thereof, You may choose to offer,
|
|
280
|
+
and charge a fee for, acceptance of support, warranty, indemnity,
|
|
281
|
+
or other liability obligations and/or rights consistent with this
|
|
282
|
+
License. However, in accepting such obligations, You may act only
|
|
283
|
+
on Your own behalf and on Your sole responsibility, not on behalf
|
|
284
|
+
of any other Contributor, and only if You agree to indemnify,
|
|
285
|
+
defend, and hold each Contributor harmless for any liability
|
|
286
|
+
incurred by, or claims asserted against, such Contributor by reason
|
|
287
|
+
of your accepting any such warranty or additional liability.
|
|
288
|
+
|
|
289
|
+
END OF TERMS AND CONDITIONS
|
|
290
|
+
|
|
291
|
+
|
|
292
|
+
================================================================================
|
|
293
|
+
|
|
294
|
+
For licensing enquiries: legal@imagine.io
|
package/README.md
ADDED
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
# @imagineio/configurator-sdk
|
|
2
|
+
|
|
3
|
+
Build a 3D product configurator and make it yours. One publishable engine — scene,
|
|
4
|
+
options, pricing, save/share, AR, AI chat — driven entirely by your backend: data
|
|
5
|
+
selects behavior, your code implements overrides through registries, and nothing
|
|
6
|
+
needs an SDK release to change.
|
|
7
|
+
|
|
8
|
+
## Install
|
|
9
|
+
|
|
10
|
+
The 3D stack (three / fiber / drei) is installed for you — npm 7+ adds the SDK's
|
|
11
|
+
peer packages automatically at the versions the SDK is built against, so your app
|
|
12
|
+
ends up with exactly one copy of `three`. Pin React 18 in the same command: a fresh
|
|
13
|
+
Vite template scaffolds React 19, which the SDK's 3D stack doesn't support yet
|
|
14
|
+
(`@react-three/fiber@8` requires React 18), so installing the SDK alone there
|
|
15
|
+
fails with `ERESOLVE`:
|
|
16
|
+
|
|
17
|
+
```bash
|
|
18
|
+
npm install @imagineio/configurator-sdk@beta react@^18.2 react-dom@^18.2
|
|
19
|
+
npm install -D @types/react@^18.3 @types/react-dom@^18.3 # the scaffold's are React 19's
|
|
20
|
+
```
|
|
21
|
+
|
|
22
|
+
(The second line matters even in a JavaScript project: create-vite scaffolds React 19
|
|
23
|
+
*types*, and pinning the runtime alone leaves them mismatched — no error, just wrong
|
|
24
|
+
autocomplete everywhere.)
|
|
25
|
+
|
|
26
|
+
Then either add the Vite plugin (recommended — serves the SDK's static assets and
|
|
27
|
+
dedupes three/react for you):
|
|
28
|
+
|
|
29
|
+
```js
|
|
30
|
+
// vite.config.js
|
|
31
|
+
import imagineConfigurator from '@imagineio/configurator-sdk/vite';
|
|
32
|
+
export default defineConfig({ plugins: [react(), imagineConfigurator()] });
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
…or follow the manual steps in the Getting Started guide.
|
|
36
|
+
|
|
37
|
+
```jsx
|
|
38
|
+
import { mount, config } from '@imagineio/configurator-sdk';
|
|
39
|
+
|
|
40
|
+
// The backend endpoint is built into the SDK — only the key is yours to set.
|
|
41
|
+
config.setApiKey('YOUR_ORG_API_KEY');
|
|
42
|
+
// systemId is REQUIRED — it names which configurator loads. Without it nothing does.
|
|
43
|
+
mount(document.getElementById('root'), { systemId: YOUR_SYSTEM_ID });
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
## Documentation
|
|
47
|
+
|
|
48
|
+
The full documentation site — Getting Started (install to a live configurator in
|
|
49
|
+
five steps), theming and UI customization, placement customization, the complete
|
|
50
|
+
function reference with runnable examples, the e-commerce bridge protocol, and
|
|
51
|
+
troubleshooting — is published by your imagine.io contact. No guides ship inside
|
|
52
|
+
this package.
|
|
53
|
+
|
|
54
|
+
## Requirements
|
|
55
|
+
|
|
56
|
+
Node ≥ 18, React 18, Vite (recommended). Peer deps (auto-installed by npm 7+):
|
|
57
|
+
`react`, `react-dom` (React 18 only — React 19 not supported yet), `three` 0.159,
|
|
58
|
+
`@react-three/fiber` 8, `@react-three/drei` 9. Everything else is installed as a
|
|
59
|
+
regular npm dependency — nothing third-party is bundled into the package itself.
|
|
60
|
+
|
|
61
|
+
**Strict CSP?** Two things load at runtime from Google, not from the package: the AR
|
|
62
|
+
viewer script (`https://ajax.googleapis.com`, overridable with `VITE_MODEL_VIEWER_SRC`
|
|
63
|
+
to self-host it) and theme fonts (`https://fonts.googleapis.com` +
|
|
64
|
+
`https://fonts.gstatic.com`, only when a theme names a Google font). Allow those hosts
|
|
65
|
+
in `script-src` / `style-src` / `font-src`, or point the override at your own origin.
|
|
66
|
+
|
|
67
|
+
## License
|
|
68
|
+
|
|
69
|
+
**Proprietary — licensed, not sold. Publicly downloadable is not the same as freely
|
|
70
|
+
usable.** This package is not open source. Being able to `npm install` it does not grant
|
|
71
|
+
a right to use it.
|
|
72
|
+
|
|
73
|
+
Summary, so you can see the terms before installing. This is a plain-English summary and
|
|
74
|
+
is not the licence; the full text in `LICENSE.md` governs.
|
|
75
|
+
|
|
76
|
+
**You need an agreement.** Rights are granted only under a separate written agreement
|
|
77
|
+
with imagine.io, for that agreement's term and scope. Without one, no rights are granted
|
|
78
|
+
and use is unauthorised.
|
|
79
|
+
|
|
80
|
+
**You may not:**
|
|
81
|
+
|
|
82
|
+
- copy, publish, redistribute, sublicense, sell, rent, or lease the package;
|
|
83
|
+
- reverse engineer, decompile, or deobfuscate it, or otherwise try to derive source
|
|
84
|
+
(except where that restriction is unenforceable by law);
|
|
85
|
+
- modify or create derivative works, including patching or runtime monkey-patching of
|
|
86
|
+
the distributed files;
|
|
87
|
+
- remove, obscure, or alter any proprietary notice, attribution, watermark, licence
|
|
88
|
+
check, or integrity mechanism;
|
|
89
|
+
- use it to build a product that competes with imagine.io;
|
|
90
|
+
- permit anyone else to do the above.
|
|
91
|
+
|
|
92
|
+
**Minification is not a grant.** The code ships minified as a technical measure. Unreadable
|
|
93
|
+
source does not imply permission, and readable source does not waive any restriction.
|
|
94
|
+
|
|
95
|
+
The licence terminates automatically on breach. The Software is provided "as is", without
|
|
96
|
+
warranty, and liability is limited — see `LICENSE.md` for those clauses in full.
|
|
97
|
+
|
|
98
|
+
Full text: `LICENSE.md`, shipped inside the package — readable at
|
|
99
|
+
`node_modules/@imagineio/configurator-sdk/LICENSE.md` after install. It also carries the
|
|
100
|
+
notice and Apache-2.0 text for the one third-party component redistributed here (Google
|
|
101
|
+
Draco).
|
|
102
|
+
|
|
103
|
+
**Want to use this?** Licensing enquiries: legal@imagine.io
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{jsx as H}from"react/jsx-runtime";import{useEffect as b,useRef as g,useState as E,useSyncExternalStore as S}from"react";import{useFrame as O}from"@react-three/fiber";import x from"./8f60e5059a.js";import{subscribeWatermark as I,getWatermarkShown as y,reportWatermarkTamper as k}from"./d3cd7f1bc1.js";import{noteWatermarkMissing as R,noteWatermarkPresent as W}from"./04931f795e.js";import{drawWatermarkOverlay as _,probeWatermarkPixels as A,renderWith as L,getWatermarkMetrics as T,getWatermarkPlacement as B,WATERMARK_RENDER_PRIORITY as C}from"./b59b0dde17.js";const P=5e3,M=3,N=400,v=2;function F(a,l,i,o){if(!a)return{bottom:0,left:0};const t=a.getBoundingClientRect();if(!(t.width>0)||!(t.height>0))return{bottom:0,left:0};const s={left:t.left+o,right:t.left+o+l,bottom:t.bottom-o,top:t.bottom-o-i};let e=0,n=0;for(const c of document.querySelectorAll("[data-sdk-overlay]")){const r=c.getBoundingClientRect();if(!(r.width>0)||!(r.height>0)||c.getAttribute("data-sdk-overlay")==="off")continue;const d=window.getComputedStyle(c);d.visibility==="hidden"||d.display==="none"||Number(d.opacity)===0||!(r.left<s.right&&r.right>s.left&&r.top<s.bottom&&r.bottom>s.top)||(e=Math.max(e,t.bottom-r.top+6),n=Math.max(n,r.right-t.left+6-o))}return!e&&!n?{bottom:0,left:0}:e<=n?{bottom:e,left:0}:{bottom:0,left:n}}function V(a,l){if(typeof document>"u"||typeof document.elementFromPoint!="function")return null;if(a&&l){const n=a.getBoundingClientRect();if(n.width>0&&n.height>0){const c=n.left+l.left+l.width/2,r=n.bottom-l.bottom-l.height/2;if(c>=0&&r>=0&&c<=window.innerWidth&&r<=window.innerHeight){const d=document.elementFromPoint(c,r),f=d===a||d?.classList?.contains("sdk-watermark-link");if(d&&!f)return"canvas-mark-covered"}}}const i=document.querySelector('[data-part="brand-mark"]');if(!i)return"brand-mark-missing";const o=i.getBoundingClientRect();if(!(o.width>0)||!(o.height>0))return"brand-mark-collapsed";const t=window.getComputedStyle(i);if(t.visibility==="hidden"||t.display==="none"||Number(t.opacity)<.5)return"brand-mark-hidden";const s=o.left+o.width/2,e=o.top+o.height/2;if(s>=0&&e>=0&&s<=window.innerWidth&&e<=window.innerHeight){const n=document.elementFromPoint(s,e);if(n&&n!==i&&!i.contains(n))return"brand-mark-covered"}return null}function z(){const[a,l]=E(()=>typeof window<"u"?window.innerWidth:1024);b(()=>{const s=()=>l(window.innerWidth);return window.addEventListener("resize",s),()=>window.removeEventListener("resize",s)},[]);const i=g({last:0,failures:0}),o=g(null);b(()=>{const e=setInterval(()=>{const n=x.getState();if(n.bootLoading||n.modalOpen||n.isLayoutLoading)return;const c=V(o.current,B());if(c){const r={reason:c};k(c,r),R(r)}else W()},P);return()=>clearInterval(e)},[]);const t=g({bottom:0,left:0,last:0});return O(s=>{const{gl:e,scene:n,camera:c,size:r,viewport:d,internal:f}=s;(f?.priority??1)-1<=0&&L(e,n,c),o.current=e.domElement;const p=d?.dpr||(typeof e.getPixelRatio=="function"?e.getPixelRatio():1)||1,m=Date.now();if(m-t.current.last>N){t.current.last=m;const u=T(e,a);if(u){const w=F(e.domElement,u.width,u.height,u.inset);(Math.abs(w.bottom-t.current.bottom)>v||Math.abs(w.left-t.current.left)>v)&&(t.current.bottom=w.bottom,t.current.left=w.left,i.current.failures=0)}}if(!_(e,{width:r.width,height:r.height,dpr:p,vw:a,avoid:t.current})||m-i.current.last<P)return;i.current.last=m;const h=A(e);if(h){if(h.ok){i.current.failures=0,W();return}if(i.current.failures+=1,i.current.failures>=M){const u={reason:"pixels",tri:h.tri,pill:h.pill,width:r.width,height:r.height,dpr:p};k("pixels",u),R(u)}}},C),null}function D(){return S(I,y,y)?H(z,{}):null}export{D as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
function l(r,o){const[a,c]=r.split(","),i=a.match(/:(.*?);/)[1],e=atob(c),n=new Uint8Array(e.length);for(let t=0;t<e.length;t++)n[t]=e.charCodeAt(t);return new File([n],o,{type:i})}export{l as dataUrlToFile};
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
@layer sdk-base, vendor, sdk;
|
|
2
|
+
@layer sdk {
|
|
3
|
+
/* Host-registered modals (ui.registerModal → ui.openModal).
|
|
4
|
+
*
|
|
5
|
+
* The host's component is the CONTENT; this is the dialog around it — backdrop, centring,
|
|
6
|
+
* themed panel — so a customer's dialog stacks, dims and dismisses like ours without them
|
|
7
|
+
* writing any of that. Restyle through the published parts:
|
|
8
|
+
* [data-part="modal"] the backdrop
|
|
9
|
+
* [data-part="modal/panel"] the panel
|
|
10
|
+
* Above the evaluating overlay (9999) and below notifications (10001), so a toast raised
|
|
11
|
+
* from inside a dialog is still readable. */
|
|
12
|
+
.sdk-modal {
|
|
13
|
+
position: fixed;
|
|
14
|
+
inset: 0;
|
|
15
|
+
z-index: 10000;
|
|
16
|
+
display: flex;
|
|
17
|
+
align-items: center;
|
|
18
|
+
justify-content: center;
|
|
19
|
+
padding: 24px;
|
|
20
|
+
background: rgba(0, 0, 0, 0.45);
|
|
21
|
+
/* Every dialog backdrop (ours, host-registered, quote, backend show_message) blurs the page
|
|
22
|
+
behind it by this much. 0 turns it off; the dimming stays. */
|
|
23
|
+
backdrop-filter: blur(var(--modal-backdrop-blur, 4px));
|
|
24
|
+
-webkit-backdrop-filter: blur(var(--modal-backdrop-blur, 4px));
|
|
25
|
+
animation: sdk-modal-in 0.15s ease-out;
|
|
26
|
+
}
|
|
27
|
+
.sdk-modal__panel {
|
|
28
|
+
position: relative;
|
|
29
|
+
box-sizing: border-box;
|
|
30
|
+
width: max-content;
|
|
31
|
+
min-width: min(320px, 100%);
|
|
32
|
+
max-width: min(560px, 100%);
|
|
33
|
+
max-height: calc(100vh - 48px);
|
|
34
|
+
overflow: auto;
|
|
35
|
+
padding: 24px;
|
|
36
|
+
background: var(--bg-primary, var(--color-surface, #ffffff));
|
|
37
|
+
color: var(--text-primary, var(--color-foreground, #1a1a1a));
|
|
38
|
+
font-family: var(--font-family-base, inherit);
|
|
39
|
+
border: 1px solid var(--border-default, var(--color-border, #e5e5e5));
|
|
40
|
+
border-radius: var(--radius-xl, 12px);
|
|
41
|
+
box-shadow: 0 24px 64px rgba(0, 0, 0, 0.25);
|
|
42
|
+
}
|
|
43
|
+
@keyframes sdk-modal-in {
|
|
44
|
+
from { opacity: 0; }
|
|
45
|
+
to { opacity: 1; }
|
|
46
|
+
}
|
|
47
|
+
@media (prefers-reduced-motion: reduce) {
|
|
48
|
+
.sdk-modal { animation: none; }
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{useEffect as i,useRef as s}from"react";import a from"./9c6c598569.js";import o from"./be337ddda5.js";import l from"./8f60e5059a.js";function p({onSeeded:r}={}){const c=a(t=>t.activeSceneConfigId),u=o(t=>t.defaultPresetId),f=o(t=>t.sceneConfigurations),e=c||u||Object.keys(f||{})[0]||null,n=s(null);return i(()=>{if(e!=null&&e!==n.current){n.current=e;try{l.setState({ownsSceneGraph:!0})}catch{}if(typeof r=="function")try{r()}catch{}}},[e,r]),null}export{p as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{authHeaders as f}from"./431a2d8618.js";import{getApiBaseUrl as m}from"./8ade32d067.js";import p from"./be337ddda5.js";const u="/api/v1/configurator/watermark-tamper/",d=2e4,i=3;let n=!1,e=0,o=null,a=null;function h(){if(typeof window>"u"||!window.location)return{hostname:null,url:null};try{const{origin:t,pathname:r,hostname:c}=window.location;return{hostname:c||null,url:`${t}${r}`}}catch{return{hostname:null,url:null}}}function w(){try{const t=p.getState()?.systemId;if(t==null||t==="")return null;const r=Number(t);return Number.isFinite(r)?r:t}catch{return null}}function l(){if(o!=null){try{clearInterval(o)}catch{}o=null}}function s(){if(!(e>=i||!n)){e+=1;try{const t=h(),r={event:"watermark_missing",reason:a?.reason||"pixels",occurrence:e,url:t.url,systemId:w(),embedded:typeof window<"u"&&window.parent!==window,detail:a||null,at:new Date().toISOString()};fetch(`${m()}${u}`,{method:"POST",headers:{"Content-Type":"application/json",...f(u)},body:JSON.stringify(r),keepalive:!0}).catch(()=>{})}catch{}e>=i&&l()}}function S(t=null){if(a=t,!n&&(n=!0,!(e>=i)&&(s(),o==null&&e<i)))try{o=setInterval(()=>{n?s():l()},d)}catch{}}function I(){n&&(n=!1,l())}function T(){n=!1,e=0,a=null,l()}function k(){return e}export{k as _getWatermarkReportCount,T as _resetWatermarkTamperReport,S as noteWatermarkMissing,I as noteWatermarkPresent};
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import{getLastMintError as f,hasTokenProvider as b}from"./33fa2c8ca2.js";const i={title:"This configurator isn\u2019t available right now.",body:"It hasn\u2019t finished being set up for this page. Please contact the store."},l={title:"This configurator isn\u2019t available right now.",body:"It has been turned off by its owner. Please contact the store if you were expecting to see it."},e=(t,o,s)=>({code:t,title:o.title,body:o.body,fix:s});function g(t,{reachable:o=null}={}){const s=t?.status,r=String(t?.code||""),d=String(t?.detail||t?.body?.error||t?.message||""),c=d.toLowerCase(),n=(...a)=>a.every(u=>c.includes(u));if(s===403)return r==="ORIGIN_NOT_ALLOWED"||n("restricted to specific")?e("domain-not-allowed",i,n("share link")?"This website is not on the share link\u2019s allowed domains. Open the link in the admin panel and add this site\u2019s domain, or clear the list to allow any site.":"This website is not on the API key\u2019s allowed origins. Add this site\u2019s domain under Settings \u2192 API Keys, or use a key issued for this site."):n("read-only")?n("session token")?e("read-only-token",i,"The session token is scoped `catalog` (read-only), so it can load and price a configuration but not save one. Mint a `session`-scoped token instead."):e("read-only-key",i,"This API key is read-only (those start `ck_ro_`), so it can load and price a configuration but not save projects or upload renders. Use a read & write key, or remove the save/export features from the page."):e("unavailable",l,"The backend refused with 403. The organisation behind this configurator is disabled or its subscription is not active \u2014 check the account in the imagine.io dashboard.");if(s===401){if(n("required")){const a=f();return b()&&a?e("token-endpoint-failed",i,`The \`getToken\` callback passed to mount() failed \u2014 ${a}. The SDK swallows a mint failure so a blip cannot kill a live page, so the request then went out with no credential. Check the endpoint is reachable from the browser, answers with { token, expiresIn }, and allows this origin.`):e("no-credential",i,"No credential reached the backend. Pass the organisation key with `config.setApiKey('ck_\u2026')` before mounting, or set `window.__configApiKey` from a script that runs before the bundle. Admin panel: Settings \u2192 API Keys.")}return n("revoked")?e("credential-revoked",i,"This API key has been revoked. Create a new one under Settings \u2192 API Keys and update the site with it."):n("not active")?e("unavailable",l,"The backend reports the organisation is not active. Check the account in the imagine.io dashboard."):n("session token")?e("session-token-rejected",i,"The backend rejected the session token. Check that your token endpoint mints it for THIS site\u2019s origin and system and that it has not expired \u2014 the SDK re-asks `getToken` automatically, so a stale token usually means the endpoint is returning a cached one."):n("share token")?e("share-link-invalid",{title:"This design link has expired.",body:"The saved design it points to is no longer available. Ask whoever shared it for an up-to-date link."},"The share token in the URL was rejected (deleted project, or a token from another environment)."):n("embed")&&n("disabled")?e("embed-link-disabled",i,"This embed link is switched off. Turn it back on in the admin panel under Scenes \u2192 Configurable Systems \u2192 Links."):n("embed slug")?e("embed-link-invalid",i,"The embed slug in the URL was not recognised. Check the link, or issue a new one under Scenes \u2192 Configurable Systems \u2192 Links."):e("credential-invalid",i,"The API key was rejected. Check it for typos or a stray space, and that it belongs to this environment \u2014 a staging key will not work against production. Admin panel: Settings \u2192 API Keys.")}if(s===404){if(n("not found in this org")||n("configurablesystem")){const a=/configurablesystem\s+(\d+)/i.exec(d)?.[1];return e("system-not-found",i,`The backend has no configurable system ${a?`with id ${a} `:""}in the organisation this credential belongs to. Either the id is wrong \u2014 check \`?system=\`, \`mount({ systemId })\` and the build's default \u2014 or the credential belongs to a different org than the system, which looks identical from here. The ids that do exist are listed in the admin panel under Scenes \u2192 Configurable Systems.`)}return e("endpoint-not-found",i,"The backend answered 404 for a boot request, so the server is up and this is the URL rather than the connection: check the API base URL points at the right server and includes `/api/v1`, and that the path kept its trailing slash \u2014 a slash-less path is answered with a redirect that is not repeated for an API call.")}return o===!0?e("domain-not-allowed-probable",i,"The backend is reachable but refused this page, which almost always means this website is not on the API key\u2019s allowed origins (or the share link\u2019s allowed domains). The browser hides the response, so check the Network tab for a blocked request \u2014 it will show `403 ORIGIN_NOT_ALLOWED`. Add this domain under Settings \u2192 API Keys."):e("network",{title:"We couldn\u2019t load the configurator.",body:"Check your internet connection and try again."},"No response from the configurator backend. Check the API URL is correct and the server is running, and that no ad blocker or corporate proxy is blocking it.")}let h=!1;function p(t,o){if(!(h||!t)){h=!0;try{console.error(`[imagine.io SDK] the configurator could not start \u2014 ${t.code}
|
|
2
|
+
${t.fix}
|
|
3
|
+
Shopper sees: \u201C${t.title} ${t.body}\u201D`,o||"")}catch{}}}function y(){h=!1}async function m(t,{timeoutMs:o=5e3}={}){if(typeof fetch!="function")return null;const s=String(t||"").replace(/\/+$/,"");if(!s)return null;const r=new AbortController,d=setTimeout(()=>r.abort(),o);try{return await fetch(`${s}/api/v1/configurator/status/`,{method:"GET",signal:r.signal}),!0}catch{return!1}finally{clearTimeout(d)}}export{y as _resetIntegratorWarning,g as describeBootFailure,m as probeBackendReachable,p as warnIntegrator};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
function n(e){return e?e.hosted===!0||e.is_hosted===!0?!0:e.hosted===!1||e.is_hosted===!1?!1:String(e.category||e.categoryName||"").toLowerCase()==="appliance":!1}function o(e){return e?.hostFloating===!0||e?.host_floating===!0?!0:String(e?.placementType??e?.placement_type??"").toLowerCase()==="wall_mounted"}function r(e){return e?.type??e?.componentType??e?.component_type??null}function i(e){const t=e?.lockVariantId??e?.lock_variant_id??null;return t==null||t===""?null:String(t)}export{o as isHostFloating,n as isHostedProduct,r as resolveComponentType,i as resolveLockVariantId};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{themeLayoutKey as d}from"./5c9fd9201c.js";import n from"./8f60e5059a.js";import m from"./872c4302e0.js";import a from"./be337ddda5.js";function f(){const t=n(e=>e.bootLoading),r=n(e=>e.bootDetail),s=n(e=>e.bootProgress),o=n(e=>e.themeReady),i=m(e=>e.isLoading),c=a(e=>e.isLoading);return{loading:!!t,detail:r??null,progress:s??null,themeReady:!!o,catalogLoading:!!i,configLoading:!!c,ready:!i&&!c}}function p(){try{n.getState().endBootLoading?.()}catch{}}function h(){const t=a(o=>o.systemId),r=a(o=>o.systemName),s=a(o=>o.systemConfiguratorKey);return{id:t??null,name:r??null,configuratorKey:s??null}}function L(){try{n.setState(t=>t.themeReady?t:{themeReady:!0})}catch{}}function S(t){try{n.setState({embedded:!!t})}catch{}}function b(t){try{a.setState({systemTheme:d(t),systemThemeRecord:t&&typeof t=="object"?t:null})}catch{}}export{p as endBootLoading,L as markThemeReady,S as setEmbedded,b as setSystemTheme,f as useBootStatus,h as useSystem};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{jsx as M}from"react/jsx-runtime";import{useSyncExternalStore as y,useRef as A,useEffect as w}from"react";import l from"./8f60e5059a.js";import{runIntent as v,INTENTS as O}from"./6d238282c1.js";import"./01a664fa9f.css";const r=new Map,i=new Map,a=new Map;let S=0;const m=new Set;function s(){S+=1;for(const e of m)try{e()}catch{}}const c=e=>typeof e=="string"?e.trim():"",g=e=>c(e).toLowerCase();function _(e){return m.add(e),()=>{m.delete(e)}}const u=()=>S;function V(e,t){const n=c(e);return!n||typeof t!="function"?()=>{}:P.has(n)?()=>{}:(r.set(n,t),s(),()=>{r.get(n)===t&&(r.delete(n),s())})}const P=new Set(["selectOption","addPiece","deleteSelected","duplicateSelected","changeLayout","undo","redo","resetScene","openModal","closeModal","saveProject","loadProject"]);function D(e,...t){const n=r.get(c(e));if(n)return v({type:`action.${c(e)}`,args:t},()=>n(...t))}function j(){return Array.from(r.keys())}const $=new Proxy({},{get:(e,t)=>typeof t=="string"&&r.has(t)?(...n)=>D(t,...n):void 0,has:(e,t)=>r.has(t),ownKeys:()=>Array.from(r.keys()),getOwnPropertyDescriptor:()=>({enumerable:!0,configurable:!0})});function q(e,t){const n=g(e);return!n||typeof t!="function"?()=>{}:(i.set(n,t),s(),()=>{i.get(n)===t&&(i.delete(n),s())})}function H(e,t){const n=g(e);return n&&i.get(n)||t}function z(){return Array.from(i.keys())}function B(e,t){return y(_,u,u),H(e,t)}function N(e){const t=g(e);return!!t&&i.has(t)}function F(e){return y(_,u,u),N(e)}function G(e,t){const n=c(e);return!n||typeof t!="function"?()=>{}:(a.set(n,t),s(),()=>{a.get(n)===t&&(a.delete(n),s())})}function J(){return Array.from(a.keys())}let d=null;function L(e){d===null&&(d=e,s())}function b(e){d===e&&(d=null,s())}function Q(){const e=A({}).current;y(_,u,u),w(()=>(L(e),()=>b(e)),[e]);const t=d===e,n=l(o=>o.activeModal),E=l(o=>o.modalOpen),I=l(o=>o.modalData),f=l(o=>o.closeModal),x=E&&n?a.get(c(n)):null,p=t&&!!x;if(w(()=>{if(!p||typeof document>"u")return;const o=h=>{h.key==="Escape"&&f?.()};return document.addEventListener("keydown",o),()=>document.removeEventListener("keydown",o)},[p,f]),!p)return null;const k=()=>f?.();return M("div",{className:"sdk-modal","data-part":"modal",role:"presentation",onMouseDown:o=>{o.target===o.currentTarget&&k()},children:M("div",{className:"sdk-modal__panel","data-part":"modal/panel",role:"dialog","aria-modal":"true",children:M(x,{data:I,close:k})})})}function W(e,t=null){return v({type:O.MODAL_OPEN,key:c(e),data:t},()=>l.getState().openModal?.(c(e),t))}function X(){r.clear(),i.clear(),a.clear(),s()}export{Q as ModalHost,X as _resetUiRegistry,$ as actions,N as hasIcon,j as listActions,z as listIcons,J as listModals,W as openModal,V as registerAction,q as registerIcon,G as registerModal,H as resolveIcon,D as runAction,F as useHasIcon,B as useIcon};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import i from"node:fs";import t from"node:path";import{fileURLToPath as h}from"node:url";const g=["three","react","react-dom","@react-three/fiber","@react-three/drei","zustand"],j={".js":"text/javascript",".mjs":"text/javascript",".wasm":"application/wasm",".svg":"image/svg+xml",".json":"application/json",".txt":"text/plain",".md":"text/markdown"};function v(){const o=t.dirname(h(import.meta.url)),n=[t.resolve(o,"static"),t.resolve(o,"..","static")];return n.find(r=>i.existsSync(r))||n[0]}function y(o,n=""){let r=[],c=[];try{c=i.readdirSync(o,{withFileTypes:!0})}catch{return r}for(const s of c){const e=n?`${n}/${s.name}`:s.name;s.isDirectory()?r=r.concat(y(t.join(o,s.name),e)):r.push(e)}return r}function S(o={}){const{copyAssets:n=!0,dedupe:r=!0}=o,c=v();let s="dist";return{name:"imagine-configurator-sdk",config(){return r?{resolve:{dedupe:g}}:null},configResolved(e){s=t.resolve(e.root,e.build.outDir)},configureServer(e){if(!n)return;const a=e.config.publicDir;e.middlewares.use((m,d,u)=>{const f=decodeURIComponent((m.url||"").split("?")[0]),l=t.normalize(t.join(c,f));if(!l.startsWith(c+t.sep))return u();let p=null;try{p=i.statSync(l)}catch{return u()}if(!p.isFile())return u();try{if(a&&i.existsSync(t.join(a,f)))return u()}catch{}d.setHeader("Content-Type",j[t.extname(l).toLowerCase()]||"application/octet-stream"),i.createReadStream(l).pipe(d)})},closeBundle(){if(n)for(const e of y(c)){const a=t.join(s,e);try{if(i.existsSync(a))continue;i.mkdirSync(t.dirname(a),{recursive:!0}),i.copyFileSync(t.join(c,e),a)}catch{}}}}}export{S as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
let d={};function i(n){d={...n||{}}}function o(n,t={}){const e={embedded:typeof window<"u"&&window.parent!==window,context:typeof window<"u"&&window.parent!==window?"embedded":"standalone",...d,...t};try{if(typeof window>"u")return;window.analytics?.track?window.analytics.track(n,e):window.mixpanel?.track&&window.mixpanel.track(n,e)}catch{}}export{i as setEmbedContext,o as trackEmbed};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
function u(t,{timeoutMs:r=3e4}={}){return new Promise(a=>{if(!t||typeof Image>"u"){a(!1);return}let n=!1;const e=f=>{n||(n=!0,clearTimeout(s),a(f))},o=new Image;o.onload=()=>e(!0),o.onerror=()=>e(!1);const s=setTimeout(()=>e(!1),r);o.src=t})}async function c(t,{attempts:r=3,timeoutMs:a=3e4,delayMs:n=700}={}){for(let e=0;e<r;e++){if(await u(t,{timeoutMs:a}))return!0;e<r-1&&await new Promise(o=>setTimeout(o,n*(e+1)))}return!1}async function l(t,{attempts:r=3,delayMs:a=400}={}){if(!t||typeof fetch!="function")return null;for(let n=1;n<=r;n+=1)try{const e=await fetch(t);if(!e.ok)throw new Error(`${e.status} ${e.statusText}`);const o=await e.blob();if(!o||o.size===0)throw new Error("empty body");return await new Promise((s,f)=>{const i=new FileReader;i.onload=()=>s(i.result),i.onerror=f,i.readAsDataURL(o)})}catch{if(n===r)return null;await new Promise(e=>setTimeout(e,a*n))}return null}async function w(t){const r=await l(t,{attempts:1});return await c(r||t),r}const m=3;export{m as CARD_LOAD_RETRIES,w as captureAndWarm,l as imageAsDataUrl,u as loadImageOnce,c as preloadImage};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{jsx as r,jsxs as t}from"react/jsx-runtime";const q=new Set(["ar","pdf"]);import{useLabels as N}from"./28d887bf8a.js";function b({images:o,pending:f=!0,title:s,max:a,types:n,className:_=""}){const m=N(),i=s===void 0?m("quote.renders","Renders"):s,y=o?.images??[],d=Array.isArray(n)&&n.length?new Set(n):null,l=e=>e&&!q.has(e.type)&&(!d||d.has(e.type)),c=(o?.ready??[]).filter(l),u=typeof a=="number"?c.slice(0,a):c,g=f?y.filter(e=>l(e)&&e.status==="generating"):[];return!u.length&&!g.length?null:t("section",{className:`quote-doc__renders ${_}`.trim(),"data-part":"quote/renders",children:[i&&r("h3",{className:"quote-doc__renders-title",children:i}),t("div",{className:"quote-doc__render-grid",children:[u.map(e=>t("figure",{className:"quote-doc__render","data-part":"quote/render",children:[r("img",{src:e.url,alt:e.label??e.type,loading:"lazy",onError:h=>{const p=h.currentTarget.closest("figure");p&&(p.style.display="none")}}),e.label&&r("figcaption",{children:e.label})]},e.id)),g.map(e=>t("figure",{className:"quote-doc__render quote-doc__render--pending","data-part":"quote/render",children:[t("span",{className:"quote-doc__render-pending",children:[e.progress??0,"%"]}),t("figcaption",{children:[e.label??e.type," \u2014 generating\u2026"]})]},e.id))]})]})}export{b as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
const i=Object.freeze(["item","sku","options","qty","unit","total"]),l=Object.freeze({company:null,logoUrl:null,accent:null,customer:null,reference:null,notes:null,terms:null,title:null,columns:Object.freeze(["item","options","qty","total"]),images:Object.freeze({max:void 0,types:void 0,pending:!0,title:"Renders"}),arQr:!0,arQrLabel:"Scan to view in your room",showSceneSelections:!0,dateFormat:void 0});let n=null;const u=new Set,a=()=>{for(const e of[...u])try{e()}catch{}};function m(e){if(!e||typeof e!="object")return null;const t={...l,...e};if(e.columns!==void 0){const o=Array.isArray(e.columns)?e.columns.map(String):[],f=o.filter(r=>!i.includes(r)),c=o.filter(r=>i.includes(r));t.columns=c.length?c:l.columns}return t.images={...l.images,...e.images&&typeof e.images=="object"?e.images:{}},t.accent!=null&&!/^#|^rgb|^hsl|^var\(/.test(String(t.accent))&&(t.accent=null),t}function g(e){const t=m(e);if(!t)return()=>{};const o=n;return n=t,a(),()=>{n===t&&(n=o,a())}}function s(){return n??l}function d(){return n!==null}function b(){n=null,a()}function p(e){return u.add(e),()=>u.delete(e)}const y=Object.freeze({item:{label:"Item",align:"left",value:e=>e.name??e.placementId},sku:{label:"SKU",align:"left",value:e=>e.sku??""},options:{label:"Options",align:"left",value:e=>e.selections.length?e.selections.map(t=>`${t.setName}: ${t.optionName}`).join(", "):"\u2014"},qty:{label:"Qty",align:"right",value:e=>String(e.qty??1)},unit:{label:"Unit",align:"right",value:e=>e.unitPriceFormatted??"\u2014"},total:{label:"Total",align:"right",value:e=>e.lineTotalFormatted??"\u2014"}});function S(e,t=s()){return t.title??e?.system?.name??"Configuration"}function x(e,t=s()){try{return new Date(e.quotedAt).toLocaleDateString(void 0,t.dateFormat)}catch{return""}}export{y as COLUMN_DEFS,i as QUOTE_COLUMNS,s as getQuoteDocument,d as hasQuoteDocument,x as quoteDate,S as quoteHeading,b as resetQuoteDocument,g as setQuoteDocument,p as subscribeQuoteDocument};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{useMemo as f}from"react";import s from"./872c4302e0.js";import g from"./9c6c598569.js";import{sceneOptionSetsFrom as I,productOptionSetsFrom as P,optionsForSetFrom as y,readOptionSetInputs as a}from"./4a99ddb3fd.js";function c(t){if(t==null||typeof t!="object")return t;let n;try{n=structuredClone(t)}catch{try{n=JSON.parse(JSON.stringify(t))}catch{return null}}const e=r=>r==null||typeof r!="object"||Object.isFrozen(r)?r:(Object.values(r).forEach(e),Object.freeze(r));return e(n)}const d=new Set;function _(t,n){if(!import.meta.env?.DEV)return;const e=`${t}:${n}`;d.has(e)||(d.add(e),Object.keys(s.getState().products||{}).length)}let p=null,m=null;function S(t,n){if(m!==t||!p){const e=new Map;for(const[r,u]of Object.entries(t||{})){const o=u?.productGraph??u?.product_graph??u?.productGraphId??null;if(o==null)continue;const l=String(o);e.has(l)||e.set(l,[]),e.get(l).push(r)}for(const r of e.values())r.sort((u,o)=>{const l=t[u],i=t[o],b=l?.isDefault??l?.is_default?0:1,x=i?.isDefault??i?.is_default?0:1;return b-x||Number(u)-Number(o)||String(u).localeCompare(String(o))});p=e,m=t}return p.get(String(n))||null}const h=new Set;function N(t,n){!import.meta.env?.DEV||h.has(String(t))||h.add(String(t))}function G(t){if(t==null)return null;const n=s.getState();let e=n.getProduct?.(t)??n.products?.[t]??n.products?.[String(t)]??null;if(!e){const r=n.productsByRef?.[String(t).toLowerCase()];r!=null&&(e=n.products?.[r]??n.products?.[String(r)]??null)}if(!e){const r=S(n.products,t);r?.length&&(e=n.products?.[r[0]]??null,e&&N(t,r))}return e?c(e):(_("getProduct",t),null)}function j(t){if(t==null)return[];const n=s.getState().products||{};return(S(n,t)||[]).map(r=>c(n[r])).filter(Boolean)}function w(t,n=null){const e=G(t),r=e&&typeof e.name=="string"?e.name.trim():"";return r||(n??null)}function v(t,n=null){if(t==null)return n??null;const e=g.getState().productInstances?.[String(t)]??null;return e?w(e.variantId??e.productId,n):n??null}function A(t){if(t==null)return null;const n=s.getState().features||{},e=n[t]??n[String(t)]??null;return e?c(e):null}function B(t){if(t==null)return null;const n=s.getState().options||{},e=n[t]??n[String(t)]??null;return e?c(e):null}function D(){const t=s.getState().products||{},n=new Map,e=[];for(const[u,o]of Object.entries(t)){if(!o)continue;const l=o.productGraph??o.product_graph??o.productGraphId??null;if(l==null){e.push(u);continue}const i=String(l);n.has(i)||n.set(i,[]),n.get(i).push(u)}const r=[];for(const[u]of n){const o=j(u);o.length&&r.push({id:O(u),name:o[0]?.name??null,variants:o})}for(const u of e){const o=c(t[u]);o&&r.push({id:o.id??O(u),name:o.name??null,variants:[o]})}return r.sort((u,o)=>String(u.name??"").localeCompare(String(o.name??"")))}function O(t){const n=Number(t);return Number.isFinite(n)&&String(n)===String(t)?n:t}const E=(t,n)=>Number(t?.sequence??Number.MAX_SAFE_INTEGER)-Number(n?.sequence??Number.MAX_SAFE_INTEGER);function H(){const t=s.getState().features||{};return Object.values(t).filter(Boolean).sort(E).map(c)}function q(){return I(a(null)).map(c)}function z(t){const n=a(t);return n.scopeId==null?[]:P(n).map(c)}function R(t,{placementId:n=null}={}){if(t==null)return[];const e=a(n),r=e.features[t]??e.features[String(t)]??null;return r?y(r,e).map(c):[]}function V(){const t=s.getState().materials||{};return Object.values(t).filter(Boolean).map(c)}function J(t){if(t==null)return null;const n=s.getState().materials||{},e=n[t]??n[String(t)]??null;return e?c(e):null}function L(){const t=s.getState();return{products:t.products||{},features:t.features||{},options:t.options||{},materials:t.materials||{},getProduct:n=>t.getProduct?.(n)??t.products?.[n]??t.products?.[String(n)]??null,getHostedProduct:n=>t.getHostedProduct?.(n)??null,listHostedProducts:()=>t.getHostedProductsList?.()??[]}}function T(){const t=s(r=>r.options),n=s(r=>r.materials),e=s(r=>r.features);return f(()=>({options:t||{},materials:n||{},optionSets:e||{},features:e||{}}),[t,n,e])}function X(t){const n=s(r=>r.products),e=g(r=>r.productInstances);return f(()=>{if(t==null)return null;const r=String(t),u=e?.[r];if(u){const l=n?.[u.variantId]??n?.[u.productId]??null;return c({placementId:r,...u,product:l??null})}const o=n?.[t]??n?.[r]??null;return o?c(o):null},[n,e,t])}export{L as getCatalog,J as getMaterial,B as getOption,A as getOptionSet,v as getPlacedProductName,G as getProduct,w as getProductName,j as getProductVariants,V as listMaterials,H as listOptionSets,R as listOptions,z as listProductOptionSets,D as listProducts,q as listSceneOptionSets,T as useCatalogMaps,X as useProduct};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{useEffect as L,useRef as y}from"react";import{useFrame as w,useThree as D}from"@react-three/fiber";import*as _ from"three";import s from"./9c6c598569.js";const x=4,A=.02,C=.004,G=.25,P=2,c=new _.Vector3,u=new _.Vector3;function I({controlsRef:n}){const{camera:o,gl:F,invalidate:p}=D(),m=y(!1),d=y({target:null,elapsed:0,stalled:0,lastGap:1/0});return L(()=>(s.getState().isFocusing&&p(),s.subscribe((t,e)=>{t.isFocusing&&!e?.isFocusing&&p()})),[p]),L(()=>{let r=null;const t=()=>{clearTimeout(r),r=setTimeout(()=>{s.getState().isFocusing&&s.getState().clearFocus()},5e3)};s.getState().isFocusing&&t();const e=s.subscribe((g,a)=>{g.isFocusing&&!a?.isFocusing&&t(),!g.isFocusing&&a?.isFocusing&&clearTimeout(r)});return()=>{clearTimeout(r),e()}},[]),L(()=>{const r=F.domElement,t=()=>{s.getState().isFocusing&&(m.current=!0)};return r.addEventListener("pointerdown",t),r.addEventListener("wheel",t),r.addEventListener("touchstart",t),()=>{r.removeEventListener("pointerdown",t),r.removeEventListener("wheel",t),r.removeEventListener("touchstart",t)}},[F]),w((r,t)=>{const{focusTarget:e,isFocusing:g,clearFocus:a,setCameraPosition:f,setCameraTarget:E}=s.getState();if(!e||!g)return;if(d.current.target!==e&&(d.current={target:e,elapsed:0,stalled:0,lastGap:1/0}),c.set(...e.position),u.set(...e.target),e.instant){o.position.copy(c),n?.current&&(n.current.target.copy(u),n.current.update()),f([...e.position]),E([...e.target]),a();return}if(m.current){m.current=!1;const S=o.position,l=n?.current?.target;f([S.x,S.y,S.z]),l&&E([l.x,l.y,l.z]),a();return}const v=1-Math.exp(-x*t);o.position.lerp(c,v),n?.current&&(n.current.target.lerp(u,v),n.current.update());const T=o.position.distanceTo(c),h=n?.current?n.current.target.distanceTo(u):0,b=Math.max(T,h),i=d.current;if(i.elapsed+=t,i.stalled=Math.abs(i.lastGap-b)<C*t*60?i.stalled+t:0,i.lastGap=b,T<A&&h<A||i.stalled>G||i.elapsed>P){o.position.copy(c),n?.current&&(n.current.target.copy(u),n.current.update()),f([...e.position]),E([...e.target]),a();return}p()}),null}var V=I;export{V as default};
|