@perceptimagery/dita-configurator-staging 0.2.1307 → 0.3.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/dist/index.js +1147 -817
- package/package.json +2 -2
package/dist/index.js
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
try {
|
|
5
5
|
if (typeof document != "undefined") {
|
|
6
6
|
var elementStyle = document.createElement("style");
|
|
7
|
-
elementStyle.appendChild(document.createTextNode("@import url('https://fonts.googleapis.com/css2?family=Work+Sans:wght@200;300;400;500;600;700;800&display=swap');\n\n#Sprie-config-html,\n#Sprie-config-body {\n width: 100%;\n height: 100%;\n margin: 0;\n padding: 0;\n font-family: 'Work Sans', sans-serif;\n box-sizing: border-box;\n}\n\n#Sprie-config-body * {\n box-sizing: border-box;\n}\n\n.sprie-config-loadingBox {\n position: fixed;\n width: 100%;\n height: 100%;\n display: flex;\n align-items: center;\n justify-content: center;\n text-align: center;\n font-size: 24px;\n font-weight: 500;\n z-index: 1000;\n background: #f2f2f2;\n}\n.my-btn {\n border: 1px solid gray;\n border-radius: 5px;\n padding: 5px 10px;\n cursor: pointer;\n transition: all 300ms ease-in;\n}\n\n.my-btn:hover {\n box-shadow: 0 0 2px 3px gray;\n}\n.my-panel {\n border: 1px solid gray;\n padding: 10px 20px;\n border-radius: 10px;\n margin: 10px auto;\n}\n\n.my-panel h3 {\n font-family: sans-serif;\n}\n#Sprie-config-Main-Container {\n width: 100%;\n height: 100%;\n display: flex;\n flex-direction: column-reverse;\n background: #ffffff;\n}\n\n#Sprie-config-Viewer-Container {\n width: 100%;\n position: relative;\n height: 100%;\n}\n\n#holder-canvas > canvas {\n width: 100%;\n height: 100%;\n}\n\n#Sprie-config-Checkout-Container {\n width: 100%;\n height: min(70%, 45rem);\n}\n\n#Sprie-config-Checkout-box {\n width: 100%;\n background: #efefef;\n padding: 1rem;\n min-height: 100%;\n display: flex;\n flex-direction: column;\n justify-content: center;\n}\n\n#Sprie-config-Checkout-header {\n right: 0;\n display: flex;\n flex-direction: column;\n width: 100%;\n justify-content: center;\n align-items: center;\n gap: 1rem;\n padding-bottom: 0.9rem;\n border-bottom: 1px solid #ccc;\n margin-bottom: 2.5rem;\n}\n\n#Sprie-config-Checkout-header #Sprie-config-frameName {\n color: #222;\n font-size: 1.375rem;\n font-weight: 400;\n line-height: 1.5275rem; /* 111.091% */\n letter-spacing: -0.05rem;\n text-transform: uppercase;\n}\n\n#Sprie-config-Checkout-header #Sprie-config-lensPrice {\n color: #222;\n font-size: 1.3125rem;\n font-weight: 400;\n line-height: 2.275rem; /* 173.333% */\n}\n\n#Sprie-config-Checkout-body {\n display: flex;\n flex-direction: column;\n}\n\n#Sprie-config-Dropdown-Container {\n flex-direction: column;\n gap: 1.5rem;\n}\n\n#Sprie-config-Checkout-button {\n display: flex;\n padding: 0rem 1.25rem;\n align-items: center;\n justify-content: center;\n width: 100%;\n background: #222;\n color: #fff;\n text-align: center;\n font-size: 0.875rem;\n font-weight: 600;\n line-height: 3.5rem; /* 400% */\n letter-spacing: 0.125rem;\n text-transform: uppercase;\n cursor: pointer;\n margin-top: 6rem;\n}\n\n.sprie-config-loadingFrame {\n position: absolute;\n width: 100%;\n height: 100%;\n display: flex;\n align-items: center;\n justify-content: center;\n text-align: center;\n fontsize: 24px;\n font-weight: 500;\n z-index: 1000;\n background: #f2f2f2;\n opacity: 0.8;\n}\n\n.sprie-config-loader {\n border: 8px solid #f3f3f3; /* Light grey */\n border-top: 8px solid #222222; /* Blue */\n border-radius: 50%;\n width: 60px;\n height: 60px;\n animation: spin 1.5s linear infinite;\n}\n\n@keyframes spin {\n 0% {\n transform: rotate(0deg);\n }\n 100% {\n transform: rotate(360deg);\n }\n}\n\n/* Breakpoints */\n@media (max-width : 576px) {\n\n #Sprie-config-Viewer-Container {\n width: 100%;\n height: min(30%, 20rem);\n }\n\n #Sprie-config-Viewer-Container .sprie-config-webgl {\n height: 99%;\n }\n\n}\n\n@media (min-width: 800px) {\n #Sprie-config-Main-Container {\n flex-direction: row-reverse;\n }\n\n #Sprie-config-Checkout-Container {\n width: auto;\n padding: 2.5rem;\n height: 100%;\n }\n\n #Sprie-config-Checkout-box {\n width: 350px;\n padding: 1.5rem;\n height: 100%;\n display: flex;\n flex-direction: column;\n justify-content: center;\n }\n\n #Sprie-config-Dropdown-Container {\n gap: 2.5rem;\n }\n\n #Sprie-config-Viewer-Container .sprie-config-webgl {\n height: 99%;\n }\n}\n\n@media (min-width: 992px) {\n #Sprie-config-Checkout-box {\n width: 450px;\n padding: 2.5rem;\n height: 100%;\n display: flex;\n flex-direction: column;\n justify-content: center;\n }\n}\n/* Dropdown.css */\n\n.sprie-config-label {\n color: rgba(34, 34, 34, 0.7);\n font-size: 0.75rem;\n font-weight: 400;\n letter-spacing: 0.02813rem;\n margin-bottom: 0.5rem;\n display: flex;\n align-items: center;\n margin-left: 0.1rem;\n}\n\n.sprie-config-dropdown-wrapper {\n position: relative;\n width: 100%;\n}\n\n.sprie-config-select-box {\n cursor: pointer;\n display: flex;\n align-items: center;\n justify-content: space-between;\n padding: 10px;\n /* border: 1px solid #ccc; */\n border-radius: 5px;\n position: relative;\n user-select: none;\n width: 100%;\n box-sizing: border-box;\n transition: border-radius 0.3s ease;\n padding: 1rem 1.25rem;\n background-color: #ffffff;\n max-height: 17rem; /* Set the fixed height for the dropdown */\n overflow-y: auto;\n}\n\n.sprie-config-select-box.sprie-config-open {\n border-bottom-right-radius: 0;\n border-bottom-left-radius: 0;\n}\n\n.sprie-config-selected-option {\n flex: 1;\n}\n\n.sprie-config-arrow {\n margin-left: 10px;\n transition: transform 0.3s ease;\n}\n\n.sprie-config-arrow.sprie-config-up {\n transform: rotate(180deg);\n}\n\n.sprie-config-dropdown-options {\n list-style: none;\n margin: 0;\n padding: 0;\n position: absolute;\n top: 100%;\n left: 0;\n width: 100%;\n z-index: 1;\n background-color: #fff;\n border-top: 1px solid #ccc;\n border-radius: 0 0 5px 5px;\n box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);\n opacity: 0;\n visibility: hidden;\n overflow: hidden;\n transition: height 0.3s ease, opacity 0.3s ease, visibility 0.3s ease;\n max-height: 17rem; /* Set the fixed height for the dropdown */\n overflow-y: auto;\n}\n\n.sprie-config-dropdown-options.sprie-config-open {\n opacity: 1;\n visibility: visible;\n height: auto;\n z-index: 1000;\n}\n\n.sprie-config-dropdown-options li {\n padding: 0.75rem 1rem;\n cursor: pointer;\n transition: background-color 0.3s ease;\n}\n\n.sprie-config-dropdown-options li:hover {\n background-color: #f0f0f0;\n}\n\n.sprie-config-dropdown-options li.sprie-config-selected {\n background-color: #f2f2f2; /* Highlight color for selected option */\n}\n\n.sprie-config-selected-option {\n width: 90%;\n}\n\n.sprie-config-frame-details-wrapper {\n display: flex;\n gap: 1rem;\n height: auto;\n overflow: hidden;\n}\n\n.sprie-config-variantImgBox {\n width: 3.4rem;\n height: 100%;\n display: flex;\n align-items: center; /* Center vertically */\n justify-content: center; /* Center horizontally */\n background: #fff;\n}\n\n.sprie-config-details {\n display: flex;\n flex-direction: column;\n gap: 2px;\n overflow: hidden;\n}\n\n.sprie-config-details .sprie-config-frameName {\n color: #4d4d4d;\n font-size: 1rem;\n font-weight: 400;\n line-height: 1.5rem; /* 150% */\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n margin : 0\n}\n\n.sprie-config-details .sprie-config-skuName {\n color: rgba(34, 34, 34, 0.7);\n font-size: 0.875rem;\n font-weight: 400;\n line-height: 0.96125rem; /* 109.857% */\n letter-spacing: 0.02813rem;\n text-transform: uppercase;\n margin : 0\n}\n/* LensDropdown.css */\n\n.sprie-config-label {\n color: rgba(34, 34, 34, 0.7);\n font-size: 0.75rem;\n font-weight: 400;\n letter-spacing: 0.02813rem;\n margin-bottom: 0.5rem;\n display: flex;\n align-items: center;\n margin-left: 0.1rem;\n}\n\n.sprie-config-dropdown-wrapper {\n position: relative;\n width: 100%;\n}\n\n.sprie-config-select-box {\n cursor: pointer;\n display: flex;\n align-items: center;\n justify-content: space-between;\n border-radius: 0.125rem;\n position: relative;\n user-select: none;\n width: 100%;\n box-sizing: border-box;\n transition: border-radius 0.3s ease;\n background-color: #ffffff;\n}\n\n.sprie-config-select-box.sprie-config-open {\n border-bottom-right-radius: 0;\n border-bottom-left-radius: 0;\n}\n\n.sprie-config-selected-lens {\n flex: 1;\n display: flex;\n gap: 1rem;\n height: auto;\n}\n\n.sprie-config-selected-lens .sprie-config-lens-details {\n display: flex;\n flex-direction: column;\n justify-content: center;\n height: auto;\n padding-bottom: 0.2rem;\n}\n\n.sprie-config-colorBox {\n display: flex;\n align-items: center;\n justify-content: center;\n}\n\n.sprie-config-lensName {\n color: #4d4d4d;\n font-size: 1rem;\n font-weight: 400;\n line-height: 1.5rem; /* 150% */\n margin: 0;\n}\n\n.sprie-config-lensColor {\n color: rgba(34, 34, 34, 0.7);\n font-size: 0.875rem;\n font-weight: 400;\n line-height: 0.96125rem; /* 109.857% */\n letter-spacing: 0.02813rem;\n text-transform: uppercase;\n margin: 0;\n}\n\n.sprie-config-arrow {\n margin-left: 10px;\n transition: transform 0.3s ease;\n}\n\n.sprie-config-arrow.sprie-config-up {\n transform: rotate(180deg);\n}\n\n.sprie-config-lens-dropdown-options {\n list-style: none;\n margin: 0;\n padding: 0;\n position: absolute;\n top: 100%;\n left: 0;\n width: 100%;\n z-index: 100; /* Adjust z-index to ensure dropdown options are above other elements */\n background-color: transparent;\n border-radius: 0 0 0.125rem 0.125rem;\n border: 0;\n box-shadow: none;\n opacity: 0;\n visibility: hidden;\n transition: opacity 0.3s ease, visibility 0.3s ease;\n max-height: 4rem; /* Set the fixed height for the dropdown */\n overflow-x: auto;\n overflow-y: hidden;\n display: flex;\n flex-direction: row;\n flex-wrap: no-wrap;\n padding: 0;\n}\n\n.sprie-config-lens-dropdown-options.sprie-config-open {\n opacity: 1;\n visibility: visible;\n}\n\n.sprie-config-lens-dropdown-options li {\n padding: 1rem 1.25rem;\n cursor: pointer;\n transition: background-color 0.3s ease;\n padding: 0.25rem;\n}\n\n.sprie-config-lens-dropdown-options li .sprie-config-li-element {\n width: 100%;\n height: 100%;\n z-index: 10;\n display: flex;\n align-items: center;\n justify-content: center;\n}\n\n.sprie-config-lens-dropdown-options li .sprie-config-tooltip {\n display: none;\n}\n\n@media (min-width: 768px) {\n .sprie-config-lens-dropdown-options {\n max-height: 9.2rem;\n overflow-x: hidden;\n overflow-y: auto;\n display: grid;\n grid-template-columns: repeat(5, auto);\n padding: 0.5rem;\n border-top: 1px solid #ccc;\n background-color: #fff;\n box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);\n }\n\n .sprie-config-lens-dropdown-options li {\n min-width: auto;\n }\n\n .sprie-config-lens-dropdown-options li .sprie-config-tooltip {\n position: absolute;\n width: auto;\n height: 2rem;\n flex-shrink: 0;\n border-radius: 0.125rem;\n background: #fff;\n box-shadow: 0px 0px 2px 0px rgba(0, 0, 0, 0.25);\n text-align: center;\n line-height: 2rem;\n transition: opacity 0.3s ease, visibility 0.3s ease;\n display: block;\n\n /* Font style properties */\n color: rgba(34, 34, 34, 0.7);\n font-size: 0.875rem;\n font-weight: 400;\n letter-spacing: 0.02813rem;\n text-transform: uppercase;\n white-space: nowrap; /* Ensure text is in one line */\n z-index: 200;\n }\n\n .sprie-config-tooltip.sprie-config-top {\n bottom: 12%;\n }\n\n .sprie-config-tooltip.sprie-config-right {\n right: 2%;\n }\n}"));
|
|
7
|
+
elementStyle.appendChild(document.createTextNode("@import url('https://fonts.googleapis.com/css2?family=Work+Sans:wght@200;300;400;500;600;700;800&display=swap');\n\n#Sprie-config-html,\n#Sprie-config-body {\n width: 100%;\n height: 100%;\n margin: 0;\n padding: 0;\n font-family: 'Work Sans', sans-serif;\n box-sizing: border-box;\n}\n\n#Sprie-config-body * {\n box-sizing: border-box;\n margin: 0;\n padding: 0;\n}\n\n.sprie-config-loadingBox {\n position: fixed;\n width: 100%;\n height: 100%;\n display: flex;\n align-items: center;\n justify-content: center;\n text-align: center;\n font-size: 24px;\n font-weight: 500;\n z-index: 10000;\n background: #f2f2f2;\n}\n/*== MAIN_CONTAINER ==*/\n#Sprie-config-Main-Container {\n width: 100%;\n height: 100%;\n}\n\n/*== HEADER ==*/\n#Sprie-config-Header {\n height: 5rem; /* 88px */\n border-bottom: 1.5px solid #aeaeae;\n display: flex;\n flex-direction: column;\n justify-content: center;\n align-items: center;\n gap: 0.5rem;\n .sprie-config-Header-groupName {\n color: #373737;\n font-size: 1rem;\n font-weight: 400;\n line-height: 1.5275rem; /* 111.091% */\n letter-spacing: -0.05rem;\n text-transform: uppercase;\n }\n}\n\n/*== 3D_VIEWER ==*/\n#Sprie-config-Viewer-Container {\n position: relative;\n width: 100%;\n\n img {\n position: absolute;\n top: 2rem;\n left: 2rem;\n }\n}\n\n/*= 3D_VIEWER-LOADER =*/\n.sprie-config-loadingFrame {\n position: absolute;\n width: 100%;\n height: 100%;\n display: flex;\n align-items: center;\n justify-content: center;\n text-align: center;\n font-size: 24px;\n font-weight: 500;\n z-index: 1000;\n background: #fafafa;\n opacity: 0.7;\n}\n\n.sprie-config-loader {\n border: 8px solid #222222;\n width: 60px;\n padding: 8px;\n aspect-ratio: 1;\n border-radius: 50%;\n background: #222222;\n --_m: conic-gradient(#0000 10%, #000), linear-gradient(#000 0 0) content-box;\n -webkit-mask: var(--_m);\n mask: var(--_m);\n -webkit-mask-composite: source-out;\n mask-composite: subtract;\n animation: spin 1s infinite linear;\n}\n\n@keyframes spin {\n to {\n transform: rotate(1turn);\n }\n}\n\n/*== CUSTOMISATION_BLOCK ==*/\n#Sprie-config-Customisation-block {\n height: 15rem; /* 240px */\n background-color: #f2f2f2;\n border-top: 1px solid #91847e;\n position: relative;\n flex-grow: 1;\n}\n\n.sprie-config-price-block {\n position: absolute;\n right: 0;\n z-index: 1000;\n display: flex;\n flex-direction: column;\n align-items: end;\n gap: 0.4rem;\n p {\n font-size: 1.25rem;\n font-weight: 500;\n color: #121212;\n }\n}\n\n.frameName {\n color: #4d4d4d;\n font-size: 0.875rem;\n font-weight: 500;\n line-height: 1.5275rem; /* 111.091% */\n letter-spacing: -0.05rem;\n text-transform: uppercase;\n}\n\n.price-tag {\n color: #222;\n font-size: 1.3125rem;\n font-weight: 400;\n line-height: 2.275rem; /* 173.333% */\n}\n\n/*=== Mobile_View ===*/\n@media (max-width: 576px) {\n /* HEADER */\n #Sprie-config-Header {\n height: 5.25rem; /* 84px */\n }\n\n #Sprie-config-Viewer-Container {\n img {\n position: absolute;\n top: 1.2rem;\n left: 1.2rem;\n }\n }\n}\n.sprie-config-palette {\n display: flex;\n gap: 1.5rem;\n justify-content: flex-start;\n overflow-x: auto;\n}\n\n.sprie-config-palette-img-box {\n position: relative;\n display: flex;\n flex-direction: column;\n justify-content: center;\n align-items: center;\n}\n\n.sprie-config-palette-img-box > button {\n background-color: transparent;\n}\n\n.sprie-config-palette-img-text {\n position: absolute;\n z-index: 100;\n bottom: -12px;\n\n .sprie-config-palette-imgName {\n white-space: nowrap;\n z-index: 100;\n }\n}\n.sprie-config-engraving-block {\n width: 100%;\n height: 100%;\n display: flex;\n flex-direction: column;\n align-items: center;\n gap: 0.8rem;\n}\n\n.sprie-config-engraving-checkbox[type='checkbox'] {\n width: 1rem;\n height: 1rem;\n accent-color: #000;\n border: 0.25rem solid #000;\n border-radius: 0.5rem;\n background-color: transparent;\n}\n\n.sprie-config-engraving-inputField-block {\n width: 25rem;\n position: relative;\n}\n\n.sprie-config-engraving-inputField {\n width: 100%;\n font-size: 0.8rem;\n font-weight: 500;\n background: transparent;\n border-width: 1px;\n}\n\n.sprie-config-engraving-inputInfo {\n position: absolute;\n white-space: nowrap;\n font-size: 0.6rem;\n bottom: 0.2rem;\n right: 0.4rem;\n color: #686868;\n}\n\n.sprie-config-engraving-link {\n position: absolute;\n white-space: nowrap;\n font-size: 0.7rem;\n bottom: -1.2rem;\n right: 0;\n color: #686868;\n text-decoration: underline;\n}\n\n@media (max-width: 576px) {\n .sprie-config-engraving-inputField-block {\n width: 70%;\n }\n}\n.carousel {\n position: relative;\n overflow: hidden;\n width: 100%;\n height: 100%;\n display: flex;\n flex-direction: column;\n align-items: center;\n}\n\n.carousel-container {\n width: 80%;\n display: flex;\n position: relative;\n overflow: hidden;\n}\n\n.carousel-item {\n display: flex;\n align-items: center;\n justify-content: center;\n min-width: 100%;\n transition-property: transform;\n transition-timing-function: cubic-bezier(0, 0, 0.2, 1);\n transition-duration: 500ms;\n}\n\n.carousel-header {\n display: flex;\n align-items: center;\n justify-content: center;\n gap: 2rem;\n\n .step-syntax {\n font-size: 1rem;\n font-weight: 600;\n line-height: 1.5rem;\n color: #4d4d4d;\n }\n\n .select-syntax {\n font-size: 1rem;\n font-weight: 400;\n line-height: 1.5rem;\n color: #91847e;\n }\n}\n\n/* Arrow-btns */\n.carousel-btn {\n border: none;\n display: flex;\n align-items: center;\n justify-content: center;\n cursor: pointer;\n background-color: transparent;\n}\n.arrow {\n border: solid #91847e;\n border-width: 0 3px 3px 0;\n display: inline-block;\n}\n\n.right-arrow {\n transform: rotate(-45deg);\n -webkit-transform: rotate(-45deg);\n}\n\n.left-arrow {\n transform: rotate(135deg);\n -webkit-transform: rotate(135deg);\n}\n\n/* Step-tracker */\n\n.step-tracker-block {\n display: flex;\n flex-direction: column;\n justify-content: center;\n align-items: center;\n border-bottom: 1px solid #aeaeae;\n width: 26.25rem;\n}\n\n.step-tracker {\n display: flex;\n gap: 1rem;\n}\n\n.step-circle {\n width: 10px;\n height: 10px;\n border-radius: 50%;\n border: 1px solid #7d7d7d;\n background-color: transparent;\n display: flex;\n justify-content: center;\n align-items: center;\n margin-right: 10px;\n font-size: 14px;\n}\n\n.step-circle.active {\n background-color: #000; /* Change color for active step */\n border-color: #000;\n}\n\n@media (max-width: 576px) {\n .carousel-container {\n width: 100%;\n }\n\n .step-tracker-block {\n width: 80%;\n }\n}\n.sprie-config-add-to-cart-block {\n width: 14.5rem;\n display: flex;\n flex-direction: column;\n justify-content: center;\n align-items: center;\n gap: 0.5rem;\n}\n.sprie-config-add-to-cart-btn {\n width: 100%;\n height: 2.75rem; /* 44px */\n background-color: #000000;\n display: flex;\n align-items: center;\n justify-content: center;\n cursor: pointer;\n border: 0;\n\n font-size: 0.875rem;\n letter-spacing: 0.1rem;\n font-weight: 500;\n color: #ffffff;\n}\n\n#Sprie-Config-return-policy-label {\n display: flex;\n justify-content: center;\n width: 13.5rem;\n\n p {\n font-size: 0.7rem;\n text-align: end;\n margin-top: 0.05rem;\n }\n}\n#Sprie-Config-return-policy-checkbox[type='checkbox'] {\n width: 1rem;\n height: 1rem;\n accent-color: #000;\n border: 0.25rem solid #000;\n border-radius: 0.5rem;\n background-color: transparent;\n}\n\n.sprie-config-add-to-cart-btn:disabled,\n.sprie-config-add-to-cart-btn [disabled] {\n /* border: 1px solid #999999; */\n background-color: rgb(80, 79, 79);\n cursor: default;\n}\n@media (max-width: 576px) {\n .sprie-config-add-to-cart-block {\n width: 100%;\n }\n\n .sprie-config-add-to-cart-btn {\n width: 100%;\n height: 4rem; /* 64px */\n }\n\n #Sprie-Config-return-policy-label {\n width: 100%;\n gap : .5rem;\n }\n}"));
|
|
8
8
|
document.head.appendChild(elementStyle);
|
|
9
9
|
}
|
|
10
10
|
} catch (e) {
|
|
@@ -112,11 +112,11 @@ var __publicField = (obj, key, value) => {
|
|
|
112
112
|
host: "https://api.sprie.io"
|
|
113
113
|
};
|
|
114
114
|
const config$1 = Object.freeze(Config$2);
|
|
115
|
-
const version$1 = "0.
|
|
115
|
+
const version$1 = "0.3.0001";
|
|
116
116
|
function modifyLensArr$1(arr, element) {
|
|
117
|
-
const
|
|
118
|
-
if (
|
|
119
|
-
return [element, ...arr.slice(0,
|
|
117
|
+
const index2 = arr.findIndex((e) => e["sku"] === element["sku"]);
|
|
118
|
+
if (index2 !== -1) {
|
|
119
|
+
return [element, ...arr.slice(0, index2), ...arr.slice(index2 + 1)];
|
|
120
120
|
}
|
|
121
121
|
return arr;
|
|
122
122
|
}
|
|
@@ -178,13 +178,13 @@ var __publicField = (obj, key, value) => {
|
|
|
178
178
|
return response;
|
|
179
179
|
}
|
|
180
180
|
// Lens-list call
|
|
181
|
-
async FetchCustomisationList() {
|
|
182
|
-
const url = `/v1/widget/list-customisation?search=type
|
|
181
|
+
async FetchCustomisationList(type) {
|
|
182
|
+
const url = `/v1/widget/list-customisation?search=type:${type},org:${this.fetcher.config.ORGID},usage:customizer&limit=50`;
|
|
183
183
|
const response = await this.fetcher.Get(url);
|
|
184
|
-
const
|
|
184
|
+
const defaultCustomisationData = response.data.find((e) => e.sku === `${type.toLowerCase()}-default`);
|
|
185
185
|
const modifiedRes = {
|
|
186
186
|
...response,
|
|
187
|
-
data: modifyLensArr$1(response.data,
|
|
187
|
+
data: modifyLensArr$1(response.data, defaultCustomisationData)
|
|
188
188
|
};
|
|
189
189
|
return modifiedRes;
|
|
190
190
|
}
|
|
@@ -671,410 +671,6 @@ var __publicField = (obj, key, value) => {
|
|
|
671
671
|
}
|
|
672
672
|
var jsxRuntimeExports = jsxRuntime.exports;
|
|
673
673
|
const App$1 = "";
|
|
674
|
-
const Button = "";
|
|
675
|
-
const Panel = "";
|
|
676
|
-
const MainContainer$1 = "";
|
|
677
|
-
const FrameDropdown$1 = "";
|
|
678
|
-
const dropdownIcon = "data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMjQiIGhlaWdodD0iMjQiIHZpZXdCb3g9IjAgMCAyNCAyNCIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KPHBhdGggZD0iTTE5IDlMMTIuNzgwOSAxNC4zMzA2QzEyLjMzMTYgMTQuNzE1OCAxMS42Njg0IDE0LjcxNTggMTEuMjE5MSAxNC4zMzA2TDUgOSIgc3Ryb2tlPSIjNEQ0RDREIiBzdHJva2Utd2lkdGg9IjEuNSIgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIi8+Cjwvc3ZnPgo=";
|
|
679
|
-
function FrameDropdown({
|
|
680
|
-
label,
|
|
681
|
-
options,
|
|
682
|
-
selectedFrame,
|
|
683
|
-
changeFrame
|
|
684
|
-
}) {
|
|
685
|
-
const [isOpen, setIsOpen] = reactExports.useState(false);
|
|
686
|
-
const dropdownRef = reactExports.useRef(null);
|
|
687
|
-
const handleToggleDropdown = () => {
|
|
688
|
-
setIsOpen((prevIsOpen) => !prevIsOpen);
|
|
689
|
-
};
|
|
690
|
-
const handleClickOutside = (event) => {
|
|
691
|
-
if (dropdownRef.current && !dropdownRef.current.contains(event.target)) {
|
|
692
|
-
setIsOpen(false);
|
|
693
|
-
}
|
|
694
|
-
};
|
|
695
|
-
const handleSelectOption = (option) => {
|
|
696
|
-
changeFrame(option);
|
|
697
|
-
setIsOpen(false);
|
|
698
|
-
};
|
|
699
|
-
reactExports.useEffect(() => {
|
|
700
|
-
document.addEventListener("click", handleClickOutside);
|
|
701
|
-
return () => {
|
|
702
|
-
document.removeEventListener("click", handleClickOutside);
|
|
703
|
-
};
|
|
704
|
-
}, []);
|
|
705
|
-
return /* @__PURE__ */ jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment, { children: /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: `sprie-config-dropdown-wrapper`, ref: dropdownRef, children: [
|
|
706
|
-
/* @__PURE__ */ jsxRuntimeExports.jsx("p", { className: `sprie-config-label`, children: label }),
|
|
707
|
-
/* @__PURE__ */ jsxRuntimeExports.jsxs(
|
|
708
|
-
"div",
|
|
709
|
-
{
|
|
710
|
-
className: `sprie-config-select-box ${isOpen ? "sprie-config-open" : ""}`,
|
|
711
|
-
onClick: handleToggleDropdown,
|
|
712
|
-
children: [
|
|
713
|
-
/* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: `sprie-config-selected-option sprie-config-frame-details-wrapper`, children: [
|
|
714
|
-
/* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: `sprie-config-variantImgBox`, children: /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
715
|
-
"img",
|
|
716
|
-
{
|
|
717
|
-
src: selectedFrame && selectedFrame.variantImage,
|
|
718
|
-
alt: "variant-img",
|
|
719
|
-
className: `sprie-config-variantImg`,
|
|
720
|
-
width: 50,
|
|
721
|
-
height: 42
|
|
722
|
-
}
|
|
723
|
-
) }),
|
|
724
|
-
/* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: `sprie-config-details`, children: [
|
|
725
|
-
/* @__PURE__ */ jsxRuntimeExports.jsx("p", { className: `sprie-config-frameName`, children: selectedFrame && selectedFrame.name }),
|
|
726
|
-
/* @__PURE__ */ jsxRuntimeExports.jsx("p", { className: `sprie-config-skuName`, children: selectedFrame && selectedFrame.sku })
|
|
727
|
-
] })
|
|
728
|
-
] }),
|
|
729
|
-
/* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
730
|
-
"img",
|
|
731
|
-
{
|
|
732
|
-
src: dropdownIcon,
|
|
733
|
-
alt: "dropdown-icon",
|
|
734
|
-
className: `sprie-config-arrow ${isOpen ? "sprie-config-up" : ""}`
|
|
735
|
-
}
|
|
736
|
-
)
|
|
737
|
-
]
|
|
738
|
-
}
|
|
739
|
-
),
|
|
740
|
-
/* @__PURE__ */ jsxRuntimeExports.jsx("ul", { className: `sprie-config-dropdown-options ${isOpen ? "sprie-config-open" : ""}`, children: options && options.map((option) => /* @__PURE__ */ jsxRuntimeExports.jsxs(
|
|
741
|
-
"li",
|
|
742
|
-
{
|
|
743
|
-
onClick: () => handleSelectOption(option),
|
|
744
|
-
className: `sprie-config-frame-details-wrapper ${selectedFrame && selectedFrame.name === option.name ? "sprie-config-selected" : ""}`,
|
|
745
|
-
children: [
|
|
746
|
-
/* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: `sprie-config-variantImgBox`, children: /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
747
|
-
"img",
|
|
748
|
-
{
|
|
749
|
-
src: option.variantImage,
|
|
750
|
-
alt: "variant-img",
|
|
751
|
-
className: `sprie-config-variantImg`,
|
|
752
|
-
width: 50,
|
|
753
|
-
height: 42
|
|
754
|
-
}
|
|
755
|
-
) }),
|
|
756
|
-
/* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: `sprie-config-details`, children: [
|
|
757
|
-
/* @__PURE__ */ jsxRuntimeExports.jsx("p", { className: `sprie-config-frameName`, children: option.name }),
|
|
758
|
-
/* @__PURE__ */ jsxRuntimeExports.jsx("p", { className: `sprie-config-skuName`, children: option.sku })
|
|
759
|
-
] })
|
|
760
|
-
]
|
|
761
|
-
},
|
|
762
|
-
option._id
|
|
763
|
-
)) })
|
|
764
|
-
] }) });
|
|
765
|
-
}
|
|
766
|
-
const LensDropdown$1 = "";
|
|
767
|
-
function LensDropdown({
|
|
768
|
-
label,
|
|
769
|
-
lensData,
|
|
770
|
-
selectedLens,
|
|
771
|
-
changeLensMaterial
|
|
772
|
-
}) {
|
|
773
|
-
const [isOpen, setIsOpen] = reactExports.useState(false);
|
|
774
|
-
const [hoveredOption, setHoveredOption] = reactExports.useState(
|
|
775
|
-
null
|
|
776
|
-
);
|
|
777
|
-
const dropdownRef = reactExports.useRef(null);
|
|
778
|
-
const isMobileView = window.innerWidth < 768;
|
|
779
|
-
const handleToggleDropdown = () => {
|
|
780
|
-
if (!isMobileView) {
|
|
781
|
-
setIsOpen((prevIsOpen) => !prevIsOpen);
|
|
782
|
-
}
|
|
783
|
-
};
|
|
784
|
-
const handleSelectOption = (option) => {
|
|
785
|
-
changeLensMaterial(option);
|
|
786
|
-
setIsOpen(false);
|
|
787
|
-
};
|
|
788
|
-
const handleHoverOption = (option) => {
|
|
789
|
-
setHoveredOption(option);
|
|
790
|
-
};
|
|
791
|
-
const handleClickOutside = (event) => {
|
|
792
|
-
if (dropdownRef.current && !dropdownRef.current.contains(event.target)) {
|
|
793
|
-
setIsOpen(false);
|
|
794
|
-
}
|
|
795
|
-
};
|
|
796
|
-
reactExports.useEffect(() => {
|
|
797
|
-
document.addEventListener("click", handleClickOutside);
|
|
798
|
-
return () => {
|
|
799
|
-
document.removeEventListener("click", handleClickOutside);
|
|
800
|
-
};
|
|
801
|
-
}, []);
|
|
802
|
-
const calculateTooltipPosition = (index) => {
|
|
803
|
-
if (lensData) {
|
|
804
|
-
const totalElements = lensData.length;
|
|
805
|
-
const elementsPerRow = 5;
|
|
806
|
-
const rowIndex = Math.floor(index / elementsPerRow);
|
|
807
|
-
return rowIndex === Math.floor((totalElements - 1) / elementsPerRow) ? "top" : "";
|
|
808
|
-
}
|
|
809
|
-
};
|
|
810
|
-
const calculateTooltipAlignment = (index) => {
|
|
811
|
-
const itemsPerRow = 5;
|
|
812
|
-
const remainder = (index + 1) % itemsPerRow;
|
|
813
|
-
if (remainder === 0) {
|
|
814
|
-
return "right";
|
|
815
|
-
} else {
|
|
816
|
-
return "left";
|
|
817
|
-
}
|
|
818
|
-
};
|
|
819
|
-
return /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "sprie-config-dropdown-wrapper", ref: dropdownRef, children: [
|
|
820
|
-
/* @__PURE__ */ jsxRuntimeExports.jsx("p", { className: "sprie-config-label", children: label }),
|
|
821
|
-
/* @__PURE__ */ jsxRuntimeExports.jsxs(
|
|
822
|
-
"div",
|
|
823
|
-
{
|
|
824
|
-
className: `sprie-config-select-box ${isMobileView ? "sprie-config-open" : `${isOpen ? "sprie-config-open" : ""}`}`,
|
|
825
|
-
onClick: handleToggleDropdown,
|
|
826
|
-
style: {
|
|
827
|
-
background: isMobileView ? "transparent" : "#ffffff",
|
|
828
|
-
padding: isMobileView ? "0.2rem 1.25rem .7rem 0.1rem" : "1rem 1.25rem"
|
|
829
|
-
},
|
|
830
|
-
children: [
|
|
831
|
-
/* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "sprie-config-selected-lens", children: [
|
|
832
|
-
/* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "sprie-config-colorBox", children: /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
833
|
-
"img",
|
|
834
|
-
{
|
|
835
|
-
src: selectedLens && selectedLens.thumbnail,
|
|
836
|
-
width: 50
|
|
837
|
-
}
|
|
838
|
-
) }),
|
|
839
|
-
/* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "sprie-config-lens-details", children: [
|
|
840
|
-
/* @__PURE__ */ jsxRuntimeExports.jsx("p", { className: "sprie-config-lensName", children: selectedLens && selectedLens.name }),
|
|
841
|
-
/* @__PURE__ */ jsxRuntimeExports.jsx("p", { className: "sprie-config-lensColor", children: selectedLens && selectedLens.metadata[0].value })
|
|
842
|
-
] })
|
|
843
|
-
] }),
|
|
844
|
-
!isMobileView && /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
845
|
-
"img",
|
|
846
|
-
{
|
|
847
|
-
src: dropdownIcon,
|
|
848
|
-
alt: "dropdown-icon",
|
|
849
|
-
className: `sprie-config-arrow ${isOpen ? "sprie-config-up" : ""}`
|
|
850
|
-
}
|
|
851
|
-
)
|
|
852
|
-
]
|
|
853
|
-
}
|
|
854
|
-
),
|
|
855
|
-
/* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
856
|
-
"ul",
|
|
857
|
-
{
|
|
858
|
-
className: `sprie-config-lens-dropdown-options ${isMobileView ? "sprie-config-open" : `${isOpen ? "sprie-config-open" : ""}`}`,
|
|
859
|
-
style: { marginLeft: isMobileView ? ".1rem" : "0" },
|
|
860
|
-
children: lensData && lensData.map((option, index) => /* @__PURE__ */ jsxRuntimeExports.jsxs(
|
|
861
|
-
"li",
|
|
862
|
-
{
|
|
863
|
-
className: selectedLens && selectedLens.name === option.name ? "sprie-config-selected" : "",
|
|
864
|
-
children: [
|
|
865
|
-
/* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "sprie-config-li-element", children: /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
866
|
-
"img",
|
|
867
|
-
{
|
|
868
|
-
src: option.thumbnail,
|
|
869
|
-
width: 50,
|
|
870
|
-
onClick: () => handleSelectOption(option),
|
|
871
|
-
onMouseEnter: () => handleHoverOption(option),
|
|
872
|
-
onMouseLeave: () => setHoveredOption(null)
|
|
873
|
-
}
|
|
874
|
-
) }),
|
|
875
|
-
hoveredOption === option && /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
876
|
-
"div",
|
|
877
|
-
{
|
|
878
|
-
className: `sprie-config-tooltip ${calculateTooltipPosition(
|
|
879
|
-
index
|
|
880
|
-
)} ${calculateTooltipAlignment(index)}`,
|
|
881
|
-
children: option.metadata[0].value
|
|
882
|
-
}
|
|
883
|
-
)
|
|
884
|
-
]
|
|
885
|
-
},
|
|
886
|
-
index
|
|
887
|
-
))
|
|
888
|
-
}
|
|
889
|
-
)
|
|
890
|
-
] });
|
|
891
|
-
}
|
|
892
|
-
function MainContainer({
|
|
893
|
-
orgName,
|
|
894
|
-
customEvent,
|
|
895
|
-
apiService: apiService2,
|
|
896
|
-
frameList,
|
|
897
|
-
lensList,
|
|
898
|
-
viewerOnly,
|
|
899
|
-
ThreeDConfigurator: ThreeDConfigurator2
|
|
900
|
-
}) {
|
|
901
|
-
const [selectedFrame, setSelectedFrame] = reactExports.useState();
|
|
902
|
-
const [selectedLens, setSelectedLens] = reactExports.useState();
|
|
903
|
-
const [modelLoading, setModelLoading] = reactExports.useState(false);
|
|
904
|
-
const domInstance = reactExports.useRef();
|
|
905
|
-
const orgId = apiService2.fetcher.LoadConfig().ORGID;
|
|
906
|
-
const setUpAndRender = reactExports.useCallback(async () => {
|
|
907
|
-
if (apiService2 && frameList && orgId) {
|
|
908
|
-
setModelLoading(true);
|
|
909
|
-
const frame = frameList[0];
|
|
910
|
-
const apiRes = await apiService2.FetchAssetBySKUOrBarcode({
|
|
911
|
-
sku: frame.sku,
|
|
912
|
-
barcode: null
|
|
913
|
-
});
|
|
914
|
-
ThreeDConfigurator2.renderAsset(
|
|
915
|
-
{
|
|
916
|
-
containerId: "holder-canvas",
|
|
917
|
-
data: {
|
|
918
|
-
assetDetails: apiRes,
|
|
919
|
-
customisation: apiRes == null ? void 0 : apiRes.customisation
|
|
920
|
-
}
|
|
921
|
-
}
|
|
922
|
-
).then((instance) => {
|
|
923
|
-
setModelLoading(false);
|
|
924
|
-
setSelectedFrame(frame);
|
|
925
|
-
domInstance.current = instance;
|
|
926
|
-
});
|
|
927
|
-
}
|
|
928
|
-
}, [orgId, frameList, apiService2, ThreeDConfigurator2]);
|
|
929
|
-
reactExports.useEffect(() => {
|
|
930
|
-
setUpAndRender();
|
|
931
|
-
}, [setUpAndRender]);
|
|
932
|
-
const getLensInfo = (frame) => {
|
|
933
|
-
const hasSpecialDefaultLens = (frame == null ? void 0 : frame.customisation.length) == 0;
|
|
934
|
-
const includedLens = hasSpecialDefaultLens ? null : frame == null ? void 0 : frame.customisation.find((x2) => x2.type == "Lens");
|
|
935
|
-
return includedLens;
|
|
936
|
-
};
|
|
937
|
-
const onChangeLens = async (requestedLens) => {
|
|
938
|
-
if (!domInstance.current) {
|
|
939
|
-
return;
|
|
940
|
-
}
|
|
941
|
-
if (requestedLens == selectedLens) {
|
|
942
|
-
return;
|
|
943
|
-
}
|
|
944
|
-
const isDefaultRequested = requestedLens.sku == "lens-default";
|
|
945
|
-
const frameDefaultLens = getLensInfo(selectedFrame);
|
|
946
|
-
if (!frameDefaultLens && isDefaultRequested) {
|
|
947
|
-
setModelLoading(true);
|
|
948
|
-
domInstance.current.changeLens(requestedLens, true, selectedFrame).then(() => {
|
|
949
|
-
setModelLoading(false);
|
|
950
|
-
});
|
|
951
|
-
} else if (!frameDefaultLens && !isDefaultRequested) {
|
|
952
|
-
if ((selectedLens == null ? void 0 : selectedLens.sku) == "lens-default") {
|
|
953
|
-
setModelLoading(true);
|
|
954
|
-
domInstance.current.changeLens(requestedLens, true, selectedFrame).then(() => {
|
|
955
|
-
setModelLoading(false);
|
|
956
|
-
});
|
|
957
|
-
} else {
|
|
958
|
-
domInstance.current.changeLens(requestedLens, false, selectedFrame);
|
|
959
|
-
}
|
|
960
|
-
} else if (frameDefaultLens && isDefaultRequested) {
|
|
961
|
-
domInstance.current.changeLens(frameDefaultLens, false, selectedFrame);
|
|
962
|
-
} else {
|
|
963
|
-
domInstance.current.changeLens(requestedLens, false, selectedFrame);
|
|
964
|
-
}
|
|
965
|
-
setSelectedLens(requestedLens);
|
|
966
|
-
};
|
|
967
|
-
const onChangeFrame = async (frame, reload) => {
|
|
968
|
-
if (frame._id == (selectedFrame == null ? void 0 : selectedFrame._id) && !reload) {
|
|
969
|
-
return;
|
|
970
|
-
}
|
|
971
|
-
if (!domInstance.current)
|
|
972
|
-
return;
|
|
973
|
-
setModelLoading(true);
|
|
974
|
-
domInstance.current.changeFrame(frame, selectedLens).then(() => {
|
|
975
|
-
setModelLoading(false);
|
|
976
|
-
});
|
|
977
|
-
setSelectedFrame(frame);
|
|
978
|
-
};
|
|
979
|
-
reactExports.useEffect(() => {
|
|
980
|
-
frameList && setSelectedFrame(frameList[0]);
|
|
981
|
-
lensList && setSelectedLens(lensList[0]);
|
|
982
|
-
}, [frameList, lensList]);
|
|
983
|
-
return /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { id: "Sprie-config-Main-Container", children: [
|
|
984
|
-
!viewerOnly && /* @__PURE__ */ jsxRuntimeExports.jsx("div", { id: "Sprie-config-Checkout-Container", children: /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { id: "Sprie-config-Checkout-box", children: [
|
|
985
|
-
/* @__PURE__ */ jsxRuntimeExports.jsxs("div", { id: "Sprie-config-Checkout-header", children: [
|
|
986
|
-
/* @__PURE__ */ jsxRuntimeExports.jsx("div", { id: "Sprie-config-frameName", children: orgName }),
|
|
987
|
-
/* @__PURE__ */ jsxRuntimeExports.jsx("div", { id: "Sprie-config-lensPrice", children: `${(selectedLens == null ? void 0 : selectedLens.price) ? `+ $${selectedLens == null ? void 0 : selectedLens.price}.00 USD` : ""}` })
|
|
988
|
-
] }),
|
|
989
|
-
/* @__PURE__ */ jsxRuntimeExports.jsxs("div", { id: "Sprie-config-Checkout-body", children: [
|
|
990
|
-
/* @__PURE__ */ jsxRuntimeExports.jsxs(
|
|
991
|
-
"div",
|
|
992
|
-
{
|
|
993
|
-
id: "Sprie-config-Dropdown-Container",
|
|
994
|
-
style: { display: frameList && lensList ? "flex" : "none" },
|
|
995
|
-
children: [
|
|
996
|
-
/* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
997
|
-
FrameDropdown,
|
|
998
|
-
{
|
|
999
|
-
label: "STEP 1 : SELECT FRAME COLOUR",
|
|
1000
|
-
options: frameList,
|
|
1001
|
-
selectedFrame,
|
|
1002
|
-
changeFrame: onChangeFrame
|
|
1003
|
-
}
|
|
1004
|
-
),
|
|
1005
|
-
/* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
1006
|
-
LensDropdown,
|
|
1007
|
-
{
|
|
1008
|
-
label: "STEP 2 : SELECT LENS COLOUR",
|
|
1009
|
-
lensData: lensList,
|
|
1010
|
-
selectedLens,
|
|
1011
|
-
changeLensMaterial: onChangeLens
|
|
1012
|
-
}
|
|
1013
|
-
)
|
|
1014
|
-
]
|
|
1015
|
-
}
|
|
1016
|
-
),
|
|
1017
|
-
/* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
1018
|
-
"button",
|
|
1019
|
-
{
|
|
1020
|
-
id: "Sprie-config-Checkout-button",
|
|
1021
|
-
onClick: () => {
|
|
1022
|
-
if (selectedFrame && selectedLens) {
|
|
1023
|
-
const frameVariantId = selectedFrame.metadata.find(
|
|
1024
|
-
(item) => item.key == "variantId"
|
|
1025
|
-
);
|
|
1026
|
-
const baseCurve = selectedFrame.metadata.find(
|
|
1027
|
-
(item) => item.key == "baseCurve"
|
|
1028
|
-
);
|
|
1029
|
-
let lensVariantKey = "variantId";
|
|
1030
|
-
if (baseCurve && baseCurve.value == "2B") {
|
|
1031
|
-
lensVariantKey = "2bVariantId";
|
|
1032
|
-
} else if (baseCurve && baseCurve.value == "6B") {
|
|
1033
|
-
lensVariantKey = "6bVariantId";
|
|
1034
|
-
}
|
|
1035
|
-
const lensVariantId = selectedLens.metadata.find(
|
|
1036
|
-
(item) => item.key == lensVariantKey
|
|
1037
|
-
);
|
|
1038
|
-
const frameId = frameVariantId ? Number(frameVariantId.value) : null;
|
|
1039
|
-
const lensId = lensVariantId ? Number(lensVariantId.value) : null;
|
|
1040
|
-
const eventData = {
|
|
1041
|
-
frameIdentifier: frameId,
|
|
1042
|
-
lensIdentifier: lensId
|
|
1043
|
-
};
|
|
1044
|
-
customEvent.emitEvent("onAddToCart", eventData);
|
|
1045
|
-
var cartItems = [];
|
|
1046
|
-
if (frameVariantId) {
|
|
1047
|
-
var frameItem = {
|
|
1048
|
-
id: frameId,
|
|
1049
|
-
quantity: 1
|
|
1050
|
-
};
|
|
1051
|
-
cartItems.push(frameItem);
|
|
1052
|
-
}
|
|
1053
|
-
if (lensVariantId) {
|
|
1054
|
-
var lensItem = {
|
|
1055
|
-
id: lensId,
|
|
1056
|
-
quantity: 1
|
|
1057
|
-
};
|
|
1058
|
-
cartItems.push(lensItem);
|
|
1059
|
-
}
|
|
1060
|
-
apiService2.HandleShopifyAddToCart(cartItems);
|
|
1061
|
-
}
|
|
1062
|
-
},
|
|
1063
|
-
type: "button",
|
|
1064
|
-
children: "Add to cart"
|
|
1065
|
-
}
|
|
1066
|
-
)
|
|
1067
|
-
] })
|
|
1068
|
-
] }) }),
|
|
1069
|
-
/* @__PURE__ */ jsxRuntimeExports.jsxs("div", { id: "Sprie-config-Viewer-Container", children: [
|
|
1070
|
-
modelLoading && /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "sprie-config-loadingFrame", children: [
|
|
1071
|
-
/* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "sprie-config-loader" }),
|
|
1072
|
-
"."
|
|
1073
|
-
] }),
|
|
1074
|
-
/* @__PURE__ */ jsxRuntimeExports.jsx("div", { style: { width: "100%", height: "100%" }, id: "holder-canvas" })
|
|
1075
|
-
] })
|
|
1076
|
-
] });
|
|
1077
|
-
}
|
|
1078
674
|
var __defProp2 = Object.defineProperty;
|
|
1079
675
|
var __defNormalProp2 = (obj, key, value) => key in obj ? __defProp2(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
1080
676
|
var __publicField2 = (obj, key, value) => {
|
|
@@ -1126,9 +722,9 @@ var __publicField = (obj, key, value) => {
|
|
|
1126
722
|
baseURL: config.host
|
|
1127
723
|
});
|
|
1128
724
|
function modifyLensArr(arr, element) {
|
|
1129
|
-
const
|
|
1130
|
-
if (
|
|
1131
|
-
return [element, ...arr.slice(0,
|
|
725
|
+
const index2 = arr.findIndex((e) => e["sku"] === element["sku"]);
|
|
726
|
+
if (index2 !== -1) {
|
|
727
|
+
return [element, ...arr.slice(0, index2), ...arr.slice(index2 + 1)];
|
|
1132
728
|
}
|
|
1133
729
|
return arr;
|
|
1134
730
|
}
|
|
@@ -1622,9 +1218,9 @@ var __publicField = (obj, key, value) => {
|
|
|
1622
1218
|
copy[i] = arr[i];
|
|
1623
1219
|
return copy;
|
|
1624
1220
|
}
|
|
1625
|
-
function spliceOne$1(list,
|
|
1626
|
-
for (;
|
|
1627
|
-
list[
|
|
1221
|
+
function spliceOne$1(list, index2) {
|
|
1222
|
+
for (; index2 + 1 < list.length; index2++)
|
|
1223
|
+
list[index2] = list[index2 + 1];
|
|
1628
1224
|
list.pop();
|
|
1629
1225
|
}
|
|
1630
1226
|
function unwrapListeners$1(arr) {
|
|
@@ -8188,8 +7784,8 @@ var __publicField = (obj, key, value) => {
|
|
|
8188
7784
|
}
|
|
8189
7785
|
}
|
|
8190
7786
|
let keyIndex = 0;
|
|
8191
|
-
for (let
|
|
8192
|
-
ctx.pbox[
|
|
7787
|
+
for (let index2 = 0; index2 < N + 2; index2++) {
|
|
7788
|
+
ctx.pbox[index2] = ORIG_P[index2] ^ key[keyIndex];
|
|
8193
7789
|
keyIndex++;
|
|
8194
7790
|
if (keyIndex >= keysize) {
|
|
8195
7791
|
keyIndex = 0;
|
|
@@ -12663,9 +12259,9 @@ var __publicField = (obj, key, value) => {
|
|
|
12663
12259
|
const listeners2 = this._listeners;
|
|
12664
12260
|
const listenerArray = listeners2[type];
|
|
12665
12261
|
if (listenerArray !== void 0) {
|
|
12666
|
-
const
|
|
12667
|
-
if (
|
|
12668
|
-
listenerArray.splice(
|
|
12262
|
+
const index2 = listenerArray.indexOf(listener);
|
|
12263
|
+
if (index2 !== -1) {
|
|
12264
|
+
listenerArray.splice(index2, 1);
|
|
12669
12265
|
}
|
|
12670
12266
|
}
|
|
12671
12267
|
}
|
|
@@ -12905,8 +12501,8 @@ var __publicField = (obj, key, value) => {
|
|
|
12905
12501
|
this.y = y;
|
|
12906
12502
|
return this;
|
|
12907
12503
|
}
|
|
12908
|
-
setComponent(
|
|
12909
|
-
switch (
|
|
12504
|
+
setComponent(index2, value) {
|
|
12505
|
+
switch (index2) {
|
|
12910
12506
|
case 0:
|
|
12911
12507
|
this.x = value;
|
|
12912
12508
|
break;
|
|
@@ -12914,18 +12510,18 @@ var __publicField = (obj, key, value) => {
|
|
|
12914
12510
|
this.y = value;
|
|
12915
12511
|
break;
|
|
12916
12512
|
default:
|
|
12917
|
-
throw new Error("index is out of range: " +
|
|
12513
|
+
throw new Error("index is out of range: " + index2);
|
|
12918
12514
|
}
|
|
12919
12515
|
return this;
|
|
12920
12516
|
}
|
|
12921
|
-
getComponent(
|
|
12922
|
-
switch (
|
|
12517
|
+
getComponent(index2) {
|
|
12518
|
+
switch (index2) {
|
|
12923
12519
|
case 0:
|
|
12924
12520
|
return this.x;
|
|
12925
12521
|
case 1:
|
|
12926
12522
|
return this.y;
|
|
12927
12523
|
default:
|
|
12928
|
-
throw new Error("index is out of range: " +
|
|
12524
|
+
throw new Error("index is out of range: " + index2);
|
|
12929
12525
|
}
|
|
12930
12526
|
}
|
|
12931
12527
|
clone() {
|
|
@@ -13110,9 +12706,9 @@ var __publicField = (obj, key, value) => {
|
|
|
13110
12706
|
array[offset + 1] = this.y;
|
|
13111
12707
|
return array;
|
|
13112
12708
|
}
|
|
13113
|
-
fromBufferAttribute(attribute,
|
|
13114
|
-
this.x = attribute.getX(
|
|
13115
|
-
this.y = attribute.getY(
|
|
12709
|
+
fromBufferAttribute(attribute, index2) {
|
|
12710
|
+
this.x = attribute.getX(index2);
|
|
12711
|
+
this.y = attribute.getY(index2);
|
|
13116
12712
|
return this;
|
|
13117
12713
|
}
|
|
13118
12714
|
rotateAround(center, angle) {
|
|
@@ -13911,8 +13507,8 @@ var __publicField = (obj, key, value) => {
|
|
|
13911
13507
|
this.w = w2;
|
|
13912
13508
|
return this;
|
|
13913
13509
|
}
|
|
13914
|
-
setComponent(
|
|
13915
|
-
switch (
|
|
13510
|
+
setComponent(index2, value) {
|
|
13511
|
+
switch (index2) {
|
|
13916
13512
|
case 0:
|
|
13917
13513
|
this.x = value;
|
|
13918
13514
|
break;
|
|
@@ -13926,12 +13522,12 @@ var __publicField = (obj, key, value) => {
|
|
|
13926
13522
|
this.w = value;
|
|
13927
13523
|
break;
|
|
13928
13524
|
default:
|
|
13929
|
-
throw new Error("index is out of range: " +
|
|
13525
|
+
throw new Error("index is out of range: " + index2);
|
|
13930
13526
|
}
|
|
13931
13527
|
return this;
|
|
13932
13528
|
}
|
|
13933
|
-
getComponent(
|
|
13934
|
-
switch (
|
|
13529
|
+
getComponent(index2) {
|
|
13530
|
+
switch (index2) {
|
|
13935
13531
|
case 0:
|
|
13936
13532
|
return this.x;
|
|
13937
13533
|
case 1:
|
|
@@ -13941,7 +13537,7 @@ var __publicField = (obj, key, value) => {
|
|
|
13941
13537
|
case 3:
|
|
13942
13538
|
return this.w;
|
|
13943
13539
|
default:
|
|
13944
|
-
throw new Error("index is out of range: " +
|
|
13540
|
+
throw new Error("index is out of range: " + index2);
|
|
13945
13541
|
}
|
|
13946
13542
|
}
|
|
13947
13543
|
clone() {
|
|
@@ -14217,11 +13813,11 @@ var __publicField = (obj, key, value) => {
|
|
|
14217
13813
|
array[offset + 3] = this.w;
|
|
14218
13814
|
return array;
|
|
14219
13815
|
}
|
|
14220
|
-
fromBufferAttribute(attribute,
|
|
14221
|
-
this.x = attribute.getX(
|
|
14222
|
-
this.y = attribute.getY(
|
|
14223
|
-
this.z = attribute.getZ(
|
|
14224
|
-
this.w = attribute.getW(
|
|
13816
|
+
fromBufferAttribute(attribute, index2) {
|
|
13817
|
+
this.x = attribute.getX(index2);
|
|
13818
|
+
this.y = attribute.getY(index2);
|
|
13819
|
+
this.z = attribute.getZ(index2);
|
|
13820
|
+
this.w = attribute.getW(index2);
|
|
14225
13821
|
return this;
|
|
14226
13822
|
}
|
|
14227
13823
|
random() {
|
|
@@ -14715,11 +14311,11 @@ var __publicField = (obj, key, value) => {
|
|
|
14715
14311
|
array[offset + 3] = this._w;
|
|
14716
14312
|
return array;
|
|
14717
14313
|
}
|
|
14718
|
-
fromBufferAttribute(attribute,
|
|
14719
|
-
this._x = attribute.getX(
|
|
14720
|
-
this._y = attribute.getY(
|
|
14721
|
-
this._z = attribute.getZ(
|
|
14722
|
-
this._w = attribute.getW(
|
|
14314
|
+
fromBufferAttribute(attribute, index2) {
|
|
14315
|
+
this._x = attribute.getX(index2);
|
|
14316
|
+
this._y = attribute.getY(index2);
|
|
14317
|
+
this._z = attribute.getZ(index2);
|
|
14318
|
+
this._w = attribute.getW(index2);
|
|
14723
14319
|
return this;
|
|
14724
14320
|
}
|
|
14725
14321
|
toJSON() {
|
|
@@ -14771,8 +14367,8 @@ var __publicField = (obj, key, value) => {
|
|
|
14771
14367
|
this.z = z;
|
|
14772
14368
|
return this;
|
|
14773
14369
|
}
|
|
14774
|
-
setComponent(
|
|
14775
|
-
switch (
|
|
14370
|
+
setComponent(index2, value) {
|
|
14371
|
+
switch (index2) {
|
|
14776
14372
|
case 0:
|
|
14777
14373
|
this.x = value;
|
|
14778
14374
|
break;
|
|
@@ -14783,12 +14379,12 @@ var __publicField = (obj, key, value) => {
|
|
|
14783
14379
|
this.z = value;
|
|
14784
14380
|
break;
|
|
14785
14381
|
default:
|
|
14786
|
-
throw new Error("index is out of range: " +
|
|
14382
|
+
throw new Error("index is out of range: " + index2);
|
|
14787
14383
|
}
|
|
14788
14384
|
return this;
|
|
14789
14385
|
}
|
|
14790
|
-
getComponent(
|
|
14791
|
-
switch (
|
|
14386
|
+
getComponent(index2) {
|
|
14387
|
+
switch (index2) {
|
|
14792
14388
|
case 0:
|
|
14793
14389
|
return this.x;
|
|
14794
14390
|
case 1:
|
|
@@ -14796,7 +14392,7 @@ var __publicField = (obj, key, value) => {
|
|
|
14796
14392
|
case 2:
|
|
14797
14393
|
return this.z;
|
|
14798
14394
|
default:
|
|
14799
|
-
throw new Error("index is out of range: " +
|
|
14395
|
+
throw new Error("index is out of range: " + index2);
|
|
14800
14396
|
}
|
|
14801
14397
|
}
|
|
14802
14398
|
clone() {
|
|
@@ -15094,11 +14690,11 @@ var __publicField = (obj, key, value) => {
|
|
|
15094
14690
|
this.z = sz;
|
|
15095
14691
|
return this;
|
|
15096
14692
|
}
|
|
15097
|
-
setFromMatrixColumn(m2,
|
|
15098
|
-
return this.fromArray(m2.elements,
|
|
14693
|
+
setFromMatrixColumn(m2, index2) {
|
|
14694
|
+
return this.fromArray(m2.elements, index2 * 4);
|
|
15099
14695
|
}
|
|
15100
|
-
setFromMatrix3Column(m2,
|
|
15101
|
-
return this.fromArray(m2.elements,
|
|
14696
|
+
setFromMatrix3Column(m2, index2) {
|
|
14697
|
+
return this.fromArray(m2.elements, index2 * 3);
|
|
15102
14698
|
}
|
|
15103
14699
|
setFromEuler(e) {
|
|
15104
14700
|
this.x = e._x;
|
|
@@ -15127,10 +14723,10 @@ var __publicField = (obj, key, value) => {
|
|
|
15127
14723
|
array[offset + 2] = this.z;
|
|
15128
14724
|
return array;
|
|
15129
14725
|
}
|
|
15130
|
-
fromBufferAttribute(attribute,
|
|
15131
|
-
this.x = attribute.getX(
|
|
15132
|
-
this.y = attribute.getY(
|
|
15133
|
-
this.z = attribute.getZ(
|
|
14726
|
+
fromBufferAttribute(attribute, index2) {
|
|
14727
|
+
this.x = attribute.getX(index2);
|
|
14728
|
+
this.y = attribute.getY(index2);
|
|
14729
|
+
this.z = attribute.getZ(index2);
|
|
15134
14730
|
return this;
|
|
15135
14731
|
}
|
|
15136
14732
|
random() {
|
|
@@ -17004,10 +16600,10 @@ var __publicField = (obj, key, value) => {
|
|
|
17004
16600
|
}
|
|
17005
16601
|
return this;
|
|
17006
16602
|
}
|
|
17007
|
-
const
|
|
17008
|
-
if (
|
|
16603
|
+
const index2 = this.children.indexOf(object);
|
|
16604
|
+
if (index2 !== -1) {
|
|
17009
16605
|
object.parent = null;
|
|
17010
|
-
this.children.splice(
|
|
16606
|
+
this.children.splice(index2, 1);
|
|
17011
16607
|
object.dispatchEvent(_removedEvent);
|
|
17012
16608
|
}
|
|
17013
16609
|
return this;
|
|
@@ -17998,10 +17594,10 @@ var __publicField = (obj, key, value) => {
|
|
|
17998
17594
|
array[offset + 2] = this.b;
|
|
17999
17595
|
return array;
|
|
18000
17596
|
}
|
|
18001
|
-
fromBufferAttribute(attribute,
|
|
18002
|
-
this.r = attribute.getX(
|
|
18003
|
-
this.g = attribute.getY(
|
|
18004
|
-
this.b = attribute.getZ(
|
|
17597
|
+
fromBufferAttribute(attribute, index2) {
|
|
17598
|
+
this.r = attribute.getX(index2);
|
|
17599
|
+
this.g = attribute.getY(index2);
|
|
17600
|
+
this.b = attribute.getZ(index2);
|
|
18005
17601
|
return this;
|
|
18006
17602
|
}
|
|
18007
17603
|
toJSON() {
|
|
@@ -18673,100 +18269,100 @@ var __publicField = (obj, key, value) => {
|
|
|
18673
18269
|
this.array.set(value, offset);
|
|
18674
18270
|
return this;
|
|
18675
18271
|
}
|
|
18676
|
-
getComponent(
|
|
18677
|
-
let value = this.array[
|
|
18272
|
+
getComponent(index2, component) {
|
|
18273
|
+
let value = this.array[index2 * this.itemSize + component];
|
|
18678
18274
|
if (this.normalized)
|
|
18679
18275
|
value = denormalize(value, this.array);
|
|
18680
18276
|
return value;
|
|
18681
18277
|
}
|
|
18682
|
-
setComponent(
|
|
18278
|
+
setComponent(index2, component, value) {
|
|
18683
18279
|
if (this.normalized)
|
|
18684
18280
|
value = normalize(value, this.array);
|
|
18685
|
-
this.array[
|
|
18281
|
+
this.array[index2 * this.itemSize + component] = value;
|
|
18686
18282
|
return this;
|
|
18687
18283
|
}
|
|
18688
|
-
getX(
|
|
18689
|
-
let x2 = this.array[
|
|
18284
|
+
getX(index2) {
|
|
18285
|
+
let x2 = this.array[index2 * this.itemSize];
|
|
18690
18286
|
if (this.normalized)
|
|
18691
18287
|
x2 = denormalize(x2, this.array);
|
|
18692
18288
|
return x2;
|
|
18693
18289
|
}
|
|
18694
|
-
setX(
|
|
18290
|
+
setX(index2, x2) {
|
|
18695
18291
|
if (this.normalized)
|
|
18696
18292
|
x2 = normalize(x2, this.array);
|
|
18697
|
-
this.array[
|
|
18293
|
+
this.array[index2 * this.itemSize] = x2;
|
|
18698
18294
|
return this;
|
|
18699
18295
|
}
|
|
18700
|
-
getY(
|
|
18701
|
-
let y = this.array[
|
|
18296
|
+
getY(index2) {
|
|
18297
|
+
let y = this.array[index2 * this.itemSize + 1];
|
|
18702
18298
|
if (this.normalized)
|
|
18703
18299
|
y = denormalize(y, this.array);
|
|
18704
18300
|
return y;
|
|
18705
18301
|
}
|
|
18706
|
-
setY(
|
|
18302
|
+
setY(index2, y) {
|
|
18707
18303
|
if (this.normalized)
|
|
18708
18304
|
y = normalize(y, this.array);
|
|
18709
|
-
this.array[
|
|
18305
|
+
this.array[index2 * this.itemSize + 1] = y;
|
|
18710
18306
|
return this;
|
|
18711
18307
|
}
|
|
18712
|
-
getZ(
|
|
18713
|
-
let z = this.array[
|
|
18308
|
+
getZ(index2) {
|
|
18309
|
+
let z = this.array[index2 * this.itemSize + 2];
|
|
18714
18310
|
if (this.normalized)
|
|
18715
18311
|
z = denormalize(z, this.array);
|
|
18716
18312
|
return z;
|
|
18717
18313
|
}
|
|
18718
|
-
setZ(
|
|
18314
|
+
setZ(index2, z) {
|
|
18719
18315
|
if (this.normalized)
|
|
18720
18316
|
z = normalize(z, this.array);
|
|
18721
|
-
this.array[
|
|
18317
|
+
this.array[index2 * this.itemSize + 2] = z;
|
|
18722
18318
|
return this;
|
|
18723
18319
|
}
|
|
18724
|
-
getW(
|
|
18725
|
-
let w2 = this.array[
|
|
18320
|
+
getW(index2) {
|
|
18321
|
+
let w2 = this.array[index2 * this.itemSize + 3];
|
|
18726
18322
|
if (this.normalized)
|
|
18727
18323
|
w2 = denormalize(w2, this.array);
|
|
18728
18324
|
return w2;
|
|
18729
18325
|
}
|
|
18730
|
-
setW(
|
|
18326
|
+
setW(index2, w2) {
|
|
18731
18327
|
if (this.normalized)
|
|
18732
18328
|
w2 = normalize(w2, this.array);
|
|
18733
|
-
this.array[
|
|
18329
|
+
this.array[index2 * this.itemSize + 3] = w2;
|
|
18734
18330
|
return this;
|
|
18735
18331
|
}
|
|
18736
|
-
setXY(
|
|
18737
|
-
|
|
18332
|
+
setXY(index2, x2, y) {
|
|
18333
|
+
index2 *= this.itemSize;
|
|
18738
18334
|
if (this.normalized) {
|
|
18739
18335
|
x2 = normalize(x2, this.array);
|
|
18740
18336
|
y = normalize(y, this.array);
|
|
18741
18337
|
}
|
|
18742
|
-
this.array[
|
|
18743
|
-
this.array[
|
|
18338
|
+
this.array[index2 + 0] = x2;
|
|
18339
|
+
this.array[index2 + 1] = y;
|
|
18744
18340
|
return this;
|
|
18745
18341
|
}
|
|
18746
|
-
setXYZ(
|
|
18747
|
-
|
|
18342
|
+
setXYZ(index2, x2, y, z) {
|
|
18343
|
+
index2 *= this.itemSize;
|
|
18748
18344
|
if (this.normalized) {
|
|
18749
18345
|
x2 = normalize(x2, this.array);
|
|
18750
18346
|
y = normalize(y, this.array);
|
|
18751
18347
|
z = normalize(z, this.array);
|
|
18752
18348
|
}
|
|
18753
|
-
this.array[
|
|
18754
|
-
this.array[
|
|
18755
|
-
this.array[
|
|
18349
|
+
this.array[index2 + 0] = x2;
|
|
18350
|
+
this.array[index2 + 1] = y;
|
|
18351
|
+
this.array[index2 + 2] = z;
|
|
18756
18352
|
return this;
|
|
18757
18353
|
}
|
|
18758
|
-
setXYZW(
|
|
18759
|
-
|
|
18354
|
+
setXYZW(index2, x2, y, z, w2) {
|
|
18355
|
+
index2 *= this.itemSize;
|
|
18760
18356
|
if (this.normalized) {
|
|
18761
18357
|
x2 = normalize(x2, this.array);
|
|
18762
18358
|
y = normalize(y, this.array);
|
|
18763
18359
|
z = normalize(z, this.array);
|
|
18764
18360
|
w2 = normalize(w2, this.array);
|
|
18765
18361
|
}
|
|
18766
|
-
this.array[
|
|
18767
|
-
this.array[
|
|
18768
|
-
this.array[
|
|
18769
|
-
this.array[
|
|
18362
|
+
this.array[index2 + 0] = x2;
|
|
18363
|
+
this.array[index2 + 1] = y;
|
|
18364
|
+
this.array[index2 + 2] = z;
|
|
18365
|
+
this.array[index2 + 3] = w2;
|
|
18770
18366
|
return this;
|
|
18771
18367
|
}
|
|
18772
18368
|
onUpload(callback) {
|
|
@@ -18835,11 +18431,11 @@ var __publicField = (obj, key, value) => {
|
|
|
18835
18431
|
getIndex() {
|
|
18836
18432
|
return this.index;
|
|
18837
18433
|
}
|
|
18838
|
-
setIndex(
|
|
18839
|
-
if (Array.isArray(
|
|
18840
|
-
this.index = new (arrayNeedsUint32(
|
|
18434
|
+
setIndex(index2) {
|
|
18435
|
+
if (Array.isArray(index2)) {
|
|
18436
|
+
this.index = new (arrayNeedsUint32(index2) ? Uint32BufferAttribute : Uint16BufferAttribute)(index2, 1);
|
|
18841
18437
|
} else {
|
|
18842
|
-
this.index =
|
|
18438
|
+
this.index = index2;
|
|
18843
18439
|
}
|
|
18844
18440
|
return this;
|
|
18845
18441
|
}
|
|
@@ -19041,13 +18637,13 @@ var __publicField = (obj, key, value) => {
|
|
|
19041
18637
|
}
|
|
19042
18638
|
}
|
|
19043
18639
|
computeTangents() {
|
|
19044
|
-
const
|
|
18640
|
+
const index2 = this.index;
|
|
19045
18641
|
const attributes = this.attributes;
|
|
19046
|
-
if (
|
|
18642
|
+
if (index2 === null || attributes.position === void 0 || attributes.normal === void 0 || attributes.uv === void 0) {
|
|
19047
18643
|
console.error("THREE.BufferGeometry: .computeTangents() failed. Missing required attributes (index, position, normal or uv)");
|
|
19048
18644
|
return;
|
|
19049
18645
|
}
|
|
19050
|
-
const indices =
|
|
18646
|
+
const indices = index2.array;
|
|
19051
18647
|
const positions2 = attributes.position.array;
|
|
19052
18648
|
const normals = attributes.normal.array;
|
|
19053
18649
|
const uvs = attributes.uv.array;
|
|
@@ -19132,7 +18728,7 @@ var __publicField = (obj, key, value) => {
|
|
|
19132
18728
|
}
|
|
19133
18729
|
}
|
|
19134
18730
|
computeVertexNormals() {
|
|
19135
|
-
const
|
|
18731
|
+
const index2 = this.index;
|
|
19136
18732
|
const positionAttribute = this.getAttribute("position");
|
|
19137
18733
|
if (positionAttribute !== void 0) {
|
|
19138
18734
|
let normalAttribute = this.getAttribute("normal");
|
|
@@ -19147,11 +18743,11 @@ var __publicField = (obj, key, value) => {
|
|
|
19147
18743
|
const pA = new Vector3(), pB = new Vector3(), pC = new Vector3();
|
|
19148
18744
|
const nA = new Vector3(), nB = new Vector3(), nC = new Vector3();
|
|
19149
18745
|
const cb = new Vector3(), ab = new Vector3();
|
|
19150
|
-
if (
|
|
19151
|
-
for (let i = 0, il =
|
|
19152
|
-
const vA =
|
|
19153
|
-
const vB =
|
|
19154
|
-
const vC =
|
|
18746
|
+
if (index2) {
|
|
18747
|
+
for (let i = 0, il = index2.count; i < il; i += 3) {
|
|
18748
|
+
const vA = index2.getX(i + 0);
|
|
18749
|
+
const vB = index2.getX(i + 1);
|
|
18750
|
+
const vC = index2.getX(i + 2);
|
|
19155
18751
|
pA.fromBufferAttribute(positionAttribute, vA);
|
|
19156
18752
|
pB.fromBufferAttribute(positionAttribute, vB);
|
|
19157
18753
|
pC.fromBufferAttribute(positionAttribute, vC);
|
|
@@ -19199,15 +18795,15 @@ var __publicField = (obj, key, value) => {
|
|
|
19199
18795
|
const itemSize = attribute.itemSize;
|
|
19200
18796
|
const normalized = attribute.normalized;
|
|
19201
18797
|
const array2 = new array.constructor(indices2.length * itemSize);
|
|
19202
|
-
let
|
|
18798
|
+
let index2 = 0, index22 = 0;
|
|
19203
18799
|
for (let i = 0, l = indices2.length; i < l; i++) {
|
|
19204
18800
|
if (attribute.isInterleavedBufferAttribute) {
|
|
19205
|
-
|
|
18801
|
+
index2 = indices2[i] * attribute.data.stride + attribute.offset;
|
|
19206
18802
|
} else {
|
|
19207
|
-
|
|
18803
|
+
index2 = indices2[i] * itemSize;
|
|
19208
18804
|
}
|
|
19209
18805
|
for (let j = 0; j < itemSize; j++) {
|
|
19210
|
-
array2[
|
|
18806
|
+
array2[index22++] = array[index2++];
|
|
19211
18807
|
}
|
|
19212
18808
|
}
|
|
19213
18809
|
return new BufferAttribute(array2, itemSize, normalized);
|
|
@@ -19266,11 +18862,11 @@ var __publicField = (obj, key, value) => {
|
|
|
19266
18862
|
return data;
|
|
19267
18863
|
}
|
|
19268
18864
|
data.data = { attributes: {} };
|
|
19269
|
-
const
|
|
19270
|
-
if (
|
|
18865
|
+
const index2 = this.index;
|
|
18866
|
+
if (index2 !== null) {
|
|
19271
18867
|
data.data.index = {
|
|
19272
|
-
type:
|
|
19273
|
-
array: Array.prototype.slice.call(
|
|
18868
|
+
type: index2.array.constructor.name,
|
|
18869
|
+
array: Array.prototype.slice.call(index2.array)
|
|
19274
18870
|
};
|
|
19275
18871
|
}
|
|
19276
18872
|
const attributes = this.attributes;
|
|
@@ -19321,9 +18917,9 @@ var __publicField = (obj, key, value) => {
|
|
|
19321
18917
|
this.boundingSphere = null;
|
|
19322
18918
|
const data = {};
|
|
19323
18919
|
this.name = source.name;
|
|
19324
|
-
const
|
|
19325
|
-
if (
|
|
19326
|
-
this.setIndex(
|
|
18920
|
+
const index2 = source.index;
|
|
18921
|
+
if (index2 !== null) {
|
|
18922
|
+
this.setIndex(index2.clone(data));
|
|
19327
18923
|
}
|
|
19328
18924
|
const attributes = source.attributes;
|
|
19329
18925
|
for (const name in attributes) {
|
|
@@ -19417,12 +19013,12 @@ var __publicField = (obj, key, value) => {
|
|
|
19417
19013
|
}
|
|
19418
19014
|
}
|
|
19419
19015
|
}
|
|
19420
|
-
getVertexPosition(
|
|
19016
|
+
getVertexPosition(index2, target) {
|
|
19421
19017
|
const geometry = this.geometry;
|
|
19422
19018
|
const position = geometry.attributes.position;
|
|
19423
19019
|
const morphPosition = geometry.morphAttributes.position;
|
|
19424
19020
|
const morphTargetsRelative = geometry.morphTargetsRelative;
|
|
19425
|
-
target.fromBufferAttribute(position,
|
|
19021
|
+
target.fromBufferAttribute(position, index2);
|
|
19426
19022
|
const morphInfluences = this.morphTargetInfluences;
|
|
19427
19023
|
if (morphPosition && morphInfluences) {
|
|
19428
19024
|
_morphA.set(0, 0, 0);
|
|
@@ -19431,7 +19027,7 @@ var __publicField = (obj, key, value) => {
|
|
|
19431
19027
|
const morphAttribute = morphPosition[i];
|
|
19432
19028
|
if (influence === 0)
|
|
19433
19029
|
continue;
|
|
19434
|
-
_tempA.fromBufferAttribute(morphAttribute,
|
|
19030
|
+
_tempA.fromBufferAttribute(morphAttribute, index2);
|
|
19435
19031
|
if (morphTargetsRelative) {
|
|
19436
19032
|
_morphA.addScaledVector(_tempA, influence);
|
|
19437
19033
|
} else {
|
|
@@ -19471,24 +19067,24 @@ var __publicField = (obj, key, value) => {
|
|
|
19471
19067
|
let intersection;
|
|
19472
19068
|
const geometry = this.geometry;
|
|
19473
19069
|
const material = this.material;
|
|
19474
|
-
const
|
|
19070
|
+
const index2 = geometry.index;
|
|
19475
19071
|
const position = geometry.attributes.position;
|
|
19476
19072
|
const uv = geometry.attributes.uv;
|
|
19477
19073
|
const uv1 = geometry.attributes.uv1;
|
|
19478
19074
|
const normal = geometry.attributes.normal;
|
|
19479
19075
|
const groups = geometry.groups;
|
|
19480
19076
|
const drawRange = geometry.drawRange;
|
|
19481
|
-
if (
|
|
19077
|
+
if (index2 !== null) {
|
|
19482
19078
|
if (Array.isArray(material)) {
|
|
19483
19079
|
for (let i = 0, il = groups.length; i < il; i++) {
|
|
19484
19080
|
const group = groups[i];
|
|
19485
19081
|
const groupMaterial = material[group.materialIndex];
|
|
19486
19082
|
const start = Math.max(group.start, drawRange.start);
|
|
19487
|
-
const end = Math.min(
|
|
19083
|
+
const end = Math.min(index2.count, Math.min(group.start + group.count, drawRange.start + drawRange.count));
|
|
19488
19084
|
for (let j = start, jl = end; j < jl; j += 3) {
|
|
19489
|
-
const a =
|
|
19490
|
-
const b =
|
|
19491
|
-
const c2 =
|
|
19085
|
+
const a = index2.getX(j);
|
|
19086
|
+
const b = index2.getX(j + 1);
|
|
19087
|
+
const c2 = index2.getX(j + 2);
|
|
19492
19088
|
intersection = checkGeometryIntersection(this, groupMaterial, raycaster, rayLocalSpace, uv, uv1, normal, a, b, c2);
|
|
19493
19089
|
if (intersection) {
|
|
19494
19090
|
intersection.faceIndex = Math.floor(j / 3);
|
|
@@ -19499,11 +19095,11 @@ var __publicField = (obj, key, value) => {
|
|
|
19499
19095
|
}
|
|
19500
19096
|
} else {
|
|
19501
19097
|
const start = Math.max(0, drawRange.start);
|
|
19502
|
-
const end = Math.min(
|
|
19098
|
+
const end = Math.min(index2.count, drawRange.start + drawRange.count);
|
|
19503
19099
|
for (let i = start, il = end; i < il; i += 3) {
|
|
19504
|
-
const a =
|
|
19505
|
-
const b =
|
|
19506
|
-
const c2 =
|
|
19100
|
+
const a = index2.getX(i);
|
|
19101
|
+
const b = index2.getX(i + 1);
|
|
19102
|
+
const c2 = index2.getX(i + 2);
|
|
19507
19103
|
intersection = checkGeometryIntersection(this, material, raycaster, rayLocalSpace, uv, uv1, normal, a, b, c2);
|
|
19508
19104
|
if (intersection) {
|
|
19509
19105
|
intersection.faceIndex = Math.floor(i / 3);
|
|
@@ -21524,7 +21120,7 @@ var __publicField = (obj, key, value) => {
|
|
|
21524
21120
|
const defaultState = createBindingState(null);
|
|
21525
21121
|
let currentState = defaultState;
|
|
21526
21122
|
let forceUpdate = false;
|
|
21527
|
-
function setup(object, material, program, geometry,
|
|
21123
|
+
function setup(object, material, program, geometry, index2) {
|
|
21528
21124
|
let updateBuffers = false;
|
|
21529
21125
|
if (vaoAvailable) {
|
|
21530
21126
|
const state = getBindingState(geometry, program, material);
|
|
@@ -21532,9 +21128,9 @@ var __publicField = (obj, key, value) => {
|
|
|
21532
21128
|
currentState = state;
|
|
21533
21129
|
bindVertexArrayObject(currentState.object);
|
|
21534
21130
|
}
|
|
21535
|
-
updateBuffers = needsUpdate(object, geometry, program,
|
|
21131
|
+
updateBuffers = needsUpdate(object, geometry, program, index2);
|
|
21536
21132
|
if (updateBuffers)
|
|
21537
|
-
saveCache(object, geometry, program,
|
|
21133
|
+
saveCache(object, geometry, program, index2);
|
|
21538
21134
|
} else {
|
|
21539
21135
|
const wireframe = material.wireframe === true;
|
|
21540
21136
|
if (currentState.geometry !== geometry.id || currentState.program !== program.id || currentState.wireframe !== wireframe) {
|
|
@@ -21544,14 +21140,14 @@ var __publicField = (obj, key, value) => {
|
|
|
21544
21140
|
updateBuffers = true;
|
|
21545
21141
|
}
|
|
21546
21142
|
}
|
|
21547
|
-
if (
|
|
21548
|
-
attributes.update(
|
|
21143
|
+
if (index2 !== null) {
|
|
21144
|
+
attributes.update(index2, gl.ELEMENT_ARRAY_BUFFER);
|
|
21549
21145
|
}
|
|
21550
21146
|
if (updateBuffers || forceUpdate) {
|
|
21551
21147
|
forceUpdate = false;
|
|
21552
21148
|
setupVertexAttributes(object, material, program, geometry);
|
|
21553
|
-
if (
|
|
21554
|
-
gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, attributes.get(
|
|
21149
|
+
if (index2 !== null) {
|
|
21150
|
+
gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, attributes.get(index2).buffer);
|
|
21555
21151
|
}
|
|
21556
21152
|
}
|
|
21557
21153
|
}
|
|
@@ -21611,7 +21207,7 @@ var __publicField = (obj, key, value) => {
|
|
|
21611
21207
|
index: null
|
|
21612
21208
|
};
|
|
21613
21209
|
}
|
|
21614
|
-
function needsUpdate(object, geometry, program,
|
|
21210
|
+
function needsUpdate(object, geometry, program, index2) {
|
|
21615
21211
|
const cachedAttributes = currentState.attributes;
|
|
21616
21212
|
const geometryAttributes = geometry.attributes;
|
|
21617
21213
|
let attributesNum = 0;
|
|
@@ -21638,11 +21234,11 @@ var __publicField = (obj, key, value) => {
|
|
|
21638
21234
|
}
|
|
21639
21235
|
if (currentState.attributesNum !== attributesNum)
|
|
21640
21236
|
return true;
|
|
21641
|
-
if (currentState.index !==
|
|
21237
|
+
if (currentState.index !== index2)
|
|
21642
21238
|
return true;
|
|
21643
21239
|
return false;
|
|
21644
21240
|
}
|
|
21645
|
-
function saveCache(object, geometry, program,
|
|
21241
|
+
function saveCache(object, geometry, program, index2) {
|
|
21646
21242
|
const cache = {};
|
|
21647
21243
|
const attributes2 = geometry.attributes;
|
|
21648
21244
|
let attributesNum = 0;
|
|
@@ -21668,7 +21264,7 @@ var __publicField = (obj, key, value) => {
|
|
|
21668
21264
|
}
|
|
21669
21265
|
currentState.attributes = cache;
|
|
21670
21266
|
currentState.attributesNum = attributesNum;
|
|
21671
|
-
currentState.index =
|
|
21267
|
+
currentState.index = index2;
|
|
21672
21268
|
}
|
|
21673
21269
|
function initAttributes() {
|
|
21674
21270
|
const newAttributes = currentState.newAttributes;
|
|
@@ -21704,11 +21300,11 @@ var __publicField = (obj, key, value) => {
|
|
|
21704
21300
|
}
|
|
21705
21301
|
}
|
|
21706
21302
|
}
|
|
21707
|
-
function vertexAttribPointer(
|
|
21303
|
+
function vertexAttribPointer(index2, size, type, normalized, stride, offset, integer) {
|
|
21708
21304
|
if (integer === true) {
|
|
21709
|
-
gl.vertexAttribIPointer(
|
|
21305
|
+
gl.vertexAttribIPointer(index2, size, type, stride, offset);
|
|
21710
21306
|
} else {
|
|
21711
|
-
gl.vertexAttribPointer(
|
|
21307
|
+
gl.vertexAttribPointer(index2, size, type, normalized, stride, offset);
|
|
21712
21308
|
}
|
|
21713
21309
|
}
|
|
21714
21310
|
function setupVertexAttributes(object, material, program, geometry) {
|
|
@@ -23284,14 +22880,14 @@ var __publicField = (obj, key, value) => {
|
|
|
23284
22880
|
let morphInfluencesSum = 0;
|
|
23285
22881
|
for (let i = 0; i < 8; i++) {
|
|
23286
22882
|
const influence = workInfluences[i];
|
|
23287
|
-
const
|
|
22883
|
+
const index2 = influence[0];
|
|
23288
22884
|
const value = influence[1];
|
|
23289
|
-
if (
|
|
23290
|
-
if (morphTargets && geometry.getAttribute("morphTarget" + i) !== morphTargets[
|
|
23291
|
-
geometry.setAttribute("morphTarget" + i, morphTargets[
|
|
22885
|
+
if (index2 !== Number.MAX_SAFE_INTEGER && value) {
|
|
22886
|
+
if (morphTargets && geometry.getAttribute("morphTarget" + i) !== morphTargets[index2]) {
|
|
22887
|
+
geometry.setAttribute("morphTarget" + i, morphTargets[index2]);
|
|
23292
22888
|
}
|
|
23293
|
-
if (morphNormals && geometry.getAttribute("morphNormal" + i) !== morphNormals[
|
|
23294
|
-
geometry.setAttribute("morphNormal" + i, morphNormals[
|
|
22889
|
+
if (morphNormals && geometry.getAttribute("morphNormal" + i) !== morphNormals[index2]) {
|
|
22890
|
+
geometry.setAttribute("morphNormal" + i, morphNormals[index2]);
|
|
23295
22891
|
}
|
|
23296
22892
|
morphInfluences[i] = value;
|
|
23297
22893
|
morphInfluencesSum += value;
|
|
@@ -28336,27 +27932,27 @@ var __publicField = (obj, key, value) => {
|
|
|
28336
27932
|
this.cameraAutoUpdate = true;
|
|
28337
27933
|
this.enabled = false;
|
|
28338
27934
|
this.isPresenting = false;
|
|
28339
|
-
this.getController = function(
|
|
28340
|
-
let controller = controllers[
|
|
27935
|
+
this.getController = function(index2) {
|
|
27936
|
+
let controller = controllers[index2];
|
|
28341
27937
|
if (controller === void 0) {
|
|
28342
27938
|
controller = new WebXRController();
|
|
28343
|
-
controllers[
|
|
27939
|
+
controllers[index2] = controller;
|
|
28344
27940
|
}
|
|
28345
27941
|
return controller.getTargetRaySpace();
|
|
28346
27942
|
};
|
|
28347
|
-
this.getControllerGrip = function(
|
|
28348
|
-
let controller = controllers[
|
|
27943
|
+
this.getControllerGrip = function(index2) {
|
|
27944
|
+
let controller = controllers[index2];
|
|
28349
27945
|
if (controller === void 0) {
|
|
28350
27946
|
controller = new WebXRController();
|
|
28351
|
-
controllers[
|
|
27947
|
+
controllers[index2] = controller;
|
|
28352
27948
|
}
|
|
28353
27949
|
return controller.getGripSpace();
|
|
28354
27950
|
};
|
|
28355
|
-
this.getHand = function(
|
|
28356
|
-
let controller = controllers[
|
|
27951
|
+
this.getHand = function(index2) {
|
|
27952
|
+
let controller = controllers[index2];
|
|
28357
27953
|
if (controller === void 0) {
|
|
28358
27954
|
controller = new WebXRController();
|
|
28359
|
-
controllers[
|
|
27955
|
+
controllers[index2] = controller;
|
|
28360
27956
|
}
|
|
28361
27957
|
return controller.getHandSpace();
|
|
28362
27958
|
};
|
|
@@ -28514,10 +28110,10 @@ var __publicField = (obj, key, value) => {
|
|
|
28514
28110
|
function onInputSourcesChange(event) {
|
|
28515
28111
|
for (let i = 0; i < event.removed.length; i++) {
|
|
28516
28112
|
const inputSource = event.removed[i];
|
|
28517
|
-
const
|
|
28518
|
-
if (
|
|
28519
|
-
controllerInputSources[
|
|
28520
|
-
controllers[
|
|
28113
|
+
const index2 = controllerInputSources.indexOf(inputSource);
|
|
28114
|
+
if (index2 >= 0) {
|
|
28115
|
+
controllerInputSources[index2] = null;
|
|
28116
|
+
controllers[index2].disconnect(inputSource);
|
|
28521
28117
|
}
|
|
28522
28118
|
}
|
|
28523
28119
|
for (let i = 0; i < event.added.length; i++) {
|
|
@@ -29105,28 +28701,28 @@ var __publicField = (obj, key, value) => {
|
|
|
29105
28701
|
}
|
|
29106
28702
|
gl.bindBuffer(gl.UNIFORM_BUFFER, null);
|
|
29107
28703
|
}
|
|
29108
|
-
function hasUniformChanged(uniform,
|
|
28704
|
+
function hasUniformChanged(uniform, index2, cache) {
|
|
29109
28705
|
const value = uniform.value;
|
|
29110
|
-
if (cache[
|
|
28706
|
+
if (cache[index2] === void 0) {
|
|
29111
28707
|
if (typeof value === "number") {
|
|
29112
|
-
cache[
|
|
28708
|
+
cache[index2] = value;
|
|
29113
28709
|
} else {
|
|
29114
28710
|
const values = Array.isArray(value) ? value : [value];
|
|
29115
28711
|
const tempValues = [];
|
|
29116
28712
|
for (let i = 0; i < values.length; i++) {
|
|
29117
28713
|
tempValues.push(values[i].clone());
|
|
29118
28714
|
}
|
|
29119
|
-
cache[
|
|
28715
|
+
cache[index2] = tempValues;
|
|
29120
28716
|
}
|
|
29121
28717
|
return true;
|
|
29122
28718
|
} else {
|
|
29123
28719
|
if (typeof value === "number") {
|
|
29124
|
-
if (cache[
|
|
29125
|
-
cache[
|
|
28720
|
+
if (cache[index2] !== value) {
|
|
28721
|
+
cache[index2] = value;
|
|
29126
28722
|
return true;
|
|
29127
28723
|
}
|
|
29128
28724
|
} else {
|
|
29129
|
-
const cachedObjects = Array.isArray(cache[
|
|
28725
|
+
const cachedObjects = Array.isArray(cache[index2]) ? cache[index2] : [cache[index2]];
|
|
29130
28726
|
const values = Array.isArray(value) ? value : [value];
|
|
29131
28727
|
for (let i = 0; i < cachedObjects.length; i++) {
|
|
29132
28728
|
const cachedObject = cachedObjects[i];
|
|
@@ -29213,8 +28809,8 @@ var __publicField = (obj, key, value) => {
|
|
|
29213
28809
|
function onUniformsGroupsDispose(event) {
|
|
29214
28810
|
const uniformsGroup = event.target;
|
|
29215
28811
|
uniformsGroup.removeEventListener("dispose", onUniformsGroupsDispose);
|
|
29216
|
-
const
|
|
29217
|
-
allocatedBindingPoints.splice(
|
|
28812
|
+
const index2 = allocatedBindingPoints.indexOf(uniformsGroup.__bindingPointIndex);
|
|
28813
|
+
allocatedBindingPoints.splice(index2, 1);
|
|
29218
28814
|
gl.deleteBuffer(buffers[uniformsGroup.id]);
|
|
29219
28815
|
delete buffers[uniformsGroup.id];
|
|
29220
28816
|
delete updateList[uniformsGroup.id];
|
|
@@ -29634,11 +29230,11 @@ var __publicField = (obj, key, value) => {
|
|
|
29634
29230
|
const frontFaceCW = object.isMesh && object.matrixWorld.determinant() < 0;
|
|
29635
29231
|
const program = setProgram(camera, scene, geometry, material, object);
|
|
29636
29232
|
state.setMaterial(material, frontFaceCW);
|
|
29637
|
-
let
|
|
29233
|
+
let index2 = geometry.index;
|
|
29638
29234
|
let rangeFactor = 1;
|
|
29639
29235
|
if (material.wireframe === true) {
|
|
29640
|
-
|
|
29641
|
-
if (
|
|
29236
|
+
index2 = geometries.getWireframeAttribute(geometry);
|
|
29237
|
+
if (index2 === void 0)
|
|
29642
29238
|
return;
|
|
29643
29239
|
rangeFactor = 2;
|
|
29644
29240
|
}
|
|
@@ -29650,9 +29246,9 @@ var __publicField = (obj, key, value) => {
|
|
|
29650
29246
|
drawStart = Math.max(drawStart, group.start * rangeFactor);
|
|
29651
29247
|
drawEnd = Math.min(drawEnd, (group.start + group.count) * rangeFactor);
|
|
29652
29248
|
}
|
|
29653
|
-
if (
|
|
29249
|
+
if (index2 !== null) {
|
|
29654
29250
|
drawStart = Math.max(drawStart, 0);
|
|
29655
|
-
drawEnd = Math.min(drawEnd,
|
|
29251
|
+
drawEnd = Math.min(drawEnd, index2.count);
|
|
29656
29252
|
} else if (position !== void 0 && position !== null) {
|
|
29657
29253
|
drawStart = Math.max(drawStart, 0);
|
|
29658
29254
|
drawEnd = Math.min(drawEnd, position.count);
|
|
@@ -29660,11 +29256,11 @@ var __publicField = (obj, key, value) => {
|
|
|
29660
29256
|
const drawCount = drawEnd - drawStart;
|
|
29661
29257
|
if (drawCount < 0 || drawCount === Infinity)
|
|
29662
29258
|
return;
|
|
29663
|
-
bindingStates.setup(object, material, program, geometry,
|
|
29259
|
+
bindingStates.setup(object, material, program, geometry, index2);
|
|
29664
29260
|
let attribute;
|
|
29665
29261
|
let renderer = bufferRenderer;
|
|
29666
|
-
if (
|
|
29667
|
-
attribute = attributes.get(
|
|
29262
|
+
if (index2 !== null) {
|
|
29263
|
+
attribute = attributes.get(index2);
|
|
29668
29264
|
renderer = indexedBufferRenderer;
|
|
29669
29265
|
renderer.setIndex(attribute);
|
|
29670
29266
|
}
|
|
@@ -30765,88 +30361,88 @@ var __publicField = (obj, key, value) => {
|
|
|
30765
30361
|
}
|
|
30766
30362
|
return this;
|
|
30767
30363
|
}
|
|
30768
|
-
setX(
|
|
30364
|
+
setX(index2, x2) {
|
|
30769
30365
|
if (this.normalized)
|
|
30770
30366
|
x2 = normalize(x2, this.array);
|
|
30771
|
-
this.data.array[
|
|
30367
|
+
this.data.array[index2 * this.data.stride + this.offset] = x2;
|
|
30772
30368
|
return this;
|
|
30773
30369
|
}
|
|
30774
|
-
setY(
|
|
30370
|
+
setY(index2, y) {
|
|
30775
30371
|
if (this.normalized)
|
|
30776
30372
|
y = normalize(y, this.array);
|
|
30777
|
-
this.data.array[
|
|
30373
|
+
this.data.array[index2 * this.data.stride + this.offset + 1] = y;
|
|
30778
30374
|
return this;
|
|
30779
30375
|
}
|
|
30780
|
-
setZ(
|
|
30376
|
+
setZ(index2, z) {
|
|
30781
30377
|
if (this.normalized)
|
|
30782
30378
|
z = normalize(z, this.array);
|
|
30783
|
-
this.data.array[
|
|
30379
|
+
this.data.array[index2 * this.data.stride + this.offset + 2] = z;
|
|
30784
30380
|
return this;
|
|
30785
30381
|
}
|
|
30786
|
-
setW(
|
|
30382
|
+
setW(index2, w2) {
|
|
30787
30383
|
if (this.normalized)
|
|
30788
30384
|
w2 = normalize(w2, this.array);
|
|
30789
|
-
this.data.array[
|
|
30385
|
+
this.data.array[index2 * this.data.stride + this.offset + 3] = w2;
|
|
30790
30386
|
return this;
|
|
30791
30387
|
}
|
|
30792
|
-
getX(
|
|
30793
|
-
let x2 = this.data.array[
|
|
30388
|
+
getX(index2) {
|
|
30389
|
+
let x2 = this.data.array[index2 * this.data.stride + this.offset];
|
|
30794
30390
|
if (this.normalized)
|
|
30795
30391
|
x2 = denormalize(x2, this.array);
|
|
30796
30392
|
return x2;
|
|
30797
30393
|
}
|
|
30798
|
-
getY(
|
|
30799
|
-
let y = this.data.array[
|
|
30394
|
+
getY(index2) {
|
|
30395
|
+
let y = this.data.array[index2 * this.data.stride + this.offset + 1];
|
|
30800
30396
|
if (this.normalized)
|
|
30801
30397
|
y = denormalize(y, this.array);
|
|
30802
30398
|
return y;
|
|
30803
30399
|
}
|
|
30804
|
-
getZ(
|
|
30805
|
-
let z = this.data.array[
|
|
30400
|
+
getZ(index2) {
|
|
30401
|
+
let z = this.data.array[index2 * this.data.stride + this.offset + 2];
|
|
30806
30402
|
if (this.normalized)
|
|
30807
30403
|
z = denormalize(z, this.array);
|
|
30808
30404
|
return z;
|
|
30809
30405
|
}
|
|
30810
|
-
getW(
|
|
30811
|
-
let w2 = this.data.array[
|
|
30406
|
+
getW(index2) {
|
|
30407
|
+
let w2 = this.data.array[index2 * this.data.stride + this.offset + 3];
|
|
30812
30408
|
if (this.normalized)
|
|
30813
30409
|
w2 = denormalize(w2, this.array);
|
|
30814
30410
|
return w2;
|
|
30815
30411
|
}
|
|
30816
|
-
setXY(
|
|
30817
|
-
|
|
30412
|
+
setXY(index2, x2, y) {
|
|
30413
|
+
index2 = index2 * this.data.stride + this.offset;
|
|
30818
30414
|
if (this.normalized) {
|
|
30819
30415
|
x2 = normalize(x2, this.array);
|
|
30820
30416
|
y = normalize(y, this.array);
|
|
30821
30417
|
}
|
|
30822
|
-
this.data.array[
|
|
30823
|
-
this.data.array[
|
|
30418
|
+
this.data.array[index2 + 0] = x2;
|
|
30419
|
+
this.data.array[index2 + 1] = y;
|
|
30824
30420
|
return this;
|
|
30825
30421
|
}
|
|
30826
|
-
setXYZ(
|
|
30827
|
-
|
|
30422
|
+
setXYZ(index2, x2, y, z) {
|
|
30423
|
+
index2 = index2 * this.data.stride + this.offset;
|
|
30828
30424
|
if (this.normalized) {
|
|
30829
30425
|
x2 = normalize(x2, this.array);
|
|
30830
30426
|
y = normalize(y, this.array);
|
|
30831
30427
|
z = normalize(z, this.array);
|
|
30832
30428
|
}
|
|
30833
|
-
this.data.array[
|
|
30834
|
-
this.data.array[
|
|
30835
|
-
this.data.array[
|
|
30429
|
+
this.data.array[index2 + 0] = x2;
|
|
30430
|
+
this.data.array[index2 + 1] = y;
|
|
30431
|
+
this.data.array[index2 + 2] = z;
|
|
30836
30432
|
return this;
|
|
30837
30433
|
}
|
|
30838
|
-
setXYZW(
|
|
30839
|
-
|
|
30434
|
+
setXYZW(index2, x2, y, z, w2) {
|
|
30435
|
+
index2 = index2 * this.data.stride + this.offset;
|
|
30840
30436
|
if (this.normalized) {
|
|
30841
30437
|
x2 = normalize(x2, this.array);
|
|
30842
30438
|
y = normalize(y, this.array);
|
|
30843
30439
|
z = normalize(z, this.array);
|
|
30844
30440
|
w2 = normalize(w2, this.array);
|
|
30845
30441
|
}
|
|
30846
|
-
this.data.array[
|
|
30847
|
-
this.data.array[
|
|
30848
|
-
this.data.array[
|
|
30849
|
-
this.data.array[
|
|
30442
|
+
this.data.array[index2 + 0] = x2;
|
|
30443
|
+
this.data.array[index2 + 1] = y;
|
|
30444
|
+
this.data.array[index2 + 2] = z;
|
|
30445
|
+
this.data.array[index2 + 3] = w2;
|
|
30850
30446
|
return this;
|
|
30851
30447
|
}
|
|
30852
30448
|
clone(data) {
|
|
@@ -30854,9 +30450,9 @@ var __publicField = (obj, key, value) => {
|
|
|
30854
30450
|
console.log("THREE.InterleavedBufferAttribute.clone(): Cloning an interleaved buffer attribute will de-interleave buffer data.");
|
|
30855
30451
|
const array = [];
|
|
30856
30452
|
for (let i = 0; i < this.count; i++) {
|
|
30857
|
-
const
|
|
30453
|
+
const index2 = i * this.data.stride + this.offset;
|
|
30858
30454
|
for (let j = 0; j < this.itemSize; j++) {
|
|
30859
|
-
array.push(this.data.array[
|
|
30455
|
+
array.push(this.data.array[index2 + j]);
|
|
30860
30456
|
}
|
|
30861
30457
|
}
|
|
30862
30458
|
return new BufferAttribute(new this.array.constructor(array), this.itemSize, this.normalized);
|
|
@@ -30875,9 +30471,9 @@ var __publicField = (obj, key, value) => {
|
|
|
30875
30471
|
console.log("THREE.InterleavedBufferAttribute.toJSON(): Serializing an interleaved buffer attribute will de-interleave buffer data.");
|
|
30876
30472
|
const array = [];
|
|
30877
30473
|
for (let i = 0; i < this.count; i++) {
|
|
30878
|
-
const
|
|
30474
|
+
const index2 = i * this.data.stride + this.offset;
|
|
30879
30475
|
for (let j = 0; j < this.itemSize; j++) {
|
|
30880
|
-
array.push(this.data.array[
|
|
30476
|
+
array.push(this.data.array[index2 + j]);
|
|
30881
30477
|
}
|
|
30882
30478
|
}
|
|
30883
30479
|
return {
|
|
@@ -30978,9 +30574,9 @@ var __publicField = (obj, key, value) => {
|
|
|
30978
30574
|
}
|
|
30979
30575
|
this._computeIntersections(raycaster, intersects, _ray$2);
|
|
30980
30576
|
}
|
|
30981
|
-
getVertexPosition(
|
|
30982
|
-
super.getVertexPosition(
|
|
30983
|
-
this.applyBoneTransform(
|
|
30577
|
+
getVertexPosition(index2, target) {
|
|
30578
|
+
super.getVertexPosition(index2, target);
|
|
30579
|
+
this.applyBoneTransform(index2, target);
|
|
30984
30580
|
return target;
|
|
30985
30581
|
}
|
|
30986
30582
|
bind(skeleton, bindMatrix) {
|
|
@@ -31020,11 +30616,11 @@ var __publicField = (obj, key, value) => {
|
|
|
31020
30616
|
console.warn("THREE.SkinnedMesh: Unrecognized bindMode: " + this.bindMode);
|
|
31021
30617
|
}
|
|
31022
30618
|
}
|
|
31023
|
-
applyBoneTransform(
|
|
30619
|
+
applyBoneTransform(index2, vector) {
|
|
31024
30620
|
const skeleton = this.skeleton;
|
|
31025
30621
|
const geometry = this.geometry;
|
|
31026
|
-
_skinIndex.fromBufferAttribute(geometry.attributes.skinIndex,
|
|
31027
|
-
_skinWeight.fromBufferAttribute(geometry.attributes.skinWeight,
|
|
30622
|
+
_skinIndex.fromBufferAttribute(geometry.attributes.skinIndex, index2);
|
|
30623
|
+
_skinWeight.fromBufferAttribute(geometry.attributes.skinWeight, index2);
|
|
31028
30624
|
_basePosition.copy(vector).applyMatrix4(this.bindMatrix);
|
|
31029
30625
|
vector.set(0, 0, 0);
|
|
31030
30626
|
for (let i = 0; i < 4; i++) {
|
|
@@ -31037,9 +30633,9 @@ var __publicField = (obj, key, value) => {
|
|
|
31037
30633
|
}
|
|
31038
30634
|
return vector.applyMatrix4(this.bindMatrixInverse);
|
|
31039
30635
|
}
|
|
31040
|
-
boneTransform(
|
|
30636
|
+
boneTransform(index2, vector) {
|
|
31041
30637
|
console.warn("THREE.SkinnedMesh: .boneTransform() was renamed to .applyBoneTransform() in r151.");
|
|
31042
|
-
return this.applyBoneTransform(
|
|
30638
|
+
return this.applyBoneTransform(index2, vector);
|
|
31043
30639
|
}
|
|
31044
30640
|
}
|
|
31045
30641
|
class Bone extends Object3D {
|
|
@@ -31281,11 +30877,11 @@ var __publicField = (obj, key, value) => {
|
|
|
31281
30877
|
this.boundingSphere = source.boundingSphere.clone();
|
|
31282
30878
|
return this;
|
|
31283
30879
|
}
|
|
31284
|
-
getColorAt(
|
|
31285
|
-
color.fromArray(this.instanceColor.array,
|
|
30880
|
+
getColorAt(index2, color) {
|
|
30881
|
+
color.fromArray(this.instanceColor.array, index2 * 3);
|
|
31286
30882
|
}
|
|
31287
|
-
getMatrixAt(
|
|
31288
|
-
matrix.fromArray(this.instanceMatrix.array,
|
|
30883
|
+
getMatrixAt(index2, matrix) {
|
|
30884
|
+
matrix.fromArray(this.instanceMatrix.array, index2 * 16);
|
|
31289
30885
|
}
|
|
31290
30886
|
raycast(raycaster, intersects) {
|
|
31291
30887
|
const matrixWorld = this.matrixWorld;
|
|
@@ -31314,14 +30910,14 @@ var __publicField = (obj, key, value) => {
|
|
|
31314
30910
|
_instanceIntersects.length = 0;
|
|
31315
30911
|
}
|
|
31316
30912
|
}
|
|
31317
|
-
setColorAt(
|
|
30913
|
+
setColorAt(index2, color) {
|
|
31318
30914
|
if (this.instanceColor === null) {
|
|
31319
30915
|
this.instanceColor = new InstancedBufferAttribute(new Float32Array(this.instanceMatrix.count * 3), 3);
|
|
31320
30916
|
}
|
|
31321
|
-
color.toArray(this.instanceColor.array,
|
|
30917
|
+
color.toArray(this.instanceColor.array, index2 * 3);
|
|
31322
30918
|
}
|
|
31323
|
-
setMatrixAt(
|
|
31324
|
-
matrix.toArray(this.instanceMatrix.array,
|
|
30919
|
+
setMatrixAt(index2, matrix) {
|
|
30920
|
+
matrix.toArray(this.instanceMatrix.array, index2 * 16);
|
|
31325
30921
|
}
|
|
31326
30922
|
updateMorphTargets() {
|
|
31327
30923
|
}
|
|
@@ -31411,15 +31007,15 @@ var __publicField = (obj, key, value) => {
|
|
|
31411
31007
|
const interSegment = new Vector3();
|
|
31412
31008
|
const interRay = new Vector3();
|
|
31413
31009
|
const step = this.isLineSegments ? 2 : 1;
|
|
31414
|
-
const
|
|
31010
|
+
const index2 = geometry.index;
|
|
31415
31011
|
const attributes = geometry.attributes;
|
|
31416
31012
|
const positionAttribute = attributes.position;
|
|
31417
|
-
if (
|
|
31013
|
+
if (index2 !== null) {
|
|
31418
31014
|
const start = Math.max(0, drawRange.start);
|
|
31419
|
-
const end = Math.min(
|
|
31015
|
+
const end = Math.min(index2.count, drawRange.start + drawRange.count);
|
|
31420
31016
|
for (let i = start, l = end - 1; i < l; i += step) {
|
|
31421
|
-
const a =
|
|
31422
|
-
const b =
|
|
31017
|
+
const a = index2.getX(i);
|
|
31018
|
+
const b = index2.getX(i + 1);
|
|
31423
31019
|
vStart.fromBufferAttribute(positionAttribute, a);
|
|
31424
31020
|
vEnd.fromBufferAttribute(positionAttribute, b);
|
|
31425
31021
|
const distSq = _ray$1.distanceSqToSegment(vStart, vEnd, interRay, interSegment);
|
|
@@ -31576,14 +31172,14 @@ var __publicField = (obj, key, value) => {
|
|
|
31576
31172
|
_ray$4.copy(raycaster.ray).applyMatrix4(_inverseMatrix);
|
|
31577
31173
|
const localThreshold = threshold / ((this.scale.x + this.scale.y + this.scale.z) / 3);
|
|
31578
31174
|
const localThresholdSq = localThreshold * localThreshold;
|
|
31579
|
-
const
|
|
31175
|
+
const index2 = geometry.index;
|
|
31580
31176
|
const attributes = geometry.attributes;
|
|
31581
31177
|
const positionAttribute = attributes.position;
|
|
31582
|
-
if (
|
|
31178
|
+
if (index2 !== null) {
|
|
31583
31179
|
const start = Math.max(0, drawRange.start);
|
|
31584
|
-
const end = Math.min(
|
|
31180
|
+
const end = Math.min(index2.count, drawRange.start + drawRange.count);
|
|
31585
31181
|
for (let i = start, il = end; i < il; i++) {
|
|
31586
|
-
const a =
|
|
31182
|
+
const a = index2.getX(i);
|
|
31587
31183
|
_position$2.fromBufferAttribute(positionAttribute, a);
|
|
31588
31184
|
testPoint(_position$2, a, localThresholdSq, matrixWorld, raycaster, intersects, this);
|
|
31589
31185
|
}
|
|
@@ -31614,7 +31210,7 @@ var __publicField = (obj, key, value) => {
|
|
|
31614
31210
|
}
|
|
31615
31211
|
}
|
|
31616
31212
|
}
|
|
31617
|
-
function testPoint(point,
|
|
31213
|
+
function testPoint(point, index2, localThresholdSq, matrixWorld, raycaster, intersects, object) {
|
|
31618
31214
|
const rayPointDistanceSq = _ray$4.distanceSqToPoint(point);
|
|
31619
31215
|
if (rayPointDistanceSq < localThresholdSq) {
|
|
31620
31216
|
const intersectPoint = new Vector3();
|
|
@@ -31627,7 +31223,7 @@ var __publicField = (obj, key, value) => {
|
|
|
31627
31223
|
distance,
|
|
31628
31224
|
distanceToRay: Math.sqrt(rayPointDistanceSq),
|
|
31629
31225
|
point: intersectPoint,
|
|
31630
|
-
index,
|
|
31226
|
+
index: index2,
|
|
31631
31227
|
face: null,
|
|
31632
31228
|
object
|
|
31633
31229
|
});
|
|
@@ -32037,8 +31633,8 @@ var __publicField = (obj, key, value) => {
|
|
|
32037
31633
|
getSettings_() {
|
|
32038
31634
|
return this.settings || this.DefaultSettings_;
|
|
32039
31635
|
}
|
|
32040
|
-
copySampleValue_(
|
|
32041
|
-
const result = this.resultBuffer, values = this.sampleValues, stride = this.valueSize, offset =
|
|
31636
|
+
copySampleValue_(index2) {
|
|
31637
|
+
const result = this.resultBuffer, values = this.sampleValues, stride = this.valueSize, offset = index2 * stride;
|
|
32042
31638
|
for (let i = 0; i !== stride; ++i) {
|
|
32043
31639
|
result[i] = values[offset + i];
|
|
32044
31640
|
}
|
|
@@ -32737,9 +32333,9 @@ var __publicField = (obj, key, value) => {
|
|
|
32737
32333
|
return this;
|
|
32738
32334
|
};
|
|
32739
32335
|
this.removeHandler = function(regex) {
|
|
32740
|
-
const
|
|
32741
|
-
if (
|
|
32742
|
-
handlers.splice(
|
|
32336
|
+
const index2 = handlers.indexOf(regex);
|
|
32337
|
+
if (index2 !== -1) {
|
|
32338
|
+
handlers.splice(index2, 2);
|
|
32743
32339
|
}
|
|
32744
32340
|
return this;
|
|
32745
32341
|
};
|
|
@@ -33415,10 +33011,10 @@ var __publicField = (obj, key, value) => {
|
|
|
33415
33011
|
}
|
|
33416
33012
|
}
|
|
33417
33013
|
static extractUrlBase(url) {
|
|
33418
|
-
const
|
|
33419
|
-
if (
|
|
33014
|
+
const index2 = url.lastIndexOf("/");
|
|
33015
|
+
if (index2 === -1)
|
|
33420
33016
|
return "./";
|
|
33421
|
-
return url.slice(0,
|
|
33017
|
+
return url.slice(0, index2 + 1);
|
|
33422
33018
|
}
|
|
33423
33019
|
static resolveURL(url, path) {
|
|
33424
33020
|
if (typeof url !== "string" || url === "")
|
|
@@ -34768,8 +34364,8 @@ var __publicField = (obj, key, value) => {
|
|
|
34768
34364
|
return geometry;
|
|
34769
34365
|
}
|
|
34770
34366
|
if (drawMode === TriangleFanDrawMode || drawMode === TriangleStripDrawMode) {
|
|
34771
|
-
let
|
|
34772
|
-
if (
|
|
34367
|
+
let index2 = geometry.getIndex();
|
|
34368
|
+
if (index2 === null) {
|
|
34773
34369
|
const indices = [];
|
|
34774
34370
|
const position = geometry.getAttribute("position");
|
|
34775
34371
|
if (position !== void 0) {
|
|
@@ -34777,30 +34373,30 @@ var __publicField = (obj, key, value) => {
|
|
|
34777
34373
|
indices.push(i);
|
|
34778
34374
|
}
|
|
34779
34375
|
geometry.setIndex(indices);
|
|
34780
|
-
|
|
34376
|
+
index2 = geometry.getIndex();
|
|
34781
34377
|
} else {
|
|
34782
34378
|
console.error("THREE.BufferGeometryUtils.toTrianglesDrawMode(): Undefined position attribute. Processing not possible.");
|
|
34783
34379
|
return geometry;
|
|
34784
34380
|
}
|
|
34785
34381
|
}
|
|
34786
|
-
const numberOfTriangles =
|
|
34382
|
+
const numberOfTriangles = index2.count - 2;
|
|
34787
34383
|
const newIndices = [];
|
|
34788
34384
|
if (drawMode === TriangleFanDrawMode) {
|
|
34789
34385
|
for (let i = 1; i <= numberOfTriangles; i++) {
|
|
34790
|
-
newIndices.push(
|
|
34791
|
-
newIndices.push(
|
|
34792
|
-
newIndices.push(
|
|
34386
|
+
newIndices.push(index2.getX(0));
|
|
34387
|
+
newIndices.push(index2.getX(i));
|
|
34388
|
+
newIndices.push(index2.getX(i + 1));
|
|
34793
34389
|
}
|
|
34794
34390
|
} else {
|
|
34795
34391
|
for (let i = 0; i < numberOfTriangles; i++) {
|
|
34796
34392
|
if (i % 2 === 0) {
|
|
34797
|
-
newIndices.push(
|
|
34798
|
-
newIndices.push(
|
|
34799
|
-
newIndices.push(
|
|
34393
|
+
newIndices.push(index2.getX(i));
|
|
34394
|
+
newIndices.push(index2.getX(i + 1));
|
|
34395
|
+
newIndices.push(index2.getX(i + 2));
|
|
34800
34396
|
} else {
|
|
34801
|
-
newIndices.push(
|
|
34802
|
-
newIndices.push(
|
|
34803
|
-
newIndices.push(
|
|
34397
|
+
newIndices.push(index2.getX(i + 2));
|
|
34398
|
+
newIndices.push(index2.getX(i + 1));
|
|
34399
|
+
newIndices.push(index2.getX(i));
|
|
34804
34400
|
}
|
|
34805
34401
|
}
|
|
34806
34402
|
}
|
|
@@ -35118,10 +34714,10 @@ var __publicField = (obj, key, value) => {
|
|
|
35118
34714
|
parser.cache.add(cacheKey, dependency);
|
|
35119
34715
|
return dependency;
|
|
35120
34716
|
}
|
|
35121
|
-
getDependency(type,
|
|
34717
|
+
getDependency(type, index2) {
|
|
35122
34718
|
if (type !== "light")
|
|
35123
34719
|
return;
|
|
35124
|
-
return this._loadLight(
|
|
34720
|
+
return this._loadLight(index2);
|
|
35125
34721
|
}
|
|
35126
34722
|
createNodeAttachment(nodeIndex) {
|
|
35127
34723
|
const self2 = this;
|
|
@@ -35568,9 +35164,9 @@ var __publicField = (obj, key, value) => {
|
|
|
35568
35164
|
this.name = EXTENSIONS.EXT_MESHOPT_COMPRESSION;
|
|
35569
35165
|
this.parser = parser;
|
|
35570
35166
|
}
|
|
35571
|
-
loadBufferView(
|
|
35167
|
+
loadBufferView(index2) {
|
|
35572
35168
|
const json = this.parser.json;
|
|
35573
|
-
const bufferView = json.bufferViews[
|
|
35169
|
+
const bufferView = json.bufferViews[index2];
|
|
35574
35170
|
if (bufferView.extensions && bufferView.extensions[this.name]) {
|
|
35575
35171
|
const extensionDef = bufferView.extensions[this.name];
|
|
35576
35172
|
const buffer = this.parser.getDependency("buffer", extensionDef.buffer);
|
|
@@ -35802,8 +35398,8 @@ var __publicField = (obj, key, value) => {
|
|
|
35802
35398
|
constructor(parameterPositions, sampleValues, sampleSize, resultBuffer) {
|
|
35803
35399
|
super(parameterPositions, sampleValues, sampleSize, resultBuffer);
|
|
35804
35400
|
}
|
|
35805
|
-
copySampleValue_(
|
|
35806
|
-
const result = this.resultBuffer, values = this.sampleValues, valueSize = this.valueSize, offset =
|
|
35401
|
+
copySampleValue_(index2) {
|
|
35402
|
+
const result = this.resultBuffer, values = this.sampleValues, valueSize = this.valueSize, offset = index2 * valueSize * 3 + valueSize;
|
|
35807
35403
|
for (let i = 0; i !== valueSize; i++) {
|
|
35808
35404
|
result[i] = values[offset + i];
|
|
35809
35405
|
}
|
|
@@ -36186,17 +35782,17 @@ var __publicField = (obj, key, value) => {
|
|
|
36186
35782
|
*
|
|
36187
35783
|
* Example: CesiumMilkTruck sample model reuses "Wheel" meshes.
|
|
36188
35784
|
*/
|
|
36189
|
-
_addNodeRef(cache,
|
|
36190
|
-
if (
|
|
35785
|
+
_addNodeRef(cache, index2) {
|
|
35786
|
+
if (index2 === void 0)
|
|
36191
35787
|
return;
|
|
36192
|
-
if (cache.refs[
|
|
36193
|
-
cache.refs[
|
|
35788
|
+
if (cache.refs[index2] === void 0) {
|
|
35789
|
+
cache.refs[index2] = cache.uses[index2] = 0;
|
|
36194
35790
|
}
|
|
36195
|
-
cache.refs[
|
|
35791
|
+
cache.refs[index2]++;
|
|
36196
35792
|
}
|
|
36197
35793
|
/** Returns a reference to a shared resource, cloning it if necessary. */
|
|
36198
|
-
_getNodeRef(cache,
|
|
36199
|
-
if (cache.refs[
|
|
35794
|
+
_getNodeRef(cache, index2, object) {
|
|
35795
|
+
if (cache.refs[index2] <= 1)
|
|
36200
35796
|
return object;
|
|
36201
35797
|
const ref = object.clone();
|
|
36202
35798
|
const updateMappings = (original, clone) => {
|
|
@@ -36209,7 +35805,7 @@ var __publicField = (obj, key, value) => {
|
|
|
36209
35805
|
}
|
|
36210
35806
|
};
|
|
36211
35807
|
updateMappings(object, ref);
|
|
36212
|
-
ref.name += "_instance_" + cache.uses[
|
|
35808
|
+
ref.name += "_instance_" + cache.uses[index2]++;
|
|
36213
35809
|
return ref;
|
|
36214
35810
|
}
|
|
36215
35811
|
_invokeOne(func) {
|
|
@@ -36239,59 +35835,59 @@ var __publicField = (obj, key, value) => {
|
|
|
36239
35835
|
* @param {number} index
|
|
36240
35836
|
* @return {Promise<Object3D|Material|THREE.Texture|AnimationClip|ArrayBuffer|Object>}
|
|
36241
35837
|
*/
|
|
36242
|
-
getDependency(type,
|
|
36243
|
-
const cacheKey = type + ":" +
|
|
35838
|
+
getDependency(type, index2) {
|
|
35839
|
+
const cacheKey = type + ":" + index2;
|
|
36244
35840
|
let dependency = this.cache.get(cacheKey);
|
|
36245
35841
|
if (!dependency) {
|
|
36246
35842
|
switch (type) {
|
|
36247
35843
|
case "scene":
|
|
36248
|
-
dependency = this.loadScene(
|
|
35844
|
+
dependency = this.loadScene(index2);
|
|
36249
35845
|
break;
|
|
36250
35846
|
case "node":
|
|
36251
35847
|
dependency = this._invokeOne(function(ext) {
|
|
36252
|
-
return ext.loadNode && ext.loadNode(
|
|
35848
|
+
return ext.loadNode && ext.loadNode(index2);
|
|
36253
35849
|
});
|
|
36254
35850
|
break;
|
|
36255
35851
|
case "mesh":
|
|
36256
35852
|
dependency = this._invokeOne(function(ext) {
|
|
36257
|
-
return ext.loadMesh && ext.loadMesh(
|
|
35853
|
+
return ext.loadMesh && ext.loadMesh(index2);
|
|
36258
35854
|
});
|
|
36259
35855
|
break;
|
|
36260
35856
|
case "accessor":
|
|
36261
|
-
dependency = this.loadAccessor(
|
|
35857
|
+
dependency = this.loadAccessor(index2);
|
|
36262
35858
|
break;
|
|
36263
35859
|
case "bufferView":
|
|
36264
35860
|
dependency = this._invokeOne(function(ext) {
|
|
36265
|
-
return ext.loadBufferView && ext.loadBufferView(
|
|
35861
|
+
return ext.loadBufferView && ext.loadBufferView(index2);
|
|
36266
35862
|
});
|
|
36267
35863
|
break;
|
|
36268
35864
|
case "buffer":
|
|
36269
|
-
dependency = this.loadBuffer(
|
|
35865
|
+
dependency = this.loadBuffer(index2);
|
|
36270
35866
|
break;
|
|
36271
35867
|
case "material":
|
|
36272
35868
|
dependency = this._invokeOne(function(ext) {
|
|
36273
|
-
return ext.loadMaterial && ext.loadMaterial(
|
|
35869
|
+
return ext.loadMaterial && ext.loadMaterial(index2);
|
|
36274
35870
|
});
|
|
36275
35871
|
break;
|
|
36276
35872
|
case "texture":
|
|
36277
35873
|
dependency = this._invokeOne(function(ext) {
|
|
36278
|
-
return ext.loadTexture && ext.loadTexture(
|
|
35874
|
+
return ext.loadTexture && ext.loadTexture(index2);
|
|
36279
35875
|
});
|
|
36280
35876
|
break;
|
|
36281
35877
|
case "skin":
|
|
36282
|
-
dependency = this.loadSkin(
|
|
35878
|
+
dependency = this.loadSkin(index2);
|
|
36283
35879
|
break;
|
|
36284
35880
|
case "animation":
|
|
36285
35881
|
dependency = this._invokeOne(function(ext) {
|
|
36286
|
-
return ext.loadAnimation && ext.loadAnimation(
|
|
35882
|
+
return ext.loadAnimation && ext.loadAnimation(index2);
|
|
36287
35883
|
});
|
|
36288
35884
|
break;
|
|
36289
35885
|
case "camera":
|
|
36290
|
-
dependency = this.loadCamera(
|
|
35886
|
+
dependency = this.loadCamera(index2);
|
|
36291
35887
|
break;
|
|
36292
35888
|
default:
|
|
36293
35889
|
dependency = this._invokeOne(function(ext) {
|
|
36294
|
-
return ext != this && ext.getDependency && ext.getDependency(type,
|
|
35890
|
+
return ext != this && ext.getDependency && ext.getDependency(type, index2);
|
|
36295
35891
|
});
|
|
36296
35892
|
if (!dependency) {
|
|
36297
35893
|
throw new Error("Unknown type: " + type);
|
|
@@ -36312,8 +35908,8 @@ var __publicField = (obj, key, value) => {
|
|
|
36312
35908
|
if (!dependencies) {
|
|
36313
35909
|
const parser = this;
|
|
36314
35910
|
const defs = this.json[type + (type === "mesh" ? "es" : "s")] || [];
|
|
36315
|
-
dependencies = Promise.all(defs.map(function(def,
|
|
36316
|
-
return parser.getDependency(type,
|
|
35911
|
+
dependencies = Promise.all(defs.map(function(def, index2) {
|
|
35912
|
+
return parser.getDependency(type, index2);
|
|
36317
35913
|
}));
|
|
36318
35914
|
this.cache.add(type, dependencies);
|
|
36319
35915
|
}
|
|
@@ -36418,14 +36014,14 @@ var __publicField = (obj, key, value) => {
|
|
|
36418
36014
|
bufferAttribute = new BufferAttribute(bufferAttribute.array.slice(), bufferAttribute.itemSize, bufferAttribute.normalized);
|
|
36419
36015
|
}
|
|
36420
36016
|
for (let i = 0, il = sparseIndices.length; i < il; i++) {
|
|
36421
|
-
const
|
|
36422
|
-
bufferAttribute.setX(
|
|
36017
|
+
const index2 = sparseIndices[i];
|
|
36018
|
+
bufferAttribute.setX(index2, sparseValues[i * itemSize]);
|
|
36423
36019
|
if (itemSize >= 2)
|
|
36424
|
-
bufferAttribute.setY(
|
|
36020
|
+
bufferAttribute.setY(index2, sparseValues[i * itemSize + 1]);
|
|
36425
36021
|
if (itemSize >= 3)
|
|
36426
|
-
bufferAttribute.setZ(
|
|
36022
|
+
bufferAttribute.setZ(index2, sparseValues[i * itemSize + 2]);
|
|
36427
36023
|
if (itemSize >= 4)
|
|
36428
|
-
bufferAttribute.setW(
|
|
36024
|
+
bufferAttribute.setW(index2, sparseValues[i * itemSize + 3]);
|
|
36429
36025
|
if (itemSize >= 5)
|
|
36430
36026
|
throw new Error("THREE.GLTFLoader: Unsupported itemSize in sparse BufferAttribute.");
|
|
36431
36027
|
}
|
|
@@ -38414,14 +38010,14 @@ var __publicField = (obj, key, value) => {
|
|
|
38414
38010
|
this.passes.push(pass);
|
|
38415
38011
|
pass.setSize(this._width * this._pixelRatio, this._height * this._pixelRatio);
|
|
38416
38012
|
}
|
|
38417
|
-
insertPass(pass,
|
|
38418
|
-
this.passes.splice(
|
|
38013
|
+
insertPass(pass, index2) {
|
|
38014
|
+
this.passes.splice(index2, 0, pass);
|
|
38419
38015
|
pass.setSize(this._width * this._pixelRatio, this._height * this._pixelRatio);
|
|
38420
38016
|
}
|
|
38421
38017
|
removePass(pass) {
|
|
38422
|
-
const
|
|
38423
|
-
if (
|
|
38424
|
-
this.passes.splice(
|
|
38018
|
+
const index2 = this.passes.indexOf(pass);
|
|
38019
|
+
if (index2 !== -1) {
|
|
38020
|
+
this.passes.splice(index2, 1);
|
|
38425
38021
|
}
|
|
38426
38022
|
}
|
|
38427
38023
|
isLastEnabledPass(passIndex) {
|
|
@@ -38794,10 +38390,10 @@ var __publicField = (obj, key, value) => {
|
|
|
38794
38390
|
if (!geo.index) {
|
|
38795
38391
|
const vertexCount = geo.attributes.position.count;
|
|
38796
38392
|
const BufferConstructor = options.useSharedArrayBuffer ? SharedArrayBuffer : ArrayBuffer;
|
|
38797
|
-
const
|
|
38798
|
-
geo.setIndex(new BufferAttribute(
|
|
38393
|
+
const index2 = getIndexArray(vertexCount, BufferConstructor);
|
|
38394
|
+
geo.setIndex(new BufferAttribute(index2, 1));
|
|
38799
38395
|
for (let i = 0; i < vertexCount; i++) {
|
|
38800
|
-
|
|
38396
|
+
index2[i] = i;
|
|
38801
38397
|
}
|
|
38802
38398
|
}
|
|
38803
38399
|
}
|
|
@@ -39012,7 +38608,7 @@ var __publicField = (obj, key, value) => {
|
|
|
39012
38608
|
function computeTriangleBounds(geo, fullBounds) {
|
|
39013
38609
|
makeEmptyBounds(fullBounds);
|
|
39014
38610
|
const posAttr = geo.attributes.position;
|
|
39015
|
-
const
|
|
38611
|
+
const index2 = geo.index ? geo.index.array : null;
|
|
39016
38612
|
const triCount = getTriCount(geo);
|
|
39017
38613
|
const triangleBounds = new Float32Array(triCount * 6);
|
|
39018
38614
|
const normalized = posAttr.normalized;
|
|
@@ -39029,10 +38625,10 @@ var __publicField = (obj, key, value) => {
|
|
|
39029
38625
|
let ai = tri3 + 0;
|
|
39030
38626
|
let bi = tri3 + 1;
|
|
39031
38627
|
let ci = tri3 + 2;
|
|
39032
|
-
if (
|
|
39033
|
-
ai =
|
|
39034
|
-
bi =
|
|
39035
|
-
ci =
|
|
38628
|
+
if (index2) {
|
|
38629
|
+
ai = index2[ai];
|
|
38630
|
+
bi = index2[bi];
|
|
38631
|
+
ci = index2[ci];
|
|
39036
38632
|
}
|
|
39037
38633
|
if (!normalized) {
|
|
39038
38634
|
ai = ai * stride + bufferOffset;
|
|
@@ -39249,7 +38845,7 @@ var __publicField = (obj, key, value) => {
|
|
|
39249
38845
|
constructor() {
|
|
39250
38846
|
}
|
|
39251
38847
|
}
|
|
39252
|
-
function partition(indirectBuffer,
|
|
38848
|
+
function partition(indirectBuffer, index2, triangleBounds, offset, count, split) {
|
|
39253
38849
|
let left = offset;
|
|
39254
38850
|
let right = offset + count - 1;
|
|
39255
38851
|
const pos = split.pos;
|
|
@@ -39263,9 +38859,9 @@ var __publicField = (obj, key, value) => {
|
|
|
39263
38859
|
}
|
|
39264
38860
|
if (left < right) {
|
|
39265
38861
|
for (let i = 0; i < 3; i++) {
|
|
39266
|
-
let t0 =
|
|
39267
|
-
|
|
39268
|
-
|
|
38862
|
+
let t0 = index2[left * 3 + i];
|
|
38863
|
+
index2[left * 3 + i] = index2[right * 3 + i];
|
|
38864
|
+
index2[right * 3 + i] = t0;
|
|
39269
38865
|
}
|
|
39270
38866
|
for (let i = 0; i < 6; i++) {
|
|
39271
38867
|
let tb = triangleBounds[left * 6 + i];
|
|
@@ -39279,7 +38875,7 @@ var __publicField = (obj, key, value) => {
|
|
|
39279
38875
|
}
|
|
39280
38876
|
}
|
|
39281
38877
|
}
|
|
39282
|
-
function partition_indirect(indirectBuffer,
|
|
38878
|
+
function partition_indirect(indirectBuffer, index2, triangleBounds, offset, count, split) {
|
|
39283
38879
|
let left = offset;
|
|
39284
38880
|
let right = offset + count - 1;
|
|
39285
38881
|
const pos = split.pos;
|
|
@@ -40032,8 +39628,8 @@ var __publicField = (obj, key, value) => {
|
|
|
40032
39628
|
for (let i = 0; i < 3; i++) {
|
|
40033
39629
|
const axis = satAxes[i];
|
|
40034
39630
|
const sb = satBounds[i];
|
|
40035
|
-
const
|
|
40036
|
-
const pi = points[
|
|
39631
|
+
const index2 = 1 << i;
|
|
39632
|
+
const pi = points[index2];
|
|
40037
39633
|
axis.subVectors(minVec, pi);
|
|
40038
39634
|
sb.setFromPoints(axis, points);
|
|
40039
39635
|
}
|
|
@@ -40194,10 +39790,10 @@ var __publicField = (obj, key, value) => {
|
|
|
40194
39790
|
for (let i2 = 0; i2 <= 1; i2++) {
|
|
40195
39791
|
const nextIndex = (i + 1) % 3;
|
|
40196
39792
|
const nextIndex2 = (i + 2) % 3;
|
|
40197
|
-
const
|
|
40198
|
-
const
|
|
40199
|
-
const p1 = points[
|
|
40200
|
-
const p2 = points[
|
|
39793
|
+
const index2 = i1 << nextIndex | i2 << nextIndex2;
|
|
39794
|
+
const index22 = 1 << i | i1 << nextIndex | i2 << nextIndex2;
|
|
39795
|
+
const p1 = points[index2];
|
|
39796
|
+
const p2 = points[index22];
|
|
40201
39797
|
const line1 = segments1[count];
|
|
40202
39798
|
line1.set(p1, p2);
|
|
40203
39799
|
const f1 = xyzFields[i];
|
|
@@ -40561,11 +40157,11 @@ var __publicField = (obj, key, value) => {
|
|
|
40561
40157
|
let a = triOffset + 0;
|
|
40562
40158
|
let b = triOffset + 1;
|
|
40563
40159
|
let c2 = triOffset + 2;
|
|
40564
|
-
const
|
|
40160
|
+
const index2 = geo.index;
|
|
40565
40161
|
if (geo.index) {
|
|
40566
|
-
a =
|
|
40567
|
-
b =
|
|
40568
|
-
c2 =
|
|
40162
|
+
a = index2.getX(a);
|
|
40163
|
+
b = index2.getX(b);
|
|
40164
|
+
c2 = index2.getX(c2);
|
|
40569
40165
|
}
|
|
40570
40166
|
const { position, normal, uv, uv1 } = geo.attributes;
|
|
40571
40167
|
const intersection = checkBufferGeometryIntersection(ray, position, normal, uv, uv1, a, b, c2, side);
|
|
@@ -40577,17 +40173,17 @@ var __publicField = (obj, key, value) => {
|
|
|
40577
40173
|
}
|
|
40578
40174
|
return null;
|
|
40579
40175
|
}
|
|
40580
|
-
function setTriangle(tri, i,
|
|
40176
|
+
function setTriangle(tri, i, index2, pos) {
|
|
40581
40177
|
const ta = tri.a;
|
|
40582
40178
|
const tb = tri.b;
|
|
40583
40179
|
const tc = tri.c;
|
|
40584
40180
|
let i0 = i;
|
|
40585
40181
|
let i1 = i + 1;
|
|
40586
40182
|
let i2 = i + 2;
|
|
40587
|
-
if (
|
|
40588
|
-
i0 =
|
|
40589
|
-
i1 =
|
|
40590
|
-
i2 =
|
|
40183
|
+
if (index2) {
|
|
40184
|
+
i0 = index2.getX(i0);
|
|
40185
|
+
i1 = index2.getX(i1);
|
|
40186
|
+
i2 = index2.getX(i2);
|
|
40591
40187
|
}
|
|
40592
40188
|
ta.x = pos.getX(i0);
|
|
40593
40189
|
ta.y = pos.getY(i0);
|
|
@@ -40621,12 +40217,12 @@ var __publicField = (obj, key, value) => {
|
|
|
40621
40217
|
}
|
|
40622
40218
|
function iterateOverTriangles(offset, count, bvh, intersectsTriangleFunc, contained, depth, triangle3) {
|
|
40623
40219
|
const { geometry } = bvh;
|
|
40624
|
-
const { index } = geometry;
|
|
40220
|
+
const { index: index2 } = geometry;
|
|
40625
40221
|
const pos = geometry.attributes.position;
|
|
40626
40222
|
for (let i = offset, l = count + offset; i < l; i++) {
|
|
40627
40223
|
let tri;
|
|
40628
40224
|
tri = i;
|
|
40629
|
-
setTriangle(triangle3, tri * 3,
|
|
40225
|
+
setTriangle(triangle3, tri * 3, index2, pos);
|
|
40630
40226
|
triangle3.needsUpdate = true;
|
|
40631
40227
|
if (intersectsTriangleFunc(triangle3, tri, contained, depth)) {
|
|
40632
40228
|
return true;
|
|
@@ -40665,10 +40261,10 @@ var __publicField = (obj, key, value) => {
|
|
|
40665
40261
|
let maxy = -Infinity;
|
|
40666
40262
|
let maxz = -Infinity;
|
|
40667
40263
|
for (let i = 3 * offset, l = 3 * (offset + count); i < l; i++) {
|
|
40668
|
-
let
|
|
40669
|
-
const x2 = posAttr.getX(
|
|
40670
|
-
const y = posAttr.getY(
|
|
40671
|
-
const z = posAttr.getZ(
|
|
40264
|
+
let index2 = indexArr[i];
|
|
40265
|
+
const x2 = posAttr.getX(index2);
|
|
40266
|
+
const y = posAttr.getY(index2);
|
|
40267
|
+
const z = posAttr.getZ(index2);
|
|
40672
40268
|
if (x2 < minx)
|
|
40673
40269
|
minx = x2;
|
|
40674
40270
|
if (x2 > maxx)
|
|
@@ -40766,12 +40362,12 @@ var __publicField = (obj, key, value) => {
|
|
|
40766
40362
|
}
|
|
40767
40363
|
function iterateOverTriangles_indirect(offset, count, bvh, intersectsTriangleFunc, contained, depth, triangle3) {
|
|
40768
40364
|
const { geometry } = bvh;
|
|
40769
|
-
const { index } = geometry;
|
|
40365
|
+
const { index: index2 } = geometry;
|
|
40770
40366
|
const pos = geometry.attributes.position;
|
|
40771
40367
|
for (let i = offset, l = count + offset; i < l; i++) {
|
|
40772
40368
|
let tri;
|
|
40773
40369
|
tri = bvh.resolveTriangleIndex(i);
|
|
40774
|
-
setTriangle(triangle3, tri * 3,
|
|
40370
|
+
setTriangle(triangle3, tri * 3, index2, pos);
|
|
40775
40371
|
triangle3.needsUpdate = true;
|
|
40776
40372
|
if (intersectsTriangleFunc(triangle3, tri, contained, depth)) {
|
|
40777
40373
|
return true;
|
|
@@ -40881,7 +40477,7 @@ var __publicField = (obj, key, value) => {
|
|
|
40881
40477
|
const thisGeometry = bvh.geometry;
|
|
40882
40478
|
const thisIndex = thisGeometry.index;
|
|
40883
40479
|
const thisPos = thisGeometry.attributes.position;
|
|
40884
|
-
const
|
|
40480
|
+
const index2 = otherGeometry.index;
|
|
40885
40481
|
const pos = otherGeometry.attributes.position;
|
|
40886
40482
|
const offset = OFFSET(nodeIndex32, uint32Array);
|
|
40887
40483
|
const count = COUNT(nodeIndex16, uint16Array);
|
|
@@ -40915,8 +40511,8 @@ var __publicField = (obj, key, value) => {
|
|
|
40915
40511
|
triangle$1.b.applyMatrix4(invertedMat$1);
|
|
40916
40512
|
triangle$1.c.applyMatrix4(invertedMat$1);
|
|
40917
40513
|
triangle$1.needsUpdate = true;
|
|
40918
|
-
for (let i2 = 0, l2 =
|
|
40919
|
-
setTriangle(triangle2$1, i2,
|
|
40514
|
+
for (let i2 = 0, l2 = index2.count; i2 < l2; i2 += 3) {
|
|
40515
|
+
setTriangle(triangle2$1, i2, index2, pos);
|
|
40920
40516
|
triangle2$1.needsUpdate = true;
|
|
40921
40517
|
if (triangle$1.intersectsTriangle(triangle2$1)) {
|
|
40922
40518
|
return true;
|
|
@@ -40953,7 +40549,7 @@ var __publicField = (obj, key, value) => {
|
|
|
40953
40549
|
obb$3.needsUpdate = true;
|
|
40954
40550
|
const geometry = bvh.geometry;
|
|
40955
40551
|
const pos = geometry.attributes.position;
|
|
40956
|
-
const
|
|
40552
|
+
const index2 = geometry.index;
|
|
40957
40553
|
const otherPos = otherGeometry.attributes.position;
|
|
40958
40554
|
const otherIndex = otherGeometry.index;
|
|
40959
40555
|
const triangle3 = ExtendedTrianglePool.getPrimitive();
|
|
@@ -41005,7 +40601,7 @@ var __publicField = (obj, key, value) => {
|
|
|
41005
40601
|
triangle22.c.applyMatrix4(geometryToBvh);
|
|
41006
40602
|
triangle22.needsUpdate = true;
|
|
41007
40603
|
for (let i = offset, l = offset + count; i < l; i++) {
|
|
41008
|
-
setTriangle(triangle3, 3 * i,
|
|
40604
|
+
setTriangle(triangle3, 3 * i, index2, pos);
|
|
41009
40605
|
triangle3.needsUpdate = true;
|
|
41010
40606
|
const dist = triangle3.distanceToTriangle(triangle22, tempTarget1, tempTarget2);
|
|
41011
40607
|
if (dist < closestDistance) {
|
|
@@ -41033,7 +40629,7 @@ var __publicField = (obj, key, value) => {
|
|
|
41033
40629
|
triangle22.c.applyMatrix4(geometryToBvh);
|
|
41034
40630
|
triangle22.needsUpdate = true;
|
|
41035
40631
|
for (let i = offset, l = offset + count; i < l; i++) {
|
|
41036
|
-
setTriangle(triangle3, 3 * i,
|
|
40632
|
+
setTriangle(triangle3, 3 * i, index2, pos);
|
|
41037
40633
|
triangle3.needsUpdate = true;
|
|
41038
40634
|
const dist = triangle3.distanceToTriangle(triangle22, tempTarget1, tempTarget2);
|
|
41039
40635
|
if (dist < closestDistance) {
|
|
@@ -41110,11 +40706,11 @@ var __publicField = (obj, key, value) => {
|
|
|
41110
40706
|
for (let i = offset, l = offset + count; i < l; i++) {
|
|
41111
40707
|
const t2 = 3 * bvh.resolveTriangleIndex(i);
|
|
41112
40708
|
for (let j = 0; j < 3; j++) {
|
|
41113
|
-
let
|
|
41114
|
-
|
|
41115
|
-
const x2 = posAttr.getX(
|
|
41116
|
-
const y = posAttr.getY(
|
|
41117
|
-
const z = posAttr.getZ(
|
|
40709
|
+
let index2 = t2 + j;
|
|
40710
|
+
index2 = indexArr ? indexArr[index2] : index2;
|
|
40711
|
+
const x2 = posAttr.getX(index2);
|
|
40712
|
+
const y = posAttr.getY(index2);
|
|
40713
|
+
const z = posAttr.getZ(index2);
|
|
41118
40714
|
if (x2 < minx)
|
|
41119
40715
|
minx = x2;
|
|
41120
40716
|
if (x2 > maxx)
|
|
@@ -41287,7 +40883,7 @@ var __publicField = (obj, key, value) => {
|
|
|
41287
40883
|
const thisGeometry = bvh.geometry;
|
|
41288
40884
|
const thisIndex = thisGeometry.index;
|
|
41289
40885
|
const thisPos = thisGeometry.attributes.position;
|
|
41290
|
-
const
|
|
40886
|
+
const index2 = otherGeometry.index;
|
|
41291
40887
|
const pos = otherGeometry.attributes.position;
|
|
41292
40888
|
const offset = OFFSET(nodeIndex32, uint32Array);
|
|
41293
40889
|
const count = COUNT(nodeIndex16, uint16Array);
|
|
@@ -41322,8 +40918,8 @@ var __publicField = (obj, key, value) => {
|
|
|
41322
40918
|
triangle.b.applyMatrix4(invertedMat);
|
|
41323
40919
|
triangle.c.applyMatrix4(invertedMat);
|
|
41324
40920
|
triangle.needsUpdate = true;
|
|
41325
|
-
for (let i2 = 0, l2 =
|
|
41326
|
-
setTriangle(triangle2, i2,
|
|
40921
|
+
for (let i2 = 0, l2 = index2.count; i2 < l2; i2 += 3) {
|
|
40922
|
+
setTriangle(triangle2, i2, index2, pos);
|
|
41327
40923
|
triangle2.needsUpdate = true;
|
|
41328
40924
|
if (triangle.intersectsTriangle(triangle2)) {
|
|
41329
40925
|
return true;
|
|
@@ -41360,7 +40956,7 @@ var __publicField = (obj, key, value) => {
|
|
|
41360
40956
|
obb$1.needsUpdate = true;
|
|
41361
40957
|
const geometry = bvh.geometry;
|
|
41362
40958
|
const pos = geometry.attributes.position;
|
|
41363
|
-
const
|
|
40959
|
+
const index2 = geometry.index;
|
|
41364
40960
|
const otherPos = otherGeometry.attributes.position;
|
|
41365
40961
|
const otherIndex = otherGeometry.index;
|
|
41366
40962
|
const triangle3 = ExtendedTrianglePool.getPrimitive();
|
|
@@ -41414,7 +41010,7 @@ var __publicField = (obj, key, value) => {
|
|
|
41414
41010
|
triangle22.needsUpdate = true;
|
|
41415
41011
|
for (let i = offset, l = offset + count; i < l; i++) {
|
|
41416
41012
|
const ti = bvh.resolveTriangleIndex(i);
|
|
41417
|
-
setTriangle(triangle3, 3 * ti,
|
|
41013
|
+
setTriangle(triangle3, 3 * ti, index2, pos);
|
|
41418
41014
|
triangle3.needsUpdate = true;
|
|
41419
41015
|
const dist = triangle3.distanceToTriangle(triangle22, tempTarget1, tempTarget2);
|
|
41420
41016
|
if (dist < closestDistance) {
|
|
@@ -41443,7 +41039,7 @@ var __publicField = (obj, key, value) => {
|
|
|
41443
41039
|
triangle22.needsUpdate = true;
|
|
41444
41040
|
for (let i = offset, l = offset + count; i < l; i++) {
|
|
41445
41041
|
const ti = bvh.resolveTriangleIndex(i);
|
|
41446
|
-
setTriangle(triangle3, 3 * ti,
|
|
41042
|
+
setTriangle(triangle3, 3 * ti, index2, pos);
|
|
41447
41043
|
triangle3.needsUpdate = true;
|
|
41448
41044
|
const dist = triangle3.distanceToTriangle(triangle22, tempTarget1, tempTarget2);
|
|
41449
41045
|
if (dist < closestDistance) {
|
|
@@ -41793,7 +41389,7 @@ var __publicField = (obj, key, value) => {
|
|
|
41793
41389
|
indirect: Boolean(data.indirectBuffer),
|
|
41794
41390
|
...options
|
|
41795
41391
|
};
|
|
41796
|
-
const { index, roots, indirectBuffer } = data;
|
|
41392
|
+
const { index: index2, roots, indirectBuffer } = data;
|
|
41797
41393
|
const bvh = new MeshBVH(geometry, { ...options, [SKIP_GENERATION]: true });
|
|
41798
41394
|
bvh._roots = roots;
|
|
41799
41395
|
bvh._indirectBuffer = indirectBuffer || null;
|
|
@@ -41802,8 +41398,8 @@ var __publicField = (obj, key, value) => {
|
|
|
41802
41398
|
if (indexAttribute === null) {
|
|
41803
41399
|
const newIndex = new BufferAttribute(data.index, 1, false);
|
|
41804
41400
|
geometry.setIndex(newIndex);
|
|
41805
|
-
} else if (indexAttribute.array !==
|
|
41806
|
-
indexAttribute.array.set(
|
|
41401
|
+
} else if (indexAttribute.array !== index2) {
|
|
41402
|
+
indexAttribute.array.set(index2);
|
|
41807
41403
|
indexAttribute.needsUpdate = true;
|
|
41808
41404
|
}
|
|
41809
41405
|
}
|
|
@@ -42289,9 +41885,9 @@ var __publicField = (obj, key, value) => {
|
|
|
42289
41885
|
}
|
|
42290
41886
|
}
|
|
42291
41887
|
dispose() {
|
|
42292
|
-
const { index, position, bvhBounds, bvhContents } = this;
|
|
42293
|
-
if (
|
|
42294
|
-
|
|
41888
|
+
const { index: index2, position, bvhBounds, bvhContents } = this;
|
|
41889
|
+
if (index2)
|
|
41890
|
+
index2.dispose();
|
|
42295
41891
|
if (position)
|
|
42296
41892
|
position.dispose();
|
|
42297
41893
|
if (bvhBounds)
|
|
@@ -42845,6 +42441,24 @@ bool bvhIntersectFirstHit(
|
|
|
42845
42441
|
}`
|
|
42846
42442
|
);
|
|
42847
42443
|
let lensMaterial;
|
|
42444
|
+
let orbitalMaterial;
|
|
42445
|
+
const defaultOrbitalMaterial = new MeshPhysicalMaterial({
|
|
42446
|
+
metalness: 0,
|
|
42447
|
+
roughness: 0.05,
|
|
42448
|
+
ior: 1,
|
|
42449
|
+
opacity: 0.6,
|
|
42450
|
+
clearcoat: 0,
|
|
42451
|
+
color: new Color(16777215),
|
|
42452
|
+
transparent: true,
|
|
42453
|
+
shadowSide: BackSide,
|
|
42454
|
+
depthWrite: true,
|
|
42455
|
+
map: null,
|
|
42456
|
+
alphaMap: null,
|
|
42457
|
+
aoMap: null,
|
|
42458
|
+
roughnessMap: null,
|
|
42459
|
+
metalnessMap: null,
|
|
42460
|
+
normalMap: null
|
|
42461
|
+
});
|
|
42848
42462
|
let envMap;
|
|
42849
42463
|
const positions = [0, 0.4, 0.7, 1];
|
|
42850
42464
|
const opacities = [0.85, 0.62, 0.3, 0];
|
|
@@ -42885,9 +42499,11 @@ bool bvhIntersectFirstHit(
|
|
|
42885
42499
|
__publicField2(this, "canvasSize");
|
|
42886
42500
|
__publicField2(this, "isInitialised");
|
|
42887
42501
|
__publicField2(this, "orgId");
|
|
42502
|
+
__publicField2(this, "textureLoader");
|
|
42888
42503
|
this.scene = new Scene();
|
|
42889
42504
|
this.canvasSize = new Vector2();
|
|
42890
42505
|
this.isInitialised = false;
|
|
42506
|
+
this.textureLoader = new TextureLoader();
|
|
42891
42507
|
this.orgId = "";
|
|
42892
42508
|
}
|
|
42893
42509
|
async intialize() {
|
|
@@ -42982,51 +42598,87 @@ bool bvhIntersectFirstHit(
|
|
|
42982
42598
|
});
|
|
42983
42599
|
}
|
|
42984
42600
|
async loadFirstFrame(orgId, frame) {
|
|
42985
|
-
var _a2, _b2;
|
|
42986
42601
|
if (frame && orgId) {
|
|
42987
42602
|
const apiRes = await this.downloadModel(orgId, frame._id);
|
|
42988
|
-
const
|
|
42989
|
-
const
|
|
42990
|
-
await this.renderModel(apiRes.asset.cloudfrontUrl,
|
|
42991
|
-
|
|
42992
|
-
|
|
42993
|
-
|
|
42994
|
-
|
|
42995
|
-
|
|
42603
|
+
const customLensMaterial = frame.customisation.find((x2) => x2.type == "Lens");
|
|
42604
|
+
const customOrbitalMaterial = frame.customisation.find((x2) => x2.type == "Orbital");
|
|
42605
|
+
await this.renderModel(apiRes.asset.cloudfrontUrl, false, apiRes.decryptionKey).then(async () => {
|
|
42606
|
+
return new Promise(async (res, rej) => {
|
|
42607
|
+
if (customLensMaterial) {
|
|
42608
|
+
this.setupLensMaterial(customLensMaterial);
|
|
42609
|
+
res();
|
|
42610
|
+
} else {
|
|
42611
|
+
res();
|
|
42612
|
+
}
|
|
42613
|
+
if (customOrbitalMaterial) {
|
|
42614
|
+
await this.setupOrbitalMaterial(customOrbitalMaterial).then(() => {
|
|
42615
|
+
res();
|
|
42616
|
+
});
|
|
42617
|
+
} else {
|
|
42618
|
+
res();
|
|
42619
|
+
}
|
|
42620
|
+
});
|
|
42996
42621
|
});
|
|
42997
42622
|
} else {
|
|
42998
42623
|
return;
|
|
42999
42624
|
}
|
|
43000
42625
|
}
|
|
43001
|
-
async changeFrame(orgId, frame,
|
|
42626
|
+
async changeFrame(orgId, frame, selectedCustomisations) {
|
|
43002
42627
|
if (frame && orgId) {
|
|
43003
42628
|
const apiRes = await this.downloadModel(orgId, frame._id);
|
|
43004
|
-
const
|
|
43005
|
-
const
|
|
43006
|
-
const
|
|
42629
|
+
const selectedLens = selectedCustomisations.find((x2) => x2.type == "Lens");
|
|
42630
|
+
const selectedOrbital = selectedCustomisations.find((x2) => x2.type == "Orbital");
|
|
42631
|
+
const customLensMaterial = frame.customisation.find((x2) => x2.type == "Lens");
|
|
42632
|
+
const customOrbitalMaterial = frame.customisation.find((x2) => x2.type == "Orbital");
|
|
42633
|
+
const renderAsIs = customLensMaterial == null && selectedLens.sku == "lens-default";
|
|
43007
42634
|
await this.renderModel(apiRes.asset.cloudfrontUrl, renderAsIs, apiRes.decryptionKey).then(async () => {
|
|
43008
|
-
|
|
43009
|
-
if (
|
|
43010
|
-
|
|
42635
|
+
return new Promise(async (res, rej) => {
|
|
42636
|
+
if (selectedLens.sku == "lens-default") {
|
|
42637
|
+
if (customLensMaterial) {
|
|
42638
|
+
this.setupLensMaterial(customLensMaterial);
|
|
42639
|
+
res();
|
|
42640
|
+
} else {
|
|
42641
|
+
res();
|
|
42642
|
+
}
|
|
42643
|
+
} else {
|
|
42644
|
+
this.setupLensMaterial(selectedLens);
|
|
42645
|
+
res();
|
|
43011
42646
|
}
|
|
43012
|
-
|
|
43013
|
-
|
|
43014
|
-
|
|
42647
|
+
if ((selectedOrbital == null ? void 0 : selectedOrbital.sku) == "orbital-default") {
|
|
42648
|
+
if (customOrbitalMaterial) {
|
|
42649
|
+
await this.setupOrbitalMaterial(customOrbitalMaterial).then(() => {
|
|
42650
|
+
res();
|
|
42651
|
+
});
|
|
42652
|
+
}
|
|
42653
|
+
} else {
|
|
42654
|
+
await this.setupOrbitalMaterial(selectedOrbital).then(() => {
|
|
42655
|
+
res();
|
|
42656
|
+
});
|
|
42657
|
+
}
|
|
42658
|
+
});
|
|
43015
42659
|
});
|
|
43016
42660
|
}
|
|
43017
42661
|
}
|
|
43018
|
-
async changeLens(
|
|
42662
|
+
async changeLens(customisations, orgId, reloadNeeded, frame) {
|
|
43019
42663
|
return new Promise((res, rej) => {
|
|
43020
42664
|
if (reloadNeeded) {
|
|
43021
|
-
this.changeFrame(orgId, frame,
|
|
42665
|
+
this.changeFrame(orgId, frame, customisations).then(() => {
|
|
43022
42666
|
res();
|
|
43023
42667
|
});
|
|
43024
42668
|
} else {
|
|
42669
|
+
const lens = customisations.find((x2) => x2.type == "Lens");
|
|
43025
42670
|
this.setupLensMaterial(lens);
|
|
43026
42671
|
res();
|
|
43027
42672
|
}
|
|
43028
42673
|
});
|
|
43029
42674
|
}
|
|
42675
|
+
async changeOrbital(orbital) {
|
|
42676
|
+
return new Promise(async (res, rej) => {
|
|
42677
|
+
await this.setupOrbitalMaterial(orbital).then(() => {
|
|
42678
|
+
res();
|
|
42679
|
+
});
|
|
42680
|
+
});
|
|
42681
|
+
}
|
|
43030
42682
|
async renderModel(modelContent, renderAsIs, decryptionKey) {
|
|
43031
42683
|
const loader = new GLTFLoader();
|
|
43032
42684
|
if (modelContent) {
|
|
@@ -43173,6 +42825,14 @@ bool bvhIntersectFirstHit(
|
|
|
43173
42825
|
lensMaterial.needsUpdate = true;
|
|
43174
42826
|
}
|
|
43175
42827
|
}
|
|
42828
|
+
if (node.material && node.material.name.toLowerCase() == "frame-stems") {
|
|
42829
|
+
orbitalMaterial = defaultOrbitalMaterial;
|
|
42830
|
+
orbitalMaterial.envMap = this.scene.environment;
|
|
42831
|
+
node.material = orbitalMaterial;
|
|
42832
|
+
node.matrixAutoUpdate = true;
|
|
42833
|
+
orbitalMaterial.matrixAutoUpdate = true;
|
|
42834
|
+
orbitalMaterial.needsUpdate = true;
|
|
42835
|
+
}
|
|
43176
42836
|
if (node.material && node.name === "Diamonds") {
|
|
43177
42837
|
this.initGemstoneDependencies();
|
|
43178
42838
|
gemstoneMaterial.uniforms.bvh.value = new MeshBVHUniformStruct();
|
|
@@ -43224,12 +42884,12 @@ bool bvhIntersectFirstHit(
|
|
|
43224
42884
|
} else if (selectedLens.direction == "tb") {
|
|
43225
42885
|
const gradientColors = selectedLens.gradientColors;
|
|
43226
42886
|
gu.uAlpha.value = true;
|
|
43227
|
-
let
|
|
42887
|
+
let index2 = 0;
|
|
43228
42888
|
gradientColors.forEach(() => {
|
|
43229
|
-
gu.colors.value[
|
|
43230
|
-
gu.positions.value[
|
|
43231
|
-
gu.opacities.value[
|
|
43232
|
-
|
|
42889
|
+
gu.colors.value[index2] = new Color(gradientColors[index2].color);
|
|
42890
|
+
gu.positions.value[index2] = gradientColors[index2].position;
|
|
42891
|
+
gu.opacities.value[index2] = gradientColors[index2].alpha;
|
|
42892
|
+
index2++;
|
|
43233
42893
|
});
|
|
43234
42894
|
}
|
|
43235
42895
|
if (selectedLens.finish == "MIRBLKHMC") {
|
|
@@ -43246,6 +42906,83 @@ bool bvhIntersectFirstHit(
|
|
|
43246
42906
|
lensMaterial.metalness = selectedLens.metalness;
|
|
43247
42907
|
}
|
|
43248
42908
|
}
|
|
42909
|
+
async downloadTexture(url) {
|
|
42910
|
+
let tex;
|
|
42911
|
+
return await this.textureLoader.loadAsync(url).then((texture) => {
|
|
42912
|
+
texture.colorSpace = SRGBColorSpace;
|
|
42913
|
+
texture.flipY = false;
|
|
42914
|
+
texture.magFilter = NearestFilter;
|
|
42915
|
+
texture.wrapS = ClampToEdgeWrapping;
|
|
42916
|
+
texture.wrapT = ClampToEdgeWrapping;
|
|
42917
|
+
tex = texture;
|
|
42918
|
+
}).then(() => tex);
|
|
42919
|
+
}
|
|
42920
|
+
resetOrbitalMaterial(mat) {
|
|
42921
|
+
mat.metalness = 0;
|
|
42922
|
+
mat.roughness = 0.05;
|
|
42923
|
+
mat.ior = 1;
|
|
42924
|
+
mat.opacity = 1;
|
|
42925
|
+
mat.clearcoat = 0;
|
|
42926
|
+
mat.color = new Color(16777215);
|
|
42927
|
+
mat.transparent = false;
|
|
42928
|
+
mat.shadowSide = BackSide;
|
|
42929
|
+
mat.depthWrite = true;
|
|
42930
|
+
mat.map = null;
|
|
42931
|
+
mat.alphaMap = null;
|
|
42932
|
+
mat.aoMap = null;
|
|
42933
|
+
mat.roughnessMap = null;
|
|
42934
|
+
mat.metalnessMap = null;
|
|
42935
|
+
mat.normalMap = null;
|
|
42936
|
+
mat.transmission = 0;
|
|
42937
|
+
}
|
|
42938
|
+
async setupOrbitalMaterial(selectedOrbital) {
|
|
42939
|
+
if (orbitalMaterial) {
|
|
42940
|
+
this.resetOrbitalMaterial(orbitalMaterial);
|
|
42941
|
+
if (selectedOrbital.texture) {
|
|
42942
|
+
if (selectedOrbital.texture.baseColor) {
|
|
42943
|
+
await this.downloadTexture(selectedOrbital.texture.baseColor).then((texture) => {
|
|
42944
|
+
orbitalMaterial.map = texture;
|
|
42945
|
+
});
|
|
42946
|
+
}
|
|
42947
|
+
if (selectedOrbital.texture.opacity) {
|
|
42948
|
+
await this.downloadTexture(selectedOrbital.texture.opacity).then((texture) => {
|
|
42949
|
+
orbitalMaterial.alphaMap = texture;
|
|
42950
|
+
});
|
|
42951
|
+
}
|
|
42952
|
+
if (selectedOrbital.texture.thickness) {
|
|
42953
|
+
await this.downloadTexture(selectedOrbital.texture.thickness).then((texture) => {
|
|
42954
|
+
orbitalMaterial.thicknessMap = texture;
|
|
42955
|
+
});
|
|
42956
|
+
}
|
|
42957
|
+
if (selectedOrbital.texture.orm) {
|
|
42958
|
+
await this.downloadTexture(selectedOrbital.texture.orm).then((texture) => {
|
|
42959
|
+
orbitalMaterial.aoMap = texture;
|
|
42960
|
+
orbitalMaterial.roughnessMap = texture;
|
|
42961
|
+
orbitalMaterial.metalnessMap = texture;
|
|
42962
|
+
});
|
|
42963
|
+
} else {
|
|
42964
|
+
orbitalMaterial.roughness = selectedOrbital.roughness;
|
|
42965
|
+
orbitalMaterial.metalness = selectedOrbital.metalness;
|
|
42966
|
+
}
|
|
42967
|
+
} else {
|
|
42968
|
+
orbitalMaterial.color = new Color(selectedOrbital.color);
|
|
42969
|
+
orbitalMaterial.roughness = selectedOrbital.roughness;
|
|
42970
|
+
orbitalMaterial.metalness = selectedOrbital.metalness;
|
|
42971
|
+
}
|
|
42972
|
+
if (selectedOrbital.ior > 1) {
|
|
42973
|
+
orbitalMaterial.ior = selectedOrbital.ior;
|
|
42974
|
+
orbitalMaterial.transmission = 1;
|
|
42975
|
+
orbitalMaterial.transparent = true;
|
|
42976
|
+
orbitalMaterial.thickness = 0.05;
|
|
42977
|
+
} else {
|
|
42978
|
+
orbitalMaterial.ior = 1;
|
|
42979
|
+
orbitalMaterial.transmission = 0;
|
|
42980
|
+
orbitalMaterial.transparent = false;
|
|
42981
|
+
orbitalMaterial.opacity = selectedOrbital.opacity;
|
|
42982
|
+
}
|
|
42983
|
+
orbitalMaterial.clearcoat = 0;
|
|
42984
|
+
}
|
|
42985
|
+
}
|
|
43249
42986
|
setupAndRenderScene() {
|
|
43250
42987
|
if (!this.camera || !this.renderer)
|
|
43251
42988
|
return;
|
|
@@ -43441,7 +43178,7 @@ bool bvhIntersectFirstHit(
|
|
|
43441
43178
|
this.customRenderer.setupAndRenderScene();
|
|
43442
43179
|
}
|
|
43443
43180
|
}
|
|
43444
|
-
loadFirstFrame(orgId, assetDetails) {
|
|
43181
|
+
loadFirstFrame(orgId, assetDetails, customisationArr) {
|
|
43445
43182
|
return new Promise((res, rej) => {
|
|
43446
43183
|
this.customRenderer.loadFirstFrame(orgId, assetDetails).then(() => {
|
|
43447
43184
|
res(1);
|
|
@@ -43450,11 +43187,14 @@ bool bvhIntersectFirstHit(
|
|
|
43450
43187
|
});
|
|
43451
43188
|
});
|
|
43452
43189
|
}
|
|
43453
|
-
changeFrame(orgId, frame,
|
|
43454
|
-
return this.customRenderer.changeFrame(orgId, frame,
|
|
43190
|
+
changeFrame(orgId, frame, customisations) {
|
|
43191
|
+
return this.customRenderer.changeFrame(orgId, frame, customisations);
|
|
43455
43192
|
}
|
|
43456
|
-
changeLens(
|
|
43457
|
-
return this.customRenderer.changeLens(
|
|
43193
|
+
changeLens(customisations, orgId, reloadNeeded, frame) {
|
|
43194
|
+
return this.customRenderer.changeLens(customisations, orgId, reloadNeeded, frame);
|
|
43195
|
+
}
|
|
43196
|
+
changeOrbital(orbital) {
|
|
43197
|
+
return this.customRenderer.changeOrbital(orbital);
|
|
43458
43198
|
}
|
|
43459
43199
|
}
|
|
43460
43200
|
class DOMService {
|
|
@@ -43495,14 +43235,17 @@ bool bvhIntersectFirstHit(
|
|
|
43495
43235
|
this.customisationArr = param.data.customisation;
|
|
43496
43236
|
this.prepareDOM();
|
|
43497
43237
|
await this.rendererService.Init();
|
|
43498
|
-
await this.rendererService.loadFirstFrame(this.orgId, this.assetDetails);
|
|
43238
|
+
await this.rendererService.loadFirstFrame(this.orgId, this.assetDetails, this.customisationArr);
|
|
43499
43239
|
return this;
|
|
43500
43240
|
}
|
|
43501
|
-
changeFrame(frame,
|
|
43502
|
-
return this.rendererService.changeFrame(this.orgId, frame,
|
|
43241
|
+
changeFrame(frame, customisations) {
|
|
43242
|
+
return this.rendererService.changeFrame(this.orgId, frame, customisations);
|
|
43243
|
+
}
|
|
43244
|
+
changeLens(customisations, reloadNeeded, frame) {
|
|
43245
|
+
return this.rendererService.changeLens(customisations, this.orgId, reloadNeeded, frame);
|
|
43503
43246
|
}
|
|
43504
|
-
|
|
43505
|
-
return this.rendererService.
|
|
43247
|
+
changeOrbital(orbital) {
|
|
43248
|
+
return this.rendererService.changeOrbital(orbital);
|
|
43506
43249
|
}
|
|
43507
43250
|
unmount() {
|
|
43508
43251
|
if (this.containerElement) {
|
|
@@ -43553,12 +43296,583 @@ bool bvhIntersectFirstHit(
|
|
|
43553
43296
|
}
|
|
43554
43297
|
}
|
|
43555
43298
|
window.ThreeDConfigurator = ThreeDConfigurator;
|
|
43299
|
+
const MainContainer$1 = "";
|
|
43300
|
+
const index$3 = "";
|
|
43301
|
+
function FramePalette({
|
|
43302
|
+
frameList,
|
|
43303
|
+
selectedFrame,
|
|
43304
|
+
modelLoading,
|
|
43305
|
+
onChangeFrame
|
|
43306
|
+
}) {
|
|
43307
|
+
const isMobileView = window.innerWidth <= 576;
|
|
43308
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
43309
|
+
"div",
|
|
43310
|
+
{
|
|
43311
|
+
className: "sprie-config-palette",
|
|
43312
|
+
style: {
|
|
43313
|
+
padding: "0 4rem 1.6rem 4rem",
|
|
43314
|
+
marginTop: isMobileView ? "1rem" : "0"
|
|
43315
|
+
},
|
|
43316
|
+
children: frameList == null ? void 0 : frameList.map((e) => /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "sprie-config-palette-img-box", children: [
|
|
43317
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
43318
|
+
"button",
|
|
43319
|
+
{
|
|
43320
|
+
style: {
|
|
43321
|
+
border: "0",
|
|
43322
|
+
cursor: modelLoading ? "default" : "pointer",
|
|
43323
|
+
opacity: (selectedFrame == null ? void 0 : selectedFrame._id) === e._id ? "1" : ".6"
|
|
43324
|
+
},
|
|
43325
|
+
onClick: () => onChangeFrame(e),
|
|
43326
|
+
disabled: modelLoading,
|
|
43327
|
+
children: /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
43328
|
+
"img",
|
|
43329
|
+
{
|
|
43330
|
+
src: e.variantImage,
|
|
43331
|
+
alt: e.name + "image",
|
|
43332
|
+
width: 60,
|
|
43333
|
+
height: 60,
|
|
43334
|
+
style: {
|
|
43335
|
+
transform: (selectedFrame == null ? void 0 : selectedFrame._id) === e._id ? "scale(1.2,1.2)" : "scale(1,1)"
|
|
43336
|
+
}
|
|
43337
|
+
}
|
|
43338
|
+
)
|
|
43339
|
+
}
|
|
43340
|
+
),
|
|
43341
|
+
(selectedFrame == null ? void 0 : selectedFrame._id) === e._id && /* @__PURE__ */ jsxRuntimeExports.jsx("p", { className: "sprie-config-palette-img-text", children: /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "sprie-config-palette-imgName", children: e.name }) })
|
|
43342
|
+
] }, e._id))
|
|
43343
|
+
}
|
|
43344
|
+
);
|
|
43345
|
+
}
|
|
43346
|
+
function LensPalette({
|
|
43347
|
+
lensList,
|
|
43348
|
+
selectedLens,
|
|
43349
|
+
modelLoading,
|
|
43350
|
+
onChangeLens
|
|
43351
|
+
}) {
|
|
43352
|
+
const isMobileView = window.innerWidth <= 576;
|
|
43353
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
43354
|
+
"div",
|
|
43355
|
+
{
|
|
43356
|
+
className: "sprie-config-palette",
|
|
43357
|
+
style: {
|
|
43358
|
+
padding: "0 1.2rem 1.6rem 1.2rem",
|
|
43359
|
+
marginTop: isMobileView ? "1rem" : "0",
|
|
43360
|
+
gap: isMobileView ? ".3rem" : "1rem"
|
|
43361
|
+
},
|
|
43362
|
+
children: lensList == null ? void 0 : lensList.map((e) => /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "sprie-config-palette-img-box", children: [
|
|
43363
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
43364
|
+
"button",
|
|
43365
|
+
{
|
|
43366
|
+
style: {
|
|
43367
|
+
border: "0",
|
|
43368
|
+
cursor: modelLoading ? "default" : "pointer",
|
|
43369
|
+
opacity: (selectedLens == null ? void 0 : selectedLens._id) === e._id ? "1" : ".6"
|
|
43370
|
+
},
|
|
43371
|
+
onClick: () => onChangeLens(e),
|
|
43372
|
+
disabled: modelLoading,
|
|
43373
|
+
children: /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
43374
|
+
"img",
|
|
43375
|
+
{
|
|
43376
|
+
src: e.thumbnail,
|
|
43377
|
+
alt: e.name + "image",
|
|
43378
|
+
width: isMobileView ? 45 : 60,
|
|
43379
|
+
height: isMobileView ? 45 : 60,
|
|
43380
|
+
style: {
|
|
43381
|
+
border: (selectedLens == null ? void 0 : selectedLens._id) === e._id ? "1px solid #9d9b9c" : "0",
|
|
43382
|
+
borderRadius: "50%",
|
|
43383
|
+
padding: "1px"
|
|
43384
|
+
}
|
|
43385
|
+
}
|
|
43386
|
+
)
|
|
43387
|
+
}
|
|
43388
|
+
),
|
|
43389
|
+
(selectedLens == null ? void 0 : selectedLens._id) === e._id && /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
43390
|
+
"p",
|
|
43391
|
+
{
|
|
43392
|
+
className: "sprie-config-palette-img-text",
|
|
43393
|
+
style: { bottom: "-1.2rem" },
|
|
43394
|
+
children: /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "sprie-config-palette-imgName", children: e.name })
|
|
43395
|
+
}
|
|
43396
|
+
)
|
|
43397
|
+
] }, e._id))
|
|
43398
|
+
}
|
|
43399
|
+
);
|
|
43400
|
+
}
|
|
43401
|
+
const index$2 = "";
|
|
43402
|
+
function LaserEngraving({ heading, onChecked, onTextAdded }) {
|
|
43403
|
+
const [input, setInput] = reactExports.useState("");
|
|
43404
|
+
const [isChecked, setIsChecked] = reactExports.useState(false);
|
|
43405
|
+
reactExports.useEffect(() => {
|
|
43406
|
+
onChecked(isChecked);
|
|
43407
|
+
});
|
|
43408
|
+
reactExports.useEffect(() => {
|
|
43409
|
+
onTextAdded(input);
|
|
43410
|
+
}, [input]);
|
|
43411
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "sprie-config-engraving-block", style: { marginTop: ".5rem" }, children: [
|
|
43412
|
+
/* @__PURE__ */ jsxRuntimeExports.jsxs("div", { style: { display: "flex", alignItems: "center", gap: ".8rem" }, children: [
|
|
43413
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
43414
|
+
"input",
|
|
43415
|
+
{
|
|
43416
|
+
type: "checkbox",
|
|
43417
|
+
className: "sprie-config-engraving-checkbox",
|
|
43418
|
+
onChange: (e) => {
|
|
43419
|
+
setIsChecked(e.target.checked);
|
|
43420
|
+
},
|
|
43421
|
+
checked: isChecked
|
|
43422
|
+
}
|
|
43423
|
+
),
|
|
43424
|
+
/* @__PURE__ */ jsxRuntimeExports.jsxs("p", { style: { fontSize: ".9rem", color: "#4d4d4d", fontWeight: "500" }, children: [
|
|
43425
|
+
"Add ",
|
|
43426
|
+
"Laser Engraving",
|
|
43427
|
+
" ",
|
|
43428
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("span", { style: { fontWeight: "400" }, children: "(OPTIONAL)" })
|
|
43429
|
+
] })
|
|
43430
|
+
] }),
|
|
43431
|
+
/* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "sprie-config-engraving-inputField-block", children: [
|
|
43432
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
43433
|
+
"input",
|
|
43434
|
+
{
|
|
43435
|
+
type: "text",
|
|
43436
|
+
className: "sprie-config-engraving-inputField",
|
|
43437
|
+
placeholder: "ADD CUSTOM TEXT",
|
|
43438
|
+
value: input,
|
|
43439
|
+
onChange: (e) => setInput(e.target.value),
|
|
43440
|
+
maxLength: 15,
|
|
43441
|
+
style: { padding: "0.7rem" },
|
|
43442
|
+
disabled: !isChecked
|
|
43443
|
+
}
|
|
43444
|
+
),
|
|
43445
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "sprie-config-engraving-inputInfo", children: `${input.length}/15 characters` }),
|
|
43446
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("a", { href: "#", className: "sprie-config-engraving-link", children: "About Custom Laser Engraving" })
|
|
43447
|
+
] })
|
|
43448
|
+
] });
|
|
43449
|
+
}
|
|
43450
|
+
const index$1 = "";
|
|
43451
|
+
function StepTracker({
|
|
43452
|
+
totalSteps,
|
|
43453
|
+
currentStep
|
|
43454
|
+
}) {
|
|
43455
|
+
const isMobileView = window.innerWidth <= 576;
|
|
43456
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
43457
|
+
"div",
|
|
43458
|
+
{
|
|
43459
|
+
className: "step-tracker-block",
|
|
43460
|
+
style: {
|
|
43461
|
+
margin: isMobileView ? "1rem 0" : ".7rem 0 1rem 0",
|
|
43462
|
+
paddingBottom: "1.5rem"
|
|
43463
|
+
},
|
|
43464
|
+
children: /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "step-tracker", children: Array.from({ length: totalSteps }).map((_, index2) => /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
43465
|
+
"div",
|
|
43466
|
+
{
|
|
43467
|
+
className: `step-circle ${index2 + 1 === currentStep ? "active" : ""}`
|
|
43468
|
+
},
|
|
43469
|
+
index2
|
|
43470
|
+
)) })
|
|
43471
|
+
}
|
|
43472
|
+
);
|
|
43473
|
+
}
|
|
43474
|
+
function CarouselHeader({
|
|
43475
|
+
nextSlide,
|
|
43476
|
+
previousSlide,
|
|
43477
|
+
currentIndex,
|
|
43478
|
+
stepsName,
|
|
43479
|
+
isLastStep
|
|
43480
|
+
}) {
|
|
43481
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "carousel-header", children: [
|
|
43482
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
43483
|
+
"button",
|
|
43484
|
+
{
|
|
43485
|
+
className: "carousel-btn prev",
|
|
43486
|
+
onClick: previousSlide,
|
|
43487
|
+
style: { visibility: currentIndex !== 0 ? "visible" : "hidden" },
|
|
43488
|
+
children: /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
43489
|
+
"i",
|
|
43490
|
+
{
|
|
43491
|
+
className: "arrow left-arrow",
|
|
43492
|
+
style: {
|
|
43493
|
+
padding: ".25rem"
|
|
43494
|
+
/* 4px */
|
|
43495
|
+
}
|
|
43496
|
+
}
|
|
43497
|
+
)
|
|
43498
|
+
}
|
|
43499
|
+
),
|
|
43500
|
+
/* @__PURE__ */ jsxRuntimeExports.jsxs("p", { children: [
|
|
43501
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "step-syntax", children: `STEP ${currentIndex + 1}: ` }),
|
|
43502
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "select-syntax", children: stepsName[currentIndex] })
|
|
43503
|
+
] }),
|
|
43504
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
43505
|
+
"button",
|
|
43506
|
+
{
|
|
43507
|
+
className: "carousel-btn next",
|
|
43508
|
+
onClick: nextSlide,
|
|
43509
|
+
style: {
|
|
43510
|
+
visibility: isLastStep ? "hidden" : "visible"
|
|
43511
|
+
},
|
|
43512
|
+
children: /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
43513
|
+
"i",
|
|
43514
|
+
{
|
|
43515
|
+
className: "arrow right-arrow",
|
|
43516
|
+
style: {
|
|
43517
|
+
padding: ".25rem"
|
|
43518
|
+
/* 4px */
|
|
43519
|
+
}
|
|
43520
|
+
}
|
|
43521
|
+
)
|
|
43522
|
+
}
|
|
43523
|
+
)
|
|
43524
|
+
] });
|
|
43525
|
+
}
|
|
43526
|
+
function Carousel({
|
|
43527
|
+
setShowAddToCart,
|
|
43528
|
+
children
|
|
43529
|
+
}) {
|
|
43530
|
+
var _a2;
|
|
43531
|
+
const [currentIndex, setCurrentIndex] = reactExports.useState(0);
|
|
43532
|
+
const carouselElements = React.Children.toArray(children);
|
|
43533
|
+
const isLastStep = !(currentIndex !== carouselElements.length - 1);
|
|
43534
|
+
const stepsName = (_a2 = carouselElements.map((child) => child)) == null ? void 0 : _a2.map((e) => e.props.heading);
|
|
43535
|
+
const goToPreviousSlide = () => {
|
|
43536
|
+
setCurrentIndex(
|
|
43537
|
+
(prevIndex) => prevIndex === 0 ? React.Children.count(children) - 1 : prevIndex - 1
|
|
43538
|
+
);
|
|
43539
|
+
};
|
|
43540
|
+
const goToNextSlide = () => {
|
|
43541
|
+
setCurrentIndex(
|
|
43542
|
+
(prevIndex) => prevIndex === React.Children.count(children) - 1 ? 0 : prevIndex + 1
|
|
43543
|
+
);
|
|
43544
|
+
};
|
|
43545
|
+
reactExports.useEffect(() => {
|
|
43546
|
+
if (isLastStep) {
|
|
43547
|
+
setShowAddToCart(true);
|
|
43548
|
+
} else {
|
|
43549
|
+
setShowAddToCart(false);
|
|
43550
|
+
}
|
|
43551
|
+
}, [isLastStep, setShowAddToCart]);
|
|
43552
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "carousel", children: [
|
|
43553
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
43554
|
+
CarouselHeader,
|
|
43555
|
+
{
|
|
43556
|
+
nextSlide: goToNextSlide,
|
|
43557
|
+
previousSlide: goToPreviousSlide,
|
|
43558
|
+
currentIndex,
|
|
43559
|
+
stepsName,
|
|
43560
|
+
isLastStep
|
|
43561
|
+
}
|
|
43562
|
+
),
|
|
43563
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
43564
|
+
StepTracker,
|
|
43565
|
+
{
|
|
43566
|
+
totalSteps: stepsName == null ? void 0 : stepsName.length,
|
|
43567
|
+
currentStep: currentIndex + 1
|
|
43568
|
+
}
|
|
43569
|
+
),
|
|
43570
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "carousel-container", children: carouselElements.map((child, index2) => /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
43571
|
+
"div",
|
|
43572
|
+
{
|
|
43573
|
+
className: "carousel-item",
|
|
43574
|
+
style: {
|
|
43575
|
+
transform: `translateX(-${currentIndex * 100}%)`
|
|
43576
|
+
},
|
|
43577
|
+
children: child
|
|
43578
|
+
},
|
|
43579
|
+
index2
|
|
43580
|
+
)) })
|
|
43581
|
+
] });
|
|
43582
|
+
}
|
|
43583
|
+
const index = "";
|
|
43584
|
+
function AddToCartBtn() {
|
|
43585
|
+
const [isChecked, setIsChecked] = reactExports.useState(false);
|
|
43586
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "sprie-config-add-to-cart-block", children: [
|
|
43587
|
+
/* @__PURE__ */ jsxRuntimeExports.jsxs(
|
|
43588
|
+
"label",
|
|
43589
|
+
{
|
|
43590
|
+
htmlFor: "Sprie-Config-return-policy-checkbox",
|
|
43591
|
+
id: "Sprie-Config-return-policy-label",
|
|
43592
|
+
children: [
|
|
43593
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
43594
|
+
"input",
|
|
43595
|
+
{
|
|
43596
|
+
type: "checkbox",
|
|
43597
|
+
id: "Sprie-Config-return-policy-checkbox",
|
|
43598
|
+
name: "sprie-config-return-policy-checkbox",
|
|
43599
|
+
onChange: (e) => setIsChecked(e.target.checked),
|
|
43600
|
+
checked: isChecked
|
|
43601
|
+
}
|
|
43602
|
+
),
|
|
43603
|
+
/* @__PURE__ */ jsxRuntimeExports.jsxs("p", { children: [
|
|
43604
|
+
"I agree this customized Item cannot be returned or exchanged.",
|
|
43605
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("span", { style: { color: "red" }, children: "*" })
|
|
43606
|
+
] })
|
|
43607
|
+
]
|
|
43608
|
+
}
|
|
43609
|
+
),
|
|
43610
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("button", { className: "sprie-config-add-to-cart-btn", disabled: !isChecked, children: "ADD TO CART" })
|
|
43611
|
+
] });
|
|
43612
|
+
}
|
|
43613
|
+
function OrbitalPalette({
|
|
43614
|
+
orbitalList,
|
|
43615
|
+
selectedOrbital,
|
|
43616
|
+
modelLoading,
|
|
43617
|
+
onChangeOrbital
|
|
43618
|
+
}) {
|
|
43619
|
+
const isMobileView = window.innerWidth <= 576;
|
|
43620
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
43621
|
+
"div",
|
|
43622
|
+
{
|
|
43623
|
+
className: "sprie-config-palette",
|
|
43624
|
+
style: {
|
|
43625
|
+
padding: "0 1.2rem 1.6rem 1.2rem",
|
|
43626
|
+
marginTop: isMobileView ? "1rem" : "0",
|
|
43627
|
+
gap: isMobileView ? ".3rem" : "1rem"
|
|
43628
|
+
},
|
|
43629
|
+
children: orbitalList == null ? void 0 : orbitalList.map((e) => /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "sprie-config-palette-img-box", children: [
|
|
43630
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
43631
|
+
"button",
|
|
43632
|
+
{
|
|
43633
|
+
style: {
|
|
43634
|
+
border: "0",
|
|
43635
|
+
cursor: modelLoading ? "default" : "pointer",
|
|
43636
|
+
opacity: (selectedOrbital == null ? void 0 : selectedOrbital._id) === e._id ? "1" : ".6"
|
|
43637
|
+
},
|
|
43638
|
+
onClick: () => onChangeOrbital(e),
|
|
43639
|
+
disabled: modelLoading,
|
|
43640
|
+
children: /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
43641
|
+
"img",
|
|
43642
|
+
{
|
|
43643
|
+
src: e.thumbnail,
|
|
43644
|
+
alt: e.name + "image",
|
|
43645
|
+
width: isMobileView ? 45 : 60,
|
|
43646
|
+
height: isMobileView ? 45 : 60,
|
|
43647
|
+
style: {
|
|
43648
|
+
border: (selectedOrbital == null ? void 0 : selectedOrbital._id) === e._id ? "1px solid #9d9b9c" : "0",
|
|
43649
|
+
borderRadius: "50%",
|
|
43650
|
+
padding: "1px"
|
|
43651
|
+
}
|
|
43652
|
+
}
|
|
43653
|
+
)
|
|
43654
|
+
}
|
|
43655
|
+
),
|
|
43656
|
+
(selectedOrbital == null ? void 0 : selectedOrbital._id) === e._id && /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
43657
|
+
"p",
|
|
43658
|
+
{
|
|
43659
|
+
className: "sprie-config-palette-img-text",
|
|
43660
|
+
style: { bottom: "-1.2rem" },
|
|
43661
|
+
children: /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "sprie-config-palette-imgName", children: e.name })
|
|
43662
|
+
}
|
|
43663
|
+
)
|
|
43664
|
+
] }, e._id))
|
|
43665
|
+
}
|
|
43666
|
+
);
|
|
43667
|
+
}
|
|
43668
|
+
const ditaLogo = "data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBzdGFuZGFsb25lPSJubyI/Pgo8IURPQ1RZUEUgc3ZnIFBVQkxJQyAiLS8vVzNDLy9EVEQgU1ZHIDIwMDEwOTA0Ly9FTiIKICJodHRwOi8vd3d3LnczLm9yZy9UUi8yMDAxL1JFQy1TVkctMjAwMTA5MDQvRFREL3N2ZzEwLmR0ZCI+CjxzdmcgdmVyc2lvbj0iMS4wIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciCiB3aWR0aD0iMzIwLjAwMDAwMHB0IiBoZWlnaHQ9IjY2LjAwMDAwMHB0IiB2aWV3Qm94PSIwIDAgMzIwLjAwMDAwMCA2Ni4wMDAwMDAiCiBwcmVzZXJ2ZUFzcGVjdFJhdGlvPSJ4TWlkWU1pZCBtZWV0Ij4KCjxnIHRyYW5zZm9ybT0idHJhbnNsYXRlKDAuMDAwMDAwLDY2LjAwMDAwMCkgc2NhbGUoMC4xMDAwMDAsLTAuMTAwMDAwKSIKZmlsbD0iIzAwMDAwMCIgc3Ryb2tlPSJub25lIj4KPHBhdGggZD0iTTAgNjUxIGMwIC02IDkgLTExIDIxIC0xMSAxMSAwIDI5IC01IDQwIC0xMCAxOCAtMTAgMTkgLTI0IDE5IC0zMDAKMCAtMjc2IC0xIC0yOTAgLTE5IC0zMDAgLTExIC01IC0yOSAtMTAgLTQwIC0xMCAtMTIgMCAtMjEgLTQgLTIxIC0xMCAwIC0xNAo0NDUgLTEzIDUxMiAxIDEwNyAyMyAxOTAgODUgMjM5IDE3OSAyMCAzNyAyNCA2MCAyNCAxMzUgMCA3OCAtNCA5NyAtMjggMTQ3Ci0zNCA3MCAtMTAwIDEzMCAtMTc2IDE2MCAtNTIgMjEgLTc1IDIzIC0zMTMgMjYgLTE4MCAyIC0yNTggMCAtMjU4IC03eiBtNDcwCi0zNiBjMTUgLTggMzggLTI3IDQ5IC00MSAyMCAtMjUgMjEgLTM5IDIxIC0yMzggMCAtMTk0IC0yIC0yMTQgLTIwIC0yNDQgLTExCi0xOCAtMzYgLTQwIC01NSAtNDggLTQ2IC0xOSAtMTM1IC0xOCAtMTYzIDIgLTIyIDE1IC0yMiAxNyAtMjIgMzAwIGwwIDI4NCA4MAowIGM1MiAwIDkxIC01IDExMCAtMTV6Ii8+CjxwYXRoIGQ9Ik05ODAgNjUwIGMwIC01IDExIC0xMCAyNCAtMTAgNTUgMCA1NiAtNyA1NiAtMzEwIDAgLTMwMyAtMSAtMzEwIC01NgotMzEwIC0xMyAwIC0yNCAtNCAtMjQgLTEwIDAgLTYgNjcgLTEwIDE4MCAtMTAgMTEzIDAgMTgwIDQgMTgwIDEwIDAgNiAtMTEgMTAKLTIzIDEwIC0xMyAwIC0zMSA4IC00MCAxOCAtMTUgMTYgLTE3IDUyIC0xNyAyOTQgMCAyNTQgMSAyNzYgMTggMjkxIDEwIDEwIDI4CjE3IDQwIDE3IDEyIDAgMjIgNSAyMiAxMCAwIDYgLTY3IDEwIC0xODAgMTAgLTExMyAwIC0xODAgLTQgLTE4MCAtMTB6Ii8+CjxwYXRoIGQ9Ik0xNTI2IDYwMSBjLTI1IC0zMyAtNDYgLTY0IC00NiAtNzAgMCAtNiAyNCA1IDU0IDI0IDUzIDM0IDE1OSA3NQoxOTQgNzUgMTAgMCAyOCAtMTAgNDAgLTIzIDIxIC0yMyAyMiAtMzAgMjIgLTI4OSAwIC0yODkgLTIgLTI5OCAtNTYgLTI5OCAtMTMKMCAtMjQgLTQgLTI0IC0xMCAwIC02IDY3IC0xMCAxODAgLTEwIDExMyAwIDE4MCA0IDE4MCAxMCAwIDYgLTExIDEwIC0yNCAxMAotNTQgMCAtNTYgOSAtNTYgMjk0IDAgMjUxIDEgMjY1IDIxIDI5MCAxMSAxNCAzMCAyNiA0MiAyNiAzNyAtMSAxNTMgLTQ2IDIwMQotNzggMjUgLTE3IDQ2IC0yNyA0NiAtMjEgMCA2IC0yMSAzNyAtNDYgNzAgbC00NyA1OSAtMzE3IDAgLTMxNyAwIC00NyAtNTl6Ii8+CjxwYXRoIGQ9Ik0yNDU1IDY1MCBjMyAtNSAxNSAtMTAgMjYgLTEwIDMwIDAgNjUgLTI3IDk3IC03NiBsMjkgLTQzIC05MCAtMTc4CmMtMTM2IC0yNzAgLTE2MyAtMzEzIC0xOTggLTMyMCAtNTkgLTExIC0yNiAtMjMgNjYgLTIzIDg5IDAgMTIxIDExIDc1IDI1IC0yOQo5IC0yNiA1NSAxMCAxMjYgbDMxIDYwIDE1MSAtMyAxNTEgLTMgMzkgLTczIGMzMCAtNTkgMzYgLTc3IDI4IC05MyAtNiAtMTAKLTIwIC0xOSAtMzAgLTE5IC0xMSAwIC0yMCAtNCAtMjAgLTEwIDAgLTYgNzAgLTEwIDE5MCAtMTAgMTIwIDAgMTkwIDQgMTkwIDEwCjAgNiAtMTEgMTAgLTI0IDEwIC0xNCAwIC0zNiAxMCAtNTAgMjMgLTE1IDEyIC0xMDYgMTU1IC0yMDQgMzE3IGwtMTc3IDI5NQotMTQ4IDMgYy0xMDAgMiAtMTQ2IC0xIC0xNDIgLTh6IG0yNTggLTM5OCBjLTM1IC0yIC05MiAtMiAtMTI3IDAgbC02NCAzIDYwCjExMyA2MCAxMTMgNjcgLTExMyA2NyAtMTEzIC02MyAtM3oiLz4KPC9nPgo8L3N2Zz4K";
|
|
43669
|
+
const deg360_Icon = "data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0idXRmLTgiPz4KPCEtLSBHZW5lcmF0b3I6IEFkb2JlIElsbHVzdHJhdG9yIDI4LjMuMCwgU1ZHIEV4cG9ydCBQbHVnLUluIC4gU1ZHIFZlcnNpb246IDYuMDAgQnVpbGQgMCkgIC0tPgo8c3ZnIHZlcnNpb249IjEuMSIgaWQ9IkxheWVyXzUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIHg9IjBweCIgeT0iMHB4IgoJIHZpZXdCb3g9IjAgMCA4ODYgNjk4IiBzdHlsZT0iZW5hYmxlLWJhY2tncm91bmQ6bmV3IDAgMCA4ODYgNjk4OyIgeG1sOnNwYWNlPSJwcmVzZXJ2ZSI+CjxzdHlsZSB0eXBlPSJ0ZXh0L2NzcyI+Cgkuc3Qwe2ZpbGw6IzkxODQ3RTt9Cjwvc3R5bGU+CjxwYXRoIGNsYXNzPSJzdDAiIGQ9Ik04NDAuMDEsNDEuMDFjLTM2LjcxLTMxLjU2LTEwOC45NC01Ny45Ny0yNDQuNi00LjU2Yy0yMC40Nyw4LjA2LTQxLjQ2LDE3LjU3LTYyLjc1LDI4LjM2CgljMTkuMzgtNC42Niw0MzEuNTItMTAxLDE3NS42MSwxOTkuNDJsLTAuMDQsMGMtMjUuODUsMzUuNS01Ny44Miw3Mi4wOC05NC40MiwxMDcuOTdsLTMyLjcyLTI4LjE0bC02LjQ0LDE0MS43NmwxNjQuODQtNS41NwoJbC00NC4zNC0zOC4xMmM2NS41NC02My43NCwxMTcuODUtMTI5Ljk0LDE1MC4yMi0xOTAuNzdDOTA3LjQ0LDEzNC42OSw4NzYuNzEsNzIuNTcsODQwLjAxLDQxLjAxeiIvPgo8cGF0aCBjbGFzcz0ic3QwIiBkPSJNNTYyLjE3LDQyNS42N2MtNjQuNDcsNDYuMi0xMzIuNjcsODYuMjItMTk4LjQzLDExNi43NmMtMC4wOSwwLjA0LTAuMTcsMC4wOC0wLjI1LDAuMTMKCUMtMTkuMjcsNzMwLjcyLDczLjg2LDQ0MS4xMyw4OC4wNyw0MDEuNDVsLTIuMDktMS41MWMtMTQuNjcsMTcuOTMtMjcuNiwzNS42MS0zOC41Myw1Mi44NEMtMjQuNCw1NjYsMTEuMTYsNjI2LjI3LDUzLjY0LDY1Ni44OQoJYzQyLjQ4LDMwLjYzLDEyNi4wNyw1Ni4yNSwyODMuMDUsNC40M2M5OS0zMi42OSwyMDguNTgtODkuNywzMTAuMDYtMTYxLjE5bC04My43Ny0wLjQ2TDU2Mi4xNyw0MjUuNjd6Ii8+CjxwYXRoIGNsYXNzPSJzdDAiIGQ9Ik0yMTIuOSwxOTcuNzRjMCwzNS41NC0yNS43Myw1Mi44MS00MS45OCw1Mi44MXYxLjAxYzIwLjY1LDAsNDYuMzcsMTUuOTEsNDYuMzcsNTEuNDUKCWMwLDM3LjkxLTM0LjE5LDYzLjk4LTgzLjYxLDYzLjk4Yy00My42NywwLTcxLjA5LTE3LjI3LTgzLjk1LTU0Ljg0bDQyLjMxLTE4Ljk2YzQuNzQsMjQuMzcsMTcuMjYsMzYuMjIsNDEuOTgsMzYuMjIKCWMyMy43LDAsMzcuOTEtMTIuODcsMzcuNTctMzIuNWMtMC4zNC0yMC45OS0xMy4yLTI4Ljc4LTM5Ljk0LTI4Ljc4aC0xMS4xN3YtMzIuNWg5LjQ4YzI0LjM3LDAsMzYuNTYtOS44MiwzNi41Ni0yOS43OQoJYzAuMzQtMjAuNjUtMTEuNTEtMzEuNDgtMzEuODItMzEuNDhjLTIwLjY1LDAtMzMuODUsMTAuODMtMzYuOSwzMS44MmwtNDEuNjQtMTUuMjNjOC44LTM2LjksNDAuNjItNTQuMTYsODAuNTYtNTQuMTYKCUMxODUuODIsMTM2LjgxLDIxMi45LDE2Mi41NCwyMTIuOSwxOTcuNzR6Ii8+CjxwYXRoIGNsYXNzPSJzdDAiIGQ9Ik0zOTYuOTgsMTg1LjU2bC0zOS4yNywxOC4yOGMtNS40Mi0xNy42LTE3LjI2LTI4LjQzLTM4LjkzLTI4LjQzYy0yOC43OCwwLTQ5LjA4LDMwLjgtNDkuMDgsNzYuMTZ2NS43NmgxLjAxCgljNy40NS0yMy4wMiwzMS4xNC0zMy41MSw1Ni44Ny0zMy41MWM0Mi45OSwwLDczLjEyLDI3LjQyLDczLjEyLDcwLjQxYzAsNDQuMzQtMzAuOCw3Mi43OC04Mi42LDcyLjc4CgljLTU4LjIzLDAtOTAuMzgtNDIuOTktOTAuMzgtMTE1LjA5YzAtNzcuNTIsNDAuNjItMTE1LjA5LDk0LjExLTExNS4wOUMzNTcuNzEsMTM2LjgxLDM4NC4xMiwxNTAuMzUsMzk2Ljk4LDE4NS41NnogTTI4MC41MywyOTMuNTQKCWMwLDIyLjM0LDE1LjIzLDM2LjIyLDM4LjI1LDM2LjIyYzI0LjAzLDAsMzcuOTEtMTMuMiwzNy45MS0zNi4yMmMwLTIyLTEzLjg4LTM1LjU0LTM3LjkxLTM1LjU0CglDMjk1Ljc2LDI1OCwyODAuNTMsMjcyLjIyLDI4MC41MywyOTMuNTR6Ii8+CjxwYXRoIGNsYXNzPSJzdDAiIGQ9Ik00MTQuNzgsMjUxLjkxYzAtNzUuNDksMzAuMTMtMTE1LjA5LDg5LjM3LTExNS4wOXM4OS4zNywzOS42LDg5LjM3LDExNS4wOVM1NjMuMzgsMzY3LDUwNC4xNSwzNjcKCVM0MTQuNzgsMzI3LjM5LDQxNC43OCwyNTEuOTF6IE01NDYuOCwyNTEuOTFjMC01My4xNS0xMy44OC03Ny41Mi00Mi42NS03Ny41MmMtMjguNzcsMC00Mi42NSwyNC4zNy00Mi42NSw3Ny41MgoJYzAsNTMuMTUsMTMuODgsNzcuNTIsNDIuNjUsNzcuNTJDNTMyLjkyLDMyOS40Myw1NDYuOCwzMDUuMDUsNTQ2LjgsMjUxLjkxeiIvPgo8cGF0aCBjbGFzcz0ic3QwIiBkPSJNNTg4LjIsMTI4LjEzYzAtMTguNjMsMTMuNzgtMzIuMDIsMzIuOTktMzIuMDJjMTkuMjEsMCwzMi45OSwxMy4zOSwzMi45OSwzMi4wMnMtMTMuNzgsMzIuMDItMzIuOTksMzIuMDIKCUM2MDEuOTcsMTYwLjE0LDU4OC4yLDE0Ni43Niw1ODguMiwxMjguMTN6IE02NDAuNTksMTI4LjEzYzAtMTEuMjUtOC4xNS0xOS40LTE5LjQtMTkuNHMtMTkuNCw4LjE1LTE5LjQsMTkuNHM4LjE1LDE5LjQsMTkuNCwxOS40CglTNjQwLjU5LDEzOS4zOCw2NDAuNTksMTI4LjEzeiIvPgo8L3N2Zz4K";
|
|
43670
|
+
function MainContainer({
|
|
43671
|
+
orgName,
|
|
43672
|
+
customEvent,
|
|
43673
|
+
apiService: apiService2,
|
|
43674
|
+
frameList,
|
|
43675
|
+
lensList,
|
|
43676
|
+
orbitalList,
|
|
43677
|
+
showOrbitalList,
|
|
43678
|
+
viewerOnly,
|
|
43679
|
+
domService,
|
|
43680
|
+
ThreeDConfigurator: ThreeDConfigurator2
|
|
43681
|
+
}) {
|
|
43682
|
+
const [selectedFrame, setSelectedFrame] = reactExports.useState();
|
|
43683
|
+
const [selectedLens, setSelectedLens] = reactExports.useState();
|
|
43684
|
+
const [selectedOrbital, setSelectedOrbital] = reactExports.useState();
|
|
43685
|
+
const [modelLoading, setModelLoading] = reactExports.useState(false);
|
|
43686
|
+
const [showAddToCart, setShowAddToCart] = reactExports.useState(false);
|
|
43687
|
+
const domInstance = reactExports.useRef();
|
|
43688
|
+
domInstance.current = domService;
|
|
43689
|
+
const isMobileView = window.innerWidth <= 576;
|
|
43690
|
+
const windowHeight = window.innerHeight / 16;
|
|
43691
|
+
const occupiedHeight = isMobileView ? showAddToCart ? (336 + 84) / 16 : (280 + 84) / 16 : (240 + 88) / 16;
|
|
43692
|
+
const onChangeFrame = async (frame, reload) => {
|
|
43693
|
+
if (frame._id === (selectedFrame == null ? void 0 : selectedFrame._id) && !reload) {
|
|
43694
|
+
return;
|
|
43695
|
+
}
|
|
43696
|
+
if (!domInstance.current)
|
|
43697
|
+
return;
|
|
43698
|
+
setModelLoading(true);
|
|
43699
|
+
domInstance.current.changeFrame(frame, [selectedLens, selectedOrbital]).then(() => {
|
|
43700
|
+
setModelLoading(false);
|
|
43701
|
+
});
|
|
43702
|
+
setSelectedFrame(frame);
|
|
43703
|
+
};
|
|
43704
|
+
const getLensInfo = (frame) => {
|
|
43705
|
+
const hasSpecialDefaultLens = (frame == null ? void 0 : frame.customisation.length) == 0;
|
|
43706
|
+
const includedLens = hasSpecialDefaultLens ? null : frame == null ? void 0 : frame.customisation.find((x2) => x2.type == "Lens");
|
|
43707
|
+
return includedLens;
|
|
43708
|
+
};
|
|
43709
|
+
const getOrbitalInfo = (frame) => {
|
|
43710
|
+
const includedOrbital = frame == null ? void 0 : frame.customisation.find((x2) => x2.type == "Orbital");
|
|
43711
|
+
return includedOrbital;
|
|
43712
|
+
};
|
|
43713
|
+
const onChangeLens = async (requestedLens) => {
|
|
43714
|
+
if (!domInstance.current) {
|
|
43715
|
+
return;
|
|
43716
|
+
}
|
|
43717
|
+
if (requestedLens == selectedLens) {
|
|
43718
|
+
return;
|
|
43719
|
+
}
|
|
43720
|
+
const isDefaultRequested = requestedLens.sku == "lens-default";
|
|
43721
|
+
const frameDefaultLens = getLensInfo(selectedFrame);
|
|
43722
|
+
if (!frameDefaultLens && isDefaultRequested) {
|
|
43723
|
+
setModelLoading(true);
|
|
43724
|
+
domInstance.current.changeLens([requestedLens, selectedOrbital], true, selectedFrame).then(() => {
|
|
43725
|
+
setModelLoading(false);
|
|
43726
|
+
});
|
|
43727
|
+
} else if (!frameDefaultLens && !isDefaultRequested) {
|
|
43728
|
+
if ((selectedLens == null ? void 0 : selectedLens.sku) == "lens-default") {
|
|
43729
|
+
setModelLoading(true);
|
|
43730
|
+
domInstance.current.changeLens([requestedLens, selectedOrbital], true, selectedFrame).then(() => {
|
|
43731
|
+
setModelLoading(false);
|
|
43732
|
+
});
|
|
43733
|
+
} else {
|
|
43734
|
+
domInstance.current.changeLens([requestedLens, selectedOrbital], false, selectedFrame);
|
|
43735
|
+
}
|
|
43736
|
+
} else if (frameDefaultLens && isDefaultRequested) {
|
|
43737
|
+
domInstance.current.changeLens([frameDefaultLens, selectedOrbital], false, selectedFrame);
|
|
43738
|
+
} else {
|
|
43739
|
+
domInstance.current.changeLens([requestedLens, selectedOrbital], false, selectedFrame);
|
|
43740
|
+
}
|
|
43741
|
+
setSelectedLens(requestedLens);
|
|
43742
|
+
};
|
|
43743
|
+
const onChangeOrbital = async (requestedOrbital) => {
|
|
43744
|
+
if (!domInstance.current) {
|
|
43745
|
+
return;
|
|
43746
|
+
}
|
|
43747
|
+
if (requestedOrbital == selectedOrbital) {
|
|
43748
|
+
return;
|
|
43749
|
+
}
|
|
43750
|
+
const isDefaultRequested = requestedOrbital.sku == "orbital-default";
|
|
43751
|
+
const frameDefaultOrbital = getOrbitalInfo(selectedFrame);
|
|
43752
|
+
setModelLoading(true);
|
|
43753
|
+
if (isDefaultRequested) {
|
|
43754
|
+
await domInstance.current.changeOrbital(frameDefaultOrbital).then(() => {
|
|
43755
|
+
setModelLoading(false);
|
|
43756
|
+
});
|
|
43757
|
+
} else {
|
|
43758
|
+
await domInstance.current.changeOrbital(requestedOrbital).then(() => {
|
|
43759
|
+
setModelLoading(false);
|
|
43760
|
+
});
|
|
43761
|
+
}
|
|
43762
|
+
setSelectedOrbital(requestedOrbital);
|
|
43763
|
+
};
|
|
43764
|
+
const onEngravingChecked = (checked) => {
|
|
43765
|
+
console.log(checked);
|
|
43766
|
+
};
|
|
43767
|
+
const onEngravingTextAdded = (text) => {
|
|
43768
|
+
console.log(text);
|
|
43769
|
+
};
|
|
43770
|
+
reactExports.useEffect(() => {
|
|
43771
|
+
frameList && setSelectedFrame(frameList[0]);
|
|
43772
|
+
lensList && setSelectedLens(lensList[0]);
|
|
43773
|
+
orbitalList && setSelectedOrbital(orbitalList[0]);
|
|
43774
|
+
}, [frameList, lensList, orbitalList]);
|
|
43775
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsxs("section", { id: "Sprie-config-Main-Container", children: [
|
|
43776
|
+
/* @__PURE__ */ jsxRuntimeExports.jsxs("header", { id: "Sprie-config-Header", children: [
|
|
43777
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
43778
|
+
"img",
|
|
43779
|
+
{
|
|
43780
|
+
src: ditaLogo,
|
|
43781
|
+
alt: "dita-logo",
|
|
43782
|
+
height: 20
|
|
43783
|
+
}
|
|
43784
|
+
),
|
|
43785
|
+
/* @__PURE__ */ jsxRuntimeExports.jsxs("p", { className: "sprie-config-Header-groupName", children: [
|
|
43786
|
+
orgName,
|
|
43787
|
+
" CUSTOMIZER"
|
|
43788
|
+
] })
|
|
43789
|
+
] }),
|
|
43790
|
+
/* @__PURE__ */ jsxRuntimeExports.jsxs(
|
|
43791
|
+
"div",
|
|
43792
|
+
{
|
|
43793
|
+
id: "Sprie-config-Viewer-Container",
|
|
43794
|
+
style: { height: `calc(${windowHeight}rem - ${occupiedHeight}rem)` },
|
|
43795
|
+
children: [
|
|
43796
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("img", { src: deg360_Icon, alt: "360deg-logo", height: 34 }),
|
|
43797
|
+
modelLoading && /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "sprie-config-loadingFrame", children: /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "sprie-config-loader" }) }),
|
|
43798
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("div", { style: { width: "100%", height: "100%" }, id: "holder-canvas" })
|
|
43799
|
+
]
|
|
43800
|
+
}
|
|
43801
|
+
),
|
|
43802
|
+
/* @__PURE__ */ jsxRuntimeExports.jsxs(
|
|
43803
|
+
"div",
|
|
43804
|
+
{
|
|
43805
|
+
id: "Sprie-config-Customisation-block",
|
|
43806
|
+
style: {
|
|
43807
|
+
paddingTop: "1.5rem",
|
|
43808
|
+
height: isMobileView ? showAddToCart ? "21rem" : "17.5rem" : "15rem"
|
|
43809
|
+
},
|
|
43810
|
+
children: [
|
|
43811
|
+
/* @__PURE__ */ jsxRuntimeExports.jsxs(
|
|
43812
|
+
"div",
|
|
43813
|
+
{
|
|
43814
|
+
className: "sprie-config-price-block",
|
|
43815
|
+
style: { top: isMobileView || !showAddToCart ? "-3rem" : "-8.5rem" },
|
|
43816
|
+
children: [
|
|
43817
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("p", { style: { marginRight: ".8rem" }, children: "$925.00 USD" }),
|
|
43818
|
+
!isMobileView && showAddToCart && /* @__PURE__ */ jsxRuntimeExports.jsx(AddToCartBtn, {}),
|
|
43819
|
+
showAddToCart && /* @__PURE__ */ jsxRuntimeExports.jsx("p", { style: { marginRight: ".8rem", fontSize: ".6rem" }, children: "Please Allow 7-10 Days for Customization Process." })
|
|
43820
|
+
]
|
|
43821
|
+
}
|
|
43822
|
+
),
|
|
43823
|
+
/* @__PURE__ */ jsxRuntimeExports.jsxs(Carousel, { setShowAddToCart, children: [
|
|
43824
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
43825
|
+
FramePalette,
|
|
43826
|
+
{
|
|
43827
|
+
modelLoading,
|
|
43828
|
+
frameList,
|
|
43829
|
+
selectedFrame,
|
|
43830
|
+
onChangeFrame,
|
|
43831
|
+
heading: "SELECT FRAME"
|
|
43832
|
+
}
|
|
43833
|
+
),
|
|
43834
|
+
showOrbitalList && /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
43835
|
+
OrbitalPalette,
|
|
43836
|
+
{
|
|
43837
|
+
orbitalList,
|
|
43838
|
+
selectedOrbital,
|
|
43839
|
+
modelLoading,
|
|
43840
|
+
onChangeOrbital,
|
|
43841
|
+
heading: "SELECT ORBITAL"
|
|
43842
|
+
}
|
|
43843
|
+
),
|
|
43844
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
43845
|
+
LensPalette,
|
|
43846
|
+
{
|
|
43847
|
+
modelLoading,
|
|
43848
|
+
lensList,
|
|
43849
|
+
selectedLens,
|
|
43850
|
+
onChangeLens,
|
|
43851
|
+
heading: "SELECT LENS COLOR"
|
|
43852
|
+
}
|
|
43853
|
+
),
|
|
43854
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
43855
|
+
LaserEngraving,
|
|
43856
|
+
{
|
|
43857
|
+
heading: "LASER ENGRAVING",
|
|
43858
|
+
onChecked: onEngravingChecked,
|
|
43859
|
+
onTextAdded: onEngravingTextAdded
|
|
43860
|
+
}
|
|
43861
|
+
)
|
|
43862
|
+
] }),
|
|
43863
|
+
isMobileView && showAddToCart && /* @__PURE__ */ jsxRuntimeExports.jsx("div", { style: { position: "absolute", bottom: "0", width: "100%" }, children: /* @__PURE__ */ jsxRuntimeExports.jsx(AddToCartBtn, {}) })
|
|
43864
|
+
]
|
|
43865
|
+
}
|
|
43866
|
+
)
|
|
43867
|
+
] });
|
|
43868
|
+
}
|
|
43556
43869
|
function App({ apiService: apiService2, sku, events: events2, viewerOnly = false }) {
|
|
43557
43870
|
const configurator = reactExports.useRef();
|
|
43558
43871
|
const [settings, setSettings] = reactExports.useState(null);
|
|
43872
|
+
const orgName = (settings == null ? void 0 : settings.orgName) || "";
|
|
43559
43873
|
const frameList = (settings == null ? void 0 : settings.frameList) || null;
|
|
43560
43874
|
const lensList = (settings == null ? void 0 : settings.lensList) || null;
|
|
43561
|
-
const
|
|
43875
|
+
const orbitalList = (settings == null ? void 0 : settings.orbitalList) || null;
|
|
43562
43876
|
reactExports.useEffect(() => {
|
|
43563
43877
|
(async () => {
|
|
43564
43878
|
var _a2;
|
|
@@ -43568,11 +43882,24 @@ bool bvhIntersectFirstHit(
|
|
|
43568
43882
|
sku,
|
|
43569
43883
|
barcode: null
|
|
43570
43884
|
});
|
|
43571
|
-
const lensApiRes = await apiService2.FetchCustomisationList();
|
|
43885
|
+
const lensApiRes = await apiService2.FetchCustomisationList("Lens");
|
|
43886
|
+
const orbitalApiRes = await apiService2.FetchCustomisationList("Orbital");
|
|
43887
|
+
const domInstance = await configurator.current.renderAsset({
|
|
43888
|
+
containerId: "holder-canvas",
|
|
43889
|
+
data: {
|
|
43890
|
+
assetDetails: apiRes,
|
|
43891
|
+
customisation: apiRes == null ? void 0 : apiRes.customisation
|
|
43892
|
+
}
|
|
43893
|
+
});
|
|
43572
43894
|
setSettings({
|
|
43573
43895
|
frameList: apiRes == null ? void 0 : apiRes.variants,
|
|
43574
43896
|
lensList: lensApiRes == null ? void 0 : lensApiRes.data,
|
|
43575
|
-
|
|
43897
|
+
orbitalList: orbitalApiRes == null ? void 0 : orbitalApiRes.data,
|
|
43898
|
+
orgName: apiRes == null ? void 0 : apiRes.group.name,
|
|
43899
|
+
showOrbitals: (apiRes == null ? void 0 : apiRes.customisation).filter(
|
|
43900
|
+
(e) => e.type === "Orbital"
|
|
43901
|
+
).length > 0,
|
|
43902
|
+
domService: domInstance
|
|
43576
43903
|
});
|
|
43577
43904
|
})();
|
|
43578
43905
|
return () => {
|
|
@@ -43589,8 +43916,11 @@ bool bvhIntersectFirstHit(
|
|
|
43589
43916
|
apiService: apiService2,
|
|
43590
43917
|
frameList,
|
|
43591
43918
|
lensList,
|
|
43919
|
+
orbitalList,
|
|
43920
|
+
showOrbitalList: (settings == null ? void 0 : settings.showOrbitals) || false,
|
|
43592
43921
|
viewerOnly,
|
|
43593
|
-
ThreeDConfigurator: configurator.current
|
|
43922
|
+
ThreeDConfigurator: configurator.current,
|
|
43923
|
+
domService: settings == null ? void 0 : settings.domService
|
|
43594
43924
|
}
|
|
43595
43925
|
)
|
|
43596
43926
|
] });
|
|
@@ -51191,9 +51521,9 @@ bool bvhIntersectFirstHit(
|
|
|
51191
51521
|
copy[i] = arr[i];
|
|
51192
51522
|
return copy;
|
|
51193
51523
|
}
|
|
51194
|
-
function spliceOne(list,
|
|
51195
|
-
for (;
|
|
51196
|
-
list[
|
|
51524
|
+
function spliceOne(list, index2) {
|
|
51525
|
+
for (; index2 + 1 < list.length; index2++)
|
|
51526
|
+
list[index2] = list[index2 + 1];
|
|
51197
51527
|
list.pop();
|
|
51198
51528
|
}
|
|
51199
51529
|
function unwrapListeners(arr) {
|