@perceptimagery/dita-configurator-staging 1.2.2101 → 1.2.2105
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +2 -2
- package/package.json +2 -2
package/dist/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/* (c) 2023, Abhishek Deb (vikz91.deb@gmail.com) */
|
|
2
2
|
(function(){"use strict";try{if(typeof document<"u"){var e=document.createElement("style");e.appendChild(document.createTextNode('@import"https://fonts.googleapis.com/css2?family=Work+Sans:wght@200;300;400;500;600;700;800&display=swap";#Sprie-config-html{font-size:87.5%}#Sprie-config-html,#Sprie-config-body{width:100%;height:100%;margin:0;padding:0;font-family:Work Sans,sans-serif;box-sizing:border-box}#Sprie-config-body *{box-sizing:border-box;margin:0;padding:0}.sprie-config-sr-only{border:0;clip:rect(0,0,0,0);height:1px;margin:-1px;overflow:hidden;padding:0;position:absolute;width:1px}.sprie-config-loadingBox{position:fixed;width:100%;height:100%;display:flex;align-items:center;justify-content:center;text-align:center;font-size:24px;font-weight:500;z-index:10000;background:#f2f2f2}.drawer.drawer--full.hidden-phone.lens-customizer .drawer__header{display:none!important}.drawer.drawer--full.hidden-phone.lens-customizer .drawer__content.drawer__content--padded-start{padding-top:0!important}.drawer.drawer--full.hidden-phone.lens-customizer #dita-3dconfig-element{height:100%!important}.popover.hidden-lap-and-up.popover-full .popover__header{display:none!important}#sprie-config-main-container{width:100%;height:100%}#sprie-config-main-header{border-bottom:.5px solid #aeaeae;display:flex;flex-direction:row;justify-content:center;align-items:center;gap:.5rem}.sprie-config-main-header-close{position:absolute;right:2%;width:3rem;height:3rem;background-color:transparent;border:none}#sprie-config-header-content{display:flex;flex-direction:column;justify-content:center;align-items:center;gap:.5rem}#sprie-config-header-content .sprie-config-mainHeader-frameName{color:#373737;font-size:1.3rem;font-weight:400;line-height:1.5275rem;letter-spacing:-.05rem;text-transform:uppercase}#sprie-config-viewer-container{position:relative;width:100%;img {position: absolute; top: 2rem; left: 2rem;}}.sprie-config-loadingFrame{position:absolute;width:100%;height:100%;display:flex;align-items:center;justify-content:center;text-align:center;font-size:24px;font-weight:500;z-index:1000;background:#fafafa;opacity:.7}.sprie-config-loader{border:8px solid #222222;width:60px;padding:8px;aspect-ratio:1;border-radius:50%;background:#222222;--_m: conic-gradient(#0000 10%, #000), linear-gradient(#000 0 0) content-box;-webkit-mask:var(--_m);mask:var(--_m);-webkit-mask-composite:source-out;mask-composite:subtract;animation:spin 1s infinite linear}@keyframes spin{to{transform:rotate(1turn)}}#Sprie-config-Cust-block{display:flex;align-items:center;background-color:#f2f2f2;border-top:1px solid #91847e;position:relative;flex-grow:1}.sprie-config-price-block{position:absolute;bottom:100%;right:0;z-index:1000;display:flex;flex-direction:column;align-items:end;gap:.4rem;p {font-size: 1.5rem; font-weight: 500; color: #121212;}}.frameName{color:#4d4d4d;font-size:.875rem;font-weight:500;line-height:1.5275rem;letter-spacing:-.05rem;text-transform:uppercase}.price-tag{color:#222;font-size:1.3125rem;font-weight:400;line-height:2.275rem}@media (max-width: 576px){#Sprie-config-Viewer-Container{img {position: absolute; top: 1.2rem; left: 1.2rem;}}#Sprie-config-Cust-block{display:flex;align-items:center}.popover__content.threedConfig{height:100%;width:100%;padding:0}.popover.hidden-lap-and-up.popover-full[open]{transform:translateY(8.5%)}}.sprie-config-palette{overflow-y:hidden;height:100%;display:flex;justify-content:flex-start;overflow-x:auto}.sprie-config-palette-img-box{position:relative;display:flex;flex-direction:column;justify-content:center;align-items:center;height:50%}.sprie-config-palette-img-box .sprie-config-image{width:60px;height:60px}.sprie-config-palette-img-box .sprie-config-image.mobile-view{width:45px;height:45px}.sprie-config-palette-img-box>button{background-color:transparent}.sprie-config-palette-img-text{top:80%;width:175%;height:150%;position:absolute;text-align:center;z-index:100}.sprie-config-palette-img-text .sprie-config-palette-imgName{z-index:100}.sprie-config-palette-img-text .sprie-config-price-tag{text-align:center;font-size:small;white-space:nowrap;z-index:100}.sprie-config-engraving-block{width:100%;height:100%;display:flex;flex-direction:column;align-items:center;gap:.8rem}.sprie-config-engraving-checkbox[type=checkbox]{width:1rem;height:1rem;accent-color:#000;border:.25rem solid #000;border-radius:.5rem;background-color:transparent}.sprie-config-engraving-inputField-block{width:25rem;position:relative}.sprie-config-engraving-inputField{width:100%;font-size:.8rem;font-weight:500;background:transparent;border-width:1px}.sprie-config-engraving-inputInfo{position:absolute;white-space:nowrap;font-size:.6rem;bottom:.2rem;right:.4rem;color:#686868}.sprie-config-engraving-link{position:absolute;background-color:transparent;border:none;white-space:nowrap;font-size:.7rem;bottom:-1.7rem;right:0;color:#686868;text-decoration:underline;cursor:pointer}@media (max-width: 576px){.sprie-config-engraving-inputField-block{width:70%}}.carousel{position:relative;overflow:hidden;width:100%;height:100%;display:flex;flex-direction:column;align-items:center}.carousel-container{width:90%;height:100%;display:flex;position:relative;overflow:hidden}.carousel-item{display:flex;align-items:start;justify-content:center;min-width:100%;height:100%;transition-property:transform;transition-timing-function:cubic-bezier(0,0,.2,1);transition-duration:.5s}.carousel-header{display:flex;align-items:center;justify-content:center;gap:2rem}.carousel-header .step-syntax{font-size:1rem;font-weight:400;line-height:1.5rem;color:#4d4d4d}.carousel-header .select-syntax{font-size:1rem;font-weight:600;line-height:1.5rem;color:#91847e}.carousel-btn{border:none;display:flex;align-items:center;justify-content:center;cursor:pointer;background-color:transparent}.arrow{border:solid #91847e;border-width:0 3px 3px 0;display:inline-block}.right-arrow{transform:rotate(-45deg);-webkit-transform:rotate(-45deg)}.left-arrow{transform:rotate(135deg);-webkit-transform:rotate(135deg)}.step-tracker-block{padding:1%!important;display:flex;flex-direction:column;justify-content:center;align-items:center;border-bottom:1px solid #aeaeae;width:26.25rem}.step-tracker{display:flex;gap:1rem}.step-circle{width:10px;height:10px;border-radius:50%;border:1px solid #7d7d7d;background-color:transparent;display:flex;justify-content:center;align-items:center;margin-right:10px;font-size:14px}.step-circle.active{background-color:#000;border-color:#000}@media (max-width: 576px){.carousel-container{align-items:start;height:70%;width:100%}.step-tracker-block{width:100%}}.sprie-config-add-to-cart-block{width:14.5rem;display:flex;flex-direction:column;justify-content:center;align-items:center;gap:.5rem}.sprie-config-add-to-cart-btn{width:100%;height:2.75rem;background-color:#000;display:flex;align-items:center;justify-content:center;cursor:pointer;border:0;font-size:.875rem;letter-spacing:.1rem;font-weight:500;color:#fff}#Sprie-Config-return-policy-label{display:flex;justify-content:center;width:16rem;p {font-size: .8rem; margin: .05rem .08rem .05rem .5rem;}}#Sprie-Config-return-policy-checkbox[type=checkbox]{align-self:center;width:1rem;height:1rem;accent-color:#000;border:.25rem solid #000;border-radius:.5rem;background-color:#efefef}.sprie-config-add-to-cart-btn:disabled,.sprie-config-add-to-cart-btn [disabled]{background-color:#504f4f;cursor:default}@media (max-width: 576px){.sprie-config-add-to-cart-block{width:100%}.sprie-config-add-to-cart-btn{width:100%;height:4rem}#Sprie-Config-return-policy-label{width:100%;margin-bottom:.5rem}}.sprie-3d-snap-button-block{position:absolute;top:1.5rem;right:2rem;display:flex;flex-direction:column}.sprie-3d-snap-button{cursor:pointer!important;border:none;font-size:.9rem;padding:.5rem 1.5rem!important;margin:.5rem 0rem!important;text-align:center}@media (max-width: 576px){.sprie-3d-snap-button-block{top:1rem;right:1.3rem;gap:0}.sprie-3d-snap-button{font-size:.7rem;padding:.3rem 1rem!important;margin:.2rem 0!important}}')),document.head.appendChild(e)}}catch(i){console.error("vite-plugin-css-injected-by-js",i)}})();
|
|
3
|
-
var LQ=Object.defineProperty;var NQ=(Wa,ls,cs)=>ls in Wa?LQ(Wa,ls,{enumerable:!0,configurable:!0,writable:!0,value:cs}):Wa[ls]=cs;var Rt=(Wa,ls,cs)=>(NQ(Wa,typeof ls!="symbol"?ls+"":ls,cs),cs);(function(){var ZI,$I;"use strict";class Wa{constructor(e){Rt(this,"config");this.config=e}IsTokenExpired(){if(!this.config.EXPIRES)return!1;const e=this.config.EXPIRES;if(!e)return!0;const t=new Date().getTime(),i=new Date(e).getTime()-t;return e===""||i<=0}IsConfigExpired(){return this.LoadConfig(),!this.config.JWT||!this.config.ORGID}RequestOptions(e,t){return{method:e,headers:{...{Accept:"application/json","Content-Type":"application/json"},...this.config.JWT&&{Authorization:this.config.JWT}},...e==="POST"&&{body:JSON.stringify(t)}}}async Get(e){return await(await fetch(this.config.HOST+e,this.RequestOptions("GET"))).json()}async Post(e,t){return await(await fetch(this.config.HOST+e,this.RequestOptions("POST",t||{}))).json()}StoreConfig(e){e.JWT&&(localStorage.setItem(`${this.config.STORE_PREFIX}jwtToken`,e.JWT),this.config.JWT=e.JWT),e.EXPIRES&&(localStorage.setItem(`${this.config.STORE_PREFIX}expires`,e.EXPIRES),this.config.EXPIRES=e.EXPIRES),e.ORGID&&(localStorage.setItem(`${this.config.STORE_PREFIX}orgId`,e.ORGID),this.config.ORGID=e.ORGID)}LoadConfig(){const e=localStorage.getItem(`${this.config.STORE_PREFIX}jwtToken`);e&&(this.config.JWT=e);const t=localStorage.getItem(`${this.config.STORE_PREFIX}orgId`);t&&(this.config.ORGID=t);const n=localStorage.getItem(`${this.config.STORE_PREFIX}expires`);return n&&(this.config.EXPIRES=n),this.config}}const ls={storePrefix:{NODE_ENV:"production"}.STORE_PREFIX||"sprie-embed-",host:"https://api.sprie.io"},cs=Object.freeze(ls),w3="1.2.
|
|
3
|
+
var LQ=Object.defineProperty;var NQ=(Wa,ls,cs)=>ls in Wa?LQ(Wa,ls,{enumerable:!0,configurable:!0,writable:!0,value:cs}):Wa[ls]=cs;var Rt=(Wa,ls,cs)=>(NQ(Wa,typeof ls!="symbol"?ls+"":ls,cs),cs);(function(){var ZI,$I;"use strict";class Wa{constructor(e){Rt(this,"config");this.config=e}IsTokenExpired(){if(!this.config.EXPIRES)return!1;const e=this.config.EXPIRES;if(!e)return!0;const t=new Date().getTime(),i=new Date(e).getTime()-t;return e===""||i<=0}IsConfigExpired(){return this.LoadConfig(),!this.config.JWT||!this.config.ORGID}RequestOptions(e,t){return{method:e,headers:{...{Accept:"application/json","Content-Type":"application/json"},...this.config.JWT&&{Authorization:this.config.JWT}},...e==="POST"&&{body:JSON.stringify(t)}}}async Get(e){return await(await fetch(this.config.HOST+e,this.RequestOptions("GET"))).json()}async Post(e,t){return await(await fetch(this.config.HOST+e,this.RequestOptions("POST",t||{}))).json()}StoreConfig(e){e.JWT&&(localStorage.setItem(`${this.config.STORE_PREFIX}jwtToken`,e.JWT),this.config.JWT=e.JWT),e.EXPIRES&&(localStorage.setItem(`${this.config.STORE_PREFIX}expires`,e.EXPIRES),this.config.EXPIRES=e.EXPIRES),e.ORGID&&(localStorage.setItem(`${this.config.STORE_PREFIX}orgId`,e.ORGID),this.config.ORGID=e.ORGID)}LoadConfig(){const e=localStorage.getItem(`${this.config.STORE_PREFIX}jwtToken`);e&&(this.config.JWT=e);const t=localStorage.getItem(`${this.config.STORE_PREFIX}orgId`);t&&(this.config.ORGID=t);const n=localStorage.getItem(`${this.config.STORE_PREFIX}expires`);return n&&(this.config.EXPIRES=n),this.config}}const ls={storePrefix:{NODE_ENV:"production"}.STORE_PREFIX||"sprie-embed-",host:"https://api.sprie.io"},cs=Object.freeze(ls),w3="1.2.2105";function I3(r,e){const t=r.findIndex(n=>n.sku===e.sku);return t!==-1?[e,...r.slice(0,t),...r.slice(t+1)]:r}class C3{constructor(e,t){Rt(this,"isAuthenticated");Rt(this,"fetcher");Rt(this,"shopifyAPI");Rt(this,"org");Rt(this,"apiKey");Rt(this,"dataVariants");this.isAuthenticated=!1,this.fetcher=e,this.shopifyAPI=t,this.dataVariants=[]}async Authenticate(e){if(this.fetcher.LoadConfig(),(this.fetcher.IsTokenExpired()||this.fetcher.IsConfigExpired())&&await this.AuthServiceApi(e),this.isAuthenticated=!(this.fetcher.IsTokenExpired()&&this.fetcher.IsConfigExpired()),this.org=this.fetcher.config.ORGID,this.apiKey=e,!this.isAuthenticated)throw new Error("Sprie Authentication failed!")}async AuthServiceApi(e){const t=`/v1/widget/auth?api=${e}`,n=await this.fetcher.Get(t);if(!n.access||!n.orgId)throw new Error("SPRIE key Not Authorised");this.fetcher.StoreConfig({...this.fetcher.config,JWT:n.access,ORGID:n.orgId,EXPIRES:n.expires})}async FetchAssetBySKUOrBarcode(e){let t="/v1/widget/variants/";if(e.barcode)t+=`${e.barcode}`;else if(e.sku)t+=`${e.sku}`;else throw new Error("Need either sku or barcode.");return t+="?populate-customisation=true",await this.fetcher.Get(t)}async FetchCustomisationList(e,t){const n=`/v1/widget/list-customisation?search=type:${e},org:${this.fetcher.config.ORGID},usage:customizer&limit=50`,i=await this.fetcher.Get(n),s=i.data.findIndex(h=>h.sku===`${e.toLowerCase()}-default`),o=i.data[s];return!t&&s>-1&&i.data.splice(s,1),{...i,data:t&&o?I3(i.data,o):i.data}}async DownloadMA(e){try{const t=`/v1/widget/org/${e.orgId}/asset/${e.assetsId}/universal-full-encrypted`,n=await this.fetcher.Get(t),i=`org/${e.orgId}/asset/${e.assetsId}`;if(!n)throw new Error("Failed to download model asset.");return{asset:n,decryptionKey:i}}catch{throw new Error("Failed to download model asset.")}}async HandleAssetUsage(e){if(!this.fetcher.IsConfigExpired()&&e){const t={org:this.fetcher.config.ORGID,asset:e,timestamp:new Date().toISOString()},n="/v1/analytics/trigger";await this.fetcher.Post(n,t)}}async PopulateDataList(e){var n;const t=(n=document.querySelector(`#${e}`))==null?void 0:n.textContent;if(t){const i=await JSON.parse(t);return Object.values(i)[0]}return null}async HandleShopifyAddToCart(e,t){e.forEach(s=>{var c;const o=(c=s.properties)==null?void 0:c.customText;o&&(delete s.properties.customText,Object.assign(s.properties,{"custom-laser-etching":"Add Laser Engraving"}),Object.assign(s.properties,{"custom-text":o}),Object.assign(s.properties,{"This customized item cannot be returned or exchanged":"I agree"}),Object.assign(s.properties,{_uniqueTimestamp:t}))});let n={items:e,sections:"mini-cart"};const i=await this.shopifyAPI.Post(n);if(i){const s=await this.shopifyAPI.Get();document.querySelector("#shopify-section-mini-cart").outerHTML=i.sections["mini-cart"],document.querySelector(".header__cart-count").textContent=s.item_count;const o=document.querySelector(".drawer.drawer--full");o&&o.hasAttribute("open")&&o.removeAttribute("open");const c=document.querySelector(".popover.hidden-lap-and-up.popover-full");c&&c.hasAttribute("open")&&c.removeAttribute("open"),document.querySelector(".mini-cart.drawer.drawer--large").setAttribute("open","")}}}var Mp=(r=>(r.Init="init",r.Preparing="preparing",r.Authenticating="authenticating",r.Fetching="fetching",r.Loading="loading",r.Done="done",r))(Mp||{});class M3{constructor({log:e,logErr:t,apiService:n,metaData:i,config:s}){Rt(this,"log");Rt(this,"logErr");Rt(this,"metaData");Rt(this,"loaderName");Rt(this,"apiKey");Rt(this,"scriptStreamEncoderId");Rt(this,"rawNodeList");Rt(this,"targetNodeList");Rt(this,"status");Rt(this,"isLoaded");Rt(this,"loadCount");Rt(this,"mutationObserver");Rt(this,"config");Rt(this,"apiService");this.config=s,this.apiService=n,this.metaData=i,this.apiKey=null,this.scriptStreamEncoderId=`sprie-embed🔴${Date.now().toString()}`,this.rawNodeList=document.getElementsByClassName(this.metaData.targetClassName),this.targetNodeList=[],this.status=Mp.Init,this.isLoaded=!1,this.loadCount=0,this.loaderName="sprie-embed-loader",this.log=e.bind(this),this.logErr=t.bind(this),this.mutationObserver=null}scanApiKeyFromCurrentScriptTag(){const e=document.currentScript;if(!e)return;const t=e==null?void 0:e.getAttribute("src");if(!t)return;const n=new URLSearchParams(t.substring(t.indexOf("?")));this.apiKey=(n==null?void 0:n.get("apikey"))||(n==null?void 0:n.get("apiKey")),this.apiKey&&(e==null||e.setAttribute("data-enc-stream-id",this.scriptStreamEncoderId))}async authenticate(){if(this.status=Mp.Authenticating,!this.apiService.isAuthenticated){if(!this.apiKey)throw new Error("Sprie: Unable to authenticate. Need APIKey.");await this.apiService.Authenticate(this.apiKey),this.apiService.isAuthenticated||this.logErr("Authentication failed! Check apikey and/or expiration.")}}async Init(){try{return this.scanApiKeyFromCurrentScriptTag(),await this.authenticate(),!0}catch(e){return this.log("SprieEmbed Loading failed."),this.logErr(e),this.isLoaded=!1,!1}}}function S3(r){return r&&r.__esModule&&Object.prototype.hasOwnProperty.call(r,"default")?r.default:r}var U1={exports:{}},bc={},P1={exports:{}},Et={};/**
|
|
4
4
|
* @license React
|
|
5
5
|
* react.production.min.js
|
|
6
6
|
*
|
|
@@ -4414,7 +4414,7 @@ bool bvhIntersectFirstHit(
|
|
|
4414
4414
|
* Subject to the terms at https://gsap.com/standard-license or for
|
|
4415
4415
|
* Club GSAP members, the agreement issued with that membership.
|
|
4416
4416
|
* @author: Jack Doyle, jack@greensock.com
|
|
4417
|
-
*/var cI,ya,rc,Bm,So,uI,bm,YP=function(){return typeof window<"u"},Rs={},To=180/Math.PI,nc=Math.PI/180,ic=Math.atan2,hI=1e8,Rm=/([A-Z])/g,qP=/(left|right|width|margin|padding|x)/i,XP=/[\s,\(]\S/,rs={autoAlpha:"opacity,visibility",scale:"scaleX,scaleY",alpha:"opacity"},Dm=function(r,e){return e.set(e.t,e.p,Math.round((e.s+e.c*r)*1e4)/1e4+e.u,e)},KP=function(r,e){return e.set(e.t,e.p,r===1?e.e:Math.round((e.s+e.c*r)*1e4)/1e4+e.u,e)},JP=function(r,e){return e.set(e.t,e.p,r?Math.round((e.s+e.c*r)*1e4)/1e4+e.u:e.b,e)},ZP=function(r,e){var t=e.s+e.c*r;e.set(e.t,e.p,~~(t+(t<0?-.5:.5))+e.u,e)},dI=function(r,e){return e.set(e.t,e.p,r?e.e:e.b,e)},fI=function(r,e){return e.set(e.t,e.p,r!==1?e.b:e.e,e)},$P=function(r,e,t){return r.style[e]=t},e7=function(r,e,t){return r.style.setProperty(e,t)},t7=function(r,e,t){return r._gsap[e]=t},r7=function(r,e,t){return r._gsap.scaleX=r._gsap.scaleY=t},n7=function(r,e,t,n,i){var s=r._gsap;s.scaleX=s.scaleY=t,s.renderTransform(i,s)},i7=function(r,e,t,n,i){var s=r._gsap;s[e]=t,s.renderTransform(i,s)},ir="transform",Tn=ir+"Origin",s7=function r(e,t){var n=this,i=this.target,s=i.style,o=i._gsap;if(e in Rs&&s){if(this.tfm=this.tfm||{},e!=="transform")e=rs[e]||e,~e.indexOf(",")?e.split(",").forEach(function(c){return n.tfm[c]=Ds(i,c)}):this.tfm[e]=o.x?o[e]:Ds(i,e),e===Tn&&(this.tfm.zOrigin=o.zOrigin);else return rs.transform.split(",").forEach(function(c){return r.call(n,c,t)});if(this.props.indexOf(ir)>=0)return;o.svg&&(this.svgo=i.getAttribute("data-svg-origin"),this.props.push(Tn,t,"")),e=ir}(s||t)&&this.props.push(e,t,s[e])},pI=function(r){r.translate&&(r.removeProperty("translate"),r.removeProperty("scale"),r.removeProperty("rotate"))},a7=function(){var r=this.props,e=this.target,t=e.style,n=e._gsap,i,s;for(i=0;i<r.length;i+=3)r[i+1]?e[r[i]]=r[i+2]:r[i+2]?t[r[i]]=r[i+2]:t.removeProperty(r[i].substr(0,2)==="--"?r[i]:r[i].replace(Rm,"-$1").toLowerCase());if(this.tfm){for(s in this.tfm)n[s]=this.tfm[s];n.svg&&(n.renderTransform(),e.setAttribute("data-svg-origin",this.svgo||"")),i=bm(),(!i||!i.isStart)&&!t[ir]&&(pI(t),n.zOrigin&&t[Tn]&&(t[Tn]+=" "+n.zOrigin+"px",n.zOrigin=0,n.renderTransform()),n.uncache=1)}},AI=function(r,e){var t={target:r,props:[],revert:a7,save:s7};return r._gsap||Sn.core.getCache(r),e&&e.split(",").forEach(function(n){return t.save(n)}),t},gI,Lm=function(r,e){var t=ya.createElementNS?ya.createElementNS((e||"http://www.w3.org/1999/xhtml").replace(/^https/,"http"),r):ya.createElement(r);return t&&t.style?t:ya.createElement(r)},ns=function r(e,t,n){var i=getComputedStyle(e);return i[t]||i.getPropertyValue(t.replace(Rm,"-$1").toLowerCase())||i.getPropertyValue(t)||!n&&r(e,sc(t)||t,1)||""},mI="O,Moz,ms,Ms,Webkit".split(","),sc=function(r,e,t){var n=e||So,i=n.style,s=5;if(r in i&&!t)return r;for(r=r.charAt(0).toUpperCase()+r.substr(1);s--&&!(mI[s]+r in i););return s<0?null:(s===3?"ms":s>=0?mI[s]:"")+r},Nm=function(){YP()&&window.document&&(cI=window,ya=cI.document,rc=ya.documentElement,So=Lm("div")||{style:{}},Lm("div"),ir=sc(ir),Tn=ir+"Origin",So.style.cssText="border-width:0;line-height:0;position:absolute;padding:0",gI=!!sc("perspective"),bm=Sn.core.reverting,Bm=1)},Um=function r(e){var t=Lm("svg",this.ownerSVGElement&&this.ownerSVGElement.getAttribute("xmlns")||"http://www.w3.org/2000/svg"),n=this.parentNode,i=this.nextSibling,s=this.style.cssText,o;if(rc.appendChild(t),t.appendChild(this),this.style.display="block",e)try{o=this.getBBox(),this._gsapBBox=this.getBBox,this.getBBox=r}catch{}else this._gsapBBox&&(o=this._gsapBBox());return n&&(i?n.insertBefore(this,i):n.appendChild(this)),rc.removeChild(t),this.style.cssText=s,o},_I=function(r,e){for(var t=e.length;t--;)if(r.hasAttribute(e[t]))return r.getAttribute(e[t])},vI=function(r){var e;try{e=r.getBBox()}catch{e=Um.call(r,!0)}return e&&(e.width||e.height)||r.getBBox===Um||(e=Um.call(r,!0)),e&&!e.width&&!e.x&&!e.y?{x:+_I(r,["x","cx","x1"])||0,y:+_I(r,["y","cy","y1"])||0,width:0,height:0}:e},yI=function(r){return!!(r.getCTM&&(!r.parentNode||r.ownerSVGElement)&&vI(r))},Bo=function(r,e){if(e){var t=r.style,n;e in Rs&&e!==Tn&&(e=ir),t.removeProperty?(n=e.substr(0,2),(n==="ms"||e.substr(0,6)==="webkit")&&(e="-"+e),t.removeProperty(n==="--"?e:e.replace(Rm,"-$1").toLowerCase())):t.removeAttribute(e)}},Ea=function(r,e,t,n,i,s){var o=new Mn(r._pt,e,t,0,1,s?fI:dI);return r._pt=o,o.b=n,o.e=i,r._props.push(t),o},EI={deg:1,rad:1,turn:1},o7={grid:1,flex:1},xa=function r(e,t,n,i){var s=parseFloat(n)||0,o=(n+"").trim().substr((s+"").length)||"px",c=So.style,h=qP.test(t),u=e.tagName.toLowerCase()==="svg",d=(u?"client":"offset")+(h?"Width":"Height"),A=100,p=i==="px",g=i==="%",v,E,m,_;if(i===o||!s||EI[i]||EI[o])return s;if(o!=="px"&&!p&&(s=r(e,t,n,"px")),_=e.getCTM&&yI(e),(g||o==="%")&&(Rs[t]||~t.indexOf("adius")))return v=_?e.getBBox()[h?"width":"height"]:e[d],vr(g?s/v*A:s/100*v);if(c[h?"width":"height"]=A+(p?o:i),E=~t.indexOf("adius")||i==="em"&&e.appendChild&&!u?e:e.parentNode,_&&(E=(e.ownerSVGElement||{}).parentNode),(!E||E===ya||!E.appendChild)&&(E=ya.body),m=E._gsap,m&&g&&m.width&&h&&m.time===Kn.time&&!m.uncache)return vr(s/m.width*A);if(g&&(t==="height"||t==="width")){var w=e.style[t];e.style[t]=A+i,v=e[d],w?e.style[t]=w:Bo(e,t)}else(g||o==="%")&&!o7[ns(E,"display")]&&(c.position=ns(e,"position")),E===e&&(c.position="static"),E.appendChild(So),v=So[d],E.removeChild(So),c.position="absolute";return h&&g&&(m=Eo(E),m.time=Kn.time,m.width=E[d]),vr(p?v*s/A:v&&s?A/v*s:0)},Ds=function(r,e,t,n){var i;return Bm||Nm(),e in rs&&e!=="transform"&&(e=rs[e],~e.indexOf(",")&&(e=e.split(",")[0])),Rs[e]&&e!=="transform"?(i=Gu(r,n),i=e!=="transformOrigin"?i[e]:i.svg?i.origin:vf(ns(r,Tn))+" "+i.zOrigin+"px"):(i=r.style[e],(!i||i==="auto"||n||~(i+"").indexOf("calc("))&&(i=_f[e]&&_f[e](r,e,t)||ns(r,e)||Cw(r,e)||(e==="opacity"?1:0))),t&&!~(i+"").trim().indexOf(" ")?xa(r,e,i,t)+t:i},l7=function(r,e,t,n){if(!t||t==="none"){var i=sc(e,r,1),s=i&&ns(r,i,1);s&&s!==t?(e=i,t=s):e==="borderColor"&&(t=ns(r,"borderTopColor"))}var o=new Mn(this._pt,r.style,e,0,1,sI),c=0,h=0,u,d,A,p,g,v,E,m,_,w,x,I;if(o.b=t,o.e=n,t+="",n+="",n==="auto"&&(v=r.style[e],r.style[e]=n,n=ns(r,e)||n,v?r.style[e]=v:Bo(r,e)),u=[t,n],Xw(u),t=u[0],n=u[1],A=t.match(Kl)||[],I=n.match(Kl)||[],I.length){for(;d=Kl.exec(n);)E=d[0],_=n.substring(c,d.index),g?g=(g+1)%5:(_.substr(-5)==="rgba("||_.substr(-5)==="hsla(")&&(g=1),E!==(v=A[h++]||"")&&(p=parseFloat(v)||0,x=v.substr((p+"").length),E.charAt(1)==="="&&(E=Jl(p,E)+x),m=parseFloat(E),w=E.substr((m+"").length),c=Kl.lastIndex-w.length,w||(w=w||Wn.units[e]||x,c===n.length&&(n+=w,o.e+=w)),x!==w&&(p=xa(r,e,v,w)||0),o._pt={_next:o._pt,p:_||h===1?_:",",s:p,c:m-p,m:g&&g<4||e==="zIndex"?Math.round:0});o.c=c<n.length?n.substring(c,n.length):""}else o.r=e==="display"&&n==="none"?fI:dI;return _w.test(n)&&(o.e=0),this._pt=o,o},xI={top:"0%",bottom:"100%",left:"0%",right:"100%",center:"50%"},c7=function(r){var e=r.split(" "),t=e[0],n=e[1]||"50%";return(t==="top"||t==="bottom"||n==="left"||n==="right")&&(r=t,t=n,n=r),e[0]=xI[t]||t,e[1]=xI[n]||n,e.join(" ")},u7=function(r,e){if(e.tween&&e.tween._time===e.tween._dur){var t=e.t,n=t.style,i=e.u,s=t._gsap,o,c,h;if(i==="all"||i===!0)n.cssText="",c=1;else for(i=i.split(","),h=i.length;--h>-1;)o=i[h],Rs[o]&&(c=1,o=o==="transformOrigin"?Tn:ir),Bo(t,o);c&&(Bo(t,ir),s&&(s.svg&&t.removeAttribute("transform"),Gu(t,1),s.uncache=1,pI(n)))}},_f={clearProps:function(r,e,t,n,i){if(i.data!=="isFromStart"){var s=r._pt=new Mn(r._pt,e,t,0,0,u7);return s.u=n,s.pr=-10,s.tween=i,r._props.push(t),1}}},Hu=[1,0,0,1,0,0],wI={},II=function(r){return r==="matrix(1, 0, 0, 1, 0, 0)"||r==="none"||!r},CI=function(r){var e=ns(r,ir);return II(e)?Hu:e.substr(7).match(mw).map(vr)},Pm=function(r,e){var t=r._gsap||Eo(r),n=r.style,i=CI(r),s,o,c,h;return t.svg&&r.getAttribute("transform")?(c=r.transform.baseVal.consolidate().matrix,i=[c.a,c.b,c.c,c.d,c.e,c.f],i.join(",")==="1,0,0,1,0,0"?Hu:i):(i===Hu&&!r.offsetParent&&r!==rc&&!t.svg&&(c=n.display,n.display="block",s=r.parentNode,(!s||!r.offsetParent)&&(h=1,o=r.nextElementSibling,rc.appendChild(r)),i=CI(r),c?n.display=c:Bo(r,"display"),h&&(o?s.insertBefore(r,o):s?s.appendChild(r):rc.removeChild(r))),e&&i.length>6?[i[0],i[1],i[4],i[5],i[12],i[13]]:i)},km=function(r,e,t,n,i,s){var o=r._gsap,c=i||Pm(r,!0),h=o.xOrigin||0,u=o.yOrigin||0,d=o.xOffset||0,A=o.yOffset||0,p=c[0],g=c[1],v=c[2],E=c[3],m=c[4],_=c[5],w=e.split(" "),x=parseFloat(w[0])||0,I=parseFloat(w[1])||0,R,S,T,D;t?c!==Hu&&(S=p*E-g*v)&&(T=x*(E/S)+I*(-v/S)+(v*_-E*m)/S,D=x*(-g/S)+I*(p/S)-(p*_-g*m)/S,x=T,I=D):(R=vI(r),x=R.x+(~w[0].indexOf("%")?x/100*R.width:x),I=R.y+(~(w[1]||w[0]).indexOf("%")?I/100*R.height:I)),n||n!==!1&&o.smooth?(m=x-h,_=I-u,o.xOffset=d+(m*p+_*v)-m,o.yOffset=A+(m*g+_*E)-_):o.xOffset=o.yOffset=0,o.xOrigin=x,o.yOrigin=I,o.smooth=!!n,o.origin=e,o.originIsAbsolute=!!t,r.style[Tn]="0px 0px",s&&(Ea(s,o,"xOrigin",h,x),Ea(s,o,"yOrigin",u,I),Ea(s,o,"xOffset",d,o.xOffset),Ea(s,o,"yOffset",A,o.yOffset)),r.setAttribute("data-svg-origin",x+" "+I)},Gu=function(r,e){var t=r._gsap||new $w(r);if("x"in t&&!e&&!t.uncache)return t;var n=r.style,i=t.scaleX<0,s="px",o="deg",c=getComputedStyle(r),h=ns(r,Tn)||"0",u,d,A,p,g,v,E,m,_,w,x,I,R,S,T,D,b,M,L,P,N,W,X,K,te,G,ee,Q,z,Z,re,V;return u=d=A=v=E=m=_=w=x=0,p=g=1,t.svg=!!(r.getCTM&&yI(r)),c.translate&&((c.translate!=="none"||c.scale!=="none"||c.rotate!=="none")&&(n[ir]=(c.translate!=="none"?"translate3d("+(c.translate+" 0 0").split(" ").slice(0,3).join(", ")+") ":"")+(c.rotate!=="none"?"rotate("+c.rotate+") ":"")+(c.scale!=="none"?"scale("+c.scale.split(" ").join(",")+") ":"")+(c[ir]!=="none"?c[ir]:"")),n.scale=n.rotate=n.translate="none"),S=Pm(r,t.svg),t.svg&&(t.uncache?(te=r.getBBox(),h=t.xOrigin-te.x+"px "+(t.yOrigin-te.y)+"px",K=""):K=!e&&r.getAttribute("data-svg-origin"),km(r,K||h,!!K||t.originIsAbsolute,t.smooth!==!1,S)),I=t.xOrigin||0,R=t.yOrigin||0,S!==Hu&&(M=S[0],L=S[1],P=S[2],N=S[3],u=W=S[4],d=X=S[5],S.length===6?(p=Math.sqrt(M*M+L*L),g=Math.sqrt(N*N+P*P),v=M||L?ic(L,M)*To:0,_=P||N?ic(P,N)*To+v:0,_&&(g*=Math.abs(Math.cos(_*nc))),t.svg&&(u-=I-(I*M+R*P),d-=R-(I*L+R*N))):(V=S[6],Z=S[7],ee=S[8],Q=S[9],z=S[10],re=S[11],u=S[12],d=S[13],A=S[14],T=ic(V,z),E=T*To,T&&(D=Math.cos(-T),b=Math.sin(-T),K=W*D+ee*b,te=X*D+Q*b,G=V*D+z*b,ee=W*-b+ee*D,Q=X*-b+Q*D,z=V*-b+z*D,re=Z*-b+re*D,W=K,X=te,V=G),T=ic(-P,z),m=T*To,T&&(D=Math.cos(-T),b=Math.sin(-T),K=M*D-ee*b,te=L*D-Q*b,G=P*D-z*b,re=N*b+re*D,M=K,L=te,P=G),T=ic(L,M),v=T*To,T&&(D=Math.cos(T),b=Math.sin(T),K=M*D+L*b,te=W*D+X*b,L=L*D-M*b,X=X*D-W*b,M=K,W=te),E&&Math.abs(E)+Math.abs(v)>359.9&&(E=v=0,m=180-m),p=vr(Math.sqrt(M*M+L*L+P*P)),g=vr(Math.sqrt(X*X+V*V)),T=ic(W,X),_=Math.abs(T)>2e-4?T*To:0,x=re?1/(re<0?-re:re):0),t.svg&&(K=r.getAttribute("transform"),t.forceCSS=r.setAttribute("transform","")||!II(ns(r,ir)),K&&r.setAttribute("transform",K))),Math.abs(_)>90&&Math.abs(_)<270&&(i?(p*=-1,_+=v<=0?180:-180,v+=v<=0?180:-180):(g*=-1,_+=_<=0?180:-180)),e=e||t.uncache,t.x=u-((t.xPercent=u&&(!e&&t.xPercent||(Math.round(r.offsetWidth/2)===Math.round(-u)?-50:0)))?r.offsetWidth*t.xPercent/100:0)+s,t.y=d-((t.yPercent=d&&(!e&&t.yPercent||(Math.round(r.offsetHeight/2)===Math.round(-d)?-50:0)))?r.offsetHeight*t.yPercent/100:0)+s,t.z=A+s,t.scaleX=vr(p),t.scaleY=vr(g),t.rotation=vr(v)+o,t.rotationX=vr(E)+o,t.rotationY=vr(m)+o,t.skewX=_+o,t.skewY=w+o,t.transformPerspective=x+s,(t.zOrigin=parseFloat(h.split(" ")[2])||!e&&t.zOrigin||0)&&(n[Tn]=vf(h)),t.xOffset=t.yOffset=0,t.force3D=Wn.force3D,t.renderTransform=t.svg?d7:gI?MI:h7,t.uncache=0,t},vf=function(r){return(r=r.split(" "))[0]+" "+r[1]},Qm=function(r,e,t){var n=en(e);return vr(parseFloat(e)+parseFloat(xa(r,"x",t+"px",n)))+n},h7=function(r,e){e.z="0px",e.rotationY=e.rotationX="0deg",e.force3D=0,MI(r,e)},bo="0deg",Vu="0px",Ro=") ",MI=function(r,e){var t=e||this,n=t.xPercent,i=t.yPercent,s=t.x,o=t.y,c=t.z,h=t.rotation,u=t.rotationY,d=t.rotationX,A=t.skewX,p=t.skewY,g=t.scaleX,v=t.scaleY,E=t.transformPerspective,m=t.force3D,_=t.target,w=t.zOrigin,x="",I=m==="auto"&&r&&r!==1||m===!0;if(w&&(d!==bo||u!==bo)){var R=parseFloat(u)*nc,S=Math.sin(R),T=Math.cos(R),D;R=parseFloat(d)*nc,D=Math.cos(R),s=Qm(_,s,S*D*-w),o=Qm(_,o,-Math.sin(R)*-w),c=Qm(_,c,T*D*-w+w)}E!==Vu&&(x+="perspective("+E+Ro),(n||i)&&(x+="translate("+n+"%, "+i+"%) "),(I||s!==Vu||o!==Vu||c!==Vu)&&(x+=c!==Vu||I?"translate3d("+s+", "+o+", "+c+") ":"translate("+s+", "+o+Ro),h!==bo&&(x+="rotate("+h+Ro),u!==bo&&(x+="rotateY("+u+Ro),d!==bo&&(x+="rotateX("+d+Ro),(A!==bo||p!==bo)&&(x+="skew("+A+", "+p+Ro),(g!==1||v!==1)&&(x+="scale("+g+", "+v+Ro),_.style[ir]=x||"translate(0, 0)"},d7=function(r,e){var t=e||this,n=t.xPercent,i=t.yPercent,s=t.x,o=t.y,c=t.rotation,h=t.skewX,u=t.skewY,d=t.scaleX,A=t.scaleY,p=t.target,g=t.xOrigin,v=t.yOrigin,E=t.xOffset,m=t.yOffset,_=t.forceCSS,w=parseFloat(s),x=parseFloat(o),I,R,S,T,D;c=parseFloat(c),h=parseFloat(h),u=parseFloat(u),u&&(u=parseFloat(u),h+=u,c+=u),c||h?(c*=nc,h*=nc,I=Math.cos(c)*d,R=Math.sin(c)*d,S=Math.sin(c-h)*-A,T=Math.cos(c-h)*A,h&&(u*=nc,D=Math.tan(h-u),D=Math.sqrt(1+D*D),S*=D,T*=D,u&&(D=Math.tan(u),D=Math.sqrt(1+D*D),I*=D,R*=D)),I=vr(I),R=vr(R),S=vr(S),T=vr(T)):(I=d,T=A,R=S=0),(w&&!~(s+"").indexOf("px")||x&&!~(o+"").indexOf("px"))&&(w=xa(p,"x",s,"px"),x=xa(p,"y",o,"px")),(g||v||E||m)&&(w=vr(w+g-(g*I+v*S)+E),x=vr(x+v-(g*R+v*T)+m)),(n||i)&&(D=p.getBBox(),w=vr(w+n/100*D.width),x=vr(x+i/100*D.height)),D="matrix("+I+","+R+","+S+","+T+","+w+","+x+")",p.setAttribute("transform",D),_&&(p.style[ir]=D)},f7=function(r,e,t,n,i){var s=360,o=zr(i),c=parseFloat(i)*(o&&~i.indexOf("rad")?To:1),h=c-n,u=n+h+"deg",d,A;return o&&(d=i.split("_")[1],d==="short"&&(h%=s,h!==h%(s/2)&&(h+=h<0?s:-s)),d==="cw"&&h<0?h=(h+s*hI)%s-~~(h/s)*s:d==="ccw"&&h>0&&(h=(h-s*hI)%s-~~(h/s)*s)),r._pt=A=new Mn(r._pt,e,t,n,h,KP),A.e=u,A.u="deg",r._props.push(t),A},SI=function(r,e){for(var t in e)r[t]=e[t];return r},p7=function(r,e,t){var n=SI({},t._gsap),i="perspective,force3D,transformOrigin,svgOrigin",s=t.style,o,c,h,u,d,A,p,g;n.svg?(h=t.getAttribute("transform"),t.setAttribute("transform",""),s[ir]=e,o=Gu(t,1),Bo(t,ir),t.setAttribute("transform",h)):(h=getComputedStyle(t)[ir],s[ir]=e,o=Gu(t,1),s[ir]=h);for(c in Rs)h=n[c],u=o[c],h!==u&&i.indexOf(c)<0&&(p=en(h),g=en(u),d=p!==g?xa(t,c,h,g):parseFloat(h),A=parseFloat(u),r._pt=new Mn(r._pt,o,c,d,A-d,Dm),r._pt.u=g||0,r._props.push(c));SI(o,n)};Cn("padding,margin,Width,Radius",function(r,e){var t="Top",n="Right",i="Bottom",s="Left",o=(e<3?[t,n,i,s]:[t+s,t+n,i+n,i+s]).map(function(c){return e<2?r+c:"border"+c+r});_f[e>1?"border"+r:r]=function(c,h,u,d,A){var p,g;if(arguments.length<4)return p=o.map(function(v){return Ds(c,v,u)}),g=p.join(" "),g.split(p[0]).length===5?p[0]:g;p=(d+"").split(" "),g={},o.forEach(function(v,E){return g[v]=p[E]=p[E]||p[(E-1)/2|0]}),c.init(h,g,A)}});var TI={name:"css",register:Nm,targetTest:function(r){return r.style&&r.nodeType},init:function(r,e,t,n,i){var s=this._props,o=r.style,c=t.vars.startAt,h,u,d,A,p,g,v,E,m,_,w,x,I,R,S,T;Bm||Nm(),this.styles=this.styles||AI(r),T=this.styles.props,this.tween=t;for(v in e)if(v!=="autoRound"&&(u=e[v],!(qn[v]&&eI(v,e,t,n,r,i)))){if(p=typeof u,g=_f[v],p==="function"&&(u=u.call(t,n,r,i),p=typeof u),p==="string"&&~u.indexOf("random(")&&(u=Pu(u)),g)g(this,r,v,u,t)&&(S=1);else if(v.substr(0,2)==="--")h=(getComputedStyle(r).getPropertyValue(v)+"").trim(),u+="",_a.lastIndex=0,_a.test(h)||(E=en(h),m=en(u)),m?E!==m&&(h=xa(r,v,h,m)+m):E&&(u+=E),this.add(o,"setProperty",h,u,n,i,0,0,v),s.push(v),T.push(v,0,o[v]);else if(p!=="undefined"){if(c&&v in c?(h=typeof c[v]=="function"?c[v].call(t,n,r,i):c[v],zr(h)&&~h.indexOf("random(")&&(h=Pu(h)),en(h+"")||h==="auto"||(h+=Wn.units[v]||en(Ds(r,v))||""),(h+"").charAt(1)==="="&&(h=Ds(r,v))):h=Ds(r,v),A=parseFloat(h),_=p==="string"&&u.charAt(1)==="="&&u.substr(0,2),_&&(u=u.substr(2)),d=parseFloat(u),v in rs&&(v==="autoAlpha"&&(A===1&&Ds(r,"visibility")==="hidden"&&d&&(A=0),T.push("visibility",0,o.visibility),Ea(this,o,"visibility",A?"inherit":"hidden",d?"inherit":"hidden",!d)),v!=="scale"&&v!=="transform"&&(v=rs[v],~v.indexOf(",")&&(v=v.split(",")[0]))),w=v in Rs,w){if(this.styles.save(v),x||(I=r._gsap,I.renderTransform&&!e.parseTransform||Gu(r,e.parseTransform),R=e.smoothOrigin!==!1&&I.smooth,x=this._pt=new Mn(this._pt,o,ir,0,1,I.renderTransform,I,0,-1),x.dep=1),v==="scale")this._pt=new Mn(this._pt,I,"scaleY",I.scaleY,(_?Jl(I.scaleY,_+d):d)-I.scaleY||0,Dm),this._pt.u=0,s.push("scaleY",v),v+="X";else if(v==="transformOrigin"){T.push(Tn,0,o[Tn]),u=c7(u),I.svg?km(r,u,0,R,0,this):(m=parseFloat(u.split(" ")[2])||0,m!==I.zOrigin&&Ea(this,I,"zOrigin",I.zOrigin,m),Ea(this,o,v,vf(h),vf(u)));continue}else if(v==="svgOrigin"){km(r,u,1,R,0,this);continue}else if(v in wI){f7(this,I,v,A,_?Jl(A,_+u):u);continue}else if(v==="smoothOrigin"){Ea(this,I,"smooth",I.smooth,u);continue}else if(v==="force3D"){I[v]=u;continue}else if(v==="transform"){p7(this,u,r);continue}}else v in o||(v=sc(v)||v);if(w||(d||d===0)&&(A||A===0)&&!XP.test(u)&&v in o)E=(h+"").substr((A+"").length),d||(d=0),m=en(u)||(v in Wn.units?Wn.units[v]:E),E!==m&&(A=xa(r,v,h,m)),this._pt=new Mn(this._pt,w?I:o,v,A,(_?Jl(A,_+d):d)-A,!w&&(m==="px"||v==="zIndex")&&e.autoRound!==!1?ZP:Dm),this._pt.u=m||0,E!==m&&m!=="%"&&(this._pt.b=h,this._pt.r=JP);else if(v in o)l7.call(this,r,v,h,_?_+u:u);else if(v in r)this.add(r,v,h||r[v],_?_+u:u,n,i);else if(v!=="parseTransform"){am(v,u);continue}w||(v in o?T.push(v,0,o[v]):T.push(v,1,h||r[v])),s.push(v)}}S&&aI(this)},render:function(r,e){if(e.tween._time||!bm())for(var t=e._pt;t;)t.r(r,t.d),t=t._next;else e.styles.revert()},get:Ds,aliases:rs,getSetter:function(r,e,t){var n=rs[e];return n&&n.indexOf(",")<0&&(e=n),e in Rs&&e!==Tn&&(r._gsap.x||Ds(r,"x"))?t&&uI===t?e==="scale"?r7:t7:(uI=t||{})&&(e==="scale"?n7:i7):r.style&&!em(r.style[e])?$P:~e.indexOf("-")?e7:Im(r,e)},core:{_removeProperty:Bo,_getMatrix:Pm}};Sn.utils.checkPrefix=sc,Sn.core.getStyleSaver=AI,function(r,e,t,n){var i=Cn(r+","+e+","+t,function(s){Rs[s]=1});Cn(e,function(s){Wn.units[s]="deg",wI[s]=1}),rs[i[13]]=r+","+e,Cn(n,function(s){var o=s.split(":");rs[o[1]]=i[o[0]]})}("x,y,z,scale,scaleX,scaleY,xPercent,yPercent","rotation,rotationX,rotationY,skewX,skewY","transform,transformOrigin,svgOrigin,force3D,smoothOrigin,transformPerspective","0:translateX,1:translateY,2:translateZ,8:rotate,8:rotationZ,8:rotateZ,9:rotateX,10:rotateY"),Cn("x,y,z,top,right,bottom,left,width,height,fontSize,padding,margin,perspective",function(r){Wn.units[r]="px"}),Sn.registerPlugin(TI);var Om=Sn.registerPlugin(TI)||Sn;Om.core.Tween;const wa=/iPhone|iPod|Android/i.test(navigator.userAgent),BI=new DN,A7={Front:{value:wa?new j(4.7,1.9,7.5):new j(1.8,.65,2.5)},Back:{value:wa?new j(0,1.9,-7.5):new j(0,.65,-4)},Left:{value:wa?new j(-9.14,1.17,3):new j(-3.5,.4,1)},Right:{value:wa?new j(9.14,1.17,3):new j(3.5,.4,1)},Top:{value:wa?new j(0,9.23,3):new j(0,3.5,1)},Bottom:{value:wa?new j(.6,-9.23,3):new j(.1,-3.5,1)},FlatFront:{value:new j(0,0,3)},FlatLeft:{value:new j(-2,0,0)},FlatRight:{value:new j(2,0,0)},FlatTop:{value:new j(0,.75,1)}};let tn,yf=!1,Fm=!1,zm,ur,Do=!1,Hm=!1,Gm;const g7=new Li({metalness:0,roughness:1,ior:1,opacity:1,clearcoat:0,color:new qe(16777215),transparent:!1,shadowSide:kr,depthWrite:!0,map:null,alphaMap:null,aoMap:null,roughnessMap:null,metalnessMap:null,normalMap:null});let Lo,Ia=[],Vm,jm=!1,Wm=!1;const Ym=[0,.4,.7,1],bI=[.85,.62,.3,0],RI=[new qe(16777215),new qe(16777215),new qe(16777215),new qe(16777215)],Rr={resolution:{value:new Ge(0,0)},color:{value:new qe(16777215)},metalness:{value:1},maxX:{value:.1},minX:{value:-.1},minY:{value:-.1},maxY:{value:.1},uAlpha:{value:!1},gradientColors:{value:RI},positions:{value:Ym},opacities:{value:bI}},m7=1;new dd().set(m7),new xs({color:"black"});class _7{constructor(){xt(this,"scene"),xt(this,"camera"),xt(this,"renderer"),xt(this,"canvas"),xt(this,"canvasSize"),xt(this,"isInitialised"),xt(this,"orgId"),xt(this,"textureLoader"),xt(this,"raycaster"),xt(this,"isTouchDown"),xt(this,"touchDownTime"),xt(this,"touchDownTimeout"),xt(this,"onPointerDown",e=>{e.target.localName==="canvas"&&(this.isTouchDown=!0,this.touchDownTime=Date.now())}),xt(this,"onPointerMove",e=>{e.target.localName==="canvas"&&this.isTouchDown&&(this.isTouchDown=!1,this.touchDownTime=0)}),xt(this,"onPointerUp",e=>{e.target.localName==="canvas"&&this.isTouchDown&&(this.isTouchDown=!1,Date.now()-this.touchDownTime>this.touchDownTimeout?(this.isTouchDown=!1,console.log("Long touch or rogue touch canceled")):this.handlePointerOnValidInput(e))}),xt(this,"handlePointerOnValidInput",e=>{const{isValid:t,x:n,y:i}=this.checkInputValidity(e);if(!t)return;const s=new Ge;if(s.x=n/this.canvas.clientWidth*2-1,s.y=-(i/this.canvas.clientHeight)*2+1,this.raycaster.setFromCamera(s,this.camera),!this.isTouchDown||this.isTouchDown&&Date.now()-this.touchDownTime<=this.touchDownTimeout){const o=this.raycaster.intersectObjects(this.scene.children,!0);for(const c of o)if(c.object.name.toLowerCase().includes("gemstone")){const h=new CustomEvent("gemZoneDetectedOnTouch",{detail:c.object.name.replace("Gemstone_Zone","")});document.dispatchEvent(h);break}}}),xt(this,"checkInputValidity",e=>{let t,n;return t=e.clientX,n=e.clientY-Math.round(window.innerHeight*(wa?.1:.08)),n<0||n>this.canvas.clientHeight?{isValid:!1,x:0,y:0}:{isValid:!0,x:t,y:n}}),this.scene=new qL,this.canvasSize=new Ge,this.isInitialised=!1,this.textureLoader=new rx,this.raycaster=new k8,this.isTouchDown=!1,this.touchDownTime=0,this.touchDownTimeout=500,this.orgId=""}async intialise(){this.canvas=document.querySelector("canvas.sprie-config-webgl");const e=this.canvas.clientWidth,t=this.canvas.clientHeight;this.canvasSize.set(e,t),this.camera=new un(12,e/t,.1,1e4),this.camera.lookAt(0,0,0),this.scene.background=new qe("#ffffff"),this.renderer=new YL({canvas:this.canvas,alpha:!0,antialias:!0}),this.renderer.toneMapping=uA,this.renderer.toneMappingExposure=1,this.renderer.setClearColor(16777215),this.renderer.outputColorSpace=Qr,this.resizeRenderer(),BI.load("https://sprie-jarvis-public.s3.eu-west-2.amazonaws.com/environment_desaturated.hdr",n=>{n.mapping=Jc,n.colorSpace=mr,this.scene.environment=n}),BI.load("https://sprie-jarvis-public.s3.eu-west-2.amazonaws.com/gems.hdr",n=>{n.mapping=Jc,n.colorSpace=mr,Lo=n}),document.addEventListener("mousedown",this.onPointerDown),document.addEventListener("mousemove",this.onPointerMove),document.addEventListener("mouseup",this.onPointerUp),this.isInitialised=!0}resizeRenderer(){var e;const t=Math.min(window.devicePixelRatio,2),n=Math.floor(this.canvas.clientWidth*t),i=Math.floor(this.canvas.clientHeight*t),s=this.canvas.clientWidth!==n||this.canvas.clientHeight!==i;return s&&((e=this.renderer)==null||e.setSize(n,i,!1)),s}cleanUp(){document.removeEventListener("mousedown",this.onPointerDown),document.removeEventListener("mousemove",this.onPointerMove),document.removeEventListener("mouseup",this.onPointerUp),this.renderer&&this.renderer.dispose()}loadModelInsideScene(e){this.scene.traverse(t=>{t.name=="Scene"&&(this.scene.remove(t),t.traverse(n=>{n instanceof Yr&&(n.geometry.dispose(),n.material.dispose())}))}),this.scene.add(e)}setLighting(e){const t=new y8(16777215,16777215,2);t.color.setHSL(.6,1,.6),t.groundColor.setHSL(.095,1,.75),t.position.set(0,50,0),e.add(t);const n=new ax(16777215,1.5);n.color.setHSL(.1,1,.95),n.position.set(-1,1.75,1),n.position.multiplyScalar(30),e.add(n)}setOrbitControls(e,t){const n=new O8(e,this.canvas);return n.target.set(.003059340956040225,-.13425621157020154,-.2564218846390263),wa?(e.position.set(4.7,1.9,7.5),n.minDistance=2.5,n.maxDistance=11,n.rotateSpeed=.8):(e.position.set(1.8,.65,2.5),n.minDistance=1.5,n.maxDistance=5,n.rotateSpeed=.5),t&&t!==0&&(n.autoRotate=!0,n.autoRotateSpeed=t),n.enableDamping=!0,n.dampingFactor=.2,n.enablePan=!1,n.minPolarAngle=-Math.PI*5/36,n.maxPolarAngle=Math.PI*3/5,n.update(),n}setupMSAA(e,t){const n=new zN,i=new HN(this.scene,t);i.clearAlpha=0;const s=e.getDrawingBufferSize(new Ge),o=new Si(s.width,s.height,{samples:4,type:yn}),c=new ON(e,o);return c.addPass(i),c.addPass(n),c}setupShadows(){const e={shadow:{blur:.6,darkness:1,opacity:.6},plane:{color:"#ffffff",opacity:1},showWireframe:!1},t=new aa;t.position.y=-.315,this.scene.add(t);const n=new Si(256,256);n.texture.generateMipmaps=!1;const i=new Si(256,256);i.texture.generateMipmaps=!1;const s=new fu(2.5,2.5).rotateX(Math.PI/2),o=new xs({map:n.texture,opacity:e.shadow.opacity,transparent:!0,depthWrite:!1}),c=new Yr(s,o);c.renderOrder=1,t.add(c),c.scale.y=-1;const h=new Yr(s);h.visible=!1,t.add(h);const u=new pu(-2.5/2,2.5/2,2.5/2,-2.5/2,0,.4);u.rotation.x=Math.PI/2,t.add(u);const d=new L2;d.userData.darkness={value:e.shadow.darkness},d.onBeforeCompile=E=>{const m=E;m.uniforms.darkness=d.userData.darkness,m.fragmentShader=`
|
|
4417
|
+
*/var cI,ya,rc,Bm,So,uI,bm,YP=function(){return typeof window<"u"},Rs={},To=180/Math.PI,nc=Math.PI/180,ic=Math.atan2,hI=1e8,Rm=/([A-Z])/g,qP=/(left|right|width|margin|padding|x)/i,XP=/[\s,\(]\S/,rs={autoAlpha:"opacity,visibility",scale:"scaleX,scaleY",alpha:"opacity"},Dm=function(r,e){return e.set(e.t,e.p,Math.round((e.s+e.c*r)*1e4)/1e4+e.u,e)},KP=function(r,e){return e.set(e.t,e.p,r===1?e.e:Math.round((e.s+e.c*r)*1e4)/1e4+e.u,e)},JP=function(r,e){return e.set(e.t,e.p,r?Math.round((e.s+e.c*r)*1e4)/1e4+e.u:e.b,e)},ZP=function(r,e){var t=e.s+e.c*r;e.set(e.t,e.p,~~(t+(t<0?-.5:.5))+e.u,e)},dI=function(r,e){return e.set(e.t,e.p,r?e.e:e.b,e)},fI=function(r,e){return e.set(e.t,e.p,r!==1?e.b:e.e,e)},$P=function(r,e,t){return r.style[e]=t},e7=function(r,e,t){return r.style.setProperty(e,t)},t7=function(r,e,t){return r._gsap[e]=t},r7=function(r,e,t){return r._gsap.scaleX=r._gsap.scaleY=t},n7=function(r,e,t,n,i){var s=r._gsap;s.scaleX=s.scaleY=t,s.renderTransform(i,s)},i7=function(r,e,t,n,i){var s=r._gsap;s[e]=t,s.renderTransform(i,s)},ir="transform",Tn=ir+"Origin",s7=function r(e,t){var n=this,i=this.target,s=i.style,o=i._gsap;if(e in Rs&&s){if(this.tfm=this.tfm||{},e!=="transform")e=rs[e]||e,~e.indexOf(",")?e.split(",").forEach(function(c){return n.tfm[c]=Ds(i,c)}):this.tfm[e]=o.x?o[e]:Ds(i,e),e===Tn&&(this.tfm.zOrigin=o.zOrigin);else return rs.transform.split(",").forEach(function(c){return r.call(n,c,t)});if(this.props.indexOf(ir)>=0)return;o.svg&&(this.svgo=i.getAttribute("data-svg-origin"),this.props.push(Tn,t,"")),e=ir}(s||t)&&this.props.push(e,t,s[e])},pI=function(r){r.translate&&(r.removeProperty("translate"),r.removeProperty("scale"),r.removeProperty("rotate"))},a7=function(){var r=this.props,e=this.target,t=e.style,n=e._gsap,i,s;for(i=0;i<r.length;i+=3)r[i+1]?e[r[i]]=r[i+2]:r[i+2]?t[r[i]]=r[i+2]:t.removeProperty(r[i].substr(0,2)==="--"?r[i]:r[i].replace(Rm,"-$1").toLowerCase());if(this.tfm){for(s in this.tfm)n[s]=this.tfm[s];n.svg&&(n.renderTransform(),e.setAttribute("data-svg-origin",this.svgo||"")),i=bm(),(!i||!i.isStart)&&!t[ir]&&(pI(t),n.zOrigin&&t[Tn]&&(t[Tn]+=" "+n.zOrigin+"px",n.zOrigin=0,n.renderTransform()),n.uncache=1)}},AI=function(r,e){var t={target:r,props:[],revert:a7,save:s7};return r._gsap||Sn.core.getCache(r),e&&e.split(",").forEach(function(n){return t.save(n)}),t},gI,Lm=function(r,e){var t=ya.createElementNS?ya.createElementNS((e||"http://www.w3.org/1999/xhtml").replace(/^https/,"http"),r):ya.createElement(r);return t&&t.style?t:ya.createElement(r)},ns=function r(e,t,n){var i=getComputedStyle(e);return i[t]||i.getPropertyValue(t.replace(Rm,"-$1").toLowerCase())||i.getPropertyValue(t)||!n&&r(e,sc(t)||t,1)||""},mI="O,Moz,ms,Ms,Webkit".split(","),sc=function(r,e,t){var n=e||So,i=n.style,s=5;if(r in i&&!t)return r;for(r=r.charAt(0).toUpperCase()+r.substr(1);s--&&!(mI[s]+r in i););return s<0?null:(s===3?"ms":s>=0?mI[s]:"")+r},Nm=function(){YP()&&window.document&&(cI=window,ya=cI.document,rc=ya.documentElement,So=Lm("div")||{style:{}},Lm("div"),ir=sc(ir),Tn=ir+"Origin",So.style.cssText="border-width:0;line-height:0;position:absolute;padding:0",gI=!!sc("perspective"),bm=Sn.core.reverting,Bm=1)},Um=function r(e){var t=Lm("svg",this.ownerSVGElement&&this.ownerSVGElement.getAttribute("xmlns")||"http://www.w3.org/2000/svg"),n=this.parentNode,i=this.nextSibling,s=this.style.cssText,o;if(rc.appendChild(t),t.appendChild(this),this.style.display="block",e)try{o=this.getBBox(),this._gsapBBox=this.getBBox,this.getBBox=r}catch{}else this._gsapBBox&&(o=this._gsapBBox());return n&&(i?n.insertBefore(this,i):n.appendChild(this)),rc.removeChild(t),this.style.cssText=s,o},_I=function(r,e){for(var t=e.length;t--;)if(r.hasAttribute(e[t]))return r.getAttribute(e[t])},vI=function(r){var e;try{e=r.getBBox()}catch{e=Um.call(r,!0)}return e&&(e.width||e.height)||r.getBBox===Um||(e=Um.call(r,!0)),e&&!e.width&&!e.x&&!e.y?{x:+_I(r,["x","cx","x1"])||0,y:+_I(r,["y","cy","y1"])||0,width:0,height:0}:e},yI=function(r){return!!(r.getCTM&&(!r.parentNode||r.ownerSVGElement)&&vI(r))},Bo=function(r,e){if(e){var t=r.style,n;e in Rs&&e!==Tn&&(e=ir),t.removeProperty?(n=e.substr(0,2),(n==="ms"||e.substr(0,6)==="webkit")&&(e="-"+e),t.removeProperty(n==="--"?e:e.replace(Rm,"-$1").toLowerCase())):t.removeAttribute(e)}},Ea=function(r,e,t,n,i,s){var o=new Mn(r._pt,e,t,0,1,s?fI:dI);return r._pt=o,o.b=n,o.e=i,r._props.push(t),o},EI={deg:1,rad:1,turn:1},o7={grid:1,flex:1},xa=function r(e,t,n,i){var s=parseFloat(n)||0,o=(n+"").trim().substr((s+"").length)||"px",c=So.style,h=qP.test(t),u=e.tagName.toLowerCase()==="svg",d=(u?"client":"offset")+(h?"Width":"Height"),A=100,p=i==="px",g=i==="%",v,E,m,_;if(i===o||!s||EI[i]||EI[o])return s;if(o!=="px"&&!p&&(s=r(e,t,n,"px")),_=e.getCTM&&yI(e),(g||o==="%")&&(Rs[t]||~t.indexOf("adius")))return v=_?e.getBBox()[h?"width":"height"]:e[d],vr(g?s/v*A:s/100*v);if(c[h?"width":"height"]=A+(p?o:i),E=~t.indexOf("adius")||i==="em"&&e.appendChild&&!u?e:e.parentNode,_&&(E=(e.ownerSVGElement||{}).parentNode),(!E||E===ya||!E.appendChild)&&(E=ya.body),m=E._gsap,m&&g&&m.width&&h&&m.time===Kn.time&&!m.uncache)return vr(s/m.width*A);if(g&&(t==="height"||t==="width")){var w=e.style[t];e.style[t]=A+i,v=e[d],w?e.style[t]=w:Bo(e,t)}else(g||o==="%")&&!o7[ns(E,"display")]&&(c.position=ns(e,"position")),E===e&&(c.position="static"),E.appendChild(So),v=So[d],E.removeChild(So),c.position="absolute";return h&&g&&(m=Eo(E),m.time=Kn.time,m.width=E[d]),vr(p?v*s/A:v&&s?A/v*s:0)},Ds=function(r,e,t,n){var i;return Bm||Nm(),e in rs&&e!=="transform"&&(e=rs[e],~e.indexOf(",")&&(e=e.split(",")[0])),Rs[e]&&e!=="transform"?(i=Gu(r,n),i=e!=="transformOrigin"?i[e]:i.svg?i.origin:vf(ns(r,Tn))+" "+i.zOrigin+"px"):(i=r.style[e],(!i||i==="auto"||n||~(i+"").indexOf("calc("))&&(i=_f[e]&&_f[e](r,e,t)||ns(r,e)||Cw(r,e)||(e==="opacity"?1:0))),t&&!~(i+"").trim().indexOf(" ")?xa(r,e,i,t)+t:i},l7=function(r,e,t,n){if(!t||t==="none"){var i=sc(e,r,1),s=i&&ns(r,i,1);s&&s!==t?(e=i,t=s):e==="borderColor"&&(t=ns(r,"borderTopColor"))}var o=new Mn(this._pt,r.style,e,0,1,sI),c=0,h=0,u,d,A,p,g,v,E,m,_,w,x,I;if(o.b=t,o.e=n,t+="",n+="",n==="auto"&&(v=r.style[e],r.style[e]=n,n=ns(r,e)||n,v?r.style[e]=v:Bo(r,e)),u=[t,n],Xw(u),t=u[0],n=u[1],A=t.match(Kl)||[],I=n.match(Kl)||[],I.length){for(;d=Kl.exec(n);)E=d[0],_=n.substring(c,d.index),g?g=(g+1)%5:(_.substr(-5)==="rgba("||_.substr(-5)==="hsla(")&&(g=1),E!==(v=A[h++]||"")&&(p=parseFloat(v)||0,x=v.substr((p+"").length),E.charAt(1)==="="&&(E=Jl(p,E)+x),m=parseFloat(E),w=E.substr((m+"").length),c=Kl.lastIndex-w.length,w||(w=w||Wn.units[e]||x,c===n.length&&(n+=w,o.e+=w)),x!==w&&(p=xa(r,e,v,w)||0),o._pt={_next:o._pt,p:_||h===1?_:",",s:p,c:m-p,m:g&&g<4||e==="zIndex"?Math.round:0});o.c=c<n.length?n.substring(c,n.length):""}else o.r=e==="display"&&n==="none"?fI:dI;return _w.test(n)&&(o.e=0),this._pt=o,o},xI={top:"0%",bottom:"100%",left:"0%",right:"100%",center:"50%"},c7=function(r){var e=r.split(" "),t=e[0],n=e[1]||"50%";return(t==="top"||t==="bottom"||n==="left"||n==="right")&&(r=t,t=n,n=r),e[0]=xI[t]||t,e[1]=xI[n]||n,e.join(" ")},u7=function(r,e){if(e.tween&&e.tween._time===e.tween._dur){var t=e.t,n=t.style,i=e.u,s=t._gsap,o,c,h;if(i==="all"||i===!0)n.cssText="",c=1;else for(i=i.split(","),h=i.length;--h>-1;)o=i[h],Rs[o]&&(c=1,o=o==="transformOrigin"?Tn:ir),Bo(t,o);c&&(Bo(t,ir),s&&(s.svg&&t.removeAttribute("transform"),Gu(t,1),s.uncache=1,pI(n)))}},_f={clearProps:function(r,e,t,n,i){if(i.data!=="isFromStart"){var s=r._pt=new Mn(r._pt,e,t,0,0,u7);return s.u=n,s.pr=-10,s.tween=i,r._props.push(t),1}}},Hu=[1,0,0,1,0,0],wI={},II=function(r){return r==="matrix(1, 0, 0, 1, 0, 0)"||r==="none"||!r},CI=function(r){var e=ns(r,ir);return II(e)?Hu:e.substr(7).match(mw).map(vr)},Pm=function(r,e){var t=r._gsap||Eo(r),n=r.style,i=CI(r),s,o,c,h;return t.svg&&r.getAttribute("transform")?(c=r.transform.baseVal.consolidate().matrix,i=[c.a,c.b,c.c,c.d,c.e,c.f],i.join(",")==="1,0,0,1,0,0"?Hu:i):(i===Hu&&!r.offsetParent&&r!==rc&&!t.svg&&(c=n.display,n.display="block",s=r.parentNode,(!s||!r.offsetParent)&&(h=1,o=r.nextElementSibling,rc.appendChild(r)),i=CI(r),c?n.display=c:Bo(r,"display"),h&&(o?s.insertBefore(r,o):s?s.appendChild(r):rc.removeChild(r))),e&&i.length>6?[i[0],i[1],i[4],i[5],i[12],i[13]]:i)},km=function(r,e,t,n,i,s){var o=r._gsap,c=i||Pm(r,!0),h=o.xOrigin||0,u=o.yOrigin||0,d=o.xOffset||0,A=o.yOffset||0,p=c[0],g=c[1],v=c[2],E=c[3],m=c[4],_=c[5],w=e.split(" "),x=parseFloat(w[0])||0,I=parseFloat(w[1])||0,R,S,T,D;t?c!==Hu&&(S=p*E-g*v)&&(T=x*(E/S)+I*(-v/S)+(v*_-E*m)/S,D=x*(-g/S)+I*(p/S)-(p*_-g*m)/S,x=T,I=D):(R=vI(r),x=R.x+(~w[0].indexOf("%")?x/100*R.width:x),I=R.y+(~(w[1]||w[0]).indexOf("%")?I/100*R.height:I)),n||n!==!1&&o.smooth?(m=x-h,_=I-u,o.xOffset=d+(m*p+_*v)-m,o.yOffset=A+(m*g+_*E)-_):o.xOffset=o.yOffset=0,o.xOrigin=x,o.yOrigin=I,o.smooth=!!n,o.origin=e,o.originIsAbsolute=!!t,r.style[Tn]="0px 0px",s&&(Ea(s,o,"xOrigin",h,x),Ea(s,o,"yOrigin",u,I),Ea(s,o,"xOffset",d,o.xOffset),Ea(s,o,"yOffset",A,o.yOffset)),r.setAttribute("data-svg-origin",x+" "+I)},Gu=function(r,e){var t=r._gsap||new $w(r);if("x"in t&&!e&&!t.uncache)return t;var n=r.style,i=t.scaleX<0,s="px",o="deg",c=getComputedStyle(r),h=ns(r,Tn)||"0",u,d,A,p,g,v,E,m,_,w,x,I,R,S,T,D,b,M,L,P,N,W,X,K,te,G,ee,Q,z,Z,re,V;return u=d=A=v=E=m=_=w=x=0,p=g=1,t.svg=!!(r.getCTM&&yI(r)),c.translate&&((c.translate!=="none"||c.scale!=="none"||c.rotate!=="none")&&(n[ir]=(c.translate!=="none"?"translate3d("+(c.translate+" 0 0").split(" ").slice(0,3).join(", ")+") ":"")+(c.rotate!=="none"?"rotate("+c.rotate+") ":"")+(c.scale!=="none"?"scale("+c.scale.split(" ").join(",")+") ":"")+(c[ir]!=="none"?c[ir]:"")),n.scale=n.rotate=n.translate="none"),S=Pm(r,t.svg),t.svg&&(t.uncache?(te=r.getBBox(),h=t.xOrigin-te.x+"px "+(t.yOrigin-te.y)+"px",K=""):K=!e&&r.getAttribute("data-svg-origin"),km(r,K||h,!!K||t.originIsAbsolute,t.smooth!==!1,S)),I=t.xOrigin||0,R=t.yOrigin||0,S!==Hu&&(M=S[0],L=S[1],P=S[2],N=S[3],u=W=S[4],d=X=S[5],S.length===6?(p=Math.sqrt(M*M+L*L),g=Math.sqrt(N*N+P*P),v=M||L?ic(L,M)*To:0,_=P||N?ic(P,N)*To+v:0,_&&(g*=Math.abs(Math.cos(_*nc))),t.svg&&(u-=I-(I*M+R*P),d-=R-(I*L+R*N))):(V=S[6],Z=S[7],ee=S[8],Q=S[9],z=S[10],re=S[11],u=S[12],d=S[13],A=S[14],T=ic(V,z),E=T*To,T&&(D=Math.cos(-T),b=Math.sin(-T),K=W*D+ee*b,te=X*D+Q*b,G=V*D+z*b,ee=W*-b+ee*D,Q=X*-b+Q*D,z=V*-b+z*D,re=Z*-b+re*D,W=K,X=te,V=G),T=ic(-P,z),m=T*To,T&&(D=Math.cos(-T),b=Math.sin(-T),K=M*D-ee*b,te=L*D-Q*b,G=P*D-z*b,re=N*b+re*D,M=K,L=te,P=G),T=ic(L,M),v=T*To,T&&(D=Math.cos(T),b=Math.sin(T),K=M*D+L*b,te=W*D+X*b,L=L*D-M*b,X=X*D-W*b,M=K,W=te),E&&Math.abs(E)+Math.abs(v)>359.9&&(E=v=0,m=180-m),p=vr(Math.sqrt(M*M+L*L+P*P)),g=vr(Math.sqrt(X*X+V*V)),T=ic(W,X),_=Math.abs(T)>2e-4?T*To:0,x=re?1/(re<0?-re:re):0),t.svg&&(K=r.getAttribute("transform"),t.forceCSS=r.setAttribute("transform","")||!II(ns(r,ir)),K&&r.setAttribute("transform",K))),Math.abs(_)>90&&Math.abs(_)<270&&(i?(p*=-1,_+=v<=0?180:-180,v+=v<=0?180:-180):(g*=-1,_+=_<=0?180:-180)),e=e||t.uncache,t.x=u-((t.xPercent=u&&(!e&&t.xPercent||(Math.round(r.offsetWidth/2)===Math.round(-u)?-50:0)))?r.offsetWidth*t.xPercent/100:0)+s,t.y=d-((t.yPercent=d&&(!e&&t.yPercent||(Math.round(r.offsetHeight/2)===Math.round(-d)?-50:0)))?r.offsetHeight*t.yPercent/100:0)+s,t.z=A+s,t.scaleX=vr(p),t.scaleY=vr(g),t.rotation=vr(v)+o,t.rotationX=vr(E)+o,t.rotationY=vr(m)+o,t.skewX=_+o,t.skewY=w+o,t.transformPerspective=x+s,(t.zOrigin=parseFloat(h.split(" ")[2])||!e&&t.zOrigin||0)&&(n[Tn]=vf(h)),t.xOffset=t.yOffset=0,t.force3D=Wn.force3D,t.renderTransform=t.svg?d7:gI?MI:h7,t.uncache=0,t},vf=function(r){return(r=r.split(" "))[0]+" "+r[1]},Qm=function(r,e,t){var n=en(e);return vr(parseFloat(e)+parseFloat(xa(r,"x",t+"px",n)))+n},h7=function(r,e){e.z="0px",e.rotationY=e.rotationX="0deg",e.force3D=0,MI(r,e)},bo="0deg",Vu="0px",Ro=") ",MI=function(r,e){var t=e||this,n=t.xPercent,i=t.yPercent,s=t.x,o=t.y,c=t.z,h=t.rotation,u=t.rotationY,d=t.rotationX,A=t.skewX,p=t.skewY,g=t.scaleX,v=t.scaleY,E=t.transformPerspective,m=t.force3D,_=t.target,w=t.zOrigin,x="",I=m==="auto"&&r&&r!==1||m===!0;if(w&&(d!==bo||u!==bo)){var R=parseFloat(u)*nc,S=Math.sin(R),T=Math.cos(R),D;R=parseFloat(d)*nc,D=Math.cos(R),s=Qm(_,s,S*D*-w),o=Qm(_,o,-Math.sin(R)*-w),c=Qm(_,c,T*D*-w+w)}E!==Vu&&(x+="perspective("+E+Ro),(n||i)&&(x+="translate("+n+"%, "+i+"%) "),(I||s!==Vu||o!==Vu||c!==Vu)&&(x+=c!==Vu||I?"translate3d("+s+", "+o+", "+c+") ":"translate("+s+", "+o+Ro),h!==bo&&(x+="rotate("+h+Ro),u!==bo&&(x+="rotateY("+u+Ro),d!==bo&&(x+="rotateX("+d+Ro),(A!==bo||p!==bo)&&(x+="skew("+A+", "+p+Ro),(g!==1||v!==1)&&(x+="scale("+g+", "+v+Ro),_.style[ir]=x||"translate(0, 0)"},d7=function(r,e){var t=e||this,n=t.xPercent,i=t.yPercent,s=t.x,o=t.y,c=t.rotation,h=t.skewX,u=t.skewY,d=t.scaleX,A=t.scaleY,p=t.target,g=t.xOrigin,v=t.yOrigin,E=t.xOffset,m=t.yOffset,_=t.forceCSS,w=parseFloat(s),x=parseFloat(o),I,R,S,T,D;c=parseFloat(c),h=parseFloat(h),u=parseFloat(u),u&&(u=parseFloat(u),h+=u,c+=u),c||h?(c*=nc,h*=nc,I=Math.cos(c)*d,R=Math.sin(c)*d,S=Math.sin(c-h)*-A,T=Math.cos(c-h)*A,h&&(u*=nc,D=Math.tan(h-u),D=Math.sqrt(1+D*D),S*=D,T*=D,u&&(D=Math.tan(u),D=Math.sqrt(1+D*D),I*=D,R*=D)),I=vr(I),R=vr(R),S=vr(S),T=vr(T)):(I=d,T=A,R=S=0),(w&&!~(s+"").indexOf("px")||x&&!~(o+"").indexOf("px"))&&(w=xa(p,"x",s,"px"),x=xa(p,"y",o,"px")),(g||v||E||m)&&(w=vr(w+g-(g*I+v*S)+E),x=vr(x+v-(g*R+v*T)+m)),(n||i)&&(D=p.getBBox(),w=vr(w+n/100*D.width),x=vr(x+i/100*D.height)),D="matrix("+I+","+R+","+S+","+T+","+w+","+x+")",p.setAttribute("transform",D),_&&(p.style[ir]=D)},f7=function(r,e,t,n,i){var s=360,o=zr(i),c=parseFloat(i)*(o&&~i.indexOf("rad")?To:1),h=c-n,u=n+h+"deg",d,A;return o&&(d=i.split("_")[1],d==="short"&&(h%=s,h!==h%(s/2)&&(h+=h<0?s:-s)),d==="cw"&&h<0?h=(h+s*hI)%s-~~(h/s)*s:d==="ccw"&&h>0&&(h=(h-s*hI)%s-~~(h/s)*s)),r._pt=A=new Mn(r._pt,e,t,n,h,KP),A.e=u,A.u="deg",r._props.push(t),A},SI=function(r,e){for(var t in e)r[t]=e[t];return r},p7=function(r,e,t){var n=SI({},t._gsap),i="perspective,force3D,transformOrigin,svgOrigin",s=t.style,o,c,h,u,d,A,p,g;n.svg?(h=t.getAttribute("transform"),t.setAttribute("transform",""),s[ir]=e,o=Gu(t,1),Bo(t,ir),t.setAttribute("transform",h)):(h=getComputedStyle(t)[ir],s[ir]=e,o=Gu(t,1),s[ir]=h);for(c in Rs)h=n[c],u=o[c],h!==u&&i.indexOf(c)<0&&(p=en(h),g=en(u),d=p!==g?xa(t,c,h,g):parseFloat(h),A=parseFloat(u),r._pt=new Mn(r._pt,o,c,d,A-d,Dm),r._pt.u=g||0,r._props.push(c));SI(o,n)};Cn("padding,margin,Width,Radius",function(r,e){var t="Top",n="Right",i="Bottom",s="Left",o=(e<3?[t,n,i,s]:[t+s,t+n,i+n,i+s]).map(function(c){return e<2?r+c:"border"+c+r});_f[e>1?"border"+r:r]=function(c,h,u,d,A){var p,g;if(arguments.length<4)return p=o.map(function(v){return Ds(c,v,u)}),g=p.join(" "),g.split(p[0]).length===5?p[0]:g;p=(d+"").split(" "),g={},o.forEach(function(v,E){return g[v]=p[E]=p[E]||p[(E-1)/2|0]}),c.init(h,g,A)}});var TI={name:"css",register:Nm,targetTest:function(r){return r.style&&r.nodeType},init:function(r,e,t,n,i){var s=this._props,o=r.style,c=t.vars.startAt,h,u,d,A,p,g,v,E,m,_,w,x,I,R,S,T;Bm||Nm(),this.styles=this.styles||AI(r),T=this.styles.props,this.tween=t;for(v in e)if(v!=="autoRound"&&(u=e[v],!(qn[v]&&eI(v,e,t,n,r,i)))){if(p=typeof u,g=_f[v],p==="function"&&(u=u.call(t,n,r,i),p=typeof u),p==="string"&&~u.indexOf("random(")&&(u=Pu(u)),g)g(this,r,v,u,t)&&(S=1);else if(v.substr(0,2)==="--")h=(getComputedStyle(r).getPropertyValue(v)+"").trim(),u+="",_a.lastIndex=0,_a.test(h)||(E=en(h),m=en(u)),m?E!==m&&(h=xa(r,v,h,m)+m):E&&(u+=E),this.add(o,"setProperty",h,u,n,i,0,0,v),s.push(v),T.push(v,0,o[v]);else if(p!=="undefined"){if(c&&v in c?(h=typeof c[v]=="function"?c[v].call(t,n,r,i):c[v],zr(h)&&~h.indexOf("random(")&&(h=Pu(h)),en(h+"")||h==="auto"||(h+=Wn.units[v]||en(Ds(r,v))||""),(h+"").charAt(1)==="="&&(h=Ds(r,v))):h=Ds(r,v),A=parseFloat(h),_=p==="string"&&u.charAt(1)==="="&&u.substr(0,2),_&&(u=u.substr(2)),d=parseFloat(u),v in rs&&(v==="autoAlpha"&&(A===1&&Ds(r,"visibility")==="hidden"&&d&&(A=0),T.push("visibility",0,o.visibility),Ea(this,o,"visibility",A?"inherit":"hidden",d?"inherit":"hidden",!d)),v!=="scale"&&v!=="transform"&&(v=rs[v],~v.indexOf(",")&&(v=v.split(",")[0]))),w=v in Rs,w){if(this.styles.save(v),x||(I=r._gsap,I.renderTransform&&!e.parseTransform||Gu(r,e.parseTransform),R=e.smoothOrigin!==!1&&I.smooth,x=this._pt=new Mn(this._pt,o,ir,0,1,I.renderTransform,I,0,-1),x.dep=1),v==="scale")this._pt=new Mn(this._pt,I,"scaleY",I.scaleY,(_?Jl(I.scaleY,_+d):d)-I.scaleY||0,Dm),this._pt.u=0,s.push("scaleY",v),v+="X";else if(v==="transformOrigin"){T.push(Tn,0,o[Tn]),u=c7(u),I.svg?km(r,u,0,R,0,this):(m=parseFloat(u.split(" ")[2])||0,m!==I.zOrigin&&Ea(this,I,"zOrigin",I.zOrigin,m),Ea(this,o,v,vf(h),vf(u)));continue}else if(v==="svgOrigin"){km(r,u,1,R,0,this);continue}else if(v in wI){f7(this,I,v,A,_?Jl(A,_+u):u);continue}else if(v==="smoothOrigin"){Ea(this,I,"smooth",I.smooth,u);continue}else if(v==="force3D"){I[v]=u;continue}else if(v==="transform"){p7(this,u,r);continue}}else v in o||(v=sc(v)||v);if(w||(d||d===0)&&(A||A===0)&&!XP.test(u)&&v in o)E=(h+"").substr((A+"").length),d||(d=0),m=en(u)||(v in Wn.units?Wn.units[v]:E),E!==m&&(A=xa(r,v,h,m)),this._pt=new Mn(this._pt,w?I:o,v,A,(_?Jl(A,_+d):d)-A,!w&&(m==="px"||v==="zIndex")&&e.autoRound!==!1?ZP:Dm),this._pt.u=m||0,E!==m&&m!=="%"&&(this._pt.b=h,this._pt.r=JP);else if(v in o)l7.call(this,r,v,h,_?_+u:u);else if(v in r)this.add(r,v,h||r[v],_?_+u:u,n,i);else if(v!=="parseTransform"){am(v,u);continue}w||(v in o?T.push(v,0,o[v]):T.push(v,1,h||r[v])),s.push(v)}}S&&aI(this)},render:function(r,e){if(e.tween._time||!bm())for(var t=e._pt;t;)t.r(r,t.d),t=t._next;else e.styles.revert()},get:Ds,aliases:rs,getSetter:function(r,e,t){var n=rs[e];return n&&n.indexOf(",")<0&&(e=n),e in Rs&&e!==Tn&&(r._gsap.x||Ds(r,"x"))?t&&uI===t?e==="scale"?r7:t7:(uI=t||{})&&(e==="scale"?n7:i7):r.style&&!em(r.style[e])?$P:~e.indexOf("-")?e7:Im(r,e)},core:{_removeProperty:Bo,_getMatrix:Pm}};Sn.utils.checkPrefix=sc,Sn.core.getStyleSaver=AI,function(r,e,t,n){var i=Cn(r+","+e+","+t,function(s){Rs[s]=1});Cn(e,function(s){Wn.units[s]="deg",wI[s]=1}),rs[i[13]]=r+","+e,Cn(n,function(s){var o=s.split(":");rs[o[1]]=i[o[0]]})}("x,y,z,scale,scaleX,scaleY,xPercent,yPercent","rotation,rotationX,rotationY,skewX,skewY","transform,transformOrigin,svgOrigin,force3D,smoothOrigin,transformPerspective","0:translateX,1:translateY,2:translateZ,8:rotate,8:rotationZ,8:rotateZ,9:rotateX,10:rotateY"),Cn("x,y,z,top,right,bottom,left,width,height,fontSize,padding,margin,perspective",function(r){Wn.units[r]="px"}),Sn.registerPlugin(TI);var Om=Sn.registerPlugin(TI)||Sn;Om.core.Tween;const wa=/iPhone|iPod|Android/i.test(navigator.userAgent),BI=new DN,A7={Front:{value:wa?new j(4.7,1.9,7.5):new j(1.8,.65,2.5)},Back:{value:wa?new j(0,1.9,-7.5):new j(0,.65,-4)},Left:{value:wa?new j(-9.14,1.17,3):new j(-3.5,.4,1)},Right:{value:wa?new j(9.14,1.17,3):new j(3.5,.4,1)},Top:{value:wa?new j(0,9.23,3):new j(0,3.5,1)},Bottom:{value:wa?new j(.6,-9.23,3):new j(.1,-3.5,1)},FlatFront:{value:new j(0,0,3)},FlatLeft:{value:new j(-2,0,0)},FlatRight:{value:new j(2,0,0)},FlatTop:{value:new j(0,.75,1)}};let tn,yf=!1,Fm=!1,zm,ur,Do=!1,Hm=!1,Gm;const g7=new Li({metalness:0,roughness:1,ior:1,opacity:1,clearcoat:0,color:new qe(16777215),transparent:!1,shadowSide:kr,depthWrite:!0,map:null,alphaMap:null,aoMap:null,roughnessMap:null,metalnessMap:null,normalMap:null});let Lo,Ia=[],Vm,jm=!1,Wm=!1;const Ym=[0,.4,.7,1],bI=[.85,.62,.3,0],RI=[new qe(16777215),new qe(16777215),new qe(16777215),new qe(16777215)],Rr={resolution:{value:new Ge(0,0)},color:{value:new qe(16777215)},metalness:{value:1},maxX:{value:.1},minX:{value:-.1},minY:{value:-.1},maxY:{value:.1},uAlpha:{value:!1},gradientColors:{value:RI},positions:{value:Ym},opacities:{value:bI}},m7=1;new dd().set(m7),new xs({color:"black"});class _7{constructor(){xt(this,"scene"),xt(this,"camera"),xt(this,"renderer"),xt(this,"canvas"),xt(this,"canvasSize"),xt(this,"isInitialised"),xt(this,"orgId"),xt(this,"textureLoader"),xt(this,"raycaster"),xt(this,"isTouchDown"),xt(this,"touchDownTime"),xt(this,"touchDownTimeout"),xt(this,"onPointerDown",e=>{e.target.localName==="canvas"&&(this.isTouchDown=!0,this.touchDownTime=Date.now())}),xt(this,"onPointerMove",e=>{e.target.localName==="canvas"&&this.isTouchDown&&(this.isTouchDown=!1,this.touchDownTime=0)}),xt(this,"onPointerUp",e=>{e.target.localName==="canvas"&&this.isTouchDown&&(this.isTouchDown=!1,Date.now()-this.touchDownTime>this.touchDownTimeout?(this.isTouchDown=!1,console.log("Long touch or rogue touch canceled")):this.handlePointerOnValidInput(e))}),xt(this,"handlePointerOnValidInput",e=>{const{isValid:t,x:n,y:i}=this.checkInputValidity(e);if(!t)return;const s=new Ge;if(s.x=n/this.canvas.clientWidth*2-1,s.y=-(i/this.canvas.clientHeight)*2+1,this.raycaster.setFromCamera(s,this.camera),!this.isTouchDown||this.isTouchDown&&Date.now()-this.touchDownTime<=this.touchDownTimeout){const o=this.raycaster.intersectObjects(this.scene.children,!0);for(const c of o)if(c.object.name.toLowerCase().includes("gemstone")){const h=new CustomEvent("gemZoneDetectedOnTouch",{detail:c.object.name.replace("Gemstone_Zone","")});document.dispatchEvent(h);break}}}),xt(this,"checkInputValidity",e=>{let t,n;return t=e.clientX,n=e.clientY-Math.round(window.innerHeight*(wa?.1:.08)),n<0||n>this.canvas.clientHeight?{isValid:!1,x:0,y:0}:{isValid:!0,x:t,y:n}}),this.scene=new qL,this.canvasSize=new Ge,this.isInitialised=!1,this.textureLoader=new rx,this.raycaster=new k8,this.isTouchDown=!1,this.touchDownTime=0,this.touchDownTimeout=500,this.orgId=""}async intialise(){this.canvas=document.querySelector("canvas.sprie-config-webgl");const e=this.canvas.clientWidth,t=this.canvas.clientHeight;this.canvasSize.set(e,t),this.camera=new un(12,e/t,.1,1e4),this.camera.lookAt(0,0,0),this.scene.background=new qe("#ffffff"),this.renderer=new YL({canvas:this.canvas,alpha:!0,antialias:!0}),this.renderer.toneMapping=uA,this.renderer.toneMappingExposure=1,this.renderer.setClearColor(16777215),this.renderer.outputColorSpace=Qr,this.resizeRenderer(),BI.load("https://sprie-jarvis-public.s3.eu-west-2.amazonaws.com/environment_desaturated.hdr",n=>{n.mapping=Jc,n.colorSpace=mr,this.scene.environment=n}),BI.load("https://sprie-jarvis-public.s3.eu-west-2.amazonaws.com/gems.hdr",n=>{n.mapping=Jc,n.colorSpace=mr,Lo=n}),document.addEventListener("mousedown",this.onPointerDown),document.addEventListener("mousemove",this.onPointerMove),document.addEventListener("mouseup",this.onPointerUp),this.isInitialised=!0}resizeRenderer(){var e;const t=Math.min(window.devicePixelRatio,2),n=Math.floor(this.canvas.clientWidth*t),i=Math.floor(this.canvas.clientHeight*t),s=this.canvas.clientWidth!==n||this.canvas.clientHeight!==i;return s&&((e=this.renderer)==null||e.setSize(n,i,!1)),s}cleanUp(){document.removeEventListener("mousedown",this.onPointerDown),document.removeEventListener("mousemove",this.onPointerMove),document.removeEventListener("mouseup",this.onPointerUp),this.renderer&&this.renderer.dispose()}loadModelInsideScene(e){this.scene.traverse(t=>{t.name=="Scene"&&(this.scene.remove(t),t.traverse(n=>{n instanceof Yr&&(n.geometry.dispose(),n.material.dispose())}))}),this.scene.add(e)}setLighting(e){const t=new y8(16777215,16777215,2);t.color.setHSL(.6,1,.6),t.groundColor.setHSL(.095,1,.75),t.position.set(0,50,0),e.add(t);const n=new ax(16777215,1.5);n.color.setHSL(.1,1,.95),n.position.set(-1,1.75,1),n.position.multiplyScalar(30),e.add(n)}setOrbitControls(e,t){const n=new O8(e,this.canvas);return n.target.set(.003059340956040225,-.13425621157020154,-.2564218846390263),wa?(e.position.set(4.7,1.9,7.5),n.minDistance=2.5,n.maxDistance=11,n.rotateSpeed=.8):(e.position.set(1.8,.65,2.5),n.minDistance=1.5,n.maxDistance=5,n.rotateSpeed=.5),t&&t!==0&&(n.autoRotate=!0,n.autoRotateSpeed=t),n.enableDamping=!0,n.dampingFactor=.2,n.enablePan=!1,n.minPolarAngle=-Math.PI*5/36,n.maxPolarAngle=Math.PI*3/5,n.update(),n}setupMSAA(e,t){const n=new zN,i=new HN(this.scene,t),s=e.getDrawingBufferSize(new Ge),o=new Si(s.width,s.height,{samples:4,type:yn}),c=new ON(e,o);return c.addPass(i),c.addPass(n),c}setupShadows(){const e={shadow:{blur:.6,darkness:1,opacity:.6},plane:{color:"#ffffff",opacity:1},showWireframe:!1},t=new aa;t.position.y=-.315,this.scene.add(t);const n=new Si(256,256);n.texture.generateMipmaps=!1;const i=new Si(256,256);i.texture.generateMipmaps=!1;const s=new fu(2.5,2.5).rotateX(Math.PI/2),o=new xs({map:n.texture,opacity:e.shadow.opacity,transparent:!0,depthWrite:!1}),c=new Yr(s,o);c.renderOrder=1,t.add(c),c.scale.y=-1;const h=new Yr(s);h.visible=!1,t.add(h);const u=new pu(-2.5/2,2.5/2,2.5/2,-2.5/2,0,.4);u.rotation.x=Math.PI/2,t.add(u);const d=new L2;d.userData.darkness={value:e.shadow.darkness},d.onBeforeCompile=E=>{const m=E;m.uniforms.darkness=d.userData.darkness,m.fragmentShader=`
|
|
4418
4418
|
uniform float darkness;
|
|
4419
4419
|
${E.fragmentShader.replace("gl_FragColor = vec4( vec3( 1.0 - fragCoordZ ), opacity );","gl_FragColor = vec4( vec3( 0.0 ), ( 1.0 - fragCoordZ ) * darkness );")}
|
|
4420
4420
|
`},d.depthTest=!1,d.depthWrite=!1;const A=new En(GN);A.depthTest=!1;const p=new En(VN);p.depthTest=!1;function g(E,m){h.visible=!0,h.material=A,h.material.uniforms.tDiffuse.value=n.texture,A.uniforms.h.value=E*1/256,m.setRenderTarget(i),m.render(h,u),h.material=p,h.material.uniforms.tDiffuse.value=i.texture,p.uniforms.v.value=E*1/256,m.setRenderTarget(n),m.render(h,u),h.visible=!1}u.far=.125,v();function v(){u.updateProjectionMatrix()}return{state:e,shadowCamera:u,depthMaterial:d,renderTarget:n,blurShadow:g}}setupAndRenderScene(e){if(!this.camera||!this.renderer)return;this.scene.add(this.camera),Tt.enabled=!0,this.setLighting(this.scene);const t=this.setOrbitControls(this.camera,e),{state:n,shadowCamera:i,depthMaterial:s,renderTarget:o,blurShadow:c}=this.setupShadows(),h=this.setupMSAA(this.renderer,this.camera),u=()=>{var d;t.update(),this.resizeRenderer()&&(this.camera.aspect=this.canvas.clientWidth/this.canvas.clientHeight,(d=this.camera)==null||d.updateProjectionMatrix());const A=this.scene.background;if(this.scene.background=null,this.scene.overrideMaterial=s,!this.renderer||!this.camera)return;const p=this.renderer.getClearAlpha();this.renderer.setClearAlpha(0),this.renderer.clear(),this.renderer.setRenderTarget(o),this.renderer.render(this.scene,i),this.scene.overrideMaterial=null,c(n.shadow.blur,this.renderer),c(n.shadow.blur*.4,this.renderer),this.renderer.setRenderTarget(null),this.renderer.setClearAlpha(p),this.scene.background=A,Ia.forEach(g=>{var v,E;g.material.uniforms.viewMatrixInverse.value=(v=this.camera)==null?void 0:v.matrixWorld,g.material.uniforms.projectionMatrixInverse.value=(E=this.camera)==null?void 0:E.projectionMatrixInverse}),requestAnimationFrame(u),h.render()};u()}async downloadModel(e,t){return await Sp.DownloadMA({orgId:e,assetsId:t})}getCustomisations(e){return[e==null?void 0:e.find(t=>(t==null?void 0:t.type)=="Lens"),e==null?void 0:e.find(t=>(t==null?void 0:t.type)=="Orbital")]}async renderModel(e,t){const n=new F8;e&&await this.loadEyewearFromGLTF(n,e,this.renderer,t)}async loadEyewearFromGLTF(e,t,n,i){const s=new tx,o=new Zi(s).setTranscoderPath("https://unpkg.com/three@0.146.0/examples/js/libs/basis/");e.setKTX2Loader(o.detectSupport(n)),Ia.length=0;const c=i,h=t.includes(".glb");let u;return h?u=await e.loadAsync(t):u=await this.LoadEncryptedGlb(e,t,c).then(d=>{let A=d.result;this.updateScene(A);let p=Number.POSITIVE_INFINITY;A.scene.traverse(g=>{g.isMesh&&(p=Math.min(p,this.getMinY(g)),this.setupLensMaterial(A,g),this.setupOrbitalMaterial(g),this.setupGemstoneMaterial(g),g.matrixAutoUpdate=!0)}),this.adjustSceneHeight(A,p),this.loadModelInsideScene(d.result.scene),this.sortGemstoneMaterials()}),u==null?void 0:u.scene}async LoadEncryptedGlb(e,t,n){const i=await CB(t,n);if(!i||!i.decodedData)throw new Error("Asset auth error.");return new Promise(s=>{e.parse(i.decodedData,"",o=>{s({result:o})})})}updateScene(e){e.scene.scale.set(7,7,7),e.scene.position.y-=.08}getMinY(e){let t=Number.POSITIVE_INFINITY;if(e.geometry instanceof Gn){const n=e.geometry.getAttribute("position");if(n){const i=n.array;for(let s=0;s<i.length;s+=3){const o=new j(i[s],i[s+1],i[s+2]),c=e.localToWorld(o.clone());t=Math.min(t,c.y)}}}return t}calculateLensExtents(e){let t=Number.POSITIVE_INFINITY,n=Number.NEGATIVE_INFINITY;if(e.geometry instanceof Gn){const i=e.geometry.getAttribute("position");if(i){const s=i.array;for(let o=0;o<s.length;o+=3){const c=new j(s[o],s[o+1],s[o+2]),h=e.localToWorld(c.clone());t=Math.min(t,h.y),n=Math.max(n,h.y)}}}Rr.minY.value=t,Rr.maxY.value=n}adjustSceneHeight(e,t){let n=-.315-t;e.scene.position.y+=n,Rr.minY.value+=n,Rr.maxY.value+=n}setupLensMaterial(e,t){yf&&t.material&&t.material.name=="Lenses"&&(this.calculateLensExtents(t),zm=t,tn=new Li({metalness:0,roughness:.05,ior:1,opacity:.6,clearcoat:1,color:new qe(16777215),transparent:!0,shadowSide:kr,depthWrite:!1}),t.material=tn,tn&&(tn.onBeforeCompile=function(n){n.uniforms.resolution=Rr.resolution,n.uniforms.color=Rr.color,n.uniforms.uAlpha=Rr.uAlpha,n.uniforms.colors=Rr.gradientColors,n.uniforms.positions=Rr.positions,n.uniforms.opacities=Rr.opacities,n.uniforms.minX=Rr.minX,n.uniforms.maxX=Rr.maxX,n.uniforms.minY=Rr.minY,n.uniforms.maxY=Rr.maxY,n.vertexShader=`
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@perceptimagery/dita-configurator-staging",
|
|
3
|
-
"version": "1.2.
|
|
3
|
+
"version": "1.2.2105",
|
|
4
4
|
"author": "Percept Imagery Ltd. <rohan@perceptimagery.com>",
|
|
5
5
|
"license": "UNLICENSED",
|
|
6
6
|
"main": "dist/index.js",
|
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
"preview": "vite preview"
|
|
16
16
|
},
|
|
17
17
|
"dependencies": {
|
|
18
|
-
"@perceptimagery/3d-configurator": "^1.5.
|
|
18
|
+
"@perceptimagery/3d-configurator": "^1.5.2105",
|
|
19
19
|
"@perceptimagery/sprie-asset-auth": "^1.2.1016",
|
|
20
20
|
"dat.gui": "^0.7.9",
|
|
21
21
|
"events": "^3.3.0",
|