@vertexvis/utils
Advanced tools
Comparing version 0.8.0 to 0.9.0
@@ -7,2 +7,58 @@ 'use strict'; | ||
function delay() { | ||
var args = []; | ||
for (var _i = 0; _i < arguments.length; _i++) { | ||
args[_i] = arguments[_i]; | ||
} | ||
return tslib.__awaiter(this, void 0, void 0, function () { | ||
var ms, promise, delay_1; | ||
return tslib.__generator(this, function (_a) { | ||
switch (_a.label) { | ||
case 0: | ||
ms = args[0]; | ||
if (!(typeof ms === 'number')) return [3 /*break*/, 4]; | ||
promise = args[1]; | ||
delay_1 = new Promise(function (resolve) { return setTimeout(resolve, ms); }); | ||
if (!(promise != null)) return [3 /*break*/, 2]; | ||
return [4 /*yield*/, delay_1]; | ||
case 1: | ||
_a.sent(); | ||
return [2 /*return*/, promise]; | ||
case 2: return [2 /*return*/, delay_1]; | ||
case 3: return [3 /*break*/, 5]; | ||
case 4: return [2 /*return*/, Promise.reject(new TypeError('First argument to `delay` must be a number'))]; | ||
case 5: return [2 /*return*/]; | ||
} | ||
}); | ||
}); | ||
} | ||
function timeout() { | ||
var args = []; | ||
for (var _i = 0; _i < arguments.length; _i++) { | ||
args[_i] = arguments[_i]; | ||
} | ||
var ms = args[0]; | ||
if (typeof ms === 'number') { | ||
var promise = args[1]; | ||
var timeout_1 = new Promise(function (_, reject) { | ||
return setTimeout(function () { return reject(new Error("Promise timed out after " + ms + "ms")); }, ms); | ||
}); | ||
if (promise != null) { | ||
return Promise.race([promise, timeout_1]); | ||
} | ||
else { | ||
return timeout_1; | ||
} | ||
} | ||
else { | ||
return Promise.reject('First argument to `timeout` must be a number'); | ||
} | ||
} | ||
var async = /*#__PURE__*/Object.freeze({ | ||
__proto__: null, | ||
delay: delay, | ||
timeout: timeout | ||
}); | ||
/** | ||
@@ -881,2 +937,3 @@ * Returns a new `BinaryReader` for an `ArrayBuffer`. | ||
exports.Async = async; | ||
exports.BinaryReader = binaryReader; | ||
@@ -883,0 +940,0 @@ exports.Color = color; |
@@ -1,2 +0,2 @@ | ||
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var r=require("tslib"),t=Object.freeze({__proto__:null,fromArrayBuffer:function(r){return{offset:0,data:new DataView(r)}},readInt32:function(t){var n=t.data.getInt32(t.offset);return r.__assign(r.__assign({},t),{offset:t.offset+4,value:n})},readUtf8String:function(t,n){var e=String.fromCharCode.apply(null,Array.from(new Uint8Array(n.data.buffer,n.offset,t)));return r.__assign(r.__assign({},n),{offset:n.offset+t,value:e})},readInt8Array:function(t,n){var e=new Int8Array(n.data.buffer,n.offset,t);return r.__assign(r.__assign({},n),{offset:n.offset+t,value:e})},sliceInt8Array:function(t,n){var e=new Int8Array(n.data.buffer.slice(n.offset,t+n.offset));return r.__assign(r.__assign({},n),{offset:0,value:e})}}),n=/rgb\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*\)/,e=/rgba\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*,\s*(.+)\s*\)/,u=/^(#|0x)?([A-Fa-f0-9]{6})$/,a=function(r,t,n,e){return void 0===e&&(e=255),{r:r,g:t,b:n,a:e}},o=function(r){var t=16777215&r;return a(t>>16&255,t>>8&255,255&t)},s=function(r){var t=u.exec(r);if(null!=t)return o(parseInt(t[2],16))},i=function(r){var t=r.toString(16);return 1===t.length?"0"+t:t},f=Object.freeze({__proto__:null,create:a,fromNumber:o,fromHexString:s,fromCss:function(r){var t=n.exec(r);if(null!=t)return a(parseInt(t[1]),parseInt(t[2]),parseInt(t[3]));var o=e.exec(r);return null!=o?a(parseInt(o[1]),parseInt(o[2]),parseInt(o[3]),Math.floor(255*parseFloat(o[4]))):u.test(r)?s(r):void 0},fromArray:function(r){return a(r[0],r[1],r[2],r[3])},isInvisible:function(r){return 0===r.a},isOpaque:function(r){return 255===r.a},toHexString:function(r){return"#"+i(r.r)+i(r.g)+i(r.b)}}); | ||
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var r=require("tslib");var t=Object.freeze({__proto__:null,delay:function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];return r.__awaiter(this,void 0,void 0,(function(){var n,e,u;return r.__generator(this,(function(r){switch(r.label){case 0:return"number"!=typeof(n=t[0])?[3,4]:(e=t[1],u=new Promise((function(r){return setTimeout(r,n)})),null==e?[3,2]:[4,u]);case 1:return r.sent(),[2,e];case 2:return[2,u];case 3:return[3,5];case 4:return[2,Promise.reject(new TypeError("First argument to `delay` must be a number"))];case 5:return[2]}}))}))},timeout:function(){for(var r=[],t=0;t<arguments.length;t++)r[t]=arguments[t];var n=r[0];if("number"==typeof n){var e=r[1],u=new Promise((function(r,t){return setTimeout((function(){return t(new Error("Promise timed out after "+n+"ms"))}),n)}));return null!=e?Promise.race([e,u]):u}return Promise.reject("First argument to `timeout` must be a number")}}),n=Object.freeze({__proto__:null,fromArrayBuffer:function(r){return{offset:0,data:new DataView(r)}},readInt32:function(t){var n=t.data.getInt32(t.offset);return r.__assign(r.__assign({},t),{offset:t.offset+4,value:n})},readUtf8String:function(t,n){var e=String.fromCharCode.apply(null,Array.from(new Uint8Array(n.data.buffer,n.offset,t)));return r.__assign(r.__assign({},n),{offset:n.offset+t,value:e})},readInt8Array:function(t,n){var e=new Int8Array(n.data.buffer,n.offset,t);return r.__assign(r.__assign({},n),{offset:n.offset+t,value:e})},sliceInt8Array:function(t,n){var e=new Int8Array(n.data.buffer.slice(n.offset,t+n.offset));return r.__assign(r.__assign({},n),{offset:0,value:e})}}),e=/rgb\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*\)/,u=/rgba\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*,\s*(.+)\s*\)/,a=/^(#|0x)?([A-Fa-f0-9]{6})$/,o=function(r,t,n,e){return void 0===e&&(e=255),{r:r,g:t,b:n,a:e}},i=function(r){var t=16777215&r;return o(t>>16&255,t>>8&255,255&t)},s=function(r){var t=a.exec(r);if(null!=t)return i(parseInt(t[2],16))},f=function(r){var t=r.toString(16);return 1===t.length?"0"+t:t},c=Object.freeze({__proto__:null,create:o,fromNumber:i,fromHexString:s,fromCss:function(r){var t=e.exec(r);if(null!=t)return o(parseInt(t[1]),parseInt(t[2]),parseInt(t[3]));var n=u.exec(r);return null!=n?o(parseInt(n[1]),parseInt(n[2]),parseInt(n[3]),Math.floor(255*parseFloat(n[4]))):a.test(r)?s(r):void 0},fromArray:function(r){return o(r[0],r[1],r[2],r[3])},isInvisible:function(r){return 0===r.a},isOpaque:function(r){return 255===r.a},toHexString:function(r){return"#"+f(r.r)+f(r.g)+f(r.b)}}); | ||
/*! | ||
@@ -8,3 +8,3 @@ * is-plain-object <https://github.com/jonschlinkert/is-plain-object> | ||
*/ | ||
function c(r){return!0==(null!=(t=r)&&"object"==typeof t&&!1===Array.isArray(t))&&"[object Object]"===Object.prototype.toString.call(r); | ||
function l(r){return!0==(null!=(t=r)&&"object"==typeof t&&!1===Array.isArray(t))&&"[object Object]"===Object.prototype.toString.call(r); | ||
/*! | ||
@@ -16,3 +16,3 @@ * isobject <https://github.com/jonschlinkert/isobject> | ||
*/ | ||
var t}var l=function(r){return!1!==c(t=r)&&"function"==typeof(n=t.constructor)&&!1!==c(e=n.prototype)&&!1!==e.hasOwnProperty("isPrototypeOf");var t,n,e};var p=Object.freeze({__proto__:null,defaults:function t(){for(var n=[],e=0;e<arguments.length;e++)n[e]=arguments[e];var u=n[0],a=n.slice(1),o=r.__assign({},u);if(0===a.length)return o;if(1===a.length){var s=a[0];for(var i in s)null==o[i]?o[i]=s[i]:l(o[i])&&(o[i]=t(o[i],s[i]));return o}return a.reduce((function(r,n){return t(r,n)}),u)},isPlainObject:l,toPairs:function(r){return null!=r?Object.keys(r).map((function(t){return[t,r[t]]})):[]},fromPairs:function(t){return Array.isArray(t)?t.reduce((function(t,n){var e;return null!=n?r.__assign(r.__assign({},t),((e={})[n[0]]=n[1],e)):t}),{}):{}}}),d=function(r,t){return{start:r,end:t}},v=function(r,t){return d(t.start+r,t.end+r)},_=function(r,t){return"number"==typeof r?t.start<=r&&r<=t.end:_(r.start,t)&&_(r.end,t)},y=function(r,t){return r.start<=t.end&&r.end>=t.start||t.start<=r.end&&t.end>=r.start},g=function(r,t){return r.start===t.start},m=function(r,t){return r.start>t.start},h=function(r,t){return r.start<t.start},b=function(r){return r.end-r.start+1},A=Object.freeze({__proto__:null,create:d,at:function(r){return{start:r,end:r}},withLength:function(r,t){return{start:r,end:r+t-1}},add:v,constrain:function(r,t){return _(r,t)?r:b(r)>b(t)?t:r.start<t.start?d(t.start,t.start+b(r)-1):d(t.end-b(r)+1,t.end)},contains:_,intersection:function(r,t){if(y(r,t))return d(Math.max(r.start,t.start),Math.min(r.end,t.end))},intersects:y,isAt:g,isAfter:m,isAtOrAfter:function(r,t){return g(r,t)||m(r,t)},isBefore:h,isAtOrBefore:function(r,t){return g(r,t)||h(r,t)},length:b,subtract:function(r,t){return v(-1*r,t)},truncate:function(r,t){if(y(t,r))return d(Math.max(r.start,t.start),Math.min(r.end,t.end))}}),x=/^\W+/,O=/\W+$/,j=/^\W+|\W+$/g;var I=Object.freeze({__proto__:null,trimStart:function(r){return r.replace(x,"")},trimEnd:function(r){return r.replace(O,"")},trim:function(r){return r.replace(j,"")}}),q=function(r,t){return r<t?-1:r>t?1:0},w=function(r){var t=/^(([^:/?#]+):)?(\/\/([^/?#]*))?([^?#]*)(\?([^#]*))?(#(.*))?/.exec(r);return null!=t?{scheme:t[2],authority:t[4],path:t[5],query:t[7],fragment:t[9]}:{}},S=function(t,n){var e="/"===t[0]?t:"/"+t;return r.__assign(r.__assign({},n),{path:e})},C=function(r){return null!=r.path?E(r.path.split("/")):[]},P=function(t,n){if(null!=t[1]){var e=r.__spreadArrays(U(n),[t]);return r.__assign(r.__assign({},n),{query:e.map((function(r){return r.map(encodeURIComponent).join("=")})).join("&")})}return n},M=function(r,t){return r.reduce((function(r,t){return P(t,r)}),t)},R=function(r,t){return V(r).reduce((function(r,t){return P(t,r)}),t)},U=function(r){return null!=r.query?z(r.query):[]},z=function(r){return r.split("&").map((function(r){return r.split("=").map((function(r){return decodeURIComponent(r)}))}))},E=function(r){return r.filter((function(r){return r.length>0}))},V=function(r){var t=[];for(var n in r)t.push([n,r[n]]);return t},k=function(r){return r.concat().sort((t=q,function(r,n){var e=r[0],u=n[0];return t(e,u)}));var t},B=Object.freeze({__proto__:null,parse:w,parseAndAddParams:function(r,t){var n=w(r);return t?R(t,n):n},isEqual:function(r,t){var n=JSON.stringify(k(U(r))),e=JSON.stringify(k(U(t)));return r.scheme===t.scheme&&r.authority===t.authority&&r.path===t.path&&r.fragment===t.fragment&&n===e},replacePath:S,pathAsArray:C,appendPath:function(r,t){var n=C(t),e=E(r.split("/"));return S(n.concat(e).join("/"),t)},addQueryString:function(r,t){var n=z(r);return M(n,t)},addQueryEntry:P,addQueryEntries:M,addQueryParams:R,replaceFragment:function(t,n){return r.__assign(r.__assign({},n),{fragment:t})},queryAsArray:U,queryAsMap:function(t){return U(t).reduce((function(t,n){var e,u=n[0],a=n[1];return r.__assign(r.__assign({},t),((e={})[u]=a,e))}),{})},toString:function(r){var t="";return null!=r.scheme&&r.scheme.length>0&&(t=r.scheme+":"),null!=r.authority&&r.authority.length>0&&(t+="//"+r.authority),t+=r.path,null!=r.query&&r.query.length>0&&(t+="?"+r.query),null!=r.fragment&&r.fragment.length>0&&(t+="#"+r.fragment),t}});for(var D=function(r,t){return r(t={exports:{}},t.exports),t.exports}((function(r){var t="undefined"!=typeof crypto&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto)||"undefined"!=typeof msCrypto&&"function"==typeof window.msCrypto.getRandomValues&&msCrypto.getRandomValues.bind(msCrypto);if(t){var n=new Uint8Array(16);r.exports=function(){return t(n),n}}else{var e=new Array(16);r.exports=function(){for(var r,t=0;t<16;t++)0==(3&t)&&(r=4294967296*Math.random()),e[t]=r>>>((3&t)<<3)&255;return e}}})),Q=[],W=0;W<256;++W)Q[W]=(W+256).toString(16).substr(1);var F,N,$=function(r,t){var n=t||0,e=Q;return[e[r[n++]],e[r[n++]],e[r[n++]],e[r[n++]],"-",e[r[n++]],e[r[n++]],"-",e[r[n++]],e[r[n++]],"-",e[r[n++]],e[r[n++]],"-",e[r[n++]],e[r[n++]],e[r[n++]],e[r[n++]],e[r[n++]],e[r[n++]]].join("")},H=0,J=0;var L=function(r,t,n){var e=t&&n||0,u=t||[],a=(r=r||{}).node||F,o=void 0!==r.clockseq?r.clockseq:N;if(null==a||null==o){var s=D();null==a&&(a=F=[1|s[0],s[1],s[2],s[3],s[4],s[5]]),null==o&&(o=N=16383&(s[6]<<8|s[7]))}var i=void 0!==r.msecs?r.msecs:(new Date).getTime(),f=void 0!==r.nsecs?r.nsecs:J+1,c=i-H+(f-J)/1e4;if(c<0&&void 0===r.clockseq&&(o=o+1&16383),(c<0||i>H)&&void 0===r.nsecs&&(f=0),f>=1e4)throw new Error("uuid.v1(): Can't create more than 10M uuids/sec");H=i,J=f,N=o;var l=(1e4*(268435455&(i+=122192928e5))+f)%4294967296;u[e++]=l>>>24&255,u[e++]=l>>>16&255,u[e++]=l>>>8&255,u[e++]=255&l;var p=i/4294967296*1e4&268435455;u[e++]=p>>>8&255,u[e++]=255&p,u[e++]=p>>>24&15|16,u[e++]=p>>>16&255,u[e++]=o>>>8|128,u[e++]=255&o;for(var d=0;d<6;++d)u[e+d]=a[d];return t||$(u)};var T=function(r,t,n){var e=t&&n||0;"string"==typeof r&&(t="binary"===r?new Array(16):null,r=null);var u=(r=r||{}).random||(r.rng||D)();if(u[6]=15&u[6]|64,u[8]=63&u[8]|128,t)for(var a=0;a<16;++a)t[e+a]=u[a];return t||$(u)},G=T;G.v1=L,G.v4=T;var K=G.v1,X=Object.freeze({__proto__:null,create:function(){return K()}}),Y=function(){function r(){this.listeners=[]}return r.prototype.on=function(r){var t=this;return this.listeners.push(r),{dispose:function(){return t.off(r)}}},r.prototype.off=function(r){var t=this.listeners.indexOf(r);-1!==t&&this.listeners.splice(t,1)},r.prototype.emit=function(r){this.listeners.forEach((function(t){return t(r)}))},r}();exports.BinaryReader=t,exports.Color=f,exports.EventDispatcher=Y,exports.Objects=p,exports.Range=A,exports.Strings=I,exports.UUID=X,exports.Uri=B; | ||
var t}var p=function(r){return!1!==l(t=r)&&"function"==typeof(n=t.constructor)&&!1!==l(e=n.prototype)&&!1!==e.hasOwnProperty("isPrototypeOf");var t,n,e};var d=Object.freeze({__proto__:null,defaults:function t(){for(var n=[],e=0;e<arguments.length;e++)n[e]=arguments[e];var u=n[0],a=n.slice(1),o=r.__assign({},u);if(0===a.length)return o;if(1===a.length){var i=a[0];for(var s in i)null==o[s]?o[s]=i[s]:p(o[s])&&(o[s]=t(o[s],i[s]));return o}return a.reduce((function(r,n){return t(r,n)}),u)},isPlainObject:p,toPairs:function(r){return null!=r?Object.keys(r).map((function(t){return[t,r[t]]})):[]},fromPairs:function(t){return Array.isArray(t)?t.reduce((function(t,n){var e;return null!=n?r.__assign(r.__assign({},t),((e={})[n[0]]=n[1],e)):t}),{}):{}}}),v=function(r,t){return{start:r,end:t}},_=function(r,t){return v(t.start+r,t.end+r)},m=function(r,t){return"number"==typeof r?t.start<=r&&r<=t.end:m(r.start,t)&&m(r.end,t)},y=function(r,t){return r.start<=t.end&&r.end>=t.start||t.start<=r.end&&t.end>=r.start},g=function(r,t){return r.start===t.start},h=function(r,t){return r.start>t.start},b=function(r,t){return r.start<t.start},A=function(r){return r.end-r.start+1},x=Object.freeze({__proto__:null,create:v,at:function(r){return{start:r,end:r}},withLength:function(r,t){return{start:r,end:r+t-1}},add:_,constrain:function(r,t){return m(r,t)?r:A(r)>A(t)?t:r.start<t.start?v(t.start,t.start+A(r)-1):v(t.end-A(r)+1,t.end)},contains:m,intersection:function(r,t){if(y(r,t))return v(Math.max(r.start,t.start),Math.min(r.end,t.end))},intersects:y,isAt:g,isAfter:h,isAtOrAfter:function(r,t){return g(r,t)||h(r,t)},isBefore:b,isAtOrBefore:function(r,t){return g(r,t)||b(r,t)},length:A,subtract:function(r,t){return _(-1*r,t)},truncate:function(r,t){if(y(t,r))return v(Math.max(r.start,t.start),Math.min(r.end,t.end))}}),j=/^\W+/,O=/\W+$/,w=/^\W+|\W+$/g;var I=Object.freeze({__proto__:null,trimStart:function(r){return r.replace(j,"")},trimEnd:function(r){return r.replace(O,"")},trim:function(r){return r.replace(w,"")}}),P=function(r,t){return r<t?-1:r>t?1:0},q=function(r){var t=/^(([^:/?#]+):)?(\/\/([^/?#]*))?([^?#]*)(\?([^#]*))?(#(.*))?/.exec(r);return null!=t?{scheme:t[2],authority:t[4],path:t[5],query:t[7],fragment:t[9]}:{}},S=function(t,n){var e="/"===t[0]?t:"/"+t;return r.__assign(r.__assign({},n),{path:e})},C=function(r){return null!=r.path?F(r.path.split("/")):[]},E=function(t,n){if(null!=t[1]){var e=r.__spreadArrays(R(n),[t]);return r.__assign(r.__assign({},n),{query:e.map((function(r){return r.map(encodeURIComponent).join("=")})).join("&")})}return n},M=function(r,t){return r.reduce((function(r,t){return E(t,r)}),t)},z=function(r,t){return V(r).reduce((function(r,t){return E(t,r)}),t)},R=function(r){return null!=r.query?U(r.query):[]},U=function(r){return r.split("&").map((function(r){return r.split("=").map((function(r){return decodeURIComponent(r)}))}))},F=function(r){return r.filter((function(r){return r.length>0}))},V=function(r){var t=[];for(var n in r)t.push([n,r[n]]);return t},k=function(r){return r.concat().sort((t=P,function(r,n){var e=r[0],u=n[0];return t(e,u)}));var t},B=Object.freeze({__proto__:null,parse:q,parseAndAddParams:function(r,t){var n=q(r);return t?z(t,n):n},isEqual:function(r,t){var n=JSON.stringify(k(R(r))),e=JSON.stringify(k(R(t)));return r.scheme===t.scheme&&r.authority===t.authority&&r.path===t.path&&r.fragment===t.fragment&&n===e},replacePath:S,pathAsArray:C,appendPath:function(r,t){var n=C(t),e=F(r.split("/"));return S(n.concat(e).join("/"),t)},addQueryString:function(r,t){var n=U(r);return M(n,t)},addQueryEntry:E,addQueryEntries:M,addQueryParams:z,replaceFragment:function(t,n){return r.__assign(r.__assign({},n),{fragment:t})},queryAsArray:R,queryAsMap:function(t){return R(t).reduce((function(t,n){var e,u=n[0],a=n[1];return r.__assign(r.__assign({},t),((e={})[u]=a,e))}),{})},toString:function(r){var t="";return null!=r.scheme&&r.scheme.length>0&&(t=r.scheme+":"),null!=r.authority&&r.authority.length>0&&(t+="//"+r.authority),t+=r.path,null!=r.query&&r.query.length>0&&(t+="?"+r.query),null!=r.fragment&&r.fragment.length>0&&(t+="#"+r.fragment),t}});for(var D=function(r,t){return r(t={exports:{}},t.exports),t.exports}((function(r){var t="undefined"!=typeof crypto&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto)||"undefined"!=typeof msCrypto&&"function"==typeof window.msCrypto.getRandomValues&&msCrypto.getRandomValues.bind(msCrypto);if(t){var n=new Uint8Array(16);r.exports=function(){return t(n),n}}else{var e=new Array(16);r.exports=function(){for(var r,t=0;t<16;t++)0==(3&t)&&(r=4294967296*Math.random()),e[t]=r>>>((3&t)<<3)&255;return e}}})),Q=[],T=0;T<256;++T)Q[T]=(T+256).toString(16).substr(1);var W,N,$=function(r,t){var n=t||0,e=Q;return[e[r[n++]],e[r[n++]],e[r[n++]],e[r[n++]],"-",e[r[n++]],e[r[n++]],"-",e[r[n++]],e[r[n++]],"-",e[r[n++]],e[r[n++]],"-",e[r[n++]],e[r[n++]],e[r[n++]],e[r[n++]],e[r[n++]],e[r[n++]]].join("")},H=0,J=0;var L=function(r,t,n){var e=t&&n||0,u=t||[],a=(r=r||{}).node||W,o=void 0!==r.clockseq?r.clockseq:N;if(null==a||null==o){var i=D();null==a&&(a=W=[1|i[0],i[1],i[2],i[3],i[4],i[5]]),null==o&&(o=N=16383&(i[6]<<8|i[7]))}var s=void 0!==r.msecs?r.msecs:(new Date).getTime(),f=void 0!==r.nsecs?r.nsecs:J+1,c=s-H+(f-J)/1e4;if(c<0&&void 0===r.clockseq&&(o=o+1&16383),(c<0||s>H)&&void 0===r.nsecs&&(f=0),f>=1e4)throw new Error("uuid.v1(): Can't create more than 10M uuids/sec");H=s,J=f,N=o;var l=(1e4*(268435455&(s+=122192928e5))+f)%4294967296;u[e++]=l>>>24&255,u[e++]=l>>>16&255,u[e++]=l>>>8&255,u[e++]=255&l;var p=s/4294967296*1e4&268435455;u[e++]=p>>>8&255,u[e++]=255&p,u[e++]=p>>>24&15|16,u[e++]=p>>>16&255,u[e++]=o>>>8|128,u[e++]=255&o;for(var d=0;d<6;++d)u[e+d]=a[d];return t||$(u)};var G=function(r,t,n){var e=t&&n||0;"string"==typeof r&&(t="binary"===r?new Array(16):null,r=null);var u=(r=r||{}).random||(r.rng||D)();if(u[6]=15&u[6]|64,u[8]=63&u[8]|128,t)for(var a=0;a<16;++a)t[e+a]=u[a];return t||$(u)},K=G;K.v1=L,K.v4=G;var X=K.v1,Y=Object.freeze({__proto__:null,create:function(){return X()}}),Z=function(){function r(){this.listeners=[]}return r.prototype.on=function(r){var t=this;return this.listeners.push(r),{dispose:function(){return t.off(r)}}},r.prototype.off=function(r){var t=this.listeners.indexOf(r);-1!==t&&this.listeners.splice(t,1)},r.prototype.emit=function(r){this.listeners.forEach((function(t){return t(r)}))},r}();exports.Async=t,exports.BinaryReader=n,exports.Color=c,exports.EventDispatcher=Z,exports.Objects=d,exports.Range=x,exports.Strings=I,exports.UUID=Y,exports.Uri=B; | ||
//# sourceMappingURL=browser.cjs.min.js.map |
@@ -1,3 +0,59 @@ | ||
import { __assign, __spreadArrays } from 'tslib'; | ||
import { __awaiter, __generator, __assign, __spreadArrays } from 'tslib'; | ||
function delay() { | ||
var args = []; | ||
for (var _i = 0; _i < arguments.length; _i++) { | ||
args[_i] = arguments[_i]; | ||
} | ||
return __awaiter(this, void 0, void 0, function () { | ||
var ms, promise, delay_1; | ||
return __generator(this, function (_a) { | ||
switch (_a.label) { | ||
case 0: | ||
ms = args[0]; | ||
if (!(typeof ms === 'number')) return [3 /*break*/, 4]; | ||
promise = args[1]; | ||
delay_1 = new Promise(function (resolve) { return setTimeout(resolve, ms); }); | ||
if (!(promise != null)) return [3 /*break*/, 2]; | ||
return [4 /*yield*/, delay_1]; | ||
case 1: | ||
_a.sent(); | ||
return [2 /*return*/, promise]; | ||
case 2: return [2 /*return*/, delay_1]; | ||
case 3: return [3 /*break*/, 5]; | ||
case 4: return [2 /*return*/, Promise.reject(new TypeError('First argument to `delay` must be a number'))]; | ||
case 5: return [2 /*return*/]; | ||
} | ||
}); | ||
}); | ||
} | ||
function timeout() { | ||
var args = []; | ||
for (var _i = 0; _i < arguments.length; _i++) { | ||
args[_i] = arguments[_i]; | ||
} | ||
var ms = args[0]; | ||
if (typeof ms === 'number') { | ||
var promise = args[1]; | ||
var timeout_1 = new Promise(function (_, reject) { | ||
return setTimeout(function () { return reject(new Error("Promise timed out after " + ms + "ms")); }, ms); | ||
}); | ||
if (promise != null) { | ||
return Promise.race([promise, timeout_1]); | ||
} | ||
else { | ||
return timeout_1; | ||
} | ||
} | ||
else { | ||
return Promise.reject('First argument to `timeout` must be a number'); | ||
} | ||
} | ||
var async = /*#__PURE__*/Object.freeze({ | ||
__proto__: null, | ||
delay: delay, | ||
timeout: timeout | ||
}); | ||
/** | ||
@@ -876,3 +932,3 @@ * Returns a new `BinaryReader` for an `ArrayBuffer`. | ||
export { binaryReader as BinaryReader, color as Color, EventDispatcher, objects as Objects, range as Range, strings as Strings, uuid$1 as UUID, uri as Uri }; | ||
export { async as Async, binaryReader as BinaryReader, color as Color, EventDispatcher, objects as Objects, range as Range, strings as Strings, uuid$1 as UUID, uri as Uri }; | ||
//# sourceMappingURL=browser.esm.js.map |
@@ -1,2 +0,2 @@ | ||
import{__assign as r,__spreadArrays as t}from"tslib";var n=Object.freeze({__proto__:null,fromArrayBuffer:function(r){return{offset:0,data:new DataView(r)}},readInt32:function(t){var n=t.data.getInt32(t.offset);return r(r({},t),{offset:t.offset+4,value:n})},readUtf8String:function(t,n){var e=String.fromCharCode.apply(null,Array.from(new Uint8Array(n.data.buffer,n.offset,t)));return r(r({},n),{offset:n.offset+t,value:e})},readInt8Array:function(t,n){var e=new Int8Array(n.data.buffer,n.offset,t);return r(r({},n),{offset:n.offset+t,value:e})},sliceInt8Array:function(t,n){var e=new Int8Array(n.data.buffer.slice(n.offset,t+n.offset));return r(r({},n),{offset:0,value:e})}}),e=/rgb\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*\)/,u=/rgba\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*,\s*(.+)\s*\)/,a=/^(#|0x)?([A-Fa-f0-9]{6})$/,o=function(r,t,n,e){return void 0===e&&(e=255),{r:r,g:t,b:n,a:e}},i=function(r){var t=16777215&r;return o(t>>16&255,t>>8&255,255&t)},f=function(r){var t=a.exec(r);if(null!=t)return i(parseInt(t[2],16))},s=function(r){var t=r.toString(16);return 1===t.length?"0"+t:t},c=Object.freeze({__proto__:null,create:o,fromNumber:i,fromHexString:f,fromCss:function(r){var t=e.exec(r);if(null!=t)return o(parseInt(t[1]),parseInt(t[2]),parseInt(t[3]));var n=u.exec(r);return null!=n?o(parseInt(n[1]),parseInt(n[2]),parseInt(n[3]),Math.floor(255*parseFloat(n[4]))):a.test(r)?f(r):void 0},fromArray:function(r){return o(r[0],r[1],r[2],r[3])},isInvisible:function(r){return 0===r.a},isOpaque:function(r){return 255===r.a},toHexString:function(r){return"#"+s(r.r)+s(r.g)+s(r.b)}}); | ||
import{__awaiter as r,__generator as t,__assign as n,__spreadArrays as e}from"tslib";var u=Object.freeze({__proto__:null,delay:function(){for(var n=[],e=0;e<arguments.length;e++)n[e]=arguments[e];return r(this,void 0,void 0,(function(){var r,e,u;return t(this,(function(t){switch(t.label){case 0:return"number"!=typeof(r=n[0])?[3,4]:(e=n[1],u=new Promise((function(t){return setTimeout(t,r)})),null==e?[3,2]:[4,u]);case 1:return t.sent(),[2,e];case 2:return[2,u];case 3:return[3,5];case 4:return[2,Promise.reject(new TypeError("First argument to `delay` must be a number"))];case 5:return[2]}}))}))},timeout:function(){for(var r=[],t=0;t<arguments.length;t++)r[t]=arguments[t];var n=r[0];if("number"==typeof n){var e=r[1],u=new Promise((function(r,t){return setTimeout((function(){return t(new Error("Promise timed out after "+n+"ms"))}),n)}));return null!=e?Promise.race([e,u]):u}return Promise.reject("First argument to `timeout` must be a number")}}),o=Object.freeze({__proto__:null,fromArrayBuffer:function(r){return{offset:0,data:new DataView(r)}},readInt32:function(r){var t=r.data.getInt32(r.offset);return n(n({},r),{offset:r.offset+4,value:t})},readUtf8String:function(r,t){var e=String.fromCharCode.apply(null,Array.from(new Uint8Array(t.data.buffer,t.offset,r)));return n(n({},t),{offset:t.offset+r,value:e})},readInt8Array:function(r,t){var e=new Int8Array(t.data.buffer,t.offset,r);return n(n({},t),{offset:t.offset+r,value:e})},sliceInt8Array:function(r,t){var e=new Int8Array(t.data.buffer.slice(t.offset,r+t.offset));return n(n({},t),{offset:0,value:e})}}),a=/rgb\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*\)/,i=/rgba\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*,\s*(.+)\s*\)/,f=/^(#|0x)?([A-Fa-f0-9]{6})$/,s=function(r,t,n,e){return void 0===e&&(e=255),{r:r,g:t,b:n,a:e}},c=function(r){var t=16777215&r;return s(t>>16&255,t>>8&255,255&t)},l=function(r){var t=f.exec(r);if(null!=t)return c(parseInt(t[2],16))},p=function(r){var t=r.toString(16);return 1===t.length?"0"+t:t},d=Object.freeze({__proto__:null,create:s,fromNumber:c,fromHexString:l,fromCss:function(r){var t=a.exec(r);if(null!=t)return s(parseInt(t[1]),parseInt(t[2]),parseInt(t[3]));var n=i.exec(r);return null!=n?s(parseInt(n[1]),parseInt(n[2]),parseInt(n[3]),Math.floor(255*parseFloat(n[4]))):f.test(r)?l(r):void 0},fromArray:function(r){return s(r[0],r[1],r[2],r[3])},isInvisible:function(r){return 0===r.a},isOpaque:function(r){return 255===r.a},toHexString:function(r){return"#"+p(r.r)+p(r.g)+p(r.b)}}); | ||
/*! | ||
@@ -8,3 +8,3 @@ * is-plain-object <https://github.com/jonschlinkert/is-plain-object> | ||
*/ | ||
function l(r){return!0==(null!=(t=r)&&"object"==typeof t&&!1===Array.isArray(t))&&"[object Object]"===Object.prototype.toString.call(r); | ||
function m(r){return!0==(null!=(t=r)&&"object"==typeof t&&!1===Array.isArray(t))&&"[object Object]"===Object.prototype.toString.call(r); | ||
/*! | ||
@@ -16,3 +16,3 @@ * isobject <https://github.com/jonschlinkert/isobject> | ||
*/ | ||
var t}var p=function(r){return!1!==l(t=r)&&"function"==typeof(n=t.constructor)&&!1!==l(e=n.prototype)&&!1!==e.hasOwnProperty("isPrototypeOf");var t,n,e};var d=Object.freeze({__proto__:null,defaults:function t(){for(var n=[],e=0;e<arguments.length;e++)n[e]=arguments[e];var u=n[0],a=n.slice(1),o=r({},u);if(0===a.length)return o;if(1===a.length){var i=a[0];for(var f in i)null==o[f]?o[f]=i[f]:p(o[f])&&(o[f]=t(o[f],i[f]));return o}return a.reduce((function(r,n){return t(r,n)}),u)},isPlainObject:p,toPairs:function(r){return null!=r?Object.keys(r).map((function(t){return[t,r[t]]})):[]},fromPairs:function(t){return Array.isArray(t)?t.reduce((function(t,n){var e;return null!=n?r(r({},t),((e={})[n[0]]=n[1],e)):t}),{}):{}}}),v=function(r,t){return{start:r,end:t}},y=function(r,t){return v(t.start+r,t.end+r)},m=function(r,t){return"number"==typeof r?t.start<=r&&r<=t.end:m(r.start,t)&&m(r.end,t)},h=function(r,t){return r.start<=t.end&&r.end>=t.start||t.start<=r.end&&t.end>=r.start},g=function(r,t){return r.start===t.start},b=function(r,t){return r.start>t.start},A=function(r,t){return r.start<t.start},_=function(r){return r.end-r.start+1},O=Object.freeze({__proto__:null,create:v,at:function(r){return{start:r,end:r}},withLength:function(r,t){return{start:r,end:r+t-1}},add:y,constrain:function(r,t){return m(r,t)?r:_(r)>_(t)?t:r.start<t.start?v(t.start,t.start+_(r)-1):v(t.end-_(r)+1,t.end)},contains:m,intersection:function(r,t){if(h(r,t))return v(Math.max(r.start,t.start),Math.min(r.end,t.end))},intersects:h,isAt:g,isAfter:b,isAtOrAfter:function(r,t){return g(r,t)||b(r,t)},isBefore:A,isAtOrBefore:function(r,t){return g(r,t)||A(r,t)},length:_,subtract:function(r,t){return y(-1*r,t)},truncate:function(r,t){if(h(t,r))return v(Math.max(r.start,t.start),Math.min(r.end,t.end))}}),j=/^\W+/,I=/\W+$/,x=/^\W+|\W+$/g;var w=Object.freeze({__proto__:null,trimStart:function(r){return r.replace(j,"")},trimEnd:function(r){return r.replace(I,"")},trim:function(r){return r.replace(x,"")}}),q=function(r,t){return r<t?-1:r>t?1:0},S=function(r){var t=/^(([^:/?#]+):)?(\/\/([^/?#]*))?([^?#]*)(\?([^#]*))?(#(.*))?/.exec(r);return null!=t?{scheme:t[2],authority:t[4],path:t[5],query:t[7],fragment:t[9]}:{}},C=function(t,n){var e="/"===t[0]?t:"/"+t;return r(r({},n),{path:e})},P=function(r){return null!=r.path?V(r.path.split("/")):[]},M=function(n,e){if(null!=n[1]){var u=t(z(e),[n]);return r(r({},e),{query:u.map((function(r){return r.map(encodeURIComponent).join("=")})).join("&")})}return e},R=function(r,t){return r.reduce((function(r,t){return M(t,r)}),t)},U=function(r,t){return k(r).reduce((function(r,t){return M(t,r)}),t)},z=function(r){return null!=r.query?E(r.query):[]},E=function(r){return r.split("&").map((function(r){return r.split("=").map((function(r){return decodeURIComponent(r)}))}))},V=function(r){return r.filter((function(r){return r.length>0}))},k=function(r){var t=[];for(var n in r)t.push([n,r[n]]);return t},B=function(r){return r.concat().sort((t=q,function(r,n){var e=r[0],u=n[0];return t(e,u)}));var t},Q=Object.freeze({__proto__:null,parse:S,parseAndAddParams:function(r,t){var n=S(r);return t?U(t,n):n},isEqual:function(r,t){var n=JSON.stringify(B(z(r))),e=JSON.stringify(B(z(t)));return r.scheme===t.scheme&&r.authority===t.authority&&r.path===t.path&&r.fragment===t.fragment&&n===e},replacePath:C,pathAsArray:P,appendPath:function(r,t){var n=P(t),e=V(r.split("/"));return C(n.concat(e).join("/"),t)},addQueryString:function(r,t){var n=E(r);return R(n,t)},addQueryEntry:M,addQueryEntries:R,addQueryParams:U,replaceFragment:function(t,n){return r(r({},n),{fragment:t})},queryAsArray:z,queryAsMap:function(t){return z(t).reduce((function(t,n){var e,u=n[0],a=n[1];return r(r({},t),((e={})[u]=a,e))}),{})},toString:function(r){var t="";return null!=r.scheme&&r.scheme.length>0&&(t=r.scheme+":"),null!=r.authority&&r.authority.length>0&&(t+="//"+r.authority),t+=r.path,null!=r.query&&r.query.length>0&&(t+="?"+r.query),null!=r.fragment&&r.fragment.length>0&&(t+="#"+r.fragment),t}});for(var W=function(r,t){return r(t={exports:{}},t.exports),t.exports}((function(r){var t="undefined"!=typeof crypto&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto)||"undefined"!=typeof msCrypto&&"function"==typeof window.msCrypto.getRandomValues&&msCrypto.getRandomValues.bind(msCrypto);if(t){var n=new Uint8Array(16);r.exports=function(){return t(n),n}}else{var e=new Array(16);r.exports=function(){for(var r,t=0;t<16;t++)0==(3&t)&&(r=4294967296*Math.random()),e[t]=r>>>((3&t)<<3)&255;return e}}})),D=[],F=0;F<256;++F)D[F]=(F+256).toString(16).substr(1);var N,$,H=function(r,t){var n=t||0,e=D;return[e[r[n++]],e[r[n++]],e[r[n++]],e[r[n++]],"-",e[r[n++]],e[r[n++]],"-",e[r[n++]],e[r[n++]],"-",e[r[n++]],e[r[n++]],"-",e[r[n++]],e[r[n++]],e[r[n++]],e[r[n++]],e[r[n++]],e[r[n++]]].join("")},J=0,L=0;var T=function(r,t,n){var e=t&&n||0,u=t||[],a=(r=r||{}).node||N,o=void 0!==r.clockseq?r.clockseq:$;if(null==a||null==o){var i=W();null==a&&(a=N=[1|i[0],i[1],i[2],i[3],i[4],i[5]]),null==o&&(o=$=16383&(i[6]<<8|i[7]))}var f=void 0!==r.msecs?r.msecs:(new Date).getTime(),s=void 0!==r.nsecs?r.nsecs:L+1,c=f-J+(s-L)/1e4;if(c<0&&void 0===r.clockseq&&(o=o+1&16383),(c<0||f>J)&&void 0===r.nsecs&&(s=0),s>=1e4)throw new Error("uuid.v1(): Can't create more than 10M uuids/sec");J=f,L=s,$=o;var l=(1e4*(268435455&(f+=122192928e5))+s)%4294967296;u[e++]=l>>>24&255,u[e++]=l>>>16&255,u[e++]=l>>>8&255,u[e++]=255&l;var p=f/4294967296*1e4&268435455;u[e++]=p>>>8&255,u[e++]=255&p,u[e++]=p>>>24&15|16,u[e++]=p>>>16&255,u[e++]=o>>>8|128,u[e++]=255&o;for(var d=0;d<6;++d)u[e+d]=a[d];return t||H(u)};var G=function(r,t,n){var e=t&&n||0;"string"==typeof r&&(t="binary"===r?new Array(16):null,r=null);var u=(r=r||{}).random||(r.rng||W)();if(u[6]=15&u[6]|64,u[8]=63&u[8]|128,t)for(var a=0;a<16;++a)t[e+a]=u[a];return t||H(u)},K=G;K.v1=T,K.v4=G;var X=K.v1,Y=Object.freeze({__proto__:null,create:function(){return X()}}),Z=function(){function r(){this.listeners=[]}return r.prototype.on=function(r){var t=this;return this.listeners.push(r),{dispose:function(){return t.off(r)}}},r.prototype.off=function(r){var t=this.listeners.indexOf(r);-1!==t&&this.listeners.splice(t,1)},r.prototype.emit=function(r){this.listeners.forEach((function(t){return t(r)}))},r}();export{n as BinaryReader,c as Color,Z as EventDispatcher,d as Objects,O as Range,w as Strings,Y as UUID,Q as Uri}; | ||
var t}var v=function(r){return!1!==m(t=r)&&"function"==typeof(n=t.constructor)&&!1!==m(e=n.prototype)&&!1!==e.hasOwnProperty("isPrototypeOf");var t,n,e};var y=Object.freeze({__proto__:null,defaults:function r(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var u=t[0],o=t.slice(1),a=n({},u);if(0===o.length)return a;if(1===o.length){var i=o[0];for(var f in i)null==a[f]?a[f]=i[f]:v(a[f])&&(a[f]=r(a[f],i[f]));return a}return o.reduce((function(t,n){return r(t,n)}),u)},isPlainObject:v,toPairs:function(r){return null!=r?Object.keys(r).map((function(t){return[t,r[t]]})):[]},fromPairs:function(r){return Array.isArray(r)?r.reduce((function(r,t){var e;return null!=t?n(n({},r),((e={})[t[0]]=t[1],e)):r}),{}):{}}}),h=function(r,t){return{start:r,end:t}},g=function(r,t){return h(t.start+r,t.end+r)},b=function(r,t){return"number"==typeof r?t.start<=r&&r<=t.end:b(r.start,t)&&b(r.end,t)},_=function(r,t){return r.start<=t.end&&r.end>=t.start||t.start<=r.end&&t.end>=r.start},A=function(r,t){return r.start===t.start},j=function(r,t){return r.start>t.start},O=function(r,t){return r.start<t.start},w=function(r){return r.end-r.start+1},I=Object.freeze({__proto__:null,create:h,at:function(r){return{start:r,end:r}},withLength:function(r,t){return{start:r,end:r+t-1}},add:g,constrain:function(r,t){return b(r,t)?r:w(r)>w(t)?t:r.start<t.start?h(t.start,t.start+w(r)-1):h(t.end-w(r)+1,t.end)},contains:b,intersection:function(r,t){if(_(r,t))return h(Math.max(r.start,t.start),Math.min(r.end,t.end))},intersects:_,isAt:A,isAfter:j,isAtOrAfter:function(r,t){return A(r,t)||j(r,t)},isBefore:O,isAtOrBefore:function(r,t){return A(r,t)||O(r,t)},length:w,subtract:function(r,t){return g(-1*r,t)},truncate:function(r,t){if(_(t,r))return h(Math.max(r.start,t.start),Math.min(r.end,t.end))}}),x=/^\W+/,P=/\W+$/,q=/^\W+|\W+$/g;var S=Object.freeze({__proto__:null,trimStart:function(r){return r.replace(x,"")},trimEnd:function(r){return r.replace(P,"")},trim:function(r){return r.replace(q,"")}}),C=function(r,t){return r<t?-1:r>t?1:0},z=function(r){var t=/^(([^:/?#]+):)?(\/\/([^/?#]*))?([^?#]*)(\?([^#]*))?(#(.*))?/.exec(r);return null!=t?{scheme:t[2],authority:t[4],path:t[5],query:t[7],fragment:t[9]}:{}},E=function(r,t){var e="/"===r[0]?r:"/"+r;return n(n({},t),{path:e})},M=function(r){return null!=r.path?B(r.path.split("/")):[]},R=function(r,t){if(null!=r[1]){var u=e(V(t),[r]);return n(n({},t),{query:u.map((function(r){return r.map(encodeURIComponent).join("=")})).join("&")})}return t},U=function(r,t){return r.reduce((function(r,t){return R(t,r)}),t)},F=function(r,t){return Q(r).reduce((function(r,t){return R(t,r)}),t)},V=function(r){return null!=r.query?k(r.query):[]},k=function(r){return r.split("&").map((function(r){return r.split("=").map((function(r){return decodeURIComponent(r)}))}))},B=function(r){return r.filter((function(r){return r.length>0}))},Q=function(r){var t=[];for(var n in r)t.push([n,r[n]]);return t},T=function(r){return r.concat().sort((t=C,function(r,n){var e=r[0],u=n[0];return t(e,u)}));var t},W=Object.freeze({__proto__:null,parse:z,parseAndAddParams:function(r,t){var n=z(r);return t?F(t,n):n},isEqual:function(r,t){var n=JSON.stringify(T(V(r))),e=JSON.stringify(T(V(t)));return r.scheme===t.scheme&&r.authority===t.authority&&r.path===t.path&&r.fragment===t.fragment&&n===e},replacePath:E,pathAsArray:M,appendPath:function(r,t){var n=M(t),e=B(r.split("/"));return E(n.concat(e).join("/"),t)},addQueryString:function(r,t){var n=k(r);return U(n,t)},addQueryEntry:R,addQueryEntries:U,addQueryParams:F,replaceFragment:function(r,t){return n(n({},t),{fragment:r})},queryAsArray:V,queryAsMap:function(r){return V(r).reduce((function(r,t){var e,u=t[0],o=t[1];return n(n({},r),((e={})[u]=o,e))}),{})},toString:function(r){var t="";return null!=r.scheme&&r.scheme.length>0&&(t=r.scheme+":"),null!=r.authority&&r.authority.length>0&&(t+="//"+r.authority),t+=r.path,null!=r.query&&r.query.length>0&&(t+="?"+r.query),null!=r.fragment&&r.fragment.length>0&&(t+="#"+r.fragment),t}});for(var D=function(r,t){return r(t={exports:{}},t.exports),t.exports}((function(r){var t="undefined"!=typeof crypto&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto)||"undefined"!=typeof msCrypto&&"function"==typeof window.msCrypto.getRandomValues&&msCrypto.getRandomValues.bind(msCrypto);if(t){var n=new Uint8Array(16);r.exports=function(){return t(n),n}}else{var e=new Array(16);r.exports=function(){for(var r,t=0;t<16;t++)0==(3&t)&&(r=4294967296*Math.random()),e[t]=r>>>((3&t)<<3)&255;return e}}})),N=[],$=0;$<256;++$)N[$]=($+256).toString(16).substr(1);var H,J,L=function(r,t){var n=t||0,e=N;return[e[r[n++]],e[r[n++]],e[r[n++]],e[r[n++]],"-",e[r[n++]],e[r[n++]],"-",e[r[n++]],e[r[n++]],"-",e[r[n++]],e[r[n++]],"-",e[r[n++]],e[r[n++]],e[r[n++]],e[r[n++]],e[r[n++]],e[r[n++]]].join("")},G=0,K=0;var X=function(r,t,n){var e=t&&n||0,u=t||[],o=(r=r||{}).node||H,a=void 0!==r.clockseq?r.clockseq:J;if(null==o||null==a){var i=D();null==o&&(o=H=[1|i[0],i[1],i[2],i[3],i[4],i[5]]),null==a&&(a=J=16383&(i[6]<<8|i[7]))}var f=void 0!==r.msecs?r.msecs:(new Date).getTime(),s=void 0!==r.nsecs?r.nsecs:K+1,c=f-G+(s-K)/1e4;if(c<0&&void 0===r.clockseq&&(a=a+1&16383),(c<0||f>G)&&void 0===r.nsecs&&(s=0),s>=1e4)throw new Error("uuid.v1(): Can't create more than 10M uuids/sec");G=f,K=s,J=a;var l=(1e4*(268435455&(f+=122192928e5))+s)%4294967296;u[e++]=l>>>24&255,u[e++]=l>>>16&255,u[e++]=l>>>8&255,u[e++]=255&l;var p=f/4294967296*1e4&268435455;u[e++]=p>>>8&255,u[e++]=255&p,u[e++]=p>>>24&15|16,u[e++]=p>>>16&255,u[e++]=a>>>8|128,u[e++]=255&a;for(var d=0;d<6;++d)u[e+d]=o[d];return t||L(u)};var Y=function(r,t,n){var e=t&&n||0;"string"==typeof r&&(t="binary"===r?new Array(16):null,r=null);var u=(r=r||{}).random||(r.rng||D)();if(u[6]=15&u[6]|64,u[8]=63&u[8]|128,t)for(var o=0;o<16;++o)t[e+o]=u[o];return t||L(u)},Z=Y;Z.v1=X,Z.v4=Y;var rr=Z.v1,tr=Object.freeze({__proto__:null,create:function(){return rr()}}),nr=function(){function r(){this.listeners=[]}return r.prototype.on=function(r){var t=this;return this.listeners.push(r),{dispose:function(){return t.off(r)}}},r.prototype.off=function(r){var t=this.listeners.indexOf(r);-1!==t&&this.listeners.splice(t,1)},r.prototype.emit=function(r){this.listeners.forEach((function(t){return t(r)}))},r}();export{u as Async,o as BinaryReader,d as Color,nr as EventDispatcher,y as Objects,I as Range,S as Strings,tr as UUID,W as Uri}; | ||
//# sourceMappingURL=browser.esm.min.js.map |
@@ -10,2 +10,58 @@ 'use strict'; | ||
function delay() { | ||
var args = []; | ||
for (var _i = 0; _i < arguments.length; _i++) { | ||
args[_i] = arguments[_i]; | ||
} | ||
return tslib.__awaiter(this, void 0, void 0, function () { | ||
var ms, promise, delay_1; | ||
return tslib.__generator(this, function (_a) { | ||
switch (_a.label) { | ||
case 0: | ||
ms = args[0]; | ||
if (!(typeof ms === 'number')) return [3 /*break*/, 4]; | ||
promise = args[1]; | ||
delay_1 = new Promise(function (resolve) { return setTimeout(resolve, ms); }); | ||
if (!(promise != null)) return [3 /*break*/, 2]; | ||
return [4 /*yield*/, delay_1]; | ||
case 1: | ||
_a.sent(); | ||
return [2 /*return*/, promise]; | ||
case 2: return [2 /*return*/, delay_1]; | ||
case 3: return [3 /*break*/, 5]; | ||
case 4: return [2 /*return*/, Promise.reject(new TypeError('First argument to `delay` must be a number'))]; | ||
case 5: return [2 /*return*/]; | ||
} | ||
}); | ||
}); | ||
} | ||
function timeout() { | ||
var args = []; | ||
for (var _i = 0; _i < arguments.length; _i++) { | ||
args[_i] = arguments[_i]; | ||
} | ||
var ms = args[0]; | ||
if (typeof ms === 'number') { | ||
var promise = args[1]; | ||
var timeout_1 = new Promise(function (_, reject) { | ||
return setTimeout(function () { return reject(new Error("Promise timed out after " + ms + "ms")); }, ms); | ||
}); | ||
if (promise != null) { | ||
return Promise.race([promise, timeout_1]); | ||
} | ||
else { | ||
return timeout_1; | ||
} | ||
} | ||
else { | ||
return Promise.reject('First argument to `timeout` must be a number'); | ||
} | ||
} | ||
var async = /*#__PURE__*/Object.freeze({ | ||
__proto__: null, | ||
delay: delay, | ||
timeout: timeout | ||
}); | ||
/** | ||
@@ -852,2 +908,3 @@ * Returns a new `BinaryReader` for an `ArrayBuffer`. | ||
exports.Async = async; | ||
exports.BinaryReader = binaryReader; | ||
@@ -854,0 +911,0 @@ exports.Color = color; |
@@ -1,2 +0,2 @@ | ||
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var r,t=require("tslib"),n=(r=require("crypto"))&&"object"==typeof r&&"default"in r?r.default:r,e=Object.freeze({__proto__:null,fromArrayBuffer:function(r){return{offset:0,data:new DataView(r)}},readInt32:function(r){var n=r.data.getInt32(r.offset);return t.__assign(t.__assign({},r),{offset:r.offset+4,value:n})},readUtf8String:function(r,n){var e=String.fromCharCode.apply(null,Array.from(new Uint8Array(n.data.buffer,n.offset,r)));return t.__assign(t.__assign({},n),{offset:n.offset+r,value:e})},readInt8Array:function(r,n){var e=new Int8Array(n.data.buffer,n.offset,r);return t.__assign(t.__assign({},n),{offset:n.offset+r,value:e})},sliceInt8Array:function(r,n){var e=new Int8Array(n.data.buffer.slice(n.offset,r+n.offset));return t.__assign(t.__assign({},n),{offset:0,value:e})}}),u=/rgb\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*\)/,a=/rgba\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*,\s*(.+)\s*\)/,o=/^(#|0x)?([A-Fa-f0-9]{6})$/,i=function(r,t,n,e){return void 0===e&&(e=255),{r:r,g:t,b:n,a:e}},s=function(r){var t=16777215&r;return i(t>>16&255,t>>8&255,255&t)},f=function(r){var t=o.exec(r);if(null!=t)return s(parseInt(t[2],16))},c=function(r){var t=r.toString(16);return 1===t.length?"0"+t:t},l=Object.freeze({__proto__:null,create:i,fromNumber:s,fromHexString:f,fromCss:function(r){var t=u.exec(r);if(null!=t)return i(parseInt(t[1]),parseInt(t[2]),parseInt(t[3]));var n=a.exec(r);return null!=n?i(parseInt(n[1]),parseInt(n[2]),parseInt(n[3]),Math.floor(255*parseFloat(n[4]))):o.test(r)?f(r):void 0},fromArray:function(r){return i(r[0],r[1],r[2],r[3])},isInvisible:function(r){return 0===r.a},isOpaque:function(r){return 255===r.a},toHexString:function(r){return"#"+c(r.r)+c(r.g)+c(r.b)}}); | ||
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var r,t=require("tslib"),n=(r=require("crypto"))&&"object"==typeof r&&"default"in r?r.default:r;var e=Object.freeze({__proto__:null,delay:function(){for(var r=[],n=0;n<arguments.length;n++)r[n]=arguments[n];return t.__awaiter(this,void 0,void 0,(function(){var n,e,u;return t.__generator(this,(function(t){switch(t.label){case 0:return"number"!=typeof(n=r[0])?[3,4]:(e=r[1],u=new Promise((function(r){return setTimeout(r,n)})),null==e?[3,2]:[4,u]);case 1:return t.sent(),[2,e];case 2:return[2,u];case 3:return[3,5];case 4:return[2,Promise.reject(new TypeError("First argument to `delay` must be a number"))];case 5:return[2]}}))}))},timeout:function(){for(var r=[],t=0;t<arguments.length;t++)r[t]=arguments[t];var n=r[0];if("number"==typeof n){var e=r[1],u=new Promise((function(r,t){return setTimeout((function(){return t(new Error("Promise timed out after "+n+"ms"))}),n)}));return null!=e?Promise.race([e,u]):u}return Promise.reject("First argument to `timeout` must be a number")}}),u=Object.freeze({__proto__:null,fromArrayBuffer:function(r){return{offset:0,data:new DataView(r)}},readInt32:function(r){var n=r.data.getInt32(r.offset);return t.__assign(t.__assign({},r),{offset:r.offset+4,value:n})},readUtf8String:function(r,n){var e=String.fromCharCode.apply(null,Array.from(new Uint8Array(n.data.buffer,n.offset,r)));return t.__assign(t.__assign({},n),{offset:n.offset+r,value:e})},readInt8Array:function(r,n){var e=new Int8Array(n.data.buffer,n.offset,r);return t.__assign(t.__assign({},n),{offset:n.offset+r,value:e})},sliceInt8Array:function(r,n){var e=new Int8Array(n.data.buffer.slice(n.offset,r+n.offset));return t.__assign(t.__assign({},n),{offset:0,value:e})}}),a=/rgb\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*\)/,o=/rgba\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*,\s*(.+)\s*\)/,i=/^(#|0x)?([A-Fa-f0-9]{6})$/,s=function(r,t,n,e){return void 0===e&&(e=255),{r:r,g:t,b:n,a:e}},f=function(r){var t=16777215&r;return s(t>>16&255,t>>8&255,255&t)},c=function(r){var t=i.exec(r);if(null!=t)return f(parseInt(t[2],16))},l=function(r){var t=r.toString(16);return 1===t.length?"0"+t:t},p=Object.freeze({__proto__:null,create:s,fromNumber:f,fromHexString:c,fromCss:function(r){var t=a.exec(r);if(null!=t)return s(parseInt(t[1]),parseInt(t[2]),parseInt(t[3]));var n=o.exec(r);return null!=n?s(parseInt(n[1]),parseInt(n[2]),parseInt(n[3]),Math.floor(255*parseFloat(n[4]))):i.test(r)?c(r):void 0},fromArray:function(r){return s(r[0],r[1],r[2],r[3])},isInvisible:function(r){return 0===r.a},isOpaque:function(r){return 255===r.a},toHexString:function(r){return"#"+l(r.r)+l(r.g)+l(r.b)}}); | ||
/*! | ||
@@ -8,3 +8,3 @@ * is-plain-object <https://github.com/jonschlinkert/is-plain-object> | ||
*/ | ||
function p(r){return!0==(null!=(t=r)&&"object"==typeof t&&!1===Array.isArray(t))&&"[object Object]"===Object.prototype.toString.call(r); | ||
function d(r){return!0==(null!=(t=r)&&"object"==typeof t&&!1===Array.isArray(t))&&"[object Object]"===Object.prototype.toString.call(r); | ||
/*! | ||
@@ -16,3 +16,3 @@ * isobject <https://github.com/jonschlinkert/isobject> | ||
*/ | ||
var t}var d=function(r){return!1!==p(t=r)&&"function"==typeof(n=t.constructor)&&!1!==p(e=n.prototype)&&!1!==e.hasOwnProperty("isPrototypeOf");var t,n,e};var _=Object.freeze({__proto__:null,defaults:function r(){for(var n=[],e=0;e<arguments.length;e++)n[e]=arguments[e];var u=n[0],a=n.slice(1),o=t.__assign({},u);if(0===a.length)return o;if(1===a.length){var i=a[0];for(var s in i)null==o[s]?o[s]=i[s]:d(o[s])&&(o[s]=r(o[s],i[s]));return o}return a.reduce((function(t,n){return r(t,n)}),u)},isPlainObject:d,toPairs:function(r){return null!=r?Object.keys(r).map((function(t){return[t,r[t]]})):[]},fromPairs:function(r){return Array.isArray(r)?r.reduce((function(r,n){var e;return null!=n?t.__assign(t.__assign({},r),((e={})[n[0]]=n[1],e)):r}),{}):{}}}),v=function(r,t){return{start:r,end:t}},g=function(r,t){return v(t.start+r,t.end+r)},y=function(r,t){return"number"==typeof r?t.start<=r&&r<=t.end:y(r.start,t)&&y(r.end,t)},h=function(r,t){return r.start<=t.end&&r.end>=t.start||t.start<=r.end&&t.end>=r.start},m=function(r,t){return r.start===t.start},b=function(r,t){return r.start>t.start},A=function(r,t){return r.start<t.start},O=function(r){return r.end-r.start+1},j=Object.freeze({__proto__:null,create:v,at:function(r){return{start:r,end:r}},withLength:function(r,t){return{start:r,end:r+t-1}},add:g,constrain:function(r,t){return y(r,t)?r:O(r)>O(t)?t:r.start<t.start?v(t.start,t.start+O(r)-1):v(t.end-O(r)+1,t.end)},contains:y,intersection:function(r,t){if(h(r,t))return v(Math.max(r.start,t.start),Math.min(r.end,t.end))},intersects:h,isAt:m,isAfter:b,isAtOrAfter:function(r,t){return m(r,t)||b(r,t)},isBefore:A,isAtOrBefore:function(r,t){return m(r,t)||A(r,t)},length:O,subtract:function(r,t){return g(-1*r,t)},truncate:function(r,t){if(h(t,r))return v(Math.max(r.start,t.start),Math.min(r.end,t.end))}}),x=/^\W+/,I=/\W+$/,q=/^\W+|\W+$/g;for(var S=Object.freeze({__proto__:null,trimStart:function(r){return r.replace(x,"")},trimEnd:function(r){return r.replace(I,"")},trim:function(r){return r.replace(q,"")}}),w=function(r,t){return r<t?-1:r>t?1:0},P=function(r){var t=/^(([^:/?#]+):)?(\/\/([^/?#]*))?([^?#]*)(\?([^#]*))?(#(.*))?/.exec(r);return null!=t?{scheme:t[2],authority:t[4],path:t[5],query:t[7],fragment:t[9]}:{}},M=function(r,n){var e="/"===r[0]?r:"/"+r;return t.__assign(t.__assign({},n),{path:e})},z=function(r){return null!=r.path?D(r.path.split("/")):[]},C=function(r,n){if(null!=r[1]){var e=t.__spreadArrays(B(n),[r]);return t.__assign(t.__assign({},n),{query:e.map((function(r){return r.map(encodeURIComponent).join("=")})).join("&")})}return n},E=function(r,t){return r.reduce((function(r,t){return C(t,r)}),t)},U=function(r,t){return Q(r).reduce((function(r,t){return C(t,r)}),t)},B=function(r){return null!=r.query?k(r.query):[]},k=function(r){return r.split("&").map((function(r){return r.split("=").map((function(r){return decodeURIComponent(r)}))}))},D=function(r){return r.filter((function(r){return r.length>0}))},Q=function(r){var t=[];for(var n in r)t.push([n,r[n]]);return t},R=function(r){return r.concat().sort((t=w,function(r,n){var e=r[0],u=n[0];return t(e,u)}));var t},W=Object.freeze({__proto__:null,parse:P,parseAndAddParams:function(r,t){var n=P(r);return t?U(t,n):n},isEqual:function(r,t){var n=JSON.stringify(R(B(r))),e=JSON.stringify(R(B(t)));return r.scheme===t.scheme&&r.authority===t.authority&&r.path===t.path&&r.fragment===t.fragment&&n===e},replacePath:M,pathAsArray:z,appendPath:function(r,t){var n=z(t),e=D(r.split("/"));return M(n.concat(e).join("/"),t)},addQueryString:function(r,t){var n=k(r);return E(n,t)},addQueryEntry:C,addQueryEntries:E,addQueryParams:U,replaceFragment:function(r,n){return t.__assign(t.__assign({},n),{fragment:r})},queryAsArray:B,queryAsMap:function(r){return B(r).reduce((function(r,n){var e,u=n[0],a=n[1];return t.__assign(t.__assign({},r),((e={})[u]=a,e))}),{})},toString:function(r){var t="";return null!=r.scheme&&r.scheme.length>0&&(t=r.scheme+":"),null!=r.authority&&r.authority.length>0&&(t+="//"+r.authority),t+=r.path,null!=r.query&&r.query.length>0&&(t+="?"+r.query),null!=r.fragment&&r.fragment.length>0&&(t+="#"+r.fragment),t}}),F=function(){return n.randomBytes(16)},N=[],$=0;$<256;++$)N[$]=($+256).toString(16).substr(1);var H,J,L=function(r,t){var n=t||0,e=N;return[e[r[n++]],e[r[n++]],e[r[n++]],e[r[n++]],"-",e[r[n++]],e[r[n++]],"-",e[r[n++]],e[r[n++]],"-",e[r[n++]],e[r[n++]],"-",e[r[n++]],e[r[n++]],e[r[n++]],e[r[n++]],e[r[n++]],e[r[n++]]].join("")},T=0,V=0;var G=function(r,t,n){var e=t&&n||0,u=t||[],a=(r=r||{}).node||H,o=void 0!==r.clockseq?r.clockseq:J;if(null==a||null==o){var i=F();null==a&&(a=H=[1|i[0],i[1],i[2],i[3],i[4],i[5]]),null==o&&(o=J=16383&(i[6]<<8|i[7]))}var s=void 0!==r.msecs?r.msecs:(new Date).getTime(),f=void 0!==r.nsecs?r.nsecs:V+1,c=s-T+(f-V)/1e4;if(c<0&&void 0===r.clockseq&&(o=o+1&16383),(c<0||s>T)&&void 0===r.nsecs&&(f=0),f>=1e4)throw new Error("uuid.v1(): Can't create more than 10M uuids/sec");T=s,V=f,J=o;var l=(1e4*(268435455&(s+=122192928e5))+f)%4294967296;u[e++]=l>>>24&255,u[e++]=l>>>16&255,u[e++]=l>>>8&255,u[e++]=255&l;var p=s/4294967296*1e4&268435455;u[e++]=p>>>8&255,u[e++]=255&p,u[e++]=p>>>24&15|16,u[e++]=p>>>16&255,u[e++]=o>>>8|128,u[e++]=255&o;for(var d=0;d<6;++d)u[e+d]=a[d];return t||L(u)};var K=function(r,t,n){var e=t&&n||0;"string"==typeof r&&(t="binary"===r?new Array(16):null,r=null);var u=(r=r||{}).random||(r.rng||F)();if(u[6]=15&u[6]|64,u[8]=63&u[8]|128,t)for(var a=0;a<16;++a)t[e+a]=u[a];return t||L(u)},X=K;X.v1=G,X.v4=K;var Y=X.v1,Z=Object.freeze({__proto__:null,create:function(){return Y()}}),rr=function(){function r(){this.listeners=[]}return r.prototype.on=function(r){var t=this;return this.listeners.push(r),{dispose:function(){return t.off(r)}}},r.prototype.off=function(r){var t=this.listeners.indexOf(r);-1!==t&&this.listeners.splice(t,1)},r.prototype.emit=function(r){this.listeners.forEach((function(t){return t(r)}))},r}();exports.BinaryReader=e,exports.Color=l,exports.EventDispatcher=rr,exports.Objects=_,exports.Range=j,exports.Strings=S,exports.UUID=Z,exports.Uri=W; | ||
var t}var _=function(r){return!1!==d(t=r)&&"function"==typeof(n=t.constructor)&&!1!==d(e=n.prototype)&&!1!==e.hasOwnProperty("isPrototypeOf");var t,n,e};var v=Object.freeze({__proto__:null,defaults:function r(){for(var n=[],e=0;e<arguments.length;e++)n[e]=arguments[e];var u=n[0],a=n.slice(1),o=t.__assign({},u);if(0===a.length)return o;if(1===a.length){var i=a[0];for(var s in i)null==o[s]?o[s]=i[s]:_(o[s])&&(o[s]=r(o[s],i[s]));return o}return a.reduce((function(t,n){return r(t,n)}),u)},isPlainObject:_,toPairs:function(r){return null!=r?Object.keys(r).map((function(t){return[t,r[t]]})):[]},fromPairs:function(r){return Array.isArray(r)?r.reduce((function(r,n){var e;return null!=n?t.__assign(t.__assign({},r),((e={})[n[0]]=n[1],e)):r}),{}):{}}}),m=function(r,t){return{start:r,end:t}},g=function(r,t){return m(t.start+r,t.end+r)},y=function(r,t){return"number"==typeof r?t.start<=r&&r<=t.end:y(r.start,t)&&y(r.end,t)},h=function(r,t){return r.start<=t.end&&r.end>=t.start||t.start<=r.end&&t.end>=r.start},b=function(r,t){return r.start===t.start},A=function(r,t){return r.start>t.start},j=function(r,t){return r.start<t.start},O=function(r){return r.end-r.start+1},x=Object.freeze({__proto__:null,create:m,at:function(r){return{start:r,end:r}},withLength:function(r,t){return{start:r,end:r+t-1}},add:g,constrain:function(r,t){return y(r,t)?r:O(r)>O(t)?t:r.start<t.start?m(t.start,t.start+O(r)-1):m(t.end-O(r)+1,t.end)},contains:y,intersection:function(r,t){if(h(r,t))return m(Math.max(r.start,t.start),Math.min(r.end,t.end))},intersects:h,isAt:b,isAfter:A,isAtOrAfter:function(r,t){return b(r,t)||A(r,t)},isBefore:j,isAtOrBefore:function(r,t){return b(r,t)||j(r,t)},length:O,subtract:function(r,t){return g(-1*r,t)},truncate:function(r,t){if(h(t,r))return m(Math.max(r.start,t.start),Math.min(r.end,t.end))}}),w=/^\W+/,I=/\W+$/,q=/^\W+|\W+$/g;for(var P=Object.freeze({__proto__:null,trimStart:function(r){return r.replace(w,"")},trimEnd:function(r){return r.replace(I,"")},trim:function(r){return r.replace(q,"")}}),S=function(r,t){return r<t?-1:r>t?1:0},E=function(r){var t=/^(([^:/?#]+):)?(\/\/([^/?#]*))?([^?#]*)(\?([^#]*))?(#(.*))?/.exec(r);return null!=t?{scheme:t[2],authority:t[4],path:t[5],query:t[7],fragment:t[9]}:{}},z=function(r,n){var e="/"===r[0]?r:"/"+r;return t.__assign(t.__assign({},n),{path:e})},M=function(r){return null!=r.path?D(r.path.split("/")):[]},C=function(r,n){if(null!=r[1]){var e=t.__spreadArrays(F(n),[r]);return t.__assign(t.__assign({},n),{query:e.map((function(r){return r.map(encodeURIComponent).join("=")})).join("&")})}return n},U=function(r,t){return r.reduce((function(r,t){return C(t,r)}),t)},B=function(r,t){return Q(r).reduce((function(r,t){return C(t,r)}),t)},F=function(r){return null!=r.query?k(r.query):[]},k=function(r){return r.split("&").map((function(r){return r.split("=").map((function(r){return decodeURIComponent(r)}))}))},D=function(r){return r.filter((function(r){return r.length>0}))},Q=function(r){var t=[];for(var n in r)t.push([n,r[n]]);return t},R=function(r){return r.concat().sort((t=S,function(r,n){var e=r[0],u=n[0];return t(e,u)}));var t},T=Object.freeze({__proto__:null,parse:E,parseAndAddParams:function(r,t){var n=E(r);return t?B(t,n):n},isEqual:function(r,t){var n=JSON.stringify(R(F(r))),e=JSON.stringify(R(F(t)));return r.scheme===t.scheme&&r.authority===t.authority&&r.path===t.path&&r.fragment===t.fragment&&n===e},replacePath:z,pathAsArray:M,appendPath:function(r,t){var n=M(t),e=D(r.split("/"));return z(n.concat(e).join("/"),t)},addQueryString:function(r,t){var n=k(r);return U(n,t)},addQueryEntry:C,addQueryEntries:U,addQueryParams:B,replaceFragment:function(r,n){return t.__assign(t.__assign({},n),{fragment:r})},queryAsArray:F,queryAsMap:function(r){return F(r).reduce((function(r,n){var e,u=n[0],a=n[1];return t.__assign(t.__assign({},r),((e={})[u]=a,e))}),{})},toString:function(r){var t="";return null!=r.scheme&&r.scheme.length>0&&(t=r.scheme+":"),null!=r.authority&&r.authority.length>0&&(t+="//"+r.authority),t+=r.path,null!=r.query&&r.query.length>0&&(t+="?"+r.query),null!=r.fragment&&r.fragment.length>0&&(t+="#"+r.fragment),t}}),W=function(){return n.randomBytes(16)},N=[],$=0;$<256;++$)N[$]=($+256).toString(16).substr(1);var H,J,L=function(r,t){var n=t||0,e=N;return[e[r[n++]],e[r[n++]],e[r[n++]],e[r[n++]],"-",e[r[n++]],e[r[n++]],"-",e[r[n++]],e[r[n++]],"-",e[r[n++]],e[r[n++]],"-",e[r[n++]],e[r[n++]],e[r[n++]],e[r[n++]],e[r[n++]],e[r[n++]]].join("")},V=0,G=0;var K=function(r,t,n){var e=t&&n||0,u=t||[],a=(r=r||{}).node||H,o=void 0!==r.clockseq?r.clockseq:J;if(null==a||null==o){var i=W();null==a&&(a=H=[1|i[0],i[1],i[2],i[3],i[4],i[5]]),null==o&&(o=J=16383&(i[6]<<8|i[7]))}var s=void 0!==r.msecs?r.msecs:(new Date).getTime(),f=void 0!==r.nsecs?r.nsecs:G+1,c=s-V+(f-G)/1e4;if(c<0&&void 0===r.clockseq&&(o=o+1&16383),(c<0||s>V)&&void 0===r.nsecs&&(f=0),f>=1e4)throw new Error("uuid.v1(): Can't create more than 10M uuids/sec");V=s,G=f,J=o;var l=(1e4*(268435455&(s+=122192928e5))+f)%4294967296;u[e++]=l>>>24&255,u[e++]=l>>>16&255,u[e++]=l>>>8&255,u[e++]=255&l;var p=s/4294967296*1e4&268435455;u[e++]=p>>>8&255,u[e++]=255&p,u[e++]=p>>>24&15|16,u[e++]=p>>>16&255,u[e++]=o>>>8|128,u[e++]=255&o;for(var d=0;d<6;++d)u[e+d]=a[d];return t||L(u)};var X=function(r,t,n){var e=t&&n||0;"string"==typeof r&&(t="binary"===r?new Array(16):null,r=null);var u=(r=r||{}).random||(r.rng||W)();if(u[6]=15&u[6]|64,u[8]=63&u[8]|128,t)for(var a=0;a<16;++a)t[e+a]=u[a];return t||L(u)},Y=X;Y.v1=K,Y.v4=X;var Z=Y.v1,rr=Object.freeze({__proto__:null,create:function(){return Z()}}),tr=function(){function r(){this.listeners=[]}return r.prototype.on=function(r){var t=this;return this.listeners.push(r),{dispose:function(){return t.off(r)}}},r.prototype.off=function(r){var t=this.listeners.indexOf(r);-1!==t&&this.listeners.splice(t,1)},r.prototype.emit=function(r){this.listeners.forEach((function(t){return t(r)}))},r}();exports.Async=e,exports.BinaryReader=u,exports.Color=p,exports.EventDispatcher=tr,exports.Objects=v,exports.Range=x,exports.Strings=P,exports.UUID=rr,exports.Uri=T; | ||
//# sourceMappingURL=bundle.cjs.min.js.map |
@@ -1,4 +0,60 @@ | ||
import { __assign, __spreadArrays } from 'tslib'; | ||
import { __awaiter, __generator, __assign, __spreadArrays } from 'tslib'; | ||
import crypto from 'crypto'; | ||
function delay() { | ||
var args = []; | ||
for (var _i = 0; _i < arguments.length; _i++) { | ||
args[_i] = arguments[_i]; | ||
} | ||
return __awaiter(this, void 0, void 0, function () { | ||
var ms, promise, delay_1; | ||
return __generator(this, function (_a) { | ||
switch (_a.label) { | ||
case 0: | ||
ms = args[0]; | ||
if (!(typeof ms === 'number')) return [3 /*break*/, 4]; | ||
promise = args[1]; | ||
delay_1 = new Promise(function (resolve) { return setTimeout(resolve, ms); }); | ||
if (!(promise != null)) return [3 /*break*/, 2]; | ||
return [4 /*yield*/, delay_1]; | ||
case 1: | ||
_a.sent(); | ||
return [2 /*return*/, promise]; | ||
case 2: return [2 /*return*/, delay_1]; | ||
case 3: return [3 /*break*/, 5]; | ||
case 4: return [2 /*return*/, Promise.reject(new TypeError('First argument to `delay` must be a number'))]; | ||
case 5: return [2 /*return*/]; | ||
} | ||
}); | ||
}); | ||
} | ||
function timeout() { | ||
var args = []; | ||
for (var _i = 0; _i < arguments.length; _i++) { | ||
args[_i] = arguments[_i]; | ||
} | ||
var ms = args[0]; | ||
if (typeof ms === 'number') { | ||
var promise = args[1]; | ||
var timeout_1 = new Promise(function (_, reject) { | ||
return setTimeout(function () { return reject(new Error("Promise timed out after " + ms + "ms")); }, ms); | ||
}); | ||
if (promise != null) { | ||
return Promise.race([promise, timeout_1]); | ||
} | ||
else { | ||
return timeout_1; | ||
} | ||
} | ||
else { | ||
return Promise.reject('First argument to `timeout` must be a number'); | ||
} | ||
} | ||
var async = /*#__PURE__*/Object.freeze({ | ||
__proto__: null, | ||
delay: delay, | ||
timeout: timeout | ||
}); | ||
/** | ||
@@ -845,3 +901,3 @@ * Returns a new `BinaryReader` for an `ArrayBuffer`. | ||
export { binaryReader as BinaryReader, color as Color, EventDispatcher, objects as Objects, range as Range, strings as Strings, uuid$1 as UUID, uri as Uri }; | ||
export { async as Async, binaryReader as BinaryReader, color as Color, EventDispatcher, objects as Objects, range as Range, strings as Strings, uuid$1 as UUID, uri as Uri }; | ||
//# sourceMappingURL=bundle.esm.js.map |
@@ -1,2 +0,2 @@ | ||
import{__assign as r,__spreadArrays as t}from"tslib";import n from"crypto";var e=Object.freeze({__proto__:null,fromArrayBuffer:function(r){return{offset:0,data:new DataView(r)}},readInt32:function(t){var n=t.data.getInt32(t.offset);return r(r({},t),{offset:t.offset+4,value:n})},readUtf8String:function(t,n){var e=String.fromCharCode.apply(null,Array.from(new Uint8Array(n.data.buffer,n.offset,t)));return r(r({},n),{offset:n.offset+t,value:e})},readInt8Array:function(t,n){var e=new Int8Array(n.data.buffer,n.offset,t);return r(r({},n),{offset:n.offset+t,value:e})},sliceInt8Array:function(t,n){var e=new Int8Array(n.data.buffer.slice(n.offset,t+n.offset));return r(r({},n),{offset:0,value:e})}}),u=/rgb\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*\)/,a=/rgba\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*,\s*(.+)\s*\)/,o=/^(#|0x)?([A-Fa-f0-9]{6})$/,i=function(r,t,n,e){return void 0===e&&(e=255),{r:r,g:t,b:n,a:e}},f=function(r){var t=16777215&r;return i(t>>16&255,t>>8&255,255&t)},s=function(r){var t=o.exec(r);if(null!=t)return f(parseInt(t[2],16))},c=function(r){var t=r.toString(16);return 1===t.length?"0"+t:t},l=Object.freeze({__proto__:null,create:i,fromNumber:f,fromHexString:s,fromCss:function(r){var t=u.exec(r);if(null!=t)return i(parseInt(t[1]),parseInt(t[2]),parseInt(t[3]));var n=a.exec(r);return null!=n?i(parseInt(n[1]),parseInt(n[2]),parseInt(n[3]),Math.floor(255*parseFloat(n[4]))):o.test(r)?s(r):void 0},fromArray:function(r){return i(r[0],r[1],r[2],r[3])},isInvisible:function(r){return 0===r.a},isOpaque:function(r){return 255===r.a},toHexString:function(r){return"#"+c(r.r)+c(r.g)+c(r.b)}}); | ||
import{__awaiter as r,__generator as t,__assign as n,__spreadArrays as e}from"tslib";import u from"crypto";var a=Object.freeze({__proto__:null,delay:function(){for(var n=[],e=0;e<arguments.length;e++)n[e]=arguments[e];return r(this,void 0,void 0,(function(){var r,e,u;return t(this,(function(t){switch(t.label){case 0:return"number"!=typeof(r=n[0])?[3,4]:(e=n[1],u=new Promise((function(t){return setTimeout(t,r)})),null==e?[3,2]:[4,u]);case 1:return t.sent(),[2,e];case 2:return[2,u];case 3:return[3,5];case 4:return[2,Promise.reject(new TypeError("First argument to `delay` must be a number"))];case 5:return[2]}}))}))},timeout:function(){for(var r=[],t=0;t<arguments.length;t++)r[t]=arguments[t];var n=r[0];if("number"==typeof n){var e=r[1],u=new Promise((function(r,t){return setTimeout((function(){return t(new Error("Promise timed out after "+n+"ms"))}),n)}));return null!=e?Promise.race([e,u]):u}return Promise.reject("First argument to `timeout` must be a number")}}),o=Object.freeze({__proto__:null,fromArrayBuffer:function(r){return{offset:0,data:new DataView(r)}},readInt32:function(r){var t=r.data.getInt32(r.offset);return n(n({},r),{offset:r.offset+4,value:t})},readUtf8String:function(r,t){var e=String.fromCharCode.apply(null,Array.from(new Uint8Array(t.data.buffer,t.offset,r)));return n(n({},t),{offset:t.offset+r,value:e})},readInt8Array:function(r,t){var e=new Int8Array(t.data.buffer,t.offset,r);return n(n({},t),{offset:t.offset+r,value:e})},sliceInt8Array:function(r,t){var e=new Int8Array(t.data.buffer.slice(t.offset,r+t.offset));return n(n({},t),{offset:0,value:e})}}),i=/rgb\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*\)/,f=/rgba\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*,\s*(.+)\s*\)/,s=/^(#|0x)?([A-Fa-f0-9]{6})$/,c=function(r,t,n,e){return void 0===e&&(e=255),{r:r,g:t,b:n,a:e}},l=function(r){var t=16777215&r;return c(t>>16&255,t>>8&255,255&t)},d=function(r){var t=s.exec(r);if(null!=t)return l(parseInt(t[2],16))},p=function(r){var t=r.toString(16);return 1===t.length?"0"+t:t},v=Object.freeze({__proto__:null,create:c,fromNumber:l,fromHexString:d,fromCss:function(r){var t=i.exec(r);if(null!=t)return c(parseInt(t[1]),parseInt(t[2]),parseInt(t[3]));var n=f.exec(r);return null!=n?c(parseInt(n[1]),parseInt(n[2]),parseInt(n[3]),Math.floor(255*parseFloat(n[4]))):s.test(r)?d(r):void 0},fromArray:function(r){return c(r[0],r[1],r[2],r[3])},isInvisible:function(r){return 0===r.a},isOpaque:function(r){return 255===r.a},toHexString:function(r){return"#"+p(r.r)+p(r.g)+p(r.b)}}); | ||
/*! | ||
@@ -8,3 +8,3 @@ * is-plain-object <https://github.com/jonschlinkert/is-plain-object> | ||
*/ | ||
function d(r){return!0==(null!=(t=r)&&"object"==typeof t&&!1===Array.isArray(t))&&"[object Object]"===Object.prototype.toString.call(r); | ||
function m(r){return!0==(null!=(t=r)&&"object"==typeof t&&!1===Array.isArray(t))&&"[object Object]"===Object.prototype.toString.call(r); | ||
/*! | ||
@@ -16,3 +16,3 @@ * isobject <https://github.com/jonschlinkert/isobject> | ||
*/ | ||
var t}var p=function(r){return!1!==d(t=r)&&"function"==typeof(n=t.constructor)&&!1!==d(e=n.prototype)&&!1!==e.hasOwnProperty("isPrototypeOf");var t,n,e};var v=Object.freeze({__proto__:null,defaults:function t(){for(var n=[],e=0;e<arguments.length;e++)n[e]=arguments[e];var u=n[0],a=n.slice(1),o=r({},u);if(0===a.length)return o;if(1===a.length){var i=a[0];for(var f in i)null==o[f]?o[f]=i[f]:p(o[f])&&(o[f]=t(o[f],i[f]));return o}return a.reduce((function(r,n){return t(r,n)}),u)},isPlainObject:p,toPairs:function(r){return null!=r?Object.keys(r).map((function(t){return[t,r[t]]})):[]},fromPairs:function(t){return Array.isArray(t)?t.reduce((function(t,n){var e;return null!=n?r(r({},t),((e={})[n[0]]=n[1],e)):t}),{}):{}}}),y=function(r,t){return{start:r,end:t}},h=function(r,t){return y(t.start+r,t.end+r)},m=function(r,t){return"number"==typeof r?t.start<=r&&r<=t.end:m(r.start,t)&&m(r.end,t)},g=function(r,t){return r.start<=t.end&&r.end>=t.start||t.start<=r.end&&t.end>=r.start},b=function(r,t){return r.start===t.start},_=function(r,t){return r.start>t.start},A=function(r,t){return r.start<t.start},O=function(r){return r.end-r.start+1},j=Object.freeze({__proto__:null,create:y,at:function(r){return{start:r,end:r}},withLength:function(r,t){return{start:r,end:r+t-1}},add:h,constrain:function(r,t){return m(r,t)?r:O(r)>O(t)?t:r.start<t.start?y(t.start,t.start+O(r)-1):y(t.end-O(r)+1,t.end)},contains:m,intersection:function(r,t){if(g(r,t))return y(Math.max(r.start,t.start),Math.min(r.end,t.end))},intersects:g,isAt:b,isAfter:_,isAtOrAfter:function(r,t){return b(r,t)||_(r,t)},isBefore:A,isAtOrBefore:function(r,t){return b(r,t)||A(r,t)},length:O,subtract:function(r,t){return h(-1*r,t)},truncate:function(r,t){if(g(t,r))return y(Math.max(r.start,t.start),Math.min(r.end,t.end))}}),I=/^\W+/,q=/\W+$/,S=/^\W+|\W+$/g;for(var w=Object.freeze({__proto__:null,trimStart:function(r){return r.replace(I,"")},trimEnd:function(r){return r.replace(q,"")},trim:function(r){return r.replace(S,"")}}),x=function(r,t){return r<t?-1:r>t?1:0},P=function(r){var t=/^(([^:/?#]+):)?(\/\/([^/?#]*))?([^?#]*)(\?([^#]*))?(#(.*))?/.exec(r);return null!=t?{scheme:t[2],authority:t[4],path:t[5],query:t[7],fragment:t[9]}:{}},z=function(t,n){var e="/"===t[0]?t:"/"+t;return r(r({},n),{path:e})},C=function(r){return null!=r.path?Q(r.path.split("/")):[]},M=function(n,e){if(null!=n[1]){var u=t(B(e),[n]);return r(r({},e),{query:u.map((function(r){return r.map(encodeURIComponent).join("=")})).join("&")})}return e},U=function(r,t){return r.reduce((function(r,t){return M(t,r)}),t)},E=function(r,t){return R(r).reduce((function(r,t){return M(t,r)}),t)},B=function(r){return null!=r.query?k(r.query):[]},k=function(r){return r.split("&").map((function(r){return r.split("=").map((function(r){return decodeURIComponent(r)}))}))},Q=function(r){return r.filter((function(r){return r.length>0}))},R=function(r){var t=[];for(var n in r)t.push([n,r[n]]);return t},W=function(r){return r.concat().sort((t=x,function(r,n){var e=r[0],u=n[0];return t(e,u)}));var t},D=Object.freeze({__proto__:null,parse:P,parseAndAddParams:function(r,t){var n=P(r);return t?E(t,n):n},isEqual:function(r,t){var n=JSON.stringify(W(B(r))),e=JSON.stringify(W(B(t)));return r.scheme===t.scheme&&r.authority===t.authority&&r.path===t.path&&r.fragment===t.fragment&&n===e},replacePath:z,pathAsArray:C,appendPath:function(r,t){var n=C(t),e=Q(r.split("/"));return z(n.concat(e).join("/"),t)},addQueryString:function(r,t){var n=k(r);return U(n,t)},addQueryEntry:M,addQueryEntries:U,addQueryParams:E,replaceFragment:function(t,n){return r(r({},n),{fragment:t})},queryAsArray:B,queryAsMap:function(t){return B(t).reduce((function(t,n){var e,u=n[0],a=n[1];return r(r({},t),((e={})[u]=a,e))}),{})},toString:function(r){var t="";return null!=r.scheme&&r.scheme.length>0&&(t=r.scheme+":"),null!=r.authority&&r.authority.length>0&&(t+="//"+r.authority),t+=r.path,null!=r.query&&r.query.length>0&&(t+="?"+r.query),null!=r.fragment&&r.fragment.length>0&&(t+="#"+r.fragment),t}}),F=function(){return n.randomBytes(16)},N=[],$=0;$<256;++$)N[$]=($+256).toString(16).substr(1);var H,J,L=function(r,t){var n=t||0,e=N;return[e[r[n++]],e[r[n++]],e[r[n++]],e[r[n++]],"-",e[r[n++]],e[r[n++]],"-",e[r[n++]],e[r[n++]],"-",e[r[n++]],e[r[n++]],"-",e[r[n++]],e[r[n++]],e[r[n++]],e[r[n++]],e[r[n++]],e[r[n++]]].join("")},T=0,V=0;var G=function(r,t,n){var e=t&&n||0,u=t||[],a=(r=r||{}).node||H,o=void 0!==r.clockseq?r.clockseq:J;if(null==a||null==o){var i=F();null==a&&(a=H=[1|i[0],i[1],i[2],i[3],i[4],i[5]]),null==o&&(o=J=16383&(i[6]<<8|i[7]))}var f=void 0!==r.msecs?r.msecs:(new Date).getTime(),s=void 0!==r.nsecs?r.nsecs:V+1,c=f-T+(s-V)/1e4;if(c<0&&void 0===r.clockseq&&(o=o+1&16383),(c<0||f>T)&&void 0===r.nsecs&&(s=0),s>=1e4)throw new Error("uuid.v1(): Can't create more than 10M uuids/sec");T=f,V=s,J=o;var l=(1e4*(268435455&(f+=122192928e5))+s)%4294967296;u[e++]=l>>>24&255,u[e++]=l>>>16&255,u[e++]=l>>>8&255,u[e++]=255&l;var d=f/4294967296*1e4&268435455;u[e++]=d>>>8&255,u[e++]=255&d,u[e++]=d>>>24&15|16,u[e++]=d>>>16&255,u[e++]=o>>>8|128,u[e++]=255&o;for(var p=0;p<6;++p)u[e+p]=a[p];return t||L(u)};var K=function(r,t,n){var e=t&&n||0;"string"==typeof r&&(t="binary"===r?new Array(16):null,r=null);var u=(r=r||{}).random||(r.rng||F)();if(u[6]=15&u[6]|64,u[8]=63&u[8]|128,t)for(var a=0;a<16;++a)t[e+a]=u[a];return t||L(u)},X=K;X.v1=G,X.v4=K;var Y=X.v1,Z=Object.freeze({__proto__:null,create:function(){return Y()}}),rr=function(){function r(){this.listeners=[]}return r.prototype.on=function(r){var t=this;return this.listeners.push(r),{dispose:function(){return t.off(r)}}},r.prototype.off=function(r){var t=this.listeners.indexOf(r);-1!==t&&this.listeners.splice(t,1)},r.prototype.emit=function(r){this.listeners.forEach((function(t){return t(r)}))},r}();export{e as BinaryReader,l as Color,rr as EventDispatcher,v as Objects,j as Range,w as Strings,Z as UUID,D as Uri}; | ||
var t}var y=function(r){return!1!==m(t=r)&&"function"==typeof(n=t.constructor)&&!1!==m(e=n.prototype)&&!1!==e.hasOwnProperty("isPrototypeOf");var t,n,e};var h=Object.freeze({__proto__:null,defaults:function r(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var u=t[0],a=t.slice(1),o=n({},u);if(0===a.length)return o;if(1===a.length){var i=a[0];for(var f in i)null==o[f]?o[f]=i[f]:y(o[f])&&(o[f]=r(o[f],i[f]));return o}return a.reduce((function(t,n){return r(t,n)}),u)},isPlainObject:y,toPairs:function(r){return null!=r?Object.keys(r).map((function(t){return[t,r[t]]})):[]},fromPairs:function(r){return Array.isArray(r)?r.reduce((function(r,t){var e;return null!=t?n(n({},r),((e={})[t[0]]=t[1],e)):r}),{}):{}}}),g=function(r,t){return{start:r,end:t}},b=function(r,t){return g(t.start+r,t.end+r)},_=function(r,t){return"number"==typeof r?t.start<=r&&r<=t.end:_(r.start,t)&&_(r.end,t)},A=function(r,t){return r.start<=t.end&&r.end>=t.start||t.start<=r.end&&t.end>=r.start},j=function(r,t){return r.start===t.start},O=function(r,t){return r.start>t.start},I=function(r,t){return r.start<t.start},w=function(r){return r.end-r.start+1},P=Object.freeze({__proto__:null,create:g,at:function(r){return{start:r,end:r}},withLength:function(r,t){return{start:r,end:r+t-1}},add:b,constrain:function(r,t){return _(r,t)?r:w(r)>w(t)?t:r.start<t.start?g(t.start,t.start+w(r)-1):g(t.end-w(r)+1,t.end)},contains:_,intersection:function(r,t){if(A(r,t))return g(Math.max(r.start,t.start),Math.min(r.end,t.end))},intersects:A,isAt:j,isAfter:O,isAtOrAfter:function(r,t){return j(r,t)||O(r,t)},isBefore:I,isAtOrBefore:function(r,t){return j(r,t)||I(r,t)},length:w,subtract:function(r,t){return b(-1*r,t)},truncate:function(r,t){if(A(t,r))return g(Math.max(r.start,t.start),Math.min(r.end,t.end))}}),q=/^\W+/,S=/\W+$/,x=/^\W+|\W+$/g;for(var z=Object.freeze({__proto__:null,trimStart:function(r){return r.replace(q,"")},trimEnd:function(r){return r.replace(S,"")},trim:function(r){return r.replace(x,"")}}),E=function(r,t){return r<t?-1:r>t?1:0},C=function(r){var t=/^(([^:/?#]+):)?(\/\/([^/?#]*))?([^?#]*)(\?([^#]*))?(#(.*))?/.exec(r);return null!=t?{scheme:t[2],authority:t[4],path:t[5],query:t[7],fragment:t[9]}:{}},M=function(r,t){var e="/"===r[0]?r:"/"+r;return n(n({},t),{path:e})},U=function(r){return null!=r.path?T(r.path.split("/")):[]},B=function(r,t){if(null!=r[1]){var u=e(Q(t),[r]);return n(n({},t),{query:u.map((function(r){return r.map(encodeURIComponent).join("=")})).join("&")})}return t},F=function(r,t){return r.reduce((function(r,t){return B(t,r)}),t)},k=function(r,t){return W(r).reduce((function(r,t){return B(t,r)}),t)},Q=function(r){return null!=r.query?R(r.query):[]},R=function(r){return r.split("&").map((function(r){return r.split("=").map((function(r){return decodeURIComponent(r)}))}))},T=function(r){return r.filter((function(r){return r.length>0}))},W=function(r){var t=[];for(var n in r)t.push([n,r[n]]);return t},D=function(r){return r.concat().sort((t=E,function(r,n){var e=r[0],u=n[0];return t(e,u)}));var t},N=Object.freeze({__proto__:null,parse:C,parseAndAddParams:function(r,t){var n=C(r);return t?k(t,n):n},isEqual:function(r,t){var n=JSON.stringify(D(Q(r))),e=JSON.stringify(D(Q(t)));return r.scheme===t.scheme&&r.authority===t.authority&&r.path===t.path&&r.fragment===t.fragment&&n===e},replacePath:M,pathAsArray:U,appendPath:function(r,t){var n=U(t),e=T(r.split("/"));return M(n.concat(e).join("/"),t)},addQueryString:function(r,t){var n=R(r);return F(n,t)},addQueryEntry:B,addQueryEntries:F,addQueryParams:k,replaceFragment:function(r,t){return n(n({},t),{fragment:r})},queryAsArray:Q,queryAsMap:function(r){return Q(r).reduce((function(r,t){var e,u=t[0],a=t[1];return n(n({},r),((e={})[u]=a,e))}),{})},toString:function(r){var t="";return null!=r.scheme&&r.scheme.length>0&&(t=r.scheme+":"),null!=r.authority&&r.authority.length>0&&(t+="//"+r.authority),t+=r.path,null!=r.query&&r.query.length>0&&(t+="?"+r.query),null!=r.fragment&&r.fragment.length>0&&(t+="#"+r.fragment),t}}),$=function(){return u.randomBytes(16)},H=[],J=0;J<256;++J)H[J]=(J+256).toString(16).substr(1);var L,V,G=function(r,t){var n=t||0,e=H;return[e[r[n++]],e[r[n++]],e[r[n++]],e[r[n++]],"-",e[r[n++]],e[r[n++]],"-",e[r[n++]],e[r[n++]],"-",e[r[n++]],e[r[n++]],"-",e[r[n++]],e[r[n++]],e[r[n++]],e[r[n++]],e[r[n++]],e[r[n++]]].join("")},K=0,X=0;var Y=function(r,t,n){var e=t&&n||0,u=t||[],a=(r=r||{}).node||L,o=void 0!==r.clockseq?r.clockseq:V;if(null==a||null==o){var i=$();null==a&&(a=L=[1|i[0],i[1],i[2],i[3],i[4],i[5]]),null==o&&(o=V=16383&(i[6]<<8|i[7]))}var f=void 0!==r.msecs?r.msecs:(new Date).getTime(),s=void 0!==r.nsecs?r.nsecs:X+1,c=f-K+(s-X)/1e4;if(c<0&&void 0===r.clockseq&&(o=o+1&16383),(c<0||f>K)&&void 0===r.nsecs&&(s=0),s>=1e4)throw new Error("uuid.v1(): Can't create more than 10M uuids/sec");K=f,X=s,V=o;var l=(1e4*(268435455&(f+=122192928e5))+s)%4294967296;u[e++]=l>>>24&255,u[e++]=l>>>16&255,u[e++]=l>>>8&255,u[e++]=255&l;var d=f/4294967296*1e4&268435455;u[e++]=d>>>8&255,u[e++]=255&d,u[e++]=d>>>24&15|16,u[e++]=d>>>16&255,u[e++]=o>>>8|128,u[e++]=255&o;for(var p=0;p<6;++p)u[e+p]=a[p];return t||G(u)};var Z=function(r,t,n){var e=t&&n||0;"string"==typeof r&&(t="binary"===r?new Array(16):null,r=null);var u=(r=r||{}).random||(r.rng||$)();if(u[6]=15&u[6]|64,u[8]=63&u[8]|128,t)for(var a=0;a<16;++a)t[e+a]=u[a];return t||G(u)},rr=Z;rr.v1=Y,rr.v4=Z;var tr=rr.v1,nr=Object.freeze({__proto__:null,create:function(){return tr()}}),er=function(){function r(){this.listeners=[]}return r.prototype.on=function(r){var t=this;return this.listeners.push(r),{dispose:function(){return t.off(r)}}},r.prototype.off=function(r){var t=this.listeners.indexOf(r);-1!==t&&this.listeners.splice(t,1)},r.prototype.emit=function(r){this.listeners.forEach((function(t){return t(r)}))},r}();export{a as Async,o as BinaryReader,v as Color,er as EventDispatcher,h as Objects,P as Range,z as Strings,nr as UUID,N as Uri}; | ||
//# sourceMappingURL=bundle.esm.min.js.map |
@@ -0,1 +1,2 @@ | ||
import * as Async from './async'; | ||
import * as BinaryReader from './binaryReader'; | ||
@@ -11,2 +12,2 @@ import * as Color from './color'; | ||
export * from './eventDispatcher'; | ||
export { BinaryReader, Color, Objects, Range, Strings, Uri, UUID }; | ||
export { Async, BinaryReader, Color, Objects, Range, Strings, Uri, UUID }; |
@@ -28,7 +28,19 @@ /** | ||
*/ | ||
export declare type DeepRequired<T, P extends string[]> = T extends object ? Pick<T, Extract<keyof T, P[0]>> & Required<{ | ||
export declare type DeepRequired<T, P extends string[]> = T extends unknown[] ? T : T extends object ? Pick<T, Extract<keyof T, P[0]>> & Required<{ | ||
[K in Exclude<keyof T, P[0]>]: NonNullable<DeepRequired<T[K], ShiftUnion<K, P>>>; | ||
}> : T; | ||
declare type Shift<T extends any[]> = ((...t: T) => any) extends (first: any, ...rest: infer Rest) => any ? Rest : never; | ||
declare type ShiftUnion<P extends PropertyKey, T extends any[]> = T extends any[] ? T[0] extends P ? Shift<T> : never : never; | ||
declare type Shift<T extends unknown[]> = ((...t: T) => unknown) extends (first: unknown, ...rest: infer Rest) => unknown ? Rest : never; | ||
declare type ShiftUnion<P extends PropertyKey, T extends unknown[]> = T extends unknown[] ? (T[0] extends P ? Shift<T> : never) : never; | ||
/** | ||
* A type that extends `Required` that in addition to making fields | ||
* not undefined, also makes them not nullable. | ||
* | ||
* @example | ||
* | ||
*type Foo = { a?: number | null }; | ||
*type Bar = RequiredAndNonNullable<Bar>; // { a: number } | ||
*/ | ||
export declare type RequiredAndNonNullable<T> = Required<{ | ||
[P in keyof T]: NonNullable<T[P]>; | ||
}>; | ||
export {}; |
{ | ||
"name": "@vertexvis/utils", | ||
"version": "0.8.0", | ||
"version": "0.9.0", | ||
"description": "Utility library for Viewer SDK.", | ||
@@ -47,3 +47,3 @@ "license": "MIT", | ||
"@vertexvis/jest-config-vertexvis": "0.4.4", | ||
"@vertexwebsdk/build": "0.8.0", | ||
"@vertexwebsdk/build": "0.9.0", | ||
"eslint": "^6.1.0", | ||
@@ -56,3 +56,3 @@ "jest": "^24.9.0", | ||
}, | ||
"gitHead": "7cea7609b4826b34472b2f5581280628f960ea8e" | ||
"gitHead": "b2e20907cd07d360426da32aa63df9826f227f02" | ||
} |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
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
555659
32
4053