bimplus-websdk 0.0.225 → 0.0.227-nonblocking-load.1
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/dist/bimplus-websdk.js +1 -1
- package/package.json +12 -11
package/dist/bimplus-websdk.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/*! For license information please see bimplus-websdk.js.LICENSE.txt */
|
|
2
|
-
!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()}(self,(()=>(()=>{"use strict";var e={d:(t,r)=>{for(var n in r)e.o(r,n)&&!e.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:r[n]})},o:(e,t)=>Object.prototype.hasOwnProperty.call(e,t),r:e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})}},t={};function r(e,t,r,n){return $.ajax({url:e,type:t,data:r,contentType:n&&void 0!==n.contentType?n.contentType:"application/json; charset=utf-8",dataType:n&&void 0!==n.dataType?n.dataType:"json",processData:!(!n||void 0===n.processData)&&n.processData,cache:!(!window||!window.BIMPLUS_SDK_ENABLE_CACHE),async:!0,xhr:function(){var e=$.ajaxSettings.xhr();return n&&void 0!==n.xhrUploadProgress&&e.upload.addEventListener("progress",n.xhrUploadProgress,!1),e},beforeSend:function(e){if(window&&void 0!==window.BIMPLUS_SDK_PENDING_REQUESTS&&window.BIMPLUS_SDK_PENDING_REQUESTS++,n&&n.token){var t=n.tokenType?n.tokenType:"BimPlus";e.setRequestHeader("Authorization",t+" "+n.token)}n&&n.eTag&&(e.setRequestHeader("Cache-Control","no-cache"),window&&!window.BIMPLUS_SDK_DISABLE_ETAG&&e.setRequestHeader("If-None-Match",n.eTag))},complete:function(t){if(window&&void 0!==window.BIMPLUS_SDK_PENDING_REQUESTS&&window.BIMPLUS_SDK_PENDING_REQUESTS--,window&&window.BIMPLUS_SDK_LOG_API_CALLS){var r={url:e,response:t&&t.responseText&&t.responseText.length>0?JSON.parse(t.responseText):null};console.log(JSON.stringify(r))}}})}function n(e,t,r,n){var s=$.Deferred();console.debug("xmlHttpRequest config=",n);var i=new XMLHttpRequest;return i.open(t,e,!0),i.setRequestHeader("Authorization","BimPlus "+n.token),window&&void 0!==window.BIMPLUS_SDK_PENDING_REQUESTS&&window.BIMPLUS_SDK_PENDING_REQUESTS++,n&&n.responseType&&(console.debug("responseType is set to",n.responseType),i.responseType=n.responseType),n&&n.eTag&&(console.debug("setRequestHeader is set to eTag",n.eTag),i.setRequestHeader("Cache-Control","no-cache"),window&&!window.BIMPLUS_SDK_DISABLE_ETAG&&i.setRequestHeader("If-None-Match",n.eTag)),i.onload=function(){window&&void 0!==window.BIMPLUS_SDK_PENDING_REQUESTS&&window.BIMPLUS_SDK_PENDING_REQUESTS--,s.resolve(i.response,i.status,i)},i.onerror=function(){window&&void 0!==window.BIMPLUS_SDK_PENDING_REQUESTS&&window.BIMPLUS_SDK_PENDING_REQUESTS--,s.reject()},r&&i.setRequestHeader("Content-Type","application/json;charset=UTF-8"),i.send(r),s.promise()}function s(e){var t="?";for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t+=r+"="+e[r]+"&");return t=t.slice(0,-1)}function i(e,t,r,n,s){var i=arguments.length>5&&void 0!==arguments[5]&&arguments[5];s||(s={}),s.token||(s.token=t),s.queryParams||(s.queryParams={}),s.queryParams.chunkSize=r,s.queryParams.chunk=1;var o=$.Deferred(),a=[];return e.get(n,s).done((function(t,r,u){a.push(t);var c=0;if(200===u.status){var l=u.getResponseHeader("X-Total-Count");l?c=parseInt(l,10):console.warn("Request for "+n+" doesn't support chunked responses!")}else 304===u.status&&(u["Cached-X-Total-Count"]?c=u["Cached-X-Total-Count"]:console.warn("Cached request for "+n+" doesn't contain chunk info!"));if(i){for(var h=function(){var t=$.Deferred();s.queryParams.chunk=p,e.get(n,s).done((function(e){t.resolve(e)})).fail((function(e,r){t.reject(e,r)})),a.push(t)},p=2;p<=c;p++)h();o.resolve(a)}else{for(var f=[],d=2;d<=c;d++){s.queryParams.chunk=d;var g=e.get(n,s).done((function(e){a.push(e)})).fail((function(e,t){o.reject(e,t)}));f.push(g)}Promise.all(f).then((function(){o.resolve(a)}))}})).fail((function(e,t){o.reject(e,t)})),o.promise()}e.r(t),e.d(t,{Api:()=>us,IDBCache:()=>ln,createDefaultConfig:()=>cs});var o=function(){var e=null,t=null,o="medium";this.setAccessToken=function(t){e=t},this.setTokenType=function(e){t=e},this.get=function(i,o){return o||(o={}),o.token||(o.token=e),o.tokenType&&o.tokenType===t||(o.tokenType=t),o.queryParams&&(i+=s(o.queryParams)),o&&o.useXMLHttpRequest?n(i,"GET",null,o):r(i,"GET",null,o)},this.getChunked=function(t,r){var n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];return i(this,e,o,t,r,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(i,o,a){return a||(a={}),a.token||(a.token=e),a.tokenType&&a.tokenType===t||(a.tokenType=t),a.queryParams&&(i+=s(a.queryParams)),a&&a.useXMLHttpRequest?n(i,"POST",o,a):r(i,"POST",o,a)},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)}},a=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,r){return e.request.put(e.getApiUrl()+"application/settings/"+t,r)},this.deleteSettings=function(t){return e.request.del(e.getApiUrl()+"application/settings/"+t)}},u=function(e){this.get=function(t){return console.debug("Annotation get API ",e.getApiTeamUrl()+"annotations/"+t),e.request.get(e.getApiTeamUrl()+"annotations/"+t)},this.delete=function(t){return e.request.del(e.getApiTeamUrl()+"annotations/"+t)},this.put=function(t,r){return e.request.put(e.getApiTeamUrl()+"annotations/"+t,r)}},c=function(e){this.get=function(t){return e.request.get(e.getApiTeamUrl()+"attachments/"+t)},this.download=function(t,r){return r?e.request.get(e.getApiTeamUrl()+"attachments/"+t+"/versions/"+r+"/download"):e.request.get(e.getApiTeamUrl()+"attachments/"+t+"/download")},this.put=function(t,r){return e.request.put(e.getApiTeamUrl()+"attachments/"+t,r)},this.post=function(t,r,n){return e.request.put(e.getApiTeamUrl()+"attachments/"+t,r,{contentType:!1,processData:!1,dataType:null,xhrUploadProgress:n})},this.delete=function(t,r){return r?e.request.del(e.getApiTeamUrl()+"attachments/"+t+"/versions/"+r):e.request.del(e.getApiTeamUrl()+"attachments/"+t)},this.deleteSelected=function(t){return e.request.del(e.getApiTeamUrl()+"objects/"+t+"/attachments")},this.postVersion=function(t,r,n){return e.request.post(e.getApiTeamUrl()+"attachments/"+t+"/versions",r,{contentType:!1,processData:!1,dataType:null,xhrUploadProgress:n})},this.getAllVersions=function(t){return e.request.get(e.getApiTeamUrl()+"attachments/"+t+"/versions")},this.releaseVersion=function(t,r){return e.request.put(e.getApiTeamUrl()+"attachments/"+t+"/release",r)}},l=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,r){return e.request.put(e.getApiTeamUrl()+"attributetemplates/"+t,r)},this.delete=function(t){return e.request.del(e.getApiTeamUrl()+"attributetemplates/"+t)}},h=function(e){this.post=function(t,r,n){return e.request.post(e.getApiUrl()+"authorize",JSON.stringify({user_id:t,password:r,application_id:n}))},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")},this.requestExternalAppToken=function(){return e.request.get(e.getApiUrl()+"validate")}};const p="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:"undefined"!=typeof window?window:global,f=Object.keys,d=Array.isArray;function g(e,t){return"object"!=typeof t||f(t).forEach((function(r){e[r]=t[r]})),e}"undefined"==typeof Promise||p.Promise||(p.Promise=Promise);const m=Object.getPrototypeOf,y={}.hasOwnProperty;function v(e,t){return y.call(e,t)}function b(e,t){"function"==typeof t&&(t=t(m(e))),("undefined"==typeof Reflect?f:Reflect.ownKeys)(t).forEach((r=>{w(e,r,t[r])}))}const T=Object.defineProperty;function w(e,t,r,n){T(e,t,g(r&&v(r,"get")&&"function"==typeof r.get?{get:r.get,set:r.set,configurable:!0}:{value:r,configurable:!0,writable:!0},n))}function A(e){return{from:function(t){return e.prototype=Object.create(t.prototype),w(e.prototype,"constructor",e),{extend:b.bind(null,e.prototype)}}}}const q=Object.getOwnPropertyDescriptor;function _(e,t){let r;return q(e,t)||(r=m(e))&&_(r,t)}const U=[].slice;function k(e,t,r){return U.call(e,t,r)}function j(e,t){return t(e)}function P(e){if(!e)throw new Error("Assertion Failed")}function x(e){p.setImmediate?setImmediate(e):setTimeout(e,0)}function S(e,t){return e.reduce(((e,r,n)=>{var s=t(r,n);return s&&(e[s[0]]=s[1]),e}),{})}function E(e,t){if(v(e,t))return e[t];if(!t)return e;if("string"!=typeof t){for(var r=[],n=0,s=t.length;n<s;++n){var i=E(e,t[n]);r.push(i)}return r}var o=t.indexOf(".");if(-1!==o){var a=e[t.substr(0,o)];return void 0===a?void 0:E(a,t.substr(o+1))}}function D(e,t,r){if(e&&void 0!==t&&(!("isFrozen"in Object)||!Object.isFrozen(e)))if("string"!=typeof t&&"length"in t){P("string"!=typeof r&&"length"in r);for(var n=0,s=t.length;n<s;++n)D(e,t[n],r[n])}else{var i=t.indexOf(".");if(-1!==i){var o=t.substr(0,i),a=t.substr(i+1);if(""===a)void 0===r?d(e)&&!isNaN(parseInt(o))?e.splice(o,1):delete e[o]:e[o]=r;else{var u=e[o];u&&v(e,o)||(u=e[o]={}),D(u,a,r)}}else void 0===r?d(e)&&!isNaN(parseInt(t))?e.splice(t,1):delete e[t]:e[t]=r}}function O(e){var t={};for(var r in e)v(e,r)&&(t[r]=e[r]);return t}const C=[].concat;function R(e){return C.apply([],e)}const I="Boolean,String,Date,RegExp,Blob,File,FileList,FileSystemFileHandle,ArrayBuffer,DataView,Uint8ClampedArray,ImageBitmap,ImageData,Map,Set,CryptoKey".split(",").concat(R([8,16,32,64].map((e=>["Int","Uint","Float"].map((t=>t+e+"Array")))))).filter((e=>p[e])),B=I.map((e=>p[e]));S(I,(e=>[e,!0]));let K=null;function N(e){K="undefined"!=typeof WeakMap&&new WeakMap;const t=M(e);return K=null,t}function M(e){if(!e||"object"!=typeof e)return e;let t=K&&K.get(e);if(t)return t;if(d(e)){t=[],K&&K.set(e,t);for(var r=0,n=e.length;r<n;++r)t.push(M(e[r]))}else if(B.indexOf(e.constructor)>=0)t=e;else{const r=m(e);for(var s in t=r===Object.prototype?{}:Object.create(r),K&&K.set(e,t),e)v(e,s)&&(t[s]=M(e[s]))}return t}const{toString:L}={};function F(e){return L.call(e).slice(8,-1)}const G="undefined"!=typeof Symbol?Symbol.iterator:"@@iterator",H="symbol"==typeof G?function(e){var t;return null!=e&&(t=e[G])&&t.apply(e)}:function(){return null},W={};function V(e){var t,r,n,s;if(1===arguments.length){if(d(e))return e.slice();if(this===W&&"string"==typeof e)return[e];if(s=H(e)){for(r=[];!(n=s.next()).done;)r.push(n.value);return r}if(null==e)return[e];if("number"==typeof(t=e.length)){for(r=new Array(t);t--;)r[t]=e[t];return r}return[e]}for(t=arguments.length,r=new Array(t);t--;)r[t]=arguments[t];return r}const J="undefined"!=typeof Symbol?e=>"AsyncFunction"===e[Symbol.toStringTag]:()=>!1;var z="undefined"!=typeof location&&/^(http|https):\/\/(localhost|127\.0\.0\.1)/.test(location.href);function X(e,t){z=e,Q=t}var Q=()=>!0;const Y=!new Error("").stack;function Z(){if(Y)try{throw Z.arguments,new Error}catch(e){return e}return new Error}function ee(e,t){var r=e.stack;return r?(t=t||0,0===r.indexOf(e.name)&&(t+=(e.name+e.message).split("\n").length),r.split("\n").slice(t).filter(Q).map((e=>"\n"+e)).join("")):""}var te=["Unknown","Constraint","Data","TransactionInactive","ReadOnly","Version","NotFound","InvalidState","InvalidAccess","Abort","Timeout","QuotaExceeded","Syntax","DataClone"],re=["Modify","Bulk","OpenFailed","VersionChange","Schema","Upgrade","InvalidTable","MissingAPI","NoSuchDatabase","InvalidArgument","SubTransaction","Unsupported","Internal","DatabaseClosed","PrematureCommit","ForeignAwait"].concat(te),ne={VersionChanged:"Database version changed by other database connection",DatabaseClosed:"Database has been closed",Abort:"Transaction aborted",TransactionInactive:"Transaction has already completed or failed",MissingAPI:"IndexedDB API missing. Please visit https://tinyurl.com/y2uuvskb"};function se(e,t){this._e=Z(),this.name=e,this.message=t}function ie(e,t){return e+". Errors: "+Object.keys(t).map((e=>t[e].toString())).filter(((e,t,r)=>r.indexOf(e)===t)).join("\n")}function oe(e,t,r,n){this._e=Z(),this.failures=t,this.failedKeys=n,this.successCount=r,this.message=ie(e,t)}function ae(e,t){this._e=Z(),this.name="BulkError",this.failures=Object.keys(t).map((e=>t[e])),this.failuresByPos=t,this.message=ie(e,t)}A(se).from(Error).extend({stack:{get:function(){return this._stack||(this._stack=this.name+": "+this.message+ee(this._e,2))}},toString:function(){return this.name+": "+this.message}}),A(oe).from(se),A(ae).from(se);var ue=re.reduce(((e,t)=>(e[t]=t+"Error",e)),{});const ce=se;var le=re.reduce(((e,t)=>{var r=t+"Error";function n(e,n){this._e=Z(),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=ne[t]||r,this.inner=null)}return A(n).from(ce),e[t]=n,e}),{});le.Syntax=SyntaxError,le.Type=TypeError,le.Range=RangeError;var he=te.reduce(((e,t)=>(e[t+"Error"]=le[t],e)),{}),pe=re.reduce(((e,t)=>(-1===["Syntax","Type","Range"].indexOf(t)&&(e[t+"Error"]=le[t]),e)),{});function fe(){}function de(e){return e}function ge(e,t){return null==e||e===de?t:function(r){return t(e(r))}}function me(e,t){return function(){e.apply(this,arguments),t.apply(this,arguments)}}function ye(e,t){return e===fe?t:function(){var r=e.apply(this,arguments);void 0!==r&&(arguments[0]=r);var n=this.onsuccess,s=this.onerror;this.onsuccess=null,this.onerror=null;var i=t.apply(this,arguments);return n&&(this.onsuccess=this.onsuccess?me(n,this.onsuccess):n),s&&(this.onerror=this.onerror?me(s,this.onerror):s),void 0!==i?i:r}}function ve(e,t){return e===fe?t:function(){e.apply(this,arguments);var r=this.onsuccess,n=this.onerror;this.onsuccess=this.onerror=null,t.apply(this,arguments),r&&(this.onsuccess=this.onsuccess?me(r,this.onsuccess):r),n&&(this.onerror=this.onerror?me(n,this.onerror):n)}}function be(e,t){return e===fe?t:function(r){var n=e.apply(this,arguments);g(r,n);var s=this.onsuccess,i=this.onerror;this.onsuccess=null,this.onerror=null;var o=t.apply(this,arguments);return s&&(this.onsuccess=this.onsuccess?me(s,this.onsuccess):s),i&&(this.onerror=this.onerror?me(i,this.onerror):i),void 0===n?void 0===o?void 0:o:g(n,o)}}function Te(e,t){return e===fe?t:function(){return!1!==t.apply(this,arguments)&&e.apply(this,arguments)}}function we(e,t){return e===fe?t:function(){var r=e.apply(this,arguments);if(r&&"function"==typeof r.then){for(var n=this,s=arguments.length,i=new Array(s);s--;)i[s]=arguments[s];return r.then((function(){return t.apply(n,i)}))}return t.apply(this,arguments)}}pe.ModifyError=oe,pe.DexieError=se,pe.BulkError=ae;var Ae={};const[qe,_e,Ue]="undefined"==typeof Promise?[]:(()=>{let e=Promise.resolve();if("undefined"==typeof crypto||!crypto.subtle)return[e,m(e),e];const t=crypto.subtle.digest("SHA-512",new Uint8Array([0]));return[t,m(t),e]})(),ke=_e&&_e.then,je=qe&&qe.constructor,Pe=!!Ue;var xe=!1,Se=Ue?()=>{Ue.then(Ze)}:p.setImmediate?setImmediate.bind(null,Ze):p.MutationObserver?()=>{var e=document.createElement("div");new MutationObserver((()=>{Ze(),e=null})).observe(e,{attributes:!0}),e.setAttribute("i","1")}:()=>{setTimeout(Ze,0)},Ee=function(e,t){Me.push([e,t]),Oe&&(Se(),Oe=!1)},De=!0,Oe=!0,Ce=[],Re=[],Ie=null,Be=de,Ke={id:"global",global:!0,ref:0,unhandleds:[],onunhandled:qt,pgp:!1,env:{},finalize:function(){this.unhandleds.forEach((e=>{try{qt(e[0],e[1])}catch(e){}}))}},Ne=Ke,Me=[],Le=0,Fe=[];function Ge(e){if("object"!=typeof this)throw new TypeError("Promises must be constructed via new");this._listeners=[],this.onuncatched=fe,this._lib=!1;var t=this._PSD=Ne;if(z&&(this._stackHolder=Z(),this._prev=null,this._numPrev=0),"function"!=typeof e){if(e!==Ae)throw new TypeError("Not a function");return this._state=arguments[1],this._value=arguments[2],void(!1===this._state&&Ve(this,this._value))}this._state=null,this._value=null,++t.ref,We(this,e)}const He={get:function(){var e=Ne,t=ct;function r(r,n){var s=!e.global&&(e!==Ne||t!==ct);const i=s&&!ft();var o=new Ge(((t,o)=>{ze(this,new $e(wt(r,e,s,i),wt(n,e,s,i),t,o,e))}));return z&&Ye(o,this),o}return r.prototype=Ae,r},set:function(e){w(this,"then",e&&e.prototype===Ae?He:{get:function(){return e},set:He.set})}};function $e(e,t,r,n,s){this.onFulfilled="function"==typeof e?e:null,this.onRejected="function"==typeof t?t:null,this.resolve=r,this.reject=n,this.psd=s}function We(e,t){try{t((t=>{if(null===e._state){if(t===e)throw new TypeError("A promise cannot be resolved with itself.");var r=e._lib&&et();t&&"function"==typeof t.then?We(e,((e,r)=>{t instanceof Ge?t._then(e,r):t.then(e,r)})):(e._state=!0,e._value=t,Je(e)),r&&tt()}}),Ve.bind(null,e))}catch(t){Ve(e,t)}}function Ve(e,t){if(Re.push(t),null===e._state){var r=e._lib&&et();t=Be(t),e._state=!1,e._value=t,z&&null!==t&&"object"==typeof t&&!t._promise&&function(e,t,r){try{e.apply(null,void 0)}catch(e){}}((()=>{var r=_(t,"stack");t._promise=e,w(t,"stack",{get:()=>xe?r&&(r.get?r.get.apply(t):r.value):e.stack})})),function(e){Ce.some((t=>t._value===e._value))||Ce.push(e)}(e),Je(e),r&&tt()}}function Je(e){var t=e._listeners;e._listeners=[];for(var r=0,n=t.length;r<n;++r)ze(e,t[r]);var s=e._PSD;--s.ref||s.finalize(),0===Le&&(++Le,Ee((()=>{0==--Le&&rt()}),[]))}function ze(e,t){if(null!==e._state){var r=e._state?t.onFulfilled:t.onRejected;if(null===r)return(e._state?t.resolve:t.reject)(e._value);++t.psd.ref,++Le,Ee(Xe,[r,e,t])}else e._listeners.push(t)}function Xe(e,t,r){try{Ie=t;var n,s=t._value;t._state?n=e(s):(Re.length&&(Re=[]),n=e(s),-1===Re.indexOf(s)&&function(e){for(var t=Ce.length;t;)if(Ce[--t]._value===e._value)return void Ce.splice(t,1)}(t)),r.resolve(n)}catch(e){r.reject(e)}finally{Ie=null,0==--Le&&rt(),--r.psd.ref||r.psd.finalize()}}function Qe(e,t,r){if(t.length===r)return t;var n="";if(!1===e._state){var s,i,o=e._value;null!=o?(s=o.name||"Error",i=o.message||o,n=ee(o,0)):(s=o,i=""),t.push(s+(i?": "+i:"")+n)}return z&&((n=ee(e._stackHolder,2))&&-1===t.indexOf(n)&&t.push(n),e._prev&&Qe(e._prev,t,r)),t}function Ye(e,t){var r=t?t._numPrev+1:0;r<100&&(e._prev=t,e._numPrev=r)}function Ze(){et()&&tt()}function et(){var e=De;return De=!1,Oe=!1,e}function tt(){var e,t,r;do{for(;Me.length>0;)for(e=Me,Me=[],r=e.length,t=0;t<r;++t){var n=e[t];n[0].apply(null,n[1])}}while(Me.length>0);De=!0,Oe=!0}function rt(){var e=Ce;Ce=[],e.forEach((e=>{e._PSD.onunhandled.call(null,e._value,e)}));for(var t=Fe.slice(0),r=t.length;r;)t[--r]()}function nt(e){return new Ge(Ae,!1,e)}function st(e,t){var r=Ne;return function(){var n=et(),s=Ne;try{return yt(r,!0),e.apply(this,arguments)}catch(e){t&&t(e)}finally{yt(s,!1),n&&tt()}}}b(Ge.prototype,{then:He,_then:function(e,t){ze(this,new $e(null,null,e,t,Ne))},catch:function(e){if(1===arguments.length)return this.then(null,e);var t=arguments[0],r=arguments[1];return"function"==typeof t?this.then(null,(e=>e instanceof t?r(e):nt(e))):this.then(null,(e=>e&&e.name===t?r(e):nt(e)))},finally:function(e){return this.then((t=>(e(),t)),(t=>(e(),nt(t))))},stack:{get:function(){if(this._stack)return this._stack;try{xe=!0;var e=Qe(this,[],20).join("\nFrom previous: ");return null!==this._state&&(this._stack=e),e}finally{xe=!1}}},timeout:function(e,t){return e<1/0?new Ge(((r,n)=>{var s=setTimeout((()=>n(new le.Timeout(t))),e);this.then(r,n).finally(clearTimeout.bind(null,s))})):this}}),"undefined"!=typeof Symbol&&Symbol.toStringTag&&w(Ge.prototype,Symbol.toStringTag,"Dexie.Promise"),Ke.env=vt(),b(Ge,{all:function(){var e=V.apply(null,arguments).map(dt);return new Ge((function(t,r){0===e.length&&t([]);var n=e.length;e.forEach(((s,i)=>Ge.resolve(s).then((r=>{e[i]=r,--n||t(e)}),r)))}))},resolve:e=>{if(e instanceof Ge)return e;if(e&&"function"==typeof e.then)return new Ge(((t,r)=>{e.then(t,r)}));var t=new Ge(Ae,!0,e);return Ye(t,Ie),t},reject:nt,race:function(){var e=V.apply(null,arguments).map(dt);return new Ge(((t,r)=>{e.map((e=>Ge.resolve(e).then(t,r)))}))},PSD:{get:()=>Ne,set:e=>Ne=e},totalEchoes:{get:()=>ct},newPSD:ht,usePSD:bt,scheduler:{get:()=>Ee,set:e=>{Ee=e}},rejectionMapper:{get:()=>Be,set:e=>{Be=e}},follow:(e,t)=>new Ge(((r,n)=>ht(((t,r)=>{var n=Ne;n.unhandleds=[],n.onunhandled=r,n.finalize=me((function(){!function(e){Fe.push((function t(){e(),Fe.splice(Fe.indexOf(t),1)})),++Le,Ee((()=>{0==--Le&&rt()}),[])}((()=>{0===this.unhandleds.length?t():r(this.unhandleds[0])}))}),n.finalize),e()}),t,r,n)))}),je&&(je.allSettled&&w(Ge,"allSettled",(function(){const e=V.apply(null,arguments).map(dt);return new Ge((t=>{0===e.length&&t([]);let r=e.length;const n=new Array(r);e.forEach(((e,s)=>Ge.resolve(e).then((e=>n[s]={status:"fulfilled",value:e}),(e=>n[s]={status:"rejected",reason:e})).then((()=>--r||t(n)))))}))})),je.any&&"undefined"!=typeof AggregateError&&w(Ge,"any",(function(){const e=V.apply(null,arguments).map(dt);return new Ge(((t,r)=>{0===e.length&&r(new AggregateError([]));let n=e.length;const s=new Array(n);e.forEach(((e,i)=>Ge.resolve(e).then((e=>t(e)),(e=>{s[i]=e,--n||r(new AggregateError(s))}))))}))})));const it={awaits:0,echoes:0,id:0};var ot=0,at=[],ut=0,ct=0,lt=0;function ht(e,t,r,n){var s=Ne,i=Object.create(s);i.parent=s,i.ref=0,i.global=!1,i.id=++lt;var o=Ke.env;i.env=Pe?{Promise:Ge,PromiseProp:{value:Ge,configurable:!0,writable:!0},all:Ge.all,race:Ge.race,allSettled:Ge.allSettled,any:Ge.any,resolve:Ge.resolve,reject:Ge.reject,nthen:At(o.nthen,i),gthen:At(o.gthen,i)}:{},t&&g(i,t),++s.ref,i.finalize=function(){--this.parent.ref||this.parent.finalize()};var a=bt(i,e,r,n);return 0===i.ref&&i.finalize(),a}function pt(){return it.id||(it.id=++ot),++it.awaits,it.echoes+=100,it.id}function ft(){return!!it.awaits&&(0==--it.awaits&&(it.id=0),it.echoes=100*it.awaits,!0)}function dt(e){return it.echoes&&e&&e.constructor===je?(pt(),e.then((e=>(ft(),e)),(e=>(ft(),_t(e))))):e}function gt(e){++ct,it.echoes&&0!=--it.echoes||(it.echoes=it.id=0),at.push(Ne),yt(e,!0)}function mt(){var e=at[at.length-1];at.pop(),yt(e,!1)}function yt(e,t){var r=Ne;if((t?!it.echoes||ut++&&e===Ne:!ut||--ut&&e===Ne)||Tt(t?gt.bind(null,e):mt),e!==Ne&&(Ne=e,r===Ke&&(Ke.env=vt()),Pe)){var n=Ke.env.Promise,s=e.env;_e.then=s.nthen,n.prototype.then=s.gthen,(r.global||e.global)&&(Object.defineProperty(p,"Promise",s.PromiseProp),n.all=s.all,n.race=s.race,n.resolve=s.resolve,n.reject=s.reject,s.allSettled&&(n.allSettled=s.allSettled),s.any&&(n.any=s.any))}}function vt(){var e=p.Promise;return Pe?{Promise:e,PromiseProp:Object.getOwnPropertyDescriptor(p,"Promise"),all:e.all,race:e.race,allSettled:e.allSettled,any:e.any,resolve:e.resolve,reject:e.reject,nthen:_e.then,gthen:e.prototype.then}:{}}function bt(e,t,r,n,s){var i=Ne;try{return yt(e,!0),t(r,n,s)}finally{yt(i,!1)}}function Tt(e){ke.call(qe,e)}function wt(e,t,r,n){return"function"!=typeof e?e:function(){var s=Ne;r&&pt(),yt(t,!0);try{return e.apply(this,arguments)}finally{yt(s,!1),n&&Tt(ft)}}}function At(e,t){return function(r,n){return e.call(this,wt(r,t),wt(n,t))}}function qt(e,t){var r;try{r=t.onuncatched(e)}catch(e){}if(!1!==r)try{var n,s={promise:t,reason:e};if(p.document&&document.createEvent?((n=document.createEvent("Event")).initEvent("unhandledrejection",!0,!0),g(n,s)):p.CustomEvent&&g(n=new CustomEvent("unhandledrejection",{detail:s}),s),n&&p.dispatchEvent&&(dispatchEvent(n),!p.PromiseRejectionEvent&&p.onunhandledrejection))try{p.onunhandledrejection(n)}catch(e){}z&&n&&!n.defaultPrevented&&console.warn(`Unhandled rejection: ${e.stack||e}`)}catch(e){}}-1===(""+ke).indexOf("[native code]")&&(pt=ft=fe);var _t=Ge.reject;function Ut(e,t,r,n){if(e.idbdb&&(e._state.openComplete||Ne.letThrough||e._vip)){var s=e._createTransaction(t,r,e._dbSchema);try{s.create(),e._state.PR1398_maxLoop=3}catch(s){return s.name===ue.InvalidState&&e.isOpen()&&--e._state.PR1398_maxLoop>0?(console.warn("Dexie: Need to reopen db"),e._close(),e.open().then((()=>Ut(e,t,r,n)))):_t(s)}return s._promise(t,((e,t)=>ht((()=>(Ne.trans=s,n(e,t,s)))))).then((e=>s._completion.then((()=>e))))}if(e._state.openComplete)return _t(new le.DatabaseClosed(e._state.dbOpenError));if(!e._state.isBeingOpened){if(!e._options.autoOpen)return _t(new le.DatabaseClosed);e.open().catch(fe)}return e._state.dbReadyPromise.then((()=>Ut(e,t,r,n)))}const kt=String.fromCharCode(65535),jt="Invalid key provided. Keys must be of type string, number, Date or Array<string | number | Date>.",Pt=[],xt="undefined"!=typeof navigator&&/(MSIE|Trident|Edge)/.test(navigator.userAgent),St=xt,Et=xt,Dt=e=>!/(dexie\.js|dexie\.min\.js)/.test(e);function Ot(e,t){return e?t?function(){return e.apply(this,arguments)&&t.apply(this,arguments)}:e:t}const Ct={type:3,lower:-1/0,lowerOpen:!1,upper:[[]],upperOpen:!1};function Rt(e){return"string"!=typeof e||/\./.test(e)?e=>e:t=>(void 0===t[e]&&e in t&&delete(t=N(t))[e],t)}class It{_trans(e,t,r){const n=this._tx||Ne.trans,s=this.name;function i(e,r,n){if(!n.schema[s])throw new le.NotFound("Table "+s+" not part of transaction");return t(n.idbtrans,n)}const o=et();try{return n&&n.db===this.db?n===Ne.trans?n._promise(e,i,r):ht((()=>n._promise(e,i,r)),{trans:n,transless:Ne.transless||Ne}):Ut(this.db,e,[this.name],i)}finally{o&&tt()}}get(e,t){return e&&e.constructor===Object?this.where(e).first(t):this._trans("readonly",(t=>this.core.get({trans:t,key:e}).then((e=>this.hook.reading.fire(e))))).then(t)}where(e){if("string"==typeof e)return new this.db.WhereClause(this,e);if(d(e))return new this.db.WhereClause(this,`[${e.join("+")}]`);const t=f(e);if(1===t.length)return this.where(t[0]).equals(e[t[0]]);const r=this.schema.indexes.concat(this.schema.primKey).filter((e=>e.compound&&t.every((t=>e.keyPath.indexOf(t)>=0))&&e.keyPath.every((e=>t.indexOf(e)>=0))))[0];if(r&&this.db._maxKey!==kt)return this.where(r.name).equals(r.keyPath.map((t=>e[t])));!r&&z&&console.warn(`The query ${JSON.stringify(e)} on ${this.name} would benefit of a compound index [${t.join("+")}]`);const{idxByName:n}=this.schema,s=this.db._deps.indexedDB;function i(e,t){try{return 0===s.cmp(e,t)}catch(e){return!1}}const[o,a]=t.reduce((([t,r],s)=>{const o=n[s],a=e[s];return[t||o,t||!o?Ot(r,o&&o.multi?e=>{const t=E(e,s);return d(t)&&t.some((e=>i(a,e)))}:e=>i(a,E(e,s))):r]}),[null,null]);return o?this.where(o.name).equals(e[o.keyPath]).filter(a):r?this.filter(a):this.where(t).equals("")}filter(e){return this.toCollection().and(e)}count(e){return this.toCollection().count(e)}offset(e){return this.toCollection().offset(e)}limit(e){return this.toCollection().limit(e)}each(e){return this.toCollection().each(e)}toArray(e){return this.toCollection().toArray(e)}toCollection(){return new this.db.Collection(new this.db.WhereClause(this))}orderBy(e){return new this.db.Collection(new this.db.WhereClause(this,d(e)?`[${e.join("+")}]`:e))}reverse(){return this.toCollection().reverse()}mapToClass(e){this.schema.mappedClass=e;const t=t=>{if(!t)return t;const r=Object.create(e.prototype);for(var n in t)if(v(t,n))try{r[n]=t[n]}catch(e){}return r};return this.schema.readHook&&this.hook.reading.unsubscribe(this.schema.readHook),this.schema.readHook=t,this.hook("reading",t),e}defineClass(){return this.mapToClass((function(e){g(this,e)}))}add(e,t){const{auto:r,keyPath:n}=this.schema.primKey;let s=e;return n&&r&&(s=Rt(n)(e)),this._trans("readwrite",(e=>this.core.mutate({trans:e,type:"add",keys:null!=t?[t]:null,values:[s]}))).then((e=>e.numFailures?Ge.reject(e.failures[0]):e.lastResult)).then((t=>{if(n)try{D(e,n,t)}catch(e){}return t}))}update(e,t){if("object"!=typeof e||d(e))return this.where(":id").equals(e).modify(t);{const r=E(e,this.schema.primKey.keyPath);if(void 0===r)return _t(new le.InvalidArgument("Given object does not contain its primary key"));try{"function"!=typeof t?f(t).forEach((r=>{D(e,r,t[r])})):t(e,{value:e,primKey:r})}catch(e){}return this.where(":id").equals(r).modify(t)}}put(e,t){const{auto:r,keyPath:n}=this.schema.primKey;let s=e;return n&&r&&(s=Rt(n)(e)),this._trans("readwrite",(e=>this.core.mutate({trans:e,type:"put",values:[s],keys:null!=t?[t]:null}))).then((e=>e.numFailures?Ge.reject(e.failures[0]):e.lastResult)).then((t=>{if(n)try{D(e,n,t)}catch(e){}return t}))}delete(e){return this._trans("readwrite",(t=>this.core.mutate({trans:t,type:"delete",keys:[e]}))).then((e=>e.numFailures?Ge.reject(e.failures[0]):void 0))}clear(){return this._trans("readwrite",(e=>this.core.mutate({trans:e,type:"deleteRange",range:Ct}))).then((e=>e.numFailures?Ge.reject(e.failures[0]):void 0))}bulkGet(e){return this._trans("readonly",(t=>this.core.getMany({keys:e,trans:t}).then((e=>e.map((e=>this.hook.reading.fire(e)))))))}bulkAdd(e,t,r){const n=Array.isArray(t)?t:void 0,s=(r=r||(n?void 0:t))?r.allKeys:void 0;return this._trans("readwrite",(t=>{const{auto:r,keyPath:i}=this.schema.primKey;if(i&&n)throw new le.InvalidArgument("bulkAdd(): keys argument invalid on tables with inbound keys");if(n&&n.length!==e.length)throw new le.InvalidArgument("Arguments objects and keys must have the same length");const o=e.length;let a=i&&r?e.map(Rt(i)):e;return this.core.mutate({trans:t,type:"add",keys:n,values:a,wantResults:s}).then((({numFailures:e,results:t,lastResult:r,failures:n})=>{if(0===e)return s?t:r;throw new ae(`${this.name}.bulkAdd(): ${e} of ${o} operations failed`,n)}))}))}bulkPut(e,t,r){const n=Array.isArray(t)?t:void 0,s=(r=r||(n?void 0:t))?r.allKeys:void 0;return this._trans("readwrite",(t=>{const{auto:r,keyPath:i}=this.schema.primKey;if(i&&n)throw new le.InvalidArgument("bulkPut(): keys argument invalid on tables with inbound keys");if(n&&n.length!==e.length)throw new le.InvalidArgument("Arguments objects and keys must have the same length");const o=e.length;let a=i&&r?e.map(Rt(i)):e;return this.core.mutate({trans:t,type:"put",keys:n,values:a,wantResults:s}).then((({numFailures:e,results:t,lastResult:r,failures:n})=>{if(0===e)return s?t:r;throw new ae(`${this.name}.bulkPut(): ${e} of ${o} operations failed`,n)}))}))}bulkDelete(e){const t=e.length;return this._trans("readwrite",(t=>this.core.mutate({trans:t,type:"delete",keys:e}))).then((({numFailures:e,lastResult:r,failures:n})=>{if(0===e)return r;throw new ae(`${this.name}.bulkDelete(): ${e} of ${t} operations failed`,n)}))}}function Bt(e){var t={},r=function(r,n){if(n){for(var s=arguments.length,i=new Array(s-1);--s;)i[s-1]=arguments[s];return t[r].subscribe.apply(null,i),e}if("string"==typeof r)return t[r]};r.addEventType=i;for(var n=1,s=arguments.length;n<s;++n)i(arguments[n]);return r;function i(e,n,s){if("object"==typeof e)return o(e);n||(n=Te),s||(s=fe);var i={subscribers:[],fire:s,subscribe:function(e){-1===i.subscribers.indexOf(e)&&(i.subscribers.push(e),i.fire=n(i.fire,e))},unsubscribe:function(e){i.subscribers=i.subscribers.filter((function(t){return t!==e})),i.fire=i.subscribers.reduce(n,s)}};return t[e]=r[e]=i,i}function o(e){f(e).forEach((function(t){var r=e[t];if(d(r))i(t,e[t][0],e[t][1]);else{if("asap"!==r)throw new le.InvalidArgument("Invalid event config");var n=i(t,de,(function(){for(var e=arguments.length,t=new Array(e);e--;)t[e]=arguments[e];n.subscribers.forEach((function(e){x((function(){e.apply(null,t)}))}))}))}}))}}function Kt(e,t){return A(t).from({prototype:e}),t}function Nt(e,t){return!(e.filter||e.algorithm||e.or)&&(t?e.justLimit:!e.replayFilter)}function Mt(e,t){e.filter=Ot(e.filter,t)}function Lt(e,t,r){var n=e.replayFilter;e.replayFilter=n?()=>Ot(n(),t()):t,e.justLimit=r&&!n}function Ft(e,t){if(e.isPrimKey)return t.primaryKey;const r=t.getIndexByKeyPath(e.index);if(!r)throw new le.Schema("KeyPath "+e.index+" on object store "+t.name+" is not indexed");return r}function Gt(e,t,r){const n=Ft(e,t.schema);return t.openCursor({trans:r,values:!e.keysOnly,reverse:"prev"===e.dir,unique:!!e.unique,query:{index:n,range:e.range}})}function Ht(e,t,r,n){const s=e.replayFilter?Ot(e.filter,e.replayFilter()):e.filter;if(e.or){const i={},o=(e,r,n)=>{if(!s||s(r,n,(e=>r.stop(e)),(e=>r.fail(e)))){var o=r.primaryKey,a=""+o;"[object ArrayBuffer]"===a&&(a=""+new Uint8Array(o)),v(i,a)||(i[a]=!0,t(e,r,n))}};return Promise.all([e.or._iterate(o,r),$t(Gt(e,n,r),e.algorithm,o,!e.keysOnly&&e.valueMapper)])}return $t(Gt(e,n,r),Ot(e.algorithm,s),t,!e.keysOnly&&e.valueMapper)}function $t(e,t,r,n){var s=st(n?(e,t,s)=>r(n(e),t,s):r);return e.then((e=>{if(e)return e.start((()=>{var r=()=>e.continue();t&&!t(e,(e=>r=e),(t=>{e.stop(t),r=fe}),(t=>{e.fail(t),r=fe}))||s(e.value,e,(e=>r=e)),r()}))}))}function Wt(e,t){try{const r=Vt(e),n=Vt(t);if(r!==n)return"Array"===r?1:"Array"===n?-1:"binary"===r?1:"binary"===n?-1:"string"===r?1:"string"===n?-1:"Date"===r?1:"Date"!==n?NaN:-1;switch(r){case"number":case"Date":case"string":return e>t?1:e<t?-1:0;case"binary":return function(e,t){const r=e.length,n=t.length,s=r<n?r:n;for(let r=0;r<s;++r)if(e[r]!==t[r])return e[r]<t[r]?-1:1;return r===n?0:r<n?-1:1}(Jt(e),Jt(t));case"Array":return function(e,t){const r=e.length,n=t.length,s=r<n?r:n;for(let r=0;r<s;++r){const n=Wt(e[r],t[r]);if(0!==n)return n}return r===n?0:r<n?-1:1}(e,t)}}catch(e){}return NaN}function Vt(e){const t=typeof e;if("object"!==t)return t;if(ArrayBuffer.isView(e))return"binary";const r=F(e);return"ArrayBuffer"===r?"binary":r}function Jt(e){return e instanceof Uint8Array?e:ArrayBuffer.isView(e)?new Uint8Array(e.buffer,e.byteOffset,e.byteLength):new Uint8Array(e)}class zt{_read(e,t){var r=this._ctx;return r.error?r.table._trans(null,_t.bind(null,r.error)):r.table._trans("readonly",e).then(t)}_write(e){var t=this._ctx;return t.error?t.table._trans(null,_t.bind(null,t.error)):t.table._trans("readwrite",e,"locked")}_addAlgorithm(e){var t=this._ctx;t.algorithm=Ot(t.algorithm,e)}_iterate(e,t){return Ht(this._ctx,e,t,this._ctx.table.core)}clone(e){var t=Object.create(this.constructor.prototype),r=Object.create(this._ctx);return e&&g(r,e),t._ctx=r,t}raw(){return this._ctx.valueMapper=null,this}each(e){var t=this._ctx;return this._read((r=>Ht(t,e,r,t.table.core)))}count(e){return this._read((e=>{const t=this._ctx,r=t.table.core;if(Nt(t,!0))return r.count({trans:e,query:{index:Ft(t,r.schema),range:t.range}}).then((e=>Math.min(e,t.limit)));var n=0;return Ht(t,(()=>(++n,!1)),e,r).then((()=>n))})).then(e)}sortBy(e,t){const r=e.split(".").reverse(),n=r[0],s=r.length-1;function i(e,t){return t?i(e[r[t]],t-1):e[n]}var o="next"===this._ctx.dir?1:-1;function a(e,t){var r=i(e,s),n=i(t,s);return r<n?-o:r>n?o:0}return this.toArray((function(e){return e.sort(a)})).then(t)}toArray(e){return this._read((e=>{var t=this._ctx;if("next"===t.dir&&Nt(t,!0)&&t.limit>0){const{valueMapper:r}=t,n=Ft(t,t.table.core.schema);return t.table.core.query({trans:e,limit:t.limit,values:!0,query:{index:n,range:t.range}}).then((({result:e})=>r?e.map(r):e))}{const r=[];return Ht(t,(e=>r.push(e)),e,t.table.core).then((()=>r))}}),e)}offset(e){var t=this._ctx;return e<=0||(t.offset+=e,Nt(t)?Lt(t,(()=>{var t=e;return(e,r)=>0===t||(1===t?(--t,!1):(r((()=>{e.advance(t),t=0})),!1))})):Lt(t,(()=>{var t=e;return()=>--t<0}))),this}limit(e){return this._ctx.limit=Math.min(this._ctx.limit,e),Lt(this._ctx,(()=>{var t=e;return function(e,r,n){return--t<=0&&r(n),t>=0}}),!0),this}until(e,t){return Mt(this._ctx,(function(r,n,s){return!e(r.value)||(n(s),t)})),this}first(e){return this.limit(1).toArray((function(e){return e[0]})).then(e)}last(e){return this.reverse().first(e)}filter(e){var t,r;return Mt(this._ctx,(function(t){return e(t.value)})),t=this._ctx,r=e,t.isMatch=Ot(t.isMatch,r),this}and(e){return this.filter(e)}or(e){return new this.db.WhereClause(this._ctx.table,e,this)}reverse(){return this._ctx.dir="prev"===this._ctx.dir?"next":"prev",this._ondirectionchange&&this._ondirectionchange(this._ctx.dir),this}desc(){return this.reverse()}eachKey(e){var t=this._ctx;return t.keysOnly=!t.isMatch,this.each((function(t,r){e(r.key,r)}))}eachUniqueKey(e){return this._ctx.unique="unique",this.eachKey(e)}eachPrimaryKey(e){var t=this._ctx;return t.keysOnly=!t.isMatch,this.each((function(t,r){e(r.primaryKey,r)}))}keys(e){var t=this._ctx;t.keysOnly=!t.isMatch;var r=[];return this.each((function(e,t){r.push(t.key)})).then((function(){return r})).then(e)}primaryKeys(e){var t=this._ctx;if("next"===t.dir&&Nt(t,!0)&&t.limit>0)return this._read((e=>{var r=Ft(t,t.table.core.schema);return t.table.core.query({trans:e,values:!1,limit:t.limit,query:{index:r,range:t.range}})})).then((({result:e})=>e)).then(e);t.keysOnly=!t.isMatch;var r=[];return this.each((function(e,t){r.push(t.primaryKey)})).then((function(){return r})).then(e)}uniqueKeys(e){return this._ctx.unique="unique",this.keys(e)}firstKey(e){return this.limit(1).keys((function(e){return e[0]})).then(e)}lastKey(e){return this.reverse().firstKey(e)}distinct(){var e=this._ctx,t=e.index&&e.table.schema.idxByName[e.index];if(!t||!t.multi)return this;var r={};return Mt(this._ctx,(function(e){var t=e.primaryKey.toString(),n=v(r,t);return r[t]=!0,!n})),this}modify(e){var t=this._ctx;return this._write((r=>{var n;if("function"==typeof e)n=e;else{var s=f(e),i=s.length;n=function(t){for(var r=!1,n=0;n<i;++n){var o=s[n],a=e[o];E(t,o)!==a&&(D(t,o,a),r=!0)}return r}}const o=t.table.core,{outbound:a,extractKey:u}=o.schema.primaryKey,c=this.db._options.modifyChunkSize||200,l=[];let h=0;const p=[],d=(e,t)=>{const{failures:r,numFailures:n}=t;h+=e-n;for(let e of f(r))l.push(r[e])};return this.clone().primaryKeys().then((s=>{const i=l=>{const h=Math.min(c,s.length-l);return o.getMany({trans:r,keys:s.slice(l,l+h),cache:"immutable"}).then((p=>{const f=[],g=[],m=a?[]:null,y=[];for(let e=0;e<h;++e){const t=p[e],r={value:N(t),primKey:s[l+e]};!1!==n.call(r,r.value,r)&&(null==r.value?y.push(s[l+e]):a||0===Wt(u(t),u(r.value))?(g.push(r.value),a&&m.push(s[l+e])):(y.push(s[l+e]),f.push(r.value)))}const v=Nt(t)&&t.limit===1/0&&("function"!=typeof e||e===Xt)&&{index:t.index,range:t.range};return Promise.resolve(f.length>0&&o.mutate({trans:r,type:"add",values:f}).then((e=>{for(let t in e.failures)y.splice(parseInt(t),1);d(f.length,e)}))).then((()=>(g.length>0||v&&"object"==typeof e)&&o.mutate({trans:r,type:"put",keys:m,values:g,criteria:v,changeSpec:"function"!=typeof e&&e}).then((e=>d(g.length,e))))).then((()=>(y.length>0||v&&e===Xt)&&o.mutate({trans:r,type:"delete",keys:y,criteria:v}).then((e=>d(y.length,e))))).then((()=>s.length>l+h&&i(l+c)))}))};return i(0).then((()=>{if(l.length>0)throw new oe("Error modifying one or more objects",l,h,p);return s.length}))}))}))}delete(){var e=this._ctx,t=e.range;return Nt(e)&&(e.isPrimKey&&!Et||3===t.type)?this._write((r=>{const{primaryKey:n}=e.table.core.schema,s=t;return e.table.core.count({trans:r,query:{index:n,range:s}}).then((t=>e.table.core.mutate({trans:r,type:"deleteRange",range:s}).then((({failures:e,lastResult:r,results:n,numFailures:s})=>{if(s)throw new oe("Could not delete some values",Object.keys(e).map((t=>e[t])),t-s);return t-s}))))})):this.modify(Xt)}}const Xt=(e,t)=>t.value=null;function Qt(e,t){return e<t?-1:e===t?0:1}function Yt(e,t){return e>t?-1:e===t?0:1}function Zt(e,t,r){var n=e instanceof ir?new e.Collection(e):e;return n._ctx.error=r?new r(t):new TypeError(t),n}function er(e){return new e.Collection(e,(()=>sr(""))).limit(0)}function tr(e,t,r,n,s,i){for(var o=Math.min(e.length,n.length),a=-1,u=0;u<o;++u){var c=t[u];if(c!==n[u])return s(e[u],r[u])<0?e.substr(0,u)+r[u]+r.substr(u+1):s(e[u],n[u])<0?e.substr(0,u)+n[u]+r.substr(u+1):a>=0?e.substr(0,a)+t[a]+r.substr(a+1):null;s(e[u],c)<0&&(a=u)}return o<n.length&&"next"===i?e+r.substr(e.length):o<e.length&&"prev"===i?e.substr(0,r.length):a<0?null:e.substr(0,a)+n[a]+r.substr(a+1)}function rr(e,t,r,n){var s,i,o,a,u,c,l,h=r.length;if(!r.every((e=>"string"==typeof e)))return Zt(e,"String expected.");function p(e){s=function(e){return"next"===e?e=>e.toUpperCase():e=>e.toLowerCase()}(e),i=function(e){return"next"===e?e=>e.toLowerCase():e=>e.toUpperCase()}(e),o="next"===e?Qt:Yt;var t=r.map((function(e){return{lower:i(e),upper:s(e)}})).sort((function(e,t){return o(e.lower,t.lower)}));a=t.map((function(e){return e.upper})),u=t.map((function(e){return e.lower})),c=e,l="next"===e?"":n}p("next");var f=new e.Collection(e,(()=>nr(a[0],u[h-1]+n)));f._ondirectionchange=function(e){p(e)};var d=0;return f._addAlgorithm((function(e,r,n){var s=e.key;if("string"!=typeof s)return!1;var p=i(s);if(t(p,u,d))return!0;for(var f=null,g=d;g<h;++g){var m=tr(s,p,a[g],u[g],o,c);null===m&&null===f?d=g+1:(null===f||o(f,m)>0)&&(f=m)}return r(null!==f?function(){e.continue(f+l)}:n),!1})),f}function nr(e,t,r,n){return{type:2,lower:e,upper:t,lowerOpen:r,upperOpen:n}}function sr(e){return{type:1,lower:e,upper:e}}class ir{get Collection(){return this._ctx.table.db.Collection}between(e,t,r,n){r=!1!==r,n=!0===n;try{return this._cmp(e,t)>0||0===this._cmp(e,t)&&(r||n)&&(!r||!n)?er(this):new this.Collection(this,(()=>nr(e,t,!r,!n)))}catch(e){return Zt(this,jt)}}equals(e){return null==e?Zt(this,jt):new this.Collection(this,(()=>sr(e)))}above(e){return null==e?Zt(this,jt):new this.Collection(this,(()=>nr(e,void 0,!0)))}aboveOrEqual(e){return null==e?Zt(this,jt):new this.Collection(this,(()=>nr(e,void 0,!1)))}below(e){return null==e?Zt(this,jt):new this.Collection(this,(()=>nr(void 0,e,!1,!0)))}belowOrEqual(e){return null==e?Zt(this,jt):new this.Collection(this,(()=>nr(void 0,e)))}startsWith(e){return"string"!=typeof e?Zt(this,"String expected."):this.between(e,e+kt,!0,!0)}startsWithIgnoreCase(e){return""===e?this.startsWith(e):rr(this,((e,t)=>0===e.indexOf(t[0])),[e],kt)}equalsIgnoreCase(e){return rr(this,((e,t)=>e===t[0]),[e],"")}anyOfIgnoreCase(){var e=V.apply(W,arguments);return 0===e.length?er(this):rr(this,((e,t)=>-1!==t.indexOf(e)),e,"")}startsWithAnyOfIgnoreCase(){var e=V.apply(W,arguments);return 0===e.length?er(this):rr(this,((e,t)=>t.some((t=>0===e.indexOf(t)))),e,kt)}anyOf(){const e=V.apply(W,arguments);let t=this._cmp;try{e.sort(t)}catch(e){return Zt(this,jt)}if(0===e.length)return er(this);const r=new this.Collection(this,(()=>nr(e[0],e[e.length-1])));r._ondirectionchange=r=>{t="next"===r?this._ascending:this._descending,e.sort(t)};let n=0;return r._addAlgorithm(((r,s,i)=>{const o=r.key;for(;t(o,e[n])>0;)if(++n,n===e.length)return s(i),!1;return 0===t(o,e[n])||(s((()=>{r.continue(e[n])})),!1)})),r}notEqual(e){return this.inAnyRange([[-1/0,e],[e,this.db._maxKey]],{includeLowers:!1,includeUppers:!1})}noneOf(){const e=V.apply(W,arguments);if(0===e.length)return new this.Collection(this);try{e.sort(this._ascending)}catch(e){return Zt(this,jt)}const t=e.reduce(((e,t)=>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})}inAnyRange(e,t){const r=this._cmp,n=this._ascending,s=this._descending,i=this._min,o=this._max;if(0===e.length)return er(this);if(!e.every((e=>void 0!==e[0]&&void 0!==e[1]&&n(e[0],e[1])<=0)))return Zt(this,"First argument to inAnyRange() must be an Array of two-value Arrays [lower,upper] where upper must not be lower than lower",le.InvalidArgument);const a=!t||!1!==t.includeLowers,u=t&&!0===t.includeUppers;let c,l=n;function h(e,t){return l(e[0],t[0])}try{c=e.reduce((function(e,t){let n=0,s=e.length;for(;n<s;++n){const s=e[n];if(r(t[0],s[1])<0&&r(t[1],s[0])>0){s[0]=i(s[0],t[0]),s[1]=o(s[1],t[1]);break}}return n===s&&e.push(t),e}),[]),c.sort(h)}catch(e){return Zt(this,jt)}let p=0;const f=u?e=>n(e,c[p][1])>0:e=>n(e,c[p][1])>=0,d=a?e=>s(e,c[p][0])>0:e=>s(e,c[p][0])>=0;let g=f;const m=new this.Collection(this,(()=>nr(c[0][0],c[c.length-1][1],!a,!u)));return m._ondirectionchange=e=>{"next"===e?(g=f,l=n):(g=d,l=s),c.sort(h)},m._addAlgorithm(((e,t,r)=>{for(var s=e.key;g(s);)if(++p,p===c.length)return t(r),!1;return!!function(e){return!f(e)&&!d(e)}(s)||(0===this._cmp(s,c[p][1])||0===this._cmp(s,c[p][0])||t((()=>{l===n?e.continue(c[p][0]):e.continue(c[p][1])})),!1)})),m}startsWithAnyOf(){const e=V.apply(W,arguments);return e.every((e=>"string"==typeof e))?0===e.length?er(this):this.inAnyRange(e.map((e=>[e,e+kt]))):Zt(this,"startsWithAnyOf() only works with strings")}}function or(e){return st((function(t){return ar(t),e(t.target.error),!1}))}function ar(e){e.stopPropagation&&e.stopPropagation(),e.preventDefault&&e.preventDefault()}const ur=Bt(null,"storagemutated");class cr{_lock(){return P(!Ne.global),++this._reculock,1!==this._reculock||Ne.global||(Ne.lockOwnerFor=this),this}_unlock(){if(P(!Ne.global),0==--this._reculock)for(Ne.global||(Ne.lockOwnerFor=null);this._blockedFuncs.length>0&&!this._locked();){var e=this._blockedFuncs.shift();try{bt(e[1],e[0])}catch(e){}}return this}_locked(){return this._reculock&&Ne.lockOwnerFor!==this}create(e){if(!this.mode)return this;const t=this.db.idbdb,r=this.db._state.dbOpenError;if(P(!this.idbtrans),!e&&!t)switch(r&&r.name){case"DatabaseClosedError":throw new le.DatabaseClosed(r);case"MissingAPIError":throw new le.MissingAPI(r.message,r);default:throw new le.OpenFailed(r)}if(!this.active)throw new le.TransactionInactive;return P(null===this._completion._state),(e=this.idbtrans=e||(this.db.core?this.db.core.transaction(this.storeNames,this.mode,{durability:this.chromeTransactionDurability}):t.transaction(this.storeNames,this.mode,{durability:this.chromeTransactionDurability}))).onerror=st((t=>{ar(t),this._reject(e.error)})),e.onabort=st((t=>{ar(t),this.active&&this._reject(new le.Abort(e.error)),this.active=!1,this.on("abort").fire(t)})),e.oncomplete=st((()=>{this.active=!1,this._resolve(),"mutatedParts"in e&&ur.storagemutated.fire(e.mutatedParts)})),this}_promise(e,t,r){if("readwrite"===e&&"readwrite"!==this.mode)return _t(new le.ReadOnly("Transaction is readonly"));if(!this.active)return _t(new le.TransactionInactive);if(this._locked())return new Ge(((n,s)=>{this._blockedFuncs.push([()=>{this._promise(e,t,r).then(n,s)},Ne])}));if(r)return ht((()=>{var e=new Ge(((e,r)=>{this._lock();const n=t(e,r,this);n&&n.then&&n.then(e,r)}));return e.finally((()=>this._unlock())),e._lib=!0,e}));var n=new Ge(((e,r)=>{var n=t(e,r,this);n&&n.then&&n.then(e,r)}));return n._lib=!0,n}_root(){return this.parent?this.parent._root():this}waitFor(e){var t=this._root();const r=Ge.resolve(e);if(t._waitingFor)t._waitingFor=t._waitingFor.then((()=>r));else{t._waitingFor=r,t._waitingQueue=[];var n=t.idbtrans.objectStore(t.storeNames[0]);!function e(){for(++t._spinCount;t._waitingQueue.length;)t._waitingQueue.shift()();t._waitingFor&&(n.get(-1/0).onsuccess=e)}()}var s=t._waitingFor;return new Ge(((e,n)=>{r.then((r=>t._waitingQueue.push(st(e.bind(null,r)))),(e=>t._waitingQueue.push(st(n.bind(null,e))))).finally((()=>{t._waitingFor===s&&(t._waitingFor=null)}))}))}abort(){this.active&&(this.active=!1,this.idbtrans&&this.idbtrans.abort(),this._reject(new le.Abort))}table(e){const t=this._memoizedTables||(this._memoizedTables={});if(v(t,e))return t[e];const r=this.schema[e];if(!r)throw new le.NotFound("Table "+e+" not part of transaction");const n=new this.db.Table(e,r,this);return n.core=this.db.core.table(e),t[e]=n,n}}function lr(e,t,r,n,s,i,o){return{name:e,keyPath:t,unique:r,multi:n,auto:s,compound:i,src:(r&&!o?"&":"")+(n?"*":"")+(s?"++":"")+hr(t)}}function hr(e){return"string"==typeof e?e:e?"["+[].join.call(e,"+")+"]":""}function pr(e,t,r){return{name:e,primKey:t,indexes:r,mappedClass:null,idxByName:S(r,(e=>[e.name,e]))}}let fr=e=>{try{return e.only([[]]),fr=()=>[[]],[[]]}catch(e){return fr=()=>kt,kt}};function dr(e){return null==e?()=>{}:"string"==typeof e?function(e){return 1===e.split(".").length?t=>t[e]:t=>E(t,e)}(e):t=>E(t,e)}function gr(e){return[].slice.call(e)}let mr=0;function yr(e){return null==e?":id":"string"==typeof e?e:`[${e.join("+")}]`}function vr(e,t,r){function n(e){if(3===e.type)return null;if(4===e.type)throw new Error("Cannot convert never type to IDBKeyRange");const{lower:r,upper:n,lowerOpen:s,upperOpen:i}=e;return void 0===r?void 0===n?null:t.upperBound(n,!!i):void 0===n?t.lowerBound(r,!!s):t.bound(r,n,!!s,!!i)}const{schema:s,hasGetAll:i}=function(e,t){const r=gr(e.objectStoreNames);return{schema:{name:e.name,tables:r.map((e=>t.objectStore(e))).map((e=>{const{keyPath:t,autoIncrement:r}=e,n=d(t),s=null==t,i={},o={name:e.name,primaryKey:{name:null,isPrimaryKey:!0,outbound:s,compound:n,keyPath:t,autoIncrement:r,unique:!0,extractKey:dr(t)},indexes:gr(e.indexNames).map((t=>e.index(t))).map((e=>{const{name:t,unique:r,multiEntry:n,keyPath:s}=e,o={name:t,compound:d(s),keyPath:s,unique:r,multiEntry:n,extractKey:dr(s)};return i[yr(s)]=o,o})),getIndexByKeyPath:e=>i[yr(e)]};return i[":id"]=o.primaryKey,null!=t&&(i[yr(t)]=o.primaryKey),o}))},hasGetAll:r.length>0&&"getAll"in t.objectStore(r[0])&&!("undefined"!=typeof navigator&&/Safari/.test(navigator.userAgent)&&!/(Chrome\/|Edge\/)/.test(navigator.userAgent)&&[].concat(navigator.userAgent.match(/Safari\/(\d*)/))[1]<604)}}(e,r),o=s.tables.map((e=>function(e){const t=e.name;return{name:t,schema:e,mutate:function({trans:e,type:r,keys:s,values:i,range:o}){return new Promise(((a,u)=>{a=st(a);const c=e.objectStore(t),l=null==c.keyPath,h="put"===r||"add"===r;if(!h&&"delete"!==r&&"deleteRange"!==r)throw new Error("Invalid operation type: "+r);const{length:p}=s||i||{length:1};if(s&&i&&s.length!==i.length)throw new Error("Given keys array must have same length as given values array.");if(0===p)return a({numFailures:0,failures:{},results:[],lastResult:void 0});let f;const d=[],g=[];let m=0;const y=e=>{++m,ar(e)};if("deleteRange"===r){if(4===o.type)return a({numFailures:m,failures:g,results:[],lastResult:void 0});3===o.type?d.push(f=c.clear()):d.push(f=c.delete(n(o)))}else{const[e,t]=h?l?[i,s]:[i,null]:[s,null];if(h)for(let n=0;n<p;++n)d.push(f=t&&void 0!==t[n]?c[r](e[n],t[n]):c[r](e[n])),f.onerror=y;else for(let t=0;t<p;++t)d.push(f=c[r](e[t])),f.onerror=y}const v=e=>{const t=e.target.result;d.forEach(((e,t)=>null!=e.error&&(g[t]=e.error))),a({numFailures:m,failures:g,results:"delete"===r?s:d.map((e=>e.result)),lastResult:t})};f.onerror=e=>{y(e),v(e)},f.onsuccess=v}))},getMany:({trans:e,keys:r})=>new Promise(((n,s)=>{n=st(n);const i=e.objectStore(t),o=r.length,a=new Array(o);let u,c=0,l=0;const h=e=>{const t=e.target;a[t._pos]=t.result,++l===c&&n(a)},p=or(s);for(let e=0;e<o;++e)null!=r[e]&&(u=i.get(r[e]),u._pos=e,u.onsuccess=h,u.onerror=p,++c);0===c&&n(a)})),get:({trans:e,key:r})=>new Promise(((n,s)=>{n=st(n);const i=e.objectStore(t).get(r);i.onsuccess=e=>n(e.target.result),i.onerror=or(s)})),query:function(e){return r=>new Promise(((s,i)=>{s=st(s);const{trans:o,values:a,limit:u,query:c}=r,l=u===1/0?void 0:u,{index:h,range:p}=c,f=o.objectStore(t),d=h.isPrimaryKey?f:f.index(h.name),g=n(p);if(0===u)return s({result:[]});if(e){const e=a?d.getAll(g,l):d.getAllKeys(g,l);e.onsuccess=e=>s({result:e.target.result}),e.onerror=or(i)}else{let e=0;const t=a||!("openKeyCursor"in d)?d.openCursor(g):d.openKeyCursor(g),r=[];t.onsuccess=n=>{const i=t.result;return i?(r.push(a?i.value:i.primaryKey),++e===u?s({result:r}):void i.continue()):s({result:r})},t.onerror=or(i)}}))}(i),openCursor:function({trans:e,values:r,query:s,reverse:i,unique:o}){return new Promise(((a,u)=>{a=st(a);const{index:c,range:l}=s,h=e.objectStore(t),p=c.isPrimaryKey?h:h.index(c.name),f=i?o?"prevunique":"prev":o?"nextunique":"next",d=r||!("openKeyCursor"in p)?p.openCursor(n(l),f):p.openKeyCursor(n(l),f);d.onerror=or(u),d.onsuccess=st((t=>{const r=d.result;if(!r)return void a(null);r.___id=++mr,r.done=!1;const n=r.continue.bind(r);let s=r.continuePrimaryKey;s&&(s=s.bind(r));const i=r.advance.bind(r),o=()=>{throw new Error("Cursor not stopped")};r.trans=e,r.stop=r.continue=r.continuePrimaryKey=r.advance=()=>{throw new Error("Cursor not started")},r.fail=st(u),r.next=function(){let e=1;return this.start((()=>e--?this.continue():this.stop())).then((()=>this))},r.start=e=>{const t=new Promise(((e,t)=>{e=st(e),d.onerror=or(t),r.fail=t,r.stop=t=>{r.stop=r.continue=r.continuePrimaryKey=r.advance=o,e(t)}})),a=()=>{if(d.result)try{e()}catch(e){r.fail(e)}else r.done=!0,r.start=()=>{throw new Error("Cursor behind last entry")},r.stop()};return d.onsuccess=st((e=>{d.onsuccess=a,a()})),r.continue=n,r.continuePrimaryKey=s,r.advance=i,a(),t},a(r)}),u)}))},count({query:e,trans:r}){const{index:s,range:i}=e;return new Promise(((e,o)=>{const a=r.objectStore(t),u=s.isPrimaryKey?a:a.index(s.name),c=n(i),l=c?u.count(c):u.count();l.onsuccess=st((t=>e(t.target.result))),l.onerror=or(o)}))}}}(e))),a={};return o.forEach((e=>a[e.name]=e)),{stack:"dbcore",transaction:e.transaction.bind(e),table(e){if(!a[e])throw new Error(`Table '${e}' not found`);return a[e]},MIN_KEY:-1/0,MAX_KEY:fr(t),schema:s}}function br({_novip:e},t){const r=t.db,n=function(e,t,{IDBKeyRange:r,indexedDB:n},s){const i=function(e,t){return t.reduce(((e,{create:t})=>({...e,...t(e)})),e)}(vr(t,r,s),e.dbcore);return{dbcore:i}}(e._middlewares,r,e._deps,t);e.core=n.dbcore,e.tables.forEach((t=>{const r=t.name;e.core.schema.tables.some((e=>e.name===r))&&(t.core=e.core.table(r),e[r]instanceof e.Table&&(e[r].core=t.core))}))}function Tr({_novip:e},t,r,n){r.forEach((r=>{const s=n[r];t.forEach((t=>{const n=_(t,r);(!n||"value"in n&&void 0===n.value)&&(t===e.Transaction.prototype||t instanceof e.Transaction?w(t,r,{get(){return this.table(r)},set(e){T(this,r,{value:e,writable:!0,configurable:!0,enumerable:!0})}}):t[r]=new e.Table(r,s))}))}))}function wr({_novip:e},t){t.forEach((t=>{for(let r in t)t[r]instanceof e.Table&&delete t[r]}))}function Ar(e,t){return e._cfg.version-t._cfg.version}function qr(e,t,r,n){const s=e._dbSchema,i=e._createTransaction("readwrite",e._storeNames,s);i.create(r),i._completion.catch(n);const o=i._reject.bind(i),a=Ne.transless||Ne;ht((()=>{Ne.trans=i,Ne.transless=a,0===t?(f(s).forEach((e=>{Ur(r,e,s[e].primKey,s[e].indexes)})),br(e,r),Ge.follow((()=>e.on.populate.fire(i))).catch(o)):function({_novip:e},t,r,n){const s=[],i=e._versions;let o=e._dbSchema=jr(e,e.idbdb,n),a=!1;return i.filter((e=>e._cfg.version>=t)).forEach((i=>{s.push((()=>{const s=o,u=i._cfg.dbschema;Pr(e,s,n),Pr(e,u,n),o=e._dbSchema=u;const c=_r(s,u);c.add.forEach((e=>{Ur(n,e[0],e[1].primKey,e[1].indexes)})),c.change.forEach((e=>{if(e.recreate)throw new le.Upgrade("Not yet support for changing primary key");{const t=n.objectStore(e.name);e.add.forEach((e=>kr(t,e))),e.change.forEach((e=>{t.deleteIndex(e.name),kr(t,e)})),e.del.forEach((e=>t.deleteIndex(e)))}}));const l=i._cfg.contentUpgrade;if(l&&i._cfg.version>t){br(e,n),r._memoizedTables={},a=!0;let t=O(u);c.del.forEach((e=>{t[e]=s[e]})),wr(e,[e.Transaction.prototype]),Tr(e,[e.Transaction.prototype],f(t),t),r.schema=t;const i=J(l);let o;i&&pt();const h=Ge.follow((()=>{if(o=l(r),o&&i){var e=ft.bind(null,null);o.then(e,e)}}));return o&&"function"==typeof o.then?Ge.resolve(o):h.then((()=>o))}})),s.push((t=>{a&&St||function(e,t){[].slice.call(t.db.objectStoreNames).forEach((r=>null==e[r]&&t.db.deleteObjectStore(r)))}(i._cfg.dbschema,t),wr(e,[e.Transaction.prototype]),Tr(e,[e.Transaction.prototype],e._storeNames,e._dbSchema),r.schema=e._dbSchema}))})),function e(){return s.length?Ge.resolve(s.shift()(r.idbtrans)).then(e):Ge.resolve()}().then((()=>{var e,t;t=n,f(e=o).forEach((r=>{t.db.objectStoreNames.contains(r)||Ur(t,r,e[r].primKey,e[r].indexes)}))}))}(e,t,i,r).catch(o)}))}function _r(e,t){const r={del:[],add:[],change:[]};let n;for(n in e)t[n]||r.del.push(n);for(n in t){const s=e[n],i=t[n];if(s){const e={name:n,def:i,recreate:!1,del:[],add:[],change:[]};if(""+(s.primKey.keyPath||"")!=""+(i.primKey.keyPath||"")||s.primKey.auto!==i.primKey.auto&&!xt)e.recreate=!0,r.change.push(e);else{const t=s.idxByName,n=i.idxByName;let o;for(o in t)n[o]||e.del.push(o);for(o in n){const r=t[o],s=n[o];r?r.src!==s.src&&e.change.push(s):e.add.push(s)}(e.del.length>0||e.add.length>0||e.change.length>0)&&r.change.push(e)}}else r.add.push([n,i])}return r}function Ur(e,t,r,n){const s=e.db.createObjectStore(t,r.keyPath?{keyPath:r.keyPath,autoIncrement:r.auto}:{autoIncrement:r.auto});return n.forEach((e=>kr(s,e))),s}function kr(e,t){e.createIndex(t.name,t.keyPath,{unique:t.unique,multiEntry:t.multi})}function jr(e,t,r){const n={};return k(t.objectStoreNames,0).forEach((e=>{const t=r.objectStore(e);let s=t.keyPath;const i=lr(hr(s),s||"",!1,!1,!!t.autoIncrement,s&&"string"!=typeof s,!0),o=[];for(let e=0;e<t.indexNames.length;++e){const r=t.index(t.indexNames[e]);s=r.keyPath;var a=lr(r.name,s,!!r.unique,!!r.multiEntry,!1,s&&"string"!=typeof s,!1);o.push(a)}n[e]=pr(e,i,o)})),n}function Pr({_novip:e},t,r){const n=r.db.objectStoreNames;for(let s=0;s<n.length;++s){const i=n[s],o=r.objectStore(i);e._hasGetAll="getAll"in o;for(let e=0;e<o.indexNames.length;++e){const r=o.indexNames[e],n=o.index(r).keyPath,s="string"==typeof n?n:"["+k(n).join("+")+"]";if(t[i]){const e=t[i].idxByName[s];e&&(e.name=r,delete t[i].idxByName[s],t[i].idxByName[r]=e)}}}"undefined"!=typeof navigator&&/Safari/.test(navigator.userAgent)&&!/(Chrome\/|Edge\/)/.test(navigator.userAgent)&&p.WorkerGlobalScope&&p instanceof p.WorkerGlobalScope&&[].concat(navigator.userAgent.match(/Safari\/(\d*)/))[1]<604&&(e._hasGetAll=!1)}class xr{_parseStoresSpec(e,t){f(e).forEach((r=>{if(null!==e[r]){var n=e[r].split(",").map(((e,t)=>{const r=(e=e.trim()).replace(/([&*]|\+\+)/g,""),n=/^\[/.test(r)?r.match(/^\[(.*)\]$/)[1].split("+"):r;return lr(r,n||null,/\&/.test(e),/\*/.test(e),/\+\+/.test(e),d(n),0===t)})),s=n.shift();if(s.multi)throw new le.Schema("Primary key cannot be multi-valued");n.forEach((e=>{if(e.auto)throw new le.Schema("Only primary key can be marked as autoIncrement (++)");if(!e.keyPath)throw new le.Schema("Index must have a name and cannot be an empty string")})),t[r]=pr(r,s,n)}}))}stores(e){const t=this.db;this._cfg.storesSource=this._cfg.storesSource?g(this._cfg.storesSource,e):e;const r=t._versions,n={};let s={};return r.forEach((e=>{g(n,e._cfg.storesSource),s=e._cfg.dbschema={},e._parseStoresSpec(n,s)})),t._dbSchema=s,wr(t,[t._allTables,t,t.Transaction.prototype]),Tr(t,[t._allTables,t,t.Transaction.prototype,this._cfg.tables],f(s),s),t._storeNames=f(s),this}upgrade(e){return this._cfg.contentUpgrade=we(this._cfg.contentUpgrade||fe,e),this}}function Sr(e,t){let r=e._dbNamesDB;return r||(r=e._dbNamesDB=new Qr("__dbnames",{addons:[],indexedDB:e,IDBKeyRange:t}),r.version(1).stores({dbnames:"name"})),r.table("dbnames")}function Er(e){return e&&"function"==typeof e.databases}function Dr(e){return ht((function(){return Ne.letThrough=!0,e()}))}function Or(){var e;return!navigator.userAgentData&&/Safari\//.test(navigator.userAgent)&&!/Chrom(e|ium)\//.test(navigator.userAgent)&&indexedDB.databases?new Promise((function(t){var r=function(){return indexedDB.databases().finally(t)};e=setInterval(r,100),r()})).finally((function(){return clearInterval(e)})):Promise.resolve()}function Cr(e){var t=t=>e.next(t),r=s(t),n=s((t=>e.throw(t)));function s(e){return t=>{var s=e(t),i=s.value;return s.done?i:i&&"function"==typeof i.then?i.then(r,n):d(i)?Promise.all(i).then(r,n):r(i)}}return s(t)()}function Rr(e,t,r){var n=arguments.length;if(n<2)throw new le.InvalidArgument("Too few arguments");for(var s=new Array(n-1);--n;)s[n-1]=arguments[n];r=s.pop();var i=R(s);return[e,i,r]}function Ir(e,t,r,n,s){return Ge.resolve().then((()=>{const i=Ne.transless||Ne,o=e._createTransaction(t,r,e._dbSchema,n),a={trans:o,transless:i};if(n)o.idbtrans=n.idbtrans;else try{o.create(),e._state.PR1398_maxLoop=3}catch(n){return n.name===ue.InvalidState&&e.isOpen()&&--e._state.PR1398_maxLoop>0?(console.warn("Dexie: Need to reopen db"),e._close(),e.open().then((()=>Ir(e,t,r,null,s)))):_t(n)}const u=J(s);let c;u&&pt();const l=Ge.follow((()=>{if(c=s.call(o,o),c)if(u){var e=ft.bind(null,null);c.then(e,e)}else"function"==typeof c.next&&"function"==typeof c.throw&&(c=Cr(c))}),a);return(c&&"function"==typeof c.then?Ge.resolve(c).then((e=>o.active?e:_t(new le.PrematureCommit("Transaction committed too early. See http://bit.ly/2kdckMn")))):l.then((()=>c))).then((e=>(n&&o._resolve(),o._completion.then((()=>e))))).catch((e=>(o._reject(e),_t(e))))}))}function Br(e,t,r){const n=d(e)?e.slice():[e];for(let e=0;e<r;++e)n.push(t);return n}const Kr={stack:"dbcore",name:"VirtualIndexMiddleware",level:1,create:function(e){return{...e,table(t){const r=e.table(t),{schema:n}=r,s={},i=[];function o(e,t,r){const n=yr(e),a=s[n]=s[n]||[],u=null==e?0:"string"==typeof e?1:e.length,c=t>0,l={...r,isVirtual:c,keyTail:t,keyLength:u,extractKey:dr(e),unique:!c&&r.unique};return a.push(l),l.isPrimaryKey||i.push(l),u>1&&o(2===u?e[0]:e.slice(0,u-1),t+1,r),a.sort(((e,t)=>e.keyTail-t.keyTail)),l}const a=o(n.primaryKey.keyPath,0,n.primaryKey);s[":id"]=[a];for(const e of n.indexes)o(e.keyPath,0,e);function u(t){const r=t.query.index;return r.isVirtual?{...t,query:{index:r,range:(n=t.query.range,s=r.keyTail,{type:1===n.type?2:n.type,lower:Br(n.lower,n.lowerOpen?e.MAX_KEY:e.MIN_KEY,s),lowerOpen:!0,upper:Br(n.upper,n.upperOpen?e.MIN_KEY:e.MAX_KEY,s),upperOpen:!0})}}:t;var n,s}const c={...r,schema:{...n,primaryKey:a,indexes:i,getIndexByKeyPath:function(e){const t=s[yr(e)];return t&&t[0]}},count:e=>r.count(u(e)),query:e=>r.query(u(e)),openCursor(t){const{keyTail:n,isVirtual:s,keyLength:i}=t.query.index;return s?r.openCursor(u(t)).then((r=>r&&function(r){const s=Object.create(r,{continue:{value:function(s){null!=s?r.continue(Br(s,t.reverse?e.MAX_KEY:e.MIN_KEY,n)):t.unique?r.continue(r.key.slice(0,i).concat(t.reverse?e.MIN_KEY:e.MAX_KEY,n)):r.continue()}},continuePrimaryKey:{value(t,s){r.continuePrimaryKey(Br(t,e.MAX_KEY,n),s)}},primaryKey:{get:()=>r.primaryKey},key:{get(){const e=r.key;return 1===i?e[0]:e.slice(0,i)}},value:{get:()=>r.value}});return s}(r))):r.openCursor(t)}};return c}}}};function Nr(e,t,r,n){return r=r||{},n=n||"",f(e).forEach((s=>{if(v(t,s)){var i=e[s],o=t[s];if("object"==typeof i&&"object"==typeof o&&i&&o){const e=F(i);e!==F(o)?r[n+s]=t[s]:"Object"===e?Nr(i,o,r,n+s+"."):i!==o&&(r[n+s]=t[s])}else i!==o&&(r[n+s]=t[s])}else r[n+s]=void 0})),f(t).forEach((s=>{v(e,s)||(r[n+s]=t[s])})),r}const Mr={stack:"dbcore",name:"HooksMiddleware",level:2,create:e=>({...e,table(t){const r=e.table(t),{primaryKey:n}=r.schema,s={...r,mutate(e){const s=Ne.trans,{deleting:i,creating:o,updating:a}=s.table(t).hook;switch(e.type){case"add":if(o.fire===fe)break;return s._promise("readwrite",(()=>u(e)),!0);case"put":if(o.fire===fe&&a.fire===fe)break;return s._promise("readwrite",(()=>u(e)),!0);case"delete":if(i.fire===fe)break;return s._promise("readwrite",(()=>u(e)),!0);case"deleteRange":if(i.fire===fe)break;return s._promise("readwrite",(()=>function(e){return c(e.trans,e.range,1e4)}(e)),!0)}return r.mutate(e);function u(e){const t=Ne.trans,s=e.keys||function(e,t){return"delete"===t.type?t.keys:t.keys||t.values.map(e.extractKey)}(n,e);if(!s)throw new Error("Keys missing");return"delete"!==(e="add"===e.type||"put"===e.type?{...e,keys:s}:{...e}).type&&(e.values=[...e.values]),e.keys&&(e.keys=[...e.keys]),function(e,t,r){return"add"===t.type?Promise.resolve([]):e.getMany({trans:t.trans,keys:r,cache:"immutable"})}(r,e,s).then((u=>{const c=s.map(((r,s)=>{const c=u[s],l={onerror:null,onsuccess:null};if("delete"===e.type)i.fire.call(l,r,c,t);else if("add"===e.type||void 0===c){const i=o.fire.call(l,r,e.values[s],t);null==r&&null!=i&&(r=i,e.keys[s]=r,n.outbound||D(e.values[s],n.keyPath,r))}else{const n=Nr(c,e.values[s]),i=a.fire.call(l,n,r,c,t);if(i){const t=e.values[s];Object.keys(i).forEach((e=>{v(t,e)?t[e]=i[e]:D(t,e,i[e])}))}}return l}));return r.mutate(e).then((({failures:t,results:r,numFailures:n,lastResult:i})=>{for(let n=0;n<s.length;++n){const i=r?r[n]:s[n],o=c[n];null==i?o.onerror&&o.onerror(t[n]):o.onsuccess&&o.onsuccess("put"===e.type&&u[n]?e.values[n]:i)}return{failures:t,results:r,numFailures:n,lastResult:i}})).catch((e=>(c.forEach((t=>t.onerror&&t.onerror(e))),Promise.reject(e))))}))}function c(e,t,s){return r.query({trans:e,values:!1,query:{index:n,range:t},limit:s}).then((({result:r})=>u({type:"delete",keys:r,trans:e}).then((n=>n.numFailures>0?Promise.reject(n.failures[0]):r.length<s?{failures:[],numFailures:0,lastResult:void 0}:c(e,{...t,lower:r[r.length-1],lowerOpen:!0},s)))))}}};return s}})};function Lr(e,t,r){try{if(!t)return null;if(t.keys.length<e.length)return null;const n=[];for(let s=0,i=0;s<t.keys.length&&i<e.length;++s)0===Wt(t.keys[s],e[i])&&(n.push(r?N(t.values[s]):t.values[s]),++i);return n.length===e.length?n:null}catch(e){return null}}const Fr={stack:"dbcore",level:-1,create:e=>({table:t=>{const r=e.table(t);return{...r,getMany:e=>{if(!e.cache)return r.getMany(e);const t=Lr(e.keys,e.trans._cache,"clone"===e.cache);return t?Ge.resolve(t):r.getMany(e).then((t=>(e.trans._cache={keys:e.keys,values:"clone"===e.cache?N(t):t},t)))},mutate:e=>("add"!==e.type&&(e.trans._cache=null),r.mutate(e))}}})};function Gr(e){return!("from"in e)}const Hr=function(e,t){if(!this){const t=new Hr;return e&&"d"in e&&g(t,e),t}g(this,arguments.length?{d:1,from:e,to:arguments.length>1?t:e}:{d:0})};function $r(e,t,r){const n=Wt(t,r);if(isNaN(n))return;if(n>0)throw RangeError();if(Gr(e))return g(e,{from:t,to:r,d:1});const s=e.l,i=e.r;if(Wt(r,e.from)<0)return s?$r(s,t,r):e.l={from:t,to:r,d:1,l:null,r:null},Jr(e);if(Wt(t,e.to)>0)return i?$r(i,t,r):e.r={from:t,to:r,d:1,l:null,r:null},Jr(e);Wt(t,e.from)<0&&(e.from=t,e.l=null,e.d=i?i.d+1:1),Wt(r,e.to)>0&&(e.to=r,e.r=null,e.d=e.l?e.l.d+1:1);const o=!e.r;s&&!e.l&&Wr(e,s),i&&o&&Wr(e,i)}function Wr(e,t){Gr(t)||function e(t,{from:r,to:n,l:s,r:i}){$r(t,r,n),s&&e(t,s),i&&e(t,i)}(e,t)}function Vr(e){let t=Gr(e)?null:{s:0,n:e};return{next(e){const r=arguments.length>0;for(;t;)switch(t.s){case 0:if(t.s=1,r)for(;t.n.l&&Wt(e,t.n.from)<0;)t={up:t,n:t.n.l,s:1};else for(;t.n.l;)t={up:t,n:t.n.l,s:1};case 1:if(t.s=2,!r||Wt(e,t.n.to)<=0)return{value:t.n,done:!1};case 2:if(t.n.r){t.s=3,t={up:t,n:t.n.r,s:0};continue}case 3:t=t.up}return{done:!0}}}}function Jr(e){var t,r;const n=((null===(t=e.r)||void 0===t?void 0:t.d)||0)-((null===(r=e.l)||void 0===r?void 0:r.d)||0),s=n>1?"r":n<-1?"l":"";if(s){const t="r"===s?"l":"r",r={...e},n=e[s];e.from=n.from,e.to=n.to,e[s]=n[s],r[s]=n[t],e[t]=r,r.d=zr(r)}e.d=zr(e)}function zr({r:e,l:t}){return(e?t?Math.max(e.d,t.d):e.d:t?t.d:0)+1}b(Hr.prototype,{add(e){return Wr(this,e),this},addKey(e){return $r(this,e,e),this},addKeys(e){return e.forEach((e=>$r(this,e,e))),this},[G](){return Vr(this)}});const Xr={stack:"dbcore",level:0,create:e=>{const t=e.schema.name,r=new Hr(e.MIN_KEY,e.MAX_KEY);return{...e,table:n=>{const s=e.table(n),{schema:i}=s,{primaryKey:o}=i,{extractKey:a,outbound:u}=o,c={...s,mutate:e=>{const o=e.trans,a=o.mutatedParts||(o.mutatedParts={}),u=e=>{const r=`idb://${t}/${n}/${e}`;return a[r]||(a[r]=new Hr)},c=u(""),l=u(":dels"),{type:h}=e;let[p,f]="deleteRange"===e.type?[e.range]:"delete"===e.type?[e.keys]:e.values.length<50?[[],e.values]:[];const g=e.trans._cache;return s.mutate(e).then((e=>{if(d(p)){"delete"!==h&&(p=e.results),c.addKeys(p);const t=Lr(p,g);t||"add"===h||l.addKeys(p),(t||f)&&function(e,t,r,n){t.indexes.forEach((function(t){const s=e(t.name||"");function i(e){return null!=e?t.extractKey(e):null}const o=e=>t.multiEntry&&d(e)?e.forEach((e=>s.addKey(e))):s.addKey(e);(r||n).forEach(((e,t)=>{const s=r&&i(r[t]),a=n&&i(n[t]);0!==Wt(s,a)&&(null!=s&&o(s),null!=a&&o(a))}))}))}(u,i,t,f)}else if(p){const e={from:p.lower,to:p.upper};l.add(e),c.add(e)}else c.add(r),l.add(r),i.indexes.forEach((e=>u(e.name).add(r)));return e}))}},l=({query:{index:t,range:r}})=>{var n,s;return[t,new Hr(null!==(n=r.lower)&&void 0!==n?n:e.MIN_KEY,null!==(s=r.upper)&&void 0!==s?s:e.MAX_KEY)]},h={get:e=>[o,new Hr(e.key)],getMany:e=>[o,(new Hr).addKeys(e.keys)],count:l,query:l,openCursor:l};return f(h).forEach((e=>{c[e]=function(i){const{subscr:o}=Ne;if(o){const c=e=>{const r=`idb://${t}/${n}/${e}`;return o[r]||(o[r]=new Hr)},l=c(""),p=c(":dels"),[f,d]=h[e](i);if(c(f.name||"").add(d),!f.isPrimaryKey){if("count"!==e){const t="query"===e&&u&&i.values&&s.query({...i,values:!1});return s[e].apply(this,arguments).then((r=>{if("query"===e){if(u&&i.values)return t.then((({result:e})=>(l.addKeys(e),r)));const e=i.values?r.result.map(a):r.result;i.values?l.addKeys(e):p.addKeys(e)}else if("openCursor"===e){const e=r,t=i.values;return e&&Object.create(e,{key:{get:()=>(p.addKey(e.primaryKey),e.key)},primaryKey:{get(){const t=e.primaryKey;return p.addKey(t),t}},value:{get:()=>(t&&l.addKey(e.primaryKey),e.value)}})}return r}))}p.add(r)}}return s[e].apply(this,arguments)}})),c}}}};class Qr{constructor(e,t){this._middlewares={},this.verno=0;const r=Qr.dependencies;this._options=t={addons:Qr.addons,autoOpen:!0,indexedDB:r.indexedDB,IDBKeyRange:r.IDBKeyRange,...t},this._deps={indexedDB:t.indexedDB,IDBKeyRange:t.IDBKeyRange};const{addons:n}=t;this._dbSchema={},this._versions=[],this._storeNames=[],this._allTables={},this.idbdb=null,this._novip=this;const s={dbOpenError:null,isBeingOpened:!1,onReadyBeingFired:null,openComplete:!1,dbReadyResolve:fe,dbReadyPromise:null,cancelOpen:fe,openCanceller:null,autoSchema:!0,PR1398_maxLoop:3};var i;s.dbReadyPromise=new Ge((e=>{s.dbReadyResolve=e})),s.openCanceller=new Ge(((e,t)=>{s.cancelOpen=t})),this._state=s,this.name=e,this.on=Bt(this,"populate","blocked","versionchange","close",{ready:[we,fe]}),this.on.ready.subscribe=j(this.on.ready.subscribe,(e=>(t,r)=>{Qr.vip((()=>{const n=this._state;if(n.openComplete)n.dbOpenError||Ge.resolve().then(t),r&&e(t);else if(n.onReadyBeingFired)n.onReadyBeingFired.push(t),r&&e(t);else{e(t);const n=this;r||e((function e(){n.on.ready.unsubscribe(t),n.on.ready.unsubscribe(e)}))}}))})),this.Collection=(i=this,Kt(zt.prototype,(function(e,t){this.db=i;let r=Ct,n=null;if(t)try{r=t()}catch(e){n=e}const s=e._ctx,o=s.table,a=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:n,or:s.or,valueMapper:a!==de?a:null}}))),this.Table=function(e){return Kt(It.prototype,(function(t,r,n){this.db=e,this._tx=n,this.name=t,this.schema=r,this.hook=e._allTables[t]?e._allTables[t].hook:Bt(null,{creating:[ye,fe],reading:[ge,de],updating:[be,fe],deleting:[ve,fe]})}))}(this),this.Transaction=function(e){return Kt(cr.prototype,(function(t,r,n,s,i){this.db=e,this.mode=t,this.storeNames=r,this.schema=n,this.chromeTransactionDurability=s,this.idbtrans=null,this.on=Bt(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 Ge(((e,t)=>{this._resolve=e,this._reject=t})),this._completion.then((()=>{this.active=!1,this.on.complete.fire()}),(e=>{var t=this.active;return this.active=!1,this.on.error.fire(e),this.parent?this.parent._reject(e):t&&this.idbtrans&&this.idbtrans.abort(),_t(e)}))}))}(this),this.Version=function(e){return Kt(xr.prototype,(function(t){this.db=e,this._cfg={version:t,storesSource:null,dbschema:{},tables:{},contentUpgrade:null}}))}(this),this.WhereClause=function(e){return Kt(ir.prototype,(function(t,r,n){this.db=e,this._ctx={table:t,index:":id"===r?null:r,or:n};const s=e._deps.indexedDB;if(!s)throw new le.MissingAPI;this._cmp=this._ascending=s.cmp.bind(s),this._descending=(e,t)=>s.cmp(t,e),this._max=(e,t)=>s.cmp(e,t)>0?e:t,this._min=(e,t)=>s.cmp(e,t)<0?e:t,this._IDBKeyRange=e._deps.IDBKeyRange}))}(this),this.on("versionchange",(e=>{e.newVersion>0?console.warn(`Another connection wants to upgrade database '${this.name}'. Closing db now to resume the upgrade.`):console.warn(`Another connection wants to delete database '${this.name}'. Closing db now to resume the delete request.`),this.close()})),this.on("blocked",(e=>{!e.newVersion||e.newVersion<e.oldVersion?console.warn(`Dexie.delete('${this.name}') was blocked`):console.warn(`Upgrade '${this.name}' blocked by other connection holding version ${e.oldVersion/10}`)})),this._maxKey=fr(t.IDBKeyRange),this._createTransaction=(e,t,r,n)=>new this.Transaction(e,t,r,this._options.chromeTransactionDurability,n),this._fireOnBlocked=e=>{this.on("blocked").fire(e),Pt.filter((e=>e.name===this.name&&e!==this&&!e._state.vcFired)).map((t=>t.on("versionchange").fire(e)))},this.use(Kr),this.use(Mr),this.use(Xr),this.use(Fr),this.vip=Object.create(this,{_vip:{value:!0}}),n.forEach((e=>e(this)))}version(e){if(isNaN(e)||e<.1)throw new le.Type("Given version is not a positive number");if(e=Math.round(10*e)/10,this.idbdb||this._state.isBeingOpened)throw new le.Schema("Cannot add version when database is open");this.verno=Math.max(this.verno,e);const t=this._versions;var r=t.filter((t=>t._cfg.version===e))[0];return r||(r=new this.Version(e),t.push(r),t.sort(Ar),r.stores({}),this._state.autoSchema=!1,r)}_whenReady(e){return this.idbdb&&(this._state.openComplete||Ne.letThrough||this._vip)?e():new Ge(((e,t)=>{if(this._state.openComplete)return t(new le.DatabaseClosed(this._state.dbOpenError));if(!this._state.isBeingOpened){if(!this._options.autoOpen)return void t(new le.DatabaseClosed);this.open().catch(fe)}this._state.dbReadyPromise.then(e,t)})).then(e)}use({stack:e,create:t,level:r,name:n}){n&&this.unuse({stack:e,name:n});const s=this._middlewares[e]||(this._middlewares[e]=[]);return s.push({stack:e,create:t,level:null==r?10:r,name:n}),s.sort(((e,t)=>e.level-t.level)),this}unuse({stack:e,name:t,create:r}){return e&&this._middlewares[e]&&(this._middlewares[e]=this._middlewares[e].filter((e=>r?e.create!==r:!!t&&e.name!==t))),this}open(){return function(e){const t=e._state,{indexedDB:r}=e._deps;if(t.isBeingOpened||e.idbdb)return t.dbReadyPromise.then((()=>t.dbOpenError?_t(t.dbOpenError):e));z&&(t.openCanceller._stackHolder=Z()),t.isBeingOpened=!0,t.dbOpenError=null,t.openComplete=!1;const n=t.openCanceller;function s(){if(t.openCanceller!==n)throw new le.DatabaseClosed("db.open() was cancelled")}let i=t.dbReadyResolve,o=null,a=!1;return Ge.race([n,("undefined"==typeof navigator?Ge.resolve():Or()).then((()=>new Ge(((n,i)=>{if(s(),!r)throw new le.MissingAPI;const u=e.name,c=t.autoSchema?r.open(u):r.open(u,Math.round(10*e.verno));if(!c)throw new le.MissingAPI;c.onerror=or(i),c.onblocked=st(e._fireOnBlocked),c.onupgradeneeded=st((n=>{if(o=c.transaction,t.autoSchema&&!e._options.allowEmptyDB){c.onerror=ar,o.abort(),c.result.close();const e=r.deleteDatabase(u);e.onsuccess=e.onerror=st((()=>{i(new le.NoSuchDatabase(`Database ${u} doesnt exist`))}))}else{o.onerror=or(i);var s=n.oldVersion>Math.pow(2,62)?0:n.oldVersion;a=s<1,e._novip.idbdb=c.result,qr(e,s/10,o,i)}}),i),c.onsuccess=st((()=>{o=null;const r=e._novip.idbdb=c.result,s=k(r.objectStoreNames);if(s.length>0)try{const n=r.transaction(1===(i=s).length?i[0]:i,"readonly");t.autoSchema?function({_novip:e},t,r){e.verno=t.version/10;const n=e._dbSchema=jr(0,t,r);e._storeNames=k(t.objectStoreNames,0),Tr(e,[e._allTables],f(n),n)}(e,r,n):(Pr(e,e._dbSchema,n),function(e,t){const r=_r(jr(0,e.idbdb,t),e._dbSchema);return!(r.add.length||r.change.some((e=>e.add.length||e.change.length)))}(e,n)||console.warn("Dexie SchemaDiff: Schema was extended without increasing the number passed to db.version(). Some queries may fail.")),br(e,n)}catch(e){}var i;Pt.push(e),r.onversionchange=st((r=>{t.vcFired=!0,e.on("versionchange").fire(r)})),r.onclose=st((t=>{e.on("close").fire(t)})),a&&function({indexedDB:e,IDBKeyRange:t},r){!Er(e)&&"__dbnames"!==r&&Sr(e,t).put({name:r}).catch(fe)}(e._deps,u),n()}),i)}))))]).then((()=>(s(),t.onReadyBeingFired=[],Ge.resolve(Dr((()=>e.on.ready.fire(e.vip)))).then((function r(){if(t.onReadyBeingFired.length>0){let n=t.onReadyBeingFired.reduce(we,fe);return t.onReadyBeingFired=[],Ge.resolve(Dr((()=>n(e.vip)))).then(r)}}))))).finally((()=>{t.onReadyBeingFired=null,t.isBeingOpened=!1})).then((()=>e)).catch((r=>{t.dbOpenError=r;try{o&&o.abort()}catch(e){}return n===t.openCanceller&&e._close(),_t(r)})).finally((()=>{t.openComplete=!0,i()}))}(this)}_close(){const e=this._state,t=Pt.indexOf(this);if(t>=0&&Pt.splice(t,1),this.idbdb){try{this.idbdb.close()}catch(e){}this._novip.idbdb=null}e.dbReadyPromise=new Ge((t=>{e.dbReadyResolve=t})),e.openCanceller=new Ge(((t,r)=>{e.cancelOpen=r}))}close(){this._close();const e=this._state;this._options.autoOpen=!1,e.dbOpenError=new le.DatabaseClosed,e.isBeingOpened&&e.cancelOpen(e.dbOpenError)}delete(){const e=arguments.length>0,t=this._state;return new Ge(((r,n)=>{const s=()=>{this.close();var e=this._deps.indexedDB.deleteDatabase(this.name);e.onsuccess=st((()=>{!function({indexedDB:e,IDBKeyRange:t},r){!Er(e)&&"__dbnames"!==r&&Sr(e,t).delete(r).catch(fe)}(this._deps,this.name),r()})),e.onerror=or(n),e.onblocked=this._fireOnBlocked};if(e)throw new le.InvalidArgument("Arguments not allowed in db.delete()");t.isBeingOpened?t.dbReadyPromise.then(s):s()}))}backendDB(){return this.idbdb}isOpen(){return null!==this.idbdb}hasBeenClosed(){const e=this._state.dbOpenError;return e&&"DatabaseClosed"===e.name}hasFailed(){return null!==this._state.dbOpenError}dynamicallyOpened(){return this._state.autoSchema}get tables(){return f(this._allTables).map((e=>this._allTables[e]))}transaction(){const e=Rr.apply(this,arguments);return this._transaction.apply(this,e)}_transaction(e,t,r){let n=Ne.trans;n&&n.db===this&&-1===e.indexOf("!")||(n=null);const s=-1!==e.indexOf("?");let i,o;e=e.replace("!","").replace("?","");try{if(o=t.map((e=>{var t=e instanceof this.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||"readonly"===e)i="readonly";else{if("rw"!=e&&"readwrite"!=e)throw new le.InvalidArgument("Invalid transaction mode: "+e);i="readwrite"}if(n){if("readonly"===n.mode&&"readwrite"===i){if(!s)throw new le.SubTransaction("Cannot enter a sub-transaction with READWRITE mode when parent transaction is READONLY");n=null}n&&o.forEach((e=>{if(n&&-1===n.storeNames.indexOf(e)){if(!s)throw new le.SubTransaction("Table "+e+" not included in parent transaction.");n=null}})),s&&n&&!n.active&&(n=null)}}catch(e){return n?n._promise(null,((t,r)=>{r(e)})):_t(e)}const a=Ir.bind(null,this,i,o,n,r);return n?n._promise(i,a,"lock"):Ne.trans?bt(Ne.transless,(()=>this._whenReady(a))):this._whenReady(a)}table(e){if(!v(this._allTables,e))throw new le.InvalidTable(`Table ${e} does not exist`);return this._allTables[e]}}const Yr="undefined"!=typeof Symbol&&"observable"in Symbol?Symbol.observable:"@@observable";class Zr{constructor(e){this._subscribe=e}subscribe(e,t,r){return this._subscribe(e&&"function"!=typeof e?e:{next:e,error:t,complete:r})}[Yr](){return this}}function en(e,t){return f(t).forEach((r=>{Wr(e[r]||(e[r]=new Hr),t[r])})),e}let tn;try{tn={indexedDB:p.indexedDB||p.mozIndexedDB||p.webkitIndexedDB||p.msIndexedDB,IDBKeyRange:p.IDBKeyRange||p.webkitIDBKeyRange}}catch(p){tn={indexedDB:null,IDBKeyRange:null}}const rn=Qr;function nn(e){let t=sn;try{sn=!0,ur.storagemutated.fire(e)}finally{sn=t}}b(rn,{...pe,delete:e=>new rn(e,{addons:[]}).delete(),exists:e=>new rn(e,{addons:[]}).open().then((e=>(e.close(),!0))).catch("NoSuchDatabaseError",(()=>!1)),getDatabaseNames(e){try{return function({indexedDB:e,IDBKeyRange:t}){return Er(e)?Promise.resolve(e.databases()).then((e=>e.map((e=>e.name)).filter((e=>"__dbnames"!==e)))):Sr(e,t).toCollection().primaryKeys()}(rn.dependencies).then(e)}catch(e){return _t(new le.MissingAPI)}},defineClass:()=>function(e){g(this,e)},ignoreTransaction:e=>Ne.trans?bt(Ne.transless,e):e(),vip:Dr,async:function(e){return function(){try{var t=Cr(e.apply(this,arguments));return t&&"function"==typeof t.then?t:Ge.resolve(t)}catch(e){return _t(e)}}},spawn:function(e,t,r){try{var n=Cr(e.apply(r,t||[]));return n&&"function"==typeof n.then?n:Ge.resolve(n)}catch(e){return _t(e)}},currentTransaction:{get:()=>Ne.trans||null},waitFor:function(e,t){const r=Ge.resolve("function"==typeof e?rn.ignoreTransaction(e):e).timeout(t||6e4);return Ne.trans?Ne.trans.waitFor(r):r},Promise:Ge,debug:{get:()=>z,set:e=>{X(e,"dexie"===e?()=>!0:Dt)}},derive:A,extend:g,props:b,override:j,Events:Bt,on:ur,liveQuery:function(e){return new Zr((t=>{const r=J(e);let n=!1,s={},i={};const o={get closed(){return n},unsubscribe:()=>{n=!0,ur.storagemutated.unsubscribe(l)}};t.start&&t.start(o);let a=!1,u=!1;function c(){return f(i).some((e=>s[e]&&function(e,t){const r=Vr(t);let n=r.next();if(n.done)return!1;let s=n.value;const i=Vr(e);let o=i.next(s.from),a=o.value;for(;!n.done&&!o.done;){if(Wt(a.from,s.to)<=0&&Wt(a.to,s.from)>=0)return!0;Wt(s.from,a.from)<0?s=(n=r.next(a.from)).value:a=(o=i.next(s.from)).value}return!1}(s[e],i[e])))}const l=e=>{en(s,e),c()&&h()},h=()=>{if(a||n)return;s={};const p={},f=function(t){r&&pt();const n=()=>ht(e,{subscr:t,trans:null}),s=Ne.trans?bt(Ne.transless,n):n();return r&&s.then(ft,ft),s}(p);u||(ur("storagemutated",l),u=!0),a=!0,Promise.resolve(f).then((e=>{a=!1,n||(c()?h():(s={},i=p,t.next&&t.next(e)))}),(e=>{a=!1,t.error&&t.error(e),o.unsubscribe()}))};return h(),o}))},extendObservabilitySet:en,getByKeyPath:E,setByKeyPath:D,delByKeyPath:function(e,t){"string"==typeof t?D(e,t,void 0):"length"in t&&[].map.call(t,(function(t){D(e,t,void 0)}))},shallowClone:O,deepClone:N,getObjectDiff:Nr,cmp:Wt,asap:x,minKey:-1/0,addons:[],connections:Pt,errnames:ue,dependencies:tn,semVer:"3.2.3",version:"3.2.3".split(".").map((e=>parseInt(e))).reduce(((e,t,r)=>e+t/Math.pow(10,2*r)))}),rn.maxKey=fr(rn.dependencies.IDBKeyRange),"undefined"!=typeof dispatchEvent&&"undefined"!=typeof addEventListener&&(ur("storagemutated",(e=>{if(!sn){let t;xt?(t=document.createEvent("CustomEvent"),t.initCustomEvent("x-storagemutated-1",!0,!0,e)):t=new CustomEvent("x-storagemutated-1",{detail:e}),sn=!0,dispatchEvent(t),sn=!1}})),addEventListener("x-storagemutated-1",(({detail:e})=>{sn||nn(e)})));let sn=!1;if("undefined"!=typeof BroadcastChannel){const e=new BroadcastChannel("x-storagemutated-1");"function"==typeof e.unref&&e.unref(),ur("storagemutated",(t=>{sn||e.postMessage(t)})),e.onmessage=e=>{e.data&&nn(e.data)}}else if("undefined"!=typeof self&&"undefined"!=typeof navigator){ur("storagemutated",(e=>{try{sn||("undefined"!=typeof localStorage&&localStorage.setItem("x-storagemutated-1",JSON.stringify({trig:Math.random(),changedParts:e})),"object"==typeof self.clients&&[...self.clients.matchAll({includeUncontrolled:!0})].forEach((t=>t.postMessage({type:"x-storagemutated-1",changedParts:e}))))}catch(e){}})),"undefined"!=typeof addEventListener&&addEventListener("storage",(e=>{if("x-storagemutated-1"===e.key){const t=JSON.parse(e.newValue);t&&nn(t.changedParts)}}));const e=self.document&&navigator.serviceWorker;e&&e.addEventListener("message",(function({data:e}){e&&"x-storagemutated-1"===e.type&&nn(e.changedParts)}))}function on(e){return on="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},on(e)}function an(){an=function(){return e};var e={},t=Object.prototype,r=t.hasOwnProperty,n=Object.defineProperty||function(e,t,r){e[t]=r.value},s="function"==typeof Symbol?Symbol:{},i=s.iterator||"@@iterator",o=s.asyncIterator||"@@asyncIterator",a=s.toStringTag||"@@toStringTag";function u(e,t,r){return Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{u({},"")}catch(e){u=function(e,t,r){return e[t]=r}}function c(e,t,r,s){var i=t&&t.prototype instanceof p?t:p,o=Object.create(i.prototype),a=new U(s||[]);return n(o,"_invoke",{value:w(e,r,a)}),o}function l(e,t,r){try{return{type:"normal",arg:e.call(t,r)}}catch(e){return{type:"throw",arg:e}}}e.wrap=c;var h={};function p(){}function f(){}function d(){}var g={};u(g,i,(function(){return this}));var m=Object.getPrototypeOf,y=m&&m(m(k([])));y&&y!==t&&r.call(y,i)&&(g=y);var v=d.prototype=p.prototype=Object.create(g);function b(e){["next","throw","return"].forEach((function(t){u(e,t,(function(e){return this._invoke(t,e)}))}))}function T(e,t){function s(n,i,o,a){var u=l(e[n],e,i);if("throw"!==u.type){var c=u.arg,h=c.value;return h&&"object"==on(h)&&r.call(h,"__await")?t.resolve(h.__await).then((function(e){s("next",e,o,a)}),(function(e){s("throw",e,o,a)})):t.resolve(h).then((function(e){c.value=e,o(c)}),(function(e){return s("throw",e,o,a)}))}a(u.arg)}var i;n(this,"_invoke",{value:function(e,r){function n(){return new t((function(t,n){s(e,r,t,n)}))}return i=i?i.then(n,n):n()}})}function w(e,t,r){var n="suspendedStart";return function(s,i){if("executing"===n)throw new Error("Generator is already running");if("completed"===n){if("throw"===s)throw i;return j()}for(r.method=s,r.arg=i;;){var o=r.delegate;if(o){var a=A(o,r);if(a){if(a===h)continue;return a}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if("suspendedStart"===n)throw n="completed",r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);n="executing";var u=l(e,t,r);if("normal"===u.type){if(n=r.done?"completed":"suspendedYield",u.arg===h)continue;return{value:u.arg,done:r.done}}"throw"===u.type&&(n="completed",r.method="throw",r.arg=u.arg)}}}function A(e,t){var r=t.method,n=e.iterator[r];if(void 0===n)return t.delegate=null,"throw"===r&&e.iterator.return&&(t.method="return",t.arg=void 0,A(e,t),"throw"===t.method)||"return"!==r&&(t.method="throw",t.arg=new TypeError("The iterator does not provide a '"+r+"' method")),h;var s=l(n,e.iterator,t.arg);if("throw"===s.type)return t.method="throw",t.arg=s.arg,t.delegate=null,h;var i=s.arg;return i?i.done?(t[e.resultName]=i.value,t.next=e.nextLoc,"return"!==t.method&&(t.method="next",t.arg=void 0),t.delegate=null,h):i:(t.method="throw",t.arg=new TypeError("iterator result is not an object"),t.delegate=null,h)}function q(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function _(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function U(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(q,this),this.reset(!0)}function k(e){if(e){var t=e[i];if(t)return t.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var n=-1,s=function t(){for(;++n<e.length;)if(r.call(e,n))return t.value=e[n],t.done=!1,t;return t.value=void 0,t.done=!0,t};return s.next=s}}return{next:j}}function j(){return{value:void 0,done:!0}}return f.prototype=d,n(v,"constructor",{value:d,configurable:!0}),n(d,"constructor",{value:f,configurable:!0}),f.displayName=u(d,a,"GeneratorFunction"),e.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===f||"GeneratorFunction"===(t.displayName||t.name))},e.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,d):(e.__proto__=d,u(e,a,"GeneratorFunction")),e.prototype=Object.create(v),e},e.awrap=function(e){return{__await:e}},b(T.prototype),u(T.prototype,o,(function(){return this})),e.AsyncIterator=T,e.async=function(t,r,n,s,i){void 0===i&&(i=Promise);var o=new T(c(t,r,n,s),i);return e.isGeneratorFunction(r)?o:o.next().then((function(e){return e.done?e.value:o.next()}))},b(v),u(v,a,"Generator"),u(v,i,(function(){return this})),u(v,"toString",(function(){return"[object Generator]"})),e.keys=function(e){var t=Object(e),r=[];for(var n in t)r.push(n);return r.reverse(),function e(){for(;r.length;){var n=r.pop();if(n in t)return e.value=n,e.done=!1,e}return e.done=!0,e}},e.values=k,U.prototype={constructor:U,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(_),!e)for(var t in this)"t"===t.charAt(0)&&r.call(this,t)&&!isNaN(+t.slice(1))&&(this[t]=void 0)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var t=this;function n(r,n){return o.type="throw",o.arg=e,t.next=r,n&&(t.method="next",t.arg=void 0),!!n}for(var s=this.tryEntries.length-1;s>=0;--s){var i=this.tryEntries[s],o=i.completion;if("root"===i.tryLoc)return n("end");if(i.tryLoc<=this.prev){var a=r.call(i,"catchLoc"),u=r.call(i,"finallyLoc");if(a&&u){if(this.prev<i.catchLoc)return n(i.catchLoc,!0);if(this.prev<i.finallyLoc)return n(i.finallyLoc)}else if(a){if(this.prev<i.catchLoc)return n(i.catchLoc,!0)}else{if(!u)throw new Error("try statement without catch or finally");if(this.prev<i.finallyLoc)return n(i.finallyLoc)}}}},abrupt:function(e,t){for(var n=this.tryEntries.length-1;n>=0;--n){var s=this.tryEntries[n];if(s.tryLoc<=this.prev&&r.call(s,"finallyLoc")&&this.prev<s.finallyLoc){var i=s;break}}i&&("break"===e||"continue"===e)&&i.tryLoc<=t&&t<=i.finallyLoc&&(i=null);var o=i?i.completion:{};return o.type=e,o.arg=t,i?(this.method="next",this.next=i.finallyLoc,h):this.complete(o)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),h},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.finallyLoc===e)return this.complete(r.completion,r.afterLoc),_(r),h}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.tryLoc===e){var n=r.completion;if("throw"===n.type){var s=n.arg;_(r)}return s}}throw new Error("illegal catch attempt")},delegateYield:function(e,t,r){return this.delegate={iterator:k(e),resultName:t,nextLoc:r},"next"===this.method&&(this.arg=void 0),h}},e}function un(e,t,r,n,s,i,o){try{var a=e[i](o),u=a.value}catch(e){return void r(e)}a.done?t(u):Promise.resolve(u).then(n,s)}function cn(e){return function(){var t=this,r=arguments;return new Promise((function(n,s){var i=e.apply(t,r);function o(e){un(i,n,s,o,a,"next",e)}function a(e){un(i,n,s,o,a,"throw",e)}o(void 0)}))}}Ge.rejectionMapper=function(e,t){if(!e||e instanceof se||e instanceof TypeError||e instanceof SyntaxError||!e.name||!he[e.name])return e;var r=new he[e.name](t||e.message,e);return"stack"in e&&w(r,"stack",{get:function(){return this.inner.stack}}),r},X(z,Dt);var ln=function(){var e=new Qr("IDBCache",{autoOpen:!1});this.isSupported=function(){var e=window.indexedDB||window.mozIndexedDB||window.webkitIndexedDB||window.msIndexedDB,t=window.IDBKeyRange||window.webkitIDBKeyRange,r=window.IDBCursor||window.webkitIDBCursor,n=function(){var e=window.navigator.userAgent,t=e.indexOf("MSIE ");if(t>0)return parseInt(e.substring(t+5,e.indexOf(".",t)),10);if(e.indexOf("Trident/")>0){var r=e.indexOf("rv:");return parseInt(e.substring(r+3,e.indexOf(".",r)),10)}var n=e.indexOf("Edge/");return n>0&&parseInt(e.substring(n+5,e.indexOf(".",n)),10)}(),s=function(){if(navigator.userAgent.match(/Safari/i)&&!1==!navigator.userAgent.match(/Chrome/i))return!1;var e=navigator.userAgent.toLowerCase();return(e=e.substring(e.indexOf("version/")+8)).substring(0,e.indexOf("."))}(),i=!1!==n&&n<11,o=!1!==s&&s<10,a=!!navigator.userAgent.match(/iPad|iPhone|iPod/i);return navigator.userAgent.match(/PhantomJS/i)?e&&t&&r:e&&t&&r&&!i&&!a&&!o},this.addResponse=function(t,r,n,s){return e.responseTable.put({etag:n,data:r,timestamp:$.now(),chunks:s?parseInt(s,10):null},t)},this.getResponse=function(t){return e.responseTable.get(t)},this.addBatchResponse=function(t,r,n,s){return e.batchedResponseTable.put({id:t+r,batch:r,data:n,timestamp:$.now(),chunks:s?parseInt(s,10):null})},this.getBatchResponse=function(t,r){return e.batchedResponseTable.get(t+r)},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.version(.4).stores({batchedResponseTable:"id,batch"}).upgrade((function(e){e.batchedResponseTable.filter((function(e){return e.id.includes("objects")&&e.id.includes("topology")&&e.id.includes("shortinfo")})).delete()})),e.version(.5).stores({batchedResponseTable:"id,batch"}).upgrade((function(e){e.batchedResponseTable.filter((function(e){return e.id.includes("objects")&&e.id.includes("topology")&&e.id.includes("shortinfo")})).delete()})),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=cn(an().mark((function e(t){var r,n;return an().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=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},n="",e.next=4,t.each((function(e){n+=" ".concat(JSON.stringify(e,r),"\n")}));case 4:return e.abrupt("return",n);case 5:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),this.dumpTable=function(){var e=cn(an().mark((function e(t){var r,n,s,i;return an().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,t.toCollection().count();case 2:return r=e.sent,n=[t.schema.primKey].concat(t.schema.indexes),s=n.map((function(e){return e.src})).join(","),i="Table: ".concat(t.name,", Schema: '").concat(s,"', Count of entries: ").concat(r,"\n"),e.t0=i,e.next=9,this.dumpTableContent(t);case 9:return i=e.t0+=e.sent,e.abrupt("return",i);case 11:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}(),this.dumpDatabase=cn(an().mark((function t(){var r;return an().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return r="",r+="BimWebSdk: Dexie Databases Dump\n",r+="===============================\n",r+="Database: ".concat(e.name," (Version: ").concat(e.verno,")\n"),t.t0=r,t.next=7,this.dumpTable(e.responseTable);case 7:return r=t.t0+=t.sent,t.t1=r,t.next=11,this.dumpTable(e.batchedResponseTable);case 11:return r=t.t1+=t.sent,t.abrupt("return",r);case 13:case"end":return t.stop()}}),t,this)})))},hn=function(){var e=null,t=null,o="medium",a=new ln;a.initDB().then((function(){window.BIMPLUS_SDK_ENABLE_IDBCACHE_DUMP&&a.dumpDatabase().then((function(e){console.log(e)}))})).catch((function(e){console.error("BimWebSdk indexedDB initialization error : "+e.stack||0)})),this.setAccessToken=function(t){e=t},this.setTokenType=function(e){t=e},this.getCache=function(){return a};var u=function(e,t,r){var n=r.getResponseHeader("ETag"),s=r.getResponseHeader("X-Total-Count"),i="arraybuffer"===r.responseType;if(n){var o=!1===i?JSON.stringify(t):null;a.addResponse(e,i?t:JSON.parse(o),n,s).then((function(){})).catch((function(t){console.error("BimWebSdk failed to add response to cache: "+e+" Reason: "+t.message)}))}},c=function(e){return"W"===e.charAt(0)?e.substring(2):e};this.getBatchResponse=function(e,t,s){var i=$.Deferred(),o=s.useXMLHttpRequest?n:r;return a.getBatchResponse(e,t).then((function(r){if(r){var n={};return null!==r.chunks&&(n["Cached-X-Total-Count"]=r.chunks),n.status=304,void i.resolve(r.data,304,n)}o(e,"GET",null,s).done((function(r,n,s){var o=s.getResponseHeader("X-Total-Count"),u="arraybuffer"===s.responseType,c=!1===u?JSON.stringify(r):null;a.addBatchResponse(e,t,u?r:JSON.parse(c),o).then((function(){})).catch((function(t){console.error("BimWebSdk failed to add response to cache: "+e+" Reason: "+t.message)})),i.resolve(r,n,s)})).fail((function(e,t){i.reject(e,t)}))})),i.promise()},this.get=function(i,o){if(o||(o={}),o.token||(o.token=e),o.tokenType&&o.tokenType===t||(o.tokenType=t),o.queryParams&&(i+=s(o.queryParams)),o.responseBatch)return this.getBatchResponse(i,o.responseBatch,o);var l=$.Deferred(),h=o.useXMLHttpRequest?n:r;return a.getResponse("GET;"+i).then((function(e){if(e){var t=c(e.etag);o.eTag=t,h(i,"GET",null,o).done((function(t,r,n){304===n.status?(null!==e.chunks&&(n["Cached-X-Total-Count"]=e.chunks),l.resolve(e.data,r,n)):(u("GET;"+i,t,n),l.resolve(t,r,n))})).fail((function(e,t){l.reject(e,t)}))}else h(i,"GET",null,o).done((function(e,t,r){u("GET;"+i,e,r),l.resolve(e,t,r)})).fail((function(e,t){l.reject(e,t)}))})).catch((function(){h(i,"GET",null,o).done((function(e,t,r){u("GET;"+i,e,r),l.resolve(e,t,r)})).fail((function(e,t){l.reject(e,t)}))})),l.promise()},this.getChunked=function(t,r){var n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];return i(this,e,o,t,r,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(i,o,a){return a||(a={}),a.token||(a.token=e),a.tokenType&&a.tokenType===t||(a.tokenType=t),a.queryParams&&(i+=s(a.queryParams)),(a.useXMLHttpRequest?n:r)(i,"POST",o,a)},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(n,i){i||(i={}),i.contentType="",i.dataType="",i.token||(i.token=e),i.tokenType&&i.tokenType===t||(i.tokenType=t),i.queryParams&&(n+=s(i.queryParams));var o=$.Deferred();return a.getResponse("HEAD;"+n).then((function(e){if(e){var t=c(e.etag);i.eTag=t,r(n,"HEAD",null,i).done((function(e,t,r){304===r.status?o.resolve(!0,t,r):(u("HEAD;"+n,null,r),o.resolve(!1,t,r))})).fail((function(e,t){o.reject(e,t)}))}else r(n,"HEAD",null,i).done((function(e,t,r){u("HEAD;"+n,null,r),o.resolve(!1,t,r)})).fail((function(e,t){o.reject(!1,t)}))})).catch((function(){r(n,"HEAD",null,i).done((function(e,t,r){u("HEAD;"+n,null,r),o.resolve(!1,t,r)})).fail((function(e,t){o.reject(!1,t)}))})),o.promise()}},pn=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,r){var n={queryParams:{customFilter:r}};return t?e.request.get(e.getApiTeamUrl()+"clashdetection/filters/"+t,r?n:null):e.request.get(e.getApiTeamUrl()+"clashdetection/filters",r?n:null)},this.calculateClashes=function(t,r,n){if(r||n){var s={queryParams:{}};return r&&(s.queryParams.topology=r),n&&(s.queryParams.clashElements=n),e.request.post(e.getApiTeamUrl()+"clashdetection/filters",t,s)}return e.request.post(e.getApiTeamUrl()+"clashdetection/filters",t)},this.getFilterResults=function(t,r,n,s){if(n||s){var i={queryParams:{}};return n&&(i.queryParams.topology=n),s&&(i.queryParams.clashElements=s),r?e.request.get(e.getApiTeamUrl()+"clashdetection/projects/"+t+"/filters/"+r,i):e.request.get(e.getApiTeamUrl()+"clashdetection/projects/"+t+"/filters",i)}return r?e.request.get(e.getApiTeamUrl()+"clashdetection/projects/"+t+"/filters/"+r):e.request.get(e.getApiTeamUrl()+"clashdetection/projects/"+t+"/filters")},this.createClashRule=function(t,r){return e.request.post(e.getApiTeamUrl()+"projects/"+t+"/clashfilters",JSON.stringify(r))},this.deleteClashRule=function(t,r){var n={queryParams:{force:r}};return e.request.del(e.getApiTeamUrl()+"clashfilters/"+t,null,r?n:null)},this.updateClashRule=function(t,r){return e.request.put(e.getApiTeamUrl()+"clashfilters/"+t,JSON.stringify(r))},this.getAllClashRules=function(t,r){var n={queryParams:{customFilter:r}};return e.request.get(e.getApiTeamUrl()+"projects/"+t+"/clashfilters",r?n:null)}},fn=function(e){this.post=function(t){var r=[{message:t}];return e.request.post(e.getApiTeamUrl()+"clientlogs",JSON.stringify(r))},this.postExtended=function(t,r,n,s){var i=[{message:t,applicationclass:r,releaseversion:n,projectid:s}];return e.request.post(e.getApiTeamUrl()+"clientlogs",JSON.stringify(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")}},dn=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,r){return e.request.put(e.getApiTeamUrl()+"comments/"+t,r)}},gn=function(e){this.get=function(t,r,n){var s=e.getApiTeamUrl()+"objects/"+t+"/customtables";r&&(s+="?variantId="+r);var i={};return n&&(i.queryParams={revision:n}),e.request.get(s,n?i:void 0)},this.post=function(t,r){return e.request.post(e.getApiTeamUrl()+"objects/"+t+"/customtables",r)}},mn=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,r){return e.request.put(e.getApiTeamUrl()+"dimensionlines/"+t,r)}},yn=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,r){return t?e.request.get(e.getApiTeamUrl()+"element-types/"+t+"/attributetemplates",r?{queryParams:r}:void 0):e.request.get(e.getApiTeamUrl()+"element-types/attributetemplates",r?{queryParams:r}: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")}},vn=function(e){this.exportObjects=function(t,r){return e.request.get(e.getApiTeamUrl()+"projects/"+t+"/objects/export/excel?typeId="+r)},this.exportModel=function(t,r,n,s,i,o){var a={};return n&&(a.revision=n),s&&(a.emptyPropExport=1),i&&(a.propSetExport=1),o&&(a.temporary="true"),e.request.post("".concat(e.getApiTeamUrl(),"projects/").concat(t,"/model/").concat(r,"/exportasync"),null,{queryParams:a,contentType:!1,processData:!1,dataType:null})},this.exportSelection=function(t,r,n,s){var i={};return r&&(i.emptyPropExport=r),n&&(i.propSetExport=n),s&&(i.temporary="true"),e.request.post("".concat(e.getApiTeamUrl(),"selections/").concat(t,"/exportasync"),null,{queryParams:i})},this.createExportSelection=function(t,r){return e.request.post("".concat(e.getApiTeamUrl(),"projects/").concat(t,"/exportobjects"),r)}},bn=function(e){this.getAccessRights=function(t){return e.request.get(e.getApiTeamUrl()+"folders/"+t+"/rights")},this.setMemberAccessRights=function(t,r,n){return e.request.put(e.getApiTeamUrl()+"folders/"+t+"/rights?assignrecursive="+(n?"true":"false"),r)},this.setMembersAccessRights=function(t,r,n){return e.request.put(e.getApiTeamUrl()+"folders/"+t+"/usersrights?assignrecursive="+(n?"true":"false"),r)}},Tn=function(e){var t=function(t){return t?e.getApiUrl()+"content/freeattributegroups/":e.getApiTeamUrl()+"freeattributegroups/"};this.post=function(r,n){return e.request.post(t(n),r)},this.get=function(r,n){return r?e.request.get(t(n)+r):e.request.get(t(n))},this.put=function(r,n,s){return e.request.put(t(s)+r,n)},this.delete=function(r,n){return e.request.del(t(n)+r)},this.getFreeAttributes=function(r,n){return e.request.get(t(n)+r+"/freeattributes")}},wn=function(e){var t=function(t){return t?e.getApiUrl()+"content/freeattributes/":e.getApiTeamUrl()+"freeattributes/"};this.post=function(r,n){return e.request.post(t(n),r)},this.get=function(r,n,s){return r?e.request.get(t(n)+r,s?{queryParams:s}:void 0):e.request.get(t(n),s?{queryParams:s}:void 0)},this.put=function(r,n,s){return e.request.put(t(s)+r,n)},this.delete=function(r,n){return e.request.del(t(n)+r)},this.getTopology=function(r){return e.request.get(t(r)+"?topology=true")},this.getFilteredAttributes=function(t,r,n){var s=e.getApiTeamUrl();return t&&(s+="projects/".concat(t,"/")),s+="attributes?",r&&(s+="layer=".concat(r,"&")),n&&(s+="type=".concat(n)),e.request.get(s)}},An=function(e){this.calculate=function(t,r,n,s,i){var o={hiddenCalculation:{projectId:t,calculationMode:"View",view:r,clippingPlanes:n,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:s},sectionSettings:{}},runAsync:i};return e.request.post(e.getApiTeamUrl()+"services/Hiddencalculation",JSON.stringify(o))}},qn=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,r){return e.request.put(e.getApiTeamUrl()+"hyperlinks/"+t,r)}},_n=function(e){this.postModel=function(t,r,n,s,i){return"replaceModelData"===i?e.request.post(e.getApiTeamUrl()+"projects/"+t+"/model/"+r+"/importasync?replaceModelData=true",n,{preparedData:n,contentType:!1,processData:!1,dataType:null,xhrUploadProgress:s}):e.request.post(e.getApiTeamUrl()+"projects/"+t+"/model/"+r+"/importasync",n,{preparedData:n,contentType:!1,processData:!1,dataType:null,xhrUploadProgress:s})}},Un=function(e){this.post=function(t,r){return e.request.post(e.getApiTeamUrl()+"projects/"+t+"/issues",r)},this.get=function(t){return e.request.get(e.getApiTeamUrl()+"issues/"+t)},this.postPin=function(t,r){return e.request.post(e.getApiTeamUrl()+"issues/"+t+"/pins",r)},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,r){return e.request.post(e.getApiTeamUrl()+"issues/"+t+"/comments",r)},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,r){return e.request.post(e.getApiTeamUrl()+"issues/"+t+"/attachments",r)},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,r,n){return e.request.put(e.getApiTeamUrl()+"issues/"+t,r,n?{queryParams:n}:void 0)},this.delete=function(t,r){var n={queryParams:{forceDelete:r}};return e.request.del(e.getApiTeamUrl()+"issues/"+t,null,r?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,r){return e.request.put(e.getApiTeamUrl()+"projects/"+t+"/issues/bcf",r,{contentType:!1,processData:!1})},this.updateImportBcf=function(t,r){return e.request.put(e.getApiTeamUrl()+"projects/"+t+"/issues/bcf",r)},this.exportBcf=function(t,r,n){return t?e.request.post(e.getApiTeamUrl()+"projects/"+t+"/issues/export/bcf"+(n?"?version="+n:""),r):e.request.post(e.getApiTeamUrl()+"issues/export/bcf"+(n?"?version="+n:""),r)},this.exportExcel=function(t,r){return t?e.request.post(e.getApiTeamUrl()+"projects/"+t+"/issues/export/excel",r):e.request.post(e.getApiTeamUrl()+"issues/export/excel",r)}},kn=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,r){return e.request.put(e.getApiTeamUrl()+"labels/"+t,r)}},jn=function(e){this.lockObject=function(t,r){return e.request.put(e.getApiTeamUrl()+"objects/"+t+"/locks",r,{dataType:"text"})},this.checkLocked=function(t){return e.request.get(e.getApiTeamUrl()+"objects/"+t+"/locks")},this.deleteLock=function(t,r){return!0===r?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")}},Pn=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,r,n){return e.request.put(e.getApiTeamUrl()+"members/"+r,n)},this.deleteUser=function(t,r){return e.request.del(e.getApiTeamUrl()+"members/"+r)}},xn=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,r){return e.request.put(e.getApiUrl()+"messages/"+t+"/updatedashboardadditionaldata",r)},this.addDashboardMessageAttachment=function(t,r,n){return e.request.put(e.getApiUrl()+"messages/"+t+"/upload?type=dashboard",r,n)},this.getAllMessagingGroups=function(){return e.request.get(e.getApiUrl()+"systemgroups")},this.getMessagingGroupsDetails=function(t){return e.request.get(e.getApiUrl()+"systemgroups/"+t)}},Sn=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):(console.warn("BimWebSdk: request (divisions/".concat(t,") does not support head method!")),new Promise((function(e){e(!1)})))},this.getDisciplines=function(t){return e.request.get(e.getApiTeamUrl()+"divisions/"+t+"/disciplines")},this.setDisciplineValidity=function(t,r,n){var s={private:!n};return e.request.put(e.getApiTeamUrl()+"divisions/"+t+"/disciplines/"+r,JSON.stringify(s))},this.getRevisions=function(t){return e.request.get(e.getApiTeamUrl()+"divisions/"+t+"/revisions")},this.getAllRevisions=function(t){return e.request.get(e.getApiTeamUrl()+"projects/"+t+"/revisions")},this.postRevision=function(t,r){return e.request.post(e.getApiTeamUrl()+"divisions/"+t+"/revisions",r)},this.put=function(t,r){return e.request.put(e.getApiTeamUrl()+"divisions/"+t,r)},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,r){return e.request.put(e.getApiTeamUrl()+"divisions/"+t+"/move",r)}},En=["topology","structure"],Dn=function(e){this.get=function(t,r){var n={};return t&&(n.object_id=t),r&&(n.project_id=r),e.request.get(e.getApiTeamUrl()+"settings/filters",{queryParams:n})},this.getFilteredObjects=function(t,r,n,s){if(n)return e.request.get(e.getApiTeamUrl()+"projects/"+t+"/filters/"+r+"/properties",{queryParams:n});if(s&&En.find((function(e){return e===s}))){var i={};return i[s]=!0,e.request.get(e.getApiTeamUrl()+"projects/"+t+"/filters/"+r,{queryParams:i})}return e.request.get(e.getApiTeamUrl()+"projects/"+t+"/filters/"+r)},this.getSelectionFilteredObjects=function(t,r,n,s){if(n)return e.request.get(e.getApiTeamUrl()+"selections/"+t+"/filters/"+r+"/properties",{queryParams:n});if(s&&En.find((function(e){return e===s}))){var i={};return i[s]=!0,e.request.get(e.getApiTeamUrl()+"selections/"+t+"/filters/"+r,{queryParams:i})}return e.request.get(e.getApiTeamUrl()+"selections/"+t+"/filters/"+r)},this.applyFilter=function(t){return e.request.get(e.getApiTeamUrl()+"filters/"+t)},this.post=function(t,r){var n={};return r&&(n.project_id=r),e.request.post(e.getApiTeamUrl()+"settings/filter",t,{queryParams:n})},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)}},On=function(e){this.post=function(t){return e.request.post(e.getApiTeamUrl()+"objects/",t)},this.get=function(t,r,n,s,i,o){var a={};r&&(a.queryParams={revision:r}),s&&(a.queryParams?a.queryParams.projectId=s:a.queryParams={projectId:s}),i&&(a.queryParams?a.queryParams.shortinfo=i:a.queryParams={shortinfo:i}),o&&(a.queryParams?a.queryParams.type=o:a.queryParams={type:o});var u=e.getApiTeamUrl()+"objects/"+t;return n&&(u+="/properties/",u+=n),e.request.get(u,r||s||i||o?a:void 0)},this.getInternal=function(t,r){var n={};r&&(n.queryParams={revision:r});var s=e.getApiTeamUrl()+"objects/"+t;return s+="/internal",e.request.get(s,r?n:void 0)},this.head=function(t,r){var n={};return r&&(n.queryParams={revision:r}),e.request.head?e.request.head(e.getApiTeamUrl()+"objects/"+t,r?n:void 0):(console.warn("BimWebSdk: request (objects/".concat(t,") does not support head method! Using get as fallback.")),e.request.get(e.getApiTeamUrl()+"objects/"+t,r?n:void 0))},this.getTopology=function(t,r,n,s,i){var o={};return(r||n||s)&&(o.queryParams={},r&&(o.queryParams.revision=r),n&&(o.queryParams.hideElements=n),s&&(o.queryParams.shortinfo=s)),i&&(o.responseBatch=i),e.request.get(e.getApiTeamUrl()+"objects/"+t+"/topology",o)},this.getGeometryThreeJS=function(t,r,n,s,i,o,a){var u,c=arguments.length>7&&void 0!==arguments[7]&&arguments[7],l={};return null===s&&null===i||(l.queryParams={},null!==s&&(l.queryParams.revision=s),null!==i&&(l.queryParams.levelofdetail=i)),a&&(l.responseBatch=a),u=r?e.getApiTeamUrl()+"objects/"+t+"/disciplines/"+r+"/geometries/threejs":e.getApiTeamUrl()+"objects/"+t+"/geometries/threejs",o&&(u+="/properties/",u+=o),n?e.request.getChunked(u,l,c):e.request.get(u,l)},this.getGeometryGLB=function(t,r,n,s,i,o,a,u,c){var l,h=arguments.length>9&&void 0!==arguments[9]&&arguments[9],p=arguments.length>10&&void 0!==arguments[10]?arguments[10]:void 0,f={};return f.dataType="binary",f.processData=!1,f.responseType="arraybuffer",f.useXMLHttpRequest=!0,void 0===n&&void 0===s&&void 0===i&&void 0===o&&void 0===a&&void 0===p||(f.queryParams={},void 0!==n&&(f.queryParams.revision=n),void 0!==s&&(f.queryParams.levelofdetail=s),void 0!==i&&(f.queryParams.vertexNormals=i),void 0!==o&&(f.queryParams.smoothingAngle=o),void 0!==a&&(f.queryParams.topology=a),void 0!==p&&(f.queryParams.edges=p)),u&&(f.responseBatch=u),l=r?e.getApiTeamUrl()+"objects/"+t+"/disciplines/"+r+"/geometries/glb":e.getApiTeamUrl()+"objects/"+t+"/geometries/glb",c?e.request.getChunked(l,f,h):e.request.get(l,f)},this.getGeometryTemplatesThreeJS=function(t,r,n,s,i,o){var a=arguments.length>6&&void 0!==arguments[6]&&arguments[6],u={};null===s&&null===i||(u.queryParams={},null!==s&&(u.queryParams.revision=s),null!==i&&(u.queryParams.levelofdetail=i)),o&&(u.responseBatch=o);var c=e.getApiTeamUrl()+"objects/"+t+"/disciplines/"+r+"/templates/threejs";return n?e.request.getChunked(c,u,a):e.request.get(c,u)},this.getGeometryCompressed=function(t,r){return r?e.request.get(e.getApiTeamUrl()+"objects/"+t+"/disciplines/"+r+"/geometries/meshblob"):e.request.get(e.getApiTeamUrl()+"objects/"+t+"/geometries/meshblob")},this.getProperties=function(t,r){return e.request.get(e.getApiTeamUrl()+"objects/"+t+"/geometries/threejs/properties"+r)},this.put=function(t,r,n){var s={};return n&&(s.projectid=n),e.request.put(e.getApiTeamUrl()+"objects/"+t,r,{queryParams:s})},this.postComment=function(t,r){return e.request.post(e.getApiTeamUrl()+"objects/"+t+"/comments",r)},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,r,n,s){return e.request.post(e.getApiTeamUrl()+"objects/"+t+"/attachments",r,{contentType:!1,processData:!1,dataType:null,xhrUploadProgress:n,queryParams:s?{DocumentFolderId:s}:void 0})},this.getAttachments=function(t,r){return e.request.get(e.getApiTeamUrl()+"objects/"+t+"/attachments",r?{queryParams:{revision:r}}:void 0)},this.deleteAttachments=function(t){return e.request.del(e.getApiTeamUrl()+"objects/"+t+"/attachments")},this.postAttachmentLink=function(t,r){return e.request.post(e.getApiTeamUrl()+"objects/"+t+"/attachmentlinks",r)},this.getAttachmentLinks=function(t){return e.request.get(e.getApiTeamUrl()+"objects/"+t+"/attachmentlinks")},this.deleteAttachmentLink=function(t,r){return e.request.del(e.getApiTeamUrl()+"objects/"+t+"/attachmentlinks/"+r)},this.postHyperlink=function(t,r){return e.request.post(e.getApiTeamUrl()+"objects/"+t+"/hyperlinks",r)},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,r,n,s){var i=r?"&documentversion="+r:"",o=s?"&revision="+s:"",a=n?"&projectid="+n:"",u=e.getApiTeamUrl()+"objects/"+t+"?freeattributes=true";return e.request.get(u+i+o+a)},this.getAttributesAsFlatStructure=function(t,r,n,s){var i=r?"&documentversion="+r:"",o=s?"&revision="+s:"",a=n?"&projectid="+n:"",u=e.getApiTeamUrl()+"objects/"+t+"?freeattributes=true&internal=true&attributedefinition=true";return e.request.get(u+i+o+a)},this.getAttributeValues=function(t,r){return e.request.get(e.getApiTeamUrl()+"objects/"+t+"/attributes/"+r+"?children=true")},this.getComplexPropertiesTopology=function(t,r){return e.request.get(e.getApiTeamUrl()+"objects/"+t+"/complexproperties"+(r>=0?"?revision="+r:""))},this.postThumbnail=function(t,r,n){return e.request.post(e.getApiTeamUrl()+"objects/"+t+"/thumbnail",r,{contentType:!1,processData:!1,dataType:null,xhrUploadProgress:n})},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,r,n){return e.request.get(e.getApiTeamUrl()+"objects/"+t+"/reports?version="+r+"&action="+n)},this.exportExcelReports=function(t,r){return e.request.post(e.getApiTeamUrl()+"projects/"+t+"/reports/export/excel",r)},this.postDimensions=function(t,r){return e.request.post(e.getApiTeamUrl()+"objects/"+t+"/dimensionlines",r)},this.putDimensions=function(t,r){return e.request.put(e.getApiTeamUrl()+"objects/"+t+"/dimensionlines",r)},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,r){return e.request.post(e.getApiTeamUrl()+"objects/"+t+"/labels",r)},this.putLabels=function(t,r){return e.request.put(e.getApiTeamUrl()+"objects/"+t+"/labels",r)},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,r){return e.request.post(e.getApiTeamUrl()+"objects/"+t+"/annotations",r)},this.putAnnotations=function(t,r){return e.request.put(e.getApiTeamUrl()+"objects/"+t+"/annotations",r)},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")},this.getObjectIdsByQuery=function(t,r,n,s){var i=Array.isArray(s)?s.join(","):void 0,o={queryParams:{}};return o.queryParams[r]=n,i&&(o.queryParams.divisions=i),e.request.get(e.getApiTeamUrl()+"objects/"+t+"/query",o)},this.getObjectIdsByIfcId=function(e,t,r){return this.getObjectIdsByQuery(e,"93027bad-df91-48ee-a0bb-60a8184cddba",t,r)}},Cn=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,r){return e.request.put(e.getApiTeamUrl()+"pins/"+t,r)}},Rn=function(e){this.get=function(){return e.request.get(e.getApiUrl()+"project-actions-rights/")}},In=function(e){var t="projectattributetemplates";this.post=function(r){return e.request.post(e.getApiTeamUrl()+t,r)},this.get=function(r,n){var s=n?{queryParams:{default:n}}:null;return r?e.request.get(e.getApiTeamUrl()+t+"/"+r):e.request.get(e.getApiTeamUrl()+t,s)},this.put=function(r,n){return e.request.put(e.getApiTeamUrl()+t+"/"+r,n)},this.delete=function(r){return e.request.del(e.getApiTeamUrl()+t+"/"+r)},this.copyFrom=function(r,n){return e.request.put(e.getApiTeamUrl()+t+"/"+n+"/copyfrom",JSON.stringify({id:r}))},this.setDefault=function(r){return e.request.put(e.getApiTeamUrl()+t+"/"+r+"/default")}};function Bn(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var n,s,i,o,a=[],u=!0,c=!1;try{if(i=(r=r.call(e)).next,0===t){if(Object(r)!==r)return;u=!1}else for(;!(u=(n=i.call(r)).done)&&(a.push(n.value),a.length!==t);u=!0);}catch(e){c=!0,s=e}finally{try{if(!u&&null!=r.return&&(o=r.return(),Object(o)!==o))return}finally{if(c)throw s}}return a}}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return Kn(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);"Object"===r&&e.constructor&&(r=e.constructor.name);if("Map"===r||"Set"===r)return Array.from(e);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return Kn(e,t)}(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 Kn(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}var Nn=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,r){return e.request.put(e.getApiTeamUrl()+"projects/"+t,r)},this.get=function(t,r,n,s,i){var o={queryParams:i||{}};return r&&(o.queryParams.disciplines=!1),s&&(o.queryParams.recycleBin=!0),t?e.request.get(e.getApiTeamUrl()+"projects/"+t,o):n?e.request.get(e.getApiUrl()+n+"/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,r,n){return r||(r="00000000-0000-0000-0000-000000000000"),n>=0&&""!==n||(n="100"),e.request.del(e.getApiTeamUrl()+"temporary/projects/"+t+"/disciplines/"+r+"/levelofdetails/"+n)},this.getModels=function(t){return e.request.get(e.getApiTeamUrl()+"projects/"+t+"/divisions")},this.postModel=function(t,r){return e.request.post(e.getApiTeamUrl()+"projects/"+t+"/divisions",r)},this.getMembers=function(t){return e.request.get(e.getApiTeamUrl()+"projects/"+t+"/members")},this.postMember=function(t,r){return e.request.post(e.getApiTeamUrl()+"projects/"+t+"/members",r)},this.putMember=function(t,r){return e.request.put(e.getApiTeamUrl()+"projects/"+t+"/members",r)},this.deleteMember=function(t,r){return e.request.del(e.getApiTeamUrl()+"projects/"+t+"/members",r)},this.getPins=function(t){return e.request.get(e.getApiTeamUrl()+"projects/"+t+"/pins")},this.putProject=function(t,r){return e.request.put(e.getApiTeamUrl()+"projects/"+t,r)},this.postAttachment=function(t,r){return e.request.post(e.getApiTeamUrl()+"projects/"+t+"/attachments",r)},this.getAttachments=function(t,r,n){var s=n;return s||(s={}),r&&(s.revision=r),e.request.get(e.getApiTeamUrl()+"projects/"+t+"/attachments",r||n?{queryParams:s}: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,r,n){return e.request.post(e.getApiTeamUrl()+"projects/"+t+"/thumbnail",r,{contentType:!1,processData:!1,dataType:null,xhrUploadProgress:n})},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,r){return e.request.get(e.getApiTeamUrl()+"projects/"+t+"/issues"+(r?"?scene=false":""))},this.getIssuesShortInfo=function(t){var r=function(){var e=Bn((new Date).toString().split("GMT"),2),t=e[0],r=e[1];if(!t||!r)return"";var n=new Date(t+"UTC").toISOString().split(".")[0],s=(r=r.split(" ")[0]).slice(0,3)+":"+r.slice(3);return n&&s?n+s:""}();return e.request.get(e.getApiTeamUrl()+"projects/"+t+"/issues?shortinfo=true"+(r?"¤ttime="+r:""))},this.postSlideshow=function(t,r){return e.request.post(e.getApiTeamUrl()+"projects/"+t+"/slideshows",r)},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,r){var n={slideShowId:r};return e.request.post(e.getApiTeamUrl()+"projects/"+t+"/slideshow/export/pdf",JSON.stringify(n))},this.getProjectInfo=function(t,r){var n={queryParams:r||{}};return e.request.get(e.getApiTeamUrl()+"projects/"+t,n)}},Mn=function(e){this.postRevision=function(t,r){return e.request.post(e.getApiTeamUrl()+"divisions/"+t+"/revisions",r)},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,r){return e.request.post(e.getApiTeamUrl()+"revisions/"+t,r)},this.putRevisionInfo=function(t,r){return e.request.put(e.getApiTeamUrl()+"revisions/"+t,r)},this.getRevisionsComparisonResult=function(t,r,n,s){return e.request.get(e.getApiTeamUrl()+"divisions/"+t+"/revisionscomparison/"+r+"/"+n,s)},this.compareRevisions=function(t,r,n,s){return e.request.post(e.getApiTeamUrl()+"divisions/"+t+"/revisionscomparison/"+r+"/"+n,null,s)},this.excelExportRevisionsComparisonResult=function(t,r,n,s){return e.request.post(e.getApiTeamUrl()+"divisions/"+t+"/revisionscomparison/"+r+"/"+n+"/export/excel",s)}},Ln=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,r){return e.request.post(e.getApiTeamUrl()+"projects/"+t+"/members",r)},this.putUserRole=function(t,r){return e.request.put(e.getApiTeamUrl()+"projects/"+t+"/members",r)},this.deleteUser=function(t){return e.request.del(e.getApiTeamUrl()+"projects/"+t+"/members")}},Fn=function(e){this.get=function(t,r){if(t||r){var n={queryParams:{}};return void 0!==t&&(n.queryParams.rights=t),void 0!==r&&(n.queryParams.customrole=r),e.request.get(e.getApiTeamUrl()+"roles/",n)}return e.request.get(e.getApiTeamUrl()+"roles/")},this.getAllRights=function(t){if(t){var r={queryParams:{globalfreeattributes:t.globalfreeattributes,global:t.global,project:t.project,document:t.document,layer:t.layer}};return e.request.get(e.getApiTeamUrl()+"rights",r)}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,r){return e.request.put(e.getApiTeamUrl()+"roles/"+t,r)},this.deleteRole=function(t){return e.request.del(e.getApiTeamUrl()+"roles/"+t)}},Gn=function(e){this.calculateCutSection=function(t){var r=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=t.projectId,s=t.cuttingPlanes,i=t.modelLayer,o=t.topologyNodes,a=t.hiddenObjects,u=t.settings,c={cuttingCalculation:{projectId:n,cuttingPlanes:s,selection:{modelLayer:i,topologyNodes:o,hiddenObjects:a},settings:u},runAsync:r};if(c.cuttingCalculation.settings&&c.cuttingCalculation.settings.responseGeometry&&"glb"===c.cuttingCalculation.settings.responseGeometry){var l={useXMLHttpRequest:!0,dataType:"binary",processData:!1,responseType:"arraybuffer"};return e.request.post(e.getApiTeamUrl()+"services/CuttingCalculation",JSON.stringify(c),l)}return e.request.post(e.getApiTeamUrl()+"services/CuttingCalculation",JSON.stringify(c))}},Hn=function(e){this.post=function(t){return e.request.post(e.getApiTeamUrl()+"share",t)}},$n=function(e){this.get=function(t){return e.request.get(e.getApiTeamUrl()+"slides/"+t)},this.put=function(t,r){return e.request.put(e.getApiTeamUrl()+"slides/"+t,r)},this.delete=function(t){return e.request.del(e.getApiTeamUrl()+"slides/"+t)},this.postThumbnail=function(t,r){return e.request.post(e.getApiTeamUrl()+"slides/"+t+"/thumbnail",r)}},Wn=function(e){this.get=function(t){return e.request.get(e.getApiTeamUrl()+"slideshows/"+t)},this.put=function(t,r){return e.request.put(e.getApiTeamUrl()+"slideshows/"+t,r)},this.delete=function(t){return e.request.del(e.getApiTeamUrl()+"slideshows/"+t)},this.postSlide=function(t,r){return e.request.post(e.getApiTeamUrl()+"slideshows/"+t+"/slides",r)},this.getSlides=function(t){return e.request.get(e.getApiTeamUrl()+"slideshows/"+t+"/slides")},this.postThumbnail=function(t,r){return e.request.post(e.getApiTeamUrl()+"slideshows/"+t+"/thumbnail",r)},this.getThumbnail=function(t){return e.request.get(e.getApiTeamUrl()+"thumbnail/"+t)}},Vn=function(e){this.postStructure=function(t,r){return e.request.post(e.getApiTeamUrl()+"projects/"+t+"/structures",r)},this.postStructureTopology=function(t,r){return e.request.post(e.getApiTeamUrl()+"structures/"+t+"/topology",r)},this.postSubNode=function(t,r){return e.request.post(e.getApiTeamUrl()+"structures/"+t,r)},this.postAssignedObject=function(t,r,n,s){return e.request.post(e.getApiTeamUrl()+"structures/"+t+"/assign/"+r+"?varianttype="+n,s)},this.attributeAssign=function(t,r,n,s){var i={attributeId:n};return s&&(i.variantType=s),e.request.put(e.getApiTeamUrl()+"projects/"+t+"/structures/"+r+"/attributeassign",JSON.stringify(i))},this.deleteAssignedObject=function(t,r,n,s){var i=[s?"removeAllNodes=true":"",n?"varianttype=true":""].filter((function(e){return e})).join("&");return e.request.del(e.getApiTeamUrl()+"structures/"+t+"/delete/"+r+"?"+i)},this.getStructure=function(t,r,n){return r?e.request.get(e.getApiTeamUrl()+"structures/"+r):e.request.get(e.getApiTeamUrl()+"projects/"+t+"/structures"+(n?"?type="+n:""))},this.getTopology=function(t,r,n){return void 0===n||""===n?e.request.get(e.getApiTeamUrl()+"structures/"+t+"/topology?varianttype="+r):!0===n?e.request.get(e.getApiTeamUrl()+"structures/"+t+"/topology?varianttype="+r+"&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,r,n){return e.request.post(e.getApiTeamUrl()+"structures/"+t+"/copy?elementRelation="+n+"&attributes=true",r)},this.putStructure=function(t,r,n){var s=n?"?applyToChild=true":"";return e.request.put(e.getApiTeamUrl()+"structures/"+t+s,r)},this.reorderStructure=function(t,r){return e.request.put(e.getApiTeamUrl()+"structures/"+t+"/reorder?varianttype="+r)},this.deleteStructure=function(t,r,n){return n?e.request.del(e.getApiTeamUrl()+"structures/"+t+"?forceDelete=true"):r?e.request.del(e.getApiTeamUrl()+"structures/"+t+"?deleteAll=true"):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,r){return e.request.post(e.getApiTeamUrl()+"projects/"+t+"/variants",r)},this.getVariantType=function(t,r){return r?e.request.get(e.getApiTeamUrl()+"projects/"+t+"/variants/"+r):e.request.get(e.getApiTeamUrl()+"projects/"+t+"/variants")},this.deleteVariantType=function(t,r){return e.request.del(e.getApiTeamUrl()+"projects/"+t+"/variants/"+r)},this.copyElementsToVariant=function(t,r,n){return e.request.put(e.getApiTeamUrl()+"projects/"+t+"/variants/"+r+"/copyfrom",n)}},Jn=function(e){this.get=function(){return e.request.get(e.getApiUrl()+"team-actions-rights/")}},zn=function(e){this.get=function(t,r){var n={queryParams:{}};return r&&(n.queryParams.filterEmpty=r),t?e.request.get(e.getApiUrl()+"teams/"+t,n):e.request.get(e.getApiUrl()+"teams",n)},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")}},Xn=function(e){this.get=function(t,r){var n={language:t};return r&&(n.type=r),e.request.get(e.getApiUrl()+"terms/download",{queryParams:n,dataType:"html"})}},Qn=function(e){this.get=function(t,r){var n={language:t};return r&&(n.type=r),e.request.get(e.getApiUrl()+"dataprotectiondeclarations/download",{queryParams:n,dataType:"html"})},this.getForbiddenEmails=function(){return e.request.get(e.getApiUrl()+"/restrictedemails")}},Yn=function(e){this.get=function(t,r){var n={language:t};return r&&(n.type=r),e.request.get(e.getApiUrl()+"imprints/download",{queryParams:n,dataType:"html"})}},Zn=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,r){return e.request.put(e.getApiUrl()+"content/units/"+t,r)},this.delete=function(t){return e.request.del(e.getApiUrl()+"content/units/"+t)}},es=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,r,n){var s=e.getApiUrl()+"user/";return t&&(s+=t),n?e.request.put(s,r,{token:n}):e.request.put(s,r)},this.setPassword=function(t,r,n){var s=e.getApiUrl()+"user/set_password";return t&&(s+=t),n?e.request.put(s,r,{token:n}):e.request.put(s,r)},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")}},ts=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,r){return e.request.put(e.getApiUrl()+"users/"+t,r)},this.delete=function(t){return e.request.del(e.getApiUrl()+"users/"+t)},this.setSubscriptions=function(t,r){return e.request.post(e.getApiUrl()+"administration/users/"+t+"/accountsettings",r)}},rs=function(e){this.postSettings=function(t,r){return e.request.post(e.getApiTeamUrl()+"userSettings/"+t,r)},this.getSettings=function(t){return e.request.get(e.getApiTeamUrl()+"userSettings/"+t)}},ns=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,r){return e.request.put(e.getApiTeamUrl()+"invitations/"+t,r)},this.accept=function(t,r){return e.request.put(e.getApiUrl()+"invitations/"+t+"/accept",r)},this.getInvitation=function(t,r){return e.request.get(e.getApiUrl()+"invitations/"+t,r)}},ss=function(e){this.post=function(t,r){return e.request.post(e.getApiTeamUrl()+"projects/"+t+"/selections",r)},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)}},is=function(e){this.postGroup=function(t,r){return e.request.post(e.getApiTeamUrl()+"projects/"+t+"/usergroups",r)},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,r){return e.request.put(e.getApiTeamUrl()+"usergroups/"+t,r)},this.assignUser=function(t,r){return e.request.put(e.getApiTeamUrl()+"usergroups/"+t+"/assign",r)},this.removeUser=function(t,r){return e.request.put(e.getApiTeamUrl()+"usergroups/"+t+"/remove",r)}},os=function(e){this.get=function(t){return e.request.get(e.getApiTeamUrl()+"scenes/"+t)},this.getObjectScenes=function(t,r){var n={};r&&(n.queryParams={shortInfo:r});var s=e.getApiTeamUrl()+"objects/"+t+"/scenes";return e.request.get(s,n)},this.post=function(t,r){return e.request.post(e.getApiTeamUrl()+"objects/"+t+"/scenes",r)},this.delete=function(t){return e.request.del(e.getApiTeamUrl()+"scenes/"+t)},this.put=function(t,r){return e.request.put(e.getApiTeamUrl()+"scenes/"+t,r)},this.postThumbnailAttachment=function(t,r,n,s){return e.request.post(e.getApiTeamUrl()+"objects/"+t+"/attachments",r,{contentType:!1,processData:!1,dataType:null,xhrUploadProgress:n,queryParams:s?{attachmenttype:"thumbnailhighresolution"}:void 0})},this.postThumbnail=function(t,r,n){return e.request.post(e.getApiTeamUrl()+"objects/"+t+"/attachments",r,{queryParams:n?{attachmenttype:"thumbnailhighresolution"}:void 0})},this.getThumbnail=function(t){return e.request.get(e.getApiTeamUrl()+"objects/"+t+"/attachments")}},as=function(e){this.post=function(t){return e.request.post(e.getApiTeamUrl()+"services/BaseQuantities",JSON.stringify(t))}},us=function(e){this._config=null,e?(void 0===e.version&&(e.version="v2"),this._config=e):this._config=cs(),this._token=null,this._tokenType=null,this._teamSlug=null,this._cache=null,window.BIMPLUS_SDK_ENABLE_DEBUG_LOGS&&console.log("BimWebSdk: config = ",this._config),this._config.cache?(this.request=new hn,this._cache=this.request.getCache(),!1===this._cache.isSupported()&&(console.warn("Warning: Caching requested but not supported by browser! Falling back to uncached requests."),this.request=new o,this._cache=null)):this.request=new o,this.setAccessToken=function(e){this._token=e,this.request.setAccessToken(e),window.BIMPLUS_SDK_ENABLE_DEBUG_LOGS&&console.log("BimWebSdk: token was set to "+this._token)},this.getAccessToken=function(){return this._token},this.setTokenType=function(e){this._tokenType=e,this.request.setTokenType(e),window.BIMPLUS_SDK_ENABLE_DEBUG_LOGS&&console.log("BimWebSdk: token type was set to "+this._tokenType)},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&&console.log("BimWebSdk: team slug was set to "+this._teamSlug)},this.getTeamSlug=function(){return this._teamSlug},this.getApiUrl=function(){return this._config.protocol+this._config.host+"/"+(this._config.version?this._config.version+"/":"")},this.getApiTeamUrl=function(){return this._teamSlug||console.error("Error: Teamslug not set"),this.getApiUrl()+this._teamSlug+"/"},this.getCache=function(){return this._cache},this.authorize=new h(this),this.user=new es(this),this.users=new ts(this),this.teams=new zn(this),this.members=new Pn(this),this.projects=new Nn(this),this.structures=new Vn(this),this.models=new Sn(this),this.objects=new On(this),this.revisions=new Mn(this),this.elementTypes=new yn(this),this.annotations=new u(this),this.attachments=new c(this),this.issues=new Un(this),this.labels=new kn(this),this.pins=new Cn(this),this.comments=new dn(this),this.hyperlinks=new qn(this),this.importService=new _n(this),this.slideshows=new Wn(this),this.slides=new $n(this),this.clashDetection=new pn(this),this.clientLogs=new fn(this),this.rightsService=new Ln(this),this.applicationSettings=new a(this),this.exportService=new vn(this),this.folders=new bn(this),this.locks=new jn(this),this.share=new Hn(this),this.messages=new xn(this),this.objectFilters=new Dn(this),this.terms=new Xn(this),this.dataProtection=new Qn(this),this.dimensions=new mn(this),this.imprints=new Yn(this),this.projectActionsRights=new Rn(this),this.roles=new Fn(this),this.attributeTemplates=new l(this),this.units=new Zn(this),this.freeAttributes=new wn(this),this.freeAttributeGroups=new Tn(this),this.hiddenCalculation=new An(this),this.sectionCut=new Gn(this),this.projectAttributeTemplates=new In(this),this.teamActionsRights=new Jn(this),this.customTables=new gn(this),this.userSettings=new rs(this),this.invitations=new ns(this),this.selections=new ss(this),this.userGroups=new is(this),this.scenes=new os(this),this.baseQuantities=new as(this)},cs=function(e){var t="api.bimplus.net";if(e)switch(e){case"prod":default:t="api.bimplus.net";break;case"dev":t="api-dev.bimplus.net";break;case"stage":t="api-stage.bimplus.net"}return{protocol:"https://",host:t,cache:!1,version:"v2"}};return t})()));
|
|
2
|
+
!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()}(self,(()=>(()=>{"use strict";var e={d:(t,r)=>{for(var n in r)e.o(r,n)&&!e.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:r[n]})},o:(e,t)=>Object.prototype.hasOwnProperty.call(e,t),r:e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})}},t={};function r(e){return function(...t){var r=t.pop();return e.call(this,t,r)}}e.r(t),e.d(t,{Api:()=>so,IDBCache:()=>os,createDefaultConfig:()=>oo});var n="function"==typeof queueMicrotask&&queueMicrotask,i="function"==typeof setImmediate&&setImmediate,s="object"==typeof process&&"function"==typeof process.nextTick;function o(e){setTimeout(e,0)}function u(e){return(t,...r)=>e((()=>t(...r)))}var a=u(n?queueMicrotask:i?setImmediate:s?process.nextTick:o);function c(e){return p(e)?function(...t){const r=t.pop();return l(e.apply(this,t),r)}:r((function(t,r){var n;try{n=e.apply(this,t)}catch(e){return r(e)}if(n&&"function"==typeof n.then)return l(n,r);r(null,n)}))}function l(e,t){return e.then((e=>{h(t,null,e)}),(e=>{h(t,e&&e.message?e:new Error(e))}))}function h(e,t,r){try{e(t,r)}catch(e){a((e=>{throw e}),e)}}function p(e){return"AsyncFunction"===e[Symbol.toStringTag]}function f(e){if("function"!=typeof e)throw new Error("expected a function");return p(e)?c(e):e}function d(e,t=e.length){if(!t)throw new Error("arity is undefined");return function(...r){return"function"==typeof r[t-1]?e.apply(this,r):new Promise(((n,i)=>{r[t-1]=(e,...t)=>{if(e)return i(e);n(t.length>1?t:t[0])},e.apply(this,r)}))}}function g(e){return function(t,...r){const n=d((function(n){var i=this;return e(t,((e,t)=>{f(e).apply(i,r.concat(t))}),n)}));return n}}function m(e,t,r,n){t=t||[];var i=[],s=0,o=f(r);return e(t,((e,t,r)=>{var n=s++;o(e,((e,t)=>{i[n]=t,r(e)}))}),(e=>{n(e,i)}))}function y(e){return e&&"number"==typeof e.length&&e.length>=0&&e.length%1==0}const v={};function b(e){function t(...t){if(null!==e){var r=e;e=null,r.apply(this,t)}}return Object.assign(t,e),t}function w(e){if(y(e))return function(e){var t=-1,r=e.length;return function(){return++t<r?{value:e[t],key:t}:null}}(e);var t=function(e){return e[Symbol.iterator]&&e[Symbol.iterator]()}(e);return t?function(e){var t=-1;return function(){var r=e.next();return r.done?null:(t++,{value:r.value,key:t})}}(t):function(e){var t=e?Object.keys(e):[],r=-1,n=t.length;return function i(){var s=t[++r];return"__proto__"===s?i():r<n?{value:e[s],key:s}:null}}(e)}function T(e){return function(...t){if(null===e)throw new Error("Callback was already called.");var r=e;e=null,r.apply(this,t)}}function A(e,t,r,n){let i=!1,s=!1,o=!1,u=0,a=0;function c(){u>=t||o||i||(o=!0,e.next().then((({value:e,done:t})=>{if(!s&&!i){if(o=!1,t)return i=!0,void(u<=0&&n(null));u++,r(e,a,l),a++,c()}})).catch(h))}function l(e,t){if(u-=1,!s)return e?h(e):!1===e?(i=!0,void(s=!0)):t===v||i&&u<=0?(i=!0,n(null)):void c()}function h(e){s||(o=!1,i=!0,n(e))}c()}var q=e=>(t,r,n)=>{if(n=b(n),e<=0)throw new RangeError("concurrency limit cannot be less than 1");if(!t)return n(null);if(function(e){return"AsyncGenerator"===e[Symbol.toStringTag]}(t))return A(t,e,r,n);if(function(e){return"function"==typeof e[Symbol.asyncIterator]}(t))return A(t[Symbol.asyncIterator](),e,r,n);var i=w(t),s=!1,o=!1,u=0,a=!1;function c(e,t){if(!o)if(u-=1,e)s=!0,n(e);else if(!1===e)s=!0,o=!0;else{if(t===v||s&&u<=0)return s=!0,n(null);a||l()}}function l(){for(a=!0;u<e&&!s;){var t=i();if(null===t)return s=!0,void(u<=0&&n(null));u+=1,r(t.value,t.key,T(c))}a=!1}l()};var _=d((function(e,t,r,n){return q(t)(e,f(r),n)}),4);function U(e,t,r){r=b(r);var n=0,i=0,{length:s}=e,o=!1;function u(e,t){!1===e&&(o=!0),!0!==o&&(e?r(e):++i!==s&&t!==v||r(null))}for(0===s&&r(null);n<s;n++)t(e[n],n,T(u))}function k(e,t,r){return _(e,1/0,t,r)}var x=d((function(e,t,r){return(y(e)?U:k)(e,f(t),r)}),3);var j=d((function(e,t,r){return m(x,e,t,r)}),3),S=g(j);var P=d((function(e,t,r){return _(e,1,t,r)}),3);var E=d((function(e,t,r){return m(P,e,t,r)}),3),O=g(E);const D=Symbol("promiseCallback");function C(){let e,t;function r(r,...n){if(r)return t(r);e(n.length>1?n:n[0])}return r[D]=new Promise(((r,n)=>{e=r,t=n})),r}function I(e,t,r){"number"!=typeof t&&(r=t,t=null),r=b(r||C());var n=Object.keys(e).length;if(!n)return r(null);t||(t=n);var i={},s=0,o=!1,u=!1,a=Object.create(null),c=[],l=[],h={};function p(e,t){c.push((()=>function(e,t){if(u)return;var n=T(((t,...n)=>{if(s--,!1!==t)if(n.length<2&&([n]=n),t){var c={};if(Object.keys(i).forEach((e=>{c[e]=i[e]})),c[e]=n,u=!0,a=Object.create(null),o)return;r(t,c)}else i[e]=n,(a[e]||[]).forEach((e=>e())),d();else o=!0}));s++;var c=f(t[t.length-1]);t.length>1?c(i,n):c(n)}(e,t)))}function d(){if(!o){if(0===c.length&&0===s)return r(null,i);for(;c.length&&s<t;){c.shift()()}}}function g(t){var r=[];return Object.keys(e).forEach((n=>{const i=e[n];Array.isArray(i)&&i.indexOf(t)>=0&&r.push(n)})),r}return Object.keys(e).forEach((t=>{var r=e[t];if(!Array.isArray(r))return p(t,[r]),void l.push(t);var n=r.slice(0,r.length-1),i=n.length;if(0===i)return p(t,r),void l.push(t);h[t]=i,n.forEach((s=>{if(!e[s])throw new Error("async.auto task `"+t+"` has a non-existent dependency `"+s+"` in "+n.join(", "));!function(e,t){var r=a[e];r||(r=a[e]=[]);r.push(t)}(s,(()=>{0===--i&&p(t,r)}))}))})),function(){var e=0;for(;l.length;)e++,g(l.pop()).forEach((e=>{0==--h[e]&&l.push(e)}));if(e!==n)throw new Error("async.auto cannot execute tasks due to a recursive dependency")}(),d(),r[D]}var R=/^(?:async\s+)?(?:function)?\s*\w*\s*\(\s*([^)]+)\s*\)(?:\s*{)/,B=/^(?:async\s+)?\(?\s*([^)=]+)\s*\)?(?:\s*=>)/,L=/,/,K=/(=.+)?(\s*)$/;class N{constructor(){this.head=this.tail=null,this.length=0}removeLink(e){return e.prev?e.prev.next=e.next:this.head=e.next,e.next?e.next.prev=e.prev:this.tail=e.prev,e.prev=e.next=null,this.length-=1,e}empty(){for(;this.head;)this.shift();return this}insertAfter(e,t){t.prev=e,t.next=e.next,e.next?e.next.prev=t:this.tail=t,e.next=t,this.length+=1}insertBefore(e,t){t.prev=e.prev,t.next=e,e.prev?e.prev.next=t:this.head=t,e.prev=t,this.length+=1}unshift(e){this.head?this.insertBefore(this.head,e):M(this,e)}push(e){this.tail?this.insertAfter(this.tail,e):M(this,e)}shift(){return this.head&&this.removeLink(this.head)}pop(){return this.tail&&this.removeLink(this.tail)}toArray(){return[...this]}*[Symbol.iterator](){for(var e=this.head;e;)yield e.data,e=e.next}remove(e){for(var t=this.head;t;){var{next:r}=t;e(t)&&this.removeLink(t),t=r}return this}}function M(e,t){e.length=1,e.head=e.tail=t}function F(e,t,r){if(null==t)t=1;else if(0===t)throw new RangeError("Concurrency must not be zero");var n=f(e),i=0,s=[];const o={error:[],drain:[],saturated:[],unsaturated:[],empty:[]};function u(e,t){return e?t?void(o[e]=o[e].filter((e=>e!==t))):o[e]=[]:Object.keys(o).forEach((e=>o[e]=[]))}function c(e,...t){o[e].forEach((e=>e(...t)))}var l=!1;function h(e,t,r,n){if(null!=n&&"function"!=typeof n)throw new Error("task callback must be a function");var i,s;function o(e,...t){return e?r?s(e):i():t.length<=1?i(t[0]):void i(t)}y.started=!0;var u=y._createTaskItem(e,r?o:n||o);if(t?y._tasks.unshift(u):y._tasks.push(u),l||(l=!0,a((()=>{l=!1,y.process()}))),r||!n)return new Promise(((e,t)=>{i=e,s=t}))}function p(e){return function(t,...r){i-=1;for(var n=0,o=e.length;n<o;n++){var u=e[n],a=s.indexOf(u);0===a?s.shift():a>0&&s.splice(a,1),u.callback(t,...r),null!=t&&c("error",t,u.data)}i<=y.concurrency-y.buffer&&c("unsaturated"),y.idle()&&c("drain"),y.process()}}function d(e){return!(0!==e.length||!y.idle())&&(a((()=>c("drain"))),!0)}const g=e=>t=>{if(!t)return new Promise(((t,r)=>{!function(e,t){const r=(...n)=>{u(e,r),t(...n)};o[e].push(r)}(e,((e,n)=>{if(e)return r(e);t(n)}))}));u(e),function(e,t){o[e].push(t)}(e,t)};var m=!1,y={_tasks:new N,_createTaskItem:(e,t)=>({data:e,callback:t}),*[Symbol.iterator](){yield*y._tasks[Symbol.iterator]()},concurrency:t,payload:r,buffer:t/4,started:!1,paused:!1,push(e,t){if(Array.isArray(e)){if(d(e))return;return e.map((e=>h(e,!1,!1,t)))}return h(e,!1,!1,t)},pushAsync(e,t){if(Array.isArray(e)){if(d(e))return;return e.map((e=>h(e,!1,!0,t)))}return h(e,!1,!0,t)},kill(){u(),y._tasks.empty()},unshift(e,t){if(Array.isArray(e)){if(d(e))return;return e.map((e=>h(e,!0,!1,t)))}return h(e,!0,!1,t)},unshiftAsync(e,t){if(Array.isArray(e)){if(d(e))return;return e.map((e=>h(e,!0,!0,t)))}return h(e,!0,!0,t)},remove(e){y._tasks.remove(e)},process(){if(!m){for(m=!0;!y.paused&&i<y.concurrency&&y._tasks.length;){var e=[],t=[],r=y._tasks.length;y.payload&&(r=Math.min(r,y.payload));for(var o=0;o<r;o++){var u=y._tasks.shift();e.push(u),s.push(u),t.push(u.data)}i+=1,0===y._tasks.length&&c("empty"),i===y.concurrency&&c("saturated");var a=T(p(e));n(t,a)}m=!1}},length:()=>y._tasks.length,running:()=>i,workersList:()=>s,idle:()=>y._tasks.length+i===0,pause(){y.paused=!0},resume(){!1!==y.paused&&(y.paused=!1,a(y.process))}};return Object.defineProperties(y,{saturated:{writable:!1,value:g("saturated")},unsaturated:{writable:!1,value:g("unsaturated")},empty:{writable:!1,value:g("empty")},drain:{writable:!1,value:g("drain")},error:{writable:!1,value:g("error")}}),y}var G=d((function(e,t,r,n){n=b(n);var i=f(r);return P(e,((e,r,n)=>{i(t,e,((e,r)=>{t=r,n(e)}))}),(e=>n(e,t)))}),4);function W(...e){var t=e.map(f);return function(...e){var r=this,n=e[e.length-1];return"function"==typeof n?e.pop():n=C(),G(t,e,((e,t,n)=>{t.apply(r,e.concat(((e,...t)=>{n(e,t)})))}),((e,t)=>n(e,...t))),n[D]}}var H=d((function(e,t,r,n){return m(q(t),e,r,n)}),4);var V=d((function(e,t,r,n){var i=f(r);return H(e,t,((e,t)=>{i(e,((e,...r)=>e?t(e):t(e,r)))}),((e,t)=>{for(var r=[],i=0;i<t.length;i++)t[i]&&(r=r.concat(...t[i]));return n(e,r)}))}),4);var z=d((function(e,t,r){return V(e,1/0,t,r)}),3);var J=d((function(e,t,r){return V(e,1,t,r)}),3);function Q(e,t){return(r,n,i,s)=>{var o,u=!1;const a=f(i);r(n,((r,n,i)=>{a(r,((n,s)=>n||!1===n?i(n):e(s)&&!o?(u=!0,o=t(!0,r),i(null,v)):void i()))}),(e=>{if(e)return s(e);s(null,u?o:t(!1))}))}}var X=d((function(e,t,r){return Q((e=>e),((e,t)=>t))(x,e,t,r)}),3);var Y=d((function(e,t,r,n){return Q((e=>e),((e,t)=>t))(q(t),e,r,n)}),4);var Z=d((function(e,t,r){return Q((e=>e),((e,t)=>t))(q(1),e,t,r)}),3);function ee(e){return(t,...r)=>f(t)(...r,((t,...r)=>{"object"==typeof console&&(t?console.error&&console.error(t):console[e]&&r.forEach((t=>console[e](t))))}))}var te=ee("dir");var re=d((function(e,t,r){r=T(r);var n,i=f(e),s=f(t);function o(e,...t){if(e)return r(e);!1!==e&&(n=t,s(...t,u))}function u(e,t){return e?r(e):!1!==e?t?void i(o):r(null,...n):void 0}return u(null,!0)}),3);function ne(e){return(t,r,n)=>e(t,n)}var ie=d((function(e,t,r){return x(e,ne(f(t)),r)}),3);var se=d((function(e,t,r,n){return q(t)(e,ne(f(r)),n)}),4);var oe=d((function(e,t,r){return se(e,1,t,r)}),3);function ue(e){return p(e)?e:function(...t){var r=t.pop(),n=!0;t.push(((...e)=>{n?a((()=>r(...e))):r(...e)})),e.apply(this,t),n=!1}}var ae=d((function(e,t,r){return Q((e=>!e),(e=>!e))(x,e,t,r)}),3);var ce=d((function(e,t,r,n){return Q((e=>!e),(e=>!e))(q(t),e,r,n)}),4);var le=d((function(e,t,r){return Q((e=>!e),(e=>!e))(P,e,t,r)}),3);function he(e,t,r,n){var i=new Array(t.length);e(t,((e,t,n)=>{r(e,((e,r)=>{i[t]=!!r,n(e)}))}),(e=>{if(e)return n(e);for(var r=[],s=0;s<t.length;s++)i[s]&&r.push(t[s]);n(null,r)}))}function pe(e,t,r,n){var i=[];e(t,((e,t,n)=>{r(e,((r,s)=>{if(r)return n(r);s&&i.push({index:t,value:e}),n(r)}))}),(e=>{if(e)return n(e);n(null,i.sort(((e,t)=>e.index-t.index)).map((e=>e.value)))}))}function fe(e,t,r,n){return(y(t)?he:pe)(e,t,f(r),n)}var de=d((function(e,t,r){return fe(x,e,t,r)}),3);var ge=d((function(e,t,r,n){return fe(q(t),e,r,n)}),4);var me=d((function(e,t,r){return fe(P,e,t,r)}),3);var ye=d((function(e,t){var r=T(t),n=f(ue(e));return function e(t){if(t)return r(t);!1!==t&&n(e)}()}),2);var ve=d((function(e,t,r,n){var i=f(r);return H(e,t,((e,t)=>{i(e,((r,n)=>r?t(r):t(r,{key:n,val:e})))}),((e,t)=>{for(var r={},{hasOwnProperty:i}=Object.prototype,s=0;s<t.length;s++)if(t[s]){var{key:o}=t[s],{val:u}=t[s];i.call(r,o)?r[o].push(u):r[o]=[u]}return n(e,r)}))}),4);var be=ee("log");var we=d((function(e,t,r,n){n=b(n);var i={},s=f(r);return q(t)(e,((e,t,r)=>{s(e,t,((e,n)=>{if(e)return r(e);i[t]=n,r(e)}))}),(e=>n(e,i)))}),4);var Te=u(s?process.nextTick:i?setImmediate:o),Ae=d(((e,t,r)=>{var n=y(t)?[]:{};e(t,((e,t,r)=>{f(e)(((e,...i)=>{i.length<2&&([i]=i),n[t]=i,r(e)}))}),(e=>r(e,n)))}),3);function qe(e,t){var r=f(e);return F(((e,t)=>{r(e[0],t)}),t,1)}class _e{constructor(){this.heap=[],this.pushCount=Number.MIN_SAFE_INTEGER}get length(){return this.heap.length}empty(){return this.heap=[],this}percUp(e){let t;for(;e>0&&xe(this.heap[e],this.heap[t=ke(e)]);){let r=this.heap[e];this.heap[e]=this.heap[t],this.heap[t]=r,e=t}}percDown(e){let t;for(;(t=Ue(e))<this.heap.length&&(t+1<this.heap.length&&xe(this.heap[t+1],this.heap[t])&&(t+=1),!xe(this.heap[e],this.heap[t]));){let r=this.heap[e];this.heap[e]=this.heap[t],this.heap[t]=r,e=t}}push(e){e.pushCount=++this.pushCount,this.heap.push(e),this.percUp(this.heap.length-1)}unshift(e){return this.heap.push(e)}shift(){let[e]=this.heap;return this.heap[0]=this.heap[this.heap.length-1],this.heap.pop(),this.percDown(0),e}toArray(){return[...this]}*[Symbol.iterator](){for(let e=0;e<this.heap.length;e++)yield this.heap[e].data}remove(e){let t=0;for(let r=0;r<this.heap.length;r++)e(this.heap[r])||(this.heap[t]=this.heap[r],t++);this.heap.splice(t);for(let e=ke(this.heap.length-1);e>=0;e--)this.percDown(e);return this}}function Ue(e){return 1+(e<<1)}function ke(e){return(e+1>>1)-1}function xe(e,t){return e.priority!==t.priority?e.priority<t.priority:e.pushCount<t.pushCount}var je=d((function(e,t){if(t=b(t),!Array.isArray(e))return t(new TypeError("First argument to race must be an array of functions"));if(!e.length)return t();for(var r=0,n=e.length;r<n;r++)f(e[r])(t)}),2);function Se(e,t,r,n){var i=[...e].reverse();return G(i,t,r,n)}function Pe(e){var t=f(e);return r((function(e,r){return e.push(((e,...t)=>{let n={};if(e&&(n.error=e),t.length>0){var i=t;t.length<=1&&([i]=t),n.value=i}r(null,n)})),t.apply(this,e)}))}function Ee(e,t,r,n){const i=f(r);return fe(e,t,((e,t)=>{i(e,((e,r)=>{t(e,!r)}))}),n)}var Oe=d((function(e,t,r){return Ee(x,e,t,r)}),3);var De=d((function(e,t,r,n){return Ee(q(t),e,r,n)}),4);var Ce=d((function(e,t,r){return Ee(P,e,t,r)}),3);function Ie(e){return function(){return e}}const Re=5,Be=0;function Le(e,t,r){var n={times:Re,intervalFunc:Ie(Be)};if(arguments.length<3&&"function"==typeof e?(r=t||C(),t=e):(!function(e,t){if("object"==typeof t)e.times=+t.times||Re,e.intervalFunc="function"==typeof t.interval?t.interval:Ie(+t.interval||Be),e.errorFilter=t.errorFilter;else{if("number"!=typeof t&&"string"!=typeof t)throw new Error("Invalid arguments for async.retry");e.times=+t||Re}}(n,e),r=r||C()),"function"!=typeof t)throw new Error("Invalid arguments for async.retry");var i=f(t),s=1;return function e(){i(((t,...i)=>{!1!==t&&(t&&s++<n.times&&("function"!=typeof n.errorFilter||n.errorFilter(t))?setTimeout(e,n.intervalFunc(s-1)):r(t,...i))}))}(),r[D]}var Ke=d((function(e,t,r){return Q(Boolean,(e=>e))(x,e,t,r)}),3);var Ne=d((function(e,t,r,n){return Q(Boolean,(e=>e))(q(t),e,r,n)}),4);var Me=d((function(e,t,r){return Q(Boolean,(e=>e))(P,e,t,r)}),3);var Fe=d((function(e,t,r){var n=f(t);return j(e,((e,t)=>{n(e,((r,n)=>{if(r)return t(r);t(r,{value:e,criteria:n})}))}),((e,t)=>{if(e)return r(e);r(null,t.sort(i).map((e=>e.value)))}));function i(e,t){var r=e.criteria,n=t.criteria;return r<n?-1:r>n?1:0}}),3);function Ge(e,t,r,n){var i=f(r);return H(function(e){for(var t=Array(e);e--;)t[e]=e;return t}(e),t,i,n)}var We=d((function(e,t){var r,n=null;return oe(e,((e,t)=>{f(e)(((e,...i)=>{if(!1===e)return t(e);i.length<2?[r]=i:r=i,n=e,t(e?null:{})}))}),(()=>t(n,r)))}));var He=d((function(e,t,r){r=T(r);var n=f(t),i=f(e),s=[];function o(e,...t){if(e)return r(e);s=t,!1!==e&&i(u)}function u(e,t){return e?r(e):!1!==e?t?void n(o):r(null,...s):void 0}return i(u)}),3);var $e=d((function(e,t){if(t=b(t),!Array.isArray(e))return t(new Error("First argument to waterfall must be an array of functions"));if(!e.length)return t();var r=0;function n(t){f(e[r++])(...t,T(i))}function i(i,...s){if(!1!==i)return i||r===e.length?t(i,...s):void n(s)}n([])})),Ve={apply:function(e,...t){return(...r)=>e(...t,...r)},applyEach:S,applyEachSeries:O,asyncify:c,auto:I,autoInject:function(e,t){var r={};return Object.keys(e).forEach((t=>{var n,i=e[t],s=p(i),o=!s&&1===i.length||s&&0===i.length;if(Array.isArray(i))n=[...i],i=n.pop(),r[t]=n.concat(n.length>0?u:i);else if(o)r[t]=i;else{if(n=function(e){const t=function(e){let t="",r=0,n=e.indexOf("*/");for(;r<e.length;)if("/"===e[r]&&"/"===e[r+1]){let t=e.indexOf("\n",r);r=-1===t?e.length:t}else if(-1!==n&&"/"===e[r]&&"*"===e[r+1]){let i=e.indexOf("*/",r);-1!==i?(r=i+2,n=e.indexOf("*/",r)):(t+=e[r],r++)}else t+=e[r],r++;return t}(e.toString());let r=t.match(R);if(r||(r=t.match(B)),!r)throw new Error("could not parse args in autoInject\nSource:\n"+t);let[,n]=r;return n.replace(/\s/g,"").split(L).map((e=>e.replace(K,"").trim()))}(i),0===i.length&&!s&&0===n.length)throw new Error("autoInject task functions require explicit parameters.");s||n.pop(),r[t]=n.concat(u)}function u(e,t){var r=n.map((t=>e[t]));r.push(t),f(i)(...r)}})),I(r,t)},cargo:function(e,t){return F(e,1,t)},cargoQueue:function(e,t,r){return F(e,t,r)},compose:function(...e){return W(...e.reverse())},concat:z,concatLimit:V,concatSeries:J,constant:function(...e){return function(...t){return t.pop()(null,...e)}},detect:X,detectLimit:Y,detectSeries:Z,dir:te,doUntil:function(e,t,r){const n=f(t);return re(e,((...e)=>{const t=e.pop();n(...e,((e,r)=>t(e,!r)))}),r)},doWhilst:re,each:ie,eachLimit:se,eachOf:x,eachOfLimit:_,eachOfSeries:P,eachSeries:oe,ensureAsync:ue,every:ae,everyLimit:ce,everySeries:le,filter:de,filterLimit:ge,filterSeries:me,forever:ye,groupBy:function(e,t,r){return ve(e,1/0,t,r)},groupByLimit:ve,groupBySeries:function(e,t,r){return ve(e,1,t,r)},log:be,map:j,mapLimit:H,mapSeries:E,mapValues:function(e,t,r){return we(e,1/0,t,r)},mapValuesLimit:we,mapValuesSeries:function(e,t,r){return we(e,1,t,r)},memoize:function(e,t=(e=>e)){var n=Object.create(null),i=Object.create(null),s=f(e),o=r(((e,r)=>{var o=t(...e);o in n?a((()=>r(null,...n[o]))):o in i?i[o].push(r):(i[o]=[r],s(...e,((e,...t)=>{e||(n[o]=t);var r=i[o];delete i[o];for(var s=0,u=r.length;s<u;s++)r[s](e,...t)})))}));return o.memo=n,o.unmemoized=e,o},nextTick:Te,parallel:function(e,t){return Ae(x,e,t)},parallelLimit:function(e,t,r){return Ae(q(t),e,r)},priorityQueue:function(e,t){var r=qe(e,t),{push:n,pushAsync:i}=r;function s(e,t){return Array.isArray(e)?e.map((e=>({data:e,priority:t}))):{data:e,priority:t}}return r._tasks=new _e,r._createTaskItem=({data:e,priority:t},r)=>({data:e,priority:t,callback:r}),r.push=function(e,t=0,r){return n(s(e,t),r)},r.pushAsync=function(e,t=0,r){return i(s(e,t),r)},delete r.unshift,delete r.unshiftAsync,r},queue:qe,race:je,reduce:G,reduceRight:Se,reflect:Pe,reflectAll:function(e){var t;return Array.isArray(e)?t=e.map(Pe):(t={},Object.keys(e).forEach((r=>{t[r]=Pe.call(this,e[r])}))),t},reject:Oe,rejectLimit:De,rejectSeries:Ce,retry:Le,retryable:function(e,t){t||(t=e,e=null);let n=e&&e.arity||t.length;p(t)&&(n+=1);var i=f(t);return r(((t,r)=>{function s(e){i(...t,e)}return(t.length<n-1||null==r)&&(t.push(r),r=C()),e?Le(e,s,r):Le(s,r),r[D]}))},seq:W,series:function(e,t){return Ae(P,e,t)},setImmediate:a,some:Ke,someLimit:Ne,someSeries:Me,sortBy:Fe,timeout:function(e,t,n){var i=f(e);return r(((r,s)=>{var o,u=!1;r.push(((...e)=>{u||(s(...e),clearTimeout(o))})),o=setTimeout((function(){var t=e.name||"anonymous",r=new Error('Callback function "'+t+'" timed out.');r.code="ETIMEDOUT",n&&(r.info=n),u=!0,s(r)}),t),i(...r)}))},times:function(e,t,r){return Ge(e,1/0,t,r)},timesLimit:Ge,timesSeries:function(e,t,r){return Ge(e,1,t,r)},transform:function(e,t,r,n){arguments.length<=3&&"function"==typeof t&&(n=r,r=t,t=Array.isArray(e)?[]:{}),n=b(n||C());var i=f(r);return x(e,((e,r,n)=>{i(t,e,r,n)}),(e=>n(e,t))),n[D]},tryEach:We,unmemoize:function(e){return(...t)=>(e.unmemoized||e)(...t)},until:function(e,t,r){const n=f(e);return He((e=>n(((t,r)=>e(t,!r)))),t,r)},waterfall:$e,whilst:He,all:ae,allLimit:ce,allSeries:le,any:Ke,anyLimit:Ne,anySeries:Me,find:X,findLimit:Y,findSeries:Z,flatMap:z,flatMapLimit:V,flatMapSeries:J,forEach:ie,forEachSeries:oe,forEachLimit:se,forEachOf:x,forEachOfSeries:P,forEachOfLimit:_,inject:G,foldl:G,foldr:Se,select:de,selectLimit:ge,selectSeries:me,wrapSync:c,during:He,doDuring:re};const ze=Ve;function Je(e){return Je="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Je(e)}function Qe(){Qe=function(){return e};var e={},t=Object.prototype,r=t.hasOwnProperty,n=Object.defineProperty||function(e,t,r){e[t]=r.value},i="function"==typeof Symbol?Symbol:{},s=i.iterator||"@@iterator",o=i.asyncIterator||"@@asyncIterator",u=i.toStringTag||"@@toStringTag";function a(e,t,r){return Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{a({},"")}catch(e){a=function(e,t,r){return e[t]=r}}function c(e,t,r,i){var s=t&&t.prototype instanceof p?t:p,o=Object.create(s.prototype),u=new U(i||[]);return n(o,"_invoke",{value:T(e,r,u)}),o}function l(e,t,r){try{return{type:"normal",arg:e.call(t,r)}}catch(e){return{type:"throw",arg:e}}}e.wrap=c;var h={};function p(){}function f(){}function d(){}var g={};a(g,s,(function(){return this}));var m=Object.getPrototypeOf,y=m&&m(m(k([])));y&&y!==t&&r.call(y,s)&&(g=y);var v=d.prototype=p.prototype=Object.create(g);function b(e){["next","throw","return"].forEach((function(t){a(e,t,(function(e){return this._invoke(t,e)}))}))}function w(e,t){function i(n,s,o,u){var a=l(e[n],e,s);if("throw"!==a.type){var c=a.arg,h=c.value;return h&&"object"==Je(h)&&r.call(h,"__await")?t.resolve(h.__await).then((function(e){i("next",e,o,u)}),(function(e){i("throw",e,o,u)})):t.resolve(h).then((function(e){c.value=e,o(c)}),(function(e){return i("throw",e,o,u)}))}u(a.arg)}var s;n(this,"_invoke",{value:function(e,r){function n(){return new t((function(t,n){i(e,r,t,n)}))}return s=s?s.then(n,n):n()}})}function T(e,t,r){var n="suspendedStart";return function(i,s){if("executing"===n)throw new Error("Generator is already running");if("completed"===n){if("throw"===i)throw s;return x()}for(r.method=i,r.arg=s;;){var o=r.delegate;if(o){var u=A(o,r);if(u){if(u===h)continue;return u}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if("suspendedStart"===n)throw n="completed",r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);n="executing";var a=l(e,t,r);if("normal"===a.type){if(n=r.done?"completed":"suspendedYield",a.arg===h)continue;return{value:a.arg,done:r.done}}"throw"===a.type&&(n="completed",r.method="throw",r.arg=a.arg)}}}function A(e,t){var r=t.method,n=e.iterator[r];if(void 0===n)return t.delegate=null,"throw"===r&&e.iterator.return&&(t.method="return",t.arg=void 0,A(e,t),"throw"===t.method)||"return"!==r&&(t.method="throw",t.arg=new TypeError("The iterator does not provide a '"+r+"' method")),h;var i=l(n,e.iterator,t.arg);if("throw"===i.type)return t.method="throw",t.arg=i.arg,t.delegate=null,h;var s=i.arg;return s?s.done?(t[e.resultName]=s.value,t.next=e.nextLoc,"return"!==t.method&&(t.method="next",t.arg=void 0),t.delegate=null,h):s:(t.method="throw",t.arg=new TypeError("iterator result is not an object"),t.delegate=null,h)}function q(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function _(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function U(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(q,this),this.reset(!0)}function k(e){if(e){var t=e[s];if(t)return t.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var n=-1,i=function t(){for(;++n<e.length;)if(r.call(e,n))return t.value=e[n],t.done=!1,t;return t.value=void 0,t.done=!0,t};return i.next=i}}return{next:x}}function x(){return{value:void 0,done:!0}}return f.prototype=d,n(v,"constructor",{value:d,configurable:!0}),n(d,"constructor",{value:f,configurable:!0}),f.displayName=a(d,u,"GeneratorFunction"),e.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===f||"GeneratorFunction"===(t.displayName||t.name))},e.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,d):(e.__proto__=d,a(e,u,"GeneratorFunction")),e.prototype=Object.create(v),e},e.awrap=function(e){return{__await:e}},b(w.prototype),a(w.prototype,o,(function(){return this})),e.AsyncIterator=w,e.async=function(t,r,n,i,s){void 0===s&&(s=Promise);var o=new w(c(t,r,n,i),s);return e.isGeneratorFunction(r)?o:o.next().then((function(e){return e.done?e.value:o.next()}))},b(v),a(v,u,"Generator"),a(v,s,(function(){return this})),a(v,"toString",(function(){return"[object Generator]"})),e.keys=function(e){var t=Object(e),r=[];for(var n in t)r.push(n);return r.reverse(),function e(){for(;r.length;){var n=r.pop();if(n in t)return e.value=n,e.done=!1,e}return e.done=!0,e}},e.values=k,U.prototype={constructor:U,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(_),!e)for(var t in this)"t"===t.charAt(0)&&r.call(this,t)&&!isNaN(+t.slice(1))&&(this[t]=void 0)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var t=this;function n(r,n){return o.type="throw",o.arg=e,t.next=r,n&&(t.method="next",t.arg=void 0),!!n}for(var i=this.tryEntries.length-1;i>=0;--i){var s=this.tryEntries[i],o=s.completion;if("root"===s.tryLoc)return n("end");if(s.tryLoc<=this.prev){var u=r.call(s,"catchLoc"),a=r.call(s,"finallyLoc");if(u&&a){if(this.prev<s.catchLoc)return n(s.catchLoc,!0);if(this.prev<s.finallyLoc)return n(s.finallyLoc)}else if(u){if(this.prev<s.catchLoc)return n(s.catchLoc,!0)}else{if(!a)throw new Error("try statement without catch or finally");if(this.prev<s.finallyLoc)return n(s.finallyLoc)}}}},abrupt:function(e,t){for(var n=this.tryEntries.length-1;n>=0;--n){var i=this.tryEntries[n];if(i.tryLoc<=this.prev&&r.call(i,"finallyLoc")&&this.prev<i.finallyLoc){var s=i;break}}s&&("break"===e||"continue"===e)&&s.tryLoc<=t&&t<=s.finallyLoc&&(s=null);var o=s?s.completion:{};return o.type=e,o.arg=t,s?(this.method="next",this.next=s.finallyLoc,h):this.complete(o)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),h},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.finallyLoc===e)return this.complete(r.completion,r.afterLoc),_(r),h}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.tryLoc===e){var n=r.completion;if("throw"===n.type){var i=n.arg;_(r)}return i}}throw new Error("illegal catch attempt")},delegateYield:function(e,t,r){return this.delegate={iterator:k(e),resultName:t,nextLoc:r},"next"===this.method&&(this.arg=void 0),h}},e}function Xe(e,t,r,n,i,s,o){try{var u=e[s](o),a=u.value}catch(e){return void r(e)}u.done?t(a):Promise.resolve(a).then(n,i)}function Ye(e){return function(){var t=this,r=arguments;return new Promise((function(n,i){var s=e.apply(t,r);function o(e){Xe(s,n,i,o,u,"next",e)}function u(e){Xe(s,n,i,o,u,"throw",e)}o(void 0)}))}}function Ze(e,t,r,n){return $.ajax({url:e,type:t,data:r,contentType:n&&void 0!==n.contentType?n.contentType:"application/json; charset=utf-8",dataType:n&&void 0!==n.dataType?n.dataType:"json",processData:!(!n||void 0===n.processData)&&n.processData,cache:!(!window||!window.BIMPLUS_SDK_ENABLE_CACHE),async:!0,xhr:function(){var e=$.ajaxSettings.xhr();return n&&void 0!==n.xhrUploadProgress&&e.upload.addEventListener("progress",n.xhrUploadProgress,!1),e},beforeSend:function(e){if(window&&void 0!==window.BIMPLUS_SDK_PENDING_REQUESTS&&window.BIMPLUS_SDK_PENDING_REQUESTS++,n&&n.token){var t=n.tokenType?n.tokenType:"BimPlus";e.setRequestHeader("Authorization",t+" "+n.token)}n&&n.eTag&&(e.setRequestHeader("Cache-Control","no-cache"),window&&!window.BIMPLUS_SDK_DISABLE_ETAG&&e.setRequestHeader("If-None-Match",n.eTag))},complete:function(t){if(window&&void 0!==window.BIMPLUS_SDK_PENDING_REQUESTS&&window.BIMPLUS_SDK_PENDING_REQUESTS--,window&&window.BIMPLUS_SDK_LOG_API_CALLS){var r={url:e,response:t&&t.responseText&&t.responseText.length>0?JSON.parse(t.responseText):null};console.log(JSON.stringify(r))}}})}function et(e,t,r,n){var i=$.Deferred();console.debug("xmlHttpRequest config=",n);var s=new XMLHttpRequest;return s.open(t,e,!0),s.setRequestHeader("Authorization","BimPlus "+n.token),window&&void 0!==window.BIMPLUS_SDK_PENDING_REQUESTS&&window.BIMPLUS_SDK_PENDING_REQUESTS++,n&&n.responseType&&(console.debug("responseType is set to",n.responseType),s.responseType=n.responseType),n&&n.eTag&&(console.debug("setRequestHeader is set to eTag",n.eTag),s.setRequestHeader("Cache-Control","no-cache"),window&&!window.BIMPLUS_SDK_DISABLE_ETAG&&s.setRequestHeader("If-None-Match",n.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()},r&&s.setRequestHeader("Content-Type","application/json;charset=UTF-8"),s.send(r),i.promise()}function tt(e){var t="?";for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t+=r+"="+e[r]+"&");return t=t.slice(0,-1)}function rt(e,t,r,n,i){var s=arguments.length>5&&void 0!==arguments[5]&&arguments[5],o=arguments.length>6&&void 0!==arguments[6]?arguments[6]:null,u=arguments.length>7&&void 0!==arguments[7]?arguments[7]:null;i||(i={}),i.token||(i.token=t),i.queryParams||(i.queryParams={}),i.queryParams.chunkSize=r,i.queryParams.chunk=1;var a,c=$.Deferred(),l=[];return o&&(a=ze.queue(function(){var t=Ye(Qe().mark((function t(r,s){var o;return Qe().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return o=$.Deferred(),i.queryParams.chunk=r,t.next=4,e.get(n,i).done((function(e){o.resolve(e)})).fail((function(e,t){o.reject(e,t)}));case 4:s(o);case 5:case"end":return t.stop()}}),t)})));return function(e,r){return t.apply(this,arguments)}}(),o)),e.get(n,i).done(function(){var t=Ye(Qe().mark((function t(r,h,p){var f,d,g,m,y,v,b;return Qe().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(l.push(r),f=0,200===p.status?(d=p.getResponseHeader("X-Total-Count"))?f=parseInt(d,10):console.warn("Request for "+n+" doesn't support chunked responses!"):304===p.status&&(p["Cached-X-Total-Count"]?f=p["Cached-X-Total-Count"]:console.warn("Cached request for "+n+" doesn't contain chunk info!")),!s){t.next=17;break}g=Qe().mark((function t(){var r,s;return Qe().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:i.queryParams.chunk=m,o?(r=u||function(e){l.push(e)},a.push(m,r)):(s=$.Deferred(),e.get(n,i).done((function(e){s.resolve(e)})).fail((function(e,t){s.reject(e,t)})),null!=u&&s.then((function(e){u(e)})),l.push(s));case 2:case"end":return t.stop()}}),t)})),m=2;case 6:if(!(m<=f)){t.next=11;break}return t.delegateYield(g(),"t0",8);case 8:m++,t.next=6;break;case 11:if(!(o&&f>1)){t.next=14;break}return t.next=14,a.drain();case 14:c.resolve(l),t.next=20;break;case 17:for(y=[],v=2;v<=f;v++)i.queryParams.chunk=v,b=e.get(n,i).done((function(e){l.push(e)})).fail((function(e,t){c.reject(e,t)})),y.push(b);Promise.all(y).then((function(){c.resolve(l)}));case 20:case"end":return t.stop()}}),t)})));return function(e,r,n){return t.apply(this,arguments)}}()).fail((function(e,t){c.reject(e,t)})),c.promise()}var nt=function(){var e=null,t=null;this.setAccessToken=function(t){e=t},this.setTokenType=function(e){t=e},this.get=function(r,n){return n||(n={}),n.token||(n.token=e),n.tokenType&&n.tokenType===t||(n.tokenType=t),n.queryParams&&(r+=tt(n.queryParams)),n&&n.useXMLHttpRequest?et(r,"GET",null,n):Ze(r,"GET",null,n)},this.getChunked=function(t,r){return rt(this,e,"medium",t,r,arguments.length>2&&void 0!==arguments[2]&&arguments[2],arguments.length>3&&void 0!==arguments[3]?arguments[3]:null,arguments.length>4&&void 0!==arguments[4]?arguments[4]:null)},this.put=function(r,n,i){return i||(i={}),i.token||(i.token=e),i.tokenType&&i.tokenType===t||(i.tokenType=t),i.queryParams&&(r+=tt(i.queryParams)),Ze(r,"PUT",n,i)},this.post=function(r,n,i){return i||(i={}),i.token||(i.token=e),i.tokenType&&i.tokenType===t||(i.tokenType=t),i.queryParams&&(r+=tt(i.queryParams)),i&&i.useXMLHttpRequest?et(r,"POST",n,i):Ze(r,"POST",n,i)},this.del=function(r,n,i){return i||(i={}),n||(i.contentType=null),i.dataType=null,i.token||(i.token=e),i.tokenType&&i.tokenType===t||(i.tokenType=t),i.queryParams&&(r+=tt(i.queryParams)),Ze(r,"DELETE",n||null,i)}},it=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,r){return e.request.put(e.getApiUrl()+"application/settings/"+t,r)},this.deleteSettings=function(t){return e.request.del(e.getApiUrl()+"application/settings/"+t)}},st=function(e){this.get=function(t){return console.debug("Annotation get API ",e.getApiTeamUrl()+"annotations/"+t),e.request.get(e.getApiTeamUrl()+"annotations/"+t)},this.delete=function(t){return e.request.del(e.getApiTeamUrl()+"annotations/"+t)},this.put=function(t,r){return e.request.put(e.getApiTeamUrl()+"annotations/"+t,r)}},ot=function(e){this.get=function(t){return e.request.get(e.getApiTeamUrl()+"attachments/"+t)},this.download=function(t,r){return r?e.request.get(e.getApiTeamUrl()+"attachments/"+t+"/versions/"+r+"/download"):e.request.get(e.getApiTeamUrl()+"attachments/"+t+"/download")},this.put=function(t,r){return e.request.put(e.getApiTeamUrl()+"attachments/"+t,r)},this.post=function(t,r,n){return e.request.put(e.getApiTeamUrl()+"attachments/"+t,r,{contentType:!1,processData:!1,dataType:null,xhrUploadProgress:n})},this.delete=function(t,r){return r?e.request.del(e.getApiTeamUrl()+"attachments/"+t+"/versions/"+r):e.request.del(e.getApiTeamUrl()+"attachments/"+t)},this.deleteSelected=function(t){return e.request.del(e.getApiTeamUrl()+"objects/"+t+"/attachments")},this.postVersion=function(t,r,n){return e.request.post(e.getApiTeamUrl()+"attachments/"+t+"/versions",r,{contentType:!1,processData:!1,dataType:null,xhrUploadProgress:n})},this.getAllVersions=function(t){return e.request.get(e.getApiTeamUrl()+"attachments/"+t+"/versions")},this.releaseVersion=function(t,r){return e.request.put(e.getApiTeamUrl()+"attachments/"+t+"/release",r)}},ut=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,r){return e.request.put(e.getApiTeamUrl()+"attributetemplates/"+t,r)},this.delete=function(t){return e.request.del(e.getApiTeamUrl()+"attributetemplates/"+t)}},at=function(e){this.post=function(t,r,n){return e.request.post(e.getApiUrl()+"authorize",JSON.stringify({user_id:t,password:r,application_id:n}))},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")},this.requestExternalAppToken=function(){return e.request.get(e.getApiUrl()+"validate")}};const ct="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:"undefined"!=typeof window?window:global,lt=Object.keys,ht=Array.isArray;function pt(e,t){return"object"!=typeof t||lt(t).forEach((function(r){e[r]=t[r]})),e}"undefined"==typeof Promise||ct.Promise||(ct.Promise=Promise);const ft=Object.getPrototypeOf,dt={}.hasOwnProperty;function gt(e,t){return dt.call(e,t)}function mt(e,t){"function"==typeof t&&(t=t(ft(e))),("undefined"==typeof Reflect?lt:Reflect.ownKeys)(t).forEach((r=>{vt(e,r,t[r])}))}const yt=Object.defineProperty;function vt(e,t,r,n){yt(e,t,pt(r&>(r,"get")&&"function"==typeof r.get?{get:r.get,set:r.set,configurable:!0}:{value:r,configurable:!0,writable:!0},n))}function bt(e){return{from:function(t){return e.prototype=Object.create(t.prototype),vt(e.prototype,"constructor",e),{extend:mt.bind(null,e.prototype)}}}}const wt=Object.getOwnPropertyDescriptor;function Tt(e,t){let r;return wt(e,t)||(r=ft(e))&&Tt(r,t)}const At=[].slice;function qt(e,t,r){return At.call(e,t,r)}function _t(e,t){return t(e)}function Ut(e){if(!e)throw new Error("Assertion Failed")}function kt(e){ct.setImmediate?setImmediate(e):setTimeout(e,0)}function xt(e,t){return e.reduce(((e,r,n)=>{var i=t(r,n);return i&&(e[i[0]]=i[1]),e}),{})}function jt(e,t){if(gt(e,t))return e[t];if(!t)return e;if("string"!=typeof t){for(var r=[],n=0,i=t.length;n<i;++n){var s=jt(e,t[n]);r.push(s)}return r}var o=t.indexOf(".");if(-1!==o){var u=e[t.substr(0,o)];return void 0===u?void 0:jt(u,t.substr(o+1))}}function St(e,t,r){if(e&&void 0!==t&&(!("isFrozen"in Object)||!Object.isFrozen(e)))if("string"!=typeof t&&"length"in t){Ut("string"!=typeof r&&"length"in r);for(var n=0,i=t.length;n<i;++n)St(e,t[n],r[n])}else{var s=t.indexOf(".");if(-1!==s){var o=t.substr(0,s),u=t.substr(s+1);if(""===u)void 0===r?ht(e)&&!isNaN(parseInt(o))?e.splice(o,1):delete e[o]:e[o]=r;else{var a=e[o];a&>(e,o)||(a=e[o]={}),St(a,u,r)}}else void 0===r?ht(e)&&!isNaN(parseInt(t))?e.splice(t,1):delete e[t]:e[t]=r}}function Pt(e){var t={};for(var r in e)gt(e,r)&&(t[r]=e[r]);return t}const Et=[].concat;function Ot(e){return Et.apply([],e)}const Dt="Boolean,String,Date,RegExp,Blob,File,FileList,FileSystemFileHandle,ArrayBuffer,DataView,Uint8ClampedArray,ImageBitmap,ImageData,Map,Set,CryptoKey".split(",").concat(Ot([8,16,32,64].map((e=>["Int","Uint","Float"].map((t=>t+e+"Array")))))).filter((e=>ct[e])),Ct=Dt.map((e=>ct[e]));xt(Dt,(e=>[e,!0]));let It=null;function Rt(e){It="undefined"!=typeof WeakMap&&new WeakMap;const t=Bt(e);return It=null,t}function Bt(e){if(!e||"object"!=typeof e)return e;let t=It&&It.get(e);if(t)return t;if(ht(e)){t=[],It&&It.set(e,t);for(var r=0,n=e.length;r<n;++r)t.push(Bt(e[r]))}else if(Ct.indexOf(e.constructor)>=0)t=e;else{const r=ft(e);for(var i in t=r===Object.prototype?{}:Object.create(r),It&&It.set(e,t),e)gt(e,i)&&(t[i]=Bt(e[i]))}return t}const{toString:Lt}={};function Kt(e){return Lt.call(e).slice(8,-1)}const Nt="undefined"!=typeof Symbol?Symbol.iterator:"@@iterator",Mt="symbol"==typeof Nt?function(e){var t;return null!=e&&(t=e[Nt])&&t.apply(e)}:function(){return null},Ft={};function Gt(e){var t,r,n,i;if(1===arguments.length){if(ht(e))return e.slice();if(this===Ft&&"string"==typeof e)return[e];if(i=Mt(e)){for(r=[];!(n=i.next()).done;)r.push(n.value);return r}if(null==e)return[e];if("number"==typeof(t=e.length)){for(r=new Array(t);t--;)r[t]=e[t];return r}return[e]}for(t=arguments.length,r=new Array(t);t--;)r[t]=arguments[t];return r}const Wt="undefined"!=typeof Symbol?e=>"AsyncFunction"===e[Symbol.toStringTag]:()=>!1;var Ht="undefined"!=typeof location&&/^(http|https):\/\/(localhost|127\.0\.0\.1)/.test(location.href);function $t(e,t){Ht=e,Vt=t}var Vt=()=>!0;const zt=!new Error("").stack;function Jt(){if(zt)try{throw Jt.arguments,new Error}catch(e){return e}return new Error}function Qt(e,t){var r=e.stack;return r?(t=t||0,0===r.indexOf(e.name)&&(t+=(e.name+e.message).split("\n").length),r.split("\n").slice(t).filter(Vt).map((e=>"\n"+e)).join("")):""}var Xt=["Unknown","Constraint","Data","TransactionInactive","ReadOnly","Version","NotFound","InvalidState","InvalidAccess","Abort","Timeout","QuotaExceeded","Syntax","DataClone"],Yt=["Modify","Bulk","OpenFailed","VersionChange","Schema","Upgrade","InvalidTable","MissingAPI","NoSuchDatabase","InvalidArgument","SubTransaction","Unsupported","Internal","DatabaseClosed","PrematureCommit","ForeignAwait"].concat(Xt),Zt={VersionChanged:"Database version changed by other database connection",DatabaseClosed:"Database has been closed",Abort:"Transaction aborted",TransactionInactive:"Transaction has already completed or failed",MissingAPI:"IndexedDB API missing. Please visit https://tinyurl.com/y2uuvskb"};function er(e,t){this._e=Jt(),this.name=e,this.message=t}function tr(e,t){return e+". Errors: "+Object.keys(t).map((e=>t[e].toString())).filter(((e,t,r)=>r.indexOf(e)===t)).join("\n")}function rr(e,t,r,n){this._e=Jt(),this.failures=t,this.failedKeys=n,this.successCount=r,this.message=tr(e,t)}function nr(e,t){this._e=Jt(),this.name="BulkError",this.failures=Object.keys(t).map((e=>t[e])),this.failuresByPos=t,this.message=tr(e,t)}bt(er).from(Error).extend({stack:{get:function(){return this._stack||(this._stack=this.name+": "+this.message+Qt(this._e,2))}},toString:function(){return this.name+": "+this.message}}),bt(rr).from(er),bt(nr).from(er);var ir=Yt.reduce(((e,t)=>(e[t]=t+"Error",e)),{});const sr=er;var or=Yt.reduce(((e,t)=>{var r=t+"Error";function n(e,n){this._e=Jt(),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=Zt[t]||r,this.inner=null)}return bt(n).from(sr),e[t]=n,e}),{});or.Syntax=SyntaxError,or.Type=TypeError,or.Range=RangeError;var ur=Xt.reduce(((e,t)=>(e[t+"Error"]=or[t],e)),{}),ar=Yt.reduce(((e,t)=>(-1===["Syntax","Type","Range"].indexOf(t)&&(e[t+"Error"]=or[t]),e)),{});function cr(){}function lr(e){return e}function hr(e,t){return null==e||e===lr?t:function(r){return t(e(r))}}function pr(e,t){return function(){e.apply(this,arguments),t.apply(this,arguments)}}function fr(e,t){return e===cr?t:function(){var r=e.apply(this,arguments);void 0!==r&&(arguments[0]=r);var n=this.onsuccess,i=this.onerror;this.onsuccess=null,this.onerror=null;var s=t.apply(this,arguments);return n&&(this.onsuccess=this.onsuccess?pr(n,this.onsuccess):n),i&&(this.onerror=this.onerror?pr(i,this.onerror):i),void 0!==s?s:r}}function dr(e,t){return e===cr?t:function(){e.apply(this,arguments);var r=this.onsuccess,n=this.onerror;this.onsuccess=this.onerror=null,t.apply(this,arguments),r&&(this.onsuccess=this.onsuccess?pr(r,this.onsuccess):r),n&&(this.onerror=this.onerror?pr(n,this.onerror):n)}}function gr(e,t){return e===cr?t:function(r){var n=e.apply(this,arguments);pt(r,n);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?pr(i,this.onsuccess):i),s&&(this.onerror=this.onerror?pr(s,this.onerror):s),void 0===n?void 0===o?void 0:o:pt(n,o)}}function mr(e,t){return e===cr?t:function(){return!1!==t.apply(this,arguments)&&e.apply(this,arguments)}}function yr(e,t){return e===cr?t:function(){var r=e.apply(this,arguments);if(r&&"function"==typeof r.then){for(var n=this,i=arguments.length,s=new Array(i);i--;)s[i]=arguments[i];return r.then((function(){return t.apply(n,s)}))}return t.apply(this,arguments)}}ar.ModifyError=rr,ar.DexieError=er,ar.BulkError=nr;var vr={};const[br,wr,Tr]="undefined"==typeof Promise?[]:(()=>{let e=Promise.resolve();if("undefined"==typeof crypto||!crypto.subtle)return[e,ft(e),e];const t=crypto.subtle.digest("SHA-512",new Uint8Array([0]));return[t,ft(t),e]})(),Ar=wr&&wr.then,qr=br&&br.constructor,_r=!!Tr;var Ur=!1,kr=Tr?()=>{Tr.then(Jr)}:ct.setImmediate?setImmediate.bind(null,Jr):ct.MutationObserver?()=>{var e=document.createElement("div");new MutationObserver((()=>{Jr(),e=null})).observe(e,{attributes:!0}),e.setAttribute("i","1")}:()=>{setTimeout(Jr,0)},xr=function(e,t){Rr.push([e,t]),Sr&&(kr(),Sr=!1)},jr=!0,Sr=!0,Pr=[],Er=[],Or=null,Dr=lr,Cr={id:"global",global:!0,ref:0,unhandleds:[],onunhandled:wn,pgp:!1,env:{},finalize:function(){this.unhandleds.forEach((e=>{try{wn(e[0],e[1])}catch(e){}}))}},Ir=Cr,Rr=[],Br=0,Lr=[];function Kr(e){if("object"!=typeof this)throw new TypeError("Promises must be constructed via new");this._listeners=[],this.onuncatched=cr,this._lib=!1;var t=this._PSD=Ir;if(Ht&&(this._stackHolder=Jt(),this._prev=null,this._numPrev=0),"function"!=typeof e){if(e!==vr)throw new TypeError("Not a function");return this._state=arguments[1],this._value=arguments[2],void(!1===this._state&&Gr(this,this._value))}this._state=null,this._value=null,++t.ref,Fr(this,e)}const Nr={get:function(){var e=Ir,t=on;function r(r,n){var i=!e.global&&(e!==Ir||t!==on);const s=i&&!ln();var o=new Kr(((t,o)=>{Hr(this,new Mr(vn(r,e,i,s),vn(n,e,i,s),t,o,e))}));return Ht&&zr(o,this),o}return r.prototype=vr,r},set:function(e){vt(this,"then",e&&e.prototype===vr?Nr:{get:function(){return e},set:Nr.set})}};function Mr(e,t,r,n,i){this.onFulfilled="function"==typeof e?e:null,this.onRejected="function"==typeof t?t:null,this.resolve=r,this.reject=n,this.psd=i}function Fr(e,t){try{t((t=>{if(null===e._state){if(t===e)throw new TypeError("A promise cannot be resolved with itself.");var r=e._lib&&Qr();t&&"function"==typeof t.then?Fr(e,((e,r)=>{t instanceof Kr?t._then(e,r):t.then(e,r)})):(e._state=!0,e._value=t,Wr(e)),r&&Xr()}}),Gr.bind(null,e))}catch(t){Gr(e,t)}}function Gr(e,t){if(Er.push(t),null===e._state){var r=e._lib&&Qr();t=Dr(t),e._state=!1,e._value=t,Ht&&null!==t&&"object"==typeof t&&!t._promise&&function(e,t,r){try{e.apply(null,void 0)}catch(e){}}((()=>{var r=Tt(t,"stack");t._promise=e,vt(t,"stack",{get:()=>Ur?r&&(r.get?r.get.apply(t):r.value):e.stack})})),function(e){Pr.some((t=>t._value===e._value))||Pr.push(e)}(e),Wr(e),r&&Xr()}}function Wr(e){var t=e._listeners;e._listeners=[];for(var r=0,n=t.length;r<n;++r)Hr(e,t[r]);var i=e._PSD;--i.ref||i.finalize(),0===Br&&(++Br,xr((()=>{0==--Br&&Yr()}),[]))}function Hr(e,t){if(null!==e._state){var r=e._state?t.onFulfilled:t.onRejected;if(null===r)return(e._state?t.resolve:t.reject)(e._value);++t.psd.ref,++Br,xr($r,[r,e,t])}else e._listeners.push(t)}function $r(e,t,r){try{Or=t;var n,i=t._value;t._state?n=e(i):(Er.length&&(Er=[]),n=e(i),-1===Er.indexOf(i)&&function(e){for(var t=Pr.length;t;)if(Pr[--t]._value===e._value)return void Pr.splice(t,1)}(t)),r.resolve(n)}catch(e){r.reject(e)}finally{Or=null,0==--Br&&Yr(),--r.psd.ref||r.psd.finalize()}}function Vr(e,t,r){if(t.length===r)return t;var n="";if(!1===e._state){var i,s,o=e._value;null!=o?(i=o.name||"Error",s=o.message||o,n=Qt(o,0)):(i=o,s=""),t.push(i+(s?": "+s:"")+n)}return Ht&&((n=Qt(e._stackHolder,2))&&-1===t.indexOf(n)&&t.push(n),e._prev&&Vr(e._prev,t,r)),t}function zr(e,t){var r=t?t._numPrev+1:0;r<100&&(e._prev=t,e._numPrev=r)}function Jr(){Qr()&&Xr()}function Qr(){var e=jr;return jr=!1,Sr=!1,e}function Xr(){var e,t,r;do{for(;Rr.length>0;)for(e=Rr,Rr=[],r=e.length,t=0;t<r;++t){var n=e[t];n[0].apply(null,n[1])}}while(Rr.length>0);jr=!0,Sr=!0}function Yr(){var e=Pr;Pr=[],e.forEach((e=>{e._PSD.onunhandled.call(null,e._value,e)}));for(var t=Lr.slice(0),r=t.length;r;)t[--r]()}function Zr(e){return new Kr(vr,!1,e)}function en(e,t){var r=Ir;return function(){var n=Qr(),i=Ir;try{return dn(r,!0),e.apply(this,arguments)}catch(e){t&&t(e)}finally{dn(i,!1),n&&Xr()}}}mt(Kr.prototype,{then:Nr,_then:function(e,t){Hr(this,new Mr(null,null,e,t,Ir))},catch:function(e){if(1===arguments.length)return this.then(null,e);var t=arguments[0],r=arguments[1];return"function"==typeof t?this.then(null,(e=>e instanceof t?r(e):Zr(e))):this.then(null,(e=>e&&e.name===t?r(e):Zr(e)))},finally:function(e){return this.then((t=>(e(),t)),(t=>(e(),Zr(t))))},stack:{get:function(){if(this._stack)return this._stack;try{Ur=!0;var e=Vr(this,[],20).join("\nFrom previous: ");return null!==this._state&&(this._stack=e),e}finally{Ur=!1}}},timeout:function(e,t){return e<1/0?new Kr(((r,n)=>{var i=setTimeout((()=>n(new or.Timeout(t))),e);this.then(r,n).finally(clearTimeout.bind(null,i))})):this}}),"undefined"!=typeof Symbol&&Symbol.toStringTag&&vt(Kr.prototype,Symbol.toStringTag,"Dexie.Promise"),Cr.env=gn(),mt(Kr,{all:function(){var e=Gt.apply(null,arguments).map(hn);return new Kr((function(t,r){0===e.length&&t([]);var n=e.length;e.forEach(((i,s)=>Kr.resolve(i).then((r=>{e[s]=r,--n||t(e)}),r)))}))},resolve:e=>{if(e instanceof Kr)return e;if(e&&"function"==typeof e.then)return new Kr(((t,r)=>{e.then(t,r)}));var t=new Kr(vr,!0,e);return zr(t,Or),t},reject:Zr,race:function(){var e=Gt.apply(null,arguments).map(hn);return new Kr(((t,r)=>{e.map((e=>Kr.resolve(e).then(t,r)))}))},PSD:{get:()=>Ir,set:e=>Ir=e},totalEchoes:{get:()=>on},newPSD:an,usePSD:mn,scheduler:{get:()=>xr,set:e=>{xr=e}},rejectionMapper:{get:()=>Dr,set:e=>{Dr=e}},follow:(e,t)=>new Kr(((r,n)=>an(((t,r)=>{var n=Ir;n.unhandleds=[],n.onunhandled=r,n.finalize=pr((function(){!function(e){Lr.push((function t(){e(),Lr.splice(Lr.indexOf(t),1)})),++Br,xr((()=>{0==--Br&&Yr()}),[])}((()=>{0===this.unhandleds.length?t():r(this.unhandleds[0])}))}),n.finalize),e()}),t,r,n)))}),qr&&(qr.allSettled&&vt(Kr,"allSettled",(function(){const e=Gt.apply(null,arguments).map(hn);return new Kr((t=>{0===e.length&&t([]);let r=e.length;const n=new Array(r);e.forEach(((e,i)=>Kr.resolve(e).then((e=>n[i]={status:"fulfilled",value:e}),(e=>n[i]={status:"rejected",reason:e})).then((()=>--r||t(n)))))}))})),qr.any&&"undefined"!=typeof AggregateError&&vt(Kr,"any",(function(){const e=Gt.apply(null,arguments).map(hn);return new Kr(((t,r)=>{0===e.length&&r(new AggregateError([]));let n=e.length;const i=new Array(n);e.forEach(((e,s)=>Kr.resolve(e).then((e=>t(e)),(e=>{i[s]=e,--n||r(new AggregateError(i))}))))}))})));const tn={awaits:0,echoes:0,id:0};var rn=0,nn=[],sn=0,on=0,un=0;function an(e,t,r,n){var i=Ir,s=Object.create(i);s.parent=i,s.ref=0,s.global=!1,s.id=++un;var o=Cr.env;s.env=_r?{Promise:Kr,PromiseProp:{value:Kr,configurable:!0,writable:!0},all:Kr.all,race:Kr.race,allSettled:Kr.allSettled,any:Kr.any,resolve:Kr.resolve,reject:Kr.reject,nthen:bn(o.nthen,s),gthen:bn(o.gthen,s)}:{},t&&pt(s,t),++i.ref,s.finalize=function(){--this.parent.ref||this.parent.finalize()};var u=mn(s,e,r,n);return 0===s.ref&&s.finalize(),u}function cn(){return tn.id||(tn.id=++rn),++tn.awaits,tn.echoes+=100,tn.id}function ln(){return!!tn.awaits&&(0==--tn.awaits&&(tn.id=0),tn.echoes=100*tn.awaits,!0)}function hn(e){return tn.echoes&&e&&e.constructor===qr?(cn(),e.then((e=>(ln(),e)),(e=>(ln(),Tn(e))))):e}function pn(e){++on,tn.echoes&&0!=--tn.echoes||(tn.echoes=tn.id=0),nn.push(Ir),dn(e,!0)}function fn(){var e=nn[nn.length-1];nn.pop(),dn(e,!1)}function dn(e,t){var r=Ir;if((t?!tn.echoes||sn++&&e===Ir:!sn||--sn&&e===Ir)||yn(t?pn.bind(null,e):fn),e!==Ir&&(Ir=e,r===Cr&&(Cr.env=gn()),_r)){var n=Cr.env.Promise,i=e.env;wr.then=i.nthen,n.prototype.then=i.gthen,(r.global||e.global)&&(Object.defineProperty(ct,"Promise",i.PromiseProp),n.all=i.all,n.race=i.race,n.resolve=i.resolve,n.reject=i.reject,i.allSettled&&(n.allSettled=i.allSettled),i.any&&(n.any=i.any))}}function gn(){var e=ct.Promise;return _r?{Promise:e,PromiseProp:Object.getOwnPropertyDescriptor(ct,"Promise"),all:e.all,race:e.race,allSettled:e.allSettled,any:e.any,resolve:e.resolve,reject:e.reject,nthen:wr.then,gthen:e.prototype.then}:{}}function mn(e,t,r,n,i){var s=Ir;try{return dn(e,!0),t(r,n,i)}finally{dn(s,!1)}}function yn(e){Ar.call(br,e)}function vn(e,t,r,n){return"function"!=typeof e?e:function(){var i=Ir;r&&cn(),dn(t,!0);try{return e.apply(this,arguments)}finally{dn(i,!1),n&&yn(ln)}}}function bn(e,t){return function(r,n){return e.call(this,vn(r,t),vn(n,t))}}function wn(e,t){var r;try{r=t.onuncatched(e)}catch(e){}if(!1!==r)try{var n,i={promise:t,reason:e};if(ct.document&&document.createEvent?((n=document.createEvent("Event")).initEvent("unhandledrejection",!0,!0),pt(n,i)):ct.CustomEvent&&pt(n=new CustomEvent("unhandledrejection",{detail:i}),i),n&&ct.dispatchEvent&&(dispatchEvent(n),!ct.PromiseRejectionEvent&&ct.onunhandledrejection))try{ct.onunhandledrejection(n)}catch(e){}Ht&&n&&!n.defaultPrevented&&console.warn(`Unhandled rejection: ${e.stack||e}`)}catch(e){}}-1===(""+Ar).indexOf("[native code]")&&(cn=ln=cr);var Tn=Kr.reject;function An(e,t,r,n){if(e.idbdb&&(e._state.openComplete||Ir.letThrough||e._vip)){var i=e._createTransaction(t,r,e._dbSchema);try{i.create(),e._state.PR1398_maxLoop=3}catch(i){return i.name===ir.InvalidState&&e.isOpen()&&--e._state.PR1398_maxLoop>0?(console.warn("Dexie: Need to reopen db"),e._close(),e.open().then((()=>An(e,t,r,n)))):Tn(i)}return i._promise(t,((e,t)=>an((()=>(Ir.trans=i,n(e,t,i)))))).then((e=>i._completion.then((()=>e))))}if(e._state.openComplete)return Tn(new or.DatabaseClosed(e._state.dbOpenError));if(!e._state.isBeingOpened){if(!e._options.autoOpen)return Tn(new or.DatabaseClosed);e.open().catch(cr)}return e._state.dbReadyPromise.then((()=>An(e,t,r,n)))}const qn=String.fromCharCode(65535),_n="Invalid key provided. Keys must be of type string, number, Date or Array<string | number | Date>.",Un=[],kn="undefined"!=typeof navigator&&/(MSIE|Trident|Edge)/.test(navigator.userAgent),xn=kn,jn=kn,Sn=e=>!/(dexie\.js|dexie\.min\.js)/.test(e);function Pn(e,t){return e?t?function(){return e.apply(this,arguments)&&t.apply(this,arguments)}:e:t}const En={type:3,lower:-1/0,lowerOpen:!1,upper:[[]],upperOpen:!1};function On(e){return"string"!=typeof e||/\./.test(e)?e=>e:t=>(void 0===t[e]&&e in t&&delete(t=Rt(t))[e],t)}class Dn{_trans(e,t,r){const n=this._tx||Ir.trans,i=this.name;function s(e,r,n){if(!n.schema[i])throw new or.NotFound("Table "+i+" not part of transaction");return t(n.idbtrans,n)}const o=Qr();try{return n&&n.db===this.db?n===Ir.trans?n._promise(e,s,r):an((()=>n._promise(e,s,r)),{trans:n,transless:Ir.transless||Ir}):An(this.db,e,[this.name],s)}finally{o&&Xr()}}get(e,t){return e&&e.constructor===Object?this.where(e).first(t):this._trans("readonly",(t=>this.core.get({trans:t,key:e}).then((e=>this.hook.reading.fire(e))))).then(t)}where(e){if("string"==typeof e)return new this.db.WhereClause(this,e);if(ht(e))return new this.db.WhereClause(this,`[${e.join("+")}]`);const t=lt(e);if(1===t.length)return this.where(t[0]).equals(e[t[0]]);const r=this.schema.indexes.concat(this.schema.primKey).filter((e=>e.compound&&t.every((t=>e.keyPath.indexOf(t)>=0))&&e.keyPath.every((e=>t.indexOf(e)>=0))))[0];if(r&&this.db._maxKey!==qn)return this.where(r.name).equals(r.keyPath.map((t=>e[t])));!r&&Ht&&console.warn(`The query ${JSON.stringify(e)} on ${this.name} would benefit of a compound index [${t.join("+")}]`);const{idxByName:n}=this.schema,i=this.db._deps.indexedDB;function s(e,t){try{return 0===i.cmp(e,t)}catch(e){return!1}}const[o,u]=t.reduce((([t,r],i)=>{const o=n[i],u=e[i];return[t||o,t||!o?Pn(r,o&&o.multi?e=>{const t=jt(e,i);return ht(t)&&t.some((e=>s(u,e)))}:e=>s(u,jt(e,i))):r]}),[null,null]);return o?this.where(o.name).equals(e[o.keyPath]).filter(u):r?this.filter(u):this.where(t).equals("")}filter(e){return this.toCollection().and(e)}count(e){return this.toCollection().count(e)}offset(e){return this.toCollection().offset(e)}limit(e){return this.toCollection().limit(e)}each(e){return this.toCollection().each(e)}toArray(e){return this.toCollection().toArray(e)}toCollection(){return new this.db.Collection(new this.db.WhereClause(this))}orderBy(e){return new this.db.Collection(new this.db.WhereClause(this,ht(e)?`[${e.join("+")}]`:e))}reverse(){return this.toCollection().reverse()}mapToClass(e){this.schema.mappedClass=e;const t=t=>{if(!t)return t;const r=Object.create(e.prototype);for(var n in t)if(gt(t,n))try{r[n]=t[n]}catch(e){}return r};return this.schema.readHook&&this.hook.reading.unsubscribe(this.schema.readHook),this.schema.readHook=t,this.hook("reading",t),e}defineClass(){return this.mapToClass((function(e){pt(this,e)}))}add(e,t){const{auto:r,keyPath:n}=this.schema.primKey;let i=e;return n&&r&&(i=On(n)(e)),this._trans("readwrite",(e=>this.core.mutate({trans:e,type:"add",keys:null!=t?[t]:null,values:[i]}))).then((e=>e.numFailures?Kr.reject(e.failures[0]):e.lastResult)).then((t=>{if(n)try{St(e,n,t)}catch(e){}return t}))}update(e,t){if("object"!=typeof e||ht(e))return this.where(":id").equals(e).modify(t);{const r=jt(e,this.schema.primKey.keyPath);if(void 0===r)return Tn(new or.InvalidArgument("Given object does not contain its primary key"));try{"function"!=typeof t?lt(t).forEach((r=>{St(e,r,t[r])})):t(e,{value:e,primKey:r})}catch(e){}return this.where(":id").equals(r).modify(t)}}put(e,t){const{auto:r,keyPath:n}=this.schema.primKey;let i=e;return n&&r&&(i=On(n)(e)),this._trans("readwrite",(e=>this.core.mutate({trans:e,type:"put",values:[i],keys:null!=t?[t]:null}))).then((e=>e.numFailures?Kr.reject(e.failures[0]):e.lastResult)).then((t=>{if(n)try{St(e,n,t)}catch(e){}return t}))}delete(e){return this._trans("readwrite",(t=>this.core.mutate({trans:t,type:"delete",keys:[e]}))).then((e=>e.numFailures?Kr.reject(e.failures[0]):void 0))}clear(){return this._trans("readwrite",(e=>this.core.mutate({trans:e,type:"deleteRange",range:En}))).then((e=>e.numFailures?Kr.reject(e.failures[0]):void 0))}bulkGet(e){return this._trans("readonly",(t=>this.core.getMany({keys:e,trans:t}).then((e=>e.map((e=>this.hook.reading.fire(e)))))))}bulkAdd(e,t,r){const n=Array.isArray(t)?t:void 0,i=(r=r||(n?void 0:t))?r.allKeys:void 0;return this._trans("readwrite",(t=>{const{auto:r,keyPath:s}=this.schema.primKey;if(s&&n)throw new or.InvalidArgument("bulkAdd(): keys argument invalid on tables with inbound keys");if(n&&n.length!==e.length)throw new or.InvalidArgument("Arguments objects and keys must have the same length");const o=e.length;let u=s&&r?e.map(On(s)):e;return this.core.mutate({trans:t,type:"add",keys:n,values:u,wantResults:i}).then((({numFailures:e,results:t,lastResult:r,failures:n})=>{if(0===e)return i?t:r;throw new nr(`${this.name}.bulkAdd(): ${e} of ${o} operations failed`,n)}))}))}bulkPut(e,t,r){const n=Array.isArray(t)?t:void 0,i=(r=r||(n?void 0:t))?r.allKeys:void 0;return this._trans("readwrite",(t=>{const{auto:r,keyPath:s}=this.schema.primKey;if(s&&n)throw new or.InvalidArgument("bulkPut(): keys argument invalid on tables with inbound keys");if(n&&n.length!==e.length)throw new or.InvalidArgument("Arguments objects and keys must have the same length");const o=e.length;let u=s&&r?e.map(On(s)):e;return this.core.mutate({trans:t,type:"put",keys:n,values:u,wantResults:i}).then((({numFailures:e,results:t,lastResult:r,failures:n})=>{if(0===e)return i?t:r;throw new nr(`${this.name}.bulkPut(): ${e} of ${o} operations failed`,n)}))}))}bulkDelete(e){const t=e.length;return this._trans("readwrite",(t=>this.core.mutate({trans:t,type:"delete",keys:e}))).then((({numFailures:e,lastResult:r,failures:n})=>{if(0===e)return r;throw new nr(`${this.name}.bulkDelete(): ${e} of ${t} operations failed`,n)}))}}function Cn(e){var t={},r=function(r,n){if(n){for(var i=arguments.length,s=new Array(i-1);--i;)s[i-1]=arguments[i];return t[r].subscribe.apply(null,s),e}if("string"==typeof r)return t[r]};r.addEventType=s;for(var n=1,i=arguments.length;n<i;++n)s(arguments[n]);return r;function s(e,n,i){if("object"==typeof e)return o(e);n||(n=mr),i||(i=cr);var s={subscribers:[],fire:i,subscribe:function(e){-1===s.subscribers.indexOf(e)&&(s.subscribers.push(e),s.fire=n(s.fire,e))},unsubscribe:function(e){s.subscribers=s.subscribers.filter((function(t){return t!==e})),s.fire=s.subscribers.reduce(n,i)}};return t[e]=r[e]=s,s}function o(e){lt(e).forEach((function(t){var r=e[t];if(ht(r))s(t,e[t][0],e[t][1]);else{if("asap"!==r)throw new or.InvalidArgument("Invalid event config");var n=s(t,lr,(function(){for(var e=arguments.length,t=new Array(e);e--;)t[e]=arguments[e];n.subscribers.forEach((function(e){kt((function(){e.apply(null,t)}))}))}))}}))}}function In(e,t){return bt(t).from({prototype:e}),t}function Rn(e,t){return!(e.filter||e.algorithm||e.or)&&(t?e.justLimit:!e.replayFilter)}function Bn(e,t){e.filter=Pn(e.filter,t)}function Ln(e,t,r){var n=e.replayFilter;e.replayFilter=n?()=>Pn(n(),t()):t,e.justLimit=r&&!n}function Kn(e,t){if(e.isPrimKey)return t.primaryKey;const r=t.getIndexByKeyPath(e.index);if(!r)throw new or.Schema("KeyPath "+e.index+" on object store "+t.name+" is not indexed");return r}function Nn(e,t,r){const n=Kn(e,t.schema);return t.openCursor({trans:r,values:!e.keysOnly,reverse:"prev"===e.dir,unique:!!e.unique,query:{index:n,range:e.range}})}function Mn(e,t,r,n){const i=e.replayFilter?Pn(e.filter,e.replayFilter()):e.filter;if(e.or){const s={},o=(e,r,n)=>{if(!i||i(r,n,(e=>r.stop(e)),(e=>r.fail(e)))){var o=r.primaryKey,u=""+o;"[object ArrayBuffer]"===u&&(u=""+new Uint8Array(o)),gt(s,u)||(s[u]=!0,t(e,r,n))}};return Promise.all([e.or._iterate(o,r),Fn(Nn(e,n,r),e.algorithm,o,!e.keysOnly&&e.valueMapper)])}return Fn(Nn(e,n,r),Pn(e.algorithm,i),t,!e.keysOnly&&e.valueMapper)}function Fn(e,t,r,n){var i=en(n?(e,t,i)=>r(n(e),t,i):r);return e.then((e=>{if(e)return e.start((()=>{var r=()=>e.continue();t&&!t(e,(e=>r=e),(t=>{e.stop(t),r=cr}),(t=>{e.fail(t),r=cr}))||i(e.value,e,(e=>r=e)),r()}))}))}function Gn(e,t){try{const r=Wn(e),n=Wn(t);if(r!==n)return"Array"===r?1:"Array"===n?-1:"binary"===r?1:"binary"===n?-1:"string"===r?1:"string"===n?-1:"Date"===r?1:"Date"!==n?NaN:-1;switch(r){case"number":case"Date":case"string":return e>t?1:e<t?-1:0;case"binary":return function(e,t){const r=e.length,n=t.length,i=r<n?r:n;for(let r=0;r<i;++r)if(e[r]!==t[r])return e[r]<t[r]?-1:1;return r===n?0:r<n?-1:1}(Hn(e),Hn(t));case"Array":return function(e,t){const r=e.length,n=t.length,i=r<n?r:n;for(let r=0;r<i;++r){const n=Gn(e[r],t[r]);if(0!==n)return n}return r===n?0:r<n?-1:1}(e,t)}}catch(e){}return NaN}function Wn(e){const t=typeof e;if("object"!==t)return t;if(ArrayBuffer.isView(e))return"binary";const r=Kt(e);return"ArrayBuffer"===r?"binary":r}function Hn(e){return e instanceof Uint8Array?e:ArrayBuffer.isView(e)?new Uint8Array(e.buffer,e.byteOffset,e.byteLength):new Uint8Array(e)}class $n{_read(e,t){var r=this._ctx;return r.error?r.table._trans(null,Tn.bind(null,r.error)):r.table._trans("readonly",e).then(t)}_write(e){var t=this._ctx;return t.error?t.table._trans(null,Tn.bind(null,t.error)):t.table._trans("readwrite",e,"locked")}_addAlgorithm(e){var t=this._ctx;t.algorithm=Pn(t.algorithm,e)}_iterate(e,t){return Mn(this._ctx,e,t,this._ctx.table.core)}clone(e){var t=Object.create(this.constructor.prototype),r=Object.create(this._ctx);return e&&pt(r,e),t._ctx=r,t}raw(){return this._ctx.valueMapper=null,this}each(e){var t=this._ctx;return this._read((r=>Mn(t,e,r,t.table.core)))}count(e){return this._read((e=>{const t=this._ctx,r=t.table.core;if(Rn(t,!0))return r.count({trans:e,query:{index:Kn(t,r.schema),range:t.range}}).then((e=>Math.min(e,t.limit)));var n=0;return Mn(t,(()=>(++n,!1)),e,r).then((()=>n))})).then(e)}sortBy(e,t){const r=e.split(".").reverse(),n=r[0],i=r.length-1;function s(e,t){return t?s(e[r[t]],t-1):e[n]}var o="next"===this._ctx.dir?1:-1;function u(e,t){var r=s(e,i),n=s(t,i);return r<n?-o:r>n?o:0}return this.toArray((function(e){return e.sort(u)})).then(t)}toArray(e){return this._read((e=>{var t=this._ctx;if("next"===t.dir&&Rn(t,!0)&&t.limit>0){const{valueMapper:r}=t,n=Kn(t,t.table.core.schema);return t.table.core.query({trans:e,limit:t.limit,values:!0,query:{index:n,range:t.range}}).then((({result:e})=>r?e.map(r):e))}{const r=[];return Mn(t,(e=>r.push(e)),e,t.table.core).then((()=>r))}}),e)}offset(e){var t=this._ctx;return e<=0||(t.offset+=e,Rn(t)?Ln(t,(()=>{var t=e;return(e,r)=>0===t||(1===t?(--t,!1):(r((()=>{e.advance(t),t=0})),!1))})):Ln(t,(()=>{var t=e;return()=>--t<0}))),this}limit(e){return this._ctx.limit=Math.min(this._ctx.limit,e),Ln(this._ctx,(()=>{var t=e;return function(e,r,n){return--t<=0&&r(n),t>=0}}),!0),this}until(e,t){return Bn(this._ctx,(function(r,n,i){return!e(r.value)||(n(i),t)})),this}first(e){return this.limit(1).toArray((function(e){return e[0]})).then(e)}last(e){return this.reverse().first(e)}filter(e){var t,r;return Bn(this._ctx,(function(t){return e(t.value)})),t=this._ctx,r=e,t.isMatch=Pn(t.isMatch,r),this}and(e){return this.filter(e)}or(e){return new this.db.WhereClause(this._ctx.table,e,this)}reverse(){return this._ctx.dir="prev"===this._ctx.dir?"next":"prev",this._ondirectionchange&&this._ondirectionchange(this._ctx.dir),this}desc(){return this.reverse()}eachKey(e){var t=this._ctx;return t.keysOnly=!t.isMatch,this.each((function(t,r){e(r.key,r)}))}eachUniqueKey(e){return this._ctx.unique="unique",this.eachKey(e)}eachPrimaryKey(e){var t=this._ctx;return t.keysOnly=!t.isMatch,this.each((function(t,r){e(r.primaryKey,r)}))}keys(e){var t=this._ctx;t.keysOnly=!t.isMatch;var r=[];return this.each((function(e,t){r.push(t.key)})).then((function(){return r})).then(e)}primaryKeys(e){var t=this._ctx;if("next"===t.dir&&Rn(t,!0)&&t.limit>0)return this._read((e=>{var r=Kn(t,t.table.core.schema);return t.table.core.query({trans:e,values:!1,limit:t.limit,query:{index:r,range:t.range}})})).then((({result:e})=>e)).then(e);t.keysOnly=!t.isMatch;var r=[];return this.each((function(e,t){r.push(t.primaryKey)})).then((function(){return r})).then(e)}uniqueKeys(e){return this._ctx.unique="unique",this.keys(e)}firstKey(e){return this.limit(1).keys((function(e){return e[0]})).then(e)}lastKey(e){return this.reverse().firstKey(e)}distinct(){var e=this._ctx,t=e.index&&e.table.schema.idxByName[e.index];if(!t||!t.multi)return this;var r={};return Bn(this._ctx,(function(e){var t=e.primaryKey.toString(),n=gt(r,t);return r[t]=!0,!n})),this}modify(e){var t=this._ctx;return this._write((r=>{var n;if("function"==typeof e)n=e;else{var i=lt(e),s=i.length;n=function(t){for(var r=!1,n=0;n<s;++n){var o=i[n],u=e[o];jt(t,o)!==u&&(St(t,o,u),r=!0)}return r}}const o=t.table.core,{outbound:u,extractKey:a}=o.schema.primaryKey,c=this.db._options.modifyChunkSize||200,l=[];let h=0;const p=[],f=(e,t)=>{const{failures:r,numFailures:n}=t;h+=e-n;for(let e of lt(r))l.push(r[e])};return this.clone().primaryKeys().then((i=>{const s=l=>{const h=Math.min(c,i.length-l);return o.getMany({trans:r,keys:i.slice(l,l+h),cache:"immutable"}).then((p=>{const d=[],g=[],m=u?[]:null,y=[];for(let e=0;e<h;++e){const t=p[e],r={value:Rt(t),primKey:i[l+e]};!1!==n.call(r,r.value,r)&&(null==r.value?y.push(i[l+e]):u||0===Gn(a(t),a(r.value))?(g.push(r.value),u&&m.push(i[l+e])):(y.push(i[l+e]),d.push(r.value)))}const v=Rn(t)&&t.limit===1/0&&("function"!=typeof e||e===Vn)&&{index:t.index,range:t.range};return Promise.resolve(d.length>0&&o.mutate({trans:r,type:"add",values:d}).then((e=>{for(let t in e.failures)y.splice(parseInt(t),1);f(d.length,e)}))).then((()=>(g.length>0||v&&"object"==typeof e)&&o.mutate({trans:r,type:"put",keys:m,values:g,criteria:v,changeSpec:"function"!=typeof e&&e}).then((e=>f(g.length,e))))).then((()=>(y.length>0||v&&e===Vn)&&o.mutate({trans:r,type:"delete",keys:y,criteria:v}).then((e=>f(y.length,e))))).then((()=>i.length>l+h&&s(l+c)))}))};return s(0).then((()=>{if(l.length>0)throw new rr("Error modifying one or more objects",l,h,p);return i.length}))}))}))}delete(){var e=this._ctx,t=e.range;return Rn(e)&&(e.isPrimKey&&!jn||3===t.type)?this._write((r=>{const{primaryKey:n}=e.table.core.schema,i=t;return e.table.core.count({trans:r,query:{index:n,range:i}}).then((t=>e.table.core.mutate({trans:r,type:"deleteRange",range:i}).then((({failures:e,lastResult:r,results:n,numFailures:i})=>{if(i)throw new rr("Could not delete some values",Object.keys(e).map((t=>e[t])),t-i);return t-i}))))})):this.modify(Vn)}}const Vn=(e,t)=>t.value=null;function zn(e,t){return e<t?-1:e===t?0:1}function Jn(e,t){return e>t?-1:e===t?0:1}function Qn(e,t,r){var n=e instanceof ri?new e.Collection(e):e;return n._ctx.error=r?new r(t):new TypeError(t),n}function Xn(e){return new e.Collection(e,(()=>ti(""))).limit(0)}function Yn(e,t,r,n,i,s){for(var o=Math.min(e.length,n.length),u=-1,a=0;a<o;++a){var c=t[a];if(c!==n[a])return i(e[a],r[a])<0?e.substr(0,a)+r[a]+r.substr(a+1):i(e[a],n[a])<0?e.substr(0,a)+n[a]+r.substr(a+1):u>=0?e.substr(0,u)+t[u]+r.substr(u+1):null;i(e[a],c)<0&&(u=a)}return o<n.length&&"next"===s?e+r.substr(e.length):o<e.length&&"prev"===s?e.substr(0,r.length):u<0?null:e.substr(0,u)+n[u]+r.substr(u+1)}function Zn(e,t,r,n){var i,s,o,u,a,c,l,h=r.length;if(!r.every((e=>"string"==typeof e)))return Qn(e,"String expected.");function p(e){i=function(e){return"next"===e?e=>e.toUpperCase():e=>e.toLowerCase()}(e),s=function(e){return"next"===e?e=>e.toLowerCase():e=>e.toUpperCase()}(e),o="next"===e?zn:Jn;var t=r.map((function(e){return{lower:s(e),upper:i(e)}})).sort((function(e,t){return o(e.lower,t.lower)}));u=t.map((function(e){return e.upper})),a=t.map((function(e){return e.lower})),c=e,l="next"===e?"":n}p("next");var f=new e.Collection(e,(()=>ei(u[0],a[h-1]+n)));f._ondirectionchange=function(e){p(e)};var d=0;return f._addAlgorithm((function(e,r,n){var i=e.key;if("string"!=typeof i)return!1;var p=s(i);if(t(p,a,d))return!0;for(var f=null,g=d;g<h;++g){var m=Yn(i,p,u[g],a[g],o,c);null===m&&null===f?d=g+1:(null===f||o(f,m)>0)&&(f=m)}return r(null!==f?function(){e.continue(f+l)}:n),!1})),f}function ei(e,t,r,n){return{type:2,lower:e,upper:t,lowerOpen:r,upperOpen:n}}function ti(e){return{type:1,lower:e,upper:e}}class ri{get Collection(){return this._ctx.table.db.Collection}between(e,t,r,n){r=!1!==r,n=!0===n;try{return this._cmp(e,t)>0||0===this._cmp(e,t)&&(r||n)&&(!r||!n)?Xn(this):new this.Collection(this,(()=>ei(e,t,!r,!n)))}catch(e){return Qn(this,_n)}}equals(e){return null==e?Qn(this,_n):new this.Collection(this,(()=>ti(e)))}above(e){return null==e?Qn(this,_n):new this.Collection(this,(()=>ei(e,void 0,!0)))}aboveOrEqual(e){return null==e?Qn(this,_n):new this.Collection(this,(()=>ei(e,void 0,!1)))}below(e){return null==e?Qn(this,_n):new this.Collection(this,(()=>ei(void 0,e,!1,!0)))}belowOrEqual(e){return null==e?Qn(this,_n):new this.Collection(this,(()=>ei(void 0,e)))}startsWith(e){return"string"!=typeof e?Qn(this,"String expected."):this.between(e,e+qn,!0,!0)}startsWithIgnoreCase(e){return""===e?this.startsWith(e):Zn(this,((e,t)=>0===e.indexOf(t[0])),[e],qn)}equalsIgnoreCase(e){return Zn(this,((e,t)=>e===t[0]),[e],"")}anyOfIgnoreCase(){var e=Gt.apply(Ft,arguments);return 0===e.length?Xn(this):Zn(this,((e,t)=>-1!==t.indexOf(e)),e,"")}startsWithAnyOfIgnoreCase(){var e=Gt.apply(Ft,arguments);return 0===e.length?Xn(this):Zn(this,((e,t)=>t.some((t=>0===e.indexOf(t)))),e,qn)}anyOf(){const e=Gt.apply(Ft,arguments);let t=this._cmp;try{e.sort(t)}catch(e){return Qn(this,_n)}if(0===e.length)return Xn(this);const r=new this.Collection(this,(()=>ei(e[0],e[e.length-1])));r._ondirectionchange=r=>{t="next"===r?this._ascending:this._descending,e.sort(t)};let n=0;return r._addAlgorithm(((r,i,s)=>{const o=r.key;for(;t(o,e[n])>0;)if(++n,n===e.length)return i(s),!1;return 0===t(o,e[n])||(i((()=>{r.continue(e[n])})),!1)})),r}notEqual(e){return this.inAnyRange([[-1/0,e],[e,this.db._maxKey]],{includeLowers:!1,includeUppers:!1})}noneOf(){const e=Gt.apply(Ft,arguments);if(0===e.length)return new this.Collection(this);try{e.sort(this._ascending)}catch(e){return Qn(this,_n)}const t=e.reduce(((e,t)=>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})}inAnyRange(e,t){const r=this._cmp,n=this._ascending,i=this._descending,s=this._min,o=this._max;if(0===e.length)return Xn(this);if(!e.every((e=>void 0!==e[0]&&void 0!==e[1]&&n(e[0],e[1])<=0)))return Qn(this,"First argument to inAnyRange() must be an Array of two-value Arrays [lower,upper] where upper must not be lower than lower",or.InvalidArgument);const u=!t||!1!==t.includeLowers,a=t&&!0===t.includeUppers;let c,l=n;function h(e,t){return l(e[0],t[0])}try{c=e.reduce((function(e,t){let n=0,i=e.length;for(;n<i;++n){const i=e[n];if(r(t[0],i[1])<0&&r(t[1],i[0])>0){i[0]=s(i[0],t[0]),i[1]=o(i[1],t[1]);break}}return n===i&&e.push(t),e}),[]),c.sort(h)}catch(e){return Qn(this,_n)}let p=0;const f=a?e=>n(e,c[p][1])>0:e=>n(e,c[p][1])>=0,d=u?e=>i(e,c[p][0])>0:e=>i(e,c[p][0])>=0;let g=f;const m=new this.Collection(this,(()=>ei(c[0][0],c[c.length-1][1],!u,!a)));return m._ondirectionchange=e=>{"next"===e?(g=f,l=n):(g=d,l=i),c.sort(h)},m._addAlgorithm(((e,t,r)=>{for(var i=e.key;g(i);)if(++p,p===c.length)return t(r),!1;return!!function(e){return!f(e)&&!d(e)}(i)||(0===this._cmp(i,c[p][1])||0===this._cmp(i,c[p][0])||t((()=>{l===n?e.continue(c[p][0]):e.continue(c[p][1])})),!1)})),m}startsWithAnyOf(){const e=Gt.apply(Ft,arguments);return e.every((e=>"string"==typeof e))?0===e.length?Xn(this):this.inAnyRange(e.map((e=>[e,e+qn]))):Qn(this,"startsWithAnyOf() only works with strings")}}function ni(e){return en((function(t){return ii(t),e(t.target.error),!1}))}function ii(e){e.stopPropagation&&e.stopPropagation(),e.preventDefault&&e.preventDefault()}const si=Cn(null,"storagemutated");class oi{_lock(){return Ut(!Ir.global),++this._reculock,1!==this._reculock||Ir.global||(Ir.lockOwnerFor=this),this}_unlock(){if(Ut(!Ir.global),0==--this._reculock)for(Ir.global||(Ir.lockOwnerFor=null);this._blockedFuncs.length>0&&!this._locked();){var e=this._blockedFuncs.shift();try{mn(e[1],e[0])}catch(e){}}return this}_locked(){return this._reculock&&Ir.lockOwnerFor!==this}create(e){if(!this.mode)return this;const t=this.db.idbdb,r=this.db._state.dbOpenError;if(Ut(!this.idbtrans),!e&&!t)switch(r&&r.name){case"DatabaseClosedError":throw new or.DatabaseClosed(r);case"MissingAPIError":throw new or.MissingAPI(r.message,r);default:throw new or.OpenFailed(r)}if(!this.active)throw new or.TransactionInactive;return Ut(null===this._completion._state),(e=this.idbtrans=e||(this.db.core?this.db.core.transaction(this.storeNames,this.mode,{durability:this.chromeTransactionDurability}):t.transaction(this.storeNames,this.mode,{durability:this.chromeTransactionDurability}))).onerror=en((t=>{ii(t),this._reject(e.error)})),e.onabort=en((t=>{ii(t),this.active&&this._reject(new or.Abort(e.error)),this.active=!1,this.on("abort").fire(t)})),e.oncomplete=en((()=>{this.active=!1,this._resolve(),"mutatedParts"in e&&si.storagemutated.fire(e.mutatedParts)})),this}_promise(e,t,r){if("readwrite"===e&&"readwrite"!==this.mode)return Tn(new or.ReadOnly("Transaction is readonly"));if(!this.active)return Tn(new or.TransactionInactive);if(this._locked())return new Kr(((n,i)=>{this._blockedFuncs.push([()=>{this._promise(e,t,r).then(n,i)},Ir])}));if(r)return an((()=>{var e=new Kr(((e,r)=>{this._lock();const n=t(e,r,this);n&&n.then&&n.then(e,r)}));return e.finally((()=>this._unlock())),e._lib=!0,e}));var n=new Kr(((e,r)=>{var n=t(e,r,this);n&&n.then&&n.then(e,r)}));return n._lib=!0,n}_root(){return this.parent?this.parent._root():this}waitFor(e){var t=this._root();const r=Kr.resolve(e);if(t._waitingFor)t._waitingFor=t._waitingFor.then((()=>r));else{t._waitingFor=r,t._waitingQueue=[];var n=t.idbtrans.objectStore(t.storeNames[0]);!function e(){for(++t._spinCount;t._waitingQueue.length;)t._waitingQueue.shift()();t._waitingFor&&(n.get(-1/0).onsuccess=e)}()}var i=t._waitingFor;return new Kr(((e,n)=>{r.then((r=>t._waitingQueue.push(en(e.bind(null,r)))),(e=>t._waitingQueue.push(en(n.bind(null,e))))).finally((()=>{t._waitingFor===i&&(t._waitingFor=null)}))}))}abort(){this.active&&(this.active=!1,this.idbtrans&&this.idbtrans.abort(),this._reject(new or.Abort))}table(e){const t=this._memoizedTables||(this._memoizedTables={});if(gt(t,e))return t[e];const r=this.schema[e];if(!r)throw new or.NotFound("Table "+e+" not part of transaction");const n=new this.db.Table(e,r,this);return n.core=this.db.core.table(e),t[e]=n,n}}function ui(e,t,r,n,i,s,o){return{name:e,keyPath:t,unique:r,multi:n,auto:i,compound:s,src:(r&&!o?"&":"")+(n?"*":"")+(i?"++":"")+ai(t)}}function ai(e){return"string"==typeof e?e:e?"["+[].join.call(e,"+")+"]":""}function ci(e,t,r){return{name:e,primKey:t,indexes:r,mappedClass:null,idxByName:xt(r,(e=>[e.name,e]))}}let li=e=>{try{return e.only([[]]),li=()=>[[]],[[]]}catch(e){return li=()=>qn,qn}};function hi(e){return null==e?()=>{}:"string"==typeof e?function(e){return 1===e.split(".").length?t=>t[e]:t=>jt(t,e)}(e):t=>jt(t,e)}function pi(e){return[].slice.call(e)}let fi=0;function di(e){return null==e?":id":"string"==typeof e?e:`[${e.join("+")}]`}function gi(e,t,r){function n(e){if(3===e.type)return null;if(4===e.type)throw new Error("Cannot convert never type to IDBKeyRange");const{lower:r,upper:n,lowerOpen:i,upperOpen:s}=e;return void 0===r?void 0===n?null:t.upperBound(n,!!s):void 0===n?t.lowerBound(r,!!i):t.bound(r,n,!!i,!!s)}const{schema:i,hasGetAll:s}=function(e,t){const r=pi(e.objectStoreNames);return{schema:{name:e.name,tables:r.map((e=>t.objectStore(e))).map((e=>{const{keyPath:t,autoIncrement:r}=e,n=ht(t),i=null==t,s={},o={name:e.name,primaryKey:{name:null,isPrimaryKey:!0,outbound:i,compound:n,keyPath:t,autoIncrement:r,unique:!0,extractKey:hi(t)},indexes:pi(e.indexNames).map((t=>e.index(t))).map((e=>{const{name:t,unique:r,multiEntry:n,keyPath:i}=e,o={name:t,compound:ht(i),keyPath:i,unique:r,multiEntry:n,extractKey:hi(i)};return s[di(i)]=o,o})),getIndexByKeyPath:e=>s[di(e)]};return s[":id"]=o.primaryKey,null!=t&&(s[di(t)]=o.primaryKey),o}))},hasGetAll:r.length>0&&"getAll"in t.objectStore(r[0])&&!("undefined"!=typeof navigator&&/Safari/.test(navigator.userAgent)&&!/(Chrome\/|Edge\/)/.test(navigator.userAgent)&&[].concat(navigator.userAgent.match(/Safari\/(\d*)/))[1]<604)}}(e,r),o=i.tables.map((e=>function(e){const t=e.name;return{name:t,schema:e,mutate:function({trans:e,type:r,keys:i,values:s,range:o}){return new Promise(((u,a)=>{u=en(u);const c=e.objectStore(t),l=null==c.keyPath,h="put"===r||"add"===r;if(!h&&"delete"!==r&&"deleteRange"!==r)throw new Error("Invalid operation type: "+r);const{length:p}=i||s||{length:1};if(i&&s&&i.length!==s.length)throw new Error("Given keys array must have same length as given values array.");if(0===p)return u({numFailures:0,failures:{},results:[],lastResult:void 0});let f;const d=[],g=[];let m=0;const y=e=>{++m,ii(e)};if("deleteRange"===r){if(4===o.type)return u({numFailures:m,failures:g,results:[],lastResult:void 0});3===o.type?d.push(f=c.clear()):d.push(f=c.delete(n(o)))}else{const[e,t]=h?l?[s,i]:[s,null]:[i,null];if(h)for(let n=0;n<p;++n)d.push(f=t&&void 0!==t[n]?c[r](e[n],t[n]):c[r](e[n])),f.onerror=y;else for(let t=0;t<p;++t)d.push(f=c[r](e[t])),f.onerror=y}const v=e=>{const t=e.target.result;d.forEach(((e,t)=>null!=e.error&&(g[t]=e.error))),u({numFailures:m,failures:g,results:"delete"===r?i:d.map((e=>e.result)),lastResult:t})};f.onerror=e=>{y(e),v(e)},f.onsuccess=v}))},getMany:({trans:e,keys:r})=>new Promise(((n,i)=>{n=en(n);const s=e.objectStore(t),o=r.length,u=new Array(o);let a,c=0,l=0;const h=e=>{const t=e.target;u[t._pos]=t.result,++l===c&&n(u)},p=ni(i);for(let e=0;e<o;++e)null!=r[e]&&(a=s.get(r[e]),a._pos=e,a.onsuccess=h,a.onerror=p,++c);0===c&&n(u)})),get:({trans:e,key:r})=>new Promise(((n,i)=>{n=en(n);const s=e.objectStore(t).get(r);s.onsuccess=e=>n(e.target.result),s.onerror=ni(i)})),query:function(e){return r=>new Promise(((i,s)=>{i=en(i);const{trans:o,values:u,limit:a,query:c}=r,l=a===1/0?void 0:a,{index:h,range:p}=c,f=o.objectStore(t),d=h.isPrimaryKey?f:f.index(h.name),g=n(p);if(0===a)return i({result:[]});if(e){const e=u?d.getAll(g,l):d.getAllKeys(g,l);e.onsuccess=e=>i({result:e.target.result}),e.onerror=ni(s)}else{let e=0;const t=u||!("openKeyCursor"in d)?d.openCursor(g):d.openKeyCursor(g),r=[];t.onsuccess=n=>{const s=t.result;return s?(r.push(u?s.value:s.primaryKey),++e===a?i({result:r}):void s.continue()):i({result:r})},t.onerror=ni(s)}}))}(s),openCursor:function({trans:e,values:r,query:i,reverse:s,unique:o}){return new Promise(((u,a)=>{u=en(u);const{index:c,range:l}=i,h=e.objectStore(t),p=c.isPrimaryKey?h:h.index(c.name),f=s?o?"prevunique":"prev":o?"nextunique":"next",d=r||!("openKeyCursor"in p)?p.openCursor(n(l),f):p.openKeyCursor(n(l),f);d.onerror=ni(a),d.onsuccess=en((t=>{const r=d.result;if(!r)return void u(null);r.___id=++fi,r.done=!1;const n=r.continue.bind(r);let i=r.continuePrimaryKey;i&&(i=i.bind(r));const s=r.advance.bind(r),o=()=>{throw new Error("Cursor not stopped")};r.trans=e,r.stop=r.continue=r.continuePrimaryKey=r.advance=()=>{throw new Error("Cursor not started")},r.fail=en(a),r.next=function(){let e=1;return this.start((()=>e--?this.continue():this.stop())).then((()=>this))},r.start=e=>{const t=new Promise(((e,t)=>{e=en(e),d.onerror=ni(t),r.fail=t,r.stop=t=>{r.stop=r.continue=r.continuePrimaryKey=r.advance=o,e(t)}})),u=()=>{if(d.result)try{e()}catch(e){r.fail(e)}else r.done=!0,r.start=()=>{throw new Error("Cursor behind last entry")},r.stop()};return d.onsuccess=en((e=>{d.onsuccess=u,u()})),r.continue=n,r.continuePrimaryKey=i,r.advance=s,u(),t},u(r)}),a)}))},count({query:e,trans:r}){const{index:i,range:s}=e;return new Promise(((e,o)=>{const u=r.objectStore(t),a=i.isPrimaryKey?u:u.index(i.name),c=n(s),l=c?a.count(c):a.count();l.onsuccess=en((t=>e(t.target.result))),l.onerror=ni(o)}))}}}(e))),u={};return o.forEach((e=>u[e.name]=e)),{stack:"dbcore",transaction:e.transaction.bind(e),table(e){if(!u[e])throw new Error(`Table '${e}' not found`);return u[e]},MIN_KEY:-1/0,MAX_KEY:li(t),schema:i}}function mi({_novip:e},t){const r=t.db,n=function(e,t,{IDBKeyRange:r,indexedDB:n},i){const s=function(e,t){return t.reduce(((e,{create:t})=>({...e,...t(e)})),e)}(gi(t,r,i),e.dbcore);return{dbcore:s}}(e._middlewares,r,e._deps,t);e.core=n.dbcore,e.tables.forEach((t=>{const r=t.name;e.core.schema.tables.some((e=>e.name===r))&&(t.core=e.core.table(r),e[r]instanceof e.Table&&(e[r].core=t.core))}))}function yi({_novip:e},t,r,n){r.forEach((r=>{const i=n[r];t.forEach((t=>{const n=Tt(t,r);(!n||"value"in n&&void 0===n.value)&&(t===e.Transaction.prototype||t instanceof e.Transaction?vt(t,r,{get(){return this.table(r)},set(e){yt(this,r,{value:e,writable:!0,configurable:!0,enumerable:!0})}}):t[r]=new e.Table(r,i))}))}))}function vi({_novip:e},t){t.forEach((t=>{for(let r in t)t[r]instanceof e.Table&&delete t[r]}))}function bi(e,t){return e._cfg.version-t._cfg.version}function wi(e,t,r,n){const i=e._dbSchema,s=e._createTransaction("readwrite",e._storeNames,i);s.create(r),s._completion.catch(n);const o=s._reject.bind(s),u=Ir.transless||Ir;an((()=>{Ir.trans=s,Ir.transless=u,0===t?(lt(i).forEach((e=>{Ai(r,e,i[e].primKey,i[e].indexes)})),mi(e,r),Kr.follow((()=>e.on.populate.fire(s))).catch(o)):function({_novip:e},t,r,n){const i=[],s=e._versions;let o=e._dbSchema=_i(e,e.idbdb,n),u=!1;return s.filter((e=>e._cfg.version>=t)).forEach((s=>{i.push((()=>{const i=o,a=s._cfg.dbschema;Ui(e,i,n),Ui(e,a,n),o=e._dbSchema=a;const c=Ti(i,a);c.add.forEach((e=>{Ai(n,e[0],e[1].primKey,e[1].indexes)})),c.change.forEach((e=>{if(e.recreate)throw new or.Upgrade("Not yet support for changing primary key");{const t=n.objectStore(e.name);e.add.forEach((e=>qi(t,e))),e.change.forEach((e=>{t.deleteIndex(e.name),qi(t,e)})),e.del.forEach((e=>t.deleteIndex(e)))}}));const l=s._cfg.contentUpgrade;if(l&&s._cfg.version>t){mi(e,n),r._memoizedTables={},u=!0;let t=Pt(a);c.del.forEach((e=>{t[e]=i[e]})),vi(e,[e.Transaction.prototype]),yi(e,[e.Transaction.prototype],lt(t),t),r.schema=t;const s=Wt(l);let o;s&&cn();const h=Kr.follow((()=>{if(o=l(r),o&&s){var e=ln.bind(null,null);o.then(e,e)}}));return o&&"function"==typeof o.then?Kr.resolve(o):h.then((()=>o))}})),i.push((t=>{u&&xn||function(e,t){[].slice.call(t.db.objectStoreNames).forEach((r=>null==e[r]&&t.db.deleteObjectStore(r)))}(s._cfg.dbschema,t),vi(e,[e.Transaction.prototype]),yi(e,[e.Transaction.prototype],e._storeNames,e._dbSchema),r.schema=e._dbSchema}))})),function e(){return i.length?Kr.resolve(i.shift()(r.idbtrans)).then(e):Kr.resolve()}().then((()=>{var e,t;t=n,lt(e=o).forEach((r=>{t.db.objectStoreNames.contains(r)||Ai(t,r,e[r].primKey,e[r].indexes)}))}))}(e,t,s,r).catch(o)}))}function Ti(e,t){const r={del:[],add:[],change:[]};let n;for(n in e)t[n]||r.del.push(n);for(n in t){const i=e[n],s=t[n];if(i){const e={name:n,def:s,recreate:!1,del:[],add:[],change:[]};if(""+(i.primKey.keyPath||"")!=""+(s.primKey.keyPath||"")||i.primKey.auto!==s.primKey.auto&&!kn)e.recreate=!0,r.change.push(e);else{const t=i.idxByName,n=s.idxByName;let o;for(o in t)n[o]||e.del.push(o);for(o in n){const r=t[o],i=n[o];r?r.src!==i.src&&e.change.push(i):e.add.push(i)}(e.del.length>0||e.add.length>0||e.change.length>0)&&r.change.push(e)}}else r.add.push([n,s])}return r}function Ai(e,t,r,n){const i=e.db.createObjectStore(t,r.keyPath?{keyPath:r.keyPath,autoIncrement:r.auto}:{autoIncrement:r.auto});return n.forEach((e=>qi(i,e))),i}function qi(e,t){e.createIndex(t.name,t.keyPath,{unique:t.unique,multiEntry:t.multi})}function _i(e,t,r){const n={};return qt(t.objectStoreNames,0).forEach((e=>{const t=r.objectStore(e);let i=t.keyPath;const s=ui(ai(i),i||"",!1,!1,!!t.autoIncrement,i&&"string"!=typeof i,!0),o=[];for(let e=0;e<t.indexNames.length;++e){const r=t.index(t.indexNames[e]);i=r.keyPath;var u=ui(r.name,i,!!r.unique,!!r.multiEntry,!1,i&&"string"!=typeof i,!1);o.push(u)}n[e]=ci(e,s,o)})),n}function Ui({_novip:e},t,r){const n=r.db.objectStoreNames;for(let i=0;i<n.length;++i){const s=n[i],o=r.objectStore(s);e._hasGetAll="getAll"in o;for(let e=0;e<o.indexNames.length;++e){const r=o.indexNames[e],n=o.index(r).keyPath,i="string"==typeof n?n:"["+qt(n).join("+")+"]";if(t[s]){const e=t[s].idxByName[i];e&&(e.name=r,delete t[s].idxByName[i],t[s].idxByName[r]=e)}}}"undefined"!=typeof navigator&&/Safari/.test(navigator.userAgent)&&!/(Chrome\/|Edge\/)/.test(navigator.userAgent)&&ct.WorkerGlobalScope&&ct instanceof ct.WorkerGlobalScope&&[].concat(navigator.userAgent.match(/Safari\/(\d*)/))[1]<604&&(e._hasGetAll=!1)}class ki{_parseStoresSpec(e,t){lt(e).forEach((r=>{if(null!==e[r]){var n=e[r].split(",").map(((e,t)=>{const r=(e=e.trim()).replace(/([&*]|\+\+)/g,""),n=/^\[/.test(r)?r.match(/^\[(.*)\]$/)[1].split("+"):r;return ui(r,n||null,/\&/.test(e),/\*/.test(e),/\+\+/.test(e),ht(n),0===t)})),i=n.shift();if(i.multi)throw new or.Schema("Primary key cannot be multi-valued");n.forEach((e=>{if(e.auto)throw new or.Schema("Only primary key can be marked as autoIncrement (++)");if(!e.keyPath)throw new or.Schema("Index must have a name and cannot be an empty string")})),t[r]=ci(r,i,n)}}))}stores(e){const t=this.db;this._cfg.storesSource=this._cfg.storesSource?pt(this._cfg.storesSource,e):e;const r=t._versions,n={};let i={};return r.forEach((e=>{pt(n,e._cfg.storesSource),i=e._cfg.dbschema={},e._parseStoresSpec(n,i)})),t._dbSchema=i,vi(t,[t._allTables,t,t.Transaction.prototype]),yi(t,[t._allTables,t,t.Transaction.prototype,this._cfg.tables],lt(i),i),t._storeNames=lt(i),this}upgrade(e){return this._cfg.contentUpgrade=yr(this._cfg.contentUpgrade||cr,e),this}}function xi(e,t){let r=e._dbNamesDB;return r||(r=e._dbNamesDB=new zi("__dbnames",{addons:[],indexedDB:e,IDBKeyRange:t}),r.version(1).stores({dbnames:"name"})),r.table("dbnames")}function ji(e){return e&&"function"==typeof e.databases}function Si(e){return an((function(){return Ir.letThrough=!0,e()}))}function Pi(){var e;return!navigator.userAgentData&&/Safari\//.test(navigator.userAgent)&&!/Chrom(e|ium)\//.test(navigator.userAgent)&&indexedDB.databases?new Promise((function(t){var r=function(){return indexedDB.databases().finally(t)};e=setInterval(r,100),r()})).finally((function(){return clearInterval(e)})):Promise.resolve()}function Ei(e){var t=t=>e.next(t),r=i(t),n=i((t=>e.throw(t)));function i(e){return t=>{var i=e(t),s=i.value;return i.done?s:s&&"function"==typeof s.then?s.then(r,n):ht(s)?Promise.all(s).then(r,n):r(s)}}return i(t)()}function Oi(e,t,r){var n=arguments.length;if(n<2)throw new or.InvalidArgument("Too few arguments");for(var i=new Array(n-1);--n;)i[n-1]=arguments[n];return r=i.pop(),[e,Ot(i),r]}function Di(e,t,r,n,i){return Kr.resolve().then((()=>{const s=Ir.transless||Ir,o=e._createTransaction(t,r,e._dbSchema,n),u={trans:o,transless:s};if(n)o.idbtrans=n.idbtrans;else try{o.create(),e._state.PR1398_maxLoop=3}catch(n){return n.name===ir.InvalidState&&e.isOpen()&&--e._state.PR1398_maxLoop>0?(console.warn("Dexie: Need to reopen db"),e._close(),e.open().then((()=>Di(e,t,r,null,i)))):Tn(n)}const a=Wt(i);let c;a&&cn();const l=Kr.follow((()=>{if(c=i.call(o,o),c)if(a){var e=ln.bind(null,null);c.then(e,e)}else"function"==typeof c.next&&"function"==typeof c.throw&&(c=Ei(c))}),u);return(c&&"function"==typeof c.then?Kr.resolve(c).then((e=>o.active?e:Tn(new or.PrematureCommit("Transaction committed too early. See http://bit.ly/2kdckMn")))):l.then((()=>c))).then((e=>(n&&o._resolve(),o._completion.then((()=>e))))).catch((e=>(o._reject(e),Tn(e))))}))}function Ci(e,t,r){const n=ht(e)?e.slice():[e];for(let e=0;e<r;++e)n.push(t);return n}const Ii={stack:"dbcore",name:"VirtualIndexMiddleware",level:1,create:function(e){return{...e,table(t){const r=e.table(t),{schema:n}=r,i={},s=[];function o(e,t,r){const n=di(e),u=i[n]=i[n]||[],a=null==e?0:"string"==typeof e?1:e.length,c=t>0,l={...r,isVirtual:c,keyTail:t,keyLength:a,extractKey:hi(e),unique:!c&&r.unique};return u.push(l),l.isPrimaryKey||s.push(l),a>1&&o(2===a?e[0]:e.slice(0,a-1),t+1,r),u.sort(((e,t)=>e.keyTail-t.keyTail)),l}const u=o(n.primaryKey.keyPath,0,n.primaryKey);i[":id"]=[u];for(const e of n.indexes)o(e.keyPath,0,e);function a(t){const r=t.query.index;return r.isVirtual?{...t,query:{index:r,range:(n=t.query.range,i=r.keyTail,{type:1===n.type?2:n.type,lower:Ci(n.lower,n.lowerOpen?e.MAX_KEY:e.MIN_KEY,i),lowerOpen:!0,upper:Ci(n.upper,n.upperOpen?e.MIN_KEY:e.MAX_KEY,i),upperOpen:!0})}}:t;var n,i}const c={...r,schema:{...n,primaryKey:u,indexes:s,getIndexByKeyPath:function(e){const t=i[di(e)];return t&&t[0]}},count:e=>r.count(a(e)),query:e=>r.query(a(e)),openCursor(t){const{keyTail:n,isVirtual:i,keyLength:s}=t.query.index;return i?r.openCursor(a(t)).then((r=>r&&function(r){const i=Object.create(r,{continue:{value:function(i){null!=i?r.continue(Ci(i,t.reverse?e.MAX_KEY:e.MIN_KEY,n)):t.unique?r.continue(r.key.slice(0,s).concat(t.reverse?e.MIN_KEY:e.MAX_KEY,n)):r.continue()}},continuePrimaryKey:{value(t,i){r.continuePrimaryKey(Ci(t,e.MAX_KEY,n),i)}},primaryKey:{get:()=>r.primaryKey},key:{get(){const e=r.key;return 1===s?e[0]:e.slice(0,s)}},value:{get:()=>r.value}});return i}(r))):r.openCursor(t)}};return c}}}};function Ri(e,t,r,n){return r=r||{},n=n||"",lt(e).forEach((i=>{if(gt(t,i)){var s=e[i],o=t[i];if("object"==typeof s&&"object"==typeof o&&s&&o){const e=Kt(s);e!==Kt(o)?r[n+i]=t[i]:"Object"===e?Ri(s,o,r,n+i+"."):s!==o&&(r[n+i]=t[i])}else s!==o&&(r[n+i]=t[i])}else r[n+i]=void 0})),lt(t).forEach((i=>{gt(e,i)||(r[n+i]=t[i])})),r}const Bi={stack:"dbcore",name:"HooksMiddleware",level:2,create:e=>({...e,table(t){const r=e.table(t),{primaryKey:n}=r.schema,i={...r,mutate(e){const i=Ir.trans,{deleting:s,creating:o,updating:u}=i.table(t).hook;switch(e.type){case"add":if(o.fire===cr)break;return i._promise("readwrite",(()=>a(e)),!0);case"put":if(o.fire===cr&&u.fire===cr)break;return i._promise("readwrite",(()=>a(e)),!0);case"delete":if(s.fire===cr)break;return i._promise("readwrite",(()=>a(e)),!0);case"deleteRange":if(s.fire===cr)break;return i._promise("readwrite",(()=>function(e){return c(e.trans,e.range,1e4)}(e)),!0)}return r.mutate(e);function a(e){const t=Ir.trans,i=e.keys||function(e,t){return"delete"===t.type?t.keys:t.keys||t.values.map(e.extractKey)}(n,e);if(!i)throw new Error("Keys missing");return"delete"!==(e="add"===e.type||"put"===e.type?{...e,keys:i}:{...e}).type&&(e.values=[...e.values]),e.keys&&(e.keys=[...e.keys]),function(e,t,r){return"add"===t.type?Promise.resolve([]):e.getMany({trans:t.trans,keys:r,cache:"immutable"})}(r,e,i).then((a=>{const c=i.map(((r,i)=>{const c=a[i],l={onerror:null,onsuccess:null};if("delete"===e.type)s.fire.call(l,r,c,t);else if("add"===e.type||void 0===c){const s=o.fire.call(l,r,e.values[i],t);null==r&&null!=s&&(r=s,e.keys[i]=r,n.outbound||St(e.values[i],n.keyPath,r))}else{const n=Ri(c,e.values[i]),s=u.fire.call(l,n,r,c,t);if(s){const t=e.values[i];Object.keys(s).forEach((e=>{gt(t,e)?t[e]=s[e]:St(t,e,s[e])}))}}return l}));return r.mutate(e).then((({failures:t,results:r,numFailures:n,lastResult:s})=>{for(let n=0;n<i.length;++n){const s=r?r[n]:i[n],o=c[n];null==s?o.onerror&&o.onerror(t[n]):o.onsuccess&&o.onsuccess("put"===e.type&&a[n]?e.values[n]:s)}return{failures:t,results:r,numFailures:n,lastResult:s}})).catch((e=>(c.forEach((t=>t.onerror&&t.onerror(e))),Promise.reject(e))))}))}function c(e,t,i){return r.query({trans:e,values:!1,query:{index:n,range:t},limit:i}).then((({result:r})=>a({type:"delete",keys:r,trans:e}).then((n=>n.numFailures>0?Promise.reject(n.failures[0]):r.length<i?{failures:[],numFailures:0,lastResult:void 0}:c(e,{...t,lower:r[r.length-1],lowerOpen:!0},i)))))}}};return i}})};function Li(e,t,r){try{if(!t)return null;if(t.keys.length<e.length)return null;const n=[];for(let i=0,s=0;i<t.keys.length&&s<e.length;++i)0===Gn(t.keys[i],e[s])&&(n.push(r?Rt(t.values[i]):t.values[i]),++s);return n.length===e.length?n:null}catch(e){return null}}const Ki={stack:"dbcore",level:-1,create:e=>({table:t=>{const r=e.table(t);return{...r,getMany:e=>{if(!e.cache)return r.getMany(e);const t=Li(e.keys,e.trans._cache,"clone"===e.cache);return t?Kr.resolve(t):r.getMany(e).then((t=>(e.trans._cache={keys:e.keys,values:"clone"===e.cache?Rt(t):t},t)))},mutate:e=>("add"!==e.type&&(e.trans._cache=null),r.mutate(e))}}})};function Ni(e){return!("from"in e)}const Mi=function(e,t){if(!this){const t=new Mi;return e&&"d"in e&&pt(t,e),t}pt(this,arguments.length?{d:1,from:e,to:arguments.length>1?t:e}:{d:0})};function Fi(e,t,r){const n=Gn(t,r);if(isNaN(n))return;if(n>0)throw RangeError();if(Ni(e))return pt(e,{from:t,to:r,d:1});const i=e.l,s=e.r;if(Gn(r,e.from)<0)return i?Fi(i,t,r):e.l={from:t,to:r,d:1,l:null,r:null},Hi(e);if(Gn(t,e.to)>0)return s?Fi(s,t,r):e.r={from:t,to:r,d:1,l:null,r:null},Hi(e);Gn(t,e.from)<0&&(e.from=t,e.l=null,e.d=s?s.d+1:1),Gn(r,e.to)>0&&(e.to=r,e.r=null,e.d=e.l?e.l.d+1:1);const o=!e.r;i&&!e.l&&Gi(e,i),s&&o&&Gi(e,s)}function Gi(e,t){Ni(t)||function e(t,{from:r,to:n,l:i,r:s}){Fi(t,r,n),i&&e(t,i),s&&e(t,s)}(e,t)}function Wi(e){let t=Ni(e)?null:{s:0,n:e};return{next(e){const r=arguments.length>0;for(;t;)switch(t.s){case 0:if(t.s=1,r)for(;t.n.l&&Gn(e,t.n.from)<0;)t={up:t,n:t.n.l,s:1};else for(;t.n.l;)t={up:t,n:t.n.l,s:1};case 1:if(t.s=2,!r||Gn(e,t.n.to)<=0)return{value:t.n,done:!1};case 2:if(t.n.r){t.s=3,t={up:t,n:t.n.r,s:0};continue}case 3:t=t.up}return{done:!0}}}}function Hi(e){var t,r;const n=((null===(t=e.r)||void 0===t?void 0:t.d)||0)-((null===(r=e.l)||void 0===r?void 0:r.d)||0),i=n>1?"r":n<-1?"l":"";if(i){const t="r"===i?"l":"r",r={...e},n=e[i];e.from=n.from,e.to=n.to,e[i]=n[i],r[i]=n[t],e[t]=r,r.d=$i(r)}e.d=$i(e)}function $i({r:e,l:t}){return(e?t?Math.max(e.d,t.d):e.d:t?t.d:0)+1}mt(Mi.prototype,{add(e){return Gi(this,e),this},addKey(e){return Fi(this,e,e),this},addKeys(e){return e.forEach((e=>Fi(this,e,e))),this},[Nt](){return Wi(this)}});const Vi={stack:"dbcore",level:0,create:e=>{const t=e.schema.name,r=new Mi(e.MIN_KEY,e.MAX_KEY);return{...e,table:n=>{const i=e.table(n),{schema:s}=i,{primaryKey:o}=s,{extractKey:u,outbound:a}=o,c={...i,mutate:e=>{const o=e.trans,u=o.mutatedParts||(o.mutatedParts={}),a=e=>{const r=`idb://${t}/${n}/${e}`;return u[r]||(u[r]=new Mi)},c=a(""),l=a(":dels"),{type:h}=e;let[p,f]="deleteRange"===e.type?[e.range]:"delete"===e.type?[e.keys]:e.values.length<50?[[],e.values]:[];const d=e.trans._cache;return i.mutate(e).then((e=>{if(ht(p)){"delete"!==h&&(p=e.results),c.addKeys(p);const t=Li(p,d);t||"add"===h||l.addKeys(p),(t||f)&&function(e,t,r,n){t.indexes.forEach((function(t){const i=e(t.name||"");function s(e){return null!=e?t.extractKey(e):null}const o=e=>t.multiEntry&&ht(e)?e.forEach((e=>i.addKey(e))):i.addKey(e);(r||n).forEach(((e,t)=>{const i=r&&s(r[t]),u=n&&s(n[t]);0!==Gn(i,u)&&(null!=i&&o(i),null!=u&&o(u))}))}))}(a,s,t,f)}else if(p){const e={from:p.lower,to:p.upper};l.add(e),c.add(e)}else c.add(r),l.add(r),s.indexes.forEach((e=>a(e.name).add(r)));return e}))}},l=({query:{index:t,range:r}})=>{var n,i;return[t,new Mi(null!==(n=r.lower)&&void 0!==n?n:e.MIN_KEY,null!==(i=r.upper)&&void 0!==i?i:e.MAX_KEY)]},h={get:e=>[o,new Mi(e.key)],getMany:e=>[o,(new Mi).addKeys(e.keys)],count:l,query:l,openCursor:l};return lt(h).forEach((e=>{c[e]=function(s){const{subscr:o}=Ir;if(o){const c=e=>{const r=`idb://${t}/${n}/${e}`;return o[r]||(o[r]=new Mi)},l=c(""),p=c(":dels"),[f,d]=h[e](s);if(c(f.name||"").add(d),!f.isPrimaryKey){if("count"!==e){const t="query"===e&&a&&s.values&&i.query({...s,values:!1});return i[e].apply(this,arguments).then((r=>{if("query"===e){if(a&&s.values)return t.then((({result:e})=>(l.addKeys(e),r)));const e=s.values?r.result.map(u):r.result;s.values?l.addKeys(e):p.addKeys(e)}else if("openCursor"===e){const e=r,t=s.values;return e&&Object.create(e,{key:{get:()=>(p.addKey(e.primaryKey),e.key)},primaryKey:{get(){const t=e.primaryKey;return p.addKey(t),t}},value:{get:()=>(t&&l.addKey(e.primaryKey),e.value)}})}return r}))}p.add(r)}}return i[e].apply(this,arguments)}})),c}}}};class zi{constructor(e,t){this._middlewares={},this.verno=0;const r=zi.dependencies;this._options=t={addons:zi.addons,autoOpen:!0,indexedDB:r.indexedDB,IDBKeyRange:r.IDBKeyRange,...t},this._deps={indexedDB:t.indexedDB,IDBKeyRange:t.IDBKeyRange};const{addons:n}=t;this._dbSchema={},this._versions=[],this._storeNames=[],this._allTables={},this.idbdb=null,this._novip=this;const i={dbOpenError:null,isBeingOpened:!1,onReadyBeingFired:null,openComplete:!1,dbReadyResolve:cr,dbReadyPromise:null,cancelOpen:cr,openCanceller:null,autoSchema:!0,PR1398_maxLoop:3};var s;i.dbReadyPromise=new Kr((e=>{i.dbReadyResolve=e})),i.openCanceller=new Kr(((e,t)=>{i.cancelOpen=t})),this._state=i,this.name=e,this.on=Cn(this,"populate","blocked","versionchange","close",{ready:[yr,cr]}),this.on.ready.subscribe=_t(this.on.ready.subscribe,(e=>(t,r)=>{zi.vip((()=>{const n=this._state;if(n.openComplete)n.dbOpenError||Kr.resolve().then(t),r&&e(t);else if(n.onReadyBeingFired)n.onReadyBeingFired.push(t),r&&e(t);else{e(t);const n=this;r||e((function e(){n.on.ready.unsubscribe(t),n.on.ready.unsubscribe(e)}))}}))})),this.Collection=(s=this,In($n.prototype,(function(e,t){this.db=s;let r=En,n=null;if(t)try{r=t()}catch(e){n=e}const i=e._ctx,o=i.table,u=o.hook.reading.fire;this._ctx={table:o,index:i.index,isPrimKey:!i.index||o.schema.primKey.keyPath&&i.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:n,or:i.or,valueMapper:u!==lr?u:null}}))),this.Table=function(e){return In(Dn.prototype,(function(t,r,n){this.db=e,this._tx=n,this.name=t,this.schema=r,this.hook=e._allTables[t]?e._allTables[t].hook:Cn(null,{creating:[fr,cr],reading:[hr,lr],updating:[gr,cr],deleting:[dr,cr]})}))}(this),this.Transaction=function(e){return In(oi.prototype,(function(t,r,n,i,s){this.db=e,this.mode=t,this.storeNames=r,this.schema=n,this.chromeTransactionDurability=i,this.idbtrans=null,this.on=Cn(this,"complete","error","abort"),this.parent=s||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 Kr(((e,t)=>{this._resolve=e,this._reject=t})),this._completion.then((()=>{this.active=!1,this.on.complete.fire()}),(e=>{var t=this.active;return this.active=!1,this.on.error.fire(e),this.parent?this.parent._reject(e):t&&this.idbtrans&&this.idbtrans.abort(),Tn(e)}))}))}(this),this.Version=function(e){return In(ki.prototype,(function(t){this.db=e,this._cfg={version:t,storesSource:null,dbschema:{},tables:{},contentUpgrade:null}}))}(this),this.WhereClause=function(e){return In(ri.prototype,(function(t,r,n){this.db=e,this._ctx={table:t,index:":id"===r?null:r,or:n};const i=e._deps.indexedDB;if(!i)throw new or.MissingAPI;this._cmp=this._ascending=i.cmp.bind(i),this._descending=(e,t)=>i.cmp(t,e),this._max=(e,t)=>i.cmp(e,t)>0?e:t,this._min=(e,t)=>i.cmp(e,t)<0?e:t,this._IDBKeyRange=e._deps.IDBKeyRange}))}(this),this.on("versionchange",(e=>{e.newVersion>0?console.warn(`Another connection wants to upgrade database '${this.name}'. Closing db now to resume the upgrade.`):console.warn(`Another connection wants to delete database '${this.name}'. Closing db now to resume the delete request.`),this.close()})),this.on("blocked",(e=>{!e.newVersion||e.newVersion<e.oldVersion?console.warn(`Dexie.delete('${this.name}') was blocked`):console.warn(`Upgrade '${this.name}' blocked by other connection holding version ${e.oldVersion/10}`)})),this._maxKey=li(t.IDBKeyRange),this._createTransaction=(e,t,r,n)=>new this.Transaction(e,t,r,this._options.chromeTransactionDurability,n),this._fireOnBlocked=e=>{this.on("blocked").fire(e),Un.filter((e=>e.name===this.name&&e!==this&&!e._state.vcFired)).map((t=>t.on("versionchange").fire(e)))},this.use(Ii),this.use(Bi),this.use(Vi),this.use(Ki),this.vip=Object.create(this,{_vip:{value:!0}}),n.forEach((e=>e(this)))}version(e){if(isNaN(e)||e<.1)throw new or.Type("Given version is not a positive number");if(e=Math.round(10*e)/10,this.idbdb||this._state.isBeingOpened)throw new or.Schema("Cannot add version when database is open");this.verno=Math.max(this.verno,e);const t=this._versions;var r=t.filter((t=>t._cfg.version===e))[0];return r||(r=new this.Version(e),t.push(r),t.sort(bi),r.stores({}),this._state.autoSchema=!1,r)}_whenReady(e){return this.idbdb&&(this._state.openComplete||Ir.letThrough||this._vip)?e():new Kr(((e,t)=>{if(this._state.openComplete)return t(new or.DatabaseClosed(this._state.dbOpenError));if(!this._state.isBeingOpened){if(!this._options.autoOpen)return void t(new or.DatabaseClosed);this.open().catch(cr)}this._state.dbReadyPromise.then(e,t)})).then(e)}use({stack:e,create:t,level:r,name:n}){n&&this.unuse({stack:e,name:n});const i=this._middlewares[e]||(this._middlewares[e]=[]);return i.push({stack:e,create:t,level:null==r?10:r,name:n}),i.sort(((e,t)=>e.level-t.level)),this}unuse({stack:e,name:t,create:r}){return e&&this._middlewares[e]&&(this._middlewares[e]=this._middlewares[e].filter((e=>r?e.create!==r:!!t&&e.name!==t))),this}open(){return function(e){const t=e._state,{indexedDB:r}=e._deps;if(t.isBeingOpened||e.idbdb)return t.dbReadyPromise.then((()=>t.dbOpenError?Tn(t.dbOpenError):e));Ht&&(t.openCanceller._stackHolder=Jt()),t.isBeingOpened=!0,t.dbOpenError=null,t.openComplete=!1;const n=t.openCanceller;function i(){if(t.openCanceller!==n)throw new or.DatabaseClosed("db.open() was cancelled")}let s=t.dbReadyResolve,o=null,u=!1;return Kr.race([n,("undefined"==typeof navigator?Kr.resolve():Pi()).then((()=>new Kr(((n,s)=>{if(i(),!r)throw new or.MissingAPI;const a=e.name,c=t.autoSchema?r.open(a):r.open(a,Math.round(10*e.verno));if(!c)throw new or.MissingAPI;c.onerror=ni(s),c.onblocked=en(e._fireOnBlocked),c.onupgradeneeded=en((n=>{if(o=c.transaction,t.autoSchema&&!e._options.allowEmptyDB){c.onerror=ii,o.abort(),c.result.close();const e=r.deleteDatabase(a);e.onsuccess=e.onerror=en((()=>{s(new or.NoSuchDatabase(`Database ${a} doesnt exist`))}))}else{o.onerror=ni(s);var i=n.oldVersion>Math.pow(2,62)?0:n.oldVersion;u=i<1,e._novip.idbdb=c.result,wi(e,i/10,o,s)}}),s),c.onsuccess=en((()=>{o=null;const r=e._novip.idbdb=c.result,i=qt(r.objectStoreNames);if(i.length>0)try{const n=r.transaction(1===(s=i).length?s[0]:s,"readonly");t.autoSchema?function({_novip:e},t,r){e.verno=t.version/10;const n=e._dbSchema=_i(0,t,r);e._storeNames=qt(t.objectStoreNames,0),yi(e,[e._allTables],lt(n),n)}(e,r,n):(Ui(e,e._dbSchema,n),function(e,t){const r=Ti(_i(0,e.idbdb,t),e._dbSchema);return!(r.add.length||r.change.some((e=>e.add.length||e.change.length)))}(e,n)||console.warn("Dexie SchemaDiff: Schema was extended without increasing the number passed to db.version(). Some queries may fail.")),mi(e,n)}catch(e){}var s;Un.push(e),r.onversionchange=en((r=>{t.vcFired=!0,e.on("versionchange").fire(r)})),r.onclose=en((t=>{e.on("close").fire(t)})),u&&function({indexedDB:e,IDBKeyRange:t},r){!ji(e)&&"__dbnames"!==r&&xi(e,t).put({name:r}).catch(cr)}(e._deps,a),n()}),s)}))))]).then((()=>(i(),t.onReadyBeingFired=[],Kr.resolve(Si((()=>e.on.ready.fire(e.vip)))).then((function r(){if(t.onReadyBeingFired.length>0){let n=t.onReadyBeingFired.reduce(yr,cr);return t.onReadyBeingFired=[],Kr.resolve(Si((()=>n(e.vip)))).then(r)}}))))).finally((()=>{t.onReadyBeingFired=null,t.isBeingOpened=!1})).then((()=>e)).catch((r=>{t.dbOpenError=r;try{o&&o.abort()}catch(e){}return n===t.openCanceller&&e._close(),Tn(r)})).finally((()=>{t.openComplete=!0,s()}))}(this)}_close(){const e=this._state,t=Un.indexOf(this);if(t>=0&&Un.splice(t,1),this.idbdb){try{this.idbdb.close()}catch(e){}this._novip.idbdb=null}e.dbReadyPromise=new Kr((t=>{e.dbReadyResolve=t})),e.openCanceller=new Kr(((t,r)=>{e.cancelOpen=r}))}close(){this._close();const e=this._state;this._options.autoOpen=!1,e.dbOpenError=new or.DatabaseClosed,e.isBeingOpened&&e.cancelOpen(e.dbOpenError)}delete(){const e=arguments.length>0,t=this._state;return new Kr(((r,n)=>{const i=()=>{this.close();var e=this._deps.indexedDB.deleteDatabase(this.name);e.onsuccess=en((()=>{!function({indexedDB:e,IDBKeyRange:t},r){!ji(e)&&"__dbnames"!==r&&xi(e,t).delete(r).catch(cr)}(this._deps,this.name),r()})),e.onerror=ni(n),e.onblocked=this._fireOnBlocked};if(e)throw new or.InvalidArgument("Arguments not allowed in db.delete()");t.isBeingOpened?t.dbReadyPromise.then(i):i()}))}backendDB(){return this.idbdb}isOpen(){return null!==this.idbdb}hasBeenClosed(){const e=this._state.dbOpenError;return e&&"DatabaseClosed"===e.name}hasFailed(){return null!==this._state.dbOpenError}dynamicallyOpened(){return this._state.autoSchema}get tables(){return lt(this._allTables).map((e=>this._allTables[e]))}transaction(){const e=Oi.apply(this,arguments);return this._transaction.apply(this,e)}_transaction(e,t,r){let n=Ir.trans;n&&n.db===this&&-1===e.indexOf("!")||(n=null);const i=-1!==e.indexOf("?");let s,o;e=e.replace("!","").replace("?","");try{if(o=t.map((e=>{var t=e instanceof this.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||"readonly"===e)s="readonly";else{if("rw"!=e&&"readwrite"!=e)throw new or.InvalidArgument("Invalid transaction mode: "+e);s="readwrite"}if(n){if("readonly"===n.mode&&"readwrite"===s){if(!i)throw new or.SubTransaction("Cannot enter a sub-transaction with READWRITE mode when parent transaction is READONLY");n=null}n&&o.forEach((e=>{if(n&&-1===n.storeNames.indexOf(e)){if(!i)throw new or.SubTransaction("Table "+e+" not included in parent transaction.");n=null}})),i&&n&&!n.active&&(n=null)}}catch(e){return n?n._promise(null,((t,r)=>{r(e)})):Tn(e)}const u=Di.bind(null,this,s,o,n,r);return n?n._promise(s,u,"lock"):Ir.trans?mn(Ir.transless,(()=>this._whenReady(u))):this._whenReady(u)}table(e){if(!gt(this._allTables,e))throw new or.InvalidTable(`Table ${e} does not exist`);return this._allTables[e]}}const Ji="undefined"!=typeof Symbol&&"observable"in Symbol?Symbol.observable:"@@observable";class Qi{constructor(e){this._subscribe=e}subscribe(e,t,r){return this._subscribe(e&&"function"!=typeof e?e:{next:e,error:t,complete:r})}[Ji](){return this}}function Xi(e,t){return lt(t).forEach((r=>{Gi(e[r]||(e[r]=new Mi),t[r])})),e}let Yi;try{Yi={indexedDB:ct.indexedDB||ct.mozIndexedDB||ct.webkitIndexedDB||ct.msIndexedDB,IDBKeyRange:ct.IDBKeyRange||ct.webkitIDBKeyRange}}catch(ct){Yi={indexedDB:null,IDBKeyRange:null}}const Zi=zi;function es(e){let t=ts;try{ts=!0,si.storagemutated.fire(e)}finally{ts=t}}mt(Zi,{...ar,delete:e=>new Zi(e,{addons:[]}).delete(),exists:e=>new Zi(e,{addons:[]}).open().then((e=>(e.close(),!0))).catch("NoSuchDatabaseError",(()=>!1)),getDatabaseNames(e){try{return function({indexedDB:e,IDBKeyRange:t}){return ji(e)?Promise.resolve(e.databases()).then((e=>e.map((e=>e.name)).filter((e=>"__dbnames"!==e)))):xi(e,t).toCollection().primaryKeys()}(Zi.dependencies).then(e)}catch(e){return Tn(new or.MissingAPI)}},defineClass:()=>function(e){pt(this,e)},ignoreTransaction:e=>Ir.trans?mn(Ir.transless,e):e(),vip:Si,async:function(e){return function(){try{var t=Ei(e.apply(this,arguments));return t&&"function"==typeof t.then?t:Kr.resolve(t)}catch(e){return Tn(e)}}},spawn:function(e,t,r){try{var n=Ei(e.apply(r,t||[]));return n&&"function"==typeof n.then?n:Kr.resolve(n)}catch(e){return Tn(e)}},currentTransaction:{get:()=>Ir.trans||null},waitFor:function(e,t){const r=Kr.resolve("function"==typeof e?Zi.ignoreTransaction(e):e).timeout(t||6e4);return Ir.trans?Ir.trans.waitFor(r):r},Promise:Kr,debug:{get:()=>Ht,set:e=>{$t(e,"dexie"===e?()=>!0:Sn)}},derive:bt,extend:pt,props:mt,override:_t,Events:Cn,on:si,liveQuery:function(e){return new Qi((t=>{const r=Wt(e);let n=!1,i={},s={};const o={get closed(){return n},unsubscribe:()=>{n=!0,si.storagemutated.unsubscribe(l)}};t.start&&t.start(o);let u=!1,a=!1;function c(){return lt(s).some((e=>i[e]&&function(e,t){const r=Wi(t);let n=r.next();if(n.done)return!1;let i=n.value;const s=Wi(e);let o=s.next(i.from),u=o.value;for(;!n.done&&!o.done;){if(Gn(u.from,i.to)<=0&&Gn(u.to,i.from)>=0)return!0;Gn(i.from,u.from)<0?i=(n=r.next(u.from)).value:u=(o=s.next(i.from)).value}return!1}(i[e],s[e])))}const l=e=>{Xi(i,e),c()&&h()},h=()=>{if(u||n)return;i={};const p={},f=function(t){r&&cn();const n=()=>an(e,{subscr:t,trans:null}),i=Ir.trans?mn(Ir.transless,n):n();return r&&i.then(ln,ln),i}(p);a||(si("storagemutated",l),a=!0),u=!0,Promise.resolve(f).then((e=>{u=!1,n||(c()?h():(i={},s=p,t.next&&t.next(e)))}),(e=>{u=!1,t.error&&t.error(e),o.unsubscribe()}))};return h(),o}))},extendObservabilitySet:Xi,getByKeyPath:jt,setByKeyPath:St,delByKeyPath:function(e,t){"string"==typeof t?St(e,t,void 0):"length"in t&&[].map.call(t,(function(t){St(e,t,void 0)}))},shallowClone:Pt,deepClone:Rt,getObjectDiff:Ri,cmp:Gn,asap:kt,minKey:-1/0,addons:[],connections:Un,errnames:ir,dependencies:Yi,semVer:"3.2.3",version:"3.2.3".split(".").map((e=>parseInt(e))).reduce(((e,t,r)=>e+t/Math.pow(10,2*r)))}),Zi.maxKey=li(Zi.dependencies.IDBKeyRange),"undefined"!=typeof dispatchEvent&&"undefined"!=typeof addEventListener&&(si("storagemutated",(e=>{if(!ts){let t;kn?(t=document.createEvent("CustomEvent"),t.initCustomEvent("x-storagemutated-1",!0,!0,e)):t=new CustomEvent("x-storagemutated-1",{detail:e}),ts=!0,dispatchEvent(t),ts=!1}})),addEventListener("x-storagemutated-1",(({detail:e})=>{ts||es(e)})));let ts=!1;if("undefined"!=typeof BroadcastChannel){const e=new BroadcastChannel("x-storagemutated-1");"function"==typeof e.unref&&e.unref(),si("storagemutated",(t=>{ts||e.postMessage(t)})),e.onmessage=e=>{e.data&&es(e.data)}}else if("undefined"!=typeof self&&"undefined"!=typeof navigator){si("storagemutated",(e=>{try{ts||("undefined"!=typeof localStorage&&localStorage.setItem("x-storagemutated-1",JSON.stringify({trig:Math.random(),changedParts:e})),"object"==typeof self.clients&&[...self.clients.matchAll({includeUncontrolled:!0})].forEach((t=>t.postMessage({type:"x-storagemutated-1",changedParts:e}))))}catch(e){}})),"undefined"!=typeof addEventListener&&addEventListener("storage",(e=>{if("x-storagemutated-1"===e.key){const t=JSON.parse(e.newValue);t&&es(t.changedParts)}}));const e=self.document&&navigator.serviceWorker;e&&e.addEventListener("message",(function({data:e}){e&&"x-storagemutated-1"===e.type&&es(e.changedParts)}))}function rs(e){return rs="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},rs(e)}function ns(){ns=function(){return e};var e={},t=Object.prototype,r=t.hasOwnProperty,n=Object.defineProperty||function(e,t,r){e[t]=r.value},i="function"==typeof Symbol?Symbol:{},s=i.iterator||"@@iterator",o=i.asyncIterator||"@@asyncIterator",u=i.toStringTag||"@@toStringTag";function a(e,t,r){return Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{a({},"")}catch(e){a=function(e,t,r){return e[t]=r}}function c(e,t,r,i){var s=t&&t.prototype instanceof p?t:p,o=Object.create(s.prototype),u=new U(i||[]);return n(o,"_invoke",{value:T(e,r,u)}),o}function l(e,t,r){try{return{type:"normal",arg:e.call(t,r)}}catch(e){return{type:"throw",arg:e}}}e.wrap=c;var h={};function p(){}function f(){}function d(){}var g={};a(g,s,(function(){return this}));var m=Object.getPrototypeOf,y=m&&m(m(k([])));y&&y!==t&&r.call(y,s)&&(g=y);var v=d.prototype=p.prototype=Object.create(g);function b(e){["next","throw","return"].forEach((function(t){a(e,t,(function(e){return this._invoke(t,e)}))}))}function w(e,t){function i(n,s,o,u){var a=l(e[n],e,s);if("throw"!==a.type){var c=a.arg,h=c.value;return h&&"object"==rs(h)&&r.call(h,"__await")?t.resolve(h.__await).then((function(e){i("next",e,o,u)}),(function(e){i("throw",e,o,u)})):t.resolve(h).then((function(e){c.value=e,o(c)}),(function(e){return i("throw",e,o,u)}))}u(a.arg)}var s;n(this,"_invoke",{value:function(e,r){function n(){return new t((function(t,n){i(e,r,t,n)}))}return s=s?s.then(n,n):n()}})}function T(e,t,r){var n="suspendedStart";return function(i,s){if("executing"===n)throw new Error("Generator is already running");if("completed"===n){if("throw"===i)throw s;return x()}for(r.method=i,r.arg=s;;){var o=r.delegate;if(o){var u=A(o,r);if(u){if(u===h)continue;return u}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if("suspendedStart"===n)throw n="completed",r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);n="executing";var a=l(e,t,r);if("normal"===a.type){if(n=r.done?"completed":"suspendedYield",a.arg===h)continue;return{value:a.arg,done:r.done}}"throw"===a.type&&(n="completed",r.method="throw",r.arg=a.arg)}}}function A(e,t){var r=t.method,n=e.iterator[r];if(void 0===n)return t.delegate=null,"throw"===r&&e.iterator.return&&(t.method="return",t.arg=void 0,A(e,t),"throw"===t.method)||"return"!==r&&(t.method="throw",t.arg=new TypeError("The iterator does not provide a '"+r+"' method")),h;var i=l(n,e.iterator,t.arg);if("throw"===i.type)return t.method="throw",t.arg=i.arg,t.delegate=null,h;var s=i.arg;return s?s.done?(t[e.resultName]=s.value,t.next=e.nextLoc,"return"!==t.method&&(t.method="next",t.arg=void 0),t.delegate=null,h):s:(t.method="throw",t.arg=new TypeError("iterator result is not an object"),t.delegate=null,h)}function q(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function _(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function U(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(q,this),this.reset(!0)}function k(e){if(e){var t=e[s];if(t)return t.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var n=-1,i=function t(){for(;++n<e.length;)if(r.call(e,n))return t.value=e[n],t.done=!1,t;return t.value=void 0,t.done=!0,t};return i.next=i}}return{next:x}}function x(){return{value:void 0,done:!0}}return f.prototype=d,n(v,"constructor",{value:d,configurable:!0}),n(d,"constructor",{value:f,configurable:!0}),f.displayName=a(d,u,"GeneratorFunction"),e.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===f||"GeneratorFunction"===(t.displayName||t.name))},e.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,d):(e.__proto__=d,a(e,u,"GeneratorFunction")),e.prototype=Object.create(v),e},e.awrap=function(e){return{__await:e}},b(w.prototype),a(w.prototype,o,(function(){return this})),e.AsyncIterator=w,e.async=function(t,r,n,i,s){void 0===s&&(s=Promise);var o=new w(c(t,r,n,i),s);return e.isGeneratorFunction(r)?o:o.next().then((function(e){return e.done?e.value:o.next()}))},b(v),a(v,u,"Generator"),a(v,s,(function(){return this})),a(v,"toString",(function(){return"[object Generator]"})),e.keys=function(e){var t=Object(e),r=[];for(var n in t)r.push(n);return r.reverse(),function e(){for(;r.length;){var n=r.pop();if(n in t)return e.value=n,e.done=!1,e}return e.done=!0,e}},e.values=k,U.prototype={constructor:U,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(_),!e)for(var t in this)"t"===t.charAt(0)&&r.call(this,t)&&!isNaN(+t.slice(1))&&(this[t]=void 0)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var t=this;function n(r,n){return o.type="throw",o.arg=e,t.next=r,n&&(t.method="next",t.arg=void 0),!!n}for(var i=this.tryEntries.length-1;i>=0;--i){var s=this.tryEntries[i],o=s.completion;if("root"===s.tryLoc)return n("end");if(s.tryLoc<=this.prev){var u=r.call(s,"catchLoc"),a=r.call(s,"finallyLoc");if(u&&a){if(this.prev<s.catchLoc)return n(s.catchLoc,!0);if(this.prev<s.finallyLoc)return n(s.finallyLoc)}else if(u){if(this.prev<s.catchLoc)return n(s.catchLoc,!0)}else{if(!a)throw new Error("try statement without catch or finally");if(this.prev<s.finallyLoc)return n(s.finallyLoc)}}}},abrupt:function(e,t){for(var n=this.tryEntries.length-1;n>=0;--n){var i=this.tryEntries[n];if(i.tryLoc<=this.prev&&r.call(i,"finallyLoc")&&this.prev<i.finallyLoc){var s=i;break}}s&&("break"===e||"continue"===e)&&s.tryLoc<=t&&t<=s.finallyLoc&&(s=null);var o=s?s.completion:{};return o.type=e,o.arg=t,s?(this.method="next",this.next=s.finallyLoc,h):this.complete(o)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),h},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.finallyLoc===e)return this.complete(r.completion,r.afterLoc),_(r),h}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.tryLoc===e){var n=r.completion;if("throw"===n.type){var i=n.arg;_(r)}return i}}throw new Error("illegal catch attempt")},delegateYield:function(e,t,r){return this.delegate={iterator:k(e),resultName:t,nextLoc:r},"next"===this.method&&(this.arg=void 0),h}},e}function is(e,t,r,n,i,s,o){try{var u=e[s](o),a=u.value}catch(e){return void r(e)}u.done?t(a):Promise.resolve(a).then(n,i)}function ss(e){return function(){var t=this,r=arguments;return new Promise((function(n,i){var s=e.apply(t,r);function o(e){is(s,n,i,o,u,"next",e)}function u(e){is(s,n,i,o,u,"throw",e)}o(void 0)}))}}Kr.rejectionMapper=function(e,t){if(!e||e instanceof er||e instanceof TypeError||e instanceof SyntaxError||!e.name||!ur[e.name])return e;var r=new ur[e.name](t||e.message,e);return"stack"in e&&vt(r,"stack",{get:function(){return this.inner.stack}}),r},$t(Ht,Sn);var os=function(){var e=new zi("IDBCache",{autoOpen:!1});this.isSupported=function(){var e=window.indexedDB||window.mozIndexedDB||window.webkitIndexedDB||window.msIndexedDB,t=window.IDBKeyRange||window.webkitIDBKeyRange,r=window.IDBCursor||window.webkitIDBCursor,n=function(){var e=window.navigator.userAgent,t=e.indexOf("MSIE ");if(t>0)return parseInt(e.substring(t+5,e.indexOf(".",t)),10);if(e.indexOf("Trident/")>0){var r=e.indexOf("rv:");return parseInt(e.substring(r+3,e.indexOf(".",r)),10)}var n=e.indexOf("Edge/");return n>0&&parseInt(e.substring(n+5,e.indexOf(".",n)),10)}(),i=function(){if(navigator.userAgent.match(/Safari/i)&&!1==!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=!1!==n&&n<11,o=!1!==i&&i<10,u=!!navigator.userAgent.match(/iPad|iPhone|iPod/i);return navigator.userAgent.match(/PhantomJS/i)?e&&t&&r:e&&t&&r&&!s&&!u&&!o},this.addResponse=function(t,r,n,i){return e.responseTable.put({etag:n,data:r,timestamp:$.now(),chunks:i?parseInt(i,10):null},t)},this.getResponse=function(t){return e.responseTable.get(t)},this.addBatchResponse=function(t,r,n,i){return e.batchedResponseTable.put({id:t+r,batch:r,data:n,timestamp:$.now(),chunks:i?parseInt(i,10):null})},this.getBatchResponse=function(t,r){return e.batchedResponseTable.get(t+r)},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.version(.4).stores({batchedResponseTable:"id,batch"}).upgrade((function(e){e.batchedResponseTable.filter((function(e){return e.id.includes("objects")&&e.id.includes("topology")&&e.id.includes("shortinfo")})).delete()})),e.version(.5).stores({batchedResponseTable:"id,batch"}).upgrade((function(e){e.batchedResponseTable.filter((function(e){return e.id.includes("objects")&&e.id.includes("topology")&&e.id.includes("shortinfo")})).delete()})),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=ss(ns().mark((function e(t){var r,n;return ns().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=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},n="",e.next=4,t.each((function(e){n+=" ".concat(JSON.stringify(e,r),"\n")}));case 4:return e.abrupt("return",n);case 5:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),this.dumpTable=function(){var e=ss(ns().mark((function e(t){var r,n,i,s;return ns().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,t.toCollection().count();case 2:return r=e.sent,n=[t.schema.primKey].concat(t.schema.indexes),i=n.map((function(e){return e.src})).join(","),s="Table: ".concat(t.name,", Schema: '").concat(i,"', Count of entries: ").concat(r,"\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(t){return e.apply(this,arguments)}}(),this.dumpDatabase=ss(ns().mark((function t(){var r;return ns().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return r="",r+="BimWebSdk: Dexie Databases Dump\n",r+="===============================\n",r+="Database: ".concat(e.name," (Version: ").concat(e.verno,")\n"),t.t0=r,t.next=7,this.dumpTable(e.responseTable);case 7:return r=t.t0+=t.sent,t.t1=r,t.next=11,this.dumpTable(e.batchedResponseTable);case 11:return r=t.t1+=t.sent,t.abrupt("return",r);case 13:case"end":return t.stop()}}),t,this)})))},us=function(){var e=null,t=null,r=new os;r.initDB().then((function(){window.BIMPLUS_SDK_ENABLE_IDBCACHE_DUMP&&r.dumpDatabase().then((function(e){console.log(e)}))})).catch((function(e){console.error("BimWebSdk indexedDB initialization error : "+e.stack||0)})),this.setAccessToken=function(t){e=t},this.setTokenType=function(e){t=e},this.getCache=function(){return r};var n=function(e,t,n){var i=n.getResponseHeader("ETag"),s=n.getResponseHeader("X-Total-Count"),o="arraybuffer"===n.responseType;if(i){var u=!1===o?JSON.stringify(t):null;r.addResponse(e,o?t:JSON.parse(u),i,s).then((function(){})).catch((function(t){console.error("BimWebSdk failed to add response to cache: "+e+" Reason: "+t.message)}))}},i=function(e){return"W"===e.charAt(0)?e.substring(2):e};this.getBatchResponse=function(e,t,n){var i=$.Deferred(),s=n.useXMLHttpRequest?et:Ze;return r.getBatchResponse(e,t).then((function(o){if(o){var u={};return null!==o.chunks&&(u["Cached-X-Total-Count"]=o.chunks),u.status=304,void i.resolve(o.data,304,u)}s(e,"GET",null,n).done((function(n,s,o){var u=o.getResponseHeader("X-Total-Count"),a="arraybuffer"===o.responseType,c=!1===a?JSON.stringify(n):null;r.addBatchResponse(e,t,a?n:JSON.parse(c),u).then((function(){})).catch((function(t){console.error("BimWebSdk failed to add response to cache: "+e+" Reason: "+t.message)})),i.resolve(n,s,o)})).fail((function(e,t){i.reject(e,t)}))})),i.promise()},this.get=function(s,o){if(o||(o={}),o.token||(o.token=e),o.tokenType&&o.tokenType===t||(o.tokenType=t),o.queryParams&&(s+=tt(o.queryParams)),o.responseBatch)return this.getBatchResponse(s,o.responseBatch,o);var u=$.Deferred(),a=o.useXMLHttpRequest?et:Ze;return r.getResponse("GET;"+s).then((function(e){if(e){var t=i(e.etag);o.eTag=t,a(s,"GET",null,o).done((function(t,r,i){304===i.status?(null!==e.chunks&&(i["Cached-X-Total-Count"]=e.chunks),u.resolve(e.data,r,i)):(n("GET;"+s,t,i),u.resolve(t,r,i))})).fail((function(e,t){u.reject(e,t)}))}else a(s,"GET",null,o).done((function(e,t,r){n("GET;"+s,e,r),u.resolve(e,t,r)})).fail((function(e,t){u.reject(e,t)}))})).catch((function(){a(s,"GET",null,o).done((function(e,t,r){n("GET;"+s,e,r),u.resolve(e,t,r)})).fail((function(e,t){u.reject(e,t)}))})),u.promise()},this.getChunked=function(t,r){return rt(this,e,"medium",t,r,arguments.length>2&&void 0!==arguments[2]&&arguments[2],arguments.length>3&&void 0!==arguments[3]?arguments[3]:null,arguments.length>4&&void 0!==arguments[4]?arguments[4]:null)},this.put=function(r,n,i){return i||(i={}),i.token||(i.token=e),i.tokenType&&i.tokenType===t||(i.tokenType=t),i.queryParams&&(r+=tt(i.queryParams)),Ze(r,"PUT",n,i)},this.post=function(r,n,i){return i||(i={}),i.token||(i.token=e),i.tokenType&&i.tokenType===t||(i.tokenType=t),i.queryParams&&(r+=tt(i.queryParams)),(i.useXMLHttpRequest?et:Ze)(r,"POST",n,i)},this.del=function(r,n,i){return i||(i={}),n||(i.contentType=null),i.dataType=null,i.token||(i.token=e),i.tokenType&&i.tokenType===t||(i.tokenType=t),i.queryParams&&(r+=tt(i.queryParams)),Ze(r,"DELETE",n||null,i)},this.head=function(s,o){o||(o={}),o.contentType="",o.dataType="",o.token||(o.token=e),o.tokenType&&o.tokenType===t||(o.tokenType=t),o.queryParams&&(s+=tt(o.queryParams));var u=$.Deferred();return r.getResponse("HEAD;"+s).then((function(e){if(e){var t=i(e.etag);o.eTag=t,Ze(s,"HEAD",null,o).done((function(e,t,r){304===r.status?u.resolve(!0,t,r):(n("HEAD;"+s,null,r),u.resolve(!1,t,r))})).fail((function(e,t){u.reject(e,t)}))}else Ze(s,"HEAD",null,o).done((function(e,t,r){n("HEAD;"+s,null,r),u.resolve(!1,t,r)})).fail((function(e,t){u.reject(!1,t)}))})).catch((function(){Ze(s,"HEAD",null,o).done((function(e,t,r){n("HEAD;"+s,null,r),u.resolve(!1,t,r)})).fail((function(e,t){u.reject(!1,t)}))})),u.promise()}},as=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,r){var n={queryParams:{customFilter:r}};return t?e.request.get(e.getApiTeamUrl()+"clashdetection/filters/"+t,r?n:null):e.request.get(e.getApiTeamUrl()+"clashdetection/filters",r?n:null)},this.calculateClashes=function(t,r,n){if(r||n){var i={queryParams:{}};return r&&(i.queryParams.topology=r),n&&(i.queryParams.clashElements=n),e.request.post(e.getApiTeamUrl()+"clashdetection/filters",t,i)}return e.request.post(e.getApiTeamUrl()+"clashdetection/filters",t)},this.getFilterResults=function(t,r,n,i){if(n||i){var s={queryParams:{}};return n&&(s.queryParams.topology=n),i&&(s.queryParams.clashElements=i),r?e.request.get(e.getApiTeamUrl()+"clashdetection/projects/"+t+"/filters/"+r,s):e.request.get(e.getApiTeamUrl()+"clashdetection/projects/"+t+"/filters",s)}return r?e.request.get(e.getApiTeamUrl()+"clashdetection/projects/"+t+"/filters/"+r):e.request.get(e.getApiTeamUrl()+"clashdetection/projects/"+t+"/filters")},this.createClashRule=function(t,r){return e.request.post(e.getApiTeamUrl()+"projects/"+t+"/clashfilters",JSON.stringify(r))},this.deleteClashRule=function(t,r){var n={queryParams:{force:r}};return e.request.del(e.getApiTeamUrl()+"clashfilters/"+t,null,r?n:null)},this.updateClashRule=function(t,r){return e.request.put(e.getApiTeamUrl()+"clashfilters/"+t,JSON.stringify(r))},this.getAllClashRules=function(t,r){var n={queryParams:{customFilter:r}};return e.request.get(e.getApiTeamUrl()+"projects/"+t+"/clashfilters",r?n:null)}},cs=function(e){this.post=function(t){var r=[{message:t}];return e.request.post(e.getApiTeamUrl()+"clientlogs",JSON.stringify(r))},this.postExtended=function(t,r,n,i){var s=[{message:t,applicationclass:r,releaseversion:n,projectid:i}];return e.request.post(e.getApiTeamUrl()+"clientlogs",JSON.stringify(s))},this.postArray=function(t){return e.request.post(e.getApiTeamUrl()+"clientlogs",JSON.stringify(t))},this.get=function(){return e.request.get(e.getApiTeamUrl()+"clientlogs")}},ls=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,r){return e.request.put(e.getApiTeamUrl()+"comments/"+t,r)}},hs=function(e){this.get=function(t,r,n){var i=e.getApiTeamUrl()+"objects/"+t+"/customtables";r&&(i+="?variantId="+r);var s={};return n&&(s.queryParams={revision:n}),e.request.get(i,n?s:void 0)},this.post=function(t,r){return e.request.post(e.getApiTeamUrl()+"objects/"+t+"/customtables",r)}},ps=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,r){return e.request.put(e.getApiTeamUrl()+"dimensionlines/"+t,r)}},fs=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,r){return t?e.request.get(e.getApiTeamUrl()+"element-types/"+t+"/attributetemplates",r?{queryParams:r}:void 0):e.request.get(e.getApiTeamUrl()+"element-types/attributetemplates",r?{queryParams:r}: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")}},ds=function(e){this.exportObjects=function(t,r){return e.request.get(e.getApiTeamUrl()+"projects/"+t+"/objects/export/excel?typeId="+r)},this.exportModel=function(t,r,n,i,s,o){var u={};return n&&(u.revision=n),i&&(u.emptyPropExport=1),s&&(u.propSetExport=1),o&&(u.temporary="true"),e.request.post("".concat(e.getApiTeamUrl(),"projects/").concat(t,"/model/").concat(r,"/exportasync"),null,{queryParams:u,contentType:!1,processData:!1,dataType:null})},this.exportSelection=function(t,r,n,i){var s={};return r&&(s.emptyPropExport=r),n&&(s.propSetExport=n),i&&(s.temporary="true"),e.request.post("".concat(e.getApiTeamUrl(),"selections/").concat(t,"/exportasync"),null,{queryParams:s})},this.createExportSelection=function(t,r){return e.request.post("".concat(e.getApiTeamUrl(),"projects/").concat(t,"/exportobjects"),r)}},gs=function(e){this.getAccessRights=function(t){return e.request.get(e.getApiTeamUrl()+"folders/"+t+"/rights")},this.setMemberAccessRights=function(t,r,n){return e.request.put(e.getApiTeamUrl()+"folders/"+t+"/rights?assignrecursive="+(n?"true":"false"),r)},this.setMembersAccessRights=function(t,r,n){return e.request.put(e.getApiTeamUrl()+"folders/"+t+"/usersrights?assignrecursive="+(n?"true":"false"),r)}},ms=function(e){var t=function(t){return t?e.getApiUrl()+"content/freeattributegroups/":e.getApiTeamUrl()+"freeattributegroups/"};this.post=function(r,n){return e.request.post(t(n),r)},this.get=function(r,n){return r?e.request.get(t(n)+r):e.request.get(t(n))},this.put=function(r,n,i){return e.request.put(t(i)+r,n)},this.delete=function(r,n){return e.request.del(t(n)+r)},this.getFreeAttributes=function(r,n){return e.request.get(t(n)+r+"/freeattributes")}},ys=function(e){var t=function(t){return t?e.getApiUrl()+"content/freeattributes/":e.getApiTeamUrl()+"freeattributes/"};this.post=function(r,n){return e.request.post(t(n),r)},this.get=function(r,n,i){return r?e.request.get(t(n)+r,i?{queryParams:i}:void 0):e.request.get(t(n),i?{queryParams:i}:void 0)},this.put=function(r,n,i){return e.request.put(t(i)+r,n)},this.delete=function(r,n){return e.request.del(t(n)+r)},this.getTopology=function(r){return e.request.get(t(r)+"?topology=true")},this.getFilteredAttributes=function(t,r,n){var i=e.getApiTeamUrl();return t&&(i+="projects/".concat(t,"/")),i+="attributes?",r&&(i+="layer=".concat(r,"&")),n&&(i+="type=".concat(n)),e.request.get(i)}},vs=function(e){this.calculate=function(t,r,n,i,s){var o={hiddenCalculation:{projectId:t,calculationMode:"View",view:r,clippingPlanes:n,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};return e.request.post(e.getApiTeamUrl()+"services/Hiddencalculation",JSON.stringify(o))}},bs=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,r){return e.request.put(e.getApiTeamUrl()+"hyperlinks/"+t,r)}},ws=function(e){this.postModel=function(t,r,n,i,s){return"replaceModelData"===s?e.request.post(e.getApiTeamUrl()+"projects/"+t+"/model/"+r+"/importasync?replaceModelData=true",n,{preparedData:n,contentType:!1,processData:!1,dataType:null,xhrUploadProgress:i}):e.request.post(e.getApiTeamUrl()+"projects/"+t+"/model/"+r+"/importasync",n,{preparedData:n,contentType:!1,processData:!1,dataType:null,xhrUploadProgress:i})}},Ts=function(e){this.post=function(t,r){return e.request.post(e.getApiTeamUrl()+"projects/"+t+"/issues",r)},this.get=function(t){return e.request.get(e.getApiTeamUrl()+"issues/"+t)},this.postPin=function(t,r){return e.request.post(e.getApiTeamUrl()+"issues/"+t+"/pins",r)},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,r){return e.request.post(e.getApiTeamUrl()+"issues/"+t+"/comments",r)},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,r){return e.request.post(e.getApiTeamUrl()+"issues/"+t+"/attachments",r)},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,r,n){return e.request.put(e.getApiTeamUrl()+"issues/"+t,r,n?{queryParams:n}:void 0)},this.delete=function(t,r){var n={queryParams:{forceDelete:r}};return e.request.del(e.getApiTeamUrl()+"issues/"+t,null,r?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,r){return e.request.put(e.getApiTeamUrl()+"projects/"+t+"/issues/bcf",r,{contentType:!1,processData:!1})},this.updateImportBcf=function(t,r){return e.request.put(e.getApiTeamUrl()+"projects/"+t+"/issues/bcf",r)},this.exportBcf=function(t,r,n){return t?e.request.post(e.getApiTeamUrl()+"projects/"+t+"/issues/export/bcf"+(n?"?version="+n:""),r):e.request.post(e.getApiTeamUrl()+"issues/export/bcf"+(n?"?version="+n:""),r)},this.exportExcel=function(t,r){return t?e.request.post(e.getApiTeamUrl()+"projects/"+t+"/issues/export/excel",r):e.request.post(e.getApiTeamUrl()+"issues/export/excel",r)}},As=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,r){return e.request.put(e.getApiTeamUrl()+"labels/"+t,r)}},qs=function(e){this.lockObject=function(t,r){return e.request.put(e.getApiTeamUrl()+"objects/"+t+"/locks",r,{dataType:"text"})},this.checkLocked=function(t){return e.request.get(e.getApiTeamUrl()+"objects/"+t+"/locks")},this.deleteLock=function(t,r){return!0===r?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")}},_s=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,r,n){return e.request.put(e.getApiTeamUrl()+"members/"+r,n)},this.deleteUser=function(t,r){return e.request.del(e.getApiTeamUrl()+"members/"+r)}},Us=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,r){return e.request.put(e.getApiUrl()+"messages/"+t+"/updatedashboardadditionaldata",r)},this.addDashboardMessageAttachment=function(t,r,n){return e.request.put(e.getApiUrl()+"messages/"+t+"/upload?type=dashboard",r,n)},this.getAllMessagingGroups=function(){return e.request.get(e.getApiUrl()+"systemgroups")},this.getMessagingGroupsDetails=function(t){return e.request.get(e.getApiUrl()+"systemgroups/"+t)}},ks=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):(console.warn("BimWebSdk: request (divisions/".concat(t,") does not support head method!")),new Promise((function(e){e(!1)})))},this.getDisciplines=function(t){return e.request.get(e.getApiTeamUrl()+"divisions/"+t+"/disciplines")},this.setDisciplineValidity=function(t,r,n){var i={private:!n};return e.request.put(e.getApiTeamUrl()+"divisions/"+t+"/disciplines/"+r,JSON.stringify(i))},this.getRevisions=function(t){return e.request.get(e.getApiTeamUrl()+"divisions/"+t+"/revisions")},this.getAllRevisions=function(t){return e.request.get(e.getApiTeamUrl()+"projects/"+t+"/revisions")},this.postRevision=function(t,r){return e.request.post(e.getApiTeamUrl()+"divisions/"+t+"/revisions",r)},this.put=function(t,r){return e.request.put(e.getApiTeamUrl()+"divisions/"+t,r)},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,r){return e.request.put(e.getApiTeamUrl()+"divisions/"+t+"/move",r)}},xs=["topology","structure"],js=function(e){this.get=function(t,r){var n={};return t&&(n.object_id=t),r&&(n.project_id=r),e.request.get(e.getApiTeamUrl()+"settings/filters",{queryParams:n})},this.getFilteredObjects=function(t,r,n,i){if(n)return e.request.get(e.getApiTeamUrl()+"projects/"+t+"/filters/"+r+"/properties",{queryParams:n});if(i&&xs.find((function(e){return e===i}))){var s={};return s[i]=!0,e.request.get(e.getApiTeamUrl()+"projects/"+t+"/filters/"+r,{queryParams:s})}return e.request.get(e.getApiTeamUrl()+"projects/"+t+"/filters/"+r)},this.getSelectionFilteredObjects=function(t,r,n,i){if(n)return e.request.get(e.getApiTeamUrl()+"selections/"+t+"/filters/"+r+"/properties",{queryParams:n});if(i&&xs.find((function(e){return e===i}))){var s={};return s[i]=!0,e.request.get(e.getApiTeamUrl()+"selections/"+t+"/filters/"+r,{queryParams:s})}return e.request.get(e.getApiTeamUrl()+"selections/"+t+"/filters/"+r)},this.applyFilter=function(t){return e.request.get(e.getApiTeamUrl()+"filters/"+t)},this.post=function(t,r){var n={};return r&&(n.project_id=r),e.request.post(e.getApiTeamUrl()+"settings/filter",t,{queryParams:n})},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)}},Ss=function(e){this.post=function(t){return e.request.post(e.getApiTeamUrl()+"objects/",t)},this.get=function(t,r,n,i,s,o){var u={};r&&(u.queryParams={revision:r}),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 n&&(a+="/properties/",a+=n),e.request.get(a,r||i||s||o?u:void 0)},this.getInternal=function(t,r){var n={};r&&(n.queryParams={revision:r});var i=e.getApiTeamUrl()+"objects/"+t;return i+="/internal",e.request.get(i,r?n:void 0)},this.head=function(t,r){var n={};return r&&(n.queryParams={revision:r}),e.request.head?e.request.head(e.getApiTeamUrl()+"objects/"+t,r?n:void 0):(console.warn("BimWebSdk: request (objects/".concat(t,") does not support head method! Using get as fallback.")),e.request.get(e.getApiTeamUrl()+"objects/"+t,r?n:void 0))},this.getTopology=function(t,r,n,i,s){var o={};return(r||n||i)&&(o.queryParams={},r&&(o.queryParams.revision=r),n&&(o.queryParams.hideElements=n),i&&(o.queryParams.shortinfo=i)),s&&(o.responseBatch=s),e.request.get(e.getApiTeamUrl()+"objects/"+t+"/topology",o)},this.getGeometryThreeJS=function(t,r,n,i,s,o,u){var a,c=arguments.length>7&&void 0!==arguments[7]&&arguments[7],l=arguments.length>8&&void 0!==arguments[8]?arguments[8]:null,h=arguments.length>9&&void 0!==arguments[9]?arguments[9]:null,p={};return null===i&&null===s||(p.queryParams={},null!==i&&(p.queryParams.revision=i),null!==s&&(p.queryParams.levelofdetail=s)),u&&(p.responseBatch=u),a=r?e.getApiTeamUrl()+"objects/"+t+"/disciplines/"+r+"/geometries/threejs":e.getApiTeamUrl()+"objects/"+t+"/geometries/threejs",o&&(a+="/properties/",a+=o),n?e.request.getChunked(a,p,c,l,h):e.request.get(a,p)},this.getGeometryGLB=function(t,r,n,i,s,o,u,a,c){var l,h=arguments.length>9&&void 0!==arguments[9]&&arguments[9],p=arguments.length>10&&void 0!==arguments[10]?arguments[10]:void 0,f=arguments.length>11&&void 0!==arguments[11]?arguments[11]:null,d=arguments.length>12&&void 0!==arguments[12]?arguments[12]:null,g={};return g.dataType="binary",g.processData=!1,g.responseType="arraybuffer",g.useXMLHttpRequest=!0,void 0===n&&void 0===i&&void 0===s&&void 0===o&&void 0===u&&void 0===p||(g.queryParams={},void 0!==n&&(g.queryParams.revision=n),void 0!==i&&(g.queryParams.levelofdetail=i),void 0!==s&&(g.queryParams.vertexNormals=s),void 0!==o&&(g.queryParams.smoothingAngle=o),void 0!==u&&(g.queryParams.topology=u),void 0!==p&&(g.queryParams.edges=p)),a&&(g.responseBatch=a),l=r?e.getApiTeamUrl()+"objects/"+t+"/disciplines/"+r+"/geometries/glb":e.getApiTeamUrl()+"objects/"+t+"/geometries/glb",c?e.request.getChunked(l,g,h,f,d):e.request.get(l,g)},this.getGeometryTemplatesThreeJS=function(t,r,n,i,s,o){var u=arguments.length>6&&void 0!==arguments[6]&&arguments[6],a=arguments.length>7&&void 0!==arguments[7]?arguments[7]:null,c=arguments.length>8&&void 0!==arguments[8]?arguments[8]:null,l={};null===i&&null===s||(l.queryParams={},null!==i&&(l.queryParams.revision=i),null!==s&&(l.queryParams.levelofdetail=s)),o&&(l.responseBatch=o);var h=e.getApiTeamUrl()+"objects/"+t+"/disciplines/"+r+"/templates/threejs";return n?e.request.getChunked(h,l,u,a,c):e.request.get(h,l)},this.getGeometryCompressed=function(t,r){return r?e.request.get(e.getApiTeamUrl()+"objects/"+t+"/disciplines/"+r+"/geometries/meshblob"):e.request.get(e.getApiTeamUrl()+"objects/"+t+"/geometries/meshblob")},this.getProperties=function(t,r){return e.request.get(e.getApiTeamUrl()+"objects/"+t+"/geometries/threejs/properties"+r)},this.put=function(t,r,n){var i={};return n&&(i.projectid=n),e.request.put(e.getApiTeamUrl()+"objects/"+t,r,{queryParams:i})},this.postComment=function(t,r){return e.request.post(e.getApiTeamUrl()+"objects/"+t+"/comments",r)},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,r,n,i){return e.request.post(e.getApiTeamUrl()+"objects/"+t+"/attachments",r,{contentType:!1,processData:!1,dataType:null,xhrUploadProgress:n,queryParams:i?{DocumentFolderId:i}:void 0})},this.getAttachments=function(t,r){return e.request.get(e.getApiTeamUrl()+"objects/"+t+"/attachments",r?{queryParams:{revision:r}}:void 0)},this.deleteAttachments=function(t){return e.request.del(e.getApiTeamUrl()+"objects/"+t+"/attachments")},this.postAttachmentLink=function(t,r){return e.request.post(e.getApiTeamUrl()+"objects/"+t+"/attachmentlinks",r)},this.getAttachmentLinks=function(t){return e.request.get(e.getApiTeamUrl()+"objects/"+t+"/attachmentlinks")},this.deleteAttachmentLink=function(t,r){return e.request.del(e.getApiTeamUrl()+"objects/"+t+"/attachmentlinks/"+r)},this.postHyperlink=function(t,r){return e.request.post(e.getApiTeamUrl()+"objects/"+t+"/hyperlinks",r)},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,r,n,i){var s=r?"&documentversion="+r:"",o=i?"&revision="+i:"",u=n?"&projectid="+n:"",a=e.getApiTeamUrl()+"objects/"+t+"?freeattributes=true";return e.request.get(a+s+o+u)},this.getAttributesAsFlatStructure=function(t,r,n,i){var s=r?"&documentversion="+r:"",o=i?"&revision="+i:"",u=n?"&projectid="+n:"",a=e.getApiTeamUrl()+"objects/"+t+"?freeattributes=true&internal=true&attributedefinition=true";return e.request.get(a+s+o+u)},this.getAttributeValues=function(t,r){return e.request.get(e.getApiTeamUrl()+"objects/"+t+"/attributes/"+r+"?children=true")},this.getComplexPropertiesTopology=function(t,r){return e.request.get(e.getApiTeamUrl()+"objects/"+t+"/complexproperties"+(r>=0?"?revision="+r:""))},this.postThumbnail=function(t,r,n){return e.request.post(e.getApiTeamUrl()+"objects/"+t+"/thumbnail",r,{contentType:!1,processData:!1,dataType:null,xhrUploadProgress:n})},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,r,n){return e.request.get(e.getApiTeamUrl()+"objects/"+t+"/reports?version="+r+"&action="+n)},this.exportExcelReports=function(t,r){return e.request.post(e.getApiTeamUrl()+"projects/"+t+"/reports/export/excel",r)},this.postDimensions=function(t,r){return e.request.post(e.getApiTeamUrl()+"objects/"+t+"/dimensionlines",r)},this.putDimensions=function(t,r){return e.request.put(e.getApiTeamUrl()+"objects/"+t+"/dimensionlines",r)},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,r){return e.request.post(e.getApiTeamUrl()+"objects/"+t+"/labels",r)},this.putLabels=function(t,r){return e.request.put(e.getApiTeamUrl()+"objects/"+t+"/labels",r)},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,r){return e.request.post(e.getApiTeamUrl()+"objects/"+t+"/annotations",r)},this.putAnnotations=function(t,r){return e.request.put(e.getApiTeamUrl()+"objects/"+t+"/annotations",r)},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")},this.getObjectIdsByQuery=function(t,r,n,i){var s=Array.isArray(i)?i.join(","):void 0,o={queryParams:{}};return o.queryParams[r]=n,s&&(o.queryParams.divisions=s),e.request.get(e.getApiTeamUrl()+"objects/"+t+"/query",o)},this.getObjectIdsByIfcId=function(e,t,r){return this.getObjectIdsByQuery(e,"93027bad-df91-48ee-a0bb-60a8184cddba",t,r)}},Ps=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,r){return e.request.put(e.getApiTeamUrl()+"pins/"+t,r)}},Es=function(e){this.get=function(){return e.request.get(e.getApiUrl()+"project-actions-rights/")}},Os=function(e){var t="projectattributetemplates";this.post=function(r){return e.request.post(e.getApiTeamUrl()+t,r)},this.get=function(r,n){var i=n?{queryParams:{default:n}}:null;return r?e.request.get(e.getApiTeamUrl()+t+"/"+r):e.request.get(e.getApiTeamUrl()+t,i)},this.put=function(r,n){return e.request.put(e.getApiTeamUrl()+t+"/"+r,n)},this.delete=function(r){return e.request.del(e.getApiTeamUrl()+t+"/"+r)},this.copyFrom=function(r,n){return e.request.put(e.getApiTeamUrl()+t+"/"+n+"/copyfrom",JSON.stringify({id:r}))},this.setDefault=function(r){return e.request.put(e.getApiTeamUrl()+t+"/"+r+"/default")}};function Ds(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var n,i,s,o,u=[],a=!0,c=!1;try{if(s=(r=r.call(e)).next,0===t){if(Object(r)!==r)return;a=!1}else for(;!(a=(n=s.call(r)).done)&&(u.push(n.value),u.length!==t);a=!0);}catch(e){c=!0,i=e}finally{try{if(!a&&null!=r.return&&(o=r.return(),Object(o)!==o))return}finally{if(c)throw i}}return u}}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return Cs(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);"Object"===r&&e.constructor&&(r=e.constructor.name);if("Map"===r||"Set"===r)return Array.from(e);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return Cs(e,t)}(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 Cs(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}var Is=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,r){return e.request.put(e.getApiTeamUrl()+"projects/"+t,r)},this.get=function(t,r,n,i,s){var o={queryParams:s||{}};return r&&(o.queryParams.disciplines=!1),i&&(o.queryParams.recycleBin=!0),t?e.request.get(e.getApiTeamUrl()+"projects/"+t,o):n?e.request.get(e.getApiUrl()+n+"/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,r,n){return r||(r="00000000-0000-0000-0000-000000000000"),n>=0&&""!==n||(n="100"),e.request.del(e.getApiTeamUrl()+"temporary/projects/"+t+"/disciplines/"+r+"/levelofdetails/"+n)},this.getModels=function(t){return e.request.get(e.getApiTeamUrl()+"projects/"+t+"/divisions")},this.postModel=function(t,r){return e.request.post(e.getApiTeamUrl()+"projects/"+t+"/divisions",r)},this.getMembers=function(t){return e.request.get(e.getApiTeamUrl()+"projects/"+t+"/members")},this.postMember=function(t,r){return e.request.post(e.getApiTeamUrl()+"projects/"+t+"/members",r)},this.putMember=function(t,r){return e.request.put(e.getApiTeamUrl()+"projects/"+t+"/members",r)},this.deleteMember=function(t,r){return e.request.del(e.getApiTeamUrl()+"projects/"+t+"/members",r)},this.getPins=function(t){return e.request.get(e.getApiTeamUrl()+"projects/"+t+"/pins")},this.putProject=function(t,r){return e.request.put(e.getApiTeamUrl()+"projects/"+t,r)},this.postAttachment=function(t,r){return e.request.post(e.getApiTeamUrl()+"projects/"+t+"/attachments",r)},this.getAttachments=function(t,r,n){var i=n;return i||(i={}),r&&(i.revision=r),e.request.get(e.getApiTeamUrl()+"projects/"+t+"/attachments",r||n?{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,r,n){return e.request.post(e.getApiTeamUrl()+"projects/"+t+"/thumbnail",r,{contentType:!1,processData:!1,dataType:null,xhrUploadProgress:n})},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,r){return e.request.get(e.getApiTeamUrl()+"projects/"+t+"/issues"+(r?"?scene=false":""))},this.getIssuesShortInfo=function(t){var r=function(){var e=Ds((new Date).toString().split("GMT"),2),t=e[0],r=e[1];if(!t||!r)return"";var n=new Date(t+"UTC").toISOString().split(".")[0],i=(r=r.split(" ")[0]).slice(0,3)+":"+r.slice(3);return n&&i?n+i:""}();return e.request.get(e.getApiTeamUrl()+"projects/"+t+"/issues?shortinfo=true"+(r?"¤ttime="+r:""))},this.postSlideshow=function(t,r){return e.request.post(e.getApiTeamUrl()+"projects/"+t+"/slideshows",r)},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,r){var n={slideShowId:r};return e.request.post(e.getApiTeamUrl()+"projects/"+t+"/slideshow/export/pdf",JSON.stringify(n))},this.getProjectInfo=function(t,r){var n={queryParams:r||{}};return e.request.get(e.getApiTeamUrl()+"projects/"+t,n)}},Rs=function(e){this.postRevision=function(t,r){return e.request.post(e.getApiTeamUrl()+"divisions/"+t+"/revisions",r)},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,r){return e.request.post(e.getApiTeamUrl()+"revisions/"+t,r)},this.putRevisionInfo=function(t,r){return e.request.put(e.getApiTeamUrl()+"revisions/"+t,r)},this.getRevisionsComparisonResult=function(t,r,n,i){return e.request.get(e.getApiTeamUrl()+"divisions/"+t+"/revisionscomparison/"+r+"/"+n,i)},this.compareRevisions=function(t,r,n,i){return e.request.post(e.getApiTeamUrl()+"divisions/"+t+"/revisionscomparison/"+r+"/"+n,null,i)},this.excelExportRevisionsComparisonResult=function(t,r,n,i){return e.request.post(e.getApiTeamUrl()+"divisions/"+t+"/revisionscomparison/"+r+"/"+n+"/export/excel",i)}},Bs=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,r){return e.request.post(e.getApiTeamUrl()+"projects/"+t+"/members",r)},this.putUserRole=function(t,r){return e.request.put(e.getApiTeamUrl()+"projects/"+t+"/members",r)},this.deleteUser=function(t){return e.request.del(e.getApiTeamUrl()+"projects/"+t+"/members")}},Ls=function(e){this.get=function(t,r){if(t||r){var n={queryParams:{}};return void 0!==t&&(n.queryParams.rights=t),void 0!==r&&(n.queryParams.customrole=r),e.request.get(e.getApiTeamUrl()+"roles/",n)}return e.request.get(e.getApiTeamUrl()+"roles/")},this.getAllRights=function(t){if(t){var r={queryParams:{globalfreeattributes:t.globalfreeattributes,global:t.global,project:t.project,document:t.document,layer:t.layer}};return e.request.get(e.getApiTeamUrl()+"rights",r)}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,r){return e.request.put(e.getApiTeamUrl()+"roles/"+t,r)},this.deleteRole=function(t){return e.request.del(e.getApiTeamUrl()+"roles/"+t)}},Ks=function(e){this.calculateCutSection=function(t){var r=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n={cuttingCalculation:{projectId:t.projectId,cuttingPlanes:t.cuttingPlanes,selection:{modelLayer:t.modelLayer,topologyNodes:t.topologyNodes,hiddenObjects:t.hiddenObjects},settings:t.settings},runAsync:r};if(n.cuttingCalculation.settings&&n.cuttingCalculation.settings.responseGeometry&&"glb"===n.cuttingCalculation.settings.responseGeometry){return e.request.post(e.getApiTeamUrl()+"services/CuttingCalculation",JSON.stringify(n),{useXMLHttpRequest:!0,dataType:"binary",processData:!1,responseType:"arraybuffer"})}return e.request.post(e.getApiTeamUrl()+"services/CuttingCalculation",JSON.stringify(n))}},Ns=function(e){this.post=function(t){return e.request.post(e.getApiTeamUrl()+"share",t)}},Ms=function(e){this.get=function(t){return e.request.get(e.getApiTeamUrl()+"slides/"+t)},this.put=function(t,r){return e.request.put(e.getApiTeamUrl()+"slides/"+t,r)},this.delete=function(t){return e.request.del(e.getApiTeamUrl()+"slides/"+t)},this.postThumbnail=function(t,r){return e.request.post(e.getApiTeamUrl()+"slides/"+t+"/thumbnail",r)}},Fs=function(e){this.get=function(t){return e.request.get(e.getApiTeamUrl()+"slideshows/"+t)},this.put=function(t,r){return e.request.put(e.getApiTeamUrl()+"slideshows/"+t,r)},this.delete=function(t){return e.request.del(e.getApiTeamUrl()+"slideshows/"+t)},this.postSlide=function(t,r){return e.request.post(e.getApiTeamUrl()+"slideshows/"+t+"/slides",r)},this.getSlides=function(t){return e.request.get(e.getApiTeamUrl()+"slideshows/"+t+"/slides")},this.postThumbnail=function(t,r){return e.request.post(e.getApiTeamUrl()+"slideshows/"+t+"/thumbnail",r)},this.getThumbnail=function(t){return e.request.get(e.getApiTeamUrl()+"thumbnail/"+t)}},Gs=function(e){this.postStructure=function(t,r){return e.request.post(e.getApiTeamUrl()+"projects/"+t+"/structures",r)},this.postStructureTopology=function(t,r){return e.request.post(e.getApiTeamUrl()+"structures/"+t+"/topology",r)},this.postSubNode=function(t,r){return e.request.post(e.getApiTeamUrl()+"structures/"+t,r)},this.postAssignedObject=function(t,r,n,i){return e.request.post(e.getApiTeamUrl()+"structures/"+t+"/assign/"+r+"?varianttype="+n,i)},this.attributeAssign=function(t,r,n,i){var s={attributeId:n};return i&&(s.variantType=i),e.request.put(e.getApiTeamUrl()+"projects/"+t+"/structures/"+r+"/attributeassign",JSON.stringify(s))},this.deleteAssignedObject=function(t,r,n,i){var s=[i?"removeAllNodes=true":"",n?"varianttype=true":""].filter((function(e){return e})).join("&");return e.request.del(e.getApiTeamUrl()+"structures/"+t+"/delete/"+r+"?"+s)},this.getStructure=function(t,r,n){return r?e.request.get(e.getApiTeamUrl()+"structures/"+r):e.request.get(e.getApiTeamUrl()+"projects/"+t+"/structures"+(n?"?type="+n:""))},this.getTopology=function(t,r,n){return void 0===n||""===n?e.request.get(e.getApiTeamUrl()+"structures/"+t+"/topology?varianttype="+r):!0===n?e.request.get(e.getApiTeamUrl()+"structures/"+t+"/topology?varianttype="+r+"&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,r,n){return e.request.post(e.getApiTeamUrl()+"structures/"+t+"/copy?elementRelation="+n+"&attributes=true",r)},this.putStructure=function(t,r,n){var i=n?"?applyToChild=true":"";return e.request.put(e.getApiTeamUrl()+"structures/"+t+i,r)},this.reorderStructure=function(t,r){return e.request.put(e.getApiTeamUrl()+"structures/"+t+"/reorder?varianttype="+r)},this.deleteStructure=function(t,r,n){return n?e.request.del(e.getApiTeamUrl()+"structures/"+t+"?forceDelete=true"):r?e.request.del(e.getApiTeamUrl()+"structures/"+t+"?deleteAll=true"):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,r){return e.request.post(e.getApiTeamUrl()+"projects/"+t+"/variants",r)},this.getVariantType=function(t,r){return r?e.request.get(e.getApiTeamUrl()+"projects/"+t+"/variants/"+r):e.request.get(e.getApiTeamUrl()+"projects/"+t+"/variants")},this.deleteVariantType=function(t,r){return e.request.del(e.getApiTeamUrl()+"projects/"+t+"/variants/"+r)},this.copyElementsToVariant=function(t,r,n){return e.request.put(e.getApiTeamUrl()+"projects/"+t+"/variants/"+r+"/copyfrom",n)}},Ws=function(e){this.get=function(){return e.request.get(e.getApiUrl()+"team-actions-rights/")}},Hs=function(e){this.get=function(t,r){var n={queryParams:{}};return r&&(n.queryParams.filterEmpty=r),t?e.request.get(e.getApiUrl()+"teams/"+t,n):e.request.get(e.getApiUrl()+"teams",n)},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")}},$s=function(e){this.get=function(t,r){var n={language:t};return r&&(n.type=r),e.request.get(e.getApiUrl()+"terms/download",{queryParams:n,dataType:"html"})}},Vs=function(e){this.get=function(t,r){var n={language:t};return r&&(n.type=r),e.request.get(e.getApiUrl()+"dataprotectiondeclarations/download",{queryParams:n,dataType:"html"})},this.getForbiddenEmails=function(){return e.request.get(e.getApiUrl()+"/restrictedemails")}},zs=function(e){this.get=function(t,r){var n={language:t};return r&&(n.type=r),e.request.get(e.getApiUrl()+"imprints/download",{queryParams:n,dataType:"html"})}},Js=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,r){return e.request.put(e.getApiUrl()+"content/units/"+t,r)},this.delete=function(t){return e.request.del(e.getApiUrl()+"content/units/"+t)}},Qs=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,r,n){var i=e.getApiUrl()+"user/";return t&&(i+=t),n?e.request.put(i,r,{token:n}):e.request.put(i,r)},this.setPassword=function(t,r,n){var i=e.getApiUrl()+"user/set_password";return t&&(i+=t),n?e.request.put(i,r,{token:n}):e.request.put(i,r)},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")}},Xs=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,r){return e.request.put(e.getApiUrl()+"users/"+t,r)},this.delete=function(t){return e.request.del(e.getApiUrl()+"users/"+t)},this.setSubscriptions=function(t,r){return e.request.post(e.getApiUrl()+"administration/users/"+t+"/accountsettings",r)}},Ys=function(e){this.postSettings=function(t,r){return e.request.post(e.getApiTeamUrl()+"userSettings/"+t,r)},this.getSettings=function(t){return e.request.get(e.getApiTeamUrl()+"userSettings/"+t)}},Zs=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,r){return e.request.put(e.getApiTeamUrl()+"invitations/"+t,r)},this.accept=function(t,r){return e.request.put(e.getApiUrl()+"invitations/"+t+"/accept",r)},this.getInvitation=function(t,r){return e.request.get(e.getApiUrl()+"invitations/"+t,r)}},eo=function(e){this.post=function(t,r){return e.request.post(e.getApiTeamUrl()+"projects/"+t+"/selections",r)},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)}},to=function(e){this.postGroup=function(t,r){return e.request.post(e.getApiTeamUrl()+"projects/"+t+"/usergroups",r)},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,r){return e.request.put(e.getApiTeamUrl()+"usergroups/"+t,r)},this.assignUser=function(t,r){return e.request.put(e.getApiTeamUrl()+"usergroups/"+t+"/assign",r)},this.removeUser=function(t,r){return e.request.put(e.getApiTeamUrl()+"usergroups/"+t+"/remove",r)}},ro=function(e){this.get=function(t){return e.request.get(e.getApiTeamUrl()+"scenes/"+t)},this.getObjectScenes=function(t,r){var n={};r&&(n.queryParams={shortInfo:r});var i=e.getApiTeamUrl()+"objects/"+t+"/scenes";return e.request.get(i,n)},this.post=function(t,r){return e.request.post(e.getApiTeamUrl()+"objects/"+t+"/scenes",r)},this.delete=function(t){return e.request.del(e.getApiTeamUrl()+"scenes/"+t)},this.put=function(t,r){return e.request.put(e.getApiTeamUrl()+"scenes/"+t,r)},this.postThumbnailAttachment=function(t,r,n,i){return e.request.post(e.getApiTeamUrl()+"objects/"+t+"/attachments",r,{contentType:!1,processData:!1,dataType:null,xhrUploadProgress:n,queryParams:i?{attachmenttype:"thumbnailhighresolution"}:void 0})},this.postThumbnail=function(t,r,n){return e.request.post(e.getApiTeamUrl()+"objects/"+t+"/attachments",r,{queryParams:n?{attachmenttype:"thumbnailhighresolution"}:void 0})},this.getThumbnail=function(t){return e.request.get(e.getApiTeamUrl()+"objects/"+t+"/attachments")}},no=function(e){this.post=function(t){return e.request.post(e.getApiTeamUrl()+"services/BaseQuantities",JSON.stringify(t))}},io=function(e){this.createWorkflowTemplateFolder=function(t,r){return e.request.post(e.getApiTeamUrl()+"structures/"+t,r)},this.putWorkflowTemplateFolder=function(t,r){return e.request.put(e.getApiTeamUrl()+"structures/"+t,r)},this.postWorkflowTemplate=function(t,r){return e.request.post(e.getApiTeamUrl()+"projects/"+t+"/workflowtemplates",r)},this.putWorkflowTemplate=function(t,r){return e.request.put(e.getApiTeamUrl()+"workflowtemplates/"+t,r)},this.getWorkflowTemplate=function(t){return e.request.get(e.getApiTeamUrl()+"workflowtemplates/"+t)},this.getWorkflowTemplateRoot=function(t){return e.request.get(e.getApiTeamUrl()+"projects/"+t+"/structures?type=IsoWorkflowStructure")},this.getWorkflowTemplateStructure=function(t){return e.request.get(e.getApiTeamUrl()+"structures/"+t+"/topology")},this.getAllWorkflowTemplates=function(t){return e.request.get(e.getApiTeamUrl()+"projects/"+t+"/workflowtemplates")},this.deleteWorkflowTemplate=function(t){return e.request.del(e.getApiTeamUrl()+"workflowtemplates/"+t)},this.getWorkflowTemplateInfo=function(t){return e.request.get(e.getApiTeamUrl()+"workflowtemplates/"+t)},this.initializeWorkflowTemplate=function(t,r){return e.request.post(e.getApiTeamUrl()+"projects/"+t+"/workflows",r)},this.getAllWorkflows=function(t,r){var n={queryParams:{}};return n.queryParams.status=r,e.request.get(e.getApiTeamUrl()+"projects/"+t+"/workflows",n)},this.getWorkflow=function(t){return e.request.get(e.getApiTeamUrl()+"workflows/"+t)},this.deleteWorkflow=function(t){return e.request.del(e.getApiTeamUrl()+"workflows/"+t)},this.putWorkflow=function(t){return e.request.put(e.getApiTeamUrl()+"workflows/"+t.id,t)},this.submitReview=function(t){return e.request.put(e.getApiTeamUrl()+"workflows/"+t.id+"/?submit=true",t)},this.getStep=function(t){return e.request.put(e.getApiTeamUrl()+"workflows/"+t)},this.submitStep=function(t,r){return e.request.put(e.getApiTeamUrl()+"steps/"+t+"/?submit=true",r)},this.saveStep=function(t,r){return e.request.put(e.getApiTeamUrl()+"steps/"+t+"/?submit=false",r)},this.cancelWorkflow=function(t){return e.request.put(e.getApiTeamUrl()+"workflows/"+t+"/cancel")}},so=function(e){this._config=null,e?(void 0===e.version&&(e.version="v2"),this._config=e):this._config=oo(),this._token=null,this._tokenType=null,this._teamSlug=null,this._cache=null,window.BIMPLUS_SDK_ENABLE_DEBUG_LOGS&&console.log("BimWebSdk: config = ",this._config),this._config.cache?(this.request=new us,this._cache=this.request.getCache(),!1===this._cache.isSupported()&&(console.warn("Warning: Caching requested but not supported by browser! Falling back to uncached requests."),this.request=new nt,this._cache=null)):this.request=new nt,this.setAccessToken=function(e){this._token=e,this.request.setAccessToken(e),window.BIMPLUS_SDK_ENABLE_DEBUG_LOGS&&console.log("BimWebSdk: token was set to "+this._token)},this.getAccessToken=function(){return this._token},this.setTokenType=function(e){this._tokenType=e,this.request.setTokenType(e),window.BIMPLUS_SDK_ENABLE_DEBUG_LOGS&&console.log("BimWebSdk: token type was set to "+this._tokenType)},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&&console.log("BimWebSdk: team slug was set to "+this._teamSlug)},this.getTeamSlug=function(){return this._teamSlug},this.getApiUrl=function(){return this._config.protocol+this._config.host+"/"+(this._config.version?this._config.version+"/":"")},this.getApiTeamUrl=function(){return this._teamSlug||console.error("Error: Teamslug not set"),this.getApiUrl()+this._teamSlug+"/"},this.getCache=function(){return this._cache},this.authorize=new at(this),this.user=new Qs(this),this.users=new Xs(this),this.teams=new Hs(this),this.members=new _s(this),this.projects=new Is(this),this.structures=new Gs(this),this.models=new ks(this),this.objects=new Ss(this),this.revisions=new Rs(this),this.elementTypes=new fs(this),this.annotations=new st(this),this.attachments=new ot(this),this.issues=new Ts(this),this.labels=new As(this),this.pins=new Ps(this),this.comments=new ls(this),this.hyperlinks=new bs(this),this.importService=new ws(this),this.slideshows=new Fs(this),this.slides=new Ms(this),this.clashDetection=new as(this),this.clientLogs=new cs(this),this.rightsService=new Bs(this),this.applicationSettings=new it(this),this.exportService=new ds(this),this.folders=new gs(this),this.locks=new qs(this),this.share=new Ns(this),this.messages=new Us(this),this.objectFilters=new js(this),this.terms=new $s(this),this.dataProtection=new Vs(this),this.dimensions=new ps(this),this.imprints=new zs(this),this.projectActionsRights=new Es(this),this.roles=new Ls(this),this.attributeTemplates=new ut(this),this.units=new Js(this),this.freeAttributes=new ys(this),this.freeAttributeGroups=new ms(this),this.hiddenCalculation=new vs(this),this.sectionCut=new Ks(this),this.projectAttributeTemplates=new Os(this),this.teamActionsRights=new Ws(this),this.customTables=new hs(this),this.userSettings=new Ys(this),this.invitations=new Zs(this),this.selections=new eo(this),this.userGroups=new to(this),this.scenes=new ro(this),this.baseQuantities=new no(this),this.workflows=new io(this)},oo=function(e){var t="api.bimplus.net";if(e)switch(e){case"prod":default:t="api.bimplus.net";break;case"dev":t="api-dev.bimplus.net";break;case"stage":t="api-stage.bimplus.net"}return{protocol:"https://",host:t,cache:!1,version:"v2"}};return t})()));
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "bimplus-websdk",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.227-nonblocking-load.1",
|
|
4
4
|
"description": "bim+ websdk",
|
|
5
5
|
"main": "dist/bimplus-websdk.js",
|
|
6
6
|
"license": "MIT",
|
|
@@ -29,18 +29,18 @@
|
|
|
29
29
|
"test-watch": "npm run test -- --browsers=Chrome --single-run=false --auto-watch"
|
|
30
30
|
},
|
|
31
31
|
"devDependencies": {
|
|
32
|
-
"@babel/core": "^7.21.
|
|
33
|
-
"@babel/plugin-transform-runtime": "^7.21.
|
|
34
|
-
"@babel/preset-env": "^7.
|
|
32
|
+
"@babel/core": "^7.21.4",
|
|
33
|
+
"@babel/plugin-transform-runtime": "^7.21.4",
|
|
34
|
+
"@babel/preset-env": "^7.21.4",
|
|
35
35
|
"@babel/runtime": "^7.21.0",
|
|
36
36
|
"babel-loader": "^9.1.2",
|
|
37
37
|
"clean-webpack-plugin": "^4.0.0",
|
|
38
38
|
"coverage-istanbul-loader": "^3.0.5",
|
|
39
39
|
"documentation": "^14.0.1",
|
|
40
|
-
"eslint": "^8.
|
|
40
|
+
"eslint": "^8.39.0",
|
|
41
41
|
"host-environment": "^2.1.2",
|
|
42
|
-
"karma": "^6.4.
|
|
43
|
-
"karma-chrome-launcher": "^3.
|
|
42
|
+
"karma": "^6.4.2",
|
|
43
|
+
"karma-chrome-launcher": "^3.2.0",
|
|
44
44
|
"karma-coverage-istanbul-reporter": "^3.0.2",
|
|
45
45
|
"karma-firefox-launcher": "^2.1.2",
|
|
46
46
|
"karma-host-environment": "^3.0.3",
|
|
@@ -48,12 +48,13 @@
|
|
|
48
48
|
"karma-qunit": "^4.1.1",
|
|
49
49
|
"karma-webpack": "^5.0.0",
|
|
50
50
|
"qunit": "^2.19.4",
|
|
51
|
-
"terser-webpack-plugin": "^5.3.
|
|
52
|
-
"webpack": "^5.
|
|
53
|
-
"webpack-cli": "^5.0.
|
|
51
|
+
"terser-webpack-plugin": "^5.3.7",
|
|
52
|
+
"webpack": "^5.80.0",
|
|
53
|
+
"webpack-cli": "^5.0.2"
|
|
54
54
|
},
|
|
55
55
|
"dependencies": {
|
|
56
56
|
"dexie": "3.2.3",
|
|
57
|
-
"
|
|
57
|
+
"async": "^3.2.4",
|
|
58
|
+
"jquery": "3.6.4"
|
|
58
59
|
}
|
|
59
60
|
}
|