PageSourceSearch

https://shop.duden.de/theme/a9dd922003eb7771b776d292d2b01149/js/sp…ment.spatial-cms-viewer.plugin.ts.8c39bd.js

js duden.de collected 2026-09-24 07:56:41 UTC 21,704 bytes, 1 lines download raw bytes

1"use strict";(self.webpackChunk=self.webpackChunk||[]).push([[59864],{857:t=>{var e=function(t){var e;return!!t&&"object"==typeof t&&"[object RegExp]"!==(e=Object.prototype.toString.call(t))&&"[object Date]"!==e&&t.$$typeof!==i},i="function"==typeof Symbol&&Symbol.for?Symbol.for("react.element"):60103;function s(t,e){return!1!==e.clone&&e.isMergeableObject(t)?a(Array.isArray(t)?[]:{},t,e):t}function n(t,e,i){return t.concat(e).map(function(t){return s(t,i)})}function o(t){return Object.keys(t).concat(Object.getOwnPropertySymbols?Object.getOwnPropertySymbols(t).filter(function(e){return Object.propertyIsEnumerable.call(t,e)}):[])}function r(t,e){try{return e in t}catch(t){return!1}}function a(t,i,l){(l=l||{}).arrayMerge=l.arrayMerge||n,l.isMergeableObject=l.isMergeableObject||e,l.cloneUnlessOtherwiseSpecified=s;var d,h,c=Array.isArray(i);return c!==Array.isArray(t)?s(i,l):c?l.arrayMerge(t,i,l):(h={},(d=l).isMergeableObject(t)&&o(t).forEach(function(e){h[e]=s(t[e],d)}),o(i).forEach(function(e){(!r(t,e)||Object.hasOwnProperty.call(t,e)&&Object.propertyIsEnumerable.call(t,e))&&(r(t,e)&&d.isMergeableObject(i[e])?h[e]=(function(t,e){if(!e.customMerge)return a;var i=e.customMerge(t);return"function"==typeof i?i:a})(e,d)(t[e],i[e],d):h[e]=s(i[e],d))}),h)}a.all=function(t,e){if(!Array.isArray(t))throw Error("first argument should be an array");return t.reduce(function(t,i){return a(t,i,e)},{})},t.exports=a},864:(t,e,i)=>{i.r(e),i.d(e,{default:()=>g});var s=i(857),n=i.n(s);class o{static ucFirst(t){return t.charAt(0).toUpperCase()+t.slice(1)}static lcFirst(t){return t.charAt(0).toLowerCase()+t.slice(1)}static toDashCase(t){return t.replace(/([A-Z])/g,"-$1").replace(/^-/,"").toLowerCase()}static toLowerCamelCase(t,e){let i=o.toUpperCamelCase(t,e);return o.lcFirst(i)}static toUpperCamelCase(t,e){return e?t.split(e).map(t=>o.ucFirst(t.toLowerCase())).join(""):o.ucFirst(t.toLowerCase())}static parsePrimitive(t){try{return/^\d+(.|,)\d+$/.test(t)&&(t=t.replace(",",".")),JSON.parse(t)}catch(e){return t.toString()}}}class r{static isNode(t){return"object"==typeof t&&null!==t&&(t===document||t===window||t instanceof Node)}static hasAttribute(t,e){if(!r.isNode(t))throw Error("The element must be a valid HTML Node!");return"function"==typeof t.hasAttribute&&t.hasAttribute(e)}static getAttribute(t,e){let i=!(arguments.length>2)||void 0===arguments[2]||arguments[2];if(i&&!1===r.hasAttribute(t,e))throw Error('The required property "'.concat(e,'" does not exist!'));if("function"!=typeof t.getAttribute){if(i)throw Error("This node doesn't support the getAttribute function!");return}return t.getAttribute(e)}static getDataAttribute(t,e){let i=!(arguments.length>2)||void 0===arguments[2]||arguments[2],s=e.replace(/^data(|-)/,""),n=o.toLowerCamelCase(s,"-");if(!r.isNode(t)){if(i)throw Error("The passed node is not a valid HTML Node!");return}if(void 0===t.dataset){if(i)throw Error("This node doesn't support the dataset attribute!");return}let a=t.dataset[n];if(void 0===a){if(i)throw Error('The required data attribute "'.concat(e,'" does not exist on ').concat(t,"!"));return a}return o.parsePrimitive(a)}static querySelector(t,e){let i=!(arguments.length>2)||void 0===arguments[2]||arguments[2];if(i&&!r.isNode(t))throw Error("The parent node is not a valid HTML Node!");let s=t.querySelector(e)||!1;if(i&&!1===s)throw Error('The required element "'.concat(e,'" does not exist in parent node!'));return s}static querySelectorAll(t,e){let i=!(arguments.length>2)||void 0===arguments[2]||arguments[2];if(i&&!r.isNode(t))throw Error("The parent node is not a valid HTML Node!");let s=t.querySelectorAll(e);if(0===s.length&&(s=!1),i&&!1===s)throw Error('At least one item of "'.concat(e,'" must exist in parent node!'));return s}static getFocusableElements(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:document.body;return t.querySelectorAll('\n            input:not([tabindex^="-"]):not([disabled]):not([type="hidden"]),\n            select:not([tabindex^="-"]):not([disabled]),\n            textarea:not([tabindex^="-"]):not([disabled]),\n            button:not([tabindex^="-"]):not([disabled]),\n            a[href]:not([tabindex^="-"]):not([disabled]),\n            [tabindex]:not
1([tabindex^="-"]):not([disabled])\n        ')}static getFirstFocusableElement(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:document.body;return this.getFocusableElements(t)[0]}static getLastFocusableElement(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:document,e=this.getFocusableElements(t);return e[e.length-1]}}class a{publish(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=arguments.length>2&&void 0!==arguments[2]&&arguments[2],s=new CustomEvent(t,{detail:e,cancelable:i});return this.el.dispatchEvent(s),s}subscribe(t,e){let i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},s=this,n=t.split("."),o=i.scope?e.bind(i.scope):e;if(i.once&&!0===i.once){let e=o;o=function(i){s.unsubscribe(t),e(i)}}return this.el.addEventListener(n[0],o),this.listeners.push({splitEventName:n,opts:i,cb:o}),!0}unsubscribe(t){let e=t.split(".");return this.listeners=this.listeners.reduce((t,i)=>([...i.splitEventName].sort().toString()===e.sort().toString()?this.el.removeEventListener(i.splitEventName[0],i.cb):t.push(i),t),[]),!0}reset(){return this.listeners.forEach(t=>{this.el.removeEventListener(t.splitEventName[0],t.cb)}),this.listeners=[],!0}get el(){return this._el}set el(t){this._el=t}get listeners(){return this._listeners}set listeners(t){this._listeners=t}constructor(t=document){this._el=t,t.$emitter=this,this._listeners=[]}}class l{init(){throw Error('The "init" method for the plugin "'.concat(this._pluginName,'" is not defined.'))}update(){}_init(){this._initialized||(this.init(),this._initialized=!0)}_update(){this._initialized&&this.update()}_mergeOptions(t){let e=o.toDashCase(this._pluginName),i=r.getDataAttribute(this.el,"data-".concat(e,"-config"),!1),s=r.getAttribute(this.el,"data-".concat(e,"-options"),!1),a=[this.constructor.options,this.options,t];i&&a.push(window.PluginConfigManager.get(this._pluginName,i));try{s&&a.push(JSON.parse(s))}catch(t){throw console.error(this.el),Error('The data attribute "data-'.concat(e,'-options" could not be parsed to json: ').concat(t.message))}return n().all(a.filter(t=>t instanceof Object&&!(t instanceof Array)).map(t=>t||{}))}_registerInstance(){window.PluginManager.getPluginInstancesFromElement(this.el).set(this._pluginName,this),window.PluginManager.getPlugin(this._pluginName,!1).get("instances").push(this)}_getPluginName(t){return t||(t=this.constructor.name),t}constructor(t,e={},i=!1){if(!r.isNode(t))throw Error("There is no valid element given.");this.el=t,this.$emitter=new a(this.el),this._pluginName=this._getPluginName(i),this.options=this._mergeOptions(e),this._initialized=!1,this._registerInstance(),this._init()}}async function d(){var t,e,s,n,o,r,a;if(window.loadThreeJsUtil||(window.loadThreeJsUtil={isLoaded:!1,promise:null,promiseResolve:null}),!window.loadThreeJsUtil.isLoaded){if(window.loadThreeJsUtil.promise){await window.loadThreeJsUtil.promise;return}if(window.loadThreeJsUtil.promise=new Promise(t=>{window.loadThreeJsUtil.promiseResolve=t}),window.threeJs||(window.threeJs=await i.e(26173).then(i.bind(i,173))),window.threeJsAddons||(window.threeJsAddons={}),!((t=window.threeJsAddons)===null||void 0===t?void 0:t.OrbitControls)){let{OrbitControls:t}=await Promise.all([i.e(26173),i.e(96976)]).then(i.bind(i,976));window.threeJsAddons.OrbitControls=t}if(!((e=window.threeJsAddons)===null||void 0===e?void 0:e.USDZExporter)){let{USDZExporter:t}=await Promise.all([i.e(26173),i.e(43707)]).then(i.bind(i,707));window.threeJsAddons.USDZExporter=t}if(!((s=window.threeJsAddons)===null||void 0===s?void 0:s.XREstimatedLight)){let{XREstimatedLight:t}=await Promise.all([i.e(26173),i.e(96874)]).then(i.bind(i,874));window.threeJsAddons.XREstimatedLight=t}if(!((n=window.threeJsAddons)===null||void 0===n?void 0:n.GLTFLoader)){let{GLTFLoader:t}=await Promise.all([i.e(26173),i.e(1990)]).then(i.bind(i,990));window.threeJsAddons.GLTFLoader=t}if(!((o=window.threeJsAddons)===null||void 0===o?void 0:o.DRACOLoader)){let{DRACOLoader:t}=await Promise.all([i.e(26173),i.e(35157)]).then(i.bind(i,157));window.threeJsAddons.DRACOLoader=t}((r=window.threeJsAddons)===null||void 0===r?void 0:r.DRACOLibPath)||(window.threeJsAddons.DRACOLibPath="three/examples/jsm/libs/draco/"),((a=window.threeJsAddons)===null||void 0===a?void 0:a.MathUtils)||(window.threeJsAddons.MathUtils=await i.e(57062).then(i.bind(i,62))),window.loadThreeJsUtil.promiseResolve(),window.loadThreeJsUtil.isLoaded=!0}}
1class h extends l{async init(){await d(),this.initViewer(!0)}initViewer(t){this.setReady(!1),this.canvas=this.el,this.canvas.tabIndex=0,(void 0==this.camera||t)&&(this.camera=new window.threeJs.PerspectiveCamera(70,this.canvas.clientWidth/this.canvas.clientHeight,.01,10)),(void 0==this.scene||t)&&(this.scene=new window.threeJs.Scene),this.rendering=!1,this.clock=new window.threeJs.Clock,this.renderer=new window.threeJs.WebGLRenderer({canvas:this.canvas,antialias:!0}),this.$emitter.publish("Viewer/initViewer")}startRendering(){var t,e,i,s;this.rendering||(this.rendering=!0,requestAnimationFrame(this.render.bind(this)),(e=this.canvas)===null||void 0===e||(t=e.parentElement)===null||void 0===t||t.classList.add("spatial-canvas-rendering"),this.ready&&((s=this.canvas)===null||void 0===s||(i=s.parentElement)===null||void 0===i||i.classList.add("spatial-canvas-display")),this.$emitter.publish("Viewer/startRendering"))}stopRendering(){var t,e;this.rendering=!1,(e=this.canvas)===null||void 0===e||(t=e.parentElement)===null||void 0===t||t.classList.remove("spatial-canvas-rendering"),this.$emitter.publish("Viewer/stopRendering")}render(){if(!this.rendering||(requestAnimationFrame(this.render.bind(this)),!this.clock))return;let t=this.clock.getDelta();this.preRender(t),void 0!=this.camera&&void 0!=this.scene&&void 0!=this.renderer&&this.renderer.render(this.scene,this.camera),this.postRender(t)}preRender(t){}postRender(t){}setReady(t){this.ready!==t&&(this.ready=t,this.onReady(t))}onReady(t){var e,i,s,n;void 0!=this.canvas&&(t?(this.$emitter.publish("Viewer/ready"),(e=this.canvas.parentElement)===null||void 0===e||e.classList.add("spatial-canvas-ready"),this.rendering&&((i=this.canvas.parentElement)===null||void 0===i||i.classList.add("spatial-canvas-display"))):(this.$emitter.publish("Viewer/notReady"),(s=this.canvas.parentElement)===null||void 0===s||s.classList.remove("spatial-canvas-ready"),(n=this.canvas.parentElement)===null||void 0===n||n.classList.remove("spatial-canvas-display")))}constructor(...t){super(...t),this.ready=!1}}class c{init(){this.plugin.canvas&&(this.lastHeight=this.plugin.canvas.clientHeight,this.lastWidth=this.plugin.canvas.clientWidth)}update(){var t,e,i,s,n;if(!this.plugin.canvas||!this.plugin.camera)return;let o=(s=(t=this.plugin.canvas.parentElement)===null||void 0===t?void 0:t.clientHeight)!==null&&void 0!==s?s:0,r=(n=(e=this.plugin.canvas.parentElement)===null||void 0===e?void 0:e.clientWidth)!==null&&void 0!==n?n:0;(o!==this.lastHeight||r!==this.lastWidth)&&(this.plugin.canvas.height=o,this.plugin.canvas.width=r,this.plugin.camera.aspect=r/o,this.plugin.camera.updateProjectionMatrix(),(i=this.plugin.renderer)===null||void 0===i||i.setSize(r,o),this.plugin.$emitter.publish("CanvasSizeUpdateUtil/sizeUpdate",{width:r,height:o}),this.lastHeight=o,this.lastWidth=r)}constructor(t){this.lastWidth=0,this.lastHeight=0,this.plugin=t,this.init()}}class u{async loadSingleObjectByUrl(t,e){this.loadStatus.set(t,0),this.emitLoadingUpdate();let i=await new Promise((e,i)=>{this.gltfLoader.load(t,i=>{this.loadStatus.set(t,1),this.emitLoadingUpdate(),e(i.scene)},e=>{this.loadStatus.set(t,e.loaded/e.total),this.emitLoadingUpdate()},e=>{this.loadStatus.set(t,-1),this.emitLoadingUpdate(),i(e)})});return e.clampSize&&(i=this.clampSize(i,e.clampMaxSize)),e.center&&(i=this.centerObject(i)),i}centerObject(t){let e=new window.threeJs.Box3().setFromObject(t).getCenter(new window.threeJs.Vector3);t.position.copy(e),t.position.multiplyScalar(-1);let i=new window.threeJs.Group;return i.name="centered",i.add(t),i}clampSize(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{x:1,y:1,z:1},i=new window.threeJs.Box3().setFromObject(t).getSize(new window.threeJs.Vector3),s=Math.max(i.x*(1/e.x),i.y*(1/e.y),i.z*(1/e.z));return t.scale.multiplyScalar(1/s),t}percentageLoaded(){let t=0,e=0;return this.loadStatus.forEach(i=>{e+=i,t++}),e/t}detailLoaded(){return this.loadStatus}emitLoadingUpdate(){this.$emitter&&this.$emitter.publish("ObjectLoaderUtil/loadingUpdate",{percentage:this.percentageLoaded(),detailed:this.detailLoaded()})}constructor(t){this.gltfLoader=new window.threeJsAddons.GLTFLoader;let e=new window.threeJsAddons.DRACOLoader;e.setDecoderPath(null==t?void 0:t.options.dracoDecodersPath),this.gltfLoader.setDRACOLoader(e),this.loadStatus=new Map,(null==t?void 0:t.$emitter)instanceof a&&(this.$emitter=null==t?void 0:t.$emitter)}}class p{bindEventListeners(t){return t.addEventListener("keydown",this.onKeyDown.bind(this)),()=>{t.removeEventListener("keydown",this.onKeyDown.bind(this))}}onKeyDown(t){if("ArrowRight"!==t.key&&"ArrowLeft"!==t.key&&"ArrowUp"!==t.key&&"ArrowDown"!==t.key&&"+"!==t.key&&"-"!==t.key)return;t.stopPropagation(),t.preventDefault();let e=Math.PI/16,i=Math.PI/16;"ArrowRight"===t.key&&this.move(-e,0),"ArrowLeft"===t.key&&this.move(e,0),"ArrowUp"===t.key&&this.move(0,-e),"ArrowDown"===t.key&&this.move(0,e),"+"===t.key&&this.zoom(i),"-"===t.key&&this.zoom(-i)}update(){this.controls.update()}enable(){this.controls.enabled=!0}disable(){this.controls.enabled=!1}dispose(){this.unbindEventListeners(),this.controls.dispose()}reset(){this.controls.target.set(0,0,0)}enableZoom(){this.controls.enableZoom=!0}disableZoom(){this.controls.enableZoom=!1}move(t,e){var i,s;let{minAzimuthAngle:n,maxAzimuthAngle:o,minPolarAngle:r,maxPolarAngle:a}=this.controls;this.controls.minAzimuthAngle=this.controls.maxAzimuthAngle=(i=window.threeJsAddons)===null||void 0===i?void 0:i.MathUtils.clamp(this.controls.getAzimuthalAngle()+t,n+t,o-t),this.controls.minPolarAngle=this.controls.maxPolarAngle=(s=window.threeJsAddons)===null||void 0===s?void 0:s.MathUtils.clamp(this.controls.getPolarAngle()+e,r+e,a-e),this.controls.update(),this.controls.minAzimuthAngle=n,this.controls.maxAzimuthAngle=o,this.controls.minPolarAngle=r,this.controls.maxPolarAngle=a}zoom(t){var e;let{minDistance:i,maxDistance:s}=this.controls;this.controls.minDistance=this.controls.maxDistance=(e=window.threeJsAddons)===null||void 0===e?void 0:e.MathUtils.clamp(this.controls.getDistance()-t,i+t,s-t),this.controls.update(),this.controls.minDistance=i,this.controls.maxDistance=s}constructor(t,e){this.controls=new window.threeJsAddons.OrbitControls(t,e),this.controls.enableDamping=!0,this.controls.dampingFactor=.25,this.controls.enableZoom=!0,this.controls.enablePan=!1,this.unbindEventListeners=this.bindEventListeners(e)}}class v{static isTouchDevice(){return"ontouchstart"in document.documentElement}static isIOSDevice(){return v.isIPhoneDevice()||v.isIPadDevice()}static isNativeWindowsBrowser(){return v.isIEBrowser()||v.isEdgeBrowser()}static isIPhoneDevice(){return!!navigator.userAgent.match(/iPhone/i)}static isIPadDevice(){return!!navigator.userAgent.match(/iPad/i)}static isIEBrowser(){return -1!==navigator.userAgent.toLowerCase().indexOf("msie")||!!navigator.userAgent.match(/Trident.*rv:\d+\./)}static isEdgeBrowser(){return!!navigator.userAgent.match(/Edge\/\d+/i)}static getList(){return{"is-touch":v.isTouchDevice(),"is-ios":v.isIOSDevice(),"is-native-windows":v.isNativeWindowsBrowser(),"is-iphone":v.isIPhoneDevice(),"is-ipad":v.isIPadDevice(),"is-ie"
1:v.isIEBrowser(),"is-edge":v.isEdgeBrowser()}}}class m{onMove(){var t;(t=this.note)===null||void 0===t||t.classList.add(m.options.hiddenClass),this.plugin.canvas&&this.plugin.canvas.removeEventListener("pointerup",this.onMove.bind(this))}constructor(t){var e,i,s,n;if(this.plugin=t,!this.plugin.canvas)return;if(this.note=(s=(i=this.plugin.canvas)===null||void 0===i?void 0:(e=i.parentElement)===null||void 0===e?void 0:e.querySelector(m.options.noteSelector))!==null&&void 0!==s?s:void 0,v.isTouchDevice()){let t=(n=this.note)===null||void 0===n?void 0:n.getAttribute(m.options.touchTextDataAttribute);t&&this.note&&(this.note.innerText=t)}this.plugin.canvas.addEventListener("pointerup",this.onMove.bind(this))}}m.options={noteSelector:"[data-spatial-movement-note]",hiddenClass:"spatial-canvas-note--hidden",touchTextDataAttribute:"data-spatial-movement-note-touch-text"};class w{initAmbientLight(t){let e=new window.threeJs.AmbientLight(t.color,t.intensity);e.name=t.id,this.lightGroup.add(e)}initDirectionalLight(t){var e,i,s,n,o,r,a,l,d,h,c,u;let p=new window.threeJs.DirectionalLight(t.color,t.intensity);p.position.set((a=(e=t.position)===null||void 0===e?void 0:e.x)!==null&&void 0!==a?a:0,(l=(i=t.position)===null||void 0===i?void 0:i.y)!==null&&void 0!==l?l:0,(d=(s=t.position)===null||void 0===s?void 0:s.z)!==null&&void 0!==d?d:0),p.target.position.set((h=(n=t.target)===null||void 0===n?void 0:n.x)!==null&&void 0!==h?h:0,(c=(o=t.target)===null||void 0===o?void 0:o.y)!==null&&void 0!==c?c:0,(u=(r=t.target)===null||void 0===r?void 0:r.z)!==null&&void 0!==u?u:0),p.name=t.id,this.lightGroup.add(p)}addLight(t){switch(t.type){case"ambient":this.initAmbientLight(t);break;case"directional":this.initDirectionalLight(t)}}removeLight(t){this.removeLightById(t.id)}removeLightById(t){this.lights=this.lights.filter(e=>e.id!==t);let e=this.lightGroup.getObjectByName(t);e&&this.lightGroup.remove(e)}dispose(){this.lights=[],this.scene.remove(this.lightGroup)}constructor(t,e,i){this.lights=null!=i?i:w.defaultLights,e&&this.lights.forEach(t=>{t.intensity=Number(e)/100}),this.scene=t,this.lightGroup=new window.threeJs.Group,this.lightGroup.name="lightGroup",this.lights.forEach(t=>{this.addLight(t)}),this.scene.add(this.lightGroup)}}w.defaultLights=[{id:"ambient",type:"ambient",color:"#ffffff",intensity:1},{id:"directional",type:"directional",color:"#ffffff",intensity:1,position:{x:-5,y:2,z:2},target:{x:0,y:0,z:0}},{id:"directional",type:"directional",color:"#ffffff",intensity:1,position:{x:0,y:2,z:2},target:{x:0,y:0,z:0}},{id:"directional",type:"directional",color:"#ffffff",intensity:1,position:{x:5,y:2,z:2},target:{x:0,y:0,z:0}}];class g extends h{async init(){await d();let t=this.el.closest(".cms-spatial-viewer-container");t.querySelector(".spatial-open-fullscreen-btn").addEventListener("click",this.openFullScreen.bind(this)),t.querySelector(".spatial-close-fullscreen-btn").addEventListener("click",this.closeFullScreen.bind(this)),this.$emitter||(this.$emitter=this.el.$emitter),this.initViewer(!0)}closeFullScreen(){var t,e;(t=this.el.closest(".cms-spatial-viewer-container"))===null||void 0===t||t.classList.remove("spatial-fullscreen-view"),(e=this.el.closest("body"))===null||void 0===e||e.classList.remove("spatial-viewer-remove-scroll-bars"),this.spatialOrbitControlsUtil.disableZoom()}openFullScreen(){var t,e;(t=this.el.closest(".cms-spatial-viewer-container"))===null||void 0===t||t.classList.add("spatial-fullscreen-view"),(e=this.el.closest("body"))===null||void 0===e||e.classList.add("spatial-viewer-remove-scroll-bars"),this.spatialOrbitControlsUtil.enableZoom()}initViewer(t){var e,i,s,n,o,r,a,l;if(super.initViewer(t),(e=this.renderer)===null||void 0===e||e.setClearColor(16777215,0),(i=this.camera)===null||void 0===i||i.position.set(0,.6,1.2),(s=this.camera)===null||void 0===s||s.lookAt(0,0,0),(n=this.spatialOrbitControlsUtil)===null||void 0===n||n.dispose(),this.camera&&this.renderer&&(this.spatialOrbitControlsUtil=new p(this.camera,this.renderer.domElement),this.spatialOrbitControlsUtil.disableZoom()),this.spatialMovementNoteUtil=new m(this),this.spatialCanvasSizeUpdateUtil=new c(this),(void 0==this.spatialLightCompositionUtil||t)&&((o=this.spatialLightCompositionUtil)===null||void 0===o||o.dispose(),this.scene&&(this.spatialLightCompositionUtil=new w(this.scene,this.options.lightIntensity))),(void 0==this.spatialObjectLoaderUtil||t)&&(this.spatialObjectLoaderUtil=new u(this)),void 0==this.model||t){let t=this.options.modelUrl;if(null==t||null==this.scene)return;this.spatialObjectLoaderUtil.loadSingleObjectByUrl(t,{center:!0,clampSize:!0,clampMaxSize:{x:4/3,y:1,z:4/3}}).then(t=>{var e,i,s;this.model=t,this.scene&&this.scene.add(this.model),this.checkDynamicViewer(),(s=this.el)===null||void 0===s||(i=s.closest(".cms-spatial-viewer-container"))===null||void 0===i||(e=i.querySelector(".spatial-canvas-spinner"))===null||void 0===e||e.classList.add("d-none"),this.setReady(!0)}).catch(()=>{var t,e,i;(i=this.el)===null||void 0===i||(e=i.parentElement)===null||void 0===e||(t=e.parentElement)===null||void 0===t||t.classList.add("spatial-cms-canvas-disabled")})}else(l=this.el)===null||void 0===l||(a=l.closest(".cms-spatial-viewer-container"))===null||void 0===a||(r=a.querySelector(".spatial-canvas-spinner"))===null||void 0===r||r.classList.add("d-none"),this.setReady(!0);super.startRendering()}preRender(t){var e,i;(e=this.spatialCanvasSizeUpdateUtil)===null||void 0===e||e.update(
1),(i=this.spatialOrbitControlsUtil)===null||void 0===i||i.update()}postRender(t){}getModelDimensions(){return void 0==this.model?{x:0,y:0,z:0}:new window.threeJs.Box3().setFromObject(this.model).getSize(new window.threeJs.Vector3)}checkDynamicViewer(){let t=this.el.closest(".cms-spatial-viewer-container-with-canvas");if(!t.classList.contains("is-dynamic"))return;let e=this.getModelDimensions(),i=Math.max(e.x,e.z)/e.y;t.style.aspectRatio="".concat(i)}}}}]);

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.