New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@r2u/viewer

Package Overview
Dependencies
Maintainers
2
Versions
57
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@r2u/viewer - npm Package Compare versions

Comparing version 1.0.1 to 1.0.2

2

dist/index.js
/*! For license information please see index.js.LICENSE.txt */
!function(e,t){if("object"==typeof exports&&"object"==typeof module)module.exports=t(require("react"));else if("function"==typeof define&&define.amd)define(["react"],t);else{var r="object"==typeof exports?t(require("react")):t(e.react);for(var n in r)("object"==typeof exports?exports:e)[n]=r[n]}}(self,(e=>(()=>{var t,r,n={58:(e,t,r)=>{"use strict";var n=r(594),o={childContextTypes:!0,contextType:!0,contextTypes:!0,defaultProps:!0,displayName:!0,getDefaultProps:!0,getDerivedStateFromError:!0,getDerivedStateFromProps:!0,mixins:!0,propTypes:!0,type:!0},a={name:!0,length:!0,prototype:!0,caller:!0,callee:!0,arguments:!0,arity:!0},i={$$typeof:!0,compare:!0,defaultProps:!0,displayName:!0,propTypes:!0,type:!0},s={};function c(e){return n.isMemo(e)?i:s[e.$$typeof]||o}s[n.ForwardRef]={$$typeof:!0,render:!0,defaultProps:!0,displayName:!0,propTypes:!0},s[n.Memo]=i;var l=Object.defineProperty,u=Object.getOwnPropertyNames,d=Object.getOwnPropertySymbols,f=Object.getOwnPropertyDescriptor,g=Object.getPrototypeOf,p=Object.prototype;e.exports=function e(t,r,n){if("string"!=typeof r){if(p){var o=g(r);o&&o!==p&&e(t,o,n)}var i=u(r);d&&(i=i.concat(d(r)));for(var s=c(t),h=c(r),m=0;m<i.length;++m){var M=i[m];if(!(a[M]||n&&n[M]||h&&h[M]||s&&s[M])){var y=f(r,M);try{l(t,M,y)}catch(e){}}}}return t}},516:e=>{"use strict";var t=Object.getOwnPropertySymbols,r=Object.prototype.hasOwnProperty,n=Object.prototype.propertyIsEnumerable;function o(e){if(null==e)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(e)}e.exports=function(){try{if(!Object.assign)return!1;var e=new String("abc");if(e[5]="de","5"===Object.getOwnPropertyNames(e)[0])return!1;for(var t={},r=0;r<10;r++)t["_"+String.fromCharCode(r)]=r;if("0123456789"!==Object.getOwnPropertyNames(t).map((function(e){return t[e]})).join(""))return!1;var n={};return"abcdefghijklmnopqrst".split("").forEach((function(e){n[e]=e})),"abcdefghijklmnopqrst"===Object.keys(Object.assign({},n)).join("")}catch(e){return!1}}()?Object.assign:function(e,a){for(var i,s,c=o(e),l=1;l<arguments.length;l++){for(var u in i=Object(arguments[l]))r.call(i,u)&&(c[u]=i[u]);if(t){s=t(i);for(var d=0;d<s.length;d++)n.call(i,s[d])&&(c[s[d]]=i[s[d]])}}return c}},697:(e,t)=>{"use strict";var r="function"==typeof Symbol&&Symbol.for,n=r?Symbol.for("react.element"):60103,o=r?Symbol.for("react.portal"):60106,a=r?Symbol.for("react.fragment"):60107,i=r?Symbol.for("react.strict_mode"):60108,s=r?Symbol.for("react.profiler"):60114,c=r?Symbol.for("react.provider"):60109,l=r?Symbol.for("react.context"):60110,u=r?Symbol.for("react.async_mode"):60111,d=r?Symbol.for("react.concurrent_mode"):60111,f=r?Symbol.for("react.forward_ref"):60112,g=r?Symbol.for("react.suspense"):60113,p=r?Symbol.for("react.suspense_list"):60120,h=r?Symbol.for("react.memo"):60115,m=r?Symbol.for("react.lazy"):60116,M=r?Symbol.for("react.block"):60121,y=r?Symbol.for("react.fundamental"):60117,b=r?Symbol.for("react.responder"):60118,v=r?Symbol.for("react.scope"):60119;function I(e){if("object"==typeof e&&null!==e){var t=e.$$typeof;switch(t){case n:switch(e=e.type){case u:case d:case a:case s:case i:case g:return e;default:switch(e=e&&e.$$typeof){case l:case f:case m:case h:case c:return e;default:return t}}case o:return t}}}function j(e){return I(e)===d}t.AsyncMode=u,t.ConcurrentMode=d,t.ContextConsumer=l,t.ContextProvider=c,t.Element=n,t.ForwardRef=f,t.Fragment=a,t.Lazy=m,t.Memo=h,t.Portal=o,t.Profiler=s,t.StrictMode=i,t.Suspense=g,t.isAsyncMode=function(e){return j(e)||I(e)===u},t.isConcurrentMode=j,t.isContextConsumer=function(e){return I(e)===l},t.isContextProvider=function(e){return I(e)===c},t.isElement=function(e){return"object"==typeof e&&null!==e&&e.$$typeof===n},t.isForwardRef=function(e){return I(e)===f},t.isFragment=function(e){return I(e)===a},t.isLazy=function(e){return I(e)===m},t.isMemo=function(e){return I(e)===h},t.isPortal=function(e){return I(e)===o},t.isProfiler=function(e){return I(e)===s},t.isStrictMode=function(e){return I(e)===i},t.isSuspense=function(e){return I(e)===g},t.isValidElementType=function(e){return"string"==typeof e||"function"==typeof e||e===a||e===d||e===s||e===i||e===g||e===p||"object"==typeof e&&null!==e&&(e.$$typeof===m||e.$$typeof===h||e.$$typeof===c||e.$$typeof===l||e.$$typeof===f||e.$$typeof===y||e.$$typeof===b||e.$$typeof===v||e.$$typeof===M)},t.typeOf=I},594:(e,t,r)=>{"use strict";e.exports=r(697)},94:(e,t,r)=>{"use strict";r(516);var n=r(156),o=60103;if("function"==typeof Symbol&&Symbol.for){var a=Symbol.for;o=a("react.element"),a("react.fragment")}var i=n.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,s=Object.prototype.hasOwnProperty,c={key:!0,ref:!0,__self:!0,__source:!0};function l(e,t,r){var n,a={},l=null,u=null;for(n in void 0!==r&&(l=""+r),void 0!==t.key&&(l=""+t.key),void 0!==t.ref&&(u=t.ref),t)s.call(t,n)&&!c.hasOwnProperty(n)&&(a[n]=t[n]);if(e&&e.defaultProps)for(n in t=e.defaultProps)void 0===a[n]&&(a[n]=t[n]);return{$$typeof:o,type:e,key:l,ref:u,props:a,_owner:i.current}}t.jsx=l,t.jsxs=l},512:(e,t,r)=>{"use strict";e.exports=r(94)},7:e=>{e.exports=function(e,t,r,n){var o=r?r.call(n,e,t):void 0;if(void 0!==o)return!!o;if(e===t)return!0;if("object"!=typeof e||!e||"object"!=typeof t||!t)return!1;var a=Object.keys(e),i=Object.keys(t);if(a.length!==i.length)return!1;for(var s=Object.prototype.hasOwnProperty.bind(t),c=0;c<a.length;c++){var l=a[c];if(!s(l))return!1;var u=e[l],d=t[l];if(!1===(o=r?r.call(n,u,d,l):void 0)||void 0===o&&u!==d)return!1}return!0}},156:t=>{"use strict";t.exports=e}},o={};function a(e){var t=o[e];if(void 0!==t)return t.exports;var r=o[e]={exports:{}};return n[e](r,r.exports,a),r.exports}a.m=n,a.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return a.d(t,{a:t}),t},a.d=(e,t)=>{for(var r in t)a.o(t,r)&&!a.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},a.f={},a.e=e=>Promise.all(Object.keys(a.f).reduce(((t,r)=>(a.f[r](e,t),t)),[])),a.u=e=>({216:"vendors",628:"threeExperience"}[e]+".bundle.js"),a.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),t={},r="@r2u/viewer:",a.l=(e,n,o,i)=>{if(t[e])t[e].push(n);else{var s,c;if(void 0!==o)for(var l=document.getElementsByTagName("script"),u=0;u<l.length;u++){var d=l[u];if(d.getAttribute("src")==e||d.getAttribute("data-webpack")==r+o){s=d;break}}s||(c=!0,(s=document.createElement("script")).charset="utf-8",s.timeout=120,a.nc&&s.setAttribute("nonce",a.nc),s.setAttribute("data-webpack",r+o),s.src=e),t[e]=[n];var f=(r,n)=>{s.onerror=s.onload=null,clearTimeout(g);var o=t[e];if(delete t[e],s.parentNode&&s.parentNode.removeChild(s),o&&o.forEach((e=>e(n))),r)return r(n)},g=setTimeout(f.bind(null,void 0,{type:"timeout",target:s}),12e4);s.onerror=f.bind(null,s.onerror),s.onload=f.bind(null,s.onload),c&&document.head.appendChild(s)}},a.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},a.p="https://unpkg.com/@r2u/viewer@1.0.1/dist/",(()=>{var e={179:0};a.f.j=(t,r)=>{var n=a.o(e,t)?e[t]:void 0;if(0!==n)if(n)r.push(n[2]);else{var o=new Promise(((r,o)=>n=e[t]=[r,o]));r.push(n[2]=o);var i=a.p+a.u(t),s=new Error;a.l(i,(r=>{if(a.o(e,t)&&(0!==(n=e[t])&&(e[t]=void 0),n)){var o=r&&("load"===r.type?"missing":r.type),i=r&&r.target&&r.target.src;s.message="Loading chunk "+t+" failed.\n("+o+": "+i+")",s.name="ChunkLoadError",s.type=o,s.request=i,n[1](s)}}),"chunk-"+t,t)}};var t=(t,r)=>{var n,o,[i,s,c]=r,l=0;if(i.some((t=>0!==e[t]))){for(n in s)a.o(s,n)&&(a.m[n]=s[n]);c&&c(a)}for(t&&t(r);l<i.length;l++)o=i[l],a.o(e,o)&&e[o]&&e[o][0](),e[o]=0},r=self.webpackChunk_r2u_viewer=self.webpackChunk_r2u_viewer||[];r.forEach(t.bind(null,0)),r.push=t.bind(null,r.push.bind(r))})();var i={};return(()=>{"use strict";a.r(i),a.d(i,{default:()=>We});var e=a(512),t=a(156),r=a.n(t);const n="data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNzAiIGhlaWdodD0iNjkiIHZpZXdCb3g9IjAgMCA3MCA2OSIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KPGcgY2xpcC1wYXRoPSJ1cmwoI2NsaXAwXzE4Ml85NDcpIj4KPGcgZmlsdGVyPSJ1cmwoI2ZpbHRlcjBfZF8xODJfOTQ3KSI+CjxwYXRoIGQ9Ik01NC4wNDU5IDQwLjgzNjNMNDEuMTQyNSAzNC42MzJDNDAuNjU5NCAzNC40Mzk4IDQwLjE0NzggMzQuMzMgMzkuNjA3OCAzNC4zM0MzOC40MTQ4IDM0LjMzIDM3LjQ0NzcgMzMuMzYyOSAzNy40NDc3IDMyLjE3VjE3Ljg1ODNDMzcuNDQ3NyAxNS41Nzk3IDM1LjU0MzUgMTMuNzQwNCAzMy4xODQ1IDEzLjc0MDRDMzAuODI1NSAxMy43NDA0IDI4LjkyMTMgMTUuNTc5NyAyOC45MjEzIDE3Ljg1ODNWMzcuNTU3OEMyOC45MjEzIDQyLjYxNDggMjQuMjg3OCA0Ni40MDMxIDE5LjMzMTYgNDUuMzk4MkwxOS4xNzI3IDQ1LjM2NkMxOC45NDUzIDQ1LjMzODYgMTguNzQ2NCA0NS4yODM3IDE4LjQ5MDYgNDUuMjgzN0MxNy42MDk1IDQ1LjI4MzcgMTYuODEzNyA0NS42NDA2IDE2LjI0NTMgNDYuMTg5NkMxNS4wMTU3IDQ3LjM5MjMgMTUuMDIxOSA0OS4zNzI5IDE2LjI1OTEgNTAuNTY3OUwyOC4wNDAyIDYxLjk0NzVDMjguODA3NiA2Mi42ODg4IDI5Ljg4NzYgNjMuMTU1NSAzMS4wNTI5IDYzLjE1NTVINTAuMzUxMUM1Mi40ODI3IDYzLjE1NTUgNTQuMTMxMiA2MS42NDU2IDU0LjQ0MzggNTkuNjQxNUw1Ni41NzU0IDQ1LjE3MzlDNTYuNjAzOCA0NC45ODE3IDU2LjYzMjMgNDQuNzg5NSA1Ni42MzIzIDQ0LjYyNDhDNTYuNjMyMyA0Mi45MjI3IDU1LjU1MjIgNDEuNDQwMyA1NC4wNDU5IDQwLjgzNjNaIiBmaWxsPSJ3aGl0ZSIvPgo8cGF0aCBkPSJNMjAuNzYxOCAxOS44MjYzQzIxLjM5MTUgMjQuMTk1NCAyNi4xMDUyIDIyLjQxMjYgMjYuMTA1MiAxNy45OTgyQzI2LjEwNTIgMTQuMTY2OCAyOS4xNzA1IDExLjA1NzMgMzIuOTQ3NSAxMS4wNTczQzM2LjcyNDQgMTEuMDU3MyAzOS43ODk3IDE0LjE2NjggMzkuNzg5NyAxNy45OTgyQzM5Ljc4OTcgMjIuNDEyNiA0NC41MDM0IDI0LjE5NTQgNDUuMTMzMSAxOS44MjYzQzQ1LjIxOTEgMTkuMjI5OCA0NS4yNjM2IDE4LjYxOTQgNDUuMjYzNiAxNy45OTgyQzQ1LjI2MzYgMTEuMDg1IDM5Ljc2MjQgNS41MDQ1MiAzMi45NDc1IDUuNTA0NTJDMjYuMTMyNSA1LjUwNDUyIDIwLjYzMTMgMTEuMDg1IDIwLjYzMTMgMTcuOTk4MkMyMC42MzEzIDE4LjYxOTQgMjAuNjc1OCAxOS4yMjk4IDIwLjc2MTggMTkuODI2M1oiIGZpbGw9IiNEREREREQiLz4KPC9nPgo8L2c+CjxkZWZzPgo8ZmlsdGVyIGlkPSJmaWx0ZXIwX2RfMTgyXzk0NyIgeD0iMTIuMzI3MSIgeT0iMi41MDQ1MiIgd2lkdGg9IjUxLjMwNTIiIGhlaWdodD0iNjcuNjUxIiBmaWx0ZXJVbml0cz0idXNlclNwYWNlT25Vc2UiIGNvbG9yLWludGVycG9sYXRpb24tZmlsdGVycz0ic1JHQiI+CjxmZUZsb29kIGZsb29kLW9wYWNpdHk9IjAiIHJlc3VsdD0iQmFja2dyb3VuZEltYWdlRml4Ii8+CjxmZUNvbG9yTWF0cml4IGluPSJTb3VyY2VBbHBoYSIgdHlwZT0ibWF0cml4IiB2YWx1ZXM9IjAgMCAwIDAgMCAwIDAgMCAwIDAgMCAwIDAgMCAwIDAgMCAwIDEyNyAwIiByZXN1bHQ9ImhhcmRBbHBoYSIvPgo8ZmVPZmZzZXQgZHg9IjIiIGR5PSIyIi8+CjxmZUdhdXNzaWFuQmx1ciBzdGREZXZpYXRpb249IjIuNSIvPgo8ZmVDb2xvck1hdHJpeCB0eXBlPSJtYXRyaXgiIHZhbHVlcz0iMCAwIDAgMCAwIDAgMCAwIDAgMCAwIDAgMCAwIDAgMCAwIDAgMC4yNSAwIi8+CjxmZUJsZW5kIG1vZGU9Im5vcm1hbCIgaW4yPSJCYWNrZ3JvdW5kSW1hZ2VGaXgiIHJlc3VsdD0iZWZmZWN0MV9kcm9wU2hhZG93XzE4Ml85NDciLz4KPGZlQmxlbmQgbW9kZT0ibm9ybWFsIiBpbj0iU291cmNlR3JhcGhpYyIgaW4yPSJlZmZlY3QxX2Ryb3BTaGFkb3dfMTgyXzk0NyIgcmVzdWx0PSJzaGFwZSIvPgo8L2ZpbHRlcj4KPGNsaXBQYXRoIGlkPSJjbGlwMF8xODJfOTQ3Ij4KPHJlY3Qgd2lkdGg9IjcwIiBoZWlnaHQ9IjY4LjgwNjgiIGZpbGw9IndoaXRlIi8+CjwvY2xpcFBhdGg+CjwvZGVmcz4KPC9zdmc+Cg==";const o=(0,t.createContext)({}),s=r().forwardRef((({glbSrc:r,exposure:n,hdri:a,minZoom:i,maxZoom:s,initialZoom:c,backgroundColor:l,backgroundImage:u,sceneBackground:d,activeShadow:f,activeBakedShadow:g,shadowOffsetX:p,shadowOffsetY:h,shadowOffsetZ:m,shadowOpacity:M,shadowRadius:y,cameraOrbitSensitivity:b,minAzimuthalAngleRotation:v,maxAzimuthalAngleRotation:I,minPolarAngleRotation:j,maxPolarAngleRotation:N,maxDragX:A,minDragX:w,maxDragY:D,minDragY:x,maxDragZ:S,minDragZ:k,activeFog:C,fogColor:z,fogNear:O,fogFar:T,cameraNear:E,cameraFar:L,bloom:Y,initialBloom:R,enableBloomButton:P,bloomIntensity:Z,bloomRadius:U,bloomThreshold:B,initialAnimation:Q,children:_},G)=>{const[F,$]=(0,t.useState)(),[W,X]=(0,t.useState)(Y?R?"bloomOn":"bloomOff":"noBloom");return(0,t.useImperativeHandle)(G,(()=>({insertModelNode:e=>{F&&F.insertModelNode(e)},deleteModelNode:e=>{F&&F.deleteModelNode(e)},updateBloom:e=>{X(e?"bloomOn":"bloomOff")},getAllSlotsMaterials:()=>F?F.getAllSlotsMaterials():null,setMaterial:(...e)=>{F&&F.setMaterial(...e)},getAllSlotsModels:()=>F?F.getAllSlotsModels():null,setModel:(...e)=>{F&&F.setModel(...e)},getCamera:()=>F?F.camera.controls.getCamera():null,setCamera:e=>{F&&F.camera.controls.setCamera(e)},updateShadow:e=>{var t;F&&(null===(t=F.world.environment)||void 0===t||t.updateShadow(e))},updateFog:e=>{var t;F&&(null===(t=F.world.environment)||void 0===t||t.updateFog(e))},updateBloomProps:e=>{var t;F&&(null===(t=F.world.environment)||void 0===t||t.updateBloom(e))},updateEnvironment:e=>{F&&F.updateEnvironment(e)},getCustomizedModel:()=>function(e,t,r,n){return new(r||(r=Promise))((function(o,a){function i(e){try{c(n.next(e))}catch(e){a(e)}}function s(e){try{c(n.throw(e))}catch(e){a(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(i,s)}c((n=n.apply(e,t||[])).next())}))}(void 0,void 0,void 0,(function*(){return F?F.getCustomizedModel():null})),getCurrentCustomization:()=>F?F.getCurrentCustomization():null}))),(0,e.jsx)(o.Provider,Object.assign({value:{glbSrc:r,exposure:n,hdri:"neutral"===a?"https://sdk.r2u.io/hdri/neutral.hdr":a,minZoom:i,maxZoom:s,initialZoom:c,backgroundColor:l,backgroundImage:u,sceneBackground:d,activeShadow:f,activeBakedShadow:g,shadowOffsetX:p,shadowOffsetY:h,shadowOffsetZ:m,shadowOpacity:M,shadowRadius:y,cameraOrbitSensitivity:b,minAzimuthalAngleRotation:v,maxAzimuthalAngleRotation:I,minPolarAngleRotation:j,maxPolarAngleRotation:N,maxDragX:A,minDragX:w,maxDragY:D,minDragY:x,maxDragZ:S,minDragZ:k,activeFog:C,fogColor:z,fogNear:O,fogFar:T,cameraNear:E,cameraFar:L,experience:F,setExperience:$,bloom:Y,initialBloom:R,enableBloomButton:P,bloomIntensity:Z,bloomRadius:U,bloomThreshold:B,initialAnimation:Q,hasBloom:W,setHasBloom:X}},{children:_}),void 0)})),c=()=>(0,t.useContext)(o);var l=a(594),u=a(7),d=a.n(u);const f=function(e){function t(e,n,c,l,f){for(var g,p,h,m,v,j=0,N=0,A=0,w=0,D=0,O=0,E=h=g=0,Y=0,R=0,P=0,Z=0,U=c.length,B=U-1,Q="",_="",G="",F="";Y<U;){if(p=c.charCodeAt(Y),Y===B&&0!==N+w+A+j&&(0!==N&&(p=47===N?10:47),w=A=j=0,U++,B++),0===N+w+A+j){if(Y===B&&(0<R&&(Q=Q.replace(d,"")),0<Q.trim().length)){switch(p){case 32:case 9:case 59:case 13:case 10:break;default:Q+=c.charAt(Y)}p=59}switch(p){case 123:for(g=(Q=Q.trim()).charCodeAt(0),h=1,Z=++Y;Y<U;){switch(p=c.charCodeAt(Y)){case 123:h++;break;case 125:h--;break;case 47:switch(p=c.charCodeAt(Y+1)){case 42:case 47:e:{for(E=Y+1;E<B;++E)switch(c.charCodeAt(E)){case 47:if(42===p&&42===c.charCodeAt(E-1)&&Y+2!==E){Y=E+1;break e}break;case 10:if(47===p){Y=E+1;break e}}Y=E}}break;case 91:p++;case 40:p++;case 34:case 39:for(;Y++<B&&c.charCodeAt(Y)!==p;);}if(0===h)break;Y++}if(h=c.substring(Z,Y),0===g&&(g=(Q=Q.replace(u,"").trim()).charCodeAt(0)),64===g){switch(0<R&&(Q=Q.replace(d,"")),p=Q.charCodeAt(1)){case 100:case 109:case 115:case 45:R=n;break;default:R=z}if(Z=(h=t(n,R,h,p,f+1)).length,0<T&&(v=s(3,h,R=r(z,Q,P),n,S,x,Z,p,f,l),Q=R.join(""),void 0!==v&&0===(Z=(h=v.trim()).length)&&(p=0,h="")),0<Z)switch(p){case 115:Q=Q.replace(I,i);case 100:case 109:case 45:h=Q+"{"+h+"}";break;case 107:h=(Q=Q.replace(M,"$1 $2"))+"{"+h+"}",h=1===C||2===C&&a("@"+h,3)?"@-webkit-"+h+"@"+h:"@"+h;break;default:h=Q+h,112===l&&(_+=h,h="")}else h=""}else h=t(n,r(n,Q,P),h,l,f+1);G+=h,h=P=R=E=g=0,Q="",p=c.charCodeAt(++Y);break;case 125:case 59:if(1<(Z=(Q=(0<R?Q.replace(d,""):Q).trim()).length))switch(0===E&&(g=Q.charCodeAt(0),45===g||96<g&&123>g)&&(Z=(Q=Q.replace(" ",":")).length),0<T&&void 0!==(v=s(1,Q,n,e,S,x,_.length,l,f,l))&&0===(Z=(Q=v.trim()).length)&&(Q="\0\0"),g=Q.charCodeAt(0),p=Q.charCodeAt(1),g){case 0:break;case 64:if(105===p||99===p){F+=Q+c.charAt(Y);break}default:58!==Q.charCodeAt(Z-1)&&(_+=o(Q,g,p,Q.charCodeAt(2)))}P=R=E=g=0,Q="",p=c.charCodeAt(++Y)}}switch(p){case 13:case 10:47===N?N=0:0===1+g&&107!==l&&0<Q.length&&(R=1,Q+="\0"),0<T*L&&s(0,Q,n,e,S,x,_.length,l,f,l),x=1,S++;break;case 59:case 125:if(0===N+w+A+j){x++;break}default:switch(x++,m=c.charAt(Y),p){case 9:case 32:if(0===w+j+N)switch(D){case 44:case 58:case 9:case 32:m="";break;default:32!==p&&(m=" ")}break;case 0:m="\\0";break;case 12:m="\\f";break;case 11:m="\\v";break;case 38:0===w+N+j&&(R=P=1,m="\f"+m);break;case 108:if(0===w+N+j+k&&0<E)switch(Y-E){case 2:112===D&&58===c.charCodeAt(Y-3)&&(k=D);case 8:111===O&&(k=O)}break;case 58:0===w+N+j&&(E=Y);break;case 44:0===N+A+w+j&&(R=1,m+="\r");break;case 34:case 39:0===N&&(w=w===p?0:0===w?p:w);break;case 91:0===w+N+A&&j++;break;case 93:0===w+N+A&&j--;break;case 41:0===w+N+j&&A--;break;case 40:0===w+N+j&&(0===g&&(2*D+3*O==533||(g=1)),A++);break;case 64:0===N+A+w+j+E+h&&(h=1);break;case 42:case 47:if(!(0<w+j+A))switch(N){case 0:switch(2*p+3*c.charCodeAt(Y+1)){case 235:N=47;break;case 220:Z=Y,N=42}break;case 42:47===p&&42===D&&Z+2!==Y&&(33===c.charCodeAt(Z+2)&&(_+=c.substring(Z,Y+1)),m="",N=0)}}0===N&&(Q+=m)}O=D,D=p,Y++}if(0<(Z=_.length)){if(R=n,0<T&&void 0!==(v=s(2,_,R,e,S,x,Z,l,f,l))&&0===(_=v).length)return F+_+G;if(_=R.join(",")+"{"+_+"}",0!=C*k){switch(2!==C||a(_,2)||(k=0),k){case 111:_=_.replace(b,":-moz-$1")+_;break;case 112:_=_.replace(y,"::-webkit-input-$1")+_.replace(y,"::-moz-$1")+_.replace(y,":-ms-input-$1")+_}k=0}}return F+_+G}function r(e,t,r){var o=t.trim().split(h);t=o;var a=o.length,i=e.length;switch(i){case 0:case 1:var s=0;for(e=0===i?"":e[0]+" ";s<a;++s)t[s]=n(e,t[s],r).trim();break;default:var c=s=0;for(t=[];s<a;++s)for(var l=0;l<i;++l)t[c++]=n(e[l]+" ",o[s],r).trim()}return t}function n(e,t,r){var n=t.charCodeAt(0);switch(33>n&&(n=(t=t.trim()).charCodeAt(0)),n){case 38:return t.replace(m,"$1"+e.trim());case 58:return e.trim()+t.replace(m,"$1"+e.trim());default:if(0<1*r&&0<t.indexOf("\f"))return t.replace(m,(58===e.charCodeAt(0)?"":"$1")+e.trim())}return e+t}function o(e,t,r,n){var i=e+";",s=2*t+3*r+4*n;if(944===s){e=i.indexOf(":",9)+1;var c=i.substring(e,i.length-1).trim();return c=i.substring(0,e).trim()+c+";",1===C||2===C&&a(c,1)?"-webkit-"+c+c:c}if(0===C||2===C&&!a(i,1))return i;switch(s){case 1015:return 97===i.charCodeAt(10)?"-webkit-"+i+i:i;case 951:return 116===i.charCodeAt(3)?"-webkit-"+i+i:i;case 963:return 110===i.charCodeAt(5)?"-webkit-"+i+i:i;case 1009:if(100!==i.charCodeAt(4))break;case 969:case 942:return"-webkit-"+i+i;case 978:return"-webkit-"+i+"-moz-"+i+i;case 1019:case 983:return"-webkit-"+i+"-moz-"+i+"-ms-"+i+i;case 883:if(45===i.charCodeAt(8))return"-webkit-"+i+i;if(0<i.indexOf("image-set(",11))return i.replace(D,"$1-webkit-$2")+i;break;case 932:if(45===i.charCodeAt(4))switch(i.charCodeAt(5)){case 103:return"-webkit-box-"+i.replace("-grow","")+"-webkit-"+i+"-ms-"+i.replace("grow","positive")+i;case 115:return"-webkit-"+i+"-ms-"+i.replace("shrink","negative")+i;case 98:return"-webkit-"+i+"-ms-"+i.replace("basis","preferred-size")+i}return"-webkit-"+i+"-ms-"+i+i;case 964:return"-webkit-"+i+"-ms-flex-"+i+i;case 1023:if(99!==i.charCodeAt(8))break;return"-webkit-box-pack"+(c=i.substring(i.indexOf(":",15)).replace("flex-","").replace("space-between","justify"))+"-webkit-"+i+"-ms-flex-pack"+c+i;case 1005:return g.test(i)?i.replace(f,":-webkit-")+i.replace(f,":-moz-")+i:i;case 1e3:switch(t=(c=i.substring(13).trim()).indexOf("-")+1,c.charCodeAt(0)+c.charCodeAt(t)){case 226:c=i.replace(v,"tb");break;case 232:c=i.replace(v,"tb-rl");break;case 220:c=i.replace(v,"lr");break;default:return i}return"-webkit-"+i+"-ms-"+c+i;case 1017:if(-1===i.indexOf("sticky",9))break;case 975:switch(t=(i=e).length-10,s=(c=(33===i.charCodeAt(t)?i.substring(0,t):i).substring(e.indexOf(":",7)+1).trim()).charCodeAt(0)+(0|c.charCodeAt(7))){case 203:if(111>c.charCodeAt(8))break;case 115:i=i.replace(c,"-webkit-"+c)+";"+i;break;case 207:case 102:i=i.replace(c,"-webkit-"+(102<s?"inline-":"")+"box")+";"+i.replace(c,"-webkit-"+c)+";"+i.replace(c,"-ms-"+c+"box")+";"+i}return i+";";case 938:if(45===i.charCodeAt(5))switch(i.charCodeAt(6)){case 105:return c=i.replace("-items",""),"-webkit-"+i+"-webkit-box-"+c+"-ms-flex-"+c+i;case 115:return"-webkit-"+i+"-ms-flex-item-"+i.replace(N,"")+i;default:return"-webkit-"+i+"-ms-flex-line-pack"+i.replace("align-content","").replace(N,"")+i}break;case 973:case 989:if(45!==i.charCodeAt(3)||122===i.charCodeAt(4))break;case 931:case 953:if(!0===w.test(e))return 115===(c=e.substring(e.indexOf(":")+1)).charCodeAt(0)?o(e.replace("stretch","fill-available"),t,r,n).replace(":fill-available",":stretch"):i.replace(c,"-webkit-"+c)+i.replace(c,"-moz-"+c.replace("fill-",""))+i;break;case 962:if(i="-webkit-"+i+(102===i.charCodeAt(5)?"-ms-"+i:"")+i,211===r+n&&105===i.charCodeAt(13)&&0<i.indexOf("transform",10))return i.substring(0,i.indexOf(";",27)+1).replace(p,"$1-webkit-$2")+i}return i}function a(e,t){var r=e.indexOf(1===t?":":"{"),n=e.substring(0,3!==t?r:10);return r=e.substring(r+1,e.length-1),E(2!==t?n:n.replace(A,"$1"),r,t)}function i(e,t){var r=o(t,t.charCodeAt(0),t.charCodeAt(1),t.charCodeAt(2));return r!==t+";"?r.replace(j," or ($1)").substring(4):"("+t+")"}function s(e,t,r,n,o,a,i,s,c,u){for(var d,f=0,g=t;f<T;++f)switch(d=O[f].call(l,e,g,r,n,o,a,i,s,c,u)){case void 0:case!1:case!0:case null:break;default:g=d}if(g!==t)return g}function c(e){return void 0!==(e=e.prefix)&&(E=null,e?"function"!=typeof e?C=1:(C=2,E=e):C=0),c}function l(e,r){var n=e;if(33>n.charCodeAt(0)&&(n=n.trim()),n=[n],0<T){var o=s(-1,r,n,n,S,x,0,0,0,0);void 0!==o&&"string"==typeof o&&(r=o)}var a=t(z,n,r,0,0);return 0<T&&void 0!==(o=s(-2,a,n,n,S,x,a.length,0,0,0))&&(a=o),k=0,x=S=1,a}var u=/^\0+/g,d=/[\0\r\f]/g,f=/: */g,g=/zoo|gra/,p=/([,: ])(transform)/g,h=/,\r+?/g,m=/([\t\r\n ])*\f?&/g,M=/@(k\w+)\s*(\S*)\s*/,y=/::(place)/g,b=/:(read-only)/g,v=/[svh]\w+-[tblr]{2}/,I=/\(\s*(.*)\s*\)/g,j=/([\s\S]*?);/g,N=/-self|flex-/g,A=/[^]*?(:[rp][el]a[\w-]+)[^]*/,w=/stretch|:\s*\w+\-(?:conte|avail)/,D=/([^-])(image-set\()/,x=1,S=1,k=0,C=1,z=[],O=[],T=0,E=null,L=0;return l.use=function e(t){switch(t){case void 0:case null:T=O.length=0;break;default:if("function"==typeof t)O[T++]=t;else if("object"==typeof t)for(var r=0,n=t.length;r<n;++r)e(t[r]);else L=0|!!t}return e},l.set=c,void 0!==e&&c(e),l},g={animationIterationCount:1,borderImageOutset:1,borderImageSlice:1,borderImageWidth:1,boxFlex:1,boxFlexGroup:1,boxOrdinalGroup:1,columnCount:1,columns:1,flex:1,flexGrow:1,flexPositive:1,flexShrink:1,flexNegative:1,flexOrder:1,gridRow:1,gridRowEnd:1,gridRowSpan:1,gridRowStart:1,gridColumn:1,gridColumnEnd:1,gridColumnSpan:1,gridColumnStart:1,msGridRow:1,msGridRowSpan:1,msGridColumn:1,msGridColumnSpan:1,fontWeight:1,lineHeight:1,opacity:1,order:1,orphans:1,tabSize:1,widows:1,zIndex:1,zoom:1,WebkitLineClamp:1,fillOpacity:1,floodOpacity:1,stopOpacity:1,strokeDasharray:1,strokeDashoffset:1,strokeMiterlimit:1,strokeOpacity:1,strokeWidth:1};var p=/^((children|dangerouslySetInnerHTML|key|ref|autoFocus|defaultValue|defaultChecked|innerHTML|suppressContentEditableWarning|suppressHydrationWarning|valueLink|accept|acceptCharset|accessKey|action|allow|allowUserMedia|allowPaymentRequest|allowFullScreen|allowTransparency|alt|async|autoComplete|autoPlay|capture|cellPadding|cellSpacing|challenge|charSet|checked|cite|classID|className|cols|colSpan|content|contentEditable|contextMenu|controls|controlsList|coords|crossOrigin|data|dateTime|decoding|default|defer|dir|disabled|disablePictureInPicture|download|draggable|encType|form|formAction|formEncType|formMethod|formNoValidate|formTarget|frameBorder|headers|height|hidden|high|href|hrefLang|htmlFor|httpEquiv|id|inputMode|integrity|is|keyParams|keyType|kind|label|lang|list|loading|loop|low|marginHeight|marginWidth|max|maxLength|media|mediaGroup|method|min|minLength|multiple|muted|name|nonce|noValidate|open|optimum|pattern|placeholder|playsInline|poster|preload|profile|radioGroup|readOnly|referrerPolicy|rel|required|reversed|role|rows|rowSpan|sandbox|scope|scoped|scrolling|seamless|selected|shape|size|sizes|slot|span|spellCheck|src|srcDoc|srcLang|srcSet|start|step|style|summary|tabIndex|target|title|type|useMap|value|width|wmode|wrap|about|datatype|inlist|prefix|property|resource|typeof|vocab|autoCapitalize|autoCorrect|autoSave|color|inert|itemProp|itemScope|itemType|itemID|itemRef|on|results|security|unselectable|accentHeight|accumulate|additive|alignmentBaseline|allowReorder|alphabetic|amplitude|arabicForm|ascent|attributeName|attributeType|autoReverse|azimuth|baseFrequency|baselineShift|baseProfile|bbox|begin|bias|by|calcMode|capHeight|clip|clipPathUnits|clipPath|clipRule|colorInterpolation|colorInterpolationFilters|colorProfile|colorRendering|contentScriptType|contentStyleType|cursor|cx|cy|d|decelerate|descent|diffuseConstant|direction|display|divisor|dominantBaseline|dur|dx|dy|edgeMode|elevation|enableBackground|end|exponent|externalResourcesRequired|fill|fillOpacity|fillRule|filter|filterRes|filterUnits|floodColor|floodOpacity|focusable|fontFamily|fontSize|fontSizeAdjust|fontStretch|fontStyle|fontVariant|fontWeight|format|from|fr|fx|fy|g1|g2|glyphName|glyphOrientationHorizontal|glyphOrientationVertical|glyphRef|gradientTransform|gradientUnits|hanging|horizAdvX|horizOriginX|ideographic|imageRendering|in|in2|intercept|k|k1|k2|k3|k4|kernelMatrix|kernelUnitLength|kerning|keyPoints|keySplines|keyTimes|lengthAdjust|letterSpacing|lightingColor|limitingConeAngle|local|markerEnd|markerMid|markerStart|markerHeight|markerUnits|markerWidth|mask|maskContentUnits|maskUnits|mathematical|mode|numOctaves|offset|opacity|operator|order|orient|orientation|origin|overflow|overlinePosition|overlineThickness|panose1|paintOrder|pathLength|patternContentUnits|patternTransform|patternUnits|pointerEvents|points|pointsAtX|pointsAtY|pointsAtZ|preserveAlpha|preserveAspectRatio|primitiveUnits|r|radius|refX|refY|renderingIntent|repeatCount|repeatDur|requiredExtensions|requiredFeatures|restart|result|rotate|rx|ry|scale|seed|shapeRendering|slope|spacing|specularConstant|specularExponent|speed|spreadMethod|startOffset|stdDeviation|stemh|stemv|stitchTiles|stopColor|stopOpacity|strikethroughPosition|strikethroughThickness|string|stroke|strokeDasharray|strokeDashoffset|strokeLinecap|strokeLinejoin|strokeMiterlimit|strokeOpacity|strokeWidth|surfaceScale|systemLanguage|tableValues|targetX|targetY|textAnchor|textDecoration|textRendering|textLength|to|transform|u1|u2|underlinePosition|underlineThickness|unicode|unicodeBidi|unicodeRange|unitsPerEm|vAlphabetic|vHanging|vIdeographic|vMathematical|values|vectorEffect|version|vertAdvY|vertOriginX|vertOriginY|viewBox|viewTarget|visibility|widths|wordSpacing|writingMode|x|xHeight|x1|x2|xChannelSelector|xlinkActuate|xlinkArcrole|xlinkHref|xlinkRole|xlinkShow|xlinkTitle|xlinkType|xmlBase|xmlns|xmlnsXlink|xmlLang|xmlSpace|y|y1|y2|yChannelSelector|z|zoomAndPan|for|class|autofocus)|(([Dd][Aa][Tt][Aa]|[Aa][Rr][Ii][Aa]|x)-.*))$/;const h=(m={},function(e){return void 0===m[e]&&(m[e]=(t=e,p.test(t)||111===t.charCodeAt(0)&&110===t.charCodeAt(1)&&t.charCodeAt(2)<91)),m[e];var t});var m,M=a(58),y=a.n(M);function b(){return(b=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e}).apply(this,arguments)}var v=function(e,t){for(var r=[e[0]],n=0,o=t.length;n<o;n+=1)r.push(t[n],e[n+1]);return r},I=function(e){return null!==e&&"object"==typeof e&&"[object Object]"===(e.toString?e.toString():Object.prototype.toString.call(e))&&!(0,l.typeOf)(e)},j=Object.freeze([]),N=Object.freeze({});function A(e){return"function"==typeof e}function w(e){return e.displayName||e.name||"Component"}function D(e){return e&&"string"==typeof e.styledComponentId}var x="undefined"!=typeof process&&(process.env.REACT_APP_SC_ATTR||process.env.SC_ATTR)||"data-styled",S="undefined"!=typeof window&&"HTMLElement"in window,k=Boolean("boolean"==typeof SC_DISABLE_SPEEDY?SC_DISABLE_SPEEDY:"undefined"!=typeof process&&void 0!==process.env.REACT_APP_SC_DISABLE_SPEEDY&&""!==process.env.REACT_APP_SC_DISABLE_SPEEDY?"false"!==process.env.REACT_APP_SC_DISABLE_SPEEDY&&process.env.REACT_APP_SC_DISABLE_SPEEDY:"undefined"!=typeof process&&void 0!==process.env.SC_DISABLE_SPEEDY&&""!==process.env.SC_DISABLE_SPEEDY&&"false"!==process.env.SC_DISABLE_SPEEDY&&process.env.SC_DISABLE_SPEEDY);function C(e){for(var t=arguments.length,r=new Array(t>1?t-1:0),n=1;n<t;n++)r[n-1]=arguments[n];throw new Error("An error occurred. See https://git.io/JUIaE#"+e+" for more information."+(r.length>0?" Args: "+r.join(", "):""))}var z=function(){function e(e){this.groupSizes=new Uint32Array(512),this.length=512,this.tag=e}var t=e.prototype;return t.indexOfGroup=function(e){for(var t=0,r=0;r<e;r++)t+=this.groupSizes[r];return t},t.insertRules=function(e,t){if(e>=this.groupSizes.length){for(var r=this.groupSizes,n=r.length,o=n;e>=o;)(o<<=1)<0&&C(16,""+e);this.groupSizes=new Uint32Array(o),this.groupSizes.set(r),this.length=o;for(var a=n;a<o;a++)this.groupSizes[a]=0}for(var i=this.indexOfGroup(e+1),s=0,c=t.length;s<c;s++)this.tag.insertRule(i,t[s])&&(this.groupSizes[e]++,i++)},t.clearGroup=function(e){if(e<this.length){var t=this.groupSizes[e],r=this.indexOfGroup(e),n=r+t;this.groupSizes[e]=0;for(var o=r;o<n;o++)this.tag.deleteRule(r)}},t.getGroup=function(e){var t="";if(e>=this.length||0===this.groupSizes[e])return t;for(var r=this.groupSizes[e],n=this.indexOfGroup(e),o=n+r,a=n;a<o;a++)t+=this.tag.getRule(a)+"/*!sc*/\n";return t},e}(),O=new Map,T=new Map,E=1,L=function(e){if(O.has(e))return O.get(e);for(;T.has(E);)E++;var t=E++;return O.set(e,t),T.set(t,e),t},Y=function(e){return T.get(e)},R=function(e,t){t>=E&&(E=t+1),O.set(e,t),T.set(t,e)},P="style["+x+'][data-styled-version="5.3.3"]',Z=new RegExp("^"+x+'\\.g(\\d+)\\[id="([\\w\\d-]+)"\\].*?"([^"]*)'),U=function(e,t,r){for(var n,o=r.split(","),a=0,i=o.length;a<i;a++)(n=o[a])&&e.registerName(t,n)},B=function(e,t){for(var r=(t.textContent||"").split("/*!sc*/\n"),n=[],o=0,a=r.length;o<a;o++){var i=r[o].trim();if(i){var s=i.match(Z);if(s){var c=0|parseInt(s[1],10),l=s[2];0!==c&&(R(l,c),U(e,l,s[3]),e.getTag().insertRules(c,n)),n.length=0}else n.push(i)}}},Q=function(){return"undefined"!=typeof window&&void 0!==window.__webpack_nonce__?window.__webpack_nonce__:null},_=function(e){var t=document.head,r=e||t,n=document.createElement("style"),o=function(e){for(var t=e.childNodes,r=t.length;r>=0;r--){var n=t[r];if(n&&1===n.nodeType&&n.hasAttribute(x))return n}}(r),a=void 0!==o?o.nextSibling:null;n.setAttribute(x,"active"),n.setAttribute("data-styled-version","5.3.3");var i=Q();return i&&n.setAttribute("nonce",i),r.insertBefore(n,a),n},G=function(){function e(e){var t=this.element=_(e);t.appendChild(document.createTextNode("")),this.sheet=function(e){if(e.sheet)return e.sheet;for(var t=document.styleSheets,r=0,n=t.length;r<n;r++){var o=t[r];if(o.ownerNode===e)return o}C(17)}(t),this.length=0}var t=e.prototype;return t.insertRule=function(e,t){try{return this.sheet.insertRule(t,e),this.length++,!0}catch(e){return!1}},t.deleteRule=function(e){this.sheet.deleteRule(e),this.length--},t.getRule=function(e){var t=this.sheet.cssRules[e];return void 0!==t&&"string"==typeof t.cssText?t.cssText:""},e}(),F=function(){function e(e){var t=this.element=_(e);this.nodes=t.childNodes,this.length=0}var t=e.prototype;return t.insertRule=function(e,t){if(e<=this.length&&e>=0){var r=document.createTextNode(t),n=this.nodes[e];return this.element.insertBefore(r,n||null),this.length++,!0}return!1},t.deleteRule=function(e){this.element.removeChild(this.nodes[e]),this.length--},t.getRule=function(e){return e<this.length?this.nodes[e].textContent:""},e}(),$=function(){function e(e){this.rules=[],this.length=0}var t=e.prototype;return t.insertRule=function(e,t){return e<=this.length&&(this.rules.splice(e,0,t),this.length++,!0)},t.deleteRule=function(e){this.rules.splice(e,1),this.length--},t.getRule=function(e){return e<this.length?this.rules[e]:""},e}(),W=S,X={isServer:!S,useCSSOMInjection:!k},H=function(){function e(e,t,r){void 0===e&&(e=N),void 0===t&&(t={}),this.options=b({},X,{},e),this.gs=t,this.names=new Map(r),this.server=!!e.isServer,!this.server&&S&&W&&(W=!1,function(e){for(var t=document.querySelectorAll(P),r=0,n=t.length;r<n;r++){var o=t[r];o&&"active"!==o.getAttribute(x)&&(B(e,o),o.parentNode&&o.parentNode.removeChild(o))}}(this))}e.registerId=function(e){return L(e)};var t=e.prototype;return t.reconstructWithOptions=function(t,r){return void 0===r&&(r=!0),new e(b({},this.options,{},t),this.gs,r&&this.names||void 0)},t.allocateGSInstance=function(e){return this.gs[e]=(this.gs[e]||0)+1},t.getTag=function(){return this.tag||(this.tag=(r=(t=this.options).isServer,n=t.useCSSOMInjection,o=t.target,e=r?new $(o):n?new G(o):new F(o),new z(e)));var e,t,r,n,o},t.hasNameForId=function(e,t){return this.names.has(e)&&this.names.get(e).has(t)},t.registerName=function(e,t){if(L(e),this.names.has(e))this.names.get(e).add(t);else{var r=new Set;r.add(t),this.names.set(e,r)}},t.insertRules=function(e,t,r){this.registerName(e,t),this.getTag().insertRules(L(e),r)},t.clearNames=function(e){this.names.has(e)&&this.names.get(e).clear()},t.clearRules=function(e){this.getTag().clearGroup(L(e)),this.clearNames(e)},t.clearTag=function(){this.tag=void 0},t.toString=function(){return function(e){for(var t=e.getTag(),r=t.length,n="",o=0;o<r;o++){var a=Y(o);if(void 0!==a){var i=e.names.get(a),s=t.getGroup(o);if(i&&s&&i.size){var c=x+".g"+o+'[id="'+a+'"]',l="";void 0!==i&&i.forEach((function(e){e.length>0&&(l+=e+",")})),n+=""+s+c+'{content:"'+l+'"}/*!sc*/\n'}}}return n}(this)},e}(),V=/(a)(d)/gi,J=function(e){return String.fromCharCode(e+(e>25?39:97))};function q(e){var t,r="";for(t=Math.abs(e);t>52;t=t/52|0)r=J(t%52)+r;return(J(t%52)+r).replace(V,"$1-$2")}var K=function(e,t){for(var r=t.length;r;)e=33*e^t.charCodeAt(--r);return e},ee=function(e){return K(5381,e)};function te(e){for(var t=0;t<e.length;t+=1){var r=e[t];if(A(r)&&!D(r))return!1}return!0}var re=ee("5.3.3"),ne=function(){function e(e,t,r){this.rules=e,this.staticRulesId="",this.isStatic=(void 0===r||r.isStatic)&&te(e),this.componentId=t,this.baseHash=K(re,t),this.baseStyle=r,H.registerId(t)}return e.prototype.generateAndInjectStyles=function(e,t,r){var n=this.componentId,o=[];if(this.baseStyle&&o.push(this.baseStyle.generateAndInjectStyles(e,t,r)),this.isStatic&&!r.hash)if(this.staticRulesId&&t.hasNameForId(n,this.staticRulesId))o.push(this.staticRulesId);else{var a=ve(this.rules,e,t,r).join(""),i=q(K(this.baseHash,a)>>>0);if(!t.hasNameForId(n,i)){var s=r(a,"."+i,void 0,n);t.insertRules(n,i,s)}o.push(i),this.staticRulesId=i}else{for(var c=this.rules.length,l=K(this.baseHash,r.hash),u="",d=0;d<c;d++){var f=this.rules[d];if("string"==typeof f)u+=f;else if(f){var g=ve(f,e,t,r),p=Array.isArray(g)?g.join(""):g;l=K(l,p+d),u+=p}}if(u){var h=q(l>>>0);if(!t.hasNameForId(n,h)){var m=r(u,"."+h,void 0,n);t.insertRules(n,h,m)}o.push(h)}}return o.join(" ")},e}(),oe=/^\s*\/\/.*$/gm,ae=[":","[",".","#"];function ie(e){var t,r,n,o,a=void 0===e?N:e,i=a.options,s=void 0===i?N:i,c=a.plugins,l=void 0===c?j:c,u=new f(s),d=[],g=function(e){function t(t){if(t)try{e(t+"}")}catch(e){}}return function(r,n,o,a,i,s,c,l,u,d){switch(r){case 1:if(0===u&&64===n.charCodeAt(0))return e(n+";"),"";break;case 2:if(0===l)return n+"/*|*/";break;case 3:switch(l){case 102:case 112:return e(o[0]+n),"";default:return n+(0===d?"/*|*/":"")}case-2:n.split("/*|*/}").forEach(t)}}}((function(e){d.push(e)})),p=function(e,n,a){return 0===n&&-1!==ae.indexOf(a[r.length])||a.match(o)?e:"."+t};function h(e,a,i,s){void 0===s&&(s="&");var c=e.replace(oe,""),l=a&&i?i+" "+a+" { "+c+" }":c;return t=s,r=a,n=new RegExp("\\"+r+"\\b","g"),o=new RegExp("(\\"+r+"\\b){2,}"),u(i||!a?"":a,l)}return u.use([].concat(l,[function(e,t,o){2===e&&o.length&&o[0].lastIndexOf(r)>0&&(o[0]=o[0].replace(n,p))},g,function(e){if(-2===e){var t=d;return d=[],t}}])),h.hash=l.length?l.reduce((function(e,t){return t.name||C(15),K(e,t.name)}),5381).toString():"",h}var se=r().createContext(),ce=(se.Consumer,r().createContext()),le=(ce.Consumer,new H),ue=ie();function de(){return(0,t.useContext)(se)||le}function fe(e){var n=(0,t.useState)(e.stylisPlugins),o=n[0],a=n[1],i=de(),s=(0,t.useMemo)((function(){var t=i;return e.sheet?t=e.sheet:e.target&&(t=t.reconstructWithOptions({target:e.target},!1)),e.disableCSSOMInjection&&(t=t.reconstructWithOptions({useCSSOMInjection:!1})),t}),[e.disableCSSOMInjection,e.sheet,e.target]),c=(0,t.useMemo)((function(){return ie({options:{prefix:!e.disableVendorPrefixes},plugins:o})}),[e.disableVendorPrefixes,o]);return(0,t.useEffect)((function(){d()(o,e.stylisPlugins)||a(e.stylisPlugins)}),[e.stylisPlugins]),r().createElement(se.Provider,{value:s},r().createElement(ce.Provider,{value:c},e.children))}var ge=function(){function e(e,t){var r=this;this.inject=function(e,t){void 0===t&&(t=ue);var n=r.name+t.hash;e.hasNameForId(r.id,n)||e.insertRules(r.id,n,t(r.rules,n,"@keyframes"))},this.toString=function(){return C(12,String(r.name))},this.name=e,this.id="sc-keyframes-"+e,this.rules=t}return e.prototype.getName=function(e){return void 0===e&&(e=ue),this.name+e.hash},e}(),pe=/([A-Z])/,he=/([A-Z])/g,me=/^ms-/,Me=function(e){return"-"+e.toLowerCase()};function ye(e){return pe.test(e)?e.replace(he,Me).replace(me,"-ms-"):e}var be=function(e){return null==e||!1===e||""===e};function ve(e,t,r,n){if(Array.isArray(e)){for(var o,a=[],i=0,s=e.length;i<s;i+=1)""!==(o=ve(e[i],t,r,n))&&(Array.isArray(o)?a.push.apply(a,o):a.push(o));return a}return be(e)?"":D(e)?"."+e.styledComponentId:A(e)?"function"!=typeof(c=e)||c.prototype&&c.prototype.isReactComponent||!t?e:ve(e(t),t,r,n):e instanceof ge?r?(e.inject(r,n),e.getName(n)):e:I(e)?function e(t,r){var n,o,a=[];for(var i in t)t.hasOwnProperty(i)&&!be(t[i])&&(Array.isArray(t[i])&&t[i].isCss||A(t[i])?a.push(ye(i)+":",t[i],";"):I(t[i])?a.push.apply(a,e(t[i],i)):a.push(ye(i)+": "+(n=i,(null==(o=t[i])||"boolean"==typeof o||""===o?"":"number"!=typeof o||0===o||n in g?String(o).trim():o+"px")+";")));return r?[r+" {"].concat(a,["}"]):a}(e):e.toString();var c}var Ie=function(e){return Array.isArray(e)&&(e.isCss=!0),e};function je(e){for(var t=arguments.length,r=new Array(t>1?t-1:0),n=1;n<t;n++)r[n-1]=arguments[n];return A(e)||I(e)?Ie(ve(v(j,[e].concat(r)))):0===r.length&&1===e.length&&"string"==typeof e[0]?e:Ie(ve(v(e,r)))}new Set;var Ne=/[!"#$%&'()*+,./:;<=>?@[\\\]^`{|}~-]+/g,Ae=/(^-|-$)/g;function we(e){return e.replace(Ne,"-").replace(Ae,"")}function De(e){return"string"==typeof e&&!0}var xe=function(e){return"function"==typeof e||"object"==typeof e&&null!==e&&!Array.isArray(e)},Se=function(e){return"__proto__"!==e&&"constructor"!==e&&"prototype"!==e};function ke(e,t,r){var n=e[r];xe(t)&&xe(n)?Ce(n,t):e[r]=t}function Ce(e){for(var t=arguments.length,r=new Array(t>1?t-1:0),n=1;n<t;n++)r[n-1]=arguments[n];for(var o=0,a=r;o<a.length;o++){var i=a[o];if(xe(i))for(var s in i)Se(s)&&ke(e,i[s],s)}return e}var ze=r().createContext();ze.Consumer;var Oe={};function Te(e,n,o){var a=D(e),i=!De(e),s=n.attrs,c=void 0===s?j:s,l=n.componentId,u=void 0===l?function(e,t){var r="string"!=typeof e?"sc":we(e);Oe[r]=(Oe[r]||0)+1;var n=r+"-"+function(e){return q(ee(e)>>>0)}("5.3.3"+r+Oe[r]);return t?t+"-"+n:n}(n.displayName,n.parentComponentId):l,d=n.displayName,f=void 0===d?function(e){return De(e)?"styled."+e:"Styled("+w(e)+")"}(e):d,g=n.displayName&&n.componentId?we(n.displayName)+"-"+n.componentId:n.componentId||u,p=a&&e.attrs?Array.prototype.concat(e.attrs,c).filter(Boolean):c,m=n.shouldForwardProp;a&&e.shouldForwardProp&&(m=n.shouldForwardProp?function(t,r,o){return e.shouldForwardProp(t,r,o)&&n.shouldForwardProp(t,r,o)}:e.shouldForwardProp);var M,v=new ne(o,g,a?e.componentStyle:void 0),I=v.isStatic&&0===c.length,x=function(e,r){return function(e,r,n,o){var a=e.attrs,i=e.componentStyle,s=e.defaultProps,c=e.foldedComponentIds,l=e.shouldForwardProp,u=e.styledComponentId,d=e.target,f=function(e,t,r){void 0===e&&(e=N);var n=b({},t,{theme:e}),o={};return r.forEach((function(e){var t,r,a,i=e;for(t in A(i)&&(i=i(n)),i)n[t]=o[t]="className"===t?(r=o[t],a=i[t],r&&a?r+" "+a:r||a):i[t]})),[n,o]}(function(e,t,r){return void 0===r&&(r=N),e.theme!==r.theme&&e.theme||t||r.theme}(r,(0,t.useContext)(ze),s)||N,r,a),g=f[0],p=f[1],m=function(e,r,n,o){var a=de(),i=(0,t.useContext)(ce)||ue;return r?e.generateAndInjectStyles(N,a,i):e.generateAndInjectStyles(n,a,i)}(i,o,g),M=n,y=p.$as||r.$as||p.as||r.as||d,v=De(y),I=p!==r?b({},r,{},p):r,j={};for(var w in I)"$"!==w[0]&&"as"!==w&&("forwardedAs"===w?j.as=I[w]:(l?l(w,h,y):!v||h(w))&&(j[w]=I[w]));return r.style&&p.style!==r.style&&(j.style=b({},r.style,{},p.style)),j.className=Array.prototype.concat(c,u,m!==u?m:null,r.className,p.className).filter(Boolean).join(" "),j.ref=M,(0,t.createElement)(y,j)}(M,e,r,I)};return x.displayName=f,(M=r().forwardRef(x)).attrs=p,M.componentStyle=v,M.displayName=f,M.shouldForwardProp=m,M.foldedComponentIds=a?Array.prototype.concat(e.foldedComponentIds,e.styledComponentId):j,M.styledComponentId=g,M.target=a?e.target:e,M.withComponent=function(e){var t=n.componentId,r=function(e,t){if(null==e)return{};var r,n,o={},a=Object.keys(e);for(n=0;n<a.length;n++)r=a[n],t.indexOf(r)>=0||(o[r]=e[r]);return o}(n,["componentId"]),a=t&&t+"-"+(De(e)?e:we(w(e)));return Te(e,b({},r,{attrs:p,componentId:a}),o)},Object.defineProperty(M,"defaultProps",{get:function(){return this._foldedDefaultProps},set:function(t){this._foldedDefaultProps=a?Ce({},e.defaultProps,t):t}}),M.toString=function(){return"."+M.styledComponentId},i&&y()(M,e,{attrs:!0,componentStyle:!0,displayName:!0,foldedComponentIds:!0,shouldForwardProp:!0,styledComponentId:!0,target:!0,withComponent:!0}),M}var Ee,Le=function(e){return function e(t,r,n){if(void 0===n&&(n=N),!(0,l.isValidElementType)(r))return C(1,String(r));var o=function(){return t(r,n,je.apply(void 0,arguments))};return o.withConfig=function(o){return e(t,r,b({},n,{},o))},o.attrs=function(o){return e(t,r,b({},n,{attrs:Array.prototype.concat(n.attrs,o).filter(Boolean)}))},o}(Te,e)};["a","abbr","address","area","article","aside","audio","b","base","bdi","bdo","big","blockquote","body","br","button","canvas","caption","cite","code","col","colgroup","data","datalist","dd","del","details","dfn","dialog","div","dl","dt","em","embed","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","iframe","img","input","ins","kbd","keygen","label","legend","li","link","main","map","mark","marquee","menu","menuitem","meta","meter","nav","noscript","object","ol","optgroup","option","output","p","param","picture","pre","progress","q","rp","rt","ruby","s","samp","script","section","select","small","source","span","strong","style","sub","summary","sup","table","tbody","td","textarea","tfoot","th","thead","time","title","tr","track","u","ul","var","video","wbr","circle","clipPath","defs","ellipse","foreignObject","g","image","line","linearGradient","marker","mask","path","pattern","polygon","polyline","radialGradient","rect","stop","svg","text","textPath","tspan"].forEach((function(e){Le[e]=Le(e)})),Ee=function(e,t){this.rules=e,this.componentId=t,this.isStatic=te(e),H.registerId(this.componentId+1)}.prototype,Ee.createStyles=function(e,t,r,n){var o=n(ve(this.rules,t,r,n).join(""),""),a=this.componentId+e;r.insertRules(a,a,o)},Ee.removeStyles=function(e,t){t.clearRules(this.componentId+e)},Ee.renderStyles=function(e,t,r,n){e>2&&H.registerId(this.componentId+e),this.removeStyles(e,r),this.createStyles(e,t,r,n)},function(){var e=function(){var e=this;this._emitSheetCSS=function(){var t=e.instance.toString();if(!t)return"";var r=Q();return"<style "+[r&&'nonce="'+r+'"',x+'="true"','data-styled-version="5.3.3"'].filter(Boolean).join(" ")+">"+t+"</style>"},this.getStyleTags=function(){return e.sealed?C(2):e._emitSheetCSS()},this.getStyleElement=function(){var t;if(e.sealed)return C(2);var n=((t={})[x]="",t["data-styled-version"]="5.3.3",t.dangerouslySetInnerHTML={__html:e.instance.toString()},t),o=Q();return o&&(n.nonce=o),[r().createElement("style",b({},n,{key:"sc-0-0"}))]},this.seal=function(){e.sealed=!0},this.instance=new H({isServer:!0}),this.sealed=!1}.prototype;e.collectStyles=function(e){return this.sealed?C(2):r().createElement(fe,{sheet:this.instance},e)},e.interleaveWithNodeStream=function(e){return C(3)}}();const Ye=Le,Re=Ye.div`
!function(e,t){if("object"==typeof exports&&"object"==typeof module)module.exports=t(require("react"));else if("function"==typeof define&&define.amd)define(["react"],t);else{var r="object"==typeof exports?t(require("react")):t(e.react);for(var n in r)("object"==typeof exports?exports:e)[n]=r[n]}}(self,(e=>(()=>{var t,r,n={58:(e,t,r)=>{"use strict";var n=r(594),o={childContextTypes:!0,contextType:!0,contextTypes:!0,defaultProps:!0,displayName:!0,getDefaultProps:!0,getDerivedStateFromError:!0,getDerivedStateFromProps:!0,mixins:!0,propTypes:!0,type:!0},a={name:!0,length:!0,prototype:!0,caller:!0,callee:!0,arguments:!0,arity:!0},i={$$typeof:!0,compare:!0,defaultProps:!0,displayName:!0,propTypes:!0,type:!0},s={};function c(e){return n.isMemo(e)?i:s[e.$$typeof]||o}s[n.ForwardRef]={$$typeof:!0,render:!0,defaultProps:!0,displayName:!0,propTypes:!0},s[n.Memo]=i;var l=Object.defineProperty,u=Object.getOwnPropertyNames,d=Object.getOwnPropertySymbols,f=Object.getOwnPropertyDescriptor,g=Object.getPrototypeOf,p=Object.prototype;e.exports=function e(t,r,n){if("string"!=typeof r){if(p){var o=g(r);o&&o!==p&&e(t,o,n)}var i=u(r);d&&(i=i.concat(d(r)));for(var s=c(t),h=c(r),m=0;m<i.length;++m){var M=i[m];if(!(a[M]||n&&n[M]||h&&h[M]||s&&s[M])){var y=f(r,M);try{l(t,M,y)}catch(e){}}}}return t}},516:e=>{"use strict";var t=Object.getOwnPropertySymbols,r=Object.prototype.hasOwnProperty,n=Object.prototype.propertyIsEnumerable;function o(e){if(null==e)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(e)}e.exports=function(){try{if(!Object.assign)return!1;var e=new String("abc");if(e[5]="de","5"===Object.getOwnPropertyNames(e)[0])return!1;for(var t={},r=0;r<10;r++)t["_"+String.fromCharCode(r)]=r;if("0123456789"!==Object.getOwnPropertyNames(t).map((function(e){return t[e]})).join(""))return!1;var n={};return"abcdefghijklmnopqrst".split("").forEach((function(e){n[e]=e})),"abcdefghijklmnopqrst"===Object.keys(Object.assign({},n)).join("")}catch(e){return!1}}()?Object.assign:function(e,a){for(var i,s,c=o(e),l=1;l<arguments.length;l++){for(var u in i=Object(arguments[l]))r.call(i,u)&&(c[u]=i[u]);if(t){s=t(i);for(var d=0;d<s.length;d++)n.call(i,s[d])&&(c[s[d]]=i[s[d]])}}return c}},697:(e,t)=>{"use strict";var r="function"==typeof Symbol&&Symbol.for,n=r?Symbol.for("react.element"):60103,o=r?Symbol.for("react.portal"):60106,a=r?Symbol.for("react.fragment"):60107,i=r?Symbol.for("react.strict_mode"):60108,s=r?Symbol.for("react.profiler"):60114,c=r?Symbol.for("react.provider"):60109,l=r?Symbol.for("react.context"):60110,u=r?Symbol.for("react.async_mode"):60111,d=r?Symbol.for("react.concurrent_mode"):60111,f=r?Symbol.for("react.forward_ref"):60112,g=r?Symbol.for("react.suspense"):60113,p=r?Symbol.for("react.suspense_list"):60120,h=r?Symbol.for("react.memo"):60115,m=r?Symbol.for("react.lazy"):60116,M=r?Symbol.for("react.block"):60121,y=r?Symbol.for("react.fundamental"):60117,b=r?Symbol.for("react.responder"):60118,v=r?Symbol.for("react.scope"):60119;function I(e){if("object"==typeof e&&null!==e){var t=e.$$typeof;switch(t){case n:switch(e=e.type){case u:case d:case a:case s:case i:case g:return e;default:switch(e=e&&e.$$typeof){case l:case f:case m:case h:case c:return e;default:return t}}case o:return t}}}function j(e){return I(e)===d}t.AsyncMode=u,t.ConcurrentMode=d,t.ContextConsumer=l,t.ContextProvider=c,t.Element=n,t.ForwardRef=f,t.Fragment=a,t.Lazy=m,t.Memo=h,t.Portal=o,t.Profiler=s,t.StrictMode=i,t.Suspense=g,t.isAsyncMode=function(e){return j(e)||I(e)===u},t.isConcurrentMode=j,t.isContextConsumer=function(e){return I(e)===l},t.isContextProvider=function(e){return I(e)===c},t.isElement=function(e){return"object"==typeof e&&null!==e&&e.$$typeof===n},t.isForwardRef=function(e){return I(e)===f},t.isFragment=function(e){return I(e)===a},t.isLazy=function(e){return I(e)===m},t.isMemo=function(e){return I(e)===h},t.isPortal=function(e){return I(e)===o},t.isProfiler=function(e){return I(e)===s},t.isStrictMode=function(e){return I(e)===i},t.isSuspense=function(e){return I(e)===g},t.isValidElementType=function(e){return"string"==typeof e||"function"==typeof e||e===a||e===d||e===s||e===i||e===g||e===p||"object"==typeof e&&null!==e&&(e.$$typeof===m||e.$$typeof===h||e.$$typeof===c||e.$$typeof===l||e.$$typeof===f||e.$$typeof===y||e.$$typeof===b||e.$$typeof===v||e.$$typeof===M)},t.typeOf=I},594:(e,t,r)=>{"use strict";e.exports=r(697)},94:(e,t,r)=>{"use strict";r(516);var n=r(156),o=60103;if("function"==typeof Symbol&&Symbol.for){var a=Symbol.for;o=a("react.element"),a("react.fragment")}var i=n.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,s=Object.prototype.hasOwnProperty,c={key:!0,ref:!0,__self:!0,__source:!0};function l(e,t,r){var n,a={},l=null,u=null;for(n in void 0!==r&&(l=""+r),void 0!==t.key&&(l=""+t.key),void 0!==t.ref&&(u=t.ref),t)s.call(t,n)&&!c.hasOwnProperty(n)&&(a[n]=t[n]);if(e&&e.defaultProps)for(n in t=e.defaultProps)void 0===a[n]&&(a[n]=t[n]);return{$$typeof:o,type:e,key:l,ref:u,props:a,_owner:i.current}}t.jsx=l,t.jsxs=l},512:(e,t,r)=>{"use strict";e.exports=r(94)},7:e=>{e.exports=function(e,t,r,n){var o=r?r.call(n,e,t):void 0;if(void 0!==o)return!!o;if(e===t)return!0;if("object"!=typeof e||!e||"object"!=typeof t||!t)return!1;var a=Object.keys(e),i=Object.keys(t);if(a.length!==i.length)return!1;for(var s=Object.prototype.hasOwnProperty.bind(t),c=0;c<a.length;c++){var l=a[c];if(!s(l))return!1;var u=e[l],d=t[l];if(!1===(o=r?r.call(n,u,d,l):void 0)||void 0===o&&u!==d)return!1}return!0}},156:t=>{"use strict";t.exports=e}},o={};function a(e){var t=o[e];if(void 0!==t)return t.exports;var r=o[e]={exports:{}};return n[e](r,r.exports,a),r.exports}a.m=n,a.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return a.d(t,{a:t}),t},a.d=(e,t)=>{for(var r in t)a.o(t,r)&&!a.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},a.f={},a.e=e=>Promise.all(Object.keys(a.f).reduce(((t,r)=>(a.f[r](e,t),t)),[])),a.u=e=>({216:"vendors",628:"threeExperience"}[e]+".bundle.js"),a.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),t={},r="@r2u/viewer:",a.l=(e,n,o,i)=>{if(t[e])t[e].push(n);else{var s,c;if(void 0!==o)for(var l=document.getElementsByTagName("script"),u=0;u<l.length;u++){var d=l[u];if(d.getAttribute("src")==e||d.getAttribute("data-webpack")==r+o){s=d;break}}s||(c=!0,(s=document.createElement("script")).charset="utf-8",s.timeout=120,a.nc&&s.setAttribute("nonce",a.nc),s.setAttribute("data-webpack",r+o),s.src=e),t[e]=[n];var f=(r,n)=>{s.onerror=s.onload=null,clearTimeout(g);var o=t[e];if(delete t[e],s.parentNode&&s.parentNode.removeChild(s),o&&o.forEach((e=>e(n))),r)return r(n)},g=setTimeout(f.bind(null,void 0,{type:"timeout",target:s}),12e4);s.onerror=f.bind(null,s.onerror),s.onload=f.bind(null,s.onload),c&&document.head.appendChild(s)}},a.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},a.p="https://unpkg.com/@r2u/viewer@1.0.2/dist/",(()=>{var e={179:0};a.f.j=(t,r)=>{var n=a.o(e,t)?e[t]:void 0;if(0!==n)if(n)r.push(n[2]);else{var o=new Promise(((r,o)=>n=e[t]=[r,o]));r.push(n[2]=o);var i=a.p+a.u(t),s=new Error;a.l(i,(r=>{if(a.o(e,t)&&(0!==(n=e[t])&&(e[t]=void 0),n)){var o=r&&("load"===r.type?"missing":r.type),i=r&&r.target&&r.target.src;s.message="Loading chunk "+t+" failed.\n("+o+": "+i+")",s.name="ChunkLoadError",s.type=o,s.request=i,n[1](s)}}),"chunk-"+t,t)}};var t=(t,r)=>{var n,o,[i,s,c]=r,l=0;if(i.some((t=>0!==e[t]))){for(n in s)a.o(s,n)&&(a.m[n]=s[n]);c&&c(a)}for(t&&t(r);l<i.length;l++)o=i[l],a.o(e,o)&&e[o]&&e[o][0](),e[o]=0},r=self.webpackChunk_r2u_viewer=self.webpackChunk_r2u_viewer||[];r.forEach(t.bind(null,0)),r.push=t.bind(null,r.push.bind(r))})();var i={};return(()=>{"use strict";a.r(i),a.d(i,{default:()=>We});var e=a(512),t=a(156),r=a.n(t);const n="data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNzAiIGhlaWdodD0iNjkiIHZpZXdCb3g9IjAgMCA3MCA2OSIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KPGcgY2xpcC1wYXRoPSJ1cmwoI2NsaXAwXzE4Ml85NDcpIj4KPGcgZmlsdGVyPSJ1cmwoI2ZpbHRlcjBfZF8xODJfOTQ3KSI+CjxwYXRoIGQ9Ik01NC4wNDU5IDQwLjgzNjNMNDEuMTQyNSAzNC42MzJDNDAuNjU5NCAzNC40Mzk4IDQwLjE0NzggMzQuMzMgMzkuNjA3OCAzNC4zM0MzOC40MTQ4IDM0LjMzIDM3LjQ0NzcgMzMuMzYyOSAzNy40NDc3IDMyLjE3VjE3Ljg1ODNDMzcuNDQ3NyAxNS41Nzk3IDM1LjU0MzUgMTMuNzQwNCAzMy4xODQ1IDEzLjc0MDRDMzAuODI1NSAxMy43NDA0IDI4LjkyMTMgMTUuNTc5NyAyOC45MjEzIDE3Ljg1ODNWMzcuNTU3OEMyOC45MjEzIDQyLjYxNDggMjQuMjg3OCA0Ni40MDMxIDE5LjMzMTYgNDUuMzk4MkwxOS4xNzI3IDQ1LjM2NkMxOC45NDUzIDQ1LjMzODYgMTguNzQ2NCA0NS4yODM3IDE4LjQ5MDYgNDUuMjgzN0MxNy42MDk1IDQ1LjI4MzcgMTYuODEzNyA0NS42NDA2IDE2LjI0NTMgNDYuMTg5NkMxNS4wMTU3IDQ3LjM5MjMgMTUuMDIxOSA0OS4zNzI5IDE2LjI1OTEgNTAuNTY3OUwyOC4wNDAyIDYxLjk0NzVDMjguODA3NiA2Mi42ODg4IDI5Ljg4NzYgNjMuMTU1NSAzMS4wNTI5IDYzLjE1NTVINTAuMzUxMUM1Mi40ODI3IDYzLjE1NTUgNTQuMTMxMiA2MS42NDU2IDU0LjQ0MzggNTkuNjQxNUw1Ni41NzU0IDQ1LjE3MzlDNTYuNjAzOCA0NC45ODE3IDU2LjYzMjMgNDQuNzg5NSA1Ni42MzIzIDQ0LjYyNDhDNTYuNjMyMyA0Mi45MjI3IDU1LjU1MjIgNDEuNDQwMyA1NC4wNDU5IDQwLjgzNjNaIiBmaWxsPSJ3aGl0ZSIvPgo8cGF0aCBkPSJNMjAuNzYxOCAxOS44MjYzQzIxLjM5MTUgMjQuMTk1NCAyNi4xMDUyIDIyLjQxMjYgMjYuMTA1MiAxNy45OTgyQzI2LjEwNTIgMTQuMTY2OCAyOS4xNzA1IDExLjA1NzMgMzIuOTQ3NSAxMS4wNTczQzM2LjcyNDQgMTEuMDU3MyAzOS43ODk3IDE0LjE2NjggMzkuNzg5NyAxNy45OTgyQzM5Ljc4OTcgMjIuNDEyNiA0NC41MDM0IDI0LjE5NTQgNDUuMTMzMSAxOS44MjYzQzQ1LjIxOTEgMTkuMjI5OCA0NS4yNjM2IDE4LjYxOTQgNDUuMjYzNiAxNy45OTgyQzQ1LjI2MzYgMTEuMDg1IDM5Ljc2MjQgNS41MDQ1MiAzMi45NDc1IDUuNTA0NTJDMjYuMTMyNSA1LjUwNDUyIDIwLjYzMTMgMTEuMDg1IDIwLjYzMTMgMTcuOTk4MkMyMC42MzEzIDE4LjYxOTQgMjAuNjc1OCAxOS4yMjk4IDIwLjc2MTggMTkuODI2M1oiIGZpbGw9IiNEREREREQiLz4KPC9nPgo8L2c+CjxkZWZzPgo8ZmlsdGVyIGlkPSJmaWx0ZXIwX2RfMTgyXzk0NyIgeD0iMTIuMzI3MSIgeT0iMi41MDQ1MiIgd2lkdGg9IjUxLjMwNTIiIGhlaWdodD0iNjcuNjUxIiBmaWx0ZXJVbml0cz0idXNlclNwYWNlT25Vc2UiIGNvbG9yLWludGVycG9sYXRpb24tZmlsdGVycz0ic1JHQiI+CjxmZUZsb29kIGZsb29kLW9wYWNpdHk9IjAiIHJlc3VsdD0iQmFja2dyb3VuZEltYWdlRml4Ii8+CjxmZUNvbG9yTWF0cml4IGluPSJTb3VyY2VBbHBoYSIgdHlwZT0ibWF0cml4IiB2YWx1ZXM9IjAgMCAwIDAgMCAwIDAgMCAwIDAgMCAwIDAgMCAwIDAgMCAwIDEyNyAwIiByZXN1bHQ9ImhhcmRBbHBoYSIvPgo8ZmVPZmZzZXQgZHg9IjIiIGR5PSIyIi8+CjxmZUdhdXNzaWFuQmx1ciBzdGREZXZpYXRpb249IjIuNSIvPgo8ZmVDb2xvck1hdHJpeCB0eXBlPSJtYXRyaXgiIHZhbHVlcz0iMCAwIDAgMCAwIDAgMCAwIDAgMCAwIDAgMCAwIDAgMCAwIDAgMC4yNSAwIi8+CjxmZUJsZW5kIG1vZGU9Im5vcm1hbCIgaW4yPSJCYWNrZ3JvdW5kSW1hZ2VGaXgiIHJlc3VsdD0iZWZmZWN0MV9kcm9wU2hhZG93XzE4Ml85NDciLz4KPGZlQmxlbmQgbW9kZT0ibm9ybWFsIiBpbj0iU291cmNlR3JhcGhpYyIgaW4yPSJlZmZlY3QxX2Ryb3BTaGFkb3dfMTgyXzk0NyIgcmVzdWx0PSJzaGFwZSIvPgo8L2ZpbHRlcj4KPGNsaXBQYXRoIGlkPSJjbGlwMF8xODJfOTQ3Ij4KPHJlY3Qgd2lkdGg9IjcwIiBoZWlnaHQ9IjY4LjgwNjgiIGZpbGw9IndoaXRlIi8+CjwvY2xpcFBhdGg+CjwvZGVmcz4KPC9zdmc+Cg==";const o=(0,t.createContext)({}),s=r().forwardRef((({glbSrc:r,exposure:n,hdri:a,minZoom:i,maxZoom:s,initialZoom:c,backgroundColor:l,backgroundImage:u,sceneBackground:d,activeShadow:f,activeBakedShadow:g,shadowOffsetX:p,shadowOffsetY:h,shadowOffsetZ:m,shadowOpacity:M,shadowRadius:y,cameraOrbitSensitivity:b,minAzimuthalAngleRotation:v,maxAzimuthalAngleRotation:I,minPolarAngleRotation:j,maxPolarAngleRotation:N,maxDragX:A,minDragX:w,maxDragY:D,minDragY:x,maxDragZ:S,minDragZ:k,activeFog:C,fogColor:z,fogNear:O,fogFar:T,cameraNear:E,cameraFar:L,bloom:Y,initialBloom:R,enableBloomButton:P,bloomIntensity:Z,bloomRadius:U,bloomThreshold:B,initialAnimation:Q,children:_},G)=>{const[F,$]=(0,t.useState)(),[W,X]=(0,t.useState)(Y?R?"bloomOn":"bloomOff":"noBloom");return(0,t.useImperativeHandle)(G,(()=>({insertModelNode:e=>{F&&F.insertModelNode(e)},deleteModelNode:e=>{F&&F.deleteModelNode(e)},updateBloom:e=>{X(e?"bloomOn":"bloomOff")},getAllSlotsMaterials:()=>F?F.getAllSlotsMaterials():null,setMaterial:(...e)=>{F&&F.setMaterial(...e)},getAllSlotsModels:()=>F?F.getAllSlotsModels():null,setModel:(...e)=>{F&&F.setModel(...e)},getCamera:()=>F?F.camera.controls.getCamera():null,setCamera:e=>{F&&F.camera.controls.setCamera(e)},updateShadow:e=>{var t;F&&(null===(t=F.world.environment)||void 0===t||t.updateShadow(e))},updateFog:e=>{var t;F&&(null===(t=F.world.environment)||void 0===t||t.updateFog(e))},updateBloomProps:e=>{var t;F&&(null===(t=F.world.environment)||void 0===t||t.updateBloom(e))},updateEnvironment:e=>{F&&F.updateEnvironment(e)},getCustomizedModel:()=>function(e,t,r,n){return new(r||(r=Promise))((function(o,a){function i(e){try{c(n.next(e))}catch(e){a(e)}}function s(e){try{c(n.throw(e))}catch(e){a(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(i,s)}c((n=n.apply(e,t||[])).next())}))}(void 0,void 0,void 0,(function*(){return F?F.getCustomizedModel():null})),getCurrentCustomization:()=>F?F.getCurrentCustomization():null}))),(0,e.jsx)(o.Provider,Object.assign({value:{glbSrc:r,exposure:n,hdri:"neutral"===a?"https://sdk.r2u.io/hdri/neutral.hdr":a,minZoom:i,maxZoom:s,initialZoom:c,backgroundColor:l,backgroundImage:u,sceneBackground:d,activeShadow:f,activeBakedShadow:g,shadowOffsetX:p,shadowOffsetY:h,shadowOffsetZ:m,shadowOpacity:M,shadowRadius:y,cameraOrbitSensitivity:b,minAzimuthalAngleRotation:v,maxAzimuthalAngleRotation:I,minPolarAngleRotation:j,maxPolarAngleRotation:N,maxDragX:A,minDragX:w,maxDragY:D,minDragY:x,maxDragZ:S,minDragZ:k,activeFog:C,fogColor:z,fogNear:O,fogFar:T,cameraNear:E,cameraFar:L,experience:F,setExperience:$,bloom:Y,initialBloom:R,enableBloomButton:P,bloomIntensity:Z,bloomRadius:U,bloomThreshold:B,initialAnimation:Q,hasBloom:W,setHasBloom:X}},{children:_}),void 0)})),c=()=>(0,t.useContext)(o);var l=a(594),u=a(7),d=a.n(u);const f=function(e){function t(e,n,c,l,f){for(var g,p,h,m,v,j=0,N=0,A=0,w=0,D=0,O=0,E=h=g=0,Y=0,R=0,P=0,Z=0,U=c.length,B=U-1,Q="",_="",G="",F="";Y<U;){if(p=c.charCodeAt(Y),Y===B&&0!==N+w+A+j&&(0!==N&&(p=47===N?10:47),w=A=j=0,U++,B++),0===N+w+A+j){if(Y===B&&(0<R&&(Q=Q.replace(d,"")),0<Q.trim().length)){switch(p){case 32:case 9:case 59:case 13:case 10:break;default:Q+=c.charAt(Y)}p=59}switch(p){case 123:for(g=(Q=Q.trim()).charCodeAt(0),h=1,Z=++Y;Y<U;){switch(p=c.charCodeAt(Y)){case 123:h++;break;case 125:h--;break;case 47:switch(p=c.charCodeAt(Y+1)){case 42:case 47:e:{for(E=Y+1;E<B;++E)switch(c.charCodeAt(E)){case 47:if(42===p&&42===c.charCodeAt(E-1)&&Y+2!==E){Y=E+1;break e}break;case 10:if(47===p){Y=E+1;break e}}Y=E}}break;case 91:p++;case 40:p++;case 34:case 39:for(;Y++<B&&c.charCodeAt(Y)!==p;);}if(0===h)break;Y++}if(h=c.substring(Z,Y),0===g&&(g=(Q=Q.replace(u,"").trim()).charCodeAt(0)),64===g){switch(0<R&&(Q=Q.replace(d,"")),p=Q.charCodeAt(1)){case 100:case 109:case 115:case 45:R=n;break;default:R=z}if(Z=(h=t(n,R,h,p,f+1)).length,0<T&&(v=s(3,h,R=r(z,Q,P),n,S,x,Z,p,f,l),Q=R.join(""),void 0!==v&&0===(Z=(h=v.trim()).length)&&(p=0,h="")),0<Z)switch(p){case 115:Q=Q.replace(I,i);case 100:case 109:case 45:h=Q+"{"+h+"}";break;case 107:h=(Q=Q.replace(M,"$1 $2"))+"{"+h+"}",h=1===C||2===C&&a("@"+h,3)?"@-webkit-"+h+"@"+h:"@"+h;break;default:h=Q+h,112===l&&(_+=h,h="")}else h=""}else h=t(n,r(n,Q,P),h,l,f+1);G+=h,h=P=R=E=g=0,Q="",p=c.charCodeAt(++Y);break;case 125:case 59:if(1<(Z=(Q=(0<R?Q.replace(d,""):Q).trim()).length))switch(0===E&&(g=Q.charCodeAt(0),45===g||96<g&&123>g)&&(Z=(Q=Q.replace(" ",":")).length),0<T&&void 0!==(v=s(1,Q,n,e,S,x,_.length,l,f,l))&&0===(Z=(Q=v.trim()).length)&&(Q="\0\0"),g=Q.charCodeAt(0),p=Q.charCodeAt(1),g){case 0:break;case 64:if(105===p||99===p){F+=Q+c.charAt(Y);break}default:58!==Q.charCodeAt(Z-1)&&(_+=o(Q,g,p,Q.charCodeAt(2)))}P=R=E=g=0,Q="",p=c.charCodeAt(++Y)}}switch(p){case 13:case 10:47===N?N=0:0===1+g&&107!==l&&0<Q.length&&(R=1,Q+="\0"),0<T*L&&s(0,Q,n,e,S,x,_.length,l,f,l),x=1,S++;break;case 59:case 125:if(0===N+w+A+j){x++;break}default:switch(x++,m=c.charAt(Y),p){case 9:case 32:if(0===w+j+N)switch(D){case 44:case 58:case 9:case 32:m="";break;default:32!==p&&(m=" ")}break;case 0:m="\\0";break;case 12:m="\\f";break;case 11:m="\\v";break;case 38:0===w+N+j&&(R=P=1,m="\f"+m);break;case 108:if(0===w+N+j+k&&0<E)switch(Y-E){case 2:112===D&&58===c.charCodeAt(Y-3)&&(k=D);case 8:111===O&&(k=O)}break;case 58:0===w+N+j&&(E=Y);break;case 44:0===N+A+w+j&&(R=1,m+="\r");break;case 34:case 39:0===N&&(w=w===p?0:0===w?p:w);break;case 91:0===w+N+A&&j++;break;case 93:0===w+N+A&&j--;break;case 41:0===w+N+j&&A--;break;case 40:0===w+N+j&&(0===g&&(2*D+3*O==533||(g=1)),A++);break;case 64:0===N+A+w+j+E+h&&(h=1);break;case 42:case 47:if(!(0<w+j+A))switch(N){case 0:switch(2*p+3*c.charCodeAt(Y+1)){case 235:N=47;break;case 220:Z=Y,N=42}break;case 42:47===p&&42===D&&Z+2!==Y&&(33===c.charCodeAt(Z+2)&&(_+=c.substring(Z,Y+1)),m="",N=0)}}0===N&&(Q+=m)}O=D,D=p,Y++}if(0<(Z=_.length)){if(R=n,0<T&&void 0!==(v=s(2,_,R,e,S,x,Z,l,f,l))&&0===(_=v).length)return F+_+G;if(_=R.join(",")+"{"+_+"}",0!=C*k){switch(2!==C||a(_,2)||(k=0),k){case 111:_=_.replace(b,":-moz-$1")+_;break;case 112:_=_.replace(y,"::-webkit-input-$1")+_.replace(y,"::-moz-$1")+_.replace(y,":-ms-input-$1")+_}k=0}}return F+_+G}function r(e,t,r){var o=t.trim().split(h);t=o;var a=o.length,i=e.length;switch(i){case 0:case 1:var s=0;for(e=0===i?"":e[0]+" ";s<a;++s)t[s]=n(e,t[s],r).trim();break;default:var c=s=0;for(t=[];s<a;++s)for(var l=0;l<i;++l)t[c++]=n(e[l]+" ",o[s],r).trim()}return t}function n(e,t,r){var n=t.charCodeAt(0);switch(33>n&&(n=(t=t.trim()).charCodeAt(0)),n){case 38:return t.replace(m,"$1"+e.trim());case 58:return e.trim()+t.replace(m,"$1"+e.trim());default:if(0<1*r&&0<t.indexOf("\f"))return t.replace(m,(58===e.charCodeAt(0)?"":"$1")+e.trim())}return e+t}function o(e,t,r,n){var i=e+";",s=2*t+3*r+4*n;if(944===s){e=i.indexOf(":",9)+1;var c=i.substring(e,i.length-1).trim();return c=i.substring(0,e).trim()+c+";",1===C||2===C&&a(c,1)?"-webkit-"+c+c:c}if(0===C||2===C&&!a(i,1))return i;switch(s){case 1015:return 97===i.charCodeAt(10)?"-webkit-"+i+i:i;case 951:return 116===i.charCodeAt(3)?"-webkit-"+i+i:i;case 963:return 110===i.charCodeAt(5)?"-webkit-"+i+i:i;case 1009:if(100!==i.charCodeAt(4))break;case 969:case 942:return"-webkit-"+i+i;case 978:return"-webkit-"+i+"-moz-"+i+i;case 1019:case 983:return"-webkit-"+i+"-moz-"+i+"-ms-"+i+i;case 883:if(45===i.charCodeAt(8))return"-webkit-"+i+i;if(0<i.indexOf("image-set(",11))return i.replace(D,"$1-webkit-$2")+i;break;case 932:if(45===i.charCodeAt(4))switch(i.charCodeAt(5)){case 103:return"-webkit-box-"+i.replace("-grow","")+"-webkit-"+i+"-ms-"+i.replace("grow","positive")+i;case 115:return"-webkit-"+i+"-ms-"+i.replace("shrink","negative")+i;case 98:return"-webkit-"+i+"-ms-"+i.replace("basis","preferred-size")+i}return"-webkit-"+i+"-ms-"+i+i;case 964:return"-webkit-"+i+"-ms-flex-"+i+i;case 1023:if(99!==i.charCodeAt(8))break;return"-webkit-box-pack"+(c=i.substring(i.indexOf(":",15)).replace("flex-","").replace("space-between","justify"))+"-webkit-"+i+"-ms-flex-pack"+c+i;case 1005:return g.test(i)?i.replace(f,":-webkit-")+i.replace(f,":-moz-")+i:i;case 1e3:switch(t=(c=i.substring(13).trim()).indexOf("-")+1,c.charCodeAt(0)+c.charCodeAt(t)){case 226:c=i.replace(v,"tb");break;case 232:c=i.replace(v,"tb-rl");break;case 220:c=i.replace(v,"lr");break;default:return i}return"-webkit-"+i+"-ms-"+c+i;case 1017:if(-1===i.indexOf("sticky",9))break;case 975:switch(t=(i=e).length-10,s=(c=(33===i.charCodeAt(t)?i.substring(0,t):i).substring(e.indexOf(":",7)+1).trim()).charCodeAt(0)+(0|c.charCodeAt(7))){case 203:if(111>c.charCodeAt(8))break;case 115:i=i.replace(c,"-webkit-"+c)+";"+i;break;case 207:case 102:i=i.replace(c,"-webkit-"+(102<s?"inline-":"")+"box")+";"+i.replace(c,"-webkit-"+c)+";"+i.replace(c,"-ms-"+c+"box")+";"+i}return i+";";case 938:if(45===i.charCodeAt(5))switch(i.charCodeAt(6)){case 105:return c=i.replace("-items",""),"-webkit-"+i+"-webkit-box-"+c+"-ms-flex-"+c+i;case 115:return"-webkit-"+i+"-ms-flex-item-"+i.replace(N,"")+i;default:return"-webkit-"+i+"-ms-flex-line-pack"+i.replace("align-content","").replace(N,"")+i}break;case 973:case 989:if(45!==i.charCodeAt(3)||122===i.charCodeAt(4))break;case 931:case 953:if(!0===w.test(e))return 115===(c=e.substring(e.indexOf(":")+1)).charCodeAt(0)?o(e.replace("stretch","fill-available"),t,r,n).replace(":fill-available",":stretch"):i.replace(c,"-webkit-"+c)+i.replace(c,"-moz-"+c.replace("fill-",""))+i;break;case 962:if(i="-webkit-"+i+(102===i.charCodeAt(5)?"-ms-"+i:"")+i,211===r+n&&105===i.charCodeAt(13)&&0<i.indexOf("transform",10))return i.substring(0,i.indexOf(";",27)+1).replace(p,"$1-webkit-$2")+i}return i}function a(e,t){var r=e.indexOf(1===t?":":"{"),n=e.substring(0,3!==t?r:10);return r=e.substring(r+1,e.length-1),E(2!==t?n:n.replace(A,"$1"),r,t)}function i(e,t){var r=o(t,t.charCodeAt(0),t.charCodeAt(1),t.charCodeAt(2));return r!==t+";"?r.replace(j," or ($1)").substring(4):"("+t+")"}function s(e,t,r,n,o,a,i,s,c,u){for(var d,f=0,g=t;f<T;++f)switch(d=O[f].call(l,e,g,r,n,o,a,i,s,c,u)){case void 0:case!1:case!0:case null:break;default:g=d}if(g!==t)return g}function c(e){return void 0!==(e=e.prefix)&&(E=null,e?"function"!=typeof e?C=1:(C=2,E=e):C=0),c}function l(e,r){var n=e;if(33>n.charCodeAt(0)&&(n=n.trim()),n=[n],0<T){var o=s(-1,r,n,n,S,x,0,0,0,0);void 0!==o&&"string"==typeof o&&(r=o)}var a=t(z,n,r,0,0);return 0<T&&void 0!==(o=s(-2,a,n,n,S,x,a.length,0,0,0))&&(a=o),k=0,x=S=1,a}var u=/^\0+/g,d=/[\0\r\f]/g,f=/: */g,g=/zoo|gra/,p=/([,: ])(transform)/g,h=/,\r+?/g,m=/([\t\r\n ])*\f?&/g,M=/@(k\w+)\s*(\S*)\s*/,y=/::(place)/g,b=/:(read-only)/g,v=/[svh]\w+-[tblr]{2}/,I=/\(\s*(.*)\s*\)/g,j=/([\s\S]*?);/g,N=/-self|flex-/g,A=/[^]*?(:[rp][el]a[\w-]+)[^]*/,w=/stretch|:\s*\w+\-(?:conte|avail)/,D=/([^-])(image-set\()/,x=1,S=1,k=0,C=1,z=[],O=[],T=0,E=null,L=0;return l.use=function e(t){switch(t){case void 0:case null:T=O.length=0;break;default:if("function"==typeof t)O[T++]=t;else if("object"==typeof t)for(var r=0,n=t.length;r<n;++r)e(t[r]);else L=0|!!t}return e},l.set=c,void 0!==e&&c(e),l},g={animationIterationCount:1,borderImageOutset:1,borderImageSlice:1,borderImageWidth:1,boxFlex:1,boxFlexGroup:1,boxOrdinalGroup:1,columnCount:1,columns:1,flex:1,flexGrow:1,flexPositive:1,flexShrink:1,flexNegative:1,flexOrder:1,gridRow:1,gridRowEnd:1,gridRowSpan:1,gridRowStart:1,gridColumn:1,gridColumnEnd:1,gridColumnSpan:1,gridColumnStart:1,msGridRow:1,msGridRowSpan:1,msGridColumn:1,msGridColumnSpan:1,fontWeight:1,lineHeight:1,opacity:1,order:1,orphans:1,tabSize:1,widows:1,zIndex:1,zoom:1,WebkitLineClamp:1,fillOpacity:1,floodOpacity:1,stopOpacity:1,strokeDasharray:1,strokeDashoffset:1,strokeMiterlimit:1,strokeOpacity:1,strokeWidth:1};var p=/^((children|dangerouslySetInnerHTML|key|ref|autoFocus|defaultValue|defaultChecked|innerHTML|suppressContentEditableWarning|suppressHydrationWarning|valueLink|accept|acceptCharset|accessKey|action|allow|allowUserMedia|allowPaymentRequest|allowFullScreen|allowTransparency|alt|async|autoComplete|autoPlay|capture|cellPadding|cellSpacing|challenge|charSet|checked|cite|classID|className|cols|colSpan|content|contentEditable|contextMenu|controls|controlsList|coords|crossOrigin|data|dateTime|decoding|default|defer|dir|disabled|disablePictureInPicture|download|draggable|encType|form|formAction|formEncType|formMethod|formNoValidate|formTarget|frameBorder|headers|height|hidden|high|href|hrefLang|htmlFor|httpEquiv|id|inputMode|integrity|is|keyParams|keyType|kind|label|lang|list|loading|loop|low|marginHeight|marginWidth|max|maxLength|media|mediaGroup|method|min|minLength|multiple|muted|name|nonce|noValidate|open|optimum|pattern|placeholder|playsInline|poster|preload|profile|radioGroup|readOnly|referrerPolicy|rel|required|reversed|role|rows|rowSpan|sandbox|scope|scoped|scrolling|seamless|selected|shape|size|sizes|slot|span|spellCheck|src|srcDoc|srcLang|srcSet|start|step|style|summary|tabIndex|target|title|type|useMap|value|width|wmode|wrap|about|datatype|inlist|prefix|property|resource|typeof|vocab|autoCapitalize|autoCorrect|autoSave|color|inert|itemProp|itemScope|itemType|itemID|itemRef|on|results|security|unselectable|accentHeight|accumulate|additive|alignmentBaseline|allowReorder|alphabetic|amplitude|arabicForm|ascent|attributeName|attributeType|autoReverse|azimuth|baseFrequency|baselineShift|baseProfile|bbox|begin|bias|by|calcMode|capHeight|clip|clipPathUnits|clipPath|clipRule|colorInterpolation|colorInterpolationFilters|colorProfile|colorRendering|contentScriptType|contentStyleType|cursor|cx|cy|d|decelerate|descent|diffuseConstant|direction|display|divisor|dominantBaseline|dur|dx|dy|edgeMode|elevation|enableBackground|end|exponent|externalResourcesRequired|fill|fillOpacity|fillRule|filter|filterRes|filterUnits|floodColor|floodOpacity|focusable|fontFamily|fontSize|fontSizeAdjust|fontStretch|fontStyle|fontVariant|fontWeight|format|from|fr|fx|fy|g1|g2|glyphName|glyphOrientationHorizontal|glyphOrientationVertical|glyphRef|gradientTransform|gradientUnits|hanging|horizAdvX|horizOriginX|ideographic|imageRendering|in|in2|intercept|k|k1|k2|k3|k4|kernelMatrix|kernelUnitLength|kerning|keyPoints|keySplines|keyTimes|lengthAdjust|letterSpacing|lightingColor|limitingConeAngle|local|markerEnd|markerMid|markerStart|markerHeight|markerUnits|markerWidth|mask|maskContentUnits|maskUnits|mathematical|mode|numOctaves|offset|opacity|operator|order|orient|orientation|origin|overflow|overlinePosition|overlineThickness|panose1|paintOrder|pathLength|patternContentUnits|patternTransform|patternUnits|pointerEvents|points|pointsAtX|pointsAtY|pointsAtZ|preserveAlpha|preserveAspectRatio|primitiveUnits|r|radius|refX|refY|renderingIntent|repeatCount|repeatDur|requiredExtensions|requiredFeatures|restart|result|rotate|rx|ry|scale|seed|shapeRendering|slope|spacing|specularConstant|specularExponent|speed|spreadMethod|startOffset|stdDeviation|stemh|stemv|stitchTiles|stopColor|stopOpacity|strikethroughPosition|strikethroughThickness|string|stroke|strokeDasharray|strokeDashoffset|strokeLinecap|strokeLinejoin|strokeMiterlimit|strokeOpacity|strokeWidth|surfaceScale|systemLanguage|tableValues|targetX|targetY|textAnchor|textDecoration|textRendering|textLength|to|transform|u1|u2|underlinePosition|underlineThickness|unicode|unicodeBidi|unicodeRange|unitsPerEm|vAlphabetic|vHanging|vIdeographic|vMathematical|values|vectorEffect|version|vertAdvY|vertOriginX|vertOriginY|viewBox|viewTarget|visibility|widths|wordSpacing|writingMode|x|xHeight|x1|x2|xChannelSelector|xlinkActuate|xlinkArcrole|xlinkHref|xlinkRole|xlinkShow|xlinkTitle|xlinkType|xmlBase|xmlns|xmlnsXlink|xmlLang|xmlSpace|y|y1|y2|yChannelSelector|z|zoomAndPan|for|class|autofocus)|(([Dd][Aa][Tt][Aa]|[Aa][Rr][Ii][Aa]|x)-.*))$/;const h=(m={},function(e){return void 0===m[e]&&(m[e]=(t=e,p.test(t)||111===t.charCodeAt(0)&&110===t.charCodeAt(1)&&t.charCodeAt(2)<91)),m[e];var t});var m,M=a(58),y=a.n(M);function b(){return(b=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e}).apply(this,arguments)}var v=function(e,t){for(var r=[e[0]],n=0,o=t.length;n<o;n+=1)r.push(t[n],e[n+1]);return r},I=function(e){return null!==e&&"object"==typeof e&&"[object Object]"===(e.toString?e.toString():Object.prototype.toString.call(e))&&!(0,l.typeOf)(e)},j=Object.freeze([]),N=Object.freeze({});function A(e){return"function"==typeof e}function w(e){return e.displayName||e.name||"Component"}function D(e){return e&&"string"==typeof e.styledComponentId}var x="undefined"!=typeof process&&(process.env.REACT_APP_SC_ATTR||process.env.SC_ATTR)||"data-styled",S="undefined"!=typeof window&&"HTMLElement"in window,k=Boolean("boolean"==typeof SC_DISABLE_SPEEDY?SC_DISABLE_SPEEDY:"undefined"!=typeof process&&void 0!==process.env.REACT_APP_SC_DISABLE_SPEEDY&&""!==process.env.REACT_APP_SC_DISABLE_SPEEDY?"false"!==process.env.REACT_APP_SC_DISABLE_SPEEDY&&process.env.REACT_APP_SC_DISABLE_SPEEDY:"undefined"!=typeof process&&void 0!==process.env.SC_DISABLE_SPEEDY&&""!==process.env.SC_DISABLE_SPEEDY&&"false"!==process.env.SC_DISABLE_SPEEDY&&process.env.SC_DISABLE_SPEEDY);function C(e){for(var t=arguments.length,r=new Array(t>1?t-1:0),n=1;n<t;n++)r[n-1]=arguments[n];throw new Error("An error occurred. See https://git.io/JUIaE#"+e+" for more information."+(r.length>0?" Args: "+r.join(", "):""))}var z=function(){function e(e){this.groupSizes=new Uint32Array(512),this.length=512,this.tag=e}var t=e.prototype;return t.indexOfGroup=function(e){for(var t=0,r=0;r<e;r++)t+=this.groupSizes[r];return t},t.insertRules=function(e,t){if(e>=this.groupSizes.length){for(var r=this.groupSizes,n=r.length,o=n;e>=o;)(o<<=1)<0&&C(16,""+e);this.groupSizes=new Uint32Array(o),this.groupSizes.set(r),this.length=o;for(var a=n;a<o;a++)this.groupSizes[a]=0}for(var i=this.indexOfGroup(e+1),s=0,c=t.length;s<c;s++)this.tag.insertRule(i,t[s])&&(this.groupSizes[e]++,i++)},t.clearGroup=function(e){if(e<this.length){var t=this.groupSizes[e],r=this.indexOfGroup(e),n=r+t;this.groupSizes[e]=0;for(var o=r;o<n;o++)this.tag.deleteRule(r)}},t.getGroup=function(e){var t="";if(e>=this.length||0===this.groupSizes[e])return t;for(var r=this.groupSizes[e],n=this.indexOfGroup(e),o=n+r,a=n;a<o;a++)t+=this.tag.getRule(a)+"/*!sc*/\n";return t},e}(),O=new Map,T=new Map,E=1,L=function(e){if(O.has(e))return O.get(e);for(;T.has(E);)E++;var t=E++;return O.set(e,t),T.set(t,e),t},Y=function(e){return T.get(e)},R=function(e,t){t>=E&&(E=t+1),O.set(e,t),T.set(t,e)},P="style["+x+'][data-styled-version="5.3.3"]',Z=new RegExp("^"+x+'\\.g(\\d+)\\[id="([\\w\\d-]+)"\\].*?"([^"]*)'),U=function(e,t,r){for(var n,o=r.split(","),a=0,i=o.length;a<i;a++)(n=o[a])&&e.registerName(t,n)},B=function(e,t){for(var r=(t.textContent||"").split("/*!sc*/\n"),n=[],o=0,a=r.length;o<a;o++){var i=r[o].trim();if(i){var s=i.match(Z);if(s){var c=0|parseInt(s[1],10),l=s[2];0!==c&&(R(l,c),U(e,l,s[3]),e.getTag().insertRules(c,n)),n.length=0}else n.push(i)}}},Q=function(){return"undefined"!=typeof window&&void 0!==window.__webpack_nonce__?window.__webpack_nonce__:null},_=function(e){var t=document.head,r=e||t,n=document.createElement("style"),o=function(e){for(var t=e.childNodes,r=t.length;r>=0;r--){var n=t[r];if(n&&1===n.nodeType&&n.hasAttribute(x))return n}}(r),a=void 0!==o?o.nextSibling:null;n.setAttribute(x,"active"),n.setAttribute("data-styled-version","5.3.3");var i=Q();return i&&n.setAttribute("nonce",i),r.insertBefore(n,a),n},G=function(){function e(e){var t=this.element=_(e);t.appendChild(document.createTextNode("")),this.sheet=function(e){if(e.sheet)return e.sheet;for(var t=document.styleSheets,r=0,n=t.length;r<n;r++){var o=t[r];if(o.ownerNode===e)return o}C(17)}(t),this.length=0}var t=e.prototype;return t.insertRule=function(e,t){try{return this.sheet.insertRule(t,e),this.length++,!0}catch(e){return!1}},t.deleteRule=function(e){this.sheet.deleteRule(e),this.length--},t.getRule=function(e){var t=this.sheet.cssRules[e];return void 0!==t&&"string"==typeof t.cssText?t.cssText:""},e}(),F=function(){function e(e){var t=this.element=_(e);this.nodes=t.childNodes,this.length=0}var t=e.prototype;return t.insertRule=function(e,t){if(e<=this.length&&e>=0){var r=document.createTextNode(t),n=this.nodes[e];return this.element.insertBefore(r,n||null),this.length++,!0}return!1},t.deleteRule=function(e){this.element.removeChild(this.nodes[e]),this.length--},t.getRule=function(e){return e<this.length?this.nodes[e].textContent:""},e}(),$=function(){function e(e){this.rules=[],this.length=0}var t=e.prototype;return t.insertRule=function(e,t){return e<=this.length&&(this.rules.splice(e,0,t),this.length++,!0)},t.deleteRule=function(e){this.rules.splice(e,1),this.length--},t.getRule=function(e){return e<this.length?this.rules[e]:""},e}(),W=S,X={isServer:!S,useCSSOMInjection:!k},H=function(){function e(e,t,r){void 0===e&&(e=N),void 0===t&&(t={}),this.options=b({},X,{},e),this.gs=t,this.names=new Map(r),this.server=!!e.isServer,!this.server&&S&&W&&(W=!1,function(e){for(var t=document.querySelectorAll(P),r=0,n=t.length;r<n;r++){var o=t[r];o&&"active"!==o.getAttribute(x)&&(B(e,o),o.parentNode&&o.parentNode.removeChild(o))}}(this))}e.registerId=function(e){return L(e)};var t=e.prototype;return t.reconstructWithOptions=function(t,r){return void 0===r&&(r=!0),new e(b({},this.options,{},t),this.gs,r&&this.names||void 0)},t.allocateGSInstance=function(e){return this.gs[e]=(this.gs[e]||0)+1},t.getTag=function(){return this.tag||(this.tag=(r=(t=this.options).isServer,n=t.useCSSOMInjection,o=t.target,e=r?new $(o):n?new G(o):new F(o),new z(e)));var e,t,r,n,o},t.hasNameForId=function(e,t){return this.names.has(e)&&this.names.get(e).has(t)},t.registerName=function(e,t){if(L(e),this.names.has(e))this.names.get(e).add(t);else{var r=new Set;r.add(t),this.names.set(e,r)}},t.insertRules=function(e,t,r){this.registerName(e,t),this.getTag().insertRules(L(e),r)},t.clearNames=function(e){this.names.has(e)&&this.names.get(e).clear()},t.clearRules=function(e){this.getTag().clearGroup(L(e)),this.clearNames(e)},t.clearTag=function(){this.tag=void 0},t.toString=function(){return function(e){for(var t=e.getTag(),r=t.length,n="",o=0;o<r;o++){var a=Y(o);if(void 0!==a){var i=e.names.get(a),s=t.getGroup(o);if(i&&s&&i.size){var c=x+".g"+o+'[id="'+a+'"]',l="";void 0!==i&&i.forEach((function(e){e.length>0&&(l+=e+",")})),n+=""+s+c+'{content:"'+l+'"}/*!sc*/\n'}}}return n}(this)},e}(),V=/(a)(d)/gi,J=function(e){return String.fromCharCode(e+(e>25?39:97))};function q(e){var t,r="";for(t=Math.abs(e);t>52;t=t/52|0)r=J(t%52)+r;return(J(t%52)+r).replace(V,"$1-$2")}var K=function(e,t){for(var r=t.length;r;)e=33*e^t.charCodeAt(--r);return e},ee=function(e){return K(5381,e)};function te(e){for(var t=0;t<e.length;t+=1){var r=e[t];if(A(r)&&!D(r))return!1}return!0}var re=ee("5.3.3"),ne=function(){function e(e,t,r){this.rules=e,this.staticRulesId="",this.isStatic=(void 0===r||r.isStatic)&&te(e),this.componentId=t,this.baseHash=K(re,t),this.baseStyle=r,H.registerId(t)}return e.prototype.generateAndInjectStyles=function(e,t,r){var n=this.componentId,o=[];if(this.baseStyle&&o.push(this.baseStyle.generateAndInjectStyles(e,t,r)),this.isStatic&&!r.hash)if(this.staticRulesId&&t.hasNameForId(n,this.staticRulesId))o.push(this.staticRulesId);else{var a=ve(this.rules,e,t,r).join(""),i=q(K(this.baseHash,a)>>>0);if(!t.hasNameForId(n,i)){var s=r(a,"."+i,void 0,n);t.insertRules(n,i,s)}o.push(i),this.staticRulesId=i}else{for(var c=this.rules.length,l=K(this.baseHash,r.hash),u="",d=0;d<c;d++){var f=this.rules[d];if("string"==typeof f)u+=f;else if(f){var g=ve(f,e,t,r),p=Array.isArray(g)?g.join(""):g;l=K(l,p+d),u+=p}}if(u){var h=q(l>>>0);if(!t.hasNameForId(n,h)){var m=r(u,"."+h,void 0,n);t.insertRules(n,h,m)}o.push(h)}}return o.join(" ")},e}(),oe=/^\s*\/\/.*$/gm,ae=[":","[",".","#"];function ie(e){var t,r,n,o,a=void 0===e?N:e,i=a.options,s=void 0===i?N:i,c=a.plugins,l=void 0===c?j:c,u=new f(s),d=[],g=function(e){function t(t){if(t)try{e(t+"}")}catch(e){}}return function(r,n,o,a,i,s,c,l,u,d){switch(r){case 1:if(0===u&&64===n.charCodeAt(0))return e(n+";"),"";break;case 2:if(0===l)return n+"/*|*/";break;case 3:switch(l){case 102:case 112:return e(o[0]+n),"";default:return n+(0===d?"/*|*/":"")}case-2:n.split("/*|*/}").forEach(t)}}}((function(e){d.push(e)})),p=function(e,n,a){return 0===n&&-1!==ae.indexOf(a[r.length])||a.match(o)?e:"."+t};function h(e,a,i,s){void 0===s&&(s="&");var c=e.replace(oe,""),l=a&&i?i+" "+a+" { "+c+" }":c;return t=s,r=a,n=new RegExp("\\"+r+"\\b","g"),o=new RegExp("(\\"+r+"\\b){2,}"),u(i||!a?"":a,l)}return u.use([].concat(l,[function(e,t,o){2===e&&o.length&&o[0].lastIndexOf(r)>0&&(o[0]=o[0].replace(n,p))},g,function(e){if(-2===e){var t=d;return d=[],t}}])),h.hash=l.length?l.reduce((function(e,t){return t.name||C(15),K(e,t.name)}),5381).toString():"",h}var se=r().createContext(),ce=(se.Consumer,r().createContext()),le=(ce.Consumer,new H),ue=ie();function de(){return(0,t.useContext)(se)||le}function fe(e){var n=(0,t.useState)(e.stylisPlugins),o=n[0],a=n[1],i=de(),s=(0,t.useMemo)((function(){var t=i;return e.sheet?t=e.sheet:e.target&&(t=t.reconstructWithOptions({target:e.target},!1)),e.disableCSSOMInjection&&(t=t.reconstructWithOptions({useCSSOMInjection:!1})),t}),[e.disableCSSOMInjection,e.sheet,e.target]),c=(0,t.useMemo)((function(){return ie({options:{prefix:!e.disableVendorPrefixes},plugins:o})}),[e.disableVendorPrefixes,o]);return(0,t.useEffect)((function(){d()(o,e.stylisPlugins)||a(e.stylisPlugins)}),[e.stylisPlugins]),r().createElement(se.Provider,{value:s},r().createElement(ce.Provider,{value:c},e.children))}var ge=function(){function e(e,t){var r=this;this.inject=function(e,t){void 0===t&&(t=ue);var n=r.name+t.hash;e.hasNameForId(r.id,n)||e.insertRules(r.id,n,t(r.rules,n,"@keyframes"))},this.toString=function(){return C(12,String(r.name))},this.name=e,this.id="sc-keyframes-"+e,this.rules=t}return e.prototype.getName=function(e){return void 0===e&&(e=ue),this.name+e.hash},e}(),pe=/([A-Z])/,he=/([A-Z])/g,me=/^ms-/,Me=function(e){return"-"+e.toLowerCase()};function ye(e){return pe.test(e)?e.replace(he,Me).replace(me,"-ms-"):e}var be=function(e){return null==e||!1===e||""===e};function ve(e,t,r,n){if(Array.isArray(e)){for(var o,a=[],i=0,s=e.length;i<s;i+=1)""!==(o=ve(e[i],t,r,n))&&(Array.isArray(o)?a.push.apply(a,o):a.push(o));return a}return be(e)?"":D(e)?"."+e.styledComponentId:A(e)?"function"!=typeof(c=e)||c.prototype&&c.prototype.isReactComponent||!t?e:ve(e(t),t,r,n):e instanceof ge?r?(e.inject(r,n),e.getName(n)):e:I(e)?function e(t,r){var n,o,a=[];for(var i in t)t.hasOwnProperty(i)&&!be(t[i])&&(Array.isArray(t[i])&&t[i].isCss||A(t[i])?a.push(ye(i)+":",t[i],";"):I(t[i])?a.push.apply(a,e(t[i],i)):a.push(ye(i)+": "+(n=i,(null==(o=t[i])||"boolean"==typeof o||""===o?"":"number"!=typeof o||0===o||n in g?String(o).trim():o+"px")+";")));return r?[r+" {"].concat(a,["}"]):a}(e):e.toString();var c}var Ie=function(e){return Array.isArray(e)&&(e.isCss=!0),e};function je(e){for(var t=arguments.length,r=new Array(t>1?t-1:0),n=1;n<t;n++)r[n-1]=arguments[n];return A(e)||I(e)?Ie(ve(v(j,[e].concat(r)))):0===r.length&&1===e.length&&"string"==typeof e[0]?e:Ie(ve(v(e,r)))}new Set;var Ne=/[!"#$%&'()*+,./:;<=>?@[\\\]^`{|}~-]+/g,Ae=/(^-|-$)/g;function we(e){return e.replace(Ne,"-").replace(Ae,"")}function De(e){return"string"==typeof e&&!0}var xe=function(e){return"function"==typeof e||"object"==typeof e&&null!==e&&!Array.isArray(e)},Se=function(e){return"__proto__"!==e&&"constructor"!==e&&"prototype"!==e};function ke(e,t,r){var n=e[r];xe(t)&&xe(n)?Ce(n,t):e[r]=t}function Ce(e){for(var t=arguments.length,r=new Array(t>1?t-1:0),n=1;n<t;n++)r[n-1]=arguments[n];for(var o=0,a=r;o<a.length;o++){var i=a[o];if(xe(i))for(var s in i)Se(s)&&ke(e,i[s],s)}return e}var ze=r().createContext();ze.Consumer;var Oe={};function Te(e,n,o){var a=D(e),i=!De(e),s=n.attrs,c=void 0===s?j:s,l=n.componentId,u=void 0===l?function(e,t){var r="string"!=typeof e?"sc":we(e);Oe[r]=(Oe[r]||0)+1;var n=r+"-"+function(e){return q(ee(e)>>>0)}("5.3.3"+r+Oe[r]);return t?t+"-"+n:n}(n.displayName,n.parentComponentId):l,d=n.displayName,f=void 0===d?function(e){return De(e)?"styled."+e:"Styled("+w(e)+")"}(e):d,g=n.displayName&&n.componentId?we(n.displayName)+"-"+n.componentId:n.componentId||u,p=a&&e.attrs?Array.prototype.concat(e.attrs,c).filter(Boolean):c,m=n.shouldForwardProp;a&&e.shouldForwardProp&&(m=n.shouldForwardProp?function(t,r,o){return e.shouldForwardProp(t,r,o)&&n.shouldForwardProp(t,r,o)}:e.shouldForwardProp);var M,v=new ne(o,g,a?e.componentStyle:void 0),I=v.isStatic&&0===c.length,x=function(e,r){return function(e,r,n,o){var a=e.attrs,i=e.componentStyle,s=e.defaultProps,c=e.foldedComponentIds,l=e.shouldForwardProp,u=e.styledComponentId,d=e.target,f=function(e,t,r){void 0===e&&(e=N);var n=b({},t,{theme:e}),o={};return r.forEach((function(e){var t,r,a,i=e;for(t in A(i)&&(i=i(n)),i)n[t]=o[t]="className"===t?(r=o[t],a=i[t],r&&a?r+" "+a:r||a):i[t]})),[n,o]}(function(e,t,r){return void 0===r&&(r=N),e.theme!==r.theme&&e.theme||t||r.theme}(r,(0,t.useContext)(ze),s)||N,r,a),g=f[0],p=f[1],m=function(e,r,n,o){var a=de(),i=(0,t.useContext)(ce)||ue;return r?e.generateAndInjectStyles(N,a,i):e.generateAndInjectStyles(n,a,i)}(i,o,g),M=n,y=p.$as||r.$as||p.as||r.as||d,v=De(y),I=p!==r?b({},r,{},p):r,j={};for(var w in I)"$"!==w[0]&&"as"!==w&&("forwardedAs"===w?j.as=I[w]:(l?l(w,h,y):!v||h(w))&&(j[w]=I[w]));return r.style&&p.style!==r.style&&(j.style=b({},r.style,{},p.style)),j.className=Array.prototype.concat(c,u,m!==u?m:null,r.className,p.className).filter(Boolean).join(" "),j.ref=M,(0,t.createElement)(y,j)}(M,e,r,I)};return x.displayName=f,(M=r().forwardRef(x)).attrs=p,M.componentStyle=v,M.displayName=f,M.shouldForwardProp=m,M.foldedComponentIds=a?Array.prototype.concat(e.foldedComponentIds,e.styledComponentId):j,M.styledComponentId=g,M.target=a?e.target:e,M.withComponent=function(e){var t=n.componentId,r=function(e,t){if(null==e)return{};var r,n,o={},a=Object.keys(e);for(n=0;n<a.length;n++)r=a[n],t.indexOf(r)>=0||(o[r]=e[r]);return o}(n,["componentId"]),a=t&&t+"-"+(De(e)?e:we(w(e)));return Te(e,b({},r,{attrs:p,componentId:a}),o)},Object.defineProperty(M,"defaultProps",{get:function(){return this._foldedDefaultProps},set:function(t){this._foldedDefaultProps=a?Ce({},e.defaultProps,t):t}}),M.toString=function(){return"."+M.styledComponentId},i&&y()(M,e,{attrs:!0,componentStyle:!0,displayName:!0,foldedComponentIds:!0,shouldForwardProp:!0,styledComponentId:!0,target:!0,withComponent:!0}),M}var Ee,Le=function(e){return function e(t,r,n){if(void 0===n&&(n=N),!(0,l.isValidElementType)(r))return C(1,String(r));var o=function(){return t(r,n,je.apply(void 0,arguments))};return o.withConfig=function(o){return e(t,r,b({},n,{},o))},o.attrs=function(o){return e(t,r,b({},n,{attrs:Array.prototype.concat(n.attrs,o).filter(Boolean)}))},o}(Te,e)};["a","abbr","address","area","article","aside","audio","b","base","bdi","bdo","big","blockquote","body","br","button","canvas","caption","cite","code","col","colgroup","data","datalist","dd","del","details","dfn","dialog","div","dl","dt","em","embed","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","iframe","img","input","ins","kbd","keygen","label","legend","li","link","main","map","mark","marquee","menu","menuitem","meta","meter","nav","noscript","object","ol","optgroup","option","output","p","param","picture","pre","progress","q","rp","rt","ruby","s","samp","script","section","select","small","source","span","strong","style","sub","summary","sup","table","tbody","td","textarea","tfoot","th","thead","time","title","tr","track","u","ul","var","video","wbr","circle","clipPath","defs","ellipse","foreignObject","g","image","line","linearGradient","marker","mask","path","pattern","polygon","polyline","radialGradient","rect","stop","svg","text","textPath","tspan"].forEach((function(e){Le[e]=Le(e)})),Ee=function(e,t){this.rules=e,this.componentId=t,this.isStatic=te(e),H.registerId(this.componentId+1)}.prototype,Ee.createStyles=function(e,t,r,n){var o=n(ve(this.rules,t,r,n).join(""),""),a=this.componentId+e;r.insertRules(a,a,o)},Ee.removeStyles=function(e,t){t.clearRules(this.componentId+e)},Ee.renderStyles=function(e,t,r,n){e>2&&H.registerId(this.componentId+e),this.removeStyles(e,r),this.createStyles(e,t,r,n)},function(){var e=function(){var e=this;this._emitSheetCSS=function(){var t=e.instance.toString();if(!t)return"";var r=Q();return"<style "+[r&&'nonce="'+r+'"',x+'="true"','data-styled-version="5.3.3"'].filter(Boolean).join(" ")+">"+t+"</style>"},this.getStyleTags=function(){return e.sealed?C(2):e._emitSheetCSS()},this.getStyleElement=function(){var t;if(e.sealed)return C(2);var n=((t={})[x]="",t["data-styled-version"]="5.3.3",t.dangerouslySetInnerHTML={__html:e.instance.toString()},t),o=Q();return o&&(n.nonce=o),[r().createElement("style",b({},n,{key:"sc-0-0"}))]},this.seal=function(){e.sealed=!0},this.instance=new H({isServer:!0}),this.sealed=!1}.prototype;e.collectStyles=function(e){return this.sealed?C(2):r().createElement(fe,{sheet:this.instance},e)},e.interleaveWithNodeStream=function(e){return C(3)}}();const Ye=Le,Re=Ye.div`
opacity: 0;

@@ -4,0 +4,0 @@

@@ -1,1 +0,1 @@

"use strict";(self.webpackChunk_r2u_viewer=self.webpackChunk_r2u_viewer||[]).push([[628],{497:(e,t,i)=>{i.r(t),i.d(t,{default:()=>F});var s=i(657),a=i(531),o=i.n(a),r=i(970),n=i(687),h=i(341),l=i(884);class d extends(o()){constructor({modelSource:e,environmentSource:t,progress:i,bloomButton:a,canvas:o,renderer:d}){super(),this.progress=i,this.bloomButton=a,this.loadingManager=new s.lLk((()=>{this.progress.style.transition="opacity 1s ease-in-out",this.progress.style.opacity="0",this.bloomButton.style.transition="opacity 0.5s ease-in-out",this.bloomButton.style.opacity="1",this.bloomButton.style.height="60px",o.classList.add("active")}),((e,t,i)=>{this.progress.style.transition="",this.progress.style.transform=`scaleX(${t/i})`})),this.modelSource=e,this.environmentSource=t,this.gltfLoader=new n.E(this.loadingManager),this.dracoLoader=new r._(this.loadingManager),this.dracoLoader.setDecoderPath("https://www.gstatic.com/draco/versioned/decoders/1.4.1/"),this.gltfLoader.setDRACOLoader(this.dracoLoader),this.ktx2Loader=new h.a(this.loadingManager),this.ktx2Loader.setTranscoderPath("https://www.gstatic.com/basis-universal/versioned/2021-04-15-ba1c3e4/").detectSupport(d.instance),this.gltfLoader.setKTX2Loader(this.ktx2Loader),this.rgbeLoader=new l.x(this.loadingManager),Promise.all([new Promise((e=>{this.gltfLoader.load(this.modelSource,e)})),new Promise((e=>{this.rgbeLoader.load(this.environmentSource,e)}))]).then((([e,t])=>{this.model=e.scene,this.animations=e.animations,this.environmentTexture=t,this.environmentTexture.mapping=s.dSO,this.environmentTexture.name=this.environmentSource,this.emit("modelReady"),this.emit("environmentReady"),this.emit("ready")}))}resetLoadingBar(){this.progress.style.transform="scaleX(0)",this.progress.style.transition="none",this.progress.style.opacity=""}updateEnvironment(e){this.resetLoadingBar(),this.rgbeLoader.load(e,(t=>{const i=this.environmentTexture;this.environmentTexture=t,this.environmentTexture.mapping=s.dSO,this.environmentTexture.name=e,null==i||i.dispose(),this.emit("environmentReady")}))}updateGlb(e){this.resetLoadingBar(),this.emit("modelDispose"),this.gltfLoader.load(e,(e=>{this.model=e.scene,this.animations=e.animations,this.emit("modelReady")}))}loadGlb(e){return t=this,i=void 0,a=function*(){return this.gltfLoader.loadAsync(e)},new((s=void 0)||(s=Promise))((function(e,o){function r(e){try{h(a.next(e))}catch(e){o(e)}}function n(e){try{h(a.throw(e))}catch(e){o(e)}}function h(t){var i;t.done?e(t.value):(i=t.value,i instanceof s?i:new s((function(e){e(i)}))).then(r,n)}h((a=a.apply(t,i||[])).next())}));var t,i,s,a}}class m extends(o()){constructor(e){super(),this.canvas=e,this.width=e.offsetWidth,this.height=e.offsetHeight,this.pixelRatio=Math.min(window.devicePixelRatio,2),window.ResizeObserver&&(this.resizeObserver=new ResizeObserver((()=>this.updateSizes())),this.resizeObserver.observe(this.canvas)),window.addEventListener("resize",(()=>this.updateSizes()))}updateSizes(){this.width=this.canvas.offsetWidth,this.height=this.canvas.offsetHeight,this.pixelRatio=Math.min(window.devicePixelRatio,2),this.emit("resize")}}class c extends(o()){constructor(){super(),this.start=Date.now(),this.current=this.start,this.elapsed=0,this.delta=1,window.requestAnimationFrame((()=>this.tick()))}tick(){const e=Date.now();this.delta=e-this.current,this.current=e,this.elapsed=this.current-this.start,this.emit("tick"),window.requestAnimationFrame((()=>this.tick()))}}class u{constructor(e=50){this.velocity=0,this.naturalFrequency=0,this.setDecayTime(e)}setDecayTime(e){this.naturalFrequency=1/Math.max(.001,e)}update(e,t,i,s){const a=2e-4*this.naturalFrequency;if(null==e||0===s)return t;if(e===t&&0===this.velocity)return t;if(i<0)return e;const o=e-t,r=this.velocity+this.naturalFrequency*o,n=o+i*r,h=Math.exp(-this.naturalFrequency*i),l=(r-this.naturalFrequency*n)*h,d=-this.naturalFrequency*(l+r*h);return Math.abs(l)<a*Math.abs(s)&&d*o>=0?(this.velocity=0,t):(this.velocity=l,t+n*h)}}const g=Math.PI/1e3,p=Math.PI/6,v=2*Math.PI;class M{constructor({experience:e,controls:t}){this.canvas=e.canvas,this.instructionsImg=e.instructionsImg,this.controls=t,this.time=e.time,this.angleAnimation=0,this.elapsedAnimation=0,this.elapsedImgAnimation=0,this.damperImgAnimation=new u,this.idle=!1,this.active=!1,this.canvas.addEventListener("touchstart",(()=>{this.active=!1,clearTimeout(this.startTimer)})),this.canvas.addEventListener("mousedown",(()=>{this.active=!1,clearTimeout(this.startTimer)}))}play(){this.startTimer=setTimeout((()=>{this.active=!0}),2e3)}stop(){this.active=!1}update(){this.active?(this.idle||(this.elapsedAnimation+=g*this.time.delta,this.instructionsImg.style.opacity="1"),this.elapsedAnimation>v&&(this.idle=!0,this.instructionsImg.style.opacity="0",this.elapsedAnimation=v,setTimeout((()=>{this.elapsedAnimation=0,this.elapsedImgAnimation=0,this.idle=!1}),2e3)),this.angleAnimation=Math.sin(this.elapsedAnimation)*p,this.elapsedImgAnimation=this.damperImgAnimation.update(this.elapsedImgAnimation,this.elapsedAnimation,this.time.delta,1),this.instructionsImg.style.transform=`translate(calc(-50% + ${-Math.sin(this.elapsedImgAnimation)}*50px), -50%)`):this.instructionsImg.style.opacity="0"}}const f=Math.PI/2.4,A=Math.PI/10;class x{constructor(e,t,i){this.ORBIT_SENSITIVITY=e.orbitSensitivity,this.MIN_CAMERA_SCROLL=2,this.MAX_CAMERA_SCROLL=10,this.DEFAULT_CAMERA_SCROLL=4,this.MAX_XZ_ANGLE=e.maxAzimuthalAngleRotation*Math.PI/180,this.MIN_XZ_ANGLE=e.minAzimuthalAngleRotation*Math.PI/180,e.maxPolarAngleRotation&&(this.MAX_Y_ANGLE=e.maxPolarAngleRotation*Math.PI/180),e.minPolarAngleRotation&&(this.MIN_Y_ANGLE=e.minPolarAngleRotation*Math.PI/180),this.MAX_X_PAN=e.maxDragX,this.MIN_X_PAN=e.minDragX,this.MAX_Y_PAN=e.maxDragY,this.MIN_Y_PAN=e.minDragY,this.MAX_Z_PAN=e.maxDragZ,this.MIN_Z_PAN=e.minDragZ,this.canvas=e.canvas,this.camera=t,this.time=e.time,this.damperRadius=new u,this.damperYAngle=new u,this.damperXZAngle=new u,this.damperXPan=new u,this.damperYPan=new u,this.damperZPan=new u,this.canvas.oncontextmenu=e=>e.preventDefault(),this.yAngleTarget=f,this.xzAngleTarget=A,this.yAngle=f,this.xzAngle=A,this.orbitCamera=!1,this.moveCamera=!1,this.panTarget=new s.Pa4,this.pan=new s.Pa4,i?(this.cameraRadius=i,this.cameraRadiusTarget=i):(this.cameraRadius=this.DEFAULT_CAMERA_SCROLL,this.cameraRadiusTarget=this.DEFAULT_CAMERA_SCROLL),this.pageMode="none",this.addDragEventListener(),this.addWheelEventListener(),this.addTouchEventListener(),this.animation=new M({experience:e,controls:this})}addDragEventListener(){let e=0,t=0;this.canvas.onmousedown=i=>{i.stopPropagation(),0===i.button?(this.orbitCamera=!0,this.canvas.style.cursor="grabbing"):(this.moveCamera=!0,this.canvas.style.cursor="move"),e=i.clientX,t=i.clientY},document.addEventListener("mouseup",(()=>{this.orbitCamera=!1,this.moveCamera=!1,this.canvas.style.cursor=""})),this.canvas.addEventListener("mousemove",(i=>{if(this.orbitCamera)this.yAngleTarget+=this.ORBIT_SENSITIVITY*Math.PI*2*((e-i.clientX)/this.canvas.width),e=i.clientX,this.xzAngleTarget+=this.ORBIT_SENSITIVITY*Math.PI*2*((i.clientY-t)/this.canvas.height),t=i.clientY,this.xzAngleTarget<this.MIN_XZ_ANGLE&&(this.xzAngleTarget=this.MIN_XZ_ANGLE),this.xzAngleTarget>this.MAX_XZ_ANGLE&&(this.xzAngleTarget=this.MAX_XZ_ANGLE),this.MIN_Y_ANGLE&&this.yAngleTarget<this.MIN_Y_ANGLE&&(this.yAngleTarget=this.MIN_Y_ANGLE),this.MAX_Y_ANGLE&&this.yAngleTarget>this.MAX_Y_ANGLE&&(this.yAngleTarget=this.MAX_Y_ANGLE);else if(this.moveCamera){const a=.8*this.cameraRadius*(e-i.clientX)/this.canvas.width;e=i.clientX;const o=.8*this.cameraRadius*(i.clientY-t)/this.canvas.height;t=i.clientY,this.panTarget.add(new s.Pa4(a*Math.cos(this.yAngleTarget)+o*Math.sin(this.xzAngleTarget)*Math.sin(-this.yAngleTarget),o*Math.cos(this.xzAngleTarget),a*Math.sin(-this.yAngleTarget)+o*Math.sin(-this.xzAngleTarget)*Math.cos(this.yAngleTarget))),null!==this.MIN_X_PAN&&void 0!==this.MIN_X_PAN&&this.panTarget.x<this.MIN_X_PAN&&(this.panTarget.x=this.MIN_X_PAN),null!==this.MAX_X_PAN&&void 0!==this.MAX_X_PAN&&this.panTarget.x>this.MAX_X_PAN&&(this.panTarget.x=this.MAX_X_PAN),null!==this.MIN_Y_PAN&&void 0!==this.MIN_Y_PAN&&this.panTarget.y<this.MIN_Y_PAN&&(this.panTarget.y=this.MIN_Y_PAN),null!==this.MAX_Y_PAN&&void 0!==this.MAX_Y_PAN&&this.panTarget.y>this.MAX_Y_PAN&&(this.panTarget.y=this.MAX_Y_PAN),null!==this.MIN_Z_PAN&&void 0!==this.MIN_Z_PAN&&this.panTarget.z<this.MIN_Z_PAN&&(this.panTarget.z=this.MIN_Z_PAN),null!==this.MAX_Z_PAN&&void 0!==this.MAX_Z_PAN&&this.panTarget.z>this.MAX_Z_PAN&&(this.panTarget.z=this.MAX_Z_PAN)}}))}addWheelEventListener(){let e;this.canvas.onwheel=t=>{t.preventDefault(),t.deltaY>0?(this.cameraRadiusTarget+=.003*t.deltaY*this.cameraRadius,this.canvas.style.cursor="zoom-out"):(this.cameraRadiusTarget+=.003*t.deltaY*this.cameraRadius/2,this.canvas.style.cursor="zoom-in"),this.cameraRadiusTarget>this.MAX_CAMERA_SCROLL&&(this.cameraRadiusTarget=this.MAX_CAMERA_SCROLL),this.cameraRadiusTarget<this.MIN_CAMERA_SCROLL&&(this.cameraRadiusTarget=this.MIN_CAMERA_SCROLL),e&&clearTimeout(e),e=setTimeout((()=>{this.canvas.style.cursor=""}),300)}}addTouchEventListener(){let e=0,t=0;document.addEventListener("touchstart",(i=>{e=i.touches[0].clientX,t=i.touches[0].clientY})),document.addEventListener("touchmove",(i=>{"movingCamera"!==this.pageMode&&"orbitingCamera"!==this.pageMode&&"zoomingCamera"!==this.pageMode&&Math.abs(i.touches[0].clientY-t)>Math.abs(i.touches[0].clientX-e)&&(this.pageMode="scrolling")}));let i=0,a=0,o=0;this.canvas.ontouchstart=e=>{1===e.touches.length?(i=e.touches[0].clientX,a=e.touches[0].clientY):2===e.touches.length&&(this.pageMode="movingCamera",i=(e.touches[0].clientX+e.touches[1].clientX)/2,a=(e.touches[0].clientY+e.touches[1].clientY)/2,o=Math.hypot(e.touches[0].pageX-e.touches[1].pageX,e.touches[0].pageY-e.touches[1].pageY))},document.addEventListener("touchend",(e=>{"movingCamera"===this.pageMode||"zoomingCamera"===this.pageMode?(this.pageMode="orbitingCamera",i=e.touches[0].clientX,a=e.touches[0].clientY):this.pageMode="none"})),this.canvas.addEventListener("touchmove",(e=>{if("scrolling"!==this.pageMode&&e.cancelable)if(Math.abs(e.touches[0].clientY-a)<=Math.abs(e.touches[0].clientX-i)&&"none"===this.pageMode&&(this.pageMode="orbitingCamera"),"movingCamera"!==this.pageMode&&"orbitingCamera"!==this.pageMode&&"zoomingCamera"!==this.pageMode||e.preventDefault(),"orbitingCamera"===this.pageMode)this.yAngleTarget+=this.ORBIT_SENSITIVITY*Math.PI*2*((i-e.touches[0].pageX)/this.canvas.width),i=e.touches[0].pageX,this.xzAngleTarget+=this.ORBIT_SENSITIVITY*Math.PI*2*((e.touches[0].pageY-a)/this.canvas.height),a=e.touches[0].pageY,this.xzAngleTarget<this.MIN_XZ_ANGLE&&(this.xzAngleTarget=this.MIN_XZ_ANGLE),this.xzAngleTarget>this.MAX_XZ_ANGLE&&(this.xzAngleTarget=this.MAX_XZ_ANGLE),this.MIN_Y_ANGLE&&this.yAngleTarget<this.MIN_Y_ANGLE&&(this.yAngleTarget=this.MIN_Y_ANGLE),this.MAX_Y_ANGLE&&this.yAngleTarget>this.MAX_Y_ANGLE&&(this.yAngleTarget=this.MAX_Y_ANGLE);else if("movingCamera"===this.pageMode){Math.abs(Math.hypot(e.touches[0].pageX-e.touches[1].pageX,e.touches[0].pageY-e.touches[1].pageY)-o)>50&&(o=Math.hypot(e.touches[0].pageX-e.touches[1].pageX,e.touches[0].pageY-e.touches[1].pageY),this.pageMode="zoomingCamera");const t=(e.touches[0].clientX+e.touches[1].clientX)/2,r=(e.touches[0].clientY+e.touches[1].clientY)/2,n=1.6*this.cameraRadius*(i-t)/this.canvas.width;i=t;const h=1.6*this.cameraRadius*(r-a)/this.canvas.height;a=r,this.panTarget.add(new s.Pa4(n*Math.cos(this.yAngleTarget)+h*Math.sin(this.xzAngleTarget)*Math.sin(-this.yAngleTarget),h*Math.cos(this.xzAngleTarget),n*Math.sin(-this.yAngleTarget)+h*Math.sin(-this.xzAngleTarget)*Math.cos(this.yAngleTarget))),null!==this.MIN_X_PAN&&void 0!==this.MIN_X_PAN&&this.panTarget.x<this.MIN_X_PAN&&(this.panTarget.x=this.MIN_X_PAN),null!==this.MAX_X_PAN&&void 0!==this.MAX_X_PAN&&this.panTarget.x>this.MAX_X_PAN&&(this.panTarget.x=this.MAX_X_PAN),null!==this.MIN_Y_PAN&&void 0!==this.MIN_Y_PAN&&this.panTarget.y<this.MIN_Y_PAN&&(this.panTarget.y=this.MIN_Y_PAN),null!==this.MAX_Y_PAN&&void 0!==this.MAX_Y_PAN&&this.panTarget.y>this.MAX_Y_PAN&&(this.panTarget.y=this.MAX_Y_PAN),null!==this.MIN_Z_PAN&&void 0!==this.MIN_Z_PAN&&this.panTarget.z<this.MIN_Z_PAN&&(this.panTarget.z=this.MIN_Z_PAN),null!==this.MAX_Z_PAN&&void 0!==this.MAX_Z_PAN&&this.panTarget.z>this.MAX_Z_PAN&&(this.panTarget.z=this.MAX_Z_PAN)}else if("zoomingCamera"===this.pageMode){const t=Math.hypot(e.touches[0].pageX-e.touches[1].pageX,e.touches[0].pageY-e.touches[1].pageY)-o;this.cameraRadiusTarget-=.03*t,o+=t,this.cameraRadiusTarget>this.MAX_CAMERA_SCROLL&&(this.cameraRadiusTarget=this.MAX_CAMERA_SCROLL),this.cameraRadiusTarget<this.MIN_CAMERA_SCROLL&&(this.cameraRadiusTarget=this.MIN_CAMERA_SCROLL)}}))}setCamera({radius:e,minRadius:t,maxRadius:i,initialRadius:s,orbitSensitivity:a,azimuthalAngle:o,maxAzimuthalAngle:r,minAzimuthalAngle:n,polarAngle:h,maxPolarAngle:l,minPolarAngle:d,dragX:m,maxDragX:c,minDragX:u,dragY:g,maxDragY:p,minDragY:v,dragZ:M,maxDragZ:f,minDragZ:A,near:x,far:T}){void 0!==e&&(this.cameraRadiusTarget=0===e?.01:e),void 0!==t&&(this.MIN_CAMERA_SCROLL=0===t?.01:t),void 0!==i&&(this.MAX_CAMERA_SCROLL=0===i?.01:i),void 0!==s&&(this.DEFAULT_CAMERA_SCROLL=0===s?.01:s),void 0!==a&&(this.ORBIT_SENSITIVITY=0===a?.01:a),void 0!==r&&(this.MAX_XZ_ANGLE=0===r?.01:r*Math.PI/180),void 0!==n&&(this.MIN_XZ_ANGLE=0===n?-.01:n*Math.PI/180),void 0!==l&&(this.MAX_Y_ANGLE=0===l?.01:l*Math.PI/180),void 0!==d&&(this.MIN_Y_ANGLE=0===d?-.01:d*Math.PI/180),void 0!==c&&(this.MAX_X_PAN=0===c?.01:c),void 0!==u&&(this.MIN_X_PAN=0===u?.01:u),void 0!==p&&(this.MAX_Y_PAN=0===p?.01:p),void 0!==v&&(this.MIN_Y_PAN=0===v?.01:v),void 0!==f&&(this.MAX_Z_PAN=0===f?.01:f),void 0!==A&&(this.MIN_Z_PAN=0===A?.01:A),void 0!==x&&(this.camera.near=0===x?.01:x),void 0!==T&&(this.camera.far=0===T?.01:T),void 0!==o&&(this.xzAngleTarget=o*Math.PI/180),void 0!==h&&(this.yAngleTarget=h*Math.PI/180),void 0!==m&&(this.panTarget.x=m),void 0!==g&&(this.panTarget.y=g),void 0!==M&&(this.panTarget.z=M),this.camera.updateProjectionMatrix()}getCamera(){return{radius:this.cameraRadiusTarget,orbitSensitivity:this.ORBIT_SENSITIVITY,azimuthalAngle:180*this.xzAngleTarget/Math.PI,polarAngle:180*this.yAngleTarget/Math.PI,dragX:this.panTarget.x,dragY:this.panTarget.y,dragZ:this.panTarget.z,near:this.camera.near,far:this.camera.near}}update(){this.animation.update(),this.yAngle=this.damperYAngle.update(this.yAngle,this.yAngleTarget+this.animation.angleAnimation,this.time.delta,1),this.xzAngle=this.damperXZAngle.update(this.xzAngle,this.xzAngleTarget,this.time.delta,1),this.cameraRadius=this.damperRadius.update(this.cameraRadius,this.cameraRadiusTarget,this.time.delta,1),this.pan.x=this.damperXPan.update(this.pan.x,this.panTarget.x,this.time.delta,1),this.pan.y=this.damperYPan.update(this.pan.y,this.panTarget.y,this.time.delta,1),this.pan.z=this.damperZPan.update(this.pan.z,this.panTarget.z,this.time.delta,1),this.camera.position.x=Math.cos(this.xzAngle)*Math.sin(this.yAngle)*this.cameraRadius,this.camera.position.y=Math.sin(this.xzAngle)*this.cameraRadius,this.camera.position.z=Math.cos(this.xzAngle)*Math.cos(this.yAngle)*this.cameraRadius,this.camera.position.add(this.pan),this.camera.lookAt(this.pan)}}class T{constructor(e){this.instance=null,this.experience=e,this.canvas=this.experience.canvas,this.sizes=this.experience.sizes,this.scene=this.experience.scene;const t=this.experience.cameraNear?this.experience.cameraNear:.1,i=this.experience.cameraFar?this.experience.cameraFar:100;this.instance=new s.cPb(35,this.sizes.width/this.sizes.height,t,i),this.instance.position.set(1,1,4),this.scene.add(this.instance),this.controls=new x(this.experience,this.instance,this.experience.initialZoom)}resize(){this.instance&&(this.instance.aspect=this.sizes.width/this.sizes.height,this.instance.updateProjectionMatrix())}update(){this.controls.update()}}class _{constructor(e){this.instance=null,this.canvas=e.canvas,this.sizes=e.sizes,this.scene=e.scene,this.camera=e.camera,this.instance=new s.CP7({canvas:this.canvas,antialias:!0,alpha:!0,powerPreference:"high-performance"}),this.instance.setSize(this.sizes.width,this.sizes.height),this.instance.setPixelRatio(this.sizes.pixelRatio),this.instance.setClearColor("",0),this.instance.setClearAlpha(0),this.instance.autoClear=!0,this.instance.shadowMap.enabled=!0,this.instance.shadowMap.type=s.dwk,this.instance.physicallyCorrectLights=!0,this.instance.outputEncoding=s.knz,this.instance.toneMapping=s.LY2,this.instance.toneMappingExposure=e.exposure}resize(){var e,t;null===(e=this.instance)||void 0===e||e.setSize(this.sizes.width,this.sizes.height),null===(t=this.instance)||void 0===t||t.setPixelRatio(this.sizes.pixelRatio)}update(){this.instance&&this.camera.instance&&this.instance.render(this.scene,this.camera.instance)}}var w=i(870);var b=i(643),P=i(220),y=i(175),N=i(475),S=i(612),C=i(248),z=i(655);class I extends S.w{constructor(e,t,i,a){super(),this.strength=void 0!==t?t:1,this.radius=i,this.threshold=a,this.resolution=void 0!==e?new s.FM8(e.x,e.y):new s.FM8(256,256),this.clearColor=new s.Ilk(0,0,0);const o={minFilter:s.wem,magFilter:s.wem,format:s.wk1};this.renderTargetsHorizontal=[],this.renderTargetsVertical=[],this.nMips=5;let r=Math.round(this.resolution.x/2),n=Math.round(this.resolution.y/2);this.renderTargetBright=new s.dd2(r,n,o),this.renderTargetBright.texture.name="UnrealBloomPass.bright",this.renderTargetBright.texture.generateMipmaps=!1;for(let e=0;e<this.nMips;e++){const t=new s.dd2(r,n,o);t.texture.name=`UnrealBloomPass.h${e}`,t.texture.generateMipmaps=!1,this.renderTargetsHorizontal.push(t);const i=new s.dd2(r,n,o);i.texture.name=`UnrealBloomPass.v${e}`,i.texture.generateMipmaps=!1,this.renderTargetsVertical.push(i),r=Math.round(r/2),n=Math.round(n/2)}void 0===z.Y&&console.error("THREE.UnrealBloomPass relies on LuminosityHighPassShader");const h=z.Y;this.highPassUniforms=s.rDY.clone(h.uniforms),this.highPassUniforms.luminosityThreshold.value=a,this.highPassUniforms.smoothWidth.value=.01,this.materialHighPassFilter=new s.jyz({uniforms:this.highPassUniforms,vertexShader:h.vertexShader,fragmentShader:h.fragmentShader,defines:{}}),this.separableBlurMaterials=[];const l=[3,5,7,9,11];r=Math.round(this.resolution.x/2),n=Math.round(this.resolution.y/2);for(let e=0;e<this.nMips;e++)this.separableBlurMaterials.push(this.getSeperableBlurMaterial(l[e])),this.separableBlurMaterials[e].uniforms.texSize.value=new s.FM8(r,n),r=Math.round(r/2),n=Math.round(n/2);this.compositeMaterial=this.getCompositeMaterial(this.nMips),this.compositeMaterial.uniforms.blurTexture1.value=this.renderTargetsVertical[0].texture,this.compositeMaterial.uniforms.blurTexture2.value=this.renderTargetsVertical[1].texture,this.compositeMaterial.uniforms.blurTexture3.value=this.renderTargetsVertical[2].texture,this.compositeMaterial.uniforms.blurTexture4.value=this.renderTargetsVertical[3].texture,this.compositeMaterial.uniforms.blurTexture5.value=this.renderTargetsVertical[4].texture,this.compositeMaterial.uniforms.bloomStrength.value=t,this.compositeMaterial.uniforms.bloomRadius.value=.1,this.compositeMaterial.needsUpdate=!0,this.compositeMaterial.uniforms.bloomFactors.value=[1,.8,.6,.4,.2],this.bloomTintColors=[new s.Pa4(1,1,1),new s.Pa4(1,1,1),new s.Pa4(1,1,1),new s.Pa4(1,1,1),new s.Pa4(1,1,1)],this.compositeMaterial.uniforms.bloomTintColors.value=this.bloomTintColors,void 0===C.C&&console.error("THREE.UnrealBloomPass relies on CopyShader");const d=C.C;this.copyUniforms=s.rDY.clone(d.uniforms),this.copyUniforms.opacity.value=1,this.materialCopy=new s.jyz({uniforms:this.copyUniforms,vertexShader:d.vertexShader,fragmentShader:d.fragmentShader,blending:s.WMw,depthTest:!1,depthWrite:!1,transparent:!0}),this.enabled=!0,this.needsSwap=!1,this._oldClearColor=new s.Ilk,this.oldClearAlpha=1,this.basic=new s.vBJ,this.fsQuad=new S.T(null)}dispose(){for(let e=0;e<this.renderTargetsHorizontal.length;e++)this.renderTargetsHorizontal[e].dispose();for(let e=0;e<this.renderTargetsVertical.length;e++)this.renderTargetsVertical[e].dispose();this.renderTargetBright.dispose()}setSize(e,t){let i=Math.round(e/2),a=Math.round(t/2);this.renderTargetBright.setSize(i,a);for(let e=0;e<this.nMips;e++)this.renderTargetsHorizontal[e].setSize(i,a),this.renderTargetsVertical[e].setSize(i,a),this.separableBlurMaterials[e].uniforms.texSize.value=new s.FM8(i,a),i=Math.round(i/2),a=Math.round(a/2)}render(e,t,i,s,a){e.getClearColor(this._oldClearColor),this.oldClearAlpha=e.getClearAlpha();const o=e.autoClear;e.autoClear=!1,e.setClearColor(this.clearColor,0),a&&e.state.buffers.stencil.setTest(!1),this.renderToScreen&&(this.fsQuad.material=this.basic,this.basic.map=i.texture,e.setRenderTarget(null),e.clear(),this.fsQuad.render(e)),this.highPassUniforms.tDiffuse.value=i.texture,this.highPassUniforms.luminosityThreshold.value=this.threshold,this.fsQuad.material=this.materialHighPassFilter,e.setRenderTarget(this.renderTargetBright),e.clear(),this.fsQuad.render(e);let r=this.renderTargetBright;for(let t=0;t<this.nMips;t++)this.fsQuad.material=this.separableBlurMaterials[t],this.separableBlurMaterials[t].uniforms.colorTexture.value=r.texture,this.separableBlurMaterials[t].uniforms.direction.value=I.BlurDirectionX,e.setRenderTarget(this.renderTargetsHorizontal[t]),e.clear(),this.fsQuad.render(e),this.separableBlurMaterials[t].uniforms.colorTexture.value=this.renderTargetsHorizontal[t].texture,this.separableBlurMaterials[t].uniforms.direction.value=I.BlurDirectionY,e.setRenderTarget(this.renderTargetsVertical[t]),e.clear(),this.fsQuad.render(e),r=this.renderTargetsVertical[t];this.fsQuad.material=this.compositeMaterial,this.compositeMaterial.uniforms.bloomStrength.value=this.strength,this.compositeMaterial.uniforms.bloomRadius.value=this.radius,this.compositeMaterial.uniforms.bloomTintColors.value=this.bloomTintColors,e.setRenderTarget(this.renderTargetsHorizontal[0]),e.clear(),this.fsQuad.render(e),this.fsQuad.material=this.materialCopy,this.copyUniforms.tDiffuse.value=this.renderTargetsHorizontal[0].texture,a&&e.state.buffers.stencil.setTest(!0),this.renderToScreen?(e.setRenderTarget(null),this.fsQuad.render(e)):(e.setRenderTarget(i),this.fsQuad.render(e)),e.setClearColor(this._oldClearColor,this.oldClearAlpha),e.autoClear=o}getSeperableBlurMaterial(e){return new s.jyz({defines:{KERNEL_RADIUS:e,SIGMA:e},uniforms:{colorTexture:{value:null},texSize:{value:new s.FM8(.5,.5)},direction:{value:new s.FM8(.5,.5)}},vertexShader:"varying vec2 vUv;\n void main() {\n vUv = uv;\n gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n }",fragmentShader:"#include <common>\n varying vec2 vUv;\n uniform sampler2D colorTexture;\n uniform vec2 texSize;\n uniform vec2 direction;\n float gaussianPdf(in float x, in float sigma) {\n return 0.39894 * exp( -0.5 * x * x/( sigma * sigma))/sigma;\n }\n void main() {\n vec2 invSize = 1.0 / texSize; float fSigma = float(SIGMA); float weightSum = gaussianPdf(0.0, fSigma); float alphaSum = 0.0; vec3 diffuseSum = texture2D( colorTexture, vUv).rgb * weightSum; for( int i = 1; i < KERNEL_RADIUS; i ++ ) { float x = float(i); float w = gaussianPdf(x, fSigma); vec2 uvOffset = direction * invSize * x; vec4 sample1 = texture2D( colorTexture, vUv + uvOffset); vec4 sample2 = texture2D( colorTexture, vUv - uvOffset); diffuseSum += (sample1.rgb + sample2.rgb) * w; alphaSum += (sample1.a + sample2.a) * w; weightSum += 2.0 * w; } gl_FragColor = vec4(diffuseSum/weightSum, alphaSum/weightSum);\n }"})}getCompositeMaterial(e){return new s.jyz({defines:{NUM_MIPS:e},uniforms:{blurTexture1:{value:null},blurTexture2:{value:null},blurTexture3:{value:null},blurTexture4:{value:null},blurTexture5:{value:null},dirtTexture:{value:null},bloomStrength:{value:1},bloomFactors:{value:null},bloomTintColors:{value:null},bloomRadius:{value:0}},vertexShader:"varying vec2 vUv;\n void main() {\n vUv = uv;\n gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n }",fragmentShader:"varying vec2 vUv;\n uniform sampler2D blurTexture1;\n uniform sampler2D blurTexture2;\n uniform sampler2D blurTexture3;\n uniform sampler2D blurTexture4;\n uniform sampler2D blurTexture5;\n uniform sampler2D dirtTexture;\n uniform float bloomStrength;\n uniform float bloomRadius;\n uniform float bloomFactors[NUM_MIPS];\n uniform vec3 bloomTintColors[NUM_MIPS];\n float lerpBloomFactor(const in float factor) {\n float mirrorFactor = 1.2 - factor;\n return mix(factor, mirrorFactor, bloomRadius);\n }\n void main() {\n gl_FragColor = bloomStrength * ( lerpBloomFactor(bloomFactors[0]) * vec4(bloomTintColors[0], 1.0) * texture2D(blurTexture1, vUv) +\n lerpBloomFactor(bloomFactors[1]) * vec4(bloomTintColors[1], 1.0) * texture2D(blurTexture2, vUv) +\n lerpBloomFactor(bloomFactors[2]) * vec4(bloomTintColors[2], 1.0) * texture2D(blurTexture3, vUv) +\n lerpBloomFactor(bloomFactors[3]) * vec4(bloomTintColors[3], 1.0) * texture2D(blurTexture4, vUv) +\n lerpBloomFactor(bloomFactors[4]) * vec4(bloomTintColors[4], 1.0) * texture2D(blurTexture5, vUv) );\n }"})}}I.BlurDirectionX=new s.FM8(1,0),I.BlurDirectionY=new s.FM8(0,1);class R{constructor(e){var t,i;if(this.scene=e.scene,this.bloomModels=null===(t=e.world.model)||void 0===t?void 0:t.bloomModels,this.lightModels=null===(i=e.world.model)||void 0===i?void 0:i.lightModels,this.experience=e,this.sunLight=new s.Ox3("",0),this.sunLight.position.set(this.experience.shadowOffsetX,this.experience.shadowOffsetY,this.experience.shadowOffsetZ),this.experience.activeShadow&&(this.sunLight.castShadow=!0),this.sunLight.shadow.camera.near=.01,this.sunLight.shadow.camera.far=100,this.sunLight.shadow.bias=-1e-5,this.sunLight.shadow.mapSize.width=2048,this.sunLight.shadow.mapSize.height=2048,this.sunLight.shadow.blurSamples=20,this.sunLight.shadow.radius=this.experience.shadowRadius?this.experience.shadowRadius:1,this.scene.add(this.sunLight),this.experience.activeFog){const e=this.experience.fogColor?this.experience.fogColor:"#ffffff",t=this.experience.fogNear?this.experience.fogNear:1,i=this.experience.fogFar?this.experience.fogFar:15;this.fog=new s.ybr(e,t,i),this.scene.fog=this.fog}}initializeBloom(){var e;if(this.experience.renderer.instance){const t=new s.dd2(this.experience.sizes.width,this.experience.sizes.height,{minFilter:s.wem,magFilter:s.wem,format:s.wk1,type:s.cLu,stencilBuffer:!1});t.samples=3;const i=new y.T(N.Y);this.darkMaterial=new s.vBJ({color:"black"}),this.darkGlassMaterial=new s.vBJ({color:"black",visible:!1}),this.materials={};const a=new P.C(this.scene,this.experience.camera.instance);this.bloomPass=new I(new s.FM8(this.experience.sizes.width,this.experience.sizes.height),this.experience.bloomIntensity,this.experience.bloomRadius,this.experience.bloomThreshold),this.bloomComposer=new b.xC(this.experience.renderer.instance,t),this.bloomComposer.renderToScreen=!1,this.bloomComposer.addPass(a),this.bloomComposer.addPass(this.bloomPass),this.bloomPass.enabled=!1,this.lightModels&&this.lightModels.forEach((e=>{e.visible=!1})),null===(e=this.bloomModels)||void 0===e||e.forEach((e=>{e.material instanceof s.Wid&&(e.material.emissiveIntensity=0)}));const o=new y.T(new s.jyz({uniforms:{baseTexture:{value:null},bloomTexture:{value:this.bloomComposer.renderTarget2.texture}},vertexShader:"varying vec2 vUv;\n\nvoid main() {\n\n vUv = uv;\n\n gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n\n}",fragmentShader:"uniform sampler2D baseTexture;\nuniform sampler2D bloomTexture;\n\nvarying vec2 vUv;\n\nvoid main() {\n\n gl_FragColor = ( texture2D( baseTexture, vUv ) + vec4( 1.0 ) * texture2D( bloomTexture, vUv ) );\n\n}",defines:{}}),"baseTexture");o.needsSwap=!0,this.finalComposer=new b.xC(this.experience.renderer.instance,t),this.finalComposer.addPass(a),this.finalComposer.addPass(o),this.finalComposer.addPass(i)}}update(){var e,t,i,a;this.experience.world.model&&this.bloomPass&&("bloomOn"===this.bloom?(this.bloomPass.enabled=!0,this.lightModels&&this.lightModels.forEach((e=>{e.visible=!0})),null===(e=this.bloomModels)||void 0===e||e.forEach((e=>{e.material instanceof s.Wid&&(e.material.emissiveIntensity=1)}))):(this.bloomPass.enabled=!1,this.lightModels&&this.lightModels.forEach((e=>{e.visible=!1})),null===(t=this.bloomModels)||void 0===t||t.forEach((e=>{e.material instanceof s.Wid&&(e.material.emissiveIntensity=0)}))),this.experience.camera.instance&&(null===(i=this.experience.world.model.model)||void 0===i||i.traverse((e=>this.darkenNonBloomed(e))),this.bloomComposer.render(),null===(a=this.experience.world.model.model)||void 0===a||a.traverse((e=>this.restoreMaterial(e))),this.finalComposer.render()))}resize(){this.bloomComposer.setSize(this.experience.sizes.width,this.experience.sizes.height),this.finalComposer.setSize(this.experience.sizes.width,this.experience.sizes.height)}updateShadow({opacity:e,XOffset:t,YOffset:i,ZOffset:s,radius:a,activeShadow:o}){var r;(t||0===t)&&(this.sunLight.position.x=t),(i||0===i)&&(this.sunLight.position.y=i),(s||0===s)&&(this.sunLight.position.z=s),void 0!==a&&(this.sunLight.shadow.radius=a||1),void 0!==o&&(null===(r=this.experience.world.model)||void 0===r||r.updateFloor(o)),this.experience.world.model&&(e||0===e)&&(this.experience.world.model.shadowMaterial.opacity=e)}updateBloom({intensity:e,radius:t,threshold:i}){void 0!==e&&(this.bloomPass.strength=e),void 0!==t&&(this.bloomPass.radius=t),void 0!==i&&(this.bloomPass.threshold=i)}updateFog({enable:e,color:t,near:i,far:a}){const o=/^#([0-9a-f]{3}){1,2}$/i;if(this.fog)e?this.scene.fog=this.fog:void 0!==e&&(this.scene.fog=null),t&&o.test(t)&&(this.fog.color=new s.Ilk(t)),i&&(this.fog.near=i),a&&(this.fog.far=a);else if(e){const e=t&&o.test(t)?t:"#ffffff",r=i||1,n=a||15;this.fog=new s.ybr(e,r,n),this.scene.fog=this.fog}}darkenNonBloomed(e){var t;e instanceof s.Kj0&&!(null===(t=this.bloomModels)||void 0===t?void 0:t.find((t=>e===t)))&&(this.materials[e.uuid]=e.material,Array.isArray(e.material)||0===e.material.alphaTest&&1===e.material.opacity?e.material=this.darkMaterial:e.material=this.darkGlassMaterial)}restoreMaterial(e){var t;e instanceof s.Kj0&&this.materials[e.uuid]&&!(null===(t=this.bloomModels)||void 0===t?void 0:t.find((t=>e===t)))&&(e.material=this.materials[e.uuid],delete this.materials[e.uuid])}}const L=(e,t)=>{if(t(e))for(let i=0,s=e.children.length;i<s;i++)L(e.children[i],t)},X=L;class E{constructor({id:e,model:t,parentModel:i,materialPalette:a}){this.id=e,this.model=t,this.parentModel=i,this.modelParts=[],this.slotsModels={},this.slotsMaterials={},this.bloomModels=[],this.lightModels=[],this.model&&X(this.model,(e=>{if(/^SLOT_/.test(e.name))return this.slotsModels[e.name.replace(/^SLOT_/,"")]={slot:e,activeModel:-1,models:[]},!1;if(e instanceof s.Kj0){if(/^SLOT_/.test(e.material.name)){const t=e.material;this.slotsMaterials[t.name.replace(/^SLOT_/,"").replace(/-(\d|\D|\|)*$/,"")]={slot:t,group:t.name.replace(/^(\d|\D)*-/,""),materials:[]}}new s.Ilk("rgb(0, 0, 0)").equals(e.material.emissive)||this.bloomModels.push(e),e.castShadow=!0,e.receiveShadow=!0,e.frustumCulled=!0}return e instanceof s._kC&&e.name.toLowerCase().startsWith("dynamic")&&this.lightModels.push(e),!0})),a.forEach((e=>{const t=e.name.replace(/^(\d|\D)*-/,"").split("|");Object.values(this.slotsMaterials).forEach((i=>{t.includes(i.group)&&i.materials.push({name:e.name.replace(/^MATERIAL_/,"").replace(/-(\d|\D|\|)*$/,""),material:e})}))})),Object.values(this.slotsModels).forEach((e=>{const t=[];X(e.slot,(e=>!/^MODEL-PART_/.test(e.name)||(t.push(e),!1))),t.forEach((t=>{t.removeFromParent(),e.models.push(new Y({model:t,id:t.name.replace(/^MODEL-PART_/,""),parentModel:this,materialPalette:a}))}))}))}removeFromParent(){var e;null===(e=this.model)||void 0===e||e.removeFromParent()}}class Y extends E{constructor({model:e,id:t,parentModel:i,constraints:s,materialPalette:a}){var o,r,n;super({id:t,model:e,parentModel:i,materialPalette:a}),(null==s?void 0:s.position)&&(null===(o=this.model)||void 0===o||o.position.set(s.position[0],s.position[1],s.position[2])),(null==s?void 0:s.scale)&&(null===(r=this.model)||void 0===r||r.scale.set(s.scale[0],s.scale[1],s.scale[2])),(null==s?void 0:s.rotation)&&(null===(n=this.model)||void 0===n||n.rotation.set(s.rotation[0],s.rotation[1],s.rotation[2]))}dispose(){var e,t;this.model&&(this.model.traverse((e=>{var t;e instanceof s.Kj0&&(e.geometry.dispose(),/SLOT_/.test(e.material.name)?null===(t=e.material.aoMap)||void 0===t||t.dispose():Object.values(e.material).forEach((e=>{e instanceof s.xEZ&&e.dispose()})),e.material.dispose())})),Object.values(this.slotsModels).forEach((e=>e.models.forEach((e=>e.dispose())))),null===(t=null===(e=this.parentModel)||void 0===e?void 0:e.model)||void 0===t||t.remove(this.model))}}const D=Math.PI/2;class O extends E{constructor(e,t){super({id:"root-model",model:e.resources.model,materialPalette:t}),this.experience=e,this.scene=e.scene,this.resources=e.resources,this.time=e.time,this.activeShadow=e.activeShadow,this.box=new s.ZzF;const i=(new s.Pa4).setScalar(1.7);if(this.model){this.box.setFromObject(this.model);const t=new s.Pa4;this.box.getSize(t),this.center=new s.Pa4,this.box.getCenter(this.center);const a=(new s.Pa4).copy(i).divide(t);let o=Math.min(a.x,Math.min(a.y,a.z));e.maxZoom||0===e.maxZoom?e.camera.controls.MIN_CAMERA_SCROLL=e.maxZoom+.01:e.camera.controls.MIN_CAMERA_SCROLL=o<1?o/.6:o<2?o/1.2:o<3?o/1.5:o<4?o/2.5:o<5?o/3:o/3.5,e.minZoom&&(e.camera.controls.MAX_CAMERA_SCROLL=e.minZoom),this.resources.animations!==[]&&(o/=1.2),this.model.scale.setScalar(o),this.model.position.sub(this.center.multiplyScalar(o)),this.model.rotation.y=D,this.activeShadow&&(this.shadowMaterial=new s.Tn7,this.shadowMaterial.opacity=e.shadowOpacity,this.shadowMaterial.needsUpdate=!0,this.floor=new s.Kj0(new s.BKK(100,100,1),this.shadowMaterial),this.floor.rotation.x=-Math.PI/2,this.floor.receiveShadow=!0,this.floor.castShadow=!1,this.floor.position.sub(this.center),this.scene.add(this.floor)),this.scene.add(this.model),0!==this.resources.animations.length&&(this.mixer=new s.Xcj(this.model),this.mixer.clipAction(this.resources.animations[0]).play())}}update(){var e;null===(e=this.mixer)||void 0===e||e.update(this.time.delta/1e3)}updateFloor(e){e&&!this.floor&&(this.shadowMaterial=new s.Tn7,this.shadowMaterial.opacity=this.experience.shadowOpacity,this.shadowMaterial.needsUpdate=!0,this.floor=new s.Kj0(new s.BKK(100,100,1),this.shadowMaterial),this.floor.rotation.x=-Math.PI/2,this.floor.receiveShadow=!0,this.floor.castShadow=!1,this.floor.position.sub(this.center),this.scene.add(this.floor),this.scene.traverse((e=>{e instanceof s.Kj0&&(e.castShadow=!0,e.receiveShadow=!0)}))),!e&&this.floor&&(this.floor.geometry.dispose(),this.floor.material.dispose(),Object.values(this.floor.material).forEach((e=>{e instanceof s.xEZ&&e.dispose()})),this.scene.remove(this.floor),this.scene.traverse((e=>{e instanceof s.Kj0&&(e.castShadow=!1,e.receiveShadow=!1)})),this.floor=void 0)}dispose(){this.model&&(this.model.traverse((e=>{e instanceof s.Kj0&&(e.geometry.dispose(),e.material.dispose())})),this.floor&&(this.floor.geometry.dispose(),this.floor.material.dispose(),Object.values(this.floor.material).forEach((e=>{e instanceof s.xEZ&&e.dispose()})),this.mixer=void 0,this.scene.remove(this.floor)),this.scene.remove(this.model))}}class B{constructor(e){this.scene=e.scene,this.resources=e.resources,this.materialPalette=[],this.resources.on("modelReady",(()=>{e.resources.model&&this.prepareCustomizationPalette(e.resources.model),this.model=new O(e,this.materialPalette),this.environment||(this.environment=new R(e)),"noBloom"!==e.bloom&&e.initializeBloom()})),this.resources.on("modelDispose",(()=>{var e;null===(e=this.model)||void 0===e||e.dispose(),this.model=void 0}))}prepareCustomizationPalette(e){const t=[];e.traverse((e=>{e instanceof s.Kj0&&/MATERIAL_/.test(e.material.name)&&t.push(e)})),t.forEach((e=>{-1===this.materialPalette.findIndex((t=>t.name.replace(/^MATERIAL_/,"").replace(/-(\d|\D|\|)*$/,"")===e.material.name.replace(/^MATERIAL_/,"").replace(/-(\d|\D|\|)*$/,"")))?this.materialPalette.push(e.material):(Object.values(e.material).forEach((e=>{e instanceof s.xEZ&&e.dispose()})),e.material.dispose()),e.geometry.dispose(),e.removeFromParent()}))}findModel(e,t){return e===t.id?t:[...t.modelParts,...Object.values(t.slotsModels).filter((e=>-1!==e.activeModel)).map((e=>e.models[e.activeModel]))].reduce(((t,i)=>t||this.findModel(e,i)),null)}insertModelNode({url:e,id:t,parentId:i="root-model",constraints:s}){if(!this.model)return;const a=this.findModel(i,this.model);a&&this.resources.loadGlb(e).then((e=>{var i;this.prepareCustomizationPalette(e.scene);const o=new Y({model:e.scene,id:t,parentModel:a,constraints:s,materialPalette:this.materialPalette});a.modelParts.push(o),null===(i=a.model)||void 0===i||i.add(o.model)}))}deleteModelNode(e){if(!this.model)return;const t=this.findModel(e,this.model);t&&(t.dispose(),t instanceof Y&&t.parentModel&&(t.parentModel.modelParts=t.parentModel.modelParts.filter((t=>t.id!==e))))}getAllSlotsMaterials(e){if(!this.model)return null;const t=e||this.model,i=[...t.modelParts,...Object.values(t.slotsModels).filter((e=>-1!==e.activeModel)).map((e=>e.models[e.activeModel]))];return{id:t.id,slots:Object.keys(t.slotsMaterials).map((e=>({name:e,materials:t.slotsMaterials[e].materials.map((e=>e.name))}))),models:i.map((e=>this.getAllSlotsMaterials(e)))}}setMaterial({modelId:e="root-model",slot:t,materialName:i}){var s,a;if(!this.model)return;const o=this.findModel(e,this.model);if(!o)return void console.error("Model with Id",e,"not found!");if(!o.slotsMaterials[t])return void console.error("Slot",t,"not found!");const r=null===(a=null===(s=o.slotsMaterials[t])||void 0===s?void 0:s.materials.find((e=>e.name===i)))||void 0===a?void 0:a.material;r?(o.slotsMaterials[t].slot.color=r.color,o.slotsMaterials[t].slot.map=r.map,o.slotsMaterials[t].slot.alphaMap=r.alphaMap,o.slotsMaterials[t].slot.aoMap=r.aoMap,o.slotsMaterials[t].slot.roughness=r.roughness,o.slotsMaterials[t].slot.roughnessMap=r.roughnessMap,o.slotsMaterials[t].slot.metalness=r.metalness,o.slotsMaterials[t].slot.metalnessMap=r.metalnessMap,o.slotsMaterials[t].slot.normalMap=r.normalMap,o.slotsMaterials[t].slot.needsUpdate=!0):console.error("Material name",i,"not found!")}getAllSlotsModels(e){if(!this.model)return null;const t=e||this.model;return{id:t.id,slots:Object.keys(t.slotsModels).map((e=>({name:e,models:t.slotsModels[e].models.map((e=>this.getAllSlotsModels(e)))}))),modelParts:t.modelParts.map((e=>this.getAllSlotsModels(e)))}}setModel({modelId:e="root-model",slot:t,modelName:i}){if(!this.model)return;const s=this.findModel(e,this.model);if(!s)return void console.error("Model with Id",e,"not found!");const a=s.slotsModels[t];if(!a)return void console.error("Slot",t,"not found!");const o=a.models.findIndex((e=>e.id===i));-1!==a.activeModel&&a.models[a.activeModel].removeFromParent(),a.activeModel=o,-1!==o&&a.slot.add(a.models[o].model)}getCustomizedModel(){var e,t,i,s,a;return t=this,i=void 0,a=function*(){if(!(null===(e=this.model)||void 0===e?void 0:e.model))return null;this.gltfExporter||(this.gltfExporter=new w.M);const t=yield this.gltfExporter.parseAsync(this.model.model,{binary:!0});return new Blob([t],{type:"application/octet-stream"})},new((s=void 0)||(s=Promise))((function(e,o){function r(e){try{h(a.next(e))}catch(e){o(e)}}function n(e){try{h(a.throw(e))}catch(e){o(e)}}function h(t){var i;t.done?e(t.value):(i=t.value,i instanceof s?i:new s((function(e){e(i)}))).then(r,n)}h((a=a.apply(t,i||[])).next())}))}getCurrentCustomization(e=this.model){return e?{id:e.id,materialSlots:Object.keys(e.slotsMaterials).map((t=>{var i;return{slot:t,activeMaterial:null===(i=e.slotsMaterials[t].materials.find((({material:i})=>{const s=e.slotsMaterials[t].slot;return o=i,(a=s).color.getHexString()===o.color.getHexString()&&a.map===o.map&&a.alphaMap===o.alphaMap&&a.aoMap===o.aoMap&&a.roughness===o.roughness&&a.roughnessMap===o.roughnessMap&&a.metalness===o.metalness&&a.metalnessMap===o.metalnessMap&&a.normalMap===o.normalMap;var a,o})))||void 0===i?void 0:i.name}})),modelSlots:Object.keys(e.slotsModels).map((t=>({slot:t,activeModel:-1!==e.slotsModels[t].activeModel?this.getCurrentCustomization(e.slotsModels[t].models[e.slotsModels[t].activeModel]):null})))}:null}}class F{constructor({canvas:e,glbSrc:t,exposure:i,minZoom:a,maxZoom:o,initialZoom:r,sceneBackground:n,activeShadow:h,activeBakedShadow:l,shadowOffsetX:u,shadowOffsetY:g,shadowOffsetZ:p,shadowOpacity:v,shadowRadius:M,cameraOrbitSensitivity:f,minAzimuthalAngleRotation:A,maxAzimuthalAngleRotation:x,minPolarAngleRotation:w,maxPolarAngleRotation:b,maxDragX:P,minDragX:y,maxDragY:N,minDragY:S,maxDragZ:C,minDragZ:z,activeFog:I,fogColor:R,fogNear:L,fogFar:X,cameraNear:E,cameraFar:Y,hdri:D,bloomIntensity:O,bloomRadius:F,bloomThreshold:Z,initialAnimation:U,loadingDiv:k,instructionsImg:G,bloomButton:j}){this.canvas=e,this.progress=k,this.bloomButton=j,this.glbSrc=t,this.exposure=i,this.instructionsImg=G,this.minZoom=a,this.maxZoom=o,this.initialZoom=r,this.activeShadow=h,this.activeBakedShadow=l,this.shadowOffsetX=u,this.shadowOffsetY=g,this.shadowOffsetZ=p,this.shadowOpacity=v,this.shadowRadius=M,this.orbitSensitivity=f,this.minAzimuthalAngleRotation=A,this.maxAzimuthalAngleRotation=x,this.minPolarAngleRotation=w,this.maxPolarAngleRotation=b,this.maxDragX=P,this.minDragX=y,this.maxDragY=N,this.minDragY=S,this.maxDragZ=C,this.minDragZ=z,this.activeFog=I,this.fogColor=/^#([0-9a-f]{3}){1,2}$/i.test(R)?R:"",this.fogNear=L,this.fogFar=X,this.cameraNear=E,this.cameraFar=Y,this.bloomIntensity=O,this.bloomRadius=F,this.bloomThreshold=Z,this.sizes=new m(this.canvas),this.time=new c,this.scene=new s.xsS,this.camera=new T(this),this.hdri=D,this.renderer=new _(this),this.resources=new d({modelSource:this.glbSrc,environmentSource:this.hdri,progress:this.progress,bloomButton:this.bloomButton,canvas:this.canvas,renderer:this.renderer}),this.world=new B(this),this.sizes.on("resize",(()=>this.resize())),this.time.on("tick",(()=>this.update())),this.resources.on("ready",(()=>{0===this.resources.animations.length&&U&&this.camera.controls.animation.play()})),this.resources.on("environmentReady",(()=>{this.resources.environmentTexture&&(n&&(this.scene.background=this.resources.environmentTexture),this.scene.environment=this.resources.environmentTexture)}))}update(){var e,t;this.camera.update(),null===(e=this.world.model)||void 0===e||e.update(),"noBloom"===this.bloom?this.renderer.update():null===(t=this.world.environment)||void 0===t||t.update()}updateGlb(e){this.resources.updateGlb(e)}updateEnvironment({exposure:e,hdri:t,sceneBackground:i,initialAnimation:s}){void 0!==e&&this.renderer.instance&&(this.renderer.instance.toneMappingExposure=e),void 0!==t&&("neutral"===t?this.resources.updateEnvironment("https://sdk.r2u.io/hdri/neutral.hdr"):this.resources.updateEnvironment(t)),i&&this.resources.environmentTexture?this.scene.background=this.resources.environmentTexture:void 0!==i&&(this.scene.background=null),s?this.camera.controls.animation.play():void 0!==s&&this.camera.controls.animation.stop()}initializeBloom(){var e;null===(e=this.world.environment)||void 0===e||e.initializeBloom()}updateBloom(e){this.bloom=e,this.world.environment&&(this.world.environment.bloom=e)}resize(){var e;this.camera.resize(),"noBloom"===this.bloom?this.renderer.resize():null===(e=this.world.environment)||void 0===e||e.resize()}insertModelNode(e){this.world.insertModelNode(e)}deleteModelNode(e){this.world.deleteModelNode(e)}getAllSlotsMaterials(){return this.world.getAllSlotsMaterials()}setMaterial(...e){this.world.setMaterial(...e)}getAllSlotsModels(){return this.world.getAllSlotsModels()}setModel(...e){this.world.setModel(...e)}getCustomizedModel(){return e=this,t=void 0,s=function*(){return this.world.getCustomizedModel()},new((i=void 0)||(i=Promise))((function(a,o){function r(e){try{h(s.next(e))}catch(e){o(e)}}function n(e){try{h(s.throw(e))}catch(e){o(e)}}function h(e){var t;e.done?a(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(r,n)}h((s=s.apply(e,t||[])).next())}));var e,t,i,s}getCurrentCustomization(){return this.world.getCurrentCustomization()}}}}]);
"use strict";(self.webpackChunk_r2u_viewer=self.webpackChunk_r2u_viewer||[]).push([[628],{497:(e,t,i)=>{i.r(t),i.d(t,{default:()=>F});var s=i(657),a=i(531),o=i.n(a),r=i(970),n=i(687),h=i(341),l=i(884);class d extends(o()){constructor({modelSource:e,environmentSource:t,progress:i,bloomButton:a,canvas:o,renderer:d}){super(),this.progress=i,this.bloomButton=a,this.loadingManager=new s.lLk((()=>{this.progress.style.transition="opacity 1s ease-in-out",this.progress.style.opacity="0",this.bloomButton.style.transition="opacity 0.5s ease-in-out",this.bloomButton.style.opacity="1",this.bloomButton.style.height="60px",o.classList.add("active")}),((e,t,i)=>{this.progress.style.transition="",this.progress.style.transform=`scaleX(${t/i})`})),this.modelSource=e,this.environmentSource=t,this.gltfLoader=new n.E(this.loadingManager),this.dracoLoader=new r._(this.loadingManager),this.dracoLoader.setDecoderPath("https://www.gstatic.com/draco/versioned/decoders/1.4.1/"),this.gltfLoader.setDRACOLoader(this.dracoLoader),this.ktx2Loader=new h.a(this.loadingManager),this.ktx2Loader.setTranscoderPath("https://www.gstatic.com/basis-universal/versioned/2021-04-15-ba1c3e4/").detectSupport(d.instance),this.gltfLoader.setKTX2Loader(this.ktx2Loader),this.rgbeLoader=new l.x(this.loadingManager),Promise.all([new Promise((e=>{this.gltfLoader.load(this.modelSource,e)})),new Promise((e=>{this.rgbeLoader.load(this.environmentSource,e)}))]).then((([e,t])=>{this.model=e.scene,this.animations=e.animations,this.environmentTexture=t,this.environmentTexture.mapping=s.dSO,this.environmentTexture.name=this.environmentSource,this.emit("modelReady"),this.emit("environmentReady"),this.emit("ready")}))}resetLoadingBar(){this.progress.style.transform="scaleX(0)",this.progress.style.transition="none",this.progress.style.opacity=""}updateEnvironment(e){this.resetLoadingBar(),this.rgbeLoader.load(e,(t=>{const i=this.environmentTexture;this.environmentTexture=t,this.environmentTexture.mapping=s.dSO,this.environmentTexture.name=e,null==i||i.dispose(),this.emit("environmentReady")}))}updateGlb(e){this.resetLoadingBar(),this.emit("modelDispose"),this.gltfLoader.load(e,(e=>{this.model=e.scene,this.animations=e.animations,this.emit("modelReady")}))}loadGlb(e){return t=this,i=void 0,a=function*(){return this.gltfLoader.loadAsync(e)},new((s=void 0)||(s=Promise))((function(e,o){function r(e){try{h(a.next(e))}catch(e){o(e)}}function n(e){try{h(a.throw(e))}catch(e){o(e)}}function h(t){var i;t.done?e(t.value):(i=t.value,i instanceof s?i:new s((function(e){e(i)}))).then(r,n)}h((a=a.apply(t,i||[])).next())}));var t,i,s,a}}class m extends(o()){constructor(e){super(),this.canvas=e,this.width=e.offsetWidth,this.height=e.offsetHeight,this.pixelRatio=Math.min(window.devicePixelRatio,2),window.ResizeObserver&&(this.resizeObserver=new ResizeObserver((()=>this.updateSizes())),this.resizeObserver.observe(this.canvas)),window.addEventListener("resize",(()=>this.updateSizes()))}updateSizes(){this.width=this.canvas.offsetWidth,this.height=this.canvas.offsetHeight,this.pixelRatio=Math.min(window.devicePixelRatio,2),this.emit("resize")}}class c extends(o()){constructor(){super(),this.start=Date.now(),this.current=this.start,this.elapsed=0,this.delta=1,window.requestAnimationFrame((()=>this.tick()))}tick(){const e=Date.now();this.delta=e-this.current,this.current=e,this.elapsed=this.current-this.start,this.emit("tick"),window.requestAnimationFrame((()=>this.tick()))}}class u{constructor(e=50){this.velocity=0,this.naturalFrequency=0,this.setDecayTime(e)}setDecayTime(e){this.naturalFrequency=1/Math.max(.001,e)}update(e,t,i,s){const a=2e-4*this.naturalFrequency;if(null==e||0===s)return t;if(e===t&&0===this.velocity)return t;if(i<0)return e;const o=e-t,r=this.velocity+this.naturalFrequency*o,n=o+i*r,h=Math.exp(-this.naturalFrequency*i),l=(r-this.naturalFrequency*n)*h,d=-this.naturalFrequency*(l+r*h);return Math.abs(l)<a*Math.abs(s)&&d*o>=0?(this.velocity=0,t):(this.velocity=l,t+n*h)}}const g=Math.PI/1e3,p=Math.PI/6,v=2*Math.PI;class M{constructor({experience:e,controls:t}){this.canvas=e.canvas,this.instructionsImg=e.instructionsImg,this.controls=t,this.time=e.time,this.angleAnimation=0,this.elapsedAnimation=0,this.elapsedImgAnimation=0,this.damperImgAnimation=new u,this.idle=!1,this.active=!1,this.canvas.addEventListener("touchstart",(()=>{this.active=!1,clearTimeout(this.startTimer)})),this.canvas.addEventListener("mousedown",(()=>{this.active=!1,clearTimeout(this.startTimer)}))}play(){this.startTimer=setTimeout((()=>{this.active=!0}),2e3)}stop(){this.active=!1}update(){this.active?(this.idle||(this.elapsedAnimation+=g*this.time.delta,this.instructionsImg.style.opacity="1"),this.elapsedAnimation>v&&(this.idle=!0,this.instructionsImg.style.opacity="0",this.elapsedAnimation=v,setTimeout((()=>{this.elapsedAnimation=0,this.elapsedImgAnimation=0,this.idle=!1}),2e3)),this.angleAnimation=Math.sin(this.elapsedAnimation)*p,this.elapsedImgAnimation=this.damperImgAnimation.update(this.elapsedImgAnimation,this.elapsedAnimation,this.time.delta,1),this.instructionsImg.style.transform=`translate(calc(-50% + ${-Math.sin(this.elapsedImgAnimation)}*50px), -50%)`):this.instructionsImg.style.opacity="0"}}const f=Math.PI/2.4,A=Math.PI/10;class x{constructor(e,t,i){this.ORBIT_SENSITIVITY=e.orbitSensitivity,this.MIN_CAMERA_SCROLL=2,this.MAX_CAMERA_SCROLL=10,this.DEFAULT_CAMERA_SCROLL=4,this.MAX_XZ_ANGLE=e.maxAzimuthalAngleRotation*Math.PI/180,this.MIN_XZ_ANGLE=e.minAzimuthalAngleRotation*Math.PI/180,e.maxPolarAngleRotation&&(this.MAX_Y_ANGLE=e.maxPolarAngleRotation*Math.PI/180),e.minPolarAngleRotation&&(this.MIN_Y_ANGLE=e.minPolarAngleRotation*Math.PI/180),this.MAX_X_PAN=e.maxDragX,this.MIN_X_PAN=e.minDragX,this.MAX_Y_PAN=e.maxDragY,this.MIN_Y_PAN=e.minDragY,this.MAX_Z_PAN=e.maxDragZ,this.MIN_Z_PAN=e.minDragZ,this.canvas=e.canvas,this.camera=t,this.time=e.time,this.damperRadius=new u,this.damperYAngle=new u,this.damperXZAngle=new u,this.damperXPan=new u,this.damperYPan=new u,this.damperZPan=new u,this.canvas.oncontextmenu=e=>e.preventDefault(),this.yAngleTarget=f,this.xzAngleTarget=A,this.yAngle=f,this.xzAngle=A,this.orbitCamera=!1,this.moveCamera=!1,this.panTarget=new s.Pa4,this.pan=new s.Pa4,i?(this.cameraRadius=i,this.cameraRadiusTarget=i):(this.cameraRadius=this.DEFAULT_CAMERA_SCROLL,this.cameraRadiusTarget=this.DEFAULT_CAMERA_SCROLL),this.pageMode="none",this.addDragEventListener(),this.addWheelEventListener(),this.addTouchEventListener(),this.animation=new M({experience:e,controls:this})}addDragEventListener(){let e=0,t=0;this.canvas.onmousedown=i=>{i.stopPropagation(),0===i.button?(this.orbitCamera=!0,this.canvas.style.cursor="grabbing"):(this.moveCamera=!0,this.canvas.style.cursor="move"),e=i.clientX,t=i.clientY},document.addEventListener("mouseup",(()=>{this.orbitCamera=!1,this.moveCamera=!1,this.canvas.style.cursor=""})),this.canvas.addEventListener("mousemove",(i=>{if(this.orbitCamera)this.yAngleTarget+=this.ORBIT_SENSITIVITY*Math.PI*2*((e-i.clientX)/this.canvas.width),e=i.clientX,this.xzAngleTarget+=this.ORBIT_SENSITIVITY*Math.PI*2*((i.clientY-t)/this.canvas.height),t=i.clientY,this.xzAngleTarget<this.MIN_XZ_ANGLE&&(this.xzAngleTarget=this.MIN_XZ_ANGLE),this.xzAngleTarget>this.MAX_XZ_ANGLE&&(this.xzAngleTarget=this.MAX_XZ_ANGLE),this.MIN_Y_ANGLE&&this.yAngleTarget<this.MIN_Y_ANGLE&&(this.yAngleTarget=this.MIN_Y_ANGLE),this.MAX_Y_ANGLE&&this.yAngleTarget>this.MAX_Y_ANGLE&&(this.yAngleTarget=this.MAX_Y_ANGLE);else if(this.moveCamera){const a=.8*this.cameraRadius*(e-i.clientX)/this.canvas.width;e=i.clientX;const o=.8*this.cameraRadius*(i.clientY-t)/this.canvas.height;t=i.clientY,this.panTarget.add(new s.Pa4(a*Math.cos(this.yAngleTarget)+o*Math.sin(this.xzAngleTarget)*Math.sin(-this.yAngleTarget),o*Math.cos(this.xzAngleTarget),a*Math.sin(-this.yAngleTarget)+o*Math.sin(-this.xzAngleTarget)*Math.cos(this.yAngleTarget))),null!==this.MIN_X_PAN&&void 0!==this.MIN_X_PAN&&this.panTarget.x<this.MIN_X_PAN&&(this.panTarget.x=this.MIN_X_PAN),null!==this.MAX_X_PAN&&void 0!==this.MAX_X_PAN&&this.panTarget.x>this.MAX_X_PAN&&(this.panTarget.x=this.MAX_X_PAN),null!==this.MIN_Y_PAN&&void 0!==this.MIN_Y_PAN&&this.panTarget.y<this.MIN_Y_PAN&&(this.panTarget.y=this.MIN_Y_PAN),null!==this.MAX_Y_PAN&&void 0!==this.MAX_Y_PAN&&this.panTarget.y>this.MAX_Y_PAN&&(this.panTarget.y=this.MAX_Y_PAN),null!==this.MIN_Z_PAN&&void 0!==this.MIN_Z_PAN&&this.panTarget.z<this.MIN_Z_PAN&&(this.panTarget.z=this.MIN_Z_PAN),null!==this.MAX_Z_PAN&&void 0!==this.MAX_Z_PAN&&this.panTarget.z>this.MAX_Z_PAN&&(this.panTarget.z=this.MAX_Z_PAN)}}))}addWheelEventListener(){let e;this.canvas.onwheel=t=>{t.preventDefault(),t.deltaY>0?(this.cameraRadiusTarget+=.003*t.deltaY*this.cameraRadius,this.canvas.style.cursor="zoom-out"):(this.cameraRadiusTarget+=.003*t.deltaY*this.cameraRadius/2,this.canvas.style.cursor="zoom-in"),this.cameraRadiusTarget>this.MAX_CAMERA_SCROLL&&(this.cameraRadiusTarget=this.MAX_CAMERA_SCROLL),this.cameraRadiusTarget<this.MIN_CAMERA_SCROLL&&(this.cameraRadiusTarget=this.MIN_CAMERA_SCROLL),e&&clearTimeout(e),e=setTimeout((()=>{this.canvas.style.cursor=""}),300)}}addTouchEventListener(){let e=0,t=0;document.addEventListener("touchstart",(i=>{e=i.touches[0].clientX,t=i.touches[0].clientY})),document.addEventListener("touchmove",(i=>{"movingCamera"!==this.pageMode&&"orbitingCamera"!==this.pageMode&&"zoomingCamera"!==this.pageMode&&Math.abs(i.touches[0].clientY-t)>Math.abs(i.touches[0].clientX-e)&&(this.pageMode="scrolling")}));let i=0,a=0,o=0;this.canvas.ontouchstart=e=>{1===e.touches.length?(i=e.touches[0].clientX,a=e.touches[0].clientY):2===e.touches.length&&(this.pageMode="movingCamera",i=(e.touches[0].clientX+e.touches[1].clientX)/2,a=(e.touches[0].clientY+e.touches[1].clientY)/2,o=Math.hypot(e.touches[0].pageX-e.touches[1].pageX,e.touches[0].pageY-e.touches[1].pageY))},document.addEventListener("touchend",(e=>{"movingCamera"===this.pageMode||"zoomingCamera"===this.pageMode?(this.pageMode="orbitingCamera",i=e.touches[0].clientX,a=e.touches[0].clientY):this.pageMode="none"})),this.canvas.addEventListener("touchmove",(e=>{if("scrolling"!==this.pageMode&&e.cancelable)if(Math.abs(e.touches[0].clientY-a)<=Math.abs(e.touches[0].clientX-i)&&"none"===this.pageMode&&(this.pageMode="orbitingCamera"),"movingCamera"!==this.pageMode&&"orbitingCamera"!==this.pageMode&&"zoomingCamera"!==this.pageMode||e.preventDefault(),"orbitingCamera"===this.pageMode)this.yAngleTarget+=this.ORBIT_SENSITIVITY*Math.PI*2*((i-e.touches[0].pageX)/this.canvas.width),i=e.touches[0].pageX,this.xzAngleTarget+=this.ORBIT_SENSITIVITY*Math.PI*2*((e.touches[0].pageY-a)/this.canvas.height),a=e.touches[0].pageY,this.xzAngleTarget<this.MIN_XZ_ANGLE&&(this.xzAngleTarget=this.MIN_XZ_ANGLE),this.xzAngleTarget>this.MAX_XZ_ANGLE&&(this.xzAngleTarget=this.MAX_XZ_ANGLE),this.MIN_Y_ANGLE&&this.yAngleTarget<this.MIN_Y_ANGLE&&(this.yAngleTarget=this.MIN_Y_ANGLE),this.MAX_Y_ANGLE&&this.yAngleTarget>this.MAX_Y_ANGLE&&(this.yAngleTarget=this.MAX_Y_ANGLE);else if("movingCamera"===this.pageMode){Math.abs(Math.hypot(e.touches[0].pageX-e.touches[1].pageX,e.touches[0].pageY-e.touches[1].pageY)-o)>50&&(o=Math.hypot(e.touches[0].pageX-e.touches[1].pageX,e.touches[0].pageY-e.touches[1].pageY),this.pageMode="zoomingCamera");const t=(e.touches[0].clientX+e.touches[1].clientX)/2,r=(e.touches[0].clientY+e.touches[1].clientY)/2,n=1.6*this.cameraRadius*(i-t)/this.canvas.width;i=t;const h=1.6*this.cameraRadius*(r-a)/this.canvas.height;a=r,this.panTarget.add(new s.Pa4(n*Math.cos(this.yAngleTarget)+h*Math.sin(this.xzAngleTarget)*Math.sin(-this.yAngleTarget),h*Math.cos(this.xzAngleTarget),n*Math.sin(-this.yAngleTarget)+h*Math.sin(-this.xzAngleTarget)*Math.cos(this.yAngleTarget))),null!==this.MIN_X_PAN&&void 0!==this.MIN_X_PAN&&this.panTarget.x<this.MIN_X_PAN&&(this.panTarget.x=this.MIN_X_PAN),null!==this.MAX_X_PAN&&void 0!==this.MAX_X_PAN&&this.panTarget.x>this.MAX_X_PAN&&(this.panTarget.x=this.MAX_X_PAN),null!==this.MIN_Y_PAN&&void 0!==this.MIN_Y_PAN&&this.panTarget.y<this.MIN_Y_PAN&&(this.panTarget.y=this.MIN_Y_PAN),null!==this.MAX_Y_PAN&&void 0!==this.MAX_Y_PAN&&this.panTarget.y>this.MAX_Y_PAN&&(this.panTarget.y=this.MAX_Y_PAN),null!==this.MIN_Z_PAN&&void 0!==this.MIN_Z_PAN&&this.panTarget.z<this.MIN_Z_PAN&&(this.panTarget.z=this.MIN_Z_PAN),null!==this.MAX_Z_PAN&&void 0!==this.MAX_Z_PAN&&this.panTarget.z>this.MAX_Z_PAN&&(this.panTarget.z=this.MAX_Z_PAN)}else if("zoomingCamera"===this.pageMode){const t=Math.hypot(e.touches[0].pageX-e.touches[1].pageX,e.touches[0].pageY-e.touches[1].pageY)-o;this.cameraRadiusTarget-=.03*t,o+=t,this.cameraRadiusTarget>this.MAX_CAMERA_SCROLL&&(this.cameraRadiusTarget=this.MAX_CAMERA_SCROLL),this.cameraRadiusTarget<this.MIN_CAMERA_SCROLL&&(this.cameraRadiusTarget=this.MIN_CAMERA_SCROLL)}}))}setCamera({radius:e,minRadius:t,maxRadius:i,initialRadius:s,orbitSensitivity:a,azimuthalAngle:o,maxAzimuthalAngle:r,minAzimuthalAngle:n,polarAngle:h,maxPolarAngle:l,minPolarAngle:d,dragX:m,maxDragX:c,minDragX:u,dragY:g,maxDragY:p,minDragY:v,dragZ:M,maxDragZ:f,minDragZ:A,near:x,far:T}){void 0!==e&&(this.cameraRadiusTarget=0===e?.01:e),void 0!==t&&(this.MIN_CAMERA_SCROLL=0===t?.01:t),void 0!==i&&(this.MAX_CAMERA_SCROLL=0===i?.01:i),void 0!==s&&(this.DEFAULT_CAMERA_SCROLL=0===s?.01:s),void 0!==a&&(this.ORBIT_SENSITIVITY=0===a?.01:a),void 0!==r&&(this.MAX_XZ_ANGLE=0===r?.01:r*Math.PI/180),void 0!==n&&(this.MIN_XZ_ANGLE=0===n?-.01:n*Math.PI/180),void 0!==l&&(this.MAX_Y_ANGLE=0===l?.01:l*Math.PI/180),void 0!==d&&(this.MIN_Y_ANGLE=0===d?-.01:d*Math.PI/180),void 0!==c&&(this.MAX_X_PAN=0===c?.01:c),void 0!==u&&(this.MIN_X_PAN=0===u?.01:u),void 0!==p&&(this.MAX_Y_PAN=0===p?.01:p),void 0!==v&&(this.MIN_Y_PAN=0===v?.01:v),void 0!==f&&(this.MAX_Z_PAN=0===f?.01:f),void 0!==A&&(this.MIN_Z_PAN=0===A?.01:A),void 0!==x&&(this.camera.near=0===x?.01:x),void 0!==T&&(this.camera.far=0===T?.01:T),void 0!==o&&(this.xzAngleTarget=o*Math.PI/180),void 0!==h&&(this.yAngleTarget=h*Math.PI/180),void 0!==m&&(this.panTarget.x=m),void 0!==g&&(this.panTarget.y=g),void 0!==M&&(this.panTarget.z=M),this.camera.updateProjectionMatrix()}getCamera(){return{radius:this.cameraRadiusTarget,orbitSensitivity:this.ORBIT_SENSITIVITY,azimuthalAngle:180*this.xzAngleTarget/Math.PI,polarAngle:180*this.yAngleTarget/Math.PI,dragX:this.panTarget.x,dragY:this.panTarget.y,dragZ:this.panTarget.z,near:this.camera.near,far:this.camera.near}}update(){this.animation.update(),this.yAngle=this.damperYAngle.update(this.yAngle,this.yAngleTarget+this.animation.angleAnimation,this.time.delta,1),this.xzAngle=this.damperXZAngle.update(this.xzAngle,this.xzAngleTarget,this.time.delta,1),this.cameraRadius=this.damperRadius.update(this.cameraRadius,this.cameraRadiusTarget,this.time.delta,1),this.pan.x=this.damperXPan.update(this.pan.x,this.panTarget.x,this.time.delta,1),this.pan.y=this.damperYPan.update(this.pan.y,this.panTarget.y,this.time.delta,1),this.pan.z=this.damperZPan.update(this.pan.z,this.panTarget.z,this.time.delta,1),this.camera.position.x=Math.cos(this.xzAngle)*Math.sin(this.yAngle)*this.cameraRadius,this.camera.position.y=Math.sin(this.xzAngle)*this.cameraRadius,this.camera.position.z=Math.cos(this.xzAngle)*Math.cos(this.yAngle)*this.cameraRadius,this.camera.position.add(this.pan),this.camera.lookAt(this.pan)}}class T{constructor(e){this.instance=null,this.experience=e,this.canvas=this.experience.canvas,this.sizes=this.experience.sizes,this.scene=this.experience.scene;const t=this.experience.cameraNear?this.experience.cameraNear:.1,i=this.experience.cameraFar?this.experience.cameraFar:100;this.instance=new s.cPb(35,this.sizes.width/this.sizes.height,t,i),this.instance.position.set(1,1,4),this.scene.add(this.instance),this.controls=new x(this.experience,this.instance,this.experience.initialZoom)}resize(){this.instance&&(this.instance.aspect=this.sizes.width/this.sizes.height,this.instance.updateProjectionMatrix())}update(){this.controls.update()}}class _{constructor(e){this.instance=null,this.canvas=e.canvas,this.sizes=e.sizes,this.scene=e.scene,this.camera=e.camera,this.instance=new s.CP7({canvas:this.canvas,antialias:!0,alpha:!0,powerPreference:"high-performance"}),this.instance.setSize(this.sizes.width,this.sizes.height),this.instance.setPixelRatio(this.sizes.pixelRatio),this.instance.setClearColor("",0),this.instance.setClearAlpha(0),this.instance.autoClear=!0,this.instance.shadowMap.enabled=!0,this.instance.shadowMap.type=s.dwk,this.instance.physicallyCorrectLights=!0,this.instance.outputEncoding=s.knz,this.instance.toneMapping=s.LY2,this.instance.toneMappingExposure=e.exposure}resize(){var e,t;null===(e=this.instance)||void 0===e||e.setSize(this.sizes.width,this.sizes.height),null===(t=this.instance)||void 0===t||t.setPixelRatio(this.sizes.pixelRatio)}update(){this.instance&&this.camera.instance&&this.instance.render(this.scene,this.camera.instance)}}var w=i(870);var b=i(643),P=i(220),y=i(175),N=i(475),S=i(612),C=i(248),z=i(655);class I extends S.w{constructor(e,t,i,a){super(),this.strength=void 0!==t?t:1,this.radius=i,this.threshold=a,this.resolution=void 0!==e?new s.FM8(e.x,e.y):new s.FM8(256,256),this.clearColor=new s.Ilk(0,0,0);const o={minFilter:s.wem,magFilter:s.wem,format:s.wk1};this.renderTargetsHorizontal=[],this.renderTargetsVertical=[],this.nMips=5;let r=Math.round(this.resolution.x/2),n=Math.round(this.resolution.y/2);this.renderTargetBright=new s.dd2(r,n,o),this.renderTargetBright.texture.name="UnrealBloomPass.bright",this.renderTargetBright.texture.generateMipmaps=!1;for(let e=0;e<this.nMips;e++){const t=new s.dd2(r,n,o);t.texture.name=`UnrealBloomPass.h${e}`,t.texture.generateMipmaps=!1,this.renderTargetsHorizontal.push(t);const i=new s.dd2(r,n,o);i.texture.name=`UnrealBloomPass.v${e}`,i.texture.generateMipmaps=!1,this.renderTargetsVertical.push(i),r=Math.round(r/2),n=Math.round(n/2)}void 0===z.Y&&console.error("THREE.UnrealBloomPass relies on LuminosityHighPassShader");const h=z.Y;this.highPassUniforms=s.rDY.clone(h.uniforms),this.highPassUniforms.luminosityThreshold.value=a,this.highPassUniforms.smoothWidth.value=.01,this.materialHighPassFilter=new s.jyz({uniforms:this.highPassUniforms,vertexShader:h.vertexShader,fragmentShader:h.fragmentShader,defines:{}}),this.separableBlurMaterials=[];const l=[3,5,7,9,11];r=Math.round(this.resolution.x/2),n=Math.round(this.resolution.y/2);for(let e=0;e<this.nMips;e++)this.separableBlurMaterials.push(this.getSeperableBlurMaterial(l[e])),this.separableBlurMaterials[e].uniforms.texSize.value=new s.FM8(r,n),r=Math.round(r/2),n=Math.round(n/2);this.compositeMaterial=this.getCompositeMaterial(this.nMips),this.compositeMaterial.uniforms.blurTexture1.value=this.renderTargetsVertical[0].texture,this.compositeMaterial.uniforms.blurTexture2.value=this.renderTargetsVertical[1].texture,this.compositeMaterial.uniforms.blurTexture3.value=this.renderTargetsVertical[2].texture,this.compositeMaterial.uniforms.blurTexture4.value=this.renderTargetsVertical[3].texture,this.compositeMaterial.uniforms.blurTexture5.value=this.renderTargetsVertical[4].texture,this.compositeMaterial.uniforms.bloomStrength.value=t,this.compositeMaterial.uniforms.bloomRadius.value=.1,this.compositeMaterial.needsUpdate=!0,this.compositeMaterial.uniforms.bloomFactors.value=[1,.8,.6,.4,.2],this.bloomTintColors=[new s.Pa4(1,1,1),new s.Pa4(1,1,1),new s.Pa4(1,1,1),new s.Pa4(1,1,1),new s.Pa4(1,1,1)],this.compositeMaterial.uniforms.bloomTintColors.value=this.bloomTintColors,void 0===C.C&&console.error("THREE.UnrealBloomPass relies on CopyShader");const d=C.C;this.copyUniforms=s.rDY.clone(d.uniforms),this.copyUniforms.opacity.value=1,this.materialCopy=new s.jyz({uniforms:this.copyUniforms,vertexShader:d.vertexShader,fragmentShader:d.fragmentShader,blending:s.WMw,depthTest:!1,depthWrite:!1,transparent:!0}),this.enabled=!0,this.needsSwap=!1,this._oldClearColor=new s.Ilk,this.oldClearAlpha=1,this.basic=new s.vBJ,this.fsQuad=new S.T(null)}dispose(){for(let e=0;e<this.renderTargetsHorizontal.length;e++)this.renderTargetsHorizontal[e].dispose();for(let e=0;e<this.renderTargetsVertical.length;e++)this.renderTargetsVertical[e].dispose();this.renderTargetBright.dispose()}setSize(e,t){let i=Math.round(e/2),a=Math.round(t/2);this.renderTargetBright.setSize(i,a);for(let e=0;e<this.nMips;e++)this.renderTargetsHorizontal[e].setSize(i,a),this.renderTargetsVertical[e].setSize(i,a),this.separableBlurMaterials[e].uniforms.texSize.value=new s.FM8(i,a),i=Math.round(i/2),a=Math.round(a/2)}render(e,t,i,s,a){e.getClearColor(this._oldClearColor),this.oldClearAlpha=e.getClearAlpha();const o=e.autoClear;e.autoClear=!1,e.setClearColor(this.clearColor,0),a&&e.state.buffers.stencil.setTest(!1),this.renderToScreen&&(this.fsQuad.material=this.basic,this.basic.map=i.texture,e.setRenderTarget(null),e.clear(),this.fsQuad.render(e)),this.highPassUniforms.tDiffuse.value=i.texture,this.highPassUniforms.luminosityThreshold.value=this.threshold,this.fsQuad.material=this.materialHighPassFilter,e.setRenderTarget(this.renderTargetBright),e.clear(),this.fsQuad.render(e);let r=this.renderTargetBright;for(let t=0;t<this.nMips;t++)this.fsQuad.material=this.separableBlurMaterials[t],this.separableBlurMaterials[t].uniforms.colorTexture.value=r.texture,this.separableBlurMaterials[t].uniforms.direction.value=I.BlurDirectionX,e.setRenderTarget(this.renderTargetsHorizontal[t]),e.clear(),this.fsQuad.render(e),this.separableBlurMaterials[t].uniforms.colorTexture.value=this.renderTargetsHorizontal[t].texture,this.separableBlurMaterials[t].uniforms.direction.value=I.BlurDirectionY,e.setRenderTarget(this.renderTargetsVertical[t]),e.clear(),this.fsQuad.render(e),r=this.renderTargetsVertical[t];this.fsQuad.material=this.compositeMaterial,this.compositeMaterial.uniforms.bloomStrength.value=this.strength,this.compositeMaterial.uniforms.bloomRadius.value=this.radius,this.compositeMaterial.uniforms.bloomTintColors.value=this.bloomTintColors,e.setRenderTarget(this.renderTargetsHorizontal[0]),e.clear(),this.fsQuad.render(e),this.fsQuad.material=this.materialCopy,this.copyUniforms.tDiffuse.value=this.renderTargetsHorizontal[0].texture,a&&e.state.buffers.stencil.setTest(!0),this.renderToScreen?(e.setRenderTarget(null),this.fsQuad.render(e)):(e.setRenderTarget(i),this.fsQuad.render(e)),e.setClearColor(this._oldClearColor,this.oldClearAlpha),e.autoClear=o}getSeperableBlurMaterial(e){return new s.jyz({defines:{KERNEL_RADIUS:e,SIGMA:e},uniforms:{colorTexture:{value:null},texSize:{value:new s.FM8(.5,.5)},direction:{value:new s.FM8(.5,.5)}},vertexShader:"varying vec2 vUv;\n void main() {\n vUv = uv;\n gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n }",fragmentShader:"#include <common>\n varying vec2 vUv;\n uniform sampler2D colorTexture;\n uniform vec2 texSize;\n uniform vec2 direction;\n float gaussianPdf(in float x, in float sigma) {\n return 0.39894 * exp( -0.5 * x * x/( sigma * sigma))/sigma;\n }\n void main() {\n vec2 invSize = 1.0 / texSize; float fSigma = float(SIGMA); float weightSum = gaussianPdf(0.0, fSigma); float alphaSum = 0.0; vec3 diffuseSum = texture2D( colorTexture, vUv).rgb * weightSum; for( int i = 1; i < KERNEL_RADIUS; i ++ ) { float x = float(i); float w = gaussianPdf(x, fSigma); vec2 uvOffset = direction * invSize * x; vec4 sample1 = texture2D( colorTexture, vUv + uvOffset); vec4 sample2 = texture2D( colorTexture, vUv - uvOffset); diffuseSum += (sample1.rgb + sample2.rgb) * w; alphaSum += (sample1.a + sample2.a) * w; weightSum += 2.0 * w; } gl_FragColor = vec4(diffuseSum/weightSum, alphaSum/weightSum);\n }"})}getCompositeMaterial(e){return new s.jyz({defines:{NUM_MIPS:e},uniforms:{blurTexture1:{value:null},blurTexture2:{value:null},blurTexture3:{value:null},blurTexture4:{value:null},blurTexture5:{value:null},dirtTexture:{value:null},bloomStrength:{value:1},bloomFactors:{value:null},bloomTintColors:{value:null},bloomRadius:{value:0}},vertexShader:"varying vec2 vUv;\n void main() {\n vUv = uv;\n gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n }",fragmentShader:"varying vec2 vUv;\n uniform sampler2D blurTexture1;\n uniform sampler2D blurTexture2;\n uniform sampler2D blurTexture3;\n uniform sampler2D blurTexture4;\n uniform sampler2D blurTexture5;\n uniform sampler2D dirtTexture;\n uniform float bloomStrength;\n uniform float bloomRadius;\n uniform float bloomFactors[NUM_MIPS];\n uniform vec3 bloomTintColors[NUM_MIPS];\n float lerpBloomFactor(const in float factor) {\n float mirrorFactor = 1.2 - factor;\n return mix(factor, mirrorFactor, bloomRadius);\n }\n void main() {\n gl_FragColor = bloomStrength * ( lerpBloomFactor(bloomFactors[0]) * vec4(bloomTintColors[0], 1.0) * texture2D(blurTexture1, vUv) +\n lerpBloomFactor(bloomFactors[1]) * vec4(bloomTintColors[1], 1.0) * texture2D(blurTexture2, vUv) +\n lerpBloomFactor(bloomFactors[2]) * vec4(bloomTintColors[2], 1.0) * texture2D(blurTexture3, vUv) +\n lerpBloomFactor(bloomFactors[3]) * vec4(bloomTintColors[3], 1.0) * texture2D(blurTexture4, vUv) +\n lerpBloomFactor(bloomFactors[4]) * vec4(bloomTintColors[4], 1.0) * texture2D(blurTexture5, vUv) );\n }"})}}I.BlurDirectionX=new s.FM8(1,0),I.BlurDirectionY=new s.FM8(0,1);class R{constructor(e){var t,i;if(this.scene=e.scene,this.bloomModels=null===(t=e.world.model)||void 0===t?void 0:t.bloomModels,this.lightModels=null===(i=e.world.model)||void 0===i?void 0:i.lightModels,this.experience=e,this.sunLight=new s.Ox3("",0),this.sunLight.position.set(this.experience.shadowOffsetX,this.experience.shadowOffsetY,this.experience.shadowOffsetZ),this.experience.activeShadow&&(this.sunLight.castShadow=!0),this.sunLight.shadow.camera.near=.01,this.sunLight.shadow.camera.far=100,this.sunLight.shadow.bias=-1e-5,this.sunLight.shadow.mapSize.width=2048,this.sunLight.shadow.mapSize.height=2048,this.sunLight.shadow.blurSamples=20,this.sunLight.shadow.radius=this.experience.shadowRadius?this.experience.shadowRadius:1,this.scene.add(this.sunLight),this.experience.activeFog){const e=this.experience.fogColor?this.experience.fogColor:"#ffffff",t=this.experience.fogNear?this.experience.fogNear:1,i=this.experience.fogFar?this.experience.fogFar:15;this.fog=new s.ybr(e,t,i),this.scene.fog=this.fog}}initializeBloom(){var e;if(this.experience.renderer.instance){const t=new s.dd2(this.experience.sizes.width,this.experience.sizes.height,{minFilter:s.wem,magFilter:s.wem,format:s.wk1,type:s.cLu,stencilBuffer:!1});t.samples=3;const i=new y.T(N.Y);this.darkMaterial=new s.vBJ({color:"black"}),this.darkGlassMaterial=new s.vBJ({color:"black",visible:!1}),this.materials={};const a=new P.C(this.scene,this.experience.camera.instance);this.bloomPass=new I(new s.FM8(this.experience.sizes.width,this.experience.sizes.height),this.experience.bloomIntensity,this.experience.bloomRadius,this.experience.bloomThreshold),this.bloomComposer=new b.xC(this.experience.renderer.instance,t),this.bloomComposer.renderToScreen=!1,this.bloomComposer.addPass(a),this.bloomComposer.addPass(this.bloomPass),this.bloomPass.enabled=!1,this.lightModels&&this.lightModels.forEach((e=>{e.visible=!1})),null===(e=this.bloomModels)||void 0===e||e.forEach((e=>{e.material instanceof s.Wid&&(e.material.emissiveIntensity=0)}));const o=new y.T(new s.jyz({uniforms:{baseTexture:{value:null},bloomTexture:{value:this.bloomComposer.renderTarget2.texture}},vertexShader:"varying vec2 vUv;\n\nvoid main() {\n\n vUv = uv;\n\n gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n\n}",fragmentShader:"uniform sampler2D baseTexture;\nuniform sampler2D bloomTexture;\n\nvarying vec2 vUv;\n\nvoid main() {\n\n gl_FragColor = ( texture2D( baseTexture, vUv ) + vec4( 1.0 ) * texture2D( bloomTexture, vUv ) );\n\n}",defines:{}}),"baseTexture");o.needsSwap=!0,this.finalComposer=new b.xC(this.experience.renderer.instance,t),this.finalComposer.addPass(a),this.finalComposer.addPass(o),this.finalComposer.addPass(i)}}update(){var e,t,i,a;this.experience.world.model&&this.bloomPass&&("bloomOn"===this.bloom?(this.bloomPass.enabled=!0,this.lightModels&&this.lightModels.forEach((e=>{e.visible=!0})),null===(e=this.bloomModels)||void 0===e||e.forEach((e=>{e.material instanceof s.Wid&&(e.material.emissiveIntensity=1)}))):(this.bloomPass.enabled=!1,this.lightModels&&this.lightModels.forEach((e=>{e.visible=!1})),null===(t=this.bloomModels)||void 0===t||t.forEach((e=>{e.material instanceof s.Wid&&(e.material.emissiveIntensity=0)}))),this.experience.camera.instance&&(null===(i=this.experience.world.model.model)||void 0===i||i.traverse((e=>this.darkenNonBloomed(e))),this.bloomComposer.render(),null===(a=this.experience.world.model.model)||void 0===a||a.traverse((e=>this.restoreMaterial(e))),this.finalComposer.render()))}resize(){this.bloomComposer.setSize(this.experience.sizes.width,this.experience.sizes.height),this.finalComposer.setSize(this.experience.sizes.width,this.experience.sizes.height)}updateShadow({opacity:e,XOffset:t,YOffset:i,ZOffset:s,radius:a,activeShadow:o}){var r;(t||0===t)&&(this.sunLight.position.x=t),(i||0===i)&&(this.sunLight.position.y=i),(s||0===s)&&(this.sunLight.position.z=s),void 0!==a&&(this.sunLight.shadow.radius=a||1),void 0!==o&&(null===(r=this.experience.world.model)||void 0===r||r.updateFloor(o)),this.experience.world.model&&(e||0===e)&&(this.experience.world.model.shadowMaterial.opacity=e)}updateBloom({intensity:e,radius:t,threshold:i}){void 0!==e&&(this.bloomPass.strength=e),void 0!==t&&(this.bloomPass.radius=t),void 0!==i&&(this.bloomPass.threshold=i)}updateFog({enable:e,color:t,near:i,far:a}){const o=/^#([0-9a-f]{3}){1,2}$/i;if(this.fog)e?this.scene.fog=this.fog:void 0!==e&&(this.scene.fog=null),t&&o.test(t)&&(this.fog.color=new s.Ilk(t)),i&&(this.fog.near=i),a&&(this.fog.far=a);else if(e){const e=t&&o.test(t)?t:"#ffffff",r=i||1,n=a||15;this.fog=new s.ybr(e,r,n),this.scene.fog=this.fog}}darkenNonBloomed(e){var t;e instanceof s.Kj0&&!(null===(t=this.bloomModels)||void 0===t?void 0:t.find((t=>e===t)))&&(this.materials[e.uuid]=e.material,Array.isArray(e.material)||0===e.material.alphaTest&&1===e.material.opacity?e.material=this.darkMaterial:e.material=this.darkGlassMaterial)}restoreMaterial(e){var t;e instanceof s.Kj0&&this.materials[e.uuid]&&!(null===(t=this.bloomModels)||void 0===t?void 0:t.find((t=>e===t)))&&(e.material=this.materials[e.uuid],delete this.materials[e.uuid])}}const L=(e,t)=>{if(t(e))for(let i=0,s=e.children.length;i<s;i++)L(e.children[i],t)},X=L;class E{constructor({id:e,model:t,parentModel:i,materialPalette:a}){this.id=e,this.model=t,this.parentModel=i,this.modelParts=[],this.slotsModels={},this.slotsMaterials={},this.bloomModels=[],this.lightModels=[],this.model&&X(this.model,(e=>{if(/^SLOT_/.test(e.name))return this.slotsModels[e.name.replace(/^SLOT_/,"")]={slot:e,activeModel:-1,models:[]},!1;if(e instanceof s.Kj0){if(/^SLOT_/.test(e.material.name)){const t=e.material;this.slotsMaterials[t.name.replace(/^SLOT_/,"").replace(/-(\d|\D|\|)*$/,"")]={slot:t,group:t.name.replace(/^(\d|\D)*-/,""),materials:[]}}new s.Ilk("rgb(0, 0, 0)").equals(e.material.emissive)||this.bloomModels.push(e),e.castShadow=!0,e.receiveShadow=!0,e.frustumCulled=!0}return e instanceof s._kC&&e.name.toLowerCase().startsWith("dynamic")&&this.lightModels.push(e),!0})),a.forEach((e=>{const t=e.name.replace(/^(\d|\D)*-/,"").split("|");Object.values(this.slotsMaterials).forEach((i=>{t.includes(i.group)&&i.materials.push({name:e.name.replace(/^MATERIAL_/,"").replace(/-(\d|\D|\|)*$/,""),material:e})}))})),Object.values(this.slotsModels).forEach((e=>{const t=[];X(e.slot,(e=>!/^MODEL-PART_/.test(e.name)||(t.push(e),!1))),t.forEach((t=>{t.removeFromParent(),e.models.push(new Y({model:t,id:t.name.replace(/^MODEL-PART_/,""),parentModel:this,materialPalette:a}))}))}))}removeFromParent(){var e;null===(e=this.model)||void 0===e||e.removeFromParent()}}class Y extends E{constructor({model:e,id:t,parentModel:i,constraints:s,materialPalette:a}){var o,r,n;super({id:t,model:e,parentModel:i,materialPalette:a}),(null==s?void 0:s.position)&&(null===(o=this.model)||void 0===o||o.position.set(s.position[0],s.position[1],s.position[2])),(null==s?void 0:s.scale)&&(null===(r=this.model)||void 0===r||r.scale.set(s.scale[0],s.scale[1],s.scale[2])),(null==s?void 0:s.rotation)&&(null===(n=this.model)||void 0===n||n.rotation.set(s.rotation[0],s.rotation[1],s.rotation[2]))}dispose(){var e,t;this.model&&(this.model.traverse((e=>{var t;e instanceof s.Kj0&&(e.geometry.dispose(),/SLOT_/.test(e.material.name)?null===(t=e.material.aoMap)||void 0===t||t.dispose():Object.values(e.material).forEach((e=>{e instanceof s.xEZ&&e.dispose()})),e.material.dispose())})),Object.values(this.slotsModels).forEach((e=>e.models.forEach((e=>e.dispose())))),null===(t=null===(e=this.parentModel)||void 0===e?void 0:e.model)||void 0===t||t.remove(this.model))}}const D=Math.PI/2;class O extends E{constructor(e,t){super({id:"root-model",model:e.resources.model,materialPalette:t}),this.experience=e,this.scene=e.scene,this.resources=e.resources,this.time=e.time,this.activeShadow=e.activeShadow,this.box=new s.ZzF;const i=(new s.Pa4).setScalar(1.7);if(this.model){this.box.setFromObject(this.model);const t=new s.Pa4;this.box.getSize(t),this.center=new s.Pa4,this.box.getCenter(this.center);const a=(new s.Pa4).copy(i).divide(t);let o=Math.min(a.x,Math.min(a.y,a.z));e.maxZoom||0===e.maxZoom?e.camera.controls.MIN_CAMERA_SCROLL=e.maxZoom+.01:e.camera.controls.MIN_CAMERA_SCROLL=o<1?o/.6:o<2?o/1.2:o<3?o/1.5:o<4?o/2.5:o<5?o/3:o/3.5,e.minZoom&&(e.camera.controls.MAX_CAMERA_SCROLL=e.minZoom),this.resources.animations!==[]&&(o/=1.2),this.model.scale.setScalar(o),this.model.position.sub(this.center.multiplyScalar(o)),this.model.rotation.y=D,this.activeShadow&&(this.shadowMaterial=new s.Tn7,this.shadowMaterial.opacity=e.shadowOpacity,this.shadowMaterial.needsUpdate=!0,this.floor=new s.Kj0(new s.BKK(100,100,1),this.shadowMaterial),this.floor.rotation.x=-Math.PI/2,this.floor.receiveShadow=!0,this.floor.castShadow=!1,this.floor.position.sub(this.center),this.scene.add(this.floor)),this.scene.add(this.model),0!==this.resources.animations.length&&(this.mixer=new s.Xcj(this.model),this.mixer.clipAction(this.resources.animations[0]).play())}}update(){var e;null===(e=this.mixer)||void 0===e||e.update(this.time.delta/1e3)}updateFloor(e){e&&!this.floor&&(this.shadowMaterial=new s.Tn7,this.shadowMaterial.opacity=this.experience.shadowOpacity,this.shadowMaterial.needsUpdate=!0,this.floor=new s.Kj0(new s.BKK(100,100,1),this.shadowMaterial),this.floor.rotation.x=-Math.PI/2,this.floor.receiveShadow=!0,this.floor.castShadow=!1,this.floor.position.sub(this.center),this.scene.add(this.floor),this.scene.traverse((e=>{e instanceof s.Kj0&&(e.castShadow=!0,e.receiveShadow=!0)}))),!e&&this.floor&&(this.floor.geometry.dispose(),this.floor.material.dispose(),Object.values(this.floor.material).forEach((e=>{e instanceof s.xEZ&&e.dispose()})),this.scene.remove(this.floor),this.scene.traverse((e=>{e instanceof s.Kj0&&(e.castShadow=!1,e.receiveShadow=!1)})),this.floor=void 0)}dispose(){this.model&&(this.model.traverse((e=>{e instanceof s.Kj0&&(e.geometry.dispose(),e.material.dispose())})),this.floor&&(this.floor.geometry.dispose(),this.floor.material.dispose(),Object.values(this.floor.material).forEach((e=>{e instanceof s.xEZ&&e.dispose()})),this.mixer=void 0,this.scene.remove(this.floor)),this.scene.remove(this.model))}}class B{constructor(e){this.scene=e.scene,this.resources=e.resources,this.materialPalette=[],this.resources.on("modelReady",(()=>{e.resources.model&&this.prepareCustomizationPalette(e.resources.model),this.model=new O(e,this.materialPalette),this.environment||(this.environment=new R(e)),"noBloom"!==e.bloom&&e.initializeBloom()})),this.resources.on("modelDispose",(()=>{var e;null===(e=this.model)||void 0===e||e.dispose(),this.model=void 0}))}prepareCustomizationPalette(e){const t=[];e.traverse((e=>{e instanceof s.Kj0&&/MATERIAL_/.test(e.material.name)&&t.push(e)})),t.forEach((e=>{-1===this.materialPalette.findIndex((t=>t.name.replace(/^MATERIAL_/,"").replace(/-(\d|\D|\|)*$/,"")===e.material.name.replace(/^MATERIAL_/,"").replace(/-(\d|\D|\|)*$/,"")))?this.materialPalette.push(e.material):(Object.values(e.material).forEach((e=>{e instanceof s.xEZ&&e.dispose()})),e.material.dispose()),e.geometry.dispose(),e.removeFromParent()}))}findModel(e,t){return e===t.id?t:[...t.modelParts,...Object.values(t.slotsModels).filter((e=>-1!==e.activeModel)).map((e=>e.models[e.activeModel]))].reduce(((t,i)=>t||this.findModel(e,i)),null)}insertModelNode({url:e,id:t,parentId:i="root-model",constraints:s}){if(!this.model)return;const a=this.findModel(i,this.model);a&&this.resources.loadGlb(e).then((e=>{var i;this.prepareCustomizationPalette(e.scene);const o=new Y({model:e.scene,id:t,parentModel:a,constraints:s,materialPalette:this.materialPalette});a.modelParts.push(o),null===(i=a.model)||void 0===i||i.add(o.model)}))}deleteModelNode(e){if(!this.model)return;const t=this.findModel(e,this.model);t&&(t.dispose(),t instanceof Y&&t.parentModel&&(t.parentModel.modelParts=t.parentModel.modelParts.filter((t=>t.id!==e))))}getAllSlotsMaterials(e){if(!this.model)return null;const t=e||this.model,i=[...t.modelParts,...Object.values(t.slotsModels).filter((e=>-1!==e.activeModel)).map((e=>e.models[e.activeModel]))];return{id:t.id,slots:Object.keys(t.slotsMaterials).map((e=>({name:e,materials:t.slotsMaterials[e].materials.map((e=>e.name))}))),models:i.map((e=>this.getAllSlotsMaterials(e)))}}setMaterial({modelId:e="root-model",slot:t,materialName:i}){var s,a;if(!this.model)return;const o=this.findModel(e,this.model);if(!o)return void console.error("Model with Id",e,"not found!");if(!o.slotsMaterials[t])return void console.error("Slot",t,"not found!");const r=null===(a=null===(s=o.slotsMaterials[t])||void 0===s?void 0:s.materials.find((e=>e.name===i)))||void 0===a?void 0:a.material;r?(Object.assign(o.slotsMaterials[t].slot,r),o.slotsMaterials[t].slot.needsUpdate=!0):console.error("Material name",i,"not found!")}getAllSlotsModels(e){if(!this.model)return null;const t=e||this.model;return{id:t.id,slots:Object.keys(t.slotsModels).map((e=>({name:e,models:t.slotsModels[e].models.map((e=>this.getAllSlotsModels(e)))}))),modelParts:t.modelParts.map((e=>this.getAllSlotsModels(e)))}}setModel({modelId:e="root-model",slot:t,modelName:i}){if(!this.model)return;const s=this.findModel(e,this.model);if(!s)return void console.error("Model with Id",e,"not found!");const a=s.slotsModels[t];if(!a)return void console.error("Slot",t,"not found!");const o=a.models.findIndex((e=>e.id===i));-1!==a.activeModel&&a.models[a.activeModel].removeFromParent(),a.activeModel=o,-1!==o&&a.slot.add(a.models[o].model)}getCustomizedModel(){var e,t,i,s,a;return t=this,i=void 0,a=function*(){if(!(null===(e=this.model)||void 0===e?void 0:e.model))return null;this.gltfExporter||(this.gltfExporter=new w.M);const t=yield this.gltfExporter.parseAsync(this.model.model,{binary:!0});return new Blob([t],{type:"application/octet-stream"})},new((s=void 0)||(s=Promise))((function(e,o){function r(e){try{h(a.next(e))}catch(e){o(e)}}function n(e){try{h(a.throw(e))}catch(e){o(e)}}function h(t){var i;t.done?e(t.value):(i=t.value,i instanceof s?i:new s((function(e){e(i)}))).then(r,n)}h((a=a.apply(t,i||[])).next())}))}getCurrentCustomization(e=this.model){return e?{id:e.id,materialSlots:Object.keys(e.slotsMaterials).map((t=>{var i;return{slot:t,activeMaterial:null===(i=e.slotsMaterials[t].materials.find((({material:i})=>{const s=e.slotsMaterials[t].slot;return o=i,(a=s).color.getHexString()===o.color.getHexString()&&a.map===o.map&&a.alphaMap===o.alphaMap&&a.aoMap===o.aoMap&&a.roughness===o.roughness&&a.roughnessMap===o.roughnessMap&&a.metalness===o.metalness&&a.metalnessMap===o.metalnessMap&&a.normalMap===o.normalMap;var a,o})))||void 0===i?void 0:i.name}})),modelSlots:Object.keys(e.slotsModels).map((t=>({slot:t,activeModel:-1!==e.slotsModels[t].activeModel?this.getCurrentCustomization(e.slotsModels[t].models[e.slotsModels[t].activeModel]):null})))}:null}}class F{constructor({canvas:e,glbSrc:t,exposure:i,minZoom:a,maxZoom:o,initialZoom:r,sceneBackground:n,activeShadow:h,activeBakedShadow:l,shadowOffsetX:u,shadowOffsetY:g,shadowOffsetZ:p,shadowOpacity:v,shadowRadius:M,cameraOrbitSensitivity:f,minAzimuthalAngleRotation:A,maxAzimuthalAngleRotation:x,minPolarAngleRotation:w,maxPolarAngleRotation:b,maxDragX:P,minDragX:y,maxDragY:N,minDragY:S,maxDragZ:C,minDragZ:z,activeFog:I,fogColor:R,fogNear:L,fogFar:X,cameraNear:E,cameraFar:Y,hdri:D,bloomIntensity:O,bloomRadius:F,bloomThreshold:Z,initialAnimation:U,loadingDiv:k,instructionsImg:G,bloomButton:j}){this.canvas=e,this.progress=k,this.bloomButton=j,this.glbSrc=t,this.exposure=i,this.instructionsImg=G,this.minZoom=a,this.maxZoom=o,this.initialZoom=r,this.activeShadow=h,this.activeBakedShadow=l,this.shadowOffsetX=u,this.shadowOffsetY=g,this.shadowOffsetZ=p,this.shadowOpacity=v,this.shadowRadius=M,this.orbitSensitivity=f,this.minAzimuthalAngleRotation=A,this.maxAzimuthalAngleRotation=x,this.minPolarAngleRotation=w,this.maxPolarAngleRotation=b,this.maxDragX=P,this.minDragX=y,this.maxDragY=N,this.minDragY=S,this.maxDragZ=C,this.minDragZ=z,this.activeFog=I,this.fogColor=/^#([0-9a-f]{3}){1,2}$/i.test(R)?R:"",this.fogNear=L,this.fogFar=X,this.cameraNear=E,this.cameraFar=Y,this.bloomIntensity=O,this.bloomRadius=F,this.bloomThreshold=Z,this.sizes=new m(this.canvas),this.time=new c,this.scene=new s.xsS,this.camera=new T(this),this.hdri=D,this.renderer=new _(this),this.resources=new d({modelSource:this.glbSrc,environmentSource:this.hdri,progress:this.progress,bloomButton:this.bloomButton,canvas:this.canvas,renderer:this.renderer}),this.world=new B(this),this.sizes.on("resize",(()=>this.resize())),this.time.on("tick",(()=>this.update())),this.resources.on("ready",(()=>{0===this.resources.animations.length&&U&&this.camera.controls.animation.play()})),this.resources.on("environmentReady",(()=>{this.resources.environmentTexture&&(n&&(this.scene.background=this.resources.environmentTexture),this.scene.environment=this.resources.environmentTexture)}))}update(){var e,t;this.camera.update(),null===(e=this.world.model)||void 0===e||e.update(),"noBloom"===this.bloom?this.renderer.update():null===(t=this.world.environment)||void 0===t||t.update()}updateGlb(e){this.resources.updateGlb(e)}updateEnvironment({exposure:e,hdri:t,sceneBackground:i,initialAnimation:s}){void 0!==e&&this.renderer.instance&&(this.renderer.instance.toneMappingExposure=e),void 0!==t&&("neutral"===t?this.resources.updateEnvironment("https://sdk.r2u.io/hdri/neutral.hdr"):this.resources.updateEnvironment(t)),i&&this.resources.environmentTexture?this.scene.background=this.resources.environmentTexture:void 0!==i&&(this.scene.background=null),s?this.camera.controls.animation.play():void 0!==s&&this.camera.controls.animation.stop()}initializeBloom(){var e;null===(e=this.world.environment)||void 0===e||e.initializeBloom()}updateBloom(e){this.bloom=e,this.world.environment&&(this.world.environment.bloom=e)}resize(){var e;this.camera.resize(),"noBloom"===this.bloom?this.renderer.resize():null===(e=this.world.environment)||void 0===e||e.resize()}insertModelNode(e){this.world.insertModelNode(e)}deleteModelNode(e){this.world.deleteModelNode(e)}getAllSlotsMaterials(){return this.world.getAllSlotsMaterials()}setMaterial(...e){this.world.setMaterial(...e)}getAllSlotsModels(){return this.world.getAllSlotsModels()}setModel(...e){this.world.setModel(...e)}getCustomizedModel(){return e=this,t=void 0,s=function*(){return this.world.getCustomizedModel()},new((i=void 0)||(i=Promise))((function(a,o){function r(e){try{h(s.next(e))}catch(e){o(e)}}function n(e){try{h(s.throw(e))}catch(e){o(e)}}function h(e){var t;e.done?a(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(r,n)}h((s=s.apply(e,t||[])).next())}));var e,t,i,s}getCurrentCustomization(){return this.world.getCurrentCustomization()}}}}]);
{
"name": "@r2u/viewer",
"version": "1.0.1",
"version": "1.0.2",
"files": [

@@ -5,0 +5,0 @@ "dist"

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc