contentstack
Advanced tools
Comparing version 3.10.0 to 3.10.1
@@ -1,2 +0,2 @@ | ||
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.Contentstack=t():e.Contentstack=t()}(this,function(){return function(e){function t(n){if(r[n])return r[n].exports;var o=r[n]={i:n,l:!1,exports:{}};return e[n].call(o.exports,o,o.exports,t),o.l=!0,o.exports}var r={};return t.m=e,t.c=r,t.i=function(e){return e},t.d=function(e,r,n){t.o(e,r)||Object.defineProperty(e,r,{configurable:!1,enumerable:!0,get:n})},t.n=function(e){var r=e&&e.__esModule?function(){return e.default}:function(){return e};return t.d(r,"a",r),r},t.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},t.p="",t(t.s=15)}([function(e,t,r){"use strict";(function(e){function n(e){return e&&e.__esModule?e:{default:e}}function o(e){return function(){switch(this._query[e]=this._query[e]||{},arguments.length){case 1:if(Array.isArray(arguments[0])||"string"==typeof arguments[0]){var t=this._query[e].BASE||[];return t=t.concat(arguments[0]),this._query[e].BASE=t,this}console.error("Kindly provide valid parameters");break;case 2:if("string"==typeof arguments[0]&&(Array.isArray(arguments[1])||"string"==typeof arguments[1])){var r=this._query[e][arguments[0]]||[];return r=r.concat(arguments[1]),this._query[e][arguments[0]]=r,this}console.error("Kindly provide valid parameters");break;default:console.error("Kindly provide valid parameters")}}}function i(e){var t=void 0===e?"undefined":p(e);switch(t){case"object":t,Array.isArray(e)&&(t="array");break;default:t}return t}function s(e,t){var r=this;return function e(t,n){for(var o in n)"object"==r._type(n[o])&&r._type(t[o])==r._type(n[o])?e(t[o],n[o]):"array"==r._type(n[o])&&r._type(t[o])==r._type(n[o])?t[o]=t[o].concat(n[o]):t[o]=n[o]}(e,t),e}function u(e,t){if(e&&t)for(var r in t)e[r]=t[r];return e}function a(){return"undefined"!=typeof window&&"object"===(void 0===e?"undefined":p(e))&&"browser"===e.title}function c(e,t,r){if(e&&e.requestParams){var n=u({},e.requestParams.body?e.requestParams.body.query||{}:{});return n.environment_uid&&(delete n.environment_uid,n.environment=e.environment),n.environment=e.environment,{content_type_uid:e.content_type_uid,locale:n.locale||"en-us",query:n,entry_uid:e.entry_uid,asset_uid:e.asset_uid,single:t||"false",toJSON:r||"false",api_key:e.requestParams.headers?e.requestParams.headers.api_key:""}}}function f(e){try{var t=l(JSON.stringify(e)),r=[];return r.push(e.content_type_uid),r.push(e.locale),e.entry_uid&&r.push(e.entry_uid),e.asset_uid&&r.push(e.asset_uid),r.push(t),r.join(".")}catch(e){}}function l(e){var t=0,r=void 0,n=void 0,o=void 0;if(0===e.length)return t;for(r=0,o=e.length;r<o;r++)n=e.charCodeAt(r),t=(t<<5)-t+n,t|=0;return t<-1?-1*t:t}function y(e){if(e&&void 0!==e.entries)if(e.entries&&e.entries.length)for(var t=0,r=e.entries.length;t<r;t++)e.entries[t]=(0,b.default)(e.entries[t]);else e.entries=[];else if(e&&e.assets&&void 0!==e.assets)if(e.assets&&e.assets.length)for(var n=0,o=e.assets.length;n<o;n++)e.assets[n]=(0,b.default)(e.assets[n]);else e.assets=[];else e&&void 0!==e.entry?e.entry=(0,b.default)(e.entry):e&&void 0!==e.asset?e.asset=(0,b.default)(e.asset):e&&void 0!==e.items&&(e.items=(0,b.default)(e.items).toJSON());return e}function h(e){var t=[];return e&&Object.keys(e).length&&(void 0!==e.entries&&(t.push(e.entries),e.content_type&&(t.schema=e.content_type)),void 0!==e.assets&&t.push(e.assets),void 0===e.content_type&&void 0===e.schema||t.push(e.content_type||e.schema),void 0!==e.count&&t.push(e.count),void 0!==e.entry&&(t=e.entry,e.schema&&(t.schema=e.schema)),void 0!==e.asset&&(t=e.asset),void 0!==e.items&&t.push(e)),t}function d(e,t){var r=e.environment_uid;r?e._query.environment_uid=r:e._query?e._query.environment=e.environment:(e._query={},e._query.environment=e.environment);var n=e,o=void 0!==n.queryCachePolicy?n.queryCachePolicy:n.cachePolicy,i=void 0!==n.tojson&&n.tojson,s=!!(n.entry_uid||n.singleEntry||n.asset_uid),a=f(c(n,s,i));if(e&&e.requestParams&&e.requestParams.body&&e.requestParams.body.query){var l=JSON.parse(JSON.stringify(e.requestParams.body.query));"object"!==(void 0===l?"undefined":p(l))&&(l=JSON.parse(l)),delete e.requestParams.body.query,e.requestParams.body=u(e.requestParams.body,l)}var d=function(){return function(e,t){return new Promise(function(r,n){try{if(e)throw e;i||(t=y(t)),r(h(t))}catch(e){n(e)}})}},v=function(r,s,u){r&&(0,_.default)(e.requestParams,t).then(function(t){try{n.entry_uid=n.asset_uid=n.tojson=n.queryCachePolicy=void 0;var r={},c={};if(e.singleEntry)if(e.singleEntry=!1,t.schema&&(r.schema=t.schema),t.content_type&&(r.content_type=t.content_type,delete r.schema),t.entries&&t.entries.length)r.entry=t.entries[0];else{if(!t.assets||!t.assets.length)return 2!==o||null===n.provider?u({error_code:141,error_message:"The requested entry doesn't exist."}):void n.provider.get(a,d());r.assets=t.assets[0]}else t.items?c={items:t.items,pagination_token:t.pagination_token,sync_token:t.sync_token,total_count:t.total_count}:r=t;return-1!==o&&null!==n.provider?(n.provider.set(a,r,function(e){try{if(e)throw e;return i||(r=y(r)),s(h(r))}catch(e){return u(e)}}),s(h(r))):Object.keys(c).length?s(c):(i||(r=y(r)),s(h(r)))}catch(e){return u({message:e.message})}}.bind(n)).catch(function(e){if(2!==o||null===n.provider)return u(e);n.provider.get(a,d())})};switch(o){case 1:return new Promise(function(e,t){null!==n.provider?n.provider.get(a,function(r,n){try{if(!r&&n)return i||(n=y(n)),e(h(n));v(!0,e,t)}catch(e){return t(e)}}):v(!0,e,t)});case 2:case 0:case void 0:case-1:return new Promise(function(e,t){v(!0,e,t)})}if(3===o){return new Promise(function(e,t){null!==n.provider&&n.provider.get(a,function(r,n){try{r||!n?t(r):(i||(n=y(n)),e(h(n)))}catch(e){t(e)}})}).then(function(){return new Promise(function(e,t){v(!0,e,t)})}).catch(function(e){return new Promise(function(e,t){v(!0,e,t)})})}}Object.defineProperty(t,"__esModule",{value:!0});var p="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e};t.transform=o,t._type=i,t.mergeDeep=s,t.merge=u,t.isBrowser=a,t.parseQueryFromParams=c,t.getHash=f,t.generateHash=l,t.resultWrapper=y,t.spreadResult=h,t.sendRequest=d;var v=r(2),_=n(v),m=r(17),b=n(m);!function(){Promise.prototype.spread||(Promise.prototype.spread=function(e,t){return t=t||function(e){},this.then(function(t){return e.apply(e,t)}).catch(function(e){t(e)})})}()}).call(t,r(4))},function(e,t,r){"use strict";function n(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}function o(e){return e&&e.__esModule?e:{default:e}}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(t,"__esModule",{value:!0});var s="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},u=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}(),a=r(9),c=o(a),f=r(0),l=n(f),y=r(6),h=o(y),d=r(16),p=o(d),v=r(7),_=o(v),m=r(2),b=o(m),g=r(5),q=(n(g),r(3)),w=o(q),O=function(){function e(){i(this,e);for(var t=arguments.length,r=Array(t),n=0;n<t;n++)r[n]=arguments[n];switch(r[0].region&&void 0!==r[0].region&&"us"!==r[0].region&&(c.default.host=r[0].region+"-cdn.contentstack.com"),r[0].fetchOptions&&void 0!==r[0].fetchOptions&&(this.fetchOptions=r[0].fetchOptions),this.config=c.default,this.cachePolicy=w.default.policies.IGNORE_CACHE,this.provider=w.default.providers("localstorage"),r.length){case 1:if("object"===s(r[0])&&"string"==typeof r[0].api_key&&"string"==typeof r[0].delivery_token&&"string"==typeof r[0].environment)return this.headers={api_key:r[0].api_key,access_token:r[0].delivery_token},this.environment=r[0].environment,this;console.error("Kindly provide valid object parameters. The specified API Key, Delivery Token, or Environment Name is invalid.");case 3:if("string"==typeof r[0]&&"string"==typeof r[1]&&"string"==typeof r[2])return this.headers={api_key:r[0],access_token:r[1]},this.environment=r[2],this;console.error("Kindly provide valid string parameters.");case 4:return"string"==typeof r[0]&&"string"==typeof r[1]&&"string"==typeof r[2]?(this.headers={api_key:r[0],access_token:r[1]},this.environment=r[2]):console.error("Kindly provide valid string parameters."),r[3]&&("string"==typeof r[3]&&"us"!==r[3]?c.default.host=r[3]+"-cdn.contentstack.com":"object"===s(r[3])&&(this.fetchOptions=r[3])),this.config=c.default,this;case 5:return"string"==typeof r[0]&&"string"==typeof r[1]&&"string"==typeof r[2]?(this.headers={api_key:r[0],access_token:r[1]},this.environment=r[2]):console.error("Kindly provide valid string parameters."),r[3]&&("string"==typeof r[3]&&"us"!==r[3]?c.default.host=r[3]+"-cdn.contentstack.com":"object"===s(r[3])&&(this.fetchOptions=r[3])),r[4]&&"object"===s(r[4])&&(this.fetchOptions=r[4]),this.config=c.default,this;default:console.error("Kindly provide valid parameters to initialize the Contentstack javascript-SDK Stack.")}}return u(e,[{key:"setPort",value:function(e){return"number"==typeof e&&(this.config.port=e),this}},{key:"setProtocol",value:function(e){return"string"==typeof e&&~["https","http"].indexOf(e)&&(this.config.protocol=e),this}},{key:"setHost",value:function(e){return"string"==typeof e&&e&&(this.config.host=e),this}},{key:"setCachePolicy",value:function(e){return"number"==typeof e&&e>=-1&&e<4?this._query?this.queryCachePolicy=e:this.cachePolicy=e:console.error("Kindly provide the valid policy"),this}},{key:"setCacheProvider",value:function(e){return e&&"object"===(void 0===e?"undefined":s(e))&&(this.provider=e),this}},{key:"clearByQuery",value:function(){if(this.provider&&"function"==typeof this.provider.clearByQuery)return this.provider.clearByQuery.apply(this.provider,arguments)}},{key:"clearByContentType",value:function(){if(this.provider&&"function"==typeof this.provider.clearByContentType)return this.provider.clearByContentType.apply(this.provider,arguments)}},{key:"clearAll",value:function(){if(this.provider&&"function"==typeof this.provider.clearAll)return this.provider.clearAll.apply(this.provider,arguments)}},{key:"getCacheProvider",value:function(){return this.provider}},{key:"ContentType",value:function(e){return e&&"string"==typeof e&&(this.content_type_uid=e,this.type="contentType"),this}},{key:"Entry",value:function(e){var t=new h.default;return e&&"string"==typeof e&&(t.entry_uid=e),l.merge(t,this)}},{key:"fetch",value:function(e){var t={method:"POST",headers:this.headers,url:this.config.protocol+"://"+this.config.host+":"+this.config.port+"/"+this.config.version+this.config.urls.content_types+this.content_type_uid,body:{_method:"GET",environment:this.environment}},r=Object.assign({},this.fetchOptions,e);return(0,b.default)(t,r)}},{key:"Assets",value:function(e){if(this.type="asset",e&&"string"==typeof e){var t=new p.default;return t.asset_uid=e,l.merge(t,this)}return this}},{key:"Query",value:function(){var e=new _.default;return l.merge(e,this)}},{key:"getLastActivities",value:function(){var e={method:"POST",headers:this.headers,url:this.config.protocol+"://"+this.config.host+":"+this.config.port+"/"+this.config.version+this.config.urls.content_types,body:{_method:"GET",only_last_activity:!0,environment:this.environment}};return(0,b.default)(e,this.fetchOptions)}},{key:"getContentTypes",value:function(e){var t={method:"POST",headers:this.headers,url:this.config.protocol+"://"+this.config.host+":"+this.config.port+"/"+this.config.version+this.config.urls.content_types,body:{_method:"GET",environment:this.environment}};if(e&&void 0!==e)for(var r in e)t.body[r]=e[r];return(0,b.default)(t,this.fetchOptions)}},{key:"sync",value:function(e,t){this._query={},this._query=Object.assign(this._query,e),this.requestParams={method:"POST",headers:this.headers,url:this.config.protocol+"://"+this.config.host+":"+this.config.port+"/"+this.config.version+this.config.urls.sync,body:{_method:"GET",query:this._query}};var r=Object.assign({},this.fetchOptions,t);return l.sendRequest(this,r)}},{key:"imageTransform",value:function(e,t){if(e&&"string"==typeof e&&"object"===(void 0===t?"undefined":s(t))&&void 0===t.length){var r=[];for(var n in t)r.push(n+"="+t[n]);e+=e.indexOf("?")<=-1?"?"+r.join("&"):"&"+r.join("&")}return e}}]),e}();t.default=O},function(e,t,r){"use strict";function n(e,t){return new Promise(function(r,n){var i=void 0,s=e.url,c=e.headers;c["Content-Type"]="application/json; charset=UTF-8",c["X-User-Agent"]="contentstack-web/"+a,e.body&&"object"===o(e.body)&&(delete e.body._method,"object"===o(e.body.query)&&0===Object.keys(e.body.query).length&&delete e.body.query,i=function e(t,r){var n=[],i=void 0;if("object"===(void 0===t?"undefined":o(t))&&void 0!==t.length)for(var s=0,u=t.length;s<u;s++)n.push(r+"[]="+t[s]);else for(i in t){var a=r?r+"["+i+"]":i,c=t[i];n.push(null!==c&&"object"===(void 0===c?"undefined":o(c))&&"query"!==i?e(c,a):a+"="+encodeURIComponent("query"!==i?c:JSON.stringify(c)))}return n.join("&")}(e.body));var f=Object.assign({method:"GET",headers:c},t);(0,u.default)(s+"?"+i,f).then(function(e){if(e.ok&&200===e.status){var t=e.json();r(t)}else n(e.statusText)}).catch(function(e){console.log("Error: ",e),n(e)})})}Object.defineProperty(t,"__esModule",{value:!0});var o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e};t.default=n;var i=r(0),s=(function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);t.default=e}(i),r(18)),u=function(e){return e&&e.__esModule?e:{default:e}}(s),a="3.10.0"},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r(14),o=function(e){return e&&e.__esModule?e:{default:e}}(n),i={};i.providers=function(e){if(e)return o.default;console.error("Kindly provide valid provider.")},i.policies={IGNORE_CACHE:-1,ONLY_NETWORK:0,CACHE_ELSE_NETWORK:1,NETWORK_ELSE_CACHE:2,CACHE_THEN_NETWORK:3},t.default=i},function(e,t,r){"use strict";function n(){throw new Error("setTimeout has not been defined")}function o(){throw new Error("clearTimeout has not been defined")}function i(e){if(l===setTimeout)return setTimeout(e,0);if((l===n||!l)&&setTimeout)return l=setTimeout,setTimeout(e,0);try{return l(e,0)}catch(t){try{return l.call(null,e,0)}catch(t){return l.call(this,e,0)}}}function s(e){if(y===clearTimeout)return clearTimeout(e);if((y===o||!y)&&clearTimeout)return y=clearTimeout,clearTimeout(e);try{return y(e)}catch(t){try{return y.call(null,e)}catch(t){return y.call(this,e)}}}function u(){v&&d&&(v=!1,d.length?p=d.concat(p):_=-1,p.length&&a())}function a(){if(!v){var e=i(u);v=!0;for(var t=p.length;t;){for(d=p,p=[];++_<t;)d&&d[_].run();_=-1,t=p.length}d=null,v=!1,s(e)}}function c(e,t){this.fun=e,this.array=t}function f(){}var l,y,h=e.exports={};!function(){try{l="function"==typeof setTimeout?setTimeout:n}catch(e){l=n}try{y="function"==typeof clearTimeout?clearTimeout:o}catch(e){y=o}}();var d,p=[],v=!1,_=-1;h.nextTick=function(e){var t=new Array(arguments.length-1);if(arguments.length>1)for(var r=1;r<arguments.length;r++)t[r-1]=arguments[r];p.push(new c(e,t)),1!==p.length||v||i(a)},c.prototype.run=function(){this.fun.apply(null,this.array)},h.title="browser",h.browser=!0,h.env={},h.argv=[],h.version="",h.versions={},h.on=f,h.addListener=f,h.once=f,h.off=f,h.removeListener=f,h.removeAllListeners=f,h.emit=f,h.prependListener=f,h.prependOnceListener=f,h.listeners=function(e){return[]},h.binding=function(e){throw new Error("process.binding is not supported")},h.cwd=function(){return"/"},h.chdir=function(e){throw new Error("process.chdir is not supported")},h.umask=function(){return 0}},function(e,t,r){"use strict";function n(e){var t=f.default.getItem(e);try{t=JSON.parse(t)}catch(e){return t}return t||null}function o(e,t){try{"object"===(void 0===t?"undefined":u(t))?f.default.setItem(e,JSON.stringify(t)):f.default.setItem(e,t)}catch(e){}}function i(){return f.default||null}function s(){return f.default?Object.keys(f.default):[]}Object.defineProperty(t,"__esModule",{value:!0});var u="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e};t.get=n,t.set=o,t.getStorage=i,t.getKeys=s;var a=r(0),c=(function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);t.default=e}(a),r(19)),f=function(e){return e&&e.__esModule?e:{default:e}}(c)},function(e,t,r){"use strict";function n(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(t,"__esModule",{value:!0});var o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},i=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}(),s=r(0),u=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}(s),a=r(1),c=(function(e){e&&e.__esModule}(a),function(){function e(){return n(this,e),this._query={},this.only=u.transform("only"),this.except=u.transform("except"),this}return i(e,[{key:"setCacheProvider",value:function(e){return e&&"object"===(void 0===e?"undefined":o(e))&&(this.provider=e),this}},{key:"setCachePolicy",value:function(e){return"number"==typeof e&&e>=-1&&e<4?this._query?this.queryCachePolicy=e:this.cachePolicy=e:console.error("Kindly provide the valid policy"),this}},{key:"includeReference",value:function(){for(var e=arguments.length,t=Array(e),r=0;r<e;r++)t[r]=arguments[r];if(Array.isArray(t)||"string"==typeof t){if(arguments.length)for(var n=0;n<arguments.length;n++)this._query.include=this._query.include||[],this._query.include=this._query.include.concat(arguments[n]);return this}console.error("Argument should be a String or an Array.")}},{key:"language",value:function(e){if(e&&"string"==typeof e)return this._query.locale=e,this;console.error("Argument should be a String.")}},{key:"addQuery",value:function(e,t){if(e&&t&&"string"==typeof e)return this._query[e]=t,this;console.error("First argument should be a String.")}},{key:"includeSchema",value:function(){return this._query.include_schema=!0,this}},{key:"includeReferenceContentTypeUID",value:function(){return this._query.include_reference_content_type_uid=!0,this}},{key:"includeContentType",value:function(){return this._query.include_content_type=!0,this}},{key:"includeOwner",value:function(){return this._query.include_owner=!0,this}},{key:"toJSON",value:function(){return this.tojson=!0,this}},{key:"addParam",value:function(e,t){if(e&&t&&"string"==typeof e&&"string"==typeof t)return this._query[e]=t,this;console.error("Kindly provide valid parameters.")}},{key:"fetch",value:function(e){if(this.entry_uid){this.requestParams={method:"POST",headers:this.headers,url:this.config.protocol+"://"+this.config.host+":"+this.config.port+"/"+this.config.version+this.config.urls.content_types+this.content_type_uid+this.config.urls.entries+this.entry_uid,body:{_method:"GET",query:this._query}};var t=Object.assign({},this.fetchOptions,e);return u.sendRequest(this,t)}console.error("Kindly provide an entry uid. e.g. .Entry('bltsomething123')")}}]),e}());t.default=c},function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function i(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function s(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0});var u=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}(),a="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},c=r(2),f=(n(c),r(0)),l=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}(f),y=r(6),h=n(y),d={compare:function(e){return function(t,r){if(t&&r&&"string"==typeof t&&void 0!==r)return this._query.query[t]=this._query.query.file_size||{},this._query.query[t][e]=r,this;console.error("Kindly provide valid parameters.")}},contained:function(e){var t=e?"$in":"$nin";return function(e,r){if(e&&r&&"string"==typeof e&&Array.isArray(r))return this._query.query[e]=this._query.query[e]||{},this._query.query[e][t]=this._query.query[e][t]||[],this._query.query[e][t]=this._query.query[e][t].concat(r),this;console.error("Kindly provide valid parameters.")}},exists:function(e){return function(t){if(t&&"string"==typeof t)return this._query.query[t]=this._query.query[t]||{},this._query.query[t].$exists=e,this;console.error("Kindly provide valid parameters.")}},logical:function(e){return function(){for(var t=[],r=0,n=arguments.length;r<n;r++)arguments[r]instanceof p&&arguments[r]._query.query?t.push(arguments[r]._query.query):"object"===a(arguments[r])&&t.push(arguments[r]);return this._query.query[e]?this._query.query[e]=this._query.query[e].concat(t):this._query.query[e]=t,this}},sort:function(e){return function(t){if(t&&"string"==typeof t)return this._query[e]=t,this;console.error("Argument should be a string.")}},pagination:function(e){return function(t){if("number"==typeof t)return this._query[e]=t,this;console.error("Argument should be a number.")}}},p=function(e){function t(){o(this,t);var e=i(this,(t.__proto__||Object.getPrototypeOf(t)).call(this));return e._query=e._query||{},e._query.query=e._query.query||{},e.lessThan=d.compare("$lt"),e.lessThanOrEqualTo=d.compare("$lte"),e.greaterThan=d.compare("$gt"),e.greaterThanOrEqualTo=d.compare("$gte"),e.notEqualTo=d.compare("$ne"),e.containedIn=d.contained(!0),e.notContainedIn=d.contained(!1),e.exists=d.exists(!0),e.notExists=d.exists(!1),e.ascending=d.sort("asc"),e.descending=d.sort("desc"),e.beforeUid=d.sort("before_uid"),e.afterUid=d.sort("after_uid"),e.skip=d.pagination("skip"),e.limit=d.pagination("limit"),e.or=d.logical("$or"),e.and=d.logical("$and"),e}return s(t,e),u(t,[{key:"equalTo",value:function(e,t){if(e&&"string"==typeof e)return this._query.query[e]=t,this;console.error("Kindly provide valid parameters.")}},{key:"where",value:function(e,t){if(e&&"string"==typeof e)return this._query.query[e]=t,this;console.error("Kindly provide valid parameters.")}},{key:"count",value:function(){var e=this.config.protocol+"://"+this.config.host+":"+this.config.port+"/"+this.config.version,t=this.type&&"asset"===this.type?e+this.config.urls.assets:e+this.config.urls.content_types+this.content_type_uid+this.config.urls.entries;return this._query.count=!0,this.requestParams={method:"POST",headers:this.headers,url:t,body:{_method:"GET",query:this._query}},this}},{key:"query",value:function(e){if("object"===(void 0===e?"undefined":a(e)))return this._query.query=l.mergeDeep(this._query.query,e),this;console.error("Kindly provide valid parameters")}},{key:"referenceIn",value:function(e,r){var n={};return r instanceof t&&r._query.query?n.$in_query=r._query.query:"object"===(void 0===r?"undefined":a(r))&&(n.$in_query=r),this._query.query[e]?this._query.query[e]=this._query.query[e].concat(n):this._query.query[e]=n,this}},{key:"referenceNotIn",value:function(e,r){var n={};return r instanceof t&&r._query.query?n.$nin_query=r._query.query:"object"===(void 0===r?"undefined":a(r))&&(n.$nin_query=r),this._query.query[e]?this._query.query[e]=this._query.query[e].concat(n):this._query.query[e]=n,this}},{key:"tags",value:function(e){if(Array.isArray(e))return this._query.tags=e,this;console.error("Kindly provide valid parameters")}},{key:"includeReferenceContentTypeUID",value:function(){return this._query.include_reference_content_type_uid=!0,this}},{key:"includeCount",value:function(){return this._query.include_count=!0,this}},{key:"addParam",value:function(e,t){if(e&&t&&"string"==typeof e&&"string"==typeof t)return this._query[e]=t,this;console.error("Kindly provide valid parameters.")}},{key:"getQuery",value:function(){return this._query.query||{}}},{key:"regex",value:function(e,t,r){if(e&&t&&"string"==typeof e&&"string"==typeof t)return this._query.query[e]={$regex:t},r&&(this._query.query[e].$options=r),this;console.error("Kindly provide valid parameters.")}},{key:"search",value:function(e){if(e&&"string"==typeof e)return this._query.typeahead=e,this;console.error("Kindly provide valid parameters.")}},{key:"find",value:function(e){var t=this.config.protocol+"://"+this.config.host+":"+this.config.port+"/"+this.config.version,r=this.type&&"asset"===this.type?t+this.config.urls.assets:t+this.config.urls.content_types+this.content_type_uid+this.config.urls.entries;this.requestParams={method:"POST",headers:this.headers,url:r,body:{_method:"GET",query:this._query}};var n=Object.assign({},this.fetchOptions,e);return l.sendRequest(this,n)}},{key:"findOne",value:function(){var e=this.config.protocol+"://"+this.config.host+":"+this.config.port+"/"+this.config.version,t=this.type&&"asset"===this.type?e+this.config.urls.assets:e+this.config.urls.content_types+this.content_type_uid+this.config.urls.entries;this.singleEntry=!0,this._query.limit=1,this.requestParams={method:"POST",headers:this.headers,url:t,body:{_method:"GET",query:this._query}};var r=Object.assign({},this.fetchOptions);return l.sendRequest(this,r)}}]),t}(h.default);t.default=p},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n={EU:"eu",US:"us"};t.default=n},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n={protocol:"https",host:"cdn.contentstack.io",port:443,version:"v3",urls:{sync:"/stacks/sync",content_types:"/content_types/",entries:"/entries/",assets:"/assets/",environments:"/environments/"}};t.default=n},function(e,t,r){"use strict";(function(n,o){var i,s,u="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e};/*! | ||
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.Contentstack=t():e.Contentstack=t()}(this,function(){return function(e){function t(n){if(r[n])return r[n].exports;var o=r[n]={i:n,l:!1,exports:{}};return e[n].call(o.exports,o,o.exports,t),o.l=!0,o.exports}var r={};return t.m=e,t.c=r,t.i=function(e){return e},t.d=function(e,r,n){t.o(e,r)||Object.defineProperty(e,r,{configurable:!1,enumerable:!0,get:n})},t.n=function(e){var r=e&&e.__esModule?function(){return e.default}:function(){return e};return t.d(r,"a",r),r},t.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},t.p="",t(t.s=15)}([function(e,t,r){"use strict";(function(e){function n(e){return e&&e.__esModule?e:{default:e}}function o(e){return function(){switch(this._query[e]=this._query[e]||{},arguments.length){case 1:if(Array.isArray(arguments[0])||"string"==typeof arguments[0]){var t=this._query[e].BASE||[];return t=t.concat(arguments[0]),this._query[e].BASE=t,this}console.error("Kindly provide valid parameters");break;case 2:if("string"==typeof arguments[0]&&(Array.isArray(arguments[1])||"string"==typeof arguments[1])){var r=this._query[e][arguments[0]]||[];return r=r.concat(arguments[1]),this._query[e][arguments[0]]=r,this}console.error("Kindly provide valid parameters");break;default:console.error("Kindly provide valid parameters")}}}function i(e){var t=void 0===e?"undefined":p(e);switch(t){case"object":t,Array.isArray(e)&&(t="array");break;default:t}return t}function s(e,t){var r=this;return function e(t,n){for(var o in n)"object"==r._type(n[o])&&r._type(t[o])==r._type(n[o])?e(t[o],n[o]):"array"==r._type(n[o])&&r._type(t[o])==r._type(n[o])?t[o]=t[o].concat(n[o]):t[o]=n[o]}(e,t),e}function u(e,t){if(e&&t)for(var r in t)e[r]=t[r];return e}function a(){return"undefined"!=typeof window&&"object"===(void 0===e?"undefined":p(e))&&"browser"===e.title}function c(e,t,r){if(e&&e.requestParams){var n=u({},e.requestParams.body?e.requestParams.body.query||{}:{});return n.environment_uid&&(delete n.environment_uid,n.environment=e.environment),n.environment=e.environment,{content_type_uid:e.content_type_uid,locale:n.locale||"en-us",query:n,entry_uid:e.entry_uid,asset_uid:e.asset_uid,single:t||"false",toJSON:r||"false",api_key:e.requestParams.headers?e.requestParams.headers.api_key:""}}}function f(e){try{var t=l(JSON.stringify(e)),r=[];return r.push(e.content_type_uid),r.push(e.locale),e.entry_uid&&r.push(e.entry_uid),e.asset_uid&&r.push(e.asset_uid),r.push(t),r.join(".")}catch(e){}}function l(e){var t=0,r=void 0,n=void 0,o=void 0;if(0===e.length)return t;for(r=0,o=e.length;r<o;r++)n=e.charCodeAt(r),t=(t<<5)-t+n,t|=0;return t<-1?-1*t:t}function y(e){if(e&&void 0!==e.entries)if(e.entries&&e.entries.length)for(var t=0,r=e.entries.length;t<r;t++)e.entries[t]=(0,b.default)(e.entries[t]);else e.entries=[];else if(e&&e.assets&&void 0!==e.assets)if(e.assets&&e.assets.length)for(var n=0,o=e.assets.length;n<o;n++)e.assets[n]=(0,b.default)(e.assets[n]);else e.assets=[];else e&&void 0!==e.entry?e.entry=(0,b.default)(e.entry):e&&void 0!==e.asset?e.asset=(0,b.default)(e.asset):e&&void 0!==e.items&&(e.items=(0,b.default)(e.items).toJSON());return e}function h(e){var t=[];return e&&Object.keys(e).length&&(void 0!==e.entries&&(t.push(e.entries),e.content_type&&(t.schema=e.content_type)),void 0!==e.assets&&t.push(e.assets),void 0===e.content_type&&void 0===e.schema||t.push(e.content_type||e.schema),void 0!==e.count&&t.push(e.count),void 0!==e.entry&&(t=e.entry,e.schema&&(t.schema=e.schema),e.content_type&&(t.content_type=e.content_type)),void 0!==e.asset&&(t=e.asset),void 0!==e.items&&t.push(e)),t}function d(e,t){var r=e.environment_uid;r?e._query.environment_uid=r:e._query?e._query.environment=e.environment:(e._query={},e._query.environment=e.environment);var n=e,o=void 0!==n.queryCachePolicy?n.queryCachePolicy:n.cachePolicy,i=void 0!==n.tojson&&n.tojson,s=!!(n.entry_uid||n.singleEntry||n.asset_uid),a=f(c(n,s,i));if(e&&e.requestParams&&e.requestParams.body&&e.requestParams.body.query){var l=JSON.parse(JSON.stringify(e.requestParams.body.query));"object"!==(void 0===l?"undefined":p(l))&&(l=JSON.parse(l)),delete e.requestParams.body.query,e.requestParams.body=u(e.requestParams.body,l)}var d=function(){return function(e,t){return new Promise(function(r,n){try{if(e)throw e;i||(t=y(t)),r(h(t))}catch(e){n(e)}})}},v=function(r,s,u){r&&(0,_.default)(e.requestParams,t).then(function(t){try{n.entry_uid=n.asset_uid=n.tojson=n.queryCachePolicy=void 0;var r={},c={};if(e.singleEntry)if(e.singleEntry=!1,t.schema&&(r.schema=t.schema),t.content_type&&(r.content_type=t.content_type,delete r.schema),t.entries&&t.entries.length)r.entry=t.entries[0];else{if(!t.assets||!t.assets.length)return 2!==o||null===n.provider?u({error_code:141,error_message:"The requested entry doesn't exist."}):void n.provider.get(a,d());r.assets=t.assets[0]}else t.items?c={items:t.items,pagination_token:t.pagination_token,sync_token:t.sync_token,total_count:t.total_count}:r=t;return-1!==o&&null!==n.provider?(n.provider.set(a,r,function(e){try{if(e)throw e;return i||(r=y(r)),s(h(r))}catch(e){return u(e)}}),s(h(r))):Object.keys(c).length?s(c):(i||(r=y(r)),s(h(r)))}catch(e){return u({message:e.message})}}.bind(n)).catch(function(e){if(2!==o||null===n.provider)return u(e);n.provider.get(a,d())})};switch(o){case 1:return new Promise(function(e,t){null!==n.provider?n.provider.get(a,function(r,n){try{if(!r&&n)return i||(n=y(n)),e(h(n));v(!0,e,t)}catch(e){return t(e)}}):v(!0,e,t)});case 2:case 0:case void 0:case-1:return new Promise(function(e,t){v(!0,e,t)})}if(3===o){return new Promise(function(e,t){null!==n.provider&&n.provider.get(a,function(r,n){try{r||!n?t(r):(i||(n=y(n)),e(h(n)))}catch(e){t(e)}})}).then(function(){return new Promise(function(e,t){v(!0,e,t)})}).catch(function(e){return new Promise(function(e,t){v(!0,e,t)})})}}Object.defineProperty(t,"__esModule",{value:!0});var p="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e};t.transform=o,t._type=i,t.mergeDeep=s,t.merge=u,t.isBrowser=a,t.parseQueryFromParams=c,t.getHash=f,t.generateHash=l,t.resultWrapper=y,t.spreadResult=h,t.sendRequest=d;var v=r(2),_=n(v),m=r(17),b=n(m);!function(){Promise.prototype.spread||(Promise.prototype.spread=function(e,t){return t=t||function(e){},this.then(function(t){return e.apply(e,t)}).catch(function(e){t(e)})})}()}).call(t,r(4))},function(e,t,r){"use strict";function n(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}function o(e){return e&&e.__esModule?e:{default:e}}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(t,"__esModule",{value:!0});var s="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},u=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}(),a=r(9),c=o(a),f=r(0),l=n(f),y=r(6),h=o(y),d=r(16),p=o(d),v=r(7),_=o(v),m=r(2),b=o(m),g=r(5),q=(n(g),r(3)),w=o(q),O=function(){function e(){i(this,e);for(var t=arguments.length,r=Array(t),n=0;n<t;n++)r[n]=arguments[n];switch(r[0].region&&void 0!==r[0].region&&"us"!==r[0].region&&(c.default.host=r[0].region+"-cdn.contentstack.com"),r[0].fetchOptions&&void 0!==r[0].fetchOptions&&(this.fetchOptions=r[0].fetchOptions),this.config=c.default,this.cachePolicy=w.default.policies.IGNORE_CACHE,this.provider=w.default.providers("localstorage"),r.length){case 1:if("object"===s(r[0])&&"string"==typeof r[0].api_key&&"string"==typeof r[0].delivery_token&&"string"==typeof r[0].environment)return this.headers={api_key:r[0].api_key,access_token:r[0].delivery_token},this.environment=r[0].environment,this;console.error("Kindly provide valid object parameters. The specified API Key, Delivery Token, or Environment Name is invalid.");case 3:if("string"==typeof r[0]&&"string"==typeof r[1]&&"string"==typeof r[2])return this.headers={api_key:r[0],access_token:r[1]},this.environment=r[2],this;console.error("Kindly provide valid string parameters.");case 4:return"string"==typeof r[0]&&"string"==typeof r[1]&&"string"==typeof r[2]?(this.headers={api_key:r[0],access_token:r[1]},this.environment=r[2]):console.error("Kindly provide valid string parameters."),r[3]&&("string"==typeof r[3]&&"us"!==r[3]?c.default.host=r[3]+"-cdn.contentstack.com":"object"===s(r[3])&&(this.fetchOptions=r[3])),this.config=c.default,this;case 5:return"string"==typeof r[0]&&"string"==typeof r[1]&&"string"==typeof r[2]?(this.headers={api_key:r[0],access_token:r[1]},this.environment=r[2]):console.error("Kindly provide valid string parameters."),r[3]&&("string"==typeof r[3]&&"us"!==r[3]?c.default.host=r[3]+"-cdn.contentstack.com":"object"===s(r[3])&&(this.fetchOptions=r[3])),r[4]&&"object"===s(r[4])&&(this.fetchOptions=r[4]),this.config=c.default,this;default:console.error("Kindly provide valid parameters to initialize the Contentstack javascript-SDK Stack.")}}return u(e,[{key:"setPort",value:function(e){return"number"==typeof e&&(this.config.port=e),this}},{key:"setProtocol",value:function(e){return"string"==typeof e&&~["https","http"].indexOf(e)&&(this.config.protocol=e),this}},{key:"setHost",value:function(e){return"string"==typeof e&&e&&(this.config.host=e),this}},{key:"setCachePolicy",value:function(e){return"number"==typeof e&&e>=-1&&e<4?this._query?this.queryCachePolicy=e:this.cachePolicy=e:console.error("Kindly provide the valid policy"),this}},{key:"setCacheProvider",value:function(e){return e&&"object"===(void 0===e?"undefined":s(e))&&(this.provider=e),this}},{key:"clearByQuery",value:function(){if(this.provider&&"function"==typeof this.provider.clearByQuery)return this.provider.clearByQuery.apply(this.provider,arguments)}},{key:"clearByContentType",value:function(){if(this.provider&&"function"==typeof this.provider.clearByContentType)return this.provider.clearByContentType.apply(this.provider,arguments)}},{key:"clearAll",value:function(){if(this.provider&&"function"==typeof this.provider.clearAll)return this.provider.clearAll.apply(this.provider,arguments)}},{key:"getCacheProvider",value:function(){return this.provider}},{key:"ContentType",value:function(e){return e&&"string"==typeof e&&(this.content_type_uid=e,this.type="contentType"),this}},{key:"Entry",value:function(e){var t=new h.default;return e&&"string"==typeof e&&(t.entry_uid=e),l.merge(t,this)}},{key:"fetch",value:function(e){var t={method:"POST",headers:this.headers,url:this.config.protocol+"://"+this.config.host+":"+this.config.port+"/"+this.config.version+this.config.urls.content_types+this.content_type_uid,body:{_method:"GET",environment:this.environment}},r=Object.assign({},this.fetchOptions,e);return(0,b.default)(t,r)}},{key:"Assets",value:function(e){if(this.type="asset",e&&"string"==typeof e){var t=new p.default;return t.asset_uid=e,l.merge(t,this)}return this}},{key:"Query",value:function(){var e=new _.default;return l.merge(e,this)}},{key:"getLastActivities",value:function(){var e={method:"POST",headers:this.headers,url:this.config.protocol+"://"+this.config.host+":"+this.config.port+"/"+this.config.version+this.config.urls.content_types,body:{_method:"GET",only_last_activity:!0,environment:this.environment}};return(0,b.default)(e,this.fetchOptions)}},{key:"getContentTypes",value:function(e){var t={method:"POST",headers:this.headers,url:this.config.protocol+"://"+this.config.host+":"+this.config.port+"/"+this.config.version+this.config.urls.content_types,body:{_method:"GET",environment:this.environment}};if(e&&void 0!==e)for(var r in e)t.body[r]=e[r];return(0,b.default)(t,this.fetchOptions)}},{key:"sync",value:function(e,t){this._query={},this._query=Object.assign(this._query,e),this.requestParams={method:"POST",headers:this.headers,url:this.config.protocol+"://"+this.config.host+":"+this.config.port+"/"+this.config.version+this.config.urls.sync,body:{_method:"GET",query:this._query}};var r=Object.assign({},this.fetchOptions,t);return l.sendRequest(this,r)}},{key:"imageTransform",value:function(e,t){if(e&&"string"==typeof e&&"object"===(void 0===t?"undefined":s(t))&&void 0===t.length){var r=[];for(var n in t)r.push(n+"="+t[n]);e+=e.indexOf("?")<=-1?"?"+r.join("&"):"&"+r.join("&")}return e}}]),e}();t.default=O},function(e,t,r){"use strict";function n(e,t){return new Promise(function(r,n){var i=void 0,s=e.url,c=e.headers;c["Content-Type"]="application/json; charset=UTF-8",c["X-User-Agent"]="contentstack-web/"+a,e.body&&"object"===o(e.body)&&(delete e.body._method,"object"===o(e.body.query)&&0===Object.keys(e.body.query).length&&delete e.body.query,i=function e(t,r){var n=[],i=void 0;if("object"===(void 0===t?"undefined":o(t))&&void 0!==t.length)for(var s=0,u=t.length;s<u;s++)n.push(r+"[]="+t[s]);else for(i in t){var a=r?r+"["+i+"]":i,c=t[i];n.push(null!==c&&"object"===(void 0===c?"undefined":o(c))&&"query"!==i?e(c,a):a+"="+encodeURIComponent("query"!==i?c:JSON.stringify(c)))}return n.join("&")}(e.body));var f=Object.assign({method:"GET",headers:c},t);(0,u.default)(s+"?"+i,f).then(function(e){if(e.ok&&200===e.status){var t=e.json();r(t)}else n(e.statusText)}).catch(function(e){console.log("Error: ",e),n(e)})})}Object.defineProperty(t,"__esModule",{value:!0});var o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e};t.default=n;var i=r(0),s=(function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);t.default=e}(i),r(18)),u=function(e){return e&&e.__esModule?e:{default:e}}(s),a="3.10.1"},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r(14),o=function(e){return e&&e.__esModule?e:{default:e}}(n),i={};i.providers=function(e){if(e)return o.default;console.error("Kindly provide valid provider.")},i.policies={IGNORE_CACHE:-1,ONLY_NETWORK:0,CACHE_ELSE_NETWORK:1,NETWORK_ELSE_CACHE:2,CACHE_THEN_NETWORK:3},t.default=i},function(e,t,r){"use strict";function n(){throw new Error("setTimeout has not been defined")}function o(){throw new Error("clearTimeout has not been defined")}function i(e){if(l===setTimeout)return setTimeout(e,0);if((l===n||!l)&&setTimeout)return l=setTimeout,setTimeout(e,0);try{return l(e,0)}catch(t){try{return l.call(null,e,0)}catch(t){return l.call(this,e,0)}}}function s(e){if(y===clearTimeout)return clearTimeout(e);if((y===o||!y)&&clearTimeout)return y=clearTimeout,clearTimeout(e);try{return y(e)}catch(t){try{return y.call(null,e)}catch(t){return y.call(this,e)}}}function u(){v&&d&&(v=!1,d.length?p=d.concat(p):_=-1,p.length&&a())}function a(){if(!v){var e=i(u);v=!0;for(var t=p.length;t;){for(d=p,p=[];++_<t;)d&&d[_].run();_=-1,t=p.length}d=null,v=!1,s(e)}}function c(e,t){this.fun=e,this.array=t}function f(){}var l,y,h=e.exports={};!function(){try{l="function"==typeof setTimeout?setTimeout:n}catch(e){l=n}try{y="function"==typeof clearTimeout?clearTimeout:o}catch(e){y=o}}();var d,p=[],v=!1,_=-1;h.nextTick=function(e){var t=new Array(arguments.length-1);if(arguments.length>1)for(var r=1;r<arguments.length;r++)t[r-1]=arguments[r];p.push(new c(e,t)),1!==p.length||v||i(a)},c.prototype.run=function(){this.fun.apply(null,this.array)},h.title="browser",h.browser=!0,h.env={},h.argv=[],h.version="",h.versions={},h.on=f,h.addListener=f,h.once=f,h.off=f,h.removeListener=f,h.removeAllListeners=f,h.emit=f,h.prependListener=f,h.prependOnceListener=f,h.listeners=function(e){return[]},h.binding=function(e){throw new Error("process.binding is not supported")},h.cwd=function(){return"/"},h.chdir=function(e){throw new Error("process.chdir is not supported")},h.umask=function(){return 0}},function(e,t,r){"use strict";function n(e){var t=f.default.getItem(e);try{t=JSON.parse(t)}catch(e){return t}return t||null}function o(e,t){try{"object"===(void 0===t?"undefined":u(t))?f.default.setItem(e,JSON.stringify(t)):f.default.setItem(e,t)}catch(e){}}function i(){return f.default||null}function s(){return f.default?Object.keys(f.default):[]}Object.defineProperty(t,"__esModule",{value:!0});var u="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e};t.get=n,t.set=o,t.getStorage=i,t.getKeys=s;var a=r(0),c=(function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);t.default=e}(a),r(19)),f=function(e){return e&&e.__esModule?e:{default:e}}(c)},function(e,t,r){"use strict";function n(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(t,"__esModule",{value:!0});var o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},i=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}(),s=r(0),u=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}(s),a=r(1),c=(function(e){e&&e.__esModule}(a),function(){function e(){return n(this,e),this._query={},this.only=u.transform("only"),this.except=u.transform("except"),this}return i(e,[{key:"setCacheProvider",value:function(e){return e&&"object"===(void 0===e?"undefined":o(e))&&(this.provider=e),this}},{key:"setCachePolicy",value:function(e){return"number"==typeof e&&e>=-1&&e<4?this._query?this.queryCachePolicy=e:this.cachePolicy=e:console.error("Kindly provide the valid policy"),this}},{key:"includeReference",value:function(){for(var e=arguments.length,t=Array(e),r=0;r<e;r++)t[r]=arguments[r];if(Array.isArray(t)||"string"==typeof t){if(arguments.length)for(var n=0;n<arguments.length;n++)this._query.include=this._query.include||[],this._query.include=this._query.include.concat(arguments[n]);return this}console.error("Argument should be a String or an Array.")}},{key:"language",value:function(e){if(e&&"string"==typeof e)return this._query.locale=e,this;console.error("Argument should be a String.")}},{key:"addQuery",value:function(e,t){if(e&&t&&"string"==typeof e)return this._query[e]=t,this;console.error("First argument should be a String.")}},{key:"includeSchema",value:function(){return this._query.include_schema=!0,this}},{key:"includeReferenceContentTypeUID",value:function(){return this._query.include_reference_content_type_uid=!0,this}},{key:"includeContentType",value:function(){return this._query.include_content_type=!0,this}},{key:"includeOwner",value:function(){return this._query.include_owner=!0,this}},{key:"toJSON",value:function(){return this.tojson=!0,this}},{key:"addParam",value:function(e,t){if(e&&t&&"string"==typeof e&&"string"==typeof t)return this._query[e]=t,this;console.error("Kindly provide valid parameters.")}},{key:"fetch",value:function(e){if(this.entry_uid){this.requestParams={method:"POST",headers:this.headers,url:this.config.protocol+"://"+this.config.host+":"+this.config.port+"/"+this.config.version+this.config.urls.content_types+this.content_type_uid+this.config.urls.entries+this.entry_uid,body:{_method:"GET",query:this._query}};var t=Object.assign({},this.fetchOptions,e);return u.sendRequest(this,t)}console.error("Kindly provide an entry uid. e.g. .Entry('bltsomething123')")}}]),e}());t.default=c},function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function i(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function s(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0});var u=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}(),a="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},c=r(2),f=(n(c),r(0)),l=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}(f),y=r(6),h=n(y),d={compare:function(e){return function(t,r){if(t&&r&&"string"==typeof t&&void 0!==r)return this._query.query[t]=this._query.query.file_size||{},this._query.query[t][e]=r,this;console.error("Kindly provide valid parameters.")}},contained:function(e){var t=e?"$in":"$nin";return function(e,r){if(e&&r&&"string"==typeof e&&Array.isArray(r))return this._query.query[e]=this._query.query[e]||{},this._query.query[e][t]=this._query.query[e][t]||[],this._query.query[e][t]=this._query.query[e][t].concat(r),this;console.error("Kindly provide valid parameters.")}},exists:function(e){return function(t){if(t&&"string"==typeof t)return this._query.query[t]=this._query.query[t]||{},this._query.query[t].$exists=e,this;console.error("Kindly provide valid parameters.")}},logical:function(e){return function(){for(var t=[],r=0,n=arguments.length;r<n;r++)arguments[r]instanceof p&&arguments[r]._query.query?t.push(arguments[r]._query.query):"object"===a(arguments[r])&&t.push(arguments[r]);return this._query.query[e]?this._query.query[e]=this._query.query[e].concat(t):this._query.query[e]=t,this}},sort:function(e){return function(t){if(t&&"string"==typeof t)return this._query[e]=t,this;console.error("Argument should be a string.")}},pagination:function(e){return function(t){if("number"==typeof t)return this._query[e]=t,this;console.error("Argument should be a number.")}}},p=function(e){function t(){o(this,t);var e=i(this,(t.__proto__||Object.getPrototypeOf(t)).call(this));return e._query=e._query||{},e._query.query=e._query.query||{},e.lessThan=d.compare("$lt"),e.lessThanOrEqualTo=d.compare("$lte"),e.greaterThan=d.compare("$gt"),e.greaterThanOrEqualTo=d.compare("$gte"),e.notEqualTo=d.compare("$ne"),e.containedIn=d.contained(!0),e.notContainedIn=d.contained(!1),e.exists=d.exists(!0),e.notExists=d.exists(!1),e.ascending=d.sort("asc"),e.descending=d.sort("desc"),e.beforeUid=d.sort("before_uid"),e.afterUid=d.sort("after_uid"),e.skip=d.pagination("skip"),e.limit=d.pagination("limit"),e.or=d.logical("$or"),e.and=d.logical("$and"),e}return s(t,e),u(t,[{key:"equalTo",value:function(e,t){if(e&&"string"==typeof e)return this._query.query[e]=t,this;console.error("Kindly provide valid parameters.")}},{key:"where",value:function(e,t){if(e&&"string"==typeof e)return this._query.query[e]=t,this;console.error("Kindly provide valid parameters.")}},{key:"count",value:function(){var e=this.config.protocol+"://"+this.config.host+":"+this.config.port+"/"+this.config.version,t=this.type&&"asset"===this.type?e+this.config.urls.assets:e+this.config.urls.content_types+this.content_type_uid+this.config.urls.entries;return this._query.count=!0,this.requestParams={method:"POST",headers:this.headers,url:t,body:{_method:"GET",query:this._query}},this}},{key:"query",value:function(e){if("object"===(void 0===e?"undefined":a(e)))return this._query.query=l.mergeDeep(this._query.query,e),this;console.error("Kindly provide valid parameters")}},{key:"referenceIn",value:function(e,r){var n={};return r instanceof t&&r._query.query?n.$in_query=r._query.query:"object"===(void 0===r?"undefined":a(r))&&(n.$in_query=r),this._query.query[e]?this._query.query[e]=this._query.query[e].concat(n):this._query.query[e]=n,this}},{key:"referenceNotIn",value:function(e,r){var n={};return r instanceof t&&r._query.query?n.$nin_query=r._query.query:"object"===(void 0===r?"undefined":a(r))&&(n.$nin_query=r),this._query.query[e]?this._query.query[e]=this._query.query[e].concat(n):this._query.query[e]=n,this}},{key:"tags",value:function(e){if(Array.isArray(e))return this._query.tags=e,this;console.error("Kindly provide valid parameters")}},{key:"includeReferenceContentTypeUID",value:function(){return this._query.include_reference_content_type_uid=!0,this}},{key:"includeCount",value:function(){return this._query.include_count=!0,this}},{key:"addParam",value:function(e,t){if(e&&t&&"string"==typeof e&&"string"==typeof t)return this._query[e]=t,this;console.error("Kindly provide valid parameters.")}},{key:"getQuery",value:function(){return this._query.query||{}}},{key:"regex",value:function(e,t,r){if(e&&t&&"string"==typeof e&&"string"==typeof t)return this._query.query[e]={$regex:t},r&&(this._query.query[e].$options=r),this;console.error("Kindly provide valid parameters.")}},{key:"search",value:function(e){if(e&&"string"==typeof e)return this._query.typeahead=e,this;console.error("Kindly provide valid parameters.")}},{key:"find",value:function(e){var t=this.config.protocol+"://"+this.config.host+":"+this.config.port+"/"+this.config.version,r=this.type&&"asset"===this.type?t+this.config.urls.assets:t+this.config.urls.content_types+this.content_type_uid+this.config.urls.entries;this.requestParams={method:"POST",headers:this.headers,url:r,body:{_method:"GET",query:this._query}};var n=Object.assign({},this.fetchOptions,e);return l.sendRequest(this,n)}},{key:"findOne",value:function(){var e=this.config.protocol+"://"+this.config.host+":"+this.config.port+"/"+this.config.version,t=this.type&&"asset"===this.type?e+this.config.urls.assets:e+this.config.urls.content_types+this.content_type_uid+this.config.urls.entries;this.singleEntry=!0,this._query.limit=1,this.requestParams={method:"POST",headers:this.headers,url:t,body:{_method:"GET",query:this._query}};var r=Object.assign({},this.fetchOptions);return l.sendRequest(this,r)}}]),t}(h.default);t.default=p},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n={EU:"eu",US:"us"};t.default=n},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n={protocol:"https",host:"cdn.contentstack.io",port:443,version:"v3",urls:{sync:"/stacks/sync",content_types:"/content_types/",entries:"/entries/",assets:"/assets/",environments:"/environments/"}};t.default=n},function(e,t,r){"use strict";(function(n,o){var i,s,u="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e};/*! | ||
* @overview es6-promise - a tiny implementation of Promises/A+. | ||
@@ -8,2 +8,2 @@ * @copyright Copyright (c) 2014 Yehuda Katz, Tom Dale, Stefan Penner and contributors (Conversion to ES6 API by Jake Archibald) | ||
*/ | ||
!function(n,o){"object"===u(t)&&void 0!==e?e.exports=o():(i=o,void 0!==(s="function"==typeof i?i.call(t,r,t,e):i)&&(e.exports=s))}(0,function(){function e(e){var t=void 0===e?"undefined":u(e);return null!==e&&("object"===t||"function"===t)}function t(e){return"function"==typeof e}function i(e){J=e}function s(e){Q=e}function a(){return void 0!==G?function(){G(f)}:c()}function c(){var e=setTimeout;return function(){return e(f,1)}}function f(){for(var e=0;e<$;e+=2){(0,Z[e])(Z[e+1]),Z[e]=void 0,Z[e+1]=void 0}$=0}function l(e,t){var r=arguments,n=this,o=new this.constructor(h);void 0===o[te]&&C(o);var i=n._state;return i?function(){var e=r[i-1];Q(function(){return E(i,o,e,n._result)})}():j(n,o,e,t),o}function y(e){var t=this;if(e&&"object"===(void 0===e?"undefined":u(e))&&e.constructor===t)return e;var r=new t(h);return q(r,e),r}function h(){}function d(){return new TypeError("You cannot resolve a promise with itself")}function p(){return new TypeError("A promises callback cannot return that same promise.")}function v(e){try{return e.then}catch(e){return ie.error=e,ie}}function _(e,t,r,n){try{e.call(t,r,n)}catch(e){return e}}function m(e,t,r){Q(function(e){var n=!1,o=_(r,t,function(r){n||(n=!0,t!==r?q(e,r):O(e,r))},function(t){n||(n=!0,P(e,t))},"Settle: "+(e._label||" unknown promise"));!n&&o&&(n=!0,P(e,o))},e)}function b(e,t){t._state===ne?O(e,t._result):t._state===oe?P(e,t._result):j(t,void 0,function(t){return q(e,t)},function(t){return P(e,t)})}function g(e,r,n){r.constructor===e.constructor&&n===l&&r.constructor.resolve===y?b(e,r):n===ie?(P(e,ie.error),ie.error=null):void 0===n?O(e,r):t(n)?m(e,r,n):O(e,r)}function q(t,r){t===r?P(t,d()):e(r)?g(t,r,v(r)):O(t,r)}function w(e){e._onerror&&e._onerror(e._result),T(e)}function O(e,t){e._state===re&&(e._result=t,e._state=ne,0!==e._subscribers.length&&Q(T,e))}function P(e,t){e._state===re&&(e._state=oe,e._result=t,Q(w,e))}function j(e,t,r,n){var o=e._subscribers,i=o.length;e._onerror=null,o[i]=t,o[i+ne]=r,o[i+oe]=n,0===i&&e._state&&Q(T,e)}function T(e){var t=e._subscribers,r=e._state;if(0!==t.length){for(var n=void 0,o=void 0,i=e._result,s=0;s<t.length;s+=3)n=t[s],o=t[s+r],n?E(r,n,o,i):o(i);e._subscribers.length=0}}function k(){this.error=null}function S(e,t){try{return e(t)}catch(e){return se.error=e,se}}function E(e,r,n,o){var i=t(n),s=void 0,u=void 0,a=void 0,c=void 0;if(i){if(s=S(n,o),s===se?(c=!0,u=s.error,s.error=null):a=!0,r===s)return void P(r,p())}else s=o,a=!0;r._state!==re||(i&&a?q(r,s):c?P(r,u):e===ne?O(r,s):e===oe&&P(r,s))}function A(e,t){try{t(function(t){q(e,t)},function(t){P(e,t)})}catch(t){P(e,t)}}function x(){return ue++}function C(e){e[te]=ue++,e._state=void 0,e._result=void 0,e._subscribers=[]}function B(e,t){this._instanceConstructor=e,this.promise=new e(h),this.promise[te]||C(this.promise),H(t)?(this.length=t.length,this._remaining=t.length,this._result=new Array(this.length),0===this.length?O(this.promise,this._result):(this.length=this.length||0,this._enumerate(t),0===this._remaining&&O(this.promise,this._result))):P(this.promise,M())}function M(){return new Error("Array Methods must be provided an Array")}function R(e){return new B(this,e).promise}function U(e){var t=this;return new t(H(e)?function(r,n){for(var o=e.length,i=0;i<o;i++)t.resolve(e[i]).then(r,n)}:function(e,t){return t(new TypeError("You must pass an array to race."))})}function K(e){var t=this,r=new t(h);return P(r,e),r}function N(){throw new TypeError("You must pass a resolver function as the first argument to the promise constructor")}function D(){throw new TypeError("Failed to construct 'Promise': Please use the 'new' operator, this object constructor cannot be called as a function.")}function I(e){this[te]=x(),this._result=this._state=void 0,this._subscribers=[],h!==e&&("function"!=typeof e&&N(),this instanceof I?A(this,e):D())}function F(){var e=void 0;if(void 0!==o)e=o;else if("undefined"!=typeof self)e=self;else try{e=Function("return this")()}catch(e){throw new Error("polyfill failed because global object is unavailable in this environment")}var t=e.Promise;if(t){var r=null;try{r=Object.prototype.toString.call(t.resolve())}catch(e){}if("[object Promise]"===r&&!t.cast)return}e.Promise=I}var L=void 0;L=Array.isArray?Array.isArray:function(e){return"[object Array]"===Object.prototype.toString.call(e)};var H=L,$=0,G=void 0,J=void 0,Q=function(e,t){Z[$]=e,Z[$+1]=t,2===($+=2)&&(J?J(f):ee())},W="undefined"!=typeof window?window:void 0,Y=W||{},z=Y.MutationObserver||Y.WebKitMutationObserver,X="undefined"==typeof self&&void 0!==n&&"[object process]"==={}.toString.call(n),V="undefined"!=typeof Uint8ClampedArray&&"undefined"!=typeof importScripts&&"undefined"!=typeof MessageChannel,Z=new Array(1e3),ee=void 0;ee=X?function(){return function(){return n.nextTick(f)}}():z?function(){var e=0,t=new z(f),r=document.createTextNode("");return t.observe(r,{characterData:!0}),function(){r.data=e=++e%2}}():V?function(){var e=new MessageChannel;return e.port1.onmessage=f,function(){return e.port2.postMessage(0)}}():void 0===W?function(){try{var e=r(!function(){var e=new Error('Cannot find module "vertx"');throw e.code="MODULE_NOT_FOUND",e}());return G=e.runOnLoop||e.runOnContext,a()}catch(e){return c()}}():c();var te=Math.random().toString(36).substring(16),re=void 0,ne=1,oe=2,ie=new k,se=new k,ue=0;return B.prototype._enumerate=function(e){for(var t=0;this._state===re&&t<e.length;t++)this._eachEntry(e[t],t)},B.prototype._eachEntry=function(e,t){var r=this._instanceConstructor,n=r.resolve;if(n===y){var o=v(e);if(o===l&&e._state!==re)this._settledAt(e._state,t,e._result);else if("function"!=typeof o)this._remaining--,this._result[t]=e;else if(r===I){var i=new r(h);g(i,e,o),this._willSettleAt(i,t)}else this._willSettleAt(new r(function(t){return t(e)}),t)}else this._willSettleAt(n(e),t)},B.prototype._settledAt=function(e,t,r){var n=this.promise;n._state===re&&(this._remaining--,e===oe?P(n,r):this._result[t]=r),0===this._remaining&&O(n,this._result)},B.prototype._willSettleAt=function(e,t){var r=this;j(e,void 0,function(e){return r._settledAt(ne,t,e)},function(e){return r._settledAt(oe,t,e)})},I.all=R,I.race=U,I.resolve=y,I.reject=K,I._setScheduler=i,I._setAsap=s,I._asap=Q,I.prototype={constructor:I,then:l,catch:function(e){return this.then(null,e)}},I.polyfill=F,I.Promise=I,I})}).call(t,r(4),r(12))},function(e,t,r){"use strict";r(13),e.exports=self.fetch.bind(self)},function(e,t,r){"use strict";var n,o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e};n=function(){return this}();try{n=n||Function("return this")()||(0,eval)("this")}catch(e){"object"===("undefined"==typeof window?"undefined":o(window))&&(n=window)}e.exports=n},function(e,t,r){"use strict";function n(e){return e&&DataView.prototype.isPrototypeOf(e)}function o(e){if("string"!=typeof e&&(e=String(e)),/[^a-z0-9\-#$%&'*+.^_`|~]/i.test(e))throw new TypeError("Invalid character in header field name");return e.toLowerCase()}function i(e){return"string"!=typeof e&&(e=String(e)),e}function s(e){var t={next:function(){var t=e.shift();return{done:void 0===t,value:t}}};return q.iterable&&(t[Symbol.iterator]=function(){return t}),t}function u(e){this.map={},e instanceof u?e.forEach(function(e,t){this.append(t,e)},this):Array.isArray(e)?e.forEach(function(e){this.append(e[0],e[1])},this):e&&Object.getOwnPropertyNames(e).forEach(function(t){this.append(t,e[t])},this)}function a(e){if(e.bodyUsed)return Promise.reject(new TypeError("Already read"));e.bodyUsed=!0}function c(e){return new Promise(function(t,r){e.onload=function(){t(e.result)},e.onerror=function(){r(e.error)}})}function f(e){var t=new FileReader,r=c(t);return t.readAsArrayBuffer(e),r}function l(e){var t=new FileReader,r=c(t);return t.readAsText(e),r}function y(e){for(var t=new Uint8Array(e),r=new Array(t.length),n=0;n<t.length;n++)r[n]=String.fromCharCode(t[n]);return r.join("")}function h(e){if(e.slice)return e.slice(0);var t=new Uint8Array(e.byteLength);return t.set(new Uint8Array(e)),t.buffer}function d(){return this.bodyUsed=!1,this._initBody=function(e){this._bodyInit=e,e?"string"==typeof e?this._bodyText=e:q.blob&&Blob.prototype.isPrototypeOf(e)?this._bodyBlob=e:q.formData&&FormData.prototype.isPrototypeOf(e)?this._bodyFormData=e:q.searchParams&&URLSearchParams.prototype.isPrototypeOf(e)?this._bodyText=e.toString():q.arrayBuffer&&q.blob&&n(e)?(this._bodyArrayBuffer=h(e.buffer),this._bodyInit=new Blob([this._bodyArrayBuffer])):q.arrayBuffer&&(ArrayBuffer.prototype.isPrototypeOf(e)||O(e))?this._bodyArrayBuffer=h(e):this._bodyText=e=Object.prototype.toString.call(e):this._bodyText="",this.headers.get("content-type")||("string"==typeof e?this.headers.set("content-type","text/plain;charset=UTF-8"):this._bodyBlob&&this._bodyBlob.type?this.headers.set("content-type",this._bodyBlob.type):q.searchParams&&URLSearchParams.prototype.isPrototypeOf(e)&&this.headers.set("content-type","application/x-www-form-urlencoded;charset=UTF-8"))},q.blob&&(this.blob=function(){var e=a(this);if(e)return e;if(this._bodyBlob)return Promise.resolve(this._bodyBlob);if(this._bodyArrayBuffer)return Promise.resolve(new Blob([this._bodyArrayBuffer]));if(this._bodyFormData)throw new Error("could not read FormData body as blob");return Promise.resolve(new Blob([this._bodyText]))},this.arrayBuffer=function(){return this._bodyArrayBuffer?a(this)||Promise.resolve(this._bodyArrayBuffer):this.blob().then(f)}),this.text=function(){var e=a(this);if(e)return e;if(this._bodyBlob)return l(this._bodyBlob);if(this._bodyArrayBuffer)return Promise.resolve(y(this._bodyArrayBuffer));if(this._bodyFormData)throw new Error("could not read FormData body as text");return Promise.resolve(this._bodyText)},q.formData&&(this.formData=function(){return this.text().then(_)}),this.json=function(){return this.text().then(JSON.parse)},this}function p(e){var t=e.toUpperCase();return P.indexOf(t)>-1?t:e}function v(e,t){t=t||{};var r=t.body;if(e instanceof v){if(e.bodyUsed)throw new TypeError("Already read");this.url=e.url,this.credentials=e.credentials,t.headers||(this.headers=new u(e.headers)),this.method=e.method,this.mode=e.mode,this.signal=e.signal,r||null==e._bodyInit||(r=e._bodyInit,e.bodyUsed=!0)}else this.url=String(e);if(this.credentials=t.credentials||this.credentials||"same-origin",!t.headers&&this.headers||(this.headers=new u(t.headers)),this.method=p(t.method||this.method||"GET"),this.mode=t.mode||this.mode||null,this.signal=t.signal||this.signal,this.referrer=null,("GET"===this.method||"HEAD"===this.method)&&r)throw new TypeError("Body not allowed for GET or HEAD requests");this._initBody(r)}function _(e){var t=new FormData;return e.trim().split("&").forEach(function(e){if(e){var r=e.split("="),n=r.shift().replace(/\+/g," "),o=r.join("=").replace(/\+/g," ");t.append(decodeURIComponent(n),decodeURIComponent(o))}}),t}function m(e){var t=new u;return e.replace(/\r?\n[\t ]+/g," ").split(/\r?\n/).forEach(function(e){var r=e.split(":"),n=r.shift().trim();if(n){var o=r.join(":").trim();t.append(n,o)}}),t}function b(e,t){t||(t={}),this.type="default",this.status=void 0===t.status?200:t.status,this.ok=this.status>=200&&this.status<300,this.statusText="statusText"in t?t.statusText:"OK",this.headers=new u(t.headers),this.url=t.url||"",this._initBody(e)}function g(e,t){return new Promise(function(r,n){function o(){s.abort()}var i=new v(e,t);if(i.signal&&i.signal.aborted)return n(new T("Aborted","AbortError"));var s=new XMLHttpRequest;s.onload=function(){var e={status:s.status,statusText:s.statusText,headers:m(s.getAllResponseHeaders()||"")};e.url="responseURL"in s?s.responseURL:e.headers.get("X-Request-URL");var t="response"in s?s.response:s.responseText;r(new b(t,e))},s.onerror=function(){n(new TypeError("Network request failed"))},s.ontimeout=function(){n(new TypeError("Network request failed"))},s.onabort=function(){n(new T("Aborted","AbortError"))},s.open(i.method,i.url,!0),"include"===i.credentials?s.withCredentials=!0:"omit"===i.credentials&&(s.withCredentials=!1),"responseType"in s&&q.blob&&(s.responseType="blob"),i.headers.forEach(function(e,t){s.setRequestHeader(t,e)}),i.signal&&(i.signal.addEventListener("abort",o),s.onreadystatechange=function(){4===s.readyState&&i.signal.removeEventListener("abort",o)}),s.send(void 0===i._bodyInit?null:i._bodyInit)})}Object.defineProperty(t,"__esModule",{value:!0}),t.Headers=u,t.Request=v,t.Response=b,t.fetch=g;var q={searchParams:"URLSearchParams"in self,iterable:"Symbol"in self&&"iterator"in Symbol,blob:"FileReader"in self&&"Blob"in self&&function(){try{return new Blob,!0}catch(e){return!1}}(),formData:"FormData"in self,arrayBuffer:"ArrayBuffer"in self};if(q.arrayBuffer)var w=["[object Int8Array]","[object Uint8Array]","[object Uint8ClampedArray]","[object Int16Array]","[object Uint16Array]","[object Int32Array]","[object Uint32Array]","[object Float32Array]","[object Float64Array]"],O=ArrayBuffer.isView||function(e){return e&&w.indexOf(Object.prototype.toString.call(e))>-1};u.prototype.append=function(e,t){e=o(e),t=i(t);var r=this.map[e];this.map[e]=r?r+", "+t:t},u.prototype.delete=function(e){delete this.map[o(e)]},u.prototype.get=function(e){return e=o(e),this.has(e)?this.map[e]:null},u.prototype.has=function(e){return this.map.hasOwnProperty(o(e))},u.prototype.set=function(e,t){this.map[o(e)]=i(t)},u.prototype.forEach=function(e,t){for(var r in this.map)this.map.hasOwnProperty(r)&&e.call(t,this.map[r],r,this)},u.prototype.keys=function(){var e=[];return this.forEach(function(t,r){e.push(r)}),s(e)},u.prototype.values=function(){var e=[];return this.forEach(function(t){e.push(t)}),s(e)},u.prototype.entries=function(){var e=[];return this.forEach(function(t,r){e.push([r,t])}),s(e)},q.iterable&&(u.prototype[Symbol.iterator]=u.prototype.entries);var P=["DELETE","GET","HEAD","OPTIONS","POST","PUT"];v.prototype.clone=function(){return new v(this,{body:this._bodyInit})},d.call(v.prototype),d.call(b.prototype),b.prototype.clone=function(){return new b(this._bodyInit,{status:this.status,statusText:this.statusText,headers:new u(this.headers),url:this.url})},b.error=function(){var e=new b(null,{status:0,statusText:""});return e.type="error",e};var j=[301,302,303,307,308];b.redirect=function(e,t){if(-1===j.indexOf(t))throw new RangeError("Invalid status code");return new b(null,{status:t,headers:{location:e}})};var T=t.DOMException=self.DOMException;try{new T}catch(e){t.DOMException=T=function(e,t){this.message=e,this.name=t;var r=Error(e);this.stack=r.stack},T.prototype=Object.create(Error.prototype),T.prototype.constructor=T}g.polyfill=!0,self.fetch||(self.fetch=g,self.Headers=u,self.Request=v,self.Response=b)},function(e,t,r){"use strict";function n(e,t){!t&&e&&e.length&&e.push("");var r=void 0,n=i.getKeys(),o=i.getStorage();if(e&&e.length){r=e.join(".");for(var s=0,u=n.length;s<u;s++)n[s]&&0===n[s].indexOf(r)&&delete o[n[s]]}else for(var a=0,c=n.length;a<c;a++)delete o[n[a]]}Object.defineProperty(t,"__esModule",{value:!0});var o=r(5),i=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}(o),s={};s.get=function(e,t){try{t(null,i.get(e))}catch(e){t(e)}},s.set=function(e,t,r){try{e&&t&&i.set(e,t),r()}catch(e){r(e)}},s.clearByContentType=function(){try{if(2===arguments.length||3===arguments.length){var e=Array.prototype.slice.call(arguments),t=e.splice(-1,1).pop(),r=[];r.push.apply(r,e),n(r),t()}}catch(e){callback(e)}},s.clearByQuery=function(e,t){try{for(var r=i.getKeys(),n=i.getStorage(),o=0,s=r.length;o<s;o++)r[o]&&~r[o].indexOf(e)&&delete n[r[o]];t()}catch(e){t(e)}},s.clearAll=function(e){try{n(),e()}catch(t){e(t)}},t.default=s},function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}var i=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}(),s=r(1),u=n(s),a=r(3),c=n(a),f=r(8),l=n(f),y=function(){function e(){o(this,e),this.CachePolicy=c.default.policies,this.Region=l.default}return i(e,[{key:"Stack",value:function(){for(var e=arguments.length,t=Array(e),r=0;r<e;r++)t[r]=arguments[r];return new(Function.prototype.bind.apply(u.default,[null].concat(t)))}}]),e}();e.exports=new y},function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(t,"__esModule",{value:!0});var i=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}(),s=r(0),u=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}(s),a=r(1),c=(n(a),r(7)),f=(n(c),function(){function e(){return o(this,e),this._query={},this.only=u.transform("only"),this}return i(e,[{key:"toJSON",value:function(){return this.tojson=!0,this}},{key:"addParam",value:function(e,t){if(e&&"string"==typeof e&&t&&"string"==typeof t)return this._query[e]=t,this;console.error("Kindly provide a valid parameters.")}},{key:"fetch",value:function(e){if(this.asset_uid){this.requestParams={method:"POST",headers:this.headers,url:this.config.protocol+"://"+this.config.host+":"+this.config.port+"/"+this.config.version+this.config.urls.assets+this.asset_uid,body:{_method:"GET",query:this._query}};var t=Object.assign({},this.fetchOptions,fetchOptions);return u.sendRequest(this,t)}console.error("Kindly provide an asset uid. e.g. .Assets('bltsomething123')")}}]),e}());t.default=f},function(e,t,r){"use strict";function n(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}var o=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}(),i=r(0),s=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}(i),u=function(){function e(t){return n(this,e),t&&(this.object=function(){return t}),this}return o(e,[{key:"toJSON",value:function(){return this.object()?s.mergeDeep(JSON.parse(JSON.stringify({})),this.object()):null}},{key:"get",value:function(e){if(this.object()&&e){return e.split(".").reduce(function(e,t){return e[t]},this.object())}}},{key:"getDownloadUrl",value:function(e){if(this.object()){var t=this.object().url?this.object().url:null,r=e&&"string"==typeof e?e:"attachment";return t?t+"?disposition="+r:null}}}]),e}();e.exports=function(e){return new u(e)}},function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var o=r(10),i=n(o),s=r(11),u=n(s);i.default.polyfill(),t.default=u.default},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.default=function(){try{return window.localStorage}catch(e){return null}}()}])}); | ||
!function(n,o){"object"===u(t)&&void 0!==e?e.exports=o():(i=o,void 0!==(s="function"==typeof i?i.call(t,r,t,e):i)&&(e.exports=s))}(0,function(){function e(e){var t=void 0===e?"undefined":u(e);return null!==e&&("object"===t||"function"===t)}function t(e){return"function"==typeof e}function i(e){J=e}function s(e){Q=e}function a(){return void 0!==G?function(){G(f)}:c()}function c(){var e=setTimeout;return function(){return e(f,1)}}function f(){for(var e=0;e<$;e+=2){(0,Z[e])(Z[e+1]),Z[e]=void 0,Z[e+1]=void 0}$=0}function l(e,t){var r=arguments,n=this,o=new this.constructor(h);void 0===o[te]&&C(o);var i=n._state;return i?function(){var e=r[i-1];Q(function(){return E(i,o,e,n._result)})}():j(n,o,e,t),o}function y(e){var t=this;if(e&&"object"===(void 0===e?"undefined":u(e))&&e.constructor===t)return e;var r=new t(h);return q(r,e),r}function h(){}function d(){return new TypeError("You cannot resolve a promise with itself")}function p(){return new TypeError("A promises callback cannot return that same promise.")}function v(e){try{return e.then}catch(e){return ie.error=e,ie}}function _(e,t,r,n){try{e.call(t,r,n)}catch(e){return e}}function m(e,t,r){Q(function(e){var n=!1,o=_(r,t,function(r){n||(n=!0,t!==r?q(e,r):O(e,r))},function(t){n||(n=!0,P(e,t))},"Settle: "+(e._label||" unknown promise"));!n&&o&&(n=!0,P(e,o))},e)}function b(e,t){t._state===ne?O(e,t._result):t._state===oe?P(e,t._result):j(t,void 0,function(t){return q(e,t)},function(t){return P(e,t)})}function g(e,r,n){r.constructor===e.constructor&&n===l&&r.constructor.resolve===y?b(e,r):n===ie?(P(e,ie.error),ie.error=null):void 0===n?O(e,r):t(n)?m(e,r,n):O(e,r)}function q(t,r){t===r?P(t,d()):e(r)?g(t,r,v(r)):O(t,r)}function w(e){e._onerror&&e._onerror(e._result),T(e)}function O(e,t){e._state===re&&(e._result=t,e._state=ne,0!==e._subscribers.length&&Q(T,e))}function P(e,t){e._state===re&&(e._state=oe,e._result=t,Q(w,e))}function j(e,t,r,n){var o=e._subscribers,i=o.length;e._onerror=null,o[i]=t,o[i+ne]=r,o[i+oe]=n,0===i&&e._state&&Q(T,e)}function T(e){var t=e._subscribers,r=e._state;if(0!==t.length){for(var n=void 0,o=void 0,i=e._result,s=0;s<t.length;s+=3)n=t[s],o=t[s+r],n?E(r,n,o,i):o(i);e._subscribers.length=0}}function k(){this.error=null}function S(e,t){try{return e(t)}catch(e){return se.error=e,se}}function E(e,r,n,o){var i=t(n),s=void 0,u=void 0,a=void 0,c=void 0;if(i){if(s=S(n,o),s===se?(c=!0,u=s.error,s.error=null):a=!0,r===s)return void P(r,p())}else s=o,a=!0;r._state!==re||(i&&a?q(r,s):c?P(r,u):e===ne?O(r,s):e===oe&&P(r,s))}function A(e,t){try{t(function(t){q(e,t)},function(t){P(e,t)})}catch(t){P(e,t)}}function x(){return ue++}function C(e){e[te]=ue++,e._state=void 0,e._result=void 0,e._subscribers=[]}function B(e,t){this._instanceConstructor=e,this.promise=new e(h),this.promise[te]||C(this.promise),H(t)?(this.length=t.length,this._remaining=t.length,this._result=new Array(this.length),0===this.length?O(this.promise,this._result):(this.length=this.length||0,this._enumerate(t),0===this._remaining&&O(this.promise,this._result))):P(this.promise,M())}function M(){return new Error("Array Methods must be provided an Array")}function R(e){return new B(this,e).promise}function U(e){var t=this;return new t(H(e)?function(r,n){for(var o=e.length,i=0;i<o;i++)t.resolve(e[i]).then(r,n)}:function(e,t){return t(new TypeError("You must pass an array to race."))})}function K(e){var t=this,r=new t(h);return P(r,e),r}function N(){throw new TypeError("You must pass a resolver function as the first argument to the promise constructor")}function D(){throw new TypeError("Failed to construct 'Promise': Please use the 'new' operator, this object constructor cannot be called as a function.")}function I(e){this[te]=x(),this._result=this._state=void 0,this._subscribers=[],h!==e&&("function"!=typeof e&&N(),this instanceof I?A(this,e):D())}function F(){var e=void 0;if(void 0!==o)e=o;else if("undefined"!=typeof self)e=self;else try{e=Function("return this")()}catch(e){throw new Error("polyfill failed because global object is unavailable in this environment")}var t=e.Promise;if(t){var r=null;try{r=Object.prototype.toString.call(t.resolve())}catch(e){}if("[object Promise]"===r&&!t.cast)return}e.Promise=I}var L=void 0;L=Array.isArray?Array.isArray:function(e){return"[object Array]"===Object.prototype.toString.call(e)};var H=L,$=0,G=void 0,J=void 0,Q=function(e,t){Z[$]=e,Z[$+1]=t,2===($+=2)&&(J?J(f):ee())},W="undefined"!=typeof window?window:void 0,Y=W||{},z=Y.MutationObserver||Y.WebKitMutationObserver,X="undefined"==typeof self&&void 0!==n&&"[object process]"==={}.toString.call(n),V="undefined"!=typeof Uint8ClampedArray&&"undefined"!=typeof importScripts&&"undefined"!=typeof MessageChannel,Z=new Array(1e3),ee=void 0;ee=X?function(){return function(){return n.nextTick(f)}}():z?function(){var e=0,t=new z(f),r=document.createTextNode("");return t.observe(r,{characterData:!0}),function(){r.data=e=++e%2}}():V?function(){var e=new MessageChannel;return e.port1.onmessage=f,function(){return e.port2.postMessage(0)}}():void 0===W?function(){try{var e=r(!function(){var e=new Error('Cannot find module "vertx"');throw e.code="MODULE_NOT_FOUND",e}());return G=e.runOnLoop||e.runOnContext,a()}catch(e){return c()}}():c();var te=Math.random().toString(36).substring(16),re=void 0,ne=1,oe=2,ie=new k,se=new k,ue=0;return B.prototype._enumerate=function(e){for(var t=0;this._state===re&&t<e.length;t++)this._eachEntry(e[t],t)},B.prototype._eachEntry=function(e,t){var r=this._instanceConstructor,n=r.resolve;if(n===y){var o=v(e);if(o===l&&e._state!==re)this._settledAt(e._state,t,e._result);else if("function"!=typeof o)this._remaining--,this._result[t]=e;else if(r===I){var i=new r(h);g(i,e,o),this._willSettleAt(i,t)}else this._willSettleAt(new r(function(t){return t(e)}),t)}else this._willSettleAt(n(e),t)},B.prototype._settledAt=function(e,t,r){var n=this.promise;n._state===re&&(this._remaining--,e===oe?P(n,r):this._result[t]=r),0===this._remaining&&O(n,this._result)},B.prototype._willSettleAt=function(e,t){var r=this;j(e,void 0,function(e){return r._settledAt(ne,t,e)},function(e){return r._settledAt(oe,t,e)})},I.all=R,I.race=U,I.resolve=y,I.reject=K,I._setScheduler=i,I._setAsap=s,I._asap=Q,I.prototype={constructor:I,then:l,catch:function(e){return this.then(null,e)}},I.polyfill=F,I.Promise=I,I})}).call(t,r(4),r(12))},function(e,t,r){"use strict";r(13),e.exports=self.fetch.bind(self)},function(e,t,r){"use strict";var n,o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e};n=function(){return this}();try{n=n||Function("return this")()||(0,eval)("this")}catch(e){"object"===("undefined"==typeof window?"undefined":o(window))&&(n=window)}e.exports=n},function(e,t,r){"use strict";function n(e){return e&&DataView.prototype.isPrototypeOf(e)}function o(e){if("string"!=typeof e&&(e=String(e)),/[^a-z0-9\-#$%&'*+.^_`|~]/i.test(e))throw new TypeError("Invalid character in header field name");return e.toLowerCase()}function i(e){return"string"!=typeof e&&(e=String(e)),e}function s(e){var t={next:function(){var t=e.shift();return{done:void 0===t,value:t}}};return q.iterable&&(t[Symbol.iterator]=function(){return t}),t}function u(e){this.map={},e instanceof u?e.forEach(function(e,t){this.append(t,e)},this):Array.isArray(e)?e.forEach(function(e){this.append(e[0],e[1])},this):e&&Object.getOwnPropertyNames(e).forEach(function(t){this.append(t,e[t])},this)}function a(e){if(e.bodyUsed)return Promise.reject(new TypeError("Already read"));e.bodyUsed=!0}function c(e){return new Promise(function(t,r){e.onload=function(){t(e.result)},e.onerror=function(){r(e.error)}})}function f(e){var t=new FileReader,r=c(t);return t.readAsArrayBuffer(e),r}function l(e){var t=new FileReader,r=c(t);return t.readAsText(e),r}function y(e){for(var t=new Uint8Array(e),r=new Array(t.length),n=0;n<t.length;n++)r[n]=String.fromCharCode(t[n]);return r.join("")}function h(e){if(e.slice)return e.slice(0);var t=new Uint8Array(e.byteLength);return t.set(new Uint8Array(e)),t.buffer}function d(){return this.bodyUsed=!1,this._initBody=function(e){this._bodyInit=e,e?"string"==typeof e?this._bodyText=e:q.blob&&Blob.prototype.isPrototypeOf(e)?this._bodyBlob=e:q.formData&&FormData.prototype.isPrototypeOf(e)?this._bodyFormData=e:q.searchParams&&URLSearchParams.prototype.isPrototypeOf(e)?this._bodyText=e.toString():q.arrayBuffer&&q.blob&&n(e)?(this._bodyArrayBuffer=h(e.buffer),this._bodyInit=new Blob([this._bodyArrayBuffer])):q.arrayBuffer&&(ArrayBuffer.prototype.isPrototypeOf(e)||O(e))?this._bodyArrayBuffer=h(e):this._bodyText=e=Object.prototype.toString.call(e):this._bodyText="",this.headers.get("content-type")||("string"==typeof e?this.headers.set("content-type","text/plain;charset=UTF-8"):this._bodyBlob&&this._bodyBlob.type?this.headers.set("content-type",this._bodyBlob.type):q.searchParams&&URLSearchParams.prototype.isPrototypeOf(e)&&this.headers.set("content-type","application/x-www-form-urlencoded;charset=UTF-8"))},q.blob&&(this.blob=function(){var e=a(this);if(e)return e;if(this._bodyBlob)return Promise.resolve(this._bodyBlob);if(this._bodyArrayBuffer)return Promise.resolve(new Blob([this._bodyArrayBuffer]));if(this._bodyFormData)throw new Error("could not read FormData body as blob");return Promise.resolve(new Blob([this._bodyText]))},this.arrayBuffer=function(){return this._bodyArrayBuffer?a(this)||Promise.resolve(this._bodyArrayBuffer):this.blob().then(f)}),this.text=function(){var e=a(this);if(e)return e;if(this._bodyBlob)return l(this._bodyBlob);if(this._bodyArrayBuffer)return Promise.resolve(y(this._bodyArrayBuffer));if(this._bodyFormData)throw new Error("could not read FormData body as text");return Promise.resolve(this._bodyText)},q.formData&&(this.formData=function(){return this.text().then(_)}),this.json=function(){return this.text().then(JSON.parse)},this}function p(e){var t=e.toUpperCase();return P.indexOf(t)>-1?t:e}function v(e,t){t=t||{};var r=t.body;if(e instanceof v){if(e.bodyUsed)throw new TypeError("Already read");this.url=e.url,this.credentials=e.credentials,t.headers||(this.headers=new u(e.headers)),this.method=e.method,this.mode=e.mode,this.signal=e.signal,r||null==e._bodyInit||(r=e._bodyInit,e.bodyUsed=!0)}else this.url=String(e);if(this.credentials=t.credentials||this.credentials||"same-origin",!t.headers&&this.headers||(this.headers=new u(t.headers)),this.method=p(t.method||this.method||"GET"),this.mode=t.mode||this.mode||null,this.signal=t.signal||this.signal,this.referrer=null,("GET"===this.method||"HEAD"===this.method)&&r)throw new TypeError("Body not allowed for GET or HEAD requests");this._initBody(r)}function _(e){var t=new FormData;return e.trim().split("&").forEach(function(e){if(e){var r=e.split("="),n=r.shift().replace(/\+/g," "),o=r.join("=").replace(/\+/g," ");t.append(decodeURIComponent(n),decodeURIComponent(o))}}),t}function m(e){var t=new u;return e.replace(/\r?\n[\t ]+/g," ").split(/\r?\n/).forEach(function(e){var r=e.split(":"),n=r.shift().trim();if(n){var o=r.join(":").trim();t.append(n,o)}}),t}function b(e,t){t||(t={}),this.type="default",this.status=void 0===t.status?200:t.status,this.ok=this.status>=200&&this.status<300,this.statusText="statusText"in t?t.statusText:"OK",this.headers=new u(t.headers),this.url=t.url||"",this._initBody(e)}function g(e,t){return new Promise(function(r,n){function o(){s.abort()}var i=new v(e,t);if(i.signal&&i.signal.aborted)return n(new T("Aborted","AbortError"));var s=new XMLHttpRequest;s.onload=function(){var e={status:s.status,statusText:s.statusText,headers:m(s.getAllResponseHeaders()||"")};e.url="responseURL"in s?s.responseURL:e.headers.get("X-Request-URL");var t="response"in s?s.response:s.responseText;r(new b(t,e))},s.onerror=function(){n(new TypeError("Network request failed"))},s.ontimeout=function(){n(new TypeError("Network request failed"))},s.onabort=function(){n(new T("Aborted","AbortError"))},s.open(i.method,i.url,!0),"include"===i.credentials?s.withCredentials=!0:"omit"===i.credentials&&(s.withCredentials=!1),"responseType"in s&&q.blob&&(s.responseType="blob"),i.headers.forEach(function(e,t){s.setRequestHeader(t,e)}),i.signal&&(i.signal.addEventListener("abort",o),s.onreadystatechange=function(){4===s.readyState&&i.signal.removeEventListener("abort",o)}),s.send(void 0===i._bodyInit?null:i._bodyInit)})}Object.defineProperty(t,"__esModule",{value:!0}),t.Headers=u,t.Request=v,t.Response=b,t.fetch=g;var q={searchParams:"URLSearchParams"in self,iterable:"Symbol"in self&&"iterator"in Symbol,blob:"FileReader"in self&&"Blob"in self&&function(){try{return new Blob,!0}catch(e){return!1}}(),formData:"FormData"in self,arrayBuffer:"ArrayBuffer"in self};if(q.arrayBuffer)var w=["[object Int8Array]","[object Uint8Array]","[object Uint8ClampedArray]","[object Int16Array]","[object Uint16Array]","[object Int32Array]","[object Uint32Array]","[object Float32Array]","[object Float64Array]"],O=ArrayBuffer.isView||function(e){return e&&w.indexOf(Object.prototype.toString.call(e))>-1};u.prototype.append=function(e,t){e=o(e),t=i(t);var r=this.map[e];this.map[e]=r?r+", "+t:t},u.prototype.delete=function(e){delete this.map[o(e)]},u.prototype.get=function(e){return e=o(e),this.has(e)?this.map[e]:null},u.prototype.has=function(e){return this.map.hasOwnProperty(o(e))},u.prototype.set=function(e,t){this.map[o(e)]=i(t)},u.prototype.forEach=function(e,t){for(var r in this.map)this.map.hasOwnProperty(r)&&e.call(t,this.map[r],r,this)},u.prototype.keys=function(){var e=[];return this.forEach(function(t,r){e.push(r)}),s(e)},u.prototype.values=function(){var e=[];return this.forEach(function(t){e.push(t)}),s(e)},u.prototype.entries=function(){var e=[];return this.forEach(function(t,r){e.push([r,t])}),s(e)},q.iterable&&(u.prototype[Symbol.iterator]=u.prototype.entries);var P=["DELETE","GET","HEAD","OPTIONS","POST","PUT"];v.prototype.clone=function(){return new v(this,{body:this._bodyInit})},d.call(v.prototype),d.call(b.prototype),b.prototype.clone=function(){return new b(this._bodyInit,{status:this.status,statusText:this.statusText,headers:new u(this.headers),url:this.url})},b.error=function(){var e=new b(null,{status:0,statusText:""});return e.type="error",e};var j=[301,302,303,307,308];b.redirect=function(e,t){if(-1===j.indexOf(t))throw new RangeError("Invalid status code");return new b(null,{status:t,headers:{location:e}})};var T=t.DOMException=self.DOMException;try{new T}catch(e){t.DOMException=T=function(e,t){this.message=e,this.name=t;var r=Error(e);this.stack=r.stack},T.prototype=Object.create(Error.prototype),T.prototype.constructor=T}g.polyfill=!0,self.fetch||(self.fetch=g,self.Headers=u,self.Request=v,self.Response=b)},function(e,t,r){"use strict";function n(e,t){!t&&e&&e.length&&e.push("");var r=void 0,n=i.getKeys(),o=i.getStorage();if(e&&e.length){r=e.join(".");for(var s=0,u=n.length;s<u;s++)n[s]&&0===n[s].indexOf(r)&&delete o[n[s]]}else for(var a=0,c=n.length;a<c;a++)delete o[n[a]]}Object.defineProperty(t,"__esModule",{value:!0});var o=r(5),i=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}(o),s={};s.get=function(e,t){try{t(null,i.get(e))}catch(e){t(e)}},s.set=function(e,t,r){try{e&&t&&i.set(e,t),r()}catch(e){r(e)}},s.clearByContentType=function(){try{if(2===arguments.length||3===arguments.length){var e=Array.prototype.slice.call(arguments),t=e.splice(-1,1).pop(),r=[];r.push.apply(r,e),n(r),t()}}catch(e){callback(e)}},s.clearByQuery=function(e,t){try{for(var r=i.getKeys(),n=i.getStorage(),o=0,s=r.length;o<s;o++)r[o]&&~r[o].indexOf(e)&&delete n[r[o]];t()}catch(e){t(e)}},s.clearAll=function(e){try{n(),e()}catch(t){e(t)}},t.default=s},function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}var i=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}(),s=r(1),u=n(s),a=r(3),c=n(a),f=r(8),l=n(f),y=function(){function e(){o(this,e),this.CachePolicy=c.default.policies,this.Region=l.default}return i(e,[{key:"Stack",value:function(){for(var e=arguments.length,t=Array(e),r=0;r<e;r++)t[r]=arguments[r];return new(Function.prototype.bind.apply(u.default,[null].concat(t)))}}]),e}();e.exports=new y},function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(t,"__esModule",{value:!0});var i=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}(),s=r(0),u=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}(s),a=r(1),c=(n(a),r(7)),f=(n(c),function(){function e(){return o(this,e),this._query={},this.only=u.transform("only"),this}return i(e,[{key:"toJSON",value:function(){return this.tojson=!0,this}},{key:"addParam",value:function(e,t){if(e&&"string"==typeof e&&t&&"string"==typeof t)return this._query[e]=t,this;console.error("Kindly provide a valid parameters.")}},{key:"fetch",value:function(e){if(this.asset_uid){this.requestParams={method:"POST",headers:this.headers,url:this.config.protocol+"://"+this.config.host+":"+this.config.port+"/"+this.config.version+this.config.urls.assets+this.asset_uid,body:{_method:"GET",query:this._query}};var t=Object.assign({},this.fetchOptions,e);return u.sendRequest(this,t)}console.error("Kindly provide an asset uid. e.g. .Assets('bltsomething123')")}}]),e}());t.default=f},function(e,t,r){"use strict";function n(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}var o=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}(),i=r(0),s=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}(i),u=function(){function e(t){return n(this,e),t&&(this.object=function(){return t}),this}return o(e,[{key:"toJSON",value:function(){return this.object()?s.mergeDeep(JSON.parse(JSON.stringify({})),this.object()):null}},{key:"get",value:function(e){if(this.object()&&e){return e.split(".").reduce(function(e,t){return e[t]},this.object())}}},{key:"getDownloadUrl",value:function(e){if(this.object()){var t=this.object().url?this.object().url:null,r=e&&"string"==typeof e?e:"attachment";return t?t+"?disposition="+r:null}}}]),e}();e.exports=function(e){return new u(e)}},function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var o=r(10),i=n(o),s=r(11),u=n(s);i.default.polyfill(),t.default=u.default},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.default=function(){try{return window.localStorage}catch(e){return null}}()}])}); |
{ | ||
"name": "contentstack", | ||
"version": "3.10.0", | ||
"version": "3.10.1", | ||
"description": "Contentstack Javascript SDK", | ||
@@ -12,3 +12,3 @@ "homepage": "https://www.contentstack.com/", | ||
"browser": "dist/web/contentstack.js", | ||
"_id": "contentstack@3.10.0", | ||
"_id": "contentstack@3.10.1", | ||
"scripts": { | ||
@@ -48,10 +48,10 @@ "test": "tape test/index.js | tap-html --out ./tap-html.html", | ||
"shasum": "a328ed07240476a26b31a23261355dc929e1da63", | ||
"tarball": "https://registry.npmjs.org/contentstack/-/contentstack-3.10.0.tgz" | ||
"tarball": "https://registry.npmjs.org/contentstack/-/contentstack-3.10.1.tgz" | ||
}, | ||
"license": "MIT", | ||
"directories": {}, | ||
"_resolved": "https://registry.npmjs.org/contentstack/-/contentstack-3.10.0.tgz", | ||
"_resolved": "https://registry.npmjs.org/contentstack/-/contentstack-3.10.1.tgz", | ||
"_npmOperationalInternal": { | ||
"host": "packages-18-east.internal.npmjs.com", | ||
"tmp": "tmp/contentstack-3.10.0.tgz_1477830884275_0.9869455888401717" | ||
"tmp": "tmp/contentstack-3.10.1.tgz_1477830884275_0.9869455888401717" | ||
}, | ||
@@ -58,0 +58,0 @@ "devDependencies": { |
@@ -210,2 +210,5 @@ import Request from './request'; | ||
} | ||
if(result.content_type){ | ||
_results['content_type'] = result.content_type | ||
} | ||
} | ||
@@ -212,0 +215,0 @@ if (typeof result.asset !== 'undefined') _results = result.asset; |
@@ -95,3 +95,3 @@ import * as Utils from '../lib/utils'; | ||
fetch(fetchoptions) { | ||
fetch(fetchOptions) { | ||
if (this.asset_uid) { | ||
@@ -98,0 +98,0 @@ this.requestParams = { |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
912605
16620