@inspectr/app 0.2.0 → 0.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +2 -2
- package/dist/_astro/{client.DghpSMxZ.js → client.DmoISyUt.js} +1 -1
- package/dist/_astro/{index.CtIA4zXx.js → index.CgJZMSBL.js} +1 -1
- package/dist/_astro/index.EqvPwrSk.css +1 -0
- package/dist/_astro/ui.icy-TwUP.js +27 -0
- package/dist/index.html +1 -1
- package/package.json +4 -4
- package/dist/_astro/index.DNrWyOmo.css +0 -1
- package/dist/_astro/ui.DiI4deY6.js +0 -27
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import{r as D,i as We}from"./index.CgJZMSBL.js";var Zo=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function $o(s){return s&&s.__esModule&&Object.prototype.hasOwnProperty.call(s,"default")?s.default:s}var Yr={exports:{}},Vt={};/**
|
|
2
|
+
* @license React
|
|
3
|
+
* react-jsx-runtime.production.js
|
|
4
|
+
*
|
|
5
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
6
|
+
*
|
|
7
|
+
* This source code is licensed under the MIT license found in the
|
|
8
|
+
* LICENSE file in the root directory of this source tree.
|
|
9
|
+
*/var Xr;function Go(){if(Xr)return Vt;Xr=1;var s=Symbol.for("react.transitional.element"),c=Symbol.for("react.fragment");function d(p,_,k){var N=null;if(k!==void 0&&(N=""+k),_.key!==void 0&&(N=""+_.key),"key"in _){k={};for(var S in _)S!=="key"&&(k[S]=_[S])}else k=_;return _=k.ref,{$$typeof:s,type:p,key:N,ref:_!==void 0?_:null,props:k}}return Vt.Fragment=c,Vt.jsx=d,Vt.jsxs=d,Vt}var eo;function Yo(){return eo||(eo=1,Yr.exports=Go()),Yr.exports}var i=Yo(),gr={exports:{}},Xo=gr.exports,to;function ea(){return to||(to=1,function(s,c){(function(d,p){s.exports=p()})(Xo,function(){var d=function(e,t){return(d=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,r){n.__proto__=r}||function(n,r){for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(n[o]=r[o])})(e,t)},p=function(){return(p=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e}).apply(this,arguments)};function _(e,t,n){for(var r,o=0,a=t.length;o<a;o++)!r&&o in t||((r=r||Array.prototype.slice.call(t,0,o))[o]=t[o]);return e.concat(r||Array.prototype.slice.call(t))}var k=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:Zo,N=Object.keys,S=Array.isArray;function L(e,t){return typeof t!="object"||N(t).forEach(function(n){e[n]=t[n]}),e}typeof Promise>"u"||k.Promise||(k.Promise=Promise);var q=Object.getPrototypeOf,E={}.hasOwnProperty;function I(e,t){return E.call(e,t)}function J(e,t){typeof t=="function"&&(t=t(q(e))),(typeof Reflect>"u"?N:Reflect.ownKeys)(t).forEach(function(n){H(e,n,t[n])})}var X=Object.defineProperty;function H(e,t,n,r){X(e,t,L(n&&I(n,"get")&&typeof n.get=="function"?{get:n.get,set:n.set,configurable:!0}:{value:n,configurable:!0,writable:!0},r))}function G(e){return{from:function(t){return e.prototype=Object.create(t.prototype),H(e.prototype,"constructor",e),{extend:J.bind(null,e.prototype)}}}}var W=Object.getOwnPropertyDescriptor,de=[].slice;function Y(e,t,n){return de.call(e,t,n)}function ve(e,t){return t(e)}function je(e){if(!e)throw new Error("Assertion Failed")}function me(e){k.setImmediate?setImmediate(e):setTimeout(e,0)}function ie(e,t){if(typeof t=="string"&&I(e,t))return e[t];if(!t)return e;if(typeof t!="string"){for(var n=[],r=0,o=t.length;r<o;++r){var a=ie(e,t[r]);n.push(a)}return n}var u=t.indexOf(".");if(u!==-1){var l=e[t.substr(0,u)];return l==null?void 0:ie(l,t.substr(u+1))}}function ne(e,t,n){if(e&&t!==void 0&&!("isFrozen"in Object&&Object.isFrozen(e)))if(typeof t!="string"&&"length"in t){je(typeof n!="string"&&"length"in n);for(var r=0,o=t.length;r<o;++r)ne(e,t[r],n[r])}else{var a,u,l=t.indexOf(".");l!==-1?(a=t.substr(0,l),(u=t.substr(l+1))===""?n===void 0?S(e)&&!isNaN(parseInt(a))?e.splice(a,1):delete e[a]:e[a]=n:ne(l=!(l=e[a])||!I(e,a)?e[a]={}:l,u,n)):n===void 0?S(e)&&!isNaN(parseInt(t))?e.splice(t,1):delete e[t]:e[t]=n}}function be(e){var t,n={};for(t in e)I(e,t)&&(n[t]=e[t]);return n}var ue=[].concat;function Z(e){return ue.apply([],e)}var ft="BigUint64Array,BigInt64Array,Array,Boolean,String,Date,RegExp,Blob,File,FileList,FileSystemFileHandle,FileSystemDirectoryHandle,ArrayBuffer,DataView,Uint8ClampedArray,ImageBitmap,ImageData,Map,Set,CryptoKey".split(",").concat(Z([8,16,32,64].map(function(e){return["Int","Uint","Float"].map(function(t){return t+e+"Array"})}))).filter(function(e){return k[e]}),ge=new Set(ft.map(function(e){return k[e]})),xe=null;function Oe(e){return xe=new WeakMap,e=function t(n){if(!n||typeof n!="object")return n;var r=xe.get(n);if(r)return r;if(S(n)){r=[],xe.set(n,r);for(var o=0,a=n.length;o<a;++o)r.push(t(n[o]))}else if(ge.has(n.constructor))r=n;else{var u,l=q(n);for(u in r=l===Object.prototype?{}:Object.create(l),xe.set(n,r),n)I(n,u)&&(r[u]=t(n[u]))}return r}(e),xe=null,e}var Ne={}.toString;function $(e){return Ne.call(e).slice(8,-1)}var ce=typeof Symbol<"u"?Symbol.iterator:"@@iterator",Se=typeof ce=="symbol"?function(e){var t;return e!=null&&(t=e[ce])&&t.apply(e)}:function(){return null};function Ee(e,t){return t=e.indexOf(t),0<=t&&e.splice(t,1),0<=t}var Pe={};function Be(e){var t,n,r,o;if(arguments.length===1){if(S(e))return e.slice();if(this===Pe&&typeof e=="string")return[e];if(o=Se(e)){for(n=[];!(r=o.next()).done;)n.push(r.value);return n}if(e==null)return[e];if(typeof(t=e.length)!="number")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 re=typeof Symbol<"u"?function(e){return e[Symbol.toStringTag]==="AsyncFunction"}:function(){return!1},Rt=["Unknown","Constraint","Data","TransactionInactive","ReadOnly","Version","NotFound","InvalidState","InvalidAccess","Abort","Timeout","QuotaExceeded","Syntax","DataClone"],Ue=["Modify","Bulk","OpenFailed","VersionChange","Schema","Upgrade","InvalidTable","MissingAPI","NoSuchDatabase","InvalidArgument","SubTransaction","Unsupported","Internal","DatabaseClosed","PrematureCommit","ForeignAwait"].concat(Rt),ye={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 _e(e,t){this.name=e,this.message=t}function Je(e,t){return e+". Errors: "+Object.keys(t).map(function(n){return t[n].toString()}).filter(function(n,r,o){return o.indexOf(n)===r}).join(`
|
|
10
|
+
`)}function He(e,t,n,r){this.failures=t,this.failedKeys=r,this.successCount=n,this.message=Je(e,t)}function et(e,t){this.name="BulkError",this.failures=Object.keys(t).map(function(n){return t[n]}),this.failuresByPos=t,this.message=Je(e,this.failures)}G(_e).from(Error).extend({toString:function(){return this.name+": "+this.message}}),G(He).from(_e),G(et).from(_e);var dt=Ue.reduce(function(e,t){return e[t]=t+"Error",e},{}),Zt=_e,U=Ue.reduce(function(e,t){var n=t+"Error";function r(o,a){this.name=n,o?typeof o=="string"?(this.message="".concat(o).concat(a?`
|
|
11
|
+
`+a:""),this.inner=a||null):typeof o=="object"&&(this.message="".concat(o.name," ").concat(o.message),this.inner=o):(this.message=ye[t]||n,this.inner=null)}return G(r).from(Zt),e[t]=r,e},{});U.Syntax=SyntaxError,U.Type=TypeError,U.Range=RangeError;var $t=Rt.reduce(function(e,t){return e[t+"Error"]=U[t],e},{}),jt=Ue.reduce(function(e,t){return["Syntax","Type","Range"].indexOf(t)===-1&&(e[t+"Error"]=U[t]),e},{});function pe(){}function tt(e){return e}function Pn(e,t){return e==null||e===tt?t:function(n){return t(e(n))}}function Ge(e,t){return function(){e.apply(this,arguments),t.apply(this,arguments)}}function V(e,t){return e===pe?t:function(){var n=e.apply(this,arguments);n!==void 0&&(arguments[0]=n);var r=this.onsuccess,o=this.onerror;this.onsuccess=null,this.onerror=null;var a=t.apply(this,arguments);return r&&(this.onsuccess=this.onsuccess?Ge(r,this.onsuccess):r),o&&(this.onerror=this.onerror?Ge(o,this.onerror):o),a!==void 0?a:n}}function he(e,t){return e===pe?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?Ge(n,this.onsuccess):n),r&&(this.onerror=this.onerror?Ge(r,this.onerror):r)}}function Re(e,t){return e===pe?t:function(n){var r=e.apply(this,arguments);L(n,r);var o=this.onsuccess,a=this.onerror;return this.onsuccess=null,this.onerror=null,n=t.apply(this,arguments),o&&(this.onsuccess=this.onsuccess?Ge(o,this.onsuccess):o),a&&(this.onerror=this.onerror?Ge(a,this.onerror):a),r===void 0?n===void 0?void 0:n:L(r,n)}}function Le(e,t){return e===pe?t:function(){return t.apply(this,arguments)!==!1&&e.apply(this,arguments)}}function Fe(e,t){return e===pe?t:function(){var n=e.apply(this,arguments);if(n&&typeof n.then=="function"){for(var r=this,o=arguments.length,a=new Array(o);o--;)a[o]=arguments[o];return n.then(function(){return t.apply(r,a)})}return t.apply(this,arguments)}}jt.ModifyError=He,jt.DexieError=_e,jt.BulkError=et;var se=typeof location<"u"&&/^(http|https):\/\/(localhost|127\.0\.0\.1)/.test(location.href);function Gt(e){se=e}var Pt={},xr=100,ft=typeof Promise>"u"?[]:function(){var e=Promise.resolve();if(typeof crypto>"u"||!crypto.subtle)return[e,q(e),e];var t=crypto.subtle.digest("SHA-512",new Uint8Array([0]));return[t,q(t),e]}(),Rt=ft[0],Ue=ft[1],ft=ft[2],Ue=Ue&&Ue.then,ht=Rt&&Rt.constructor,Rn=!!ft,Mt=function(e,t){Dt.push([e,t]),Yt&&(queueMicrotask(Co),Yt=!1)},Mn=!0,Yt=!0,pt=[],Xt=[],Dn=tt,nt={id:"global",global:!0,ref:0,unhandleds:[],onunhandled:pe,pgp:!1,env:{},finalize:pe},z=nt,Dt=[],mt=0,en=[];function B(e){if(typeof this!="object")throw new TypeError("Promises must be constructed via new");this._listeners=[],this._lib=!1;var t=this._PSD=z;if(typeof e!="function"){if(e!==Pt)throw new TypeError("Not a function");return this._state=arguments[1],this._value=arguments[2],void(this._state===!1&&In(this,this._value))}this._state=null,this._value=null,++t.ref,function n(r,o){try{o(function(a){if(r._state===null){if(a===r)throw new TypeError("A promise cannot be resolved with itself.");var u=r._lib&&kt();a&&typeof a.then=="function"?n(r,function(l,h){a instanceof B?a._then(l,h):a.then(l,h)}):(r._state=!0,r._value=a,jr(r)),u&&_t()}},In.bind(null,r))}catch(a){In(r,a)}}(this,e)}var Kn={get:function(){var e=z,t=on;function n(r,o){var a=this,u=!e.global&&(e!==z||t!==on),l=u&&!ot(),h=new B(function(g,b){Tn(a,new wr(_r(r,e,u,l),_r(o,e,u,l),g,b,e))});return this._consoleTask&&(h._consoleTask=this._consoleTask),h}return n.prototype=Pt,n},set:function(e){H(this,"then",e&&e.prototype===Pt?Kn:{get:function(){return e},set:Kn.set})}};function wr(e,t,n,r,o){this.onFulfilled=typeof e=="function"?e:null,this.onRejected=typeof t=="function"?t:null,this.resolve=n,this.reject=r,this.psd=o}function In(e,t){var n,r;Xt.push(t),e._state===null&&(n=e._lib&&kt(),t=Dn(t),e._state=!1,e._value=t,r=e,pt.some(function(o){return o._value===r._value})||pt.push(r),jr(e),n&&_t())}function jr(e){var t=e._listeners;e._listeners=[];for(var n=0,r=t.length;n<r;++n)Tn(e,t[n]);var o=e._PSD;--o.ref||o.finalize(),mt===0&&(++mt,Mt(function(){--mt==0&&Fn()},[]))}function Tn(e,t){if(e._state!==null){var n=e._state?t.onFulfilled:t.onRejected;if(n===null)return(e._state?t.resolve:t.reject)(e._value);++t.psd.ref,++mt,Mt(_o,[n,e,t])}else e._listeners.push(t)}function _o(e,t,n){try{var r,o=t._value;!t._state&&Xt.length&&(Xt=[]),r=se&&t._consoleTask?t._consoleTask.run(function(){return e(o)}):e(o),t._state||Xt.indexOf(o)!==-1||function(a){for(var u=pt.length;u;)if(pt[--u]._value===a._value)return pt.splice(u,1)}(t),n.resolve(r)}catch(a){n.reject(a)}finally{--mt==0&&Fn(),--n.psd.ref||n.psd.finalize()}}function Co(){gt(nt,function(){kt()&&_t()})}function kt(){var e=Mn;return Yt=Mn=!1,e}function _t(){var e,t,n;do for(;0<Dt.length;)for(e=Dt,Dt=[],n=e.length,t=0;t<n;++t){var r=e[t];r[0].apply(null,r[1])}while(0<Dt.length);Yt=Mn=!0}function Fn(){var e=pt;pt=[],e.forEach(function(r){r._PSD.onunhandled.call(null,r._value,r)});for(var t=en.slice(0),n=t.length;n;)t[--n]()}function tn(e){return new B(Pt,!1,e)}function ke(e,t){var n=z;return function(){var r=kt(),o=z;try{return at(n,!0),e.apply(this,arguments)}catch(a){t&&t(a)}finally{at(o,!1),r&&_t()}}}J(B.prototype,{then:Kn,_then:function(e,t){Tn(this,new wr(null,null,e,t,z))},catch:function(e){if(arguments.length===1)return this.then(null,e);var t=e,n=arguments[1];return typeof t=="function"?this.then(null,function(r){return(r instanceof t?n:tn)(r)}):this.then(null,function(r){return(r&&r.name===t?n:tn)(r)})},finally:function(e){return this.then(function(t){return B.resolve(e()).then(function(){return t})},function(t){return B.resolve(e()).then(function(){return tn(t)})})},timeout:function(e,t){var n=this;return e<1/0?new B(function(r,o){var a=setTimeout(function(){return o(new U.Timeout(t))},e);n.then(r,o).finally(clearTimeout.bind(null,a))}):this}}),typeof Symbol<"u"&&Symbol.toStringTag&&H(B.prototype,Symbol.toStringTag,"Dexie.Promise"),nt.env=kr(),J(B,{all:function(){var e=Be.apply(null,arguments).map(an);return new B(function(t,n){e.length===0&&t([]);var r=e.length;e.forEach(function(o,a){return B.resolve(o).then(function(u){e[a]=u,--r||t(e)},n)})})},resolve:function(e){return e instanceof B?e:e&&typeof e.then=="function"?new B(function(t,n){e.then(t,n)}):new B(Pt,!0,e)},reject:tn,race:function(){var e=Be.apply(null,arguments).map(an);return new B(function(t,n){e.map(function(r){return B.resolve(r).then(t,n)})})},PSD:{get:function(){return z},set:function(e){return z=e}},totalEchoes:{get:function(){return on}},newPSD:rt,usePSD:gt,scheduler:{get:function(){return Mt},set:function(e){Mt=e}},rejectionMapper:{get:function(){return Dn},set:function(e){Dn=e}},follow:function(e,t){return new B(function(n,r){return rt(function(o,a){var u=z;u.unhandleds=[],u.onunhandled=a,u.finalize=Ge(function(){var l,h=this;l=function(){h.unhandleds.length===0?o():a(h.unhandleds[0])},en.push(function g(){l(),en.splice(en.indexOf(g),1)}),++mt,Mt(function(){--mt==0&&Fn()},[])},u.finalize),e()},t,n,r)})}}),ht&&(ht.allSettled&&H(B,"allSettled",function(){var e=Be.apply(null,arguments).map(an);return new B(function(t){e.length===0&&t([]);var n=e.length,r=new Array(n);e.forEach(function(o,a){return B.resolve(o).then(function(u){return r[a]={status:"fulfilled",value:u}},function(u){return r[a]={status:"rejected",reason:u}}).then(function(){return--n||t(r)})})})}),ht.any&&typeof AggregateError<"u"&&H(B,"any",function(){var e=Be.apply(null,arguments).map(an);return new B(function(t,n){e.length===0&&n(new AggregateError([]));var r=e.length,o=new Array(r);e.forEach(function(a,u){return B.resolve(a).then(function(l){return t(l)},function(l){o[u]=l,--r||n(new AggregateError(o))})})})}),ht.withResolvers&&(B.withResolvers=ht.withResolvers));var Me={awaits:0,echoes:0,id:0},Ao=0,nn=[],rn=0,on=0,No=0;function rt(e,t,n,r){var o=z,a=Object.create(o);return a.parent=o,a.ref=0,a.global=!1,a.id=++No,nt.env,a.env=Rn?{Promise:B,PromiseProp:{value:B,configurable:!0,writable:!0},all:B.all,race:B.race,allSettled:B.allSettled,any:B.any,resolve:B.resolve,reject:B.reject}:{},t&&L(a,t),++o.ref,a.finalize=function(){--this.parent.ref||this.parent.finalize()},r=gt(a,e,n,r),a.ref===0&&a.finalize(),r}function Ct(){return Me.id||(Me.id=++Ao),++Me.awaits,Me.echoes+=xr,Me.id}function ot(){return!!Me.awaits&&(--Me.awaits==0&&(Me.id=0),Me.echoes=Me.awaits*xr,!0)}function an(e){return Me.echoes&&e&&e.constructor===ht?(Ct(),e.then(function(t){return ot(),t},function(t){return ot(),Ce(t)})):e}function Oo(){var e=nn[nn.length-1];nn.pop(),at(e,!1)}function at(e,t){var n,r=z;(t?!Me.echoes||rn++&&e===z:!rn||--rn&&e===z)||queueMicrotask(t?function(o){++on,Me.echoes&&--Me.echoes!=0||(Me.echoes=Me.awaits=Me.id=0),nn.push(z),at(o,!0)}.bind(null,e):Oo),e!==z&&(z=e,r===nt&&(nt.env=kr()),Rn&&(n=nt.env.Promise,t=e.env,(r.global||e.global)&&(Object.defineProperty(k,"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 kr(){var e=k.Promise;return Rn?{Promise:e,PromiseProp:Object.getOwnPropertyDescriptor(k,"Promise"),all:e.all,race:e.race,allSettled:e.allSettled,any:e.any,resolve:e.resolve,reject:e.reject}:{}}function gt(e,t,n,r,o){var a=z;try{return at(e,!0),t(n,r,o)}finally{at(a,!1)}}function _r(e,t,n,r){return typeof e!="function"?e:function(){var o=z;n&&Ct(),at(t,!0);try{return e.apply(this,arguments)}finally{at(o,!1),r&&queueMicrotask(ot)}}}function qn(e){Promise===ht&&Me.echoes===0?rn===0?e():enqueueNativeMicroTask(e):setTimeout(e,0)}(""+Ue).indexOf("[native code]")===-1&&(Ct=ot=pe);var Ce=B.reject,yt="",Ye="Invalid key provided. Keys must be of type string, number, Date or Array<string | number | Date>.",Cr="String expected.",At=[],sn="__dbnames",Bn="readonly",Ln="readwrite";function vt(e,t){return e?t?function(){return e.apply(this,arguments)&&t.apply(this,arguments)}:e:t}var Ar={type:3,lower:-1/0,lowerOpen:!1,upper:[[]],upperOpen:!1};function un(e){return typeof e!="string"||/\./.test(e)?function(t){return t}:function(t){return t[e]===void 0&&e in t&&delete(t=Oe(t))[e],t}}function Nr(){throw U.Type()}function le(e,t){try{var n=Or(e),r=Or(t);if(n!==r)return n==="Array"?1:r==="Array"?-1:n==="binary"?1:r==="binary"?-1:n==="string"?1:r==="string"?-1:n==="Date"?1:r!=="Date"?NaN:-1;switch(n){case"number":case"Date":case"string":return t<e?1:e<t?-1:0;case"binary":return function(o,a){for(var u=o.length,l=a.length,h=u<l?u:l,g=0;g<h;++g)if(o[g]!==a[g])return o[g]<a[g]?-1:1;return u===l?0:u<l?-1:1}(Sr(e),Sr(t));case"Array":return function(o,a){for(var u=o.length,l=a.length,h=u<l?u:l,g=0;g<h;++g){var b=le(o[g],a[g]);if(b!==0)return b}return u===l?0:u<l?-1:1}(e,t)}}catch{}return NaN}function Or(e){var t=typeof e;return t!="object"?t:ArrayBuffer.isView(e)?"binary":(e=$(e),e==="ArrayBuffer"?"binary":e)}function Sr(e){return e instanceof Uint8Array?e:ArrayBuffer.isView(e)?new Uint8Array(e.buffer,e.byteOffset,e.byteLength):new Uint8Array(e)}var Er=(we.prototype._trans=function(e,t,n){var r=this._tx||z.trans,o=this.name,a=se&&typeof console<"u"&&console.createTask&&console.createTask("Dexie: ".concat(e==="readonly"?"read":"write"," ").concat(this.name));function u(g,b,f){if(!f.schema[o])throw new U.NotFound("Table "+o+" not part of transaction");return t(f.idbtrans,f)}var l=kt();try{var h=r&&r.db._novip===this.db._novip?r===z.trans?r._promise(e,u,n):rt(function(){return r._promise(e,u,n)},{trans:r,transless:z.transless||z}):function g(b,f,w,m){if(b.idbdb&&(b._state.openComplete||z.letThrough||b._vip)){var v=b._createTransaction(f,w,b._dbSchema);try{v.create(),b._state.PR1398_maxLoop=3}catch(x){return x.name===dt.InvalidState&&b.isOpen()&&0<--b._state.PR1398_maxLoop?(console.warn("Dexie: Need to reopen db"),b.close({disableAutoOpen:!1}),b.open().then(function(){return g(b,f,w,m)})):Ce(x)}return v._promise(f,function(x,y){return rt(function(){return z.trans=v,m(x,y,v)})}).then(function(x){if(f==="readwrite")try{v.idbtrans.commit()}catch{}return f==="readonly"?x:v._completion.then(function(){return x})})}if(b._state.openComplete)return Ce(new U.DatabaseClosed(b._state.dbOpenError));if(!b._state.isBeingOpened){if(!b._state.autoOpen)return Ce(new U.DatabaseClosed);b.open().catch(pe)}return b._state.dbReadyPromise.then(function(){return g(b,f,w,m)})}(this.db,e,[this.name],u);return a&&(h._consoleTask=a,h=h.catch(function(g){return console.trace(g),Ce(g)})),h}finally{l&&_t()}},we.prototype.get=function(e,t){var n=this;return e&&e.constructor===Object?this.where(e).first(t):e==null?Ce(new U.Type("Invalid argument to Table.get()")):this._trans("readonly",function(r){return n.core.get({trans:r,key:e}).then(function(o){return n.hook.reading.fire(o)})}).then(t)},we.prototype.where=function(e){if(typeof e=="string")return new this.db.WhereClause(this,e);if(S(e))return new this.db.WhereClause(this,"[".concat(e.join("+"),"]"));var t=N(e);if(t.length===1)return this.where(t[0]).equals(e[t[0]]);var n=this.schema.indexes.concat(this.schema.primKey).filter(function(l){if(l.compound&&t.every(function(g){return 0<=l.keyPath.indexOf(g)})){for(var h=0;h<t.length;++h)if(t.indexOf(l.keyPath[h])===-1)return!1;return!0}return!1}).sort(function(l,h){return l.keyPath.length-h.keyPath.length})[0];if(n&&this.db._maxKey!==yt){var a=n.keyPath.slice(0,t.length);return this.where(a).equals(a.map(function(h){return e[h]}))}!n&&se&&console.warn("The query ".concat(JSON.stringify(e)," on ").concat(this.name," would benefit from a ")+"compound index [".concat(t.join("+"),"]"));var r=this.schema.idxByName;function o(l,h){return le(l,h)===0}var u=t.reduce(function(f,h){var g=f[0],b=f[1],f=r[h],w=e[h];return[g||f,g||!f?vt(b,f&&f.multi?function(m){return m=ie(m,h),S(m)&&m.some(function(v){return o(w,v)})}:function(m){return o(w,ie(m,h))}):b]},[null,null]),a=u[0],u=u[1];return a?this.where(a.name).equals(e[a.keyPath]).filter(u):n?this.filter(u):this.where(t).equals("")},we.prototype.filter=function(e){return this.toCollection().and(e)},we.prototype.count=function(e){return this.toCollection().count(e)},we.prototype.offset=function(e){return this.toCollection().offset(e)},we.prototype.limit=function(e){return this.toCollection().limit(e)},we.prototype.each=function(e){return this.toCollection().each(e)},we.prototype.toArray=function(e){return this.toCollection().toArray(e)},we.prototype.toCollection=function(){return new this.db.Collection(new this.db.WhereClause(this))},we.prototype.orderBy=function(e){return new this.db.Collection(new this.db.WhereClause(this,S(e)?"[".concat(e.join("+"),"]"):e))},we.prototype.reverse=function(){return this.toCollection().reverse()},we.prototype.mapToClass=function(e){var t,n=this.db,r=this.name;function o(){return t!==null&&t.apply(this,arguments)||this}(this.schema.mappedClass=e).prototype instanceof Nr&&(function(h,g){if(typeof g!="function"&&g!==null)throw new TypeError("Class extends value "+String(g)+" is not a constructor or null");function b(){this.constructor=h}d(h,g),h.prototype=g===null?Object.create(g):(b.prototype=g.prototype,new b)}(o,t=e),Object.defineProperty(o.prototype,"db",{get:function(){return n},enumerable:!1,configurable:!0}),o.prototype.table=function(){return r},e=o);for(var a=new Set,u=e.prototype;u;u=q(u))Object.getOwnPropertyNames(u).forEach(function(h){return a.add(h)});function l(h){if(!h)return h;var g,b=Object.create(e.prototype);for(g in h)if(!a.has(g))try{b[g]=h[g]}catch{}return b}return this.schema.readHook&&this.hook.reading.unsubscribe(this.schema.readHook),this.schema.readHook=l,this.hook("reading",l),e},we.prototype.defineClass=function(){return this.mapToClass(function(e){L(this,e)})},we.prototype.add=function(e,t){var n=this,r=this.schema.primKey,o=r.auto,a=r.keyPath,u=e;return a&&o&&(u=un(a)(e)),this._trans("readwrite",function(l){return n.core.mutate({trans:l,type:"add",keys:t!=null?[t]:null,values:[u]})}).then(function(l){return l.numFailures?B.reject(l.failures[0]):l.lastResult}).then(function(l){if(a)try{ne(e,a,l)}catch{}return l})},we.prototype.update=function(e,t){return typeof e!="object"||S(e)?this.where(":id").equals(e).modify(t):(e=ie(e,this.schema.primKey.keyPath),e===void 0?Ce(new U.InvalidArgument("Given object does not contain its primary key")):this.where(":id").equals(e).modify(t))},we.prototype.put=function(e,t){var n=this,r=this.schema.primKey,o=r.auto,a=r.keyPath,u=e;return a&&o&&(u=un(a)(e)),this._trans("readwrite",function(l){return n.core.mutate({trans:l,type:"put",values:[u],keys:t!=null?[t]:null})}).then(function(l){return l.numFailures?B.reject(l.failures[0]):l.lastResult}).then(function(l){if(a)try{ne(e,a,l)}catch{}return l})},we.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 n.numFailures?B.reject(n.failures[0]):void 0})},we.prototype.clear=function(){var e=this;return this._trans("readwrite",function(t){return e.core.mutate({trans:t,type:"deleteRange",range:Ar})}).then(function(t){return t.numFailures?B.reject(t.failures[0]):void 0})},we.prototype.bulkGet=function(e){var t=this;return this._trans("readonly",function(n){return t.core.getMany({keys:e,trans:n}).then(function(r){return r.map(function(o){return t.hook.reading.fire(o)})})})},we.prototype.bulkAdd=function(e,t,n){var r=this,o=Array.isArray(t)?t:void 0,a=(n=n||(o?void 0:t))?n.allKeys:void 0;return this._trans("readwrite",function(u){var g=r.schema.primKey,l=g.auto,g=g.keyPath;if(g&&o)throw new U.InvalidArgument("bulkAdd(): keys argument invalid on tables with inbound keys");if(o&&o.length!==e.length)throw new U.InvalidArgument("Arguments objects and keys must have the same length");var h=e.length,g=g&&l?e.map(un(g)):e;return r.core.mutate({trans:u,type:"add",keys:o,values:g,wantResults:a}).then(function(v){var f=v.numFailures,w=v.results,m=v.lastResult,v=v.failures;if(f===0)return a?w:m;throw new et("".concat(r.name,".bulkAdd(): ").concat(f," of ").concat(h," operations failed"),v)})})},we.prototype.bulkPut=function(e,t,n){var r=this,o=Array.isArray(t)?t:void 0,a=(n=n||(o?void 0:t))?n.allKeys:void 0;return this._trans("readwrite",function(u){var g=r.schema.primKey,l=g.auto,g=g.keyPath;if(g&&o)throw new U.InvalidArgument("bulkPut(): keys argument invalid on tables with inbound keys");if(o&&o.length!==e.length)throw new U.InvalidArgument("Arguments objects and keys must have the same length");var h=e.length,g=g&&l?e.map(un(g)):e;return r.core.mutate({trans:u,type:"put",keys:o,values:g,wantResults:a}).then(function(v){var f=v.numFailures,w=v.results,m=v.lastResult,v=v.failures;if(f===0)return a?w:m;throw new et("".concat(r.name,".bulkPut(): ").concat(f," of ").concat(h," operations failed"),v)})})},we.prototype.bulkUpdate=function(e){var t=this,n=this.core,r=e.map(function(u){return u.key}),o=e.map(function(u){return u.changes}),a=[];return this._trans("readwrite",function(u){return n.getMany({trans:u,keys:r,cache:"clone"}).then(function(l){var h=[],g=[];e.forEach(function(f,w){var m=f.key,v=f.changes,x=l[w];if(x){for(var y=0,j=Object.keys(v);y<j.length;y++){var C=j[y],A=v[C];if(C===t.schema.primKey.keyPath){if(le(A,m)!==0)throw new U.Constraint("Cannot update primary key in bulkUpdate()")}else ne(x,C,A)}a.push(w),h.push(m),g.push(x)}});var b=h.length;return n.mutate({trans:u,type:"put",keys:h,values:g,updates:{keys:r,changeSpecs:o}}).then(function(f){var w=f.numFailures,m=f.failures;if(w===0)return b;for(var v=0,x=Object.keys(m);v<x.length;v++){var y,j=x[v],C=a[Number(j)];C!=null&&(y=m[j],delete m[j],m[C]=y)}throw new et("".concat(t.name,".bulkUpdate(): ").concat(w," of ").concat(b," operations failed"),m)})})})},we.prototype.bulkDelete=function(e){var t=this,n=e.length;return this._trans("readwrite",function(r){return t.core.mutate({trans:r,type:"delete",keys:e})}).then(function(u){var o=u.numFailures,a=u.lastResult,u=u.failures;if(o===0)return a;throw new et("".concat(t.name,".bulkDelete(): ").concat(o," of ").concat(n," operations failed"),u)})},we);function we(){}function Kt(e){function t(u,l){if(l){for(var h=arguments.length,g=new Array(h-1);--h;)g[h-1]=arguments[h];return n[u].subscribe.apply(null,g),e}if(typeof u=="string")return n[u]}var n={};t.addEventType=a;for(var r=1,o=arguments.length;r<o;++r)a(arguments[r]);return t;function a(u,l,h){if(typeof u!="object"){var g;l=l||Le;var b={subscribers:[],fire:h=h||pe,subscribe:function(f){b.subscribers.indexOf(f)===-1&&(b.subscribers.push(f),b.fire=l(b.fire,f))},unsubscribe:function(f){b.subscribers=b.subscribers.filter(function(w){return w!==f}),b.fire=b.subscribers.reduce(l,h)}};return n[u]=t[u]=b}N(g=u).forEach(function(f){var w=g[f];if(S(w))a(f,g[f][0],g[f][1]);else{if(w!=="asap")throw new U.InvalidArgument("Invalid event config");var m=a(f,tt,function(){for(var v=arguments.length,x=new Array(v);v--;)x[v]=arguments[v];m.subscribers.forEach(function(y){me(function(){y.apply(null,x)})})})}})}}function It(e,t){return G(t).from({prototype:e}),t}function Nt(e,t){return!(e.filter||e.algorithm||e.or)&&(t?e.justLimit:!e.replayFilter)}function Hn(e,t){e.filter=vt(e.filter,t)}function Qn(e,t,n){var r=e.replayFilter;e.replayFilter=r?function(){return vt(r(),t())}:t,e.justLimit=n&&!r}function ln(e,t){if(e.isPrimKey)return t.primaryKey;var n=t.getIndexByKeyPath(e.index);if(!n)throw new U.Schema("KeyPath "+e.index+" on object store "+t.name+" is not indexed");return n}function Pr(e,t,n){var r=ln(e,t.schema);return t.openCursor({trans:n,values:!e.keysOnly,reverse:e.dir==="prev",unique:!!e.unique,query:{index:r,range:e.range}})}function cn(e,t,n,r){var o=e.replayFilter?vt(e.filter,e.replayFilter()):e.filter;if(e.or){var a={},u=function(l,h,g){var b,f;o&&!o(h,g,function(w){return h.stop(w)},function(w){return h.fail(w)})||((f=""+(b=h.primaryKey))=="[object ArrayBuffer]"&&(f=""+new Uint8Array(b)),I(a,f)||(a[f]=!0,t(l,h,g)))};return Promise.all([e.or._iterate(u,n),Rr(Pr(e,r,n),e.algorithm,u,!e.keysOnly&&e.valueMapper)])}return Rr(Pr(e,r,n),vt(e.algorithm,o),t,!e.keysOnly&&e.valueMapper)}function Rr(e,t,n,r){var o=ke(r?function(a,u,l){return n(r(a),u,l)}:n);return e.then(function(a){if(a)return a.start(function(){var u=function(){return a.continue()};t&&!t(a,function(l){return u=l},function(l){a.stop(l),u=pe},function(l){a.fail(l),u=pe})||o(a.value,a,function(l){return u=l}),u()})})}var Tt=(Mr.prototype.execute=function(e){var t=this["@@propmod"];if(t.add!==void 0){var n=t.add;if(S(n))return _(_([],S(e)?e:[],!0),n).sort();if(typeof n=="number")return(Number(e)||0)+n;if(typeof n=="bigint")try{return BigInt(e)+n}catch{return BigInt(0)+n}throw new TypeError("Invalid term ".concat(n))}if(t.remove!==void 0){var r=t.remove;if(S(r))return S(e)?e.filter(function(o){return!r.includes(o)}).sort():[];if(typeof r=="number")return Number(e)-r;if(typeof r=="bigint")try{return BigInt(e)-r}catch{return BigInt(0)-r}throw new TypeError("Invalid subtrahend ".concat(r))}return n=(n=t.replacePrefix)===null||n===void 0?void 0:n[0],n&&typeof e=="string"&&e.startsWith(n)?t.replacePrefix[1]+e.substring(n.length):e},Mr);function Mr(e){this["@@propmod"]=e}var So=(fe.prototype._read=function(e,t){var n=this._ctx;return n.error?n.table._trans(null,Ce.bind(null,n.error)):n.table._trans("readonly",e).then(t)},fe.prototype._write=function(e){var t=this._ctx;return t.error?t.table._trans(null,Ce.bind(null,t.error)):t.table._trans("readwrite",e,"locked")},fe.prototype._addAlgorithm=function(e){var t=this._ctx;t.algorithm=vt(t.algorithm,e)},fe.prototype._iterate=function(e,t){return cn(this._ctx,e,t,this._ctx.table.core)},fe.prototype.clone=function(e){var t=Object.create(this.constructor.prototype),n=Object.create(this._ctx);return e&&L(n,e),t._ctx=n,t},fe.prototype.raw=function(){return this._ctx.valueMapper=null,this},fe.prototype.each=function(e){var t=this._ctx;return this._read(function(n){return cn(t,e,n,t.table.core)})},fe.prototype.count=function(e){var t=this;return this._read(function(n){var r=t._ctx,o=r.table.core;if(Nt(r,!0))return o.count({trans:n,query:{index:ln(r,o.schema),range:r.range}}).then(function(u){return Math.min(u,r.limit)});var a=0;return cn(r,function(){return++a,!1},n,o).then(function(){return a})}).then(e)},fe.prototype.sortBy=function(e,t){var n=e.split(".").reverse(),r=n[0],o=n.length-1;function a(h,g){return g?a(h[n[g]],g-1):h[r]}var u=this._ctx.dir==="next"?1:-1;function l(h,g){return le(a(h,o),a(g,o))*u}return this.toArray(function(h){return h.sort(l)}).then(t)},fe.prototype.toArray=function(e){var t=this;return this._read(function(n){var r=t._ctx;if(r.dir==="next"&&Nt(r,!0)&&0<r.limit){var o=r.valueMapper,a=ln(r,r.table.core.schema);return r.table.core.query({trans:n,limit:r.limit,values:!0,query:{index:a,range:r.range}}).then(function(l){return l=l.result,o?l.map(o):l})}var u=[];return cn(r,function(l){return u.push(l)},n,r.table.core).then(function(){return u})},e)},fe.prototype.offset=function(e){var t=this._ctx;return e<=0||(t.offset+=e,Nt(t)?Qn(t,function(){var n=e;return function(r,o){return n===0||(n===1?--n:o(function(){r.advance(n),n=0}),!1)}}):Qn(t,function(){var n=e;return function(){return--n<0}})),this},fe.prototype.limit=function(e){return this._ctx.limit=Math.min(this._ctx.limit,e),Qn(this._ctx,function(){var t=e;return function(n,r,o){return--t<=0&&r(o),0<=t}},!0),this},fe.prototype.until=function(e,t){return Hn(this._ctx,function(n,r,o){return!e(n.value)||(r(o),t)}),this},fe.prototype.first=function(e){return this.limit(1).toArray(function(t){return t[0]}).then(e)},fe.prototype.last=function(e){return this.reverse().first(e)},fe.prototype.filter=function(e){var t;return Hn(this._ctx,function(n){return e(n.value)}),(t=this._ctx).isMatch=vt(t.isMatch,e),this},fe.prototype.and=function(e){return this.filter(e)},fe.prototype.or=function(e){return new this.db.WhereClause(this._ctx.table,e,this)},fe.prototype.reverse=function(){return this._ctx.dir=this._ctx.dir==="prev"?"next":"prev",this._ondirectionchange&&this._ondirectionchange(this._ctx.dir),this},fe.prototype.desc=function(){return this.reverse()},fe.prototype.eachKey=function(e){var t=this._ctx;return t.keysOnly=!t.isMatch,this.each(function(n,r){e(r.key,r)})},fe.prototype.eachUniqueKey=function(e){return this._ctx.unique="unique",this.eachKey(e)},fe.prototype.eachPrimaryKey=function(e){var t=this._ctx;return t.keysOnly=!t.isMatch,this.each(function(n,r){e(r.primaryKey,r)})},fe.prototype.keys=function(e){var t=this._ctx;t.keysOnly=!t.isMatch;var n=[];return this.each(function(r,o){n.push(o.key)}).then(function(){return n}).then(e)},fe.prototype.primaryKeys=function(e){var t=this._ctx;if(t.dir==="next"&&Nt(t,!0)&&0<t.limit)return this._read(function(r){var o=ln(t,t.table.core.schema);return t.table.core.query({trans:r,values:!1,limit:t.limit,query:{index:o,range:t.range}})}).then(function(r){return r.result}).then(e);t.keysOnly=!t.isMatch;var n=[];return this.each(function(r,o){n.push(o.primaryKey)}).then(function(){return n}).then(e)},fe.prototype.uniqueKeys=function(e){return this._ctx.unique="unique",this.keys(e)},fe.prototype.firstKey=function(e){return this.limit(1).keys(function(t){return t[0]}).then(e)},fe.prototype.lastKey=function(e){return this.reverse().firstKey(e)},fe.prototype.distinct=function(){var e=this._ctx,e=e.index&&e.table.schema.idxByName[e.index];if(!e||!e.multi)return this;var t={};return Hn(this._ctx,function(o){var r=o.primaryKey.toString(),o=I(t,r);return t[r]=!0,!o}),this},fe.prototype.modify=function(e){var t=this,n=this._ctx;return this._write(function(r){var o,a,u;u=typeof e=="function"?e:(o=N(e),a=o.length,function(y){for(var j=!1,C=0;C<a;++C){var A=o[C],O=e[A],P=ie(y,A);O instanceof Tt?(ne(y,A,O.execute(P)),j=!0):P!==O&&(ne(y,A,O),j=!0)}return j});var l=n.table.core,f=l.schema.primaryKey,h=f.outbound,g=f.extractKey,b=200,f=t.db._options.modifyChunkSize;f&&(b=typeof f=="object"?f[l.name]||f["*"]||200:f);function w(y,A){var C=A.failures,A=A.numFailures;v+=y-A;for(var O=0,P=N(C);O<P.length;O++){var T=P[O];m.push(C[T])}}var m=[],v=0,x=[];return t.clone().primaryKeys().then(function(y){function j(A){var O=Math.min(b,y.length-A);return l.getMany({trans:r,keys:y.slice(A,A+O),cache:"immutable"}).then(function(P){for(var T=[],R=[],M=h?[]:null,F=[],K=0;K<O;++K){var Q=P[K],te={value:Oe(Q),primKey:y[A+K]};u.call(te,te.value,te)!==!1&&(te.value==null?F.push(y[A+K]):h||le(g(Q),g(te.value))===0?(R.push(te.value),h&&M.push(y[A+K])):(F.push(y[A+K]),T.push(te.value)))}return Promise.resolve(0<T.length&&l.mutate({trans:r,type:"add",values:T}).then(function(oe){for(var ae in oe.failures)F.splice(parseInt(ae),1);w(T.length,oe)})).then(function(){return(0<R.length||C&&typeof e=="object")&&l.mutate({trans:r,type:"put",keys:M,values:R,criteria:C,changeSpec:typeof e!="function"&&e,isAdditionalChunk:0<A}).then(function(oe){return w(R.length,oe)})}).then(function(){return(0<F.length||C&&e===Vn)&&l.mutate({trans:r,type:"delete",keys:F,criteria:C,isAdditionalChunk:0<A}).then(function(oe){return w(F.length,oe)})}).then(function(){return y.length>A+O&&j(A+b)})})}var C=Nt(n)&&n.limit===1/0&&(typeof e!="function"||e===Vn)&&{index:n.index,range:n.range};return j(0).then(function(){if(0<m.length)throw new He("Error modifying one or more objects",m,v,x);return y.length})})})},fe.prototype.delete=function(){var e=this._ctx,t=e.range;return Nt(e)&&(e.isPrimKey||t.type===3)?this._write(function(n){var r=e.table.core.schema.primaryKey,o=t;return e.table.core.count({trans:n,query:{index:r,range:o}}).then(function(a){return e.table.core.mutate({trans:n,type:"deleteRange",range:o}).then(function(u){var l=u.failures;if(u.lastResult,u.results,u=u.numFailures,u)throw new He("Could not delete some values",Object.keys(l).map(function(h){return l[h]}),a-u);return a-u})})}):this.modify(Vn)},fe);function fe(){}var Vn=function(e,t){return t.value=null};function Eo(e,t){return e<t?-1:e===t?0:1}function Po(e,t){return t<e?-1:e===t?0:1}function Qe(e,t,n){return e=e instanceof Kr?new e.Collection(e):e,e._ctx.error=new(n||TypeError)(t),e}function Ot(e){return new e.Collection(e,function(){return Dr("")}).limit(0)}function dn(e,t,n,r){var o,a,u,l,h,g,b,f=n.length;if(!n.every(function(v){return typeof v=="string"}))return Qe(e,Cr);function w(v){o=v==="next"?function(y){return y.toUpperCase()}:function(y){return y.toLowerCase()},a=v==="next"?function(y){return y.toLowerCase()}:function(y){return y.toUpperCase()},u=v==="next"?Eo:Po;var x=n.map(function(y){return{lower:a(y),upper:o(y)}}).sort(function(y,j){return u(y.lower,j.lower)});l=x.map(function(y){return y.upper}),h=x.map(function(y){return y.lower}),b=(g=v)==="next"?"":r}w("next"),e=new e.Collection(e,function(){return it(l[0],h[f-1]+r)}),e._ondirectionchange=function(v){w(v)};var m=0;return e._addAlgorithm(function(v,x,y){var j=v.key;if(typeof j!="string")return!1;var C=a(j);if(t(C,h,m))return!0;for(var A=null,O=m;O<f;++O){var P=function(T,R,M,F,K,Q){for(var te=Math.min(T.length,F.length),oe=-1,ae=0;ae<te;++ae){var Ve=R[ae];if(Ve!==F[ae])return K(T[ae],M[ae])<0?T.substr(0,ae)+M[ae]+M.substr(ae+1):K(T[ae],F[ae])<0?T.substr(0,ae)+F[ae]+M.substr(ae+1):0<=oe?T.substr(0,oe)+R[oe]+M.substr(oe+1):null;K(T[ae],Ve)<0&&(oe=ae)}return te<F.length&&Q==="next"?T+M.substr(T.length):te<T.length&&Q==="prev"?T.substr(0,M.length):oe<0?null:T.substr(0,oe)+F[oe]+M.substr(oe+1)}(j,C,l[O],h[O],u,g);P===null&&A===null?m=O+1:(A===null||0<u(A,P))&&(A=P)}return x(A!==null?function(){v.continue(A+b)}:y),!1}),e}function it(e,t,n,r){return{type:2,lower:e,upper:t,lowerOpen:n,upperOpen:r}}function Dr(e){return{type:1,lower:e,upper:e}}var Kr=(Object.defineProperty(De.prototype,"Collection",{get:function(){return this._ctx.table.db.Collection},enumerable:!1,configurable:!0}),De.prototype.between=function(e,t,n,r){n=n!==!1,r=r===!0;try{return 0<this._cmp(e,t)||this._cmp(e,t)===0&&(n||r)&&(!n||!r)?Ot(this):new this.Collection(this,function(){return it(e,t,!n,!r)})}catch{return Qe(this,Ye)}},De.prototype.equals=function(e){return e==null?Qe(this,Ye):new this.Collection(this,function(){return Dr(e)})},De.prototype.above=function(e){return e==null?Qe(this,Ye):new this.Collection(this,function(){return it(e,void 0,!0)})},De.prototype.aboveOrEqual=function(e){return e==null?Qe(this,Ye):new this.Collection(this,function(){return it(e,void 0,!1)})},De.prototype.below=function(e){return e==null?Qe(this,Ye):new this.Collection(this,function(){return it(void 0,e,!1,!0)})},De.prototype.belowOrEqual=function(e){return e==null?Qe(this,Ye):new this.Collection(this,function(){return it(void 0,e)})},De.prototype.startsWith=function(e){return typeof e!="string"?Qe(this,Cr):this.between(e,e+yt,!0,!0)},De.prototype.startsWithIgnoreCase=function(e){return e===""?this.startsWith(e):dn(this,function(t,n){return t.indexOf(n[0])===0},[e],yt)},De.prototype.equalsIgnoreCase=function(e){return dn(this,function(t,n){return t===n[0]},[e],"")},De.prototype.anyOfIgnoreCase=function(){var e=Be.apply(Pe,arguments);return e.length===0?Ot(this):dn(this,function(t,n){return n.indexOf(t)!==-1},e,"")},De.prototype.startsWithAnyOfIgnoreCase=function(){var e=Be.apply(Pe,arguments);return e.length===0?Ot(this):dn(this,function(t,n){return n.some(function(r){return t.indexOf(r)===0})},e,yt)},De.prototype.anyOf=function(){var e=this,t=Be.apply(Pe,arguments),n=this._cmp;try{t.sort(n)}catch{return Qe(this,Ye)}if(t.length===0)return Ot(this);var r=new this.Collection(this,function(){return it(t[0],t[t.length-1])});r._ondirectionchange=function(a){n=a==="next"?e._ascending:e._descending,t.sort(n)};var o=0;return r._addAlgorithm(function(a,u,l){for(var h=a.key;0<n(h,t[o]);)if(++o===t.length)return u(l),!1;return n(h,t[o])===0||(u(function(){a.continue(t[o])}),!1)}),r},De.prototype.notEqual=function(e){return this.inAnyRange([[-1/0,e],[e,this.db._maxKey]],{includeLowers:!1,includeUppers:!1})},De.prototype.noneOf=function(){var e=Be.apply(Pe,arguments);if(e.length===0)return new this.Collection(this);try{e.sort(this._ascending)}catch{return Qe(this,Ye)}var t=e.reduce(function(n,r){return n?n.concat([[n[n.length-1][1],r]]):[[-1/0,r]]},null);return t.push([e[e.length-1],this.db._maxKey]),this.inAnyRange(t,{includeLowers:!1,includeUppers:!1})},De.prototype.inAnyRange=function(j,t){var n=this,r=this._cmp,o=this._ascending,a=this._descending,u=this._min,l=this._max;if(j.length===0)return Ot(this);if(!j.every(function(C){return C[0]!==void 0&&C[1]!==void 0&&o(C[0],C[1])<=0}))return Qe(this,"First argument to inAnyRange() must be an Array of two-value Arrays [lower,upper] where upper must not be lower than lower",U.InvalidArgument);var h=!t||t.includeLowers!==!1,g=t&&t.includeUppers===!0,b,f=o;function w(C,A){return f(C[0],A[0])}try{(b=j.reduce(function(C,A){for(var O=0,P=C.length;O<P;++O){var T=C[O];if(r(A[0],T[1])<0&&0<r(A[1],T[0])){T[0]=u(T[0],A[0]),T[1]=l(T[1],A[1]);break}}return O===P&&C.push(A),C},[])).sort(w)}catch{return Qe(this,Ye)}var m=0,v=g?function(C){return 0<o(C,b[m][1])}:function(C){return 0<=o(C,b[m][1])},x=h?function(C){return 0<a(C,b[m][0])}:function(C){return 0<=a(C,b[m][0])},y=v,j=new this.Collection(this,function(){return it(b[0][0],b[b.length-1][1],!h,!g)});return j._ondirectionchange=function(C){f=C==="next"?(y=v,o):(y=x,a),b.sort(w)},j._addAlgorithm(function(C,A,O){for(var P,T=C.key;y(T);)if(++m===b.length)return A(O),!1;return!v(P=T)&&!x(P)||(n._cmp(T,b[m][1])===0||n._cmp(T,b[m][0])===0||A(function(){f===o?C.continue(b[m][0]):C.continue(b[m][1])}),!1)}),j},De.prototype.startsWithAnyOf=function(){var e=Be.apply(Pe,arguments);return e.every(function(t){return typeof t=="string"})?e.length===0?Ot(this):this.inAnyRange(e.map(function(t){return[t,t+yt]})):Qe(this,"startsWithAnyOf() only works with strings")},De);function De(){}function Ze(e){return ke(function(t){return Ft(t),e(t.target.error),!1})}function Ft(e){e.stopPropagation&&e.stopPropagation(),e.preventDefault&&e.preventDefault()}var qt="storagemutated",zn="x-storagemutated-1",st=Kt(null,qt),Ro=($e.prototype._lock=function(){return je(!z.global),++this._reculock,this._reculock!==1||z.global||(z.lockOwnerFor=this),this},$e.prototype._unlock=function(){if(je(!z.global),--this._reculock==0)for(z.global||(z.lockOwnerFor=null);0<this._blockedFuncs.length&&!this._locked();){var e=this._blockedFuncs.shift();try{gt(e[1],e[0])}catch{}}return this},$e.prototype._locked=function(){return this._reculock&&z.lockOwnerFor!==this},$e.prototype.create=function(e){var t=this;if(!this.mode)return this;var n=this.db.idbdb,r=this.db._state.dbOpenError;if(je(!this.idbtrans),!e&&!n)switch(r&&r.name){case"DatabaseClosedError":throw new U.DatabaseClosed(r);case"MissingAPIError":throw new U.MissingAPI(r.message,r);default:throw new U.OpenFailed(r)}if(!this.active)throw new U.TransactionInactive;return je(this._completion._state===null),(e=this.idbtrans=e||(this.db.core||n).transaction(this.storeNames,this.mode,{durability:this.chromeTransactionDurability})).onerror=ke(function(o){Ft(o),t._reject(e.error)}),e.onabort=ke(function(o){Ft(o),t.active&&t._reject(new U.Abort(e.error)),t.active=!1,t.on("abort").fire(o)}),e.oncomplete=ke(function(){t.active=!1,t._resolve(),"mutatedParts"in e&&st.storagemutated.fire(e.mutatedParts)}),this},$e.prototype._promise=function(e,t,n){var r=this;if(e==="readwrite"&&this.mode!=="readwrite")return Ce(new U.ReadOnly("Transaction is readonly"));if(!this.active)return Ce(new U.TransactionInactive);if(this._locked())return new B(function(a,u){r._blockedFuncs.push([function(){r._promise(e,t,n).then(a,u)},z])});if(n)return rt(function(){var a=new B(function(u,l){r._lock();var h=t(u,l,r);h&&h.then&&h.then(u,l)});return a.finally(function(){return r._unlock()}),a._lib=!0,a});var o=new B(function(a,u){var l=t(a,u,r);l&&l.then&&l.then(a,u)});return o._lib=!0,o},$e.prototype._root=function(){return this.parent?this.parent._root():this},$e.prototype.waitFor=function(e){var t,n=this._root(),r=B.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 a(){for(++n._spinCount;n._waitingQueue.length;)n._waitingQueue.shift()();n._waitingFor&&(t.get(-1/0).onsuccess=a)}());var o=n._waitingFor;return new B(function(a,u){r.then(function(l){return n._waitingQueue.push(ke(a.bind(null,l)))},function(l){return n._waitingQueue.push(ke(u.bind(null,l)))}).finally(function(){n._waitingFor===o&&(n._waitingFor=null)})})},$e.prototype.abort=function(){this.active&&(this.active=!1,this.idbtrans&&this.idbtrans.abort(),this._reject(new U.Abort))},$e.prototype.table=function(e){var t=this._memoizedTables||(this._memoizedTables={});if(I(t,e))return t[e];var n=this.schema[e];if(!n)throw new U.NotFound("Table "+e+" not part of transaction");return n=new this.db.Table(e,n,this),n.core=this.db.core.table(e),t[e]=n},$e);function $e(){}function Un(e,t,n,r,o,a,u){return{name:e,keyPath:t,unique:n,multi:r,auto:o,compound:a,src:(n&&!u?"&":"")+(r?"*":"")+(o?"++":"")+Ir(t)}}function Ir(e){return typeof e=="string"?e:e?"["+[].join.call(e,"+")+"]":""}function Wn(e,t,n){return{name:e,primKey:t,indexes:n,mappedClass:null,idxByName:(r=function(o){return[o.name,o]},n.reduce(function(o,a,u){return u=r(a,u),u&&(o[u[0]]=u[1]),o},{}))};var r}var Bt=function(e){try{return e.only([[]]),Bt=function(){return[[]]},[[]]}catch{return Bt=function(){return yt},yt}};function Jn(e){return e==null?function(){}:typeof e=="string"?(t=e).split(".").length===1?function(n){return n[t]}:function(n){return ie(n,t)}:function(n){return ie(n,e)};var t}function Tr(e){return[].slice.call(e)}var Mo=0;function Lt(e){return e==null?":id":typeof e=="string"?e:"[".concat(e.join("+"),"]")}function Do(e,t,h){function r(y){if(y.type===3)return null;if(y.type===4)throw new Error("Cannot convert never type to IDBKeyRange");var m=y.lower,v=y.upper,x=y.lowerOpen,y=y.upperOpen;return m===void 0?v===void 0?null:t.upperBound(v,!!y):v===void 0?t.lowerBound(m,!!x):t.bound(m,v,!!x,!!y)}function o(w){var m,v=w.name;return{name:v,schema:w,mutate:function(x){var y=x.trans,j=x.type,C=x.keys,A=x.values,O=x.range;return new Promise(function(P,T){P=ke(P);var R=y.objectStore(v),M=R.keyPath==null,F=j==="put"||j==="add";if(!F&&j!=="delete"&&j!=="deleteRange")throw new Error("Invalid operation type: "+j);var K,Q=(C||A||{length:1}).length;if(C&&A&&C.length!==A.length)throw new Error("Given keys array must have same length as given values array.");if(Q===0)return P({numFailures:0,failures:{},results:[],lastResult:void 0});function te(qe){++Ve,Ft(qe)}var oe=[],ae=[],Ve=0;if(j==="deleteRange"){if(O.type===4)return P({numFailures:Ve,failures:ae,results:[],lastResult:void 0});O.type===3?oe.push(K=R.clear()):oe.push(K=R.delete(r(O)))}else{var M=F?M?[A,C]:[A,null]:[C,null],ee=M[0],Ie=M[1];if(F)for(var Te=0;Te<Q;++Te)oe.push(K=Ie&&Ie[Te]!==void 0?R[j](ee[Te],Ie[Te]):R[j](ee[Te])),K.onerror=te;else for(Te=0;Te<Q;++Te)oe.push(K=R[j](ee[Te])),K.onerror=te}function _n(qe){qe=qe.target.result,oe.forEach(function(wt,fr){return wt.error!=null&&(ae[fr]=wt.error)}),P({numFailures:Ve,failures:ae,results:j==="delete"?C:oe.map(function(wt){return wt.result}),lastResult:qe})}K.onerror=function(qe){te(qe),_n(qe)},K.onsuccess=_n})},getMany:function(x){var y=x.trans,j=x.keys;return new Promise(function(C,A){C=ke(C);for(var O,P=y.objectStore(v),T=j.length,R=new Array(T),M=0,F=0,K=function(oe){oe=oe.target,R[oe._pos]=oe.result,++F===M&&C(R)},Q=Ze(A),te=0;te<T;++te)j[te]!=null&&((O=P.get(j[te]))._pos=te,O.onsuccess=K,O.onerror=Q,++M);M===0&&C(R)})},get:function(x){var y=x.trans,j=x.key;return new Promise(function(C,A){C=ke(C);var O=y.objectStore(v).get(j);O.onsuccess=function(P){return C(P.target.result)},O.onerror=Ze(A)})},query:(m=g,function(x){return new Promise(function(y,j){y=ke(y);var C,A,O,M=x.trans,P=x.values,T=x.limit,K=x.query,R=T===1/0?void 0:T,F=K.index,K=K.range,M=M.objectStore(v),F=F.isPrimaryKey?M:M.index(F.name),K=r(K);if(T===0)return y({result:[]});m?((R=P?F.getAll(K,R):F.getAllKeys(K,R)).onsuccess=function(Q){return y({result:Q.target.result})},R.onerror=Ze(j)):(C=0,A=!P&&"openKeyCursor"in F?F.openKeyCursor(K):F.openCursor(K),O=[],A.onsuccess=function(Q){var te=A.result;return te?(O.push(P?te.value:te.primaryKey),++C===T?y({result:O}):void te.continue()):y({result:O})},A.onerror=Ze(j))})}),openCursor:function(x){var y=x.trans,j=x.values,C=x.query,A=x.reverse,O=x.unique;return new Promise(function(P,T){P=ke(P);var F=C.index,R=C.range,M=y.objectStore(v),M=F.isPrimaryKey?M:M.index(F.name),F=A?O?"prevunique":"prev":O?"nextunique":"next",K=!j&&"openKeyCursor"in M?M.openKeyCursor(r(R),F):M.openCursor(r(R),F);K.onerror=Ze(T),K.onsuccess=ke(function(Q){var te,oe,ae,Ve,ee=K.result;ee?(ee.___id=++Mo,ee.done=!1,te=ee.continue.bind(ee),oe=(oe=ee.continuePrimaryKey)&&oe.bind(ee),ae=ee.advance.bind(ee),Ve=function(){throw new Error("Cursor not stopped")},ee.trans=y,ee.stop=ee.continue=ee.continuePrimaryKey=ee.advance=function(){throw new Error("Cursor not started")},ee.fail=ke(T),ee.next=function(){var Ie=this,Te=1;return this.start(function(){return Te--?Ie.continue():Ie.stop()}).then(function(){return Ie})},ee.start=function(Ie){function Te(){if(K.result)try{Ie()}catch(qe){ee.fail(qe)}else ee.done=!0,ee.start=function(){throw new Error("Cursor behind last entry")},ee.stop()}var _n=new Promise(function(qe,wt){qe=ke(qe),K.onerror=Ze(wt),ee.fail=wt,ee.stop=function(fr){ee.stop=ee.continue=ee.continuePrimaryKey=ee.advance=Ve,qe(fr)}});return K.onsuccess=ke(function(qe){K.onsuccess=Te,Te()}),ee.continue=te,ee.continuePrimaryKey=oe,ee.advance=ae,Te(),_n},P(ee)):P(null)},T)})},count:function(x){var y=x.query,j=x.trans,C=y.index,A=y.range;return new Promise(function(O,P){var T=j.objectStore(v),R=C.isPrimaryKey?T:T.index(C.name),T=r(A),R=T?R.count(T):R.count();R.onsuccess=ke(function(M){return O(M.target.result)}),R.onerror=Ze(P)})}}}var a,u,l,b=(u=h,l=Tr((a=e).objectStoreNames),{schema:{name:a.name,tables:l.map(function(w){return u.objectStore(w)}).map(function(w){var m=w.keyPath,y=w.autoIncrement,v=S(m),x={},y={name:w.name,primaryKey:{name:null,isPrimaryKey:!0,outbound:m==null,compound:v,keyPath:m,autoIncrement:y,unique:!0,extractKey:Jn(m)},indexes:Tr(w.indexNames).map(function(j){return w.index(j)}).map(function(O){var C=O.name,A=O.unique,P=O.multiEntry,O=O.keyPath,P={name:C,compound:S(O),keyPath:O,unique:A,multiEntry:P,extractKey:Jn(O)};return x[Lt(O)]=P}),getIndexByKeyPath:function(j){return x[Lt(j)]}};return x[":id"]=y.primaryKey,m!=null&&(x[Lt(m)]=y.primaryKey),y})},hasGetAll:0<l.length&&"getAll"in u.objectStore(l[0])&&!(typeof navigator<"u"&&/Safari/.test(navigator.userAgent)&&!/(Chrome\/|Edge\/)/.test(navigator.userAgent)&&[].concat(navigator.userAgent.match(/Safari\/(\d*)/))[1]<604)}),h=b.schema,g=b.hasGetAll,b=h.tables.map(o),f={};return b.forEach(function(w){return f[w.name]=w}),{stack:"dbcore",transaction:e.transaction.bind(e),table:function(w){if(!f[w])throw new Error("Table '".concat(w,"' not found"));return f[w]},MIN_KEY:-1/0,MAX_KEY:Bt(t),schema:h}}function Ko(e,t,n,r){var o=n.IDBKeyRange;return n.indexedDB,{dbcore:(r=Do(t,o,r),e.dbcore.reduce(function(a,u){return u=u.create,p(p({},a),u(a))},r))}}function fn(e,r){var n=r.db,r=Ko(e._middlewares,n,e._deps,r);e.core=r.dbcore,e.tables.forEach(function(o){var a=o.name;e.core.schema.tables.some(function(u){return u.name===a})&&(o.core=e.core.table(a),e[a]instanceof e.Table&&(e[a].core=o.core))})}function hn(e,t,n,r){n.forEach(function(o){var a=r[o];t.forEach(function(u){var l=function h(g,b){return W(g,b)||(g=q(g))&&h(g,b)}(u,o);(!l||"value"in l&&l.value===void 0)&&(u===e.Transaction.prototype||u instanceof e.Transaction?H(u,o,{get:function(){return this.table(o)},set:function(h){X(this,o,{value:h,writable:!0,configurable:!0,enumerable:!0})}}):u[o]=new e.Table(o,a))})})}function Zn(e,t){t.forEach(function(n){for(var r in n)n[r]instanceof e.Table&&delete n[r]})}function Io(e,t){return e._cfg.version-t._cfg.version}function To(e,t,n,r){var o=e._dbSchema;n.objectStoreNames.contains("$meta")&&!o.$meta&&(o.$meta=Wn("$meta",qr("")[0],[]),e._storeNames.push("$meta"));var a=e._createTransaction("readwrite",e._storeNames,o);a.create(n),a._completion.catch(r);var u=a._reject.bind(a),l=z.transless||z;rt(function(){return z.trans=a,z.transless=l,t!==0?(fn(e,n),g=t,((h=a).storeNames.includes("$meta")?h.table("$meta").get("version").then(function(b){return b??g}):B.resolve(g)).then(function(b){return w=b,m=a,v=n,x=[],b=(f=e)._versions,y=f._dbSchema=mn(0,f.idbdb,v),(b=b.filter(function(j){return j._cfg.version>=w})).length!==0?(b.forEach(function(j){x.push(function(){var C=y,A=j._cfg.dbschema;gn(f,C,v),gn(f,A,v),y=f._dbSchema=A;var O=$n(C,A);O.add.forEach(function(F){Gn(v,F[0],F[1].primKey,F[1].indexes)}),O.change.forEach(function(F){if(F.recreate)throw new U.Upgrade("Not yet support for changing primary key");var K=v.objectStore(F.name);F.add.forEach(function(Q){return pn(K,Q)}),F.change.forEach(function(Q){K.deleteIndex(Q.name),pn(K,Q)}),F.del.forEach(function(Q){return K.deleteIndex(Q)})});var P=j._cfg.contentUpgrade;if(P&&j._cfg.version>w){fn(f,v),m._memoizedTables={};var T=be(A);O.del.forEach(function(F){T[F]=C[F]}),Zn(f,[f.Transaction.prototype]),hn(f,[f.Transaction.prototype],N(T),T),m.schema=T;var R,M=re(P);return M&&Ct(),O=B.follow(function(){var F;(R=P(m))&&M&&(F=ot.bind(null,null),R.then(F,F))}),R&&typeof R.then=="function"?B.resolve(R):O.then(function(){return R})}}),x.push(function(C){var A,O,P=j._cfg.dbschema;A=P,O=C,[].slice.call(O.db.objectStoreNames).forEach(function(T){return A[T]==null&&O.db.deleteObjectStore(T)}),Zn(f,[f.Transaction.prototype]),hn(f,[f.Transaction.prototype],f._storeNames,f._dbSchema),m.schema=f._dbSchema}),x.push(function(C){f.idbdb.objectStoreNames.contains("$meta")&&(Math.ceil(f.idbdb.version/10)===j._cfg.version?(f.idbdb.deleteObjectStore("$meta"),delete f._dbSchema.$meta,f._storeNames=f._storeNames.filter(function(A){return A!=="$meta"})):C.objectStore("$meta").put(j._cfg.version,"version"))})}),function j(){return x.length?B.resolve(x.shift()(m.idbtrans)).then(j):B.resolve()}().then(function(){Fr(y,v)})):B.resolve();var f,w,m,v,x,y}).catch(u)):(N(o).forEach(function(b){Gn(n,b,o[b].primKey,o[b].indexes)}),fn(e,n),void B.follow(function(){return e.on.populate.fire(a)}).catch(u));var h,g})}function Fo(e,t){Fr(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=mn(0,e.idbdb,t);gn(e,e._dbSchema,t);for(var r=0,o=$n(n,e._dbSchema).change;r<o.length;r++){var a=function(u){if(u.change.length||u.recreate)return console.warn("Unable to patch indexes of table ".concat(u.name," because it has changes on the type of index or primary key.")),{value:void 0};var l=t.objectStore(u.name);u.add.forEach(function(h){se&&console.debug("Dexie upgrade patch: Creating missing index ".concat(u.name,".").concat(h.src)),pn(l,h)})}(o[r]);if(typeof a=="object")return a.value}}function $n(e,t){var n,r={del:[],add:[],change:[]};for(n in e)t[n]||r.del.push(n);for(n in t){var o=e[n],a=t[n];if(o){var u={name:n,def:a,recreate:!1,del:[],add:[],change:[]};if(""+(o.primKey.keyPath||"")!=""+(a.primKey.keyPath||"")||o.primKey.auto!==a.primKey.auto)u.recreate=!0,r.change.push(u);else{var l=o.idxByName,h=a.idxByName,g=void 0;for(g in l)h[g]||u.del.push(g);for(g in h){var b=l[g],f=h[g];b?b.src!==f.src&&u.change.push(f):u.add.push(f)}(0<u.del.length||0<u.add.length||0<u.change.length)&&r.change.push(u)}}else r.add.push([n,a])}return r}function Gn(e,t,n,r){var o=e.db.createObjectStore(t,n.keyPath?{keyPath:n.keyPath,autoIncrement:n.auto}:{autoIncrement:n.auto});return r.forEach(function(a){return pn(o,a)}),o}function Fr(e,t){N(e).forEach(function(n){t.db.objectStoreNames.contains(n)||(se&&console.debug("Dexie: Creating missing table",n),Gn(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 mn(e,t,n){var r={};return Y(t.objectStoreNames,0).forEach(function(o){for(var a=n.objectStore(o),u=Un(Ir(g=a.keyPath),g||"",!0,!1,!!a.autoIncrement,g&&typeof g!="string",!0),l=[],h=0;h<a.indexNames.length;++h){var b=a.index(a.indexNames[h]),g=b.keyPath,b=Un(b.name,g,!!b.unique,!!b.multiEntry,!1,g&&typeof g!="string",!1);l.push(b)}r[o]=Wn(o,u,l)}),r}function gn(e,t,n){for(var r=n.db.objectStoreNames,o=0;o<r.length;++o){var a=r[o],u=n.objectStore(a);e._hasGetAll="getAll"in u;for(var l=0;l<u.indexNames.length;++l){var h=u.indexNames[l],g=u.index(h).keyPath,b=typeof g=="string"?g:"["+Y(g).join("+")+"]";!t[a]||(g=t[a].idxByName[b])&&(g.name=h,delete t[a].idxByName[b],t[a].idxByName[h]=g)}}typeof navigator<"u"&&/Safari/.test(navigator.userAgent)&&!/(Chrome\/|Edge\/)/.test(navigator.userAgent)&&k.WorkerGlobalScope&&k instanceof k.WorkerGlobalScope&&[].concat(navigator.userAgent.match(/Safari\/(\d*)/))[1]<604&&(e._hasGetAll=!1)}function qr(e){return e.split(",").map(function(t,n){var r=(t=t.trim()).replace(/([&*]|\+\+)/g,""),o=/^\[/.test(r)?r.match(/^\[(.*)\]$/)[1].split("+"):r;return Un(r,o||null,/\&/.test(t),/\*/.test(t),/\+\+/.test(t),S(o),n===0)})}var qo=(yn.prototype._parseStoresSpec=function(e,t){N(e).forEach(function(n){if(e[n]!==null){var r=qr(e[n]),o=r.shift();if(o.unique=!0,o.multi)throw new U.Schema("Primary key cannot be multi-valued");r.forEach(function(a){if(a.auto)throw new U.Schema("Only primary key can be marked as autoIncrement (++)");if(!a.keyPath)throw new U.Schema("Index must have a name and cannot be an empty string")}),t[n]=Wn(n,o,r)}})},yn.prototype.stores=function(n){var t=this.db;this._cfg.storesSource=this._cfg.storesSource?L(this._cfg.storesSource,n):n;var n=t._versions,r={},o={};return n.forEach(function(a){L(r,a._cfg.storesSource),o=a._cfg.dbschema={},a._parseStoresSpec(r,o)}),t._dbSchema=o,Zn(t,[t._allTables,t,t.Transaction.prototype]),hn(t,[t._allTables,t,t.Transaction.prototype,this._cfg.tables],N(o),o),t._storeNames=N(o),this},yn.prototype.upgrade=function(e){return this._cfg.contentUpgrade=Fe(this._cfg.contentUpgrade||pe,e),this},yn);function yn(){}function Yn(e,t){var n=e._dbNamesDB;return n||(n=e._dbNamesDB=new Xe(sn,{addons:[],indexedDB:e,IDBKeyRange:t})).version(1).stores({dbnames:"name"}),n.table("dbnames")}function Xn(e){return e&&typeof e.databases=="function"}function er(e){return rt(function(){return z.letThrough=!0,e()})}function tr(e){return!("from"in e)}var Ke=function(e,t){if(!this){var n=new Ke;return e&&"d"in e&&L(n,e),n}L(this,arguments.length?{d:1,from:e,to:1<arguments.length?t:e}:{d:0})};function Ht(e,t,n){var r=le(t,n);if(!isNaN(r)){if(0<r)throw RangeError();if(tr(e))return L(e,{from:t,to:n,d:1});var o=e.l,r=e.r;if(le(n,e.from)<0)return o?Ht(o,t,n):e.l={from:t,to:n,d:1,l:null,r:null},Lr(e);if(0<le(t,e.to))return r?Ht(r,t,n):e.r={from:t,to:n,d:1,l:null,r:null},Lr(e);le(t,e.from)<0&&(e.from=t,e.l=null,e.d=r?r.d+1:1),0<le(n,e.to)&&(e.to=n,e.r=null,e.d=e.l?e.l.d+1:1),n=!e.r,o&&!e.l&&Qt(e,o),r&&n&&Qt(e,r)}}function Qt(e,t){tr(t)||function n(r,h){var a=h.from,u=h.to,l=h.l,h=h.r;Ht(r,a,u),l&&n(r,l),h&&n(r,h)}(e,t)}function Br(e,t){var n=vn(t),r=n.next();if(r.done)return!1;for(var o=r.value,a=vn(e),u=a.next(o.from),l=u.value;!r.done&&!u.done;){if(le(l.from,o.to)<=0&&0<=le(l.to,o.from))return!0;le(o.from,l.from)<0?o=(r=n.next(l.from)).value:l=(u=a.next(o.from)).value}return!1}function vn(e){var t=tr(e)?null:{s:0,n:e};return{next:function(n){for(var r=0<arguments.length;t;)switch(t.s){case 0:if(t.s=1,r)for(;t.n.l&&le(n,t.n.from)<0;)t={up:t,n:t.n.l,s:1};else for(;t.n.l;)t={up:t,n:t.n.l,s:1};case 1:if(t.s=2,!r||le(n,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 Lr(e){var t,n,r=(((t=e.r)===null||t===void 0?void 0:t.d)||0)-(((n=e.l)===null||n===void 0?void 0:n.d)||0),o=1<r?"r":r<-1?"l":"";o&&(t=o=="r"?"l":"r",n=p({},e),r=e[o],e.from=r.from,e.to=r.to,e[o]=r[o],n[o]=r[t],(e[t]=n).d=Hr(n)),e.d=Hr(e)}function Hr(n){var t=n.r,n=n.l;return(t?n?Math.max(t.d,n.d):t.d:n?n.d:0)+1}function bn(e,t){return N(t).forEach(function(n){e[n]?Qt(e[n],t[n]):e[n]=function r(o){var a,u,l={};for(a in o)I(o,a)&&(u=o[a],l[a]=!u||typeof u!="object"||ge.has(u.constructor)?u:r(u));return l}(t[n])}),e}function nr(e,t){return e.all||t.all||Object.keys(e).some(function(n){return t[n]&&Br(t[n],e[n])})}J(Ke.prototype,((Ue={add:function(e){return Qt(this,e),this},addKey:function(e){return Ht(this,e,e),this},addKeys:function(e){var t=this;return e.forEach(function(n){return Ht(t,n,n)}),this},hasKey:function(e){var t=vn(this).next(e).value;return t&&le(t.from,e)<=0&&0<=le(t.to,e)}})[ce]=function(){return vn(this)},Ue));var bt={},rr={},or=!1;function xn(e){bn(rr,e),or||(or=!0,setTimeout(function(){or=!1,ar(rr,!(rr={}))},0))}function ar(e,t){t===void 0&&(t=!1);var n=new Set;if(e.all)for(var r=0,o=Object.values(bt);r<o.length;r++)Qr(u=o[r],e,n,t);else for(var a in e){var u,l=/^idb\:\/\/(.*)\/(.*)\//.exec(a);l&&(a=l[1],l=l[2],(u=bt["idb://".concat(a,"/").concat(l)])&&Qr(u,e,n,t))}n.forEach(function(h){return h()})}function Qr(e,t,n,r){for(var o=[],a=0,u=Object.entries(e.queries.query);a<u.length;a++){for(var l=u[a],h=l[0],g=[],b=0,f=l[1];b<f.length;b++){var w=f[b];nr(t,w.obsSet)?w.subscribers.forEach(function(y){return n.add(y)}):r&&g.push(w)}r&&o.push([h,g])}if(r)for(var m=0,v=o;m<v.length;m++){var x=v[m],h=x[0],g=x[1];e.queries.query[h]=g}}function Bo(e){var t=e._state,n=e._deps.indexedDB;if(t.isBeingOpened||e.idbdb)return t.dbReadyPromise.then(function(){return t.dbOpenError?Ce(t.dbOpenError):e});t.isBeingOpened=!0,t.dbOpenError=null,t.openComplete=!1;var r=t.openCanceller,o=Math.round(10*e.verno),a=!1;function u(){if(t.openCanceller!==r)throw new U.DatabaseClosed("db.open() was cancelled")}function l(){return new B(function(w,m){if(u(),!n)throw new U.MissingAPI;var v=e.name,x=t.autoSchema||!o?n.open(v):n.open(v,o);if(!x)throw new U.MissingAPI;x.onerror=Ze(m),x.onblocked=ke(e._fireOnBlocked),x.onupgradeneeded=ke(function(y){var j;b=x.transaction,t.autoSchema&&!e._options.allowEmptyDB?(x.onerror=Ft,b.abort(),x.result.close(),(j=n.deleteDatabase(v)).onsuccess=j.onerror=ke(function(){m(new U.NoSuchDatabase("Database ".concat(v," doesnt exist")))})):(b.onerror=Ze(m),y=y.oldVersion>Math.pow(2,62)?0:y.oldVersion,f=y<1,e.idbdb=x.result,a&&Fo(e,b),To(e,y/10,b,m))},m),x.onsuccess=ke(function(){b=null;var y,j,C,A,O,P=e.idbdb=x.result,T=Y(P.objectStoreNames);if(0<T.length)try{var R=P.transaction((A=T).length===1?A[0]:A,"readonly");if(t.autoSchema)j=P,C=R,(y=e).verno=j.version/10,C=y._dbSchema=mn(0,j,C),y._storeNames=Y(j.objectStoreNames,0),hn(y,[y._allTables],N(C),C);else if(gn(e,e._dbSchema,R),((O=$n(mn(0,(O=e).idbdb,R),O._dbSchema)).add.length||O.change.some(function(M){return M.add.length||M.change.length}))&&!a)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."),P.close(),o=P.version+1,a=!0,w(l());fn(e,R)}catch{}At.push(e),P.onversionchange=ke(function(M){t.vcFired=!0,e.on("versionchange").fire(M)}),P.onclose=ke(function(M){e.on("close").fire(M)}),f&&(O=e._deps,R=v,P=O.indexedDB,O=O.IDBKeyRange,Xn(P)||R===sn||Yn(P,O).put({name:R}).catch(pe)),w()},m)}).catch(function(w){switch(w?.name){case"UnknownError":if(0<t.PR1398_maxLoop)return t.PR1398_maxLoop--,console.warn("Dexie: Workaround for Chrome UnknownError on open()"),l();break;case"VersionError":if(0<o)return o=0,l()}return B.reject(w)})}var h,g=t.dbReadyResolve,b=null,f=!1;return B.race([r,(typeof navigator>"u"?B.resolve():!navigator.userAgentData&&/Safari\//.test(navigator.userAgent)&&!/Chrom(e|ium)\//.test(navigator.userAgent)&&indexedDB.databases?new Promise(function(w){function m(){return indexedDB.databases().finally(w)}h=setInterval(m,100),m()}).finally(function(){return clearInterval(h)}):Promise.resolve()).then(l)]).then(function(){return u(),t.onReadyBeingFired=[],B.resolve(er(function(){return e.on.ready.fire(e.vip)})).then(function w(){if(0<t.onReadyBeingFired.length){var m=t.onReadyBeingFired.reduce(Fe,pe);return t.onReadyBeingFired=[],B.resolve(er(function(){return m(e.vip)})).then(w)}})}).finally(function(){t.openCanceller===r&&(t.onReadyBeingFired=null,t.isBeingOpened=!1)}).catch(function(w){t.dbOpenError=w;try{b&&b.abort()}catch{}return r===t.openCanceller&&e._close(),Ce(w)}).finally(function(){t.openComplete=!0,g()}).then(function(){var w;return f&&(w={},e.tables.forEach(function(m){m.schema.indexes.forEach(function(v){v.name&&(w["idb://".concat(e.name,"/").concat(m.name,"/").concat(v.name)]=new Ke(-1/0,[[[]]]))}),w["idb://".concat(e.name,"/").concat(m.name,"/")]=w["idb://".concat(e.name,"/").concat(m.name,"/:dels")]=new Ke(-1/0,[[[]]])}),st(qt).fire(w),ar(w,!0)),e})}function ir(e){function t(a){return e.next(a)}var n=o(t),r=o(function(a){return e.throw(a)});function o(a){return function(h){var l=a(h),h=l.value;return l.done?h:h&&typeof h.then=="function"?h.then(n,r):S(h)?Promise.all(h).then(n,r):n(h)}}return o(t)()}function wn(e,t,n){for(var r=S(e)?e.slice():[e],o=0;o<n;++o)r.push(t);return r}var Lo={stack:"dbcore",name:"VirtualIndexMiddleware",level:1,create:function(e){return p(p({},e),{table:function(t){var n=e.table(t),r=n.schema,o={},a=[];function u(f,w,m){var v=Lt(f),x=o[v]=o[v]||[],y=f==null?0:typeof f=="string"?1:f.length,j=0<w,j=p(p({},m),{name:j?"".concat(v,"(virtual-from:").concat(m.name,")"):m.name,lowLevelIndex:m,isVirtual:j,keyTail:w,keyLength:y,extractKey:Jn(f),unique:!j&&m.unique});return x.push(j),j.isPrimaryKey||a.push(j),1<y&&u(y===2?f[0]:f.slice(0,y-1),w+1,m),x.sort(function(C,A){return C.keyTail-A.keyTail}),j}t=u(r.primaryKey.keyPath,0,r.primaryKey),o[":id"]=[t];for(var l=0,h=r.indexes;l<h.length;l++){var g=h[l];u(g.keyPath,0,g)}function b(f){var w,m=f.query.index;return m.isVirtual?p(p({},f),{query:{index:m.lowLevelIndex,range:(w=f.query.range,m=m.keyTail,{type:w.type===1?2:w.type,lower:wn(w.lower,w.lowerOpen?e.MAX_KEY:e.MIN_KEY,m),lowerOpen:!0,upper:wn(w.upper,w.upperOpen?e.MIN_KEY:e.MAX_KEY,m),upperOpen:!0})}}):f}return p(p({},n),{schema:p(p({},r),{primaryKey:t,indexes:a,getIndexByKeyPath:function(f){return(f=o[Lt(f)])&&f[0]}}),count:function(f){return n.count(b(f))},query:function(f){return n.query(b(f))},openCursor:function(f){var w=f.query.index,m=w.keyTail,v=w.isVirtual,x=w.keyLength;return v?n.openCursor(b(f)).then(function(j){return j&&y(j)}):n.openCursor(f);function y(j){return Object.create(j,{continue:{value:function(C){C!=null?j.continue(wn(C,f.reverse?e.MAX_KEY:e.MIN_KEY,m)):f.unique?j.continue(j.key.slice(0,x).concat(f.reverse?e.MIN_KEY:e.MAX_KEY,m)):j.continue()}},continuePrimaryKey:{value:function(C,A){j.continuePrimaryKey(wn(C,e.MAX_KEY,m),A)}},primaryKey:{get:function(){return j.primaryKey}},key:{get:function(){var C=j.key;return x===1?C[0]:C.slice(0,x)}},value:{get:function(){return j.value}}})}}})}})}};function sr(e,t,n,r){return n=n||{},r=r||"",N(e).forEach(function(o){var a,u,l;I(t,o)?(a=e[o],u=t[o],typeof a=="object"&&typeof u=="object"&&a&&u?(l=$(a))!==$(u)?n[r+o]=t[o]:l==="Object"?sr(a,u,n,r+o+"."):a!==u&&(n[r+o]=t[o]):a!==u&&(n[r+o]=t[o])):n[r+o]=void 0}),N(t).forEach(function(o){I(e,o)||(n[r+o]=t[o])}),n}function ur(e,t){return t.type==="delete"?t.keys:t.keys||t.values.map(e.extractKey)}var Ho={stack:"dbcore",name:"HooksMiddleware",level:2,create:function(e){return p(p({},e),{table:function(t){var n=e.table(t),r=n.schema.primaryKey;return p(p({},n),{mutate:function(o){var a=z.trans,u=a.table(t).hook,l=u.deleting,h=u.creating,g=u.updating;switch(o.type){case"add":if(h.fire===pe)break;return a._promise("readwrite",function(){return b(o)},!0);case"put":if(h.fire===pe&&g.fire===pe)break;return a._promise("readwrite",function(){return b(o)},!0);case"delete":if(l.fire===pe)break;return a._promise("readwrite",function(){return b(o)},!0);case"deleteRange":if(l.fire===pe)break;return a._promise("readwrite",function(){return function f(w,m,v){return n.query({trans:w,values:!1,query:{index:r,range:m},limit:v}).then(function(x){var y=x.result;return b({type:"delete",keys:y,trans:w}).then(function(j){return 0<j.numFailures?Promise.reject(j.failures[0]):y.length<v?{failures:[],numFailures:0,lastResult:void 0}:f(w,p(p({},m),{lower:y[y.length-1],lowerOpen:!0}),v)})})}(o.trans,o.range,1e4)},!0)}return n.mutate(o);function b(f){var w,m,v,x=z.trans,y=f.keys||ur(r,f);if(!y)throw new Error("Keys missing");return(f=f.type==="add"||f.type==="put"?p(p({},f),{keys:y}):p({},f)).type!=="delete"&&(f.values=_([],f.values)),f.keys&&(f.keys=_([],f.keys)),w=n,v=y,((m=f).type==="add"?Promise.resolve([]):w.getMany({trans:m.trans,keys:v,cache:"immutable"})).then(function(j){var C=y.map(function(A,O){var P,T,R,M=j[O],F={onerror:null,onsuccess:null};return f.type==="delete"?l.fire.call(F,A,M,x):f.type==="add"||M===void 0?(P=h.fire.call(F,A,f.values[O],x),A==null&&P!=null&&(f.keys[O]=A=P,r.outbound||ne(f.values[O],r.keyPath,A))):(P=sr(M,f.values[O]),(T=g.fire.call(F,P,A,M,x))&&(R=f.values[O],Object.keys(T).forEach(function(K){I(R,K)?R[K]=T[K]:ne(R,K,T[K])}))),F});return n.mutate(f).then(function(A){for(var O=A.failures,P=A.results,T=A.numFailures,A=A.lastResult,R=0;R<y.length;++R){var M=(P||y)[R],F=C[R];M==null?F.onerror&&F.onerror(O[R]):F.onsuccess&&F.onsuccess(f.type==="put"&&j[R]?f.values[R]:M)}return{failures:O,results:P,numFailures:T,lastResult:A}}).catch(function(A){return C.forEach(function(O){return O.onerror&&O.onerror(A)}),Promise.reject(A)})})}}})}})}};function Vr(e,t,n){try{if(!t||t.keys.length<e.length)return null;for(var r=[],o=0,a=0;o<t.keys.length&&a<e.length;++o)le(t.keys[o],e[a])===0&&(r.push(n?Oe(t.values[o]):t.values[o]),++a);return r.length===e.length?r:null}catch{return null}}var Qo={stack:"dbcore",level:-1,create:function(e){return{table:function(t){var n=e.table(t);return p(p({},n),{getMany:function(r){if(!r.cache)return n.getMany(r);var o=Vr(r.keys,r.trans._cache,r.cache==="clone");return o?B.resolve(o):n.getMany(r).then(function(a){return r.trans._cache={keys:r.keys,values:r.cache==="clone"?Oe(a):a},a})},mutate:function(r){return r.type!=="add"&&(r.trans._cache=null),n.mutate(r)}})}}}};function zr(e,t){return e.trans.mode==="readonly"&&!!e.subscr&&!e.trans.explicit&&e.trans.db._options.cache!=="disabled"&&!t.schema.primaryKey.outbound}function Ur(e,t){switch(e){case"query":return t.values&&!t.unique;case"get":case"getMany":case"count":case"openCursor":return!1}}var Vo={stack:"dbcore",level:0,name:"Observability",create:function(e){var t=e.schema.name,n=new Ke(e.MIN_KEY,e.MAX_KEY);return p(p({},e),{transaction:function(r,o,a){if(z.subscr&&o!=="readonly")throw new U.ReadOnly("Readwrite transaction in liveQuery context. Querier source: ".concat(z.querier));return e.transaction(r,o,a)},table:function(r){var o=e.table(r),a=o.schema,u=a.primaryKey,f=a.indexes,l=u.extractKey,h=u.outbound,g=u.autoIncrement&&f.filter(function(m){return m.compound&&m.keyPath.includes(u.keyPath)}),b=p(p({},o),{mutate:function(m){function v(K){return K="idb://".concat(t,"/").concat(r,"/").concat(K),A[K]||(A[K]=new Ke)}var x,y,j,C=m.trans,A=m.mutatedParts||(m.mutatedParts={}),O=v(""),P=v(":dels"),T=m.type,F=m.type==="deleteRange"?[m.range]:m.type==="delete"?[m.keys]:m.values.length<50?[ur(u,m).filter(function(K){return K}),m.values]:[],R=F[0],M=F[1],F=m.trans._cache;return S(R)?(O.addKeys(R),(F=T==="delete"||R.length===M.length?Vr(R,F):null)||P.addKeys(R),(F||M)&&(x=v,y=F,j=M,a.indexes.forEach(function(K){var Q=x(K.name||"");function te(ae){return ae!=null?K.extractKey(ae):null}function oe(ae){return K.multiEntry&&S(ae)?ae.forEach(function(Ve){return Q.addKey(Ve)}):Q.addKey(ae)}(y||j).forEach(function(ae,Ie){var ee=y&&te(y[Ie]),Ie=j&&te(j[Ie]);le(ee,Ie)!==0&&(ee!=null&&oe(ee),Ie!=null&&oe(Ie))})}))):R?(M={from:(M=R.lower)!==null&&M!==void 0?M:e.MIN_KEY,to:(M=R.upper)!==null&&M!==void 0?M:e.MAX_KEY},P.add(M),O.add(M)):(O.add(n),P.add(n),a.indexes.forEach(function(K){return v(K.name).add(n)})),o.mutate(m).then(function(K){return!R||m.type!=="add"&&m.type!=="put"||(O.addKeys(K.results),g&&g.forEach(function(Q){for(var te=m.values.map(function(ee){return Q.extractKey(ee)}),oe=Q.keyPath.findIndex(function(ee){return ee===u.keyPath}),ae=0,Ve=K.results.length;ae<Ve;++ae)te[ae][oe]=K.results[ae];v(Q.name).addKeys(te)})),C.mutatedParts=bn(C.mutatedParts||{},A),K})}}),f=function(v){var x=v.query,v=x.index,x=x.range;return[v,new Ke((v=x.lower)!==null&&v!==void 0?v:e.MIN_KEY,(x=x.upper)!==null&&x!==void 0?x:e.MAX_KEY)]},w={get:function(m){return[u,new Ke(m.key)]},getMany:function(m){return[u,new Ke().addKeys(m.keys)]},count:f,query:f,openCursor:f};return N(w).forEach(function(m){b[m]=function(v){var x=z.subscr,y=!!x,j=zr(z,o)&&Ur(m,v)?v.obsSet={}:x;if(y){var C=function(M){return M="idb://".concat(t,"/").concat(r,"/").concat(M),j[M]||(j[M]=new Ke)},A=C(""),O=C(":dels"),x=w[m](v),y=x[0],x=x[1];if((m==="query"&&y.isPrimaryKey&&!v.values?O:C(y.name||"")).add(x),!y.isPrimaryKey){if(m!=="count"){var P=m==="query"&&h&&v.values&&o.query(p(p({},v),{values:!1}));return o[m].apply(this,arguments).then(function(M){if(m==="query"){if(h&&v.values)return P.then(function(te){return te=te.result,A.addKeys(te),M});var F=v.values?M.result.map(l):M.result;(v.values?A:O).addKeys(F)}else if(m==="openCursor"){var K=M,Q=v.values;return K&&Object.create(K,{key:{get:function(){return O.addKey(K.primaryKey),K.key}},primaryKey:{get:function(){var te=K.primaryKey;return O.addKey(te),te}},value:{get:function(){return Q&&A.addKey(K.primaryKey),K.value}}})}return M})}O.add(n)}}return o[m].apply(this,arguments)}}),b}})}};function Wr(e,t,n){if(n.numFailures===0)return t;if(t.type==="deleteRange")return null;var r=t.keys?t.keys.length:"values"in t&&t.values?t.values.length:1;return n.numFailures===r?null:(t=p({},t),S(t.keys)&&(t.keys=t.keys.filter(function(o,a){return!(a in n.failures)})),"values"in t&&S(t.values)&&(t.values=t.values.filter(function(o,a){return!(a in n.failures)})),t)}function lr(e,t){return n=e,((r=t).lower===void 0||(r.lowerOpen?0<le(n,r.lower):0<=le(n,r.lower)))&&(e=e,(t=t).upper===void 0||(t.upperOpen?le(e,t.upper)<0:le(e,t.upper)<=0));var n,r}function Jr(e,t,w,r,o,a){if(!w||w.length===0)return e;var u=t.query.index,l=u.multiEntry,h=t.query.range,g=r.schema.primaryKey.extractKey,b=u.extractKey,f=(u.lowLevelIndex||u).extractKey,w=w.reduce(function(m,v){var x=m,y=[];if(v.type==="add"||v.type==="put")for(var j=new Ke,C=v.values.length-1;0<=C;--C){var A,O=v.values[C],P=g(O);j.hasKey(P)||(A=b(O),(l&&S(A)?A.some(function(K){return lr(K,h)}):lr(A,h))&&(j.addKey(P),y.push(O)))}switch(v.type){case"add":var T=new Ke().addKeys(t.values?m.map(function(Q){return g(Q)}):m),x=m.concat(t.values?y.filter(function(Q){return Q=g(Q),!T.hasKey(Q)&&(T.addKey(Q),!0)}):y.map(function(Q){return g(Q)}).filter(function(Q){return!T.hasKey(Q)&&(T.addKey(Q),!0)}));break;case"put":var R=new Ke().addKeys(v.values.map(function(Q){return g(Q)}));x=m.filter(function(Q){return!R.hasKey(t.values?g(Q):Q)}).concat(t.values?y:y.map(function(Q){return g(Q)}));break;case"delete":var M=new Ke().addKeys(v.keys);x=m.filter(function(Q){return!M.hasKey(t.values?g(Q):Q)});break;case"deleteRange":var F=v.range;x=m.filter(function(Q){return!lr(g(Q),F)})}return x},e);return w===e?e:(w.sort(function(m,v){return le(f(m),f(v))||le(g(m),g(v))}),t.limit&&t.limit<1/0&&(w.length>t.limit?w.length=t.limit:e.length===t.limit&&w.length<t.limit&&(o.dirty=!0)),a?Object.freeze(w):w)}function Zr(e,t){return le(e.lower,t.lower)===0&&le(e.upper,t.upper)===0&&!!e.lowerOpen==!!t.lowerOpen&&!!e.upperOpen==!!t.upperOpen}function zo(e,t){return function(n,r,o,a){if(n===void 0)return r!==void 0?-1:0;if(r===void 0)return 1;if((r=le(n,r))===0){if(o&&a)return 0;if(o)return 1;if(a)return-1}return r}(e.lower,t.lower,e.lowerOpen,t.lowerOpen)<=0&&0<=function(n,r,o,a){if(n===void 0)return r!==void 0?1:0;if(r===void 0)return-1;if((r=le(n,r))===0){if(o&&a)return 0;if(o)return-1;if(a)return 1}return r}(e.upper,t.upper,e.upperOpen,t.upperOpen)}function Uo(e,t,n,r){e.subscribers.add(n),r.addEventListener("abort",function(){var o,a;e.subscribers.delete(n),e.subscribers.size===0&&(o=e,a=t,setTimeout(function(){o.subscribers.size===0&&Ee(a,o)},3e3))})}var Wo={stack:"dbcore",level:0,name:"Cache",create:function(e){var t=e.schema.name;return p(p({},e),{transaction:function(n,r,o){var a,u,l=e.transaction(n,r,o);return r==="readwrite"&&(u=(a=new AbortController).signal,o=function(h){return function(){if(a.abort(),r==="readwrite"){for(var g=new Set,b=0,f=n;b<f.length;b++){var w=f[b],m=bt["idb://".concat(t,"/").concat(w)];if(m){var v=e.table(w),x=m.optimisticOps.filter(function(Q){return Q.trans===l});if(l._explicit&&h&&l.mutatedParts)for(var y=0,j=Object.values(m.queries.query);y<j.length;y++)for(var C=0,A=(T=j[y]).slice();C<A.length;C++)nr((R=A[C]).obsSet,l.mutatedParts)&&(Ee(T,R),R.subscribers.forEach(function(Q){return g.add(Q)}));else if(0<x.length){m.optimisticOps=m.optimisticOps.filter(function(Q){return Q.trans!==l});for(var O=0,P=Object.values(m.queries.query);O<P.length;O++)for(var T,R,M,F=0,K=(T=P[O]).slice();F<K.length;F++)(R=K[F]).res!=null&&l.mutatedParts&&(h&&!R.dirty?(M=Object.isFrozen(R.res),M=Jr(R.res,R.req,x,v,R,M),R.dirty?(Ee(T,R),R.subscribers.forEach(function(Q){return g.add(Q)})):M!==R.res&&(R.res=M,R.promise=B.resolve({result:M}))):(R.dirty&&Ee(T,R),R.subscribers.forEach(function(Q){return g.add(Q)})))}}}g.forEach(function(Q){return Q()})}}},l.addEventListener("abort",o(!1),{signal:u}),l.addEventListener("error",o(!1),{signal:u}),l.addEventListener("complete",o(!0),{signal:u})),l},table:function(n){var r=e.table(n),o=r.schema.primaryKey;return p(p({},r),{mutate:function(a){var u=z.trans;if(o.outbound||u.db._options.cache==="disabled"||u.explicit||u.idbtrans.mode!=="readwrite")return r.mutate(a);var l=bt["idb://".concat(t,"/").concat(n)];return l?(u=r.mutate(a),a.type!=="add"&&a.type!=="put"||!(50<=a.values.length||ur(o,a).some(function(h){return h==null}))?(l.optimisticOps.push(a),a.mutatedParts&&xn(a.mutatedParts),u.then(function(h){0<h.numFailures&&(Ee(l.optimisticOps,a),(h=Wr(0,a,h))&&l.optimisticOps.push(h),a.mutatedParts&&xn(a.mutatedParts))}),u.catch(function(){Ee(l.optimisticOps,a),a.mutatedParts&&xn(a.mutatedParts)})):u.then(function(h){var g=Wr(0,p(p({},a),{values:a.values.map(function(b,f){var w;return h.failures[f]||(b=(w=o.keyPath)!==null&&w!==void 0&&w.includes(".")?Oe(b):p({},b),ne(b,o.keyPath,h.results[f])),b})}),h);l.optimisticOps.push(g),queueMicrotask(function(){return a.mutatedParts&&xn(a.mutatedParts)})}),u):r.mutate(a)},query:function(a){if(!zr(z,r)||!Ur("query",a))return r.query(a);var u=((g=z.trans)===null||g===void 0?void 0:g.db._options.cache)==="immutable",f=z,l=f.requery,h=f.signal,g=function(v,x,y,j){var C=bt["idb://".concat(v,"/").concat(x)];if(!C)return[];if(!(x=C.queries[y]))return[null,!1,C,null];var A=x[(j.query?j.query.index.name:null)||""];if(!A)return[null,!1,C,null];switch(y){case"query":var O=A.find(function(P){return P.req.limit===j.limit&&P.req.values===j.values&&Zr(P.req.query.range,j.query.range)});return O?[O,!0,C,A]:[A.find(function(P){return("limit"in P.req?P.req.limit:1/0)>=j.limit&&(!j.values||P.req.values)&&zo(P.req.query.range,j.query.range)}),!1,C,A];case"count":return O=A.find(function(P){return Zr(P.req.query.range,j.query.range)}),[O,!!O,C,A]}}(t,n,"query",a),b=g[0],f=g[1],w=g[2],m=g[3];return b&&f?b.obsSet=a.obsSet:(f=r.query(a).then(function(v){var x=v.result;if(b&&(b.res=x),u){for(var y=0,j=x.length;y<j;++y)Object.freeze(x[y]);Object.freeze(x)}else v.result=Oe(x);return v}).catch(function(v){return m&&b&&Ee(m,b),Promise.reject(v)}),b={obsSet:a.obsSet,promise:f,subscribers:new Set,type:"query",req:a,dirty:!1},m?m.push(b):(m=[b],(w=w||(bt["idb://".concat(t,"/").concat(n)]={queries:{query:{},count:{}},objs:new Map,optimisticOps:[],unsignaledParts:{}})).queries.query[a.query.index.name||""]=m)),Uo(b,m,l,h),b.promise.then(function(v){return{result:Jr(v.result,a,w?.optimisticOps,r,b,u)}})}})}})}};function jn(e,t){return new Proxy(e,{get:function(n,r,o){return r==="db"?t:Reflect.get(n,r,o)}})}var Xe=(Ae.prototype.version=function(e){if(isNaN(e)||e<.1)throw new U.Type("Given version is not a positive number");if(e=Math.round(10*e)/10,this.idbdb||this._state.isBeingOpened)throw new U.Schema("Cannot add version when database is open");this.verno=Math.max(this.verno,e);var t=this._versions,n=t.filter(function(r){return r._cfg.version===e})[0];return n||(n=new this.Version(e),t.push(n),t.sort(Io),n.stores({}),this._state.autoSchema=!1,n)},Ae.prototype._whenReady=function(e){var t=this;return this.idbdb&&(this._state.openComplete||z.letThrough||this._vip)?e():new B(function(n,r){if(t._state.openComplete)return r(new U.DatabaseClosed(t._state.dbOpenError));if(!t._state.isBeingOpened){if(!t._state.autoOpen)return void r(new U.DatabaseClosed);t.open().catch(pe)}t._state.dbReadyPromise.then(n,r)}).then(e)},Ae.prototype.use=function(e){var t=e.stack,n=e.create,r=e.level,o=e.name;return o&&this.unuse({stack:t,name:o}),e=this._middlewares[t]||(this._middlewares[t]=[]),e.push({stack:t,create:n,level:r??10,name:o}),e.sort(function(a,u){return a.level-u.level}),this},Ae.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(o){return r?o.create!==r:!!n&&o.name!==n})),this},Ae.prototype.open=function(){var e=this;return gt(nt,function(){return Bo(e)})},Ae.prototype._close=function(){var e=this._state,t=At.indexOf(this);if(0<=t&&At.splice(t,1),this.idbdb){try{this.idbdb.close()}catch{}this.idbdb=null}e.isBeingOpened||(e.dbReadyPromise=new B(function(n){e.dbReadyResolve=n}),e.openCanceller=new B(function(n,r){e.cancelOpen=r}))},Ae.prototype.close=function(n){var t=(n===void 0?{disableAutoOpen:!0}:n).disableAutoOpen,n=this._state;t?(n.isBeingOpened&&n.cancelOpen(new U.DatabaseClosed),this._close(),n.autoOpen=!1,n.dbOpenError=new U.DatabaseClosed):(this._close(),n.autoOpen=this._options.autoOpen||n.isBeingOpened,n.openComplete=!1,n.dbOpenError=null)},Ae.prototype.delete=function(e){var t=this;e===void 0&&(e={disableAutoOpen:!0});var n=0<arguments.length&&typeof arguments[0]!="object",r=this._state;return new B(function(o,a){function u(){t.close(e);var l=t._deps.indexedDB.deleteDatabase(t.name);l.onsuccess=ke(function(){var h,g,b;h=t._deps,g=t.name,b=h.indexedDB,h=h.IDBKeyRange,Xn(b)||g===sn||Yn(b,h).delete(g).catch(pe),o()}),l.onerror=Ze(a),l.onblocked=t._fireOnBlocked}if(n)throw new U.InvalidArgument("Invalid closeOptions argument to db.delete()");r.isBeingOpened?r.dbReadyPromise.then(u):u()})},Ae.prototype.backendDB=function(){return this.idbdb},Ae.prototype.isOpen=function(){return this.idbdb!==null},Ae.prototype.hasBeenClosed=function(){var e=this._state.dbOpenError;return e&&e.name==="DatabaseClosed"},Ae.prototype.hasFailed=function(){return this._state.dbOpenError!==null},Ae.prototype.dynamicallyOpened=function(){return this._state.autoSchema},Object.defineProperty(Ae.prototype,"tables",{get:function(){var e=this;return N(this._allTables).map(function(t){return e._allTables[t]})},enumerable:!1,configurable:!0}),Ae.prototype.transaction=function(){var e=function(t,n,r){var o=arguments.length;if(o<2)throw new U.InvalidArgument("Too few arguments");for(var a=new Array(o-1);--o;)a[o-1]=arguments[o];return r=a.pop(),[t,Z(a),r]}.apply(this,arguments);return this._transaction.apply(this,e)},Ae.prototype._transaction=function(e,t,n){var r=this,o=z.trans;o&&o.db===this&&e.indexOf("!")===-1||(o=null);var a,u,l=e.indexOf("?")!==-1;e=e.replace("!","").replace("?","");try{if(u=t.map(function(g){if(g=g instanceof r.Table?g.name:g,typeof g!="string")throw new TypeError("Invalid table argument to Dexie.transaction(). Only Table or String are allowed");return g}),e=="r"||e===Bn)a=Bn;else{if(e!="rw"&&e!=Ln)throw new U.InvalidArgument("Invalid transaction mode: "+e);a=Ln}if(o){if(o.mode===Bn&&a===Ln){if(!l)throw new U.SubTransaction("Cannot enter a sub-transaction with READWRITE mode when parent transaction is READONLY");o=null}o&&u.forEach(function(g){if(o&&o.storeNames.indexOf(g)===-1){if(!l)throw new U.SubTransaction("Table "+g+" not included in parent transaction.");o=null}}),l&&o&&!o.active&&(o=null)}}catch(g){return o?o._promise(null,function(b,f){f(g)}):Ce(g)}var h=function g(b,f,w,m,v){return B.resolve().then(function(){var x=z.transless||z,y=b._createTransaction(f,w,b._dbSchema,m);if(y.explicit=!0,x={trans:y,transless:x},m)y.idbtrans=m.idbtrans;else try{y.create(),y.idbtrans._explicit=!0,b._state.PR1398_maxLoop=3}catch(A){return A.name===dt.InvalidState&&b.isOpen()&&0<--b._state.PR1398_maxLoop?(console.warn("Dexie: Need to reopen db"),b.close({disableAutoOpen:!1}),b.open().then(function(){return g(b,f,w,null,v)})):Ce(A)}var j,C=re(v);return C&&Ct(),x=B.follow(function(){var A;(j=v.call(y,y))&&(C?(A=ot.bind(null,null),j.then(A,A)):typeof j.next=="function"&&typeof j.throw=="function"&&(j=ir(j)))},x),(j&&typeof j.then=="function"?B.resolve(j).then(function(A){return y.active?A:Ce(new U.PrematureCommit("Transaction committed too early. See http://bit.ly/2kdckMn"))}):x.then(function(){return j})).then(function(A){return m&&y._resolve(),y._completion.then(function(){return A})}).catch(function(A){return y._reject(A),Ce(A)})})}.bind(null,this,a,u,o,n);return o?o._promise(a,h,"lock"):z.trans?gt(z.transless,function(){return r._whenReady(h)}):this._whenReady(h)},Ae.prototype.table=function(e){if(!I(this._allTables,e))throw new U.InvalidTable("Table ".concat(e," does not exist"));return this._allTables[e]},Ae);function Ae(e,t){var n=this;this._middlewares={},this.verno=0;var r=Ae.dependencies;this._options=t=p({addons:Ae.addons,autoOpen:!0,indexedDB:r.indexedDB,IDBKeyRange:r.IDBKeyRange,cache:"cloned"},t),this._deps={indexedDB:t.indexedDB,IDBKeyRange:t.IDBKeyRange},r=t.addons,this._dbSchema={},this._versions=[],this._storeNames=[],this._allTables={},this.idbdb=null,this._novip=this;var o,a,u,l,h,g={dbOpenError:null,isBeingOpened:!1,onReadyBeingFired:null,openComplete:!1,dbReadyResolve:pe,dbReadyPromise:null,cancelOpen:pe,openCanceller:null,autoSchema:!0,PR1398_maxLoop:3,autoOpen:t.autoOpen};g.dbReadyPromise=new B(function(f){g.dbReadyResolve=f}),g.openCanceller=new B(function(f,w){g.cancelOpen=w}),this._state=g,this.name=e,this.on=Kt(this,"populate","blocked","versionchange","close",{ready:[Fe,pe]}),this.on.ready.subscribe=ve(this.on.ready.subscribe,function(f){return function(w,m){Ae.vip(function(){var v,x=n._state;x.openComplete?(x.dbOpenError||B.resolve().then(w),m&&f(w)):x.onReadyBeingFired?(x.onReadyBeingFired.push(w),m&&f(w)):(f(w),v=n,m||f(function y(){v.on.ready.unsubscribe(w),v.on.ready.unsubscribe(y)}))})}}),this.Collection=(o=this,It(So.prototype,function(j,y){this.db=o;var m=Ar,v=null;if(y)try{m=y()}catch(C){v=C}var x=j._ctx,y=x.table,j=y.hook.reading.fire;this._ctx={table:y,index:x.index,isPrimKey:!x.index||y.schema.primKey.keyPath&&x.index===y.schema.primKey.name,range:m,keysOnly:!1,dir:"next",unique:"",algorithm:null,filter:null,replayFilter:null,justLimit:!0,isMatch:null,offset:0,limit:1/0,error:v,or:x.or,valueMapper:j!==tt?j:null}})),this.Table=(a=this,It(Er.prototype,function(f,w,m){this.db=a,this._tx=m,this.name=f,this.schema=w,this.hook=a._allTables[f]?a._allTables[f].hook:Kt(null,{creating:[V,pe],reading:[Pn,tt],updating:[Re,pe],deleting:[he,pe]})})),this.Transaction=(u=this,It(Ro.prototype,function(f,w,m,v,x){var y=this;this.db=u,this.mode=f,this.storeNames=w,this.schema=m,this.chromeTransactionDurability=v,this.idbtrans=null,this.on=Kt(this,"complete","error","abort"),this.parent=x||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 B(function(j,C){y._resolve=j,y._reject=C}),this._completion.then(function(){y.active=!1,y.on.complete.fire()},function(j){var C=y.active;return y.active=!1,y.on.error.fire(j),y.parent?y.parent._reject(j):C&&y.idbtrans&&y.idbtrans.abort(),Ce(j)})})),this.Version=(l=this,It(qo.prototype,function(f){this.db=l,this._cfg={version:f,storesSource:null,dbschema:{},tables:{},contentUpgrade:null}})),this.WhereClause=(h=this,It(Kr.prototype,function(f,w,m){if(this.db=h,this._ctx={table:f,index:w===":id"?null:w,or:m},this._cmp=this._ascending=le,this._descending=function(v,x){return le(x,v)},this._max=function(v,x){return 0<le(v,x)?v:x},this._min=function(v,x){return le(v,x)<0?v:x},this._IDBKeyRange=h._deps.IDBKeyRange,!this._IDBKeyRange)throw new U.MissingAPI})),this.on("versionchange",function(f){0<f.newVersion?console.warn("Another connection wants to upgrade database '".concat(n.name,"'. Closing db now to resume the upgrade.")):console.warn("Another connection wants to delete database '".concat(n.name,"'. Closing db now to resume the delete request.")),n.close({disableAutoOpen:!1})}),this.on("blocked",function(f){!f.newVersion||f.newVersion<f.oldVersion?console.warn("Dexie.delete('".concat(n.name,"') was blocked")):console.warn("Upgrade '".concat(n.name,"' blocked by other connection holding version ").concat(f.oldVersion/10))}),this._maxKey=Bt(t.IDBKeyRange),this._createTransaction=function(f,w,m,v){return new n.Transaction(f,w,m,n._options.chromeTransactionDurability,v)},this._fireOnBlocked=function(f){n.on("blocked").fire(f),At.filter(function(w){return w.name===n.name&&w!==n&&!w._state.vcFired}).map(function(w){return w.on("versionchange").fire(f)})},this.use(Qo),this.use(Wo),this.use(Vo),this.use(Lo),this.use(Ho);var b=new Proxy(this,{get:function(f,w,m){if(w==="_vip")return!0;if(w==="table")return function(x){return jn(n.table(x),b)};var v=Reflect.get(f,w,m);return v instanceof Er?jn(v,b):w==="tables"?v.map(function(x){return jn(x,b)}):w==="_createTransaction"?function(){return jn(v.apply(this,arguments),b)}:v}});this.vip=b,r.forEach(function(f){return f(n)})}var kn,Ue=typeof Symbol<"u"&&"observable"in Symbol?Symbol.observable:"@@observable",Jo=(cr.prototype.subscribe=function(e,t,n){return this._subscribe(e&&typeof e!="function"?e:{next:e,error:t,complete:n})},cr.prototype[Ue]=function(){return this},cr);function cr(e){this._subscribe=e}try{kn={indexedDB:k.indexedDB||k.mozIndexedDB||k.webkitIndexedDB||k.msIndexedDB,IDBKeyRange:k.IDBKeyRange||k.webkitIDBKeyRange}}catch{kn={indexedDB:null,IDBKeyRange:null}}function $r(e){var t,n=!1,r=new Jo(function(o){var a=re(e),u,l=!1,h={},g={},b={get closed(){return l},unsubscribe:function(){l||(l=!0,u&&u.abort(),f&&st.storagemutated.unsubscribe(m))}};o.start&&o.start(b);var f=!1,w=function(){return qn(v)},m=function(x){bn(h,x),nr(g,h)&&w()},v=function(){var x,y,j;!l&&kn.indexedDB&&(h={},x={},u&&u.abort(),u=new AbortController,j=function(C){var A=kt();try{a&&Ct();var O=rt(e,C);return O=a?O.finally(ot):O}finally{A&&_t()}}(y={subscr:x,signal:u.signal,requery:w,querier:e,trans:null}),Promise.resolve(j).then(function(C){n=!0,t=C,l||y.signal.aborted||(h={},function(A){for(var O in A)if(I(A,O))return;return 1}(g=x)||f||(st(qt,m),f=!0),qn(function(){return!l&&o.next&&o.next(C)}))},function(C){n=!1,["DatabaseClosedError","AbortError"].includes(C?.name)||l||qn(function(){l||o.error&&o.error(C)})}))};return setTimeout(w,0),b});return r.hasValue=function(){return n},r.getValue=function(){return t},r}var xt=Xe;function dr(e){var t=ut;try{ut=!0,st.storagemutated.fire(e),ar(e,!0)}finally{ut=t}}J(xt,p(p({},jt),{delete:function(e){return new xt(e,{addons:[]}).delete()},exists:function(e){return new xt(e,{addons:[]}).open().then(function(t){return t.close(),!0}).catch("NoSuchDatabaseError",function(){return!1})},getDatabaseNames:function(e){try{return t=xt.dependencies,n=t.indexedDB,t=t.IDBKeyRange,(Xn(n)?Promise.resolve(n.databases()).then(function(r){return r.map(function(o){return o.name}).filter(function(o){return o!==sn})}):Yn(n,t).toCollection().primaryKeys()).then(e)}catch{return Ce(new U.MissingAPI)}var t,n},defineClass:function(){return function(e){L(this,e)}},ignoreTransaction:function(e){return z.trans?gt(z.transless,e):e()},vip:er,async:function(e){return function(){try{var t=ir(e.apply(this,arguments));return t&&typeof t.then=="function"?t:B.resolve(t)}catch(n){return Ce(n)}}},spawn:function(e,t,n){try{var r=ir(e.apply(n,t||[]));return r&&typeof r.then=="function"?r:B.resolve(r)}catch(o){return Ce(o)}},currentTransaction:{get:function(){return z.trans||null}},waitFor:function(e,t){return t=B.resolve(typeof e=="function"?xt.ignoreTransaction(e):e).timeout(t||6e4),z.trans?z.trans.waitFor(t):t},Promise:B,debug:{get:function(){return se},set:function(e){Gt(e)}},derive:G,extend:L,props:J,override:ve,Events:Kt,on:st,liveQuery:$r,extendObservabilitySet:bn,getByKeyPath:ie,setByKeyPath:ne,delByKeyPath:function(e,t){typeof t=="string"?ne(e,t,void 0):"length"in t&&[].map.call(t,function(n){ne(e,n,void 0)})},shallowClone:be,deepClone:Oe,getObjectDiff:sr,cmp:le,asap:me,minKey:-1/0,addons:[],connections:At,errnames:dt,dependencies:kn,cache:bt,semVer:"4.0.11",version:"4.0.11".split(".").map(function(e){return parseInt(e)}).reduce(function(e,t,n){return e+t/Math.pow(10,2*n)})})),xt.maxKey=Bt(xt.dependencies.IDBKeyRange),typeof dispatchEvent<"u"&&typeof addEventListener<"u"&&(st(qt,function(e){ut||(e=new CustomEvent(zn,{detail:e}),ut=!0,dispatchEvent(e),ut=!1)}),addEventListener(zn,function(e){e=e.detail,ut||dr(e)}));var St,ut=!1,Gr=function(){};return typeof BroadcastChannel<"u"&&((Gr=function(){(St=new BroadcastChannel(zn)).onmessage=function(e){return e.data&&dr(e.data)}})(),typeof St.unref=="function"&&St.unref(),st(qt,function(e){ut||St.postMessage(e)})),typeof addEventListener<"u"&&(addEventListener("pagehide",function(e){if(!Xe.disableBfCache&&e.persisted){se&&console.debug("Dexie: handling persisted pagehide"),St?.close();for(var t=0,n=At;t<n.length;t++)n[t].close({disableAutoOpen:!1})}}),addEventListener("pageshow",function(e){!Xe.disableBfCache&&e.persisted&&(se&&console.debug("Dexie: handling persisted pageshow"),Gr(),dr({all:new Ke(-1/0,[[]])}))})),B.rejectionMapper=function(e,t){return!e||e instanceof _e||e instanceof TypeError||e instanceof SyntaxError||!e.name||!$t[e.name]?e:(t=new $t[e.name](t||e.message,e),"stack"in e&&H(t,"stack",{get:function(){return this.inner.stack}}),t)},Gt(se),p(Xe,Object.freeze({__proto__:null,Dexie:Xe,liveQuery:$r,Entity:Nr,cmp:le,PropModification:Tt,replacePrefix:function(e,t){return new Tt({replacePrefix:[e,t]})},add:function(e){return new Tt({add:e})},remove:function(e){return new Tt({remove:e})},default:Xe,RangeSet:Ke,mergeRanges:Qt,rangesOverlap:Br}),{default:Xe}),Xe})}(gr)),gr.exports}var ta=ea();const yr=$o(ta),no=Symbol.for("Dexie"),On=globalThis[no]||(globalThis[no]=yr);if(yr.semVer!==On.semVer)throw new Error(`Two different versions of Dexie loaded in the same app: ${yr.semVer} and ${On.semVer}`);const{liveQuery:na,mergeRanges:Ei,rangesOverlap:Pi,RangeSet:Ri,cmp:Mi,Entity:Di,PropModification:Ki,replacePrefix:Ii,add:Ti,remove:Fi}=On;function ra(s,c,d){var p,_;typeof s=="function"?(p=c||[],_=d):(p=[],_=c);var k=We.useRef({hasResult:!1,result:_,error:null}),N=We.useReducer(function(q){return q+1},0);N[0];var S=N[1],L=We.useMemo(function(){var q=typeof s=="function"?s():s;if(!q||typeof q.subscribe!="function")throw s===q?new TypeError("Given argument to useObservable() was neither a valid observable nor a function."):new TypeError("Observable factory given to useObservable() did not return a valid observable.");if(!k.current.hasResult&&typeof window<"u"&&(typeof q.hasValue!="function"||q.hasValue()))if(typeof q.getValue=="function")k.current.result=q.getValue(),k.current.hasResult=!0;else{var E=q.subscribe(function(I){k.current.result=I,k.current.hasResult=!0});typeof E=="function"?E():E.unsubscribe()}return q},p);if(We.useDebugValue(k.current.result),We.useEffect(function(){var q=L.subscribe(function(E){var I=k.current;(I.error!==null||I.result!==E)&&(I.error=null,I.result=E,I.hasResult=!0,S())},function(E){var I=k.current;I.error!==E&&(I.error=E,S())});return typeof q=="function"?q:q.unsubscribe.bind(q)},p),k.current.error)throw k.current.error;return k.current.result}function ro(s,c,d){return ra(function(){return na(s)},c||[],d)}const br=s=>s>=200&&s<300?"bg-green-200 text-green-800":s>=300&&s<400?"bg-blue-200 text-blue-800":s>=400&&s<500?"bg-orange-600 text-orange-200":s>=500?"bg-red-800 text-red-100":"bg-gray-200 text-gray-800",ho=s=>{if(!s)return"";switch(s.toUpperCase()){case"GET":return"text-[rgb(0,107,230)]";case"POST":return"text-[rgb(23,131,135)]";case"PATCH":return"text-[rgb(204,75,0)]";case"DELETE":return"text-red-700";default:return""}},oa=s=>{if(s)return" border border-slate-500";switch(s.toUpperCase()){case"GET":return"text-green-700 border border-green-700";case"POST":return"text-sky-700 border border-sky-700";case"PUT":return"text-fuchsia-700 border border-fuchsia-700";case"PATCH":return"text-purple-700 border border-purple-700";case"DELETE":return"text-red-700 border border-red-700";case"OPTIONS":return"text-rose-700 border border-rose-700";case"HEAD":return"text-pink-700 border border-pink-700";default:return"text-gray-700 border border-gray-700"}},aa=["bg-blue-100","border-blue-700"].join(" "),ia="border-l-4",sa=({operation:s,opId:c,onSelect:d,onRemove:p,selected:_})=>{var k,N,S,L,q,E;const I=X=>{d(X)},J=X=>{const H=new Date(X),G=String(H.getHours()).padStart(2,"0"),W=String(H.getMinutes()).padStart(2,"0"),de=String(H.getSeconds()).padStart(2,"0");return`${G}:${W}:${de}`};return i.jsx("li",{className:`flex items-center cursor-pointer hover:bg-gray-200 ${ia} ${_?aa:"border-transparent"}`,onClick:()=>{I(s)},children:i.jsxs("div",{className:"flex items-center p-2 w-full",children:[i.jsx("div",{className:"w-16 flex justify-center",children:i.jsx("span",{className:`inline-flex px-3 py-1 text-xs font-semibold rounded-full ${br((k=s?.response)==null?void 0:k.status)}`,children:((N=s?.response)==null?void 0:N.status)||"N/A"})}),i.jsx("div",{className:`w-20 text-center font-medium ${ho((S=s?.request)==null?void 0:S.method)}`,children:((L=s?.request)==null?void 0:L.method)||"GET"}),i.jsx("div",{className:"flex-grow truncate text-left",children:s?.request.path||s?.request.url}),i.jsx("div",{className:"w-20 text-gray-900 text-center text-xs",children:(q=s?.request)!=null&&q.timestamp?J(s.request.timestamp):"N/A"}),i.jsxs("div",{className:"w-16 text-gray-500 text-center text-xs",children:[(E=s?.timing)==null?void 0:E.duration,"ms"]}),i.jsx("button",{className:"w-8 h-8 flex items-center justify-center cursor-pointer text-red-500 hover:text-red-700",onClick:X=>{X.stopPropagation(),p(c)},children:"✕"})]})})},oo=({options:s,selected:c,onChange:d,placeholder:p="Add option...",colorFn:_})=>{const[k,N]=D.useState(""),[S,L]=D.useState(!1),[q,E]=D.useState(0),I=D.useRef(null),J=s.filter(W=>W.toLowerCase().includes(k.toLowerCase())&&!c.includes(W));D.useEffect(()=>{E(0)},[k,c]);const X=W=>{c.includes(W)||d([...c,W]),N("")},H=W=>{d(c.filter(de=>de!==W))},G=W=>{W.key==="ArrowDown"?(W.preventDefault(),E(de=>de+1<J.length?de+1:de)):W.key==="ArrowUp"?(W.preventDefault(),E(de=>de-1>=0?de-1:0)):W.key==="Enter"?(console.log("enter",q),W.preventDefault(),J.length>0&&X(J[q])):W.key==="Backspace"&&!k&&c.length>0&&H(c[c.length-1])};return i.jsxs("div",{className:"w-full max-w-md relative",children:[i.jsxs("div",{className:"flex flex-wrap items-center border border-gray-300 rounded-md shadow-sm px-2 py-1",children:[c.map(W=>i.jsxs("div",{className:`flex items-center rounded-full px-2 py-1 mr-2 my-1 text-xs ${_?_(W):"bg-indigo-100 text-indigo-700"}`,children:[i.jsx("span",{children:W}),i.jsx("button",{type:"button",onClick:()=>H(W),className:"ml-1 focus:outline-none cursor-pointer","aria-label":`Remove ${W}`,children:i.jsx("svg",{className:"w-3 h-3",fill:"currentColor",viewBox:"0 0 20 20",children:i.jsx("path",{fillRule:"evenodd",d:`M4.293 4.293a1 1 0 011.414 0L10 8.586l4.293-4.293a1 1 0 111.414
|
|
12
|
+
1.414L11.414 10l4.293 4.293a1 1 0 01-1.414 1.414L10 11.414l-4.293
|
|
13
|
+
4.293a1 1 0 01-1.414-1.414L8.586 10 4.293 5.707a1 1 0 010-1.414z`,clipRule:"evenodd"})})})]},W)),i.jsx("input",{ref:I,type:"text",className:"flex-grow outline-none p-1",placeholder:c.length>0?"":p,value:k,onChange:W=>N(W.target.value),onKeyDown:G,onFocus:()=>L(!0),onBlur:()=>setTimeout(()=>L(!1),100)})]}),S&&J.length>0&&i.jsx("ul",{className:"absolute left-0 right-0 border border-gray-300 mt-1 rounded-md shadow-lg bg-white max-h-40 overflow-y-auto z-10",children:J.map((W,de)=>i.jsx("li",{className:`cursor-pointer px-2 py-1 hover:bg-indigo-100 ${de===q?"bg-indigo-200":""}`,onMouseEnter:()=>E(de),onMouseDown:()=>X(W),children:W},W))})]})},ua=({isOpen:s,onClose:c,sortField:d,sortDirection:p,filters:_,setSortField:k,setSortDirection:N,setFilters:S})=>{const L=()=>{k("time"),N("desc")},q=()=>{S({})},E=H=>{const G=H.target.value;S(W=>({...W,timestampRange:G,customStart:void 0,customEnd:void 0}))},I=(H,G)=>{S(W=>({...W,timestampRange:{...typeof W.timestampRange=="object"&&W.timestampRange||{},[H]:G}}))},J=["GET","POST","PUT","PATCH","DELETE","OPTIONS","HEAD"],X=["200","201","204","301","302","400","401","403","404","500","502","503"];return i.jsxs(i.Fragment,{children:[s&&i.jsx("div",{className:"fixed inset-0 bg-black opacity-50",style:{zIndex:9998},onClick:c}),i.jsxs("div",{className:`fixed top-0 left-0 h-full w-100 bg-white shadow-xl transform transition-transform duration-300
|
|
14
|
+
${s?"translate-x-0":"-translate-x-full"}
|
|
15
|
+
`,style:{zIndex:9999},children:[i.jsxs("div",{className:"flex items-center justify-between px-4 py-3 border-b border-gray-300 bg-gray-50",children:[i.jsx("h2",{className:"pl-4 text-lg font-semibold text-gray-800",children:"Filter & Sort"}),i.jsx("button",{onClick:c,className:"text-gray-600 hover:text-gray-800 focus:outline-none cursor-pointer","aria-label":"Close",children:"×"})]}),i.jsxs("div",{className:"p-4 overflow-y-auto h-full",children:[i.jsxs("section",{className:"mb-6 ml-4 mr-4",children:[i.jsxs("div",{className:"flex items-center justify-between",children:[i.jsx("h3",{className:"mb-3 text-xs font-bold text-gray-600 uppercase tracking-wide",children:"Sort By"}),i.jsx("button",{onClick:L,className:"text-xs text-blue-600 hover:underline cursor-pointer",children:"Reset"})]}),i.jsxs("div",{className:"space-y-3",children:[i.jsxs("label",{className:"flex items-center",children:[i.jsx("input",{type:"radio",name:"sortField",value:"time",checked:d==="time",onChange:H=>k(H.target.value),className:"form-radio text-blue-600"}),i.jsx("span",{className:"ml-3 text-gray-700",children:"Timestamp"})]}),i.jsxs("label",{className:"flex items-center",children:[i.jsx("input",{type:"radio",name:"sortField",value:"statusCode",checked:d==="statusCode",onChange:H=>k(H.target.value),className:"form-radio text-blue-600"}),i.jsx("span",{className:"ml-3 text-gray-700",children:"Status"})]}),i.jsxs("label",{className:"flex items-center",children:[i.jsx("input",{type:"radio",name:"sortField",value:"method",checked:d==="method",onChange:H=>k(H.target.value),className:"form-radio text-blue-600"}),i.jsx("span",{className:"ml-3 text-gray-700",children:"Method"})]})]}),i.jsxs("div",{className:"mt-4",children:[i.jsx("h4",{className:"mb-2 text-xs font-bold text-gray-600 uppercase tracking-wide",children:"Sort Direction"}),i.jsxs("div",{className:"space-y-3",children:[i.jsxs("label",{className:"flex items-center",children:[i.jsx("input",{type:"radio",name:"sortDirection",value:"asc",checked:p==="asc",onChange:H=>N(H.target.value),className:"form-radio text-blue-600"}),i.jsx("span",{className:"ml-3 text-gray-700",children:"Ascending"})]}),i.jsxs("label",{className:"flex items-center",children:[i.jsx("input",{type:"radio",name:"sortDirection",value:"desc",checked:p==="desc",onChange:H=>N(H.target.value),className:"form-radio text-blue-600"}),i.jsx("span",{className:"ml-3 text-gray-700",children:"Descending"})]})]})]})]}),i.jsxs("section",{className:"mb-6 ml-4 mr-4",children:[i.jsxs("div",{className:"flex items-center justify-between",children:[i.jsx("h3",{className:"mb-3 text-xs font-bold text-gray-600 uppercase tracking-wide",children:"Filters"}),i.jsx("button",{onClick:q,className:"text-xs text-blue-600 hover:underline cursor-pointer",children:"Reset"})]}),i.jsxs("div",{className:"space-y-4",children:[i.jsxs("div",{children:[i.jsx("label",{className:"block text-sm font-medium text-gray-700 mb-1",children:"Quick Time Range"}),i.jsxs("select",{value:typeof _.timestampRange=="string"?_.timestampRange:"",onChange:E,className:"block w-full border border-gray-300 rounded-md shadow-sm py-2 px-3 focus:ring-blue-500 focus:border-blue-500 sm:text-sm",children:[i.jsx("option",{value:"",children:"Any"}),i.jsx("option",{value:"5M",children:"Last 5 minutes"}),i.jsx("option",{value:"15M",children:"Last 15 minutes"}),i.jsx("option",{value:"30M",children:"Last 30 minutes"}),i.jsx("option",{value:"1H",children:"Last 1 hour"}),i.jsx("option",{value:"3H",children:"Last 3 hours"}),i.jsx("option",{value:"6H",children:"Last 6 hours"}),i.jsx("option",{value:"12H",children:"Last 12 hours"}),i.jsx("option",{value:"24H",children:"Last 24 hours"}),i.jsx("option",{value:"48H",children:"Last 48 hours"}),i.jsx("option",{value:"week",children:"Last Week"}),i.jsx("option",{value:"month",children:"Last Month"})]})]}),i.jsxs("div",{children:[i.jsx("label",{className:"block text-sm font-medium text-gray-700 mb-1",children:"Specific Time Range"}),i.jsxs("div",{className:"flex space-x-2",children:[i.jsx("input",{type:"datetime-local",value:typeof _.timestampRange=="object"&&_.timestampRange.start?_.timestampRange.start:"",onChange:H=>I("start",H.target.value),className:"w-1/2 border border-gray-300 rounded-md shadow-sm py-2 px-3 focus:ring-blue-500 focus:border-blue-500 sm:text-sm"}),i.jsx("input",{type:"datetime-local",value:typeof _.timestampRange=="object"&&_.timestampRange.end?_.timestampRange.end:"",onChange:H=>I("end",H.target.value),className:"w-1/2 border border-gray-300 rounded-md shadow-sm py-2 px-3 focus:ring-blue-500 focus:border-blue-500 sm:text-sm"})]})]}),i.jsxs("div",{children:[i.jsx("label",{className:"block text-sm font-medium text-gray-700 mb-1",children:"Status"}),i.jsx(oo,{options:X,selected:_.status||[],onChange:H=>S(G=>({...G,status:H})),placeholder:"Add status code...",colorFn:br})]}),i.jsxs("div",{children:[i.jsx("label",{className:"block text-sm font-medium text-gray-700 mb-1",children:"Method"}),i.jsx(oo,{options:J,selected:_.method||[],onChange:H=>S(G=>({...G,method:H})),placeholder:"Add method...",colorFn:oa})]}),i.jsxs("div",{children:[i.jsx("label",{className:"block text-sm font-medium text-gray-700 mb-1",children:"Path"}),i.jsx("input",{type:"text",placeholder:"e.g. /api/users",value:_.path||"",onChange:H=>S(G=>({...G,path:H.target.value})),className:"block w-full border border-gray-300 rounded-md shadow-sm py-2 px-3 focus:ring-blue-500 focus:border-blue-500 sm:text-sm"})]}),i.jsxs("div",{children:[i.jsx("label",{className:"block text-sm font-medium text-gray-700 mb-1",children:"Duration (ms)"}),i.jsxs("div",{className:"flex space-x-2",children:[i.jsx("input",{type:"number",placeholder:"Min",value:_.durationMin||"",onChange:H=>S(G=>({...G,durationMin:H.target.value})),className:"w-1/2 border border-gray-300 rounded-md shadow-sm py-2 px-3 focus:ring-blue-500 focus:border-blue-500 sm:text-sm"}),i.jsx("input",{type:"number",placeholder:"Max",value:_.durationMax||"",onChange:H=>S(G=>({...G,durationMax:H.target.value})),className:"w-1/2 border border-gray-300 rounded-md shadow-sm py-2 px-3 focus:ring-blue-500 focus:border-blue-500 sm:text-sm"})]})]}),i.jsxs("div",{children:[i.jsx("label",{className:"block text-sm font-medium text-gray-700 mb-1",children:"Host"}),i.jsx("input",{type:"text",placeholder:"e.g. localhost",value:_.host||"",onChange:H=>S(G=>({...G,host:H.target.value})),className:"block w-full border border-gray-300 rounded-md shadow-sm py-2 px-3 focus:ring-blue-500 focus:border-blue-500 sm:text-sm"})]})]})]})]})]})]})},la=({currentPage:s,totalPages:c,onPageChange:d})=>{const p=((_,k)=>{const N=[];if(k<=7)for(let S=1;S<=k;S++)N.push(S);else if(_<=4){for(let S=1;S<=5;S++)N.push(S);N.push("ellipsis"),N.push(k)}else if(_>=k-3){N.push(1),N.push("ellipsis");for(let S=k-4;S<=k;S++)N.push(S)}else N.push(1),N.push("ellipsis"),N.push(_-1),N.push(_),N.push(_+1),N.push("ellipsis"),N.push(k);return N})(s,c);return i.jsx("nav",{className:"p-2 border-t border-gray-300",children:i.jsxs("ul",{className:"flex items-center justify-center -space-x-px h-8 text-sm",children:[i.jsx("li",{children:i.jsxs("button",{onClick:()=>d(s-1),disabled:s<=1,className:"flex items-center justify-center px-3 h-8 leading-tight text-gray-500 bg-white border border-e-0 border-gray-300 rounded-s-lg hover:bg-gray-100 hover:text-gray-700 disabled:opacity-50 dark:bg-gray-800 dark:border-gray-700 dark:text-gray-400 dark:hover:bg-gray-700 dark:hover:text-white cursor-pointer",children:[i.jsx("span",{className:"sr-only",children:"Previous"}),i.jsx("svg",{className:"w-2.5 h-2.5 rtl:rotate-180","aria-hidden":"true",xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 6 10",children:i.jsx("path",{stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"M5 1 1 5l4 4"})})]})}),p.map((_,k)=>{if(_==="ellipsis")return i.jsx("li",{children:i.jsx("span",{className:"flex items-center justify-center px-3 h-8 leading-tight text-gray-500 bg-white border border-gray-300 cursor-pointer",children:"..."})},`ellipsis-${k}`);const N=_===s;return i.jsx("li",{children:i.jsx("button",{onClick:()=>d(_),className:N?"z-10 flex items-center justify-center px-3 h-8 leading-tight text-blue-600 border border-blue-300 bg-blue-50 hover:bg-blue-100 hover:text-blue-700 dark:border-gray-700 dark:bg-gray-700 dark:text-white cursor-pointer":"flex items-center justify-center px-3 h-8 leading-tight text-gray-500 bg-white border border-gray-300 hover:bg-gray-100 hover:text-gray-700 dark:bg-gray-800 dark:border-gray-700 dark:text-gray-400 dark:hover:bg-gray-700 dark:hover:text-white cursor-pointer",children:_})},_)}),i.jsx("li",{children:i.jsxs("button",{onClick:()=>d(s+1),disabled:s>=c,className:"flex items-center justify-center px-3 h-8 leading-tight text-gray-500 bg-white border border-gray-300 rounded-e-lg hover:bg-gray-100 hover:text-gray-700 disabled:opacity-50 dark:bg-gray-800 dark:border-gray-700 dark:text-gray-400 dark:hover:bg-gray-700 dark:hover:text-white cursor-pointer",children:[i.jsx("span",{className:"sr-only",children:"Next"}),i.jsx("svg",{className:"w-2.5 h-2.5 rtl:rotate-180","aria-hidden":"true",xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 6 10",children:i.jsx("path",{stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"m1 9 4-4-4-4"})})]})})]})})},ca=({open:s,onClose:c,onConfirmAll:d,onConfirmFiltered:p,hasFilters:_})=>s?i.jsxs("div",{className:"fixed inset-0 z-50 flex items-center justify-center",children:[i.jsx("div",{className:"absolute inset-0 bg-black opacity-50",onClick:c}),i.jsxs("div",{className:"relative bg-white rounded-lg shadow-xl max-w-md w-full mx-4 p-6 z-10",children:[i.jsxs("div",{className:"flex items-center",children:[i.jsx("div",{className:"flex-shrink-0 bg-red-100 rounded-full p-2",children:i.jsx("svg",{className:"size-6 text-red-600",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor","aria-hidden":"true","data-slot":"icon",children:i.jsx("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M12 9v3.75m-9.303 3.376c-.866 1.5.217 3.374 1.948 3.374h14.71c1.73 0 2.813-1.874 1.948-3.374L13.949 3.378c-.866-1.5-3.032-1.5-3.898 0L2.697 16.126ZM12 15.75h.007v.008H12v-.008Z"})})}),i.jsxs("div",{className:"ml-4",children:[i.jsx("h3",{className:"text-lg font-medium text-gray-900",children:_?"Clear Requests":"Clear All Requests"}),i.jsx("p",{className:"mt-2 text-sm text-gray-500",children:_?"You have active filters. Would you like to clear only the filtered requests or all requests?":"Are you sure you want to clear all requests? This action cannot be undone."})]})]}),i.jsxs("div",{className:"mt-6 flex justify-end space-x-3",children:[i.jsx("button",{onClick:c,className:"px-4 py-2 bg-gray-200 rounded hover:bg-gray-300 text-sm",children:"Cancel"}),_&&i.jsx("button",{onClick:()=>{p(),c()},className:"px-4 py-2 bg-yellow-500 text-white rounded hover:bg-yellow-600 text-sm",children:"Clear Filtered"}),i.jsx("button",{onClick:()=>{d(),c()},className:"px-4 py-2 bg-red-600 text-white rounded hover:bg-red-700 text-sm",children:"Clear All"})]})]})]}):null,da=({text:s,align:c="center"})=>c==="left"?i.jsxs("div",{className:"flex items-center my-1",children:[i.jsx("span",{className:"px-3 text-xs text-slate-600",children:s}),i.jsx("div",{className:"flex-grow border-t border-gray-300"})]}):c==="right"?i.jsxs("div",{className:"flex items-center my-1",children:[i.jsx("div",{className:"flex-grow border-t border-gray-300"}),i.jsx("span",{className:"px-3 text-xs text-slate-600",children:s})]}):i.jsxs("div",{className:"flex items-center my-1",children:[i.jsx("div",{className:"flex-grow border-t border-gray-300"}),i.jsx("span",{className:"px-3 text-xs text-slate-600",children:s}),i.jsx("div",{className:"flex-grow border-t border-gray-300"})]}),fa=({operations:s,onSelect:c,onRemove:d,clearOperations:p,clearFilteredRequests:_,selectedOperation:k,currentPage:N,totalPages:S,totalCount:L,onPageChange:q,sortField:E,sortDirection:I,filters:J,setSortField:X,setSortDirection:H,setFilters:G})=>{const[W,de]=D.useState(!1),[Y,ve]=D.useState(!1),je=Object.entries(J||{}).reduce((be,[ue,Z])=>ue==="timestampRange"&&typeof Z=="object"?Z.start||Z.end?be+1:be:Z?be+1:be,0),me=je>0?"bg-green-500 text-white":"bg-blue-500 text-white",ie=be=>{const ue=new Date(be),Z=String(ue.getDate()).padStart(2,"0"),ge=String(ue.getMonth()+1).padStart(2,"0");return`${ue.getFullYear()}-${ge}-${Z}`},ne=(be=>be.reduce((ue,Z)=>{const ge=Z.request.timestamp?ie(Z.request.timestamp):"N/A";return ue[ge]||(ue[ge]=[]),ue[ge].push(Z),ue},{}))(s);return i.jsxs("div",{className:"flex flex-col h-full relative",children:[i.jsxs("div",{className:"p-4 flex justify-between items-center",children:[i.jsxs("span",{className:"font-bold text-xl",children:["Requests (",s.length," of ",L,")"]}),i.jsxs("div",{className:"space-x-2 relative",children:[i.jsxs("button",{className:`relative px-3 py-1 rounded text-xs cursor-pointer ${me}`,onClick:()=>de(!0),children:[i.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:"1.5",stroke:"currentColor",className:"w-4 h-4 text-white",children:i.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M12 3c2.755 0 5.455.232 8.083.678.533.09.917.556.917 1.096v1.044a2.25 2.25 0 0 1-.659 1.591l-5.432 5.432a2.25 2.25 0 0 0-.659 1.591v2.927a2.25 2.25 0 0 1-1.244 2.013L9.75 21v-6.568a2.25 2.25 0 0 0-.659-1.591L3.659 7.409A2.25 2.25 0 0 1 3 5.818V4.774c0-.54.384-1.006.917-1.096A48.32 48.32 0 0 1 12 3Z"})}),je>0&&i.jsx("span",{className:"absolute -top-1 -right-1 bg-green-700 text-white text-[10px] font-bold w-4 h-4 flex items-center justify-center rounded-full",children:je})]}),i.jsx("button",{className:"px-3 py-1 bg-red-500 text-white rounded text-xs cursor-pointer",onClick:()=>ve(!0),children:i.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:"1.5",stroke:"currentColor",className:"w-4 h-4 text-white",children:i.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"m14.74 9-.346 9m-4.788 0L9.26 9m9.968-3.21c.342.052.682.107 1.022.166m-1.022-.165L18.16 19.673a2.25 2.25 0 0 1-2.244 2.077H8.084a2.25 2.25 0 0 1-2.244-2.077L4.772 5.79m14.456 0a48.108 48.108 0 0 0-3.478-.397m-12 .562c.34-.059.68-.114 1.022-.165m0 0a48.11 48.11 0 0 1 3.478-.397m7.5 0v-.916c0-1.18-.91-2.164-2.09-2.201a51.964 51.964 0 0 0-3.32 0c-1.18.037-2.09 1.022-2.09 2.201v.916m7.5 0a48.667 48.667 0 0 0-7.5 0"})})})]})]}),i.jsxs("div",{className:"flex items-center bg-gray-200 p-2 border-b border-gray-300 text-sm font-bold cursor-pointer",onClick:()=>de(!0),children:[i.jsx("div",{className:"w-16 text-center",children:"Status"}),i.jsx("div",{className:"w-20 text-center",children:"Method"}),i.jsx("div",{className:"flex-grow text-left",children:"Path"}),i.jsx("div",{className:"w-20 text-center",children:"Timestamp"}),i.jsx("div",{className:"w-16 text-right",children:"Duration"}),i.jsx("div",{className:"w-10"})]}),i.jsx("ul",{className:"overflow-y-auto flex-grow",style:{maxHeight:"calc(100vh - 40px - 100px - 49px)"},children:s.length===0?i.jsx("li",{className:"flex items-center justify-center h-full text-gray-500 text-2xl",children:"No operations"}):Object.entries(ne).map(([be,ue])=>i.jsxs(We.Fragment,{children:[i.jsx("li",{children:i.jsx(da,{text:be,align:"center"})}),ue.map((Z,ge)=>{const xe=Z.id||ge;return i.jsx(sa,{opId:xe,operation:Z,onSelect:c,onRemove:d,selected:k&&k.id===xe},xe)})]},be))}),i.jsx(la,{currentPage:N,totalPages:S,onPageChange:q}),i.jsx(ua,{isOpen:W,onClose:()=>de(!1),sortField:E,sortDirection:I,filters:J,setSortField:X,setSortDirection:H,setFilters:G}),i.jsx(ca,{open:Y,onClose:()=>ve(!1),onConfirmAll:p,onConfirmFiltered:_,hasFilters:je>0})]})},Nn=({message:s,subMessage:c,onClose:d,type:p="success"})=>{const[_,k]=D.useState(3e3),[N,S]=D.useState(!1);D.useEffect(()=>{const X=setInterval(()=>{N||k(H=>H<=50?(clearInterval(X),d(),0):H-50)},50);return()=>clearInterval(X)},[N,d]);const L=_/3e3*100,q=p==="error"?"border-red-500":"border-green-500",E=p==="error"?"text-red-500":"text-green-500",I=p==="error"?"bg-red-500":"bg-green-500",J=p==="error"?"M12 9v2m0 4h.01M21 12a9 9 0 1 1-18 0 9 9 0 0 1 18 0Z":"M9 12.75L11.25 15L15 9.75M21 12a9 9 0 1 1-18 0 9 9 0 0 1 18 0Z";return i.jsx("div",{className:"fixed top-4 right-4 z-50 w-80",onMouseEnter:()=>S(!0),onMouseLeave:()=>S(!1),children:i.jsx("div",{className:`bg-white border-l-4 ${q} p-2 shadow-lg rounded-lg`,children:i.jsxs("div",{className:"flex items-start",children:[i.jsx("div",{className:"flex-shrink-0",children:i.jsx("svg",{className:`h-6 w-6 ${E}`,fill:"none",viewBox:"0 0 24 24",strokeWidth:"1.5",stroke:"currentColor",children:i.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:J})})}),i.jsxs("div",{className:"ml-1 flex-1",children:[i.jsx("p",{className:"text-sm font-medium text-gray-900",children:s}),c&&i.jsx("p",{className:"mt-1 text-sm text-gray-500 break-words",children:c}),i.jsx("div",{className:`w-full h-1 rounded-t-lg ${I}`,style:{width:`${L}%`}})]}),i.jsx("div",{className:"ml-auto pl-1",children:i.jsxs("button",{onClick:d,className:`text-gray-400 hover:text-gray-500 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-${p==="error"?"red":"green"}-500`,children:[i.jsx("span",{className:"sr-only",children:"Close"}),i.jsx("svg",{className:"h-5 w-5",fill:"currentColor",viewBox:"0 0 20 20",children:i.jsx("path",{fillRule:"evenodd",d:"M4.293 4.293a1 1 0 0 1 1.414 0L10 8.586l4.293-4.293a1 1 0 1 1 1.414 1.414L11.414 10l4.293 4.293a1 1 0 0 1-1.414 1.414L10 11.414l-4.293 4.293a1 1 0 1 1-1.414-1.414L8.586 10 4.293 5.707a1 1 0 0 1 0-1.414z",clipRule:"evenodd"})})]})})]})})})},ha=({operation:s})=>{var c,d,p,_,k,N,S,L,q;const[E,I]=D.useState(!1),[J,X]=D.useState(!1),[H,G]=D.useState(!1),[W,de]=D.useState(!1),[Y,ve]=D.useState(!1),je=ge=>{if(!ge)return"N/A";const xe=new Date(ge),Oe=xe.toLocaleDateString("en-CA",{year:"numeric",month:"2-digit",day:"2-digit"}),Ne=xe.toLocaleTimeString([],{hour:"2-digit",minute:"2-digit",second:"2-digit",hour12:!1});return`${Oe} at ${Ne}`},me=()=>{if(!(s!=null&&s.request))return;const{request:ge}=s,{method:xe,url:Oe,headers:Ne,body:$}=ge;let ce=`curl -X ${xe} '${Oe}'`;return Ne&&Ne.forEach(Se=>{ce+=` -H '${Se.name}: ${Se.value}'`}),$&&(ce+=` --data '${$}'`),ce},ie=()=>{const ge=me();navigator.clipboard.writeText(ge).then(()=>{I(!0),setTimeout(()=>I(!1),2500)}).catch(xe=>{console.error("[Inspectr] Failed to copy cURL command:",xe),X(!0)})},ne=()=>{navigator.clipboard.writeText(s.request.url).then(()=>{G(!0)}).catch(ge=>{console.error("[Inspectr] Failed to copy URL:",ge)})},be=()=>{const{meta:ge,timing:xe,response:Oe,...Ne}=s;fetch("/api/replay",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(Ne)}).then($=>{if(!$.ok)throw new Error("Replay failed");return $.json()}).then(()=>{ve(!0),setTimeout(()=>ve(!1),2500)}).catch($=>{console.error("[Inspectr] Failed to replay request:",$),de(!0)})},ue="flex items-center space-x-2 px-2 py-1 border border-slate-600 text-slate-600 rounded focus:outline-none cursor-pointer transition-transform duration-150 ease-in-out active:scale-95 active:bg-slate-200 active:ring active:ring-slate-300",Z=()=>i.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",className:"h-4 w-4",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:i.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"M5 13l4 4L19 7"})});return i.jsxs("div",{className:"mb-4 p-4 bg-white border border-gray-300 rounded shadow relative",children:[i.jsxs("div",{className:"flex items-center justify-between mb-2",children:[i.jsx("h2",{className:"font-bold text-2xl",children:"Request Details"}),i.jsxs("div",{className:"flex space-x-2",children:[i.jsxs("button",{onClick:ie,className:ue,children:[E?i.jsx(Z,{}):i.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:"1.5",stroke:"currentColor",className:"h-4 w-4",children:i.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"m6.75 7.5 3 2.25-3 2.25m4.5 0h3m-9 8.25h13.5A2.25 2.25 0 0 0 21 18V6a2.25 2.25 0 0 0-2.25-2.25H5.25A2.25 2.25 0 0 0 3 6v12a2.25 2.25 0 0 0 2.25 2.25Z"})}),i.jsx("span",{className:"text-xs",children:E?"Copied cURL":"Copy as cURL"})]}),i.jsxs("button",{onClick:be,className:ue,children:[Y?i.jsx(Z,{}):i.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor",className:"h-4 w-4",children:i.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M16.023 9.348h4.992v-.001M2.985 19.644v-4.992m0 0h4.992m-4.993 0 3.181 3.183a8.25 8.25 0 0 0 13.803-3.7M4.031 9.865a8.25 8.25 0 0 1 13.803-3.7l3.181 3.182m0-4.991v4.99"})}),i.jsx("span",{className:"text-xs",children:Y?"Replayed":"Replay"})]})]})]}),i.jsxs("div",{className:"flex flex-col space-y-1",children:[i.jsxs("div",{className:"flex items-center space-x-2 font-mono text-lg",children:[i.jsx("span",{className:`font-bold ${ho((c=s?.request)==null?void 0:c.method)}`,children:(d=s?.request)==null?void 0:d.method}),i.jsx("span",{className:"text-blue-600",children:(p=s?.request)==null?void 0:p.path}),i.jsx("span",{className:`inline-flex px-3 py-1 text-xs font-semibold rounded-full ${br((_=s?.response)==null?void 0:_.status)}`,children:(k=s?.response)==null?void 0:k.status}),i.jsx("span",{className:"text-sm",children:(N=s?.response)==null?void 0:N.status_text})]}),i.jsxs("div",{className:"flex items-center text-gray-600",children:[i.jsx("span",{onClick:ne,className:"cursor-pointer",children:(S=s?.request)==null?void 0:S.url}),i.jsx("button",{onClick:ne,className:"cursor-pointer pl-1",children:i.jsx("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:"icon-xs",children:i.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M7 5C7 3.34315 8.34315 2 10 2H19C20.6569 2 22 3.34315 22 5V14C22 15.6569 20.6569 17 19 17H17V19C17 20.6569 15.6569 22 14 22H5C3.34315 22 2 20.6569 2 19V10C2 8.34315 3.34315 7 5 7H7V5ZM9 7H14C15.6569 7 17 8.34315 17 10V15H19C19.5523 15 20 14.5523 20 14V5C20 4.44772 19.5523 4 19 4H10C9.44772 4 9 4.44772 9 5V7ZM5 9C4.44772 9 4 9.44772 4 10V19C4 19.5523 4.44772 20 5 20H14C14.5523 20 15 19.5523 15 19V10C15 9.44772 14.5523 9 14 9H5Z",fill:"currentColor"})})})]}),i.jsxs("div",{className:"text-gray-500 text-xs",children:["Received on"," ",i.jsx("span",{className:"font-semibold",children:je((L=s?.request)==null?void 0:L.timestamp)})," • Took ",i.jsxs("span",{className:"font-semibold",children:[(q=s?.timing)==null?void 0:q.duration,"ms"]})," to respond"]})]}),J&&i.jsx(Nn,{message:"Failed to copy cURL command!",subMessage:"Please try again.",onClose:()=>X(!1)}),H&&i.jsx(Nn,{message:"URL copied!",subMessage:"The request URL has been copied to your clipboard.",onClose:()=>G(!1)}),W&&i.jsx(Nn,{message:"Replay failed!",subMessage:"Failed to replay the request. Please try again.",onClose:()=>de(!1)})]})};function pa(s,c,d){return c in s?Object.defineProperty(s,c,{value:d,enumerable:!0,configurable:!0,writable:!0}):s[c]=d,s}function ao(s,c){var d=Object.keys(s);if(Object.getOwnPropertySymbols){var p=Object.getOwnPropertySymbols(s);c&&(p=p.filter(function(_){return Object.getOwnPropertyDescriptor(s,_).enumerable})),d.push.apply(d,p)}return d}function io(s){for(var c=1;c<arguments.length;c++){var d=arguments[c]!=null?arguments[c]:{};c%2?ao(Object(d),!0).forEach(function(p){pa(s,p,d[p])}):Object.getOwnPropertyDescriptors?Object.defineProperties(s,Object.getOwnPropertyDescriptors(d)):ao(Object(d)).forEach(function(p){Object.defineProperty(s,p,Object.getOwnPropertyDescriptor(d,p))})}return s}function ma(s,c){if(s==null)return{};var d={},p=Object.keys(s),_,k;for(k=0;k<p.length;k++)_=p[k],!(c.indexOf(_)>=0)&&(d[_]=s[_]);return d}function ga(s,c){if(s==null)return{};var d=ma(s,c),p,_;if(Object.getOwnPropertySymbols){var k=Object.getOwnPropertySymbols(s);for(_=0;_<k.length;_++)p=k[_],!(c.indexOf(p)>=0)&&Object.prototype.propertyIsEnumerable.call(s,p)&&(d[p]=s[p])}return d}function ya(s,c){return va(s)||ba(s,c)||xa(s,c)||wa()}function va(s){if(Array.isArray(s))return s}function ba(s,c){if(!(typeof Symbol>"u"||!(Symbol.iterator in Object(s)))){var d=[],p=!0,_=!1,k=void 0;try{for(var N=s[Symbol.iterator](),S;!(p=(S=N.next()).done)&&(d.push(S.value),!(c&&d.length===c));p=!0);}catch(L){_=!0,k=L}finally{try{!p&&N.return!=null&&N.return()}finally{if(_)throw k}}return d}}function xa(s,c){if(s){if(typeof s=="string")return so(s,c);var d=Object.prototype.toString.call(s).slice(8,-1);if(d==="Object"&&s.constructor&&(d=s.constructor.name),d==="Map"||d==="Set")return Array.from(s);if(d==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(d))return so(s,c)}}function so(s,c){(c==null||c>s.length)&&(c=s.length);for(var d=0,p=new Array(c);d<c;d++)p[d]=s[d];return p}function wa(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
16
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function ja(s,c,d){return c in s?Object.defineProperty(s,c,{value:d,enumerable:!0,configurable:!0,writable:!0}):s[c]=d,s}function uo(s,c){var d=Object.keys(s);if(Object.getOwnPropertySymbols){var p=Object.getOwnPropertySymbols(s);c&&(p=p.filter(function(_){return Object.getOwnPropertyDescriptor(s,_).enumerable})),d.push.apply(d,p)}return d}function lo(s){for(var c=1;c<arguments.length;c++){var d=arguments[c]!=null?arguments[c]:{};c%2?uo(Object(d),!0).forEach(function(p){ja(s,p,d[p])}):Object.getOwnPropertyDescriptors?Object.defineProperties(s,Object.getOwnPropertyDescriptors(d)):uo(Object(d)).forEach(function(p){Object.defineProperty(s,p,Object.getOwnPropertyDescriptor(d,p))})}return s}function ka(){for(var s=arguments.length,c=new Array(s),d=0;d<s;d++)c[d]=arguments[d];return function(p){return c.reduceRight(function(_,k){return k(_)},p)}}function zt(s){return function c(){for(var d=this,p=arguments.length,_=new Array(p),k=0;k<p;k++)_[k]=arguments[k];return _.length>=s.length?s.apply(this,_):function(){for(var N=arguments.length,S=new Array(N),L=0;L<N;L++)S[L]=arguments[L];return c.apply(d,[].concat(_,S))}}}function Sn(s){return{}.toString.call(s).includes("Object")}function _a(s){return!Object.keys(s).length}function Wt(s){return typeof s=="function"}function Ca(s,c){return Object.prototype.hasOwnProperty.call(s,c)}function Aa(s,c){return Sn(c)||ct("changeType"),Object.keys(c).some(function(d){return!Ca(s,d)})&&ct("changeField"),c}function Na(s){Wt(s)||ct("selectorType")}function Oa(s){Wt(s)||Sn(s)||ct("handlerType"),Sn(s)&&Object.values(s).some(function(c){return!Wt(c)})&&ct("handlersType")}function Sa(s){s||ct("initialIsRequired"),Sn(s)||ct("initialType"),_a(s)&&ct("initialContent")}function Ea(s,c){throw new Error(s[c]||s.default)}var Pa={initialIsRequired:"initial state is required",initialType:"initial state should be an object",initialContent:"initial state shouldn't be an empty object",handlerType:"handler should be an object or a function",handlersType:"all handlers should be a functions",selectorType:"selector should be a function",changeType:"provided value of changes should be an object",changeField:'it seams you want to change a field in the state which is not specified in the "initial" state',default:"an unknown error accured in `state-local` package"},ct=zt(Ea)(Pa),Cn={changes:Aa,selector:Na,handler:Oa,initial:Sa};function Ra(s){var c=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};Cn.initial(s),Cn.handler(c);var d={current:s},p=zt(Ka)(d,c),_=zt(Da)(d),k=zt(Cn.changes)(s),N=zt(Ma)(d);function S(){var q=arguments.length>0&&arguments[0]!==void 0?arguments[0]:function(E){return E};return Cn.selector(q),q(d.current)}function L(q){ka(p,_,k,N)(q)}return[S,L]}function Ma(s,c){return Wt(c)?c(s.current):c}function Da(s,c){return s.current=lo(lo({},s.current),c),c}function Ka(s,c,d){return Wt(c)?c(s.current):Object.keys(d).forEach(function(p){var _;return(_=c[p])===null||_===void 0?void 0:_.call(c,s.current[p])}),d}var Ia={create:Ra},Ta={paths:{vs:"https://cdn.jsdelivr.net/npm/monaco-editor@0.52.2/min/vs"}};function Fa(s){return function c(){for(var d=this,p=arguments.length,_=new Array(p),k=0;k<p;k++)_[k]=arguments[k];return _.length>=s.length?s.apply(this,_):function(){for(var N=arguments.length,S=new Array(N),L=0;L<N;L++)S[L]=arguments[L];return c.apply(d,[].concat(_,S))}}}function qa(s){return{}.toString.call(s).includes("Object")}function Ba(s){return s||co("configIsRequired"),qa(s)||co("configType"),s.urls?(La(),{paths:{vs:s.urls.monacoBase}}):s}function La(){console.warn(po.deprecation)}function Ha(s,c){throw new Error(s[c]||s.default)}var po={configIsRequired:"the configuration object is required",configType:"the configuration object should be an object",default:"an unknown error accured in `@monaco-editor/loader` package",deprecation:`Deprecation warning!
|
|
17
|
+
You are using deprecated way of configuration.
|
|
18
|
+
|
|
19
|
+
Instead of using
|
|
20
|
+
monaco.config({ urls: { monacoBase: '...' } })
|
|
21
|
+
use
|
|
22
|
+
monaco.config({ paths: { vs: '...' } })
|
|
23
|
+
|
|
24
|
+
For more please check the link https://github.com/suren-atoyan/monaco-loader#config
|
|
25
|
+
`},co=Fa(Ha)(po),Qa={config:Ba},Va=function(){for(var s=arguments.length,c=new Array(s),d=0;d<s;d++)c[d]=arguments[d];return function(p){return c.reduceRight(function(_,k){return k(_)},p)}};function mo(s,c){return Object.keys(c).forEach(function(d){c[d]instanceof Object&&s[d]&&Object.assign(c[d],mo(s[d],c[d]))}),io(io({},s),c)}var za={type:"cancelation",msg:"operation is manually canceled"};function hr(s){var c=!1,d=new Promise(function(p,_){s.then(function(k){return c?_(za):p(k)}),s.catch(_)});return d.cancel=function(){return c=!0},d}var Ua=Ia.create({config:Ta,isInitialized:!1,resolve:null,reject:null,monaco:null}),go=ya(Ua,2),Jt=go[0],En=go[1];function Wa(s){var c=Qa.config(s),d=c.monaco,p=ga(c,["monaco"]);En(function(_){return{config:mo(_.config,p),monaco:d}})}function Ja(){var s=Jt(function(c){var d=c.monaco,p=c.isInitialized,_=c.resolve;return{monaco:d,isInitialized:p,resolve:_}});if(!s.isInitialized){if(En({isInitialized:!0}),s.monaco)return s.resolve(s.monaco),hr(pr);if(window.monaco&&window.monaco.editor)return yo(window.monaco),s.resolve(window.monaco),hr(pr);Va(Za,Ga)(Ya)}return hr(pr)}function Za(s){return document.body.appendChild(s)}function $a(s){var c=document.createElement("script");return s&&(c.src=s),c}function Ga(s){var c=Jt(function(p){var _=p.config,k=p.reject;return{config:_,reject:k}}),d=$a("".concat(c.config.paths.vs,"/loader.js"));return d.onload=function(){return s()},d.onerror=c.reject,d}function Ya(){var s=Jt(function(d){var p=d.config,_=d.resolve,k=d.reject;return{config:p,resolve:_,reject:k}}),c=window.require;c.config(s.config),c(["vs/editor/editor.main"],function(d){yo(d),s.resolve(d)},function(d){s.reject(d)})}function yo(s){Jt().monaco||En({monaco:s})}function Xa(){return Jt(function(s){var c=s.monaco;return c})}var pr=new Promise(function(s,c){return En({resolve:s,reject:c})}),vo={config:Wa,init:Ja,__getMonacoInstance:Xa},ei={wrapper:{display:"flex",position:"relative",textAlign:"initial"},fullWidth:{width:"100%"},hide:{display:"none"}},mr=ei,ti={container:{display:"flex",height:"100%",width:"100%",justifyContent:"center",alignItems:"center"}},ni=ti;function ri({children:s}){return We.createElement("div",{style:ni.container},s)}var oi=ri,ai=oi;function ii({width:s,height:c,isEditorReady:d,loading:p,_ref:_,className:k,wrapperProps:N}){return We.createElement("section",{style:{...mr.wrapper,width:s,height:c},...N},!d&&We.createElement(ai,null,p),We.createElement("div",{ref:_,style:{...mr.fullWidth,...!d&&mr.hide},className:k}))}var si=ii,bo=D.memo(si);function ui(s){D.useEffect(s,[])}var xo=ui;function li(s,c,d=!0){let p=D.useRef(!0);D.useEffect(p.current||!d?()=>{p.current=!1}:s,c)}var ze=li;function Ut(){}function Et(s,c,d,p){return ci(s,p)||di(s,c,d,p)}function ci(s,c){return s.editor.getModel(wo(s,c))}function di(s,c,d,p){return s.editor.createModel(c,d,p?wo(s,p):void 0)}function wo(s,c){return s.Uri.parse(c)}function fi({original:s,modified:c,language:d,originalLanguage:p,modifiedLanguage:_,originalModelPath:k,modifiedModelPath:N,keepCurrentOriginalModel:S=!1,keepCurrentModifiedModel:L=!1,theme:q="light",loading:E="Loading...",options:I={},height:J="100%",width:X="100%",className:H,wrapperProps:G={},beforeMount:W=Ut,onMount:de=Ut}){let[Y,ve]=D.useState(!1),[je,me]=D.useState(!0),ie=D.useRef(null),ne=D.useRef(null),be=D.useRef(null),ue=D.useRef(de),Z=D.useRef(W),ge=D.useRef(!1);xo(()=>{let $=vo.init();return $.then(ce=>(ne.current=ce)&&me(!1)).catch(ce=>ce?.type!=="cancelation"&&console.error("Monaco initialization: error:",ce)),()=>ie.current?Ne():$.cancel()}),ze(()=>{if(ie.current&&ne.current){let $=ie.current.getOriginalEditor(),ce=Et(ne.current,s||"",p||d||"text",k||"");ce!==$.getModel()&&$.setModel(ce)}},[k],Y),ze(()=>{if(ie.current&&ne.current){let $=ie.current.getModifiedEditor(),ce=Et(ne.current,c||"",_||d||"text",N||"");ce!==$.getModel()&&$.setModel(ce)}},[N],Y),ze(()=>{let $=ie.current.getModifiedEditor();$.getOption(ne.current.editor.EditorOption.readOnly)?$.setValue(c||""):c!==$.getValue()&&($.executeEdits("",[{range:$.getModel().getFullModelRange(),text:c||"",forceMoveMarkers:!0}]),$.pushUndoStop())},[c],Y),ze(()=>{var $,ce;(ce=($=ie.current)==null?void 0:$.getModel())==null||ce.original.setValue(s||"")},[s],Y),ze(()=>{let{original:$,modified:ce}=ie.current.getModel();ne.current.editor.setModelLanguage($,p||d||"text"),ne.current.editor.setModelLanguage(ce,_||d||"text")},[d,p,_],Y),ze(()=>{var $;($=ne.current)==null||$.editor.setTheme(q)},[q],Y),ze(()=>{var $;($=ie.current)==null||$.updateOptions(I)},[I],Y);let xe=D.useCallback(()=>{var $;if(!ne.current)return;Z.current(ne.current);let ce=Et(ne.current,s||"",p||d||"text",k||""),Se=Et(ne.current,c||"",_||d||"text",N||"");($=ie.current)==null||$.setModel({original:ce,modified:Se})},[d,c,_,s,p,k,N]),Oe=D.useCallback(()=>{var $;!ge.current&&be.current&&(ie.current=ne.current.editor.createDiffEditor(be.current,{automaticLayout:!0,...I}),xe(),($=ne.current)==null||$.editor.setTheme(q),ve(!0),ge.current=!0)},[I,q,xe]);D.useEffect(()=>{Y&&ue.current(ie.current,ne.current)},[Y]),D.useEffect(()=>{!je&&!Y&&Oe()},[je,Y,Oe]);function Ne(){var $,ce,Se,Ee;let Pe=($=ie.current)==null?void 0:$.getModel();S||(ce=Pe?.original)==null||ce.dispose(),L||(Se=Pe?.modified)==null||Se.dispose(),(Ee=ie.current)==null||Ee.dispose()}return We.createElement(bo,{width:X,height:J,isEditorReady:Y,loading:E,_ref:be,className:H,wrapperProps:G})}var hi=fi;D.memo(hi);function pi(s){let c=D.useRef();return D.useEffect(()=>{c.current=s},[s]),c.current}var mi=pi,An=new Map;function gi({defaultValue:s,defaultLanguage:c,defaultPath:d,value:p,language:_,path:k,theme:N="light",line:S,loading:L="Loading...",options:q={},overrideServices:E={},saveViewState:I=!0,keepCurrentModel:J=!1,width:X="100%",height:H="100%",className:G,wrapperProps:W={},beforeMount:de=Ut,onMount:Y=Ut,onChange:ve,onValidate:je=Ut}){let[me,ie]=D.useState(!1),[ne,be]=D.useState(!0),ue=D.useRef(null),Z=D.useRef(null),ge=D.useRef(null),xe=D.useRef(Y),Oe=D.useRef(de),Ne=D.useRef(),$=D.useRef(p),ce=mi(k),Se=D.useRef(!1),Ee=D.useRef(!1);xo(()=>{let re=vo.init();return re.then(ye=>(ue.current=ye)&&be(!1)).catch(ye=>ye?.type!=="cancelation"&&console.error("Monaco initialization: error:",ye)),()=>Z.current?Be():re.cancel()}),ze(()=>{var re,ye,_e,Je;let He=Et(ue.current,s||p||"",c||_||"",k||d||"");He!==((re=Z.current)==null?void 0:re.getModel())&&(I&&An.set(ce,(ye=Z.current)==null?void 0:ye.saveViewState()),(_e=Z.current)==null||_e.setModel(He),I&&((Je=Z.current)==null||Je.restoreViewState(An.get(k))))},[k],me),ze(()=>{var re;(re=Z.current)==null||re.updateOptions(q)},[q],me),ze(()=>{!Z.current||p===void 0||(Z.current.getOption(ue.current.editor.EditorOption.readOnly)?Z.current.setValue(p):p!==Z.current.getValue()&&(Ee.current=!0,Z.current.executeEdits("",[{range:Z.current.getModel().getFullModelRange(),text:p,forceMoveMarkers:!0}]),Z.current.pushUndoStop(),Ee.current=!1))},[p],me),ze(()=>{var re,ye;let _e=(re=Z.current)==null?void 0:re.getModel();_e&&_&&((ye=ue.current)==null||ye.editor.setModelLanguage(_e,_))},[_],me),ze(()=>{var re;S!==void 0&&((re=Z.current)==null||re.revealLine(S))},[S],me),ze(()=>{var re;(re=ue.current)==null||re.editor.setTheme(N)},[N],me);let Pe=D.useCallback(()=>{var re;if(!(!ge.current||!ue.current)&&!Se.current){Oe.current(ue.current);let ye=k||d,_e=Et(ue.current,p||s||"",c||_||"",ye||"");Z.current=(re=ue.current)==null?void 0:re.editor.create(ge.current,{model:_e,automaticLayout:!0,...q},E),I&&Z.current.restoreViewState(An.get(ye)),ue.current.editor.setTheme(N),S!==void 0&&Z.current.revealLine(S),ie(!0),Se.current=!0}},[s,c,d,p,_,k,q,E,I,N,S]);D.useEffect(()=>{me&&xe.current(Z.current,ue.current)},[me]),D.useEffect(()=>{!ne&&!me&&Pe()},[ne,me,Pe]),$.current=p,D.useEffect(()=>{var re,ye;me&&ve&&((re=Ne.current)==null||re.dispose(),Ne.current=(ye=Z.current)==null?void 0:ye.onDidChangeModelContent(_e=>{Ee.current||ve(Z.current.getValue(),_e)}))},[me,ve]),D.useEffect(()=>{if(me){let re=ue.current.editor.onDidChangeMarkers(ye=>{var _e;let Je=(_e=Z.current.getModel())==null?void 0:_e.uri;if(Je&&ye.find(He=>He.path===Je.path)){let He=ue.current.editor.getModelMarkers({resource:Je});je?.(He)}});return()=>{re?.dispose()}}return()=>{}},[me,je]);function Be(){var re,ye;(re=Ne.current)==null||re.dispose(),J?I&&An.set(k,Z.current.saveViewState()):(ye=Z.current.getModel())==null||ye.dispose(),Z.current.dispose()}return We.createElement(bo,{width:X,height:H,isEditorReady:me,loading:L,_ref:ge,className:G,wrapperProps:W})}var yi=gi,vi=D.memo(yi),jo=vi;const bi=({open:s,onClose:c,decoded:d})=>{var p,_,k;if(!s)return null;const N=()=>{const L=JSON.stringify(d,null,2);navigator.clipboard.writeText(L).then(()=>{}).catch(q=>{console.error("Failed to copy JWT:",q)})},S=L=>L?new Date(L*1e3).toLocaleString():"N/A";return i.jsxs("div",{className:"fixed inset-0 z-50 flex items-center justify-center",children:[i.jsx("div",{className:"absolute inset-0 bg-black opacity-50",onClick:c}),i.jsxs("div",{className:"relative bg-white rounded-lg shadow-xl max-w-lg w-full mx-4 p-6 z-10",children:[i.jsxs("div",{className:"flex items-center justify-between",children:[i.jsxs("div",{className:"flex items-center",children:[i.jsx("div",{className:"flex-shrink-0 bg-blue-100 rounded-full p-2",children:i.jsxs("svg",{className:"w-6 h-6",viewBox:"0 0 48 48",children:[i.jsx("polygon",{fill:"#546e7a",points:"21.906,31.772 24.507,29.048 27.107,31.772 27.107,43 21.906,43"}),i.jsx("polygon",{fill:"#f50057",points:"17.737,29.058 21.442,28.383 21.945,32.115 15.345,41.199 11.138,38.141"}),i.jsx("polygon",{fill:"#d500f9",points:"15.962,24.409 19.355,26.041 17.569,29.356 6.89,32.825 5.283,27.879"}),i.jsx("polygon",{fill:"#29b6f6",points:"17.256,19.607 19.042,22.922 15.649,24.554 4.97,21.084 6.577,16.137"}),i.jsx("polygon",{fill:"#00e5ff",points:"21.126,16.482 20.623,20.214 16.918,19.539 10.318,10.455 14.526,7.398"}),i.jsx("polygon",{fill:"#546e7a",points:"26.094,16.228 23.493,18.952 20.893,16.228 20.893,5 26.094,5"}),i.jsx("polygon",{fill:"#f50057",points:"30.262,18.943 26.558,19.618 26.055,15.886 32.654,6.802 36.862,9.859"}),i.jsx("polygon",{fill:"#d500f9",points:"32.039,23.59 28.645,21.958 30.431,18.643 41.11,15.174 42.717,20.12"}),i.jsx("polygon",{fill:"#29b6f6",points:"30.744,28.393 28.958,25.078 32.351,23.447 43.03,26.916 41.423,31.863"}),i.jsx("polygon",{fill:"#00e5ff",points:"26.874,31.518 27.378,27.786 31.082,28.461 37.682,37.545 33.474,40.602"})]})}),i.jsxs("div",{className:"ml-4",children:[i.jsx("h3",{className:"text-lg font-medium text-gray-900",children:"Decoded JWT"}),i.jsx("p",{className:"mt-1 text-sm text-gray-500",children:"Below is the decoded JWT information."})]})]}),i.jsx("button",{onClick:c,className:"text-gray-600 hover:text-gray-800 focus:outline-none cursor-pointer","aria-label":"Close",children:"×"})]}),i.jsxs("div",{className:"relative mt-4",children:[i.jsx("button",{onClick:N,className:"absolute top-2 right-2 z-10 cursor-pointer bg-gray-200 p-1 rounded hover:bg-gray-300",children:i.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 256 256",fill:"currentColor",className:"w-5 h-5",children:i.jsx("path",{d:"M48.186 92.137c0-8.392 6.49-14.89 16.264-14.89s29.827-.225 29.827-.225-.306-6.99-.306-15.88c0-8.888 7.954-14.96 17.49-14.96 9.538 0 56.786.401 61.422.401 4.636 0 8.397 1.719 13.594 5.67 5.196 3.953 13.052 10.56 16.942 14.962 3.89 4.402 5.532 6.972 5.532 10.604 0 3.633 0 76.856-.06 85.34-.059 8.485-7.877 14.757-17.134 14.881-9.257.124-29.135.124-29.135.124s.466 6.275.466 15.15-8.106 15.811-17.317 16.056c-9.21.245-71.944-.49-80.884-.245-8.94.245-16.975-6.794-16.975-15.422s.274-93.175.274-101.566zm16.734 3.946l-1.152 92.853a3.96 3.96 0 0 0 3.958 4.012l73.913.22a3.865 3.865 0 0 0 3.91-3.978l-.218-8.892a1.988 1.988 0 0 0-2.046-1.953s-21.866.64-31.767.293c-9.902-.348-16.672-6.807-16.675-15.516-.003-8.709.003-69.142.003-69.142a1.989 1.989 0 0 0-2.007-1.993l-23.871.082a4.077 4.077 0 0 0-4.048 4.014zm106.508-35.258c-1.666-1.45-3.016-.84-3.016 1.372v17.255c0 1.106.894 2.007 1.997 2.013l20.868.101c2.204.011 2.641-1.156.976-2.606l-20.825-18.135zm-57.606.847a2.002 2.002 0 0 0-2.02 1.988l-.626 96.291a2.968 2.968 0 0 0 2.978 2.997l75.2-.186a2.054 2.054 0 0 0 2.044-2.012l1.268-62.421a1.951 1.951 0 0 0-1.96-2.004s-26.172.042-30.783.042c-4.611 0-7.535-2.222-7.535-6.482S152.3 63.92 152.3 63.92a2.033 2.033 0 0 0-2.015-2.018l-36.464-.23z",stroke:"#979797",fillRule:"evenodd"})})}),i.jsx("pre",{className:"bg-gray-100 p-2 rounded text-xs text-gray-700 overflow-x-auto",children:JSON.stringify(d,null,2)}),d&&i.jsxs("div",{className:"mt-2 text-sm text-gray-600",children:[((p=d?.payload)==null?void 0:p.iat)&&i.jsxs("p",{children:["Issued At (iat): ",S(d.payload.iat)]}),((_=d?.payload)==null?void 0:_.nbf)&&i.jsxs("p",{children:["Not Before (nbf): ",S(d.payload.nbf)]}),((k=d?.payload)==null?void 0:k.exp)&&i.jsxs("p",{children:["Expires At (exp): ",S(d.payload.exp)]})]})]}),i.jsx("div",{className:"mt-6 flex justify-end",children:i.jsx("button",{onClick:c,className:"px-4 py-2 bg-gray-200 rounded hover:bg-gray-300 text-sm",children:"Close"})})]})]})},ko=({textToCopy:s,copiedTimeout:c=2500})=>{const[d,p]=D.useState(!1),_=()=>{navigator.clipboard.writeText(s).then(()=>{p(!0),setTimeout(()=>p(!1),c)}).catch(N=>{console.error("Failed to copy text:",N)})},k=()=>i.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",className:"h-4 w-4",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:i.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"M5 13l4 4L19 7"})});return i.jsx("div",{className:"flex items-center rounded px-2 font-sans text-xs text-token-text-secondary",children:i.jsx("span",{"data-state":d?"copied":"closed",children:i.jsxs("button",{onClick:_,className:"flex gap-1 items-center select-none px-4 py-1 cursor-pointer","aria-label":"Copy",children:[d?i.jsx(k,{}):i.jsx("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:"icon-xs",children:i.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M7 5C7 3.34315 8.34315 2 10 2H19C20.6569 2 22 3.34315 22 5V14C22 15.6569 20.6569 17 19 17H17V19C17 20.6569 15.6569 22 14 22H5C3.34315 22 2 20.6569 2 19V10C2 8.34315 3.34315 7 5 7H7V5ZM9 7H14C15.6569 7 17 8.34315 17 10V15H19C19.5523 15 20 14.5523 20 14V5C20 4.44772 19.5523 4 19 4H10C9.44772 4 9 4.44772 9 5V7ZM5 9C4.44772 9 4 9.44772 4 10V19C4 19.5523 4.44772 20 5 20H14C14.5523 20 15 19.5523 15 19V10C15 9.44772 14.5523 9 14 9H5Z",fill:"currentColor"})}),d?"Copied":"Copy"]})})})},fo=s=>{let c=s.replace(/-/g,"+").replace(/_/g,"/");for(;c.length%4;)c+="=";return c},xi=s=>{try{const c=s.split(".");if(c.length!==3)return null;const d=JSON.parse(atob(fo(c[0]))),p=JSON.parse(atob(fo(c[1])));return{header:d,payload:p,signature:c[2]}}catch(c){return console.error("Failed to decode JWT:",c),null}},wi=s=>typeof s!="string"?!1:((s.startsWith("Bearer ")||s.startsWith("bearer "))&&(s=s.slice(7).trim()),/^[A-Za-z0-9\-_]+\.[A-Za-z0-9\-_]+\.[A-Za-z0-9\-_]+$/.test(s)),ji=({operation:s})=>{var c,d,p,_;const[k,N]=D.useState(!1),[S,L]=D.useState(!1),[q,E]=D.useState(!1),[I,J]=D.useState(null),X=Y=>{const ve=Y.startsWith("Bearer ")||Y.startsWith("bearer ")?Y.slice(7).trim():Y,je=xi(ve);je&&(J(je),E(!0))},H=Y=>Y.map(ve=>i.jsxs("tr",{children:[i.jsx("td",{className:"border border-slate-200 px-2 py-1 font-mono text-slate-500 text-xs",children:ve.name}),i.jsx("td",{className:"border border-slate-200 px-2 py-1 font-mono text-xs",children:i.jsxs("div",{className:"flex flex-wrap items-center",children:[i.jsx("span",{className:"min-w-0 break-all flex-1",children:ve.value}),wi(ve.value)&&i.jsx("button",{onClick:()=>X(ve.value),className:"ml-2 p-1 text-blue-500 text-xs border border-slate-600 rounded cursor-pointer",children:i.jsxs("svg",{className:"w-4 h-4",viewBox:"0 0 48 48",children:[i.jsx("polygon",{fill:"#546e7a",points:"21.906,31.772 24.507,29.048 27.107,31.772 27.107,43 21.906,43"}),i.jsx("polygon",{fill:"#f50057",points:"17.737,29.058 21.442,28.383 21.945,32.115 15.345,41.199 11.138,38.141"}),i.jsx("polygon",{fill:"#d500f9",points:"15.962,24.409 19.355,26.041 17.569,29.356 6.89,32.825 5.283,27.879"}),i.jsx("polygon",{fill:"#29b6f6",points:"17.256,19.607 19.042,22.922 15.649,24.554 4.97,21.084 6.577,16.137"}),i.jsx("polygon",{fill:"#00e5ff",points:"21.126,16.482 20.623,20.214 16.918,19.539 10.318,10.455 14.526,7.398"}),i.jsx("polygon",{fill:"#546e7a",points:"26.094,16.228 23.493,18.952 20.893,16.228 20.893,5 26.094,5"}),i.jsx("polygon",{fill:"#f50057",points:"30.262,18.943 26.558,19.618 26.055,15.886 32.654,6.802 36.862,9.859"}),i.jsx("polygon",{fill:"#d500f9",points:"32.039,23.59 28.645,21.958 30.431,18.643 41.11,15.174 42.717,20.12"}),i.jsx("polygon",{fill:"#29b6f6",points:"30.744,28.393 28.958,25.078 32.351,23.447 43.03,26.916 41.423,31.863"}),i.jsx("polygon",{fill:"#00e5ff",points:"26.874,31.518 27.378,27.786 31.082,28.461 37.682,37.545 33.474,40.602"})]})})]})})]},ve.name)),G=s.request.body,W=!G||typeof G=="object"&&Object.keys(G).length===0||typeof G=="string"&&(G.trim()===""||G.trim()==="{}"),de=Y=>{try{const ve=JSON.parse(Y);return JSON.stringify(ve,null,2)}catch{return Y}};return i.jsxs("div",{children:[i.jsxs("div",{className:"mb-4",children:[i.jsxs("button",{className:"w-full p-2 text-left font-bold bg-gray-200 cursor-pointer",onClick:()=>N(!k),children:["Query Parameters (",(((c=s?.request)==null?void 0:c.query_params)??[]).length,")"]}),k&&i.jsx("div",{className:"p-0",children:i.jsxs("table",{className:"table-fixed w-full border-collapse border border-gray-300",children:[i.jsx("thead",{children:i.jsxs("tr",{className:"bg-gray-100",children:[i.jsx("th",{className:"border border-slate-200 px-2 py-1 w-1/4 text-left",children:"Key"}),i.jsx("th",{className:"border border-slate-200 px-2 py-1 text-left",children:"Value"})]})}),i.jsx("tbody",{children:H(((d=s?.request)==null?void 0:d.query_params)??[])})]})})]}),i.jsxs("div",{className:"mb-4",children:[i.jsxs("button",{className:"w-full p-2 text-left font-bold bg-gray-200 cursor-pointer",onClick:()=>L(!S),children:["Headers (",(((p=s?.request)==null?void 0:p.headers)??[]).length,")"]}),S&&i.jsx("div",{className:"p-0",children:i.jsxs("table",{className:"table-fixed w-full border-collapse border border-gray-300",children:[i.jsx("thead",{children:i.jsxs("tr",{className:"bg-gray-100",children:[i.jsx("th",{className:"border border-slate-200 px-2 py-1 w-1/4 text-left",children:"Header"}),i.jsx("th",{className:"border border-slate-200 px-2 py-1 text-left",children:"Value"})]})}),i.jsx("tbody",{children:H(((_=s?.request)==null?void 0:_.headers)??[])})]})})]}),i.jsxs("div",{children:[i.jsxs("div",{className:"flex justify-between items-center bg-gray-200",children:[i.jsx("button",{className:"p-2 text-left font-bold flex-grow",children:"Request Body"}),i.jsx(ko,{textToCopy:de(G)})]}),W?i.jsx("div",{className:"p-4 bg-white rounded-b shadow",children:"No payload"}):i.jsx("div",{className:"bg-white rounded-b shadow p-0 h-100",children:i.jsx(jo,{height:"100%",defaultLanguage:"json",value:de(G),options:{readOnly:!0,minimap:{enabled:!1},automaticLayout:!0,fontFamily:'"Cascadia Code", "Jetbrains Mono", "Fira Code", "Menlo", "Consolas", monospace',tabSize:2,scrollBeyondLastLine:!1}})})]}),i.jsx(bi,{open:q,decoded:I,onClose:()=>{E(!1),J(null)}})]})},ki=({operation:s})=>{var c,d;const[p,_]=D.useState(!1),k=q=>q.map(E=>i.jsxs("tr",{children:[i.jsx("td",{className:"border border-slate-200 px-2 py-1 font-mono text-slate-500 text-xs",children:E.name}),i.jsx("td",{className:"border border-slate-200 px-2 py-1 font-mono text-xs",children:i.jsx("div",{className:"flex flex-wrap items-center",children:i.jsx("span",{className:"min-w-0 break-all flex-1",children:E.value})})})]},E.name)),N=s.response.body,S=!N||typeof N=="object"&&Object.keys(N).length===0||typeof N=="string"&&(N.trim()===""||N.trim()==="{}"),L=q=>{try{const E=JSON.parse(q);return JSON.stringify(E,null,2)}catch{return q}};return i.jsxs("div",{children:[i.jsxs("div",{className:"mb-4",children:[i.jsxs("button",{className:"w-full p-2 text-left font-bold bg-gray-200 cursor-pointer",onClick:()=>_(!p),children:["Headers (",(((c=s?.response)==null?void 0:c.headers)??[]).length,")"]}),p&&i.jsx("div",{className:"p-0",children:i.jsxs("table",{className:"w-full border-collapse border border-gray-300",children:[i.jsx("thead",{children:i.jsxs("tr",{className:"bg-gray-100",children:[i.jsx("th",{className:"border border-slate-200 px-2 py-1 w-1/4 text-left",children:"Header"}),i.jsx("th",{className:"border border-slate-200 px-2 py-1 text-left",children:"Value"})]})}),i.jsx("tbody",{children:k(((d=s?.response)==null?void 0:d.headers)??[])})]})})]}),i.jsxs("div",{children:[i.jsxs("div",{className:"flex justify-between items-center bg-gray-200",children:[i.jsx("button",{className:"p-2 text-left font-bold flex-grow",children:"Response Body"}),i.jsx(ko,{textToCopy:L(N)})]}),S?i.jsx("div",{className:"p-4 bg-white rounded-b shadow",children:"No payload"}):i.jsx("div",{className:"bg-white rounded-b shadow p-0 h-100",children:i.jsx(jo,{height:"100%",defaultLanguage:"json",value:L(N),options:{readOnly:!0,minimap:{enabled:!1},automaticLayout:!0,fontFamily:'"Cascadia Code", "Jetbrains Mono", "Fira Code", "Menlo", "Consolas", monospace',tabSize:2,scrollBeyondLastLine:!1}})})]})]})},_i=({operation:s,currentTab:c,setCurrentTab:d})=>s?i.jsxs("div",{className:"flex flex-col h-full",children:[i.jsx(ha,{operation:s}),i.jsxs("div",{className:"flex space-x-2",children:[i.jsx("button",{className:`px-4 py-2 rounded-t ${c==="request"?"bg-blue-600 text-white":"bg-gray-200 text-gray-700"}`,onClick:()=>d("request"),children:"Request"}),i.jsx("button",{className:`px-4 py-2 rounded-t ${c==="response"?"bg-blue-600 text-white":"bg-gray-200 text-gray-700"}`,onClick:()=>d("response"),children:"Response"})]}),i.jsx("div",{className:"p-4 bg-white border border-gray-300 rounded-b shadow flex-grow overflow-y-auto",style:{maxHeight:"calc(100vh - 270px)"},children:c==="request"?i.jsx(ji,{operation:s}):i.jsx(ki,{operation:s})})]}):i.jsx("div",{className:"text-gray-500",children:"No request selected."}),Ci="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAGAAAABgCAYAAADimHc4AAAAAXNSR0IB2cksfwAAAAlwSFlzAAALEwAACxMBAJqcGAAACHxJREFUeJztnX+MFGcdxiul8UWMcECtlSIcR+GKYKsHhTu9dsQr9PhxV+TSEtTYVqXVHnD9AZWWhkG7tY1pY2uUtrYRQhZbTyC1Ftyilhg1Ri0Ww4gh1pomeze3O8ZaClZ68PoZ50gu6+zdLjd732FmnuT5j5DvPJ/bfZ93fu155yVKlChRokSJEg1FatLssXi09ByxE6FfjHfjU/g/+HE8TnquWKgv/D9jXeCf4irp+SItAj4f/9wn/DN+EL9Les7IinCXDxC+63/ij0vPGUn1LbivDQLA9Y+lZ42kCPZ6fLoEACdxrfS8kZL7vY5/XUL4Z7xVeuZIiUA/XOJf/xn/FV8kPXdkRJj3lBG+7tsffEF67kjI3ekOUj0zuAVfjtfg7/R5pfTskRBBzsJvFQn/V8kOOAARosL34tfxOwU+VST8N8ZMr7+sPe3svW27o295Kq+/uDWvb3o0rz/3zbxe9UCu5wYzd1/bppySPr7QizDvxr1lfs9/a+0zPW3tO53TRQBoAPSuuDe3Qfr4Qi/C/FuZ4b9dbXxm0rrO/CsA0AMA0CvuyR2VPr7Qi0APlQng+Y5dzlUA6C0BwEHp4wu9CPQ6/O8yKuaC23c7z3V05vUgAE7wFbRU+vhCL+XtdJvwdvzDfn7VB0AWV92xx+kEQAYAGQBkAJABQAYAGQBkAPAsABayCCdnR89Gyjv1/CMfADukZ4uFCHoC/pMPgOukZ4uFCLq2yLpwofRssRBBf8on/C7puWIjwr7ZB8A+6bnOSRHceHxbvxNlpfi3PgA2r3/BWXXX806aFpSmBaVpQWlaUJoWlKYFpWlBaVpQmhaUpgWlP70xt6P1ztz2pWty3792dc/TTTf1PGWssp9obLO/29Bq3zJ/iT1WOp+Kqq/NfK/MjVYxLwTAcwDQANAl7AP0io05DQANAA0ADQANAA0AXd9i63nN9qNzmrqjW1UJ7WP4HwGEfxxXA+BokACuvNa2ATBdOqeKidDq8b8CAJB979S6KgCcCBhAHgCzpHOqmAjuAnfxDADA4TWdr05av9fRAX8F7QLACOmcKirCm4ifxFaJdk9BFJ6e3r9hnzMTABYALABYALAAYAHAAoAFAAsAFgAsAFgAsABgAcACgAUACwAWACwAHG5osR+bv9hOrh0XirAb8JsFALZJzxUbEXaz8m667Q/gIem5YiPCXumzBrRLzxUbEfZXfAC0Ss8VGxH2Rh8Ac6XnCq2Ud0FlKV6Nbw3AewsBjJ919bS7M85aWpBJCzJpQSYtyKQFmbQgkxZk0oJMWpBJCzJpQSYtyKQFmbQgkxZk0oJMWpBJCzJpQSY11GQfYNYt6DYvb+w2Z9d3mTPndJkzrugyp83KbqqpzS6fOj0b7oqqvLuW9wfQ8wf08vs7xwLgtaD3AQDQANAA0ADQANAA0ADQANDVl2ZfnDItO0Y656IinDZV3n2bZ+Newq/CWQEAp6fUZJdL51xUbjup9F8/zhP+hTgnAEBPrsneKp1zURHOlfjtCgPIEf4HsCMA4ASfgI9K51xUyjvd3KG8uxUqBeB1wp+Mjw0zgC4AtLMGnC+d87CKwDsLAFjl/h8rv54bCYCLADCh5c7cOABULVrd8z4AjAbAKAC8u6HFvgAAIyJ9PeBspLx7goYEINEQlAAQVgJAWAmAsxAhVeGpATnj04IUbqQFGbQggxZk0IIMWpBBCzJoQQYtyKAFGbQggxZksAgbLMIGLchgETZoQQaLsMEibLAIG7Qgg0XYoAUZtCCDFmTQggxakEELMmouy1ZL5zqolPd0y2Oq/Acsyt0HTMHHh7mGnqaGPk0NHSWdc1Ep767mSoZ/BsCH8JsCG7FeNmKLpHMuKsJZW+HwXR8j/PcLnoq4QzrnoiKcxcPwCdCEPwHbAgBO8QkI70MehDMKb1XFn2YMxPU3b5kIgL8LANjOGhD+t3IR0iX4amwE4G2FAMbWNkwHwPwht6Ab7QUAuAYATQBYAIBPFm1BtdkZ0rmKSHmPrRZ+Cj4hPVdsRNhf9gFwg/RcsZEbtg+Au6Tnio0Ie5H6/4s8j0jPFRsp/zuq09JznbMivDr88hCr6Esb9jl1QdbQhhb70LzF9jzpfCoqghuDfx/AXuDI6m2vXBL4PqDZ/sOcpu7w3nYyVBFcIz4WAAAbj1//gnM84I3YMQA0SudUMSnvfW+5AAC4zwzXAOBIwAB6ADBTOqeKiuA2K+91kkOFsAQAewIE8M68ZnuLdD4Vl/KuGSzs2+GaJfpFHwApACwBQAoAKQCkAJACQAoAKQCkAJACwP0A+BoAtgxwb+jmhlZ72fwldnjP9UuKsG/0AfAz6bliI8K+ygeAu5Yk9/AMhwj6UuX/tsQPSs8WCxH0OHzQB8D10rPFQgQ9Aj/jA+BZ6dkiJ0IdqbwbfN3TFf2fF/Z7xcH/NmS0oF8O8pzwQVpQR9um3Ejp4wu9lPeMQanXld2HQZpv3+38oIR9gPve0C9JH1/oRaBHy9yQZTp2OXPXdeZPlvDaykPSxxd6EeiRMgGcvHjusskA+F0JAF6WPr7Qi0BX4RNlQtjavrO7GQC9g7w3tE36+EIv5T1ls0x5L/TYVuCXigB4a3R13Ufa087DADgAgAMAOACAXwBgf98bs1pZhOP1dEvQIugZ+I0iEP6IJ/b7t251na28W1vC+1zXuSTl3fj1kwG+in6DP4+vwd/APcp7u9bj0rNHRoS5rsz1wf3dgc9Kzx0ZEWZNGfsE139RyS9rBCvl/VZkqQCSW1iClvJeBlLKDcDupctJ0vNGTsr7NaXDJQDYKT1rZKW8p3EGejGI24CukJ4zsurr+XsGAPBV6RkjL+VdqPG70WsHfo/0fLGQ8h6J/bbyzh/l8X0q+W354ZdKLtAnSpQoUaJEicrRfwFj5g/5zsKE0wAAAABJRU5ErkJggg==",Ai=({apiEndpoint:s,setApiEndpoint:c,connectionStatus:d,channelCode:p,setChannelCode:_,channel:k,setChannel:N,onRegister:S})=>{const[L,q]=D.useState(!1),[E,I]=D.useState(s),[J,X]=D.useState(p),[H,G]=D.useState(k);D.useEffect(()=>{I(s),X(p),G(k)},[s,p,k]),D.useEffect(()=>{if(typeof window<"u"){const Y=localStorage.getItem("apiEndpoint")||window.location.origin+"/api";I(Y),c(Y)}},[c]);const W=()=>{typeof window<"u"&&localStorage.setItem("apiEndpoint",E),c(E)},de=()=>{typeof window<"u"&&(localStorage.setItem("channelCode",J),localStorage.setItem("channel",H)),_(J),N(H),S(J,H,"",!0)};return i.jsxs("div",{className:"fixed bottom-0 left-0 w-full",children:[i.jsxs("div",{className:"flex items-center justify-between bg-gray-200 px-4 py-2 w-full cursor-pointer select-none",onClick:()=>q(Y=>!Y),children:[i.jsx("div",{className:"flex items-center gap-4",children:i.jsxs("span",{className:`px-2 py-1 rounded-full text-xs font-semibold flex items-center
|
|
26
|
+
${d==="connected"?"bg-green-500 text-white":d==="reconnecting"?"bg-yellow-500 text-black":"bg-red-500"}`,children:[i.jsx("span",{className:`w-2 h-2 rounded-full mr-1
|
|
27
|
+
${d==="connected"?"bg-green-800":d==="reconnecting"?"bg-yellow-800":"bg-red-800"}`}),d.charAt(0).toUpperCase()+d.slice(1)]})}),i.jsxs("a",{href:"https://github.com/inspectr-hq/inspectr",target:"_blank",rel:"noopener noreferrer",className:"flex items-center gap-2",onClick:Y=>Y.stopPropagation(),children:[i.jsx("img",{src:Ci,alt:"Inspectr Logo",className:"h-6"}),i.jsx("span",{className:"text-gray-700 font-semibold text-sm",children:"Inspectr"})]})]}),i.jsx("div",{className:`bg-gray-100 border-t border-gray-300 transition-all duration-300 overflow-hidden ${L?"max-h-96 opacity-100 py-4":"max-h-0 opacity-0 py-0"}`,children:i.jsxs("div",{className:"px-6",children:[i.jsx("h2",{className:"text-lg font-semibold text-gray-800 mb-4",children:"Configuration"}),i.jsxs("div",{className:"grid grid-cols-3 gap-6",children:[i.jsxs("div",{children:[i.jsx("label",{className:"block text-sm font-medium text-gray-700 mb-1",children:"Inspectr API Endpoint"}),i.jsx("input",{type:"text",placeholder:"Enter API Endpoint...",value:E,onChange:Y=>I(Y.target.value),className:"w-full border bg-white border-gray-300 rounded-md shadow-sm py-2 px-3 focus:ring-blue-500 focus:border-blue-500 sm:text-sm"}),i.jsx("button",{onClick:W,className:"mt-2 bg-blue-600 text-white px-3 py-1.5 rounded-md text-sm",children:"Save"})]}),i.jsxs("div",{children:[i.jsx("label",{className:"block text-sm font-medium text-gray-700 mb-1",children:"Channel"}),i.jsx("input",{type:"text",placeholder:"Enter Channel...",value:H,onChange:Y=>G(Y.target.value),className:"w-full bg-white border border-gray-300 rounded-md shadow-sm py-2 px-3 focus:ring-blue-500 focus:border-blue-500 sm:text-sm"}),i.jsx("button",{onClick:de,className:"mt-2 bg-green-600 text-white px-3 py-1.5 rounded-md text-sm",children:"Register"})]}),i.jsxs("div",{children:[i.jsx("label",{className:"block text-sm font-medium text-gray-700 mb-1",children:"Access Code"}),i.jsx("input",{type:"text",placeholder:"Enter Access Code...",value:J,onChange:Y=>X(Y.target.value),className:"w-full border bg-white border-gray-300 rounded-md shadow-sm py-2 px-3 focus:ring-blue-500 focus:border-blue-500 sm:text-sm"})]})]})]})})]})};class Ni{constructor(){this.db=new On("InspectrDB"),this.db.version(1).stores({events:"id, time, operation_id, method, status_code, path, duration, server"})}transformEvent(c){var d;const{id:p,time:_,data:k,operation_id:N}=c;return{id:p,time:_,operation_id:N,method:k.request.method,url:k.request.url,server:k.request.server,path:k.request.path,client_ip:k.request.client_ip,duration:k.timing.duration,status_code:(d=k.response)==null?void 0:d.status,raw:c}}async upsertEvent(c){const d=this.transformEvent(c);return await this.db.events.put(d)}async deleteEvent(c){return await this.db.events.delete(c)}async getEvent(c){return await this.db.events.get(c)}async queryEvents(c={}){const{filters:d={},sort:p={field:"time",order:"desc"},page:_=1,pageSize:k=20}=c;let N=this.db.events.toCollection();if(d.timestampRange){if(typeof d.timestampRange=="string"){let E=new Date;switch(d.timestampRange){case"5M":E.setMinutes(E.getMinutes()-5);break;case"15M":E.setMinutes(E.getMinutes()-15);break;case"30M":E.setMinutes(E.getMinutes()-30);break;case"1H":E.setHours(E.getHours()-1);break;case"3H":E.setHours(E.getHours()-3);break;case"6H":E.setHours(E.getHours()-6);break;case"12H":E.setHours(E.getHours()-12);break;case"24H":E.setHours(E.getHours()-24);break;case"48H":E.setHours(E.getHours()-48);break;case"week":E.setDate(E.getDate()-7);break;case"month":E.setMonth(E.getMonth()-1);break}N=N.filter(I=>new Date(I.time)>=E)}else if(typeof d.timestampRange=="object"){if(d.timestampRange.start&&d.timestampRange.end){const E=new Date(d.timestampRange.start),I=new Date(d.timestampRange.end);N=N.filter(J=>{const X=new Date(J.time);return X>=E&&X<=I})}else if(d.timestampRange.start){const E=new Date(d.timestampRange.start);N=N.filter(I=>new Date(I.time)>=E)}else if(d.timestampRange.end){const E=new Date(d.timestampRange.end);N=N.filter(I=>new Date(I.time)<=E)}}}if(d.status&&Array.isArray(d.status)&&d.status.length>0&&(N=N.filter(E=>d.status.includes(String(E.status_code)))),d.method&&Array.isArray(d.method)&&d.method.length>0){const E=d.method.map(I=>I.toLowerCase());N=N.filter(I=>E.includes(I.method.toLowerCase()))}d.path&&(N=N.filter(E=>E.path.includes(d.path))),d.durationMin&&(N=N.filter(E=>Number(E.duration)>=Number(d.durationMin))),d.durationMax&&(N=N.filter(E=>Number(E.duration)<=Number(d.durationMax))),d.host&&(N=N.filter(E=>E.server.toLowerCase().includes(d.host.toLowerCase())));let S;if(typeof N.orderBy=="function")try{S=N.orderBy(p.field),p.order==="desc"&&(S=S.reverse())}catch(E){console.error("[EventDB] orderBy error, fallback sorting:",E),S=(await N.toArray()).sort((I,J)=>{const X=p.field;return I[X]<J[X]?p.order==="asc"?-1:1:I[X]>J[X]?p.order==="asc"?1:-1:0})}else S=(await N.toArray()).sort((E,I)=>{const J=p.field;return E[J]<I[J]?p.order==="asc"?-1:1:E[J]>I[J]?p.order==="asc"?1:-1:0});const L=(_-1)*k;let q;return Array.isArray(S)?q=S.slice(L,L+k):typeof S.offset=="function"?q=await S.offset(L).limit(k).toArray():q=[],q.map(E=>({id:E.id,...E.raw.data}))}async clearEvents(){return await this.db.events.clear()}}const lt=new Ni,Oi=typeof window<"u"&&window.location.hostname==="localhost",vr=typeof window<"u"&&localStorage.getItem("debug")==="true";vr&&console.log("[Inspectr] Debug Mode enabled");const qi=({apiEndpoint:s="/api"})=>{const[c,d]=D.useState(null),[p,_]=D.useState("request"),[k,N]=D.useState(s),[S,L]=D.useState("disconnected"),[q,E]=D.useState(""),[I,J]=D.useState(""),[X,H]=D.useState(""),[G,W]=D.useState(""),[de,Y]=D.useState(""),[ve,je]=D.useState(!1),[me,ie]=D.useState(null),ne=100,[be,ue]=D.useState(1),[Z,ge]=D.useState("time"),[xe,Oe]=D.useState("desc"),[Ne,$]=D.useState({}),ce=D.useRef(!1),Se=D.useRef(0),Ee=D.useRef(!1),Pe=6,Be=5e3,re=ro(()=>(vr&&console.log("[Inspectr] filters",Ne),lt.queryEvents({sort:{field:Z,order:xe},filters:Ne,page:be,pageSize:ne})),[be,Z,xe,Ne]),ye=ro(()=>lt.db.events.count(),[]),_e=ye?Math.ceil(ye/ne):1,Je=()=>{const V=new URLSearchParams(window.location.search),he=V.get("channelCode"),Re=V.get("channel"),Le=V.get("token");return he||Re||Le?(console.log("🔍 Found credentials in query params"),he&&(J(he),localStorage.setItem("channelCode",he)),Re&&(H(Re),localStorage.setItem("channel",Re)),Le&&(W(Le),localStorage.setItem("token",Le)),window.history.replaceState({},"",`${window.location.pathname}${V.toString()?"?"+V.toString():""}`),!0):!1},He=()=>{const V=localStorage.getItem("channelCode"),he=localStorage.getItem("channel"),Re=localStorage.getItem("token");return V&&he&&Re?(console.log("✅ Using stored credentials from localStorage"),J(V),H(he),W(Re),!0):!1},et=async()=>{console.log("🔄 Fetching /app/config (Localhost, No credentials found)");try{const V=await Ge();V!=null&&V.token&&V!=null&&V.sse_endpoint&&V!=null&&V.channel_code&&(console.log("✅ Loaded from /app/config:",V),J(V.channel_code),localStorage.setItem("channelCode",V.channel_code),H(V.channel),localStorage.setItem("channel",V.channel),W(V.token),localStorage.setItem("token",V.token),E(V.sse_endpoint),localStorage.setItem("sseEndpoint",V.sse_endpoint))}catch(V){console.error("❌ Failed to load /app/config:",V)}};D.useEffect(()=>{(async()=>typeof window>"u"||(Je()||!He()&&Oi&&await et(),je(!0)))()},[]),D.useEffect(()=>{ve&&(console.log("🔄 Auto-registering with stored credentials:",X,I),X&&I?dt(I,X):console.log("⚠️ Missing credentials for auto-registration, skipping."))},[ve,X,I]);const dt=async(V=I,he=X,Re=G,Le)=>{try{let Fe={};V&&he?Fe={channel:he,channel_code:V}:Re&&(Fe={token:Re}),console.log("📤 Registering with:",Fe);const se=await Pn(Fe);if(se!=null&&se.token&&se!=null&&se.sse_endpoint&&se!=null&&se.channel_code)return console.log("✅ Registration successful"),Se.current=0,Ee.current=!1,J(se.channel_code),localStorage.setItem("channelCode",se.channel_code),H(se.channel),localStorage.setItem("channel",se.channel),W(se.token),localStorage.setItem("token",se.token),Y(se.expires),localStorage.setItem("expires",se.expires),E(se.sse_endpoint),localStorage.setItem("sseEndpoint",se.sse_endpoint),Le&&ie({message:"Registration Successful",subMessage:"Your channel and access code have been registered."}),L("connected"),!0;throw console.error("❌ Registration failed:",se),ie({message:"Registration Failed",subMessage:"Please check your channel and access code.",type:"error"}),new Error("Registration failed")}catch(Fe){throw console.error("❌ Registration error:",Fe),ie({message:"Registration Error",subMessage:"An error occurred during registration.",type:"error"}),Fe}},Zt=()=>{Se.current<Pe?(Se.current+=1,console.log(`🔄 Attempting re-registration (${Se.current}/${Pe}) in ${Be/1e3} seconds...`),setTimeout(async()=>{try{await dt()}catch(V){console.log("❌ Re-registration attempt failed:",V),Zt()}},Be)):(console.log(`❌ Re-registration failed after ${Pe} attempts. Giving up.`),Se.current=0,Ee.current=!0,L("disconnected"))};D.useEffect(()=>{if(!q)return;const V=localStorage.getItem("lastEventId");let he=q;V&&(he+=he.includes("?")?`&last_event_id=${V}`:`?last_event_id=${V}`);const Re=()=>`req-${Math.random().toString(36).substr(2,9)}`,Le=new EventSource(he);return console.log(`🔄 SSE connecting with ${he}`),Le.onopen=()=>{console.log("📡️ SSE connection opened."),ce.current=!0,L("connected")},Le.onmessage=Fe=>{try{const se=JSON.parse(Fe.data);vr&&console.log("[Inspectr] Received event:",se),se.id||(se.id=Re()),se.operation_id&&localStorage.setItem("lastEventId",se.operation_id),lt.upsertEvent(se).catch(Gt=>console.error("Error saving event to DB:",Gt))}catch(se){console.error("Error parsing SSE Inspectr data:",se)}},Le.onerror=Fe=>{if(console.error("❌ SSE connection error:",Fe),ce.current=!1,L("reconnecting"),Ee.current){console.log("❌ Maximum re-registration attempts reached. Closing EventSource."),L("disconnected"),Le.close();return}!Ee.current&&Se.current===0&&(console.log("🔄 Starting re-registration retry loop due to SSE error."),Zt())},()=>{console.log("Closing SSE EventSource connection"),Le.close(),L("disconnected")}},[q]),D.useEffect(()=>{!c&&re&&re.length>0&&d(re[0])},[re,c]);const U=()=>{d(null),lt.clearEvents().catch(V=>console.error("Error clearing events from DB:",V)),pe().catch(V=>console.error("Error deleting operations from Inspectr:",V)),localStorage.removeItem("lastEventId")},$t=async()=>{try{const V=await lt.queryEvents({filters:Ne,sort:{field:"time",order:"desc"},page:1,pageSize:Number.MAX_SAFE_INTEGER});await Promise.all(V.map(async he=>{await lt.deleteEvent(he.id),await tt(he.operation_id)})),c&&V.some(he=>he.id===c.id)&&d(null)}catch(V){console.error("Error clearing filtered operations:",V)}},jt=async V=>{c&&(c.id||"")===V&&d(null);const he=await lt.getEvent(V);lt.deleteEvent(V).catch(Re=>console.error("Error deleting event from DB:",Re)),tt(he.operation_id).catch(Re=>console.error("Error deleting operation from Inspectr:",Re))},pe=async()=>{try{if(!(await fetch(`${k}/operations`,{method:"DELETE",headers:{"Content-Type":"application/json","x-inspectr-client":"inspectr-app"}})).ok)throw new Error("Failed to delete all operations")}catch(V){console.error("Error deleting all operations:",V),ie({message:"Error deleting all operations",subMessage:V.message,type:"error"})}},tt=async V=>{try{if(!(await fetch(`${k}/operations/${V}`,{method:"DELETE",headers:{"Content-Type":"application/json","x-inspectr-client":"inspectr-app"}})).ok)throw new Error(`Failed to delete operation ${V}`)}catch(he){console.error(`Error deleting operation ${V}:`,he),ie({message:"Error deleting operation",subMessage:he.message,type:"error"})}},Pn=async V=>{const he=await fetch(`${k}/register`,{method:"POST",headers:{"Content-Type":"application/json","x-inspectr-client":"inspectr-app"},body:JSON.stringify(V)});if(!he.ok)throw new Error(`Registration API call failed with status ${he.status}`);return await he.json()},Ge=async()=>{const V=await fetch("/app/config");if(!V.ok)throw new Error(`Failed to fetch config: ${V.status}`);return await V.json()};return i.jsxs("div",{className:"flex flex-col h-screen",children:[i.jsxs("div",{className:"flex flex-grow",children:[i.jsx("div",{className:"w-1/3 border-r border-gray-300 overflow-y-auto",children:i.jsx(fa,{operations:re||[],onSelect:d,onRemove:jt,clearOperations:U,clearFilteredOperations:$t,selectedOperation:c,currentPage:be,totalPages:_e,totalCount:ye||0,onPageChange:ue,sortField:Z,sortDirection:xe,filters:Ne,setSortField:ge,setSortDirection:Oe,setFilters:$})}),i.jsx("div",{className:"w-2/3 p-4 h-full overflow-y-auto",children:i.jsx("div",{className:"flex flex-col h-full",children:i.jsx(_i,{operation:c,currentTab:p,setCurrentTab:_})})})]}),i.jsx(Ai,{apiEndpoint:k,setApiEndpoint:N,connectionStatus:S,channelCode:I,setChannelCode:J,channel:X,setChannel:H,onRegister:dt}),me&&i.jsx(Nn,{message:me.message,subMessage:me.subMessage,type:me.type,onClose:()=>ie(null)})]})};export{qi as InspectrApp};
|
package/dist/index.html
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
<!DOCTYPE html><html lang="en" data-astro-cid-sckkx6r4> <head><meta charset="UTF-8"><meta name="viewport" content="width=device-width"><link rel="icon" type="image/icon" href="/favicon.ico"><meta name="description" content="Inspectr – Simplifying API and Webhook debugging"><title>Inspectr</title><link rel="stylesheet" href="/_astro/index.
|
|
1
|
+
<!DOCTYPE html><html lang="en" data-astro-cid-sckkx6r4> <head><meta charset="UTF-8"><meta name="viewport" content="width=device-width"><link rel="icon" type="image/icon" href="/favicon.ico"><meta name="description" content="Inspectr – Simplifying API and Webhook debugging"><title>Inspectr</title><link rel="stylesheet" href="/_astro/index.EqvPwrSk.css"></head> <body data-astro-cid-sckkx6r4> <style>astro-island,astro-slot,astro-static-slot{display:contents}</style><script>(()=>{var e=async t=>{await(await t())()};(self.Astro||(self.Astro={})).load=e;window.dispatchEvent(new Event("astro:load"));})();;(()=>{var A=Object.defineProperty;var g=(i,o,a)=>o in i?A(i,o,{enumerable:!0,configurable:!0,writable:!0,value:a}):i[o]=a;var d=(i,o,a)=>g(i,typeof o!="symbol"?o+"":o,a);{let i={0:t=>m(t),1:t=>a(t),2:t=>new RegExp(t),3:t=>new Date(t),4:t=>new Map(a(t)),5:t=>new Set(a(t)),6:t=>BigInt(t),7:t=>new URL(t),8:t=>new Uint8Array(t),9:t=>new Uint16Array(t),10:t=>new Uint32Array(t),11:t=>1/0*t},o=t=>{let[l,e]=t;return l in i?i[l](e):void 0},a=t=>t.map(o),m=t=>typeof t!="object"||t===null?t:Object.fromEntries(Object.entries(t).map(([l,e])=>[l,o(e)]));class y extends HTMLElement{constructor(){super(...arguments);d(this,"Component");d(this,"hydrator");d(this,"hydrate",async()=>{var b;if(!this.hydrator||!this.isConnected)return;let e=(b=this.parentElement)==null?void 0:b.closest("astro-island[ssr]");if(e){e.addEventListener("astro:hydrate",this.hydrate,{once:!0});return}let c=this.querySelectorAll("astro-slot"),n={},h=this.querySelectorAll("template[data-astro-template]");for(let r of h){let s=r.closest(this.tagName);s!=null&&s.isSameNode(this)&&(n[r.getAttribute("data-astro-template")||"default"]=r.innerHTML,r.remove())}for(let r of c){let s=r.closest(this.tagName);s!=null&&s.isSameNode(this)&&(n[r.getAttribute("name")||"default"]=r.innerHTML)}let p;try{p=this.hasAttribute("props")?m(JSON.parse(this.getAttribute("props"))):{}}catch(r){let s=this.getAttribute("component-url")||"<unknown>",v=this.getAttribute("component-export");throw v&&(s+=` (export ${v})`),console.error(`[hydrate] Error parsing props for component ${s}`,this.getAttribute("props"),r),r}let u;await this.hydrator(this)(this.Component,p,n,{client:this.getAttribute("client")}),this.removeAttribute("ssr"),this.dispatchEvent(new CustomEvent("astro:hydrate"))});d(this,"unmount",()=>{this.isConnected||this.dispatchEvent(new CustomEvent("astro:unmount"))})}disconnectedCallback(){document.removeEventListener("astro:after-swap",this.unmount),document.addEventListener("astro:after-swap",this.unmount,{once:!0})}connectedCallback(){if(!this.hasAttribute("await-children")||document.readyState==="interactive"||document.readyState==="complete")this.childrenConnectedCallback();else{let e=()=>{document.removeEventListener("DOMContentLoaded",e),c.disconnect(),this.childrenConnectedCallback()},c=new MutationObserver(()=>{var n;((n=this.lastChild)==null?void 0:n.nodeType)===Node.COMMENT_NODE&&this.lastChild.nodeValue==="astro:end"&&(this.lastChild.remove(),e())});c.observe(this,{childList:!0}),document.addEventListener("DOMContentLoaded",e)}}async childrenConnectedCallback(){let e=this.getAttribute("before-hydration-url");e&&await import(e),this.start()}async start(){let e=JSON.parse(this.getAttribute("opts")),c=this.getAttribute("client");if(Astro[c]===void 0){window.addEventListener(`astro:${c}`,()=>this.start(),{once:!0});return}try{await Astro[c](async()=>{let n=this.getAttribute("renderer-url"),[h,{default:p}]=await Promise.all([import(this.getAttribute("component-url")),n?import(n):()=>()=>{}]),u=this.getAttribute("component-export")||"default";if(!u.includes("."))this.Component=h[u];else{this.Component=h;for(let f of u.split("."))this.Component=this.Component[f]}return this.hydrator=p,this.hydrate},e,this)}catch(n){console.error(`[astro-island] Error hydrating ${this.getAttribute("component-url")}`,n)}}attributeChangedCallback(){this.hydrate()}}d(y,"observedAttributes",["props"]),customElements.get("astro-island")||customElements.define("astro-island",y)}})();</script><astro-island uid="1rMu1p" prefix="r0" component-url="/_astro/ui.icy-TwUP.js" component-export="InspectrApp" renderer-url="/_astro/client.DmoISyUt.js" props="{}" ssr client="load" opts="{"name":"InspectrApp","value":true}" await-children><div class="flex flex-col h-screen"><div class="flex flex-grow"><div class="w-1/3 border-r border-gray-300 overflow-y-auto"><div class="flex flex-col h-full relative"><div class="p-4 flex justify-between items-center"><span class="font-bold text-xl">Requests (<!-- -->0<!-- --> of <!-- -->0<!-- -->)</span><div class="space-x-2 relative"><button class="relative px-3 py-1 rounded text-xs cursor-pointer bg-blue-500 text-white"><svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor" class="w-4 h-4 text-white"><path stroke-linecap="round" stroke-linejoin="round" d="M12 3c2.755 0 5.455.232 8.083.678.533.09.917.556.917 1.096v1.044a2.25 2.25 0 0 1-.659 1.591l-5.432 5.432a2.25 2.25 0 0 0-.659 1.591v2.927a2.25 2.25 0 0 1-1.244 2.013L9.75 21v-6.568a2.25 2.25 0 0 0-.659-1.591L3.659 7.409A2.25 2.25 0 0 1 3 5.818V4.774c0-.54.384-1.006.917-1.096A48.32 48.32 0 0 1 12 3Z"></path></svg></button><button class="px-3 py-1 bg-red-500 text-white rounded text-xs cursor-pointer"><svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor" class="w-4 h-4 text-white"><path stroke-linecap="round" stroke-linejoin="round" d="m14.74 9-.346 9m-4.788 0L9.26 9m9.968-3.21c.342.052.682.107 1.022.166m-1.022-.165L18.16 19.673a2.25 2.25 0 0 1-2.244 2.077H8.084a2.25 2.25 0 0 1-2.244-2.077L4.772 5.79m14.456 0a48.108 48.108 0 0 0-3.478-.397m-12 .562c.34-.059.68-.114 1.022-.165m0 0a48.11 48.11 0 0 1 3.478-.397m7.5 0v-.916c0-1.18-.91-2.164-2.09-2.201a51.964 51.964 0 0 0-3.32 0c-1.18.037-2.09 1.022-2.09 2.201v.916m7.5 0a48.667 48.667 0 0 0-7.5 0"></path></svg></button></div></div><div class="flex items-center bg-gray-200 p-2 border-b border-gray-300 text-sm font-bold cursor-pointer"><div class="w-16 text-center">Status</div><div class="w-20 text-center">Method</div><div class="flex-grow text-left">Path</div><div class="w-20 text-center">Timestamp</div><div class="w-16 text-right">Duration</div><div class="w-10"></div></div><ul class="overflow-y-auto flex-grow" style="max-height:calc(100vh - 40px - 100px - 49px)"><li class="flex items-center justify-center h-full text-gray-500 text-2xl">No operations</li></ul><nav class="p-2 border-t border-gray-300"><ul class="flex items-center justify-center -space-x-px h-8 text-sm"><li><button disabled="" class="flex items-center justify-center px-3 h-8 leading-tight text-gray-500 bg-white border border-e-0 border-gray-300 rounded-s-lg hover:bg-gray-100 hover:text-gray-700 disabled:opacity-50 dark:bg-gray-800 dark:border-gray-700 dark:text-gray-400 dark:hover:bg-gray-700 dark:hover:text-white cursor-pointer"><span class="sr-only">Previous</span><svg class="w-2.5 h-2.5 rtl:rotate-180" aria-hidden="true" xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 6 10"><path stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M5 1 1 5l4 4"></path></svg></button></li><li><button class="z-10 flex items-center justify-center px-3 h-8 leading-tight text-blue-600 border border-blue-300 bg-blue-50 hover:bg-blue-100 hover:text-blue-700 dark:border-gray-700 dark:bg-gray-700 dark:text-white cursor-pointer">1</button></li><li><button disabled="" class="flex items-center justify-center px-3 h-8 leading-tight text-gray-500 bg-white border border-gray-300 rounded-e-lg hover:bg-gray-100 hover:text-gray-700 disabled:opacity-50 dark:bg-gray-800 dark:border-gray-700 dark:text-gray-400 dark:hover:bg-gray-700 dark:hover:text-white cursor-pointer"><span class="sr-only">Next</span><svg class="w-2.5 h-2.5 rtl:rotate-180" aria-hidden="true" xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 6 10"><path stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="m1 9 4-4-4-4"></path></svg></button></li></ul></nav><div class="fixed top-0 left-0 h-full w-100 bg-white shadow-xl transform transition-transform duration-300
|
|
2
2
|
-translate-x-full
|
|
3
3
|
" style="z-index:9999"><div class="flex items-center justify-between px-4 py-3 border-b border-gray-300 bg-gray-50"><h2 class="pl-4 text-lg font-semibold text-gray-800">Filter & Sort</h2><button class="text-gray-600 hover:text-gray-800 focus:outline-none cursor-pointer" aria-label="Close">×</button></div><div class="p-4 overflow-y-auto h-full"><section class="mb-6 ml-4 mr-4"><div class="flex items-center justify-between"><h3 class="mb-3 text-xs font-bold text-gray-600 uppercase tracking-wide">Sort By</h3><button class="text-xs text-blue-600 hover:underline cursor-pointer">Reset</button></div><div class="space-y-3"><label class="flex items-center"><input type="radio" class="form-radio text-blue-600" name="sortField" checked="" value="time"/><span class="ml-3 text-gray-700">Timestamp</span></label><label class="flex items-center"><input type="radio" class="form-radio text-blue-600" name="sortField" value="statusCode"/><span class="ml-3 text-gray-700">Status</span></label><label class="flex items-center"><input type="radio" class="form-radio text-blue-600" name="sortField" value="method"/><span class="ml-3 text-gray-700">Method</span></label></div><div class="mt-4"><h4 class="mb-2 text-xs font-bold text-gray-600 uppercase tracking-wide">Sort Direction</h4><div class="space-y-3"><label class="flex items-center"><input type="radio" class="form-radio text-blue-600" name="sortDirection" value="asc"/><span class="ml-3 text-gray-700">Ascending</span></label><label class="flex items-center"><input type="radio" class="form-radio text-blue-600" name="sortDirection" checked="" value="desc"/><span class="ml-3 text-gray-700">Descending</span></label></div></div></section><section class="mb-6 ml-4 mr-4"><div class="flex items-center justify-between"><h3 class="mb-3 text-xs font-bold text-gray-600 uppercase tracking-wide">Filters</h3><button class="text-xs text-blue-600 hover:underline cursor-pointer">Reset</button></div><div class="space-y-4"><div><label class="block text-sm font-medium text-gray-700 mb-1">Quick Time Range</label><select class="block w-full border border-gray-300 rounded-md shadow-sm py-2 px-3 focus:ring-blue-500 focus:border-blue-500 sm:text-sm"><option value="" selected="">Any</option><option value="5M">Last 5 minutes</option><option value="15M">Last 15 minutes</option><option value="30M">Last 30 minutes</option><option value="1H">Last 1 hour</option><option value="3H">Last 3 hours</option><option value="6H">Last 6 hours</option><option value="12H">Last 12 hours</option><option value="24H">Last 24 hours</option><option value="48H">Last 48 hours</option><option value="week">Last Week</option><option value="month">Last Month</option></select></div><div><label class="block text-sm font-medium text-gray-700 mb-1">Specific Time Range</label><div class="flex space-x-2"><input type="datetime-local" class="w-1/2 border border-gray-300 rounded-md shadow-sm py-2 px-3 focus:ring-blue-500 focus:border-blue-500 sm:text-sm" value=""/><input type="datetime-local" class="w-1/2 border border-gray-300 rounded-md shadow-sm py-2 px-3 focus:ring-blue-500 focus:border-blue-500 sm:text-sm" value=""/></div></div><div><label class="block text-sm font-medium text-gray-700 mb-1">Status</label><div class="w-full max-w-md relative"><div class="flex flex-wrap items-center border border-gray-300 rounded-md shadow-sm px-2 py-1"><input type="text" class="flex-grow outline-none p-1" placeholder="Add status code..." value=""/></div></div></div><div><label class="block text-sm font-medium text-gray-700 mb-1">Method</label><div class="w-full max-w-md relative"><div class="flex flex-wrap items-center border border-gray-300 rounded-md shadow-sm px-2 py-1"><input type="text" class="flex-grow outline-none p-1" placeholder="Add method..." value=""/></div></div></div><div><label class="block text-sm font-medium text-gray-700 mb-1">Path</label><input type="text" placeholder="e.g. /api/users" class="block w-full border border-gray-300 rounded-md shadow-sm py-2 px-3 focus:ring-blue-500 focus:border-blue-500 sm:text-sm" value=""/></div><div><label class="block text-sm font-medium text-gray-700 mb-1">Duration (ms)</label><div class="flex space-x-2"><input type="number" placeholder="Min" class="w-1/2 border border-gray-300 rounded-md shadow-sm py-2 px-3 focus:ring-blue-500 focus:border-blue-500 sm:text-sm" value=""/><input type="number" placeholder="Max" class="w-1/2 border border-gray-300 rounded-md shadow-sm py-2 px-3 focus:ring-blue-500 focus:border-blue-500 sm:text-sm" value=""/></div></div><div><label class="block text-sm font-medium text-gray-700 mb-1">Host</label><input type="text" placeholder="e.g. localhost" class="block w-full border border-gray-300 rounded-md shadow-sm py-2 px-3 focus:ring-blue-500 focus:border-blue-500 sm:text-sm" value=""/></div></div></section></div></div></div></div><div class="w-2/3 p-4 h-full overflow-y-auto"><div class="flex flex-col h-full"><div class="text-gray-500">No request selected.</div></div></div></div><div class="fixed bottom-0 left-0 w-full"><div class="flex items-center justify-between bg-gray-200 px-4 py-2 w-full cursor-pointer select-none"><div class="flex items-center gap-4"><span class="px-2 py-1 rounded-full text-xs font-semibold flex items-center
|
|
4
4
|
bg-red-500"><span class="w-2 h-2 rounded-full mr-1
|
package/package.json
CHANGED
|
@@ -2,9 +2,9 @@
|
|
|
2
2
|
"name": "@inspectr/app",
|
|
3
3
|
"description": "Standalone Inspectr app for inspecting API requests & Webhook events.",
|
|
4
4
|
"type": "module",
|
|
5
|
-
"version": "0.
|
|
5
|
+
"version": "0.3.0",
|
|
6
6
|
"author": "Tim Haselaars",
|
|
7
|
-
"homepage": "https://
|
|
7
|
+
"homepage": "https://inspectr.dev",
|
|
8
8
|
"bugs": "https://github.com/inspectr-hq/inspectr-app/issues",
|
|
9
9
|
"repository": {
|
|
10
10
|
"type": "git",
|
|
@@ -37,11 +37,11 @@
|
|
|
37
37
|
"devDependencies": {
|
|
38
38
|
"@astrojs/react": "^4.2.1",
|
|
39
39
|
"@tailwindcss/vite": "^4.0.6",
|
|
40
|
-
"@inspectr/ui": "^0.
|
|
40
|
+
"@inspectr/ui": "^0.3.0",
|
|
41
41
|
"@types/react": "^19.0.8",
|
|
42
42
|
"@types/react-dom": "^19.0.3",
|
|
43
43
|
"astro": "^5.4.2",
|
|
44
|
-
"tailwindcss": "^4.0.
|
|
44
|
+
"tailwindcss": "^4.0.14"
|
|
45
45
|
},
|
|
46
46
|
"publishConfig": {
|
|
47
47
|
"access": "public"
|