bimplus-websdk 0.0.174 → 0.0.178

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -1,115 +1,115 @@
1
- bim+ websdk
2
- =========
3
-
4
- bim+ websdk is a javascript wrapper around the bim+ api
5
-
6
- Quick Links
7
- -----------
8
-
9
- https://doc.allplan.com/display/bimpluspublic/Bimplus+Web+SDK+Reference
10
-
11
- How to build
12
- ------------
13
-
14
- ### Install nodejs
15
- [http://www.nodejs.org/](http://www.nodejs.org/)
16
-
17
- ### Install local npm modules
18
- Open up a normal command line (admin is not needed) and go to the websdk folder
19
-
20
- npm install
21
-
22
- (whenever package.json has changed, you might to do this again)
23
-
24
- ### Build websdk
25
- Library building process is using UMD (Universal Module Definition) output format so
26
- it's compatible with both cjs and amd module formats. The same library can be use in the
27
- client or on the server. Build process is using babel so it's possible to use new ES2015
28
- code in source codes.
29
-
30
- Library can be build in several ways as a dev or prod version.
31
- To run a dev build with source maps run:
32
-
33
- npm run build
34
-
35
- To build a prod version - uglified, minified run:
36
-
37
- npm run build-prod
38
-
39
- Pulish new release to npm (Hint: Before doing this npm login needs to be done and the package version adjusted) :
40
-
41
- npm run npm-publish
42
-
43
- Check content of npm package (result is bimplus-renderer@(version).tar.gz)
44
-
45
- npm run npm-pack
46
-
47
-
48
- ### Develop/Debug websdk
49
- goto your websdk folder
50
-
51
- npm link
52
-
53
- goto your application folder which uses the websdk
54
-
55
- npm link bimplus-websdk
56
-
57
- Do you changes in the websdk and build
58
-
59
- npm run build
60
-
61
- or
62
-
63
- npm run build-prod
64
-
65
- Your app will automatically get the changes done in the renderer
66
-
67
- After developing it might be wise to unlink:
68
- goto your websdk folder
69
-
70
- npm unlink
71
- goto your application folder which uses the websdk
72
-
73
- npm unlink bimplus-websdk
74
- npm install
75
-
76
- ### Unit testing
77
- With every build output is copied also to the test folder.
78
- To run the unit tests go to the test subfolder and run :
79
-
80
- npm install
81
- npm run test
82
-
83
- For more information see README.md inside the test folder
84
-
85
- ### Documentation
86
- Bimplus WebSDK uses npm documentation plugin for easy documentation generation.
87
- To generate a documentation please install documentation plugin via npm :
88
-
89
- npm install -g documentation
90
-
91
- To create documentation in html format go to your websdk folder and run :
92
-
93
- npm run build-doc
94
-
95
- Documentation output will be in websdk/documentation folder
96
-
97
- To create documentation in markdown format go to your websdk folder and run :
98
-
99
- npm run build-docMd
100
-
101
- Documentation output will be in websdk/documentation/Bimplus_WebSDK_doc.md file.
102
-
103
- To create a markdown suitable for Confluence run script:
104
-
105
- npm run build-docConf
106
-
107
- This script will convert generated markdown into Confluence format. See console
108
- output for converted file name.
109
-
110
- Content of the confluence file can be inserted into Confluence page :
111
- - start confluence page editation mode
112
- - choose Insert more content / {} Markup option from toolbar
113
- - in popup window choose to Insert Markdown format
114
- - copy content of the converted confluence markdown file into the field in Confluence
115
- - save it (Please note that page links doesn't work in page preview mode)
1
+ bim+ websdk
2
+ =========
3
+
4
+ bim+ websdk is a javascript wrapper around the bim+ api
5
+
6
+ Quick Links
7
+ -----------
8
+
9
+ https://doc.allplan.com/display/bimpluspublic/Bimplus+Web+SDK+Reference
10
+
11
+ How to build
12
+ ------------
13
+
14
+ ### Install nodejs
15
+ [http://www.nodejs.org/](http://www.nodejs.org/)
16
+
17
+ ### Install local npm modules
18
+ Open up a normal command line (admin is not needed) and go to the websdk folder
19
+
20
+ npm install
21
+
22
+ (whenever package.json has changed, you might to do this again)
23
+
24
+ ### Build websdk
25
+ Library building process is using UMD (Universal Module Definition) output format so
26
+ it's compatible with both cjs and amd module formats. The same library can be use in the
27
+ client or on the server. Build process is using babel so it's possible to use new ES2015
28
+ code in source codes.
29
+
30
+ Library can be build in several ways as a dev or prod version.
31
+ To run a dev build with source maps run:
32
+
33
+ npm run build
34
+
35
+ To build a prod version - uglified, minified run:
36
+
37
+ npm run build-prod
38
+
39
+ Pulish new release to npm (Hint: Before doing this npm login needs to be done and the package version adjusted) :
40
+
41
+ npm run npm-publish
42
+
43
+ Check content of npm package (result is bimplus-renderer@(version).tar.gz)
44
+
45
+ npm run npm-pack
46
+
47
+
48
+ ### Develop/Debug websdk
49
+ goto your websdk folder
50
+
51
+ npm link
52
+
53
+ goto your application folder which uses the websdk
54
+
55
+ npm link bimplus-websdk
56
+
57
+ Do you changes in the websdk and build
58
+
59
+ npm run build
60
+
61
+ or
62
+
63
+ npm run build-prod
64
+
65
+ Your app will automatically get the changes done in the renderer
66
+
67
+ After developing it might be wise to unlink:
68
+ goto your websdk folder
69
+
70
+ npm unlink
71
+ goto your application folder which uses the websdk
72
+
73
+ npm unlink bimplus-websdk
74
+ npm install
75
+
76
+ ### Unit testing
77
+ With every build output is copied also to the test folder.
78
+ To run the unit tests go to the test subfolder and run :
79
+
80
+ npm install
81
+ npm run test
82
+
83
+ For more information see README.md inside the test folder
84
+
85
+ ### Documentation
86
+ Bimplus WebSDK uses npm documentation plugin for easy documentation generation.
87
+ To generate a documentation please install documentation plugin via npm :
88
+
89
+ npm install -g documentation
90
+
91
+ To create documentation in html format go to your websdk folder and run :
92
+
93
+ npm run build-doc
94
+
95
+ Documentation output will be in websdk/documentation folder
96
+
97
+ To create documentation in markdown format go to your websdk folder and run :
98
+
99
+ npm run build-docMd
100
+
101
+ Documentation output will be in websdk/documentation/Bimplus_WebSDK_doc.md file.
102
+
103
+ To create a markdown suitable for Confluence run script:
104
+
105
+ npm run build-docConf
106
+
107
+ This script will convert generated markdown into Confluence format. See console
108
+ output for converted file name.
109
+
110
+ Content of the confluence file can be inserted into Confluence page :
111
+ - start confluence page editation mode
112
+ - choose Insert more content / {} Markup option from toolbar
113
+ - in popup window choose to Insert Markdown format
114
+ - copy content of the converted confluence markdown file into the field in Confluence
115
+ - save it (Please note that page links doesn't work in page preview mode)
package/clean CHANGED
@@ -1,3 +1,3 @@
1
- #!/usr/bin/env bash
2
-
3
- rm -rf ./dist ./node_modules
1
+ #!/usr/bin/env bash
2
+
3
+ rm -rf ./dist ./node_modules
@@ -1 +1 @@
1
- !function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.add=t():e.add=t()}(window,(function(){return function(e){function t(r){if(n[r])return n[r].exports;var i=n[r]={i:r,l:!1,exports:{}};return e[r].call(i.exports,i,i.exports,t),i.l=!0,i.exports}var n={};return t.m=e,t.c=n,t.d=function(e,n,r){t.o(e,n)||Object.defineProperty(e,n,{enumerable:!0,get:r})},t.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},t.t=function(e,n){if(1&n&&(e=t(e)),8&n)return e;if(4&n&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(t.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&n&&"string"!=typeof e)for(var i in e)t.d(r,i,function(t){return e[t]}.bind(null,i));return r},t.n=function(e){var n=e&&e.__esModule?function(){return e.default}:function(){return e};return t.d(n,"a",n),n},t.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},t.p="",t(t.s=0)}([function(e,t,n){"use strict";function r(e,t,n,r){return $.ajax({url:e,type:t,data:n,contentType:r&&void 0!==r.contentType?r.contentType:"application/json; charset=utf-8",dataType:r&&void 0!==r.dataType?r.dataType:"json",processData:!(!r||void 0===r.processData)&&r.processData,cache:!(!window||!window.BIMPLUS_SDK_ENABLE_CACHE),async:!0,xhr:function(){var e=$.ajaxSettings.xhr();return r&&void 0!==r.xhrUploadProgress&&e.upload.addEventListener("progress",r.xhrUploadProgress,!1),e},beforeSend:function(e){if(window&&void 0!==window.BIMPLUS_SDK_PENDING_REQUESTS&&window.BIMPLUS_SDK_PENDING_REQUESTS++,r&&r.token){var t=r.tokenType?r.tokenType:"BimPlus";e.setRequestHeader("Authorization",t+" "+r.token)}r&&r.eTag&&(e.setRequestHeader("Cache-Control","no-cache"),window&&!window.BIMPLUS_SDK_DISABLE_ETAG&&e.setRequestHeader("If-None-Match",r.eTag))},complete:function(e){window&&void 0!==window.BIMPLUS_SDK_PENDING_REQUESTS&&window.BIMPLUS_SDK_PENDING_REQUESTS--,window&&window.BIMPLUS_SDK_LOG_API_CALLS&&e&&e.responseText&&0<e.responseText.length&&JSON.parse(e.responseText)}})}function i(e,t,n,r){var i=$.Deferred(),s=new XMLHttpRequest;return s.open(t,e,!0),s.setRequestHeader("Authorization","BimPlus "+r.token),window&&void 0!==window.BIMPLUS_SDK_PENDING_REQUESTS&&window.BIMPLUS_SDK_PENDING_REQUESTS++,r&&r.responseType&&(s.responseType=r.responseType),r&&r.eTag&&(s.setRequestHeader("Cache-Control","no-cache"),window&&!window.BIMPLUS_SDK_DISABLE_ETAG&&s.setRequestHeader("If-None-Match",r.eTag)),s.onload=function(){window&&void 0!==window.BIMPLUS_SDK_PENDING_REQUESTS&&window.BIMPLUS_SDK_PENDING_REQUESTS--,i.resolve(s.response,s.status,s)},s.onerror=function(){window&&void 0!==window.BIMPLUS_SDK_PENDING_REQUESTS&&window.BIMPLUS_SDK_PENDING_REQUESTS--,i.reject()},n&&s.setRequestHeader("Content-Type","application/json;charset=UTF-8"),s.send(n),i.promise()}function s(e){var t="?";for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t+=n+"="+e[n]+"&");return t=t.slice(0,-1)}function o(e,t,n,r,i){i||(i={}),i.token||(i.token=t),i.queryParams||(i.queryParams={}),i.queryParams.chunkSize=n,i.queryParams.chunk=1;var s=$.Deferred(),o=[];return e.get(r,i).done((function(t,n,u){o.push(t);var a=0;if(200===u.status){var c=u.getResponseHeader("X-Total-Count");c&&(a=parseInt(c,10))}else 304===u.status&&u["Cached-X-Total-Count"]&&(a=u["Cached-X-Total-Count"]);for(var l=[],p=2;p<=a;p++){i.queryParams.chunk=p;var f=e.get(r,i).done((function(e){o.push(e)})).fail((function(e,t){s.reject(e,t)}));l.push(f)}Promise.all(l).then((function(){s.resolve(o)}))})).fail((function(e,t){s.reject(e,t)})),s.promise()}function u(){for(var e=0,t=0,n=arguments.length;t<n;t++)e+=arguments[t].length;var r=Array(e),i=0;for(t=0;t<n;t++)for(var s=arguments[t],o=0,u=s.length;o<u;o++,i++)r[i]=s[o];return r}function a(e,t){return"object"==typeof t?(Tt(t).forEach((function(n){e[n]=t[n]})),e):e}function c(e,t){return _t.call(e,t)}function l(e,t){"function"==typeof t&&(t=t(wt(e))),Tt(t).forEach((function(n){p(e,n,t[n])}))}function p(e,t,n,r){Ut(e,t,a(n&&c(n,"get")&&"function"==typeof n.get?{get:n.get,set:n.set,configurable:!0}:{value:n,configurable:!0,writable:!0},r))}function f(e){return{from:function(t){return e.prototype=Object.create(t.prototype),p(e.prototype,"constructor",e),{extend:l.bind(null,e.prototype)}}}}function h(e,t,n){return kt.call(e,t,n)}function d(e,t){return t(e)}function g(e){if(!e)throw new Error("Assertion Failed")}function m(e){qt.setImmediate?setImmediate(e):setTimeout(e,0)}function y(e,t){return e.reduce((function(e,n,r){var i=t(n,r);return i&&(e[i[0]]=i[1]),e}),{})}function v(e,t){if(c(e,t))return e[t];if(!t)return e;if("string"!=typeof t){for(var n,r=[],i=0,s=t.length;i<s;++i)n=v(e,t[i]),r.push(n);return r}var o=t.indexOf(".");if(-1!==o){var u=e[t.substr(0,o)];return void 0===u?void 0:v(u,t.substr(o+1))}}function b(e,t,n){if(e&&void 0!==t&&(!("isFrozen"in Object)||!Object.isFrozen(e)))if("string"!=typeof t&&"length"in t){g("string"!=typeof n&&"length"in n);for(var r=0,i=t.length;r<i;++r)b(e,t[r],n[r])}else{var s=t.indexOf(".");if(-1!==s){var o=t.substr(0,s),u=t.substr(s+1);if(""===u)void 0===n?At(e)&&!isNaN(parseInt(o))?e.splice(o,1):delete e[o]:e[o]=n;else{var a=e[o];a||(a=e[o]={}),b(a,u,n)}}else void 0===n?At(e)&&!isNaN(parseInt(t))?e.splice(t,1):delete e[t]:e[t]=n}}function T(e){var t={};for(var n in e)c(e,n)&&(t[n]=e[n]);return t}function A(e){return Pt.apply([],e)}function q(e){if(!e||"object"!=typeof e)return e;var t;if(At(e)){t=[];for(var n=0,r=e.length;n<r;++n)t.push(q(e[n]))}else if(0<=xt.indexOf(e.constructor))t=e;else for(var i in t=e.constructor?Object.create(e.constructor.prototype):{},e)c(e,i)&&(t[i]=q(e[i]));return t}function w(e){return Dt.call(e).slice(8,-1)}function _(e,t,n,r){return n=n||{},r=r||"",Tt(e).forEach((function(i){if(c(t,i)){var s=e[i],o=t[i];if("object"==typeof s&&"object"==typeof o&&s&&o){var u=w(s),a=w(o);u===a?Et[u]?Ot(s,u)!==Ot(o,a)&&(n[r+i]=t[i]):_(s,o,n,r+i+"."):n[r+i]=t[i]}else s!==o&&(n[r+i]=t[i])}else n[r+i]=void 0})),Tt(t).forEach((function(i){c(e,i)||(n[r+i]=t[i])})),n}function U(e){var t,n,r,i;if(1===arguments.length){if(At(e))return e.slice();if(this===It&&"string"==typeof e)return[e];if(i=Rt(e)){for(n=[];!(r=i.next()).done;)n.push(r.value);return n}if(null==e)return[e];if("number"==typeof(t=e.length)){for(n=Array(t);t--;)n[t]=e[t];return n}return[e]}for(t=arguments.length,n=Array(t);t--;)n[t]=arguments[t];return n}function j(e,t){Kt=e,Mt=t}function k(){if(Nt)try{throw new Error}catch(e){return e}return new Error}function P(e,t){var n=e.stack;return n?(t=t||0,0===n.indexOf(e.name)&&(t+=(e.name+e.message).split("\n").length),n.split("\n").slice(t).filter(Mt).map((function(e){return"\n"+e})).join("")):""}function S(e,t){this._e=k(),this.name=e,this.message=t}function x(e,t){return e+". Errors: "+Object.keys(t).map((function(e){return t[e].toString()})).filter((function(e,t,n){return n.indexOf(e)===t})).join("\n")}function E(e,t,n,r){this._e=k(),this.failures=t,this.failedKeys=r,this.successCount=n,this.message=x(e,t)}function D(e,t){this._e=k(),this.name="BulkError",this.failures=t,this.message=x(e,t)}function O(){}function C(e){return e}function R(e,t){return null==e||e===C?t:function(n){return t(e(n))}}function I(e,t){return function(){e.apply(this,arguments),t.apply(this,arguments)}}function B(e,t){return e===O?t:function(){var n=e.apply(this,arguments);void 0!==n&&(arguments[0]=n);var r=this.onsuccess,i=this.onerror;this.onsuccess=null,this.onerror=null;var s=t.apply(this,arguments);return r&&(this.onsuccess=this.onsuccess?I(r,this.onsuccess):r),i&&(this.onerror=this.onerror?I(i,this.onerror):i),void 0===s?n:s}}function K(e,t){return e===O?t:function(){e.apply(this,arguments);var n=this.onsuccess,r=this.onerror;this.onsuccess=this.onerror=null,t.apply(this,arguments),n&&(this.onsuccess=this.onsuccess?I(n,this.onsuccess):n),r&&(this.onerror=this.onerror?I(r,this.onerror):r)}}function M(e,t){return e===O?t:function(n){var r=e.apply(this,arguments);a(n,r);var i=this.onsuccess,s=this.onerror;this.onsuccess=null,this.onerror=null;var o=t.apply(this,arguments);return i&&(this.onsuccess=this.onsuccess?I(i,this.onsuccess):i),s&&(this.onerror=this.onerror?I(s,this.onerror):s),void 0===r?void 0===o?void 0:o:a(r,o)}}function N(e,t){return e===O?t:function(){return!1!==t.apply(this,arguments)&&e.apply(this,arguments)}}function F(e,t){return e===O?t:function(){var n=e.apply(this,arguments);if(n&&"function"==typeof n.then){for(var r=this,i=arguments.length,s=Array(i);i--;)s[i]=arguments[i];return n.then((function(){return t.apply(r,s)}))}return t.apply(this,arguments)}}function L(e){if("object"!=typeof this)throw new TypeError("Promises must be constructed via new");this._listeners=[],this.onuncatched=O,this._lib=!1;var t=this._PSD=mn;if(Kt&&(this._stackHolder=k(),this._prev=null,this._numPrev=0),"function"!=typeof e){if(e!==zt)throw new TypeError("Not a function");return this._state=arguments[1],this._value=arguments[2],void(!1===this._state&&V(this,this._value))}this._state=null,this._value=null,++t.ref,H(this,e)}function G(e,t,n,r,i){this.onFulfilled="function"==typeof e?e:null,this.onRejected="function"==typeof t?t:null,this.resolve=n,this.reject=r,this.psd=i}function H(e,t){try{t((function(t){if(null===e._state){if(t===e)throw new TypeError("A promise cannot be resolved with itself.");var n=e._lib&&Y();t&&"function"==typeof t.then?H(e,(function(e,n){t instanceof L?t._then(e,n):t.then(e,n)})):(e._state=!0,e._value=t,J(e)),n&&Z()}}),V.bind(null,e))}catch(t){V(e,t)}}function V(e,t){if(fn.push(t),null===e._state){var n=e._lib&&Y();t=dn(t),e._state=!1,e._value=t,Kt&&null!==t&&"object"==typeof t&&!t._promise&&function(e,t,n){try{e.apply(null,n)}catch(e){t&&t(e)}}((function(){var n=function e(t,n){var r;return jt(t,n)||(r=wt(t))&&e(r,n)}(t,"stack");t._promise=e,p(t,"stack",{get:function(){return on?n&&(n.get?n.get.apply(t):n.value):e.stack}})})),function(e){pn.some((function(t){return t._value===e._value}))||pn.push(e)}(e),J(e),n&&Z()}}function J(e){var t=e._listeners;e._listeners=[];for(var n=0,r=t.length;n<r;++n)X(e,t[n]);var i=e._PSD;--i.ref||i.finalize(),0===vn&&(++vn,an((function(){0==--vn&&ee()}),[]))}function X(e,t){if(null!==e._state){var n=e._state?t.onFulfilled:t.onRejected;return null===n?(e._state?t.resolve:t.reject)(e._value):(++t.psd.ref,++vn,void an(W,[n,e,t]))}e._listeners.push(t)}function W(e,t,n){try{hn=t;var r,i=t._value;t._state?r=e(i):(fn.length&&(fn=[]),r=e(i),-1===fn.indexOf(i)&&function(e){for(var t=pn.length;t;)if(pn[--t]._value===e._value)return void pn.splice(t,1)}(t)),n.resolve(r)}catch(t){n.reject(t)}finally{hn=null,0==--vn&&ee(),--n.psd.ref||n.psd.finalize()}}function z(e,t){var n=t?t._numPrev+1:0;n<Qt&&(e._prev=t,e._numPrev=n)}function Q(){Y()&&Z()}function Y(){var e=cn;return cn=!1,ln=!1,e}function Z(){var e,t,n;do{for(;0<yn.length;)for(e=yn,yn=[],n=e.length,t=0;t<n;++t){var r=e[t];r[0].apply(null,r[1])}}while(0<yn.length);cn=!0,ln=!0}function ee(){var e=pn;pn=[],e.forEach((function(e){e._PSD.onunhandled.call(null,e._value,e)}));for(var t=bn.slice(0),n=t.length;n;)t[--n]()}function te(e){return new L(zt,!1,e)}function ne(e,t){var n=mn;return function(){var r=Y(),i=mn;try{return ce(n,!0),e.apply(this,arguments)}catch(e){t&&t(e)}finally{ce(i,!1),r&&Z()}}}function re(e,t,n,r){var i=mn,s=Object.create(i);s.parent=i,s.ref=0,s.global=!1,s.id=++jn;var o=gn.env;s.env=sn?{Promise:L,PromiseProp:{value:L,configurable:!0,writable:!0},all:L.all,race:L.race,allSettled:L.allSettled,any:L.any,resolve:L.resolve,reject:L.reject,nthen:he(o.nthen,s),gthen:he(o.gthen,s)}:{},t&&a(s,t),++i.ref,s.finalize=function(){--this.parent.ref||this.parent.finalize()};var u=pe(s,e,n,r);return 0===s.ref&&s.finalize(),u}function ie(){return An.id||(An.id=++qn),++An.awaits,An.echoes+=Yt,An.id}function se(e){!An.awaits||e&&e!==An.id||(0==--An.awaits&&(An.id=0),An.echoes=An.awaits*Yt)}function oe(e){return An.echoes&&e&&e.constructor===rn?(ie(),e.then((function(e){return se(),e}),(function(e){return se(),Sn(e)}))):e}function ue(e){++Un,An.echoes&&0!=--An.echoes||(An.echoes=An.id=0),wn.push(mn),ce(e,!0)}function ae(){var e=wn[wn.length-1];wn.pop(),ce(e,!1)}function ce(e,t){var n=mn;if((t?An.echoes&&(!_n++||e!==mn):_n&&(!--_n||e!==mn))&&function(e){nn.call(Zt,e)}(t?ue.bind(null,e):ae),e!==mn&&(mn=e,n===gn&&(gn.env=le()),sn)){var r=gn.env.Promise,i=e.env;en.then=i.nthen,r.prototype.then=i.gthen,(n.global||e.global)&&(Object.defineProperty(qt,"Promise",i.PromiseProp),r.all=i.all,r.race=i.race,r.resolve=i.resolve,r.reject=i.reject,i.allSettled&&(r.allSettled=i.allSettled),i.any&&(r.any=i.any))}}function le(){var e=qt.Promise;return sn?{Promise:e,PromiseProp:Object.getOwnPropertyDescriptor(qt,"Promise"),all:e.all,race:e.race,allSettled:e.allSettled,any:e.any,resolve:e.resolve,reject:e.reject,nthen:en.then,gthen:e.prototype.then}:{}}function pe(e,t,n,r,i){var s=mn;try{return ce(e,!0),t(n,r,i)}finally{ce(s,!1)}}function fe(e,t,n){return"function"==typeof e?function(){var r=mn;n&&ie(),ce(t,!0);try{return e.apply(this,arguments)}finally{ce(r,!1)}}:e}function he(e,t){return function(n,r){return e.call(this,fe(n,t,!1),fe(r,t,!1))}}function de(e,t){var n;try{n=t.onuncatched(e)}catch(t){}if(!1!==n)try{var r,i={promise:t,reason:e};if(qt.document&&document.createEvent?((r=document.createEvent("Event")).initEvent(Pn,!0,!0),a(r,i)):qt.CustomEvent&&a(r=new CustomEvent(Pn,{detail:i}),i),r&&qt.dispatchEvent&&(dispatchEvent(r),!qt.PromiseRejectionEvent&&qt.onunhandledrejection))try{qt.onunhandledrejection(r)}catch(e){}Kt&&r&&r.defaultPrevented}catch(t){}}function ge(e,t){return e?t?function(){return e.apply(this,arguments)&&t.apply(this,arguments)}:e:t}function me(e){function t(e,t,s){if("object"==typeof e)return n(e);t||(t=N),s||(s=O);var o={subscribers:[],fire:s,subscribe:function(e){-1===o.subscribers.indexOf(e)&&(o.subscribers.push(e),o.fire=t(o.fire,e))},unsubscribe:function(e){o.subscribers=o.subscribers.filter((function(t){return t!==e})),o.fire=o.subscribers.reduce(t,s)}};return r[e]=i[e]=o,o}function n(e){Tt(e).forEach((function(n){var r=e[n];if(At(r))t(n,e[n][0],e[n][1]);else{if("asap"!==r)throw new Jt.InvalidArgument("Invalid event config");var i=t(n,C,(function(){for(var e=arguments.length,t=Array(e);e--;)t[e]=arguments[e];i.subscribers.forEach((function(e){m((function(){e.apply(null,t)}))}))}))}}))}var r={},i=function(t,n){if(n){for(var i=arguments.length,s=Array(i-1);--i;)s[i-1]=arguments[i];return r[t].subscribe.apply(null,s),e}return"string"==typeof t?r[t]:void 0};i.addEventType=t;for(var s=1,o=arguments.length;s<o;++s)t(arguments[s]);return i}function ye(e,t){return f(t).from({prototype:e}),t}function ve(e,t){return!(e.filter||e.algorithm||e.or)&&(t?e.justLimit:!e.replayFilter)}function be(e,t){e.filter=ge(e.filter,t)}function Te(e,t,n){var r=e.replayFilter;e.replayFilter=r?function(){return ge(r(),t())}:t,e.justLimit=n&&!r}function Ae(e,t){if(e.isPrimKey)return t.primaryKey;var n=t.getIndexByKeyPath(e.index);if(!n)throw new Jt.Schema("KeyPath "+e.index+" on object store "+t.name+" is not indexed");return n}function qe(e,t,n){var r=Ae(e,t.schema);return t.openCursor({trans:n,values:!e.keysOnly,reverse:"prev"===e.dir,unique:!!e.unique,query:{index:r,range:e.range}})}function we(e,t,n,r){var i=e.replayFilter?ge(e.filter,e.replayFilter()):e.filter;if(!e.or)return _e(qe(e,r,n),ge(e.algorithm,i),t,!e.keysOnly&&e.valueMapper);var s={},o=function(e,n,r){if(!i||i(n,r,(function(e){return n.stop(e)}),(function(e){return n.fail(e)}))){var o=n.primaryKey,u=""+o;"[object ArrayBuffer]"==u&&(u=""+new Uint8Array(o)),c(s,u)||(s[u]=!0,t(e,n,r))}};return Promise.all([e.or._iterate(o,n),_e(qe(e,r,n),e.algorithm,o,!e.keysOnly&&e.valueMapper)])}function _e(e,t,n,r){var i=ne(r?function(e,t,i){return n(r(e),t,i)}:n);return e.then((function(e){if(e)return e.start((function(){var n=function(){return e.continue()};(!t||t(e,(function(e){return n=e}),(function(t){e.stop(t),n=O}),(function(t){e.fail(t),n=O})))&&i(e.value,e,(function(e){return n=e})),n()}))}))}function Ue(e,t){return e<t?-1:e===t?0:1}function je(e,t){return e>t?-1:e===t?0:1}function ke(e,t,n){var r=e instanceof Gn?new e.Collection(e):e;return r._ctx.error=n?new n(t):new TypeError(t),r}function Pe(e){return new e.Collection(e,(function(){return De("")})).limit(0)}function Se(e,t,n,r,i,s){for(var o,u=ft(e.length,r.length),a=-1,c=0;c<u;++c){if((o=t[c])!==r[c])return 0>i(e[c],n[c])?e.substr(0,c)+n[c]+n.substr(c+1):0>i(e[c],r[c])?e.substr(0,c)+r[c]+n.substr(c+1):0<=a?e.substr(0,a)+t[a]+n.substr(a+1):null;0>i(e[c],o)&&(a=c)}return u<r.length&&"next"===s?e+n.substr(e.length):u<e.length&&"prev"===s?e.substr(0,n.length):0>a?null:e.substr(0,a)+r[a]+n.substr(a+1)}function xe(e,t,n,r){function i(e){s=function(e){return"next"===e?function(e){return e.toUpperCase()}:function(e){return e.toLowerCase()}}(e),o=function(e){return"next"===e?function(e){return e.toLowerCase()}:function(e){return e.toUpperCase()}}(e),u="next"===e?Ue:je;var t=n.map((function(e){return{lower:o(e),upper:s(e)}})).sort((function(e,t){return u(e.lower,t.lower)}));a=t.map((function(e){return e.upper})),c=t.map((function(e){return e.lower})),l=e,p="next"===e?"":r}var s,o,u,a,c,l,p,f=n.length;if(!n.every((function(e){return"string"==typeof e})))return ke(e,Dn);i("next");var h=new e.Collection(e,(function(){return Ee(a[0],c[f-1]+r)}));h._ondirectionchange=function(e){i(e)};var d=0;return h._addAlgorithm((function(e,n,r){var i=e.key;if("string"!=typeof i)return!1;var s=o(i);if(t(s,c,d))return!0;for(var h,g=null,m=d;m<f;++m)null===(h=Se(i,s,a[m],c[m],u,l))&&null===g?d=m+1:(null===g||0<u(g,h))&&(g=h);return n(null===g?r:function(){e.continue(g+p)}),!1})),h}function Ee(e,t,n,r){return{type:2,lower:e,upper:t,lowerOpen:n,upperOpen:r}}function De(e){return{type:1,lower:e,upper:e}}function Oe(e){return 1===e.length?e[0]:e}function Ce(e){try{return e.only([[]]),[[]]}catch(e){return xn}}function Re(e){return ne((function(t){return Ie(t),e(t.target.error),!1}))}function Ie(e){e.stopPropagation&&e.stopPropagation(),e.preventDefault&&e.preventDefault()}function Be(e,t,n,r,i,s,o){return{name:e,keyPath:t,unique:n,multi:r,auto:i,compound:s,src:(n&&!o?"&":"")+(r?"*":"")+(i?"++":"")+Ke(t)}}function Ke(e){return"string"==typeof e?e:e?"["+[].join.call(e,"+")+"]":""}function Me(e,t,n){return{name:e,primKey:t,indexes:n,mappedClass:null,idxByName:y(n,(function(e){return[e.name,e]}))}}function Ne(e){return null==e?function(){}:"string"==typeof e?function(e){return 1===e.split(".").length?function(t){return t[e]}:function(t){return v(t,e)}}(e):function(t){return v(t,e)}}function Fe(e,t){return"delete"===t.type?t.keys:t.keys||t.values.map(e.extractKey)}function Le(e){return[].slice.call(e)}function Ge(e){return null==e?":id":"string"==typeof e?e:"["+e.join("+")+"]"}function He(e,t,n,r){function i(e){if(3===e.type)return null;if(4===e.type)throw new Error("Cannot convert never type to IDBKeyRange");var t=e.lower,r=e.upper,i=e.lowerOpen,s=e.upperOpen;return void 0===t?void 0===r?null:n.upperBound(r,!!s):void 0===r?n.lowerBound(t,!!i):n.bound(t,r,!!i,!!s)}var s=t.cmp.bind(t),o=function(e,t){var n=Le(e.objectStoreNames);return{schema:{name:e.name,tables:n.map((function(e){return t.objectStore(e)})).map((function(e){var t=e.keyPath,n=e.autoIncrement,r=At(t),i={},s={name:e.name,primaryKey:{name:null,isPrimaryKey:!0,outbound:null==t,compound:r,keyPath:t,autoIncrement:n,unique:!0,extractKey:Ne(t)},indexes:Le(e.indexNames).map((function(t){return e.index(t)})).map((function(e){var t=e.name,n=e.unique,r=e.multiEntry,s=e.keyPath,o={name:t,compound:At(s),keyPath:s,unique:n,multiEntry:r,extractKey:Ne(s)};return i[Ge(s)]=o,o})),getIndexByKeyPath:function(e){return i[Ge(e)]}};return i[":id"]=s.primaryKey,null!=t&&(i[Ge(t)]=s.primaryKey),s}))},hasGetAll:0<n.length&&"getAll"in t.objectStore(n[0])&&!("undefined"!=typeof navigator&&/Safari/.test(navigator.userAgent)&&!/(Chrome\/|Edge\/)/.test(navigator.userAgent)&&604>[].concat(navigator.userAgent.match(/Safari\/(\d*)/))[1])}}(e,r),a=o.schema,c=o.hasGetAll,l=a.tables.map((function(e){return function(e){var t=e.name;return{name:t,schema:e,mutate:function(n){var r=n.trans,s=n.type,o=n.keys,a=n.values,c=n.range,l=n.wantResults;return new Promise((function(n){n=ne(n);var p=r.objectStore(t),f=null==p.keyPath,h="put"===s||"add"===s;if(!h&&"delete"!==s&&"deleteRange"!==s)throw new Error("Invalid operation type: "+s);var d=(o||a||{length:1}).length;if(o&&a&&o.length!==a.length)throw new Error("Given keys array must have same length as given values array.");if(0===d)return n({numFailures:0,failures:{},results:[],lastResult:void 0});var g,m=l&&u(o||Fe(e.primaryKey,{type:s,keys:o,values:a})),y=[],v=0,b=function(e){++v,Ie(e),m&&(m[e.target._reqno]=void 0),y[e.target._reqno]=e.target.error},T=function(e){var t=e.target;m[t._reqno]=t.result};if("deleteRange"===s){if(4===c.type)return n({numFailures:v,failures:y,results:m,lastResult:void 0});g=3===c.type?p.clear():p.delete(i(c))}else{var A=h?f?[a,o]:[a,null]:[o,null],q=A[0],w=A[1];if(h)for(var _=0;_<d;++_)(g=w&&void 0!==w[_]?p[s](q[_],w[_]):p[s](q[_]))._reqno=_,m&&void 0===m[_]&&(g.onsuccess=T),g.onerror=b;else for(_=0;_<d;++_)(g=p[s](q[_]))._reqno=_,g.onerror=b}var U=function(e){var t=e.target.result;m&&(m[d-1]=t),n({numFailures:v,failures:y,results:m,lastResult:t})};g.onerror=function(e){b(e),U(e)},g.onsuccess=U}))},getMany:function(e){var n=e.trans,r=e.keys;return new Promise((function(e,i){e=ne(e);for(var s,o=n.objectStore(t),u=r.length,a=Array(u),c=0,l=0,p=function(t){var n=t.target;null!=(a[n._pos]=n.result)&&0,++l==c&&e(a)},f=Re(i),h=0;h<u;++h)null!=r[h]&&((s=o.get(r[h]))._pos=h,s.onsuccess=p,s.onerror=f,++c);0==c&&e(a)}))},get:function(e){var n=e.trans,r=e.key;return new Promise((function(e,i){e=ne(e);var s=n.objectStore(t).get(r);s.onsuccess=function(t){return e(t.target.result)},s.onerror=Re(i)}))},query:function(e){return function(n){return new Promise((function(r,s){r=ne(r);var o=n.trans,u=n.values,a=n.limit,c=n.query,l=a===1/0?void 0:a,p=c.index,f=c.range,h=o.objectStore(t),d=p.isPrimaryKey?h:h.index(p.name),g=i(f);if(0===a)return r({result:[]});if(e){var m=u?d.getAll(g,l):d.getAllKeys(g,l);m.onsuccess=function(e){return r({result:e.target.result})},m.onerror=Re(s)}else{var y=0,v=u||!("openKeyCursor"in d)?d.openCursor(g):d.openKeyCursor(g),b=[];v.onsuccess=function(){var e=v.result;return e?(b.push(u?e.value:e.primaryKey),++y===a?r({result:b}):void e.continue()):r({result:b})},v.onerror=Re(s)}}))}}(c),openCursor:function(e){var n=e.trans,r=e.values,s=e.query,o=e.reverse,u=e.unique;return new Promise((function(e,a){e=ne(e);var c=s.index,l=s.range,p=n.objectStore(t),f=c.isPrimaryKey?p:p.index(c.name),h=o?u?"prevunique":"prev":u?"nextunique":"next",d=r||!("openKeyCursor"in f)?f.openCursor(i(l),h):f.openKeyCursor(i(l),h);d.onerror=Re(a),d.onsuccess=ne((function(){var t=d.result;if(t){t.___id=++Vn,t.done=!1;var r=t.continue.bind(t),i=t.continuePrimaryKey;i&&(i=i.bind(t));var s=t.advance.bind(t),o=function(){throw new Error("Cursor not stopped")};t.trans=n,t.stop=t.continue=t.continuePrimaryKey=t.advance=function(){throw new Error("Cursor not started")},t.fail=ne(a),t.next=function(){var e=this,t=1;return this.start((function(){return t--?e.continue():e.stop()})).then((function(){return e}))},t.start=function(e){var n=new Promise((function(e,n){e=ne(e),d.onerror=Re(n),t.fail=n,t.stop=function(n){t.stop=t.continue=t.continuePrimaryKey=t.advance=o,e(n)}})),u=function(){if(d.result)try{e()}catch(e){t.fail(e)}else t.done=!0,t.start=function(){throw new Error("Cursor behind last entry")},t.stop()};return d.onsuccess=ne((function(){d.onsuccess=u,u()})),t.continue=r,t.continuePrimaryKey=i,t.advance=s,u(),n},e(t)}else e(null)}),a)}))},count:function(e){var n=e.query,r=e.trans,s=n.index,o=n.range;return new Promise((function(e,n){var u=r.objectStore(t),a=s.isPrimaryKey?u:u.index(s.name),c=i(o),l=c?a.count(c):a.count();l.onsuccess=ne((function(t){return e(t.target.result)})),l.onerror=Re(n)}))}}}(e)})),p={};return l.forEach((function(e){return p[e.name]=e})),{stack:"dbcore",transaction:e.transaction.bind(e),table:function(e){if(!p[e])throw new Error("Table '"+e+"' not found");return p[e]},cmp:s,MIN_KEY:-1/0,MAX_KEY:Ce(n),schema:a}}function Ve(e,t,n,r){var i=n.IDBKeyRange;return{dbcore:function(e,t){return t.reduce((function(e,t){var n=t.create;return bt(bt({},e),n(e))}),e)}(He(t,n.indexedDB,i,r),e.dbcore)}}function Je(e,t){var n=t.db,r=Ve(e._middlewares,n,e._deps,t);e.core=r.dbcore,e.tables.forEach((function(t){var n=t.name;e.core.schema.tables.some((function(e){return e.name===n}))&&(t.core=e.core.table(n),e[n]instanceof e.Table&&(e[n].core=t.core))}))}function Xe(e,t,n,r){n.forEach((function(n){var i=r[n];t.forEach((function(t){n in t||(t===e.Transaction.prototype||t instanceof e.Transaction?p(t,n,{get:function(){return this.table(n)},set:function(e){Ut(this,n,{value:e,writable:!0,configurable:!0,enumerable:!0})}}):t[n]=new e.Table(n,i))}))}))}function We(e,t){t.forEach((function(t){for(var n in t)t[n]instanceof e.Table&&delete t[n]}))}function ze(e,t){return e._cfg.version-t._cfg.version}function Qe(e,t,n,r){var i=e._dbSchema,s=e._createTransaction("readwrite",e._storeNames,i);s.create(n),s._completion.catch(r);var o=s._reject.bind(s),u=mn.transless||mn;re((function(){mn.trans=s,mn.transless=u,0===t?(Tt(i).forEach((function(e){Ye(n,e,i[e].primKey,i[e].indexes)})),Je(e,n),L.follow((function(){return e.on.populate.fire(s)})).catch(o)):function(e,t,n,r){var i=[],s=e._versions,o=e._dbSchema=Ze(e,e.idbdb,r),u=!1;return s.filter((function(e){return e._cfg.version>=t})).forEach((function(s){i.push((function(){var i=o,a=s._cfg.dbschema;et(e,i,r),et(e,a,r),o=e._dbSchema=a;var c=function(e,t){var n,r={del:[],add:[],change:[]};for(n in e)t[n]||r.del.push(n);for(n in t){var i=e[n],s=t[n];if(i){var o={name:n,def:s,recreate:!1,del:[],add:[],change:[]};if(i.primKey.src===s.primKey.src||Cn){var u=i.idxByName,a=s.idxByName,c=void 0;for(c in u)a[c]||o.del.push(c);for(c in a){var l=u[c],p=a[c];l?l.src!==p.src&&o.change.push(p):o.add.push(p)}(0<o.del.length||0<o.add.length||0<o.change.length)&&r.change.push(o)}else o.recreate=!0,r.change.push(o)}else r.add.push([n,s])}return r}(i,a);c.add.forEach((function(e){Ye(r,e[0],e[1].primKey,e[1].indexes)})),c.change.forEach((function(e){if(e.recreate)throw new Jt.Upgrade("Not yet support for changing primary key");var t=r.objectStore(e.name);e.add.forEach((function(e){return $e(t,e)})),e.change.forEach((function(e){t.deleteIndex(e.name),$e(t,e)})),e.del.forEach((function(e){return t.deleteIndex(e)}))}));var l=s._cfg.contentUpgrade;if(l&&s._cfg.version>t){Je(e,r),u=!0;var p=T(a);c.del.forEach((function(e){p[e]=i[e]})),We(e,[e.Transaction.prototype]),Xe(e,[e.Transaction.prototype],Tt(p),p),n.schema=p;var f=Bt(l);f&&ie();var h,d=L.follow((function(){if((h=l(n))&&f){var e=se.bind(null,null);h.then(e,e)}}));return h&&"function"==typeof h.then?L.resolve(h):d.then((function(){return h}))}})),i.push((function(t){u&&Rn||function(e,t){for(var n,r=0;r<t.db.objectStoreNames.length;++r)n=t.db.objectStoreNames[r],null==e[n]&&t.db.deleteObjectStore(n)}(s._cfg.dbschema,t);We(e,[e.Transaction.prototype]),Xe(e,[e.Transaction.prototype],e._storeNames,e._dbSchema),n.schema=e._dbSchema}))})),function e(){return i.length?L.resolve(i.shift()(n.idbtrans)).then(e):L.resolve()}().then((function(){!function(e,t){Tt(e).forEach((function(n){t.db.objectStoreNames.contains(n)||Ye(t,n,e[n].primKey,e[n].indexes)}))}(o,r)}))}(e,t,s,n).catch(o)}))}function Ye(e,t,n,r){var i=e.db.createObjectStore(t,n.keyPath?{keyPath:n.keyPath,autoIncrement:n.auto}:{autoIncrement:n.auto});return r.forEach((function(e){return $e(i,e)})),i}function $e(e,t){e.createIndex(t.name,t.keyPath,{unique:t.unique,multiEntry:t.multi})}function Ze(e,t,n){var r={};return h(t.objectStoreNames,0).forEach((function(e){for(var t,i=n.objectStore(e),s=i.keyPath,o=Be(Ke(s),s||"",!1,!1,!!i.autoIncrement,s&&"string"!=typeof s,!0),u=[],a=0;a<i.indexNames.length;++a){s=(t=i.index(i.indexNames[a])).keyPath;var c=Be(t.name,s,!!t.unique,!!t.multiEntry,!1,s&&"string"!=typeof s,!1);u.push(c)}r[e]=Me(e,o,u)})),r}function et(e,t,n){for(var r=n.db.objectStoreNames,i=0;i<r.length;++i){var s=r[i],o=n.objectStore(s);e._hasGetAll="getAll"in o;for(var u=0;u<o.indexNames.length;++u){var a=o.indexNames[u],c=o.index(a).keyPath,l="string"==typeof c?c:"["+h(c).join("+")+"]";if(t[s]){var p=t[s].idxByName[l];p&&(p.name=a,delete t[s].idxByName[l],t[s].idxByName[a]=p)}}}"undefined"!=typeof navigator&&/Safari/.test(navigator.userAgent)&&!/(Chrome\/|Edge\/)/.test(navigator.userAgent)&&qt.WorkerGlobalScope&&qt instanceof qt.WorkerGlobalScope&&604>[].concat(navigator.userAgent.match(/Safari\/(\d*)/))[1]&&(e._hasGetAll=!1)}function tt(e){return re((function(){return mn.letThrough=!0,e()}))}function nt(e){var t=e._state,n=e._deps.indexedDB;if(t.isBeingOpened||e.idbdb)return t.dbReadyPromise.then((function(){return t.dbOpenError?Sn(t.dbOpenError):e}));Kt&&(t.openCanceller._stackHolder=k()),t.isBeingOpened=!0,t.dbOpenError=null,t.openComplete=!1;var r=t.dbReadyResolve,i=null;return L.race([t.openCanceller,new L((function(r,s){if(!n)throw new Jt.MissingAPI("indexedDB API not found. If using IE10+, make sure to run your code on a server URL (not locally). If using old Safari versions, make sure to include indexedDB polyfill.");var o=e.name,u=t.autoSchema?n.open(o):n.open(o,pt(10*e.verno));if(!u)throw new Jt.MissingAPI("IndexedDB API not available");u.onerror=Re(s),u.onblocked=ne(e._fireOnBlocked),u.onupgradeneeded=ne((function(r){if(i=u.transaction,t.autoSchema&&!e._options.allowEmptyDB){u.onerror=Ie,i.abort(),u.result.close();var a=n.deleteDatabase(o);a.onsuccess=a.onerror=ne((function(){s(new Jt.NoSuchDatabase("Database "+o+" doesnt exist"))}))}else{i.onerror=Re(s);var c=0x4000000000000000<r.oldVersion?0:r.oldVersion;e.idbdb=u.result,Qe(e,c/10,i,s)}}),s),u.onsuccess=ne((function(){i=null;var n=e.idbdb=u.result,s=h(n.objectStoreNames);if(0<s.length)try{var a=n.transaction(Oe(s),"readonly");t.autoSchema?function(e,t,n){e.verno=t.version/10;var r=e._dbSchema=Ze(0,t,n);e._storeNames=h(t.objectStoreNames,0),Xe(e,[e._allTables],Tt(r),r)}(e,n,a):et(e,e._dbSchema,a),Je(e,a)}catch(e){}On.push(e),n.onversionchange=ne((function(n){t.vcFired=!0,e.on("versionchange").fire(n)})),kn.add(o),r()}),s)}))]).then((function(){return t.onReadyBeingFired=[],L.resolve(tt(e.on.ready.fire)).then((function e(){if(0<t.onReadyBeingFired.length){var n=t.onReadyBeingFired.reduce(F,O);return t.onReadyBeingFired=[],L.resolve(tt(n)).then(e)}}))})).finally((function(){t.onReadyBeingFired=null})).then((function(){return t.isBeingOpened=!1,e})).catch((function(n){try{i&&i.abort()}catch(e){}return t.isBeingOpened=!1,e.close(),t.dbOpenError=n,Sn(t.dbOpenError)})).finally((function(){t.openComplete=!0,r()}))}function rt(e){function t(e){return function(t){var n=e(t),s=n.value;return n.done?s:s&&"function"==typeof s.then?s.then(r,i):At(s)?Promise.all(s).then(r,i):r(s)}}var n=function(t){return e.next(t)},r=t(n),i=t((function(t){return e.throw(t)}));return t(n)()}function it(e,t,n){var r=arguments.length;if(2>r)throw new Jt.InvalidArgument("Too few arguments");for(var i=Array(r-1);--r;)i[r-1]=arguments[r];n=i.pop();var s=A(i);return[e,s,n]}function st(e,t,n,r,i){return L.resolve().then((function(){var s=mn.transless||mn,o=e._createTransaction(t,n,e._dbSchema,r);r?o.idbtrans=r.idbtrans:o.create();var u=Bt(i);u&&ie();var a,c=L.follow((function(){if(a=i.call(o,o))if(u){var e=se.bind(null,null);a.then(e,e)}else"function"==typeof a.next&&"function"==typeof a.throw&&(a=rt(a))}),{trans:o,transless:s});return(a&&"function"==typeof a.then?L.resolve(a).then((function(e){return o.active?e:Sn(new Jt.PrematureCommit("Transaction committed too early. See http://bit.ly/2kdckMn"))})):c.then((function(){return a}))).then((function(e){return r&&o._resolve(),o._completion.then((function(){return e}))})).catch((function(e){return o._reject(e),Sn(e)}))}))}function ot(e,t,n){for(var r=At(e)?e.slice():[e],i=0;i<n;++i)r.push(t);return r}function ut(e,t,n,r,i,s,o){try{var u=e[s](o),a=u.value}catch(e){return void n(e)}u.done?t(a):Promise.resolve(a).then(r,i)}function at(e){return function(){var t=this,n=arguments;return new Promise((function(r,i){function s(e){ut(u,r,i,s,o,"next",e)}function o(e){ut(u,r,i,s,o,"throw",e)}var u=e.apply(t,n);s(void 0)}))}}function ct(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,i,s=[],o=!0,u=!1;try{for(n=n.call(e);!(o=(r=n.next()).done)&&(s.push(r.value),!t||s.length!==t);o=!0);}catch(e){u=!0,i=e}finally{try{o||null==n.return||n.return()}finally{if(u)throw i}}return s}}(e,t)||function(e,t){if(e){if("string"==typeof e)return lt(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?lt(e,t):void 0}}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function lt(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}var pt=Math.round,ft=Math.min;n.r(t),n.d(t,"Api",(function(){return Jr})),n.d(t,"createDefaultConfig",(function(){return Xr})),n.d(t,"IDBCache",(function(){return Yn}));var ht=function(){var e=null,t=null;this.setAccessToken=function(t){e=t},this.setTokenType=function(e){t=e},this.get=function(n,o){return o||(o={}),o.token||(o.token=e),o.tokenType&&o.tokenType===t||(o.tokenType=t),o.queryParams&&(n+=s(o.queryParams)),o&&o.useXMLHttpRequest?i(n,"GET",null,o):r(n,"GET",null,o)},this.getChunked=function(t,n){return o(this,e,"medium",t,n)},this.put=function(n,i,o){return o||(o={}),o.token||(o.token=e),o.tokenType&&o.tokenType===t||(o.tokenType=t),o.queryParams&&(n+=s(o.queryParams)),r(n,"PUT",i,o)},this.post=function(n,o,u){return u||(u={}),u.token||(u.token=e),u.tokenType&&u.tokenType===t||(u.tokenType=t),u.queryParams&&(n+=s(u.queryParams)),u&&u.useXMLHttpRequest?i(n,"POST",o,u):r(n,"POST",o,u)},this.del=function(n,i,o){return o||(o={}),i||(o.contentType=null),o.dataType=null,o.token||(o.token=e),o.tokenType&&o.tokenType===t||(o.tokenType=t),o.queryParams&&(n+=s(o.queryParams)),r(n,"DELETE",i||null,o)}},dt=function(e){this.postSettings=function(t){return e.request.post(e.getApiUrl()+"application/settings",t)},this.getSettings=function(t){return t?e.request.get(e.getApiUrl()+"application/settings/"+t):e.request.get(e.getApiUrl()+"application/settings")},this.putSettings=function(t,n){return e.request.put(e.getApiUrl()+"application/settings/"+t,n)},this.deleteSettings=function(t){return e.request.del(e.getApiUrl()+"application/settings/"+t)}},gt=function(e){this.get=function(t){return e.request.get(e.getApiTeamUrl()+"annotations/"+t)},this.delete=function(t){return e.request.del(e.getApiTeamUrl()+"annotations/"+t)},this.put=function(t,n){return e.request.put(e.getApiTeamUrl()+"annotations/"+t,n)}},mt=function(e){this.get=function(t){return e.request.get(e.getApiTeamUrl()+"attachments/"+t)},this.download=function(t,n){return n?e.request.get(e.getApiTeamUrl()+"attachments/"+t+"/versions/"+n+"/download"):e.request.get(e.getApiTeamUrl()+"attachments/"+t+"/download")},this.put=function(t,n){return e.request.put(e.getApiTeamUrl()+"attachments/"+t,n)},this.post=function(t,n,r){return e.request.put(e.getApiTeamUrl()+"attachments/"+t,n,{contentType:!1,processData:!1,dataType:null,xhrUploadProgress:r})},this.delete=function(t,n){return n?e.request.del(e.getApiTeamUrl()+"attachments/"+t+"/versions/"+n):e.request.del(e.getApiTeamUrl()+"attachments/"+t)},this.postVersion=function(t,n,r){return e.request.post(e.getApiTeamUrl()+"attachments/"+t+"/versions",n,{contentType:!1,processData:!1,dataType:null,xhrUploadProgress:r})},this.getAllVersions=function(t){return e.request.get(e.getApiTeamUrl()+"attachments/"+t+"/versions")},this.releaseVersion=function(t){return e.request.put(e.getApiTeamUrl()+"attachments/"+t+"/release")}},yt=function(e){this.post=function(t){return e.request.post(e.getApiTeamUrl()+"attributetemplates",t)},this.get=function(t){return t?e.request.get(e.getApiTeamUrl()+"attributetemplates/"+t):e.request.get(e.getApiTeamUrl()+"attributetemplates")},this.put=function(t,n){return e.request.put(e.getApiTeamUrl()+"attributetemplates/"+t,n)},this.delete=function(t){return e.request.del(e.getApiTeamUrl()+"attributetemplates/"+t)}},vt=function(e){this.post=function(t,n,r){return e.request.post(e.getApiUrl()+"authorize",JSON.stringify({user_id:t,password:n,application_id:r}))},this.forgotPassword=function(t){return e.request.post(e.getApiUrl()+"auth-forgot",t,{dataType:null})},this.checkAccessToken=function(){return e.request.get(e.getApiUrl()+"authorize")},this.requestCrossToken=function(){return e.request.post(e.getApiUrl()+"cross-token")}},bt=function(){return(bt=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e}).apply(this,arguments)},Tt=Object.keys,At=Array.isArray,qt="undefined"==typeof self?"undefined"==typeof window?global:window:self;"undefined"==typeof Promise||qt.Promise||(qt.Promise=Promise);var wt=Object.getPrototypeOf,_t={}.hasOwnProperty,Ut=Object.defineProperty,jt=Object.getOwnPropertyDescriptor,kt=[].slice,Pt=[].concat,St=["Boolean","String","Date","RegExp","Blob","File","FileList","ArrayBuffer","DataView","Uint8ClampedArray","ImageData","Map","Set"].concat(A([8,16,32,64].map((function(e){return["Int","Uint","Float"].map((function(t){return t+e+"Array"}))})))).filter((function(e){return qt[e]})),xt=St.map((function(e){return qt[e]})),Et=y(St,(function(e){return[e,!0]})),Dt={}.toString,Ot=function(e,t){return"Array"===t?""+e.map((function(e){return Ot(e,w(e))})):"ArrayBuffer"===t?""+new Uint8Array(e):"Date"===t?e.getTime():ArrayBuffer.isView(e)?""+new Uint8Array(e.buffer):e},Ct="undefined"!=typeof Symbol&&Symbol.iterator,Rt=Ct?function(e){var t;return null!=e&&(t=e[Ct])&&t.apply(e)}:function(){return null},It={},Bt="undefined"==typeof Symbol?function(){return!1}:function(e){return"AsyncFunction"===e[Symbol.toStringTag]},Kt="undefined"!=typeof location&&/^(http|https):\/\/(localhost|127\.0\.0\.1)/.test(location.href),Mt=function(){return!0},Nt=!new Error("").stack,Ft=["Unknown","Constraint","Data","TransactionInactive","ReadOnly","Version","NotFound","InvalidState","InvalidAccess","Abort","Timeout","QuotaExceeded","Syntax","DataClone"],Lt=["Modify","Bulk","OpenFailed","VersionChange","Schema","Upgrade","InvalidTable","MissingAPI","NoSuchDatabase","InvalidArgument","SubTransaction","Unsupported","Internal","DatabaseClosed","PrematureCommit","ForeignAwait"].concat(Ft),Gt={VersionChanged:"Database version changed by other database connection",DatabaseClosed:"Database has been closed",Abort:"Transaction aborted",TransactionInactive:"Transaction has already completed or failed"};f(S).from(Error).extend({stack:{get:function(){return this._stack||(this._stack=this.name+": "+this.message+P(this._e,2))}},toString:function(){return this.name+": "+this.message}}),f(E).from(S),f(D).from(S);var Ht=Lt.reduce((function(e,t){return e[t]=t+"Error",e}),{}),Vt=S,Jt=Lt.reduce((function(e,t){function n(e,n){this._e=k(),this.name=r,e?"string"==typeof e?(this.message=e+(n?"\n "+n:""),this.inner=n||null):"object"==typeof e&&(this.message=e.name+" "+e.message,this.inner=e):(this.message=Gt[t]||r,this.inner=null)}var r=t+"Error";return f(n).from(Vt),e[t]=n,e}),{});Jt.Syntax=SyntaxError,Jt.Type=TypeError,Jt.Range=RangeError;var Xt=Ft.reduce((function(e,t){return e[t+"Error"]=Jt[t],e}),{}),Wt=Lt.reduce((function(e,t){return-1===["Syntax","Type","Range"].indexOf(t)&&(e[t+"Error"]=Jt[t]),e}),{});Wt.ModifyError=E,Wt.DexieError=S,Wt.BulkError=D;var zt={},Qt=100,Yt=100,$t="undefined"==typeof Promise?[]:function(){var e=Promise.resolve();if("undefined"==typeof crypto||!crypto.subtle)return[e,e.__proto__,e];var t=crypto.subtle.digest("SHA-512",new Uint8Array([0]));return[t,t.__proto__,e]}(),Zt=$t[0],en=$t[1],tn=$t[2],nn=en&&en.then,rn=Zt&&Zt.constructor,sn=!!tn,on=!1,un=tn?function(){tn.then(Q)}:qt.setImmediate?setImmediate.bind(null,Q):qt.MutationObserver?function(){var e=document.createElement("div");new MutationObserver((function(){Q(),e=null})).observe(e,{attributes:!0}),e.setAttribute("i","1")}:function(){setTimeout(Q,0)},an=function(e,t){yn.push([e,t]),ln&&(un(),ln=!1)},cn=!0,ln=!0,pn=[],fn=[],hn=null,dn=C,gn={id:"global",global:!0,ref:0,unhandleds:[],onunhandled:de,pgp:!1,env:{},finalize:function(){this.unhandleds.forEach((function(e){try{de(e[0],e[1])}catch(e){}}))}},mn=gn,yn=[],vn=0,bn=[],Tn={get:function(){function e(e,r){var i=this,s=!t.global&&(t!==mn||n!==Un);s&&se();var o=new L((function(n,o){X(i,new G(fe(e,t,s),fe(r,t,s),n,o,t))}));return Kt&&z(o,this),o}var t=mn,n=Un;return e.prototype=zt,e},set:function(e){p(this,"then",e&&e.prototype===zt?Tn:{get:function(){return e},set:Tn.set})}};l(L.prototype,{then:Tn,_then:function(e,t){X(this,new G(null,null,e,t,mn))},catch:function(e){if(1===arguments.length)return this.then(null,e);var t=arguments[0],n=arguments[1];return"function"==typeof t?this.then(null,(function(e){return e instanceof t?n(e):te(e)})):this.then(null,(function(e){return e&&e.name===t?n(e):te(e)}))},finally:function(e){return this.then((function(t){return e(),t}),(function(t){return e(),te(t)}))},stack:{get:function(){if(this._stack)return this._stack;try{on=!0;var e=function e(t,n,r){if(n.length===r)return n;var i="";if(!1===t._state){var s,o,u=t._value;null==u?(s=u,o=""):(s=u.name||"Error",o=u.message||u,i=P(u,0)),n.push(s+(o?": "+o:"")+i)}return Kt&&((i=P(t._stackHolder,2))&&-1===n.indexOf(i)&&n.push(i),t._prev&&e(t._prev,n,r)),n}(this,[],20).join("\nFrom previous: ");return null!==this._state&&(this._stack=e),e}finally{on=!1}}},timeout:function(e,t){var n=this;return e<1/0?new L((function(r,i){var s=setTimeout((function(){return i(new Jt.Timeout(t))}),e);n.then(r,i).finally(clearTimeout.bind(null,s))})):this}}),"undefined"!=typeof Symbol&&Symbol.toStringTag&&p(L.prototype,Symbol.toStringTag,"Dexie.Promise"),gn.env=le(),l(L,{all:function(){var e=U.apply(null,arguments).map(oe);return new L((function(t,n){0===e.length&&t([]);var r=e.length;e.forEach((function(i,s){return L.resolve(i).then((function(n){e[s]=n,--r||t(e)}),n)}))}))},resolve:function(e){if(e instanceof L)return e;if(e&&"function"==typeof e.then)return new L((function(t,n){e.then(t,n)}));var t=new L(zt,!0,e);return z(t,hn),t},reject:te,race:function(){var e=U.apply(null,arguments).map(oe);return new L((function(t,n){e.map((function(e){return L.resolve(e).then(t,n)}))}))},PSD:{get:function(){return mn},set:function(e){return mn=e}},newPSD:re,usePSD:pe,scheduler:{get:function(){return an},set:function(e){an=e}},rejectionMapper:{get:function(){return dn},set:function(e){dn=e}},follow:function(e,t){return new L((function(n,r){return re((function(t,n){var r=mn;r.unhandleds=[],r.onunhandled=n,r.finalize=I((function(){var e=this;!function(e){bn.push((function t(){e(),bn.splice(bn.indexOf(t),1)})),++vn,an((function(){0==--vn&&ee()}),[])}((function(){0===e.unhandleds.length?t():n(e.unhandleds[0])}))}),r.finalize),e()}),t,n,r)}))}}),rn&&(rn.allSettled&&p(L,"allSettled",(function(){var e=U.apply(null,arguments).map(oe);return new L((function(t){0===e.length&&t([]);var n=e.length,r=Array(n);e.forEach((function(e,i){return L.resolve(e).then((function(e){return r[i]={status:"fulfilled",value:e}}),(function(e){return r[i]={status:"rejected",reason:e}})).then((function(){return--n||t(r)}))}))}))})),rn.any&&"undefined"!=typeof AggregateError&&p(L,"any",(function(){var e=U.apply(null,arguments).map(oe);return new L((function(t,n){0===e.length&&n(new AggregateError([]));var r=e.length,i=Array(r);e.forEach((function(e,s){return L.resolve(e).then((function(e){return t(e)}),(function(e){i[s]=e,--r||n(new AggregateError(i))}))}))}))})));var An={awaits:0,echoes:0,id:0},qn=0,wn=[],_n=0,Un=0,jn=0;-1===(""+nn).indexOf("[native code]")&&(ie=se=O);var kn,Pn="unhandledrejection",Sn=L.reject,xn="￿",En="Invalid key provided. Keys must be of type string, number, Date or Array<string | number | Date>.",Dn="String expected.",On=[],Cn="undefined"!=typeof navigator&&/(MSIE|Trident|Edge)/.test(navigator.userAgent),Rn=Cn,In=function(e){return!/(dexie\.js|dexie\.min\.js)/.test(e)},Bn="__dbnames",Kn="readonly",Mn="readwrite",Nn={type:3,lower:-1/0,lowerOpen:!1,upper:[[]],upperOpen:!1},Fn=function(){function e(){}return e.prototype._trans=function(e,t,n){function r(e,n,r){if(!r.schema[s])throw new Jt.NotFound("Table "+s+" not part of transaction");return t(r.idbtrans,r)}var i=this._tx||mn.trans,s=this.name,o=Y();try{return i&&i.db===this.db?i===mn.trans?i._promise(e,r,n):re((function(){return i._promise(e,r,n)}),{trans:i,transless:mn.transless||mn}):function e(t,n,r,i){if(!t._state.openComplete&&!mn.letThrough){if(!t._state.isBeingOpened){if(!t._options.autoOpen)return Sn(new Jt.DatabaseClosed);t.open().catch(O)}return t._state.dbReadyPromise.then((function(){return e(t,n,r,i)}))}var s=t._createTransaction(n,r,t._dbSchema);try{s.create()}catch(t){return Sn(t)}return s._promise(n,(function(e,t){return re((function(){return mn.trans=s,i(e,t,s)}))})).then((function(e){return s._completion.then((function(){return e}))}))}(this.db,e,[this.name],r)}finally{o&&Z()}},e.prototype.get=function(e,t){var n=this;return e&&e.constructor===Object?this.where(e).first(t):this._trans("readonly",(function(t){return n.core.get({trans:t,key:e}).then((function(e){return n.hook.reading.fire(e)}))})).then(t)},e.prototype.where=function(e){function t(e,t){try{return 0===s.cmp(e,t)}catch(t){return!1}}if("string"==typeof e)return new this.db.WhereClause(this,e);if(At(e))return new this.db.WhereClause(this,"["+e.join("+")+"]");var n=Tt(e);if(1===n.length)return this.where(n[0]).equals(e[n[0]]);var r=this.schema.indexes.concat(this.schema.primKey).filter((function(e){return e.compound&&n.every((function(t){return 0<=e.keyPath.indexOf(t)}))&&e.keyPath.every((function(e){return 0<=n.indexOf(e)}))}))[0];if(r&&this.db._maxKey!==xn)return this.where(r.name).equals(r.keyPath.map((function(t){return e[t]})));var i=this.schema.idxByName,s=this.db._deps.indexedDB,o=n.reduce((function(n,r){var s=n[0],o=n[1],u=i[r],a=e[r];return[s||u,s||!u?ge(o,u&&u.multi?function(e){var n=v(e,r);return At(n)&&n.some((function(e){return t(a,e)}))}:function(e){return t(a,v(e,r))}):o]}),[null,null]),u=o[0],a=o[1];return u?this.where(u.name).equals(e[u.keyPath]).filter(a):r?this.filter(a):this.where(n).equals("")},e.prototype.filter=function(e){return this.toCollection().and(e)},e.prototype.count=function(e){return this.toCollection().count(e)},e.prototype.offset=function(e){return this.toCollection().offset(e)},e.prototype.limit=function(e){return this.toCollection().limit(e)},e.prototype.each=function(e){return this.toCollection().each(e)},e.prototype.toArray=function(e){return this.toCollection().toArray(e)},e.prototype.toCollection=function(){return new this.db.Collection(new this.db.WhereClause(this))},e.prototype.orderBy=function(e){return new this.db.Collection(new this.db.WhereClause(this,At(e)?"["+e.join("+")+"]":e))},e.prototype.reverse=function(){return this.toCollection().reverse()},e.prototype.mapToClass=function(e){this.schema.mappedClass=e;var t=function(t){if(!t)return t;var n=Object.create(e.prototype);for(var r in t)if(c(t,r))try{n[r]=t[r]}catch(e){}return n};return this.schema.readHook&&this.hook.reading.unsubscribe(this.schema.readHook),this.schema.readHook=t,this.hook("reading",t),e},e.prototype.defineClass=function(){return this.mapToClass((function(e){a(this,e)}))},e.prototype.add=function(e,t){var n=this;return this._trans("readwrite",(function(r){return n.core.mutate({trans:r,type:"add",keys:null==t?null:[t],values:[e]})})).then((function(e){return e.numFailures?L.reject(e.failures[0]):e.lastResult})).then((function(t){if(!n.core.schema.primaryKey.outbound)try{b(e,n.core.schema.primaryKey.keyPath,t)}catch(e){}return t}))},e.prototype.update=function(e,t){if("object"!=typeof t||At(t))throw new Jt.InvalidArgument("Modifications must be an object.");if("object"==typeof e&&!At(e)){Tt(t).forEach((function(n){b(e,n,t[n])}));var n=v(e,this.schema.primKey.keyPath);return void 0===n?Sn(new Jt.InvalidArgument("Given object does not contain its primary key")):this.where(":id").equals(n).modify(t)}return this.where(":id").equals(e).modify(t)},e.prototype.put=function(e,t){var n=this;return this._trans("readwrite",(function(r){return n.core.mutate({trans:r,type:"put",values:[e],keys:null==t?null:[t]})})).then((function(e){return e.numFailures?L.reject(e.failures[0]):e.lastResult})).then((function(t){if(!n.core.schema.primaryKey.outbound)try{b(e,n.core.schema.primaryKey.keyPath,t)}catch(e){}return t}))},e.prototype.delete=function(e){var t=this;return this._trans("readwrite",(function(n){return t.core.mutate({trans:n,type:"delete",keys:[e]})})).then((function(e){return e.numFailures?L.reject(e.failures[0]):void 0}))},e.prototype.clear=function(){var e=this;return this._trans("readwrite",(function(t){return e.core.mutate({trans:t,type:"deleteRange",range:Nn})})).then((function(e){return e.numFailures?L.reject(e.failures[0]):void 0}))},e.prototype.bulkGet=function(e){var t=this;return this._trans("readonly",(function(n){return t.core.getMany({keys:e,trans:n})}))},e.prototype.bulkAdd=function(e,t,n){var r=this,i=Array.isArray(t)?t:void 0,s=(n=n||(i?void 0:t))?n.allKeys:void 0;return this._trans("readwrite",(function(t){if(!r.core.schema.primaryKey.outbound&&i)throw new Jt.InvalidArgument("bulkAdd(): keys argument invalid on tables with inbound keys");if(i&&i.length!==e.length)throw new Jt.InvalidArgument("Arguments objects and keys must have the same length");var n=e.length;return r.core.mutate({trans:t,type:"add",keys:i,values:e,wantResults:s}).then((function(e){var t=e.numFailures,i=e.results,o=e.lastResult,u=e.failures;if(0===t)return s?i:o;throw new D(r.name+".bulkAdd(): "+t+" of "+n+" operations failed",Object.keys(u).map((function(e){return u[e]})))}))}))},e.prototype.bulkPut=function(e,t,n){var r=this,i=Array.isArray(t)?t:void 0,s=(n=n||(i?void 0:t))?n.allKeys:void 0;return this._trans("readwrite",(function(t){if(!r.core.schema.primaryKey.outbound&&i)throw new Jt.InvalidArgument("bulkPut(): keys argument invalid on tables with inbound keys");if(i&&i.length!==e.length)throw new Jt.InvalidArgument("Arguments objects and keys must have the same length");var n=e.length;return r.core.mutate({trans:t,type:"put",keys:i,values:e,wantResults:s}).then((function(e){var t=e.numFailures,i=e.results,o=e.lastResult,u=e.failures;if(0===t)return s?i:o;throw new D(r.name+".bulkPut(): "+t+" of "+n+" operations failed",Object.keys(u).map((function(e){return u[e]})))}))}))},e.prototype.bulkDelete=function(e){var t=this,n=e.length;return this._trans("readwrite",(function(n){return t.core.mutate({trans:n,type:"delete",keys:e})})).then((function(e){var r=e.numFailures,i=e.lastResult,s=e.failures;if(0===r)return i;throw new D(t.name+".bulkDelete(): "+r+" of "+n+" operations failed",s)}))},e}(),Ln=function(){function e(){}return e.prototype._read=function(e,t){var n=this._ctx;return n.error?n.table._trans(null,Sn.bind(null,n.error)):n.table._trans("readonly",e).then(t)},e.prototype._write=function(e){var t=this._ctx;return t.error?t.table._trans(null,Sn.bind(null,t.error)):t.table._trans("readwrite",e,"locked")},e.prototype._addAlgorithm=function(e){var t=this._ctx;t.algorithm=ge(t.algorithm,e)},e.prototype._iterate=function(e,t){return we(this._ctx,e,t,this._ctx.table.core)},e.prototype.clone=function(e){var t=Object.create(this.constructor.prototype),n=Object.create(this._ctx);return e&&a(n,e),t._ctx=n,t},e.prototype.raw=function(){return this._ctx.valueMapper=null,this},e.prototype.each=function(e){var t=this._ctx;return this._read((function(n){return we(t,e,n,t.table.core)}))},e.prototype.count=function(e){var t=this;return this._read((function(e){var n=t._ctx,r=n.table.core;if(ve(n,!0))return r.count({trans:e,query:{index:Ae(n,r.schema),range:n.range}}).then((function(e){return ft(e,n.limit)}));var i=0;return we(n,(function(){return++i,!1}),e,r).then((function(){return i}))})).then(e)},e.prototype.sortBy=function(e,t){function n(e,t){return t?n(e[i[t]],t-1):e[s]}function r(e,t){var r=n(e,o),i=n(t,o);return r<i?-u:r>i?u:0}var i=e.split(".").reverse(),s=i[0],o=i.length-1,u="next"===this._ctx.dir?1:-1;return this.toArray((function(e){return e.sort(r)})).then(t)},e.prototype.toArray=function(e){var t=this;return this._read((function(e){var n=t._ctx;if("next"===n.dir&&ve(n,!0)&&0<n.limit){var r=n.valueMapper,i=Ae(n,n.table.core.schema);return n.table.core.query({trans:e,limit:n.limit,values:!0,query:{index:i,range:n.range}}).then((function(e){var t=e.result;return r?t.map(r):t}))}var s=[];return we(n,(function(e){return s.push(e)}),e,n.table.core).then((function(){return s}))}),e)},e.prototype.offset=function(e){var t=this._ctx;return 0>=e||(t.offset+=e,ve(t)?Te(t,(function(){var t=e;return function(e,n){return 0===t||(1===t?(--t,!1):(n((function(){e.advance(t),t=0})),!1))}})):Te(t,(function(){var t=e;return function(){return 0>--t}}))),this},e.prototype.limit=function(e){return this._ctx.limit=ft(this._ctx.limit,e),Te(this._ctx,(function(){var t=e;return function(e,n,r){return 0>=--t&&n(r),0<=t}}),!0),this},e.prototype.until=function(e,t){return be(this._ctx,(function(n,r,i){return!e(n.value)||(r(i),t)})),this},e.prototype.first=function(e){return this.limit(1).toArray((function(e){return e[0]})).then(e)},e.prototype.last=function(e){return this.reverse().first(e)},e.prototype.filter=function(e){return be(this._ctx,(function(t){return e(t.value)})),function(e,t){e.isMatch=ge(e.isMatch,t)}(this._ctx,e),this},e.prototype.and=function(e){return this.filter(e)},e.prototype.or=function(e){return new this.db.WhereClause(this._ctx.table,e,this)},e.prototype.reverse=function(){return this._ctx.dir="prev"===this._ctx.dir?"next":"prev",this._ondirectionchange&&this._ondirectionchange(this._ctx.dir),this},e.prototype.desc=function(){return this.reverse()},e.prototype.eachKey=function(e){var t=this._ctx;return t.keysOnly=!t.isMatch,this.each((function(t,n){e(n.key,n)}))},e.prototype.eachUniqueKey=function(e){return this._ctx.unique="unique",this.eachKey(e)},e.prototype.eachPrimaryKey=function(e){var t=this._ctx;return t.keysOnly=!t.isMatch,this.each((function(t,n){e(n.primaryKey,n)}))},e.prototype.keys=function(e){var t=this._ctx;t.keysOnly=!t.isMatch;var n=[];return this.each((function(e,t){n.push(t.key)})).then((function(){return n})).then(e)},e.prototype.primaryKeys=function(e){var t=this._ctx;if("next"===t.dir&&ve(t,!0)&&0<t.limit)return this._read((function(e){var n=Ae(t,t.table.core.schema);return t.table.core.query({trans:e,values:!1,limit:t.limit,query:{index:n,range:t.range}})})).then((function(e){return e.result})).then(e);t.keysOnly=!t.isMatch;var n=[];return this.each((function(e,t){n.push(t.primaryKey)})).then((function(){return n})).then(e)},e.prototype.uniqueKeys=function(e){return this._ctx.unique="unique",this.keys(e)},e.prototype.firstKey=function(e){return this.limit(1).keys((function(e){return e[0]})).then(e)},e.prototype.lastKey=function(e){return this.reverse().firstKey(e)},e.prototype.distinct=function(){var e=this._ctx,t=e.index&&e.table.schema.idxByName[e.index];if(!t||!t.multi)return this;var n={};return be(this._ctx,(function(e){var t=e.primaryKey.toString(),r=c(n,t);return n[t]=!0,!r})),this},e.prototype.modify=function(e){var t=this,n=this._ctx;return this._write((function(r){var i;if("function"==typeof e)i=e;else{var s=Tt(e),o=s.length;i=function(t){for(var n=!1,r=0;r<o;++r){var i=s[r],u=e[i];v(t,i)!==u&&(b(t,i,u),n=!0)}return n}}var u=n.table.core,a=u.schema.primaryKey,c=a.outbound,l=a.extractKey,p="testmode"in zn?1:2e3,f=t.db.core.cmp,h=[],d=0,g=[],m=function(e,t){var n=t.failures,r=t.numFailures;d+=e-r;for(var i,s=0,o=Tt(n);s<o.length;s++)i=o[s],h.push(n[i])};return t.clone().primaryKeys().then((function(e){var t=function(n){var s=ft(p,e.length-n);return u.getMany({trans:r,keys:e.slice(n,n+s)}).then((function(o){for(var a=[],h=[],d=c?[]:null,g=[],y=0;y<s;++y){var v=o[y],b={value:q(v),primKey:e[n+y]};!1!==i.call(b,b.value,b)&&(null==b.value?g.push(e[n+y]):c||0===f(l(v),l(b.value))?(h.push(b.value),c&&d.push(e[n+y])):(g.push(e[n+y]),a.push(b.value)))}return Promise.resolve(0<a.length&&u.mutate({trans:r,type:"add",values:a}).then((function(e){for(var t in e.failures)g.splice(parseInt(t),1);m(a.length,e)}))).then((function(){return 0<h.length&&u.mutate({trans:r,type:"put",keys:d,values:h}).then((function(e){return m(h.length,e)}))})).then((function(){return 0<g.length&&u.mutate({trans:r,type:"delete",keys:g}).then((function(e){return m(g.length,e)}))})).then((function(){return e.length>n+s&&t(n+p)}))}))};return t(0).then((function(){if(0<h.length)throw new E("Error modifying one or more objects",h,d,g);return e.length}))}))}))},e.prototype.delete=function(){var e=this._ctx,t=e.range;return ve(e)&&(e.isPrimKey&&!Cn||3===t.type)?this._write((function(n){var r=e.table.core.schema.primaryKey,i=t;return e.table.core.count({trans:n,query:{index:r,range:i}}).then((function(t){return e.table.core.mutate({trans:n,type:"deleteRange",range:i}).then((function(e){var n=e.failures,r=(e.lastResult,e.results,e.numFailures);if(r)throw new E("Could not delete some values",Object.keys(n).map((function(e){return n[e]})),t-r);return t-r}))}))})):this.modify((function(e,t){return t.value=null}))},e}(),Gn=function(){function e(){}return Object.defineProperty(e.prototype,"Collection",{get:function(){return this._ctx.table.db.Collection},enumerable:!0,configurable:!0}),e.prototype.between=function(e,t,n,r){n=!1!==n,r=!0===r;try{return 0<this._cmp(e,t)||0===this._cmp(e,t)&&(n||r)&&(!n||!r)?Pe(this):new this.Collection(this,(function(){return Ee(e,t,!n,!r)}))}catch(t){return ke(this,En)}},e.prototype.equals=function(e){return new this.Collection(this,(function(){return De(e)}))},e.prototype.above=function(e){return null==e?ke(this,En):new this.Collection(this,(function(){return Ee(e,void 0,!0)}))},e.prototype.aboveOrEqual=function(e){return null==e?ke(this,En):new this.Collection(this,(function(){return Ee(e,void 0,!1)}))},e.prototype.below=function(e){return null==e?ke(this,En):new this.Collection(this,(function(){return Ee(void 0,e,!1,!0)}))},e.prototype.belowOrEqual=function(e){return null==e?ke(this,En):new this.Collection(this,(function(){return Ee(void 0,e)}))},e.prototype.startsWith=function(e){return"string"==typeof e?this.between(e,e+xn,!0,!0):ke(this,Dn)},e.prototype.startsWithIgnoreCase=function(e){return""===e?this.startsWith(e):xe(this,(function(e,t){return 0===e.indexOf(t[0])}),[e],xn)},e.prototype.equalsIgnoreCase=function(e){return xe(this,(function(e,t){return e===t[0]}),[e],"")},e.prototype.anyOfIgnoreCase=function(){var e=U.apply(It,arguments);return 0===e.length?Pe(this):xe(this,(function(e,t){return-1!==t.indexOf(e)}),e,"")},e.prototype.startsWithAnyOfIgnoreCase=function(){var e=U.apply(It,arguments);return 0===e.length?Pe(this):xe(this,(function(e,t){return t.some((function(t){return 0===e.indexOf(t)}))}),e,xn)},e.prototype.anyOf=function(){var e=this,t=U.apply(It,arguments),n=this._cmp;try{t.sort(n)}catch(t){return ke(this,En)}if(0===t.length)return Pe(this);var r=new this.Collection(this,(function(){return Ee(t[0],t[t.length-1])}));r._ondirectionchange=function(r){n="next"===r?e._ascending:e._descending,t.sort(n)};var i=0;return r._addAlgorithm((function(e,r,s){for(var o=e.key;0<n(o,t[i]);)if(++i===t.length)return r(s),!1;return 0===n(o,t[i])||(r((function(){e.continue(t[i])})),!1)})),r},e.prototype.notEqual=function(e){return this.inAnyRange([[-1/0,e],[e,this.db._maxKey]],{includeLowers:!1,includeUppers:!1})},e.prototype.noneOf=function(){var e=U.apply(It,arguments);if(0===e.length)return new this.Collection(this);try{e.sort(this._ascending)}catch(t){return ke(this,En)}var t=e.reduce((function(e,t){return e?e.concat([[e[e.length-1][1],t]]):[[-1/0,t]]}),null);return t.push([e[e.length-1],this.db._maxKey]),this.inAnyRange(t,{includeLowers:!1,includeUppers:!1})},e.prototype.inAnyRange=function(e,t){function n(e,t){return f(e[0],t[0])}var r=this,i=this._cmp,s=this._ascending,o=this._descending,u=this._min,a=this._max;if(0===e.length)return Pe(this);if(!e.every((function(e){return void 0!==e[0]&&void 0!==e[1]&&0>=s(e[0],e[1])})))return ke(this,"First argument to inAnyRange() must be an Array of two-value Arrays [lower,upper] where upper must not be lower than lower",Jt.InvalidArgument);var c,l=!t||!1!==t.includeLowers,p=t&&!0===t.includeUppers,f=s;try{(c=e.reduce((function(e,t){for(var n,r=0,s=e.length;r<s;++r)if(n=e[r],0>i(t[0],n[1])&&0<i(t[1],n[0])){n[0]=u(n[0],t[0]),n[1]=a(n[1],t[1]);break}return r===s&&e.push(t),e}),[])).sort(n)}catch(e){return ke(this,En)}var h=0,d=p?function(e){return 0<s(e,c[h][1])}:function(e){return 0<=s(e,c[h][1])},g=l?function(e){return 0<o(e,c[h][0])}:function(e){return 0<=o(e,c[h][0])},m=d,y=new this.Collection(this,(function(){return Ee(c[0][0],c[c.length-1][1],!l,!p)}));return y._ondirectionchange=function(e){"next"===e?(m=d,f=s):(m=g,f=o),c.sort(n)},y._addAlgorithm((function(e,t,n){for(var i=e.key;m(i);)if(++h===c.length)return t(n),!1;return!!function(e){return!d(e)&&!g(e)}(i)||0!==r._cmp(i,c[h][1])&&0!==r._cmp(i,c[h][0])&&(t((function(){f===s?e.continue(c[h][0]):e.continue(c[h][1])})),!1)})),y},e.prototype.startsWithAnyOf=function(){var e=U.apply(It,arguments);return e.every((function(e){return"string"==typeof e}))?0===e.length?Pe(this):this.inAnyRange(e.map((function(e){return[e,e+xn]}))):ke(this,"startsWithAnyOf() only works with strings")},e}(),Hn=function(){function e(){}return e.prototype._lock=function(){return g(!mn.global),++this._reculock,1!==this._reculock||mn.global||(mn.lockOwnerFor=this),this},e.prototype._unlock=function(){if(g(!mn.global),0==--this._reculock)for(mn.global||(mn.lockOwnerFor=null);0<this._blockedFuncs.length&&!this._locked();){var e=this._blockedFuncs.shift();try{pe(e[1],e[0])}catch(e){}}return this},e.prototype._locked=function(){return this._reculock&&mn.lockOwnerFor!==this},e.prototype.create=function(e){var t=this;if(!this.mode)return this;var n=this.db.idbdb,r=this.db._state.dbOpenError;if(g(!this.idbtrans),!e&&!n)switch(r&&r.name){case"DatabaseClosedError":throw new Jt.DatabaseClosed(r);case"MissingAPIError":throw new Jt.MissingAPI(r.message,r);default:throw new Jt.OpenFailed(r)}if(!this.active)throw new Jt.TransactionInactive;return g(null===this._completion._state),(e=this.idbtrans=e||n.transaction(Oe(this.storeNames),this.mode)).onerror=ne((function(n){Ie(n),t._reject(e.error)})),e.onabort=ne((function(n){Ie(n),t.active&&t._reject(new Jt.Abort(e.error)),t.active=!1,t.on("abort").fire(n)})),e.oncomplete=ne((function(){t.active=!1,t._resolve()})),this},e.prototype._promise=function(e,t,n){var r=this;if("readwrite"===e&&"readwrite"!==this.mode)return Sn(new Jt.ReadOnly("Transaction is readonly"));if(!this.active)return Sn(new Jt.TransactionInactive);if(this._locked())return new L((function(i,s){r._blockedFuncs.push([function(){r._promise(e,t,n).then(i,s)},mn])}));if(n)return re((function(){var e=new L((function(e,n){r._lock();var i=t(e,n,r);i&&i.then&&i.then(e,n)}));return e.finally((function(){return r._unlock()})),e._lib=!0,e}));var i=new L((function(e,n){var i=t(e,n,r);i&&i.then&&i.then(e,n)}));return i._lib=!0,i},e.prototype._root=function(){return this.parent?this.parent._root():this},e.prototype.waitFor=function(e){var t=this._root(),n=L.resolve(e);if(t._waitingFor)t._waitingFor=t._waitingFor.then((function(){return n}));else{t._waitingFor=n,t._waitingQueue=[];var r=t.idbtrans.objectStore(t.storeNames[0]);!function e(){for(++t._spinCount;t._waitingQueue.length;)t._waitingQueue.shift()();t._waitingFor&&(r.get(-1/0).onsuccess=e)}()}var i=t._waitingFor;return new L((function(e,r){n.then((function(n){return t._waitingQueue.push(ne(e.bind(null,n)))}),(function(e){return t._waitingQueue.push(ne(r.bind(null,e)))})).finally((function(){t._waitingFor===i&&(t._waitingFor=null)}))}))},e.prototype.abort=function(){this.active&&this._reject(new Jt.Abort),this.active=!1},e.prototype.table=function(e){var t=this._memoizedTables||(this._memoizedTables={});if(c(t,e))return t[e];var n=this.schema[e];if(!n)throw new Jt.NotFound("Table "+e+" not part of transaction");var r=new this.db.Table(e,n,this);return r.core=this.db.core.table(e),t[e]=r,r},e}(),Vn=0,Jn=function(){function e(){}return e.prototype._parseStoresSpec=function(e,t){Tt(e).forEach((function(n){if(null!==e[n]){var r=function(e){return e.split(",").map((function(e,t){var n=(e=e.trim()).replace(/([&*]|\+\+)/g,""),r=/^\[/.test(n)?n.match(/^\[(.*)\]$/)[1].split("+"):n;return Be(n,r||null,/\&/.test(e),/\*/.test(e),/\+\+/.test(e),At(r),0===t)}))}(e[n]),i=r.shift();if(i.multi)throw new Jt.Schema("Primary key cannot be multi-valued");r.forEach((function(e){if(e.auto)throw new Jt.Schema("Only primary key can be marked as autoIncrement (++)");if(!e.keyPath)throw new Jt.Schema("Index must have a name and cannot be an empty string")})),t[n]=Me(n,i,r)}}))},e.prototype.stores=function(e){var t=this.db;this._cfg.storesSource=this._cfg.storesSource?a(this._cfg.storesSource,e):e;var n=t._versions,r={},i={};return n.forEach((function(e){a(r,e._cfg.storesSource),i=e._cfg.dbschema={},e._parseStoresSpec(r,i)})),t._dbSchema=i,We(t,[t._allTables,t,t.Transaction.prototype]),Xe(t,[t._allTables,t,t.Transaction.prototype,this._cfg.tables],Tt(i),i),t._storeNames=Tt(i),this},e.prototype.upgrade=function(e){return this._cfg.contentUpgrade=e,this},e}(),Xn={stack:"dbcore",name:"VirtualIndexMiddleware",level:1,create:function(e){return bt(bt({},e),{table:function(t){function n(e,t,r){var i=Ge(e),s=u[i]=u[i]||[],o=null==e?0:"string"==typeof e?1:e.length,c=0<t,l=bt(bt({},r),{isVirtual:c,isPrimaryKey:!c&&r.isPrimaryKey,keyTail:t,keyLength:o,extractKey:Ne(e),unique:!c&&r.unique});(s.push(l),l.isPrimaryKey||a.push(l),1<o)&&n(2===o?e[0]:e.slice(0,o-1),t+1,r);return s.sort((function(e,t){return e.keyTail-t.keyTail})),l}function r(t,n){return{type:1===t.type?2:t.type,lower:ot(t.lower,t.lowerOpen?e.MAX_KEY:e.MIN_KEY,n),lowerOpen:!0,upper:ot(t.upper,t.upperOpen?e.MIN_KEY:e.MAX_KEY,n),upperOpen:!0}}function i(e){var t=e.query.index;return t.isVirtual?bt(bt({},e),{query:{index:t,range:r(e.query.range,t.keyTail)}}):e}var s=e.table(t),o=s.schema,u={},a=[],c=n(o.primaryKey.keyPath,0,o.primaryKey);u[":id"]=[c];for(var l,p=0,f=o.indexes;p<f.length;p++)n((l=f[p]).keyPath,0,l);return bt(bt({},s),{schema:bt(bt({},o),{primaryKey:c,indexes:a,getIndexByKeyPath:function(e){var t=u[Ge(e)];return t&&t[0]}}),count:function(e){return s.count(i(e))},query:function(e){return s.query(i(e))},openCursor:function(t){function n(n){return Object.create(n,{continue:{value:function(r){null==r?t.unique?n.continue(ot(n.key,t.reverse?e.MIN_KEY:e.MAX_KEY,o)):n.continue():n.continue(ot(r,t.reverse?e.MAX_KEY:e.MIN_KEY,o))}},continuePrimaryKey:{value:function(t,r){n.continuePrimaryKey(ot(t,e.MAX_KEY,o),r)}},key:{get:function(){var e=n.key;return 1===a?e[0]:e.slice(0,a)}},value:{get:function(){return n.value}}})}var r=t.query.index,o=r.keyTail,u=r.isVirtual,a=r.keyLength;return u?s.openCursor(i(t)).then((function(e){return e&&n(e)})):s.openCursor(t)}})}})}},Wn={stack:"dbcore",name:"HooksMiddleware",level:2,create:function(e){return bt(bt({},e),{table:function(t){var n=e.table(t),r=n.schema.primaryKey;return bt(bt({},n),{mutate:function(e){function i(e){var t=mn.trans,i=e.keys||Fe(r,e);if(!i)throw new Error("Keys missing");return"delete"!==(e="add"===e.type||"put"===e.type?bt(bt({},e),{keys:i,wantResults:!0}):bt({},e)).type&&(e.values=u(e.values)),e.keys&&(e.keys=u(e.keys)),function(e,t,n){return"add"===t.type?Promise.resolve(Array(t.values.length)):e.getMany({trans:t.trans,keys:n})}(n,e,i).then((function(s){var o=i.map((function(n,i){var o=s[i],u={onerror:null,onsuccess:null};if("delete"===e.type)c.fire.call(u,n,o,t);else if("add"===e.type||void 0===o){var a=l.fire.call(u,n,e.values[i],t);null==n&&null!=a&&(n=a,e.keys[i]=n,!r.outbound&&b(e.values[i],r.keyPath,n))}else{var f=_(o,e.values[i]),h=p.fire.call(u,f,n,o,t);if(h){var d=e.values[i];Object.keys(h).forEach((function(e){b(d,e,h[e])}))}}return u}));return n.mutate(e).then((function(t){for(var n=t.failures,r=t.results,u=t.numFailures,a=t.lastResult,c=0;c<i.length;++c){var l=r?r[c]:i[c],p=o[c];null==l?p.onerror&&p.onerror(n[c]):p.onsuccess&&p.onsuccess("put"===e.type&&s[c]?e.values[c]:l)}return{failures:n,results:r,numFailures:u,lastResult:a}})).catch((function(e){return o.forEach((function(t){return t.onerror&&t.onerror(e)})),Promise.reject(e)}))}))}function s(e){return function e(t,s,o){return n.query({trans:t,values:!1,query:{index:r,range:s},limit:o}).then((function(n){var r=n.result;return i({type:"delete",keys:r,trans:t}).then((function(n){return 0<n.numFailures?Promise.reject(n.failures[0]):r.length<o?{failures:[],numFailures:0,lastResult:void 0}:e(t,bt(bt({},s),{lower:r[r.length-1],lowerOpen:!0}),o)}))}))}(e.trans,e.range,1e4)}var o=mn.trans,a=o.table(t).hook,c=a.deleting,l=a.creating,p=a.updating;switch(e.type){case"add":if(l.fire===O)break;return o._promise("readwrite",(function(){return i(e)}),!0);case"put":if(l.fire===O&&p.fire===O)break;return o._promise("readwrite",(function(){return i(e)}),!0);case"delete":if(c.fire===O)break;return o._promise("readwrite",(function(){return i(e)}),!0);case"deleteRange":if(c.fire===O)break;return o._promise("readwrite",(function(){return s(e)}),!0)}return n.mutate(e)}})}})}},zn=function(){function e(t,n){var r=this;this._middlewares={},this.verno=0;var i=e.dependencies;this._options=n=bt({addons:e.addons,autoOpen:!0,indexedDB:i.indexedDB,IDBKeyRange:i.IDBKeyRange},n),this._deps={indexedDB:n.indexedDB,IDBKeyRange:n.IDBKeyRange};var s=n.addons;this._dbSchema={},this._versions=[],this._storeNames=[],this._allTables={},this.idbdb=null;var o={dbOpenError:null,isBeingOpened:!1,onReadyBeingFired:null,openComplete:!1,dbReadyResolve:O,dbReadyPromise:null,cancelOpen:O,openCanceller:null,autoSchema:!0};o.dbReadyPromise=new L((function(e){o.dbReadyResolve=e})),o.openCanceller=new L((function(e,t){o.cancelOpen=t})),this._state=o,this.name=t,this.on=me(this,"populate","blocked","versionchange",{ready:[F,O]}),this.on.ready.subscribe=d(this.on.ready.subscribe,(function(t){return function(n,i){e.vip((function(){var e=r._state;if(e.openComplete)e.dbOpenError||L.resolve().then(n),i&&t(n);else if(e.onReadyBeingFired)e.onReadyBeingFired.push(n),i&&t(n);else{t(n);var s=r;i||t((function e(){s.on.ready.unsubscribe(n),s.on.ready.unsubscribe(e)}))}}))}})),this.Collection=function(e){return ye(Ln.prototype,(function(t,n){this.db=e;var r=Nn,i=null;if(n)try{r=n()}catch(e){i=e}var s=t._ctx,o=s.table,u=o.hook.reading.fire;this._ctx={table:o,index:s.index,isPrimKey:!s.index||o.schema.primKey.keyPath&&s.index===o.schema.primKey.name,range:r,keysOnly:!1,dir:"next",unique:"",algorithm:null,filter:null,replayFilter:null,justLimit:!0,isMatch:null,offset:0,limit:1/0,error:i,or:s.or,valueMapper:u===C?null:u}}))}(this),this.Table=function(e){return ye(Fn.prototype,(function(t,n,r){this.db=e,this._tx=r,this.name=t,this.schema=n,this.hook=e._allTables[t]?e._allTables[t].hook:me(null,{creating:[B,O],reading:[R,C],updating:[M,O],deleting:[K,O]})}))}(this),this.Transaction=function(e){return ye(Hn.prototype,(function(t,n,r,i){var s=this;this.db=e,this.mode=t,this.storeNames=n,this.schema=r,this.idbtrans=null,this.on=me(this,"complete","error","abort"),this.parent=i||null,this.active=!0,this._reculock=0,this._blockedFuncs=[],this._resolve=null,this._reject=null,this._waitingFor=null,this._waitingQueue=null,this._spinCount=0,this._completion=new L((function(e,t){s._resolve=e,s._reject=t})),this._completion.then((function(){s.active=!1,s.on.complete.fire()}),(function(e){var t=s.active;return s.active=!1,s.on.error.fire(e),s.parent?s.parent._reject(e):t&&s.idbtrans&&s.idbtrans.abort(),Sn(e)}))}))}(this),this.Version=function(e){return ye(Jn.prototype,(function(t){this.db=e,this._cfg={version:t,storesSource:null,dbschema:{},tables:{},contentUpgrade:null}}))}(this),this.WhereClause=function(e){return ye(Gn.prototype,(function(t,n,r){this.db=e,this._ctx={table:t,index:":id"===n?null:n,or:r};var i=e._deps.indexedDB;if(!i)throw new Jt.MissingAPI("indexedDB API missing");this._cmp=this._ascending=i.cmp.bind(i),this._descending=function(e,t){return i.cmp(t,e)},this._max=function(e,t){return 0<i.cmp(e,t)?e:t},this._min=function(e,t){return 0>i.cmp(e,t)?e:t},this._IDBKeyRange=e._deps.IDBKeyRange}))}(this),this.on("versionchange",(function(e){e.newVersion,r.close()})),this.on("blocked",(function(e){e.newVersion&&(e.newVersion,e.oldVersion)})),this._maxKey=Ce(n.IDBKeyRange),this._createTransaction=function(e,t,n,i){return new r.Transaction(e,t,n,i)},this._fireOnBlocked=function(e){r.on("blocked").fire(e),On.filter((function(e){return e.name===r.name&&e!==r&&!e._state.vcFired})).map((function(t){return t.on("versionchange").fire(e)}))},this.use(Xn),this.use(Wn),s.forEach((function(e){return e(r)}))}return e.prototype.version=function(e){if(isNaN(e)||.1>e)throw new Jt.Type("Given version is not a positive number");if(e=pt(10*e)/10,this.idbdb||this._state.isBeingOpened)throw new Jt.Schema("Cannot add version when database is open");this.verno=Math.max(this.verno,e);var t=this._versions,n=t.filter((function(t){return t._cfg.version===e}))[0];return n||(n=new this.Version(e),t.push(n),t.sort(ze),n.stores({}),this._state.autoSchema=!1,n)},e.prototype._whenReady=function(e){var t=this;return this._state.openComplete||mn.letThrough?e():new L((function(e,n){if(!t._state.isBeingOpened){if(!t._options.autoOpen)return void n(new Jt.DatabaseClosed);t.open().catch(O)}t._state.dbReadyPromise.then(e,n)})).then(e)},e.prototype.use=function(e){var t=e.stack,n=e.create,r=e.level,i=e.name;i&&this.unuse({stack:t,name:i});var s=this._middlewares[t]||(this._middlewares[t]=[]);return s.push({stack:t,create:n,level:null==r?10:r,name:i}),s.sort((function(e,t){return e.level-t.level})),this},e.prototype.unuse=function(e){var t=e.stack,n=e.name,r=e.create;return t&&this._middlewares[t]&&(this._middlewares[t]=this._middlewares[t].filter((function(e){return r?e.create!==r:!!n&&e.name!==n}))),this},e.prototype.open=function(){return nt(this)},e.prototype.close=function(){var e=On.indexOf(this),t=this._state;if(0<=e&&On.splice(e,1),this.idbdb){try{this.idbdb.close()}catch(t){}this.idbdb=null}this._options.autoOpen=!1,t.dbOpenError=new Jt.DatabaseClosed,t.isBeingOpened&&t.cancelOpen(t.dbOpenError),t.dbReadyPromise=new L((function(e){t.dbReadyResolve=e})),t.openCanceller=new L((function(e,n){t.cancelOpen=n}))},e.prototype.delete=function(){var e=this,t=0<arguments.length,n=this._state;return new L((function(r,i){var s=function(){e.close();var t=e._deps.indexedDB.deleteDatabase(e.name);t.onsuccess=ne((function(){kn.remove(e.name),r()})),t.onerror=Re(i),t.onblocked=e._fireOnBlocked};if(t)throw new Jt.InvalidArgument("Arguments not allowed in db.delete()");n.isBeingOpened?n.dbReadyPromise.then(s):s()}))},e.prototype.backendDB=function(){return this.idbdb},e.prototype.isOpen=function(){return null!==this.idbdb},e.prototype.hasBeenClosed=function(){var e=this._state.dbOpenError;return e&&"DatabaseClosed"===e.name},e.prototype.hasFailed=function(){return null!==this._state.dbOpenError},e.prototype.dynamicallyOpened=function(){return this._state.autoSchema},Object.defineProperty(e.prototype,"tables",{get:function(){var e=this;return Tt(this._allTables).map((function(t){return e._allTables[t]}))},enumerable:!0,configurable:!0}),e.prototype.transaction=function(){var e=it.apply(this,arguments);return this._transaction.apply(this,e)},e.prototype._transaction=function(e,t,n){var r=this,i=mn.trans;i&&i.db===this&&-1===e.indexOf("!")||(i=null);var s,o,u=-1!==e.indexOf("?");e=e.replace("!","").replace("?","");try{if(o=t.map((function(e){var t=e instanceof r.Table?e.name:e;if("string"!=typeof t)throw new TypeError("Invalid table argument to Dexie.transaction(). Only Table or String are allowed");return t})),"r"==e||e===Kn)s=Kn;else{if("rw"!=e&&e!=Mn)throw new Jt.InvalidArgument("Invalid transaction mode: "+e);s=Mn}if(i){if(i.mode===Kn&&s===Mn){if(!u)throw new Jt.SubTransaction("Cannot enter a sub-transaction with READWRITE mode when parent transaction is READONLY");i=null}i&&o.forEach((function(e){if(i&&-1===i.storeNames.indexOf(e)){if(!u)throw new Jt.SubTransaction("Table "+e+" not included in parent transaction.");i=null}})),u&&i&&!i.active&&(i=null)}}catch(t){return i?i._promise(null,(function(e,n){n(t)})):Sn(t)}var a=st.bind(null,this,s,o,i,n);return i?i._promise(s,a,"lock"):mn.trans?pe(mn.transless,(function(){return r._whenReady(a)})):this._whenReady(a)},e.prototype.table=function(e){if(!c(this._allTables,e))throw new Jt.InvalidTable("Table "+e+" does not exist");return this._allTables[e]},e}(),Qn=zn;l(Qn,bt(bt({},Wt),{delete:function(e){return new Qn(e).delete()},exists:function(e){return new Qn(e,{addons:[]}).open().then((function(e){return e.close(),!0})).catch("NoSuchDatabaseError",(function(){return!1}))},getDatabaseNames:function(e){return kn?kn.getDatabaseNames().then(e):L.resolve([])},defineClass:function(){return function(e){a(this,e)}},ignoreTransaction:function(e){return mn.trans?pe(mn.transless,e):e()},vip:tt,async:function(e){return function(){try{var t=rt(e.apply(this,arguments));return t&&"function"==typeof t.then?t:L.resolve(t)}catch(t){return Sn(t)}}},spawn:function(e,t,n){try{var r=rt(e.apply(n,t||[]));return r&&"function"==typeof r.then?r:L.resolve(r)}catch(t){return Sn(t)}},currentTransaction:{get:function(){return mn.trans||null}},waitFor:function(e,t){var n=L.resolve("function"==typeof e?Qn.ignoreTransaction(e):e).timeout(t||6e4);return mn.trans?mn.trans.waitFor(n):n},Promise:L,debug:{get:function(){return Kt},set:function(e){j(e,"dexie"===e?function(){return!0}:In)}},derive:f,extend:a,props:l,override:d,Events:me,getByKeyPath:v,setByKeyPath:b,delByKeyPath:function(e,t){"string"==typeof t?b(e,t,void 0):"length"in t&&[].map.call(t,(function(t){b(e,t,void 0)}))},shallowClone:T,deepClone:q,getObjectDiff:_,asap:m,minKey:-1/0,addons:[],connections:On,errnames:Ht,dependencies:function(){try{return{indexedDB:qt.indexedDB||qt.mozIndexedDB||qt.webkitIndexedDB||qt.msIndexedDB,IDBKeyRange:qt.IDBKeyRange||qt.webkitIDBKeyRange}}catch(e){return{indexedDB:null,IDBKeyRange:null}}}(),semVer:"3.0.1",version:"3.0.1".split(".").map((function(e){return parseInt(e)})).reduce((function(e,t,n){return e+t/Math.pow(10,2*n)})),default:Qn,Dexie:Qn})),Qn.maxKey=Ce(Qn.dependencies.IDBKeyRange),function(e){try{kn=function(e){var t,n=e&&"function"==typeof e.databases;if(!n){var r=new zn(Bn,{addons:[]});r.version(1).stores({dbnames:"name"}),t=r.table("dbnames")}return{getDatabaseNames:function(){return n?L.resolve(e.databases()).then((function(e){return e.map((function(e){return e.name})).filter((function(e){return e!==Bn}))})):t.toCollection().primaryKeys()},add:function(e){return!n&&e!==Bn&&t.put({name:e}).catch(O)},remove:function(e){return!n&&e!==Bn&&t.delete(e).catch(O)}}}(e)}catch(e){}}(zn.dependencies.indexedDB),L.rejectionMapper=function(e,t){if(!e||e instanceof S||e instanceof TypeError||e instanceof SyntaxError||!e.name||!Xt[e.name])return e;var n=new Xt[e.name](t||e.message,e);return"stack"in e&&p(n,"stack",{get:function(){return this.inner.stack}}),n},j(Kt,In);var Yn=function(){var e=new zn("IDBCache",{autoOpen:!1});this.isSupported=function(){var e=window.indexedDB||window.mozIndexedDB||window.webkitIndexedDB||window.msIndexedDB,t=window.IDBKeyRange||window.webkitIDBKeyRange,n=window.IDBCursor||window.webkitIDBCursor,r=function(){var e=window.navigator.userAgent,t=e.indexOf("MSIE ");if(0<t)return parseInt(e.substring(t+5,e.indexOf(".",t)),10);if(0<e.indexOf("Trident/")){var n=e.indexOf("rv:");return parseInt(e.substring(n+3,e.indexOf(".",n)),10)}var r=e.indexOf("Edge/");return!!(0<r)&&parseInt(e.substring(r+5,e.indexOf(".",r)),10)}(),i=function(){if(navigator.userAgent.match(/Safari/i)&&0==!navigator.userAgent.match(/Chrome/i))return!1;var e=navigator.userAgent.toLowerCase();return(e=e.substring(e.indexOf("version/")+8)).substring(0,e.indexOf("."))}(),s=!!navigator.userAgent.match(/iPad|iPhone|iPod/i);return navigator.userAgent.match(/PhantomJS/i)?e&&t&&n:e&&t&&n&&!(!1!==r&&11>r)&&!s&&!(!1!==i&&10>i)},this.addResponse=function(t,n,r,i){return e.responseTable.put({etag:r,data:n,timestamp:$.now(),chunks:i?parseInt(i,10):null},t)},this.getResponse=function(t){return e.responseTable.get(t)},this.addBatchResponse=function(t,n,r,i){return e.batchedResponseTable.put({id:t+n,batch:n,data:r,timestamp:$.now(),chunks:i?parseInt(i,10):null})},this.getBatchResponse=function(t,n){return e.batchedResponseTable.get(t+n)},this.deleteBatchResponses=function(t){return e.batchedResponseTable.where("batch").equals(t).delete()},this.clear=function(){return Promise.all([e.responseTable.clear(),e.batchedResponseTable.clear()])},this.clearResponseTable=function(){return Promise.all([e.responseTable.clear()])},this.initDB=function(){return e.version(.1).stores({responseTable:""}),e.version(.2).stores({batchResponseTable:"&[id+batch],batch"}),e.version(.3).stores({batchedResponseTable:"id,batch",batchResponseTable:null}),e.open()},this.deleteDB=function(){return e.delete()},this.close=function(){return e.close()},this.isOpen=function(){return e.isOpen()},this.dumpTableContent=function(){var e=at(regeneratorRuntime.mark((function e(t){var n,r;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=function(e,t){return"timestamp"===e?window&&window.BIMPLUS_SDK_ENABLE_IDBCACHE_TIMESTAMP_DUMP?t:"NOT SHOWN":"data"===e?window&&window.BIMPLUS_SDK_ENABLE_IDBCACHE_DATA_DUMP?t:"NOT SHOWN":t},r="",e.next=4,t.each((function(e){r+=" ".concat(JSON.stringify(e,n),"\n")}));case 4:return e.abrupt("return",r);case 5:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),this.dumpTable=function(){var e=at(regeneratorRuntime.mark((function e(t){var n,r,i,s;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,t.toCollection().count();case 2:return n=e.sent,r=[t.schema.primKey].concat(t.schema.indexes),i=r.map((function(e){return e.src})).join(","),s="Table: ".concat(t.name,", Schema: '").concat(i,"', Count of entries: ").concat(n,"\n"),e.t0=s,e.next=9,this.dumpTableContent(t);case 9:return s=e.t0+=e.sent,e.abrupt("return",s);case 11:case"end":return e.stop()}}),e,this)})));return function(){return e.apply(this,arguments)}}(),this.dumpDatabase=at(regeneratorRuntime.mark((function t(){var n;return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return n="",n+="BimWebSdk: Dexie Databases Dump\n",n+="===============================\n",n+="Database: ".concat(e.name," (Version: ").concat(e.verno,")\n"),t.t0=n,t.next=7,this.dumpTable(e.responseTable);case 7:return n=t.t0+=t.sent,t.t1=n,t.next=11,this.dumpTable(e.batchedResponseTable);case 11:return n=t.t1+=t.sent,t.abrupt("return",n);case 13:case"end":return t.stop()}}),t,this)})))},$n=function(){var e=null,t=null,n=new Yn;n.initDB().then((function(){window.BIMPLUS_SDK_ENABLE_IDBCACHE_DUMP&&n.dumpDatabase().then((function(){}))})).catch((function(){})),this.setAccessToken=function(t){e=t},this.setTokenType=function(e){t=e},this.getCache=function(){return n};var u=function(e,t,r){var i=r.getResponseHeader("ETag"),s=r.getResponseHeader("X-Total-Count"),o="arraybuffer"===r.responseType;if(i){var u=0==o?JSON.stringify(t):null;n.addResponse(e,o?t:JSON.parse(u),i,s).then((function(){})).catch((function(){}))}},a=function(e){return"W"===e.charAt(0)?e.substring(2):e};this.getBatchResponse=function(e,t,s){var o=$.Deferred(),u=s.useXMLHttpRequest?i:r;return n.getBatchResponse(e,t).then((function(r){if(r){var i={};return null!==r.chunks&&(i["Cached-X-Total-Count"]=r.chunks),i.status=304,void o.resolve(r.data,304,i)}u(e,"GET",null,s).done((function(r,i,s){var u=s.getResponseHeader("X-Total-Count"),a="arraybuffer"===s.responseType,c=!1===a?JSON.stringify(r):null;n.addBatchResponse(e,t,a?r:JSON.parse(c),u).then((function(){})).catch((function(){})),o.resolve(r,i,s)})).fail((function(e,t){o.reject(e,t)}))})),o.promise()},this.get=function(o,c){if(c||(c={}),c.token||(c.token=e),c.tokenType&&c.tokenType===t||(c.tokenType=t),c.queryParams&&(o+=s(c.queryParams)),c.responseBatch)return this.getBatchResponse(o,c.responseBatch,c);var l=$.Deferred(),p=c.useXMLHttpRequest?i:r;return n.getResponse("GET;"+o).then((function(e){if(e){var t=a(e.etag);c.eTag=t,p(o,"GET",null,c).done((function(t,n,r){304===r.status?(null!==e.chunks&&(r["Cached-X-Total-Count"]=e.chunks),l.resolve(e.data,n,r)):(u("GET;"+o,t,r),l.resolve(t,n,r))})).fail((function(e,t){l.reject(e,t)}))}else p(o,"GET",null,c).done((function(e,t,n){u("GET;"+o,e,n),l.resolve(e,t,n)})).fail((function(e,t){l.reject(e,t)}))})).catch((function(){p(o,"GET",null,c).done((function(e,t,n){u("GET;"+o,e,n),l.resolve(e,t,n)})).fail((function(e,t){l.reject(e,t)}))})),l.promise()},this.getChunked=function(t,n){return o(this,e,"medium",t,n)},this.put=function(n,i,o){return o||(o={}),o.token||(o.token=e),o.tokenType&&o.tokenType===t||(o.tokenType=t),o.queryParams&&(n+=s(o.queryParams)),r(n,"PUT",i,o)},this.post=function(n,o,u){return u||(u={}),u.token||(u.token=e),u.tokenType&&u.tokenType===t||(u.tokenType=t),u.queryParams&&(n+=s(u.queryParams)),(u.useXMLHttpRequest?i:r)(n,"POST",o,u)},this.del=function(n,i,o){return o||(o={}),i||(o.contentType=null),o.dataType=null,o.token||(o.token=e),o.tokenType&&o.tokenType===t||(o.tokenType=t),o.queryParams&&(n+=s(o.queryParams)),r(n,"DELETE",i||null,o)},this.head=function(i,o){o||(o={}),o.contentType="",o.dataType="",o.token||(o.token=e),o.tokenType&&o.tokenType===t||(o.tokenType=t),o.queryParams&&(i+=s(o.queryParams));var c=$.Deferred();return n.getResponse("HEAD;"+i).then((function(e){if(e){var t=a(e.etag);o.eTag=t,r(i,"HEAD",null,o).done((function(e,t,n){304===n.status?c.resolve(!0,t,n):(u("HEAD;"+i,null,n),c.resolve(!1,t,n))})).fail((function(e,t){c.reject(e,t)}))}else r(i,"HEAD",null,o).done((function(e,t,n){u("HEAD;"+i,null,n),c.resolve(!1,t,n)})).fail((function(e,t){c.reject(!1,t)}))})).catch((function(){r(i,"HEAD",null,o).done((function(e,t,n){u("HEAD;"+i,null,n),c.resolve(!1,t,n)})).fail((function(e,t){c.reject(!1,t)}))})),c.promise()}},Zn=function(e){this.detectAllClashes=function(t){return e.request.post(e.getApiTeamUrl()+"services/postprocess",t)},this.detectDisciplinesClashes=function(t){return e.request.post(e.getApiTeamUrl()+"clashdetection",t)},this.getFilters=function(t,n){var r={queryParams:{customFilter:n}};return t?e.request.get(e.getApiTeamUrl()+"clashdetection/filters/"+t,n?r:null):e.request.get(e.getApiTeamUrl()+"clashdetection/filters",n?r:null)},this.calculateClashes=function(t,n){return n?e.request.post(e.getApiTeamUrl()+"clashdetection/filters",t,{queryParams:{topology:n}}):e.request.post(e.getApiTeamUrl()+"clashdetection/filters",t)},this.getFilterResults=function(t,n,r){return r?e.request.get(e.getApiTeamUrl()+"clashdetection/projects/"+t+"/filters/"+n,{queryParams:{topology:r}}):e.request.get(e.getApiTeamUrl()+"clashdetection/projects/"+t+"/filters/"+n)},this.createClashRule=function(t,n){return e.request.post(e.getApiTeamUrl()+"projects/"+t+"/clashfilters",JSON.stringify(n))},this.deleteClashRule=function(t,n){return e.request.del(e.getApiTeamUrl()+"clashfilters/"+t,null,n?{queryParams:{force:n}}:null)},this.updateClashRule=function(t,n){return e.request.put(e.getApiTeamUrl()+"clashfilters/"+t,JSON.stringify(n))},this.getAllClashRules=function(t,n){return e.request.get(e.getApiTeamUrl()+"projects/"+t+"/clashfilters",n?{queryParams:{customFilter:n}}:null)}},er=function(e){this.post=function(t){return e.request.post(e.getApiTeamUrl()+"clientlogs",JSON.stringify([{message:t}]))},this.postExtended=function(t,n,r,i){return e.request.post(e.getApiTeamUrl()+"clientlogs",JSON.stringify([{message:t,applicationclass:n,releaseversion:r,projectid:i}]))},this.postArray=function(t){return e.request.post(e.getApiTeamUrl()+"clientlogs",JSON.stringify(t))},this.get=function(){return e.request.get(e.getApiTeamUrl()+"clientlogs")}},tr=function(e){this.get=function(t){return e.request.get(e.getApiTeamUrl()+"comments/"+t)},this.delete=function(t){return e.request.del(e.getApiTeamUrl()+"comments/"+t)},this.put=function(t,n){return e.request.put(e.getApiTeamUrl()+"comments/"+t,n)}},nr=function(e){this.get=function(t,n,r){var i=e.getApiTeamUrl()+"objects/"+t+"/customtables";n&&(i+="?variantId="+n);var s={};return r&&(s.queryParams={revision:r}),e.request.get(i,r?s:void 0)},this.post=function(t,n){return e.request.post(e.getApiTeamUrl()+"objects/"+t+"/customtables",n)}},rr=function(e){this.get=function(t){return e.request.get(e.getApiTeamUrl()+"dimensionlines/"+t)},this.delete=function(t){return e.request.del(e.getApiTeamUrl()+"dimensionlines/"+t)},this.put=function(t,n){return e.request.put(e.getApiTeamUrl()+"dimensionlines/"+t,n)}},ir=function(e){this.get=function(t){return t?e.request.get(e.getApiTeamUrl()+"element-types/"+t):e.request.get(e.getApiTeamUrl()+"element-types")},this.getDisciplines=function(t){return t?e.request.get(e.getApiTeamUrl()+"element-types/disciplines/"+t):e.request.get(e.getApiTeamUrl()+"element-types/disciplines")},this.getAttributeTemplates=function(t,n){return t?e.request.get(e.getApiTeamUrl()+"element-types/"+t+"/attributetemplates",n?{queryParams:n}:void 0):e.request.get(e.getApiTeamUrl()+"element-types/attributetemplates",n?{queryParams:n}:void 0)},this.getTopology=function(){return e.request.get(e.getApiTeamUrl()+"element-types/topology")},this.getProjectTopology=function(t){return e.request.get(e.getApiTeamUrl()+"projects/"+t+"/element-types")}},sr=function(e){this.exportObjects=function(t,n){return e.request.get(e.getApiTeamUrl()+"projects/"+t+"/objects/export/excel?typeId="+n)},this.exportModel=function(t,n,r,i,s){return e.request.post("".concat(e.getApiTeamUrl(),"projects/").concat(t,"/model/").concat(n,"/exportasync").concat(r?"?revision="+r:"").concat(i?r?"&emptyPropExport=1":"?emptyPropExport=1":"").concat(s?r||i?"&propSetExport=1":"?propSetExport=1":""),null,{contentType:!1,processData:!1,dataType:null})},this.exportSelection=function(t,n,r){return e.request.post("".concat(e.getApiTeamUrl(),"selections/").concat(t,"/exportasync?emptyPropExport=").concat(n,"&propSetExport=").concat(r))},this.createExportSelection=function(t,n){return e.request.post("".concat(e.getApiTeamUrl(),"projects/").concat(t,"/exportobjects"),n)}},or=function(e){this.getAccessRights=function(t){return e.request.get(e.getApiTeamUrl()+"folders/"+t+"/rights")},this.setMemberAccessRights=function(t,n,r){return e.request.put(e.getApiTeamUrl()+"folders/"+t+"/rights?assignrecursive="+(r?"true":"false"),n)}},ur=function(e){var t=function(t){return t?e.getApiUrl()+"content/freeattributegroups/":e.getApiTeamUrl()+"freeattributegroups/"};this.post=function(n,r){return e.request.post(t(r),n)},this.get=function(n,r){return n?e.request.get(t(r)+n):e.request.get(t(r))},this.put=function(n,r,i){return e.request.put(t(i)+n,r)},this.delete=function(n,r){return e.request.del(t(r)+n)},this.getFreeAttributes=function(n,r){return e.request.get(t(r)+n+"/freeattributes")}},ar=function(e){var t=function(t){return t?e.getApiUrl()+"content/freeattributes/":e.getApiTeamUrl()+"freeattributes/"};this.post=function(n,r){return e.request.post(t(r),n)},this.get=function(n,r,i){return n?e.request.get(t(r)+n,i?{queryParams:i}:void 0):e.request.get(t(r),i?{queryParams:i}:void 0)},this.put=function(n,r,i){return e.request.put(t(i)+n,r)},this.delete=function(n,r){return e.request.del(t(r)+n)},this.getTopology=function(n){return e.request.get(t(n)+"?topology=true")},this.getFilteredAttributes=function(t,n,r){var i=e.getApiTeamUrl();return t&&(i+="projects/".concat(t,"/")),i+="attributes?",n&&(i+="layer=".concat(n,"&")),r&&(i+="type=".concat(r)),e.request.get(i)}},cr=function(e){this.calculate=function(t,n,r,i,s){return e.request.post(e.getApiTeamUrl()+"services/Hiddencalculation",JSON.stringify({hiddenCalculation:{projectId:t,calculationMode:"View",view:n,clippingPlanes:r,clipRegion:{clipFace:!1},light:{useLight:!0,elevationAngle:45,sideAngle:60,useShadows:!1},propertySettings:{faceMode:"Filling",calcLines:!0},responseSettings:{mode:"Svg",svgHeight:390,svgWidth:500,fileName:i},sectionSettings:{}},runAsync:s}))}},lr=function(e){this.get=function(t){return e.request.get(e.getApiTeamUrl()+"hyperlinks/"+t)},this.delete=function(t){return e.request.del(e.getApiTeamUrl()+"hyperlinks/"+t)},this.put=function(t,n){return e.request.put(e.getApiTeamUrl()+"hyperlinks/"+t,n)}},pr=function(e){this.postModel=function(t,n,r,i){return e.request.post(e.getApiTeamUrl()+"projects/"+t+"/model/"+n+"/importasync",r,{preparedData:r,contentType:!1,processData:!1,dataType:null,xhrUploadProgress:i})},this.postModelLandXML=function(t,n,r,i){return e.request.post(e.getApiTeamUrl()+"projects/"+t+"/model/"+n+"/landxmlasync",r,{preparedData:r,contentType:!1,processData:!1,dataType:null,xhrUploadProgress:i})}},fr=function(e){this.post=function(t,n){return e.request.post(e.getApiTeamUrl()+"projects/"+t+"/issues",n)},this.get=function(t){return e.request.get(e.getApiTeamUrl()+"issues/"+t)},this.postPin=function(t,n){return e.request.post(e.getApiTeamUrl()+"issues/"+t+"/pins",n)},this.getPins=function(t){return e.request.get(e.getApiTeamUrl()+"issues/"+t+"/pins")},this.deletePins=function(t){return e.request.del(e.getApiTeamUrl()+"issues/"+t+"/pins")},this.postComment=function(t,n){return e.request.post(e.getApiTeamUrl()+"issues/"+t+"/comments",n)},this.getComments=function(t){return e.request.get(e.getApiTeamUrl()+"issues/"+t+"/comments")},this.deleteComments=function(t){return e.request.del(e.getApiTeamUrl()+"issues/"+t+"/comments")},this.postAttachment=function(t,n){return e.request.post(e.getApiTeamUrl()+"issues/"+t+"/attachments",n)},this.getAttachments=function(t){return e.request.get(e.getApiTeamUrl()+"issues/"+t+"/attachments")},this.deleteAttachments=function(t){return e.request.del(e.getApiTeamUrl()+"issues/"+t+"/attachments")},this.put=function(t,n){return e.request.put(e.getApiTeamUrl()+"issues/"+t,n)},this.delete=function(t,n){return e.request.del(e.getApiTeamUrl()+"issues/"+t,null,n?{queryParams:{forceDelete:n}}:null)},this.getRights=function(t){return e.request.get(e.getApiTeamUrl()+"issues/"+t+"/rights")},this.getIssueTypes=function(){return e.request.get(e.getApiTeamUrl()+"lib/issuetypes")},this.getReports=function(t){return e.request.get(e.getApiTeamUrl()+"issues/"+t+"/reports")},this.importBcf=function(t,n){return e.request.put(e.getApiTeamUrl()+"projects/"+t+"/issues/bcf",n,{contentType:!1,processData:!1})},this.updateImportBcf=function(t,n){return e.request.put(e.getApiTeamUrl()+"projects/"+t+"/issues/bcf",n)},this.exportBcf=function(t,n,r){return t?e.request.post(e.getApiTeamUrl()+"projects/"+t+"/issues/export/bcf"+(r?"?version="+r:""),n):e.request.post(e.getApiTeamUrl()+"issues/export/bcf"+(r?"?version="+r:""),n)},this.exportExcel=function(t,n){return t?e.request.post(e.getApiTeamUrl()+"projects/"+t+"/issues/export/excel",n):e.request.post(e.getApiTeamUrl()+"issues/export/excel",n)}},hr=function(e){this.get=function(t){return e.request.get(e.getApiTeamUrl()+"labels/"+t)},this.delete=function(t){return e.request.del(e.getApiTeamUrl()+"labels/"+t)},this.put=function(t,n){return e.request.put(e.getApiTeamUrl()+"labels/"+t,n)}},dr=function(e){this.lockObject=function(t,n){return e.request.put(e.getApiTeamUrl()+"objects/"+t+"/locks",n,{dataType:"text"})},this.checkLocked=function(t){return e.request.get(e.getApiTeamUrl()+"objects/"+t+"/locks")},this.deleteLock=function(t,n){return!0===n?e.request.del(e.getApiTeamUrl()+"objects/"+t+"/locks?asAdmin=true"):e.request.del(e.getApiTeamUrl()+"objects/"+t+"/locks")},this.getLocksWithChildren=function(t){return e.request.get(e.getApiTeamUrl()+"objects/"+t+"/locks?withChildren=true")}},gr=function(e){this.post=function(t){return e.request.post(e.getApiTeamUrl()+"members",t)},this.get=function(){return e.request.get(e.getApiTeamUrl()+"members")},this.putUser=function(t,n,r){return e.request.put(e.getApiTeamUrl()+"members/"+n,r)},this.deleteUser=function(t,n){return e.request.del(e.getApiTeamUrl()+"members/"+n)}},mr=function(e){this.post=function(t){return e.request.post(e.getApiUrl()+"messages",t)},this.getUserMessages=function(t){return e.request.get(e.getApiUrl()+"user/"+t+"/messages")},this.getUserDashboardMessages=function(t){return e.request.get(e.getApiUrl()+"user/"+t+"/messages?topic=dashboard")},this.getSentUserMessages=function(t){return e.request.get(e.getApiUrl()+"user/"+t+"/messages/sent")},this.getSentGroupMessages=function(t){return e.request.get(e.getApiUrl()+"user/"+t+"/messages/groupsent")},this.get=function(t){return e.request.get(e.getApiUrl()+"messages/"+t)},this.getFiltered=function(t){return e.request.get(e.getApiUrl()+"messages/",{queryParams:{filter:t}})},this.deleteMessage=function(t){return e.request.del(e.getApiUrl()+"messages/"+t)},this.markAsRead=function(t){return e.request.post(e.getApiUrl()+"messages/"+t+"/markasreadbrowser",null,{dataType:null,contentType:null})},this.updateDashboardAdditionalData=function(t,n){return e.request.put(e.getApiUrl()+"messages/"+t+"/updatedashboardadditionaldata",n)},this.addDashboardMessageAttachment=function(t,n,r){return e.request.put(e.getApiUrl()+"messages/"+t+"/upload?type=dashboard",n,r)},this.getAllMessagingGroups=function(){return e.request.get(e.getApiUrl()+"systemgroups")},this.getMessagingGroupsDetails=function(t){return e.request.get(e.getApiUrl()+"systemgroups/"+t)}},yr=function(e){this.get=function(t){return t?e.request.get(e.getApiTeamUrl()+"divisions/"+t):e.request.get(e.getApiTeamUrl()+"divisions")},this.head=function(t){return e.request.head?e.request.head(e.getApiTeamUrl()+"divisions/"+t):new Promise((function(e){e(!1)}))},this.getDisciplines=function(t){return e.request.get(e.getApiTeamUrl()+"divisions/"+t+"/disciplines")},this.setDisciplineValidity=function(t,n,r){return e.request.put(e.getApiTeamUrl()+"divisions/"+t+"/disciplines/"+n,JSON.stringify({private:!r}))},this.getRevisions=function(t){return e.request.get(e.getApiTeamUrl()+"divisions/"+t+"/revisions")},this.postRevision=function(t,n){return e.request.post(e.getApiTeamUrl()+"divisions/"+t+"/revisions",n)},this.put=function(t,n){return e.request.put(e.getApiTeamUrl()+"divisions/"+t,n)},this.download=function(t){return e.request.get(e.getApiTeamUrl()+"divisions/"+t+"/download")},this.delete=function(t){return e.request.del(e.getApiTeamUrl()+"divisions/"+t)},this.move=function(t,n){return e.request.put(e.getApiTeamUrl()+"divisions/"+t+"/move",n)}},vr=["topology","structure"],br=function(e){this.get=function(t,n){var r={};return t&&(r.object_id=t),n&&(r.project_id=n),e.request.get(e.getApiTeamUrl()+"settings/filters",{queryParams:r})},this.getFilteredObjects=function(t,n,r,i){if(!r){if(i&&vr.find((function(e){return e===i}))){var s={};return s[i]=!0,e.request.get(e.getApiTeamUrl()+"projects/"+t+"/filters/"+n,{queryParams:s})}return e.request.get(e.getApiTeamUrl()+"projects/"+t+"/filters/"+n)}return e.request.get(e.getApiTeamUrl()+"projects/"+t+"/filters/"+n+"/properties",{queryParams:r})},this.getSelectionFilteredObjects=function(t,n,r,i){if(!r){if(i&&vr.find((function(e){return e===i}))){var s={};return s[i]=!0,e.request.get(e.getApiTeamUrl()+"selections/"+t+"/filters/"+n,{queryParams:s})}return e.request.get(e.getApiTeamUrl()+"selections/"+t+"/filters/"+n)}return e.request.get(e.getApiTeamUrl()+"selections/"+t+"/filters/"+n+"/properties",{queryParams:r})},this.applyFilter=function(t){return e.request.get(e.getApiTeamUrl()+"filters/"+t)},this.post=function(t,n){var r={};return n&&(r.project_id=n),e.request.post(e.getApiTeamUrl()+"settings/filter",t,{queryParams:r})},this.put=function(t){return e.request.put(e.getApiTeamUrl()+"settings/filter",t)},this.delete=function(t){return e.request.del(e.getApiTeamUrl()+"settings/filter/"+t)},this.getFilter=function(t){return e.request.get(e.getApiTeamUrl()+"settings/filters/"+t)}},Tr=function(e){this.post=function(t){return e.request.post(e.getApiTeamUrl()+"objects/",t)},this.get=function(t,n,r,i,s,o){var u={};n&&(u.queryParams={revision:n}),i&&(u.queryParams?u.queryParams.projectId=i:u.queryParams={projectId:i}),s&&(u.queryParams?u.queryParams.shortinfo=s:u.queryParams={shortinfo:s}),o&&(u.queryParams?u.queryParams.type=o:u.queryParams={type:o});var a=e.getApiTeamUrl()+"objects/"+t;return r&&(a+="/properties/",a+=r),e.request.get(a,n||i||s||o?u:void 0)},this.getInternal=function(t,n){var r={};n&&(r.queryParams={revision:n});var i=e.getApiTeamUrl()+"objects/"+t;return i+="/internal",e.request.get(i,n?r:void 0)},this.head=function(t,n){var r={};return n&&(r.queryParams={revision:n}),e.request.head?e.request.head(e.getApiTeamUrl()+"objects/"+t,n?r:void 0):e.request.get(e.getApiTeamUrl()+"objects/"+t,n?r:void 0)},this.getTopology=function(t,n,r,i,s){var o={};return(n||r||i)&&(o.queryParams={},n&&(o.queryParams.revision=n),r&&(o.queryParams.hideElements=r),i&&(o.queryParams.shortinfo=i)),s&&(o.responseBatch=s),e.request.get(e.getApiTeamUrl()+"objects/"+t+"/topology",o)},this.getGeometryThreeJS=function(t,n,r,i,s,o,u){var a,c={};return(null!==i||null!==s)&&(c.queryParams={},null!==i&&(c.queryParams.revision=i),null!==s&&(c.queryParams.levelofdetail=s)),u&&(c.responseBatch=u),a=n?e.getApiTeamUrl()+"objects/"+t+"/disciplines/"+n+"/geometries/threejs":e.getApiTeamUrl()+"objects/"+t+"/geometries/threejs",o&&(a+="/properties/",a+=o),r?e.request.getChunked(a,c):e.request.get(a,c)},this.getGeometryGLB=function(t,n,r,i,s,o,u,a,c){var l,p={};return p.dataType="binary",p.processData=!1,p.responseType="arraybuffer",p.useXMLHttpRequest=!0,(void 0!==r||void 0!==i||void 0!==s||void 0!==o||void 0!==u)&&(p.queryParams={},void 0!==r&&(p.queryParams.revision=r),void 0!==i&&(p.queryParams.levelofdetail=i),void 0!==s&&(p.queryParams.vertexNormals=s),void 0!==o&&(p.queryParams.smoothingAngle=o),void 0!==u&&(p.queryParams.topology=u)),a&&(p.responseBatch=a),l=n?e.getApiTeamUrl()+"objects/"+t+"/disciplines/"+n+"/geometries/glb":e.getApiTeamUrl()+"objects/"+t+"/geometries/glb",c?e.request.getChunked(l,p):e.request.get(l,p)},this.getGeometryTemplatesThreeJS=function(t,n,r,i,s,o){var u={};(null!==i||null!==s)&&(u.queryParams={},null!==i&&(u.queryParams.revision=i),null!==s&&(u.queryParams.levelofdetail=s)),o&&(u.responseBatch=o);var a=e.getApiTeamUrl()+"objects/"+t+"/disciplines/"+n+"/templates/threejs";return r?e.request.getChunked(a,u):e.request.get(a,u)},this.getGeometryCompressed=function(t,n){return n?e.request.get(e.getApiTeamUrl()+"objects/"+t+"/disciplines/"+n+"/geometries/meshblob"):e.request.get(e.getApiTeamUrl()+"objects/"+t+"/geometries/meshblob")},this.getProperties=function(t,n){return e.request.get(e.getApiTeamUrl()+"objects/"+t+"/geometries/threejs/properties"+n)},this.put=function(t,n,r){var i={};return r&&(i.projectid=r),e.request.put(e.getApiTeamUrl()+"objects/"+t,n,{queryParams:i})},this.postComment=function(t,n){return e.request.post(e.getApiTeamUrl()+"objects/"+t+"/comments",n)},this.getComments=function(t){return e.request.get(e.getApiTeamUrl()+"objects/"+t+"/comments")},this.deleteComments=function(t){return e.request.del(e.getApiTeamUrl()+"objects/"+t+"/comments")},this.postAttachment=function(t,n,r,i){return e.request.post(e.getApiTeamUrl()+"objects/"+t+"/attachments",n,{contentType:!1,processData:!1,dataType:null,xhrUploadProgress:r,queryParams:i?{DocumentFolderId:i}:void 0})},this.getAttachments=function(t,n){return e.request.get(e.getApiTeamUrl()+"objects/"+t+"/attachments",n?{queryParams:{revision:n}}:void 0)},this.deleteAttachments=function(t){return e.request.del(e.getApiTeamUrl()+"objects/"+t+"/attachments")},this.postAttachmentLink=function(t,n){return e.request.post(e.getApiTeamUrl()+"objects/"+t+"/attachmentlinks",n)},this.getAttachmentLinks=function(t){return e.request.get(e.getApiTeamUrl()+"objects/"+t+"/attachmentlinks")},this.deleteAttachmentLink=function(t,n){return e.request.del(e.getApiTeamUrl()+"objects/"+t+"/attachmentlinks/"+n)},this.postHyperlink=function(t,n){return e.request.post(e.getApiTeamUrl()+"objects/"+t+"/hyperlinks",n)},this.getHyperlinks=function(t){return e.request.get(e.getApiTeamUrl()+"objects/"+t+"/hyperlinks")},this.deleteHyperlinks=function(t){return e.request.del(e.getApiTeamUrl()+"objects/"+t+"/hyperlinks")},this.delete=function(t){return e.request.del(e.getApiTeamUrl()+"objects/"+t)},this.getAttributes=function(t,n,r,i){var s=n?"&documentversion="+n:"",o=i?"&revision="+i:"",u=r?"&projectid="+r:"",a=e.getApiTeamUrl()+"objects/"+t+"?freeattributes=true";return e.request.get(a+s+o+u)},this.getAttributesAsFlatStructure=function(t,n,r,i){var s=n?"&documentversion="+n:"",o=i?"&revision="+i:"",u=r?"&projectid="+r:"",a=e.getApiTeamUrl()+"objects/"+t+"?freeattributes=true&internal=true&attributedefinition=true";return e.request.get(a+s+o+u)},this.getAttributeValues=function(t,n){return e.request.get(e.getApiTeamUrl()+"objects/"+t+"/attributes/"+n+"?children=true")},this.getComplexPropertiesTopology=function(t,n){return e.request.get(e.getApiTeamUrl()+"objects/"+t+"/complexproperties"+(0<=n?"?revision="+n:""))},this.postThumbnail=function(t,n,r){return e.request.post(e.getApiTeamUrl()+"objects/"+t+"/thumbnail",n,{contentType:!1,processData:!1,dataType:null,xhrUploadProgress:r})},this.deleteThumbnail=function(t){return e.request.del(e.getApiTeamUrl()+"objects/"+t+"/thumbnail")},this.addChildObject=function(t){return e.request.post(e.getApiTeamUrl()+"objects/alter/",t)},this.getReports=function(t,n,r){return e.request.get(e.getApiTeamUrl()+"objects/"+t+"/reports?version="+n+"&action="+r)},this.exportExcelReports=function(t,n){return e.request.post(e.getApiTeamUrl()+"projects/"+t+"/reports/export/excel",n)},this.postDimensions=function(t,n){return e.request.post(e.getApiTeamUrl()+"objects/"+t+"/dimensionlines",n)},this.putDimensions=function(t,n){return e.request.put(e.getApiTeamUrl()+"objects/"+t+"/dimensionlines",n)},this.getDimensions=function(t){return e.request.get(e.getApiTeamUrl()+"objects/"+t+"/dimensionlines")},this.deleteDimensions=function(t){return e.request.del(e.getApiTeamUrl()+"objects/"+t+"/dimensionlines")},this.postLabels=function(t,n){return e.request.post(e.getApiTeamUrl()+"objects/"+t+"/labels",n)},this.putLabels=function(t,n){return e.request.put(e.getApiTeamUrl()+"objects/"+t+"/labels",n)},this.getLabels=function(t){return e.request.get(e.getApiTeamUrl()+"objects/"+t+"/labels")},this.deleteLabels=function(t){return e.request.del(e.getApiTeamUrl()+"objects/"+t+"/labels")},this.postAnnotations=function(t,n){return e.request.post(e.getApiTeamUrl()+"objects/"+t+"/annotations",n)},this.putAnnotations=function(t,n){return e.request.put(e.getApiTeamUrl()+"objects/"+t+"/annotations",n)},this.getAnnotations=function(t){return e.request.get(e.getApiTeamUrl()+"objects/"+t+"/annotations")},this.deleteAnnotations=function(t){return e.request.del(e.getApiTeamUrl()+"objects/"+t+"/annotations")}},Ar=function(e){this.get=function(t){return e.request.get(e.getApiTeamUrl()+"pins/"+t)},this.delete=function(t){return e.request.del(e.getApiTeamUrl()+"pins/"+t)},this.put=function(t,n){return e.request.put(e.getApiTeamUrl()+"pins/"+t,n)}},qr=function(e){this.get=function(){return e.request.get(e.getApiUrl()+"project-actions-rights/")}},wr=function(e){var t="projectattributetemplates";this.post=function(n){return e.request.post(e.getApiTeamUrl()+t,n)},this.get=function(n,r){var i=r?{queryParams:{default:r}}:null;return n?e.request.get(e.getApiTeamUrl()+t+"/"+n):e.request.get(e.getApiTeamUrl()+t,i)},this.put=function(n,r){return e.request.put(e.getApiTeamUrl()+t+"/"+n,r)},this.delete=function(n){return e.request.del(e.getApiTeamUrl()+t+"/"+n)},this.copyFrom=function(n,r){return e.request.put(e.getApiTeamUrl()+t+"/"+r+"/copyfrom",JSON.stringify({id:n}))},this.setDefault=function(n){return e.request.put(e.getApiTeamUrl()+t+"/"+n+"/default")}},_r=function(e){this.post=function(t){return e.request.post(e.getApiTeamUrl()+"projects",t)},this.createFromExisting=function(t){return e.request.post(e.getApiTeamUrl()+"projects/copyfrom",t)},this.put=function(t,n){return e.request.put(e.getApiTeamUrl()+"projects/"+t,n)},this.get=function(t,n,r,i){var s={queryParams:{}};return n&&(s.queryParams.disciplines=!1),i&&(s.queryParams.recycleBin=!0),t?e.request.get(e.getApiTeamUrl()+"projects/"+t,s):r?e.request.get(e.getApiUrl()+r+"/projects",s):e.getTeamSlug()?e.request.get(e.getApiTeamUrl()+"projects",s):e.request.get(e.getApiUrl()+"/projects",s)},this.delete=function(t){return e.request.del(e.getApiTeamUrl()+"projects/"+t)},this.moveToRecycleBin=function(t){return e.request.del(e.getApiTeamUrl()+"projects/"+t+"?moveToRecycleBin=true")},this.restoreFromRecycleBin=function(t){return e.request.put(e.getApiTeamUrl()+"objects/"+t+"/restore",JSON.stringify({}),{dataType:"text"})},this.deleteFromRecycleBin=function(t){return e.request.del(e.getApiTeamUrl()+"projects/"+t+"?fromRecycleBin=true")},this.deleteServerCache=function(t){return e.request.del(e.getApiTeamUrl()+"projects/"+t+"/deletecache")},this.clearServerDecimation=function(t,n,r){return n||(n="00000000-0000-0000-0000-000000000000"),0<=r&&""!==r||(r="100"),e.request.del(e.getApiTeamUrl()+"temporary/projects/"+t+"/disciplines/"+n+"/levelofdetails/"+r)},this.getModels=function(t){return e.request.get(e.getApiTeamUrl()+"projects/"+t+"/divisions")},this.postModel=function(t,n){return e.request.post(e.getApiTeamUrl()+"projects/"+t+"/divisions",n)},this.getMembers=function(t){return e.request.get(e.getApiTeamUrl()+"projects/"+t+"/members")},this.postMember=function(t,n){return e.request.post(e.getApiTeamUrl()+"projects/"+t+"/members",n)},this.putMember=function(t,n){return e.request.put(e.getApiTeamUrl()+"projects/"+t+"/members",n)},this.deleteMember=function(t,n){return e.request.del(e.getApiTeamUrl()+"projects/"+t+"/members",n)},this.getPins=function(t){return e.request.get(e.getApiTeamUrl()+"projects/"+t+"/pins")},this.putProject=function(t,n){return e.request.put(e.getApiTeamUrl()+"projects/"+t,n)},this.postAttachment=function(t,n){return e.request.post(e.getApiTeamUrl()+"projects/"+t+"/attachments",n)},this.getAttachments=function(t,n,r){var i=r;return i||(i={}),n&&(i.revision=n),e.request.get(e.getApiTeamUrl()+"projects/"+t+"/attachments",n||r?{queryParams:i}:void 0)},this.deleteAttachments=function(t){return e.request.del(e.getApiTeamUrl()+"projects/"+t+"/attachments")},this.getTopology=function(t){return e.request.get(e.getApiTeamUrl()+"projects/"+t+"/topology")},this.getSpots=function(t){return e.request.get(e.getApiTeamUrl()+"projects/"+t+"/pins")},this.postThumbnail=function(t,n,r){return e.request.post(e.getApiTeamUrl()+"projects/"+t+"/thumbnail",n,{contentType:!1,processData:!1,dataType:null,xhrUploadProgress:r})},this.getThumbnail=function(t){return e.request.get(e.getApiTeamUrl()+"thumbnail/"+t)},this.deleteThumbnail=function(t){return e.request.del(e.getApiTeamUrl()+"projects/"+t+"/thumbnail")},this.getComments=function(t){return e.request.get(e.getApiTeamUrl()+"projects/"+t+"/comments")},this.getHyperlinks=function(t){return e.request.get(e.getApiTeamUrl()+"projects/"+t+"/hyperlinks")},this.getIssues=function(t,n){return e.request.get(e.getApiTeamUrl()+"projects/"+t+"/issues"+(n?"?scene=false":""))},this.getIssuesShortInfo=function(t){var n=function(){var e=ct((new Date).toString().split("GMT"),2),t=e[0],n=e[1];if(!t||!n)return"";var r=new Date(t+"UTC").toISOString().split(".")[0],i=(n=n.split(" ")[0]).slice(0,3)+":"+n.slice(3);return r&&i?r+i:""}();return e.request.get(e.getApiTeamUrl()+"projects/"+t+"/issues?shortinfo=true"+(n?"&currenttime="+n:""))},this.postSlideshow=function(t,n){return e.request.post(e.getApiTeamUrl()+"projects/"+t+"/slideshows",n)},this.getSlideshows=function(t){return e.request.get(e.getApiTeamUrl()+"projects/"+t+"/slideshows")},this.deleteSlideshows=function(t){return e.request.del(e.getApiTeamUrl()+"projects/"+t+"/slideshows")},this.exportSlideshowToPDF=function(t,n){return e.request.post(e.getApiTeamUrl()+"projects/"+t+"/slideshow/export/pdf",JSON.stringify({slideShowId:n}))},this.getProjectInfo=function(t){return e.request.get(e.getApiTeamUrl()+"projects/"+t)}},Ur=function(e){this.postRevision=function(t,n){return e.request.post(e.getApiTeamUrl()+"divisions/"+t+"/revisions",n)},this.getRevisionList=function(t){return e.request.get(e.getApiTeamUrl()+"divisions/"+t+"/revisions")},this.getRevisionInfo=function(t){return e.request.get(e.getApiTeamUrl()+"revisions/"+t)},this.postRevisionInfo=function(t,n){return e.request.post(e.getApiTeamUrl()+"revisions/"+t,n)},this.putRevisionInfo=function(t,n){return e.request.put(e.getApiTeamUrl()+"revisions/"+t,n)},this.getRevisionsComparisonResult=function(t,n,r,i){return e.request.get(e.getApiTeamUrl()+"divisions/"+t+"/revisionscomparison/"+n+"/"+r,i)},this.compareRevisions=function(t,n,r,i){return e.request.post(e.getApiTeamUrl()+"divisions/"+t+"/revisionscomparison/"+n+"/"+r,null,i)},this.excelExportRevisionsComparisonResult=function(t,n,r,i){return e.request.post(e.getApiTeamUrl()+"divisions/"+t+"/revisionscomparison/"+n+"/"+r+"/export/excel",i)}},jr=function(e){this.getRoles=function(t){return t?e.request.get(e.getApiTeamUrl()+"projects/"+t+"/members"):e.request.get(e.getApiTeamUrl()+"roles")},this.postUserRole=function(t,n){return e.request.post(e.getApiTeamUrl()+"projects/"+t+"/members",n)},this.putUserRole=function(t,n){return e.request.put(e.getApiTeamUrl()+"projects/"+t+"/members",n)},this.deleteUser=function(t){return e.request.del(e.getApiTeamUrl()+"projects/"+t+"/members")}},kr=function(e){this.get=function(t,n){if(t||n){var r={queryParams:{}};return void 0!==t&&(r.queryParams.rights=t),void 0!==n&&(r.queryParams.customrole=n),e.request.get(e.getApiTeamUrl()+"roles/",r)}return e.request.get(e.getApiTeamUrl()+"roles/")},this.getAllRights=function(t){if(t){var n={queryParams:{globalfreeattributes:t.globalfreeattributes,global:t.global,project:t.project,document:t.document,layer:t.layer}};return e.request.get(e.getApiTeamUrl()+"rights",n)}return e.request.get(e.getApiTeamUrl()+"rights")},this.post=function(t){return e.request.post(e.getApiTeamUrl()+"roles/",t)},this.getRoleDetails=function(t){return e.request.get(e.getApiTeamUrl()+"roles/"+t)},this.updateRole=function(t,n){return e.request.put(e.getApiTeamUrl()+"roles/"+t,n)},this.deleteRole=function(t){return e.request.del(e.getApiTeamUrl()+"roles/"+t)}},Pr=function(e){this.calculateCutSection=function(t){var n=!!(1<arguments.length&&void 0!==arguments[1])&&arguments[1],r=t.projectId,i=t.cuttingPlanes,s=t.modelLayer,o=t.topologyNodes,u=t.hiddenObjects,a=t.settings,c={cuttingCalculation:{projectId:r,cuttingPlanes:i,selection:{modelLayer:s,topologyNodes:o,hiddenObjects:u},settings:a},runAsync:n};return c.cuttingCalculation.settings&&c.cuttingCalculation.settings.responseGeometry&&"glb"===c.cuttingCalculation.settings.responseGeometry?e.request.post(e.getApiTeamUrl()+"services/CuttingCalculation",JSON.stringify(c),{useXMLHttpRequest:!0,dataType:"binary",processData:!1,responseType:"arraybuffer"}):e.request.post(e.getApiTeamUrl()+"services/CuttingCalculation",JSON.stringify(c))}},Sr=function(e){this.post=function(t){return e.request.post(e.getApiTeamUrl()+"share",t)}},xr=function(e){this.get=function(t){return e.request.get(e.getApiTeamUrl()+"slides/"+t)},this.put=function(t,n){return e.request.put(e.getApiTeamUrl()+"slides/"+t,n)},this.delete=function(t){return e.request.del(e.getApiTeamUrl()+"slides/"+t)},this.postThumbnail=function(t,n){return e.request.post(e.getApiTeamUrl()+"slides/"+t+"/thumbnail",n)}},Er=function(e){this.get=function(t){return e.request.get(e.getApiTeamUrl()+"slideshows/"+t)},this.put=function(t,n){return e.request.put(e.getApiTeamUrl()+"slideshows/"+t,n)},this.delete=function(t){return e.request.del(e.getApiTeamUrl()+"slideshows/"+t)},this.postSlide=function(t,n){return e.request.post(e.getApiTeamUrl()+"slideshows/"+t+"/slides",n)},this.getSlides=function(t){return e.request.get(e.getApiTeamUrl()+"slideshows/"+t+"/slides")},this.postThumbnail=function(t,n){return e.request.post(e.getApiTeamUrl()+"slideshows/"+t+"/thumbnail",n)},this.getThumbnail=function(t){return e.request.get(e.getApiTeamUrl()+"thumbnail/"+t)}},Dr=function(e){this.postStructure=function(t,n){return e.request.post(e.getApiTeamUrl()+"projects/"+t+"/structures",n)},this.postStructureTopology=function(t,n){return e.request.post(e.getApiTeamUrl()+"structures/"+t+"/topology",n)},this.postSubNode=function(t,n){return e.request.post(e.getApiTeamUrl()+"structures/"+t,n)},this.postAssignedObject=function(t,n,r,i){return e.request.post(e.getApiTeamUrl()+"structures/"+t+"/assign/"+n+"?varianttype="+r,i)},this.attributeAssign=function(t,n,r,i){var s={attributeId:r};return i&&(s.variantType=i),e.request.put(e.getApiTeamUrl()+"projects/"+t+"/structures/"+n+"/attributeassign",JSON.stringify(s))},this.deleteAssignedObject=function(t,n,r,i){var s=[i?"removeAllNodes=true":"",r?"varianttype=true":""].filter((function(e){return e})).join("&");return e.request.del(e.getApiTeamUrl()+"structures/"+t+"/delete/"+n+"?"+s)},this.getStructure=function(t,n,r){return n?e.request.get(e.getApiTeamUrl()+"structures/"+n):e.request.get(e.getApiTeamUrl()+"projects/"+t+"/structures"+(r?"?type="+r:""))},this.getTopology=function(t,n,r){return void 0===r||""===r?e.request.get(e.getApiTeamUrl()+"structures/"+t+"/topology?varianttype="+n):!0===r?e.request.get(e.getApiTeamUrl()+"structures/"+t+"/topology?varianttype="+n+"&attributes=true"):void 0},this.getTopologyStructure=function(t){return e.request.get(e.getApiTeamUrl()+"projects/"+t+"/topologystructure")},this.resetTopologyStructure=function(t){return e.request.put(e.getApiTeamUrl()+"projects/"+t+"/topologystructure/reset")},this.copyStructure=function(t,n,r){return e.request.post(e.getApiTeamUrl()+"structures/"+t+"/copy?elementRelation="+r+"&attributes=true",n)},this.putStructure=function(t,n,r){var i=r?"?applyToChild=true":"";return e.request.put(e.getApiTeamUrl()+"structures/"+t+i,n)},this.reorderStructure=function(t,n){return e.request.put(e.getApiTeamUrl()+"structures/"+t+"/reorder?varianttype="+n)},this.deleteStructure=function(t){return e.request.del(e.getApiTeamUrl()+"structures/"+t)},this.removeAllAssignedObjects=function(t){return e.request.del(e.getApiTeamUrl()+"structures/"+t+"/delete")},this.deleteAllProjectStructures=function(t){return e.request.del(e.getApiTeamUrl()+"projects/"+t+"/structures")},this.postVariantType=function(t,n){return e.request.post(e.getApiTeamUrl()+"projects/"+t+"/variants",n)},this.getVariantType=function(t,n){return n?e.request.get(e.getApiTeamUrl()+"projects/"+t+"/variants/"+n):e.request.get(e.getApiTeamUrl()+"projects/"+t+"/variants")},this.deleteVariantType=function(t,n){return e.request.del(e.getApiTeamUrl()+"projects/"+t+"/variants/"+n)},this.copyElementsToVariant=function(t,n,r){return e.request.put(e.getApiTeamUrl()+"projects/"+t+"/variants/"+n+"/copyfrom",r)}},Or=function(e){this.get=function(){return e.request.get(e.getApiUrl()+"team-actions-rights/")}},Cr=function(e){this.get=function(t){return t?e.request.get(e.getApiUrl()+"teams/"+t):e.request.get(e.getApiUrl()+"teams")},this.postTeam=function(t){return e.request.post(e.getApiUrl()+"teams",t)},this.putTeam=function(t){return e.request.put(e.getApiUrl()+"team",t)},this.deleteTeam=function(t){return e.request.del(e.getApiUrl()+"teams/"+t)},this.getAccountSettings=function(t){return e.request.get(e.getApiUrl()+"administration/teams/"+t+"/accountsettings")},this.getRestrictions=function(t){return e.request.get(e.getApiUrl()+"teams/"+t+"/restrictions")},this.deleteServerCache=function(){return e.request.del(e.getApiTeamUrl()+"deleteCache")}},Rr=function(e){this.get=function(t){return e.request.get(e.getApiUrl()+"terms/download",{queryParams:{language:t},dataType:"html"})}},Ir=function(e){this.get=function(t){return e.request.get(e.getApiUrl()+"dataprotectiondeclarations/download",{queryParams:{language:t},dataType:"html"})}},Br=function(e){this.get=function(t){return e.request.get(e.getApiUrl()+"imprints/download",{queryParams:{language:t},dataType:"html"})}},Kr=function(e){this.post=function(t){return e.request.post(e.getApiUrl()+"content/units/",t)},this.get=function(t){return t?e.request.get(e.getApiUrl()+"content/units/"+t):e.request.get(e.getApiUrl()+"content/units/")},this.put=function(t,n){return e.request.put(e.getApiUrl()+"content/units/"+t,n)},this.delete=function(t){return e.request.del(e.getApiUrl()+"content/units/"+t)}},Mr=function(e){this.get=function(t){return t?e.request.get(e.getApiUrl()+"user",{token:t}):e.request.get(e.getApiUrl()+"user")},this.put=function(t,n,r){var i=e.getApiUrl()+"user/";return t&&(i+=t),r?e.request.put(i,n,{token:r}):e.request.put(i,n)},this.post=function(t){return e.request.post(e.getApiUrl()+"user",t)},this.postPhoto=function(t){return e.request.post(e.getApiUrl()+"user/photo",t,{contentType:!1,processData:!1})},this.deletePhoto=function(){return e.request.del(e.getApiUrl()+"user/photo")},this.getPhoto=function(){return e.request.get(e.getApiUrl()+"user/photo")},this.putPassword=function(t){return e.request.put(e.getApiUrl()+"user/change_password",t)},this.getSubscriptions=function(t){return t?e.request.get(e.getApiUrl()+"user/accountsettings/"+t):e.request.get(e.getApiUrl()+"user/accountsettings")}},Nr=function(e){this.post=function(t){return e.request.post(e.getApiUrl()+"users",t)},this.exist=function(t){return e.request.get(e.getApiUrl()+"users/exist",{queryParams:{email:t}})},this.put=function(t,n){return e.request.put(e.getApiUrl()+"users/"+t,n)},this.delete=function(t){return e.request.del(e.getApiUrl()+"users/"+t)},this.setSubscriptions=function(t,n){return e.request.post(e.getApiUrl()+"administration/users/"+t+"/accountsettings",n)}},Fr=function(e){this.postSettings=function(t,n){return e.request.post(e.getApiTeamUrl()+"userSettings/"+t,n)},this.getSettings=function(t){return e.request.get(e.getApiTeamUrl()+"userSettings/"+t)}},Lr=function(e){this.get=function(t){return e.request.get(e.getApiTeamUrl()+"invitations/"+(t||""))},this.getProjectInvitations=function(t){return e.request.get("".concat(e.getApiTeamUrl(),"invitations?projectId=").concat(t))},this.post=function(t){return e.request.post(e.getApiTeamUrl()+"invitations/",t)},this.delete=function(t){return e.request.del(e.getApiTeamUrl()+"invitations/"+t)},this.put=function(t,n){return e.request.put(e.getApiTeamUrl()+"invitations/"+t,n)},this.accept=function(t,n){return e.request.put(e.getApiUrl()+"invitations/"+t+"/accept",n)},this.getInvitation=function(t,n){return e.request.get(e.getApiUrl()+"invitations/"+t,n)}},Gr=function(e){this.post=function(t,n){return e.request.post(e.getApiTeamUrl()+"projects/"+t+"/selections",n)},this.get=function(t){return e.request.get(e.getApiTeamUrl()+"selections/"+t)},this.getAllSelections=function(t){return e.request.get(e.getApiTeamUrl()+"projects/"+t+"/selections")},this.delete=function(t){return e.request.del(e.getApiTeamUrl()+"selections/"+t)}},Hr=function(e){this.postGroup=function(t,n){return e.request.post(e.getApiTeamUrl()+"projects/"+t+"/usergroups",n)},this.getGroups=function(t){return e.request.get(e.getApiTeamUrl()+"projects/"+t+"/usergroups")},this.getUsers=function(t){return e.request.get(e.getApiTeamUrl()+"usergroups/"+t)},this.deleteGroup=function(t){return e.request.del(e.getApiTeamUrl()+"usergroups/"+t)},this.putGroup=function(t,n){return e.request.put(e.getApiTeamUrl()+"usergroups/"+t,n)},this.assignUser=function(t,n){return e.request.put(e.getApiTeamUrl()+"usergroups/"+t+"/assign",n)},this.removeUser=function(t,n){return e.request.put(e.getApiTeamUrl()+"usergroups/"+t+"/remove",n)}},Vr=function(e){this.get=function(t){return e.request.get(e.getApiTeamUrl()+"scenes/"+t)},this.getObjectScenes=function(t){return e.request.get(e.getApiTeamUrl()+"objects/"+t+"/scenes")},this.post=function(t,n){return e.request.post(e.getApiTeamUrl()+"objects/"+t+"/scenes",n)},this.delete=function(t){return e.request.del(e.getApiTeamUrl()+"scenes/"+t)},this.put=function(t,n){return e.request.put(e.getApiTeamUrl()+"scenes/"+t,n)},this.postThumbnailAttachment=function(t,n,r,i){return e.request.post(e.getApiTeamUrl()+"objects/"+t+"/attachments",n,{contentType:!1,processData:!1,dataType:null,xhrUploadProgress:r,queryParams:i?{attachmenttype:"thumbnailhighresolution"}:void 0})},this.postThumbnail=function(t,n,r){return e.request.post(e.getApiTeamUrl()+"objects/"+t+"/attachments",n,{queryParams:r?{attachmenttype:"thumbnailhighresolution"}:void 0})},this.getThumbnail=function(t){return e.request.get(e.getApiTeamUrl()+"objects/"+t+"/attachments")}},Jr=function(e){this._config=null,e?(!e.version&&(e.version="v2"),this._config=e):this._config=Xr(),this._token=null,this._tokenType=null,this._teamSlug=null,this._cache=null,window.BIMPLUS_SDK_ENABLE_DEBUG_LOGS,this._config.cache?(this.request=new $n,this._cache=this.request.getCache(),!1===this._cache.isSupported()&&(this.request=new ht,this._cache=null)):this.request=new ht,this.setAccessToken=function(e){this._token=e,this.request.setAccessToken(e),window.BIMPLUS_SDK_ENABLE_DEBUG_LOGS},this.getAccessToken=function(){return this._token},this.setTokenType=function(e){this._tokenType=e,this.request.setTokenType(e),window.BIMPLUS_SDK_ENABLE_DEBUG_LOGS},this.getTokenType=function(){return this._tokenType},this.setAccessTokenAndType=function(e,t){this.setAccessToken(e),this.setTokenType(t)},this.getAccessTokenAndType=function(){return{token:this._token,tokenType:this._tokenType}},this.setTeamSlug=function(e){this._teamSlug=e,window.BIMPLUS_SDK_ENABLE_DEBUG_LOGS},this.getTeamSlug=function(){return this._teamSlug},this.getApiUrl=function(){return this._config.protocol+this._config.host+"/"+this._config.version+"/"},this.getApiTeamUrl=function(){return this._teamSlug,this.getApiUrl()+this._teamSlug+"/"},this.getCache=function(){return this._cache},this.authorize=new vt(this),this.user=new Mr(this),this.users=new Nr(this),this.teams=new Cr(this),this.members=new gr(this),this.projects=new _r(this),this.structures=new Dr(this),this.models=new yr(this),this.objects=new Tr(this),this.revisions=new Ur(this),this.elementTypes=new ir(this),this.annotations=new gt(this),this.attachments=new mt(this),this.issues=new fr(this),this.labels=new hr(this),this.pins=new Ar(this),this.comments=new tr(this),this.hyperlinks=new lr(this),this.importService=new pr(this),this.slideshows=new Er(this),this.slides=new xr(this),this.clashDetection=new Zn(this),this.clientLogs=new er(this),this.rightsService=new jr(this),this.applicationSettings=new dt(this),this.exportService=new sr(this),this.folders=new or(this),this.locks=new dr(this),this.share=new Sr(this),this.messages=new mr(this),this.objectFilters=new br(this),this.terms=new Rr(this),this.dataProtection=new Ir(this),this.dimensions=new rr(this),this.imprints=new Br(this),this.projectActionsRights=new qr(this),this.roles=new kr(this),this.attributeTemplates=new yt(this),this.units=new Kr(this),this.freeAttributes=new ar(this),this.freeAttributeGroups=new ur(this),this.hiddenCalculation=new cr(this),this.sectionCut=new Pr(this),this.projectAttributeTemplates=new wr(this),this.teamActionsRights=new Or(this),this.customTables=new nr(this),this.userSettings=new Fr(this),this.invitations=new Lr(this),this.selections=new Gr(this),this.userGroups=new Hr(this),this.scenes=new Vr(this)},Xr=function(e){var t="api.bimplus.net";return e&&(t="prod"===e?"api.bimplus.net":"dev"===e?"api-dev.bimplus.net":"stage"===e?"api-stage.bimplus.net":"api.bimplus.net"),{protocol:"https://",host:t,cache:!1,version:"v2"}}}])}));
1
+ !function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.add=t():e.add=t()}(window,(function(){return function(e){function t(r){if(n[r])return n[r].exports;var i=n[r]={i:r,l:!1,exports:{}};return e[r].call(i.exports,i,i.exports,t),i.l=!0,i.exports}var n={};return t.m=e,t.c=n,t.d=function(e,n,r){t.o(e,n)||Object.defineProperty(e,n,{enumerable:!0,get:r})},t.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},t.t=function(e,n){if(1&n&&(e=t(e)),8&n)return e;if(4&n&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(t.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&n&&"string"!=typeof e)for(var i in e)t.d(r,i,function(t){return e[t]}.bind(null,i));return r},t.n=function(e){var n=e&&e.__esModule?function(){return e.default}:function(){return e};return t.d(n,"a",n),n},t.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},t.p="",t(t.s=0)}([function(e,t,n){"use strict";function r(e,t,n,r){return $.ajax({url:e,type:t,data:n,contentType:r&&void 0!==r.contentType?r.contentType:"application/json; charset=utf-8",dataType:r&&void 0!==r.dataType?r.dataType:"json",processData:!(!r||void 0===r.processData)&&r.processData,cache:!(!window||!window.BIMPLUS_SDK_ENABLE_CACHE),async:!0,xhr:function(){var e=$.ajaxSettings.xhr();return r&&void 0!==r.xhrUploadProgress&&e.upload.addEventListener("progress",r.xhrUploadProgress,!1),e},beforeSend:function(e){if(window&&void 0!==window.BIMPLUS_SDK_PENDING_REQUESTS&&window.BIMPLUS_SDK_PENDING_REQUESTS++,r&&r.token){var t=r.tokenType?r.tokenType:"BimPlus";e.setRequestHeader("Authorization",t+" "+r.token)}r&&r.eTag&&(e.setRequestHeader("Cache-Control","no-cache"),window&&!window.BIMPLUS_SDK_DISABLE_ETAG&&e.setRequestHeader("If-None-Match",r.eTag))},complete:function(e){window&&void 0!==window.BIMPLUS_SDK_PENDING_REQUESTS&&window.BIMPLUS_SDK_PENDING_REQUESTS--,window&&window.BIMPLUS_SDK_LOG_API_CALLS&&e&&e.responseText&&0<e.responseText.length&&JSON.parse(e.responseText)}})}function i(e,t,n,r){var i=$.Deferred(),s=new XMLHttpRequest;return s.open(t,e,!0),s.setRequestHeader("Authorization","BimPlus "+r.token),window&&void 0!==window.BIMPLUS_SDK_PENDING_REQUESTS&&window.BIMPLUS_SDK_PENDING_REQUESTS++,r&&r.responseType&&(s.responseType=r.responseType),r&&r.eTag&&(s.setRequestHeader("Cache-Control","no-cache"),window&&!window.BIMPLUS_SDK_DISABLE_ETAG&&s.setRequestHeader("If-None-Match",r.eTag)),s.onload=function(){window&&void 0!==window.BIMPLUS_SDK_PENDING_REQUESTS&&window.BIMPLUS_SDK_PENDING_REQUESTS--,i.resolve(s.response,s.status,s)},s.onerror=function(){window&&void 0!==window.BIMPLUS_SDK_PENDING_REQUESTS&&window.BIMPLUS_SDK_PENDING_REQUESTS--,i.reject()},n&&s.setRequestHeader("Content-Type","application/json;charset=UTF-8"),s.send(n),i.promise()}function s(e){var t="?";for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t+=n+"="+e[n]+"&");return t=t.slice(0,-1)}function o(e,t,n,r,i){i||(i={}),i.token||(i.token=t),i.queryParams||(i.queryParams={}),i.queryParams.chunkSize=n,i.queryParams.chunk=1;var s=$.Deferred(),o=[];return e.get(r,i).done((function(t,n,u){o.push(t);var a=0;if(200===u.status){var c=u.getResponseHeader("X-Total-Count");c&&(a=parseInt(c,10))}else 304===u.status&&u["Cached-X-Total-Count"]&&(a=u["Cached-X-Total-Count"]);for(var l=[],p=2;p<=a;p++){i.queryParams.chunk=p;var f=e.get(r,i).done((function(e){o.push(e)})).fail((function(e,t){s.reject(e,t)}));l.push(f)}Promise.all(l).then((function(){s.resolve(o)}))})).fail((function(e,t){s.reject(e,t)})),s.promise()}function u(){for(var e=0,t=0,n=arguments.length;t<n;t++)e+=arguments[t].length;var r=Array(e),i=0;for(t=0;t<n;t++)for(var s=arguments[t],o=0,u=s.length;o<u;o++,i++)r[i]=s[o];return r}function a(e,t){return"object"==typeof t?(Tt(t).forEach((function(n){e[n]=t[n]})),e):e}function c(e,t){return _t.call(e,t)}function l(e,t){"function"==typeof t&&(t=t(wt(e))),Tt(t).forEach((function(n){p(e,n,t[n])}))}function p(e,t,n,r){Ut(e,t,a(n&&c(n,"get")&&"function"==typeof n.get?{get:n.get,set:n.set,configurable:!0}:{value:n,configurable:!0,writable:!0},r))}function f(e){return{from:function(t){return e.prototype=Object.create(t.prototype),p(e.prototype,"constructor",e),{extend:l.bind(null,e.prototype)}}}}function h(e,t,n){return kt.call(e,t,n)}function d(e,t){return t(e)}function g(e){if(!e)throw new Error("Assertion Failed")}function m(e){qt.setImmediate?setImmediate(e):setTimeout(e,0)}function y(e,t){return e.reduce((function(e,n,r){var i=t(n,r);return i&&(e[i[0]]=i[1]),e}),{})}function v(e,t){if(c(e,t))return e[t];if(!t)return e;if("string"!=typeof t){for(var n,r=[],i=0,s=t.length;i<s;++i)n=v(e,t[i]),r.push(n);return r}var o=t.indexOf(".");if(-1!==o){var u=e[t.substr(0,o)];return void 0===u?void 0:v(u,t.substr(o+1))}}function b(e,t,n){if(e&&void 0!==t&&(!("isFrozen"in Object)||!Object.isFrozen(e)))if("string"!=typeof t&&"length"in t){g("string"!=typeof n&&"length"in n);for(var r=0,i=t.length;r<i;++r)b(e,t[r],n[r])}else{var s=t.indexOf(".");if(-1!==s){var o=t.substr(0,s),u=t.substr(s+1);if(""===u)void 0===n?At(e)&&!isNaN(parseInt(o))?e.splice(o,1):delete e[o]:e[o]=n;else{var a=e[o];a||(a=e[o]={}),b(a,u,n)}}else void 0===n?At(e)&&!isNaN(parseInt(t))?e.splice(t,1):delete e[t]:e[t]=n}}function T(e){var t={};for(var n in e)c(e,n)&&(t[n]=e[n]);return t}function A(e){return Pt.apply([],e)}function q(e){if(!e||"object"!=typeof e)return e;var t;if(At(e)){t=[];for(var n=0,r=e.length;n<r;++n)t.push(q(e[n]))}else if(0<=xt.indexOf(e.constructor))t=e;else for(var i in t=e.constructor?Object.create(e.constructor.prototype):{},e)c(e,i)&&(t[i]=q(e[i]));return t}function w(e){return Dt.call(e).slice(8,-1)}function _(e,t,n,r){return n=n||{},r=r||"",Tt(e).forEach((function(i){if(c(t,i)){var s=e[i],o=t[i];if("object"==typeof s&&"object"==typeof o&&s&&o){var u=w(s),a=w(o);u===a?Et[u]?Ot(s,u)!==Ot(o,a)&&(n[r+i]=t[i]):_(s,o,n,r+i+"."):n[r+i]=t[i]}else s!==o&&(n[r+i]=t[i])}else n[r+i]=void 0})),Tt(t).forEach((function(i){c(e,i)||(n[r+i]=t[i])})),n}function U(e){var t,n,r,i;if(1===arguments.length){if(At(e))return e.slice();if(this===It&&"string"==typeof e)return[e];if(i=Rt(e)){for(n=[];!(r=i.next()).done;)n.push(r.value);return n}if(null==e)return[e];if("number"==typeof(t=e.length)){for(n=Array(t);t--;)n[t]=e[t];return n}return[e]}for(t=arguments.length,n=Array(t);t--;)n[t]=arguments[t];return n}function j(e,t){Kt=e,Mt=t}function k(){if(Nt)try{throw new Error}catch(e){return e}return new Error}function P(e,t){var n=e.stack;return n?(t=t||0,0===n.indexOf(e.name)&&(t+=(e.name+e.message).split("\n").length),n.split("\n").slice(t).filter(Mt).map((function(e){return"\n"+e})).join("")):""}function S(e,t){this._e=k(),this.name=e,this.message=t}function x(e,t){return e+". Errors: "+Object.keys(t).map((function(e){return t[e].toString()})).filter((function(e,t,n){return n.indexOf(e)===t})).join("\n")}function E(e,t,n,r){this._e=k(),this.failures=t,this.failedKeys=r,this.successCount=n,this.message=x(e,t)}function D(e,t){this._e=k(),this.name="BulkError",this.failures=t,this.message=x(e,t)}function O(){}function C(e){return e}function R(e,t){return null==e||e===C?t:function(n){return t(e(n))}}function I(e,t){return function(){e.apply(this,arguments),t.apply(this,arguments)}}function B(e,t){return e===O?t:function(){var n=e.apply(this,arguments);void 0!==n&&(arguments[0]=n);var r=this.onsuccess,i=this.onerror;this.onsuccess=null,this.onerror=null;var s=t.apply(this,arguments);return r&&(this.onsuccess=this.onsuccess?I(r,this.onsuccess):r),i&&(this.onerror=this.onerror?I(i,this.onerror):i),void 0===s?n:s}}function K(e,t){return e===O?t:function(){e.apply(this,arguments);var n=this.onsuccess,r=this.onerror;this.onsuccess=this.onerror=null,t.apply(this,arguments),n&&(this.onsuccess=this.onsuccess?I(n,this.onsuccess):n),r&&(this.onerror=this.onerror?I(r,this.onerror):r)}}function M(e,t){return e===O?t:function(n){var r=e.apply(this,arguments);a(n,r);var i=this.onsuccess,s=this.onerror;this.onsuccess=null,this.onerror=null;var o=t.apply(this,arguments);return i&&(this.onsuccess=this.onsuccess?I(i,this.onsuccess):i),s&&(this.onerror=this.onerror?I(s,this.onerror):s),void 0===r?void 0===o?void 0:o:a(r,o)}}function N(e,t){return e===O?t:function(){return!1!==t.apply(this,arguments)&&e.apply(this,arguments)}}function F(e,t){return e===O?t:function(){var n=e.apply(this,arguments);if(n&&"function"==typeof n.then){for(var r=this,i=arguments.length,s=Array(i);i--;)s[i]=arguments[i];return n.then((function(){return t.apply(r,s)}))}return t.apply(this,arguments)}}function L(e){if("object"!=typeof this)throw new TypeError("Promises must be constructed via new");this._listeners=[],this.onuncatched=O,this._lib=!1;var t=this._PSD=mn;if(Kt&&(this._stackHolder=k(),this._prev=null,this._numPrev=0),"function"!=typeof e){if(e!==zt)throw new TypeError("Not a function");return this._state=arguments[1],this._value=arguments[2],void(!1===this._state&&V(this,this._value))}this._state=null,this._value=null,++t.ref,H(this,e)}function G(e,t,n,r,i){this.onFulfilled="function"==typeof e?e:null,this.onRejected="function"==typeof t?t:null,this.resolve=n,this.reject=r,this.psd=i}function H(e,t){try{t((function(t){if(null===e._state){if(t===e)throw new TypeError("A promise cannot be resolved with itself.");var n=e._lib&&Y();t&&"function"==typeof t.then?H(e,(function(e,n){t instanceof L?t._then(e,n):t.then(e,n)})):(e._state=!0,e._value=t,J(e)),n&&Z()}}),V.bind(null,e))}catch(t){V(e,t)}}function V(e,t){if(fn.push(t),null===e._state){var n=e._lib&&Y();t=dn(t),e._state=!1,e._value=t,Kt&&null!==t&&"object"==typeof t&&!t._promise&&function(e,t,n){try{e.apply(null,n)}catch(e){t&&t(e)}}((function(){var n=function e(t,n){var r;return jt(t,n)||(r=wt(t))&&e(r,n)}(t,"stack");t._promise=e,p(t,"stack",{get:function(){return on?n&&(n.get?n.get.apply(t):n.value):e.stack}})})),function(e){pn.some((function(t){return t._value===e._value}))||pn.push(e)}(e),J(e),n&&Z()}}function J(e){var t=e._listeners;e._listeners=[];for(var n=0,r=t.length;n<r;++n)X(e,t[n]);var i=e._PSD;--i.ref||i.finalize(),0===vn&&(++vn,an((function(){0==--vn&&ee()}),[]))}function X(e,t){if(null!==e._state){var n=e._state?t.onFulfilled:t.onRejected;return null===n?(e._state?t.resolve:t.reject)(e._value):(++t.psd.ref,++vn,void an(W,[n,e,t]))}e._listeners.push(t)}function W(e,t,n){try{hn=t;var r,i=t._value;t._state?r=e(i):(fn.length&&(fn=[]),r=e(i),-1===fn.indexOf(i)&&function(e){for(var t=pn.length;t;)if(pn[--t]._value===e._value)return void pn.splice(t,1)}(t)),n.resolve(r)}catch(t){n.reject(t)}finally{hn=null,0==--vn&&ee(),--n.psd.ref||n.psd.finalize()}}function z(e,t){var n=t?t._numPrev+1:0;n<Qt&&(e._prev=t,e._numPrev=n)}function Q(){Y()&&Z()}function Y(){var e=cn;return cn=!1,ln=!1,e}function Z(){var e,t,n;do{for(;0<yn.length;)for(e=yn,yn=[],n=e.length,t=0;t<n;++t){var r=e[t];r[0].apply(null,r[1])}}while(0<yn.length);cn=!0,ln=!0}function ee(){var e=pn;pn=[],e.forEach((function(e){e._PSD.onunhandled.call(null,e._value,e)}));for(var t=bn.slice(0),n=t.length;n;)t[--n]()}function te(e){return new L(zt,!1,e)}function ne(e,t){var n=mn;return function(){var r=Y(),i=mn;try{return ce(n,!0),e.apply(this,arguments)}catch(e){t&&t(e)}finally{ce(i,!1),r&&Z()}}}function re(e,t,n,r){var i=mn,s=Object.create(i);s.parent=i,s.ref=0,s.global=!1,s.id=++jn;var o=gn.env;s.env=sn?{Promise:L,PromiseProp:{value:L,configurable:!0,writable:!0},all:L.all,race:L.race,allSettled:L.allSettled,any:L.any,resolve:L.resolve,reject:L.reject,nthen:he(o.nthen,s),gthen:he(o.gthen,s)}:{},t&&a(s,t),++i.ref,s.finalize=function(){--this.parent.ref||this.parent.finalize()};var u=pe(s,e,n,r);return 0===s.ref&&s.finalize(),u}function ie(){return An.id||(An.id=++qn),++An.awaits,An.echoes+=Yt,An.id}function se(e){!An.awaits||e&&e!==An.id||(0==--An.awaits&&(An.id=0),An.echoes=An.awaits*Yt)}function oe(e){return An.echoes&&e&&e.constructor===rn?(ie(),e.then((function(e){return se(),e}),(function(e){return se(),Sn(e)}))):e}function ue(e){++Un,An.echoes&&0!=--An.echoes||(An.echoes=An.id=0),wn.push(mn),ce(e,!0)}function ae(){var e=wn[wn.length-1];wn.pop(),ce(e,!1)}function ce(e,t){var n=mn;if((t?An.echoes&&(!_n++||e!==mn):_n&&(!--_n||e!==mn))&&function(e){nn.call(Zt,e)}(t?ue.bind(null,e):ae),e!==mn&&(mn=e,n===gn&&(gn.env=le()),sn)){var r=gn.env.Promise,i=e.env;en.then=i.nthen,r.prototype.then=i.gthen,(n.global||e.global)&&(Object.defineProperty(qt,"Promise",i.PromiseProp),r.all=i.all,r.race=i.race,r.resolve=i.resolve,r.reject=i.reject,i.allSettled&&(r.allSettled=i.allSettled),i.any&&(r.any=i.any))}}function le(){var e=qt.Promise;return sn?{Promise:e,PromiseProp:Object.getOwnPropertyDescriptor(qt,"Promise"),all:e.all,race:e.race,allSettled:e.allSettled,any:e.any,resolve:e.resolve,reject:e.reject,nthen:en.then,gthen:e.prototype.then}:{}}function pe(e,t,n,r,i){var s=mn;try{return ce(e,!0),t(n,r,i)}finally{ce(s,!1)}}function fe(e,t,n){return"function"==typeof e?function(){var r=mn;n&&ie(),ce(t,!0);try{return e.apply(this,arguments)}finally{ce(r,!1)}}:e}function he(e,t){return function(n,r){return e.call(this,fe(n,t,!1),fe(r,t,!1))}}function de(e,t){var n;try{n=t.onuncatched(e)}catch(t){}if(!1!==n)try{var r,i={promise:t,reason:e};if(qt.document&&document.createEvent?((r=document.createEvent("Event")).initEvent(Pn,!0,!0),a(r,i)):qt.CustomEvent&&a(r=new CustomEvent(Pn,{detail:i}),i),r&&qt.dispatchEvent&&(dispatchEvent(r),!qt.PromiseRejectionEvent&&qt.onunhandledrejection))try{qt.onunhandledrejection(r)}catch(e){}Kt&&r&&r.defaultPrevented}catch(t){}}function ge(e,t){return e?t?function(){return e.apply(this,arguments)&&t.apply(this,arguments)}:e:t}function me(e){function t(e,t,s){if("object"==typeof e)return n(e);t||(t=N),s||(s=O);var o={subscribers:[],fire:s,subscribe:function(e){-1===o.subscribers.indexOf(e)&&(o.subscribers.push(e),o.fire=t(o.fire,e))},unsubscribe:function(e){o.subscribers=o.subscribers.filter((function(t){return t!==e})),o.fire=o.subscribers.reduce(t,s)}};return r[e]=i[e]=o,o}function n(e){Tt(e).forEach((function(n){var r=e[n];if(At(r))t(n,e[n][0],e[n][1]);else{if("asap"!==r)throw new Jt.InvalidArgument("Invalid event config");var i=t(n,C,(function(){for(var e=arguments.length,t=Array(e);e--;)t[e]=arguments[e];i.subscribers.forEach((function(e){m((function(){e.apply(null,t)}))}))}))}}))}var r={},i=function(t,n){if(n){for(var i=arguments.length,s=Array(i-1);--i;)s[i-1]=arguments[i];return r[t].subscribe.apply(null,s),e}return"string"==typeof t?r[t]:void 0};i.addEventType=t;for(var s=1,o=arguments.length;s<o;++s)t(arguments[s]);return i}function ye(e,t){return f(t).from({prototype:e}),t}function ve(e,t){return!(e.filter||e.algorithm||e.or)&&(t?e.justLimit:!e.replayFilter)}function be(e,t){e.filter=ge(e.filter,t)}function Te(e,t,n){var r=e.replayFilter;e.replayFilter=r?function(){return ge(r(),t())}:t,e.justLimit=n&&!r}function Ae(e,t){if(e.isPrimKey)return t.primaryKey;var n=t.getIndexByKeyPath(e.index);if(!n)throw new Jt.Schema("KeyPath "+e.index+" on object store "+t.name+" is not indexed");return n}function qe(e,t,n){var r=Ae(e,t.schema);return t.openCursor({trans:n,values:!e.keysOnly,reverse:"prev"===e.dir,unique:!!e.unique,query:{index:r,range:e.range}})}function we(e,t,n,r){var i=e.replayFilter?ge(e.filter,e.replayFilter()):e.filter;if(!e.or)return _e(qe(e,r,n),ge(e.algorithm,i),t,!e.keysOnly&&e.valueMapper);var s={},o=function(e,n,r){if(!i||i(n,r,(function(e){return n.stop(e)}),(function(e){return n.fail(e)}))){var o=n.primaryKey,u=""+o;"[object ArrayBuffer]"==u&&(u=""+new Uint8Array(o)),c(s,u)||(s[u]=!0,t(e,n,r))}};return Promise.all([e.or._iterate(o,n),_e(qe(e,r,n),e.algorithm,o,!e.keysOnly&&e.valueMapper)])}function _e(e,t,n,r){var i=ne(r?function(e,t,i){return n(r(e),t,i)}:n);return e.then((function(e){if(e)return e.start((function(){var n=function(){return e.continue()};(!t||t(e,(function(e){return n=e}),(function(t){e.stop(t),n=O}),(function(t){e.fail(t),n=O})))&&i(e.value,e,(function(e){return n=e})),n()}))}))}function Ue(e,t){return e<t?-1:e===t?0:1}function je(e,t){return e>t?-1:e===t?0:1}function ke(e,t,n){var r=e instanceof Gn?new e.Collection(e):e;return r._ctx.error=n?new n(t):new TypeError(t),r}function Pe(e){return new e.Collection(e,(function(){return De("")})).limit(0)}function Se(e,t,n,r,i,s){for(var o,u=ft(e.length,r.length),a=-1,c=0;c<u;++c){if((o=t[c])!==r[c])return 0>i(e[c],n[c])?e.substr(0,c)+n[c]+n.substr(c+1):0>i(e[c],r[c])?e.substr(0,c)+r[c]+n.substr(c+1):0<=a?e.substr(0,a)+t[a]+n.substr(a+1):null;0>i(e[c],o)&&(a=c)}return u<r.length&&"next"===s?e+n.substr(e.length):u<e.length&&"prev"===s?e.substr(0,n.length):0>a?null:e.substr(0,a)+r[a]+n.substr(a+1)}function xe(e,t,n,r){function i(e){s=function(e){return"next"===e?function(e){return e.toUpperCase()}:function(e){return e.toLowerCase()}}(e),o=function(e){return"next"===e?function(e){return e.toLowerCase()}:function(e){return e.toUpperCase()}}(e),u="next"===e?Ue:je;var t=n.map((function(e){return{lower:o(e),upper:s(e)}})).sort((function(e,t){return u(e.lower,t.lower)}));a=t.map((function(e){return e.upper})),c=t.map((function(e){return e.lower})),l=e,p="next"===e?"":r}var s,o,u,a,c,l,p,f=n.length;if(!n.every((function(e){return"string"==typeof e})))return ke(e,Dn);i("next");var h=new e.Collection(e,(function(){return Ee(a[0],c[f-1]+r)}));h._ondirectionchange=function(e){i(e)};var d=0;return h._addAlgorithm((function(e,n,r){var i=e.key;if("string"!=typeof i)return!1;var s=o(i);if(t(s,c,d))return!0;for(var h,g=null,m=d;m<f;++m)null===(h=Se(i,s,a[m],c[m],u,l))&&null===g?d=m+1:(null===g||0<u(g,h))&&(g=h);return n(null===g?r:function(){e.continue(g+p)}),!1})),h}function Ee(e,t,n,r){return{type:2,lower:e,upper:t,lowerOpen:n,upperOpen:r}}function De(e){return{type:1,lower:e,upper:e}}function Oe(e){return 1===e.length?e[0]:e}function Ce(e){try{return e.only([[]]),[[]]}catch(e){return xn}}function Re(e){return ne((function(t){return Ie(t),e(t.target.error),!1}))}function Ie(e){e.stopPropagation&&e.stopPropagation(),e.preventDefault&&e.preventDefault()}function Be(e,t,n,r,i,s,o){return{name:e,keyPath:t,unique:n,multi:r,auto:i,compound:s,src:(n&&!o?"&":"")+(r?"*":"")+(i?"++":"")+Ke(t)}}function Ke(e){return"string"==typeof e?e:e?"["+[].join.call(e,"+")+"]":""}function Me(e,t,n){return{name:e,primKey:t,indexes:n,mappedClass:null,idxByName:y(n,(function(e){return[e.name,e]}))}}function Ne(e){return null==e?function(){}:"string"==typeof e?function(e){return 1===e.split(".").length?function(t){return t[e]}:function(t){return v(t,e)}}(e):function(t){return v(t,e)}}function Fe(e,t){return"delete"===t.type?t.keys:t.keys||t.values.map(e.extractKey)}function Le(e){return[].slice.call(e)}function Ge(e){return null==e?":id":"string"==typeof e?e:"["+e.join("+")+"]"}function He(e,t,n,r){function i(e){if(3===e.type)return null;if(4===e.type)throw new Error("Cannot convert never type to IDBKeyRange");var t=e.lower,r=e.upper,i=e.lowerOpen,s=e.upperOpen;return void 0===t?void 0===r?null:n.upperBound(r,!!s):void 0===r?n.lowerBound(t,!!i):n.bound(t,r,!!i,!!s)}var s=t.cmp.bind(t),o=function(e,t){var n=Le(e.objectStoreNames);return{schema:{name:e.name,tables:n.map((function(e){return t.objectStore(e)})).map((function(e){var t=e.keyPath,n=e.autoIncrement,r=At(t),i={},s={name:e.name,primaryKey:{name:null,isPrimaryKey:!0,outbound:null==t,compound:r,keyPath:t,autoIncrement:n,unique:!0,extractKey:Ne(t)},indexes:Le(e.indexNames).map((function(t){return e.index(t)})).map((function(e){var t=e.name,n=e.unique,r=e.multiEntry,s=e.keyPath,o={name:t,compound:At(s),keyPath:s,unique:n,multiEntry:r,extractKey:Ne(s)};return i[Ge(s)]=o,o})),getIndexByKeyPath:function(e){return i[Ge(e)]}};return i[":id"]=s.primaryKey,null!=t&&(i[Ge(t)]=s.primaryKey),s}))},hasGetAll:0<n.length&&"getAll"in t.objectStore(n[0])&&!("undefined"!=typeof navigator&&/Safari/.test(navigator.userAgent)&&!/(Chrome\/|Edge\/)/.test(navigator.userAgent)&&604>[].concat(navigator.userAgent.match(/Safari\/(\d*)/))[1])}}(e,r),a=o.schema,c=o.hasGetAll,l=a.tables.map((function(e){return function(e){var t=e.name;return{name:t,schema:e,mutate:function(n){var r=n.trans,s=n.type,o=n.keys,a=n.values,c=n.range,l=n.wantResults;return new Promise((function(n){n=ne(n);var p=r.objectStore(t),f=null==p.keyPath,h="put"===s||"add"===s;if(!h&&"delete"!==s&&"deleteRange"!==s)throw new Error("Invalid operation type: "+s);var d=(o||a||{length:1}).length;if(o&&a&&o.length!==a.length)throw new Error("Given keys array must have same length as given values array.");if(0===d)return n({numFailures:0,failures:{},results:[],lastResult:void 0});var g,m=l&&u(o||Fe(e.primaryKey,{type:s,keys:o,values:a})),y=[],v=0,b=function(e){++v,Ie(e),m&&(m[e.target._reqno]=void 0),y[e.target._reqno]=e.target.error},T=function(e){var t=e.target;m[t._reqno]=t.result};if("deleteRange"===s){if(4===c.type)return n({numFailures:v,failures:y,results:m,lastResult:void 0});g=3===c.type?p.clear():p.delete(i(c))}else{var A=h?f?[a,o]:[a,null]:[o,null],q=A[0],w=A[1];if(h)for(var _=0;_<d;++_)(g=w&&void 0!==w[_]?p[s](q[_],w[_]):p[s](q[_]))._reqno=_,m&&void 0===m[_]&&(g.onsuccess=T),g.onerror=b;else for(_=0;_<d;++_)(g=p[s](q[_]))._reqno=_,g.onerror=b}var U=function(e){var t=e.target.result;m&&(m[d-1]=t),n({numFailures:v,failures:y,results:m,lastResult:t})};g.onerror=function(e){b(e),U(e)},g.onsuccess=U}))},getMany:function(e){var n=e.trans,r=e.keys;return new Promise((function(e,i){e=ne(e);for(var s,o=n.objectStore(t),u=r.length,a=Array(u),c=0,l=0,p=function(t){var n=t.target;null!=(a[n._pos]=n.result)&&0,++l==c&&e(a)},f=Re(i),h=0;h<u;++h)null!=r[h]&&((s=o.get(r[h]))._pos=h,s.onsuccess=p,s.onerror=f,++c);0==c&&e(a)}))},get:function(e){var n=e.trans,r=e.key;return new Promise((function(e,i){e=ne(e);var s=n.objectStore(t).get(r);s.onsuccess=function(t){return e(t.target.result)},s.onerror=Re(i)}))},query:function(e){return function(n){return new Promise((function(r,s){r=ne(r);var o=n.trans,u=n.values,a=n.limit,c=n.query,l=a===1/0?void 0:a,p=c.index,f=c.range,h=o.objectStore(t),d=p.isPrimaryKey?h:h.index(p.name),g=i(f);if(0===a)return r({result:[]});if(e){var m=u?d.getAll(g,l):d.getAllKeys(g,l);m.onsuccess=function(e){return r({result:e.target.result})},m.onerror=Re(s)}else{var y=0,v=u||!("openKeyCursor"in d)?d.openCursor(g):d.openKeyCursor(g),b=[];v.onsuccess=function(){var e=v.result;return e?(b.push(u?e.value:e.primaryKey),++y===a?r({result:b}):void e.continue()):r({result:b})},v.onerror=Re(s)}}))}}(c),openCursor:function(e){var n=e.trans,r=e.values,s=e.query,o=e.reverse,u=e.unique;return new Promise((function(e,a){e=ne(e);var c=s.index,l=s.range,p=n.objectStore(t),f=c.isPrimaryKey?p:p.index(c.name),h=o?u?"prevunique":"prev":u?"nextunique":"next",d=r||!("openKeyCursor"in f)?f.openCursor(i(l),h):f.openKeyCursor(i(l),h);d.onerror=Re(a),d.onsuccess=ne((function(){var t=d.result;if(t){t.___id=++Vn,t.done=!1;var r=t.continue.bind(t),i=t.continuePrimaryKey;i&&(i=i.bind(t));var s=t.advance.bind(t),o=function(){throw new Error("Cursor not stopped")};t.trans=n,t.stop=t.continue=t.continuePrimaryKey=t.advance=function(){throw new Error("Cursor not started")},t.fail=ne(a),t.next=function(){var e=this,t=1;return this.start((function(){return t--?e.continue():e.stop()})).then((function(){return e}))},t.start=function(e){var n=new Promise((function(e,n){e=ne(e),d.onerror=Re(n),t.fail=n,t.stop=function(n){t.stop=t.continue=t.continuePrimaryKey=t.advance=o,e(n)}})),u=function(){if(d.result)try{e()}catch(e){t.fail(e)}else t.done=!0,t.start=function(){throw new Error("Cursor behind last entry")},t.stop()};return d.onsuccess=ne((function(){d.onsuccess=u,u()})),t.continue=r,t.continuePrimaryKey=i,t.advance=s,u(),n},e(t)}else e(null)}),a)}))},count:function(e){var n=e.query,r=e.trans,s=n.index,o=n.range;return new Promise((function(e,n){var u=r.objectStore(t),a=s.isPrimaryKey?u:u.index(s.name),c=i(o),l=c?a.count(c):a.count();l.onsuccess=ne((function(t){return e(t.target.result)})),l.onerror=Re(n)}))}}}(e)})),p={};return l.forEach((function(e){return p[e.name]=e})),{stack:"dbcore",transaction:e.transaction.bind(e),table:function(e){if(!p[e])throw new Error("Table '"+e+"' not found");return p[e]},cmp:s,MIN_KEY:-1/0,MAX_KEY:Ce(n),schema:a}}function Ve(e,t,n,r){var i=n.IDBKeyRange;return{dbcore:function(e,t){return t.reduce((function(e,t){var n=t.create;return bt(bt({},e),n(e))}),e)}(He(t,n.indexedDB,i,r),e.dbcore)}}function Je(e,t){var n=t.db,r=Ve(e._middlewares,n,e._deps,t);e.core=r.dbcore,e.tables.forEach((function(t){var n=t.name;e.core.schema.tables.some((function(e){return e.name===n}))&&(t.core=e.core.table(n),e[n]instanceof e.Table&&(e[n].core=t.core))}))}function Xe(e,t,n,r){n.forEach((function(n){var i=r[n];t.forEach((function(t){n in t||(t===e.Transaction.prototype||t instanceof e.Transaction?p(t,n,{get:function(){return this.table(n)},set:function(e){Ut(this,n,{value:e,writable:!0,configurable:!0,enumerable:!0})}}):t[n]=new e.Table(n,i))}))}))}function We(e,t){t.forEach((function(t){for(var n in t)t[n]instanceof e.Table&&delete t[n]}))}function ze(e,t){return e._cfg.version-t._cfg.version}function Qe(e,t,n,r){var i=e._dbSchema,s=e._createTransaction("readwrite",e._storeNames,i);s.create(n),s._completion.catch(r);var o=s._reject.bind(s),u=mn.transless||mn;re((function(){mn.trans=s,mn.transless=u,0===t?(Tt(i).forEach((function(e){Ye(n,e,i[e].primKey,i[e].indexes)})),Je(e,n),L.follow((function(){return e.on.populate.fire(s)})).catch(o)):function(e,t,n,r){var i=[],s=e._versions,o=e._dbSchema=Ze(e,e.idbdb,r),u=!1;return s.filter((function(e){return e._cfg.version>=t})).forEach((function(s){i.push((function(){var i=o,a=s._cfg.dbschema;et(e,i,r),et(e,a,r),o=e._dbSchema=a;var c=function(e,t){var n,r={del:[],add:[],change:[]};for(n in e)t[n]||r.del.push(n);for(n in t){var i=e[n],s=t[n];if(i){var o={name:n,def:s,recreate:!1,del:[],add:[],change:[]};if(i.primKey.src===s.primKey.src||Cn){var u=i.idxByName,a=s.idxByName,c=void 0;for(c in u)a[c]||o.del.push(c);for(c in a){var l=u[c],p=a[c];l?l.src!==p.src&&o.change.push(p):o.add.push(p)}(0<o.del.length||0<o.add.length||0<o.change.length)&&r.change.push(o)}else o.recreate=!0,r.change.push(o)}else r.add.push([n,s])}return r}(i,a);c.add.forEach((function(e){Ye(r,e[0],e[1].primKey,e[1].indexes)})),c.change.forEach((function(e){if(e.recreate)throw new Jt.Upgrade("Not yet support for changing primary key");var t=r.objectStore(e.name);e.add.forEach((function(e){return $e(t,e)})),e.change.forEach((function(e){t.deleteIndex(e.name),$e(t,e)})),e.del.forEach((function(e){return t.deleteIndex(e)}))}));var l=s._cfg.contentUpgrade;if(l&&s._cfg.version>t){Je(e,r),u=!0;var p=T(a);c.del.forEach((function(e){p[e]=i[e]})),We(e,[e.Transaction.prototype]),Xe(e,[e.Transaction.prototype],Tt(p),p),n.schema=p;var f=Bt(l);f&&ie();var h,d=L.follow((function(){if((h=l(n))&&f){var e=se.bind(null,null);h.then(e,e)}}));return h&&"function"==typeof h.then?L.resolve(h):d.then((function(){return h}))}})),i.push((function(t){u&&Rn||function(e,t){for(var n,r=0;r<t.db.objectStoreNames.length;++r)n=t.db.objectStoreNames[r],null==e[n]&&t.db.deleteObjectStore(n)}(s._cfg.dbschema,t);We(e,[e.Transaction.prototype]),Xe(e,[e.Transaction.prototype],e._storeNames,e._dbSchema),n.schema=e._dbSchema}))})),function e(){return i.length?L.resolve(i.shift()(n.idbtrans)).then(e):L.resolve()}().then((function(){!function(e,t){Tt(e).forEach((function(n){t.db.objectStoreNames.contains(n)||Ye(t,n,e[n].primKey,e[n].indexes)}))}(o,r)}))}(e,t,s,n).catch(o)}))}function Ye(e,t,n,r){var i=e.db.createObjectStore(t,n.keyPath?{keyPath:n.keyPath,autoIncrement:n.auto}:{autoIncrement:n.auto});return r.forEach((function(e){return $e(i,e)})),i}function $e(e,t){e.createIndex(t.name,t.keyPath,{unique:t.unique,multiEntry:t.multi})}function Ze(e,t,n){var r={};return h(t.objectStoreNames,0).forEach((function(e){for(var t,i=n.objectStore(e),s=i.keyPath,o=Be(Ke(s),s||"",!1,!1,!!i.autoIncrement,s&&"string"!=typeof s,!0),u=[],a=0;a<i.indexNames.length;++a){s=(t=i.index(i.indexNames[a])).keyPath;var c=Be(t.name,s,!!t.unique,!!t.multiEntry,!1,s&&"string"!=typeof s,!1);u.push(c)}r[e]=Me(e,o,u)})),r}function et(e,t,n){for(var r=n.db.objectStoreNames,i=0;i<r.length;++i){var s=r[i],o=n.objectStore(s);e._hasGetAll="getAll"in o;for(var u=0;u<o.indexNames.length;++u){var a=o.indexNames[u],c=o.index(a).keyPath,l="string"==typeof c?c:"["+h(c).join("+")+"]";if(t[s]){var p=t[s].idxByName[l];p&&(p.name=a,delete t[s].idxByName[l],t[s].idxByName[a]=p)}}}"undefined"!=typeof navigator&&/Safari/.test(navigator.userAgent)&&!/(Chrome\/|Edge\/)/.test(navigator.userAgent)&&qt.WorkerGlobalScope&&qt instanceof qt.WorkerGlobalScope&&604>[].concat(navigator.userAgent.match(/Safari\/(\d*)/))[1]&&(e._hasGetAll=!1)}function tt(e){return re((function(){return mn.letThrough=!0,e()}))}function nt(e){var t=e._state,n=e._deps.indexedDB;if(t.isBeingOpened||e.idbdb)return t.dbReadyPromise.then((function(){return t.dbOpenError?Sn(t.dbOpenError):e}));Kt&&(t.openCanceller._stackHolder=k()),t.isBeingOpened=!0,t.dbOpenError=null,t.openComplete=!1;var r=t.dbReadyResolve,i=null;return L.race([t.openCanceller,new L((function(r,s){if(!n)throw new Jt.MissingAPI("indexedDB API not found. If using IE10+, make sure to run your code on a server URL (not locally). If using old Safari versions, make sure to include indexedDB polyfill.");var o=e.name,u=t.autoSchema?n.open(o):n.open(o,pt(10*e.verno));if(!u)throw new Jt.MissingAPI("IndexedDB API not available");u.onerror=Re(s),u.onblocked=ne(e._fireOnBlocked),u.onupgradeneeded=ne((function(r){if(i=u.transaction,t.autoSchema&&!e._options.allowEmptyDB){u.onerror=Ie,i.abort(),u.result.close();var a=n.deleteDatabase(o);a.onsuccess=a.onerror=ne((function(){s(new Jt.NoSuchDatabase("Database "+o+" doesnt exist"))}))}else{i.onerror=Re(s);var c=0x4000000000000000<r.oldVersion?0:r.oldVersion;e.idbdb=u.result,Qe(e,c/10,i,s)}}),s),u.onsuccess=ne((function(){i=null;var n=e.idbdb=u.result,s=h(n.objectStoreNames);if(0<s.length)try{var a=n.transaction(Oe(s),"readonly");t.autoSchema?function(e,t,n){e.verno=t.version/10;var r=e._dbSchema=Ze(0,t,n);e._storeNames=h(t.objectStoreNames,0),Xe(e,[e._allTables],Tt(r),r)}(e,n,a):et(e,e._dbSchema,a),Je(e,a)}catch(e){}On.push(e),n.onversionchange=ne((function(n){t.vcFired=!0,e.on("versionchange").fire(n)})),kn.add(o),r()}),s)}))]).then((function(){return t.onReadyBeingFired=[],L.resolve(tt(e.on.ready.fire)).then((function e(){if(0<t.onReadyBeingFired.length){var n=t.onReadyBeingFired.reduce(F,O);return t.onReadyBeingFired=[],L.resolve(tt(n)).then(e)}}))})).finally((function(){t.onReadyBeingFired=null})).then((function(){return t.isBeingOpened=!1,e})).catch((function(n){try{i&&i.abort()}catch(e){}return t.isBeingOpened=!1,e.close(),t.dbOpenError=n,Sn(t.dbOpenError)})).finally((function(){t.openComplete=!0,r()}))}function rt(e){function t(e){return function(t){var n=e(t),s=n.value;return n.done?s:s&&"function"==typeof s.then?s.then(r,i):At(s)?Promise.all(s).then(r,i):r(s)}}var n=function(t){return e.next(t)},r=t(n),i=t((function(t){return e.throw(t)}));return t(n)()}function it(e,t,n){var r=arguments.length;if(2>r)throw new Jt.InvalidArgument("Too few arguments");for(var i=Array(r-1);--r;)i[r-1]=arguments[r];n=i.pop();var s=A(i);return[e,s,n]}function st(e,t,n,r,i){return L.resolve().then((function(){var s=mn.transless||mn,o=e._createTransaction(t,n,e._dbSchema,r);r?o.idbtrans=r.idbtrans:o.create();var u=Bt(i);u&&ie();var a,c=L.follow((function(){if(a=i.call(o,o))if(u){var e=se.bind(null,null);a.then(e,e)}else"function"==typeof a.next&&"function"==typeof a.throw&&(a=rt(a))}),{trans:o,transless:s});return(a&&"function"==typeof a.then?L.resolve(a).then((function(e){return o.active?e:Sn(new Jt.PrematureCommit("Transaction committed too early. See http://bit.ly/2kdckMn"))})):c.then((function(){return a}))).then((function(e){return r&&o._resolve(),o._completion.then((function(){return e}))})).catch((function(e){return o._reject(e),Sn(e)}))}))}function ot(e,t,n){for(var r=At(e)?e.slice():[e],i=0;i<n;++i)r.push(t);return r}function ut(e,t,n,r,i,s,o){try{var u=e[s](o),a=u.value}catch(e){return void n(e)}u.done?t(a):Promise.resolve(a).then(r,i)}function at(e){return function(){var t=this,n=arguments;return new Promise((function(r,i){function s(e){ut(u,r,i,s,o,"next",e)}function o(e){ut(u,r,i,s,o,"throw",e)}var u=e.apply(t,n);s(void 0)}))}}function ct(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(e)){var n=[],r=!0,i=!1,s=void 0;try{for(var o,u=e[Symbol.iterator]();!(r=(o=u.next()).done)&&(n.push(o.value),!t||n.length!==t);r=!0);}catch(e){i=!0,s=e}finally{try{r||null==u.return||u.return()}finally{if(i)throw s}}return n}}(e,t)||function(e,t){if(e){if("string"==typeof e)return lt(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?lt(e,t):void 0}}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function lt(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}var pt=Math.round,ft=Math.min;n.r(t),n.d(t,"Api",(function(){return Jr})),n.d(t,"createDefaultConfig",(function(){return Xr})),n.d(t,"IDBCache",(function(){return Yn}));var ht=function(){var e=null,t=null;this.setAccessToken=function(t){e=t},this.setTokenType=function(e){t=e},this.get=function(n,o){return o||(o={}),o.token||(o.token=e),o.tokenType&&o.tokenType===t||(o.tokenType=t),o.queryParams&&(n+=s(o.queryParams)),o&&o.useXMLHttpRequest?i(n,"GET",null,o):r(n,"GET",null,o)},this.getChunked=function(t,n){return o(this,e,"medium",t,n)},this.put=function(n,i,o){return o||(o={}),o.token||(o.token=e),o.tokenType&&o.tokenType===t||(o.tokenType=t),o.queryParams&&(n+=s(o.queryParams)),r(n,"PUT",i,o)},this.post=function(n,o,u){return u||(u={}),u.token||(u.token=e),u.tokenType&&u.tokenType===t||(u.tokenType=t),u.queryParams&&(n+=s(u.queryParams)),u&&u.useXMLHttpRequest?i(n,"POST",o,u):r(n,"POST",o,u)},this.del=function(n,i,o){return o||(o={}),i||(o.contentType=null),o.dataType=null,o.token||(o.token=e),o.tokenType&&o.tokenType===t||(o.tokenType=t),o.queryParams&&(n+=s(o.queryParams)),r(n,"DELETE",i||null,o)}},dt=function(e){this.postSettings=function(t){return e.request.post(e.getApiUrl()+"application/settings",t)},this.getSettings=function(t){return t?e.request.get(e.getApiUrl()+"application/settings/"+t):e.request.get(e.getApiUrl()+"application/settings")},this.putSettings=function(t,n){return e.request.put(e.getApiUrl()+"application/settings/"+t,n)},this.deleteSettings=function(t){return e.request.del(e.getApiUrl()+"application/settings/"+t)}},gt=function(e){this.get=function(t){return e.request.get(e.getApiTeamUrl()+"annotations/"+t)},this.delete=function(t){return e.request.del(e.getApiTeamUrl()+"annotations/"+t)},this.put=function(t,n){return e.request.put(e.getApiTeamUrl()+"annotations/"+t,n)}},mt=function(e){this.get=function(t){return e.request.get(e.getApiTeamUrl()+"attachments/"+t)},this.download=function(t,n){return n?e.request.get(e.getApiTeamUrl()+"attachments/"+t+"/versions/"+n+"/download"):e.request.get(e.getApiTeamUrl()+"attachments/"+t+"/download")},this.put=function(t,n){return e.request.put(e.getApiTeamUrl()+"attachments/"+t,n)},this.post=function(t,n,r){return e.request.put(e.getApiTeamUrl()+"attachments/"+t,n,{contentType:!1,processData:!1,dataType:null,xhrUploadProgress:r})},this.delete=function(t,n){return n?e.request.del(e.getApiTeamUrl()+"attachments/"+t+"/versions/"+n):e.request.del(e.getApiTeamUrl()+"attachments/"+t)},this.postVersion=function(t,n,r){return e.request.post(e.getApiTeamUrl()+"attachments/"+t+"/versions",n,{contentType:!1,processData:!1,dataType:null,xhrUploadProgress:r})},this.getAllVersions=function(t){return e.request.get(e.getApiTeamUrl()+"attachments/"+t+"/versions")},this.releaseVersion=function(t){return e.request.put(e.getApiTeamUrl()+"attachments/"+t+"/release")}},yt=function(e){this.post=function(t){return e.request.post(e.getApiTeamUrl()+"attributetemplates",t)},this.get=function(t){return t?e.request.get(e.getApiTeamUrl()+"attributetemplates/"+t):e.request.get(e.getApiTeamUrl()+"attributetemplates")},this.put=function(t,n){return e.request.put(e.getApiTeamUrl()+"attributetemplates/"+t,n)},this.delete=function(t){return e.request.del(e.getApiTeamUrl()+"attributetemplates/"+t)}},vt=function(e){this.post=function(t,n,r){return e.request.post(e.getApiUrl()+"authorize",JSON.stringify({user_id:t,password:n,application_id:r}))},this.forgotPassword=function(t){return e.request.post(e.getApiUrl()+"auth-forgot",t,{dataType:null})},this.checkAccessToken=function(){return e.request.get(e.getApiUrl()+"authorize")},this.requestCrossToken=function(){return e.request.post(e.getApiUrl()+"cross-token")}},bt=function(){return(bt=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e}).apply(this,arguments)},Tt=Object.keys,At=Array.isArray,qt="undefined"==typeof self?"undefined"==typeof window?global:window:self;"undefined"==typeof Promise||qt.Promise||(qt.Promise=Promise);var wt=Object.getPrototypeOf,_t={}.hasOwnProperty,Ut=Object.defineProperty,jt=Object.getOwnPropertyDescriptor,kt=[].slice,Pt=[].concat,St=["Boolean","String","Date","RegExp","Blob","File","FileList","ArrayBuffer","DataView","Uint8ClampedArray","ImageData","Map","Set"].concat(A([8,16,32,64].map((function(e){return["Int","Uint","Float"].map((function(t){return t+e+"Array"}))})))).filter((function(e){return qt[e]})),xt=St.map((function(e){return qt[e]})),Et=y(St,(function(e){return[e,!0]})),Dt={}.toString,Ot=function(e,t){return"Array"===t?""+e.map((function(e){return Ot(e,w(e))})):"ArrayBuffer"===t?""+new Uint8Array(e):"Date"===t?e.getTime():ArrayBuffer.isView(e)?""+new Uint8Array(e.buffer):e},Ct="undefined"!=typeof Symbol&&Symbol.iterator,Rt=Ct?function(e){var t;return null!=e&&(t=e[Ct])&&t.apply(e)}:function(){return null},It={},Bt="undefined"==typeof Symbol?function(){return!1}:function(e){return"AsyncFunction"===e[Symbol.toStringTag]},Kt="undefined"!=typeof location&&/^(http|https):\/\/(localhost|127\.0\.0\.1)/.test(location.href),Mt=function(){return!0},Nt=!new Error("").stack,Ft=["Unknown","Constraint","Data","TransactionInactive","ReadOnly","Version","NotFound","InvalidState","InvalidAccess","Abort","Timeout","QuotaExceeded","Syntax","DataClone"],Lt=["Modify","Bulk","OpenFailed","VersionChange","Schema","Upgrade","InvalidTable","MissingAPI","NoSuchDatabase","InvalidArgument","SubTransaction","Unsupported","Internal","DatabaseClosed","PrematureCommit","ForeignAwait"].concat(Ft),Gt={VersionChanged:"Database version changed by other database connection",DatabaseClosed:"Database has been closed",Abort:"Transaction aborted",TransactionInactive:"Transaction has already completed or failed"};f(S).from(Error).extend({stack:{get:function(){return this._stack||(this._stack=this.name+": "+this.message+P(this._e,2))}},toString:function(){return this.name+": "+this.message}}),f(E).from(S),f(D).from(S);var Ht=Lt.reduce((function(e,t){return e[t]=t+"Error",e}),{}),Vt=S,Jt=Lt.reduce((function(e,t){function n(e,n){this._e=k(),this.name=r,e?"string"==typeof e?(this.message=e+(n?"\n "+n:""),this.inner=n||null):"object"==typeof e&&(this.message=e.name+" "+e.message,this.inner=e):(this.message=Gt[t]||r,this.inner=null)}var r=t+"Error";return f(n).from(Vt),e[t]=n,e}),{});Jt.Syntax=SyntaxError,Jt.Type=TypeError,Jt.Range=RangeError;var Xt=Ft.reduce((function(e,t){return e[t+"Error"]=Jt[t],e}),{}),Wt=Lt.reduce((function(e,t){return-1===["Syntax","Type","Range"].indexOf(t)&&(e[t+"Error"]=Jt[t]),e}),{});Wt.ModifyError=E,Wt.DexieError=S,Wt.BulkError=D;var zt={},Qt=100,Yt=100,$t="undefined"==typeof Promise?[]:function(){var e=Promise.resolve();if("undefined"==typeof crypto||!crypto.subtle)return[e,e.__proto__,e];var t=crypto.subtle.digest("SHA-512",new Uint8Array([0]));return[t,t.__proto__,e]}(),Zt=$t[0],en=$t[1],tn=$t[2],nn=en&&en.then,rn=Zt&&Zt.constructor,sn=!!tn,on=!1,un=tn?function(){tn.then(Q)}:qt.setImmediate?setImmediate.bind(null,Q):qt.MutationObserver?function(){var e=document.createElement("div");new MutationObserver((function(){Q(),e=null})).observe(e,{attributes:!0}),e.setAttribute("i","1")}:function(){setTimeout(Q,0)},an=function(e,t){yn.push([e,t]),ln&&(un(),ln=!1)},cn=!0,ln=!0,pn=[],fn=[],hn=null,dn=C,gn={id:"global",global:!0,ref:0,unhandleds:[],onunhandled:de,pgp:!1,env:{},finalize:function(){this.unhandleds.forEach((function(e){try{de(e[0],e[1])}catch(e){}}))}},mn=gn,yn=[],vn=0,bn=[],Tn={get:function(){function e(e,r){var i=this,s=!t.global&&(t!==mn||n!==Un);s&&se();var o=new L((function(n,o){X(i,new G(fe(e,t,s),fe(r,t,s),n,o,t))}));return Kt&&z(o,this),o}var t=mn,n=Un;return e.prototype=zt,e},set:function(e){p(this,"then",e&&e.prototype===zt?Tn:{get:function(){return e},set:Tn.set})}};l(L.prototype,{then:Tn,_then:function(e,t){X(this,new G(null,null,e,t,mn))},catch:function(e){if(1===arguments.length)return this.then(null,e);var t=arguments[0],n=arguments[1];return"function"==typeof t?this.then(null,(function(e){return e instanceof t?n(e):te(e)})):this.then(null,(function(e){return e&&e.name===t?n(e):te(e)}))},finally:function(e){return this.then((function(t){return e(),t}),(function(t){return e(),te(t)}))},stack:{get:function(){if(this._stack)return this._stack;try{on=!0;var e=function e(t,n,r){if(n.length===r)return n;var i="";if(!1===t._state){var s,o,u=t._value;null==u?(s=u,o=""):(s=u.name||"Error",o=u.message||u,i=P(u,0)),n.push(s+(o?": "+o:"")+i)}return Kt&&((i=P(t._stackHolder,2))&&-1===n.indexOf(i)&&n.push(i),t._prev&&e(t._prev,n,r)),n}(this,[],20).join("\nFrom previous: ");return null!==this._state&&(this._stack=e),e}finally{on=!1}}},timeout:function(e,t){var n=this;return e<1/0?new L((function(r,i){var s=setTimeout((function(){return i(new Jt.Timeout(t))}),e);n.then(r,i).finally(clearTimeout.bind(null,s))})):this}}),"undefined"!=typeof Symbol&&Symbol.toStringTag&&p(L.prototype,Symbol.toStringTag,"Dexie.Promise"),gn.env=le(),l(L,{all:function(){var e=U.apply(null,arguments).map(oe);return new L((function(t,n){0===e.length&&t([]);var r=e.length;e.forEach((function(i,s){return L.resolve(i).then((function(n){e[s]=n,--r||t(e)}),n)}))}))},resolve:function(e){if(e instanceof L)return e;if(e&&"function"==typeof e.then)return new L((function(t,n){e.then(t,n)}));var t=new L(zt,!0,e);return z(t,hn),t},reject:te,race:function(){var e=U.apply(null,arguments).map(oe);return new L((function(t,n){e.map((function(e){return L.resolve(e).then(t,n)}))}))},PSD:{get:function(){return mn},set:function(e){return mn=e}},newPSD:re,usePSD:pe,scheduler:{get:function(){return an},set:function(e){an=e}},rejectionMapper:{get:function(){return dn},set:function(e){dn=e}},follow:function(e,t){return new L((function(n,r){return re((function(t,n){var r=mn;r.unhandleds=[],r.onunhandled=n,r.finalize=I((function(){var e=this;!function(e){bn.push((function t(){e(),bn.splice(bn.indexOf(t),1)})),++vn,an((function(){0==--vn&&ee()}),[])}((function(){0===e.unhandleds.length?t():n(e.unhandleds[0])}))}),r.finalize),e()}),t,n,r)}))}}),rn&&(rn.allSettled&&p(L,"allSettled",(function(){var e=U.apply(null,arguments).map(oe);return new L((function(t){0===e.length&&t([]);var n=e.length,r=Array(n);e.forEach((function(e,i){return L.resolve(e).then((function(e){return r[i]={status:"fulfilled",value:e}}),(function(e){return r[i]={status:"rejected",reason:e}})).then((function(){return--n||t(r)}))}))}))})),rn.any&&"undefined"!=typeof AggregateError&&p(L,"any",(function(){var e=U.apply(null,arguments).map(oe);return new L((function(t,n){0===e.length&&n(new AggregateError([]));var r=e.length,i=Array(r);e.forEach((function(e,s){return L.resolve(e).then((function(e){return t(e)}),(function(e){i[s]=e,--r||n(new AggregateError(i))}))}))}))})));var An={awaits:0,echoes:0,id:0},qn=0,wn=[],_n=0,Un=0,jn=0;-1===(""+nn).indexOf("[native code]")&&(ie=se=O);var kn,Pn="unhandledrejection",Sn=L.reject,xn="￿",En="Invalid key provided. Keys must be of type string, number, Date or Array<string | number | Date>.",Dn="String expected.",On=[],Cn="undefined"!=typeof navigator&&/(MSIE|Trident|Edge)/.test(navigator.userAgent),Rn=Cn,In=function(e){return!/(dexie\.js|dexie\.min\.js)/.test(e)},Bn="__dbnames",Kn="readonly",Mn="readwrite",Nn={type:3,lower:-1/0,lowerOpen:!1,upper:[[]],upperOpen:!1},Fn=function(){function e(){}return e.prototype._trans=function(e,t,n){function r(e,n,r){if(!r.schema[s])throw new Jt.NotFound("Table "+s+" not part of transaction");return t(r.idbtrans,r)}var i=this._tx||mn.trans,s=this.name,o=Y();try{return i&&i.db===this.db?i===mn.trans?i._promise(e,r,n):re((function(){return i._promise(e,r,n)}),{trans:i,transless:mn.transless||mn}):function e(t,n,r,i){if(!t._state.openComplete&&!mn.letThrough){if(!t._state.isBeingOpened){if(!t._options.autoOpen)return Sn(new Jt.DatabaseClosed);t.open().catch(O)}return t._state.dbReadyPromise.then((function(){return e(t,n,r,i)}))}var s=t._createTransaction(n,r,t._dbSchema);try{s.create()}catch(t){return Sn(t)}return s._promise(n,(function(e,t){return re((function(){return mn.trans=s,i(e,t,s)}))})).then((function(e){return s._completion.then((function(){return e}))}))}(this.db,e,[this.name],r)}finally{o&&Z()}},e.prototype.get=function(e,t){var n=this;return e&&e.constructor===Object?this.where(e).first(t):this._trans("readonly",(function(t){return n.core.get({trans:t,key:e}).then((function(e){return n.hook.reading.fire(e)}))})).then(t)},e.prototype.where=function(e){function t(e,t){try{return 0===s.cmp(e,t)}catch(t){return!1}}if("string"==typeof e)return new this.db.WhereClause(this,e);if(At(e))return new this.db.WhereClause(this,"["+e.join("+")+"]");var n=Tt(e);if(1===n.length)return this.where(n[0]).equals(e[n[0]]);var r=this.schema.indexes.concat(this.schema.primKey).filter((function(e){return e.compound&&n.every((function(t){return 0<=e.keyPath.indexOf(t)}))&&e.keyPath.every((function(e){return 0<=n.indexOf(e)}))}))[0];if(r&&this.db._maxKey!==xn)return this.where(r.name).equals(r.keyPath.map((function(t){return e[t]})));var i=this.schema.idxByName,s=this.db._deps.indexedDB,o=n.reduce((function(n,r){var s=n[0],o=n[1],u=i[r],a=e[r];return[s||u,s||!u?ge(o,u&&u.multi?function(e){var n=v(e,r);return At(n)&&n.some((function(e){return t(a,e)}))}:function(e){return t(a,v(e,r))}):o]}),[null,null]),u=o[0],a=o[1];return u?this.where(u.name).equals(e[u.keyPath]).filter(a):r?this.filter(a):this.where(n).equals("")},e.prototype.filter=function(e){return this.toCollection().and(e)},e.prototype.count=function(e){return this.toCollection().count(e)},e.prototype.offset=function(e){return this.toCollection().offset(e)},e.prototype.limit=function(e){return this.toCollection().limit(e)},e.prototype.each=function(e){return this.toCollection().each(e)},e.prototype.toArray=function(e){return this.toCollection().toArray(e)},e.prototype.toCollection=function(){return new this.db.Collection(new this.db.WhereClause(this))},e.prototype.orderBy=function(e){return new this.db.Collection(new this.db.WhereClause(this,At(e)?"["+e.join("+")+"]":e))},e.prototype.reverse=function(){return this.toCollection().reverse()},e.prototype.mapToClass=function(e){this.schema.mappedClass=e;var t=function(t){if(!t)return t;var n=Object.create(e.prototype);for(var r in t)if(c(t,r))try{n[r]=t[r]}catch(e){}return n};return this.schema.readHook&&this.hook.reading.unsubscribe(this.schema.readHook),this.schema.readHook=t,this.hook("reading",t),e},e.prototype.defineClass=function(){return this.mapToClass((function(e){a(this,e)}))},e.prototype.add=function(e,t){var n=this;return this._trans("readwrite",(function(r){return n.core.mutate({trans:r,type:"add",keys:null==t?null:[t],values:[e]})})).then((function(e){return e.numFailures?L.reject(e.failures[0]):e.lastResult})).then((function(t){if(!n.core.schema.primaryKey.outbound)try{b(e,n.core.schema.primaryKey.keyPath,t)}catch(e){}return t}))},e.prototype.update=function(e,t){if("object"!=typeof t||At(t))throw new Jt.InvalidArgument("Modifications must be an object.");if("object"==typeof e&&!At(e)){Tt(t).forEach((function(n){b(e,n,t[n])}));var n=v(e,this.schema.primKey.keyPath);return void 0===n?Sn(new Jt.InvalidArgument("Given object does not contain its primary key")):this.where(":id").equals(n).modify(t)}return this.where(":id").equals(e).modify(t)},e.prototype.put=function(e,t){var n=this;return this._trans("readwrite",(function(r){return n.core.mutate({trans:r,type:"put",values:[e],keys:null==t?null:[t]})})).then((function(e){return e.numFailures?L.reject(e.failures[0]):e.lastResult})).then((function(t){if(!n.core.schema.primaryKey.outbound)try{b(e,n.core.schema.primaryKey.keyPath,t)}catch(e){}return t}))},e.prototype.delete=function(e){var t=this;return this._trans("readwrite",(function(n){return t.core.mutate({trans:n,type:"delete",keys:[e]})})).then((function(e){return e.numFailures?L.reject(e.failures[0]):void 0}))},e.prototype.clear=function(){var e=this;return this._trans("readwrite",(function(t){return e.core.mutate({trans:t,type:"deleteRange",range:Nn})})).then((function(e){return e.numFailures?L.reject(e.failures[0]):void 0}))},e.prototype.bulkGet=function(e){var t=this;return this._trans("readonly",(function(n){return t.core.getMany({keys:e,trans:n})}))},e.prototype.bulkAdd=function(e,t,n){var r=this,i=Array.isArray(t)?t:void 0,s=(n=n||(i?void 0:t))?n.allKeys:void 0;return this._trans("readwrite",(function(t){if(!r.core.schema.primaryKey.outbound&&i)throw new Jt.InvalidArgument("bulkAdd(): keys argument invalid on tables with inbound keys");if(i&&i.length!==e.length)throw new Jt.InvalidArgument("Arguments objects and keys must have the same length");var n=e.length;return r.core.mutate({trans:t,type:"add",keys:i,values:e,wantResults:s}).then((function(e){var t=e.numFailures,i=e.results,o=e.lastResult,u=e.failures;if(0===t)return s?i:o;throw new D(r.name+".bulkAdd(): "+t+" of "+n+" operations failed",Object.keys(u).map((function(e){return u[e]})))}))}))},e.prototype.bulkPut=function(e,t,n){var r=this,i=Array.isArray(t)?t:void 0,s=(n=n||(i?void 0:t))?n.allKeys:void 0;return this._trans("readwrite",(function(t){if(!r.core.schema.primaryKey.outbound&&i)throw new Jt.InvalidArgument("bulkPut(): keys argument invalid on tables with inbound keys");if(i&&i.length!==e.length)throw new Jt.InvalidArgument("Arguments objects and keys must have the same length");var n=e.length;return r.core.mutate({trans:t,type:"put",keys:i,values:e,wantResults:s}).then((function(e){var t=e.numFailures,i=e.results,o=e.lastResult,u=e.failures;if(0===t)return s?i:o;throw new D(r.name+".bulkPut(): "+t+" of "+n+" operations failed",Object.keys(u).map((function(e){return u[e]})))}))}))},e.prototype.bulkDelete=function(e){var t=this,n=e.length;return this._trans("readwrite",(function(n){return t.core.mutate({trans:n,type:"delete",keys:e})})).then((function(e){var r=e.numFailures,i=e.lastResult,s=e.failures;if(0===r)return i;throw new D(t.name+".bulkDelete(): "+r+" of "+n+" operations failed",s)}))},e}(),Ln=function(){function e(){}return e.prototype._read=function(e,t){var n=this._ctx;return n.error?n.table._trans(null,Sn.bind(null,n.error)):n.table._trans("readonly",e).then(t)},e.prototype._write=function(e){var t=this._ctx;return t.error?t.table._trans(null,Sn.bind(null,t.error)):t.table._trans("readwrite",e,"locked")},e.prototype._addAlgorithm=function(e){var t=this._ctx;t.algorithm=ge(t.algorithm,e)},e.prototype._iterate=function(e,t){return we(this._ctx,e,t,this._ctx.table.core)},e.prototype.clone=function(e){var t=Object.create(this.constructor.prototype),n=Object.create(this._ctx);return e&&a(n,e),t._ctx=n,t},e.prototype.raw=function(){return this._ctx.valueMapper=null,this},e.prototype.each=function(e){var t=this._ctx;return this._read((function(n){return we(t,e,n,t.table.core)}))},e.prototype.count=function(e){var t=this;return this._read((function(e){var n=t._ctx,r=n.table.core;if(ve(n,!0))return r.count({trans:e,query:{index:Ae(n,r.schema),range:n.range}}).then((function(e){return ft(e,n.limit)}));var i=0;return we(n,(function(){return++i,!1}),e,r).then((function(){return i}))})).then(e)},e.prototype.sortBy=function(e,t){function n(e,t){return t?n(e[i[t]],t-1):e[s]}function r(e,t){var r=n(e,o),i=n(t,o);return r<i?-u:r>i?u:0}var i=e.split(".").reverse(),s=i[0],o=i.length-1,u="next"===this._ctx.dir?1:-1;return this.toArray((function(e){return e.sort(r)})).then(t)},e.prototype.toArray=function(e){var t=this;return this._read((function(e){var n=t._ctx;if("next"===n.dir&&ve(n,!0)&&0<n.limit){var r=n.valueMapper,i=Ae(n,n.table.core.schema);return n.table.core.query({trans:e,limit:n.limit,values:!0,query:{index:i,range:n.range}}).then((function(e){var t=e.result;return r?t.map(r):t}))}var s=[];return we(n,(function(e){return s.push(e)}),e,n.table.core).then((function(){return s}))}),e)},e.prototype.offset=function(e){var t=this._ctx;return 0>=e||(t.offset+=e,ve(t)?Te(t,(function(){var t=e;return function(e,n){return 0===t||(1===t?(--t,!1):(n((function(){e.advance(t),t=0})),!1))}})):Te(t,(function(){var t=e;return function(){return 0>--t}}))),this},e.prototype.limit=function(e){return this._ctx.limit=ft(this._ctx.limit,e),Te(this._ctx,(function(){var t=e;return function(e,n,r){return 0>=--t&&n(r),0<=t}}),!0),this},e.prototype.until=function(e,t){return be(this._ctx,(function(n,r,i){return!e(n.value)||(r(i),t)})),this},e.prototype.first=function(e){return this.limit(1).toArray((function(e){return e[0]})).then(e)},e.prototype.last=function(e){return this.reverse().first(e)},e.prototype.filter=function(e){return be(this._ctx,(function(t){return e(t.value)})),function(e,t){e.isMatch=ge(e.isMatch,t)}(this._ctx,e),this},e.prototype.and=function(e){return this.filter(e)},e.prototype.or=function(e){return new this.db.WhereClause(this._ctx.table,e,this)},e.prototype.reverse=function(){return this._ctx.dir="prev"===this._ctx.dir?"next":"prev",this._ondirectionchange&&this._ondirectionchange(this._ctx.dir),this},e.prototype.desc=function(){return this.reverse()},e.prototype.eachKey=function(e){var t=this._ctx;return t.keysOnly=!t.isMatch,this.each((function(t,n){e(n.key,n)}))},e.prototype.eachUniqueKey=function(e){return this._ctx.unique="unique",this.eachKey(e)},e.prototype.eachPrimaryKey=function(e){var t=this._ctx;return t.keysOnly=!t.isMatch,this.each((function(t,n){e(n.primaryKey,n)}))},e.prototype.keys=function(e){var t=this._ctx;t.keysOnly=!t.isMatch;var n=[];return this.each((function(e,t){n.push(t.key)})).then((function(){return n})).then(e)},e.prototype.primaryKeys=function(e){var t=this._ctx;if("next"===t.dir&&ve(t,!0)&&0<t.limit)return this._read((function(e){var n=Ae(t,t.table.core.schema);return t.table.core.query({trans:e,values:!1,limit:t.limit,query:{index:n,range:t.range}})})).then((function(e){return e.result})).then(e);t.keysOnly=!t.isMatch;var n=[];return this.each((function(e,t){n.push(t.primaryKey)})).then((function(){return n})).then(e)},e.prototype.uniqueKeys=function(e){return this._ctx.unique="unique",this.keys(e)},e.prototype.firstKey=function(e){return this.limit(1).keys((function(e){return e[0]})).then(e)},e.prototype.lastKey=function(e){return this.reverse().firstKey(e)},e.prototype.distinct=function(){var e=this._ctx,t=e.index&&e.table.schema.idxByName[e.index];if(!t||!t.multi)return this;var n={};return be(this._ctx,(function(e){var t=e.primaryKey.toString(),r=c(n,t);return n[t]=!0,!r})),this},e.prototype.modify=function(e){var t=this,n=this._ctx;return this._write((function(r){var i;if("function"==typeof e)i=e;else{var s=Tt(e),o=s.length;i=function(t){for(var n=!1,r=0;r<o;++r){var i=s[r],u=e[i];v(t,i)!==u&&(b(t,i,u),n=!0)}return n}}var u=n.table.core,a=u.schema.primaryKey,c=a.outbound,l=a.extractKey,p="testmode"in zn?1:2e3,f=t.db.core.cmp,h=[],d=0,g=[],m=function(e,t){var n=t.failures,r=t.numFailures;d+=e-r;for(var i,s=0,o=Tt(n);s<o.length;s++)i=o[s],h.push(n[i])};return t.clone().primaryKeys().then((function(e){var t=function(n){var s=ft(p,e.length-n);return u.getMany({trans:r,keys:e.slice(n,n+s)}).then((function(o){for(var a=[],h=[],d=c?[]:null,g=[],y=0;y<s;++y){var v=o[y],b={value:q(v),primKey:e[n+y]};!1!==i.call(b,b.value,b)&&(null==b.value?g.push(e[n+y]):c||0===f(l(v),l(b.value))?(h.push(b.value),c&&d.push(e[n+y])):(g.push(e[n+y]),a.push(b.value)))}return Promise.resolve(0<a.length&&u.mutate({trans:r,type:"add",values:a}).then((function(e){for(var t in e.failures)g.splice(parseInt(t),1);m(a.length,e)}))).then((function(){return 0<h.length&&u.mutate({trans:r,type:"put",keys:d,values:h}).then((function(e){return m(h.length,e)}))})).then((function(){return 0<g.length&&u.mutate({trans:r,type:"delete",keys:g}).then((function(e){return m(g.length,e)}))})).then((function(){return e.length>n+s&&t(n+p)}))}))};return t(0).then((function(){if(0<h.length)throw new E("Error modifying one or more objects",h,d,g);return e.length}))}))}))},e.prototype.delete=function(){var e=this._ctx,t=e.range;return ve(e)&&(e.isPrimKey&&!Cn||3===t.type)?this._write((function(n){var r=e.table.core.schema.primaryKey,i=t;return e.table.core.count({trans:n,query:{index:r,range:i}}).then((function(t){return e.table.core.mutate({trans:n,type:"deleteRange",range:i}).then((function(e){var n=e.failures,r=(e.lastResult,e.results,e.numFailures);if(r)throw new E("Could not delete some values",Object.keys(n).map((function(e){return n[e]})),t-r);return t-r}))}))})):this.modify((function(e,t){return t.value=null}))},e}(),Gn=function(){function e(){}return Object.defineProperty(e.prototype,"Collection",{get:function(){return this._ctx.table.db.Collection},enumerable:!0,configurable:!0}),e.prototype.between=function(e,t,n,r){n=!1!==n,r=!0===r;try{return 0<this._cmp(e,t)||0===this._cmp(e,t)&&(n||r)&&(!n||!r)?Pe(this):new this.Collection(this,(function(){return Ee(e,t,!n,!r)}))}catch(t){return ke(this,En)}},e.prototype.equals=function(e){return new this.Collection(this,(function(){return De(e)}))},e.prototype.above=function(e){return null==e?ke(this,En):new this.Collection(this,(function(){return Ee(e,void 0,!0)}))},e.prototype.aboveOrEqual=function(e){return null==e?ke(this,En):new this.Collection(this,(function(){return Ee(e,void 0,!1)}))},e.prototype.below=function(e){return null==e?ke(this,En):new this.Collection(this,(function(){return Ee(void 0,e,!1,!0)}))},e.prototype.belowOrEqual=function(e){return null==e?ke(this,En):new this.Collection(this,(function(){return Ee(void 0,e)}))},e.prototype.startsWith=function(e){return"string"==typeof e?this.between(e,e+xn,!0,!0):ke(this,Dn)},e.prototype.startsWithIgnoreCase=function(e){return""===e?this.startsWith(e):xe(this,(function(e,t){return 0===e.indexOf(t[0])}),[e],xn)},e.prototype.equalsIgnoreCase=function(e){return xe(this,(function(e,t){return e===t[0]}),[e],"")},e.prototype.anyOfIgnoreCase=function(){var e=U.apply(It,arguments);return 0===e.length?Pe(this):xe(this,(function(e,t){return-1!==t.indexOf(e)}),e,"")},e.prototype.startsWithAnyOfIgnoreCase=function(){var e=U.apply(It,arguments);return 0===e.length?Pe(this):xe(this,(function(e,t){return t.some((function(t){return 0===e.indexOf(t)}))}),e,xn)},e.prototype.anyOf=function(){var e=this,t=U.apply(It,arguments),n=this._cmp;try{t.sort(n)}catch(t){return ke(this,En)}if(0===t.length)return Pe(this);var r=new this.Collection(this,(function(){return Ee(t[0],t[t.length-1])}));r._ondirectionchange=function(r){n="next"===r?e._ascending:e._descending,t.sort(n)};var i=0;return r._addAlgorithm((function(e,r,s){for(var o=e.key;0<n(o,t[i]);)if(++i===t.length)return r(s),!1;return 0===n(o,t[i])||(r((function(){e.continue(t[i])})),!1)})),r},e.prototype.notEqual=function(e){return this.inAnyRange([[-1/0,e],[e,this.db._maxKey]],{includeLowers:!1,includeUppers:!1})},e.prototype.noneOf=function(){var e=U.apply(It,arguments);if(0===e.length)return new this.Collection(this);try{e.sort(this._ascending)}catch(t){return ke(this,En)}var t=e.reduce((function(e,t){return e?e.concat([[e[e.length-1][1],t]]):[[-1/0,t]]}),null);return t.push([e[e.length-1],this.db._maxKey]),this.inAnyRange(t,{includeLowers:!1,includeUppers:!1})},e.prototype.inAnyRange=function(e,t){function n(e,t){return f(e[0],t[0])}var r=this,i=this._cmp,s=this._ascending,o=this._descending,u=this._min,a=this._max;if(0===e.length)return Pe(this);if(!e.every((function(e){return void 0!==e[0]&&void 0!==e[1]&&0>=s(e[0],e[1])})))return ke(this,"First argument to inAnyRange() must be an Array of two-value Arrays [lower,upper] where upper must not be lower than lower",Jt.InvalidArgument);var c,l=!t||!1!==t.includeLowers,p=t&&!0===t.includeUppers,f=s;try{(c=e.reduce((function(e,t){for(var n,r=0,s=e.length;r<s;++r)if(n=e[r],0>i(t[0],n[1])&&0<i(t[1],n[0])){n[0]=u(n[0],t[0]),n[1]=a(n[1],t[1]);break}return r===s&&e.push(t),e}),[])).sort(n)}catch(e){return ke(this,En)}var h=0,d=p?function(e){return 0<s(e,c[h][1])}:function(e){return 0<=s(e,c[h][1])},g=l?function(e){return 0<o(e,c[h][0])}:function(e){return 0<=o(e,c[h][0])},m=d,y=new this.Collection(this,(function(){return Ee(c[0][0],c[c.length-1][1],!l,!p)}));return y._ondirectionchange=function(e){"next"===e?(m=d,f=s):(m=g,f=o),c.sort(n)},y._addAlgorithm((function(e,t,n){for(var i=e.key;m(i);)if(++h===c.length)return t(n),!1;return!!function(e){return!d(e)&&!g(e)}(i)||0!==r._cmp(i,c[h][1])&&0!==r._cmp(i,c[h][0])&&(t((function(){f===s?e.continue(c[h][0]):e.continue(c[h][1])})),!1)})),y},e.prototype.startsWithAnyOf=function(){var e=U.apply(It,arguments);return e.every((function(e){return"string"==typeof e}))?0===e.length?Pe(this):this.inAnyRange(e.map((function(e){return[e,e+xn]}))):ke(this,"startsWithAnyOf() only works with strings")},e}(),Hn=function(){function e(){}return e.prototype._lock=function(){return g(!mn.global),++this._reculock,1!==this._reculock||mn.global||(mn.lockOwnerFor=this),this},e.prototype._unlock=function(){if(g(!mn.global),0==--this._reculock)for(mn.global||(mn.lockOwnerFor=null);0<this._blockedFuncs.length&&!this._locked();){var e=this._blockedFuncs.shift();try{pe(e[1],e[0])}catch(e){}}return this},e.prototype._locked=function(){return this._reculock&&mn.lockOwnerFor!==this},e.prototype.create=function(e){var t=this;if(!this.mode)return this;var n=this.db.idbdb,r=this.db._state.dbOpenError;if(g(!this.idbtrans),!e&&!n)switch(r&&r.name){case"DatabaseClosedError":throw new Jt.DatabaseClosed(r);case"MissingAPIError":throw new Jt.MissingAPI(r.message,r);default:throw new Jt.OpenFailed(r)}if(!this.active)throw new Jt.TransactionInactive;return g(null===this._completion._state),(e=this.idbtrans=e||n.transaction(Oe(this.storeNames),this.mode)).onerror=ne((function(n){Ie(n),t._reject(e.error)})),e.onabort=ne((function(n){Ie(n),t.active&&t._reject(new Jt.Abort(e.error)),t.active=!1,t.on("abort").fire(n)})),e.oncomplete=ne((function(){t.active=!1,t._resolve()})),this},e.prototype._promise=function(e,t,n){var r=this;if("readwrite"===e&&"readwrite"!==this.mode)return Sn(new Jt.ReadOnly("Transaction is readonly"));if(!this.active)return Sn(new Jt.TransactionInactive);if(this._locked())return new L((function(i,s){r._blockedFuncs.push([function(){r._promise(e,t,n).then(i,s)},mn])}));if(n)return re((function(){var e=new L((function(e,n){r._lock();var i=t(e,n,r);i&&i.then&&i.then(e,n)}));return e.finally((function(){return r._unlock()})),e._lib=!0,e}));var i=new L((function(e,n){var i=t(e,n,r);i&&i.then&&i.then(e,n)}));return i._lib=!0,i},e.prototype._root=function(){return this.parent?this.parent._root():this},e.prototype.waitFor=function(e){var t=this._root(),n=L.resolve(e);if(t._waitingFor)t._waitingFor=t._waitingFor.then((function(){return n}));else{t._waitingFor=n,t._waitingQueue=[];var r=t.idbtrans.objectStore(t.storeNames[0]);!function e(){for(++t._spinCount;t._waitingQueue.length;)t._waitingQueue.shift()();t._waitingFor&&(r.get(-1/0).onsuccess=e)}()}var i=t._waitingFor;return new L((function(e,r){n.then((function(n){return t._waitingQueue.push(ne(e.bind(null,n)))}),(function(e){return t._waitingQueue.push(ne(r.bind(null,e)))})).finally((function(){t._waitingFor===i&&(t._waitingFor=null)}))}))},e.prototype.abort=function(){this.active&&this._reject(new Jt.Abort),this.active=!1},e.prototype.table=function(e){var t=this._memoizedTables||(this._memoizedTables={});if(c(t,e))return t[e];var n=this.schema[e];if(!n)throw new Jt.NotFound("Table "+e+" not part of transaction");var r=new this.db.Table(e,n,this);return r.core=this.db.core.table(e),t[e]=r,r},e}(),Vn=0,Jn=function(){function e(){}return e.prototype._parseStoresSpec=function(e,t){Tt(e).forEach((function(n){if(null!==e[n]){var r=function(e){return e.split(",").map((function(e,t){var n=(e=e.trim()).replace(/([&*]|\+\+)/g,""),r=/^\[/.test(n)?n.match(/^\[(.*)\]$/)[1].split("+"):n;return Be(n,r||null,/\&/.test(e),/\*/.test(e),/\+\+/.test(e),At(r),0===t)}))}(e[n]),i=r.shift();if(i.multi)throw new Jt.Schema("Primary key cannot be multi-valued");r.forEach((function(e){if(e.auto)throw new Jt.Schema("Only primary key can be marked as autoIncrement (++)");if(!e.keyPath)throw new Jt.Schema("Index must have a name and cannot be an empty string")})),t[n]=Me(n,i,r)}}))},e.prototype.stores=function(e){var t=this.db;this._cfg.storesSource=this._cfg.storesSource?a(this._cfg.storesSource,e):e;var n=t._versions,r={},i={};return n.forEach((function(e){a(r,e._cfg.storesSource),i=e._cfg.dbschema={},e._parseStoresSpec(r,i)})),t._dbSchema=i,We(t,[t._allTables,t,t.Transaction.prototype]),Xe(t,[t._allTables,t,t.Transaction.prototype,this._cfg.tables],Tt(i),i),t._storeNames=Tt(i),this},e.prototype.upgrade=function(e){return this._cfg.contentUpgrade=e,this},e}(),Xn={stack:"dbcore",name:"VirtualIndexMiddleware",level:1,create:function(e){return bt(bt({},e),{table:function(t){function n(e,t,r){var i=Ge(e),s=u[i]=u[i]||[],o=null==e?0:"string"==typeof e?1:e.length,c=0<t,l=bt(bt({},r),{isVirtual:c,isPrimaryKey:!c&&r.isPrimaryKey,keyTail:t,keyLength:o,extractKey:Ne(e),unique:!c&&r.unique});(s.push(l),l.isPrimaryKey||a.push(l),1<o)&&n(2===o?e[0]:e.slice(0,o-1),t+1,r);return s.sort((function(e,t){return e.keyTail-t.keyTail})),l}function r(t,n){return{type:1===t.type?2:t.type,lower:ot(t.lower,t.lowerOpen?e.MAX_KEY:e.MIN_KEY,n),lowerOpen:!0,upper:ot(t.upper,t.upperOpen?e.MIN_KEY:e.MAX_KEY,n),upperOpen:!0}}function i(e){var t=e.query.index;return t.isVirtual?bt(bt({},e),{query:{index:t,range:r(e.query.range,t.keyTail)}}):e}var s=e.table(t),o=s.schema,u={},a=[],c=n(o.primaryKey.keyPath,0,o.primaryKey);u[":id"]=[c];for(var l,p=0,f=o.indexes;p<f.length;p++)n((l=f[p]).keyPath,0,l);return bt(bt({},s),{schema:bt(bt({},o),{primaryKey:c,indexes:a,getIndexByKeyPath:function(e){var t=u[Ge(e)];return t&&t[0]}}),count:function(e){return s.count(i(e))},query:function(e){return s.query(i(e))},openCursor:function(t){function n(n){return Object.create(n,{continue:{value:function(r){null==r?t.unique?n.continue(ot(n.key,t.reverse?e.MIN_KEY:e.MAX_KEY,o)):n.continue():n.continue(ot(r,t.reverse?e.MAX_KEY:e.MIN_KEY,o))}},continuePrimaryKey:{value:function(t,r){n.continuePrimaryKey(ot(t,e.MAX_KEY,o),r)}},key:{get:function(){var e=n.key;return 1===a?e[0]:e.slice(0,a)}},value:{get:function(){return n.value}}})}var r=t.query.index,o=r.keyTail,u=r.isVirtual,a=r.keyLength;return u?s.openCursor(i(t)).then((function(e){return e&&n(e)})):s.openCursor(t)}})}})}},Wn={stack:"dbcore",name:"HooksMiddleware",level:2,create:function(e){return bt(bt({},e),{table:function(t){var n=e.table(t),r=n.schema.primaryKey;return bt(bt({},n),{mutate:function(e){function i(e){var t=mn.trans,i=e.keys||Fe(r,e);if(!i)throw new Error("Keys missing");return"delete"!==(e="add"===e.type||"put"===e.type?bt(bt({},e),{keys:i,wantResults:!0}):bt({},e)).type&&(e.values=u(e.values)),e.keys&&(e.keys=u(e.keys)),function(e,t,n){return"add"===t.type?Promise.resolve(Array(t.values.length)):e.getMany({trans:t.trans,keys:n})}(n,e,i).then((function(s){var o=i.map((function(n,i){var o=s[i],u={onerror:null,onsuccess:null};if("delete"===e.type)c.fire.call(u,n,o,t);else if("add"===e.type||void 0===o){var a=l.fire.call(u,n,e.values[i],t);null==n&&null!=a&&(n=a,e.keys[i]=n,!r.outbound&&b(e.values[i],r.keyPath,n))}else{var f=_(o,e.values[i]),h=p.fire.call(u,f,n,o,t);if(h){var d=e.values[i];Object.keys(h).forEach((function(e){b(d,e,h[e])}))}}return u}));return n.mutate(e).then((function(t){for(var n=t.failures,r=t.results,u=t.numFailures,a=t.lastResult,c=0;c<i.length;++c){var l=r?r[c]:i[c],p=o[c];null==l?p.onerror&&p.onerror(n[c]):p.onsuccess&&p.onsuccess("put"===e.type&&s[c]?e.values[c]:l)}return{failures:n,results:r,numFailures:u,lastResult:a}})).catch((function(e){return o.forEach((function(t){return t.onerror&&t.onerror(e)})),Promise.reject(e)}))}))}function s(e){return function e(t,s,o){return n.query({trans:t,values:!1,query:{index:r,range:s},limit:o}).then((function(n){var r=n.result;return i({type:"delete",keys:r,trans:t}).then((function(n){return 0<n.numFailures?Promise.reject(n.failures[0]):r.length<o?{failures:[],numFailures:0,lastResult:void 0}:e(t,bt(bt({},s),{lower:r[r.length-1],lowerOpen:!0}),o)}))}))}(e.trans,e.range,1e4)}var o=mn.trans,a=o.table(t).hook,c=a.deleting,l=a.creating,p=a.updating;switch(e.type){case"add":if(l.fire===O)break;return o._promise("readwrite",(function(){return i(e)}),!0);case"put":if(l.fire===O&&p.fire===O)break;return o._promise("readwrite",(function(){return i(e)}),!0);case"delete":if(c.fire===O)break;return o._promise("readwrite",(function(){return i(e)}),!0);case"deleteRange":if(c.fire===O)break;return o._promise("readwrite",(function(){return s(e)}),!0)}return n.mutate(e)}})}})}},zn=function(){function e(t,n){var r=this;this._middlewares={},this.verno=0;var i=e.dependencies;this._options=n=bt({addons:e.addons,autoOpen:!0,indexedDB:i.indexedDB,IDBKeyRange:i.IDBKeyRange},n),this._deps={indexedDB:n.indexedDB,IDBKeyRange:n.IDBKeyRange};var s=n.addons;this._dbSchema={},this._versions=[],this._storeNames=[],this._allTables={},this.idbdb=null;var o={dbOpenError:null,isBeingOpened:!1,onReadyBeingFired:null,openComplete:!1,dbReadyResolve:O,dbReadyPromise:null,cancelOpen:O,openCanceller:null,autoSchema:!0};o.dbReadyPromise=new L((function(e){o.dbReadyResolve=e})),o.openCanceller=new L((function(e,t){o.cancelOpen=t})),this._state=o,this.name=t,this.on=me(this,"populate","blocked","versionchange",{ready:[F,O]}),this.on.ready.subscribe=d(this.on.ready.subscribe,(function(t){return function(n,i){e.vip((function(){var e=r._state;if(e.openComplete)e.dbOpenError||L.resolve().then(n),i&&t(n);else if(e.onReadyBeingFired)e.onReadyBeingFired.push(n),i&&t(n);else{t(n);var s=r;i||t((function e(){s.on.ready.unsubscribe(n),s.on.ready.unsubscribe(e)}))}}))}})),this.Collection=function(e){return ye(Ln.prototype,(function(t,n){this.db=e;var r=Nn,i=null;if(n)try{r=n()}catch(e){i=e}var s=t._ctx,o=s.table,u=o.hook.reading.fire;this._ctx={table:o,index:s.index,isPrimKey:!s.index||o.schema.primKey.keyPath&&s.index===o.schema.primKey.name,range:r,keysOnly:!1,dir:"next",unique:"",algorithm:null,filter:null,replayFilter:null,justLimit:!0,isMatch:null,offset:0,limit:1/0,error:i,or:s.or,valueMapper:u===C?null:u}}))}(this),this.Table=function(e){return ye(Fn.prototype,(function(t,n,r){this.db=e,this._tx=r,this.name=t,this.schema=n,this.hook=e._allTables[t]?e._allTables[t].hook:me(null,{creating:[B,O],reading:[R,C],updating:[M,O],deleting:[K,O]})}))}(this),this.Transaction=function(e){return ye(Hn.prototype,(function(t,n,r,i){var s=this;this.db=e,this.mode=t,this.storeNames=n,this.schema=r,this.idbtrans=null,this.on=me(this,"complete","error","abort"),this.parent=i||null,this.active=!0,this._reculock=0,this._blockedFuncs=[],this._resolve=null,this._reject=null,this._waitingFor=null,this._waitingQueue=null,this._spinCount=0,this._completion=new L((function(e,t){s._resolve=e,s._reject=t})),this._completion.then((function(){s.active=!1,s.on.complete.fire()}),(function(e){var t=s.active;return s.active=!1,s.on.error.fire(e),s.parent?s.parent._reject(e):t&&s.idbtrans&&s.idbtrans.abort(),Sn(e)}))}))}(this),this.Version=function(e){return ye(Jn.prototype,(function(t){this.db=e,this._cfg={version:t,storesSource:null,dbschema:{},tables:{},contentUpgrade:null}}))}(this),this.WhereClause=function(e){return ye(Gn.prototype,(function(t,n,r){this.db=e,this._ctx={table:t,index:":id"===n?null:n,or:r};var i=e._deps.indexedDB;if(!i)throw new Jt.MissingAPI("indexedDB API missing");this._cmp=this._ascending=i.cmp.bind(i),this._descending=function(e,t){return i.cmp(t,e)},this._max=function(e,t){return 0<i.cmp(e,t)?e:t},this._min=function(e,t){return 0>i.cmp(e,t)?e:t},this._IDBKeyRange=e._deps.IDBKeyRange}))}(this),this.on("versionchange",(function(e){e.newVersion,r.close()})),this.on("blocked",(function(e){e.newVersion&&(e.newVersion,e.oldVersion)})),this._maxKey=Ce(n.IDBKeyRange),this._createTransaction=function(e,t,n,i){return new r.Transaction(e,t,n,i)},this._fireOnBlocked=function(e){r.on("blocked").fire(e),On.filter((function(e){return e.name===r.name&&e!==r&&!e._state.vcFired})).map((function(t){return t.on("versionchange").fire(e)}))},this.use(Xn),this.use(Wn),s.forEach((function(e){return e(r)}))}return e.prototype.version=function(e){if(isNaN(e)||.1>e)throw new Jt.Type("Given version is not a positive number");if(e=pt(10*e)/10,this.idbdb||this._state.isBeingOpened)throw new Jt.Schema("Cannot add version when database is open");this.verno=Math.max(this.verno,e);var t=this._versions,n=t.filter((function(t){return t._cfg.version===e}))[0];return n||(n=new this.Version(e),t.push(n),t.sort(ze),n.stores({}),this._state.autoSchema=!1,n)},e.prototype._whenReady=function(e){var t=this;return this._state.openComplete||mn.letThrough?e():new L((function(e,n){if(!t._state.isBeingOpened){if(!t._options.autoOpen)return void n(new Jt.DatabaseClosed);t.open().catch(O)}t._state.dbReadyPromise.then(e,n)})).then(e)},e.prototype.use=function(e){var t=e.stack,n=e.create,r=e.level,i=e.name;i&&this.unuse({stack:t,name:i});var s=this._middlewares[t]||(this._middlewares[t]=[]);return s.push({stack:t,create:n,level:null==r?10:r,name:i}),s.sort((function(e,t){return e.level-t.level})),this},e.prototype.unuse=function(e){var t=e.stack,n=e.name,r=e.create;return t&&this._middlewares[t]&&(this._middlewares[t]=this._middlewares[t].filter((function(e){return r?e.create!==r:!!n&&e.name!==n}))),this},e.prototype.open=function(){return nt(this)},e.prototype.close=function(){var e=On.indexOf(this),t=this._state;if(0<=e&&On.splice(e,1),this.idbdb){try{this.idbdb.close()}catch(t){}this.idbdb=null}this._options.autoOpen=!1,t.dbOpenError=new Jt.DatabaseClosed,t.isBeingOpened&&t.cancelOpen(t.dbOpenError),t.dbReadyPromise=new L((function(e){t.dbReadyResolve=e})),t.openCanceller=new L((function(e,n){t.cancelOpen=n}))},e.prototype.delete=function(){var e=this,t=0<arguments.length,n=this._state;return new L((function(r,i){var s=function(){e.close();var t=e._deps.indexedDB.deleteDatabase(e.name);t.onsuccess=ne((function(){kn.remove(e.name),r()})),t.onerror=Re(i),t.onblocked=e._fireOnBlocked};if(t)throw new Jt.InvalidArgument("Arguments not allowed in db.delete()");n.isBeingOpened?n.dbReadyPromise.then(s):s()}))},e.prototype.backendDB=function(){return this.idbdb},e.prototype.isOpen=function(){return null!==this.idbdb},e.prototype.hasBeenClosed=function(){var e=this._state.dbOpenError;return e&&"DatabaseClosed"===e.name},e.prototype.hasFailed=function(){return null!==this._state.dbOpenError},e.prototype.dynamicallyOpened=function(){return this._state.autoSchema},Object.defineProperty(e.prototype,"tables",{get:function(){var e=this;return Tt(this._allTables).map((function(t){return e._allTables[t]}))},enumerable:!0,configurable:!0}),e.prototype.transaction=function(){var e=it.apply(this,arguments);return this._transaction.apply(this,e)},e.prototype._transaction=function(e,t,n){var r=this,i=mn.trans;i&&i.db===this&&-1===e.indexOf("!")||(i=null);var s,o,u=-1!==e.indexOf("?");e=e.replace("!","").replace("?","");try{if(o=t.map((function(e){var t=e instanceof r.Table?e.name:e;if("string"!=typeof t)throw new TypeError("Invalid table argument to Dexie.transaction(). Only Table or String are allowed");return t})),"r"==e||e===Kn)s=Kn;else{if("rw"!=e&&e!=Mn)throw new Jt.InvalidArgument("Invalid transaction mode: "+e);s=Mn}if(i){if(i.mode===Kn&&s===Mn){if(!u)throw new Jt.SubTransaction("Cannot enter a sub-transaction with READWRITE mode when parent transaction is READONLY");i=null}i&&o.forEach((function(e){if(i&&-1===i.storeNames.indexOf(e)){if(!u)throw new Jt.SubTransaction("Table "+e+" not included in parent transaction.");i=null}})),u&&i&&!i.active&&(i=null)}}catch(t){return i?i._promise(null,(function(e,n){n(t)})):Sn(t)}var a=st.bind(null,this,s,o,i,n);return i?i._promise(s,a,"lock"):mn.trans?pe(mn.transless,(function(){return r._whenReady(a)})):this._whenReady(a)},e.prototype.table=function(e){if(!c(this._allTables,e))throw new Jt.InvalidTable("Table "+e+" does not exist");return this._allTables[e]},e}(),Qn=zn;l(Qn,bt(bt({},Wt),{delete:function(e){return new Qn(e).delete()},exists:function(e){return new Qn(e,{addons:[]}).open().then((function(e){return e.close(),!0})).catch("NoSuchDatabaseError",(function(){return!1}))},getDatabaseNames:function(e){return kn?kn.getDatabaseNames().then(e):L.resolve([])},defineClass:function(){return function(e){a(this,e)}},ignoreTransaction:function(e){return mn.trans?pe(mn.transless,e):e()},vip:tt,async:function(e){return function(){try{var t=rt(e.apply(this,arguments));return t&&"function"==typeof t.then?t:L.resolve(t)}catch(t){return Sn(t)}}},spawn:function(e,t,n){try{var r=rt(e.apply(n,t||[]));return r&&"function"==typeof r.then?r:L.resolve(r)}catch(t){return Sn(t)}},currentTransaction:{get:function(){return mn.trans||null}},waitFor:function(e,t){var n=L.resolve("function"==typeof e?Qn.ignoreTransaction(e):e).timeout(t||6e4);return mn.trans?mn.trans.waitFor(n):n},Promise:L,debug:{get:function(){return Kt},set:function(e){j(e,"dexie"===e?function(){return!0}:In)}},derive:f,extend:a,props:l,override:d,Events:me,getByKeyPath:v,setByKeyPath:b,delByKeyPath:function(e,t){"string"==typeof t?b(e,t,void 0):"length"in t&&[].map.call(t,(function(t){b(e,t,void 0)}))},shallowClone:T,deepClone:q,getObjectDiff:_,asap:m,minKey:-1/0,addons:[],connections:On,errnames:Ht,dependencies:function(){try{return{indexedDB:qt.indexedDB||qt.mozIndexedDB||qt.webkitIndexedDB||qt.msIndexedDB,IDBKeyRange:qt.IDBKeyRange||qt.webkitIDBKeyRange}}catch(e){return{indexedDB:null,IDBKeyRange:null}}}(),semVer:"3.0.1",version:"3.0.1".split(".").map((function(e){return parseInt(e)})).reduce((function(e,t,n){return e+t/Math.pow(10,2*n)})),default:Qn,Dexie:Qn})),Qn.maxKey=Ce(Qn.dependencies.IDBKeyRange),function(e){try{kn=function(e){var t,n=e&&"function"==typeof e.databases;if(!n){var r=new zn(Bn,{addons:[]});r.version(1).stores({dbnames:"name"}),t=r.table("dbnames")}return{getDatabaseNames:function(){return n?L.resolve(e.databases()).then((function(e){return e.map((function(e){return e.name})).filter((function(e){return e!==Bn}))})):t.toCollection().primaryKeys()},add:function(e){return!n&&e!==Bn&&t.put({name:e}).catch(O)},remove:function(e){return!n&&e!==Bn&&t.delete(e).catch(O)}}}(e)}catch(e){}}(zn.dependencies.indexedDB),L.rejectionMapper=function(e,t){if(!e||e instanceof S||e instanceof TypeError||e instanceof SyntaxError||!e.name||!Xt[e.name])return e;var n=new Xt[e.name](t||e.message,e);return"stack"in e&&p(n,"stack",{get:function(){return this.inner.stack}}),n},j(Kt,In);var Yn=function(){var e=new zn("IDBCache",{autoOpen:!1});this.isSupported=function(){var e=window.indexedDB||window.mozIndexedDB||window.webkitIndexedDB||window.msIndexedDB,t=window.IDBKeyRange||window.webkitIDBKeyRange,n=window.IDBCursor||window.webkitIDBCursor,r=function(){var e=window.navigator.userAgent,t=e.indexOf("MSIE ");if(0<t)return parseInt(e.substring(t+5,e.indexOf(".",t)),10);if(0<e.indexOf("Trident/")){var n=e.indexOf("rv:");return parseInt(e.substring(n+3,e.indexOf(".",n)),10)}var r=e.indexOf("Edge/");return!!(0<r)&&parseInt(e.substring(r+5,e.indexOf(".",r)),10)}(),i=function(){if(navigator.userAgent.match(/Safari/i)&&0==!navigator.userAgent.match(/Chrome/i))return!1;var e=navigator.userAgent.toLowerCase();return(e=e.substring(e.indexOf("version/")+8)).substring(0,e.indexOf("."))}(),s=!!navigator.userAgent.match(/iPad|iPhone|iPod/i);return navigator.userAgent.match(/PhantomJS/i)?e&&t&&n:e&&t&&n&&!(!1!==r&&11>r)&&!s&&!(!1!==i&&10>i)},this.addResponse=function(t,n,r,i){return e.responseTable.put({etag:r,data:n,timestamp:$.now(),chunks:i?parseInt(i,10):null},t)},this.getResponse=function(t){return e.responseTable.get(t)},this.addBatchResponse=function(t,n,r,i){return e.batchedResponseTable.put({id:t+n,batch:n,data:r,timestamp:$.now(),chunks:i?parseInt(i,10):null})},this.getBatchResponse=function(t,n){return e.batchedResponseTable.get(t+n)},this.deleteBatchResponses=function(t){return e.batchedResponseTable.where("batch").equals(t).delete()},this.clear=function(){return Promise.all([e.responseTable.clear(),e.batchedResponseTable.clear()])},this.clearResponseTable=function(){return Promise.all([e.responseTable.clear()])},this.initDB=function(){return e.version(.1).stores({responseTable:""}),e.version(.2).stores({batchResponseTable:"&[id+batch],batch"}),e.version(.3).stores({batchedResponseTable:"id,batch",batchResponseTable:null}),e.open()},this.deleteDB=function(){return e.delete()},this.close=function(){return e.close()},this.isOpen=function(){return e.isOpen()},this.dumpTableContent=function(){var e=at(regeneratorRuntime.mark((function e(t){var n,r;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=function(e,t){return"timestamp"===e?window&&window.BIMPLUS_SDK_ENABLE_IDBCACHE_TIMESTAMP_DUMP?t:"NOT SHOWN":"data"===e?window&&window.BIMPLUS_SDK_ENABLE_IDBCACHE_DATA_DUMP?t:"NOT SHOWN":t},r="",e.next=4,t.each((function(e){r+=" ".concat(JSON.stringify(e,n),"\n")}));case 4:return e.abrupt("return",r);case 5:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),this.dumpTable=function(){var e=at(regeneratorRuntime.mark((function e(t){var n,r,i,s;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,t.toCollection().count();case 2:return n=e.sent,r=[t.schema.primKey].concat(t.schema.indexes),i=r.map((function(e){return e.src})).join(","),s="Table: ".concat(t.name,", Schema: '").concat(i,"', Count of entries: ").concat(n,"\n"),e.t0=s,e.next=9,this.dumpTableContent(t);case 9:return s=e.t0+=e.sent,e.abrupt("return",s);case 11:case"end":return e.stop()}}),e,this)})));return function(){return e.apply(this,arguments)}}(),this.dumpDatabase=at(regeneratorRuntime.mark((function t(){var n;return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return n="",n+="BimWebSdk: Dexie Databases Dump\n",n+="===============================\n",n+="Database: ".concat(e.name," (Version: ").concat(e.verno,")\n"),t.t0=n,t.next=7,this.dumpTable(e.responseTable);case 7:return n=t.t0+=t.sent,t.t1=n,t.next=11,this.dumpTable(e.batchedResponseTable);case 11:return n=t.t1+=t.sent,t.abrupt("return",n);case 13:case"end":return t.stop()}}),t,this)})))},$n=function(){var e=null,t=null,n=new Yn;n.initDB().then((function(){window.BIMPLUS_SDK_ENABLE_IDBCACHE_DUMP&&n.dumpDatabase().then((function(){}))})).catch((function(){})),this.setAccessToken=function(t){e=t},this.setTokenType=function(e){t=e},this.getCache=function(){return n};var u=function(e,t,r){var i=r.getResponseHeader("ETag"),s=r.getResponseHeader("X-Total-Count"),o="arraybuffer"===r.responseType;if(i){var u=0==o?JSON.stringify(t):null;n.addResponse(e,o?t:JSON.parse(u),i,s).then((function(){})).catch((function(){}))}},a=function(e){return"W"===e.charAt(0)?e.substring(2):e};this.getBatchResponse=function(e,t,s){var o=$.Deferred(),u=s.useXMLHttpRequest?i:r;return n.getBatchResponse(e,t).then((function(r){if(r){var i={};return null!==r.chunks&&(i["Cached-X-Total-Count"]=r.chunks),i.status=304,void o.resolve(r.data,304,i)}u(e,"GET",null,s).done((function(r,i,s){var u=s.getResponseHeader("X-Total-Count"),a="arraybuffer"===s.responseType,c=!1===a?JSON.stringify(r):null;n.addBatchResponse(e,t,a?r:JSON.parse(c),u).then((function(){})).catch((function(){})),o.resolve(r,i,s)})).fail((function(e,t){o.reject(e,t)}))})),o.promise()},this.get=function(o,c){if(c||(c={}),c.token||(c.token=e),c.tokenType&&c.tokenType===t||(c.tokenType=t),c.queryParams&&(o+=s(c.queryParams)),c.responseBatch)return this.getBatchResponse(o,c.responseBatch,c);var l=$.Deferred(),p=c.useXMLHttpRequest?i:r;return n.getResponse("GET;"+o).then((function(e){if(e){var t=a(e.etag);c.eTag=t,p(o,"GET",null,c).done((function(t,n,r){304===r.status?(null!==e.chunks&&(r["Cached-X-Total-Count"]=e.chunks),l.resolve(e.data,n,r)):(u("GET;"+o,t,r),l.resolve(t,n,r))})).fail((function(e,t){l.reject(e,t)}))}else p(o,"GET",null,c).done((function(e,t,n){u("GET;"+o,e,n),l.resolve(e,t,n)})).fail((function(e,t){l.reject(e,t)}))})).catch((function(){p(o,"GET",null,c).done((function(e,t,n){u("GET;"+o,e,n),l.resolve(e,t,n)})).fail((function(e,t){l.reject(e,t)}))})),l.promise()},this.getChunked=function(t,n){return o(this,e,"medium",t,n)},this.put=function(n,i,o){return o||(o={}),o.token||(o.token=e),o.tokenType&&o.tokenType===t||(o.tokenType=t),o.queryParams&&(n+=s(o.queryParams)),r(n,"PUT",i,o)},this.post=function(n,o,u){return u||(u={}),u.token||(u.token=e),u.tokenType&&u.tokenType===t||(u.tokenType=t),u.queryParams&&(n+=s(u.queryParams)),(u.useXMLHttpRequest?i:r)(n,"POST",o,u)},this.del=function(n,i,o){return o||(o={}),i||(o.contentType=null),o.dataType=null,o.token||(o.token=e),o.tokenType&&o.tokenType===t||(o.tokenType=t),o.queryParams&&(n+=s(o.queryParams)),r(n,"DELETE",i||null,o)},this.head=function(i,o){o||(o={}),o.contentType="",o.dataType="",o.token||(o.token=e),o.tokenType&&o.tokenType===t||(o.tokenType=t),o.queryParams&&(i+=s(o.queryParams));var c=$.Deferred();return n.getResponse("HEAD;"+i).then((function(e){if(e){var t=a(e.etag);o.eTag=t,r(i,"HEAD",null,o).done((function(e,t,n){304===n.status?c.resolve(!0,t,n):(u("HEAD;"+i,null,n),c.resolve(!1,t,n))})).fail((function(e,t){c.reject(e,t)}))}else r(i,"HEAD",null,o).done((function(e,t,n){u("HEAD;"+i,null,n),c.resolve(!1,t,n)})).fail((function(e,t){c.reject(!1,t)}))})).catch((function(){r(i,"HEAD",null,o).done((function(e,t,n){u("HEAD;"+i,null,n),c.resolve(!1,t,n)})).fail((function(e,t){c.reject(!1,t)}))})),c.promise()}},Zn=function(e){this.detectAllClashes=function(t){return e.request.post(e.getApiTeamUrl()+"services/postprocess",t)},this.detectDisciplinesClashes=function(t){return e.request.post(e.getApiTeamUrl()+"clashdetection",t)},this.getFilters=function(t,n){var r={queryParams:{customFilter:n}};return t?e.request.get(e.getApiTeamUrl()+"clashdetection/filters/"+t,n?r:null):e.request.get(e.getApiTeamUrl()+"clashdetection/filters",n?r:null)},this.calculateClashes=function(t,n,r){if(n||r){var i={queryParams:{}};return n&&(i.queryParams.topology=n),r&&(i.queryParams.clashElements=r),e.request.post(e.getApiTeamUrl()+"clashdetection/filters",t,i)}return e.request.post(e.getApiTeamUrl()+"clashdetection/filters",t)},this.getFilterResults=function(t,n,r,i){if(r||i){var s={queryParams:{}};return r&&(s.queryParams.topology=r),i&&(s.queryParams.clashElements=i),e.request.get(e.getApiTeamUrl()+"clashdetection/projects/"+t+"/filters/"+n,s)}return e.request.get(e.getApiTeamUrl()+"clashdetection/projects/"+t+"/filters/"+n)},this.createClashRule=function(t,n){return e.request.post(e.getApiTeamUrl()+"projects/"+t+"/clashfilters",JSON.stringify(n))},this.deleteClashRule=function(t,n){return e.request.del(e.getApiTeamUrl()+"clashfilters/"+t,null,n?{queryParams:{force:n}}:null)},this.updateClashRule=function(t,n){return e.request.put(e.getApiTeamUrl()+"clashfilters/"+t,JSON.stringify(n))},this.getAllClashRules=function(t,n){return e.request.get(e.getApiTeamUrl()+"projects/"+t+"/clashfilters",n?{queryParams:{customFilter:n}}:null)}},er=function(e){this.post=function(t){return e.request.post(e.getApiTeamUrl()+"clientlogs",JSON.stringify([{message:t}]))},this.postExtended=function(t,n,r,i){return e.request.post(e.getApiTeamUrl()+"clientlogs",JSON.stringify([{message:t,applicationclass:n,releaseversion:r,projectid:i}]))},this.postArray=function(t){return e.request.post(e.getApiTeamUrl()+"clientlogs",JSON.stringify(t))},this.get=function(){return e.request.get(e.getApiTeamUrl()+"clientlogs")}},tr=function(e){this.get=function(t){return e.request.get(e.getApiTeamUrl()+"comments/"+t)},this.delete=function(t){return e.request.del(e.getApiTeamUrl()+"comments/"+t)},this.put=function(t,n){return e.request.put(e.getApiTeamUrl()+"comments/"+t,n)}},nr=function(e){this.get=function(t,n,r){var i=e.getApiTeamUrl()+"objects/"+t+"/customtables";n&&(i+="?variantId="+n);var s={};return r&&(s.queryParams={revision:r}),e.request.get(i,r?s:void 0)},this.post=function(t,n){return e.request.post(e.getApiTeamUrl()+"objects/"+t+"/customtables",n)}},rr=function(e){this.get=function(t){return e.request.get(e.getApiTeamUrl()+"dimensionlines/"+t)},this.delete=function(t){return e.request.del(e.getApiTeamUrl()+"dimensionlines/"+t)},this.put=function(t,n){return e.request.put(e.getApiTeamUrl()+"dimensionlines/"+t,n)}},ir=function(e){this.get=function(t){return t?e.request.get(e.getApiTeamUrl()+"element-types/"+t):e.request.get(e.getApiTeamUrl()+"element-types")},this.getDisciplines=function(t){return t?e.request.get(e.getApiTeamUrl()+"element-types/disciplines/"+t):e.request.get(e.getApiTeamUrl()+"element-types/disciplines")},this.getAttributeTemplates=function(t,n){return t?e.request.get(e.getApiTeamUrl()+"element-types/"+t+"/attributetemplates",n?{queryParams:n}:void 0):e.request.get(e.getApiTeamUrl()+"element-types/attributetemplates",n?{queryParams:n}:void 0)},this.getTopology=function(){return e.request.get(e.getApiTeamUrl()+"element-types/topology")},this.getProjectTopology=function(t){return e.request.get(e.getApiTeamUrl()+"projects/"+t+"/element-types")}},sr=function(e){this.exportObjects=function(t,n){return e.request.get(e.getApiTeamUrl()+"projects/"+t+"/objects/export/excel?typeId="+n)},this.exportModel=function(t,n,r,i,s){return e.request.post("".concat(e.getApiTeamUrl(),"projects/").concat(t,"/model/").concat(n,"/exportasync").concat(r?"?revision="+r:"").concat(i?r?"&emptyPropExport=1":"?emptyPropExport=1":"").concat(s?r||i?"&propSetExport=1":"?propSetExport=1":""),null,{contentType:!1,processData:!1,dataType:null})},this.exportSelection=function(t,n,r){return e.request.post("".concat(e.getApiTeamUrl(),"selections/").concat(t,"/exportasync?emptyPropExport=").concat(n,"&propSetExport=").concat(r))},this.createExportSelection=function(t,n){return e.request.post("".concat(e.getApiTeamUrl(),"projects/").concat(t,"/exportobjects"),n)}},or=function(e){this.getAccessRights=function(t){return e.request.get(e.getApiTeamUrl()+"folders/"+t+"/rights")},this.setMemberAccessRights=function(t,n,r){return e.request.put(e.getApiTeamUrl()+"folders/"+t+"/rights?assignrecursive="+(r?"true":"false"),n)}},ur=function(e){var t=function(t){return t?e.getApiUrl()+"content/freeattributegroups/":e.getApiTeamUrl()+"freeattributegroups/"};this.post=function(n,r){return e.request.post(t(r),n)},this.get=function(n,r){return n?e.request.get(t(r)+n):e.request.get(t(r))},this.put=function(n,r,i){return e.request.put(t(i)+n,r)},this.delete=function(n,r){return e.request.del(t(r)+n)},this.getFreeAttributes=function(n,r){return e.request.get(t(r)+n+"/freeattributes")}},ar=function(e){var t=function(t){return t?e.getApiUrl()+"content/freeattributes/":e.getApiTeamUrl()+"freeattributes/"};this.post=function(n,r){return e.request.post(t(r),n)},this.get=function(n,r,i){return n?e.request.get(t(r)+n,i?{queryParams:i}:void 0):e.request.get(t(r),i?{queryParams:i}:void 0)},this.put=function(n,r,i){return e.request.put(t(i)+n,r)},this.delete=function(n,r){return e.request.del(t(r)+n)},this.getTopology=function(n){return e.request.get(t(n)+"?topology=true")},this.getFilteredAttributes=function(t,n,r){var i=e.getApiTeamUrl();return t&&(i+="projects/".concat(t,"/")),i+="attributes?",n&&(i+="layer=".concat(n,"&")),r&&(i+="type=".concat(r)),e.request.get(i)}},cr=function(e){this.calculate=function(t,n,r,i,s){return e.request.post(e.getApiTeamUrl()+"services/Hiddencalculation",JSON.stringify({hiddenCalculation:{projectId:t,calculationMode:"View",view:n,clippingPlanes:r,clipRegion:{clipFace:!1},light:{useLight:!0,elevationAngle:45,sideAngle:60,useShadows:!1},propertySettings:{faceMode:"Filling",calcLines:!0},responseSettings:{mode:"Svg",svgHeight:390,svgWidth:500,fileName:i},sectionSettings:{}},runAsync:s}))}},lr=function(e){this.get=function(t){return e.request.get(e.getApiTeamUrl()+"hyperlinks/"+t)},this.delete=function(t){return e.request.del(e.getApiTeamUrl()+"hyperlinks/"+t)},this.put=function(t,n){return e.request.put(e.getApiTeamUrl()+"hyperlinks/"+t,n)}},pr=function(e){this.postModel=function(t,n,r,i){return e.request.post(e.getApiTeamUrl()+"projects/"+t+"/model/"+n+"/importasync",r,{preparedData:r,contentType:!1,processData:!1,dataType:null,xhrUploadProgress:i})},this.postModelLandXML=function(t,n,r,i){return e.request.post(e.getApiTeamUrl()+"projects/"+t+"/model/"+n+"/landxmlasync",r,{preparedData:r,contentType:!1,processData:!1,dataType:null,xhrUploadProgress:i})}},fr=function(e){this.post=function(t,n){return e.request.post(e.getApiTeamUrl()+"projects/"+t+"/issues",n)},this.get=function(t){return e.request.get(e.getApiTeamUrl()+"issues/"+t)},this.postPin=function(t,n){return e.request.post(e.getApiTeamUrl()+"issues/"+t+"/pins",n)},this.getPins=function(t){return e.request.get(e.getApiTeamUrl()+"issues/"+t+"/pins")},this.deletePins=function(t){return e.request.del(e.getApiTeamUrl()+"issues/"+t+"/pins")},this.postComment=function(t,n){return e.request.post(e.getApiTeamUrl()+"issues/"+t+"/comments",n)},this.getComments=function(t){return e.request.get(e.getApiTeamUrl()+"issues/"+t+"/comments")},this.deleteComments=function(t){return e.request.del(e.getApiTeamUrl()+"issues/"+t+"/comments")},this.postAttachment=function(t,n){return e.request.post(e.getApiTeamUrl()+"issues/"+t+"/attachments",n)},this.getAttachments=function(t){return e.request.get(e.getApiTeamUrl()+"issues/"+t+"/attachments")},this.deleteAttachments=function(t){return e.request.del(e.getApiTeamUrl()+"issues/"+t+"/attachments")},this.put=function(t,n){return e.request.put(e.getApiTeamUrl()+"issues/"+t,n)},this.delete=function(t,n){return e.request.del(e.getApiTeamUrl()+"issues/"+t,null,n?{queryParams:{forceDelete:n}}:null)},this.getRights=function(t){return e.request.get(e.getApiTeamUrl()+"issues/"+t+"/rights")},this.getIssueTypes=function(){return e.request.get(e.getApiTeamUrl()+"lib/issuetypes")},this.getReports=function(t){return e.request.get(e.getApiTeamUrl()+"issues/"+t+"/reports")},this.importBcf=function(t,n){return e.request.put(e.getApiTeamUrl()+"projects/"+t+"/issues/bcf",n,{contentType:!1,processData:!1})},this.updateImportBcf=function(t,n){return e.request.put(e.getApiTeamUrl()+"projects/"+t+"/issues/bcf",n)},this.exportBcf=function(t,n,r){return t?e.request.post(e.getApiTeamUrl()+"projects/"+t+"/issues/export/bcf"+(r?"?version="+r:""),n):e.request.post(e.getApiTeamUrl()+"issues/export/bcf"+(r?"?version="+r:""),n)},this.exportExcel=function(t,n){return t?e.request.post(e.getApiTeamUrl()+"projects/"+t+"/issues/export/excel",n):e.request.post(e.getApiTeamUrl()+"issues/export/excel",n)}},hr=function(e){this.get=function(t){return e.request.get(e.getApiTeamUrl()+"labels/"+t)},this.delete=function(t){return e.request.del(e.getApiTeamUrl()+"labels/"+t)},this.put=function(t,n){return e.request.put(e.getApiTeamUrl()+"labels/"+t,n)}},dr=function(e){this.lockObject=function(t,n){return e.request.put(e.getApiTeamUrl()+"objects/"+t+"/locks",n,{dataType:"text"})},this.checkLocked=function(t){return e.request.get(e.getApiTeamUrl()+"objects/"+t+"/locks")},this.deleteLock=function(t,n){return!0===n?e.request.del(e.getApiTeamUrl()+"objects/"+t+"/locks?asAdmin=true"):e.request.del(e.getApiTeamUrl()+"objects/"+t+"/locks")},this.getLocksWithChildren=function(t){return e.request.get(e.getApiTeamUrl()+"objects/"+t+"/locks?withChildren=true")}},gr=function(e){this.post=function(t){return e.request.post(e.getApiTeamUrl()+"members",t)},this.get=function(){return e.request.get(e.getApiTeamUrl()+"members")},this.putUser=function(t,n,r){return e.request.put(e.getApiTeamUrl()+"members/"+n,r)},this.deleteUser=function(t,n){return e.request.del(e.getApiTeamUrl()+"members/"+n)}},mr=function(e){this.post=function(t){return e.request.post(e.getApiUrl()+"messages",t)},this.getUserMessages=function(t){return e.request.get(e.getApiUrl()+"user/"+t+"/messages")},this.getUserDashboardMessages=function(t){return e.request.get(e.getApiUrl()+"user/"+t+"/messages?topic=dashboard")},this.getSentUserMessages=function(t){return e.request.get(e.getApiUrl()+"user/"+t+"/messages/sent")},this.getSentGroupMessages=function(t){return e.request.get(e.getApiUrl()+"user/"+t+"/messages/groupsent")},this.get=function(t){return e.request.get(e.getApiUrl()+"messages/"+t)},this.getFiltered=function(t){return e.request.get(e.getApiUrl()+"messages/",{queryParams:{filter:t}})},this.deleteMessage=function(t){return e.request.del(e.getApiUrl()+"messages/"+t)},this.markAsRead=function(t){return e.request.post(e.getApiUrl()+"messages/"+t+"/markasreadbrowser",null,{dataType:null,contentType:null})},this.updateDashboardAdditionalData=function(t,n){return e.request.put(e.getApiUrl()+"messages/"+t+"/updatedashboardadditionaldata",n)},this.addDashboardMessageAttachment=function(t,n,r){return e.request.put(e.getApiUrl()+"messages/"+t+"/upload?type=dashboard",n,r)},this.getAllMessagingGroups=function(){return e.request.get(e.getApiUrl()+"systemgroups")},this.getMessagingGroupsDetails=function(t){return e.request.get(e.getApiUrl()+"systemgroups/"+t)}},yr=function(e){this.get=function(t){return t?e.request.get(e.getApiTeamUrl()+"divisions/"+t):e.request.get(e.getApiTeamUrl()+"divisions")},this.head=function(t){return e.request.head?e.request.head(e.getApiTeamUrl()+"divisions/"+t):new Promise((function(e){e(!1)}))},this.getDisciplines=function(t){return e.request.get(e.getApiTeamUrl()+"divisions/"+t+"/disciplines")},this.setDisciplineValidity=function(t,n,r){return e.request.put(e.getApiTeamUrl()+"divisions/"+t+"/disciplines/"+n,JSON.stringify({private:!r}))},this.getRevisions=function(t){return e.request.get(e.getApiTeamUrl()+"divisions/"+t+"/revisions")},this.postRevision=function(t,n){return e.request.post(e.getApiTeamUrl()+"divisions/"+t+"/revisions",n)},this.put=function(t,n){return e.request.put(e.getApiTeamUrl()+"divisions/"+t,n)},this.download=function(t){return e.request.get(e.getApiTeamUrl()+"divisions/"+t+"/download")},this.delete=function(t){return e.request.del(e.getApiTeamUrl()+"divisions/"+t)},this.move=function(t,n){return e.request.put(e.getApiTeamUrl()+"divisions/"+t+"/move",n)}},vr=["topology","structure"],br=function(e){this.get=function(t,n){var r={};return t&&(r.object_id=t),n&&(r.project_id=n),e.request.get(e.getApiTeamUrl()+"settings/filters",{queryParams:r})},this.getFilteredObjects=function(t,n,r,i){if(!r){if(i&&vr.find((function(e){return e===i}))){var s={};return s[i]=!0,e.request.get(e.getApiTeamUrl()+"projects/"+t+"/filters/"+n,{queryParams:s})}return e.request.get(e.getApiTeamUrl()+"projects/"+t+"/filters/"+n)}return e.request.get(e.getApiTeamUrl()+"projects/"+t+"/filters/"+n+"/properties",{queryParams:r})},this.getSelectionFilteredObjects=function(t,n,r,i){if(!r){if(i&&vr.find((function(e){return e===i}))){var s={};return s[i]=!0,e.request.get(e.getApiTeamUrl()+"selections/"+t+"/filters/"+n,{queryParams:s})}return e.request.get(e.getApiTeamUrl()+"selections/"+t+"/filters/"+n)}return e.request.get(e.getApiTeamUrl()+"selections/"+t+"/filters/"+n+"/properties",{queryParams:r})},this.applyFilter=function(t){return e.request.get(e.getApiTeamUrl()+"filters/"+t)},this.post=function(t,n){var r={};return n&&(r.project_id=n),e.request.post(e.getApiTeamUrl()+"settings/filter",t,{queryParams:r})},this.put=function(t){return e.request.put(e.getApiTeamUrl()+"settings/filter",t)},this.delete=function(t){return e.request.del(e.getApiTeamUrl()+"settings/filter/"+t)},this.getFilter=function(t){return e.request.get(e.getApiTeamUrl()+"settings/filters/"+t)}},Tr=function(e){this.post=function(t){return e.request.post(e.getApiTeamUrl()+"objects/",t)},this.get=function(t,n,r,i,s,o){var u={};n&&(u.queryParams={revision:n}),i&&(u.queryParams?u.queryParams.projectId=i:u.queryParams={projectId:i}),s&&(u.queryParams?u.queryParams.shortinfo=s:u.queryParams={shortinfo:s}),o&&(u.queryParams?u.queryParams.type=o:u.queryParams={type:o});var a=e.getApiTeamUrl()+"objects/"+t;return r&&(a+="/properties/",a+=r),e.request.get(a,n||i||s||o?u:void 0)},this.getInternal=function(t,n){var r={};n&&(r.queryParams={revision:n});var i=e.getApiTeamUrl()+"objects/"+t;return i+="/internal",e.request.get(i,n?r:void 0)},this.head=function(t,n){var r={};return n&&(r.queryParams={revision:n}),e.request.head?e.request.head(e.getApiTeamUrl()+"objects/"+t,n?r:void 0):e.request.get(e.getApiTeamUrl()+"objects/"+t,n?r:void 0)},this.getTopology=function(t,n,r,i,s){var o={};return(n||r||i)&&(o.queryParams={},n&&(o.queryParams.revision=n),r&&(o.queryParams.hideElements=r),i&&(o.queryParams.shortinfo=i)),s&&(o.responseBatch=s),e.request.get(e.getApiTeamUrl()+"objects/"+t+"/topology",o)},this.getGeometryThreeJS=function(t,n,r,i,s,o,u){var a,c={};return(null!==i||null!==s)&&(c.queryParams={},null!==i&&(c.queryParams.revision=i),null!==s&&(c.queryParams.levelofdetail=s)),u&&(c.responseBatch=u),a=n?e.getApiTeamUrl()+"objects/"+t+"/disciplines/"+n+"/geometries/threejs":e.getApiTeamUrl()+"objects/"+t+"/geometries/threejs",o&&(a+="/properties/",a+=o),r?e.request.getChunked(a,c):e.request.get(a,c)},this.getGeometryGLB=function(t,n,r,i,s,o,u,a,c){var l,p={};return p.dataType="binary",p.processData=!1,p.responseType="arraybuffer",p.useXMLHttpRequest=!0,(void 0!==r||void 0!==i||void 0!==s||void 0!==o||void 0!==u)&&(p.queryParams={},void 0!==r&&(p.queryParams.revision=r),void 0!==i&&(p.queryParams.levelofdetail=i),void 0!==s&&(p.queryParams.vertexNormals=s),void 0!==o&&(p.queryParams.smoothingAngle=o),void 0!==u&&(p.queryParams.topology=u)),a&&(p.responseBatch=a),l=n?e.getApiTeamUrl()+"objects/"+t+"/disciplines/"+n+"/geometries/glb":e.getApiTeamUrl()+"objects/"+t+"/geometries/glb",c?e.request.getChunked(l,p):e.request.get(l,p)},this.getGeometryTemplatesThreeJS=function(t,n,r,i,s,o){var u={};(null!==i||null!==s)&&(u.queryParams={},null!==i&&(u.queryParams.revision=i),null!==s&&(u.queryParams.levelofdetail=s)),o&&(u.responseBatch=o);var a=e.getApiTeamUrl()+"objects/"+t+"/disciplines/"+n+"/templates/threejs";return r?e.request.getChunked(a,u):e.request.get(a,u)},this.getGeometryCompressed=function(t,n){return n?e.request.get(e.getApiTeamUrl()+"objects/"+t+"/disciplines/"+n+"/geometries/meshblob"):e.request.get(e.getApiTeamUrl()+"objects/"+t+"/geometries/meshblob")},this.getProperties=function(t,n){return e.request.get(e.getApiTeamUrl()+"objects/"+t+"/geometries/threejs/properties"+n)},this.put=function(t,n,r){var i={};return r&&(i.projectid=r),e.request.put(e.getApiTeamUrl()+"objects/"+t,n,{queryParams:i})},this.postComment=function(t,n){return e.request.post(e.getApiTeamUrl()+"objects/"+t+"/comments",n)},this.getComments=function(t){return e.request.get(e.getApiTeamUrl()+"objects/"+t+"/comments")},this.deleteComments=function(t){return e.request.del(e.getApiTeamUrl()+"objects/"+t+"/comments")},this.postAttachment=function(t,n,r,i){return e.request.post(e.getApiTeamUrl()+"objects/"+t+"/attachments",n,{contentType:!1,processData:!1,dataType:null,xhrUploadProgress:r,queryParams:i?{DocumentFolderId:i}:void 0})},this.getAttachments=function(t,n){return e.request.get(e.getApiTeamUrl()+"objects/"+t+"/attachments",n?{queryParams:{revision:n}}:void 0)},this.deleteAttachments=function(t){return e.request.del(e.getApiTeamUrl()+"objects/"+t+"/attachments")},this.postAttachmentLink=function(t,n){return e.request.post(e.getApiTeamUrl()+"objects/"+t+"/attachmentlinks",n)},this.getAttachmentLinks=function(t){return e.request.get(e.getApiTeamUrl()+"objects/"+t+"/attachmentlinks")},this.deleteAttachmentLink=function(t,n){return e.request.del(e.getApiTeamUrl()+"objects/"+t+"/attachmentlinks/"+n)},this.postHyperlink=function(t,n){return e.request.post(e.getApiTeamUrl()+"objects/"+t+"/hyperlinks",n)},this.getHyperlinks=function(t){return e.request.get(e.getApiTeamUrl()+"objects/"+t+"/hyperlinks")},this.deleteHyperlinks=function(t){return e.request.del(e.getApiTeamUrl()+"objects/"+t+"/hyperlinks")},this.delete=function(t){return e.request.del(e.getApiTeamUrl()+"objects/"+t)},this.getAttributes=function(t,n,r,i){var s=n?"&documentversion="+n:"",o=i?"&revision="+i:"",u=r?"&projectid="+r:"",a=e.getApiTeamUrl()+"objects/"+t+"?freeattributes=true";return e.request.get(a+s+o+u)},this.getAttributesAsFlatStructure=function(t,n,r,i){var s=n?"&documentversion="+n:"",o=i?"&revision="+i:"",u=r?"&projectid="+r:"",a=e.getApiTeamUrl()+"objects/"+t+"?freeattributes=true&internal=true&attributedefinition=true";return e.request.get(a+s+o+u)},this.getAttributeValues=function(t,n){return e.request.get(e.getApiTeamUrl()+"objects/"+t+"/attributes/"+n+"?children=true")},this.getComplexPropertiesTopology=function(t,n){return e.request.get(e.getApiTeamUrl()+"objects/"+t+"/complexproperties"+(0<=n?"?revision="+n:""))},this.postThumbnail=function(t,n,r){return e.request.post(e.getApiTeamUrl()+"objects/"+t+"/thumbnail",n,{contentType:!1,processData:!1,dataType:null,xhrUploadProgress:r})},this.deleteThumbnail=function(t){return e.request.del(e.getApiTeamUrl()+"objects/"+t+"/thumbnail")},this.addChildObject=function(t){return e.request.post(e.getApiTeamUrl()+"objects/alter/",t)},this.getReports=function(t,n,r){return e.request.get(e.getApiTeamUrl()+"objects/"+t+"/reports?version="+n+"&action="+r)},this.exportExcelReports=function(t,n){return e.request.post(e.getApiTeamUrl()+"projects/"+t+"/reports/export/excel",n)},this.postDimensions=function(t,n){return e.request.post(e.getApiTeamUrl()+"objects/"+t+"/dimensionlines",n)},this.putDimensions=function(t,n){return e.request.put(e.getApiTeamUrl()+"objects/"+t+"/dimensionlines",n)},this.getDimensions=function(t){return e.request.get(e.getApiTeamUrl()+"objects/"+t+"/dimensionlines")},this.deleteDimensions=function(t){return e.request.del(e.getApiTeamUrl()+"objects/"+t+"/dimensionlines")},this.postLabels=function(t,n){return e.request.post(e.getApiTeamUrl()+"objects/"+t+"/labels",n)},this.putLabels=function(t,n){return e.request.put(e.getApiTeamUrl()+"objects/"+t+"/labels",n)},this.getLabels=function(t){return e.request.get(e.getApiTeamUrl()+"objects/"+t+"/labels")},this.deleteLabels=function(t){return e.request.del(e.getApiTeamUrl()+"objects/"+t+"/labels")},this.postAnnotations=function(t,n){return e.request.post(e.getApiTeamUrl()+"objects/"+t+"/annotations",n)},this.putAnnotations=function(t,n){return e.request.put(e.getApiTeamUrl()+"objects/"+t+"/annotations",n)},this.getAnnotations=function(t){return e.request.get(e.getApiTeamUrl()+"objects/"+t+"/annotations")},this.deleteAnnotations=function(t){return e.request.del(e.getApiTeamUrl()+"objects/"+t+"/annotations")}},Ar=function(e){this.get=function(t){return e.request.get(e.getApiTeamUrl()+"pins/"+t)},this.delete=function(t){return e.request.del(e.getApiTeamUrl()+"pins/"+t)},this.put=function(t,n){return e.request.put(e.getApiTeamUrl()+"pins/"+t,n)}},qr=function(e){this.get=function(){return e.request.get(e.getApiUrl()+"project-actions-rights/")}},wr=function(e){var t="projectattributetemplates";this.post=function(n){return e.request.post(e.getApiTeamUrl()+t,n)},this.get=function(n,r){var i=r?{queryParams:{default:r}}:null;return n?e.request.get(e.getApiTeamUrl()+t+"/"+n):e.request.get(e.getApiTeamUrl()+t,i)},this.put=function(n,r){return e.request.put(e.getApiTeamUrl()+t+"/"+n,r)},this.delete=function(n){return e.request.del(e.getApiTeamUrl()+t+"/"+n)},this.copyFrom=function(n,r){return e.request.put(e.getApiTeamUrl()+t+"/"+r+"/copyfrom",JSON.stringify({id:n}))},this.setDefault=function(n){return e.request.put(e.getApiTeamUrl()+t+"/"+n+"/default")}},_r=function(e){this.post=function(t){return e.request.post(e.getApiTeamUrl()+"projects",t)},this.createFromExisting=function(t){return e.request.post(e.getApiTeamUrl()+"projects/copyfrom",t)},this.put=function(t,n){return e.request.put(e.getApiTeamUrl()+"projects/"+t,n)},this.get=function(t,n,r,i,s){var o={queryParams:s||{}};return n&&(o.queryParams.disciplines=!1),i&&(o.queryParams.recycleBin=!0),t?e.request.get(e.getApiTeamUrl()+"projects/"+t,o):r?e.request.get(e.getApiUrl()+r+"/projects",o):e.getTeamSlug()?e.request.get(e.getApiTeamUrl()+"projects",o):e.request.get(e.getApiUrl()+"/projects",o)},this.delete=function(t){return e.request.del(e.getApiTeamUrl()+"projects/"+t)},this.moveToRecycleBin=function(t){return e.request.del(e.getApiTeamUrl()+"projects/"+t+"?moveToRecycleBin=true")},this.restoreFromRecycleBin=function(t){return e.request.put(e.getApiTeamUrl()+"objects/"+t+"/restore",JSON.stringify({}),{dataType:"text"})},this.deleteFromRecycleBin=function(t){return e.request.del(e.getApiTeamUrl()+"projects/"+t+"?fromRecycleBin=true")},this.deleteServerCache=function(t){return e.request.del(e.getApiTeamUrl()+"projects/"+t+"/deletecache")},this.clearServerDecimation=function(t,n,r){return n||(n="00000000-0000-0000-0000-000000000000"),0<=r&&""!==r||(r="100"),e.request.del(e.getApiTeamUrl()+"temporary/projects/"+t+"/disciplines/"+n+"/levelofdetails/"+r)},this.getModels=function(t){return e.request.get(e.getApiTeamUrl()+"projects/"+t+"/divisions")},this.postModel=function(t,n){return e.request.post(e.getApiTeamUrl()+"projects/"+t+"/divisions",n)},this.getMembers=function(t){return e.request.get(e.getApiTeamUrl()+"projects/"+t+"/members")},this.postMember=function(t,n){return e.request.post(e.getApiTeamUrl()+"projects/"+t+"/members",n)},this.putMember=function(t,n){return e.request.put(e.getApiTeamUrl()+"projects/"+t+"/members",n)},this.deleteMember=function(t,n){return e.request.del(e.getApiTeamUrl()+"projects/"+t+"/members",n)},this.getPins=function(t){return e.request.get(e.getApiTeamUrl()+"projects/"+t+"/pins")},this.putProject=function(t,n){return e.request.put(e.getApiTeamUrl()+"projects/"+t,n)},this.postAttachment=function(t,n){return e.request.post(e.getApiTeamUrl()+"projects/"+t+"/attachments",n)},this.getAttachments=function(t,n,r){var i=r;return i||(i={}),n&&(i.revision=n),e.request.get(e.getApiTeamUrl()+"projects/"+t+"/attachments",n||r?{queryParams:i}:void 0)},this.deleteAttachments=function(t){return e.request.del(e.getApiTeamUrl()+"projects/"+t+"/attachments")},this.getTopology=function(t){return e.request.get(e.getApiTeamUrl()+"projects/"+t+"/topology")},this.getSpots=function(t){return e.request.get(e.getApiTeamUrl()+"projects/"+t+"/pins")},this.postThumbnail=function(t,n,r){return e.request.post(e.getApiTeamUrl()+"projects/"+t+"/thumbnail",n,{contentType:!1,processData:!1,dataType:null,xhrUploadProgress:r})},this.getThumbnail=function(t){return e.request.get(e.getApiTeamUrl()+"thumbnail/"+t)},this.deleteThumbnail=function(t){return e.request.del(e.getApiTeamUrl()+"projects/"+t+"/thumbnail")},this.getComments=function(t){return e.request.get(e.getApiTeamUrl()+"projects/"+t+"/comments")},this.getHyperlinks=function(t){return e.request.get(e.getApiTeamUrl()+"projects/"+t+"/hyperlinks")},this.getIssues=function(t,n){return e.request.get(e.getApiTeamUrl()+"projects/"+t+"/issues"+(n?"?scene=false":""))},this.getIssuesShortInfo=function(t){var n=function(){var e=ct((new Date).toString().split("GMT"),2),t=e[0],n=e[1];if(!t||!n)return"";var r=new Date(t+"UTC").toISOString().split(".")[0],i=(n=n.split(" ")[0]).slice(0,3)+":"+n.slice(3);return r&&i?r+i:""}();return e.request.get(e.getApiTeamUrl()+"projects/"+t+"/issues?shortinfo=true"+(n?"&currenttime="+n:""))},this.postSlideshow=function(t,n){return e.request.post(e.getApiTeamUrl()+"projects/"+t+"/slideshows",n)},this.getSlideshows=function(t){return e.request.get(e.getApiTeamUrl()+"projects/"+t+"/slideshows")},this.deleteSlideshows=function(t){return e.request.del(e.getApiTeamUrl()+"projects/"+t+"/slideshows")},this.exportSlideshowToPDF=function(t,n){return e.request.post(e.getApiTeamUrl()+"projects/"+t+"/slideshow/export/pdf",JSON.stringify({slideShowId:n}))},this.getProjectInfo=function(t,n){var r={queryParams:n||{}};return e.request.get(e.getApiTeamUrl()+"projects/"+t,r)}},Ur=function(e){this.postRevision=function(t,n){return e.request.post(e.getApiTeamUrl()+"divisions/"+t+"/revisions",n)},this.getRevisionList=function(t){return e.request.get(e.getApiTeamUrl()+"divisions/"+t+"/revisions")},this.getRevisionInfo=function(t){return e.request.get(e.getApiTeamUrl()+"revisions/"+t)},this.postRevisionInfo=function(t,n){return e.request.post(e.getApiTeamUrl()+"revisions/"+t,n)},this.putRevisionInfo=function(t,n){return e.request.put(e.getApiTeamUrl()+"revisions/"+t,n)},this.getRevisionsComparisonResult=function(t,n,r,i){return e.request.get(e.getApiTeamUrl()+"divisions/"+t+"/revisionscomparison/"+n+"/"+r,i)},this.compareRevisions=function(t,n,r,i){return e.request.post(e.getApiTeamUrl()+"divisions/"+t+"/revisionscomparison/"+n+"/"+r,null,i)},this.excelExportRevisionsComparisonResult=function(t,n,r,i){return e.request.post(e.getApiTeamUrl()+"divisions/"+t+"/revisionscomparison/"+n+"/"+r+"/export/excel",i)}},jr=function(e){this.getRoles=function(t){return t?e.request.get(e.getApiTeamUrl()+"projects/"+t+"/members"):e.request.get(e.getApiTeamUrl()+"roles")},this.postUserRole=function(t,n){return e.request.post(e.getApiTeamUrl()+"projects/"+t+"/members",n)},this.putUserRole=function(t,n){return e.request.put(e.getApiTeamUrl()+"projects/"+t+"/members",n)},this.deleteUser=function(t){return e.request.del(e.getApiTeamUrl()+"projects/"+t+"/members")}},kr=function(e){this.get=function(t,n){if(t||n){var r={queryParams:{}};return void 0!==t&&(r.queryParams.rights=t),void 0!==n&&(r.queryParams.customrole=n),e.request.get(e.getApiTeamUrl()+"roles/",r)}return e.request.get(e.getApiTeamUrl()+"roles/")},this.getAllRights=function(t){if(t){var n={queryParams:{globalfreeattributes:t.globalfreeattributes,global:t.global,project:t.project,document:t.document,layer:t.layer}};return e.request.get(e.getApiTeamUrl()+"rights",n)}return e.request.get(e.getApiTeamUrl()+"rights")},this.post=function(t){return e.request.post(e.getApiTeamUrl()+"roles/",t)},this.getRoleDetails=function(t){return e.request.get(e.getApiTeamUrl()+"roles/"+t)},this.updateRole=function(t,n){return e.request.put(e.getApiTeamUrl()+"roles/"+t,n)},this.deleteRole=function(t){return e.request.del(e.getApiTeamUrl()+"roles/"+t)}},Pr=function(e){this.calculateCutSection=function(t){var n=!!(1<arguments.length&&void 0!==arguments[1])&&arguments[1],r=t.projectId,i=t.cuttingPlanes,s=t.modelLayer,o=t.topologyNodes,u=t.hiddenObjects,a=t.settings,c={cuttingCalculation:{projectId:r,cuttingPlanes:i,selection:{modelLayer:s,topologyNodes:o,hiddenObjects:u},settings:a},runAsync:n};return c.cuttingCalculation.settings&&c.cuttingCalculation.settings.responseGeometry&&"glb"===c.cuttingCalculation.settings.responseGeometry?e.request.post(e.getApiTeamUrl()+"services/CuttingCalculation",JSON.stringify(c),{useXMLHttpRequest:!0,dataType:"binary",processData:!1,responseType:"arraybuffer"}):e.request.post(e.getApiTeamUrl()+"services/CuttingCalculation",JSON.stringify(c))}},Sr=function(e){this.post=function(t){return e.request.post(e.getApiTeamUrl()+"share",t)}},xr=function(e){this.get=function(t){return e.request.get(e.getApiTeamUrl()+"slides/"+t)},this.put=function(t,n){return e.request.put(e.getApiTeamUrl()+"slides/"+t,n)},this.delete=function(t){return e.request.del(e.getApiTeamUrl()+"slides/"+t)},this.postThumbnail=function(t,n){return e.request.post(e.getApiTeamUrl()+"slides/"+t+"/thumbnail",n)}},Er=function(e){this.get=function(t){return e.request.get(e.getApiTeamUrl()+"slideshows/"+t)},this.put=function(t,n){return e.request.put(e.getApiTeamUrl()+"slideshows/"+t,n)},this.delete=function(t){return e.request.del(e.getApiTeamUrl()+"slideshows/"+t)},this.postSlide=function(t,n){return e.request.post(e.getApiTeamUrl()+"slideshows/"+t+"/slides",n)},this.getSlides=function(t){return e.request.get(e.getApiTeamUrl()+"slideshows/"+t+"/slides")},this.postThumbnail=function(t,n){return e.request.post(e.getApiTeamUrl()+"slideshows/"+t+"/thumbnail",n)},this.getThumbnail=function(t){return e.request.get(e.getApiTeamUrl()+"thumbnail/"+t)}},Dr=function(e){this.postStructure=function(t,n){return e.request.post(e.getApiTeamUrl()+"projects/"+t+"/structures",n)},this.postStructureTopology=function(t,n){return e.request.post(e.getApiTeamUrl()+"structures/"+t+"/topology",n)},this.postSubNode=function(t,n){return e.request.post(e.getApiTeamUrl()+"structures/"+t,n)},this.postAssignedObject=function(t,n,r,i){return e.request.post(e.getApiTeamUrl()+"structures/"+t+"/assign/"+n+"?varianttype="+r,i)},this.attributeAssign=function(t,n,r,i){var s={attributeId:r};return i&&(s.variantType=i),e.request.put(e.getApiTeamUrl()+"projects/"+t+"/structures/"+n+"/attributeassign",JSON.stringify(s))},this.deleteAssignedObject=function(t,n,r,i){var s=[i?"removeAllNodes=true":"",r?"varianttype=true":""].filter((function(e){return e})).join("&");return e.request.del(e.getApiTeamUrl()+"structures/"+t+"/delete/"+n+"?"+s)},this.getStructure=function(t,n,r){return n?e.request.get(e.getApiTeamUrl()+"structures/"+n):e.request.get(e.getApiTeamUrl()+"projects/"+t+"/structures"+(r?"?type="+r:""))},this.getTopology=function(t,n,r){return void 0===r||""===r?e.request.get(e.getApiTeamUrl()+"structures/"+t+"/topology?varianttype="+n):!0===r?e.request.get(e.getApiTeamUrl()+"structures/"+t+"/topology?varianttype="+n+"&attributes=true"):void 0},this.getTopologyStructure=function(t){return e.request.get(e.getApiTeamUrl()+"projects/"+t+"/topologystructure")},this.resetTopologyStructure=function(t){return e.request.put(e.getApiTeamUrl()+"projects/"+t+"/topologystructure/reset")},this.copyStructure=function(t,n,r){return e.request.post(e.getApiTeamUrl()+"structures/"+t+"/copy?elementRelation="+r+"&attributes=true",n)},this.putStructure=function(t,n,r){var i=r?"?applyToChild=true":"";return e.request.put(e.getApiTeamUrl()+"structures/"+t+i,n)},this.reorderStructure=function(t,n){return e.request.put(e.getApiTeamUrl()+"structures/"+t+"/reorder?varianttype="+n)},this.deleteStructure=function(t){return e.request.del(e.getApiTeamUrl()+"structures/"+t)},this.removeAllAssignedObjects=function(t){return e.request.del(e.getApiTeamUrl()+"structures/"+t+"/delete")},this.deleteAllProjectStructures=function(t){return e.request.del(e.getApiTeamUrl()+"projects/"+t+"/structures")},this.postVariantType=function(t,n){return e.request.post(e.getApiTeamUrl()+"projects/"+t+"/variants",n)},this.getVariantType=function(t,n){return n?e.request.get(e.getApiTeamUrl()+"projects/"+t+"/variants/"+n):e.request.get(e.getApiTeamUrl()+"projects/"+t+"/variants")},this.deleteVariantType=function(t,n){return e.request.del(e.getApiTeamUrl()+"projects/"+t+"/variants/"+n)},this.copyElementsToVariant=function(t,n,r){return e.request.put(e.getApiTeamUrl()+"projects/"+t+"/variants/"+n+"/copyfrom",r)}},Or=function(e){this.get=function(){return e.request.get(e.getApiUrl()+"team-actions-rights/")}},Cr=function(e){this.get=function(t){return t?e.request.get(e.getApiUrl()+"teams/"+t):e.request.get(e.getApiUrl()+"teams")},this.postTeam=function(t){return e.request.post(e.getApiUrl()+"teams",t)},this.putTeam=function(t){return e.request.put(e.getApiUrl()+"team",t)},this.deleteTeam=function(t){return e.request.del(e.getApiUrl()+"teams/"+t)},this.getAccountSettings=function(t){return e.request.get(e.getApiUrl()+"administration/teams/"+t+"/accountsettings")},this.getRestrictions=function(t){return e.request.get(e.getApiUrl()+"teams/"+t+"/restrictions")},this.deleteServerCache=function(){return e.request.del(e.getApiTeamUrl()+"deleteCache")}},Rr=function(e){this.get=function(t){return e.request.get(e.getApiUrl()+"terms/download",{queryParams:{language:t},dataType:"html"})}},Ir=function(e){this.get=function(t){return e.request.get(e.getApiUrl()+"dataprotectiondeclarations/download",{queryParams:{language:t},dataType:"html"})}},Br=function(e){this.get=function(t){return e.request.get(e.getApiUrl()+"imprints/download",{queryParams:{language:t},dataType:"html"})}},Kr=function(e){this.post=function(t){return e.request.post(e.getApiUrl()+"content/units/",t)},this.get=function(t){return t?e.request.get(e.getApiUrl()+"content/units/"+t):e.request.get(e.getApiUrl()+"content/units/")},this.put=function(t,n){return e.request.put(e.getApiUrl()+"content/units/"+t,n)},this.delete=function(t){return e.request.del(e.getApiUrl()+"content/units/"+t)}},Mr=function(e){this.get=function(t){return t?e.request.get(e.getApiUrl()+"user",{token:t}):e.request.get(e.getApiUrl()+"user")},this.put=function(t,n,r){var i=e.getApiUrl()+"user/";return t&&(i+=t),r?e.request.put(i,n,{token:r}):e.request.put(i,n)},this.post=function(t){return e.request.post(e.getApiUrl()+"user",t)},this.postPhoto=function(t){return e.request.post(e.getApiUrl()+"user/photo",t,{contentType:!1,processData:!1})},this.deletePhoto=function(){return e.request.del(e.getApiUrl()+"user/photo")},this.getPhoto=function(){return e.request.get(e.getApiUrl()+"user/photo")},this.putPassword=function(t){return e.request.put(e.getApiUrl()+"user/change_password",t)},this.getSubscriptions=function(t){return t?e.request.get(e.getApiUrl()+"user/accountsettings/"+t):e.request.get(e.getApiUrl()+"user/accountsettings")}},Nr=function(e){this.post=function(t){return e.request.post(e.getApiUrl()+"users",t)},this.exist=function(t){return e.request.get(e.getApiUrl()+"users/exist",{queryParams:{email:t}})},this.put=function(t,n){return e.request.put(e.getApiUrl()+"users/"+t,n)},this.delete=function(t){return e.request.del(e.getApiUrl()+"users/"+t)},this.setSubscriptions=function(t,n){return e.request.post(e.getApiUrl()+"administration/users/"+t+"/accountsettings",n)}},Fr=function(e){this.postSettings=function(t,n){return e.request.post(e.getApiTeamUrl()+"userSettings/"+t,n)},this.getSettings=function(t){return e.request.get(e.getApiTeamUrl()+"userSettings/"+t)}},Lr=function(e){this.get=function(t){return e.request.get(e.getApiTeamUrl()+"invitations/"+(t||""))},this.getProjectInvitations=function(t){return e.request.get("".concat(e.getApiTeamUrl(),"invitations?projectId=").concat(t))},this.post=function(t){return e.request.post(e.getApiTeamUrl()+"invitations/",t)},this.delete=function(t){return e.request.del(e.getApiTeamUrl()+"invitations/"+t)},this.put=function(t,n){return e.request.put(e.getApiTeamUrl()+"invitations/"+t,n)},this.accept=function(t,n){return e.request.put(e.getApiUrl()+"invitations/"+t+"/accept",n)},this.getInvitation=function(t,n){return e.request.get(e.getApiUrl()+"invitations/"+t,n)}},Gr=function(e){this.post=function(t,n){return e.request.post(e.getApiTeamUrl()+"projects/"+t+"/selections",n)},this.get=function(t){return e.request.get(e.getApiTeamUrl()+"selections/"+t)},this.getAllSelections=function(t){return e.request.get(e.getApiTeamUrl()+"projects/"+t+"/selections")},this.delete=function(t){return e.request.del(e.getApiTeamUrl()+"selections/"+t)}},Hr=function(e){this.postGroup=function(t,n){return e.request.post(e.getApiTeamUrl()+"projects/"+t+"/usergroups",n)},this.getGroups=function(t){return e.request.get(e.getApiTeamUrl()+"projects/"+t+"/usergroups")},this.getUsers=function(t){return e.request.get(e.getApiTeamUrl()+"usergroups/"+t)},this.deleteGroup=function(t){return e.request.del(e.getApiTeamUrl()+"usergroups/"+t)},this.putGroup=function(t,n){return e.request.put(e.getApiTeamUrl()+"usergroups/"+t,n)},this.assignUser=function(t,n){return e.request.put(e.getApiTeamUrl()+"usergroups/"+t+"/assign",n)},this.removeUser=function(t,n){return e.request.put(e.getApiTeamUrl()+"usergroups/"+t+"/remove",n)}},Vr=function(e){this.get=function(t){return e.request.get(e.getApiTeamUrl()+"scenes/"+t)},this.getObjectScenes=function(t){return e.request.get(e.getApiTeamUrl()+"objects/"+t+"/scenes")},this.post=function(t,n){return e.request.post(e.getApiTeamUrl()+"objects/"+t+"/scenes",n)},this.delete=function(t){return e.request.del(e.getApiTeamUrl()+"scenes/"+t)},this.put=function(t,n){return e.request.put(e.getApiTeamUrl()+"scenes/"+t,n)},this.postThumbnailAttachment=function(t,n,r,i){return e.request.post(e.getApiTeamUrl()+"objects/"+t+"/attachments",n,{contentType:!1,processData:!1,dataType:null,xhrUploadProgress:r,queryParams:i?{attachmenttype:"thumbnailhighresolution"}:void 0})},this.postThumbnail=function(t,n,r){return e.request.post(e.getApiTeamUrl()+"objects/"+t+"/attachments",n,{queryParams:r?{attachmenttype:"thumbnailhighresolution"}:void 0})},this.getThumbnail=function(t){return e.request.get(e.getApiTeamUrl()+"objects/"+t+"/attachments")}},Jr=function(e){this._config=null,e?(!e.version&&(e.version="v2"),this._config=e):this._config=Xr(),this._token=null,this._tokenType=null,this._teamSlug=null,this._cache=null,window.BIMPLUS_SDK_ENABLE_DEBUG_LOGS,this._config.cache?(this.request=new $n,this._cache=this.request.getCache(),!1===this._cache.isSupported()&&(this.request=new ht,this._cache=null)):this.request=new ht,this.setAccessToken=function(e){this._token=e,this.request.setAccessToken(e),window.BIMPLUS_SDK_ENABLE_DEBUG_LOGS},this.getAccessToken=function(){return this._token},this.setTokenType=function(e){this._tokenType=e,this.request.setTokenType(e),window.BIMPLUS_SDK_ENABLE_DEBUG_LOGS},this.getTokenType=function(){return this._tokenType},this.setAccessTokenAndType=function(e,t){this.setAccessToken(e),this.setTokenType(t)},this.getAccessTokenAndType=function(){return{token:this._token,tokenType:this._tokenType}},this.setTeamSlug=function(e){this._teamSlug=e,window.BIMPLUS_SDK_ENABLE_DEBUG_LOGS},this.getTeamSlug=function(){return this._teamSlug},this.getApiUrl=function(){return this._config.protocol+this._config.host+"/"+this._config.version+"/"},this.getApiTeamUrl=function(){return this._teamSlug,this.getApiUrl()+this._teamSlug+"/"},this.getCache=function(){return this._cache},this.authorize=new vt(this),this.user=new Mr(this),this.users=new Nr(this),this.teams=new Cr(this),this.members=new gr(this),this.projects=new _r(this),this.structures=new Dr(this),this.models=new yr(this),this.objects=new Tr(this),this.revisions=new Ur(this),this.elementTypes=new ir(this),this.annotations=new gt(this),this.attachments=new mt(this),this.issues=new fr(this),this.labels=new hr(this),this.pins=new Ar(this),this.comments=new tr(this),this.hyperlinks=new lr(this),this.importService=new pr(this),this.slideshows=new Er(this),this.slides=new xr(this),this.clashDetection=new Zn(this),this.clientLogs=new er(this),this.rightsService=new jr(this),this.applicationSettings=new dt(this),this.exportService=new sr(this),this.folders=new or(this),this.locks=new dr(this),this.share=new Sr(this),this.messages=new mr(this),this.objectFilters=new br(this),this.terms=new Rr(this),this.dataProtection=new Ir(this),this.dimensions=new rr(this),this.imprints=new Br(this),this.projectActionsRights=new qr(this),this.roles=new kr(this),this.attributeTemplates=new yt(this),this.units=new Kr(this),this.freeAttributes=new ar(this),this.freeAttributeGroups=new ur(this),this.hiddenCalculation=new cr(this),this.sectionCut=new Pr(this),this.projectAttributeTemplates=new wr(this),this.teamActionsRights=new Or(this),this.customTables=new nr(this),this.userSettings=new Fr(this),this.invitations=new Lr(this),this.selections=new Gr(this),this.userGroups=new Hr(this),this.scenes=new Vr(this)},Xr=function(e){var t="api.bimplus.net";return e&&(t="prod"===e?"api.bimplus.net":"dev"===e?"api-dev.bimplus.net":"stage"===e?"api-stage.bimplus.net":"api.bimplus.net"),{protocol:"https://",host:t,cache:!1,version:"v2"}}}])}));
package/install CHANGED
@@ -1,3 +1,3 @@
1
- #!/usr/bin/env bash
2
-
3
- yarn install
1
+ #!/usr/bin/env bash
2
+
3
+ yarn install
package/jsinspect CHANGED
@@ -1,20 +1,20 @@
1
- #!/usr/bin/env bash
2
-
3
- #install jsinspect
4
- npm list -g --quiet jsinspect > "/dev/null" 2>&1
5
- OUT=$?
6
- if [ ${OUT} != 0 ]
7
- then
8
- npm install -g jsinspect
9
- RET_VAL=$?
10
- if [ ${RET_VAL} -ne 0 ]
11
- then
12
- echo "Error ---> Unable to install \"jsinspect\""
13
- exit ${RET_VAL}
14
- fi
15
- echo "Info ---> \"jsinspect\" has been installed."
16
- else
17
- echo "Info ---> \"jsinspect\" already installed."
18
- fi
19
-
20
- jsinspect ./src
1
+ #!/usr/bin/env bash
2
+
3
+ #install jsinspect
4
+ npm list -g --quiet jsinspect > "/dev/null" 2>&1
5
+ OUT=$?
6
+ if [ ${OUT} != 0 ]
7
+ then
8
+ npm install -g jsinspect
9
+ RET_VAL=$?
10
+ if [ ${RET_VAL} -ne 0 ]
11
+ then
12
+ echo "Error ---> Unable to install \"jsinspect\""
13
+ exit ${RET_VAL}
14
+ fi
15
+ echo "Info ---> \"jsinspect\" has been installed."
16
+ else
17
+ echo "Info ---> \"jsinspect\" already installed."
18
+ fi
19
+
20
+ jsinspect ./src
package/package.json CHANGED
@@ -1,59 +1,59 @@
1
- {
2
- "name": "bimplus-websdk",
3
- "version": "0.0.174",
4
- "description": "bim+ websdk",
5
- "main": "dist/bimplus-websdk.js",
6
- "license": "MIT",
7
- "repository": {
8
- "type": "git",
9
- "url": "."
10
- },
11
- "scripts": {
12
- "eslint": "eslint src/**/*.js test/**/*.js",
13
- "build": "npm run eslint && webpack --config webpack.dev.js",
14
- "build-prod": "npm run eslint && webpack --config webpack.prod.js",
15
- "yarn-publish": "npm run build-prod && yarn publish",
16
- "yarn-publish-branch": "npm run build-prod && yarn publish --tag",
17
- "npm-pack": "npm run build-prod && npm pack",
18
- "install-documentation-package": "npm install -g documentation",
19
- "build-doc": "npm run install-documentation-package && documentation build ./src/Api/*.js --config doc_config.yml -f html -o ./documentation",
20
- "build-docMd": "npm run install-documentation-package && documentation build ./src/Api/*.js -f md -o ./documentation/Bimplus_WebSDK_doc.md",
21
- "build-docConf": "npm run build-docMd && cd ./documentation && python convert_to_confluence_md.py",
22
- "build-docAll": "npm run build-doc && npm run build-docConf",
23
- "test": "node node_modules/karma/bin/karma start",
24
- "test-chrome": "npm run test -- --single-run=true --browsers Chrome karma.conf.js",
25
- "test-chrome-headless": "npm run test -- --single-run=true --browsers ChromeHeadless karma.conf.js",
26
- "test-firefox": "npm run test -- --single-run=true --browsers Firefox karma.conf.js",
27
- "test-firefox-headless": "npm run test -- --single-run=true --browsers FirefoxHeadless karma.conf.js",
28
- "test-watch": "npm run test -- --browsers=Chrome --single-run=false --auto-watch"
29
- },
30
- "devDependencies": {
31
- "@babel/core": "^7.9.6",
32
- "@babel/plugin-transform-runtime": "^7.9.6",
33
- "@babel/polyfill": "^7.8.7",
34
- "@babel/preset-env": "^7.9.6",
35
- "@babel/runtime": "^7.9.6",
36
- "babel-loader": "^8.1.0",
37
- "babel-minify-webpack-plugin": "^0.3.1",
38
- "clean-webpack-plugin": "^3.0.0",
39
- "eslint": "^7.0.0",
40
- "istanbul-instrumenter-loader": "^3.0.1",
41
- "karma": "^5.0.9",
42
- "karma-chrome-launcher": "^3.1.0",
43
- "karma-coverage-istanbul-reporter": "^3.0.2",
44
- "karma-eslint": "^2.2.0",
45
- "karma-firefox-launcher": "^1.3.0",
46
- "karma-host-environment": "^3.0.3",
47
- "karma-jquery": "^0.2.4",
48
- "karma-qunit": "^4.1.1",
49
- "karma-webpack": "^4.0.2",
50
- "qunit": "^2.10.0",
51
- "webpack": "^4.43.0",
52
- "webpack-cli": "^3.3.11",
53
- "host-environment": "^2.1.2"
54
- },
55
- "dependencies": {
56
- "dexie": "3.0.1",
57
- "jquery": "3.5.1"
58
- }
59
- }
1
+ {
2
+ "name": "bimplus-websdk",
3
+ "version": "0.0.178",
4
+ "description": "bim+ websdk",
5
+ "main": "dist/bimplus-websdk.js",
6
+ "license": "MIT",
7
+ "repository": {
8
+ "type": "git",
9
+ "url": "."
10
+ },
11
+ "scripts": {
12
+ "eslint": "eslint src/**/*.js test/**/*.js",
13
+ "build": "npm run eslint && webpack --config webpack.dev.js",
14
+ "build-prod": "npm run eslint && webpack --config webpack.prod.js",
15
+ "yarn-publish": "npm run build-prod && yarn publish",
16
+ "yarn-publish-branch": "npm run build-prod && yarn publish --tag",
17
+ "npm-pack": "npm run build-prod && npm pack",
18
+ "install-documentation-package": "npm install -g documentation",
19
+ "build-doc": "npm run install-documentation-package && documentation build ./src/Api/*.js --config doc_config.yml -f html -o ./documentation",
20
+ "build-docMd": "npm run install-documentation-package && documentation build ./src/Api/*.js -f md -o ./documentation/Bimplus_WebSDK_doc.md",
21
+ "build-docConf": "npm run build-docMd && cd ./documentation && python convert_to_confluence_md.py",
22
+ "build-docAll": "npm run build-doc && npm run build-docConf",
23
+ "test": "node node_modules/karma/bin/karma start",
24
+ "test-chrome": "npm run test -- --single-run=true --browsers Chrome karma.conf.js",
25
+ "test-chrome-headless": "npm run test -- --single-run=true --browsers ChromeHeadless karma.conf.js",
26
+ "test-firefox": "npm run test -- --single-run=true --browsers Firefox karma.conf.js",
27
+ "test-firefox-headless": "npm run test -- --single-run=true --browsers FirefoxHeadless karma.conf.js",
28
+ "test-watch": "npm run test -- --browsers=Chrome --single-run=false --auto-watch"
29
+ },
30
+ "devDependencies": {
31
+ "@babel/core": "^7.9.6",
32
+ "@babel/plugin-transform-runtime": "^7.9.6",
33
+ "@babel/polyfill": "^7.8.7",
34
+ "@babel/preset-env": "^7.9.6",
35
+ "@babel/runtime": "^7.9.6",
36
+ "babel-loader": "^8.1.0",
37
+ "babel-minify-webpack-plugin": "^0.3.1",
38
+ "clean-webpack-plugin": "^3.0.0",
39
+ "eslint": "^7.0.0",
40
+ "istanbul-instrumenter-loader": "^3.0.1",
41
+ "karma": "^5.0.9",
42
+ "karma-chrome-launcher": "^3.1.0",
43
+ "karma-coverage-istanbul-reporter": "^3.0.2",
44
+ "karma-eslint": "^2.2.0",
45
+ "karma-firefox-launcher": "^1.3.0",
46
+ "karma-host-environment": "^3.0.3",
47
+ "karma-jquery": "^0.2.4",
48
+ "karma-qunit": "^4.1.1",
49
+ "karma-webpack": "^4.0.2",
50
+ "qunit": "^2.10.0",
51
+ "webpack": "^4.43.0",
52
+ "webpack-cli": "^3.3.11",
53
+ "host-environment": "^2.1.2"
54
+ },
55
+ "dependencies": {
56
+ "dexie": "3.0.1",
57
+ "jquery": "3.5.1"
58
+ }
59
+ }
package/reinstall CHANGED
@@ -1,4 +1,4 @@
1
- #!/usr/bin/env bash
2
-
3
- ./clean
4
- ./install
1
+ #!/usr/bin/env bash
2
+
3
+ ./clean
4
+ ./install