@colijnit/configurator 1.0.13 → 1.0.17
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/app/builder.d.ts +12 -11
- package/app/components/answers/answer/answer.component.d.ts +0 -1
- package/app/services/configurator.service.d.ts +9 -14
- package/app/services/locator.service.d.ts +4 -0
- package/bundles/colijnit-configurator.umd.js +207 -76
- package/bundles/colijnit-configurator.umd.js.map +1 -1
- package/bundles/colijnit-configurator.umd.min.js +2 -2
- package/bundles/colijnit-configurator.umd.min.js.map +1 -1
- package/colijnit-configurator.d.ts +6 -7
- package/colijnit-configurator.metadata.json +1 -1
- package/esm2015/app/builder.js +67 -25
- package/esm2015/app/components/answers/answer/answer.component.js +26 -17
- package/esm2015/app/components/answers/answers.component.js +16 -13
- package/esm2015/app/components/selections/selections.component.js +45 -25
- package/esm2015/app/services/configurator.service.js +36 -21
- package/esm2015/app/services/image-cache.service.js +3 -1
- package/esm2015/app/services/locator.service.js +10 -0
- package/esm2015/colijnit-configurator.js +7 -8
- package/esm2015/public_api.js +2 -1
- package/esm5/app/builder.js +116 -34
- package/esm5/app/components/answers/answer/answer.component.js +20 -10
- package/esm5/app/components/answers/answers.component.js +3 -3
- package/esm5/app/components/selections/selections.component.js +4 -4
- package/esm5/app/services/configurator.service.js +55 -22
- package/esm5/app/services/image-cache.service.js +3 -1
- package/esm5/app/services/locator.service.js +13 -0
- package/esm5/colijnit-configurator.js +7 -8
- package/esm5/public_api.js +2 -1
- package/fesm2015/colijnit-configurator.js +192 -96
- package/fesm2015/colijnit-configurator.js.map +1 -1
- package/fesm5/colijnit-configurator.js +203 -68
- package/fesm5/colijnit-configurator.js.map +1 -1
- package/package.json +2 -2
- package/public_api.d.ts +1 -0
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("three"),require("@colijnit/configuratorapi/build/model/deco-node"),require("@colijnit/configuratorapi/build/service/business-object-factory"),require("@colijnit/configuratorapi/build/model/selection"),require("@colijnit/configuratorapi/build/enum/deco-node-type.enum"),require("axios"),require("@colijnit/configuratorapi/build/enum/deco-node-kind.enum"),require("jszip"),require("@colijnit/configuratorapi/build/model/article"),require("@angular/core"),require("@colijnit/configuratorapi/build/configurator"),require("rxjs"),require("@angular/common"),require("@angular/animations")):"function"==typeof define&&define.amd?define("@colijnit/configurator",["exports","three","@colijnit/configuratorapi/build/model/deco-node","@colijnit/configuratorapi/build/service/business-object-factory","@colijnit/configuratorapi/build/model/selection","@colijnit/configuratorapi/build/enum/deco-node-type.enum","axios","@colijnit/configuratorapi/build/enum/deco-node-kind.enum","jszip","@colijnit/configuratorapi/build/model/article","@angular/core","@colijnit/configuratorapi/build/configurator","rxjs","@angular/common","@angular/animations"],t):t(((e=e||self).colijnit=e.colijnit||{},e.colijnit.configurator={}),e.three,e.decoNode,e.businessObjectFactory,e.selection,e.decoNodeType_enum,e.axios,e.decoNodeKind_enum,e.JSZip,e.article,e.ng.core,e.configurator,e.rxjs,e.ng.common,e.ng.animations)}(this,(function(e,t,n,i,r,o,a,s,c,l,u,d,h,
|
|
1
|
+
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("three"),require("@colijnit/configuratorapi/build/model/options"),require("@colijnit/configuratorapi/build/model/deco-node"),require("@colijnit/configuratorapi/build/service/business-object-factory"),require("@colijnit/configuratorapi/build/model/selection"),require("@colijnit/configuratorapi/build/enum/deco-node-type.enum"),require("axios"),require("@colijnit/configuratorapi/build/enum/deco-node-kind.enum"),require("jszip"),require("@colijnit/configuratorapi/build/model/article"),require("@angular/core"),require("@colijnit/configuratorapi/build/configurator"),require("@colijnit/configuratorapi/build/utils/function/not-nill.function"),require("@colijnit/configuratorapi/build/enum/node-type.enum"),require("@colijnit/configuratorapi/build/utils/function/is-nill.function"),require("rxjs"),require("@angular/common"),require("@angular/animations")):"function"==typeof define&&define.amd?define("@colijnit/configurator",["exports","three","@colijnit/configuratorapi/build/model/options","@colijnit/configuratorapi/build/model/deco-node","@colijnit/configuratorapi/build/service/business-object-factory","@colijnit/configuratorapi/build/model/selection","@colijnit/configuratorapi/build/enum/deco-node-type.enum","axios","@colijnit/configuratorapi/build/enum/deco-node-kind.enum","jszip","@colijnit/configuratorapi/build/model/article","@angular/core","@colijnit/configuratorapi/build/configurator","@colijnit/configuratorapi/build/utils/function/not-nill.function","@colijnit/configuratorapi/build/enum/node-type.enum","@colijnit/configuratorapi/build/utils/function/is-nill.function","rxjs","@angular/common","@angular/animations"],t):t(((e=e||self).colijnit=e.colijnit||{},e.colijnit.configurator={}),e.three,e.options,e.decoNode,e.businessObjectFactory,e.selection,e.decoNodeType_enum,e.axios,e.decoNodeKind_enum,e.JSZip,e.article,e.ng.core,e.configurator,e.notNill_function,e.nodeType_enum,e.isNill_function,e.rxjs,e.ng.common,e.ng.animations)}(this,(function(e,t,n,i,r,o,a,s,c,l,u,d,p,h,f,g,m,b,w){"use strict";s=s&&Object.prototype.hasOwnProperty.call(s,"default")?s.default:s;
|
|
2
2
|
/*! *****************************************************************************
|
|
3
3
|
Copyright (c) Microsoft Corporation.
|
|
4
4
|
|
|
@@ -13,5 +13,5 @@
|
|
|
13
13
|
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
|
14
14
|
PERFORMANCE OF THIS SOFTWARE.
|
|
15
15
|
***************************************************************************** */
|
|
16
|
-
var m=function(e,t){return(m=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(e,t)};function g(e,t,n,i){var r,o=arguments.length,a=o<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,n,i);else for(var s=e.length-1;s>=0;s--)(r=e[s])&&(a=(o<3?r(a):o>3?r(t,n,a):r(t,n))||a);return o>3&&a&&Object.defineProperty(t,n,a),a}function v(e,t,n,i){return new(n||(n=Promise))((function(r,o){function a(e){try{c(i.next(e))}catch(e){o(e)}}function s(e){try{c(i.throw(e))}catch(e){o(e)}}function c(e){var t;e.done?r(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}c((i=i.apply(e,t||[])).next())}))}function b(e,t){var n,i,r,o,a={label:0,sent:function(){if(1&r[0])throw r[1];return r[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(o){return function(s){return function(o){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,i&&(r=2&o[0]?i.return:o[0]?i.throw||((r=i.return)&&r.call(i),0):i.next)&&!(r=r.call(i,o[1])).done)return r;switch(i=0,r&&(o=[2&o[0],r.value]),o[0]){case 0:case 1:r=o;break;case 4:return a.label++,{value:o[1],done:!1};case 5:a.label++,i=o[1],o=[0];continue;case 7:o=a.ops.pop(),a.trys.pop();continue;default:if(!(r=a.trys,(r=r.length>0&&r[r.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!r||o[1]>r[0]&&o[1]<r[3])){a.label=o[1];break}if(6===o[0]&&a.label<r[1]){a.label=r[1],r=o;break}if(r&&a.label<r[2]){a.label=r[2],a.ops.push(o);break}r[2]&&a.ops.pop(),a.trys.pop();continue}o=t.call(e,a)}catch(e){o=[6,e],i=0}finally{n=r=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,s])}}}function w(e){var t="function"==typeof Symbol&&Symbol.iterator,n=t&&e[t],i=0;if(n)return n.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&i>=e.length&&(e=void 0),{value:e&&e[i++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}var y=function(){function e(){}return e.DisposeMaterial=function(e){var t=this;e&&(Array.isArray(e)?e.forEach((function(e){t.materialProps.filter((function(t){return e[t]})).forEach((function(t){return e[t].dispose()})),e.dispose()})):(this.materialProps.filter((function(t){return e[t]&&e[t].dispose})).forEach((function(t){return e[t].dispose()})),e.dispose&&e.dispose()))},e.DisposeObject=function(e){var t=this;e&&(e.children.length&&e.children.forEach((function(e){return t.DisposeObject(e)})),this.DisposeNode(e))},e.DisposeNode=function(e){var n=this;e.traverse((function(e){e instanceof t.Mesh&&(e.geometry&&e.geometry.dispose(),n.DisposeMaterial(e.material)),"function"==typeof e.dispose&&e.dispose()}))},e.materialProps=["map","lightMap","bumpMap","normalMap","specularMap","envMap","aoMap","roughnessMap","metalnessMap"],e}(),_=function(){function e(){}return e.StripMimeStringFromDataUri=function(e){if(!e)return"";var t=this.GetMimeStringFromDataUri(e);return e.substr(t.length+1)},e.GetMimeStringFromDataUri=function(e){return e?e.split(",")[0]:""},e.FileExists=function(e,t){return v(this,void 0,void 0,(function(){return b(this,(function(n){switch(n.label){case 0:return[4,a({method:"get",url:t+"getFiles.php?assetUrl="+e,responseType:"json"})];case 1:return[2,!!n.sent().data]}}))}))},e.FixUrl=function(t){if(!t)return"";var n=t;return n.endsWith("glb")||n.endsWith("obj")||n.endsWith("glb.gz")||n.endsWith("obj.gz")||(n=e.FixUnityUrl(n)),n=n.replace("/content/","/content43/")},e.FixGlbUrl=function(e){if(!e)return"";var t=e;return-1===e.indexOf("_webplayer")&&(t=e.concat("_webplayer")),(t=t.replace("/content/","/content43/")).endsWith(".glb")||(t=t.concat(".glb")),t},e.MimeTypeFromFilename=function(e){switch(/(?:\.([^.]+))?$/.exec(e)[1]){case"jpg":case"jpeg":return"image/jpeg";case"png":return"image/png";case"bmp":return"image/bmp"}},e.DownloadFile=function(e,t,n){void 0===n&&(n="text/plain");var i=document.createElement("a");i.setAttribute("href","data:"+n+";charset=utf-8,"+encodeURIComponent(t)),i.setAttribute("download",e),i.style.display="none",document.body.appendChild(i),i.click(),document.body.removeChild(i)},e.ReadAsText=function(e){return new Promise((function(t){var n=new FileReader;n.readAsText(e),n.onloadend=function(e){2===e.target.readyState&&t(e.target.result)}}))},e.GetExtensionFromDataUri=function(e){return e.replace(/(data:image\/)(.*?)(;base64.*)/gi,"$2")},e.CreateDownloadFileNameFromBase64=function(e){return"preview."+this.GetExtensionFromDataUri(e)},e.DownloadFromDataUri=function(e,t){var n=document.createElement("a");n.download=t,n.href=e,document.body.appendChild(n),n.click(),document.body.removeChild(n)},e.DocumentBodyToDataUri=function(e,t){return e?"data:"+t+";base64,"+e:""},e.FixUnityUrl=function(e){return(e=-1===e.indexOf("_webplayer")?e.concat("_webplayer.ione3d"):e.replace("_webplayer","_webplayer.ione3d")).endsWith(".gz")||(e=e.concat(".gz")),e.replace(".unity3d","")},e._cachedTextureUploads=new Map,e}(),x=function(){function e(){this._objectCache=new Map}return e.prototype.clearCache=function(){Array.from(this._objectCache.values()).forEach((function(e){return y.DisposeObject(e)})),this._objectCache.clear()},e.prototype.download3DSource=function(e){var t=this;return new Promise((function(n,i){return v(t,void 0,void 0,(function(){var t,r=this;return b(this,(function(o){switch(o.label){case 0:return e=e.replace(".unity3d",""),t=e+(e.indexOf(".glb")<0?".glb":""),this._objectCache.has(t)?(n(this._objectCache.get(t)),[2]):[4,_.FileExists(t,"https://cdn1.colijn-it.nl/content43/")];case 1:return o.sent()?this.loadGlbSource(t).then((function(e){r._objectCache.set(t,e),n(e)})):i("GLB source not found! ("+t+")"),[2]}}))}))}))},e.prototype.readFileAsText=function(e){var t=new FileReader;return new Promise((function(n,i){t.onload=function(e){return n(e.target.result)},t.onerror=function(e){return i(e)},t.readAsText(e)}))},e.prototype.loadJsonModel=function(e){return v(this,void 0,void 0,(function(){var n,i,r=this;return b(this,(function(o){switch(o.label){case 0:return this._objectCache.has(e)?[2,Promise.resolve(this._objectCache.get(e))]:[4,this._readJsonFile(e)];case 1:return n=o.sent(),(i=new t.ObjectLoader).crossOrigin="Anonymous",[2,new Promise((function(t,o){try{var a=i.parse(n);r._objectCache.set(e,a),t(a)}catch(e){o(null)}}))]}}))}))},e.prototype.loadJsonObjectModel=function(e){return v(this,void 0,void 0,(function(){var n,i=this;return b(this,(function(r){return this._objectCache.has(e)?[2,Promise.resolve(this._objectCache.get(e))]:((n=new t.ObjectLoader).setCrossOrigin("Anonymous"),n.setResourcePath(""),[2,new Promise((function(t,r){n.load(e,(function(n){var r="Scene"===n.type&&"Object3D"===n.children[0].type?n.children[0]:n;i._objectCache.set(e,r),t(r)}),(function(e){return null}),(function(e){return r(e)}))}))])}))}))},e.prototype.loadGlbModel=function(e,t){return void 0===t&&(t=!0),v(this,void 0,void 0,(function(){var n;return b(this,(function(i){switch(i.label){case 0:return this._objectCache.has(e)?[2,Promise.resolve(this._objectCache.get(e))]:window.hasOwnProperty("loadGLTF")?[4,window.loadGLTF(e)]:(console.error("loadGLTF not defined in window global"),[2,null]);case 1:return(n=i.sent())?(this._cleanedUpObjects(n,t),this._objectCache.set(e,n),[2,n]):[2,null]}}))}))},e.prototype.loadGlbSource=function(e){return v(this,void 0,void 0,(function(){var n,i;return b(this,(function(r){switch(r.label){case 0:return[4,this.loadGlbModel(e,!1)];case 1:return(n=r.sent())&&(n.children=n.children.filter((function(e){return!(e instanceof t.Camera)})),n.children.sort((function(e,t){return e.name<t.name?1:-1})),n.children.forEach((function(e){e.traverse((function(e){e.visible=!e.name.toLowerCase().startsWith("c_")})),e.visible=!1})),1===n.children.length&&n.children[0]instanceof t.Group&&(i=n.children[0].children.slice(),n.children.length=0,n.children=i)),[2,n]}}))}))},e.prototype.textureFromUrl=function(e){return v(this,void 0,void 0,(function(){return b(this,(function(n){return[2,new Promise((function(n,i){(new t.TextureLoader).load(e,(function(e){return e.wrapT=t.RepeatWrapping,e.wrapS=t.RepeatWrapping,e.repeat.set(1,1),e.needsUpdate=!0,n(e)}),null,i)}))]}))}))},e.prototype._cleanedUpObjects=function(e,n){var i=this;void 0===n&&(n=!0);var r=new t.Object3D;e.children.forEach((function(e){e instanceof t.Camera||(n&&e instanceof t.Group||1===e.children.length&&e.children[0]instanceof t.Group?i._addGroupChildrenToObject(e,r):n&&!(e instanceof t.Mesh)||!(e instanceof t.Mesh)&&!e.name&&e.children.length>0?(e.children.forEach((function(t){t.translateY(e.position.y)})),e.translateY(-e.position.y),r.children.length>0?r.add(e.clone()):r=e.clone()):r.add(e.clone()))}));var o=(new t.Box3).setFromObject(r),a=new t.Vector3;o.getCenter(a);var s=(new t.Vector3).add(a).negate();return r.children.forEach((function(e){e.position.add(s)})),r},e.prototype._addGroupChildrenToObject=function(e,n,i){var r=this;void 0===i&&(i=!0),e.children.forEach((function(o){i&&o instanceof t.Group?r._addGroupChildrenToObject(o,n):(o.translateY(e.position.y),n.add(o.clone()))}))},e.prototype._iterateChildren=function(e,n){for(var i=0;i<e.length;i++){var r=e[i];r instanceof t.Mesh?n(r):this._iterateChildren(r.children,n)}},e.prototype._readJsonFile=function(e){return v(this,void 0,void 0,(function(){var t,n;return b(this,(function(i){switch(i.label){case 0:return i.trys.push([0,5,,6]),[4,fetch(e)];case 1:return(t=i.sent()).ok?[3,2]:[2,""];case 2:return n=!1,[4,t.clone().text().then((function(e){""===e&&(n=!0)}))];case 3:return i.sent(),[2,n?{}:t.json()];case 4:return[3,6];case 5:return i.sent(),[2,""];case 6:return[2]}}))}))},e}(),j=function(){function e(){}return e.TrySelectorConnection=function(e,t,n,i,r){var o;r&&(i=r(o=i));for(var a=0;a<n.children.length;a++)for(var s=0;s<i.children.length;s++){var c=n.children[a],l=i.children[s];if(!c.connected&&!l.connected&&this.CanSelectorConnect(c,l)){if(!o)return this.SelectorConnect(e,t,c,l);var u=r(o,i,n);this.SelectorConnect(e,t,c,u.children[s])}}return!1},e.Convert3DPointToScreenPoint=function(e,n,i,r){if(!e)return new t.Vector2;var o=e.clone().project(n);return o.x=(o.x+1)/2*i,o.y=-(o.y-1)/2*r,new t.Vector2(o.x,o.y)},e.CanSelectorConnect=function(e,n){var i=e instanceof t.Object3D?e.name:e.connector,r=n instanceof t.Object3D?n.name:n.connector,o=e instanceof t.Object3D&&n instanceof t.Object3D&&e.parent===n.parent,a=i.toUpperCase().split("_"),s=r.toUpperCase().split("_");return a.length>=3&&s.length>=3&&!o&&("C"===a[0]&&"C"===s[0]&&a[1]===s[1]&&a[2]!==s[2])},e.SelectorConnect=function(e,n,i,r){if(!e||!n)return!1;i.connectedTo=r.parent.name,r.connectedTo=i.parent.name;var o=new t.Euler(0,0,0),a=new t.Vector3(0,0,0);e.updateMatrixWorld(!0),o.copy(n.rotation),n.getWorldPosition(a),n.rotation.set(0,0,0),n.position.set(0,0,0);var s=new t.Quaternion;i.getWorldQuaternion(s);var c=new t.Quaternion;r.getWorldQuaternion(c);var l=new t.Quaternion;i.parent.getWorldQuaternion(l);var u=new t.Quaternion;r.parent.getWorldQuaternion(u);var d=(new t.Quaternion).multiplyQuaternions(s.invert(),c).multiply((new t.Quaternion).multiplyQuaternions(l,l));r.parent.quaternion.copy(d),e.updateMatrixWorld(!0);var h=new t.Vector3;i.getWorldPosition(h);var p=new t.Vector3;r.getWorldPosition(p);var f=h.sub(p);return r.parent.position.x+=f.x,r.parent.position.y+=f.y,r.parent.position.z+=f.z,n.rotation.copy(o),n.position.copy(a),e.updateMatrixWorld(!0),i.connected=!0,r.connected=!0,!0},e}(),F=function(){this.specular=new t.Color(.3,.3,.3),this.shininess=0,this.repeatX=4,this.repeatY=4,this.loaded=!1},C=function(){function e(){}return e.CreateTextureFromBase64=function(n,i,r){return new Promise((function(o){e.textures.has(n)?o(e.textures.get(n)):i?(new t.TextureLoader).load(i,(function(i){i.anisotropy=16,i.wrapS=t.RepeatWrapping,i.wrapT=t.RepeatWrapping,i.repeat=new t.Vector2(r?r.repeatX:1,r?r.repeatY:1),i.needsUpdate=!0,e.textures.set(n,i),o(i)})):o(new t.Texture)}))},e.getDocBodyWithMimeTypeDefinition=function(e,t){if(null===t)return t;switch(e.substr(e.lastIndexOf(".")+1).toLowerCase()){case"jpg":case"jpeg":return"data:image/jpg;base64,"+t;case"png":return"data:image/png;base64,"+t;case"gif":return"data:image/gif;base64,"+t;case"bmp":return"data:image/bmp;base64,"+t;default:return"data:image/png;base64,"+t}},e.getFixedImageFilepathUrl=function(e){return e.replace("/content/","/content43/")},e.textures=new Map,e}(),O=(function(e){function t(){return null!==e&&e.apply(this,arguments)||this}(function(e,t){function n(){this.constructor=e}m(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)})(t,e)}(F),function(){function e(){}return e.CreateMaterialFromAsset=function(n){return v(this,void 0,void 0,(function(){var i,r,o,a,s,c;return b(this,(function(l){switch(l.label){case 0:return i=new F,n?(n.settings&&e.setSettingsOfMaterial(i,n.settings),n.texture?(r=i,[4,C.CreateTextureFromBase64(n.id+"_texture",n.texture,i)]):[3,2]):[2,i];case 1:r.texture=l.sent(),i.texture.encoding=t.sRGBEncoding,i.textureFilename=n.textureFilename,l.label=2;case 2:return n.normal?(o=i,[4,C.CreateTextureFromBase64(n.id+"_normal",n.normal,i)]):[3,4];case 3:o.normal=l.sent(),i.normalFilename=n.normalFilename,l.label=4;case 4:return n.ao?(a=i,[4,C.CreateTextureFromBase64(n.id+"_ao",n.ao,i)]):[3,6];case 5:a.ao=l.sent(),i.aoFilename=n.aoFilename,l.label=6;case 6:return n.metalness?(s=i,[4,C.CreateTextureFromBase64(n.id+"_metalness",n.metalness,i)]):[3,8];case 7:s.metalness=l.sent(),i.metalnessFilename=n.metalnessFilename,l.label=8;case 8:return n.roughness?(c=i,[4,C.CreateTextureFromBase64(n.id+"_roughness",n.roughness,i)]):[3,10];case 9:c.roughness=l.sent(),i.roughnessFilename=n.roughnessFilename,l.label=10;case 10:return[2,i]}}))}))},e.setSettingsOfMaterial=function(e,n){var i=parseFloat(n.power);isNaN(i)||(e.shininess=i);var r=parseFloat(n.level);isNaN(r)||(e.specular=new t.Color(r,r,r));var o=n.hasOwnProperty("repeat"),a=o?parseFloat(n.repeat.repeatx):parseFloat(n.repeatx);isNaN(a)||(e.repeatX=Math.max(1,a));var s=o?parseFloat(n.repeat.repeaty):parseFloat(n.repeaty);isNaN(s)||(e.repeatY=Math.max(1,s));var c=parseFloat(n.metalness);isNaN(c)||(e.metalnessValue=Math.min(1,c));var l=parseFloat(n.roughness);isNaN(l)||(e.roughnessValue=Math.min(1,l))},e}()),A=function(){},S=function(){this.settings={}},I=function(){function e(){}return e.LoadVariation=function(t,n){return v(this,void 0,void 0,(function(){var i,r,o;return b(this,(function(a){switch(a.label){case 0:if(!n)return[2,null];n.indexOf("ione3d")<0&&(n=n.concat(".ione3d")),i=n.substr(0,n.lastIndexOf(".ione3d")),a.label=1;case 1:return a.trys.push([1,4,,5]),t.endsWith("/")||(t+="/"),window.hasOwnProperty("downloadVariation")?[4,window.downloadVariation(t.replace("https://cdn1.colijn-it.nl/","")+"variation/"+n)]:(console.error("downloadVariation not defined in window global"),[2,null]);case 2:return r=a.sent(),[4,e.GetVariationSettingsFromFile(i,r)];case 3:return[2,a.sent()];case 4:return o=a.sent(),o,[2,null];case 5:return[2]}}))}))},e.GetVariationSettingsFromFile=function(t,n){return v(this,void 0,void 0,(function(){var i,r,o,a;return b(this,(function(s){switch(s.label){case 0:return n?[4,e.GetZipContent(n)]:[2,null];case 1:return i=s.sent(),(r=new S).id=t,i.files["index.json"]?[4,i.files["index.json"].async("string")]:[3,3];case 2:a=s.sent(),o=JSON.parse(a),s.label=3;case 3:return o?[4,e.CreateSettingsBasedOnIndex(o,r,i)]:[3,5];case 4:return s.sent(),[3,7];case 5:return[4,e.CreateSettingsBasedOnFileName(r,i)];case 6:s.sent(),s.label=7;case 7:return[2,r]}}))}))},e.CreateSettingsBasedOnIndex=function(t,n,i){return v(this,void 0,void 0,(function(){var r,o,a,s,c,l;return b(this,(function(u){switch(u.label){case 0:return t.normalFile?(r=n,[4,e.LoadFileContentFromZip(i.files[t.normalFile],t.normalFile)]):[3,2];case 1:r.normal=u.sent(),n.normalFilename=t.normalFile,u.label=2;case 2:return t.aoFile?(o=n,[4,e.LoadFileContentFromZip(i.files[t.aoFile],t.aoFile)]):[3,4];case 3:o.ao=u.sent(),n.aoFilename=t.aoFile,u.label=4;case 4:return t.metalnessFile?(a=n,[4,e.LoadFileContentFromZip(i.files[t.metalnessFile],t.metalnessFile)]):[3,6];case 5:a.metalness=u.sent(),n.metalnessFilename=t.metalnessFile,u.label=6;case 6:return t.roughnessFile?(s=n,[4,e.LoadFileContentFromZip(i.files[t.roughnessFile],t.roughnessFile)]):[3,8];case 7:s.roughness=u.sent(),n.roughnessFilename=t.roughnessFile,u.label=8;case 8:return t.diffuseFile?(c=n,[4,e.LoadFileContentFromZip(i.files[t.diffuseFile],t.diffuseFile)]):[3,10];case 9:c.texture=u.sent(),n.textureFilename=t.diffuseFile,u.label=10;case 10:return l=n,[4,e.LoadFileContentFromZip(i.files["repeat.json"],"repeat.json",!1)];case 11:return l.settings=u.sent()||{},Object.assign(n.settings,t.repeat),n.settings.metalness=t.metalness,n.settings.roughness=t.roughness,[2]}}))}))},e.CreateSettingsBasedOnFileName=function(e,t){return v(this,void 0,void 0,(function(){var n,i,r,o,a,s,c,l=this;return b(this,(function(u){switch(u.label){case 0:for(a in n=[],i=function(i){var o;return b(this,(function(a){switch(a.label){case 0:return t.files[i]?[4,t.files[i]]:[3,2];case 1:(o=a.sent()).name.toLowerCase().indexOf("normal")>-1&&r.FileIsImage(o.name)?n.push(t.files[i].async("base64").then((function(t){e.normal="data:image/"+l.GetBase64FileType(o.name)+";base64,"+t,e.normalFilename=i}))):o.name.toLowerCase().indexOf("ao")>-1&&r.FileIsImage(o.name)?n.push(t.files[i].async("base64").then((function(t){e.ao="data:image/"+l.GetBase64FileType(o.name)+";base64,"+t,e.aoFilename=i}))):o.name.toLowerCase().indexOf("metalness")>-1&&r.FileIsImage(o.name)?n.push(t.files[i].async("base64").then((function(t){e.metalness="data:image/"+l.GetBase64FileType(o.name)+";base64,"+t,e.metalnessFilename=i}))):o.name.toLowerCase().indexOf("roughness")>-1&&r.FileIsImage(o.name)?n.push(t.files[i].async("base64").then((function(t){e.roughness="data:image/"+l.GetBase64FileType(o.name)+";base64,"+t,e.roughnessFilename=i}))):o.name.toLowerCase().indexOf("diffuse")>-1&&r.FileIsImage(o.name)?n.push(t.files[i].async("base64").then((function(t){e.texture="data:image/"+l.GetBase64FileType(o.name)+";base64,"+t,e.textureFilename=i}))):o.name.indexOf(".jp")>-1?n.push(t.files[i].async("base64").then((function(t){e.texture="data:image/jpeg;base64,"+t,e.textureFilename=i}))):o.name.indexOf(".json")>-1&&n.push(t.files[i].async("string").then((function(t){var n=JSON.parse(t);for(var i in n)n[i]&&(e.settings[i]=n[i])}))),a.label=2;case 2:return[2]}}))},r=this,o=[],t.files)o.push(a);s=0,u.label=1;case 1:return s<o.length?(c=o[s],[5,i(c)]):[3,4];case 2:u.sent(),u.label=3;case 3:return s++,[3,1];case 4:return[4,Promise.all(n)];case 5:return u.sent(),[2]}}))}))},e.LoadFileContentFromZip=function(e,t,n){var i=this;return void 0===n&&(n=!0),new Promise((function(r){e&&t?e.async(n?"base64":"string").then((function(e){r(n?"data:image/"+i.GetBase64FileType(t)+";base64,"+e:e)})):r(void 0)}))},e.FileIsImage=function(e){switch(e.substring(e.lastIndexOf(".")+1,e.length).toLowerCase()){case"jpg":case"jpeg":case"png":case"bmp":return!0;default:return!1}},e.GetBase64FileType=function(e){switch(e.substring(e.lastIndexOf(".")+1,e.length).toLowerCase()){case"jpg":case"jpeg":return"jpeg";case"png":return"png";case"bmp":return"bmp";default:return"jpeg"}},e.GetZipContent=function(e){return v(this,void 0,void 0,(function(){return b(this,(function(t){switch(t.label){case 0:return[4,(new c).loadAsync(e)];case 1:return[2,t.sent()]}}))}))},e.MaterialCache=new Map,e}(),N=function(){function e(){this._lastKnownVariations=new Map}return e.prototype.clearCache=function(){for(var e=Array.from(this._lastKnownVariations.values()),t=0;t<e.length;t++){Array.from(e[t].values()).forEach((function(e){e.forEach((function(e){e.material.texture.dispose(),e.material.normal.dispose(),e.material.metalness.dispose(),e.material.roughness.dispose(),e.material.ao.dispose()}))}))}},e.prototype.loadPart=function(e,t,n){return void 0===n&&(n=!1),v(this,void 0,void 0,(function(){var i,r,a,s,c,l;return b(this,(function(u){switch(u.label){case 0:u.trys.push([0,6,,7]),i=t.length,r=0,u.label=1;case 1:return r<i?t[r].decoNode&&t[r].decoNode.gameObjectName&&t[r].decoNode.type===o.DecoNodeType.Part?[4,I.LoadVariation(this.assetPath,t[r].decoNode.gameObjectName||t[r].decoId)]:[3,4]:[3,5];case 2:return(a=u.sent())?((s=new A).decoId=parseFloat(t[r].decoNode.id),s.brandId=t[r].decoNode.brandId,s.gameObjectName=t[r].decoNode.gameObjectName,c=s,[4,O.CreateMaterialFromAsset(a)]):[3,4];case 3:c.material=u.sent(),this._applyMaterialPart(e,s,t[r].node,n),u.label=4;case 4:return r++,[3,1];case 5:return[3,7];case 6:return l=u.sent(),console.error(l),[3,7];case 7:return[2]}}))}))},e.prototype.loadVariation=function(e,t,n,i){return void 0===i&&(i=!1),v(this,void 0,void 0,(function(){var r,o,a,s,c,l,u,d,h;return b(this,(function(p){switch(p.label){case 0:p.trys.push([0,9,,10]),r=n.length,o=0,p.label=1;case 1:if(!(o<r))return[3,8];if(!(a=n[o].variations)||0===a.length)return this._getLastKnownVariations(e,n[o].nodeId)?(n[o].variations=this._getLastKnownVariations(e,n[o].nodeId),this._applyVariations(t,n[o],i),[3,7]):[3,7];s=[],c=0,p.label=2;case 2:return c<a.length?[4,I.LoadVariation(this.assetPath,a[c].gameObjectName||n[o].decoId)]:[3,6];case 3:return l=p.sent(),(u=new A).decoId=parseFloat(a[c].id),u.brandId=a[c].brandId,u.gameObjectName=a[c].gameObjectName,u.supplierArticleNr=a[c].supplierArticleNr,u.materialId=a[c].materialId,d=u,[4,O.CreateMaterialFromAsset(l)];case 4:d.material=p.sent(),s.push(u),p.label=5;case 5:return c++,[3,2];case 6:this._setLastKnownVariations(e,n[o].nodeId,s),n[o].variations=s,this._applyVariations(t,n[o],i),p.label=7;case 7:return o++,[3,1];case 8:return[3,10];case 9:return h=p.sent(),console.error(h),[3,10];case 10:return[2]}}))}))},e.prototype._getChildrenFilterByProp=function(e,t,n,i){return e.children.filter((function(e){return e.userData&&e.userData.hasOwnProperty(t)&&e.userData[t].hasOwnProperty(n)&&e.userData[t][n]===i}))},e.prototype._applyMaterialPart=function(e,n,i,r){var o=this;void 0===r&&(r=!1);for(var a=this._getChildrenFilterByProp(e,"selection","node",i),s=a.length,c=0;c<s;c++){var l=a[c];null!=l&&l.traverse((function(e){if(e instanceof t.Mesh&&n)if(Array.isArray(e.material))for(var i=0,a=e.material.length;i<a;i++)-1!==e.material[i].name.toLowerCase().indexOf("fixed_frame")&&(e.material[i]=o._setMeshMaterialFromVariation(e.material[i].name,n,r));else-1!==e.material.name.toLowerCase().indexOf("fixed_frame")&&(e.material=o._setMeshMaterialFromVariation(e.material.name,n,r))}))}},e.prototype._applyVariations=function(e,n,i){var r=this;void 0===i&&(i=!1);for(var o=this._getChildrenFilterByProp(e,"selection","node",n.node),a=o.length,s=0;s<a;s++){var c=o[s];null!=c&&c.traverse((function(e){if(e instanceof t.Mesh&&n.variations&&n.variations.length>0&&e.name.toLowerCase().indexOf("c_"))for(var o=0;o<n.variations.length;o++){var a=n.variations[o];if(a.material){var s=a.materialId?a.materialId.toLowerCase():"default";if(Array.isArray(e.material))for(var c=0,l=e.material.length;c<l;c++)-1!==e.material[c].name.toLowerCase().indexOf(s)&&(e.material[c]=r._setMeshMaterialFromVariation(e.material[c].name,a,i));else-1!==e.material.name.toLowerCase().indexOf(s)&&(e.material=r._setMeshMaterialFromVariation(e.material.name,a,i))}}}))}},e.prototype._setMeshMaterialFromVariation=function(e,n,i){if(void 0===i&&(i=!1),n.material.texture&&(n.material.texture.needsUpdate=!0),i){var r={name:e,roughness:n.material.roughnessValue?n.material.roughnessValue:1,metalness:n.material.metalnessValue?n.material.metalnessValue:0};return n.material.texture&&(r.map=n.material.texture),n.material.ao&&(r.aoMap=n.material.ao),n.material.roughness&&(r.roughnessMap=n.material.roughness),n.material.metalness&&(r.metalnessMap=n.material.metalness),n.material.normal&&(r.normalMap=n.material.normal),(o=new t.MeshStandardMaterial(r)).color.setRGB(1,1,1),o.needsUpdate=!0,o}var o;return(o=new t.MeshPhongMaterial({name:e,shininess:n.material.shininess,specular:n.material.specular,map:n.material.texture,normalMap:n.material.normal})).needsUpdate=!0,o},e.prototype._setLastKnownVariations=function(e,t,n){if(this._lastKnownVariations.has(e)){(i=this._lastKnownVariations.get(e)).set(t,n)}else{var i=new Map;this._lastKnownVariations.set(e,i.set(t,n))}},e.prototype._getLastKnownVariations=function(e,t){if(this._lastKnownVariations.has(e)){var n=this._lastKnownVariations.get(e);if(n.has(t))return n.get(t)}return null},e}(),M=function(){function e(){this.selectionsReceived=new h.BehaviorSubject([]),this.answersReceived=new h.BehaviorSubject([]),this.questionReceived=new h.BehaviorSubject(void 0),this._subs=[]}return e.prototype.ngOnDestroy=function(){this._subs.forEach((function(e){e.unsubscribe()}))},e.prototype.initApi=function(e){var t=this;this._configuratorApi=new d.Configurator(e),this._subs.push(this._configuratorApi.selectionsReceived.subscribe((function(e){return t.selectionsReceived.next(e)})),this._configuratorApi.answersReceived.subscribe((function(e){return t.answersReceived.next(e)})),this._configuratorApi.questionReceived.subscribe((function(e){return t.questionReceived.next(e)})))},e.prototype.initNodeInstance=function(e){return v(this,void 0,void 0,(function(){return b(this,(function(t){switch(t.label){case 0:return[4,this._configuratorApi.initNodeInstance(e)];case 1:return[2,t.sent()]}}))}))},e.prototype.setInstanceToConfigure=function(e,t){return void 0===t&&(t=!1),v(this,void 0,void 0,(function(){return b(this,(function(n){switch(n.label){case 0:return[4,this._configuratorApi.setInstanceToConfigure(e,t)];case 1:return[2,n.sent()]}}))}))},e.prototype.getGoodIdFromSku=function(e,t){return void 0===t&&(t=!1),v(this,void 0,void 0,(function(){return b(this,(function(n){switch(n.label){case 0:return[4,this._configuratorApi.getGoodIdFromSku(e,t)];case 1:return[2,n.sent()]}}))}))},e.prototype.getArticleQuickSel=function(e,t){return void 0===t&&(t=!1),v(this,void 0,void 0,(function(){return b(this,(function(n){switch(n.label){case 0:return[4,this._configuratorApi.getArticleQuickSel(e,t)];case 1:return[2,n.sent()]}}))}))},e.prototype.getSelections=function(e){return void 0===e&&(e=!1),v(this,void 0,void 0,(function(){return b(this,(function(t){switch(t.label){case 0:return[4,this._configuratorApi.getSelections(e)];case 1:return[2,t.sent()]}}))}))},e.prototype.getDecos=function(e){return void 0===e&&(e=!1),v(this,void 0,void 0,(function(){return b(this,(function(t){switch(t.label){case 0:return[4,this._configuratorApi.getDecos(e)];case 1:return[2,t.sent()]}}))}))},e.prototype.getQuestionAndAnswers=function(e){return void 0===e&&(e=!1),v(this,void 0,void 0,(function(){return b(this,(function(t){return[2,this._configuratorApi.getQuestionAndAnswers(e)]}))}))},e.prototype.getSingleImage=function(e,t,n,i,r){return v(this,void 0,void 0,(function(){return b(this,(function(o){switch(o.label){case 0:return e?[4,this._configuratorApi.getSingleImage(e,t,n,i,r)]:[2,null];case 1:return[2,o.sent()]}}))}))},e.prototype.selectSelection=function(e,t){void 0===t&&(t=!1),this._configuratorApi.selectSelection(e,t)},e.prototype.selectAnswer=function(e,t){void 0===t&&(t=!1),this._configuratorApi.selectAnswer(e,t)},e.ɵprov=u.ɵɵdefineInjectable({factory:function(){return new e},token:e,providedIn:"root"}),e=g([u.Injectable({providedIn:"root"})],e)}(),D=function(){function e(e){var t=this;this._configuratorService=e,this.selectionsReceived=new h.BehaviorSubject([]),this.answersReceived=new h.BehaviorSubject([]),this.questionReceived=new h.BehaviorSubject(void 0),this._selections=[],this._decos=[],this._placedAdjustables=[],this._placedAddables=[],this._adjustables=[],this._addables=[],this._articleCache=new Map,this._subs=[],this._boFactory=new i.BusinessObjectFactory,this._threedUtils=new x,this._variationHelper=new N,this._subs.push(this._configuratorService.selectionsReceived.subscribe((function(e){return t.selectionsReceived.next(e)})),this._configuratorService.answersReceived.subscribe((function(e){return t.answersReceived.next(e)})),this._configuratorService.questionReceived.subscribe((function(e){return t.questionReceived.next(e)})))}return e.prototype.init=function(e,t){if(!e)throw"No scene object provided!";if(!t)throw"No connection options provided!";this._configuratorService||(this._configuratorService=new M),this._configuratorService.initApi(t),this._scene=e},e.prototype.buildModel=function(e,t,n){return v(this,void 0,void 0,(function(){var i;return b(this,(function(r){switch(r.label){case 0:if(!this._scene&&!e)return[2];r.label=1;case 1:return r.trys.push([1,7,,8]),[4,this._prepareConfiguration(t,n)];case 2:return r.sent(),this._source?[4,this._configuratorService.setInstanceToConfigure(e)]:[3,5];case 3:return r.sent(),(i=[]).push(this._getSelections(e)),i.push(this._getDecos()),[4,Promise.all(i)];case 4:return r.sent(),this._linkSelectionsAndDecos(),[2,this._build(e)];case 5:throw"GLB source not found!";case 6:return[3,8];case 7:throw r.sent();case 8:return[2]}}))}))},e.prototype.initNodeInstance=function(e){return this._configuratorService.initNodeInstance(e)},e.prototype.destroy=function(){this._threedUtils.clearCache(),this._variationHelper.clearCache()},e.prototype.selectSelection=function(e){this._configuratorService.selectSelection(e,!1)},e.prototype.getQuestionAndAnswers=function(){return v(this,void 0,void 0,(function(){return b(this,(function(e){return[2,this._configuratorService.getQuestionAndAnswers(!1)]}))}))},e.prototype.selectAnswer=function(e){this._configuratorService.selectAnswer(e,!1)},e.prototype._prepareConfiguration=function(e,t){return v(this,void 0,void 0,(function(){var n,i;return b(this,(function(r){switch(r.label){case 0:return[4,this._getArticle(e,t)];case 1:return(n=r.sent())&&n.assetUrl?(i=this,[4,this._threedUtils.download3DSource(n.assetUrl).catch((function(e){throw e}))]):[3,3];case 2:i._source=r.sent(),n.contentDeliveryUrl&&(this._variationHelper.assetPath=n.contentDeliveryUrl+(n.contentDeliveryUrl.endsWith("/")?"":"/")+(n.distSchema?n.distSchema:"UP_DBA")),r.label=3;case 3:return[2]}}))}))},e.prototype._build=function(e){return v(this,void 0,void 0,(function(){var n,i,r,o,a,s,c,l;return b(this,(function(u){switch(u.label){case 0:if(this._reset(),!((n=this._getAdjustables())&&n.length>0))return[3,2];for((i=new t.Object3D).visible=!1,this._scene.add(i),r=!1,o=0,a=n.length;o<a;o++){if(s=this._createAdjustable(i,n[o]))for(c=0,l=this._placedAdjustables.length;c<l;c++){if(j.TrySelectorConnection(this._scene,i,this._placedAdjustables[c],s)){this._placedAdjustables[c].visible=!0,s.visible=!0,r=!0;break}r=!1}!r&&this._placedAdjustables.length>1&&console.warn("No connection found for: ",s.name)}return this._placeAddables(i),this._updatePivot(i),[4,this._loadVariations(i,e)];case 1:return u.sent(),this._scene.remove(i),[2,i];case 2:throw"No adjustables found!"}}))}))},e.prototype._prepareTheSelections=function(){for(var e,t,n,i=this,r=this._selections.filter((function(e){return e.generic&&e.decoNode.variation&&!e.decoNode.type})).map((function(e,t,n){var r=i._selections.find((function(t){return t.artNodeIdDeco===e.decoNode.variation.id}));return r&&(e.decoNode.variation.supplierArticleNr=r.supplierArticleNr),e.decoNode.variation.materialId=e.hdecoGameObject,e.decoNode.variation})),a=!0,c=this._selections.length,l=!1,u=-1,d=0;d<c;d++){var h=this._selections[d];1===h.presentationLevel&&(n=h.hdecoPositioning),h.presentationLevel>u&&(h.hdecoPositioning=h.hdecoPositioning||n),h.decoNode&&(h.decoNode.type===o.DecoNodeType.Variation?e?(l?e.variations=[h.decoNode]:e.variations.push(h.decoNode),l=!1):(a&&(r.length=0,a=!1),r.push(h.decoNode)):h.decoNode.type===o.DecoNodeType.Part&&"string"==typeof h.decoNode.gameObjectName&&h.decoNode.gameObjectName.length&&(h.decoNode.kind===s.DecoNodeKind.Adjustable?(h.variations=r,this._adjustables.push(h),e&&e.nodeId===h.nodeId||(l=!0),e=h,t=h):h.decoNode.kind===s.DecoNodeKind.Addable&&(h.variations=t?t.variations:r,t&&t.addables.push(h),this._addables.push(h),e&&e.nodeId===h.nodeId||(l=!0),e=h))),u=h.presentationLevel}},e.prototype._createAdjustable=function(e,t){var n=this._source?this._source.getObjectByName(t.decoNode.gameObjectName):null;if(!n){var i=t.decoNode.gameObjectName.replace(/[.]/g,"");if(!(n=this._source?this._source.getObjectByName(i):null))return null}var r=n.clone();return r.name=this._createUniqueName(e,n),r.userData.selection=t,r.position.set(0,0,0),r.visible=!0,e.add(r),this._placedAdjustables.push(r),r},e.prototype._createAddable=function(e,t,n,i){var r=this._source.getObjectByName(t.decoNode.gameObjectName);if(!r)return null;var o=r.clone();return o.name=this._createUniqueName(e,r),o.userData.selection=t,o.position.set(0,0,0),o.visible=!0,i&&n?(e.add(o),this._placedAddables.push(o),o):o},e.prototype._placeAddables=function(e){for(var t=this,n=this._placedAdjustables.length,i=0;i<n;i++)if(this._placedAdjustables[i].userData.hasOwnProperty("selection")&&this._placedAdjustables[i].userData.selection){var r=this._placedAdjustables[i].userData.selection;if(r)for(var o=r.addables.length,a=void 0,s=0;s<o;s++)j.TrySelectorConnection(this._scene,e,this._placedAdjustables[i],r.addables[s],(function(n,i,r){return t._createAddable(e,n,i,r)})),a&&j.TrySelectorConnection(this._scene,e,a,r.addables[s],(function(n,i,r){return t._createAddable(e,n,i,r)})),a=this._placedAddables[this._placedAddables.length-1]}},e.prototype._createUniqueName=function(e,t){for(var n=0,i=t.name,r=e.getObjectByName(i);r;)n++,i=t.name+(0!==n?"_"+n:""),r=e.getObjectByName(i);return i},e.prototype._getGoodIdFromSku=function(e){return v(this,void 0,void 0,(function(){var t;return b(this,(function(n){switch(n.label){case 0:return[4,this._configuratorService.getGoodIdFromSku(e,!1)];case 1:return(t=n.sent()).validationResult.success&&t.resultObject?[2,t.resultObject]:[2]}}))}))},e.prototype._getArticle=function(e,t){return v(this,void 0,void 0,(function(){var n,i,r;return b(this,(function(o){switch(o.label){case 0:return this._articleCache.has(e)?[2,this._articleCache.get(e)]:t?[3,2]:[4,this._getGoodIdFromSku(e).catch((function(t){throw"Article with sku "+e+" not found!"}))];case 1:t=o.sent(),o.label=2;case 2:return[4,this._configuratorService.getArticleQuickSel(t,!1)];case 3:return(i=o.sent()).validationResult.success&&i.resultObject&&(i.resultObject.hasOwnProperty("oArticle")?(r=Array.isArray(i.resultObject.oArticle)?i.resultObject.oArticle[0]:i.resultObject.oArticle,n=this._boFactory.makeWithRawBackendData(l.Article,r)):n=this._boFactory.makeWithRawBackendData(l.Article,i.resultObject)),this._articleCache.set(e,n),[2,n]}}))}))},e.prototype._getSelections=function(e){return v(this,void 0,void 0,(function(){var t;return b(this,(function(n){switch(n.label){case 0:return this._selections.length=0,[4,this._configuratorService.getSelections(!1)];case 1:if(!((t=n.sent()).resultObjects&&t.resultObjects.length>0))throw"No selections found!";return this._selections=this._boFactory.makeBOArrayFromRawBackendDataArray(r.Selection,t.resultObjects),this._selections.forEach((function(t){return t.instanceId=e})),[2]}}))}))},e.prototype._getDecos=function(){return v(this,void 0,void 0,(function(){var e;return b(this,(function(t){switch(t.label){case 0:return this._decos.length=0,[4,this._configuratorService.getDecos(!1)];case 1:if(!((e=t.sent()).resultObjects&&e.resultObjects.length>0))throw"No deconodes found!";return this._decos=this._boFactory.makeBOArrayFromRawBackendDataArray(n.DecoNode,e.resultObjects),[2]}}))}))},e.prototype._linkSelectionsAndDecos=function(){for(var e=this,t=this._selections.length,i=function(t){var i=r._selections[t].artNodeIdDeco,o=r._decos.find((function(e){return e.id===i}));o||(o=new n.DecoNode);var a=r._getVariations().find((function(n){return n.parentId===e._selections[t].artNodeIdDeco}));a&&(o.variation=a),r._selections[t].decoNode=o},r=this,o=0;o<t;o++)i(o)},e.prototype._getVariations=function(){return this._decos.filter((function(e){return e.type===o.DecoNodeType.Variation}))},e.prototype._loadVariations=function(e,t){return v(this,void 0,void 0,(function(){return b(this,(function(n){switch(n.label){case 0:return[4,this._variationHelper.loadPart(e,this._adjustables,!0)];case 1:return n.sent(),[4,this._variationHelper.loadVariation(t,e,this._adjustables,!0)];case 2:return n.sent(),[4,this._variationHelper.loadVariation(t,e,this._addables,!0)];case 3:return n.sent(),[2]}}))}))},e.prototype._getAdjustables=function(){return this._selections.filter((function(e){var t=e.decoNode;return t&&t.gameObjectName&&t.type===o.DecoNodeType.Part&&t.kind===s.DecoNodeKind.Adjustable}))},e.prototype._updatePivot=function(e){var n=(new t.Box3).setFromObject(e),i=new t.Vector3;n.getCenter(i);var r=(new t.Vector3).sub(i).setY(Math.abs(Math.min(n.min.y,0)));e.children.forEach((function(e){e.position.add(r)})),e.updateWorldMatrix(!1,!0)},e.prototype._reset=function(){this._placedAddables.length=0,this._placedAdjustables.length=0,this._adjustables.length=0,this._addables.length=0,this._prepareTheSelections()},e.ctorParameters=function(){return[{type:M}]},e=g([u.Injectable()],e)}(),V=function(){function e(){this.answers=[],this.answerClick=new u.EventEmitter}return g([u.Input()],e.prototype,"answers",void 0),g([u.Input()],e.prototype,"selectionTitle",void 0),g([u.Output()],e.prototype,"answerClick",void 0),e=g([u.Component({selector:"answers",template:'\n <ng-container>\n <div class="answers-container" visibilityObserverMaster>\n <h2 class="answers-title" [textContent]="selectionTitle"></h2>\n <answer *ngFor="let answer of answers"\n (click)="answerClick.emit(answer)"\n [answer]="answer"\n visibilityObserver\n #intersection="intersection"\n [observerEnabled]="true"\n [showing]="intersection.isIntersecting"\n ></answer>\n </div>\n </ng-container>\n ',styles:[":host{position:absolute;top:0;right:0;width:400px;height:-webkit-fit-content;height:-moz-fit-content;height:fit-content}:host .answers-title{margin-left:10px;color:#1a1a1a}:host .answers-container{height:100vh;overflow-y:scroll}",".selection{position:relative;overflow:hidden;cursor:pointer;font-size:12px;border:1px solid #d3d3d3;padding:10px;display:flex;flex-direction:row;border-radius:3px;margin-bottom:3px;box-shadow:2px 1px rgba(211,211,211,.5);background:#fff}.thumbnail{width:54px;min-width:54px;height:54px;min-height:54px;border:1px solid #d3d3d3;border-radius:5px}.img-size{width:54px;min-width:54px;height:54px;min-height:54px;border-radius:5px}.unloaded{background-color:#d3d3d3}.titles{margin-left:14px;-ms-grid-row-align:center;align-self:center}"]})],e)}(),P=function(){function e(e){this._configuratorService=e,this._imageCache=new Map}var t;return t=e,e._handleResponseData=function(e,t,n){return n&&n.resultObject?null!==n.resultObject.filePath&&""!==n.resultObject.filePath?C.getFixedImageFilepathUrl(n.resultObject.filePath):e?C.getDocBodyWithMimeTypeDefinition(n.resultObject.fileName,t?n.resultObject.thumbnailBody:n.resultObject.documentBody):t?n.resultObject.thumbnailBody:n.resultObject.documentBody:""},e.prototype.getImageForSelectionOrAnswer=function(e){var n=this;return new Promise((function(i,r){if(e&&e.nodeId){if(!n._imageCache.has(e.nodeId))return n._configuratorService.getSingleImage(e.nodeId,4,!0,!0,!0).then((function(r){var o=t._handleResponseData(!0,!0,r);n._imageCache.set(e.nodeId,o),i(o)}));i(n._imageCache.get(e.nodeId))}else r()}))},e.ctorParameters=function(){return[{type:M}]},e.ɵprov=u.ɵɵdefineInjectable({factory:function(){return new e(u.ɵɵinject(M))},token:e,providedIn:"root"}),e=t=g([u.Injectable({providedIn:"root"})],e)}(),k=function(){function e(e){this._imageCacheService=e,this.thumbnailLoaded=!1}return Object.defineProperty(e.prototype,"showing",{set:function(e){e&&this._loadThumbnail(this.answer)},enumerable:!0,configurable:!0}),e.prototype.ngOnInit=function(){},e.prototype._loadThumbnail=function(e){var t=this;this._imageCacheService.getImageForSelectionOrAnswer(e).then((function(n){e.imageData=n,t.thumbnailLoaded=!0}))},e.ctorParameters=function(){return[{type:P}]},g([u.Input()],e.prototype,"answer",void 0),g([u.Input()],e.prototype,"showing",null),e=g([u.Component({selector:"answer",template:'\n <ng-container>\n <div class="selection" @answerAppear>\n <div class="thumbnail">\n <rp-loader *ngIf="!thumbnailLoaded"></rp-loader>\n <img *ngIf="answer.imageData" class="img-size" [src]="answer.imageData">\n </div>\n <div class="titles">\n <div class="answer" [textContent]="answer.commercialAnswer"></div>\n </div>\n </div>\n </ng-container>\n ',animations:[f.trigger("answerAppear",[f.state("void",f.style({background:"#dbdbdb"})),f.state("white",f.style({background:"white"})),f.transition("void <=> *",f.animate(500))])],styles:[".answer{font-size:12px;position:relative;overflow:hidden;cursor:pointer}",".selection{position:relative;overflow:hidden;cursor:pointer;font-size:12px;border:1px solid #d3d3d3;padding:10px;display:flex;flex-direction:row;border-radius:3px;margin-bottom:3px;box-shadow:2px 1px rgba(211,211,211,.5);background:#fff}.thumbnail{width:54px;min-width:54px;height:54px;min-height:54px;border:1px solid #d3d3d3;border-radius:5px}.img-size{width:54px;min-width:54px;height:54px;min-height:54px;border-radius:5px}.unloaded{background-color:#d3d3d3}.titles{margin-left:14px;-ms-grid-row-align:center;align-self:center}"]})],e)}(),T=function(){function e(){var e=this;this._mapping=new Map,this._observer=new IntersectionObserver((function(t){var n,i;try{for(var r=w(t),o=r.next();!o.done;o=r.next()){var a=o.value,s=e._mapping.get(a.target);s&&s(a.isIntersecting)}}catch(e){n={error:e}}finally{try{o&&!o.done&&(i=r.return)&&i.call(r)}finally{if(n)throw n.error}}}),{rootMargin:"300px 0px 300px 0px"})}return e.prototype.ngOnDestroy=function(){this._mapping.clear(),this._observer.disconnect()},e.prototype.add=function(e,t){this._mapping.set(e,t),this._observer.observe(e)},e.prototype.remove=function(e){this._mapping.delete(e),this._observer.unobserve(e)},e=g([u.Directive({selector:"[visibilityObserverMaster]"})],e)}(),B=function(){function e(e,t){this.observerEnabled=!1,this.IS_INTERSECTING=!0,this.IS_NOT_INTERSECTING=!1,this._parent=e,this._elementRef=t,this.isIntersecting=!1}return e.prototype.ngOnDestroy=function(){this._parent.remove(this._elementRef.nativeElement),this._elementRef=void 0},e.prototype.ngOnInit=function(){var e=this;this.observerEnabled&&this._parent.add(this._elementRef.nativeElement,(function(t){e.isIntersecting=t,e.isIntersecting&&e._parent.remove(e._elementRef.nativeElement)}))},e.ctorParameters=function(){return[{type:T},{type:u.ElementRef}]},g([u.Input()],e.prototype,"observerEnabled",void 0),e=g([u.Directive({selector:"[visibilityObserver]",exportAs:"intersection"})],e)}(),R=function(){function e(){}return e=g([u.Component({selector:"rp-loader",template:'\n <div class="loader-wrapper">\n <svg xmlns="http://www.w3.org/2000/svg" width="44" height="44" viewBox="0 0 44 44" stroke="#3760a1">\n <g fill="none" fill-rule="evenodd" stroke-width="3">\n <circle class="ripple1" cx="22" cy="22" r="19">\n </circle>\n <circle class="ripple2" cx="22" cy="22" r="19">\n </circle>\n </g>\n </svg>\n </div>\n ',styles:[":host{-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;pointer-events:none}:host .loader-wrapper{z-index:1100;position:absolute;width:54px;height:54px}:host .loader-wrapper svg{width:100%;height:100%}:host .loader-wrapper svg .ripple1{transform-origin:center;-webkit-animation:1.5s infinite ripple;animation:1.5s infinite ripple}:host .loader-wrapper svg .ripple2{transform-origin:center;-webkit-animation:1.5s .4s infinite ripple;animation:1.5s .4s infinite ripple}@-webkit-keyframes ripple{0%{transform:scale(0);opacity:1}100%{transform:scale(1);opacity:0}}@keyframes ripple{0%{transform:scale(0);opacity:1}100%{transform:scale(1);opacity:0}}"]})],e)}(),L=function(){function e(){}return e=g([u.NgModule({imports:[p.CommonModule],declarations:[R],exports:[R]})],e)}(),E=function(){function e(){}return e=g([u.NgModule({imports:[p.CommonModule,L],declarations:[V,k,B,T],exports:[V]})],e)}(),G=function(){this.children=[],this.expanded=!1,this.thumbnail=""},U=function(){function e(e){this._imageCacheService=e,this.selectionViewModels=[],this.selectionClick=new u.EventEmitter}return Object.defineProperty(e.prototype,"selections",{set:function(e){this._prepareSelections(e),this._loadThumbnails()},enumerable:!0,configurable:!0}),e.prototype.ngOnInit=function(){},e.prototype.expandClicked=function(e,t){t.preventDefault(),t.stopImmediatePropagation(),e.expanded=!e.expanded},e.prototype.selectSelection=function(e,t){t.preventDefault(),t.stopImmediatePropagation(),this.selectionClick.next(e)},e.prototype._loadThumbnails=function(){return v(this,void 0,void 0,(function(){var e=this;return b(this,(function(t){return this.selectionViewModels.length>0&&this.selectionViewModels.forEach((function(t){return v(e,void 0,void 0,(function(){return b(this,(function(e){switch(e.label){case 0:return[4,this._imageCacheService.getImageForSelectionOrAnswer(t.selection).then((function(e){t.thumbnail=e}))];case 1:return e.sent(),[2]}}))}))})),[2]}))}))},e.prototype._prepareSelections=function(e){var t,n=this;this.selectionViewModels.length=0,e.forEach((function(e){1===e.presentationLevel?((t=new G).selection=e,n.selectionViewModels.push(t)):e.presentationLevel>1&&t&&t.children.push(e)}))},e.ctorParameters=function(){return[{type:P}]},g([u.Input()],e.prototype,"selections",null),g([u.Output()],e.prototype,"selectionClick",void 0),e=g([u.Component({selector:"selections",template:'\n <ng-container>\n <div class="selections-container">\n <h2 class="selections-title">Configuratie</h2>\n <div *ngFor="let selectionViewModel of selectionViewModels">\n <div class="selection" (click)="selectSelection(selectionViewModel.selection, $event)">\n <div class="thumbnail">\n <rp-loader *ngIf="selectionViewModel.thumbnail === \'\'"></rp-loader>\n <img visibilityObserver *ngIf="selectionViewModel.thumbnail !== \'\'" class="img-size" [src]="selectionViewModel.thumbnail">\n </div>\n <div class="titles">\n <div class="question" [textContent]="selectionViewModel.selection.commercialQuestion"></div>\n <div class="answer" [textContent]="selectionViewModel.selection.answer"></div>\n <div class="collapse-handle" [class.expanded]="selectionViewModel.expanded"\n *ngIf="selectionViewModel.children.length > 0" (click)="expandClicked(selectionViewModel, $event)"></div>\n <div *ngIf="selectionViewModel.children.length > 0 && selectionViewModel.expanded" @showHideChildren>\n <div class="child-selection" *ngFor="let selection of selectionViewModel.children"\n (click)="selectSelection(selection, $event)"\n >\n <div class="question" [textContent]="selection.commercialQuestion"></div>\n <div class="answer" [textContent]="selection.answer"></div>\n </div>\n </div>\n </div>\n </div>\n </div>\n </div>\n </ng-container>\n ',animations:[f.trigger("showHideChildren",[f.state("void",f.style({height:"0"})),f.state("*",f.style({height:"*"})),f.transition("void <=> *",f.animate(200))])],styles:[":host{position:absolute;top:0;right:0;width:400px}:host .question{font-weight:700;color:#1a1a1a}:host .answer{font-size:12px;font-style:italic;margin-top:3px}:host .collapse-handle{position:absolute;top:10px;right:12px;border:solid #000;border-width:0 3px 3px 0;display:inline-block;padding:3px;transform:rotate(45deg);-webkit-transform:rotate(45deg)}:host .collapse-handle.expanded{transform:rotate(-135deg);-webkit-transform:rotate(-135deg)}:host .child-selection{margin-left:10px;margin-top:5px}:host .selections-title{margin-left:10px;color:#1a1a1a}:host .selections-container{height:-webkit-fit-content;height:-moz-fit-content;height:fit-content;background:0 0;overflow:auto}",".selection{position:relative;overflow:hidden;cursor:pointer;font-size:12px;border:1px solid #d3d3d3;padding:10px;display:flex;flex-direction:row;border-radius:3px;margin-bottom:3px;box-shadow:2px 1px rgba(211,211,211,.5);background:#fff}.thumbnail{width:54px;min-width:54px;height:54px;min-height:54px;border:1px solid #d3d3d3;border-radius:5px}.img-size{width:54px;min-width:54px;height:54px;min-height:54px;border-radius:5px}.unloaded{background-color:#d3d3d3}.titles{margin-left:14px;-ms-grid-row-align:center;align-self:center}"]})],e)}(),W=function(){function e(){}return e=g([u.NgModule({imports:[p.CommonModule,L],declarations:[U],exports:[U]})],e)}();e.AnswersComponent=V,e.AnswersModule=E,e.Builder=D,e.SelectionsComponent=U,e.SelectionsModule=W,e.ɵa=M,e.ɵb=L,e.ɵc=R,e.ɵd=k,e.ɵe=P,e.ɵf=B,e.ɵg=T,Object.defineProperty(e,"__esModule",{value:!0})}));
|
|
16
|
+
var v=function(e,t){return(v=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(e,t)};function x(e,t,n,i){var r,o=arguments.length,a=o<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,n,i);else for(var s=e.length-1;s>=0;s--)(r=e[s])&&(a=(o<3?r(a):o>3?r(t,n,a):r(t,n))||a);return o>3&&a&&Object.defineProperty(t,n,a),a}function y(e,t,n,i){return new(n||(n=Promise))((function(r,o){function a(e){try{c(i.next(e))}catch(e){o(e)}}function s(e){try{c(i.throw(e))}catch(e){o(e)}}function c(e){var t;e.done?r(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}c((i=i.apply(e,t||[])).next())}))}function _(e,t){var n,i,r,o,a={label:0,sent:function(){if(1&r[0])throw r[1];return r[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(o){return function(s){return function(o){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,i&&(r=2&o[0]?i.return:o[0]?i.throw||((r=i.return)&&r.call(i),0):i.next)&&!(r=r.call(i,o[1])).done)return r;switch(i=0,r&&(o=[2&o[0],r.value]),o[0]){case 0:case 1:r=o;break;case 4:return a.label++,{value:o[1],done:!1};case 5:a.label++,i=o[1],o=[0];continue;case 7:o=a.ops.pop(),a.trys.pop();continue;default:if(!(r=a.trys,(r=r.length>0&&r[r.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!r||o[1]>r[0]&&o[1]<r[3])){a.label=o[1];break}if(6===o[0]&&a.label<r[1]){a.label=r[1],r=o;break}if(r&&a.label<r[2]){a.label=r[2],a.ops.push(o);break}r[2]&&a.ops.pop(),a.trys.pop();continue}o=t.call(e,a)}catch(e){o=[6,e],i=0}finally{n=r=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,s])}}}function j(e){var t="function"==typeof Symbol&&Symbol.iterator,n=t&&e[t],i=0;if(n)return n.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&i>=e.length&&(e=void 0),{value:e&&e[i++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}var C=function(){function e(){}return e.DisposeMaterial=function(e){var t=this;e&&(Array.isArray(e)?e.forEach((function(e){t.materialProps.filter((function(t){return e[t]})).forEach((function(t){return e[t].dispose()})),e.dispose()})):(this.materialProps.filter((function(t){return e[t]&&e[t].dispose})).forEach((function(t){return e[t].dispose()})),e.dispose&&e.dispose()))},e.DisposeObject=function(e){var t=this;e&&(e.children.length&&e.children.forEach((function(e){return t.DisposeObject(e)})),this.DisposeNode(e))},e.DisposeNode=function(e){var n=this;e.traverse((function(e){e instanceof t.Mesh&&(e.geometry&&e.geometry.dispose(),n.DisposeMaterial(e.material)),"function"==typeof e.dispose&&e.dispose()}))},e.materialProps=["map","lightMap","bumpMap","normalMap","specularMap","envMap","aoMap","roughnessMap","metalnessMap"],e}(),F=function(){function e(){}return e.StripMimeStringFromDataUri=function(e){if(!e)return"";var t=this.GetMimeStringFromDataUri(e);return e.substr(t.length+1)},e.GetMimeStringFromDataUri=function(e){return e?e.split(",")[0]:""},e.FileExists=function(e,t){return y(this,void 0,void 0,(function(){return _(this,(function(n){switch(n.label){case 0:return[4,s({method:"get",url:t+"getFiles.php?assetUrl="+e,responseType:"json"})];case 1:return[2,!!n.sent().data]}}))}))},e.FixUrl=function(t){if(!t)return"";var n=t;return n.endsWith("glb")||n.endsWith("obj")||n.endsWith("glb.gz")||n.endsWith("obj.gz")||(n=e.FixUnityUrl(n)),n=n.replace("/content/","/content43/")},e.FixGlbUrl=function(e){if(!e)return"";var t=e;return-1===e.indexOf("_webplayer")&&(t=e.concat("_webplayer")),(t=t.replace("/content/","/content43/")).endsWith(".glb")||(t=t.concat(".glb")),t},e.MimeTypeFromFilename=function(e){switch(/(?:\.([^.]+))?$/.exec(e)[1]){case"jpg":case"jpeg":return"image/jpeg";case"png":return"image/png";case"bmp":return"image/bmp"}},e.DownloadFile=function(e,t,n){void 0===n&&(n="text/plain");var i=document.createElement("a");i.setAttribute("href","data:"+n+";charset=utf-8,"+encodeURIComponent(t)),i.setAttribute("download",e),i.style.display="none",document.body.appendChild(i),i.click(),document.body.removeChild(i)},e.ReadAsText=function(e){return new Promise((function(t){var n=new FileReader;n.readAsText(e),n.onloadend=function(e){2===e.target.readyState&&t(e.target.result)}}))},e.GetExtensionFromDataUri=function(e){return e.replace(/(data:image\/)(.*?)(;base64.*)/gi,"$2")},e.CreateDownloadFileNameFromBase64=function(e){return"preview."+this.GetExtensionFromDataUri(e)},e.DownloadFromDataUri=function(e,t){var n=document.createElement("a");n.download=t,n.href=e,document.body.appendChild(n),n.click(),document.body.removeChild(n)},e.DocumentBodyToDataUri=function(e,t){return e?"data:"+t+";base64,"+e:""},e.FixUnityUrl=function(e){return(e=-1===e.indexOf("_webplayer")?e.concat("_webplayer.ione3d"):e.replace("_webplayer","_webplayer.ione3d")).endsWith(".gz")||(e=e.concat(".gz")),e.replace(".unity3d","")},e._cachedTextureUploads=new Map,e}(),O=function(){function e(){this._objectCache=new Map}return e.prototype.clearCache=function(){Array.from(this._objectCache.values()).forEach((function(e){return C.DisposeObject(e)})),this._objectCache.clear()},e.prototype.download3DSource=function(e){var t=this;return new Promise((function(n,i){return y(t,void 0,void 0,(function(){var t,r=this;return _(this,(function(o){switch(o.label){case 0:return e=e.replace(".unity3d",""),t=e+(e.indexOf(".glb")<0?".glb":""),this._objectCache.has(t)?(n(this._objectCache.get(t)),[2]):[4,F.FileExists(t,"https://cdn1.colijn-it.nl/content43/")];case 1:return o.sent()?this.loadGlbSource(t).then((function(e){r._objectCache.set(t,e),n(e)})):i("GLB source not found! ("+t+")"),[2]}}))}))}))},e.prototype.readFileAsText=function(e){var t=new FileReader;return new Promise((function(n,i){t.onload=function(e){return n(e.target.result)},t.onerror=function(e){return i(e)},t.readAsText(e)}))},e.prototype.loadJsonModel=function(e){return y(this,void 0,void 0,(function(){var n,i,r=this;return _(this,(function(o){switch(o.label){case 0:return this._objectCache.has(e)?[2,Promise.resolve(this._objectCache.get(e))]:[4,this._readJsonFile(e)];case 1:return n=o.sent(),(i=new t.ObjectLoader).crossOrigin="Anonymous",[2,new Promise((function(t,o){try{var a=i.parse(n);r._objectCache.set(e,a),t(a)}catch(e){o(null)}}))]}}))}))},e.prototype.loadJsonObjectModel=function(e){return y(this,void 0,void 0,(function(){var n,i=this;return _(this,(function(r){return this._objectCache.has(e)?[2,Promise.resolve(this._objectCache.get(e))]:((n=new t.ObjectLoader).setCrossOrigin("Anonymous"),n.setResourcePath(""),[2,new Promise((function(t,r){n.load(e,(function(n){var r="Scene"===n.type&&"Object3D"===n.children[0].type?n.children[0]:n;i._objectCache.set(e,r),t(r)}),(function(e){return null}),(function(e){return r(e)}))}))])}))}))},e.prototype.loadGlbModel=function(e,t){return void 0===t&&(t=!0),y(this,void 0,void 0,(function(){var n;return _(this,(function(i){switch(i.label){case 0:return this._objectCache.has(e)?[2,Promise.resolve(this._objectCache.get(e))]:window.hasOwnProperty("loadGLTF")?[4,window.loadGLTF(e)]:(console.error("loadGLTF not defined in window global"),[2,null]);case 1:return(n=i.sent())?(this._cleanedUpObjects(n,t),this._objectCache.set(e,n),[2,n]):[2,null]}}))}))},e.prototype.loadGlbSource=function(e){return y(this,void 0,void 0,(function(){var n,i;return _(this,(function(r){switch(r.label){case 0:return[4,this.loadGlbModel(e,!1)];case 1:return(n=r.sent())&&(n.children=n.children.filter((function(e){return!(e instanceof t.Camera)})),n.children.sort((function(e,t){return e.name<t.name?1:-1})),n.children.forEach((function(e){e.traverse((function(e){e.visible=!e.name.toLowerCase().startsWith("c_")})),e.visible=!1})),1===n.children.length&&n.children[0]instanceof t.Group&&(i=n.children[0].children.slice(),n.children.length=0,n.children=i)),[2,n]}}))}))},e.prototype.textureFromUrl=function(e){return y(this,void 0,void 0,(function(){return _(this,(function(n){return[2,new Promise((function(n,i){(new t.TextureLoader).load(e,(function(e){return e.wrapT=t.RepeatWrapping,e.wrapS=t.RepeatWrapping,e.repeat.set(1,1),e.needsUpdate=!0,n(e)}),null,i)}))]}))}))},e.prototype._cleanedUpObjects=function(e,n){var i=this;void 0===n&&(n=!0);var r=new t.Object3D;e.children.forEach((function(e){e instanceof t.Camera||(n&&e instanceof t.Group||1===e.children.length&&e.children[0]instanceof t.Group?i._addGroupChildrenToObject(e,r):n&&!(e instanceof t.Mesh)||!(e instanceof t.Mesh)&&!e.name&&e.children.length>0?(e.children.forEach((function(t){t.translateY(e.position.y)})),e.translateY(-e.position.y),r.children.length>0?r.add(e.clone()):r=e.clone()):r.add(e.clone()))}));var o=(new t.Box3).setFromObject(r),a=new t.Vector3;o.getCenter(a);var s=(new t.Vector3).add(a).negate();return r.children.forEach((function(e){e.position.add(s)})),r},e.prototype._addGroupChildrenToObject=function(e,n,i){var r=this;void 0===i&&(i=!0),e.children.forEach((function(o){i&&o instanceof t.Group?r._addGroupChildrenToObject(o,n):(o.translateY(e.position.y),n.add(o.clone()))}))},e.prototype._iterateChildren=function(e,n){for(var i=0;i<e.length;i++){var r=e[i];r instanceof t.Mesh?n(r):this._iterateChildren(r.children,n)}},e.prototype._readJsonFile=function(e){return y(this,void 0,void 0,(function(){var t,n;return _(this,(function(i){switch(i.label){case 0:return i.trys.push([0,5,,6]),[4,fetch(e)];case 1:return(t=i.sent()).ok?[3,2]:[2,""];case 2:return n=!1,[4,t.clone().text().then((function(e){""===e&&(n=!0)}))];case 3:return i.sent(),[2,n?{}:t.json()];case 4:return[3,6];case 5:return i.sent(),[2,""];case 6:return[2]}}))}))},e}(),I=function(){function e(){}return e.TrySelectorConnection=function(e,t,n,i,r){var o;r&&(i=r(o=i));for(var a=0;a<n.children.length;a++)for(var s=0;s<i.children.length;s++){var c=n.children[a],l=i.children[s];if(!c.connected&&!l.connected&&this.CanSelectorConnect(c,l)){if(!o)return this.SelectorConnect(e,t,c,l);var u=r(o,i,n);this.SelectorConnect(e,t,c,u.children[s])}}return!1},e.Convert3DPointToScreenPoint=function(e,n,i,r){if(!e)return new t.Vector2;var o=e.clone().project(n);return o.x=(o.x+1)/2*i,o.y=-(o.y-1)/2*r,new t.Vector2(o.x,o.y)},e.CanSelectorConnect=function(e,n){var i=e instanceof t.Object3D?e.name:e.connector,r=n instanceof t.Object3D?n.name:n.connector,o=e instanceof t.Object3D&&n instanceof t.Object3D&&e.parent===n.parent,a=i.toUpperCase().split("_"),s=r.toUpperCase().split("_");return a.length>=3&&s.length>=3&&!o&&("C"===a[0]&&"C"===s[0]&&a[1]===s[1]&&a[2]!==s[2])},e.SelectorConnect=function(e,n,i,r){if(!e||!n)return!1;i.connectedTo=r.parent.name,r.connectedTo=i.parent.name;var o=new t.Euler(0,0,0),a=new t.Vector3(0,0,0);e.updateMatrixWorld(!0),o.copy(n.rotation),n.getWorldPosition(a),n.rotation.set(0,0,0),n.position.set(0,0,0);var s=new t.Quaternion;i.getWorldQuaternion(s);var c=new t.Quaternion;r.getWorldQuaternion(c);var l=new t.Quaternion;i.parent.getWorldQuaternion(l);var u=new t.Quaternion;r.parent.getWorldQuaternion(u);var d=(new t.Quaternion).multiplyQuaternions(s.invert(),c).multiply((new t.Quaternion).multiplyQuaternions(l,l));r.parent.quaternion.copy(d),e.updateMatrixWorld(!0);var p=new t.Vector3;i.getWorldPosition(p);var h=new t.Vector3;r.getWorldPosition(h);var f=p.sub(h);return r.parent.position.x+=f.x,r.parent.position.y+=f.y,r.parent.position.z+=f.z,n.rotation.copy(o),n.position.copy(a),e.updateMatrixWorld(!0),i.connected=!0,r.connected=!0,!0},e}(),N=function(){this.specular=new t.Color(.3,.3,.3),this.shininess=0,this.repeatX=4,this.repeatY=4,this.loaded=!1},A=function(){function e(){}return e.CreateTextureFromBase64=function(n,i,r){return new Promise((function(o){e.textures.has(n)?o(e.textures.get(n)):i?(new t.TextureLoader).load(i,(function(i){i.anisotropy=16,i.wrapS=t.RepeatWrapping,i.wrapT=t.RepeatWrapping,i.repeat=new t.Vector2(r?r.repeatX:1,r?r.repeatY:1),i.needsUpdate=!0,e.textures.set(n,i),o(i)})):o(new t.Texture)}))},e.getDocBodyWithMimeTypeDefinition=function(e,t){if(null===t)return t;switch(e.substr(e.lastIndexOf(".")+1).toLowerCase()){case"jpg":case"jpeg":return"data:image/jpg;base64,"+t;case"png":return"data:image/png;base64,"+t;case"gif":return"data:image/gif;base64,"+t;case"bmp":return"data:image/bmp;base64,"+t;default:return"data:image/png;base64,"+t}},e.getFixedImageFilepathUrl=function(e){return e.replace("/content/","/content43/")},e.textures=new Map,e}(),M=(function(e){function t(){return null!==e&&e.apply(this,arguments)||this}(function(e,t){function n(){this.constructor=e}v(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)})(t,e)}(N),function(){function e(){}return e.CreateMaterialFromAsset=function(n){return y(this,void 0,void 0,(function(){var i,r,o,a,s,c;return _(this,(function(l){switch(l.label){case 0:return i=new N,n?(n.settings&&e.setSettingsOfMaterial(i,n.settings),n.texture?(r=i,[4,A.CreateTextureFromBase64(n.id+"_texture",n.texture,i)]):[3,2]):[2,i];case 1:r.texture=l.sent(),i.texture.encoding=t.sRGBEncoding,i.textureFilename=n.textureFilename,l.label=2;case 2:return n.normal?(o=i,[4,A.CreateTextureFromBase64(n.id+"_normal",n.normal,i)]):[3,4];case 3:o.normal=l.sent(),i.normalFilename=n.normalFilename,l.label=4;case 4:return n.ao?(a=i,[4,A.CreateTextureFromBase64(n.id+"_ao",n.ao,i)]):[3,6];case 5:a.ao=l.sent(),i.aoFilename=n.aoFilename,l.label=6;case 6:return n.metalness?(s=i,[4,A.CreateTextureFromBase64(n.id+"_metalness",n.metalness,i)]):[3,8];case 7:s.metalness=l.sent(),i.metalnessFilename=n.metalnessFilename,l.label=8;case 8:return n.roughness?(c=i,[4,A.CreateTextureFromBase64(n.id+"_roughness",n.roughness,i)]):[3,10];case 9:c.roughness=l.sent(),i.roughnessFilename=n.roughnessFilename,l.label=10;case 10:return[2,i]}}))}))},e.setSettingsOfMaterial=function(e,n){var i=parseFloat(n.power);isNaN(i)||(e.shininess=i);var r=parseFloat(n.level);isNaN(r)||(e.specular=new t.Color(r,r,r));var o=n.hasOwnProperty("repeat"),a=o?parseFloat(n.repeat.repeatx):parseFloat(n.repeatx);isNaN(a)||(e.repeatX=Math.max(1,a));var s=o?parseFloat(n.repeat.repeaty):parseFloat(n.repeaty);isNaN(s)||(e.repeatY=Math.max(1,s));var c=parseFloat(n.metalness);isNaN(c)||(e.metalnessValue=Math.min(1,c));var l=parseFloat(n.roughness);isNaN(l)||(e.roughnessValue=Math.min(1,l))},e}()),S=function(){},k=function(){this.settings={}},D=function(){function e(){}return e.LoadVariation=function(t,n){return y(this,void 0,void 0,(function(){var i,r,o;return _(this,(function(a){switch(a.label){case 0:if(!n)return[2,null];n.indexOf("ione3d")<0&&(n=n.concat(".ione3d")),i=n.substr(0,n.lastIndexOf(".ione3d")),a.label=1;case 1:return a.trys.push([1,4,,5]),t.endsWith("/")||(t+="/"),window.hasOwnProperty("downloadVariation")?[4,window.downloadVariation(t.replace("https://cdn1.colijn-it.nl/","")+"variation/"+n)]:(console.error("downloadVariation not defined in window global"),[2,null]);case 2:return r=a.sent(),[4,e.GetVariationSettingsFromFile(i,r)];case 3:return[2,a.sent()];case 4:return o=a.sent(),o,[2,null];case 5:return[2]}}))}))},e.GetVariationSettingsFromFile=function(t,n){return y(this,void 0,void 0,(function(){var i,r,o,a;return _(this,(function(s){switch(s.label){case 0:return n?[4,e.GetZipContent(n)]:[2,null];case 1:return i=s.sent(),(r=new k).id=t,i.files["index.json"]?[4,i.files["index.json"].async("string")]:[3,3];case 2:a=s.sent(),o=JSON.parse(a),s.label=3;case 3:return o?[4,e.CreateSettingsBasedOnIndex(o,r,i)]:[3,5];case 4:return s.sent(),[3,7];case 5:return[4,e.CreateSettingsBasedOnFileName(r,i)];case 6:s.sent(),s.label=7;case 7:return[2,r]}}))}))},e.CreateSettingsBasedOnIndex=function(t,n,i){return y(this,void 0,void 0,(function(){var r,o,a,s,c,l;return _(this,(function(u){switch(u.label){case 0:return t.normalFile?(r=n,[4,e.LoadFileContentFromZip(i.files[t.normalFile],t.normalFile)]):[3,2];case 1:r.normal=u.sent(),n.normalFilename=t.normalFile,u.label=2;case 2:return t.aoFile?(o=n,[4,e.LoadFileContentFromZip(i.files[t.aoFile],t.aoFile)]):[3,4];case 3:o.ao=u.sent(),n.aoFilename=t.aoFile,u.label=4;case 4:return t.metalnessFile?(a=n,[4,e.LoadFileContentFromZip(i.files[t.metalnessFile],t.metalnessFile)]):[3,6];case 5:a.metalness=u.sent(),n.metalnessFilename=t.metalnessFile,u.label=6;case 6:return t.roughnessFile?(s=n,[4,e.LoadFileContentFromZip(i.files[t.roughnessFile],t.roughnessFile)]):[3,8];case 7:s.roughness=u.sent(),n.roughnessFilename=t.roughnessFile,u.label=8;case 8:return t.diffuseFile?(c=n,[4,e.LoadFileContentFromZip(i.files[t.diffuseFile],t.diffuseFile)]):[3,10];case 9:c.texture=u.sent(),n.textureFilename=t.diffuseFile,u.label=10;case 10:return l=n,[4,e.LoadFileContentFromZip(i.files["repeat.json"],"repeat.json",!1)];case 11:return l.settings=u.sent()||{},Object.assign(n.settings,t.repeat),n.settings.metalness=t.metalness,n.settings.roughness=t.roughness,[2]}}))}))},e.CreateSettingsBasedOnFileName=function(e,t){return y(this,void 0,void 0,(function(){var n,i,r,o,a,s,c,l=this;return _(this,(function(u){switch(u.label){case 0:for(a in n=[],i=function(i){var o;return _(this,(function(a){switch(a.label){case 0:return t.files[i]?[4,t.files[i]]:[3,2];case 1:(o=a.sent()).name.toLowerCase().indexOf("normal")>-1&&r.FileIsImage(o.name)?n.push(t.files[i].async("base64").then((function(t){e.normal="data:image/"+l.GetBase64FileType(o.name)+";base64,"+t,e.normalFilename=i}))):o.name.toLowerCase().indexOf("ao")>-1&&r.FileIsImage(o.name)?n.push(t.files[i].async("base64").then((function(t){e.ao="data:image/"+l.GetBase64FileType(o.name)+";base64,"+t,e.aoFilename=i}))):o.name.toLowerCase().indexOf("metalness")>-1&&r.FileIsImage(o.name)?n.push(t.files[i].async("base64").then((function(t){e.metalness="data:image/"+l.GetBase64FileType(o.name)+";base64,"+t,e.metalnessFilename=i}))):o.name.toLowerCase().indexOf("roughness")>-1&&r.FileIsImage(o.name)?n.push(t.files[i].async("base64").then((function(t){e.roughness="data:image/"+l.GetBase64FileType(o.name)+";base64,"+t,e.roughnessFilename=i}))):o.name.toLowerCase().indexOf("diffuse")>-1&&r.FileIsImage(o.name)?n.push(t.files[i].async("base64").then((function(t){e.texture="data:image/"+l.GetBase64FileType(o.name)+";base64,"+t,e.textureFilename=i}))):o.name.indexOf(".jp")>-1?n.push(t.files[i].async("base64").then((function(t){e.texture="data:image/jpeg;base64,"+t,e.textureFilename=i}))):o.name.indexOf(".json")>-1&&n.push(t.files[i].async("string").then((function(t){var n=JSON.parse(t);for(var i in n)n[i]&&(e.settings[i]=n[i])}))),a.label=2;case 2:return[2]}}))},r=this,o=[],t.files)o.push(a);s=0,u.label=1;case 1:return s<o.length?(c=o[s],[5,i(c)]):[3,4];case 2:u.sent(),u.label=3;case 3:return s++,[3,1];case 4:return[4,Promise.all(n)];case 5:return u.sent(),[2]}}))}))},e.LoadFileContentFromZip=function(e,t,n){var i=this;return void 0===n&&(n=!0),new Promise((function(r){e&&t?e.async(n?"base64":"string").then((function(e){r(n?"data:image/"+i.GetBase64FileType(t)+";base64,"+e:e)})):r(void 0)}))},e.FileIsImage=function(e){switch(e.substring(e.lastIndexOf(".")+1,e.length).toLowerCase()){case"jpg":case"jpeg":case"png":case"bmp":return!0;default:return!1}},e.GetBase64FileType=function(e){switch(e.substring(e.lastIndexOf(".")+1,e.length).toLowerCase()){case"jpg":case"jpeg":return"jpeg";case"png":return"png";case"bmp":return"bmp";default:return"jpeg"}},e.GetZipContent=function(e){return y(this,void 0,void 0,(function(){return _(this,(function(t){switch(t.label){case 0:return[4,(new l).loadAsync(e)];case 1:return[2,t.sent()]}}))}))},e.MaterialCache=new Map,e}(),P=function(){function e(){this._lastKnownVariations=new Map}return e.prototype.clearCache=function(){for(var e=Array.from(this._lastKnownVariations.values()),t=0;t<e.length;t++){Array.from(e[t].values()).forEach((function(e){e.forEach((function(e){e.material.texture.dispose(),e.material.normal.dispose(),e.material.metalness.dispose(),e.material.roughness.dispose(),e.material.ao.dispose()}))}))}},e.prototype.loadPart=function(e,t,n){return void 0===n&&(n=!1),y(this,void 0,void 0,(function(){var i,r,o,s,c,l;return _(this,(function(u){switch(u.label){case 0:u.trys.push([0,6,,7]),i=t.length,r=0,u.label=1;case 1:return r<i?t[r].decoNode&&t[r].decoNode.gameObjectName&&t[r].decoNode.type===a.DecoNodeType.Part?[4,D.LoadVariation(this.assetPath,t[r].decoNode.gameObjectName||t[r].decoId)]:[3,4]:[3,5];case 2:return(o=u.sent())?((s=new S).decoId=parseFloat(t[r].decoNode.id),s.brandId=t[r].decoNode.brandId,s.gameObjectName=t[r].decoNode.gameObjectName,c=s,[4,M.CreateMaterialFromAsset(o)]):[3,4];case 3:c.material=u.sent(),this._applyMaterialPart(e,s,t[r].node,n),u.label=4;case 4:return r++,[3,1];case 5:return[3,7];case 6:return l=u.sent(),console.error(l),[3,7];case 7:return[2]}}))}))},e.prototype.loadVariation=function(e,t,n,i){return void 0===i&&(i=!1),y(this,void 0,void 0,(function(){var r,o,a,s,c,l,u,d,p;return _(this,(function(h){switch(h.label){case 0:h.trys.push([0,9,,10]),r=n.length,o=0,h.label=1;case 1:if(!(o<r))return[3,8];if(!(a=n[o].variations)||0===a.length)return this._getLastKnownVariations(e,n[o].nodeId)?(n[o].variations=this._getLastKnownVariations(e,n[o].nodeId),this._applyVariations(t,n[o],i),[3,7]):[3,7];s=[],c=0,h.label=2;case 2:return c<a.length?[4,D.LoadVariation(this.assetPath,a[c].gameObjectName||n[o].decoId)]:[3,6];case 3:return l=h.sent(),(u=new S).decoId=parseFloat(a[c].id),u.brandId=a[c].brandId,u.gameObjectName=a[c].gameObjectName,u.supplierArticleNr=a[c].supplierArticleNr,u.materialId=a[c].materialId,d=u,[4,M.CreateMaterialFromAsset(l)];case 4:d.material=h.sent(),s.push(u),h.label=5;case 5:return c++,[3,2];case 6:this._setLastKnownVariations(e,n[o].nodeId,s),n[o].variations=s,this._applyVariations(t,n[o],i),h.label=7;case 7:return o++,[3,1];case 8:return[3,10];case 9:return p=h.sent(),console.error(p),[3,10];case 10:return[2]}}))}))},e.prototype._getChildrenFilterByProp=function(e,t,n,i){return e.children.filter((function(e){return e.userData&&e.userData.hasOwnProperty(t)&&e.userData[t].hasOwnProperty(n)&&e.userData[t][n]===i}))},e.prototype._applyMaterialPart=function(e,n,i,r){var o=this;void 0===r&&(r=!1);for(var a=this._getChildrenFilterByProp(e,"selection","node",i),s=a.length,c=0;c<s;c++){var l=a[c];null!=l&&l.traverse((function(e){if(e instanceof t.Mesh&&n)if(Array.isArray(e.material))for(var i=0,a=e.material.length;i<a;i++)-1!==e.material[i].name.toLowerCase().indexOf("fixed_frame")&&(e.material[i]=o._setMeshMaterialFromVariation(e.material[i].name,n,r));else-1!==e.material.name.toLowerCase().indexOf("fixed_frame")&&(e.material=o._setMeshMaterialFromVariation(e.material.name,n,r))}))}},e.prototype._applyVariations=function(e,n,i){var r=this;void 0===i&&(i=!1);for(var o=this._getChildrenFilterByProp(e,"selection","node",n.node),a=o.length,s=0;s<a;s++){var c=o[s];null!=c&&c.traverse((function(e){if(e instanceof t.Mesh&&n.variations&&n.variations.length>0&&e.name.toLowerCase().indexOf("c_"))for(var o=0;o<n.variations.length;o++){var a=n.variations[o];if(a.material){var s=a.materialId?a.materialId.toLowerCase():"default";if(Array.isArray(e.material))for(var c=0,l=e.material.length;c<l;c++)-1!==e.material[c].name.toLowerCase().indexOf(s)&&(e.material[c]=r._setMeshMaterialFromVariation(e.material[c].name,a,i));else-1!==e.material.name.toLowerCase().indexOf(s)&&(e.material=r._setMeshMaterialFromVariation(e.material.name,a,i))}}}))}},e.prototype._setMeshMaterialFromVariation=function(e,n,i){if(void 0===i&&(i=!1),n.material.texture&&(n.material.texture.needsUpdate=!0),i){var r={name:e,roughness:n.material.roughnessValue?n.material.roughnessValue:1,metalness:n.material.metalnessValue?n.material.metalnessValue:0};return n.material.texture&&(r.map=n.material.texture),n.material.ao&&(r.aoMap=n.material.ao),n.material.roughness&&(r.roughnessMap=n.material.roughness),n.material.metalness&&(r.metalnessMap=n.material.metalness),n.material.normal&&(r.normalMap=n.material.normal),(o=new t.MeshStandardMaterial(r)).color.setRGB(1,1,1),o.needsUpdate=!0,o}var o;return(o=new t.MeshPhongMaterial({name:e,shininess:n.material.shininess,specular:n.material.specular,map:n.material.texture,normalMap:n.material.normal})).needsUpdate=!0,o},e.prototype._setLastKnownVariations=function(e,t,n){if(this._lastKnownVariations.has(e)){(i=this._lastKnownVariations.get(e)).set(t,n)}else{var i=new Map;this._lastKnownVariations.set(e,i.set(t,n))}},e.prototype._getLastKnownVariations=function(e,t){if(this._lastKnownVariations.has(e)){var n=this._lastKnownVariations.get(e);if(n.has(t))return n.get(t)}return null},e}(),T=function(){function e(){}return e.injector=void 0,e=x([d.Injectable()],e)}(),V=function(){function e(e){this._injector=e,T.injector||(T.injector=e)}return e.prototype.initApi=function(e){this._configuratorApi=new p.Configurator(e)},e.prototype.initNodeInstance=function(e){return y(this,void 0,void 0,(function(){return _(this,(function(t){switch(t.label){case 0:return[4,this._configuratorApi.initNodeInstance(e)];case 1:return[2,t.sent()]}}))}))},e.prototype.setInstanceToConfigure=function(e,t){return void 0===t&&(t=!1),y(this,void 0,void 0,(function(){return _(this,(function(n){switch(n.label){case 0:return[4,this._configuratorApi.setInstanceToConfigure(e,t)];case 1:return[2,n.sent()]}}))}))},e.prototype.getGoodIdFromSku=function(e,t){return void 0===t&&(t=!1),y(this,void 0,void 0,(function(){return _(this,(function(n){switch(n.label){case 0:return[4,this._configuratorApi.getGoodIdFromSku(e,t)];case 1:return[2,n.sent()]}}))}))},e.prototype.getArticleQuickSel=function(e,t){return void 0===t&&(t=!1),y(this,void 0,void 0,(function(){return _(this,(function(n){switch(n.label){case 0:return[4,this._configuratorApi.getArticleQuickSel(e,t)];case 1:return[2,n.sent()]}}))}))},e.prototype.getSelections=function(e,t){return void 0===e&&(e=!1),void 0===t&&(t=2),y(this,void 0,void 0,(function(){var n;return _(this,(function(i){switch(i.label){case 0:return[4,this._configuratorApi.getSelections(e)];case 1:return(n=i.sent()).resultObjects.filter((function(e){(g.isNill(e.hierarchicalPublicationCode)||(e.hierarchicalPublicationCode&t)>0)&&(e.nodeType===f.NodeType.Question&&((e.questionPublicationCode&t)>0||g.isNill(e.questionPublicationCode))||e.nodeType===f.NodeType.Answer&&((e.answerPublicationCode&t)>0||g.isNill(e.answerPublicationCode)))})),[2,n]}}))}))},e.prototype.getDecos=function(e){return void 0===e&&(e=!1),y(this,void 0,void 0,(function(){return _(this,(function(t){switch(t.label){case 0:return[4,this._configuratorApi.getDecos(e)];case 1:return[2,t.sent()]}}))}))},e.prototype.getQuestionAndAnswers=function(e,t){return void 0===e&&(e=!1),void 0===t&&(t=2),y(this,void 0,void 0,(function(){var n;return _(this,(function(i){switch(i.label){case 0:return[4,this._configuratorApi.getQuestionAndAnswers(e)];case 1:return(n=i.sent()).answers.filter((function(e){h.notNill(e.hierarchicalPublicationCode)&&0==(e.hierarchicalPublicationCode&t)||e.type===f.NodeType.Question&&0==(e.questionPublicationCode&t)&&h.notNill(e.questionPublicationCode)||e.type===f.NodeType.Answer&&0==(e.publicationCode&t)&&h.notNill(e.publicationCode)})),[2,n]}}))}))},e.prototype.getSingleImage=function(e,t,n,i,r){return y(this,void 0,void 0,(function(){return _(this,(function(o){switch(o.label){case 0:return e?[4,this._configuratorApi.getSingleImage(e,t,n,i,r)]:[2,null];case 1:return[2,o.sent()]}}))}))},e.prototype.selectSelection=function(e,t){return void 0===t&&(t=!1),y(this,void 0,void 0,(function(){return _(this,(function(n){switch(n.label){case 0:return[4,this._configuratorApi.selectSelection(e,t)];case 1:return[2,n.sent()]}}))}))},e.prototype.selectAnswer=function(e,t){return void 0===t&&(t=!1),y(this,void 0,void 0,(function(){return _(this,(function(n){switch(n.label){case 0:return[4,this._configuratorApi.selectAnswer(e,t)];case 1:return[2,n.sent()]}}))}))},e.ctorParameters=function(){return[{type:d.Injector}]},e.ɵprov=d.ɵɵdefineInjectable({factory:function(){return new e(d.ɵɵinject(d.INJECTOR))},token:e,providedIn:"root"}),e=x([d.Injectable({providedIn:"root"})],e)}(),B=function(){function e(e,t,n){if(this.selectionsReceived=new m.BehaviorSubject([]),this.answersReceived=new m.BehaviorSubject([]),this.modelLoaded=new m.BehaviorSubject(null),this._selections=[],this._answers=[],this._decos=[],this._placedAdjustables=[],this._placedAddables=[],this._adjustables=[],this._addables=[],this._articleCache=new Map,this._boFactory=new r.BusinessObjectFactory,this._threedUtils=new O,this._variationHelper=new P,!e)throw"No scene object provided!";if(!t)throw"No connection options provided!";this._configuratorService=n?T.injector.get(V):new V(void 0),this._configuratorService.initApi(t),this._scene=e}return e.prototype.buildModel=function(e,t,n){return y(this,void 0,void 0,(function(){var i;return _(this,(function(r){switch(r.label){case 0:if(!this._scene)return[2];r.label=1;case 1:return r.trys.push([1,8,,9]),[4,this._setInstanceId(e,t,n)];case 2:return r.sent(),[4,this._prepareConfiguration(this._sku,this._goodId)];case 3:return r.sent(),this._source?[4,this._configuratorService.setInstanceToConfigure(this._instanceId)]:[3,6];case 4:return r.sent(),(i=[]).push(this.getQuestionAndAnswers()),i.push(this._getSelections(this._instanceId)),i.push(this._getDecos()),[4,Promise.all(i)];case 5:return r.sent(),this._answers.length>0?[2]:(this._linkSelectionsAndDecos(),[2,this._build(this._instanceId)]);case 6:throw"GLB source not found!";case 7:return[3,9];case 8:throw r.sent();case 9:return[2]}}))}))},e.prototype.initNodeInstance=function(e){return this._configuratorService.initNodeInstance(e)},e.prototype.destroy=function(){this._threedUtils.clearCache(),this._variationHelper.clearCache()},e.prototype.selectSelection=function(e){return y(this,void 0,void 0,(function(){return _(this,(function(t){switch(t.label){case 0:return[4,this._configuratorService.selectSelection(e,!1)];case 1:return t.sent(),this.getQuestionAndAnswers(),[2]}}))}))},e.prototype.getQuestionAndAnswers=function(e){return y(this,void 0,void 0,(function(){var t;return _(this,(function(n){switch(n.label){case 0:return[4,this._configuratorService.getQuestionAndAnswers(!1,e)];case 1:return t=n.sent(),this._answers=t.answers,this.answersReceived.next(t.answers),[2]}}))}))},e.prototype.selectAnswer=function(e){return y(this,void 0,void 0,(function(){var t,n;return _(this,(function(i){switch(i.label){case 0:return[4,this._configuratorService.selectAnswer(e,!1)];case 1:return i.sent(),n=(t=this.modelLoaded).next,[4,this.buildModel()];case 2:return n.apply(t,[i.sent()]),[2]}}))}))},e.prototype._setInstanceId=function(e,t,n){return y(this,void 0,void 0,(function(){var i;return _(this,(function(r){switch(r.label){case 0:return t||this._instanceId?[3,4]:n?[3,2]:[4,this._getGoodIdFromSku(e)];case 1:n=r.sent(),r.label=2;case 2:return this._goodId=n,[4,this.initNodeInstance(this._goodId)];case 3:if(!(i=r.sent())||!i.resultObject)throw"Failed to initialize node instance";return this._instanceId=i.resultObject,[3,5];case 4:this._instanceId||(this._instanceId=t),r.label=5;case 5:return this._sku||(this._sku=e),[2]}}))}))},e.prototype._prepareConfiguration=function(e,t){return y(this,void 0,void 0,(function(){var n,i;return _(this,(function(r){switch(r.label){case 0:return[4,this._getArticle(e,t)];case 1:return(n=r.sent())&&n.assetUrl?(i=this,[4,this._threedUtils.download3DSource(n.assetUrl).catch((function(e){throw e}))]):[3,3];case 2:i._source=r.sent(),n.contentDeliveryUrl&&(this._variationHelper.assetPath=n.contentDeliveryUrl+(n.contentDeliveryUrl.endsWith("/")?"":"/")+(n.distSchema?n.distSchema:"UP_DBA")),r.label=3;case 3:return[2]}}))}))},e.prototype._build=function(e){return y(this,void 0,void 0,(function(){var n,i,r,o,a,s,c,l;return _(this,(function(u){switch(u.label){case 0:if(this._reset(),!((n=this._getAdjustables())&&n.length>0))return[3,2];for((i=new t.Object3D).visible=!1,this._scene.add(i),r=!1,o=0,a=n.length;o<a;o++){if(s=this._createAdjustable(i,n[o]))for(c=0,l=this._placedAdjustables.length;c<l;c++){if(I.TrySelectorConnection(this._scene,i,this._placedAdjustables[c],s)){this._placedAdjustables[c].visible=!0,s.visible=!0,r=!0;break}r=!1}!r&&this._placedAdjustables.length>1&&console.warn("No connection found for: ",s.name)}return this._placeAddables(i),this._updatePivot(i),[4,this._loadVariations(i,e)];case 1:return u.sent(),this._scene.remove(i),[2,i];case 2:throw"No adjustables found!"}}))}))},e.prototype._prepareTheSelections=function(){for(var e,t,n,i=this,r=this._selections.filter((function(e){return e.generic&&e.decoNode.variation&&!e.decoNode.type})).map((function(e,t,n){var r=i._selections.find((function(t){return t.artNodeIdDeco===e.decoNode.variation.id}));return r&&(e.decoNode.variation.supplierArticleNr=r.supplierArticleNr),e.decoNode.variation.materialId=e.hdecoGameObject,e.decoNode.variation})),o=!0,s=this._selections.length,l=!1,u=-1,d=0;d<s;d++){var p=this._selections[d];1===p.presentationLevel&&(n=p.hdecoPositioning),p.presentationLevel>u&&(p.hdecoPositioning=p.hdecoPositioning||n),p.decoNode&&(p.decoNode.type===a.DecoNodeType.Variation?e?(l?e.variations=[p.decoNode]:e.variations.push(p.decoNode),l=!1):(o&&(r.length=0,o=!1),r.push(p.decoNode)):p.decoNode.type===a.DecoNodeType.Part&&"string"==typeof p.decoNode.gameObjectName&&p.decoNode.gameObjectName.length&&(p.decoNode.kind===c.DecoNodeKind.Adjustable?(p.variations=r,this._adjustables.push(p),e&&e.nodeId===p.nodeId||(l=!0),e=p,t=p):p.decoNode.kind===c.DecoNodeKind.Addable&&(p.variations=t?t.variations:r,t&&t.addables.push(p),this._addables.push(p),e&&e.nodeId===p.nodeId||(l=!0),e=p))),u=p.presentationLevel}},e.prototype._createAdjustable=function(e,t){var n=this._source?this._source.getObjectByName(t.decoNode.gameObjectName):null;if(!n){var i=t.decoNode.gameObjectName.replace(/[.]/g,"");if(!(n=this._source?this._source.getObjectByName(i):null))return null}var r=n.clone();return r.name=this._createUniqueName(e,n),r.userData.selection=t,r.position.set(0,0,0),r.visible=!0,e.add(r),this._placedAdjustables.push(r),r},e.prototype._createAddable=function(e,t,n,i){var r=this._source.getObjectByName(t.decoNode.gameObjectName);if(!r)return null;var o=r.clone();return o.name=this._createUniqueName(e,r),o.userData.selection=t,o.position.set(0,0,0),o.visible=!0,i&&n?(e.add(o),this._placedAddables.push(o),o):o},e.prototype._placeAddables=function(e){for(var t=this,n=this._placedAdjustables.length,i=0;i<n;i++)if(this._placedAdjustables[i].userData.hasOwnProperty("selection")&&this._placedAdjustables[i].userData.selection){var r=this._placedAdjustables[i].userData.selection;if(r)for(var o=r.addables.length,a=void 0,s=0;s<o;s++)I.TrySelectorConnection(this._scene,e,this._placedAdjustables[i],r.addables[s],(function(n,i,r){return t._createAddable(e,n,i,r)})),a&&I.TrySelectorConnection(this._scene,e,a,r.addables[s],(function(n,i,r){return t._createAddable(e,n,i,r)})),a=this._placedAddables[this._placedAddables.length-1]}},e.prototype._createUniqueName=function(e,t){for(var n=0,i=t.name,r=e.getObjectByName(i);r;)n++,i=t.name+(0!==n?"_"+n:""),r=e.getObjectByName(i);return i},e.prototype._getGoodIdFromSku=function(e){return y(this,void 0,void 0,(function(){var t;return _(this,(function(n){switch(n.label){case 0:return[4,this._configuratorService.getGoodIdFromSku(e,!1)];case 1:return(t=n.sent()).validationResult.success&&t.resultObject?[2,t.resultObject]:[2]}}))}))},e.prototype._getArticle=function(e,t){return y(this,void 0,void 0,(function(){var n,i,r;return _(this,(function(o){switch(o.label){case 0:return this._articleCache.has(e)?[2,this._articleCache.get(e)]:t?[3,2]:[4,this._getGoodIdFromSku(e).catch((function(t){throw"Article with sku "+e+" not found!"}))];case 1:t=o.sent(),o.label=2;case 2:return[4,this._configuratorService.getArticleQuickSel(t,!1)];case 3:return(i=o.sent()).validationResult.success&&i.resultObject&&(i.resultObject.hasOwnProperty("oArticle")?(r=Array.isArray(i.resultObject.oArticle)?i.resultObject.oArticle[0]:i.resultObject.oArticle,n=this._boFactory.makeWithRawBackendData(u.Article,r)):n=this._boFactory.makeWithRawBackendData(u.Article,i.resultObject)),this._articleCache.set(e,n),[2,n]}}))}))},e.prototype._getSelections=function(e,t){return y(this,void 0,void 0,(function(){var n;return _(this,(function(i){switch(i.label){case 0:return this._selections=[],[4,this._configuratorService.getSelections(!1,t)];case 1:if(!((n=i.sent()).resultObjects&&n.resultObjects.length>0))throw"No selections found!";return this._selections=this._boFactory.makeBOArrayFromRawBackendDataArray(o.Selection,n.resultObjects),this._selections.forEach((function(t){return t.instanceId=e})),this.selectionsReceived.next(this._selections),[2]}}))}))},e.prototype._getDecos=function(){return y(this,void 0,void 0,(function(){var e;return _(this,(function(t){switch(t.label){case 0:return this._decos=[],[4,this._configuratorService.getDecos(!1)];case 1:if(!((e=t.sent()).resultObjects&&e.resultObjects.length>0))throw"No deconodes found!";return this._decos=this._boFactory.makeBOArrayFromRawBackendDataArray(i.DecoNode,e.resultObjects),[2]}}))}))},e.prototype._linkSelectionsAndDecos=function(){for(var e=this,t=this._selections.length,n=function(t){var n=r._selections[t].artNodeIdDeco,o=r._decos.find((function(e){return e.id===n}));o||(o=new i.DecoNode);var a=r._getVariations().find((function(n){return n.parentId===e._selections[t].artNodeIdDeco}));a&&(o.variation=a),r._selections[t].decoNode=o},r=this,o=0;o<t;o++)n(o)},e.prototype._getVariations=function(){return this._decos.filter((function(e){return e.type===a.DecoNodeType.Variation}))},e.prototype._loadVariations=function(e,t){return y(this,void 0,void 0,(function(){return _(this,(function(n){switch(n.label){case 0:return[4,this._variationHelper.loadPart(e,this._adjustables,!0)];case 1:return n.sent(),[4,this._variationHelper.loadVariation(t,e,this._adjustables,!0)];case 2:return n.sent(),[4,this._variationHelper.loadVariation(t,e,this._addables,!0)];case 3:return n.sent(),[2]}}))}))},e.prototype._getAdjustables=function(){return this._selections.filter((function(e){var t=e.decoNode;return t&&t.gameObjectName&&t.type===a.DecoNodeType.Part&&t.kind===c.DecoNodeKind.Adjustable}))},e.prototype._updatePivot=function(e){var n=(new t.Box3).setFromObject(e),i=new t.Vector3;n.getCenter(i);var r=(new t.Vector3).sub(i).setY(Math.abs(Math.min(n.min.y,0)));e.children.forEach((function(e){e.position.add(r)})),e.updateWorldMatrix(!1,!0)},e.prototype._reset=function(){this._placedAddables.length=0,this._placedAdjustables.length=0,this._adjustables.length=0,this._addables.length=0,this._prepareTheSelections()},e.ctorParameters=function(){return[{type:t.Scene},{type:n.Options},{type:Boolean}]},e=x([d.Injectable()],e)}(),L=function(){function e(){this.answers=[],this.answerClick=new d.EventEmitter}return x([d.Input()],e.prototype,"answers",void 0),x([d.Input()],e.prototype,"selectionTitle",void 0),x([d.Output()],e.prototype,"answerClick",void 0),e=x([d.Component({selector:"answers",template:'\n <div class="ione-configurator">\n <div class="rp-answers-slideout">\n <h2 class="answers-title" [textContent]="selectionTitle"></h2>\n <div class="answers-container" visibilityObserverMaster>\n <answer *ngFor="let answer of answers"\n (click)="answerClick.emit(answer)"\n [answer]="answer"\n visibilityObserver\n #intersection="intersection"\n [observerEnabled]="true"\n [showing]="intersection.isIntersecting"\n ></answer>\n </div>\n \n </div>\n </div>\n ',styles:[".ione-configurator .rp-answers-slideout{position:absolute;top:0;right:0;width:400px;height:-webkit-fit-content;height:-moz-fit-content;height:fit-content}.ione-configurator .answers-title{margin-left:10px;color:#1a1a1a}.ione-configurator .answers-container{height:100vh;overflow-y:scroll}.ione-configurator .answer-content{position:relative;overflow:hidden;cursor:pointer;font-size:12px;border:1px solid #d3d3d3;padding:10px;display:flex;flex-direction:row;border-radius:3px;margin-bottom:3px;box-shadow:2px 1px rgba(211,211,211,.5);background:#fff}.ione-configurator .thumbnail{width:54px;min-width:54px;height:54px;min-height:54px;border:1px solid #d3d3d3;border-radius:5px}.ione-configurator .img-size{width:54px;min-width:54px;height:54px;min-height:54px;border-radius:5px}.ione-configurator .answer-wrapper{display:block}.ione-configurator .answer-title{font-size:12px;position:relative;overflow:hidden;cursor:pointer}.ione-configurator .question{font-weight:700;color:#1a1a1a}.ione-configurator .answer{font-size:12px;font-style:italic;margin-top:3px}.ione-configurator .collapse-content,.ione-configurator .collapse-wrapper{display:block}.ione-configurator .collapse-handle{position:absolute;top:10px;right:12px;border:solid #000;border-width:0 3px 3px 0;display:inline-block;padding:3px;transform:rotate(45deg);-webkit-transform:rotate(45deg)}.ione-configurator .collapse-handle.expanded{transform:rotate(-135deg);-webkit-transform:rotate(-135deg)}.ione-configurator .child-selection{margin-left:10px;display:flex;flex-direction:column;margin-top:5px}.ione-configurator .mat-title{margin-left:10px;color:#1a1a1a}.ione-configurator .drawer__header{height:48px}.ione-configurator .rp-selections-summary{height:-webkit-fit-content;height:-moz-fit-content;height:fit-content;background:0 0;overflow:auto;position:absolute;top:0;right:0;width:400px}.ione-configurator .selections-content{overflow-y:auto}.ione-configurator .co-summary-line{position:relative;overflow:hidden;cursor:pointer;font-size:12px;border:1px solid #d3d3d3;padding:10px;display:flex;flex-direction:row;border-radius:3px;margin-bottom:3px;box-shadow:2px 1px rgba(211,211,211,.5);background:#fff}.ione-configurator .selection-thumbnail{width:54px;min-width:54px;height:54px;min-height:54px;border:1px solid #d3d3d3;border-radius:5px}.ione-configurator .selection-img{width:54px;min-width:54px;height:54px;min-height:54px;border-radius:5px}.ione-configurator .answer-thumbnail{width:54px;min-width:54px;height:54px;min-height:54px;border:1px solid #d3d3d3;border-radius:5px}.ione-configurator .answer-img{width:54px;min-width:54px;height:54px;min-height:54px;border-radius:5px}.ione-configurator .unloaded{background-color:#d3d3d3}.ione-configurator .titles{margin-left:14px;-ms-grid-row-align:center;align-self:center}.ione-configurator .title-wrapper{display:flex;flex-direction:column}.ione-configurator .answer-title-wrapper{text-align:center;-ms-grid-row-align:center;align-self:center;margin-left:14px}"]})],e)}(),G=function(){function e(e){this._configuratorService=e,this._imageCache=new Map}var t;return t=e,e._handleResponseData=function(e,t,n){return n&&n.resultObject?null!==n.resultObject.filePath&&""!==n.resultObject.filePath?A.getFixedImageFilepathUrl(n.resultObject.filePath):e?A.getDocBodyWithMimeTypeDefinition(n.resultObject.fileName,t?n.resultObject.thumbnailBody:n.resultObject.documentBody):t?n.resultObject.thumbnailBody:n.resultObject.documentBody:""},e.prototype.getImageForSelectionOrAnswer=function(e){var n=this;return new Promise((function(i,r){if(e&&e.nodeId){if(!n._imageCache.has(e.nodeId))return n._configuratorService.getSingleImage(e.nodeId,4,!0,!0,!0).then((function(r){var o=t._handleResponseData(!0,!0,r);n._imageCache.set(e.nodeId,o),i(o)})).catch((function(){r()}));i(n._imageCache.get(e.nodeId))}else r()}))},e.ctorParameters=function(){return[{type:V}]},e.ɵprov=d.ɵɵdefineInjectable({factory:function(){return new e(d.ɵɵinject(V))},token:e,providedIn:"root"}),e=t=x([d.Injectable({providedIn:"root"})],e)}(),E=function(){function e(e){this._imageCacheService=e}return Object.defineProperty(e.prototype,"showing",{set:function(e){this.answer.imageData="",e&&"Skip / Cancel"!==this.answer.answer?this._loadThumbnail(this.answer):this.answer.imageData=null},enumerable:!0,configurable:!0}),e.prototype.ngOnInit=function(){},e.prototype._loadThumbnail=function(e){return y(this,void 0,void 0,(function(){return _(this,(function(t){switch(t.label){case 0:return[4,this._imageCacheService.getImageForSelectionOrAnswer(e).then((function(t){e.imageData=""===t?null:t}))];case 1:return t.sent(),[2]}}))}))},e.ctorParameters=function(){return[{type:G}]},x([d.Input()],e.prototype,"answer",void 0),x([d.Input()],e.prototype,"showing",null),e=x([d.Component({selector:"answer",template:'\n <div class="ione-configurator">\n <div class="answer-wrapper">\n <div class="answer-content" @answerAppear>\n <div class="answer-thumbnail">\n <rp-loader *ngIf="answer.imageData === \'\'"></rp-loader>\n <img *ngIf="answer.imageData !== \'\' && answer.imageData !== null" class="answer-img" [src]="answer.imageData">\n </div>\n <div class="answer-title-wrapper">\n <span class="answer-title" [textContent]="answer.commercialAnswer"></span>\n </div>\n <div class="price">\n <span class="price-value"></span>\n </div>\n </div>\n </div>\n </div>\n ',animations:[w.trigger("answerAppear",[w.state("void",w.style({background:"#dbdbdb"})),w.state("white",w.style({background:"white"})),w.transition("void <=> *",w.animate(500))])],styles:[".ione-configurator .rp-answers-slideout{position:absolute;top:0;right:0;width:400px;height:-webkit-fit-content;height:-moz-fit-content;height:fit-content}.ione-configurator .answers-title{margin-left:10px;color:#1a1a1a}.ione-configurator .answers-container{height:100vh;overflow-y:scroll}.ione-configurator .answer-content{position:relative;overflow:hidden;cursor:pointer;font-size:12px;border:1px solid #d3d3d3;padding:10px;display:flex;flex-direction:row;border-radius:3px;margin-bottom:3px;box-shadow:2px 1px rgba(211,211,211,.5);background:#fff}.ione-configurator .thumbnail{width:54px;min-width:54px;height:54px;min-height:54px;border:1px solid #d3d3d3;border-radius:5px}.ione-configurator .img-size{width:54px;min-width:54px;height:54px;min-height:54px;border-radius:5px}.ione-configurator .answer-wrapper{display:block}.ione-configurator .answer-title{font-size:12px;position:relative;overflow:hidden;cursor:pointer}.ione-configurator .question{font-weight:700;color:#1a1a1a}.ione-configurator .answer{font-size:12px;font-style:italic;margin-top:3px}.ione-configurator .collapse-content,.ione-configurator .collapse-wrapper{display:block}.ione-configurator .collapse-handle{position:absolute;top:10px;right:12px;border:solid #000;border-width:0 3px 3px 0;display:inline-block;padding:3px;transform:rotate(45deg);-webkit-transform:rotate(45deg)}.ione-configurator .collapse-handle.expanded{transform:rotate(-135deg);-webkit-transform:rotate(-135deg)}.ione-configurator .child-selection{margin-left:10px;display:flex;flex-direction:column;margin-top:5px}.ione-configurator .mat-title{margin-left:10px;color:#1a1a1a}.ione-configurator .drawer__header{height:48px}.ione-configurator .rp-selections-summary{height:-webkit-fit-content;height:-moz-fit-content;height:fit-content;background:0 0;overflow:auto;position:absolute;top:0;right:0;width:400px}.ione-configurator .selections-content{overflow-y:auto}.ione-configurator .co-summary-line{position:relative;overflow:hidden;cursor:pointer;font-size:12px;border:1px solid #d3d3d3;padding:10px;display:flex;flex-direction:row;border-radius:3px;margin-bottom:3px;box-shadow:2px 1px rgba(211,211,211,.5);background:#fff}.ione-configurator .selection-thumbnail{width:54px;min-width:54px;height:54px;min-height:54px;border:1px solid #d3d3d3;border-radius:5px}.ione-configurator .selection-img{width:54px;min-width:54px;height:54px;min-height:54px;border-radius:5px}.ione-configurator .answer-thumbnail{width:54px;min-width:54px;height:54px;min-height:54px;border:1px solid #d3d3d3;border-radius:5px}.ione-configurator .answer-img{width:54px;min-width:54px;height:54px;min-height:54px;border-radius:5px}.ione-configurator .unloaded{background-color:#d3d3d3}.ione-configurator .titles{margin-left:14px;-ms-grid-row-align:center;align-self:center}.ione-configurator .title-wrapper{display:flex;flex-direction:column}.ione-configurator .answer-title-wrapper{text-align:center;-ms-grid-row-align:center;align-self:center;margin-left:14px}"]})],e)}(),U=function(){function e(){var e=this;this._mapping=new Map,this._observer=new IntersectionObserver((function(t){var n,i;try{for(var r=j(t),o=r.next();!o.done;o=r.next()){var a=o.value,s=e._mapping.get(a.target);s&&s(a.isIntersecting)}}catch(e){n={error:e}}finally{try{o&&!o.done&&(i=r.return)&&i.call(r)}finally{if(n)throw n.error}}}),{rootMargin:"300px 0px 300px 0px"})}return e.prototype.ngOnDestroy=function(){this._mapping.clear(),this._observer.disconnect()},e.prototype.add=function(e,t){this._mapping.set(e,t),this._observer.observe(e)},e.prototype.remove=function(e){this._mapping.delete(e),this._observer.unobserve(e)},e=x([d.Directive({selector:"[visibilityObserverMaster]"})],e)}(),R=function(){function e(e,t){this.observerEnabled=!1,this.IS_INTERSECTING=!0,this.IS_NOT_INTERSECTING=!1,this._parent=e,this._elementRef=t,this.isIntersecting=!1}return e.prototype.ngOnDestroy=function(){this._parent.remove(this._elementRef.nativeElement),this._elementRef=void 0},e.prototype.ngOnInit=function(){var e=this;this.observerEnabled&&this._parent.add(this._elementRef.nativeElement,(function(t){e.isIntersecting=t,e.isIntersecting&&e._parent.remove(e._elementRef.nativeElement)}))},e.ctorParameters=function(){return[{type:U},{type:d.ElementRef}]},x([d.Input()],e.prototype,"observerEnabled",void 0),e=x([d.Directive({selector:"[visibilityObserver]",exportAs:"intersection"})],e)}(),q=function(){function e(){}return e=x([d.Component({selector:"rp-loader",template:'\n <div class="loader-wrapper">\n <svg xmlns="http://www.w3.org/2000/svg" width="44" height="44" viewBox="0 0 44 44" stroke="#3760a1">\n <g fill="none" fill-rule="evenodd" stroke-width="3">\n <circle class="ripple1" cx="22" cy="22" r="19">\n </circle>\n <circle class="ripple2" cx="22" cy="22" r="19">\n </circle>\n </g>\n </svg>\n </div>\n ',styles:[":host{-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;pointer-events:none}:host .loader-wrapper{z-index:1100;position:absolute;width:54px;height:54px}:host .loader-wrapper svg{width:100%;height:100%}:host .loader-wrapper svg .ripple1{transform-origin:center;-webkit-animation:1.5s infinite ripple;animation:1.5s infinite ripple}:host .loader-wrapper svg .ripple2{transform-origin:center;-webkit-animation:1.5s .4s infinite ripple;animation:1.5s .4s infinite ripple}@-webkit-keyframes ripple{0%{transform:scale(0);opacity:1}100%{transform:scale(1);opacity:0}}@keyframes ripple{0%{transform:scale(0);opacity:1}100%{transform:scale(1);opacity:0}}"]})],e)}(),z=function(){function e(){}return e=x([d.NgModule({imports:[b.CommonModule],declarations:[q],exports:[q]})],e)}(),W=function(){function e(){}return e=x([d.NgModule({imports:[b.CommonModule,z],declarations:[L,E,R,U],exports:[L]})],e)}(),Q=function(){this.children=[],this.expanded=!1,this.thumbnail=""},K=function(){function e(e){this._imageCacheService=e,this.selectionViewModels=[],this.selectionClick=new d.EventEmitter}return Object.defineProperty(e.prototype,"selections",{set:function(e){this._prepareSelections(e),this._loadThumbnails()},enumerable:!0,configurable:!0}),e.prototype.ngOnInit=function(){},e.prototype.expandClicked=function(e,t){t.preventDefault(),t.stopImmediatePropagation(),e.expanded=!e.expanded},e.prototype.selectSelection=function(e,t){t.preventDefault(),t.stopImmediatePropagation(),this.selectionClick.next(e)},e.prototype._loadThumbnails=function(){return y(this,void 0,void 0,(function(){var e=this;return _(this,(function(t){return this.selectionViewModels.length>0&&this.selectionViewModels.forEach((function(t){return y(e,void 0,void 0,(function(){return _(this,(function(e){switch(e.label){case 0:return[4,this._imageCacheService.getImageForSelectionOrAnswer(t.selection).then((function(e){t.thumbnail=""===e?null:e}))];case 1:return e.sent(),[2]}}))}))})),[2]}))}))},e.prototype._prepareSelections=function(e){var t,n=this;this.selectionViewModels.length=0,e.forEach((function(e){1===e.presentationLevel?((t=new Q).selection=e,n.selectionViewModels.push(t)):e.presentationLevel>1&&t&&t.children.push(e)}))},e.ctorParameters=function(){return[{type:G}]},x([d.Input()],e.prototype,"selections",null),x([d.Output()],e.prototype,"selectionClick",void 0),e=x([d.Component({selector:"selections",template:'\n <div class="ione-configurator">\n <div class="rp-selections-summary">\n <header class="drawer__header">\n <h2 class="mat-title" [textContent]="\'Configuratie\'"></h2>\n \x3c!--<button>--\x3e\n \x3c!----\x3e\n \x3c!--</button>--\x3e\n </header>\n <div class="selections-content">\n <ng-container *ngFor="let selectionViewModel of selectionViewModels">\n\n <div class="co-summary-line" (click)="selectSelection(selectionViewModel.selection, $event)">\n <div class="selection-thumbnail">\n <rp-loader *ngIf="selectionViewModel.thumbnail === \'\'"></rp-loader>\n <img visibilityObserver *ngIf="selectionViewModel.thumbnail !== \'\' && selectionViewModel.thumbnail !== null" class="selection-img" [src]="selectionViewModel.thumbnail">\n </div>\n <div class="titles">\n <div class="title-wrapper">\n <label class="question" [textContent]="selectionViewModel.selection.question"></label>\n <span class="answer" [textContent]="selectionViewModel.selection.answer"></span>\n <div *ngIf="selectionViewModel.children.length > 0 && selectionViewModel.expanded" @showHideChildren>\n <div class="child-selection" *ngFor="let selection of selectionViewModel.children"\n (click)="selectSelection(selection, $event)"\n >\n <label class="question" [textContent]="selection.commercialQuestion"></label>\n <span class="answer" [textContent]="selection.answer"></span>\n </div>\n </div>\n </div>\n </div>\n \n <div class="price-wrapper">\n <span class="price-value"></span>\n </div>\n\n <div class="collapse-wrapper">\n <div class="collapse-content">\n <div class="collapse-handle" [class.expanded]="selectionViewModel.expanded"\n *ngIf="selectionViewModel.children.length > 0" (click)="expandClicked(selectionViewModel, $event)"></div>\n </div>\n </div>\n </div>\n\n </ng-container>\n </div>\n </div>\n </div>\n ',animations:[w.trigger("showHideChildren",[w.state("void",w.style({height:"0"})),w.state("*",w.style({height:"*"})),w.transition("void <=> *",w.animate(200))])],styles:[".ione-configurator .rp-answers-slideout{position:absolute;top:0;right:0;width:400px;height:-webkit-fit-content;height:-moz-fit-content;height:fit-content}.ione-configurator .answers-title{margin-left:10px;color:#1a1a1a}.ione-configurator .answers-container{height:100vh;overflow-y:scroll}.ione-configurator .answer-content{position:relative;overflow:hidden;cursor:pointer;font-size:12px;border:1px solid #d3d3d3;padding:10px;display:flex;flex-direction:row;border-radius:3px;margin-bottom:3px;box-shadow:2px 1px rgba(211,211,211,.5);background:#fff}.ione-configurator .thumbnail{width:54px;min-width:54px;height:54px;min-height:54px;border:1px solid #d3d3d3;border-radius:5px}.ione-configurator .img-size{width:54px;min-width:54px;height:54px;min-height:54px;border-radius:5px}.ione-configurator .answer-wrapper{display:block}.ione-configurator .answer-title{font-size:12px;position:relative;overflow:hidden;cursor:pointer}.ione-configurator .question{font-weight:700;color:#1a1a1a}.ione-configurator .answer{font-size:12px;font-style:italic;margin-top:3px}.ione-configurator .collapse-content,.ione-configurator .collapse-wrapper{display:block}.ione-configurator .collapse-handle{position:absolute;top:10px;right:12px;border:solid #000;border-width:0 3px 3px 0;display:inline-block;padding:3px;transform:rotate(45deg);-webkit-transform:rotate(45deg)}.ione-configurator .collapse-handle.expanded{transform:rotate(-135deg);-webkit-transform:rotate(-135deg)}.ione-configurator .child-selection{margin-left:10px;display:flex;flex-direction:column;margin-top:5px}.ione-configurator .mat-title{margin-left:10px;color:#1a1a1a}.ione-configurator .drawer__header{height:48px}.ione-configurator .rp-selections-summary{height:-webkit-fit-content;height:-moz-fit-content;height:fit-content;background:0 0;overflow:auto;position:absolute;top:0;right:0;width:400px}.ione-configurator .selections-content{overflow-y:auto}.ione-configurator .co-summary-line{position:relative;overflow:hidden;cursor:pointer;font-size:12px;border:1px solid #d3d3d3;padding:10px;display:flex;flex-direction:row;border-radius:3px;margin-bottom:3px;box-shadow:2px 1px rgba(211,211,211,.5);background:#fff}.ione-configurator .selection-thumbnail{width:54px;min-width:54px;height:54px;min-height:54px;border:1px solid #d3d3d3;border-radius:5px}.ione-configurator .selection-img{width:54px;min-width:54px;height:54px;min-height:54px;border-radius:5px}.ione-configurator .answer-thumbnail{width:54px;min-width:54px;height:54px;min-height:54px;border:1px solid #d3d3d3;border-radius:5px}.ione-configurator .answer-img{width:54px;min-width:54px;height:54px;min-height:54px;border-radius:5px}.ione-configurator .unloaded{background-color:#d3d3d3}.ione-configurator .titles{margin-left:14px;-ms-grid-row-align:center;align-self:center}.ione-configurator .title-wrapper{display:flex;flex-direction:column}.ione-configurator .answer-title-wrapper{text-align:center;-ms-grid-row-align:center;align-self:center;margin-left:14px}"]})],e)}(),Z=function(){function e(){}return e=x([d.NgModule({imports:[b.CommonModule,z],declarations:[K],exports:[K]})],e)}();e.AnswersComponent=L,e.AnswersModule=W,e.Builder=B,e.ConfiguratorService=V,e.SelectionsComponent=K,e.SelectionsModule=Z,e.ɵa=z,e.ɵb=q,e.ɵc=E,e.ɵd=G,e.ɵe=R,e.ɵf=U,Object.defineProperty(e,"__esModule",{value:!0})}));
|
|
17
17
|
//# sourceMappingURL=colijnit-configurator.umd.min.js.map
|