bimplus-websdk 1.0.59 → 1.0.60

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.
@@ -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,(()=>(()=>{var e={744(e,t,n){e.exports=function(){"use strict";var e=function(t,n){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])})(t,n)},t=function(){return(t=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e}).apply(this,arguments)};function r(e,t,n){if(n||2===arguments.length)for(var r,i=0,o=t.length;i<o;i++)!r&&i in t||((r=r||Array.prototype.slice.call(t,0,i))[i]=t[i]);return e.concat(r||Array.prototype.slice.call(t))}var i="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:"undefined"!=typeof window?window:n.g,o=Object.keys,s=Array.isArray;function u(e,t){return"object"!=typeof t||o(t).forEach((function(n){e[n]=t[n]})),e}"undefined"==typeof Promise||i.Promise||(i.Promise=Promise);var a=Object.getPrototypeOf,c={}.hasOwnProperty;function l(e,t){return c.call(e,t)}function f(e,t){"function"==typeof t&&(t=t(a(e))),("undefined"==typeof Reflect?o:Reflect.ownKeys)(t).forEach((function(n){h(e,n,t[n])}))}var p=Object.defineProperty;function h(e,t,n,r){p(e,t,u(n&&l(n,"get")&&"function"==typeof n.get?{get:n.get,set:n.set,configurable:!0}:{value:n,configurable:!0,writable:!0},r))}function d(e){return{from:function(t){return e.prototype=Object.create(t.prototype),h(e.prototype,"constructor",e),{extend:f.bind(null,e.prototype)}}}}var g=Object.getOwnPropertyDescriptor,m=[].slice;function y(e,t,n){return m.call(e,t,n)}function v(e,t){return t(e)}function b(e){if(!e)throw new Error("Assertion Failed")}function w(e){i.setImmediate?setImmediate(e):setTimeout(e,0)}function T(e,t){if("string"==typeof t&&l(e,t))return e[t];if(!t)return e;if("string"!=typeof t){for(var n=[],r=0,i=t.length;r<i;++r){var o=T(e,t[r]);n.push(o)}return n}var s=t.indexOf(".");if(-1!==s){var u=e[t.substr(0,s)];return null==u?void 0:T(u,t.substr(s+1))}}function A(e,t,n){if(e&&void 0!==t&&(!("isFrozen"in Object)||!Object.isFrozen(e)))if("string"!=typeof t&&"length"in t){b("string"!=typeof n&&"length"in n);for(var r=0,i=t.length;r<i;++r)A(e,t[r],n[r])}else{var o,u,a=t.indexOf(".");-1!==a?(o=t.substr(0,a),""===(u=t.substr(a+1))?void 0===n?s(e)&&!isNaN(parseInt(o))?e.splice(o,1):delete e[o]:e[o]=n:A(a=(a=e[o])&&l(e,o)?a:e[o]={},u,n)):void 0===n?s(e)&&!isNaN(parseInt(t))?e.splice(t,1):delete e[t]:e[t]=n}}function q(e){var t,n={};for(t in e)l(e,t)&&(n[t]=e[t]);return n}var _=[].concat;function U(e){return _.apply([],e)}var k="BigUint64Array,BigInt64Array,Array,Boolean,String,Date,RegExp,Blob,File,FileList,FileSystemFileHandle,FileSystemDirectoryHandle,ArrayBuffer,DataView,Uint8ClampedArray,ImageBitmap,ImageData,Map,Set,CryptoKey".split(",").concat(U([8,16,32,64].map((function(e){return["Int","Uint","Float"].map((function(t){return t+e+"Array"}))})))).filter((function(e){return i[e]})),j=new Set(k.map((function(e){return i[e]}))),S=null;function P(e){return S=new WeakMap,e=function e(t){if(!t||"object"!=typeof t)return t;var n=S.get(t);if(n)return n;if(s(t)){n=[],S.set(t,n);for(var r=0,i=t.length;r<i;++r)n.push(e(t[r]))}else if(j.has(t.constructor))n=t;else{var o,u=a(t);for(o in n=u===Object.prototype?{}:Object.create(u),S.set(t,n),t)l(t,o)&&(n[o]=e(t[o]))}return n}(e),S=null,e}var x={}.toString;function O(e){return x.call(e).slice(8,-1)}var E="undefined"!=typeof Symbol?Symbol.iterator:"@@iterator",D="symbol"==typeof E?function(e){var t;return null!=e&&(t=e[E])&&t.apply(e)}:function(){return null};function C(e,t){return 0<=(t=e.indexOf(t))&&e.splice(t,1),0<=t}var I={};function R(e){var t,n,r,i;if(1===arguments.length){if(s(e))return e.slice();if(this===I&&"string"==typeof e)return[e];if(i=D(e)){for(n=[];!(r=i.next()).done;)n.push(r.value);return n}if(null==e)return[e];if("number"!=typeof(t=e.length))return[e];for(n=new Array(t);t--;)n[t]=e[t];return n}for(t=arguments.length,n=new Array(t);t--;)n[t]=arguments[t];return n}var B="undefined"!=typeof Symbol?function(e){return"AsyncFunction"===e[Symbol.toStringTag]}:function(){return!1},K=["Modify","Bulk","OpenFailed","VersionChange","Schema","Upgrade","InvalidTable","MissingAPI","NoSuchDatabase","InvalidArgument","SubTransaction","Unsupported","Internal","DatabaseClosed","PrematureCommit","ForeignAwait"].concat(ae=["Unknown","Constraint","Data","TransactionInactive","ReadOnly","Version","NotFound","InvalidState","InvalidAccess","Abort","Timeout","QuotaExceeded","Syntax","DataClone"]),N={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 M(e,t){this.name=e,this.message=t}function F(e,t){return e+". Errors: "+Object.keys(t).map((function(e){return t[e].toString()})).filter((function(e,t,n){return n.indexOf(e)===t})).join("\n")}function L(e,t,n,r){this.failures=t,this.failedKeys=r,this.successCount=n,this.message=F(e,t)}function G(e,t){this.name="BulkError",this.failures=Object.keys(t).map((function(e){return t[e]})),this.failuresByPos=t,this.message=F(e,this.failures)}d(M).from(Error).extend({toString:function(){return this.name+": "+this.message}}),d(L).from(M),d(G).from(M);var z=K.reduce((function(e,t){return e[t]=t+"Error",e}),{}),W=M,H=K.reduce((function(e,t){var n=t+"Error";function r(e,r){this.name=n,e?"string"==typeof e?(this.message="".concat(e).concat(r?"\n "+r:""),this.inner=r||null):"object"==typeof e&&(this.message="".concat(e.name," ").concat(e.message),this.inner=e):(this.message=N[t]||n,this.inner=null)}return d(r).from(W),e[t]=r,e}),{});H.Syntax=SyntaxError,H.Type=TypeError,H.Range=RangeError;var V=ae.reduce((function(e,t){return e[t+"Error"]=H[t],e}),{}),$=K.reduce((function(e,t){return-1===["Syntax","Type","Range"].indexOf(t)&&(e[t+"Error"]=H[t]),e}),{});function Q(){}function J(e){return e}function X(e,t){return null==e||e===J?t:function(n){return t(e(n))}}function Y(e,t){return function(){e.apply(this,arguments),t.apply(this,arguments)}}function Z(e,t){return e===Q?t:function(){var n=e.apply(this,arguments);void 0!==n&&(arguments[0]=n);var r=this.onsuccess,i=this.onerror;this.onsuccess=null,this.onerror=null;var o=t.apply(this,arguments);return r&&(this.onsuccess=this.onsuccess?Y(r,this.onsuccess):r),i&&(this.onerror=this.onerror?Y(i,this.onerror):i),void 0!==o?o:n}}function ee(e,t){return e===Q?t:function(){e.apply(this,arguments);var n=this.onsuccess,r=this.onerror;this.onsuccess=this.onerror=null,t.apply(this,arguments),n&&(this.onsuccess=this.onsuccess?Y(n,this.onsuccess):n),r&&(this.onerror=this.onerror?Y(r,this.onerror):r)}}function te(e,t){return e===Q?t:function(n){var r=e.apply(this,arguments);u(n,r);var i=this.onsuccess,o=this.onerror;return this.onsuccess=null,this.onerror=null,n=t.apply(this,arguments),i&&(this.onsuccess=this.onsuccess?Y(i,this.onsuccess):i),o&&(this.onerror=this.onerror?Y(o,this.onerror):o),void 0===r?void 0===n?void 0:n:u(r,n)}}function ne(e,t){return e===Q?t:function(){return!1!==t.apply(this,arguments)&&e.apply(this,arguments)}}function re(e,t){return e===Q?t:function(){var n=e.apply(this,arguments);if(n&&"function"==typeof n.then){for(var r=this,i=arguments.length,o=new Array(i);i--;)o[i]=arguments[i];return n.then((function(){return t.apply(r,o)}))}return t.apply(this,arguments)}}$.ModifyError=L,$.DexieError=M,$.BulkError=G;var ie="undefined"!=typeof location&&/^(http|https):\/\/(localhost|127\.0\.0\.1)/.test(location.href);function oe(e){ie=e}var se={},ue=100,ae=(k="undefined"==typeof Promise?[]:function(){var e=Promise.resolve();if("undefined"==typeof crypto||!crypto.subtle)return[e,a(e),e];var t=crypto.subtle.digest("SHA-512",new Uint8Array([0]));return[t,a(t),e]}(),k[0]),ce=(K=k[1],k=k[2],K=K&&K.then,ae&&ae.constructor),le=!!k,fe=function(e,t){be.push([e,t]),he&&(queueMicrotask(Pe),he=!1)},pe=!0,he=!0,de=[],ge=[],me=J,ye={id:"global",global:!0,ref:0,unhandleds:[],onunhandled:Q,pgp:!1,env:{},finalize:Q},ve=ye,be=[],we=0,Te=[];function Ae(e){if("object"!=typeof this)throw new TypeError("Promises must be constructed via new");this._listeners=[],this._lib=!1;var t=this._PSD=ve;if("function"!=typeof e){if(e!==se)throw new TypeError("Not a function");return this._state=arguments[1],this._value=arguments[2],void(!1===this._state&&Ue(this,this._value))}this._state=null,this._value=null,++t.ref,function e(t,n){try{n((function(n){if(null===t._state){if(n===t)throw new TypeError("A promise cannot be resolved with itself.");var r=t._lib&&xe();n&&"function"==typeof n.then?e(t,(function(e,t){n instanceof Ae?n._then(e,t):n.then(e,t)})):(t._state=!0,t._value=n,ke(t)),r&&Oe()}}),Ue.bind(null,t))}catch(n){Ue(t,n)}}(this,e)}var qe={get:function(){var e=ve,t=Ne;function n(n,r){var i=this,o=!e.global&&(e!==ve||t!==Ne),s=o&&!Ge(),u=new Ae((function(t,u){je(i,new _e(Qe(n,e,o,s),Qe(r,e,o,s),t,u,e))}));return this._consoleTask&&(u._consoleTask=this._consoleTask),u}return n.prototype=se,n},set:function(e){h(this,"then",e&&e.prototype===se?qe:{get:function(){return e},set:qe.set})}};function _e(e,t,n,r,i){this.onFulfilled="function"==typeof e?e:null,this.onRejected="function"==typeof t?t:null,this.resolve=n,this.reject=r,this.psd=i}function Ue(e,t){var n,r;ge.push(t),null===e._state&&(n=e._lib&&xe(),t=me(t),e._state=!1,e._value=t,r=e,de.some((function(e){return e._value===r._value}))||de.push(r),ke(e),n&&Oe())}function ke(e){var t=e._listeners;e._listeners=[];for(var n=0,r=t.length;n<r;++n)je(e,t[n]);var i=e._PSD;--i.ref||i.finalize(),0===we&&(++we,fe((function(){0==--we&&Ee()}),[]))}function je(e,t){if(null!==e._state){var n=e._state?t.onFulfilled:t.onRejected;if(null===n)return(e._state?t.resolve:t.reject)(e._value);++t.psd.ref,++we,fe(Se,[n,e,t])}else e._listeners.push(t)}function Se(e,t,n){try{var r,i=t._value;!t._state&&ge.length&&(ge=[]),r=ie&&t._consoleTask?t._consoleTask.run((function(){return e(i)})):e(i),t._state||-1!==ge.indexOf(i)||function(e){for(var t=de.length;t;)if(de[--t]._value===e._value)return de.splice(t,1)}(t),n.resolve(r)}catch(e){n.reject(e)}finally{0==--we&&Ee(),--n.psd.ref||n.psd.finalize()}}function Pe(){$e(ye,(function(){xe()&&Oe()}))}function xe(){var e=pe;return he=pe=!1,e}function Oe(){var e,t,n;do{for(;0<be.length;)for(e=be,be=[],n=e.length,t=0;t<n;++t){var r=e[t];r[0].apply(null,r[1])}}while(0<be.length);he=pe=!0}function Ee(){var e=de;de=[],e.forEach((function(e){e._PSD.onunhandled.call(null,e._value,e)}));for(var t=Te.slice(0),n=t.length;n;)t[--n]()}function De(e){return new Ae(se,!1,e)}function Ce(e,t){var n=ve;return function(){var r=xe(),i=ve;try{return He(n,!0),e.apply(this,arguments)}catch(r){t&&t(r)}finally{He(i,!1),r&&Oe()}}}f(Ae.prototype,{then:qe,_then:function(e,t){je(this,new _e(null,null,e,t,ve))},catch:function(e){if(1===arguments.length)return this.then(null,e);var t=e,n=arguments[1];return"function"==typeof t?this.then(null,(function(e){return(e instanceof t?n:De)(e)})):this.then(null,(function(e){return(e&&e.name===t?n:De)(e)}))},finally:function(e){return this.then((function(t){return Ae.resolve(e()).then((function(){return t}))}),(function(t){return Ae.resolve(e()).then((function(){return De(t)}))}))},timeout:function(e,t){var n=this;return e<1/0?new Ae((function(r,i){var o=setTimeout((function(){return i(new H.Timeout(t))}),e);n.then(r,i).finally(clearTimeout.bind(null,o))})):this}}),"undefined"!=typeof Symbol&&Symbol.toStringTag&&h(Ae.prototype,Symbol.toStringTag,"Dexie.Promise"),ye.env=Ve(),f(Ae,{all:function(){var e=R.apply(null,arguments).map(ze);return new Ae((function(t,n){0===e.length&&t([]);var r=e.length;e.forEach((function(i,o){return Ae.resolve(i).then((function(n){e[o]=n,--r||t(e)}),n)}))}))},resolve:function(e){return e instanceof Ae?e:e&&"function"==typeof e.then?new Ae((function(t,n){e.then(t,n)})):new Ae(se,!0,e)},reject:De,race:function(){var e=R.apply(null,arguments).map(ze);return new Ae((function(t,n){e.map((function(e){return Ae.resolve(e).then(t,n)}))}))},PSD:{get:function(){return ve},set:function(e){return ve=e}},totalEchoes:{get:function(){return Ne}},newPSD:Fe,usePSD:$e,scheduler:{get:function(){return fe},set:function(e){fe=e}},rejectionMapper:{get:function(){return me},set:function(e){me=e}},follow:function(e,t){return new Ae((function(n,r){return Fe((function(t,n){var r=ve;r.unhandleds=[],r.onunhandled=n,r.finalize=Y((function(){var e,r=this;e=function(){0===r.unhandleds.length?t():n(r.unhandleds[0])},Te.push((function t(){e(),Te.splice(Te.indexOf(t),1)})),++we,fe((function(){0==--we&&Ee()}),[])}),r.finalize),e()}),t,n,r)}))}}),ce&&(ce.allSettled&&h(Ae,"allSettled",(function(){var e=R.apply(null,arguments).map(ze);return new Ae((function(t){0===e.length&&t([]);var n=e.length,r=new Array(n);e.forEach((function(e,i){return Ae.resolve(e).then((function(e){return r[i]={status:"fulfilled",value:e}}),(function(e){return r[i]={status:"rejected",reason:e}})).then((function(){return--n||t(r)}))}))}))})),ce.any&&"undefined"!=typeof AggregateError&&h(Ae,"any",(function(){var e=R.apply(null,arguments).map(ze);return new Ae((function(t,n){0===e.length&&n(new AggregateError([]));var r=e.length,i=new Array(r);e.forEach((function(e,o){return Ae.resolve(e).then((function(e){return t(e)}),(function(e){i[o]=e,--r||n(new AggregateError(i))}))}))}))})),ce.withResolvers&&(Ae.withResolvers=ce.withResolvers));var Ie={awaits:0,echoes:0,id:0},Re=0,Be=[],Ke=0,Ne=0,Me=0;function Fe(e,t,n,r){var i=ve,o=Object.create(i);return o.parent=i,o.ref=0,o.global=!1,o.id=++Me,ye.env,o.env=le?{Promise:Ae,PromiseProp:{value:Ae,configurable:!0,writable:!0},all:Ae.all,race:Ae.race,allSettled:Ae.allSettled,any:Ae.any,resolve:Ae.resolve,reject:Ae.reject}:{},t&&u(o,t),++i.ref,o.finalize=function(){--this.parent.ref||this.parent.finalize()},r=$e(o,e,n,r),0===o.ref&&o.finalize(),r}function Le(){return Ie.id||(Ie.id=++Re),++Ie.awaits,Ie.echoes+=ue,Ie.id}function Ge(){return!!Ie.awaits&&(0==--Ie.awaits&&(Ie.id=0),Ie.echoes=Ie.awaits*ue,!0)}function ze(e){return Ie.echoes&&e&&e.constructor===ce?(Le(),e.then((function(e){return Ge(),e}),(function(e){return Ge(),Xe(e)}))):e}function We(){var e=Be[Be.length-1];Be.pop(),He(e,!1)}function He(e,t){var n,r=ve;(t?!Ie.echoes||Ke++&&e===ve:!Ke||--Ke&&e===ve)||queueMicrotask(t?function(e){++Ne,Ie.echoes&&0!=--Ie.echoes||(Ie.echoes=Ie.awaits=Ie.id=0),Be.push(ve),He(e,!0)}.bind(null,e):We),e!==ve&&(ve=e,r===ye&&(ye.env=Ve()),le&&(n=ye.env.Promise,t=e.env,(r.global||e.global)&&(Object.defineProperty(i,"Promise",t.PromiseProp),n.all=t.all,n.race=t.race,n.resolve=t.resolve,n.reject=t.reject,t.allSettled&&(n.allSettled=t.allSettled),t.any&&(n.any=t.any))))}function Ve(){var e=i.Promise;return le?{Promise:e,PromiseProp:Object.getOwnPropertyDescriptor(i,"Promise"),all:e.all,race:e.race,allSettled:e.allSettled,any:e.any,resolve:e.resolve,reject:e.reject}:{}}function $e(e,t,n,r,i){var o=ve;try{return He(e,!0),t(n,r,i)}finally{He(o,!1)}}function Qe(e,t,n,r){return"function"!=typeof e?e:function(){var i=ve;n&&Le(),He(t,!0);try{return e.apply(this,arguments)}finally{He(i,!1),r&&queueMicrotask(Ge)}}}function Je(e){Promise===ce&&0===Ie.echoes?0===Ke?e():enqueueNativeMicroTask(e):setTimeout(e,0)}-1===(""+K).indexOf("[native code]")&&(Le=Ge=Q);var Xe=Ae.reject,Ye=String.fromCharCode(65535),Ze="Invalid key provided. Keys must be of type string, number, Date or Array<string | number | Date>.",et="String expected.",tt=[],nt="__dbnames",rt="readonly",it="readwrite";function ot(e,t){return e?t?function(){return e.apply(this,arguments)&&t.apply(this,arguments)}:e:t}var st={type:3,lower:-1/0,lowerOpen:!1,upper:[[]],upperOpen:!1};function ut(e){return"string"!=typeof e||/\./.test(e)?function(e){return e}:function(t){return void 0===t[e]&&e in t&&delete(t=P(t))[e],t}}function at(){throw H.Type("Entity instances must never be new:ed. Instances are generated by the framework bypassing the constructor.")}function ct(e,t){try{var n=lt(e),r=lt(t);if(n!==r)return"Array"===n?1:"Array"===r?-1:"binary"===n?1:"binary"===r?-1:"string"===n?1:"string"===r?-1:"Date"===n?1:"Date"!==r?NaN:-1;switch(n){case"number":case"Date":case"string":return t<e?1:e<t?-1:0;case"binary":return function(e,t){for(var n=e.length,r=t.length,i=n<r?n:r,o=0;o<i;++o)if(e[o]!==t[o])return e[o]<t[o]?-1:1;return n===r?0:n<r?-1:1}(ft(e),ft(t));case"Array":return function(e,t){for(var n=e.length,r=t.length,i=n<r?n:r,o=0;o<i;++o){var s=ct(e[o],t[o]);if(0!==s)return s}return n===r?0:n<r?-1:1}(e,t)}}catch(e){}return NaN}function lt(e){var t=typeof e;return"object"!=t?t:ArrayBuffer.isView(e)||"ArrayBuffer"===(e=O(e))?"binary":e}function ft(e){return e instanceof Uint8Array?e:ArrayBuffer.isView(e)?new Uint8Array(e.buffer,e.byteOffset,e.byteLength):new Uint8Array(e)}function pt(e,t,n){var r=e.schema.yProps;return r?(t&&0<n.numFailures&&(t=t.filter((function(e,t){return!n.failures[t]}))),Promise.all(r.map((function(n){return n=n.updatesTable,t?e.db.table(n).where("k").anyOf(t).delete():e.db.table(n).clear()}))).then((function(){return n}))):n}var ht=(dt.prototype.execute=function(e){var t=this["@@propmod"];if(void 0!==t.add){var n=t.add;if(s(n))return r(r([],s(e)?e:[],!0),n,!0).sort();if("number"==typeof n)return(Number(e)||0)+n;if("bigint"==typeof n)try{return BigInt(e)+n}catch(e){return BigInt(0)+n}throw new TypeError("Invalid term ".concat(n))}if(void 0!==t.remove){var i=t.remove;if(s(i))return s(e)?e.filter((function(e){return!i.includes(e)})).sort():[];if("number"==typeof i)return Number(e)-i;if("bigint"==typeof i)try{return BigInt(e)-i}catch(e){return BigInt(0)-i}throw new TypeError("Invalid subtrahend ".concat(i))}return(n=null===(n=t.replacePrefix)||void 0===n?void 0:n[0])&&"string"==typeof e&&e.startsWith(n)?t.replacePrefix[1]+e.substring(n.length):e},dt);function dt(e){this["@@propmod"]=e}function gt(e,t){for(var n=o(t),r=n.length,i=!1,s=0;s<r;++s){var u=n[s],a=t[u],c=T(e,u);a instanceof ht?(A(e,u,a.execute(c)),i=!0):c!==a&&(A(e,u,a),i=!0)}return i}var mt=(yt.prototype._trans=function(e,t,n){var r=this._tx||ve.trans,i=this.name,o=ie&&"undefined"!=typeof console&&console.createTask&&console.createTask("Dexie: ".concat("readonly"===e?"read":"write"," ").concat(this.name));function s(e,n,r){if(!r.schema[i])throw new H.NotFound("Table "+i+" not part of transaction");return t(r.idbtrans,r)}var u=xe();try{var a=r&&r.db._novip===this.db._novip?r===ve.trans?r._promise(e,s,n):Fe((function(){return r._promise(e,s,n)}),{trans:r,transless:ve.transless||ve}):function e(t,n,r,i){if(t.idbdb&&(t._state.openComplete||ve.letThrough||t._vip)){var o=t._createTransaction(n,r,t._dbSchema);try{o.create(),t._state.PR1398_maxLoop=3}catch(o){return o.name===z.InvalidState&&t.isOpen()&&0<--t._state.PR1398_maxLoop?(console.warn("Dexie: Need to reopen db"),t.close({disableAutoOpen:!1}),t.open().then((function(){return e(t,n,r,i)}))):Xe(o)}return o._promise(n,(function(e,t){return Fe((function(){return ve.trans=o,i(e,t,o)}))})).then((function(e){if("readwrite"===n)try{o.idbtrans.commit()}catch(e){}return"readonly"===n?e:o._completion.then((function(){return e}))}))}if(t._state.openComplete)return Xe(new H.DatabaseClosed(t._state.dbOpenError));if(!t._state.isBeingOpened){if(!t._state.autoOpen)return Xe(new H.DatabaseClosed);t.open().catch(Q)}return t._state.dbReadyPromise.then((function(){return e(t,n,r,i)}))}(this.db,e,[this.name],s);return o&&(a._consoleTask=o,a=a.catch((function(e){return console.trace(e),Xe(e)}))),a}finally{u&&Oe()}},yt.prototype.get=function(e,t){var n=this;return e&&e.constructor===Object?this.where(e).first(t):null==e?Xe(new H.Type("Invalid argument to Table.get()")):this._trans("readonly",(function(t){return n.core.get({trans:t,key:e}).then((function(e){return n.hook.reading.fire(e)}))})).then(t)},yt.prototype.where=function(e){if("string"==typeof e)return new this.db.WhereClause(this,e);if(s(e))return new this.db.WhereClause(this,"[".concat(e.join("+"),"]"));var t=o(e);if(1===t.length)return this.where(t[0]).equals(e[t[0]]);var n=this.schema.indexes.concat(this.schema.primKey).filter((function(e){if(e.compound&&t.every((function(t){return 0<=e.keyPath.indexOf(t)}))){for(var n=0;n<t.length;++n)if(-1===t.indexOf(e.keyPath[n]))return!1;return!0}return!1})).sort((function(e,t){return e.keyPath.length-t.keyPath.length}))[0];if(n&&this.db._maxKey!==Ye){var r=n.keyPath.slice(0,t.length);return this.where(r).equals(r.map((function(t){return e[t]})))}!n&&ie&&console.warn("The query ".concat(JSON.stringify(e)," on ").concat(this.name," would benefit from a ")+"compound index [".concat(t.join("+"),"]"));var i=this.schema.idxByName;function u(e,t){return 0===ct(e,t)}var a=t.reduce((function(t,n){var r=t[0],o=t[1],a=(t=i[n],e[n]);return[r||t,r||!t?ot(o,t&&t.multi?function(e){return e=T(e,n),s(e)&&e.some((function(e){return u(a,e)}))}:function(e){return u(a,T(e,n))}):o]}),[null,null]);return r=a[0],a=a[1],r?this.where(r.name).equals(e[r.keyPath]).filter(a):n?this.filter(a):this.where(t).equals("")},yt.prototype.filter=function(e){return this.toCollection().and(e)},yt.prototype.count=function(e){return this.toCollection().count(e)},yt.prototype.offset=function(e){return this.toCollection().offset(e)},yt.prototype.limit=function(e){return this.toCollection().limit(e)},yt.prototype.each=function(e){return this.toCollection().each(e)},yt.prototype.toArray=function(e){return this.toCollection().toArray(e)},yt.prototype.toCollection=function(){return new this.db.Collection(new this.db.WhereClause(this))},yt.prototype.orderBy=function(e){return new this.db.Collection(new this.db.WhereClause(this,s(e)?"[".concat(e.join("+"),"]"):e))},yt.prototype.reverse=function(){return this.toCollection().reverse()},yt.prototype.mapToClass=function(t){var n,r=this.db,i=this.name;function o(){return null!==n&&n.apply(this,arguments)||this}(this.schema.mappedClass=t).prototype instanceof at&&(function(t,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}(o,n=t),Object.defineProperty(o.prototype,"db",{get:function(){return r},enumerable:!1,configurable:!0}),o.prototype.table=function(){return i},t=o);for(var s=new Set,u=t.prototype;u;u=a(u))Object.getOwnPropertyNames(u).forEach((function(e){return s.add(e)}));function c(e){if(!e)return e;var n,r=Object.create(t.prototype);for(n in e)if(!s.has(n))try{r[n]=e[n]}catch(e){}return r}return this.schema.readHook&&this.hook.reading.unsubscribe(this.schema.readHook),this.schema.readHook=c,this.hook("reading",c),t},yt.prototype.defineClass=function(){return this.mapToClass((function(e){u(this,e)}))},yt.prototype.add=function(e,t){var n=this,r=this.schema.primKey,i=r.auto,o=r.keyPath,s=e;return o&&i&&(s=ut(o)(e)),this._trans("readwrite",(function(e){return n.core.mutate({trans:e,type:"add",keys:null!=t?[t]:null,values:[s]})})).then((function(e){return e.numFailures?Ae.reject(e.failures[0]):e.lastResult})).then((function(t){if(o)try{A(e,o,t)}catch(t){}return t}))},yt.prototype.upsert=function(e,t){var n=this,r=this.schema.primKey.keyPath;return this._trans("readwrite",(function(i){return n.core.get({trans:i,key:e}).then((function(o){var s=null!=o?o:{};return gt(s,t),r&&A(s,r,e),n.core.mutate({trans:i,type:"put",values:[s],keys:[e],upsert:!0,updates:{keys:[e],changeSpecs:[t]}}).then((function(e){return e.numFailures?Ae.reject(e.failures[0]):!!o}))}))}))},yt.prototype.update=function(e,t){return"object"!=typeof e||s(e)?this.where(":id").equals(e).modify(t):void 0===(e=T(e,this.schema.primKey.keyPath))?Xe(new H.InvalidArgument("Given object does not contain its primary key")):this.where(":id").equals(e).modify(t)},yt.prototype.put=function(e,t){var n=this,r=this.schema.primKey,i=r.auto,o=r.keyPath,s=e;return o&&i&&(s=ut(o)(e)),this._trans("readwrite",(function(e){return n.core.mutate({trans:e,type:"put",values:[s],keys:null!=t?[t]:null})})).then((function(e){return e.numFailures?Ae.reject(e.failures[0]):e.lastResult})).then((function(t){if(o)try{A(e,o,t)}catch(t){}return t}))},yt.prototype.delete=function(e){var t=this;return this._trans("readwrite",(function(n){return t.core.mutate({trans:n,type:"delete",keys:[e]}).then((function(n){return pt(t,[e],n)})).then((function(e){return e.numFailures?Ae.reject(e.failures[0]):void 0}))}))},yt.prototype.clear=function(){var e=this;return this._trans("readwrite",(function(t){return e.core.mutate({trans:t,type:"deleteRange",range:st}).then((function(t){return pt(e,null,t)}))})).then((function(e){return e.numFailures?Ae.reject(e.failures[0]):void 0}))},yt.prototype.bulkGet=function(e){var t=this;return this._trans("readonly",(function(n){return t.core.getMany({keys:e,trans:n}).then((function(e){return e.map((function(e){return t.hook.reading.fire(e)}))}))}))},yt.prototype.bulkAdd=function(e,t,n){var r=this,i=Array.isArray(t)?t:void 0,o=(n=n||(i?void 0:t))?n.allKeys:void 0;return this._trans("readwrite",(function(t){var n=(u=r.schema.primKey).auto;if((u=u.keyPath)&&i)throw new H.InvalidArgument("bulkAdd(): keys argument invalid on tables with inbound keys");if(i&&i.length!==e.length)throw new H.InvalidArgument("Arguments objects and keys must have the same length");var s=e.length,u=u&&n?e.map(ut(u)):e;return r.core.mutate({trans:t,type:"add",keys:i,values:u,wantResults:o}).then((function(e){var t=e.numFailures,n=e.results,i=e.lastResult;if(e=e.failures,0===t)return o?n:i;throw new G("".concat(r.name,".bulkAdd(): ").concat(t," of ").concat(s," operations failed"),e)}))}))},yt.prototype.bulkPut=function(e,t,n){var r=this,i=Array.isArray(t)?t:void 0,o=(n=n||(i?void 0:t))?n.allKeys:void 0;return this._trans("readwrite",(function(t){var n=(u=r.schema.primKey).auto;if((u=u.keyPath)&&i)throw new H.InvalidArgument("bulkPut(): keys argument invalid on tables with inbound keys");if(i&&i.length!==e.length)throw new H.InvalidArgument("Arguments objects and keys must have the same length");var s=e.length,u=u&&n?e.map(ut(u)):e;return r.core.mutate({trans:t,type:"put",keys:i,values:u,wantResults:o}).then((function(e){var t=e.numFailures,n=e.results,i=e.lastResult;if(e=e.failures,0===t)return o?n:i;throw new G("".concat(r.name,".bulkPut(): ").concat(t," of ").concat(s," operations failed"),e)}))}))},yt.prototype.bulkUpdate=function(e){var t=this,n=this.core,r=e.map((function(e){return e.key})),i=e.map((function(e){return e.changes})),o=[];return this._trans("readwrite",(function(s){return n.getMany({trans:s,keys:r,cache:"clone"}).then((function(u){var a=[],c=[];e.forEach((function(e,n){var r=e.key,i=e.changes,s=u[n];if(s){for(var l=0,f=Object.keys(i);l<f.length;l++){var p=f[l],h=i[p];if(p===t.schema.primKey.keyPath){if(0!==ct(h,r))throw new H.Constraint("Cannot update primary key in bulkUpdate()")}else A(s,p,h)}o.push(n),a.push(r),c.push(s)}}));var l=a.length;return n.mutate({trans:s,type:"put",keys:a,values:c,updates:{keys:r,changeSpecs:i}}).then((function(e){var n=e.numFailures,r=e.failures;if(0===n)return l;for(var i=0,s=Object.keys(r);i<s.length;i++){var u,a=s[i],c=o[Number(a)];null!=c&&(u=r[a],delete r[a],r[c]=u)}throw new G("".concat(t.name,".bulkUpdate(): ").concat(n," of ").concat(l," operations failed"),r)}))}))}))},yt.prototype.bulkDelete=function(e){var t=this,n=e.length;return this._trans("readwrite",(function(n){return t.core.mutate({trans:n,type:"delete",keys:e}).then((function(n){return pt(t,e,n)}))})).then((function(e){var r=e.numFailures,i=e.lastResult;if(e=e.failures,0===r)return i;throw new G("".concat(t.name,".bulkDelete(): ").concat(r," of ").concat(n," operations failed"),e)}))},yt);function yt(){}function vt(e){function t(t,r){if(r){for(var i=arguments.length,o=new Array(i-1);--i;)o[i-1]=arguments[i];return n[t].subscribe.apply(null,o),e}if("string"==typeof t)return n[t]}var n={};t.addEventType=u;for(var r=1,i=arguments.length;r<i;++r)u(arguments[r]);return t;function u(e,r,i){if("object"!=typeof e){var a;r=r||ne;var c={subscribers:[],fire:i=i||Q,subscribe:function(e){-1===c.subscribers.indexOf(e)&&(c.subscribers.push(e),c.fire=r(c.fire,e))},unsubscribe:function(e){c.subscribers=c.subscribers.filter((function(t){return t!==e})),c.fire=c.subscribers.reduce(r,i)}};return n[e]=t[e]=c}o(a=e).forEach((function(e){var t=a[e];if(s(t))u(e,a[e][0],a[e][1]);else{if("asap"!==t)throw new H.InvalidArgument("Invalid event config");var n=u(e,J,(function(){for(var e=arguments.length,t=new Array(e);e--;)t[e]=arguments[e];n.subscribers.forEach((function(e){w((function(){e.apply(null,t)}))}))}))}}))}}function bt(e,t){return d(t).from({prototype:e}),t}function wt(e,t){return!(e.filter||e.algorithm||e.or)&&(t?e.justLimit:!e.replayFilter)}function Tt(e,t){e.filter=ot(e.filter,t)}function At(e,t,n){var r=e.replayFilter;e.replayFilter=r?function(){return ot(r(),t())}:t,e.justLimit=n&&!r}function qt(e,t){if(e.isPrimKey)return t.primaryKey;var n=t.getIndexByKeyPath(e.index);if(!n)throw new H.Schema("KeyPath "+e.index+" on object store "+t.name+" is not indexed");return n}function _t(e,t,n){var r=qt(e,t.schema);return t.openCursor({trans:n,values:!e.keysOnly,reverse:"prev"===e.dir,unique:!!e.unique,query:{index:r,range:e.range}})}function Ut(e,t,n,r){var i=e.replayFilter?ot(e.filter,e.replayFilter()):e.filter;if(e.or){var o={},s=function(e,n,r){var s,u;i&&!i(n,r,(function(e){return n.stop(e)}),(function(e){return n.fail(e)}))||("[object ArrayBuffer]"==(u=""+(s=n.primaryKey))&&(u=""+new Uint8Array(s)),l(o,u)||(o[u]=!0,t(e,n,r)))};return Promise.all([e.or._iterate(s,n),kt(_t(e,r,n),e.algorithm,s,!e.keysOnly&&e.valueMapper)])}return kt(_t(e,r,n),ot(e.algorithm,i),t,!e.keysOnly&&e.valueMapper)}function kt(e,t,n,r){var i=Ce(r?function(e,t,i){return n(r(e),t,i)}:n);return e.then((function(e){if(e)return e.start((function(){var n=function(){return e.continue()};t&&!t(e,(function(e){return n=e}),(function(t){e.stop(t),n=Q}),(function(t){e.fail(t),n=Q}))||i(e.value,e,(function(e){return n=e})),n()}))}))}var jt=(St.prototype._read=function(e,t){var n=this._ctx;return n.error?n.table._trans(null,Xe.bind(null,n.error)):n.table._trans("readonly",e).then(t)},St.prototype._write=function(e){var t=this._ctx;return t.error?t.table._trans(null,Xe.bind(null,t.error)):t.table._trans("readwrite",e,"locked")},St.prototype._addAlgorithm=function(e){var t=this._ctx;t.algorithm=ot(t.algorithm,e)},St.prototype._iterate=function(e,t){return Ut(this._ctx,e,t,this._ctx.table.core)},St.prototype.clone=function(e){var t=Object.create(this.constructor.prototype),n=Object.create(this._ctx);return e&&u(n,e),t._ctx=n,t},St.prototype.raw=function(){return this._ctx.valueMapper=null,this},St.prototype.each=function(e){var t=this._ctx;return this._read((function(n){return Ut(t,e,n,t.table.core)}))},St.prototype.count=function(e){var t=this;return this._read((function(e){var n=t._ctx,r=n.table.core;if(wt(n,!0))return r.count({trans:e,query:{index:qt(n,r.schema),range:n.range}}).then((function(e){return Math.min(e,n.limit)}));var i=0;return Ut(n,(function(){return++i,!1}),e,r).then((function(){return i}))})).then(e)},St.prototype.sortBy=function(e,t){var n=e.split(".").reverse(),r=n[0],i=n.length-1;function o(e,t){return t?o(e[n[t]],t-1):e[r]}var s="next"===this._ctx.dir?1:-1;function u(e,t){return ct(o(e,i),o(t,i))*s}return this.toArray((function(e){return e.sort(u)})).then(t)},St.prototype.toArray=function(e){var t=this;return this._read((function(e){var n=t._ctx;if("next"===n.dir&&wt(n,!0)&&0<n.limit){var r=n.valueMapper,i=qt(n,n.table.core.schema);return n.table.core.query({trans:e,limit:n.limit,values:!0,query:{index:i,range:n.range}}).then((function(e){return e=e.result,r?e.map(r):e}))}var o=[];return Ut(n,(function(e){return o.push(e)}),e,n.table.core).then((function(){return o}))}),e)},St.prototype.offset=function(e){var t=this._ctx;return e<=0||(t.offset+=e,wt(t)?At(t,(function(){var t=e;return function(e,n){return 0===t||(1===t?--t:n((function(){e.advance(t),t=0})),!1)}})):At(t,(function(){var t=e;return function(){return--t<0}}))),this},St.prototype.limit=function(e){return this._ctx.limit=Math.min(this._ctx.limit,e),At(this._ctx,(function(){var t=e;return function(e,n,r){return--t<=0&&n(r),0<=t}}),!0),this},St.prototype.until=function(e,t){return Tt(this._ctx,(function(n,r,i){return!e(n.value)||(r(i),t)})),this},St.prototype.first=function(e){return this.limit(1).toArray((function(e){return e[0]})).then(e)},St.prototype.last=function(e){return this.reverse().first(e)},St.prototype.filter=function(e){var t;return Tt(this._ctx,(function(t){return e(t.value)})),(t=this._ctx).isMatch=ot(t.isMatch,e),this},St.prototype.and=function(e){return this.filter(e)},St.prototype.or=function(e){return new this.db.WhereClause(this._ctx.table,e,this)},St.prototype.reverse=function(){return this._ctx.dir="prev"===this._ctx.dir?"next":"prev",this._ondirectionchange&&this._ondirectionchange(this._ctx.dir),this},St.prototype.desc=function(){return this.reverse()},St.prototype.eachKey=function(e){var t=this._ctx;return t.keysOnly=!t.isMatch,this.each((function(t,n){e(n.key,n)}))},St.prototype.eachUniqueKey=function(e){return this._ctx.unique="unique",this.eachKey(e)},St.prototype.eachPrimaryKey=function(e){var t=this._ctx;return t.keysOnly=!t.isMatch,this.each((function(t,n){e(n.primaryKey,n)}))},St.prototype.keys=function(e){var t=this._ctx;t.keysOnly=!t.isMatch;var n=[];return this.each((function(e,t){n.push(t.key)})).then((function(){return n})).then(e)},St.prototype.primaryKeys=function(e){var t=this._ctx;if("next"===t.dir&&wt(t,!0)&&0<t.limit)return this._read((function(e){var n=qt(t,t.table.core.schema);return t.table.core.query({trans:e,values:!1,limit:t.limit,query:{index:n,range:t.range}})})).then((function(e){return e.result})).then(e);t.keysOnly=!t.isMatch;var n=[];return this.each((function(e,t){n.push(t.primaryKey)})).then((function(){return n})).then(e)},St.prototype.uniqueKeys=function(e){return this._ctx.unique="unique",this.keys(e)},St.prototype.firstKey=function(e){return this.limit(1).keys((function(e){return e[0]})).then(e)},St.prototype.lastKey=function(e){return this.reverse().firstKey(e)},St.prototype.distinct=function(){var e;if(!(e=(e=this._ctx).index&&e.table.schema.idxByName[e.index])||!e.multi)return this;var t={};return Tt(this._ctx,(function(e){var n=e.primaryKey.toString();return e=l(t,n),t[n]=!0,!e})),this},St.prototype.modify=function(e){var t=this,n=this._ctx;return this._write((function(r){var i,s="function"==typeof e?e:function(t){return gt(t,e)},u=n.table.core,a=(i=u.schema.primaryKey).outbound,c=i.extractKey,l=200;function f(e,t){var n=t.failures;t=t.numFailures,h+=e-t;for(var r=0,i=o(n);r<i.length;r++){var s=i[r];p.push(n[s])}}(i=t.db._options.modifyChunkSize)&&(l="object"==typeof i?i[u.name]||i["*"]||200:i);var p=[],h=0,d=[],g=e===Pt;return t.clone().primaryKeys().then((function(t){function i(p){var h=Math.min(l,t.length-p),d=t.slice(p,p+h);return(g?Promise.resolve([]):u.getMany({trans:r,keys:d,cache:"immutable"})).then((function(m){var y=[],v=[],b=a?[]:null,w=g?d:[];if(!g)for(var T=0;T<h;++T){var A=m[T],q={value:P(A),primKey:t[p+T]};!1!==s.call(q,q.value,q)&&(null==q.value?w.push(t[p+T]):a||0===ct(c(A),c(q.value))?(v.push(q.value),a&&b.push(t[p+T])):(w.push(t[p+T]),y.push(q.value)))}return Promise.resolve(0<y.length&&u.mutate({trans:r,type:"add",values:y}).then((function(e){for(var t in e.failures)w.splice(parseInt(t),1);f(y.length,e)}))).then((function(){return(0<v.length||o&&"object"==typeof e)&&u.mutate({trans:r,type:"put",keys:b,values:v,criteria:o,changeSpec:"function"!=typeof e&&e,isAdditionalChunk:0<p}).then((function(e){return f(v.length,e)}))})).then((function(){return(0<w.length||o&&g)&&u.mutate({trans:r,type:"delete",keys:w,criteria:o,isAdditionalChunk:0<p}).then((function(e){return pt(n.table,w,e)})).then((function(e){return f(w.length,e)}))})).then((function(){return t.length>p+h&&i(p+l)}))}))}var o=wt(n)&&n.limit===1/0&&("function"!=typeof e||g)&&{index:n.index,range:n.range};return i(0).then((function(){if(0<p.length)throw new L("Error modifying one or more objects",p,h,d);return t.length}))}))}))},St.prototype.delete=function(){var e=this._ctx,t=e.range;return!wt(e)||e.table.schema.yProps||!e.isPrimKey&&3!==t.type?this.modify(Pt):this._write((function(n){var r=e.table.core.schema.primaryKey,i=t;return e.table.core.count({trans:n,query:{index:r,range:i}}).then((function(t){return e.table.core.mutate({trans:n,type:"deleteRange",range:i}).then((function(e){var n=e.failures;if(e=e.numFailures)throw new L("Could not delete some values",Object.keys(n).map((function(e){return n[e]})),t-e);return t-e}))}))}))},St);function St(){}var Pt=function(e,t){return t.value=null};function xt(e,t){return e<t?-1:e===t?0:1}function Ot(e,t){return t<e?-1:e===t?0:1}function Et(e,t,n){return(e=e instanceof Bt?new e.Collection(e):e)._ctx.error=new(n||TypeError)(t),e}function Dt(e){return new e.Collection(e,(function(){return Rt("")})).limit(0)}function Ct(e,t,n,r){var i,o,s,u,a,c,l,f=n.length;if(!n.every((function(e){return"string"==typeof e})))return Et(e,et);function p(e){i="next"===e?function(e){return e.toUpperCase()}:function(e){return e.toLowerCase()},o="next"===e?function(e){return e.toLowerCase()}:function(e){return e.toUpperCase()},s="next"===e?xt:Ot;var t=n.map((function(e){return{lower:o(e),upper:i(e)}})).sort((function(e,t){return s(e.lower,t.lower)}));u=t.map((function(e){return e.upper})),a=t.map((function(e){return e.lower})),l="next"===(c=e)?"":r}p("next"),(e=new e.Collection(e,(function(){return It(u[0],a[f-1]+r)})))._ondirectionchange=function(e){p(e)};var h=0;return e._addAlgorithm((function(e,n,r){var i=e.key;if("string"!=typeof i)return!1;var p=o(i);if(t(p,a,h))return!0;for(var d=null,g=h;g<f;++g){var m=function(e,t,n,r,i,o){for(var s=Math.min(e.length,r.length),u=-1,a=0;a<s;++a){var c=t[a];if(c!==r[a])return i(e[a],n[a])<0?e.substr(0,a)+n[a]+n.substr(a+1):i(e[a],r[a])<0?e.substr(0,a)+r[a]+n.substr(a+1):0<=u?e.substr(0,u)+t[u]+n.substr(u+1):null;i(e[a],c)<0&&(u=a)}return s<r.length&&"next"===o?e+n.substr(e.length):s<e.length&&"prev"===o?e.substr(0,n.length):u<0?null:e.substr(0,u)+r[u]+n.substr(u+1)}(i,p,u[g],a[g],s,c);null===m&&null===d?h=g+1:(null===d||0<s(d,m))&&(d=m)}return n(null!==d?function(){e.continue(d+l)}:r),!1})),e}function It(e,t,n,r){return{type:2,lower:e,upper:t,lowerOpen:n,upperOpen:r}}function Rt(e){return{type:1,lower:e,upper:e}}var Bt=(Object.defineProperty(Kt.prototype,"Collection",{get:function(){return this._ctx.table.db.Collection},enumerable:!1,configurable:!0}),Kt.prototype.between=function(e,t,n,r){n=!1!==n,r=!0===r;try{return 0<this._cmp(e,t)||0===this._cmp(e,t)&&(n||r)&&(!n||!r)?Dt(this):new this.Collection(this,(function(){return It(e,t,!n,!r)}))}catch(e){return Et(this,Ze)}},Kt.prototype.equals=function(e){return null==e?Et(this,Ze):new this.Collection(this,(function(){return Rt(e)}))},Kt.prototype.above=function(e){return null==e?Et(this,Ze):new this.Collection(this,(function(){return It(e,void 0,!0)}))},Kt.prototype.aboveOrEqual=function(e){return null==e?Et(this,Ze):new this.Collection(this,(function(){return It(e,void 0,!1)}))},Kt.prototype.below=function(e){return null==e?Et(this,Ze):new this.Collection(this,(function(){return It(void 0,e,!1,!0)}))},Kt.prototype.belowOrEqual=function(e){return null==e?Et(this,Ze):new this.Collection(this,(function(){return It(void 0,e)}))},Kt.prototype.startsWith=function(e){return"string"!=typeof e?Et(this,et):this.between(e,e+Ye,!0,!0)},Kt.prototype.startsWithIgnoreCase=function(e){return""===e?this.startsWith(e):Ct(this,(function(e,t){return 0===e.indexOf(t[0])}),[e],Ye)},Kt.prototype.equalsIgnoreCase=function(e){return Ct(this,(function(e,t){return e===t[0]}),[e],"")},Kt.prototype.anyOfIgnoreCase=function(){var e=R.apply(I,arguments);return 0===e.length?Dt(this):Ct(this,(function(e,t){return-1!==t.indexOf(e)}),e,"")},Kt.prototype.startsWithAnyOfIgnoreCase=function(){var e=R.apply(I,arguments);return 0===e.length?Dt(this):Ct(this,(function(e,t){return t.some((function(t){return 0===e.indexOf(t)}))}),e,Ye)},Kt.prototype.anyOf=function(){var e=this,t=R.apply(I,arguments),n=this._cmp;try{t.sort(n)}catch(r){return Et(this,Ze)}if(0===t.length)return Dt(this);var r=new this.Collection(this,(function(){return It(t[0],t[t.length-1])}));r._ondirectionchange=function(r){n="next"===r?e._ascending:e._descending,t.sort(n)};var i=0;return r._addAlgorithm((function(e,r,o){for(var s=e.key;0<n(s,t[i]);)if(++i===t.length)return r(o),!1;return 0===n(s,t[i])||(r((function(){e.continue(t[i])})),!1)})),r},Kt.prototype.notEqual=function(e){return this.inAnyRange([[-1/0,e],[e,this.db._maxKey]],{includeLowers:!1,includeUppers:!1})},Kt.prototype.noneOf=function(){var e=R.apply(I,arguments);if(0===e.length)return new this.Collection(this);try{e.sort(this._ascending)}catch(e){return Et(this,Ze)}var t=e.reduce((function(e,t){return e?e.concat([[e[e.length-1][1],t]]):[[-1/0,t]]}),null);return t.push([e[e.length-1],this.db._maxKey]),this.inAnyRange(t,{includeLowers:!1,includeUppers:!1})},Kt.prototype.inAnyRange=function(e,t){var n=this,r=this._cmp,i=this._ascending,o=this._descending,s=this._min,u=this._max;if(0===e.length)return Dt(this);if(!e.every((function(e){return void 0!==e[0]&&void 0!==e[1]&&i(e[0],e[1])<=0})))return Et(this,"First argument to inAnyRange() must be an Array of two-value Arrays [lower,upper] where upper must not be lower than lower",H.InvalidArgument);var a,c=!t||!1!==t.includeLowers,l=t&&!0===t.includeUppers,f=i;function p(e,t){return f(e[0],t[0])}try{(a=e.reduce((function(e,t){for(var n=0,i=e.length;n<i;++n){var o=e[n];if(r(t[0],o[1])<0&&0<r(t[1],o[0])){o[0]=s(o[0],t[0]),o[1]=u(o[1],t[1]);break}}return n===i&&e.push(t),e}),[])).sort(p)}catch(e){return Et(this,Ze)}var h=0,d=l?function(e){return 0<i(e,a[h][1])}:function(e){return 0<=i(e,a[h][1])},g=c?function(e){return 0<o(e,a[h][0])}:function(e){return 0<=o(e,a[h][0])},m=d;return(e=new this.Collection(this,(function(){return It(a[0][0],a[a.length-1][1],!c,!l)})))._ondirectionchange=function(e){f="next"===e?(m=d,i):(m=g,o),a.sort(p)},e._addAlgorithm((function(e,t,r){for(var o,s=e.key;m(s);)if(++h===a.length)return t(r),!1;return!d(o=s)&&!g(o)||(0===n._cmp(s,a[h][1])||0===n._cmp(s,a[h][0])||t((function(){f===i?e.continue(a[h][0]):e.continue(a[h][1])})),!1)})),e},Kt.prototype.startsWithAnyOf=function(){var e=R.apply(I,arguments);return e.every((function(e){return"string"==typeof e}))?0===e.length?Dt(this):this.inAnyRange(e.map((function(e){return[e,e+Ye]}))):Et(this,"startsWithAnyOf() only works with strings")},Kt);function Kt(){}function Nt(e){return Ce((function(t){return Mt(t),e(t.target.error),!1}))}function Mt(e){e.stopPropagation&&e.stopPropagation(),e.preventDefault&&e.preventDefault()}var Ft="storagemutated",Lt="x-storagemutated-1",Gt=vt(null,Ft),zt=(Wt.prototype._lock=function(){return b(!ve.global),++this._reculock,1!==this._reculock||ve.global||(ve.lockOwnerFor=this),this},Wt.prototype._unlock=function(){if(b(!ve.global),0==--this._reculock)for(ve.global||(ve.lockOwnerFor=null);0<this._blockedFuncs.length&&!this._locked();){var e=this._blockedFuncs.shift();try{$e(e[1],e[0])}catch(e){}}return this},Wt.prototype._locked=function(){return this._reculock&&ve.lockOwnerFor!==this},Wt.prototype.create=function(e){var t=this;if(!this.mode)return this;var n=this.db.idbdb,r=this.db._state.dbOpenError;if(b(!this.idbtrans),!e&&!n)switch(r&&r.name){case"DatabaseClosedError":throw new H.DatabaseClosed(r);case"MissingAPIError":throw new H.MissingAPI(r.message,r);default:throw new H.OpenFailed(r)}if(!this.active)throw new H.TransactionInactive;return b(null===this._completion._state),(e=this.idbtrans=e||(this.db.core||n).transaction(this.storeNames,this.mode,{durability:this.chromeTransactionDurability})).onerror=Ce((function(n){Mt(n),t._reject(e.error)})),e.onabort=Ce((function(n){Mt(n),t.active&&t._reject(new H.Abort(e.error)),t.active=!1,t.on("abort").fire(n)})),e.oncomplete=Ce((function(){t.active=!1,t._resolve(),"mutatedParts"in e&&Gt.storagemutated.fire(e.mutatedParts)})),this},Wt.prototype._promise=function(e,t,n){var r=this;if("readwrite"===e&&"readwrite"!==this.mode)return Xe(new H.ReadOnly("Transaction is readonly"));if(!this.active)return Xe(new H.TransactionInactive);if(this._locked())return new Ae((function(i,o){r._blockedFuncs.push([function(){r._promise(e,t,n).then(i,o)},ve])}));if(n)return Fe((function(){var e=new Ae((function(e,n){r._lock();var i=t(e,n,r);i&&i.then&&i.then(e,n)}));return e.finally((function(){return r._unlock()})),e._lib=!0,e}));var i=new Ae((function(e,n){var i=t(e,n,r);i&&i.then&&i.then(e,n)}));return i._lib=!0,i},Wt.prototype._root=function(){return this.parent?this.parent._root():this},Wt.prototype.waitFor=function(e){var t,n=this._root(),r=Ae.resolve(e);n._waitingFor?n._waitingFor=n._waitingFor.then((function(){return r})):(n._waitingFor=r,n._waitingQueue=[],t=n.idbtrans.objectStore(n.storeNames[0]),function e(){for(++n._spinCount;n._waitingQueue.length;)n._waitingQueue.shift()();n._waitingFor&&(t.get(-1/0).onsuccess=e)}());var i=n._waitingFor;return new Ae((function(e,t){r.then((function(t){return n._waitingQueue.push(Ce(e.bind(null,t)))}),(function(e){return n._waitingQueue.push(Ce(t.bind(null,e)))})).finally((function(){n._waitingFor===i&&(n._waitingFor=null)}))}))},Wt.prototype.abort=function(){this.active&&(this.active=!1,this.idbtrans&&this.idbtrans.abort(),this._reject(new H.Abort))},Wt.prototype.table=function(e){var t=this._memoizedTables||(this._memoizedTables={});if(l(t,e))return t[e];var n=this.schema[e];if(!n)throw new H.NotFound("Table "+e+" not part of transaction");return(n=new this.db.Table(e,n,this)).core=this.db.core.table(e),t[e]=n},Wt);function Wt(){}function Ht(e,t,n,r,i,o,s,u){return{name:e,keyPath:t,unique:n,multi:r,auto:i,compound:o,src:(n&&!s?"&":"")+(r?"*":"")+(i?"++":"")+Vt(t),type:u}}function Vt(e){return"string"==typeof e?e:e?"["+[].join.call(e,"+")+"]":""}function $t(e,t,n){return{name:e,primKey:t,indexes:n,mappedClass:null,idxByName:(r=function(e){return[e.name,e]},n.reduce((function(e,t,n){return(n=r(t,n))&&(e[n[0]]=n[1]),e}),{}))};var r}var Qt=function(e){try{return e.only([[]]),Qt=function(){return[[]]},[[]]}catch(e){return Qt=function(){return Ye},Ye}};function Jt(e){return null==e?function(){}:"string"==typeof e?1===(t=e).split(".").length?function(e){return e[t]}:function(e){return T(e,t)}:function(t){return T(t,e)};var t}function Xt(e){return[].slice.call(e)}var Yt=0;function Zt(e){return null==e?":id":"string"==typeof e?e:"[".concat(e.join("+"),"]")}function en(e,t,n){function r(e){if(3===e.type)return null;if(4===e.type)throw new Error("Cannot convert never type to IDBKeyRange");var n=e.lower,r=e.upper,i=e.lowerOpen;return e=e.upperOpen,void 0===n?void 0===r?null:t.upperBound(r,!!e):void 0===r?t.lowerBound(n,!!i):t.bound(n,r,!!i,!!e)}function i(e){var t,n=e.name;return{name:n,schema:e,mutate:function(e){var t=e.trans,i=e.type,o=e.keys,s=e.values,u=e.range;return new Promise((function(e,a){e=Ce(e);var c=t.objectStore(n),l=null==c.keyPath,f="put"===i||"add"===i;if(!f&&"delete"!==i&&"deleteRange"!==i)throw new Error("Invalid operation type: "+i);var p,h=(o||s||{length:1}).length;if(o&&s&&o.length!==s.length)throw new Error("Given keys array must have same length as given values array.");if(0===h)return e({numFailures:0,failures:{},results:[],lastResult:void 0});function d(e){++y,Mt(e)}var g=[],m=[],y=0;if("deleteRange"===i){if(4===u.type)return e({numFailures:y,failures:m,results:[],lastResult:void 0});3===u.type?g.push(p=c.clear()):g.push(p=c.delete(r(u)))}else{var v=(l=f?l?[s,o]:[s,null]:[o,null])[0],b=l[1];if(f)for(var w=0;w<h;++w)g.push(p=b&&void 0!==b[w]?c[i](v[w],b[w]):c[i](v[w])),p.onerror=d;else for(w=0;w<h;++w)g.push(p=c[i](v[w])),p.onerror=d}function T(t){t=t.target.result,g.forEach((function(e,t){return null!=e.error&&(m[t]=e.error)})),e({numFailures:y,failures:m,results:"delete"===i?o:g.map((function(e){return e.result})),lastResult:t})}p.onerror=function(e){d(e),T(e)},p.onsuccess=T}))},getMany:function(e){var t=e.trans,r=e.keys;return new Promise((function(e,i){e=Ce(e);for(var o,s=t.objectStore(n),u=r.length,a=new Array(u),c=0,l=0,f=function(t){t=t.target,a[t._pos]=t.result,++l===c&&e(a)},p=Nt(i),h=0;h<u;++h)null!=r[h]&&((o=s.get(r[h]))._pos=h,o.onsuccess=f,o.onerror=p,++c);0===c&&e(a)}))},get:function(e){var t=e.trans,r=e.key;return new Promise((function(e,i){e=Ce(e);var o=t.objectStore(n).get(r);o.onsuccess=function(t){return e(t.target.result)},o.onerror=Nt(i)}))},query:(t=l,function(e){return new Promise((function(i,o){i=Ce(i);var s,u,a,c=e.trans,l=e.values,f=e.limit,p=e.query,h=f===1/0?void 0:f,d=p.index;if(p=p.range,c=c.objectStore(n),d=d.isPrimaryKey?c:c.index(d.name),p=r(p),0===f)return i({result:[]});t?((h=l?d.getAll(p,h):d.getAllKeys(p,h)).onsuccess=function(e){return i({result:e.target.result})},h.onerror=Nt(o)):(s=0,u=!l&&"openKeyCursor"in d?d.openKeyCursor(p):d.openCursor(p),a=[],u.onsuccess=function(e){var t=u.result;return t?(a.push(l?t.value:t.primaryKey),++s===f?i({result:a}):void t.continue()):i({result:a})},u.onerror=Nt(o))}))}),openCursor:function(e){var t=e.trans,i=e.values,o=e.query,s=e.reverse,u=e.unique;return new Promise((function(e,a){e=Ce(e);var c=o.index,l=o.range,f=t.objectStore(n),p=(f=c.isPrimaryKey?f:f.index(c.name),c=s?u?"prevunique":"prev":u?"nextunique":"next",!i&&"openKeyCursor"in f?f.openKeyCursor(r(l),c):f.openCursor(r(l),c));p.onerror=Nt(a),p.onsuccess=Ce((function(n){var r,i,o,s,u=p.result;u?(u.___id=++Yt,u.done=!1,r=u.continue.bind(u),i=(i=u.continuePrimaryKey)&&i.bind(u),o=u.advance.bind(u),s=function(){throw new Error("Cursor not stopped")},u.trans=t,u.stop=u.continue=u.continuePrimaryKey=u.advance=function(){throw new Error("Cursor not started")},u.fail=Ce(a),u.next=function(){var e=this,t=1;return this.start((function(){return t--?e.continue():e.stop()})).then((function(){return e}))},u.start=function(e){function t(){if(p.result)try{e()}catch(e){u.fail(e)}else u.done=!0,u.start=function(){throw new Error("Cursor behind last entry")},u.stop()}var n=new Promise((function(e,t){e=Ce(e),p.onerror=Nt(t),u.fail=t,u.stop=function(t){u.stop=u.continue=u.continuePrimaryKey=u.advance=s,e(t)}}));return p.onsuccess=Ce((function(e){p.onsuccess=t,t()})),u.continue=r,u.continuePrimaryKey=i,u.advance=o,t(),n},e(u)):e(null)}),a)}))},count:function(e){var t=e.query,i=e.trans,o=t.index,s=t.range;return new Promise((function(e,t){var u=i.objectStore(n),a=o.isPrimaryKey?u:u.index(o.name);(a=(u=r(s))?a.count(u):a.count()).onsuccess=Ce((function(t){return e(t.target.result)})),a.onerror=Nt(t)}))}}}var o,u,a,c=(u=n,a=Xt((o=e).objectStoreNames),{schema:{name:o.name,tables:a.map((function(e){return u.objectStore(e)})).map((function(e){var t=e.keyPath,n=e.autoIncrement,r=s(t),i={};return n={name:e.name,primaryKey:{name:null,isPrimaryKey:!0,outbound:null==t,compound:r,keyPath:t,autoIncrement:n,unique:!0,extractKey:Jt(t)},indexes:Xt(e.indexNames).map((function(t){return e.index(t)})).map((function(e){var t=e.name,n=e.unique,r=e.multiEntry;return e=e.keyPath,r={name:t,compound:s(e),keyPath:e,unique:n,multiEntry:r,extractKey:Jt(e)},i[Zt(e)]=r})),getIndexByKeyPath:function(e){return i[Zt(e)]}},i[":id"]=n.primaryKey,null!=t&&(i[Zt(t)]=n.primaryKey),n}))},hasGetAll:0<a.length&&"getAll"in u.objectStore(a[0])&&!("undefined"!=typeof navigator&&/Safari/.test(navigator.userAgent)&&!/(Chrome\/|Edge\/)/.test(navigator.userAgent)&&[].concat(navigator.userAgent.match(/Safari\/(\d*)/))[1]<604)}),l=(n=c.schema,c.hasGetAll),f=(c=n.tables.map(i),{});return c.forEach((function(e){return f[e.name]=e})),{stack:"dbcore",transaction:e.transaction.bind(e),table:function(e){if(!f[e])throw new Error("Table '".concat(e,"' not found"));return f[e]},MIN_KEY:-1/0,MAX_KEY:Qt(t),schema:n}}function tn(e,n,r,i){var o=r.IDBKeyRange;return r.indexedDB,{dbcore:(i=en(n,o,i),e.dbcore.reduce((function(e,n){return n=n.create,t(t({},e),n(e))}),i))}}function nn(e,t){var n=t.db;t=tn(e._middlewares,n,e._deps,t),e.core=t.dbcore,e.tables.forEach((function(t){var n=t.name;e.core.schema.tables.some((function(e){return e.name===n}))&&(t.core=e.core.table(n),e[n]instanceof e.Table&&(e[n].core=t.core))}))}function rn(e,t,n,r){n.forEach((function(n){var i=r[n];t.forEach((function(t){var r=function e(t,n){return g(t,n)||(t=a(t))&&e(t,n)}(t,n);(!r||"value"in r&&void 0===r.value)&&(t===e.Transaction.prototype||t instanceof e.Transaction?h(t,n,{get:function(){return this.table(n)},set:function(e){p(this,n,{value:e,writable:!0,configurable:!0,enumerable:!0})}}):t[n]=new e.Table(n,i))}))}))}function on(e,t){t.forEach((function(t){for(var n in t)t[n]instanceof e.Table&&delete t[n]}))}function sn(e,t){return e._cfg.version-t._cfg.version}function un(e,t,n,r){var i=e._dbSchema;n.objectStoreNames.contains("$meta")&&!i.$meta&&(i.$meta=$t("$meta",gn("")[0],[]),e._storeNames.push("$meta"));var s=e._createTransaction("readwrite",e._storeNames,i);s.create(n),s._completion.catch(r);var u=s._reject.bind(s),a=ve.transless||ve;Fe((function(){return ve.trans=s,ve.transless=a,0!==t?(nn(e,n),c=t,((r=s).storeNames.includes("$meta")?r.table("$meta").get("version").then((function(e){return null!=e?e:c})):Ae.resolve(c)).then((function(t){return i=t,u=s,a=n,c=[],t=(r=e)._versions,l=r._dbSchema=hn(0,r.idbdb,a),0!==(t=t.filter((function(e){return e._cfg.version>=i}))).length?(t.forEach((function(e){c.push((function(){var t=l,n=e._cfg.dbschema;dn(r,t,a),dn(r,n,a),l=r._dbSchema=n;var s=cn(t,n);s.add.forEach((function(e){ln(a,e[0],e[1].primKey,e[1].indexes)})),s.change.forEach((function(e){if(e.recreate)throw new H.Upgrade("Not yet support for changing primary key");var t=a.objectStore(e.name);e.add.forEach((function(e){return pn(t,e)})),e.change.forEach((function(e){t.deleteIndex(e.name),pn(t,e)})),e.del.forEach((function(e){return t.deleteIndex(e)}))}));var c=e._cfg.contentUpgrade;if(c&&e._cfg.version>i){nn(r,a),u._memoizedTables={};var f=q(n);s.del.forEach((function(e){f[e]=t[e]})),on(r,[r.Transaction.prototype]),rn(r,[r.Transaction.prototype],o(f),f),u.schema=f;var p,h=B(c);return h&&Le(),s=Ae.follow((function(){var e;(p=c(u))&&h&&(e=Ge.bind(null,null),p.then(e,e))})),p&&"function"==typeof p.then?Ae.resolve(p):s.then((function(){return p}))}})),c.push((function(t){var n,i,o=e._cfg.dbschema;n=o,i=t,[].slice.call(i.db.objectStoreNames).forEach((function(e){return null==n[e]&&i.db.deleteObjectStore(e)})),on(r,[r.Transaction.prototype]),rn(r,[r.Transaction.prototype],r._storeNames,r._dbSchema),u.schema=r._dbSchema})),c.push((function(t){r.idbdb.objectStoreNames.contains("$meta")&&(Math.ceil(r.idbdb.version/10)===e._cfg.version?(r.idbdb.deleteObjectStore("$meta"),delete r._dbSchema.$meta,r._storeNames=r._storeNames.filter((function(e){return"$meta"!==e}))):t.objectStore("$meta").put(e._cfg.version,"version"))}))})),function e(){return c.length?Ae.resolve(c.shift()(u.idbtrans)).then(e):Ae.resolve()}().then((function(){fn(l,a)}))):Ae.resolve();var r,i,u,a,c,l})).catch(u)):(o(i).forEach((function(e){ln(n,e,i[e].primKey,i[e].indexes)})),nn(e,n),void Ae.follow((function(){return e.on.populate.fire(s)})).catch(u));var r,c}))}function an(e,t){fn(e._dbSchema,t),t.db.version%10!=0||t.objectStoreNames.contains("$meta")||t.db.createObjectStore("$meta").add(Math.ceil(t.db.version/10-1),"version");var n=hn(0,e.idbdb,t);dn(e,e._dbSchema,t);for(var r=0,i=cn(n,e._dbSchema).change;r<i.length;r++){var o=function(e){if(e.change.length||e.recreate)return console.warn("Unable to patch indexes of table ".concat(e.name," because it has changes on the type of index or primary key.")),{value:void 0};var n=t.objectStore(e.name);e.add.forEach((function(t){ie&&console.debug("Dexie upgrade patch: Creating missing index ".concat(e.name,".").concat(t.src)),pn(n,t)}))}(i[r]);if("object"==typeof o)return o.value}}function cn(e,t){var n,r={del:[],add:[],change:[]};for(n in e)t[n]||r.del.push(n);for(n in t){var i=e[n],o=t[n];if(i){var s={name:n,def:o,recreate:!1,del:[],add:[],change:[]};if(""+(i.primKey.keyPath||"")!=""+(o.primKey.keyPath||"")||i.primKey.auto!==o.primKey.auto)s.recreate=!0,r.change.push(s);else{var u=i.idxByName,a=o.idxByName,c=void 0;for(c in u)a[c]||s.del.push(c);for(c in a){var l=u[c],f=a[c];l?l.src!==f.src&&s.change.push(f):s.add.push(f)}(0<s.del.length||0<s.add.length||0<s.change.length)&&r.change.push(s)}}else r.add.push([n,o])}return r}function ln(e,t,n,r){var i=e.db.createObjectStore(t,n.keyPath?{keyPath:n.keyPath,autoIncrement:n.auto}:{autoIncrement:n.auto});return r.forEach((function(e){return pn(i,e)})),i}function fn(e,t){o(e).forEach((function(n){t.db.objectStoreNames.contains(n)||(ie&&console.debug("Dexie: Creating missing table",n),ln(t,n,e[n].primKey,e[n].indexes))}))}function pn(e,t){e.createIndex(t.name,t.keyPath,{unique:t.unique,multiEntry:t.multi})}function hn(e,t,n){var r={};return y(t.objectStoreNames,0).forEach((function(e){for(var t=n.objectStore(e),i=Ht(Vt(u=t.keyPath),u||"",!0,!1,!!t.autoIncrement,u&&"string"!=typeof u,!0),o=[],s=0;s<t.indexNames.length;++s){var u=(a=t.index(t.indexNames[s])).keyPath,a=Ht(a.name,u,!!a.unique,!!a.multiEntry,!1,u&&"string"!=typeof u,!1);o.push(a)}r[e]=$t(e,i,o)})),r}function dn(e,t,n){for(var r=n.db.objectStoreNames,o=0;o<r.length;++o){var s=r[o],u=n.objectStore(s);e._hasGetAll="getAll"in u;for(var a=0;a<u.indexNames.length;++a){var c=u.indexNames[a],l=u.index(c).keyPath,f="string"==typeof l?l:"["+y(l).join("+")+"]";!t[s]||(l=t[s].idxByName[f])&&(l.name=c,delete t[s].idxByName[f],t[s].idxByName[c]=l)}}"undefined"!=typeof navigator&&/Safari/.test(navigator.userAgent)&&!/(Chrome\/|Edge\/)/.test(navigator.userAgent)&&i.WorkerGlobalScope&&i instanceof i.WorkerGlobalScope&&[].concat(navigator.userAgent.match(/Safari\/(\d*)/))[1]<604&&(e._hasGetAll=!1)}function gn(e){return e.split(",").map((function(e,t){var n=null===(r=(i=e.split(":"))[1])||void 0===r?void 0:r.trim(),r=(e=i[0].trim()).replace(/([&*]|\+\+)/g,""),i=/^\[/.test(r)?r.match(/^\[(.*)\]$/)[1].split("+"):r;return Ht(r,i||null,/\&/.test(e),/\*/.test(e),/\+\+/.test(e),s(i),0===t,n)}))}var mn=(yn.prototype._createTableSchema=$t,yn.prototype._parseIndexSyntax=gn,yn.prototype._parseStoresSpec=function(e,t){var n=this;o(e).forEach((function(r){if(null!==e[r]){var i=n._parseIndexSyntax(e[r]),o=i.shift();if(!o)throw new H.Schema("Invalid schema for table "+r+": "+e[r]);if(o.unique=!0,o.multi)throw new H.Schema("Primary key cannot be multiEntry*");i.forEach((function(e){if(e.auto)throw new H.Schema("Only primary key can be marked as autoIncrement (++)");if(!e.keyPath)throw new H.Schema("Index must have a name and cannot be an empty string")})),i=n._createTableSchema(r,o,i),t[r]=i}}))},yn.prototype.stores=function(e){var t=this.db;this._cfg.storesSource=this._cfg.storesSource?u(this._cfg.storesSource,e):e,e=t._versions;var n={},r={};return e.forEach((function(e){u(n,e._cfg.storesSource),r=e._cfg.dbschema={},e._parseStoresSpec(n,r)})),t._dbSchema=r,on(t,[t._allTables,t,t.Transaction.prototype]),rn(t,[t._allTables,t,t.Transaction.prototype,this._cfg.tables],o(r),r),t._storeNames=o(r),this},yn.prototype.upgrade=function(e){return this._cfg.contentUpgrade=re(this._cfg.contentUpgrade||Q,e),this},yn);function yn(){}function vn(e,t){var n=e._dbNamesDB;return n||(n=e._dbNamesDB=new rr(nt,{addons:[],indexedDB:e,IDBKeyRange:t})).version(1).stores({dbnames:"name"}),n.table("dbnames")}function bn(e){return e&&"function"==typeof e.databases}function wn(e){return Fe((function(){return ve.letThrough=!0,e()}))}function Tn(e){return!("from"in e)}var An=function(e,t){if(!this){var n=new An;return e&&"d"in e&&u(n,e),n}u(this,arguments.length?{d:1,from:e,to:1<arguments.length?t:e}:{d:0})};function qn(e,t,n){var r=ct(t,n);if(!isNaN(r)){if(0<r)throw RangeError();if(Tn(e))return u(e,{from:t,to:n,d:1});var i=e.l;if(r=e.r,ct(n,e.from)<0)return i?qn(i,t,n):e.l={from:t,to:n,d:1,l:null,r:null},jn(e);if(0<ct(t,e.to))return r?qn(r,t,n):e.r={from:t,to:n,d:1,l:null,r:null},jn(e);ct(t,e.from)<0&&(e.from=t,e.l=null,e.d=r?r.d+1:1),0<ct(n,e.to)&&(e.to=n,e.r=null,e.d=e.l?e.l.d+1:1),n=!e.r,i&&!e.l&&_n(e,i),r&&n&&_n(e,r)}}function _n(e,t){Tn(t)||function e(t,n){var r=n.from,i=n.to,o=n.l;n=n.r,qn(t,r,i),o&&e(t,o),n&&e(t,n)}(e,t)}function Un(e,t){var n=kn(t),r=n.next();if(r.done)return!1;for(var i=r.value,o=kn(e),s=o.next(i.from),u=s.value;!r.done&&!s.done;){if(ct(u.from,i.to)<=0&&0<=ct(u.to,i.from))return!0;ct(i.from,u.from)<0?i=(r=n.next(u.from)).value:u=(s=o.next(i.from)).value}return!1}function kn(e){var t=Tn(e)?null:{s:0,n:e};return{next:function(e){for(var n=0<arguments.length;t;)switch(t.s){case 0:if(t.s=1,n)for(;t.n.l&&ct(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,!n||ct(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 jn(e){var n,r,i=((null===(n=e.r)||void 0===n?void 0:n.d)||0)-((null===(r=e.l)||void 0===r?void 0:r.d)||0),o=1<i?"r":i<-1?"l":"";o&&(n="r"==o?"l":"r",r=t({},e),i=e[o],e.from=i.from,e.to=i.to,e[o]=i[o],r[o]=i[n],(e[n]=r).d=Sn(r)),e.d=Sn(e)}function Sn(e){var t=e.r;return e=e.l,(t?e?Math.max(t.d,e.d):t.d:e?e.d:0)+1}function Pn(e,t){return o(t).forEach((function(n){e[n]?_n(e[n],t[n]):e[n]=function e(t){var n,r,i={};for(n in t)l(t,n)&&(r=t[n],i[n]=!r||"object"!=typeof r||j.has(r.constructor)?r:e(r));return i}(t[n])})),e}function xn(e,t){return e.all||t.all||Object.keys(e).some((function(n){return t[n]&&Un(t[n],e[n])}))}f(An.prototype,((K={add:function(e){return _n(this,e),this},addKey:function(e){return qn(this,e,e),this},addKeys:function(e){var t=this;return e.forEach((function(e){return qn(t,e,e)})),this},hasKey:function(e){var t=kn(this).next(e).value;return t&&ct(t.from,e)<=0&&0<=ct(t.to,e)}})[E]=function(){return kn(this)},K));var On={},En={},Dn=!1;function Cn(e){Pn(En,e),Dn||(Dn=!0,setTimeout((function(){Dn=!1,In(En,!(En={}))}),0))}function In(e,t){void 0===t&&(t=!1);var n=new Set;if(e.all)for(var r=0,i=Object.values(On);r<i.length;r++)Rn(s=i[r],e,n,t);else for(var o in e){var s,u=/^idb\:\/\/(.*)\/(.*)\//.exec(o);u&&(o=u[1],u=u[2],(s=On["idb://".concat(o,"/").concat(u)])&&Rn(s,e,n,t))}n.forEach((function(e){return e()}))}function Rn(e,t,n,r){for(var i=[],o=0,s=Object.entries(e.queries.query);o<s.length;o++){for(var u=s[o],a=u[0],c=[],l=0,f=u[1];l<f.length;l++){var p=f[l];xn(t,p.obsSet)?p.subscribers.forEach((function(e){return n.add(e)})):r&&c.push(p)}r&&i.push([a,c])}if(r)for(var h=0,d=i;h<d.length;h++){var g=d[h];a=g[0],c=g[1],e.queries.query[a]=c}}function Bn(e){var t=e._state,n=e._deps.indexedDB;if(t.isBeingOpened||e.idbdb)return t.dbReadyPromise.then((function(){return t.dbOpenError?Xe(t.dbOpenError):e}));t.isBeingOpened=!0,t.dbOpenError=null,t.openComplete=!1;var r=t.openCanceller,i=Math.round(10*e.verno),s=!1;function u(){if(t.openCanceller!==r)throw new H.DatabaseClosed("db.open() was cancelled")}function a(){return new Ae((function(r,c){if(u(),!n)throw new H.MissingAPI;var l=e.name,h=t.autoSchema||!i?n.open(l):n.open(l,i);if(!h)throw new H.MissingAPI;h.onerror=Nt(c),h.onblocked=Ce(e._fireOnBlocked),h.onupgradeneeded=Ce((function(r){var i;f=h.transaction,t.autoSchema&&!e._options.allowEmptyDB?(h.onerror=Mt,f.abort(),h.result.close(),(i=n.deleteDatabase(l)).onsuccess=i.onerror=Ce((function(){c(new H.NoSuchDatabase("Database ".concat(l," doesnt exist")))}))):(f.onerror=Nt(c),r=r.oldVersion>Math.pow(2,62)?0:r.oldVersion,p=r<1,e.idbdb=h.result,s&&an(e,f),un(e,r/10,f,c))}),c),h.onsuccess=Ce((function(){f=null;var n,u,c,d,g,m=e.idbdb=h.result,v=y(m.objectStoreNames);if(0<v.length)try{var b=m.transaction(1===(d=v).length?d[0]:d,"readonly");if(t.autoSchema)u=m,c=b,(n=e).verno=u.version/10,c=n._dbSchema=hn(0,u,c),n._storeNames=y(u.objectStoreNames,0),rn(n,[n._allTables],o(c),c);else if(dn(e,e._dbSchema,b),((g=cn(hn(0,(g=e).idbdb,b),g._dbSchema)).add.length||g.change.some((function(e){return e.add.length||e.change.length})))&&!s)return console.warn("Dexie SchemaDiff: Schema was extended without increasing the number passed to db.version(). Dexie will add missing parts and increment native version number to workaround this."),m.close(),i=m.version+1,s=!0,r(a());nn(e,b)}catch(n){}tt.push(e),m.onversionchange=Ce((function(n){t.vcFired=!0,e.on("versionchange").fire(n)})),m.onclose=Ce((function(){e.close({disableAutoOpen:!1})})),p&&(g=e._deps,b=l,m=g.indexedDB,g=g.IDBKeyRange,bn(m)||b===nt||vn(m,g).put({name:b}).catch(Q)),r()}),c)})).catch((function(e){switch(null==e?void 0:e.name){case"UnknownError":if(0<t.PR1398_maxLoop)return t.PR1398_maxLoop--,console.warn("Dexie: Workaround for Chrome UnknownError on open()"),a();break;case"VersionError":if(0<i)return i=0,a()}return Ae.reject(e)}))}var c,l=t.dbReadyResolve,f=null,p=!1;return Ae.race([r,("undefined"==typeof navigator?Ae.resolve():!navigator.userAgentData&&/Safari\//.test(navigator.userAgent)&&!/Chrom(e|ium)\//.test(navigator.userAgent)&&indexedDB.databases?new Promise((function(e){function t(){return indexedDB.databases().finally(e)}c=setInterval(t,100),t()})).finally((function(){return clearInterval(c)})):Promise.resolve()).then(a)]).then((function(){return u(),t.onReadyBeingFired=[],Ae.resolve(wn((function(){return e.on.ready.fire(e.vip)}))).then((function n(){if(0<t.onReadyBeingFired.length){var r=t.onReadyBeingFired.reduce(re,Q);return t.onReadyBeingFired=[],Ae.resolve(wn((function(){return r(e.vip)}))).then(n)}}))})).finally((function(){t.openCanceller===r&&(t.onReadyBeingFired=null,t.isBeingOpened=!1)})).catch((function(n){t.dbOpenError=n;try{f&&f.abort()}catch(n){}return r===t.openCanceller&&e._close(),Xe(n)})).finally((function(){t.openComplete=!0,l()})).then((function(){var t;return p&&(t={},e.tables.forEach((function(n){n.schema.indexes.forEach((function(r){r.name&&(t["idb://".concat(e.name,"/").concat(n.name,"/").concat(r.name)]=new An(-1/0,[[[]]]))})),t["idb://".concat(e.name,"/").concat(n.name,"/")]=t["idb://".concat(e.name,"/").concat(n.name,"/:dels")]=new An(-1/0,[[[]]])})),Gt(Ft).fire(t),In(t,!0)),e}))}function Kn(e){function t(t){return e.next(t)}var n=i(t),r=i((function(t){return e.throw(t)}));function i(e){return function(t){var i=e(t);return t=i.value,i.done?t:t&&"function"==typeof t.then?t.then(n,r):s(t)?Promise.all(t).then(n,r):n(t)}}return i(t)()}function Nn(e,t,n){for(var r=s(e)?e.slice():[e],i=0;i<n;++i)r.push(t);return r}var Mn={stack:"dbcore",name:"VirtualIndexMiddleware",level:1,create:function(e){return t(t({},e),{table:function(n){var r=e.table(n),i=r.schema,o={},s=[];function u(e,n,r){var i=Zt(e),a=o[i]=o[i]||[],c=null==e?0:"string"==typeof e?1:e.length,l=0<n;return l=t(t({},r),{name:l?"".concat(i,"(virtual-from:").concat(r.name,")"):r.name,lowLevelIndex:r,isVirtual:l,keyTail:n,keyLength:c,extractKey:Jt(e),unique:!l&&r.unique}),a.push(l),l.isPrimaryKey||s.push(l),1<c&&u(2===c?e[0]:e.slice(0,c-1),n+1,r),a.sort((function(e,t){return e.keyTail-t.keyTail})),l}n=u(i.primaryKey.keyPath,0,i.primaryKey),o[":id"]=[n];for(var a=0,c=i.indexes;a<c.length;a++){var l=c[a];u(l.keyPath,0,l)}function f(n){var r,i=n.query.index;return i.isVirtual?t(t({},n),{query:{index:i.lowLevelIndex,range:(r=n.query.range,i=i.keyTail,{type:1===r.type?2:r.type,lower:Nn(r.lower,r.lowerOpen?e.MAX_KEY:e.MIN_KEY,i),lowerOpen:!0,upper:Nn(r.upper,r.upperOpen?e.MIN_KEY:e.MAX_KEY,i),upperOpen:!0})}}):n}return t(t({},r),{schema:t(t({},i),{primaryKey:n,indexes:s,getIndexByKeyPath:function(e){return(e=o[Zt(e)])&&e[0]}}),count:function(e){return r.count(f(e))},query:function(e){return r.query(f(e))},openCursor:function(t){var n=t.query.index,i=n.keyTail,o=n.isVirtual,s=n.keyLength;return o?r.openCursor(f(t)).then((function(e){return e&&u(e)})):r.openCursor(t);function u(n){return Object.create(n,{continue:{value:function(r){null!=r?n.continue(Nn(r,t.reverse?e.MAX_KEY:e.MIN_KEY,i)):t.unique?n.continue(n.key.slice(0,s).concat(t.reverse?e.MIN_KEY:e.MAX_KEY,i)):n.continue()}},continuePrimaryKey:{value:function(t,r){n.continuePrimaryKey(Nn(t,e.MAX_KEY,i),r)}},primaryKey:{get:function(){return n.primaryKey}},key:{get:function(){var e=n.key;return 1===s?e[0]:e.slice(0,s)}},value:{get:function(){return n.value}}})}}})}})}};function Fn(e,t,n,r){return n=n||{},r=r||"",o(e).forEach((function(i){var o,s,u;l(t,i)?(o=e[i],s=t[i],"object"==typeof o&&"object"==typeof s&&o&&s?(u=O(o))!==O(s)?n[r+i]=t[i]:"Object"===u?Fn(o,s,n,r+i+"."):o!==s&&(n[r+i]=t[i]):o!==s&&(n[r+i]=t[i])):n[r+i]=void 0})),o(t).forEach((function(i){l(e,i)||(n[r+i]=t[i])})),n}function Ln(e,t){return"delete"===t.type?t.keys:t.keys||t.values.map(e.extractKey)}var Gn={stack:"dbcore",name:"HooksMiddleware",level:2,create:function(e){return t(t({},e),{table:function(n){var i=e.table(n),o=i.schema.primaryKey;return t(t({},i),{mutate:function(e){var s=ve.trans,u=s.table(n).hook,a=u.deleting,c=u.creating,f=u.updating;switch(e.type){case"add":if(c.fire===Q)break;return s._promise("readwrite",(function(){return p(e)}),!0);case"put":if(c.fire===Q&&f.fire===Q)break;return s._promise("readwrite",(function(){return p(e)}),!0);case"delete":if(a.fire===Q)break;return s._promise("readwrite",(function(){return p(e)}),!0);case"deleteRange":if(a.fire===Q)break;return s._promise("readwrite",(function(){return function e(n,r,s){return i.query({trans:n,values:!1,query:{index:o,range:r},limit:s}).then((function(i){var o=i.result;return p({type:"delete",keys:o,trans:n}).then((function(i){return 0<i.numFailures?Promise.reject(i.failures[0]):o.length<s?{failures:[],numFailures:0,lastResult:void 0}:e(n,t(t({},r),{lower:o[o.length-1],lowerOpen:!0}),s)}))}))}(e.trans,e.range,1e4)}),!0)}return i.mutate(e);function p(e){var n,s,u,p=ve.trans,h=e.keys||Ln(o,e);if(!h)throw new Error("Keys missing");return"delete"!==(e="add"===e.type||"put"===e.type?t(t({},e),{keys:h}):t({},e)).type&&(e.values=r([],e.values,!0)),e.keys&&(e.keys=r([],e.keys,!0)),n=i,u=h,("add"===(s=e).type?Promise.resolve([]):n.getMany({trans:s.trans,keys:u,cache:"immutable"})).then((function(t){var n=h.map((function(n,r){var i,s,u,h=t[r],d={onerror:null,onsuccess:null};return"delete"===e.type?a.fire.call(d,n,h,p):"add"===e.type||void 0===h?(i=c.fire.call(d,n,e.values[r],p),null==n&&null!=i&&(e.keys[r]=n=i,o.outbound||A(e.values[r],o.keyPath,n))):(i=Fn(h,e.values[r]),(s=f.fire.call(d,i,n,h,p))&&(u=e.values[r],Object.keys(s).forEach((function(e){l(u,e)?u[e]=s[e]:A(u,e,s[e])})))),d}));return i.mutate(e).then((function(r){for(var i=r.failures,o=r.results,s=r.numFailures,u=(r=r.lastResult,0);u<h.length;++u){var a=(o||h)[u],c=n[u];null==a?c.onerror&&c.onerror(i[u]):c.onsuccess&&c.onsuccess("put"===e.type&&t[u]?e.values[u]:a)}return{failures:i,results:o,numFailures:s,lastResult:r}})).catch((function(e){return n.forEach((function(t){return t.onerror&&t.onerror(e)})),Promise.reject(e)}))}))}}})}})}};function zn(e,t,n){try{if(!t)return null;if(t.keys.length<e.length)return null;for(var r=[],i=0,o=0;i<t.keys.length&&o<e.length;++i)0===ct(t.keys[i],e[o])&&(r.push(n?P(t.values[i]):t.values[i]),++o);return r.length===e.length?r:null}catch(e){return null}}var Wn={stack:"dbcore",level:-1,create:function(e){return{table:function(n){var r=e.table(n);return t(t({},r),{getMany:function(e){if(!e.cache)return r.getMany(e);var t=zn(e.keys,e.trans._cache,"clone"===e.cache);return t?Ae.resolve(t):r.getMany(e).then((function(t){return e.trans._cache={keys:e.keys,values:"clone"===e.cache?P(t):t},t}))},mutate:function(e){return"add"!==e.type&&(e.trans._cache=null),r.mutate(e)}})}}}};function Hn(e,t){return"readonly"===e.trans.mode&&!!e.subscr&&!e.trans.explicit&&"disabled"!==e.trans.db._options.cache&&!t.schema.primaryKey.outbound}function Vn(e,t){switch(e){case"query":return t.values&&!t.unique;case"get":case"getMany":case"count":case"openCursor":return!1}}var $n={stack:"dbcore",level:0,name:"Observability",create:function(e){var n=e.schema.name,r=new An(e.MIN_KEY,e.MAX_KEY);return t(t({},e),{transaction:function(t,n,r){if(ve.subscr&&"readonly"!==n)throw new H.ReadOnly("Readwrite transaction in liveQuery context. Querier source: ".concat(ve.querier));return e.transaction(t,n,r)},table:function(i){var u=e.table(i),a=u.schema,c=a.primaryKey,l=a.indexes,f=c.extractKey,p=c.outbound,h=c.autoIncrement&&l.filter((function(e){return e.compound&&e.keyPath.includes(c.keyPath)})),d=t(t({},u),{mutate:function(t){function o(e){return e="idb://".concat(n,"/").concat(i,"/").concat(e),g[e]||(g[e]=new An)}var l,f,p,d=t.trans,g=t.mutatedParts||(t.mutatedParts={}),m=o(""),y=o(":dels"),v=t.type,b="deleteRange"===t.type?[t.range]:"delete"===t.type?[t.keys]:t.values.length<50?[Ln(c,t).filter((function(e){return e})),t.values]:[],w=b[0],T=b[1];return b=t.trans._cache,s(w)?(m.addKeys(w),(b="delete"===v||w.length===T.length?zn(w,b):null)||y.addKeys(w),(b||T)&&(l=o,f=b,p=T,a.indexes.forEach((function(e){var t=l(e.name||"");function n(t){return null!=t?e.extractKey(t):null}function r(n){return e.multiEntry&&s(n)?n.forEach((function(e){return t.addKey(e)})):t.addKey(n)}(f||p).forEach((function(e,t){var i=f&&n(f[t]);0!==ct(i,t=p&&n(p[t]))&&(null!=i&&r(i),null!=t&&r(t))}))})))):w?(T={from:null!==(T=w.lower)&&void 0!==T?T:e.MIN_KEY,to:null!==(T=w.upper)&&void 0!==T?T:e.MAX_KEY},y.add(T),m.add(T)):(m.add(r),y.add(r),a.indexes.forEach((function(e){return o(e.name).add(r)}))),u.mutate(t).then((function(e){return!w||"add"!==t.type&&"put"!==t.type||(m.addKeys(e.results),h&&h.forEach((function(n){for(var r=t.values.map((function(e){return n.extractKey(e)})),i=n.keyPath.findIndex((function(e){return e===c.keyPath})),s=0,u=e.results.length;s<u;++s)r[s][i]=e.results[s];o(n.name).addKeys(r)}))),d.mutatedParts=Pn(d.mutatedParts||{},g),e}))}}),g=(l=function(t){t=(n=t.query).index;var n=n.range;return[t,new An(null!==(t=n.lower)&&void 0!==t?t:e.MIN_KEY,null!==(n=n.upper)&&void 0!==n?n:e.MAX_KEY)]},{get:function(e){return[c,new An(e.key)]},getMany:function(e){return[c,(new An).addKeys(e.keys)]},count:l,query:l,openCursor:l});return o(g).forEach((function(e){d[e]=function(o){var s=!!(d=ve.subscr),a=Hn(ve,u)&&Vn(e,o)?o.obsSet={}:d;if(s){var c=function(e){return e="idb://".concat(n,"/").concat(i,"/").concat(e),a[e]||(a[e]=new An)},l=c(""),h=c(":dels"),d=(s=(d=g[e](o))[0],d[1]);if(("query"===e&&s.isPrimaryKey&&!o.values?h:c(s.name||"")).add(d),!s.isPrimaryKey){if("count"!==e){var m="query"===e&&p&&o.values&&u.query(t(t({},o),{values:!1}));return u[e].apply(this,arguments).then((function(t){if("query"===e){if(p&&o.values)return m.then((function(e){return e=e.result,l.addKeys(e),t}));var n=o.values?t.result.map(f):t.result;(o.values?l:h).addKeys(n)}else if("openCursor"===e){var r=t,i=o.values;return r&&Object.create(r,{key:{get:function(){return h.addKey(r.primaryKey),r.key}},primaryKey:{get:function(){var e=r.primaryKey;return h.addKey(e),e}},value:{get:function(){return i&&l.addKey(r.primaryKey),r.value}}})}return t}))}h.add(r)}}return u[e].apply(this,arguments)}})),d}})}};function Qn(e,n,r){if(0===r.numFailures)return n;if("deleteRange"===n.type)return null;var i=n.keys?n.keys.length:"values"in n&&n.values?n.values.length:1;return r.numFailures===i?null:(n=t({},n),s(n.keys)&&(n.keys=n.keys.filter((function(e,t){return!(t in r.failures)}))),"values"in n&&s(n.values)&&(n.values=n.values.filter((function(e,t){return!(t in r.failures)}))),n)}function Jn(e,t){return n=e,(void 0===(r=t).lower||(r.lowerOpen?0<ct(n,r.lower):0<=ct(n,r.lower)))&&(void 0===t.upper||(t.upperOpen?ct(e,t.upper)<0:ct(e,t.upper)<=0));var n,r}function Xn(e,t,n,r,i,o){if(!n||0===n.length)return e;var u=t.query.index,a=u.multiEntry,c=t.query.range,l=r.schema.primaryKey.extractKey,f=u.extractKey,p=(u.lowLevelIndex||u).extractKey;return n=n.reduce((function(e,n){var r=e,i=[];if("add"===n.type||"put"===n.type)for(var o=new An,u=n.values.length-1;0<=u;--u){var p,h=n.values[u],d=l(h);o.hasKey(d)||(p=f(h),(a&&s(p)?p.some((function(e){return Jn(e,c)})):Jn(p,c))&&(o.addKey(d),i.push(h)))}switch(n.type){case"add":var g=(new An).addKeys(t.values?e.map((function(e){return l(e)})):e);r=e.concat(t.values?i.filter((function(e){return e=l(e),!g.hasKey(e)&&(g.addKey(e),!0)})):i.map((function(e){return l(e)})).filter((function(e){return!g.hasKey(e)&&(g.addKey(e),!0)})));break;case"put":var m=(new An).addKeys(n.values.map((function(e){return l(e)})));r=e.filter((function(e){return!m.hasKey(t.values?l(e):e)})).concat(t.values?i:i.map((function(e){return l(e)})));break;case"delete":var y=(new An).addKeys(n.keys);r=e.filter((function(e){return!y.hasKey(t.values?l(e):e)}));break;case"deleteRange":var v=n.range;r=e.filter((function(e){return!Jn(l(e),v)}))}return r}),e),n===e?e:(n.sort((function(e,t){return ct(p(e),p(t))||ct(l(e),l(t))})),t.limit&&t.limit<1/0&&(n.length>t.limit?n.length=t.limit:e.length===t.limit&&n.length<t.limit&&(i.dirty=!0)),o?Object.freeze(n):n)}function Yn(e,t){return 0===ct(e.lower,t.lower)&&0===ct(e.upper,t.upper)&&!!e.lowerOpen==!!t.lowerOpen&&!!e.upperOpen==!!t.upperOpen}function Zn(e,t){return function(e,t,n,r){if(void 0===e)return void 0!==t?-1:0;if(void 0===t)return 1;if(0===(t=ct(e,t))){if(n&&r)return 0;if(n)return 1;if(r)return-1}return t}(e.lower,t.lower,e.lowerOpen,t.lowerOpen)<=0&&0<=function(e,t,n,r){if(void 0===e)return void 0!==t?1:0;if(void 0===t)return-1;if(0===(t=ct(e,t))){if(n&&r)return 0;if(n)return-1;if(r)return 1}return t}(e.upper,t.upper,e.upperOpen,t.upperOpen)}function er(e,t,n,r){e.subscribers.add(n),r.addEventListener("abort",(function(){var r,i;e.subscribers.delete(n),0===e.subscribers.size&&(r=e,i=t,setTimeout((function(){0===r.subscribers.size&&C(i,r)}),3e3))}))}var tr={stack:"dbcore",level:0,name:"Cache",create:function(e){var n=e.schema.name;return t(t({},e),{transaction:function(t,r,i){var o,s,u=e.transaction(t,r,i);return"readwrite"===r&&(s=(o=new AbortController).signal,i=function(i){return function(){if(o.abort(),"readwrite"===r){for(var s=new Set,a=0,c=t;a<c.length;a++){var l=c[a],f=On["idb://".concat(n,"/").concat(l)];if(f){var p=e.table(l),h=f.optimisticOps.filter((function(e){return e.trans===u}));if(u._explicit&&i&&u.mutatedParts)for(var d=0,g=Object.values(f.queries.query);d<g.length;d++)for(var m=0,y=(w=g[d]).slice();m<y.length;m++)xn((T=y[m]).obsSet,u.mutatedParts)&&(C(w,T),T.subscribers.forEach((function(e){return s.add(e)})));else if(0<h.length){f.optimisticOps=f.optimisticOps.filter((function(e){return e.trans!==u}));for(var v=0,b=Object.values(f.queries.query);v<b.length;v++)for(var w,T,A,q=0,_=(w=b[v]).slice();q<_.length;q++)null!=(T=_[q]).res&&u.mutatedParts&&(i&&!T.dirty?(A=Object.isFrozen(T.res),A=Xn(T.res,T.req,h,p,T,A),T.dirty?(C(w,T),T.subscribers.forEach((function(e){return s.add(e)}))):A!==T.res&&(T.res=A,T.promise=Ae.resolve({result:A}))):(T.dirty&&C(w,T),T.subscribers.forEach((function(e){return s.add(e)}))))}}}s.forEach((function(e){return e()}))}}},u.addEventListener("abort",i(!1),{signal:s}),u.addEventListener("error",i(!1),{signal:s}),u.addEventListener("complete",i(!0),{signal:s})),u},table:function(r){var i=e.table(r),o=i.schema.primaryKey;return t(t({},i),{mutate:function(e){var s=ve.trans;if(o.outbound||"disabled"===s.db._options.cache||s.explicit||"readwrite"!==s.idbtrans.mode)return i.mutate(e);var u=On["idb://".concat(n,"/").concat(r)];return u?(s=i.mutate(e),"add"!==e.type&&"put"!==e.type||!(50<=e.values.length||Ln(o,e).some((function(e){return null==e})))?(u.optimisticOps.push(e),e.mutatedParts&&Cn(e.mutatedParts),s.then((function(t){0<t.numFailures&&(C(u.optimisticOps,e),(t=Qn(0,e,t))&&u.optimisticOps.push(t),e.mutatedParts&&Cn(e.mutatedParts))})),s.catch((function(){C(u.optimisticOps,e),e.mutatedParts&&Cn(e.mutatedParts)}))):s.then((function(n){var r=Qn(0,t(t({},e),{values:e.values.map((function(e,r){var i;return n.failures[r]||A(e=null!==(i=o.keyPath)&&void 0!==i&&i.includes(".")?P(e):t({},e),o.keyPath,n.results[r]),e}))}),n);u.optimisticOps.push(r),queueMicrotask((function(){return e.mutatedParts&&Cn(e.mutatedParts)}))})),s):i.mutate(e)},query:function(e){if(!Hn(ve,i)||!Vn("query",e))return i.query(e);var t="immutable"===(null===(u=ve.trans)||void 0===u?void 0:u.db._options.cache),o=(c=ve).requery,s=c.signal,u=function(e,t,n,r){var i=On["idb://".concat(e,"/").concat(t)];if(!i)return[];if(!(t=i.queries[n]))return[null,!1,i,null];var o=t[(r.query?r.query.index.name:null)||""];if(!o)return[null,!1,i,null];switch(n){case"query":var s=o.find((function(e){return e.req.limit===r.limit&&e.req.values===r.values&&Yn(e.req.query.range,r.query.range)}));return s?[s,!0,i,o]:[o.find((function(e){return("limit"in e.req?e.req.limit:1/0)>=r.limit&&(!r.values||e.req.values)&&Zn(e.req.query.range,r.query.range)})),!1,i,o];case"count":return s=o.find((function(e){return Yn(e.req.query.range,r.query.range)})),[s,!!s,i,o]}}(n,r,"query",e),a=u[0],c=u[1],l=u[2],f=u[3];return a&&c?a.obsSet=e.obsSet:(c=i.query(e).then((function(e){var n=e.result;if(a&&(a.res=n),t){for(var r=0,i=n.length;r<i;++r)Object.freeze(n[r]);Object.freeze(n)}else e.result=P(n);return e})).catch((function(e){return f&&a&&C(f,a),Promise.reject(e)})),a={obsSet:e.obsSet,promise:c,subscribers:new Set,type:"query",req:e,dirty:!1},f?f.push(a):(f=[a],(l=l||(On["idb://".concat(n,"/").concat(r)]={queries:{query:{},count:{}},objs:new Map,optimisticOps:[],unsignaledParts:{}})).queries.query[e.query.index.name||""]=f)),er(a,f,o,s),a.promise.then((function(n){return{result:Xn(n.result,e,null==l?void 0:l.optimisticOps,i,a,t)}}))}})}})}};function nr(e,t){return new Proxy(e,{get:function(e,n,r){return"db"===n?t:Reflect.get(e,n,r)}})}var rr=(ir.prototype.version=function(e){if(isNaN(e)||e<.1)throw new H.Type("Given version is not a positive number");if(e=Math.round(10*e)/10,this.idbdb||this._state.isBeingOpened)throw new H.Schema("Cannot add version when database is open");this.verno=Math.max(this.verno,e);var t=this._versions,n=t.filter((function(t){return t._cfg.version===e}))[0];return n||(n=new this.Version(e),t.push(n),t.sort(sn),n.stores({}),this._state.autoSchema=!1,n)},ir.prototype._whenReady=function(e){var t=this;return this.idbdb&&(this._state.openComplete||ve.letThrough||this._vip)?e():new Ae((function(e,n){if(t._state.openComplete)return n(new H.DatabaseClosed(t._state.dbOpenError));if(!t._state.isBeingOpened){if(!t._state.autoOpen)return void n(new H.DatabaseClosed);t.open().catch(Q)}t._state.dbReadyPromise.then(e,n)})).then(e)},ir.prototype.use=function(e){var t=e.stack,n=e.create,r=e.level,i=e.name;return i&&this.unuse({stack:t,name:i}),(e=this._middlewares[t]||(this._middlewares[t]=[])).push({stack:t,create:n,level:null==r?10:r,name:i}),e.sort((function(e,t){return e.level-t.level})),this},ir.prototype.unuse=function(e){var t=e.stack,n=e.name,r=e.create;return t&&this._middlewares[t]&&(this._middlewares[t]=this._middlewares[t].filter((function(e){return r?e.create!==r:!!n&&e.name!==n}))),this},ir.prototype.open=function(){var e=this;return $e(ye,(function(){return Bn(e)}))},ir.prototype._close=function(){this.on.close.fire(new CustomEvent("close"));var e=this._state,t=tt.indexOf(this);if(0<=t&&tt.splice(t,1),this.idbdb){try{this.idbdb.close()}catch(t){}this.idbdb=null}e.isBeingOpened||(e.dbReadyPromise=new Ae((function(t){e.dbReadyResolve=t})),e.openCanceller=new Ae((function(t,n){e.cancelOpen=n})))},ir.prototype.close=function(e){var t=(void 0===e?{disableAutoOpen:!0}:e).disableAutoOpen;e=this._state,t?(e.isBeingOpened&&e.cancelOpen(new H.DatabaseClosed),this._close(),e.autoOpen=!1,e.dbOpenError=new H.DatabaseClosed):(this._close(),e.autoOpen=this._options.autoOpen||e.isBeingOpened,e.openComplete=!1,e.dbOpenError=null)},ir.prototype.delete=function(e){var t=this;void 0===e&&(e={disableAutoOpen:!0});var n=0<arguments.length&&"object"!=typeof arguments[0],r=this._state;return new Ae((function(i,o){function s(){t.close(e);var n=t._deps.indexedDB.deleteDatabase(t.name);n.onsuccess=Ce((function(){var e,n,r;e=t._deps,n=t.name,r=e.indexedDB,e=e.IDBKeyRange,bn(r)||n===nt||vn(r,e).delete(n).catch(Q),i()})),n.onerror=Nt(o),n.onblocked=t._fireOnBlocked}if(n)throw new H.InvalidArgument("Invalid closeOptions argument to db.delete()");r.isBeingOpened?r.dbReadyPromise.then(s):s()}))},ir.prototype.backendDB=function(){return this.idbdb},ir.prototype.isOpen=function(){return null!==this.idbdb},ir.prototype.hasBeenClosed=function(){var e=this._state.dbOpenError;return e&&"DatabaseClosed"===e.name},ir.prototype.hasFailed=function(){return null!==this._state.dbOpenError},ir.prototype.dynamicallyOpened=function(){return this._state.autoSchema},Object.defineProperty(ir.prototype,"tables",{get:function(){var e=this;return o(this._allTables).map((function(t){return e._allTables[t]}))},enumerable:!1,configurable:!0}),ir.prototype.transaction=function(){var e=function(e,t,n){var r=arguments.length;if(r<2)throw new H.InvalidArgument("Too few arguments");for(var i=new Array(r-1);--r;)i[r-1]=arguments[r];return n=i.pop(),[e,U(i),n]}.apply(this,arguments);return this._transaction.apply(this,e)},ir.prototype._transaction=function(e,t,n){var r=this,i=ve.trans;i&&i.db===this&&-1===e.indexOf("!")||(i=null);var o,s,u=-1!==e.indexOf("?");e=e.replace("!","").replace("?","");try{if(s=t.map((function(e){if("string"!=typeof(e=e instanceof r.Table?e.name:e))throw new TypeError("Invalid table argument to Dexie.transaction(). Only Table or String are allowed");return e})),"r"==e||e===rt)o=rt;else{if("rw"!=e&&e!=it)throw new H.InvalidArgument("Invalid transaction mode: "+e);o=it}if(i){if(i.mode===rt&&o===it){if(!u)throw new H.SubTransaction("Cannot enter a sub-transaction with READWRITE mode when parent transaction is READONLY");i=null}i&&s.forEach((function(e){if(i&&-1===i.storeNames.indexOf(e)){if(!u)throw new H.SubTransaction("Table "+e+" not included in parent transaction.");i=null}})),u&&i&&!i.active&&(i=null)}}catch(n){return i?i._promise(null,(function(e,t){t(n)})):Xe(n)}var a=function e(t,n,r,i,o){return Ae.resolve().then((function(){var s=ve.transless||ve,u=t._createTransaction(n,r,t._dbSchema,i);if(u.explicit=!0,s={trans:u,transless:s},i)u.idbtrans=i.idbtrans;else try{u.create(),u.idbtrans._explicit=!0,t._state.PR1398_maxLoop=3}catch(s){return s.name===z.InvalidState&&t.isOpen()&&0<--t._state.PR1398_maxLoop?(console.warn("Dexie: Need to reopen db"),t.close({disableAutoOpen:!1}),t.open().then((function(){return e(t,n,r,null,o)}))):Xe(s)}var a,c=B(o);return c&&Le(),s=Ae.follow((function(){var e;(a=o.call(u,u))&&(c?(e=Ge.bind(null,null),a.then(e,e)):"function"==typeof a.next&&"function"==typeof a.throw&&(a=Kn(a)))}),s),(a&&"function"==typeof a.then?Ae.resolve(a).then((function(e){return u.active?e:Xe(new H.PrematureCommit("Transaction committed too early. See http://bit.ly/2kdckMn"))})):s.then((function(){return a}))).then((function(e){return i&&u._resolve(),u._completion.then((function(){return e}))})).catch((function(e){return u._reject(e),Xe(e)}))}))}.bind(null,this,o,s,i,n);return i?i._promise(o,a,"lock"):ve.trans?$e(ve.transless,(function(){return r._whenReady(a)})):this._whenReady(a)},ir.prototype.table=function(e){if(!l(this._allTables,e))throw new H.InvalidTable("Table ".concat(e," does not exist"));return this._allTables[e]},ir);function ir(e,n){var r=this;this._middlewares={},this.verno=0;var i=ir.dependencies;this._options=n=t({addons:ir.addons,autoOpen:!0,indexedDB:i.indexedDB,IDBKeyRange:i.IDBKeyRange,cache:"cloned"},n),this._deps={indexedDB:n.indexedDB,IDBKeyRange:n.IDBKeyRange},i=n.addons,this._dbSchema={},this._versions=[],this._storeNames=[],this._allTables={},this.idbdb=null,this._novip=this;var o,s,u,a,c,l={dbOpenError:null,isBeingOpened:!1,onReadyBeingFired:null,openComplete:!1,dbReadyResolve:Q,dbReadyPromise:null,cancelOpen:Q,openCanceller:null,autoSchema:!0,PR1398_maxLoop:3,autoOpen:n.autoOpen};l.dbReadyPromise=new Ae((function(e){l.dbReadyResolve=e})),l.openCanceller=new Ae((function(e,t){l.cancelOpen=t})),this._state=l,this.name=e,this.on=vt(this,"populate","blocked","versionchange","close",{ready:[re,Q]}),this.once=function(e,t){var n=function(){for(var i=[],o=0;o<arguments.length;o++)i[o]=arguments[o];r.on(e).unsubscribe(n),t.apply(r,i)};return r.on(e,n)},this.on.ready.subscribe=v(this.on.ready.subscribe,(function(e){return function(t,n){ir.vip((function(){var i,o=r._state;o.openComplete?(o.dbOpenError||Ae.resolve().then(t),n&&e(t)):o.onReadyBeingFired?(o.onReadyBeingFired.push(t),n&&e(t)):(e(t),i=r,n||e((function e(){i.on.ready.unsubscribe(t),i.on.ready.unsubscribe(e)})))}))}})),this.Collection=(o=this,bt(jt.prototype,(function(e,t){this.db=o;var n=st,r=null;if(t)try{n=t()}catch(e){r=e}var i=e._ctx;e=(t=i.table).hook.reading.fire,this._ctx={table:t,index:i.index,isPrimKey:!i.index||t.schema.primKey.keyPath&&i.index===t.schema.primKey.name,range:n,keysOnly:!1,dir:"next",unique:"",algorithm:null,filter:null,replayFilter:null,justLimit:!0,isMatch:null,offset:0,limit:1/0,error:r,or:i.or,valueMapper:e!==J?e:null}}))),this.Table=(s=this,bt(mt.prototype,(function(e,t,n){this.db=s,this._tx=n,this.name=e,this.schema=t,this.hook=s._allTables[e]?s._allTables[e].hook:vt(null,{creating:[Z,Q],reading:[X,J],updating:[te,Q],deleting:[ee,Q]})}))),this.Transaction=(u=this,bt(zt.prototype,(function(e,t,n,r,i){var o=this;"readonly"!==e&&t.forEach((function(e){(e=null===(e=n[e])||void 0===e?void 0:e.yProps)&&(t=t.concat(e.map((function(e){return e.updatesTable}))))})),this.db=u,this.mode=e,this.storeNames=t,this.schema=n,this.chromeTransactionDurability=r,this.idbtrans=null,this.on=vt(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 Ae((function(e,t){o._resolve=e,o._reject=t})),this._completion.then((function(){o.active=!1,o.on.complete.fire()}),(function(e){var t=o.active;return o.active=!1,o.on.error.fire(e),o.parent?o.parent._reject(e):t&&o.idbtrans&&o.idbtrans.abort(),Xe(e)}))}))),this.Version=(a=this,bt(mn.prototype,(function(e){this.db=a,this._cfg={version:e,storesSource:null,dbschema:{},tables:{},contentUpgrade:null}}))),this.WhereClause=(c=this,bt(Bt.prototype,(function(e,t,n){if(this.db=c,this._ctx={table:e,index:":id"===t?null:t,or:n},this._cmp=this._ascending=ct,this._descending=function(e,t){return ct(t,e)},this._max=function(e,t){return 0<ct(e,t)?e:t},this._min=function(e,t){return ct(e,t)<0?e:t},this._IDBKeyRange=c._deps.IDBKeyRange,!this._IDBKeyRange)throw new H.MissingAPI}))),this.on("versionchange",(function(e){0<e.newVersion?console.warn("Another connection wants to upgrade database '".concat(r.name,"'. Closing db now to resume the upgrade.")):console.warn("Another connection wants to delete database '".concat(r.name,"'. Closing db now to resume the delete request.")),r.close({disableAutoOpen:!1})})),this.on("blocked",(function(e){!e.newVersion||e.newVersion<e.oldVersion?console.warn("Dexie.delete('".concat(r.name,"') was blocked")):console.warn("Upgrade '".concat(r.name,"' blocked by other connection holding version ").concat(e.oldVersion/10))})),this._maxKey=Qt(n.IDBKeyRange),this._createTransaction=function(e,t,n,i){return new r.Transaction(e,t,n,r._options.chromeTransactionDurability,i)},this._fireOnBlocked=function(e){r.on("blocked").fire(e),tt.filter((function(e){return e.name===r.name&&e!==r&&!e._state.vcFired})).map((function(t){return t.on("versionchange").fire(e)}))},this.use(Wn),this.use(tr),this.use($n),this.use(Mn),this.use(Gn);var f=new Proxy(this,{get:function(e,t,n){if("_vip"===t)return!0;if("table"===t)return function(e){return nr(r.table(e),f)};var i=Reflect.get(e,t,n);return i instanceof mt?nr(i,f):"tables"===t?i.map((function(e){return nr(e,f)})):"_createTransaction"===t?function(){return nr(i.apply(this,arguments),f)}:i}});this.vip=f,i.forEach((function(e){return e(r)}))}K="undefined"!=typeof Symbol&&"observable"in Symbol?Symbol.observable:"@@observable";var or,sr=(ur.prototype.subscribe=function(e,t,n){return this._subscribe(e&&"function"!=typeof e?e:{next:e,error:t,complete:n})},ur.prototype[K]=function(){return this},ur);function ur(e){this._subscribe=e}try{or={indexedDB:i.indexedDB||i.mozIndexedDB||i.webkitIndexedDB||i.msIndexedDB,IDBKeyRange:i.IDBKeyRange||i.webkitIDBKeyRange}}catch(k){or={indexedDB:null,IDBKeyRange:null}}function ar(e){var t,n=!1,r=new sr((function(r){var i,o=B(e),s=!1,u={},a={},c={get closed(){return s},unsubscribe:function(){s||(s=!0,i&&i.abort(),f&&Gt.storagemutated.unsubscribe(h))}};r.start&&r.start(c);var f=!1,p=function(){return Je(d)},h=function(e){Pn(u,e),xn(a,u)&&p()},d=function(){var c,d,g;!s&&or.indexedDB&&(u={},c={},i&&i.abort(),i=new AbortController,g=function(t){var n=xe();try{o&&Le();var r=Fe(e,t);return r=o?r.finally(Ge):r}finally{n&&Oe()}}(d={subscr:c,signal:i.signal,requery:p,querier:e,trans:null}),Promise.resolve(g).then((function(e){n=!0,t=e,s||d.signal.aborted||(u={},function(e){for(var t in e)if(l(e,t))return;return 1}(a=c)||f||(Gt(Ft,h),f=!0),Je((function(){return!s&&r.next&&r.next(e)})))}),(function(e){n=!1,["DatabaseClosedError","AbortError"].includes(null==e?void 0:e.name)||s||Je((function(){s||r.error&&r.error(e)}))})))};return setTimeout(p,0),c}));return r.hasValue=function(){return n},r.getValue=function(){return t},r}var cr=rr;function lr(e){var t=pr;try{pr=!0,Gt.storagemutated.fire(e),In(e,!0)}finally{pr=t}}f(cr,t(t({},$),{delete:function(e){return new cr(e,{addons:[]}).delete()},exists:function(e){return new cr(e,{addons:[]}).open().then((function(e){return e.close(),!0})).catch("NoSuchDatabaseError",(function(){return!1}))},getDatabaseNames:function(e){try{return n=(t=cr.dependencies).indexedDB,t=t.IDBKeyRange,(bn(n)?Promise.resolve(n.databases()).then((function(e){return e.map((function(e){return e.name})).filter((function(e){return e!==nt}))})):vn(n,t).toCollection().primaryKeys()).then(e)}catch(e){return Xe(new H.MissingAPI)}var t,n},defineClass:function(){return function(e){u(this,e)}},ignoreTransaction:function(e){return ve.trans?$e(ve.transless,e):e()},vip:wn,async:function(e){return function(){try{var t=Kn(e.apply(this,arguments));return t&&"function"==typeof t.then?t:Ae.resolve(t)}catch(t){return Xe(t)}}},spawn:function(e,t,n){try{var r=Kn(e.apply(n,t||[]));return r&&"function"==typeof r.then?r:Ae.resolve(r)}catch(e){return Xe(e)}},currentTransaction:{get:function(){return ve.trans||null}},waitFor:function(e,t){return t=Ae.resolve("function"==typeof e?cr.ignoreTransaction(e):e).timeout(t||6e4),ve.trans?ve.trans.waitFor(t):t},Promise:Ae,debug:{get:function(){return ie},set:function(e){oe(e)}},derive:d,extend:u,props:f,override:v,Events:vt,on:Gt,liveQuery:ar,extendObservabilitySet:Pn,getByKeyPath:T,setByKeyPath:A,delByKeyPath:function(e,t){"string"==typeof t?A(e,t,void 0):"length"in t&&[].map.call(t,(function(t){A(e,t,void 0)}))},shallowClone:q,deepClone:P,getObjectDiff:Fn,cmp:ct,asap:w,minKey:-1/0,addons:[],connections:tt,errnames:z,dependencies:or,cache:On,semVer:"4.2.1",version:"4.2.1".split(".").map((function(e){return parseInt(e)})).reduce((function(e,t,n){return e+t/Math.pow(10,2*n)}))})),cr.maxKey=Qt(cr.dependencies.IDBKeyRange),"undefined"!=typeof dispatchEvent&&"undefined"!=typeof addEventListener&&(Gt(Ft,(function(e){pr||(e=new CustomEvent(Lt,{detail:e}),pr=!0,dispatchEvent(e),pr=!1)})),addEventListener(Lt,(function(e){e=e.detail,pr||lr(e)})));var fr,pr=!1,hr=function(){};return"undefined"!=typeof BroadcastChannel&&((hr=function(){(fr=new BroadcastChannel(Lt)).onmessage=function(e){return e.data&&lr(e.data)}})(),"function"==typeof fr.unref&&fr.unref(),Gt(Ft,(function(e){pr||fr.postMessage(e)}))),"undefined"!=typeof addEventListener&&(addEventListener("pagehide",(function(e){if(!rr.disableBfCache&&e.persisted){ie&&console.debug("Dexie: handling persisted pagehide"),null!=fr&&fr.close();for(var t=0,n=tt;t<n.length;t++)n[t].close({disableAutoOpen:!1})}})),addEventListener("pageshow",(function(e){!rr.disableBfCache&&e.persisted&&(ie&&console.debug("Dexie: handling persisted pageshow"),hr(),lr({all:new An(-1/0,[[]])}))}))),Ae.rejectionMapper=function(e,t){return!e||e instanceof M||e instanceof TypeError||e instanceof SyntaxError||!e.name||!V[e.name]?e:(t=new V[e.name](t||e.message,e),"stack"in e&&h(t,"stack",{get:function(){return this.inner.stack}}),t)},oe(ie),t(rr,Object.freeze({__proto__:null,Dexie:rr,liveQuery:ar,Entity:at,cmp:ct,PropModification:ht,replacePrefix:function(e,t){return new ht({replacePrefix:[e,t]})},add:function(e){return new ht({add:e})},remove:function(e){return new ht({remove:e})},default:rr,RangeSet:An,mergeRanges:_n,rangesOverlap:Un}),{default:rr}),rr}()}},t={};function n(r){var i=t[r];if(void 0!==i)return i.exports;var o=t[r]={exports:{}};return e[r].call(o.exports,o,o.exports,n),o.exports}n.d=(e,t)=>{for(var r in t)n.o(t,r)&&!n.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},n.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),n.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),n.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var r={};return(()=>{"use strict";function e(t){return e="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},e(t)}function t(t){if(null!=t){var n=t["function"==typeof Symbol&&Symbol.iterator||"@@iterator"],r=0;if(n)return n.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length))return{next:function(){return t&&r>=t.length&&(t=void 0),{value:t&&t[r++],done:!t}}}}throw new TypeError(e(t)+" is not iterable")}function i(){var e,t,n="function"==typeof Symbol?Symbol:{},r=n.iterator||"@@iterator",s=n.toStringTag||"@@toStringTag";function u(n,r,i,s){var u=r&&r.prototype instanceof c?r:c,l=Object.create(u.prototype);return o(l,"_invoke",function(n,r,i){var o,s,u,c=0,l=i||[],f=!1,p={p:0,n:0,v:e,a:h,f:h.bind(e,4),d:function(t,n){return o=t,s=0,u=e,p.n=n,a}};function h(n,r){for(s=n,u=r,t=0;!f&&c&&!i&&t<l.length;t++){var i,o=l[t],h=p.p,d=o[2];n>3?(i=d===r)&&(u=o[(s=o[4])?5:(s=3,3)],o[4]=o[5]=e):o[0]<=h&&((i=n<2&&h<o[1])?(s=0,p.v=r,p.n=o[1]):h<d&&(i=n<3||o[0]>r||r>d)&&(o[4]=n,o[5]=r,p.n=d,s=0))}if(i||n>1)return a;throw f=!0,r}return function(i,l,d){if(c>1)throw TypeError("Generator is already running");for(f&&1===l&&h(l,d),s=l,u=d;(t=s<2?e:u)||!f;){o||(s?s<3?(s>1&&(p.n=-1),h(s,u)):p.n=u:p.v=u);try{if(c=2,o){if(s||(i="next"),t=o[i]){if(!(t=t.call(o,u)))throw TypeError("iterator result is not an object");if(!t.done)return t;u=t.value,s<2&&(s=0)}else 1===s&&(t=o.return)&&t.call(o),s<2&&(u=TypeError("The iterator does not provide a '"+i+"' method"),s=1);o=e}else if((t=(f=p.n<0)?u:n.call(r,p))!==a)break}catch(t){o=e,s=1,u=t}finally{c=1}}return{value:t,done:f}}}(n,i,s),!0),l}var a={};function c(){}function l(){}function f(){}t=Object.getPrototypeOf;var p=[][r]?t(t([][r]())):(o(t={},r,(function(){return this})),t),h=f.prototype=c.prototype=Object.create(p);function d(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,f):(e.__proto__=f,o(e,s,"GeneratorFunction")),e.prototype=Object.create(h),e}return l.prototype=f,o(h,"constructor",f),o(f,"constructor",l),l.displayName="GeneratorFunction",o(f,s,"GeneratorFunction"),o(h),o(h,s,"Generator"),o(h,r,(function(){return this})),o(h,"toString",(function(){return"[object Generator]"})),(i=function(){return{w:u,m:d}})()}function o(e,t,n,r){var i=Object.defineProperty;try{i({},"",{})}catch(e){i=0}o=function(e,t,n,r){function s(t,n){o(e,t,(function(e){return this._invoke(t,n,e)}))}t?i?i(e,t,{value:n,enumerable:!r,configurable:!r,writable:!r}):e[t]=n:(s("next",0),s("throw",1),s("return",2))},o(e,t,n,r)}function s(e,t,n,r,i,o,s){try{var u=e[o](s),a=u.value}catch(e){return void n(e)}u.done?t(a):Promise.resolve(a).then(r,i)}function u(e){return function(){var t=this,n=arguments;return new Promise((function(r,i){var o=e.apply(t,n);function u(e){s(o,r,i,u,a,"next",e)}function a(e){s(o,r,i,u,a,"throw",e)}u(void 0)}))}}function a(e,t,n,r){return $.ajax({url:e,type:t,data:n,contentType:r&&void 0!==r.contentType?r.contentType:"application/json; charset=utf-8",dataType:r&&void 0!==r.dataType?r.dataType:"json",processData:!(!r||void 0===r.processData)&&r.processData,cache:window&&window.BIMPLUS_SDK_ENABLE_CACHE||!1,async:!0,xhr:function(){var e=$.ajaxSettings.xhr();return r&&void 0!==r.xhrUploadProgress&&e.upload.addEventListener("progress",r.xhrUploadProgress,!1),e},beforeSend:function(t){if(window&&void 0!==window.BIMPLUS_SDK_PENDING_REQUESTS&&window.BIMPLUS_SDK_PENDING_REQUESTS++,null!=r&&r.token){var n=r.tokenType?r.tokenType:"BimPlus";t.setRequestHeader("Authorization",n+" "+r.token)}if(null!=r&&r.eTag&&(t.setRequestHeader("Cache-Control","no-cache"),window&&!window.BIMPLUS_SDK_DISABLE_ETAG&&t.setRequestHeader("If-None-Match",r.eTag)),null!=r&&r.headers)for(var i in r.headers)i&&t.setRequestHeader(i,r.headers[i]);!t._url&&e&&(t._url=e)},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 n={url:e,response:null!=t&&t.responseText&&(null==t?void 0:t.responseText.length)>0?JSON.parse(t.responseText):null};console.log(JSON.stringify(n))}}})}function c(e,t,n,r){var i=$.Deferred();console.debug("xmlHttpRequest config=",r);var o=new XMLHttpRequest;return o.open(t,e,!0),o.setRequestHeader("Authorization","BimPlus "+r.token),window&&void 0!==window.BIMPLUS_SDK_PENDING_REQUESTS&&window.BIMPLUS_SDK_PENDING_REQUESTS++,null!=r&&r.responseType&&(console.debug("responseType is set to",r.responseType),o.responseType=r.responseType),null!=r&&r.eTag&&(console.debug("setRequestHeader is set to eTag",r.eTag),o.setRequestHeader("Cache-Control","no-cache"),window&&!window.BIMPLUS_SDK_DISABLE_ETAG&&o.setRequestHeader("If-None-Match",r.eTag)),o.onload=function(){window&&void 0!==window.BIMPLUS_SDK_PENDING_REQUESTS&&window.BIMPLUS_SDK_PENDING_REQUESTS--,i.resolve(o.response,o.status,o)},o.onerror=function(){window&&void 0!==window.BIMPLUS_SDK_PENDING_REQUESTS&&window.BIMPLUS_SDK_PENDING_REQUESTS--,i.reject()},n&&o.setRequestHeader("Content-Type","application/json;charset=UTF-8"),o.send(n),i.promise()}function l(e,t,n,r){return t||(t={}),t.token||(t.token=n),t.tokenType&&t.tokenType===r||(t.tokenType=r),t.queryParams&&(e+=function(e){var t="?";for(var n in e)Object.hasOwn(e,n)&&(t+=n+"="+e[n]+"&");return t=t.slice(0,-1)}(t.queryParams)),{ajaxConfig:t,url:e}}function f(e,n,r,o,s){s||(s={}),s.token||(s.token=n),s.queryParams||(s.queryParams={}),s.queryParams.chunkSize||(s.queryParams.chunkSize=r),s.queryParams.chunk=1;var a=$.Deferred(),c=[];return e.get(o,s).done(function(){var n=u(i().m((function n(r,u,l){var f,p,h,d;return i().w((function(n){for(;;)switch(n.n){case 0:c.push(r),f=0,200===l.status?(p=l.getResponseHeader("X-Total-Count"))?f=parseInt(p,10):console.warn("Request for "+o+" doesn't support chunked responses!"):304===l.status&&(l["Cached-X-Total-Count"]?f=l["Cached-X-Total-Count"]:console.warn("Cached request for "+o+" doesn't contain chunk info!")),h=i().m((function t(){var n;return i().w((function(t){for(;;)switch(t.n){case 0:s.queryParams.chunk=d,n=$.Deferred(),e.get(o,s).done((function(e){n.resolve(e)})).fail((function(e,t){n.reject(e,t)})),c.push(n);case 1:return t.a(2)}}),t)})),d=2;case 1:if(!(d<=f)){n.n=3;break}return n.d(t(h()),2);case 2:d++,n.n=1;break;case 3:a.resolve(c);case 4:return n.a(2)}}),n)})));return function(e,t,r){return n.apply(this,arguments)}}()).fail((function(e,t){a.reject(e,t)})),a.promise()}function p(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.attachmentId,n=e.file,r=e.fileName,o=e.ajaxConfig,s=e.request,a=e.url,c=e.deferred;e.uploadData.start=e.uploadData.currentChunk*e.uploadData.chunkSize,e.uploadData.end=Math.min(e.uploadData.fileSize,e.uploadData.start+e.uploadData.chunkSize)-1;var l=n.slice(e.uploadData.start,e.uploadData.end+1);return o.headers={"Content-Range":"bytes "+e.uploadData.start+"-"+e.uploadData.end+"/"+e.uploadData.fileSize,"Content-Disposition":'inline; name="'+r+'"; filename="'+n.name+'"',"Chunk-FileId":t},s.put(a,l,o).done(function(){var l=u(i().m((function u(l,f,h){return i().w((function(i){for(;;)switch(i.n){case 0:if(e.uploadData.doCallback(l,f,h),e.uploadData.currentChunk++,!(e.uploadData.currentChunk<e.uploadData.totalChunks)){i.n=1;break}return i.a(2,p({attachmentId:t,uploadData:e.uploadData,file:n,fileName:r,ajaxConfig:o,request:s,url:a,deferred:c}));case 1:c.resolve(l);case 2:return i.a(2)}}),u)})));return function(e,t,n){return l.apply(this,arguments)}}()).fail((function(i,u,l){if(e.uploadData.doCallback({error:i}))return p({attachmentId:t,uploadData:e.uploadData,file:n,fileName:r,ajaxConfig:o,request:s,url:a,deferred:c});c.reject(i,u,l)}))}function h(e,t,n,r,o){var s,a,c=null==r?void 0:r.file,l=null==r?void 0:r.opts,f=null==l?void 0:l.chunkSize,h=2147482624;f>0&&f<h||(f=h);var d=c.size,g=Math.ceil(d/f),m=0*f,y={currentChunk:0,start:m,end:Math.min(d,m+f)-1,totalChunks:g,fileSize:d,chunkSize:f,doCallback:function(e,t,n){var r;return null==l||null===(r=l.callback)||void 0===r?void 0:r.call(l,e,t,n)}},v=c.slice(y.start,y.end+1),b=null!=c&&c.name?(null===(s=(a=c.name).substring)||void 0===s?void 0:s.call(a,0,c.name.lastIndexOf(".")))||c.name:"";!function(e){var t,n,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};e||(e={}),e.token||(e.token=r.token),e.contentType=!1,e.processData=!1,e.headers||(e.headers={}),e.headers["Content-Range"]="bytes "+r.uploadData.start+"-"+r.uploadData.end+"/"+r.uploadData.fileSize,e.headers["Content-Disposition"]='inline; name="'+r.fileName+'"; filename="'+r.file.name+'"',e.queryParams||(e.queryParams={});var i=null==r||null===(t=r.data)||void 0===t?void 0:t.documentFolderId;!e.queryParams.DocumentFolderId&&i&&(e.queryParams.DocumentFolderId=i);var o=null==r||null===(n=r.data)||void 0===n?void 0:n.uploadProgress;e.xhrUploadProgress||"function"!=typeof o||(e.xhrUploadProgress=function(e){e||(e={}),e.extraData={start:r.uploadData.start,end:r.uploadData.end,fileSize:r.uploadData.fileSize,chunk:r.uploadData.currentChunk+1,total:r.uploadData.totalChunks};for(var t=arguments.length,n=new Array(t>1?t-1:0),i=1;i<t;i++)n[i-1]=arguments[i];return o.apply(void 0,[e].concat(n))})}(o,{token:t,data:r,fileName:b,file:c,uploadData:y});var w=$.Deferred(),T=function(){return e.put(n,v,o).done(function(){var t=u(i().m((function t(r,s,u){var a;return i().w((function(t){for(;;)switch(t.n){case 0:if(a="00000000-0000-0000-0000-000000000000"===r.id?r.fileName:r.id,y.doCallback(r,s,u),y.currentChunk++,!(y.currentChunk<y.totalChunks)){t.n=1;break}return t.a(2,p({attachmentId:a,uploadData:y,file:c,fileName:b,ajaxConfig:o,request:e,url:n,deferred:w}));case 1:w.resolve(r,s,u);case 2:return t.a(2)}}),t)})));return function(e,n,r){return t.apply(this,arguments)}}()).fail((function(e,t,n){if(y.doCallback({error:e}))return T();w.reject(e,t,n)}))};return T(),w.promise()}n.r(r),n.d(r,{Api:()=>He,IDBCache:()=>N,createDefaultConfig:()=>Ve});var d=function(){var e=null,t=null;this.setAccessToken=function(t){e=t},this.setTokenType=function(e){t=e},this.get=function(n,r){var i=l(n,r,e,t),o=i.ajaxConfig,s=i.url;return null!=o&&o.useXMLHttpRequest?c(s,"GET",null,o):a(s,"GET",null,o)},this.getChunked=function(t,n){return f(this,e,"medium",t,n)},this.put=function(n,r,i){var o=l(n,i,e,t),s=o.ajaxConfig;return a(o.url,"PUT",r,s)},this.putChunked=function(t,n,r){return h(this,e,t,n,r)},this.post=function(n,r,i){var o=l(n,i,e,t),s=o.ajaxConfig,u=o.url;return null!=s&&s.useXMLHttpRequest?c(u,"POST",r,s):a(u,"POST",r,s)},this.del=function(n,r,i){var o=l(n,i,e,t),s=o.ajaxConfig,u=o.url;return r||(s.contentType=null),s.dataType=null,a(u,"DELETE",r||null,s)}},g=function(e){this.postSettings=function(t){return e.request.post(e.getApiUrl()+"application/settings",t)},this.getSettings=function(t){return t?e.request.get(e.getApiUrl()+"application/settings/"+t):e.request.get(e.getApiUrl()+"application/settings")},this.putSettings=function(t,n){return e.request.put(e.getApiUrl()+"application/settings/"+t,n)},this.deleteSettings=function(t){return e.request.del(e.getApiUrl()+"application/settings/"+t)}},m=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,n){return e.request.put(e.getApiTeamUrl()+"annotations/"+t,n)}},y=function(e){this.get=function(t){return e.request.get(e.getApiTeamUrl()+"attachments/"+t)},this.download=function(t,n){return n?e.request.get(e.getApiTeamUrl()+"attachments/"+t+"/versions/"+n+"/download"):e.request.get(e.getApiTeamUrl()+"attachments/"+t+"/download")},this.put=function(t,n){return e.request.put(e.getApiTeamUrl()+"attachments/"+t,n)},this.post=function(t,n,r){return e.request.put(e.getApiTeamUrl()+"attachments/"+t,n,{contentType:!1,processData:!1,dataType:null,xhrUploadProgress:r})},this.updateChunked=function(t,n,r){var i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},o=e.getApiTeamUrl()+"attachments/"+t+"/chunked",s={file:n,uploadProgress:r,opts:i};return e.request.putChunked(o,s,{queryParams:{}})},this.delete=function(t,n){return n?e.request.del(e.getApiTeamUrl()+"attachments/"+t+"/versions/"+n):e.request.del(e.getApiTeamUrl()+"attachments/"+t)},this.deleteSelected=function(t){return e.request.del(e.getApiTeamUrl()+"objects/"+t+"/attachments")},this.postVersion=function(t,n,r){return e.request.post(e.getApiTeamUrl()+"attachments/"+t+"/versions",n,{contentType:!1,processData:!1,dataType:null,xhrUploadProgress:r})},this.createVersionChunked=function(t,n,r){var i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},o=e.getApiTeamUrl()+"attachments/"+t+"/versions/chunked",s={file:n,uploadProgress:r,opts:i};return e.request.putChunked(o,s,{queryParams:{}})},this.getAllVersions=function(t){return e.request.get(e.getApiTeamUrl()+"attachments/"+t+"/versions")},this.releaseVersion=function(t,n){return e.request.put(e.getApiTeamUrl()+"attachments/"+t+"/release",n)},this.getBluebeam=function(t,n,r){var i={};return i.externalClientId=t,r&&(i.region=r),e.request.get(e.getApiUrl()+"external/attachments/bluebeam",{queryParams:i,headers:{"source-Authorization":"Bearer ".concat(n)}})},this.postBluebeam=function(t,n,r){var i={};return n&&(i.region=n),e.request.post(e.getApiTeamUrl()+"external/attachments/upload",r,{queryParams:i,headers:{"source-Authorization":"Bearer ".concat(t)}})},this.getExchange=function(){return e.request.get(e.getApiUrl()+"external/attachments/exchange")},this.postExternalAttachment=function(t){return e.request.post(e.getApiTeamUrl()+"external/attachments/upload",t)}},v=function(e){this.post=function(t){return e.request.post(e.getApiTeamUrl()+"attributetemplates",t)},this.get=function(t){return t?e.request.get(e.getApiTeamUrl()+"attributetemplates/"+t):e.request.get(e.getApiTeamUrl()+"attributetemplates")},this.put=function(t,n){return e.request.put(e.getApiTeamUrl()+"attributetemplates/"+t,n)},this.delete=function(t){return e.request.del(e.getApiTeamUrl()+"attributetemplates/"+t)}},b=function(e){this.post=function(t,n,r){return e.request.post(e.getApiUrl()+"authorize",JSON.stringify({user_id:t,password:n,application_id:r}))},this.forgotPassword=function(t){return e.request.post(e.getApiUrl()+"auth-forgot",t,{dataType:null})},this.checkAccessToken=function(){return e.request.get(e.getApiUrl()+"authorize")},this.requestCrossToken=function(){return e.request.post(e.getApiUrl()+"cross-token")},this.requestExternalAppToken=function(){return e.request.get(e.getApiUrl()+"validate")},this.getOpenIdConfiguration=function(){return e.request.get(e.getApiUrl()+".well-known/openid-configuration")}},w=n(744);const T=Symbol.for("Dexie"),A=globalThis[T]||(globalThis[T]=w);if(w.semVer!==A.semVer)throw new Error(`Two different versions of Dexie loaded in the same app: ${w.semVer} and ${A.semVer}`);const{liveQuery:q,mergeRanges:_,rangesOverlap:U,RangeSet:k,cmp:j,Entity:S,PropModification:P,replacePrefix:x,add:O,remove:E,DexieYProvider:D}=A,C=A;function I(){var e,t,n="function"==typeof Symbol?Symbol:{},r=n.iterator||"@@iterator",i=n.toStringTag||"@@toStringTag";function o(n,r,i,o){var a=r&&r.prototype instanceof u?r:u,c=Object.create(a.prototype);return R(c,"_invoke",function(n,r,i){var o,u,a,c=0,l=i||[],f=!1,p={p:0,n:0,v:e,a:h,f:h.bind(e,4),d:function(t,n){return o=t,u=0,a=e,p.n=n,s}};function h(n,r){for(u=n,a=r,t=0;!f&&c&&!i&&t<l.length;t++){var i,o=l[t],h=p.p,d=o[2];n>3?(i=d===r)&&(a=o[(u=o[4])?5:(u=3,3)],o[4]=o[5]=e):o[0]<=h&&((i=n<2&&h<o[1])?(u=0,p.v=r,p.n=o[1]):h<d&&(i=n<3||o[0]>r||r>d)&&(o[4]=n,o[5]=r,p.n=d,u=0))}if(i||n>1)return s;throw f=!0,r}return function(i,l,d){if(c>1)throw TypeError("Generator is already running");for(f&&1===l&&h(l,d),u=l,a=d;(t=u<2?e:a)||!f;){o||(u?u<3?(u>1&&(p.n=-1),h(u,a)):p.n=a:p.v=a);try{if(c=2,o){if(u||(i="next"),t=o[i]){if(!(t=t.call(o,a)))throw TypeError("iterator result is not an object");if(!t.done)return t;a=t.value,u<2&&(u=0)}else 1===u&&(t=o.return)&&t.call(o),u<2&&(a=TypeError("The iterator does not provide a '"+i+"' method"),u=1);o=e}else if((t=(f=p.n<0)?a:n.call(r,p))!==s)break}catch(t){o=e,u=1,a=t}finally{c=1}}return{value:t,done:f}}}(n,i,o),!0),c}var s={};function u(){}function a(){}function c(){}t=Object.getPrototypeOf;var l=[][r]?t(t([][r]())):(R(t={},r,(function(){return this})),t),f=c.prototype=u.prototype=Object.create(l);function p(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,c):(e.__proto__=c,R(e,i,"GeneratorFunction")),e.prototype=Object.create(f),e}return a.prototype=c,R(f,"constructor",c),R(c,"constructor",a),a.displayName="GeneratorFunction",R(c,i,"GeneratorFunction"),R(f),R(f,i,"Generator"),R(f,r,(function(){return this})),R(f,"toString",(function(){return"[object Generator]"})),(I=function(){return{w:o,m:p}})()}function R(e,t,n,r){var i=Object.defineProperty;try{i({},"",{})}catch(e){i=0}R=function(e,t,n,r){function o(t,n){R(e,t,(function(e){return this._invoke(t,n,e)}))}t?i?i(e,t,{value:n,enumerable:!r,configurable:!r,writable:!r}):e[t]=n:(o("next",0),o("throw",1),o("return",2))},R(e,t,n,r)}function B(e,t,n,r,i,o,s){try{var u=e[o](s),a=u.value}catch(e){return void n(e)}u.done?t(a):Promise.resolve(a).then(r,i)}function K(e){return function(){var t=this,n=arguments;return new Promise((function(r,i){var o=e.apply(t,n);function s(e){B(o,r,i,s,u,"next",e)}function u(e){B(o,r,i,s,u,"throw",e)}s(void 0)}))}}var N=function(){var e=new C("IDBCache",{autoOpen:!1});this._detectIE=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 n=e.indexOf("rv:");return parseInt(e.substring(n+3,e.indexOf(".",n)),10)}var r=e.indexOf("Edge/");return r>0&&parseInt(e.substring(r+5,e.indexOf(".",r)),10)},this._detectSafari=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("."))},this.isSupported=function(){var e=window.indexedDB||window.mozIndexedDB||window.webkitIndexedDB||window.msIndexedDB,t=window.IDBKeyRange||window.webkitIDBKeyRange,n=window.IDBCursor||window.webkitIDBCursor,r=this._detectIE(),i=this._detectSafari(),o=!1!==r&&r<11,s=!1!==i&&i<10,u=!!navigator.userAgent.match(/iPad|iPhone|iPod/i);return navigator.userAgent.match(/PhantomJS/i)?e&&t&&n:e&&t&&n&&!o&&!u&&!s},this.addResponse=function(t,n,r,i){return e.responseTable.put({etag:r,data:n,timestamp:$.now(),chunks:i?parseInt(i,10):null},t)},this.getResponse=function(t){return e.responseTable.get(t)},this.addBatchResponse=function(t,n,r,i){return e.batchedResponseTable.put({id:t+n,batch:n,data:r,timestamp:$.now(),chunks:i?parseInt(i,10):null})},this.getBatchResponse=function(t,n){return e.batchedResponseTable.get(t+n)},this.deleteBatchResponses=function(t){return e.batchedResponseTable.where("batch").equals(t).delete()},this.clear=function(){return Promise.all([e.responseTable.clear(),e.batchedResponseTable.clear()])},this.clearResponseTable=function(){return Promise.all([e.responseTable.clear()])},this.initDB=function(){return e.version(.1).stores({responseTable:""}),e.version(.2).stores({batchResponseTable:"&[id+batch],batch"}),e.version(.3).stores({batchedResponseTable:"id,batch",batchResponseTable:null}),e.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=K(I().m((function e(t){var n,r;return I().w((function(e){for(;;)switch(e.n){case 0:return n=function(e,t){var n,r;return"timestamp"===e?null!==(n=window)&&void 0!==n&&n.BIMPLUS_SDK_ENABLE_IDBCACHE_TIMESTAMP_DUMP?t:"NOT SHOWN":"data"===e?null!==(r=window)&&void 0!==r&&r.BIMPLUS_SDK_ENABLE_IDBCACHE_DATA_DUMP?t:"NOT SHOWN":t},r="",e.n=1,t.each((function(e){r+=" ".concat(JSON.stringify(e,n),"\n")}));case 1:return e.a(2,r)}}),e)})));return function(t){return e.apply(this,arguments)}}(),this.dumpTable=function(){var e=K(I().m((function e(t){var n,r,i,o,s;return I().w((function(e){for(;;)switch(e.n){case 0:return e.n=1,t.toCollection().count();case 1:return n=e.v,r=[t.schema.primKey].concat(t.schema.indexes),i=r.map((function(e){return e.src})).join(","),o="Table: ".concat(t.name,", Schema: '").concat(i,"', Count of entries: ").concat(n,"\n"),s=o,e.n=2,this.dumpTableContent(t);case 2:return o=s+=e.v,e.a(2,o)}}),e,this)})));return function(t){return e.apply(this,arguments)}}(),this.dumpDatabase=K(I().m((function t(){var n,r,i;return I().w((function(t){for(;;)switch(t.n){case 0:return n="",n+="BimWebSdk: Dexie Databases Dump\n",n+="===============================\n",n+="Database: ".concat(e.name," (Version: ").concat(e.verno,")\n"),r=n,t.n=1,this.dumpTable(e.responseTable);case 1:return n=r+=t.v,i=n,t.n=2,this.dumpTable(e.batchedResponseTable);case 2:return n=i+=t.v,t.a(2,n)}}),t,this)})))},M=function(){var e=null,t=null,n=new N;n.initDB().then((function(){window.BIMPLUS_SDK_ENABLE_IDBCACHE_DUMP&&n.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 n};var r=function(e,t,r){var i=r.getResponseHeader("ETag"),o=r.getResponseHeader("X-Total-Count"),s="arraybuffer"===r.responseType;if(i){var u=!1===s?JSON.stringify(t):null;n.addResponse(e,s?t:JSON.parse(u),i,o).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,r){var i=$.Deferred(),o=r.useXMLHttpRequest?c:a;return n.getBatchResponse(e,t).then((function(s){if(s){var u={};null!==s.chunks&&(u["Cached-X-Total-Count"]=s.chunks),u.status=304,i.resolve(s.data,304,u)}else o(e,"GET",null,r).done((function(r,o,s){var u=s.getResponseHeader("X-Total-Count"),a="arraybuffer"===s.responseType,c=!1===a?JSON.stringify(r):null;n.addBatchResponse(e,t,a?r:JSON.parse(c),u).then((function(){})).catch((function(t){console.error("BimWebSdk failed to add response to cache: "+e+" Reason: "+t.message)})),i.resolve(r,o,s)})).fail((function(e,t){i.reject(e,t)}))})),i.promise()},this.get=function(o,s){var u=l(o,s,e,t),f=u.ajaxConfig,p=u.url;if(f.responseBatch)return this.getBatchResponse(p,f.responseBatch,f);var h=$.Deferred(),d=f.useXMLHttpRequest?c:a;return n.getResponse("GET;"+p).then((function(e){if(e){var t=i(e.etag);f.eTag=t,d(p,"GET",null,f).done((function(t,n,i){304===i.status?(null!==e.chunks&&(i["Cached-X-Total-Count"]=e.chunks),h.resolve(e.data,n,i)):(r("GET;"+p,t,i),h.resolve(t,n,i))})).fail((function(e,t){h.reject(e,t)}))}else d(p,"GET",null,f).done((function(e,t,n){r("GET;"+p,e,n),h.resolve(e,t,n)})).fail((function(e,t){h.reject(e,t)}))})).catch((function(){d(p,"GET",null,f).done((function(e,t,n){r("GET;"+p,e,n),h.resolve(e,t,n)})).fail((function(e,t){h.reject(e,t)}))})),h.promise()},this.put=function(n,r,i){var o=l(n,i,e,t),s=o.ajaxConfig;return a(o.url,"PUT",r,s)},this.post=function(n,r,i){var o=l(n,i,e,t),s=o.ajaxConfig,u=o.url;return(s.useXMLHttpRequest?c:a)(u,"POST",r,s)},this.del=function(n,r,i){var o=l(n,i,e,t),s=o.ajaxConfig,u=o.url;return r||(s.contentType=null),s.dataType=null,a(u,"DELETE",r||null,s)},this.head=function(o,s){var u=l(o,s,e,t),c=u.ajaxConfig,f=u.url;c.contentType="",c.dataType="";var p=$.Deferred();return n.getResponse("HEAD;"+f).then((function(e){if(e){var t=i(e.etag);c.eTag=t,a(f,"HEAD",null,c).done((function(e,t,n){304===n.status?p.resolve(!0,t,n):(r("HEAD;"+f,null,n),p.resolve(!1,t,n))})).fail((function(e,t){p.reject(e,t)}))}else a(f,"HEAD",null,c).done((function(e,t,n){r("HEAD;"+f,null,n),p.resolve(!1,t,n)})).fail((function(e,t){p.reject(!1,t)}))})).catch((function(){a(f,"HEAD",null,c).done((function(e,t,n){r("HEAD;"+f,null,n),p.resolve(!1,t,n)})).fail((function(e,t){p.reject(!1,t)}))})),p.promise()},this.getChunked=function(t,n){return f(this,e,"medium",t,n)},this.putChunked=function(t,n,r){return h(this,e,t,n,r)}},F=function(e){this.detectAllClashes=function(t){return e.request.post(e.getApiTeamUrl()+"services/postprocess",t)},this.detectDisciplinesClashes=function(t){return e.request.post(e.getApiTeamUrl()+"clashdetection",t)},this.getFilters=function(t,n){var r={queryParams:{customFilter:n}};return t?e.request.get(e.getApiTeamUrl()+"clashdetection/filters/"+t,n?r:null):e.request.get(e.getApiTeamUrl()+"clashdetection/filters",n?r:null)},this.calculateClashes=function(t,n,r){if(n||r){var i={queryParams:{}};return n&&(i.queryParams.topology=n),r&&(i.queryParams.clashElements=r),e.request.post(e.getApiTeamUrl()+"clashdetection/filters",t,i)}return e.request.post(e.getApiTeamUrl()+"clashdetection/filters",t)},this.getFilterResults=function(t,n,r,i){if(r||i){var o={queryParams:{}};return r&&(o.queryParams.topology=r),i&&(o.queryParams.clashElements=i),n?e.request.get(e.getApiTeamUrl()+"clashdetection/projects/"+t+"/filters/"+n,o):e.request.get(e.getApiTeamUrl()+"clashdetection/projects/"+t+"/filters",o)}return n?e.request.get(e.getApiTeamUrl()+"clashdetection/projects/"+t+"/filters/"+n):e.request.get(e.getApiTeamUrl()+"clashdetection/projects/"+t+"/filters")},this.createClashRule=function(t,n){return e.request.post(e.getApiTeamUrl()+"projects/"+t+"/clashfilters",JSON.stringify(n))},this.deleteClashRule=function(t,n){var r={queryParams:{force:n}};return e.request.del(e.getApiTeamUrl()+"clashfilters/"+t,null,n?r:null)},this.updateClashRule=function(t,n){return e.request.put(e.getApiTeamUrl()+"clashfilters/"+t,JSON.stringify(n))},this.getAllClashRules=function(t,n){var r={queryParams:{customFilter:n}};return e.request.get(e.getApiTeamUrl()+"projects/"+t+"/clashfilters",n?r:null)}},L=function(e){this.post=function(t){var n=[{message:t}];return e.request.post(e.getApiTeamUrl()+"clientlogs",JSON.stringify(n))},this.postExtended=function(t,n,r,i){var o=[{message:t,applicationclass:n,releaseversion:r,projectid:i}];return e.request.post(e.getApiTeamUrl()+"clientlogs",JSON.stringify(o))},this.postArray=function(t){return e.request.post(e.getApiTeamUrl()+"clientlogs",JSON.stringify(t))},this.get=function(){return e.request.get(e.getApiTeamUrl()+"clientlogs")}},G=function(e){this.get=function(t){return e.request.get(e.getApiTeamUrl()+"comments/"+t)},this.delete=function(t){return e.request.del(e.getApiTeamUrl()+"comments/"+t)},this.put=function(t,n){return e.request.put(e.getApiTeamUrl()+"comments/"+t,n)}},z=function(e){this.post=function(t){return t.runAsync=!1,e.request.post(e.getApiTeamUrl()+"services/Connexis",JSON.stringify(t))}},W=function(e){this.get=function(t,n,r){var i="".concat(e.getApiTeamUrl(),"objects/").concat(t,"/customtables");n&&(i+="?variantId=".concat(n));var o={};return r&&(o.queryParams={revision:r}),e.request.get(i,r?o:void 0)},this.post=function(t,n){return e.request.post("".concat(e.getApiTeamUrl(),"objects/").concat(t,"/customtables"),n)},this.exportTable=function(t,n){return e.request.post("".concat(e.getApiTeamUrl(),"customtables/").concat(t,"/export/excel"),n)},this.deleteAllTables=function(t){return e.request.del("".concat(e.getApiTeamUrl(),"objects/").concat(t,"/customtables"))},this.deleteTable=function(t){return e.request.del("".concat(e.getApiTeamUrl(),"customtables/").concat(t))}},H=function(e){this.get=function(t){return e.request.get(e.getApiTeamUrl()+"dimensionlines/"+t)},this.delete=function(t){return e.request.del(e.getApiTeamUrl()+"dimensionlines/"+t)},this.put=function(t,n){return e.request.put(e.getApiTeamUrl()+"dimensionlines/"+t,n)}},V=function(e){this.get=function(t){return t?e.request.get(e.getApiTeamUrl()+"element-types/"+t):e.request.get(e.getApiTeamUrl()+"element-types")},this.getDisciplines=function(t){return t?e.request.get(e.getApiTeamUrl()+"element-types/disciplines/"+t):e.request.get(e.getApiTeamUrl()+"element-types/disciplines")},this.getAttributeTemplates=function(t,n){return t?e.request.get(e.getApiTeamUrl()+"element-types/"+t+"/attributetemplates",n?{queryParams:n}:void 0):e.request.get(e.getApiTeamUrl()+"element-types/attributetemplates",n?{queryParams:n}:void 0)},this.getTopology=function(){return e.request.get(e.getApiTeamUrl()+"element-types/topology")},this.getProjectTopology=function(t){return e.request.get(e.getApiTeamUrl()+"projects/"+t+"/element-types")}},Q=function(e){this.exportObjects=function(t,n){return e.request.get(e.getApiTeamUrl()+"projects/"+t+"/objects/export/excel?typeId="+n)},this.exportModel=function(t,n,r,i,o,s,u){var a={};return r&&(a.revision=r),i&&(a.emptyPropExport=1),o&&(a.propSetExport=1),s&&(a.temporary="true"),u&&(a.exportType=u),e.request.post("".concat(e.getApiTeamUrl(),"projects/").concat(t,"/model/").concat(n,"/exportasync"),null,{queryParams:a,contentType:!1,processData:!1,dataType:null})},this.exportSelection=function(t,n,r,i,o){var s={};return n&&(s.emptyPropExport=n),r&&(s.propSetExport=r),i&&(s.temporary="true"),o&&(s.exportType=o),e.request.post("".concat(e.getApiTeamUrl(),"selections/").concat(t,"/exportasync"),null,{queryParams:s})},this.createExportSelection=function(t,n){return e.request.post("".concat(e.getApiTeamUrl(),"projects/").concat(t,"/exportobjects"),n)}},J=function(e){this.getAccessRights=function(t){return e.request.get(e.getApiTeamUrl()+"folders/"+t+"/rights")},this.setMemberAccessRights=function(t,n,r){return e.request.put(e.getApiTeamUrl()+"folders/"+t+"/rights?assignrecursive="+(r?"true":"false"),n)},this.setMembersAccessRights=function(t,n,r){return e.request.put(e.getApiTeamUrl()+"folders/"+t+"/usersrights?assignrecursive="+(r?"true":"false"),n)}},X=function(e){var t=function(t){return t?e.getApiUrl()+"content/freeattributegroups/":e.getApiTeamUrl()+"freeattributegroups/"};this.post=function(n,r){return e.request.post(t(r),n)},this.get=function(n,r){return n?e.request.get(t(r)+n):e.request.get(t(r))},this.put=function(n,r,i){return e.request.put(t(i)+n,r)},this.delete=function(n,r){return e.request.del(t(r)+n)},this.getFreeAttributes=function(n,r){return e.request.get(t(r)+n+"/freeattributes")}},Y=function(e){var t=function(t){return t?e.getApiUrl()+"content/freeattributes/":e.getApiTeamUrl()+"freeattributes/"};this.post=function(n,r){return e.request.post(t(r),n)},this.get=function(n,r,i){return n?e.request.get(t(r)+n,i?{queryParams:i}:void 0):e.request.get(t(r),i?{queryParams:i}:void 0)},this.put=function(n,r,i){return e.request.put(t(i)+n,r)},this.delete=function(n,r){return e.request.del(t(r)+n)},this.getTopology=function(n){return e.request.get(t(n)+"?topology=true")},this.getFilteredAttributes=function(t,n,r){var i=e.getApiTeamUrl();return t&&(i+="projects/".concat(t,"/")),i+="attributes?",n&&(i+="layer=".concat(n,"&")),r&&(i+="type=".concat(r)),e.request.get(i)}},Z=function(e){this.calculate=function(t,n,r,i,o){var s={hiddenCalculation:{projectId:t,calculationMode:"View",view:n,clippingPlanes:r,clipRegion:{clipFace:!1},light:{useLight:!0,elevationAngle:45,sideAngle:60,useShadows:!1},propertySettings:{faceMode:"Filling",calcLines:!0},responseSettings:{mode:"Svg",svgHeight:390,svgWidth:500,fileName:i},sectionSettings:{}},runAsync:o};return e.request.post(e.getApiTeamUrl()+"services/Hiddencalculation",JSON.stringify(s))}},ee=function(e){this.get=function(t){return e.request.get(e.getApiTeamUrl()+"hyperlinks/"+t)},this.delete=function(t){return e.request.del(e.getApiTeamUrl()+"hyperlinks/"+t)},this.put=function(t,n){return e.request.put(e.getApiTeamUrl()+"hyperlinks/"+t,n)}},te=function(e){this.postModel=function(t,n,r,i,o,s){"replaceModelData"===o&&(s||(s={}),s.replaceModelData=!0);var u={preparedData:r,processData:!1,dataType:null,xhrUploadProgress:i,queryParams:s};return null!=r&&r.attachment_id?(r.version&&(u.queryParams=u.queryParams||{},u.queryParams.version=r.version),e.request.post(e.getApiTeamUrl()+"projects/"+t+"/model/"+n+"/attachment/"+r.attachment_id+"/importasync",r,u)):(u.contentType=!1,e.request.post(e.getApiTeamUrl()+"projects/"+t+"/model/"+n+"/importasync",r,u))}},ne=function(e){this.post=function(t,n){return e.request.post(e.getApiTeamUrl()+"projects/"+t+"/issues",n)},this.get=function(t){return e.request.get(e.getApiTeamUrl()+"issues/"+t)},this.postPin=function(t,n){return e.request.post(e.getApiTeamUrl()+"issues/"+t+"/pins",n)},this.getPins=function(t){return e.request.get(e.getApiTeamUrl()+"issues/"+t+"/pins")},this.deletePins=function(t){return e.request.del(e.getApiTeamUrl()+"issues/"+t+"/pins")},this.postComment=function(t,n){return e.request.post(e.getApiTeamUrl()+"issues/"+t+"/comments",n)},this.getComments=function(t){return e.request.get(e.getApiTeamUrl()+"issues/"+t+"/comments")},this.deleteComments=function(t){return e.request.del(e.getApiTeamUrl()+"issues/"+t+"/comments")},this.postAttachment=function(t,n){return e.request.post(e.getApiTeamUrl()+"issues/"+t+"/attachments",n)},this.getAttachments=function(t){return e.request.get(e.getApiTeamUrl()+"issues/"+t+"/attachments")},this.deleteAttachments=function(t){return e.request.del(e.getApiTeamUrl()+"issues/"+t+"/attachments")},this.put=function(t,n,r){return e.request.put(e.getApiTeamUrl()+"issues/"+t,n,r?{queryParams:r}:void 0)},this.delete=function(t,n){var r={queryParams:{forceDelete:n}};return e.request.del(e.getApiTeamUrl()+"issues/"+t,null,n?r:null)},this.getRights=function(t){return e.request.get(e.getApiTeamUrl()+"issues/"+t+"/rights")},this.getIssueTypes=function(){return e.request.get(e.getApiTeamUrl()+"lib/issuetypes")},this.getReports=function(t){return e.request.get(e.getApiTeamUrl()+"issues/"+t+"/reports")},this.importBcf=function(t,n){return e.request.put(e.getApiTeamUrl()+"projects/"+t+"/issues/bcf",n,{contentType:!1,processData:!1})},this.updateImportBcf=function(t,n){return e.request.put(e.getApiTeamUrl()+"projects/"+t+"/issues/bcf",n)},this.exportBcf=function(t,n,r){return t?e.request.post(e.getApiTeamUrl()+"projects/"+t+"/issues/export/bcf"+(r?"?version="+r:""),n):e.request.post(e.getApiTeamUrl()+"issues/export/bcf"+(r?"?version="+r:""),n)},this.exportExcel=function(t,n){return t?e.request.post(e.getApiTeamUrl()+"projects/"+t+"/issues/export/excel",n):e.request.post(e.getApiTeamUrl()+"issues/export/excel",n)}},re=function(e){this.get=function(t){return e.request.get(e.getApiTeamUrl()+"labels/"+t)},this.delete=function(t){return e.request.del(e.getApiTeamUrl()+"labels/"+t)},this.put=function(t,n){return e.request.put(e.getApiTeamUrl()+"labels/"+t,n)}},ie=function(e){this.lockObject=function(t,n){return e.request.put(e.getApiTeamUrl()+"objects/"+t+"/locks",n,{dataType:"text"})},this.checkLocked=function(t){return e.request.get(e.getApiTeamUrl()+"objects/"+t+"/locks")},this.deleteLock=function(t,n){return!0===n?e.request.del(e.getApiTeamUrl()+"objects/"+t+"/locks?asAdmin=true"):e.request.del(e.getApiTeamUrl()+"objects/"+t+"/locks")},this.getLocksWithChildren=function(t){return e.request.get(e.getApiTeamUrl()+"objects/"+t+"/locks?withChildren=true")}},oe=function(e){this.post=function(t){return e.request.post(e.getApiTeamUrl()+"members",t)},this.get=function(){return e.request.get(e.getApiTeamUrl()+"members")},this.putUser=function(t,n,r){return e.request.put(e.getApiTeamUrl()+"members/"+n,r)},this.deleteUser=function(t,n){return e.request.del(e.getApiTeamUrl()+"members/"+n)}},se=function(e){this.post=function(t){return e.request.post(e.getApiUrl()+"messages",t)},this.getUserMessages=function(t){return e.request.get(e.getApiUrl()+"user/"+t+"/messages")},this.getUserDashboardMessages=function(t){return e.request.get(e.getApiUrl()+"user/"+t+"/messages?topic=dashboard")},this.getSentUserMessages=function(t){return e.request.get(e.getApiUrl()+"user/"+t+"/messages/sent")},this.getSentGroupMessages=function(t){return e.request.get(e.getApiUrl()+"user/"+t+"/messages/groupsent")},this.get=function(t){return e.request.get(e.getApiUrl()+"messages/"+t)},this.getFiltered=function(t){return e.request.get(e.getApiUrl()+"messages/",{queryParams:{filter:t}})},this.deleteMessage=function(t){return e.request.del(e.getApiUrl()+"messages/"+t)},this.markAsRead=function(t){return e.request.post(e.getApiUrl()+"messages/"+t+"/markasreadbrowser",null,{dataType:null,contentType:null})},this.updateDashboardAdditionalData=function(t,n){return e.request.put(e.getApiUrl()+"messages/"+t+"/updatedashboardadditionaldata",n)},this.addDashboardMessageAttachment=function(t,n,r){return e.request.put(e.getApiUrl()+"messages/"+t+"/upload?type=dashboard",n,r)},this.getAllMessagingGroups=function(){return e.request.get(e.getApiUrl()+"systemgroups")},this.getMessagingGroupsDetails=function(t){return e.request.get(e.getApiUrl()+"systemgroups/"+t)}},ue=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!")),Promise.resolve(!1))},this.getDisciplines=function(t){return e.request.get(e.getApiTeamUrl()+"divisions/"+t+"/disciplines")},this.setDisciplineValidity=function(t,n,r){var i={private:!r};return e.request.put(e.getApiTeamUrl()+"divisions/"+t+"/disciplines/"+n,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,n){return e.request.post(e.getApiTeamUrl()+"divisions/"+t+"/revisions",n)},this.put=function(t,n){return e.request.put(e.getApiTeamUrl()+"divisions/"+t,n)},this.download=function(t){return e.request.get(e.getApiTeamUrl()+"divisions/"+t+"/download")},this.delete=function(t){return e.request.del(e.getApiTeamUrl()+"divisions/"+t)},this.move=function(t,n){return e.request.put(e.getApiTeamUrl()+"divisions/"+t+"/move",n)}},ae=["topology","structure"],ce=function(e){this.get=function(t,n){var r={};return t&&(r.object_id=t),n&&(r.project_id=n),e.request.get(e.getApiTeamUrl()+"settings/filters",{queryParams:r})},this.getFilteredObjects=function(t,n,r,i){if(r)return e.request.get(e.getApiTeamUrl()+"projects/"+t+"/filters/"+n+"/properties",{queryParams:r});if(i&&ae.find((function(e){return e===i}))){var o={};return o[i]=!0,e.request.get(e.getApiTeamUrl()+"projects/"+t+"/filters/"+n,{queryParams:o})}return e.request.get(e.getApiTeamUrl()+"projects/"+t+"/filters/"+n)},this.getSelectionFilteredObjects=function(t,n,r,i){if(r)return e.request.get(e.getApiTeamUrl()+"selections/"+t+"/filters/"+n+"/properties",{queryParams:r});if(i&&ae.find((function(e){return e===i}))){var o={};return o[i]=!0,e.request.get(e.getApiTeamUrl()+"selections/"+t+"/filters/"+n,{queryParams:o})}return e.request.get(e.getApiTeamUrl()+"selections/"+t+"/filters/"+n)},this.applyFilter=function(t){return e.request.get(e.getApiTeamUrl()+"filters/"+t)},this.post=function(t,n){var r={};return n&&(r.project_id=n),e.request.post(e.getApiTeamUrl()+"settings/filter",t,{queryParams:r})},this.put=function(t){return e.request.put(e.getApiTeamUrl()+"settings/filter",t)},this.delete=function(t){return e.request.del(e.getApiTeamUrl()+"settings/filter/"+t)},this.getFilter=function(t){return e.request.get(e.getApiTeamUrl()+"settings/filters/"+t)}},le=function(e){this.post=function(t){return e.request.post(e.getApiTeamUrl()+"objects/",t)},this._buildQueryParams=function(e){var t={};return e.revision&&(t.revision=e.revision),e.projectId&&(t.projectId=e.projectId),e.shortInfo&&(t.shortinfo=e.shortInfo),e.type&&(t.type=e.type),{queryParams:t}},this.get=function(t,n,r,i,o,s){var u={revision:n,projectId:i,shortInfo:o,type:s},a=this._buildQueryParams(u),c=e.getApiTeamUrl()+"objects/"+t;return r&&(c+="/properties/",c+=r),e.request.get(c,n||i||o||s?a:void 0)},this.getInternal=function(t,n){var r={};n&&(r.queryParams={revision:n});var i=e.getApiTeamUrl()+"objects/"+t;return i+="/internal",e.request.get(i,n?r:void 0)},this.head=function(t,n){var r={};return n&&(r.queryParams={revision:n}),e.request.head?e.request.head(e.getApiTeamUrl()+"objects/"+t,n?r:void 0):(console.warn("BimWebSdk: request (objects/".concat(t,") does not support head method! Using get as fallback.")),e.request.get(e.getApiTeamUrl()+"objects/"+t,n?r:void 0))},this.getTopology=function(t,n,r,i,o){var s={};return(n||r||i)&&(s.queryParams={},n&&(s.queryParams.revision=n),r&&(s.queryParams.hideElements=r),i&&(s.queryParams.shortinfo=i)),o&&(s.responseBatch=o),e.request.get(e.getApiTeamUrl()+"objects/"+t+"/topology",s)},this.getGeometryThreeJS=function(t){var n,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{chunked:null,revision:null,lod:null,batch:null,chunkSize:null,properties:null},o={};return(i.revision||i.lod||i.chunkSize)&&(o.queryParams={},i.revision&&(o.queryParams.revision=i.revision),i.lod&&(o.queryParams.levelofdetail=i.lod),i.chunkSize&&(o.queryParams.chunkSize=i.chunkSize)),i.batch&&(o.responseBatch=i.batch),n=r?e.getApiTeamUrl()+"objects/"+t+"/disciplines/"+r+"/geometries/threejs":e.getApiTeamUrl()+"objects/"+t+"/geometries/threejs",i.properties&&(n+="/properties/",n+=i.properties),i.chunked?e.request.getChunked(n,o):e.request.get(n,o)},this._buildGetGeoAjaxOptions=function(e){var t={dataType:"binary",processData:!1,responseType:"arraybuffer",useXMLHttpRequest:!0,queryParams:{}};return e.revision&&(t.queryParams.revision=e.revision),e.lod&&(t.queryParams.levelofdetail=e.lod),e.vertexNormals&&(t.queryParams.vertexNormals=e.vertexNormals),e.smoothingAngle&&(t.queryParams.smoothingAngle=e.smoothingAngle),e.topology&&(t.queryParams.topology=e.topology),e.edges&&(t.queryParams.edges=e.edges),e.version&&(t.queryParams.version=e.version),e.batch&&(t.responseBatch=e.batch),t},this.getGeometryGLB=function(t){var n,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{chunked:null,revision:null,lod:null,batch:null,vertexNormals:null,smoothingAngle:null,topology:null,edges:null,version:null},o=this._buildGetGeoAjaxOptions(i);return n=r?e.getApiTeamUrl()+"objects/"+t+"/disciplines/"+r+"/geometries/glb":e.getApiTeamUrl()+"objects/"+t+"/geometries/glb",i.chunked?e.request.getChunked(n,o):e.request.get(n,o)},this.getGLB=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;return this.getGeometryGLB(e,null,{version:t})},this.getGeometryTemplatesThreeJS=function(t,n,r,i,o,s){var u={};null===i&&null===o||(u.queryParams={},null!==i&&(u.queryParams.revision=i),null!==o&&(u.queryParams.levelofdetail=o)),s&&(u.responseBatch=s);var a=e.getApiTeamUrl()+"objects/"+t+"/disciplines/"+n+"/templates/threejs";return r?e.request.getChunked(a,u):e.request.get(a,u)},this.getGeometryCompressed=function(t,n){return n?e.request.get(e.getApiTeamUrl()+"objects/"+t+"/disciplines/"+n+"/geometries/meshblob"):e.request.get(e.getApiTeamUrl()+"objects/"+t+"/geometries/meshblob")},this.getProperties=function(t,n){return e.request.get(e.getApiTeamUrl()+"objects/"+t+"/geometries/threejs/properties"+n)},this.put=function(t,n,r){var i={};return r&&(i.projectid=r),e.request.put(e.getApiTeamUrl()+"objects/"+t,n,{queryParams:i})},this.postComment=function(t,n){return e.request.post(e.getApiTeamUrl()+"objects/"+t+"/comments",n)},this.getComments=function(t){return e.request.get(e.getApiTeamUrl()+"objects/"+t+"/comments")},this.deleteComments=function(t){return e.request.del(e.getApiTeamUrl()+"objects/"+t+"/comments")},this.postAttachment=function(t,n,r,i){return e.request.post(e.getApiTeamUrl()+"objects/"+t+"/attachments",n,{contentType:!1,processData:!1,dataType:null,xhrUploadProgress:r,queryParams:i?{DocumentFolderId:i}:void 0})},this.createAttachmentChunked=function(t,n,r,i){var o=arguments.length>4&&void 0!==arguments[4]?arguments[4]:{},s=e.getApiTeamUrl()+"objects/"+t+"/attachments/chunked",u={file:n,uploadProgress:r,documentFolderId:i,opts:o},a={queryParams:{}};return i&&(a.queryParams={DocumentFolderId:i}),e.request.putChunked(s,u,a)},this.getAttachments=function(t,n){return e.request.get(e.getApiTeamUrl()+"objects/"+t+"/attachments",n?{queryParams:{revision:n}}:void 0)},this.deleteAttachments=function(t){return e.request.del(e.getApiTeamUrl()+"objects/"+t+"/attachments")},this.postAttachmentLink=function(t,n){return e.request.post(e.getApiTeamUrl()+"objects/"+t+"/attachmentlinks",n)},this.getAttachmentLinks=function(t,n){return e.request.get(e.getApiTeamUrl()+"objects/"+t+"/attachmentlinks",n?{queryParams:{revision:n}}:void 0)},this.deleteAttachmentLink=function(t,n){return e.request.del(e.getApiTeamUrl()+"objects/"+t+"/attachmentlinks/"+n)},this.postHyperlink=function(t,n){return e.request.post(e.getApiTeamUrl()+"objects/"+t+"/hyperlinks",n)},this.getHyperlinks=function(t){return e.request.get(e.getApiTeamUrl()+"objects/"+t+"/hyperlinks")},this.deleteHyperlinks=function(t){return e.request.del(e.getApiTeamUrl()+"objects/"+t+"/hyperlinks")},this.delete=function(t){return e.request.del(e.getApiTeamUrl()+"objects/"+t)},this.getAttributes=function(t,n,r,i){var o=n?"&documentversion="+n:"",s=i?"&revision="+i:"",u=r?"&projectid="+r:"",a=e.getApiTeamUrl()+"objects/"+t+"?freeattributes=true";return e.request.get(a+o+s+u)},this.getAttributesAsFlatStructure=function(t,n,r,i){var o=n?"&documentversion="+n:"",s=i?"&revision="+i:"",u=r?"&projectid="+r:"",a=e.getApiTeamUrl()+"objects/"+t+"?freeattributes=true&internal=true&attributedefinition=true";return e.request.get(a+o+s+u)},this.getAttributeValues=function(t,n){return e.request.get(e.getApiTeamUrl()+"objects/"+t+"/attributes/"+n+"?children=true")},this.getComplexPropertiesTopology=function(t,n){return e.request.get(e.getApiTeamUrl()+"objects/"+t+"/complexproperties"+(n>=0?"?revision="+n:""))},this.postThumbnail=function(t,n,r){return e.request.post(e.getApiTeamUrl()+"objects/"+t+"/thumbnail",n,{contentType:!1,processData:!1,dataType:null,xhrUploadProgress:r})},this.deleteThumbnail=function(t){return e.request.del(e.getApiTeamUrl()+"objects/"+t+"/thumbnail")},this.addChildObject=function(t){return e.request.post(e.getApiTeamUrl()+"objects/alter/",t)},this.getReports=function(t,n,r){return e.request.get(e.getApiTeamUrl()+"objects/"+t+"/reports?version="+n+"&action="+r)},this.exportExcelReports=function(t,n){return e.request.post(e.getApiTeamUrl()+"projects/"+t+"/reports/export/excel",n)},this.postDimensions=function(t,n){return e.request.post(e.getApiTeamUrl()+"objects/"+t+"/dimensionlines",n)},this.putDimensions=function(t,n){return e.request.put(e.getApiTeamUrl()+"objects/"+t+"/dimensionlines",n)},this.getDimensions=function(t){return e.request.get(e.getApiTeamUrl()+"objects/"+t+"/dimensionlines")},this.deleteDimensions=function(t){return e.request.del(e.getApiTeamUrl()+"objects/"+t+"/dimensionlines")},this.postLabels=function(t,n){return e.request.post(e.getApiTeamUrl()+"objects/"+t+"/labels",n)},this.putLabels=function(t,n){return e.request.put(e.getApiTeamUrl()+"objects/"+t+"/labels",n)},this.getLabels=function(t){return e.request.get(e.getApiTeamUrl()+"objects/"+t+"/labels")},this.deleteLabels=function(t){return e.request.del(e.getApiTeamUrl()+"objects/"+t+"/labels")},this.postAnnotations=function(t,n){return e.request.post(e.getApiTeamUrl()+"objects/"+t+"/annotations",n)},this.putAnnotations=function(t,n){return e.request.put(e.getApiTeamUrl()+"objects/"+t+"/annotations",n)},this.getAnnotations=function(t){return e.request.get(e.getApiTeamUrl()+"objects/"+t+"/annotations")},this.deleteAnnotations=function(t){return e.request.del(e.getApiTeamUrl()+"objects/"+t+"/annotations")},this.getObjectIdsByQuery=function(t,n,r,i){var o=Array.isArray(i)?i.join(","):void 0,s={queryParams:{}};return s.queryParams[n]=r,o&&(s.queryParams.divisions=o),e.request.get(e.getApiTeamUrl()+"objects/"+t+"/query",s)},this.getObjectIdsByIfcId=function(e,t,n){return this.getObjectIdsByQuery(e,"93027bad-df91-48ee-a0bb-60a8184cddba",t,n)},this.postOverlay=function(t){return e.request.post(e.getApiTeamUrl()+"objects/",t)},this.getOverlays=function(t){return e.request.get(e.getApiTeamUrl()+"objects/"+t+"/overlays")},this.getOverlay=function(e){return this.getInternal(e)},this.deleteOverlay=function(t){return e.request.del(e.getApiTeamUrl()+"objects/"+t)},this.deleteOverlays=function(t){return e.request.del(e.getApiTeamUrl()+"objects/"+t+"/overlays")},this.getThumbnail=function(t){var n=e.getApiTeamUrl()+"objects/"+t+"/thumbnail/download";return e.request.get(n,{useXMLHttpRequest:!0,dataType:"binary",processData:!1,responseType:"arraybuffer"})}},fe=function(e){this.get=function(t){return e.request.get(e.getApiTeamUrl()+"overlays/"+t)},this.put=function(t,n){return e.request.put(e.getApiTeamUrl()+"overlays/"+t,n)},this.delete=function(t){return e.request.del(e.getApiTeamUrl()+"overlays/"+t)}},pe=function(e){this.get=function(t){return e.request.get(e.getApiTeamUrl()+"overlaysets/"+t)},this.put=function(t,n){return e.request.put(e.getApiTeamUrl()+"overlaysets/"+t,n)},this.delete=function(t){return e.request.del(e.getApiTeamUrl()+"overlaysets/"+t)},this.postOverlay=function(t,n){return e.request.post(e.getApiTeamUrl()+"overlaysets/"+t+"/overlays",n)},this.getOverlays=function(t){return e.request.get(e.getApiTeamUrl()+"overlaysets/"+t+"/overlays")}},he=function(e){this.get=function(t){return e.request.get(e.getApiTeamUrl()+"pins/"+t)},this.delete=function(t){return e.request.del(e.getApiTeamUrl()+"pins/"+t)},this.put=function(t,n){return e.request.put(e.getApiTeamUrl()+"pins/"+t,n)}},de=function(e){this.get=function(){return e.request.get(e.getApiUrl()+"project-actions-rights/")}},ge=function(e){var t="projectattributetemplates";this.post=function(n){return e.request.post(e.getApiTeamUrl()+t,n)},this.get=function(n,r){var i=r?{queryParams:{default:r}}:null;return n?e.request.get(e.getApiTeamUrl()+t+"/"+n):e.request.get(e.getApiTeamUrl()+t,i)},this.put=function(n,r){return e.request.put(e.getApiTeamUrl()+t+"/"+n,r)},this.delete=function(n){return e.request.del(e.getApiTeamUrl()+t+"/"+n)},this.copyFrom=function(n,r){return e.request.put(e.getApiTeamUrl()+t+"/"+r+"/copyfrom",JSON.stringify({id:n}))},this.setDefault=function(n){return e.request.put(e.getApiTeamUrl()+t+"/"+n+"/default")}};function me(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,i,o,s,u=[],a=!0,c=!1;try{if(o=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;a=!1}else for(;!(a=(r=o.call(n)).done)&&(u.push(r.value),u.length!==t);a=!0);}catch(e){c=!0,i=e}finally{try{if(!a&&null!=n.return&&(s=n.return(),Object(s)!==s))return}finally{if(c)throw i}}return u}}(e,t)||function(e,t){if(e){if("string"==typeof e)return ye(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?ye(e,t):void 0}}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function ye(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}var ve=function(e){this.post=function(t){return e.request.post(e.getApiTeamUrl()+"projects",t)},this.createFromExisting=function(t){return e.request.post(e.getApiTeamUrl()+"projects/copyfrom",t)},this.put=function(t,n){return e.request.put(e.getApiTeamUrl()+"projects/"+t,n)},this.get=function(t,n,r,i,o){var s={queryParams:o||{}};return n&&(s.queryParams.disciplines=!1),i&&(s.queryParams.recycleBin=!0),t?e.request.get(e.getApiTeamUrl()+"projects/"+t,s):r?e.request.get(e.getApiUrl()+r+"/projects",s):e.getTeamSlug()?e.request.get(e.getApiTeamUrl()+"projects",s):e.request.get(e.getApiUrl()+"/projects",s)},this.delete=function(t){return e.request.del(e.getApiTeamUrl()+"projects/"+t)},this.moveToRecycleBin=function(t){return e.request.del(e.getApiTeamUrl()+"projects/"+t+"?moveToRecycleBin=true")},this.restoreFromRecycleBin=function(t){return e.request.put(e.getApiTeamUrl()+"objects/"+t+"/restore",JSON.stringify({}),{dataType:"text"})},this.deleteFromRecycleBin=function(t){return e.request.del(e.getApiTeamUrl()+"projects/"+t+"?fromRecycleBin=true")},this.deleteServerCache=function(t){return e.request.del(e.getApiTeamUrl()+"projects/"+t+"/deletecache")},this.clearServerDecimation=function(t,n,r){return n||(n="00000000-0000-0000-0000-000000000000"),(r<0||!r&&0!=r)&&(r="100"),e.request.del(e.getApiTeamUrl()+"temporary/projects/"+t+"/disciplines/"+n+"/levelofdetails/"+r)},this.getModels=function(t){return e.request.get(e.getApiTeamUrl()+"projects/"+t+"/divisions")},this.postModel=function(t,n){return e.request.post(e.getApiTeamUrl()+"projects/"+t+"/divisions",n)},this.getMembers=function(t){return e.request.get(e.getApiTeamUrl()+"projects/"+t+"/members")},this.postMember=function(t,n){return e.request.post(e.getApiTeamUrl()+"projects/"+t+"/members",n)},this.putMember=function(t,n){return e.request.put(e.getApiTeamUrl()+"projects/"+t+"/members",n)},this.deleteMember=function(t,n){return e.request.del(e.getApiTeamUrl()+"projects/"+t+"/members",n)},this.getPins=function(t){return e.request.get(e.getApiTeamUrl()+"projects/"+t+"/pins")},this.putProject=function(t,n){return e.request.put(e.getApiTeamUrl()+"projects/"+t,n)},this.postAttachment=function(t,n){return e.request.post(e.getApiTeamUrl()+"projects/"+t+"/attachments",n)},this.getAttachments=function(t,n,r){var i=r;return i||(i={}),n&&(i.revision=n),e.request.get(e.getApiTeamUrl()+"projects/"+t+"/attachments",n||r?{queryParams:i}:void 0)},this.deleteAttachments=function(t){return e.request.del(e.getApiTeamUrl()+"projects/"+t+"/attachments")},this.getTopology=function(t){return e.request.get(e.getApiTeamUrl()+"projects/"+t+"/topology")},this.getSpots=function(t){return e.request.get(e.getApiTeamUrl()+"projects/"+t+"/pins")},this.postThumbnail=function(t,n,r){return e.request.post(e.getApiTeamUrl()+"projects/"+t+"/thumbnail",n,{contentType:!1,processData:!1,dataType:null,xhrUploadProgress:r})},this.getThumbnail=function(t){return e.request.get(e.getApiTeamUrl()+"thumbnail/"+t)},this.deleteThumbnail=function(t){return e.request.del(e.getApiTeamUrl()+"projects/"+t+"/thumbnail")},this.getComments=function(t){return e.request.get(e.getApiTeamUrl()+"projects/"+t+"/comments")},this.getHyperlinks=function(t){return e.request.get(e.getApiTeamUrl()+"projects/"+t+"/hyperlinks")},this.getIssues=function(t,n,r){var i=r||n?"?":"",o=r&&n?"&":"",s=r?"scenethumbnail="+r:"";return e.request.get(e.getApiTeamUrl()+"projects/"+t+"/issues"+i+(n?"scene=false":"")+o+s)},this.getIssuesShortInfo=function(t){var n=function(){var e=me((new Date).toString().split("GMT"),2),t=e[0],n=e[1];if(!t||!n)return"";var r=new Date(t+"UTC").toISOString().split(".")[0],i=(n=n.split(" ")[0]).slice(0,3)+":"+n.slice(3);return r&&i?r+i:""}();return e.request.get(e.getApiTeamUrl()+"projects/"+t+"/issues?shortinfo=true"+(n?"&currenttime="+n:""))},this.postSlideshow=function(t,n){return e.request.post(e.getApiTeamUrl()+"projects/"+t+"/slideshows",n)},this.getSlideshows=function(t){return e.request.get(e.getApiTeamUrl()+"projects/"+t+"/slideshows")},this.deleteSlideshows=function(t){return e.request.del(e.getApiTeamUrl()+"projects/"+t+"/slideshows")},this.exportSlideshowToPDF=function(t,n){var r={slideShowId:n};return e.request.post(e.getApiTeamUrl()+"projects/"+t+"/slideshow/export/pdf",JSON.stringify(r))},this.getProjectInfo=function(t,n){var r={queryParams:n||{}};return e.request.get(e.getApiTeamUrl()+"projects/"+t,r)},this.postOverlaySet=function(t,n){return e.request.post(e.getApiTeamUrl()+"projects/"+t+"/overlaysets",n)},this.getOverlaySets=function(t){return e.request.get(e.getApiTeamUrl()+"projects/"+t+"/overlaysets")},this.deleteOverlaySets=function(t){return e.request.del(e.getApiTeamUrl()+"projects/"+t+"/overlaysets")}},be=function(e){this.postRevision=function(t,n){return e.request.post(e.getApiTeamUrl()+"divisions/"+t+"/revisions",n)},this.getRevisionList=function(t){return e.request.get(e.getApiTeamUrl()+"divisions/"+t+"/revisions")},this.getRevisionInfo=function(t){return e.request.get(e.getApiTeamUrl()+"revisions/"+t)},this.postRevisionInfo=function(t,n){return e.request.post(e.getApiTeamUrl()+"revisions/"+t,n)},this.putRevisionInfo=function(t,n){return e.request.put(e.getApiTeamUrl()+"revisions/"+t,n)},this.getRevisionsComparisonResult=function(t,n,r,i){return e.request.get(e.getApiTeamUrl()+"divisions/"+t+"/revisionscomparison/"+n+"/"+r,i)},this.compareRevisions=function(t,n,r,i){return e.request.post(e.getApiTeamUrl()+"divisions/"+t+"/revisionscomparison/"+n+"/"+r,null,i)},this.excelExportRevisionsComparisonResult=function(t,n,r,i){return e.request.post(e.getApiTeamUrl()+"divisions/"+t+"/revisionscomparison/"+n+"/"+r+"/export/excel",i)}},we=function(e){this.getRoles=function(t){return t?e.request.get(e.getApiTeamUrl()+"projects/"+t+"/members"):e.request.get(e.getApiTeamUrl()+"roles")},this.postUserRole=function(t,n){return e.request.post(e.getApiTeamUrl()+"projects/"+t+"/members",n)},this.putUserRole=function(t,n){return e.request.put(e.getApiTeamUrl()+"projects/"+t+"/members",n)},this.deleteUser=function(t){return e.request.del(e.getApiTeamUrl()+"projects/"+t+"/members")}},Te=function(e){this.get=function(t,n){if(t||n){var r={queryParams:{}};return void 0!==t&&(r.queryParams.rights=t),void 0!==n&&(r.queryParams.customrole=n),e.request.get(e.getApiTeamUrl()+"roles/",r)}return e.request.get(e.getApiTeamUrl()+"roles/")},this.getAllRights=function(t){if(t){var n={queryParams:{globalfreeattributes:t.globalfreeattributes,global:t.global,project:t.project,document:t.document,layer:t.layer}};return e.request.get(e.getApiTeamUrl()+"rights",n)}return e.request.get(e.getApiTeamUrl()+"rights")},this.post=function(t){return e.request.post(e.getApiTeamUrl()+"roles/",t)},this.getRoleDetails=function(t){return e.request.get(e.getApiTeamUrl()+"roles/"+t)},this.updateRole=function(t,n){return e.request.put(e.getApiTeamUrl()+"roles/"+t,n)},this.deleteRole=function(t){return e.request.del(e.getApiTeamUrl()+"roles/"+t)}},Ae=function(e){this.calculateCutSection=function(t){var n,r=arguments.length>1&&void 0!==arguments[1]&&arguments[1],i={cuttingCalculation:{projectId:t.projectId,cuttingPlanes:t.cuttingPlanes,selection:{modelLayer:t.modelLayer,topologyNodes:t.topologyNodes,hiddenObjects:t.hiddenObjects},settings:t.settings},runAsync:r};if("glb"===(null===(n=i.cuttingCalculation)||void 0===n||null===(n=n.settings)||void 0===n?void 0:n.responseGeometry)){return e.request.post(e.getApiTeamUrl()+"services/CuttingCalculation",JSON.stringify(i),{useXMLHttpRequest:!0,dataType:"binary",processData:!1,responseType:"arraybuffer"})}return e.request.post(e.getApiTeamUrl()+"services/CuttingCalculation",JSON.stringify(i))}},qe=function(e){this.post=function(t){return e.request.post(e.getApiTeamUrl()+"share",t)}},_e=function(e){this.get=function(t){return e.request.get(e.getApiTeamUrl()+"slides/"+t)},this.put=function(t,n){return e.request.put(e.getApiTeamUrl()+"slides/"+t,n)},this.delete=function(t){return e.request.del(e.getApiTeamUrl()+"slides/"+t)},this.postThumbnail=function(t,n){return e.request.post(e.getApiTeamUrl()+"slides/"+t+"/thumbnail",n)}},Ue=function(e){this.get=function(t){return e.request.get(e.getApiTeamUrl()+"slideshows/"+t)},this.put=function(t,n){return e.request.put(e.getApiTeamUrl()+"slideshows/"+t,n)},this.delete=function(t){return e.request.del(e.getApiTeamUrl()+"slideshows/"+t)},this.postSlide=function(t,n){return e.request.post(e.getApiTeamUrl()+"slideshows/"+t+"/slides",n)},this.getSlides=function(t){return e.request.get(e.getApiTeamUrl()+"slideshows/"+t+"/slides")},this.postThumbnail=function(t,n){return e.request.post(e.getApiTeamUrl()+"slideshows/"+t+"/thumbnail",n)},this.getThumbnail=function(t){return e.request.get(e.getApiTeamUrl()+"thumbnail/"+t)}},ke=function(e){this.postStructure=function(t,n){return e.request.post(e.getApiTeamUrl()+"projects/"+t+"/structures",n)},this.postStructureTopology=function(t,n){return e.request.post(e.getApiTeamUrl()+"structures/"+t+"/topology",n)},this.postSubNode=function(t,n){return e.request.post(e.getApiTeamUrl()+"structures/"+t,n)},this.postAssignedObject=function(t,n,r,i){return e.request.post(e.getApiTeamUrl()+"structures/"+t+"/assign/"+n+"?varianttype="+r,i)},this.attributeAssign=function(t,n,r,i){var o={attributeId:r};return i&&(o.variantType=i),e.request.put(e.getApiTeamUrl()+"projects/"+t+"/structures/"+n+"/attributeassign",JSON.stringify(o))},this.deleteAssignedObject=function(t,n,r,i){var o=[i?"removeAllNodes=true":"",r?"varianttype=true":""].filter((function(e){return e})).join("&");return e.request.del(e.getApiTeamUrl()+"structures/"+t+"/delete/"+n+"?"+o)},this.getStructure=function(t,n,r){return n?e.request.get(e.getApiTeamUrl()+"structures/"+n):e.request.get(e.getApiTeamUrl()+"projects/"+t+"/structures"+(r?"?type="+r:""))},this.getTopology=function(t,n,r){return void 0===r||""==r?e.request.get(e.getApiTeamUrl()+"structures/"+t+"/topology?varianttype="+n):!0===r?e.request.get(e.getApiTeamUrl()+"structures/"+t+"/topology?varianttype="+n+"&attributes=true"):void 0},this.getTopologyStructure=function(t,n){return e.request.get(e.getApiTeamUrl()+"projects/"+t+"/topologystructure",n?{queryParams:n}:void 0)},this.resetTopologyStructure=function(t,n){return e.request.put(e.getApiTeamUrl()+"projects/"+t+"/topologystructure/reset",void 0,n?{queryParams:n}:void 0)},this.copyStructure=function(t,n,r){return e.request.post(e.getApiTeamUrl()+"structures/"+t+"/copy?elementRelation="+r+"&attributes=true",n)},this.putStructure=function(t,n,r){var i=r?"?applyToChild=true":"";return e.request.put(e.getApiTeamUrl()+"structures/"+t+i,n)},this.reorderStructure=function(t,n){return e.request.put(e.getApiTeamUrl()+"structures/"+t+"/reorder?varianttype="+n)},this.deleteStructure=function(t,n,r){return r?e.request.del(e.getApiTeamUrl()+"structures/"+t+"?forceDelete=true"):n?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,n){return e.request.post(e.getApiTeamUrl()+"projects/"+t+"/variants",n)},this.getVariantType=function(t,n){return n?e.request.get(e.getApiTeamUrl()+"projects/"+t+"/variants/"+n):e.request.get(e.getApiTeamUrl()+"projects/"+t+"/variants")},this.deleteVariantType=function(t,n){return e.request.del(e.getApiTeamUrl()+"projects/"+t+"/variants/"+n)},this.copyElementsToVariant=function(t,n,r){return e.request.put(e.getApiTeamUrl()+"projects/"+t+"/variants/"+n+"/copyfrom",r)}},je=function(e){this.get=function(){return e.request.get(e.getApiUrl()+"team-actions-rights/")}},Se=function(e){this.get=function(t,n){var r={queryParams:{}};return n&&(r.queryParams.filterEmpty=n),t?e.request.get(e.getApiUrl()+"teams/"+t,r):e.request.get(e.getApiUrl()+"teams",r)},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")}},Pe=function(e){this.get=function(t,n){var r={language:t};return n&&(r.type=n),e.request.get(e.getApiUrl()+"terms/download",{queryParams:r,dataType:"html"})}},xe=function(e){this.get=function(t,n){var r={language:t};return n&&(r.type=n),e.request.get(e.getApiUrl()+"dataprotectiondeclarations/download",{queryParams:r,dataType:"html"})},this.getForbiddenEmails=function(){return e.request.get(e.getApiUrl()+"restrictedemails")}},Oe=function(e){this.get=function(t,n){var r={language:t};return n&&(r.type=n),e.request.get(e.getApiUrl()+"imprints/download",{queryParams:r,dataType:"html"})}},Ee=function(e){this.post=function(t){return e.request.post(e.getApiUrl()+"content/units/",t)},this.get=function(t){return t?e.request.get(e.getApiUrl()+"content/units/"+t):e.request.get(e.getApiUrl()+"content/units/")},this.put=function(t,n){return e.request.put(e.getApiUrl()+"content/units/"+t,n)},this.delete=function(t){return e.request.del(e.getApiUrl()+"content/units/"+t)}},De=function(e){this.get=function(t){return t?e.request.get(e.getApiUrl()+"user",{token:t}):e.request.get(e.getApiUrl()+"user")},this.put=function(t,n){var r=e.getApiUrl()+"user";return n?e.request.put(r,t,{token:n}):e.request.put(r,t)},this.setPassword=function(t,n,r){var i=e.getApiUrl()+"user/set_password";return t&&(i+=t),r?e.request.put(i,n,{token:r}):e.request.put(i,n)},this.post=function(t){return e.request.post(e.getApiUrl()+"user",t)},this.postPhoto=function(t){return e.request.post(e.getApiUrl()+"user/photo",t,{contentType:!1,processData:!1})},this.deletePhoto=function(){return e.request.del(e.getApiUrl()+"user/photo")},this.getPhoto=function(){return e.request.get(e.getApiUrl()+"user/photo")},this.putPassword=function(t){return e.request.put(e.getApiUrl()+"user/change_password",t)},this.getSubscriptions=function(t){return t?e.request.get(e.getApiUrl()+"user/accountsettings/"+t):e.request.get(e.getApiUrl()+"user/accountsettings")}},Ce=function(e){this.post=function(t){return e.request.post(e.getApiUrl()+"users",t)},this.exist=function(t){return e.request.get(e.getApiUrl()+"users/exist",{queryParams:{email:t}})},this.put=function(t,n){return e.request.put(e.getApiUrl()+"users/"+t,n)},this.delete=function(t){return e.request.del(e.getApiUrl()+"users/"+t)},this.setSubscriptions=function(t,n){return e.request.post(e.getApiUrl()+"administration/users/"+t+"/accountsettings",n)}},Ie=function(e){this.postSettings=function(t,n){return e.request.post(e.getApiTeamUrl()+"userSettings/"+t,n)},this.getSettings=function(t){return e.request.get(e.getApiTeamUrl()+"userSettings/"+t)}},Re=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,n){var r=null!=n?n:"".concat(e.getApiTeamUrl(),"invitations/");return e.request.post(r,t)},this.delete=function(t){return e.request.del(e.getApiTeamUrl()+"invitations/"+t)},this.put=function(t,n){return e.request.put(e.getApiTeamUrl()+"invitations/"+t,n)},this.accept=function(t,n){return e.request.put(e.getApiUrl()+"invitations/"+t+"/accept",n)},this.getInvitation=function(t,n){return e.request.get(e.getApiUrl()+"invitations/"+t,n)}},Be=function(e){this.post=function(t,n){return e.request.post(e.getApiTeamUrl()+"projects/"+t+"/selections",n)},this.get=function(t){return e.request.get(e.getApiTeamUrl()+"selections/"+t)},this.getAllSelections=function(t){return e.request.get(e.getApiTeamUrl()+"projects/"+t+"/selections")},this.delete=function(t){return e.request.del(e.getApiTeamUrl()+"selections/"+t)}},Ke=function(e){this.postGroup=function(t,n){return e.request.post(e.getApiTeamUrl()+"projects/"+t+"/usergroups",n)},this.getGroups=function(t){return e.request.get(e.getApiTeamUrl()+"projects/"+t+"/usergroups")},this.getUsers=function(t){return e.request.get(e.getApiTeamUrl()+"usergroups/"+t)},this.deleteGroup=function(t){return e.request.del(e.getApiTeamUrl()+"usergroups/"+t)},this.putGroup=function(t,n){return e.request.put(e.getApiTeamUrl()+"usergroups/"+t,n)},this.assignUser=function(t,n){return e.request.put(e.getApiTeamUrl()+"usergroups/"+t+"/assign",n)},this.removeUser=function(t,n){return e.request.put(e.getApiTeamUrl()+"usergroups/"+t+"/remove",n)}},Ne=function(e){this.get=function(t){return e.request.get(e.getApiTeamUrl()+"scenes/"+t)},this.getObjectScenes=function(t,n){var r={};n&&(r.queryParams={shortInfo:n});var i=e.getApiTeamUrl()+"objects/"+t+"/scenes";return e.request.get(i,r)},this.post=function(t,n){return e.request.post(e.getApiTeamUrl()+"objects/"+t+"/scenes",n)},this.delete=function(t){return e.request.del(e.getApiTeamUrl()+"scenes/"+t)},this.put=function(t,n){return e.request.put(e.getApiTeamUrl()+"scenes/"+t,n)},this.postThumbnailAttachment=function(t,n,r,i){return e.request.post(e.getApiTeamUrl()+"objects/"+t+"/attachments",n,{contentType:!1,processData:!1,dataType:null,xhrUploadProgress:r,queryParams:i?{attachmenttype:"thumbnailhighresolution"}:void 0})},this.postThumbnail=function(t,n,r){return e.request.post(e.getApiTeamUrl()+"objects/"+t+"/attachments",n,{queryParams:r?{attachmenttype:"thumbnailhighresolution"}:void 0})},this.getThumbnail=function(t){return e.request.get(e.getApiTeamUrl()+"objects/"+t+"/attachments")}},Me=function(e){this.post=function(t){return e.request.post(e.getApiTeamUrl()+"services/BaseQuantities",JSON.stringify(t))}},Fe=function(e){this.createWorkflowTemplateFolder=function(t,n){return e.request.post(e.getApiTeamUrl()+"structures/"+t,n)},this.putWorkflowTemplateFolder=function(t,n){return e.request.put(e.getApiTeamUrl()+"structures/"+t,n)},this.postWorkflowTemplate=function(t,n){return e.request.post(e.getApiTeamUrl()+"projects/"+t+"/workflowtemplates",n)},this.putWorkflowTemplate=function(t,n){return e.request.put(e.getApiTeamUrl()+"workflowtemplates/"+t,n)},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,n){return e.request.post(e.getApiTeamUrl()+"projects/"+t+"/workflows",n)},this.getAllWorkflows=function(t,n){var r={queryParams:{}};return r.queryParams.status=n,e.request.get(e.getApiTeamUrl()+"projects/"+t+"/workflows",r)},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,n){return e.request.put(e.getApiTeamUrl()+"steps/"+t+"/?submit=true",n)},this.saveStep=function(t,n){return e.request.put(e.getApiTeamUrl()+"steps/"+t+"/?submit=false",n)},this.cancelWorkflow=function(t){return e.request.put(e.getApiTeamUrl()+"workflows/"+t+"/cancel")}},Le=function(e){this.post=function(t){return e.request.post(e.getApiUrl()+"administration/backups",t)},this.put=function(t,n){return e.request.put(e.getApiUrl()+"administration/backups/"+t,n)},this.delete=function(t){return e.request.del(e.getApiUrl()+"administration/backups/"+t)},this.get=function(t){return e.request.get(e.getApiUrl()+"administration/backups/"+t)},this.getProjectBackups=function(t){return e.request.get(e.getApiUrl()+"administration/backups/projects/"+t)}};function Ge(e){return Ge="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},Ge(e)}function ze(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,We(r.key),r)}}function We(e){var t=function(e,t){if("object"!=Ge(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!=Ge(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==Ge(t)?t:t+""}var He=function(){return e=function e(t){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this._config=null,t?(void 0===t.version&&(t.version="v2"),this._config=t):this._config=Ve(),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 M,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 d,this._cache=null)):this.request=new d,this.authorize=new b(this),this.user=new De(this),this.users=new Ce(this),this.teams=new Se(this),this.members=new oe(this),this.projects=new ve(this),this.structures=new ke(this),this.models=new ue(this),this.objects=new le(this),this.overlays=new fe(this),this.overlaySets=new pe(this),this.revisions=new be(this),this.elementTypes=new V(this),this.annotations=new m(this),this.attachments=new y(this),this.issues=new ne(this),this.labels=new re(this),this.pins=new he(this),this.comments=new G(this),this.hyperlinks=new ee(this),this.importService=new te(this),this.slideshows=new Ue(this),this.slides=new _e(this),this.clashDetection=new F(this),this.clientLogs=new L(this),this.rightsService=new we(this),this.applicationSettings=new g(this),this.exportService=new Q(this),this.folders=new J(this),this.locks=new ie(this),this.share=new qe(this),this.messages=new se(this),this.objectFilters=new ce(this),this.terms=new Pe(this),this.dataProtection=new xe(this),this.dimensions=new H(this),this.imprints=new Oe(this),this.projectActionsRights=new de(this),this.roles=new Te(this),this.attributeTemplates=new v(this),this.units=new Ee(this),this.freeAttributes=new Y(this),this.freeAttributeGroups=new X(this),this.hiddenCalculation=new Z(this),this.sectionCut=new Ae(this),this.projectAttributeTemplates=new ge(this),this.teamActionsRights=new je(this),this.customTables=new W(this),this.userSettings=new Ie(this),this.invitations=new Re(this),this.selections=new Be(this),this.userGroups=new Ke(this),this.scenes=new Ne(this),this.baseQuantities=new Me(this),this.workflows=new Fe(this),this.backups=new Le(this),this.connexis=new z(this)},(t=[{key:"setAccessToken",value:function(e){this._token=e,this.request.setAccessToken(e),window.BIMPLUS_SDK_ENABLE_DEBUG_LOGS&&console.log("BimWebSdk: token was set to "+this._token)}},{key:"getAccessToken",value:function(){return this._token}},{key:"setTokenType",value: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)}},{key:"getTokenType",value:function(){return this._tokenType}},{key:"setAccessTokenAndType",value:function(e,t){this.setAccessToken(e),this.setTokenType(t)}},{key:"getAccessTokenAndType",value:function(){return{token:this._token,tokenType:this._tokenType}}},{key:"setTeamSlug",value:function(e){this._teamSlug=e,window.BIMPLUS_SDK_ENABLE_DEBUG_LOGS&&console.log("BimWebSdk: team slug was set to "+this._teamSlug)}},{key:"getTeamSlug",value:function(){return this._teamSlug}},{key:"getApiUrl",value:function(){return this._config.protocol+this._config.host+"/"+(this._config.version?this._config.version+"/":"")}},{key:"getApiTeamUrl",value:function(){return this._teamSlug||console.error("Error: Teamslug not set"),this.getApiUrl()+this._teamSlug+"/"}},{key:"getCache",value:function(){return this._cache}}])&&ze(e.prototype,t),n&&ze(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,t,n}(),Ve=function(e){var t="api.bimplus.net";if(e)switch(e){case"dev":t="api-dev.bimplus.net";break;case"stage":t="api-stage.bimplus.net"}return{protocol:"https://",host:t,cache:!1,version:"v2"}}})(),r})()));
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,(()=>(()=>{var e={744(e,t,n){e.exports=function(){"use strict";var e=function(t,n){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])})(t,n)},t=function(){return(t=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e}).apply(this,arguments)};function r(e,t,n){if(n||2===arguments.length)for(var r,i=0,o=t.length;i<o;i++)!r&&i in t||((r=r||Array.prototype.slice.call(t,0,i))[i]=t[i]);return e.concat(r||Array.prototype.slice.call(t))}var i="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:"undefined"!=typeof window?window:n.g,o=Object.keys,s=Array.isArray;function u(e,t){return"object"!=typeof t||o(t).forEach((function(n){e[n]=t[n]})),e}"undefined"==typeof Promise||i.Promise||(i.Promise=Promise);var a=Object.getPrototypeOf,c={}.hasOwnProperty;function l(e,t){return c.call(e,t)}function f(e,t){"function"==typeof t&&(t=t(a(e))),("undefined"==typeof Reflect?o:Reflect.ownKeys)(t).forEach((function(n){h(e,n,t[n])}))}var p=Object.defineProperty;function h(e,t,n,r){p(e,t,u(n&&l(n,"get")&&"function"==typeof n.get?{get:n.get,set:n.set,configurable:!0}:{value:n,configurable:!0,writable:!0},r))}function d(e){return{from:function(t){return e.prototype=Object.create(t.prototype),h(e.prototype,"constructor",e),{extend:f.bind(null,e.prototype)}}}}var g=Object.getOwnPropertyDescriptor,m=[].slice;function y(e,t,n){return m.call(e,t,n)}function v(e,t){return t(e)}function b(e){if(!e)throw new Error("Assertion Failed")}function w(e){i.setImmediate?setImmediate(e):setTimeout(e,0)}function T(e,t){if("string"==typeof t&&l(e,t))return e[t];if(!t)return e;if("string"!=typeof t){for(var n=[],r=0,i=t.length;r<i;++r){var o=T(e,t[r]);n.push(o)}return n}var s=t.indexOf(".");if(-1!==s){var u=e[t.substr(0,s)];return null==u?void 0:T(u,t.substr(s+1))}}function x(e,t,n){if(e&&void 0!==t&&(!("isFrozen"in Object)||!Object.isFrozen(e)))if("string"!=typeof t&&"length"in t){b("string"!=typeof n&&"length"in n);for(var r=0,i=t.length;r<i;++r)x(e,t[r],n[r])}else{var o,u,a=t.indexOf(".");-1!==a?(o=t.substr(0,a),""===(u=t.substr(a+1))?void 0===n?s(e)&&!isNaN(parseInt(o))?e.splice(o,1):delete e[o]:e[o]=n:x(a=(a=e[o])&&l(e,o)?a:e[o]={},u,n)):void 0===n?s(e)&&!isNaN(parseInt(t))?e.splice(t,1):delete e[t]:e[t]=n}}function A(e){var t,n={};for(t in e)l(e,t)&&(n[t]=e[t]);return n}var q=[].concat;function k(e){return q.apply([],e)}var _="BigUint64Array,BigInt64Array,Array,Boolean,String,Date,RegExp,Blob,File,FileList,FileSystemFileHandle,FileSystemDirectoryHandle,ArrayBuffer,DataView,Uint8ClampedArray,ImageBitmap,ImageData,Map,Set,CryptoKey".split(",").concat(k([8,16,32,64].map((function(e){return["Int","Uint","Float"].map((function(t){return t+e+"Array"}))})))).filter((function(e){return i[e]})),j=new Set(_.map((function(e){return i[e]}))),U=null;function S(e){return U=new WeakMap,e=function e(t){if(!t||"object"!=typeof t)return t;var n=U.get(t);if(n)return n;if(s(t)){n=[],U.set(t,n);for(var r=0,i=t.length;r<i;++r)n.push(e(t[r]))}else if(j.has(t.constructor))n=t;else{var o,u=a(t);for(o in n=u===Object.prototype?{}:Object.create(u),U.set(t,n),t)l(t,o)&&(n[o]=e(t[o]))}return n}(e),U=null,e}var P={}.toString;function E(e){return P.call(e).slice(8,-1)}var C="undefined"!=typeof Symbol?Symbol.iterator:"@@iterator",D="symbol"==typeof C?function(e){var t;return null!=e&&(t=e[C])&&t.apply(e)}:function(){return null};function O(e,t){return 0<=(t=e.indexOf(t))&&e.splice(t,1),0<=t}var R={};function I(e){var t,n,r,i;if(1===arguments.length){if(s(e))return e.slice();if(this===R&&"string"==typeof e)return[e];if(i=D(e)){for(n=[];!(r=i.next()).done;)n.push(r.value);return n}if(null==e)return[e];if("number"!=typeof(t=e.length))return[e];for(n=new Array(t);t--;)n[t]=e[t];return n}for(t=arguments.length,n=new Array(t);t--;)n[t]=arguments[t];return n}var N="undefined"!=typeof Symbol?function(e){return"AsyncFunction"===e[Symbol.toStringTag]}:function(){return!1},B=["Modify","Bulk","OpenFailed","VersionChange","Schema","Upgrade","InvalidTable","MissingAPI","NoSuchDatabase","InvalidArgument","SubTransaction","Unsupported","Internal","DatabaseClosed","PrematureCommit","ForeignAwait"].concat(ae=["Unknown","Constraint","Data","TransactionInactive","ReadOnly","Version","NotFound","InvalidState","InvalidAccess","Abort","Timeout","QuotaExceeded","Syntax","DataClone"]),M={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 K(e,t){this.name=e,this.message=t}function L(e,t){return e+". Errors: "+Object.keys(t).map((function(e){return t[e].toString()})).filter((function(e,t,n){return n.indexOf(e)===t})).join("\n")}function F(e,t,n,r){this.failures=t,this.failedKeys=r,this.successCount=n,this.message=L(e,t)}function H(e,t){this.name="BulkError",this.failures=Object.keys(t).map((function(e){return t[e]})),this.failuresByPos=t,this.message=L(e,this.failures)}d(K).from(Error).extend({toString:function(){return this.name+": "+this.message}}),d(F).from(K),d(H).from(K);var W=B.reduce((function(e,t){return e[t]=t+"Error",e}),{}),G=K,z=B.reduce((function(e,t){var n=t+"Error";function r(e,r){this.name=n,e?"string"==typeof e?(this.message="".concat(e).concat(r?"\n "+r:""),this.inner=r||null):"object"==typeof e&&(this.message="".concat(e.name," ").concat(e.message),this.inner=e):(this.message=M[t]||n,this.inner=null)}return d(r).from(G),e[t]=r,e}),{});z.Syntax=SyntaxError,z.Type=TypeError,z.Range=RangeError;var $=ae.reduce((function(e,t){return e[t+"Error"]=z[t],e}),{}),V=B.reduce((function(e,t){return-1===["Syntax","Type","Range"].indexOf(t)&&(e[t+"Error"]=z[t]),e}),{});function X(){}function Q(e){return e}function J(e,t){return null==e||e===Q?t:function(n){return t(e(n))}}function Y(e,t){return function(){e.apply(this,arguments),t.apply(this,arguments)}}function Z(e,t){return e===X?t:function(){var n=e.apply(this,arguments);void 0!==n&&(arguments[0]=n);var r=this.onsuccess,i=this.onerror;this.onsuccess=null,this.onerror=null;var o=t.apply(this,arguments);return r&&(this.onsuccess=this.onsuccess?Y(r,this.onsuccess):r),i&&(this.onerror=this.onerror?Y(i,this.onerror):i),void 0!==o?o:n}}function ee(e,t){return e===X?t:function(){e.apply(this,arguments);var n=this.onsuccess,r=this.onerror;this.onsuccess=this.onerror=null,t.apply(this,arguments),n&&(this.onsuccess=this.onsuccess?Y(n,this.onsuccess):n),r&&(this.onerror=this.onerror?Y(r,this.onerror):r)}}function te(e,t){return e===X?t:function(n){var r=e.apply(this,arguments);u(n,r);var i=this.onsuccess,o=this.onerror;return this.onsuccess=null,this.onerror=null,n=t.apply(this,arguments),i&&(this.onsuccess=this.onsuccess?Y(i,this.onsuccess):i),o&&(this.onerror=this.onerror?Y(o,this.onerror):o),void 0===r?void 0===n?void 0:n:u(r,n)}}function ne(e,t){return e===X?t:function(){return!1!==t.apply(this,arguments)&&e.apply(this,arguments)}}function re(e,t){return e===X?t:function(){var n=e.apply(this,arguments);if(n&&"function"==typeof n.then){for(var r=this,i=arguments.length,o=new Array(i);i--;)o[i]=arguments[i];return n.then((function(){return t.apply(r,o)}))}return t.apply(this,arguments)}}V.ModifyError=F,V.DexieError=K,V.BulkError=H;var ie="undefined"!=typeof location&&/^(http|https):\/\/(localhost|127\.0\.0\.1)/.test(location.href);function oe(e){ie=e}var se={},ue=100,ae=(_="undefined"==typeof Promise?[]:function(){var e=Promise.resolve();if("undefined"==typeof crypto||!crypto.subtle)return[e,a(e),e];var t=crypto.subtle.digest("SHA-512",new Uint8Array([0]));return[t,a(t),e]}(),_[0]),ce=(B=_[1],_=_[2],B=B&&B.then,ae&&ae.constructor),le=!!_,fe=function(e,t){be.push([e,t]),he&&(queueMicrotask(Se),he=!1)},pe=!0,he=!0,de=[],ge=[],me=Q,ye={id:"global",global:!0,ref:0,unhandleds:[],onunhandled:X,pgp:!1,env:{},finalize:X},ve=ye,be=[],we=0,Te=[];function xe(e){if("object"!=typeof this)throw new TypeError("Promises must be constructed via new");this._listeners=[],this._lib=!1;var t=this._PSD=ve;if("function"!=typeof e){if(e!==se)throw new TypeError("Not a function");return this._state=arguments[1],this._value=arguments[2],void(!1===this._state&&ke(this,this._value))}this._state=null,this._value=null,++t.ref,function e(t,n){try{n((function(n){if(null===t._state){if(n===t)throw new TypeError("A promise cannot be resolved with itself.");var r=t._lib&&Pe();n&&"function"==typeof n.then?e(t,(function(e,t){n instanceof xe?n._then(e,t):n.then(e,t)})):(t._state=!0,t._value=n,_e(t)),r&&Ee()}}),ke.bind(null,t))}catch(n){ke(t,n)}}(this,e)}var Ae={get:function(){var e=ve,t=Me;function n(n,r){var i=this,o=!e.global&&(e!==ve||t!==Me),s=o&&!He(),u=new xe((function(t,u){je(i,new qe(Xe(n,e,o,s),Xe(r,e,o,s),t,u,e))}));return this._consoleTask&&(u._consoleTask=this._consoleTask),u}return n.prototype=se,n},set:function(e){h(this,"then",e&&e.prototype===se?Ae:{get:function(){return e},set:Ae.set})}};function qe(e,t,n,r,i){this.onFulfilled="function"==typeof e?e:null,this.onRejected="function"==typeof t?t:null,this.resolve=n,this.reject=r,this.psd=i}function ke(e,t){var n,r;ge.push(t),null===e._state&&(n=e._lib&&Pe(),t=me(t),e._state=!1,e._value=t,r=e,de.some((function(e){return e._value===r._value}))||de.push(r),_e(e),n&&Ee())}function _e(e){var t=e._listeners;e._listeners=[];for(var n=0,r=t.length;n<r;++n)je(e,t[n]);var i=e._PSD;--i.ref||i.finalize(),0===we&&(++we,fe((function(){0==--we&&Ce()}),[]))}function je(e,t){if(null!==e._state){var n=e._state?t.onFulfilled:t.onRejected;if(null===n)return(e._state?t.resolve:t.reject)(e._value);++t.psd.ref,++we,fe(Ue,[n,e,t])}else e._listeners.push(t)}function Ue(e,t,n){try{var r,i=t._value;!t._state&&ge.length&&(ge=[]),r=ie&&t._consoleTask?t._consoleTask.run((function(){return e(i)})):e(i),t._state||-1!==ge.indexOf(i)||function(e){for(var t=de.length;t;)if(de[--t]._value===e._value)return de.splice(t,1)}(t),n.resolve(r)}catch(e){n.reject(e)}finally{0==--we&&Ce(),--n.psd.ref||n.psd.finalize()}}function Se(){Ve(ye,(function(){Pe()&&Ee()}))}function Pe(){var e=pe;return he=pe=!1,e}function Ee(){var e,t,n;do{for(;0<be.length;)for(e=be,be=[],n=e.length,t=0;t<n;++t){var r=e[t];r[0].apply(null,r[1])}}while(0<be.length);he=pe=!0}function Ce(){var e=de;de=[],e.forEach((function(e){e._PSD.onunhandled.call(null,e._value,e)}));for(var t=Te.slice(0),n=t.length;n;)t[--n]()}function De(e){return new xe(se,!1,e)}function Oe(e,t){var n=ve;return function(){var r=Pe(),i=ve;try{return ze(n,!0),e.apply(this,arguments)}catch(r){t&&t(r)}finally{ze(i,!1),r&&Ee()}}}f(xe.prototype,{then:Ae,_then:function(e,t){je(this,new qe(null,null,e,t,ve))},catch:function(e){if(1===arguments.length)return this.then(null,e);var t=e,n=arguments[1];return"function"==typeof t?this.then(null,(function(e){return(e instanceof t?n:De)(e)})):this.then(null,(function(e){return(e&&e.name===t?n:De)(e)}))},finally:function(e){return this.then((function(t){return xe.resolve(e()).then((function(){return t}))}),(function(t){return xe.resolve(e()).then((function(){return De(t)}))}))},timeout:function(e,t){var n=this;return e<1/0?new xe((function(r,i){var o=setTimeout((function(){return i(new z.Timeout(t))}),e);n.then(r,i).finally(clearTimeout.bind(null,o))})):this}}),"undefined"!=typeof Symbol&&Symbol.toStringTag&&h(xe.prototype,Symbol.toStringTag,"Dexie.Promise"),ye.env=$e(),f(xe,{all:function(){var e=I.apply(null,arguments).map(We);return new xe((function(t,n){0===e.length&&t([]);var r=e.length;e.forEach((function(i,o){return xe.resolve(i).then((function(n){e[o]=n,--r||t(e)}),n)}))}))},resolve:function(e){return e instanceof xe?e:e&&"function"==typeof e.then?new xe((function(t,n){e.then(t,n)})):new xe(se,!0,e)},reject:De,race:function(){var e=I.apply(null,arguments).map(We);return new xe((function(t,n){e.map((function(e){return xe.resolve(e).then(t,n)}))}))},PSD:{get:function(){return ve},set:function(e){return ve=e}},totalEchoes:{get:function(){return Me}},newPSD:Le,usePSD:Ve,scheduler:{get:function(){return fe},set:function(e){fe=e}},rejectionMapper:{get:function(){return me},set:function(e){me=e}},follow:function(e,t){return new xe((function(n,r){return Le((function(t,n){var r=ve;r.unhandleds=[],r.onunhandled=n,r.finalize=Y((function(){var e,r=this;e=function(){0===r.unhandleds.length?t():n(r.unhandleds[0])},Te.push((function t(){e(),Te.splice(Te.indexOf(t),1)})),++we,fe((function(){0==--we&&Ce()}),[])}),r.finalize),e()}),t,n,r)}))}}),ce&&(ce.allSettled&&h(xe,"allSettled",(function(){var e=I.apply(null,arguments).map(We);return new xe((function(t){0===e.length&&t([]);var n=e.length,r=new Array(n);e.forEach((function(e,i){return xe.resolve(e).then((function(e){return r[i]={status:"fulfilled",value:e}}),(function(e){return r[i]={status:"rejected",reason:e}})).then((function(){return--n||t(r)}))}))}))})),ce.any&&"undefined"!=typeof AggregateError&&h(xe,"any",(function(){var e=I.apply(null,arguments).map(We);return new xe((function(t,n){0===e.length&&n(new AggregateError([]));var r=e.length,i=new Array(r);e.forEach((function(e,o){return xe.resolve(e).then((function(e){return t(e)}),(function(e){i[o]=e,--r||n(new AggregateError(i))}))}))}))})),ce.withResolvers&&(xe.withResolvers=ce.withResolvers));var Re={awaits:0,echoes:0,id:0},Ie=0,Ne=[],Be=0,Me=0,Ke=0;function Le(e,t,n,r){var i=ve,o=Object.create(i);return o.parent=i,o.ref=0,o.global=!1,o.id=++Ke,ye.env,o.env=le?{Promise:xe,PromiseProp:{value:xe,configurable:!0,writable:!0},all:xe.all,race:xe.race,allSettled:xe.allSettled,any:xe.any,resolve:xe.resolve,reject:xe.reject}:{},t&&u(o,t),++i.ref,o.finalize=function(){--this.parent.ref||this.parent.finalize()},r=Ve(o,e,n,r),0===o.ref&&o.finalize(),r}function Fe(){return Re.id||(Re.id=++Ie),++Re.awaits,Re.echoes+=ue,Re.id}function He(){return!!Re.awaits&&(0==--Re.awaits&&(Re.id=0),Re.echoes=Re.awaits*ue,!0)}function We(e){return Re.echoes&&e&&e.constructor===ce?(Fe(),e.then((function(e){return He(),e}),(function(e){return He(),Je(e)}))):e}function Ge(){var e=Ne[Ne.length-1];Ne.pop(),ze(e,!1)}function ze(e,t){var n,r=ve;(t?!Re.echoes||Be++&&e===ve:!Be||--Be&&e===ve)||queueMicrotask(t?function(e){++Me,Re.echoes&&0!=--Re.echoes||(Re.echoes=Re.awaits=Re.id=0),Ne.push(ve),ze(e,!0)}.bind(null,e):Ge),e!==ve&&(ve=e,r===ye&&(ye.env=$e()),le&&(n=ye.env.Promise,t=e.env,(r.global||e.global)&&(Object.defineProperty(i,"Promise",t.PromiseProp),n.all=t.all,n.race=t.race,n.resolve=t.resolve,n.reject=t.reject,t.allSettled&&(n.allSettled=t.allSettled),t.any&&(n.any=t.any))))}function $e(){var e=i.Promise;return le?{Promise:e,PromiseProp:Object.getOwnPropertyDescriptor(i,"Promise"),all:e.all,race:e.race,allSettled:e.allSettled,any:e.any,resolve:e.resolve,reject:e.reject}:{}}function Ve(e,t,n,r,i){var o=ve;try{return ze(e,!0),t(n,r,i)}finally{ze(o,!1)}}function Xe(e,t,n,r){return"function"!=typeof e?e:function(){var i=ve;n&&Fe(),ze(t,!0);try{return e.apply(this,arguments)}finally{ze(i,!1),r&&queueMicrotask(He)}}}function Qe(e){Promise===ce&&0===Re.echoes?0===Be?e():enqueueNativeMicroTask(e):setTimeout(e,0)}-1===(""+B).indexOf("[native code]")&&(Fe=He=X);var Je=xe.reject,Ye=String.fromCharCode(65535),Ze="Invalid key provided. Keys must be of type string, number, Date or Array<string | number | Date>.",et="String expected.",tt=[],nt="__dbnames",rt="readonly",it="readwrite";function ot(e,t){return e?t?function(){return e.apply(this,arguments)&&t.apply(this,arguments)}:e:t}var st={type:3,lower:-1/0,lowerOpen:!1,upper:[[]],upperOpen:!1};function ut(e){return"string"!=typeof e||/\./.test(e)?function(e){return e}:function(t){return void 0===t[e]&&e in t&&delete(t=S(t))[e],t}}function at(){throw z.Type("Entity instances must never be new:ed. Instances are generated by the framework bypassing the constructor.")}function ct(e,t){try{var n=lt(e),r=lt(t);if(n!==r)return"Array"===n?1:"Array"===r?-1:"binary"===n?1:"binary"===r?-1:"string"===n?1:"string"===r?-1:"Date"===n?1:"Date"!==r?NaN:-1;switch(n){case"number":case"Date":case"string":return t<e?1:e<t?-1:0;case"binary":return function(e,t){for(var n=e.length,r=t.length,i=n<r?n:r,o=0;o<i;++o)if(e[o]!==t[o])return e[o]<t[o]?-1:1;return n===r?0:n<r?-1:1}(ft(e),ft(t));case"Array":return function(e,t){for(var n=e.length,r=t.length,i=n<r?n:r,o=0;o<i;++o){var s=ct(e[o],t[o]);if(0!==s)return s}return n===r?0:n<r?-1:1}(e,t)}}catch(e){}return NaN}function lt(e){var t=typeof e;return"object"!=t?t:ArrayBuffer.isView(e)||"ArrayBuffer"===(e=E(e))?"binary":e}function ft(e){return e instanceof Uint8Array?e:ArrayBuffer.isView(e)?new Uint8Array(e.buffer,e.byteOffset,e.byteLength):new Uint8Array(e)}function pt(e,t,n){var r=e.schema.yProps;return r?(t&&0<n.numFailures&&(t=t.filter((function(e,t){return!n.failures[t]}))),Promise.all(r.map((function(n){return n=n.updatesTable,t?e.db.table(n).where("k").anyOf(t).delete():e.db.table(n).clear()}))).then((function(){return n}))):n}var ht=(dt.prototype.execute=function(e){var t=this["@@propmod"];if(void 0!==t.add){var n=t.add;if(s(n))return r(r([],s(e)?e:[],!0),n,!0).sort();if("number"==typeof n)return(Number(e)||0)+n;if("bigint"==typeof n)try{return BigInt(e)+n}catch(e){return BigInt(0)+n}throw new TypeError("Invalid term ".concat(n))}if(void 0!==t.remove){var i=t.remove;if(s(i))return s(e)?e.filter((function(e){return!i.includes(e)})).sort():[];if("number"==typeof i)return Number(e)-i;if("bigint"==typeof i)try{return BigInt(e)-i}catch(e){return BigInt(0)-i}throw new TypeError("Invalid subtrahend ".concat(i))}return(n=null===(n=t.replacePrefix)||void 0===n?void 0:n[0])&&"string"==typeof e&&e.startsWith(n)?t.replacePrefix[1]+e.substring(n.length):e},dt);function dt(e){this["@@propmod"]=e}function gt(e,t){for(var n=o(t),r=n.length,i=!1,s=0;s<r;++s){var u=n[s],a=t[u],c=T(e,u);a instanceof ht?(x(e,u,a.execute(c)),i=!0):c!==a&&(x(e,u,a),i=!0)}return i}var mt=(yt.prototype._trans=function(e,t,n){var r=this._tx||ve.trans,i=this.name,o=ie&&"undefined"!=typeof console&&console.createTask&&console.createTask("Dexie: ".concat("readonly"===e?"read":"write"," ").concat(this.name));function s(e,n,r){if(!r.schema[i])throw new z.NotFound("Table "+i+" not part of transaction");return t(r.idbtrans,r)}var u=Pe();try{var a=r&&r.db._novip===this.db._novip?r===ve.trans?r._promise(e,s,n):Le((function(){return r._promise(e,s,n)}),{trans:r,transless:ve.transless||ve}):function e(t,n,r,i){if(t.idbdb&&(t._state.openComplete||ve.letThrough||t._vip)){var o=t._createTransaction(n,r,t._dbSchema);try{o.create(),t._state.PR1398_maxLoop=3}catch(o){return o.name===W.InvalidState&&t.isOpen()&&0<--t._state.PR1398_maxLoop?(console.warn("Dexie: Need to reopen db"),t.close({disableAutoOpen:!1}),t.open().then((function(){return e(t,n,r,i)}))):Je(o)}return o._promise(n,(function(e,t){return Le((function(){return ve.trans=o,i(e,t,o)}))})).then((function(e){if("readwrite"===n)try{o.idbtrans.commit()}catch(e){}return"readonly"===n?e:o._completion.then((function(){return e}))}))}if(t._state.openComplete)return Je(new z.DatabaseClosed(t._state.dbOpenError));if(!t._state.isBeingOpened){if(!t._state.autoOpen)return Je(new z.DatabaseClosed);t.open().catch(X)}return t._state.dbReadyPromise.then((function(){return e(t,n,r,i)}))}(this.db,e,[this.name],s);return o&&(a._consoleTask=o,a=a.catch((function(e){return console.trace(e),Je(e)}))),a}finally{u&&Ee()}},yt.prototype.get=function(e,t){var n=this;return e&&e.constructor===Object?this.where(e).first(t):null==e?Je(new z.Type("Invalid argument to Table.get()")):this._trans("readonly",(function(t){return n.core.get({trans:t,key:e}).then((function(e){return n.hook.reading.fire(e)}))})).then(t)},yt.prototype.where=function(e){if("string"==typeof e)return new this.db.WhereClause(this,e);if(s(e))return new this.db.WhereClause(this,"[".concat(e.join("+"),"]"));var t=o(e);if(1===t.length)return this.where(t[0]).equals(e[t[0]]);var n=this.schema.indexes.concat(this.schema.primKey).filter((function(e){if(e.compound&&t.every((function(t){return 0<=e.keyPath.indexOf(t)}))){for(var n=0;n<t.length;++n)if(-1===t.indexOf(e.keyPath[n]))return!1;return!0}return!1})).sort((function(e,t){return e.keyPath.length-t.keyPath.length}))[0];if(n&&this.db._maxKey!==Ye){var r=n.keyPath.slice(0,t.length);return this.where(r).equals(r.map((function(t){return e[t]})))}!n&&ie&&console.warn("The query ".concat(JSON.stringify(e)," on ").concat(this.name," would benefit from a ")+"compound index [".concat(t.join("+"),"]"));var i=this.schema.idxByName;function u(e,t){return 0===ct(e,t)}var a=t.reduce((function(t,n){var r=t[0],o=t[1],a=(t=i[n],e[n]);return[r||t,r||!t?ot(o,t&&t.multi?function(e){return e=T(e,n),s(e)&&e.some((function(e){return u(a,e)}))}:function(e){return u(a,T(e,n))}):o]}),[null,null]);return r=a[0],a=a[1],r?this.where(r.name).equals(e[r.keyPath]).filter(a):n?this.filter(a):this.where(t).equals("")},yt.prototype.filter=function(e){return this.toCollection().and(e)},yt.prototype.count=function(e){return this.toCollection().count(e)},yt.prototype.offset=function(e){return this.toCollection().offset(e)},yt.prototype.limit=function(e){return this.toCollection().limit(e)},yt.prototype.each=function(e){return this.toCollection().each(e)},yt.prototype.toArray=function(e){return this.toCollection().toArray(e)},yt.prototype.toCollection=function(){return new this.db.Collection(new this.db.WhereClause(this))},yt.prototype.orderBy=function(e){return new this.db.Collection(new this.db.WhereClause(this,s(e)?"[".concat(e.join("+"),"]"):e))},yt.prototype.reverse=function(){return this.toCollection().reverse()},yt.prototype.mapToClass=function(t){var n,r=this.db,i=this.name;function o(){return null!==n&&n.apply(this,arguments)||this}(this.schema.mappedClass=t).prototype instanceof at&&(function(t,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}(o,n=t),Object.defineProperty(o.prototype,"db",{get:function(){return r},enumerable:!1,configurable:!0}),o.prototype.table=function(){return i},t=o);for(var s=new Set,u=t.prototype;u;u=a(u))Object.getOwnPropertyNames(u).forEach((function(e){return s.add(e)}));function c(e){if(!e)return e;var n,r=Object.create(t.prototype);for(n in e)if(!s.has(n))try{r[n]=e[n]}catch(e){}return r}return this.schema.readHook&&this.hook.reading.unsubscribe(this.schema.readHook),this.schema.readHook=c,this.hook("reading",c),t},yt.prototype.defineClass=function(){return this.mapToClass((function(e){u(this,e)}))},yt.prototype.add=function(e,t){var n=this,r=this.schema.primKey,i=r.auto,o=r.keyPath,s=e;return o&&i&&(s=ut(o)(e)),this._trans("readwrite",(function(e){return n.core.mutate({trans:e,type:"add",keys:null!=t?[t]:null,values:[s]})})).then((function(e){return e.numFailures?xe.reject(e.failures[0]):e.lastResult})).then((function(t){if(o)try{x(e,o,t)}catch(t){}return t}))},yt.prototype.upsert=function(e,t){var n=this,r=this.schema.primKey.keyPath;return this._trans("readwrite",(function(i){return n.core.get({trans:i,key:e}).then((function(o){var s=null!=o?o:{};return gt(s,t),r&&x(s,r,e),n.core.mutate({trans:i,type:"put",values:[s],keys:[e],upsert:!0,updates:{keys:[e],changeSpecs:[t]}}).then((function(e){return e.numFailures?xe.reject(e.failures[0]):!!o}))}))}))},yt.prototype.update=function(e,t){return"object"!=typeof e||s(e)?this.where(":id").equals(e).modify(t):void 0===(e=T(e,this.schema.primKey.keyPath))?Je(new z.InvalidArgument("Given object does not contain its primary key")):this.where(":id").equals(e).modify(t)},yt.prototype.put=function(e,t){var n=this,r=this.schema.primKey,i=r.auto,o=r.keyPath,s=e;return o&&i&&(s=ut(o)(e)),this._trans("readwrite",(function(e){return n.core.mutate({trans:e,type:"put",values:[s],keys:null!=t?[t]:null})})).then((function(e){return e.numFailures?xe.reject(e.failures[0]):e.lastResult})).then((function(t){if(o)try{x(e,o,t)}catch(t){}return t}))},yt.prototype.delete=function(e){var t=this;return this._trans("readwrite",(function(n){return t.core.mutate({trans:n,type:"delete",keys:[e]}).then((function(n){return pt(t,[e],n)})).then((function(e){return e.numFailures?xe.reject(e.failures[0]):void 0}))}))},yt.prototype.clear=function(){var e=this;return this._trans("readwrite",(function(t){return e.core.mutate({trans:t,type:"deleteRange",range:st}).then((function(t){return pt(e,null,t)}))})).then((function(e){return e.numFailures?xe.reject(e.failures[0]):void 0}))},yt.prototype.bulkGet=function(e){var t=this;return this._trans("readonly",(function(n){return t.core.getMany({keys:e,trans:n}).then((function(e){return e.map((function(e){return t.hook.reading.fire(e)}))}))}))},yt.prototype.bulkAdd=function(e,t,n){var r=this,i=Array.isArray(t)?t:void 0,o=(n=n||(i?void 0:t))?n.allKeys:void 0;return this._trans("readwrite",(function(t){var n=(u=r.schema.primKey).auto;if((u=u.keyPath)&&i)throw new z.InvalidArgument("bulkAdd(): keys argument invalid on tables with inbound keys");if(i&&i.length!==e.length)throw new z.InvalidArgument("Arguments objects and keys must have the same length");var s=e.length,u=u&&n?e.map(ut(u)):e;return r.core.mutate({trans:t,type:"add",keys:i,values:u,wantResults:o}).then((function(e){var t=e.numFailures,n=e.results,i=e.lastResult;if(e=e.failures,0===t)return o?n:i;throw new H("".concat(r.name,".bulkAdd(): ").concat(t," of ").concat(s," operations failed"),e)}))}))},yt.prototype.bulkPut=function(e,t,n){var r=this,i=Array.isArray(t)?t:void 0,o=(n=n||(i?void 0:t))?n.allKeys:void 0;return this._trans("readwrite",(function(t){var n=(u=r.schema.primKey).auto;if((u=u.keyPath)&&i)throw new z.InvalidArgument("bulkPut(): keys argument invalid on tables with inbound keys");if(i&&i.length!==e.length)throw new z.InvalidArgument("Arguments objects and keys must have the same length");var s=e.length,u=u&&n?e.map(ut(u)):e;return r.core.mutate({trans:t,type:"put",keys:i,values:u,wantResults:o}).then((function(e){var t=e.numFailures,n=e.results,i=e.lastResult;if(e=e.failures,0===t)return o?n:i;throw new H("".concat(r.name,".bulkPut(): ").concat(t," of ").concat(s," operations failed"),e)}))}))},yt.prototype.bulkUpdate=function(e){var t=this,n=this.core,r=e.map((function(e){return e.key})),i=e.map((function(e){return e.changes})),o=[];return this._trans("readwrite",(function(s){return n.getMany({trans:s,keys:r,cache:"clone"}).then((function(u){var a=[],c=[];e.forEach((function(e,n){var r=e.key,i=e.changes,s=u[n];if(s){for(var l=0,f=Object.keys(i);l<f.length;l++){var p=f[l],h=i[p];if(p===t.schema.primKey.keyPath){if(0!==ct(h,r))throw new z.Constraint("Cannot update primary key in bulkUpdate()")}else x(s,p,h)}o.push(n),a.push(r),c.push(s)}}));var l=a.length;return n.mutate({trans:s,type:"put",keys:a,values:c,updates:{keys:r,changeSpecs:i}}).then((function(e){var n=e.numFailures,r=e.failures;if(0===n)return l;for(var i=0,s=Object.keys(r);i<s.length;i++){var u,a=s[i],c=o[Number(a)];null!=c&&(u=r[a],delete r[a],r[c]=u)}throw new H("".concat(t.name,".bulkUpdate(): ").concat(n," of ").concat(l," operations failed"),r)}))}))}))},yt.prototype.bulkDelete=function(e){var t=this,n=e.length;return this._trans("readwrite",(function(n){return t.core.mutate({trans:n,type:"delete",keys:e}).then((function(n){return pt(t,e,n)}))})).then((function(e){var r=e.numFailures,i=e.lastResult;if(e=e.failures,0===r)return i;throw new H("".concat(t.name,".bulkDelete(): ").concat(r," of ").concat(n," operations failed"),e)}))},yt);function yt(){}function vt(e){function t(t,r){if(r){for(var i=arguments.length,o=new Array(i-1);--i;)o[i-1]=arguments[i];return n[t].subscribe.apply(null,o),e}if("string"==typeof t)return n[t]}var n={};t.addEventType=u;for(var r=1,i=arguments.length;r<i;++r)u(arguments[r]);return t;function u(e,r,i){if("object"!=typeof e){var a;r=r||ne;var c={subscribers:[],fire:i=i||X,subscribe:function(e){-1===c.subscribers.indexOf(e)&&(c.subscribers.push(e),c.fire=r(c.fire,e))},unsubscribe:function(e){c.subscribers=c.subscribers.filter((function(t){return t!==e})),c.fire=c.subscribers.reduce(r,i)}};return n[e]=t[e]=c}o(a=e).forEach((function(e){var t=a[e];if(s(t))u(e,a[e][0],a[e][1]);else{if("asap"!==t)throw new z.InvalidArgument("Invalid event config");var n=u(e,Q,(function(){for(var e=arguments.length,t=new Array(e);e--;)t[e]=arguments[e];n.subscribers.forEach((function(e){w((function(){e.apply(null,t)}))}))}))}}))}}function bt(e,t){return d(t).from({prototype:e}),t}function wt(e,t){return!(e.filter||e.algorithm||e.or)&&(t?e.justLimit:!e.replayFilter)}function Tt(e,t){e.filter=ot(e.filter,t)}function xt(e,t,n){var r=e.replayFilter;e.replayFilter=r?function(){return ot(r(),t())}:t,e.justLimit=n&&!r}function At(e,t){if(e.isPrimKey)return t.primaryKey;var n=t.getIndexByKeyPath(e.index);if(!n)throw new z.Schema("KeyPath "+e.index+" on object store "+t.name+" is not indexed");return n}function qt(e,t,n){var r=At(e,t.schema);return t.openCursor({trans:n,values:!e.keysOnly,reverse:"prev"===e.dir,unique:!!e.unique,query:{index:r,range:e.range}})}function kt(e,t,n,r){var i=e.replayFilter?ot(e.filter,e.replayFilter()):e.filter;if(e.or){var o={},s=function(e,n,r){var s,u;i&&!i(n,r,(function(e){return n.stop(e)}),(function(e){return n.fail(e)}))||("[object ArrayBuffer]"==(u=""+(s=n.primaryKey))&&(u=""+new Uint8Array(s)),l(o,u)||(o[u]=!0,t(e,n,r)))};return Promise.all([e.or._iterate(s,n),_t(qt(e,r,n),e.algorithm,s,!e.keysOnly&&e.valueMapper)])}return _t(qt(e,r,n),ot(e.algorithm,i),t,!e.keysOnly&&e.valueMapper)}function _t(e,t,n,r){var i=Oe(r?function(e,t,i){return n(r(e),t,i)}:n);return e.then((function(e){if(e)return e.start((function(){var n=function(){return e.continue()};t&&!t(e,(function(e){return n=e}),(function(t){e.stop(t),n=X}),(function(t){e.fail(t),n=X}))||i(e.value,e,(function(e){return n=e})),n()}))}))}var jt=(Ut.prototype._read=function(e,t){var n=this._ctx;return n.error?n.table._trans(null,Je.bind(null,n.error)):n.table._trans("readonly",e).then(t)},Ut.prototype._write=function(e){var t=this._ctx;return t.error?t.table._trans(null,Je.bind(null,t.error)):t.table._trans("readwrite",e,"locked")},Ut.prototype._addAlgorithm=function(e){var t=this._ctx;t.algorithm=ot(t.algorithm,e)},Ut.prototype._iterate=function(e,t){return kt(this._ctx,e,t,this._ctx.table.core)},Ut.prototype.clone=function(e){var t=Object.create(this.constructor.prototype),n=Object.create(this._ctx);return e&&u(n,e),t._ctx=n,t},Ut.prototype.raw=function(){return this._ctx.valueMapper=null,this},Ut.prototype.each=function(e){var t=this._ctx;return this._read((function(n){return kt(t,e,n,t.table.core)}))},Ut.prototype.count=function(e){var t=this;return this._read((function(e){var n=t._ctx,r=n.table.core;if(wt(n,!0))return r.count({trans:e,query:{index:At(n,r.schema),range:n.range}}).then((function(e){return Math.min(e,n.limit)}));var i=0;return kt(n,(function(){return++i,!1}),e,r).then((function(){return i}))})).then(e)},Ut.prototype.sortBy=function(e,t){var n=e.split(".").reverse(),r=n[0],i=n.length-1;function o(e,t){return t?o(e[n[t]],t-1):e[r]}var s="next"===this._ctx.dir?1:-1;function u(e,t){return ct(o(e,i),o(t,i))*s}return this.toArray((function(e){return e.sort(u)})).then(t)},Ut.prototype.toArray=function(e){var t=this;return this._read((function(e){var n=t._ctx;if("next"===n.dir&&wt(n,!0)&&0<n.limit){var r=n.valueMapper,i=At(n,n.table.core.schema);return n.table.core.query({trans:e,limit:n.limit,values:!0,query:{index:i,range:n.range}}).then((function(e){return e=e.result,r?e.map(r):e}))}var o=[];return kt(n,(function(e){return o.push(e)}),e,n.table.core).then((function(){return o}))}),e)},Ut.prototype.offset=function(e){var t=this._ctx;return e<=0||(t.offset+=e,wt(t)?xt(t,(function(){var t=e;return function(e,n){return 0===t||(1===t?--t:n((function(){e.advance(t),t=0})),!1)}})):xt(t,(function(){var t=e;return function(){return--t<0}}))),this},Ut.prototype.limit=function(e){return this._ctx.limit=Math.min(this._ctx.limit,e),xt(this._ctx,(function(){var t=e;return function(e,n,r){return--t<=0&&n(r),0<=t}}),!0),this},Ut.prototype.until=function(e,t){return Tt(this._ctx,(function(n,r,i){return!e(n.value)||(r(i),t)})),this},Ut.prototype.first=function(e){return this.limit(1).toArray((function(e){return e[0]})).then(e)},Ut.prototype.last=function(e){return this.reverse().first(e)},Ut.prototype.filter=function(e){var t;return Tt(this._ctx,(function(t){return e(t.value)})),(t=this._ctx).isMatch=ot(t.isMatch,e),this},Ut.prototype.and=function(e){return this.filter(e)},Ut.prototype.or=function(e){return new this.db.WhereClause(this._ctx.table,e,this)},Ut.prototype.reverse=function(){return this._ctx.dir="prev"===this._ctx.dir?"next":"prev",this._ondirectionchange&&this._ondirectionchange(this._ctx.dir),this},Ut.prototype.desc=function(){return this.reverse()},Ut.prototype.eachKey=function(e){var t=this._ctx;return t.keysOnly=!t.isMatch,this.each((function(t,n){e(n.key,n)}))},Ut.prototype.eachUniqueKey=function(e){return this._ctx.unique="unique",this.eachKey(e)},Ut.prototype.eachPrimaryKey=function(e){var t=this._ctx;return t.keysOnly=!t.isMatch,this.each((function(t,n){e(n.primaryKey,n)}))},Ut.prototype.keys=function(e){var t=this._ctx;t.keysOnly=!t.isMatch;var n=[];return this.each((function(e,t){n.push(t.key)})).then((function(){return n})).then(e)},Ut.prototype.primaryKeys=function(e){var t=this._ctx;if("next"===t.dir&&wt(t,!0)&&0<t.limit)return this._read((function(e){var n=At(t,t.table.core.schema);return t.table.core.query({trans:e,values:!1,limit:t.limit,query:{index:n,range:t.range}})})).then((function(e){return e.result})).then(e);t.keysOnly=!t.isMatch;var n=[];return this.each((function(e,t){n.push(t.primaryKey)})).then((function(){return n})).then(e)},Ut.prototype.uniqueKeys=function(e){return this._ctx.unique="unique",this.keys(e)},Ut.prototype.firstKey=function(e){return this.limit(1).keys((function(e){return e[0]})).then(e)},Ut.prototype.lastKey=function(e){return this.reverse().firstKey(e)},Ut.prototype.distinct=function(){var e;if(!(e=(e=this._ctx).index&&e.table.schema.idxByName[e.index])||!e.multi)return this;var t={};return Tt(this._ctx,(function(e){var n=e.primaryKey.toString();return e=l(t,n),t[n]=!0,!e})),this},Ut.prototype.modify=function(e){var t=this,n=this._ctx;return this._write((function(r){var i,s="function"==typeof e?e:function(t){return gt(t,e)},u=n.table.core,a=(i=u.schema.primaryKey).outbound,c=i.extractKey,l=200;function f(e,t){var n=t.failures;t=t.numFailures,h+=e-t;for(var r=0,i=o(n);r<i.length;r++){var s=i[r];p.push(n[s])}}(i=t.db._options.modifyChunkSize)&&(l="object"==typeof i?i[u.name]||i["*"]||200:i);var p=[],h=0,d=[],g=e===St;return t.clone().primaryKeys().then((function(t){function i(p){var h=Math.min(l,t.length-p),d=t.slice(p,p+h);return(g?Promise.resolve([]):u.getMany({trans:r,keys:d,cache:"immutable"})).then((function(m){var y=[],v=[],b=a?[]:null,w=g?d:[];if(!g)for(var T=0;T<h;++T){var x=m[T],A={value:S(x),primKey:t[p+T]};!1!==s.call(A,A.value,A)&&(null==A.value?w.push(t[p+T]):a||0===ct(c(x),c(A.value))?(v.push(A.value),a&&b.push(t[p+T])):(w.push(t[p+T]),y.push(A.value)))}return Promise.resolve(0<y.length&&u.mutate({trans:r,type:"add",values:y}).then((function(e){for(var t in e.failures)w.splice(parseInt(t),1);f(y.length,e)}))).then((function(){return(0<v.length||o&&"object"==typeof e)&&u.mutate({trans:r,type:"put",keys:b,values:v,criteria:o,changeSpec:"function"!=typeof e&&e,isAdditionalChunk:0<p}).then((function(e){return f(v.length,e)}))})).then((function(){return(0<w.length||o&&g)&&u.mutate({trans:r,type:"delete",keys:w,criteria:o,isAdditionalChunk:0<p}).then((function(e){return pt(n.table,w,e)})).then((function(e){return f(w.length,e)}))})).then((function(){return t.length>p+h&&i(p+l)}))}))}var o=wt(n)&&n.limit===1/0&&("function"!=typeof e||g)&&{index:n.index,range:n.range};return i(0).then((function(){if(0<p.length)throw new F("Error modifying one or more objects",p,h,d);return t.length}))}))}))},Ut.prototype.delete=function(){var e=this._ctx,t=e.range;return!wt(e)||e.table.schema.yProps||!e.isPrimKey&&3!==t.type?this.modify(St):this._write((function(n){var r=e.table.core.schema.primaryKey,i=t;return e.table.core.count({trans:n,query:{index:r,range:i}}).then((function(t){return e.table.core.mutate({trans:n,type:"deleteRange",range:i}).then((function(e){var n=e.failures;if(e=e.numFailures)throw new F("Could not delete some values",Object.keys(n).map((function(e){return n[e]})),t-e);return t-e}))}))}))},Ut);function Ut(){}var St=function(e,t){return t.value=null};function Pt(e,t){return e<t?-1:e===t?0:1}function Et(e,t){return t<e?-1:e===t?0:1}function Ct(e,t,n){return(e=e instanceof Nt?new e.Collection(e):e)._ctx.error=new(n||TypeError)(t),e}function Dt(e){return new e.Collection(e,(function(){return It("")})).limit(0)}function Ot(e,t,n,r){var i,o,s,u,a,c,l,f=n.length;if(!n.every((function(e){return"string"==typeof e})))return Ct(e,et);function p(e){i="next"===e?function(e){return e.toUpperCase()}:function(e){return e.toLowerCase()},o="next"===e?function(e){return e.toLowerCase()}:function(e){return e.toUpperCase()},s="next"===e?Pt:Et;var t=n.map((function(e){return{lower:o(e),upper:i(e)}})).sort((function(e,t){return s(e.lower,t.lower)}));u=t.map((function(e){return e.upper})),a=t.map((function(e){return e.lower})),l="next"===(c=e)?"":r}p("next"),(e=new e.Collection(e,(function(){return Rt(u[0],a[f-1]+r)})))._ondirectionchange=function(e){p(e)};var h=0;return e._addAlgorithm((function(e,n,r){var i=e.key;if("string"!=typeof i)return!1;var p=o(i);if(t(p,a,h))return!0;for(var d=null,g=h;g<f;++g){var m=function(e,t,n,r,i,o){for(var s=Math.min(e.length,r.length),u=-1,a=0;a<s;++a){var c=t[a];if(c!==r[a])return i(e[a],n[a])<0?e.substr(0,a)+n[a]+n.substr(a+1):i(e[a],r[a])<0?e.substr(0,a)+r[a]+n.substr(a+1):0<=u?e.substr(0,u)+t[u]+n.substr(u+1):null;i(e[a],c)<0&&(u=a)}return s<r.length&&"next"===o?e+n.substr(e.length):s<e.length&&"prev"===o?e.substr(0,n.length):u<0?null:e.substr(0,u)+r[u]+n.substr(u+1)}(i,p,u[g],a[g],s,c);null===m&&null===d?h=g+1:(null===d||0<s(d,m))&&(d=m)}return n(null!==d?function(){e.continue(d+l)}:r),!1})),e}function Rt(e,t,n,r){return{type:2,lower:e,upper:t,lowerOpen:n,upperOpen:r}}function It(e){return{type:1,lower:e,upper:e}}var Nt=(Object.defineProperty(Bt.prototype,"Collection",{get:function(){return this._ctx.table.db.Collection},enumerable:!1,configurable:!0}),Bt.prototype.between=function(e,t,n,r){n=!1!==n,r=!0===r;try{return 0<this._cmp(e,t)||0===this._cmp(e,t)&&(n||r)&&(!n||!r)?Dt(this):new this.Collection(this,(function(){return Rt(e,t,!n,!r)}))}catch(e){return Ct(this,Ze)}},Bt.prototype.equals=function(e){return null==e?Ct(this,Ze):new this.Collection(this,(function(){return It(e)}))},Bt.prototype.above=function(e){return null==e?Ct(this,Ze):new this.Collection(this,(function(){return Rt(e,void 0,!0)}))},Bt.prototype.aboveOrEqual=function(e){return null==e?Ct(this,Ze):new this.Collection(this,(function(){return Rt(e,void 0,!1)}))},Bt.prototype.below=function(e){return null==e?Ct(this,Ze):new this.Collection(this,(function(){return Rt(void 0,e,!1,!0)}))},Bt.prototype.belowOrEqual=function(e){return null==e?Ct(this,Ze):new this.Collection(this,(function(){return Rt(void 0,e)}))},Bt.prototype.startsWith=function(e){return"string"!=typeof e?Ct(this,et):this.between(e,e+Ye,!0,!0)},Bt.prototype.startsWithIgnoreCase=function(e){return""===e?this.startsWith(e):Ot(this,(function(e,t){return 0===e.indexOf(t[0])}),[e],Ye)},Bt.prototype.equalsIgnoreCase=function(e){return Ot(this,(function(e,t){return e===t[0]}),[e],"")},Bt.prototype.anyOfIgnoreCase=function(){var e=I.apply(R,arguments);return 0===e.length?Dt(this):Ot(this,(function(e,t){return-1!==t.indexOf(e)}),e,"")},Bt.prototype.startsWithAnyOfIgnoreCase=function(){var e=I.apply(R,arguments);return 0===e.length?Dt(this):Ot(this,(function(e,t){return t.some((function(t){return 0===e.indexOf(t)}))}),e,Ye)},Bt.prototype.anyOf=function(){var e=this,t=I.apply(R,arguments),n=this._cmp;try{t.sort(n)}catch(r){return Ct(this,Ze)}if(0===t.length)return Dt(this);var r=new this.Collection(this,(function(){return Rt(t[0],t[t.length-1])}));r._ondirectionchange=function(r){n="next"===r?e._ascending:e._descending,t.sort(n)};var i=0;return r._addAlgorithm((function(e,r,o){for(var s=e.key;0<n(s,t[i]);)if(++i===t.length)return r(o),!1;return 0===n(s,t[i])||(r((function(){e.continue(t[i])})),!1)})),r},Bt.prototype.notEqual=function(e){return this.inAnyRange([[-1/0,e],[e,this.db._maxKey]],{includeLowers:!1,includeUppers:!1})},Bt.prototype.noneOf=function(){var e=I.apply(R,arguments);if(0===e.length)return new this.Collection(this);try{e.sort(this._ascending)}catch(e){return Ct(this,Ze)}var t=e.reduce((function(e,t){return e?e.concat([[e[e.length-1][1],t]]):[[-1/0,t]]}),null);return t.push([e[e.length-1],this.db._maxKey]),this.inAnyRange(t,{includeLowers:!1,includeUppers:!1})},Bt.prototype.inAnyRange=function(e,t){var n=this,r=this._cmp,i=this._ascending,o=this._descending,s=this._min,u=this._max;if(0===e.length)return Dt(this);if(!e.every((function(e){return void 0!==e[0]&&void 0!==e[1]&&i(e[0],e[1])<=0})))return Ct(this,"First argument to inAnyRange() must be an Array of two-value Arrays [lower,upper] where upper must not be lower than lower",z.InvalidArgument);var a,c=!t||!1!==t.includeLowers,l=t&&!0===t.includeUppers,f=i;function p(e,t){return f(e[0],t[0])}try{(a=e.reduce((function(e,t){for(var n=0,i=e.length;n<i;++n){var o=e[n];if(r(t[0],o[1])<0&&0<r(t[1],o[0])){o[0]=s(o[0],t[0]),o[1]=u(o[1],t[1]);break}}return n===i&&e.push(t),e}),[])).sort(p)}catch(e){return Ct(this,Ze)}var h=0,d=l?function(e){return 0<i(e,a[h][1])}:function(e){return 0<=i(e,a[h][1])},g=c?function(e){return 0<o(e,a[h][0])}:function(e){return 0<=o(e,a[h][0])},m=d;return(e=new this.Collection(this,(function(){return Rt(a[0][0],a[a.length-1][1],!c,!l)})))._ondirectionchange=function(e){f="next"===e?(m=d,i):(m=g,o),a.sort(p)},e._addAlgorithm((function(e,t,r){for(var o,s=e.key;m(s);)if(++h===a.length)return t(r),!1;return!d(o=s)&&!g(o)||(0===n._cmp(s,a[h][1])||0===n._cmp(s,a[h][0])||t((function(){f===i?e.continue(a[h][0]):e.continue(a[h][1])})),!1)})),e},Bt.prototype.startsWithAnyOf=function(){var e=I.apply(R,arguments);return e.every((function(e){return"string"==typeof e}))?0===e.length?Dt(this):this.inAnyRange(e.map((function(e){return[e,e+Ye]}))):Ct(this,"startsWithAnyOf() only works with strings")},Bt);function Bt(){}function Mt(e){return Oe((function(t){return Kt(t),e(t.target.error),!1}))}function Kt(e){e.stopPropagation&&e.stopPropagation(),e.preventDefault&&e.preventDefault()}var Lt="storagemutated",Ft="x-storagemutated-1",Ht=vt(null,Lt),Wt=(Gt.prototype._lock=function(){return b(!ve.global),++this._reculock,1!==this._reculock||ve.global||(ve.lockOwnerFor=this),this},Gt.prototype._unlock=function(){if(b(!ve.global),0==--this._reculock)for(ve.global||(ve.lockOwnerFor=null);0<this._blockedFuncs.length&&!this._locked();){var e=this._blockedFuncs.shift();try{Ve(e[1],e[0])}catch(e){}}return this},Gt.prototype._locked=function(){return this._reculock&&ve.lockOwnerFor!==this},Gt.prototype.create=function(e){var t=this;if(!this.mode)return this;var n=this.db.idbdb,r=this.db._state.dbOpenError;if(b(!this.idbtrans),!e&&!n)switch(r&&r.name){case"DatabaseClosedError":throw new z.DatabaseClosed(r);case"MissingAPIError":throw new z.MissingAPI(r.message,r);default:throw new z.OpenFailed(r)}if(!this.active)throw new z.TransactionInactive;return b(null===this._completion._state),(e=this.idbtrans=e||(this.db.core||n).transaction(this.storeNames,this.mode,{durability:this.chromeTransactionDurability})).onerror=Oe((function(n){Kt(n),t._reject(e.error)})),e.onabort=Oe((function(n){Kt(n),t.active&&t._reject(new z.Abort(e.error)),t.active=!1,t.on("abort").fire(n)})),e.oncomplete=Oe((function(){t.active=!1,t._resolve(),"mutatedParts"in e&&Ht.storagemutated.fire(e.mutatedParts)})),this},Gt.prototype._promise=function(e,t,n){var r=this;if("readwrite"===e&&"readwrite"!==this.mode)return Je(new z.ReadOnly("Transaction is readonly"));if(!this.active)return Je(new z.TransactionInactive);if(this._locked())return new xe((function(i,o){r._blockedFuncs.push([function(){r._promise(e,t,n).then(i,o)},ve])}));if(n)return Le((function(){var e=new xe((function(e,n){r._lock();var i=t(e,n,r);i&&i.then&&i.then(e,n)}));return e.finally((function(){return r._unlock()})),e._lib=!0,e}));var i=new xe((function(e,n){var i=t(e,n,r);i&&i.then&&i.then(e,n)}));return i._lib=!0,i},Gt.prototype._root=function(){return this.parent?this.parent._root():this},Gt.prototype.waitFor=function(e){var t,n=this._root(),r=xe.resolve(e);n._waitingFor?n._waitingFor=n._waitingFor.then((function(){return r})):(n._waitingFor=r,n._waitingQueue=[],t=n.idbtrans.objectStore(n.storeNames[0]),function e(){for(++n._spinCount;n._waitingQueue.length;)n._waitingQueue.shift()();n._waitingFor&&(t.get(-1/0).onsuccess=e)}());var i=n._waitingFor;return new xe((function(e,t){r.then((function(t){return n._waitingQueue.push(Oe(e.bind(null,t)))}),(function(e){return n._waitingQueue.push(Oe(t.bind(null,e)))})).finally((function(){n._waitingFor===i&&(n._waitingFor=null)}))}))},Gt.prototype.abort=function(){this.active&&(this.active=!1,this.idbtrans&&this.idbtrans.abort(),this._reject(new z.Abort))},Gt.prototype.table=function(e){var t=this._memoizedTables||(this._memoizedTables={});if(l(t,e))return t[e];var n=this.schema[e];if(!n)throw new z.NotFound("Table "+e+" not part of transaction");return(n=new this.db.Table(e,n,this)).core=this.db.core.table(e),t[e]=n},Gt);function Gt(){}function zt(e,t,n,r,i,o,s,u){return{name:e,keyPath:t,unique:n,multi:r,auto:i,compound:o,src:(n&&!s?"&":"")+(r?"*":"")+(i?"++":"")+$t(t),type:u}}function $t(e){return"string"==typeof e?e:e?"["+[].join.call(e,"+")+"]":""}function Vt(e,t,n){return{name:e,primKey:t,indexes:n,mappedClass:null,idxByName:(r=function(e){return[e.name,e]},n.reduce((function(e,t,n){return(n=r(t,n))&&(e[n[0]]=n[1]),e}),{}))};var r}var Xt=function(e){try{return e.only([[]]),Xt=function(){return[[]]},[[]]}catch(e){return Xt=function(){return Ye},Ye}};function Qt(e){return null==e?function(){}:"string"==typeof e?1===(t=e).split(".").length?function(e){return e[t]}:function(e){return T(e,t)}:function(t){return T(t,e)};var t}function Jt(e){return[].slice.call(e)}var Yt=0;function Zt(e){return null==e?":id":"string"==typeof e?e:"[".concat(e.join("+"),"]")}function en(e,t,n){function r(e){if(3===e.type)return null;if(4===e.type)throw new Error("Cannot convert never type to IDBKeyRange");var n=e.lower,r=e.upper,i=e.lowerOpen;return e=e.upperOpen,void 0===n?void 0===r?null:t.upperBound(r,!!e):void 0===r?t.lowerBound(n,!!i):t.bound(n,r,!!i,!!e)}function i(e){var t,n=e.name;return{name:n,schema:e,mutate:function(e){var t=e.trans,i=e.type,o=e.keys,s=e.values,u=e.range;return new Promise((function(e,a){e=Oe(e);var c=t.objectStore(n),l=null==c.keyPath,f="put"===i||"add"===i;if(!f&&"delete"!==i&&"deleteRange"!==i)throw new Error("Invalid operation type: "+i);var p,h=(o||s||{length:1}).length;if(o&&s&&o.length!==s.length)throw new Error("Given keys array must have same length as given values array.");if(0===h)return e({numFailures:0,failures:{},results:[],lastResult:void 0});function d(e){++y,Kt(e)}var g=[],m=[],y=0;if("deleteRange"===i){if(4===u.type)return e({numFailures:y,failures:m,results:[],lastResult:void 0});3===u.type?g.push(p=c.clear()):g.push(p=c.delete(r(u)))}else{var v=(l=f?l?[s,o]:[s,null]:[o,null])[0],b=l[1];if(f)for(var w=0;w<h;++w)g.push(p=b&&void 0!==b[w]?c[i](v[w],b[w]):c[i](v[w])),p.onerror=d;else for(w=0;w<h;++w)g.push(p=c[i](v[w])),p.onerror=d}function T(t){t=t.target.result,g.forEach((function(e,t){return null!=e.error&&(m[t]=e.error)})),e({numFailures:y,failures:m,results:"delete"===i?o:g.map((function(e){return e.result})),lastResult:t})}p.onerror=function(e){d(e),T(e)},p.onsuccess=T}))},getMany:function(e){var t=e.trans,r=e.keys;return new Promise((function(e,i){e=Oe(e);for(var o,s=t.objectStore(n),u=r.length,a=new Array(u),c=0,l=0,f=function(t){t=t.target,a[t._pos]=t.result,++l===c&&e(a)},p=Mt(i),h=0;h<u;++h)null!=r[h]&&((o=s.get(r[h]))._pos=h,o.onsuccess=f,o.onerror=p,++c);0===c&&e(a)}))},get:function(e){var t=e.trans,r=e.key;return new Promise((function(e,i){e=Oe(e);var o=t.objectStore(n).get(r);o.onsuccess=function(t){return e(t.target.result)},o.onerror=Mt(i)}))},query:(t=l,function(e){return new Promise((function(i,o){i=Oe(i);var s,u,a,c=e.trans,l=e.values,f=e.limit,p=e.query,h=f===1/0?void 0:f,d=p.index;if(p=p.range,c=c.objectStore(n),d=d.isPrimaryKey?c:c.index(d.name),p=r(p),0===f)return i({result:[]});t?((h=l?d.getAll(p,h):d.getAllKeys(p,h)).onsuccess=function(e){return i({result:e.target.result})},h.onerror=Mt(o)):(s=0,u=!l&&"openKeyCursor"in d?d.openKeyCursor(p):d.openCursor(p),a=[],u.onsuccess=function(e){var t=u.result;return t?(a.push(l?t.value:t.primaryKey),++s===f?i({result:a}):void t.continue()):i({result:a})},u.onerror=Mt(o))}))}),openCursor:function(e){var t=e.trans,i=e.values,o=e.query,s=e.reverse,u=e.unique;return new Promise((function(e,a){e=Oe(e);var c=o.index,l=o.range,f=t.objectStore(n),p=(f=c.isPrimaryKey?f:f.index(c.name),c=s?u?"prevunique":"prev":u?"nextunique":"next",!i&&"openKeyCursor"in f?f.openKeyCursor(r(l),c):f.openCursor(r(l),c));p.onerror=Mt(a),p.onsuccess=Oe((function(n){var r,i,o,s,u=p.result;u?(u.___id=++Yt,u.done=!1,r=u.continue.bind(u),i=(i=u.continuePrimaryKey)&&i.bind(u),o=u.advance.bind(u),s=function(){throw new Error("Cursor not stopped")},u.trans=t,u.stop=u.continue=u.continuePrimaryKey=u.advance=function(){throw new Error("Cursor not started")},u.fail=Oe(a),u.next=function(){var e=this,t=1;return this.start((function(){return t--?e.continue():e.stop()})).then((function(){return e}))},u.start=function(e){function t(){if(p.result)try{e()}catch(e){u.fail(e)}else u.done=!0,u.start=function(){throw new Error("Cursor behind last entry")},u.stop()}var n=new Promise((function(e,t){e=Oe(e),p.onerror=Mt(t),u.fail=t,u.stop=function(t){u.stop=u.continue=u.continuePrimaryKey=u.advance=s,e(t)}}));return p.onsuccess=Oe((function(e){p.onsuccess=t,t()})),u.continue=r,u.continuePrimaryKey=i,u.advance=o,t(),n},e(u)):e(null)}),a)}))},count:function(e){var t=e.query,i=e.trans,o=t.index,s=t.range;return new Promise((function(e,t){var u=i.objectStore(n),a=o.isPrimaryKey?u:u.index(o.name);(a=(u=r(s))?a.count(u):a.count()).onsuccess=Oe((function(t){return e(t.target.result)})),a.onerror=Mt(t)}))}}}var o,u,a,c=(u=n,a=Jt((o=e).objectStoreNames),{schema:{name:o.name,tables:a.map((function(e){return u.objectStore(e)})).map((function(e){var t=e.keyPath,n=e.autoIncrement,r=s(t),i={};return n={name:e.name,primaryKey:{name:null,isPrimaryKey:!0,outbound:null==t,compound:r,keyPath:t,autoIncrement:n,unique:!0,extractKey:Qt(t)},indexes:Jt(e.indexNames).map((function(t){return e.index(t)})).map((function(e){var t=e.name,n=e.unique,r=e.multiEntry;return e=e.keyPath,r={name:t,compound:s(e),keyPath:e,unique:n,multiEntry:r,extractKey:Qt(e)},i[Zt(e)]=r})),getIndexByKeyPath:function(e){return i[Zt(e)]}},i[":id"]=n.primaryKey,null!=t&&(i[Zt(t)]=n.primaryKey),n}))},hasGetAll:0<a.length&&"getAll"in u.objectStore(a[0])&&!("undefined"!=typeof navigator&&/Safari/.test(navigator.userAgent)&&!/(Chrome\/|Edge\/)/.test(navigator.userAgent)&&[].concat(navigator.userAgent.match(/Safari\/(\d*)/))[1]<604)}),l=(n=c.schema,c.hasGetAll),f=(c=n.tables.map(i),{});return c.forEach((function(e){return f[e.name]=e})),{stack:"dbcore",transaction:e.transaction.bind(e),table:function(e){if(!f[e])throw new Error("Table '".concat(e,"' not found"));return f[e]},MIN_KEY:-1/0,MAX_KEY:Xt(t),schema:n}}function tn(e,n,r,i){var o=r.IDBKeyRange;return r.indexedDB,{dbcore:(i=en(n,o,i),e.dbcore.reduce((function(e,n){return n=n.create,t(t({},e),n(e))}),i))}}function nn(e,t){var n=t.db;t=tn(e._middlewares,n,e._deps,t),e.core=t.dbcore,e.tables.forEach((function(t){var n=t.name;e.core.schema.tables.some((function(e){return e.name===n}))&&(t.core=e.core.table(n),e[n]instanceof e.Table&&(e[n].core=t.core))}))}function rn(e,t,n,r){n.forEach((function(n){var i=r[n];t.forEach((function(t){var r=function e(t,n){return g(t,n)||(t=a(t))&&e(t,n)}(t,n);(!r||"value"in r&&void 0===r.value)&&(t===e.Transaction.prototype||t instanceof e.Transaction?h(t,n,{get:function(){return this.table(n)},set:function(e){p(this,n,{value:e,writable:!0,configurable:!0,enumerable:!0})}}):t[n]=new e.Table(n,i))}))}))}function on(e,t){t.forEach((function(t){for(var n in t)t[n]instanceof e.Table&&delete t[n]}))}function sn(e,t){return e._cfg.version-t._cfg.version}function un(e,t,n,r){var i=e._dbSchema;n.objectStoreNames.contains("$meta")&&!i.$meta&&(i.$meta=Vt("$meta",gn("")[0],[]),e._storeNames.push("$meta"));var s=e._createTransaction("readwrite",e._storeNames,i);s.create(n),s._completion.catch(r);var u=s._reject.bind(s),a=ve.transless||ve;Le((function(){return ve.trans=s,ve.transless=a,0!==t?(nn(e,n),c=t,((r=s).storeNames.includes("$meta")?r.table("$meta").get("version").then((function(e){return null!=e?e:c})):xe.resolve(c)).then((function(t){return i=t,u=s,a=n,c=[],t=(r=e)._versions,l=r._dbSchema=hn(0,r.idbdb,a),0!==(t=t.filter((function(e){return e._cfg.version>=i}))).length?(t.forEach((function(e){c.push((function(){var t=l,n=e._cfg.dbschema;dn(r,t,a),dn(r,n,a),l=r._dbSchema=n;var s=cn(t,n);s.add.forEach((function(e){ln(a,e[0],e[1].primKey,e[1].indexes)})),s.change.forEach((function(e){if(e.recreate)throw new z.Upgrade("Not yet support for changing primary key");var t=a.objectStore(e.name);e.add.forEach((function(e){return pn(t,e)})),e.change.forEach((function(e){t.deleteIndex(e.name),pn(t,e)})),e.del.forEach((function(e){return t.deleteIndex(e)}))}));var c=e._cfg.contentUpgrade;if(c&&e._cfg.version>i){nn(r,a),u._memoizedTables={};var f=A(n);s.del.forEach((function(e){f[e]=t[e]})),on(r,[r.Transaction.prototype]),rn(r,[r.Transaction.prototype],o(f),f),u.schema=f;var p,h=N(c);return h&&Fe(),s=xe.follow((function(){var e;(p=c(u))&&h&&(e=He.bind(null,null),p.then(e,e))})),p&&"function"==typeof p.then?xe.resolve(p):s.then((function(){return p}))}})),c.push((function(t){var n,i,o=e._cfg.dbschema;n=o,i=t,[].slice.call(i.db.objectStoreNames).forEach((function(e){return null==n[e]&&i.db.deleteObjectStore(e)})),on(r,[r.Transaction.prototype]),rn(r,[r.Transaction.prototype],r._storeNames,r._dbSchema),u.schema=r._dbSchema})),c.push((function(t){r.idbdb.objectStoreNames.contains("$meta")&&(Math.ceil(r.idbdb.version/10)===e._cfg.version?(r.idbdb.deleteObjectStore("$meta"),delete r._dbSchema.$meta,r._storeNames=r._storeNames.filter((function(e){return"$meta"!==e}))):t.objectStore("$meta").put(e._cfg.version,"version"))}))})),function e(){return c.length?xe.resolve(c.shift()(u.idbtrans)).then(e):xe.resolve()}().then((function(){fn(l,a)}))):xe.resolve();var r,i,u,a,c,l})).catch(u)):(o(i).forEach((function(e){ln(n,e,i[e].primKey,i[e].indexes)})),nn(e,n),void xe.follow((function(){return e.on.populate.fire(s)})).catch(u));var r,c}))}function an(e,t){fn(e._dbSchema,t),t.db.version%10!=0||t.objectStoreNames.contains("$meta")||t.db.createObjectStore("$meta").add(Math.ceil(t.db.version/10-1),"version");var n=hn(0,e.idbdb,t);dn(e,e._dbSchema,t);for(var r=0,i=cn(n,e._dbSchema).change;r<i.length;r++){var o=function(e){if(e.change.length||e.recreate)return console.warn("Unable to patch indexes of table ".concat(e.name," because it has changes on the type of index or primary key.")),{value:void 0};var n=t.objectStore(e.name);e.add.forEach((function(t){ie&&console.debug("Dexie upgrade patch: Creating missing index ".concat(e.name,".").concat(t.src)),pn(n,t)}))}(i[r]);if("object"==typeof o)return o.value}}function cn(e,t){var n,r={del:[],add:[],change:[]};for(n in e)t[n]||r.del.push(n);for(n in t){var i=e[n],o=t[n];if(i){var s={name:n,def:o,recreate:!1,del:[],add:[],change:[]};if(""+(i.primKey.keyPath||"")!=""+(o.primKey.keyPath||"")||i.primKey.auto!==o.primKey.auto)s.recreate=!0,r.change.push(s);else{var u=i.idxByName,a=o.idxByName,c=void 0;for(c in u)a[c]||s.del.push(c);for(c in a){var l=u[c],f=a[c];l?l.src!==f.src&&s.change.push(f):s.add.push(f)}(0<s.del.length||0<s.add.length||0<s.change.length)&&r.change.push(s)}}else r.add.push([n,o])}return r}function ln(e,t,n,r){var i=e.db.createObjectStore(t,n.keyPath?{keyPath:n.keyPath,autoIncrement:n.auto}:{autoIncrement:n.auto});return r.forEach((function(e){return pn(i,e)})),i}function fn(e,t){o(e).forEach((function(n){t.db.objectStoreNames.contains(n)||(ie&&console.debug("Dexie: Creating missing table",n),ln(t,n,e[n].primKey,e[n].indexes))}))}function pn(e,t){e.createIndex(t.name,t.keyPath,{unique:t.unique,multiEntry:t.multi})}function hn(e,t,n){var r={};return y(t.objectStoreNames,0).forEach((function(e){for(var t=n.objectStore(e),i=zt($t(u=t.keyPath),u||"",!0,!1,!!t.autoIncrement,u&&"string"!=typeof u,!0),o=[],s=0;s<t.indexNames.length;++s){var u=(a=t.index(t.indexNames[s])).keyPath,a=zt(a.name,u,!!a.unique,!!a.multiEntry,!1,u&&"string"!=typeof u,!1);o.push(a)}r[e]=Vt(e,i,o)})),r}function dn(e,t,n){for(var r=n.db.objectStoreNames,o=0;o<r.length;++o){var s=r[o],u=n.objectStore(s);e._hasGetAll="getAll"in u;for(var a=0;a<u.indexNames.length;++a){var c=u.indexNames[a],l=u.index(c).keyPath,f="string"==typeof l?l:"["+y(l).join("+")+"]";!t[s]||(l=t[s].idxByName[f])&&(l.name=c,delete t[s].idxByName[f],t[s].idxByName[c]=l)}}"undefined"!=typeof navigator&&/Safari/.test(navigator.userAgent)&&!/(Chrome\/|Edge\/)/.test(navigator.userAgent)&&i.WorkerGlobalScope&&i instanceof i.WorkerGlobalScope&&[].concat(navigator.userAgent.match(/Safari\/(\d*)/))[1]<604&&(e._hasGetAll=!1)}function gn(e){return e.split(",").map((function(e,t){var n=null===(r=(i=e.split(":"))[1])||void 0===r?void 0:r.trim(),r=(e=i[0].trim()).replace(/([&*]|\+\+)/g,""),i=/^\[/.test(r)?r.match(/^\[(.*)\]$/)[1].split("+"):r;return zt(r,i||null,/\&/.test(e),/\*/.test(e),/\+\+/.test(e),s(i),0===t,n)}))}var mn=(yn.prototype._createTableSchema=Vt,yn.prototype._parseIndexSyntax=gn,yn.prototype._parseStoresSpec=function(e,t){var n=this;o(e).forEach((function(r){if(null!==e[r]){var i=n._parseIndexSyntax(e[r]),o=i.shift();if(!o)throw new z.Schema("Invalid schema for table "+r+": "+e[r]);if(o.unique=!0,o.multi)throw new z.Schema("Primary key cannot be multiEntry*");i.forEach((function(e){if(e.auto)throw new z.Schema("Only primary key can be marked as autoIncrement (++)");if(!e.keyPath)throw new z.Schema("Index must have a name and cannot be an empty string")})),i=n._createTableSchema(r,o,i),t[r]=i}}))},yn.prototype.stores=function(e){var t=this.db;this._cfg.storesSource=this._cfg.storesSource?u(this._cfg.storesSource,e):e,e=t._versions;var n={},r={};return e.forEach((function(e){u(n,e._cfg.storesSource),r=e._cfg.dbschema={},e._parseStoresSpec(n,r)})),t._dbSchema=r,on(t,[t._allTables,t,t.Transaction.prototype]),rn(t,[t._allTables,t,t.Transaction.prototype,this._cfg.tables],o(r),r),t._storeNames=o(r),this},yn.prototype.upgrade=function(e){return this._cfg.contentUpgrade=re(this._cfg.contentUpgrade||X,e),this},yn);function yn(){}function vn(e,t){var n=e._dbNamesDB;return n||(n=e._dbNamesDB=new rr(nt,{addons:[],indexedDB:e,IDBKeyRange:t})).version(1).stores({dbnames:"name"}),n.table("dbnames")}function bn(e){return e&&"function"==typeof e.databases}function wn(e){return Le((function(){return ve.letThrough=!0,e()}))}function Tn(e){return!("from"in e)}var xn=function(e,t){if(!this){var n=new xn;return e&&"d"in e&&u(n,e),n}u(this,arguments.length?{d:1,from:e,to:1<arguments.length?t:e}:{d:0})};function An(e,t,n){var r=ct(t,n);if(!isNaN(r)){if(0<r)throw RangeError();if(Tn(e))return u(e,{from:t,to:n,d:1});var i=e.l;if(r=e.r,ct(n,e.from)<0)return i?An(i,t,n):e.l={from:t,to:n,d:1,l:null,r:null},jn(e);if(0<ct(t,e.to))return r?An(r,t,n):e.r={from:t,to:n,d:1,l:null,r:null},jn(e);ct(t,e.from)<0&&(e.from=t,e.l=null,e.d=r?r.d+1:1),0<ct(n,e.to)&&(e.to=n,e.r=null,e.d=e.l?e.l.d+1:1),n=!e.r,i&&!e.l&&qn(e,i),r&&n&&qn(e,r)}}function qn(e,t){Tn(t)||function e(t,n){var r=n.from,i=n.to,o=n.l;n=n.r,An(t,r,i),o&&e(t,o),n&&e(t,n)}(e,t)}function kn(e,t){var n=_n(t),r=n.next();if(r.done)return!1;for(var i=r.value,o=_n(e),s=o.next(i.from),u=s.value;!r.done&&!s.done;){if(ct(u.from,i.to)<=0&&0<=ct(u.to,i.from))return!0;ct(i.from,u.from)<0?i=(r=n.next(u.from)).value:u=(s=o.next(i.from)).value}return!1}function _n(e){var t=Tn(e)?null:{s:0,n:e};return{next:function(e){for(var n=0<arguments.length;t;)switch(t.s){case 0:if(t.s=1,n)for(;t.n.l&&ct(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,!n||ct(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 jn(e){var n,r,i=((null===(n=e.r)||void 0===n?void 0:n.d)||0)-((null===(r=e.l)||void 0===r?void 0:r.d)||0),o=1<i?"r":i<-1?"l":"";o&&(n="r"==o?"l":"r",r=t({},e),i=e[o],e.from=i.from,e.to=i.to,e[o]=i[o],r[o]=i[n],(e[n]=r).d=Un(r)),e.d=Un(e)}function Un(e){var t=e.r;return e=e.l,(t?e?Math.max(t.d,e.d):t.d:e?e.d:0)+1}function Sn(e,t){return o(t).forEach((function(n){e[n]?qn(e[n],t[n]):e[n]=function e(t){var n,r,i={};for(n in t)l(t,n)&&(r=t[n],i[n]=!r||"object"!=typeof r||j.has(r.constructor)?r:e(r));return i}(t[n])})),e}function Pn(e,t){return e.all||t.all||Object.keys(e).some((function(n){return t[n]&&kn(t[n],e[n])}))}f(xn.prototype,((B={add:function(e){return qn(this,e),this},addKey:function(e){return An(this,e,e),this},addKeys:function(e){var t=this;return e.forEach((function(e){return An(t,e,e)})),this},hasKey:function(e){var t=_n(this).next(e).value;return t&&ct(t.from,e)<=0&&0<=ct(t.to,e)}})[C]=function(){return _n(this)},B));var En={},Cn={},Dn=!1;function On(e){Sn(Cn,e),Dn||(Dn=!0,setTimeout((function(){Dn=!1,Rn(Cn,!(Cn={}))}),0))}function Rn(e,t){void 0===t&&(t=!1);var n=new Set;if(e.all)for(var r=0,i=Object.values(En);r<i.length;r++)In(s=i[r],e,n,t);else for(var o in e){var s,u=/^idb\:\/\/(.*)\/(.*)\//.exec(o);u&&(o=u[1],u=u[2],(s=En["idb://".concat(o,"/").concat(u)])&&In(s,e,n,t))}n.forEach((function(e){return e()}))}function In(e,t,n,r){for(var i=[],o=0,s=Object.entries(e.queries.query);o<s.length;o++){for(var u=s[o],a=u[0],c=[],l=0,f=u[1];l<f.length;l++){var p=f[l];Pn(t,p.obsSet)?p.subscribers.forEach((function(e){return n.add(e)})):r&&c.push(p)}r&&i.push([a,c])}if(r)for(var h=0,d=i;h<d.length;h++){var g=d[h];a=g[0],c=g[1],e.queries.query[a]=c}}function Nn(e){var t=e._state,n=e._deps.indexedDB;if(t.isBeingOpened||e.idbdb)return t.dbReadyPromise.then((function(){return t.dbOpenError?Je(t.dbOpenError):e}));t.isBeingOpened=!0,t.dbOpenError=null,t.openComplete=!1;var r=t.openCanceller,i=Math.round(10*e.verno),s=!1;function u(){if(t.openCanceller!==r)throw new z.DatabaseClosed("db.open() was cancelled")}function a(){return new xe((function(r,c){if(u(),!n)throw new z.MissingAPI;var l=e.name,h=t.autoSchema||!i?n.open(l):n.open(l,i);if(!h)throw new z.MissingAPI;h.onerror=Mt(c),h.onblocked=Oe(e._fireOnBlocked),h.onupgradeneeded=Oe((function(r){var i;f=h.transaction,t.autoSchema&&!e._options.allowEmptyDB?(h.onerror=Kt,f.abort(),h.result.close(),(i=n.deleteDatabase(l)).onsuccess=i.onerror=Oe((function(){c(new z.NoSuchDatabase("Database ".concat(l," doesnt exist")))}))):(f.onerror=Mt(c),r=r.oldVersion>Math.pow(2,62)?0:r.oldVersion,p=r<1,e.idbdb=h.result,s&&an(e,f),un(e,r/10,f,c))}),c),h.onsuccess=Oe((function(){f=null;var n,u,c,d,g,m=e.idbdb=h.result,v=y(m.objectStoreNames);if(0<v.length)try{var b=m.transaction(1===(d=v).length?d[0]:d,"readonly");if(t.autoSchema)u=m,c=b,(n=e).verno=u.version/10,c=n._dbSchema=hn(0,u,c),n._storeNames=y(u.objectStoreNames,0),rn(n,[n._allTables],o(c),c);else if(dn(e,e._dbSchema,b),((g=cn(hn(0,(g=e).idbdb,b),g._dbSchema)).add.length||g.change.some((function(e){return e.add.length||e.change.length})))&&!s)return console.warn("Dexie SchemaDiff: Schema was extended without increasing the number passed to db.version(). Dexie will add missing parts and increment native version number to workaround this."),m.close(),i=m.version+1,s=!0,r(a());nn(e,b)}catch(n){}tt.push(e),m.onversionchange=Oe((function(n){t.vcFired=!0,e.on("versionchange").fire(n)})),m.onclose=Oe((function(){e.close({disableAutoOpen:!1})})),p&&(g=e._deps,b=l,m=g.indexedDB,g=g.IDBKeyRange,bn(m)||b===nt||vn(m,g).put({name:b}).catch(X)),r()}),c)})).catch((function(e){switch(null==e?void 0:e.name){case"UnknownError":if(0<t.PR1398_maxLoop)return t.PR1398_maxLoop--,console.warn("Dexie: Workaround for Chrome UnknownError on open()"),a();break;case"VersionError":if(0<i)return i=0,a()}return xe.reject(e)}))}var c,l=t.dbReadyResolve,f=null,p=!1;return xe.race([r,("undefined"==typeof navigator?xe.resolve():!navigator.userAgentData&&/Safari\//.test(navigator.userAgent)&&!/Chrom(e|ium)\//.test(navigator.userAgent)&&indexedDB.databases?new Promise((function(e){function t(){return indexedDB.databases().finally(e)}c=setInterval(t,100),t()})).finally((function(){return clearInterval(c)})):Promise.resolve()).then(a)]).then((function(){return u(),t.onReadyBeingFired=[],xe.resolve(wn((function(){return e.on.ready.fire(e.vip)}))).then((function n(){if(0<t.onReadyBeingFired.length){var r=t.onReadyBeingFired.reduce(re,X);return t.onReadyBeingFired=[],xe.resolve(wn((function(){return r(e.vip)}))).then(n)}}))})).finally((function(){t.openCanceller===r&&(t.onReadyBeingFired=null,t.isBeingOpened=!1)})).catch((function(n){t.dbOpenError=n;try{f&&f.abort()}catch(n){}return r===t.openCanceller&&e._close(),Je(n)})).finally((function(){t.openComplete=!0,l()})).then((function(){var t;return p&&(t={},e.tables.forEach((function(n){n.schema.indexes.forEach((function(r){r.name&&(t["idb://".concat(e.name,"/").concat(n.name,"/").concat(r.name)]=new xn(-1/0,[[[]]]))})),t["idb://".concat(e.name,"/").concat(n.name,"/")]=t["idb://".concat(e.name,"/").concat(n.name,"/:dels")]=new xn(-1/0,[[[]]])})),Ht(Lt).fire(t),Rn(t,!0)),e}))}function Bn(e){function t(t){return e.next(t)}var n=i(t),r=i((function(t){return e.throw(t)}));function i(e){return function(t){var i=e(t);return t=i.value,i.done?t:t&&"function"==typeof t.then?t.then(n,r):s(t)?Promise.all(t).then(n,r):n(t)}}return i(t)()}function Mn(e,t,n){for(var r=s(e)?e.slice():[e],i=0;i<n;++i)r.push(t);return r}var Kn={stack:"dbcore",name:"VirtualIndexMiddleware",level:1,create:function(e){return t(t({},e),{table:function(n){var r=e.table(n),i=r.schema,o={},s=[];function u(e,n,r){var i=Zt(e),a=o[i]=o[i]||[],c=null==e?0:"string"==typeof e?1:e.length,l=0<n;return l=t(t({},r),{name:l?"".concat(i,"(virtual-from:").concat(r.name,")"):r.name,lowLevelIndex:r,isVirtual:l,keyTail:n,keyLength:c,extractKey:Qt(e),unique:!l&&r.unique}),a.push(l),l.isPrimaryKey||s.push(l),1<c&&u(2===c?e[0]:e.slice(0,c-1),n+1,r),a.sort((function(e,t){return e.keyTail-t.keyTail})),l}n=u(i.primaryKey.keyPath,0,i.primaryKey),o[":id"]=[n];for(var a=0,c=i.indexes;a<c.length;a++){var l=c[a];u(l.keyPath,0,l)}function f(n){var r,i=n.query.index;return i.isVirtual?t(t({},n),{query:{index:i.lowLevelIndex,range:(r=n.query.range,i=i.keyTail,{type:1===r.type?2:r.type,lower:Mn(r.lower,r.lowerOpen?e.MAX_KEY:e.MIN_KEY,i),lowerOpen:!0,upper:Mn(r.upper,r.upperOpen?e.MIN_KEY:e.MAX_KEY,i),upperOpen:!0})}}):n}return t(t({},r),{schema:t(t({},i),{primaryKey:n,indexes:s,getIndexByKeyPath:function(e){return(e=o[Zt(e)])&&e[0]}}),count:function(e){return r.count(f(e))},query:function(e){return r.query(f(e))},openCursor:function(t){var n=t.query.index,i=n.keyTail,o=n.isVirtual,s=n.keyLength;return o?r.openCursor(f(t)).then((function(e){return e&&u(e)})):r.openCursor(t);function u(n){return Object.create(n,{continue:{value:function(r){null!=r?n.continue(Mn(r,t.reverse?e.MAX_KEY:e.MIN_KEY,i)):t.unique?n.continue(n.key.slice(0,s).concat(t.reverse?e.MIN_KEY:e.MAX_KEY,i)):n.continue()}},continuePrimaryKey:{value:function(t,r){n.continuePrimaryKey(Mn(t,e.MAX_KEY,i),r)}},primaryKey:{get:function(){return n.primaryKey}},key:{get:function(){var e=n.key;return 1===s?e[0]:e.slice(0,s)}},value:{get:function(){return n.value}}})}}})}})}};function Ln(e,t,n,r){return n=n||{},r=r||"",o(e).forEach((function(i){var o,s,u;l(t,i)?(o=e[i],s=t[i],"object"==typeof o&&"object"==typeof s&&o&&s?(u=E(o))!==E(s)?n[r+i]=t[i]:"Object"===u?Ln(o,s,n,r+i+"."):o!==s&&(n[r+i]=t[i]):o!==s&&(n[r+i]=t[i])):n[r+i]=void 0})),o(t).forEach((function(i){l(e,i)||(n[r+i]=t[i])})),n}function Fn(e,t){return"delete"===t.type?t.keys:t.keys||t.values.map(e.extractKey)}var Hn={stack:"dbcore",name:"HooksMiddleware",level:2,create:function(e){return t(t({},e),{table:function(n){var i=e.table(n),o=i.schema.primaryKey;return t(t({},i),{mutate:function(e){var s=ve.trans,u=s.table(n).hook,a=u.deleting,c=u.creating,f=u.updating;switch(e.type){case"add":if(c.fire===X)break;return s._promise("readwrite",(function(){return p(e)}),!0);case"put":if(c.fire===X&&f.fire===X)break;return s._promise("readwrite",(function(){return p(e)}),!0);case"delete":if(a.fire===X)break;return s._promise("readwrite",(function(){return p(e)}),!0);case"deleteRange":if(a.fire===X)break;return s._promise("readwrite",(function(){return function e(n,r,s){return i.query({trans:n,values:!1,query:{index:o,range:r},limit:s}).then((function(i){var o=i.result;return p({type:"delete",keys:o,trans:n}).then((function(i){return 0<i.numFailures?Promise.reject(i.failures[0]):o.length<s?{failures:[],numFailures:0,lastResult:void 0}:e(n,t(t({},r),{lower:o[o.length-1],lowerOpen:!0}),s)}))}))}(e.trans,e.range,1e4)}),!0)}return i.mutate(e);function p(e){var n,s,u,p=ve.trans,h=e.keys||Fn(o,e);if(!h)throw new Error("Keys missing");return"delete"!==(e="add"===e.type||"put"===e.type?t(t({},e),{keys:h}):t({},e)).type&&(e.values=r([],e.values,!0)),e.keys&&(e.keys=r([],e.keys,!0)),n=i,u=h,("add"===(s=e).type?Promise.resolve([]):n.getMany({trans:s.trans,keys:u,cache:"immutable"})).then((function(t){var n=h.map((function(n,r){var i,s,u,h=t[r],d={onerror:null,onsuccess:null};return"delete"===e.type?a.fire.call(d,n,h,p):"add"===e.type||void 0===h?(i=c.fire.call(d,n,e.values[r],p),null==n&&null!=i&&(e.keys[r]=n=i,o.outbound||x(e.values[r],o.keyPath,n))):(i=Ln(h,e.values[r]),(s=f.fire.call(d,i,n,h,p))&&(u=e.values[r],Object.keys(s).forEach((function(e){l(u,e)?u[e]=s[e]:x(u,e,s[e])})))),d}));return i.mutate(e).then((function(r){for(var i=r.failures,o=r.results,s=r.numFailures,u=(r=r.lastResult,0);u<h.length;++u){var a=(o||h)[u],c=n[u];null==a?c.onerror&&c.onerror(i[u]):c.onsuccess&&c.onsuccess("put"===e.type&&t[u]?e.values[u]:a)}return{failures:i,results:o,numFailures:s,lastResult:r}})).catch((function(e){return n.forEach((function(t){return t.onerror&&t.onerror(e)})),Promise.reject(e)}))}))}}})}})}};function Wn(e,t,n){try{if(!t)return null;if(t.keys.length<e.length)return null;for(var r=[],i=0,o=0;i<t.keys.length&&o<e.length;++i)0===ct(t.keys[i],e[o])&&(r.push(n?S(t.values[i]):t.values[i]),++o);return r.length===e.length?r:null}catch(e){return null}}var Gn={stack:"dbcore",level:-1,create:function(e){return{table:function(n){var r=e.table(n);return t(t({},r),{getMany:function(e){if(!e.cache)return r.getMany(e);var t=Wn(e.keys,e.trans._cache,"clone"===e.cache);return t?xe.resolve(t):r.getMany(e).then((function(t){return e.trans._cache={keys:e.keys,values:"clone"===e.cache?S(t):t},t}))},mutate:function(e){return"add"!==e.type&&(e.trans._cache=null),r.mutate(e)}})}}}};function zn(e,t){return"readonly"===e.trans.mode&&!!e.subscr&&!e.trans.explicit&&"disabled"!==e.trans.db._options.cache&&!t.schema.primaryKey.outbound}function $n(e,t){switch(e){case"query":return t.values&&!t.unique;case"get":case"getMany":case"count":case"openCursor":return!1}}var Vn={stack:"dbcore",level:0,name:"Observability",create:function(e){var n=e.schema.name,r=new xn(e.MIN_KEY,e.MAX_KEY);return t(t({},e),{transaction:function(t,n,r){if(ve.subscr&&"readonly"!==n)throw new z.ReadOnly("Readwrite transaction in liveQuery context. Querier source: ".concat(ve.querier));return e.transaction(t,n,r)},table:function(i){var u=e.table(i),a=u.schema,c=a.primaryKey,l=a.indexes,f=c.extractKey,p=c.outbound,h=c.autoIncrement&&l.filter((function(e){return e.compound&&e.keyPath.includes(c.keyPath)})),d=t(t({},u),{mutate:function(t){function o(e){return e="idb://".concat(n,"/").concat(i,"/").concat(e),g[e]||(g[e]=new xn)}var l,f,p,d=t.trans,g=t.mutatedParts||(t.mutatedParts={}),m=o(""),y=o(":dels"),v=t.type,b="deleteRange"===t.type?[t.range]:"delete"===t.type?[t.keys]:t.values.length<50?[Fn(c,t).filter((function(e){return e})),t.values]:[],w=b[0],T=b[1];return b=t.trans._cache,s(w)?(m.addKeys(w),(b="delete"===v||w.length===T.length?Wn(w,b):null)||y.addKeys(w),(b||T)&&(l=o,f=b,p=T,a.indexes.forEach((function(e){var t=l(e.name||"");function n(t){return null!=t?e.extractKey(t):null}function r(n){return e.multiEntry&&s(n)?n.forEach((function(e){return t.addKey(e)})):t.addKey(n)}(f||p).forEach((function(e,t){var i=f&&n(f[t]);0!==ct(i,t=p&&n(p[t]))&&(null!=i&&r(i),null!=t&&r(t))}))})))):w?(T={from:null!==(T=w.lower)&&void 0!==T?T:e.MIN_KEY,to:null!==(T=w.upper)&&void 0!==T?T:e.MAX_KEY},y.add(T),m.add(T)):(m.add(r),y.add(r),a.indexes.forEach((function(e){return o(e.name).add(r)}))),u.mutate(t).then((function(e){return!w||"add"!==t.type&&"put"!==t.type||(m.addKeys(e.results),h&&h.forEach((function(n){for(var r=t.values.map((function(e){return n.extractKey(e)})),i=n.keyPath.findIndex((function(e){return e===c.keyPath})),s=0,u=e.results.length;s<u;++s)r[s][i]=e.results[s];o(n.name).addKeys(r)}))),d.mutatedParts=Sn(d.mutatedParts||{},g),e}))}}),g=(l=function(t){t=(n=t.query).index;var n=n.range;return[t,new xn(null!==(t=n.lower)&&void 0!==t?t:e.MIN_KEY,null!==(n=n.upper)&&void 0!==n?n:e.MAX_KEY)]},{get:function(e){return[c,new xn(e.key)]},getMany:function(e){return[c,(new xn).addKeys(e.keys)]},count:l,query:l,openCursor:l});return o(g).forEach((function(e){d[e]=function(o){var s=!!(d=ve.subscr),a=zn(ve,u)&&$n(e,o)?o.obsSet={}:d;if(s){var c=function(e){return e="idb://".concat(n,"/").concat(i,"/").concat(e),a[e]||(a[e]=new xn)},l=c(""),h=c(":dels"),d=(s=(d=g[e](o))[0],d[1]);if(("query"===e&&s.isPrimaryKey&&!o.values?h:c(s.name||"")).add(d),!s.isPrimaryKey){if("count"!==e){var m="query"===e&&p&&o.values&&u.query(t(t({},o),{values:!1}));return u[e].apply(this,arguments).then((function(t){if("query"===e){if(p&&o.values)return m.then((function(e){return e=e.result,l.addKeys(e),t}));var n=o.values?t.result.map(f):t.result;(o.values?l:h).addKeys(n)}else if("openCursor"===e){var r=t,i=o.values;return r&&Object.create(r,{key:{get:function(){return h.addKey(r.primaryKey),r.key}},primaryKey:{get:function(){var e=r.primaryKey;return h.addKey(e),e}},value:{get:function(){return i&&l.addKey(r.primaryKey),r.value}}})}return t}))}h.add(r)}}return u[e].apply(this,arguments)}})),d}})}};function Xn(e,n,r){if(0===r.numFailures)return n;if("deleteRange"===n.type)return null;var i=n.keys?n.keys.length:"values"in n&&n.values?n.values.length:1;return r.numFailures===i?null:(n=t({},n),s(n.keys)&&(n.keys=n.keys.filter((function(e,t){return!(t in r.failures)}))),"values"in n&&s(n.values)&&(n.values=n.values.filter((function(e,t){return!(t in r.failures)}))),n)}function Qn(e,t){return n=e,(void 0===(r=t).lower||(r.lowerOpen?0<ct(n,r.lower):0<=ct(n,r.lower)))&&(void 0===t.upper||(t.upperOpen?ct(e,t.upper)<0:ct(e,t.upper)<=0));var n,r}function Jn(e,t,n,r,i,o){if(!n||0===n.length)return e;var u=t.query.index,a=u.multiEntry,c=t.query.range,l=r.schema.primaryKey.extractKey,f=u.extractKey,p=(u.lowLevelIndex||u).extractKey;return n=n.reduce((function(e,n){var r=e,i=[];if("add"===n.type||"put"===n.type)for(var o=new xn,u=n.values.length-1;0<=u;--u){var p,h=n.values[u],d=l(h);o.hasKey(d)||(p=f(h),(a&&s(p)?p.some((function(e){return Qn(e,c)})):Qn(p,c))&&(o.addKey(d),i.push(h)))}switch(n.type){case"add":var g=(new xn).addKeys(t.values?e.map((function(e){return l(e)})):e);r=e.concat(t.values?i.filter((function(e){return e=l(e),!g.hasKey(e)&&(g.addKey(e),!0)})):i.map((function(e){return l(e)})).filter((function(e){return!g.hasKey(e)&&(g.addKey(e),!0)})));break;case"put":var m=(new xn).addKeys(n.values.map((function(e){return l(e)})));r=e.filter((function(e){return!m.hasKey(t.values?l(e):e)})).concat(t.values?i:i.map((function(e){return l(e)})));break;case"delete":var y=(new xn).addKeys(n.keys);r=e.filter((function(e){return!y.hasKey(t.values?l(e):e)}));break;case"deleteRange":var v=n.range;r=e.filter((function(e){return!Qn(l(e),v)}))}return r}),e),n===e?e:(n.sort((function(e,t){return ct(p(e),p(t))||ct(l(e),l(t))})),t.limit&&t.limit<1/0&&(n.length>t.limit?n.length=t.limit:e.length===t.limit&&n.length<t.limit&&(i.dirty=!0)),o?Object.freeze(n):n)}function Yn(e,t){return 0===ct(e.lower,t.lower)&&0===ct(e.upper,t.upper)&&!!e.lowerOpen==!!t.lowerOpen&&!!e.upperOpen==!!t.upperOpen}function Zn(e,t){return function(e,t,n,r){if(void 0===e)return void 0!==t?-1:0;if(void 0===t)return 1;if(0===(t=ct(e,t))){if(n&&r)return 0;if(n)return 1;if(r)return-1}return t}(e.lower,t.lower,e.lowerOpen,t.lowerOpen)<=0&&0<=function(e,t,n,r){if(void 0===e)return void 0!==t?1:0;if(void 0===t)return-1;if(0===(t=ct(e,t))){if(n&&r)return 0;if(n)return-1;if(r)return 1}return t}(e.upper,t.upper,e.upperOpen,t.upperOpen)}function er(e,t,n,r){e.subscribers.add(n),r.addEventListener("abort",(function(){var r,i;e.subscribers.delete(n),0===e.subscribers.size&&(r=e,i=t,setTimeout((function(){0===r.subscribers.size&&O(i,r)}),3e3))}))}var tr={stack:"dbcore",level:0,name:"Cache",create:function(e){var n=e.schema.name;return t(t({},e),{transaction:function(t,r,i){var o,s,u=e.transaction(t,r,i);return"readwrite"===r&&(s=(o=new AbortController).signal,i=function(i){return function(){if(o.abort(),"readwrite"===r){for(var s=new Set,a=0,c=t;a<c.length;a++){var l=c[a],f=En["idb://".concat(n,"/").concat(l)];if(f){var p=e.table(l),h=f.optimisticOps.filter((function(e){return e.trans===u}));if(u._explicit&&i&&u.mutatedParts)for(var d=0,g=Object.values(f.queries.query);d<g.length;d++)for(var m=0,y=(w=g[d]).slice();m<y.length;m++)Pn((T=y[m]).obsSet,u.mutatedParts)&&(O(w,T),T.subscribers.forEach((function(e){return s.add(e)})));else if(0<h.length){f.optimisticOps=f.optimisticOps.filter((function(e){return e.trans!==u}));for(var v=0,b=Object.values(f.queries.query);v<b.length;v++)for(var w,T,x,A=0,q=(w=b[v]).slice();A<q.length;A++)null!=(T=q[A]).res&&u.mutatedParts&&(i&&!T.dirty?(x=Object.isFrozen(T.res),x=Jn(T.res,T.req,h,p,T,x),T.dirty?(O(w,T),T.subscribers.forEach((function(e){return s.add(e)}))):x!==T.res&&(T.res=x,T.promise=xe.resolve({result:x}))):(T.dirty&&O(w,T),T.subscribers.forEach((function(e){return s.add(e)}))))}}}s.forEach((function(e){return e()}))}}},u.addEventListener("abort",i(!1),{signal:s}),u.addEventListener("error",i(!1),{signal:s}),u.addEventListener("complete",i(!0),{signal:s})),u},table:function(r){var i=e.table(r),o=i.schema.primaryKey;return t(t({},i),{mutate:function(e){var s=ve.trans;if(o.outbound||"disabled"===s.db._options.cache||s.explicit||"readwrite"!==s.idbtrans.mode)return i.mutate(e);var u=En["idb://".concat(n,"/").concat(r)];return u?(s=i.mutate(e),"add"!==e.type&&"put"!==e.type||!(50<=e.values.length||Fn(o,e).some((function(e){return null==e})))?(u.optimisticOps.push(e),e.mutatedParts&&On(e.mutatedParts),s.then((function(t){0<t.numFailures&&(O(u.optimisticOps,e),(t=Xn(0,e,t))&&u.optimisticOps.push(t),e.mutatedParts&&On(e.mutatedParts))})),s.catch((function(){O(u.optimisticOps,e),e.mutatedParts&&On(e.mutatedParts)}))):s.then((function(n){var r=Xn(0,t(t({},e),{values:e.values.map((function(e,r){var i;return n.failures[r]||x(e=null!==(i=o.keyPath)&&void 0!==i&&i.includes(".")?S(e):t({},e),o.keyPath,n.results[r]),e}))}),n);u.optimisticOps.push(r),queueMicrotask((function(){return e.mutatedParts&&On(e.mutatedParts)}))})),s):i.mutate(e)},query:function(e){if(!zn(ve,i)||!$n("query",e))return i.query(e);var t="immutable"===(null===(u=ve.trans)||void 0===u?void 0:u.db._options.cache),o=(c=ve).requery,s=c.signal,u=function(e,t,n,r){var i=En["idb://".concat(e,"/").concat(t)];if(!i)return[];if(!(t=i.queries[n]))return[null,!1,i,null];var o=t[(r.query?r.query.index.name:null)||""];if(!o)return[null,!1,i,null];switch(n){case"query":var s=o.find((function(e){return e.req.limit===r.limit&&e.req.values===r.values&&Yn(e.req.query.range,r.query.range)}));return s?[s,!0,i,o]:[o.find((function(e){return("limit"in e.req?e.req.limit:1/0)>=r.limit&&(!r.values||e.req.values)&&Zn(e.req.query.range,r.query.range)})),!1,i,o];case"count":return s=o.find((function(e){return Yn(e.req.query.range,r.query.range)})),[s,!!s,i,o]}}(n,r,"query",e),a=u[0],c=u[1],l=u[2],f=u[3];return a&&c?a.obsSet=e.obsSet:(c=i.query(e).then((function(e){var n=e.result;if(a&&(a.res=n),t){for(var r=0,i=n.length;r<i;++r)Object.freeze(n[r]);Object.freeze(n)}else e.result=S(n);return e})).catch((function(e){return f&&a&&O(f,a),Promise.reject(e)})),a={obsSet:e.obsSet,promise:c,subscribers:new Set,type:"query",req:e,dirty:!1},f?f.push(a):(f=[a],(l=l||(En["idb://".concat(n,"/").concat(r)]={queries:{query:{},count:{}},objs:new Map,optimisticOps:[],unsignaledParts:{}})).queries.query[e.query.index.name||""]=f)),er(a,f,o,s),a.promise.then((function(n){return{result:Jn(n.result,e,null==l?void 0:l.optimisticOps,i,a,t)}}))}})}})}};function nr(e,t){return new Proxy(e,{get:function(e,n,r){return"db"===n?t:Reflect.get(e,n,r)}})}var rr=(ir.prototype.version=function(e){if(isNaN(e)||e<.1)throw new z.Type("Given version is not a positive number");if(e=Math.round(10*e)/10,this.idbdb||this._state.isBeingOpened)throw new z.Schema("Cannot add version when database is open");this.verno=Math.max(this.verno,e);var t=this._versions,n=t.filter((function(t){return t._cfg.version===e}))[0];return n||(n=new this.Version(e),t.push(n),t.sort(sn),n.stores({}),this._state.autoSchema=!1,n)},ir.prototype._whenReady=function(e){var t=this;return this.idbdb&&(this._state.openComplete||ve.letThrough||this._vip)?e():new xe((function(e,n){if(t._state.openComplete)return n(new z.DatabaseClosed(t._state.dbOpenError));if(!t._state.isBeingOpened){if(!t._state.autoOpen)return void n(new z.DatabaseClosed);t.open().catch(X)}t._state.dbReadyPromise.then(e,n)})).then(e)},ir.prototype.use=function(e){var t=e.stack,n=e.create,r=e.level,i=e.name;return i&&this.unuse({stack:t,name:i}),(e=this._middlewares[t]||(this._middlewares[t]=[])).push({stack:t,create:n,level:null==r?10:r,name:i}),e.sort((function(e,t){return e.level-t.level})),this},ir.prototype.unuse=function(e){var t=e.stack,n=e.name,r=e.create;return t&&this._middlewares[t]&&(this._middlewares[t]=this._middlewares[t].filter((function(e){return r?e.create!==r:!!n&&e.name!==n}))),this},ir.prototype.open=function(){var e=this;return Ve(ye,(function(){return Nn(e)}))},ir.prototype._close=function(){this.on.close.fire(new CustomEvent("close"));var e=this._state,t=tt.indexOf(this);if(0<=t&&tt.splice(t,1),this.idbdb){try{this.idbdb.close()}catch(t){}this.idbdb=null}e.isBeingOpened||(e.dbReadyPromise=new xe((function(t){e.dbReadyResolve=t})),e.openCanceller=new xe((function(t,n){e.cancelOpen=n})))},ir.prototype.close=function(e){var t=(void 0===e?{disableAutoOpen:!0}:e).disableAutoOpen;e=this._state,t?(e.isBeingOpened&&e.cancelOpen(new z.DatabaseClosed),this._close(),e.autoOpen=!1,e.dbOpenError=new z.DatabaseClosed):(this._close(),e.autoOpen=this._options.autoOpen||e.isBeingOpened,e.openComplete=!1,e.dbOpenError=null)},ir.prototype.delete=function(e){var t=this;void 0===e&&(e={disableAutoOpen:!0});var n=0<arguments.length&&"object"!=typeof arguments[0],r=this._state;return new xe((function(i,o){function s(){t.close(e);var n=t._deps.indexedDB.deleteDatabase(t.name);n.onsuccess=Oe((function(){var e,n,r;e=t._deps,n=t.name,r=e.indexedDB,e=e.IDBKeyRange,bn(r)||n===nt||vn(r,e).delete(n).catch(X),i()})),n.onerror=Mt(o),n.onblocked=t._fireOnBlocked}if(n)throw new z.InvalidArgument("Invalid closeOptions argument to db.delete()");r.isBeingOpened?r.dbReadyPromise.then(s):s()}))},ir.prototype.backendDB=function(){return this.idbdb},ir.prototype.isOpen=function(){return null!==this.idbdb},ir.prototype.hasBeenClosed=function(){var e=this._state.dbOpenError;return e&&"DatabaseClosed"===e.name},ir.prototype.hasFailed=function(){return null!==this._state.dbOpenError},ir.prototype.dynamicallyOpened=function(){return this._state.autoSchema},Object.defineProperty(ir.prototype,"tables",{get:function(){var e=this;return o(this._allTables).map((function(t){return e._allTables[t]}))},enumerable:!1,configurable:!0}),ir.prototype.transaction=function(){var e=function(e,t,n){var r=arguments.length;if(r<2)throw new z.InvalidArgument("Too few arguments");for(var i=new Array(r-1);--r;)i[r-1]=arguments[r];return n=i.pop(),[e,k(i),n]}.apply(this,arguments);return this._transaction.apply(this,e)},ir.prototype._transaction=function(e,t,n){var r=this,i=ve.trans;i&&i.db===this&&-1===e.indexOf("!")||(i=null);var o,s,u=-1!==e.indexOf("?");e=e.replace("!","").replace("?","");try{if(s=t.map((function(e){if("string"!=typeof(e=e instanceof r.Table?e.name:e))throw new TypeError("Invalid table argument to Dexie.transaction(). Only Table or String are allowed");return e})),"r"==e||e===rt)o=rt;else{if("rw"!=e&&e!=it)throw new z.InvalidArgument("Invalid transaction mode: "+e);o=it}if(i){if(i.mode===rt&&o===it){if(!u)throw new z.SubTransaction("Cannot enter a sub-transaction with READWRITE mode when parent transaction is READONLY");i=null}i&&s.forEach((function(e){if(i&&-1===i.storeNames.indexOf(e)){if(!u)throw new z.SubTransaction("Table "+e+" not included in parent transaction.");i=null}})),u&&i&&!i.active&&(i=null)}}catch(n){return i?i._promise(null,(function(e,t){t(n)})):Je(n)}var a=function e(t,n,r,i,o){return xe.resolve().then((function(){var s=ve.transless||ve,u=t._createTransaction(n,r,t._dbSchema,i);if(u.explicit=!0,s={trans:u,transless:s},i)u.idbtrans=i.idbtrans;else try{u.create(),u.idbtrans._explicit=!0,t._state.PR1398_maxLoop=3}catch(s){return s.name===W.InvalidState&&t.isOpen()&&0<--t._state.PR1398_maxLoop?(console.warn("Dexie: Need to reopen db"),t.close({disableAutoOpen:!1}),t.open().then((function(){return e(t,n,r,null,o)}))):Je(s)}var a,c=N(o);return c&&Fe(),s=xe.follow((function(){var e;(a=o.call(u,u))&&(c?(e=He.bind(null,null),a.then(e,e)):"function"==typeof a.next&&"function"==typeof a.throw&&(a=Bn(a)))}),s),(a&&"function"==typeof a.then?xe.resolve(a).then((function(e){return u.active?e:Je(new z.PrematureCommit("Transaction committed too early. See http://bit.ly/2kdckMn"))})):s.then((function(){return a}))).then((function(e){return i&&u._resolve(),u._completion.then((function(){return e}))})).catch((function(e){return u._reject(e),Je(e)}))}))}.bind(null,this,o,s,i,n);return i?i._promise(o,a,"lock"):ve.trans?Ve(ve.transless,(function(){return r._whenReady(a)})):this._whenReady(a)},ir.prototype.table=function(e){if(!l(this._allTables,e))throw new z.InvalidTable("Table ".concat(e," does not exist"));return this._allTables[e]},ir);function ir(e,n){var r=this;this._middlewares={},this.verno=0;var i=ir.dependencies;this._options=n=t({addons:ir.addons,autoOpen:!0,indexedDB:i.indexedDB,IDBKeyRange:i.IDBKeyRange,cache:"cloned"},n),this._deps={indexedDB:n.indexedDB,IDBKeyRange:n.IDBKeyRange},i=n.addons,this._dbSchema={},this._versions=[],this._storeNames=[],this._allTables={},this.idbdb=null,this._novip=this;var o,s,u,a,c,l={dbOpenError:null,isBeingOpened:!1,onReadyBeingFired:null,openComplete:!1,dbReadyResolve:X,dbReadyPromise:null,cancelOpen:X,openCanceller:null,autoSchema:!0,PR1398_maxLoop:3,autoOpen:n.autoOpen};l.dbReadyPromise=new xe((function(e){l.dbReadyResolve=e})),l.openCanceller=new xe((function(e,t){l.cancelOpen=t})),this._state=l,this.name=e,this.on=vt(this,"populate","blocked","versionchange","close",{ready:[re,X]}),this.once=function(e,t){var n=function(){for(var i=[],o=0;o<arguments.length;o++)i[o]=arguments[o];r.on(e).unsubscribe(n),t.apply(r,i)};return r.on(e,n)},this.on.ready.subscribe=v(this.on.ready.subscribe,(function(e){return function(t,n){ir.vip((function(){var i,o=r._state;o.openComplete?(o.dbOpenError||xe.resolve().then(t),n&&e(t)):o.onReadyBeingFired?(o.onReadyBeingFired.push(t),n&&e(t)):(e(t),i=r,n||e((function e(){i.on.ready.unsubscribe(t),i.on.ready.unsubscribe(e)})))}))}})),this.Collection=(o=this,bt(jt.prototype,(function(e,t){this.db=o;var n=st,r=null;if(t)try{n=t()}catch(e){r=e}var i=e._ctx;e=(t=i.table).hook.reading.fire,this._ctx={table:t,index:i.index,isPrimKey:!i.index||t.schema.primKey.keyPath&&i.index===t.schema.primKey.name,range:n,keysOnly:!1,dir:"next",unique:"",algorithm:null,filter:null,replayFilter:null,justLimit:!0,isMatch:null,offset:0,limit:1/0,error:r,or:i.or,valueMapper:e!==Q?e:null}}))),this.Table=(s=this,bt(mt.prototype,(function(e,t,n){this.db=s,this._tx=n,this.name=e,this.schema=t,this.hook=s._allTables[e]?s._allTables[e].hook:vt(null,{creating:[Z,X],reading:[J,Q],updating:[te,X],deleting:[ee,X]})}))),this.Transaction=(u=this,bt(Wt.prototype,(function(e,t,n,r,i){var o=this;"readonly"!==e&&t.forEach((function(e){(e=null===(e=n[e])||void 0===e?void 0:e.yProps)&&(t=t.concat(e.map((function(e){return e.updatesTable}))))})),this.db=u,this.mode=e,this.storeNames=t,this.schema=n,this.chromeTransactionDurability=r,this.idbtrans=null,this.on=vt(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 xe((function(e,t){o._resolve=e,o._reject=t})),this._completion.then((function(){o.active=!1,o.on.complete.fire()}),(function(e){var t=o.active;return o.active=!1,o.on.error.fire(e),o.parent?o.parent._reject(e):t&&o.idbtrans&&o.idbtrans.abort(),Je(e)}))}))),this.Version=(a=this,bt(mn.prototype,(function(e){this.db=a,this._cfg={version:e,storesSource:null,dbschema:{},tables:{},contentUpgrade:null}}))),this.WhereClause=(c=this,bt(Nt.prototype,(function(e,t,n){if(this.db=c,this._ctx={table:e,index:":id"===t?null:t,or:n},this._cmp=this._ascending=ct,this._descending=function(e,t){return ct(t,e)},this._max=function(e,t){return 0<ct(e,t)?e:t},this._min=function(e,t){return ct(e,t)<0?e:t},this._IDBKeyRange=c._deps.IDBKeyRange,!this._IDBKeyRange)throw new z.MissingAPI}))),this.on("versionchange",(function(e){0<e.newVersion?console.warn("Another connection wants to upgrade database '".concat(r.name,"'. Closing db now to resume the upgrade.")):console.warn("Another connection wants to delete database '".concat(r.name,"'. Closing db now to resume the delete request.")),r.close({disableAutoOpen:!1})})),this.on("blocked",(function(e){!e.newVersion||e.newVersion<e.oldVersion?console.warn("Dexie.delete('".concat(r.name,"') was blocked")):console.warn("Upgrade '".concat(r.name,"' blocked by other connection holding version ").concat(e.oldVersion/10))})),this._maxKey=Xt(n.IDBKeyRange),this._createTransaction=function(e,t,n,i){return new r.Transaction(e,t,n,r._options.chromeTransactionDurability,i)},this._fireOnBlocked=function(e){r.on("blocked").fire(e),tt.filter((function(e){return e.name===r.name&&e!==r&&!e._state.vcFired})).map((function(t){return t.on("versionchange").fire(e)}))},this.use(Gn),this.use(tr),this.use(Vn),this.use(Kn),this.use(Hn);var f=new Proxy(this,{get:function(e,t,n){if("_vip"===t)return!0;if("table"===t)return function(e){return nr(r.table(e),f)};var i=Reflect.get(e,t,n);return i instanceof mt?nr(i,f):"tables"===t?i.map((function(e){return nr(e,f)})):"_createTransaction"===t?function(){return nr(i.apply(this,arguments),f)}:i}});this.vip=f,i.forEach((function(e){return e(r)}))}B="undefined"!=typeof Symbol&&"observable"in Symbol?Symbol.observable:"@@observable";var or,sr=(ur.prototype.subscribe=function(e,t,n){return this._subscribe(e&&"function"!=typeof e?e:{next:e,error:t,complete:n})},ur.prototype[B]=function(){return this},ur);function ur(e){this._subscribe=e}try{or={indexedDB:i.indexedDB||i.mozIndexedDB||i.webkitIndexedDB||i.msIndexedDB,IDBKeyRange:i.IDBKeyRange||i.webkitIDBKeyRange}}catch(_){or={indexedDB:null,IDBKeyRange:null}}function ar(e){var t,n=!1,r=new sr((function(r){var i,o=N(e),s=!1,u={},a={},c={get closed(){return s},unsubscribe:function(){s||(s=!0,i&&i.abort(),f&&Ht.storagemutated.unsubscribe(h))}};r.start&&r.start(c);var f=!1,p=function(){return Qe(d)},h=function(e){Sn(u,e),Pn(a,u)&&p()},d=function(){var c,d,g;!s&&or.indexedDB&&(u={},c={},i&&i.abort(),i=new AbortController,g=function(t){var n=Pe();try{o&&Fe();var r=Le(e,t);return r=o?r.finally(He):r}finally{n&&Ee()}}(d={subscr:c,signal:i.signal,requery:p,querier:e,trans:null}),Promise.resolve(g).then((function(e){n=!0,t=e,s||d.signal.aborted||(u={},function(e){for(var t in e)if(l(e,t))return;return 1}(a=c)||f||(Ht(Lt,h),f=!0),Qe((function(){return!s&&r.next&&r.next(e)})))}),(function(e){n=!1,["DatabaseClosedError","AbortError"].includes(null==e?void 0:e.name)||s||Qe((function(){s||r.error&&r.error(e)}))})))};return setTimeout(p,0),c}));return r.hasValue=function(){return n},r.getValue=function(){return t},r}var cr=rr;function lr(e){var t=pr;try{pr=!0,Ht.storagemutated.fire(e),Rn(e,!0)}finally{pr=t}}f(cr,t(t({},V),{delete:function(e){return new cr(e,{addons:[]}).delete()},exists:function(e){return new cr(e,{addons:[]}).open().then((function(e){return e.close(),!0})).catch("NoSuchDatabaseError",(function(){return!1}))},getDatabaseNames:function(e){try{return n=(t=cr.dependencies).indexedDB,t=t.IDBKeyRange,(bn(n)?Promise.resolve(n.databases()).then((function(e){return e.map((function(e){return e.name})).filter((function(e){return e!==nt}))})):vn(n,t).toCollection().primaryKeys()).then(e)}catch(e){return Je(new z.MissingAPI)}var t,n},defineClass:function(){return function(e){u(this,e)}},ignoreTransaction:function(e){return ve.trans?Ve(ve.transless,e):e()},vip:wn,async:function(e){return function(){try{var t=Bn(e.apply(this,arguments));return t&&"function"==typeof t.then?t:xe.resolve(t)}catch(t){return Je(t)}}},spawn:function(e,t,n){try{var r=Bn(e.apply(n,t||[]));return r&&"function"==typeof r.then?r:xe.resolve(r)}catch(e){return Je(e)}},currentTransaction:{get:function(){return ve.trans||null}},waitFor:function(e,t){return t=xe.resolve("function"==typeof e?cr.ignoreTransaction(e):e).timeout(t||6e4),ve.trans?ve.trans.waitFor(t):t},Promise:xe,debug:{get:function(){return ie},set:function(e){oe(e)}},derive:d,extend:u,props:f,override:v,Events:vt,on:Ht,liveQuery:ar,extendObservabilitySet:Sn,getByKeyPath:T,setByKeyPath:x,delByKeyPath:function(e,t){"string"==typeof t?x(e,t,void 0):"length"in t&&[].map.call(t,(function(t){x(e,t,void 0)}))},shallowClone:A,deepClone:S,getObjectDiff:Ln,cmp:ct,asap:w,minKey:-1/0,addons:[],connections:tt,errnames:W,dependencies:or,cache:En,semVer:"4.2.1",version:"4.2.1".split(".").map((function(e){return parseInt(e)})).reduce((function(e,t,n){return e+t/Math.pow(10,2*n)}))})),cr.maxKey=Xt(cr.dependencies.IDBKeyRange),"undefined"!=typeof dispatchEvent&&"undefined"!=typeof addEventListener&&(Ht(Lt,(function(e){pr||(e=new CustomEvent(Ft,{detail:e}),pr=!0,dispatchEvent(e),pr=!1)})),addEventListener(Ft,(function(e){e=e.detail,pr||lr(e)})));var fr,pr=!1,hr=function(){};return"undefined"!=typeof BroadcastChannel&&((hr=function(){(fr=new BroadcastChannel(Ft)).onmessage=function(e){return e.data&&lr(e.data)}})(),"function"==typeof fr.unref&&fr.unref(),Ht(Lt,(function(e){pr||fr.postMessage(e)}))),"undefined"!=typeof addEventListener&&(addEventListener("pagehide",(function(e){if(!rr.disableBfCache&&e.persisted){ie&&console.debug("Dexie: handling persisted pagehide"),null!=fr&&fr.close();for(var t=0,n=tt;t<n.length;t++)n[t].close({disableAutoOpen:!1})}})),addEventListener("pageshow",(function(e){!rr.disableBfCache&&e.persisted&&(ie&&console.debug("Dexie: handling persisted pageshow"),hr(),lr({all:new xn(-1/0,[[]])}))}))),xe.rejectionMapper=function(e,t){return!e||e instanceof K||e instanceof TypeError||e instanceof SyntaxError||!e.name||!$[e.name]?e:(t=new $[e.name](t||e.message,e),"stack"in e&&h(t,"stack",{get:function(){return this.inner.stack}}),t)},oe(ie),t(rr,Object.freeze({__proto__:null,Dexie:rr,liveQuery:ar,Entity:at,cmp:ct,PropModification:ht,replacePrefix:function(e,t){return new ht({replacePrefix:[e,t]})},add:function(e){return new ht({add:e})},remove:function(e){return new ht({remove:e})},default:rr,RangeSet:xn,mergeRanges:qn,rangesOverlap:kn}),{default:rr}),rr}()}},t={};function n(r){var i=t[r];if(void 0!==i)return i.exports;var o=t[r]={exports:{}};return e[r].call(o.exports,o,o.exports,n),o.exports}n.d=(e,t)=>{for(var r in t)n.o(t,r)&&!n.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},n.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),n.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),n.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var r={};return(()=>{"use strict";n.r(r),n.d(r,{Api:()=>$e,IDBCache:()=>L,createDefaultConfig:()=>Ve});var e=function(e,t){if(void 0===e||!e.document)throw new Error("jQuery requires a window with a document");var n=[],r=Object.getPrototypeOf,i=n.slice,o=n.flat?function(e){return n.flat.call(e)}:function(e){return n.concat.apply([],e)},s=n.push,u=n.indexOf,a={},c=a.toString,l=a.hasOwnProperty,f=l.toString,p=f.call(Object),h={};function d(e){return null==e?e+"":"object"==typeof e?a[c.call(e)]||"object":typeof e}function g(e){return null!=e&&e===e.window}function m(e){var t=!!e&&e.length,n=d(e);return"function"!=typeof e&&!g(e)&&("array"===n||0===t||"number"==typeof t&&t>0&&t-1 in e)}var y=e.document,v={type:!0,src:!0,nonce:!0,noModule:!0};function b(e,t,n){var r,i=(n=n||y).createElement("script");for(r in i.text=e,v)t&&t[r]&&(i[r]=t[r]);n.head.appendChild(i).parentNode&&i.parentNode.removeChild(i)}var w="4.0.0",T=/HTML$/i,x=function(e,t){return new x.fn.init(e,t)};function A(e,t){return e.nodeName&&e.nodeName.toLowerCase()===t.toLowerCase()}x.fn=x.prototype={jquery:w,constructor:x,length:0,toArray:function(){return i.call(this)},get:function(e){return null==e?i.call(this):e<0?this[e+this.length]:this[e]},pushStack:function(e){var t=x.merge(this.constructor(),e);return t.prevObject=this,t},each:function(e){return x.each(this,e)},map:function(e){return this.pushStack(x.map(this,(function(t,n){return e.call(t,n,t)})))},slice:function(){return this.pushStack(i.apply(this,arguments))},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},even:function(){return this.pushStack(x.grep(this,(function(e,t){return(t+1)%2})))},odd:function(){return this.pushStack(x.grep(this,(function(e,t){return t%2})))},eq:function(e){var t=this.length,n=+e+(e<0?t:0);return this.pushStack(n>=0&&n<t?[this[n]]:[])},end:function(){return this.prevObject||this.constructor()}},x.extend=x.fn.extend=function(){var e,t,n,r,i,o,s=arguments[0]||{},u=1,a=arguments.length,c=!1;for("boolean"==typeof s&&(c=s,s=arguments[u]||{},u++),"object"!=typeof s&&"function"!=typeof s&&(s={}),u===a&&(s=this,u--);u<a;u++)if(null!=(e=arguments[u]))for(t in e)r=e[t],"__proto__"!==t&&s!==r&&(c&&r&&(x.isPlainObject(r)||(i=Array.isArray(r)))?(n=s[t],o=i&&!Array.isArray(n)?[]:i||x.isPlainObject(n)?n:{},i=!1,s[t]=x.extend(c,o,r)):void 0!==r&&(s[t]=r));return s},x.extend({expando:"jQuery"+(w+Math.random()).replace(/\D/g,""),isReady:!0,error:function(e){throw new Error(e)},noop:function(){},isPlainObject:function(e){var t,n;return!(!e||"[object Object]"!==c.call(e))&&(!(t=r(e))||"function"==typeof(n=l.call(t,"constructor")&&t.constructor)&&f.call(n)===p)},isEmptyObject:function(e){var t;for(t in e)return!1;return!0},globalEval:function(e,t,n){b(e,{nonce:t&&t.nonce},n)},each:function(e,t){var n,r=0;if(m(e))for(n=e.length;r<n&&!1!==t.call(e[r],r,e[r]);r++);else for(r in e)if(!1===t.call(e[r],r,e[r]))break;return e},text:function(e){var t,n="",r=0,i=e.nodeType;if(!i)for(;t=e[r++];)n+=x.text(t);return 1===i||11===i?e.textContent:9===i?e.documentElement.textContent:3===i||4===i?e.nodeValue:n},makeArray:function(e,t){var n=t||[];return null!=e&&(m(Object(e))?x.merge(n,"string"==typeof e?[e]:e):s.call(n,e)),n},inArray:function(e,t,n){return null==t?-1:u.call(t,e,n)},isXMLDoc:function(e){var t=e&&e.namespaceURI,n=e&&(e.ownerDocument||e).documentElement;return!T.test(t||n&&n.nodeName||"HTML")},contains:function(e,t){var n=t&&t.parentNode;return e===n||!(!n||1!==n.nodeType||!(e.contains?e.contains(n):e.compareDocumentPosition&&16&e.compareDocumentPosition(n)))},merge:function(e,t){for(var n=+t.length,r=0,i=e.length;r<n;r++)e[i++]=t[r];return e.length=i,e},grep:function(e,t,n){for(var r=[],i=0,o=e.length,s=!n;i<o;i++)!t(e[i],i)!==s&&r.push(e[i]);return r},map:function(e,t,n){var r,i,s=0,u=[];if(m(e))for(r=e.length;s<r;s++)null!=(i=t(e[s],s,n))&&u.push(i);else for(s in e)null!=(i=t(e[s],s,n))&&u.push(i);return o(u)},guid:1,support:h}),"function"==typeof Symbol&&(x.fn[Symbol.iterator]=n[Symbol.iterator]),x.each("Boolean Number String Function Array Date RegExp Object Error Symbol".split(" "),(function(e,t){a["[object "+t+"]"]=t.toLowerCase()}));var q=n.pop,k="[\\x20\\t\\r\\n\\f]",_=y.documentMode,j=_&&new RegExp(":enabled|:disabled|\\["+k+"*name"+k+"*="+k+"*(?:''|\"\")"),U=new RegExp("^"+k+"+|((?:^|[^\\\\])(?:\\\\.)*)"+k+"+$","g"),S="(?:\\\\[\\da-fA-F]{1,6}"+k+"?|\\\\[^\\r\\n\\f]|[\\w-]|[^\0-\\x7f])+",P=new RegExp("^"+k+"*([>+~]|"+k+")"+k+"*"),E=new RegExp(k+"|>"),C=/[+~]/,D=y.documentElement,O=D.matches||D.msMatchesSelector;function R(){var e=[];return function t(n,r){return e.push(n+" ")>x.expr.cacheLength&&delete t[e.shift()],t[n+" "]=r}}function I(e){return e&&void 0!==e.getElementsByTagName&&e}var N="\\["+k+"*("+S+")(?:"+k+"*([*^$|!~]?=)"+k+"*(?:'((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\"|("+S+"))|)"+k+"*\\]",B=":("+S+")(?:\\((('((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\")|((?:\\\\.|[^\\\\()[\\]]|"+N+")*)|.*)\\)|)",M={ID:new RegExp("^#("+S+")"),CLASS:new RegExp("^\\.("+S+")"),TAG:new RegExp("^("+S+"|[*])"),ATTR:new RegExp("^"+N),PSEUDO:new RegExp("^"+B),CHILD:new RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\("+k+"*(even|odd|(([+-]|)(\\d*)n|)"+k+"*(?:([+-]|)"+k+"*(\\d+)|))"+k+"*\\)|)","i")},K=new RegExp(B),L=new RegExp("\\\\[\\da-fA-F]{1,6}"+k+"?|\\\\([^\\r\\n\\f])","g"),F=function(e,t){var n="0x"+e.slice(1)-65536;return t||(n<0?String.fromCharCode(n+65536):String.fromCharCode(n>>10|55296,1023&n|56320))};function H(e){return e.replace(L,F)}function W(e){x.error("Syntax error, unrecognized expression: "+e)}var G=new RegExp("^"+k+"*,"+k+"*"),z=R();function $(e,t){var n,r,i,o,s,u,a,c=z[e+" "];if(c)return t?0:c.slice(0);for(s=e,u=[],a=x.expr.preFilter;s;){for(o in n&&!(r=G.exec(s))||(r&&(s=s.slice(r[0].length)||s),u.push(i=[])),n=!1,(r=P.exec(s))&&(n=r.shift(),i.push({value:n,type:r[0].replace(U," ")}),s=s.slice(n.length)),M)!(r=x.expr.match[o].exec(s))||a[o]&&!(r=a[o](r))||(n=r.shift(),i.push({value:n,type:o,matches:r}),s=s.slice(n.length));if(!n)break}return t?s.length:s?W(e):z(e,u).slice(0)}var V={ATTR:function(e){return e[1]=H(e[1]),e[3]=H(e[3]||e[4]||e[5]||""),"~="===e[2]&&(e[3]=" "+e[3]+" "),e.slice(0,4)},CHILD:function(e){return e[1]=e[1].toLowerCase(),"nth"===e[1].slice(0,3)?(e[3]||W(e[0]),e[4]=+(e[4]?e[5]+(e[6]||1):2*("even"===e[3]||"odd"===e[3])),e[5]=+(e[7]+e[8]||"odd"===e[3])):e[3]&&W(e[0]),e},PSEUDO:function(e){var t,n=!e[6]&&e[2];return M.CHILD.test(e[0])?null:(e[3]?e[2]=e[4]||e[5]||"":n&&K.test(n)&&(t=$(n,!0))&&(t=n.indexOf(")",n.length-t)-n.length)&&(e[0]=e[0].slice(0,t),e[2]=n.slice(0,t)),e.slice(0,3))}};function X(e){for(var t=0,n=e.length,r="";t<n;t++)r+=e[t].value;return r}function Q(e,t,n,r,i,o,s){var u=0,a=e.length,c=null==n;if("object"===d(n))for(u in i=!0,n)Q(e,t,u,n[u],!0,o,s);else if(void 0!==r&&(i=!0,"function"!=typeof r&&(s=!0),c&&(s?(t.call(e,r),t=null):(c=t,t=function(e,t,n){return c.call(x(e),n)})),t))for(;u<a;u++)t(e[u],n,s?r:r.call(e[u],u,t(e[u],n)));return i?e:c?t.call(e):a?t(e[0],n):o}var J=/[^\x20\t\r\n\f]+/g;x.fn.extend({attr:function(e,t){return Q(this,x.attr,e,t,arguments.length>1)},removeAttr:function(e){return this.each((function(){x.removeAttr(this,e)}))}}),x.extend({attr:function(e,t,n){var r,i,o=e.nodeType;if(3!==o&&8!==o&&2!==o)return void 0===e.getAttribute?x.prop(e,t,n):(1===o&&x.isXMLDoc(e)||(i=x.attrHooks[t.toLowerCase()]),void 0!==n?null===n||!1===n&&0!==t.toLowerCase().indexOf("aria-")?void x.removeAttr(e,t):i&&"set"in i&&void 0!==(r=i.set(e,n,t))?r:(e.setAttribute(t,n),n):i&&"get"in i&&null!==(r=i.get(e,t))?r:null==(r=e.getAttribute(t))?void 0:r)},attrHooks:{},removeAttr:function(e,t){var n,r=0,i=t&&t.match(J);if(i&&1===e.nodeType)for(;n=i[r++];)e.removeAttribute(n)}}),_&&(x.attrHooks.type={set:function(e,t){if("radio"===t&&A(e,"input")){var n=e.value;return e.setAttribute("type",t),n&&(e.value=n),t}}});var Y=/([\0-\x1f\x7f]|^-?\d)|^-$|[^\x80-\uFFFF\w-]/g;function Z(e,t){return t?"\0"===e?"�":e.slice(0,-1)+"\\"+e.charCodeAt(e.length-1).toString(16)+" ":"\\"+e}x.escapeSelector=function(e){return(e+"").replace(Y,Z)};var ee,te=n.sort,ne=n.splice;function re(e,t){if(e===t)return ee=!0,0;var n=!e.compareDocumentPosition-!t.compareDocumentPosition;return n||(1&(n=(e.ownerDocument||e)==(t.ownerDocument||t)?e.compareDocumentPosition(t):1)?e==y||e.ownerDocument==y&&x.contains(y,e)?-1:t==y||t.ownerDocument==y&&x.contains(y,t)?1:0:4&n?-1:1)}x.uniqueSort=function(e){var t,n=[],r=0,i=0;if(ee=!1,te.call(e,re),ee){for(;t=e[i++];)t===e[i]&&(r=n.push(i));for(;r--;)ne.call(e,n[r],1)}return e},x.fn.uniqueSort=function(){return this.pushStack(x.uniqueSort(i.apply(this)))};var ie,oe,se,ue,ae,ce=0,le=0,fe=R(),pe=R(),he=R(),de=new RegExp(k+"+","g"),ge=new RegExp("^"+S+"$"),me=x.extend({needsContext:new RegExp("^"+k+"*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\("+k+"*((?:-\\d)?\\d*)"+k+"*\\)|)(?=[^-]|$)","i")},M),ye=/^(?:input|select|textarea|button)$/i,ve=/^h\d$/i,be=/^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,we=function(){Ue()},Te=Pe((function(e){return!0===e.disabled&&A(e,"fieldset")}),{dir:"parentNode",next:"legend"});function xe(e,t,n,r){var i,o,u,a,c,l,f,p=t&&t.ownerDocument,h=t?t.nodeType:9;if(n=n||[],"string"!=typeof e||!e||1!==h&&9!==h&&11!==h)return n;if(!r&&(Ue(t),t=t||se,ae)){if(11!==h&&(c=be.exec(e)))if(i=c[1]){if(9===h)return(u=t.getElementById(i))&&s.call(n,u),n;if(p&&(u=p.getElementById(i))&&x.contains(t,u))return s.call(n,u),n}else{if(c[2])return s.apply(n,t.getElementsByTagName(e)),n;if((i=c[3])&&t.getElementsByClassName)return s.apply(n,t.getElementsByClassName(i)),n}if(!(he[e+" "]||j&&j.test(e))){if(f=e,p=t,1===h&&(E.test(e)||P.test(e))){for(((p=C.test(e)&&I(t.parentNode)||t)!=t||_)&&((a=t.getAttribute("id"))?a=x.escapeSelector(a):t.setAttribute("id",a=x.expando)),o=(l=$(e)).length;o--;)l[o]=(a?"#"+a:":scope")+" "+X(l[o]);f=l.join(",")}try{return s.apply(n,p.querySelectorAll(f)),n}catch(t){he(e,!0)}finally{a===x.expando&&t.removeAttribute("id")}}}return Ie(e.replace(U,"$1"),t,n,r)}function Ae(e){return e[x.expando]=!0,e}function qe(e){return function(t){return A(t,"input")&&t.type===e}}function ke(e){return function(t){return(A(t,"input")||A(t,"button"))&&t.type===e}}function _e(e){return function(t){return"form"in t?t.parentNode&&!1===t.disabled?"label"in t?"label"in t.parentNode?t.parentNode.disabled===e:t.disabled===e:t.isDisabled===e||t.isDisabled!==!e&&Te(t)===e:t.disabled===e:"label"in t&&t.disabled===e}}function je(e){return Ae((function(t){return t=+t,Ae((function(n,r){for(var i,o=e([],n.length,t),s=o.length;s--;)n[i=o[s]]&&(n[i]=!(r[i]=n[i]))}))}))}function Ue(e){var t,n=e?e.ownerDocument||e:y;n!=se&&9===n.nodeType&&(ue=(se=n).documentElement,ae=!x.isXMLDoc(se),_&&y!=se&&(t=se.defaultView)&&t.top!==t&&t.addEventListener("unload",we))}for(ie in xe.matches=function(e,t){return xe(e,null,null,t)},xe.matchesSelector=function(e,t){if(Ue(e),ae&&!he[t+" "]&&(!j||!j.test(t)))try{return O.call(e,t)}catch(e){he(t,!0)}return xe(t,se,null,[e]).length>0},x.expr={cacheLength:50,createPseudo:Ae,match:me,find:{ID:function(e,t){if(void 0!==t.getElementById&&ae){var n=t.getElementById(e);return n?[n]:[]}},TAG:function(e,t){return void 0!==t.getElementsByTagName?t.getElementsByTagName(e):t.querySelectorAll(e)},CLASS:function(e,t){if(void 0!==t.getElementsByClassName&&ae)return t.getElementsByClassName(e)}},relative:{">":{dir:"parentNode",first:!0}," ":{dir:"parentNode"},"+":{dir:"previousSibling",first:!0},"~":{dir:"previousSibling"}},preFilter:V,filter:{ID:function(e){var t=H(e);return function(e){return e.getAttribute("id")===t}},TAG:function(e){var t=H(e).toLowerCase();return"*"===e?function(){return!0}:function(e){return A(e,t)}},CLASS:function(e){var t=fe[e+" "];return t||(t=new RegExp("(^|"+k+")"+e+"("+k+"|$)"))&&fe(e,(function(e){return t.test("string"==typeof e.className&&e.className||void 0!==e.getAttribute&&e.getAttribute("class")||"")}))},ATTR:function(e,t,n){return function(r){var i=x.attr(r,e);return null==i?"!="===t:!t||(i+="","="===t?i===n:"!="===t?i!==n:"^="===t?n&&0===i.indexOf(n):"*="===t?n&&i.indexOf(n)>-1:"$="===t?n&&i.slice(-n.length)===n:"~="===t?(" "+i.replace(de," ")+" ").indexOf(n)>-1:"|="===t&&(i===n||i.slice(0,n.length+1)===n+"-"))}},CHILD:function(e,t,n,r,i){var o="nth"!==e.slice(0,3),s="last"!==e.slice(-4),u="of-type"===t;return 1===r&&0===i?function(e){return!!e.parentNode}:function(t,n,a){var c,l,f,p,h,d=o!==s?"nextSibling":"previousSibling",g=t.parentNode,m=u&&t.nodeName.toLowerCase(),y=!a&&!u,v=!1;if(g){if(o){for(;d;){for(f=t;f=f[d];)if(u?A(f,m):1===f.nodeType)return!1;h=d="only"===e&&!h&&"nextSibling"}return!0}if(h=[s?g.firstChild:g.lastChild],s&&y){for(v=(p=(c=(l=g[x.expando]||(g[x.expando]={}))[e]||[])[0]===ce&&c[1])&&c[2],f=p&&g.childNodes[p];f=++p&&f&&f[d]||(v=p=0)||h.pop();)if(1===f.nodeType&&++v&&f===t){l[e]=[ce,p,v];break}}else if(y&&(v=p=(c=(l=t[x.expando]||(t[x.expando]={}))[e]||[])[0]===ce&&c[1]),!1===v)for(;(f=++p&&f&&f[d]||(v=p=0)||h.pop())&&(!(u?A(f,m):1===f.nodeType)||!++v||(y&&((l=f[x.expando]||(f[x.expando]={}))[e]=[ce,v]),f!==t)););return(v-=i)===r||v%r==0&&v/r>=0}}},PSEUDO:function(e,t){var n=x.expr.pseudos[e]||x.expr.setFilters[e.toLowerCase()]||W("unsupported pseudo: "+e);return n[x.expando]?n(t):n}},pseudos:{not:Ae((function(e){var t=[],n=[],r=Re(e.replace(U,"$1"));return r[x.expando]?Ae((function(e,t,n,i){for(var o,s=r(e,null,i,[]),u=e.length;u--;)(o=s[u])&&(e[u]=!(t[u]=o))})):function(e,i,o){return t[0]=e,r(t,null,o,n),t[0]=null,!n.pop()}})),has:Ae((function(e){return function(t){return xe(e,t).length>0}})),contains:Ae((function(e){return e=H(e),function(t){return(t.textContent||x.text(t)).indexOf(e)>-1}})),lang:Ae((function(e){return ge.test(e||"")||W("unsupported lang: "+e),e=H(e).toLowerCase(),function(t){var n;do{if(n=ae?t.lang:t.getAttribute("xml:lang")||t.getAttribute("lang"))return(n=n.toLowerCase())===e||0===n.indexOf(e+"-")}while((t=t.parentNode)&&1===t.nodeType);return!1}})),target:function(t){var n=e.location&&e.location.hash;return n&&n.slice(1)===t.id},root:function(e){return e===ue},focus:function(e){return e===se.activeElement&&se.hasFocus()&&!!(e.type||e.href||~e.tabIndex)},enabled:_e(!1),disabled:_e(!0),checked:function(e){return A(e,"input")&&!!e.checked||A(e,"option")&&!!e.selected},selected:function(e){return _&&e.parentNode&&e.parentNode.selectedIndex,!0===e.selected},empty:function(e){for(e=e.firstChild;e;e=e.nextSibling)if(e.nodeType<6)return!1;return!0},parent:function(e){return!x.expr.pseudos.empty(e)},header:function(e){return ve.test(e.nodeName)},input:function(e){return ye.test(e.nodeName)},button:function(e){return A(e,"input")&&"button"===e.type||A(e,"button")},text:function(e){return A(e,"input")&&"text"===e.type},first:je((function(){return[0]})),last:je((function(e,t){return[t-1]})),eq:je((function(e,t,n){return[n<0?n+t:n]})),even:je((function(e,t){for(var n=0;n<t;n+=2)e.push(n);return e})),odd:je((function(e,t){for(var n=1;n<t;n+=2)e.push(n);return e})),lt:je((function(e,t,n){var r;for(r=n<0?n+t:n>t?t:n;--r>=0;)e.push(r);return e})),gt:je((function(e,t,n){for(var r=n<0?n+t:n;++r<t;)e.push(r);return e}))}},x.expr.pseudos.nth=x.expr.pseudos.eq,{radio:!0,checkbox:!0,file:!0,password:!0,image:!0})x.expr.pseudos[ie]=qe(ie);for(ie in{submit:!0,reset:!0})x.expr.pseudos[ie]=ke(ie);function Se(){}function Pe(e,t,n){var r=t.dir,i=t.next,o=i||r,s=n&&"parentNode"===o,u=le++;return t.first?function(t,n,i){for(;t=t[r];)if(1===t.nodeType||s)return e(t,n,i);return!1}:function(t,n,a){var c,l,f=[ce,u];if(a){for(;t=t[r];)if((1===t.nodeType||s)&&e(t,n,a))return!0}else for(;t=t[r];)if(1===t.nodeType||s)if(l=t[x.expando]||(t[x.expando]={}),i&&A(t,i))t=t[r]||t;else{if((c=l[o])&&c[0]===ce&&c[1]===u)return f[2]=c[2];if(l[o]=f,f[2]=e(t,n,a))return!0}return!1}}function Ee(e){return e.length>1?function(t,n,r){for(var i=e.length;i--;)if(!e[i](t,n,r))return!1;return!0}:e[0]}function Ce(e,t,n,r,i){for(var o,s=[],u=0,a=e.length,c=null!=t;u<a;u++)(o=e[u])&&(n&&!n(o,r,i)||(s.push(o),c&&t.push(u)));return s}function De(e,t,n,r,i,o){return r&&!r[x.expando]&&(r=De(r)),i&&!i[x.expando]&&(i=De(i,o)),Ae((function(o,a,c,l){var f,p,h,d,g=[],m=[],y=a.length,v=o||function(e,t,n){for(var r=0,i=t.length;r<i;r++)xe(e,t[r],n);return n}(t||"*",c.nodeType?[c]:c,[]),b=!e||!o&&t?v:Ce(v,g,e,c,l);if(n?n(b,d=i||(o?e:y||r)?[]:a,c,l):d=b,r)for(f=Ce(d,m),r(f,[],c,l),p=f.length;p--;)(h=f[p])&&(d[m[p]]=!(b[m[p]]=h));if(o){if(i||e){if(i){for(f=[],p=d.length;p--;)(h=d[p])&&f.push(b[p]=h);i(null,d=[],f,l)}for(p=d.length;p--;)(h=d[p])&&(f=i?u.call(o,h):g[p])>-1&&(o[f]=!(a[f]=h))}}else d=Ce(d===a?d.splice(y,d.length):d),i?i(null,a,d,l):s.apply(a,d)}))}function Oe(e){for(var t,n,r,i=e.length,o=x.expr.relative[e[0].type],s=o||x.expr.relative[" "],a=o?1:0,c=Pe((function(e){return e===t}),s,!0),l=Pe((function(e){return u.call(t,e)>-1}),s,!0),f=[function(e,n,r){var i=!o&&(r||n!=oe)||((t=n).nodeType?c(e,n,r):l(e,n,r));return t=null,i}];a<i;a++)if(n=x.expr.relative[e[a].type])f=[Pe(Ee(f),n)];else{if((n=x.expr.filter[e[a].type].apply(null,e[a].matches))[x.expando]){for(r=++a;r<i&&!x.expr.relative[e[r].type];r++);return De(a>1&&Ee(f),a>1&&X(e.slice(0,a-1).concat({value:" "===e[a-2].type?"*":""})).replace(U,"$1"),n,a<r&&Oe(e.slice(a,r)),r<i&&Oe(e=e.slice(r)),r<i&&X(e))}f.push(n)}return Ee(f)}function Re(e,t){var n,r=[],i=[],o=pe[e+" "];if(!o){for(t||(t=$(e)),n=t.length;n--;)(o=Oe(t[n]))[x.expando]?r.push(o):i.push(o);o=pe(e,function(e,t){var n=t.length>0,r=e.length>0,i=function(i,o,u,a,c){var l,f,p,h=0,d="0",g=i&&[],m=[],y=oe,v=i||r&&x.expr.find.TAG("*",c),b=ce+=null==y?1:Math.random()||.1;for(c&&(oe=o==se||o||c);null!=(l=v[d]);d++){if(r&&l){for(f=0,o||l.ownerDocument==se||(Ue(l),u=!ae);p=e[f++];)if(p(l,o||se,u)){s.call(a,l);break}c&&(ce=b)}n&&((l=!p&&l)&&h--,i&&g.push(l))}if(h+=d,n&&d!==h){for(f=0;p=t[f++];)p(g,m,o,u);if(i){if(h>0)for(;d--;)g[d]||m[d]||(m[d]=q.call(a));m=Ce(m)}s.apply(a,m),c&&!i&&m.length>0&&h+t.length>1&&x.uniqueSort(a)}return c&&(ce=b,oe=y),g};return n?Ae(i):i}(i,r)),o.selector=e}return o}function Ie(e,t,n,r){var i,o,u,a,c,l="function"==typeof e&&e,f=!r&&$(e=l.selector||e);if(n=n||[],1===f.length){if((o=f[0]=f[0].slice(0)).length>2&&"ID"===(u=o[0]).type&&9===t.nodeType&&ae&&x.expr.relative[o[1].type]){if(!(t=(x.expr.find.ID(H(u.matches[0]),t)||[])[0]))return n;l&&(t=t.parentNode),e=e.slice(o.shift().value.length)}for(i=me.needsContext.test(e)?0:o.length;i--&&(u=o[i],!x.expr.relative[a=u.type]);)if((c=x.expr.find[a])&&(r=c(H(u.matches[0]),C.test(o[0].type)&&I(t.parentNode)||t))){if(o.splice(i,1),!(e=r.length&&X(o)))return s.apply(n,r),n;break}}return(l||Re(e,f))(r,t,!ae,n,!t||C.test(e)&&I(t.parentNode)||t),n}function Ne(e,t,n){for(var r=[],i=void 0!==n;(e=e[t])&&9!==e.nodeType;)if(1===e.nodeType){if(i&&x(e).is(n))break;r.push(e)}return r}function Be(e,t){for(var n=[];e;e=e.nextSibling)1===e.nodeType&&e!==t&&n.push(e);return n}Se.prototype=x.expr.pseudos,x.expr.setFilters=new Se,Ue(),x.find=xe,xe.compile=Re,xe.select=Ie,xe.setDocument=Ue,xe.tokenize=$;var Me=x.expr.match.needsContext,Ke=/^<([a-z][^\/\0>:\x20\t\r\n\f]*)[\x20\t\r\n\f]*\/?>(?:<\/\1>|)$/i;function Le(e){return"<"===e[0]&&">"===e[e.length-1]&&e.length>=3}function Fe(e,t,n){return"function"==typeof t?x.grep(e,(function(e,r){return!!t.call(e,r,e)!==n})):t.nodeType?x.grep(e,(function(e){return e===t!==n})):"string"!=typeof t?x.grep(e,(function(e){return u.call(t,e)>-1!==n})):x.filter(t,e,n)}x.filter=function(e,t,n){var r=t[0];return n&&(e=":not("+e+")"),1===t.length&&1===r.nodeType?x.find.matchesSelector(r,e)?[r]:[]:x.find.matches(e,x.grep(t,(function(e){return 1===e.nodeType})))},x.fn.extend({find:function(e){var t,n,r=this.length,i=this;if("string"!=typeof e)return this.pushStack(x(e).filter((function(){for(t=0;t<r;t++)if(x.contains(i[t],this))return!0})));for(n=this.pushStack([]),t=0;t<r;t++)x.find(e,i[t],n);return r>1?x.uniqueSort(n):n},filter:function(e){return this.pushStack(Fe(this,e||[],!1))},not:function(e){return this.pushStack(Fe(this,e||[],!0))},is:function(e){return!!Fe(this,"string"==typeof e&&Me.test(e)?x(e):e||[],!1).length}});var He,We=/^(?:\s*(<[\w\W]+>)[^>]*|#([\w-]+))$/;(x.fn.init=function(e,t){var n,r;if(!e)return this;if(e.nodeType)return this[0]=e,this.length=1,this;if("function"==typeof e)return void 0!==He.ready?He.ready(e):e(x);if(Le(n=e+""))n=[null,e,null];else{if("string"!=typeof e)return x.makeArray(e,this);n=We.exec(e)}if(!n||!n[1]&&t)return!t||t.jquery?(t||He).find(e):this.constructor(t).find(e);if(n[1]){if(t=t instanceof x?t[0]:t,x.merge(this,x.parseHTML(n[1],t&&t.nodeType?t.ownerDocument||t:y,!0)),Ke.test(n[1])&&x.isPlainObject(t))for(n in t)"function"==typeof this[n]?this[n](t[n]):this.attr(n,t[n]);return this}return(r=y.getElementById(n[2]))&&(this[0]=r,this.length=1),this}).prototype=x.fn,He=x(y);var Ge=/^(?:parents|prev(?:Until|All))/,ze={children:!0,contents:!0,next:!0,prev:!0};function $e(e,t){for(;(e=e[t])&&1!==e.nodeType;);return e}function Ve(e){return e}function Xe(e){throw e}function Qe(e,t,n,r){var i;try{e&&"function"==typeof(i=e.promise)?i.call(e).done(t).fail(n):e&&"function"==typeof(i=e.then)?i.call(e,t,n):t.apply(void 0,[e].slice(r))}catch(e){n(e)}}x.fn.extend({has:function(e){var t=x(e,this),n=t.length;return this.filter((function(){for(var e=0;e<n;e++)if(x.contains(this,t[e]))return!0}))},closest:function(e,t){var n,r=0,i=this.length,o=[],s="string"!=typeof e&&x(e);if(!Me.test(e))for(;r<i;r++)for(n=this[r];n&&n!==t;n=n.parentNode)if(n.nodeType<11&&(s?s.index(n)>-1:1===n.nodeType&&x.find.matchesSelector(n,e))){o.push(n);break}return this.pushStack(o.length>1?x.uniqueSort(o):o)},index:function(e){return e?"string"==typeof e?u.call(x(e),this[0]):u.call(this,e.jquery?e[0]:e):this[0]&&this[0].parentNode?this.first().prevAll().length:-1},add:function(e,t){return this.pushStack(x.uniqueSort(x.merge(this.get(),x(e,t))))},addBack:function(e){return this.add(null==e?this.prevObject:this.prevObject.filter(e))}}),x.each({parent:function(e){var t=e.parentNode;return t&&11!==t.nodeType?t:null},parents:function(e){return Ne(e,"parentNode")},parentsUntil:function(e,t,n){return Ne(e,"parentNode",n)},next:function(e){return $e(e,"nextSibling")},prev:function(e){return $e(e,"previousSibling")},nextAll:function(e){return Ne(e,"nextSibling")},prevAll:function(e){return Ne(e,"previousSibling")},nextUntil:function(e,t,n){return Ne(e,"nextSibling",n)},prevUntil:function(e,t,n){return Ne(e,"previousSibling",n)},siblings:function(e){return Be((e.parentNode||{}).firstChild,e)},children:function(e){return Be(e.firstChild)},contents:function(e){return null!=e.contentDocument&&r(e.contentDocument)?e.contentDocument:(A(e,"template")&&(e=e.content||e),x.merge([],e.childNodes))}},(function(e,t){x.fn[e]=function(n,r){var i=x.map(this,t,n);return"Until"!==e.slice(-5)&&(r=n),r&&"string"==typeof r&&(i=x.filter(r,i)),this.length>1&&(ze[e]||x.uniqueSort(i),Ge.test(e)&&i.reverse()),this.pushStack(i)}})),x.Callbacks=function(e){e="string"==typeof e?function(e){var t={};return x.each(e.match(J)||[],(function(e,n){t[n]=!0})),t}(e):x.extend({},e);var t,n,r,i,o=[],s=[],u=-1,a=function(){for(i=i||e.once,r=t=!0;s.length;u=-1)for(n=s.shift();++u<o.length;)!1===o[u].apply(n[0],n[1])&&e.stopOnFalse&&(u=o.length,n=!1);e.memory||(n=!1),t=!1,i&&(o=n?[]:"")},c={add:function(){return o&&(n&&!t&&(u=o.length-1,s.push(n)),function t(n){x.each(n,(function(n,r){"function"==typeof r?e.unique&&c.has(r)||o.push(r):r&&r.length&&"string"!==d(r)&&t(r)}))}(arguments),n&&!t&&a()),this},remove:function(){return x.each(arguments,(function(e,t){for(var n;(n=x.inArray(t,o,n))>-1;)o.splice(n,1),n<=u&&u--})),this},has:function(e){return e?x.inArray(e,o)>-1:o.length>0},empty:function(){return o&&(o=[]),this},disable:function(){return i=s=[],o=n="",this},disabled:function(){return!o},lock:function(){return i=s=[],n||t||(o=n=""),this},locked:function(){return!!i},fireWith:function(e,n){return i||(n=[e,(n=n||[]).slice?n.slice():n],s.push(n),t||a()),this},fire:function(){return c.fireWith(this,arguments),this},fired:function(){return!!r}};return c},x.extend({Deferred:function(t){var n=[["notify","progress",x.Callbacks("memory"),x.Callbacks("memory"),2],["resolve","done",x.Callbacks("once memory"),x.Callbacks("once memory"),0,"resolved"],["reject","fail",x.Callbacks("once memory"),x.Callbacks("once memory"),1,"rejected"]],r="pending",i={state:function(){return r},always:function(){return o.done(arguments).fail(arguments),this},catch:function(e){return i.then(null,e)},pipe:function(){var e=arguments;return x.Deferred((function(t){x.each(n,(function(n,r){var i="function"==typeof e[r[4]]&&e[r[4]];o[r[1]]((function(){var e=i&&i.apply(this,arguments);e&&"function"==typeof e.promise?e.promise().progress(t.notify).done(t.resolve).fail(t.reject):t[r[0]+"With"](this,i?[e]:arguments)}))})),e=null})).promise()},then:function(t,r,i){var o=0;function s(t,n,r,i){return function(){var u=this,a=arguments,c=function(){var e,c;if(!(t<o)){if((e=r.apply(u,a))===n.promise())throw new TypeError("Thenable self-resolution");"function"==typeof(c=e&&("object"==typeof e||"function"==typeof e)&&e.then)?i?c.call(e,s(o,n,Ve,i),s(o,n,Xe,i)):(o++,c.call(e,s(o,n,Ve,i),s(o,n,Xe,i),s(o,n,Ve,n.notifyWith))):(r!==Ve&&(u=void 0,a=[e]),(i||n.resolveWith)(u,a))}},l=i?c:function(){try{c()}catch(e){x.Deferred.exceptionHook&&x.Deferred.exceptionHook(e,l.error),t+1>=o&&(r!==Xe&&(u=void 0,a=[e]),n.rejectWith(u,a))}};t?l():(x.Deferred.getErrorHook&&(l.error=x.Deferred.getErrorHook()),e.setTimeout(l))}}return x.Deferred((function(e){n[0][3].add(s(0,e,"function"==typeof i?i:Ve,e.notifyWith)),n[1][3].add(s(0,e,"function"==typeof t?t:Ve)),n[2][3].add(s(0,e,"function"==typeof r?r:Xe))})).promise()},promise:function(e){return null!=e?x.extend(e,i):i}},o={};return x.each(n,(function(e,t){var s=t[2],u=t[5];i[t[1]]=s.add,u&&s.add((function(){r=u}),n[3-e][2].disable,n[3-e][3].disable,n[0][2].lock,n[0][3].lock),s.add(t[3].fire),o[t[0]]=function(){return o[t[0]+"With"](this===o?void 0:this,arguments),this},o[t[0]+"With"]=s.fireWith})),i.promise(o),t&&t.call(o,o),o},when:function(e){var t=arguments.length,n=t,r=Array(n),o=i.call(arguments),s=x.Deferred(),u=function(e){return function(n){r[e]=this,o[e]=arguments.length>1?i.call(arguments):n,--t||s.resolveWith(r,o)}};if(t<=1&&(Qe(e,s.done(u(n)).resolve,s.reject,!t),"pending"===s.state()||"function"==typeof(o[n]&&o[n].then)))return s.then();for(;n--;)Qe(o[n],u(n),s.reject);return s.promise()}});var Je=/^(Eval|Internal|Range|Reference|Syntax|Type|URI)Error$/;x.Deferred.exceptionHook=function(t,n){t&&Je.test(t.name)&&e.console.warn("jQuery.Deferred exception",t,n)},x.readyException=function(t){e.setTimeout((function(){throw t}))};var Ye=x.Deferred();function Ze(){y.removeEventListener("DOMContentLoaded",Ze),e.removeEventListener("load",Ze),x.ready()}x.fn.ready=function(e){return Ye.then(e).catch((function(e){x.readyException(e)})),this},x.extend({isReady:!1,readyWait:1,ready:function(e){(!0===e?--x.readyWait:x.isReady)||(x.isReady=!0,!0!==e&&--x.readyWait>0||Ye.resolveWith(y,[x]))}}),x.ready.then=Ye.then,"loading"!==y.readyState?e.setTimeout(x.ready):(y.addEventListener("DOMContentLoaded",Ze),e.addEventListener("load",Ze));var et=/-([a-z])/g;function tt(e,t){return t.toUpperCase()}function nt(e){return e.replace(et,tt)}function rt(e){return 1===e.nodeType||9===e.nodeType||!+e.nodeType}function it(){this.expando=x.expando+it.uid++}it.uid=1,it.prototype={cache:function(e){var t=e[this.expando];return t||(t=Object.create(null),rt(e)&&(e.nodeType?e[this.expando]=t:Object.defineProperty(e,this.expando,{value:t,configurable:!0}))),t},set:function(e,t,n){var r,i=this.cache(e);if("string"==typeof t)i[nt(t)]=n;else for(r in t)i[nt(r)]=t[r];return n},get:function(e,t){return void 0===t?this.cache(e):e[this.expando]&&e[this.expando][nt(t)]},access:function(e,t,n){return void 0===t||t&&"string"==typeof t&&void 0===n?this.get(e,t):(this.set(e,t,n),void 0!==n?n:t)},remove:function(e,t){var n,r=e[this.expando];if(void 0!==r){if(void 0!==t){n=(t=Array.isArray(t)?t.map(nt):(t=nt(t))in r?[t]:t.match(J)||[]).length;for(;n--;)delete r[t[n]]}(void 0===t||x.isEmptyObject(r))&&(e.nodeType?e[this.expando]=void 0:delete e[this.expando])}},hasData:function(e){var t=e[this.expando];return void 0!==t&&!x.isEmptyObject(t)}};var ot=new it,st=new it,ut=/^(?:\{[\w\W]*\}|\[[\w\W]*\])$/,at=/[A-Z]/g;function ct(e,t,n){var r;if(void 0===n&&1===e.nodeType)if(r="data-"+t.replace(at,"-$&").toLowerCase(),"string"==typeof(n=e.getAttribute(r))){try{n=function(e){return"true"===e||"false"!==e&&("null"===e?null:e===+e+""?+e:ut.test(e)?JSON.parse(e):e)}(n)}catch(e){}st.set(e,t,n)}else n=void 0;return n}x.extend({hasData:function(e){return st.hasData(e)||ot.hasData(e)},data:function(e,t,n){return st.access(e,t,n)},removeData:function(e,t){st.remove(e,t)},_data:function(e,t,n){return ot.access(e,t,n)},_removeData:function(e,t){ot.remove(e,t)}}),x.fn.extend({data:function(e,t){var n,r,i,o=this[0],s=o&&o.attributes;if(void 0===e){if(this.length&&(i=st.get(o),1===o.nodeType&&!ot.get(o,"hasDataAttrs"))){for(n=s.length;n--;)s[n]&&0===(r=s[n].name).indexOf("data-")&&(r=nt(r.slice(5)),ct(o,r,i[r]));ot.set(o,"hasDataAttrs",!0)}return i}return"object"==typeof e?this.each((function(){st.set(this,e)})):Q(this,(function(t){var n;if(o&&void 0===t)return void 0!==(n=st.get(o,e))||void 0!==(n=ct(o,e))?n:void 0;this.each((function(){st.set(this,e,t)}))}),null,t,arguments.length>1,null,!0)},removeData:function(e){return this.each((function(){st.remove(this,e)}))}}),x.extend({queue:function(e,t,n){var r;if(e)return t=(t||"fx")+"queue",r=ot.get(e,t),n&&(!r||Array.isArray(n)?r=ot.set(e,t,x.makeArray(n)):r.push(n)),r||[]},dequeue:function(e,t){t=t||"fx";var n=x.queue(e,t),r=n.length,i=n.shift(),o=x._queueHooks(e,t);"inprogress"===i&&(i=n.shift(),r--),i&&("fx"===t&&n.unshift("inprogress"),delete o.stop,i.call(e,(function(){x.dequeue(e,t)}),o)),!r&&o&&o.empty.fire()},_queueHooks:function(e,t){var n=t+"queueHooks";return ot.get(e,n)||ot.set(e,n,{empty:x.Callbacks("once memory").add((function(){ot.remove(e,[t+"queue",n])}))})}}),x.fn.extend({queue:function(e,t){var n=2;return"string"!=typeof e&&(t=e,e="fx",n--),arguments.length<n?x.queue(this[0],e):void 0===t?this:this.each((function(){var n=x.queue(this,e,t);x._queueHooks(this,e),"fx"===e&&"inprogress"!==n[0]&&x.dequeue(this,e)}))},dequeue:function(e){return this.each((function(){x.dequeue(this,e)}))},clearQueue:function(e){return this.queue(e||"fx",[])},promise:function(e,t){var n,r=1,i=x.Deferred(),o=this,s=this.length,u=function(){--r||i.resolveWith(o,[o])};for("string"!=typeof e&&(t=e,e=void 0),e=e||"fx";s--;)(n=ot.get(o[s],e+"queueHooks"))&&n.empty&&(r++,n.empty.add(u));return u(),i.promise(t)}});var lt=/[+-]?(?:\d*\.|)\d+(?:[eE][+-]?\d+|)/.source,ft=new RegExp("^(?:([+-])=|)("+lt+")([a-z%]*)$","i"),pt=["Top","Right","Bottom","Left"];function ht(e,t){return"none"===(e=t||e).style.display||""===e.style.display&&"none"===x.css(e,"display")}var dt=/^[a-z]/,gt=/^(?:Border(?:Top|Right|Bottom|Left)?(?:Width|)|(?:Margin|Padding)?(?:Top|Right|Bottom|Left)?|(?:Min|Max)?(?:Width|Height))$/;function mt(e){return dt.test(e)&&gt.test(e[0].toUpperCase()+e.slice(1))}function yt(e,t,n,r){var i,o,s=20,u=r?function(){return r.cur()}:function(){return x.css(e,t,"")},a=u(),c=n&&n[3]||(mt(t)?"px":""),l=e.nodeType&&(!mt(t)||"px"!==c&&+a)&&ft.exec(x.css(e,t));if(l&&l[3]!==c){for(a/=2,c=c||l[3],l=+a||1;s--;)x.style(e,t,l+c),(1-o)*(1-(o=u()/a||.5))<=0&&(s=0),l/=o;l*=2,x.style(e,t,l+c),n=n||[]}return n&&(l=+l||+a||0,i=n[1]?l+(n[1]+1)*n[2]:+n[2],r&&(r.unit=c,r.start=l,r.end=i)),i}var vt=/^-ms-/;function bt(e){return nt(e.replace(vt,"ms-"))}var wt={};function Tt(e){var t,n=e.ownerDocument,r=e.nodeName,i=wt[r];return i||(t=n.body.appendChild(n.createElement(r)),i=x.css(t,"display"),t.parentNode.removeChild(t),"none"===i&&(i="block"),wt[r]=i,i)}function xt(e,t){for(var n,r,i=[],o=0,s=e.length;o<s;o++)(r=e[o]).style&&(n=r.style.display,t?("none"===n&&(i[o]=ot.get(r,"display")||null,i[o]||(r.style.display="")),""===r.style.display&&ht(r)&&(i[o]=Tt(r))):"none"!==n&&(i[o]="none",ot.set(r,"display",n)));for(o=0;o<s;o++)null!=i[o]&&(e[o].style.display=i[o]);return e}x.fn.extend({show:function(){return xt(this,!0)},hide:function(){return xt(this)},toggle:function(e){return"boolean"==typeof e?e?this.show():this.hide():this.each((function(){ht(this)?x(this).show():x(this).hide()}))}});var At=function(e){return x.contains(e.ownerDocument,e)||e.getRootNode(qt)===e.ownerDocument},qt={composed:!0};D.getRootNode||(At=function(e){return x.contains(e.ownerDocument,e)});var kt=/<([a-z][^\/\0>\x20\t\r\n\f]*)/i,_t={thead:["table"],col:["colgroup","table"],tr:["tbody","table"],td:["tr","tbody","table"]};function jt(e,t){var r;return r=void 0!==e.getElementsByTagName?n.slice.call(e.getElementsByTagName(t||"*")):void 0!==e.querySelectorAll?e.querySelectorAll(t||"*"):[],void 0===t||t&&A(e,t)?x.merge([e],r):r}_t.tbody=_t.tfoot=_t.colgroup=_t.caption=_t.thead,_t.th=_t.td;var Ut=/^$|^module$|\/(?:java|ecma)script/i;function St(e,t){for(var n=0,r=e.length;n<r;n++)ot.set(e[n],"globalEval",!t||ot.get(t[n],"globalEval"))}var Pt=/<|&#?\w+;/;function Et(e,t,r,i,o){for(var s,u,a,c,l,f,p=t.createDocumentFragment(),h=[],g=0,y=e.length;g<y;g++)if((s=e[g])||0===s)if("object"===d(s)&&(s.nodeType||m(s)))x.merge(h,s.nodeType?[s]:s);else if(Pt.test(s)){for(u=u||p.appendChild(t.createElement("div")),a=(kt.exec(s)||["",""])[1].toLowerCase(),f=(c=_t[a]||n).length;--f>-1;)u=u.appendChild(t.createElement(c[f]));u.innerHTML=x.htmlPrefilter(s),x.merge(h,u.childNodes),(u=p.firstChild).textContent=""}else h.push(t.createTextNode(s));for(p.textContent="",g=0;s=h[g++];)if(i&&x.inArray(s,i)>-1)o&&o.push(s);else if(l=At(s),u=jt(p.appendChild(s),"script"),l&&St(u),r)for(f=0;s=u[f++];)Ut.test(s.type||"")&&r.push(s);return p}function Ct(e){return e.type=(null!==e.getAttribute("type"))+"/"+e.type,e}function Dt(e){return"true/"===(e.type||"").slice(0,5)?e.type=e.type.slice(5):e.removeAttribute("type"),e}function Ot(e,t,n,r){t=o(t);var i,s,u,a,c,l,f=0,p=e.length,h=p-1,d=t[0];if("function"==typeof d)return e.each((function(i){var o=e.eq(i);t[0]=d.call(this,i,o.html()),Ot(o,t,n,r)}));if(p&&(s=(i=Et(t,e[0].ownerDocument,!1,e,r)).firstChild,1===i.childNodes.length&&(i=s),s||r)){for(a=(u=x.map(jt(i,"script"),Ct)).length;f<p;f++)c=i,f!==h&&(c=x.clone(c,!0,!0),a&&x.merge(u,jt(c,"script"))),n.call(e[f],c,f);if(a)for(l=u[u.length-1].ownerDocument,x.map(u,Dt),f=0;f<a;f++)c=u[f],Ut.test(c.type||"")&&!ot.get(c,"globalEval")&&x.contains(l,c)&&(c.src&&"module"!==(c.type||"").toLowerCase()?x._evalUrl&&!c.noModule&&x._evalUrl(c.src,{nonce:c.nonce,crossOrigin:c.crossOrigin},l):b(c.textContent,c,l))}return e}var Rt=/^(?:checkbox|radio)$/i,It=/^([^.]*)(?:\.(.+)|)/;function Nt(){return!0}function Bt(){return!1}function Mt(e,t,n,r,i,o){var s,u;if("object"==typeof t){for(u in"string"!=typeof n&&(r=r||n,n=void 0),t)Mt(e,u,n,r,t[u],o);return e}if(null==r&&null==i?(i=n,r=n=void 0):null==i&&("string"==typeof n?(i=r,r=void 0):(i=r,r=n,n=void 0)),!1===i)i=Bt;else if(!i)return e;return 1===o&&(s=i,i=function(e){return x().off(e),s.apply(this,arguments)},i.guid=s.guid||(s.guid=x.guid++)),e.each((function(){x.event.add(this,t,i,r,n)}))}function Kt(e,t,n){n?(ot.set(e,t,!1),x.event.add(e,t,{namespace:!1,handler:function(e){var n,r=ot.get(this,t);if(1&e.isTrigger&&this[t]){if(r.length)(x.event.special[t]||{}).delegateType&&e.stopPropagation();else if(r=i.call(arguments),ot.set(this,t,r),this[t](),n=ot.get(this,t),ot.set(this,t,!1),r!==n)return e.stopImmediatePropagation(),e.preventDefault(),n&&n.value}else r.length&&(ot.set(this,t,{value:x.event.trigger(r[0],r.slice(1),this)}),e.stopPropagation(),e.isImmediatePropagationStopped=Nt)}})):void 0===ot.get(e,t)&&x.event.add(e,t,Nt)}x.event={add:function(e,t,n,r,i){var o,s,u,a,c,l,f,p,h,d,g,m=ot.get(e);if(rt(e))for(n.handler&&(n=(o=n).handler,i=o.selector),i&&x.find.matchesSelector(D,i),n.guid||(n.guid=x.guid++),(a=m.events)||(a=m.events=Object.create(null)),(s=m.handle)||(s=m.handle=function(t){return void 0!==x&&x.event.triggered!==t.type?x.event.dispatch.apply(e,arguments):void 0}),c=(t=(t||"").match(J)||[""]).length;c--;)h=g=(u=It.exec(t[c])||[])[1],d=(u[2]||"").split(".").sort(),h&&(f=x.event.special[h]||{},h=(i?f.delegateType:f.bindType)||h,f=x.event.special[h]||{},l=x.extend({type:h,origType:g,data:r,handler:n,guid:n.guid,selector:i,needsContext:i&&x.expr.match.needsContext.test(i),namespace:d.join(".")},o),(p=a[h])||((p=a[h]=[]).delegateCount=0,f.setup&&!1!==f.setup.call(e,r,d,s)||e.addEventListener&&e.addEventListener(h,s)),f.add&&(f.add.call(e,l),l.handler.guid||(l.handler.guid=n.guid)),i?p.splice(p.delegateCount++,0,l):p.push(l))},remove:function(e,t,n,r,i){var o,s,u,a,c,l,f,p,h,d,g,m=ot.hasData(e)&&ot.get(e);if(m&&(a=m.events)){for(c=(t=(t||"").match(J)||[""]).length;c--;)if(h=g=(u=It.exec(t[c])||[])[1],d=(u[2]||"").split(".").sort(),h){for(f=x.event.special[h]||{},p=a[h=(r?f.delegateType:f.bindType)||h]||[],u=u[2]&&new RegExp("(^|\\.)"+d.join("\\.(?:.*\\.|)")+"(\\.|$)"),s=o=p.length;o--;)l=p[o],!i&&g!==l.origType||n&&n.guid!==l.guid||u&&!u.test(l.namespace)||r&&r!==l.selector&&("**"!==r||!l.selector)||(p.splice(o,1),l.selector&&p.delegateCount--,f.remove&&f.remove.call(e,l));s&&!p.length&&(f.teardown&&!1!==f.teardown.call(e,d,m.handle)||x.removeEvent(e,h,m.handle),delete a[h])}else for(h in a)x.event.remove(e,h+t[c],n,r,!0);x.isEmptyObject(a)&&ot.remove(e,"handle events")}},dispatch:function(e){var t,n,r,i,o,s,u=new Array(arguments.length),a=x.event.fix(e),c=(ot.get(this,"events")||Object.create(null))[a.type]||[],l=x.event.special[a.type]||{};for(u[0]=a,t=1;t<arguments.length;t++)u[t]=arguments[t];if(a.delegateTarget=this,!l.preDispatch||!1!==l.preDispatch.call(this,a)){for(s=x.event.handlers.call(this,a,c),t=0;(i=s[t++])&&!a.isPropagationStopped();)for(a.currentTarget=i.elem,n=0;(o=i.handlers[n++])&&!a.isImmediatePropagationStopped();)a.rnamespace&&!1!==o.namespace&&!a.rnamespace.test(o.namespace)||(a.handleObj=o,a.data=o.data,void 0!==(r=((x.event.special[o.origType]||{}).handle||o.handler).apply(i.elem,u))&&!1===(a.result=r)&&(a.preventDefault(),a.stopPropagation()));return l.postDispatch&&l.postDispatch.call(this,a),a.result}},handlers:function(e,t){var n,r,i,o,s,u=[],a=t.delegateCount,c=e.target;if(a&&!("click"===e.type&&e.button>=1))for(;c!==this;c=c.parentNode||this)if(1===c.nodeType&&("click"!==e.type||!0!==c.disabled)){for(o=[],s={},n=0;n<a;n++)void 0===s[i=(r=t[n]).selector+" "]&&(s[i]=r.needsContext?x(i,this).index(c)>-1:x.find(i,this,null,[c]).length),s[i]&&o.push(r);o.length&&u.push({elem:c,handlers:o})}return c=this,a<t.length&&u.push({elem:c,handlers:t.slice(a)}),u},addProp:function(e,t){Object.defineProperty(x.Event.prototype,e,{enumerable:!0,configurable:!0,get:"function"==typeof t?function(){if(this.originalEvent)return t(this.originalEvent)}:function(){if(this.originalEvent)return this.originalEvent[e]},set:function(t){Object.defineProperty(this,e,{enumerable:!0,configurable:!0,writable:!0,value:t})}})},fix:function(e){return e[x.expando]?e:new x.Event(e)},special:x.extend(Object.create(null),{load:{noBubble:!0},click:{setup:function(e){var t=this||e;return Rt.test(t.type)&&t.click&&A(t,"input")&&Kt(t,"click",!0),!1},trigger:function(e){var t=this||e;return Rt.test(t.type)&&t.click&&A(t,"input")&&Kt(t,"click"),!0},_default:function(e){var t=e.target;return Rt.test(t.type)&&t.click&&A(t,"input")&&ot.get(t,"click")||A(t,"a")}},beforeunload:{postDispatch:function(e){void 0!==e.result&&e.preventDefault()}}})},x.removeEvent=function(e,t,n){e.removeEventListener&&e.removeEventListener(t,n)},x.Event=function(e,t){if(!(this instanceof x.Event))return new x.Event(e,t);e&&e.type?(this.originalEvent=e,this.type=e.type,this.isDefaultPrevented=e.defaultPrevented?Nt:Bt,this.target=e.target,this.currentTarget=e.currentTarget,this.relatedTarget=e.relatedTarget):this.type=e,t&&x.extend(this,t),this.timeStamp=e&&e.timeStamp||Date.now(),this[x.expando]=!0},x.Event.prototype={constructor:x.Event,isDefaultPrevented:Bt,isPropagationStopped:Bt,isImmediatePropagationStopped:Bt,isSimulated:!1,preventDefault:function(){var e=this.originalEvent;this.isDefaultPrevented=Nt,e&&!this.isSimulated&&e.preventDefault()},stopPropagation:function(){var e=this.originalEvent;this.isPropagationStopped=Nt,e&&!this.isSimulated&&e.stopPropagation()},stopImmediatePropagation:function(){var e=this.originalEvent;this.isImmediatePropagationStopped=Nt,e&&!this.isSimulated&&e.stopImmediatePropagation(),this.stopPropagation()}},x.each({altKey:!0,bubbles:!0,cancelable:!0,changedTouches:!0,ctrlKey:!0,detail:!0,eventPhase:!0,metaKey:!0,pageX:!0,pageY:!0,shiftKey:!0,view:!0,char:!0,code:!0,charCode:!0,key:!0,keyCode:!0,button:!0,buttons:!0,clientX:!0,clientY:!0,offsetX:!0,offsetY:!0,pointerId:!0,pointerType:!0,screenX:!0,screenY:!0,targetTouches:!0,toElement:!0,touches:!0,which:!0},x.event.addProp),x.each({focus:"focusin",blur:"focusout"},(function(e,t){function n(e){var t=x.event.fix(e);t.type="focusin"===e.type?"focus":"blur",t.isSimulated=!0,t.target===t.currentTarget&&ot.get(this,"handle")(t)}x.event.special[e]={setup:function(){if(Kt(this,e,!0),!_)return!1;this.addEventListener(t,n)},trigger:function(){return Kt(this,e),!0},teardown:function(){if(!_)return!1;this.removeEventListener(t,n)},_default:function(t){return ot.get(t.target,e)},delegateType:t}})),x.each({mouseenter:"mouseover",mouseleave:"mouseout",pointerenter:"pointerover",pointerleave:"pointerout"},(function(e,t){x.event.special[e]={delegateType:t,bindType:t,handle:function(e){var n,r=e.relatedTarget,i=e.handleObj;return r&&(r===this||x.contains(this,r))||(e.type=i.origType,n=i.handler.apply(this,arguments),e.type=t),n}}})),x.fn.extend({on:function(e,t,n,r){return Mt(this,e,t,n,r)},one:function(e,t,n,r){return Mt(this,e,t,n,r,1)},off:function(e,t,n){var r,i;if(e&&e.preventDefault&&e.handleObj)return r=e.handleObj,x(e.delegateTarget).off(r.namespace?r.origType+"."+r.namespace:r.origType,r.selector,r.handler),this;if("object"==typeof e){for(i in e)this.off(i,t,e[i]);return this}return!1!==t&&"function"!=typeof t||(n=t,t=void 0),!1===n&&(n=Bt),this.each((function(){x.event.remove(this,e,n,t)}))}});var Lt=/<script|<style|<link/i;function Ft(e,t){return A(e,"table")&&A(11!==t.nodeType?t:t.firstChild,"tr")&&x(e).children("tbody")[0]||e}function Ht(e,t){var n,r,i,o=ot.get(e,"events");if(1===t.nodeType){if(o)for(n in ot.remove(t,"handle events"),o)for(r=0,i=o[n].length;r<i;r++)x.event.add(t,n,o[n][r]);st.hasData(e)&&st.set(t,x.extend({},st.get(e)))}}function Wt(e,t,n){for(var r,i=t?x.filter(t,e):e,o=0;null!=(r=i[o]);o++)n||1!==r.nodeType||x.cleanData(jt(r)),r.parentNode&&(n&&At(r)&&St(jt(r,"script")),r.parentNode.removeChild(r));return e}x.extend({htmlPrefilter:function(e){return e},clone:function(e,t,n){var r,i,o,s,u=e.cloneNode(!0),a=At(e);if(_&&(1===e.nodeType||11===e.nodeType)&&!x.isXMLDoc(e))for(s=jt(u),r=0,i=(o=jt(e)).length;r<i;r++)A(s[r],"textarea")&&(s[r].defaultValue=o[r].defaultValue);if(t)if(n)for(o=o||jt(e),s=s||jt(u),r=0,i=o.length;r<i;r++)Ht(o[r],s[r]);else Ht(e,u);return(s=jt(u,"script")).length>0&&St(s,!a&&jt(e,"script")),u},cleanData:function(e){for(var t,n,r,i=x.event.special,o=0;void 0!==(n=e[o]);o++)if(rt(n)){if(t=n[ot.expando]){if(t.events)for(r in t.events)i[r]?x.event.remove(n,r):x.removeEvent(n,r,t.handle);n[ot.expando]=void 0}n[st.expando]&&(n[st.expando]=void 0)}}}),x.fn.extend({detach:function(e){return Wt(this,e,!0)},remove:function(e){return Wt(this,e)},text:function(e){return Q(this,(function(e){return void 0===e?x.text(this):this.empty().each((function(){1!==this.nodeType&&11!==this.nodeType&&9!==this.nodeType||(this.textContent=e)}))}),null,e,arguments.length)},append:function(){return Ot(this,arguments,(function(e){1!==this.nodeType&&11!==this.nodeType&&9!==this.nodeType||Ft(this,e).appendChild(e)}))},prepend:function(){return Ot(this,arguments,(function(e){if(1===this.nodeType||11===this.nodeType||9===this.nodeType){var t=Ft(this,e);t.insertBefore(e,t.firstChild)}}))},before:function(){return Ot(this,arguments,(function(e){this.parentNode&&this.parentNode.insertBefore(e,this)}))},after:function(){return Ot(this,arguments,(function(e){this.parentNode&&this.parentNode.insertBefore(e,this.nextSibling)}))},empty:function(){for(var e,t=0;null!=(e=this[t]);t++)1===e.nodeType&&(x.cleanData(jt(e,!1)),e.textContent="");return this},clone:function(e,t){return e=null!=e&&e,t=null==t?e:t,this.map((function(){return x.clone(this,e,t)}))},html:function(e){return Q(this,(function(e){var t=this[0]||{},n=0,r=this.length;if(void 0===e&&1===t.nodeType)return t.innerHTML;if("string"==typeof e&&!Lt.test(e)&&!_t[(kt.exec(e)||["",""])[1].toLowerCase()]){e=x.htmlPrefilter(e);try{for(;n<r;n++)1===(t=this[n]||{}).nodeType&&(x.cleanData(jt(t,!1)),t.innerHTML=e);t=0}catch(e){}}t&&this.empty().append(e)}),null,e,arguments.length)},replaceWith:function(){var e=[];return Ot(this,arguments,(function(t){var n=this.parentNode;x.inArray(this,e)<0&&(x.cleanData(jt(this)),n&&n.replaceChild(t,this))}),e)}}),x.each({appendTo:"append",prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},(function(e,t){x.fn[e]=function(e){for(var n,r=[],i=x(e),o=i.length-1,u=0;u<=o;u++)n=u===o?this:this.clone(!0),x(i[u])[t](n),s.apply(r,n);return this.pushStack(r)}}));var Gt=new RegExp("^("+lt+")(?!px)[a-z%]+$","i"),zt=/^--/;function $t(t){var n=t.ownerDocument.defaultView;return n||(n=e),n.getComputedStyle(t)}function Vt(e,t,n){var r,i=zt.test(t);return(n=n||$t(e))&&(r=n.getPropertyValue(t)||n[t],i&&r&&(r=r.replace(U,"$1")||void 0),""!==r||At(e)||(r=x.style(e,t))),void 0!==r?r+"":r}var Xt=["Webkit","Moz","ms"],Qt=y.createElement("div").style;function Jt(e){return e in Qt?e:function(e){for(var t=e[0].toUpperCase()+e.slice(1),n=Xt.length;n--;)if((e=Xt[n]+t)in Qt)return e}(e)||e}var Yt,Zt,en=y.createElement("table");function tn(){if(en&&en.style){var t,n=y.createElement("col"),r=y.createElement("tr"),i=y.createElement("td");en.style.cssText="position:absolute;left:-11111px;border-collapse:separate;border-spacing:0",r.style.cssText="box-sizing:content-box;border:1px solid;height:1px",i.style.cssText="height:9px;width:9px;padding:0",n.span=2,D.appendChild(en).appendChild(n).parentNode.appendChild(r).appendChild(i).parentNode.appendChild(i.cloneNode(!0)),0!==en.offsetWidth?(t=e.getComputedStyle(r),Zt=_||18===Math.round(parseFloat(e.getComputedStyle(n).width)),Yt=Math.round(parseFloat(t.height)+parseFloat(t.borderTopWidth)+parseFloat(t.borderBottomWidth))===r.offsetHeight,D.removeChild(en),en=null):D.removeChild(en)}}x.extend(h,{reliableTrDimensions:function(){return tn(),Yt},reliableColDimensions:function(){return tn(),Zt}});var nn={position:"absolute",visibility:"hidden",display:"block"},rn={letterSpacing:"0",fontWeight:"400"};function on(e,t,n){var r=ft.exec(t);return r?Math.max(0,r[2]-(n||0))+(r[3]||"px"):t}function sn(e,t,n,r,i,o){var s="width"===t?1:0,u=0,a=0,c=0;if(n===(r?"border":"content"))return 0;for(;s<4;s+=2)"margin"===n&&(c+=x.css(e,n+pt[s],!0,i)),r?("content"===n&&(a-=x.css(e,"padding"+pt[s],!0,i)),"margin"!==n&&(a-=x.css(e,"border"+pt[s]+"Width",!0,i))):(a+=x.css(e,"padding"+pt[s],!0,i),"padding"!==n?a+=x.css(e,"border"+pt[s]+"Width",!0,i):u+=x.css(e,"border"+pt[s]+"Width",!0,i));return!r&&o>=0&&(a+=Math.max(0,Math.ceil(e["offset"+t[0].toUpperCase()+t.slice(1)]-o-a-u-.5))||0),a+c}function un(e,t,n){var r=$t(e),i=(_||n)&&"border-box"===x.css(e,"boxSizing",!1,r),o=i,s=Vt(e,t,r),u="offset"+t[0].toUpperCase()+t.slice(1);if(Gt.test(s)){if(!n)return s;s="auto"}return("auto"===s||_&&i||!h.reliableColDimensions()&&A(e,"col")||!h.reliableTrDimensions()&&A(e,"tr"))&&e.getClientRects().length&&(i="border-box"===x.css(e,"boxSizing",!1,r),(o=u in e)&&(s=e[u])),(s=parseFloat(s)||0)+sn(e,t,n||(i?"border":"content"),o,r,s)+"px"}function an(e,t,n,r,i){return new an.prototype.init(e,t,n,r,i)}x.extend({cssHooks:{},style:function(e,t,n,r){if(e&&3!==e.nodeType&&8!==e.nodeType&&e.style){var i,o,s,u=bt(t),a=zt.test(t),c=e.style;if(a||(t=Jt(u)),s=x.cssHooks[t]||x.cssHooks[u],void 0===n)return s&&"get"in s&&void 0!==(i=s.get(e,!1,r))?i:c[t];"string"===(o=typeof n)&&(i=ft.exec(n))&&i[1]&&(n=yt(e,t,i),o="number"),null!=n&&n==n&&("number"===o&&(n+=i&&i[3]||(mt(u)?"px":"")),_&&""===n&&0===t.indexOf("background")&&(c[t]="inherit"),s&&"set"in s&&void 0===(n=s.set(e,n,r))||(a?c.setProperty(t,n):c[t]=n))}},css:function(e,t,n,r){var i,o,s,u=bt(t);return zt.test(t)||(t=Jt(u)),(s=x.cssHooks[t]||x.cssHooks[u])&&"get"in s&&(i=s.get(e,!0,n)),void 0===i&&(i=Vt(e,t,r)),"normal"===i&&t in rn&&(i=rn[t]),""===n||n?(o=parseFloat(i),!0===n||isFinite(o)?o||0:i):i}}),x.each(["height","width"],(function(e,t){x.cssHooks[t]={get:function(e,n,r){if(n)return"none"===x.css(e,"display")?function(e,t,n){var r,i,o={};for(i in t)o[i]=e.style[i],e.style[i]=t[i];for(i in r=n.call(e),t)e.style[i]=o[i];return r}(e,nn,(function(){return un(e,t,r)})):un(e,t,r)},set:function(e,n,r){var i,o=$t(e),s=r&&"border-box"===x.css(e,"boxSizing",!1,o),u=r?sn(e,t,r,s,o):0;return u&&(i=ft.exec(n))&&"px"!==(i[3]||"px")&&(e.style[t]=n,n=x.css(e,t)),on(0,n,u)}}})),x.each({margin:"",padding:"",border:"Width"},(function(e,t){x.cssHooks[e+t]={expand:function(n){for(var r=0,i={},o="string"==typeof n?n.split(" "):[n];r<4;r++)i[e+pt[r]+t]=o[r]||o[r-2]||o[0];return i}},"margin"!==e&&(x.cssHooks[e+t].set=on)})),x.fn.extend({css:function(e,t){return Q(this,(function(e,t,n){var r,i,o={},s=0;if(Array.isArray(t)){for(r=$t(e),i=t.length;s<i;s++)o[t[s]]=x.css(e,t[s],!1,r);return o}return void 0!==n?x.style(e,t,n):x.css(e,t)}),e,t,arguments.length>1)}}),x.Tween=an,an.prototype={constructor:an,init:function(e,t,n,r,i,o){this.elem=e,this.prop=n,this.easing=i||x.easing._default,this.options=t,this.start=this.now=this.cur(),this.end=r,this.unit=o||(mt(n)?"px":"")},cur:function(){var e=an.propHooks[this.prop];return e&&e.get?e.get(this):an.propHooks._default.get(this)},run:function(e){var t,n=an.propHooks[this.prop];return this.options.duration?this.pos=t=x.easing[this.easing](e,this.options.duration*e,0,1,this.options.duration):this.pos=t=e,this.now=(this.end-this.start)*t+this.start,this.options.step&&this.options.step.call(this.elem,this.now,this),n&&n.set?n.set(this):an.propHooks._default.set(this),this}},an.prototype.init.prototype=an.prototype,an.propHooks={_default:{get:function(e){var t;return 1!==e.elem.nodeType||null!=e.elem[e.prop]&&null==e.elem.style[e.prop]?e.elem[e.prop]:(t=x.css(e.elem,e.prop,""))&&"auto"!==t?t:0},set:function(e){x.fx.step[e.prop]?x.fx.step[e.prop](e):1!==e.elem.nodeType||!x.cssHooks[e.prop]&&null==e.elem.style[Jt(e.prop)]?e.elem[e.prop]=e.now:x.style(e.elem,e.prop,e.now+e.unit)}}},x.easing={linear:function(e){return e},swing:function(e){return.5-Math.cos(e*Math.PI)/2},_default:"swing"},x.fx=an.prototype.init,x.fx.step={};var cn,ln,fn=/^(?:toggle|show|hide)$/,pn=/queueHooks$/;function hn(){ln&&(!1===y.hidden&&e.requestAnimationFrame?e.requestAnimationFrame(hn):e.setTimeout(hn,13),x.fx.tick())}function dn(){return e.setTimeout((function(){cn=void 0})),cn=Date.now()}function gn(e,t){var n,r=0,i={height:e};for(t=t?1:0;r<4;r+=2-t)i["margin"+(n=pt[r])]=i["padding"+n]=e;return t&&(i.opacity=i.width=e),i}function mn(e,t,n){for(var r,i=(yn.tweeners[t]||[]).concat(yn.tweeners["*"]),o=0,s=i.length;o<s;o++)if(r=i[o].call(n,t,e))return r}function yn(e,t,n){var r,i,o=0,s=yn.prefilters.length,u=x.Deferred().always((function(){delete a.elem})),a=function(){if(i)return!1;for(var t=cn||dn(),n=Math.max(0,c.startTime+c.duration-t),r=1-(n/c.duration||0),o=0,s=c.tweens.length;o<s;o++)c.tweens[o].run(r);return u.notifyWith(e,[c,r,n]),r<1&&s?n:(s||u.notifyWith(e,[c,1,0]),u.resolveWith(e,[c]),!1)},c=u.promise({elem:e,props:x.extend({},t),opts:x.extend(!0,{specialEasing:{},easing:x.easing._default},n),originalProperties:t,originalOptions:n,startTime:cn||dn(),duration:n.duration,tweens:[],createTween:function(t,n){var r=x.Tween(e,c.opts,t,n,c.opts.specialEasing[t]||c.opts.easing);return c.tweens.push(r),r},stop:function(t){var n=0,r=t?c.tweens.length:0;if(i)return this;for(i=!0;n<r;n++)c.tweens[n].run(1);return t?(u.notifyWith(e,[c,1,0]),u.resolveWith(e,[c,t])):u.rejectWith(e,[c,t]),this}}),l=c.props;for(!function(e,t){var n,r,i,o,s;for(n in e)if(i=t[r=bt(n)],o=e[n],Array.isArray(o)&&(i=o[1],o=e[n]=o[0]),n!==r&&(e[r]=o,delete e[n]),(s=x.cssHooks[r])&&"expand"in s)for(n in o=s.expand(o),delete e[r],o)n in e||(e[n]=o[n],t[n]=i);else t[r]=i}(l,c.opts.specialEasing);o<s;o++)if(r=yn.prefilters[o].call(c,e,l,c.opts))return"function"==typeof r.stop&&(x._queueHooks(c.elem,c.opts.queue).stop=r.stop.bind(r)),r;return x.map(l,mn,c),"function"==typeof c.opts.start&&c.opts.start.call(e,c),c.progress(c.opts.progress).done(c.opts.done,c.opts.complete).fail(c.opts.fail).always(c.opts.always),x.fx.timer(x.extend(a,{elem:e,anim:c,queue:c.opts.queue})),c}x.Animation=x.extend(yn,{tweeners:{"*":[function(e,t){var n=this.createTween(e,t);return yt(n.elem,e,ft.exec(t),n),n}]},tweener:function(e,t){"function"==typeof e?(t=e,e=["*"]):e=e.match(J);for(var n,r=0,i=e.length;r<i;r++)n=e[r],yn.tweeners[n]=yn.tweeners[n]||[],yn.tweeners[n].unshift(t)},prefilters:[function(e,t,n){var r,i,o,s,u,a,c,l,f="width"in t||"height"in t,p=this,h={},d=e.style,g=e.nodeType&&ht(e),m=ot.get(e,"fxshow");for(r in n.queue||(null==(s=x._queueHooks(e,"fx")).unqueued&&(s.unqueued=0,u=s.empty.fire,s.empty.fire=function(){s.unqueued||u()}),s.unqueued++,p.always((function(){p.always((function(){s.unqueued--,x.queue(e,"fx").length||s.empty.fire()}))}))),t)if(i=t[r],fn.test(i)){if(delete t[r],o=o||"toggle"===i,i===(g?"hide":"show")){if("show"!==i||!m||void 0===m[r])continue;g=!0}h[r]=m&&m[r]||x.style(e,r)}if((a=!x.isEmptyObject(t))||!x.isEmptyObject(h))for(r in f&&1===e.nodeType&&(n.overflow=[d.overflow,d.overflowX,d.overflowY],null==(c=m&&m.display)&&(c=ot.get(e,"display")),"none"===(l=x.css(e,"display"))&&(c?l=c:(xt([e],!0),c=e.style.display||c,l=x.css(e,"display"),xt([e]))),("inline"===l||"inline-block"===l&&null!=c)&&"none"===x.css(e,"float")&&(a||(p.done((function(){d.display=c})),null==c&&(l=d.display,c="none"===l?"":l)),d.display="inline-block")),n.overflow&&(d.overflow="hidden",p.always((function(){d.overflow=n.overflow[0],d.overflowX=n.overflow[1],d.overflowY=n.overflow[2]}))),a=!1,h)a||(m?"hidden"in m&&(g=m.hidden):m=ot.set(e,"fxshow",{display:c}),o&&(m.hidden=!g),g&&xt([e],!0),p.done((function(){for(r in g||xt([e]),ot.remove(e,"fxshow"),h)x.style(e,r,h[r])}))),a=mn(g?m[r]:0,r,p),r in m||(m[r]=a.start,g&&(a.end=a.start,a.start=0))}],prefilter:function(e,t){t?yn.prefilters.unshift(e):yn.prefilters.push(e)}}),x.speed=function(e,t,n){var r=e&&"object"==typeof e?x.extend({},e):{complete:n||t||"function"==typeof e&&e,duration:e,easing:n&&t||t&&"function"!=typeof t&&t};return x.fx.off?r.duration=0:"number"!=typeof r.duration&&(r.duration in x.fx.speeds?r.duration=x.fx.speeds[r.duration]:r.duration=x.fx.speeds._default),null!=r.queue&&!0!==r.queue||(r.queue="fx"),r.old=r.complete,r.complete=function(){"function"==typeof r.old&&r.old.call(this),r.queue&&x.dequeue(this,r.queue)},r},x.fn.extend({fadeTo:function(e,t,n,r){return this.filter(ht).css("opacity",0).show().end().animate({opacity:t},e,n,r)},animate:function(e,t,n,r){var i=x.isEmptyObject(e),o=x.speed(t,n,r),s=function(){var t=yn(this,x.extend({},e),o);(i||ot.get(this,"finish"))&&t.stop(!0)};return s.finish=s,i||!1===o.queue?this.each(s):this.queue(o.queue,s)},stop:function(e,t,n){var r=function(e){var t=e.stop;delete e.stop,t(n)};return"string"!=typeof e&&(n=t,t=e,e=void 0),t&&this.queue(e||"fx",[]),this.each((function(){var t=!0,i=null!=e&&e+"queueHooks",o=x.timers,s=ot.get(this);if(i)s[i]&&s[i].stop&&r(s[i]);else for(i in s)s[i]&&s[i].stop&&pn.test(i)&&r(s[i]);for(i=o.length;i--;)o[i].elem!==this||null!=e&&o[i].queue!==e||(o[i].anim.stop(n),t=!1,o.splice(i,1));!t&&n||x.dequeue(this,e)}))},finish:function(e){return!1!==e&&(e=e||"fx"),this.each((function(){var t,n=ot.get(this),r=n[e+"queue"],i=n[e+"queueHooks"],o=x.timers,s=r?r.length:0;for(n.finish=!0,x.queue(this,e,[]),i&&i.stop&&i.stop.call(this,!0),t=o.length;t--;)o[t].elem===this&&o[t].queue===e&&(o[t].anim.stop(!0),o.splice(t,1));for(t=0;t<s;t++)r[t]&&r[t].finish&&r[t].finish.call(this);delete n.finish}))}}),x.each(["toggle","show","hide"],(function(e,t){var n=x.fn[t];x.fn[t]=function(e,r,i){return null==e||"boolean"==typeof e?n.apply(this,arguments):this.animate(gn(t,!0),e,r,i)}})),x.each({slideDown:gn("show"),slideUp:gn("hide"),slideToggle:gn("toggle"),fadeIn:{opacity:"show"},fadeOut:{opacity:"hide"},fadeToggle:{opacity:"toggle"}},(function(e,t){x.fn[e]=function(e,n,r){return this.animate(t,e,n,r)}})),x.timers=[],x.fx.tick=function(){var e,t=0,n=x.timers;for(cn=Date.now();t<n.length;t++)(e=n[t])()||n[t]!==e||n.splice(t--,1);n.length||x.fx.stop(),cn=void 0},x.fx.timer=function(e){x.timers.push(e),x.fx.start()},x.fx.start=function(){ln||(ln=!0,hn())},x.fx.stop=function(){ln=null},x.fx.speeds={slow:600,fast:200,_default:400},x.fn.delay=function(t,n){return t=x.fx&&x.fx.speeds[t]||t,n=n||"fx",this.queue(n,(function(n,r){var i=e.setTimeout(n,t);r.stop=function(){e.clearTimeout(i)}}))};var vn=/^(?:input|select|textarea|button)$/i,bn=/^(?:a|area)$/i;function wn(e){return(e.match(J)||[]).join(" ")}function Tn(e){return e.getAttribute&&e.getAttribute("class")||""}function xn(e){return Array.isArray(e)?e:"string"==typeof e&&e.match(J)||[]}x.fn.extend({prop:function(e,t){return Q(this,x.prop,e,t,arguments.length>1)},removeProp:function(e){return this.each((function(){delete this[x.propFix[e]||e]}))}}),x.extend({prop:function(e,t,n){var r,i,o=e.nodeType;if(3!==o&&8!==o&&2!==o)return 1===o&&x.isXMLDoc(e)||(t=x.propFix[t]||t,i=x.propHooks[t]),void 0!==n?i&&"set"in i&&void 0!==(r=i.set(e,n,t))?r:e[t]=n:i&&"get"in i&&null!==(r=i.get(e,t))?r:e[t]},propHooks:{tabIndex:{get:function(e){var t=e.getAttribute("tabindex");return t?parseInt(t,10):vn.test(e.nodeName)||bn.test(e.nodeName)&&e.href?0:-1}}},propFix:{for:"htmlFor",class:"className"}}),_&&(x.propHooks.selected={get:function(e){var t=e.parentNode;return t&&t.parentNode&&t.parentNode.selectedIndex,null},set:function(e){var t=e.parentNode;t&&(t.selectedIndex,t.parentNode&&t.parentNode.selectedIndex)}}),x.each(["tabIndex","readOnly","maxLength","cellSpacing","cellPadding","rowSpan","colSpan","useMap","frameBorder","contentEditable"],(function(){x.propFix[this.toLowerCase()]=this})),x.fn.extend({addClass:function(e){var t,n,r,i,o,s;return"function"==typeof e?this.each((function(t){x(this).addClass(e.call(this,t,Tn(this)))})):(t=xn(e)).length?this.each((function(){if(r=Tn(this),n=1===this.nodeType&&" "+wn(r)+" "){for(o=0;o<t.length;o++)i=t[o],n.indexOf(" "+i+" ")<0&&(n+=i+" ");s=wn(n),r!==s&&this.setAttribute("class",s)}})):this},removeClass:function(e){var t,n,r,i,o,s;return"function"==typeof e?this.each((function(t){x(this).removeClass(e.call(this,t,Tn(this)))})):arguments.length?(t=xn(e)).length?this.each((function(){if(r=Tn(this),n=1===this.nodeType&&" "+wn(r)+" "){for(o=0;o<t.length;o++)for(i=t[o];n.indexOf(" "+i+" ")>-1;)n=n.replace(" "+i+" "," ");s=wn(n),r!==s&&this.setAttribute("class",s)}})):this:this.attr("class","")},toggleClass:function(e,t){var n,r,i,o;return"function"==typeof e?this.each((function(n){x(this).toggleClass(e.call(this,n,Tn(this),t),t)})):"boolean"==typeof t?t?this.addClass(e):this.removeClass(e):(n=xn(e)).length?this.each((function(){for(o=x(this),i=0;i<n.length;i++)r=n[i],o.hasClass(r)?o.removeClass(r):o.addClass(r)})):this},hasClass:function(e){var t,n,r=0;for(t=" "+e+" ";n=this[r++];)if(1===n.nodeType&&(" "+wn(Tn(n))+" ").indexOf(t)>-1)return!0;return!1}}),x.fn.extend({val:function(e){var t,n,r,i=this[0];return arguments.length?(r="function"==typeof e,this.each((function(n){var i;1===this.nodeType&&(null==(i=r?e.call(this,n,x(this).val()):e)?i="":"number"==typeof i?i+="":Array.isArray(i)&&(i=x.map(i,(function(e){return null==e?"":e+""}))),(t=x.valHooks[this.type]||x.valHooks[this.nodeName.toLowerCase()])&&"set"in t&&void 0!==t.set(this,i,"value")||(this.value=i))}))):i?(t=x.valHooks[i.type]||x.valHooks[i.nodeName.toLowerCase()])&&"get"in t&&void 0!==(n=t.get(i,"value"))?n:null==(n=i.value)?"":n:void 0}}),x.extend({valHooks:{select:{get:function(e){var t,n,r,i=e.options,o=e.selectedIndex,s="select-one"===e.type,u=s?null:[],a=s?o+1:i.length;for(r=o<0?a:s?o:0;r<a;r++)if((n=i[r]).selected&&!n.disabled&&(!n.parentNode.disabled||!A(n.parentNode,"optgroup"))){if(t=x(n).val(),s)return t;u.push(t)}return u},set:function(e,t){for(var n,r,i=e.options,o=x.makeArray(t),s=i.length;s--;)((r=i[s]).selected=x.inArray(x(r).val(),o)>-1)&&(n=!0);return n||(e.selectedIndex=-1),o}}}}),_&&(x.valHooks.option={get:function(e){var t=e.getAttribute("value");return null!=t?t:wn(x.text(e))}}),x.each(["radio","checkbox"],(function(){x.valHooks[this]={set:function(e,t){if(Array.isArray(t))return e.checked=x.inArray(x(e).val(),t)>-1}}}));var An=/^(?:focusinfocus|focusoutblur)$/,qn=function(e){e.stopPropagation()};x.extend(x.event,{trigger:function(t,n,r,i){var o,s,u,a,c,f,p,h,d=[r||y],m=l.call(t,"type")?t.type:t,v=l.call(t,"namespace")?t.namespace.split("."):[];if(s=h=u=r=r||y,3!==r.nodeType&&8!==r.nodeType&&!An.test(m+x.event.triggered)&&(m.indexOf(".")>-1&&(v=m.split("."),m=v.shift(),v.sort()),c=m.indexOf(":")<0&&"on"+m,(t=t[x.expando]?t:new x.Event(m,"object"==typeof t&&t)).isTrigger=i?2:3,t.namespace=v.join("."),t.rnamespace=t.namespace?new RegExp("(^|\\.)"+v.join("\\.(?:.*\\.|)")+"(\\.|$)"):null,t.result=void 0,t.target||(t.target=r),n=null==n?[t]:x.makeArray(n,[t]),p=x.event.special[m]||{},i||!p.trigger||!1!==p.trigger.apply(r,n))){if(!i&&!p.noBubble&&!g(r)){for(a=p.delegateType||m,An.test(a+m)||(s=s.parentNode);s;s=s.parentNode)d.push(s),u=s;u===(r.ownerDocument||y)&&d.push(u.defaultView||u.parentWindow||e)}for(o=0;(s=d[o++])&&!t.isPropagationStopped();)h=s,t.type=o>1?a:p.bindType||m,(f=(ot.get(s,"events")||Object.create(null))[t.type]&&ot.get(s,"handle"))&&f.apply(s,n),(f=c&&s[c])&&f.apply&&rt(s)&&(t.result=f.apply(s,n),!1===t.result&&t.preventDefault());return t.type=m,i||t.isDefaultPrevented()||p._default&&!1!==p._default.apply(d.pop(),n)||!rt(r)||c&&"function"==typeof r[m]&&!g(r)&&((u=r[c])&&(r[c]=null),x.event.triggered=m,t.isPropagationStopped()&&h.addEventListener(m,qn),r[m](),t.isPropagationStopped()&&h.removeEventListener(m,qn),x.event.triggered=void 0,u&&(r[c]=u)),t.result}},simulate:function(e,t,n){var r=x.extend(new x.Event,n,{type:e,isSimulated:!0});x.event.trigger(r,null,t)}}),x.fn.extend({trigger:function(e,t){return this.each((function(){x.event.trigger(e,t,this)}))},triggerHandler:function(e,t){var n=this[0];if(n)return x.event.trigger(e,t,n,!0)}});var kn=e.location,_n={guid:Date.now()},jn=/\?/;x.parseXML=function(t){var n,r;if(!t||"string"!=typeof t)return null;try{n=(new e.DOMParser).parseFromString(t,"text/xml")}catch(e){}return r=n&&n.getElementsByTagName("parsererror")[0],n&&!r||x.error("Invalid XML: "+(r?x.map(r.childNodes,(function(e){return e.textContent})).join("\n"):t)),n};var Un=/\[\]$/,Sn=/\r?\n/g,Pn=/^(?:submit|button|image|reset|file)$/i,En=/^(?:input|select|textarea|keygen)/i;function Cn(e,t,n,r){var i;if(Array.isArray(t))x.each(t,(function(t,i){n||Un.test(e)?r(e,i):Cn(e+"["+("object"==typeof i&&null!=i?t:"")+"]",i,n,r)}));else if(n||"object"!==d(t))r(e,t);else for(i in t)Cn(e+"["+i+"]",t[i],n,r)}x.param=function(e,t){var n,r=[],i=function(e,t){var n="function"==typeof t?t():t;r[r.length]=encodeURIComponent(e)+"="+encodeURIComponent(null==n?"":n)};if(null==e)return"";if(Array.isArray(e)||e.jquery&&!x.isPlainObject(e))x.each(e,(function(){i(this.name,this.value)}));else for(n in e)Cn(n,e[n],t,i);return r.join("&")},x.fn.extend({serialize:function(){return x.param(this.serializeArray())},serializeArray:function(){return this.map((function(){var e=x.prop(this,"elements");return e?x.makeArray(e):this})).filter((function(){var e=this.type;return this.name&&!x(this).is(":disabled")&&En.test(this.nodeName)&&!Pn.test(e)&&(this.checked||!Rt.test(e))})).map((function(e,t){var n=x(this).val();return null==n?null:Array.isArray(n)?x.map(n,(function(e){return{name:t.name,value:e.replace(Sn,"\r\n")}})):{name:t.name,value:n.replace(Sn,"\r\n")}})).get()}});var Dn=/%20/g,On=/#.*$/,Rn=/([?&])_=[^&]*/,In=/^(.*?):[ \t]*([^\r\n]*)$/gm,Nn=/^(?:GET|HEAD)$/,Bn=/^\/\//,Mn={},Kn={},Ln="*/".concat("*"),Fn=y.createElement("a");function Hn(e){return function(t,n){"string"!=typeof t&&(n=t,t="*");var r,i=0,o=t.toLowerCase().match(J)||[];if("function"==typeof n)for(;r=o[i++];)"+"===r[0]?(r=r.slice(1)||"*",(e[r]=e[r]||[]).unshift(n)):(e[r]=e[r]||[]).push(n)}}function Wn(e,t,n,r){var i={},o=e===Kn;function s(u){var a;return i[u]=!0,x.each(e[u]||[],(function(e,u){var c=u(t,n,r);return"string"!=typeof c||o||i[c]?o?!(a=c):void 0:(t.dataTypes.unshift(c),s(c),!1)})),a}return s(t.dataTypes[0])||!i["*"]&&s("*")}function Gn(e,t){var n,r,i=x.ajaxSettings.flatOptions||{};for(n in t)void 0!==t[n]&&((i[n]?e:r||(r={}))[n]=t[n]);return r&&x.extend(!0,e,r),e}Fn.href=kn.href,x.extend({active:0,lastModified:{},etag:{},ajaxSettings:{url:kn.href,type:"GET",isLocal:/^(?:about|app|app-storage|.+-extension|file|res|widget):$/.test(kn.protocol),global:!0,processData:!0,async:!0,contentType:"application/x-www-form-urlencoded; charset=UTF-8",accepts:{"*":Ln,text:"text/plain",html:"text/html",xml:"application/xml, text/xml",json:"application/json, text/javascript"},contents:{xml:/\bxml\b/,html:/\bhtml/,json:/\bjson\b/},responseFields:{xml:"responseXML",text:"responseText",json:"responseJSON"},converters:{"* text":String,"text html":!0,"text json":JSON.parse,"text xml":x.parseXML},flatOptions:{url:!0,context:!0}},ajaxSetup:function(e,t){return t?Gn(Gn(e,x.ajaxSettings),t):Gn(x.ajaxSettings,e)},ajaxPrefilter:Hn(Mn),ajaxTransport:Hn(Kn),ajax:function(t,n){"object"==typeof t&&(n=t,t=void 0),n=n||{};var r,i,o,s,u,a,c,l,f,p,h=x.ajaxSetup({},n),d=h.context||h,g=h.context&&(d.nodeType||d.jquery)?x(d):x.event,m=x.Deferred(),v=x.Callbacks("once memory"),b=h.statusCode||{},w={},T={},A="canceled",q={readyState:0,getResponseHeader:function(e){var t;if(c){if(!s)for(s={};t=In.exec(o);)s[t[1].toLowerCase()+" "]=(s[t[1].toLowerCase()+" "]||[]).concat(t[2]);t=s[e.toLowerCase()+" "]}return null==t?null:t.join(", ")},getAllResponseHeaders:function(){return c?o:null},setRequestHeader:function(e,t){return null==c&&(e=T[e.toLowerCase()]=T[e.toLowerCase()]||e,w[e]=t),this},overrideMimeType:function(e){return null==c&&(h.mimeType=e),this},statusCode:function(e){var t;if(e)if(c)q.always(e[q.status]);else for(t in e)b[t]=[b[t],e[t]];return this},abort:function(e){var t=e||A;return r&&r.abort(t),k(0,t),this}};if(m.promise(q),h.url=((t||h.url||kn.href)+"").replace(Bn,kn.protocol+"//"),h.type=n.method||n.type||h.method||h.type,h.dataTypes=(h.dataType||"*").toLowerCase().match(J)||[""],null==h.crossDomain){a=y.createElement("a");try{a.href=h.url,a.href=a.href,h.crossDomain=Fn.protocol+"//"+Fn.host!=a.protocol+"//"+a.host}catch(e){h.crossDomain=!0}}if(Wn(Mn,h,n,q),h.data&&h.processData&&"string"!=typeof h.data&&(h.data=x.param(h.data,h.traditional)),c)return q;for(f in(l=x.event&&h.global)&&0==x.active++&&x.event.trigger("ajaxStart"),h.type=h.type.toUpperCase(),h.hasContent=!Nn.test(h.type),i=h.url.replace(On,""),h.hasContent?h.data&&h.processData&&0===(h.contentType||"").indexOf("application/x-www-form-urlencoded")&&(h.data=h.data.replace(Dn,"+")):(p=h.url.slice(i.length),h.data&&(h.processData||"string"==typeof h.data)&&(i+=(jn.test(i)?"&":"?")+h.data,delete h.data),!1===h.cache&&(i=i.replace(Rn,"$1"),p=(jn.test(i)?"&":"?")+"_="+_n.guid+++p),h.url=i+p),h.ifModified&&(x.lastModified[i]&&q.setRequestHeader("If-Modified-Since",x.lastModified[i]),x.etag[i]&&q.setRequestHeader("If-None-Match",x.etag[i])),(h.data&&h.hasContent&&!1!==h.contentType||n.contentType)&&q.setRequestHeader("Content-Type",h.contentType),q.setRequestHeader("Accept",h.dataTypes[0]&&h.accepts[h.dataTypes[0]]?h.accepts[h.dataTypes[0]]+("*"!==h.dataTypes[0]?", "+Ln+"; q=0.01":""):h.accepts["*"]),h.headers)q.setRequestHeader(f,h.headers[f]);if(h.beforeSend&&(!1===h.beforeSend.call(d,q,h)||c))return q.abort();if(A="abort",v.add(h.complete),q.done(h.success),q.fail(h.error),r=Wn(Kn,h,n,q)){if(q.readyState=1,l&&g.trigger("ajaxSend",[q,h]),c)return q;h.async&&h.timeout>0&&(u=e.setTimeout((function(){q.abort("timeout")}),h.timeout));try{c=!1,r.send(w,k)}catch(e){if(c)throw e;k(-1,e)}}else k(-1,"No Transport");function k(t,n,s,a){var f,p,y,w,T,A=n;c||(c=!0,u&&e.clearTimeout(u),r=void 0,o=a||"",q.readyState=t>0?4:0,f=t>=200&&t<300||304===t,s&&(w=function(e,t,n){for(var r,i,o,s,u=e.contents,a=e.dataTypes;"*"===a[0];)a.shift(),void 0===r&&(r=e.mimeType||t.getResponseHeader("Content-Type"));if(r)for(i in u)if(u[i]&&u[i].test(r)){a.unshift(i);break}if(a[0]in n)o=a[0];else{for(i in n){if(!a[0]||e.converters[i+" "+a[0]]){o=i;break}s||(s=i)}o=o||s}if(o)return o!==a[0]&&a.unshift(o),n[o]}(h,q,s)),!f&&x.inArray("script",h.dataTypes)>-1&&x.inArray("json",h.dataTypes)<0&&(h.converters["text script"]=function(){}),w=function(e,t,n,r){var i,o,s,u,a,c={},l=e.dataTypes.slice();if(l[1])for(s in e.converters)c[s.toLowerCase()]=e.converters[s];for(o=l.shift();o;)if(e.responseFields[o]&&(n[e.responseFields[o]]=t),!a&&r&&e.dataFilter&&(t=e.dataFilter(t,e.dataType)),a=o,o=l.shift())if("*"===o)o=a;else if("*"!==a&&a!==o){if(!(s=c[a+" "+o]||c["* "+o]))for(i in c)if((u=i.split(" "))[1]===o&&(s=c[a+" "+u[0]]||c["* "+u[0]])){!0===s?s=c[i]:!0!==c[i]&&(o=u[0],l.unshift(u[1]));break}if(!0!==s)if(s&&e.throws)t=s(t);else try{t=s(t)}catch(e){return{state:"parsererror",error:s?e:"No conversion from "+a+" to "+o}}}return{state:"success",data:t}}(h,w,q,f),f?(h.ifModified&&((T=q.getResponseHeader("Last-Modified"))&&(x.lastModified[i]=T),(T=q.getResponseHeader("etag"))&&(x.etag[i]=T)),204===t||"HEAD"===h.type?A="nocontent":304===t?A="notmodified":(A=w.state,p=w.data,f=!(y=w.error))):(y=A,!t&&A||(A="error",t<0&&(t=0))),q.status=t,q.statusText=(n||A)+"",f?m.resolveWith(d,[p,A,q]):m.rejectWith(d,[q,A,y]),q.statusCode(b),b=void 0,l&&g.trigger(f?"ajaxSuccess":"ajaxError",[q,h,f?p:y]),v.fireWith(d,[q,A]),l&&(g.trigger("ajaxComplete",[q,h]),--x.active||x.event.trigger("ajaxStop")))}return q},getJSON:function(e,t,n){return x.get(e,t,n,"json")},getScript:function(e,t){return x.get(e,void 0,t,"script")}}),x.each(["get","post"],(function(e,t){x[t]=function(e,n,r,i){return"function"!=typeof n&&null!==n||(i=i||r,r=n,n=void 0),x.ajax(x.extend({url:e,type:t,dataType:i,data:n,success:r},x.isPlainObject(e)&&e))}})),x.ajaxPrefilter((function(e){var t;for(t in e.headers)"content-type"===t.toLowerCase()&&(e.contentType=e.headers[t]||"")})),x._evalUrl=function(e,t,n){return x.ajax({url:e,type:"GET",dataType:"script",cache:!0,async:!1,global:!1,scriptAttrs:t.crossOrigin?{crossOrigin:t.crossOrigin}:void 0,converters:{"text script":function(){}},dataFilter:function(e){x.globalEval(e,t,n)}})},x.fn.extend({wrapAll:function(e){var t;return this[0]&&("function"==typeof e&&(e=e.call(this[0])),t=x(e,this[0].ownerDocument).eq(0).clone(!0),this[0].parentNode&&t.insertBefore(this[0]),t.map((function(){for(var e=this;e.firstElementChild;)e=e.firstElementChild;return e})).append(this)),this},wrapInner:function(e){return"function"==typeof e?this.each((function(t){x(this).wrapInner(e.call(this,t))})):this.each((function(){var t=x(this),n=t.contents();n.length?n.wrapAll(e):t.append(e)}))},wrap:function(e){var t="function"==typeof e;return this.each((function(n){x(this).wrapAll(t?e.call(this,n):e)}))},unwrap:function(e){return this.parent(e).not("body").each((function(){x(this).replaceWith(this.childNodes)})),this}}),x.expr.pseudos.hidden=function(e){return!x.expr.pseudos.visible(e)},x.expr.pseudos.visible=function(e){return!!(e.offsetWidth||e.offsetHeight||e.getClientRects().length)},x.ajaxSettings.xhr=function(){return new e.XMLHttpRequest};var zn={0:200};function $n(e){return e.scriptAttrs||!e.headers&&(e.crossDomain||e.async&&x.inArray("json",e.dataTypes)<0)}x.ajaxTransport((function(e){var t;return{send:function(n,r){var i,o=e.xhr();if(o.open(e.type,e.url,e.async,e.username,e.password),e.xhrFields)for(i in e.xhrFields)o[i]=e.xhrFields[i];for(i in e.mimeType&&o.overrideMimeType&&o.overrideMimeType(e.mimeType),e.crossDomain||n["X-Requested-With"]||(n["X-Requested-With"]="XMLHttpRequest"),n)o.setRequestHeader(i,n[i]);t=function(e){return function(){t&&(t=o.onload=o.onerror=o.onabort=o.ontimeout=null,"abort"===e?o.abort():"error"===e?r(o.status,o.statusText):r(zn[o.status]||o.status,o.statusText,"text"===(o.responseType||"text")?{text:o.responseText}:{binary:o.response},o.getAllResponseHeaders()))}},o.onload=t(),o.onabort=o.onerror=o.ontimeout=t("error"),t=t("abort");try{o.send(e.hasContent&&e.data||null)}catch(e){if(t)throw e}},abort:function(){t&&t()}}})),x.ajaxSetup({accepts:{script:"text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"},converters:{"text script":function(e){return x.globalEval(e),e}}}),x.ajaxPrefilter("script",(function(e){void 0===e.cache&&(e.cache=!1),$n(e)&&(e.type="GET")})),x.ajaxTransport("script",(function(e){var t,n;if($n(e))return{send:function(r,i){t=x("<script>").attr(e.scriptAttrs||{}).prop({charset:e.scriptCharset,src:e.url}).on("load error",n=function(e){t.remove(),n=null,e&&i("error"===e.type?404:200,e.type)}),y.head.appendChild(t[0])},abort:function(){n&&n()}}}));var Vn=[],Xn=/(=)\?(?=&|$)|\?\?/;x.ajaxSetup({jsonp:"callback",jsonpCallback:function(){var e=Vn.pop()||x.expando+"_"+_n.guid++;return this[e]=!0,e}}),x.ajaxPrefilter("jsonp",(function(t,n,r){var i,o,s,u=!1!==t.jsonp&&(Xn.test(t.url)?"url":"string"==typeof t.data&&0===(t.contentType||"").indexOf("application/x-www-form-urlencoded")&&Xn.test(t.data)&&"data");return i=t.jsonpCallback="function"==typeof t.jsonpCallback?t.jsonpCallback():t.jsonpCallback,u?t[u]=t[u].replace(Xn,"$1"+i):!1!==t.jsonp&&(t.url+=(jn.test(t.url)?"&":"?")+t.jsonp+"="+i),t.converters["script json"]=function(){return s||x.error(i+" was not called"),s[0]},t.dataTypes[0]="json",o=e[i],e[i]=function(){s=arguments},r.always((function(){void 0===o?x(e).removeProp(i):e[i]=o,t[i]&&(t.jsonpCallback=n.jsonpCallback,Vn.push(i)),s&&"function"==typeof o&&o(s[0]),s=o=void 0})),"script"})),x.ajaxPrefilter((function(t,n){"string"==typeof t.data||x.isPlainObject(t.data)||Array.isArray(t.data)||"processData"in n||(t.processData=!1),t.data instanceof e.FormData&&(t.contentType=!1)})),x.parseHTML=function(t,n,r){return"string"==typeof t||Le(t+"")?("boolean"==typeof n&&(r=n,n=!1),n||(n=(new e.DOMParser).parseFromString("","text/html")),o=!r&&[],(i=Ke.exec(t))?[n.createElement(i[1])]:(i=Et([t],n,o),o&&o.length&&x(o).remove(),x.merge([],i.childNodes))):[];var i,o},x.fn.load=function(e,t,n){var r,i,o,s=this,u=e.indexOf(" ");return u>-1&&(r=wn(e.slice(u)),e=e.slice(0,u)),"function"==typeof t?(n=t,t=void 0):t&&"object"==typeof t&&(i="POST"),s.length>0&&x.ajax({url:e,type:i||"GET",dataType:"html",data:t}).done((function(e){o=arguments,s.html(r?x("<div>").append(x.parseHTML(e)).find(r):e)})).always(n&&function(e,t){s.each((function(){n.apply(this,o||[e.responseText,t,e])}))}),this},x.expr.pseudos.animated=function(e){return x.grep(x.timers,(function(t){return e===t.elem})).length},x.offset={setOffset:function(e,t,n){var r,i,o,s,u,a,c=x.css(e,"position"),l=x(e),f={};"static"===c&&(e.style.position="relative"),u=l.offset(),o=x.css(e,"top"),a=x.css(e,"left"),("absolute"===c||"fixed"===c)&&(o+a).indexOf("auto")>-1?(s=(r=l.position()).top,i=r.left):(s=parseFloat(o)||0,i=parseFloat(a)||0),"function"==typeof t&&(t=t.call(e,n,x.extend({},u))),null!=t.top&&(f.top=t.top-u.top+s),null!=t.left&&(f.left=t.left-u.left+i),"using"in t?t.using.call(e,f):l.css(f)}},x.fn.extend({offset:function(e){if(arguments.length)return void 0===e?this:this.each((function(t){x.offset.setOffset(this,e,t)}));var t,n,r=this[0];return r?r.getClientRects().length?(t=r.getBoundingClientRect(),n=r.ownerDocument.defaultView,{top:t.top+n.pageYOffset,left:t.left+n.pageXOffset}):{top:0,left:0}:void 0},position:function(){if(this[0]){var e,t,n,r=this[0],i={top:0,left:0};if("fixed"===x.css(r,"position"))t=r.getBoundingClientRect();else{for(t=this.offset(),n=r.ownerDocument,e=r.offsetParent||n.documentElement;e&&e!==n.documentElement&&"static"===x.css(e,"position");)e=e.offsetParent||n.documentElement;e&&e!==r&&1===e.nodeType&&"static"!==x.css(e,"position")&&((i=x(e).offset()).top+=x.css(e,"borderTopWidth",!0),i.left+=x.css(e,"borderLeftWidth",!0))}return{top:t.top-i.top-x.css(r,"marginTop",!0),left:t.left-i.left-x.css(r,"marginLeft",!0)}}},offsetParent:function(){return this.map((function(){for(var e=this.offsetParent;e&&"static"===x.css(e,"position");)e=e.offsetParent;return e||D}))}}),x.each({scrollLeft:"pageXOffset",scrollTop:"pageYOffset"},(function(e,t){var n="pageYOffset"===t;x.fn[e]=function(r){return Q(this,(function(e,r,i){var o;if(g(e)?o=e:9===e.nodeType&&(o=e.defaultView),void 0===i)return o?o[t]:e[r];o?o.scrollTo(n?o.pageXOffset:i,n?i:o.pageYOffset):e[r]=i}),e,r,arguments.length)}})),x.each({Height:"height",Width:"width"},(function(e,t){x.each({padding:"inner"+e,content:t,"":"outer"+e},(function(n,r){x.fn[r]=function(i,o){var s=arguments.length&&(n||"boolean"!=typeof i),u=n||(!0===i||!0===o?"margin":"border");return Q(this,(function(t,n,i){var o;return g(t)?0===r.indexOf("outer")?t["inner"+e]:t.document.documentElement["client"+e]:9===t.nodeType?(o=t.documentElement,Math.max(t.body["scroll"+e],o["scroll"+e],t.body["offset"+e],o["offset"+e],o["client"+e])):void 0===i?x.css(t,n,u):x.style(t,n,i,u)}),t,s?i:void 0,s)}}))})),x.each(["ajaxStart","ajaxStop","ajaxComplete","ajaxError","ajaxSuccess","ajaxSend"],(function(e,t){x.fn[t]=function(e){return this.on(t,e)}})),x.fn.extend({bind:function(e,t,n){return this.on(e,null,t,n)},unbind:function(e,t){return this.off(e,null,t)},delegate:function(e,t,n,r){return this.on(t,e,n,r)},undelegate:function(e,t,n){return 1===arguments.length?this.off(e,"**"):this.off(t,e||"**",n)},hover:function(e,t){return this.on("mouseenter",e).on("mouseleave",t||e)}}),x.each("blur focus focusin focusout resize scroll click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave change select submit keydown keypress keyup contextmenu".split(" "),(function(e,t){x.fn[t]=function(e,n){return arguments.length>0?this.on(t,null,e,n):this.trigger(t)}})),x.proxy=function(e,t){var n,r,o;if("string"==typeof t&&(n=e[t],t=e,e=n),"function"==typeof e)return r=i.call(arguments,2),o=function(){return e.apply(t||this,r.concat(i.call(arguments)))},o.guid=e.guid=e.guid||x.guid++,o},x.holdReady=function(e){e?x.readyWait++:x.ready(!0)},x.expr[":"]=x.expr.filters=x.expr.pseudos,"function"==typeof define&&define.amd&&define("jquery",[],(function(){return x}));var Qn=e.jQuery,Jn=e.$;return x.noConflict=function(t){return e.$===x&&(e.$=Jn),t&&e.jQuery===x&&(e.jQuery=Qn),x},void 0===t&&(e.jQuery=e.$=x),x}(window,!0);const t=e;function i(e){return i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},i(e)}function o(e){if(null!=e){var t=e["function"==typeof Symbol&&Symbol.iterator||"@@iterator"],n=0;if(t)return t.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length))return{next:function(){return e&&n>=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}}}throw new TypeError(i(e)+" is not iterable")}function s(){var e,t,n="function"==typeof Symbol?Symbol:{},r=n.iterator||"@@iterator",i=n.toStringTag||"@@toStringTag";function o(n,r,i,o){var s=r&&r.prototype instanceof c?r:c,l=Object.create(s.prototype);return u(l,"_invoke",function(n,r,i){var o,s,u,c=0,l=i||[],f=!1,p={p:0,n:0,v:e,a:h,f:h.bind(e,4),d:function(t,n){return o=t,s=0,u=e,p.n=n,a}};function h(n,r){for(s=n,u=r,t=0;!f&&c&&!i&&t<l.length;t++){var i,o=l[t],h=p.p,d=o[2];n>3?(i=d===r)&&(u=o[(s=o[4])?5:(s=3,3)],o[4]=o[5]=e):o[0]<=h&&((i=n<2&&h<o[1])?(s=0,p.v=r,p.n=o[1]):h<d&&(i=n<3||o[0]>r||r>d)&&(o[4]=n,o[5]=r,p.n=d,s=0))}if(i||n>1)return a;throw f=!0,r}return function(i,l,d){if(c>1)throw TypeError("Generator is already running");for(f&&1===l&&h(l,d),s=l,u=d;(t=s<2?e:u)||!f;){o||(s?s<3?(s>1&&(p.n=-1),h(s,u)):p.n=u:p.v=u);try{if(c=2,o){if(s||(i="next"),t=o[i]){if(!(t=t.call(o,u)))throw TypeError("iterator result is not an object");if(!t.done)return t;u=t.value,s<2&&(s=0)}else 1===s&&(t=o.return)&&t.call(o),s<2&&(u=TypeError("The iterator does not provide a '"+i+"' method"),s=1);o=e}else if((t=(f=p.n<0)?u:n.call(r,p))!==a)break}catch(t){o=e,s=1,u=t}finally{c=1}}return{value:t,done:f}}}(n,i,o),!0),l}var a={};function c(){}function l(){}function f(){}t=Object.getPrototypeOf;var p=[][r]?t(t([][r]())):(u(t={},r,(function(){return this})),t),h=f.prototype=c.prototype=Object.create(p);function d(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,f):(e.__proto__=f,u(e,i,"GeneratorFunction")),e.prototype=Object.create(h),e}return l.prototype=f,u(h,"constructor",f),u(f,"constructor",l),l.displayName="GeneratorFunction",u(f,i,"GeneratorFunction"),u(h),u(h,i,"Generator"),u(h,r,(function(){return this})),u(h,"toString",(function(){return"[object Generator]"})),(s=function(){return{w:o,m:d}})()}function u(e,t,n,r){var i=Object.defineProperty;try{i({},"",{})}catch(e){i=0}u=function(e,t,n,r){function o(t,n){u(e,t,(function(e){return this._invoke(t,n,e)}))}t?i?i(e,t,{value:n,enumerable:!r,configurable:!r,writable:!r}):e[t]=n:(o("next",0),o("throw",1),o("return",2))},u(e,t,n,r)}function a(e,t,n,r,i,o,s){try{var u=e[o](s),a=u.value}catch(e){return void n(e)}u.done?t(a):Promise.resolve(a).then(r,i)}function c(e){return function(){var t=this,n=arguments;return new Promise((function(r,i){var o=e.apply(t,n);function s(e){a(o,r,i,s,u,"next",e)}function u(e){a(o,r,i,s,u,"throw",e)}s(void 0)}))}}function l(e,n,r,i){return t.ajax({url:e,type:n,data:r,contentType:i&&void 0!==i.contentType?i.contentType:"application/json; charset=utf-8",dataType:i&&void 0!==i.dataType?i.dataType:"json",processData:!(!i||void 0===i.processData)&&i.processData,cache:window&&window.BIMPLUS_SDK_ENABLE_CACHE||!1,async:!0,xhr:function(){var e=t.ajaxSettings.xhr();return i&&void 0!==i.xhrUploadProgress&&e.upload.addEventListener("progress",i.xhrUploadProgress,!1),e},beforeSend:function(t){if(window&&void 0!==window.BIMPLUS_SDK_PENDING_REQUESTS&&window.BIMPLUS_SDK_PENDING_REQUESTS++,null!=i&&i.token){var n=i.tokenType?i.tokenType:"BimPlus";t.setRequestHeader("Authorization",n+" "+i.token)}if(null!=i&&i.eTag&&(t.setRequestHeader("Cache-Control","no-cache"),window&&!window.BIMPLUS_SDK_DISABLE_ETAG&&t.setRequestHeader("If-None-Match",i.eTag)),null!=i&&i.headers)for(var r in i.headers)r&&t.setRequestHeader(r,i.headers[r]);!t._url&&e&&(t._url=e)},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 n={url:e,response:null!=t&&t.responseText&&(null==t?void 0:t.responseText.length)>0?JSON.parse(t.responseText):null};console.log(JSON.stringify(n))}}})}function f(e,n,r,i){var o=t.Deferred();console.debug("xmlHttpRequest config=",i);var s=new XMLHttpRequest;return s.open(n,e,!0),s.setRequestHeader("Authorization","BimPlus "+i.token),window&&void 0!==window.BIMPLUS_SDK_PENDING_REQUESTS&&window.BIMPLUS_SDK_PENDING_REQUESTS++,null!=i&&i.responseType&&(console.debug("responseType is set to",i.responseType),s.responseType=i.responseType),null!=i&&i.eTag&&(console.debug("setRequestHeader is set to eTag",i.eTag),s.setRequestHeader("Cache-Control","no-cache"),window&&!window.BIMPLUS_SDK_DISABLE_ETAG&&s.setRequestHeader("If-None-Match",i.eTag)),s.onload=function(){window&&void 0!==window.BIMPLUS_SDK_PENDING_REQUESTS&&window.BIMPLUS_SDK_PENDING_REQUESTS--,o.resolve(s.response,s.status,s)},s.onerror=function(){window&&void 0!==window.BIMPLUS_SDK_PENDING_REQUESTS&&window.BIMPLUS_SDK_PENDING_REQUESTS--,o.reject()},r&&s.setRequestHeader("Content-Type","application/json;charset=UTF-8"),s.send(r),o.promise()}function p(e,t,n,r){return t||(t={}),t.token||(t.token=n),t.tokenType&&t.tokenType===r||(t.tokenType=r),t.queryParams&&(e+=function(e){var t="?";for(var n in e)Object.hasOwn(e,n)&&(t+=n+"="+e[n]+"&");return t=t.slice(0,-1)}(t.queryParams)),{ajaxConfig:t,url:e}}function h(e,n,r,i,u){u||(u={}),u.token||(u.token=n),u.queryParams||(u.queryParams={}),u.queryParams.chunkSize||(u.queryParams.chunkSize=r),u.queryParams.chunk=1;var a=t.Deferred(),l=[];return e.get(i,u).done(function(){var n=c(s().m((function n(r,c,f){var p,h,d,g;return s().w((function(n){for(;;)switch(n.n){case 0:l.push(r),p=0,200===f.status?(h=f.getResponseHeader("X-Total-Count"))?p=parseInt(h,10):console.warn("Request for "+i+" doesn't support chunked responses!"):304===f.status&&(f["Cached-X-Total-Count"]?p=f["Cached-X-Total-Count"]:console.warn("Cached request for "+i+" doesn't contain chunk info!")),d=s().m((function n(){var r;return s().w((function(n){for(;;)switch(n.n){case 0:u.queryParams.chunk=g,r=t.Deferred(),e.get(i,u).done((function(e){r.resolve(e)})).fail((function(e,t){r.reject(e,t)})),l.push(r);case 1:return n.a(2)}}),n)})),g=2;case 1:if(!(g<=p)){n.n=3;break}return n.d(o(d()),2);case 2:g++,n.n=1;break;case 3:a.resolve(l);case 4:return n.a(2)}}),n)})));return function(e,t,r){return n.apply(this,arguments)}}()).fail((function(e,t){a.reject(e,t)})),a.promise()}function d(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.attachmentId,n=e.file,r=e.fileName,i=e.ajaxConfig,o=e.request,u=e.url,a=e.deferred;e.uploadData.start=e.uploadData.currentChunk*e.uploadData.chunkSize,e.uploadData.end=Math.min(e.uploadData.fileSize,e.uploadData.start+e.uploadData.chunkSize)-1;var l=n.slice(e.uploadData.start,e.uploadData.end+1);return i.headers={"Content-Range":"bytes "+e.uploadData.start+"-"+e.uploadData.end+"/"+e.uploadData.fileSize,"Content-Disposition":'inline; name="'+r+'"; filename="'+n.name+'"',"Chunk-FileId":t},o.put(u,l,i).done(function(){var l=c(s().m((function c(l,f,p){return s().w((function(s){for(;;)switch(s.n){case 0:if(e.uploadData.doCallback(l,f,p),e.uploadData.currentChunk++,!(e.uploadData.currentChunk<e.uploadData.totalChunks)){s.n=1;break}return s.a(2,d({attachmentId:t,uploadData:e.uploadData,file:n,fileName:r,ajaxConfig:i,request:o,url:u,deferred:a}));case 1:a.resolve(l);case 2:return s.a(2)}}),c)})));return function(e,t,n){return l.apply(this,arguments)}}()).fail((function(s,c,l){if(e.uploadData.doCallback({error:s}))return d({attachmentId:t,uploadData:e.uploadData,file:n,fileName:r,ajaxConfig:i,request:o,url:u,deferred:a});a.reject(s,c,l)}))}function g(e,n,r,i,o){var u,a,l=null==i?void 0:i.file,f=null==i?void 0:i.opts,p=null==f?void 0:f.chunkSize,h=2147482624;p>0&&p<h||(p=h);var g=l.size,m=Math.ceil(g/p),y=0*p,v={currentChunk:0,start:y,end:Math.min(g,y+p)-1,totalChunks:m,fileSize:g,chunkSize:p,doCallback:function(e,t,n){var r;return null==f||null===(r=f.callback)||void 0===r?void 0:r.call(f,e,t,n)}},b=l.slice(v.start,v.end+1),w=null!=l&&l.name?(null===(u=(a=l.name).substring)||void 0===u?void 0:u.call(a,0,l.name.lastIndexOf(".")))||l.name:"";!function(e){var t,n,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};e||(e={}),e.token||(e.token=r.token),e.contentType=!1,e.processData=!1,e.headers||(e.headers={}),e.headers["Content-Range"]="bytes "+r.uploadData.start+"-"+r.uploadData.end+"/"+r.uploadData.fileSize,e.headers["Content-Disposition"]='inline; name="'+r.fileName+'"; filename="'+r.file.name+'"',e.queryParams||(e.queryParams={});var i=null==r||null===(t=r.data)||void 0===t?void 0:t.documentFolderId;!e.queryParams.DocumentFolderId&&i&&(e.queryParams.DocumentFolderId=i);var o=null==r||null===(n=r.data)||void 0===n?void 0:n.uploadProgress;e.xhrUploadProgress||"function"!=typeof o||(e.xhrUploadProgress=function(e){e||(e={}),e.extraData={start:r.uploadData.start,end:r.uploadData.end,fileSize:r.uploadData.fileSize,chunk:r.uploadData.currentChunk+1,total:r.uploadData.totalChunks};for(var t=arguments.length,n=new Array(t>1?t-1:0),i=1;i<t;i++)n[i-1]=arguments[i];return o.apply(void 0,[e].concat(n))})}(o,{token:n,data:i,fileName:w,file:l,uploadData:v});var T=t.Deferred(),x=function(){return e.put(r,b,o).done(function(){var t=c(s().m((function t(n,i,u){var a;return s().w((function(t){for(;;)switch(t.n){case 0:if(a="00000000-0000-0000-0000-000000000000"===n.id?n.fileName:n.id,v.doCallback(n,i,u),v.currentChunk++,!(v.currentChunk<v.totalChunks)){t.n=1;break}return t.a(2,d({attachmentId:a,uploadData:v,file:l,fileName:w,ajaxConfig:o,request:e,url:r,deferred:T}));case 1:T.resolve(n,i,u);case 2:return t.a(2)}}),t)})));return function(e,n,r){return t.apply(this,arguments)}}()).fail((function(e,t,n){if(v.doCallback({error:e}))return x();T.reject(e,t,n)}))};return x(),T.promise()}var m=function(){var e=null,t=null;this.setAccessToken=function(t){e=t},this.setTokenType=function(e){t=e},this.get=function(n,r){var i=p(n,r,e,t),o=i.ajaxConfig,s=i.url;return null!=o&&o.useXMLHttpRequest?f(s,"GET",null,o):l(s,"GET",null,o)},this.getChunked=function(t,n){return h(this,e,"medium",t,n)},this.put=function(n,r,i){var o=p(n,i,e,t),s=o.ajaxConfig;return l(o.url,"PUT",r,s)},this.putChunked=function(t,n,r){return g(this,e,t,n,r)},this.post=function(n,r,i){var o=p(n,i,e,t),s=o.ajaxConfig,u=o.url;return null!=s&&s.useXMLHttpRequest?f(u,"POST",r,s):l(u,"POST",r,s)},this.del=function(n,r,i){var o=p(n,i,e,t),s=o.ajaxConfig,u=o.url;return r||(s.contentType=null),s.dataType=null,l(u,"DELETE",r||null,s)}},y=function(e){this.postSettings=function(t){return e.request.post(e.getApiUrl()+"application/settings",t)},this.getSettings=function(t){return t?e.request.get(e.getApiUrl()+"application/settings/"+t):e.request.get(e.getApiUrl()+"application/settings")},this.putSettings=function(t,n){return e.request.put(e.getApiUrl()+"application/settings/"+t,n)},this.deleteSettings=function(t){return e.request.del(e.getApiUrl()+"application/settings/"+t)}},v=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,n){return e.request.put(e.getApiTeamUrl()+"annotations/"+t,n)}},b=function(e){this.get=function(t){return e.request.get(e.getApiTeamUrl()+"attachments/"+t)},this.download=function(t,n){return n?e.request.get(e.getApiTeamUrl()+"attachments/"+t+"/versions/"+n+"/download"):e.request.get(e.getApiTeamUrl()+"attachments/"+t+"/download")},this.put=function(t,n){return e.request.put(e.getApiTeamUrl()+"attachments/"+t,n)},this.post=function(t,n,r){return e.request.put(e.getApiTeamUrl()+"attachments/"+t,n,{contentType:!1,processData:!1,dataType:null,xhrUploadProgress:r})},this.updateChunked=function(t,n,r){var i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},o=e.getApiTeamUrl()+"attachments/"+t+"/chunked",s={file:n,uploadProgress:r,opts:i};return e.request.putChunked(o,s,{queryParams:{}})},this.delete=function(t,n){return n?e.request.del(e.getApiTeamUrl()+"attachments/"+t+"/versions/"+n):e.request.del(e.getApiTeamUrl()+"attachments/"+t)},this.deleteSelected=function(t){return e.request.del(e.getApiTeamUrl()+"objects/"+t+"/attachments")},this.postVersion=function(t,n,r){return e.request.post(e.getApiTeamUrl()+"attachments/"+t+"/versions",n,{contentType:!1,processData:!1,dataType:null,xhrUploadProgress:r})},this.createVersionChunked=function(t,n,r){var i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},o=e.getApiTeamUrl()+"attachments/"+t+"/versions/chunked",s={file:n,uploadProgress:r,opts:i};return e.request.putChunked(o,s,{queryParams:{}})},this.getAllVersions=function(t){return e.request.get(e.getApiTeamUrl()+"attachments/"+t+"/versions")},this.releaseVersion=function(t,n){return e.request.put(e.getApiTeamUrl()+"attachments/"+t+"/release",n)},this.getBluebeam=function(t,n,r){var i={};return i.externalClientId=t,r&&(i.region=r),e.request.get(e.getApiUrl()+"external/attachments/bluebeam",{queryParams:i,headers:{"source-Authorization":"Bearer ".concat(n)}})},this.postBluebeam=function(t,n,r){var i={};return n&&(i.region=n),e.request.post(e.getApiTeamUrl()+"external/attachments/upload",r,{queryParams:i,headers:{"source-Authorization":"Bearer ".concat(t)}})},this.getExchange=function(){return e.request.get(e.getApiUrl()+"external/attachments/exchange")},this.postExternalAttachment=function(t){return e.request.post(e.getApiTeamUrl()+"external/attachments/upload",t)}},w=function(e){this.post=function(t){return e.request.post(e.getApiTeamUrl()+"attributetemplates",t)},this.get=function(t){return t?e.request.get(e.getApiTeamUrl()+"attributetemplates/"+t):e.request.get(e.getApiTeamUrl()+"attributetemplates")},this.put=function(t,n){return e.request.put(e.getApiTeamUrl()+"attributetemplates/"+t,n)},this.delete=function(t){return e.request.del(e.getApiTeamUrl()+"attributetemplates/"+t)}},T=function(e){this.post=function(t,n,r){return e.request.post(e.getApiUrl()+"authorize",JSON.stringify({user_id:t,password:n,application_id:r}))},this.forgotPassword=function(t){return e.request.post(e.getApiUrl()+"auth-forgot",t,{dataType:null})},this.checkAccessToken=function(){return e.request.get(e.getApiUrl()+"authorize")},this.requestCrossToken=function(){return e.request.post(e.getApiUrl()+"cross-token")},this.requestExternalAppToken=function(){return e.request.get(e.getApiUrl()+"validate")},this.getOpenIdConfiguration=function(){return e.request.get(e.getApiUrl()+".well-known/openid-configuration")}},x=n(744);const A=Symbol.for("Dexie"),q=globalThis[A]||(globalThis[A]=x);if(x.semVer!==q.semVer)throw new Error(`Two different versions of Dexie loaded in the same app: ${x.semVer} and ${q.semVer}`);const{liveQuery:k,mergeRanges:_,rangesOverlap:j,RangeSet:U,cmp:S,Entity:P,PropModification:E,replacePrefix:C,add:D,remove:O,DexieYProvider:R}=q,I=q;function N(){var e,t,n="function"==typeof Symbol?Symbol:{},r=n.iterator||"@@iterator",i=n.toStringTag||"@@toStringTag";function o(n,r,i,o){var a=r&&r.prototype instanceof u?r:u,c=Object.create(a.prototype);return B(c,"_invoke",function(n,r,i){var o,u,a,c=0,l=i||[],f=!1,p={p:0,n:0,v:e,a:h,f:h.bind(e,4),d:function(t,n){return o=t,u=0,a=e,p.n=n,s}};function h(n,r){for(u=n,a=r,t=0;!f&&c&&!i&&t<l.length;t++){var i,o=l[t],h=p.p,d=o[2];n>3?(i=d===r)&&(a=o[(u=o[4])?5:(u=3,3)],o[4]=o[5]=e):o[0]<=h&&((i=n<2&&h<o[1])?(u=0,p.v=r,p.n=o[1]):h<d&&(i=n<3||o[0]>r||r>d)&&(o[4]=n,o[5]=r,p.n=d,u=0))}if(i||n>1)return s;throw f=!0,r}return function(i,l,d){if(c>1)throw TypeError("Generator is already running");for(f&&1===l&&h(l,d),u=l,a=d;(t=u<2?e:a)||!f;){o||(u?u<3?(u>1&&(p.n=-1),h(u,a)):p.n=a:p.v=a);try{if(c=2,o){if(u||(i="next"),t=o[i]){if(!(t=t.call(o,a)))throw TypeError("iterator result is not an object");if(!t.done)return t;a=t.value,u<2&&(u=0)}else 1===u&&(t=o.return)&&t.call(o),u<2&&(a=TypeError("The iterator does not provide a '"+i+"' method"),u=1);o=e}else if((t=(f=p.n<0)?a:n.call(r,p))!==s)break}catch(t){o=e,u=1,a=t}finally{c=1}}return{value:t,done:f}}}(n,i,o),!0),c}var s={};function u(){}function a(){}function c(){}t=Object.getPrototypeOf;var l=[][r]?t(t([][r]())):(B(t={},r,(function(){return this})),t),f=c.prototype=u.prototype=Object.create(l);function p(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,c):(e.__proto__=c,B(e,i,"GeneratorFunction")),e.prototype=Object.create(f),e}return a.prototype=c,B(f,"constructor",c),B(c,"constructor",a),a.displayName="GeneratorFunction",B(c,i,"GeneratorFunction"),B(f),B(f,i,"Generator"),B(f,r,(function(){return this})),B(f,"toString",(function(){return"[object Generator]"})),(N=function(){return{w:o,m:p}})()}function B(e,t,n,r){var i=Object.defineProperty;try{i({},"",{})}catch(e){i=0}B=function(e,t,n,r){function o(t,n){B(e,t,(function(e){return this._invoke(t,n,e)}))}t?i?i(e,t,{value:n,enumerable:!r,configurable:!r,writable:!r}):e[t]=n:(o("next",0),o("throw",1),o("return",2))},B(e,t,n,r)}function M(e,t,n,r,i,o,s){try{var u=e[o](s),a=u.value}catch(e){return void n(e)}u.done?t(a):Promise.resolve(a).then(r,i)}function K(e){return function(){var t=this,n=arguments;return new Promise((function(r,i){var o=e.apply(t,n);function s(e){M(o,r,i,s,u,"next",e)}function u(e){M(o,r,i,s,u,"throw",e)}s(void 0)}))}}var L=function(){var e=new I("IDBCache",{autoOpen:!1});this._detectIE=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 n=e.indexOf("rv:");return parseInt(e.substring(n+3,e.indexOf(".",n)),10)}var r=e.indexOf("Edge/");return r>0&&parseInt(e.substring(r+5,e.indexOf(".",r)),10)},this._detectSafari=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("."))},this.isSupported=function(){var e=window.indexedDB||window.mozIndexedDB||window.webkitIndexedDB||window.msIndexedDB,t=window.IDBKeyRange||window.webkitIDBKeyRange,n=window.IDBCursor||window.webkitIDBCursor,r=this._detectIE(),i=this._detectSafari(),o=!1!==r&&r<11,s=!1!==i&&i<10,u=!!navigator.userAgent.match(/iPad|iPhone|iPod/i);return navigator.userAgent.match(/PhantomJS/i)?e&&t&&n:e&&t&&n&&!o&&!u&&!s},this.addResponse=function(t,n,r,i){return e.responseTable.put({etag:r,data:n,timestamp:Date.now(),chunks:i?parseInt(i,10):null},t)},this.getResponse=function(t){return e.responseTable.get(t)},this.addBatchResponse=function(t,n,r,i){return e.batchedResponseTable.put({id:t+n,batch:n,data:r,timestamp:Date.now(),chunks:i?parseInt(i,10):null})},this.getBatchResponse=function(t,n){return e.batchedResponseTable.get(t+n)},this.deleteBatchResponses=function(t){return e.batchedResponseTable.where("batch").equals(t).delete()},this.clear=function(){return Promise.all([e.responseTable.clear(),e.batchedResponseTable.clear()])},this.clearResponseTable=function(){return Promise.all([e.responseTable.clear()])},this.initDB=function(){return e.version(.1).stores({responseTable:""}),e.version(.2).stores({batchResponseTable:"&[id+batch],batch"}),e.version(.3).stores({batchedResponseTable:"id,batch",batchResponseTable:null}),e.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=K(N().m((function e(t){var n,r;return N().w((function(e){for(;;)switch(e.n){case 0:return n=function(e,t){var n,r;return"timestamp"===e?null!==(n=window)&&void 0!==n&&n.BIMPLUS_SDK_ENABLE_IDBCACHE_TIMESTAMP_DUMP?t:"NOT SHOWN":"data"===e?null!==(r=window)&&void 0!==r&&r.BIMPLUS_SDK_ENABLE_IDBCACHE_DATA_DUMP?t:"NOT SHOWN":t},r="",e.n=1,t.each((function(e){r+=" ".concat(JSON.stringify(e,n),"\n")}));case 1:return e.a(2,r)}}),e)})));return function(t){return e.apply(this,arguments)}}(),this.dumpTable=function(){var e=K(N().m((function e(t){var n,r,i,o,s;return N().w((function(e){for(;;)switch(e.n){case 0:return e.n=1,t.toCollection().count();case 1:return n=e.v,r=[t.schema.primKey].concat(t.schema.indexes),i=r.map((function(e){return e.src})).join(","),o="Table: ".concat(t.name,", Schema: '").concat(i,"', Count of entries: ").concat(n,"\n"),s=o,e.n=2,this.dumpTableContent(t);case 2:return o=s+=e.v,e.a(2,o)}}),e,this)})));return function(t){return e.apply(this,arguments)}}(),this.dumpDatabase=K(N().m((function t(){var n,r,i;return N().w((function(t){for(;;)switch(t.n){case 0:return n="",n+="BimWebSdk: Dexie Databases Dump\n",n+="===============================\n",n+="Database: ".concat(e.name," (Version: ").concat(e.verno,")\n"),r=n,t.n=1,this.dumpTable(e.responseTable);case 1:return n=r+=t.v,i=n,t.n=2,this.dumpTable(e.batchedResponseTable);case 2:return n=i+=t.v,t.a(2,n)}}),t,this)})))},F=function(){var e=null,n=null,r=new L;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){n=e},this.getCache=function(){return r};var i=function(e,t,n){var i=n.getResponseHeader("ETag"),o=n.getResponseHeader("X-Total-Count"),s="arraybuffer"===n.responseType;if(i){var u=!1===s?JSON.stringify(t):null;r.addResponse(e,s?t:JSON.parse(u),i,o).then((function(){})).catch((function(t){console.error("BimWebSdk failed to add response to cache: "+e+" Reason: "+t.message)}))}},o=function(e){return"W"===e.charAt(0)?e.substring(2):e};this.getBatchResponse=function(e,n,i){var o=t.Deferred(),s=i.useXMLHttpRequest?f:l;return r.getBatchResponse(e,n).then((function(t){if(t){var u={};null!==t.chunks&&(u["Cached-X-Total-Count"]=t.chunks),u.status=304,o.resolve(t.data,304,u)}else s(e,"GET",null,i).done((function(t,i,s){var u=s.getResponseHeader("X-Total-Count"),a="arraybuffer"===s.responseType,c=!1===a?JSON.stringify(t):null;r.addBatchResponse(e,n,a?t:JSON.parse(c),u).then((function(){})).catch((function(t){console.error("BimWebSdk failed to add response to cache: "+e+" Reason: "+t.message)})),o.resolve(t,i,s)})).fail((function(e,t){o.reject(e,t)}))})),o.promise()},this.get=function(s,u){var a=p(s,u,e,n),c=a.ajaxConfig,h=a.url;if(c.responseBatch)return this.getBatchResponse(h,c.responseBatch,c);var d=t.Deferred(),g=c.useXMLHttpRequest?f:l;return r.getResponse("GET;"+h).then((function(e){if(e){var t=o(e.etag);c.eTag=t,g(h,"GET",null,c).done((function(t,n,r){304===r.status?(null!==e.chunks&&(r["Cached-X-Total-Count"]=e.chunks),d.resolve(e.data,n,r)):(i("GET;"+h,t,r),d.resolve(t,n,r))})).fail((function(e,t){d.reject(e,t)}))}else g(h,"GET",null,c).done((function(e,t,n){i("GET;"+h,e,n),d.resolve(e,t,n)})).fail((function(e,t){d.reject(e,t)}))})).catch((function(){g(h,"GET",null,c).done((function(e,t,n){i("GET;"+h,e,n),d.resolve(e,t,n)})).fail((function(e,t){d.reject(e,t)}))})),d.promise()},this.put=function(t,r,i){var o=p(t,i,e,n),s=o.ajaxConfig;return l(o.url,"PUT",r,s)},this.post=function(t,r,i){var o=p(t,i,e,n),s=o.ajaxConfig,u=o.url;return(s.useXMLHttpRequest?f:l)(u,"POST",r,s)},this.del=function(t,r,i){var o=p(t,i,e,n),s=o.ajaxConfig,u=o.url;return r||(s.contentType=null),s.dataType=null,l(u,"DELETE",r||null,s)},this.head=function(s,u){var a=p(s,u,e,n),c=a.ajaxConfig,f=a.url;c.contentType="",c.dataType="";var h=t.Deferred();return r.getResponse("HEAD;"+f).then((function(e){if(e){var t=o(e.etag);c.eTag=t,l(f,"HEAD",null,c).done((function(e,t,n){304===n.status?h.resolve(!0,t,n):(i("HEAD;"+f,null,n),h.resolve(!1,t,n))})).fail((function(e,t){h.reject(e,t)}))}else l(f,"HEAD",null,c).done((function(e,t,n){i("HEAD;"+f,null,n),h.resolve(!1,t,n)})).fail((function(e,t){h.reject(!1,t)}))})).catch((function(){l(f,"HEAD",null,c).done((function(e,t,n){i("HEAD;"+f,null,n),h.resolve(!1,t,n)})).fail((function(e,t){h.reject(!1,t)}))})),h.promise()},this.getChunked=function(t,n){return h(this,e,"medium",t,n)},this.putChunked=function(t,n,r){return g(this,e,t,n,r)}},H=function(e){this.detectAllClashes=function(t){return e.request.post(e.getApiTeamUrl()+"services/postprocess",t)},this.detectDisciplinesClashes=function(t){return e.request.post(e.getApiTeamUrl()+"clashdetection",t)},this.getFilters=function(t,n){var r={queryParams:{customFilter:n}};return t?e.request.get(e.getApiTeamUrl()+"clashdetection/filters/"+t,n?r:null):e.request.get(e.getApiTeamUrl()+"clashdetection/filters",n?r:null)},this.calculateClashes=function(t,n,r){if(n||r){var i={queryParams:{}};return n&&(i.queryParams.topology=n),r&&(i.queryParams.clashElements=r),e.request.post(e.getApiTeamUrl()+"clashdetection/filters",t,i)}return e.request.post(e.getApiTeamUrl()+"clashdetection/filters",t)},this.getFilterResults=function(t,n,r,i){if(r||i){var o={queryParams:{}};return r&&(o.queryParams.topology=r),i&&(o.queryParams.clashElements=i),n?e.request.get(e.getApiTeamUrl()+"clashdetection/projects/"+t+"/filters/"+n,o):e.request.get(e.getApiTeamUrl()+"clashdetection/projects/"+t+"/filters",o)}return n?e.request.get(e.getApiTeamUrl()+"clashdetection/projects/"+t+"/filters/"+n):e.request.get(e.getApiTeamUrl()+"clashdetection/projects/"+t+"/filters")},this.createClashRule=function(t,n){return e.request.post(e.getApiTeamUrl()+"projects/"+t+"/clashfilters",JSON.stringify(n))},this.deleteClashRule=function(t,n){var r={queryParams:{force:n}};return e.request.del(e.getApiTeamUrl()+"clashfilters/"+t,null,n?r:null)},this.updateClashRule=function(t,n){return e.request.put(e.getApiTeamUrl()+"clashfilters/"+t,JSON.stringify(n))},this.getAllClashRules=function(t,n){var r={queryParams:{customFilter:n}};return e.request.get(e.getApiTeamUrl()+"projects/"+t+"/clashfilters",n?r:null)}},W=function(e){this.post=function(t){var n=[{message:t}];return e.request.post(e.getApiTeamUrl()+"clientlogs",JSON.stringify(n))},this.postExtended=function(t,n,r,i){var o=[{message:t,applicationclass:n,releaseversion:r,projectid:i}];return e.request.post(e.getApiTeamUrl()+"clientlogs",JSON.stringify(o))},this.postArray=function(t){return e.request.post(e.getApiTeamUrl()+"clientlogs",JSON.stringify(t))},this.get=function(){return e.request.get(e.getApiTeamUrl()+"clientlogs")}},G=function(e){this.get=function(t){return e.request.get(e.getApiTeamUrl()+"comments/"+t)},this.delete=function(t){return e.request.del(e.getApiTeamUrl()+"comments/"+t)},this.put=function(t,n){return e.request.put(e.getApiTeamUrl()+"comments/"+t,n)}},z=function(e){this.post=function(t){return t.runAsync=!1,e.request.post(e.getApiTeamUrl()+"services/Connexis",JSON.stringify(t))}},$=function(e){this.get=function(t,n,r){var i="".concat(e.getApiTeamUrl(),"objects/").concat(t,"/customtables");n&&(i+="?variantId=".concat(n));var o={};return r&&(o.queryParams={revision:r}),e.request.get(i,r?o:void 0)},this.post=function(t,n){return e.request.post("".concat(e.getApiTeamUrl(),"objects/").concat(t,"/customtables"),n)},this.exportTable=function(t,n){return e.request.post("".concat(e.getApiTeamUrl(),"customtables/").concat(t,"/export/excel"),n)},this.deleteAllTables=function(t){return e.request.del("".concat(e.getApiTeamUrl(),"objects/").concat(t,"/customtables"))},this.deleteTable=function(t){return e.request.del("".concat(e.getApiTeamUrl(),"customtables/").concat(t))}},V=function(e){this.get=function(t){return e.request.get(e.getApiTeamUrl()+"dimensionlines/"+t)},this.delete=function(t){return e.request.del(e.getApiTeamUrl()+"dimensionlines/"+t)},this.put=function(t,n){return e.request.put(e.getApiTeamUrl()+"dimensionlines/"+t,n)}},X=function(e){this.get=function(t){return t?e.request.get(e.getApiTeamUrl()+"element-types/"+t):e.request.get(e.getApiTeamUrl()+"element-types")},this.getDisciplines=function(t){return t?e.request.get(e.getApiTeamUrl()+"element-types/disciplines/"+t):e.request.get(e.getApiTeamUrl()+"element-types/disciplines")},this.getAttributeTemplates=function(t,n){return t?e.request.get(e.getApiTeamUrl()+"element-types/"+t+"/attributetemplates",n?{queryParams:n}:void 0):e.request.get(e.getApiTeamUrl()+"element-types/attributetemplates",n?{queryParams:n}:void 0)},this.getTopology=function(){return e.request.get(e.getApiTeamUrl()+"element-types/topology")},this.getProjectTopology=function(t){return e.request.get(e.getApiTeamUrl()+"projects/"+t+"/element-types")}},Q=function(e){this.exportObjects=function(t,n){return e.request.get(e.getApiTeamUrl()+"projects/"+t+"/objects/export/excel?typeId="+n)},this.exportModel=function(t,n,r,i,o,s,u){var a={};return r&&(a.revision=r),i&&(a.emptyPropExport=1),o&&(a.propSetExport=1),s&&(a.temporary="true"),u&&(a.exportType=u),e.request.post("".concat(e.getApiTeamUrl(),"projects/").concat(t,"/model/").concat(n,"/exportasync"),null,{queryParams:a,contentType:!1,processData:!1,dataType:null})},this.exportSelection=function(t,n,r,i,o){var s={};return n&&(s.emptyPropExport=n),r&&(s.propSetExport=r),i&&(s.temporary="true"),o&&(s.exportType=o),e.request.post("".concat(e.getApiTeamUrl(),"selections/").concat(t,"/exportasync"),null,{queryParams:s})},this.createExportSelection=function(t,n){return e.request.post("".concat(e.getApiTeamUrl(),"projects/").concat(t,"/exportobjects"),n)}},J=function(e){this.getAccessRights=function(t){return e.request.get(e.getApiTeamUrl()+"folders/"+t+"/rights")},this.setMemberAccessRights=function(t,n,r){return e.request.put(e.getApiTeamUrl()+"folders/"+t+"/rights?assignrecursive="+(r?"true":"false"),n)},this.setMembersAccessRights=function(t,n,r){return e.request.put(e.getApiTeamUrl()+"folders/"+t+"/usersrights?assignrecursive="+(r?"true":"false"),n)}},Y=function(e){var t=function(t){return t?e.getApiUrl()+"content/freeattributegroups/":e.getApiTeamUrl()+"freeattributegroups/"};this.post=function(n,r){return e.request.post(t(r),n)},this.get=function(n,r){return n?e.request.get(t(r)+n):e.request.get(t(r))},this.put=function(n,r,i){return e.request.put(t(i)+n,r)},this.delete=function(n,r){return e.request.del(t(r)+n)},this.getFreeAttributes=function(n,r){return e.request.get(t(r)+n+"/freeattributes")}},Z=function(e){var t=function(t){return t?e.getApiUrl()+"content/freeattributes/":e.getApiTeamUrl()+"freeattributes/"};this.post=function(n,r){return e.request.post(t(r),n)},this.get=function(n,r,i){return n?e.request.get(t(r)+n,i?{queryParams:i}:void 0):e.request.get(t(r),i?{queryParams:i}:void 0)},this.put=function(n,r,i){return e.request.put(t(i)+n,r)},this.delete=function(n,r){return e.request.del(t(r)+n)},this.getTopology=function(n){return e.request.get(t(n)+"?topology=true")},this.getFilteredAttributes=function(t,n,r){var i=e.getApiTeamUrl();return t&&(i+="projects/".concat(t,"/")),i+="attributes?",n&&(i+="layer=".concat(n,"&")),r&&(i+="type=".concat(r)),e.request.get(i)}},ee=function(e){this.calculate=function(t,n,r,i,o){var s={hiddenCalculation:{projectId:t,calculationMode:"View",view:n,clippingPlanes:r,clipRegion:{clipFace:!1},light:{useLight:!0,elevationAngle:45,sideAngle:60,useShadows:!1},propertySettings:{faceMode:"Filling",calcLines:!0},responseSettings:{mode:"Svg",svgHeight:390,svgWidth:500,fileName:i},sectionSettings:{}},runAsync:o};return e.request.post(e.getApiTeamUrl()+"services/Hiddencalculation",JSON.stringify(s))}},te=function(e){this.get=function(t){return e.request.get(e.getApiTeamUrl()+"hyperlinks/"+t)},this.delete=function(t){return e.request.del(e.getApiTeamUrl()+"hyperlinks/"+t)},this.put=function(t,n){return e.request.put(e.getApiTeamUrl()+"hyperlinks/"+t,n)}},ne=function(e){this.postModel=function(t,n,r,i,o,s){"replaceModelData"===o&&(s||(s={}),s.replaceModelData=!0);var u={preparedData:r,processData:!1,dataType:null,xhrUploadProgress:i,queryParams:s};return null!=r&&r.attachment_id?(r.version&&(u.queryParams=u.queryParams||{},u.queryParams.version=r.version),e.request.post(e.getApiTeamUrl()+"projects/"+t+"/model/"+n+"/attachment/"+r.attachment_id+"/importasync",r,u)):(u.contentType=!1,e.request.post(e.getApiTeamUrl()+"projects/"+t+"/model/"+n+"/importasync",r,u))}},re=function(e){this.post=function(t,n){return e.request.post(e.getApiTeamUrl()+"projects/"+t+"/issues",n)},this.get=function(t){return e.request.get(e.getApiTeamUrl()+"issues/"+t)},this.postPin=function(t,n){return e.request.post(e.getApiTeamUrl()+"issues/"+t+"/pins",n)},this.getPins=function(t){return e.request.get(e.getApiTeamUrl()+"issues/"+t+"/pins")},this.deletePins=function(t){return e.request.del(e.getApiTeamUrl()+"issues/"+t+"/pins")},this.postComment=function(t,n){return e.request.post(e.getApiTeamUrl()+"issues/"+t+"/comments",n)},this.getComments=function(t){return e.request.get(e.getApiTeamUrl()+"issues/"+t+"/comments")},this.deleteComments=function(t){return e.request.del(e.getApiTeamUrl()+"issues/"+t+"/comments")},this.postAttachment=function(t,n){return e.request.post(e.getApiTeamUrl()+"issues/"+t+"/attachments",n)},this.getAttachments=function(t){return e.request.get(e.getApiTeamUrl()+"issues/"+t+"/attachments")},this.deleteAttachments=function(t){return e.request.del(e.getApiTeamUrl()+"issues/"+t+"/attachments")},this.put=function(t,n,r){return e.request.put(e.getApiTeamUrl()+"issues/"+t,n,r?{queryParams:r}:void 0)},this.delete=function(t,n){var r={queryParams:{forceDelete:n}};return e.request.del(e.getApiTeamUrl()+"issues/"+t,null,n?r:null)},this.getRights=function(t){return e.request.get(e.getApiTeamUrl()+"issues/"+t+"/rights")},this.getIssueTypes=function(){return e.request.get(e.getApiTeamUrl()+"lib/issuetypes")},this.getReports=function(t){return e.request.get(e.getApiTeamUrl()+"issues/"+t+"/reports")},this.importBcf=function(t,n){return e.request.put(e.getApiTeamUrl()+"projects/"+t+"/issues/bcf",n,{contentType:!1,processData:!1})},this.updateImportBcf=function(t,n){return e.request.put(e.getApiTeamUrl()+"projects/"+t+"/issues/bcf",n)},this.exportBcf=function(t,n,r){return t?e.request.post(e.getApiTeamUrl()+"projects/"+t+"/issues/export/bcf"+(r?"?version="+r:""),n):e.request.post(e.getApiTeamUrl()+"issues/export/bcf"+(r?"?version="+r:""),n)},this.exportExcel=function(t,n){return t?e.request.post(e.getApiTeamUrl()+"projects/"+t+"/issues/export/excel",n):e.request.post(e.getApiTeamUrl()+"issues/export/excel",n)}},ie=function(e){this.get=function(t){return e.request.get(e.getApiTeamUrl()+"labels/"+t)},this.delete=function(t){return e.request.del(e.getApiTeamUrl()+"labels/"+t)},this.put=function(t,n){return e.request.put(e.getApiTeamUrl()+"labels/"+t,n)}},oe=function(e){this.lockObject=function(t,n){return e.request.put(e.getApiTeamUrl()+"objects/"+t+"/locks",n,{dataType:"text"})},this.checkLocked=function(t){return e.request.get(e.getApiTeamUrl()+"objects/"+t+"/locks")},this.deleteLock=function(t,n){return!0===n?e.request.del(e.getApiTeamUrl()+"objects/"+t+"/locks?asAdmin=true"):e.request.del(e.getApiTeamUrl()+"objects/"+t+"/locks")},this.getLocksWithChildren=function(t){return e.request.get(e.getApiTeamUrl()+"objects/"+t+"/locks?withChildren=true")}},se=function(e){this.post=function(t){return e.request.post(e.getApiTeamUrl()+"members",t)},this.get=function(){return e.request.get(e.getApiTeamUrl()+"members")},this.putUser=function(t,n,r){return e.request.put(e.getApiTeamUrl()+"members/"+n,r)},this.deleteUser=function(t,n){return e.request.del(e.getApiTeamUrl()+"members/"+n)}},ue=function(e){this.post=function(t){return e.request.post(e.getApiUrl()+"messages",t)},this.getUserMessages=function(t){return e.request.get(e.getApiUrl()+"user/"+t+"/messages")},this.getUserDashboardMessages=function(t){return e.request.get(e.getApiUrl()+"user/"+t+"/messages?topic=dashboard")},this.getSentUserMessages=function(t){return e.request.get(e.getApiUrl()+"user/"+t+"/messages/sent")},this.getSentGroupMessages=function(t){return e.request.get(e.getApiUrl()+"user/"+t+"/messages/groupsent")},this.get=function(t){return e.request.get(e.getApiUrl()+"messages/"+t)},this.getFiltered=function(t){return e.request.get(e.getApiUrl()+"messages/",{queryParams:{filter:t}})},this.deleteMessage=function(t){return e.request.del(e.getApiUrl()+"messages/"+t)},this.markAsRead=function(t){return e.request.post(e.getApiUrl()+"messages/"+t+"/markasreadbrowser",null,{dataType:null,contentType:null})},this.updateDashboardAdditionalData=function(t,n){return e.request.put(e.getApiUrl()+"messages/"+t+"/updatedashboardadditionaldata",n)},this.addDashboardMessageAttachment=function(t,n,r){return e.request.put(e.getApiUrl()+"messages/"+t+"/upload?type=dashboard",n,r)},this.getAllMessagingGroups=function(){return e.request.get(e.getApiUrl()+"systemgroups")},this.getMessagingGroupsDetails=function(t){return e.request.get(e.getApiUrl()+"systemgroups/"+t)}},ae=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!")),Promise.resolve(!1))},this.getDisciplines=function(t){return e.request.get(e.getApiTeamUrl()+"divisions/"+t+"/disciplines")},this.setDisciplineValidity=function(t,n,r){var i={private:!r};return e.request.put(e.getApiTeamUrl()+"divisions/"+t+"/disciplines/"+n,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,n){return e.request.post(e.getApiTeamUrl()+"divisions/"+t+"/revisions",n)},this.put=function(t,n){return e.request.put(e.getApiTeamUrl()+"divisions/"+t,n)},this.download=function(t){return e.request.get(e.getApiTeamUrl()+"divisions/"+t+"/download")},this.delete=function(t){return e.request.del(e.getApiTeamUrl()+"divisions/"+t)},this.move=function(t,n){return e.request.put(e.getApiTeamUrl()+"divisions/"+t+"/move",n)}},ce=["topology","structure"],le=function(e){this.get=function(t,n){var r={};return t&&(r.object_id=t),n&&(r.project_id=n),e.request.get(e.getApiTeamUrl()+"settings/filters",{queryParams:r})},this.getFilteredObjects=function(t,n,r,i){if(r)return e.request.get(e.getApiTeamUrl()+"projects/"+t+"/filters/"+n+"/properties",{queryParams:r});if(i&&ce.find((function(e){return e===i}))){var o={};return o[i]=!0,e.request.get(e.getApiTeamUrl()+"projects/"+t+"/filters/"+n,{queryParams:o})}return e.request.get(e.getApiTeamUrl()+"projects/"+t+"/filters/"+n)},this.getSelectionFilteredObjects=function(t,n,r,i){if(r)return e.request.get(e.getApiTeamUrl()+"selections/"+t+"/filters/"+n+"/properties",{queryParams:r});if(i&&ce.find((function(e){return e===i}))){var o={};return o[i]=!0,e.request.get(e.getApiTeamUrl()+"selections/"+t+"/filters/"+n,{queryParams:o})}return e.request.get(e.getApiTeamUrl()+"selections/"+t+"/filters/"+n)},this.applyFilter=function(t){return e.request.get(e.getApiTeamUrl()+"filters/"+t)},this.post=function(t,n){var r={};return n&&(r.project_id=n),e.request.post(e.getApiTeamUrl()+"settings/filter",t,{queryParams:r})},this.put=function(t){return e.request.put(e.getApiTeamUrl()+"settings/filter",t)},this.delete=function(t){return e.request.del(e.getApiTeamUrl()+"settings/filter/"+t)},this.getFilter=function(t){return e.request.get(e.getApiTeamUrl()+"settings/filters/"+t)}},fe=function(e){this.post=function(t){return e.request.post(e.getApiTeamUrl()+"objects/",t)},this._buildQueryParams=function(e){var t={};return e.revision&&(t.revision=e.revision),e.projectId&&(t.projectId=e.projectId),e.shortInfo&&(t.shortinfo=e.shortInfo),e.type&&(t.type=e.type),{queryParams:t}},this.get=function(t,n,r,i,o,s){var u={revision:n,projectId:i,shortInfo:o,type:s},a=this._buildQueryParams(u),c=e.getApiTeamUrl()+"objects/"+t;return r&&(c+="/properties/",c+=r),e.request.get(c,n||i||o||s?a:void 0)},this.getInternal=function(t,n){var r={};n&&(r.queryParams={revision:n});var i=e.getApiTeamUrl()+"objects/"+t;return i+="/internal",e.request.get(i,n?r:void 0)},this.head=function(t,n){var r={};return n&&(r.queryParams={revision:n}),e.request.head?e.request.head(e.getApiTeamUrl()+"objects/"+t,n?r:void 0):(console.warn("BimWebSdk: request (objects/".concat(t,") does not support head method! Using get as fallback.")),e.request.get(e.getApiTeamUrl()+"objects/"+t,n?r:void 0))},this.getTopology=function(t,n,r,i,o){var s={};return(n||r||i)&&(s.queryParams={},n&&(s.queryParams.revision=n),r&&(s.queryParams.hideElements=r),i&&(s.queryParams.shortinfo=i)),o&&(s.responseBatch=o),e.request.get(e.getApiTeamUrl()+"objects/"+t+"/topology",s)},this.getGeometryThreeJS=function(t){var n,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{chunked:null,revision:null,lod:null,batch:null,chunkSize:null,properties:null},o={};return(i.revision||i.lod||i.chunkSize)&&(o.queryParams={},i.revision&&(o.queryParams.revision=i.revision),i.lod&&(o.queryParams.levelofdetail=i.lod),i.chunkSize&&(o.queryParams.chunkSize=i.chunkSize)),i.batch&&(o.responseBatch=i.batch),n=r?e.getApiTeamUrl()+"objects/"+t+"/disciplines/"+r+"/geometries/threejs":e.getApiTeamUrl()+"objects/"+t+"/geometries/threejs",i.properties&&(n+="/properties/",n+=i.properties),i.chunked?e.request.getChunked(n,o):e.request.get(n,o)},this._buildGetGeoAjaxOptions=function(e){var t={dataType:"binary",processData:!1,responseType:"arraybuffer",useXMLHttpRequest:!0,queryParams:{}};return e.revision&&(t.queryParams.revision=e.revision),e.lod&&(t.queryParams.levelofdetail=e.lod),e.vertexNormals&&(t.queryParams.vertexNormals=e.vertexNormals),e.smoothingAngle&&(t.queryParams.smoothingAngle=e.smoothingAngle),e.topology&&(t.queryParams.topology=e.topology),e.edges&&(t.queryParams.edges=e.edges),e.version&&(t.queryParams.version=e.version),e.batch&&(t.responseBatch=e.batch),t},this.getGeometryGLB=function(t){var n,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{chunked:null,revision:null,lod:null,batch:null,vertexNormals:null,smoothingAngle:null,topology:null,edges:null,version:null},o=this._buildGetGeoAjaxOptions(i);return n=r?e.getApiTeamUrl()+"objects/"+t+"/disciplines/"+r+"/geometries/glb":e.getApiTeamUrl()+"objects/"+t+"/geometries/glb",i.chunked?e.request.getChunked(n,o):e.request.get(n,o)},this.getGLB=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;return this.getGeometryGLB(e,null,{version:t})},this.getGeometryTemplatesThreeJS=function(t,n,r,i,o,s){var u={};null===i&&null===o||(u.queryParams={},null!==i&&(u.queryParams.revision=i),null!==o&&(u.queryParams.levelofdetail=o)),s&&(u.responseBatch=s);var a=e.getApiTeamUrl()+"objects/"+t+"/disciplines/"+n+"/templates/threejs";return r?e.request.getChunked(a,u):e.request.get(a,u)},this.getGeometryCompressed=function(t,n){return n?e.request.get(e.getApiTeamUrl()+"objects/"+t+"/disciplines/"+n+"/geometries/meshblob"):e.request.get(e.getApiTeamUrl()+"objects/"+t+"/geometries/meshblob")},this.getProperties=function(t,n){return e.request.get(e.getApiTeamUrl()+"objects/"+t+"/geometries/threejs/properties"+n)},this.put=function(t,n,r){var i={};return r&&(i.projectid=r),e.request.put(e.getApiTeamUrl()+"objects/"+t,n,{queryParams:i})},this.postComment=function(t,n){return e.request.post(e.getApiTeamUrl()+"objects/"+t+"/comments",n)},this.getComments=function(t){return e.request.get(e.getApiTeamUrl()+"objects/"+t+"/comments")},this.deleteComments=function(t){return e.request.del(e.getApiTeamUrl()+"objects/"+t+"/comments")},this.postAttachment=function(t,n,r,i){return e.request.post(e.getApiTeamUrl()+"objects/"+t+"/attachments",n,{contentType:!1,processData:!1,dataType:null,xhrUploadProgress:r,queryParams:i?{DocumentFolderId:i}:void 0})},this.createAttachmentChunked=function(t,n,r,i){var o=arguments.length>4&&void 0!==arguments[4]?arguments[4]:{},s=e.getApiTeamUrl()+"objects/"+t+"/attachments/chunked",u={file:n,uploadProgress:r,documentFolderId:i,opts:o},a={queryParams:{}};return i&&(a.queryParams={DocumentFolderId:i}),e.request.putChunked(s,u,a)},this.getAttachments=function(t,n){return e.request.get(e.getApiTeamUrl()+"objects/"+t+"/attachments",n?{queryParams:{revision:n}}:void 0)},this.deleteAttachments=function(t){return e.request.del(e.getApiTeamUrl()+"objects/"+t+"/attachments")},this.postAttachmentLink=function(t,n){return e.request.post(e.getApiTeamUrl()+"objects/"+t+"/attachmentlinks",n)},this.getAttachmentLinks=function(t,n){return e.request.get(e.getApiTeamUrl()+"objects/"+t+"/attachmentlinks",n?{queryParams:{revision:n}}:void 0)},this.deleteAttachmentLink=function(t,n){return e.request.del(e.getApiTeamUrl()+"objects/"+t+"/attachmentlinks/"+n)},this.postHyperlink=function(t,n){return e.request.post(e.getApiTeamUrl()+"objects/"+t+"/hyperlinks",n)},this.getHyperlinks=function(t){return e.request.get(e.getApiTeamUrl()+"objects/"+t+"/hyperlinks")},this.deleteHyperlinks=function(t){return e.request.del(e.getApiTeamUrl()+"objects/"+t+"/hyperlinks")},this.delete=function(t){return e.request.del(e.getApiTeamUrl()+"objects/"+t)},this.getAttributes=function(t,n,r,i){var o=n?"&documentversion="+n:"",s=i?"&revision="+i:"",u=r?"&projectid="+r:"",a=e.getApiTeamUrl()+"objects/"+t+"?freeattributes=true";return e.request.get(a+o+s+u)},this.getAttributesAsFlatStructure=function(t,n,r,i){var o=n?"&documentversion="+n:"",s=i?"&revision="+i:"",u=r?"&projectid="+r:"",a=e.getApiTeamUrl()+"objects/"+t+"?freeattributes=true&internal=true&attributedefinition=true";return e.request.get(a+o+s+u)},this.getAttributeValues=function(t,n){return e.request.get(e.getApiTeamUrl()+"objects/"+t+"/attributes/"+n+"?children=true")},this.getComplexPropertiesTopology=function(t,n){return e.request.get(e.getApiTeamUrl()+"objects/"+t+"/complexproperties"+(n>=0?"?revision="+n:""))},this.postThumbnail=function(t,n,r){return e.request.post(e.getApiTeamUrl()+"objects/"+t+"/thumbnail",n,{contentType:!1,processData:!1,dataType:null,xhrUploadProgress:r})},this.deleteThumbnail=function(t){return e.request.del(e.getApiTeamUrl()+"objects/"+t+"/thumbnail")},this.addChildObject=function(t){return e.request.post(e.getApiTeamUrl()+"objects/alter/",t)},this.getReports=function(t,n,r){return e.request.get(e.getApiTeamUrl()+"objects/"+t+"/reports?version="+n+"&action="+r)},this.exportExcelReports=function(t,n){return e.request.post(e.getApiTeamUrl()+"projects/"+t+"/reports/export/excel",n)},this.postDimensions=function(t,n){return e.request.post(e.getApiTeamUrl()+"objects/"+t+"/dimensionlines",n)},this.putDimensions=function(t,n){return e.request.put(e.getApiTeamUrl()+"objects/"+t+"/dimensionlines",n)},this.getDimensions=function(t){return e.request.get(e.getApiTeamUrl()+"objects/"+t+"/dimensionlines")},this.deleteDimensions=function(t){return e.request.del(e.getApiTeamUrl()+"objects/"+t+"/dimensionlines")},this.postLabels=function(t,n){return e.request.post(e.getApiTeamUrl()+"objects/"+t+"/labels",n)},this.putLabels=function(t,n){return e.request.put(e.getApiTeamUrl()+"objects/"+t+"/labels",n)},this.getLabels=function(t){return e.request.get(e.getApiTeamUrl()+"objects/"+t+"/labels")},this.deleteLabels=function(t){return e.request.del(e.getApiTeamUrl()+"objects/"+t+"/labels")},this.postAnnotations=function(t,n){return e.request.post(e.getApiTeamUrl()+"objects/"+t+"/annotations",n)},this.putAnnotations=function(t,n){return e.request.put(e.getApiTeamUrl()+"objects/"+t+"/annotations",n)},this.getAnnotations=function(t){return e.request.get(e.getApiTeamUrl()+"objects/"+t+"/annotations")},this.deleteAnnotations=function(t){return e.request.del(e.getApiTeamUrl()+"objects/"+t+"/annotations")},this.getObjectIdsByQuery=function(t,n,r,i){var o=Array.isArray(i)?i.join(","):void 0,s={queryParams:{}};return s.queryParams[n]=r,o&&(s.queryParams.divisions=o),e.request.get(e.getApiTeamUrl()+"objects/"+t+"/query",s)},this.getObjectIdsByIfcId=function(e,t,n){return this.getObjectIdsByQuery(e,"93027bad-df91-48ee-a0bb-60a8184cddba",t,n)},this.postOverlay=function(t){return e.request.post(e.getApiTeamUrl()+"objects/",t)},this.getOverlays=function(t){return e.request.get(e.getApiTeamUrl()+"objects/"+t+"/overlays")},this.getOverlay=function(e){return this.getInternal(e)},this.deleteOverlay=function(t){return e.request.del(e.getApiTeamUrl()+"objects/"+t)},this.deleteOverlays=function(t){return e.request.del(e.getApiTeamUrl()+"objects/"+t+"/overlays")},this.getThumbnail=function(t){var n=e.getApiTeamUrl()+"objects/"+t+"/thumbnail/download";return e.request.get(n,{useXMLHttpRequest:!0,dataType:"binary",processData:!1,responseType:"arraybuffer"})}},pe=function(e){this.get=function(t){return e.request.get(e.getApiTeamUrl()+"overlays/"+t)},this.put=function(t,n){return e.request.put(e.getApiTeamUrl()+"overlays/"+t,n)},this.delete=function(t){return e.request.del(e.getApiTeamUrl()+"overlays/"+t)}},he=function(e){this.get=function(t){return e.request.get(e.getApiTeamUrl()+"overlaysets/"+t)},this.put=function(t,n){return e.request.put(e.getApiTeamUrl()+"overlaysets/"+t,n)},this.delete=function(t){return e.request.del(e.getApiTeamUrl()+"overlaysets/"+t)},this.postOverlay=function(t,n){return e.request.post(e.getApiTeamUrl()+"overlaysets/"+t+"/overlays",n)},this.getOverlays=function(t){return e.request.get(e.getApiTeamUrl()+"overlaysets/"+t+"/overlays")}},de=function(e){this.get=function(t){return e.request.get(e.getApiTeamUrl()+"pins/"+t)},this.delete=function(t){return e.request.del(e.getApiTeamUrl()+"pins/"+t)},this.put=function(t,n){return e.request.put(e.getApiTeamUrl()+"pins/"+t,n)}},ge=function(e){this.get=function(){return e.request.get(e.getApiUrl()+"project-actions-rights/")}},me=function(e){var t="projectattributetemplates";this.post=function(n){return e.request.post(e.getApiTeamUrl()+t,n)},this.get=function(n,r){var i=r?{queryParams:{default:r}}:null;return n?e.request.get(e.getApiTeamUrl()+t+"/"+n):e.request.get(e.getApiTeamUrl()+t,i)},this.put=function(n,r){return e.request.put(e.getApiTeamUrl()+t+"/"+n,r)},this.delete=function(n){return e.request.del(e.getApiTeamUrl()+t+"/"+n)},this.copyFrom=function(n,r){return e.request.put(e.getApiTeamUrl()+t+"/"+r+"/copyfrom",JSON.stringify({id:n}))},this.setDefault=function(n){return e.request.put(e.getApiTeamUrl()+t+"/"+n+"/default")}};function ye(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,i,o,s,u=[],a=!0,c=!1;try{if(o=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;a=!1}else for(;!(a=(r=o.call(n)).done)&&(u.push(r.value),u.length!==t);a=!0);}catch(e){c=!0,i=e}finally{try{if(!a&&null!=n.return&&(s=n.return(),Object(s)!==s))return}finally{if(c)throw i}}return u}}(e,t)||function(e,t){if(e){if("string"==typeof e)return ve(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?ve(e,t):void 0}}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function ve(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}var be=function(e){this.post=function(t){return e.request.post(e.getApiTeamUrl()+"projects",t)},this.createFromExisting=function(t){return e.request.post(e.getApiTeamUrl()+"projects/copyfrom",t)},this.put=function(t,n){return e.request.put(e.getApiTeamUrl()+"projects/"+t,n)},this.get=function(t,n,r,i,o){var s={queryParams:o||{}};return n&&(s.queryParams.disciplines=!1),i&&(s.queryParams.recycleBin=!0),t?e.request.get(e.getApiTeamUrl()+"projects/"+t,s):r?e.request.get(e.getApiUrl()+r+"/projects",s):e.getTeamSlug()?e.request.get(e.getApiTeamUrl()+"projects",s):e.request.get(e.getApiUrl()+"/projects",s)},this.delete=function(t){return e.request.del(e.getApiTeamUrl()+"projects/"+t)},this.moveToRecycleBin=function(t){return e.request.del(e.getApiTeamUrl()+"projects/"+t+"?moveToRecycleBin=true")},this.restoreFromRecycleBin=function(t){return e.request.put(e.getApiTeamUrl()+"objects/"+t+"/restore",JSON.stringify({}),{dataType:"text"})},this.deleteFromRecycleBin=function(t){return e.request.del(e.getApiTeamUrl()+"projects/"+t+"?fromRecycleBin=true")},this.deleteServerCache=function(t){return e.request.del(e.getApiTeamUrl()+"projects/"+t+"/deletecache")},this.clearServerDecimation=function(t,n,r){return n||(n="00000000-0000-0000-0000-000000000000"),(r<0||!r&&0!=r)&&(r="100"),e.request.del(e.getApiTeamUrl()+"temporary/projects/"+t+"/disciplines/"+n+"/levelofdetails/"+r)},this.getModels=function(t){return e.request.get(e.getApiTeamUrl()+"projects/"+t+"/divisions")},this.postModel=function(t,n){return e.request.post(e.getApiTeamUrl()+"projects/"+t+"/divisions",n)},this.getMembers=function(t){return e.request.get(e.getApiTeamUrl()+"projects/"+t+"/members")},this.postMember=function(t,n){return e.request.post(e.getApiTeamUrl()+"projects/"+t+"/members",n)},this.putMember=function(t,n){return e.request.put(e.getApiTeamUrl()+"projects/"+t+"/members",n)},this.deleteMember=function(t,n){return e.request.del(e.getApiTeamUrl()+"projects/"+t+"/members",n)},this.getPins=function(t){return e.request.get(e.getApiTeamUrl()+"projects/"+t+"/pins")},this.putProject=function(t,n){return e.request.put(e.getApiTeamUrl()+"projects/"+t,n)},this.postAttachment=function(t,n){return e.request.post(e.getApiTeamUrl()+"projects/"+t+"/attachments",n)},this.getAttachments=function(t,n,r){var i=r;return i||(i={}),n&&(i.revision=n),e.request.get(e.getApiTeamUrl()+"projects/"+t+"/attachments",n||r?{queryParams:i}:void 0)},this.deleteAttachments=function(t){return e.request.del(e.getApiTeamUrl()+"projects/"+t+"/attachments")},this.getTopology=function(t){return e.request.get(e.getApiTeamUrl()+"projects/"+t+"/topology")},this.getSpots=function(t){return e.request.get(e.getApiTeamUrl()+"projects/"+t+"/pins")},this.postThumbnail=function(t,n,r){return e.request.post(e.getApiTeamUrl()+"projects/"+t+"/thumbnail",n,{contentType:!1,processData:!1,dataType:null,xhrUploadProgress:r})},this.getThumbnail=function(t){return e.request.get(e.getApiTeamUrl()+"thumbnail/"+t)},this.deleteThumbnail=function(t){return e.request.del(e.getApiTeamUrl()+"projects/"+t+"/thumbnail")},this.getComments=function(t){return e.request.get(e.getApiTeamUrl()+"projects/"+t+"/comments")},this.getHyperlinks=function(t){return e.request.get(e.getApiTeamUrl()+"projects/"+t+"/hyperlinks")},this.getIssues=function(t,n,r){var i=r||n?"?":"",o=r&&n?"&":"",s=r?"scenethumbnail="+r:"";return e.request.get(e.getApiTeamUrl()+"projects/"+t+"/issues"+i+(n?"scene=false":"")+o+s)},this.getIssuesShortInfo=function(t){var n=function(){var e=ye((new Date).toString().split("GMT"),2),t=e[0],n=e[1];if(!t||!n)return"";var r=new Date(t+"UTC").toISOString().split(".")[0],i=(n=n.split(" ")[0]).slice(0,3)+":"+n.slice(3);return r&&i?r+i:""}();return e.request.get(e.getApiTeamUrl()+"projects/"+t+"/issues?shortinfo=true"+(n?"&currenttime="+n:""))},this.postSlideshow=function(t,n){return e.request.post(e.getApiTeamUrl()+"projects/"+t+"/slideshows",n)},this.getSlideshows=function(t){return e.request.get(e.getApiTeamUrl()+"projects/"+t+"/slideshows")},this.deleteSlideshows=function(t){return e.request.del(e.getApiTeamUrl()+"projects/"+t+"/slideshows")},this.exportSlideshowToPDF=function(t,n){var r={slideShowId:n};return e.request.post(e.getApiTeamUrl()+"projects/"+t+"/slideshow/export/pdf",JSON.stringify(r))},this.getProjectInfo=function(t,n){var r={queryParams:n||{}};return e.request.get(e.getApiTeamUrl()+"projects/"+t,r)},this.postOverlaySet=function(t,n){return e.request.post(e.getApiTeamUrl()+"projects/"+t+"/overlaysets",n)},this.getOverlaySets=function(t){return e.request.get(e.getApiTeamUrl()+"projects/"+t+"/overlaysets")},this.deleteOverlaySets=function(t){return e.request.del(e.getApiTeamUrl()+"projects/"+t+"/overlaysets")}},we=function(e){this.postRevision=function(t,n){return e.request.post(e.getApiTeamUrl()+"divisions/"+t+"/revisions",n)},this.getRevisionList=function(t){return e.request.get(e.getApiTeamUrl()+"divisions/"+t+"/revisions")},this.getRevisionInfo=function(t){return e.request.get(e.getApiTeamUrl()+"revisions/"+t)},this.postRevisionInfo=function(t,n){return e.request.post(e.getApiTeamUrl()+"revisions/"+t,n)},this.putRevisionInfo=function(t,n){return e.request.put(e.getApiTeamUrl()+"revisions/"+t,n)},this.getRevisionsComparisonResult=function(t,n,r,i){return e.request.get(e.getApiTeamUrl()+"divisions/"+t+"/revisionscomparison/"+n+"/"+r,i)},this.compareRevisions=function(t,n,r,i){return e.request.post(e.getApiTeamUrl()+"divisions/"+t+"/revisionscomparison/"+n+"/"+r,null,i)},this.excelExportRevisionsComparisonResult=function(t,n,r,i){return e.request.post(e.getApiTeamUrl()+"divisions/"+t+"/revisionscomparison/"+n+"/"+r+"/export/excel",i)}},Te=function(e){this.getRoles=function(t){return t?e.request.get(e.getApiTeamUrl()+"projects/"+t+"/members"):e.request.get(e.getApiTeamUrl()+"roles")},this.postUserRole=function(t,n){return e.request.post(e.getApiTeamUrl()+"projects/"+t+"/members",n)},this.putUserRole=function(t,n){return e.request.put(e.getApiTeamUrl()+"projects/"+t+"/members",n)},this.deleteUser=function(t){return e.request.del(e.getApiTeamUrl()+"projects/"+t+"/members")}},xe=function(e){this.get=function(t,n){if(t||n){var r={queryParams:{}};return void 0!==t&&(r.queryParams.rights=t),void 0!==n&&(r.queryParams.customrole=n),e.request.get(e.getApiTeamUrl()+"roles/",r)}return e.request.get(e.getApiTeamUrl()+"roles/")},this.getAllRights=function(t){if(t){var n={queryParams:{globalfreeattributes:t.globalfreeattributes,global:t.global,project:t.project,document:t.document,layer:t.layer}};return e.request.get(e.getApiTeamUrl()+"rights",n)}return e.request.get(e.getApiTeamUrl()+"rights")},this.post=function(t){return e.request.post(e.getApiTeamUrl()+"roles/",t)},this.getRoleDetails=function(t){return e.request.get(e.getApiTeamUrl()+"roles/"+t)},this.updateRole=function(t,n){return e.request.put(e.getApiTeamUrl()+"roles/"+t,n)},this.deleteRole=function(t){return e.request.del(e.getApiTeamUrl()+"roles/"+t)}},Ae=function(e){this.calculateCutSection=function(t){var n,r=arguments.length>1&&void 0!==arguments[1]&&arguments[1],i={cuttingCalculation:{projectId:t.projectId,cuttingPlanes:t.cuttingPlanes,selection:{modelLayer:t.modelLayer,topologyNodes:t.topologyNodes,hiddenObjects:t.hiddenObjects},settings:t.settings},runAsync:r};if("glb"===(null===(n=i.cuttingCalculation)||void 0===n||null===(n=n.settings)||void 0===n?void 0:n.responseGeometry)){return e.request.post(e.getApiTeamUrl()+"services/CuttingCalculation",JSON.stringify(i),{useXMLHttpRequest:!0,dataType:"binary",processData:!1,responseType:"arraybuffer"})}return e.request.post(e.getApiTeamUrl()+"services/CuttingCalculation",JSON.stringify(i))}},qe=function(e){this.post=function(t){return e.request.post(e.getApiTeamUrl()+"share",t)}},ke=function(e){this.get=function(t){return e.request.get(e.getApiTeamUrl()+"slides/"+t)},this.put=function(t,n){return e.request.put(e.getApiTeamUrl()+"slides/"+t,n)},this.delete=function(t){return e.request.del(e.getApiTeamUrl()+"slides/"+t)},this.postThumbnail=function(t,n){return e.request.post(e.getApiTeamUrl()+"slides/"+t+"/thumbnail",n)}},_e=function(e){this.get=function(t){return e.request.get(e.getApiTeamUrl()+"slideshows/"+t)},this.put=function(t,n){return e.request.put(e.getApiTeamUrl()+"slideshows/"+t,n)},this.delete=function(t){return e.request.del(e.getApiTeamUrl()+"slideshows/"+t)},this.postSlide=function(t,n){return e.request.post(e.getApiTeamUrl()+"slideshows/"+t+"/slides",n)},this.getSlides=function(t){return e.request.get(e.getApiTeamUrl()+"slideshows/"+t+"/slides")},this.postThumbnail=function(t,n){return e.request.post(e.getApiTeamUrl()+"slideshows/"+t+"/thumbnail",n)},this.getThumbnail=function(t){return e.request.get(e.getApiTeamUrl()+"thumbnail/"+t)}},je=function(e){this.postStructure=function(t,n){return e.request.post(e.getApiTeamUrl()+"projects/"+t+"/structures",n)},this.postStructureTopology=function(t,n){return e.request.post(e.getApiTeamUrl()+"structures/"+t+"/topology",n)},this.postSubNode=function(t,n){return e.request.post(e.getApiTeamUrl()+"structures/"+t,n)},this.postAssignedObject=function(t,n,r,i){return e.request.post(e.getApiTeamUrl()+"structures/"+t+"/assign/"+n+"?varianttype="+r,i)},this.attributeAssign=function(t,n,r,i){var o={attributeId:r};return i&&(o.variantType=i),e.request.put(e.getApiTeamUrl()+"projects/"+t+"/structures/"+n+"/attributeassign",JSON.stringify(o))},this.deleteAssignedObject=function(t,n,r,i){var o=[i?"removeAllNodes=true":"",r?"varianttype=true":""].filter((function(e){return e})).join("&");return e.request.del(e.getApiTeamUrl()+"structures/"+t+"/delete/"+n+"?"+o)},this.getStructure=function(t,n,r){return n?e.request.get(e.getApiTeamUrl()+"structures/"+n):e.request.get(e.getApiTeamUrl()+"projects/"+t+"/structures"+(r?"?type="+r:""))},this.getTopology=function(t,n,r){return void 0===r||""==r?e.request.get(e.getApiTeamUrl()+"structures/"+t+"/topology?varianttype="+n):!0===r?e.request.get(e.getApiTeamUrl()+"structures/"+t+"/topology?varianttype="+n+"&attributes=true"):void 0},this.getTopologyStructure=function(t,n){return e.request.get(e.getApiTeamUrl()+"projects/"+t+"/topologystructure",n?{queryParams:n}:void 0)},this.resetTopologyStructure=function(t,n){return e.request.put(e.getApiTeamUrl()+"projects/"+t+"/topologystructure/reset",void 0,n?{queryParams:n}:void 0)},this.copyStructure=function(t,n,r){return e.request.post(e.getApiTeamUrl()+"structures/"+t+"/copy?elementRelation="+r+"&attributes=true",n)},this.putStructure=function(t,n,r){var i=r?"?applyToChild=true":"";return e.request.put(e.getApiTeamUrl()+"structures/"+t+i,n)},this.reorderStructure=function(t,n){return e.request.put(e.getApiTeamUrl()+"structures/"+t+"/reorder?varianttype="+n)},this.deleteStructure=function(t,n,r){return r?e.request.del(e.getApiTeamUrl()+"structures/"+t+"?forceDelete=true"):n?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,n){return e.request.post(e.getApiTeamUrl()+"projects/"+t+"/variants",n)},this.getVariantType=function(t,n){return n?e.request.get(e.getApiTeamUrl()+"projects/"+t+"/variants/"+n):e.request.get(e.getApiTeamUrl()+"projects/"+t+"/variants")},this.deleteVariantType=function(t,n){return e.request.del(e.getApiTeamUrl()+"projects/"+t+"/variants/"+n)},this.copyElementsToVariant=function(t,n,r){return e.request.put(e.getApiTeamUrl()+"projects/"+t+"/variants/"+n+"/copyfrom",r)}},Ue=function(e){this.get=function(){return e.request.get(e.getApiUrl()+"team-actions-rights/")}},Se=function(e){this.get=function(t,n){var r={queryParams:{}};return n&&(r.queryParams.filterEmpty=n),t?e.request.get(e.getApiUrl()+"teams/"+t,r):e.request.get(e.getApiUrl()+"teams",r)},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")}},Pe=function(e){this.get=function(t,n){var r={language:t};return n&&(r.type=n),e.request.get(e.getApiUrl()+"terms/download",{queryParams:r,dataType:"html"})}},Ee=function(e){this.get=function(t,n){var r={language:t};return n&&(r.type=n),e.request.get(e.getApiUrl()+"dataprotectiondeclarations/download",{queryParams:r,dataType:"html"})},this.getForbiddenEmails=function(){return e.request.get(e.getApiUrl()+"restrictedemails")}},Ce=function(e){this.get=function(t,n){var r={language:t};return n&&(r.type=n),e.request.get(e.getApiUrl()+"imprints/download",{queryParams:r,dataType:"html"})}},De=function(e){this.post=function(t){return e.request.post(e.getApiUrl()+"content/units/",t)},this.get=function(t){return t?e.request.get(e.getApiUrl()+"content/units/"+t):e.request.get(e.getApiUrl()+"content/units/")},this.put=function(t,n){return e.request.put(e.getApiUrl()+"content/units/"+t,n)},this.delete=function(t){return e.request.del(e.getApiUrl()+"content/units/"+t)}},Oe=function(e){this.get=function(t){return t?e.request.get(e.getApiUrl()+"user",{token:t}):e.request.get(e.getApiUrl()+"user")},this.put=function(t,n){var r=e.getApiUrl()+"user";return n?e.request.put(r,t,{token:n}):e.request.put(r,t)},this.setPassword=function(t,n,r){var i=e.getApiUrl()+"user/set_password";return t&&(i+=t),r?e.request.put(i,n,{token:r}):e.request.put(i,n)},this.post=function(t){return e.request.post(e.getApiUrl()+"user",t)},this.postPhoto=function(t){return e.request.post(e.getApiUrl()+"user/photo",t,{contentType:!1,processData:!1})},this.deletePhoto=function(){return e.request.del(e.getApiUrl()+"user/photo")},this.getPhoto=function(){return e.request.get(e.getApiUrl()+"user/photo")},this.putPassword=function(t){return e.request.put(e.getApiUrl()+"user/change_password",t)},this.getSubscriptions=function(t){return t?e.request.get(e.getApiUrl()+"user/accountsettings/"+t):e.request.get(e.getApiUrl()+"user/accountsettings")}},Re=function(e){this.post=function(t){return e.request.post(e.getApiUrl()+"users",t)},this.exist=function(t){return e.request.get(e.getApiUrl()+"users/exist",{queryParams:{email:t}})},this.put=function(t,n){return e.request.put(e.getApiUrl()+"users/"+t,n)},this.delete=function(t){return e.request.del(e.getApiUrl()+"users/"+t)},this.setSubscriptions=function(t,n){return e.request.post(e.getApiUrl()+"administration/users/"+t+"/accountsettings",n)}},Ie=function(e){this.postSettings=function(t,n){return e.request.post(e.getApiTeamUrl()+"userSettings/"+t,n)},this.getSettings=function(t){return e.request.get(e.getApiTeamUrl()+"userSettings/"+t)}},Ne=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,n){var r=null!=n?n:"".concat(e.getApiTeamUrl(),"invitations/");return e.request.post(r,t)},this.delete=function(t){return e.request.del(e.getApiTeamUrl()+"invitations/"+t)},this.put=function(t,n){return e.request.put(e.getApiTeamUrl()+"invitations/"+t,n)},this.accept=function(t,n){return e.request.put(e.getApiUrl()+"invitations/"+t+"/accept",n)},this.getInvitation=function(t,n){return e.request.get(e.getApiUrl()+"invitations/"+t,n)}},Be=function(e){this.post=function(t,n){return e.request.post(e.getApiTeamUrl()+"projects/"+t+"/selections",n)},this.get=function(t){return e.request.get(e.getApiTeamUrl()+"selections/"+t)},this.getAllSelections=function(t){return e.request.get(e.getApiTeamUrl()+"projects/"+t+"/selections")},this.delete=function(t){return e.request.del(e.getApiTeamUrl()+"selections/"+t)}},Me=function(e){this.postGroup=function(t,n){return e.request.post(e.getApiTeamUrl()+"projects/"+t+"/usergroups",n)},this.getGroups=function(t){return e.request.get(e.getApiTeamUrl()+"projects/"+t+"/usergroups")},this.getUsers=function(t){return e.request.get(e.getApiTeamUrl()+"usergroups/"+t)},this.deleteGroup=function(t){return e.request.del(e.getApiTeamUrl()+"usergroups/"+t)},this.putGroup=function(t,n){return e.request.put(e.getApiTeamUrl()+"usergroups/"+t,n)},this.assignUser=function(t,n){return e.request.put(e.getApiTeamUrl()+"usergroups/"+t+"/assign",n)},this.removeUser=function(t,n){return e.request.put(e.getApiTeamUrl()+"usergroups/"+t+"/remove",n)}},Ke=function(e){this.get=function(t){return e.request.get(e.getApiTeamUrl()+"scenes/"+t)},this.getObjectScenes=function(t,n){var r={};n&&(r.queryParams={shortInfo:n});var i=e.getApiTeamUrl()+"objects/"+t+"/scenes";return e.request.get(i,r)},this.post=function(t,n){return e.request.post(e.getApiTeamUrl()+"objects/"+t+"/scenes",n)},this.delete=function(t){return e.request.del(e.getApiTeamUrl()+"scenes/"+t)},this.put=function(t,n){return e.request.put(e.getApiTeamUrl()+"scenes/"+t,n)},this.postThumbnailAttachment=function(t,n,r,i){return e.request.post(e.getApiTeamUrl()+"objects/"+t+"/attachments",n,{contentType:!1,processData:!1,dataType:null,xhrUploadProgress:r,queryParams:i?{attachmenttype:"thumbnailhighresolution"}:void 0})},this.postThumbnail=function(t,n,r){return e.request.post(e.getApiTeamUrl()+"objects/"+t+"/attachments",n,{queryParams:r?{attachmenttype:"thumbnailhighresolution"}:void 0})},this.getThumbnail=function(t){return e.request.get(e.getApiTeamUrl()+"objects/"+t+"/attachments")}},Le=function(e){this.post=function(t){return e.request.post(e.getApiTeamUrl()+"services/BaseQuantities",JSON.stringify(t))}},Fe=function(e){this.createWorkflowTemplateFolder=function(t,n){return e.request.post(e.getApiTeamUrl()+"structures/"+t,n)},this.putWorkflowTemplateFolder=function(t,n){return e.request.put(e.getApiTeamUrl()+"structures/"+t,n)},this.postWorkflowTemplate=function(t,n){return e.request.post(e.getApiTeamUrl()+"projects/"+t+"/workflowtemplates",n)},this.putWorkflowTemplate=function(t,n){return e.request.put(e.getApiTeamUrl()+"workflowtemplates/"+t,n)},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,n){return e.request.post(e.getApiTeamUrl()+"projects/"+t+"/workflows",n)},this.getAllWorkflows=function(t,n){var r={queryParams:{}};return r.queryParams.status=n,e.request.get(e.getApiTeamUrl()+"projects/"+t+"/workflows",r)},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,n){return e.request.put(e.getApiTeamUrl()+"steps/"+t+"/?submit=true",n)},this.saveStep=function(t,n){return e.request.put(e.getApiTeamUrl()+"steps/"+t+"/?submit=false",n)},this.cancelWorkflow=function(t){return e.request.put(e.getApiTeamUrl()+"workflows/"+t+"/cancel")}},He=function(e){this.post=function(t){return e.request.post(e.getApiUrl()+"administration/backups",t)},this.put=function(t,n){return e.request.put(e.getApiUrl()+"administration/backups/"+t,n)},this.delete=function(t){return e.request.del(e.getApiUrl()+"administration/backups/"+t)},this.get=function(t){return e.request.get(e.getApiUrl()+"administration/backups/"+t)},this.getProjectBackups=function(t){return e.request.get(e.getApiUrl()+"administration/backups/projects/"+t)}};function We(e){return We="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},We(e)}function Ge(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,ze(r.key),r)}}function ze(e){var t=function(e,t){if("object"!=We(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!=We(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==We(t)?t:t+""}var $e=function(){return e=function e(t){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this._config=null,t?(void 0===t.version&&(t.version="v2"),this._config=t):this._config=Ve(),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 F,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 m,this._cache=null)):this.request=new m,this.authorize=new T(this),this.user=new Oe(this),this.users=new Re(this),this.teams=new Se(this),this.members=new se(this),this.projects=new be(this),this.structures=new je(this),this.models=new ae(this),this.objects=new fe(this),this.overlays=new pe(this),this.overlaySets=new he(this),this.revisions=new we(this),this.elementTypes=new X(this),this.annotations=new v(this),this.attachments=new b(this),this.issues=new re(this),this.labels=new ie(this),this.pins=new de(this),this.comments=new G(this),this.hyperlinks=new te(this),this.importService=new ne(this),this.slideshows=new _e(this),this.slides=new ke(this),this.clashDetection=new H(this),this.clientLogs=new W(this),this.rightsService=new Te(this),this.applicationSettings=new y(this),this.exportService=new Q(this),this.folders=new J(this),this.locks=new oe(this),this.share=new qe(this),this.messages=new ue(this),this.objectFilters=new le(this),this.terms=new Pe(this),this.dataProtection=new Ee(this),this.dimensions=new V(this),this.imprints=new Ce(this),this.projectActionsRights=new ge(this),this.roles=new xe(this),this.attributeTemplates=new w(this),this.units=new De(this),this.freeAttributes=new Z(this),this.freeAttributeGroups=new Y(this),this.hiddenCalculation=new ee(this),this.sectionCut=new Ae(this),this.projectAttributeTemplates=new me(this),this.teamActionsRights=new Ue(this),this.customTables=new $(this),this.userSettings=new Ie(this),this.invitations=new Ne(this),this.selections=new Be(this),this.userGroups=new Me(this),this.scenes=new Ke(this),this.baseQuantities=new Le(this),this.workflows=new Fe(this),this.backups=new He(this),this.connexis=new z(this)},(t=[{key:"setAccessToken",value:function(e){this._token=e,this.request.setAccessToken(e),window.BIMPLUS_SDK_ENABLE_DEBUG_LOGS&&console.log("BimWebSdk: token was set to "+this._token)}},{key:"getAccessToken",value:function(){return this._token}},{key:"setTokenType",value: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)}},{key:"getTokenType",value:function(){return this._tokenType}},{key:"setAccessTokenAndType",value:function(e,t){this.setAccessToken(e),this.setTokenType(t)}},{key:"getAccessTokenAndType",value:function(){return{token:this._token,tokenType:this._tokenType}}},{key:"setTeamSlug",value:function(e){this._teamSlug=e,window.BIMPLUS_SDK_ENABLE_DEBUG_LOGS&&console.log("BimWebSdk: team slug was set to "+this._teamSlug)}},{key:"getTeamSlug",value:function(){return this._teamSlug}},{key:"getApiUrl",value:function(){return this._config.protocol+this._config.host+"/"+(this._config.version?this._config.version+"/":"")}},{key:"getApiTeamUrl",value:function(){return this._teamSlug||console.error("Error: Teamslug not set"),this.getApiUrl()+this._teamSlug+"/"}},{key:"getCache",value:function(){return this._cache}}])&&Ge(e.prototype,t),n&&Ge(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,t,n}(),Ve=function(e){var t="api.bimplus.net";if(e)switch(e){case"dev":t="api-dev.bimplus.net";break;case"stage":t="api-stage.bimplus.net"}return{protocol:"https://",host:t,cache:!1,version:"v2"}}})(),r})()));
@@ -1 +1,12 @@
1
+ /*!
2
+ * jQuery JavaScript Library v4.0.0
3
+ * https://jquery.com/
4
+ *
5
+ * Copyright OpenJS Foundation and other contributors
6
+ * Released under the MIT license
7
+ * https://jquery.com/license/
8
+ *
9
+ * Date: 2026-01-18T00:20Z
10
+ */
11
+
1
12
  /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/babel/babel/blob/main/packages/babel-helpers/LICENSE */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "bimplus-websdk",
3
- "version": "1.0.59",
3
+ "version": "1.0.60",
4
4
  "description": "bim+ websdk",
5
5
  "types": "types/bimplus-websdk.d.ts",
6
6
  "keywords": [
@@ -67,6 +67,6 @@
67
67
  "dependencies": {
68
68
  "async": "^3.2.6",
69
69
  "dexie": "4.2.1",
70
- "jquery": "3.7.1"
70
+ "jquery": "4.0.0"
71
71
  }
72
72
  }