Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@plattar/plattar-api

Package Overview
Dependencies
Maintainers
1
Versions
70
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@plattar/plattar-api - npm Package Compare versions

Comparing version 1.99.4 to 1.101.1

2

build/es2015/plattar-api-min.js

@@ -1,1 +0,1 @@

"use strict";function _slicedToArray(arr,i){return _arrayWithHoles(arr)||_iterableToArrayLimit(arr,i)||_unsupportedIterableToArray(arr,i)||_nonIterableRest()}function _nonIterableRest(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function _unsupportedIterableToArray(o,minLen){if(!o)return;if(typeof o==="string")return _arrayLikeToArray(o,minLen);var n=Object.prototype.toString.call(o).slice(8,-1);if(n==="Object"&&o.constructor)n=o.constructor.name;if(n==="Map"||n==="Set")return Array.from(o);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return _arrayLikeToArray(o,minLen)}function _arrayLikeToArray(arr,len){if(len==null||len>arr.length)len=arr.length;for(var i=0,arr2=new Array(len);i<len;i++){arr2[i]=arr[i]}return arr2}function _iterableToArrayLimit(arr,i){if(typeof Symbol==="undefined"||!(Symbol.iterator in Object(arr)))return;var _arr=[];var _n=true;var _d=false;var _e=undefined;try{for(var _i=arr[Symbol.iterator](),_s;!(_n=(_s=_i.next()).done);_n=true){_arr.push(_s.value);if(i&&_arr.length===i)break}}catch(err){_d=true;_e=err}finally{try{if(!_n&&_i["return"]!=null)_i["return"]()}finally{if(_d)throw _e}}return _arr}function _arrayWithHoles(arr){if(Array.isArray(arr))return arr}function _inherits(subClass,superClass){if(typeof superClass!=="function"&&superClass!==null){throw new TypeError("Super expression must either be null or a function")}subClass.prototype=Object.create(superClass&&superClass.prototype,{constructor:{value:subClass,writable:true,configurable:true}});if(superClass)_setPrototypeOf(subClass,superClass)}function _setPrototypeOf(o,p){_setPrototypeOf=Object.setPrototypeOf||function _setPrototypeOf(o,p){o.__proto__=p;return o};return _setPrototypeOf(o,p)}function _createSuper(Derived){var hasNativeReflectConstruct=_isNativeReflectConstruct();return function _createSuperInternal(){var Super=_getPrototypeOf(Derived),result;if(hasNativeReflectConstruct){var NewTarget=_getPrototypeOf(this).constructor;result=Reflect.construct(Super,arguments,NewTarget)}else{result=Super.apply(this,arguments)}return _possibleConstructorReturn(this,result)}}function _possibleConstructorReturn(self,call){if(call&&(_typeof(call)==="object"||typeof call==="function")){return call}return _assertThisInitialized(self)}function _assertThisInitialized(self){if(self===void 0){throw new ReferenceError("this hasn't been initialised - super() hasn't been called")}return self}function _isNativeReflectConstruct(){if(typeof Reflect==="undefined"||!Reflect.construct)return false;if(Reflect.construct.sham)return false;if(typeof Proxy==="function")return true;try{Date.prototype.toString.call(Reflect.construct(Date,[],function(){}));return true}catch(e){return false}}function _getPrototypeOf(o){_getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf:function _getPrototypeOf(o){return o.__proto__||Object.getPrototypeOf(o)};return _getPrototypeOf(o)}function _classCallCheck(instance,Constructor){if(!(instance instanceof Constructor)){throw new TypeError("Cannot call a class as a function")}}function _defineProperties(target,props){for(var i=0;i<props.length;i++){var descriptor=props[i];descriptor.enumerable=descriptor.enumerable||false;descriptor.configurable=true;if("value"in descriptor)descriptor.writable=true;Object.defineProperty(target,descriptor.key,descriptor)}}function _createClass(Constructor,protoProps,staticProps){if(protoProps)_defineProperties(Constructor.prototype,protoProps);if(staticProps)_defineProperties(Constructor,staticProps);return Constructor}function _typeof(obj){"@babel/helpers - typeof";if(typeof Symbol==="function"&&typeof Symbol.iterator==="symbol"){_typeof=function _typeof(obj){return typeof obj}}else{_typeof=function _typeof(obj){return obj&&typeof Symbol==="function"&&obj.constructor===Symbol&&obj!==Symbol.prototype?"symbol":typeof obj}}return _typeof(obj)}(function(f){if((typeof exports==="undefined"?"undefined":_typeof(exports))==="object"&&typeof module!=="undefined"){module.exports=f()}else if(typeof define==="function"&&define.amd){define([],f)}else{var g;if(typeof window!=="undefined"){g=window}else if(typeof global!=="undefined"){g=global}else if(typeof self!=="undefined"){g=self}else{g=this}g.Plattar=f()}})(function(){var define,module,exports;return function(){function r(e,n,t){function o(i,f){if(!n[i]){if(!e[i]){var c="function"==typeof require&&require;if(!f&&c)return c(i,!0);if(u)return u(i,!0);var a=new Error("Cannot find module '"+i+"'");throw a.code="MODULE_NOT_FOUND",a}var p=n[i]={exports:{}};e[i][0].call(p.exports,function(r){var n=e[i][1][r];return o(n||r)},p,p.exports,r,e,n,t)}return n[i].exports}for(var u="function"==typeof require&&require,i=0;i<t.length;i++){o(t[i])}return o}return r}()({1:[function(require,module,exports){"use strict";var Server=require("./server/plattar-server.js");var Util=require("./util/plattar-util.js");var Project=require("./types/application.js");var Scene=require("./types/scene/scene.js");var SceneAnnotation=require("./types/scene/scene-annotation.js");var SceneAudio=require("./types/scene/scene-audio.js");var SceneButton=require("./types/scene/scene-button.js");var SceneCamera=require("./types/scene/scene-camera.js");var SceneCarousel=require("./types/scene/scene-carousel.js");var SceneImage=require("./types/scene/scene-image.js");var SceneModel=require("./types/scene/scene-model.js");var ScenePanorama=require("./types/scene/scene-panorama.js");var ScenePoller=require("./types/scene/scene-poller.js");var SceneProduct=require("./types/scene/scene-product.js");var SceneShadow=require("./types/scene/scene-shadow.js");var SceneVideo=require("./types/scene/scene-video.js");var SceneVolumetric=require("./types/scene/scene-volumetric.js");var SceneYoutube=require("./types/scene/scene-youtube.js");var Page=require("./types/page/page.js");var CardButton=require("./types/page/card-button.js");var CardHTML=require("./types/page/card-html.js");var CardIFrame=require("./types/page/card-iframe.js");var CardImage=require("./types/page/card-image.js");var CardMap=require("./types/page/card-map.js");var CardParagraph=require("./types/page/card-paragraph.js");var CardRow=require("./types/page/card-row.js");var CardSlider=require("./types/page/card-slider.js");var CardTitle=require("./types/page/card-title.js");var CardVideo=require("./types/page/card-video.js");var CardYoutube=require("./types/page/card-youtube.js");var Product=require("./types/product/product.js");var ProductVariation=require("./types/product/product-variation.js");var ProductAnnotation=require("./types/product/product-annotation.js");var FileAudio=require("./types/file/file-audio.js");var FileVideo=require("./types/file/file-video.js");var FileModel=require("./types/file/file-model.js");var FileImage=require("./types/file/file-image.js");var ScriptEvent=require("./types/misc/script-event.js");var Tag=require("./types/misc/tag.js");var ApplicationBuild=require("./types/misc/application-build.js");var AsyncJob=require("./types/misc/async-job.js");var SceneObject=require("./types/scene/scene-base.js");var CardObject=require("./types/page/card-base.js");var ProductObject=require("./types/product/product-base.js");var FileObject=require("./types/file/file-base.js");Server.create();module.exports={Server:Server,Util:Util,Project:Project,Scene:Scene,SceneAnnotation:SceneAnnotation,SceneAudio:SceneAudio,SceneButton:SceneButton,SceneCamera:SceneCamera,SceneCarousel:SceneCarousel,SceneImage:SceneImage,SceneModel:SceneModel,ScenePanorama:ScenePanorama,ScenePoller:ScenePoller,SceneProduct:SceneProduct,SceneShadow:SceneShadow,SceneVideo:SceneVideo,SceneVolumetric:SceneVolumetric,SceneYoutube:SceneYoutube,Page:Page,CardButton:CardButton,CardHTML:CardHTML,CardIFrame:CardIFrame,CardImage:CardImage,CardMap:CardMap,CardParagraph:CardParagraph,CardRow:CardRow,CardSlider:CardSlider,CardTitle:CardTitle,CardVideo:CardVideo,CardYoutube:CardYoutube,Product:Product,ProductVariation:ProductVariation,ProductAnnotation:ProductAnnotation,FileAudio:FileAudio,FileVideo:FileVideo,FileModel:FileModel,FileImage:FileImage,FileObject:FileObject,ScriptEvent:ScriptEvent,Tag:Tag,ApplicationBuild:ApplicationBuild,AsyncJob:AsyncJob,SceneObject:SceneObject,CardObject:CardObject,ProductObject:ProductObject}},{"./server/plattar-server.js":5,"./types/application.js":6,"./types/file/file-audio.js":7,"./types/file/file-base.js":8,"./types/file/file-image.js":9,"./types/file/file-model.js":10,"./types/file/file-video.js":11,"./types/misc/application-build.js":15,"./types/misc/async-job.js":16,"./types/misc/script-event.js":17,"./types/misc/tag.js":18,"./types/page/card-base.js":19,"./types/page/card-button.js":20,"./types/page/card-html.js":21,"./types/page/card-iframe.js":22,"./types/page/card-image.js":23,"./types/page/card-map.js":24,"./types/page/card-paragraph.js":25,"./types/page/card-row.js":26,"./types/page/card-slider.js":27,"./types/page/card-title.js":28,"./types/page/card-video.js":29,"./types/page/card-youtube.js":30,"./types/page/page.js":31,"./types/product/product-annotation.js":32,"./types/product/product-base.js":33,"./types/product/product-variation.js":34,"./types/product/product.js":35,"./types/scene/scene-annotation.js":36,"./types/scene/scene-audio.js":37,"./types/scene/scene-base.js":38,"./types/scene/scene-button.js":39,"./types/scene/scene-camera.js":40,"./types/scene/scene-carousel.js":41,"./types/scene/scene-image.js":42,"./types/scene/scene-model.js":43,"./types/scene/scene-panorama.js":44,"./types/scene/scene-poller.js":45,"./types/scene/scene-product.js":46,"./types/scene/scene-shadow.js":47,"./types/scene/scene-video.js":48,"./types/scene/scene-volumetric.js":49,"./types/scene/scene-youtube.js":50,"./types/scene/scene.js":51,"./util/plattar-util.js":52}],2:[function(require,module,exports){(function(global){(function(){"use strict";var getGlobal=function getGlobal(){if(typeof self!=="undefined"){return self}if(typeof window!=="undefined"){return window}if(typeof global!=="undefined"){return global}throw new Error("unable to locate global object")};var global=getGlobal();module.exports=exports=global.fetch;if(global.fetch){exports["default"]=global.fetch.bind(global)}exports.Headers=global.Headers;exports.Request=global.Request;exports.Response=global.Response}).call(this)}).call(this,typeof global!=="undefined"?global:typeof self!=="undefined"?self:typeof window!=="undefined"?window:{})},{}],3:[function(require,module,exports){var process=module.exports={};var cachedSetTimeout;var cachedClearTimeout;function defaultSetTimout(){throw new Error("setTimeout has not been defined")}function defaultClearTimeout(){throw new Error("clearTimeout has not been defined")}(function(){try{if(typeof setTimeout==="function"){cachedSetTimeout=setTimeout}else{cachedSetTimeout=defaultSetTimout}}catch(e){cachedSetTimeout=defaultSetTimout}try{if(typeof clearTimeout==="function"){cachedClearTimeout=clearTimeout}else{cachedClearTimeout=defaultClearTimeout}}catch(e){cachedClearTimeout=defaultClearTimeout}})();function runTimeout(fun){if(cachedSetTimeout===setTimeout){return setTimeout(fun,0)}if((cachedSetTimeout===defaultSetTimout||!cachedSetTimeout)&&setTimeout){cachedSetTimeout=setTimeout;return setTimeout(fun,0)}try{return cachedSetTimeout(fun,0)}catch(e){try{return cachedSetTimeout.call(null,fun,0)}catch(e){return cachedSetTimeout.call(this,fun,0)}}}function runClearTimeout(marker){if(cachedClearTimeout===clearTimeout){return clearTimeout(marker)}if((cachedClearTimeout===defaultClearTimeout||!cachedClearTimeout)&&clearTimeout){cachedClearTimeout=clearTimeout;return clearTimeout(marker)}try{return cachedClearTimeout(marker)}catch(e){try{return cachedClearTimeout.call(null,marker)}catch(e){return cachedClearTimeout.call(this,marker)}}}var queue=[];var draining=false;var currentQueue;var queueIndex=-1;function cleanUpNextTick(){if(!draining||!currentQueue){return}draining=false;if(currentQueue.length){queue=currentQueue.concat(queue)}else{queueIndex=-1}if(queue.length){drainQueue()}}function drainQueue(){if(draining){return}var timeout=runTimeout(cleanUpNextTick);draining=true;var len=queue.length;while(len){currentQueue=queue;queue=[];while(++queueIndex<len){if(currentQueue){currentQueue[queueIndex].run()}}queueIndex=-1;len=queue.length}currentQueue=null;draining=false;runClearTimeout(timeout)}process.nextTick=function(fun){var args=new Array(arguments.length-1);if(arguments.length>1){for(var i=1;i<arguments.length;i++){args[i-1]=arguments[i]}}queue.push(new Item(fun,args));if(queue.length===1&&!draining){runTimeout(drainQueue)}};function Item(fun,array){this.fun=fun;this.array=array}Item.prototype.run=function(){this.fun.apply(null,this.array)};process.title="browser";process.browser=true;process.env={};process.argv=[];process.version="";process.versions={};function noop(){}process.on=noop;process.addListener=noop;process.once=noop;process.off=noop;process.removeListener=noop;process.removeAllListeners=noop;process.emit=noop;process.prependListener=noop;process.prependOnceListener=noop;process.listeners=function(name){return[]};process.binding=function(name){throw new Error("process.binding is not supported")};process.cwd=function(){return"/"};process.chdir=function(dir){throw new Error("process.chdir is not supported")};process.umask=function(){return 0}},{}],4:[function(require,module,exports){var fetch=require("node-fetch");var PlattarQuery=function(){function PlattarQuery(target,server){_classCallCheck(this,PlattarQuery);if(!target){throw new Error("PlattarQuery cannot be created as target object cannot be null")}if(!server){throw new Error("PlattarQuery cannot be created as server object cannot be null")}this._target=target;this._server=server;this._params=[];this._getIncludeQuery=[]}_createClass(PlattarQuery,[{key:"target",get:function get(){return this._target}},{key:"server",get:function get(){return this._server}},{key:"_get",value:function _get(opt){var _this=this;return new Promise(function(resolve,reject){var target=_this.target;var server=_this.server;if(!target.id){reject(new Error("PlattarQuery."+target.type()+".get() - object id is missing"));return}var options=opt||{cache:true};if(options.cache===true){var cached=PlattarQuery._GetGlobalCachedObject(target);if(cached){resolve(cached);return}}var origin=server.originLocation.api_read;var auth=server.authToken;var reqopts={method:"GET",headers:auth};var includeQuery=_this._IncludeQuery;var params=_this._ParamFor("get");var endpoint=origin+target.type()+"/"+target.id;if(includeQuery){endpoint=endpoint+"?include="+includeQuery}if(params){var appender=includeQuery?"&":"?";params.forEach(function(param){endpoint=endpoint+appender+param.key+"="+param.value;appender="&"})}fetch(endpoint,reqopts).then(function(res){if(res.ok){try{return res.json()}catch(err){return new Error("PlattarQuery."+target.type()+".get("+target.id+") - critical error occured, cannot proceed")}}return new Error("PlattarQuery."+target.type()+".get("+target.id+") - unexpected error occured, cannot proceed. error message is "+res.statusText)}).then(function(json){if(json instanceof Error){reject(json)}else{var PlattarUtil=require("../util/plattar-util.js");PlattarUtil.reconstruct(target,json,options);resolve(target)}})})}},{key:"_update",value:function _update(){var _this2=this;return new Promise(function(resolve,reject){var target=_this2.target;var server=_this2.server;if(!target.id){reject(new Error("PlattarQuery."+target.type()+".update() - object id is missing"));return}var origin=server.originLocation.api_write;var auth=server.authToken;var headers={Accept:"application/json","Content-Type":"application/json"};Object.assign(headers,auth);var reqopts={method:"PATCH",headers:headers,body:JSON.stringify({data:{id:target.id,attributes:target.attributes}})};var params=_this2._ParamFor("update");var endpoint=origin+target.type()+"/"+target.id;if(params){var appender="?";params.forEach(function(param){endpoint=endpoint+appender+param.key+"="+param.value;appender="&"})}fetch(endpoint,reqopts).then(function(res){if(res.ok){try{return res.json()}catch(err){return new Error("PlattarQuery."+target.type()+".update("+target.id+") - critical error occured, cannot proceed")}}return new Error("PlattarQuery."+target.type()+".update("+target.id+") - unexpected error occured, cannot proceed. error message is "+res.statusText)}).then(function(json){if(json instanceof Error){reject(json)}else{var PlattarUtil=require("../util/plattar-util.js");PlattarUtil.reconstruct(target,json,{cache:true});resolve(target)}})})}},{key:"_create",value:function _create(){var _this3=this;return new Promise(function(resolve,reject){reject(new Error("PlattarQuery."+_this3.target.type()+".create() - not implemented"))})}},{key:"_delete",value:function _delete(){var _this4=this;return new Promise(function(resolve,reject){reject(new Error("PlattarQuery."+_this4.target.type()+".delete("+_this4.target.id+") - not implemented"))})}},{key:"_addParameter",value:function _addParameter(key,value,type){type=type||"all";this._params.push({key:key,value:value,type:type.toLowerCase()})}},{key:"_include",value:function _include(args){var _this5=this;if(!args||args.length<=0){return this}var PlattarUtil=require("../util/plattar-util.js");args.forEach(function(obj){if(Array.isArray(obj)){obj.forEach(function(strObject){if(typeof strObject==="string"||strObject instanceof String){_this5._getIncludeQuery.push(strObject)}else{throw new Error("PlattarQuery."+_this5.target.type()+".include(...args) - argument of Array must only include Strings")}})}else if(PlattarUtil.isPlattarObject(obj)){var type=obj.type();if(Array.isArray(type)){_this5._include(type)}else{_this5._getIncludeQuery.push(type)}}else{throw new Error("PlattarQuery."+_this5.target.type()+".include(...args) - argument must be of type PlattarObject or Array but was type="+_typeof(obj)+" value="+obj)}});return this}},{key:"_ParamFor",value:function _ParamFor(type){type=type||"all";var list=this._params.filter(function(objcheck){return objcheck.type===type||objcheck.type==="all"});if(list.length>0){return list}return undefined}},{key:"_IncludeQuery",get:function get(){if(this._getIncludeQuery.length<=0){return undefined}return"".concat(this._getIncludeQuery.map(function(item){return"".concat(item)}).join(","))}}]);return PlattarQuery}();PlattarQuery._GlobalObjectCache={};PlattarQuery._InvalidateGlobalCache=function(){PlattarQuery._GlobalObjectCache={}};PlattarQuery._HasGlobalCachedObject=function(obj){return PlattarQuery._GlobalObjectCache.hasOwnProperty(obj.id)};PlattarQuery._GetGlobalCachedObject=function(obj){return PlattarQuery._HasGlobalCachedObject(obj)?PlattarQuery._GlobalObjectCache[obj.id]:undefined};PlattarQuery._SetGlobalCachedObject=function(obj){};PlattarQuery._DeleteGlobalCachedObject=function(obj){if(PlattarQuery._HasGlobalCachedObject(obj)){delete PlattarQuery._GlobalObjectCache[obj.id]}};module.exports=PlattarQuery},{"../util/plattar-util.js":52,"node-fetch":2}],5:[function(require,module,exports){(function(process){(function(){var fetch=require("node-fetch");var PlattarServer=function(){function PlattarServer(){_classCallCheck(this,PlattarServer);this._authToken={};this._serverLocation=this.prod}_createClass(PlattarServer,[{key:"prod",get:function get(){return PlattarServer.match("prod")}},{key:"isProd",get:function get(){return this._serverLocation.type==="prod"}},{key:"staging",get:function get(){return PlattarServer.match("staging")}},{key:"isStaging",get:function get(){return this._serverLocation.type==="staging"}},{key:"dev",get:function get(){return PlattarServer.match("dev")}},{key:"isDev",get:function get(){return this._serverLocation.type==="dev"}},{key:"authToken",get:function get(){return this._authToken}},{key:"originLocation",get:function get(){return this._serverLocation}},{key:"auth",value:function auth(token,opt){var _this6=this;var copt=opt||{validate:false};return new Promise(function(resolve,reject){var server=_this6.originLocation.api_write;if(!server){reject(new Error("Plattar.auth(token) - cannot authenticate as server not set via Plattar.origin(server)"));return}if(!token){reject(new Error("Plattar.auth(token) - token variable is undefined"));return}if(!copt.validate){_this6._authToken={"plattar-auth-token":token};resolve(_this6);return}var endpoint=server+"plattaruser/xauth/validate";var options={method:"GET",headers:{"plattar-auth-token":token}};fetch(endpoint,options).then(function(res){if(res.ok){_this6._authToken={"plattar-auth-token":token};resolve(_this6)}else{reject(new Error("Plattar.auth(token) - failed to validate authentication token at "+endpoint))}})})}},{key:"origin",value:function origin(server,opt){var _this7=this;var copt=opt||{validate:false};return new Promise(function(resolve,reject){if(!server){reject(new Error("Plattar.origin(server) - server variable is undefined"));return}if(!copt.validate){_this7._serverLocation=server;resolve(_this7);return}var endpoint=server.api_read+"ping";var options={method:"GET"};fetch(endpoint,options).then(function(res){if(res.ok){_this7._serverLocation=server;resolve(_this7)}else{reject(new Error("Plattar.origin(server) - failed to ping server at "+endpoint))}})})}}]);return PlattarServer}();PlattarServer.match=function(serverName){switch(serverName.toLowerCase()){case"staging.plattar.space":case"cdn-staging.plattar.space":case"staging":return{base:"https://staging.plattar.space/",api_read:"https://staging.plattar.space/api/v2/",api_write:"https://cms.plattar.space/api/v2/",cdn:"https://cdn-staging.plattar.space/",cdn_image:"http://plattar-staging.s3-website-ap-southeast-2.amazonaws.com/",analytics:"https://c.plattar.space/api/v2/analytics",type:"staging"};case"app.plattar.com":case"cdn.plattar.com":case"prod":case"production":return{base:"https://app.plattar.com/",api_read:"https://app.plattar.com/api/v2/",api_write:"https://cms.plattar.com/api/v2/",cdn:"https://cdn.plattar.com/",cdn_image:"http://plattar-production.s3-website-ap-southeast-2.amazonaws.com/",analytics:"https://c.plattar.space/api/v2/analytics",type:"prod"};case"dev":case"developer":case"development":case"local":case"localhost":default:return{base:"https://localhost/",api_read:"https://localhost/api/v2/",api_write:"https://localhost/api/v2/",cdn:"https://cdn-dev.plattar.space/",cdn_image:"http://plattar-dev.s3-website-ap-southeast-2.amazonaws.com/",analytics:"https://localhost:3000/api/v2/analytics/",type:"dev"}}};PlattarServer.create=function(origin,auth){var newServer=new PlattarServer;if(origin){newServer.origin(origin)}if(auth){newServer.auth(auth)}PlattarServer._default=newServer;return newServer};PlattarServer.disableTLS=function(){process.env.NODE_TLS_REJECT_UNAUTHORIZED="0"};PlattarServer["default"]=function(){return PlattarServer._default};PlattarServer.location=function(){return PlattarServer["default"]().originLocation};module.exports=PlattarServer}).call(this)}).call(this,require("_process"))},{_process:3,"node-fetch":2}],6:[function(require,module,exports){var PlattarBase=require("./interfaces/plattar-base.js");var Application=function(_PlattarBase){_inherits(Application,_PlattarBase);var _super=_createSuper(Application);function Application(){_classCallCheck(this,Application);return _super.apply(this,arguments)}_createClass(Application,null,[{key:"type",value:function type(){return"application"}}]);return Application}(PlattarBase);module.exports=Application},{"./interfaces/plattar-base.js":12}],7:[function(require,module,exports){var FileBase=require("./file-base.js");var FileAudio=function(_FileBase){_inherits(FileAudio,_FileBase);var _super2=_createSuper(FileAudio);function FileAudio(){_classCallCheck(this,FileAudio);return _super2.apply(this,arguments)}_createClass(FileAudio,null,[{key:"type",value:function type(){return"fileaudio"}}]);return FileAudio}(FileBase);module.exports=FileAudio},{"./file-base.js":8}],8:[function(require,module,exports){var PlattarBase=require("../interfaces/plattar-base.js");var Server=require("../../server/plattar-server.js");var FileBase=function(_PlattarBase2){_inherits(FileBase,_PlattarBase2);var _super3=_createSuper(FileBase);function FileBase(id,server){var _this8;_classCallCheck(this,FileBase);_this8=_super3.call(this,id,server||Server["default"]());if(_this8.constructor===FileBase){throw new Error("FileBase is abstract and cannot be created")}return _this8}_createClass(FileBase,[{key:"sourcePath",get:function get(){if(!this.attributes.path){return null}return this.path+this.attributes.original_filename}},{key:"backupPath",get:function get(){if(!this.attributes.path){return null}return this.path+this.attributes.original_upload}},{key:"path",get:function get(){if(!this.attributes.path){return null}return this._query.server.originLocation.cdn+this.attributes.path}}],[{key:"type",value:function type(){var FileAudio=require("./file-audio.js");var FileVideo=require("./file-video.js");var FileModel=require("./file-model.js");var FileImage=require("./file-image.js");return[FileAudio,FileVideo,FileModel,FileImage]}}]);return FileBase}(PlattarBase);module.exports=FileBase},{"../../server/plattar-server.js":5,"../interfaces/plattar-base.js":12,"./file-audio.js":7,"./file-image.js":9,"./file-model.js":10,"./file-video.js":11}],9:[function(require,module,exports){var FileBase=require("./file-base.js");var FileImage=function(_FileBase2){_inherits(FileImage,_FileBase2);var _super4=_createSuper(FileImage);function FileImage(){_classCallCheck(this,FileImage);return _super4.apply(this,arguments)}_createClass(FileImage,null,[{key:"type",value:function type(){return"fileimage"}}]);return FileImage}(FileBase);module.exports=FileImage},{"./file-base.js":8}],10:[function(require,module,exports){var FileBase=require("./file-base.js");var FileModel=function(_FileBase3){_inherits(FileModel,_FileBase3);var _super5=_createSuper(FileModel);function FileModel(){_classCallCheck(this,FileModel);return _super5.apply(this,arguments)}_createClass(FileModel,null,[{key:"type",value:function type(){return"filemodel"}}]);return FileModel}(FileBase);module.exports=FileModel},{"./file-base.js":8}],11:[function(require,module,exports){var FileBase=require("./file-base.js");var FileVideo=function(_FileBase4){_inherits(FileVideo,_FileBase4);var _super6=_createSuper(FileVideo);function FileVideo(){_classCallCheck(this,FileVideo);return _super6.apply(this,arguments)}_createClass(FileVideo,null,[{key:"type",value:function type(){return"filevideo"}}]);return FileVideo}(FileBase);module.exports=FileVideo},{"./file-base.js":8}],12:[function(require,module,exports){var PlattarObject=require("./plattar-object.js");var Server=require("../../server/plattar-server.js");var PlattarBase=function(_PlattarObject){_inherits(PlattarBase,_PlattarObject);var _super7=_createSuper(PlattarBase);function PlattarBase(id,server){var _this9;_classCallCheck(this,PlattarBase);_this9=_super7.call(this,id,server||Server["default"]());if(_this9.constructor===PlattarBase){throw new Error("PlattarBase is abstract and cannot be created")}return _this9}return PlattarBase}(PlattarObject);module.exports=PlattarBase},{"../../server/plattar-server.js":5,"./plattar-object.js":14}],13:[function(require,module,exports){var PlattarObjectRelations=function(){function PlattarObjectRelations(parent){_classCallCheck(this,PlattarObjectRelations);this._parent=parent;this._relatedObjects={}}_createClass(PlattarObjectRelations,[{key:"parent",get:function get(){return this._parent}},{key:"_put",value:function _put(obj){if(!obj){return this}var PlattarUtil=require("../../util/plattar-util.js");if(!PlattarUtil.isPlattarObject(obj)){throw new Error("PlattarObjectRelations._put(PlattarObject) - argument must be type of PlattarObject")}if(!this._relatedObjects.hasOwnProperty(obj.type())){this._relatedObjects[obj.type()]=[]}this._relatedObjects[obj.type()].push(obj)}},{key:"filter",value:function filter(obj,id){var _this10=this;if(!obj){return[]}var PlattarUtil=require("../../util/plattar-util.js");if(!PlattarUtil.isPlattarObject(obj)){throw new Error("PlattarObjectRelations.filter(PlattarObject) - argument must be type of PlattarObject")}var type=obj.type();if(Array.isArray(type)){var compiledList=[];type.forEach(function(inObject){var retArray=_this10.filter(inObject,id);if(retArray.length>0){compiledList=compiledList.concat(retArray)}});return compiledList}if(!this._relatedObjects.hasOwnProperty(type)){return[]}var list=this._relatedObjects[type];if(!id){return list}return list.filter(function(objcheck){return objcheck.id===id})}},{key:"find",value:function find(obj,id){var list=this.filter(obj,id);if(list.length<=0){return undefined}return list[0]}}]);return PlattarObjectRelations}();module.exports=PlattarObjectRelations},{"../../util/plattar-util.js":52}],14:[function(require,module,exports){var PlattarQuery=require("../../server/plattar-query.js");var PlattarObjectRelations=require("./plattar-object-relations.js");var PlattarObject=function(){function PlattarObject(id,server){_classCallCheck(this,PlattarObject);if(this.constructor===PlattarObject){throw new Error("PlattarObject is abstract and cannot be created")}this._id=id;this._attributes={};this._query=new PlattarQuery(this,server);this._relationships=new PlattarObjectRelations(this)}_createClass(PlattarObject,[{key:"invalidate",value:function invalidate(){return PlattarQuery._DeleteGlobalCachedObject(this)}},{key:"_cache",value:function _cache(){return PlattarQuery._SetGlobalCachedObject(this)}},{key:"id",get:function get(){return this._id}},{key:"attributes",get:function get(){return this._attributes}},{key:"overrideAttributes",set:function set(attributes){this._attributes=Object.assign({},attributes)}},{key:"relationships",get:function get(){return this._relationships}},{key:"get",value:function get(opt){return this._query._get(opt)}},{key:"update",value:function update(){return this._query._update()}},{key:"create",value:function create(){return this._query._create()}},{key:"delete",value:function _delete(){return this._query._delete()}},{key:"type",value:function type(){return this.constructor.type()}},{key:"include",value:function include(){for(var _len=arguments.length,args=new Array(_len),_key=0;_key<_len;_key++){args[_key]=arguments[_key]}this._query._include(args);return this}},{key:"addParameter",value:function addParameter(key,value,type){this._query._addParameter(key,value,type);return this}}],[{key:"type",value:function type(){throw new Error("PlattarObject.type() - not implemented")}},{key:"include",value:function include(){var _this11=this;for(var _len2=arguments.length,args=new Array(_len2),_key2=0;_key2<_len2;_key2++){args[_key2]=arguments[_key2]}if(!args||args.length<=0){return[]}var includes=[this.type()];args.forEach(function(obj){if(Array.isArray(obj)){obj.forEach(function(strObject){if(typeof strObject==="string"||strObject instanceof String){includes.push("".concat(_this11.type(),".").concat(strObject))}else{throw new Error("PlattarObject."+_this11.type()+".include(...args) - argument of Array must only include Strings")}})}else if(obj.prototype instanceof PlattarObject){includes.push("".concat(_this11.type(),".").concat(obj.type()))}else{throw new Error("PlattarObject."+_this11.type()+".include(...args) - argument must be of type PlattarObject or Array but was type="+_typeof(obj)+" value="+obj)}});return includes}}]);return PlattarObject}();module.exports=PlattarObject},{"../../server/plattar-query.js":4,"./plattar-object-relations.js":13}],15:[function(require,module,exports){var PlattarBase=require("../interfaces/plattar-base.js");var ApplicationBuild=function(_PlattarBase3){_inherits(ApplicationBuild,_PlattarBase3);var _super8=_createSuper(ApplicationBuild);function ApplicationBuild(){_classCallCheck(this,ApplicationBuild);return _super8.apply(this,arguments)}_createClass(ApplicationBuild,null,[{key:"type",value:function type(){return"applicationbuild"}}]);return ApplicationBuild}(PlattarBase);module.exports=ApplicationBuild},{"../interfaces/plattar-base.js":12}],16:[function(require,module,exports){var PlattarBase=require("../interfaces/plattar-base.js");var AsyncJob=function(_PlattarBase4){_inherits(AsyncJob,_PlattarBase4);var _super9=_createSuper(AsyncJob);function AsyncJob(){_classCallCheck(this,AsyncJob);return _super9.apply(this,arguments)}_createClass(AsyncJob,[{key:"accessKey",set:function set(code){this.addParameter("access_key",code,"update")}}],[{key:"type",value:function type(){return"asyncjob"}}]);return AsyncJob}(PlattarBase);module.exports=AsyncJob},{"../interfaces/plattar-base.js":12}],17:[function(require,module,exports){var PlattarBase=require("../interfaces/plattar-base.js");var ScriptEvent=function(_PlattarBase5){_inherits(ScriptEvent,_PlattarBase5);var _super10=_createSuper(ScriptEvent);function ScriptEvent(){_classCallCheck(this,ScriptEvent);return _super10.apply(this,arguments)}_createClass(ScriptEvent,null,[{key:"type",value:function type(){return"scriptevent"}}]);return ScriptEvent}(PlattarBase);module.exports=ScriptEvent},{"../interfaces/plattar-base.js":12}],18:[function(require,module,exports){var PlattarBase=require("../interfaces/plattar-base.js");var Tag=function(_PlattarBase6){_inherits(Tag,_PlattarBase6);var _super11=_createSuper(Tag);function Tag(){_classCallCheck(this,Tag);return _super11.apply(this,arguments)}_createClass(Tag,null,[{key:"type",value:function type(){return"tag"}}]);return Tag}(PlattarBase);module.exports=Tag},{"../interfaces/plattar-base.js":12}],19:[function(require,module,exports){var PlattarBase=require("../interfaces/plattar-base.js");var Server=require("../../server/plattar-server.js");var CardBase=function(_PlattarBase7){_inherits(CardBase,_PlattarBase7);var _super12=_createSuper(CardBase);function CardBase(id,server){var _this12;_classCallCheck(this,CardBase);_this12=_super12.call(this,id,server||Server["default"]());if(_this12.constructor===CardBase){throw new Error("CardBase is abstract and cannot be created")}return _this12}_createClass(CardBase,null,[{key:"type",value:function type(){var CardButton=require("./card-button.js");var CardHTML=require("./card-html.js");var CardIFrame=require("./card-iframe.js");var CardImage=require("./card-image.js");var CardMap=require("./card-map.js");var CardParagraph=require("./card-paragraph.js");var CardRow=require("./card-row.js");var CardSlider=require("./card-slider.js");var CardTitle=require("./card-title.js");var CardVideo=require("./card-video.js");var CardYoutube=require("./card-youtube.js");return[CardButton,CardHTML,CardIFrame,CardImage,CardMap,CardParagraph,CardRow,CardSlider,CardTitle,CardVideo,CardYoutube]}}]);return CardBase}(PlattarBase);module.exports=CardBase},{"../../server/plattar-server.js":5,"../interfaces/plattar-base.js":12,"./card-button.js":20,"./card-html.js":21,"./card-iframe.js":22,"./card-image.js":23,"./card-map.js":24,"./card-paragraph.js":25,"./card-row.js":26,"./card-slider.js":27,"./card-title.js":28,"./card-video.js":29,"./card-youtube.js":30}],20:[function(require,module,exports){var CardBase=require("./card-base.js");var CardButton=function(_CardBase){_inherits(CardButton,_CardBase);var _super13=_createSuper(CardButton);function CardButton(){_classCallCheck(this,CardButton);return _super13.apply(this,arguments)}_createClass(CardButton,null,[{key:"type",value:function type(){return"cardbutton"}}]);return CardButton}(CardBase);module.exports=CardButton},{"./card-base.js":19}],21:[function(require,module,exports){var CardBase=require("./card-base.js");var CardHTML=function(_CardBase2){_inherits(CardHTML,_CardBase2);var _super14=_createSuper(CardHTML);function CardHTML(){_classCallCheck(this,CardHTML);return _super14.apply(this,arguments)}_createClass(CardHTML,null,[{key:"type",value:function type(){return"cardhtml"}}]);return CardHTML}(CardBase);module.exports=CardHTML},{"./card-base.js":19}],22:[function(require,module,exports){var CardBase=require("./card-base.js");var CardIFrame=function(_CardBase3){_inherits(CardIFrame,_CardBase3);var _super15=_createSuper(CardIFrame);function CardIFrame(){_classCallCheck(this,CardIFrame);return _super15.apply(this,arguments)}_createClass(CardIFrame,null,[{key:"type",value:function type(){return"cardiframe"}}]);return CardIFrame}(CardBase);module.exports=CardIFrame},{"./card-base.js":19}],23:[function(require,module,exports){var CardBase=require("./card-base.js");var CardImage=function(_CardBase4){_inherits(CardImage,_CardBase4);var _super16=_createSuper(CardImage);function CardImage(){_classCallCheck(this,CardImage);return _super16.apply(this,arguments)}_createClass(CardImage,null,[{key:"type",value:function type(){return"cardimage"}}]);return CardImage}(CardBase);module.exports=CardImage},{"./card-base.js":19}],24:[function(require,module,exports){var CardBase=require("./card-base.js");var CardMap=function(_CardBase5){_inherits(CardMap,_CardBase5);var _super17=_createSuper(CardMap);function CardMap(){_classCallCheck(this,CardMap);return _super17.apply(this,arguments)}_createClass(CardMap,null,[{key:"type",value:function type(){return"cardmap"}}]);return CardMap}(CardBase);module.exports=CardMap},{"./card-base.js":19}],25:[function(require,module,exports){var CardBase=require("./card-base.js");var CardParagraph=function(_CardBase6){_inherits(CardParagraph,_CardBase6);var _super18=_createSuper(CardParagraph);function CardParagraph(){_classCallCheck(this,CardParagraph);return _super18.apply(this,arguments)}_createClass(CardParagraph,null,[{key:"type",value:function type(){return"cardparagraph"}}]);return CardParagraph}(CardBase);module.exports=CardParagraph},{"./card-base.js":19}],26:[function(require,module,exports){var CardBase=require("./card-base.js");var CardRow=function(_CardBase7){_inherits(CardRow,_CardBase7);var _super19=_createSuper(CardRow);function CardRow(){_classCallCheck(this,CardRow);return _super19.apply(this,arguments)}_createClass(CardRow,null,[{key:"type",value:function type(){return"cardrow"}}]);return CardRow}(CardBase);module.exports=CardRow},{"./card-base.js":19}],27:[function(require,module,exports){var CardBase=require("./card-base.js");var CardSlider=function(_CardBase8){_inherits(CardSlider,_CardBase8);var _super20=_createSuper(CardSlider);function CardSlider(){_classCallCheck(this,CardSlider);return _super20.apply(this,arguments)}_createClass(CardSlider,null,[{key:"type",value:function type(){return"cardslider"}}]);return CardSlider}(CardBase);module.exports=CardSlider},{"./card-base.js":19}],28:[function(require,module,exports){var CardBase=require("./card-base.js");var CardTitle=function(_CardBase9){_inherits(CardTitle,_CardBase9);var _super21=_createSuper(CardTitle);function CardTitle(){_classCallCheck(this,CardTitle);return _super21.apply(this,arguments)}_createClass(CardTitle,null,[{key:"type",value:function type(){return"cardtitle"}}]);return CardTitle}(CardBase);module.exports=CardTitle},{"./card-base.js":19}],29:[function(require,module,exports){var CardBase=require("./card-base.js");var CardVideo=function(_CardBase10){_inherits(CardVideo,_CardBase10);var _super22=_createSuper(CardVideo);function CardVideo(){_classCallCheck(this,CardVideo);return _super22.apply(this,arguments)}_createClass(CardVideo,null,[{key:"type",value:function type(){return"cardvideo"}}]);return CardVideo}(CardBase);module.exports=CardVideo},{"./card-base.js":19}],30:[function(require,module,exports){var CardBase=require("./card-base.js");var CardYoutube=function(_CardBase11){_inherits(CardYoutube,_CardBase11);var _super23=_createSuper(CardYoutube);function CardYoutube(){_classCallCheck(this,CardYoutube);return _super23.apply(this,arguments)}_createClass(CardYoutube,null,[{key:"type",value:function type(){return"cardyoutube"}}]);return CardYoutube}(CardBase);module.exports=CardYoutube},{"./card-base.js":19}],31:[function(require,module,exports){var PlattarBase=require("../interfaces/plattar-base.js");var Page=function(_PlattarBase8){_inherits(Page,_PlattarBase8);var _super24=_createSuper(Page);function Page(){_classCallCheck(this,Page);return _super24.apply(this,arguments)}_createClass(Page,null,[{key:"type",value:function type(){return"page"}}]);return Page}(PlattarBase);module.exports=Page},{"../interfaces/plattar-base.js":12}],32:[function(require,module,exports){var ProductBase=require("./product-base.js");var ProductAnnotation=function(_ProductBase){_inherits(ProductAnnotation,_ProductBase);var _super25=_createSuper(ProductAnnotation);function ProductAnnotation(){_classCallCheck(this,ProductAnnotation);return _super25.apply(this,arguments)}_createClass(ProductAnnotation,null,[{key:"type",value:function type(){return"productannotation"}}]);return ProductAnnotation}(ProductBase);module.exports=ProductAnnotation},{"./product-base.js":33}],33:[function(require,module,exports){var PlattarBase=require("../interfaces/plattar-base.js");var Server=require("../../server/plattar-server.js");var ProductBase=function(_PlattarBase9){_inherits(ProductBase,_PlattarBase9);var _super26=_createSuper(ProductBase);function ProductBase(id,server){var _this13;_classCallCheck(this,ProductBase);_this13=_super26.call(this,id,server||Server["default"]());if(_this13.constructor===ProductBase){throw new Error("ProductBase is abstract and cannot be created")}return _this13}_createClass(ProductBase,null,[{key:"type",value:function type(){var ProductVariation=require("./product-variation.js");var ProductAnnotation=require("./product-annotation.js");return[ProductAnnotation,ProductVariation]}}]);return ProductBase}(PlattarBase);module.exports=ProductBase},{"../../server/plattar-server.js":5,"../interfaces/plattar-base.js":12,"./product-annotation.js":32,"./product-variation.js":34}],34:[function(require,module,exports){var ProductBase=require("./product-base.js");var ProductVariation=function(_ProductBase2){_inherits(ProductVariation,_ProductBase2);var _super27=_createSuper(ProductVariation);function ProductVariation(){_classCallCheck(this,ProductVariation);return _super27.apply(this,arguments)}_createClass(ProductVariation,null,[{key:"type",value:function type(){return"productvariation"}}]);return ProductVariation}(ProductBase);module.exports=ProductVariation},{"./product-base.js":33}],35:[function(require,module,exports){var PlattarBase=require("../interfaces/plattar-base.js");var Product=function(_PlattarBase10){_inherits(Product,_PlattarBase10);var _super28=_createSuper(Product);function Product(){_classCallCheck(this,Product);return _super28.apply(this,arguments)}_createClass(Product,null,[{key:"type",value:function type(){return"product"}}]);return Product}(PlattarBase);module.exports=Product},{"../interfaces/plattar-base.js":12}],36:[function(require,module,exports){var SceneBase=require("./scene-base.js");var SceneAnnotation=function(_SceneBase){_inherits(SceneAnnotation,_SceneBase);var _super29=_createSuper(SceneAnnotation);function SceneAnnotation(){_classCallCheck(this,SceneAnnotation);return _super29.apply(this,arguments)}_createClass(SceneAnnotation,null,[{key:"type",value:function type(){return"sceneannotation"}}]);return SceneAnnotation}(SceneBase);module.exports=SceneAnnotation},{"./scene-base.js":38}],37:[function(require,module,exports){var SceneBase=require("./scene-base.js");var SceneAudio=function(_SceneBase2){_inherits(SceneAudio,_SceneBase2);var _super30=_createSuper(SceneAudio);function SceneAudio(){_classCallCheck(this,SceneAudio);return _super30.apply(this,arguments)}_createClass(SceneAudio,null,[{key:"type",value:function type(){return"sceneaudio"}}]);return SceneAudio}(SceneBase);module.exports=SceneAudio},{"./scene-base.js":38}],38:[function(require,module,exports){var PlattarBase=require("../interfaces/plattar-base.js");var Server=require("../../server/plattar-server.js");var SceneBase=function(_PlattarBase11){_inherits(SceneBase,_PlattarBase11);var _super31=_createSuper(SceneBase);function SceneBase(id,server){var _this14;_classCallCheck(this,SceneBase);_this14=_super31.call(this,id,server||Server["default"]());if(_this14.constructor===SceneBase){throw new Error("SceneBase is abstract and cannot be created")}return _this14}_createClass(SceneBase,null,[{key:"type",value:function type(){var SceneAnnotation=require("./scene-annotation.js");var SceneAudio=require("./scene-audio.js");var SceneButton=require("./scene-button.js");var SceneCamera=require("./scene-camera.js");var SceneCarousel=require("./scene-carousel.js");var SceneImage=require("./scene-image.js");var SceneModel=require("./scene-model.js");var ScenePanorama=require("./scene-panorama.js");var ScenePoller=require("./scene-poller.js");var SceneProduct=require("./scene-product.js");var SceneShadow=require("./scene-shadow.js");var SceneVideo=require("./scene-video.js");var SceneVolumetric=require("./scene-volumetric.js");var SceneYoutube=require("./scene-youtube.js");return[SceneAnnotation,SceneAudio,SceneButton,SceneCamera,SceneCarousel,SceneImage,SceneModel,ScenePanorama,ScenePoller,SceneProduct,SceneShadow,SceneVideo,SceneVolumetric,SceneYoutube]}}]);return SceneBase}(PlattarBase);module.exports=SceneBase},{"../../server/plattar-server.js":5,"../interfaces/plattar-base.js":12,"./scene-annotation.js":36,"./scene-audio.js":37,"./scene-button.js":39,"./scene-camera.js":40,"./scene-carousel.js":41,"./scene-image.js":42,"./scene-model.js":43,"./scene-panorama.js":44,"./scene-poller.js":45,"./scene-product.js":46,"./scene-shadow.js":47,"./scene-video.js":48,"./scene-volumetric.js":49,"./scene-youtube.js":50}],39:[function(require,module,exports){var SceneBase=require("./scene-base.js");var SceneButton=function(_SceneBase3){_inherits(SceneButton,_SceneBase3);var _super32=_createSuper(SceneButton);function SceneButton(){_classCallCheck(this,SceneButton);return _super32.apply(this,arguments)}_createClass(SceneButton,null,[{key:"type",value:function type(){return"scenebutton"}}]);return SceneButton}(SceneBase);module.exports=SceneButton},{"./scene-base.js":38}],40:[function(require,module,exports){var SceneBase=require("./scene-base.js");var SceneCamera=function(_SceneBase4){_inherits(SceneCamera,_SceneBase4);var _super33=_createSuper(SceneCamera);function SceneCamera(){_classCallCheck(this,SceneCamera);return _super33.apply(this,arguments)}_createClass(SceneCamera,null,[{key:"type",value:function type(){return"scenecamera"}}]);return SceneCamera}(SceneBase);module.exports=SceneCamera},{"./scene-base.js":38}],41:[function(require,module,exports){var SceneBase=require("./scene-base.js");var SceneCarousel=function(_SceneBase5){_inherits(SceneCarousel,_SceneBase5);var _super34=_createSuper(SceneCarousel);function SceneCarousel(){_classCallCheck(this,SceneCarousel);return _super34.apply(this,arguments)}_createClass(SceneCarousel,null,[{key:"type",value:function type(){return"scenecarousel"}}]);return SceneCarousel}(SceneBase);module.exports=SceneCarousel},{"./scene-base.js":38}],42:[function(require,module,exports){var SceneBase=require("./scene-base.js");var SceneImage=function(_SceneBase6){_inherits(SceneImage,_SceneBase6);var _super35=_createSuper(SceneImage);function SceneImage(){_classCallCheck(this,SceneImage);return _super35.apply(this,arguments)}_createClass(SceneImage,null,[{key:"type",value:function type(){return"sceneimage"}}]);return SceneImage}(SceneBase);module.exports=SceneImage},{"./scene-base.js":38}],43:[function(require,module,exports){var SceneBase=require("./scene-base.js");var SceneModel=function(_SceneBase7){_inherits(SceneModel,_SceneBase7);var _super36=_createSuper(SceneModel);function SceneModel(){_classCallCheck(this,SceneModel);return _super36.apply(this,arguments)}_createClass(SceneModel,null,[{key:"type",value:function type(){return"scenemodel"}}]);return SceneModel}(SceneBase);module.exports=SceneModel},{"./scene-base.js":38}],44:[function(require,module,exports){var SceneBase=require("./scene-base.js");var ScenePanorama=function(_SceneBase8){_inherits(ScenePanorama,_SceneBase8);var _super37=_createSuper(ScenePanorama);function ScenePanorama(){_classCallCheck(this,ScenePanorama);return _super37.apply(this,arguments)}_createClass(ScenePanorama,null,[{key:"type",value:function type(){return"scenepanorama"}}]);return ScenePanorama}(SceneBase);module.exports=ScenePanorama},{"./scene-base.js":38}],45:[function(require,module,exports){var SceneBase=require("./scene-base.js");var ScenePoller=function(_SceneBase9){_inherits(ScenePoller,_SceneBase9);var _super38=_createSuper(ScenePoller);function ScenePoller(){_classCallCheck(this,ScenePoller);return _super38.apply(this,arguments)}_createClass(ScenePoller,null,[{key:"type",value:function type(){return"scenepoller"}}]);return ScenePoller}(SceneBase);module.exports=ScenePoller},{"./scene-base.js":38}],46:[function(require,module,exports){var SceneBase=require("./scene-base.js");var SceneProduct=function(_SceneBase10){_inherits(SceneProduct,_SceneBase10);var _super39=_createSuper(SceneProduct);function SceneProduct(){_classCallCheck(this,SceneProduct);return _super39.apply(this,arguments)}_createClass(SceneProduct,null,[{key:"type",value:function type(){return"sceneproduct"}}]);return SceneProduct}(SceneBase);module.exports=SceneProduct},{"./scene-base.js":38}],47:[function(require,module,exports){var SceneBase=require("./scene-base.js");var SceneShadow=function(_SceneBase11){_inherits(SceneShadow,_SceneBase11);var _super40=_createSuper(SceneShadow);function SceneShadow(){_classCallCheck(this,SceneShadow);return _super40.apply(this,arguments)}_createClass(SceneShadow,null,[{key:"type",value:function type(){return"sceneshadow"}}]);return SceneShadow}(SceneBase);module.exports=SceneShadow},{"./scene-base.js":38}],48:[function(require,module,exports){var SceneBase=require("./scene-base.js");var SceneVideo=function(_SceneBase12){_inherits(SceneVideo,_SceneBase12);var _super41=_createSuper(SceneVideo);function SceneVideo(){_classCallCheck(this,SceneVideo);return _super41.apply(this,arguments)}_createClass(SceneVideo,null,[{key:"type",value:function type(){return"scenevideo"}}]);return SceneVideo}(SceneBase);module.exports=SceneVideo},{"./scene-base.js":38}],49:[function(require,module,exports){var SceneBase=require("./scene-base.js");var SceneVolumetric=function(_SceneBase13){_inherits(SceneVolumetric,_SceneBase13);var _super42=_createSuper(SceneVolumetric);function SceneVolumetric(){_classCallCheck(this,SceneVolumetric);return _super42.apply(this,arguments)}_createClass(SceneVolumetric,null,[{key:"type",value:function type(){return"scenevolumetric"}}]);return SceneVolumetric}(SceneBase);module.exports=SceneVolumetric},{"./scene-base.js":38}],50:[function(require,module,exports){var SceneBase=require("./scene-base.js");var SceneYoutube=function(_SceneBase14){_inherits(SceneYoutube,_SceneBase14);var _super43=_createSuper(SceneYoutube);function SceneYoutube(){_classCallCheck(this,SceneYoutube);return _super43.apply(this,arguments)}_createClass(SceneYoutube,null,[{key:"type",value:function type(){return"sceneyoutube"}}]);return SceneYoutube}(SceneBase);module.exports=SceneYoutube},{"./scene-base.js":38}],51:[function(require,module,exports){var PlattarBase=require("../interfaces/plattar-base.js");var Scene=function(_PlattarBase12){_inherits(Scene,_PlattarBase12);var _super44=_createSuper(Scene);function Scene(){_classCallCheck(this,Scene);return _super44.apply(this,arguments)}_createClass(Scene,null,[{key:"type",value:function type(){return"scene"}}]);return Scene}(PlattarBase);module.exports=Scene},{"../interfaces/plattar-base.js":12}],52:[function(require,module,exports){var Application=require("../types/application.js");var Scene=require("../types/scene/scene.js");var SceneAnnotation=require("../types/scene/scene-annotation.js");var SceneAudio=require("../types/scene/scene-audio.js");var SceneButton=require("../types/scene/scene-button.js");var SceneCamera=require("../types/scene/scene-camera.js");var SceneCarousel=require("../types/scene/scene-carousel.js");var SceneImage=require("../types/scene/scene-image.js");var SceneModel=require("../types/scene/scene-model.js");var ScenePanorama=require("../types/scene/scene-panorama.js");var ScenePoller=require("../types/scene/scene-poller.js");var SceneProduct=require("../types/scene/scene-product.js");var SceneShadow=require("../types/scene/scene-shadow.js");var SceneVideo=require("../types/scene/scene-video.js");var SceneVolumetric=require("../types/scene/scene-volumetric.js");var SceneYoutube=require("../types/scene/scene-youtube.js");var Page=require("../types/page/page.js");var CardButton=require("../types/page/card-button.js");var CardHTML=require("../types/page/card-html.js");var CardIFrame=require("../types/page/card-iframe.js");var CardImage=require("../types/page/card-image.js");var CardMap=require("../types/page/card-map.js");var CardParagraph=require("../types/page/card-paragraph.js");var CardRow=require("../types/page/card-row.js");var CardSlider=require("../types/page/card-slider.js");var CardTitle=require("../types/page/card-title.js");var CardVideo=require("../types/page/card-video.js");var CardYoutube=require("../types/page/card-youtube.js");var Product=require("../types/product/product.js");var ProductVariation=require("../types/product/product-variation.js");var ProductAnnotation=require("../types/product/product-annotation.js");var FileAudio=require("../types/file/file-audio.js");var FileVideo=require("../types/file/file-video.js");var FileModel=require("../types/file/file-model.js");var FileImage=require("../types/file/file-image.js");var ScriptEvent=require("../types/misc/script-event.js");var Tag=require("../types/misc/tag.js");var ApplicationBuild=require("../types/misc/application-build.js");var AsyncJob=require("../types/misc/async-job.js");var PlattarUtil=function PlattarUtil(){_classCallCheck(this,PlattarUtil)};PlattarUtil.isPlattarObject=function(obj){var PlattarObject=require("../types/interfaces/plattar-object.js");if(obj&&obj.prototype&&obj.prototype instanceof PlattarObject){return true}if(obj&&obj instanceof PlattarObject){return true}return false};PlattarUtil.reconstruct=function(parent,json,options){parent._attributes=json.data.attributes;if(options.cache===true){parent._cache()}var server=parent._query.server;if(json.data.relationships){var _loop=function _loop(){var _Object$entries$_i=_slicedToArray(_Object$entries[_i],2),key=_Object$entries$_i[0],value=_Object$entries$_i[1];var data=value.data;if(Array.isArray(data)){data.forEach(function(item){var construct=PlattarUtil.create(key,item.id,server);construct._attributes=item.attributes||{};parent.relationships._put(construct)})}else{var construct=PlattarUtil.create(key,data.id,server);construct._attributes=data.attributes||{};parent.relationships._put(construct)}};for(var _i=0,_Object$entries=Object.entries(json.data.relationships);_i<_Object$entries.length;_i++){_loop()}}if(json.included){json.included.forEach(function(item){var existing=parent.relationships.find(PlattarUtil.match(item.type),item.id);if(existing){PlattarUtil.reconstruct(existing,{data:item,included:json.included},options)}})}};PlattarUtil.create=function(type,id,server){var _DynamicClass=PlattarUtil.match(type);return new _DynamicClass(id,server)};PlattarUtil.match=function(type){switch(type){case Application.type():return Application;case Scene.type():return Scene;case SceneAnnotation.type():return SceneAnnotation;case SceneAudio.type():return SceneAudio;case SceneButton.type():return SceneButton;case SceneCamera.type():return SceneCamera;case SceneCarousel.type():return SceneCarousel;case SceneImage.type():return SceneImage;case SceneModel.type():return SceneModel;case ScenePanorama.type():return ScenePanorama;case ScenePoller.type():return ScenePoller;case SceneProduct.type():return SceneProduct;case SceneShadow.type():return SceneShadow;case SceneVideo.type():return SceneVideo;case SceneVolumetric.type():return SceneVolumetric;case SceneYoutube.type():return SceneYoutube;case Page.type():return Page;case CardButton.type():return CardButton;case CardHTML.type():return CardHTML;case CardIFrame.type():return CardIFrame;case Product.type():return Product;case ProductVariation.type():return ProductVariation;case ProductAnnotation.type():return ProductAnnotation;case FileAudio.type():return FileAudio;case FileVideo.type():return FileVideo;case FileModel.type():return FileModel;case FileImage.type():return FileImage;case CardMap.type():return CardMap;case CardParagraph.type():return CardParagraph;case CardRow.type():return CardRow;case CardSlider.type():return CardSlider;case CardTitle.type():return CardTitle;case CardVideo.type():return CardVideo;case CardYoutube.type():return CardYoutube;case CardImage.type():return CardImage;case ScriptEvent.type():return ScriptEvent;case Tag.type():return Tag;case ApplicationBuild.type():return ApplicationBuild;case AsyncJob.type():return AsyncJob;default:throw new Error('PlattarUtil.match(type) - provided type of "'+type+'" does not exist and cannot be created')}};module.exports=PlattarUtil},{"../types/application.js":6,"../types/file/file-audio.js":7,"../types/file/file-image.js":9,"../types/file/file-model.js":10,"../types/file/file-video.js":11,"../types/interfaces/plattar-object.js":14,"../types/misc/application-build.js":15,"../types/misc/async-job.js":16,"../types/misc/script-event.js":17,"../types/misc/tag.js":18,"../types/page/card-button.js":20,"../types/page/card-html.js":21,"../types/page/card-iframe.js":22,"../types/page/card-image.js":23,"../types/page/card-map.js":24,"../types/page/card-paragraph.js":25,"../types/page/card-row.js":26,"../types/page/card-slider.js":27,"../types/page/card-title.js":28,"../types/page/card-video.js":29,"../types/page/card-youtube.js":30,"../types/page/page.js":31,"../types/product/product-annotation.js":32,"../types/product/product-variation.js":34,"../types/product/product.js":35,"../types/scene/scene-annotation.js":36,"../types/scene/scene-audio.js":37,"../types/scene/scene-button.js":39,"../types/scene/scene-camera.js":40,"../types/scene/scene-carousel.js":41,"../types/scene/scene-image.js":42,"../types/scene/scene-model.js":43,"../types/scene/scene-panorama.js":44,"../types/scene/scene-poller.js":45,"../types/scene/scene-product.js":46,"../types/scene/scene-shadow.js":47,"../types/scene/scene-video.js":48,"../types/scene/scene-volumetric.js":49,"../types/scene/scene-youtube.js":50,"../types/scene/scene.js":51}]},{},[1])(1)});
"use strict";function _slicedToArray(arr,i){return _arrayWithHoles(arr)||_iterableToArrayLimit(arr,i)||_unsupportedIterableToArray(arr,i)||_nonIterableRest()}function _nonIterableRest(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function _unsupportedIterableToArray(o,minLen){if(!o)return;if(typeof o==="string")return _arrayLikeToArray(o,minLen);var n=Object.prototype.toString.call(o).slice(8,-1);if(n==="Object"&&o.constructor)n=o.constructor.name;if(n==="Map"||n==="Set")return Array.from(o);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return _arrayLikeToArray(o,minLen)}function _arrayLikeToArray(arr,len){if(len==null||len>arr.length)len=arr.length;for(var i=0,arr2=new Array(len);i<len;i++){arr2[i]=arr[i]}return arr2}function _iterableToArrayLimit(arr,i){if(typeof Symbol==="undefined"||!(Symbol.iterator in Object(arr)))return;var _arr=[];var _n=true;var _d=false;var _e=undefined;try{for(var _i=arr[Symbol.iterator](),_s;!(_n=(_s=_i.next()).done);_n=true){_arr.push(_s.value);if(i&&_arr.length===i)break}}catch(err){_d=true;_e=err}finally{try{if(!_n&&_i["return"]!=null)_i["return"]()}finally{if(_d)throw _e}}return _arr}function _arrayWithHoles(arr){if(Array.isArray(arr))return arr}function _inherits(subClass,superClass){if(typeof superClass!=="function"&&superClass!==null){throw new TypeError("Super expression must either be null or a function")}subClass.prototype=Object.create(superClass&&superClass.prototype,{constructor:{value:subClass,writable:true,configurable:true}});if(superClass)_setPrototypeOf(subClass,superClass)}function _setPrototypeOf(o,p){_setPrototypeOf=Object.setPrototypeOf||function _setPrototypeOf(o,p){o.__proto__=p;return o};return _setPrototypeOf(o,p)}function _createSuper(Derived){var hasNativeReflectConstruct=_isNativeReflectConstruct();return function _createSuperInternal(){var Super=_getPrototypeOf(Derived),result;if(hasNativeReflectConstruct){var NewTarget=_getPrototypeOf(this).constructor;result=Reflect.construct(Super,arguments,NewTarget)}else{result=Super.apply(this,arguments)}return _possibleConstructorReturn(this,result)}}function _possibleConstructorReturn(self,call){if(call&&(_typeof(call)==="object"||typeof call==="function")){return call}return _assertThisInitialized(self)}function _assertThisInitialized(self){if(self===void 0){throw new ReferenceError("this hasn't been initialised - super() hasn't been called")}return self}function _isNativeReflectConstruct(){if(typeof Reflect==="undefined"||!Reflect.construct)return false;if(Reflect.construct.sham)return false;if(typeof Proxy==="function")return true;try{Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}));return true}catch(e){return false}}function _getPrototypeOf(o){_getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf:function _getPrototypeOf(o){return o.__proto__||Object.getPrototypeOf(o)};return _getPrototypeOf(o)}function _classCallCheck(instance,Constructor){if(!(instance instanceof Constructor)){throw new TypeError("Cannot call a class as a function")}}function _defineProperties(target,props){for(var i=0;i<props.length;i++){var descriptor=props[i];descriptor.enumerable=descriptor.enumerable||false;descriptor.configurable=true;if("value"in descriptor)descriptor.writable=true;Object.defineProperty(target,descriptor.key,descriptor)}}function _createClass(Constructor,protoProps,staticProps){if(protoProps)_defineProperties(Constructor.prototype,protoProps);if(staticProps)_defineProperties(Constructor,staticProps);return Constructor}function _typeof(obj){"@babel/helpers - typeof";if(typeof Symbol==="function"&&typeof Symbol.iterator==="symbol"){_typeof=function _typeof(obj){return typeof obj}}else{_typeof=function _typeof(obj){return obj&&typeof Symbol==="function"&&obj.constructor===Symbol&&obj!==Symbol.prototype?"symbol":typeof obj}}return _typeof(obj)}(function(f){if((typeof exports==="undefined"?"undefined":_typeof(exports))==="object"&&typeof module!=="undefined"){module.exports=f()}else if(typeof define==="function"&&define.amd){define([],f)}else{var g;if(typeof window!=="undefined"){g=window}else if(typeof global!=="undefined"){g=global}else if(typeof self!=="undefined"){g=self}else{g=this}g.Plattar=f()}})(function(){var define,module,exports;return function(){function r(e,n,t){function o(i,f){if(!n[i]){if(!e[i]){var c="function"==typeof require&&require;if(!f&&c)return c(i,!0);if(u)return u(i,!0);var a=new Error("Cannot find module '"+i+"'");throw a.code="MODULE_NOT_FOUND",a}var p=n[i]={exports:{}};e[i][0].call(p.exports,function(r){var n=e[i][1][r];return o(n||r)},p,p.exports,r,e,n,t)}return n[i].exports}for(var u="function"==typeof require&&require,i=0;i<t.length;i++){o(t[i])}return o}return r}()({1:[function(require,module,exports){"use strict";var Server=require("./server/plattar-server.js");var Util=require("./util/plattar-util.js");var Project=require("./types/application.js");var Scene=require("./types/scene/scene.js");var SceneAnnotation=require("./types/scene/scene-annotation.js");var SceneAudio=require("./types/scene/scene-audio.js");var SceneButton=require("./types/scene/scene-button.js");var SceneCamera=require("./types/scene/scene-camera.js");var SceneCarousel=require("./types/scene/scene-carousel.js");var SceneImage=require("./types/scene/scene-image.js");var SceneModel=require("./types/scene/scene-model.js");var ScenePanorama=require("./types/scene/scene-panorama.js");var ScenePoller=require("./types/scene/scene-poller.js");var SceneProduct=require("./types/scene/scene-product.js");var SceneShadow=require("./types/scene/scene-shadow.js");var SceneVideo=require("./types/scene/scene-video.js");var SceneVolumetric=require("./types/scene/scene-volumetric.js");var SceneYoutube=require("./types/scene/scene-youtube.js");var Page=require("./types/page/page.js");var CardButton=require("./types/page/card-button.js");var CardHTML=require("./types/page/card-html.js");var CardIFrame=require("./types/page/card-iframe.js");var CardImage=require("./types/page/card-image.js");var CardMap=require("./types/page/card-map.js");var CardParagraph=require("./types/page/card-paragraph.js");var CardRow=require("./types/page/card-row.js");var CardSlider=require("./types/page/card-slider.js");var CardTitle=require("./types/page/card-title.js");var CardVideo=require("./types/page/card-video.js");var CardYoutube=require("./types/page/card-youtube.js");var Product=require("./types/product/product.js");var ProductVariation=require("./types/product/product-variation.js");var ProductAnnotation=require("./types/product/product-annotation.js");var FileAudio=require("./types/file/file-audio.js");var FileVideo=require("./types/file/file-video.js");var FileModel=require("./types/file/file-model.js");var FileImage=require("./types/file/file-image.js");var ScriptEvent=require("./types/misc/script-event.js");var Tag=require("./types/misc/tag.js");var ApplicationBuild=require("./types/misc/application-build.js");var AsyncJob=require("./types/misc/async-job.js");var SceneObject=require("./types/scene/scene-base.js");var CardObject=require("./types/page/card-base.js");var ProductObject=require("./types/product/product-base.js");var FileObject=require("./types/file/file-base.js");Server.create();module.exports={Server:Server,Util:Util,Project:Project,Scene:Scene,SceneAnnotation:SceneAnnotation,SceneAudio:SceneAudio,SceneButton:SceneButton,SceneCamera:SceneCamera,SceneCarousel:SceneCarousel,SceneImage:SceneImage,SceneModel:SceneModel,ScenePanorama:ScenePanorama,ScenePoller:ScenePoller,SceneProduct:SceneProduct,SceneShadow:SceneShadow,SceneVideo:SceneVideo,SceneVolumetric:SceneVolumetric,SceneYoutube:SceneYoutube,Page:Page,CardButton:CardButton,CardHTML:CardHTML,CardIFrame:CardIFrame,CardImage:CardImage,CardMap:CardMap,CardParagraph:CardParagraph,CardRow:CardRow,CardSlider:CardSlider,CardTitle:CardTitle,CardVideo:CardVideo,CardYoutube:CardYoutube,Product:Product,ProductVariation:ProductVariation,ProductAnnotation:ProductAnnotation,FileAudio:FileAudio,FileVideo:FileVideo,FileModel:FileModel,FileImage:FileImage,FileObject:FileObject,ScriptEvent:ScriptEvent,Tag:Tag,ApplicationBuild:ApplicationBuild,AsyncJob:AsyncJob,SceneObject:SceneObject,CardObject:CardObject,ProductObject:ProductObject}},{"./server/plattar-server.js":5,"./types/application.js":6,"./types/file/file-audio.js":7,"./types/file/file-base.js":8,"./types/file/file-image.js":9,"./types/file/file-model.js":10,"./types/file/file-video.js":11,"./types/misc/application-build.js":15,"./types/misc/async-job.js":16,"./types/misc/script-event.js":17,"./types/misc/tag.js":18,"./types/page/card-base.js":19,"./types/page/card-button.js":20,"./types/page/card-html.js":21,"./types/page/card-iframe.js":22,"./types/page/card-image.js":23,"./types/page/card-map.js":24,"./types/page/card-paragraph.js":25,"./types/page/card-row.js":26,"./types/page/card-slider.js":27,"./types/page/card-title.js":28,"./types/page/card-video.js":29,"./types/page/card-youtube.js":30,"./types/page/page.js":31,"./types/product/product-annotation.js":32,"./types/product/product-base.js":33,"./types/product/product-variation.js":34,"./types/product/product.js":35,"./types/scene/scene-annotation.js":36,"./types/scene/scene-audio.js":37,"./types/scene/scene-base.js":38,"./types/scene/scene-button.js":39,"./types/scene/scene-camera.js":40,"./types/scene/scene-carousel.js":41,"./types/scene/scene-image.js":42,"./types/scene/scene-model.js":43,"./types/scene/scene-panorama.js":44,"./types/scene/scene-poller.js":45,"./types/scene/scene-product.js":46,"./types/scene/scene-shadow.js":47,"./types/scene/scene-video.js":48,"./types/scene/scene-volumetric.js":49,"./types/scene/scene-youtube.js":50,"./types/scene/scene.js":51,"./util/plattar-util.js":52}],2:[function(require,module,exports){(function(global){(function(){"use strict";var getGlobal=function getGlobal(){if(typeof self!=="undefined"){return self}if(typeof window!=="undefined"){return window}if(typeof global!=="undefined"){return global}throw new Error("unable to locate global object")};var global=getGlobal();module.exports=exports=global.fetch;if(global.fetch){exports["default"]=global.fetch.bind(global)}exports.Headers=global.Headers;exports.Request=global.Request;exports.Response=global.Response}).call(this)}).call(this,typeof global!=="undefined"?global:typeof self!=="undefined"?self:typeof window!=="undefined"?window:{})},{}],3:[function(require,module,exports){var process=module.exports={};var cachedSetTimeout;var cachedClearTimeout;function defaultSetTimout(){throw new Error("setTimeout has not been defined")}function defaultClearTimeout(){throw new Error("clearTimeout has not been defined")}(function(){try{if(typeof setTimeout==="function"){cachedSetTimeout=setTimeout}else{cachedSetTimeout=defaultSetTimout}}catch(e){cachedSetTimeout=defaultSetTimout}try{if(typeof clearTimeout==="function"){cachedClearTimeout=clearTimeout}else{cachedClearTimeout=defaultClearTimeout}}catch(e){cachedClearTimeout=defaultClearTimeout}})();function runTimeout(fun){if(cachedSetTimeout===setTimeout){return setTimeout(fun,0)}if((cachedSetTimeout===defaultSetTimout||!cachedSetTimeout)&&setTimeout){cachedSetTimeout=setTimeout;return setTimeout(fun,0)}try{return cachedSetTimeout(fun,0)}catch(e){try{return cachedSetTimeout.call(null,fun,0)}catch(e){return cachedSetTimeout.call(this,fun,0)}}}function runClearTimeout(marker){if(cachedClearTimeout===clearTimeout){return clearTimeout(marker)}if((cachedClearTimeout===defaultClearTimeout||!cachedClearTimeout)&&clearTimeout){cachedClearTimeout=clearTimeout;return clearTimeout(marker)}try{return cachedClearTimeout(marker)}catch(e){try{return cachedClearTimeout.call(null,marker)}catch(e){return cachedClearTimeout.call(this,marker)}}}var queue=[];var draining=false;var currentQueue;var queueIndex=-1;function cleanUpNextTick(){if(!draining||!currentQueue){return}draining=false;if(currentQueue.length){queue=currentQueue.concat(queue)}else{queueIndex=-1}if(queue.length){drainQueue()}}function drainQueue(){if(draining){return}var timeout=runTimeout(cleanUpNextTick);draining=true;var len=queue.length;while(len){currentQueue=queue;queue=[];while(++queueIndex<len){if(currentQueue){currentQueue[queueIndex].run()}}queueIndex=-1;len=queue.length}currentQueue=null;draining=false;runClearTimeout(timeout)}process.nextTick=function(fun){var args=new Array(arguments.length-1);if(arguments.length>1){for(var i=1;i<arguments.length;i++){args[i-1]=arguments[i]}}queue.push(new Item(fun,args));if(queue.length===1&&!draining){runTimeout(drainQueue)}};function Item(fun,array){this.fun=fun;this.array=array}Item.prototype.run=function(){this.fun.apply(null,this.array)};process.title="browser";process.browser=true;process.env={};process.argv=[];process.version="";process.versions={};function noop(){}process.on=noop;process.addListener=noop;process.once=noop;process.off=noop;process.removeListener=noop;process.removeAllListeners=noop;process.emit=noop;process.prependListener=noop;process.prependOnceListener=noop;process.listeners=function(name){return[]};process.binding=function(name){throw new Error("process.binding is not supported")};process.cwd=function(){return"/"};process.chdir=function(dir){throw new Error("process.chdir is not supported")};process.umask=function(){return 0}},{}],4:[function(require,module,exports){var fetch=require("node-fetch");var PlattarQuery=function(){function PlattarQuery(target,server){_classCallCheck(this,PlattarQuery);if(!target){throw new Error("PlattarQuery cannot be created as target object cannot be null")}if(!server){throw new Error("PlattarQuery cannot be created as server object cannot be null")}this._target=target;this._server=server;this._params=[];this._getIncludeQuery=[]}_createClass(PlattarQuery,[{key:"target",get:function get(){return this._target}},{key:"server",get:function get(){return this._server}},{key:"_get",value:function _get(opt){var _this=this;return new Promise(function(resolve,reject){var target=_this.target;var server=_this.server;if(!target.id){reject(new Error("PlattarQuery."+target.type()+".get() - object id is missing"));return}var options=opt||{cache:true};if(options.cache===true){var cached=PlattarQuery._GetGlobalCachedObject(target);if(cached){resolve(cached);return}}var origin=server.originLocation.api_read;var auth=server.authToken;var reqopts={method:"GET",headers:auth};var includeQuery=_this._IncludeQuery;var params=_this._ParamFor("get");var endpoint=origin+target.type()+"/"+target.id;if(includeQuery){endpoint=endpoint+"?include="+includeQuery}if(params){var appender=includeQuery?"&":"?";params.forEach(function(param){endpoint=endpoint+appender+param.key+"="+param.value;appender="&"})}fetch(endpoint,reqopts).then(function(res){if(res.ok){try{return res.json()}catch(err){return new Error("PlattarQuery."+target.type()+".get("+target.id+") - critical error occured, cannot proceed")}}return new Error("PlattarQuery."+target.type()+".get("+target.id+") - unexpected error occured, cannot proceed. error message is "+res.statusText)}).then(function(json){if(json instanceof Error){reject(json)}else{var PlattarUtil=require("../util/plattar-util.js");PlattarUtil.reconstruct(target,json,options);resolve(target)}})})}},{key:"_update",value:function _update(){var _this2=this;return new Promise(function(resolve,reject){var target=_this2.target;var server=_this2.server;if(!target.id){reject(new Error("PlattarQuery."+target.type()+".update() - object id is missing"));return}var origin=server.originLocation.api_write;var auth=server.authToken;var headers={Accept:"application/json","Content-Type":"application/json"};Object.assign(headers,auth);var reqopts={method:"PATCH",headers:headers,body:JSON.stringify({data:{id:target.id,attributes:target.attributes},meta:target.meta||{}})};var params=_this2._ParamFor("update");var endpoint=origin+target.type()+"/"+target.id;if(params){var appender="?";params.forEach(function(param){endpoint=endpoint+appender+param.key+"="+param.value;appender="&"})}fetch(endpoint,reqopts).then(function(res){if(res.ok){try{return res.json()}catch(err){return new Error("PlattarQuery."+target.type()+".update("+target.id+") - critical error occured, cannot proceed")}}return new Error("PlattarQuery."+target.type()+".update("+target.id+") - unexpected error occured, cannot proceed. error message is "+res.statusText)}).then(function(json){if(json instanceof Error){reject(json)}else{var PlattarUtil=require("../util/plattar-util.js");PlattarUtil.reconstruct(target,json,{cache:true});resolve(target)}})})}},{key:"_create",value:function _create(){var _this3=this;return new Promise(function(resolve,reject){reject(new Error("PlattarQuery."+_this3.target.type()+".create() - not implemented"))})}},{key:"_delete",value:function _delete(){var _this4=this;return new Promise(function(resolve,reject){reject(new Error("PlattarQuery."+_this4.target.type()+".delete("+_this4.target.id+") - not implemented"))})}},{key:"_addParameter",value:function _addParameter(key,value,type){type=type||"all";this._params.push({key:key,value:value,type:type.toLowerCase()})}},{key:"_include",value:function _include(args){var _this5=this;if(!args||args.length<=0){return this}var PlattarUtil=require("../util/plattar-util.js");args.forEach(function(obj){if(Array.isArray(obj)){obj.forEach(function(strObject){if(typeof strObject==="string"||strObject instanceof String){_this5._getIncludeQuery.push(strObject)}else{throw new Error("PlattarQuery."+_this5.target.type()+".include(...args) - argument of Array must only include Strings")}})}else if(PlattarUtil.isPlattarObject(obj)){var type=obj.type();if(Array.isArray(type)){_this5._include(type)}else{_this5._getIncludeQuery.push(type)}}else{throw new Error("PlattarQuery."+_this5.target.type()+".include(...args) - argument must be of type PlattarObject or Array but was type="+_typeof(obj)+" value="+obj)}});return this}},{key:"_ParamFor",value:function _ParamFor(type){type=type||"all";var list=this._params.filter(function(objcheck){return objcheck.type===type||objcheck.type==="all"});if(list.length>0){return list}return undefined}},{key:"_IncludeQuery",get:function get(){if(this._getIncludeQuery.length<=0){return undefined}return"".concat(this._getIncludeQuery.map(function(item){return"".concat(item)}).join(","))}}]);return PlattarQuery}();PlattarQuery._GlobalObjectCache={};PlattarQuery._InvalidateGlobalCache=function(){PlattarQuery._GlobalObjectCache={}};PlattarQuery._HasGlobalCachedObject=function(obj){return PlattarQuery._GlobalObjectCache.hasOwnProperty(obj.id)};PlattarQuery._GetGlobalCachedObject=function(obj){return PlattarQuery._HasGlobalCachedObject(obj)?PlattarQuery._GlobalObjectCache[obj.id]:undefined};PlattarQuery._SetGlobalCachedObject=function(obj){};PlattarQuery._DeleteGlobalCachedObject=function(obj){if(PlattarQuery._HasGlobalCachedObject(obj)){delete PlattarQuery._GlobalObjectCache[obj.id]}};module.exports=PlattarQuery},{"../util/plattar-util.js":52,"node-fetch":2}],5:[function(require,module,exports){(function(process){(function(){var fetch=require("node-fetch");var PlattarServer=function(){function PlattarServer(){_classCallCheck(this,PlattarServer);this._authToken={};this._serverLocation=this.prod}_createClass(PlattarServer,[{key:"prod",get:function get(){return PlattarServer.match("prod")}},{key:"isProd",get:function get(){return this._serverLocation.type==="prod"}},{key:"staging",get:function get(){return PlattarServer.match("staging")}},{key:"isStaging",get:function get(){return this._serverLocation.type==="staging"}},{key:"dev",get:function get(){return PlattarServer.match("dev")}},{key:"isDev",get:function get(){return this._serverLocation.type==="dev"}},{key:"authToken",get:function get(){return this._authToken}},{key:"originLocation",get:function get(){return this._serverLocation}},{key:"auth",value:function auth(token,opt){var _this6=this;var copt=opt||{validate:false};return new Promise(function(resolve,reject){var server=_this6.originLocation.api_write;if(!server){reject(new Error("Plattar.auth(token) - cannot authenticate as server not set via Plattar.origin(server)"));return}if(!token){reject(new Error("Plattar.auth(token) - token variable is undefined"));return}if(!copt.validate){_this6._authToken={"plattar-auth-token":token};resolve(_this6);return}var endpoint=server+"plattaruser/xauth/validate";var options={method:"GET",headers:{"plattar-auth-token":token}};fetch(endpoint,options).then(function(res){if(res.ok){_this6._authToken={"plattar-auth-token":token};resolve(_this6)}else{reject(new Error("Plattar.auth(token) - failed to validate authentication token at "+endpoint))}})})}},{key:"origin",value:function origin(server,opt){var _this7=this;var copt=opt||{validate:false};return new Promise(function(resolve,reject){if(!server){reject(new Error("Plattar.origin(server) - server variable is undefined"));return}if(!copt.validate){_this7._serverLocation=server;resolve(_this7);return}var endpoint=server.api_read+"ping";var options={method:"GET"};fetch(endpoint,options).then(function(res){if(res.ok){_this7._serverLocation=server;resolve(_this7)}else{reject(new Error("Plattar.origin(server) - failed to ping server at "+endpoint))}})})}}]);return PlattarServer}();PlattarServer.match=function(serverName){switch(serverName.toLowerCase()){case"staging.plattar.space":case"cdn-staging.plattar.space":case"staging":return{base:"https://staging.plattar.space/",api_read:"https://staging.plattar.space/api/v2/",api_write:"https://cms.plattar.space/api/v2/",cdn:"https://cdn-staging.plattar.space/",cdn_image:"http://plattar-staging.s3-website-ap-southeast-2.amazonaws.com/",analytics:"https://c.plattar.space/api/v2/analytics",type:"staging"};case"app.plattar.com":case"cdn.plattar.com":case"prod":case"production":return{base:"https://app.plattar.com/",api_read:"https://app.plattar.com/api/v2/",api_write:"https://cms.plattar.com/api/v2/",cdn:"https://cdn.plattar.com/",cdn_image:"http://plattar-production.s3-website-ap-southeast-2.amazonaws.com/",analytics:"https://c.plattar.space/api/v2/analytics",type:"prod"};case"dev":case"developer":case"development":case"local":case"localhost":default:return{base:"https://localhost/",api_read:"https://localhost/api/v2/",api_write:"https://localhost/api/v2/",cdn:"https://cdn-dev.plattar.space/",cdn_image:"http://plattar-dev.s3-website-ap-southeast-2.amazonaws.com/",analytics:"https://localhost:3000/api/v2/analytics/",type:"dev"}}};PlattarServer.create=function(origin,auth){var newServer=new PlattarServer;if(origin){newServer.origin(origin)}if(auth){newServer.auth(auth)}PlattarServer._default=newServer;return newServer};PlattarServer.disableTLS=function(){process.env.NODE_TLS_REJECT_UNAUTHORIZED="0"};PlattarServer["default"]=function(){return PlattarServer._default};PlattarServer.location=function(){return PlattarServer["default"]().originLocation};module.exports=PlattarServer}).call(this)}).call(this,require("_process"))},{_process:3,"node-fetch":2}],6:[function(require,module,exports){var PlattarBase=require("./interfaces/plattar-base.js");var Application=function(_PlattarBase){_inherits(Application,_PlattarBase);var _super=_createSuper(Application);function Application(){_classCallCheck(this,Application);return _super.apply(this,arguments)}_createClass(Application,null,[{key:"type",value:function type(){return"application"}}]);return Application}(PlattarBase);module.exports=Application},{"./interfaces/plattar-base.js":12}],7:[function(require,module,exports){var FileBase=require("./file-base.js");var FileAudio=function(_FileBase){_inherits(FileAudio,_FileBase);var _super2=_createSuper(FileAudio);function FileAudio(){_classCallCheck(this,FileAudio);return _super2.apply(this,arguments)}_createClass(FileAudio,null,[{key:"type",value:function type(){return"fileaudio"}}]);return FileAudio}(FileBase);module.exports=FileAudio},{"./file-base.js":8}],8:[function(require,module,exports){var PlattarBase=require("../interfaces/plattar-base.js");var Server=require("../../server/plattar-server.js");var FileBase=function(_PlattarBase2){_inherits(FileBase,_PlattarBase2);var _super3=_createSuper(FileBase);function FileBase(id,server){var _this8;_classCallCheck(this,FileBase);_this8=_super3.call(this,id,server||Server["default"]());if(_this8.constructor===FileBase){throw new Error("FileBase is abstract and cannot be created")}return _this8}_createClass(FileBase,[{key:"sourcePath",get:function get(){if(!this.attributes.path){return null}return this.path+this.attributes.original_filename}},{key:"backupPath",get:function get(){if(!this.attributes.path){return null}return this.path+this.attributes.original_upload}},{key:"path",get:function get(){if(!this.attributes.path){return null}return this._query.server.originLocation.cdn+this.attributes.path}}],[{key:"type",value:function type(){var FileAudio=require("./file-audio.js");var FileVideo=require("./file-video.js");var FileModel=require("./file-model.js");var FileImage=require("./file-image.js");return[FileAudio,FileVideo,FileModel,FileImage]}}]);return FileBase}(PlattarBase);module.exports=FileBase},{"../../server/plattar-server.js":5,"../interfaces/plattar-base.js":12,"./file-audio.js":7,"./file-image.js":9,"./file-model.js":10,"./file-video.js":11}],9:[function(require,module,exports){var FileBase=require("./file-base.js");var FileImage=function(_FileBase2){_inherits(FileImage,_FileBase2);var _super4=_createSuper(FileImage);function FileImage(){_classCallCheck(this,FileImage);return _super4.apply(this,arguments)}_createClass(FileImage,null,[{key:"type",value:function type(){return"fileimage"}}]);return FileImage}(FileBase);module.exports=FileImage},{"./file-base.js":8}],10:[function(require,module,exports){var FileBase=require("./file-base.js");var FileModel=function(_FileBase3){_inherits(FileModel,_FileBase3);var _super5=_createSuper(FileModel);function FileModel(){_classCallCheck(this,FileModel);return _super5.apply(this,arguments)}_createClass(FileModel,null,[{key:"type",value:function type(){return"filemodel"}}]);return FileModel}(FileBase);module.exports=FileModel},{"./file-base.js":8}],11:[function(require,module,exports){var FileBase=require("./file-base.js");var FileVideo=function(_FileBase4){_inherits(FileVideo,_FileBase4);var _super6=_createSuper(FileVideo);function FileVideo(){_classCallCheck(this,FileVideo);return _super6.apply(this,arguments)}_createClass(FileVideo,null,[{key:"type",value:function type(){return"filevideo"}}]);return FileVideo}(FileBase);module.exports=FileVideo},{"./file-base.js":8}],12:[function(require,module,exports){var PlattarObject=require("./plattar-object.js");var Server=require("../../server/plattar-server.js");var PlattarBase=function(_PlattarObject){_inherits(PlattarBase,_PlattarObject);var _super7=_createSuper(PlattarBase);function PlattarBase(id,server){var _this9;_classCallCheck(this,PlattarBase);_this9=_super7.call(this,id,server||Server["default"]());if(_this9.constructor===PlattarBase){throw new Error("PlattarBase is abstract and cannot be created")}return _this9}return PlattarBase}(PlattarObject);module.exports=PlattarBase},{"../../server/plattar-server.js":5,"./plattar-object.js":14}],13:[function(require,module,exports){var PlattarObjectRelations=function(){function PlattarObjectRelations(parent){_classCallCheck(this,PlattarObjectRelations);this._parent=parent;this._relatedObjects={}}_createClass(PlattarObjectRelations,[{key:"parent",get:function get(){return this._parent}},{key:"_put",value:function _put(obj){if(!obj){return this}var PlattarUtil=require("../../util/plattar-util.js");if(!PlattarUtil.isPlattarObject(obj)){throw new Error("PlattarObjectRelations._put(PlattarObject) - argument must be type of PlattarObject")}if(!this._relatedObjects.hasOwnProperty(obj.type())){this._relatedObjects[obj.type()]=[]}this._relatedObjects[obj.type()].push(obj)}},{key:"filter",value:function filter(obj,id){var _this10=this;if(!obj){return[]}var PlattarUtil=require("../../util/plattar-util.js");if(!PlattarUtil.isPlattarObject(obj)){throw new Error("PlattarObjectRelations.filter(PlattarObject) - argument must be type of PlattarObject")}var type=obj.type();if(Array.isArray(type)){var compiledList=[];type.forEach(function(inObject){var retArray=_this10.filter(inObject,id);if(retArray.length>0){compiledList=compiledList.concat(retArray)}});return compiledList}if(!this._relatedObjects.hasOwnProperty(type)){return[]}var list=this._relatedObjects[type];if(!id){return list}return list.filter(function(objcheck){return objcheck.id===id})}},{key:"find",value:function find(obj,id){var list=this.filter(obj,id);if(list.length<=0){return undefined}return list[0]}}]);return PlattarObjectRelations}();module.exports=PlattarObjectRelations},{"../../util/plattar-util.js":52}],14:[function(require,module,exports){var PlattarQuery=require("../../server/plattar-query.js");var PlattarObjectRelations=require("./plattar-object-relations.js");var PlattarObject=function(){function PlattarObject(id,server){_classCallCheck(this,PlattarObject);if(this.constructor===PlattarObject){throw new Error("PlattarObject is abstract and cannot be created")}this._id=id;this._attributes={};this._meta={};this._query=new PlattarQuery(this,server);this._relationships=new PlattarObjectRelations(this)}_createClass(PlattarObject,[{key:"invalidate",value:function invalidate(){return PlattarQuery._DeleteGlobalCachedObject(this)}},{key:"_cache",value:function _cache(){return PlattarQuery._SetGlobalCachedObject(this)}},{key:"id",get:function get(){return this._id}},{key:"attributes",get:function get(){return this._attributes}},{key:"meta",get:function get(){return this._meta}},{key:"overrideAttributes",set:function set(attributes){this._attributes=Object.assign({},attributes)}},{key:"relationships",get:function get(){return this._relationships}},{key:"get",value:function get(opt){return this._query._get(opt)}},{key:"update",value:function update(){return this._query._update()}},{key:"create",value:function create(){return this._query._create()}},{key:"delete",value:function _delete(){return this._query._delete()}},{key:"type",value:function type(){return this.constructor.type()}},{key:"include",value:function include(){for(var _len=arguments.length,args=new Array(_len),_key=0;_key<_len;_key++){args[_key]=arguments[_key]}this._query._include(args);return this}},{key:"addParameter",value:function addParameter(key,value,type){this._query._addParameter(key,value,type);return this}}],[{key:"type",value:function type(){throw new Error("PlattarObject.type() - not implemented")}},{key:"include",value:function include(){var _this11=this;for(var _len2=arguments.length,args=new Array(_len2),_key2=0;_key2<_len2;_key2++){args[_key2]=arguments[_key2]}if(!args||args.length<=0){return[]}var includes=[this.type()];args.forEach(function(obj){if(Array.isArray(obj)){obj.forEach(function(strObject){if(typeof strObject==="string"||strObject instanceof String){includes.push("".concat(_this11.type(),".").concat(strObject))}else{throw new Error("PlattarObject."+_this11.type()+".include(...args) - argument of Array must only include Strings")}})}else if(obj.prototype instanceof PlattarObject){includes.push("".concat(_this11.type(),".").concat(obj.type()))}else{throw new Error("PlattarObject."+_this11.type()+".include(...args) - argument must be of type PlattarObject or Array but was type="+_typeof(obj)+" value="+obj)}});return includes}}]);return PlattarObject}();module.exports=PlattarObject},{"../../server/plattar-query.js":4,"./plattar-object-relations.js":13}],15:[function(require,module,exports){var PlattarBase=require("../interfaces/plattar-base.js");var ApplicationBuild=function(_PlattarBase3){_inherits(ApplicationBuild,_PlattarBase3);var _super8=_createSuper(ApplicationBuild);function ApplicationBuild(){_classCallCheck(this,ApplicationBuild);return _super8.apply(this,arguments)}_createClass(ApplicationBuild,null,[{key:"type",value:function type(){return"applicationbuild"}}]);return ApplicationBuild}(PlattarBase);module.exports=ApplicationBuild},{"../interfaces/plattar-base.js":12}],16:[function(require,module,exports){var PlattarBase=require("../interfaces/plattar-base.js");var AsyncJob=function(_PlattarBase4){_inherits(AsyncJob,_PlattarBase4);var _super9=_createSuper(AsyncJob);function AsyncJob(){_classCallCheck(this,AsyncJob);return _super9.apply(this,arguments)}_createClass(AsyncJob,[{key:"accessKey",set:function set(code){this.addParameter("access_key",code,"update")}}],[{key:"type",value:function type(){return"asyncjob"}}]);return AsyncJob}(PlattarBase);module.exports=AsyncJob},{"../interfaces/plattar-base.js":12}],17:[function(require,module,exports){var PlattarBase=require("../interfaces/plattar-base.js");var ScriptEvent=function(_PlattarBase5){_inherits(ScriptEvent,_PlattarBase5);var _super10=_createSuper(ScriptEvent);function ScriptEvent(){_classCallCheck(this,ScriptEvent);return _super10.apply(this,arguments)}_createClass(ScriptEvent,null,[{key:"type",value:function type(){return"scriptevent"}}]);return ScriptEvent}(PlattarBase);module.exports=ScriptEvent},{"../interfaces/plattar-base.js":12}],18:[function(require,module,exports){var PlattarBase=require("../interfaces/plattar-base.js");var Tag=function(_PlattarBase6){_inherits(Tag,_PlattarBase6);var _super11=_createSuper(Tag);function Tag(){_classCallCheck(this,Tag);return _super11.apply(this,arguments)}_createClass(Tag,null,[{key:"type",value:function type(){return"tag"}}]);return Tag}(PlattarBase);module.exports=Tag},{"../interfaces/plattar-base.js":12}],19:[function(require,module,exports){var PlattarBase=require("../interfaces/plattar-base.js");var Server=require("../../server/plattar-server.js");var CardBase=function(_PlattarBase7){_inherits(CardBase,_PlattarBase7);var _super12=_createSuper(CardBase);function CardBase(id,server){var _this12;_classCallCheck(this,CardBase);_this12=_super12.call(this,id,server||Server["default"]());if(_this12.constructor===CardBase){throw new Error("CardBase is abstract and cannot be created")}return _this12}_createClass(CardBase,null,[{key:"type",value:function type(){var CardButton=require("./card-button.js");var CardHTML=require("./card-html.js");var CardIFrame=require("./card-iframe.js");var CardImage=require("./card-image.js");var CardMap=require("./card-map.js");var CardParagraph=require("./card-paragraph.js");var CardRow=require("./card-row.js");var CardSlider=require("./card-slider.js");var CardTitle=require("./card-title.js");var CardVideo=require("./card-video.js");var CardYoutube=require("./card-youtube.js");return[CardButton,CardHTML,CardIFrame,CardImage,CardMap,CardParagraph,CardRow,CardSlider,CardTitle,CardVideo,CardYoutube]}}]);return CardBase}(PlattarBase);module.exports=CardBase},{"../../server/plattar-server.js":5,"../interfaces/plattar-base.js":12,"./card-button.js":20,"./card-html.js":21,"./card-iframe.js":22,"./card-image.js":23,"./card-map.js":24,"./card-paragraph.js":25,"./card-row.js":26,"./card-slider.js":27,"./card-title.js":28,"./card-video.js":29,"./card-youtube.js":30}],20:[function(require,module,exports){var CardBase=require("./card-base.js");var CardButton=function(_CardBase){_inherits(CardButton,_CardBase);var _super13=_createSuper(CardButton);function CardButton(){_classCallCheck(this,CardButton);return _super13.apply(this,arguments)}_createClass(CardButton,null,[{key:"type",value:function type(){return"cardbutton"}}]);return CardButton}(CardBase);module.exports=CardButton},{"./card-base.js":19}],21:[function(require,module,exports){var CardBase=require("./card-base.js");var CardHTML=function(_CardBase2){_inherits(CardHTML,_CardBase2);var _super14=_createSuper(CardHTML);function CardHTML(){_classCallCheck(this,CardHTML);return _super14.apply(this,arguments)}_createClass(CardHTML,null,[{key:"type",value:function type(){return"cardhtml"}}]);return CardHTML}(CardBase);module.exports=CardHTML},{"./card-base.js":19}],22:[function(require,module,exports){var CardBase=require("./card-base.js");var CardIFrame=function(_CardBase3){_inherits(CardIFrame,_CardBase3);var _super15=_createSuper(CardIFrame);function CardIFrame(){_classCallCheck(this,CardIFrame);return _super15.apply(this,arguments)}_createClass(CardIFrame,null,[{key:"type",value:function type(){return"cardiframe"}}]);return CardIFrame}(CardBase);module.exports=CardIFrame},{"./card-base.js":19}],23:[function(require,module,exports){var CardBase=require("./card-base.js");var CardImage=function(_CardBase4){_inherits(CardImage,_CardBase4);var _super16=_createSuper(CardImage);function CardImage(){_classCallCheck(this,CardImage);return _super16.apply(this,arguments)}_createClass(CardImage,null,[{key:"type",value:function type(){return"cardimage"}}]);return CardImage}(CardBase);module.exports=CardImage},{"./card-base.js":19}],24:[function(require,module,exports){var CardBase=require("./card-base.js");var CardMap=function(_CardBase5){_inherits(CardMap,_CardBase5);var _super17=_createSuper(CardMap);function CardMap(){_classCallCheck(this,CardMap);return _super17.apply(this,arguments)}_createClass(CardMap,null,[{key:"type",value:function type(){return"cardmap"}}]);return CardMap}(CardBase);module.exports=CardMap},{"./card-base.js":19}],25:[function(require,module,exports){var CardBase=require("./card-base.js");var CardParagraph=function(_CardBase6){_inherits(CardParagraph,_CardBase6);var _super18=_createSuper(CardParagraph);function CardParagraph(){_classCallCheck(this,CardParagraph);return _super18.apply(this,arguments)}_createClass(CardParagraph,null,[{key:"type",value:function type(){return"cardparagraph"}}]);return CardParagraph}(CardBase);module.exports=CardParagraph},{"./card-base.js":19}],26:[function(require,module,exports){var CardBase=require("./card-base.js");var CardRow=function(_CardBase7){_inherits(CardRow,_CardBase7);var _super19=_createSuper(CardRow);function CardRow(){_classCallCheck(this,CardRow);return _super19.apply(this,arguments)}_createClass(CardRow,null,[{key:"type",value:function type(){return"cardrow"}}]);return CardRow}(CardBase);module.exports=CardRow},{"./card-base.js":19}],27:[function(require,module,exports){var CardBase=require("./card-base.js");var CardSlider=function(_CardBase8){_inherits(CardSlider,_CardBase8);var _super20=_createSuper(CardSlider);function CardSlider(){_classCallCheck(this,CardSlider);return _super20.apply(this,arguments)}_createClass(CardSlider,null,[{key:"type",value:function type(){return"cardslider"}}]);return CardSlider}(CardBase);module.exports=CardSlider},{"./card-base.js":19}],28:[function(require,module,exports){var CardBase=require("./card-base.js");var CardTitle=function(_CardBase9){_inherits(CardTitle,_CardBase9);var _super21=_createSuper(CardTitle);function CardTitle(){_classCallCheck(this,CardTitle);return _super21.apply(this,arguments)}_createClass(CardTitle,null,[{key:"type",value:function type(){return"cardtitle"}}]);return CardTitle}(CardBase);module.exports=CardTitle},{"./card-base.js":19}],29:[function(require,module,exports){var CardBase=require("./card-base.js");var CardVideo=function(_CardBase10){_inherits(CardVideo,_CardBase10);var _super22=_createSuper(CardVideo);function CardVideo(){_classCallCheck(this,CardVideo);return _super22.apply(this,arguments)}_createClass(CardVideo,null,[{key:"type",value:function type(){return"cardvideo"}}]);return CardVideo}(CardBase);module.exports=CardVideo},{"./card-base.js":19}],30:[function(require,module,exports){var CardBase=require("./card-base.js");var CardYoutube=function(_CardBase11){_inherits(CardYoutube,_CardBase11);var _super23=_createSuper(CardYoutube);function CardYoutube(){_classCallCheck(this,CardYoutube);return _super23.apply(this,arguments)}_createClass(CardYoutube,null,[{key:"type",value:function type(){return"cardyoutube"}}]);return CardYoutube}(CardBase);module.exports=CardYoutube},{"./card-base.js":19}],31:[function(require,module,exports){var PlattarBase=require("../interfaces/plattar-base.js");var Page=function(_PlattarBase8){_inherits(Page,_PlattarBase8);var _super24=_createSuper(Page);function Page(){_classCallCheck(this,Page);return _super24.apply(this,arguments)}_createClass(Page,null,[{key:"type",value:function type(){return"page"}}]);return Page}(PlattarBase);module.exports=Page},{"../interfaces/plattar-base.js":12}],32:[function(require,module,exports){var ProductBase=require("./product-base.js");var ProductAnnotation=function(_ProductBase){_inherits(ProductAnnotation,_ProductBase);var _super25=_createSuper(ProductAnnotation);function ProductAnnotation(){_classCallCheck(this,ProductAnnotation);return _super25.apply(this,arguments)}_createClass(ProductAnnotation,null,[{key:"type",value:function type(){return"productannotation"}}]);return ProductAnnotation}(ProductBase);module.exports=ProductAnnotation},{"./product-base.js":33}],33:[function(require,module,exports){var PlattarBase=require("../interfaces/plattar-base.js");var Server=require("../../server/plattar-server.js");var ProductBase=function(_PlattarBase9){_inherits(ProductBase,_PlattarBase9);var _super26=_createSuper(ProductBase);function ProductBase(id,server){var _this13;_classCallCheck(this,ProductBase);_this13=_super26.call(this,id,server||Server["default"]());if(_this13.constructor===ProductBase){throw new Error("ProductBase is abstract and cannot be created")}return _this13}_createClass(ProductBase,null,[{key:"type",value:function type(){var ProductVariation=require("./product-variation.js");var ProductAnnotation=require("./product-annotation.js");return[ProductAnnotation,ProductVariation]}}]);return ProductBase}(PlattarBase);module.exports=ProductBase},{"../../server/plattar-server.js":5,"../interfaces/plattar-base.js":12,"./product-annotation.js":32,"./product-variation.js":34}],34:[function(require,module,exports){var ProductBase=require("./product-base.js");var ProductVariation=function(_ProductBase2){_inherits(ProductVariation,_ProductBase2);var _super27=_createSuper(ProductVariation);function ProductVariation(){_classCallCheck(this,ProductVariation);return _super27.apply(this,arguments)}_createClass(ProductVariation,null,[{key:"type",value:function type(){return"productvariation"}}]);return ProductVariation}(ProductBase);module.exports=ProductVariation},{"./product-base.js":33}],35:[function(require,module,exports){var PlattarBase=require("../interfaces/plattar-base.js");var Product=function(_PlattarBase10){_inherits(Product,_PlattarBase10);var _super28=_createSuper(Product);function Product(){_classCallCheck(this,Product);return _super28.apply(this,arguments)}_createClass(Product,null,[{key:"type",value:function type(){return"product"}}]);return Product}(PlattarBase);module.exports=Product},{"../interfaces/plattar-base.js":12}],36:[function(require,module,exports){var SceneBase=require("./scene-base.js");var SceneAnnotation=function(_SceneBase){_inherits(SceneAnnotation,_SceneBase);var _super29=_createSuper(SceneAnnotation);function SceneAnnotation(){_classCallCheck(this,SceneAnnotation);return _super29.apply(this,arguments)}_createClass(SceneAnnotation,null,[{key:"type",value:function type(){return"sceneannotation"}}]);return SceneAnnotation}(SceneBase);module.exports=SceneAnnotation},{"./scene-base.js":38}],37:[function(require,module,exports){var SceneBase=require("./scene-base.js");var SceneAudio=function(_SceneBase2){_inherits(SceneAudio,_SceneBase2);var _super30=_createSuper(SceneAudio);function SceneAudio(){_classCallCheck(this,SceneAudio);return _super30.apply(this,arguments)}_createClass(SceneAudio,null,[{key:"type",value:function type(){return"sceneaudio"}}]);return SceneAudio}(SceneBase);module.exports=SceneAudio},{"./scene-base.js":38}],38:[function(require,module,exports){var PlattarBase=require("../interfaces/plattar-base.js");var Server=require("../../server/plattar-server.js");var SceneBase=function(_PlattarBase11){_inherits(SceneBase,_PlattarBase11);var _super31=_createSuper(SceneBase);function SceneBase(id,server){var _this14;_classCallCheck(this,SceneBase);_this14=_super31.call(this,id,server||Server["default"]());if(_this14.constructor===SceneBase){throw new Error("SceneBase is abstract and cannot be created")}return _this14}_createClass(SceneBase,null,[{key:"type",value:function type(){var SceneAnnotation=require("./scene-annotation.js");var SceneAudio=require("./scene-audio.js");var SceneButton=require("./scene-button.js");var SceneCamera=require("./scene-camera.js");var SceneCarousel=require("./scene-carousel.js");var SceneImage=require("./scene-image.js");var SceneModel=require("./scene-model.js");var ScenePanorama=require("./scene-panorama.js");var ScenePoller=require("./scene-poller.js");var SceneProduct=require("./scene-product.js");var SceneShadow=require("./scene-shadow.js");var SceneVideo=require("./scene-video.js");var SceneVolumetric=require("./scene-volumetric.js");var SceneYoutube=require("./scene-youtube.js");return[SceneAnnotation,SceneAudio,SceneButton,SceneCamera,SceneCarousel,SceneImage,SceneModel,ScenePanorama,ScenePoller,SceneProduct,SceneShadow,SceneVideo,SceneVolumetric,SceneYoutube]}}]);return SceneBase}(PlattarBase);module.exports=SceneBase},{"../../server/plattar-server.js":5,"../interfaces/plattar-base.js":12,"./scene-annotation.js":36,"./scene-audio.js":37,"./scene-button.js":39,"./scene-camera.js":40,"./scene-carousel.js":41,"./scene-image.js":42,"./scene-model.js":43,"./scene-panorama.js":44,"./scene-poller.js":45,"./scene-product.js":46,"./scene-shadow.js":47,"./scene-video.js":48,"./scene-volumetric.js":49,"./scene-youtube.js":50}],39:[function(require,module,exports){var SceneBase=require("./scene-base.js");var SceneButton=function(_SceneBase3){_inherits(SceneButton,_SceneBase3);var _super32=_createSuper(SceneButton);function SceneButton(){_classCallCheck(this,SceneButton);return _super32.apply(this,arguments)}_createClass(SceneButton,null,[{key:"type",value:function type(){return"scenebutton"}}]);return SceneButton}(SceneBase);module.exports=SceneButton},{"./scene-base.js":38}],40:[function(require,module,exports){var SceneBase=require("./scene-base.js");var SceneCamera=function(_SceneBase4){_inherits(SceneCamera,_SceneBase4);var _super33=_createSuper(SceneCamera);function SceneCamera(){_classCallCheck(this,SceneCamera);return _super33.apply(this,arguments)}_createClass(SceneCamera,null,[{key:"type",value:function type(){return"scenecamera"}}]);return SceneCamera}(SceneBase);module.exports=SceneCamera},{"./scene-base.js":38}],41:[function(require,module,exports){var SceneBase=require("./scene-base.js");var SceneCarousel=function(_SceneBase5){_inherits(SceneCarousel,_SceneBase5);var _super34=_createSuper(SceneCarousel);function SceneCarousel(){_classCallCheck(this,SceneCarousel);return _super34.apply(this,arguments)}_createClass(SceneCarousel,null,[{key:"type",value:function type(){return"scenecarousel"}}]);return SceneCarousel}(SceneBase);module.exports=SceneCarousel},{"./scene-base.js":38}],42:[function(require,module,exports){var SceneBase=require("./scene-base.js");var SceneImage=function(_SceneBase6){_inherits(SceneImage,_SceneBase6);var _super35=_createSuper(SceneImage);function SceneImage(){_classCallCheck(this,SceneImage);return _super35.apply(this,arguments)}_createClass(SceneImage,null,[{key:"type",value:function type(){return"sceneimage"}}]);return SceneImage}(SceneBase);module.exports=SceneImage},{"./scene-base.js":38}],43:[function(require,module,exports){var SceneBase=require("./scene-base.js");var SceneModel=function(_SceneBase7){_inherits(SceneModel,_SceneBase7);var _super36=_createSuper(SceneModel);function SceneModel(){_classCallCheck(this,SceneModel);return _super36.apply(this,arguments)}_createClass(SceneModel,null,[{key:"type",value:function type(){return"scenemodel"}}]);return SceneModel}(SceneBase);module.exports=SceneModel},{"./scene-base.js":38}],44:[function(require,module,exports){var SceneBase=require("./scene-base.js");var ScenePanorama=function(_SceneBase8){_inherits(ScenePanorama,_SceneBase8);var _super37=_createSuper(ScenePanorama);function ScenePanorama(){_classCallCheck(this,ScenePanorama);return _super37.apply(this,arguments)}_createClass(ScenePanorama,null,[{key:"type",value:function type(){return"scenepanorama"}}]);return ScenePanorama}(SceneBase);module.exports=ScenePanorama},{"./scene-base.js":38}],45:[function(require,module,exports){var SceneBase=require("./scene-base.js");var ScenePoller=function(_SceneBase9){_inherits(ScenePoller,_SceneBase9);var _super38=_createSuper(ScenePoller);function ScenePoller(){_classCallCheck(this,ScenePoller);return _super38.apply(this,arguments)}_createClass(ScenePoller,null,[{key:"type",value:function type(){return"scenepoller"}}]);return ScenePoller}(SceneBase);module.exports=ScenePoller},{"./scene-base.js":38}],46:[function(require,module,exports){var SceneBase=require("./scene-base.js");var SceneProduct=function(_SceneBase10){_inherits(SceneProduct,_SceneBase10);var _super39=_createSuper(SceneProduct);function SceneProduct(){_classCallCheck(this,SceneProduct);return _super39.apply(this,arguments)}_createClass(SceneProduct,null,[{key:"type",value:function type(){return"sceneproduct"}}]);return SceneProduct}(SceneBase);module.exports=SceneProduct},{"./scene-base.js":38}],47:[function(require,module,exports){var SceneBase=require("./scene-base.js");var SceneShadow=function(_SceneBase11){_inherits(SceneShadow,_SceneBase11);var _super40=_createSuper(SceneShadow);function SceneShadow(){_classCallCheck(this,SceneShadow);return _super40.apply(this,arguments)}_createClass(SceneShadow,null,[{key:"type",value:function type(){return"sceneshadow"}}]);return SceneShadow}(SceneBase);module.exports=SceneShadow},{"./scene-base.js":38}],48:[function(require,module,exports){var SceneBase=require("./scene-base.js");var SceneVideo=function(_SceneBase12){_inherits(SceneVideo,_SceneBase12);var _super41=_createSuper(SceneVideo);function SceneVideo(){_classCallCheck(this,SceneVideo);return _super41.apply(this,arguments)}_createClass(SceneVideo,null,[{key:"type",value:function type(){return"scenevideo"}}]);return SceneVideo}(SceneBase);module.exports=SceneVideo},{"./scene-base.js":38}],49:[function(require,module,exports){var SceneBase=require("./scene-base.js");var SceneVolumetric=function(_SceneBase13){_inherits(SceneVolumetric,_SceneBase13);var _super42=_createSuper(SceneVolumetric);function SceneVolumetric(){_classCallCheck(this,SceneVolumetric);return _super42.apply(this,arguments)}_createClass(SceneVolumetric,null,[{key:"type",value:function type(){return"scenevolumetric"}}]);return SceneVolumetric}(SceneBase);module.exports=SceneVolumetric},{"./scene-base.js":38}],50:[function(require,module,exports){var SceneBase=require("./scene-base.js");var SceneYoutube=function(_SceneBase14){_inherits(SceneYoutube,_SceneBase14);var _super43=_createSuper(SceneYoutube);function SceneYoutube(){_classCallCheck(this,SceneYoutube);return _super43.apply(this,arguments)}_createClass(SceneYoutube,null,[{key:"type",value:function type(){return"sceneyoutube"}}]);return SceneYoutube}(SceneBase);module.exports=SceneYoutube},{"./scene-base.js":38}],51:[function(require,module,exports){var PlattarBase=require("../interfaces/plattar-base.js");var Scene=function(_PlattarBase12){_inherits(Scene,_PlattarBase12);var _super44=_createSuper(Scene);function Scene(){_classCallCheck(this,Scene);return _super44.apply(this,arguments)}_createClass(Scene,null,[{key:"type",value:function type(){return"scene"}}]);return Scene}(PlattarBase);module.exports=Scene},{"../interfaces/plattar-base.js":12}],52:[function(require,module,exports){var Application=require("../types/application.js");var Scene=require("../types/scene/scene.js");var SceneAnnotation=require("../types/scene/scene-annotation.js");var SceneAudio=require("../types/scene/scene-audio.js");var SceneButton=require("../types/scene/scene-button.js");var SceneCamera=require("../types/scene/scene-camera.js");var SceneCarousel=require("../types/scene/scene-carousel.js");var SceneImage=require("../types/scene/scene-image.js");var SceneModel=require("../types/scene/scene-model.js");var ScenePanorama=require("../types/scene/scene-panorama.js");var ScenePoller=require("../types/scene/scene-poller.js");var SceneProduct=require("../types/scene/scene-product.js");var SceneShadow=require("../types/scene/scene-shadow.js");var SceneVideo=require("../types/scene/scene-video.js");var SceneVolumetric=require("../types/scene/scene-volumetric.js");var SceneYoutube=require("../types/scene/scene-youtube.js");var Page=require("../types/page/page.js");var CardButton=require("../types/page/card-button.js");var CardHTML=require("../types/page/card-html.js");var CardIFrame=require("../types/page/card-iframe.js");var CardImage=require("../types/page/card-image.js");var CardMap=require("../types/page/card-map.js");var CardParagraph=require("../types/page/card-paragraph.js");var CardRow=require("../types/page/card-row.js");var CardSlider=require("../types/page/card-slider.js");var CardTitle=require("../types/page/card-title.js");var CardVideo=require("../types/page/card-video.js");var CardYoutube=require("../types/page/card-youtube.js");var Product=require("../types/product/product.js");var ProductVariation=require("../types/product/product-variation.js");var ProductAnnotation=require("../types/product/product-annotation.js");var FileAudio=require("../types/file/file-audio.js");var FileVideo=require("../types/file/file-video.js");var FileModel=require("../types/file/file-model.js");var FileImage=require("../types/file/file-image.js");var ScriptEvent=require("../types/misc/script-event.js");var Tag=require("../types/misc/tag.js");var ApplicationBuild=require("../types/misc/application-build.js");var AsyncJob=require("../types/misc/async-job.js");var PlattarUtil=function PlattarUtil(){_classCallCheck(this,PlattarUtil)};PlattarUtil.isPlattarObject=function(obj){var PlattarObject=require("../types/interfaces/plattar-object.js");if(obj&&obj.prototype&&obj.prototype instanceof PlattarObject){return true}if(obj&&obj instanceof PlattarObject){return true}return false};PlattarUtil.reconstruct=function(parent,json,options){parent._attributes=json.data.attributes;if(options.cache===true){parent._cache()}var server=parent._query.server;if(json.data.relationships){var _loop=function _loop(){var _Object$entries$_i=_slicedToArray(_Object$entries[_i],2),key=_Object$entries$_i[0],value=_Object$entries$_i[1];var data=value.data;if(Array.isArray(data)){data.forEach(function(item){var construct=PlattarUtil.create(key,item.id,server);construct._attributes=item.attributes||{};parent.relationships._put(construct)})}else{var construct=PlattarUtil.create(key,data.id,server);construct._attributes=data.attributes||{};parent.relationships._put(construct)}};for(var _i=0,_Object$entries=Object.entries(json.data.relationships);_i<_Object$entries.length;_i++){_loop()}}if(json.included){json.included.forEach(function(item){var existing=parent.relationships.find(PlattarUtil.match(item.type),item.id);if(existing){PlattarUtil.reconstruct(existing,{data:item,included:json.included},options)}})}};PlattarUtil.create=function(type,id,server){var _DynamicClass=PlattarUtil.match(type);return new _DynamicClass(id,server)};PlattarUtil.match=function(type){switch(type){case Application.type():return Application;case Scene.type():return Scene;case SceneAnnotation.type():return SceneAnnotation;case SceneAudio.type():return SceneAudio;case SceneButton.type():return SceneButton;case SceneCamera.type():return SceneCamera;case SceneCarousel.type():return SceneCarousel;case SceneImage.type():return SceneImage;case SceneModel.type():return SceneModel;case ScenePanorama.type():return ScenePanorama;case ScenePoller.type():return ScenePoller;case SceneProduct.type():return SceneProduct;case SceneShadow.type():return SceneShadow;case SceneVideo.type():return SceneVideo;case SceneVolumetric.type():return SceneVolumetric;case SceneYoutube.type():return SceneYoutube;case Page.type():return Page;case CardButton.type():return CardButton;case CardHTML.type():return CardHTML;case CardIFrame.type():return CardIFrame;case Product.type():return Product;case ProductVariation.type():return ProductVariation;case ProductAnnotation.type():return ProductAnnotation;case FileAudio.type():return FileAudio;case FileVideo.type():return FileVideo;case FileModel.type():return FileModel;case FileImage.type():return FileImage;case CardMap.type():return CardMap;case CardParagraph.type():return CardParagraph;case CardRow.type():return CardRow;case CardSlider.type():return CardSlider;case CardTitle.type():return CardTitle;case CardVideo.type():return CardVideo;case CardYoutube.type():return CardYoutube;case CardImage.type():return CardImage;case ScriptEvent.type():return ScriptEvent;case Tag.type():return Tag;case ApplicationBuild.type():return ApplicationBuild;case AsyncJob.type():return AsyncJob;default:throw new Error('PlattarUtil.match(type) - provided type of "'+type+'" does not exist and cannot be created')}};module.exports=PlattarUtil},{"../types/application.js":6,"../types/file/file-audio.js":7,"../types/file/file-image.js":9,"../types/file/file-model.js":10,"../types/file/file-video.js":11,"../types/interfaces/plattar-object.js":14,"../types/misc/application-build.js":15,"../types/misc/async-job.js":16,"../types/misc/script-event.js":17,"../types/misc/tag.js":18,"../types/page/card-button.js":20,"../types/page/card-html.js":21,"../types/page/card-iframe.js":22,"../types/page/card-image.js":23,"../types/page/card-map.js":24,"../types/page/card-paragraph.js":25,"../types/page/card-row.js":26,"../types/page/card-slider.js":27,"../types/page/card-title.js":28,"../types/page/card-video.js":29,"../types/page/card-youtube.js":30,"../types/page/page.js":31,"../types/product/product-annotation.js":32,"../types/product/product-variation.js":34,"../types/product/product.js":35,"../types/scene/scene-annotation.js":36,"../types/scene/scene-audio.js":37,"../types/scene/scene-button.js":39,"../types/scene/scene-camera.js":40,"../types/scene/scene-carousel.js":41,"../types/scene/scene-image.js":42,"../types/scene/scene-model.js":43,"../types/scene/scene-panorama.js":44,"../types/scene/scene-poller.js":45,"../types/scene/scene-product.js":46,"../types/scene/scene-shadow.js":47,"../types/scene/scene-video.js":48,"../types/scene/scene-volumetric.js":49,"../types/scene/scene-youtube.js":50,"../types/scene/scene.js":51}]},{},[1])(1)});

@@ -1,1 +0,1 @@

(function(f){if(typeof exports==="object"&&typeof module!=="undefined"){module.exports=f()}else if(typeof define==="function"&&define.amd){define([],f)}else{var g;if(typeof window!=="undefined"){g=window}else if(typeof global!=="undefined"){g=global}else if(typeof self!=="undefined"){g=self}else{g=this}g.Plattar=f()}})(function(){var define,module,exports;return function(){function r(e,n,t){function o(i,f){if(!n[i]){if(!e[i]){var c="function"==typeof require&&require;if(!f&&c)return c(i,!0);if(u)return u(i,!0);var a=new Error("Cannot find module '"+i+"'");throw a.code="MODULE_NOT_FOUND",a}var p=n[i]={exports:{}};e[i][0].call(p.exports,function(r){var n=e[i][1][r];return o(n||r)},p,p.exports,r,e,n,t)}return n[i].exports}for(var u="function"==typeof require&&require,i=0;i<t.length;i++)o(t[i]);return o}return r}()({1:[function(require,module,exports){"use strict";const Server=require("./server/plattar-server.js");const Util=require("./util/plattar-util.js");const Project=require("./types/application.js");const Scene=require("./types/scene/scene.js");const SceneAnnotation=require("./types/scene/scene-annotation.js");const SceneAudio=require("./types/scene/scene-audio.js");const SceneButton=require("./types/scene/scene-button.js");const SceneCamera=require("./types/scene/scene-camera.js");const SceneCarousel=require("./types/scene/scene-carousel.js");const SceneImage=require("./types/scene/scene-image.js");const SceneModel=require("./types/scene/scene-model.js");const ScenePanorama=require("./types/scene/scene-panorama.js");const ScenePoller=require("./types/scene/scene-poller.js");const SceneProduct=require("./types/scene/scene-product.js");const SceneShadow=require("./types/scene/scene-shadow.js");const SceneVideo=require("./types/scene/scene-video.js");const SceneVolumetric=require("./types/scene/scene-volumetric.js");const SceneYoutube=require("./types/scene/scene-youtube.js");const Page=require("./types/page/page.js");const CardButton=require("./types/page/card-button.js");const CardHTML=require("./types/page/card-html.js");const CardIFrame=require("./types/page/card-iframe.js");const CardImage=require("./types/page/card-image.js");const CardMap=require("./types/page/card-map.js");const CardParagraph=require("./types/page/card-paragraph.js");const CardRow=require("./types/page/card-row.js");const CardSlider=require("./types/page/card-slider.js");const CardTitle=require("./types/page/card-title.js");const CardVideo=require("./types/page/card-video.js");const CardYoutube=require("./types/page/card-youtube.js");const Product=require("./types/product/product.js");const ProductVariation=require("./types/product/product-variation.js");const ProductAnnotation=require("./types/product/product-annotation.js");const FileAudio=require("./types/file/file-audio.js");const FileVideo=require("./types/file/file-video.js");const FileModel=require("./types/file/file-model.js");const FileImage=require("./types/file/file-image.js");const ScriptEvent=require("./types/misc/script-event.js");const Tag=require("./types/misc/tag.js");const ApplicationBuild=require("./types/misc/application-build.js");const AsyncJob=require("./types/misc/async-job.js");const SceneObject=require("./types/scene/scene-base.js");const CardObject=require("./types/page/card-base.js");const ProductObject=require("./types/product/product-base.js");const FileObject=require("./types/file/file-base.js");Server.create();module.exports={Server:Server,Util:Util,Project:Project,Scene:Scene,SceneAnnotation:SceneAnnotation,SceneAudio:SceneAudio,SceneButton:SceneButton,SceneCamera:SceneCamera,SceneCarousel:SceneCarousel,SceneImage:SceneImage,SceneModel:SceneModel,ScenePanorama:ScenePanorama,ScenePoller:ScenePoller,SceneProduct:SceneProduct,SceneShadow:SceneShadow,SceneVideo:SceneVideo,SceneVolumetric:SceneVolumetric,SceneYoutube:SceneYoutube,Page:Page,CardButton:CardButton,CardHTML:CardHTML,CardIFrame:CardIFrame,CardImage:CardImage,CardMap:CardMap,CardParagraph:CardParagraph,CardRow:CardRow,CardSlider:CardSlider,CardTitle:CardTitle,CardVideo:CardVideo,CardYoutube:CardYoutube,Product:Product,ProductVariation:ProductVariation,ProductAnnotation:ProductAnnotation,FileAudio:FileAudio,FileVideo:FileVideo,FileModel:FileModel,FileImage:FileImage,FileObject:FileObject,ScriptEvent:ScriptEvent,Tag:Tag,ApplicationBuild:ApplicationBuild,AsyncJob:AsyncJob,SceneObject:SceneObject,CardObject:CardObject,ProductObject:ProductObject}},{"./server/plattar-server.js":5,"./types/application.js":6,"./types/file/file-audio.js":7,"./types/file/file-base.js":8,"./types/file/file-image.js":9,"./types/file/file-model.js":10,"./types/file/file-video.js":11,"./types/misc/application-build.js":15,"./types/misc/async-job.js":16,"./types/misc/script-event.js":17,"./types/misc/tag.js":18,"./types/page/card-base.js":19,"./types/page/card-button.js":20,"./types/page/card-html.js":21,"./types/page/card-iframe.js":22,"./types/page/card-image.js":23,"./types/page/card-map.js":24,"./types/page/card-paragraph.js":25,"./types/page/card-row.js":26,"./types/page/card-slider.js":27,"./types/page/card-title.js":28,"./types/page/card-video.js":29,"./types/page/card-youtube.js":30,"./types/page/page.js":31,"./types/product/product-annotation.js":32,"./types/product/product-base.js":33,"./types/product/product-variation.js":34,"./types/product/product.js":35,"./types/scene/scene-annotation.js":36,"./types/scene/scene-audio.js":37,"./types/scene/scene-base.js":38,"./types/scene/scene-button.js":39,"./types/scene/scene-camera.js":40,"./types/scene/scene-carousel.js":41,"./types/scene/scene-image.js":42,"./types/scene/scene-model.js":43,"./types/scene/scene-panorama.js":44,"./types/scene/scene-poller.js":45,"./types/scene/scene-product.js":46,"./types/scene/scene-shadow.js":47,"./types/scene/scene-video.js":48,"./types/scene/scene-volumetric.js":49,"./types/scene/scene-youtube.js":50,"./types/scene/scene.js":51,"./util/plattar-util.js":52}],2:[function(require,module,exports){(function(global){(function(){"use strict";var getGlobal=function(){if(typeof self!=="undefined"){return self}if(typeof window!=="undefined"){return window}if(typeof global!=="undefined"){return global}throw new Error("unable to locate global object")};var global=getGlobal();module.exports=exports=global.fetch;if(global.fetch){exports.default=global.fetch.bind(global)}exports.Headers=global.Headers;exports.Request=global.Request;exports.Response=global.Response}).call(this)}).call(this,typeof global!=="undefined"?global:typeof self!=="undefined"?self:typeof window!=="undefined"?window:{})},{}],3:[function(require,module,exports){var process=module.exports={};var cachedSetTimeout;var cachedClearTimeout;function defaultSetTimout(){throw new Error("setTimeout has not been defined")}function defaultClearTimeout(){throw new Error("clearTimeout has not been defined")}(function(){try{if(typeof setTimeout==="function"){cachedSetTimeout=setTimeout}else{cachedSetTimeout=defaultSetTimout}}catch(e){cachedSetTimeout=defaultSetTimout}try{if(typeof clearTimeout==="function"){cachedClearTimeout=clearTimeout}else{cachedClearTimeout=defaultClearTimeout}}catch(e){cachedClearTimeout=defaultClearTimeout}})();function runTimeout(fun){if(cachedSetTimeout===setTimeout){return setTimeout(fun,0)}if((cachedSetTimeout===defaultSetTimout||!cachedSetTimeout)&&setTimeout){cachedSetTimeout=setTimeout;return setTimeout(fun,0)}try{return cachedSetTimeout(fun,0)}catch(e){try{return cachedSetTimeout.call(null,fun,0)}catch(e){return cachedSetTimeout.call(this,fun,0)}}}function runClearTimeout(marker){if(cachedClearTimeout===clearTimeout){return clearTimeout(marker)}if((cachedClearTimeout===defaultClearTimeout||!cachedClearTimeout)&&clearTimeout){cachedClearTimeout=clearTimeout;return clearTimeout(marker)}try{return cachedClearTimeout(marker)}catch(e){try{return cachedClearTimeout.call(null,marker)}catch(e){return cachedClearTimeout.call(this,marker)}}}var queue=[];var draining=false;var currentQueue;var queueIndex=-1;function cleanUpNextTick(){if(!draining||!currentQueue){return}draining=false;if(currentQueue.length){queue=currentQueue.concat(queue)}else{queueIndex=-1}if(queue.length){drainQueue()}}function drainQueue(){if(draining){return}var timeout=runTimeout(cleanUpNextTick);draining=true;var len=queue.length;while(len){currentQueue=queue;queue=[];while(++queueIndex<len){if(currentQueue){currentQueue[queueIndex].run()}}queueIndex=-1;len=queue.length}currentQueue=null;draining=false;runClearTimeout(timeout)}process.nextTick=function(fun){var args=new Array(arguments.length-1);if(arguments.length>1){for(var i=1;i<arguments.length;i++){args[i-1]=arguments[i]}}queue.push(new Item(fun,args));if(queue.length===1&&!draining){runTimeout(drainQueue)}};function Item(fun,array){this.fun=fun;this.array=array}Item.prototype.run=function(){this.fun.apply(null,this.array)};process.title="browser";process.browser=true;process.env={};process.argv=[];process.version="";process.versions={};function noop(){}process.on=noop;process.addListener=noop;process.once=noop;process.off=noop;process.removeListener=noop;process.removeAllListeners=noop;process.emit=noop;process.prependListener=noop;process.prependOnceListener=noop;process.listeners=function(name){return[]};process.binding=function(name){throw new Error("process.binding is not supported")};process.cwd=function(){return"/"};process.chdir=function(dir){throw new Error("process.chdir is not supported")};process.umask=function(){return 0}},{}],4:[function(require,module,exports){const fetch=require("node-fetch");class PlattarQuery{constructor(target,server){if(!target){throw new Error("PlattarQuery cannot be created as target object cannot be null")}if(!server){throw new Error("PlattarQuery cannot be created as server object cannot be null")}this._target=target;this._server=server;this._params=[];this._getIncludeQuery=[]}get target(){return this._target}get server(){return this._server}_get(opt){return new Promise((resolve,reject)=>{const target=this.target;const server=this.server;if(!target.id){reject(new Error("PlattarQuery."+target.type()+".get() - object id is missing"));return}const options=opt||{cache:true};if(options.cache===true){const cached=PlattarQuery._GetGlobalCachedObject(target);if(cached){resolve(cached);return}}const origin=server.originLocation.api_read;const auth=server.authToken;const reqopts={method:"GET",headers:auth};const includeQuery=this._IncludeQuery;const params=this._ParamFor("get");let endpoint=origin+target.type()+"/"+target.id;if(includeQuery){endpoint=endpoint+"?include="+includeQuery}if(params){let appender=includeQuery?"&":"?";params.forEach(param=>{endpoint=endpoint+appender+param.key+"="+param.value;appender="&"})}fetch(endpoint,reqopts).then(res=>{if(res.ok){try{return res.json()}catch(err){return new Error("PlattarQuery."+target.type()+".get("+target.id+") - critical error occured, cannot proceed")}}return new Error("PlattarQuery."+target.type()+".get("+target.id+") - unexpected error occured, cannot proceed. error message is "+res.statusText)}).then(json=>{if(json instanceof Error){reject(json)}else{const PlattarUtil=require("../util/plattar-util.js");PlattarUtil.reconstruct(target,json,options);resolve(target)}})})}_update(){return new Promise((resolve,reject)=>{const target=this.target;const server=this.server;if(!target.id){reject(new Error("PlattarQuery."+target.type()+".update() - object id is missing"));return}const origin=server.originLocation.api_write;const auth=server.authToken;const headers={Accept:"application/json","Content-Type":"application/json"};Object.assign(headers,auth);const reqopts={method:"PATCH",headers:headers,body:JSON.stringify({data:{id:target.id,attributes:target.attributes}})};const params=this._ParamFor("update");let endpoint=origin+target.type()+"/"+target.id;if(params){let appender="?";params.forEach(param=>{endpoint=endpoint+appender+param.key+"="+param.value;appender="&"})}fetch(endpoint,reqopts).then(res=>{if(res.ok){try{return res.json()}catch(err){return new Error("PlattarQuery."+target.type()+".update("+target.id+") - critical error occured, cannot proceed")}}return new Error("PlattarQuery."+target.type()+".update("+target.id+") - unexpected error occured, cannot proceed. error message is "+res.statusText)}).then(json=>{if(json instanceof Error){reject(json)}else{const PlattarUtil=require("../util/plattar-util.js");PlattarUtil.reconstruct(target,json,{cache:true});resolve(target)}})})}_create(){return new Promise((resolve,reject)=>{reject(new Error("PlattarQuery."+this.target.type()+".create() - not implemented"))})}_delete(){return new Promise((resolve,reject)=>{reject(new Error("PlattarQuery."+this.target.type()+".delete("+this.target.id+") - not implemented"))})}_addParameter(key,value,type){type=type||"all";this._params.push({key:key,value:value,type:type.toLowerCase()})}_include(args){if(!args||args.length<=0){return this}const PlattarUtil=require("../util/plattar-util.js");args.forEach(obj=>{if(Array.isArray(obj)){obj.forEach(strObject=>{if(typeof strObject==="string"||strObject instanceof String){this._getIncludeQuery.push(strObject)}else{throw new Error("PlattarQuery."+this.target.type()+".include(...args) - argument of Array must only include Strings")}})}else if(PlattarUtil.isPlattarObject(obj)){const type=obj.type();if(Array.isArray(type)){this._include(type)}else{this._getIncludeQuery.push(type)}}else{throw new Error("PlattarQuery."+this.target.type()+".include(...args) - argument must be of type PlattarObject or Array but was type="+typeof obj+" value="+obj)}});return this}_ParamFor(type){type=type||"all";const list=this._params.filter(objcheck=>{return objcheck.type===type||objcheck.type==="all"});if(list.length>0){return list}return undefined}get _IncludeQuery(){if(this._getIncludeQuery.length<=0){return undefined}return`${this._getIncludeQuery.map(item=>`${item}`).join(",")}`}}PlattarQuery._GlobalObjectCache={};PlattarQuery._InvalidateGlobalCache=(()=>{PlattarQuery._GlobalObjectCache={}});PlattarQuery._HasGlobalCachedObject=(obj=>{return PlattarQuery._GlobalObjectCache.hasOwnProperty(obj.id)});PlattarQuery._GetGlobalCachedObject=(obj=>{return PlattarQuery._HasGlobalCachedObject(obj)?PlattarQuery._GlobalObjectCache[obj.id]:undefined});PlattarQuery._SetGlobalCachedObject=(obj=>{});PlattarQuery._DeleteGlobalCachedObject=(obj=>{if(PlattarQuery._HasGlobalCachedObject(obj)){delete PlattarQuery._GlobalObjectCache[obj.id]}});module.exports=PlattarQuery},{"../util/plattar-util.js":52,"node-fetch":2}],5:[function(require,module,exports){(function(process){(function(){const fetch=require("node-fetch");class PlattarServer{constructor(){this._authToken={};this._serverLocation=this.prod}get prod(){return PlattarServer.match("prod")}get isProd(){return this._serverLocation.type==="prod"}get staging(){return PlattarServer.match("staging")}get isStaging(){return this._serverLocation.type==="staging"}get dev(){return PlattarServer.match("dev")}get isDev(){return this._serverLocation.type==="dev"}get authToken(){return this._authToken}get originLocation(){return this._serverLocation}auth(token,opt){const copt=opt||{validate:false};return new Promise((resolve,reject)=>{const server=this.originLocation.api_write;if(!server){reject(new Error("Plattar.auth(token) - cannot authenticate as server not set via Plattar.origin(server)"));return}if(!token){reject(new Error("Plattar.auth(token) - token variable is undefined"));return}if(!copt.validate){this._authToken={"plattar-auth-token":token};resolve(this);return}const endpoint=server+"plattaruser/xauth/validate";const options={method:"GET",headers:{"plattar-auth-token":token}};fetch(endpoint,options).then(res=>{if(res.ok){this._authToken={"plattar-auth-token":token};resolve(this)}else{reject(new Error("Plattar.auth(token) - failed to validate authentication token at "+endpoint))}})})}origin(server,opt){const copt=opt||{validate:false};return new Promise((resolve,reject)=>{if(!server){reject(new Error("Plattar.origin(server) - server variable is undefined"));return}if(!copt.validate){this._serverLocation=server;resolve(this);return}const endpoint=server.api_read+"ping";const options={method:"GET"};fetch(endpoint,options).then(res=>{if(res.ok){this._serverLocation=server;resolve(this)}else{reject(new Error("Plattar.origin(server) - failed to ping server at "+endpoint))}})})}}PlattarServer.match=(serverName=>{switch(serverName.toLowerCase()){case"staging.plattar.space":case"cdn-staging.plattar.space":case"staging":return{base:"https://staging.plattar.space/",api_read:"https://staging.plattar.space/api/v2/",api_write:"https://cms.plattar.space/api/v2/",cdn:"https://cdn-staging.plattar.space/",cdn_image:"http://plattar-staging.s3-website-ap-southeast-2.amazonaws.com/",analytics:"https://c.plattar.space/api/v2/analytics",type:"staging"};case"app.plattar.com":case"cdn.plattar.com":case"prod":case"production":return{base:"https://app.plattar.com/",api_read:"https://app.plattar.com/api/v2/",api_write:"https://cms.plattar.com/api/v2/",cdn:"https://cdn.plattar.com/",cdn_image:"http://plattar-production.s3-website-ap-southeast-2.amazonaws.com/",analytics:"https://c.plattar.space/api/v2/analytics",type:"prod"};case"dev":case"developer":case"development":case"local":case"localhost":default:return{base:"https://localhost/",api_read:"https://localhost/api/v2/",api_write:"https://localhost/api/v2/",cdn:"https://cdn-dev.plattar.space/",cdn_image:"http://plattar-dev.s3-website-ap-southeast-2.amazonaws.com/",analytics:"https://localhost:3000/api/v2/analytics/",type:"dev"}}});PlattarServer.create=((origin,auth)=>{const newServer=new PlattarServer;if(origin){newServer.origin(origin)}if(auth){newServer.auth(auth)}PlattarServer._default=newServer;return newServer});PlattarServer.disableTLS=(()=>{process.env.NODE_TLS_REJECT_UNAUTHORIZED="0"});PlattarServer.default=(()=>{return PlattarServer._default});PlattarServer.location=(()=>{return PlattarServer.default().originLocation});module.exports=PlattarServer}).call(this)}).call(this,require("_process"))},{_process:3,"node-fetch":2}],6:[function(require,module,exports){const PlattarBase=require("./interfaces/plattar-base.js");class Application extends PlattarBase{static type(){return"application"}}module.exports=Application},{"./interfaces/plattar-base.js":12}],7:[function(require,module,exports){const FileBase=require("./file-base.js");class FileAudio extends FileBase{static type(){return"fileaudio"}}module.exports=FileAudio},{"./file-base.js":8}],8:[function(require,module,exports){const PlattarBase=require("../interfaces/plattar-base.js");const Server=require("../../server/plattar-server.js");class FileBase extends PlattarBase{constructor(id,server){super(id,server||Server.default());if(this.constructor===FileBase){throw new Error("FileBase is abstract and cannot be created")}}static type(){const FileAudio=require("./file-audio.js");const FileVideo=require("./file-video.js");const FileModel=require("./file-model.js");const FileImage=require("./file-image.js");return[FileAudio,FileVideo,FileModel,FileImage]}get sourcePath(){if(!this.attributes.path){return null}return this.path+this.attributes.original_filename}get backupPath(){if(!this.attributes.path){return null}return this.path+this.attributes.original_upload}get path(){if(!this.attributes.path){return null}return this._query.server.originLocation.cdn+this.attributes.path}}module.exports=FileBase},{"../../server/plattar-server.js":5,"../interfaces/plattar-base.js":12,"./file-audio.js":7,"./file-image.js":9,"./file-model.js":10,"./file-video.js":11}],9:[function(require,module,exports){const FileBase=require("./file-base.js");class FileImage extends FileBase{static type(){return"fileimage"}}module.exports=FileImage},{"./file-base.js":8}],10:[function(require,module,exports){const FileBase=require("./file-base.js");class FileModel extends FileBase{static type(){return"filemodel"}}module.exports=FileModel},{"./file-base.js":8}],11:[function(require,module,exports){const FileBase=require("./file-base.js");class FileVideo extends FileBase{static type(){return"filevideo"}}module.exports=FileVideo},{"./file-base.js":8}],12:[function(require,module,exports){const PlattarObject=require("./plattar-object.js");const Server=require("../../server/plattar-server.js");class PlattarBase extends PlattarObject{constructor(id,server){super(id,server||Server.default());if(this.constructor===PlattarBase){throw new Error("PlattarBase is abstract and cannot be created")}}}module.exports=PlattarBase},{"../../server/plattar-server.js":5,"./plattar-object.js":14}],13:[function(require,module,exports){class PlattarObjectRelations{constructor(parent){this._parent=parent;this._relatedObjects={}}get parent(){return this._parent}_put(obj){if(!obj){return this}const PlattarUtil=require("../../util/plattar-util.js");if(!PlattarUtil.isPlattarObject(obj)){throw new Error("PlattarObjectRelations._put(PlattarObject) - argument must be type of PlattarObject")}if(!this._relatedObjects.hasOwnProperty(obj.type())){this._relatedObjects[obj.type()]=[]}this._relatedObjects[obj.type()].push(obj)}filter(obj,id){if(!obj){return[]}const PlattarUtil=require("../../util/plattar-util.js");if(!PlattarUtil.isPlattarObject(obj)){throw new Error("PlattarObjectRelations.filter(PlattarObject) - argument must be type of PlattarObject")}const type=obj.type();if(Array.isArray(type)){var compiledList=[];type.forEach(inObject=>{const retArray=this.filter(inObject,id);if(retArray.length>0){compiledList=compiledList.concat(retArray)}});return compiledList}if(!this._relatedObjects.hasOwnProperty(type)){return[]}const list=this._relatedObjects[type];if(!id){return list}return list.filter(objcheck=>{return objcheck.id===id})}find(obj,id){const list=this.filter(obj,id);if(list.length<=0){return undefined}return list[0]}}module.exports=PlattarObjectRelations},{"../../util/plattar-util.js":52}],14:[function(require,module,exports){const PlattarQuery=require("../../server/plattar-query.js");const PlattarObjectRelations=require("./plattar-object-relations.js");class PlattarObject{constructor(id,server){if(this.constructor===PlattarObject){throw new Error("PlattarObject is abstract and cannot be created")}this._id=id;this._attributes={};this._query=new PlattarQuery(this,server);this._relationships=new PlattarObjectRelations(this)}invalidate(){return PlattarQuery._DeleteGlobalCachedObject(this)}_cache(){return PlattarQuery._SetGlobalCachedObject(this)}get id(){return this._id}get attributes(){return this._attributes}set overrideAttributes(attributes){this._attributes=Object.assign({},attributes)}get relationships(){return this._relationships}get(opt){return this._query._get(opt)}update(){return this._query._update()}create(){return this._query._create()}delete(){return this._query._delete()}static type(){throw new Error("PlattarObject.type() - not implemented")}type(){return this.constructor.type()}static include(...args){if(!args||args.length<=0){return[]}const includes=[this.type()];args.forEach(obj=>{if(Array.isArray(obj)){obj.forEach(strObject=>{if(typeof strObject==="string"||strObject instanceof String){includes.push(`${this.type()}.${strObject}`)}else{throw new Error("PlattarObject."+this.type()+".include(...args) - argument of Array must only include Strings")}})}else if(obj.prototype instanceof PlattarObject){includes.push(`${this.type()}.${obj.type()}`)}else{throw new Error("PlattarObject."+this.type()+".include(...args) - argument must be of type PlattarObject or Array but was type="+typeof obj+" value="+obj)}});return includes}include(...args){this._query._include(args);return this}addParameter(key,value,type){this._query._addParameter(key,value,type);return this}}module.exports=PlattarObject},{"../../server/plattar-query.js":4,"./plattar-object-relations.js":13}],15:[function(require,module,exports){const PlattarBase=require("../interfaces/plattar-base.js");class ApplicationBuild extends PlattarBase{static type(){return"applicationbuild"}}module.exports=ApplicationBuild},{"../interfaces/plattar-base.js":12}],16:[function(require,module,exports){const PlattarBase=require("../interfaces/plattar-base.js");class AsyncJob extends PlattarBase{static type(){return"asyncjob"}set accessKey(code){this.addParameter("access_key",code,"update")}}module.exports=AsyncJob},{"../interfaces/plattar-base.js":12}],17:[function(require,module,exports){const PlattarBase=require("../interfaces/plattar-base.js");class ScriptEvent extends PlattarBase{static type(){return"scriptevent"}}module.exports=ScriptEvent},{"../interfaces/plattar-base.js":12}],18:[function(require,module,exports){const PlattarBase=require("../interfaces/plattar-base.js");class Tag extends PlattarBase{static type(){return"tag"}}module.exports=Tag},{"../interfaces/plattar-base.js":12}],19:[function(require,module,exports){const PlattarBase=require("../interfaces/plattar-base.js");const Server=require("../../server/plattar-server.js");class CardBase extends PlattarBase{constructor(id,server){super(id,server||Server.default());if(this.constructor===CardBase){throw new Error("CardBase is abstract and cannot be created")}}static type(){const CardButton=require("./card-button.js");const CardHTML=require("./card-html.js");const CardIFrame=require("./card-iframe.js");const CardImage=require("./card-image.js");const CardMap=require("./card-map.js");const CardParagraph=require("./card-paragraph.js");const CardRow=require("./card-row.js");const CardSlider=require("./card-slider.js");const CardTitle=require("./card-title.js");const CardVideo=require("./card-video.js");const CardYoutube=require("./card-youtube.js");return[CardButton,CardHTML,CardIFrame,CardImage,CardMap,CardParagraph,CardRow,CardSlider,CardTitle,CardVideo,CardYoutube]}}module.exports=CardBase},{"../../server/plattar-server.js":5,"../interfaces/plattar-base.js":12,"./card-button.js":20,"./card-html.js":21,"./card-iframe.js":22,"./card-image.js":23,"./card-map.js":24,"./card-paragraph.js":25,"./card-row.js":26,"./card-slider.js":27,"./card-title.js":28,"./card-video.js":29,"./card-youtube.js":30}],20:[function(require,module,exports){const CardBase=require("./card-base.js");class CardButton extends CardBase{static type(){return"cardbutton"}}module.exports=CardButton},{"./card-base.js":19}],21:[function(require,module,exports){const CardBase=require("./card-base.js");class CardHTML extends CardBase{static type(){return"cardhtml"}}module.exports=CardHTML},{"./card-base.js":19}],22:[function(require,module,exports){const CardBase=require("./card-base.js");class CardIFrame extends CardBase{static type(){return"cardiframe"}}module.exports=CardIFrame},{"./card-base.js":19}],23:[function(require,module,exports){const CardBase=require("./card-base.js");class CardImage extends CardBase{static type(){return"cardimage"}}module.exports=CardImage},{"./card-base.js":19}],24:[function(require,module,exports){const CardBase=require("./card-base.js");class CardMap extends CardBase{static type(){return"cardmap"}}module.exports=CardMap},{"./card-base.js":19}],25:[function(require,module,exports){const CardBase=require("./card-base.js");class CardParagraph extends CardBase{static type(){return"cardparagraph"}}module.exports=CardParagraph},{"./card-base.js":19}],26:[function(require,module,exports){const CardBase=require("./card-base.js");class CardRow extends CardBase{static type(){return"cardrow"}}module.exports=CardRow},{"./card-base.js":19}],27:[function(require,module,exports){const CardBase=require("./card-base.js");class CardSlider extends CardBase{static type(){return"cardslider"}}module.exports=CardSlider},{"./card-base.js":19}],28:[function(require,module,exports){const CardBase=require("./card-base.js");class CardTitle extends CardBase{static type(){return"cardtitle"}}module.exports=CardTitle},{"./card-base.js":19}],29:[function(require,module,exports){const CardBase=require("./card-base.js");class CardVideo extends CardBase{static type(){return"cardvideo"}}module.exports=CardVideo},{"./card-base.js":19}],30:[function(require,module,exports){const CardBase=require("./card-base.js");class CardYoutube extends CardBase{static type(){return"cardyoutube"}}module.exports=CardYoutube},{"./card-base.js":19}],31:[function(require,module,exports){const PlattarBase=require("../interfaces/plattar-base.js");class Page extends PlattarBase{static type(){return"page"}}module.exports=Page},{"../interfaces/plattar-base.js":12}],32:[function(require,module,exports){const ProductBase=require("./product-base.js");class ProductAnnotation extends ProductBase{static type(){return"productannotation"}}module.exports=ProductAnnotation},{"./product-base.js":33}],33:[function(require,module,exports){const PlattarBase=require("../interfaces/plattar-base.js");const Server=require("../../server/plattar-server.js");class ProductBase extends PlattarBase{constructor(id,server){super(id,server||Server.default());if(this.constructor===ProductBase){throw new Error("ProductBase is abstract and cannot be created")}}static type(){const ProductVariation=require("./product-variation.js");const ProductAnnotation=require("./product-annotation.js");return[ProductAnnotation,ProductVariation]}}module.exports=ProductBase},{"../../server/plattar-server.js":5,"../interfaces/plattar-base.js":12,"./product-annotation.js":32,"./product-variation.js":34}],34:[function(require,module,exports){const ProductBase=require("./product-base.js");class ProductVariation extends ProductBase{static type(){return"productvariation"}}module.exports=ProductVariation},{"./product-base.js":33}],35:[function(require,module,exports){const PlattarBase=require("../interfaces/plattar-base.js");class Product extends PlattarBase{static type(){return"product"}}module.exports=Product},{"../interfaces/plattar-base.js":12}],36:[function(require,module,exports){const SceneBase=require("./scene-base.js");class SceneAnnotation extends SceneBase{static type(){return"sceneannotation"}}module.exports=SceneAnnotation},{"./scene-base.js":38}],37:[function(require,module,exports){const SceneBase=require("./scene-base.js");class SceneAudio extends SceneBase{static type(){return"sceneaudio"}}module.exports=SceneAudio},{"./scene-base.js":38}],38:[function(require,module,exports){const PlattarBase=require("../interfaces/plattar-base.js");const Server=require("../../server/plattar-server.js");class SceneBase extends PlattarBase{constructor(id,server){super(id,server||Server.default());if(this.constructor===SceneBase){throw new Error("SceneBase is abstract and cannot be created")}}static type(){const SceneAnnotation=require("./scene-annotation.js");const SceneAudio=require("./scene-audio.js");const SceneButton=require("./scene-button.js");const SceneCamera=require("./scene-camera.js");const SceneCarousel=require("./scene-carousel.js");const SceneImage=require("./scene-image.js");const SceneModel=require("./scene-model.js");const ScenePanorama=require("./scene-panorama.js");const ScenePoller=require("./scene-poller.js");const SceneProduct=require("./scene-product.js");const SceneShadow=require("./scene-shadow.js");const SceneVideo=require("./scene-video.js");const SceneVolumetric=require("./scene-volumetric.js");const SceneYoutube=require("./scene-youtube.js");return[SceneAnnotation,SceneAudio,SceneButton,SceneCamera,SceneCarousel,SceneImage,SceneModel,ScenePanorama,ScenePoller,SceneProduct,SceneShadow,SceneVideo,SceneVolumetric,SceneYoutube]}}module.exports=SceneBase},{"../../server/plattar-server.js":5,"../interfaces/plattar-base.js":12,"./scene-annotation.js":36,"./scene-audio.js":37,"./scene-button.js":39,"./scene-camera.js":40,"./scene-carousel.js":41,"./scene-image.js":42,"./scene-model.js":43,"./scene-panorama.js":44,"./scene-poller.js":45,"./scene-product.js":46,"./scene-shadow.js":47,"./scene-video.js":48,"./scene-volumetric.js":49,"./scene-youtube.js":50}],39:[function(require,module,exports){const SceneBase=require("./scene-base.js");class SceneButton extends SceneBase{static type(){return"scenebutton"}}module.exports=SceneButton},{"./scene-base.js":38}],40:[function(require,module,exports){const SceneBase=require("./scene-base.js");class SceneCamera extends SceneBase{static type(){return"scenecamera"}}module.exports=SceneCamera},{"./scene-base.js":38}],41:[function(require,module,exports){const SceneBase=require("./scene-base.js");class SceneCarousel extends SceneBase{static type(){return"scenecarousel"}}module.exports=SceneCarousel},{"./scene-base.js":38}],42:[function(require,module,exports){const SceneBase=require("./scene-base.js");class SceneImage extends SceneBase{static type(){return"sceneimage"}}module.exports=SceneImage},{"./scene-base.js":38}],43:[function(require,module,exports){const SceneBase=require("./scene-base.js");class SceneModel extends SceneBase{static type(){return"scenemodel"}}module.exports=SceneModel},{"./scene-base.js":38}],44:[function(require,module,exports){const SceneBase=require("./scene-base.js");class ScenePanorama extends SceneBase{static type(){return"scenepanorama"}}module.exports=ScenePanorama},{"./scene-base.js":38}],45:[function(require,module,exports){const SceneBase=require("./scene-base.js");class ScenePoller extends SceneBase{static type(){return"scenepoller"}}module.exports=ScenePoller},{"./scene-base.js":38}],46:[function(require,module,exports){const SceneBase=require("./scene-base.js");class SceneProduct extends SceneBase{static type(){return"sceneproduct"}}module.exports=SceneProduct},{"./scene-base.js":38}],47:[function(require,module,exports){const SceneBase=require("./scene-base.js");class SceneShadow extends SceneBase{static type(){return"sceneshadow"}}module.exports=SceneShadow},{"./scene-base.js":38}],48:[function(require,module,exports){const SceneBase=require("./scene-base.js");class SceneVideo extends SceneBase{static type(){return"scenevideo"}}module.exports=SceneVideo},{"./scene-base.js":38}],49:[function(require,module,exports){const SceneBase=require("./scene-base.js");class SceneVolumetric extends SceneBase{static type(){return"scenevolumetric"}}module.exports=SceneVolumetric},{"./scene-base.js":38}],50:[function(require,module,exports){const SceneBase=require("./scene-base.js");class SceneYoutube extends SceneBase{static type(){return"sceneyoutube"}}module.exports=SceneYoutube},{"./scene-base.js":38}],51:[function(require,module,exports){const PlattarBase=require("../interfaces/plattar-base.js");class Scene extends PlattarBase{static type(){return"scene"}}module.exports=Scene},{"../interfaces/plattar-base.js":12}],52:[function(require,module,exports){const Application=require("../types/application.js");const Scene=require("../types/scene/scene.js");const SceneAnnotation=require("../types/scene/scene-annotation.js");const SceneAudio=require("../types/scene/scene-audio.js");const SceneButton=require("../types/scene/scene-button.js");const SceneCamera=require("../types/scene/scene-camera.js");const SceneCarousel=require("../types/scene/scene-carousel.js");const SceneImage=require("../types/scene/scene-image.js");const SceneModel=require("../types/scene/scene-model.js");const ScenePanorama=require("../types/scene/scene-panorama.js");const ScenePoller=require("../types/scene/scene-poller.js");const SceneProduct=require("../types/scene/scene-product.js");const SceneShadow=require("../types/scene/scene-shadow.js");const SceneVideo=require("../types/scene/scene-video.js");const SceneVolumetric=require("../types/scene/scene-volumetric.js");const SceneYoutube=require("../types/scene/scene-youtube.js");const Page=require("../types/page/page.js");const CardButton=require("../types/page/card-button.js");const CardHTML=require("../types/page/card-html.js");const CardIFrame=require("../types/page/card-iframe.js");const CardImage=require("../types/page/card-image.js");const CardMap=require("../types/page/card-map.js");const CardParagraph=require("../types/page/card-paragraph.js");const CardRow=require("../types/page/card-row.js");const CardSlider=require("../types/page/card-slider.js");const CardTitle=require("../types/page/card-title.js");const CardVideo=require("../types/page/card-video.js");const CardYoutube=require("../types/page/card-youtube.js");const Product=require("../types/product/product.js");const ProductVariation=require("../types/product/product-variation.js");const ProductAnnotation=require("../types/product/product-annotation.js");const FileAudio=require("../types/file/file-audio.js");const FileVideo=require("../types/file/file-video.js");const FileModel=require("../types/file/file-model.js");const FileImage=require("../types/file/file-image.js");const ScriptEvent=require("../types/misc/script-event.js");const Tag=require("../types/misc/tag.js");const ApplicationBuild=require("../types/misc/application-build.js");const AsyncJob=require("../types/misc/async-job.js");class PlattarUtil{}PlattarUtil.isPlattarObject=(obj=>{const PlattarObject=require("../types/interfaces/plattar-object.js");if(obj&&obj.prototype&&obj.prototype instanceof PlattarObject){return true}if(obj&&obj instanceof PlattarObject){return true}return false});PlattarUtil.reconstruct=((parent,json,options)=>{parent._attributes=json.data.attributes;if(options.cache===true){parent._cache()}const server=parent._query.server;if(json.data.relationships){for(const[key,value]of Object.entries(json.data.relationships)){const data=value.data;if(Array.isArray(data)){data.forEach(item=>{const construct=PlattarUtil.create(key,item.id,server);construct._attributes=item.attributes||{};parent.relationships._put(construct)})}else{const construct=PlattarUtil.create(key,data.id,server);construct._attributes=data.attributes||{};parent.relationships._put(construct)}}}if(json.included){json.included.forEach(item=>{const existing=parent.relationships.find(PlattarUtil.match(item.type),item.id);if(existing){PlattarUtil.reconstruct(existing,{data:item,included:json.included},options)}})}});PlattarUtil.create=((type,id,server)=>{const _DynamicClass=PlattarUtil.match(type);return new _DynamicClass(id,server)});PlattarUtil.match=(type=>{switch(type){case Application.type():return Application;case Scene.type():return Scene;case SceneAnnotation.type():return SceneAnnotation;case SceneAudio.type():return SceneAudio;case SceneButton.type():return SceneButton;case SceneCamera.type():return SceneCamera;case SceneCarousel.type():return SceneCarousel;case SceneImage.type():return SceneImage;case SceneModel.type():return SceneModel;case ScenePanorama.type():return ScenePanorama;case ScenePoller.type():return ScenePoller;case SceneProduct.type():return SceneProduct;case SceneShadow.type():return SceneShadow;case SceneVideo.type():return SceneVideo;case SceneVolumetric.type():return SceneVolumetric;case SceneYoutube.type():return SceneYoutube;case Page.type():return Page;case CardButton.type():return CardButton;case CardHTML.type():return CardHTML;case CardIFrame.type():return CardIFrame;case Product.type():return Product;case ProductVariation.type():return ProductVariation;case ProductAnnotation.type():return ProductAnnotation;case FileAudio.type():return FileAudio;case FileVideo.type():return FileVideo;case FileModel.type():return FileModel;case FileImage.type():return FileImage;case CardMap.type():return CardMap;case CardParagraph.type():return CardParagraph;case CardRow.type():return CardRow;case CardSlider.type():return CardSlider;case CardTitle.type():return CardTitle;case CardVideo.type():return CardVideo;case CardYoutube.type():return CardYoutube;case CardImage.type():return CardImage;case ScriptEvent.type():return ScriptEvent;case Tag.type():return Tag;case ApplicationBuild.type():return ApplicationBuild;case AsyncJob.type():return AsyncJob;default:throw new Error('PlattarUtil.match(type) - provided type of "'+type+'" does not exist and cannot be created')}});module.exports=PlattarUtil},{"../types/application.js":6,"../types/file/file-audio.js":7,"../types/file/file-image.js":9,"../types/file/file-model.js":10,"../types/file/file-video.js":11,"../types/interfaces/plattar-object.js":14,"../types/misc/application-build.js":15,"../types/misc/async-job.js":16,"../types/misc/script-event.js":17,"../types/misc/tag.js":18,"../types/page/card-button.js":20,"../types/page/card-html.js":21,"../types/page/card-iframe.js":22,"../types/page/card-image.js":23,"../types/page/card-map.js":24,"../types/page/card-paragraph.js":25,"../types/page/card-row.js":26,"../types/page/card-slider.js":27,"../types/page/card-title.js":28,"../types/page/card-video.js":29,"../types/page/card-youtube.js":30,"../types/page/page.js":31,"../types/product/product-annotation.js":32,"../types/product/product-variation.js":34,"../types/product/product.js":35,"../types/scene/scene-annotation.js":36,"../types/scene/scene-audio.js":37,"../types/scene/scene-button.js":39,"../types/scene/scene-camera.js":40,"../types/scene/scene-carousel.js":41,"../types/scene/scene-image.js":42,"../types/scene/scene-model.js":43,"../types/scene/scene-panorama.js":44,"../types/scene/scene-poller.js":45,"../types/scene/scene-product.js":46,"../types/scene/scene-shadow.js":47,"../types/scene/scene-video.js":48,"../types/scene/scene-volumetric.js":49,"../types/scene/scene-youtube.js":50,"../types/scene/scene.js":51}]},{},[1])(1)});
(function(f){if(typeof exports==="object"&&typeof module!=="undefined"){module.exports=f()}else if(typeof define==="function"&&define.amd){define([],f)}else{var g;if(typeof window!=="undefined"){g=window}else if(typeof global!=="undefined"){g=global}else if(typeof self!=="undefined"){g=self}else{g=this}g.Plattar=f()}})(function(){var define,module,exports;return function(){function r(e,n,t){function o(i,f){if(!n[i]){if(!e[i]){var c="function"==typeof require&&require;if(!f&&c)return c(i,!0);if(u)return u(i,!0);var a=new Error("Cannot find module '"+i+"'");throw a.code="MODULE_NOT_FOUND",a}var p=n[i]={exports:{}};e[i][0].call(p.exports,function(r){var n=e[i][1][r];return o(n||r)},p,p.exports,r,e,n,t)}return n[i].exports}for(var u="function"==typeof require&&require,i=0;i<t.length;i++)o(t[i]);return o}return r}()({1:[function(require,module,exports){"use strict";const Server=require("./server/plattar-server.js");const Util=require("./util/plattar-util.js");const Project=require("./types/application.js");const Scene=require("./types/scene/scene.js");const SceneAnnotation=require("./types/scene/scene-annotation.js");const SceneAudio=require("./types/scene/scene-audio.js");const SceneButton=require("./types/scene/scene-button.js");const SceneCamera=require("./types/scene/scene-camera.js");const SceneCarousel=require("./types/scene/scene-carousel.js");const SceneImage=require("./types/scene/scene-image.js");const SceneModel=require("./types/scene/scene-model.js");const ScenePanorama=require("./types/scene/scene-panorama.js");const ScenePoller=require("./types/scene/scene-poller.js");const SceneProduct=require("./types/scene/scene-product.js");const SceneShadow=require("./types/scene/scene-shadow.js");const SceneVideo=require("./types/scene/scene-video.js");const SceneVolumetric=require("./types/scene/scene-volumetric.js");const SceneYoutube=require("./types/scene/scene-youtube.js");const Page=require("./types/page/page.js");const CardButton=require("./types/page/card-button.js");const CardHTML=require("./types/page/card-html.js");const CardIFrame=require("./types/page/card-iframe.js");const CardImage=require("./types/page/card-image.js");const CardMap=require("./types/page/card-map.js");const CardParagraph=require("./types/page/card-paragraph.js");const CardRow=require("./types/page/card-row.js");const CardSlider=require("./types/page/card-slider.js");const CardTitle=require("./types/page/card-title.js");const CardVideo=require("./types/page/card-video.js");const CardYoutube=require("./types/page/card-youtube.js");const Product=require("./types/product/product.js");const ProductVariation=require("./types/product/product-variation.js");const ProductAnnotation=require("./types/product/product-annotation.js");const FileAudio=require("./types/file/file-audio.js");const FileVideo=require("./types/file/file-video.js");const FileModel=require("./types/file/file-model.js");const FileImage=require("./types/file/file-image.js");const ScriptEvent=require("./types/misc/script-event.js");const Tag=require("./types/misc/tag.js");const ApplicationBuild=require("./types/misc/application-build.js");const AsyncJob=require("./types/misc/async-job.js");const SceneObject=require("./types/scene/scene-base.js");const CardObject=require("./types/page/card-base.js");const ProductObject=require("./types/product/product-base.js");const FileObject=require("./types/file/file-base.js");Server.create();module.exports={Server:Server,Util:Util,Project:Project,Scene:Scene,SceneAnnotation:SceneAnnotation,SceneAudio:SceneAudio,SceneButton:SceneButton,SceneCamera:SceneCamera,SceneCarousel:SceneCarousel,SceneImage:SceneImage,SceneModel:SceneModel,ScenePanorama:ScenePanorama,ScenePoller:ScenePoller,SceneProduct:SceneProduct,SceneShadow:SceneShadow,SceneVideo:SceneVideo,SceneVolumetric:SceneVolumetric,SceneYoutube:SceneYoutube,Page:Page,CardButton:CardButton,CardHTML:CardHTML,CardIFrame:CardIFrame,CardImage:CardImage,CardMap:CardMap,CardParagraph:CardParagraph,CardRow:CardRow,CardSlider:CardSlider,CardTitle:CardTitle,CardVideo:CardVideo,CardYoutube:CardYoutube,Product:Product,ProductVariation:ProductVariation,ProductAnnotation:ProductAnnotation,FileAudio:FileAudio,FileVideo:FileVideo,FileModel:FileModel,FileImage:FileImage,FileObject:FileObject,ScriptEvent:ScriptEvent,Tag:Tag,ApplicationBuild:ApplicationBuild,AsyncJob:AsyncJob,SceneObject:SceneObject,CardObject:CardObject,ProductObject:ProductObject}},{"./server/plattar-server.js":5,"./types/application.js":6,"./types/file/file-audio.js":7,"./types/file/file-base.js":8,"./types/file/file-image.js":9,"./types/file/file-model.js":10,"./types/file/file-video.js":11,"./types/misc/application-build.js":15,"./types/misc/async-job.js":16,"./types/misc/script-event.js":17,"./types/misc/tag.js":18,"./types/page/card-base.js":19,"./types/page/card-button.js":20,"./types/page/card-html.js":21,"./types/page/card-iframe.js":22,"./types/page/card-image.js":23,"./types/page/card-map.js":24,"./types/page/card-paragraph.js":25,"./types/page/card-row.js":26,"./types/page/card-slider.js":27,"./types/page/card-title.js":28,"./types/page/card-video.js":29,"./types/page/card-youtube.js":30,"./types/page/page.js":31,"./types/product/product-annotation.js":32,"./types/product/product-base.js":33,"./types/product/product-variation.js":34,"./types/product/product.js":35,"./types/scene/scene-annotation.js":36,"./types/scene/scene-audio.js":37,"./types/scene/scene-base.js":38,"./types/scene/scene-button.js":39,"./types/scene/scene-camera.js":40,"./types/scene/scene-carousel.js":41,"./types/scene/scene-image.js":42,"./types/scene/scene-model.js":43,"./types/scene/scene-panorama.js":44,"./types/scene/scene-poller.js":45,"./types/scene/scene-product.js":46,"./types/scene/scene-shadow.js":47,"./types/scene/scene-video.js":48,"./types/scene/scene-volumetric.js":49,"./types/scene/scene-youtube.js":50,"./types/scene/scene.js":51,"./util/plattar-util.js":52}],2:[function(require,module,exports){(function(global){(function(){"use strict";var getGlobal=function(){if(typeof self!=="undefined"){return self}if(typeof window!=="undefined"){return window}if(typeof global!=="undefined"){return global}throw new Error("unable to locate global object")};var global=getGlobal();module.exports=exports=global.fetch;if(global.fetch){exports.default=global.fetch.bind(global)}exports.Headers=global.Headers;exports.Request=global.Request;exports.Response=global.Response}).call(this)}).call(this,typeof global!=="undefined"?global:typeof self!=="undefined"?self:typeof window!=="undefined"?window:{})},{}],3:[function(require,module,exports){var process=module.exports={};var cachedSetTimeout;var cachedClearTimeout;function defaultSetTimout(){throw new Error("setTimeout has not been defined")}function defaultClearTimeout(){throw new Error("clearTimeout has not been defined")}(function(){try{if(typeof setTimeout==="function"){cachedSetTimeout=setTimeout}else{cachedSetTimeout=defaultSetTimout}}catch(e){cachedSetTimeout=defaultSetTimout}try{if(typeof clearTimeout==="function"){cachedClearTimeout=clearTimeout}else{cachedClearTimeout=defaultClearTimeout}}catch(e){cachedClearTimeout=defaultClearTimeout}})();function runTimeout(fun){if(cachedSetTimeout===setTimeout){return setTimeout(fun,0)}if((cachedSetTimeout===defaultSetTimout||!cachedSetTimeout)&&setTimeout){cachedSetTimeout=setTimeout;return setTimeout(fun,0)}try{return cachedSetTimeout(fun,0)}catch(e){try{return cachedSetTimeout.call(null,fun,0)}catch(e){return cachedSetTimeout.call(this,fun,0)}}}function runClearTimeout(marker){if(cachedClearTimeout===clearTimeout){return clearTimeout(marker)}if((cachedClearTimeout===defaultClearTimeout||!cachedClearTimeout)&&clearTimeout){cachedClearTimeout=clearTimeout;return clearTimeout(marker)}try{return cachedClearTimeout(marker)}catch(e){try{return cachedClearTimeout.call(null,marker)}catch(e){return cachedClearTimeout.call(this,marker)}}}var queue=[];var draining=false;var currentQueue;var queueIndex=-1;function cleanUpNextTick(){if(!draining||!currentQueue){return}draining=false;if(currentQueue.length){queue=currentQueue.concat(queue)}else{queueIndex=-1}if(queue.length){drainQueue()}}function drainQueue(){if(draining){return}var timeout=runTimeout(cleanUpNextTick);draining=true;var len=queue.length;while(len){currentQueue=queue;queue=[];while(++queueIndex<len){if(currentQueue){currentQueue[queueIndex].run()}}queueIndex=-1;len=queue.length}currentQueue=null;draining=false;runClearTimeout(timeout)}process.nextTick=function(fun){var args=new Array(arguments.length-1);if(arguments.length>1){for(var i=1;i<arguments.length;i++){args[i-1]=arguments[i]}}queue.push(new Item(fun,args));if(queue.length===1&&!draining){runTimeout(drainQueue)}};function Item(fun,array){this.fun=fun;this.array=array}Item.prototype.run=function(){this.fun.apply(null,this.array)};process.title="browser";process.browser=true;process.env={};process.argv=[];process.version="";process.versions={};function noop(){}process.on=noop;process.addListener=noop;process.once=noop;process.off=noop;process.removeListener=noop;process.removeAllListeners=noop;process.emit=noop;process.prependListener=noop;process.prependOnceListener=noop;process.listeners=function(name){return[]};process.binding=function(name){throw new Error("process.binding is not supported")};process.cwd=function(){return"/"};process.chdir=function(dir){throw new Error("process.chdir is not supported")};process.umask=function(){return 0}},{}],4:[function(require,module,exports){const fetch=require("node-fetch");class PlattarQuery{constructor(target,server){if(!target){throw new Error("PlattarQuery cannot be created as target object cannot be null")}if(!server){throw new Error("PlattarQuery cannot be created as server object cannot be null")}this._target=target;this._server=server;this._params=[];this._getIncludeQuery=[]}get target(){return this._target}get server(){return this._server}_get(opt){return new Promise((resolve,reject)=>{const target=this.target;const server=this.server;if(!target.id){reject(new Error("PlattarQuery."+target.type()+".get() - object id is missing"));return}const options=opt||{cache:true};if(options.cache===true){const cached=PlattarQuery._GetGlobalCachedObject(target);if(cached){resolve(cached);return}}const origin=server.originLocation.api_read;const auth=server.authToken;const reqopts={method:"GET",headers:auth};const includeQuery=this._IncludeQuery;const params=this._ParamFor("get");let endpoint=origin+target.type()+"/"+target.id;if(includeQuery){endpoint=endpoint+"?include="+includeQuery}if(params){let appender=includeQuery?"&":"?";params.forEach(param=>{endpoint=endpoint+appender+param.key+"="+param.value;appender="&"})}fetch(endpoint,reqopts).then(res=>{if(res.ok){try{return res.json()}catch(err){return new Error("PlattarQuery."+target.type()+".get("+target.id+") - critical error occured, cannot proceed")}}return new Error("PlattarQuery."+target.type()+".get("+target.id+") - unexpected error occured, cannot proceed. error message is "+res.statusText)}).then(json=>{if(json instanceof Error){reject(json)}else{const PlattarUtil=require("../util/plattar-util.js");PlattarUtil.reconstruct(target,json,options);resolve(target)}})})}_update(){return new Promise((resolve,reject)=>{const target=this.target;const server=this.server;if(!target.id){reject(new Error("PlattarQuery."+target.type()+".update() - object id is missing"));return}const origin=server.originLocation.api_write;const auth=server.authToken;const headers={Accept:"application/json","Content-Type":"application/json"};Object.assign(headers,auth);const reqopts={method:"PATCH",headers:headers,body:JSON.stringify({data:{id:target.id,attributes:target.attributes},meta:target.meta||{}})};const params=this._ParamFor("update");let endpoint=origin+target.type()+"/"+target.id;if(params){let appender="?";params.forEach(param=>{endpoint=endpoint+appender+param.key+"="+param.value;appender="&"})}fetch(endpoint,reqopts).then(res=>{if(res.ok){try{return res.json()}catch(err){return new Error("PlattarQuery."+target.type()+".update("+target.id+") - critical error occured, cannot proceed")}}return new Error("PlattarQuery."+target.type()+".update("+target.id+") - unexpected error occured, cannot proceed. error message is "+res.statusText)}).then(json=>{if(json instanceof Error){reject(json)}else{const PlattarUtil=require("../util/plattar-util.js");PlattarUtil.reconstruct(target,json,{cache:true});resolve(target)}})})}_create(){return new Promise((resolve,reject)=>{reject(new Error("PlattarQuery."+this.target.type()+".create() - not implemented"))})}_delete(){return new Promise((resolve,reject)=>{reject(new Error("PlattarQuery."+this.target.type()+".delete("+this.target.id+") - not implemented"))})}_addParameter(key,value,type){type=type||"all";this._params.push({key:key,value:value,type:type.toLowerCase()})}_include(args){if(!args||args.length<=0){return this}const PlattarUtil=require("../util/plattar-util.js");args.forEach(obj=>{if(Array.isArray(obj)){obj.forEach(strObject=>{if(typeof strObject==="string"||strObject instanceof String){this._getIncludeQuery.push(strObject)}else{throw new Error("PlattarQuery."+this.target.type()+".include(...args) - argument of Array must only include Strings")}})}else if(PlattarUtil.isPlattarObject(obj)){const type=obj.type();if(Array.isArray(type)){this._include(type)}else{this._getIncludeQuery.push(type)}}else{throw new Error("PlattarQuery."+this.target.type()+".include(...args) - argument must be of type PlattarObject or Array but was type="+typeof obj+" value="+obj)}});return this}_ParamFor(type){type=type||"all";const list=this._params.filter(objcheck=>{return objcheck.type===type||objcheck.type==="all"});if(list.length>0){return list}return undefined}get _IncludeQuery(){if(this._getIncludeQuery.length<=0){return undefined}return`${this._getIncludeQuery.map(item=>`${item}`).join(",")}`}}PlattarQuery._GlobalObjectCache={};PlattarQuery._InvalidateGlobalCache=(()=>{PlattarQuery._GlobalObjectCache={}});PlattarQuery._HasGlobalCachedObject=(obj=>{return PlattarQuery._GlobalObjectCache.hasOwnProperty(obj.id)});PlattarQuery._GetGlobalCachedObject=(obj=>{return PlattarQuery._HasGlobalCachedObject(obj)?PlattarQuery._GlobalObjectCache[obj.id]:undefined});PlattarQuery._SetGlobalCachedObject=(obj=>{});PlattarQuery._DeleteGlobalCachedObject=(obj=>{if(PlattarQuery._HasGlobalCachedObject(obj)){delete PlattarQuery._GlobalObjectCache[obj.id]}});module.exports=PlattarQuery},{"../util/plattar-util.js":52,"node-fetch":2}],5:[function(require,module,exports){(function(process){(function(){const fetch=require("node-fetch");class PlattarServer{constructor(){this._authToken={};this._serverLocation=this.prod}get prod(){return PlattarServer.match("prod")}get isProd(){return this._serverLocation.type==="prod"}get staging(){return PlattarServer.match("staging")}get isStaging(){return this._serverLocation.type==="staging"}get dev(){return PlattarServer.match("dev")}get isDev(){return this._serverLocation.type==="dev"}get authToken(){return this._authToken}get originLocation(){return this._serverLocation}auth(token,opt){const copt=opt||{validate:false};return new Promise((resolve,reject)=>{const server=this.originLocation.api_write;if(!server){reject(new Error("Plattar.auth(token) - cannot authenticate as server not set via Plattar.origin(server)"));return}if(!token){reject(new Error("Plattar.auth(token) - token variable is undefined"));return}if(!copt.validate){this._authToken={"plattar-auth-token":token};resolve(this);return}const endpoint=server+"plattaruser/xauth/validate";const options={method:"GET",headers:{"plattar-auth-token":token}};fetch(endpoint,options).then(res=>{if(res.ok){this._authToken={"plattar-auth-token":token};resolve(this)}else{reject(new Error("Plattar.auth(token) - failed to validate authentication token at "+endpoint))}})})}origin(server,opt){const copt=opt||{validate:false};return new Promise((resolve,reject)=>{if(!server){reject(new Error("Plattar.origin(server) - server variable is undefined"));return}if(!copt.validate){this._serverLocation=server;resolve(this);return}const endpoint=server.api_read+"ping";const options={method:"GET"};fetch(endpoint,options).then(res=>{if(res.ok){this._serverLocation=server;resolve(this)}else{reject(new Error("Plattar.origin(server) - failed to ping server at "+endpoint))}})})}}PlattarServer.match=(serverName=>{switch(serverName.toLowerCase()){case"staging.plattar.space":case"cdn-staging.plattar.space":case"staging":return{base:"https://staging.plattar.space/",api_read:"https://staging.plattar.space/api/v2/",api_write:"https://cms.plattar.space/api/v2/",cdn:"https://cdn-staging.plattar.space/",cdn_image:"http://plattar-staging.s3-website-ap-southeast-2.amazonaws.com/",analytics:"https://c.plattar.space/api/v2/analytics",type:"staging"};case"app.plattar.com":case"cdn.plattar.com":case"prod":case"production":return{base:"https://app.plattar.com/",api_read:"https://app.plattar.com/api/v2/",api_write:"https://cms.plattar.com/api/v2/",cdn:"https://cdn.plattar.com/",cdn_image:"http://plattar-production.s3-website-ap-southeast-2.amazonaws.com/",analytics:"https://c.plattar.space/api/v2/analytics",type:"prod"};case"dev":case"developer":case"development":case"local":case"localhost":default:return{base:"https://localhost/",api_read:"https://localhost/api/v2/",api_write:"https://localhost/api/v2/",cdn:"https://cdn-dev.plattar.space/",cdn_image:"http://plattar-dev.s3-website-ap-southeast-2.amazonaws.com/",analytics:"https://localhost:3000/api/v2/analytics/",type:"dev"}}});PlattarServer.create=((origin,auth)=>{const newServer=new PlattarServer;if(origin){newServer.origin(origin)}if(auth){newServer.auth(auth)}PlattarServer._default=newServer;return newServer});PlattarServer.disableTLS=(()=>{process.env.NODE_TLS_REJECT_UNAUTHORIZED="0"});PlattarServer.default=(()=>{return PlattarServer._default});PlattarServer.location=(()=>{return PlattarServer.default().originLocation});module.exports=PlattarServer}).call(this)}).call(this,require("_process"))},{_process:3,"node-fetch":2}],6:[function(require,module,exports){const PlattarBase=require("./interfaces/plattar-base.js");class Application extends PlattarBase{static type(){return"application"}}module.exports=Application},{"./interfaces/plattar-base.js":12}],7:[function(require,module,exports){const FileBase=require("./file-base.js");class FileAudio extends FileBase{static type(){return"fileaudio"}}module.exports=FileAudio},{"./file-base.js":8}],8:[function(require,module,exports){const PlattarBase=require("../interfaces/plattar-base.js");const Server=require("../../server/plattar-server.js");class FileBase extends PlattarBase{constructor(id,server){super(id,server||Server.default());if(this.constructor===FileBase){throw new Error("FileBase is abstract and cannot be created")}}static type(){const FileAudio=require("./file-audio.js");const FileVideo=require("./file-video.js");const FileModel=require("./file-model.js");const FileImage=require("./file-image.js");return[FileAudio,FileVideo,FileModel,FileImage]}get sourcePath(){if(!this.attributes.path){return null}return this.path+this.attributes.original_filename}get backupPath(){if(!this.attributes.path){return null}return this.path+this.attributes.original_upload}get path(){if(!this.attributes.path){return null}return this._query.server.originLocation.cdn+this.attributes.path}}module.exports=FileBase},{"../../server/plattar-server.js":5,"../interfaces/plattar-base.js":12,"./file-audio.js":7,"./file-image.js":9,"./file-model.js":10,"./file-video.js":11}],9:[function(require,module,exports){const FileBase=require("./file-base.js");class FileImage extends FileBase{static type(){return"fileimage"}}module.exports=FileImage},{"./file-base.js":8}],10:[function(require,module,exports){const FileBase=require("./file-base.js");class FileModel extends FileBase{static type(){return"filemodel"}}module.exports=FileModel},{"./file-base.js":8}],11:[function(require,module,exports){const FileBase=require("./file-base.js");class FileVideo extends FileBase{static type(){return"filevideo"}}module.exports=FileVideo},{"./file-base.js":8}],12:[function(require,module,exports){const PlattarObject=require("./plattar-object.js");const Server=require("../../server/plattar-server.js");class PlattarBase extends PlattarObject{constructor(id,server){super(id,server||Server.default());if(this.constructor===PlattarBase){throw new Error("PlattarBase is abstract and cannot be created")}}}module.exports=PlattarBase},{"../../server/plattar-server.js":5,"./plattar-object.js":14}],13:[function(require,module,exports){class PlattarObjectRelations{constructor(parent){this._parent=parent;this._relatedObjects={}}get parent(){return this._parent}_put(obj){if(!obj){return this}const PlattarUtil=require("../../util/plattar-util.js");if(!PlattarUtil.isPlattarObject(obj)){throw new Error("PlattarObjectRelations._put(PlattarObject) - argument must be type of PlattarObject")}if(!this._relatedObjects.hasOwnProperty(obj.type())){this._relatedObjects[obj.type()]=[]}this._relatedObjects[obj.type()].push(obj)}filter(obj,id){if(!obj){return[]}const PlattarUtil=require("../../util/plattar-util.js");if(!PlattarUtil.isPlattarObject(obj)){throw new Error("PlattarObjectRelations.filter(PlattarObject) - argument must be type of PlattarObject")}const type=obj.type();if(Array.isArray(type)){var compiledList=[];type.forEach(inObject=>{const retArray=this.filter(inObject,id);if(retArray.length>0){compiledList=compiledList.concat(retArray)}});return compiledList}if(!this._relatedObjects.hasOwnProperty(type)){return[]}const list=this._relatedObjects[type];if(!id){return list}return list.filter(objcheck=>{return objcheck.id===id})}find(obj,id){const list=this.filter(obj,id);if(list.length<=0){return undefined}return list[0]}}module.exports=PlattarObjectRelations},{"../../util/plattar-util.js":52}],14:[function(require,module,exports){const PlattarQuery=require("../../server/plattar-query.js");const PlattarObjectRelations=require("./plattar-object-relations.js");class PlattarObject{constructor(id,server){if(this.constructor===PlattarObject){throw new Error("PlattarObject is abstract and cannot be created")}this._id=id;this._attributes={};this._meta={};this._query=new PlattarQuery(this,server);this._relationships=new PlattarObjectRelations(this)}invalidate(){return PlattarQuery._DeleteGlobalCachedObject(this)}_cache(){return PlattarQuery._SetGlobalCachedObject(this)}get id(){return this._id}get attributes(){return this._attributes}get meta(){return this._meta}set overrideAttributes(attributes){this._attributes=Object.assign({},attributes)}get relationships(){return this._relationships}get(opt){return this._query._get(opt)}update(){return this._query._update()}create(){return this._query._create()}delete(){return this._query._delete()}static type(){throw new Error("PlattarObject.type() - not implemented")}type(){return this.constructor.type()}static include(...args){if(!args||args.length<=0){return[]}const includes=[this.type()];args.forEach(obj=>{if(Array.isArray(obj)){obj.forEach(strObject=>{if(typeof strObject==="string"||strObject instanceof String){includes.push(`${this.type()}.${strObject}`)}else{throw new Error("PlattarObject."+this.type()+".include(...args) - argument of Array must only include Strings")}})}else if(obj.prototype instanceof PlattarObject){includes.push(`${this.type()}.${obj.type()}`)}else{throw new Error("PlattarObject."+this.type()+".include(...args) - argument must be of type PlattarObject or Array but was type="+typeof obj+" value="+obj)}});return includes}include(...args){this._query._include(args);return this}addParameter(key,value,type){this._query._addParameter(key,value,type);return this}}module.exports=PlattarObject},{"../../server/plattar-query.js":4,"./plattar-object-relations.js":13}],15:[function(require,module,exports){const PlattarBase=require("../interfaces/plattar-base.js");class ApplicationBuild extends PlattarBase{static type(){return"applicationbuild"}}module.exports=ApplicationBuild},{"../interfaces/plattar-base.js":12}],16:[function(require,module,exports){const PlattarBase=require("../interfaces/plattar-base.js");class AsyncJob extends PlattarBase{static type(){return"asyncjob"}set accessKey(code){this.addParameter("access_key",code,"update")}}module.exports=AsyncJob},{"../interfaces/plattar-base.js":12}],17:[function(require,module,exports){const PlattarBase=require("../interfaces/plattar-base.js");class ScriptEvent extends PlattarBase{static type(){return"scriptevent"}}module.exports=ScriptEvent},{"../interfaces/plattar-base.js":12}],18:[function(require,module,exports){const PlattarBase=require("../interfaces/plattar-base.js");class Tag extends PlattarBase{static type(){return"tag"}}module.exports=Tag},{"../interfaces/plattar-base.js":12}],19:[function(require,module,exports){const PlattarBase=require("../interfaces/plattar-base.js");const Server=require("../../server/plattar-server.js");class CardBase extends PlattarBase{constructor(id,server){super(id,server||Server.default());if(this.constructor===CardBase){throw new Error("CardBase is abstract and cannot be created")}}static type(){const CardButton=require("./card-button.js");const CardHTML=require("./card-html.js");const CardIFrame=require("./card-iframe.js");const CardImage=require("./card-image.js");const CardMap=require("./card-map.js");const CardParagraph=require("./card-paragraph.js");const CardRow=require("./card-row.js");const CardSlider=require("./card-slider.js");const CardTitle=require("./card-title.js");const CardVideo=require("./card-video.js");const CardYoutube=require("./card-youtube.js");return[CardButton,CardHTML,CardIFrame,CardImage,CardMap,CardParagraph,CardRow,CardSlider,CardTitle,CardVideo,CardYoutube]}}module.exports=CardBase},{"../../server/plattar-server.js":5,"../interfaces/plattar-base.js":12,"./card-button.js":20,"./card-html.js":21,"./card-iframe.js":22,"./card-image.js":23,"./card-map.js":24,"./card-paragraph.js":25,"./card-row.js":26,"./card-slider.js":27,"./card-title.js":28,"./card-video.js":29,"./card-youtube.js":30}],20:[function(require,module,exports){const CardBase=require("./card-base.js");class CardButton extends CardBase{static type(){return"cardbutton"}}module.exports=CardButton},{"./card-base.js":19}],21:[function(require,module,exports){const CardBase=require("./card-base.js");class CardHTML extends CardBase{static type(){return"cardhtml"}}module.exports=CardHTML},{"./card-base.js":19}],22:[function(require,module,exports){const CardBase=require("./card-base.js");class CardIFrame extends CardBase{static type(){return"cardiframe"}}module.exports=CardIFrame},{"./card-base.js":19}],23:[function(require,module,exports){const CardBase=require("./card-base.js");class CardImage extends CardBase{static type(){return"cardimage"}}module.exports=CardImage},{"./card-base.js":19}],24:[function(require,module,exports){const CardBase=require("./card-base.js");class CardMap extends CardBase{static type(){return"cardmap"}}module.exports=CardMap},{"./card-base.js":19}],25:[function(require,module,exports){const CardBase=require("./card-base.js");class CardParagraph extends CardBase{static type(){return"cardparagraph"}}module.exports=CardParagraph},{"./card-base.js":19}],26:[function(require,module,exports){const CardBase=require("./card-base.js");class CardRow extends CardBase{static type(){return"cardrow"}}module.exports=CardRow},{"./card-base.js":19}],27:[function(require,module,exports){const CardBase=require("./card-base.js");class CardSlider extends CardBase{static type(){return"cardslider"}}module.exports=CardSlider},{"./card-base.js":19}],28:[function(require,module,exports){const CardBase=require("./card-base.js");class CardTitle extends CardBase{static type(){return"cardtitle"}}module.exports=CardTitle},{"./card-base.js":19}],29:[function(require,module,exports){const CardBase=require("./card-base.js");class CardVideo extends CardBase{static type(){return"cardvideo"}}module.exports=CardVideo},{"./card-base.js":19}],30:[function(require,module,exports){const CardBase=require("./card-base.js");class CardYoutube extends CardBase{static type(){return"cardyoutube"}}module.exports=CardYoutube},{"./card-base.js":19}],31:[function(require,module,exports){const PlattarBase=require("../interfaces/plattar-base.js");class Page extends PlattarBase{static type(){return"page"}}module.exports=Page},{"../interfaces/plattar-base.js":12}],32:[function(require,module,exports){const ProductBase=require("./product-base.js");class ProductAnnotation extends ProductBase{static type(){return"productannotation"}}module.exports=ProductAnnotation},{"./product-base.js":33}],33:[function(require,module,exports){const PlattarBase=require("../interfaces/plattar-base.js");const Server=require("../../server/plattar-server.js");class ProductBase extends PlattarBase{constructor(id,server){super(id,server||Server.default());if(this.constructor===ProductBase){throw new Error("ProductBase is abstract and cannot be created")}}static type(){const ProductVariation=require("./product-variation.js");const ProductAnnotation=require("./product-annotation.js");return[ProductAnnotation,ProductVariation]}}module.exports=ProductBase},{"../../server/plattar-server.js":5,"../interfaces/plattar-base.js":12,"./product-annotation.js":32,"./product-variation.js":34}],34:[function(require,module,exports){const ProductBase=require("./product-base.js");class ProductVariation extends ProductBase{static type(){return"productvariation"}}module.exports=ProductVariation},{"./product-base.js":33}],35:[function(require,module,exports){const PlattarBase=require("../interfaces/plattar-base.js");class Product extends PlattarBase{static type(){return"product"}}module.exports=Product},{"../interfaces/plattar-base.js":12}],36:[function(require,module,exports){const SceneBase=require("./scene-base.js");class SceneAnnotation extends SceneBase{static type(){return"sceneannotation"}}module.exports=SceneAnnotation},{"./scene-base.js":38}],37:[function(require,module,exports){const SceneBase=require("./scene-base.js");class SceneAudio extends SceneBase{static type(){return"sceneaudio"}}module.exports=SceneAudio},{"./scene-base.js":38}],38:[function(require,module,exports){const PlattarBase=require("../interfaces/plattar-base.js");const Server=require("../../server/plattar-server.js");class SceneBase extends PlattarBase{constructor(id,server){super(id,server||Server.default());if(this.constructor===SceneBase){throw new Error("SceneBase is abstract and cannot be created")}}static type(){const SceneAnnotation=require("./scene-annotation.js");const SceneAudio=require("./scene-audio.js");const SceneButton=require("./scene-button.js");const SceneCamera=require("./scene-camera.js");const SceneCarousel=require("./scene-carousel.js");const SceneImage=require("./scene-image.js");const SceneModel=require("./scene-model.js");const ScenePanorama=require("./scene-panorama.js");const ScenePoller=require("./scene-poller.js");const SceneProduct=require("./scene-product.js");const SceneShadow=require("./scene-shadow.js");const SceneVideo=require("./scene-video.js");const SceneVolumetric=require("./scene-volumetric.js");const SceneYoutube=require("./scene-youtube.js");return[SceneAnnotation,SceneAudio,SceneButton,SceneCamera,SceneCarousel,SceneImage,SceneModel,ScenePanorama,ScenePoller,SceneProduct,SceneShadow,SceneVideo,SceneVolumetric,SceneYoutube]}}module.exports=SceneBase},{"../../server/plattar-server.js":5,"../interfaces/plattar-base.js":12,"./scene-annotation.js":36,"./scene-audio.js":37,"./scene-button.js":39,"./scene-camera.js":40,"./scene-carousel.js":41,"./scene-image.js":42,"./scene-model.js":43,"./scene-panorama.js":44,"./scene-poller.js":45,"./scene-product.js":46,"./scene-shadow.js":47,"./scene-video.js":48,"./scene-volumetric.js":49,"./scene-youtube.js":50}],39:[function(require,module,exports){const SceneBase=require("./scene-base.js");class SceneButton extends SceneBase{static type(){return"scenebutton"}}module.exports=SceneButton},{"./scene-base.js":38}],40:[function(require,module,exports){const SceneBase=require("./scene-base.js");class SceneCamera extends SceneBase{static type(){return"scenecamera"}}module.exports=SceneCamera},{"./scene-base.js":38}],41:[function(require,module,exports){const SceneBase=require("./scene-base.js");class SceneCarousel extends SceneBase{static type(){return"scenecarousel"}}module.exports=SceneCarousel},{"./scene-base.js":38}],42:[function(require,module,exports){const SceneBase=require("./scene-base.js");class SceneImage extends SceneBase{static type(){return"sceneimage"}}module.exports=SceneImage},{"./scene-base.js":38}],43:[function(require,module,exports){const SceneBase=require("./scene-base.js");class SceneModel extends SceneBase{static type(){return"scenemodel"}}module.exports=SceneModel},{"./scene-base.js":38}],44:[function(require,module,exports){const SceneBase=require("./scene-base.js");class ScenePanorama extends SceneBase{static type(){return"scenepanorama"}}module.exports=ScenePanorama},{"./scene-base.js":38}],45:[function(require,module,exports){const SceneBase=require("./scene-base.js");class ScenePoller extends SceneBase{static type(){return"scenepoller"}}module.exports=ScenePoller},{"./scene-base.js":38}],46:[function(require,module,exports){const SceneBase=require("./scene-base.js");class SceneProduct extends SceneBase{static type(){return"sceneproduct"}}module.exports=SceneProduct},{"./scene-base.js":38}],47:[function(require,module,exports){const SceneBase=require("./scene-base.js");class SceneShadow extends SceneBase{static type(){return"sceneshadow"}}module.exports=SceneShadow},{"./scene-base.js":38}],48:[function(require,module,exports){const SceneBase=require("./scene-base.js");class SceneVideo extends SceneBase{static type(){return"scenevideo"}}module.exports=SceneVideo},{"./scene-base.js":38}],49:[function(require,module,exports){const SceneBase=require("./scene-base.js");class SceneVolumetric extends SceneBase{static type(){return"scenevolumetric"}}module.exports=SceneVolumetric},{"./scene-base.js":38}],50:[function(require,module,exports){const SceneBase=require("./scene-base.js");class SceneYoutube extends SceneBase{static type(){return"sceneyoutube"}}module.exports=SceneYoutube},{"./scene-base.js":38}],51:[function(require,module,exports){const PlattarBase=require("../interfaces/plattar-base.js");class Scene extends PlattarBase{static type(){return"scene"}}module.exports=Scene},{"../interfaces/plattar-base.js":12}],52:[function(require,module,exports){const Application=require("../types/application.js");const Scene=require("../types/scene/scene.js");const SceneAnnotation=require("../types/scene/scene-annotation.js");const SceneAudio=require("../types/scene/scene-audio.js");const SceneButton=require("../types/scene/scene-button.js");const SceneCamera=require("../types/scene/scene-camera.js");const SceneCarousel=require("../types/scene/scene-carousel.js");const SceneImage=require("../types/scene/scene-image.js");const SceneModel=require("../types/scene/scene-model.js");const ScenePanorama=require("../types/scene/scene-panorama.js");const ScenePoller=require("../types/scene/scene-poller.js");const SceneProduct=require("../types/scene/scene-product.js");const SceneShadow=require("../types/scene/scene-shadow.js");const SceneVideo=require("../types/scene/scene-video.js");const SceneVolumetric=require("../types/scene/scene-volumetric.js");const SceneYoutube=require("../types/scene/scene-youtube.js");const Page=require("../types/page/page.js");const CardButton=require("../types/page/card-button.js");const CardHTML=require("../types/page/card-html.js");const CardIFrame=require("../types/page/card-iframe.js");const CardImage=require("../types/page/card-image.js");const CardMap=require("../types/page/card-map.js");const CardParagraph=require("../types/page/card-paragraph.js");const CardRow=require("../types/page/card-row.js");const CardSlider=require("../types/page/card-slider.js");const CardTitle=require("../types/page/card-title.js");const CardVideo=require("../types/page/card-video.js");const CardYoutube=require("../types/page/card-youtube.js");const Product=require("../types/product/product.js");const ProductVariation=require("../types/product/product-variation.js");const ProductAnnotation=require("../types/product/product-annotation.js");const FileAudio=require("../types/file/file-audio.js");const FileVideo=require("../types/file/file-video.js");const FileModel=require("../types/file/file-model.js");const FileImage=require("../types/file/file-image.js");const ScriptEvent=require("../types/misc/script-event.js");const Tag=require("../types/misc/tag.js");const ApplicationBuild=require("../types/misc/application-build.js");const AsyncJob=require("../types/misc/async-job.js");class PlattarUtil{}PlattarUtil.isPlattarObject=(obj=>{const PlattarObject=require("../types/interfaces/plattar-object.js");if(obj&&obj.prototype&&obj.prototype instanceof PlattarObject){return true}if(obj&&obj instanceof PlattarObject){return true}return false});PlattarUtil.reconstruct=((parent,json,options)=>{parent._attributes=json.data.attributes;if(options.cache===true){parent._cache()}const server=parent._query.server;if(json.data.relationships){for(const[key,value]of Object.entries(json.data.relationships)){const data=value.data;if(Array.isArray(data)){data.forEach(item=>{const construct=PlattarUtil.create(key,item.id,server);construct._attributes=item.attributes||{};parent.relationships._put(construct)})}else{const construct=PlattarUtil.create(key,data.id,server);construct._attributes=data.attributes||{};parent.relationships._put(construct)}}}if(json.included){json.included.forEach(item=>{const existing=parent.relationships.find(PlattarUtil.match(item.type),item.id);if(existing){PlattarUtil.reconstruct(existing,{data:item,included:json.included},options)}})}});PlattarUtil.create=((type,id,server)=>{const _DynamicClass=PlattarUtil.match(type);return new _DynamicClass(id,server)});PlattarUtil.match=(type=>{switch(type){case Application.type():return Application;case Scene.type():return Scene;case SceneAnnotation.type():return SceneAnnotation;case SceneAudio.type():return SceneAudio;case SceneButton.type():return SceneButton;case SceneCamera.type():return SceneCamera;case SceneCarousel.type():return SceneCarousel;case SceneImage.type():return SceneImage;case SceneModel.type():return SceneModel;case ScenePanorama.type():return ScenePanorama;case ScenePoller.type():return ScenePoller;case SceneProduct.type():return SceneProduct;case SceneShadow.type():return SceneShadow;case SceneVideo.type():return SceneVideo;case SceneVolumetric.type():return SceneVolumetric;case SceneYoutube.type():return SceneYoutube;case Page.type():return Page;case CardButton.type():return CardButton;case CardHTML.type():return CardHTML;case CardIFrame.type():return CardIFrame;case Product.type():return Product;case ProductVariation.type():return ProductVariation;case ProductAnnotation.type():return ProductAnnotation;case FileAudio.type():return FileAudio;case FileVideo.type():return FileVideo;case FileModel.type():return FileModel;case FileImage.type():return FileImage;case CardMap.type():return CardMap;case CardParagraph.type():return CardParagraph;case CardRow.type():return CardRow;case CardSlider.type():return CardSlider;case CardTitle.type():return CardTitle;case CardVideo.type():return CardVideo;case CardYoutube.type():return CardYoutube;case CardImage.type():return CardImage;case ScriptEvent.type():return ScriptEvent;case Tag.type():return Tag;case ApplicationBuild.type():return ApplicationBuild;case AsyncJob.type():return AsyncJob;default:throw new Error('PlattarUtil.match(type) - provided type of "'+type+'" does not exist and cannot be created')}});module.exports=PlattarUtil},{"../types/application.js":6,"../types/file/file-audio.js":7,"../types/file/file-image.js":9,"../types/file/file-model.js":10,"../types/file/file-video.js":11,"../types/interfaces/plattar-object.js":14,"../types/misc/application-build.js":15,"../types/misc/async-job.js":16,"../types/misc/script-event.js":17,"../types/misc/tag.js":18,"../types/page/card-button.js":20,"../types/page/card-html.js":21,"../types/page/card-iframe.js":22,"../types/page/card-image.js":23,"../types/page/card-map.js":24,"../types/page/card-paragraph.js":25,"../types/page/card-row.js":26,"../types/page/card-slider.js":27,"../types/page/card-title.js":28,"../types/page/card-video.js":29,"../types/page/card-youtube.js":30,"../types/page/page.js":31,"../types/product/product-annotation.js":32,"../types/product/product-variation.js":34,"../types/product/product.js":35,"../types/scene/scene-annotation.js":36,"../types/scene/scene-audio.js":37,"../types/scene/scene-button.js":39,"../types/scene/scene-camera.js":40,"../types/scene/scene-carousel.js":41,"../types/scene/scene-image.js":42,"../types/scene/scene-model.js":43,"../types/scene/scene-panorama.js":44,"../types/scene/scene-poller.js":45,"../types/scene/scene-product.js":46,"../types/scene/scene-shadow.js":47,"../types/scene/scene-video.js":48,"../types/scene/scene-volumetric.js":49,"../types/scene/scene-youtube.js":50,"../types/scene/scene.js":51}]},{},[1])(1)});

@@ -470,3 +470,4 @@ (function(f){if(typeof exports==="object"&&typeof module!=="undefined"){module.exports=f()}else if(typeof define==="function"&&define.amd){define([],f)}else{var g;if(typeof window!=="undefined"){g=window}else if(typeof global!=="undefined"){g=global}else if(typeof self!=="undefined"){g=self}else{g=this}g.Plattar = f()}})(function(){var define,module,exports;return (function(){function r(e,n,t){function o(i,f){if(!n[i]){if(!e[i]){var c="function"==typeof require&&require;if(!f&&c)return c(i,!0);if(u)return u(i,!0);var a=new Error("Cannot find module '"+i+"'");throw a.code="MODULE_NOT_FOUND",a}var p=n[i]={exports:{}};e[i][0].call(p.exports,function(r){var n=e[i][1][r];return o(n||r)},p,p.exports,r,e,n,t)}return n[i].exports}for(var u="function"==typeof require&&require,i=0;i<t.length;i++)o(t[i]);return o}return r})()({1:[function(require,module,exports){

attributes: target.attributes
}
},
meta: target.meta || {}
}

@@ -1108,2 +1109,3 @@ )

this._attributes = {};
this._meta = {};
this._query = new PlattarQuery(this, server);

@@ -1142,2 +1144,9 @@ this._relationships = new PlattarObjectRelations(this);

/**
* Returns any meta-data that should be posted
*/
get meta() {
return this._meta;
}
/**
* This can be used to override the current internal attributes

@@ -1144,0 +1153,0 @@ * with new Data. Upon next request, the override attributes will

{
"name": "@plattar/plattar-api",
"version": "1.99.4",
"version": "1.101.1",
"description": "Module for interfacing with the Plattar API (https://www.plattar.com)",

@@ -5,0 +5,0 @@ "main": "index.js",

@@ -137,3 +137,4 @@ const fetch = require("node-fetch");

attributes: target.attributes
}
},
meta: target.meta || {}
}

@@ -140,0 +141,0 @@ )

@@ -13,2 +13,4 @@ import { PlattarServer as Server } from "../../server/plattar-server";

get relationships(): PlattarObjectRelations;
get attributes(): any;
get meta(): any;
static include(...args: [any]): [string];

@@ -15,0 +17,0 @@ include(...args: [any]): this;

@@ -13,2 +13,3 @@ const PlattarQuery = require("../../server/plattar-query.js");

this._attributes = {};
this._meta = {};
this._query = new PlattarQuery(this, server);

@@ -47,2 +48,9 @@ this._relationships = new PlattarObjectRelations(this);

/**
* Returns any meta-data that should be posted
*/
get meta() {
return this._meta;
}
/**
* This can be used to override the current internal attributes

@@ -49,0 +57,0 @@ * with new Data. Upon next request, the override attributes will

Sorry, the diff of this file is too big to display

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc