!function(t,e){if("object"==typeof exports&&"object"==typeof module)module.exports=e();else if("function"==typeof define&&define.amd)define([],e);else{var i=e();for(var r in i)("object"==typeof exports?exports:t)[r]=i[r]}}(this,function(){return function(t){function e(r){if(i[r])return i[r].exports;var a=i[r]={i:r,l:!1,exports:{}};return t[r].call(a.exports,a,a.exports,e),a.l=!0,a.exports}var i={};return e.m=t,e.c=i,e.i=function(t){return t},e.d=function(t,i,r){e.o(t,i)||Object.defineProperty(t,i,{configurable:!1,enumerable:!0,get:r})},e.n=function(t){var i=t&&t.__esModule?function(){return t.default}:function(){return t};return e.d(i,"a",i),i},e.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},e.p="",e(e.s=31)}([function(t,e,i){"use strict";Object.defineProperty(e,"__esModule",{value:!0});!function(t){t[t.UNDEFINED=255]="UNDEFINED",t[t.HIDDEN=254]="HIDDEN",t[t.HIGHLIGHTED=253]="HIGHLIGHTED",t[t.XRAYVISIBLE=252]="XRAYVISIBLE",t[t.EXTRAHIGHLIGHTED=251]="EXTRAHIGHLIGHTED",t[t.UNSTYLED=225]="UNSTYLED"}(e.State||(e.State={}))},function(t,e,i){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=function(){function t(){this._buffer=null,this._view=null,this._position=0}return Object.defineProperty(t.prototype,"Position",{get:function(){return this._position},enumerable:!0,configurable:!0}),t.prototype.load=function(t){this._position=0;var e=this;if(void 0===t||null==t)throw"Source must be defined";if("string"==typeof t){var i;i=new XMLHttpRequest,i.open("GET",t,!0),i.onreadystatechange=function(){if(4==i.readyState&&200==i.status){var t=new FileReader;t.onloadend=function(){t.result&&(e._buffer=t.result,e._view=new DataView(e._buffer),e.onloaded&&e.onloaded(e))},t.readAsArrayBuffer(i.response)}if(4==i.readyState&&200!=i.status){var r="Failed to fetch binary data from server. Server code: "+i.status+". This might be due to CORS policy of your browser if you run this as a local file.";throw e.onerror&&e.onerror(r),r}},i.responseType="blob",i.send()}else if(t instanceof Blob||t instanceof File){var r=new FileReader;r.onloadend=function(){r.result&&(e._buffer=r.result,e._view=new DataView(e._buffer),e.onloaded&&e.onloaded(e))},r.readAsArrayBuffer(t)}else t instanceof ArrayBuffer&&(this._buffer=t,this._view=new DataView(e._buffer),e.onloaded&&e.onloaded(e))},t.prototype.seek=function(t){if(t<0||t>this._buffer.byteLength)throw"Position out of range.";this._position=t},t.prototype.isEOF=function(){if(null==this._position)throw"Position is not defined";return this._position==this._buffer.byteLength},t.prototype.readArray=function(t,e,i){null==e&&(e=1);var r=t*e,a=this._position;this._position+=r;return 1===e?new i(this._buffer.slice(a,a+r))[0]:new i(this._buffer.slice(a,a+r))},t.prototype.move=function(t){var e=this._position;return this._position+=t,e},t.prototype.readByte=function(){return this.readUint8()},t.prototype.readByteArray=function(t){return this.readUint8Array(t)},t.prototype.readUint8=function(){var t=this.move(1);return this._view.getUint8(t)},t.prototype.readUint8Array=function(t){return this.readArray(1,t,Uint8Array)},t.prototype.readInt16=function(){var t=this.move(2);return this._view.getInt16(t,!0)},t.prototype.readInt16Array=function(t){return this.readArray(2,t,Int16Array)},t.prototype.readUInt16=function(){var t=this.move(2);return this._view.getUint16(t,!0)},t.prototype.readUint16Array=function(t){return this.readArray(2,t,Uint16Array)},t.prototype.readInt32=function(){var t=this.move(4);return this._view.getInt32(t,!0)},t.prototype.readInt32Array=function(t){return this.readArray(4,t,Int32Array)},t.prototype.readUint32=function(){var t=this.move(4);return this._view.getUint32(t,!0)},t.prototype.readUint32Array=function(t){return this.readArray(4,t,Uint32Array)},t.prototype.readFloat32=function(){var t=this.move(4);return this._view.getFloat32(t,!0)},t.prototype.readFloat32Array=function(t){return this.readArray(4,t,Float32Array)},t.prototype.readFloat64=function(){var t=this.move(8);return this._view.getFloat64(t,!0)},t.prototype.readFloat64Array=function(t){return this.readArray(8,t,Float64Array)},t.prototype.readChar=function(t){null==t&&(t=1);var e=this.readByteArray(t),i=new Array(t);for(var r in e)i[r]=String.fromCharCode(e[r]);return 1===t?i[0]:i},t.prototype.readPoint=function(t){null==t&&(t=1);for(var e=this.readFloat32Array(3*t),i=new Array(t),r=0;r<t;r++){var a=3*r*4,n=new Float32Array(e.buffer,a,3);i[r]=n}return 1===t?i[0]:i},t.prototype.readRgba=function(t){null==t&&(t=1);for(var e=this.readByteArray(4*t),i=new Array(t),r=0;r<t;r++){var a=4*r,n=new Uint8Array(e.buffer,a,4);i[r]=n}return 1===t?i[0]:i},t.prototype.readPackedNormal=function(t){null==t&&(t=1);for(var e=this.readUint8Array(2*t),i=new Array(t),r=0;r<t;r++){var a=new Uint8Array(e.buffer,2*r,2);i[r]=a}return 1===t?i[0]:i},t.prototype.readMatrix4x4=function(t){null==t&&(t=1);for(var e=this.readFloat32Array(16*t),i=new Array(t),r=0;r<t;r++){var a=16*r*4,n=new Float32Array(e.buffer,a,16);i[r]=n}return 1===t?i[0]:i},t.prototype.readMatrix4x4_64=function(t){null==t&&(t=1);for(var e=this.readFloat64Array(16*t),i=new Array(t),r=0;r<t;r++){var a=16*r*8,n=new Float64Array(e.buffer,a,16);i[r]=n}return 1===t?i[0]:i},t.prototype.readData=function(t){var e=this.move(t);return this._buffer.slice(e,e+t)},t}();e.BinaryReader=r},function(t,e,i){"use strict";Object.defineProperty(e,"__esModule",{value:!0});!function(t){t[t.IFCDISTRIBUTIONELEMENT=44]="IFCDISTRIBUTIONELEMENT",t[t.IFCDISTRIBUTIONFLOWELEMENT=45]="IFCDISTRIBUTIONFLOWELEMENT",t[t.IFCDISTRIBUTIONCHAMBERELEMENT=180]="IFCDISTRIBUTIONCHAMBERELEMENT",t[t.IFCENERGYCONVERSIONDEVICE=175]="IFCENERGYCONVERSIONDEVICE",t[t.IFCAIRTOAIRHEATRECOVERY=1097]="IFCAIRTOAIRHEATRECOVERY",t[t.IFCBOILER=1105]="IFCBOILER",t[t.IFCBURNER=1109]="IFCBURNER",t[t.IFCCHILLER=1119]="IFCCHILLER",t[t.IFCCOIL=1124]="IFCCOIL",t[t.IFCCONDENSER=1132]="IFCCONDENSER",t[t.IFCCOOLEDBEAM=1141]="IFCCOOLEDBEAM",t[t.IFCCOOLINGTOWER=1142]="IFCCOOLINGTOWER",t[t.IFCENGINE=1164]="IFCENGINE",t[t.IFCEVAPORATIVECOOLER=1166]="IFCEVAPORATIVECOOLER",t[t.IFCEVAPORATOR=1167]="IFCEVAPORATOR",t[t.IFCHEATEXCHANGER=1187]="IFCHEATEXCHANGER",t[t.IFCHUMIDIFIER=1188]="IFCHUMIDIFIER",t[t.IFCTUBEBUNDLE=1305]="IFCTUBEBUNDLE",t[t.IFCUNITARYEQUIPMENT=1310]="IFCUNITARYEQUIPMENT",t[t.IFCELECTRICGENERATOR=1160]="IFCELECTRICGENERATOR",t[t.IFCELECTRICMOTOR=1161]="IFCELECTRICMOTOR",t[t.IFCMOTORCONNECTION=1216]="IFCMOTORCONNECTION",t[t.IFCSOLARDEVICE=1270]="IFCSOLARDEVICE",t[t.IFCTRANSFORMER=1303]="IFCTRANSFORMER",t[t.IFCFLOWCONTROLLER=121]="IFCFLOWCONTROLLER",t[t.IFCELECTRICDISTRIBUTIONPOINT=242]="IFCELECTRICDISTRIBUTIONPOINT",t[t.IFCAIRTERMINALBOX=1096]="IFCAIRTERMINALBOX",t[t.IFCDAMPER=1148]="IFCDAMPER",t[t.IFCFLOWMETER=1182]="IFCFLOWMETER",t[t.IFCVALVE=1311]="IFCVALVE",t[t.IFCELECTRICDISTRIBUTIONBOARD=1157]="IFCELECTRICDISTRIBUTIONBOARD",t[t.IFCELECTRICTIMECONTROL=1162]="IFCELECTRICTIMECONTROL",t[t.IFCPROTECTIVEDEVICE=1235]="IFCPROTECTIVEDEVICE",t[t.IFCSWITCHINGDEVICE=1290]="IFCSWITCHINGDEVICE",t[t.IFCFLOWFITTING=467]="IFCFLOWFITTING",t[t.IFCDUCTFITTING=1153]="IFCDUCTFITTING",t[t.IFCPIPEFITTING=1222]="IFCPIPEFITTING",t[t.IFCCABLECARRIERFITTING=1111]="IFCCABLECARRIERFITTING",t[t.IFCCABLEFITTING=1113]="IFCCABLEFITTING",t[t.IFCJUNCTIONBOX=1195]="IFCJUNCTIONBOX",t[t.IFCFLOWMOVINGDEVICE=502]="IFCFLOWMOVINGDEVICE",t[t.IFCCOMPRESSOR=1131]="IFCCOMPRESSOR",t[t.IFCFAN=1177]="IFCFAN",t[t.IFCPUMP=1238]="IFCPUMP",t[t.IFCFLOWSEGMENT=574]="IFCFLOWSEGMENT",t[t.IFCDUCTSEGMENT=1154]="IFCDUCTSEGMENT",t[t.IFCPIPESEGMENT=1223]="IFCPIPESEGMENT",t[t.IFCCABLECARRIERSEGMENT=1112]="IFCCABLECARRIERSEGMENT",t[t.IFCCABLESEGMENT=1115]="IFCCABLESEGMENT",t[t.IFCFLOWSTORAGEDEVICE=371]="IFCFLOWSTORAGEDEVICE",t[t.IFCTANK=1293]="IFCTANK",t[t.IFCELECTRICFLOWSTORAGEDEVICE=1159]="IFCELECTRICFLOWSTORAGEDEVICE",t[t.IFCFLOWTERMINAL=46]="IFCFLOWTERMINAL",t[t.IFCFIRESUPPRESSIONTERMINAL=1179]="IFCFIRESUPPRESSIONTERMINAL",t[t.IFCSANITARYTERMINAL=1262]="IFCSANITARYTERMINAL",t[t.IFCSTACKTERMINAL=1277]="IFCSTACKTERMINAL",t[t.IFCWASTETERMINAL=1315]="IFCWASTETERMINAL",t[t.IFCAIRTERMINAL=1095]="IFCAIRTERMINAL",t[t.IFCMEDICALDEVICE=1212]="IFCMEDICALDEVICE",t[t.IFCSPACEHEATER=1272]="IFCSPACEHEATER",t[t.IFCAUDIOVISUALAPPLIANCE=1099]="IFCAUDIOVISUALAPPLIANCE",t[t.IFCCOMMUNICATIONSAPPLIANCE=1127]="IFCCOMMUNICATIONSAPPLIANCE",t[t.IFCELECTRICAPPLIANCE=1156]="IFCELECTRICAPPLIANCE",t[t.IFCLAMP=1198]="IFCLAMP",t[t.IFCLIGHTFIXTURE=1199]="IFCLIGHTFIXTURE",t[t.IFCOUTLET=1219]="IFCOUTLET",t[t.IFCFLOWTREATMENTDEVICE=425]="IFCFLOWTREATMENTDEVICE",t[t.IFCINTERCEPTOR=1193]="IFCINTERCEPTOR",t[t.IFCDUCTSILENCER=1155]="IFCDUCTSILENCER",t[t.IFCFILTER=1178]="IFCFILTER",t[t.IFCDISTRIBUTIONCONTROLELEMENT=468]="IFCDISTRIBUTIONCONTROLELEMENT",t[t.IFCPROTECTIVEDEVICETRIPPINGUNIT=1236]="IFCPROTECTIVEDEVICETRIPPINGUNIT",t[t.IFCACTUATOR=1091]="IFCACTUATOR",t[t.IFCALARM=1098]="IFCALARM",t[t.IFCCONTROLLER=1139]="IFCCONTROLLER",t[t.IFCFLOWINSTRUMENT=1181]="IFCFLOWINSTRUMENT",t[t.IFCSENSOR=1264]="IFCSENSOR",t[t.IFCUNITARYCONTROLELEMENT=1308]="IFCUNITARYCONTROLELEMENT",t[t.IFCDISCRETEACCESSORY=423]="IFCDISCRETEACCESSORY",t[t.IFCFASTENER=535]="IFCFASTENER",t[t.IFCMECHANICALFASTENER=536]="IFCMECHANICALFASTENER",t[t.IFCREINFORCINGBAR=571]="IFCREINFORCINGBAR",t[t.IFCREINFORCINGMESH=531]="IFCREINFORCINGMESH",t[t.IFCTENDON=261]="IFCTENDON",t[t.IFCTENDONANCHOR=675]="IFCTENDONANCHOR",t[t.IFCBUILDINGELEMENTPART=220]="IFCBUILDINGELEMENTPART",t[t.IFCVIBRATIONISOLATOR=1312]="IFCVIBRATIONISOLATOR",t[t.IFCCHAMFEREDGEFEATURE=765]="IFCCHAMFEREDGEFEATURE",t[t.IFCROUNDEDEDGEFEATURE=766]="IFCROUNDEDEDGEFEATURE",t[t.IFCOPENINGELEMENT=498]="IFCOPENINGELEMENT",t[t.IFCOPENINGSTANDARDCASE=1217]="IFCOPENINGSTANDARDCASE",t[t.IFCVOIDINGFEATURE=1313]="IFCVOIDINGFEATURE",t[t.IFCPROJECTIONELEMENT=384]="IFCPROJECTIONELEMENT",t[t.IFCSURFACEFEATURE=1287]="IFCSURFACEFEATURE",t[t.IFCFOOTING=120]="IFCFOOTING",t[t.IFCPILE=572]="IFCPILE",t[t.IFCBEAM=171]="IFCBEAM",t[t.IFCBEAMSTANDARDCASE=1104]="IFCBEAMSTANDARDCASE",t[t.IFCCOLUMN=383]="IFCCOLUMN",t[t.IFCCOLUMNSTANDARDCASE=1126]="IFCCOLUMNSTANDARDCASE",t[t.IFCCURTAINWALL=456]="IFCCURTAINWALL",t[t.IFCDOOR=213]="IFCDOOR",t[t.IFCDOORSTANDARDCASE=1151]="IFCDOORSTANDARDCASE",t[t.IFCMEMBER=310]="IFCMEMBER",t[t.IFCMEMBERSTANDARDCASE=1214]="IFCMEMBERSTANDARDCASE",t[t.IFCPLATE=351]="IFCPLATE",t[t.IFCPLATESTANDARDCASE=1224]="IFCPLATESTANDARDCASE",t[t.IFCRAILING=350]="IFCRAILING",t[t.IFCRAMP=414]="IFCRAMP",t[t.IFCRAMPFLIGHT=348]="IFCRAMPFLIGHT",t[t.IFCROOF=347]="IFCROOF",t[t.IFCSLAB=99]="IFCSLAB",t[t.IFCSLABELEMENTEDCASE=1268]="IFCSLABELEMENTEDCASE",t[t.IFCSLABSTANDARDCASE=1269]="IFCSLABSTANDARDCASE",t[t.IFCSTAIR=346]="IFCSTAIR",t[t.IFCSTAIRFLIGHT=25]="IFCSTAIRFLIGHT",t[t.IFCWALL=452]="IFCWALL",t[t.IFCWALLSTANDARDCASE=453]="IFCWALLSTANDARDCASE",t[t.IFCWALLELEMENTEDCASE=1314]="IFCWALLELEMENTEDCASE",t[t.IFCWINDOW=667]="IFCWINDOW",t[t.IFCWINDOWSTANDARDCASE=1316]="IFCWINDOWSTANDARDCASE",t[t.IFCBUILDINGELEMENTPROXY=560]="IFCBUILDINGELEMENTPROXY",t[t.IFCCOVERING=382]="IFCCOVERING",t[t.IFCCHIMNEY=1120]="IFCCHIMNEY",t[t.IFCSHADINGDEVICE=1265]="IFCSHADINGDEVICE",t[t.IFCELEMENTASSEMBLY=18]="IFCELEMENTASSEMBLY",t[t.IFCFURNISHINGELEMENT=253]="IFCFURNISHINGELEMENT",t[t.IFCFURNITURE=1184]="IFCFURNITURE",t[t.IFCSYSTEMFURNITUREELEMENT=1291]="IFCSYSTEMFURNITUREELEMENT",t[t.IFCTRANSPORTELEMENT=416]="IFCTRANSPORTELEMENT",t[t.IFCVIRTUALELEMENT=168]="IFCVIRTUALELEMENT",t[t.IFCELECTRICALELEMENT=23]="IFCELECTRICALELEMENT",t[t.IFCEQUIPMENTELEMENT=212]="IFCEQUIPMENTELEMENT",t[t.IFCCIVILELEMENT=1122]="IFCCIVILELEMENT",t[t.IFCGEOGRAPHICELEMENT=1185]="IFCGEOGRAPHICELEMENT",t[t.IFCDISTRIBUTIONPORT=178]="IFCDISTRIBUTIONPORT",t[t.IFCPROXY=447]="IFCPROXY",t[t.IFCSTRUCTURALLINEARACTION=463]="IFCSTRUCTURALLINEARACTION",t[t.IFCSTRUCTURALLINEARACTIONVARYING=464]="IFCSTRUCTURALLINEARACTIONVARYING",t[t.IFCSTRUCTURALPLANARACTION=39]="IFCSTRUCTURALPLANARACTION",t[t.IFCSTRUCTURALPLANARACTIONVARYING=357]="IFCSTRUCTURALPLANARACTIONVARYING",t[t.IFCSTRUCTURALPOINTACTION=356]="IFCSTRUCTURALPOINTACTION",t[t.IFCSTRUCTURALCURVEACTION=1279]="IFCSTRUCTURALCURVEACTION",t[t.IFCSTRUCTURALSURFACEACTION=1284]="IFCSTRUCTURALSURFACEACTION",t[t.IFCSTRUCTURALPOINTREACTION=354]="IFCSTRUCTURALPOINTREACTION",t[t.IFCSTRUCTURALCURVEREACTION=1280]="IFCSTRUCTURALCURVEREACTION",t[t.IFCSTRUCTURALSURFACEREACTION=1285]="IFCSTRUCTURALSURFACEREACTION",t[t.IFCSTRUCTURALCURVECONNECTION=534]="IFCSTRUCTURALCURVECONNECTION",t[t.IFCSTRUCTURALPOINTCONNECTION=533]="IFCSTRUCTURALPOINTCONNECTION",t[t.IFCSTRUCTURALSURFACECONNECTION=264]="IFCSTRUCTURALSURFACECONNECTION",t[t.IFCSTRUCTURALCURVEMEMBER=224]="IFCSTRUCTURALCURVEMEMBER",t[t.IFCSTRUCTURALCURVEMEMBERVARYING=227]="IFCSTRUCTURALCURVEMEMBERVARYING",t[t.IFCSTRUCTURALSURFACEMEMBER=420]="IFCSTRUCTURALSURFACEMEMBER",t[t.IFCSTRUCTURALSURFACEMEMBERVARYING=421]="IFCSTRUCTURALSURFACEMEMBERVARYING",t[t.IFCANNOTATION=634]="IFCANNOTATION",t[t.IFCBUILDING=169]="IFCBUILDING",t[t.IFCBUILDINGSTOREY=459]="IFCBUILDINGSTOREY",t[t.IFCSITE=349]="IFCSITE",t[t.IFCSPACE=454]="IFCSPACE",t[t.IFCGRID=564]="IFCGRID",t[t.IFCEXTERNALSPATIALELEMENT=1174]="IFCEXTERNALSPATIALELEMENT",t[t.IFCSPATIALZONE=1275]="IFCSPATIALZONE"}(e.ProductType||(e.ProductType={}))},function(t,e,i){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=i(1),a=i(5),n=i(0),o=i(2),s=function(){function t(){this.meter=1e3,this.productMaps={}}return t.prototype.parse=function(t){var e=this,i=t;if(94132117!=i.readInt32())throw"Magic number mismatch.";var r=i.readByte(),s=i.readInt32(),A=i.readInt32(),c=i.readInt32(),u=i.readInt32(),l=i.readInt32(),f=i.readInt32();this.meter=i.readFloat32();var d=i.readInt16(),T=function(t,e){if(void 0===t||void 0===e)throw"Wrong arguments";if(0==e)return 0;for(var i=e*t,r=Math.ceil(Math.sqrt(i/4));4*r%t!=0;)r++;return r*r*4/t};this.vertices=new Float32Array(T(4,3*A)),this.normals=new Uint8Array(6*c),this.indices=new Float32Array(3*c),this.styleIndices=new Uint16Array(3*c),this.styles=new Uint8Array(T(1,4*(f+1))),this.products=new Float32Array(3*c),this.states=new Uint8Array(3*c*2),this.transformations=new Float32Array(3*c),this.matrices=new Float32Array(T(4,16*u)),this.productMaps={},this.regions=new Array(d);for(var I=0,E=0,C=3*c,m=0,p=0,g=n.State,v=o.ProductType,R=0;R<d;R++){var _=new h;_.population=i.readInt32(),_.centre=i.readFloat32Array(3),_.bbox=i.readFloat32Array(6),this.regions[R]=_}var M=[];M.getStyle=function(t){for(var e=0;e<this.length;e++){var i=this[e];if(i.id==t)return i}return null};var b=0;for(b;b<f;b++){var F=i.readInt32(),O=255*i.readFloat32(),B=255*i.readFloat32(),S=255*i.readFloat32(),L=255*i.readFloat32();this.styles.set([O,B,S,L],4*b),M.push({id:F,index:b,transparent:L<254})}this.styles.set([255,255,255,255],4*b);var N={id:-1,index:b,transparent:L<254};M.push(N);for(var R=0;R<l;R++){var P=i.readInt32(),y=i.readInt16(),x=i.readFloat32Array(6),w={productID:P,type:y,bBox:x,spans:[]};this.productMaps[P]=w}for(var U=0;U<s;U++){for(var D=i.readInt32(),G=[],H=0;H<D;H++){var Y=i.readInt32(),k=(i.readInt16(),i.readInt32()),F=i.readInt32(),X=null;D>1&&(X=1===r?i.readFloat32Array(16):i.readFloat64Array(16),this.matrices.set(X,p),p+=16);var K=M.getStyle(F);null===K&&(K=N),G.push({pLabel:Y,iLabel:k,style:K.index,transparent:K.transparent,transform:null!=X?m++:-1})}var V=new a.TriangulatedShape;V.parse(i),G.forEach(function(t){var i=0;i=t.transparent?C-V.indices.length:E;var r=i,a=e.productMaps[t.pLabel];void 0===a&&(a={productID:0,type:v.IFCOPENINGELEMENT,bBox:new Float32Array(6),spans:[]},e.productMaps[t.pLabel]=a),e.normals.set(V.normals,2*i);for(var n=a.type==v.IFCSPACE||a.type==v.IFCOPENINGELEMENT?g.HIDDEN:255,o=0;o<V.indices.length;o++)e.indices[i]=V.indices[o]+I/3,e.products[i]=t.pLabel,e.styleIndices[i]=t.style,e.transformations[i]=t.transform,e.states[2*i]=n,e.states[2*i+1]=255,i++;var s=i;a.spans.push(new Int32Array([r,s])),t.transparent?C-=V.indices.length:E+=V.indices.length},this),this.vertices.set(V.vertices,I),I+=V.vertices.length,V=null}i.isEOF(),this.transparentIndex=E},t.prototype.load=function(t){var e=new r.BinaryReader,i=this;e.onloaded=function(){i.parse(e),i.onloaded&&i.onloaded(this)},e.onerror=function(t){i.onerror&&i.onerror(t)},e.load(t)},t}();e.ModelGeometry=s;var A=function(){function t(){}return t}();e.ProductMap=A;var h=function(){function t(t){this.population=-1,this.centre=null,this.bbox=null,t&&(this.population=t.population,this.centre=new Float32Array(t.centre),this.bbox=new Float32Array(t.bbox))}return t.prototype.clone=function(){var e=new t;return e.population=this.population,e.centre=new Float32Array(this.centre),e.bbox=new Float32Array(this.bbox),e},t.prototype.merge=function(e){if(-1===this.population&&null===this.centre&&null===this.bbox)return new t(e);var i=new t;i.population=this.population+e.population;var r=Math.min(this.bbox[0],e.bbox[0]),a=Math.min(this.bbox[1],e.bbox[1]),n=Math.min(this.bbox[2],e.bbox[2]),o=Math.min(this.bbox[0]+this.bbox[3],e.bbox[0]+e.bbox[3]),s=Math.min(this.bbox[1]+this.bbox[4],e.bbox[1]+e.bbox[4]),A=Math.min(this.bbox[2]+this.bbox[5],e.bbox[2]+e.bbox[5]),h=o-r,c=s-a,u=A-n,l=(r+o)/2,f=(a+s)/2,d=(n+A)/2;return i.bbox=new Float32Array([r,a,n,h,c,u]),i.centre=new Float32Array([l,f,d]),i},t}();e.Region=h},,function(t,e,i){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=i(1),a=function(){function t(){this.load=function(t){var e=new r.BinaryReader,i=this;e.onloaded=function(){i.parse(e),i.onloaded&&i.onloaded(this)},e.load(t)}}return t.prototype.parse=function(t){var e=this,i=(t.readByte(),t.readInt32()),r=t.readInt32();e.vertices=t.readFloat32Array(3*i),e.indices=new Uint32Array(3*r),e.normals=new Uint8Array(6*r);var a,n=0;a=i<=255?function(e){return t.readByteArray(e)}:i<=65535?function(e){return t.readUint16Array(e)}:function(e){return t.readInt32Array(e)};var o=t.readInt32();if(0!==i&&0!==r)for(var s=0;s<o;s++){var A=t.readInt32();if(0!=A){var h=A>0;if(A=Math.abs(A),h){var c=t.readByteArray(2),u=a(3*A);e.indices.set(u,n);for(var l=0;l<3*A;l++)e.normals[2*n]=c[0],e.normals[2*n+1]=c[1],n++}else for(var l=0;l<A;l++)e.indices[n]=a(),e.normals.set(t.readByteArray(2),2*n),n++,e.indices[n]=a(),e.normals.set(t.readByteArray(2),2*n),n++,e.indices[n]=a(),e.normals.set(t.readByteArray(2),2*n),n++}}},t}();e.TriangulatedShape=a},,,,,,function(t,e,i){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=i(17),a=function(){function t(){}return t.create=function(){var t=new Float32Array(3);return t[0]=0,t[1]=0,t[2]=0,t},t.clone=function(t){var e=new Float32Array(3);return e[0]=t[0],e[1]=t[1],e[2]=t[2],e},t.fromValues=function(t,e,i){var r=new Float32Array(3);return r[0]=t,r[1]=e,r[2]=i,r},t.copy=function(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t},t.set=function(t,e,i,r){return t[0]=e,t[1]=i,t[2]=r,t},t.add=function(t,e,i){return t[0]=e[0]+i[0],t[1]=e[1]+i[1],t[2]=e[2]+i[2],t},t.subtract=function(t,e,i){return t[0]=e[0]-i[0],t[1]=e[1]-i[1],t[2]=e[2]-i[2],t},t.multiply=function(t,e,i){return t[0]=e[0]*i[0],t[1]=e[1]*i[1],t[2]=e[2]*i[2],t},t.divide=function(t,e,i){return t[0]=e[0]/i[0],t[1]=e[1]/i[1],t[2]=e[2]/i[2],t},t.ceil=function(t,e){return t[0]=Math.ceil(e[0]),t[1]=Math.ceil(e[1]),t[2]=Math.ceil(e[2]),t},t.floor=function(t,e){return t[0]=Math.floor(e[0]),t[1]=Math.floor(e[1]),t[2]=Math.floor(e[2]),t},t.min=function(t,e,i){return t[0]=Math.min(e[0],i[0]),t[1]=Math.min(e[1],i[1]),t[2]=Math.min(e[2],i[2]),t},t.max=function(t,e,i){return t[0]=Math.max(e[0],i[0]),t[1]=Math.max(e[1],i[1]),t[2]=Math.max(e[2],i[2]),t},t.round=function(t,e){return t[0]=Math.round(e[0]),t[1]=Math.round(e[1]),t[2]=Math.round(e[2]),t},t.scale=function(t,e,i){return t[0]=e[0]*i,t[1]=e[1]*i,t[2]=e[2]*i,t},t.scaleAndAdd=function(t,e,i,r){return t[0]=e[0]+i[0]*r,t[1]=e[1]+i[1]*r,t[2]=e[2]+i[2]*r,t},t.distance=function(t,e){var i=e[0]-t[0],r=e[1]-t[1],a=e[2]-t[2];return Math.sqrt(i*i+r*r+a*a)},t.squaredDistance=function(t,e){var i=e[0]-t[0],r=e[1]-t[1],a=e[2]-t[2];return i*i+r*r+a*a},t.vectorLength=function(t){var e=t[0],i=t[1],r=t[2];return Math.sqrt(e*e+i*i+r*r)},t.squaredLength=function(t){var e=t[0],i=t[1],r=t[2];return e*e+i*i+r*r},t.negate=function(t,e){return t[0]=-e[0],t[1]=-e[1],t[2]=-e[2],t},t.inverse=function(t,e){return t[0]=1/e[0],t[1]=1/e[1],t[2]=1/e[2],t},t.normalize=function(t,e){var i=e[0],r=e[1],a=e[2],n=i*i+r*r+a*a;return n>0&&(n=1/Math.sqrt(n),t[0]=e[0]*n,t[1]=e[1]*n,t[2]=e[2]*n),t},t.dot=function(t,e){return t[0]*e[0]+t[1]*e[1]+t[2]*e[2]},t.cross=function(t,e,i){var r=e[0],a=e[1],n=e[2],o=i[0],s=i[1],A=i[2];return t[0]=a*A-n*s,t[1]=n*o-r*A,t[2]=r*s-a*o,t},t.lerp=function(t,e,i,r){var a=e[0],n=e[1],o=e[2];return t[0]=a+r*(i[0]-a),t[1]=n+r*(i[1]-n),t[2]=o+r*(i[2]-o),t},t.hermite=function(t,e,i,r,a,n){var o=n*n,s=o*(2*n-3)+1,A=o*(n-2)+n,h=o*(n-1),c=o*(3-2*n);return t[0]=e[0]*s+i[0]*A+r[0]*h+a[0]*c,t[1]=e[1]*s+i[1]*A+r[1]*h+a[1]*c,t[2]=e[2]*s+i[2]*A+r[2]*h+a[2]*c,t},t.bezier=function(t,e,i,r,a,n){var o=1-n,s=o*o,A=n*n,h=s*o,c=3*n*s,u=3*A*o,l=A*n;return t[0]=e[0]*h+i[0]*c+r[0]*u+a[0]*l,t[1]=e[1]*h+i[1]*c+r[1]*u+a[1]*l,t[2]=e[2]*h+i[2]*c+r[2]*u+a[2]*l,t},t.random=function(t,e){e=e||1;var i=2*r.glMatrix.RANDOM()*Math.PI,a=2*r.glMatrix.RANDOM()-1,n=Math.sqrt(1-a*a)*e;return t[0]=Math.cos(i)*n,t[1]=Math.sin(i)*n,t[2]=a*e,t},t.transformMat4=function(t,e,i){var r=e[0],a=e[1],n=e[2],o=i[3]*r+i[7]*a+i[11]*n+i[15];return o=o||1,t[0]=(i[0]*r+i[4]*a+i[8]*n+i[12])/o,t[1]=(i[1]*r+i[5]*a+i[9]*n+i[13])/o,t[2]=(i[2]*r+i[6]*a+i[10]*n+i[14])/o,t},t.transformMat3=function(t,e,i){var r=e[0],a=e[1],n=e[2];return t[0]=r*i[0]+a*i[3]+n*i[6],t[1]=r*i[1]+a*i[4]+n*i[7],t[2]=r*i[2]+a*i[5]+n*i[8],t},t.transformQuat=function(t,e,i){var r=e[0],a=e[1],n=e[2],o=i[0],s=i[1],A=i[2],h=i[3],c=h*r+s*n-A*a,u=h*a+A*r-o*n,l=h*n+o*a-s*r,f=-o*r-s*a-A*n;return t[0]=c*h+f*-o+u*-A-l*-s,t[1]=u*h+f*-s+l*-o-c*-A,t[2]=l*h+f*-A+c*-s-u*-o,t},t.rotateX=function(t,e,i,r){var a=[],n=[];return a[0]=e[0]-i[0],a[1]=e[1]-i[1],a[2]=e[2]-i[2],n[0]=a[0],n[1]=a[1]*Math.cos(r)-a[2]*Math.sin(r),n[2]=a[1]*Math.sin(r)+a[2]*Math.cos(r),t[0]=n[0]+i[0],t[1]=n[1]+i[1],t[2]=n[2]+i[2],t},t.rotateY=function(t,e,i,r){var a=[],n=[];return a[0]=e[0]-i[0],a[1]=e[1]-i[1],a[2]=e[2]-i[2],n[0]=a[2]*Math.sin(r)+a[0]*Math.cos(r),n[1]=a[1],n[2]=a[2]*Math.cos(r)-a[0]*Math.sin(r),t[0]=n[0]+i[0],t[1]=n[1]+i[1],t[2]=n[2]+i[2],t},t.rotateZ=function(t,e,i,r){var a=[],n=[];return a[0]=e[0]-i[0],a[1]=e[1]-i[1],a[2]=e[2]-i[2],n[0]=a[0]*Math.cos(r)-a[1]*Math.sin(r),n[1]=a[0]*Math.sin(r)+a[1]*Math.cos(r),n[2]=a[2],t[0]=n[0]+i[0],t[1]=n[1]+i[1],t[2]=n[2]+i[2],t},t.angle=function(e,i){var r=t.fromValues(e[0],e[1],e[2]),a=t.fromValues(i[0],i[1],i[2]);t.normalize(r,r),t.normalize(a,a);var n=t.dot(r,a);return n>1?0:n<-1?Math.PI:Math.acos(n)},t.str=function(t){return"vec3("+t[0]+", "+t[1]+", "+t[2]+")"},t.exactEquals=function(t,e){return t[0]===e[0]&&t[1]===e[1]&&t[2]===e[2]},t.equals=function(t,e){var i=t[0],a=t[1],n=t[2],o=e[0],s=e[1],A=e[2];return Math.abs(i-o)<=r.glMatrix.EPSILON*Math.max(1,Math.abs(i),Math.abs(o))&&Math.abs(a-s)<=r.glMatrix.EPSILON*Math.max(1,Math.abs(a),Math.abs(s))&&Math.abs(n-A)<=r.glMatrix.EPSILON*Math.max(1,Math.abs(n),Math.abs(A))},t}();a.sub=a.subtract,a.mul=a.multiply,a.div=a.divide,a.dist=a.distance,a.sqrDist=a.squaredDistance,a.len=a.vectorLength,a.sqrLen=a.squaredLength,a.forEach=function(){var t=a.create();return function(e,i,r,a,n,o){var s,A;for(i||(i=3),r||(r=0),A=a?Math.min(a*i+r,e.length):e.length,s=r;s<A;s+=i)t[0]=e[s],t[1]=e[s+1],t[2]=e[s+2],n(t,t,o),e[s]=t[0],e[s+1]=t[1],e[s+2]=t[2];return e}}(),e.vec3=a},,,,function(t,e,i){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=i(3),a=i(0),n=function(){function t(e,i){var a=this;if(this.pickable=!0,void 0===e||void 0===i)throw"WebGL context and geometry model must be specified";this._gl=e,this.model=i,this.id=t._instancesNum++,this.stopped=!1,this._numberOfIndices=i.indices.length,this._vertexTexture=e.createTexture(),this._matrixTexture=e.createTexture(),this._styleTexture=e.createTexture(),this._vertexTextureSize=0,this._matrixTextureSize=0,this._styleTextureSize=0,this._normalBuffer=e.createBuffer(),this._indexBuffer=e.createBuffer(),this._productBuffer=e.createBuffer(),this._styleBuffer=e.createBuffer(),this._stateBuffer=e.createBuffer(),this._transformationBuffer=e.createBuffer(),this._feedCompleted=!1,this.region=i.regions[0],i.regions.forEach(function(t){t.population>a.region.population&&(a.region=t)}),void 0===this.region&&(this.region=new r.Region,this.region.population=1,this.region.centre=new Float32Array([0,0,0]),this.region.bbox=new Float32Array([0,0,0,10*i.meter,10*i.meter,10*i.meter]))}return t.prototype.setActive=function(t){if(!this.stopped){var e=this._gl;this._vertexTextureSize>0&&(e.activeTexture(e.TEXTURE1),e.bindTexture(e.TEXTURE_2D,this._vertexTexture),e.uniform1i(t.VertexSamplerUniform,1)),this._matrixTextureSize>0&&(e.activeTexture(e.TEXTURE2),e.bindTexture(e.TEXTURE_2D,this._matrixTexture),e.uniform1i(t.MatrixSamplerUniform,2)),this._styleTextureSize>0&&(e.activeTexture(e.TEXTURE3),e.bindTexture(e.TEXTURE_2D,this._styleTexture),e.uniform1i(t.StyleSamplerUniform,3)),e.bindBuffer(e.ARRAY_BUFFER,this._normalBuffer),e.vertexAttribPointer(t.NormalAttrPointer,2,e.UNSIGNED_BYTE,!1,0,0),e.bindBuffer(e.ARRAY_BUFFER,this._indexBuffer),e.vertexAttribPointer(t.IndexlAttrPointer,1,e.FLOAT,!1,0,0),e.bindBuffer(e.ARRAY_BUFFER,this._productBuffer),e.vertexAttribPointer(t.ProductAttrPointer,1,e.FLOAT,!1,0,0),e.bindBuffer(e.ARRAY_BUFFER,this._stateBuffer),e.vertexAttribPointer(t.StateAttrPointer,2,e.UNSIGNED_BYTE,!1,0,0),e.bindBuffer(e.ARRAY_BUFFER,this._styleBuffer),e.vertexAttribPointer(t.StyleAttrPointer,1,e.UNSIGNED_SHORT,!1,0,0),e.bindBuffer(e.ARRAY_BUFFER,this._transformationBuffer),e.vertexAttribPointer(t.TransformationAttrPointer,1,e.FLOAT,!1,0,0),e.uniform1i(t.VertexTextureSizeUniform,this._vertexTextureSize),e.uniform1i(t.MatrixTextureSizeUniform,this._matrixTextureSize),e.uniform1i(t.StyleTextureSizeUniform,this._styleTextureSize)}},t.prototype.draw=function(t){if(!this.stopped){var e=this._gl;return void 0===t?void e.drawArrays(e.TRIANGLES,0,this._numberOfIndices):"solid"===t&&this.model.transparentIndex>0?void e.drawArrays(e.TRIANGLES,0,this.model.transparentIndex):"transparent"===t&&this.model.transparentIndex<this._numberOfIndices?(e.depthMask(!1),e.drawArrays(e.TRIANGLES,this.model.transparentIndex,this._numberOfIndices-this.model.transparentIndex),void e.depthMask(!0)):void 0}},t.prototype.drawProduct=function(t){if(!this.stopped){var e=this._gl,i=this.getProductMap(t);null!=i&&i.spans.forEach(function(t){e.drawArrays(e.TRIANGLES,t[0],t[1]-t[0])},this)}},t.prototype.getProductMap=function(t){var e=this.model.productMaps[t];return void 0!==e?e:null},t.prototype.getProductMaps=function(t){var e=this,i=new Array;return t.forEach(function(t){var r=e.model.productMaps[t];void 0!==r&&i.push(r)}),i},t.prototype.unload=function(){var t=this._gl;t.deleteTexture(this._vertexTexture),t.deleteTexture(this._matrixTexture),t.deleteTexture(this._styleTexture),t.deleteBuffer(this._normalBuffer),t.deleteBuffer(this._indexBuffer),t.deleteBuffer(this._productBuffer),t.deleteBuffer(this._styleBuffer),t.deleteBuffer(this._stateBuffer),t.deleteBuffer(this._transformationBuffer)},t.prototype.feedGPU=function(){if(this._feedCompleted)throw"GPU can bee fed only once. It discards unnecessary data which cannot be restored again.";var e=this._gl,i=this.model;this.bufferData(this._normalBuffer,i.normals),this.bufferData(this._indexBuffer,i.indices),this.bufferData(this._productBuffer,i.products),this.bufferData(this._stateBuffer,i.states),this.bufferData(this._transformationBuffer,i.transformations),this.bufferData(this._styleBuffer,i.styleIndices),this._vertexTextureSize=t.bufferTexture(e,this._vertexTexture,i.vertices,3),this._matrixTextureSize=t.bufferTexture(e,this._matrixTexture,i.matrices,4),this._styleTextureSize=t.bufferTexture(e,this._styleTexture,i.styles),i.normals=null,i.indices=null,i.products=null,i.transformations=null,i.styleIndices=null,i.vertices=null,i.matrices=null,this._feedCompleted=!0},t.prototype.bufferData=function(t,e){var i=this._gl;i.bindBuffer(i.ARRAY_BUFFER,t),i.bufferData(i.ARRAY_BUFFER,e,i.STATIC_DRAW)},t.bufferTexture=function(t,e,i,r){if(0==i.length){t.bindTexture(t.TEXTURE_2D,e);var a=new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]);return t.texImage2D(t.TEXTURE_2D,0,t.RGBA,2,2,0,t.RGBA,t.UNSIGNED_BYTE,a),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MAG_FILTER,t.NEAREST),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MIN_FILTER,t.NEAREST),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_WRAP_S,t.CLAMP_TO_EDGE),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_WRAP_T,t.CLAMP_TO_EDGE),2}var n=i instanceof Float32Array,o=0,s=t.getParameter(t.MAX_TEXTURE_SIZE);if(n)o=Math.ceil(Math.sqrt(Math.ceil(i.length/r)))+1;else{var A=Math.sqrt(i.byteLength/4);o=Math.ceil(A)}if(0==o)return 0;if(o>s)throw"Too much data! It cannot fit into the texture.";if(t.bindTexture(t.TEXTURE_2D,e),t.pixelStorei(t.UNPACK_FLIP_Y_WEBGL,0),t.pixelStorei(t.UNPACK_PREMULTIPLY_ALPHA_WEBGL,0),n){var h=null;o*o*r!=i.length?(h=new Float32Array(o*o*r),h.set(i)):h=i;var c=null;switch(r){case 1:c=t.ALPHA;break;case 3:c=t.RGB;break;case 4:c=t.RGBA}t.texImage2D(t.TEXTURE_2D,0,c,o,o,0,c,t.FLOAT,h)}else t.texImage2D(t.TEXTURE_2D,0,t.RGBA,o,o,0,t.RGBA,t.UNSIGNED_BYTE,new Uint8Array(i.buffer));return t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MAG_FILTER,t.NEAREST),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MIN_FILTER,t.NEAREST),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_WRAP_S,t.CLAMP_TO_EDGE),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_WRAP_T,t.CLAMP_TO_EDGE),o},t.prototype.getState=function(t){if(void 0===t)throw"id must be defined";var e=this.getProductMap(t);if(null===e)return null;var i=e.spans[0];return void 0===i?null:this.model.states[2*i[0]]},t.prototype.getStyle=function(t){if(void 0===t)throw"id must be defined";var e=this.getProductMap(t);if(null===e)return null;var i=e.spans[0];return void 0===i?null:this.model.states[2*i[0]+1]},t.prototype.setState=function(t,e){var i=this;if("number"!=typeof t&&t<0&&t>255)throw"You have to specify state as an ID of state or index in style pallete.";if(void 0===e)throw"You have to specify products as an array of product IDs or as a product type ID";var r=[];if("number"==typeof e)for(var a in this.model.productMaps){var n=this.model.productMaps[a];n.type==e&&r.push(n)}else for(var o=0;o<e.length;o++){var s=e[o],n=this.getProductMap(s);null!=n&&r.push(n)}var A=t<=225?1:0;r.forEach(function(e){e.spans.forEach(function(e){for(var r=e[0];r<e[1];r++)i.model.states[2*r+A]=t})}),this.bufferData(this._stateBuffer,this.model.states)},t.prototype.resetStates=function(){for(var t=0;t<this.model.states.length;t+=2)this.model.states[t]=a.State.UNDEFINED;this.bufferData(this._stateBuffer,this.model.states)},t.prototype.resetStyles=function(){for(var t=0;t<this.model.states.length;t+=2)this.model.states[t+1]=a.State.UNSTYLED;this.bufferData(this._stateBuffer,this.model.states)},t.prototype.getModelState=function(){var t=[],e=this.model.productMaps;for(var i in e)if(e.hasOwnProperty(i)){var r=e[i],a=r.spans[0];if(void 0!==a){var n=this.model.states[2*a[0]],o=this.model.states[2*a[0]+1];t.push([r.productID,n+(o<<8)])}}return t},t.prototype.restoreModelState=function(t){var e=this;t.forEach(function(t){var i=t[0],r=t[1]>>8,a=t[1]-(r<<8),n=e.getProductMap(i);null!=n&&n.spans.forEach(function(t){for(var i=t[0];i<t[1];i++)e.model.states[2*i]=a,e.model.states[2*i+1]=r})}),this.bufferData(this._stateBuffer,this.model.states)},t}();n._instancesNum=0,e.ModelHandle=n},function(t,e,i){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.ProductInheritance={name:"IfcProduct",id:20,abs:!0,children:[{name:"IfcElement",id:19,abs:!0,children:[{name:"IfcDistributionElement",id:44,abs:!1,children:[{name:"IfcDistributionFlowElement",id:45,abs:!1,children:[{name:"IfcDistributionChamberElement",id:180,abs:!1},{name:"IfcEnergyConversionDevice",id:175,abs:!1,children:[{name:"IfcAirToAirHeatRecovery",id:1097,abs:!1},{name:"IfcBoiler",id:1105,abs:!1},{name:"IfcBurner",id:1109,abs:!1},{name:"IfcChiller",id:1119,abs:!1},{name:"IfcCoil",id:1124,abs:!1},{name:"IfcCondenser",id:1132,abs:!1},{name:"IfcCooledBeam",id:1141,abs:!1},{name:"IfcCoolingTower",id:1142,abs:!1},{name:"IfcEngine",id:1164,abs:!1},{name:"IfcEvaporativeCooler",id:1166,abs:!1},{name:"IfcEvaporator",id:1167,abs:!1},{name:"IfcHeatExchanger",id:1187,abs:!1},{name:"IfcHumidifier",id:1188,abs:!1},{name:"IfcTubeBundle",id:1305,abs:!1},{name:"IfcUnitaryEquipment",id:1310,abs:!1},{name:"IfcElectricGenerator",id:1160,abs:!1},{name:"IfcElectricMotor",id:1161,abs:!1},{name:"IfcMotorConnection",id:1216,abs:!1},{name:"IfcSolarDevice",id:1270,abs:!1},{name:"IfcTransformer",id:1303,abs:!1}]},{name:"IfcFlowController",id:121,abs:!1,children:[{name:"IfcElectricDistributionPoint",id:242,abs:!1},{name:"IfcAirTerminalBox",id:1096,abs:!1},{name:"IfcDamper",id:1148,abs:!1},{name:"IfcFlowMeter",id:1182,abs:!1},{name:"IfcValve",id:1311,abs:!1},{name:"IfcElectricDistributionBoard",id:1157,abs:!1},{name:"IfcElectricTimeControl",id:1162,abs:!1},{name:"IfcProtectiveDevice",id:1235,abs:!1},{name:"IfcSwitchingDevice",id:1290,abs:!1}]},{name:"IfcFlowFitting",id:467,abs:!1,children:[{name:"IfcDuctFitting",id:1153,abs:!1},{name:"IfcPipeFitting",id:1222,abs:!1},{name:"IfcCableCarrierFitting",id:1111,abs:!1},{name:"IfcCableFitting",id:1113,abs:!1},{name:"IfcJunctionBox",id:1195,abs:!1}]},{name:"IfcFlowMovingDevice",id:502,abs:!1,children:[{name:"IfcCompressor",id:1131,abs:!1},{name:"IfcFan",id:1177,abs:!1},{name:"IfcPump",id:1238,abs:!1}]},{name:"IfcFlowSegment",id:574,abs:!1,children:[{name:"IfcDuctSegment",id:1154,abs:!1},{name:"IfcPipeSegment",id:1223,abs:!1},{name:"IfcCableCarrierSegment",id:1112,abs:!1},{name:"IfcCableSegment",id:1115,abs:!1}]},{name:"IfcFlowStorageDevice",id:371,abs:!1,children:[{name:"IfcTank",id:1293,abs:!1},{name:"IfcElectricFlowStorageDevice",id:1159,abs:!1}]},{name:"IfcFlowTerminal",id:46,abs:!1,children:[{name:"IfcFireSuppressionTerminal",id:1179,abs:!1},{name:"IfcSanitaryTerminal",id:1262,abs:!1},{name:"IfcStackTerminal",id:1277,abs:!1},{name:"IfcWasteTerminal",id:1315,abs:!1},{name:"IfcAirTerminal",id:1095,abs:!1},{name:"IfcMedicalDevice",id:1212,abs:!1},{name:"IfcSpaceHeater",id:1272,abs:!1},{name:"IfcAudioVisualAppliance",id:1099,abs:!1},{name:"IfcCommunicationsAppliance",id:1127,abs:!1},{name:"IfcElectricAppliance",id:1156,abs:!1},{name:"IfcLamp",id:1198,abs:!1},{name:"IfcLightFixture",id:1199,abs:!1},{name:"IfcOutlet",id:1219,abs:!1}]},{name:"IfcFlowTreatmentDevice",id:425,abs:!1,children:[{name:"IfcInterceptor",id:1193,abs:!1},{name:"IfcDuctSilencer",id:1155,abs:!1},{name:"IfcFilter",id:1178,abs:!1}]}]},{name:"IfcDistributionControlElement",id:468,abs:!1,children:[{name:"IfcProtectiveDeviceTrippingUnit",id:1236,abs:!1},{name:"IfcActuator",id:1091,abs:!1},{name:"IfcAlarm",id:1098,abs:!1},{name:"IfcController",id:1139,abs:!1},{name:"IfcFlowInstrument",id:1181,abs:!1},{name:"IfcSensor",id:1264,abs:!1},{name:"IfcUnitaryControlElement",id:1308,abs:!1}]}]},{name:"IfcElementComponent",id:424,abs:!0,children:[{name:"IfcDiscreteAccessory",id:423,abs:!1},{name:"IfcFastener",id:535,abs:!1,children:[{name:"IfcMechanicalFastener",id:536,abs:!1}]},{name:"IfcReinforcingElement",id:262,abs:!0,children:[{name:"IfcReinforcingBar",id:571,abs:!1},{name:"IfcReinforcingMesh",id:531,abs:!1},{name:"IfcTendon",id:261,abs:!1},{name:"IfcTendonAnchor",id:675,abs:!1}]},{name:"IfcBuildingElementPart",id:220,abs:!1},{name:"IfcMechanicalFastener",id:536,abs:!1},{name:"IfcVibrationIsolator",id:1312,abs:!1}]},{name:"IfcFeatureElement",id:386,abs:!0,children:[{name:"IfcFeatureElementSubtraction",id:499,abs:!0,children:[{name:"IfcEdgeFeature",id:764,abs:!0,children:[{name:"IfcChamferEdgeFeature",id:765,abs:!1},{name:"IfcRoundedEdgeFeature",id:766,abs:!1}]},{name:"IfcOpeningElement",id:498,abs:!1,children:[{name:"IfcOpeningStandardCase",id:1217,abs:!1}]},{name:"IfcVoidingFeature",id:1313,abs:!1}]},{name:"IfcFeatureElementAddition",id:385,abs:!0,children:[{name:"IfcProjectionElement",id:384,abs:!1}]},{name:"IfcSurfaceFeature",id:1287,abs:!1}]},{name:"IfcBuildingElement",id:26,abs:!0,children:[{name:"IfcBuildingElementComponent",id:221,abs:!0,children:[{name:"IfcBuildingElementPart",id:220,abs:!1},{name:"IfcReinforcingElement",id:262,abs:!0,children:[{name:"IfcReinforcingBar",id:571,abs:!1},{name:"IfcReinforcingMesh",id:531,abs:!1},{name:"IfcTendon",id:261,abs:!1},{name:"IfcTendonAnchor",id:675,abs:!1}]}]},{name:"IfcFooting",id:120,abs:!1},{name:"IfcPile",id:572,abs:!1},{name:"IfcBeam",id:171,abs:!1,children:[{name:"IfcBeamStandardCase",id:1104,abs:!1}]},{name:"IfcColumn",id:383,abs:!1,children:[{name:"IfcColumnStandardCase",id:1126,abs:!1}]},{name:"IfcCurtainWall",id:456,abs:!1},{name:"IfcDoor",id:213,abs:!1,children:[{name:"IfcDoorStandardCase",id:1151,abs:!1}]},{name:"IfcMember",id:310,abs:!1,children:[{name:"IfcMemberStandardCase",id:1214,abs:!1}]},{name:"IfcPlate",id:351,abs:!1,children:[{name:"IfcPlateStandardCase",id:1224,abs:!1}]},{name:"IfcRailing",id:350,abs:!1},{name:"IfcRamp",id:414,abs:!1},{name:"IfcRampFlight",id:348,abs:!1},{name:"IfcRoof",id:347,abs:!1},{name:"IfcSlab",id:99,abs:!1,children:[{name:"IfcSlabElementedCase",id:1268,abs:!1},{name:"IfcSlabStandardCase",id:1269,abs:!1}]},{name:"IfcStair",id:346,abs:!1},{name:"IfcStairFlight",id:25,abs:!1},{name:"IfcWall",id:452,abs:!1,children:[{name:"IfcWallStandardCase",id:453,abs:!1},{name:"IfcWallElementedCase",id:1314,abs:!1}]},{name:"IfcWindow",id:667,abs:!1,children:[{name:"IfcWindowStandardCase",id:1316,abs:!1}]},{name:"IfcBuildingElementProxy",id:560,abs:!1},{name:"IfcCovering",id:382,abs:!1},{name:"IfcChimney",id:1120,abs:!1},{name:"IfcShadingDevice",id:1265,abs:!1}]},{name:"IfcElementAssembly",id:18,abs:!1},{name:"IfcFurnishingElement",id:253,abs:!1,children:[{name:"IfcFurniture",id:1184,abs:!1},{name:"IfcSystemFurnitureElement",id:1291,abs:!1}]},{name:"IfcTransportElement",id:416,abs:!1},{name:"IfcVirtualElement",id:168,abs:!1},{name:"IfcElectricalElement",id:23,abs:!1},{name:"IfcEquipmentElement",id:212,abs:!1},{name:"IfcCivilElement",id:1122,abs:!1},{name:"IfcGeographicElement",id:1185,abs:!1}]},{name:"IfcPort",id:179,abs:!0,children:[{name:"IfcDistributionPort",id:178,abs:!1}]},{name:"IfcProxy",id:447,abs:!1},{name:"IfcStructuralActivity",id:41,abs:!0,children:[{name:"IfcStructuralAction",id:40,abs:!0,children:[{name:"IfcStructuralLinearAction",id:463,abs:!1,children:[{name:"IfcStructuralLinearActionVarying",id:464,abs:!1}]},{name:"IfcStructuralPlanarAction",id:39,abs:!1,children:[{name:"IfcStructuralPlanarActionVarying",id:357,abs:!1}]},{name:"IfcStructuralPointAction",id:356,abs:!1},{name:"IfcStructuralCurveAction",id:1279,abs:!1,children:[{name:"IfcStructuralLinearAction",id:463,abs:!1}]},{name:"IfcStructuralSurfaceAction",id:1284,abs:!1,children:[{name:"IfcStructuralPlanarAction",id:39,abs:!1}]}]},{name:"IfcStructuralReaction",id:355,abs:!0,children:[{name:"IfcStructuralPointReaction",id:354,abs:!1},{name:"IfcStructuralCurveReaction",id:1280,abs:!1},{name:"IfcStructuralSurfaceReaction",id:1285,abs:!1}]}]},{name:"IfcStructuralItem",id:226,abs:!0,children:[{name:"IfcStructuralConnection",id:265,abs:!0,children:[{name:"IfcStructuralCurveConnection",id:534,abs:!1},{name:"IfcStructuralPointConnection",id:533,abs:!1},{name:"IfcStructuralSurfaceConnection",id:264,abs:!1}]},{name:"IfcStructuralMember",id:225,abs:!0,children:[{name:"IfcStructuralCurveMember",id:224,abs:!1,children:[{name:"IfcStructuralCurveMemberVarying",id:227,abs:!1}]},{name:"IfcStructuralSurfaceMember",id:420,abs:!1,children:[{name:"IfcStructuralSurfaceMemberVarying",id:421,abs:!1}]}]}]},{name:"IfcAnnotation",id:634,abs:!1},{name:"IfcSpatialStructureElement",id:170,abs:!0,children:[{name:"IfcBuilding",id:169,abs:!1},{name:"IfcBuildingStorey",id:459,abs:!1},{name:"IfcSite",id:349,abs:!1},{name:"IfcSpace",id:454,abs:!1}]},{name:"IfcGrid",id:564,abs:!1},{name:"IfcSpatialElement",id:1273,abs:!0,children:[{name:"IfcSpatialStructureElement",id:170,abs:!0,children:[{name:"IfcBuilding",id:169,abs:!1},{name:"IfcBuildingStorey",id:459,abs:!1},{name:"IfcSite",id:349,abs:!1},{name:"IfcSpace",id:454,abs:!1}]},{name:"IfcExternalSpatialStructureElement",id:1175,abs:!0,children:[{name:"IfcExternalSpatialElement",id:1174,abs:!1}]},{name:"IfcSpatialZone",id:1275,abs:!1}]}]}},function(t,e,i){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=function(){function t(){}return t.setMatrixArrayType=function(e){t.ARRAY_TYPE=e},t.toRadian=function(e){return e*t.degree},t.equals=function(e,i){return Math.abs(e-i)<=t.EPSILON*Math.max(1,Math.abs(e),Math.abs(i))},t}();r.EPSILON=1e-6,r.ARRAY_TYPE="undefined"!=typeof Float32Array?Float32Array:Array,r.RANDOM=Math.random,r.ENABLE_SIMD=!1,r.SIMD_AVAILABLE=r.ARRAY_TYPE===Float32Array&&void 0!==window.SIMD,r.USE_SIMD=r.ENABLE_SIMD&&r.SIMD_AVAILABLE,r.degree=Math.PI/180,e.glMatrix=r},function(t,e,i){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=function(){function t(){}return t.fromMat4=function(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[4],t[4]=e[5],t[5]=e[6],t[6]=e[8],t[7]=e[9],t[8]=e[10],t},t}();r.create=function(){var t=new Float32Array(9);return t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=1,t[5]=0,t[6]=0,t[7]=0,t[8]=1,t},e.mat3=r},function(t,e,i){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=i(17),a=function(){function t(){}return t.create=function(){var t=new Float32Array(16);return t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=1,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=1,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t},t.clone=function(t){var e=new Float32Array(16);return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e[6]=t[6],e[7]=t[7],e[8]=t[8],e[9]=t[9],e[10]=t[10],e[11]=t[11],e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15],e},t.copy=function(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t[9]=e[9],t[10]=e[10],t[11]=e[11],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15],t},t.fromValues=function(t,e,i,r,a,n,o,s,A,h,c,u,l,f,d,T){var I=new Float32Array(16);return I[0]=t,I[1]=e,I[2]=i,I[3]=r,I[4]=a,I[5]=n,I[6]=o,I[7]=s,I[8]=A,I[9]=h,I[10]=c,I[11]=u,I[12]=l,I[13]=f,I[14]=d,I[15]=T,I},t.set=function(t,e,i,r,a,n,o,s,A,h,c,u,l,f,d,T,I){return t[0]=e,t[1]=i,t[2]=r,t[3]=a,t[4]=n,t[5]=o,t[6]=s,t[7]=A,t[8]=h,t[9]=c,t[10]=u,t[11]=l,t[12]=f,t[13]=d,t[14]=T,t[15]=I,t},t.identity=function(t){return t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=1,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=1,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t},t.transpose=function(t,e){if(t===e){var i=e[1],r=e[2],a=e[3],n=e[6],o=e[7],s=e[11];t[1]=e[4],t[2]=e[8],t[3]=e[12],t[4]=i,t[6]=e[9],t[7]=e[13],t[8]=r,t[9]=n,t[11]=e[14],t[12]=a,t[13]=o,t[14]=s}else t[0]=e[0],t[1]=e[4],t[2]=e[8],t[3]=e[12],t[4]=e[1],t[5]=e[5],t[6]=e[9],t[7]=e[13],t[8]=e[2],t[9]=e[6],t[10]=e[10],t[11]=e[14],t[12]=e[3],t[13]=e[7],t[14]=e[11],t[15]=e[15];return t},t.invert=function(t,e){var i=e[0],r=e[1],a=e[2],n=e[3],o=e[4],s=e[5],A=e[6],h=e[7],c=e[8],u=e[9],l=e[10],f=e[11],d=e[12],T=e[13],I=e[14],E=e[15],C=i*s-r*o,m=i*A-a*o,p=i*h-n*o,g=r*A-a*s,v=r*h-n*s,R=a*h-n*A,_=c*T-u*d,M=c*I-l*d,b=c*E-f*d,F=u*I-l*T,O=u*E-f*T,B=l*E-f*I,S=C*B-m*O+p*F+g*b-v*M+R*_;return S?(S=1/S,t[0]=(s*B-A*O+h*F)*S,t[1]=(a*O-r*B-n*F)*S,t[2]=(T*R-I*v+E*g)*S,t[3]=(l*v-u*R-f*g)*S,t[4]=(A*b-o*B-h*M)*S,t[5]=(i*B-a*b+n*M)*S,t[6]=(I*p-d*R-E*m)*S,t[7]=(c*R-l*p+f*m)*S,t[8]=(o*O-s*b+h*_)*S,t[9]=(r*b-i*O-n*_)*S,t[10]=(d*v-T*p+E*C)*S,t[11]=(u*p-c*v-f*C)*S,t[12]=(s*M-o*F-A*_)*S,t[13]=(i*F-r*M+a*_)*S,t[14]=(T*m-d*g-I*C)*S,t[15]=(c*g-u*m+l*C)*S,t):null},t.adjoint=function(t,e){var i=e[0],r=e[1],a=e[2],n=e[3],o=e[4],s=e[5],A=e[6],h=e[7],c=e[8],u=e[9],l=e[10],f=e[11],d=e[12],T=e[13],I=e[14],E=e[15];return t[0]=s*(l*E-f*I)-u*(A*E-h*I)+T*(A*f-h*l),t[1]=-(r*(l*E-f*I)-u*(a*E-n*I)+T*(a*f-n*l)),t[2]=r*(A*E-h*I)-s*(a*E-n*I)+T*(a*h-n*A),t[3]=-(r*(A*f-h*l)-s*(a*f-n*l)+u*(a*h-n*A)),t[4]=-(o*(l*E-f*I)-c*(A*E-h*I)+d*(A*f-h*l)),t[5]=i*(l*E-f*I)-c*(a*E-n*I)+d*(a*f-n*l),t[6]=-(i*(A*E-h*I)-o*(a*E-n*I)+d*(a*h-n*A)),t[7]=i*(A*f-h*l)-o*(a*f-n*l)+c*(a*h-n*A),t[8]=o*(u*E-f*T)-c*(s*E-h*T)+d*(s*f-h*u),t[9]=-(i*(u*E-f*T)-c*(r*E-n*T)+d*(r*f-n*u)),t[10]=i*(s*E-h*T)-o*(r*E-n*T)+d*(r*h-n*s),t[11]=-(i*(s*f-h*u)-o*(r*f-n*u)+c*(r*h-n*s)),t[12]=-(o*(u*I-l*T)-c*(s*I-A*T)+d*(s*l-A*u)),t[13]=i*(u*I-l*T)-c*(r*I-a*T)+d*(r*l-a*u),t[14]=-(i*(s*I-A*T)-o*(r*I-a*T)+d*(r*A-a*s)),t[15]=i*(s*l-A*u)-o*(r*l-a*u)+c*(r*A-a*s),t},t.determinant=function(t){var e=t[0],i=t[1],r=t[2],a=t[3],n=t[4],o=t[5],s=t[6],A=t[7],h=t[8],c=t[9],u=t[10],l=t[11],f=t[12],d=t[13],T=t[14],I=t[15];return(e*o-i*n)*(u*I-l*T)-(e*s-r*n)*(c*I-l*d)+(e*A-a*n)*(c*T-u*d)+(i*s-r*o)*(h*I-l*f)-(i*A-a*o)*(h*T-u*f)+(r*A-a*s)*(h*d-c*f)},t.multiply=function(t,e,i){var r=e[0],a=e[1],n=e[2],o=e[3],s=e[4],A=e[5],h=e[6],c=e[7],u=e[8],l=e[9],f=e[10],d=e[11],T=e[12],I=e[13],E=e[14],C=e[15],m=i[0],p=i[1],g=i[2],v=i[3];return t[0]=m*r+p*s+g*u+v*T,t[1]=m*a+p*A+g*l+v*I,t[2]=m*n+p*h+g*f+v*E,t[3]=m*o+p*c+g*d+v*C,m=i[4],p=i[5],g=i[6],v=i[7],t[4]=m*r+p*s+g*u+v*T,t[5]=m*a+p*A+g*l+v*I,t[6]=m*n+p*h+g*f+v*E,t[7]=m*o+p*c+g*d+v*C,m=i[8],p=i[9],g=i[10],v=i[11],t[8]=m*r+p*s+g*u+v*T,t[9]=m*a+p*A+g*l+v*I,t[10]=m*n+p*h+g*f+v*E,t[11]=m*o+p*c+g*d+v*C,m=i[12],p=i[13],g=i[14],v=i[15],t[12]=m*r+p*s+g*u+v*T,t[13]=m*a+p*A+g*l+v*I,t[14]=m*n+p*h+g*f+v*E,t[15]=m*o+p*c+g*d+v*C,t},t.translate=function(t,e,i){var r,a,n,o,s,A,h,c,u,l,f,d,T=i[0],I=i[1],E=i[2];return e===t?(t[12]=e[0]*T+e[4]*I+e[8]*E+e[12],t[13]=e[1]*T+e[5]*I+e[9]*E+e[13],t[14]=e[2]*T+e[6]*I+e[10]*E+e[14],t[15]=e[3]*T+e[7]*I+e[11]*E+e[15]):(r=e[0],a=e[1],n=e[2],o=e[3],s=e[4],A=e[5],h=e[6],c=e[7],u=e[8],l=e[9],f=e[10],d=e[11],t[0]=r,t[1]=a,t[2]=n,t[3]=o,t[4]=s,t[5]=A,t[6]=h,t[7]=c,t[8]=u,t[9]=l,t[10]=f,t[11]=d,t[12]=r*T+s*I+u*E+e[12],t[13]=a*T+A*I+l*E+e[13],t[14]=n*T+h*I+f*E+e[14],t[15]=o*T+c*I+d*E+e[15]),t},t.scale=function(t,e,i){var r=i[0],a=i[1],n=i[2];return t[0]=e[0]*r,t[1]=e[1]*r,t[2]=e[2]*r,t[3]=e[3]*r,t[4]=e[4]*a,t[5]=e[5]*a,t[6]=e[6]*a,t[7]=e[7]*a,t[8]=e[8]*n,t[9]=e[9]*n,t[10]=e[10]*n,t[11]=e[11]*n,t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15],t},t.rotate=function(t,e,i,a){var n,o,s,A,h,c,u,l,f,d,T,I,E,C,m,p,g,v,R,_,M,b,F,O,B=a[0],S=a[1],L=a[2],N=Math.sqrt(B*B+S*S+L*L);return Math.abs(N)<r.glMatrix.EPSILON?null:(N=1/N,B*=N,S*=N,L*=N,n=Math.sin(i),o=Math.cos(i),s=1-o,A=e[0],h=e[1],c=e[2],u=e[3],l=e[4],f=e[5],d=e[6],T=e[7],I=e[8],E=e[9],C=e[10],m=e[11],p=B*B*s+o,g=S*B*s+L*n,v=L*B*s-S*n,R=B*S*s-L*n,_=S*S*s+o,M=L*S*s+B*n,b=B*L*s+S*n,F=S*L*s-B*n,O=L*L*s+o,t[0]=A*p+l*g+I*v,t[1]=h*p+f*g+E*v,t[2]=c*p+d*g+C*v,t[3]=u*p+T*g+m*v,t[4]=A*R+l*_+I*M,t[5]=h*R+f*_+E*M,t[6]=c*R+d*_+C*M,t[7]=u*R+T*_+m*M,t[8]=A*b+l*F+I*O,t[9]=h*b+f*F+E*O,t[10]=c*b+d*F+C*O,t[11]=u*b+T*F+m*O,e!==t&&(t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15]),t)},t.rotateX=function(t,e,i){var r=Math.sin(i),a=Math.cos(i),n=e[4],o=e[5],s=e[6],A=e[7],h=e[8],c=e[9],u=e[10],l=e[11];return e!==t&&(t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15]),t[4]=n*a+h*r,t[5]=o*a+c*r,t[6]=s*a+u*r,t[7]=A*a+l*r,t[8]=h*a-n*r,t[9]=c*a-o*r,t[10]=u*a-s*r,t[11]=l*a-A*r,t},t.rotateY=function(t,e,i){var r=Math.sin(i),a=Math.cos(i),n=e[0],o=e[1],s=e[2],A=e[3],h=e[8],c=e[9],u=e[10],l=e[11];return e!==t&&(t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15]),t[0]=n*a-h*r,t[1]=o*a-c*r,t[2]=s*a-u*r,t[3]=A*a-l*r,t[8]=n*r+h*a,t[9]=o*r+c*a,t[10]=s*r+u*a,t[11]=A*r+l*a,t},t.rotateZ=function(t,e,i){var r=Math.sin(i),a=Math.cos(i),n=e[0],o=e[1],s=e[2],A=e[3],h=e[4],c=e[5],u=e[6],l=e[7];return e!==t&&(t[8]=e[8],t[9]=e[9],t[10]=e[10],t[11]=e[11],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15]),t[0]=n*a+h*r,t[1]=o*a+c*r,t[2]=s*a+u*r,t[3]=A*a+l*r,t[4]=h*a-n*r,t[5]=c*a-o*r,t[6]=u*a-s*r,t[7]=l*a-A*r,t},t.fromTranslation=function(t,e){return t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=1,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=1,t[11]=0,t[12]=e[0],t[13]=e[1],t[14]=e[2],t[15]=1,t},t.fromScaling=function(t,e){return t[0]=e[0],t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=e[1],t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=e[2],t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t},t.fromRotation=function(t,e,i){var a,n,o,s=i[0],A=i[1],h=i[2],c=Math.sqrt(s*s+A*A+h*h);return Math.abs(c)<r.glMatrix.EPSILON?null:(c=1/c,s*=c,A*=c,h*=c,a=Math.sin(e),n=Math.cos(e),o=1-n,t[0]=s*s*o+n,t[1]=A*s*o+h*a,t[2]=h*s*o-A*a,t[3]=0,t[4]=s*A*o-h*a,t[5]=A*A*o+n,t[6]=h*A*o+s*a,t[7]=0,t[8]=s*h*o+A*a,t[9]=A*h*o-s*a,t[10]=h*h*o+n,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t)},t.fromXRotation=function(t,e){var i=Math.sin(e),r=Math.cos(e);return t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=r,t[6]=i,t[7]=0,t[8]=0,t[9]=-i,t[10]=r,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t},t.fromYRotation=function(t,e){var i=Math.sin(e),r=Math.cos(e);return t[0]=r,t[1]=0,t[2]=-i,t[3]=0,t[4]=0,t[5]=1,t[6]=0,t[7]=0,t[8]=i,t[9]=0,t[10]=r,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t},t.fromZRotation=function(t,e){var i=Math.sin(e),r=Math.cos(e);return t[0]=r,t[1]=i,t[2]=0,t[3]=0,t[4]=-i,t[5]=r,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=1,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t},t.fromRotationTranslation=function(t,e,i){var r=e[0],a=e[1],n=e[2],o=e[3],s=r+r,A=a+a,h=n+n,c=r*s,u=r*A,l=r*h,f=a*A,d=a*h,T=n*h,I=o*s,E=o*A,C=o*h;return t[0]=1-(f+T),t[1]=u+C,t[2]=l-E,t[3]=0,t[4]=u-C,t[5]=1-(c+T),t[6]=d+I,t[7]=0,t[8]=l+E,t[9]=d-I,t[10]=1-(c+f),t[11]=0,t[12]=i[0],t[13]=i[1],t[14]=i[2],t[15]=1,t},t.getTranslation=function(t,e){return t[0]=e[12],t[1]=e[13],t[2]=e[14],t},t.getScaling=function(t,e){var i=e[0],r=e[1],a=e[2],n=e[4],o=e[5],s=e[6],A=e[8],h=e[9],c=e[10];return t[0]=Math.sqrt(i*i+r*r+a*a),t[1]=Math.sqrt(n*n+o*o+s*s),t[2]=Math.sqrt(A*A+h*h+c*c),t},t.getRotation=function(t,e){var i=e[0]+e[5]+e[10],r=0;return i>0?(r=2*Math.sqrt(i+1),t[3]=.25*r,t[0]=(e[6]-e[9])/r,t[1]=(e[8]-e[2])/r,t[2]=(e[1]-e[4])/r):e[0]>e[5]&&e[0]>e[10]?(r=2*Math.sqrt(1+e[0]-e[5]-e[10]),t[3]=(e[6]-e[9])/r,t[0]=.25*r,t[1]=(e[1]+e[4])/r,t[2]=(e[8]+e[2])/r):e[5]>e[10]?(r=2*Math.sqrt(1+e[5]-e[0]-e[10]),t[3]=(e[8]-e[2])/r,t[0]=(e[1]+e[4])/r,t[1]=.25*r,t[2]=(e[6]+e[9])/r):(r=2*Math.sqrt(1+e[10]-e[0]-e[5]),t[3]=(e[1]-e[4])/r,t[0]=(e[8]+e[2])/r,t[1]=(e[6]+e[9])/r,t[2]=.25*r),t},t.fromRotationTranslationScale=function(t,e,i,r){var a=e[0],n=e[1],o=e[2],s=e[3],A=a+a,h=n+n,c=o+o,u=a*A,l=a*h,f=a*c,d=n*h,T=n*c,I=o*c,E=s*A,C=s*h,m=s*c,p=r[0],g=r[1],v=r[2];return t[0]=(1-(d+I))*p,t[1]=(l+m)*p,t[2]=(f-C)*p,t[3]=0,t[4]=(l-m)*g,t[5]=(1-(u+I))*g,t[6]=(T+E)*g,t[7]=0,t[8]=(f+C)*v,t[9]=(T-E)*v,t[10]=(1-(u+d))*v,t[11]=0,t[12]=i[0],t[13]=i[1],t[14]=i[2],t[15]=1,t},t.fromRotationTranslationScaleOrigin=function(t,e,i,r,a){var n=e[0],o=e[1],s=e[2],A=e[3],h=n+n,c=o+o,u=s+s,l=n*h,f=n*c,d=n*u,T=o*c,I=o*u,E=s*u,C=A*h,m=A*c,p=A*u,g=r[0],v=r[1],R=r[2],_=a[0],M=a[1],b=a[2];return t[0]=(1-(T+E))*g,t[1]=(f+p)*g,t[2]=(d-m)*g,t[3]=0,t[4]=(f-p)*v,t[5]=(1-(l+E))*v,t[6]=(I+C)*v,t[7]=0,t[8]=(d+m)*R,t[9]=(I-C)*R,t[10]=(1-(l+T))*R,t[11]=0,t[12]=i[0]+_-(t[0]*_+t[4]*M+t[8]*b),t[13]=i[1]+M-(t[1]*_+t[5]*M+t[9]*b),t[14]=i[2]+b-(t[2]*_+t[6]*M+t[10]*b),t[15]=1,t},t.fromQuat=function(t,e){var i=e[0],r=e[1],a=e[2],n=e[3],o=i+i,s=r+r,A=a+a,h=i*o,c=r*o,u=r*s,l=a*o,f=a*s,d=a*A,T=n*o,I=n*s,E=n*A;return t[0]=1-u-d,t[1]=c+E,t[2]=l-I,t[3]=0,t[4]=c-E,t[5]=1-h-d,t[6]=f+T,t[7]=0,t[8]=l+I,t[9]=f-T,t[10]=1-h-u,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t},t.frustum=function(t,e,i,r,a,n,o){var s=1/(i-e),A=1/(a-r),h=1/(n-o);return t[0]=2*n*s,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=2*n*A,t[6]=0,t[7]=0,t[8]=(i+e)*s,t[9]=(a+r)*A,t[10]=(o+n)*h,t[11]=-1,t[12]=0,t[13]=0,t[14]=o*n*2*h,t[15]=0,t},t.perspective=function(t,e,i,r,a){var n=1/Math.tan(e/2),o=1/(r-a);return t[0]=n/i,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=n,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=(a+r)*o,t[11]=-1,t[12]=0,t[13]=0,t[14]=2*a*r*o,t[15]=0,t},t.perspectiveFromFieldOfView=function(t,e,i,r){var a=Math.tan(e.upDegrees*Math.PI/180),n=Math.tan(e.downDegrees*Math.PI/180),o=Math.tan(e.leftDegrees*Math.PI/180),s=Math.tan(e.rightDegrees*Math.PI/180),A=2/(o+s),h=2/(a+n);return t[0]=A,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=h,t[6]=0,t[7]=0,t[8]=-(o-s)*A*.5,t[9]=(a-n)*h*.5,t[10]=r/(i-r),t[11]=-1,t[12]=0,t[13]=0,t[14]=r*i/(i-r),t[15]=0,t},t.ortho=function(t,e,i,r,a,n,o){var s=1/(e-i),A=1/(r-a),h=1/(n-o);return t[0]=-2*s,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=-2*A,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=2*h,t[11]=0,t[12]=(e+i)*s,t[13]=(a+r)*A,t[14]=(o+n)*h,t[15]=1,t},t.lookAt=function(e,i,a,n){var o,s,A,h,c,u,l,f,d,T,I=i[0],E=i[1],C=i[2],m=n[0],p=n[1],g=n[2],v=a[0],R=a[1],_=a[2];return Math.abs(I-v)<r.glMatrix.EPSILON&&Math.abs(E-R)<r.glMatrix.EPSILON&&Math.abs(C-_)<r.glMatrix.EPSILON?t.identity(e):(l=I-v,f=E-R,d=C-_,T=1/Math.sqrt(l*l+f*f+d*d),l*=T,f*=T,d*=T,o=p*d-g*f,s=g*l-m*d,A=m*f-p*l,T=Math.sqrt(o*o+s*s+A*A),T?(T=1/T,o*=T,s*=T,A*=T):(o=0,s=0,A=0),h=f*A-d*s,c=d*o-l*A,u=l*s-f*o,T=Math.sqrt(h*h+c*c+u*u),T?(T=1/T,h*=T,c*=T,u*=T):(h=0,c=0,u=0),e[0]=o,e[1]=h,e[2]=l,e[3]=0,e[4]=s,e[5]=c,e[6]=f,e[7]=0,e[8]=A,e[9]=u,e[10]=d,e[11]=0,e[12]=-(o*I+s*E+A*C),e[13]=-(h*I+c*E+u*C),e[14]=-(l*I+f*E+d*C),e[15]=1,e)},t.str=function(t){return"mat4("+t[0]+", "+t[1]+", "+t[2]+", "+t[3]+", "+t[4]+", "+t[5]+", "+t[6]+", "+t[7]+", "+t[8]+", "+t[9]+", "+t[10]+", "+t[11]+", "+t[12]+", "+t[13]+", "+t[14]+", "+t[15]+")"},t.frob=function(t){return Math.sqrt(Math.pow(t[0],2)+Math.pow(t[1],2)+Math.pow(t[2],2)+Math.pow(t[3],2)+Math.pow(t[4],2)+Math.pow(t[5],2)+Math.pow(t[6],2)+Math.pow(t[7],2)+Math.pow(t[8],2)+Math.pow(t[9],2)+Math.pow(t[10],2)+Math.pow(t[11],2)+Math.pow(t[12],2)+Math.pow(t[13],2)+Math.pow(t[14],2)+Math.pow(t[15],2))},t.add=function(t,e,i){return t[0]=e[0]+i[0],t[1]=e[1]+i[1],t[2]=e[2]+i[2],t[3]=e[3]+i[3],t[4]=e[4]+i[4],t[5]=e[5]+i[5],t[6]=e[6]+i[6],t[7]=e[7]+i[7],t[8]=e[8]+i[8],t[9]=e[9]+i[9],t[10]=e[10]+i[10],t[11]=e[11]+i[11],t[12]=e[12]+i[12],t[13]=e[13]+i[13],t[14]=e[14]+i[14],t[15]=e[15]+i[15],t},t.subtract=function(t,e,i){return t[0]=e[0]-i[0],t[1]=e[1]-i[1],t[2]=e[2]-i[2],t[3]=e[3]-i[3],t[4]=e[4]-i[4],t[5]=e[5]-i[5],t[6]=e[6]-i[6],t[7]=e[7]-i[7],t[8]=e[8]-i[8],t[9]=e[9]-i[9],t[10]=e[10]-i[10],t[11]=e[11]-i[11],t[12]=e[12]-i[12],t[13]=e[13]-i[13],t[14]=e[14]-i[14],t[15]=e[15]-i[15],t},t.multiplyScalar=function(t,e,i){return t[0]=e[0]*i,t[1]=e[1]*i,t[2]=e[2]*i,t[3]=e[3]*i,t[4]=e[4]*i,t[5]=e[5]*i,t[6]=e[6]*i,t[7]=e[7]*i,t[8]=e[8]*i,t[9]=e[9]*i,t[10]=e[10]*i,t[11]=e[11]*i,t[12]=e[12]*i,t[13]=e[13]*i,t[14]=e[14]*i,t[15]=e[15]*i,t},t.multiplyScalarAndAdd=function(t,e,i,r){return t[0]=e[0]+i[0]*r,t[1]=e[1]+i[1]*r,t[2]=e[2]+i[2]*r,t[3]=e[3]+i[3]*r,t[4]=e[4]+i[4]*r,t[5]=e[5]+i[5]*r,t[6]=e[6]+i[6]*r,t[7]=e[7]+i[7]*r,t[8]=e[8]+i[8]*r,t[9]=e[9]+i[9]*r,t[10]=e[10]+i[10]*r,t[11]=e[11]+i[11]*r,t[12]=e[12]+i[12]*r,t[13]=e[13]+i[13]*r,t[14]=e[14]+i[14]*r,t[15]=e[15]+i[15]*r,t},t.exactEquals=function(t,e){return t[0]===e[0]&&t[1]===e[1]&&t[2]===e[2]&&t[3]===e[3]&&t[4]===e[4]&&t[5]===e[5]&&t[6]===e[6]&&t[7]===e[7]&&t[8]===e[8]&&t[9]===e[9]&&t[10]===e[10]&&t[11]===e[11]&&t[12]===e[12]&&t[13]===e[13]&&t[14]===e[14]&&t[15]===e[15]},t.equals=function(t,e){var i=t[0],a=t[1],n=t[2],o=t[3],s=t[4],A=t[5],h=t[6],c=t[7],u=t[8],l=t[9],f=t[10],d=t[11],T=t[12],I=t[13],E=t[14],C=t[15],m=e[0],p=e[1],g=e[2],v=e[3],R=e[4],_=e[5],M=e[6],b=e[7],F=e[8],O=e[9],B=e[10],S=e[11],L=e[12],N=e[13],P=e[14],y=e[15];return Math.abs(i-m)<=r.glMatrix.EPSILON*Math.max(1,Math.abs(i),Math.abs(m))&&Math.abs(a-p)<=r.glMatrix.EPSILON*Math.max(1,Math.abs(a),Math.abs(p))&&Math.abs(n-g)<=r.glMatrix.EPSILON*Math.max(1,Math.abs(n),Math.abs(g))&&Math.abs(o-v)<=r.glMatrix.EPSILON*Math.max(1,Math.abs(o),Math.abs(v))&&Math.abs(s-R)<=r.glMatrix.EPSILON*Math.max(1,Math.abs(s),Math.abs(R))&&Math.abs(A-_)<=r.glMatrix.EPSILON*Math.max(1,Math.abs(A),Math.abs(_))&&Math.abs(h-M)<=r.glMatrix.EPSILON*Math.max(1,Math.abs(h),Math.abs(M))&&Math.abs(c-b)<=r.glMatrix.EPSILON*Math.max(1,Math.abs(c),Math.abs(b))&&Math.abs(u-F)<=r.glMatrix.EPSILON*Math.max(1,Math.abs(u),Math.abs(F))&&Math.abs(l-O)<=r.glMatrix.EPSILON*Math.max(1,Math.abs(l),Math.abs(O))&&Math.abs(f-B)<=r.glMatrix.EPSILON*Math.max(1,Math.abs(f),Math.abs(B))&&Math.abs(d-S)<=r.glMatrix.EPSILON*Math.max(1,Math.abs(d),Math.abs(S))&&Math.abs(T-L)<=r.glMatrix.EPSILON*Math.max(1,Math.abs(T),Math.abs(L))&&Math.abs(I-N)<=r.glMatrix.EPSILON*Math.max(1,Math.abs(I),Math.abs(N))&&Math.abs(E-P)<=r.glMatrix.EPSILON*Math.max(1,Math.abs(E),Math.abs(P))&&Math.abs(C-y)<=r.glMatrix.EPSILON*Math.max(1,Math.abs(C),Math.abs(y))},t}();a.mul=a.multiply,a.sub=a.subtract,e.mat4=a},,function(t,e,i){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=i(0),a=i(2),n=i(3),o=i(15),s=i(28),A=i(22),h=i(11),c=i(18),u=i(19),l=i(0);e.State=l.State;var f=i(2);e.ProductType=f.ProductType;var d=i(16);e.ProductInheritance=d.ProductInheritance;var T=i(25);e.NavigationCube=T.NavigationCube;var I=i(27);e.NavigationHome=I.NavigationHome;var E=function(){function t(t){if(this._initKeyboardEvents=function(){function t(t){for(var e=Array.prototype.slice.call(arguments),i=0,r=e.length;i<r;i++){var t=e[i];if("number"==typeof t&&n.indexOf(""+t)>-1)return!0;if(n.indexOf(""+A[t])>-1)return!0}return!1}function e(){if(n.length>0){var i=t("Q"),r=t("E"),o=t("R")||t("PageUp"),s=t("C")||t("PageDown"),A=t("W")||t("Up"),h=t("A")||t("Left"),c=t("D")||t("Right"),u=t("S")||t("Down"),l=t("Space"),f=t("Alt");A?a.navigate("zoom",.2*a.scrollSpeed,.2*a.scrollSpeed):u&&a.navigate("zoom",-.2*a.scrollSpeed,-.2*a.scrollSpeed),h?a.navigate("pan",5*a.panSpeed,0):c&&a.navigate("pan",-5*a.panSpeed,0),l?a.navigate("pan",0,5*a.panSpeed):f&&a.navigate("pan",0,-5*a.panSpeed),i?a.navigate("orbit",-3,0):r&&a.navigate("orbit",3,0),o?a.navigate("orbit",0,-3):s&&a.navigate("orbit",0,3)}setTimeout(e,20)}function i(t){if("fly"===a.navigationMode&&s.indexOf(""+t.keyCode)>-1){var e=""+t.keyCode,i=n.indexOf(e);return i>-1&&n.splice(i,1),t.preventDefault(),!1}}function r(t){if("fly"===a.navigationMode&&s.indexOf(""+t.keyCode)>-1){var e=""+t.keyCode;return-1===n.indexOf(e)&&n.push(e),t.preventDefault(),!1}}for(var a=this,n=[],o={87:"W",83:"S",65:"A",68:"D",81:"Q",69:"E",82:"R",67:"C",33:"PageUp",34:"PageDown",38:"Up",40:"Down",37:"Left",39:"Right",18:"Alt",32:"Space"},s=Object.keys(o),A={},h=0,c=s.length;h<c;h++)A[o[s[h]]]=s[h];a._canvas.setAttribute("tabindex",-1),a._canvas.addEventListener("keydown",r,!0),a._canvas.addEventListener("keyup",i,!0),e()},this._lastActiveHandlesCount=0,void 0===t)throw"Canvas has to be defined";if(void 0!==t.nodeName&&"CANVAS"===t.nodeName&&(this._canvas=t),"string"==typeof t&&(this._canvas=document.getElementById(t)),null==this._canvas)throw"You have to specify canvas either as an ID of HTML element or the element itself";this.perspectiveCamera={fov:45,near:0,far:0},this.orthogonalCamera={left:0,right:0,top:0,bottom:0,near:0,far:0},this.camera="perspective",this.background=[230,230,230,255],this.highlightingColour=[255,173,33,255],this.extraHighlightingColour=[255,0,0,255],this.lightA=[0,1e6,2e5,.8],this.lightB=[0,-5e5,5e4,.2],this.navigationMode="orbit",this.renderingMode=m.NORMAL,this.autoZoomRelationalDistance=0,this.scrollSpeed=1,this.panSpeed=1,this._clippingPlaneA=[0,0,0,0],this._clippingPlaneB=[0,0,0,0];var e=A.WebGLUtils.setupWebGL(this._canvas);e&&(this.gl=e,this._fpt=e.getExtension("OES_texture_float")||e.getExtension("MOZ_OES_texture_float")||e.getExtension("WEBKIT_OES_texture_float"),e.enable(e.DEPTH_TEST),e.blendFunc(e.SRC_ALPHA,e.ONE_MINUS_SRC_ALPHA),e.enable(e.BLEND),this._width=this._canvas.width=this._canvas.offsetWidth,this._height=this._canvas.height=this._canvas.offsetHeight,this._geometryLoaded=!1,this._numberOfActiveModels=0,this._lastStates={},this._visualStateAttributes=["perspectiveCamera","orthogonalCamera","camera","background","lightA","lightB","renderingMode","_clippingA","_clippingB","mvMatrix","_pMatrix","_distance","_origin","highlightingColour","extraHighlightingColour","_numberOfActiveModels","_width","_height"],this._stylingChanged=!0,this._userAction=!0,this._events={},this._plugins=new Array,this.mvMatrix=u.mat4.create(),this._pMatrix=u.mat4.create(),this._origin=[0,0,0],this._distance=0,this._shaderProgram=null,this._handles=[],this._isRunning=!0,this._initShaders(),this._initAttributesAndUniforms(),this._initMouseEvents(),this._initKeyboardEvents(),this._initTouchNavigationEvents(),this._initTouchTapEvents(),this._stateStyles=new Uint8Array(900),this._stateStyleTexture=e.createTexture(),e.activeTexture(e.TEXTURE4),e.bindTexture(e.TEXTURE_2D,this._stateStyleTexture),e.uniform1i(this._stateStyleSamplerUniform,4),o.ModelHandle.bufferTexture(e,this._stateStyleTexture,this._stateStyles))}return t.check=function(){var t={warnings:[],errors:[],noErrors:!1,noWarnings:!1},e=document.createElement("canvas");if(e){var i=A.WebGLUtils.setupWebGL(e);if(null==i)t.errors.push("Browser doesn't support WebGL. This is critical.");else{i.getExtension("OES_texture_float")||i.getExtension("MOZ_OES_texture_float")||i.getExtension("WEBKIT_OES_texture_float")||t.warnings.push("Floating point texture extension is not supported. Performance of the viewer will be very bad. But it should work.");var r=i.getParameter(i.MAX_VERTEX_TEXTURE_IMAGE_UNITS);r<4&&t.errors.push("Browser supports only "+r+" vertex texture image units but minimal requirement for the viewer is 4.")}}else t.errors.push("Browser doesn't have support for HTMLCanvasElement. This is critical.");return window.File&&window.FileReader&&window.Blob||t.errors.push("Browser doesn't support 'File', 'FileReader' or 'Blob' objects."),window.Int32Array&&window.Float32Array||t.errors.push("Browser doesn't support TypedArrays. These are crucial for binary parsing and for comunication with GPU."),0==t.errors.length&&(t.noErrors=!0),0==t.warnings.length&&(t.noWarnings=!0),t},t.prototype.addPlugin=function(t){this._plugins.push(t),t.init&&t.init(this)},t.prototype.removePlugin=function(t){var e=this._plugins.indexOf(t,0);e<0||this._plugins.splice(e,1)},t.prototype.defineStyle=function(t,e){if(void 0===t||t<0&&t>224)throw"Style index has to be defined as a number 0-224";if(void 0===e||!e.length||4!=e.length)throw"Colour must be defined as an array of 4 bytes";var i=new Uint8Array(e);this._stateStyles.set(i,4*t),o.ModelHandle.bufferTexture(this.gl,this._stateStyleTexture,this._stateStyles),this._stylingChanged=!0},t.prototype.setState=function(t,e){if(void 0===t||!(t>=225&&t<=255))throw"State has to be defined as 225 - 255. Use xState enum.";this._handles.forEach(function(i){i.setState(t,e)}),this._stylingChanged=!0},t.prototype.getState=function(t){var e=null;return this._handles.forEach(function(i){e=i.getState(t)}),e},t.prototype.resetStates=function(t){this._handles.forEach(function(t){t.resetStates()}),t=void 0===t||t,t&&this._handles.forEach(function(t){t.setState(r.State.HIDDEN,a.ProductType.IFCSPACE)}),this._stylingChanged=!0},t.prototype.getModelState=function(t){var e=this._handles[t];if(void 0===e)throw"Model doesn't exist";return e.getModelState()},t.prototype.restoreModelState=function(t,e){var i=this._handles[t];if(void 0===i)throw"Model doesn't exist";i.restoreModelState(e),this._stylingChanged=!0},t.prototype.setStyle=function(t,e){if(void 0===t||!(t>=0&&t<=225))throw"Style has to be defined as 0 - 225 where 225 is for default style.";var i=[this._stateStyles[4*t],this._stateStyles[4*t+1],this._stateStyles[4*t+2],this._stateStyles[4*t+3]];0==i[0]&&0==i[1]&&0==i[2]&&0==i[3]&&console&&console.warn&&console.warn("You have used undefined colour for restyling. Elements with this style will have transparent black colour and hence will be invisible."),this._handles.forEach(function(i){i.setState(t,e)}),this._stylingChanged=!0},t.prototype.getStyle=function(t){return this._handles.forEach(function(e){var i=e.getStyle(t);if(null!==i)return i}),null},t.prototype.resetStyles=function(){this._handles.forEach(function(t){t.resetStyles()}),this._stylingChanged=!0},t.prototype.getProductType=function(t){var e=null;return this._handles.forEach(function(i){var r=i.getProductMap(t);r&&(e=r.type)}),e},t.prototype.setCameraPosition=function(t){if(void 0===t)throw"Parameter coordinates must be defined";u.mat4.lookAt(this.mvMatrix,t,this._origin,[0,0,1])},t.prototype.setCameraTarget=function(t){var e=this,i=function(t){var i=Math.sqrt(t[3]*t[3]+t[4]*t[4]+t[5]*t[5]),r=Math.max(e._width,e._height)/Math.min(e._width,e._height);e._distance=i/r/(2*Math.tan(e.perspectiveCamera.fov*Math.PI/180/2))};if(void 0!==t&&null!=t){var r=null;return this._handles.forEach(function(e){var i=e.getProductMap(t);i&&(r=i.bBox)}),!!r&&(this._origin=[r[0]+r[3]/2,r[1]+r[4]/2,r[2]+r[5]/2],i(r),!0)}var a=e.getMergedRegion();return a&&(this._origin=[a.centre[0],a.centre[1],a.centre[2]],i(a.bbox)),!0},t.prototype.getMergedRegion=function(){var t=new n.Region;return this._handles.filter(function(t,e,i){return!t.stopped}).forEach(function(e,i,r){t=t.merge(e.region)}),t},t.prototype.getBiggestRegion=function(){var t=function(t){return t[3]*t[4]*t[5]},e=this._handles.filter(function(t,e,i){t.stopped}).sort(function(e,i){var r=t(e.region.bbox),a=t(i.region.bbox);return r<a?-1:r==a?0:r>a?1:void 0}).pop();return e?e.region:null},t.prototype.set=function(t){for(var e in t)this[e]=t[e]},t.prototype.loadAsync=function(t,e,i){if(void 0===e)throw"You have to specify model to load.";if("string"!=typeof e&&!(e instanceof Blob))throw"Model has to be specified either as a URL to wexBIM file or Blob object representing the wexBIM file.";var r=this;"undefined"==typeof Worker&&this.load(e,i);var a=new Worker(t);a.onmessage=function(t){var e=t.data;r.addHandle(e,i)},a.onerror=function(t){r.error(t.message)},a.postMessage(e)},t.prototype.load=function(t,e){if(void 0===t)throw"You have to specify model to load.";if("string"!=typeof t&&!(t instanceof Blob))throw"Model has to be specified either as a URL to wexBIM file or Blob object representing the wexBIM file.";var i=this,r=new n.ModelGeometry;r.onloaded=function(){i.addHandle(r,e)},r.onerror=function(t){i.error(t)},r.load(t)},t.prototype.addHandle=function(t,e){var i=this,r=this.gl,a=new o.ModelHandle(i.gl,t);i._handles.push(a),a.feedGPU();var n=a.model.meter;if(r.uniform1f(i._meterUniformPointer,n),1===i._handles.length){i.setCameraTarget();var s=a.region,A=Math.max(s.bbox[3],s.bbox[4],s.bbox[5]);i.perspectiveCamera.far=50*A,i.perspectiveCamera.near=n/10,i.orthogonalCamera.far=i.perspectiveCamera.far,i.orthogonalCamera.near=i.perspectiveCamera.near;i.orthogonalCamera.top=A/1.8,i.orthogonalCamera.bottom=A/1.8*-1,i.orthogonalCamera.left=A/1.8*-1*i._width/i._height,i.orthogonalCamera.right=A/1.8*i._width/i._height,i.setCameraTarget();var h=Math.sqrt(i._distance*i._distance*1.5);i.setCameraPosition([s.centre[0]+-1*h,s.centre[1]+-1*h,s.centre[2]+h])}i.fire("loaded",{id:a.id,tag:e}),i._geometryLoaded=!0},t.prototype.unload=function(t){var e=this._handles.filter(function(e){return e.id===t}).pop();if(void 0===e)throw"Model with id: "+t+" doesn't exist or was unloaded already.";e.stopped=!0;var i=this._handles.indexOf(e);this._handles.splice(i,1),this._numberOfActiveModels=this._handles.length,e.unload()},t.prototype._initShaders=function(){var t=this.gl,e=this,i=function(i,r){if(t.shaderSource(i,r),t.compileShader(i),!t.getShaderParameter(i,t.COMPILE_STATUS))return e.error(t.getShaderInfoLog(i)),null},r=t.createShader(t.FRAGMENT_SHADER);i(r,s.Shaders.fragment_shader);var a=t.createShader(t.VERTEX_SHADER);i(a,s.Shaders.vertex_shader),this._shaderProgram=t.createProgram(),t.attachShader(this._shaderProgram,a),t.attachShader(this._shaderProgram,r),t.linkProgram(this._shaderProgram),t.getProgramParameter(this._shaderProgram,t.LINK_STATUS)||this.error("Could not initialise shaders "),t.useProgram(this._shaderProgram)},t.prototype._initAttributesAndUniforms=function(){var t=this.gl;this._pMatrixUniformPointer=t.getUniformLocation(this._shaderProgram,"uPMatrix"),this._mvMatrixUniformPointer=t.getUniformLocation(this._shaderProgram,"uMVMatrix"),this._lightAUniformPointer=t.getUniformLocation(this._shaderProgram,"ulightA"),this._lightBUniformPointer=t.getUniformLocation(this._shaderProgram,"ulightB"),this._colorCodingUniformPointer=t.getUniformLocation(this._shaderProgram,"uColorCoding"),this._clippingPlaneAUniformPointer=t.getUniformLocation(this._shaderProgram,"uClippingPlaneA"),this._clippingAUniformPointer=t.getUniformLocation(this._shaderProgram,"uClippingA"),this._clippingPlaneBUniformPointer=t.getUniformLocation(this._shaderProgram,"uClippingPlaneB"),this._clippingBUniformPointer=t.getUniformLocation(this._shaderProgram,"uClippingB"),this._meterUniformPointer=t.getUniformLocation(this._shaderProgram,"uMeter"),this._renderingModeUniformPointer=t.getUniformLocation(this._shaderProgram,"uRenderingMode"),this._highlightingColourUniformPointer=t.getUniformLocation(this._shaderProgram,"uHighlightColour"),this._extraHighlightingColourUniformPointer=t.getUniformLocation(this._shaderProgram,"uExtraHighlightColour"),this._stateStyleSamplerUniform=t.getUniformLocation(this._shaderProgram,"uStateStyleSampler"),this._pointers=new C(t,this._shaderProgram)},t.prototype._initMouseEvents=function(){var t=this,e=this,i=!1,r=null,a=null,n=null,o=null,s="L",A=-1,h=function(t){i=!0,r=t.clientX,a=t.clientY,n=t.clientX,o=t.clientY;var h=e._canvas.getBoundingClientRect(),c=n-h.left,u=e._height-(o-h.top);switch(A=e.getID(c,u),e.fire("mouseDown",{id:A}),t.button){case 0:s="left";break;case 1:s="middle";break;case 2:s="right";break;default:s="left"}e.disableTextSelection()},c=function(t){i=!1;var r=t.clientX,a=t.clientY,h=Math.abs(r-n),c=Math.abs(a-o);if(h<3&&c<3&&"left"===s){var u=!1;e._plugins.forEach(function(t){t.onBeforePick&&(u=u||t.onBeforePick(A))}),u||e.fire("pick",{id:A})}e.enableTextSelection()},u=function(n){if(i&&"none"!==e.navigationMode){i||document.activeElement!==e._canvas||"fly"!==e.navigationMode||(s="none");var o=n.clientX,A=n.clientY,h=o-r,c=A-a;if(r=o,a=A,"left"===s)switch(e.navigationMode){case"free-orbit":t.navigate("free-orbit",h,c);break;case"fixed-orbit":case"orbit":t.navigate("orbit",h,c);break;case"pan":t.navigate("pan",h,c);break;case"zoom":t.navigate("zoom",h,c)}"middle"!==s&&"right"!==s||t.navigate("pan",h,c)}},l=function(i){if("none"!==e.navigationMode){i.stopPropagation&&i.stopPropagation(),i.preventDefault&&i.preventDefault();var r=function(t){return t=+t,0===t||isNaN(t)?t:t>0?1:-1};t.navigate("zoom",-1*r(i.deltaX),-1*r(i.deltaY))}},f=e.height,d=e.width;setInterval(function(){e._canvas.offsetHeight===f&&e._canvas.offsetWidth===d||(f=e._height=e._canvas.height=e._canvas.offsetHeight,d=e._width=e._canvas.width=e._canvas.offsetWidth)},500),this._canvas.addEventListener("mousedown",function(t){return h(t)},!0),this._canvas.addEventListener("wheel",function(t){return l(t)},!0),window.addEventListener("mouseup",function(t){return c(t)},!0),window.addEventListener("mousemove",function(t){return u(t)},!0),this._canvas.addEventListener("mousemove",function(){e._userAction=!0},!0),this._canvas.addEventListener("dblclick",function(){e.fire("dblclick",{id:A})},!0)},t.prototype._initTouchNavigationEvents=function(){var t,e,i,r,a,n,o=this,s=function(o){o.preventDefault(),o.touches.length>=1&&(t=o.touches[0].clientX,e=o.touches[0].clientY),o.touches.length>=2&&(i=o.touches[1].clientX,r=o.touches[1].clientY),o.touches.length>=3&&(a=o.touches[2].clientX,n=o.touches[2].clientY)},A=function(s){if(s.preventDefault(),"none"!==o.navigationMode&&s.touches)if(1===s.touches.length){var A=s.touches[0].clientX-t,h=s.touches[0].clientY-e;t=s.touches[0].clientX,e=s.touches[0].clientY,o.navigate("free-orbit",A,h)}else if(2===s.touches.length){var c=Math.sqrt((t-i)*(t-i)+(e-r)*(e-r));t=s.touches[0].clientX,e=s.touches[0].clientY,i=s.touches[1].clientX,r=s.touches[1].clientY;var u=Math.sqrt((t-i)*(t-i)+(e-r)*(e-r));c>u?o.navigate("zoom",-1,-1):o.navigate("zoom",1,1)}else if(3===s.touches.length){var l=(s.touches[0].clientX+s.touches[1].clientX+s.touches[2].clientX)/3-(t+i+a)/3,f=(s.touches[0].clientY+s.touches[1].clientY+s.touches[2].clientY)/3-(e+r+n)/3;t=s.touches[0].clientX,e=s.touches[0].clientY,i=s.touches[1].clientX,r=s.touches[1].clientY,n=s.touches[2].clientX,n=s.touches[2].clientY;o.navigate("pan",.2*l,.2*f)}};this._canvas.addEventListener("touchstart",function(t){return s(t)},!0),this._canvas.addEventListener("touchmove",function(t){return A(t)},!0)},t.prototype._initTouchTapEvents=function(){var t,e,i=this,r=!1,a=new Date,n=-1,o=function(o){if(1===o.touches.length){r=!0,t=o.touches[0].clientX,e=o.touches[0].clientY;var s=i._canvas.getBoundingClientRect(),A=t-s.left,h=i._height-(e-s.top);n=i.getID(A,h);var c=new Date;c.getTime()-a.getTime()<200&&i.fire("dblclick",{id:n}),a=c,i.fire("mouseDown",{id:n}),i.disableTextSelection()}},s=function(a){if(r){r=!1;var o=a.changedTouches[0].clientX,s=a.changedTouches[0].clientY,A=Math.abs(o-t),h=Math.abs(s-e);if(A<3&&h<3){var c=!1;i._plugins.forEach(function(t){t.onBeforePick&&(c=c||t.onBeforePick(n))},i),c||i.fire("pick",{id:n})}i.enableTextSelection()}};this._canvas.addEventListener("touchstart",function(t){return o(t)},!0),this._canvas.addEventListener("touchend",function(t){return s(t)},!0)},t.prototype.navigate=function(t,e,i){function r(t){return t*Math.PI/180}if(this._handles&&this._handles[0]){var a=this._origin,n=this.getCameraPosition(),o=h.vec3.transformMat4(h.vec3.create(),a,this.mvMatrix),s=h.vec3.subtract(h.vec3.create(),a,n),A=Math.max(h.vec3.vectorLength(s),this._handles[0].model.meter),l=u.mat4.translate(u.mat4.create(),u.mat4.create(),o);switch(t){case"free-orbit":l=u.mat4.rotate(u.mat4.create(),l,r(i/4),[1,0,0]),l=u.mat4.rotate(u.mat4.create(),l,r(e/4),[0,1,0]);break;case"fixed-orbit":case"orbit":u.mat4.rotate(l,l,r(i/4),[1,0,0]);var f=h.vec3.transformMat3(h.vec3.create(),[0,0,1],c.mat3.fromMat4(c.mat3.create(),this.mvMatrix));f=h.vec3.normalize(h.vec3.create(),f),l=u.mat4.rotate(u.mat4.create(),l,r(e/4),f);break;case"pan":u.mat4.translate(l,l,[e*A/150,0,0]),u.mat4.translate(l,l,[0,-1*i*A/150,0]);break;case"zoom":u.mat4.translate(l,l,[0,0,e*A/20]),u.mat4.translate(l,l,[0,0,i*A/20]);break;case"spin":return this.navigate("orbit",-1.2*e,-1.2*i)}var d=h.vec3.negate(h.vec3.create(),o);l=u.mat4.translate(u.mat4.create(),l,d),this.mvMatrix=u.mat4.multiply(u.mat4.create(),l,this.mvMatrix)}},t.prototype.draw=function(){var t=this;if(this._geometryLoaded&&0!=this._handles.length&&(this._stylingChanged||this.isChanged())||this._userAction){this._userAction=!1,this._plugins.forEach(function(t){t.onBeforeDraw&&t.onBeforeDraw()}),this._stylingChanged=!1;var e=this.gl,i=this._width,r=this._height;switch(e.useProgram(this._shaderProgram),e.viewport(0,0,i,r),e.clearColor(this.background[0]/255,this.background[1]/255,this.background[2]/255,this.background[3]/255),e.clear(e.COLOR_BUFFER_BIT|e.DEPTH_BUFFER_BIT),this.camera){case"perspective":u.mat4.perspective(this._pMatrix,this.perspectiveCamera.fov*Math.PI/180,this._width/this._height,this.perspectiveCamera.near,this.perspectiveCamera.far);break;case"orthogonal":u.mat4.ortho(this._pMatrix,this.orthogonalCamera.left,this.orthogonalCamera.right,this.orthogonalCamera.bottom,this.orthogonalCamera.top,this.orthogonalCamera.near,this.orthogonalCamera.far);break;default:u.mat4.perspective(this._pMatrix,this.perspectiveCamera.fov*Math.PI/180,this._width/this._height,this.perspectiveCamera.near,this.perspectiveCamera.far)}e.uniformMatrix4fv(this._pMatrixUniformPointer,!1,this._pMatrix),e.uniformMatrix4fv(this._mvMatrixUniformPointer,!1,this.mvMatrix),e.uniform4fv(this._lightAUniformPointer,new Float32Array(this.lightA)),e.uniform4fv(this._lightBUniformPointer,new Float32Array(this.lightB)),e.activeTexture(e.TEXTURE4),e.bindTexture(e.TEXTURE_2D,this._stateStyleTexture),e.uniform1i(this._stateStyleSamplerUniform,4),e.uniform1i(this._clippingAUniformPointer,this._clippingA?1:0),e.uniform1i(this._clippingBUniformPointer,this._clippingB?1:0),this._clippingA&&e.uniform4fv(this._clippingPlaneAUniformPointer,new Float32Array(this._clippingPlaneA)),this._clippingB&&e.uniform4fv(this._clippingPlaneBUniformPointer,new Float32Array(this._clippingPlaneB)),e.uniform1i(this._colorCodingUniformPointer,0),e.uniform4fv(this._highlightingColourUniformPointer,new Float32Array([this.highlightingColour[0]/255,this.highlightingColour[1]/255,this.highlightingColour[2]/255,this.highlightingColour[3]/255])),e.uniform4fv(this._extraHighlightingColourUniformPointer,new Float32Array([this.extraHighlightingColour[0]/255,this.extraHighlightingColour[1]/255,this.extraHighlightingColour[2]/255,this.extraHighlightingColour[3]/255])),e.uniform1i(this._renderingModeUniformPointer,this.renderingMode),this.renderingMode==m.XRAY?(e.disable(e.CULL_FACE),this._handles.forEach(function(e){e.stopped||(e.setActive(t._pointers),e.draw("solid"))}),e.enable(e.CULL_FACE),this._handles.forEach(function(e){e.stopped||(e.setActive(t._pointers),e.draw("transparent"))})):(e.disable(e.CULL_FACE),this._handles.forEach(function(e){e.stopped||(e.setActive(t._pointers),e.draw("solid"))}),this._handles.forEach(function(e){e.stopped||(e.setActive(t._pointers),e.draw("transparent"))})),this._plugins.forEach(function(t){t.onAfterDraw&&t.onAfterDraw()}),this.fire("frame",{})}},t.prototype.isChanged=function(){var t=this,e=!0;this._visualStateAttributes.forEach(function(i){var r=JSON.stringify(t[i]),a=t._lastStates[i];t._lastStates[i]=r,e=e&&r===a});var i=this._handles.filter(function(t){return!t.stopped}).length;return e=e&&this._lastActiveHandlesCount==i,this._lastActiveHandlesCount=i,!e},t.prototype.getCameraPosition=function(){var t=u.mat4.create();u.mat4.multiply(t,this._pMatrix,this.mvMatrix);var e=u.mat4.create();u.mat4.invert(e,t);var i=h.vec3.create();return h.vec3.transformMat4(i,h.vec3.create(),e),i},t.prototype.zoomTo=function(t){if(!this.setCameraTarget(t))return!1;var e=this.getCameraPosition(),i=h.vec3.create();h.vec3.subtract(i,e,this._origin),i=h.vec3.normalize(h.vec3.create(),i);var r=h.vec3.create();return h.vec3.scale(r,i,1.2*this._distance),h.vec3.add(e,r,this._origin),u.mat4.lookAt(this.mvMatrix,e,this._origin,[0,0,1]),!0},t.prototype.show=function(t){var e=this._origin,i=this._distance,r=[0,0,0],a=[0,0,1];switch(t){case"top":return void u.mat4.translate(this.mvMatrix,u.mat4.create(),[-1*e[0],-1*e[1],-1*(i+e[2])]);case"bottom":var n=u.mat4.translate(u.mat4.create(),u.mat4.create(),[-1*e[0],1*e[1],-1*(e[2]+i)]),o=u.mat4.rotateY(u.mat4.create(),n,Math.PI),s=u.mat4.rotateZ(u.mat4.create(),o,Math.PI);return void(this.mvMatrix=s);case"front":r=[e[0],e[1]-i,e[2]];break;case"back":r=[e[0],e[1]+i,e[2]];break;case"left":r=[e[0]-i,e[1],e[2]];break;case"right":r=[e[0]+i,e[1],e[2]];break;case"top_right_front":var A=h.vec3.fromValues(1,-1,1);i*=1.3,A=h.vec3.normalize(h.vec3.create(),A);var c=h.vec3.scale(h.vec3.create(),A,i);r=[e[0]+c[0],e[1]+c[1],e[2]+c[2]];break;case"top_left_front":var A=h.vec3.fromValues(-1,-1,1);i*=1.3,A=h.vec3.normalize(h.vec3.create(),A);var c=h.vec3.scale(h.vec3.create(),A,i);r=[e[0]+c[0],e[1]+c[1],e[2]+c[2]]}u.mat4.lookAt(this.mvMatrix,r,e,a)},t.prototype.error=function(t){this.fire("error",{message:t})},t.prototype.getID=function(t,e){var i=this;this._plugins.forEach(function(t){t.onBeforeDrawId&&t.onBeforeDrawId()});var r=this.gl,a=this._width/2,n=this._height/2;t/=2,e/=2;var o=r.createFramebuffer();r.bindFramebuffer(r.FRAMEBUFFER,o);var s=r.createRenderbuffer();r.bindRenderbuffer(r.RENDERBUFFER,s),r.renderbufferStorage(r.RENDERBUFFER,r.DEPTH_COMPONENT16,a,n);var A=r.createTexture();if(r.activeTexture(r.TEXTURE0),r.bindTexture(r.TEXTURE_2D,A),r.texImage2D(r.TEXTURE_2D,0,r.RGBA,a,n,0,r.RGBA,r.UNSIGNED_BYTE,null),r.texParameteri(r.TEXTURE_2D,r.TEXTURE_WRAP_S,r.CLAMP_TO_EDGE),r.texParameteri(r.TEXTURE_2D,r.TEXTURE_WRAP_T,r.CLAMP_TO_EDGE),r.texParameteri(r.TEXTURE_2D,r.TEXTURE_MIN_FILTER,r.NEAREST),r.texParameteri(r.TEXTURE_2D,r.TEXTURE_MAG_FILTER,r.NEAREST),r.framebufferRenderbuffer(r.FRAMEBUFFER,r.DEPTH_ATTACHMENT,r.RENDERBUFFER,s),r.framebufferTexture2D(r.FRAMEBUFFER,r.COLOR_ATTACHMENT0,r.TEXTURE_2D,A,0),r.checkFramebufferStatus(r.FRAMEBUFFER)!=r.FRAMEBUFFER_COMPLETE)return this.error("this combination of attachments does not work"),null;r.bindFramebuffer(r.FRAMEBUFFER,o),r.viewport(0,0,a,n),r.enable(r.DEPTH_TEST),r.disable(r.BLEND),r.clearColor(0,0,0,0),r.clear(r.COLOR_BUFFER_BIT|r.DEPTH_BUFFER_BIT),r.uniform1i(this._colorCodingUniformPointer,1),this._handles.forEach(function(t){!t.stopped&&t.pickable&&(t.setActive(i._pointers),t.draw())}),this._plugins.forEach(function(t){t.onAfterDrawId&&t.onAfterDrawId()});var h=new Uint8Array(4);if(r.readPixels(t,e,1,1,r.RGBA,r.UNSIGNED_BYTE,h),r.bindFramebuffer(r.FRAMEBUFFER,null),r.deleteTexture(A),r.deleteRenderbuffer(s),r.deleteFramebuffer(o),r.blendFunc(r.SRC_ALPHA,r.ONE_MINUS_SRC_ALPHA),r.enable(r.BLEND),0!=h[3]){var c=h[0]+256*h[1]+256*h[2]*256,u=!1;return this._plugins.forEach(function(t){t.onBeforeGetId&&(u=u||t.onBeforeGetId(c))}),u?null:c}return null},t.prototype.start=function(t){function e(){if(30==++n){n=0;var t=new Date,i=t.getTime()-a.getTime();a=t;var o=1e3/i*30;r.fire("fps",Math.floor(o))}r._isRunning&&(window.requestAnimationFrame(e),r.draw())}if(void 0!==t){var i=this._handles.filter(function(e){return e.id===t}).pop();if(void 0===i)throw"Model doesn't exist.";return i.stopped=!1,void this._numberOfActiveModels++}this._isRunning=!0;var r=this,a=new Date,n=0;e()},t.prototype.stop=function(t){if(void 0===t)return void(this._isRunning=!1);var e=this._handles.filter(function(e){return e.id===t}).pop();if(void 0===e)throw"Model doesn't exist.";e.stopped=!0,this._numberOfActiveModels--},t.prototype.stopPicking=function(t){var e=this._handles.filter(function(e){return e.id===t}).pop();if(void 0===e)throw"Model doesn't exist.";e.pickable=!1},t.prototype.startPicking=function(t){var e=this._handles.filter(function(e){return e.id===t}).pop();if(void 0===e)throw"Model doesn't exist.";e.pickable=!0},t.prototype.on=function(t,e){var i=this._events;i[t]||(i[t]=new Array),i[t].push(e)},t.prototype.off=function(t,e){var i=this._events,r=i[t];if(r){var a=r.indexOf(e);a>=0&&r.splice(a,1)}},t.prototype.fire=function(t,e){var i=this._events[t];i&&i.slice().forEach(function(t){t(e)})},t.prototype.disableTextSelection=function(){document.documentElement.style["-webkit-touch-callout"]="none",document.documentElement.style["-webkit-user-select"]="none",document.documentElement.style["-khtml-user-select"]="none",document.documentElement.style["-moz-user-select"]="none",document.documentElement.style["-ms-user-select"]="none",document.documentElement.style["user-select"]="none"},t.prototype.enableTextSelection=function(){document.documentElement.style["-webkit-touch-callout"]="text",document.documentElement.style["-webkit-user-select"]="text",document.documentElement.style["-khtml-user-select"]="text",document.documentElement.style["-moz-user-select"]="text",document.documentElement.style["-ms-user-select"]="text",document.documentElement.style["user-select"]="text"},t.prototype.getSVGOverlay=function(){var t=document.createElementNS("http://www.w3.org/2000/svg","svg");this._canvas.parentNode?this._canvas.parentNode.insertBefore(t,this._canvas.nextSibling):document.body.appendChild(t);var e=function(t){var e=t.getBoundingClientRect(),i=document.body,r=document.documentElement,a=window.pageYOffset||r.scrollTop||i.scrollTop,n=window.pageXOffset||r.scrollLeft||i.scrollLeft,o=r.clientTop||i.clientTop||0,s=r.clientLeft||i.clientLeft||0,A=r.clientBottom||i.clientBottom||0,h=r.clientRight||i.clientRight||0,c=Math.round(e.top+a-o),u=Math.round(e.left+n-s),l=Math.round(e.top+a-A);return{top:c,left:u,width:Math.round(e.left+n-h)-u,height:l-c}}(this._canvas);return t.style.position="absolute",t.style.top=e.top+"px",t.style.left=e.left+"px",t.style["z-index"]=100,t.setAttribute("width",this._width.toString()),t.setAttribute("height",this._height.toString()),t},t.prototype.getClip=function(){var t=this._clippingPlaneA;if(!this._clippingA||t.every(function(t){return 0===t}))return[[0,0,0],[0,0,0]];var e=h.vec3.normalize(h.vec3.create(),[t[0],t[1],t[2]]),i=this._lastClippingPoint,r=i[0]*t[0]+i[1]*t[1]+i[2]*t[2]+t[3];return Math.abs(r)<1e-5?[i,[e[0],e[1],e[2]]]:[[0!==t[0]?-1*t[3]/t[0]:0,0!==t[1]?-1*t[3]/t[1]:0,0!==t[2]?-1*t[3]/t[2]:0],[e[0],e[1],e[2]]]},t.prototype.clip=function(t,e){if(void 0!==t&&void 0!==e){this._lastClippingPoint=t;var i=0-e[0]*t[0]-e[1]*t[1]-e[2]*t[2];return this.clippingPlaneA=[e[0],e[1],e[2],i],void this.fire("clipped",{})}var r,a="http://www.w3.org/2000/svg",n=this.getSVGOverlay(),o=this,s={},A=!1,c=function(t){if(!A){A=!0,o.disableTextSelection();var e=n.getBoundingClientRect();s.x=t.clientX-e.left,s.y=t.clientY-e.top,s.angle=0,r=document.createElementNS(a,"g"),r.setAttribute("id","section"),n.appendChild(r);var i=document.createElementNS(a,"line");r.appendChild(i),i.setAttribute("style","stroke:rgb(255,0,0);stroke-width:2"),i.setAttribute("x1",s.x.toString()),i.setAttribute("y1","99999"),i.setAttribute("x2",s.x.toString()),i.setAttribute("y2","-99999")}},l=function(t){if(A){var e=n.getBoundingClientRect();if(s.x!=t.clientX-e.left||s.y!=t.clientY-e.top){A=!1,o.enableTextSelection();var i=u.mat4.create();u.mat4.multiply(i,o._pMatrix,o.mvMatrix);var r=u.mat4.create();u.mat4.invert(r,i);var a=s.x/(o._width/2)-1,d=1-s.y/(o._height/2),T=h.vec3.create();h.vec3.transformMat4(T,[a,d,-1],r);var I=h.vec3.create();h.vec3.transformMat4(I,[a,d,1],r);var E=s.angle*Math.PI/180,C=a+Math.cos(E),m=d+Math.sin(E),p=h.vec3.create();h.vec3.transformMat4(p,[C,m,1],r);var g=h.vec3.subtract(h.vec3.create(),T,I),v=h.vec3.subtract(h.vec3.create(),p,I),R=h.vec3.cross(h.vec3.create(),g,v);o.clip([I[0],I[1],I[2]],[R[0],R[1],R[2]]),n.parentNode.removeChild(n),n.removeEventListener("mousedown",c,!0),window.removeEventListener("mouseup",l,!0),window.removeEventListener("mousemove",f,!0)}}},f=function(t){if(A){var e=n.getBoundingClientRect(),i=t.clientX-e.left,a=t.clientY-e.top,o=i-s.x,h=a-s.y,c=-180*Math.atan2(o,h)/Math.PI+90;c=5*Math.round(c/5),s.angle=360-c+90,r.setAttribute("transform","rotate("+c+" "+s.x+" "+s.y+")")}};document.documentElement.appendChild(n),n.addEventListener("mousedown",c,!0),window.addEventListener("mouseup",l,!0),window.addEventListener("mousemove",f,!0),this.stopClipping=function(){n.parentNode.removeChild(n),n.removeEventListener("mousedown",c,!0),window.removeEventListener("mouseup",l,!0),window.removeEventListener("mousemove",f,!0),o.stopClipping=function(){}}},t.prototype.stopClipping=function(){},t.prototype.unclip=function(){this.clippingPlaneA=null},Object.defineProperty(t.prototype,"clippingPlaneA",{get:function(){return this._clippingPlaneA},set:function(t){this._clippingPlaneA=t,this._clippingA=null!=t,this._clippingA?this.fire("clipped",{}):this.fire("unclipped",{})},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"clippingPlaneB",{get:function(){return this._clippingPlaneB},set:function(t){this._clippingPlaneB=t,this._clippingB=null!=t,this._clippingB?this.fire("clipped",{}):this.fire("unclipped",{})},enumerable:!0,configurable:!0}),t}();e.Viewer=E;var C=function(){function t(t,e){this.NormalAttrPointer=t.getAttribLocation(e,"aNormal"),this.IndexlAttrPointer=t.getAttribLocation(e,"aVertexIndex"),this.ProductAttrPointer=t.getAttribLocation(e,"aProduct"),this.StateAttrPointer=t.getAttribLocation(e,"aState"),this.StyleAttrPointer=t.getAttribLocation(e,"aStyleIndex"),this.TransformationAttrPointer=t.getAttribLocation(e,"aTransformationIndex"),this.VertexSamplerUniform=t.getUniformLocation(e,"uVertexSampler"),this.MatrixSamplerUniform=t.getUniformLocation(e,"uMatrixSampler"),this.StyleSamplerUniform=t.getUniformLocation(e,"uStyleSampler"),this.VertexTextureSizeUniform=t.getUniformLocation(e,"uVertexTextureSize"),this.MatrixTextureSizeUniform=t.getUniformLocation(e,"uMatrixTextureSize"),this.StyleTextureSizeUniform=t.getUniformLocation(e,"uStyleTextureSize"),t.enableVertexAttribArray(this.NormalAttrPointer),t.enableVertexAttribArray(this.IndexlAttrPointer),t.enableVertexAttribArray(this.ProductAttrPointer),t.enableVertexAttribArray(this.StateAttrPointer),t.enableVertexAttribArray(this.StyleAttrPointer),t.enableVertexAttribArray(this.TransformationAttrPointer)}return t}();e.ModelPointers=C;var m;!function(t){t[t.NORMAL=0]="NORMAL",t[t.GRAYSCALE=1]="GRAYSCALE",t[t.XRAY=2]="XRAY"}(m=e.RenderingMode||(e.RenderingMode={}))},function(t,e,i){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=function(){function t(){}return t.makeFailHTML=function(t){return'<table style="background-color: #8CE; width: 100%; height: 100%;"><tr><td align="center"><div style="display: table-cell; vertical-align: middle;"><div style="">'+t+"</div></div></td></tr></table>"},t.setupWebGL=function(t,e,i){function r(e){var i=t.parentNode;if(i){var r="undefined"!=typeof WebGLRenderingContext?this.OTHER_PROBLEM:this.GET_A_WEBGL_BROWSER;e&&(r+="<br/><br/>Status: "+e),i.innerHTML=this.makeFailHTML(r)}}i=i||r,t.addEventListener&&t.addEventListener("webglcontextcreationerror",function(t){i(t.statusMessage)},!1);var a=this.create3DContext(t,e);return a||"undefined"==typeof WebGLRenderingContext&&i(""),a},t.create3DContext=function(t,e){for(var i=["webgl","experimental-webgl","webkit-3d","moz-webgl"],r=null,a=0;a<i.length;++a){try{r=t.getContext(i[a],e)}catch(t){}if(r)break}return r},t}();r.GET_A_WEBGL_BROWSER='This page requires a browser that supports WebGL.<br/><a href="http://get.webgl.org">Click here to upgrade your browser.</a>',r.OTHER_PROBLEM='It doesn\'t appear your computer can support WebGL.<br/><a href="http://get.webgl.org/troubleshooting/">Click here for more information.</a>',e.WebGLUtils=r,window.requestAnimationFrame=window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||window.oRequestAnimationFrame||window.msRequestAnimationFrame||function(t){window.setTimeout(t,1e3/60)}},function(t,e,i){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.CubeShaders={cube_fshader:" precision mediump float; uniform float uAlpha; uniform sampler2D uTexture; uniform bool uColorCoding; uniform float uHighlighting; varying vec2 vTexCoord; varying vec4 vIdColor; void main(void) { if (uColorCoding) { gl_FragColor = vIdColor; } else { vec4 pixel = texture2D(uTexture, vTexCoord); if (vIdColor.x < 0.0) { gl_FragColor = vec4(pixel.rgb * uHighlighting, uAlpha); } else { gl_FragColor = vec4(pixel.rgb, uAlpha); } } }",cube_vshader:" attribute highp vec3 aVertex; attribute highp vec2 aTexCoord; attribute highp float aId; uniform mat3 uRotation; uniform mat4 uPMatrix; uniform bool uColorCoding; uniform float uSelection; varying vec2 vTexCoord; varying vec4 vIdColor; vec4 getIdColor(float id){ float product = floor(id + 0.5); float B = floor(product / (256.0*256.0)); float G = floor((product - B * 256.0*256.0) / 256.0); float R = mod(product, 256.0); return vec4(R / 255.0, G / 255.0, B / 255.0, 1.0); } void main(void) { vec4 point = vec4(uRotation * aVertex, 1.0); gl_Position = uPMatrix * point; vTexCoord = aTexCoord; if (uColorCoding) { vIdColor = getIdColor(aId); return; } bool isSelected = abs(uSelection - aId) < 0.1; if (isSelected){ vIdColor = vec4(-1.0, -1.0, -1.0, -1.0); } else{ vIdColor = vec4(1.0, 1.0, 1.0, 1.0); } }"}},function(t,e,i){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.CubeTextures={en:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAgAAAAIACAYAAAD0eNT6AAAABHNCSVQICAgIfAhkiAAAIABJREFUeJzt3XmYXFWd//FPLd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1q9nACAAoKwIABVS29amg77yFaVXrgzc97lvfCOEigAAliWjLmCui6dSajvlFC09/XQlGhoC9+/51a/Ue9ddIVQGALCMABCSVEeH5r/udWo79VTVTmPFP0nKDQxo42c/W+bKAAAgAPxFsrlZmbGxafWN19SobvlypVasUNNLXqJ5Rx2l9KpVM65p05VXKtvTM+PjAADwfASACS+/8UYVMhlldu1SZudOZbu7VRgfV3F8XIVsVsVsVrHaWiVSKcXTacXTaSXq61XX1qa6tjYpXt7hFNu/+1113XprWY8JAMBuBIC9xGtrleroUKqjI9I6um67TZuvuSbSGgAAcxuzAKpM/3336dmLL5aKxahLAQDMYdwBqCI7f/pTbbziChWz2ahLAQDMcQSAKlDM5bTpyiu14/rroy4FAGAEASBigw8/rE2f+5yGn3gi6lIAAIYQACIytnmzNl9zjXrvvDPqUgAABhEAKijb06OeX/9a3XfcocGHH5YKhahLAgAYRQCokGKhoCfOOkujGzdGXQoAAEwDrJRYPK5V550XdRkAAEjiDsBfrD/vPMVrapRoalKiqUnJhgb33tioRGOj4rW1itXUKFZTo/jEe3rVKikW8z5H82GHadGJJ2rXTTeF94MAAOCBADCh/777VAi4F8B+H/mIFp10UqA+K84+W32//a2yvb2B+gEAUE48ApiBzVdfrWxfX6A+yeZmrfz3fw+pIgAA/BAAZiA3MKDNX/hC4H4Ljz1WLUceGUJFAAD4IQDMUNfNN2vggQcC91t9/vmKp1IhVAQAQGkEgDLYcNllKgRcv79u6VIte+97Q6oIAICpEQDKYGzTJm2/9trA/dpOPVX1L3pRCBUBADA1AkCZbPvOdzS2ZUugPrFEQqsvvFCK868BAFBZfPOUSSGb1YbLLgvcr/Hgg9X2938fQkUAAOwbAaCMBu6/X1233hq437IPfEC1ixeHUBEAAJMjAJTZ5s9/XrnBwUB9EvX1WnXuuSFVBADACxEAyizb26stV18duN/8175WC17/+vIXBADAJAgAIdh5440afOSRwP1WnnuuEg0NIVQEAMBfIwCEoVjUhksvVTGXC9SttrVVy886K6SiAADYgwAQktFnntH2H/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AAwiAAAAYBABAAAAgwgAAAAYRAAAAMAgAgAAAAYRAAAAMIgAAACAQQQAAAAMIgAAAGAQAQAAAIMIAAAAGEQAAADAIAIAAAAGEQAAADCIAAAAgEEEAAAADCIAAABgEAEAAACDCAAAABhEAAAAwCACAAAABhEAAAAwiAAAAIBBBAAAAAz6/xxM5q4tElQWAAAAAElFTkSuQmCC"}},function(t,e,i){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=i(23),a=i(24),n=i(19),o=i(18),s=i(11),A=function(){function t(t){this.TOP=16e5,this.BOTTOM=1600001,this.LEFT=1600002,this.RIGHT=1600003,this.FRONT=1600004,this.BACK=1600005,this.TOP_LEFT_FRONT=1600006,this.TOP_RIGHT_FRONT=1600007,this.TOP_LEFT_BACK=1600008,this.TOP_RIGHT_BACK=1600009,this.BOTTOM_LEFT_FRONT=1600010,this.BOTTOM_RIGHT_FRONT=1600011,this.BOTTOM_LEFT_BACK=1600012,this.BOTTOM_RIGHT_BACK=1600013,this.TOP_LEFT=1600014,this.TOP_RIGHT=1600015,this.TOP_FRONT=1600016,this.TOP_BACK=1600017,this.BOTTOM_LEFT=1600018,this.BOTTOM_RIGHT=1600019,this.BOTTOM_FRONT=1600020,this.BOTTOM_BACK=1600021,this.FRONT_RIGHT=1600022,this.FRONT_LEFT=1600023,this.BACK_RIGHT=1600024,this.BACK_LEFT=1600025,this._initialized=!1,this.ratio=.15,this.highlighting=1.2,this.activeAlpha=1,this.passiveAlpha=.7,this.position=this.BOTTOM_RIGHT,this.vertices=new Float32Array([-.3,-.5,-.3,.3,-.5,-.3,.3,-.5,.3,-.3,-.5,.3,-.3,.5,-.3,-.3,.5,.3,.3,.5,.3,.3,.5,-.3,-.3,-.3,.5,.3,-.3,.5,.3,.3,.5,-.3,.3,.5,-.3,-.3,-.5,-.3,.3,-.5,.3,.3,-.5,.3,-.3,-.5,.5,-.3,-.3,.5,.3,-.3,.5,.3,.3,.5,-.3,.3,-.5,-.3,-.3,-.5,-.3,.3,-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array([0,1,2,0,2,3,4,5,6,4,6,7,8,9,10,8,10,11,12,13,14,12,14,15,16,17,18,16,18,19,20,21,22,20,22,23,24,25,26,24,26,27,28,29,30,28,30,31,32,33,34,32,34,35,36,37,38,36,38,39,40,41,42,40,42,43,44,45,46,44,46,47,48,49,50,48,50,51,52,53,54,52,54,55,56,57,58,56,58,59,60,61,62,60,62,63,64,65,66,64,66,67,68,69,70,68,70,71,72,74,73,72,75,74,76,77,78,76,78,79,80,81,82,80,82,83,84,86,85,84,87,86,88,89,90,88,90,91,92,93,94,92,94,95,96,98,97,96,99,98,100,101,102,100,102,103,104,105,106,104,106,107,108,110,109,108,111,110,112,113,114,112,114,115,116,117,118,116,118,119,120,121,122,120,122,123,124,125,126,124,126,127,128,129,130,128,130,131,132,133,134,132,134,135,136,137,138,136,138,139,140,141,142,140,142,143,144,145,146,144,146,147,148,149,150,148,150,151,152,154,153,152,155,154,156,157,158,156,158,159,160,161,162,160,162,163,164,165,166,164,166,167,168,170,169,168,171,170,172,173,174,172,174,175,176,178,177,176,179,178,180,181,182,180,182,183,184,185,186,184,186,187,188,189,190,188,190,191,192,193,194,192,194,195,196,197,198,196,198,199,200,201,202,200,202,203,204,205,206,204,206,207,208,209,210,208,210,211,212,213,214,212,214,215]),this.txtCoords=new Float32Array([1/3+1/15,0+1/15,.6,0+1/15,.6,1/3-1/15,1/3+1/15,1/3-1/15,1-1/15,0+1/15,1-1/15,1/3-1/15,2/3+1/15,1/3-1/15,2/3+1/15,0+1/15,2/3+1/15,1/3+1/15,1-1/15,1/3+1/15,1-1/15,.6,2/3+1/15,.6,0+1/15,1/3-1/15,0+1/15,0+1/15,1/3-1/15,0+1/15,1/3-1/15,1/3-1/15,0+1/15,1/3+1/15,1/3-1/15,1/3+1/15,1/3-1/15,.6,0+1/15,.6,.6,1/3+1/15,.6,.6,1/3+1/15,.6,1/3+1/15,1/3+1/15,.7,1/3+1/30,.7,1/3+1/30,.7,1/3+1/30,.7,1/3+1/30,1/3+1/30,1/3+1/30,1/3+1/30,1/3+1/30,1/3+1/30,1/3+1/30,1/3+1/30,1/3+1/30,1/3+1/30,1/30,1/3+1/30,1/30,1/3+1/30,1/30,1/3+1/30,1/30,.7,1/3+1/30,.7,1/3+1/30,.7,1/3+1/30,.7,1/3+1/30,1/30,1/3+1/30,1/30,1/3+1/30,1/30,1/3+1/30,1/30,1/3+1/30,1/3+1/30,1/30,1/3+1/30,1/30,1/3+1/30,1/30,1/3+1/30,1/30,.7,1/3+1/30,.7,1/3+1/30,.7,1/3+1/30,.7,1/3+1/30,1/3+1/30,1/3+1/30,1/3+1/30,1/3+1/30,1/3+1/30,1/3+1/30,1/3+1/30,1/3+1/30,.7,1/30,.7,1/30,.7,1/30,.7,1/30,.7,1/3+1/30,.7,1/3+1/30,.7,1/3+1/30,.7,1/3+1/30,1/30,1/3+1/30,1/30,1/3+1/30,1/30,1/3+1/30,1/30,1/3+1/30,.7,1/30,.7,1/30,.7,1/30,.7,1/30,1/30,1/30,1/30,1/30,1/30,1/30,1/30,1/30,1/3+1/30,1/3+1/30,1/3+1/30,1/3+1/30,1/3+1/30,1/3+1/30,1/3+1/30,1/3+1/30,1/3+1/30,1/30,1/3+1/30,1/30,1/3+1/30,1/30,1/3+1/30,1/30,1/30,1/30,1/30,1/30,1/30,1/30,1/30,1/30,1/30,1/3+1/30,1/30,1/3+1/30,1/30,1/3+1/30,1/30,1/3+1/30,1/3+1/30,1/30,1/3+1/30,1/30,1/3+1/30,1/30,1/3+1/30,1/30,1/30,1/30,1/30,1/30,1/30,1/30,1/30,1/30,1/3+1/30,1/3+1/30,1/3+1/30,1/3+1/30,1/3+1/30,1/3+1/30,1/3+1/30,1/3+1/30,.7,1/30,.7,1/30,.7,1/30,.7,1/30,1/30,1/30,1/30,1/30,1/30,1/30,1/30,1/30,1/30,1/3+1/30,1/30,1/3+1/30,1/30,1/3+1/30,1/30,1/3+1/30,.7,1/30,.7,1/30,.7,1/30,.7,1/30,2/3+2/30,1/3+1/30,2/3+2/30,1/3+1/30,2/3+2/30,1/3+1/30,2/3+2/30,1/3+1/30,2/30,1/3+1/30,2/30,1/3+1/30,2/30,1/3+1/30,2/30,1/3+1/30,2/3+2/30,1/3+1/30,2/3+2/30,1/3+1/30,2/3+2/30,1/3+1/30,2/3+2/30,1/3+1/30,1/3+2/30,1/3+1/30,1/3+2/30,1/3+1/30,1/3+2/30,1/3+1/30,1/3+2/30,1/3+1/30,2/3+2/30,1/3+1/30,2/3+2/30,1/3+1/30,2/3+2/30,1/3+1/30,2/3+2/30,1/3+1/30,1/3+2/30,1/30,1/3+2/30,1/30,1/3+2/30,1/30,1/3+2/30,1/30,2/3+2/30,1/3+1/30,2/3+2/30,1/3+1/30,2/3+2/30,1/3+1/30,2/3+2/30,1/3+1/30,2/3+2/30,1/30,2/3+2/30,1/30,2/3+2/30,1/30,2/3+2/30,1/30,2/30,1/30,2/30,1/30,2/30,1/30,2/30,1/30,2/30,1/3+1/30,2/30,1/3+1/30,2/30,1/3+1/30,2/30,1/3+1/30,2/30,1/30,2/30,1/30,2/30,1/30,2/30,1/30,1/3+2/30,1/3+1/30,1/3+2/30,1/3+1/30,1/3+2/30,1/3+1/30,1/3+2/30,1/3+1/30,2/30,1/30,2/30,1/30,2/30,1/30,2/30,1/30,1/3+2/30,1/30,1/3+2/30,1/30,1/3+2/30,1/30,1/3+2/30,1/30,2/30,1/30,2/30,1/30,2/30,1/30,2/30,1/30,2/3+2/30,1/30,2/3+2/30,1/30,2/3+2/30,1/30,2/3+2/30,1/30,1/3+2/30,1/30,1/3+2/30,1/30,1/3+2/30,1/30,1/3+2/30,1/30,2/30,1/3+1/30,2/30,1/3+1/30,2/30,1/3+1/30,2/30,1/3+1/30,1/3+2/30,1/30,1/3+2/30,1/30,1/3+2/30,1/30,1/3+2/30,1/30,1/3+2/30,1/3+1/30,1/3+2/30,1/3+1/30,1/3+2/30,1/3+1/30,1/3+2/30,1/3+1/30,2/3+2/30,1/30,2/3+2/30,1/30,2/3+2/30,1/30,2/3+2/30,1/30,2/30,1/3+1/30,2/30,1/3+1/30,2/30,1/3+1/30,2/30,1/3+1/30,2/3+2/30,1/30,2/3+2/30,1/30,2/3+2/30,1/30,2/3+2/30,1/30,1/3+2/30,1/3+1/30,1/3+2/30,1/3+1/30,1/3+2/30,1/3+1/30,1/3+2/30,1/3+1/30]),this.ids=new Float32Array([this.FRONT,this.FRONT,this.FRONT,this.FRONT,this.BACK,this.BACK,this.BACK,this.BACK,this.TOP,this.TOP,this.TOP,this.TOP,this.BOTTOM,this.BOTTOM,this.BOTTOM,this.BOTTOM,this.RIGHT,this.RIGHT,this.RIGHT,this.RIGHT,this.LEFT,this.LEFT,this.LEFT,this.LEFT,this.TOP_LEFT_FRONT,this.TOP_LEFT_FRONT,this.TOP_LEFT_FRONT,this.TOP_LEFT_FRONT,this.TOP_LEFT_FRONT,this.TOP_LEFT_FRONT,this.TOP_LEFT_FRONT,this.TOP_LEFT_FRONT,this.TOP_LEFT_FRONT,this.TOP_LEFT_FRONT,this.TOP_LEFT_FRONT,this.TOP_LEFT_FRONT,this.TOP_RIGHT_FRONT,this.TOP_RIGHT_FRONT,this.TOP_RIGHT_FRONT,this.TOP_RIGHT_FRONT,this.TOP_RIGHT_FRONT,this.TOP_RIGHT_FRONT,this.TOP_RIGHT_FRONT,this.TOP_RIGHT_FRONT,this.TOP_RIGHT_FRONT,this.TOP_RIGHT_FRONT,this.TOP_RIGHT_FRONT,this.TOP_RIGHT_FRONT,this.TOP_LEFT_BACK,this.TOP_LEFT_BACK,this.TOP_LEFT_BACK,this.TOP_LEFT_BACK,this.TOP_LEFT_BACK,this.TOP_LEFT_BACK,this.TOP_LEFT_BACK,this.TOP_LEFT_BACK,this.TOP_LEFT_BACK,this.TOP_LEFT_BACK,this.TOP_LEFT_BACK,this.TOP_LEFT_BACK,this.TOP_RIGHT_BACK,this.TOP_RIGHT_BACK,this.TOP_RIGHT_BACK,this.TOP_RIGHT_BACK,this.TOP_RIGHT_BACK,this.TOP_RIGHT_BACK,this.TOP_RIGHT_BACK,this.TOP_RIGHT_BACK,this.TOP_RIGHT_BACK,this.TOP_RIGHT_BACK,this.TOP_RIGHT_BACK,this.TOP_RIGHT_BACK,this.BOTTOM_LEFT_FRONT,this.BOTTOM_LEFT_FRONT,this.BOTTOM_LEFT_FRONT,this.BOTTOM_LEFT_FRONT,this.BOTTOM_LEFT_FRONT,this.BOTTOM_LEFT_FRONT,this.BOTTOM_LEFT_FRONT,this.BOTTOM_LEFT_FRONT,this.BOTTOM_LEFT_FRONT,this.BOTTOM_LEFT_FRONT,this.BOTTOM_LEFT_FRONT,this.BOTTOM_LEFT_FRONT,this.BOTTOM_RIGHT_FRONT,this.BOTTOM_RIGHT_FRONT,this.BOTTOM_RIGHT_FRONT,this.BOTTOM_RIGHT_FRONT,this.BOTTOM_RIGHT_FRONT,this.BOTTOM_RIGHT_FRONT,this.BOTTOM_RIGHT_FRONT,this.BOTTOM_RIGHT_FRONT,this.BOTTOM_RIGHT_FRONT,this.BOTTOM_RIGHT_FRONT,this.BOTTOM_RIGHT_FRONT,this.BOTTOM_RIGHT_FRONT,this.BOTTOM_LEFT_BACK,this.BOTTOM_LEFT_BACK,this.BOTTOM_LEFT_BACK,this.BOTTOM_LEFT_BACK,this.BOTTOM_LEFT_BACK,this.BOTTOM_LEFT_BACK,this.BOTTOM_LEFT_BACK,this.BOTTOM_LEFT_BACK,this.BOTTOM_LEFT_BACK,this.BOTTOM_LEFT_BACK,this.BOTTOM_LEFT_BACK,this.BOTTOM_LEFT_BACK,this.BOTTOM_RIGHT_BACK,this.BOTTOM_RIGHT_BACK,this.BOTTOM_RIGHT_BACK,this.BOTTOM_RIGHT_BACK,this.BOTTOM_RIGHT_BACK,this.BOTTOM_RIGHT_BACK,this.BOTTOM_RIGHT_BACK,this.BOTTOM_RIGHT_BACK,this.BOTTOM_RIGHT_BACK,this.BOTTOM_RIGHT_BACK,this.BOTTOM_RIGHT_BACK,this.BOTTOM_RIGHT_BACK,this.TOP_RIGHT,this.TOP_RIGHT,this.TOP_RIGHT,this.TOP_RIGHT,this.TOP_RIGHT,this.TOP_RIGHT,this.TOP_RIGHT,this.TOP_RIGHT,this.TOP_LEFT,this.TOP_LEFT,this.TOP_LEFT,this.TOP_LEFT,this.TOP_LEFT,this.TOP_LEFT,this.TOP_LEFT,this.TOP_LEFT,this.TOP_FRONT,this.TOP_FRONT,this.TOP_FRONT,this.TOP_FRONT,this.TOP_FRONT,this.TOP_FRONT,this.TOP_FRONT,this.TOP_FRONT,this.TOP_BACK,this.TOP_BACK,this.TOP_BACK,this.TOP_BACK,this.TOP_BACK,this.TOP_BACK,this.TOP_BACK,this.TOP_BACK,this.BOTTOM_RIGHT,this.BOTTOM_RIGHT,this.BOTTOM_RIGHT,this.BOTTOM_RIGHT,this.BOTTOM_RIGHT,this.BOTTOM_RIGHT,this.BOTTOM_RIGHT,this.BOTTOM_RIGHT,this.BOTTOM_LEFT,this.BOTTOM_LEFT,this.BOTTOM_LEFT,this.BOTTOM_LEFT,this.BOTTOM_LEFT,this.BOTTOM_LEFT,this.BOTTOM_LEFT,this.BOTTOM_LEFT,this.BOTTOM_FRONT,this.BOTTOM_FRONT,this.BOTTOM_FRONT,this.BOTTOM_FRONT,this.BOTTOM_FRONT,this.BOTTOM_FRONT,this.BOTTOM_FRONT,this.BOTTOM_FRONT,this.BOTTOM_BACK,this.BOTTOM_BACK,this.BOTTOM_BACK,this.BOTTOM_BACK,this.BOTTOM_BACK,this.BOTTOM_BACK,this.BOTTOM_BACK,this.BOTTOM_BACK,this.FRONT_RIGHT,this.FRONT_RIGHT,this.FRONT_RIGHT,this.FRONT_RIGHT,this.FRONT_RIGHT,this.FRONT_RIGHT,this.FRONT_RIGHT,this.FRONT_RIGHT,this.FRONT_LEFT,this.FRONT_LEFT,this.FRONT_LEFT,this.FRONT_LEFT,this.FRONT_LEFT,this.FRONT_LEFT,this.FRONT_LEFT,this.FRONT_LEFT,this.BACK_RIGHT,this.BACK_RIGHT,this.BACK_RIGHT,this.BACK_RIGHT,this.BACK_RIGHT,this.BACK_RIGHT,this.BACK_RIGHT,this.BACK_RIGHT,this.BACK_LEFT,this.BACK_LEFT,this.BACK_LEFT,this.BACK_LEFT,this.BACK_LEFT,this.BACK_LEFT,this.BACK_LEFT,this.BACK_LEFT]),this._image=t}return t.prototype.init=function(t){var e=this;this.viewer=t;var i=this.viewer.gl;this._shader=null,this._initShader(),this._alpha=this.passiveAlpha,this._selection=0,i.useProgram(this._shader),this._pMatrixUniformPointer=i.getUniformLocation(this._shader,"uPMatrix"),this._rotationUniformPointer=i.getUniformLocation(this._shader,"uRotation"),this._colourCodingUniformPointer=i.getUniformLocation(this._shader,"uColorCoding"),this._alphaUniformPointer=i.getUniformLocation(this._shader,"uAlpha"),this._selectionUniformPointer=i.getUniformLocation(this._shader,"uSelection"),this._textureUniformPointer=i.getUniformLocation(this._shader,"uTexture"),this._highlightingUniformPointer=i.getUniformLocation(this._shader,"uHighlighting"),this._vertexAttrPointer=i.getAttribLocation(this._shader,"aVertex"),this._texCoordAttrPointer=i.getAttribLocation(this._shader,"aTexCoord"),this._idAttrPointer=i.getAttribLocation(this._shader,"aId"),i.enableVertexAttribArray(this._vertexAttrPointer),i.enableVertexAttribArray(this._texCoordAttrPointer),i.enableVertexAttribArray(this._idAttrPointer),this._indexBuffer=i.createBuffer(),this._vertexBuffer=i.createBuffer(),this._texCoordBuffer=i.createBuffer(),this._idBuffer=i.createBuffer(),i.bindBuffer(i.ELEMENT_ARRAY_BUFFER,this._indexBuffer),i.bufferData(i.ELEMENT_ARRAY_BUFFER,this.indices,i.STATIC_DRAW),i.bindBuffer(i.ARRAY_BUFFER,this._vertexBuffer),i.bufferData(i.ARRAY_BUFFER,this.vertices,i.STATIC_DRAW),i.bindBuffer(i.ARRAY_BUFFER,this._texCoordBuffer),i.bufferData(i.ARRAY_BUFFER,this.txtCoords,i.STATIC_DRAW),i.bindBuffer(i.ARRAY_BUFFER,this._idBuffer),i.bufferData(i.ARRAY_BUFFER,this.ids,i.STATIC_DRAW);var e=this;if(this._texture=i.createTexture(),void 0===this._image){var r=a.CubeTextures.en,n=new Image;e._image=n,n.addEventListener("load",function(){i.bindTexture(i.TEXTURE_2D,e._texture),i.pixelStorei(i.UNPACK_FLIP_Y_WEBGL,1),i.texImage2D(i.TEXTURE_2D,0,i.RGBA,i.RGBA,i.UNSIGNED_BYTE,e._image),i.texParameteri(i.TEXTURE_2D,i.TEXTURE_MAG_FILTER,i.LINEAR),i.texParameteri(i.TEXTURE_2D,i.TEXTURE_MIN_FILTER,i.LINEAR_MIPMAP_NEAREST),i.generateMipmap(i.TEXTURE_2D)}),n.src=r}else i.bindTexture(i.TEXTURE_2D,e._texture),i.pixelStorei(i.UNPACK_FLIP_Y_WEBGL,1),i.texImage2D(i.TEXTURE_2D,0,i.RGBA,i.RGBA,i.UNSIGNED_BYTE,e._image),i.texParameteri(i.TEXTURE_2D,i.TEXTURE_MAG_FILTER,i.LINEAR),i.texParameteri(i.TEXTURE_2D,i.TEXTURE_MIN_FILTER,i.LINEAR_MIPMAP_NEAREST),i.generateMipmap(i.TEXTURE_2D);i.useProgram(this.viewer._shaderProgram),t._canvas.addEventListener("mousemove",function(i){var r=i.clientX,a=i.clientY,n=t._canvas.getBoundingClientRect(),o=r-n.left,s=t._height-(a-n.top);if(e._region){var A=e._region[0]*t._width,h=e._region[2]*t._width,c=e._region[1]*t._height,u=e._region[3]*t._height;if(o<A||o>h||s<c||s>u)return e._alpha=e.passiveAlpha,void(e._selection=0);var l=t.getID(o,s);l>=e.TOP&&l<=e.BACK_LEFT?(e._alpha=e.activeAlpha,e._selection=l):(e._alpha=e.passiveAlpha,e._selection=0)}},!0),e._drag=!1,t._canvas.addEventListener("mousedown",function(i){var r=i.clientX,a=i.clientY,n=t._canvas.getBoundingClientRect(),o=r-n.left,s=t._height-(a-n.top),A=t.getID(o,s);A>=e.TOP&&A<=e.BACK_LEFT&&(e._drag=!0,e._originalNavigation=t.navigationMode,t.navigationMode="orbit")},!0),window.addEventListener("mouseup",function(i){!0===e._drag&&(t.navigationMode=e._originalNavigation),e._drag=!1},!0),this._initialized=!0},t.prototype.onBeforeDraw=function(){},t.prototype.onBeforePick=function(t){if(t>=this.TOP&&t<=this.BACK_LEFT){var e=s.vec3.create(),i=this.viewer._distance;switch(t){case this.TOP:return this.viewer.show("top"),!0;case this.BOTTOM:return this.viewer.show("bottom"),!0;case this.LEFT:return this.viewer.show("left"),!0;case this.RIGHT:return this.viewer.show("right"),!0;case this.FRONT:return this.viewer.show("front"),!0;case this.BACK:return this.viewer.show("back"),!0;case this.TOP_LEFT_FRONT:e=s.vec3.fromValues(-1,-1,1),i*=1.3;break;case this.TOP_RIGHT_FRONT:e=s.vec3.fromValues(1,-1,1),i*=1.3;break;case this.TOP_LEFT_BACK:e=s.vec3.fromValues(-1,1,1),i*=1.3;break;case this.TOP_RIGHT_BACK:e=s.vec3.fromValues(1,1,1),i*=1.3;break;case this.BOTTOM_LEFT_FRONT:e=s.vec3.fromValues(-1,-1,-1),i*=1.3;break;case this.BOTTOM_RIGHT_FRONT:e=s.vec3.fromValues(1,-1,-1),i*=1.3;break;case this.BOTTOM_LEFT_BACK:e=s.vec3.fromValues(-1,1,-1),i*=1.3;break;case this.BOTTOM_RIGHT_BACK:e=s.vec3.fromValues(1,1,-1),i*=1.3;break;case this.TOP_LEFT:e=s.vec3.fromValues(-1,0,1),i*=1.3;break;case this.TOP_RIGHT:e=s.vec3.fromValues(1,0,1),i*=1.3;break;case this.TOP_FRONT:e=s.vec3.fromValues(0,-1,1),i*=1.3;break;case this.TOP_BACK:e=s.vec3.fromValues(0,1,1),i*=1.3;break;case this.BOTTOM_LEFT:e=s.vec3.fromValues(-1,0,-1),i*=1.3;break;case this.BOTTOM_RIGHT:e=s.vec3.fromValues(1,0,-1);break;case this.BOTTOM_FRONT:e=s.vec3.fromValues(0,-1,-1),i*=1.3;break;case this.BOTTOM_BACK:e=s.vec3.fromValues(0,1,-1),i*=1.3;break;case this.FRONT_RIGHT:e=s.vec3.fromValues(1,-1,0),i*=1.3;break;case this.FRONT_LEFT:e=s.vec3.fromValues(-1,-1,0),i*=1.3;break;case this.BACK_RIGHT:e=s.vec3.fromValues(1,1,0),i*=1.3;break;case this.BACK_LEFT:e=s.vec3.fromValues(-1,1,0),i*=1.3}var r=this.viewer._origin,a=s.vec3.fromValues(0,0,1),o=s.vec3.fromValues(r[0],r[1],r[2]);e=s.vec3.normalize(s.vec3.create(),e);var A=s.vec3.scale(s.vec3.create(),e,i),h=s.vec3.add(s.vec3.create(),o,A);return n.mat4.lookAt(this.viewer.mvMatrix,h,o,a),!0}return!1},t.prototype.onAfterDraw=function(){this.setActive().uniform1i(this._colourCodingUniformPointer,0),this.draw(),this.setInactive()},t.prototype.onBeforeDrawId=function(){},t.prototype.onAfterDrawId=function(){this.setActive().uniform1i(this._colourCodingUniformPointer,1),this.draw(),this.setInactive()},t.prototype.onBeforeGetId=function(t){return!1},t.prototype.setActive=function(){var t=this.viewer.gl;return t.useProgram(this._shader),t},t.prototype.setInactive=function(){this.viewer.gl.useProgram(this.viewer._shaderProgram)},t.prototype.draw=function(){if(this._initialized){var t=this.viewer.gl,e=n.mat4.create(),i=1/this.ratio,r=i/this.viewer._height*this.viewer._width,a=this.ratio*this.viewer._height/this.viewer._width*2,s=2*this.ratio;switch(this.position){case this.BOTTOM_RIGHT:n.mat4.ortho(e,1-r,1,-1,i-1,-1,1),this._region=[1-a,0,1,s];break;case this.BOTTOM_LEFT:n.mat4.ortho(e,-1,r-1,-1,i-1,-1,1),this._region=[0,0,a,s];break;case this.TOP_LEFT:n.mat4.ortho(e,-1,r-1,1-i,1,-1,1),this._region=[0,1-s,a,1];break;case this.TOP_RIGHT:n.mat4.ortho(e,1-r,1,1-i,1,-1,1),this._region=[1-a,1-s,1,1]}var A=o.mat3.fromMat4(o.mat3.create(),this.viewer.mvMatrix);t.uniformMatrix4fv(this._pMatrixUniformPointer,!1,e),t.uniformMatrix3fv(this._rotationUniformPointer,!1,A),t.uniform1f(this._alphaUniformPointer,this._alpha),t.uniform1f(this._highlightingUniformPointer,this.highlighting),t.uniform1f(this._selectionUniformPointer,this._selection),t.bindBuffer(t.ARRAY_BUFFER,this._vertexBuffer),t.vertexAttribPointer(this._vertexAttrPointer,3,t.FLOAT,!1,0,0),t.bindBuffer(t.ARRAY_BUFFER,this._idBuffer),t.vertexAttribPointer(this._idAttrPointer,1,t.FLOAT,!1,0,0),t.bindBuffer(t.ARRAY_BUFFER,this._texCoordBuffer),t.vertexAttribPointer(this._texCoordAttrPointer,2,t.FLOAT,!1,0,0),t.activeTexture(t.TEXTURE1),t.bindTexture(t.TEXTURE_2D,this._texture),t.uniform1i(this._textureUniformPointer,1);var h=t.getParameter(t.CULL_FACE);h||t.enable(t.CULL_FACE),t.bindBuffer(t.ELEMENT_ARRAY_BUFFER,this._indexBuffer),t.drawElements(t.TRIANGLES,this.indices.length,t.UNSIGNED_SHORT,0),h||t.disable(t.CULL_FACE)}},t.prototype._initShader=function(){var t=this.viewer.gl,e=this.viewer,i=function(i,r){if(t.shaderSource(i,r),t.compileShader(i),!t.getShaderParameter(i,t.COMPILE_STATUS))return e.error(t.getShaderInfoLog(i)),null},a=t.createShader(t.FRAGMENT_SHADER);i(a,r.CubeShaders.cube_fshader);var n=t.createShader(t.VERTEX_SHADER);i(n,r.CubeShaders.cube_vshader),this._shader=t.createProgram(),t.attachShader(this._shader,n),t.attachShader(this._shader,a),t.linkProgram(this._shader),t.getProgramParameter(this._shader,t.LINK_STATUS)||e.error("Could not initialise shaders for a navigation cube plugin")},t}();e.NavigationCube=A},function(t,e,i){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.HomeTextures={en:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAASMAAAEXCAYAAADmyyKWAAAABHNCSVQICAgIfAhkiAAADtpJREFUeJzt3XuwrXVdx/H3Fzicw+VwB5EABRGIh6sUkCSlkZbIRVQuapIXwiJNy1vaZSbLLJtsZKzIgYKBQFBABEIQBA/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FIyRpBSMkaQUjJGkFIyRpBSMkaQUjJGkFIyRpBSMkaQUjJGkFIyRpBSMkaQUjJGkFIyRpBSMkaQUjJGkFIyRpBSMkaQUjJGkFIyRpBSMkaQUjJGkFIyRpBSMkaQUjJGkFIyRpBSMkaQUjJGkFIyRpBSMkaQUjJGkFIyRpBSMkaQUjJGkFDZqPSC7r51xBrFiResZE/fIvfeO5XHvP/98vn3DDWN57Mzqww+3npBe1Fpbb1i0EnEScEHrHVJSJ3e1Xth6xGL5zzRJKRgjSSkYI0kpGCNJKRgjSSkYI0kpGCNJKRgjSSkYI0kpGCNJKRgjSSkYI0kpGCNJKRgjSSkYI0kpGCNJKRgjSSkYI0kpGCNJKRgjSSkYI0kpGCNJKRgjSSkYI0kpGCNJKRgjSSkYI0kpGCNJKRgjSSkYI0kpGCNJKRgjSSkYI0kpGCNJKRgjSSkYI0kpGCNJKRgjSSkYI0kpGCNJKRgjSSkYI0kpGCNJKRgjSSkYI0kpGCNJKRgjSSkYI0kpGCNJKRgjSSkYI0kpGCNJKRgjSSkYI0kpGCNJKRgjSSkYI0kpGCNJKRgjSSkYI0kpGCNJKRgjSSkYI0kpGCNJKRgjSSkYI0kpGCNJKRgjSSkYI0kpGCNJKRgjSSkYI0kpGCNJKRgjSSkYI0kpGCNJKRgjSSkYI0kpGCNJKRgjSSkYI0kpGCNJKfwvQct8OdSrePoAAAAASUVORK5CYII="}},function(t,e,i){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=i(26),a=i(11),n=function(){function t(t){this.ratio=.2,this.placementX=.05,this.placementY=.05,this.activeAlpha=1,this.passiveAlpha=.3,this.distance=null,this.viewDirection=[1,1,-1],this._image=t}return t.prototype.init=function(t){this._viewer=t;var e=this;if(void 0===this._image){var i=r.HomeTextures.en,n=new Image;e._image=n,n.addEventListener("load",function(){e._adjust()}),n.src=i}else e._adjust();document.documentElement.appendChild(this._image),e._image.addEventListener("click",function(){var t=e._viewer;t.setCameraTarget();var i=(t._origin,null!=e.distance?e.distance:t._distance),r=a.vec3.normalize(a.vec3.create(),e.viewDirection),n=a.vec3.scale(a.vec3.create(),r,-1*i);t.setCameraPosition(Array.prototype.slice.call(n))}),e._image.addEventListener("mouseover",function(){e._image.style.opacity=e.activeAlpha.toString(),e._image.style.filter="alpha(opacity="+Math.round(100*e.activeAlpha)+")"}),e._image.addEventListener("mouseleave",function(){e._image.style.opacity=e.passiveAlpha.toString(),e._image.style.filter="alpha(opacity="+Math.round(100*e.passiveAlpha)+")"}),e._image.style.opacity=this.passiveAlpha.toString(),e._image.style.filter="alpha(opacity="+Math.round(100*this.passiveAlpha)+")"},t.prototype._adjust=function(){var t=this._viewer._canvas,e=function(t){var e=t.getBoundingClientRect(),i=document.body,r=document.documentElement,a=window.pageYOffset||r.scrollTop||i.scrollTop,n=window.pageXOffset||r.scrollLeft||i.scrollLeft,o=r.clientTop||i.clientTop||0,s=r.clientLeft||i.clientLeft||0;return{top:Math.round(e.top+a-o),left:Math.round(e.left+n-s),width:Math.round(e.width),height:Math.round(e.height)}}(t);this._image.style.width=Math.round(e.height*this.ratio)+"px",this._image.style.height=Math.round(e.height*this.ratio)+"px",this._image.style.position="absolute",this._image.style.left=Math.round(e.left+e.width*this.placementX)+"px",this._image.style.top=Math.round(e.top+e.height*this.placementY)+"px"},t.prototype.onBeforeDraw=function(){},t.prototype.onBeforePick=function(t){return!1},t.prototype.onAfterDraw=function(){this._adjust()},t.prototype.onBeforeDrawId=function(){},t.prototype.onAfterDrawId=function(){},t.prototype.onBeforeGetId=function(t){return!1},t.prototype.draw=function(){},t}();e.NavigationHome=n},function(t,e,i){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.Shaders={fragment_shader:" precision mediump float; uniform vec4 uClippingPlaneA; uniform vec4 uClippingPlaneB; uniform bool uClippingA; uniform bool uClippingB; varying vec4 vFrontColor; varying vec4 vBackColor; varying vec3 vPosition; varying float vDiscard; void main(void) { if ( vDiscard > 0.5) discard; if (uClippingA) { vec4 p = uClippingPlaneA; vec3 x = vPosition; float distance = (dot(p.xyz, x) + p.w) / length(p.xyz); if (distance < 0.0){ discard; } } if (uClippingB) { vec4 p = uClippingPlaneB; vec3 x = vPosition; float distance = (dot(p.xyz, x) + p.w) / length(p.xyz); if (distance < 0.0) { discard; } } gl_FragColor = gl_FrontFacing ? vFrontColor : vBackColor; }",vertex_shader:" attribute highp float aVertexIndex; attribute highp float aTransformationIndex; attribute highp float aStyleIndex; attribute highp float aProduct; attribute highp vec2 aState; attribute highp vec2 aNormal; uniform mat4 uMVMatrix; uniform mat4 uPMatrix; uniform vec4 ulightA; uniform vec4 ulightB; uniform vec4 uHighlightColour; uniform vec4 uExtraHighlightColour; uniform float uMeter; uniform bool uColorCoding; uniform int uRenderingMode; uniform highp sampler2D uVertexSampler; uniform int uVertexTextureSize; uniform highp sampler2D uMatrixSampler; uniform int uMatrixTextureSize; uniform highp sampler2D uStyleSampler; uniform int uStyleTextureSize; uniform highp sampler2D uStateStyleSampler; varying vec4 vFrontColor; varying vec4 vBackColor; varying vec3 vPosition; varying float vDiscard; vec3 getNormal() { float U = aNormal[0]; float V = aNormal[1]; float PI = 3.1415926535897932384626433832795; float lon = U / 252.0 * 2.0 * PI; float lat = V / 252.0 * PI; float x = sin(lon) * sin(lat); float z = cos(lon) * sin(lat); float y = cos(lat); return normalize(vec3(x, y, z)); } vec4 getIdColor() { float product = floor(aProduct + 0.5); float B = floor(product / (256.0*256.0)); float G = floor((product - B * 256.0*256.0) / 256.0); float R = mod(product, 256.0); return vec4(R / 255.0, G / 255.0, B / 255.0, 1.0); } vec2 getTextureCoordinates(int index, int size) { float x = float(index - (index / size) * size); float y = float(index / size); float pixelSize = 1.0 / float(size); return vec2((x + 0.5) * pixelSize, (y + 0.5) * pixelSize); } vec4 getColor() { int restyle = int(floor(aState[1] + 0.5)); if (restyle > 224) { int index = int(floor(aStyleIndex + 0.5)); vec2 coords = getTextureCoordinates(index, uStyleTextureSize); vec4 col = texture2D(uStyleSampler, coords); if (uRenderingMode == 0) { return col; } float intensity = (col.r + col.g + col.b) / 3.0; return vec4(intensity, intensity, intensity, col.a); } vec2 coords = getTextureCoordinates(restyle, 15); return texture2D(uStateStyleSampler, coords); } vec3 getVertexPosition() { int index = int(floor(aVertexIndex + 0.5)); vec2 coords = getTextureCoordinates(index, uVertexTextureSize); vec3 point = vec3(texture2D(uVertexSampler, coords)); if (aTransformationIndex < 0.0) { return point; } int tIndex = int(floor(aTransformationIndex + 0.5)); tIndex *= 4; mat4 transform = mat4( texture2D(uMatrixSampler, getTextureCoordinates(tIndex, uMatrixTextureSize)), texture2D(uMatrixSampler, getTextureCoordinates(tIndex + 1, uMatrixTextureSize)), texture2D(uMatrixSampler, getTextureCoordinates(tIndex + 2, uMatrixTextureSize)), texture2D(uMatrixSampler, getTextureCoordinates(tIndex + 3, uMatrixTextureSize)) ); return vec3(transform * vec4(point, 1.0)); } void main(void) { int state = int(floor(aState[0] + 0.5)); vDiscard = 0.0; if (state == 254) { vDiscard = 1.0; vFrontColor = vec4(0.0, 0.0, 0.0, 0.0); vBackColor = vec4(0.0, 0.0, 0.0, 0.0); vPosition = vec3(0.0, 0.0, 0.0); gl_Position = vec4(0.0, 0.0, 0.0, 1.0); return; } vec3 vertex = getVertexPosition(); vec3 normal = getNormal(); vec3 backNormal = normal * -1.0; if (uColorCoding) { vec4 idColor = getIdColor(); vFrontColor = idColor; vBackColor = idColor; } else { float lightAIntensity = ulightA[3]; vec3 lightADirection = normalize(ulightA.xyz - vertex); float lightBIntensity = ulightB[3]; vec3 lightBDirection = normalize(ulightB.xyz - vertex); float lightWeightA = max(dot(normal, lightADirection) * lightAIntensity, 0.0); float lightWeightB = max(dot(normal, lightBDirection) * lightBIntensity, 0.0); float backLightWeightA = max(dot(backNormal, lightADirection) * lightAIntensity, 0.0); float backLightWeightB = max(dot(backNormal, lightBDirection) * lightBIntensity, 0.0); float lightWeighting = lightWeightA + lightWeightB + 0.4; float backLightWeighting = backLightWeightA + backLightWeightB + 0.4; vec4 baseColor = vec4(1.0, 1.0, 1.0, 1.0); if (uRenderingMode == 2) { if (state == 252) { baseColor = getColor(); } else { baseColor = vec4(0.0, 0.0, 0.3, 0.5); } } if (state == 251) { baseColor = uExtraHighlightColour; } else if (state == 253) { baseColor = uHighlightColour; } if (uRenderingMode != 2 && state != 253 && state != 251) { baseColor = getColor(); } if (baseColor.a < 0.98 && uRenderingMode == 0) { vec3 trans = -0.002 * uMeter * normalize(normal); vertex = vertex + trans; } vFrontColor = vec4(baseColor.rgb * lightWeighting, baseColor.a); vBackColor = vec4(baseColor.rgb * backLightWeighting, baseColor.a); } vPosition = vertex; gl_Position = uPMatrix * uMVMatrix * vec4(vertex, 1.0); }"}},,,function(t,e,i){"use strict";function r(t){for(var i in t)e.hasOwnProperty(i)||(e[i]=t[i])}Object.defineProperty(e,"__esModule",{value:!0}),r(i(1)),r(i(3)),r(i(15)),r(i(16)),r(i(2)),r(i(0)),r(i(5)),r(i(21))}])});
//# sourceMappingURL=xbim-viewer.min.js.map