PageSourceSearch

https://www.kalieber.de/theme/ad3790167585c93f471cfdeda96610d2/js/…ment.spatial-cms-viewer.plugin.ts.f9de5f.js

js kalieber.de collected 2026-09-26 08:58:15 UTC 9,519 bytes, 1 lines download raw bytes

1"use strict";(self.webpackChunkspatial_cms_element=self.webpackChunkspatial_cms_element||[]).push([[20529],{156(e){var t=function(e){var t;return!!e&&"object"==typeof e&&"[object RegExp]"!==(t=Object.prototype.toString.call(e))&&"[object Date]"!==t&&e.$$typeof!==i},i="function"==typeof Symbol&&Symbol.for?Symbol.for("react.element"):60103;function s(e,t){return!1!==t.clone&&t.isMergeableObject(e)?l(Array.isArray(e)?[]:{},e,t):e}function n(e,t,i){return e.concat(t).map(function(e){return s(e,i)})}function r(e){return Object.keys(e).concat(Object.getOwnPropertySymbols?Object.getOwnPropertySymbols(e).filter(function(t){return Object.propertyIsEnumerable.call(e,t)}):[])}function a(e,t){try{return t in e}catch(e){return!1}}function l(e,i,o){(o=o||{}).arrayMerge=o.arrayMerge||n,o.isMergeableObject=o.isMergeableObject||t,o.cloneUnlessOtherwiseSpecified=s;var c,u,d=Array.isArray(i);return d!==Array.isArray(e)?s(i,o):d?o.arrayMerge(e,i,o):(u={},(c=o).isMergeableObject(e)&&r(e).forEach(function(t){u[t]=s(e[t],c)}),r(i).forEach(function(t){(!a(e,t)||Object.hasOwnProperty.call(e,t)&&Object.propertyIsEnumerable.call(e,t))&&(a(e,t)&&c.isMergeableObject(i[t])?u[t]=(function(e,t){if(!t.customMerge)return l;var i=t.customMerge(e);return"function"==typeof i?i:l})(t,c)(e[t],i[t],c):u[t]=s(i[t],c))}),u)}l.all=function(e,t){if(!Array.isArray(e))throw Error("first argument should be an array");return e.reduce(function(e,i){return l(e,i,t)},{})},e.exports=l},529(e,t,i){i.r(t),i.d(t,{default:()=>u});var s=i(156),n=i.n(s);class r{static ucFirst(e){return e.charAt(0).toUpperCase()+e.slice(1)}static lcFirst(e){return e.charAt(0).toLowerCase()+e.slice(1)}static toDashCase(e){return e.replace(/([A-Z])/g,"-$1").replace(/^-/,"").toLowerCase()}static toLowerCamelCase(e,t){let i=r.toUpperCamelCase(e,t);return r.lcFirst(i)}static toUpperCamelCase(e,t){return t?e.split(t).map(e=>r.ucFirst(e.toLowerCase())).join(""):r.ucFirst(e.toLowerCase())}static parsePrimitive(e){try{return/^\d+(.|,)\d+$/.test(e)&&(e=e.replace(",",".")),JSON.parse(e)}catch(t){return e.toString()}}}class a{constructor(e=document){this._el=e,e.$emitter=this,this._listeners=[]}publish(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=arguments.length>2&&void 0!==arguments[2]&&arguments[2],s=new CustomEvent(e,{detail:t,cancelable:i});return this.el.dispatchEvent(s),s}subscribe(e,t){let i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},s=this,n=e.split("."),r=i.scope?t.bind(i.scope):t;if(i.once&&!0===i.once){let t=r;r=function(i){s.unsubscribe(e),t(i)}}return this.el.addEventListener(n[0],r),this.listeners.push({splitEventName:n,opts:i,cb:r}),!0}unsubscribe(e){arguments.length>1&&"function"==typeof arguments[1]&&console.warn(`[NativeEventEmitter] Unsubscribing by passing the subscriber function as a second argument is not supported. By default, all listeners for the event will be removed. Use a suffix (separated by a dot) on the event name when subscribing/unsubscribing to identify/target your specific listener only, e.g. "${e}.MyCustomPlugin"`);let t=e.split(".");return this.listeners=this.listeners.reduce((e,i)=>([...i.splitEventName].sort().toString()===t.sort().toString()?this.el.removeEventListener(i.splitEventName[0],i.cb):e.push(i),e),[]),!0}reset(){return this.listeners.forEach(e=>{this.el.removeEventListener(e.splitEventName[0],e.cb)}),this.listeners=[],!0}get el(){return this._el}set el(e){this._el=e}get listeners(){return this._listeners}set listeners(e){this._listeners=e}}class l{constructor(e,t={},i=!1){if(!(e instanceof Node)){console.warn(`There is no valid element given while trying to create a plugin instance for "${i}".`);return}this.el=e,this.$emitter=new a(this.el),this._pluginName=this._getPluginName(i),this.options=this._mergeOptions(t),this._initialized=!1,this._registerInstance(),this._init()}init(){console.warn(`The "init" method for the plugin "${this._pluginName}" is not defined. The plugin will not be initialized.`)}update(){}destroy(){}_init(){this._initialized||(this.init(),this._initialized=!0)}_update(){this._initialized&&this.update()}_mergeOptions(e){let t=[this.constructor.options,this.options,e];return t.push(this._getConfigFromDataAttribute()),t.push(this._getOptionsFromDataAttribute()),n().all(t.filter(e=>e instanceof Object&&!(e instanceof Array)).map(e=>e||{}))}_getConfigFromDataAttribute(){let e={};if("function"!=typeof this.el.getAttribute)return e;let t=r.toDashCase(this._pluginName),i=this.el.getAttribute(`data-${t}-config`);return i?window.PluginConfigManager.get(this._pluginName,i):e}_getOptionsFromDataAttribute(){let e={};if("function"!=typeof this.el.getAttribute)return e;let t=r.toDashCase(this._pluginName),i=this.el.getAttribute(`data-${t}-options`);if(i)try{return JSON.parse(i)}catch(e){console.error(`The data attribute "data-${t}-options" could not be parsed to json: ${e.message}`)}return e}_registerInstance(){window.PluginManager.getPluginInstancesFromElement(this.el).set(this._pluginName,this),window.PluginManager.getPlugin(this._pluginName,!1).get("instances").push(this)}_getPluginName(e){return e||(e=this.constructor.name),e}}async function o(){return(window.loadDiveUtil||(window.loadDiveUtil={promise:null}),window.DIVEClass||window.DIVEARPlugin||window.DIVEQuickViewPlugin||window.DIVEAnimationPlugin)?Promise.resolve():(window.loadDiveUtil.promise||(window.loadDiveUtil.promise=new Promise(e=>{let t=Promise.all([i.e(99451),i.e(86179),i.e(50209)]).then(i.bind(i,209));Promise.all([t,Promise.all([i.e(99451),i.e(86179),i.e(55399),i.e(20947),i.e(93772)]).then(i.bind(i,772)),Promise.all([i.e(99451),i.e(86179),i.e(87411)]).then(i.bind(i,411)),Promise.all([i.e(99451),i.e(95939)]).then(i.bind(i,939))]).then(t=>{let[i,s,n,r]=t;window.DIVEClass=i.DIVE,window.DIVEARPlugin=s,window.DIVEQuickViewPlugin=n,window.DIVEAnimationPlugin=r,e()})})),window.loadDiveUtil.promise)}
1class c extends l{async init(){await o(),await this.initViewer()}async initViewer(){if(this.setReady(!1),this.canvas=this.el,this.canvas.tabIndex=0,void 0==this.dive){this.dive=await window.DIVEQuickViewPlugin.QuickView(this.options.modelUrl,{autoStart:!1,canvas:this.canvas});let e=this.dive.model.animations;if(e.length>0){let t=new window.DIVEAnimationPlugin.AnimationSystem;await t.fromClips(this.dive.model,e),this.dive.clock.addTicker(t);let i=await t.fromClips(this.dive.model,e);i.loop="repeat",i.play();let s=this.canvas.parentElement?.querySelector(".spatial-anim-container");if(!s)return;let n=s.querySelector(".spatial-anim-button");if(!n)return;n.addEventListener("click",()=>{"playing"===i.state?(i.pause(),n.classList.remove("spatial-anim-play")):(i.resume(),n.classList.add("spatial-anim-play"))});let r=n.querySelector(".spatial-anim-button-circle");if(!r)return;r.style.setProperty("--progress",String(0));let a=i.update.bind(i);if(i.update=e=>{a(e);let t=i.duration>0?i.time/i.duration:0;r.style.setProperty("--progress",String(t))},n.classList.add("spatial-anim-play"),n.classList.remove("visually-hidden"),e.length>1){let t=s.querySelector(".spatial-anim-switch-container");if(!t)return;let a=t.querySelector(".spatial-anim-switch");if(!a)return;e.forEach(e=>{let t=document.createElement("option");t.value=e.name,t.textContent=e.name,a.appendChild(t)}),a.addEventListener("change",e=>{let t=e.target.value;i.play(t),n.classList.add("spatial-anim-play"),r.style.setProperty("--progress",String(0))}),t.classList.remove("visually-hidden")}}}this.$emitter.publish("Viewer/initViewer")}startRendering(){this.rendering||(this.rendering=!0,this.dive?.start(),this.canvas?.parentElement?.classList.add("spatial-canvas-rendering"),this.ready&&this.canvas?.parentElement?.classList.add("spatial-canvas-display"),this.$emitter.publish("Viewer/startRendering"))}stopRendering(){this.rendering=!1,this.dive?.stop(),this.canvas?.parentElement?.classList.remove("spatial-canvas-rendering"),this.$emitter.publish("Viewer/stopRendering")}setReady(e){this.ready!==e&&(this.ready=e,this.onReady(e))}onReady(e){void 0!=this.canvas&&(e?(this.$emitter.publish("Viewer/ready"),this.canvas.parentElement?.classList.add("spatial-canvas-ready"),this.rendering&&this.canvas.parentElement?.classList.add("spatial-canvas-display")):(this.$emitter.publish("Viewer/notReady"),this.canvas.parentElement?.classList.remove("spatial-canvas-ready"),this.canvas.parentElement?.classList.remove("spatial-canvas-display")))}constructor(...e){super(...e),this.rendering=!1,this.ready=!1}}class u extends c{async init(){await o();let e=this.el.closest(".cms-spatial-viewer-container");e.querySelector(".spatial-open-fullscreen-btn").addEventListener("click",this.openFullScreen.bind(this)),e.querySelector(".spatial-close-fullscreen-btn").addEventListener("click",this.closeFullScreen.bind(this)),this.$emitter||(this.$emitter=this.el.$emitter),await this.initViewer()}closeFullScreen(){this.el.closest(".cms-spatial-viewer-container")?.classList.remove("spatial-fullscreen-view"),this.el.closest("body")?.classList.remove("spatial-viewer-remove-scroll-bars")}openFullScreen(){this.el.closest(".cms-spatial-viewer-container")?.classList.add("spatial-fullscreen-view"),this.el.closest("body")?.classList.add("spatial-viewer-remove-scroll-bars")}async initViewer(){try{await super.initViewer()}catch(e){this.el?.parentElement?.parentElement?.classList.add("spatial-cms-canvas-disabled")}finally{this.el?.closest(".cms-spatial-viewer-container")?.querySelector(".spatial-canvas-spinner")?.classList.add("d-none"),this.setReady(!0),super.startRendering()}}}}}]);

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.