@arbocollab/arbo-plugin-item-table 0.1.94 → 0.1.95
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/lib/es/index.es.js +2 -2
- package/lib/umd/index.umd.js +2 -2
- package/package.json +1 -1
package/lib/umd/index.umd.js
CHANGED
|
@@ -110,7 +110,7 @@ Expected function or array of functions, received type ${typeof e}.`),ls)}functi
|
|
|
110
110
|
* Date: 2023-02-28T14:09:41.732Z
|
|
111
111
|
*/function x1(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);t&&(s=s.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),n.push.apply(n,s)}return n}function xg(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?x1(Object(n),!0).forEach(function(s){bz(e,s,n[s])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):x1(Object(n)).forEach(function(s){Object.defineProperty(e,s,Object.getOwnPropertyDescriptor(n,s))})}return e}function wz(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function F1(e,t){for(var n=0;n<t.length;n++){var s=t[n];s.enumerable=s.enumerable||!1,s.configurable=!0,"value"in s&&(s.writable=!0),Object.defineProperty(e,P1(s.key),s)}}function Cz(e,t,n){return t&&F1(e.prototype,t),n&&F1(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function bz(e,t,n){return t=P1(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Fg(){return Fg=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var s in n)Object.prototype.hasOwnProperty.call(n,s)&&(e[s]=n[s])}return e},Fg.apply(this,arguments)}function Sz(e,t){if(typeof e!="object"||e===null)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var s=n.call(e,t);if(typeof s!="object")return s;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}function P1(e){var t=Sz(e,"string");return typeof t=="symbol"?t:String(t)}var A1={exports:{}};(function(e){typeof window>"u"||function(t){var n=t.HTMLCanvasElement&&t.HTMLCanvasElement.prototype,s=t.Blob&&function(){try{return!!new Blob}catch{return!1}}(),o=s&&t.Uint8Array&&function(){try{return new Blob([new Uint8Array(100)]).size===100}catch{return!1}}(),i=t.BlobBuilder||t.WebKitBlobBuilder||t.MozBlobBuilder||t.MSBlobBuilder,r=/^data:((.*?)(;charset=.*?)?)(;base64)?,/,a=(s||i)&&t.atob&&t.ArrayBuffer&&t.Uint8Array&&function(l){var u,c,d,h,f,p,g,v,C;if(u=l.match(r),!u)throw new Error("invalid data URI");for(c=u[2]?u[1]:"text/plain"+(u[3]||";charset=US-ASCII"),d=!!u[4],h=l.slice(u[0].length),d?f=atob(h):f=decodeURIComponent(h),p=new ArrayBuffer(f.length),g=new Uint8Array(p),v=0;v<f.length;v+=1)g[v]=f.charCodeAt(v);return s?new Blob([o?g:p],{type:c}):(C=new i,C.append(p),C.getBlob(c))};t.HTMLCanvasElement&&!n.toBlob&&(n.mozGetAsFile?n.toBlob=function(l,u,c){var d=this;setTimeout(function(){c&&n.toDataURL&&a?l(a(d.toDataURL(u,c))):l(d.mozGetAsFile("blob",u))})}:n.toDataURL&&a&&(n.msToBlob?n.toBlob=function(l,u,c){var d=this;setTimeout(function(){(u&&u!=="image/png"||c)&&n.toDataURL&&a?l(a(d.toDataURL(u,c))):l(d.msToBlob(u))})}:n.toBlob=function(l,u,c){var d=this;setTimeout(function(){l(a(d.toDataURL(u,c)))})})),e.exports?e.exports=a:t.dataURLtoBlob=a}(window)})(A1);var k1=A1.exports,Ez=function(t){return typeof Blob>"u"?!1:t instanceof Blob||Object.prototype.toString.call(t)==="[object Blob]"},O1={strict:!0,checkOrientation:!0,retainExif:!1,maxWidth:1/0,maxHeight:1/0,minWidth:0,minHeight:0,width:void 0,height:void 0,resize:"none",quality:.8,mimeType:"auto",convertTypes:["image/png"],convertSize:5e6,beforeDraw:null,drew:null,success:null,error:null},_z=typeof window<"u"&&typeof window.document<"u",Aa=_z?window:{},Pg=function(t){return t>0&&t<1/0},Rz=Array.prototype.slice;function yC(e){return Array.from?Array.from(e):Rz.call(e)}var Dz=/^image\/.+$/;function wC(e){return Dz.test(e)}function Tz(e){var t=wC(e)?e.substr(6):"";return t==="jpeg"&&(t="jpg"),".".concat(t)}var M1=String.fromCharCode;function Iz(e,t,n){var s="",o;for(n+=t,o=t;o<n;o+=1)s+=M1(e.getUint8(o));return s}var xz=Aa.btoa;function N1(e,t){for(var n=[],s=8192,o=new Uint8Array(e);o.length>0;)n.push(M1.apply(null,yC(o.subarray(0,s)))),o=o.subarray(s);return"data:".concat(t,";base64,").concat(xz(n.join("")))}function Fz(e){var t=new DataView(e),n;try{var s,o,i;if(t.getUint8(0)===255&&t.getUint8(1)===216)for(var r=t.byteLength,a=2;a+1<r;){if(t.getUint8(a)===255&&t.getUint8(a+1)===225){o=a;break}a+=1}if(o){var l=o+4,u=o+10;if(Iz(t,l,4)==="Exif"){var c=t.getUint16(u);if(s=c===18761,(s||c===19789)&&t.getUint16(u+2,s)===42){var d=t.getUint32(u+4,s);d>=8&&(i=u+d)}}}if(i){var h=t.getUint16(i,s),f,p;for(p=0;p<h;p+=1)if(f=i+p*12+2,t.getUint16(f,s)===274){f+=8,n=t.getUint16(f,s),t.setUint16(f,1,s);break}}}catch{n=1}return n}function Pz(e){var t=0,n=1,s=1;switch(e){case 2:n=-1;break;case 3:t=-180;break;case 4:s=-1;break;case 5:t=90,s=-1;break;case 6:t=90;break;case 7:t=90,n=-1;break;case 8:t=-90;break}return{rotate:t,scaleX:n,scaleY:s}}var Az=/\.\d*(?:0|9){12}\d*$/;function L1(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1e11;return Az.test(e)?Math.round(e*t)/t:e}function _h(e){var t=e.aspectRatio,n=e.height,s=e.width,o=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"none",i=Pg(s),r=Pg(n);if(i&&r){var a=n*t;(o==="contain"||o==="none")&&a>s||o==="cover"&&a<s?n=s/t:s=n*t}else i?n=s/t:r&&(s=n*t);return{width:s,height:n}}function kz(e){for(var t=yC(new Uint8Array(e)),n=t.length,s=[],o=0;o+3<n;){var i=t[o],r=t[o+1];if(i===255&&r===218)break;if(i===255&&r===216)o+=2;else{var a=t[o+2]*256+t[o+3],l=o+a+2,u=t.slice(o,l);s.push(u),o=l}}return s.reduce(function(c,d){return d[0]===255&&d[1]===225?c.concat(d):c},[])}function Oz(e,t){var n=yC(new Uint8Array(e));if(n[2]!==255||n[3]!==224)return e;var s=n[4]*256+n[5],o=[255,216].concat(t,n.slice(4+s));return new Uint8Array(o)}var Mz=Aa.ArrayBuffer,CC=Aa.FileReader,Vl=Aa.URL||Aa.webkitURL,Nz=/\.\w+$/,Lz=Aa.Compressor,Vz=function(){function e(t,n){wz(this,e),this.file=t,this.exif=[],this.image=new Image,this.options=xg(xg({},O1),n),this.aborted=!1,this.result=null,this.init()}return Cz(e,[{key:"init",value:function(){var n=this,s=this.file,o=this.options;if(!Ez(s)){this.fail(new Error("The first argument must be a File or Blob object."));return}var i=s.type;if(!wC(i)){this.fail(new Error("The first argument must be an image File or Blob object."));return}if(!Vl||!CC){this.fail(new Error("The current browser does not support image compression."));return}Mz||(o.checkOrientation=!1,o.retainExif=!1);var r=i==="image/jpeg",a=r&&o.checkOrientation,l=r&&o.retainExif;if(Vl&&!a&&!l)this.load({url:Vl.createObjectURL(s)});else{var u=new CC;this.reader=u,u.onload=function(c){var d=c.target,h=d.result,f={},p=1;a&&(p=Fz(h),p>1&&Fg(f,Pz(p))),l&&(n.exif=kz(h)),a||l?!Vl||p>1?f.url=N1(h,i):f.url=Vl.createObjectURL(s):f.url=h,n.load(f)},u.onabort=function(){n.fail(new Error("Aborted to read the image with FileReader."))},u.onerror=function(){n.fail(new Error("Failed to read the image with FileReader."))},u.onloadend=function(){n.reader=null},a||l?u.readAsArrayBuffer(s):u.readAsDataURL(s)}}},{key:"load",value:function(n){var s=this,o=this.file,i=this.image;i.onload=function(){s.draw(xg(xg({},n),{},{naturalWidth:i.naturalWidth,naturalHeight:i.naturalHeight}))},i.onabort=function(){s.fail(new Error("Aborted to load the image."))},i.onerror=function(){s.fail(new Error("Failed to load the image."))},Aa.navigator&&/(?:iPad|iPhone|iPod).*?AppleWebKit/i.test(Aa.navigator.userAgent)&&(i.crossOrigin="anonymous"),i.alt=o.name,i.src=n.url}},{key:"draw",value:function(n){var s=this,o=n.naturalWidth,i=n.naturalHeight,r=n.rotate,a=r===void 0?0:r,l=n.scaleX,u=l===void 0?1:l,c=n.scaleY,d=c===void 0?1:c,h=this.file,f=this.image,p=this.options,g=document.createElement("canvas"),v=g.getContext("2d"),C=Math.abs(a)%180===90,S=(p.resize==="contain"||p.resize==="cover")&&Pg(p.width)&&Pg(p.height),b=Math.max(p.maxWidth,0)||1/0,w=Math.max(p.maxHeight,0)||1/0,_=Math.max(p.minWidth,0)||0,R=Math.max(p.minHeight,0)||0,T=o/i,I=p.width,x=p.height;if(C){var P=[w,b];b=P[0],w=P[1];var D=[R,_];_=D[0],R=D[1];var F=[x,I];I=F[0],x=F[1]}S&&(T=I/x);var k=_h({aspectRatio:T,width:b,height:w},"contain");b=k.width,w=k.height;var O=_h({aspectRatio:T,width:_,height:R},"cover");if(_=O.width,R=O.height,S){var $=_h({aspectRatio:T,width:I,height:x},p.resize);I=$.width,x=$.height}else{var q=_h({aspectRatio:T,width:I,height:x}),J=q.width;I=J===void 0?o:J;var ee=q.height;x=ee===void 0?i:ee}I=Math.floor(L1(Math.min(Math.max(I,_),b))),x=Math.floor(L1(Math.min(Math.max(x,R),w)));var X=-I/2,ve=-x/2,te=I,N=x,V=[];if(S){var ne=0,ie=0,pe=o,ae=i,re=_h({aspectRatio:T,width:o,height:i},{contain:"cover",cover:"contain"}[p.resize]);pe=re.width,ae=re.height,ne=(o-pe)/2,ie=(i-ae)/2,V.push(ne,ie,pe,ae)}if(V.push(X,ve,te,N),C){var W=[x,I];I=W[0],x=W[1]}g.width=I,g.height=x,wC(p.mimeType)||(p.mimeType=h.type);var fe="transparent";h.size>p.convertSize&&p.convertTypes.indexOf(p.mimeType)>=0&&(p.mimeType="image/jpeg");var oe=p.mimeType==="image/jpeg";if(oe&&(fe="#fff"),v.fillStyle=fe,v.fillRect(0,0,I,x),p.beforeDraw&&p.beforeDraw.call(this,v,g),!this.aborted&&(v.save(),v.translate(I/2,x/2),v.rotate(a*Math.PI/180),v.scale(u,d),v.drawImage.apply(v,[f].concat(V)),v.restore(),p.drew&&p.drew.call(this,v,g),!this.aborted)){var Ie=function(Z){if(!s.aborted){var de=function(ye){return s.done({naturalWidth:o,naturalHeight:i,result:ye})};if(Z&&oe&&p.retainExif&&s.exif&&s.exif.length>0){var ke=function(ye){return de(k1(N1(Oz(ye,s.exif),p.mimeType)))};if(Z.arrayBuffer)Z.arrayBuffer().then(ke).catch(function(){s.fail(new Error("Failed to read the compressed image with Blob.arrayBuffer()."))});else{var Pe=new CC;s.reader=Pe,Pe.onload=function(Le){var ye=Le.target;ke(ye.result)},Pe.onabort=function(){s.fail(new Error("Aborted to read the compressed image with FileReader."))},Pe.onerror=function(){s.fail(new Error("Failed to read the compressed image with FileReader."))},Pe.onloadend=function(){s.reader=null},Pe.readAsArrayBuffer(Z)}}else de(Z)}};g.toBlob?g.toBlob(Ie,p.mimeType,p.quality):Ie(k1(g.toDataURL(p.mimeType,p.quality)))}}},{key:"done",value:function(n){var s=n.naturalWidth,o=n.naturalHeight,i=n.result,r=this.file,a=this.image,l=this.options;if(Vl&&a.src.indexOf("blob:")===0&&Vl.revokeObjectURL(a.src),i)if(l.strict&&!l.retainExif&&i.size>r.size&&l.mimeType===r.type&&!(l.width>s||l.height>o||l.minWidth>s||l.minHeight>o||l.maxWidth<s||l.maxHeight<o))i=r;else{var u=new Date;i.lastModified=u.getTime(),i.lastModifiedDate=u,i.name=r.name,i.name&&i.type!==r.type&&(i.name=i.name.replace(Nz,Tz(i.type)))}else i=r;this.result=i,l.success&&l.success.call(this,i)}},{key:"fail",value:function(n){var s=this.options;if(s.error)s.error.call(this,n);else throw n}},{key:"abort",value:function(){this.aborted||(this.aborted=!0,this.reader?this.reader.abort():this.image.complete?this.fail(new Error("The compression process has been aborted.")):(this.image.onload=null,this.image.onabort()))}}],[{key:"noConflict",value:function(){return window.Compressor=Lz,e}},{key:"setDefaults",value:function(n){Fg(O1,n)}}]),e}(),V1=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Bz(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var B1={exports:{}};(function(e,t){(function(n,s){e.exports=s()})(V1,function(){var n=function(m,y){return(n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(E,A){E.__proto__=A}||function(E,A){for(var L in A)Object.prototype.hasOwnProperty.call(A,L)&&(E[L]=A[L])})(m,y)},s=function(){return(s=Object.assign||function(m){for(var y,E=1,A=arguments.length;E<A;E++)for(var L in y=arguments[E])Object.prototype.hasOwnProperty.call(y,L)&&(m[L]=y[L]);return m}).apply(this,arguments)};function o(m,y,E){for(var A,L=0,z=y.length;L<z;L++)!A&&L in y||((A=A||Array.prototype.slice.call(y,0,L))[L]=y[L]);return m.concat(A||Array.prototype.slice.call(y))}var i=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:V1,r=Object.keys,a=Array.isArray;function l(m,y){return typeof y!="object"||r(y).forEach(function(E){m[E]=y[E]}),m}typeof Promise>"u"||i.Promise||(i.Promise=Promise);var u=Object.getPrototypeOf,c={}.hasOwnProperty;function d(m,y){return c.call(m,y)}function h(m,y){typeof y=="function"&&(y=y(u(m))),(typeof Reflect>"u"?r:Reflect.ownKeys)(y).forEach(function(E){p(m,E,y[E])})}var f=Object.defineProperty;function p(m,y,E,A){f(m,y,l(E&&d(E,"get")&&typeof E.get=="function"?{get:E.get,set:E.set,configurable:!0}:{value:E,configurable:!0,writable:!0},A))}function g(m){return{from:function(y){return m.prototype=Object.create(y.prototype),p(m.prototype,"constructor",m),{extend:h.bind(null,m.prototype)}}}}var v=Object.getOwnPropertyDescriptor,C=[].slice;function S(m,y,E){return C.call(m,y,E)}function b(m,y){return y(m)}function w(m){if(!m)throw new Error("Assertion Failed")}function _(m){i.setImmediate?setImmediate(m):setTimeout(m,0)}function R(m,y){if(typeof y=="string"&&d(m,y))return m[y];if(!y)return m;if(typeof y!="string"){for(var E=[],A=0,L=y.length;A<L;++A){var z=R(m,y[A]);E.push(z)}return E}var se=y.indexOf(".");if(se!==-1){var ue=m[y.substr(0,se)];return ue==null?void 0:R(ue,y.substr(se+1))}}function T(m,y,E){if(m&&y!==void 0&&!("isFrozen"in Object&&Object.isFrozen(m)))if(typeof y!="string"&&"length"in y){w(typeof E!="string"&&"length"in E);for(var A=0,L=y.length;A<L;++A)T(m,y[A],E[A])}else{var z,se,ue=y.indexOf(".");ue!==-1?(z=y.substr(0,ue),(se=y.substr(ue+1))===""?E===void 0?a(m)&&!isNaN(parseInt(z))?m.splice(z,1):delete m[z]:m[z]=E:T(ue=!(ue=m[z])||!d(m,z)?m[z]={}:ue,se,E)):E===void 0?a(m)&&!isNaN(parseInt(y))?m.splice(y,1):delete m[y]:m[y]=E}}function I(m){var y,E={};for(y in m)d(m,y)&&(E[y]=m[y]);return E}var x=[].concat;function P(m){return x.apply([],m)}var wa="BigUint64Array,BigInt64Array,Array,Boolean,String,Date,RegExp,Blob,File,FileList,FileSystemFileHandle,FileSystemDirectoryHandle,ArrayBuffer,DataView,Uint8ClampedArray,ImageBitmap,ImageData,Map,Set,CryptoKey".split(",").concat(P([8,16,32,64].map(function(m){return["Int","Uint","Float"].map(function(y){return y+m+"Array"})}))).filter(function(m){return i[m]}),D=new Set(wa.map(function(m){return i[m]})),F=null;function k(m){return F=new WeakMap,m=function y(E){if(!E||typeof E!="object")return E;var A=F.get(E);if(A)return A;if(a(E)){A=[],F.set(E,A);for(var L=0,z=E.length;L<z;++L)A.push(y(E[L]))}else if(D.has(E.constructor))A=E;else{var se,ue=u(E);for(se in A=ue===Object.prototype?{}:Object.create(ue),F.set(E,A),E)d(E,se)&&(A[se]=y(E[se]))}return A}(m),F=null,m}var O={}.toString;function $(m){return O.call(m).slice(8,-1)}var q=typeof Symbol<"u"?Symbol.iterator:"@@iterator",J=typeof q=="symbol"?function(m){var y;return m!=null&&(y=m[q])&&y.apply(m)}:function(){return null};function ee(m,y){return y=m.indexOf(y),0<=y&&m.splice(y,1),0<=y}var X={};function ve(m){var y,E,A,L;if(arguments.length===1){if(a(m))return m.slice();if(this===X&&typeof m=="string")return[m];if(L=J(m)){for(E=[];!(A=L.next()).done;)E.push(A.value);return E}if(m==null)return[m];if(typeof(y=m.length)!="number")return[m];for(E=new Array(y);y--;)E[y]=m[y];return E}for(y=arguments.length,E=new Array(y);y--;)E[y]=arguments[y];return E}var te=typeof Symbol<"u"?function(m){return m[Symbol.toStringTag]==="AsyncFunction"}:function(){return!1},ze=["Unknown","Constraint","Data","TransactionInactive","ReadOnly","Version","NotFound","InvalidState","InvalidAccess","Abort","Timeout","QuotaExceeded","Syntax","DataClone"],mi=["Modify","Bulk","OpenFailed","VersionChange","Schema","Upgrade","InvalidTable","MissingAPI","NoSuchDatabase","InvalidArgument","SubTransaction","Unsupported","Internal","DatabaseClosed","PrematureCommit","ForeignAwait"].concat(ze),N={VersionChanged:"Database version changed by other database connection",DatabaseClosed:"Database has been closed",Abort:"Transaction aborted",TransactionInactive:"Transaction has already completed or failed",MissingAPI:"IndexedDB API missing. Please visit https://tinyurl.com/y2uuvskb"};function V(m,y){this.name=m,this.message=y}function ne(m,y){return m+". Errors: "+Object.keys(y).map(function(E){return y[E].toString()}).filter(function(E,A,L){return L.indexOf(E)===A}).join(`
|
|
112
112
|
`)}function ie(m,y,E,A){this.failures=y,this.failedKeys=A,this.successCount=E,this.message=ne(m,y)}function pe(m,y){this.name="BulkError",this.failures=Object.keys(y).map(function(E){return y[E]}),this.failuresByPos=y,this.message=ne(m,this.failures)}g(V).from(Error).extend({toString:function(){return this.name+": "+this.message}}),g(ie).from(V),g(pe).from(V);var ae=mi.reduce(function(m,y){return m[y]=y+"Error",m},{}),re=V,W=mi.reduce(function(m,y){var E=y+"Error";function A(L,z){this.name=E,L?typeof L=="string"?(this.message="".concat(L).concat(z?`
|
|
113
|
-
`+z:""),this.inner=z||null):typeof L=="object"&&(this.message="".concat(L.name," ").concat(L.message),this.inner=L):(this.message=N[y]||E,this.inner=null)}return g(A).from(re),m[y]=A,m},{});W.Syntax=SyntaxError,W.Type=TypeError,W.Range=RangeError;var fe=ze.reduce(function(m,y){return m[y+"Error"]=W[y],m},{}),oe=mi.reduce(function(m,y){return["Syntax","Type","Range"].indexOf(y)===-1&&(m[y+"Error"]=W[y]),m},{});function Ie(){}function G(m){return m}function Z(m,y){return m==null||m===G?y:function(E){return y(m(E))}}function de(m,y){return function(){m.apply(this,arguments),y.apply(this,arguments)}}function ke(m,y){return m===Ie?y:function(){var E=m.apply(this,arguments);E!==void 0&&(arguments[0]=E);var A=this.onsuccess,L=this.onerror;this.onsuccess=null,this.onerror=null;var z=y.apply(this,arguments);return A&&(this.onsuccess=this.onsuccess?de(A,this.onsuccess):A),L&&(this.onerror=this.onerror?de(L,this.onerror):L),z!==void 0?z:E}}function Pe(m,y){return m===Ie?y:function(){m.apply(this,arguments);var E=this.onsuccess,A=this.onerror;this.onsuccess=this.onerror=null,y.apply(this,arguments),E&&(this.onsuccess=this.onsuccess?de(E,this.onsuccess):E),A&&(this.onerror=this.onerror?de(A,this.onerror):A)}}function Le(m,y){return m===Ie?y:function(E){var A=m.apply(this,arguments);l(E,A);var L=this.onsuccess,z=this.onerror;return this.onsuccess=null,this.onerror=null,E=y.apply(this,arguments),L&&(this.onsuccess=this.onsuccess?de(L,this.onsuccess):L),z&&(this.onerror=this.onerror?de(z,this.onerror):z),A===void 0?E===void 0?void 0:E:l(A,E)}}function ye(m,y){return m===Ie?y:function(){return y.apply(this,arguments)!==!1&&m.apply(this,arguments)}}function M(m,y){return m===Ie?y:function(){var E=m.apply(this,arguments);if(E&&typeof E.then=="function"){for(var A=this,L=arguments.length,z=new Array(L);L--;)z[L]=arguments[L];return E.then(function(){return y.apply(A,z)})}return y.apply(this,arguments)}}oe.ModifyError=ie,oe.DexieError=V,oe.BulkError=pe;var H=typeof location<"u"&&/^(http|https):\/\/(localhost|127\.0\.0\.1)/.test(location.href);function le(m){H=m}var Ge={},we=100,wa=typeof Promise>"u"?[]:function(){var m=Promise.resolve();if(typeof crypto>"u"||!crypto.subtle)return[m,u(m),m];var y=crypto.subtle.digest("SHA-512",new Uint8Array([0]));return[y,u(y),m]}(),ze=wa[0],mi=wa[1],wa=wa[2],mi=mi&&mi.then,Ue=ze&&ze.constructor,Se=!!wa,Ve=function(m,y){yt.push([m,y]),At&&(queueMicrotask(Ir),At=!1)},pt=!0,At=!0,Ut=[],Jt=[],zt=G,Ne={id:"global",global:!0,ref:0,unhandleds:[],onunhandled:Ie,pgp:!1,env:{},finalize:Ie},je=Ne,yt=[],Ot=0,Wt=[];function st(m){if(typeof this!="object")throw new TypeError("Promises must be constructed via new");this._listeners=[],this._lib=!1;var y=this._PSD=je;if(typeof m!="function"){if(m!==Ge)throw new TypeError("Not a function");return this._state=arguments[1],this._value=arguments[2],void(this._state===!1&&pl(this,this._value))}this._state=null,this._value=null,++y.ref,function E(A,L){try{L(function(z){if(A._state===null){if(z===A)throw new TypeError("A promise cannot be resolved with itself.");var se=A._lib&&xr();z&&typeof z.then=="function"?E(A,function(ue,Ce){z instanceof st?z._then(ue,Ce):z.then(ue,Ce)}):(A._state=!0,A._value=z,wo(A)),se&&pi()}},pl.bind(null,A))}catch(z){pl(A,z)}}(this,m)}var ps={get:function(){var m=je,y=Od;function E(A,L){var z=this,se=!m.global&&(m!==je||y!==Od),ue=se&&!jt(),Ce=new st(function(_e,Te){va(z,new Ui(Pr(A,m,se,ue),Pr(L,m,se,ue),_e,Te,m))});return this._consoleTask&&(Ce._consoleTask=this._consoleTask),Ce}return E.prototype=Ge,E},set:function(m){p(this,"then",m&&m.prototype===Ge?ps:{get:function(){return m},set:ps.set})}};function Ui(m,y,E,A,L){this.onFulfilled=typeof m=="function"?m:null,this.onRejected=typeof y=="function"?y:null,this.resolve=E,this.reject=A,this.psd=L}function pl(m,y){var E,A;Jt.push(y),m._state===null&&(E=m._lib&&xr(),y=zt(y),m._state=!1,m._value=y,A=m,Ut.some(function(L){return L._value===A._value})||Ut.push(A),wo(m),E&&pi())}function wo(m){var y=m._listeners;m._listeners=[];for(var E=0,A=y.length;E<A;++E)va(m,y[E]);var L=m._PSD;--L.ref||L.finalize(),Ot===0&&(++Ot,Ve(function(){--Ot==0&&Fr()},[]))}function va(m,y){if(m._state!==null){var E=m._state?y.onFulfilled:y.onRejected;if(E===null)return(m._state?y.resolve:y.reject)(m._value);++y.psd.ref,++Ot,Ve(gl,[E,m,y])}else m._listeners.push(y)}function gl(m,y,E){try{var A,L=y._value;!y._state&&Jt.length&&(Jt=[]),A=H&&y._consoleTask?y._consoleTask.run(function(){return m(L)}):m(L),y._state||Jt.indexOf(L)!==-1||function(z){for(var se=Ut.length;se;)if(Ut[--se]._value===z._value)return Ut.splice(se,1)}(y),E.resolve(A)}catch(z){E.reject(z)}finally{--Ot==0&&Fr(),--E.psd.ref||E.psd.finalize()}}function Ir(){Co(Ne,function(){xr()&&pi()})}function xr(){var m=pt;return At=pt=!1,m}function pi(){var m,y,E;do for(;0<yt.length;)for(m=yt,yt=[],E=m.length,y=0;y<E;++y){var A=m[y];A[0].apply(null,A[1])}while(0<yt.length);At=pt=!0}function Fr(){var m=Ut;Ut=[],m.forEach(function(A){A._PSD.onunhandled.call(null,A._value,A)});for(var y=Wt.slice(0),E=y.length;E;)y[--E]()}function Au(m){return new st(Ge,!1,m)}function kn(m,y){var E=je;return function(){var A=xr(),L=je;try{return js(E,!0),m.apply(this,arguments)}catch(z){y&&y(z)}finally{js(L,!1),A&&pi()}}}h(st.prototype,{then:ps,_then:function(m,y){va(this,new Ui(null,null,m,y,je))},catch:function(m){if(arguments.length===1)return this.then(null,m);var y=m,E=arguments[1];return typeof y=="function"?this.then(null,function(A){return(A instanceof y?E:Au)(A)}):this.then(null,function(A){return(A&&A.name===y?E:Au)(A)})},finally:function(m){return this.then(function(y){return st.resolve(m()).then(function(){return y})},function(y){return st.resolve(m()).then(function(){return Au(y)})})},timeout:function(m,y){var E=this;return m<1/0?new st(function(A,L){var z=setTimeout(function(){return L(new W.Timeout(y))},m);E.then(A,L).finally(clearTimeout.bind(null,z))}):this}}),typeof Symbol<"u"&&Symbol.toStringTag&&p(st.prototype,Symbol.toStringTag,"Dexie.Promise"),Ne.env=ku(),h(st,{all:function(){var m=ve.apply(null,arguments).map(sn);return new st(function(y,E){m.length===0&&y([]);var A=m.length;m.forEach(function(L,z){return st.resolve(L).then(function(se){m[z]=se,--A||y(m)},E)})})},resolve:function(m){return m instanceof st?m:m&&typeof m.then=="function"?new st(function(y,E){m.then(y,E)}):new st(Ge,!0,m)},reject:Au,race:function(){var m=ve.apply(null,arguments).map(sn);return new st(function(y,E){m.map(function(A){return st.resolve(A).then(y,E)})})},PSD:{get:function(){return je},set:function(m){return je=m}},totalEchoes:{get:function(){return Od}},newPSD:Ae,usePSD:Co,scheduler:{get:function(){return Ve},set:function(m){Ve=m}},rejectionMapper:{get:function(){return zt},set:function(m){zt=m}},follow:function(m,y){return new st(function(E,A){return Ae(function(L,z){var se=je;se.unhandleds=[],se.onunhandled=z,se.finalize=de(function(){var ue,Ce=this;ue=function(){Ce.unhandleds.length===0?L():z(Ce.unhandleds[0])},Wt.push(function _e(){ue(),Wt.splice(Wt.indexOf(_e),1)}),++Ot,Ve(function(){--Ot==0&&Fr()},[])},se.finalize),m()},y,E,A)})}}),Ue&&(Ue.allSettled&&p(st,"allSettled",function(){var m=ve.apply(null,arguments).map(sn);return new st(function(y){m.length===0&&y([]);var E=m.length,A=new Array(E);m.forEach(function(L,z){return st.resolve(L).then(function(se){return A[z]={status:"fulfilled",value:se}},function(se){return A[z]={status:"rejected",reason:se}}).then(function(){return--E||y(A)})})})}),Ue.any&&typeof AggregateError<"u"&&p(st,"any",function(){var m=ve.apply(null,arguments).map(sn);return new st(function(y,E){m.length===0&&E(new AggregateError([]));var A=m.length,L=new Array(A);m.forEach(function(z,se){return st.resolve(z).then(function(ue){return y(ue)},function(ue){L[se]=ue,--A||E(new AggregateError(L))})})})}),Ue.withResolvers&&(st.withResolvers=Ue.withResolvers));var gs={awaits:0,echoes:0,id:0},__=0,Ad=[],kd=0,Od=0,R_=0;function Ae(m,y,E,A){var L=je,z=Object.create(L);return z.parent=L,z.ref=0,z.global=!1,z.id=++R_,Ne.env,z.env=Se?{Promise:st,PromiseProp:{value:st,configurable:!0,writable:!0},all:st.all,race:st.race,allSettled:st.allSettled,any:st.any,resolve:st.resolve,reject:st.reject}:{},y&&l(z,y),++L.ref,z.finalize=function(){--this.parent.ref||this.parent.finalize()},A=Co(z,m,E,A),z.ref===0&&z.finalize(),A}function Ye(){return gs.id||(gs.id=++__),++gs.awaits,gs.echoes+=we,gs.id}function jt(){return!!gs.awaits&&(--gs.awaits==0&&(gs.id=0),gs.echoes=gs.awaits*we,!0)}function sn(m){return gs.echoes&&m&&m.constructor===Ue?(Ye(),m.then(function(y){return jt(),y},function(y){return jt(),Kn(y)})):m}function Wi(){var m=Ad[Ad.length-1];Ad.pop(),js(m,!1)}function js(m,y){var E,A=je;(y?!gs.echoes||kd++&&m===je:!kd||--kd&&m===je)||queueMicrotask(y?(function(L){++Od,gs.echoes&&--gs.echoes!=0||(gs.echoes=gs.awaits=gs.id=0),Ad.push(je),js(L,!0)}).bind(null,m):Wi),m!==je&&(je=m,A===Ne&&(Ne.env=ku()),Se&&(E=Ne.env.Promise,y=m.env,(A.global||m.global)&&(Object.defineProperty(i,"Promise",y.PromiseProp),E.all=y.all,E.race=y.race,E.resolve=y.resolve,E.reject=y.reject,y.allSettled&&(E.allSettled=y.allSettled),y.any&&(E.any=y.any))))}function ku(){var m=i.Promise;return Se?{Promise:m,PromiseProp:Object.getOwnPropertyDescriptor(i,"Promise"),all:m.all,race:m.race,allSettled:m.allSettled,any:m.any,resolve:m.resolve,reject:m.reject}:{}}function Co(m,y,E,A,L){var z=je;try{return js(m,!0),y(E,A,L)}finally{js(z,!1)}}function Pr(m,y,E,A){return typeof m!="function"?m:function(){var L=je;E&&Ye(),js(y,!0);try{return m.apply(this,arguments)}finally{js(L,!1),A&&queueMicrotask(jt)}}}function Fy(m){Promise===Ue&&gs.echoes===0?kd===0?m():enqueueNativeMicroTask(m):setTimeout(m,0)}(""+mi).indexOf("[native code]")===-1&&(Ye=jt=Ie);var Kn=st.reject,ya="",gi="Invalid key provided. Keys must be of type string, number, Date or Array<string | number | Date>.",Ou="String expected.",Md=[],Py="__dbnames",D_="readonly",T_="readwrite";function Mu(m,y){return m?y?function(){return m.apply(this,arguments)&&y.apply(this,arguments)}:m:y}var VB={type:3,lower:-1/0,lowerOpen:!1,upper:[[]],upperOpen:!1};function Ay(m){return typeof m!="string"||/\./.test(m)?function(y){return y}:function(y){return y[m]===void 0&&m in y&&delete(y=k(y))[m],y}}function BB(){throw W.Type()}function ln(m,y){try{var E=$B(m),A=$B(y);if(E!==A)return E==="Array"?1:A==="Array"?-1:E==="binary"?1:A==="binary"?-1:E==="string"?1:A==="string"?-1:E==="Date"?1:A!=="Date"?NaN:-1;switch(E){case"number":case"Date":case"string":return y<m?1:m<y?-1:0;case"binary":return function(L,z){for(var se=L.length,ue=z.length,Ce=se<ue?se:ue,_e=0;_e<Ce;++_e)if(L[_e]!==z[_e])return L[_e]<z[_e]?-1:1;return se===ue?0:se<ue?-1:1}(HB(m),HB(y));case"Array":return function(L,z){for(var se=L.length,ue=z.length,Ce=se<ue?se:ue,_e=0;_e<Ce;++_e){var Te=ln(L[_e],z[_e]);if(Te!==0)return Te}return se===ue?0:se<ue?-1:1}(m,y)}}catch{}return NaN}function $B(m){var y=typeof m;return y!="object"?y:ArrayBuffer.isView(m)?"binary":(m=$(m),m==="ArrayBuffer"?"binary":m)}function HB(m){return m instanceof Uint8Array?m:ArrayBuffer.isView(m)?new Uint8Array(m.buffer,m.byteOffset,m.byteLength):new Uint8Array(m)}var GB=($n.prototype._trans=function(m,y,E){var A=this._tx||je.trans,L=this.name,z=H&&typeof console<"u"&&console.createTask&&console.createTask("Dexie: ".concat(m==="readonly"?"read":"write"," ").concat(this.name));function se(_e,Te,he){if(!he.schema[L])throw new W.NotFound("Table "+L+" not part of transaction");return y(he.idbtrans,he)}var ue=xr();try{var Ce=A&&A.db._novip===this.db._novip?A===je.trans?A._promise(m,se,E):Ae(function(){return A._promise(m,se,E)},{trans:A,transless:je.transless||je}):function _e(Te,he,Fe,be){if(Te.idbdb&&(Te._state.openComplete||je.letThrough||Te._vip)){var De=Te._createTransaction(he,Fe,Te._dbSchema);try{De.create(),Te._state.PR1398_maxLoop=3}catch(xe){return xe.name===ae.InvalidState&&Te.isOpen()&&0<--Te._state.PR1398_maxLoop?(console.warn("Dexie: Need to reopen db"),Te.close({disableAutoOpen:!1}),Te.open().then(function(){return _e(Te,he,Fe,be)})):Kn(xe)}return De._promise(he,function(xe,Re){return Ae(function(){return je.trans=De,be(xe,Re,De)})}).then(function(xe){if(he==="readwrite")try{De.idbtrans.commit()}catch{}return he==="readonly"?xe:De._completion.then(function(){return xe})})}if(Te._state.openComplete)return Kn(new W.DatabaseClosed(Te._state.dbOpenError));if(!Te._state.isBeingOpened){if(!Te._state.autoOpen)return Kn(new W.DatabaseClosed);Te.open().catch(Ie)}return Te._state.dbReadyPromise.then(function(){return _e(Te,he,Fe,be)})}(this.db,m,[this.name],se);return z&&(Ce._consoleTask=z,Ce=Ce.catch(function(_e){return console.trace(_e),Kn(_e)})),Ce}finally{ue&&pi()}},$n.prototype.get=function(m,y){var E=this;return m&&m.constructor===Object?this.where(m).first(y):m==null?Kn(new W.Type("Invalid argument to Table.get()")):this._trans("readonly",function(A){return E.core.get({trans:A,key:m}).then(function(L){return E.hook.reading.fire(L)})}).then(y)},$n.prototype.where=function(m){if(typeof m=="string")return new this.db.WhereClause(this,m);if(a(m))return new this.db.WhereClause(this,"[".concat(m.join("+"),"]"));var y=r(m);if(y.length===1)return this.where(y[0]).equals(m[y[0]]);var E=this.schema.indexes.concat(this.schema.primKey).filter(function(ue){if(ue.compound&&y.every(function(_e){return 0<=ue.keyPath.indexOf(_e)})){for(var Ce=0;Ce<y.length;++Ce)if(y.indexOf(ue.keyPath[Ce])===-1)return!1;return!0}return!1}).sort(function(ue,Ce){return ue.keyPath.length-Ce.keyPath.length})[0];if(E&&this.db._maxKey!==ya){var z=E.keyPath.slice(0,y.length);return this.where(z).equals(z.map(function(Ce){return m[Ce]}))}!E&&H&&console.warn("The query ".concat(JSON.stringify(m)," on ").concat(this.name," would benefit from a ")+"compound index [".concat(y.join("+"),"]"));var A=this.schema.idxByName;function L(ue,Ce){return ln(ue,Ce)===0}var se=y.reduce(function(he,Ce){var _e=he[0],Te=he[1],he=A[Ce],Fe=m[Ce];return[_e||he,_e||!he?Mu(Te,he&&he.multi?function(be){return be=R(be,Ce),a(be)&&be.some(function(De){return L(Fe,De)})}:function(be){return L(Fe,R(be,Ce))}):Te]},[null,null]),z=se[0],se=se[1];return z?this.where(z.name).equals(m[z.keyPath]).filter(se):E?this.filter(se):this.where(y).equals("")},$n.prototype.filter=function(m){return this.toCollection().and(m)},$n.prototype.count=function(m){return this.toCollection().count(m)},$n.prototype.offset=function(m){return this.toCollection().offset(m)},$n.prototype.limit=function(m){return this.toCollection().limit(m)},$n.prototype.each=function(m){return this.toCollection().each(m)},$n.prototype.toArray=function(m){return this.toCollection().toArray(m)},$n.prototype.toCollection=function(){return new this.db.Collection(new this.db.WhereClause(this))},$n.prototype.orderBy=function(m){return new this.db.Collection(new this.db.WhereClause(this,a(m)?"[".concat(m.join("+"),"]"):m))},$n.prototype.reverse=function(){return this.toCollection().reverse()},$n.prototype.mapToClass=function(m){var y,E=this.db,A=this.name;function L(){return y!==null&&y.apply(this,arguments)||this}(this.schema.mappedClass=m).prototype instanceof BB&&(function(Ce,_e){if(typeof _e!="function"&&_e!==null)throw new TypeError("Class extends value "+String(_e)+" is not a constructor or null");function Te(){this.constructor=Ce}n(Ce,_e),Ce.prototype=_e===null?Object.create(_e):(Te.prototype=_e.prototype,new Te)}(L,y=m),Object.defineProperty(L.prototype,"db",{get:function(){return E},enumerable:!1,configurable:!0}),L.prototype.table=function(){return A},m=L);for(var z=new Set,se=m.prototype;se;se=u(se))Object.getOwnPropertyNames(se).forEach(function(Ce){return z.add(Ce)});function ue(Ce){if(!Ce)return Ce;var _e,Te=Object.create(m.prototype);for(_e in Ce)if(!z.has(_e))try{Te[_e]=Ce[_e]}catch{}return Te}return this.schema.readHook&&this.hook.reading.unsubscribe(this.schema.readHook),this.schema.readHook=ue,this.hook("reading",ue),m},$n.prototype.defineClass=function(){return this.mapToClass(function(m){l(this,m)})},$n.prototype.add=function(m,y){var E=this,A=this.schema.primKey,L=A.auto,z=A.keyPath,se=m;return z&&L&&(se=Ay(z)(m)),this._trans("readwrite",function(ue){return E.core.mutate({trans:ue,type:"add",keys:y!=null?[y]:null,values:[se]})}).then(function(ue){return ue.numFailures?st.reject(ue.failures[0]):ue.lastResult}).then(function(ue){if(z)try{T(m,z,ue)}catch{}return ue})},$n.prototype.update=function(m,y){return typeof m!="object"||a(m)?this.where(":id").equals(m).modify(y):(m=R(m,this.schema.primKey.keyPath),m===void 0?Kn(new W.InvalidArgument("Given object does not contain its primary key")):this.where(":id").equals(m).modify(y))},$n.prototype.put=function(m,y){var E=this,A=this.schema.primKey,L=A.auto,z=A.keyPath,se=m;return z&&L&&(se=Ay(z)(m)),this._trans("readwrite",function(ue){return E.core.mutate({trans:ue,type:"put",values:[se],keys:y!=null?[y]:null})}).then(function(ue){return ue.numFailures?st.reject(ue.failures[0]):ue.lastResult}).then(function(ue){if(z)try{T(m,z,ue)}catch{}return ue})},$n.prototype.delete=function(m){var y=this;return this._trans("readwrite",function(E){return y.core.mutate({trans:E,type:"delete",keys:[m]})}).then(function(E){return E.numFailures?st.reject(E.failures[0]):void 0})},$n.prototype.clear=function(){var m=this;return this._trans("readwrite",function(y){return m.core.mutate({trans:y,type:"deleteRange",range:VB})}).then(function(y){return y.numFailures?st.reject(y.failures[0]):void 0})},$n.prototype.bulkGet=function(m){var y=this;return this._trans("readonly",function(E){return y.core.getMany({keys:m,trans:E}).then(function(A){return A.map(function(L){return y.hook.reading.fire(L)})})})},$n.prototype.bulkAdd=function(m,y,E){var A=this,L=Array.isArray(y)?y:void 0,z=(E=E||(L?void 0:y))?E.allKeys:void 0;return this._trans("readwrite",function(se){var _e=A.schema.primKey,ue=_e.auto,_e=_e.keyPath;if(_e&&L)throw new W.InvalidArgument("bulkAdd(): keys argument invalid on tables with inbound keys");if(L&&L.length!==m.length)throw new W.InvalidArgument("Arguments objects and keys must have the same length");var Ce=m.length,_e=_e&&ue?m.map(Ay(_e)):m;return A.core.mutate({trans:se,type:"add",keys:L,values:_e,wantResults:z}).then(function(De){var he=De.numFailures,Fe=De.results,be=De.lastResult,De=De.failures;if(he===0)return z?Fe:be;throw new pe("".concat(A.name,".bulkAdd(): ").concat(he," of ").concat(Ce," operations failed"),De)})})},$n.prototype.bulkPut=function(m,y,E){var A=this,L=Array.isArray(y)?y:void 0,z=(E=E||(L?void 0:y))?E.allKeys:void 0;return this._trans("readwrite",function(se){var _e=A.schema.primKey,ue=_e.auto,_e=_e.keyPath;if(_e&&L)throw new W.InvalidArgument("bulkPut(): keys argument invalid on tables with inbound keys");if(L&&L.length!==m.length)throw new W.InvalidArgument("Arguments objects and keys must have the same length");var Ce=m.length,_e=_e&&ue?m.map(Ay(_e)):m;return A.core.mutate({trans:se,type:"put",keys:L,values:_e,wantResults:z}).then(function(De){var he=De.numFailures,Fe=De.results,be=De.lastResult,De=De.failures;if(he===0)return z?Fe:be;throw new pe("".concat(A.name,".bulkPut(): ").concat(he," of ").concat(Ce," operations failed"),De)})})},$n.prototype.bulkUpdate=function(m){var y=this,E=this.core,A=m.map(function(se){return se.key}),L=m.map(function(se){return se.changes}),z=[];return this._trans("readwrite",function(se){return E.getMany({trans:se,keys:A,cache:"clone"}).then(function(ue){var Ce=[],_e=[];m.forEach(function(he,Fe){var be=he.key,De=he.changes,xe=ue[Fe];if(xe){for(var Re=0,Me=Object.keys(De);Re<Me.length;Re++){var $e=Me[Re],He=De[$e];if($e===y.schema.primKey.keyPath){if(ln(He,be)!==0)throw new W.Constraint("Cannot update primary key in bulkUpdate()")}else T(xe,$e,He)}z.push(Fe),Ce.push(be),_e.push(xe)}});var Te=Ce.length;return E.mutate({trans:se,type:"put",keys:Ce,values:_e,updates:{keys:A,changeSpecs:L}}).then(function(he){var Fe=he.numFailures,be=he.failures;if(Fe===0)return Te;for(var De=0,xe=Object.keys(be);De<xe.length;De++){var Re,Me=xe[De],$e=z[Number(Me)];$e!=null&&(Re=be[Me],delete be[Me],be[$e]=Re)}throw new pe("".concat(y.name,".bulkUpdate(): ").concat(Fe," of ").concat(Te," operations failed"),be)})})})},$n.prototype.bulkDelete=function(m){var y=this,E=m.length;return this._trans("readwrite",function(A){return y.core.mutate({trans:A,type:"delete",keys:m})}).then(function(se){var L=se.numFailures,z=se.lastResult,se=se.failures;if(L===0)return z;throw new pe("".concat(y.name,".bulkDelete(): ").concat(L," of ").concat(E," operations failed"),se)})},$n);function $n(){}function yp(m){function y(se,ue){if(ue){for(var Ce=arguments.length,_e=new Array(Ce-1);--Ce;)_e[Ce-1]=arguments[Ce];return E[se].subscribe.apply(null,_e),m}if(typeof se=="string")return E[se]}var E={};y.addEventType=z;for(var A=1,L=arguments.length;A<L;++A)z(arguments[A]);return y;function z(se,ue,Ce){if(typeof se!="object"){var _e;ue=ue||ye;var Te={subscribers:[],fire:Ce=Ce||Ie,subscribe:function(he){Te.subscribers.indexOf(he)===-1&&(Te.subscribers.push(he),Te.fire=ue(Te.fire,he))},unsubscribe:function(he){Te.subscribers=Te.subscribers.filter(function(Fe){return Fe!==he}),Te.fire=Te.subscribers.reduce(ue,Ce)}};return E[se]=y[se]=Te}r(_e=se).forEach(function(he){var Fe=_e[he];if(a(Fe))z(he,_e[he][0],_e[he][1]);else{if(Fe!=="asap")throw new W.InvalidArgument("Invalid event config");var be=z(he,G,function(){for(var De=arguments.length,xe=new Array(De);De--;)xe[De]=arguments[De];be.subscribers.forEach(function(Re){_(function(){Re.apply(null,xe)})})})}})}}function wp(m,y){return g(y).from({prototype:m}),y}function Nd(m,y){return!(m.filter||m.algorithm||m.or)&&(y?m.justLimit:!m.replayFilter)}function I_(m,y){m.filter=Mu(m.filter,y)}function x_(m,y,E){var A=m.replayFilter;m.replayFilter=A?function(){return Mu(A(),y())}:y,m.justLimit=E&&!A}function ky(m,y){if(m.isPrimKey)return y.primaryKey;var E=y.getIndexByKeyPath(m.index);if(!E)throw new W.Schema("KeyPath "+m.index+" on object store "+y.name+" is not indexed");return E}function UB(m,y,E){var A=ky(m,y.schema);return y.openCursor({trans:E,values:!m.keysOnly,reverse:m.dir==="prev",unique:!!m.unique,query:{index:A,range:m.range}})}function Oy(m,y,E,A){var L=m.replayFilter?Mu(m.filter,m.replayFilter()):m.filter;if(m.or){var z={},se=function(ue,Ce,_e){var Te,he;L&&!L(Ce,_e,function(Fe){return Ce.stop(Fe)},function(Fe){return Ce.fail(Fe)})||((he=""+(Te=Ce.primaryKey))=="[object ArrayBuffer]"&&(he=""+new Uint8Array(Te)),d(z,he)||(z[he]=!0,y(ue,Ce,_e)))};return Promise.all([m.or._iterate(se,E),WB(UB(m,A,E),m.algorithm,se,!m.keysOnly&&m.valueMapper)])}return WB(UB(m,A,E),Mu(m.algorithm,L),y,!m.keysOnly&&m.valueMapper)}function WB(m,y,E,A){var L=kn(A?function(z,se,ue){return E(A(z),se,ue)}:E);return m.then(function(z){if(z)return z.start(function(){var se=function(){return z.continue()};y&&!y(z,function(ue){return se=ue},function(ue){z.stop(ue),se=Ie},function(ue){z.fail(ue),se=Ie})||L(z.value,z,function(ue){return se=ue}),se()})})}var wa=Symbol(),Cp=(zB.prototype.execute=function(m){if(this.add!==void 0){var y=this.add;if(a(y))return o(o([],a(m)?m:[],!0),y).sort();if(typeof y=="number")return(Number(m)||0)+y;if(typeof y=="bigint")try{return BigInt(m)+y}catch{return BigInt(0)+y}throw new TypeError("Invalid term ".concat(y))}if(this.remove!==void 0){var E=this.remove;if(a(E))return a(m)?m.filter(function(A){return!E.includes(A)}).sort():[];if(typeof E=="number")return Number(m)-E;if(typeof E=="bigint")try{return BigInt(m)-E}catch{return BigInt(0)-E}throw new TypeError("Invalid subtrahend ".concat(E))}return y=(y=this.replacePrefix)===null||y===void 0?void 0:y[0],y&&typeof m=="string"&&m.startsWith(y)?this.replacePrefix[1]+m.substring(y.length):m},zB);function zB(m){Object.assign(this,m)}var sbe=(mn.prototype._read=function(m,y){var E=this._ctx;return E.error?E.table._trans(null,Kn.bind(null,E.error)):E.table._trans("readonly",m).then(y)},mn.prototype._write=function(m){var y=this._ctx;return y.error?y.table._trans(null,Kn.bind(null,y.error)):y.table._trans("readwrite",m,"locked")},mn.prototype._addAlgorithm=function(m){var y=this._ctx;y.algorithm=Mu(y.algorithm,m)},mn.prototype._iterate=function(m,y){return Oy(this._ctx,m,y,this._ctx.table.core)},mn.prototype.clone=function(m){var y=Object.create(this.constructor.prototype),E=Object.create(this._ctx);return m&&l(E,m),y._ctx=E,y},mn.prototype.raw=function(){return this._ctx.valueMapper=null,this},mn.prototype.each=function(m){var y=this._ctx;return this._read(function(E){return Oy(y,m,E,y.table.core)})},mn.prototype.count=function(m){var y=this;return this._read(function(E){var A=y._ctx,L=A.table.core;if(Nd(A,!0))return L.count({trans:E,query:{index:ky(A,L.schema),range:A.range}}).then(function(se){return Math.min(se,A.limit)});var z=0;return Oy(A,function(){return++z,!1},E,L).then(function(){return z})}).then(m)},mn.prototype.sortBy=function(m,y){var E=m.split(".").reverse(),A=E[0],L=E.length-1;function z(Ce,_e){return _e?z(Ce[E[_e]],_e-1):Ce[A]}var se=this._ctx.dir==="next"?1:-1;function ue(Ce,_e){return ln(z(Ce,L),z(_e,L))*se}return this.toArray(function(Ce){return Ce.sort(ue)}).then(y)},mn.prototype.toArray=function(m){var y=this;return this._read(function(E){var A=y._ctx;if(A.dir==="next"&&Nd(A,!0)&&0<A.limit){var L=A.valueMapper,z=ky(A,A.table.core.schema);return A.table.core.query({trans:E,limit:A.limit,values:!0,query:{index:z,range:A.range}}).then(function(ue){return ue=ue.result,L?ue.map(L):ue})}var se=[];return Oy(A,function(ue){return se.push(ue)},E,A.table.core).then(function(){return se})},m)},mn.prototype.offset=function(m){var y=this._ctx;return m<=0||(y.offset+=m,Nd(y)?x_(y,function(){var E=m;return function(A,L){return E===0||(E===1?--E:L(function(){A.advance(E),E=0}),!1)}}):x_(y,function(){var E=m;return function(){return--E<0}})),this},mn.prototype.limit=function(m){return this._ctx.limit=Math.min(this._ctx.limit,m),x_(this._ctx,function(){var y=m;return function(E,A,L){return--y<=0&&A(L),0<=y}},!0),this},mn.prototype.until=function(m,y){return I_(this._ctx,function(E,A,L){return!m(E.value)||(A(L),y)}),this},mn.prototype.first=function(m){return this.limit(1).toArray(function(y){return y[0]}).then(m)},mn.prototype.last=function(m){return this.reverse().first(m)},mn.prototype.filter=function(m){var y;return I_(this._ctx,function(E){return m(E.value)}),(y=this._ctx).isMatch=Mu(y.isMatch,m),this},mn.prototype.and=function(m){return this.filter(m)},mn.prototype.or=function(m){return new this.db.WhereClause(this._ctx.table,m,this)},mn.prototype.reverse=function(){return this._ctx.dir=this._ctx.dir==="prev"?"next":"prev",this._ondirectionchange&&this._ondirectionchange(this._ctx.dir),this},mn.prototype.desc=function(){return this.reverse()},mn.prototype.eachKey=function(m){var y=this._ctx;return y.keysOnly=!y.isMatch,this.each(function(E,A){m(A.key,A)})},mn.prototype.eachUniqueKey=function(m){return this._ctx.unique="unique",this.eachKey(m)},mn.prototype.eachPrimaryKey=function(m){var y=this._ctx;return y.keysOnly=!y.isMatch,this.each(function(E,A){m(A.primaryKey,A)})},mn.prototype.keys=function(m){var y=this._ctx;y.keysOnly=!y.isMatch;var E=[];return this.each(function(A,L){E.push(L.key)}).then(function(){return E}).then(m)},mn.prototype.primaryKeys=function(m){var y=this._ctx;if(y.dir==="next"&&Nd(y,!0)&&0<y.limit)return this._read(function(A){var L=ky(y,y.table.core.schema);return y.table.core.query({trans:A,values:!1,limit:y.limit,query:{index:L,range:y.range}})}).then(function(A){return A.result}).then(m);y.keysOnly=!y.isMatch;var E=[];return this.each(function(A,L){E.push(L.primaryKey)}).then(function(){return E}).then(m)},mn.prototype.uniqueKeys=function(m){return this._ctx.unique="unique",this.keys(m)},mn.prototype.firstKey=function(m){return this.limit(1).keys(function(y){return y[0]}).then(m)},mn.prototype.lastKey=function(m){return this.reverse().firstKey(m)},mn.prototype.distinct=function(){var m=this._ctx,m=m.index&&m.table.schema.idxByName[m.index];if(!m||!m.multi)return this;var y={};return I_(this._ctx,function(L){var A=L.primaryKey.toString(),L=d(y,A);return y[A]=!0,!L}),this},mn.prototype.modify=function(m){var y=this,E=this._ctx;return this._write(function(A){var L,z,se;se=typeof m=="function"?m:(L=r(m),z=L.length,function(Re){for(var Me=!1,$e=0;$e<z;++$e){var He=L[$e],Ze=m[He],ot=R(Re,He);Ze instanceof Cp?(T(Re,He,Ze.execute(ot)),Me=!0):ot!==Ze&&(T(Re,He,Ze),Me=!0)}return Me});var ue=E.table.core,he=ue.schema.primaryKey,Ce=he.outbound,_e=he.extractKey,Te=200,he=y.db._options.modifyChunkSize;he&&(Te=typeof he=="object"?he[ue.name]||he["*"]||200:he);function Fe(Re,He){var $e=He.failures,He=He.numFailures;De+=Re-He;for(var Ze=0,ot=r($e);Ze<ot.length;Ze++){var gt=ot[Ze];be.push($e[gt])}}var be=[],De=0,xe=[];return y.clone().primaryKeys().then(function(Re){function Me(He){var Ze=Math.min(Te,Re.length-He);return ue.getMany({trans:A,keys:Re.slice(He,He+Ze),cache:"immutable"}).then(function(ot){for(var gt=[],it=[],at=Ce?[]:null,St=[],ht=0;ht<Ze;++ht){var Rt=ot[ht],Zt={value:k(Rt),primKey:Re[He+ht]};se.call(Zt,Zt.value,Zt)!==!1&&(Zt.value==null?St.push(Re[He+ht]):Ce||ln(_e(Rt),_e(Zt.value))===0?(it.push(Zt.value),Ce&&at.push(Re[He+ht])):(St.push(Re[He+ht]),gt.push(Zt.value)))}return Promise.resolve(0<gt.length&&ue.mutate({trans:A,type:"add",values:gt}).then(function(on){for(var rn in on.failures)St.splice(parseInt(rn),1);Fe(gt.length,on)})).then(function(){return(0<it.length||$e&&typeof m=="object")&&ue.mutate({trans:A,type:"put",keys:at,values:it,criteria:$e,changeSpec:typeof m!="function"&&m,isAdditionalChunk:0<He}).then(function(on){return Fe(it.length,on)})}).then(function(){return(0<St.length||$e&&m===F_)&&ue.mutate({trans:A,type:"delete",keys:St,criteria:$e,isAdditionalChunk:0<He}).then(function(on){return Fe(St.length,on)})}).then(function(){return Re.length>He+Ze&&Me(He+Te)})})}var $e=Nd(E)&&E.limit===1/0&&(typeof m!="function"||m===F_)&&{index:E.index,range:E.range};return Me(0).then(function(){if(0<be.length)throw new ie("Error modifying one or more objects",be,De,xe);return Re.length})})})},mn.prototype.delete=function(){var m=this._ctx,y=m.range;return Nd(m)&&(m.isPrimKey||y.type===3)?this._write(function(E){var A=m.table.core.schema.primaryKey,L=y;return m.table.core.count({trans:E,query:{index:A,range:L}}).then(function(z){return m.table.core.mutate({trans:E,type:"deleteRange",range:L}).then(function(se){var ue=se.failures;if(se.lastResult,se.results,se=se.numFailures,se)throw new ie("Could not delete some values",Object.keys(ue).map(function(Ce){return ue[Ce]}),z-se);return z-se})})}):this.modify(F_)},mn);function mn(){}var F_=function(m,y){return y.value=null};function obe(m,y){return m<y?-1:m===y?0:1}function ibe(m,y){return y<m?-1:m===y?0:1}function Uo(m,y,E){return m=m instanceof KB?new m.Collection(m):m,m._ctx.error=new(E||TypeError)(y),m}function Ld(m){return new m.Collection(m,function(){return jB("")}).limit(0)}function My(m,y,E,A){var L,z,se,ue,Ce,_e,Te,he=E.length;if(!E.every(function(De){return typeof De=="string"}))return Uo(m,Ou);function Fe(De){L=De==="next"?function(Re){return Re.toUpperCase()}:function(Re){return Re.toLowerCase()},z=De==="next"?function(Re){return Re.toLowerCase()}:function(Re){return Re.toUpperCase()},se=De==="next"?obe:ibe;var xe=E.map(function(Re){return{lower:z(Re),upper:L(Re)}}).sort(function(Re,Me){return se(Re.lower,Me.lower)});ue=xe.map(function(Re){return Re.upper}),Ce=xe.map(function(Re){return Re.lower}),Te=(_e=De)==="next"?"":A}Fe("next"),m=new m.Collection(m,function(){return ml(ue[0],Ce[he-1]+A)}),m._ondirectionchange=function(De){Fe(De)};var be=0;return m._addAlgorithm(function(De,xe,Re){var Me=De.key;if(typeof Me!="string")return!1;var $e=z(Me);if(y($e,Ce,be))return!0;for(var He=null,Ze=be;Ze<he;++Ze){var ot=function(gt,it,at,St,ht,Rt){for(var Zt=Math.min(gt.length,St.length),on=-1,rn=0;rn<Zt;++rn){var Wo=it[rn];if(Wo!==St[rn])return ht(gt[rn],at[rn])<0?gt.substr(0,rn)+at[rn]+at.substr(rn+1):ht(gt[rn],St[rn])<0?gt.substr(0,rn)+St[rn]+at.substr(rn+1):0<=on?gt.substr(0,on)+it[on]+at.substr(on+1):null;ht(gt[rn],Wo)<0&&(on=rn)}return Zt<St.length&&Rt==="next"?gt+at.substr(gt.length):Zt<gt.length&&Rt==="prev"?gt.substr(0,at.length):on<0?null:gt.substr(0,on)+St[on]+at.substr(on+1)}(Me,$e,ue[Ze],Ce[Ze],se,_e);ot===null&&He===null?be=Ze+1:(He===null||0<se(He,ot))&&(He=ot)}return xe(He!==null?function(){De.continue(He+Te)}:Re),!1}),m}function ml(m,y,E,A){return{type:2,lower:m,upper:y,lowerOpen:E,upperOpen:A}}function jB(m){return{type:1,lower:m,upper:m}}var KB=(Object.defineProperty(Is.prototype,"Collection",{get:function(){return this._ctx.table.db.Collection},enumerable:!1,configurable:!0}),Is.prototype.between=function(m,y,E,A){E=E!==!1,A=A===!0;try{return 0<this._cmp(m,y)||this._cmp(m,y)===0&&(E||A)&&(!E||!A)?Ld(this):new this.Collection(this,function(){return ml(m,y,!E,!A)})}catch{return Uo(this,gi)}},Is.prototype.equals=function(m){return m==null?Uo(this,gi):new this.Collection(this,function(){return jB(m)})},Is.prototype.above=function(m){return m==null?Uo(this,gi):new this.Collection(this,function(){return ml(m,void 0,!0)})},Is.prototype.aboveOrEqual=function(m){return m==null?Uo(this,gi):new this.Collection(this,function(){return ml(m,void 0,!1)})},Is.prototype.below=function(m){return m==null?Uo(this,gi):new this.Collection(this,function(){return ml(void 0,m,!1,!0)})},Is.prototype.belowOrEqual=function(m){return m==null?Uo(this,gi):new this.Collection(this,function(){return ml(void 0,m)})},Is.prototype.startsWith=function(m){return typeof m!="string"?Uo(this,Ou):this.between(m,m+ya,!0,!0)},Is.prototype.startsWithIgnoreCase=function(m){return m===""?this.startsWith(m):My(this,function(y,E){return y.indexOf(E[0])===0},[m],ya)},Is.prototype.equalsIgnoreCase=function(m){return My(this,function(y,E){return y===E[0]},[m],"")},Is.prototype.anyOfIgnoreCase=function(){var m=ve.apply(X,arguments);return m.length===0?Ld(this):My(this,function(y,E){return E.indexOf(y)!==-1},m,"")},Is.prototype.startsWithAnyOfIgnoreCase=function(){var m=ve.apply(X,arguments);return m.length===0?Ld(this):My(this,function(y,E){return E.some(function(A){return y.indexOf(A)===0})},m,ya)},Is.prototype.anyOf=function(){var m=this,y=ve.apply(X,arguments),E=this._cmp;try{y.sort(E)}catch{return Uo(this,gi)}if(y.length===0)return Ld(this);var A=new this.Collection(this,function(){return ml(y[0],y[y.length-1])});A._ondirectionchange=function(z){E=z==="next"?m._ascending:m._descending,y.sort(E)};var L=0;return A._addAlgorithm(function(z,se,ue){for(var Ce=z.key;0<E(Ce,y[L]);)if(++L===y.length)return se(ue),!1;return E(Ce,y[L])===0||(se(function(){z.continue(y[L])}),!1)}),A},Is.prototype.notEqual=function(m){return this.inAnyRange([[-1/0,m],[m,this.db._maxKey]],{includeLowers:!1,includeUppers:!1})},Is.prototype.noneOf=function(){var m=ve.apply(X,arguments);if(m.length===0)return new this.Collection(this);try{m.sort(this._ascending)}catch{return Uo(this,gi)}var y=m.reduce(function(E,A){return E?E.concat([[E[E.length-1][1],A]]):[[-1/0,A]]},null);return y.push([m[m.length-1],this.db._maxKey]),this.inAnyRange(y,{includeLowers:!1,includeUppers:!1})},Is.prototype.inAnyRange=function(Me,y){var E=this,A=this._cmp,L=this._ascending,z=this._descending,se=this._min,ue=this._max;if(Me.length===0)return Ld(this);if(!Me.every(function($e){return $e[0]!==void 0&&$e[1]!==void 0&&L($e[0],$e[1])<=0}))return Uo(this,"First argument to inAnyRange() must be an Array of two-value Arrays [lower,upper] where upper must not be lower than lower",W.InvalidArgument);var Ce=!y||y.includeLowers!==!1,_e=y&&y.includeUppers===!0,Te,he=L;function Fe($e,He){return he($e[0],He[0])}try{(Te=Me.reduce(function($e,He){for(var Ze=0,ot=$e.length;Ze<ot;++Ze){var gt=$e[Ze];if(A(He[0],gt[1])<0&&0<A(He[1],gt[0])){gt[0]=se(gt[0],He[0]),gt[1]=ue(gt[1],He[1]);break}}return Ze===ot&&$e.push(He),$e},[])).sort(Fe)}catch{return Uo(this,gi)}var be=0,De=_e?function($e){return 0<L($e,Te[be][1])}:function($e){return 0<=L($e,Te[be][1])},xe=Ce?function($e){return 0<z($e,Te[be][0])}:function($e){return 0<=z($e,Te[be][0])},Re=De,Me=new this.Collection(this,function(){return ml(Te[0][0],Te[Te.length-1][1],!Ce,!_e)});return Me._ondirectionchange=function($e){he=$e==="next"?(Re=De,L):(Re=xe,z),Te.sort(Fe)},Me._addAlgorithm(function($e,He,Ze){for(var ot,gt=$e.key;Re(gt);)if(++be===Te.length)return He(Ze),!1;return!De(ot=gt)&&!xe(ot)||(E._cmp(gt,Te[be][1])===0||E._cmp(gt,Te[be][0])===0||He(function(){he===L?$e.continue(Te[be][0]):$e.continue(Te[be][1])}),!1)}),Me},Is.prototype.startsWithAnyOf=function(){var m=ve.apply(X,arguments);return m.every(function(y){return typeof y=="string"})?m.length===0?Ld(this):this.inAnyRange(m.map(function(y){return[y,y+ya]})):Uo(this,"startsWithAnyOf() only works with strings")},Is);function Is(){}function Ar(m){return kn(function(y){return bp(y),m(y.target.error),!1})}function bp(m){m.stopPropagation&&m.stopPropagation(),m.preventDefault&&m.preventDefault()}var Sp="storagemutated",P_="x-storagemutated-1",vl=yp(null,Sp),rbe=(kr.prototype._lock=function(){return w(!je.global),++this._reculock,this._reculock!==1||je.global||(je.lockOwnerFor=this),this},kr.prototype._unlock=function(){if(w(!je.global),--this._reculock==0)for(je.global||(je.lockOwnerFor=null);0<this._blockedFuncs.length&&!this._locked();){var m=this._blockedFuncs.shift();try{Co(m[1],m[0])}catch{}}return this},kr.prototype._locked=function(){return this._reculock&&je.lockOwnerFor!==this},kr.prototype.create=function(m){var y=this;if(!this.mode)return this;var E=this.db.idbdb,A=this.db._state.dbOpenError;if(w(!this.idbtrans),!m&&!E)switch(A&&A.name){case"DatabaseClosedError":throw new W.DatabaseClosed(A);case"MissingAPIError":throw new W.MissingAPI(A.message,A);default:throw new W.OpenFailed(A)}if(!this.active)throw new W.TransactionInactive;return w(this._completion._state===null),(m=this.idbtrans=m||(this.db.core||E).transaction(this.storeNames,this.mode,{durability:this.chromeTransactionDurability})).onerror=kn(function(L){bp(L),y._reject(m.error)}),m.onabort=kn(function(L){bp(L),y.active&&y._reject(new W.Abort(m.error)),y.active=!1,y.on("abort").fire(L)}),m.oncomplete=kn(function(){y.active=!1,y._resolve(),"mutatedParts"in m&&vl.storagemutated.fire(m.mutatedParts)}),this},kr.prototype._promise=function(m,y,E){var A=this;if(m==="readwrite"&&this.mode!=="readwrite")return Kn(new W.ReadOnly("Transaction is readonly"));if(!this.active)return Kn(new W.TransactionInactive);if(this._locked())return new st(function(z,se){A._blockedFuncs.push([function(){A._promise(m,y,E).then(z,se)},je])});if(E)return Ae(function(){var z=new st(function(se,ue){A._lock();var Ce=y(se,ue,A);Ce&&Ce.then&&Ce.then(se,ue)});return z.finally(function(){return A._unlock()}),z._lib=!0,z});var L=new st(function(z,se){var ue=y(z,se,A);ue&&ue.then&&ue.then(z,se)});return L._lib=!0,L},kr.prototype._root=function(){return this.parent?this.parent._root():this},kr.prototype.waitFor=function(m){var y,E=this._root(),A=st.resolve(m);E._waitingFor?E._waitingFor=E._waitingFor.then(function(){return A}):(E._waitingFor=A,E._waitingQueue=[],y=E.idbtrans.objectStore(E.storeNames[0]),function z(){for(++E._spinCount;E._waitingQueue.length;)E._waitingQueue.shift()();E._waitingFor&&(y.get(-1/0).onsuccess=z)}());var L=E._waitingFor;return new st(function(z,se){A.then(function(ue){return E._waitingQueue.push(kn(z.bind(null,ue)))},function(ue){return E._waitingQueue.push(kn(se.bind(null,ue)))}).finally(function(){E._waitingFor===L&&(E._waitingFor=null)})})},kr.prototype.abort=function(){this.active&&(this.active=!1,this.idbtrans&&this.idbtrans.abort(),this._reject(new W.Abort))},kr.prototype.table=function(m){var y=this._memoizedTables||(this._memoizedTables={});if(d(y,m))return y[m];var E=this.schema[m];if(!E)throw new W.NotFound("Table "+m+" not part of transaction");return E=new this.db.Table(m,E,this),E.core=this.db.core.table(m),y[m]=E},kr);function kr(){}function A_(m,y,E,A,L,z,se){return{name:m,keyPath:y,unique:E,multi:A,auto:L,compound:z,src:(E&&!se?"&":"")+(A?"*":"")+(L?"++":"")+qB(y)}}function qB(m){return typeof m=="string"?m:m?"["+[].join.call(m,"+")+"]":""}function k_(m,y,E){return{name:m,primKey:y,indexes:E,mappedClass:null,idxByName:(A=function(L){return[L.name,L]},E.reduce(function(L,z,se){return se=A(z,se),se&&(L[se[0]]=se[1]),L},{}))};var A}var Ep=function(m){try{return m.only([[]]),Ep=function(){return[[]]},[[]]}catch{return Ep=function(){return ya},ya}};function O_(m){return m==null?function(){}:typeof m=="string"?(y=m).split(".").length===1?function(E){return E[y]}:function(E){return R(E,y)}:function(E){return R(E,m)};var y}function YB(m){return[].slice.call(m)}var abe=0;function _p(m){return m==null?":id":typeof m=="string"?m:"[".concat(m.join("+"),"]")}function lbe(m,y,Ce){function A(Re){if(Re.type===3)return null;if(Re.type===4)throw new Error("Cannot convert never type to IDBKeyRange");var be=Re.lower,De=Re.upper,xe=Re.lowerOpen,Re=Re.upperOpen;return be===void 0?De===void 0?null:y.upperBound(De,!!Re):De===void 0?y.lowerBound(be,!!xe):y.bound(be,De,!!xe,!!Re)}function L(Fe){var be,De=Fe.name;return{name:De,schema:Fe,mutate:function(xe){var Re=xe.trans,Me=xe.type,$e=xe.keys,He=xe.values,Ze=xe.range;return new Promise(function(ot,gt){ot=kn(ot);var it=Re.objectStore(De),at=it.keyPath==null,St=Me==="put"||Me==="add";if(!St&&Me!=="delete"&&Me!=="deleteRange")throw new Error("Invalid operation type: "+Me);var ht,Rt=($e||He||{length:1}).length;if($e&&He&&$e.length!==He.length)throw new Error("Given keys array must have same length as given values array.");if(Rt===0)return ot({numFailures:0,failures:{},results:[],lastResult:void 0});function Zt(oo){++Wo,bp(oo)}var on=[],rn=[],Wo=0;if(Me==="deleteRange"){if(Ze.type===4)return ot({numFailures:Wo,failures:rn,results:[],lastResult:void 0});Ze.type===3?on.push(ht=it.clear()):on.push(ht=it.delete(A(Ze)))}else{var at=St?at?[He,$e]:[He,null]:[$e,null],Kt=at[0],qs=at[1];if(St)for(var Ys=0;Ys<Rt;++Ys)on.push(ht=qs&&qs[Ys]!==void 0?it[Me](Kt[Ys],qs[Ys]):it[Me](Kt[Ys])),ht.onerror=Zt;else for(Ys=0;Ys<Rt;++Ys)on.push(ht=it[Me](Kt[Ys])),ht.onerror=Zt}function qy(oo){oo=oo.target.result,on.forEach(function(Vu,J_){return Vu.error!=null&&(rn[J_]=Vu.error)}),ot({numFailures:Wo,failures:rn,results:Me==="delete"?$e:on.map(function(Vu){return Vu.result}),lastResult:oo})}ht.onerror=function(oo){Zt(oo),qy(oo)},ht.onsuccess=qy})},getMany:function(xe){var Re=xe.trans,Me=xe.keys;return new Promise(function($e,He){$e=kn($e);for(var Ze,ot=Re.objectStore(De),gt=Me.length,it=new Array(gt),at=0,St=0,ht=function(on){on=on.target,it[on._pos]=on.result,++St===at&&$e(it)},Rt=Ar(He),Zt=0;Zt<gt;++Zt)Me[Zt]!=null&&((Ze=ot.get(Me[Zt]))._pos=Zt,Ze.onsuccess=ht,Ze.onerror=Rt,++at);at===0&&$e(it)})},get:function(xe){var Re=xe.trans,Me=xe.key;return new Promise(function($e,He){$e=kn($e);var Ze=Re.objectStore(De).get(Me);Ze.onsuccess=function(ot){return $e(ot.target.result)},Ze.onerror=Ar(He)})},query:(be=_e,function(xe){return new Promise(function(Re,Me){Re=kn(Re);var $e,He,Ze,at=xe.trans,ot=xe.values,gt=xe.limit,ht=xe.query,it=gt===1/0?void 0:gt,St=ht.index,ht=ht.range,at=at.objectStore(De),St=St.isPrimaryKey?at:at.index(St.name),ht=A(ht);if(gt===0)return Re({result:[]});be?((it=ot?St.getAll(ht,it):St.getAllKeys(ht,it)).onsuccess=function(Rt){return Re({result:Rt.target.result})},it.onerror=Ar(Me)):($e=0,He=!ot&&"openKeyCursor"in St?St.openKeyCursor(ht):St.openCursor(ht),Ze=[],He.onsuccess=function(Rt){var Zt=He.result;return Zt?(Ze.push(ot?Zt.value:Zt.primaryKey),++$e===gt?Re({result:Ze}):void Zt.continue()):Re({result:Ze})},He.onerror=Ar(Me))})}),openCursor:function(xe){var Re=xe.trans,Me=xe.values,$e=xe.query,He=xe.reverse,Ze=xe.unique;return new Promise(function(ot,gt){ot=kn(ot);var St=$e.index,it=$e.range,at=Re.objectStore(De),at=St.isPrimaryKey?at:at.index(St.name),St=He?Ze?"prevunique":"prev":Ze?"nextunique":"next",ht=!Me&&"openKeyCursor"in at?at.openKeyCursor(A(it),St):at.openCursor(A(it),St);ht.onerror=Ar(gt),ht.onsuccess=kn(function(Rt){var Zt,on,rn,Wo,Kt=ht.result;Kt?(Kt.___id=++abe,Kt.done=!1,Zt=Kt.continue.bind(Kt),on=(on=Kt.continuePrimaryKey)&&on.bind(Kt),rn=Kt.advance.bind(Kt),Wo=function(){throw new Error("Cursor not stopped")},Kt.trans=Re,Kt.stop=Kt.continue=Kt.continuePrimaryKey=Kt.advance=function(){throw new Error("Cursor not started")},Kt.fail=kn(gt),Kt.next=function(){var qs=this,Ys=1;return this.start(function(){return Ys--?qs.continue():qs.stop()}).then(function(){return qs})},Kt.start=function(qs){function Ys(){if(ht.result)try{qs()}catch(oo){Kt.fail(oo)}else Kt.done=!0,Kt.start=function(){throw new Error("Cursor behind last entry")},Kt.stop()}var qy=new Promise(function(oo,Vu){oo=kn(oo),ht.onerror=Ar(Vu),Kt.fail=Vu,Kt.stop=function(J_){Kt.stop=Kt.continue=Kt.continuePrimaryKey=Kt.advance=Wo,oo(J_)}});return ht.onsuccess=kn(function(oo){ht.onsuccess=Ys,Ys()}),Kt.continue=Zt,Kt.continuePrimaryKey=on,Kt.advance=rn,Ys(),qy},ot(Kt)):ot(null)},gt)})},count:function(xe){var Re=xe.query,Me=xe.trans,$e=Re.index,He=Re.range;return new Promise(function(Ze,ot){var gt=Me.objectStore(De),it=$e.isPrimaryKey?gt:gt.index($e.name),gt=A(He),it=gt?it.count(gt):it.count();it.onsuccess=kn(function(at){return Ze(at.target.result)}),it.onerror=Ar(ot)})}}}var z,se,ue,Te=(se=Ce,ue=YB((z=m).objectStoreNames),{schema:{name:z.name,tables:ue.map(function(Fe){return se.objectStore(Fe)}).map(function(Fe){var be=Fe.keyPath,Re=Fe.autoIncrement,De=a(be),xe={},Re={name:Fe.name,primaryKey:{name:null,isPrimaryKey:!0,outbound:be==null,compound:De,keyPath:be,autoIncrement:Re,unique:!0,extractKey:O_(be)},indexes:YB(Fe.indexNames).map(function(Me){return Fe.index(Me)}).map(function(Ze){var $e=Ze.name,He=Ze.unique,ot=Ze.multiEntry,Ze=Ze.keyPath,ot={name:$e,compound:a(Ze),keyPath:Ze,unique:He,multiEntry:ot,extractKey:O_(Ze)};return xe[_p(Ze)]=ot}),getIndexByKeyPath:function(Me){return xe[_p(Me)]}};return xe[":id"]=Re.primaryKey,be!=null&&(xe[_p(be)]=Re.primaryKey),Re})},hasGetAll:0<ue.length&&"getAll"in se.objectStore(ue[0])&&!(typeof navigator<"u"&&/Safari/.test(navigator.userAgent)&&!/(Chrome\/|Edge\/)/.test(navigator.userAgent)&&[].concat(navigator.userAgent.match(/Safari\/(\d*)/))[1]<604)}),Ce=Te.schema,_e=Te.hasGetAll,Te=Ce.tables.map(L),he={};return Te.forEach(function(Fe){return he[Fe.name]=Fe}),{stack:"dbcore",transaction:m.transaction.bind(m),table:function(Fe){if(!he[Fe])throw new Error("Table '".concat(Fe,"' not found"));return he[Fe]},MIN_KEY:-1/0,MAX_KEY:Ep(y),schema:Ce}}function ube(m,y,E,A){var L=E.IDBKeyRange;return E.indexedDB,{dbcore:(A=lbe(y,L,A),m.dbcore.reduce(function(z,se){return se=se.create,s(s({},z),se(z))},A))}}function Ny(m,A){var E=A.db,A=ube(m._middlewares,E,m._deps,A);m.core=A.dbcore,m.tables.forEach(function(L){var z=L.name;m.core.schema.tables.some(function(se){return se.name===z})&&(L.core=m.core.table(z),m[z]instanceof m.Table&&(m[z].core=L.core))})}function Ly(m,y,E,A){E.forEach(function(L){var z=A[L];y.forEach(function(se){var ue=function Ce(_e,Te){return v(_e,Te)||(_e=u(_e))&&Ce(_e,Te)}(se,L);(!ue||"value"in ue&&ue.value===void 0)&&(se===m.Transaction.prototype||se instanceof m.Transaction?p(se,L,{get:function(){return this.table(L)},set:function(Ce){f(this,L,{value:Ce,writable:!0,configurable:!0,enumerable:!0})}}):se[L]=new m.Table(L,z))})})}function M_(m,y){y.forEach(function(E){for(var A in E)E[A]instanceof m.Table&&delete E[A]})}function cbe(m,y){return m._cfg.version-y._cfg.version}function dbe(m,y,E,A){var L=m._dbSchema;E.objectStoreNames.contains("$meta")&&!L.$meta&&(L.$meta=k_("$meta",XB("")[0],[]),m._storeNames.push("$meta"));var z=m._createTransaction("readwrite",m._storeNames,L);z.create(E),z._completion.catch(A);var se=z._reject.bind(z),ue=je.transless||je;Ae(function(){return je.trans=z,je.transless=ue,y!==0?(Ny(m,E),_e=y,((Ce=z).storeNames.includes("$meta")?Ce.table("$meta").get("version").then(function(Te){return Te??_e}):st.resolve(_e)).then(function(Te){return Fe=Te,be=z,De=E,xe=[],Te=(he=m)._versions,Re=he._dbSchema=By(0,he.idbdb,De),(Te=Te.filter(function(Me){return Me._cfg.version>=Fe})).length!==0?(Te.forEach(function(Me){xe.push(function(){var $e=Re,He=Me._cfg.dbschema;$y(he,$e,De),$y(he,He,De),Re=he._dbSchema=He;var Ze=N_($e,He);Ze.add.forEach(function(St){L_(De,St[0],St[1].primKey,St[1].indexes)}),Ze.change.forEach(function(St){if(St.recreate)throw new W.Upgrade("Not yet support for changing primary key");var ht=De.objectStore(St.name);St.add.forEach(function(Rt){return Vy(ht,Rt)}),St.change.forEach(function(Rt){ht.deleteIndex(Rt.name),Vy(ht,Rt)}),St.del.forEach(function(Rt){return ht.deleteIndex(Rt)})});var ot=Me._cfg.contentUpgrade;if(ot&&Me._cfg.version>Fe){Ny(he,De),be._memoizedTables={};var gt=I(He);Ze.del.forEach(function(St){gt[St]=$e[St]}),M_(he,[he.Transaction.prototype]),Ly(he,[he.Transaction.prototype],r(gt),gt),be.schema=gt;var it,at=te(ot);return at&&Ye(),Ze=st.follow(function(){var St;(it=ot(be))&&at&&(St=jt.bind(null,null),it.then(St,St))}),it&&typeof it.then=="function"?st.resolve(it):Ze.then(function(){return it})}}),xe.push(function($e){var He,Ze,ot=Me._cfg.dbschema;He=ot,Ze=$e,[].slice.call(Ze.db.objectStoreNames).forEach(function(gt){return He[gt]==null&&Ze.db.deleteObjectStore(gt)}),M_(he,[he.Transaction.prototype]),Ly(he,[he.Transaction.prototype],he._storeNames,he._dbSchema),be.schema=he._dbSchema}),xe.push(function($e){he.idbdb.objectStoreNames.contains("$meta")&&(Math.ceil(he.idbdb.version/10)===Me._cfg.version?(he.idbdb.deleteObjectStore("$meta"),delete he._dbSchema.$meta,he._storeNames=he._storeNames.filter(function(He){return He!=="$meta"})):$e.objectStore("$meta").put(Me._cfg.version,"version"))})}),function Me(){return xe.length?st.resolve(xe.shift()(be.idbtrans)).then(Me):st.resolve()}().then(function(){ZB(Re,De)})):st.resolve();var he,Fe,be,De,xe,Re}).catch(se)):(r(L).forEach(function(Te){L_(E,Te,L[Te].primKey,L[Te].indexes)}),Ny(m,E),void st.follow(function(){return m.on.populate.fire(z)}).catch(se));var Ce,_e})}function hbe(m,y){ZB(m._dbSchema,y),y.db.version%10!=0||y.objectStoreNames.contains("$meta")||y.db.createObjectStore("$meta").add(Math.ceil(y.db.version/10-1),"version");var E=By(0,m.idbdb,y);$y(m,m._dbSchema,y);for(var A=0,L=N_(E,m._dbSchema).change;A<L.length;A++){var z=function(se){if(se.change.length||se.recreate)return console.warn("Unable to patch indexes of table ".concat(se.name," because it has changes on the type of index or primary key.")),{value:void 0};var ue=y.objectStore(se.name);se.add.forEach(function(Ce){H&&console.debug("Dexie upgrade patch: Creating missing index ".concat(se.name,".").concat(Ce.src)),Vy(ue,Ce)})}(L[A]);if(typeof z=="object")return z.value}}function N_(m,y){var E,A={del:[],add:[],change:[]};for(E in m)y[E]||A.del.push(E);for(E in y){var L=m[E],z=y[E];if(L){var se={name:E,def:z,recreate:!1,del:[],add:[],change:[]};if(""+(L.primKey.keyPath||"")!=""+(z.primKey.keyPath||"")||L.primKey.auto!==z.primKey.auto)se.recreate=!0,A.change.push(se);else{var ue=L.idxByName,Ce=z.idxByName,_e=void 0;for(_e in ue)Ce[_e]||se.del.push(_e);for(_e in Ce){var Te=ue[_e],he=Ce[_e];Te?Te.src!==he.src&&se.change.push(he):se.add.push(he)}(0<se.del.length||0<se.add.length||0<se.change.length)&&A.change.push(se)}}else A.add.push([E,z])}return A}function L_(m,y,E,A){var L=m.db.createObjectStore(y,E.keyPath?{keyPath:E.keyPath,autoIncrement:E.auto}:{autoIncrement:E.auto});return A.forEach(function(z){return Vy(L,z)}),L}function ZB(m,y){r(m).forEach(function(E){y.db.objectStoreNames.contains(E)||(H&&console.debug("Dexie: Creating missing table",E),L_(y,E,m[E].primKey,m[E].indexes))})}function Vy(m,y){m.createIndex(y.name,y.keyPath,{unique:y.unique,multiEntry:y.multi})}function By(m,y,E){var A={};return S(y.objectStoreNames,0).forEach(function(L){for(var z=E.objectStore(L),se=A_(qB(_e=z.keyPath),_e||"",!0,!1,!!z.autoIncrement,_e&&typeof _e!="string",!0),ue=[],Ce=0;Ce<z.indexNames.length;++Ce){var Te=z.index(z.indexNames[Ce]),_e=Te.keyPath,Te=A_(Te.name,_e,!!Te.unique,!!Te.multiEntry,!1,_e&&typeof _e!="string",!1);ue.push(Te)}A[L]=k_(L,se,ue)}),A}function $y(m,y,E){for(var A=E.db.objectStoreNames,L=0;L<A.length;++L){var z=A[L],se=E.objectStore(z);m._hasGetAll="getAll"in se;for(var ue=0;ue<se.indexNames.length;++ue){var Ce=se.indexNames[ue],_e=se.index(Ce).keyPath,Te=typeof _e=="string"?_e:"["+S(_e).join("+")+"]";!y[z]||(_e=y[z].idxByName[Te])&&(_e.name=Ce,delete y[z].idxByName[Te],y[z].idxByName[Ce]=_e)}}typeof navigator<"u"&&/Safari/.test(navigator.userAgent)&&!/(Chrome\/|Edge\/)/.test(navigator.userAgent)&&i.WorkerGlobalScope&&i instanceof i.WorkerGlobalScope&&[].concat(navigator.userAgent.match(/Safari\/(\d*)/))[1]<604&&(m._hasGetAll=!1)}function XB(m){return m.split(",").map(function(y,E){var A=(y=y.trim()).replace(/([&*]|\+\+)/g,""),L=/^\[/.test(A)?A.match(/^\[(.*)\]$/)[1].split("+"):A;return A_(A,L||null,/\&/.test(y),/\*/.test(y),/\+\+/.test(y),a(L),E===0)})}var fbe=(Hy.prototype._parseStoresSpec=function(m,y){r(m).forEach(function(E){if(m[E]!==null){var A=XB(m[E]),L=A.shift();if(L.unique=!0,L.multi)throw new W.Schema("Primary key cannot be multi-valued");A.forEach(function(z){if(z.auto)throw new W.Schema("Only primary key can be marked as autoIncrement (++)");if(!z.keyPath)throw new W.Schema("Index must have a name and cannot be an empty string")}),y[E]=k_(E,L,A)}})},Hy.prototype.stores=function(E){var y=this.db;this._cfg.storesSource=this._cfg.storesSource?l(this._cfg.storesSource,E):E;var E=y._versions,A={},L={};return E.forEach(function(z){l(A,z._cfg.storesSource),L=z._cfg.dbschema={},z._parseStoresSpec(A,L)}),y._dbSchema=L,M_(y,[y._allTables,y,y.Transaction.prototype]),Ly(y,[y._allTables,y,y.Transaction.prototype,this._cfg.tables],r(L),L),y._storeNames=r(L),this},Hy.prototype.upgrade=function(m){return this._cfg.contentUpgrade=M(this._cfg.contentUpgrade||Ie,m),this},Hy);function Hy(){}function V_(m,y){var E=m._dbNamesDB;return E||(E=m._dbNamesDB=new Ca(Py,{addons:[],indexedDB:m,IDBKeyRange:y})).version(1).stores({dbnames:"name"}),E.table("dbnames")}function B_(m){return m&&typeof m.databases=="function"}function $_(m){return Ae(function(){return je.letThrough=!0,m()})}function H_(m){return!("from"in m)}var Ks=function(m,y){if(!this){var E=new Ks;return m&&"d"in m&&l(E,m),E}l(this,arguments.length?{d:1,from:m,to:1<arguments.length?y:m}:{d:0})};function Rp(m,y,E){var A=ln(y,E);if(!isNaN(A)){if(0<A)throw RangeError();if(H_(m))return l(m,{from:y,to:E,d:1});var L=m.l,A=m.r;if(ln(E,m.from)<0)return L?Rp(L,y,E):m.l={from:y,to:E,d:1,l:null,r:null},QB(m);if(0<ln(y,m.to))return A?Rp(A,y,E):m.r={from:y,to:E,d:1,l:null,r:null},QB(m);ln(y,m.from)<0&&(m.from=y,m.l=null,m.d=A?A.d+1:1),0<ln(E,m.to)&&(m.to=E,m.r=null,m.d=m.l?m.l.d+1:1),E=!m.r,L&&!m.l&&Dp(m,L),A&&E&&Dp(m,A)}}function Dp(m,y){H_(y)||function E(A,Ce){var z=Ce.from,se=Ce.to,ue=Ce.l,Ce=Ce.r;Rp(A,z,se),ue&&E(A,ue),Ce&&E(A,Ce)}(m,y)}function JB(m,y){var E=Gy(y),A=E.next();if(A.done)return!1;for(var L=A.value,z=Gy(m),se=z.next(L.from),ue=se.value;!A.done&&!se.done;){if(ln(ue.from,L.to)<=0&&0<=ln(ue.to,L.from))return!0;ln(L.from,ue.from)<0?L=(A=E.next(ue.from)).value:ue=(se=z.next(L.from)).value}return!1}function Gy(m){var y=H_(m)?null:{s:0,n:m};return{next:function(E){for(var A=0<arguments.length;y;)switch(y.s){case 0:if(y.s=1,A)for(;y.n.l&&ln(E,y.n.from)<0;)y={up:y,n:y.n.l,s:1};else for(;y.n.l;)y={up:y,n:y.n.l,s:1};case 1:if(y.s=2,!A||ln(E,y.n.to)<=0)return{value:y.n,done:!1};case 2:if(y.n.r){y.s=3,y={up:y,n:y.n.r,s:0};continue}case 3:y=y.up}return{done:!0}}}}function QB(m){var y,E,A=(((y=m.r)===null||y===void 0?void 0:y.d)||0)-(((E=m.l)===null||E===void 0?void 0:E.d)||0),L=1<A?"r":A<-1?"l":"";L&&(y=L=="r"?"l":"r",E=s({},m),A=m[L],m.from=A.from,m.to=A.to,m[L]=A[L],E[L]=A[y],(m[y]=E).d=e$(E)),m.d=e$(m)}function e$(E){var y=E.r,E=E.l;return(y?E?Math.max(y.d,E.d):y.d:E?E.d:0)+1}function Uy(m,y){return r(y).forEach(function(E){m[E]?Dp(m[E],y[E]):m[E]=function A(L){var z,se,ue={};for(z in L)d(L,z)&&(se=L[z],ue[z]=!se||typeof se!="object"||D.has(se.constructor)?se:A(se));return ue}(y[E])}),m}function G_(m,y){return m.all||y.all||Object.keys(m).some(function(E){return y[E]&&JB(y[E],m[E])})}h(Ks.prototype,((mi={add:function(m){return Dp(this,m),this},addKey:function(m){return Rp(this,m,m),this},addKeys:function(m){var y=this;return m.forEach(function(E){return Rp(y,E,E)}),this},hasKey:function(m){var y=Gy(this).next(m).value;return y&&ln(y.from,m)<=0&&0<=ln(y.to,m)}})[q]=function(){return Gy(this)},mi));var Nu={},U_={},W_=!1;function Wy(m){Uy(U_,m),W_||(W_=!0,setTimeout(function(){W_=!1,z_(U_,!(U_={}))},0))}function z_(m,y){y===void 0&&(y=!1);var E=new Set;if(m.all)for(var A=0,L=Object.values(Nu);A<L.length;A++)t$(se=L[A],m,E,y);else for(var z in m){var se,ue=/^idb\:\/\/(.*)\/(.*)\//.exec(z);ue&&(z=ue[1],ue=ue[2],(se=Nu["idb://".concat(z,"/").concat(ue)])&&t$(se,m,E,y))}E.forEach(function(Ce){return Ce()})}function t$(m,y,E,A){for(var L=[],z=0,se=Object.entries(m.queries.query);z<se.length;z++){for(var ue=se[z],Ce=ue[0],_e=[],Te=0,he=ue[1];Te<he.length;Te++){var Fe=he[Te];G_(y,Fe.obsSet)?Fe.subscribers.forEach(function(Re){return E.add(Re)}):A&&_e.push(Fe)}A&&L.push([Ce,_e])}if(A)for(var be=0,De=L;be<De.length;be++){var xe=De[be],Ce=xe[0],_e=xe[1];m.queries.query[Ce]=_e}}function pbe(m){var y=m._state,E=m._deps.indexedDB;if(y.isBeingOpened||m.idbdb)return y.dbReadyPromise.then(function(){return y.dbOpenError?Kn(y.dbOpenError):m});y.isBeingOpened=!0,y.dbOpenError=null,y.openComplete=!1;var A=y.openCanceller,L=Math.round(10*m.verno),z=!1;function se(){if(y.openCanceller!==A)throw new W.DatabaseClosed("db.open() was cancelled")}function ue(){return new st(function(Fe,be){if(se(),!E)throw new W.MissingAPI;var De=m.name,xe=y.autoSchema||!L?E.open(De):E.open(De,L);if(!xe)throw new W.MissingAPI;xe.onerror=Ar(be),xe.onblocked=kn(m._fireOnBlocked),xe.onupgradeneeded=kn(function(Re){var Me;Te=xe.transaction,y.autoSchema&&!m._options.allowEmptyDB?(xe.onerror=bp,Te.abort(),xe.result.close(),(Me=E.deleteDatabase(De)).onsuccess=Me.onerror=kn(function(){be(new W.NoSuchDatabase("Database ".concat(De," doesnt exist")))})):(Te.onerror=Ar(be),Re=Re.oldVersion>Math.pow(2,62)?0:Re.oldVersion,he=Re<1,m.idbdb=xe.result,z&&hbe(m,Te),dbe(m,Re/10,Te,be))},be),xe.onsuccess=kn(function(){Te=null;var Re,Me,$e,He,Ze,ot=m.idbdb=xe.result,gt=S(ot.objectStoreNames);if(0<gt.length)try{var it=ot.transaction((He=gt).length===1?He[0]:He,"readonly");if(y.autoSchema)Me=ot,$e=it,(Re=m).verno=Me.version/10,$e=Re._dbSchema=By(0,Me,$e),Re._storeNames=S(Me.objectStoreNames,0),Ly(Re,[Re._allTables],r($e),$e);else if($y(m,m._dbSchema,it),((Ze=N_(By(0,(Ze=m).idbdb,it),Ze._dbSchema)).add.length||Ze.change.some(function(at){return at.add.length||at.change.length}))&&!z)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."),ot.close(),L=ot.version+1,z=!0,Fe(ue());Ny(m,it)}catch{}Md.push(m),ot.onversionchange=kn(function(at){y.vcFired=!0,m.on("versionchange").fire(at)}),ot.onclose=kn(function(at){m.on("close").fire(at)}),he&&(Ze=m._deps,it=De,ot=Ze.indexedDB,Ze=Ze.IDBKeyRange,B_(ot)||it===Py||V_(ot,Ze).put({name:it}).catch(Ie)),Fe()},be)}).catch(function(Fe){switch(Fe==null?void 0:Fe.name){case"UnknownError":if(0<y.PR1398_maxLoop)return y.PR1398_maxLoop--,console.warn("Dexie: Workaround for Chrome UnknownError on open()"),ue();break;case"VersionError":if(0<L)return L=0,ue()}return st.reject(Fe)})}var Ce,_e=y.dbReadyResolve,Te=null,he=!1;return st.race([A,(typeof navigator>"u"?st.resolve():!navigator.userAgentData&&/Safari\//.test(navigator.userAgent)&&!/Chrom(e|ium)\//.test(navigator.userAgent)&&indexedDB.databases?new Promise(function(Fe){function be(){return indexedDB.databases().finally(Fe)}Ce=setInterval(be,100),be()}).finally(function(){return clearInterval(Ce)}):Promise.resolve()).then(ue)]).then(function(){return se(),y.onReadyBeingFired=[],st.resolve($_(function(){return m.on.ready.fire(m.vip)})).then(function Fe(){if(0<y.onReadyBeingFired.length){var be=y.onReadyBeingFired.reduce(M,Ie);return y.onReadyBeingFired=[],st.resolve($_(function(){return be(m.vip)})).then(Fe)}})}).finally(function(){y.openCanceller===A&&(y.onReadyBeingFired=null,y.isBeingOpened=!1)}).catch(function(Fe){y.dbOpenError=Fe;try{Te&&Te.abort()}catch{}return A===y.openCanceller&&m._close(),Kn(Fe)}).finally(function(){y.openComplete=!0,_e()}).then(function(){var Fe;return he&&(Fe={},m.tables.forEach(function(be){be.schema.indexes.forEach(function(De){De.name&&(Fe["idb://".concat(m.name,"/").concat(be.name,"/").concat(De.name)]=new Ks(-1/0,[[[]]]))}),Fe["idb://".concat(m.name,"/").concat(be.name,"/")]=Fe["idb://".concat(m.name,"/").concat(be.name,"/:dels")]=new Ks(-1/0,[[[]]])}),vl(Sp).fire(Fe),z_(Fe,!0)),m})}function j_(m){function y(z){return m.next(z)}var E=L(y),A=L(function(z){return m.throw(z)});function L(z){return function(Ce){var ue=z(Ce),Ce=ue.value;return ue.done?Ce:Ce&&typeof Ce.then=="function"?Ce.then(E,A):a(Ce)?Promise.all(Ce).then(E,A):E(Ce)}}return L(y)()}function zy(m,y,E){for(var A=a(m)?m.slice():[m],L=0;L<E;++L)A.push(y);return A}var gbe={stack:"dbcore",name:"VirtualIndexMiddleware",level:1,create:function(m){return s(s({},m),{table:function(y){var E=m.table(y),A=E.schema,L={},z=[];function se(he,Fe,be){var De=_p(he),xe=L[De]=L[De]||[],Re=he==null?0:typeof he=="string"?1:he.length,Me=0<Fe,Me=s(s({},be),{name:Me?"".concat(De,"(virtual-from:").concat(be.name,")"):be.name,lowLevelIndex:be,isVirtual:Me,keyTail:Fe,keyLength:Re,extractKey:O_(he),unique:!Me&&be.unique});return xe.push(Me),Me.isPrimaryKey||z.push(Me),1<Re&&se(Re===2?he[0]:he.slice(0,Re-1),Fe+1,be),xe.sort(function($e,He){return $e.keyTail-He.keyTail}),Me}y=se(A.primaryKey.keyPath,0,A.primaryKey),L[":id"]=[y];for(var ue=0,Ce=A.indexes;ue<Ce.length;ue++){var _e=Ce[ue];se(_e.keyPath,0,_e)}function Te(he){var Fe,be=he.query.index;return be.isVirtual?s(s({},he),{query:{index:be.lowLevelIndex,range:(Fe=he.query.range,be=be.keyTail,{type:Fe.type===1?2:Fe.type,lower:zy(Fe.lower,Fe.lowerOpen?m.MAX_KEY:m.MIN_KEY,be),lowerOpen:!0,upper:zy(Fe.upper,Fe.upperOpen?m.MIN_KEY:m.MAX_KEY,be),upperOpen:!0})}}):he}return s(s({},E),{schema:s(s({},A),{primaryKey:y,indexes:z,getIndexByKeyPath:function(he){return(he=L[_p(he)])&&he[0]}}),count:function(he){return E.count(Te(he))},query:function(he){return E.query(Te(he))},openCursor:function(he){var Fe=he.query.index,be=Fe.keyTail,De=Fe.isVirtual,xe=Fe.keyLength;return De?E.openCursor(Te(he)).then(function(Me){return Me&&Re(Me)}):E.openCursor(he);function Re(Me){return Object.create(Me,{continue:{value:function($e){$e!=null?Me.continue(zy($e,he.reverse?m.MAX_KEY:m.MIN_KEY,be)):he.unique?Me.continue(Me.key.slice(0,xe).concat(he.reverse?m.MIN_KEY:m.MAX_KEY,be)):Me.continue()}},continuePrimaryKey:{value:function($e,He){Me.continuePrimaryKey(zy($e,m.MAX_KEY,be),He)}},primaryKey:{get:function(){return Me.primaryKey}},key:{get:function(){var $e=Me.key;return xe===1?$e[0]:$e.slice(0,xe)}},value:{get:function(){return Me.value}}})}}})}})}};function K_(m,y,E,A){return E=E||{},A=A||"",r(m).forEach(function(L){var z,se,ue;d(y,L)?(z=m[L],se=y[L],typeof z=="object"&&typeof se=="object"&&z&&se?(ue=$(z))!==$(se)?E[A+L]=y[L]:ue==="Object"?K_(z,se,E,A+L+"."):z!==se&&(E[A+L]=y[L]):z!==se&&(E[A+L]=y[L])):E[A+L]=void 0}),r(y).forEach(function(L){d(m,L)||(E[A+L]=y[L])}),E}function q_(m,y){return y.type==="delete"?y.keys:y.keys||y.values.map(m.extractKey)}var mbe={stack:"dbcore",name:"HooksMiddleware",level:2,create:function(m){return s(s({},m),{table:function(y){var E=m.table(y),A=E.schema.primaryKey;return s(s({},E),{mutate:function(L){var z=je.trans,se=z.table(y).hook,ue=se.deleting,Ce=se.creating,_e=se.updating;switch(L.type){case"add":if(Ce.fire===Ie)break;return z._promise("readwrite",function(){return Te(L)},!0);case"put":if(Ce.fire===Ie&&_e.fire===Ie)break;return z._promise("readwrite",function(){return Te(L)},!0);case"delete":if(ue.fire===Ie)break;return z._promise("readwrite",function(){return Te(L)},!0);case"deleteRange":if(ue.fire===Ie)break;return z._promise("readwrite",function(){return function he(Fe,be,De){return E.query({trans:Fe,values:!1,query:{index:A,range:be},limit:De}).then(function(xe){var Re=xe.result;return Te({type:"delete",keys:Re,trans:Fe}).then(function(Me){return 0<Me.numFailures?Promise.reject(Me.failures[0]):Re.length<De?{failures:[],numFailures:0,lastResult:void 0}:he(Fe,s(s({},be),{lower:Re[Re.length-1],lowerOpen:!0}),De)})})}(L.trans,L.range,1e4)},!0)}return E.mutate(L);function Te(he){var Fe,be,De,xe=je.trans,Re=he.keys||q_(A,he);if(!Re)throw new Error("Keys missing");return(he=he.type==="add"||he.type==="put"?s(s({},he),{keys:Re}):s({},he)).type!=="delete"&&(he.values=o([],he.values)),he.keys&&(he.keys=o([],he.keys)),Fe=E,De=Re,((be=he).type==="add"?Promise.resolve([]):Fe.getMany({trans:be.trans,keys:De,cache:"immutable"})).then(function(Me){var $e=Re.map(function(He,Ze){var ot,gt,it,at=Me[Ze],St={onerror:null,onsuccess:null};return he.type==="delete"?ue.fire.call(St,He,at,xe):he.type==="add"||at===void 0?(ot=Ce.fire.call(St,He,he.values[Ze],xe),He==null&&ot!=null&&(he.keys[Ze]=He=ot,A.outbound||T(he.values[Ze],A.keyPath,He))):(ot=K_(at,he.values[Ze]),(gt=_e.fire.call(St,ot,He,at,xe))&&(it=he.values[Ze],Object.keys(gt).forEach(function(ht){d(it,ht)?it[ht]=gt[ht]:T(it,ht,gt[ht])}))),St});return E.mutate(he).then(function(He){for(var Ze=He.failures,ot=He.results,gt=He.numFailures,He=He.lastResult,it=0;it<Re.length;++it){var at=(ot||Re)[it],St=$e[it];at==null?St.onerror&&St.onerror(Ze[it]):St.onsuccess&&St.onsuccess(he.type==="put"&&Me[it]?he.values[it]:at)}return{failures:Ze,results:ot,numFailures:gt,lastResult:He}}).catch(function(He){return $e.forEach(function(Ze){return Ze.onerror&&Ze.onerror(He)}),Promise.reject(He)})})}}})}})}};function n$(m,y,E){try{if(!y||y.keys.length<m.length)return null;for(var A=[],L=0,z=0;L<y.keys.length&&z<m.length;++L)ln(y.keys[L],m[z])===0&&(A.push(E?k(y.values[L]):y.values[L]),++z);return A.length===m.length?A:null}catch{return null}}var vbe={stack:"dbcore",level:-1,create:function(m){return{table:function(y){var E=m.table(y);return s(s({},E),{getMany:function(A){if(!A.cache)return E.getMany(A);var L=n$(A.keys,A.trans._cache,A.cache==="clone");return L?st.resolve(L):E.getMany(A).then(function(z){return A.trans._cache={keys:A.keys,values:A.cache==="clone"?k(z):z},z})},mutate:function(A){return A.type!=="add"&&(A.trans._cache=null),E.mutate(A)}})}}}};function s$(m,y){return m.trans.mode==="readonly"&&!!m.subscr&&!m.trans.explicit&&m.trans.db._options.cache!=="disabled"&&!y.schema.primaryKey.outbound}function o$(m,y){switch(m){case"query":return y.values&&!y.unique;case"get":case"getMany":case"count":case"openCursor":return!1}}var ybe={stack:"dbcore",level:0,name:"Observability",create:function(m){var y=m.schema.name,E=new Ks(m.MIN_KEY,m.MAX_KEY);return s(s({},m),{transaction:function(A,L,z){if(je.subscr&&L!=="readonly")throw new W.ReadOnly("Readwrite transaction in liveQuery context. Querier source: ".concat(je.querier));return m.transaction(A,L,z)},table:function(A){var L=m.table(A),z=L.schema,se=z.primaryKey,he=z.indexes,ue=se.extractKey,Ce=se.outbound,_e=se.autoIncrement&&he.filter(function(be){return be.compound&&be.keyPath.includes(se.keyPath)}),Te=s(s({},L),{mutate:function(be){function De(ht){return ht="idb://".concat(y,"/").concat(A,"/").concat(ht),He[ht]||(He[ht]=new Ks)}var xe,Re,Me,$e=be.trans,He=be.mutatedParts||(be.mutatedParts={}),Ze=De(""),ot=De(":dels"),gt=be.type,St=be.type==="deleteRange"?[be.range]:be.type==="delete"?[be.keys]:be.values.length<50?[q_(se,be).filter(function(ht){return ht}),be.values]:[],it=St[0],at=St[1],St=be.trans._cache;return a(it)?(Ze.addKeys(it),(St=gt==="delete"||it.length===at.length?n$(it,St):null)||ot.addKeys(it),(St||at)&&(xe=De,Re=St,Me=at,z.indexes.forEach(function(ht){var Rt=xe(ht.name||"");function Zt(rn){return rn!=null?ht.extractKey(rn):null}function on(rn){return ht.multiEntry&&a(rn)?rn.forEach(function(Wo){return Rt.addKey(Wo)}):Rt.addKey(rn)}(Re||Me).forEach(function(rn,qs){var Kt=Re&&Zt(Re[qs]),qs=Me&&Zt(Me[qs]);ln(Kt,qs)!==0&&(Kt!=null&&on(Kt),qs!=null&&on(qs))})}))):it?(at={from:(at=it.lower)!==null&&at!==void 0?at:m.MIN_KEY,to:(at=it.upper)!==null&&at!==void 0?at:m.MAX_KEY},ot.add(at),Ze.add(at)):(Ze.add(E),ot.add(E),z.indexes.forEach(function(ht){return De(ht.name).add(E)})),L.mutate(be).then(function(ht){return!it||be.type!=="add"&&be.type!=="put"||(Ze.addKeys(ht.results),_e&&_e.forEach(function(Rt){for(var Zt=be.values.map(function(Kt){return Rt.extractKey(Kt)}),on=Rt.keyPath.findIndex(function(Kt){return Kt===se.keyPath}),rn=0,Wo=ht.results.length;rn<Wo;++rn)Zt[rn][on]=ht.results[rn];De(Rt.name).addKeys(Zt)})),$e.mutatedParts=Uy($e.mutatedParts||{},He),ht})}}),he=function(De){var xe=De.query,De=xe.index,xe=xe.range;return[De,new Ks((De=xe.lower)!==null&&De!==void 0?De:m.MIN_KEY,(xe=xe.upper)!==null&&xe!==void 0?xe:m.MAX_KEY)]},Fe={get:function(be){return[se,new Ks(be.key)]},getMany:function(be){return[se,new Ks().addKeys(be.keys)]},count:he,query:he,openCursor:he};return r(Fe).forEach(function(be){Te[be]=function(De){var xe=je.subscr,Re=!!xe,Me=s$(je,L)&&o$(be,De)?De.obsSet={}:xe;if(Re){var $e=function(at){return at="idb://".concat(y,"/").concat(A,"/").concat(at),Me[at]||(Me[at]=new Ks)},He=$e(""),Ze=$e(":dels"),xe=Fe[be](De),Re=xe[0],xe=xe[1];if((be==="query"&&Re.isPrimaryKey&&!De.values?Ze:$e(Re.name||"")).add(xe),!Re.isPrimaryKey){if(be!=="count"){var ot=be==="query"&&Ce&&De.values&&L.query(s(s({},De),{values:!1}));return L[be].apply(this,arguments).then(function(at){if(be==="query"){if(Ce&&De.values)return ot.then(function(Zt){return Zt=Zt.result,He.addKeys(Zt),at});var St=De.values?at.result.map(ue):at.result;(De.values?He:Ze).addKeys(St)}else if(be==="openCursor"){var ht=at,Rt=De.values;return ht&&Object.create(ht,{key:{get:function(){return Ze.addKey(ht.primaryKey),ht.key}},primaryKey:{get:function(){var Zt=ht.primaryKey;return Ze.addKey(Zt),Zt}},value:{get:function(){return Rt&&He.addKey(ht.primaryKey),ht.value}}})}return at})}Ze.add(E)}}return L[be].apply(this,arguments)}}),Te}})}};function i$(m,y,E){if(E.numFailures===0)return y;if(y.type==="deleteRange")return null;var A=y.keys?y.keys.length:"values"in y&&y.values?y.values.length:1;return E.numFailures===A?null:(y=s({},y),a(y.keys)&&(y.keys=y.keys.filter(function(L,z){return!(z in E.failures)})),"values"in y&&a(y.values)&&(y.values=y.values.filter(function(L,z){return!(z in E.failures)})),y)}function Y_(m,y){return E=m,((A=y).lower===void 0||(A.lowerOpen?0<ln(E,A.lower):0<=ln(E,A.lower)))&&(m=m,(y=y).upper===void 0||(y.upperOpen?ln(m,y.upper)<0:ln(m,y.upper)<=0));var E,A}function r$(m,y,Fe,A,L,z){if(!Fe||Fe.length===0)return m;var se=y.query.index,ue=se.multiEntry,Ce=y.query.range,_e=A.schema.primaryKey.extractKey,Te=se.extractKey,he=(se.lowLevelIndex||se).extractKey,Fe=Fe.reduce(function(be,De){var xe=be,Re=[];if(De.type==="add"||De.type==="put")for(var Me=new Ks,$e=De.values.length-1;0<=$e;--$e){var He,Ze=De.values[$e],ot=_e(Ze);Me.hasKey(ot)||(He=Te(Ze),(ue&&a(He)?He.some(function(ht){return Y_(ht,Ce)}):Y_(He,Ce))&&(Me.addKey(ot),Re.push(Ze)))}switch(De.type){case"add":var gt=new Ks().addKeys(y.values?be.map(function(Rt){return _e(Rt)}):be),xe=be.concat(y.values?Re.filter(function(Rt){return Rt=_e(Rt),!gt.hasKey(Rt)&&(gt.addKey(Rt),!0)}):Re.map(function(Rt){return _e(Rt)}).filter(function(Rt){return!gt.hasKey(Rt)&&(gt.addKey(Rt),!0)}));break;case"put":var it=new Ks().addKeys(De.values.map(function(Rt){return _e(Rt)}));xe=be.filter(function(Rt){return!it.hasKey(y.values?_e(Rt):Rt)}).concat(y.values?Re:Re.map(function(Rt){return _e(Rt)}));break;case"delete":var at=new Ks().addKeys(De.keys);xe=be.filter(function(Rt){return!at.hasKey(y.values?_e(Rt):Rt)});break;case"deleteRange":var St=De.range;xe=be.filter(function(Rt){return!Y_(_e(Rt),St)})}return xe},m);return Fe===m?m:(Fe.sort(function(be,De){return ln(he(be),he(De))||ln(_e(be),_e(De))}),y.limit&&y.limit<1/0&&(Fe.length>y.limit?Fe.length=y.limit:m.length===y.limit&&Fe.length<y.limit&&(L.dirty=!0)),z?Object.freeze(Fe):Fe)}function a$(m,y){return ln(m.lower,y.lower)===0&&ln(m.upper,y.upper)===0&&!!m.lowerOpen==!!y.lowerOpen&&!!m.upperOpen==!!y.upperOpen}function wbe(m,y){return function(E,A,L,z){if(E===void 0)return A!==void 0?-1:0;if(A===void 0)return 1;if((A=ln(E,A))===0){if(L&&z)return 0;if(L)return 1;if(z)return-1}return A}(m.lower,y.lower,m.lowerOpen,y.lowerOpen)<=0&&0<=function(E,A,L,z){if(E===void 0)return A!==void 0?1:0;if(A===void 0)return-1;if((A=ln(E,A))===0){if(L&&z)return 0;if(L)return-1;if(z)return 1}return A}(m.upper,y.upper,m.upperOpen,y.upperOpen)}function Cbe(m,y,E,A){m.subscribers.add(E),A.addEventListener("abort",function(){var L,z;m.subscribers.delete(E),m.subscribers.size===0&&(L=m,z=y,setTimeout(function(){L.subscribers.size===0&&ee(z,L)},3e3))})}var bbe={stack:"dbcore",level:0,name:"Cache",create:function(m){var y=m.schema.name;return s(s({},m),{transaction:function(E,A,L){var z,se,ue=m.transaction(E,A,L);return A==="readwrite"&&(se=(z=new AbortController).signal,L=function(Ce){return function(){if(z.abort(),A==="readwrite"){for(var _e=new Set,Te=0,he=E;Te<he.length;Te++){var Fe=he[Te],be=Nu["idb://".concat(y,"/").concat(Fe)];if(be){var De=m.table(Fe),xe=be.optimisticOps.filter(function(Rt){return Rt.trans===ue});if(ue._explicit&&Ce&&ue.mutatedParts)for(var Re=0,Me=Object.values(be.queries.query);Re<Me.length;Re++)for(var $e=0,He=(gt=Me[Re]).slice();$e<He.length;$e++)G_((it=He[$e]).obsSet,ue.mutatedParts)&&(ee(gt,it),it.subscribers.forEach(function(Rt){return _e.add(Rt)}));else if(0<xe.length){be.optimisticOps=be.optimisticOps.filter(function(Rt){return Rt.trans!==ue});for(var Ze=0,ot=Object.values(be.queries.query);Ze<ot.length;Ze++)for(var gt,it,at,St=0,ht=(gt=ot[Ze]).slice();St<ht.length;St++)(it=ht[St]).res!=null&&ue.mutatedParts&&(Ce&&!it.dirty?(at=Object.isFrozen(it.res),at=r$(it.res,it.req,xe,De,it,at),it.dirty?(ee(gt,it),it.subscribers.forEach(function(Rt){return _e.add(Rt)})):at!==it.res&&(it.res=at,it.promise=st.resolve({result:at}))):(it.dirty&&ee(gt,it),it.subscribers.forEach(function(Rt){return _e.add(Rt)})))}}}_e.forEach(function(Rt){return Rt()})}}},ue.addEventListener("abort",L(!1),{signal:se}),ue.addEventListener("error",L(!1),{signal:se}),ue.addEventListener("complete",L(!0),{signal:se})),ue},table:function(E){var A=m.table(E),L=A.schema.primaryKey;return s(s({},A),{mutate:function(z){var se=je.trans;if(L.outbound||se.db._options.cache==="disabled"||se.explicit||se.idbtrans.mode!=="readwrite")return A.mutate(z);var ue=Nu["idb://".concat(y,"/").concat(E)];return ue?(se=A.mutate(z),z.type!=="add"&&z.type!=="put"||!(50<=z.values.length||q_(L,z).some(function(Ce){return Ce==null}))?(ue.optimisticOps.push(z),z.mutatedParts&&Wy(z.mutatedParts),se.then(function(Ce){0<Ce.numFailures&&(ee(ue.optimisticOps,z),(Ce=i$(0,z,Ce))&&ue.optimisticOps.push(Ce),z.mutatedParts&&Wy(z.mutatedParts))}),se.catch(function(){ee(ue.optimisticOps,z),z.mutatedParts&&Wy(z.mutatedParts)})):se.then(function(Ce){var _e=i$(0,s(s({},z),{values:z.values.map(function(Te,he){var Fe;return Ce.failures[he]?Te:(Te=(Fe=L.keyPath)!==null&&Fe!==void 0&&Fe.includes(".")?k(Te):s({},Te),T(Te,L.keyPath,Ce.results[he]),Te)})}),Ce);ue.optimisticOps.push(_e),queueMicrotask(function(){return z.mutatedParts&&Wy(z.mutatedParts)})}),se):A.mutate(z)},query:function(z){if(!s$(je,A)||!o$("query",z))return A.query(z);var se=((_e=je.trans)===null||_e===void 0?void 0:_e.db._options.cache)==="immutable",he=je,ue=he.requery,Ce=he.signal,_e=function(De,xe,Re,Me){var $e=Nu["idb://".concat(De,"/").concat(xe)];if(!$e)return[];if(!(xe=$e.queries[Re]))return[null,!1,$e,null];var He=xe[(Me.query?Me.query.index.name:null)||""];if(!He)return[null,!1,$e,null];switch(Re){case"query":var Ze=He.find(function(ot){return ot.req.limit===Me.limit&&ot.req.values===Me.values&&a$(ot.req.query.range,Me.query.range)});return Ze?[Ze,!0,$e,He]:[He.find(function(ot){return("limit"in ot.req?ot.req.limit:1/0)>=Me.limit&&(!Me.values||ot.req.values)&&wbe(ot.req.query.range,Me.query.range)}),!1,$e,He];case"count":return Ze=He.find(function(ot){return a$(ot.req.query.range,Me.query.range)}),[Ze,!!Ze,$e,He]}}(y,E,"query",z),Te=_e[0],he=_e[1],Fe=_e[2],be=_e[3];return Te&&he?Te.obsSet=z.obsSet:(he=A.query(z).then(function(De){var xe=De.result;if(Te&&(Te.res=xe),se){for(var Re=0,Me=xe.length;Re<Me;++Re)Object.freeze(xe[Re]);Object.freeze(xe)}else De.result=k(xe);return De}).catch(function(De){return be&&Te&&ee(be,Te),Promise.reject(De)}),Te={obsSet:z.obsSet,promise:he,subscribers:new Set,type:"query",req:z,dirty:!1},be?be.push(Te):(be=[Te],(Fe=Fe||(Nu["idb://".concat(y,"/").concat(E)]={queries:{query:{},count:{}},objs:new Map,optimisticOps:[],unsignaledParts:{}})).queries.query[z.query.index.name||""]=be)),Cbe(Te,be,ue,Ce),Te.promise.then(function(De){return{result:r$(De.result,z,Fe==null?void 0:Fe.optimisticOps,A,Te,se)}})}})}})}};function jy(m,y){return new Proxy(m,{get:function(E,A,L){return A==="db"?y:Reflect.get(E,A,L)}})}var Ca=(as.prototype.version=function(m){if(isNaN(m)||m<.1)throw new W.Type("Given version is not a positive number");if(m=Math.round(10*m)/10,this.idbdb||this._state.isBeingOpened)throw new W.Schema("Cannot add version when database is open");this.verno=Math.max(this.verno,m);var y=this._versions,E=y.filter(function(A){return A._cfg.version===m})[0];return E||(E=new this.Version(m),y.push(E),y.sort(cbe),E.stores({}),this._state.autoSchema=!1,E)},as.prototype._whenReady=function(m){var y=this;return this.idbdb&&(this._state.openComplete||je.letThrough||this._vip)?m():new st(function(E,A){if(y._state.openComplete)return A(new W.DatabaseClosed(y._state.dbOpenError));if(!y._state.isBeingOpened){if(!y._state.autoOpen)return void A(new W.DatabaseClosed);y.open().catch(Ie)}y._state.dbReadyPromise.then(E,A)}).then(m)},as.prototype.use=function(m){var y=m.stack,E=m.create,A=m.level,L=m.name;return L&&this.unuse({stack:y,name:L}),m=this._middlewares[y]||(this._middlewares[y]=[]),m.push({stack:y,create:E,level:A??10,name:L}),m.sort(function(z,se){return z.level-se.level}),this},as.prototype.unuse=function(m){var y=m.stack,E=m.name,A=m.create;return y&&this._middlewares[y]&&(this._middlewares[y]=this._middlewares[y].filter(function(L){return A?L.create!==A:!!E&&L.name!==E})),this},as.prototype.open=function(){var m=this;return Co(Ne,function(){return pbe(m)})},as.prototype._close=function(){var m=this._state,y=Md.indexOf(this);if(0<=y&&Md.splice(y,1),this.idbdb){try{this.idbdb.close()}catch{}this.idbdb=null}m.isBeingOpened||(m.dbReadyPromise=new st(function(E){m.dbReadyResolve=E}),m.openCanceller=new st(function(E,A){m.cancelOpen=A}))},as.prototype.close=function(E){var y=(E===void 0?{disableAutoOpen:!0}:E).disableAutoOpen,E=this._state;y?(E.isBeingOpened&&E.cancelOpen(new W.DatabaseClosed),this._close(),E.autoOpen=!1,E.dbOpenError=new W.DatabaseClosed):(this._close(),E.autoOpen=this._options.autoOpen||E.isBeingOpened,E.openComplete=!1,E.dbOpenError=null)},as.prototype.delete=function(m){var y=this;m===void 0&&(m={disableAutoOpen:!0});var E=0<arguments.length&&typeof arguments[0]!="object",A=this._state;return new st(function(L,z){function se(){y.close(m);var ue=y._deps.indexedDB.deleteDatabase(y.name);ue.onsuccess=kn(function(){var Ce,_e,Te;Ce=y._deps,_e=y.name,Te=Ce.indexedDB,Ce=Ce.IDBKeyRange,B_(Te)||_e===Py||V_(Te,Ce).delete(_e).catch(Ie),L()}),ue.onerror=Ar(z),ue.onblocked=y._fireOnBlocked}if(E)throw new W.InvalidArgument("Invalid closeOptions argument to db.delete()");A.isBeingOpened?A.dbReadyPromise.then(se):se()})},as.prototype.backendDB=function(){return this.idbdb},as.prototype.isOpen=function(){return this.idbdb!==null},as.prototype.hasBeenClosed=function(){var m=this._state.dbOpenError;return m&&m.name==="DatabaseClosed"},as.prototype.hasFailed=function(){return this._state.dbOpenError!==null},as.prototype.dynamicallyOpened=function(){return this._state.autoSchema},Object.defineProperty(as.prototype,"tables",{get:function(){var m=this;return r(this._allTables).map(function(y){return m._allTables[y]})},enumerable:!1,configurable:!0}),as.prototype.transaction=function(){var m=(function(y,E,A){var L=arguments.length;if(L<2)throw new W.InvalidArgument("Too few arguments");for(var z=new Array(L-1);--L;)z[L-1]=arguments[L];return A=z.pop(),[y,P(z),A]}).apply(this,arguments);return this._transaction.apply(this,m)},as.prototype._transaction=function(m,y,E){var A=this,L=je.trans;L&&L.db===this&&m.indexOf("!")===-1||(L=null);var z,se,ue=m.indexOf("?")!==-1;m=m.replace("!","").replace("?","");try{if(se=y.map(function(_e){if(_e=_e instanceof A.Table?_e.name:_e,typeof _e!="string")throw new TypeError("Invalid table argument to Dexie.transaction(). Only Table or String are allowed");return _e}),m=="r"||m===D_)z=D_;else{if(m!="rw"&&m!=T_)throw new W.InvalidArgument("Invalid transaction mode: "+m);z=T_}if(L){if(L.mode===D_&&z===T_){if(!ue)throw new W.SubTransaction("Cannot enter a sub-transaction with READWRITE mode when parent transaction is READONLY");L=null}L&&se.forEach(function(_e){if(L&&L.storeNames.indexOf(_e)===-1){if(!ue)throw new W.SubTransaction("Table "+_e+" not included in parent transaction.");L=null}}),ue&&L&&!L.active&&(L=null)}}catch(_e){return L?L._promise(null,function(Te,he){he(_e)}):Kn(_e)}var Ce=(function _e(Te,he,Fe,be,De){return st.resolve().then(function(){var xe=je.transless||je,Re=Te._createTransaction(he,Fe,Te._dbSchema,be);if(Re.explicit=!0,xe={trans:Re,transless:xe},be)Re.idbtrans=be.idbtrans;else try{Re.create(),Re.idbtrans._explicit=!0,Te._state.PR1398_maxLoop=3}catch(He){return He.name===ae.InvalidState&&Te.isOpen()&&0<--Te._state.PR1398_maxLoop?(console.warn("Dexie: Need to reopen db"),Te.close({disableAutoOpen:!1}),Te.open().then(function(){return _e(Te,he,Fe,null,De)})):Kn(He)}var Me,$e=te(De);return $e&&Ye(),xe=st.follow(function(){var He;(Me=De.call(Re,Re))&&($e?(He=jt.bind(null,null),Me.then(He,He)):typeof Me.next=="function"&&typeof Me.throw=="function"&&(Me=j_(Me)))},xe),(Me&&typeof Me.then=="function"?st.resolve(Me).then(function(He){return Re.active?He:Kn(new W.PrematureCommit("Transaction committed too early. See http://bit.ly/2kdckMn"))}):xe.then(function(){return Me})).then(function(He){return be&&Re._resolve(),Re._completion.then(function(){return He})}).catch(function(He){return Re._reject(He),Kn(He)})})}).bind(null,this,z,se,L,E);return L?L._promise(z,Ce,"lock"):je.trans?Co(je.transless,function(){return A._whenReady(Ce)}):this._whenReady(Ce)},as.prototype.table=function(m){if(!d(this._allTables,m))throw new W.InvalidTable("Table ".concat(m," does not exist"));return this._allTables[m]},as);function as(m,y){var E=this;this._middlewares={},this.verno=0;var A=as.dependencies;this._options=y=s({addons:as.addons,autoOpen:!0,indexedDB:A.indexedDB,IDBKeyRange:A.IDBKeyRange,cache:"cloned"},y),this._deps={indexedDB:y.indexedDB,IDBKeyRange:y.IDBKeyRange},A=y.addons,this._dbSchema={},this._versions=[],this._storeNames=[],this._allTables={},this.idbdb=null,this._novip=this;var L,z,se,ue,Ce,_e={dbOpenError:null,isBeingOpened:!1,onReadyBeingFired:null,openComplete:!1,dbReadyResolve:Ie,dbReadyPromise:null,cancelOpen:Ie,openCanceller:null,autoSchema:!0,PR1398_maxLoop:3,autoOpen:y.autoOpen};_e.dbReadyPromise=new st(function(he){_e.dbReadyResolve=he}),_e.openCanceller=new st(function(he,Fe){_e.cancelOpen=Fe}),this._state=_e,this.name=m,this.on=yp(this,"populate","blocked","versionchange","close",{ready:[M,Ie]}),this.on.ready.subscribe=b(this.on.ready.subscribe,function(he){return function(Fe,be){as.vip(function(){var De,xe=E._state;xe.openComplete?(xe.dbOpenError||st.resolve().then(Fe),be&&he(Fe)):xe.onReadyBeingFired?(xe.onReadyBeingFired.push(Fe),be&&he(Fe)):(he(Fe),De=E,be||he(function Re(){De.on.ready.unsubscribe(Fe),De.on.ready.unsubscribe(Re)}))})}}),this.Collection=(L=this,wp(sbe.prototype,function(Me,Re){this.db=L;var be=VB,De=null;if(Re)try{be=Re()}catch($e){De=$e}var xe=Me._ctx,Re=xe.table,Me=Re.hook.reading.fire;this._ctx={table:Re,index:xe.index,isPrimKey:!xe.index||Re.schema.primKey.keyPath&&xe.index===Re.schema.primKey.name,range:be,keysOnly:!1,dir:"next",unique:"",algorithm:null,filter:null,replayFilter:null,justLimit:!0,isMatch:null,offset:0,limit:1/0,error:De,or:xe.or,valueMapper:Me!==G?Me:null}})),this.Table=(z=this,wp(GB.prototype,function(he,Fe,be){this.db=z,this._tx=be,this.name=he,this.schema=Fe,this.hook=z._allTables[he]?z._allTables[he].hook:yp(null,{creating:[ke,Ie],reading:[Z,G],updating:[Le,Ie],deleting:[Pe,Ie]})})),this.Transaction=(se=this,wp(rbe.prototype,function(he,Fe,be,De,xe){var Re=this;this.db=se,this.mode=he,this.storeNames=Fe,this.schema=be,this.chromeTransactionDurability=De,this.idbtrans=null,this.on=yp(this,"complete","error","abort"),this.parent=xe||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 st(function(Me,$e){Re._resolve=Me,Re._reject=$e}),this._completion.then(function(){Re.active=!1,Re.on.complete.fire()},function(Me){var $e=Re.active;return Re.active=!1,Re.on.error.fire(Me),Re.parent?Re.parent._reject(Me):$e&&Re.idbtrans&&Re.idbtrans.abort(),Kn(Me)})})),this.Version=(ue=this,wp(fbe.prototype,function(he){this.db=ue,this._cfg={version:he,storesSource:null,dbschema:{},tables:{},contentUpgrade:null}})),this.WhereClause=(Ce=this,wp(KB.prototype,function(he,Fe,be){if(this.db=Ce,this._ctx={table:he,index:Fe===":id"?null:Fe,or:be},this._cmp=this._ascending=ln,this._descending=function(De,xe){return ln(xe,De)},this._max=function(De,xe){return 0<ln(De,xe)?De:xe},this._min=function(De,xe){return ln(De,xe)<0?De:xe},this._IDBKeyRange=Ce._deps.IDBKeyRange,!this._IDBKeyRange)throw new W.MissingAPI})),this.on("versionchange",function(he){0<he.newVersion?console.warn("Another connection wants to upgrade database '".concat(E.name,"'. Closing db now to resume the upgrade.")):console.warn("Another connection wants to delete database '".concat(E.name,"'. Closing db now to resume the delete request.")),E.close({disableAutoOpen:!1})}),this.on("blocked",function(he){!he.newVersion||he.newVersion<he.oldVersion?console.warn("Dexie.delete('".concat(E.name,"') was blocked")):console.warn("Upgrade '".concat(E.name,"' blocked by other connection holding version ").concat(he.oldVersion/10))}),this._maxKey=Ep(y.IDBKeyRange),this._createTransaction=function(he,Fe,be,De){return new E.Transaction(he,Fe,be,E._options.chromeTransactionDurability,De)},this._fireOnBlocked=function(he){E.on("blocked").fire(he),Md.filter(function(Fe){return Fe.name===E.name&&Fe!==E&&!Fe._state.vcFired}).map(function(Fe){return Fe.on("versionchange").fire(he)})},this.use(vbe),this.use(bbe),this.use(ybe),this.use(gbe),this.use(mbe);var Te=new Proxy(this,{get:function(he,Fe,be){if(Fe==="_vip")return!0;if(Fe==="table")return function(xe){return jy(E.table(xe),Te)};var De=Reflect.get(he,Fe,be);return De instanceof GB?jy(De,Te):Fe==="tables"?De.map(function(xe){return jy(xe,Te)}):Fe==="_createTransaction"?function(){return jy(De.apply(this,arguments),Te)}:De}});this.vip=Te,A.forEach(function(he){return he(E)})}var Ky,mi=typeof Symbol<"u"&&"observable"in Symbol?Symbol.observable:"@@observable",Sbe=(Z_.prototype.subscribe=function(m,y,E){return this._subscribe(m&&typeof m!="function"?m:{next:m,error:y,complete:E})},Z_.prototype[mi]=function(){return this},Z_);function Z_(m){this._subscribe=m}try{Ky={indexedDB:i.indexedDB||i.mozIndexedDB||i.webkitIndexedDB||i.msIndexedDB,IDBKeyRange:i.IDBKeyRange||i.webkitIDBKeyRange}}catch{Ky={indexedDB:null,IDBKeyRange:null}}function l$(m){var y,E=!1,A=new Sbe(function(L){var z=te(m),se,ue=!1,Ce={},_e={},Te={get closed(){return ue},unsubscribe:function(){ue||(ue=!0,se&&se.abort(),he&&vl.storagemutated.unsubscribe(be))}};L.start&&L.start(Te);var he=!1,Fe=function(){return Fy(De)},be=function(xe){Uy(Ce,xe),G_(_e,Ce)&&Fe()},De=function(){var xe,Re,Me;!ue&&Ky.indexedDB&&(Ce={},xe={},se&&se.abort(),se=new AbortController,Me=function($e){var He=xr();try{z&&Ye();var Ze=Ae(m,$e);return Ze=z?Ze.finally(jt):Ze}finally{He&&pi()}}(Re={subscr:xe,signal:se.signal,requery:Fe,querier:m,trans:null}),Promise.resolve(Me).then(function($e){E=!0,y=$e,ue||Re.signal.aborted||(Ce={},function(He){for(var Ze in He)if(d(He,Ze))return;return 1}(_e=xe)||he||(vl(Sp,be),he=!0),Fy(function(){return!ue&&L.next&&L.next($e)}))},function($e){E=!1,["DatabaseClosedError","AbortError"].includes($e==null?void 0:$e.name)||ue||Fy(function(){ue||L.error&&L.error($e)})}))};return setTimeout(Fe,0),Te});return A.hasValue=function(){return E},A.getValue=function(){return y},A}var Lu=Ca;function X_(m){var y=yl;try{yl=!0,vl.storagemutated.fire(m),z_(m,!0)}finally{yl=y}}h(Lu,s(s({},oe),{delete:function(m){return new Lu(m,{addons:[]}).delete()},exists:function(m){return new Lu(m,{addons:[]}).open().then(function(y){return y.close(),!0}).catch("NoSuchDatabaseError",function(){return!1})},getDatabaseNames:function(m){try{return y=Lu.dependencies,E=y.indexedDB,y=y.IDBKeyRange,(B_(E)?Promise.resolve(E.databases()).then(function(A){return A.map(function(L){return L.name}).filter(function(L){return L!==Py})}):V_(E,y).toCollection().primaryKeys()).then(m)}catch{return Kn(new W.MissingAPI)}var y,E},defineClass:function(){return function(m){l(this,m)}},ignoreTransaction:function(m){return je.trans?Co(je.transless,m):m()},vip:$_,async:function(m){return function(){try{var y=j_(m.apply(this,arguments));return y&&typeof y.then=="function"?y:st.resolve(y)}catch(E){return Kn(E)}}},spawn:function(m,y,E){try{var A=j_(m.apply(E,y||[]));return A&&typeof A.then=="function"?A:st.resolve(A)}catch(L){return Kn(L)}},currentTransaction:{get:function(){return je.trans||null}},waitFor:function(m,y){return y=st.resolve(typeof m=="function"?Lu.ignoreTransaction(m):m).timeout(y||6e4),je.trans?je.trans.waitFor(y):y},Promise:st,debug:{get:function(){return H},set:function(m){le(m)}},derive:g,extend:l,props:h,override:b,Events:yp,on:vl,liveQuery:l$,extendObservabilitySet:Uy,getByKeyPath:R,setByKeyPath:T,delByKeyPath:function(m,y){typeof y=="string"?T(m,y,void 0):"length"in y&&[].map.call(y,function(E){T(m,E,void 0)})},shallowClone:I,deepClone:k,getObjectDiff:K_,cmp:ln,asap:_,minKey:-1/0,addons:[],connections:Md,errnames:ae,dependencies:Ky,cache:Nu,semVer:"4.0.10",version:"4.0.10".split(".").map(function(m){return parseInt(m)}).reduce(function(m,y,E){return m+y/Math.pow(10,2*E)})})),Lu.maxKey=Ep(Lu.dependencies.IDBKeyRange),typeof dispatchEvent<"u"&&typeof addEventListener<"u"&&(vl(Sp,function(m){yl||(m=new CustomEvent(P_,{detail:m}),yl=!0,dispatchEvent(m),yl=!1)}),addEventListener(P_,function(m){m=m.detail,yl||X_(m)}));var Vd,yl=!1,u$=function(){};return typeof BroadcastChannel<"u"&&((u$=function(){(Vd=new BroadcastChannel(P_)).onmessage=function(m){return m.data&&X_(m.data)}})(),typeof Vd.unref=="function"&&Vd.unref(),vl(Sp,function(m){yl||Vd.postMessage(m)})),typeof addEventListener<"u"&&(addEventListener("pagehide",function(m){if(!Ca.disableBfCache&&m.persisted){H&&console.debug("Dexie: handling persisted pagehide"),Vd!=null&&Vd.close();for(var y=0,E=Md;y<E.length;y++)E[y].close({disableAutoOpen:!1})}}),addEventListener("pageshow",function(m){!Ca.disableBfCache&&m.persisted&&(H&&console.debug("Dexie: handling persisted pageshow"),u$(),X_({all:new Ks(-1/0,[[]])}))})),st.rejectionMapper=function(m,y){return!m||m instanceof V||m instanceof TypeError||m instanceof SyntaxError||!m.name||!fe[m.name]?m:(y=new fe[m.name](y||m.message,m),"stack"in m&&p(y,"stack",{get:function(){return this.inner.stack}}),y)},le(H),s(Ca,Object.freeze({__proto__:null,Dexie:Ca,liveQuery:l$,Entity:BB,cmp:ln,PropModSymbol:wa,PropModification:Cp,replacePrefix:function(m,y){return new Cp({replacePrefix:[m,y]})},add:function(m){return new Cp({add:m})},remove:function(m){return new Cp({remove:m})},default:Ca,RangeSet:Ks,mergeRanges:Dp,rangesOverlap:JB}),{default:Ca}),Ca})})(B1);var $z=B1.exports;const bC=Bz($z),$1=Symbol.for("Dexie"),Rh=globalThis[$1]||(globalThis[$1]=bC);if(bC.semVer!==Rh.semVer)throw new Error(`Two different versions of Dexie loaded in the same app: ${bC.semVer} and ${Rh.semVer}`);const{liveQuery:Lbe,mergeRanges:Vbe,rangesOverlap:Bbe,RangeSet:$be,cmp:Hbe,Entity:Gbe,PropModSymbol:Ube,PropModification:Wbe,replacePrefix:zbe,add:jbe,remove:Kbe}=Rh;class H1 extends Rh{constructor(n){super(n);es(this,"icons");es(this,"visuals");es(this,"users");es(this,"columns");es(this,"general");this.version(1).stores({icons:"key",visuals:"key",users:"key",columns:"key",general:"key"})}getTable(n){return this[n]?this[n]:this.general}}const Ag=new Map,Hz=async e=>{if(!Ag.has(e)){const t=new H1(e);try{await t.open(),Ag.set(e,t)}catch(n){console.error("Failed to open database, attempting to delete and recreate:",n);try{await Rh.delete(e);const s=new H1(e);await s.open(),Ag.set(e,s)}catch(s){throw console.error("Failed to delete and recreate database:",s),s}}}return Ag.get(e)},Dh=({dbName:e,storeName:t})=>{const n=async()=>(await Hz(e)).getTable(t);return{getCachedValue:async u=>{try{const c=await n();if(!c){console.error(`Store is undefined for key: ${u}`);return}const d=await c.get(u);return d==null?void 0:d.value}catch(c){console.error("Failed to get cached value:",c);return}},setCachedValue:async(u,c)=>{try{const d=await n();if(!d){console.error(`Store is undefined, cannot cache key: ${u}`);return}await d.put({key:u,value:c,timestamp:Date.now()})}catch(d){console.error("Failed to cache value:",d)}},deleteCachedValue:async u=>{try{const c=await n();if(!c){console.error(`Store is undefined, cannot delete key: ${u}`);return}await c.delete(u)}catch(c){console.error("Failed to delete cached value:",c)}},clearCache:async()=>{try{const u=await n();if(!u){console.error("Store is undefined, cannot clear cache");return}await u.clear()}catch(u){console.error("Failed to clear cache:",u)}},getAllKeys:async()=>{try{const u=await n();return u?(await u.toArray()).map(d=>d.key):(console.error("Store is undefined, cannot get all keys"),[])}catch(u){return console.error("Failed to get all keys:",u),[]}},getCachedValueWithTimestamp:async u=>{try{const c=await n();if(!c){console.error(`Store is undefined for key: ${u}`);return}return await c.get(u)}catch(c){console.error("Failed to get cached value with timestamp:",c);return}}}},Gz="AvatarCache",Uz="images",Bl={},kg={},Wz=()=>{const{getCachedValue:e,setCachedValue:t}=Dh({dbName:Gz,storeName:Uz}),n=a=>new Promise((l,u)=>{const c=new FileReader;c.onloadend=()=>l(c.result),c.onerror=u,c.readAsDataURL(a)}),s=async a=>{try{if(Bl[a])return Bl[a];if(kg[a])return await kg[a];const l=(async()=>{try{const u=await e(a);if(!u||!(u instanceof Blob))return null;const c=await n(u);return Bl[a]=c,c}catch(u){return console.warn(`Failed to get cached image for key: ${a}`,u),null}})();return kg[a]=l,l.finally(()=>{delete kg[a]}),await l}catch(l){return console.error(`Error in getCachedImage for key: ${a}`,l),null}},o=a=>new Promise((l,u)=>{new Vz(a,{width:96,height:96,quality:1,success(c){l(c)},error(c){console.error("Image compression failed:",c.message),u(c)}})});return{getCachedImage:s,setCachedImage:async(a,l)=>{try{const u=await o(l);await t(a,u);const c=await n(u);Bl[a]=c}catch(u){throw console.error(`Failed to cache image for key: ${a}`,u),u}},clearMemoryCache:a=>{try{a?delete Bl[a]:Object.keys(Bl).forEach(l=>delete Bl[l])}catch(l){console.error("Error clearing memory cache:",l)}}}},Th=new Map,sr=new Map,ic=new Map,zz=5*60*1e3,G1=100;function jz(){const e=Date.now(),t=[];ic.forEach((n,s)=>{e-n>zz&&t.push(s)}),t.forEach(n=>{Th.delete(n),ic.delete(n),sr.delete(n)})}function Kz(){if(ic.size<=G1)return;const e=Array.from(ic.entries()).sort((n,s)=>n[1]-s[1]);e.slice(0,e.length-G1).forEach(([n])=>{Th.delete(n),ic.delete(n),sr.delete(n)})}const qz=(e,t)=>{const n=sr.get(e);return n==null||n.forEach(s=>s(t)),sr.delete(e),t};async function Yz({userId:e,avatarUrl:t,cacheInterface:n,onLoadingChange:s}){let o=e;if(t)try{const d=new URL(t,"http://localhost").pathname.split("/").pop();d?o=`${e}_${d}`:o=t}catch{o=t||e}const i=await n.getCachedImage(o),r=Th.has(o),a=sr.has(o);if(i)return qz(o,i);if(jz(),r)return new Promise(c=>{a||sr.set(o,[]),sr.get(o).push(c)});const l=(async()=>{let c=null,d=null;try{const h=Math.random()*300;await new Promise(p=>setTimeout(p,h)),s==null||s(!0);const f=await fetch(t,{cache:"no-cache"});if(!f.ok)throw new Error("Failed to fetch image");return c=await f.blob(),await n.setCachedImage(o,c),d=URL.createObjectURL(c),d}catch(h){throw console.error("Error loading avatar image:",h),h}finally{c=null,s==null||s(!1),ic.set(o,Date.now()),setTimeout(()=>{Th.delete(o),Kz()},100)}})();Th.set(o,l);const u=await l;return sr.has(o)&&(sr.get(o).forEach(d=>d(u)),sr.delete(o)),u}const Zz=(e,t=3,n=1e3)=>{const s=B(0),o=B(!1),i=B(!1),r=async()=>{try{await e()}catch(a){if(s.value<t)return s.value++,i.value=!0,await new Promise(l=>setTimeout(l,n)),r();throw o.value=!0,a}};return{retry:r,currentAttempt:s,errorRetry:o,isRetrying:i}};function xs(e,t){Xz(e)&&(e="100%");const n=Jz(e);return e=t===360?e:Math.min(t,Math.max(0,parseFloat(e))),n&&(e=parseInt(String(e*t),10)/100),Math.abs(e-t)<1e-6?1:(t===360?e=(e<0?e%t+t:e%t)/parseFloat(String(t)):e=e%t/parseFloat(String(t)),e)}function Og(e){return Math.min(1,Math.max(0,e))}function Xz(e){return typeof e=="string"&&e.indexOf(".")!==-1&&parseFloat(e)===1}function Jz(e){return typeof e=="string"&&e.indexOf("%")!==-1}function U1(e){return e=parseFloat(e),(isNaN(e)||e<0||e>1)&&(e=1),e}function Mg(e){return Number(e)<=1?`${Number(e)*100}%`:e}function $l(e){return e.length===1?"0"+e:String(e)}function Qz(e,t,n){return{r:xs(e,255)*255,g:xs(t,255)*255,b:xs(n,255)*255}}function W1(e,t,n){e=xs(e,255),t=xs(t,255),n=xs(n,255);const s=Math.max(e,t,n),o=Math.min(e,t,n);let i=0,r=0;const a=(s+o)/2;if(s===o)r=0,i=0;else{const l=s-o;switch(r=a>.5?l/(2-s-o):l/(s+o),s){case e:i=(t-n)/l+(t<n?6:0);break;case t:i=(n-e)/l+2;break;case n:i=(e-t)/l+4;break}i/=6}return{h:i,s:r,l:a}}function SC(e,t,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?e+(t-e)*(6*n):n<1/2?t:n<2/3?e+(t-e)*(2/3-n)*6:e}function e3(e,t,n){let s,o,i;if(e=xs(e,360),t=xs(t,100),n=xs(n,100),t===0)o=n,i=n,s=n;else{const r=n<.5?n*(1+t):n+t-n*t,a=2*n-r;s=SC(a,r,e+1/3),o=SC(a,r,e),i=SC(a,r,e-1/3)}return{r:s*255,g:o*255,b:i*255}}function z1(e,t,n){e=xs(e,255),t=xs(t,255),n=xs(n,255);const s=Math.max(e,t,n),o=Math.min(e,t,n);let i=0;const r=s,a=s-o,l=s===0?0:a/s;if(s===o)i=0;else{switch(s){case e:i=(t-n)/a+(t<n?6:0);break;case t:i=(n-e)/a+2;break;case n:i=(e-t)/a+4;break}i/=6}return{h:i,s:l,v:r}}function t3(e,t,n){e=xs(e,360)*6,t=xs(t,100),n=xs(n,100);const s=Math.floor(e),o=e-s,i=n*(1-t),r=n*(1-o*t),a=n*(1-(1-o)*t),l=s%6,u=[n,r,i,i,a,n][l],c=[a,n,n,r,i,i][l],d=[i,i,a,n,n,r][l];return{r:u*255,g:c*255,b:d*255}}function j1(e,t,n,s){const o=[$l(Math.round(e).toString(16)),$l(Math.round(t).toString(16)),$l(Math.round(n).toString(16))];return s&&o[0].startsWith(o[0].charAt(1))&&o[1].startsWith(o[1].charAt(1))&&o[2].startsWith(o[2].charAt(1))?o[0].charAt(0)+o[1].charAt(0)+o[2].charAt(0):o.join("")}function n3(e,t,n,s,o){const i=[$l(Math.round(e).toString(16)),$l(Math.round(t).toString(16)),$l(Math.round(n).toString(16)),$l(o3(s))];return o&&i[0].startsWith(i[0].charAt(1))&&i[1].startsWith(i[1].charAt(1))&&i[2].startsWith(i[2].charAt(1))&&i[3].startsWith(i[3].charAt(1))?i[0].charAt(0)+i[1].charAt(0)+i[2].charAt(0)+i[3].charAt(0):i.join("")}function s3(e,t,n,s){const o=e/100,i=t/100,r=n/100,a=s/100,l=255*(1-o)*(1-a),u=255*(1-i)*(1-a),c=255*(1-r)*(1-a);return{r:l,g:u,b:c}}function K1(e,t,n){let s=1-e/255,o=1-t/255,i=1-n/255,r=Math.min(s,o,i);return r===1?(s=0,o=0,i=0):(s=(s-r)/(1-r)*100,o=(o-r)/(1-r)*100,i=(i-r)/(1-r)*100),r*=100,{c:Math.round(s),m:Math.round(o),y:Math.round(i),k:Math.round(r)}}function o3(e){return Math.round(parseFloat(e)*255).toString(16)}function q1(e){return Fo(e)/255}function Fo(e){return parseInt(e,16)}function i3(e){return{r:e>>16,g:(e&65280)>>8,b:e&255}}const EC={aliceblue:"#f0f8ff",antiquewhite:"#faebd7",aqua:"#00ffff",aquamarine:"#7fffd4",azure:"#f0ffff",beige:"#f5f5dc",bisque:"#ffe4c4",black:"#000000",blanchedalmond:"#ffebcd",blue:"#0000ff",blueviolet:"#8a2be2",brown:"#a52a2a",burlywood:"#deb887",cadetblue:"#5f9ea0",chartreuse:"#7fff00",chocolate:"#d2691e",coral:"#ff7f50",cornflowerblue:"#6495ed",cornsilk:"#fff8dc",crimson:"#dc143c",cyan:"#00ffff",darkblue:"#00008b",darkcyan:"#008b8b",darkgoldenrod:"#b8860b",darkgray:"#a9a9a9",darkgreen:"#006400",darkgrey:"#a9a9a9",darkkhaki:"#bdb76b",darkmagenta:"#8b008b",darkolivegreen:"#556b2f",darkorange:"#ff8c00",darkorchid:"#9932cc",darkred:"#8b0000",darksalmon:"#e9967a",darkseagreen:"#8fbc8f",darkslateblue:"#483d8b",darkslategray:"#2f4f4f",darkslategrey:"#2f4f4f",darkturquoise:"#00ced1",darkviolet:"#9400d3",deeppink:"#ff1493",deepskyblue:"#00bfff",dimgray:"#696969",dimgrey:"#696969",dodgerblue:"#1e90ff",firebrick:"#b22222",floralwhite:"#fffaf0",forestgreen:"#228b22",fuchsia:"#ff00ff",gainsboro:"#dcdcdc",ghostwhite:"#f8f8ff",goldenrod:"#daa520",gold:"#ffd700",gray:"#808080",green:"#008000",greenyellow:"#adff2f",grey:"#808080",honeydew:"#f0fff0",hotpink:"#ff69b4",indianred:"#cd5c5c",indigo:"#4b0082",ivory:"#fffff0",khaki:"#f0e68c",lavenderblush:"#fff0f5",lavender:"#e6e6fa",lawngreen:"#7cfc00",lemonchiffon:"#fffacd",lightblue:"#add8e6",lightcoral:"#f08080",lightcyan:"#e0ffff",lightgoldenrodyellow:"#fafad2",lightgray:"#d3d3d3",lightgreen:"#90ee90",lightgrey:"#d3d3d3",lightpink:"#ffb6c1",lightsalmon:"#ffa07a",lightseagreen:"#20b2aa",lightskyblue:"#87cefa",lightslategray:"#778899",lightslategrey:"#778899",lightsteelblue:"#b0c4de",lightyellow:"#ffffe0",lime:"#00ff00",limegreen:"#32cd32",linen:"#faf0e6",magenta:"#ff00ff",maroon:"#800000",mediumaquamarine:"#66cdaa",mediumblue:"#0000cd",mediumorchid:"#ba55d3",mediumpurple:"#9370db",mediumseagreen:"#3cb371",mediumslateblue:"#7b68ee",mediumspringgreen:"#00fa9a",mediumturquoise:"#48d1cc",mediumvioletred:"#c71585",midnightblue:"#191970",mintcream:"#f5fffa",mistyrose:"#ffe4e1",moccasin:"#ffe4b5",navajowhite:"#ffdead",navy:"#000080",oldlace:"#fdf5e6",olive:"#808000",olivedrab:"#6b8e23",orange:"#ffa500",orangered:"#ff4500",orchid:"#da70d6",palegoldenrod:"#eee8aa",palegreen:"#98fb98",paleturquoise:"#afeeee",palevioletred:"#db7093",papayawhip:"#ffefd5",peachpuff:"#ffdab9",peru:"#cd853f",pink:"#ffc0cb",plum:"#dda0dd",powderblue:"#b0e0e6",purple:"#800080",rebeccapurple:"#663399",red:"#ff0000",rosybrown:"#bc8f8f",royalblue:"#4169e1",saddlebrown:"#8b4513",salmon:"#fa8072",sandybrown:"#f4a460",seagreen:"#2e8b57",seashell:"#fff5ee",sienna:"#a0522d",silver:"#c0c0c0",skyblue:"#87ceeb",slateblue:"#6a5acd",slategray:"#708090",slategrey:"#708090",snow:"#fffafa",springgreen:"#00ff7f",steelblue:"#4682b4",tan:"#d2b48c",teal:"#008080",thistle:"#d8bfd8",tomato:"#ff6347",turquoise:"#40e0d0",violet:"#ee82ee",wheat:"#f5deb3",white:"#ffffff",whitesmoke:"#f5f5f5",yellow:"#ffff00",yellowgreen:"#9acd32"};function r3(e){let t={r:0,g:0,b:0},n=1,s=null,o=null,i=null,r=!1,a=!1;return typeof e=="string"&&(e=a3(e)),typeof e=="object"&&(Po(e.r)&&Po(e.g)&&Po(e.b)?(t=Qz(e.r,e.g,e.b),r=!0,a=String(e.r).substr(-1)==="%"?"prgb":"rgb"):Po(e.h)&&Po(e.s)&&Po(e.v)?(s=Mg(e.s),o=Mg(e.v),t=t3(e.h,s,o),r=!0,a="hsv"):Po(e.h)&&Po(e.s)&&Po(e.l)?(s=Mg(e.s),i=Mg(e.l),t=e3(e.h,s,i),r=!0,a="hsl"):Po(e.c)&&Po(e.m)&&Po(e.y)&&Po(e.k)&&(t=s3(e.c,e.m,e.y,e.k),r=!0,a="cmyk"),Object.prototype.hasOwnProperty.call(e,"a")&&(n=e.a)),n=U1(n),{ok:r,format:e.format||a,r:Math.min(255,Math.max(t.r,0)),g:Math.min(255,Math.max(t.g,0)),b:Math.min(255,Math.max(t.b,0)),a:n}}const ka="(?:"+"[-\\+]?\\d*\\.\\d+%?"+")|(?:"+"[-\\+]?\\d+%?"+")",_C="[\\s|\\(]+("+ka+")[,|\\s]+("+ka+")[,|\\s]+("+ka+")\\s*\\)?",Ng="[\\s|\\(]+("+ka+")[,|\\s]+("+ka+")[,|\\s]+("+ka+")[,|\\s]+("+ka+")\\s*\\)?",Zo={CSS_UNIT:new RegExp(ka),rgb:new RegExp("rgb"+_C),rgba:new RegExp("rgba"+Ng),hsl:new RegExp("hsl"+_C),hsla:new RegExp("hsla"+Ng),hsv:new RegExp("hsv"+_C),hsva:new RegExp("hsva"+Ng),cmyk:new RegExp("cmyk"+Ng),hex3:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex6:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/,hex4:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex8:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/};function a3(e){if(e=e.trim().toLowerCase(),e.length===0)return!1;let t=!1;if(EC[e])e=EC[e],t=!0;else if(e==="transparent")return{r:0,g:0,b:0,a:0,format:"name"};let n=Zo.rgb.exec(e);return n?{r:n[1],g:n[2],b:n[3]}:(n=Zo.rgba.exec(e),n?{r:n[1],g:n[2],b:n[3],a:n[4]}:(n=Zo.hsl.exec(e),n?{h:n[1],s:n[2],l:n[3]}:(n=Zo.hsla.exec(e),n?{h:n[1],s:n[2],l:n[3],a:n[4]}:(n=Zo.hsv.exec(e),n?{h:n[1],s:n[2],v:n[3]}:(n=Zo.hsva.exec(e),n?{h:n[1],s:n[2],v:n[3],a:n[4]}:(n=Zo.cmyk.exec(e),n?{c:n[1],m:n[2],y:n[3],k:n[4]}:(n=Zo.hex8.exec(e),n?{r:Fo(n[1]),g:Fo(n[2]),b:Fo(n[3]),a:q1(n[4]),format:t?"name":"hex8"}:(n=Zo.hex6.exec(e),n?{r:Fo(n[1]),g:Fo(n[2]),b:Fo(n[3]),format:t?"name":"hex"}:(n=Zo.hex4.exec(e),n?{r:Fo(n[1]+n[1]),g:Fo(n[2]+n[2]),b:Fo(n[3]+n[3]),a:q1(n[4]+n[4]),format:t?"name":"hex8"}:(n=Zo.hex3.exec(e),n?{r:Fo(n[1]+n[1]),g:Fo(n[2]+n[2]),b:Fo(n[3]+n[3]),format:t?"name":"hex"}:!1))))))))))}function Po(e){return typeof e=="number"?!Number.isNaN(e):Zo.CSS_UNIT.test(e)}class Nn{constructor(t="",n={}){if(t instanceof Nn)return t;typeof t=="number"&&(t=i3(t)),this.originalInput=t;const s=r3(t);this.originalInput=t,this.r=s.r,this.g=s.g,this.b=s.b,this.a=s.a,this.roundA=Math.round(100*this.a)/100,this.format=n.format??s.format,this.gradientType=n.gradientType,this.r<1&&(this.r=Math.round(this.r)),this.g<1&&(this.g=Math.round(this.g)),this.b<1&&(this.b=Math.round(this.b)),this.isValid=s.ok}isDark(){return this.getBrightness()<128}isLight(){return!this.isDark()}getBrightness(){const t=this.toRgb();return(t.r*299+t.g*587+t.b*114)/1e3}getLuminance(){const t=this.toRgb();let n,s,o;const i=t.r/255,r=t.g/255,a=t.b/255;return i<=.03928?n=i/12.92:n=Math.pow((i+.055)/1.055,2.4),r<=.03928?s=r/12.92:s=Math.pow((r+.055)/1.055,2.4),a<=.03928?o=a/12.92:o=Math.pow((a+.055)/1.055,2.4),.2126*n+.7152*s+.0722*o}getAlpha(){return this.a}setAlpha(t){return this.a=U1(t),this.roundA=Math.round(100*this.a)/100,this}isMonochrome(){const{s:t}=this.toHsl();return t===0}toHsv(){const t=z1(this.r,this.g,this.b);return{h:t.h*360,s:t.s,v:t.v,a:this.a}}toHsvString(){const t=z1(this.r,this.g,this.b),n=Math.round(t.h*360),s=Math.round(t.s*100),o=Math.round(t.v*100);return this.a===1?`hsv(${n}, ${s}%, ${o}%)`:`hsva(${n}, ${s}%, ${o}%, ${this.roundA})`}toHsl(){const t=W1(this.r,this.g,this.b);return{h:t.h*360,s:t.s,l:t.l,a:this.a}}toHslString(){const t=W1(this.r,this.g,this.b),n=Math.round(t.h*360),s=Math.round(t.s*100),o=Math.round(t.l*100);return this.a===1?`hsl(${n}, ${s}%, ${o}%)`:`hsla(${n}, ${s}%, ${o}%, ${this.roundA})`}toHex(t=!1){return j1(this.r,this.g,this.b,t)}toHexString(t=!1){return"#"+this.toHex(t)}toHex8(t=!1){return n3(this.r,this.g,this.b,this.a,t)}toHex8String(t=!1){return"#"+this.toHex8(t)}toHexShortString(t=!1){return this.a===1?this.toHexString(t):this.toHex8String(t)}toRgb(){return{r:Math.round(this.r),g:Math.round(this.g),b:Math.round(this.b),a:this.a}}toRgbString(){const t=Math.round(this.r),n=Math.round(this.g),s=Math.round(this.b);return this.a===1?`rgb(${t}, ${n}, ${s})`:`rgba(${t}, ${n}, ${s}, ${this.roundA})`}toPercentageRgb(){const t=n=>`${Math.round(xs(n,255)*100)}%`;return{r:t(this.r),g:t(this.g),b:t(this.b),a:this.a}}toPercentageRgbString(){const t=n=>Math.round(xs(n,255)*100);return this.a===1?`rgb(${t(this.r)}%, ${t(this.g)}%, ${t(this.b)}%)`:`rgba(${t(this.r)}%, ${t(this.g)}%, ${t(this.b)}%, ${this.roundA})`}toCmyk(){return{...K1(this.r,this.g,this.b)}}toCmykString(){const{c:t,m:n,y:s,k:o}=K1(this.r,this.g,this.b);return`cmyk(${t}, ${n}, ${s}, ${o})`}toName(){if(this.a===0)return"transparent";if(this.a<1)return!1;const t="#"+j1(this.r,this.g,this.b,!1);for(const[n,s]of Object.entries(EC))if(t===s)return n;return!1}toString(t){const n=!!t;t=t??this.format;let s=!1;const o=this.a<1&&this.a>=0;return!n&&o&&(t.startsWith("hex")||t==="name")?t==="name"&&this.a===0?this.toName():this.toRgbString():(t==="rgb"&&(s=this.toRgbString()),t==="prgb"&&(s=this.toPercentageRgbString()),(t==="hex"||t==="hex6")&&(s=this.toHexString()),t==="hex3"&&(s=this.toHexString(!0)),t==="hex4"&&(s=this.toHex8String(!0)),t==="hex8"&&(s=this.toHex8String()),t==="name"&&(s=this.toName()),t==="hsl"&&(s=this.toHslString()),t==="hsv"&&(s=this.toHsvString()),t==="cmyk"&&(s=this.toCmykString()),s||this.toHexString())}toNumber(){return(Math.round(this.r)<<16)+(Math.round(this.g)<<8)+Math.round(this.b)}clone(){return new Nn(this.toString())}lighten(t=10){const n=this.toHsl();return n.l+=t/100,n.l=Og(n.l),new Nn(n)}brighten(t=10){const n=this.toRgb();return n.r=Math.max(0,Math.min(255,n.r-Math.round(255*-(t/100)))),n.g=Math.max(0,Math.min(255,n.g-Math.round(255*-(t/100)))),n.b=Math.max(0,Math.min(255,n.b-Math.round(255*-(t/100)))),new Nn(n)}darken(t=10){const n=this.toHsl();return n.l-=t/100,n.l=Og(n.l),new Nn(n)}tint(t=10){return this.mix("white",t)}shade(t=10){return this.mix("black",t)}desaturate(t=10){const n=this.toHsl();return n.s-=t/100,n.s=Og(n.s),new Nn(n)}saturate(t=10){const n=this.toHsl();return n.s+=t/100,n.s=Og(n.s),new Nn(n)}greyscale(){return this.desaturate(100)}spin(t){const n=this.toHsl(),s=(n.h+t)%360;return n.h=s<0?360+s:s,new Nn(n)}mix(t,n=50){const s=this.toRgb(),o=new Nn(t).toRgb(),i=n/100,r={r:(o.r-s.r)*i+s.r,g:(o.g-s.g)*i+s.g,b:(o.b-s.b)*i+s.b,a:(o.a-s.a)*i+s.a};return new Nn(r)}analogous(t=6,n=30){const s=this.toHsl(),o=360/n,i=[this];for(s.h=(s.h-(o*t>>1)+720)%360;--t;)s.h=(s.h+o)%360,i.push(new Nn(s));return i}complement(){const t=this.toHsl();return t.h=(t.h+180)%360,new Nn(t)}monochromatic(t=6){const n=this.toHsv(),{h:s}=n,{s:o}=n;let{v:i}=n;const r=[],a=1/t;for(;t--;)r.push(new Nn({h:s,s:o,v:i})),i=(i+a)%1;return r}splitcomplement(){const t=this.toHsl(),{h:n}=t;return[this,new Nn({h:(n+72)%360,s:t.s,l:t.l}),new Nn({h:(n+216)%360,s:t.s,l:t.l})]}onBackground(t){const n=this.toRgb(),s=new Nn(t).toRgb(),o=n.a+s.a*(1-n.a);return new Nn({r:(n.r*n.a+s.r*s.a*(1-n.a))/o,g:(n.g*n.a+s.g*s.a*(1-n.a))/o,b:(n.b*n.a+s.b*s.a*(1-n.a))/o,a:o})}triad(){return this.polyad(3)}tetrad(){return this.polyad(4)}polyad(t){const n=this.toHsl(),{h:s}=n,o=[this],i=360/t;for(let r=1;r<t;r++)o.push(new Nn({h:(s+r*i)%360,s:n.s,l:n.l}));return o}equals(t){const n=new Nn(t);return this.format==="cmyk"||n.format==="cmyk"?this.toCmykString()===n.toCmykString():this.toRgbString()===n.toRgbString()}}function Y1(e){return new Nn(e||"").isValid}function Lg(e,t){const{c1:n,c2:s}={c1:new Nn(e),c2:new Nn(t)};return n.equals(s)}const l3=["src","alt"],Ih=_t(rt({__name:"Avatar",props:{name:{},id:{},profile_image:{},color:{},initial:{},isMe:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1},readOnly:{type:Boolean,default:!1},size:{default:24},isUseShortLabel:{type:Boolean,default:!0},borderRadius:{default:void 0}},setup(e){const t=e,n=B(""),s=B(!1),o=B(null),i=B(!1),r=Y(()=>({name:t.name||"",id:t.id||"",profile_image:t.profile_image||null,color:t.color||{bgColor:"#CCCCCC",textColor:"var(--background-color)"},initial:t.initial})),a=Y(()=>{var _;const w=((_=r.value.color)==null?void 0:_.bgColor)||"#CCCCCC";return Y1(w)?w:"#CCCCCC"}),l=Y(()=>{var _;const w=((_=r.value.color)==null?void 0:_.textColor)||"var(--background-color)";return Y1(w)?w:"var(--background-color)"}),u=Y(()=>{if(!t.isUseShortLabel)return"";const{initial:w,name:_}=r.value;if(typeof w=="string"&&w.trim())return w.trim();if(!(_!=null&&_.trim()))return"";const R=_.trim().split(/\s+/).filter(Boolean);return R.length===1?R[0].slice(0,2).toUpperCase():(R[0][0]+R[1][0]).toUpperCase()}),c=Y(()=>r.value.profile_image?"image":"text"),d=Y(()=>({"--avatar-size":`${t.size}px`,"--avatar-bg":a.value,"--avatar-border":t.isMe?"var(--primary-color)":"#f3f5f8","--text-color":l.value,"--font-size":`${Math.floor(t.size/2)}px`,"--border-radius":t.borderRadius?typeof t.borderRadius=="number"?`${t.borderRadius}px`:t.borderRadius:"4px"})),h=()=>{n.value="",i.value=!0},{getCachedImage:f,setCachedImage:p}=Wz(),g=async()=>{if(o.value&&o.value.abort(),n.value.startsWith("blob:")&&URL.revokeObjectURL(n.value),!r.value.id||!r.value.profile_image){n.value="";return}o.value=new AbortController;const w=o.value;try{const _=await Yz({userId:r.value.id,avatarUrl:r.value.profile_image,cacheInterface:{getCachedImage:f,setCachedImage:p},onLoadingChange:R=>{w.signal.aborted||(s.value=R)}});if(!w.signal.aborted&&(n.value=_,_.length===0))throw console.warn("Loaded avatar image is empty, displaying initials instead."),h(),new Error("Empty image source")}catch(_){w.signal.aborted||(console.error("Failed to load avatar:",_),n.value="")}},{retry:v,errorRetry:C,isRetrying:S}=Zz(g,3,2e3),b=nt(()=>[r.value.id,r.value.profile_image],v,{immediate:!0});return vs(()=>{b(),o.value&&(o.value.abort(),o.value=null),n.value.startsWith("blob:")&&URL.revokeObjectURL(n.value),n.value="",s.value=!1}),(w,_)=>(j(),ce("div",{class:Q([w.$style["avatar-wrapper"],{[w.$style.me]:e.isMe,[w.$style.loading]:s.value,[w.$style.disabled]:e.disabled,[w.$style.readOnly]:t.readOnly}]),style:dn(d.value)},[s.value||U(S)?(j(),ce("div",{key:0,class:Q(w.$style["skeleton-loader"])},null,2)):(j(),ce(xt,{key:1},[c.value==="text"||U(C)||i.value?(j(),ce("div",{key:0,class:Q(w.$style["short-label"])},wt(u.value),3)):n.value.length>0||r.value.profile_image?(j(),ce("img",{key:1,src:n.value||r.value.profile_image||"",alt:r.value.name||"Avatar",loading:"lazy"},null,8,l3)):Je("",!0)],64))],6))}}),[["__cssModules",{$style:{"avatar-wrapper":"_avatar-wrapper_1pd1f_1",me:"_me_1pd1f_17","short-label":"_short-label_1pd1f_20",action:"_action_1pd1f_38",loading:"_loading_1pd1f_56",disabled:"_disabled_1pd1f_59",readOnly:"_readOnly_1pd1f_62"}}]]),u3=["404","ClickChart","ClickToCreate","NoAccess1","NoActivity","NoAssignedComment","NoAssignedScene","NoComment","NoData","NoData2","NoRendition1","NoRendition2","PrivateComment","PrivateScene","ReportAchievement","ReportCompletedScenes","ReportInvolvement","ReportMetric","ReportOverdueScenes","ReportProfessionalName","ReportSceneAssignment","ReportSceneStatus","ReportSceneStatusType","Successful1","Unsuccessful1","ConfirmDeletion","Waiting1","DefaultThumbnail","UploadReviewFile","ClickToSearch","NoDataSearchFilter"],c3=["UploadInProgress"],Pu=class Pu{constructor(){es(this,"KEY_PAIR",{workspaceCode:"ws.code",apiBaseUrl:"API_BASE_URL",assetUrl:"ASSET_URL",baseUrl:"BASE_URL",baseReviewUrl:"BASE_REVIEW_URL"});Object.values(this.KEY_PAIR).every(n=>{const s=sessionStorage.getItem(n);return(s==null||s==="")&&console.error(`[SessionStorageHelper] Key "${n}" is not set in sessionStorage.`),!0})||console.error("[SessionStorageHelper] Some expected keys are missing in sessionStorage. Please ensure all required keys are set.")}static getInstance(){return Pu.instance||(Pu.instance=new Pu),Pu.instance}setItem(t,n){try{sessionStorage.setItem(t,n)}catch(s){console.error("Error setting sessionStorage item:",s)}}getItem(t){try{const n=sessionStorage.getItem(t);return n===null?"":n}catch(n){throw console.error("Error getting sessionStorage item:",n),n}}};es(Pu,"instance");let _n=Pu;const Vg={},Oa={},Z1=(e,t,n,s,o="base64")=>{const i=B(""),r=B(""),a=B(!0),l=Y(()=>`${t}:${e.value.name}`),u=g=>new Promise((v,C)=>{const S=new FileReader;S.onload=()=>v(S.result),S.onerror=C,S.readAsDataURL(g)}),c=g=>`data:image/svg+xml;charset=utf-8,${encodeURIComponent(g)}`,d=async(g,v)=>{if(Oa[v])return Oa[v];if(v in Vg){const b=await Vg[v];return b&&(Oa[v]=b),b}const C=await s(l.value);if(C&&typeof C=="string")return Oa[v]=C,C;const S=(async()=>{try{const b=await fetch(g,{cache:"no-cache"});if(!b.ok)throw new Error("Failed to fetch visual");const w=b.headers.get("Content-Type")||"";let _;if(w.includes("svg")||w.includes("xml")){const R=await b.text();if(!R.trim())throw new Error("Empty SVG content");_=o==="svg"?R:c(R),Oa[v]=_}else if(w.match(/image\/(jpeg|jpg|png|gif|webp)/)){const R=await b.blob();if(!R.size)throw new Error("Empty image blob");_=await u(R),Oa[v]=_}else throw new Error(`Unsupported content type: ${w}`);return await n(l.value,_),_}catch(b){return console.error("Error fetching visual:",b),""}})();return Vg[v]=S,S.finally(()=>{delete Vg[v]}),await S},h=async g=>{a.value=!0;try{if(Oa[l.value]){const _=Oa[l.value];i.value=_,_.startsWith("data:image/svg+xml")?r.value=decodeURIComponent(_.split(",")[1]):(_.startsWith("<svg")||_.includes("<svg"))&&(r.value=_),a.value=!1;return}const v=_n.getInstance().getItem("ASSET_URL")||"",C={icon:`${v}/icon/tess/TESSRAPP_Icon_${g}`,visual:`${v}/icon/visual/TESSRAPP_Visual_${g}`,ratting:`${v}/icon/tess/rating/TESSRAPP_Icon_${g}_Outline`,flag:`${v}/icon/flags/4x3/${g}`},S=u3.includes(g)?"png":c3.includes(g)?"gif":"svg",b=`${C[t]}.${S}`,w=await d(b,l.value);w&&(i.value=w,w.startsWith("data:image/svg+xml")?r.value=decodeURIComponent(w.split(",")[1]):(w.startsWith("<svg")||w.includes("<svg"))&&(r.value=w))}catch(v){console.error("Error fetching remote visual:",v)}finally{a.value=!1}},f=async()=>{i.value="",r.value="",e.value.name&&(a.value=!0,await h(e.value.name),a.value=!1)},p=Y(()=>r.value?r.value:"");return nt(()=>e,()=>{f()},{deep:!0,immediate:!0}),{svgContent:p,url:i,loading:a}},d3=["innerHTML","about"],h3="IconCache",f3="icons",lt=_t(rt({__name:"Icon",props:{src:{},source:{default:"remote"},size:{default:14},color:{default:"currentColor"}},setup(e){jG(h=>({v1555daee:h.size+"px"}));const t=e,n=h=>{if(typeof h=="number")return h;switch(h){case"small":return 14;case"medium":return 14;case"large":return 20;default:return typeof h=="string"?Number.parseInt(h,10):14}},s=Y(()=>n(t.size)),o=Y(()=>({width:s.value+"px",height:s.value+"px",color:t.color})),{getCachedValue:i,setCachedValue:r}=Dh({dbName:h3,storeName:f3}),a=async h=>{const f=await i(h);if(typeof f=="string")return f},l=async(h,f)=>{await r(h,f)},u=Y(()=>t.source==="rating"?"ratting":"icon"),c=Y(()=>({name:t.src,size:s.value,color:t.color||"currentColor"})),{svgContent:d}=Z1(c,u.value,l,a,"svg");return(h,f)=>(j(),ce("div",{class:Q(h.$style.iconWrapper),innerHTML:U(d),style:dn(o.value),about:t.src,"data-icon":"true"},null,14,d3))}}),[["__cssModules",{$style:{iconWrapper:"_iconWrapper_1n0y9_1"}}]]),p3={review:"{reviewDomain}/{ws_code}",review_take:"{reviewDomain}/{ws_code}?id={take_id}",review_scene:"{reviewDomain}/{ws_code}?id={take_id}&scene_id={scene_id}&tab=iteration",review_rendition:"{reviewDomain}/{ws_code}?id={take_id}&scene_id={scene_id}&rendition_id={rendition_id}",review_frame:"{reviewDomain}/{ws_code}?id={take_id}&scene_id={scene_id}&rendition_id={rendition_id}&tab=comment&refresh_marker=true#type=frame&data={frame}",review_rendition_comment:"{reviewDomain}/{ws_code}?scene_id={scene_id}&rendition_id={rendition_id}&comment_id={comment_id}",review_comment:"{reviewDomain}/{ws_code}?id={take_id}&scene_id={scene_id}&comment_id={comment_id}",review_multiple_scenes:"{reviewDomain}/{ws_code}?scene_ids={scene_ids}",scene_hub:"{baseDomain}/{ws_code}/{scene_id}?o=st",hub_rendition:"{baseDomain}/{ws_code}/{scene_id}?o=st&renditionId={rendition_id}",hub_comment:"{baseDomain}/{ws_code}/{scene_id}?o=st&comment_id={comment_id}",people_insight:"{baseDomain}/{ws_code}/{user_id}?o=pt",people_detail:"{baseDomain}/{ws_code}/ws/ppl/{display_name}-${user_id}",project:"{baseDomain}/{ws_code}/pl/dir/{entity_id}",woohoo:"{baseDomain}/{ws_code}/pl/woo/rpt/{woohoo_id}",update:"{baseDomain}/{ws_code}/pl/au?id={entity_id}",core:"{baseDomain}/{ws_code}",project_focusMode:"{baseDomain}/{ws_code}/pl/dir/{parent_id}?f={entity_id}",access_setting:"{baseDomain}/{ws_code}/pl/dir?f={entity_id}&o=as"},Ao=({type:e,config:t})=>{const n=[];try{const s=p3[e];if(!s)throw new Error(`Link template for link type "${e}" not found`);const o=s.replace(/{(.*?)}/g,(i,r)=>{const a=t[String(r)];if(a!==void 0)return a;n.push(r)});return n.length>0?{url:o,hasError:!0,error:`Missing required keys: ${n.join(", ")}`,missingKeys:n}:{url:o,hasError:!1,error:void 0}}catch(s){return console.error("Link Creator ERROR at:",s),{url:"",hasError:!0,error:s instanceof Error?s.message:`Missing required keys: ${n.join(", ")}`}}};var X1=typeof global=="object"&&global&&global.Object===Object&&global,g3=typeof self=="object"&&self&&self.Object===Object&&self,Di=X1||g3||Function("return this")(),Xo=Di.Symbol,J1=Object.prototype,m3=J1.hasOwnProperty,v3=J1.toString,xh=Xo?Xo.toStringTag:void 0;function y3(e){var t=m3.call(e,xh),n=e[xh];try{e[xh]=void 0;var s=!0}catch{}var o=v3.call(e);return s&&(t?e[xh]=n:delete e[xh]),o}var w3=Object.prototype,C3=w3.toString;function b3(e){return C3.call(e)}var S3="[object Null]",E3="[object Undefined]",Q1=Xo?Xo.toStringTag:void 0;function rc(e){return e==null?e===void 0?E3:S3:Q1&&Q1 in Object(e)?y3(e):b3(e)}function jr(e){return e!=null&&typeof e=="object"}var _3="[object Symbol]";function Bg(e){return typeof e=="symbol"||jr(e)&&rc(e)==_3}function R3(e,t){for(var n=-1,s=e==null?0:e.length,o=Array(s);++n<s;)o[n]=t(e[n],n,e);return o}var Jo=Array.isArray,eI=Xo?Xo.prototype:void 0,tI=eI?eI.toString:void 0;function nI(e){if(typeof e=="string")return e;if(Jo(e))return R3(e,nI)+"";if(Bg(e))return tI?tI.call(e):"";var t=e+"";return t=="0"&&1/e==-1/0?"-0":t}var D3=/\s/;function T3(e){for(var t=e.length;t--&&D3.test(e.charAt(t)););return t}var I3=/^\s+/;function x3(e){return e&&e.slice(0,T3(e)+1).replace(I3,"")}function Ma(e){var t=typeof e;return e!=null&&(t=="object"||t=="function")}var sI=NaN,F3=/^[-+]0x[0-9a-f]+$/i,P3=/^0b[01]+$/i,A3=/^0o[0-7]+$/i,k3=parseInt;function RC(e){if(typeof e=="number")return e;if(Bg(e))return sI;if(Ma(e)){var t=typeof e.valueOf=="function"?e.valueOf():e;e=Ma(t)?t+"":t}if(typeof e!="string")return e===0?e:+e;e=x3(e);var n=P3.test(e);return n||A3.test(e)?k3(e.slice(2),n?2:8):F3.test(e)?sI:+e}var oI=1/0,O3=17976931348623157e292;function M3(e){if(!e)return e===0?e:0;if(e=RC(e),e===oI||e===-oI){var t=e<0?-1:1;return t*O3}return e===e?e:0}function N3(e){var t=M3(e),n=t%1;return t===t?n?t-n:t:0}function DC(e){return e}var L3="[object AsyncFunction]",V3="[object Function]",B3="[object GeneratorFunction]",$3="[object Proxy]";function iI(e){if(!Ma(e))return!1;var t=rc(e);return t==V3||t==B3||t==L3||t==$3}var TC=Di["__core-js_shared__"],rI=function(){var e=/[^.]+$/.exec(TC&&TC.keys&&TC.keys.IE_PROTO||"");return e?"Symbol(src)_1."+e:""}();function H3(e){return!!rI&&rI in e}var G3=Function.prototype,U3=G3.toString;function Hl(e){if(e!=null){try{return U3.call(e)}catch{}try{return e+""}catch{}}return""}var W3=/[\\^$.*+?()[\]{}|]/g,z3=/^\[object .+?Constructor\]$/,j3=Function.prototype,K3=Object.prototype,q3=j3.toString,Y3=K3.hasOwnProperty,Z3=RegExp("^"+q3.call(Y3).replace(W3,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function X3(e){if(!Ma(e)||H3(e))return!1;var t=iI(e)?Z3:z3;return t.test(Hl(e))}function J3(e,t){return e==null?void 0:e[t]}function Gl(e,t){var n=J3(e,t);return X3(n)?n:void 0}var IC=Gl(Di,"WeakMap"),aI=Object.create,Q3=function(){function e(){}return function(t){if(!Ma(t))return{};if(aI)return aI(t);e.prototype=t;var n=new e;return e.prototype=void 0,n}}();function e6(e,t,n){switch(n.length){case 0:return e.call(t);case 1:return e.call(t,n[0]);case 2:return e.call(t,n[0],n[1]);case 3:return e.call(t,n[0],n[1],n[2])}return e.apply(t,n)}function t6(){}var n6=800,s6=16,o6=Date.now;function i6(e){var t=0,n=0;return function(){var s=o6(),o=s6-(s-n);if(n=s,o>0){if(++t>=n6)return arguments[0]}else t=0;return e.apply(void 0,arguments)}}function r6(e){return function(){return e}}var $g=function(){try{var e=Gl(Object,"defineProperty");return e({},"",{}),e}catch{}}(),a6=$g?function(e,t){return $g(e,"toString",{configurable:!0,enumerable:!1,value:r6(t),writable:!0})}:DC,l6=i6(a6);function u6(e,t){for(var n=-1,s=e==null?0:e.length;++n<s&&t(e[n],n,e)!==!1;);return e}function c6(e,t,n,s){for(var o=e.length,i=n+-1;++i<o;)if(t(e[i],i,e))return i;return-1}function d6(e){return e!==e}function h6(e,t,n){for(var s=n-1,o=e.length;++s<o;)if(e[s]===t)return s;return-1}function f6(e,t,n){return t===t?h6(e,t,n):c6(e,d6,n)}function p6(e,t){var n=e==null?0:e.length;return!!n&&f6(e,t,0)>-1}var g6=9007199254740991,m6=/^(?:0|[1-9]\d*)$/;function lI(e,t){var n=typeof e;return t=t??g6,!!t&&(n=="number"||n!="symbol"&&m6.test(e))&&e>-1&&e%1==0&&e<t}function v6(e,t,n){t=="__proto__"&&$g?$g(e,t,{configurable:!0,enumerable:!0,value:n,writable:!0}):e[t]=n}function xC(e,t){return e===t||e!==e&&t!==t}var y6=Object.prototype,w6=y6.hasOwnProperty;function C6(e,t,n){var s=e[t];(!(w6.call(e,t)&&xC(s,n))||n===void 0&&!(t in e))&&v6(e,t,n)}var uI=Math.max;function b6(e,t,n){return t=uI(t===void 0?e.length-1:t,0),function(){for(var s=arguments,o=-1,i=uI(s.length-t,0),r=Array(i);++o<i;)r[o]=s[t+o];o=-1;for(var a=Array(t+1);++o<t;)a[o]=s[o];return a[t]=n(r),e6(e,this,a)}}function S6(e,t){return l6(b6(e,t,DC),e+"")}var E6=9007199254740991;function FC(e){return typeof e=="number"&&e>-1&&e%1==0&&e<=E6}function PC(e){return e!=null&&FC(e.length)&&!iI(e)}var _6=Object.prototype;function AC(e){var t=e&&e.constructor,n=typeof t=="function"&&t.prototype||_6;return e===n}function R6(e,t){for(var n=-1,s=Array(e);++n<e;)s[n]=t(n);return s}var D6="[object Arguments]";function cI(e){return jr(e)&&rc(e)==D6}var dI=Object.prototype,T6=dI.hasOwnProperty,I6=dI.propertyIsEnumerable,Hg=cI(function(){return arguments}())?cI:function(e){return jr(e)&&T6.call(e,"callee")&&!I6.call(e,"callee")};function x6(){return!1}var hI=typeof On=="object"&&On&&!On.nodeType&&On,fI=hI&&typeof module=="object"&&module&&!module.nodeType&&module,F6=fI&&fI.exports===hI,pI=F6?Di.Buffer:void 0,P6=pI?pI.isBuffer:void 0,Fh=P6||x6,A6="[object Arguments]",k6="[object Array]",O6="[object Boolean]",M6="[object Date]",N6="[object Error]",L6="[object Function]",V6="[object Map]",B6="[object Number]",$6="[object Object]",H6="[object RegExp]",G6="[object Set]",U6="[object String]",W6="[object WeakMap]",z6="[object ArrayBuffer]",j6="[object DataView]",K6="[object Float32Array]",q6="[object Float64Array]",Y6="[object Int8Array]",Z6="[object Int16Array]",X6="[object Int32Array]",J6="[object Uint8Array]",Q6="[object Uint8ClampedArray]",e4="[object Uint16Array]",t4="[object Uint32Array]",Ln={};Ln[K6]=Ln[q6]=Ln[Y6]=Ln[Z6]=Ln[X6]=Ln[J6]=Ln[Q6]=Ln[e4]=Ln[t4]=!0,Ln[A6]=Ln[k6]=Ln[z6]=Ln[O6]=Ln[j6]=Ln[M6]=Ln[N6]=Ln[L6]=Ln[V6]=Ln[B6]=Ln[$6]=Ln[H6]=Ln[G6]=Ln[U6]=Ln[W6]=!1;function n4(e){return jr(e)&&FC(e.length)&&!!Ln[rc(e)]}function kC(e){return function(t){return e(t)}}var gI=typeof On=="object"&&On&&!On.nodeType&&On,Ph=gI&&typeof module=="object"&&module&&!module.nodeType&&module,s4=Ph&&Ph.exports===gI,OC=s4&&X1.process,ac=function(){try{var e=Ph&&Ph.require&&Ph.require("util").types;return e||OC&&OC.binding&&OC.binding("util")}catch{}}(),mI=ac&&ac.isTypedArray,MC=mI?kC(mI):n4,o4=Object.prototype,i4=o4.hasOwnProperty;function r4(e,t){var n=Jo(e),s=!n&&Hg(e),o=!n&&!s&&Fh(e),i=!n&&!s&&!o&&MC(e),r=n||s||o||i,a=r?R6(e.length,String):[],l=a.length;for(var u in e)i4.call(e,u)&&!(r&&(u=="length"||o&&(u=="offset"||u=="parent")||i&&(u=="buffer"||u=="byteLength"||u=="byteOffset")||lI(u,l)))&&a.push(u);return a}function vI(e,t){return function(n){return e(t(n))}}var a4=vI(Object.keys,Object),l4=Object.prototype,u4=l4.hasOwnProperty;function yI(e){if(!AC(e))return a4(e);var t=[];for(var n in Object(e))u4.call(e,n)&&n!="constructor"&&t.push(n);return t}function wI(e){return PC(e)?r4(e):yI(e)}var c4=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,d4=/^\w*$/;function NC(e,t){if(Jo(e))return!1;var n=typeof e;return n=="number"||n=="symbol"||n=="boolean"||e==null||Bg(e)?!0:d4.test(e)||!c4.test(e)||t!=null&&e in Object(t)}var Ah=Gl(Object,"create");function h4(){this.__data__=Ah?Ah(null):{},this.size=0}function f4(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t}var p4="__lodash_hash_undefined__",g4=Object.prototype,m4=g4.hasOwnProperty;function v4(e){var t=this.__data__;if(Ah){var n=t[e];return n===p4?void 0:n}return m4.call(t,e)?t[e]:void 0}var y4=Object.prototype,w4=y4.hasOwnProperty;function C4(e){var t=this.__data__;return Ah?t[e]!==void 0:w4.call(t,e)}var b4="__lodash_hash_undefined__";function S4(e,t){var n=this.__data__;return this.size+=this.has(e)?0:1,n[e]=Ah&&t===void 0?b4:t,this}function Ul(e){var t=-1,n=e==null?0:e.length;for(this.clear();++t<n;){var s=e[t];this.set(s[0],s[1])}}Ul.prototype.clear=h4,Ul.prototype.delete=f4,Ul.prototype.get=v4,Ul.prototype.has=C4,Ul.prototype.set=S4;function E4(){this.__data__=[],this.size=0}function Gg(e,t){for(var n=e.length;n--;)if(xC(e[n][0],t))return n;return-1}var _4=Array.prototype,R4=_4.splice;function D4(e){var t=this.__data__,n=Gg(t,e);if(n<0)return!1;var s=t.length-1;return n==s?t.pop():R4.call(t,n,1),--this.size,!0}function T4(e){var t=this.__data__,n=Gg(t,e);return n<0?void 0:t[n][1]}function I4(e){return Gg(this.__data__,e)>-1}function x4(e,t){var n=this.__data__,s=Gg(n,e);return s<0?(++this.size,n.push([e,t])):n[s][1]=t,this}function Kr(e){var t=-1,n=e==null?0:e.length;for(this.clear();++t<n;){var s=e[t];this.set(s[0],s[1])}}Kr.prototype.clear=E4,Kr.prototype.delete=D4,Kr.prototype.get=T4,Kr.prototype.has=I4,Kr.prototype.set=x4;var kh=Gl(Di,"Map");function F4(){this.size=0,this.__data__={hash:new Ul,map:new(kh||Kr),string:new Ul}}function P4(e){var t=typeof e;return t=="string"||t=="number"||t=="symbol"||t=="boolean"?e!=="__proto__":e===null}function Ug(e,t){var n=e.__data__;return P4(t)?n[typeof t=="string"?"string":"hash"]:n.map}function A4(e){var t=Ug(this,e).delete(e);return this.size-=t?1:0,t}function k4(e){return Ug(this,e).get(e)}function O4(e){return Ug(this,e).has(e)}function M4(e,t){var n=Ug(this,e),s=n.size;return n.set(e,t),this.size+=n.size==s?0:1,this}function qr(e){var t=-1,n=e==null?0:e.length;for(this.clear();++t<n;){var s=e[t];this.set(s[0],s[1])}}qr.prototype.clear=F4,qr.prototype.delete=A4,qr.prototype.get=k4,qr.prototype.has=O4,qr.prototype.set=M4;var N4="Expected a function";function LC(e,t){if(typeof e!="function"||t!=null&&typeof t!="function")throw new TypeError(N4);var n=function(){var s=arguments,o=t?t.apply(this,s):s[0],i=n.cache;if(i.has(o))return i.get(o);var r=e.apply(this,s);return n.cache=i.set(o,r)||i,r};return n.cache=new(LC.Cache||qr),n}LC.Cache=qr;var L4=500;function V4(e){var t=LC(e,function(s){return n.size===L4&&n.clear(),s}),n=t.cache;return t}var B4=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,$4=/\\(\\)?/g,H4=V4(function(e){var t=[];return e.charCodeAt(0)===46&&t.push(""),e.replace(B4,function(n,s,o,i){t.push(o?i.replace($4,"$1"):s||n)}),t});function G4(e){return e==null?"":nI(e)}function CI(e,t){return Jo(e)?e:NC(e,t)?[e]:H4(G4(e))}function Wg(e){if(typeof e=="string"||Bg(e))return e;var t=e+"";return t=="0"&&1/e==-1/0?"-0":t}function bI(e,t){t=CI(t,e);for(var n=0,s=t.length;e!=null&&n<s;)e=e[Wg(t[n++])];return n&&n==s?e:void 0}function U4(e,t,n){var s=e==null?void 0:bI(e,t);return s===void 0?n:s}function SI(e,t){for(var n=-1,s=t.length,o=e.length;++n<s;)e[o+n]=t[n];return e}var EI=Xo?Xo.isConcatSpreadable:void 0;function W4(e){return Jo(e)||Hg(e)||!!(EI&&e&&e[EI])}function z4(e,t,n,s,o){var i=-1,r=e.length;for(n||(n=W4),o||(o=[]);++i<r;){var a=e[i];n(a)&&SI(o,a)}return o}var j4=vI(Object.getPrototypeOf,Object);function K4(e,t,n){var s=-1,o=e.length;t<0&&(t=-t>o?0:o+t),n=n>o?o:n,n<0&&(n+=o),o=t>n?0:n-t>>>0,t>>>=0;for(var i=Array(o);++s<o;)i[s]=e[s+t];return i}var q4=Math.ceil,Y4=Math.max;function Z4(e,t,n){t===void 0?t=1:t=Y4(N3(t),0);var s=e==null?0:e.length;if(!s||t<1)return[];for(var o=0,i=0,r=Array(q4(s/t));o<s;)r[i++]=K4(e,o,o+=t);return r}function X4(){this.__data__=new Kr,this.size=0}function J4(e){var t=this.__data__,n=t.delete(e);return this.size=t.size,n}function Q4(e){return this.__data__.get(e)}function e5(e){return this.__data__.has(e)}var t5=200;function n5(e,t){var n=this.__data__;if(n instanceof Kr){var s=n.__data__;if(!kh||s.length<t5-1)return s.push([e,t]),this.size=++n.size,this;n=this.__data__=new qr(s)}return n.set(e,t),this.size=n.size,this}function or(e){var t=this.__data__=new Kr(e);this.size=t.size}or.prototype.clear=X4,or.prototype.delete=J4,or.prototype.get=Q4,or.prototype.has=e5,or.prototype.set=n5;var _I=typeof On=="object"&&On&&!On.nodeType&&On,RI=_I&&typeof module=="object"&&module&&!module.nodeType&&module,s5=RI&&RI.exports===_I,DI=s5?Di.Buffer:void 0;DI&&DI.allocUnsafe;function o5(e,t){return e.slice()}function i5(e,t){for(var n=-1,s=e==null?0:e.length,o=0,i=[];++n<s;){var r=e[n];t(r,n,e)&&(i[o++]=r)}return i}function r5(){return[]}var a5=Object.prototype,l5=a5.propertyIsEnumerable,TI=Object.getOwnPropertySymbols,u5=TI?function(e){return e==null?[]:(e=Object(e),i5(TI(e),function(t){return l5.call(e,t)}))}:r5;function c5(e,t,n){var s=t(e);return Jo(e)?s:SI(s,n(e))}function VC(e){return c5(e,wI,u5)}var BC=Gl(Di,"DataView"),$C=Gl(Di,"Promise"),lc=Gl(Di,"Set"),II="[object Map]",d5="[object Object]",xI="[object Promise]",FI="[object Set]",PI="[object WeakMap]",AI="[object DataView]",h5=Hl(BC),f5=Hl(kh),p5=Hl($C),g5=Hl(lc),m5=Hl(IC),Qo=rc;(BC&&Qo(new BC(new ArrayBuffer(1)))!=AI||kh&&Qo(new kh)!=II||$C&&Qo($C.resolve())!=xI||lc&&Qo(new lc)!=FI||IC&&Qo(new IC)!=PI)&&(Qo=function(e){var t=rc(e),n=t==d5?e.constructor:void 0,s=n?Hl(n):"";if(s)switch(s){case h5:return AI;case f5:return II;case p5:return xI;case g5:return FI;case m5:return PI}return t});var v5=Object.prototype,y5=v5.hasOwnProperty;function w5(e){var t=e.length,n=new e.constructor(t);return t&&typeof e[0]=="string"&&y5.call(e,"index")&&(n.index=e.index,n.input=e.input),n}var zg=Di.Uint8Array;function HC(e){var t=new e.constructor(e.byteLength);return new zg(t).set(new zg(e)),t}function C5(e,t){var n=HC(e.buffer);return new e.constructor(n,e.byteOffset,e.byteLength)}var b5=/\w*$/;function S5(e){var t=new e.constructor(e.source,b5.exec(e));return t.lastIndex=e.lastIndex,t}var kI=Xo?Xo.prototype:void 0,OI=kI?kI.valueOf:void 0;function E5(e){return OI?Object(OI.call(e)):{}}function _5(e,t){var n=HC(e.buffer);return new e.constructor(n,e.byteOffset,e.length)}var R5="[object Boolean]",D5="[object Date]",T5="[object Map]",I5="[object Number]",x5="[object RegExp]",F5="[object Set]",P5="[object String]",A5="[object Symbol]",k5="[object ArrayBuffer]",O5="[object DataView]",M5="[object Float32Array]",N5="[object Float64Array]",L5="[object Int8Array]",V5="[object Int16Array]",B5="[object Int32Array]",$5="[object Uint8Array]",H5="[object Uint8ClampedArray]",G5="[object Uint16Array]",U5="[object Uint32Array]";function W5(e,t,n){var s=e.constructor;switch(t){case k5:return HC(e);case R5:case D5:return new s(+e);case O5:return C5(e);case M5:case N5:case L5:case V5:case B5:case $5:case H5:case G5:case U5:return _5(e);case T5:return new s;case I5:case P5:return new s(e);case x5:return S5(e);case F5:return new s;case A5:return E5(e)}}function z5(e){return typeof e.constructor=="function"&&!AC(e)?Q3(j4(e)):{}}var j5="[object Map]";function K5(e){return jr(e)&&Qo(e)==j5}var MI=ac&&ac.isMap,q5=MI?kC(MI):K5,Y5="[object Set]";function Z5(e){return jr(e)&&Qo(e)==Y5}var NI=ac&&ac.isSet,X5=NI?kC(NI):Z5,LI="[object Arguments]",J5="[object Array]",Q5="[object Boolean]",e8="[object Date]",t8="[object Error]",VI="[object Function]",n8="[object GeneratorFunction]",s8="[object Map]",o8="[object Number]",BI="[object Object]",i8="[object RegExp]",r8="[object Set]",a8="[object String]",l8="[object Symbol]",u8="[object WeakMap]",c8="[object ArrayBuffer]",d8="[object DataView]",h8="[object Float32Array]",f8="[object Float64Array]",p8="[object Int8Array]",g8="[object Int16Array]",m8="[object Int32Array]",v8="[object Uint8Array]",y8="[object Uint8ClampedArray]",w8="[object Uint16Array]",C8="[object Uint32Array]",Fn={};Fn[LI]=Fn[J5]=Fn[c8]=Fn[d8]=Fn[Q5]=Fn[e8]=Fn[h8]=Fn[f8]=Fn[p8]=Fn[g8]=Fn[m8]=Fn[s8]=Fn[o8]=Fn[BI]=Fn[i8]=Fn[r8]=Fn[a8]=Fn[l8]=Fn[v8]=Fn[y8]=Fn[w8]=Fn[C8]=!0,Fn[t8]=Fn[VI]=Fn[u8]=!1;function jg(e,t,n,s,o,i){var r;if(r!==void 0)return r;if(!Ma(e))return e;var a=Jo(e);if(a)r=w5(e);else{var l=Qo(e),u=l==VI||l==n8;if(Fh(e))return o5(e);if(l==BI||l==LI||u&&!o)r=u?{}:z5(e);else{if(!Fn[l])return o?e:{};r=W5(e,l)}}i||(i=new or);var c=i.get(e);if(c)return c;i.set(e,r),X5(e)?e.forEach(function(f){r.add(jg(f,t,n,f,e,i))}):q5(e)&&e.forEach(function(f,p){r.set(p,jg(f,t,n,p,e,i))});var d=VC,h=a?void 0:d(e);return u6(h||e,function(f,p){h&&(p=f,f=e[p]),C6(r,p,jg(f,t,n,p,e,i))}),r}var b8=1,S8=4;function $I(e){return jg(e,b8|S8)}var E8="__lodash_hash_undefined__";function _8(e){return this.__data__.set(e,E8),this}function R8(e){return this.__data__.has(e)}function Oh(e){var t=-1,n=e==null?0:e.length;for(this.__data__=new qr;++t<n;)this.add(e[t])}Oh.prototype.add=Oh.prototype.push=_8,Oh.prototype.has=R8;function D8(e,t){for(var n=-1,s=e==null?0:e.length;++n<s;)if(t(e[n],n,e))return!0;return!1}function HI(e,t){return e.has(t)}var T8=1,I8=2;function GI(e,t,n,s,o,i){var r=n&T8,a=e.length,l=t.length;if(a!=l&&!(r&&l>a))return!1;var u=i.get(e),c=i.get(t);if(u&&c)return u==t&&c==e;var d=-1,h=!0,f=n&I8?new Oh:void 0;for(i.set(e,t),i.set(t,e);++d<a;){var p=e[d],g=t[d];if(s)var v=r?s(g,p,d,t,e,i):s(p,g,d,e,t,i);if(v!==void 0){if(v)continue;h=!1;break}if(f){if(!D8(t,function(C,S){if(!HI(f,S)&&(p===C||o(p,C,n,s,i)))return f.push(S)})){h=!1;break}}else if(!(p===g||o(p,g,n,s,i))){h=!1;break}}return i.delete(e),i.delete(t),h}function x8(e){var t=-1,n=Array(e.size);return e.forEach(function(s,o){n[++t]=[o,s]}),n}function GC(e){var t=-1,n=Array(e.size);return e.forEach(function(s){n[++t]=s}),n}var F8=1,P8=2,A8="[object Boolean]",k8="[object Date]",O8="[object Error]",M8="[object Map]",N8="[object Number]",L8="[object RegExp]",V8="[object Set]",B8="[object String]",$8="[object Symbol]",H8="[object ArrayBuffer]",G8="[object DataView]",UI=Xo?Xo.prototype:void 0,UC=UI?UI.valueOf:void 0;function U8(e,t,n,s,o,i,r){switch(n){case G8:if(e.byteLength!=t.byteLength||e.byteOffset!=t.byteOffset)return!1;e=e.buffer,t=t.buffer;case H8:return!(e.byteLength!=t.byteLength||!i(new zg(e),new zg(t)));case A8:case k8:case N8:return xC(+e,+t);case O8:return e.name==t.name&&e.message==t.message;case L8:case B8:return e==t+"";case M8:var a=x8;case V8:var l=s&F8;if(a||(a=GC),e.size!=t.size&&!l)return!1;var u=r.get(e);if(u)return u==t;s|=P8,r.set(e,t);var c=GI(a(e),a(t),s,o,i,r);return r.delete(e),c;case $8:if(UC)return UC.call(e)==UC.call(t)}return!1}var W8=1,z8=Object.prototype,j8=z8.hasOwnProperty;function K8(e,t,n,s,o,i){var r=n&W8,a=VC(e),l=a.length,u=VC(t),c=u.length;if(l!=c&&!r)return!1;for(var d=l;d--;){var h=a[d];if(!(r?h in t:j8.call(t,h)))return!1}var f=i.get(e),p=i.get(t);if(f&&p)return f==t&&p==e;var g=!0;i.set(e,t),i.set(t,e);for(var v=r;++d<l;){h=a[d];var C=e[h],S=t[h];if(s)var b=r?s(S,C,h,t,e,i):s(C,S,h,e,t,i);if(!(b===void 0?C===S||o(C,S,n,s,i):b)){g=!1;break}v||(v=h=="constructor")}if(g&&!v){var w=e.constructor,_=t.constructor;w!=_&&"constructor"in e&&"constructor"in t&&!(typeof w=="function"&&w instanceof w&&typeof _=="function"&&_ instanceof _)&&(g=!1)}return i.delete(e),i.delete(t),g}var q8=1,WI="[object Arguments]",zI="[object Array]",Kg="[object Object]",Y8=Object.prototype,jI=Y8.hasOwnProperty;function Z8(e,t,n,s,o,i){var r=Jo(e),a=Jo(t),l=r?zI:Qo(e),u=a?zI:Qo(t);l=l==WI?Kg:l,u=u==WI?Kg:u;var c=l==Kg,d=u==Kg,h=l==u;if(h&&Fh(e)){if(!Fh(t))return!1;r=!0,c=!1}if(h&&!c)return i||(i=new or),r||MC(e)?GI(e,t,n,s,o,i):U8(e,t,l,n,s,o,i);if(!(n&q8)){var f=c&&jI.call(e,"__wrapped__"),p=d&&jI.call(t,"__wrapped__");if(f||p){var g=f?e.value():e,v=p?t.value():t;return i||(i=new or),o(g,v,n,s,i)}}return h?(i||(i=new or),K8(e,t,n,s,o,i)):!1}function WC(e,t,n,s,o){return e===t?!0:e==null||t==null||!jr(e)&&!jr(t)?e!==e&&t!==t:Z8(e,t,n,s,WC,o)}var X8=1,J8=2;function Q8(e,t,n,s){var o=n.length,i=o;if(e==null)return!i;for(e=Object(e);o--;){var r=n[o];if(r[2]?r[1]!==e[r[0]]:!(r[0]in e))return!1}for(;++o<i;){r=n[o];var a=r[0],l=e[a],u=r[1];if(r[2]){if(l===void 0&&!(a in e))return!1}else{var c=new or,d;if(!(d===void 0?WC(u,l,X8|J8,s,c):d))return!1}}return!0}function KI(e){return e===e&&!Ma(e)}function ej(e){for(var t=wI(e),n=t.length;n--;){var s=t[n],o=e[s];t[n]=[s,o,KI(o)]}return t}function qI(e,t){return function(n){return n==null?!1:n[e]===t&&(t!==void 0||e in Object(n))}}function tj(e){var t=ej(e);return t.length==1&&t[0][2]?qI(t[0][0],t[0][1]):function(n){return n===e||Q8(n,e,t)}}function nj(e,t){return e!=null&&t in Object(e)}function sj(e,t,n){t=CI(t,e);for(var s=-1,o=t.length,i=!1;++s<o;){var r=Wg(t[s]);if(!(i=e!=null&&n(e,r)))break;e=e[r]}return i||++s!=o?i:(o=e==null?0:e.length,!!o&&FC(o)&&lI(r,o)&&(Jo(e)||Hg(e)))}function oj(e,t){return e!=null&&sj(e,t,nj)}var ij=1,rj=2;function aj(e,t){return NC(e)&&KI(t)?qI(Wg(e),t):function(n){var s=U4(n,e);return s===void 0&&s===t?oj(n,e):WC(t,s,ij|rj)}}function lj(e){return function(t){return t==null?void 0:t[e]}}function uj(e){return function(t){return bI(t,e)}}function cj(e){return NC(e)?lj(Wg(e)):uj(e)}function dj(e){return typeof e=="function"?e:e==null?DC:typeof e=="object"?Jo(e)?aj(e[0],e[1]):tj(e):cj(e)}var zC=function(){return Di.Date.now()},hj="Expected a function",fj=Math.max,pj=Math.min;function Ti(e,t,n){var s,o,i,r,a,l,u=0,c=!1,d=!1,h=!0;if(typeof e!="function")throw new TypeError(hj);t=RC(t)||0,Ma(n)&&(c=!!n.leading,d="maxWait"in n,i=d?fj(RC(n.maxWait)||0,t):i,h="trailing"in n?!!n.trailing:h);function f(R){var T=s,I=o;return s=o=void 0,u=R,r=e.apply(I,T),r}function p(R){return u=R,a=setTimeout(C,t),c?f(R):r}function g(R){var T=R-l,I=R-u,x=t-T;return d?pj(x,i-I):x}function v(R){var T=R-l,I=R-u;return l===void 0||T>=t||T<0||d&&I>=i}function C(){var R=zC();if(v(R))return S(R);a=setTimeout(C,g(R))}function S(R){return a=void 0,h&&s?f(R):(s=o=void 0,r)}function b(){a!==void 0&&clearTimeout(a),u=0,s=l=o=a=void 0}function w(){return a===void 0?r:S(zC())}function _(){var R=zC(),T=v(R);if(s=arguments,o=this,l=R,T){if(a===void 0)return p(l);if(d)return clearTimeout(a),a=setTimeout(C,t),f(l)}return a===void 0&&(a=setTimeout(C,t)),r}return _.cancel=b,_.flush=w,_}function YI(e){return jr(e)&&PC(e)}function gj(e){var t=e==null?0:e.length;return t?e[t-1]:void 0}var mj="[object Map]",vj="[object Set]",yj=Object.prototype,wj=yj.hasOwnProperty;function Cj(e){if(e==null)return!0;if(PC(e)&&(Jo(e)||typeof e=="string"||typeof e.splice=="function"||Fh(e)||MC(e)||Hg(e)))return!e.length;var t=Qo(e);if(t==mj||t==vj)return!e.size;if(AC(e))return!yI(e).length;for(var n in e)if(wj.call(e,n))return!1;return!0}var bj=1/0,Sj=lc&&1/GC(new lc([,-0]))[1]==bj?function(e){return new lc(e)}:t6,Ej=200;function _j(e,t,n){var s=-1,o=p6,i=e.length,r=!0,a=[],l=a;if(i>=Ej){var u=t?null:Sj(e);if(u)return GC(u);r=!1,o=HI,l=new Oh}else l=t?[]:a;e:for(;++s<i;){var c=e[s],d=t?t(c):c;if(c=c!==0?c:0,r&&d===d){for(var h=l.length;h--;)if(l[h]===d)continue e;t&&l.push(d),a.push(c)}else o(l,d,n)||(l!==a&&l.push(d),a.push(c))}return a}var uc=S6(function(e){var t=gj(e);return YI(t)&&(t=void 0),_j(z4(e,1,YI),dj(t))});const ts=(e,t)=>{const n=Yn();return{apiServices:Y(()=>{var r;const o=n==null?void 0:n.appContext.config.globalProperties,i=(r=t.params)==null?void 0:r.context;if(o!=null&&o.apiServices)return o.apiServices;if(e&&(i!=null&&i.apiServices))return i.apiServices})}},Rj=e=>{const t=document.cookie.match(new RegExp("(^| )"+e+"=([^;]+)"));return t?decodeURIComponent(t[2]):null};let Wl=class extends Error{};class Dj extends Wl{constructor(t){super(`Invalid DateTime: ${t.toMessage()}`)}}class Tj extends Wl{constructor(t){super(`Invalid Interval: ${t.toMessage()}`)}}class Ij extends Wl{constructor(t){super(`Invalid Duration: ${t.toMessage()}`)}}class cc extends Wl{}class ZI extends Wl{constructor(t){super(`Invalid unit ${t}`)}}class Bs extends Wl{}let Na=class extends Wl{constructor(){super("Zone is an abstract class")}};const Et="numeric",Ii="short",ko="long",qg={year:Et,month:Et,day:Et},XI={year:Et,month:Ii,day:Et},xj={year:Et,month:Ii,day:Et,weekday:Ii},JI={year:Et,month:ko,day:Et},QI={year:Et,month:ko,day:Et,weekday:ko},ex={hour:Et,minute:Et},tx={hour:Et,minute:Et,second:Et},nx={hour:Et,minute:Et,second:Et,timeZoneName:Ii},sx={hour:Et,minute:Et,second:Et,timeZoneName:ko},ox={hour:Et,minute:Et,hourCycle:"h23"},ix={hour:Et,minute:Et,second:Et,hourCycle:"h23"},rx={hour:Et,minute:Et,second:Et,hourCycle:"h23",timeZoneName:Ii},ax={hour:Et,minute:Et,second:Et,hourCycle:"h23",timeZoneName:ko},lx={year:Et,month:Et,day:Et,hour:Et,minute:Et},ux={year:Et,month:Et,day:Et,hour:Et,minute:Et,second:Et},cx={year:Et,month:Ii,day:Et,hour:Et,minute:Et},dx={year:Et,month:Ii,day:Et,hour:Et,minute:Et,second:Et},Fj={year:Et,month:Ii,day:Et,weekday:Ii,hour:Et,minute:Et},hx={year:Et,month:ko,day:Et,hour:Et,minute:Et,timeZoneName:Ii},fx={year:Et,month:ko,day:Et,hour:Et,minute:Et,second:Et,timeZoneName:Ii},px={year:Et,month:ko,day:Et,weekday:ko,hour:Et,minute:Et,timeZoneName:ko},gx={year:Et,month:ko,day:Et,weekday:ko,hour:Et,minute:Et,second:Et,timeZoneName:ko};let Mh=class{get type(){throw new Na}get name(){throw new Na}get ianaName(){return this.name}get isUniversal(){throw new Na}offsetName(t,n){throw new Na}formatOffset(t,n){throw new Na}offset(t){throw new Na}equals(t){throw new Na}get isValid(){throw new Na}},jC=null;class Yg extends Mh{static get instance(){return jC===null&&(jC=new Yg),jC}get type(){return"system"}get name(){return new Intl.DateTimeFormat().resolvedOptions().timeZone}get isUniversal(){return!1}offsetName(t,{format:n,locale:s}){return Hx(t,n,s)}formatOffset(t,n){return Bh(this.offset(t),n)}offset(t){return-new Date(t).getTimezoneOffset()}equals(t){return t.type==="system"}get isValid(){return!0}}const KC=new Map;function Pj(e){let t=KC.get(e);return t===void 0&&(t=new Intl.DateTimeFormat("en-US",{hour12:!1,timeZone:e,year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit",era:"short"}),KC.set(e,t)),t}const Aj={year:0,month:1,day:2,era:3,hour:4,minute:5,second:6};function kj(e,t){const n=e.format(t).replace(/\u200E/g,""),s=/(\d+)\/(\d+)\/(\d+) (AD|BC),? (\d+):(\d+):(\d+)/.exec(n),[,o,i,r,a,l,u,c]=s;return[r,o,i,a,l,u,c]}function Oj(e,t){const n=e.formatToParts(t),s=[];for(let o=0;o<n.length;o++){const{type:i,value:r}=n[o],a=Aj[i];i==="era"?s[a]=r:$t(a)||(s[a]=parseInt(r,10))}return s}const qC=new Map;let dc=class Q_ extends Mh{static create(t){let n=qC.get(t);return n===void 0&&qC.set(t,n=new Q_(t)),n}static resetCache(){qC.clear(),KC.clear()}static isValidSpecifier(t){return this.isValidZone(t)}static isValidZone(t){if(!t)return!1;try{return new Intl.DateTimeFormat("en-US",{timeZone:t}).format(),!0}catch{return!1}}constructor(t){super(),this.zoneName=t,this.valid=Q_.isValidZone(t)}get type(){return"iana"}get name(){return this.zoneName}get isUniversal(){return!1}offsetName(t,{format:n,locale:s}){return Hx(t,n,s,this.name)}formatOffset(t,n){return Bh(this.offset(t),n)}offset(t){if(!this.valid)return NaN;const n=new Date(t);if(isNaN(n))return NaN;const s=Pj(this.name);let[o,i,r,a,l,u,c]=s.formatToParts?Oj(s,n):kj(s,n);a==="BC"&&(o=-Math.abs(o)+1);const h=em({year:o,month:i,day:r,hour:l===24?0:l,minute:u,second:c,millisecond:0});let f=+n;const p=f%1e3;return f-=p>=0?p:1e3+p,(h-f)/(60*1e3)}equals(t){return t.type==="iana"&&t.name===this.name}get isValid(){return this.valid}},mx={};function Mj(e,t={}){const n=JSON.stringify([e,t]);let s=mx[n];return s||(s=new Intl.ListFormat(e,t),mx[n]=s),s}const YC=new Map;function ZC(e,t={}){const n=JSON.stringify([e,t]);let s=YC.get(n);return s===void 0&&(s=new Intl.DateTimeFormat(e,t),YC.set(n,s)),s}const XC=new Map;function Nj(e,t={}){const n=JSON.stringify([e,t]);let s=XC.get(n);return s===void 0&&(s=new Intl.NumberFormat(e,t),XC.set(n,s)),s}const JC=new Map;function Lj(e,t={}){const{base:n,...s}=t,o=JSON.stringify([e,s]);let i=JC.get(o);return i===void 0&&(i=new Intl.RelativeTimeFormat(e,t),JC.set(o,i)),i}let Nh=null;function Vj(){return Nh||(Nh=new Intl.DateTimeFormat().resolvedOptions().locale,Nh)}const QC=new Map;function vx(e){let t=QC.get(e);return t===void 0&&(t=new Intl.DateTimeFormat(e).resolvedOptions(),QC.set(e,t)),t}const eb=new Map;function Bj(e){let t=eb.get(e);if(!t){const n=new Intl.Locale(e);t="getWeekInfo"in n?n.getWeekInfo():n.weekInfo,"minimalDays"in t||(t={...yx,...t}),eb.set(e,t)}return t}function $j(e){const t=e.indexOf("-x-");t!==-1&&(e=e.substring(0,t));const n=e.indexOf("-u-");if(n===-1)return[e];{let s,o;try{s=ZC(e).resolvedOptions(),o=e}catch{const l=e.substring(0,n);s=ZC(l).resolvedOptions(),o=l}const{numberingSystem:i,calendar:r}=s;return[o,i,r]}}function Hj(e,t,n){return(n||t)&&(e.includes("-u-")||(e+="-u"),n&&(e+=`-ca-${n}`),t&&(e+=`-nu-${t}`)),e}function Gj(e){const t=[];for(let n=1;n<=12;n++){const s=bt.utc(2009,n,1);t.push(e(s))}return t}function Uj(e){const t=[];for(let n=1;n<=7;n++){const s=bt.utc(2016,11,13+n);t.push(e(s))}return t}function Zg(e,t,n,s){const o=e.listingMode();return o==="error"?null:o==="en"?n(t):s(t)}function Wj(e){return e.numberingSystem&&e.numberingSystem!=="latn"?!1:e.numberingSystem==="latn"||!e.locale||e.locale.startsWith("en")||vx(e.locale).numberingSystem==="latn"}class zj{constructor(t,n,s){this.padTo=s.padTo||0,this.floor=s.floor||!1;const{padTo:o,floor:i,...r}=s;if(!n||Object.keys(r).length>0){const a={useGrouping:!1,...s};s.padTo>0&&(a.minimumIntegerDigits=s.padTo),this.inf=Nj(t,a)}}format(t){if(this.inf){const n=this.floor?Math.floor(t):t;return this.inf.format(n)}else{const n=this.floor?Math.floor(t):ub(t,3);return ds(n,this.padTo)}}}class jj{constructor(t,n,s){this.opts=s,this.originalZone=void 0;let o;if(this.opts.timeZone)this.dt=t;else if(t.zone.type==="fixed"){const r=-1*(t.offset/60),a=r>=0?`Etc/GMT+${r}`:`Etc/GMT${r}`;t.offset!==0&&dc.create(a).valid?(o=a,this.dt=t):(o="UTC",this.dt=t.offset===0?t:t.setZone("UTC").plus({minutes:t.offset}),this.originalZone=t.zone)}else t.zone.type==="system"?this.dt=t:t.zone.type==="iana"?(this.dt=t,o=t.zone.name):(o="UTC",this.dt=t.setZone("UTC").plus({minutes:t.offset}),this.originalZone=t.zone);const i={...this.opts};i.timeZone=i.timeZone||o,this.dtf=ZC(n,i)}format(){return this.originalZone?this.formatToParts().map(({value:t})=>t).join(""):this.dtf.format(this.dt.toJSDate())}formatToParts(){const t=this.dtf.formatToParts(this.dt.toJSDate());return this.originalZone?t.map(n=>{if(n.type==="timeZoneName"){const s=this.originalZone.offsetName(this.dt.ts,{locale:this.dt.locale,format:this.opts.timeZoneName});return{...n,value:s}}else return n}):t}resolvedOptions(){return this.dtf.resolvedOptions()}}class Kj{constructor(t,n,s){this.opts={style:"long",...s},!n&&Lx()&&(this.rtf=Lj(t,s))}format(t,n){return this.rtf?this.rtf.format(t,n):g7(n,t,this.opts.numeric,this.opts.style!=="long")}formatToParts(t,n){return this.rtf?this.rtf.formatToParts(t,n):[]}}const yx={firstDay:1,minimalDays:4,weekend:[6,7]};class bn{static fromOpts(t){return bn.create(t.locale,t.numberingSystem,t.outputCalendar,t.weekSettings,t.defaultToEN)}static create(t,n,s,o,i=!1){const r=t||Zn.defaultLocale,a=r||(i?"en-US":Vj()),l=n||Zn.defaultNumberingSystem,u=s||Zn.defaultOutputCalendar,c=ab(o)||Zn.defaultWeekSettings;return new bn(a,l,u,c,r)}static resetCache(){Nh=null,YC.clear(),XC.clear(),JC.clear(),QC.clear(),eb.clear()}static fromObject({locale:t,numberingSystem:n,outputCalendar:s,weekSettings:o}={}){return bn.create(t,n,s,o)}constructor(t,n,s,o,i){const[r,a,l]=$j(t);this.locale=r,this.numberingSystem=n||a||null,this.outputCalendar=s||l||null,this.weekSettings=o,this.intl=Hj(this.locale,this.numberingSystem,this.outputCalendar),this.weekdaysCache={format:{},standalone:{}},this.monthsCache={format:{},standalone:{}},this.meridiemCache=null,this.eraCache={},this.specifiedLocale=i,this.fastNumbersCached=null}get fastNumbers(){return this.fastNumbersCached==null&&(this.fastNumbersCached=Wj(this)),this.fastNumbersCached}listingMode(){const t=this.isEnglish(),n=(this.numberingSystem===null||this.numberingSystem==="latn")&&(this.outputCalendar===null||this.outputCalendar==="gregory");return t&&n?"en":"intl"}clone(t){return!t||Object.getOwnPropertyNames(t).length===0?this:bn.create(t.locale||this.specifiedLocale,t.numberingSystem||this.numberingSystem,t.outputCalendar||this.outputCalendar,ab(t.weekSettings)||this.weekSettings,t.defaultToEN||!1)}redefaultToEN(t={}){return this.clone({...t,defaultToEN:!0})}redefaultToSystem(t={}){return this.clone({...t,defaultToEN:!1})}months(t,n=!1){return Zg(this,t,Wx,()=>{const s=this.intl==="ja"||this.intl.startsWith("ja-");n&=!s;const o=n?{month:t,day:"numeric"}:{month:t},i=n?"format":"standalone";if(!this.monthsCache[i][t]){const r=s?a=>this.dtFormatter(a,o).format():a=>this.extract(a,o,"month");this.monthsCache[i][t]=Gj(r)}return this.monthsCache[i][t]})}weekdays(t,n=!1){return Zg(this,t,Kx,()=>{const s=n?{weekday:t,year:"numeric",month:"long",day:"numeric"}:{weekday:t},o=n?"format":"standalone";return this.weekdaysCache[o][t]||(this.weekdaysCache[o][t]=Uj(i=>this.extract(i,s,"weekday"))),this.weekdaysCache[o][t]})}meridiems(){return Zg(this,void 0,()=>qx,()=>{if(!this.meridiemCache){const t={hour:"numeric",hourCycle:"h12"};this.meridiemCache=[bt.utc(2016,11,13,9),bt.utc(2016,11,13,19)].map(n=>this.extract(n,t,"dayperiod"))}return this.meridiemCache})}eras(t){return Zg(this,t,Yx,()=>{const n={era:t};return this.eraCache[t]||(this.eraCache[t]=[bt.utc(-40,1,1),bt.utc(2017,1,1)].map(s=>this.extract(s,n,"era"))),this.eraCache[t]})}extract(t,n,s){const o=this.dtFormatter(t,n),i=o.formatToParts(),r=i.find(a=>a.type.toLowerCase()===s);return r?r.value:null}numberFormatter(t={}){return new zj(this.intl,t.forceSimple||this.fastNumbers,t)}dtFormatter(t,n={}){return new jj(t,this.intl,n)}relFormatter(t={}){return new Kj(this.intl,this.isEnglish(),t)}listFormatter(t={}){return Mj(this.intl,t)}isEnglish(){return this.locale==="en"||this.locale.toLowerCase()==="en-us"||vx(this.intl).locale.startsWith("en-us")}getWeekSettings(){return this.weekSettings?this.weekSettings:Vx()?Bj(this.locale):yx}getStartOfWeek(){return this.getWeekSettings().firstDay}getMinDaysInFirstWeek(){return this.getWeekSettings().minimalDays}getWeekendDays(){return this.getWeekSettings().weekend}equals(t){return this.locale===t.locale&&this.numberingSystem===t.numberingSystem&&this.outputCalendar===t.outputCalendar}toString(){return`Locale(${this.locale}, ${this.numberingSystem}, ${this.outputCalendar})`}}let tb=null,ir=class Tp extends Mh{static get utcInstance(){return tb===null&&(tb=new Tp(0)),tb}static instance(t){return t===0?Tp.utcInstance:new Tp(t)}static parseSpecifier(t){if(t){const n=t.match(/^utc(?:([+-]\d{1,2})(?::(\d{2}))?)?$/i);if(n)return new Tp(tm(n[1],n[2]))}return null}constructor(t){super(),this.fixed=t}get type(){return"fixed"}get name(){return this.fixed===0?"UTC":`UTC${Bh(this.fixed,"narrow")}`}get ianaName(){return this.fixed===0?"Etc/UTC":`Etc/GMT${Bh(-this.fixed,"narrow")}`}offsetName(){return this.name}formatOffset(t,n){return Bh(this.fixed,n)}get isUniversal(){return!0}offset(){return this.fixed}equals(t){return t.type==="fixed"&&t.fixed===this.fixed}get isValid(){return!0}};class qj extends Mh{constructor(t){super(),this.zoneName=t}get type(){return"invalid"}get name(){return this.zoneName}get isUniversal(){return!1}offsetName(){return null}formatOffset(){return""}offset(){return NaN}equals(){return!1}get isValid(){return!1}}function La(e,t){if($t(e)||e===null)return t;if(e instanceof Mh)return e;if(e7(e)){const n=e.toLowerCase();return n==="default"?t:n==="local"||n==="system"?Yg.instance:n==="utc"||n==="gmt"?ir.utcInstance:ir.parseSpecifier(n)||dc.create(e)}else return Va(e)?ir.instance(e):typeof e=="object"&&"offset"in e&&typeof e.offset=="function"?e:new qj(e)}const nb={arab:"[٠-٩]",arabext:"[۰-۹]",bali:"[᭐-᭙]",beng:"[০-৯]",deva:"[०-९]",fullwide:"[0-9]",gujr:"[૦-૯]",hanidec:"[〇|一|二|三|四|五|六|七|八|九]",khmr:"[០-៩]",knda:"[೦-೯]",laoo:"[໐-໙]",limb:"[᥆-᥏]",mlym:"[൦-൯]",mong:"[᠐-᠙]",mymr:"[၀-၉]",orya:"[୦-୯]",tamldec:"[௦-௯]",telu:"[౦-౯]",thai:"[๐-๙]",tibt:"[༠-༩]",latn:"\\d"},wx={arab:[1632,1641],arabext:[1776,1785],bali:[6992,7001],beng:[2534,2543],deva:[2406,2415],fullwide:[65296,65303],gujr:[2790,2799],khmr:[6112,6121],knda:[3302,3311],laoo:[3792,3801],limb:[6470,6479],mlym:[3430,3439],mong:[6160,6169],mymr:[4160,4169],orya:[2918,2927],tamldec:[3046,3055],telu:[3174,3183],thai:[3664,3673],tibt:[3872,3881]},Yj=nb.hanidec.replace(/[\[|\]]/g,"").split("");function Zj(e){let t=parseInt(e,10);if(isNaN(t)){t="";for(let n=0;n<e.length;n++){const s=e.charCodeAt(n);if(e[n].search(nb.hanidec)!==-1)t+=Yj.indexOf(e[n]);else for(const o in wx){const[i,r]=wx[o];s>=i&&s<=r&&(t+=s-i)}}return parseInt(t,10)}else return t}const sb=new Map;function Xj(){sb.clear()}function xi({numberingSystem:e},t=""){const n=e||"latn";let s=sb.get(n);s===void 0&&(s=new Map,sb.set(n,s));let o=s.get(t);return o===void 0&&(o=new RegExp(`${nb[n]}${t}`),s.set(t,o)),o}let Cx=()=>Date.now(),bx="system",Sx=null,Ex=null,_x=null,Rx=60,Dx,Tx=null;class Zn{static get now(){return Cx}static set now(t){Cx=t}static set defaultZone(t){bx=t}static get defaultZone(){return La(bx,Yg.instance)}static get defaultLocale(){return Sx}static set defaultLocale(t){Sx=t}static get defaultNumberingSystem(){return Ex}static set defaultNumberingSystem(t){Ex=t}static get defaultOutputCalendar(){return _x}static set defaultOutputCalendar(t){_x=t}static get defaultWeekSettings(){return Tx}static set defaultWeekSettings(t){Tx=ab(t)}static get twoDigitCutoffYear(){return Rx}static set twoDigitCutoffYear(t){Rx=t%100}static get throwOnInvalid(){return Dx}static set throwOnInvalid(t){Dx=t}static resetCaches(){bn.resetCache(),dc.resetCache(),bt.resetCache(),Xj()}}class Fi{constructor(t,n){this.reason=t,this.explanation=n}toMessage(){return this.explanation?`${this.reason}: ${this.explanation}`:this.reason}}const Ix=[0,31,59,90,120,151,181,212,243,273,304,334],xx=[0,31,60,91,121,152,182,213,244,274,305,335];function ei(e,t){return new Fi("unit out of range",`you specified ${t} (of type ${typeof t}) as a ${e}, which is invalid`)}function ob(e,t,n){const s=new Date(Date.UTC(e,t-1,n));e<100&&e>=0&&s.setUTCFullYear(s.getUTCFullYear()-1900);const o=s.getUTCDay();return o===0?7:o}function Fx(e,t,n){return n+(Lh(e)?xx:Ix)[t-1]}function Px(e,t){const n=Lh(e)?xx:Ix,s=n.findIndex(i=>i<t),o=t-n[s];return{month:s+1,day:o}}function ib(e,t){return(e-t+7)%7+1}function Xg(e,t=4,n=1){const{year:s,month:o,day:i}=e,r=Fx(s,o,i),a=ib(ob(s,o,i),n);let l=Math.floor((r-a+14-t)/7),u;return l<1?(u=s-1,l=Vh(u,t,n)):l>Vh(s,t,n)?(u=s+1,l=1):u=s,{weekYear:u,weekNumber:l,weekday:a,...sm(e)}}function Ax(e,t=4,n=1){const{weekYear:s,weekNumber:o,weekday:i}=e,r=ib(ob(s,1,t),n),a=fc(s);let l=o*7+i-r-7+t,u;l<1?(u=s-1,l+=fc(u)):l>a?(u=s+1,l-=fc(s)):u=s;const{month:c,day:d}=Px(u,l);return{year:u,month:c,day:d,...sm(e)}}function rb(e){const{year:t,month:n,day:s}=e,o=Fx(t,n,s);return{year:t,ordinal:o,...sm(e)}}function kx(e){const{year:t,ordinal:n}=e,{month:s,day:o}=Px(t,n);return{year:t,month:s,day:o,...sm(e)}}function Ox(e,t){if(!$t(e.localWeekday)||!$t(e.localWeekNumber)||!$t(e.localWeekYear)){if(!$t(e.weekday)||!$t(e.weekNumber)||!$t(e.weekYear))throw new cc("Cannot mix locale-based week fields with ISO-based week fields");return $t(e.localWeekday)||(e.weekday=e.localWeekday),$t(e.localWeekNumber)||(e.weekNumber=e.localWeekNumber),$t(e.localWeekYear)||(e.weekYear=e.localWeekYear),delete e.localWeekday,delete e.localWeekNumber,delete e.localWeekYear,{minDaysInFirstWeek:t.getMinDaysInFirstWeek(),startOfWeek:t.getStartOfWeek()}}else return{minDaysInFirstWeek:4,startOfWeek:1}}function Jj(e,t=4,n=1){const s=Jg(e.weekYear),o=ti(e.weekNumber,1,Vh(e.weekYear,t,n)),i=ti(e.weekday,1,7);return s?o?i?!1:ei("weekday",e.weekday):ei("week",e.weekNumber):ei("weekYear",e.weekYear)}function Qj(e){const t=Jg(e.year),n=ti(e.ordinal,1,fc(e.year));return t?n?!1:ei("ordinal",e.ordinal):ei("year",e.year)}function Mx(e){const t=Jg(e.year),n=ti(e.month,1,12),s=ti(e.day,1,Qg(e.year,e.month));return t?n?s?!1:ei("day",e.day):ei("month",e.month):ei("year",e.year)}function Nx(e){const{hour:t,minute:n,second:s,millisecond:o}=e,i=ti(t,0,23)||t===24&&n===0&&s===0&&o===0,r=ti(n,0,59),a=ti(s,0,59),l=ti(o,0,999);return i?r?a?l?!1:ei("millisecond",o):ei("second",s):ei("minute",n):ei("hour",t)}function $t(e){return typeof e>"u"}function Va(e){return typeof e=="number"}function Jg(e){return typeof e=="number"&&e%1===0}function e7(e){return typeof e=="string"}function t7(e){return Object.prototype.toString.call(e)==="[object Date]"}function Lx(){try{return typeof Intl<"u"&&!!Intl.RelativeTimeFormat}catch{return!1}}function Vx(){try{return typeof Intl<"u"&&!!Intl.Locale&&("weekInfo"in Intl.Locale.prototype||"getWeekInfo"in Intl.Locale.prototype)}catch{return!1}}function n7(e){return Array.isArray(e)?e:[e]}function Bx(e,t,n){if(e.length!==0)return e.reduce((s,o)=>{const i=[t(o),o];return s&&n(s[0],i[0])===s[0]?s:i},null)[1]}function s7(e,t){return t.reduce((n,s)=>(n[s]=e[s],n),{})}function hc(e,t){return Object.prototype.hasOwnProperty.call(e,t)}function ab(e){if(e==null)return null;if(typeof e!="object")throw new Bs("Week settings must be an object");if(!ti(e.firstDay,1,7)||!ti(e.minimalDays,1,7)||!Array.isArray(e.weekend)||e.weekend.some(t=>!ti(t,1,7)))throw new Bs("Invalid week settings");return{firstDay:e.firstDay,minimalDays:e.minimalDays,weekend:Array.from(e.weekend)}}function ti(e,t,n){return Jg(e)&&e>=t&&e<=n}function o7(e,t){return e-t*Math.floor(e/t)}function ds(e,t=2){const n=e<0;let s;return n?s="-"+(""+-e).padStart(t,"0"):s=(""+e).padStart(t,"0"),s}function Ba(e){if(!($t(e)||e===null||e===""))return parseInt(e,10)}function zl(e){if(!($t(e)||e===null||e===""))return parseFloat(e)}function lb(e){if(!($t(e)||e===null||e==="")){const t=parseFloat("0."+e)*1e3;return Math.floor(t)}}function ub(e,t,n="round"){const s=10**t;switch(n){case"expand":return e>0?Math.ceil(e*s)/s:Math.floor(e*s)/s;case"trunc":return Math.trunc(e*s)/s;case"round":return Math.round(e*s)/s;case"floor":return Math.floor(e*s)/s;case"ceil":return Math.ceil(e*s)/s;default:throw new RangeError(`Value rounding ${n} is out of range`)}}function Lh(e){return e%4===0&&(e%100!==0||e%400===0)}function fc(e){return Lh(e)?366:365}function Qg(e,t){const n=o7(t-1,12)+1,s=e+(t-n)/12;return n===2?Lh(s)?29:28:[31,null,31,30,31,30,31,31,30,31,30,31][n-1]}function em(e){let t=Date.UTC(e.year,e.month-1,e.day,e.hour,e.minute,e.second,e.millisecond);return e.year<100&&e.year>=0&&(t=new Date(t),t.setUTCFullYear(e.year,e.month-1,e.day)),+t}function $x(e,t,n){return-ib(ob(e,1,t),n)+t-1}function Vh(e,t=4,n=1){const s=$x(e,t,n),o=$x(e+1,t,n);return(fc(e)-s+o)/7}function cb(e){return e>99?e:e>Zn.twoDigitCutoffYear?1900+e:2e3+e}function Hx(e,t,n,s=null){const o=new Date(e),i={hourCycle:"h23",year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit"};s&&(i.timeZone=s);const r={timeZoneName:t,...i},a=new Intl.DateTimeFormat(n,r).formatToParts(o).find(l=>l.type.toLowerCase()==="timezonename");return a?a.value:null}function tm(e,t){let n=parseInt(e,10);Number.isNaN(n)&&(n=0);const s=parseInt(t,10)||0,o=n<0||Object.is(n,-0)?-s:s;return n*60+o}function Gx(e){const t=Number(e);if(typeof e=="boolean"||e===""||!Number.isFinite(t))throw new Bs(`Invalid unit value ${e}`);return t}function nm(e,t){const n={};for(const s in e)if(hc(e,s)){const o=e[s];if(o==null)continue;n[t(s)]=Gx(o)}return n}function Bh(e,t){const n=Math.trunc(Math.abs(e/60)),s=Math.trunc(Math.abs(e%60)),o=e>=0?"+":"-";switch(t){case"short":return`${o}${ds(n,2)}:${ds(s,2)}`;case"narrow":return`${o}${n}${s>0?`:${s}`:""}`;case"techie":return`${o}${ds(n,2)}${ds(s,2)}`;default:throw new RangeError(`Value format ${t} is out of range for property format`)}}function sm(e){return s7(e,["hour","minute","second","millisecond"])}const i7=["January","February","March","April","May","June","July","August","September","October","November","December"],Ux=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],r7=["J","F","M","A","M","J","J","A","S","O","N","D"];function Wx(e){switch(e){case"narrow":return[...r7];case"short":return[...Ux];case"long":return[...i7];case"numeric":return["1","2","3","4","5","6","7","8","9","10","11","12"];case"2-digit":return["01","02","03","04","05","06","07","08","09","10","11","12"];default:return null}}const zx=["Monday","Tuesday","Wednesday","Thursday","Friday","Saturday","Sunday"],jx=["Mon","Tue","Wed","Thu","Fri","Sat","Sun"],a7=["M","T","W","T","F","S","S"];function Kx(e){switch(e){case"narrow":return[...a7];case"short":return[...jx];case"long":return[...zx];case"numeric":return["1","2","3","4","5","6","7"];default:return null}}const qx=["AM","PM"],l7=["Before Christ","Anno Domini"],u7=["BC","AD"],c7=["B","A"];function Yx(e){switch(e){case"narrow":return[...c7];case"short":return[...u7];case"long":return[...l7];default:return null}}function d7(e){return qx[e.hour<12?0:1]}function h7(e,t){return Kx(t)[e.weekday-1]}function f7(e,t){return Wx(t)[e.month-1]}function p7(e,t){return Yx(t)[e.year<0?0:1]}function g7(e,t,n="always",s=!1){const o={years:["year","yr."],quarters:["quarter","qtr."],months:["month","mo."],weeks:["week","wk."],days:["day","day","days"],hours:["hour","hr."],minutes:["minute","min."],seconds:["second","sec."]},i=["hours","minutes","seconds"].indexOf(e)===-1;if(n==="auto"&&i){const d=e==="days";switch(t){case 1:return d?"tomorrow":`next ${o[e][0]}`;case-1:return d?"yesterday":`last ${o[e][0]}`;case 0:return d?"today":`this ${o[e][0]}`}}const r=Object.is(t,-0)||t<0,a=Math.abs(t),l=a===1,u=o[e],c=s?l?u[1]:u[2]||u[1]:l?o[e][0]:e;return r?`${a} ${c} ago`:`in ${a} ${c}`}function Zx(e,t){let n="";for(const s of e)s.literal?n+=s.val:n+=t(s.val);return n}const m7={D:qg,DD:XI,DDD:JI,DDDD:QI,t:ex,tt:tx,ttt:nx,tttt:sx,T:ox,TT:ix,TTT:rx,TTTT:ax,f:lx,ff:cx,fff:hx,ffff:px,F:ux,FF:dx,FFF:fx,FFFF:gx};class $s{static create(t,n={}){return new $s(t,n)}static parseFormat(t){let n=null,s="",o=!1;const i=[];for(let r=0;r<t.length;r++){const a=t.charAt(r);a==="'"?((s.length>0||o)&&i.push({literal:o||/^\s+$/.test(s),val:s===""?"'":s}),n=null,s="",o=!o):o||a===n?s+=a:(s.length>0&&i.push({literal:/^\s+$/.test(s),val:s}),s=a,n=a)}return s.length>0&&i.push({literal:o||/^\s+$/.test(s),val:s}),i}static macroTokenToFormatOpts(t){return m7[t]}constructor(t,n){this.opts=n,this.loc=t,this.systemLoc=null}formatWithSystemDefault(t,n){return this.systemLoc===null&&(this.systemLoc=this.loc.redefaultToSystem()),this.systemLoc.dtFormatter(t,{...this.opts,...n}).format()}dtFormatter(t,n={}){return this.loc.dtFormatter(t,{...this.opts,...n})}formatDateTime(t,n){return this.dtFormatter(t,n).format()}formatDateTimeParts(t,n){return this.dtFormatter(t,n).formatToParts()}formatInterval(t,n){return this.dtFormatter(t.start,n).dtf.formatRange(t.start.toJSDate(),t.end.toJSDate())}resolvedOptions(t,n){return this.dtFormatter(t,n).resolvedOptions()}num(t,n=0,s=void 0){if(this.opts.forceSimple)return ds(t,n);const o={...this.opts};return n>0&&(o.padTo=n),s&&(o.signDisplay=s),this.loc.numberFormatter(o).format(t)}formatDateTimeFromString(t,n){const s=this.loc.listingMode()==="en",o=this.loc.outputCalendar&&this.loc.outputCalendar!=="gregory",i=(f,p)=>this.loc.extract(t,f,p),r=f=>t.isOffsetFixed&&t.offset===0&&f.allowZ?"Z":t.isValid?t.zone.formatOffset(t.ts,f.format):"",a=()=>s?d7(t):i({hour:"numeric",hourCycle:"h12"},"dayperiod"),l=(f,p)=>s?f7(t,f):i(p?{month:f}:{month:f,day:"numeric"},"month"),u=(f,p)=>s?h7(t,f):i(p?{weekday:f}:{weekday:f,month:"long",day:"numeric"},"weekday"),c=f=>{const p=$s.macroTokenToFormatOpts(f);return p?this.formatWithSystemDefault(t,p):f},d=f=>s?p7(t,f):i({era:f},"era"),h=f=>{switch(f){case"S":return this.num(t.millisecond);case"u":case"SSS":return this.num(t.millisecond,3);case"s":return this.num(t.second);case"ss":return this.num(t.second,2);case"uu":return this.num(Math.floor(t.millisecond/10),2);case"uuu":return this.num(Math.floor(t.millisecond/100));case"m":return this.num(t.minute);case"mm":return this.num(t.minute,2);case"h":return this.num(t.hour%12===0?12:t.hour%12);case"hh":return this.num(t.hour%12===0?12:t.hour%12,2);case"H":return this.num(t.hour);case"HH":return this.num(t.hour,2);case"Z":return r({format:"narrow",allowZ:this.opts.allowZ});case"ZZ":return r({format:"short",allowZ:this.opts.allowZ});case"ZZZ":return r({format:"techie",allowZ:this.opts.allowZ});case"ZZZZ":return t.zone.offsetName(t.ts,{format:"short",locale:this.loc.locale});case"ZZZZZ":return t.zone.offsetName(t.ts,{format:"long",locale:this.loc.locale});case"z":return t.zoneName;case"a":return a();case"d":return o?i({day:"numeric"},"day"):this.num(t.day);case"dd":return o?i({day:"2-digit"},"day"):this.num(t.day,2);case"c":return this.num(t.weekday);case"ccc":return u("short",!0);case"cccc":return u("long",!0);case"ccccc":return u("narrow",!0);case"E":return this.num(t.weekday);case"EEE":return u("short",!1);case"EEEE":return u("long",!1);case"EEEEE":return u("narrow",!1);case"L":return o?i({month:"numeric",day:"numeric"},"month"):this.num(t.month);case"LL":return o?i({month:"2-digit",day:"numeric"},"month"):this.num(t.month,2);case"LLL":return l("short",!0);case"LLLL":return l("long",!0);case"LLLLL":return l("narrow",!0);case"M":return o?i({month:"numeric"},"month"):this.num(t.month);case"MM":return o?i({month:"2-digit"},"month"):this.num(t.month,2);case"MMM":return l("short",!1);case"MMMM":return l("long",!1);case"MMMMM":return l("narrow",!1);case"y":return o?i({year:"numeric"},"year"):this.num(t.year);case"yy":return o?i({year:"2-digit"},"year"):this.num(t.year.toString().slice(-2),2);case"yyyy":return o?i({year:"numeric"},"year"):this.num(t.year,4);case"yyyyyy":return o?i({year:"numeric"},"year"):this.num(t.year,6);case"G":return d("short");case"GG":return d("long");case"GGGGG":return d("narrow");case"kk":return this.num(t.weekYear.toString().slice(-2),2);case"kkkk":return this.num(t.weekYear,4);case"W":return this.num(t.weekNumber);case"WW":return this.num(t.weekNumber,2);case"n":return this.num(t.localWeekNumber);case"nn":return this.num(t.localWeekNumber,2);case"ii":return this.num(t.localWeekYear.toString().slice(-2),2);case"iiii":return this.num(t.localWeekYear,4);case"o":return this.num(t.ordinal);case"ooo":return this.num(t.ordinal,3);case"q":return this.num(t.quarter);case"qq":return this.num(t.quarter,2);case"X":return this.num(Math.floor(t.ts/1e3));case"x":return this.num(t.ts);default:return c(f)}};return Zx($s.parseFormat(n),h)}formatDurationFromString(t,n){const s=this.opts.signMode==="negativeLargestOnly"?-1:1,o=c=>{switch(c[0]){case"S":return"milliseconds";case"s":return"seconds";case"m":return"minutes";case"h":return"hours";case"d":return"days";case"w":return"weeks";case"M":return"months";case"y":return"years";default:return null}},i=(c,d)=>h=>{const f=o(h);if(f){const p=d.isNegativeDuration&&f!==d.largestUnit?s:1;let g;return this.opts.signMode==="negativeLargestOnly"&&f!==d.largestUnit?g="never":this.opts.signMode==="all"?g="always":g="auto",this.num(c.get(f)*p,h.length,g)}else return h},r=$s.parseFormat(n),a=r.reduce((c,{literal:d,val:h})=>d?c:c.concat(h),[]),l=t.shiftTo(...a.map(o).filter(c=>c)),u={isNegativeDuration:l<0,largestUnit:Object.keys(l.values)[0]};return Zx(r,i(l,u))}}const Xx=/[A-Za-z_+-]{1,256}(?::?\/[A-Za-z0-9_+-]{1,256}(?:\/[A-Za-z0-9_+-]{1,256})?)?/;function pc(...e){const t=e.reduce((n,s)=>n+s.source,"");return RegExp(`^${t}$`)}function gc(...e){return t=>e.reduce(([n,s,o],i)=>{const[r,a,l]=i(t,o);return[{...n,...r},a||s,l]},[{},null,1]).slice(0,2)}function mc(e,...t){if(e==null)return[null,null];for(const[n,s]of t){const o=n.exec(e);if(o)return s(o)}return[null,null]}function Jx(...e){return(t,n)=>{const s={};let o;for(o=0;o<e.length;o++)s[e[o]]=Ba(t[n+o]);return[s,null,n+o]}}const Qx=/(?:([Zz])|([+-]\d\d)(?::?(\d\d))?)/,v7=`(?:${Qx.source}?(?:\\[(${Xx.source})\\])?)?`,db=/(\d\d)(?::?(\d\d)(?::?(\d\d)(?:[.,](\d{1,30}))?)?)?/,eF=RegExp(`${db.source}${v7}`),hb=RegExp(`(?:[Tt]${eF.source})?`),y7=/([+-]\d{6}|\d{4})(?:-?(\d\d)(?:-?(\d\d))?)?/,w7=/(\d{4})-?W(\d\d)(?:-?(\d))?/,C7=/(\d{4})-?(\d{3})/,b7=Jx("weekYear","weekNumber","weekDay"),S7=Jx("year","ordinal"),E7=/(\d{4})-(\d\d)-(\d\d)/,tF=RegExp(`${db.source} ?(?:${Qx.source}|(${Xx.source}))?`),_7=RegExp(`(?: ${tF.source})?`);function vc(e,t,n){const s=e[t];return $t(s)?n:Ba(s)}function R7(e,t){return[{year:vc(e,t),month:vc(e,t+1,1),day:vc(e,t+2,1)},null,t+3]}function yc(e,t){return[{hours:vc(e,t,0),minutes:vc(e,t+1,0),seconds:vc(e,t+2,0),milliseconds:lb(e[t+3])},null,t+4]}function $h(e,t){const n=!e[t]&&!e[t+1],s=tm(e[t+1],e[t+2]),o=n?null:ir.instance(s);return[{},o,t+3]}function Hh(e,t){const n=e[t]?dc.create(e[t]):null;return[{},n,t+1]}const D7=RegExp(`^T?${db.source}$`),T7=/^-?P(?:(?:(-?\d{1,20}(?:\.\d{1,20})?)Y)?(?:(-?\d{1,20}(?:\.\d{1,20})?)M)?(?:(-?\d{1,20}(?:\.\d{1,20})?)W)?(?:(-?\d{1,20}(?:\.\d{1,20})?)D)?(?:T(?:(-?\d{1,20}(?:\.\d{1,20})?)H)?(?:(-?\d{1,20}(?:\.\d{1,20})?)M)?(?:(-?\d{1,20})(?:[.,](-?\d{1,20}))?S)?)?)$/;function I7(e){const[t,n,s,o,i,r,a,l,u]=e,c=t[0]==="-",d=l&&l[0]==="-",h=(f,p=!1)=>f!==void 0&&(p||f&&c)?-f:f;return[{years:h(zl(n)),months:h(zl(s)),weeks:h(zl(o)),days:h(zl(i)),hours:h(zl(r)),minutes:h(zl(a)),seconds:h(zl(l),l==="-0"),milliseconds:h(lb(u),d)}]}const x7={GMT:0,EDT:-4*60,EST:-5*60,CDT:-5*60,CST:-6*60,MDT:-6*60,MST:-7*60,PDT:-7*60,PST:-8*60};function fb(e,t,n,s,o,i,r){const a={year:t.length===2?cb(Ba(t)):Ba(t),month:Ux.indexOf(n)+1,day:Ba(s),hour:Ba(o),minute:Ba(i)};return r&&(a.second=Ba(r)),e&&(a.weekday=e.length>3?zx.indexOf(e)+1:jx.indexOf(e)+1),a}const F7=/^(?:(Mon|Tue|Wed|Thu|Fri|Sat|Sun),\s)?(\d{1,2})\s(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)\s(\d{2,4})\s(\d\d):(\d\d)(?::(\d\d))?\s(?:(UT|GMT|[ECMP][SD]T)|([Zz])|(?:([+-]\d\d)(\d\d)))$/;function P7(e){const[,t,n,s,o,i,r,a,l,u,c,d]=e,h=fb(t,o,s,n,i,r,a);let f;return l?f=x7[l]:u?f=0:f=tm(c,d),[h,new ir(f)]}function A7(e){return e.replace(/\([^()]*\)|[\n\t]/g," ").replace(/(\s\s+)/g," ").trim()}const k7=/^(Mon|Tue|Wed|Thu|Fri|Sat|Sun), (\d\d) (Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec) (\d{4}) (\d\d):(\d\d):(\d\d) GMT$/,O7=/^(Monday|Tuesday|Wednesday|Thursday|Friday|Saturday|Sunday), (\d\d)-(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)-(\d\d) (\d\d):(\d\d):(\d\d) GMT$/,M7=/^(Mon|Tue|Wed|Thu|Fri|Sat|Sun) (Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec) ( \d|\d\d) (\d\d):(\d\d):(\d\d) (\d{4})$/;function nF(e){const[,t,n,s,o,i,r,a]=e;return[fb(t,o,s,n,i,r,a),ir.utcInstance]}function N7(e){const[,t,n,s,o,i,r,a]=e;return[fb(t,a,n,s,o,i,r),ir.utcInstance]}const L7=pc(y7,hb),V7=pc(w7,hb),B7=pc(C7,hb),$7=pc(eF),sF=gc(R7,yc,$h,Hh),H7=gc(b7,yc,$h,Hh),G7=gc(S7,yc,$h,Hh),U7=gc(yc,$h,Hh);function W7(e){return mc(e,[L7,sF],[V7,H7],[B7,G7],[$7,U7])}function z7(e){return mc(A7(e),[F7,P7])}function j7(e){return mc(e,[k7,nF],[O7,nF],[M7,N7])}function K7(e){return mc(e,[T7,I7])}const q7=gc(yc);function Y7(e){return mc(e,[D7,q7])}const Z7=pc(E7,_7),X7=pc(tF),J7=gc(yc,$h,Hh);function Q7(e){return mc(e,[Z7,sF],[X7,J7])}const oF="Invalid Duration",iF={weeks:{days:7,hours:7*24,minutes:7*24*60,seconds:7*24*60*60,milliseconds:7*24*60*60*1e3},days:{hours:24,minutes:24*60,seconds:24*60*60,milliseconds:24*60*60*1e3},hours:{minutes:60,seconds:60*60,milliseconds:60*60*1e3},minutes:{seconds:60,milliseconds:60*1e3},seconds:{milliseconds:1e3}},eK={years:{quarters:4,months:12,weeks:52,days:365,hours:365*24,minutes:365*24*60,seconds:365*24*60*60,milliseconds:365*24*60*60*1e3},quarters:{months:3,weeks:13,days:91,hours:91*24,minutes:91*24*60,seconds:91*24*60*60,milliseconds:91*24*60*60*1e3},months:{weeks:4,days:30,hours:30*24,minutes:30*24*60,seconds:30*24*60*60,milliseconds:30*24*60*60*1e3},...iF},ni=146097/400,wc=146097/4800,tK={years:{quarters:4,months:12,weeks:ni/7,days:ni,hours:ni*24,minutes:ni*24*60,seconds:ni*24*60*60,milliseconds:ni*24*60*60*1e3},quarters:{months:3,weeks:ni/28,days:ni/4,hours:ni*24/4,minutes:ni*24*60/4,seconds:ni*24*60*60/4,milliseconds:ni*24*60*60*1e3/4},months:{weeks:wc/7,days:wc,hours:wc*24,minutes:wc*24*60,seconds:wc*24*60*60,milliseconds:wc*24*60*60*1e3},...iF},jl=["years","quarters","months","weeks","days","hours","minutes","seconds","milliseconds"],nK=jl.slice(0).reverse();function Yr(e,t,n=!1){const s={values:n?t.values:{...e.values,...t.values||{}},loc:e.loc.clone(t.loc),conversionAccuracy:t.conversionAccuracy||e.conversionAccuracy,matrix:t.matrix||e.matrix};return new hn(s)}function rF(e,t){let n=t.milliseconds??0;for(const s of nK.slice(1))t[s]&&(n+=t[s]*e[s].milliseconds);return n}function aF(e,t){const n=rF(e,t)<0?-1:1;jl.reduceRight((s,o)=>{if($t(t[o]))return s;if(s){const i=t[s]*n,r=e[o][s],a=Math.floor(i/r);t[o]+=a*n,t[s]-=a*r*n}return o},null),jl.reduce((s,o)=>{if($t(t[o]))return s;if(s){const i=t[s]%1;t[s]-=i,t[o]+=i*e[s][o]}return o},null)}function lF(e){const t={};for(const[n,s]of Object.entries(e))s!==0&&(t[n]=s);return t}class hn{constructor(t){const n=t.conversionAccuracy==="longterm"||!1;let s=n?tK:eK;t.matrix&&(s=t.matrix),this.values=t.values,this.loc=t.loc||bn.create(),this.conversionAccuracy=n?"longterm":"casual",this.invalid=t.invalid||null,this.matrix=s,this.isLuxonDuration=!0}static fromMillis(t,n){return hn.fromObject({milliseconds:t},n)}static fromObject(t,n={}){if(t==null||typeof t!="object")throw new Bs(`Duration.fromObject: argument expected to be an object, got ${t===null?"null":typeof t}`);return new hn({values:nm(t,hn.normalizeUnit),loc:bn.fromObject(n),conversionAccuracy:n.conversionAccuracy,matrix:n.matrix})}static fromDurationLike(t){if(Va(t))return hn.fromMillis(t);if(hn.isDuration(t))return t;if(typeof t=="object")return hn.fromObject(t);throw new Bs(`Unknown duration argument ${t} of type ${typeof t}`)}static fromISO(t,n){const[s]=K7(t);return s?hn.fromObject(s,n):hn.invalid("unparsable",`the input "${t}" can't be parsed as ISO 8601`)}static fromISOTime(t,n){const[s]=Y7(t);return s?hn.fromObject(s,n):hn.invalid("unparsable",`the input "${t}" can't be parsed as ISO 8601`)}static invalid(t,n=null){if(!t)throw new Bs("need to specify a reason the Duration is invalid");const s=t instanceof Fi?t:new Fi(t,n);if(Zn.throwOnInvalid)throw new Ij(s);return new hn({invalid:s})}static normalizeUnit(t){const n={year:"years",years:"years",quarter:"quarters",quarters:"quarters",month:"months",months:"months",week:"weeks",weeks:"weeks",day:"days",days:"days",hour:"hours",hours:"hours",minute:"minutes",minutes:"minutes",second:"seconds",seconds:"seconds",millisecond:"milliseconds",milliseconds:"milliseconds"}[t&&t.toLowerCase()];if(!n)throw new ZI(t);return n}static isDuration(t){return t&&t.isLuxonDuration||!1}get locale(){return this.isValid?this.loc.locale:null}get numberingSystem(){return this.isValid?this.loc.numberingSystem:null}toFormat(t,n={}){const s={...n,floor:n.round!==!1&&n.floor!==!1};return this.isValid?$s.create(this.loc,s).formatDurationFromString(this,t):oF}toHuman(t={}){if(!this.isValid)return oF;const n=t.showZeros!==!1,s=jl.map(o=>{const i=this.values[o];return $t(i)||i===0&&!n?null:this.loc.numberFormatter({style:"unit",unitDisplay:"long",...t,unit:o.slice(0,-1)}).format(i)}).filter(o=>o);return this.loc.listFormatter({type:"conjunction",style:t.listStyle||"narrow",...t}).format(s)}toObject(){return this.isValid?{...this.values}:{}}toISO(){if(!this.isValid)return null;let t="P";return this.years!==0&&(t+=this.years+"Y"),(this.months!==0||this.quarters!==0)&&(t+=this.months+this.quarters*3+"M"),this.weeks!==0&&(t+=this.weeks+"W"),this.days!==0&&(t+=this.days+"D"),(this.hours!==0||this.minutes!==0||this.seconds!==0||this.milliseconds!==0)&&(t+="T"),this.hours!==0&&(t+=this.hours+"H"),this.minutes!==0&&(t+=this.minutes+"M"),(this.seconds!==0||this.milliseconds!==0)&&(t+=ub(this.seconds+this.milliseconds/1e3,3)+"S"),t==="P"&&(t+="T0S"),t}toISOTime(t={}){if(!this.isValid)return null;const n=this.toMillis();return n<0||n>=864e5?null:(t={suppressMilliseconds:!1,suppressSeconds:!1,includePrefix:!1,format:"extended",...t,includeOffset:!1},bt.fromMillis(n,{zone:"UTC"}).toISOTime(t))}toJSON(){return this.toISO()}toString(){return this.toISO()}[Symbol.for("nodejs.util.inspect.custom")](){return this.isValid?`Duration { values: ${JSON.stringify(this.values)} }`:`Duration { Invalid, reason: ${this.invalidReason} }`}toMillis(){return this.isValid?rF(this.matrix,this.values):NaN}valueOf(){return this.toMillis()}plus(t){if(!this.isValid)return this;const n=hn.fromDurationLike(t),s={};for(const o of jl)(hc(n.values,o)||hc(this.values,o))&&(s[o]=n.get(o)+this.get(o));return Yr(this,{values:s},!0)}minus(t){if(!this.isValid)return this;const n=hn.fromDurationLike(t);return this.plus(n.negate())}mapUnits(t){if(!this.isValid)return this;const n={};for(const s of Object.keys(this.values))n[s]=Gx(t(this.values[s],s));return Yr(this,{values:n},!0)}get(t){return this[hn.normalizeUnit(t)]}set(t){if(!this.isValid)return this;const n={...this.values,...nm(t,hn.normalizeUnit)};return Yr(this,{values:n})}reconfigure({locale:t,numberingSystem:n,conversionAccuracy:s,matrix:o}={}){const r={loc:this.loc.clone({locale:t,numberingSystem:n}),matrix:o,conversionAccuracy:s};return Yr(this,r)}as(t){return this.isValid?this.shiftTo(t).get(t):NaN}normalize(){if(!this.isValid)return this;const t=this.toObject();return aF(this.matrix,t),Yr(this,{values:t},!0)}rescale(){if(!this.isValid)return this;const t=lF(this.normalize().shiftToAll().toObject());return Yr(this,{values:t},!0)}shiftTo(...t){if(!this.isValid)return this;if(t.length===0)return this;t=t.map(r=>hn.normalizeUnit(r));const n={},s={},o=this.toObject();let i;for(const r of jl)if(t.indexOf(r)>=0){i=r;let a=0;for(const u in s)a+=this.matrix[u][r]*s[u],s[u]=0;Va(o[r])&&(a+=o[r]);const l=Math.trunc(a);n[r]=l,s[r]=(a*1e3-l*1e3)/1e3}else Va(o[r])&&(s[r]=o[r]);for(const r in s)s[r]!==0&&(n[i]+=r===i?s[r]:s[r]/this.matrix[i][r]);return aF(this.matrix,n),Yr(this,{values:n},!0)}shiftToAll(){return this.isValid?this.shiftTo("years","months","weeks","days","hours","minutes","seconds","milliseconds"):this}negate(){if(!this.isValid)return this;const t={};for(const n of Object.keys(this.values))t[n]=this.values[n]===0?0:-this.values[n];return Yr(this,{values:t},!0)}removeZeros(){if(!this.isValid)return this;const t=lF(this.values);return Yr(this,{values:t},!0)}get years(){return this.isValid?this.values.years||0:NaN}get quarters(){return this.isValid?this.values.quarters||0:NaN}get months(){return this.isValid?this.values.months||0:NaN}get weeks(){return this.isValid?this.values.weeks||0:NaN}get days(){return this.isValid?this.values.days||0:NaN}get hours(){return this.isValid?this.values.hours||0:NaN}get minutes(){return this.isValid?this.values.minutes||0:NaN}get seconds(){return this.isValid?this.values.seconds||0:NaN}get milliseconds(){return this.isValid?this.values.milliseconds||0:NaN}get isValid(){return this.invalid===null}get invalidReason(){return this.invalid?this.invalid.reason:null}get invalidExplanation(){return this.invalid?this.invalid.explanation:null}equals(t){if(!this.isValid||!t.isValid||!this.loc.equals(t.loc))return!1;function n(s,o){return s===void 0||s===0?o===void 0||o===0:s===o}for(const s of jl)if(!n(this.values[s],t.values[s]))return!1;return!0}}const Cc="Invalid Interval";function sK(e,t){return!e||!e.isValid?Xn.invalid("missing or invalid start"):!t||!t.isValid?Xn.invalid("missing or invalid end"):t<e?Xn.invalid("end before start",`The end of an interval must be after its start, but you had start=${e.toISO()} and end=${t.toISO()}`):null}class Xn{constructor(t){this.s=t.start,this.e=t.end,this.invalid=t.invalid||null,this.isLuxonInterval=!0}static invalid(t,n=null){if(!t)throw new Bs("need to specify a reason the Interval is invalid");const s=t instanceof Fi?t:new Fi(t,n);if(Zn.throwOnInvalid)throw new Tj(s);return new Xn({invalid:s})}static fromDateTimes(t,n){const s=Wh(t),o=Wh(n),i=sK(s,o);return i??new Xn({start:s,end:o})}static after(t,n){const s=hn.fromDurationLike(n),o=Wh(t);return Xn.fromDateTimes(o,o.plus(s))}static before(t,n){const s=hn.fromDurationLike(n),o=Wh(t);return Xn.fromDateTimes(o.minus(s),o)}static fromISO(t,n){const[s,o]=(t||"").split("/",2);if(s&&o){let i,r;try{i=bt.fromISO(s,n),r=i.isValid}catch{r=!1}let a,l;try{a=bt.fromISO(o,n),l=a.isValid}catch{l=!1}if(r&&l)return Xn.fromDateTimes(i,a);if(r){const u=hn.fromISO(o,n);if(u.isValid)return Xn.after(i,u)}else if(l){const u=hn.fromISO(s,n);if(u.isValid)return Xn.before(a,u)}}return Xn.invalid("unparsable",`the input "${t}" can't be parsed as ISO 8601`)}static isInterval(t){return t&&t.isLuxonInterval||!1}get start(){return this.isValid?this.s:null}get end(){return this.isValid?this.e:null}get lastDateTime(){return this.isValid&&this.e?this.e.minus(1):null}get isValid(){return this.invalidReason===null}get invalidReason(){return this.invalid?this.invalid.reason:null}get invalidExplanation(){return this.invalid?this.invalid.explanation:null}length(t="milliseconds"){return this.isValid?this.toDuration(t).get(t):NaN}count(t="milliseconds",n){if(!this.isValid)return NaN;const s=this.start.startOf(t,n);let o;return n!=null&&n.useLocaleWeeks?o=this.end.reconfigure({locale:s.locale}):o=this.end,o=o.startOf(t,n),Math.floor(o.diff(s,t).get(t))+(o.valueOf()!==this.end.valueOf())}hasSame(t){return this.isValid?this.isEmpty()||this.e.minus(1).hasSame(this.s,t):!1}isEmpty(){return this.s.valueOf()===this.e.valueOf()}isAfter(t){return this.isValid?this.s>t:!1}isBefore(t){return this.isValid?this.e<=t:!1}contains(t){return this.isValid?this.s<=t&&this.e>t:!1}set({start:t,end:n}={}){return this.isValid?Xn.fromDateTimes(t||this.s,n||this.e):this}splitAt(...t){if(!this.isValid)return[];const n=t.map(Wh).filter(r=>this.contains(r)).sort((r,a)=>r.toMillis()-a.toMillis()),s=[];let{s:o}=this,i=0;for(;o<this.e;){const r=n[i]||this.e,a=+r>+this.e?this.e:r;s.push(Xn.fromDateTimes(o,a)),o=a,i+=1}return s}splitBy(t){const n=hn.fromDurationLike(t);if(!this.isValid||!n.isValid||n.as("milliseconds")===0)return[];let{s}=this,o=1,i;const r=[];for(;s<this.e;){const a=this.start.plus(n.mapUnits(l=>l*o));i=+a>+this.e?this.e:a,r.push(Xn.fromDateTimes(s,i)),s=i,o+=1}return r}divideEqually(t){return this.isValid?this.splitBy(this.length()/t).slice(0,t):[]}overlaps(t){return this.e>t.s&&this.s<t.e}abutsStart(t){return this.isValid?+this.e==+t.s:!1}abutsEnd(t){return this.isValid?+t.e==+this.s:!1}engulfs(t){return this.isValid?this.s<=t.s&&this.e>=t.e:!1}equals(t){return!this.isValid||!t.isValid?!1:this.s.equals(t.s)&&this.e.equals(t.e)}intersection(t){if(!this.isValid)return this;const n=this.s>t.s?this.s:t.s,s=this.e<t.e?this.e:t.e;return n>=s?null:Xn.fromDateTimes(n,s)}union(t){if(!this.isValid)return this;const n=this.s<t.s?this.s:t.s,s=this.e>t.e?this.e:t.e;return Xn.fromDateTimes(n,s)}static merge(t){const[n,s]=t.sort((o,i)=>o.s-i.s).reduce(([o,i],r)=>i?i.overlaps(r)||i.abutsStart(r)?[o,i.union(r)]:[o.concat([i]),r]:[o,r],[[],null]);return s&&n.push(s),n}static xor(t){let n=null,s=0;const o=[],i=t.map(l=>[{time:l.s,type:"s"},{time:l.e,type:"e"}]),r=Array.prototype.concat(...i),a=r.sort((l,u)=>l.time-u.time);for(const l of a)s+=l.type==="s"?1:-1,s===1?n=l.time:(n&&+n!=+l.time&&o.push(Xn.fromDateTimes(n,l.time)),n=null);return Xn.merge(o)}difference(...t){return Xn.xor([this].concat(t)).map(n=>this.intersection(n)).filter(n=>n&&!n.isEmpty())}toString(){return this.isValid?`[${this.s.toISO()} – ${this.e.toISO()})`:Cc}[Symbol.for("nodejs.util.inspect.custom")](){return this.isValid?`Interval { start: ${this.s.toISO()}, end: ${this.e.toISO()} }`:`Interval { Invalid, reason: ${this.invalidReason} }`}toLocaleString(t=qg,n={}){return this.isValid?$s.create(this.s.loc.clone(n),t).formatInterval(this):Cc}toISO(t){return this.isValid?`${this.s.toISO(t)}/${this.e.toISO(t)}`:Cc}toISODate(){return this.isValid?`${this.s.toISODate()}/${this.e.toISODate()}`:Cc}toISOTime(t){return this.isValid?`${this.s.toISOTime(t)}/${this.e.toISOTime(t)}`:Cc}toFormat(t,{separator:n=" – "}={}){return this.isValid?`${this.s.toFormat(t)}${n}${this.e.toFormat(t)}`:Cc}toDuration(t,n){return this.isValid?this.e.diff(this.s,t,n):hn.invalid(this.invalidReason)}mapEndpoints(t){return Xn.fromDateTimes(t(this.s),t(this.e))}}class bc{static hasDST(t=Zn.defaultZone){const n=bt.now().setZone(t).set({month:12});return!t.isUniversal&&n.offset!==n.set({month:6}).offset}static isValidIANAZone(t){return dc.isValidZone(t)}static normalizeZone(t){return La(t,Zn.defaultZone)}static getStartOfWeek({locale:t=null,locObj:n=null}={}){return(n||bn.create(t)).getStartOfWeek()}static getMinimumDaysInFirstWeek({locale:t=null,locObj:n=null}={}){return(n||bn.create(t)).getMinDaysInFirstWeek()}static getWeekendWeekdays({locale:t=null,locObj:n=null}={}){return(n||bn.create(t)).getWeekendDays().slice()}static months(t="long",{locale:n=null,numberingSystem:s=null,locObj:o=null,outputCalendar:i="gregory"}={}){return(o||bn.create(n,s,i)).months(t)}static monthsFormat(t="long",{locale:n=null,numberingSystem:s=null,locObj:o=null,outputCalendar:i="gregory"}={}){return(o||bn.create(n,s,i)).months(t,!0)}static weekdays(t="long",{locale:n=null,numberingSystem:s=null,locObj:o=null}={}){return(o||bn.create(n,s,null)).weekdays(t)}static weekdaysFormat(t="long",{locale:n=null,numberingSystem:s=null,locObj:o=null}={}){return(o||bn.create(n,s,null)).weekdays(t,!0)}static meridiems({locale:t=null}={}){return bn.create(t).meridiems()}static eras(t="short",{locale:n=null}={}){return bn.create(n,null,"gregory").eras(t)}static features(){return{relative:Lx(),localeWeek:Vx()}}}function uF(e,t){const n=o=>o.toUTC(0,{keepLocalTime:!0}).startOf("day").valueOf(),s=n(t)-n(e);return Math.floor(hn.fromMillis(s).as("days"))}function oK(e,t,n){const s=[["years",(l,u)=>u.year-l.year],["quarters",(l,u)=>u.quarter-l.quarter+(u.year-l.year)*4],["months",(l,u)=>u.month-l.month+(u.year-l.year)*12],["weeks",(l,u)=>{const c=uF(l,u);return(c-c%7)/7}],["days",uF]],o={},i=e;let r,a;for(const[l,u]of s)n.indexOf(l)>=0&&(r=l,o[l]=u(e,t),a=i.plus(o),a>t?(o[l]--,e=i.plus(o),e>t&&(a=e,o[l]--,e=i.plus(o))):e=a);return[e,o,a,r]}function iK(e,t,n,s){let[o,i,r,a]=oK(e,t,n);const l=t-o,u=n.filter(d=>["hours","minutes","seconds","milliseconds"].indexOf(d)>=0);u.length===0&&(r<t&&(r=o.plus({[a]:1})),r!==o&&(i[a]=(i[a]||0)+l/(r-o)));const c=hn.fromObject(i,s);return u.length>0?hn.fromMillis(l,s).shiftTo(...u).plus(c):c}const rK="missing Intl.DateTimeFormat.formatToParts support";function vn(e,t=n=>n){return{regex:e,deser:([n])=>t(Zj(n))}}const cF="[ ]",dF=new RegExp(cF,"g");function aK(e){return e.replace(/\./g,"\\.?").replace(dF,cF)}function hF(e){return e.replace(/\./g,"").replace(dF," ").toLowerCase()}function Pi(e,t){return e===null?null:{regex:RegExp(e.map(aK).join("|")),deser:([n])=>e.findIndex(s=>hF(n)===hF(s))+t}}function fF(e,t){return{regex:e,deser:([,n,s])=>tm(n,s),groups:t}}function om(e){return{regex:e,deser:([t])=>t}}function lK(e){return e.replace(/[\-\[\]{}()*+?.,\\\^$|#\s]/g,"\\$&")}function uK(e,t){const n=xi(t),s=xi(t,"{2}"),o=xi(t,"{3}"),i=xi(t,"{4}"),r=xi(t,"{6}"),a=xi(t,"{1,2}"),l=xi(t,"{1,3}"),u=xi(t,"{1,6}"),c=xi(t,"{1,9}"),d=xi(t,"{2,4}"),h=xi(t,"{4,6}"),f=v=>({regex:RegExp(lK(v.val)),deser:([C])=>C,literal:!0}),g=(v=>{if(e.literal)return f(v);switch(v.val){case"G":return Pi(t.eras("short"),0);case"GG":return Pi(t.eras("long"),0);case"y":return vn(u);case"yy":return vn(d,cb);case"yyyy":return vn(i);case"yyyyy":return vn(h);case"yyyyyy":return vn(r);case"M":return vn(a);case"MM":return vn(s);case"MMM":return Pi(t.months("short",!0),1);case"MMMM":return Pi(t.months("long",!0),1);case"L":return vn(a);case"LL":return vn(s);case"LLL":return Pi(t.months("short",!1),1);case"LLLL":return Pi(t.months("long",!1),1);case"d":return vn(a);case"dd":return vn(s);case"o":return vn(l);case"ooo":return vn(o);case"HH":return vn(s);case"H":return vn(a);case"hh":return vn(s);case"h":return vn(a);case"mm":return vn(s);case"m":return vn(a);case"q":return vn(a);case"qq":return vn(s);case"s":return vn(a);case"ss":return vn(s);case"S":return vn(l);case"SSS":return vn(o);case"u":return om(c);case"uu":return om(a);case"uuu":return vn(n);case"a":return Pi(t.meridiems(),0);case"kkkk":return vn(i);case"kk":return vn(d,cb);case"W":return vn(a);case"WW":return vn(s);case"E":case"c":return vn(n);case"EEE":return Pi(t.weekdays("short",!1),1);case"EEEE":return Pi(t.weekdays("long",!1),1);case"ccc":return Pi(t.weekdays("short",!0),1);case"cccc":return Pi(t.weekdays("long",!0),1);case"Z":case"ZZ":return fF(new RegExp(`([+-]${a.source})(?::(${s.source}))?`),2);case"ZZZ":return fF(new RegExp(`([+-]${a.source})(${s.source})?`),2);case"z":return om(/[a-z_+-/]{1,256}?/i);case" ":return om(/[^\S\n\r]/);default:return f(v)}})(e)||{invalidReason:rK};return g.token=e,g}const cK={year:{"2-digit":"yy",numeric:"yyyyy"},month:{numeric:"M","2-digit":"MM",short:"MMM",long:"MMMM"},day:{numeric:"d","2-digit":"dd"},weekday:{short:"EEE",long:"EEEE"},dayperiod:"a",dayPeriod:"a",hour12:{numeric:"h","2-digit":"hh"},hour24:{numeric:"H","2-digit":"HH"},minute:{numeric:"m","2-digit":"mm"},second:{numeric:"s","2-digit":"ss"},timeZoneName:{long:"ZZZZZ",short:"ZZZ"}};function dK(e,t,n){const{type:s,value:o}=e;if(s==="literal"){const l=/^\s+$/.test(o);return{literal:!l,val:l?" ":o}}const i=t[s];let r=s;s==="hour"&&(t.hour12!=null?r=t.hour12?"hour12":"hour24":t.hourCycle!=null?t.hourCycle==="h11"||t.hourCycle==="h12"?r="hour12":r="hour24":r=n.hour12?"hour12":"hour24");let a=cK[r];if(typeof a=="object"&&(a=a[i]),a)return{literal:!1,val:a}}function hK(e){return[`^${e.map(n=>n.regex).reduce((n,s)=>`${n}(${s.source})`,"")}$`,e]}function fK(e,t,n){const s=e.match(t);if(s){const o={};let i=1;for(const r in n)if(hc(n,r)){const a=n[r],l=a.groups?a.groups+1:1;!a.literal&&a.token&&(o[a.token.val[0]]=a.deser(s.slice(i,i+l))),i+=l}return[s,o]}else return[s,{}]}function pK(e){const t=i=>{switch(i){case"S":return"millisecond";case"s":return"second";case"m":return"minute";case"h":case"H":return"hour";case"d":return"day";case"o":return"ordinal";case"L":case"M":return"month";case"y":return"year";case"E":case"c":return"weekday";case"W":return"weekNumber";case"k":return"weekYear";case"q":return"quarter";default:return null}};let n=null,s;return $t(e.z)||(n=dc.create(e.z)),$t(e.Z)||(n||(n=new ir(e.Z)),s=e.Z),$t(e.q)||(e.M=(e.q-1)*3+1),$t(e.h)||(e.h<12&&e.a===1?e.h+=12:e.h===12&&e.a===0&&(e.h=0)),e.G===0&&e.y&&(e.y=-e.y),$t(e.u)||(e.S=lb(e.u)),[Object.keys(e).reduce((i,r)=>{const a=t(r);return a&&(i[a]=e[r]),i},{}),n,s]}let pb=null;function gK(){return pb||(pb=bt.fromMillis(1555555555555)),pb}function mK(e,t){if(e.literal)return e;const n=$s.macroTokenToFormatOpts(e.val),s=vF(n,t);return s==null||s.includes(void 0)?e:s}function pF(e,t){return Array.prototype.concat(...e.map(n=>mK(n,t)))}class gF{constructor(t,n){if(this.locale=t,this.format=n,this.tokens=pF($s.parseFormat(n),t),this.units=this.tokens.map(s=>uK(s,t)),this.disqualifyingUnit=this.units.find(s=>s.invalidReason),!this.disqualifyingUnit){const[s,o]=hK(this.units);this.regex=RegExp(s,"i"),this.handlers=o}}explainFromTokens(t){if(this.isValid){const[n,s]=fK(t,this.regex,this.handlers),[o,i,r]=s?pK(s):[null,null,void 0];if(hc(s,"a")&&hc(s,"H"))throw new cc("Can't include meridiem when specifying 24-hour format");return{input:t,tokens:this.tokens,regex:this.regex,rawMatches:n,matches:s,result:o,zone:i,specificOffset:r}}else return{input:t,tokens:this.tokens,invalidReason:this.invalidReason}}get isValid(){return!this.disqualifyingUnit}get invalidReason(){return this.disqualifyingUnit?this.disqualifyingUnit.invalidReason:null}}function mF(e,t,n){return new gF(e,n).explainFromTokens(t)}function vK(e,t,n){const{result:s,zone:o,specificOffset:i,invalidReason:r}=mF(e,t,n);return[s,o,i,r]}function vF(e,t){if(!e)return null;const s=$s.create(t,e).dtFormatter(gK()),o=s.formatToParts(),i=s.resolvedOptions();return o.map(r=>dK(r,e,i))}const gb="Invalid DateTime",yF=864e13;function Gh(e){return new Fi("unsupported zone",`the zone "${e.name}" is not supported`)}function mb(e){return e.weekData===null&&(e.weekData=Xg(e.c)),e.weekData}function vb(e){return e.localWeekData===null&&(e.localWeekData=Xg(e.c,e.loc.getMinDaysInFirstWeek(),e.loc.getStartOfWeek())),e.localWeekData}function Kl(e,t){const n={ts:e.ts,zone:e.zone,c:e.c,o:e.o,loc:e.loc,invalid:e.invalid};return new bt({...n,...t,old:n})}function wF(e,t,n){let s=e-t*60*1e3;const o=n.offset(s);if(t===o)return[s,t];s-=(o-t)*60*1e3;const i=n.offset(s);return o===i?[s,o]:[e-Math.min(o,i)*60*1e3,Math.max(o,i)]}function im(e,t){e+=t*60*1e3;const n=new Date(e);return{year:n.getUTCFullYear(),month:n.getUTCMonth()+1,day:n.getUTCDate(),hour:n.getUTCHours(),minute:n.getUTCMinutes(),second:n.getUTCSeconds(),millisecond:n.getUTCMilliseconds()}}function rm(e,t,n){return wF(em(e),t,n)}function CF(e,t){const n=e.o,s=e.c.year+Math.trunc(t.years),o=e.c.month+Math.trunc(t.months)+Math.trunc(t.quarters)*3,i={...e.c,year:s,month:o,day:Math.min(e.c.day,Qg(s,o))+Math.trunc(t.days)+Math.trunc(t.weeks)*7},r=hn.fromObject({years:t.years-Math.trunc(t.years),quarters:t.quarters-Math.trunc(t.quarters),months:t.months-Math.trunc(t.months),weeks:t.weeks-Math.trunc(t.weeks),days:t.days-Math.trunc(t.days),hours:t.hours,minutes:t.minutes,seconds:t.seconds,milliseconds:t.milliseconds}).as("milliseconds"),a=em(i);let[l,u]=wF(a,n,e.zone);return r!==0&&(l+=r,u=e.zone.offset(l)),{ts:l,o:u}}function Sc(e,t,n,s,o,i){const{setZone:r,zone:a}=n;if(e&&Object.keys(e).length!==0||t){const l=t||a,u=bt.fromObject(e,{...n,zone:l,specificOffset:i});return r?u:u.setZone(a)}else return bt.invalid(new Fi("unparsable",`the input "${o}" can't be parsed as ${s}`))}function am(e,t,n=!0){return e.isValid?$s.create(bn.create("en-US"),{allowZ:n,forceSimple:!0}).formatDateTimeFromString(e,t):null}function yb(e,t,n){const s=e.c.year>9999||e.c.year<0;let o="";if(s&&e.c.year>=0&&(o+="+"),o+=ds(e.c.year,s?6:4),n==="year")return o;if(t){if(o+="-",o+=ds(e.c.month),n==="month")return o;o+="-"}else if(o+=ds(e.c.month),n==="month")return o;return o+=ds(e.c.day),o}function bF(e,t,n,s,o,i,r){let a=!n||e.c.millisecond!==0||e.c.second!==0,l="";switch(r){case"day":case"month":case"year":break;default:if(l+=ds(e.c.hour),r==="hour")break;if(t){if(l+=":",l+=ds(e.c.minute),r==="minute")break;a&&(l+=":",l+=ds(e.c.second))}else{if(l+=ds(e.c.minute),r==="minute")break;a&&(l+=ds(e.c.second))}if(r==="second")break;a&&(!s||e.c.millisecond!==0)&&(l+=".",l+=ds(e.c.millisecond,3))}return o&&(e.isOffsetFixed&&e.offset===0&&!i?l+="Z":e.o<0?(l+="-",l+=ds(Math.trunc(-e.o/60)),l+=":",l+=ds(Math.trunc(-e.o%60))):(l+="+",l+=ds(Math.trunc(e.o/60)),l+=":",l+=ds(Math.trunc(e.o%60)))),i&&(l+="["+e.zone.ianaName+"]"),l}const SF={month:1,day:1,hour:0,minute:0,second:0,millisecond:0},yK={weekNumber:1,weekday:1,hour:0,minute:0,second:0,millisecond:0},wK={ordinal:1,hour:0,minute:0,second:0,millisecond:0},lm=["year","month","day","hour","minute","second","millisecond"],CK=["weekYear","weekNumber","weekday","hour","minute","second","millisecond"],bK=["year","ordinal","hour","minute","second","millisecond"];function um(e){const t={year:"year",years:"year",month:"month",months:"month",day:"day",days:"day",hour:"hour",hours:"hour",minute:"minute",minutes:"minute",quarter:"quarter",quarters:"quarter",second:"second",seconds:"second",millisecond:"millisecond",milliseconds:"millisecond",weekday:"weekday",weekdays:"weekday",weeknumber:"weekNumber",weeksnumber:"weekNumber",weeknumbers:"weekNumber",weekyear:"weekYear",weekyears:"weekYear",ordinal:"ordinal"}[e.toLowerCase()];if(!t)throw new ZI(e);return t}function EF(e){switch(e.toLowerCase()){case"localweekday":case"localweekdays":return"localWeekday";case"localweeknumber":case"localweeknumbers":return"localWeekNumber";case"localweekyear":case"localweekyears":return"localWeekYear";default:return um(e)}}function SK(e){if(Uh===void 0&&(Uh=Zn.now()),e.type!=="iana")return e.offset(Uh);const t=e.name;let n=wb.get(t);return n===void 0&&(n=e.offset(Uh),wb.set(t,n)),n}function _F(e,t){const n=La(t.zone,Zn.defaultZone);if(!n.isValid)return bt.invalid(Gh(n));const s=bn.fromObject(t);let o,i;if($t(e.year))o=Zn.now();else{for(const l of lm)$t(e[l])&&(e[l]=SF[l]);const r=Mx(e)||Nx(e);if(r)return bt.invalid(r);const a=SK(n);[o,i]=rm(e,a,n)}return new bt({ts:o,zone:n,loc:s,o:i})}function RF(e,t,n){const s=$t(n.round)?!0:n.round,o=$t(n.rounding)?"trunc":n.rounding,i=(a,l)=>(a=ub(a,s||n.calendary?0:2,n.calendary?"round":o),t.loc.clone(n).relFormatter(n).format(a,l)),r=a=>n.calendary?t.hasSame(e,a)?0:t.startOf(a).diff(e.startOf(a),a).get(a):t.diff(e,a).get(a);if(n.unit)return i(r(n.unit),n.unit);for(const a of n.units){const l=r(a);if(Math.abs(l)>=1)return i(l,a)}return i(e>t?-0:0,n.units[n.units.length-1])}function DF(e){let t={},n;return e.length>0&&typeof e[e.length-1]=="object"?(t=e[e.length-1],n=Array.from(e).slice(0,e.length-1)):n=Array.from(e),[t,n]}let Uh;const wb=new Map;class bt{constructor(t){const n=t.zone||Zn.defaultZone;let s=t.invalid||(Number.isNaN(t.ts)?new Fi("invalid input"):null)||(n.isValid?null:Gh(n));this.ts=$t(t.ts)?Zn.now():t.ts;let o=null,i=null;if(!s)if(t.old&&t.old.ts===this.ts&&t.old.zone.equals(n))[o,i]=[t.old.c,t.old.o];else{const a=Va(t.o)&&!t.old?t.o:n.offset(this.ts);o=im(this.ts,a),s=Number.isNaN(o.year)?new Fi("invalid input"):null,o=s?null:o,i=s?null:a}this._zone=n,this.loc=t.loc||bn.create(),this.invalid=s,this.weekData=null,this.localWeekData=null,this.c=o,this.o=i,this.isLuxonDateTime=!0}static now(){return new bt({})}static local(){const[t,n]=DF(arguments),[s,o,i,r,a,l,u]=n;return _F({year:s,month:o,day:i,hour:r,minute:a,second:l,millisecond:u},t)}static utc(){const[t,n]=DF(arguments),[s,o,i,r,a,l,u]=n;return t.zone=ir.utcInstance,_F({year:s,month:o,day:i,hour:r,minute:a,second:l,millisecond:u},t)}static fromJSDate(t,n={}){const s=t7(t)?t.valueOf():NaN;if(Number.isNaN(s))return bt.invalid("invalid input");const o=La(n.zone,Zn.defaultZone);return o.isValid?new bt({ts:s,zone:o,loc:bn.fromObject(n)}):bt.invalid(Gh(o))}static fromMillis(t,n={}){if(Va(t))return t<-yF||t>yF?bt.invalid("Timestamp out of range"):new bt({ts:t,zone:La(n.zone,Zn.defaultZone),loc:bn.fromObject(n)});throw new Bs(`fromMillis requires a numerical input, but received a ${typeof t} with value ${t}`)}static fromSeconds(t,n={}){if(Va(t))return new bt({ts:t*1e3,zone:La(n.zone,Zn.defaultZone),loc:bn.fromObject(n)});throw new Bs("fromSeconds requires a numerical input")}static fromObject(t,n={}){t=t||{};const s=La(n.zone,Zn.defaultZone);if(!s.isValid)return bt.invalid(Gh(s));const o=bn.fromObject(n),i=nm(t,EF),{minDaysInFirstWeek:r,startOfWeek:a}=Ox(i,o),l=Zn.now(),u=$t(n.specificOffset)?s.offset(l):n.specificOffset,c=!$t(i.ordinal),d=!$t(i.year),h=!$t(i.month)||!$t(i.day),f=d||h,p=i.weekYear||i.weekNumber;if((f||c)&&p)throw new cc("Can't mix weekYear/weekNumber units with year/month/day or ordinals");if(h&&c)throw new cc("Can't mix ordinal dates with month/day");const g=p||i.weekday&&!f;let v,C,S=im(l,u);g?(v=CK,C=yK,S=Xg(S,r,a)):c?(v=bK,C=wK,S=rb(S)):(v=lm,C=SF);let b=!1;for(const P of v){const D=i[P];$t(D)?b?i[P]=C[P]:i[P]=S[P]:b=!0}const w=g?Jj(i,r,a):c?Qj(i):Mx(i),_=w||Nx(i);if(_)return bt.invalid(_);const R=g?Ax(i,r,a):c?kx(i):i,[T,I]=rm(R,u,s),x=new bt({ts:T,zone:s,o:I,loc:o});return i.weekday&&f&&t.weekday!==x.weekday?bt.invalid("mismatched weekday",`you can't specify both a weekday of ${i.weekday} and a date of ${x.toISO()}`):x.isValid?x:bt.invalid(x.invalid)}static fromISO(t,n={}){const[s,o]=W7(t);return Sc(s,o,n,"ISO 8601",t)}static fromRFC2822(t,n={}){const[s,o]=z7(t);return Sc(s,o,n,"RFC 2822",t)}static fromHTTP(t,n={}){const[s,o]=j7(t);return Sc(s,o,n,"HTTP",n)}static fromFormat(t,n,s={}){if($t(t)||$t(n))throw new Bs("fromFormat requires an input string and a format");const{locale:o=null,numberingSystem:i=null}=s,r=bn.fromOpts({locale:o,numberingSystem:i,defaultToEN:!0}),[a,l,u,c]=vK(r,t,n);return c?bt.invalid(c):Sc(a,l,s,`format ${n}`,t,u)}static fromString(t,n,s={}){return bt.fromFormat(t,n,s)}static fromSQL(t,n={}){const[s,o]=Q7(t);return Sc(s,o,n,"SQL",t)}static invalid(t,n=null){if(!t)throw new Bs("need to specify a reason the DateTime is invalid");const s=t instanceof Fi?t:new Fi(t,n);if(Zn.throwOnInvalid)throw new Dj(s);return new bt({invalid:s})}static isDateTime(t){return t&&t.isLuxonDateTime||!1}static parseFormatForOpts(t,n={}){const s=vF(t,bn.fromObject(n));return s?s.map(o=>o?o.val:null).join(""):null}static expandFormat(t,n={}){return pF($s.parseFormat(t),bn.fromObject(n)).map(o=>o.val).join("")}static resetCache(){Uh=void 0,wb.clear()}get(t){return this[t]}get isValid(){return this.invalid===null}get invalidReason(){return this.invalid?this.invalid.reason:null}get invalidExplanation(){return this.invalid?this.invalid.explanation:null}get locale(){return this.isValid?this.loc.locale:null}get numberingSystem(){return this.isValid?this.loc.numberingSystem:null}get outputCalendar(){return this.isValid?this.loc.outputCalendar:null}get zone(){return this._zone}get zoneName(){return this.isValid?this.zone.name:null}get year(){return this.isValid?this.c.year:NaN}get quarter(){return this.isValid?Math.ceil(this.c.month/3):NaN}get month(){return this.isValid?this.c.month:NaN}get day(){return this.isValid?this.c.day:NaN}get hour(){return this.isValid?this.c.hour:NaN}get minute(){return this.isValid?this.c.minute:NaN}get second(){return this.isValid?this.c.second:NaN}get millisecond(){return this.isValid?this.c.millisecond:NaN}get weekYear(){return this.isValid?mb(this).weekYear:NaN}get weekNumber(){return this.isValid?mb(this).weekNumber:NaN}get weekday(){return this.isValid?mb(this).weekday:NaN}get isWeekend(){return this.isValid&&this.loc.getWeekendDays().includes(this.weekday)}get localWeekday(){return this.isValid?vb(this).weekday:NaN}get localWeekNumber(){return this.isValid?vb(this).weekNumber:NaN}get localWeekYear(){return this.isValid?vb(this).weekYear:NaN}get ordinal(){return this.isValid?rb(this.c).ordinal:NaN}get monthShort(){return this.isValid?bc.months("short",{locObj:this.loc})[this.month-1]:null}get monthLong(){return this.isValid?bc.months("long",{locObj:this.loc})[this.month-1]:null}get weekdayShort(){return this.isValid?bc.weekdays("short",{locObj:this.loc})[this.weekday-1]:null}get weekdayLong(){return this.isValid?bc.weekdays("long",{locObj:this.loc})[this.weekday-1]:null}get offset(){return this.isValid?+this.o:NaN}get offsetNameShort(){return this.isValid?this.zone.offsetName(this.ts,{format:"short",locale:this.locale}):null}get offsetNameLong(){return this.isValid?this.zone.offsetName(this.ts,{format:"long",locale:this.locale}):null}get isOffsetFixed(){return this.isValid?this.zone.isUniversal:null}get isInDST(){return this.isOffsetFixed?!1:this.offset>this.set({month:1,day:1}).offset||this.offset>this.set({month:5}).offset}getPossibleOffsets(){if(!this.isValid||this.isOffsetFixed)return[this];const t=864e5,n=6e4,s=em(this.c),o=this.zone.offset(s-t),i=this.zone.offset(s+t),r=this.zone.offset(s-o*n),a=this.zone.offset(s-i*n);if(r===a)return[this];const l=s-r*n,u=s-a*n,c=im(l,r),d=im(u,a);return c.hour===d.hour&&c.minute===d.minute&&c.second===d.second&&c.millisecond===d.millisecond?[Kl(this,{ts:l}),Kl(this,{ts:u})]:[this]}get isInLeapYear(){return Lh(this.year)}get daysInMonth(){return Qg(this.year,this.month)}get daysInYear(){return this.isValid?fc(this.year):NaN}get weeksInWeekYear(){return this.isValid?Vh(this.weekYear):NaN}get weeksInLocalWeekYear(){return this.isValid?Vh(this.localWeekYear,this.loc.getMinDaysInFirstWeek(),this.loc.getStartOfWeek()):NaN}resolvedLocaleOptions(t={}){const{locale:n,numberingSystem:s,calendar:o}=$s.create(this.loc.clone(t),t).resolvedOptions(this);return{locale:n,numberingSystem:s,outputCalendar:o}}toUTC(t=0,n={}){return this.setZone(ir.instance(t),n)}toLocal(){return this.setZone(Zn.defaultZone)}setZone(t,{keepLocalTime:n=!1,keepCalendarTime:s=!1}={}){if(t=La(t,Zn.defaultZone),t.equals(this.zone))return this;if(t.isValid){let o=this.ts;if(n||s){const i=t.offset(this.ts),r=this.toObject();[o]=rm(r,i,t)}return Kl(this,{ts:o,zone:t})}else return bt.invalid(Gh(t))}reconfigure({locale:t,numberingSystem:n,outputCalendar:s}={}){const o=this.loc.clone({locale:t,numberingSystem:n,outputCalendar:s});return Kl(this,{loc:o})}setLocale(t){return this.reconfigure({locale:t})}set(t){if(!this.isValid)return this;const n=nm(t,EF),{minDaysInFirstWeek:s,startOfWeek:o}=Ox(n,this.loc),i=!$t(n.weekYear)||!$t(n.weekNumber)||!$t(n.weekday),r=!$t(n.ordinal),a=!$t(n.year),l=!$t(n.month)||!$t(n.day),u=a||l,c=n.weekYear||n.weekNumber;if((u||r)&&c)throw new cc("Can't mix weekYear/weekNumber units with year/month/day or ordinals");if(l&&r)throw new cc("Can't mix ordinal dates with month/day");let d;i?d=Ax({...Xg(this.c,s,o),...n},s,o):$t(n.ordinal)?(d={...this.toObject(),...n},$t(n.day)&&(d.day=Math.min(Qg(d.year,d.month),d.day))):d=kx({...rb(this.c),...n});const[h,f]=rm(d,this.o,this.zone);return Kl(this,{ts:h,o:f})}plus(t){if(!this.isValid)return this;const n=hn.fromDurationLike(t);return Kl(this,CF(this,n))}minus(t){if(!this.isValid)return this;const n=hn.fromDurationLike(t).negate();return Kl(this,CF(this,n))}startOf(t,{useLocaleWeeks:n=!1}={}){if(!this.isValid)return this;const s={},o=hn.normalizeUnit(t);switch(o){case"years":s.month=1;case"quarters":case"months":s.day=1;case"weeks":case"days":s.hour=0;case"hours":s.minute=0;case"minutes":s.second=0;case"seconds":s.millisecond=0;break}if(o==="weeks")if(n){const i=this.loc.getStartOfWeek(),{weekday:r}=this;r<i&&(s.weekNumber=this.weekNumber-1),s.weekday=i}else s.weekday=1;if(o==="quarters"){const i=Math.ceil(this.month/3);s.month=(i-1)*3+1}return this.set(s)}endOf(t,n){return this.isValid?this.plus({[t]:1}).startOf(t,n).minus(1):this}toFormat(t,n={}){return this.isValid?$s.create(this.loc.redefaultToEN(n)).formatDateTimeFromString(this,t):gb}toLocaleString(t=qg,n={}){return this.isValid?$s.create(this.loc.clone(n),t).formatDateTime(this):gb}toLocaleParts(t={}){return this.isValid?$s.create(this.loc.clone(t),t).formatDateTimeParts(this):[]}toISO({format:t="extended",suppressSeconds:n=!1,suppressMilliseconds:s=!1,includeOffset:o=!0,extendedZone:i=!1,precision:r="milliseconds"}={}){if(!this.isValid)return null;r=um(r);const a=t==="extended";let l=yb(this,a,r);return lm.indexOf(r)>=3&&(l+="T"),l+=bF(this,a,n,s,o,i,r),l}toISODate({format:t="extended",precision:n="day"}={}){return this.isValid?yb(this,t==="extended",um(n)):null}toISOWeekDate(){return am(this,"kkkk-'W'WW-c")}toISOTime({suppressMilliseconds:t=!1,suppressSeconds:n=!1,includeOffset:s=!0,includePrefix:o=!1,extendedZone:i=!1,format:r="extended",precision:a="milliseconds"}={}){return this.isValid?(a=um(a),(o&&lm.indexOf(a)>=3?"T":"")+bF(this,r==="extended",n,t,s,i,a)):null}toRFC2822(){return am(this,"EEE, dd LLL yyyy HH:mm:ss ZZZ",!1)}toHTTP(){return am(this.toUTC(),"EEE, dd LLL yyyy HH:mm:ss 'GMT'")}toSQLDate(){return this.isValid?yb(this,!0):null}toSQLTime({includeOffset:t=!0,includeZone:n=!1,includeOffsetSpace:s=!0}={}){let o="HH:mm:ss.SSS";return(n||t)&&(s&&(o+=" "),n?o+="z":t&&(o+="ZZ")),am(this,o,!0)}toSQL(t={}){return this.isValid?`${this.toSQLDate()} ${this.toSQLTime(t)}`:null}toString(){return this.isValid?this.toISO():gb}[Symbol.for("nodejs.util.inspect.custom")](){return this.isValid?`DateTime { ts: ${this.toISO()}, zone: ${this.zone.name}, locale: ${this.locale} }`:`DateTime { Invalid, reason: ${this.invalidReason} }`}valueOf(){return this.toMillis()}toMillis(){return this.isValid?this.ts:NaN}toSeconds(){return this.isValid?this.ts/1e3:NaN}toUnixInteger(){return this.isValid?Math.floor(this.ts/1e3):NaN}toJSON(){return this.toISO()}toBSON(){return this.toJSDate()}toObject(t={}){if(!this.isValid)return{};const n={...this.c};return t.includeConfig&&(n.outputCalendar=this.outputCalendar,n.numberingSystem=this.loc.numberingSystem,n.locale=this.loc.locale),n}toJSDate(){return new Date(this.isValid?this.ts:NaN)}diff(t,n="milliseconds",s={}){if(!this.isValid||!t.isValid)return hn.invalid("created by diffing an invalid DateTime");const o={locale:this.locale,numberingSystem:this.numberingSystem,...s},i=n7(n).map(hn.normalizeUnit),r=t.valueOf()>this.valueOf(),a=r?this:t,l=r?t:this,u=iK(a,l,i,o);return r?u.negate():u}diffNow(t="milliseconds",n={}){return this.diff(bt.now(),t,n)}until(t){return this.isValid?Xn.fromDateTimes(this,t):this}hasSame(t,n,s){if(!this.isValid)return!1;const o=t.valueOf(),i=this.setZone(t.zone,{keepLocalTime:!0});return i.startOf(n,s)<=o&&o<=i.endOf(n,s)}equals(t){return this.isValid&&t.isValid&&this.valueOf()===t.valueOf()&&this.zone.equals(t.zone)&&this.loc.equals(t.loc)}toRelative(t={}){if(!this.isValid)return null;const n=t.base||bt.fromObject({},{zone:this.zone}),s=t.padding?this<n?-t.padding:t.padding:0;let o=["years","months","days","hours","minutes","seconds"],i=t.unit;return Array.isArray(t.unit)&&(o=t.unit,i=void 0),RF(n,this.plus(s),{...t,numeric:"always",units:o,unit:i})}toRelativeCalendar(t={}){return this.isValid?RF(t.base||bt.fromObject({},{zone:this.zone}),this,{...t,numeric:"auto",units:["years","months","days"],calendary:!0}):null}static min(...t){if(!t.every(bt.isDateTime))throw new Bs("min requires all arguments be DateTimes");return Bx(t,n=>n.valueOf(),Math.min)}static max(...t){if(!t.every(bt.isDateTime))throw new Bs("max requires all arguments be DateTimes");return Bx(t,n=>n.valueOf(),Math.max)}static fromFormatExplain(t,n,s={}){const{locale:o=null,numberingSystem:i=null}=s,r=bn.fromOpts({locale:o,numberingSystem:i,defaultToEN:!0});return mF(r,t,n)}static fromStringExplain(t,n,s={}){return bt.fromFormatExplain(t,n,s)}static buildFormatParser(t,n={}){const{locale:s=null,numberingSystem:o=null}=n,i=bn.fromOpts({locale:s,numberingSystem:o,defaultToEN:!0});return new gF(i,t)}static fromFormatParser(t,n,s={}){if($t(t)||$t(n))throw new Bs("fromFormatParser requires an input string and a format parser");const{locale:o=null,numberingSystem:i=null}=s,r=bn.fromOpts({locale:o,numberingSystem:i,defaultToEN:!0});if(!r.equals(n.locale))throw new Bs(`fromFormatParser called with a locale of ${r}, but the format parser was created for ${n.locale}`);const{result:a,zone:l,specificOffset:u,invalidReason:c}=n.explainFromTokens(t);return c?bt.invalid(c):Sc(a,l,s,`format ${n.format}`,t,u)}static get DATE_SHORT(){return qg}static get DATE_MED(){return XI}static get DATE_MED_WITH_WEEKDAY(){return xj}static get DATE_FULL(){return JI}static get DATE_HUGE(){return QI}static get TIME_SIMPLE(){return ex}static get TIME_WITH_SECONDS(){return tx}static get TIME_WITH_SHORT_OFFSET(){return nx}static get TIME_WITH_LONG_OFFSET(){return sx}static get TIME_24_SIMPLE(){return ox}static get TIME_24_WITH_SECONDS(){return ix}static get TIME_24_WITH_SHORT_OFFSET(){return rx}static get TIME_24_WITH_LONG_OFFSET(){return ax}static get DATETIME_SHORT(){return lx}static get DATETIME_SHORT_WITH_SECONDS(){return ux}static get DATETIME_MED(){return cx}static get DATETIME_MED_WITH_SECONDS(){return dx}static get DATETIME_MED_WITH_WEEKDAY(){return Fj}static get DATETIME_FULL(){return hx}static get DATETIME_FULL_WITH_SECONDS(){return fx}static get DATETIME_HUGE(){return px}static get DATETIME_HUGE_WITH_SECONDS(){return gx}}function Wh(e){if(bt.isDateTime(e))return e;if(e&&e.valueOf&&Va(e.valueOf()))return bt.fromJSDate(e);if(e&&typeof e=="object")return bt.fromObject(e);throw new Bs(`Unknown datetime argument: ${e}, of type ${typeof e}`)}const TF="account.last_prefered_timezone",rr=800;var Ht=(e=>(e[e.UNCHECK=0]="UNCHECK",e[e.INDETERMINATE=1]="INDETERMINATE",e[e.CHECKED=2]="CHECKED",e))(Ht||{});function zh(e){if(!e)return null;if(bt.isDateTime(e))return e;if(e instanceof Date){const t=bt.fromJSDate(e);return t.isValid?t:null}if(typeof e=="number"){const t=bt.fromMillis(e);return t.isValid?t:null}if(typeof e=="string"){let t=bt.fromISO(e);return t.isValid||(t=bt.fromRFC2822(e)),t.isValid?t:null}return null}function IF(e,t,n){const s=zh(e);if(!s)return"";const o=n?s.setZone(n):s;return o.isValid?o.toFormat(t):""}const cm=()=>Rj(TF)||"UTC",xF=e=>({id:e.id,name:(e==null?void 0:e.name)??e.display_name,initial:e.initial,profile_image:e.profile_image,color:{bgColor:e.color.bgColor,textColor:e.color.textColor}}),Ec=e=>e!=null&&e.length?e.map(xF):[],EK=e=>{if(!(e!=null&&e.length))return[];const t=new Set;return e.filter(n=>t.has(n.id)?!1:(t.add(n.id),!0))},FF=e=>{if(!e)return null;const t=new Date(e);return Number.isNaN(t.getTime())?null:t},_K=e=>Object.fromEntries(Object.entries(e).filter(([t,n])=>n!==void 0)),PF=(e,t)=>{var s,o,i;const n={id:e.id,name:e.name,assignees:void 0,status:e.template_flow_status,dateRange:[FF(e.start_date),FF(e.due_date)],isStarted:!!Number(e.is_started),isCompleted:!!Number(e.is_completed),lastUpdated:{tooltip:e!=null&&e.last_updated_by?e.last_updated_by:"",value:IF(e.updated_at,"MMM dd, yyyy | HH:mm",t)||""},completedOn:{tooltip:e.actual_due_date==null?"Pending":e.last_completed_by?e.last_completed_by:"",value:IF(e.actual_due_date,"MMM dd, yyyy | HH:mm",t)},isDeleted:!1,isProcessing:e!=null&&e.bulk_process?{state:e==null?void 0:e.bulk_process.state,message:(e==null?void 0:e.bulk_process.message)||""}:void 0,disabled:((s=e==null?void 0:e.bulk_process)==null?void 0:s.state)==0,isArchived:((o=e.property)==null?void 0:o.is_archived)===1||e.status==0,isLocked:((i=e.property)==null?void 0:i.is_locked)===1};return _K(n)},AF={headphone:["headphones","headset"],sofa:["couch"],couch:["sofa"],run:["running","runner"]},Cb=e=>e.toLowerCase().trim(),RK=e=>Cb(e).split(/\s+/).filter(Boolean),kF=e=>e.replace(/(ing|ed|s)$/i,"");function DK(e){const t=new Set;for(const n of e){const s=kF(n);if(t.add(s),t.add(n),AF[s])for(const o of AF[s])t.add(kF(o))}return Array.from(t)}function TK(e,t){const n=Cb(e),s=DK(RK(t));let o=0;for(const i of s)i&&(n.includes(i)&&(o+=i.length*2),n.startsWith(i)&&(o+=3));return o}function IK(e,t){const n=i=>i.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),s=t.split(/\s+/).filter(Boolean).map(n);if(!s.length)return e;const o=new RegExp(`(${s.join("|")})`,"ig");return e.replace(o,"<mark>$1</mark>")}const OF=e=>{if(e!==null){if(Number(e.metric_type.id)==1)return["none","not","range"].includes(e.restricted_type)?"number":"dropdown";if(Number(e.metric_type.id)==2)return e.format_type=="icon"?"rating":"dropdown";if(Number(e.metric_type.id)==3)return"formula"}},bb=e=>!isNaN(e)&&isFinite(e),dm=(e,t)=>{var i;const{restricted_type:n}=e,s=Math.floor(Number(t)),o=((i=e.restricted_value)==null?void 0:i.split(",").map(Number))||[];if(n=="none")return!0;if(e.restricted_type=="not")return bb(s)&&!o.includes(s);if(e.restricted_type=="range"){const[r,a]=o;return bb(Number(t))&&Number(t)>=Number(r)&&Number(t)<=Number(a)}else if(n=="exact")return bb(s)&&o.includes(s);return!1},xK=(e,t)=>{var i;const n=_n.getInstance().getItem("ws.terminology"),s=n?JSON.parse(n):null;return` ${((i=s==null?void 0:s.find(r=>r.code==="scene"))==null?void 0:i.name)||"Scene"} ${t}`.trim()};/*! js-cookie v3.0.5 | MIT */function hm(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var s in n)e[s]=n[s]}return e}var FK={read:function(e){return e[0]==='"'&&(e=e.slice(1,-1)),e.replace(/(%[\dA-F]{2})+/gi,decodeURIComponent)},write:function(e){return encodeURIComponent(e).replace(/%(2[346BF]|3[AC-F]|40|5[BDE]|60|7[BCD])/g,decodeURIComponent)}};function Sb(e,t){function n(o,i,r){if(!(typeof document>"u")){r=hm({},t,r),typeof r.expires=="number"&&(r.expires=new Date(Date.now()+r.expires*864e5)),r.expires&&(r.expires=r.expires.toUTCString()),o=encodeURIComponent(o).replace(/%(2[346B]|5E|60|7C)/g,decodeURIComponent).replace(/[()]/g,escape);var a="";for(var l in r)r[l]&&(a+="; "+l,r[l]!==!0&&(a+="="+r[l].split(";")[0]));return document.cookie=o+"="+e.write(i,o)+a}}function s(o){if(!(typeof document>"u"||arguments.length&&!o)){for(var i=document.cookie?document.cookie.split("; "):[],r={},a=0;a<i.length;a++){var l=i[a].split("="),u=l.slice(1).join("=");try{var c=decodeURIComponent(l[0]);if(r[c]=e.read(u,c),o===c)break}catch{}}return o?r[o]:r}}return Object.create({set:n,get:s,remove:function(o,i){n(o,"",hm({},i,{expires:-1}))},withAttributes:function(o){return Sb(this.converter,hm({},this.attributes,o))},withConverter:function(o){return Sb(hm({},this.converter,o),this.attributes)}},{attributes:{value:Object.freeze(t)},converter:{value:Object.freeze(e)}})}var MF=Sb(FK,{path:"/"});const fm=({date:e,timezone:t,format:n})=>{if(!e)return"";const s=typeof e=="string"?bt.fromISO(e,{zone:t}):e,o=bt.now().setZone(t||"local"),i=s.setZone(t||"local"),r=o.startOf("day"),l=i.startOf("day").diff(r,"days").days;let u="";if(l===0?u="Today":l===-1?u="Yesterday":l===1&&(u="Tomorrow"),u&&(n!=null&&n.includes("HH:mm"))){const c=i.toFormat("HH:mm");return`${u} at ${c}`}else if(u)return u;return i.toFormat(n)},Eb=()=>MF.get("account.last_prefered_timezone")||"UTC",pm=e=>`${bt.fromJSDate(e,{zone:"UTC"}).toFormat("yyyy-MM-dd'T'HH:mm:ss.SSS")}999Z`,gm=e=>({id:e.id,label:e.name,value:e.id,data:e,color:e.color||{bgColor:"#CCCCCC",textColor:"#FFFFFF"},selected:!1,hover:!1,type:"text",disabled:!1,clickable:!0,danger:!1}),mm=e=>{var P;const t=En("filterParams",null),n=B(((P=e.value)==null?void 0:P.map(D=>D.id))??[]),s=B([]),o=B(!1),i=Si(e,"workspaceId"),r=Si(e,"entityId"),a=Si(e,"id"),l=Si(e,"ids"),u=Si(e,"isSelectAll"),c=Si(e,"isBulkUpdate"),d=e.updateRowData,h=B([]),{apiServices:f}=ts(!!e.params,e),p=Y(()=>{var O,$;const D=new Set(((O=e.value)==null?void 0:O.map(q=>q.id))??[]),F=(($=e.value)==null?void 0:$.map(q=>({...gm(q),selected:!0})))??[],k=s.value.filter(q=>!D.has(q.id));return uc(F,k,"id")}),g=D=>{const F=p.value.find(k=>k.id===D);return F==null?void 0:F.data},v=()=>{var D;return c.value&&u.value?[]:(D=l.value)!=null&&D.length?l.value:[String(a.value)]},C=async(D,F,k)=>{if(o.value||!f.value)return!1;o.value=!0;try{const O=await D();if((O==null?void 0:O.message)!=="Done")throw new Error("API call failed");return F(),!0}catch(O){return console.error("API call error:",O),k==null||k(O),!1}finally{o.value=!1}},S=Y(()=>!!(c.value&&u.value)),b=async()=>await C(()=>f.value.unAssignAll({workspaceId:String(i.value),userIds:[],itemIds:S.value?void 0:v(),entityId:S.value?String(r.value):void 0,filterParams:t!=null&&t.value?t.value:void 0}),()=>{d==null||d({assignees:[],type:"removeAll"}),n.value=[]},()=>{var F;console.error("Failed to unassign all assignees"),(F=e.errorCallback)==null||F.call(e)}),w=async D=>await C(()=>f.value.replaceAssignee(R(D)),()=>{n.value=[D];const k=g(D);k&&(d==null||d({assignees:Ec([k]),type:"overwrite"}))},()=>{var k;(k=e.errorCallback)==null||k.call(e)}),_=async D=>await C(()=>f.value.addAssignee(R(D)),()=>{var O,$,q;n.value.push(D);const k=g(D);if(k){const J=(q=($=(O=e.params)==null?void 0:O.api)==null?void 0:$.getRowNode(String(e.id)))==null?void 0:q.data,ee=(J==null?void 0:J.assignees)||[],X=uc([...ee,...Ec([k])],"id");d==null||d({assignees:X,type:"add"})}},()=>{var k;(k=e.errorCallback)==null||k.call(e)}),R=D=>{const F={workspaceId:String(i.value),userIds:[D],filterParams:t!=null&&t.value?t.value:void 0};return S.value?(F.itemIds=void 0,F.entityId=String(r.value)):F.itemIds=v(),F},T=async D=>await C(()=>f.value.removeAssignee(R(D)),()=>{var $,q,J;const k=(J=(q=($=e.params)==null?void 0:$.api)==null?void 0:q.getRowNode(String(e.id)))==null?void 0:J.data;n.value=n.value.filter(ee=>ee!==D);const O=Ec(((k==null?void 0:k.assignees)||[]).filter(ee=>ee.id!==D));d==null||d({assignees:O,type:"remove"})},()=>{var k;(k=e.errorCallback)==null||k.call(e)});return{isSubmitting:o,options:h,unAssignAll:b,replaceAssignees:w,addAssignee:_,removeAssignee:T,handleSelect:D=>{const F=String(D.id);n.value.includes(F)?T(F):_(F)},openPeopleInsight:D=>{if(!D||!i.value)return;const F=Ao({type:"people_insight",config:{user_id:D,ws_code:i.value,baseDomain:_n.getInstance().getItem("BASE_URL")||""}}).url;window.open(F,"_blank")},assigneeList:s,mergedOptions:p,selectedUserIds:n}},PK={placement:"bottom-start",theme:"light",trigger:"click",interactive:!0,appendTo:()=>document.getElementById("item-table-layout-id")||document.body,showArrow:!0,showOnInit:!1,alwaysShow:!1,debug:!1,content:void 0};function AK(e){return e.value?"$el"in e.value?e.value.$el:e.value:null}function Fs(e={}){const t=B(!1),n={...PK,...e},s=B(null),o=B(null),i=B(null),r=B(!1);let a=null,l=null;const u=S=>{(S.key==="Escape"||S.key==="Esc")&&p()},c=()=>{a&&l&&(l.removeEventListener("click",a),a=null,l=null),i.value&&(i.value.destroy(),i.value=null,r.value=!1),document.removeEventListener("keydown",u)},d=S=>{const{showOnInit:b,alwaysShow:w,showArrow:_,debug:R,...T}=n;return{...T,content:S,theme:n.theme,trigger:w||n.toggleOnClick?"manual":n.trigger,placement:n.placement||"bottom-start",arrow:!1,offset:n.offset,interactive:n.interactive,appendTo:n.appendTo,animation:"fade",maxWidth:n.maxWidth||350,onShow:I=>{if(e.disabled)return!1;if(r.value=!0,document.addEventListener("keydown",u),e.onShow)return e.onShow(I)},onHide:I=>{if(t.value)return setTimeout(()=>{t.value=!1},200),!1;if(w)return!1;if(r.value=!1,document.removeEventListener("keydown",u),e.onHide)return e.onHide(I)},onClickOutside:n.onClickOutside?n.onClickOutside:(I,x)=>{const P=x.target.closest(".notification-center"),D=x.target.closest("#people-insight-container");if(P||D){t.value=!0;return}if(e.onClickOutside)return e.onClickOutside(I,x);w||I.hide()},popperOptions:n.popperOptions||{modifiers:[{name:"computeStyles",options:{gpuAcceleration:!1}},{name:"preventOverflow",options:{padding:8}}]},hideOnClick:n.hideOnClick!==void 0?n.hideOnClick:!1}},h=()=>{var w;c();const S=AK(s),b=o.value;if(!(!S||!b)){b.style.display==="none"&&(b.style.display="");try{const _=d(b),R=Pa(S,_);i.value=Array.isArray(R)?R[0]:R,n.toggleOnClick&&!n.alwaysShow&&(a=()=>g(),l=S,S.addEventListener("click",a)),(n.showOnInit||n.alwaysShow)&&((w=i.value)==null||w.show())}catch(_){console.error("[useTippyComposable] Failed to create Tippy instance:",_)}}},f=S=>{S&&C(S),i.value&&i.value.show()},p=()=>{n.alwaysShow||i.value&&i.value.hide()},g=()=>{r.value?p():f()},v=S=>{i.value&&i.value.setContent(S)},C=S=>{i.value&&i.value.setProps(S)};return nt([s,o],h,{flush:"post"}),vs(()=>{c()}),{instance:i,isVisible:r,show:f,hide:p,toggle:g,triggerRef:s,popupRef:o,destroyTippy:c,setContent:v,setProps:C}}const NF=(e,t,n)=>{const s=B("Copy"),o=()=>{setTimeout(()=>{s.value="Copy"},5e3)};return{copyToClipboard:async r=>{r.stopPropagation(),r.preventDefault(),r.stopImmediatePropagation();try{return await navigator.clipboard.writeText(e),s.value="Copied",t==null||t(),o(),!0}catch(a){return console.error("Failed to copy text to clipboard:",a),s.value="Copy failed",o(),!1}},tooltip:s}},kK=(e,t,n)=>{const s={truncate:"End date cleared because it was before start. Please pick an end date.",swap:"Dates auto-swapped because start was after end.",...e.messages},o=So({startDate:null,endDate:null,timezone:e.timezone||"UTC",format:e.format||"",isSelectingStart:!1,isSelectingEnd:!1,rangeFeedback:{status:"idle",action:null,message:""},cacheStartDate:null,cacheEndDate:null,isDirty:!1});eh(()=>{var P;((P=e.value)==null?void 0:P.length)===2&&(o.startDate=e.value[0],o.endDate=e.value[1]),o.cacheStartDate=o.startDate,o.cacheEndDate=o.endDate,o.isSelectingStart=!1,o.isSelectingEnd=!1,e.timezone&&(o.timezone=e.timezone)});const i=B(!1),r=B(!1),a=()=>{var q,J,ee,X,ve,te,N,V;const P=i.value||((J=(q=o.startDate)==null?void 0:q.getTime)==null?void 0:J.call(q))!==((X=(ee=o.cacheStartDate)==null?void 0:ee.getTime)==null?void 0:X.call(ee)),D=r.value||((te=(ve=o.endDate)==null?void 0:ve.getTime)==null?void 0:te.call(ve))!==((V=(N=o.cacheEndDate)==null?void 0:N.getTime)==null?void 0:V.call(N)),F=o.startDate===null,k=o.endDate===null;let O,$;P&&D&&F&&k?(O=!0,$=!0,t("clearAll")):P&&!D?(O=!0,F?t("clearStart"):t("update:start",o.startDate)):D&&!P?($=!0,k?t("clearDue"):t("update:end",o.endDate)):P&&D&&(O=!0,$=!0,t("update",[o.startDate,o.endDate])),!(!O&&!$)&&(O&&!$?t("confirmed",{start:o.startDate}):!O&&$?t("confirmed",{end:o.endDate}):t("confirmed",{start:o.startDate,end:o.endDate}),o.isDirty=P||D)},l=(P,D)=>{const F=bt.fromObject({year:P.year,month:P.month,day:P.day},{zone:o.timezone});return(D==="start"?F.startOf("day"):F.endOf("day")).toJSDate()},u=()=>{o.rangeFeedback.status="idle",o.rangeFeedback.action=null,o.rangeFeedback.message=""},c=P=>{e.enableRangeFeedback&&(o.rangeFeedback.status="corrected",o.rangeFeedback.action=P,o.rangeFeedback.message=P==="swap"?s.swap:s.truncate)},d=P=>{if(!(!o.startDate||!o.endDate)){if(o.startDate.getTime()<=o.endDate.getTime()){e.enableRangeFeedback&&u();return}if(P==="select-start"){const D={start:o.startDate,end:o.endDate};o.endDate=null,t("range:invalid",D),t("range:corrected",{start:o.startDate,end:o.endDate,action:"truncate"}),o.isSelectingEnd=!0,c("truncate")}else{const D={start:o.startDate,end:o.endDate},F=o.startDate;o.startDate=o.endDate,o.endDate=F,t("range:invalid",D),t("range:corrected",{start:o.startDate,end:o.endDate,action:"swap"}),c("swap")}}},h=B(!1),f=B(!1),p=(P,D=!0)=>{i.value=!0,h.value=!1,!(e.disabled||e.readOnly)&&(o.startDate=l(P,"start"),D?(o.isSelectingStart=!1,o.isSelectingEnd=!0):(o.isSelectingStart=!0,o.isSelectingEnd=!1),d("select-start"))},g=P=>{r.value=!0,f.value=!1,!(e.disabled||e.readOnly)&&(o.endDate=l(P,"end"),d("select-end"))},v=()=>{i.value=!0,!(e.disabled||e.readOnly)&&(o.startDate=null,u())},C=()=>{r.value=!0,!(e.disabled||e.readOnly)&&(o.endDate=null,u())},S=()=>{i.value=!0,r.value=!0,!(e.disabled||e.readOnly)&&(o.startDate=null,o.endDate=null,u(),w())},b=()=>{e.disabled||e.readOnly||o.isDirty||(o.cacheStartDate=o.startDate,o.cacheEndDate=o.endDate)},w=()=>{e.disabled||e.readOnly||(a(),o.cacheStartDate=o.startDate,o.cacheEndDate=o.endDate,o.isDirty=!1)},_=()=>{e.disabled||e.readOnly||(o.startDate=o.cacheStartDate,o.endDate=o.cacheEndDate,u(),o.isDirty=!1)},R=Y(()=>o.startDate?bt.fromJSDate(o.startDate,{zone:o.timezone}).toFormat(o.format):e.startPlaceholder),T=Y(()=>o.endDate?bt.fromJSDate(o.endDate,{zone:o.timezone}).toFormat(o.format):e.duePlaceholder),I=Y(()=>!o.startDate&&!e.disabled?e.startTooltip:!o.startDate&&(e.disabled||e.readOnly)?e.startPlaceholder:o.startDate?bt.fromJSDate(o.startDate,{zone:o.timezone}).toFormat("LLL dd, yyyy | HH:mm:ss"):e.startTooltip),x=Y(()=>!o.endDate&&!e.disabled?e.dueTooltip:!o.endDate&&(e.disabled||e.readOnly)?e.startPlaceholder:o.endDate?bt.fromJSDate(o.endDate,{zone:o.timezone}).toFormat("LLL dd, yyyy | HH:mm:ss"):e.dueTooltip);return{states:o,displayStartDate:R,displayEndDate:T,tooltipStartDate:I,tooltipEndDate:x,showMultipleDueDates:f,showMultipleStartDates:h,selectEndDate:g,selectStartDate:p,clearDue:C,clearStart:v,clearAll:S,beginInteraction:b,confirmSelection:w,cancelSelection:_}},LF="MMM dd",OK=e=>{const t=e.timezone,n=Y(()=>e.start?fm({date:zh(e.start),timezone:t,format:LF}):"No start"),s=Y(()=>e.end?fm({date:zh(e.end),timezone:t,format:LF}):"No due"),o=d=>{if(!d)return null;const h=bt.now().setZone(t).startOf("day"),f=bt.fromISO(d).setZone(t).startOf("day");if(!f.isValid)return console.warn("Invalid date:",d,f.invalidReason),null;const p=f.diff(h,"days").days;return p===0?"today":p===1?"tomorrow":p===-1?"yesterday":p<-1?"past":"future"},i=Y(()=>o(e.start)),r=Y(()=>o(e.end)),a=Y(()=>{if(n.value==="No start")return["empty"];const d=[];return i.value&&d.push(`start-${i.value}`),e.isStarted&&d.push("actual"),d}),l=Y(()=>{if(s.value==="No due")return["empty"];const d=[];return r.value&&d.push(`end-${r.value}`),e.isEnded&&d.push("actual"),d}),u=Y(()=>e.start?fm({date:zh(e.start),timezone:t,format:"MMM dd, yyyy | HH:mm"}):"No start"),c=Y(()=>e.end?fm({date:zh(e.end),timezone:t,format:"MMM dd, yyyy | HH:mm"}):"No due");return{startDate:n,endDate:s,startClasses:a,endClasses:l,fullStartDate:u,fullEndDate:c}},MK="UserCache",NK="user",LK=()=>{const e=B({}),{getCachedValue:t,setCachedValue:n}=Dh({dbName:MK,storeName:NK}),s=async u=>u?await t(u):null;return{getCachedUser:s,setCachedUser:async u=>{if(!(u!=null&&u.id)){console.warn("Cannot cache user without id:",u);return}await n(u.id,u),e.value[u.id]=!0},getCachedUsers:async u=>{if(!u||u.length===0)return[];const c=u.map(h=>s(h));return(await Promise.all(c)).filter(h=>h!==null)},setCachedUsers:async u=>{if(!u||u.length===0)return;const d=uc(u,"id").filter(h=>h.id&&!e.value[h.id]).map(async h=>{await n(h.id,h),e.value[h.id]=!0});await Promise.all(d)},isUserCached:u=>!!e.value[u],clearCacheTracking:()=>{e.value={}}}},VK={placement:"bottom-start",theme:"light",trigger:"manual",interactive:!0,appendTo:()=>document.getElementById("item-table-layout-id")||document.body,showArrow:!0,showOnInit:!1,alwaysShow:!1,debug:!1,content:void 0,useTrigger:!0,showOverlay:!1,overlayOpacity:.5,closeOnOverlayClick:!0,centered:!1};let jh=0,Oo=null;function BK(e){return Oo||(Oo=document.createElement("div"),Oo.className="popup-overlay",Oo.style.cssText=`
|
|
113
|
+
`+z:""),this.inner=z||null):typeof L=="object"&&(this.message="".concat(L.name," ").concat(L.message),this.inner=L):(this.message=N[y]||E,this.inner=null)}return g(A).from(re),m[y]=A,m},{});W.Syntax=SyntaxError,W.Type=TypeError,W.Range=RangeError;var fe=ze.reduce(function(m,y){return m[y+"Error"]=W[y],m},{}),oe=mi.reduce(function(m,y){return["Syntax","Type","Range"].indexOf(y)===-1&&(m[y+"Error"]=W[y]),m},{});function Ie(){}function G(m){return m}function Z(m,y){return m==null||m===G?y:function(E){return y(m(E))}}function de(m,y){return function(){m.apply(this,arguments),y.apply(this,arguments)}}function ke(m,y){return m===Ie?y:function(){var E=m.apply(this,arguments);E!==void 0&&(arguments[0]=E);var A=this.onsuccess,L=this.onerror;this.onsuccess=null,this.onerror=null;var z=y.apply(this,arguments);return A&&(this.onsuccess=this.onsuccess?de(A,this.onsuccess):A),L&&(this.onerror=this.onerror?de(L,this.onerror):L),z!==void 0?z:E}}function Pe(m,y){return m===Ie?y:function(){m.apply(this,arguments);var E=this.onsuccess,A=this.onerror;this.onsuccess=this.onerror=null,y.apply(this,arguments),E&&(this.onsuccess=this.onsuccess?de(E,this.onsuccess):E),A&&(this.onerror=this.onerror?de(A,this.onerror):A)}}function Le(m,y){return m===Ie?y:function(E){var A=m.apply(this,arguments);l(E,A);var L=this.onsuccess,z=this.onerror;return this.onsuccess=null,this.onerror=null,E=y.apply(this,arguments),L&&(this.onsuccess=this.onsuccess?de(L,this.onsuccess):L),z&&(this.onerror=this.onerror?de(z,this.onerror):z),A===void 0?E===void 0?void 0:E:l(A,E)}}function ye(m,y){return m===Ie?y:function(){return y.apply(this,arguments)!==!1&&m.apply(this,arguments)}}function M(m,y){return m===Ie?y:function(){var E=m.apply(this,arguments);if(E&&typeof E.then=="function"){for(var A=this,L=arguments.length,z=new Array(L);L--;)z[L]=arguments[L];return E.then(function(){return y.apply(A,z)})}return y.apply(this,arguments)}}oe.ModifyError=ie,oe.DexieError=V,oe.BulkError=pe;var H=typeof location<"u"&&/^(http|https):\/\/(localhost|127\.0\.0\.1)/.test(location.href);function le(m){H=m}var Ge={},we=100,wa=typeof Promise>"u"?[]:function(){var m=Promise.resolve();if(typeof crypto>"u"||!crypto.subtle)return[m,u(m),m];var y=crypto.subtle.digest("SHA-512",new Uint8Array([0]));return[y,u(y),m]}(),ze=wa[0],mi=wa[1],wa=wa[2],mi=mi&&mi.then,Ue=ze&&ze.constructor,Se=!!wa,Ve=function(m,y){yt.push([m,y]),At&&(queueMicrotask(Ir),At=!1)},pt=!0,At=!0,Ut=[],Jt=[],zt=G,Ne={id:"global",global:!0,ref:0,unhandleds:[],onunhandled:Ie,pgp:!1,env:{},finalize:Ie},je=Ne,yt=[],Ot=0,Wt=[];function st(m){if(typeof this!="object")throw new TypeError("Promises must be constructed via new");this._listeners=[],this._lib=!1;var y=this._PSD=je;if(typeof m!="function"){if(m!==Ge)throw new TypeError("Not a function");return this._state=arguments[1],this._value=arguments[2],void(this._state===!1&&pl(this,this._value))}this._state=null,this._value=null,++y.ref,function E(A,L){try{L(function(z){if(A._state===null){if(z===A)throw new TypeError("A promise cannot be resolved with itself.");var se=A._lib&&xr();z&&typeof z.then=="function"?E(A,function(ue,Ce){z instanceof st?z._then(ue,Ce):z.then(ue,Ce)}):(A._state=!0,A._value=z,wo(A)),se&&pi()}},pl.bind(null,A))}catch(z){pl(A,z)}}(this,m)}var ps={get:function(){var m=je,y=Od;function E(A,L){var z=this,se=!m.global&&(m!==je||y!==Od),ue=se&&!jt(),Ce=new st(function(_e,Te){va(z,new Ui(Pr(A,m,se,ue),Pr(L,m,se,ue),_e,Te,m))});return this._consoleTask&&(Ce._consoleTask=this._consoleTask),Ce}return E.prototype=Ge,E},set:function(m){p(this,"then",m&&m.prototype===Ge?ps:{get:function(){return m},set:ps.set})}};function Ui(m,y,E,A,L){this.onFulfilled=typeof m=="function"?m:null,this.onRejected=typeof y=="function"?y:null,this.resolve=E,this.reject=A,this.psd=L}function pl(m,y){var E,A;Jt.push(y),m._state===null&&(E=m._lib&&xr(),y=zt(y),m._state=!1,m._value=y,A=m,Ut.some(function(L){return L._value===A._value})||Ut.push(A),wo(m),E&&pi())}function wo(m){var y=m._listeners;m._listeners=[];for(var E=0,A=y.length;E<A;++E)va(m,y[E]);var L=m._PSD;--L.ref||L.finalize(),Ot===0&&(++Ot,Ve(function(){--Ot==0&&Fr()},[]))}function va(m,y){if(m._state!==null){var E=m._state?y.onFulfilled:y.onRejected;if(E===null)return(m._state?y.resolve:y.reject)(m._value);++y.psd.ref,++Ot,Ve(gl,[E,m,y])}else m._listeners.push(y)}function gl(m,y,E){try{var A,L=y._value;!y._state&&Jt.length&&(Jt=[]),A=H&&y._consoleTask?y._consoleTask.run(function(){return m(L)}):m(L),y._state||Jt.indexOf(L)!==-1||function(z){for(var se=Ut.length;se;)if(Ut[--se]._value===z._value)return Ut.splice(se,1)}(y),E.resolve(A)}catch(z){E.reject(z)}finally{--Ot==0&&Fr(),--E.psd.ref||E.psd.finalize()}}function Ir(){Co(Ne,function(){xr()&&pi()})}function xr(){var m=pt;return At=pt=!1,m}function pi(){var m,y,E;do for(;0<yt.length;)for(m=yt,yt=[],E=m.length,y=0;y<E;++y){var A=m[y];A[0].apply(null,A[1])}while(0<yt.length);At=pt=!0}function Fr(){var m=Ut;Ut=[],m.forEach(function(A){A._PSD.onunhandled.call(null,A._value,A)});for(var y=Wt.slice(0),E=y.length;E;)y[--E]()}function Au(m){return new st(Ge,!1,m)}function kn(m,y){var E=je;return function(){var A=xr(),L=je;try{return js(E,!0),m.apply(this,arguments)}catch(z){y&&y(z)}finally{js(L,!1),A&&pi()}}}h(st.prototype,{then:ps,_then:function(m,y){va(this,new Ui(null,null,m,y,je))},catch:function(m){if(arguments.length===1)return this.then(null,m);var y=m,E=arguments[1];return typeof y=="function"?this.then(null,function(A){return(A instanceof y?E:Au)(A)}):this.then(null,function(A){return(A&&A.name===y?E:Au)(A)})},finally:function(m){return this.then(function(y){return st.resolve(m()).then(function(){return y})},function(y){return st.resolve(m()).then(function(){return Au(y)})})},timeout:function(m,y){var E=this;return m<1/0?new st(function(A,L){var z=setTimeout(function(){return L(new W.Timeout(y))},m);E.then(A,L).finally(clearTimeout.bind(null,z))}):this}}),typeof Symbol<"u"&&Symbol.toStringTag&&p(st.prototype,Symbol.toStringTag,"Dexie.Promise"),Ne.env=ku(),h(st,{all:function(){var m=ve.apply(null,arguments).map(sn);return new st(function(y,E){m.length===0&&y([]);var A=m.length;m.forEach(function(L,z){return st.resolve(L).then(function(se){m[z]=se,--A||y(m)},E)})})},resolve:function(m){return m instanceof st?m:m&&typeof m.then=="function"?new st(function(y,E){m.then(y,E)}):new st(Ge,!0,m)},reject:Au,race:function(){var m=ve.apply(null,arguments).map(sn);return new st(function(y,E){m.map(function(A){return st.resolve(A).then(y,E)})})},PSD:{get:function(){return je},set:function(m){return je=m}},totalEchoes:{get:function(){return Od}},newPSD:Ae,usePSD:Co,scheduler:{get:function(){return Ve},set:function(m){Ve=m}},rejectionMapper:{get:function(){return zt},set:function(m){zt=m}},follow:function(m,y){return new st(function(E,A){return Ae(function(L,z){var se=je;se.unhandleds=[],se.onunhandled=z,se.finalize=de(function(){var ue,Ce=this;ue=function(){Ce.unhandleds.length===0?L():z(Ce.unhandleds[0])},Wt.push(function _e(){ue(),Wt.splice(Wt.indexOf(_e),1)}),++Ot,Ve(function(){--Ot==0&&Fr()},[])},se.finalize),m()},y,E,A)})}}),Ue&&(Ue.allSettled&&p(st,"allSettled",function(){var m=ve.apply(null,arguments).map(sn);return new st(function(y){m.length===0&&y([]);var E=m.length,A=new Array(E);m.forEach(function(L,z){return st.resolve(L).then(function(se){return A[z]={status:"fulfilled",value:se}},function(se){return A[z]={status:"rejected",reason:se}}).then(function(){return--E||y(A)})})})}),Ue.any&&typeof AggregateError<"u"&&p(st,"any",function(){var m=ve.apply(null,arguments).map(sn);return new st(function(y,E){m.length===0&&E(new AggregateError([]));var A=m.length,L=new Array(A);m.forEach(function(z,se){return st.resolve(z).then(function(ue){return y(ue)},function(ue){L[se]=ue,--A||E(new AggregateError(L))})})})}),Ue.withResolvers&&(st.withResolvers=Ue.withResolvers));var gs={awaits:0,echoes:0,id:0},__=0,Ad=[],kd=0,Od=0,R_=0;function Ae(m,y,E,A){var L=je,z=Object.create(L);return z.parent=L,z.ref=0,z.global=!1,z.id=++R_,Ne.env,z.env=Se?{Promise:st,PromiseProp:{value:st,configurable:!0,writable:!0},all:st.all,race:st.race,allSettled:st.allSettled,any:st.any,resolve:st.resolve,reject:st.reject}:{},y&&l(z,y),++L.ref,z.finalize=function(){--this.parent.ref||this.parent.finalize()},A=Co(z,m,E,A),z.ref===0&&z.finalize(),A}function Ye(){return gs.id||(gs.id=++__),++gs.awaits,gs.echoes+=we,gs.id}function jt(){return!!gs.awaits&&(--gs.awaits==0&&(gs.id=0),gs.echoes=gs.awaits*we,!0)}function sn(m){return gs.echoes&&m&&m.constructor===Ue?(Ye(),m.then(function(y){return jt(),y},function(y){return jt(),Kn(y)})):m}function Wi(){var m=Ad[Ad.length-1];Ad.pop(),js(m,!1)}function js(m,y){var E,A=je;(y?!gs.echoes||kd++&&m===je:!kd||--kd&&m===je)||queueMicrotask(y?(function(L){++Od,gs.echoes&&--gs.echoes!=0||(gs.echoes=gs.awaits=gs.id=0),Ad.push(je),js(L,!0)}).bind(null,m):Wi),m!==je&&(je=m,A===Ne&&(Ne.env=ku()),Se&&(E=Ne.env.Promise,y=m.env,(A.global||m.global)&&(Object.defineProperty(i,"Promise",y.PromiseProp),E.all=y.all,E.race=y.race,E.resolve=y.resolve,E.reject=y.reject,y.allSettled&&(E.allSettled=y.allSettled),y.any&&(E.any=y.any))))}function ku(){var m=i.Promise;return Se?{Promise:m,PromiseProp:Object.getOwnPropertyDescriptor(i,"Promise"),all:m.all,race:m.race,allSettled:m.allSettled,any:m.any,resolve:m.resolve,reject:m.reject}:{}}function Co(m,y,E,A,L){var z=je;try{return js(m,!0),y(E,A,L)}finally{js(z,!1)}}function Pr(m,y,E,A){return typeof m!="function"?m:function(){var L=je;E&&Ye(),js(y,!0);try{return m.apply(this,arguments)}finally{js(L,!1),A&&queueMicrotask(jt)}}}function Fy(m){Promise===Ue&&gs.echoes===0?kd===0?m():enqueueNativeMicroTask(m):setTimeout(m,0)}(""+mi).indexOf("[native code]")===-1&&(Ye=jt=Ie);var Kn=st.reject,ya="",gi="Invalid key provided. Keys must be of type string, number, Date or Array<string | number | Date>.",Ou="String expected.",Md=[],Py="__dbnames",D_="readonly",T_="readwrite";function Mu(m,y){return m?y?function(){return m.apply(this,arguments)&&y.apply(this,arguments)}:m:y}var VB={type:3,lower:-1/0,lowerOpen:!1,upper:[[]],upperOpen:!1};function Ay(m){return typeof m!="string"||/\./.test(m)?function(y){return y}:function(y){return y[m]===void 0&&m in y&&delete(y=k(y))[m],y}}function BB(){throw W.Type()}function ln(m,y){try{var E=$B(m),A=$B(y);if(E!==A)return E==="Array"?1:A==="Array"?-1:E==="binary"?1:A==="binary"?-1:E==="string"?1:A==="string"?-1:E==="Date"?1:A!=="Date"?NaN:-1;switch(E){case"number":case"Date":case"string":return y<m?1:m<y?-1:0;case"binary":return function(L,z){for(var se=L.length,ue=z.length,Ce=se<ue?se:ue,_e=0;_e<Ce;++_e)if(L[_e]!==z[_e])return L[_e]<z[_e]?-1:1;return se===ue?0:se<ue?-1:1}(HB(m),HB(y));case"Array":return function(L,z){for(var se=L.length,ue=z.length,Ce=se<ue?se:ue,_e=0;_e<Ce;++_e){var Te=ln(L[_e],z[_e]);if(Te!==0)return Te}return se===ue?0:se<ue?-1:1}(m,y)}}catch{}return NaN}function $B(m){var y=typeof m;return y!="object"?y:ArrayBuffer.isView(m)?"binary":(m=$(m),m==="ArrayBuffer"?"binary":m)}function HB(m){return m instanceof Uint8Array?m:ArrayBuffer.isView(m)?new Uint8Array(m.buffer,m.byteOffset,m.byteLength):new Uint8Array(m)}var GB=($n.prototype._trans=function(m,y,E){var A=this._tx||je.trans,L=this.name,z=H&&typeof console<"u"&&console.createTask&&console.createTask("Dexie: ".concat(m==="readonly"?"read":"write"," ").concat(this.name));function se(_e,Te,he){if(!he.schema[L])throw new W.NotFound("Table "+L+" not part of transaction");return y(he.idbtrans,he)}var ue=xr();try{var Ce=A&&A.db._novip===this.db._novip?A===je.trans?A._promise(m,se,E):Ae(function(){return A._promise(m,se,E)},{trans:A,transless:je.transless||je}):function _e(Te,he,Fe,be){if(Te.idbdb&&(Te._state.openComplete||je.letThrough||Te._vip)){var De=Te._createTransaction(he,Fe,Te._dbSchema);try{De.create(),Te._state.PR1398_maxLoop=3}catch(xe){return xe.name===ae.InvalidState&&Te.isOpen()&&0<--Te._state.PR1398_maxLoop?(console.warn("Dexie: Need to reopen db"),Te.close({disableAutoOpen:!1}),Te.open().then(function(){return _e(Te,he,Fe,be)})):Kn(xe)}return De._promise(he,function(xe,Re){return Ae(function(){return je.trans=De,be(xe,Re,De)})}).then(function(xe){if(he==="readwrite")try{De.idbtrans.commit()}catch{}return he==="readonly"?xe:De._completion.then(function(){return xe})})}if(Te._state.openComplete)return Kn(new W.DatabaseClosed(Te._state.dbOpenError));if(!Te._state.isBeingOpened){if(!Te._state.autoOpen)return Kn(new W.DatabaseClosed);Te.open().catch(Ie)}return Te._state.dbReadyPromise.then(function(){return _e(Te,he,Fe,be)})}(this.db,m,[this.name],se);return z&&(Ce._consoleTask=z,Ce=Ce.catch(function(_e){return console.trace(_e),Kn(_e)})),Ce}finally{ue&&pi()}},$n.prototype.get=function(m,y){var E=this;return m&&m.constructor===Object?this.where(m).first(y):m==null?Kn(new W.Type("Invalid argument to Table.get()")):this._trans("readonly",function(A){return E.core.get({trans:A,key:m}).then(function(L){return E.hook.reading.fire(L)})}).then(y)},$n.prototype.where=function(m){if(typeof m=="string")return new this.db.WhereClause(this,m);if(a(m))return new this.db.WhereClause(this,"[".concat(m.join("+"),"]"));var y=r(m);if(y.length===1)return this.where(y[0]).equals(m[y[0]]);var E=this.schema.indexes.concat(this.schema.primKey).filter(function(ue){if(ue.compound&&y.every(function(_e){return 0<=ue.keyPath.indexOf(_e)})){for(var Ce=0;Ce<y.length;++Ce)if(y.indexOf(ue.keyPath[Ce])===-1)return!1;return!0}return!1}).sort(function(ue,Ce){return ue.keyPath.length-Ce.keyPath.length})[0];if(E&&this.db._maxKey!==ya){var z=E.keyPath.slice(0,y.length);return this.where(z).equals(z.map(function(Ce){return m[Ce]}))}!E&&H&&console.warn("The query ".concat(JSON.stringify(m)," on ").concat(this.name," would benefit from a ")+"compound index [".concat(y.join("+"),"]"));var A=this.schema.idxByName;function L(ue,Ce){return ln(ue,Ce)===0}var se=y.reduce(function(he,Ce){var _e=he[0],Te=he[1],he=A[Ce],Fe=m[Ce];return[_e||he,_e||!he?Mu(Te,he&&he.multi?function(be){return be=R(be,Ce),a(be)&&be.some(function(De){return L(Fe,De)})}:function(be){return L(Fe,R(be,Ce))}):Te]},[null,null]),z=se[0],se=se[1];return z?this.where(z.name).equals(m[z.keyPath]).filter(se):E?this.filter(se):this.where(y).equals("")},$n.prototype.filter=function(m){return this.toCollection().and(m)},$n.prototype.count=function(m){return this.toCollection().count(m)},$n.prototype.offset=function(m){return this.toCollection().offset(m)},$n.prototype.limit=function(m){return this.toCollection().limit(m)},$n.prototype.each=function(m){return this.toCollection().each(m)},$n.prototype.toArray=function(m){return this.toCollection().toArray(m)},$n.prototype.toCollection=function(){return new this.db.Collection(new this.db.WhereClause(this))},$n.prototype.orderBy=function(m){return new this.db.Collection(new this.db.WhereClause(this,a(m)?"[".concat(m.join("+"),"]"):m))},$n.prototype.reverse=function(){return this.toCollection().reverse()},$n.prototype.mapToClass=function(m){var y,E=this.db,A=this.name;function L(){return y!==null&&y.apply(this,arguments)||this}(this.schema.mappedClass=m).prototype instanceof BB&&(function(Ce,_e){if(typeof _e!="function"&&_e!==null)throw new TypeError("Class extends value "+String(_e)+" is not a constructor or null");function Te(){this.constructor=Ce}n(Ce,_e),Ce.prototype=_e===null?Object.create(_e):(Te.prototype=_e.prototype,new Te)}(L,y=m),Object.defineProperty(L.prototype,"db",{get:function(){return E},enumerable:!1,configurable:!0}),L.prototype.table=function(){return A},m=L);for(var z=new Set,se=m.prototype;se;se=u(se))Object.getOwnPropertyNames(se).forEach(function(Ce){return z.add(Ce)});function ue(Ce){if(!Ce)return Ce;var _e,Te=Object.create(m.prototype);for(_e in Ce)if(!z.has(_e))try{Te[_e]=Ce[_e]}catch{}return Te}return this.schema.readHook&&this.hook.reading.unsubscribe(this.schema.readHook),this.schema.readHook=ue,this.hook("reading",ue),m},$n.prototype.defineClass=function(){return this.mapToClass(function(m){l(this,m)})},$n.prototype.add=function(m,y){var E=this,A=this.schema.primKey,L=A.auto,z=A.keyPath,se=m;return z&&L&&(se=Ay(z)(m)),this._trans("readwrite",function(ue){return E.core.mutate({trans:ue,type:"add",keys:y!=null?[y]:null,values:[se]})}).then(function(ue){return ue.numFailures?st.reject(ue.failures[0]):ue.lastResult}).then(function(ue){if(z)try{T(m,z,ue)}catch{}return ue})},$n.prototype.update=function(m,y){return typeof m!="object"||a(m)?this.where(":id").equals(m).modify(y):(m=R(m,this.schema.primKey.keyPath),m===void 0?Kn(new W.InvalidArgument("Given object does not contain its primary key")):this.where(":id").equals(m).modify(y))},$n.prototype.put=function(m,y){var E=this,A=this.schema.primKey,L=A.auto,z=A.keyPath,se=m;return z&&L&&(se=Ay(z)(m)),this._trans("readwrite",function(ue){return E.core.mutate({trans:ue,type:"put",values:[se],keys:y!=null?[y]:null})}).then(function(ue){return ue.numFailures?st.reject(ue.failures[0]):ue.lastResult}).then(function(ue){if(z)try{T(m,z,ue)}catch{}return ue})},$n.prototype.delete=function(m){var y=this;return this._trans("readwrite",function(E){return y.core.mutate({trans:E,type:"delete",keys:[m]})}).then(function(E){return E.numFailures?st.reject(E.failures[0]):void 0})},$n.prototype.clear=function(){var m=this;return this._trans("readwrite",function(y){return m.core.mutate({trans:y,type:"deleteRange",range:VB})}).then(function(y){return y.numFailures?st.reject(y.failures[0]):void 0})},$n.prototype.bulkGet=function(m){var y=this;return this._trans("readonly",function(E){return y.core.getMany({keys:m,trans:E}).then(function(A){return A.map(function(L){return y.hook.reading.fire(L)})})})},$n.prototype.bulkAdd=function(m,y,E){var A=this,L=Array.isArray(y)?y:void 0,z=(E=E||(L?void 0:y))?E.allKeys:void 0;return this._trans("readwrite",function(se){var _e=A.schema.primKey,ue=_e.auto,_e=_e.keyPath;if(_e&&L)throw new W.InvalidArgument("bulkAdd(): keys argument invalid on tables with inbound keys");if(L&&L.length!==m.length)throw new W.InvalidArgument("Arguments objects and keys must have the same length");var Ce=m.length,_e=_e&&ue?m.map(Ay(_e)):m;return A.core.mutate({trans:se,type:"add",keys:L,values:_e,wantResults:z}).then(function(De){var he=De.numFailures,Fe=De.results,be=De.lastResult,De=De.failures;if(he===0)return z?Fe:be;throw new pe("".concat(A.name,".bulkAdd(): ").concat(he," of ").concat(Ce," operations failed"),De)})})},$n.prototype.bulkPut=function(m,y,E){var A=this,L=Array.isArray(y)?y:void 0,z=(E=E||(L?void 0:y))?E.allKeys:void 0;return this._trans("readwrite",function(se){var _e=A.schema.primKey,ue=_e.auto,_e=_e.keyPath;if(_e&&L)throw new W.InvalidArgument("bulkPut(): keys argument invalid on tables with inbound keys");if(L&&L.length!==m.length)throw new W.InvalidArgument("Arguments objects and keys must have the same length");var Ce=m.length,_e=_e&&ue?m.map(Ay(_e)):m;return A.core.mutate({trans:se,type:"put",keys:L,values:_e,wantResults:z}).then(function(De){var he=De.numFailures,Fe=De.results,be=De.lastResult,De=De.failures;if(he===0)return z?Fe:be;throw new pe("".concat(A.name,".bulkPut(): ").concat(he," of ").concat(Ce," operations failed"),De)})})},$n.prototype.bulkUpdate=function(m){var y=this,E=this.core,A=m.map(function(se){return se.key}),L=m.map(function(se){return se.changes}),z=[];return this._trans("readwrite",function(se){return E.getMany({trans:se,keys:A,cache:"clone"}).then(function(ue){var Ce=[],_e=[];m.forEach(function(he,Fe){var be=he.key,De=he.changes,xe=ue[Fe];if(xe){for(var Re=0,Me=Object.keys(De);Re<Me.length;Re++){var $e=Me[Re],He=De[$e];if($e===y.schema.primKey.keyPath){if(ln(He,be)!==0)throw new W.Constraint("Cannot update primary key in bulkUpdate()")}else T(xe,$e,He)}z.push(Fe),Ce.push(be),_e.push(xe)}});var Te=Ce.length;return E.mutate({trans:se,type:"put",keys:Ce,values:_e,updates:{keys:A,changeSpecs:L}}).then(function(he){var Fe=he.numFailures,be=he.failures;if(Fe===0)return Te;for(var De=0,xe=Object.keys(be);De<xe.length;De++){var Re,Me=xe[De],$e=z[Number(Me)];$e!=null&&(Re=be[Me],delete be[Me],be[$e]=Re)}throw new pe("".concat(y.name,".bulkUpdate(): ").concat(Fe," of ").concat(Te," operations failed"),be)})})})},$n.prototype.bulkDelete=function(m){var y=this,E=m.length;return this._trans("readwrite",function(A){return y.core.mutate({trans:A,type:"delete",keys:m})}).then(function(se){var L=se.numFailures,z=se.lastResult,se=se.failures;if(L===0)return z;throw new pe("".concat(y.name,".bulkDelete(): ").concat(L," of ").concat(E," operations failed"),se)})},$n);function $n(){}function yp(m){function y(se,ue){if(ue){for(var Ce=arguments.length,_e=new Array(Ce-1);--Ce;)_e[Ce-1]=arguments[Ce];return E[se].subscribe.apply(null,_e),m}if(typeof se=="string")return E[se]}var E={};y.addEventType=z;for(var A=1,L=arguments.length;A<L;++A)z(arguments[A]);return y;function z(se,ue,Ce){if(typeof se!="object"){var _e;ue=ue||ye;var Te={subscribers:[],fire:Ce=Ce||Ie,subscribe:function(he){Te.subscribers.indexOf(he)===-1&&(Te.subscribers.push(he),Te.fire=ue(Te.fire,he))},unsubscribe:function(he){Te.subscribers=Te.subscribers.filter(function(Fe){return Fe!==he}),Te.fire=Te.subscribers.reduce(ue,Ce)}};return E[se]=y[se]=Te}r(_e=se).forEach(function(he){var Fe=_e[he];if(a(Fe))z(he,_e[he][0],_e[he][1]);else{if(Fe!=="asap")throw new W.InvalidArgument("Invalid event config");var be=z(he,G,function(){for(var De=arguments.length,xe=new Array(De);De--;)xe[De]=arguments[De];be.subscribers.forEach(function(Re){_(function(){Re.apply(null,xe)})})})}})}}function wp(m,y){return g(y).from({prototype:m}),y}function Nd(m,y){return!(m.filter||m.algorithm||m.or)&&(y?m.justLimit:!m.replayFilter)}function I_(m,y){m.filter=Mu(m.filter,y)}function x_(m,y,E){var A=m.replayFilter;m.replayFilter=A?function(){return Mu(A(),y())}:y,m.justLimit=E&&!A}function ky(m,y){if(m.isPrimKey)return y.primaryKey;var E=y.getIndexByKeyPath(m.index);if(!E)throw new W.Schema("KeyPath "+m.index+" on object store "+y.name+" is not indexed");return E}function UB(m,y,E){var A=ky(m,y.schema);return y.openCursor({trans:E,values:!m.keysOnly,reverse:m.dir==="prev",unique:!!m.unique,query:{index:A,range:m.range}})}function Oy(m,y,E,A){var L=m.replayFilter?Mu(m.filter,m.replayFilter()):m.filter;if(m.or){var z={},se=function(ue,Ce,_e){var Te,he;L&&!L(Ce,_e,function(Fe){return Ce.stop(Fe)},function(Fe){return Ce.fail(Fe)})||((he=""+(Te=Ce.primaryKey))=="[object ArrayBuffer]"&&(he=""+new Uint8Array(Te)),d(z,he)||(z[he]=!0,y(ue,Ce,_e)))};return Promise.all([m.or._iterate(se,E),WB(UB(m,A,E),m.algorithm,se,!m.keysOnly&&m.valueMapper)])}return WB(UB(m,A,E),Mu(m.algorithm,L),y,!m.keysOnly&&m.valueMapper)}function WB(m,y,E,A){var L=kn(A?function(z,se,ue){return E(A(z),se,ue)}:E);return m.then(function(z){if(z)return z.start(function(){var se=function(){return z.continue()};y&&!y(z,function(ue){return se=ue},function(ue){z.stop(ue),se=Ie},function(ue){z.fail(ue),se=Ie})||L(z.value,z,function(ue){return se=ue}),se()})})}var wa=Symbol(),Cp=(zB.prototype.execute=function(m){if(this.add!==void 0){var y=this.add;if(a(y))return o(o([],a(m)?m:[],!0),y).sort();if(typeof y=="number")return(Number(m)||0)+y;if(typeof y=="bigint")try{return BigInt(m)+y}catch{return BigInt(0)+y}throw new TypeError("Invalid term ".concat(y))}if(this.remove!==void 0){var E=this.remove;if(a(E))return a(m)?m.filter(function(A){return!E.includes(A)}).sort():[];if(typeof E=="number")return Number(m)-E;if(typeof E=="bigint")try{return BigInt(m)-E}catch{return BigInt(0)-E}throw new TypeError("Invalid subtrahend ".concat(E))}return y=(y=this.replacePrefix)===null||y===void 0?void 0:y[0],y&&typeof m=="string"&&m.startsWith(y)?this.replacePrefix[1]+m.substring(y.length):m},zB);function zB(m){Object.assign(this,m)}var sbe=(mn.prototype._read=function(m,y){var E=this._ctx;return E.error?E.table._trans(null,Kn.bind(null,E.error)):E.table._trans("readonly",m).then(y)},mn.prototype._write=function(m){var y=this._ctx;return y.error?y.table._trans(null,Kn.bind(null,y.error)):y.table._trans("readwrite",m,"locked")},mn.prototype._addAlgorithm=function(m){var y=this._ctx;y.algorithm=Mu(y.algorithm,m)},mn.prototype._iterate=function(m,y){return Oy(this._ctx,m,y,this._ctx.table.core)},mn.prototype.clone=function(m){var y=Object.create(this.constructor.prototype),E=Object.create(this._ctx);return m&&l(E,m),y._ctx=E,y},mn.prototype.raw=function(){return this._ctx.valueMapper=null,this},mn.prototype.each=function(m){var y=this._ctx;return this._read(function(E){return Oy(y,m,E,y.table.core)})},mn.prototype.count=function(m){var y=this;return this._read(function(E){var A=y._ctx,L=A.table.core;if(Nd(A,!0))return L.count({trans:E,query:{index:ky(A,L.schema),range:A.range}}).then(function(se){return Math.min(se,A.limit)});var z=0;return Oy(A,function(){return++z,!1},E,L).then(function(){return z})}).then(m)},mn.prototype.sortBy=function(m,y){var E=m.split(".").reverse(),A=E[0],L=E.length-1;function z(Ce,_e){return _e?z(Ce[E[_e]],_e-1):Ce[A]}var se=this._ctx.dir==="next"?1:-1;function ue(Ce,_e){return ln(z(Ce,L),z(_e,L))*se}return this.toArray(function(Ce){return Ce.sort(ue)}).then(y)},mn.prototype.toArray=function(m){var y=this;return this._read(function(E){var A=y._ctx;if(A.dir==="next"&&Nd(A,!0)&&0<A.limit){var L=A.valueMapper,z=ky(A,A.table.core.schema);return A.table.core.query({trans:E,limit:A.limit,values:!0,query:{index:z,range:A.range}}).then(function(ue){return ue=ue.result,L?ue.map(L):ue})}var se=[];return Oy(A,function(ue){return se.push(ue)},E,A.table.core).then(function(){return se})},m)},mn.prototype.offset=function(m){var y=this._ctx;return m<=0||(y.offset+=m,Nd(y)?x_(y,function(){var E=m;return function(A,L){return E===0||(E===1?--E:L(function(){A.advance(E),E=0}),!1)}}):x_(y,function(){var E=m;return function(){return--E<0}})),this},mn.prototype.limit=function(m){return this._ctx.limit=Math.min(this._ctx.limit,m),x_(this._ctx,function(){var y=m;return function(E,A,L){return--y<=0&&A(L),0<=y}},!0),this},mn.prototype.until=function(m,y){return I_(this._ctx,function(E,A,L){return!m(E.value)||(A(L),y)}),this},mn.prototype.first=function(m){return this.limit(1).toArray(function(y){return y[0]}).then(m)},mn.prototype.last=function(m){return this.reverse().first(m)},mn.prototype.filter=function(m){var y;return I_(this._ctx,function(E){return m(E.value)}),(y=this._ctx).isMatch=Mu(y.isMatch,m),this},mn.prototype.and=function(m){return this.filter(m)},mn.prototype.or=function(m){return new this.db.WhereClause(this._ctx.table,m,this)},mn.prototype.reverse=function(){return this._ctx.dir=this._ctx.dir==="prev"?"next":"prev",this._ondirectionchange&&this._ondirectionchange(this._ctx.dir),this},mn.prototype.desc=function(){return this.reverse()},mn.prototype.eachKey=function(m){var y=this._ctx;return y.keysOnly=!y.isMatch,this.each(function(E,A){m(A.key,A)})},mn.prototype.eachUniqueKey=function(m){return this._ctx.unique="unique",this.eachKey(m)},mn.prototype.eachPrimaryKey=function(m){var y=this._ctx;return y.keysOnly=!y.isMatch,this.each(function(E,A){m(A.primaryKey,A)})},mn.prototype.keys=function(m){var y=this._ctx;y.keysOnly=!y.isMatch;var E=[];return this.each(function(A,L){E.push(L.key)}).then(function(){return E}).then(m)},mn.prototype.primaryKeys=function(m){var y=this._ctx;if(y.dir==="next"&&Nd(y,!0)&&0<y.limit)return this._read(function(A){var L=ky(y,y.table.core.schema);return y.table.core.query({trans:A,values:!1,limit:y.limit,query:{index:L,range:y.range}})}).then(function(A){return A.result}).then(m);y.keysOnly=!y.isMatch;var E=[];return this.each(function(A,L){E.push(L.primaryKey)}).then(function(){return E}).then(m)},mn.prototype.uniqueKeys=function(m){return this._ctx.unique="unique",this.keys(m)},mn.prototype.firstKey=function(m){return this.limit(1).keys(function(y){return y[0]}).then(m)},mn.prototype.lastKey=function(m){return this.reverse().firstKey(m)},mn.prototype.distinct=function(){var m=this._ctx,m=m.index&&m.table.schema.idxByName[m.index];if(!m||!m.multi)return this;var y={};return I_(this._ctx,function(L){var A=L.primaryKey.toString(),L=d(y,A);return y[A]=!0,!L}),this},mn.prototype.modify=function(m){var y=this,E=this._ctx;return this._write(function(A){var L,z,se;se=typeof m=="function"?m:(L=r(m),z=L.length,function(Re){for(var Me=!1,$e=0;$e<z;++$e){var He=L[$e],Ze=m[He],ot=R(Re,He);Ze instanceof Cp?(T(Re,He,Ze.execute(ot)),Me=!0):ot!==Ze&&(T(Re,He,Ze),Me=!0)}return Me});var ue=E.table.core,he=ue.schema.primaryKey,Ce=he.outbound,_e=he.extractKey,Te=200,he=y.db._options.modifyChunkSize;he&&(Te=typeof he=="object"?he[ue.name]||he["*"]||200:he);function Fe(Re,He){var $e=He.failures,He=He.numFailures;De+=Re-He;for(var Ze=0,ot=r($e);Ze<ot.length;Ze++){var gt=ot[Ze];be.push($e[gt])}}var be=[],De=0,xe=[];return y.clone().primaryKeys().then(function(Re){function Me(He){var Ze=Math.min(Te,Re.length-He);return ue.getMany({trans:A,keys:Re.slice(He,He+Ze),cache:"immutable"}).then(function(ot){for(var gt=[],it=[],at=Ce?[]:null,St=[],ht=0;ht<Ze;++ht){var Rt=ot[ht],Zt={value:k(Rt),primKey:Re[He+ht]};se.call(Zt,Zt.value,Zt)!==!1&&(Zt.value==null?St.push(Re[He+ht]):Ce||ln(_e(Rt),_e(Zt.value))===0?(it.push(Zt.value),Ce&&at.push(Re[He+ht])):(St.push(Re[He+ht]),gt.push(Zt.value)))}return Promise.resolve(0<gt.length&&ue.mutate({trans:A,type:"add",values:gt}).then(function(on){for(var rn in on.failures)St.splice(parseInt(rn),1);Fe(gt.length,on)})).then(function(){return(0<it.length||$e&&typeof m=="object")&&ue.mutate({trans:A,type:"put",keys:at,values:it,criteria:$e,changeSpec:typeof m!="function"&&m,isAdditionalChunk:0<He}).then(function(on){return Fe(it.length,on)})}).then(function(){return(0<St.length||$e&&m===F_)&&ue.mutate({trans:A,type:"delete",keys:St,criteria:$e,isAdditionalChunk:0<He}).then(function(on){return Fe(St.length,on)})}).then(function(){return Re.length>He+Ze&&Me(He+Te)})})}var $e=Nd(E)&&E.limit===1/0&&(typeof m!="function"||m===F_)&&{index:E.index,range:E.range};return Me(0).then(function(){if(0<be.length)throw new ie("Error modifying one or more objects",be,De,xe);return Re.length})})})},mn.prototype.delete=function(){var m=this._ctx,y=m.range;return Nd(m)&&(m.isPrimKey||y.type===3)?this._write(function(E){var A=m.table.core.schema.primaryKey,L=y;return m.table.core.count({trans:E,query:{index:A,range:L}}).then(function(z){return m.table.core.mutate({trans:E,type:"deleteRange",range:L}).then(function(se){var ue=se.failures;if(se.lastResult,se.results,se=se.numFailures,se)throw new ie("Could not delete some values",Object.keys(ue).map(function(Ce){return ue[Ce]}),z-se);return z-se})})}):this.modify(F_)},mn);function mn(){}var F_=function(m,y){return y.value=null};function obe(m,y){return m<y?-1:m===y?0:1}function ibe(m,y){return y<m?-1:m===y?0:1}function Uo(m,y,E){return m=m instanceof KB?new m.Collection(m):m,m._ctx.error=new(E||TypeError)(y),m}function Ld(m){return new m.Collection(m,function(){return jB("")}).limit(0)}function My(m,y,E,A){var L,z,se,ue,Ce,_e,Te,he=E.length;if(!E.every(function(De){return typeof De=="string"}))return Uo(m,Ou);function Fe(De){L=De==="next"?function(Re){return Re.toUpperCase()}:function(Re){return Re.toLowerCase()},z=De==="next"?function(Re){return Re.toLowerCase()}:function(Re){return Re.toUpperCase()},se=De==="next"?obe:ibe;var xe=E.map(function(Re){return{lower:z(Re),upper:L(Re)}}).sort(function(Re,Me){return se(Re.lower,Me.lower)});ue=xe.map(function(Re){return Re.upper}),Ce=xe.map(function(Re){return Re.lower}),Te=(_e=De)==="next"?"":A}Fe("next"),m=new m.Collection(m,function(){return ml(ue[0],Ce[he-1]+A)}),m._ondirectionchange=function(De){Fe(De)};var be=0;return m._addAlgorithm(function(De,xe,Re){var Me=De.key;if(typeof Me!="string")return!1;var $e=z(Me);if(y($e,Ce,be))return!0;for(var He=null,Ze=be;Ze<he;++Ze){var ot=function(gt,it,at,St,ht,Rt){for(var Zt=Math.min(gt.length,St.length),on=-1,rn=0;rn<Zt;++rn){var Wo=it[rn];if(Wo!==St[rn])return ht(gt[rn],at[rn])<0?gt.substr(0,rn)+at[rn]+at.substr(rn+1):ht(gt[rn],St[rn])<0?gt.substr(0,rn)+St[rn]+at.substr(rn+1):0<=on?gt.substr(0,on)+it[on]+at.substr(on+1):null;ht(gt[rn],Wo)<0&&(on=rn)}return Zt<St.length&&Rt==="next"?gt+at.substr(gt.length):Zt<gt.length&&Rt==="prev"?gt.substr(0,at.length):on<0?null:gt.substr(0,on)+St[on]+at.substr(on+1)}(Me,$e,ue[Ze],Ce[Ze],se,_e);ot===null&&He===null?be=Ze+1:(He===null||0<se(He,ot))&&(He=ot)}return xe(He!==null?function(){De.continue(He+Te)}:Re),!1}),m}function ml(m,y,E,A){return{type:2,lower:m,upper:y,lowerOpen:E,upperOpen:A}}function jB(m){return{type:1,lower:m,upper:m}}var KB=(Object.defineProperty(Is.prototype,"Collection",{get:function(){return this._ctx.table.db.Collection},enumerable:!1,configurable:!0}),Is.prototype.between=function(m,y,E,A){E=E!==!1,A=A===!0;try{return 0<this._cmp(m,y)||this._cmp(m,y)===0&&(E||A)&&(!E||!A)?Ld(this):new this.Collection(this,function(){return ml(m,y,!E,!A)})}catch{return Uo(this,gi)}},Is.prototype.equals=function(m){return m==null?Uo(this,gi):new this.Collection(this,function(){return jB(m)})},Is.prototype.above=function(m){return m==null?Uo(this,gi):new this.Collection(this,function(){return ml(m,void 0,!0)})},Is.prototype.aboveOrEqual=function(m){return m==null?Uo(this,gi):new this.Collection(this,function(){return ml(m,void 0,!1)})},Is.prototype.below=function(m){return m==null?Uo(this,gi):new this.Collection(this,function(){return ml(void 0,m,!1,!0)})},Is.prototype.belowOrEqual=function(m){return m==null?Uo(this,gi):new this.Collection(this,function(){return ml(void 0,m)})},Is.prototype.startsWith=function(m){return typeof m!="string"?Uo(this,Ou):this.between(m,m+ya,!0,!0)},Is.prototype.startsWithIgnoreCase=function(m){return m===""?this.startsWith(m):My(this,function(y,E){return y.indexOf(E[0])===0},[m],ya)},Is.prototype.equalsIgnoreCase=function(m){return My(this,function(y,E){return y===E[0]},[m],"")},Is.prototype.anyOfIgnoreCase=function(){var m=ve.apply(X,arguments);return m.length===0?Ld(this):My(this,function(y,E){return E.indexOf(y)!==-1},m,"")},Is.prototype.startsWithAnyOfIgnoreCase=function(){var m=ve.apply(X,arguments);return m.length===0?Ld(this):My(this,function(y,E){return E.some(function(A){return y.indexOf(A)===0})},m,ya)},Is.prototype.anyOf=function(){var m=this,y=ve.apply(X,arguments),E=this._cmp;try{y.sort(E)}catch{return Uo(this,gi)}if(y.length===0)return Ld(this);var A=new this.Collection(this,function(){return ml(y[0],y[y.length-1])});A._ondirectionchange=function(z){E=z==="next"?m._ascending:m._descending,y.sort(E)};var L=0;return A._addAlgorithm(function(z,se,ue){for(var Ce=z.key;0<E(Ce,y[L]);)if(++L===y.length)return se(ue),!1;return E(Ce,y[L])===0||(se(function(){z.continue(y[L])}),!1)}),A},Is.prototype.notEqual=function(m){return this.inAnyRange([[-1/0,m],[m,this.db._maxKey]],{includeLowers:!1,includeUppers:!1})},Is.prototype.noneOf=function(){var m=ve.apply(X,arguments);if(m.length===0)return new this.Collection(this);try{m.sort(this._ascending)}catch{return Uo(this,gi)}var y=m.reduce(function(E,A){return E?E.concat([[E[E.length-1][1],A]]):[[-1/0,A]]},null);return y.push([m[m.length-1],this.db._maxKey]),this.inAnyRange(y,{includeLowers:!1,includeUppers:!1})},Is.prototype.inAnyRange=function(Me,y){var E=this,A=this._cmp,L=this._ascending,z=this._descending,se=this._min,ue=this._max;if(Me.length===0)return Ld(this);if(!Me.every(function($e){return $e[0]!==void 0&&$e[1]!==void 0&&L($e[0],$e[1])<=0}))return Uo(this,"First argument to inAnyRange() must be an Array of two-value Arrays [lower,upper] where upper must not be lower than lower",W.InvalidArgument);var Ce=!y||y.includeLowers!==!1,_e=y&&y.includeUppers===!0,Te,he=L;function Fe($e,He){return he($e[0],He[0])}try{(Te=Me.reduce(function($e,He){for(var Ze=0,ot=$e.length;Ze<ot;++Ze){var gt=$e[Ze];if(A(He[0],gt[1])<0&&0<A(He[1],gt[0])){gt[0]=se(gt[0],He[0]),gt[1]=ue(gt[1],He[1]);break}}return Ze===ot&&$e.push(He),$e},[])).sort(Fe)}catch{return Uo(this,gi)}var be=0,De=_e?function($e){return 0<L($e,Te[be][1])}:function($e){return 0<=L($e,Te[be][1])},xe=Ce?function($e){return 0<z($e,Te[be][0])}:function($e){return 0<=z($e,Te[be][0])},Re=De,Me=new this.Collection(this,function(){return ml(Te[0][0],Te[Te.length-1][1],!Ce,!_e)});return Me._ondirectionchange=function($e){he=$e==="next"?(Re=De,L):(Re=xe,z),Te.sort(Fe)},Me._addAlgorithm(function($e,He,Ze){for(var ot,gt=$e.key;Re(gt);)if(++be===Te.length)return He(Ze),!1;return!De(ot=gt)&&!xe(ot)||(E._cmp(gt,Te[be][1])===0||E._cmp(gt,Te[be][0])===0||He(function(){he===L?$e.continue(Te[be][0]):$e.continue(Te[be][1])}),!1)}),Me},Is.prototype.startsWithAnyOf=function(){var m=ve.apply(X,arguments);return m.every(function(y){return typeof y=="string"})?m.length===0?Ld(this):this.inAnyRange(m.map(function(y){return[y,y+ya]})):Uo(this,"startsWithAnyOf() only works with strings")},Is);function Is(){}function Ar(m){return kn(function(y){return bp(y),m(y.target.error),!1})}function bp(m){m.stopPropagation&&m.stopPropagation(),m.preventDefault&&m.preventDefault()}var Sp="storagemutated",P_="x-storagemutated-1",vl=yp(null,Sp),rbe=(kr.prototype._lock=function(){return w(!je.global),++this._reculock,this._reculock!==1||je.global||(je.lockOwnerFor=this),this},kr.prototype._unlock=function(){if(w(!je.global),--this._reculock==0)for(je.global||(je.lockOwnerFor=null);0<this._blockedFuncs.length&&!this._locked();){var m=this._blockedFuncs.shift();try{Co(m[1],m[0])}catch{}}return this},kr.prototype._locked=function(){return this._reculock&&je.lockOwnerFor!==this},kr.prototype.create=function(m){var y=this;if(!this.mode)return this;var E=this.db.idbdb,A=this.db._state.dbOpenError;if(w(!this.idbtrans),!m&&!E)switch(A&&A.name){case"DatabaseClosedError":throw new W.DatabaseClosed(A);case"MissingAPIError":throw new W.MissingAPI(A.message,A);default:throw new W.OpenFailed(A)}if(!this.active)throw new W.TransactionInactive;return w(this._completion._state===null),(m=this.idbtrans=m||(this.db.core||E).transaction(this.storeNames,this.mode,{durability:this.chromeTransactionDurability})).onerror=kn(function(L){bp(L),y._reject(m.error)}),m.onabort=kn(function(L){bp(L),y.active&&y._reject(new W.Abort(m.error)),y.active=!1,y.on("abort").fire(L)}),m.oncomplete=kn(function(){y.active=!1,y._resolve(),"mutatedParts"in m&&vl.storagemutated.fire(m.mutatedParts)}),this},kr.prototype._promise=function(m,y,E){var A=this;if(m==="readwrite"&&this.mode!=="readwrite")return Kn(new W.ReadOnly("Transaction is readonly"));if(!this.active)return Kn(new W.TransactionInactive);if(this._locked())return new st(function(z,se){A._blockedFuncs.push([function(){A._promise(m,y,E).then(z,se)},je])});if(E)return Ae(function(){var z=new st(function(se,ue){A._lock();var Ce=y(se,ue,A);Ce&&Ce.then&&Ce.then(se,ue)});return z.finally(function(){return A._unlock()}),z._lib=!0,z});var L=new st(function(z,se){var ue=y(z,se,A);ue&&ue.then&&ue.then(z,se)});return L._lib=!0,L},kr.prototype._root=function(){return this.parent?this.parent._root():this},kr.prototype.waitFor=function(m){var y,E=this._root(),A=st.resolve(m);E._waitingFor?E._waitingFor=E._waitingFor.then(function(){return A}):(E._waitingFor=A,E._waitingQueue=[],y=E.idbtrans.objectStore(E.storeNames[0]),function z(){for(++E._spinCount;E._waitingQueue.length;)E._waitingQueue.shift()();E._waitingFor&&(y.get(-1/0).onsuccess=z)}());var L=E._waitingFor;return new st(function(z,se){A.then(function(ue){return E._waitingQueue.push(kn(z.bind(null,ue)))},function(ue){return E._waitingQueue.push(kn(se.bind(null,ue)))}).finally(function(){E._waitingFor===L&&(E._waitingFor=null)})})},kr.prototype.abort=function(){this.active&&(this.active=!1,this.idbtrans&&this.idbtrans.abort(),this._reject(new W.Abort))},kr.prototype.table=function(m){var y=this._memoizedTables||(this._memoizedTables={});if(d(y,m))return y[m];var E=this.schema[m];if(!E)throw new W.NotFound("Table "+m+" not part of transaction");return E=new this.db.Table(m,E,this),E.core=this.db.core.table(m),y[m]=E},kr);function kr(){}function A_(m,y,E,A,L,z,se){return{name:m,keyPath:y,unique:E,multi:A,auto:L,compound:z,src:(E&&!se?"&":"")+(A?"*":"")+(L?"++":"")+qB(y)}}function qB(m){return typeof m=="string"?m:m?"["+[].join.call(m,"+")+"]":""}function k_(m,y,E){return{name:m,primKey:y,indexes:E,mappedClass:null,idxByName:(A=function(L){return[L.name,L]},E.reduce(function(L,z,se){return se=A(z,se),se&&(L[se[0]]=se[1]),L},{}))};var A}var Ep=function(m){try{return m.only([[]]),Ep=function(){return[[]]},[[]]}catch{return Ep=function(){return ya},ya}};function O_(m){return m==null?function(){}:typeof m=="string"?(y=m).split(".").length===1?function(E){return E[y]}:function(E){return R(E,y)}:function(E){return R(E,m)};var y}function YB(m){return[].slice.call(m)}var abe=0;function _p(m){return m==null?":id":typeof m=="string"?m:"[".concat(m.join("+"),"]")}function lbe(m,y,Ce){function A(Re){if(Re.type===3)return null;if(Re.type===4)throw new Error("Cannot convert never type to IDBKeyRange");var be=Re.lower,De=Re.upper,xe=Re.lowerOpen,Re=Re.upperOpen;return be===void 0?De===void 0?null:y.upperBound(De,!!Re):De===void 0?y.lowerBound(be,!!xe):y.bound(be,De,!!xe,!!Re)}function L(Fe){var be,De=Fe.name;return{name:De,schema:Fe,mutate:function(xe){var Re=xe.trans,Me=xe.type,$e=xe.keys,He=xe.values,Ze=xe.range;return new Promise(function(ot,gt){ot=kn(ot);var it=Re.objectStore(De),at=it.keyPath==null,St=Me==="put"||Me==="add";if(!St&&Me!=="delete"&&Me!=="deleteRange")throw new Error("Invalid operation type: "+Me);var ht,Rt=($e||He||{length:1}).length;if($e&&He&&$e.length!==He.length)throw new Error("Given keys array must have same length as given values array.");if(Rt===0)return ot({numFailures:0,failures:{},results:[],lastResult:void 0});function Zt(oo){++Wo,bp(oo)}var on=[],rn=[],Wo=0;if(Me==="deleteRange"){if(Ze.type===4)return ot({numFailures:Wo,failures:rn,results:[],lastResult:void 0});Ze.type===3?on.push(ht=it.clear()):on.push(ht=it.delete(A(Ze)))}else{var at=St?at?[He,$e]:[He,null]:[$e,null],Kt=at[0],qs=at[1];if(St)for(var Ys=0;Ys<Rt;++Ys)on.push(ht=qs&&qs[Ys]!==void 0?it[Me](Kt[Ys],qs[Ys]):it[Me](Kt[Ys])),ht.onerror=Zt;else for(Ys=0;Ys<Rt;++Ys)on.push(ht=it[Me](Kt[Ys])),ht.onerror=Zt}function qy(oo){oo=oo.target.result,on.forEach(function(Vu,J_){return Vu.error!=null&&(rn[J_]=Vu.error)}),ot({numFailures:Wo,failures:rn,results:Me==="delete"?$e:on.map(function(Vu){return Vu.result}),lastResult:oo})}ht.onerror=function(oo){Zt(oo),qy(oo)},ht.onsuccess=qy})},getMany:function(xe){var Re=xe.trans,Me=xe.keys;return new Promise(function($e,He){$e=kn($e);for(var Ze,ot=Re.objectStore(De),gt=Me.length,it=new Array(gt),at=0,St=0,ht=function(on){on=on.target,it[on._pos]=on.result,++St===at&&$e(it)},Rt=Ar(He),Zt=0;Zt<gt;++Zt)Me[Zt]!=null&&((Ze=ot.get(Me[Zt]))._pos=Zt,Ze.onsuccess=ht,Ze.onerror=Rt,++at);at===0&&$e(it)})},get:function(xe){var Re=xe.trans,Me=xe.key;return new Promise(function($e,He){$e=kn($e);var Ze=Re.objectStore(De).get(Me);Ze.onsuccess=function(ot){return $e(ot.target.result)},Ze.onerror=Ar(He)})},query:(be=_e,function(xe){return new Promise(function(Re,Me){Re=kn(Re);var $e,He,Ze,at=xe.trans,ot=xe.values,gt=xe.limit,ht=xe.query,it=gt===1/0?void 0:gt,St=ht.index,ht=ht.range,at=at.objectStore(De),St=St.isPrimaryKey?at:at.index(St.name),ht=A(ht);if(gt===0)return Re({result:[]});be?((it=ot?St.getAll(ht,it):St.getAllKeys(ht,it)).onsuccess=function(Rt){return Re({result:Rt.target.result})},it.onerror=Ar(Me)):($e=0,He=!ot&&"openKeyCursor"in St?St.openKeyCursor(ht):St.openCursor(ht),Ze=[],He.onsuccess=function(Rt){var Zt=He.result;return Zt?(Ze.push(ot?Zt.value:Zt.primaryKey),++$e===gt?Re({result:Ze}):void Zt.continue()):Re({result:Ze})},He.onerror=Ar(Me))})}),openCursor:function(xe){var Re=xe.trans,Me=xe.values,$e=xe.query,He=xe.reverse,Ze=xe.unique;return new Promise(function(ot,gt){ot=kn(ot);var St=$e.index,it=$e.range,at=Re.objectStore(De),at=St.isPrimaryKey?at:at.index(St.name),St=He?Ze?"prevunique":"prev":Ze?"nextunique":"next",ht=!Me&&"openKeyCursor"in at?at.openKeyCursor(A(it),St):at.openCursor(A(it),St);ht.onerror=Ar(gt),ht.onsuccess=kn(function(Rt){var Zt,on,rn,Wo,Kt=ht.result;Kt?(Kt.___id=++abe,Kt.done=!1,Zt=Kt.continue.bind(Kt),on=(on=Kt.continuePrimaryKey)&&on.bind(Kt),rn=Kt.advance.bind(Kt),Wo=function(){throw new Error("Cursor not stopped")},Kt.trans=Re,Kt.stop=Kt.continue=Kt.continuePrimaryKey=Kt.advance=function(){throw new Error("Cursor not started")},Kt.fail=kn(gt),Kt.next=function(){var qs=this,Ys=1;return this.start(function(){return Ys--?qs.continue():qs.stop()}).then(function(){return qs})},Kt.start=function(qs){function Ys(){if(ht.result)try{qs()}catch(oo){Kt.fail(oo)}else Kt.done=!0,Kt.start=function(){throw new Error("Cursor behind last entry")},Kt.stop()}var qy=new Promise(function(oo,Vu){oo=kn(oo),ht.onerror=Ar(Vu),Kt.fail=Vu,Kt.stop=function(J_){Kt.stop=Kt.continue=Kt.continuePrimaryKey=Kt.advance=Wo,oo(J_)}});return ht.onsuccess=kn(function(oo){ht.onsuccess=Ys,Ys()}),Kt.continue=Zt,Kt.continuePrimaryKey=on,Kt.advance=rn,Ys(),qy},ot(Kt)):ot(null)},gt)})},count:function(xe){var Re=xe.query,Me=xe.trans,$e=Re.index,He=Re.range;return new Promise(function(Ze,ot){var gt=Me.objectStore(De),it=$e.isPrimaryKey?gt:gt.index($e.name),gt=A(He),it=gt?it.count(gt):it.count();it.onsuccess=kn(function(at){return Ze(at.target.result)}),it.onerror=Ar(ot)})}}}var z,se,ue,Te=(se=Ce,ue=YB((z=m).objectStoreNames),{schema:{name:z.name,tables:ue.map(function(Fe){return se.objectStore(Fe)}).map(function(Fe){var be=Fe.keyPath,Re=Fe.autoIncrement,De=a(be),xe={},Re={name:Fe.name,primaryKey:{name:null,isPrimaryKey:!0,outbound:be==null,compound:De,keyPath:be,autoIncrement:Re,unique:!0,extractKey:O_(be)},indexes:YB(Fe.indexNames).map(function(Me){return Fe.index(Me)}).map(function(Ze){var $e=Ze.name,He=Ze.unique,ot=Ze.multiEntry,Ze=Ze.keyPath,ot={name:$e,compound:a(Ze),keyPath:Ze,unique:He,multiEntry:ot,extractKey:O_(Ze)};return xe[_p(Ze)]=ot}),getIndexByKeyPath:function(Me){return xe[_p(Me)]}};return xe[":id"]=Re.primaryKey,be!=null&&(xe[_p(be)]=Re.primaryKey),Re})},hasGetAll:0<ue.length&&"getAll"in se.objectStore(ue[0])&&!(typeof navigator<"u"&&/Safari/.test(navigator.userAgent)&&!/(Chrome\/|Edge\/)/.test(navigator.userAgent)&&[].concat(navigator.userAgent.match(/Safari\/(\d*)/))[1]<604)}),Ce=Te.schema,_e=Te.hasGetAll,Te=Ce.tables.map(L),he={};return Te.forEach(function(Fe){return he[Fe.name]=Fe}),{stack:"dbcore",transaction:m.transaction.bind(m),table:function(Fe){if(!he[Fe])throw new Error("Table '".concat(Fe,"' not found"));return he[Fe]},MIN_KEY:-1/0,MAX_KEY:Ep(y),schema:Ce}}function ube(m,y,E,A){var L=E.IDBKeyRange;return E.indexedDB,{dbcore:(A=lbe(y,L,A),m.dbcore.reduce(function(z,se){return se=se.create,s(s({},z),se(z))},A))}}function Ny(m,A){var E=A.db,A=ube(m._middlewares,E,m._deps,A);m.core=A.dbcore,m.tables.forEach(function(L){var z=L.name;m.core.schema.tables.some(function(se){return se.name===z})&&(L.core=m.core.table(z),m[z]instanceof m.Table&&(m[z].core=L.core))})}function Ly(m,y,E,A){E.forEach(function(L){var z=A[L];y.forEach(function(se){var ue=function Ce(_e,Te){return v(_e,Te)||(_e=u(_e))&&Ce(_e,Te)}(se,L);(!ue||"value"in ue&&ue.value===void 0)&&(se===m.Transaction.prototype||se instanceof m.Transaction?p(se,L,{get:function(){return this.table(L)},set:function(Ce){f(this,L,{value:Ce,writable:!0,configurable:!0,enumerable:!0})}}):se[L]=new m.Table(L,z))})})}function M_(m,y){y.forEach(function(E){for(var A in E)E[A]instanceof m.Table&&delete E[A]})}function cbe(m,y){return m._cfg.version-y._cfg.version}function dbe(m,y,E,A){var L=m._dbSchema;E.objectStoreNames.contains("$meta")&&!L.$meta&&(L.$meta=k_("$meta",XB("")[0],[]),m._storeNames.push("$meta"));var z=m._createTransaction("readwrite",m._storeNames,L);z.create(E),z._completion.catch(A);var se=z._reject.bind(z),ue=je.transless||je;Ae(function(){return je.trans=z,je.transless=ue,y!==0?(Ny(m,E),_e=y,((Ce=z).storeNames.includes("$meta")?Ce.table("$meta").get("version").then(function(Te){return Te??_e}):st.resolve(_e)).then(function(Te){return Fe=Te,be=z,De=E,xe=[],Te=(he=m)._versions,Re=he._dbSchema=By(0,he.idbdb,De),(Te=Te.filter(function(Me){return Me._cfg.version>=Fe})).length!==0?(Te.forEach(function(Me){xe.push(function(){var $e=Re,He=Me._cfg.dbschema;$y(he,$e,De),$y(he,He,De),Re=he._dbSchema=He;var Ze=N_($e,He);Ze.add.forEach(function(St){L_(De,St[0],St[1].primKey,St[1].indexes)}),Ze.change.forEach(function(St){if(St.recreate)throw new W.Upgrade("Not yet support for changing primary key");var ht=De.objectStore(St.name);St.add.forEach(function(Rt){return Vy(ht,Rt)}),St.change.forEach(function(Rt){ht.deleteIndex(Rt.name),Vy(ht,Rt)}),St.del.forEach(function(Rt){return ht.deleteIndex(Rt)})});var ot=Me._cfg.contentUpgrade;if(ot&&Me._cfg.version>Fe){Ny(he,De),be._memoizedTables={};var gt=I(He);Ze.del.forEach(function(St){gt[St]=$e[St]}),M_(he,[he.Transaction.prototype]),Ly(he,[he.Transaction.prototype],r(gt),gt),be.schema=gt;var it,at=te(ot);return at&&Ye(),Ze=st.follow(function(){var St;(it=ot(be))&&at&&(St=jt.bind(null,null),it.then(St,St))}),it&&typeof it.then=="function"?st.resolve(it):Ze.then(function(){return it})}}),xe.push(function($e){var He,Ze,ot=Me._cfg.dbschema;He=ot,Ze=$e,[].slice.call(Ze.db.objectStoreNames).forEach(function(gt){return He[gt]==null&&Ze.db.deleteObjectStore(gt)}),M_(he,[he.Transaction.prototype]),Ly(he,[he.Transaction.prototype],he._storeNames,he._dbSchema),be.schema=he._dbSchema}),xe.push(function($e){he.idbdb.objectStoreNames.contains("$meta")&&(Math.ceil(he.idbdb.version/10)===Me._cfg.version?(he.idbdb.deleteObjectStore("$meta"),delete he._dbSchema.$meta,he._storeNames=he._storeNames.filter(function(He){return He!=="$meta"})):$e.objectStore("$meta").put(Me._cfg.version,"version"))})}),function Me(){return xe.length?st.resolve(xe.shift()(be.idbtrans)).then(Me):st.resolve()}().then(function(){ZB(Re,De)})):st.resolve();var he,Fe,be,De,xe,Re}).catch(se)):(r(L).forEach(function(Te){L_(E,Te,L[Te].primKey,L[Te].indexes)}),Ny(m,E),void st.follow(function(){return m.on.populate.fire(z)}).catch(se));var Ce,_e})}function hbe(m,y){ZB(m._dbSchema,y),y.db.version%10!=0||y.objectStoreNames.contains("$meta")||y.db.createObjectStore("$meta").add(Math.ceil(y.db.version/10-1),"version");var E=By(0,m.idbdb,y);$y(m,m._dbSchema,y);for(var A=0,L=N_(E,m._dbSchema).change;A<L.length;A++){var z=function(se){if(se.change.length||se.recreate)return console.warn("Unable to patch indexes of table ".concat(se.name," because it has changes on the type of index or primary key.")),{value:void 0};var ue=y.objectStore(se.name);se.add.forEach(function(Ce){H&&console.debug("Dexie upgrade patch: Creating missing index ".concat(se.name,".").concat(Ce.src)),Vy(ue,Ce)})}(L[A]);if(typeof z=="object")return z.value}}function N_(m,y){var E,A={del:[],add:[],change:[]};for(E in m)y[E]||A.del.push(E);for(E in y){var L=m[E],z=y[E];if(L){var se={name:E,def:z,recreate:!1,del:[],add:[],change:[]};if(""+(L.primKey.keyPath||"")!=""+(z.primKey.keyPath||"")||L.primKey.auto!==z.primKey.auto)se.recreate=!0,A.change.push(se);else{var ue=L.idxByName,Ce=z.idxByName,_e=void 0;for(_e in ue)Ce[_e]||se.del.push(_e);for(_e in Ce){var Te=ue[_e],he=Ce[_e];Te?Te.src!==he.src&&se.change.push(he):se.add.push(he)}(0<se.del.length||0<se.add.length||0<se.change.length)&&A.change.push(se)}}else A.add.push([E,z])}return A}function L_(m,y,E,A){var L=m.db.createObjectStore(y,E.keyPath?{keyPath:E.keyPath,autoIncrement:E.auto}:{autoIncrement:E.auto});return A.forEach(function(z){return Vy(L,z)}),L}function ZB(m,y){r(m).forEach(function(E){y.db.objectStoreNames.contains(E)||(H&&console.debug("Dexie: Creating missing table",E),L_(y,E,m[E].primKey,m[E].indexes))})}function Vy(m,y){m.createIndex(y.name,y.keyPath,{unique:y.unique,multiEntry:y.multi})}function By(m,y,E){var A={};return S(y.objectStoreNames,0).forEach(function(L){for(var z=E.objectStore(L),se=A_(qB(_e=z.keyPath),_e||"",!0,!1,!!z.autoIncrement,_e&&typeof _e!="string",!0),ue=[],Ce=0;Ce<z.indexNames.length;++Ce){var Te=z.index(z.indexNames[Ce]),_e=Te.keyPath,Te=A_(Te.name,_e,!!Te.unique,!!Te.multiEntry,!1,_e&&typeof _e!="string",!1);ue.push(Te)}A[L]=k_(L,se,ue)}),A}function $y(m,y,E){for(var A=E.db.objectStoreNames,L=0;L<A.length;++L){var z=A[L],se=E.objectStore(z);m._hasGetAll="getAll"in se;for(var ue=0;ue<se.indexNames.length;++ue){var Ce=se.indexNames[ue],_e=se.index(Ce).keyPath,Te=typeof _e=="string"?_e:"["+S(_e).join("+")+"]";!y[z]||(_e=y[z].idxByName[Te])&&(_e.name=Ce,delete y[z].idxByName[Te],y[z].idxByName[Ce]=_e)}}typeof navigator<"u"&&/Safari/.test(navigator.userAgent)&&!/(Chrome\/|Edge\/)/.test(navigator.userAgent)&&i.WorkerGlobalScope&&i instanceof i.WorkerGlobalScope&&[].concat(navigator.userAgent.match(/Safari\/(\d*)/))[1]<604&&(m._hasGetAll=!1)}function XB(m){return m.split(",").map(function(y,E){var A=(y=y.trim()).replace(/([&*]|\+\+)/g,""),L=/^\[/.test(A)?A.match(/^\[(.*)\]$/)[1].split("+"):A;return A_(A,L||null,/\&/.test(y),/\*/.test(y),/\+\+/.test(y),a(L),E===0)})}var fbe=(Hy.prototype._parseStoresSpec=function(m,y){r(m).forEach(function(E){if(m[E]!==null){var A=XB(m[E]),L=A.shift();if(L.unique=!0,L.multi)throw new W.Schema("Primary key cannot be multi-valued");A.forEach(function(z){if(z.auto)throw new W.Schema("Only primary key can be marked as autoIncrement (++)");if(!z.keyPath)throw new W.Schema("Index must have a name and cannot be an empty string")}),y[E]=k_(E,L,A)}})},Hy.prototype.stores=function(E){var y=this.db;this._cfg.storesSource=this._cfg.storesSource?l(this._cfg.storesSource,E):E;var E=y._versions,A={},L={};return E.forEach(function(z){l(A,z._cfg.storesSource),L=z._cfg.dbschema={},z._parseStoresSpec(A,L)}),y._dbSchema=L,M_(y,[y._allTables,y,y.Transaction.prototype]),Ly(y,[y._allTables,y,y.Transaction.prototype,this._cfg.tables],r(L),L),y._storeNames=r(L),this},Hy.prototype.upgrade=function(m){return this._cfg.contentUpgrade=M(this._cfg.contentUpgrade||Ie,m),this},Hy);function Hy(){}function V_(m,y){var E=m._dbNamesDB;return E||(E=m._dbNamesDB=new Ca(Py,{addons:[],indexedDB:m,IDBKeyRange:y})).version(1).stores({dbnames:"name"}),E.table("dbnames")}function B_(m){return m&&typeof m.databases=="function"}function $_(m){return Ae(function(){return je.letThrough=!0,m()})}function H_(m){return!("from"in m)}var Ks=function(m,y){if(!this){var E=new Ks;return m&&"d"in m&&l(E,m),E}l(this,arguments.length?{d:1,from:m,to:1<arguments.length?y:m}:{d:0})};function Rp(m,y,E){var A=ln(y,E);if(!isNaN(A)){if(0<A)throw RangeError();if(H_(m))return l(m,{from:y,to:E,d:1});var L=m.l,A=m.r;if(ln(E,m.from)<0)return L?Rp(L,y,E):m.l={from:y,to:E,d:1,l:null,r:null},QB(m);if(0<ln(y,m.to))return A?Rp(A,y,E):m.r={from:y,to:E,d:1,l:null,r:null},QB(m);ln(y,m.from)<0&&(m.from=y,m.l=null,m.d=A?A.d+1:1),0<ln(E,m.to)&&(m.to=E,m.r=null,m.d=m.l?m.l.d+1:1),E=!m.r,L&&!m.l&&Dp(m,L),A&&E&&Dp(m,A)}}function Dp(m,y){H_(y)||function E(A,Ce){var z=Ce.from,se=Ce.to,ue=Ce.l,Ce=Ce.r;Rp(A,z,se),ue&&E(A,ue),Ce&&E(A,Ce)}(m,y)}function JB(m,y){var E=Gy(y),A=E.next();if(A.done)return!1;for(var L=A.value,z=Gy(m),se=z.next(L.from),ue=se.value;!A.done&&!se.done;){if(ln(ue.from,L.to)<=0&&0<=ln(ue.to,L.from))return!0;ln(L.from,ue.from)<0?L=(A=E.next(ue.from)).value:ue=(se=z.next(L.from)).value}return!1}function Gy(m){var y=H_(m)?null:{s:0,n:m};return{next:function(E){for(var A=0<arguments.length;y;)switch(y.s){case 0:if(y.s=1,A)for(;y.n.l&&ln(E,y.n.from)<0;)y={up:y,n:y.n.l,s:1};else for(;y.n.l;)y={up:y,n:y.n.l,s:1};case 1:if(y.s=2,!A||ln(E,y.n.to)<=0)return{value:y.n,done:!1};case 2:if(y.n.r){y.s=3,y={up:y,n:y.n.r,s:0};continue}case 3:y=y.up}return{done:!0}}}}function QB(m){var y,E,A=(((y=m.r)===null||y===void 0?void 0:y.d)||0)-(((E=m.l)===null||E===void 0?void 0:E.d)||0),L=1<A?"r":A<-1?"l":"";L&&(y=L=="r"?"l":"r",E=s({},m),A=m[L],m.from=A.from,m.to=A.to,m[L]=A[L],E[L]=A[y],(m[y]=E).d=e$(E)),m.d=e$(m)}function e$(E){var y=E.r,E=E.l;return(y?E?Math.max(y.d,E.d):y.d:E?E.d:0)+1}function Uy(m,y){return r(y).forEach(function(E){m[E]?Dp(m[E],y[E]):m[E]=function A(L){var z,se,ue={};for(z in L)d(L,z)&&(se=L[z],ue[z]=!se||typeof se!="object"||D.has(se.constructor)?se:A(se));return ue}(y[E])}),m}function G_(m,y){return m.all||y.all||Object.keys(m).some(function(E){return y[E]&&JB(y[E],m[E])})}h(Ks.prototype,((mi={add:function(m){return Dp(this,m),this},addKey:function(m){return Rp(this,m,m),this},addKeys:function(m){var y=this;return m.forEach(function(E){return Rp(y,E,E)}),this},hasKey:function(m){var y=Gy(this).next(m).value;return y&&ln(y.from,m)<=0&&0<=ln(y.to,m)}})[q]=function(){return Gy(this)},mi));var Nu={},U_={},W_=!1;function Wy(m){Uy(U_,m),W_||(W_=!0,setTimeout(function(){W_=!1,z_(U_,!(U_={}))},0))}function z_(m,y){y===void 0&&(y=!1);var E=new Set;if(m.all)for(var A=0,L=Object.values(Nu);A<L.length;A++)t$(se=L[A],m,E,y);else for(var z in m){var se,ue=/^idb\:\/\/(.*)\/(.*)\//.exec(z);ue&&(z=ue[1],ue=ue[2],(se=Nu["idb://".concat(z,"/").concat(ue)])&&t$(se,m,E,y))}E.forEach(function(Ce){return Ce()})}function t$(m,y,E,A){for(var L=[],z=0,se=Object.entries(m.queries.query);z<se.length;z++){for(var ue=se[z],Ce=ue[0],_e=[],Te=0,he=ue[1];Te<he.length;Te++){var Fe=he[Te];G_(y,Fe.obsSet)?Fe.subscribers.forEach(function(Re){return E.add(Re)}):A&&_e.push(Fe)}A&&L.push([Ce,_e])}if(A)for(var be=0,De=L;be<De.length;be++){var xe=De[be],Ce=xe[0],_e=xe[1];m.queries.query[Ce]=_e}}function pbe(m){var y=m._state,E=m._deps.indexedDB;if(y.isBeingOpened||m.idbdb)return y.dbReadyPromise.then(function(){return y.dbOpenError?Kn(y.dbOpenError):m});y.isBeingOpened=!0,y.dbOpenError=null,y.openComplete=!1;var A=y.openCanceller,L=Math.round(10*m.verno),z=!1;function se(){if(y.openCanceller!==A)throw new W.DatabaseClosed("db.open() was cancelled")}function ue(){return new st(function(Fe,be){if(se(),!E)throw new W.MissingAPI;var De=m.name,xe=y.autoSchema||!L?E.open(De):E.open(De,L);if(!xe)throw new W.MissingAPI;xe.onerror=Ar(be),xe.onblocked=kn(m._fireOnBlocked),xe.onupgradeneeded=kn(function(Re){var Me;Te=xe.transaction,y.autoSchema&&!m._options.allowEmptyDB?(xe.onerror=bp,Te.abort(),xe.result.close(),(Me=E.deleteDatabase(De)).onsuccess=Me.onerror=kn(function(){be(new W.NoSuchDatabase("Database ".concat(De," doesnt exist")))})):(Te.onerror=Ar(be),Re=Re.oldVersion>Math.pow(2,62)?0:Re.oldVersion,he=Re<1,m.idbdb=xe.result,z&&hbe(m,Te),dbe(m,Re/10,Te,be))},be),xe.onsuccess=kn(function(){Te=null;var Re,Me,$e,He,Ze,ot=m.idbdb=xe.result,gt=S(ot.objectStoreNames);if(0<gt.length)try{var it=ot.transaction((He=gt).length===1?He[0]:He,"readonly");if(y.autoSchema)Me=ot,$e=it,(Re=m).verno=Me.version/10,$e=Re._dbSchema=By(0,Me,$e),Re._storeNames=S(Me.objectStoreNames,0),Ly(Re,[Re._allTables],r($e),$e);else if($y(m,m._dbSchema,it),((Ze=N_(By(0,(Ze=m).idbdb,it),Ze._dbSchema)).add.length||Ze.change.some(function(at){return at.add.length||at.change.length}))&&!z)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."),ot.close(),L=ot.version+1,z=!0,Fe(ue());Ny(m,it)}catch{}Md.push(m),ot.onversionchange=kn(function(at){y.vcFired=!0,m.on("versionchange").fire(at)}),ot.onclose=kn(function(at){m.on("close").fire(at)}),he&&(Ze=m._deps,it=De,ot=Ze.indexedDB,Ze=Ze.IDBKeyRange,B_(ot)||it===Py||V_(ot,Ze).put({name:it}).catch(Ie)),Fe()},be)}).catch(function(Fe){switch(Fe==null?void 0:Fe.name){case"UnknownError":if(0<y.PR1398_maxLoop)return y.PR1398_maxLoop--,console.warn("Dexie: Workaround for Chrome UnknownError on open()"),ue();break;case"VersionError":if(0<L)return L=0,ue()}return st.reject(Fe)})}var Ce,_e=y.dbReadyResolve,Te=null,he=!1;return st.race([A,(typeof navigator>"u"?st.resolve():!navigator.userAgentData&&/Safari\//.test(navigator.userAgent)&&!/Chrom(e|ium)\//.test(navigator.userAgent)&&indexedDB.databases?new Promise(function(Fe){function be(){return indexedDB.databases().finally(Fe)}Ce=setInterval(be,100),be()}).finally(function(){return clearInterval(Ce)}):Promise.resolve()).then(ue)]).then(function(){return se(),y.onReadyBeingFired=[],st.resolve($_(function(){return m.on.ready.fire(m.vip)})).then(function Fe(){if(0<y.onReadyBeingFired.length){var be=y.onReadyBeingFired.reduce(M,Ie);return y.onReadyBeingFired=[],st.resolve($_(function(){return be(m.vip)})).then(Fe)}})}).finally(function(){y.openCanceller===A&&(y.onReadyBeingFired=null,y.isBeingOpened=!1)}).catch(function(Fe){y.dbOpenError=Fe;try{Te&&Te.abort()}catch{}return A===y.openCanceller&&m._close(),Kn(Fe)}).finally(function(){y.openComplete=!0,_e()}).then(function(){var Fe;return he&&(Fe={},m.tables.forEach(function(be){be.schema.indexes.forEach(function(De){De.name&&(Fe["idb://".concat(m.name,"/").concat(be.name,"/").concat(De.name)]=new Ks(-1/0,[[[]]]))}),Fe["idb://".concat(m.name,"/").concat(be.name,"/")]=Fe["idb://".concat(m.name,"/").concat(be.name,"/:dels")]=new Ks(-1/0,[[[]]])}),vl(Sp).fire(Fe),z_(Fe,!0)),m})}function j_(m){function y(z){return m.next(z)}var E=L(y),A=L(function(z){return m.throw(z)});function L(z){return function(Ce){var ue=z(Ce),Ce=ue.value;return ue.done?Ce:Ce&&typeof Ce.then=="function"?Ce.then(E,A):a(Ce)?Promise.all(Ce).then(E,A):E(Ce)}}return L(y)()}function zy(m,y,E){for(var A=a(m)?m.slice():[m],L=0;L<E;++L)A.push(y);return A}var gbe={stack:"dbcore",name:"VirtualIndexMiddleware",level:1,create:function(m){return s(s({},m),{table:function(y){var E=m.table(y),A=E.schema,L={},z=[];function se(he,Fe,be){var De=_p(he),xe=L[De]=L[De]||[],Re=he==null?0:typeof he=="string"?1:he.length,Me=0<Fe,Me=s(s({},be),{name:Me?"".concat(De,"(virtual-from:").concat(be.name,")"):be.name,lowLevelIndex:be,isVirtual:Me,keyTail:Fe,keyLength:Re,extractKey:O_(he),unique:!Me&&be.unique});return xe.push(Me),Me.isPrimaryKey||z.push(Me),1<Re&&se(Re===2?he[0]:he.slice(0,Re-1),Fe+1,be),xe.sort(function($e,He){return $e.keyTail-He.keyTail}),Me}y=se(A.primaryKey.keyPath,0,A.primaryKey),L[":id"]=[y];for(var ue=0,Ce=A.indexes;ue<Ce.length;ue++){var _e=Ce[ue];se(_e.keyPath,0,_e)}function Te(he){var Fe,be=he.query.index;return be.isVirtual?s(s({},he),{query:{index:be.lowLevelIndex,range:(Fe=he.query.range,be=be.keyTail,{type:Fe.type===1?2:Fe.type,lower:zy(Fe.lower,Fe.lowerOpen?m.MAX_KEY:m.MIN_KEY,be),lowerOpen:!0,upper:zy(Fe.upper,Fe.upperOpen?m.MIN_KEY:m.MAX_KEY,be),upperOpen:!0})}}):he}return s(s({},E),{schema:s(s({},A),{primaryKey:y,indexes:z,getIndexByKeyPath:function(he){return(he=L[_p(he)])&&he[0]}}),count:function(he){return E.count(Te(he))},query:function(he){return E.query(Te(he))},openCursor:function(he){var Fe=he.query.index,be=Fe.keyTail,De=Fe.isVirtual,xe=Fe.keyLength;return De?E.openCursor(Te(he)).then(function(Me){return Me&&Re(Me)}):E.openCursor(he);function Re(Me){return Object.create(Me,{continue:{value:function($e){$e!=null?Me.continue(zy($e,he.reverse?m.MAX_KEY:m.MIN_KEY,be)):he.unique?Me.continue(Me.key.slice(0,xe).concat(he.reverse?m.MIN_KEY:m.MAX_KEY,be)):Me.continue()}},continuePrimaryKey:{value:function($e,He){Me.continuePrimaryKey(zy($e,m.MAX_KEY,be),He)}},primaryKey:{get:function(){return Me.primaryKey}},key:{get:function(){var $e=Me.key;return xe===1?$e[0]:$e.slice(0,xe)}},value:{get:function(){return Me.value}}})}}})}})}};function K_(m,y,E,A){return E=E||{},A=A||"",r(m).forEach(function(L){var z,se,ue;d(y,L)?(z=m[L],se=y[L],typeof z=="object"&&typeof se=="object"&&z&&se?(ue=$(z))!==$(se)?E[A+L]=y[L]:ue==="Object"?K_(z,se,E,A+L+"."):z!==se&&(E[A+L]=y[L]):z!==se&&(E[A+L]=y[L])):E[A+L]=void 0}),r(y).forEach(function(L){d(m,L)||(E[A+L]=y[L])}),E}function q_(m,y){return y.type==="delete"?y.keys:y.keys||y.values.map(m.extractKey)}var mbe={stack:"dbcore",name:"HooksMiddleware",level:2,create:function(m){return s(s({},m),{table:function(y){var E=m.table(y),A=E.schema.primaryKey;return s(s({},E),{mutate:function(L){var z=je.trans,se=z.table(y).hook,ue=se.deleting,Ce=se.creating,_e=se.updating;switch(L.type){case"add":if(Ce.fire===Ie)break;return z._promise("readwrite",function(){return Te(L)},!0);case"put":if(Ce.fire===Ie&&_e.fire===Ie)break;return z._promise("readwrite",function(){return Te(L)},!0);case"delete":if(ue.fire===Ie)break;return z._promise("readwrite",function(){return Te(L)},!0);case"deleteRange":if(ue.fire===Ie)break;return z._promise("readwrite",function(){return function he(Fe,be,De){return E.query({trans:Fe,values:!1,query:{index:A,range:be},limit:De}).then(function(xe){var Re=xe.result;return Te({type:"delete",keys:Re,trans:Fe}).then(function(Me){return 0<Me.numFailures?Promise.reject(Me.failures[0]):Re.length<De?{failures:[],numFailures:0,lastResult:void 0}:he(Fe,s(s({},be),{lower:Re[Re.length-1],lowerOpen:!0}),De)})})}(L.trans,L.range,1e4)},!0)}return E.mutate(L);function Te(he){var Fe,be,De,xe=je.trans,Re=he.keys||q_(A,he);if(!Re)throw new Error("Keys missing");return(he=he.type==="add"||he.type==="put"?s(s({},he),{keys:Re}):s({},he)).type!=="delete"&&(he.values=o([],he.values)),he.keys&&(he.keys=o([],he.keys)),Fe=E,De=Re,((be=he).type==="add"?Promise.resolve([]):Fe.getMany({trans:be.trans,keys:De,cache:"immutable"})).then(function(Me){var $e=Re.map(function(He,Ze){var ot,gt,it,at=Me[Ze],St={onerror:null,onsuccess:null};return he.type==="delete"?ue.fire.call(St,He,at,xe):he.type==="add"||at===void 0?(ot=Ce.fire.call(St,He,he.values[Ze],xe),He==null&&ot!=null&&(he.keys[Ze]=He=ot,A.outbound||T(he.values[Ze],A.keyPath,He))):(ot=K_(at,he.values[Ze]),(gt=_e.fire.call(St,ot,He,at,xe))&&(it=he.values[Ze],Object.keys(gt).forEach(function(ht){d(it,ht)?it[ht]=gt[ht]:T(it,ht,gt[ht])}))),St});return E.mutate(he).then(function(He){for(var Ze=He.failures,ot=He.results,gt=He.numFailures,He=He.lastResult,it=0;it<Re.length;++it){var at=(ot||Re)[it],St=$e[it];at==null?St.onerror&&St.onerror(Ze[it]):St.onsuccess&&St.onsuccess(he.type==="put"&&Me[it]?he.values[it]:at)}return{failures:Ze,results:ot,numFailures:gt,lastResult:He}}).catch(function(He){return $e.forEach(function(Ze){return Ze.onerror&&Ze.onerror(He)}),Promise.reject(He)})})}}})}})}};function n$(m,y,E){try{if(!y||y.keys.length<m.length)return null;for(var A=[],L=0,z=0;L<y.keys.length&&z<m.length;++L)ln(y.keys[L],m[z])===0&&(A.push(E?k(y.values[L]):y.values[L]),++z);return A.length===m.length?A:null}catch{return null}}var vbe={stack:"dbcore",level:-1,create:function(m){return{table:function(y){var E=m.table(y);return s(s({},E),{getMany:function(A){if(!A.cache)return E.getMany(A);var L=n$(A.keys,A.trans._cache,A.cache==="clone");return L?st.resolve(L):E.getMany(A).then(function(z){return A.trans._cache={keys:A.keys,values:A.cache==="clone"?k(z):z},z})},mutate:function(A){return A.type!=="add"&&(A.trans._cache=null),E.mutate(A)}})}}}};function s$(m,y){return m.trans.mode==="readonly"&&!!m.subscr&&!m.trans.explicit&&m.trans.db._options.cache!=="disabled"&&!y.schema.primaryKey.outbound}function o$(m,y){switch(m){case"query":return y.values&&!y.unique;case"get":case"getMany":case"count":case"openCursor":return!1}}var ybe={stack:"dbcore",level:0,name:"Observability",create:function(m){var y=m.schema.name,E=new Ks(m.MIN_KEY,m.MAX_KEY);return s(s({},m),{transaction:function(A,L,z){if(je.subscr&&L!=="readonly")throw new W.ReadOnly("Readwrite transaction in liveQuery context. Querier source: ".concat(je.querier));return m.transaction(A,L,z)},table:function(A){var L=m.table(A),z=L.schema,se=z.primaryKey,he=z.indexes,ue=se.extractKey,Ce=se.outbound,_e=se.autoIncrement&&he.filter(function(be){return be.compound&&be.keyPath.includes(se.keyPath)}),Te=s(s({},L),{mutate:function(be){function De(ht){return ht="idb://".concat(y,"/").concat(A,"/").concat(ht),He[ht]||(He[ht]=new Ks)}var xe,Re,Me,$e=be.trans,He=be.mutatedParts||(be.mutatedParts={}),Ze=De(""),ot=De(":dels"),gt=be.type,St=be.type==="deleteRange"?[be.range]:be.type==="delete"?[be.keys]:be.values.length<50?[q_(se,be).filter(function(ht){return ht}),be.values]:[],it=St[0],at=St[1],St=be.trans._cache;return a(it)?(Ze.addKeys(it),(St=gt==="delete"||it.length===at.length?n$(it,St):null)||ot.addKeys(it),(St||at)&&(xe=De,Re=St,Me=at,z.indexes.forEach(function(ht){var Rt=xe(ht.name||"");function Zt(rn){return rn!=null?ht.extractKey(rn):null}function on(rn){return ht.multiEntry&&a(rn)?rn.forEach(function(Wo){return Rt.addKey(Wo)}):Rt.addKey(rn)}(Re||Me).forEach(function(rn,qs){var Kt=Re&&Zt(Re[qs]),qs=Me&&Zt(Me[qs]);ln(Kt,qs)!==0&&(Kt!=null&&on(Kt),qs!=null&&on(qs))})}))):it?(at={from:(at=it.lower)!==null&&at!==void 0?at:m.MIN_KEY,to:(at=it.upper)!==null&&at!==void 0?at:m.MAX_KEY},ot.add(at),Ze.add(at)):(Ze.add(E),ot.add(E),z.indexes.forEach(function(ht){return De(ht.name).add(E)})),L.mutate(be).then(function(ht){return!it||be.type!=="add"&&be.type!=="put"||(Ze.addKeys(ht.results),_e&&_e.forEach(function(Rt){for(var Zt=be.values.map(function(Kt){return Rt.extractKey(Kt)}),on=Rt.keyPath.findIndex(function(Kt){return Kt===se.keyPath}),rn=0,Wo=ht.results.length;rn<Wo;++rn)Zt[rn][on]=ht.results[rn];De(Rt.name).addKeys(Zt)})),$e.mutatedParts=Uy($e.mutatedParts||{},He),ht})}}),he=function(De){var xe=De.query,De=xe.index,xe=xe.range;return[De,new Ks((De=xe.lower)!==null&&De!==void 0?De:m.MIN_KEY,(xe=xe.upper)!==null&&xe!==void 0?xe:m.MAX_KEY)]},Fe={get:function(be){return[se,new Ks(be.key)]},getMany:function(be){return[se,new Ks().addKeys(be.keys)]},count:he,query:he,openCursor:he};return r(Fe).forEach(function(be){Te[be]=function(De){var xe=je.subscr,Re=!!xe,Me=s$(je,L)&&o$(be,De)?De.obsSet={}:xe;if(Re){var $e=function(at){return at="idb://".concat(y,"/").concat(A,"/").concat(at),Me[at]||(Me[at]=new Ks)},He=$e(""),Ze=$e(":dels"),xe=Fe[be](De),Re=xe[0],xe=xe[1];if((be==="query"&&Re.isPrimaryKey&&!De.values?Ze:$e(Re.name||"")).add(xe),!Re.isPrimaryKey){if(be!=="count"){var ot=be==="query"&&Ce&&De.values&&L.query(s(s({},De),{values:!1}));return L[be].apply(this,arguments).then(function(at){if(be==="query"){if(Ce&&De.values)return ot.then(function(Zt){return Zt=Zt.result,He.addKeys(Zt),at});var St=De.values?at.result.map(ue):at.result;(De.values?He:Ze).addKeys(St)}else if(be==="openCursor"){var ht=at,Rt=De.values;return ht&&Object.create(ht,{key:{get:function(){return Ze.addKey(ht.primaryKey),ht.key}},primaryKey:{get:function(){var Zt=ht.primaryKey;return Ze.addKey(Zt),Zt}},value:{get:function(){return Rt&&He.addKey(ht.primaryKey),ht.value}}})}return at})}Ze.add(E)}}return L[be].apply(this,arguments)}}),Te}})}};function i$(m,y,E){if(E.numFailures===0)return y;if(y.type==="deleteRange")return null;var A=y.keys?y.keys.length:"values"in y&&y.values?y.values.length:1;return E.numFailures===A?null:(y=s({},y),a(y.keys)&&(y.keys=y.keys.filter(function(L,z){return!(z in E.failures)})),"values"in y&&a(y.values)&&(y.values=y.values.filter(function(L,z){return!(z in E.failures)})),y)}function Y_(m,y){return E=m,((A=y).lower===void 0||(A.lowerOpen?0<ln(E,A.lower):0<=ln(E,A.lower)))&&(m=m,(y=y).upper===void 0||(y.upperOpen?ln(m,y.upper)<0:ln(m,y.upper)<=0));var E,A}function r$(m,y,Fe,A,L,z){if(!Fe||Fe.length===0)return m;var se=y.query.index,ue=se.multiEntry,Ce=y.query.range,_e=A.schema.primaryKey.extractKey,Te=se.extractKey,he=(se.lowLevelIndex||se).extractKey,Fe=Fe.reduce(function(be,De){var xe=be,Re=[];if(De.type==="add"||De.type==="put")for(var Me=new Ks,$e=De.values.length-1;0<=$e;--$e){var He,Ze=De.values[$e],ot=_e(Ze);Me.hasKey(ot)||(He=Te(Ze),(ue&&a(He)?He.some(function(ht){return Y_(ht,Ce)}):Y_(He,Ce))&&(Me.addKey(ot),Re.push(Ze)))}switch(De.type){case"add":var gt=new Ks().addKeys(y.values?be.map(function(Rt){return _e(Rt)}):be),xe=be.concat(y.values?Re.filter(function(Rt){return Rt=_e(Rt),!gt.hasKey(Rt)&&(gt.addKey(Rt),!0)}):Re.map(function(Rt){return _e(Rt)}).filter(function(Rt){return!gt.hasKey(Rt)&&(gt.addKey(Rt),!0)}));break;case"put":var it=new Ks().addKeys(De.values.map(function(Rt){return _e(Rt)}));xe=be.filter(function(Rt){return!it.hasKey(y.values?_e(Rt):Rt)}).concat(y.values?Re:Re.map(function(Rt){return _e(Rt)}));break;case"delete":var at=new Ks().addKeys(De.keys);xe=be.filter(function(Rt){return!at.hasKey(y.values?_e(Rt):Rt)});break;case"deleteRange":var St=De.range;xe=be.filter(function(Rt){return!Y_(_e(Rt),St)})}return xe},m);return Fe===m?m:(Fe.sort(function(be,De){return ln(he(be),he(De))||ln(_e(be),_e(De))}),y.limit&&y.limit<1/0&&(Fe.length>y.limit?Fe.length=y.limit:m.length===y.limit&&Fe.length<y.limit&&(L.dirty=!0)),z?Object.freeze(Fe):Fe)}function a$(m,y){return ln(m.lower,y.lower)===0&&ln(m.upper,y.upper)===0&&!!m.lowerOpen==!!y.lowerOpen&&!!m.upperOpen==!!y.upperOpen}function wbe(m,y){return function(E,A,L,z){if(E===void 0)return A!==void 0?-1:0;if(A===void 0)return 1;if((A=ln(E,A))===0){if(L&&z)return 0;if(L)return 1;if(z)return-1}return A}(m.lower,y.lower,m.lowerOpen,y.lowerOpen)<=0&&0<=function(E,A,L,z){if(E===void 0)return A!==void 0?1:0;if(A===void 0)return-1;if((A=ln(E,A))===0){if(L&&z)return 0;if(L)return-1;if(z)return 1}return A}(m.upper,y.upper,m.upperOpen,y.upperOpen)}function Cbe(m,y,E,A){m.subscribers.add(E),A.addEventListener("abort",function(){var L,z;m.subscribers.delete(E),m.subscribers.size===0&&(L=m,z=y,setTimeout(function(){L.subscribers.size===0&&ee(z,L)},3e3))})}var bbe={stack:"dbcore",level:0,name:"Cache",create:function(m){var y=m.schema.name;return s(s({},m),{transaction:function(E,A,L){var z,se,ue=m.transaction(E,A,L);return A==="readwrite"&&(se=(z=new AbortController).signal,L=function(Ce){return function(){if(z.abort(),A==="readwrite"){for(var _e=new Set,Te=0,he=E;Te<he.length;Te++){var Fe=he[Te],be=Nu["idb://".concat(y,"/").concat(Fe)];if(be){var De=m.table(Fe),xe=be.optimisticOps.filter(function(Rt){return Rt.trans===ue});if(ue._explicit&&Ce&&ue.mutatedParts)for(var Re=0,Me=Object.values(be.queries.query);Re<Me.length;Re++)for(var $e=0,He=(gt=Me[Re]).slice();$e<He.length;$e++)G_((it=He[$e]).obsSet,ue.mutatedParts)&&(ee(gt,it),it.subscribers.forEach(function(Rt){return _e.add(Rt)}));else if(0<xe.length){be.optimisticOps=be.optimisticOps.filter(function(Rt){return Rt.trans!==ue});for(var Ze=0,ot=Object.values(be.queries.query);Ze<ot.length;Ze++)for(var gt,it,at,St=0,ht=(gt=ot[Ze]).slice();St<ht.length;St++)(it=ht[St]).res!=null&&ue.mutatedParts&&(Ce&&!it.dirty?(at=Object.isFrozen(it.res),at=r$(it.res,it.req,xe,De,it,at),it.dirty?(ee(gt,it),it.subscribers.forEach(function(Rt){return _e.add(Rt)})):at!==it.res&&(it.res=at,it.promise=st.resolve({result:at}))):(it.dirty&&ee(gt,it),it.subscribers.forEach(function(Rt){return _e.add(Rt)})))}}}_e.forEach(function(Rt){return Rt()})}}},ue.addEventListener("abort",L(!1),{signal:se}),ue.addEventListener("error",L(!1),{signal:se}),ue.addEventListener("complete",L(!0),{signal:se})),ue},table:function(E){var A=m.table(E),L=A.schema.primaryKey;return s(s({},A),{mutate:function(z){var se=je.trans;if(L.outbound||se.db._options.cache==="disabled"||se.explicit||se.idbtrans.mode!=="readwrite")return A.mutate(z);var ue=Nu["idb://".concat(y,"/").concat(E)];return ue?(se=A.mutate(z),z.type!=="add"&&z.type!=="put"||!(50<=z.values.length||q_(L,z).some(function(Ce){return Ce==null}))?(ue.optimisticOps.push(z),z.mutatedParts&&Wy(z.mutatedParts),se.then(function(Ce){0<Ce.numFailures&&(ee(ue.optimisticOps,z),(Ce=i$(0,z,Ce))&&ue.optimisticOps.push(Ce),z.mutatedParts&&Wy(z.mutatedParts))}),se.catch(function(){ee(ue.optimisticOps,z),z.mutatedParts&&Wy(z.mutatedParts)})):se.then(function(Ce){var _e=i$(0,s(s({},z),{values:z.values.map(function(Te,he){var Fe;return Ce.failures[he]?Te:(Te=(Fe=L.keyPath)!==null&&Fe!==void 0&&Fe.includes(".")?k(Te):s({},Te),T(Te,L.keyPath,Ce.results[he]),Te)})}),Ce);ue.optimisticOps.push(_e),queueMicrotask(function(){return z.mutatedParts&&Wy(z.mutatedParts)})}),se):A.mutate(z)},query:function(z){if(!s$(je,A)||!o$("query",z))return A.query(z);var se=((_e=je.trans)===null||_e===void 0?void 0:_e.db._options.cache)==="immutable",he=je,ue=he.requery,Ce=he.signal,_e=function(De,xe,Re,Me){var $e=Nu["idb://".concat(De,"/").concat(xe)];if(!$e)return[];if(!(xe=$e.queries[Re]))return[null,!1,$e,null];var He=xe[(Me.query?Me.query.index.name:null)||""];if(!He)return[null,!1,$e,null];switch(Re){case"query":var Ze=He.find(function(ot){return ot.req.limit===Me.limit&&ot.req.values===Me.values&&a$(ot.req.query.range,Me.query.range)});return Ze?[Ze,!0,$e,He]:[He.find(function(ot){return("limit"in ot.req?ot.req.limit:1/0)>=Me.limit&&(!Me.values||ot.req.values)&&wbe(ot.req.query.range,Me.query.range)}),!1,$e,He];case"count":return Ze=He.find(function(ot){return a$(ot.req.query.range,Me.query.range)}),[Ze,!!Ze,$e,He]}}(y,E,"query",z),Te=_e[0],he=_e[1],Fe=_e[2],be=_e[3];return Te&&he?Te.obsSet=z.obsSet:(he=A.query(z).then(function(De){var xe=De.result;if(Te&&(Te.res=xe),se){for(var Re=0,Me=xe.length;Re<Me;++Re)Object.freeze(xe[Re]);Object.freeze(xe)}else De.result=k(xe);return De}).catch(function(De){return be&&Te&&ee(be,Te),Promise.reject(De)}),Te={obsSet:z.obsSet,promise:he,subscribers:new Set,type:"query",req:z,dirty:!1},be?be.push(Te):(be=[Te],(Fe=Fe||(Nu["idb://".concat(y,"/").concat(E)]={queries:{query:{},count:{}},objs:new Map,optimisticOps:[],unsignaledParts:{}})).queries.query[z.query.index.name||""]=be)),Cbe(Te,be,ue,Ce),Te.promise.then(function(De){return{result:r$(De.result,z,Fe==null?void 0:Fe.optimisticOps,A,Te,se)}})}})}})}};function jy(m,y){return new Proxy(m,{get:function(E,A,L){return A==="db"?y:Reflect.get(E,A,L)}})}var Ca=(as.prototype.version=function(m){if(isNaN(m)||m<.1)throw new W.Type("Given version is not a positive number");if(m=Math.round(10*m)/10,this.idbdb||this._state.isBeingOpened)throw new W.Schema("Cannot add version when database is open");this.verno=Math.max(this.verno,m);var y=this._versions,E=y.filter(function(A){return A._cfg.version===m})[0];return E||(E=new this.Version(m),y.push(E),y.sort(cbe),E.stores({}),this._state.autoSchema=!1,E)},as.prototype._whenReady=function(m){var y=this;return this.idbdb&&(this._state.openComplete||je.letThrough||this._vip)?m():new st(function(E,A){if(y._state.openComplete)return A(new W.DatabaseClosed(y._state.dbOpenError));if(!y._state.isBeingOpened){if(!y._state.autoOpen)return void A(new W.DatabaseClosed);y.open().catch(Ie)}y._state.dbReadyPromise.then(E,A)}).then(m)},as.prototype.use=function(m){var y=m.stack,E=m.create,A=m.level,L=m.name;return L&&this.unuse({stack:y,name:L}),m=this._middlewares[y]||(this._middlewares[y]=[]),m.push({stack:y,create:E,level:A??10,name:L}),m.sort(function(z,se){return z.level-se.level}),this},as.prototype.unuse=function(m){var y=m.stack,E=m.name,A=m.create;return y&&this._middlewares[y]&&(this._middlewares[y]=this._middlewares[y].filter(function(L){return A?L.create!==A:!!E&&L.name!==E})),this},as.prototype.open=function(){var m=this;return Co(Ne,function(){return pbe(m)})},as.prototype._close=function(){var m=this._state,y=Md.indexOf(this);if(0<=y&&Md.splice(y,1),this.idbdb){try{this.idbdb.close()}catch{}this.idbdb=null}m.isBeingOpened||(m.dbReadyPromise=new st(function(E){m.dbReadyResolve=E}),m.openCanceller=new st(function(E,A){m.cancelOpen=A}))},as.prototype.close=function(E){var y=(E===void 0?{disableAutoOpen:!0}:E).disableAutoOpen,E=this._state;y?(E.isBeingOpened&&E.cancelOpen(new W.DatabaseClosed),this._close(),E.autoOpen=!1,E.dbOpenError=new W.DatabaseClosed):(this._close(),E.autoOpen=this._options.autoOpen||E.isBeingOpened,E.openComplete=!1,E.dbOpenError=null)},as.prototype.delete=function(m){var y=this;m===void 0&&(m={disableAutoOpen:!0});var E=0<arguments.length&&typeof arguments[0]!="object",A=this._state;return new st(function(L,z){function se(){y.close(m);var ue=y._deps.indexedDB.deleteDatabase(y.name);ue.onsuccess=kn(function(){var Ce,_e,Te;Ce=y._deps,_e=y.name,Te=Ce.indexedDB,Ce=Ce.IDBKeyRange,B_(Te)||_e===Py||V_(Te,Ce).delete(_e).catch(Ie),L()}),ue.onerror=Ar(z),ue.onblocked=y._fireOnBlocked}if(E)throw new W.InvalidArgument("Invalid closeOptions argument to db.delete()");A.isBeingOpened?A.dbReadyPromise.then(se):se()})},as.prototype.backendDB=function(){return this.idbdb},as.prototype.isOpen=function(){return this.idbdb!==null},as.prototype.hasBeenClosed=function(){var m=this._state.dbOpenError;return m&&m.name==="DatabaseClosed"},as.prototype.hasFailed=function(){return this._state.dbOpenError!==null},as.prototype.dynamicallyOpened=function(){return this._state.autoSchema},Object.defineProperty(as.prototype,"tables",{get:function(){var m=this;return r(this._allTables).map(function(y){return m._allTables[y]})},enumerable:!1,configurable:!0}),as.prototype.transaction=function(){var m=(function(y,E,A){var L=arguments.length;if(L<2)throw new W.InvalidArgument("Too few arguments");for(var z=new Array(L-1);--L;)z[L-1]=arguments[L];return A=z.pop(),[y,P(z),A]}).apply(this,arguments);return this._transaction.apply(this,m)},as.prototype._transaction=function(m,y,E){var A=this,L=je.trans;L&&L.db===this&&m.indexOf("!")===-1||(L=null);var z,se,ue=m.indexOf("?")!==-1;m=m.replace("!","").replace("?","");try{if(se=y.map(function(_e){if(_e=_e instanceof A.Table?_e.name:_e,typeof _e!="string")throw new TypeError("Invalid table argument to Dexie.transaction(). Only Table or String are allowed");return _e}),m=="r"||m===D_)z=D_;else{if(m!="rw"&&m!=T_)throw new W.InvalidArgument("Invalid transaction mode: "+m);z=T_}if(L){if(L.mode===D_&&z===T_){if(!ue)throw new W.SubTransaction("Cannot enter a sub-transaction with READWRITE mode when parent transaction is READONLY");L=null}L&&se.forEach(function(_e){if(L&&L.storeNames.indexOf(_e)===-1){if(!ue)throw new W.SubTransaction("Table "+_e+" not included in parent transaction.");L=null}}),ue&&L&&!L.active&&(L=null)}}catch(_e){return L?L._promise(null,function(Te,he){he(_e)}):Kn(_e)}var Ce=(function _e(Te,he,Fe,be,De){return st.resolve().then(function(){var xe=je.transless||je,Re=Te._createTransaction(he,Fe,Te._dbSchema,be);if(Re.explicit=!0,xe={trans:Re,transless:xe},be)Re.idbtrans=be.idbtrans;else try{Re.create(),Re.idbtrans._explicit=!0,Te._state.PR1398_maxLoop=3}catch(He){return He.name===ae.InvalidState&&Te.isOpen()&&0<--Te._state.PR1398_maxLoop?(console.warn("Dexie: Need to reopen db"),Te.close({disableAutoOpen:!1}),Te.open().then(function(){return _e(Te,he,Fe,null,De)})):Kn(He)}var Me,$e=te(De);return $e&&Ye(),xe=st.follow(function(){var He;(Me=De.call(Re,Re))&&($e?(He=jt.bind(null,null),Me.then(He,He)):typeof Me.next=="function"&&typeof Me.throw=="function"&&(Me=j_(Me)))},xe),(Me&&typeof Me.then=="function"?st.resolve(Me).then(function(He){return Re.active?He:Kn(new W.PrematureCommit("Transaction committed too early. See http://bit.ly/2kdckMn"))}):xe.then(function(){return Me})).then(function(He){return be&&Re._resolve(),Re._completion.then(function(){return He})}).catch(function(He){return Re._reject(He),Kn(He)})})}).bind(null,this,z,se,L,E);return L?L._promise(z,Ce,"lock"):je.trans?Co(je.transless,function(){return A._whenReady(Ce)}):this._whenReady(Ce)},as.prototype.table=function(m){if(!d(this._allTables,m))throw new W.InvalidTable("Table ".concat(m," does not exist"));return this._allTables[m]},as);function as(m,y){var E=this;this._middlewares={},this.verno=0;var A=as.dependencies;this._options=y=s({addons:as.addons,autoOpen:!0,indexedDB:A.indexedDB,IDBKeyRange:A.IDBKeyRange,cache:"cloned"},y),this._deps={indexedDB:y.indexedDB,IDBKeyRange:y.IDBKeyRange},A=y.addons,this._dbSchema={},this._versions=[],this._storeNames=[],this._allTables={},this.idbdb=null,this._novip=this;var L,z,se,ue,Ce,_e={dbOpenError:null,isBeingOpened:!1,onReadyBeingFired:null,openComplete:!1,dbReadyResolve:Ie,dbReadyPromise:null,cancelOpen:Ie,openCanceller:null,autoSchema:!0,PR1398_maxLoop:3,autoOpen:y.autoOpen};_e.dbReadyPromise=new st(function(he){_e.dbReadyResolve=he}),_e.openCanceller=new st(function(he,Fe){_e.cancelOpen=Fe}),this._state=_e,this.name=m,this.on=yp(this,"populate","blocked","versionchange","close",{ready:[M,Ie]}),this.on.ready.subscribe=b(this.on.ready.subscribe,function(he){return function(Fe,be){as.vip(function(){var De,xe=E._state;xe.openComplete?(xe.dbOpenError||st.resolve().then(Fe),be&&he(Fe)):xe.onReadyBeingFired?(xe.onReadyBeingFired.push(Fe),be&&he(Fe)):(he(Fe),De=E,be||he(function Re(){De.on.ready.unsubscribe(Fe),De.on.ready.unsubscribe(Re)}))})}}),this.Collection=(L=this,wp(sbe.prototype,function(Me,Re){this.db=L;var be=VB,De=null;if(Re)try{be=Re()}catch($e){De=$e}var xe=Me._ctx,Re=xe.table,Me=Re.hook.reading.fire;this._ctx={table:Re,index:xe.index,isPrimKey:!xe.index||Re.schema.primKey.keyPath&&xe.index===Re.schema.primKey.name,range:be,keysOnly:!1,dir:"next",unique:"",algorithm:null,filter:null,replayFilter:null,justLimit:!0,isMatch:null,offset:0,limit:1/0,error:De,or:xe.or,valueMapper:Me!==G?Me:null}})),this.Table=(z=this,wp(GB.prototype,function(he,Fe,be){this.db=z,this._tx=be,this.name=he,this.schema=Fe,this.hook=z._allTables[he]?z._allTables[he].hook:yp(null,{creating:[ke,Ie],reading:[Z,G],updating:[Le,Ie],deleting:[Pe,Ie]})})),this.Transaction=(se=this,wp(rbe.prototype,function(he,Fe,be,De,xe){var Re=this;this.db=se,this.mode=he,this.storeNames=Fe,this.schema=be,this.chromeTransactionDurability=De,this.idbtrans=null,this.on=yp(this,"complete","error","abort"),this.parent=xe||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 st(function(Me,$e){Re._resolve=Me,Re._reject=$e}),this._completion.then(function(){Re.active=!1,Re.on.complete.fire()},function(Me){var $e=Re.active;return Re.active=!1,Re.on.error.fire(Me),Re.parent?Re.parent._reject(Me):$e&&Re.idbtrans&&Re.idbtrans.abort(),Kn(Me)})})),this.Version=(ue=this,wp(fbe.prototype,function(he){this.db=ue,this._cfg={version:he,storesSource:null,dbschema:{},tables:{},contentUpgrade:null}})),this.WhereClause=(Ce=this,wp(KB.prototype,function(he,Fe,be){if(this.db=Ce,this._ctx={table:he,index:Fe===":id"?null:Fe,or:be},this._cmp=this._ascending=ln,this._descending=function(De,xe){return ln(xe,De)},this._max=function(De,xe){return 0<ln(De,xe)?De:xe},this._min=function(De,xe){return ln(De,xe)<0?De:xe},this._IDBKeyRange=Ce._deps.IDBKeyRange,!this._IDBKeyRange)throw new W.MissingAPI})),this.on("versionchange",function(he){0<he.newVersion?console.warn("Another connection wants to upgrade database '".concat(E.name,"'. Closing db now to resume the upgrade.")):console.warn("Another connection wants to delete database '".concat(E.name,"'. Closing db now to resume the delete request.")),E.close({disableAutoOpen:!1})}),this.on("blocked",function(he){!he.newVersion||he.newVersion<he.oldVersion?console.warn("Dexie.delete('".concat(E.name,"') was blocked")):console.warn("Upgrade '".concat(E.name,"' blocked by other connection holding version ").concat(he.oldVersion/10))}),this._maxKey=Ep(y.IDBKeyRange),this._createTransaction=function(he,Fe,be,De){return new E.Transaction(he,Fe,be,E._options.chromeTransactionDurability,De)},this._fireOnBlocked=function(he){E.on("blocked").fire(he),Md.filter(function(Fe){return Fe.name===E.name&&Fe!==E&&!Fe._state.vcFired}).map(function(Fe){return Fe.on("versionchange").fire(he)})},this.use(vbe),this.use(bbe),this.use(ybe),this.use(gbe),this.use(mbe);var Te=new Proxy(this,{get:function(he,Fe,be){if(Fe==="_vip")return!0;if(Fe==="table")return function(xe){return jy(E.table(xe),Te)};var De=Reflect.get(he,Fe,be);return De instanceof GB?jy(De,Te):Fe==="tables"?De.map(function(xe){return jy(xe,Te)}):Fe==="_createTransaction"?function(){return jy(De.apply(this,arguments),Te)}:De}});this.vip=Te,A.forEach(function(he){return he(E)})}var Ky,mi=typeof Symbol<"u"&&"observable"in Symbol?Symbol.observable:"@@observable",Sbe=(Z_.prototype.subscribe=function(m,y,E){return this._subscribe(m&&typeof m!="function"?m:{next:m,error:y,complete:E})},Z_.prototype[mi]=function(){return this},Z_);function Z_(m){this._subscribe=m}try{Ky={indexedDB:i.indexedDB||i.mozIndexedDB||i.webkitIndexedDB||i.msIndexedDB,IDBKeyRange:i.IDBKeyRange||i.webkitIDBKeyRange}}catch{Ky={indexedDB:null,IDBKeyRange:null}}function l$(m){var y,E=!1,A=new Sbe(function(L){var z=te(m),se,ue=!1,Ce={},_e={},Te={get closed(){return ue},unsubscribe:function(){ue||(ue=!0,se&&se.abort(),he&&vl.storagemutated.unsubscribe(be))}};L.start&&L.start(Te);var he=!1,Fe=function(){return Fy(De)},be=function(xe){Uy(Ce,xe),G_(_e,Ce)&&Fe()},De=function(){var xe,Re,Me;!ue&&Ky.indexedDB&&(Ce={},xe={},se&&se.abort(),se=new AbortController,Me=function($e){var He=xr();try{z&&Ye();var Ze=Ae(m,$e);return Ze=z?Ze.finally(jt):Ze}finally{He&&pi()}}(Re={subscr:xe,signal:se.signal,requery:Fe,querier:m,trans:null}),Promise.resolve(Me).then(function($e){E=!0,y=$e,ue||Re.signal.aborted||(Ce={},function(He){for(var Ze in He)if(d(He,Ze))return;return 1}(_e=xe)||he||(vl(Sp,be),he=!0),Fy(function(){return!ue&&L.next&&L.next($e)}))},function($e){E=!1,["DatabaseClosedError","AbortError"].includes($e==null?void 0:$e.name)||ue||Fy(function(){ue||L.error&&L.error($e)})}))};return setTimeout(Fe,0),Te});return A.hasValue=function(){return E},A.getValue=function(){return y},A}var Lu=Ca;function X_(m){var y=yl;try{yl=!0,vl.storagemutated.fire(m),z_(m,!0)}finally{yl=y}}h(Lu,s(s({},oe),{delete:function(m){return new Lu(m,{addons:[]}).delete()},exists:function(m){return new Lu(m,{addons:[]}).open().then(function(y){return y.close(),!0}).catch("NoSuchDatabaseError",function(){return!1})},getDatabaseNames:function(m){try{return y=Lu.dependencies,E=y.indexedDB,y=y.IDBKeyRange,(B_(E)?Promise.resolve(E.databases()).then(function(A){return A.map(function(L){return L.name}).filter(function(L){return L!==Py})}):V_(E,y).toCollection().primaryKeys()).then(m)}catch{return Kn(new W.MissingAPI)}var y,E},defineClass:function(){return function(m){l(this,m)}},ignoreTransaction:function(m){return je.trans?Co(je.transless,m):m()},vip:$_,async:function(m){return function(){try{var y=j_(m.apply(this,arguments));return y&&typeof y.then=="function"?y:st.resolve(y)}catch(E){return Kn(E)}}},spawn:function(m,y,E){try{var A=j_(m.apply(E,y||[]));return A&&typeof A.then=="function"?A:st.resolve(A)}catch(L){return Kn(L)}},currentTransaction:{get:function(){return je.trans||null}},waitFor:function(m,y){return y=st.resolve(typeof m=="function"?Lu.ignoreTransaction(m):m).timeout(y||6e4),je.trans?je.trans.waitFor(y):y},Promise:st,debug:{get:function(){return H},set:function(m){le(m)}},derive:g,extend:l,props:h,override:b,Events:yp,on:vl,liveQuery:l$,extendObservabilitySet:Uy,getByKeyPath:R,setByKeyPath:T,delByKeyPath:function(m,y){typeof y=="string"?T(m,y,void 0):"length"in y&&[].map.call(y,function(E){T(m,E,void 0)})},shallowClone:I,deepClone:k,getObjectDiff:K_,cmp:ln,asap:_,minKey:-1/0,addons:[],connections:Md,errnames:ae,dependencies:Ky,cache:Nu,semVer:"4.0.10",version:"4.0.10".split(".").map(function(m){return parseInt(m)}).reduce(function(m,y,E){return m+y/Math.pow(10,2*E)})})),Lu.maxKey=Ep(Lu.dependencies.IDBKeyRange),typeof dispatchEvent<"u"&&typeof addEventListener<"u"&&(vl(Sp,function(m){yl||(m=new CustomEvent(P_,{detail:m}),yl=!0,dispatchEvent(m),yl=!1)}),addEventListener(P_,function(m){m=m.detail,yl||X_(m)}));var Vd,yl=!1,u$=function(){};return typeof BroadcastChannel<"u"&&((u$=function(){(Vd=new BroadcastChannel(P_)).onmessage=function(m){return m.data&&X_(m.data)}})(),typeof Vd.unref=="function"&&Vd.unref(),vl(Sp,function(m){yl||Vd.postMessage(m)})),typeof addEventListener<"u"&&(addEventListener("pagehide",function(m){if(!Ca.disableBfCache&&m.persisted){H&&console.debug("Dexie: handling persisted pagehide"),Vd!=null&&Vd.close();for(var y=0,E=Md;y<E.length;y++)E[y].close({disableAutoOpen:!1})}}),addEventListener("pageshow",function(m){!Ca.disableBfCache&&m.persisted&&(H&&console.debug("Dexie: handling persisted pageshow"),u$(),X_({all:new Ks(-1/0,[[]])}))})),st.rejectionMapper=function(m,y){return!m||m instanceof V||m instanceof TypeError||m instanceof SyntaxError||!m.name||!fe[m.name]?m:(y=new fe[m.name](y||m.message,m),"stack"in m&&p(y,"stack",{get:function(){return this.inner.stack}}),y)},le(H),s(Ca,Object.freeze({__proto__:null,Dexie:Ca,liveQuery:l$,Entity:BB,cmp:ln,PropModSymbol:wa,PropModification:Cp,replacePrefix:function(m,y){return new Cp({replacePrefix:[m,y]})},add:function(m){return new Cp({add:m})},remove:function(m){return new Cp({remove:m})},default:Ca,RangeSet:Ks,mergeRanges:Dp,rangesOverlap:JB}),{default:Ca}),Ca})})(B1);var $z=B1.exports;const bC=Bz($z),$1=Symbol.for("Dexie"),Rh=globalThis[$1]||(globalThis[$1]=bC);if(bC.semVer!==Rh.semVer)throw new Error(`Two different versions of Dexie loaded in the same app: ${bC.semVer} and ${Rh.semVer}`);const{liveQuery:Lbe,mergeRanges:Vbe,rangesOverlap:Bbe,RangeSet:$be,cmp:Hbe,Entity:Gbe,PropModSymbol:Ube,PropModification:Wbe,replacePrefix:zbe,add:jbe,remove:Kbe}=Rh;class H1 extends Rh{constructor(n){super(n);es(this,"icons");es(this,"visuals");es(this,"users");es(this,"columns");es(this,"general");this.version(1).stores({icons:"key",visuals:"key",users:"key",columns:"key",general:"key"})}getTable(n){return this[n]?this[n]:this.general}}const Ag=new Map,Hz=async e=>{if(!Ag.has(e)){const t=new H1(e);try{await t.open(),Ag.set(e,t)}catch(n){console.error("Failed to open database, attempting to delete and recreate:",n);try{await Rh.delete(e);const s=new H1(e);await s.open(),Ag.set(e,s)}catch(s){throw console.error("Failed to delete and recreate database:",s),s}}}return Ag.get(e)},Dh=({dbName:e,storeName:t})=>{const n=async()=>(await Hz(e)).getTable(t);return{getCachedValue:async u=>{try{const c=await n();if(!c){console.error(`Store is undefined for key: ${u}`);return}const d=await c.get(u);return d==null?void 0:d.value}catch(c){console.error("Failed to get cached value:",c);return}},setCachedValue:async(u,c)=>{try{const d=await n();if(!d){console.error(`Store is undefined, cannot cache key: ${u}`);return}await d.put({key:u,value:c,timestamp:Date.now()})}catch(d){console.error("Failed to cache value:",d)}},deleteCachedValue:async u=>{try{const c=await n();if(!c){console.error(`Store is undefined, cannot delete key: ${u}`);return}await c.delete(u)}catch(c){console.error("Failed to delete cached value:",c)}},clearCache:async()=>{try{const u=await n();if(!u){console.error("Store is undefined, cannot clear cache");return}await u.clear()}catch(u){console.error("Failed to clear cache:",u)}},getAllKeys:async()=>{try{const u=await n();return u?(await u.toArray()).map(d=>d.key):(console.error("Store is undefined, cannot get all keys"),[])}catch(u){return console.error("Failed to get all keys:",u),[]}},getCachedValueWithTimestamp:async u=>{try{const c=await n();if(!c){console.error(`Store is undefined for key: ${u}`);return}return await c.get(u)}catch(c){console.error("Failed to get cached value with timestamp:",c);return}}}},Gz="AvatarCache",Uz="images",Bl={},kg={},Wz=()=>{const{getCachedValue:e,setCachedValue:t}=Dh({dbName:Gz,storeName:Uz}),n=a=>new Promise((l,u)=>{const c=new FileReader;c.onloadend=()=>l(c.result),c.onerror=u,c.readAsDataURL(a)}),s=async a=>{try{if(Bl[a])return Bl[a];if(kg[a])return await kg[a];const l=(async()=>{try{const u=await e(a);if(!u||!(u instanceof Blob))return null;const c=await n(u);return Bl[a]=c,c}catch(u){return console.warn(`Failed to get cached image for key: ${a}`,u),null}})();return kg[a]=l,l.finally(()=>{delete kg[a]}),await l}catch(l){return console.error(`Error in getCachedImage for key: ${a}`,l),null}},o=a=>new Promise((l,u)=>{new Vz(a,{width:96,height:96,quality:1,success(c){l(c)},error(c){console.error("Image compression failed:",c.message),u(c)}})});return{getCachedImage:s,setCachedImage:async(a,l)=>{try{const u=await o(l);await t(a,u);const c=await n(u);Bl[a]=c}catch(u){throw console.error(`Failed to cache image for key: ${a}`,u),u}},clearMemoryCache:a=>{try{a?delete Bl[a]:Object.keys(Bl).forEach(l=>delete Bl[l])}catch(l){console.error("Error clearing memory cache:",l)}}}},Th=new Map,sr=new Map,ic=new Map,zz=5*60*1e3,G1=100;function jz(){const e=Date.now(),t=[];ic.forEach((n,s)=>{e-n>zz&&t.push(s)}),t.forEach(n=>{Th.delete(n),ic.delete(n),sr.delete(n)})}function Kz(){if(ic.size<=G1)return;const e=Array.from(ic.entries()).sort((n,s)=>n[1]-s[1]);e.slice(0,e.length-G1).forEach(([n])=>{Th.delete(n),ic.delete(n),sr.delete(n)})}const qz=(e,t)=>{const n=sr.get(e);return n==null||n.forEach(s=>s(t)),sr.delete(e),t};async function Yz({userId:e,avatarUrl:t,cacheInterface:n,onLoadingChange:s}){let o=e;if(t)try{const d=new URL(t,"http://localhost").pathname.split("/").pop();d?o=`${e}_${d}`:o=t}catch{o=t||e}const i=await n.getCachedImage(o),r=Th.has(o),a=sr.has(o);if(i)return qz(o,i);if(jz(),r)return new Promise(c=>{a||sr.set(o,[]),sr.get(o).push(c)});const l=(async()=>{let c=null,d=null;try{const h=Math.random()*300;await new Promise(p=>setTimeout(p,h)),s==null||s(!0);const f=await fetch(t,{cache:"no-cache"});if(!f.ok)throw new Error("Failed to fetch image");return c=await f.blob(),await n.setCachedImage(o,c),d=URL.createObjectURL(c),d}catch(h){throw console.error("Error loading avatar image:",h),h}finally{c=null,s==null||s(!1),ic.set(o,Date.now()),setTimeout(()=>{Th.delete(o),Kz()},100)}})();Th.set(o,l);const u=await l;return sr.has(o)&&(sr.get(o).forEach(d=>d(u)),sr.delete(o)),u}const Zz=(e,t=3,n=1e3)=>{const s=B(0),o=B(!1),i=B(!1),r=async()=>{try{await e()}catch(a){if(s.value<t)return s.value++,i.value=!0,await new Promise(l=>setTimeout(l,n)),r();throw o.value=!0,a}};return{retry:r,currentAttempt:s,errorRetry:o,isRetrying:i}};function xs(e,t){Xz(e)&&(e="100%");const n=Jz(e);return e=t===360?e:Math.min(t,Math.max(0,parseFloat(e))),n&&(e=parseInt(String(e*t),10)/100),Math.abs(e-t)<1e-6?1:(t===360?e=(e<0?e%t+t:e%t)/parseFloat(String(t)):e=e%t/parseFloat(String(t)),e)}function Og(e){return Math.min(1,Math.max(0,e))}function Xz(e){return typeof e=="string"&&e.indexOf(".")!==-1&&parseFloat(e)===1}function Jz(e){return typeof e=="string"&&e.indexOf("%")!==-1}function U1(e){return e=parseFloat(e),(isNaN(e)||e<0||e>1)&&(e=1),e}function Mg(e){return Number(e)<=1?`${Number(e)*100}%`:e}function $l(e){return e.length===1?"0"+e:String(e)}function Qz(e,t,n){return{r:xs(e,255)*255,g:xs(t,255)*255,b:xs(n,255)*255}}function W1(e,t,n){e=xs(e,255),t=xs(t,255),n=xs(n,255);const s=Math.max(e,t,n),o=Math.min(e,t,n);let i=0,r=0;const a=(s+o)/2;if(s===o)r=0,i=0;else{const l=s-o;switch(r=a>.5?l/(2-s-o):l/(s+o),s){case e:i=(t-n)/l+(t<n?6:0);break;case t:i=(n-e)/l+2;break;case n:i=(e-t)/l+4;break}i/=6}return{h:i,s:r,l:a}}function SC(e,t,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?e+(t-e)*(6*n):n<1/2?t:n<2/3?e+(t-e)*(2/3-n)*6:e}function e3(e,t,n){let s,o,i;if(e=xs(e,360),t=xs(t,100),n=xs(n,100),t===0)o=n,i=n,s=n;else{const r=n<.5?n*(1+t):n+t-n*t,a=2*n-r;s=SC(a,r,e+1/3),o=SC(a,r,e),i=SC(a,r,e-1/3)}return{r:s*255,g:o*255,b:i*255}}function z1(e,t,n){e=xs(e,255),t=xs(t,255),n=xs(n,255);const s=Math.max(e,t,n),o=Math.min(e,t,n);let i=0;const r=s,a=s-o,l=s===0?0:a/s;if(s===o)i=0;else{switch(s){case e:i=(t-n)/a+(t<n?6:0);break;case t:i=(n-e)/a+2;break;case n:i=(e-t)/a+4;break}i/=6}return{h:i,s:l,v:r}}function t3(e,t,n){e=xs(e,360)*6,t=xs(t,100),n=xs(n,100);const s=Math.floor(e),o=e-s,i=n*(1-t),r=n*(1-o*t),a=n*(1-(1-o)*t),l=s%6,u=[n,r,i,i,a,n][l],c=[a,n,n,r,i,i][l],d=[i,i,a,n,n,r][l];return{r:u*255,g:c*255,b:d*255}}function j1(e,t,n,s){const o=[$l(Math.round(e).toString(16)),$l(Math.round(t).toString(16)),$l(Math.round(n).toString(16))];return s&&o[0].startsWith(o[0].charAt(1))&&o[1].startsWith(o[1].charAt(1))&&o[2].startsWith(o[2].charAt(1))?o[0].charAt(0)+o[1].charAt(0)+o[2].charAt(0):o.join("")}function n3(e,t,n,s,o){const i=[$l(Math.round(e).toString(16)),$l(Math.round(t).toString(16)),$l(Math.round(n).toString(16)),$l(o3(s))];return o&&i[0].startsWith(i[0].charAt(1))&&i[1].startsWith(i[1].charAt(1))&&i[2].startsWith(i[2].charAt(1))&&i[3].startsWith(i[3].charAt(1))?i[0].charAt(0)+i[1].charAt(0)+i[2].charAt(0)+i[3].charAt(0):i.join("")}function s3(e,t,n,s){const o=e/100,i=t/100,r=n/100,a=s/100,l=255*(1-o)*(1-a),u=255*(1-i)*(1-a),c=255*(1-r)*(1-a);return{r:l,g:u,b:c}}function K1(e,t,n){let s=1-e/255,o=1-t/255,i=1-n/255,r=Math.min(s,o,i);return r===1?(s=0,o=0,i=0):(s=(s-r)/(1-r)*100,o=(o-r)/(1-r)*100,i=(i-r)/(1-r)*100),r*=100,{c:Math.round(s),m:Math.round(o),y:Math.round(i),k:Math.round(r)}}function o3(e){return Math.round(parseFloat(e)*255).toString(16)}function q1(e){return Fo(e)/255}function Fo(e){return parseInt(e,16)}function i3(e){return{r:e>>16,g:(e&65280)>>8,b:e&255}}const EC={aliceblue:"#f0f8ff",antiquewhite:"#faebd7",aqua:"#00ffff",aquamarine:"#7fffd4",azure:"#f0ffff",beige:"#f5f5dc",bisque:"#ffe4c4",black:"#000000",blanchedalmond:"#ffebcd",blue:"#0000ff",blueviolet:"#8a2be2",brown:"#a52a2a",burlywood:"#deb887",cadetblue:"#5f9ea0",chartreuse:"#7fff00",chocolate:"#d2691e",coral:"#ff7f50",cornflowerblue:"#6495ed",cornsilk:"#fff8dc",crimson:"#dc143c",cyan:"#00ffff",darkblue:"#00008b",darkcyan:"#008b8b",darkgoldenrod:"#b8860b",darkgray:"#a9a9a9",darkgreen:"#006400",darkgrey:"#a9a9a9",darkkhaki:"#bdb76b",darkmagenta:"#8b008b",darkolivegreen:"#556b2f",darkorange:"#ff8c00",darkorchid:"#9932cc",darkred:"#8b0000",darksalmon:"#e9967a",darkseagreen:"#8fbc8f",darkslateblue:"#483d8b",darkslategray:"#2f4f4f",darkslategrey:"#2f4f4f",darkturquoise:"#00ced1",darkviolet:"#9400d3",deeppink:"#ff1493",deepskyblue:"#00bfff",dimgray:"#696969",dimgrey:"#696969",dodgerblue:"#1e90ff",firebrick:"#b22222",floralwhite:"#fffaf0",forestgreen:"#228b22",fuchsia:"#ff00ff",gainsboro:"#dcdcdc",ghostwhite:"#f8f8ff",goldenrod:"#daa520",gold:"#ffd700",gray:"#808080",green:"#008000",greenyellow:"#adff2f",grey:"#808080",honeydew:"#f0fff0",hotpink:"#ff69b4",indianred:"#cd5c5c",indigo:"#4b0082",ivory:"#fffff0",khaki:"#f0e68c",lavenderblush:"#fff0f5",lavender:"#e6e6fa",lawngreen:"#7cfc00",lemonchiffon:"#fffacd",lightblue:"#add8e6",lightcoral:"#f08080",lightcyan:"#e0ffff",lightgoldenrodyellow:"#fafad2",lightgray:"#d3d3d3",lightgreen:"#90ee90",lightgrey:"#d3d3d3",lightpink:"#ffb6c1",lightsalmon:"#ffa07a",lightseagreen:"#20b2aa",lightskyblue:"#87cefa",lightslategray:"#778899",lightslategrey:"#778899",lightsteelblue:"#b0c4de",lightyellow:"#ffffe0",lime:"#00ff00",limegreen:"#32cd32",linen:"#faf0e6",magenta:"#ff00ff",maroon:"#800000",mediumaquamarine:"#66cdaa",mediumblue:"#0000cd",mediumorchid:"#ba55d3",mediumpurple:"#9370db",mediumseagreen:"#3cb371",mediumslateblue:"#7b68ee",mediumspringgreen:"#00fa9a",mediumturquoise:"#48d1cc",mediumvioletred:"#c71585",midnightblue:"#191970",mintcream:"#f5fffa",mistyrose:"#ffe4e1",moccasin:"#ffe4b5",navajowhite:"#ffdead",navy:"#000080",oldlace:"#fdf5e6",olive:"#808000",olivedrab:"#6b8e23",orange:"#ffa500",orangered:"#ff4500",orchid:"#da70d6",palegoldenrod:"#eee8aa",palegreen:"#98fb98",paleturquoise:"#afeeee",palevioletred:"#db7093",papayawhip:"#ffefd5",peachpuff:"#ffdab9",peru:"#cd853f",pink:"#ffc0cb",plum:"#dda0dd",powderblue:"#b0e0e6",purple:"#800080",rebeccapurple:"#663399",red:"#ff0000",rosybrown:"#bc8f8f",royalblue:"#4169e1",saddlebrown:"#8b4513",salmon:"#fa8072",sandybrown:"#f4a460",seagreen:"#2e8b57",seashell:"#fff5ee",sienna:"#a0522d",silver:"#c0c0c0",skyblue:"#87ceeb",slateblue:"#6a5acd",slategray:"#708090",slategrey:"#708090",snow:"#fffafa",springgreen:"#00ff7f",steelblue:"#4682b4",tan:"#d2b48c",teal:"#008080",thistle:"#d8bfd8",tomato:"#ff6347",turquoise:"#40e0d0",violet:"#ee82ee",wheat:"#f5deb3",white:"#ffffff",whitesmoke:"#f5f5f5",yellow:"#ffff00",yellowgreen:"#9acd32"};function r3(e){let t={r:0,g:0,b:0},n=1,s=null,o=null,i=null,r=!1,a=!1;return typeof e=="string"&&(e=a3(e)),typeof e=="object"&&(Po(e.r)&&Po(e.g)&&Po(e.b)?(t=Qz(e.r,e.g,e.b),r=!0,a=String(e.r).substr(-1)==="%"?"prgb":"rgb"):Po(e.h)&&Po(e.s)&&Po(e.v)?(s=Mg(e.s),o=Mg(e.v),t=t3(e.h,s,o),r=!0,a="hsv"):Po(e.h)&&Po(e.s)&&Po(e.l)?(s=Mg(e.s),i=Mg(e.l),t=e3(e.h,s,i),r=!0,a="hsl"):Po(e.c)&&Po(e.m)&&Po(e.y)&&Po(e.k)&&(t=s3(e.c,e.m,e.y,e.k),r=!0,a="cmyk"),Object.prototype.hasOwnProperty.call(e,"a")&&(n=e.a)),n=U1(n),{ok:r,format:e.format||a,r:Math.min(255,Math.max(t.r,0)),g:Math.min(255,Math.max(t.g,0)),b:Math.min(255,Math.max(t.b,0)),a:n}}const ka="(?:"+"[-\\+]?\\d*\\.\\d+%?"+")|(?:"+"[-\\+]?\\d+%?"+")",_C="[\\s|\\(]+("+ka+")[,|\\s]+("+ka+")[,|\\s]+("+ka+")\\s*\\)?",Ng="[\\s|\\(]+("+ka+")[,|\\s]+("+ka+")[,|\\s]+("+ka+")[,|\\s]+("+ka+")\\s*\\)?",Zo={CSS_UNIT:new RegExp(ka),rgb:new RegExp("rgb"+_C),rgba:new RegExp("rgba"+Ng),hsl:new RegExp("hsl"+_C),hsla:new RegExp("hsla"+Ng),hsv:new RegExp("hsv"+_C),hsva:new RegExp("hsva"+Ng),cmyk:new RegExp("cmyk"+Ng),hex3:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex6:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/,hex4:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex8:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/};function a3(e){if(e=e.trim().toLowerCase(),e.length===0)return!1;let t=!1;if(EC[e])e=EC[e],t=!0;else if(e==="transparent")return{r:0,g:0,b:0,a:0,format:"name"};let n=Zo.rgb.exec(e);return n?{r:n[1],g:n[2],b:n[3]}:(n=Zo.rgba.exec(e),n?{r:n[1],g:n[2],b:n[3],a:n[4]}:(n=Zo.hsl.exec(e),n?{h:n[1],s:n[2],l:n[3]}:(n=Zo.hsla.exec(e),n?{h:n[1],s:n[2],l:n[3],a:n[4]}:(n=Zo.hsv.exec(e),n?{h:n[1],s:n[2],v:n[3]}:(n=Zo.hsva.exec(e),n?{h:n[1],s:n[2],v:n[3],a:n[4]}:(n=Zo.cmyk.exec(e),n?{c:n[1],m:n[2],y:n[3],k:n[4]}:(n=Zo.hex8.exec(e),n?{r:Fo(n[1]),g:Fo(n[2]),b:Fo(n[3]),a:q1(n[4]),format:t?"name":"hex8"}:(n=Zo.hex6.exec(e),n?{r:Fo(n[1]),g:Fo(n[2]),b:Fo(n[3]),format:t?"name":"hex"}:(n=Zo.hex4.exec(e),n?{r:Fo(n[1]+n[1]),g:Fo(n[2]+n[2]),b:Fo(n[3]+n[3]),a:q1(n[4]+n[4]),format:t?"name":"hex8"}:(n=Zo.hex3.exec(e),n?{r:Fo(n[1]+n[1]),g:Fo(n[2]+n[2]),b:Fo(n[3]+n[3]),format:t?"name":"hex"}:!1))))))))))}function Po(e){return typeof e=="number"?!Number.isNaN(e):Zo.CSS_UNIT.test(e)}class Nn{constructor(t="",n={}){if(t instanceof Nn)return t;typeof t=="number"&&(t=i3(t)),this.originalInput=t;const s=r3(t);this.originalInput=t,this.r=s.r,this.g=s.g,this.b=s.b,this.a=s.a,this.roundA=Math.round(100*this.a)/100,this.format=n.format??s.format,this.gradientType=n.gradientType,this.r<1&&(this.r=Math.round(this.r)),this.g<1&&(this.g=Math.round(this.g)),this.b<1&&(this.b=Math.round(this.b)),this.isValid=s.ok}isDark(){return this.getBrightness()<128}isLight(){return!this.isDark()}getBrightness(){const t=this.toRgb();return(t.r*299+t.g*587+t.b*114)/1e3}getLuminance(){const t=this.toRgb();let n,s,o;const i=t.r/255,r=t.g/255,a=t.b/255;return i<=.03928?n=i/12.92:n=Math.pow((i+.055)/1.055,2.4),r<=.03928?s=r/12.92:s=Math.pow((r+.055)/1.055,2.4),a<=.03928?o=a/12.92:o=Math.pow((a+.055)/1.055,2.4),.2126*n+.7152*s+.0722*o}getAlpha(){return this.a}setAlpha(t){return this.a=U1(t),this.roundA=Math.round(100*this.a)/100,this}isMonochrome(){const{s:t}=this.toHsl();return t===0}toHsv(){const t=z1(this.r,this.g,this.b);return{h:t.h*360,s:t.s,v:t.v,a:this.a}}toHsvString(){const t=z1(this.r,this.g,this.b),n=Math.round(t.h*360),s=Math.round(t.s*100),o=Math.round(t.v*100);return this.a===1?`hsv(${n}, ${s}%, ${o}%)`:`hsva(${n}, ${s}%, ${o}%, ${this.roundA})`}toHsl(){const t=W1(this.r,this.g,this.b);return{h:t.h*360,s:t.s,l:t.l,a:this.a}}toHslString(){const t=W1(this.r,this.g,this.b),n=Math.round(t.h*360),s=Math.round(t.s*100),o=Math.round(t.l*100);return this.a===1?`hsl(${n}, ${s}%, ${o}%)`:`hsla(${n}, ${s}%, ${o}%, ${this.roundA})`}toHex(t=!1){return j1(this.r,this.g,this.b,t)}toHexString(t=!1){return"#"+this.toHex(t)}toHex8(t=!1){return n3(this.r,this.g,this.b,this.a,t)}toHex8String(t=!1){return"#"+this.toHex8(t)}toHexShortString(t=!1){return this.a===1?this.toHexString(t):this.toHex8String(t)}toRgb(){return{r:Math.round(this.r),g:Math.round(this.g),b:Math.round(this.b),a:this.a}}toRgbString(){const t=Math.round(this.r),n=Math.round(this.g),s=Math.round(this.b);return this.a===1?`rgb(${t}, ${n}, ${s})`:`rgba(${t}, ${n}, ${s}, ${this.roundA})`}toPercentageRgb(){const t=n=>`${Math.round(xs(n,255)*100)}%`;return{r:t(this.r),g:t(this.g),b:t(this.b),a:this.a}}toPercentageRgbString(){const t=n=>Math.round(xs(n,255)*100);return this.a===1?`rgb(${t(this.r)}%, ${t(this.g)}%, ${t(this.b)}%)`:`rgba(${t(this.r)}%, ${t(this.g)}%, ${t(this.b)}%, ${this.roundA})`}toCmyk(){return{...K1(this.r,this.g,this.b)}}toCmykString(){const{c:t,m:n,y:s,k:o}=K1(this.r,this.g,this.b);return`cmyk(${t}, ${n}, ${s}, ${o})`}toName(){if(this.a===0)return"transparent";if(this.a<1)return!1;const t="#"+j1(this.r,this.g,this.b,!1);for(const[n,s]of Object.entries(EC))if(t===s)return n;return!1}toString(t){const n=!!t;t=t??this.format;let s=!1;const o=this.a<1&&this.a>=0;return!n&&o&&(t.startsWith("hex")||t==="name")?t==="name"&&this.a===0?this.toName():this.toRgbString():(t==="rgb"&&(s=this.toRgbString()),t==="prgb"&&(s=this.toPercentageRgbString()),(t==="hex"||t==="hex6")&&(s=this.toHexString()),t==="hex3"&&(s=this.toHexString(!0)),t==="hex4"&&(s=this.toHex8String(!0)),t==="hex8"&&(s=this.toHex8String()),t==="name"&&(s=this.toName()),t==="hsl"&&(s=this.toHslString()),t==="hsv"&&(s=this.toHsvString()),t==="cmyk"&&(s=this.toCmykString()),s||this.toHexString())}toNumber(){return(Math.round(this.r)<<16)+(Math.round(this.g)<<8)+Math.round(this.b)}clone(){return new Nn(this.toString())}lighten(t=10){const n=this.toHsl();return n.l+=t/100,n.l=Og(n.l),new Nn(n)}brighten(t=10){const n=this.toRgb();return n.r=Math.max(0,Math.min(255,n.r-Math.round(255*-(t/100)))),n.g=Math.max(0,Math.min(255,n.g-Math.round(255*-(t/100)))),n.b=Math.max(0,Math.min(255,n.b-Math.round(255*-(t/100)))),new Nn(n)}darken(t=10){const n=this.toHsl();return n.l-=t/100,n.l=Og(n.l),new Nn(n)}tint(t=10){return this.mix("white",t)}shade(t=10){return this.mix("black",t)}desaturate(t=10){const n=this.toHsl();return n.s-=t/100,n.s=Og(n.s),new Nn(n)}saturate(t=10){const n=this.toHsl();return n.s+=t/100,n.s=Og(n.s),new Nn(n)}greyscale(){return this.desaturate(100)}spin(t){const n=this.toHsl(),s=(n.h+t)%360;return n.h=s<0?360+s:s,new Nn(n)}mix(t,n=50){const s=this.toRgb(),o=new Nn(t).toRgb(),i=n/100,r={r:(o.r-s.r)*i+s.r,g:(o.g-s.g)*i+s.g,b:(o.b-s.b)*i+s.b,a:(o.a-s.a)*i+s.a};return new Nn(r)}analogous(t=6,n=30){const s=this.toHsl(),o=360/n,i=[this];for(s.h=(s.h-(o*t>>1)+720)%360;--t;)s.h=(s.h+o)%360,i.push(new Nn(s));return i}complement(){const t=this.toHsl();return t.h=(t.h+180)%360,new Nn(t)}monochromatic(t=6){const n=this.toHsv(),{h:s}=n,{s:o}=n;let{v:i}=n;const r=[],a=1/t;for(;t--;)r.push(new Nn({h:s,s:o,v:i})),i=(i+a)%1;return r}splitcomplement(){const t=this.toHsl(),{h:n}=t;return[this,new Nn({h:(n+72)%360,s:t.s,l:t.l}),new Nn({h:(n+216)%360,s:t.s,l:t.l})]}onBackground(t){const n=this.toRgb(),s=new Nn(t).toRgb(),o=n.a+s.a*(1-n.a);return new Nn({r:(n.r*n.a+s.r*s.a*(1-n.a))/o,g:(n.g*n.a+s.g*s.a*(1-n.a))/o,b:(n.b*n.a+s.b*s.a*(1-n.a))/o,a:o})}triad(){return this.polyad(3)}tetrad(){return this.polyad(4)}polyad(t){const n=this.toHsl(),{h:s}=n,o=[this],i=360/t;for(let r=1;r<t;r++)o.push(new Nn({h:(s+r*i)%360,s:n.s,l:n.l}));return o}equals(t){const n=new Nn(t);return this.format==="cmyk"||n.format==="cmyk"?this.toCmykString()===n.toCmykString():this.toRgbString()===n.toRgbString()}}function Y1(e){return new Nn(e||"").isValid}function Lg(e,t){const{c1:n,c2:s}={c1:new Nn(e),c2:new Nn(t)};return n.equals(s)}const l3=["src","alt"],Ih=_t(rt({__name:"Avatar",props:{name:{},id:{},profile_image:{},color:{},initial:{},isMe:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1},readOnly:{type:Boolean,default:!1},size:{default:24},isUseShortLabel:{type:Boolean,default:!0},borderRadius:{default:void 0}},setup(e){const t=e,n=B(""),s=B(!1),o=B(null),i=B(!1),r=Y(()=>({name:t.name||"",id:t.id||"",profile_image:t.profile_image||null,color:t.color||{bgColor:"#CCCCCC",textColor:"var(--background-color)"},initial:t.initial})),a=Y(()=>{var _;const w=((_=r.value.color)==null?void 0:_.bgColor)||"#CCCCCC";return Y1(w)?w:"#CCCCCC"}),l=Y(()=>{var _;const w=((_=r.value.color)==null?void 0:_.textColor)||"var(--background-color)";return Y1(w)?w:"var(--background-color)"}),u=Y(()=>{if(!t.isUseShortLabel)return"";const{initial:w,name:_}=r.value;if(typeof w=="string"&&w.trim())return w.trim();if(!(_!=null&&_.trim()))return"";const R=_.trim().split(/\s+/).filter(Boolean);return R.length===1?R[0].slice(0,2).toUpperCase():(R[0][0]+R[1][0]).toUpperCase()}),c=Y(()=>r.value.profile_image?"image":"text"),d=Y(()=>({"--avatar-size":`${t.size}px`,"--avatar-bg":a.value,"--avatar-border":t.isMe?"var(--primary-color)":"#f3f5f8","--text-color":l.value,"--font-size":`${Math.floor(t.size/2)}px`,"--border-radius":t.borderRadius?typeof t.borderRadius=="number"?`${t.borderRadius}px`:t.borderRadius:"4px"})),h=()=>{n.value="",i.value=!0},{getCachedImage:f,setCachedImage:p}=Wz(),g=async()=>{if(o.value&&o.value.abort(),n.value.startsWith("blob:")&&URL.revokeObjectURL(n.value),!r.value.id||!r.value.profile_image){n.value="";return}o.value=new AbortController;const w=o.value;try{const _=await Yz({userId:r.value.id,avatarUrl:r.value.profile_image,cacheInterface:{getCachedImage:f,setCachedImage:p},onLoadingChange:R=>{w.signal.aborted||(s.value=R)}});if(!w.signal.aborted&&(n.value=_,_.length===0))throw console.warn("Loaded avatar image is empty, displaying initials instead."),h(),new Error("Empty image source")}catch(_){w.signal.aborted||(console.error("Failed to load avatar:",_),n.value="")}},{retry:v,errorRetry:C,isRetrying:S}=Zz(g,3,2e3),b=nt(()=>[r.value.id,r.value.profile_image],v,{immediate:!0});return vs(()=>{b(),o.value&&(o.value.abort(),o.value=null),n.value.startsWith("blob:")&&URL.revokeObjectURL(n.value),n.value="",s.value=!1}),(w,_)=>(j(),ce("div",{class:Q([w.$style["avatar-wrapper"],{[w.$style.me]:e.isMe,[w.$style.loading]:s.value,[w.$style.disabled]:e.disabled,[w.$style.readOnly]:t.readOnly}]),style:dn(d.value)},[s.value||U(S)?(j(),ce("div",{key:0,class:Q(w.$style["skeleton-loader"])},null,2)):(j(),ce(xt,{key:1},[c.value==="text"||U(C)||i.value?(j(),ce("div",{key:0,class:Q(w.$style["short-label"])},wt(u.value),3)):n.value.length>0||r.value.profile_image?(j(),ce("img",{key:1,src:n.value||r.value.profile_image||"",alt:r.value.name||"Avatar",loading:"lazy"},null,8,l3)):Je("",!0)],64))],6))}}),[["__cssModules",{$style:{"avatar-wrapper":"_avatar-wrapper_1pd1f_1",me:"_me_1pd1f_17","short-label":"_short-label_1pd1f_20",action:"_action_1pd1f_38",loading:"_loading_1pd1f_56",disabled:"_disabled_1pd1f_59",readOnly:"_readOnly_1pd1f_62"}}]]),u3=["404","ClickChart","ClickToCreate","NoAccess1","NoActivity","NoAssignedComment","NoAssignedScene","NoComment","NoData","NoData2","NoRendition1","NoRendition2","PrivateComment","PrivateScene","ReportAchievement","ReportCompletedScenes","ReportInvolvement","ReportMetric","ReportOverdueScenes","ReportProfessionalName","ReportSceneAssignment","ReportSceneStatus","ReportSceneStatusType","Successful1","Unsuccessful1","ConfirmDeletion","Waiting1","DefaultThumbnail","UploadReviewFile","ClickToSearch","NoDataSearchFilter"],c3=["UploadInProgress"],Pu=class Pu{constructor(){es(this,"KEY_PAIR",{workspaceCode:"ws.code",apiBaseUrl:"API_BASE_URL",assetUrl:"ASSET_URL",baseUrl:"BASE_URL",baseReviewUrl:"BASE_REVIEW_URL"});Object.values(this.KEY_PAIR).every(n=>{const s=sessionStorage.getItem(n);return(s==null||s==="")&&console.error(`[SessionStorageHelper] Key "${n}" is not set in sessionStorage.`),!0})||console.error("[SessionStorageHelper] Some expected keys are missing in sessionStorage. Please ensure all required keys are set.")}static getInstance(){return Pu.instance||(Pu.instance=new Pu),Pu.instance}setItem(t,n){try{sessionStorage.setItem(t,n)}catch(s){console.error("Error setting sessionStorage item:",s)}}getItem(t){try{const n=sessionStorage.getItem(t);return n===null?"":n}catch(n){throw console.error("Error getting sessionStorage item:",n),n}}};es(Pu,"instance");let _n=Pu;const Vg={},Oa={},Z1=(e,t,n,s,o="base64")=>{const i=B(""),r=B(""),a=B(!0),l=Y(()=>`${t}:${e.value.name}`),u=g=>new Promise((v,C)=>{const S=new FileReader;S.onload=()=>v(S.result),S.onerror=C,S.readAsDataURL(g)}),c=g=>`data:image/svg+xml;charset=utf-8,${encodeURIComponent(g)}`,d=async(g,v)=>{if(Oa[v])return Oa[v];if(v in Vg){const b=await Vg[v];return b&&(Oa[v]=b),b}const C=await s(l.value);if(C&&typeof C=="string")return Oa[v]=C,C;const S=(async()=>{try{const b=await fetch(g,{cache:"no-cache"});if(!b.ok)throw new Error("Failed to fetch visual");const w=b.headers.get("Content-Type")||"";let _;if(w.includes("svg")||w.includes("xml")){const R=await b.text();if(!R.trim())throw new Error("Empty SVG content");_=o==="svg"?R:c(R),Oa[v]=_}else if(w.match(/image\/(jpeg|jpg|png|gif|webp)/)){const R=await b.blob();if(!R.size)throw new Error("Empty image blob");_=await u(R),Oa[v]=_}else throw new Error(`Unsupported content type: ${w}`);return await n(l.value,_),_}catch(b){return console.error("Error fetching visual:",b),""}})();return Vg[v]=S,S.finally(()=>{delete Vg[v]}),await S},h=async g=>{a.value=!0;try{if(Oa[l.value]){const _=Oa[l.value];i.value=_,_.startsWith("data:image/svg+xml")?r.value=decodeURIComponent(_.split(",")[1]):(_.startsWith("<svg")||_.includes("<svg"))&&(r.value=_),a.value=!1;return}const v=_n.getInstance().getItem("ASSET_URL")||"",C={icon:`${v}/icon/tess/TESSRAPP_Icon_${g}`,visual:`${v}/icon/visual/TESSRAPP_Visual_${g}`,ratting:`${v}/icon/tess/rating/TESSRAPP_Icon_${g}_Outline`,flag:`${v}/icon/flags/4x3/${g}`},S=u3.includes(g)?"png":c3.includes(g)?"gif":"svg",b=`${C[t]}.${S}`,w=await d(b,l.value);w&&(i.value=w,w.startsWith("data:image/svg+xml")?r.value=decodeURIComponent(w.split(",")[1]):(w.startsWith("<svg")||w.includes("<svg"))&&(r.value=w))}catch(v){console.error("Error fetching remote visual:",v)}finally{a.value=!1}},f=async()=>{i.value="",r.value="",e.value.name&&(a.value=!0,await h(e.value.name),a.value=!1)},p=Y(()=>r.value?r.value:"");return nt(()=>e,()=>{f()},{deep:!0,immediate:!0}),{svgContent:p,url:i,loading:a}},d3=["innerHTML","about"],h3="IconCache",f3="icons",lt=_t(rt({__name:"Icon",props:{src:{},source:{default:"remote"},size:{default:14},color:{default:"currentColor"}},setup(e){jG(h=>({v1555daee:h.size+"px"}));const t=e,n=h=>{if(typeof h=="number")return h;switch(h){case"small":return 14;case"medium":return 14;case"large":return 20;default:return typeof h=="string"?Number.parseInt(h,10):14}},s=Y(()=>n(t.size)),o=Y(()=>({width:s.value+"px",height:s.value+"px",color:t.color})),{getCachedValue:i,setCachedValue:r}=Dh({dbName:h3,storeName:f3}),a=async h=>{const f=await i(h);if(typeof f=="string")return f},l=async(h,f)=>{await r(h,f)},u=Y(()=>t.source==="rating"?"ratting":"icon"),c=Y(()=>({name:t.src,size:s.value,color:t.color||"currentColor"})),{svgContent:d}=Z1(c,u.value,l,a,"svg");return(h,f)=>(j(),ce("div",{class:Q(h.$style.iconWrapper),innerHTML:U(d),style:dn(o.value),about:t.src,"data-icon":"true"},null,14,d3))}}),[["__cssModules",{$style:{iconWrapper:"_iconWrapper_1n0y9_1"}}]]),p3={review:"{reviewDomain}/{ws_code}",review_take:"{reviewDomain}/{ws_code}?id={take_id}",review_scene:"{reviewDomain}/{ws_code}?id={take_id}&scene_id={scene_id}&tab=iteration",review_rendition:"{reviewDomain}/{ws_code}?id={take_id}&scene_id={scene_id}&rendition_id={rendition_id}",review_frame:"{reviewDomain}/{ws_code}?id={take_id}&scene_id={scene_id}&rendition_id={rendition_id}&tab=comment&refresh_marker=true#type=frame&data={frame}",review_rendition_comment:"{reviewDomain}/{ws_code}?scene_id={scene_id}&rendition_id={rendition_id}&comment_id={comment_id}",review_comment:"{reviewDomain}/{ws_code}?id={take_id}&scene_id={scene_id}&comment_id={comment_id}",review_multiple_scenes:"{reviewDomain}/{ws_code}?scene_ids={scene_ids}",scene_hub:"{baseDomain}/{ws_code}/{scene_id}?o=st",hub_rendition:"{baseDomain}/{ws_code}/{scene_id}?o=st&renditionId={rendition_id}",hub_comment:"{baseDomain}/{ws_code}/{scene_id}?o=st&comment_id={comment_id}",people_insight:"{baseDomain}/{ws_code}/{user_id}?o=pt",people_detail:"{baseDomain}/{ws_code}/ws/ppl/{display_name}-${user_id}",project:"{baseDomain}/{ws_code}/pl/dir/{entity_id}",woohoo:"{baseDomain}/{ws_code}/pl/woo/rpt/{woohoo_id}",update:"{baseDomain}/{ws_code}/pl/au?id={entity_id}",core:"{baseDomain}/{ws_code}",project_focusMode:"{baseDomain}/{ws_code}/pl/dir/{parent_id}?f={entity_id}",access_setting:"{baseDomain}/{ws_code}/pl/dir?f={entity_id}&o=as"},Ao=({type:e,config:t})=>{const n=[];try{const s=p3[e];if(!s)throw new Error(`Link template for link type "${e}" not found`);const o=s.replace(/{(.*?)}/g,(i,r)=>{const a=t[String(r)];if(a!==void 0)return a;n.push(r)});return n.length>0?{url:o,hasError:!0,error:`Missing required keys: ${n.join(", ")}`,missingKeys:n}:{url:o,hasError:!1,error:void 0}}catch(s){return console.error("Link Creator ERROR at:",s),{url:"",hasError:!0,error:s instanceof Error?s.message:`Missing required keys: ${n.join(", ")}`}}};var X1=typeof global=="object"&&global&&global.Object===Object&&global,g3=typeof self=="object"&&self&&self.Object===Object&&self,Di=X1||g3||Function("return this")(),Xo=Di.Symbol,J1=Object.prototype,m3=J1.hasOwnProperty,v3=J1.toString,xh=Xo?Xo.toStringTag:void 0;function y3(e){var t=m3.call(e,xh),n=e[xh];try{e[xh]=void 0;var s=!0}catch{}var o=v3.call(e);return s&&(t?e[xh]=n:delete e[xh]),o}var w3=Object.prototype,C3=w3.toString;function b3(e){return C3.call(e)}var S3="[object Null]",E3="[object Undefined]",Q1=Xo?Xo.toStringTag:void 0;function rc(e){return e==null?e===void 0?E3:S3:Q1&&Q1 in Object(e)?y3(e):b3(e)}function jr(e){return e!=null&&typeof e=="object"}var _3="[object Symbol]";function Bg(e){return typeof e=="symbol"||jr(e)&&rc(e)==_3}function R3(e,t){for(var n=-1,s=e==null?0:e.length,o=Array(s);++n<s;)o[n]=t(e[n],n,e);return o}var Jo=Array.isArray,eI=Xo?Xo.prototype:void 0,tI=eI?eI.toString:void 0;function nI(e){if(typeof e=="string")return e;if(Jo(e))return R3(e,nI)+"";if(Bg(e))return tI?tI.call(e):"";var t=e+"";return t=="0"&&1/e==-1/0?"-0":t}var D3=/\s/;function T3(e){for(var t=e.length;t--&&D3.test(e.charAt(t)););return t}var I3=/^\s+/;function x3(e){return e&&e.slice(0,T3(e)+1).replace(I3,"")}function Ma(e){var t=typeof e;return e!=null&&(t=="object"||t=="function")}var sI=NaN,F3=/^[-+]0x[0-9a-f]+$/i,P3=/^0b[01]+$/i,A3=/^0o[0-7]+$/i,k3=parseInt;function RC(e){if(typeof e=="number")return e;if(Bg(e))return sI;if(Ma(e)){var t=typeof e.valueOf=="function"?e.valueOf():e;e=Ma(t)?t+"":t}if(typeof e!="string")return e===0?e:+e;e=x3(e);var n=P3.test(e);return n||A3.test(e)?k3(e.slice(2),n?2:8):F3.test(e)?sI:+e}var oI=1/0,O3=17976931348623157e292;function M3(e){if(!e)return e===0?e:0;if(e=RC(e),e===oI||e===-oI){var t=e<0?-1:1;return t*O3}return e===e?e:0}function N3(e){var t=M3(e),n=t%1;return t===t?n?t-n:t:0}function DC(e){return e}var L3="[object AsyncFunction]",V3="[object Function]",B3="[object GeneratorFunction]",$3="[object Proxy]";function iI(e){if(!Ma(e))return!1;var t=rc(e);return t==V3||t==B3||t==L3||t==$3}var TC=Di["__core-js_shared__"],rI=function(){var e=/[^.]+$/.exec(TC&&TC.keys&&TC.keys.IE_PROTO||"");return e?"Symbol(src)_1."+e:""}();function H3(e){return!!rI&&rI in e}var G3=Function.prototype,U3=G3.toString;function Hl(e){if(e!=null){try{return U3.call(e)}catch{}try{return e+""}catch{}}return""}var W3=/[\\^$.*+?()[\]{}|]/g,z3=/^\[object .+?Constructor\]$/,j3=Function.prototype,K3=Object.prototype,q3=j3.toString,Y3=K3.hasOwnProperty,Z3=RegExp("^"+q3.call(Y3).replace(W3,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function X3(e){if(!Ma(e)||H3(e))return!1;var t=iI(e)?Z3:z3;return t.test(Hl(e))}function J3(e,t){return e==null?void 0:e[t]}function Gl(e,t){var n=J3(e,t);return X3(n)?n:void 0}var IC=Gl(Di,"WeakMap"),aI=Object.create,Q3=function(){function e(){}return function(t){if(!Ma(t))return{};if(aI)return aI(t);e.prototype=t;var n=new e;return e.prototype=void 0,n}}();function e6(e,t,n){switch(n.length){case 0:return e.call(t);case 1:return e.call(t,n[0]);case 2:return e.call(t,n[0],n[1]);case 3:return e.call(t,n[0],n[1],n[2])}return e.apply(t,n)}function t6(){}var n6=800,s6=16,o6=Date.now;function i6(e){var t=0,n=0;return function(){var s=o6(),o=s6-(s-n);if(n=s,o>0){if(++t>=n6)return arguments[0]}else t=0;return e.apply(void 0,arguments)}}function r6(e){return function(){return e}}var $g=function(){try{var e=Gl(Object,"defineProperty");return e({},"",{}),e}catch{}}(),a6=$g?function(e,t){return $g(e,"toString",{configurable:!0,enumerable:!1,value:r6(t),writable:!0})}:DC,l6=i6(a6);function u6(e,t){for(var n=-1,s=e==null?0:e.length;++n<s&&t(e[n],n,e)!==!1;);return e}function c6(e,t,n,s){for(var o=e.length,i=n+-1;++i<o;)if(t(e[i],i,e))return i;return-1}function d6(e){return e!==e}function h6(e,t,n){for(var s=n-1,o=e.length;++s<o;)if(e[s]===t)return s;return-1}function f6(e,t,n){return t===t?h6(e,t,n):c6(e,d6,n)}function p6(e,t){var n=e==null?0:e.length;return!!n&&f6(e,t,0)>-1}var g6=9007199254740991,m6=/^(?:0|[1-9]\d*)$/;function lI(e,t){var n=typeof e;return t=t??g6,!!t&&(n=="number"||n!="symbol"&&m6.test(e))&&e>-1&&e%1==0&&e<t}function v6(e,t,n){t=="__proto__"&&$g?$g(e,t,{configurable:!0,enumerable:!0,value:n,writable:!0}):e[t]=n}function xC(e,t){return e===t||e!==e&&t!==t}var y6=Object.prototype,w6=y6.hasOwnProperty;function C6(e,t,n){var s=e[t];(!(w6.call(e,t)&&xC(s,n))||n===void 0&&!(t in e))&&v6(e,t,n)}var uI=Math.max;function b6(e,t,n){return t=uI(t===void 0?e.length-1:t,0),function(){for(var s=arguments,o=-1,i=uI(s.length-t,0),r=Array(i);++o<i;)r[o]=s[t+o];o=-1;for(var a=Array(t+1);++o<t;)a[o]=s[o];return a[t]=n(r),e6(e,this,a)}}function S6(e,t){return l6(b6(e,t,DC),e+"")}var E6=9007199254740991;function FC(e){return typeof e=="number"&&e>-1&&e%1==0&&e<=E6}function PC(e){return e!=null&&FC(e.length)&&!iI(e)}var _6=Object.prototype;function AC(e){var t=e&&e.constructor,n=typeof t=="function"&&t.prototype||_6;return e===n}function R6(e,t){for(var n=-1,s=Array(e);++n<e;)s[n]=t(n);return s}var D6="[object Arguments]";function cI(e){return jr(e)&&rc(e)==D6}var dI=Object.prototype,T6=dI.hasOwnProperty,I6=dI.propertyIsEnumerable,Hg=cI(function(){return arguments}())?cI:function(e){return jr(e)&&T6.call(e,"callee")&&!I6.call(e,"callee")};function x6(){return!1}var hI=typeof On=="object"&&On&&!On.nodeType&&On,fI=hI&&typeof module=="object"&&module&&!module.nodeType&&module,F6=fI&&fI.exports===hI,pI=F6?Di.Buffer:void 0,P6=pI?pI.isBuffer:void 0,Fh=P6||x6,A6="[object Arguments]",k6="[object Array]",O6="[object Boolean]",M6="[object Date]",N6="[object Error]",L6="[object Function]",V6="[object Map]",B6="[object Number]",$6="[object Object]",H6="[object RegExp]",G6="[object Set]",U6="[object String]",W6="[object WeakMap]",z6="[object ArrayBuffer]",j6="[object DataView]",K6="[object Float32Array]",q6="[object Float64Array]",Y6="[object Int8Array]",Z6="[object Int16Array]",X6="[object Int32Array]",J6="[object Uint8Array]",Q6="[object Uint8ClampedArray]",e4="[object Uint16Array]",t4="[object Uint32Array]",Ln={};Ln[K6]=Ln[q6]=Ln[Y6]=Ln[Z6]=Ln[X6]=Ln[J6]=Ln[Q6]=Ln[e4]=Ln[t4]=!0,Ln[A6]=Ln[k6]=Ln[z6]=Ln[O6]=Ln[j6]=Ln[M6]=Ln[N6]=Ln[L6]=Ln[V6]=Ln[B6]=Ln[$6]=Ln[H6]=Ln[G6]=Ln[U6]=Ln[W6]=!1;function n4(e){return jr(e)&&FC(e.length)&&!!Ln[rc(e)]}function kC(e){return function(t){return e(t)}}var gI=typeof On=="object"&&On&&!On.nodeType&&On,Ph=gI&&typeof module=="object"&&module&&!module.nodeType&&module,s4=Ph&&Ph.exports===gI,OC=s4&&X1.process,ac=function(){try{var e=Ph&&Ph.require&&Ph.require("util").types;return e||OC&&OC.binding&&OC.binding("util")}catch{}}(),mI=ac&&ac.isTypedArray,MC=mI?kC(mI):n4,o4=Object.prototype,i4=o4.hasOwnProperty;function r4(e,t){var n=Jo(e),s=!n&&Hg(e),o=!n&&!s&&Fh(e),i=!n&&!s&&!o&&MC(e),r=n||s||o||i,a=r?R6(e.length,String):[],l=a.length;for(var u in e)i4.call(e,u)&&!(r&&(u=="length"||o&&(u=="offset"||u=="parent")||i&&(u=="buffer"||u=="byteLength"||u=="byteOffset")||lI(u,l)))&&a.push(u);return a}function vI(e,t){return function(n){return e(t(n))}}var a4=vI(Object.keys,Object),l4=Object.prototype,u4=l4.hasOwnProperty;function yI(e){if(!AC(e))return a4(e);var t=[];for(var n in Object(e))u4.call(e,n)&&n!="constructor"&&t.push(n);return t}function wI(e){return PC(e)?r4(e):yI(e)}var c4=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,d4=/^\w*$/;function NC(e,t){if(Jo(e))return!1;var n=typeof e;return n=="number"||n=="symbol"||n=="boolean"||e==null||Bg(e)?!0:d4.test(e)||!c4.test(e)||t!=null&&e in Object(t)}var Ah=Gl(Object,"create");function h4(){this.__data__=Ah?Ah(null):{},this.size=0}function f4(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t}var p4="__lodash_hash_undefined__",g4=Object.prototype,m4=g4.hasOwnProperty;function v4(e){var t=this.__data__;if(Ah){var n=t[e];return n===p4?void 0:n}return m4.call(t,e)?t[e]:void 0}var y4=Object.prototype,w4=y4.hasOwnProperty;function C4(e){var t=this.__data__;return Ah?t[e]!==void 0:w4.call(t,e)}var b4="__lodash_hash_undefined__";function S4(e,t){var n=this.__data__;return this.size+=this.has(e)?0:1,n[e]=Ah&&t===void 0?b4:t,this}function Ul(e){var t=-1,n=e==null?0:e.length;for(this.clear();++t<n;){var s=e[t];this.set(s[0],s[1])}}Ul.prototype.clear=h4,Ul.prototype.delete=f4,Ul.prototype.get=v4,Ul.prototype.has=C4,Ul.prototype.set=S4;function E4(){this.__data__=[],this.size=0}function Gg(e,t){for(var n=e.length;n--;)if(xC(e[n][0],t))return n;return-1}var _4=Array.prototype,R4=_4.splice;function D4(e){var t=this.__data__,n=Gg(t,e);if(n<0)return!1;var s=t.length-1;return n==s?t.pop():R4.call(t,n,1),--this.size,!0}function T4(e){var t=this.__data__,n=Gg(t,e);return n<0?void 0:t[n][1]}function I4(e){return Gg(this.__data__,e)>-1}function x4(e,t){var n=this.__data__,s=Gg(n,e);return s<0?(++this.size,n.push([e,t])):n[s][1]=t,this}function Kr(e){var t=-1,n=e==null?0:e.length;for(this.clear();++t<n;){var s=e[t];this.set(s[0],s[1])}}Kr.prototype.clear=E4,Kr.prototype.delete=D4,Kr.prototype.get=T4,Kr.prototype.has=I4,Kr.prototype.set=x4;var kh=Gl(Di,"Map");function F4(){this.size=0,this.__data__={hash:new Ul,map:new(kh||Kr),string:new Ul}}function P4(e){var t=typeof e;return t=="string"||t=="number"||t=="symbol"||t=="boolean"?e!=="__proto__":e===null}function Ug(e,t){var n=e.__data__;return P4(t)?n[typeof t=="string"?"string":"hash"]:n.map}function A4(e){var t=Ug(this,e).delete(e);return this.size-=t?1:0,t}function k4(e){return Ug(this,e).get(e)}function O4(e){return Ug(this,e).has(e)}function M4(e,t){var n=Ug(this,e),s=n.size;return n.set(e,t),this.size+=n.size==s?0:1,this}function qr(e){var t=-1,n=e==null?0:e.length;for(this.clear();++t<n;){var s=e[t];this.set(s[0],s[1])}}qr.prototype.clear=F4,qr.prototype.delete=A4,qr.prototype.get=k4,qr.prototype.has=O4,qr.prototype.set=M4;var N4="Expected a function";function LC(e,t){if(typeof e!="function"||t!=null&&typeof t!="function")throw new TypeError(N4);var n=function(){var s=arguments,o=t?t.apply(this,s):s[0],i=n.cache;if(i.has(o))return i.get(o);var r=e.apply(this,s);return n.cache=i.set(o,r)||i,r};return n.cache=new(LC.Cache||qr),n}LC.Cache=qr;var L4=500;function V4(e){var t=LC(e,function(s){return n.size===L4&&n.clear(),s}),n=t.cache;return t}var B4=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,$4=/\\(\\)?/g,H4=V4(function(e){var t=[];return e.charCodeAt(0)===46&&t.push(""),e.replace(B4,function(n,s,o,i){t.push(o?i.replace($4,"$1"):s||n)}),t});function G4(e){return e==null?"":nI(e)}function CI(e,t){return Jo(e)?e:NC(e,t)?[e]:H4(G4(e))}function Wg(e){if(typeof e=="string"||Bg(e))return e;var t=e+"";return t=="0"&&1/e==-1/0?"-0":t}function bI(e,t){t=CI(t,e);for(var n=0,s=t.length;e!=null&&n<s;)e=e[Wg(t[n++])];return n&&n==s?e:void 0}function U4(e,t,n){var s=e==null?void 0:bI(e,t);return s===void 0?n:s}function SI(e,t){for(var n=-1,s=t.length,o=e.length;++n<s;)e[o+n]=t[n];return e}var EI=Xo?Xo.isConcatSpreadable:void 0;function W4(e){return Jo(e)||Hg(e)||!!(EI&&e&&e[EI])}function z4(e,t,n,s,o){var i=-1,r=e.length;for(n||(n=W4),o||(o=[]);++i<r;){var a=e[i];n(a)&&SI(o,a)}return o}var j4=vI(Object.getPrototypeOf,Object);function K4(e,t,n){var s=-1,o=e.length;t<0&&(t=-t>o?0:o+t),n=n>o?o:n,n<0&&(n+=o),o=t>n?0:n-t>>>0,t>>>=0;for(var i=Array(o);++s<o;)i[s]=e[s+t];return i}var q4=Math.ceil,Y4=Math.max;function Z4(e,t,n){t===void 0?t=1:t=Y4(N3(t),0);var s=e==null?0:e.length;if(!s||t<1)return[];for(var o=0,i=0,r=Array(q4(s/t));o<s;)r[i++]=K4(e,o,o+=t);return r}function X4(){this.__data__=new Kr,this.size=0}function J4(e){var t=this.__data__,n=t.delete(e);return this.size=t.size,n}function Q4(e){return this.__data__.get(e)}function e5(e){return this.__data__.has(e)}var t5=200;function n5(e,t){var n=this.__data__;if(n instanceof Kr){var s=n.__data__;if(!kh||s.length<t5-1)return s.push([e,t]),this.size=++n.size,this;n=this.__data__=new qr(s)}return n.set(e,t),this.size=n.size,this}function or(e){var t=this.__data__=new Kr(e);this.size=t.size}or.prototype.clear=X4,or.prototype.delete=J4,or.prototype.get=Q4,or.prototype.has=e5,or.prototype.set=n5;var _I=typeof On=="object"&&On&&!On.nodeType&&On,RI=_I&&typeof module=="object"&&module&&!module.nodeType&&module,s5=RI&&RI.exports===_I,DI=s5?Di.Buffer:void 0;DI&&DI.allocUnsafe;function o5(e,t){return e.slice()}function i5(e,t){for(var n=-1,s=e==null?0:e.length,o=0,i=[];++n<s;){var r=e[n];t(r,n,e)&&(i[o++]=r)}return i}function r5(){return[]}var a5=Object.prototype,l5=a5.propertyIsEnumerable,TI=Object.getOwnPropertySymbols,u5=TI?function(e){return e==null?[]:(e=Object(e),i5(TI(e),function(t){return l5.call(e,t)}))}:r5;function c5(e,t,n){var s=t(e);return Jo(e)?s:SI(s,n(e))}function VC(e){return c5(e,wI,u5)}var BC=Gl(Di,"DataView"),$C=Gl(Di,"Promise"),lc=Gl(Di,"Set"),II="[object Map]",d5="[object Object]",xI="[object Promise]",FI="[object Set]",PI="[object WeakMap]",AI="[object DataView]",h5=Hl(BC),f5=Hl(kh),p5=Hl($C),g5=Hl(lc),m5=Hl(IC),Qo=rc;(BC&&Qo(new BC(new ArrayBuffer(1)))!=AI||kh&&Qo(new kh)!=II||$C&&Qo($C.resolve())!=xI||lc&&Qo(new lc)!=FI||IC&&Qo(new IC)!=PI)&&(Qo=function(e){var t=rc(e),n=t==d5?e.constructor:void 0,s=n?Hl(n):"";if(s)switch(s){case h5:return AI;case f5:return II;case p5:return xI;case g5:return FI;case m5:return PI}return t});var v5=Object.prototype,y5=v5.hasOwnProperty;function w5(e){var t=e.length,n=new e.constructor(t);return t&&typeof e[0]=="string"&&y5.call(e,"index")&&(n.index=e.index,n.input=e.input),n}var zg=Di.Uint8Array;function HC(e){var t=new e.constructor(e.byteLength);return new zg(t).set(new zg(e)),t}function C5(e,t){var n=HC(e.buffer);return new e.constructor(n,e.byteOffset,e.byteLength)}var b5=/\w*$/;function S5(e){var t=new e.constructor(e.source,b5.exec(e));return t.lastIndex=e.lastIndex,t}var kI=Xo?Xo.prototype:void 0,OI=kI?kI.valueOf:void 0;function E5(e){return OI?Object(OI.call(e)):{}}function _5(e,t){var n=HC(e.buffer);return new e.constructor(n,e.byteOffset,e.length)}var R5="[object Boolean]",D5="[object Date]",T5="[object Map]",I5="[object Number]",x5="[object RegExp]",F5="[object Set]",P5="[object String]",A5="[object Symbol]",k5="[object ArrayBuffer]",O5="[object DataView]",M5="[object Float32Array]",N5="[object Float64Array]",L5="[object Int8Array]",V5="[object Int16Array]",B5="[object Int32Array]",$5="[object Uint8Array]",H5="[object Uint8ClampedArray]",G5="[object Uint16Array]",U5="[object Uint32Array]";function W5(e,t,n){var s=e.constructor;switch(t){case k5:return HC(e);case R5:case D5:return new s(+e);case O5:return C5(e);case M5:case N5:case L5:case V5:case B5:case $5:case H5:case G5:case U5:return _5(e);case T5:return new s;case I5:case P5:return new s(e);case x5:return S5(e);case F5:return new s;case A5:return E5(e)}}function z5(e){return typeof e.constructor=="function"&&!AC(e)?Q3(j4(e)):{}}var j5="[object Map]";function K5(e){return jr(e)&&Qo(e)==j5}var MI=ac&&ac.isMap,q5=MI?kC(MI):K5,Y5="[object Set]";function Z5(e){return jr(e)&&Qo(e)==Y5}var NI=ac&&ac.isSet,X5=NI?kC(NI):Z5,LI="[object Arguments]",J5="[object Array]",Q5="[object Boolean]",e8="[object Date]",t8="[object Error]",VI="[object Function]",n8="[object GeneratorFunction]",s8="[object Map]",o8="[object Number]",BI="[object Object]",i8="[object RegExp]",r8="[object Set]",a8="[object String]",l8="[object Symbol]",u8="[object WeakMap]",c8="[object ArrayBuffer]",d8="[object DataView]",h8="[object Float32Array]",f8="[object Float64Array]",p8="[object Int8Array]",g8="[object Int16Array]",m8="[object Int32Array]",v8="[object Uint8Array]",y8="[object Uint8ClampedArray]",w8="[object Uint16Array]",C8="[object Uint32Array]",Fn={};Fn[LI]=Fn[J5]=Fn[c8]=Fn[d8]=Fn[Q5]=Fn[e8]=Fn[h8]=Fn[f8]=Fn[p8]=Fn[g8]=Fn[m8]=Fn[s8]=Fn[o8]=Fn[BI]=Fn[i8]=Fn[r8]=Fn[a8]=Fn[l8]=Fn[v8]=Fn[y8]=Fn[w8]=Fn[C8]=!0,Fn[t8]=Fn[VI]=Fn[u8]=!1;function jg(e,t,n,s,o,i){var r;if(r!==void 0)return r;if(!Ma(e))return e;var a=Jo(e);if(a)r=w5(e);else{var l=Qo(e),u=l==VI||l==n8;if(Fh(e))return o5(e);if(l==BI||l==LI||u&&!o)r=u?{}:z5(e);else{if(!Fn[l])return o?e:{};r=W5(e,l)}}i||(i=new or);var c=i.get(e);if(c)return c;i.set(e,r),X5(e)?e.forEach(function(f){r.add(jg(f,t,n,f,e,i))}):q5(e)&&e.forEach(function(f,p){r.set(p,jg(f,t,n,p,e,i))});var d=VC,h=a?void 0:d(e);return u6(h||e,function(f,p){h&&(p=f,f=e[p]),C6(r,p,jg(f,t,n,p,e,i))}),r}var b8=1,S8=4;function $I(e){return jg(e,b8|S8)}var E8="__lodash_hash_undefined__";function _8(e){return this.__data__.set(e,E8),this}function R8(e){return this.__data__.has(e)}function Oh(e){var t=-1,n=e==null?0:e.length;for(this.__data__=new qr;++t<n;)this.add(e[t])}Oh.prototype.add=Oh.prototype.push=_8,Oh.prototype.has=R8;function D8(e,t){for(var n=-1,s=e==null?0:e.length;++n<s;)if(t(e[n],n,e))return!0;return!1}function HI(e,t){return e.has(t)}var T8=1,I8=2;function GI(e,t,n,s,o,i){var r=n&T8,a=e.length,l=t.length;if(a!=l&&!(r&&l>a))return!1;var u=i.get(e),c=i.get(t);if(u&&c)return u==t&&c==e;var d=-1,h=!0,f=n&I8?new Oh:void 0;for(i.set(e,t),i.set(t,e);++d<a;){var p=e[d],g=t[d];if(s)var v=r?s(g,p,d,t,e,i):s(p,g,d,e,t,i);if(v!==void 0){if(v)continue;h=!1;break}if(f){if(!D8(t,function(C,S){if(!HI(f,S)&&(p===C||o(p,C,n,s,i)))return f.push(S)})){h=!1;break}}else if(!(p===g||o(p,g,n,s,i))){h=!1;break}}return i.delete(e),i.delete(t),h}function x8(e){var t=-1,n=Array(e.size);return e.forEach(function(s,o){n[++t]=[o,s]}),n}function GC(e){var t=-1,n=Array(e.size);return e.forEach(function(s){n[++t]=s}),n}var F8=1,P8=2,A8="[object Boolean]",k8="[object Date]",O8="[object Error]",M8="[object Map]",N8="[object Number]",L8="[object RegExp]",V8="[object Set]",B8="[object String]",$8="[object Symbol]",H8="[object ArrayBuffer]",G8="[object DataView]",UI=Xo?Xo.prototype:void 0,UC=UI?UI.valueOf:void 0;function U8(e,t,n,s,o,i,r){switch(n){case G8:if(e.byteLength!=t.byteLength||e.byteOffset!=t.byteOffset)return!1;e=e.buffer,t=t.buffer;case H8:return!(e.byteLength!=t.byteLength||!i(new zg(e),new zg(t)));case A8:case k8:case N8:return xC(+e,+t);case O8:return e.name==t.name&&e.message==t.message;case L8:case B8:return e==t+"";case M8:var a=x8;case V8:var l=s&F8;if(a||(a=GC),e.size!=t.size&&!l)return!1;var u=r.get(e);if(u)return u==t;s|=P8,r.set(e,t);var c=GI(a(e),a(t),s,o,i,r);return r.delete(e),c;case $8:if(UC)return UC.call(e)==UC.call(t)}return!1}var W8=1,z8=Object.prototype,j8=z8.hasOwnProperty;function K8(e,t,n,s,o,i){var r=n&W8,a=VC(e),l=a.length,u=VC(t),c=u.length;if(l!=c&&!r)return!1;for(var d=l;d--;){var h=a[d];if(!(r?h in t:j8.call(t,h)))return!1}var f=i.get(e),p=i.get(t);if(f&&p)return f==t&&p==e;var g=!0;i.set(e,t),i.set(t,e);for(var v=r;++d<l;){h=a[d];var C=e[h],S=t[h];if(s)var b=r?s(S,C,h,t,e,i):s(C,S,h,e,t,i);if(!(b===void 0?C===S||o(C,S,n,s,i):b)){g=!1;break}v||(v=h=="constructor")}if(g&&!v){var w=e.constructor,_=t.constructor;w!=_&&"constructor"in e&&"constructor"in t&&!(typeof w=="function"&&w instanceof w&&typeof _=="function"&&_ instanceof _)&&(g=!1)}return i.delete(e),i.delete(t),g}var q8=1,WI="[object Arguments]",zI="[object Array]",Kg="[object Object]",Y8=Object.prototype,jI=Y8.hasOwnProperty;function Z8(e,t,n,s,o,i){var r=Jo(e),a=Jo(t),l=r?zI:Qo(e),u=a?zI:Qo(t);l=l==WI?Kg:l,u=u==WI?Kg:u;var c=l==Kg,d=u==Kg,h=l==u;if(h&&Fh(e)){if(!Fh(t))return!1;r=!0,c=!1}if(h&&!c)return i||(i=new or),r||MC(e)?GI(e,t,n,s,o,i):U8(e,t,l,n,s,o,i);if(!(n&q8)){var f=c&&jI.call(e,"__wrapped__"),p=d&&jI.call(t,"__wrapped__");if(f||p){var g=f?e.value():e,v=p?t.value():t;return i||(i=new or),o(g,v,n,s,i)}}return h?(i||(i=new or),K8(e,t,n,s,o,i)):!1}function WC(e,t,n,s,o){return e===t?!0:e==null||t==null||!jr(e)&&!jr(t)?e!==e&&t!==t:Z8(e,t,n,s,WC,o)}var X8=1,J8=2;function Q8(e,t,n,s){var o=n.length,i=o;if(e==null)return!i;for(e=Object(e);o--;){var r=n[o];if(r[2]?r[1]!==e[r[0]]:!(r[0]in e))return!1}for(;++o<i;){r=n[o];var a=r[0],l=e[a],u=r[1];if(r[2]){if(l===void 0&&!(a in e))return!1}else{var c=new or,d;if(!(d===void 0?WC(u,l,X8|J8,s,c):d))return!1}}return!0}function KI(e){return e===e&&!Ma(e)}function ej(e){for(var t=wI(e),n=t.length;n--;){var s=t[n],o=e[s];t[n]=[s,o,KI(o)]}return t}function qI(e,t){return function(n){return n==null?!1:n[e]===t&&(t!==void 0||e in Object(n))}}function tj(e){var t=ej(e);return t.length==1&&t[0][2]?qI(t[0][0],t[0][1]):function(n){return n===e||Q8(n,e,t)}}function nj(e,t){return e!=null&&t in Object(e)}function sj(e,t,n){t=CI(t,e);for(var s=-1,o=t.length,i=!1;++s<o;){var r=Wg(t[s]);if(!(i=e!=null&&n(e,r)))break;e=e[r]}return i||++s!=o?i:(o=e==null?0:e.length,!!o&&FC(o)&&lI(r,o)&&(Jo(e)||Hg(e)))}function oj(e,t){return e!=null&&sj(e,t,nj)}var ij=1,rj=2;function aj(e,t){return NC(e)&&KI(t)?qI(Wg(e),t):function(n){var s=U4(n,e);return s===void 0&&s===t?oj(n,e):WC(t,s,ij|rj)}}function lj(e){return function(t){return t==null?void 0:t[e]}}function uj(e){return function(t){return bI(t,e)}}function cj(e){return NC(e)?lj(Wg(e)):uj(e)}function dj(e){return typeof e=="function"?e:e==null?DC:typeof e=="object"?Jo(e)?aj(e[0],e[1]):tj(e):cj(e)}var zC=function(){return Di.Date.now()},hj="Expected a function",fj=Math.max,pj=Math.min;function Ti(e,t,n){var s,o,i,r,a,l,u=0,c=!1,d=!1,h=!0;if(typeof e!="function")throw new TypeError(hj);t=RC(t)||0,Ma(n)&&(c=!!n.leading,d="maxWait"in n,i=d?fj(RC(n.maxWait)||0,t):i,h="trailing"in n?!!n.trailing:h);function f(R){var T=s,I=o;return s=o=void 0,u=R,r=e.apply(I,T),r}function p(R){return u=R,a=setTimeout(C,t),c?f(R):r}function g(R){var T=R-l,I=R-u,x=t-T;return d?pj(x,i-I):x}function v(R){var T=R-l,I=R-u;return l===void 0||T>=t||T<0||d&&I>=i}function C(){var R=zC();if(v(R))return S(R);a=setTimeout(C,g(R))}function S(R){return a=void 0,h&&s?f(R):(s=o=void 0,r)}function b(){a!==void 0&&clearTimeout(a),u=0,s=l=o=a=void 0}function w(){return a===void 0?r:S(zC())}function _(){var R=zC(),T=v(R);if(s=arguments,o=this,l=R,T){if(a===void 0)return p(l);if(d)return clearTimeout(a),a=setTimeout(C,t),f(l)}return a===void 0&&(a=setTimeout(C,t)),r}return _.cancel=b,_.flush=w,_}function YI(e){return jr(e)&&PC(e)}function gj(e){var t=e==null?0:e.length;return t?e[t-1]:void 0}var mj="[object Map]",vj="[object Set]",yj=Object.prototype,wj=yj.hasOwnProperty;function Cj(e){if(e==null)return!0;if(PC(e)&&(Jo(e)||typeof e=="string"||typeof e.splice=="function"||Fh(e)||MC(e)||Hg(e)))return!e.length;var t=Qo(e);if(t==mj||t==vj)return!e.size;if(AC(e))return!yI(e).length;for(var n in e)if(wj.call(e,n))return!1;return!0}var bj=1/0,Sj=lc&&1/GC(new lc([,-0]))[1]==bj?function(e){return new lc(e)}:t6,Ej=200;function _j(e,t,n){var s=-1,o=p6,i=e.length,r=!0,a=[],l=a;if(i>=Ej){var u=t?null:Sj(e);if(u)return GC(u);r=!1,o=HI,l=new Oh}else l=t?[]:a;e:for(;++s<i;){var c=e[s],d=t?t(c):c;if(c=c!==0?c:0,r&&d===d){for(var h=l.length;h--;)if(l[h]===d)continue e;t&&l.push(d),a.push(c)}else o(l,d,n)||(l!==a&&l.push(d),a.push(c))}return a}var uc=S6(function(e){var t=gj(e);return YI(t)&&(t=void 0),_j(z4(e,1,YI),dj(t))});const ts=(e,t)=>{const n=Yn();return{apiServices:Y(()=>{var r;const o=n==null?void 0:n.appContext.config.globalProperties,i=(r=t.params)==null?void 0:r.context;if(o!=null&&o.apiServices)return o.apiServices;if(e&&(i!=null&&i.apiServices))return i.apiServices})}},Rj=e=>{const t=document.cookie.match(new RegExp("(^| )"+e+"=([^;]+)"));return t?decodeURIComponent(t[2]):null};let Wl=class extends Error{};class Dj extends Wl{constructor(t){super(`Invalid DateTime: ${t.toMessage()}`)}}class Tj extends Wl{constructor(t){super(`Invalid Interval: ${t.toMessage()}`)}}class Ij extends Wl{constructor(t){super(`Invalid Duration: ${t.toMessage()}`)}}class cc extends Wl{}class ZI extends Wl{constructor(t){super(`Invalid unit ${t}`)}}class Bs extends Wl{}let Na=class extends Wl{constructor(){super("Zone is an abstract class")}};const Et="numeric",Ii="short",ko="long",qg={year:Et,month:Et,day:Et},XI={year:Et,month:Ii,day:Et},xj={year:Et,month:Ii,day:Et,weekday:Ii},JI={year:Et,month:ko,day:Et},QI={year:Et,month:ko,day:Et,weekday:ko},ex={hour:Et,minute:Et},tx={hour:Et,minute:Et,second:Et},nx={hour:Et,minute:Et,second:Et,timeZoneName:Ii},sx={hour:Et,minute:Et,second:Et,timeZoneName:ko},ox={hour:Et,minute:Et,hourCycle:"h23"},ix={hour:Et,minute:Et,second:Et,hourCycle:"h23"},rx={hour:Et,minute:Et,second:Et,hourCycle:"h23",timeZoneName:Ii},ax={hour:Et,minute:Et,second:Et,hourCycle:"h23",timeZoneName:ko},lx={year:Et,month:Et,day:Et,hour:Et,minute:Et},ux={year:Et,month:Et,day:Et,hour:Et,minute:Et,second:Et},cx={year:Et,month:Ii,day:Et,hour:Et,minute:Et},dx={year:Et,month:Ii,day:Et,hour:Et,minute:Et,second:Et},Fj={year:Et,month:Ii,day:Et,weekday:Ii,hour:Et,minute:Et},hx={year:Et,month:ko,day:Et,hour:Et,minute:Et,timeZoneName:Ii},fx={year:Et,month:ko,day:Et,hour:Et,minute:Et,second:Et,timeZoneName:Ii},px={year:Et,month:ko,day:Et,weekday:ko,hour:Et,minute:Et,timeZoneName:ko},gx={year:Et,month:ko,day:Et,weekday:ko,hour:Et,minute:Et,second:Et,timeZoneName:ko};let Mh=class{get type(){throw new Na}get name(){throw new Na}get ianaName(){return this.name}get isUniversal(){throw new Na}offsetName(t,n){throw new Na}formatOffset(t,n){throw new Na}offset(t){throw new Na}equals(t){throw new Na}get isValid(){throw new Na}},jC=null;class Yg extends Mh{static get instance(){return jC===null&&(jC=new Yg),jC}get type(){return"system"}get name(){return new Intl.DateTimeFormat().resolvedOptions().timeZone}get isUniversal(){return!1}offsetName(t,{format:n,locale:s}){return Hx(t,n,s)}formatOffset(t,n){return Bh(this.offset(t),n)}offset(t){return-new Date(t).getTimezoneOffset()}equals(t){return t.type==="system"}get isValid(){return!0}}const KC=new Map;function Pj(e){let t=KC.get(e);return t===void 0&&(t=new Intl.DateTimeFormat("en-US",{hour12:!1,timeZone:e,year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit",era:"short"}),KC.set(e,t)),t}const Aj={year:0,month:1,day:2,era:3,hour:4,minute:5,second:6};function kj(e,t){const n=e.format(t).replace(/\u200E/g,""),s=/(\d+)\/(\d+)\/(\d+) (AD|BC),? (\d+):(\d+):(\d+)/.exec(n),[,o,i,r,a,l,u,c]=s;return[r,o,i,a,l,u,c]}function Oj(e,t){const n=e.formatToParts(t),s=[];for(let o=0;o<n.length;o++){const{type:i,value:r}=n[o],a=Aj[i];i==="era"?s[a]=r:$t(a)||(s[a]=parseInt(r,10))}return s}const qC=new Map;let dc=class Q_ extends Mh{static create(t){let n=qC.get(t);return n===void 0&&qC.set(t,n=new Q_(t)),n}static resetCache(){qC.clear(),KC.clear()}static isValidSpecifier(t){return this.isValidZone(t)}static isValidZone(t){if(!t)return!1;try{return new Intl.DateTimeFormat("en-US",{timeZone:t}).format(),!0}catch{return!1}}constructor(t){super(),this.zoneName=t,this.valid=Q_.isValidZone(t)}get type(){return"iana"}get name(){return this.zoneName}get isUniversal(){return!1}offsetName(t,{format:n,locale:s}){return Hx(t,n,s,this.name)}formatOffset(t,n){return Bh(this.offset(t),n)}offset(t){if(!this.valid)return NaN;const n=new Date(t);if(isNaN(n))return NaN;const s=Pj(this.name);let[o,i,r,a,l,u,c]=s.formatToParts?Oj(s,n):kj(s,n);a==="BC"&&(o=-Math.abs(o)+1);const h=em({year:o,month:i,day:r,hour:l===24?0:l,minute:u,second:c,millisecond:0});let f=+n;const p=f%1e3;return f-=p>=0?p:1e3+p,(h-f)/(60*1e3)}equals(t){return t.type==="iana"&&t.name===this.name}get isValid(){return this.valid}},mx={};function Mj(e,t={}){const n=JSON.stringify([e,t]);let s=mx[n];return s||(s=new Intl.ListFormat(e,t),mx[n]=s),s}const YC=new Map;function ZC(e,t={}){const n=JSON.stringify([e,t]);let s=YC.get(n);return s===void 0&&(s=new Intl.DateTimeFormat(e,t),YC.set(n,s)),s}const XC=new Map;function Nj(e,t={}){const n=JSON.stringify([e,t]);let s=XC.get(n);return s===void 0&&(s=new Intl.NumberFormat(e,t),XC.set(n,s)),s}const JC=new Map;function Lj(e,t={}){const{base:n,...s}=t,o=JSON.stringify([e,s]);let i=JC.get(o);return i===void 0&&(i=new Intl.RelativeTimeFormat(e,t),JC.set(o,i)),i}let Nh=null;function Vj(){return Nh||(Nh=new Intl.DateTimeFormat().resolvedOptions().locale,Nh)}const QC=new Map;function vx(e){let t=QC.get(e);return t===void 0&&(t=new Intl.DateTimeFormat(e).resolvedOptions(),QC.set(e,t)),t}const eb=new Map;function Bj(e){let t=eb.get(e);if(!t){const n=new Intl.Locale(e);t="getWeekInfo"in n?n.getWeekInfo():n.weekInfo,"minimalDays"in t||(t={...yx,...t}),eb.set(e,t)}return t}function $j(e){const t=e.indexOf("-x-");t!==-1&&(e=e.substring(0,t));const n=e.indexOf("-u-");if(n===-1)return[e];{let s,o;try{s=ZC(e).resolvedOptions(),o=e}catch{const l=e.substring(0,n);s=ZC(l).resolvedOptions(),o=l}const{numberingSystem:i,calendar:r}=s;return[o,i,r]}}function Hj(e,t,n){return(n||t)&&(e.includes("-u-")||(e+="-u"),n&&(e+=`-ca-${n}`),t&&(e+=`-nu-${t}`)),e}function Gj(e){const t=[];for(let n=1;n<=12;n++){const s=bt.utc(2009,n,1);t.push(e(s))}return t}function Uj(e){const t=[];for(let n=1;n<=7;n++){const s=bt.utc(2016,11,13+n);t.push(e(s))}return t}function Zg(e,t,n,s){const o=e.listingMode();return o==="error"?null:o==="en"?n(t):s(t)}function Wj(e){return e.numberingSystem&&e.numberingSystem!=="latn"?!1:e.numberingSystem==="latn"||!e.locale||e.locale.startsWith("en")||vx(e.locale).numberingSystem==="latn"}class zj{constructor(t,n,s){this.padTo=s.padTo||0,this.floor=s.floor||!1;const{padTo:o,floor:i,...r}=s;if(!n||Object.keys(r).length>0){const a={useGrouping:!1,...s};s.padTo>0&&(a.minimumIntegerDigits=s.padTo),this.inf=Nj(t,a)}}format(t){if(this.inf){const n=this.floor?Math.floor(t):t;return this.inf.format(n)}else{const n=this.floor?Math.floor(t):ub(t,3);return ds(n,this.padTo)}}}class jj{constructor(t,n,s){this.opts=s,this.originalZone=void 0;let o;if(this.opts.timeZone)this.dt=t;else if(t.zone.type==="fixed"){const r=-1*(t.offset/60),a=r>=0?`Etc/GMT+${r}`:`Etc/GMT${r}`;t.offset!==0&&dc.create(a).valid?(o=a,this.dt=t):(o="UTC",this.dt=t.offset===0?t:t.setZone("UTC").plus({minutes:t.offset}),this.originalZone=t.zone)}else t.zone.type==="system"?this.dt=t:t.zone.type==="iana"?(this.dt=t,o=t.zone.name):(o="UTC",this.dt=t.setZone("UTC").plus({minutes:t.offset}),this.originalZone=t.zone);const i={...this.opts};i.timeZone=i.timeZone||o,this.dtf=ZC(n,i)}format(){return this.originalZone?this.formatToParts().map(({value:t})=>t).join(""):this.dtf.format(this.dt.toJSDate())}formatToParts(){const t=this.dtf.formatToParts(this.dt.toJSDate());return this.originalZone?t.map(n=>{if(n.type==="timeZoneName"){const s=this.originalZone.offsetName(this.dt.ts,{locale:this.dt.locale,format:this.opts.timeZoneName});return{...n,value:s}}else return n}):t}resolvedOptions(){return this.dtf.resolvedOptions()}}class Kj{constructor(t,n,s){this.opts={style:"long",...s},!n&&Lx()&&(this.rtf=Lj(t,s))}format(t,n){return this.rtf?this.rtf.format(t,n):g7(n,t,this.opts.numeric,this.opts.style!=="long")}formatToParts(t,n){return this.rtf?this.rtf.formatToParts(t,n):[]}}const yx={firstDay:1,minimalDays:4,weekend:[6,7]};class bn{static fromOpts(t){return bn.create(t.locale,t.numberingSystem,t.outputCalendar,t.weekSettings,t.defaultToEN)}static create(t,n,s,o,i=!1){const r=t||Zn.defaultLocale,a=r||(i?"en-US":Vj()),l=n||Zn.defaultNumberingSystem,u=s||Zn.defaultOutputCalendar,c=ab(o)||Zn.defaultWeekSettings;return new bn(a,l,u,c,r)}static resetCache(){Nh=null,YC.clear(),XC.clear(),JC.clear(),QC.clear(),eb.clear()}static fromObject({locale:t,numberingSystem:n,outputCalendar:s,weekSettings:o}={}){return bn.create(t,n,s,o)}constructor(t,n,s,o,i){const[r,a,l]=$j(t);this.locale=r,this.numberingSystem=n||a||null,this.outputCalendar=s||l||null,this.weekSettings=o,this.intl=Hj(this.locale,this.numberingSystem,this.outputCalendar),this.weekdaysCache={format:{},standalone:{}},this.monthsCache={format:{},standalone:{}},this.meridiemCache=null,this.eraCache={},this.specifiedLocale=i,this.fastNumbersCached=null}get fastNumbers(){return this.fastNumbersCached==null&&(this.fastNumbersCached=Wj(this)),this.fastNumbersCached}listingMode(){const t=this.isEnglish(),n=(this.numberingSystem===null||this.numberingSystem==="latn")&&(this.outputCalendar===null||this.outputCalendar==="gregory");return t&&n?"en":"intl"}clone(t){return!t||Object.getOwnPropertyNames(t).length===0?this:bn.create(t.locale||this.specifiedLocale,t.numberingSystem||this.numberingSystem,t.outputCalendar||this.outputCalendar,ab(t.weekSettings)||this.weekSettings,t.defaultToEN||!1)}redefaultToEN(t={}){return this.clone({...t,defaultToEN:!0})}redefaultToSystem(t={}){return this.clone({...t,defaultToEN:!1})}months(t,n=!1){return Zg(this,t,Wx,()=>{const s=this.intl==="ja"||this.intl.startsWith("ja-");n&=!s;const o=n?{month:t,day:"numeric"}:{month:t},i=n?"format":"standalone";if(!this.monthsCache[i][t]){const r=s?a=>this.dtFormatter(a,o).format():a=>this.extract(a,o,"month");this.monthsCache[i][t]=Gj(r)}return this.monthsCache[i][t]})}weekdays(t,n=!1){return Zg(this,t,Kx,()=>{const s=n?{weekday:t,year:"numeric",month:"long",day:"numeric"}:{weekday:t},o=n?"format":"standalone";return this.weekdaysCache[o][t]||(this.weekdaysCache[o][t]=Uj(i=>this.extract(i,s,"weekday"))),this.weekdaysCache[o][t]})}meridiems(){return Zg(this,void 0,()=>qx,()=>{if(!this.meridiemCache){const t={hour:"numeric",hourCycle:"h12"};this.meridiemCache=[bt.utc(2016,11,13,9),bt.utc(2016,11,13,19)].map(n=>this.extract(n,t,"dayperiod"))}return this.meridiemCache})}eras(t){return Zg(this,t,Yx,()=>{const n={era:t};return this.eraCache[t]||(this.eraCache[t]=[bt.utc(-40,1,1),bt.utc(2017,1,1)].map(s=>this.extract(s,n,"era"))),this.eraCache[t]})}extract(t,n,s){const o=this.dtFormatter(t,n),i=o.formatToParts(),r=i.find(a=>a.type.toLowerCase()===s);return r?r.value:null}numberFormatter(t={}){return new zj(this.intl,t.forceSimple||this.fastNumbers,t)}dtFormatter(t,n={}){return new jj(t,this.intl,n)}relFormatter(t={}){return new Kj(this.intl,this.isEnglish(),t)}listFormatter(t={}){return Mj(this.intl,t)}isEnglish(){return this.locale==="en"||this.locale.toLowerCase()==="en-us"||vx(this.intl).locale.startsWith("en-us")}getWeekSettings(){return this.weekSettings?this.weekSettings:Vx()?Bj(this.locale):yx}getStartOfWeek(){return this.getWeekSettings().firstDay}getMinDaysInFirstWeek(){return this.getWeekSettings().minimalDays}getWeekendDays(){return this.getWeekSettings().weekend}equals(t){return this.locale===t.locale&&this.numberingSystem===t.numberingSystem&&this.outputCalendar===t.outputCalendar}toString(){return`Locale(${this.locale}, ${this.numberingSystem}, ${this.outputCalendar})`}}let tb=null,ir=class Tp extends Mh{static get utcInstance(){return tb===null&&(tb=new Tp(0)),tb}static instance(t){return t===0?Tp.utcInstance:new Tp(t)}static parseSpecifier(t){if(t){const n=t.match(/^utc(?:([+-]\d{1,2})(?::(\d{2}))?)?$/i);if(n)return new Tp(tm(n[1],n[2]))}return null}constructor(t){super(),this.fixed=t}get type(){return"fixed"}get name(){return this.fixed===0?"UTC":`UTC${Bh(this.fixed,"narrow")}`}get ianaName(){return this.fixed===0?"Etc/UTC":`Etc/GMT${Bh(-this.fixed,"narrow")}`}offsetName(){return this.name}formatOffset(t,n){return Bh(this.fixed,n)}get isUniversal(){return!0}offset(){return this.fixed}equals(t){return t.type==="fixed"&&t.fixed===this.fixed}get isValid(){return!0}};class qj extends Mh{constructor(t){super(),this.zoneName=t}get type(){return"invalid"}get name(){return this.zoneName}get isUniversal(){return!1}offsetName(){return null}formatOffset(){return""}offset(){return NaN}equals(){return!1}get isValid(){return!1}}function La(e,t){if($t(e)||e===null)return t;if(e instanceof Mh)return e;if(e7(e)){const n=e.toLowerCase();return n==="default"?t:n==="local"||n==="system"?Yg.instance:n==="utc"||n==="gmt"?ir.utcInstance:ir.parseSpecifier(n)||dc.create(e)}else return Va(e)?ir.instance(e):typeof e=="object"&&"offset"in e&&typeof e.offset=="function"?e:new qj(e)}const nb={arab:"[٠-٩]",arabext:"[۰-۹]",bali:"[᭐-᭙]",beng:"[০-৯]",deva:"[०-९]",fullwide:"[0-9]",gujr:"[૦-૯]",hanidec:"[〇|一|二|三|四|五|六|七|八|九]",khmr:"[០-៩]",knda:"[೦-೯]",laoo:"[໐-໙]",limb:"[᥆-᥏]",mlym:"[൦-൯]",mong:"[᠐-᠙]",mymr:"[၀-၉]",orya:"[୦-୯]",tamldec:"[௦-௯]",telu:"[౦-౯]",thai:"[๐-๙]",tibt:"[༠-༩]",latn:"\\d"},wx={arab:[1632,1641],arabext:[1776,1785],bali:[6992,7001],beng:[2534,2543],deva:[2406,2415],fullwide:[65296,65303],gujr:[2790,2799],khmr:[6112,6121],knda:[3302,3311],laoo:[3792,3801],limb:[6470,6479],mlym:[3430,3439],mong:[6160,6169],mymr:[4160,4169],orya:[2918,2927],tamldec:[3046,3055],telu:[3174,3183],thai:[3664,3673],tibt:[3872,3881]},Yj=nb.hanidec.replace(/[\[|\]]/g,"").split("");function Zj(e){let t=parseInt(e,10);if(isNaN(t)){t="";for(let n=0;n<e.length;n++){const s=e.charCodeAt(n);if(e[n].search(nb.hanidec)!==-1)t+=Yj.indexOf(e[n]);else for(const o in wx){const[i,r]=wx[o];s>=i&&s<=r&&(t+=s-i)}}return parseInt(t,10)}else return t}const sb=new Map;function Xj(){sb.clear()}function xi({numberingSystem:e},t=""){const n=e||"latn";let s=sb.get(n);s===void 0&&(s=new Map,sb.set(n,s));let o=s.get(t);return o===void 0&&(o=new RegExp(`${nb[n]}${t}`),s.set(t,o)),o}let Cx=()=>Date.now(),bx="system",Sx=null,Ex=null,_x=null,Rx=60,Dx,Tx=null;class Zn{static get now(){return Cx}static set now(t){Cx=t}static set defaultZone(t){bx=t}static get defaultZone(){return La(bx,Yg.instance)}static get defaultLocale(){return Sx}static set defaultLocale(t){Sx=t}static get defaultNumberingSystem(){return Ex}static set defaultNumberingSystem(t){Ex=t}static get defaultOutputCalendar(){return _x}static set defaultOutputCalendar(t){_x=t}static get defaultWeekSettings(){return Tx}static set defaultWeekSettings(t){Tx=ab(t)}static get twoDigitCutoffYear(){return Rx}static set twoDigitCutoffYear(t){Rx=t%100}static get throwOnInvalid(){return Dx}static set throwOnInvalid(t){Dx=t}static resetCaches(){bn.resetCache(),dc.resetCache(),bt.resetCache(),Xj()}}class Fi{constructor(t,n){this.reason=t,this.explanation=n}toMessage(){return this.explanation?`${this.reason}: ${this.explanation}`:this.reason}}const Ix=[0,31,59,90,120,151,181,212,243,273,304,334],xx=[0,31,60,91,121,152,182,213,244,274,305,335];function ei(e,t){return new Fi("unit out of range",`you specified ${t} (of type ${typeof t}) as a ${e}, which is invalid`)}function ob(e,t,n){const s=new Date(Date.UTC(e,t-1,n));e<100&&e>=0&&s.setUTCFullYear(s.getUTCFullYear()-1900);const o=s.getUTCDay();return o===0?7:o}function Fx(e,t,n){return n+(Lh(e)?xx:Ix)[t-1]}function Px(e,t){const n=Lh(e)?xx:Ix,s=n.findIndex(i=>i<t),o=t-n[s];return{month:s+1,day:o}}function ib(e,t){return(e-t+7)%7+1}function Xg(e,t=4,n=1){const{year:s,month:o,day:i}=e,r=Fx(s,o,i),a=ib(ob(s,o,i),n);let l=Math.floor((r-a+14-t)/7),u;return l<1?(u=s-1,l=Vh(u,t,n)):l>Vh(s,t,n)?(u=s+1,l=1):u=s,{weekYear:u,weekNumber:l,weekday:a,...sm(e)}}function Ax(e,t=4,n=1){const{weekYear:s,weekNumber:o,weekday:i}=e,r=ib(ob(s,1,t),n),a=fc(s);let l=o*7+i-r-7+t,u;l<1?(u=s-1,l+=fc(u)):l>a?(u=s+1,l-=fc(s)):u=s;const{month:c,day:d}=Px(u,l);return{year:u,month:c,day:d,...sm(e)}}function rb(e){const{year:t,month:n,day:s}=e,o=Fx(t,n,s);return{year:t,ordinal:o,...sm(e)}}function kx(e){const{year:t,ordinal:n}=e,{month:s,day:o}=Px(t,n);return{year:t,month:s,day:o,...sm(e)}}function Ox(e,t){if(!$t(e.localWeekday)||!$t(e.localWeekNumber)||!$t(e.localWeekYear)){if(!$t(e.weekday)||!$t(e.weekNumber)||!$t(e.weekYear))throw new cc("Cannot mix locale-based week fields with ISO-based week fields");return $t(e.localWeekday)||(e.weekday=e.localWeekday),$t(e.localWeekNumber)||(e.weekNumber=e.localWeekNumber),$t(e.localWeekYear)||(e.weekYear=e.localWeekYear),delete e.localWeekday,delete e.localWeekNumber,delete e.localWeekYear,{minDaysInFirstWeek:t.getMinDaysInFirstWeek(),startOfWeek:t.getStartOfWeek()}}else return{minDaysInFirstWeek:4,startOfWeek:1}}function Jj(e,t=4,n=1){const s=Jg(e.weekYear),o=ti(e.weekNumber,1,Vh(e.weekYear,t,n)),i=ti(e.weekday,1,7);return s?o?i?!1:ei("weekday",e.weekday):ei("week",e.weekNumber):ei("weekYear",e.weekYear)}function Qj(e){const t=Jg(e.year),n=ti(e.ordinal,1,fc(e.year));return t?n?!1:ei("ordinal",e.ordinal):ei("year",e.year)}function Mx(e){const t=Jg(e.year),n=ti(e.month,1,12),s=ti(e.day,1,Qg(e.year,e.month));return t?n?s?!1:ei("day",e.day):ei("month",e.month):ei("year",e.year)}function Nx(e){const{hour:t,minute:n,second:s,millisecond:o}=e,i=ti(t,0,23)||t===24&&n===0&&s===0&&o===0,r=ti(n,0,59),a=ti(s,0,59),l=ti(o,0,999);return i?r?a?l?!1:ei("millisecond",o):ei("second",s):ei("minute",n):ei("hour",t)}function $t(e){return typeof e>"u"}function Va(e){return typeof e=="number"}function Jg(e){return typeof e=="number"&&e%1===0}function e7(e){return typeof e=="string"}function t7(e){return Object.prototype.toString.call(e)==="[object Date]"}function Lx(){try{return typeof Intl<"u"&&!!Intl.RelativeTimeFormat}catch{return!1}}function Vx(){try{return typeof Intl<"u"&&!!Intl.Locale&&("weekInfo"in Intl.Locale.prototype||"getWeekInfo"in Intl.Locale.prototype)}catch{return!1}}function n7(e){return Array.isArray(e)?e:[e]}function Bx(e,t,n){if(e.length!==0)return e.reduce((s,o)=>{const i=[t(o),o];return s&&n(s[0],i[0])===s[0]?s:i},null)[1]}function s7(e,t){return t.reduce((n,s)=>(n[s]=e[s],n),{})}function hc(e,t){return Object.prototype.hasOwnProperty.call(e,t)}function ab(e){if(e==null)return null;if(typeof e!="object")throw new Bs("Week settings must be an object");if(!ti(e.firstDay,1,7)||!ti(e.minimalDays,1,7)||!Array.isArray(e.weekend)||e.weekend.some(t=>!ti(t,1,7)))throw new Bs("Invalid week settings");return{firstDay:e.firstDay,minimalDays:e.minimalDays,weekend:Array.from(e.weekend)}}function ti(e,t,n){return Jg(e)&&e>=t&&e<=n}function o7(e,t){return e-t*Math.floor(e/t)}function ds(e,t=2){const n=e<0;let s;return n?s="-"+(""+-e).padStart(t,"0"):s=(""+e).padStart(t,"0"),s}function Ba(e){if(!($t(e)||e===null||e===""))return parseInt(e,10)}function zl(e){if(!($t(e)||e===null||e===""))return parseFloat(e)}function lb(e){if(!($t(e)||e===null||e==="")){const t=parseFloat("0."+e)*1e3;return Math.floor(t)}}function ub(e,t,n="round"){const s=10**t;switch(n){case"expand":return e>0?Math.ceil(e*s)/s:Math.floor(e*s)/s;case"trunc":return Math.trunc(e*s)/s;case"round":return Math.round(e*s)/s;case"floor":return Math.floor(e*s)/s;case"ceil":return Math.ceil(e*s)/s;default:throw new RangeError(`Value rounding ${n} is out of range`)}}function Lh(e){return e%4===0&&(e%100!==0||e%400===0)}function fc(e){return Lh(e)?366:365}function Qg(e,t){const n=o7(t-1,12)+1,s=e+(t-n)/12;return n===2?Lh(s)?29:28:[31,null,31,30,31,30,31,31,30,31,30,31][n-1]}function em(e){let t=Date.UTC(e.year,e.month-1,e.day,e.hour,e.minute,e.second,e.millisecond);return e.year<100&&e.year>=0&&(t=new Date(t),t.setUTCFullYear(e.year,e.month-1,e.day)),+t}function $x(e,t,n){return-ib(ob(e,1,t),n)+t-1}function Vh(e,t=4,n=1){const s=$x(e,t,n),o=$x(e+1,t,n);return(fc(e)-s+o)/7}function cb(e){return e>99?e:e>Zn.twoDigitCutoffYear?1900+e:2e3+e}function Hx(e,t,n,s=null){const o=new Date(e),i={hourCycle:"h23",year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit"};s&&(i.timeZone=s);const r={timeZoneName:t,...i},a=new Intl.DateTimeFormat(n,r).formatToParts(o).find(l=>l.type.toLowerCase()==="timezonename");return a?a.value:null}function tm(e,t){let n=parseInt(e,10);Number.isNaN(n)&&(n=0);const s=parseInt(t,10)||0,o=n<0||Object.is(n,-0)?-s:s;return n*60+o}function Gx(e){const t=Number(e);if(typeof e=="boolean"||e===""||!Number.isFinite(t))throw new Bs(`Invalid unit value ${e}`);return t}function nm(e,t){const n={};for(const s in e)if(hc(e,s)){const o=e[s];if(o==null)continue;n[t(s)]=Gx(o)}return n}function Bh(e,t){const n=Math.trunc(Math.abs(e/60)),s=Math.trunc(Math.abs(e%60)),o=e>=0?"+":"-";switch(t){case"short":return`${o}${ds(n,2)}:${ds(s,2)}`;case"narrow":return`${o}${n}${s>0?`:${s}`:""}`;case"techie":return`${o}${ds(n,2)}${ds(s,2)}`;default:throw new RangeError(`Value format ${t} is out of range for property format`)}}function sm(e){return s7(e,["hour","minute","second","millisecond"])}const i7=["January","February","March","April","May","June","July","August","September","October","November","December"],Ux=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],r7=["J","F","M","A","M","J","J","A","S","O","N","D"];function Wx(e){switch(e){case"narrow":return[...r7];case"short":return[...Ux];case"long":return[...i7];case"numeric":return["1","2","3","4","5","6","7","8","9","10","11","12"];case"2-digit":return["01","02","03","04","05","06","07","08","09","10","11","12"];default:return null}}const zx=["Monday","Tuesday","Wednesday","Thursday","Friday","Saturday","Sunday"],jx=["Mon","Tue","Wed","Thu","Fri","Sat","Sun"],a7=["M","T","W","T","F","S","S"];function Kx(e){switch(e){case"narrow":return[...a7];case"short":return[...jx];case"long":return[...zx];case"numeric":return["1","2","3","4","5","6","7"];default:return null}}const qx=["AM","PM"],l7=["Before Christ","Anno Domini"],u7=["BC","AD"],c7=["B","A"];function Yx(e){switch(e){case"narrow":return[...c7];case"short":return[...u7];case"long":return[...l7];default:return null}}function d7(e){return qx[e.hour<12?0:1]}function h7(e,t){return Kx(t)[e.weekday-1]}function f7(e,t){return Wx(t)[e.month-1]}function p7(e,t){return Yx(t)[e.year<0?0:1]}function g7(e,t,n="always",s=!1){const o={years:["year","yr."],quarters:["quarter","qtr."],months:["month","mo."],weeks:["week","wk."],days:["day","day","days"],hours:["hour","hr."],minutes:["minute","min."],seconds:["second","sec."]},i=["hours","minutes","seconds"].indexOf(e)===-1;if(n==="auto"&&i){const d=e==="days";switch(t){case 1:return d?"tomorrow":`next ${o[e][0]}`;case-1:return d?"yesterday":`last ${o[e][0]}`;case 0:return d?"today":`this ${o[e][0]}`}}const r=Object.is(t,-0)||t<0,a=Math.abs(t),l=a===1,u=o[e],c=s?l?u[1]:u[2]||u[1]:l?o[e][0]:e;return r?`${a} ${c} ago`:`in ${a} ${c}`}function Zx(e,t){let n="";for(const s of e)s.literal?n+=s.val:n+=t(s.val);return n}const m7={D:qg,DD:XI,DDD:JI,DDDD:QI,t:ex,tt:tx,ttt:nx,tttt:sx,T:ox,TT:ix,TTT:rx,TTTT:ax,f:lx,ff:cx,fff:hx,ffff:px,F:ux,FF:dx,FFF:fx,FFFF:gx};class $s{static create(t,n={}){return new $s(t,n)}static parseFormat(t){let n=null,s="",o=!1;const i=[];for(let r=0;r<t.length;r++){const a=t.charAt(r);a==="'"?((s.length>0||o)&&i.push({literal:o||/^\s+$/.test(s),val:s===""?"'":s}),n=null,s="",o=!o):o||a===n?s+=a:(s.length>0&&i.push({literal:/^\s+$/.test(s),val:s}),s=a,n=a)}return s.length>0&&i.push({literal:o||/^\s+$/.test(s),val:s}),i}static macroTokenToFormatOpts(t){return m7[t]}constructor(t,n){this.opts=n,this.loc=t,this.systemLoc=null}formatWithSystemDefault(t,n){return this.systemLoc===null&&(this.systemLoc=this.loc.redefaultToSystem()),this.systemLoc.dtFormatter(t,{...this.opts,...n}).format()}dtFormatter(t,n={}){return this.loc.dtFormatter(t,{...this.opts,...n})}formatDateTime(t,n){return this.dtFormatter(t,n).format()}formatDateTimeParts(t,n){return this.dtFormatter(t,n).formatToParts()}formatInterval(t,n){return this.dtFormatter(t.start,n).dtf.formatRange(t.start.toJSDate(),t.end.toJSDate())}resolvedOptions(t,n){return this.dtFormatter(t,n).resolvedOptions()}num(t,n=0,s=void 0){if(this.opts.forceSimple)return ds(t,n);const o={...this.opts};return n>0&&(o.padTo=n),s&&(o.signDisplay=s),this.loc.numberFormatter(o).format(t)}formatDateTimeFromString(t,n){const s=this.loc.listingMode()==="en",o=this.loc.outputCalendar&&this.loc.outputCalendar!=="gregory",i=(f,p)=>this.loc.extract(t,f,p),r=f=>t.isOffsetFixed&&t.offset===0&&f.allowZ?"Z":t.isValid?t.zone.formatOffset(t.ts,f.format):"",a=()=>s?d7(t):i({hour:"numeric",hourCycle:"h12"},"dayperiod"),l=(f,p)=>s?f7(t,f):i(p?{month:f}:{month:f,day:"numeric"},"month"),u=(f,p)=>s?h7(t,f):i(p?{weekday:f}:{weekday:f,month:"long",day:"numeric"},"weekday"),c=f=>{const p=$s.macroTokenToFormatOpts(f);return p?this.formatWithSystemDefault(t,p):f},d=f=>s?p7(t,f):i({era:f},"era"),h=f=>{switch(f){case"S":return this.num(t.millisecond);case"u":case"SSS":return this.num(t.millisecond,3);case"s":return this.num(t.second);case"ss":return this.num(t.second,2);case"uu":return this.num(Math.floor(t.millisecond/10),2);case"uuu":return this.num(Math.floor(t.millisecond/100));case"m":return this.num(t.minute);case"mm":return this.num(t.minute,2);case"h":return this.num(t.hour%12===0?12:t.hour%12);case"hh":return this.num(t.hour%12===0?12:t.hour%12,2);case"H":return this.num(t.hour);case"HH":return this.num(t.hour,2);case"Z":return r({format:"narrow",allowZ:this.opts.allowZ});case"ZZ":return r({format:"short",allowZ:this.opts.allowZ});case"ZZZ":return r({format:"techie",allowZ:this.opts.allowZ});case"ZZZZ":return t.zone.offsetName(t.ts,{format:"short",locale:this.loc.locale});case"ZZZZZ":return t.zone.offsetName(t.ts,{format:"long",locale:this.loc.locale});case"z":return t.zoneName;case"a":return a();case"d":return o?i({day:"numeric"},"day"):this.num(t.day);case"dd":return o?i({day:"2-digit"},"day"):this.num(t.day,2);case"c":return this.num(t.weekday);case"ccc":return u("short",!0);case"cccc":return u("long",!0);case"ccccc":return u("narrow",!0);case"E":return this.num(t.weekday);case"EEE":return u("short",!1);case"EEEE":return u("long",!1);case"EEEEE":return u("narrow",!1);case"L":return o?i({month:"numeric",day:"numeric"},"month"):this.num(t.month);case"LL":return o?i({month:"2-digit",day:"numeric"},"month"):this.num(t.month,2);case"LLL":return l("short",!0);case"LLLL":return l("long",!0);case"LLLLL":return l("narrow",!0);case"M":return o?i({month:"numeric"},"month"):this.num(t.month);case"MM":return o?i({month:"2-digit"},"month"):this.num(t.month,2);case"MMM":return l("short",!1);case"MMMM":return l("long",!1);case"MMMMM":return l("narrow",!1);case"y":return o?i({year:"numeric"},"year"):this.num(t.year);case"yy":return o?i({year:"2-digit"},"year"):this.num(t.year.toString().slice(-2),2);case"yyyy":return o?i({year:"numeric"},"year"):this.num(t.year,4);case"yyyyyy":return o?i({year:"numeric"},"year"):this.num(t.year,6);case"G":return d("short");case"GG":return d("long");case"GGGGG":return d("narrow");case"kk":return this.num(t.weekYear.toString().slice(-2),2);case"kkkk":return this.num(t.weekYear,4);case"W":return this.num(t.weekNumber);case"WW":return this.num(t.weekNumber,2);case"n":return this.num(t.localWeekNumber);case"nn":return this.num(t.localWeekNumber,2);case"ii":return this.num(t.localWeekYear.toString().slice(-2),2);case"iiii":return this.num(t.localWeekYear,4);case"o":return this.num(t.ordinal);case"ooo":return this.num(t.ordinal,3);case"q":return this.num(t.quarter);case"qq":return this.num(t.quarter,2);case"X":return this.num(Math.floor(t.ts/1e3));case"x":return this.num(t.ts);default:return c(f)}};return Zx($s.parseFormat(n),h)}formatDurationFromString(t,n){const s=this.opts.signMode==="negativeLargestOnly"?-1:1,o=c=>{switch(c[0]){case"S":return"milliseconds";case"s":return"seconds";case"m":return"minutes";case"h":return"hours";case"d":return"days";case"w":return"weeks";case"M":return"months";case"y":return"years";default:return null}},i=(c,d)=>h=>{const f=o(h);if(f){const p=d.isNegativeDuration&&f!==d.largestUnit?s:1;let g;return this.opts.signMode==="negativeLargestOnly"&&f!==d.largestUnit?g="never":this.opts.signMode==="all"?g="always":g="auto",this.num(c.get(f)*p,h.length,g)}else return h},r=$s.parseFormat(n),a=r.reduce((c,{literal:d,val:h})=>d?c:c.concat(h),[]),l=t.shiftTo(...a.map(o).filter(c=>c)),u={isNegativeDuration:l<0,largestUnit:Object.keys(l.values)[0]};return Zx(r,i(l,u))}}const Xx=/[A-Za-z_+-]{1,256}(?::?\/[A-Za-z0-9_+-]{1,256}(?:\/[A-Za-z0-9_+-]{1,256})?)?/;function pc(...e){const t=e.reduce((n,s)=>n+s.source,"");return RegExp(`^${t}$`)}function gc(...e){return t=>e.reduce(([n,s,o],i)=>{const[r,a,l]=i(t,o);return[{...n,...r},a||s,l]},[{},null,1]).slice(0,2)}function mc(e,...t){if(e==null)return[null,null];for(const[n,s]of t){const o=n.exec(e);if(o)return s(o)}return[null,null]}function Jx(...e){return(t,n)=>{const s={};let o;for(o=0;o<e.length;o++)s[e[o]]=Ba(t[n+o]);return[s,null,n+o]}}const Qx=/(?:([Zz])|([+-]\d\d)(?::?(\d\d))?)/,v7=`(?:${Qx.source}?(?:\\[(${Xx.source})\\])?)?`,db=/(\d\d)(?::?(\d\d)(?::?(\d\d)(?:[.,](\d{1,30}))?)?)?/,eF=RegExp(`${db.source}${v7}`),hb=RegExp(`(?:[Tt]${eF.source})?`),y7=/([+-]\d{6}|\d{4})(?:-?(\d\d)(?:-?(\d\d))?)?/,w7=/(\d{4})-?W(\d\d)(?:-?(\d))?/,C7=/(\d{4})-?(\d{3})/,b7=Jx("weekYear","weekNumber","weekDay"),S7=Jx("year","ordinal"),E7=/(\d{4})-(\d\d)-(\d\d)/,tF=RegExp(`${db.source} ?(?:${Qx.source}|(${Xx.source}))?`),_7=RegExp(`(?: ${tF.source})?`);function vc(e,t,n){const s=e[t];return $t(s)?n:Ba(s)}function R7(e,t){return[{year:vc(e,t),month:vc(e,t+1,1),day:vc(e,t+2,1)},null,t+3]}function yc(e,t){return[{hours:vc(e,t,0),minutes:vc(e,t+1,0),seconds:vc(e,t+2,0),milliseconds:lb(e[t+3])},null,t+4]}function $h(e,t){const n=!e[t]&&!e[t+1],s=tm(e[t+1],e[t+2]),o=n?null:ir.instance(s);return[{},o,t+3]}function Hh(e,t){const n=e[t]?dc.create(e[t]):null;return[{},n,t+1]}const D7=RegExp(`^T?${db.source}$`),T7=/^-?P(?:(?:(-?\d{1,20}(?:\.\d{1,20})?)Y)?(?:(-?\d{1,20}(?:\.\d{1,20})?)M)?(?:(-?\d{1,20}(?:\.\d{1,20})?)W)?(?:(-?\d{1,20}(?:\.\d{1,20})?)D)?(?:T(?:(-?\d{1,20}(?:\.\d{1,20})?)H)?(?:(-?\d{1,20}(?:\.\d{1,20})?)M)?(?:(-?\d{1,20})(?:[.,](-?\d{1,20}))?S)?)?)$/;function I7(e){const[t,n,s,o,i,r,a,l,u]=e,c=t[0]==="-",d=l&&l[0]==="-",h=(f,p=!1)=>f!==void 0&&(p||f&&c)?-f:f;return[{years:h(zl(n)),months:h(zl(s)),weeks:h(zl(o)),days:h(zl(i)),hours:h(zl(r)),minutes:h(zl(a)),seconds:h(zl(l),l==="-0"),milliseconds:h(lb(u),d)}]}const x7={GMT:0,EDT:-4*60,EST:-5*60,CDT:-5*60,CST:-6*60,MDT:-6*60,MST:-7*60,PDT:-7*60,PST:-8*60};function fb(e,t,n,s,o,i,r){const a={year:t.length===2?cb(Ba(t)):Ba(t),month:Ux.indexOf(n)+1,day:Ba(s),hour:Ba(o),minute:Ba(i)};return r&&(a.second=Ba(r)),e&&(a.weekday=e.length>3?zx.indexOf(e)+1:jx.indexOf(e)+1),a}const F7=/^(?:(Mon|Tue|Wed|Thu|Fri|Sat|Sun),\s)?(\d{1,2})\s(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)\s(\d{2,4})\s(\d\d):(\d\d)(?::(\d\d))?\s(?:(UT|GMT|[ECMP][SD]T)|([Zz])|(?:([+-]\d\d)(\d\d)))$/;function P7(e){const[,t,n,s,o,i,r,a,l,u,c,d]=e,h=fb(t,o,s,n,i,r,a);let f;return l?f=x7[l]:u?f=0:f=tm(c,d),[h,new ir(f)]}function A7(e){return e.replace(/\([^()]*\)|[\n\t]/g," ").replace(/(\s\s+)/g," ").trim()}const k7=/^(Mon|Tue|Wed|Thu|Fri|Sat|Sun), (\d\d) (Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec) (\d{4}) (\d\d):(\d\d):(\d\d) GMT$/,O7=/^(Monday|Tuesday|Wednesday|Thursday|Friday|Saturday|Sunday), (\d\d)-(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)-(\d\d) (\d\d):(\d\d):(\d\d) GMT$/,M7=/^(Mon|Tue|Wed|Thu|Fri|Sat|Sun) (Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec) ( \d|\d\d) (\d\d):(\d\d):(\d\d) (\d{4})$/;function nF(e){const[,t,n,s,o,i,r,a]=e;return[fb(t,o,s,n,i,r,a),ir.utcInstance]}function N7(e){const[,t,n,s,o,i,r,a]=e;return[fb(t,a,n,s,o,i,r),ir.utcInstance]}const L7=pc(y7,hb),V7=pc(w7,hb),B7=pc(C7,hb),$7=pc(eF),sF=gc(R7,yc,$h,Hh),H7=gc(b7,yc,$h,Hh),G7=gc(S7,yc,$h,Hh),U7=gc(yc,$h,Hh);function W7(e){return mc(e,[L7,sF],[V7,H7],[B7,G7],[$7,U7])}function z7(e){return mc(A7(e),[F7,P7])}function j7(e){return mc(e,[k7,nF],[O7,nF],[M7,N7])}function K7(e){return mc(e,[T7,I7])}const q7=gc(yc);function Y7(e){return mc(e,[D7,q7])}const Z7=pc(E7,_7),X7=pc(tF),J7=gc(yc,$h,Hh);function Q7(e){return mc(e,[Z7,sF],[X7,J7])}const oF="Invalid Duration",iF={weeks:{days:7,hours:7*24,minutes:7*24*60,seconds:7*24*60*60,milliseconds:7*24*60*60*1e3},days:{hours:24,minutes:24*60,seconds:24*60*60,milliseconds:24*60*60*1e3},hours:{minutes:60,seconds:60*60,milliseconds:60*60*1e3},minutes:{seconds:60,milliseconds:60*1e3},seconds:{milliseconds:1e3}},eK={years:{quarters:4,months:12,weeks:52,days:365,hours:365*24,minutes:365*24*60,seconds:365*24*60*60,milliseconds:365*24*60*60*1e3},quarters:{months:3,weeks:13,days:91,hours:91*24,minutes:91*24*60,seconds:91*24*60*60,milliseconds:91*24*60*60*1e3},months:{weeks:4,days:30,hours:30*24,minutes:30*24*60,seconds:30*24*60*60,milliseconds:30*24*60*60*1e3},...iF},ni=146097/400,wc=146097/4800,tK={years:{quarters:4,months:12,weeks:ni/7,days:ni,hours:ni*24,minutes:ni*24*60,seconds:ni*24*60*60,milliseconds:ni*24*60*60*1e3},quarters:{months:3,weeks:ni/28,days:ni/4,hours:ni*24/4,minutes:ni*24*60/4,seconds:ni*24*60*60/4,milliseconds:ni*24*60*60*1e3/4},months:{weeks:wc/7,days:wc,hours:wc*24,minutes:wc*24*60,seconds:wc*24*60*60,milliseconds:wc*24*60*60*1e3},...iF},jl=["years","quarters","months","weeks","days","hours","minutes","seconds","milliseconds"],nK=jl.slice(0).reverse();function Yr(e,t,n=!1){const s={values:n?t.values:{...e.values,...t.values||{}},loc:e.loc.clone(t.loc),conversionAccuracy:t.conversionAccuracy||e.conversionAccuracy,matrix:t.matrix||e.matrix};return new hn(s)}function rF(e,t){let n=t.milliseconds??0;for(const s of nK.slice(1))t[s]&&(n+=t[s]*e[s].milliseconds);return n}function aF(e,t){const n=rF(e,t)<0?-1:1;jl.reduceRight((s,o)=>{if($t(t[o]))return s;if(s){const i=t[s]*n,r=e[o][s],a=Math.floor(i/r);t[o]+=a*n,t[s]-=a*r*n}return o},null),jl.reduce((s,o)=>{if($t(t[o]))return s;if(s){const i=t[s]%1;t[s]-=i,t[o]+=i*e[s][o]}return o},null)}function lF(e){const t={};for(const[n,s]of Object.entries(e))s!==0&&(t[n]=s);return t}class hn{constructor(t){const n=t.conversionAccuracy==="longterm"||!1;let s=n?tK:eK;t.matrix&&(s=t.matrix),this.values=t.values,this.loc=t.loc||bn.create(),this.conversionAccuracy=n?"longterm":"casual",this.invalid=t.invalid||null,this.matrix=s,this.isLuxonDuration=!0}static fromMillis(t,n){return hn.fromObject({milliseconds:t},n)}static fromObject(t,n={}){if(t==null||typeof t!="object")throw new Bs(`Duration.fromObject: argument expected to be an object, got ${t===null?"null":typeof t}`);return new hn({values:nm(t,hn.normalizeUnit),loc:bn.fromObject(n),conversionAccuracy:n.conversionAccuracy,matrix:n.matrix})}static fromDurationLike(t){if(Va(t))return hn.fromMillis(t);if(hn.isDuration(t))return t;if(typeof t=="object")return hn.fromObject(t);throw new Bs(`Unknown duration argument ${t} of type ${typeof t}`)}static fromISO(t,n){const[s]=K7(t);return s?hn.fromObject(s,n):hn.invalid("unparsable",`the input "${t}" can't be parsed as ISO 8601`)}static fromISOTime(t,n){const[s]=Y7(t);return s?hn.fromObject(s,n):hn.invalid("unparsable",`the input "${t}" can't be parsed as ISO 8601`)}static invalid(t,n=null){if(!t)throw new Bs("need to specify a reason the Duration is invalid");const s=t instanceof Fi?t:new Fi(t,n);if(Zn.throwOnInvalid)throw new Ij(s);return new hn({invalid:s})}static normalizeUnit(t){const n={year:"years",years:"years",quarter:"quarters",quarters:"quarters",month:"months",months:"months",week:"weeks",weeks:"weeks",day:"days",days:"days",hour:"hours",hours:"hours",minute:"minutes",minutes:"minutes",second:"seconds",seconds:"seconds",millisecond:"milliseconds",milliseconds:"milliseconds"}[t&&t.toLowerCase()];if(!n)throw new ZI(t);return n}static isDuration(t){return t&&t.isLuxonDuration||!1}get locale(){return this.isValid?this.loc.locale:null}get numberingSystem(){return this.isValid?this.loc.numberingSystem:null}toFormat(t,n={}){const s={...n,floor:n.round!==!1&&n.floor!==!1};return this.isValid?$s.create(this.loc,s).formatDurationFromString(this,t):oF}toHuman(t={}){if(!this.isValid)return oF;const n=t.showZeros!==!1,s=jl.map(o=>{const i=this.values[o];return $t(i)||i===0&&!n?null:this.loc.numberFormatter({style:"unit",unitDisplay:"long",...t,unit:o.slice(0,-1)}).format(i)}).filter(o=>o);return this.loc.listFormatter({type:"conjunction",style:t.listStyle||"narrow",...t}).format(s)}toObject(){return this.isValid?{...this.values}:{}}toISO(){if(!this.isValid)return null;let t="P";return this.years!==0&&(t+=this.years+"Y"),(this.months!==0||this.quarters!==0)&&(t+=this.months+this.quarters*3+"M"),this.weeks!==0&&(t+=this.weeks+"W"),this.days!==0&&(t+=this.days+"D"),(this.hours!==0||this.minutes!==0||this.seconds!==0||this.milliseconds!==0)&&(t+="T"),this.hours!==0&&(t+=this.hours+"H"),this.minutes!==0&&(t+=this.minutes+"M"),(this.seconds!==0||this.milliseconds!==0)&&(t+=ub(this.seconds+this.milliseconds/1e3,3)+"S"),t==="P"&&(t+="T0S"),t}toISOTime(t={}){if(!this.isValid)return null;const n=this.toMillis();return n<0||n>=864e5?null:(t={suppressMilliseconds:!1,suppressSeconds:!1,includePrefix:!1,format:"extended",...t,includeOffset:!1},bt.fromMillis(n,{zone:"UTC"}).toISOTime(t))}toJSON(){return this.toISO()}toString(){return this.toISO()}[Symbol.for("nodejs.util.inspect.custom")](){return this.isValid?`Duration { values: ${JSON.stringify(this.values)} }`:`Duration { Invalid, reason: ${this.invalidReason} }`}toMillis(){return this.isValid?rF(this.matrix,this.values):NaN}valueOf(){return this.toMillis()}plus(t){if(!this.isValid)return this;const n=hn.fromDurationLike(t),s={};for(const o of jl)(hc(n.values,o)||hc(this.values,o))&&(s[o]=n.get(o)+this.get(o));return Yr(this,{values:s},!0)}minus(t){if(!this.isValid)return this;const n=hn.fromDurationLike(t);return this.plus(n.negate())}mapUnits(t){if(!this.isValid)return this;const n={};for(const s of Object.keys(this.values))n[s]=Gx(t(this.values[s],s));return Yr(this,{values:n},!0)}get(t){return this[hn.normalizeUnit(t)]}set(t){if(!this.isValid)return this;const n={...this.values,...nm(t,hn.normalizeUnit)};return Yr(this,{values:n})}reconfigure({locale:t,numberingSystem:n,conversionAccuracy:s,matrix:o}={}){const r={loc:this.loc.clone({locale:t,numberingSystem:n}),matrix:o,conversionAccuracy:s};return Yr(this,r)}as(t){return this.isValid?this.shiftTo(t).get(t):NaN}normalize(){if(!this.isValid)return this;const t=this.toObject();return aF(this.matrix,t),Yr(this,{values:t},!0)}rescale(){if(!this.isValid)return this;const t=lF(this.normalize().shiftToAll().toObject());return Yr(this,{values:t},!0)}shiftTo(...t){if(!this.isValid)return this;if(t.length===0)return this;t=t.map(r=>hn.normalizeUnit(r));const n={},s={},o=this.toObject();let i;for(const r of jl)if(t.indexOf(r)>=0){i=r;let a=0;for(const u in s)a+=this.matrix[u][r]*s[u],s[u]=0;Va(o[r])&&(a+=o[r]);const l=Math.trunc(a);n[r]=l,s[r]=(a*1e3-l*1e3)/1e3}else Va(o[r])&&(s[r]=o[r]);for(const r in s)s[r]!==0&&(n[i]+=r===i?s[r]:s[r]/this.matrix[i][r]);return aF(this.matrix,n),Yr(this,{values:n},!0)}shiftToAll(){return this.isValid?this.shiftTo("years","months","weeks","days","hours","minutes","seconds","milliseconds"):this}negate(){if(!this.isValid)return this;const t={};for(const n of Object.keys(this.values))t[n]=this.values[n]===0?0:-this.values[n];return Yr(this,{values:t},!0)}removeZeros(){if(!this.isValid)return this;const t=lF(this.values);return Yr(this,{values:t},!0)}get years(){return this.isValid?this.values.years||0:NaN}get quarters(){return this.isValid?this.values.quarters||0:NaN}get months(){return this.isValid?this.values.months||0:NaN}get weeks(){return this.isValid?this.values.weeks||0:NaN}get days(){return this.isValid?this.values.days||0:NaN}get hours(){return this.isValid?this.values.hours||0:NaN}get minutes(){return this.isValid?this.values.minutes||0:NaN}get seconds(){return this.isValid?this.values.seconds||0:NaN}get milliseconds(){return this.isValid?this.values.milliseconds||0:NaN}get isValid(){return this.invalid===null}get invalidReason(){return this.invalid?this.invalid.reason:null}get invalidExplanation(){return this.invalid?this.invalid.explanation:null}equals(t){if(!this.isValid||!t.isValid||!this.loc.equals(t.loc))return!1;function n(s,o){return s===void 0||s===0?o===void 0||o===0:s===o}for(const s of jl)if(!n(this.values[s],t.values[s]))return!1;return!0}}const Cc="Invalid Interval";function sK(e,t){return!e||!e.isValid?Xn.invalid("missing or invalid start"):!t||!t.isValid?Xn.invalid("missing or invalid end"):t<e?Xn.invalid("end before start",`The end of an interval must be after its start, but you had start=${e.toISO()} and end=${t.toISO()}`):null}class Xn{constructor(t){this.s=t.start,this.e=t.end,this.invalid=t.invalid||null,this.isLuxonInterval=!0}static invalid(t,n=null){if(!t)throw new Bs("need to specify a reason the Interval is invalid");const s=t instanceof Fi?t:new Fi(t,n);if(Zn.throwOnInvalid)throw new Tj(s);return new Xn({invalid:s})}static fromDateTimes(t,n){const s=Wh(t),o=Wh(n),i=sK(s,o);return i??new Xn({start:s,end:o})}static after(t,n){const s=hn.fromDurationLike(n),o=Wh(t);return Xn.fromDateTimes(o,o.plus(s))}static before(t,n){const s=hn.fromDurationLike(n),o=Wh(t);return Xn.fromDateTimes(o.minus(s),o)}static fromISO(t,n){const[s,o]=(t||"").split("/",2);if(s&&o){let i,r;try{i=bt.fromISO(s,n),r=i.isValid}catch{r=!1}let a,l;try{a=bt.fromISO(o,n),l=a.isValid}catch{l=!1}if(r&&l)return Xn.fromDateTimes(i,a);if(r){const u=hn.fromISO(o,n);if(u.isValid)return Xn.after(i,u)}else if(l){const u=hn.fromISO(s,n);if(u.isValid)return Xn.before(a,u)}}return Xn.invalid("unparsable",`the input "${t}" can't be parsed as ISO 8601`)}static isInterval(t){return t&&t.isLuxonInterval||!1}get start(){return this.isValid?this.s:null}get end(){return this.isValid?this.e:null}get lastDateTime(){return this.isValid&&this.e?this.e.minus(1):null}get isValid(){return this.invalidReason===null}get invalidReason(){return this.invalid?this.invalid.reason:null}get invalidExplanation(){return this.invalid?this.invalid.explanation:null}length(t="milliseconds"){return this.isValid?this.toDuration(t).get(t):NaN}count(t="milliseconds",n){if(!this.isValid)return NaN;const s=this.start.startOf(t,n);let o;return n!=null&&n.useLocaleWeeks?o=this.end.reconfigure({locale:s.locale}):o=this.end,o=o.startOf(t,n),Math.floor(o.diff(s,t).get(t))+(o.valueOf()!==this.end.valueOf())}hasSame(t){return this.isValid?this.isEmpty()||this.e.minus(1).hasSame(this.s,t):!1}isEmpty(){return this.s.valueOf()===this.e.valueOf()}isAfter(t){return this.isValid?this.s>t:!1}isBefore(t){return this.isValid?this.e<=t:!1}contains(t){return this.isValid?this.s<=t&&this.e>t:!1}set({start:t,end:n}={}){return this.isValid?Xn.fromDateTimes(t||this.s,n||this.e):this}splitAt(...t){if(!this.isValid)return[];const n=t.map(Wh).filter(r=>this.contains(r)).sort((r,a)=>r.toMillis()-a.toMillis()),s=[];let{s:o}=this,i=0;for(;o<this.e;){const r=n[i]||this.e,a=+r>+this.e?this.e:r;s.push(Xn.fromDateTimes(o,a)),o=a,i+=1}return s}splitBy(t){const n=hn.fromDurationLike(t);if(!this.isValid||!n.isValid||n.as("milliseconds")===0)return[];let{s}=this,o=1,i;const r=[];for(;s<this.e;){const a=this.start.plus(n.mapUnits(l=>l*o));i=+a>+this.e?this.e:a,r.push(Xn.fromDateTimes(s,i)),s=i,o+=1}return r}divideEqually(t){return this.isValid?this.splitBy(this.length()/t).slice(0,t):[]}overlaps(t){return this.e>t.s&&this.s<t.e}abutsStart(t){return this.isValid?+this.e==+t.s:!1}abutsEnd(t){return this.isValid?+t.e==+this.s:!1}engulfs(t){return this.isValid?this.s<=t.s&&this.e>=t.e:!1}equals(t){return!this.isValid||!t.isValid?!1:this.s.equals(t.s)&&this.e.equals(t.e)}intersection(t){if(!this.isValid)return this;const n=this.s>t.s?this.s:t.s,s=this.e<t.e?this.e:t.e;return n>=s?null:Xn.fromDateTimes(n,s)}union(t){if(!this.isValid)return this;const n=this.s<t.s?this.s:t.s,s=this.e>t.e?this.e:t.e;return Xn.fromDateTimes(n,s)}static merge(t){const[n,s]=t.sort((o,i)=>o.s-i.s).reduce(([o,i],r)=>i?i.overlaps(r)||i.abutsStart(r)?[o,i.union(r)]:[o.concat([i]),r]:[o,r],[[],null]);return s&&n.push(s),n}static xor(t){let n=null,s=0;const o=[],i=t.map(l=>[{time:l.s,type:"s"},{time:l.e,type:"e"}]),r=Array.prototype.concat(...i),a=r.sort((l,u)=>l.time-u.time);for(const l of a)s+=l.type==="s"?1:-1,s===1?n=l.time:(n&&+n!=+l.time&&o.push(Xn.fromDateTimes(n,l.time)),n=null);return Xn.merge(o)}difference(...t){return Xn.xor([this].concat(t)).map(n=>this.intersection(n)).filter(n=>n&&!n.isEmpty())}toString(){return this.isValid?`[${this.s.toISO()} – ${this.e.toISO()})`:Cc}[Symbol.for("nodejs.util.inspect.custom")](){return this.isValid?`Interval { start: ${this.s.toISO()}, end: ${this.e.toISO()} }`:`Interval { Invalid, reason: ${this.invalidReason} }`}toLocaleString(t=qg,n={}){return this.isValid?$s.create(this.s.loc.clone(n),t).formatInterval(this):Cc}toISO(t){return this.isValid?`${this.s.toISO(t)}/${this.e.toISO(t)}`:Cc}toISODate(){return this.isValid?`${this.s.toISODate()}/${this.e.toISODate()}`:Cc}toISOTime(t){return this.isValid?`${this.s.toISOTime(t)}/${this.e.toISOTime(t)}`:Cc}toFormat(t,{separator:n=" – "}={}){return this.isValid?`${this.s.toFormat(t)}${n}${this.e.toFormat(t)}`:Cc}toDuration(t,n){return this.isValid?this.e.diff(this.s,t,n):hn.invalid(this.invalidReason)}mapEndpoints(t){return Xn.fromDateTimes(t(this.s),t(this.e))}}class bc{static hasDST(t=Zn.defaultZone){const n=bt.now().setZone(t).set({month:12});return!t.isUniversal&&n.offset!==n.set({month:6}).offset}static isValidIANAZone(t){return dc.isValidZone(t)}static normalizeZone(t){return La(t,Zn.defaultZone)}static getStartOfWeek({locale:t=null,locObj:n=null}={}){return(n||bn.create(t)).getStartOfWeek()}static getMinimumDaysInFirstWeek({locale:t=null,locObj:n=null}={}){return(n||bn.create(t)).getMinDaysInFirstWeek()}static getWeekendWeekdays({locale:t=null,locObj:n=null}={}){return(n||bn.create(t)).getWeekendDays().slice()}static months(t="long",{locale:n=null,numberingSystem:s=null,locObj:o=null,outputCalendar:i="gregory"}={}){return(o||bn.create(n,s,i)).months(t)}static monthsFormat(t="long",{locale:n=null,numberingSystem:s=null,locObj:o=null,outputCalendar:i="gregory"}={}){return(o||bn.create(n,s,i)).months(t,!0)}static weekdays(t="long",{locale:n=null,numberingSystem:s=null,locObj:o=null}={}){return(o||bn.create(n,s,null)).weekdays(t)}static weekdaysFormat(t="long",{locale:n=null,numberingSystem:s=null,locObj:o=null}={}){return(o||bn.create(n,s,null)).weekdays(t,!0)}static meridiems({locale:t=null}={}){return bn.create(t).meridiems()}static eras(t="short",{locale:n=null}={}){return bn.create(n,null,"gregory").eras(t)}static features(){return{relative:Lx(),localeWeek:Vx()}}}function uF(e,t){const n=o=>o.toUTC(0,{keepLocalTime:!0}).startOf("day").valueOf(),s=n(t)-n(e);return Math.floor(hn.fromMillis(s).as("days"))}function oK(e,t,n){const s=[["years",(l,u)=>u.year-l.year],["quarters",(l,u)=>u.quarter-l.quarter+(u.year-l.year)*4],["months",(l,u)=>u.month-l.month+(u.year-l.year)*12],["weeks",(l,u)=>{const c=uF(l,u);return(c-c%7)/7}],["days",uF]],o={},i=e;let r,a;for(const[l,u]of s)n.indexOf(l)>=0&&(r=l,o[l]=u(e,t),a=i.plus(o),a>t?(o[l]--,e=i.plus(o),e>t&&(a=e,o[l]--,e=i.plus(o))):e=a);return[e,o,a,r]}function iK(e,t,n,s){let[o,i,r,a]=oK(e,t,n);const l=t-o,u=n.filter(d=>["hours","minutes","seconds","milliseconds"].indexOf(d)>=0);u.length===0&&(r<t&&(r=o.plus({[a]:1})),r!==o&&(i[a]=(i[a]||0)+l/(r-o)));const c=hn.fromObject(i,s);return u.length>0?hn.fromMillis(l,s).shiftTo(...u).plus(c):c}const rK="missing Intl.DateTimeFormat.formatToParts support";function vn(e,t=n=>n){return{regex:e,deser:([n])=>t(Zj(n))}}const cF="[ ]",dF=new RegExp(cF,"g");function aK(e){return e.replace(/\./g,"\\.?").replace(dF,cF)}function hF(e){return e.replace(/\./g,"").replace(dF," ").toLowerCase()}function Pi(e,t){return e===null?null:{regex:RegExp(e.map(aK).join("|")),deser:([n])=>e.findIndex(s=>hF(n)===hF(s))+t}}function fF(e,t){return{regex:e,deser:([,n,s])=>tm(n,s),groups:t}}function om(e){return{regex:e,deser:([t])=>t}}function lK(e){return e.replace(/[\-\[\]{}()*+?.,\\\^$|#\s]/g,"\\$&")}function uK(e,t){const n=xi(t),s=xi(t,"{2}"),o=xi(t,"{3}"),i=xi(t,"{4}"),r=xi(t,"{6}"),a=xi(t,"{1,2}"),l=xi(t,"{1,3}"),u=xi(t,"{1,6}"),c=xi(t,"{1,9}"),d=xi(t,"{2,4}"),h=xi(t,"{4,6}"),f=v=>({regex:RegExp(lK(v.val)),deser:([C])=>C,literal:!0}),g=(v=>{if(e.literal)return f(v);switch(v.val){case"G":return Pi(t.eras("short"),0);case"GG":return Pi(t.eras("long"),0);case"y":return vn(u);case"yy":return vn(d,cb);case"yyyy":return vn(i);case"yyyyy":return vn(h);case"yyyyyy":return vn(r);case"M":return vn(a);case"MM":return vn(s);case"MMM":return Pi(t.months("short",!0),1);case"MMMM":return Pi(t.months("long",!0),1);case"L":return vn(a);case"LL":return vn(s);case"LLL":return Pi(t.months("short",!1),1);case"LLLL":return Pi(t.months("long",!1),1);case"d":return vn(a);case"dd":return vn(s);case"o":return vn(l);case"ooo":return vn(o);case"HH":return vn(s);case"H":return vn(a);case"hh":return vn(s);case"h":return vn(a);case"mm":return vn(s);case"m":return vn(a);case"q":return vn(a);case"qq":return vn(s);case"s":return vn(a);case"ss":return vn(s);case"S":return vn(l);case"SSS":return vn(o);case"u":return om(c);case"uu":return om(a);case"uuu":return vn(n);case"a":return Pi(t.meridiems(),0);case"kkkk":return vn(i);case"kk":return vn(d,cb);case"W":return vn(a);case"WW":return vn(s);case"E":case"c":return vn(n);case"EEE":return Pi(t.weekdays("short",!1),1);case"EEEE":return Pi(t.weekdays("long",!1),1);case"ccc":return Pi(t.weekdays("short",!0),1);case"cccc":return Pi(t.weekdays("long",!0),1);case"Z":case"ZZ":return fF(new RegExp(`([+-]${a.source})(?::(${s.source}))?`),2);case"ZZZ":return fF(new RegExp(`([+-]${a.source})(${s.source})?`),2);case"z":return om(/[a-z_+-/]{1,256}?/i);case" ":return om(/[^\S\n\r]/);default:return f(v)}})(e)||{invalidReason:rK};return g.token=e,g}const cK={year:{"2-digit":"yy",numeric:"yyyyy"},month:{numeric:"M","2-digit":"MM",short:"MMM",long:"MMMM"},day:{numeric:"d","2-digit":"dd"},weekday:{short:"EEE",long:"EEEE"},dayperiod:"a",dayPeriod:"a",hour12:{numeric:"h","2-digit":"hh"},hour24:{numeric:"H","2-digit":"HH"},minute:{numeric:"m","2-digit":"mm"},second:{numeric:"s","2-digit":"ss"},timeZoneName:{long:"ZZZZZ",short:"ZZZ"}};function dK(e,t,n){const{type:s,value:o}=e;if(s==="literal"){const l=/^\s+$/.test(o);return{literal:!l,val:l?" ":o}}const i=t[s];let r=s;s==="hour"&&(t.hour12!=null?r=t.hour12?"hour12":"hour24":t.hourCycle!=null?t.hourCycle==="h11"||t.hourCycle==="h12"?r="hour12":r="hour24":r=n.hour12?"hour12":"hour24");let a=cK[r];if(typeof a=="object"&&(a=a[i]),a)return{literal:!1,val:a}}function hK(e){return[`^${e.map(n=>n.regex).reduce((n,s)=>`${n}(${s.source})`,"")}$`,e]}function fK(e,t,n){const s=e.match(t);if(s){const o={};let i=1;for(const r in n)if(hc(n,r)){const a=n[r],l=a.groups?a.groups+1:1;!a.literal&&a.token&&(o[a.token.val[0]]=a.deser(s.slice(i,i+l))),i+=l}return[s,o]}else return[s,{}]}function pK(e){const t=i=>{switch(i){case"S":return"millisecond";case"s":return"second";case"m":return"minute";case"h":case"H":return"hour";case"d":return"day";case"o":return"ordinal";case"L":case"M":return"month";case"y":return"year";case"E":case"c":return"weekday";case"W":return"weekNumber";case"k":return"weekYear";case"q":return"quarter";default:return null}};let n=null,s;return $t(e.z)||(n=dc.create(e.z)),$t(e.Z)||(n||(n=new ir(e.Z)),s=e.Z),$t(e.q)||(e.M=(e.q-1)*3+1),$t(e.h)||(e.h<12&&e.a===1?e.h+=12:e.h===12&&e.a===0&&(e.h=0)),e.G===0&&e.y&&(e.y=-e.y),$t(e.u)||(e.S=lb(e.u)),[Object.keys(e).reduce((i,r)=>{const a=t(r);return a&&(i[a]=e[r]),i},{}),n,s]}let pb=null;function gK(){return pb||(pb=bt.fromMillis(1555555555555)),pb}function mK(e,t){if(e.literal)return e;const n=$s.macroTokenToFormatOpts(e.val),s=vF(n,t);return s==null||s.includes(void 0)?e:s}function pF(e,t){return Array.prototype.concat(...e.map(n=>mK(n,t)))}class gF{constructor(t,n){if(this.locale=t,this.format=n,this.tokens=pF($s.parseFormat(n),t),this.units=this.tokens.map(s=>uK(s,t)),this.disqualifyingUnit=this.units.find(s=>s.invalidReason),!this.disqualifyingUnit){const[s,o]=hK(this.units);this.regex=RegExp(s,"i"),this.handlers=o}}explainFromTokens(t){if(this.isValid){const[n,s]=fK(t,this.regex,this.handlers),[o,i,r]=s?pK(s):[null,null,void 0];if(hc(s,"a")&&hc(s,"H"))throw new cc("Can't include meridiem when specifying 24-hour format");return{input:t,tokens:this.tokens,regex:this.regex,rawMatches:n,matches:s,result:o,zone:i,specificOffset:r}}else return{input:t,tokens:this.tokens,invalidReason:this.invalidReason}}get isValid(){return!this.disqualifyingUnit}get invalidReason(){return this.disqualifyingUnit?this.disqualifyingUnit.invalidReason:null}}function mF(e,t,n){return new gF(e,n).explainFromTokens(t)}function vK(e,t,n){const{result:s,zone:o,specificOffset:i,invalidReason:r}=mF(e,t,n);return[s,o,i,r]}function vF(e,t){if(!e)return null;const s=$s.create(t,e).dtFormatter(gK()),o=s.formatToParts(),i=s.resolvedOptions();return o.map(r=>dK(r,e,i))}const gb="Invalid DateTime",yF=864e13;function Gh(e){return new Fi("unsupported zone",`the zone "${e.name}" is not supported`)}function mb(e){return e.weekData===null&&(e.weekData=Xg(e.c)),e.weekData}function vb(e){return e.localWeekData===null&&(e.localWeekData=Xg(e.c,e.loc.getMinDaysInFirstWeek(),e.loc.getStartOfWeek())),e.localWeekData}function Kl(e,t){const n={ts:e.ts,zone:e.zone,c:e.c,o:e.o,loc:e.loc,invalid:e.invalid};return new bt({...n,...t,old:n})}function wF(e,t,n){let s=e-t*60*1e3;const o=n.offset(s);if(t===o)return[s,t];s-=(o-t)*60*1e3;const i=n.offset(s);return o===i?[s,o]:[e-Math.min(o,i)*60*1e3,Math.max(o,i)]}function im(e,t){e+=t*60*1e3;const n=new Date(e);return{year:n.getUTCFullYear(),month:n.getUTCMonth()+1,day:n.getUTCDate(),hour:n.getUTCHours(),minute:n.getUTCMinutes(),second:n.getUTCSeconds(),millisecond:n.getUTCMilliseconds()}}function rm(e,t,n){return wF(em(e),t,n)}function CF(e,t){const n=e.o,s=e.c.year+Math.trunc(t.years),o=e.c.month+Math.trunc(t.months)+Math.trunc(t.quarters)*3,i={...e.c,year:s,month:o,day:Math.min(e.c.day,Qg(s,o))+Math.trunc(t.days)+Math.trunc(t.weeks)*7},r=hn.fromObject({years:t.years-Math.trunc(t.years),quarters:t.quarters-Math.trunc(t.quarters),months:t.months-Math.trunc(t.months),weeks:t.weeks-Math.trunc(t.weeks),days:t.days-Math.trunc(t.days),hours:t.hours,minutes:t.minutes,seconds:t.seconds,milliseconds:t.milliseconds}).as("milliseconds"),a=em(i);let[l,u]=wF(a,n,e.zone);return r!==0&&(l+=r,u=e.zone.offset(l)),{ts:l,o:u}}function Sc(e,t,n,s,o,i){const{setZone:r,zone:a}=n;if(e&&Object.keys(e).length!==0||t){const l=t||a,u=bt.fromObject(e,{...n,zone:l,specificOffset:i});return r?u:u.setZone(a)}else return bt.invalid(new Fi("unparsable",`the input "${o}" can't be parsed as ${s}`))}function am(e,t,n=!0){return e.isValid?$s.create(bn.create("en-US"),{allowZ:n,forceSimple:!0}).formatDateTimeFromString(e,t):null}function yb(e,t,n){const s=e.c.year>9999||e.c.year<0;let o="";if(s&&e.c.year>=0&&(o+="+"),o+=ds(e.c.year,s?6:4),n==="year")return o;if(t){if(o+="-",o+=ds(e.c.month),n==="month")return o;o+="-"}else if(o+=ds(e.c.month),n==="month")return o;return o+=ds(e.c.day),o}function bF(e,t,n,s,o,i,r){let a=!n||e.c.millisecond!==0||e.c.second!==0,l="";switch(r){case"day":case"month":case"year":break;default:if(l+=ds(e.c.hour),r==="hour")break;if(t){if(l+=":",l+=ds(e.c.minute),r==="minute")break;a&&(l+=":",l+=ds(e.c.second))}else{if(l+=ds(e.c.minute),r==="minute")break;a&&(l+=ds(e.c.second))}if(r==="second")break;a&&(!s||e.c.millisecond!==0)&&(l+=".",l+=ds(e.c.millisecond,3))}return o&&(e.isOffsetFixed&&e.offset===0&&!i?l+="Z":e.o<0?(l+="-",l+=ds(Math.trunc(-e.o/60)),l+=":",l+=ds(Math.trunc(-e.o%60))):(l+="+",l+=ds(Math.trunc(e.o/60)),l+=":",l+=ds(Math.trunc(e.o%60)))),i&&(l+="["+e.zone.ianaName+"]"),l}const SF={month:1,day:1,hour:0,minute:0,second:0,millisecond:0},yK={weekNumber:1,weekday:1,hour:0,minute:0,second:0,millisecond:0},wK={ordinal:1,hour:0,minute:0,second:0,millisecond:0},lm=["year","month","day","hour","minute","second","millisecond"],CK=["weekYear","weekNumber","weekday","hour","minute","second","millisecond"],bK=["year","ordinal","hour","minute","second","millisecond"];function um(e){const t={year:"year",years:"year",month:"month",months:"month",day:"day",days:"day",hour:"hour",hours:"hour",minute:"minute",minutes:"minute",quarter:"quarter",quarters:"quarter",second:"second",seconds:"second",millisecond:"millisecond",milliseconds:"millisecond",weekday:"weekday",weekdays:"weekday",weeknumber:"weekNumber",weeksnumber:"weekNumber",weeknumbers:"weekNumber",weekyear:"weekYear",weekyears:"weekYear",ordinal:"ordinal"}[e.toLowerCase()];if(!t)throw new ZI(e);return t}function EF(e){switch(e.toLowerCase()){case"localweekday":case"localweekdays":return"localWeekday";case"localweeknumber":case"localweeknumbers":return"localWeekNumber";case"localweekyear":case"localweekyears":return"localWeekYear";default:return um(e)}}function SK(e){if(Uh===void 0&&(Uh=Zn.now()),e.type!=="iana")return e.offset(Uh);const t=e.name;let n=wb.get(t);return n===void 0&&(n=e.offset(Uh),wb.set(t,n)),n}function _F(e,t){const n=La(t.zone,Zn.defaultZone);if(!n.isValid)return bt.invalid(Gh(n));const s=bn.fromObject(t);let o,i;if($t(e.year))o=Zn.now();else{for(const l of lm)$t(e[l])&&(e[l]=SF[l]);const r=Mx(e)||Nx(e);if(r)return bt.invalid(r);const a=SK(n);[o,i]=rm(e,a,n)}return new bt({ts:o,zone:n,loc:s,o:i})}function RF(e,t,n){const s=$t(n.round)?!0:n.round,o=$t(n.rounding)?"trunc":n.rounding,i=(a,l)=>(a=ub(a,s||n.calendary?0:2,n.calendary?"round":o),t.loc.clone(n).relFormatter(n).format(a,l)),r=a=>n.calendary?t.hasSame(e,a)?0:t.startOf(a).diff(e.startOf(a),a).get(a):t.diff(e,a).get(a);if(n.unit)return i(r(n.unit),n.unit);for(const a of n.units){const l=r(a);if(Math.abs(l)>=1)return i(l,a)}return i(e>t?-0:0,n.units[n.units.length-1])}function DF(e){let t={},n;return e.length>0&&typeof e[e.length-1]=="object"?(t=e[e.length-1],n=Array.from(e).slice(0,e.length-1)):n=Array.from(e),[t,n]}let Uh;const wb=new Map;class bt{constructor(t){const n=t.zone||Zn.defaultZone;let s=t.invalid||(Number.isNaN(t.ts)?new Fi("invalid input"):null)||(n.isValid?null:Gh(n));this.ts=$t(t.ts)?Zn.now():t.ts;let o=null,i=null;if(!s)if(t.old&&t.old.ts===this.ts&&t.old.zone.equals(n))[o,i]=[t.old.c,t.old.o];else{const a=Va(t.o)&&!t.old?t.o:n.offset(this.ts);o=im(this.ts,a),s=Number.isNaN(o.year)?new Fi("invalid input"):null,o=s?null:o,i=s?null:a}this._zone=n,this.loc=t.loc||bn.create(),this.invalid=s,this.weekData=null,this.localWeekData=null,this.c=o,this.o=i,this.isLuxonDateTime=!0}static now(){return new bt({})}static local(){const[t,n]=DF(arguments),[s,o,i,r,a,l,u]=n;return _F({year:s,month:o,day:i,hour:r,minute:a,second:l,millisecond:u},t)}static utc(){const[t,n]=DF(arguments),[s,o,i,r,a,l,u]=n;return t.zone=ir.utcInstance,_F({year:s,month:o,day:i,hour:r,minute:a,second:l,millisecond:u},t)}static fromJSDate(t,n={}){const s=t7(t)?t.valueOf():NaN;if(Number.isNaN(s))return bt.invalid("invalid input");const o=La(n.zone,Zn.defaultZone);return o.isValid?new bt({ts:s,zone:o,loc:bn.fromObject(n)}):bt.invalid(Gh(o))}static fromMillis(t,n={}){if(Va(t))return t<-yF||t>yF?bt.invalid("Timestamp out of range"):new bt({ts:t,zone:La(n.zone,Zn.defaultZone),loc:bn.fromObject(n)});throw new Bs(`fromMillis requires a numerical input, but received a ${typeof t} with value ${t}`)}static fromSeconds(t,n={}){if(Va(t))return new bt({ts:t*1e3,zone:La(n.zone,Zn.defaultZone),loc:bn.fromObject(n)});throw new Bs("fromSeconds requires a numerical input")}static fromObject(t,n={}){t=t||{};const s=La(n.zone,Zn.defaultZone);if(!s.isValid)return bt.invalid(Gh(s));const o=bn.fromObject(n),i=nm(t,EF),{minDaysInFirstWeek:r,startOfWeek:a}=Ox(i,o),l=Zn.now(),u=$t(n.specificOffset)?s.offset(l):n.specificOffset,c=!$t(i.ordinal),d=!$t(i.year),h=!$t(i.month)||!$t(i.day),f=d||h,p=i.weekYear||i.weekNumber;if((f||c)&&p)throw new cc("Can't mix weekYear/weekNumber units with year/month/day or ordinals");if(h&&c)throw new cc("Can't mix ordinal dates with month/day");const g=p||i.weekday&&!f;let v,C,S=im(l,u);g?(v=CK,C=yK,S=Xg(S,r,a)):c?(v=bK,C=wK,S=rb(S)):(v=lm,C=SF);let b=!1;for(const P of v){const D=i[P];$t(D)?b?i[P]=C[P]:i[P]=S[P]:b=!0}const w=g?Jj(i,r,a):c?Qj(i):Mx(i),_=w||Nx(i);if(_)return bt.invalid(_);const R=g?Ax(i,r,a):c?kx(i):i,[T,I]=rm(R,u,s),x=new bt({ts:T,zone:s,o:I,loc:o});return i.weekday&&f&&t.weekday!==x.weekday?bt.invalid("mismatched weekday",`you can't specify both a weekday of ${i.weekday} and a date of ${x.toISO()}`):x.isValid?x:bt.invalid(x.invalid)}static fromISO(t,n={}){const[s,o]=W7(t);return Sc(s,o,n,"ISO 8601",t)}static fromRFC2822(t,n={}){const[s,o]=z7(t);return Sc(s,o,n,"RFC 2822",t)}static fromHTTP(t,n={}){const[s,o]=j7(t);return Sc(s,o,n,"HTTP",n)}static fromFormat(t,n,s={}){if($t(t)||$t(n))throw new Bs("fromFormat requires an input string and a format");const{locale:o=null,numberingSystem:i=null}=s,r=bn.fromOpts({locale:o,numberingSystem:i,defaultToEN:!0}),[a,l,u,c]=vK(r,t,n);return c?bt.invalid(c):Sc(a,l,s,`format ${n}`,t,u)}static fromString(t,n,s={}){return bt.fromFormat(t,n,s)}static fromSQL(t,n={}){const[s,o]=Q7(t);return Sc(s,o,n,"SQL",t)}static invalid(t,n=null){if(!t)throw new Bs("need to specify a reason the DateTime is invalid");const s=t instanceof Fi?t:new Fi(t,n);if(Zn.throwOnInvalid)throw new Dj(s);return new bt({invalid:s})}static isDateTime(t){return t&&t.isLuxonDateTime||!1}static parseFormatForOpts(t,n={}){const s=vF(t,bn.fromObject(n));return s?s.map(o=>o?o.val:null).join(""):null}static expandFormat(t,n={}){return pF($s.parseFormat(t),bn.fromObject(n)).map(o=>o.val).join("")}static resetCache(){Uh=void 0,wb.clear()}get(t){return this[t]}get isValid(){return this.invalid===null}get invalidReason(){return this.invalid?this.invalid.reason:null}get invalidExplanation(){return this.invalid?this.invalid.explanation:null}get locale(){return this.isValid?this.loc.locale:null}get numberingSystem(){return this.isValid?this.loc.numberingSystem:null}get outputCalendar(){return this.isValid?this.loc.outputCalendar:null}get zone(){return this._zone}get zoneName(){return this.isValid?this.zone.name:null}get year(){return this.isValid?this.c.year:NaN}get quarter(){return this.isValid?Math.ceil(this.c.month/3):NaN}get month(){return this.isValid?this.c.month:NaN}get day(){return this.isValid?this.c.day:NaN}get hour(){return this.isValid?this.c.hour:NaN}get minute(){return this.isValid?this.c.minute:NaN}get second(){return this.isValid?this.c.second:NaN}get millisecond(){return this.isValid?this.c.millisecond:NaN}get weekYear(){return this.isValid?mb(this).weekYear:NaN}get weekNumber(){return this.isValid?mb(this).weekNumber:NaN}get weekday(){return this.isValid?mb(this).weekday:NaN}get isWeekend(){return this.isValid&&this.loc.getWeekendDays().includes(this.weekday)}get localWeekday(){return this.isValid?vb(this).weekday:NaN}get localWeekNumber(){return this.isValid?vb(this).weekNumber:NaN}get localWeekYear(){return this.isValid?vb(this).weekYear:NaN}get ordinal(){return this.isValid?rb(this.c).ordinal:NaN}get monthShort(){return this.isValid?bc.months("short",{locObj:this.loc})[this.month-1]:null}get monthLong(){return this.isValid?bc.months("long",{locObj:this.loc})[this.month-1]:null}get weekdayShort(){return this.isValid?bc.weekdays("short",{locObj:this.loc})[this.weekday-1]:null}get weekdayLong(){return this.isValid?bc.weekdays("long",{locObj:this.loc})[this.weekday-1]:null}get offset(){return this.isValid?+this.o:NaN}get offsetNameShort(){return this.isValid?this.zone.offsetName(this.ts,{format:"short",locale:this.locale}):null}get offsetNameLong(){return this.isValid?this.zone.offsetName(this.ts,{format:"long",locale:this.locale}):null}get isOffsetFixed(){return this.isValid?this.zone.isUniversal:null}get isInDST(){return this.isOffsetFixed?!1:this.offset>this.set({month:1,day:1}).offset||this.offset>this.set({month:5}).offset}getPossibleOffsets(){if(!this.isValid||this.isOffsetFixed)return[this];const t=864e5,n=6e4,s=em(this.c),o=this.zone.offset(s-t),i=this.zone.offset(s+t),r=this.zone.offset(s-o*n),a=this.zone.offset(s-i*n);if(r===a)return[this];const l=s-r*n,u=s-a*n,c=im(l,r),d=im(u,a);return c.hour===d.hour&&c.minute===d.minute&&c.second===d.second&&c.millisecond===d.millisecond?[Kl(this,{ts:l}),Kl(this,{ts:u})]:[this]}get isInLeapYear(){return Lh(this.year)}get daysInMonth(){return Qg(this.year,this.month)}get daysInYear(){return this.isValid?fc(this.year):NaN}get weeksInWeekYear(){return this.isValid?Vh(this.weekYear):NaN}get weeksInLocalWeekYear(){return this.isValid?Vh(this.localWeekYear,this.loc.getMinDaysInFirstWeek(),this.loc.getStartOfWeek()):NaN}resolvedLocaleOptions(t={}){const{locale:n,numberingSystem:s,calendar:o}=$s.create(this.loc.clone(t),t).resolvedOptions(this);return{locale:n,numberingSystem:s,outputCalendar:o}}toUTC(t=0,n={}){return this.setZone(ir.instance(t),n)}toLocal(){return this.setZone(Zn.defaultZone)}setZone(t,{keepLocalTime:n=!1,keepCalendarTime:s=!1}={}){if(t=La(t,Zn.defaultZone),t.equals(this.zone))return this;if(t.isValid){let o=this.ts;if(n||s){const i=t.offset(this.ts),r=this.toObject();[o]=rm(r,i,t)}return Kl(this,{ts:o,zone:t})}else return bt.invalid(Gh(t))}reconfigure({locale:t,numberingSystem:n,outputCalendar:s}={}){const o=this.loc.clone({locale:t,numberingSystem:n,outputCalendar:s});return Kl(this,{loc:o})}setLocale(t){return this.reconfigure({locale:t})}set(t){if(!this.isValid)return this;const n=nm(t,EF),{minDaysInFirstWeek:s,startOfWeek:o}=Ox(n,this.loc),i=!$t(n.weekYear)||!$t(n.weekNumber)||!$t(n.weekday),r=!$t(n.ordinal),a=!$t(n.year),l=!$t(n.month)||!$t(n.day),u=a||l,c=n.weekYear||n.weekNumber;if((u||r)&&c)throw new cc("Can't mix weekYear/weekNumber units with year/month/day or ordinals");if(l&&r)throw new cc("Can't mix ordinal dates with month/day");let d;i?d=Ax({...Xg(this.c,s,o),...n},s,o):$t(n.ordinal)?(d={...this.toObject(),...n},$t(n.day)&&(d.day=Math.min(Qg(d.year,d.month),d.day))):d=kx({...rb(this.c),...n});const[h,f]=rm(d,this.o,this.zone);return Kl(this,{ts:h,o:f})}plus(t){if(!this.isValid)return this;const n=hn.fromDurationLike(t);return Kl(this,CF(this,n))}minus(t){if(!this.isValid)return this;const n=hn.fromDurationLike(t).negate();return Kl(this,CF(this,n))}startOf(t,{useLocaleWeeks:n=!1}={}){if(!this.isValid)return this;const s={},o=hn.normalizeUnit(t);switch(o){case"years":s.month=1;case"quarters":case"months":s.day=1;case"weeks":case"days":s.hour=0;case"hours":s.minute=0;case"minutes":s.second=0;case"seconds":s.millisecond=0;break}if(o==="weeks")if(n){const i=this.loc.getStartOfWeek(),{weekday:r}=this;r<i&&(s.weekNumber=this.weekNumber-1),s.weekday=i}else s.weekday=1;if(o==="quarters"){const i=Math.ceil(this.month/3);s.month=(i-1)*3+1}return this.set(s)}endOf(t,n){return this.isValid?this.plus({[t]:1}).startOf(t,n).minus(1):this}toFormat(t,n={}){return this.isValid?$s.create(this.loc.redefaultToEN(n)).formatDateTimeFromString(this,t):gb}toLocaleString(t=qg,n={}){return this.isValid?$s.create(this.loc.clone(n),t).formatDateTime(this):gb}toLocaleParts(t={}){return this.isValid?$s.create(this.loc.clone(t),t).formatDateTimeParts(this):[]}toISO({format:t="extended",suppressSeconds:n=!1,suppressMilliseconds:s=!1,includeOffset:o=!0,extendedZone:i=!1,precision:r="milliseconds"}={}){if(!this.isValid)return null;r=um(r);const a=t==="extended";let l=yb(this,a,r);return lm.indexOf(r)>=3&&(l+="T"),l+=bF(this,a,n,s,o,i,r),l}toISODate({format:t="extended",precision:n="day"}={}){return this.isValid?yb(this,t==="extended",um(n)):null}toISOWeekDate(){return am(this,"kkkk-'W'WW-c")}toISOTime({suppressMilliseconds:t=!1,suppressSeconds:n=!1,includeOffset:s=!0,includePrefix:o=!1,extendedZone:i=!1,format:r="extended",precision:a="milliseconds"}={}){return this.isValid?(a=um(a),(o&&lm.indexOf(a)>=3?"T":"")+bF(this,r==="extended",n,t,s,i,a)):null}toRFC2822(){return am(this,"EEE, dd LLL yyyy HH:mm:ss ZZZ",!1)}toHTTP(){return am(this.toUTC(),"EEE, dd LLL yyyy HH:mm:ss 'GMT'")}toSQLDate(){return this.isValid?yb(this,!0):null}toSQLTime({includeOffset:t=!0,includeZone:n=!1,includeOffsetSpace:s=!0}={}){let o="HH:mm:ss.SSS";return(n||t)&&(s&&(o+=" "),n?o+="z":t&&(o+="ZZ")),am(this,o,!0)}toSQL(t={}){return this.isValid?`${this.toSQLDate()} ${this.toSQLTime(t)}`:null}toString(){return this.isValid?this.toISO():gb}[Symbol.for("nodejs.util.inspect.custom")](){return this.isValid?`DateTime { ts: ${this.toISO()}, zone: ${this.zone.name}, locale: ${this.locale} }`:`DateTime { Invalid, reason: ${this.invalidReason} }`}valueOf(){return this.toMillis()}toMillis(){return this.isValid?this.ts:NaN}toSeconds(){return this.isValid?this.ts/1e3:NaN}toUnixInteger(){return this.isValid?Math.floor(this.ts/1e3):NaN}toJSON(){return this.toISO()}toBSON(){return this.toJSDate()}toObject(t={}){if(!this.isValid)return{};const n={...this.c};return t.includeConfig&&(n.outputCalendar=this.outputCalendar,n.numberingSystem=this.loc.numberingSystem,n.locale=this.loc.locale),n}toJSDate(){return new Date(this.isValid?this.ts:NaN)}diff(t,n="milliseconds",s={}){if(!this.isValid||!t.isValid)return hn.invalid("created by diffing an invalid DateTime");const o={locale:this.locale,numberingSystem:this.numberingSystem,...s},i=n7(n).map(hn.normalizeUnit),r=t.valueOf()>this.valueOf(),a=r?this:t,l=r?t:this,u=iK(a,l,i,o);return r?u.negate():u}diffNow(t="milliseconds",n={}){return this.diff(bt.now(),t,n)}until(t){return this.isValid?Xn.fromDateTimes(this,t):this}hasSame(t,n,s){if(!this.isValid)return!1;const o=t.valueOf(),i=this.setZone(t.zone,{keepLocalTime:!0});return i.startOf(n,s)<=o&&o<=i.endOf(n,s)}equals(t){return this.isValid&&t.isValid&&this.valueOf()===t.valueOf()&&this.zone.equals(t.zone)&&this.loc.equals(t.loc)}toRelative(t={}){if(!this.isValid)return null;const n=t.base||bt.fromObject({},{zone:this.zone}),s=t.padding?this<n?-t.padding:t.padding:0;let o=["years","months","days","hours","minutes","seconds"],i=t.unit;return Array.isArray(t.unit)&&(o=t.unit,i=void 0),RF(n,this.plus(s),{...t,numeric:"always",units:o,unit:i})}toRelativeCalendar(t={}){return this.isValid?RF(t.base||bt.fromObject({},{zone:this.zone}),this,{...t,numeric:"auto",units:["years","months","days"],calendary:!0}):null}static min(...t){if(!t.every(bt.isDateTime))throw new Bs("min requires all arguments be DateTimes");return Bx(t,n=>n.valueOf(),Math.min)}static max(...t){if(!t.every(bt.isDateTime))throw new Bs("max requires all arguments be DateTimes");return Bx(t,n=>n.valueOf(),Math.max)}static fromFormatExplain(t,n,s={}){const{locale:o=null,numberingSystem:i=null}=s,r=bn.fromOpts({locale:o,numberingSystem:i,defaultToEN:!0});return mF(r,t,n)}static fromStringExplain(t,n,s={}){return bt.fromFormatExplain(t,n,s)}static buildFormatParser(t,n={}){const{locale:s=null,numberingSystem:o=null}=n,i=bn.fromOpts({locale:s,numberingSystem:o,defaultToEN:!0});return new gF(i,t)}static fromFormatParser(t,n,s={}){if($t(t)||$t(n))throw new Bs("fromFormatParser requires an input string and a format parser");const{locale:o=null,numberingSystem:i=null}=s,r=bn.fromOpts({locale:o,numberingSystem:i,defaultToEN:!0});if(!r.equals(n.locale))throw new Bs(`fromFormatParser called with a locale of ${r}, but the format parser was created for ${n.locale}`);const{result:a,zone:l,specificOffset:u,invalidReason:c}=n.explainFromTokens(t);return c?bt.invalid(c):Sc(a,l,s,`format ${n.format}`,t,u)}static get DATE_SHORT(){return qg}static get DATE_MED(){return XI}static get DATE_MED_WITH_WEEKDAY(){return xj}static get DATE_FULL(){return JI}static get DATE_HUGE(){return QI}static get TIME_SIMPLE(){return ex}static get TIME_WITH_SECONDS(){return tx}static get TIME_WITH_SHORT_OFFSET(){return nx}static get TIME_WITH_LONG_OFFSET(){return sx}static get TIME_24_SIMPLE(){return ox}static get TIME_24_WITH_SECONDS(){return ix}static get TIME_24_WITH_SHORT_OFFSET(){return rx}static get TIME_24_WITH_LONG_OFFSET(){return ax}static get DATETIME_SHORT(){return lx}static get DATETIME_SHORT_WITH_SECONDS(){return ux}static get DATETIME_MED(){return cx}static get DATETIME_MED_WITH_SECONDS(){return dx}static get DATETIME_MED_WITH_WEEKDAY(){return Fj}static get DATETIME_FULL(){return hx}static get DATETIME_FULL_WITH_SECONDS(){return fx}static get DATETIME_HUGE(){return px}static get DATETIME_HUGE_WITH_SECONDS(){return gx}}function Wh(e){if(bt.isDateTime(e))return e;if(e&&e.valueOf&&Va(e.valueOf()))return bt.fromJSDate(e);if(e&&typeof e=="object")return bt.fromObject(e);throw new Bs(`Unknown datetime argument: ${e}, of type ${typeof e}`)}const TF="account.last_prefered_timezone",rr=500;var Ht=(e=>(e[e.UNCHECK=0]="UNCHECK",e[e.INDETERMINATE=1]="INDETERMINATE",e[e.CHECKED=2]="CHECKED",e))(Ht||{});function zh(e){if(!e)return null;if(bt.isDateTime(e))return e;if(e instanceof Date){const t=bt.fromJSDate(e);return t.isValid?t:null}if(typeof e=="number"){const t=bt.fromMillis(e);return t.isValid?t:null}if(typeof e=="string"){let t=bt.fromISO(e);return t.isValid||(t=bt.fromRFC2822(e)),t.isValid?t:null}return null}function IF(e,t,n){const s=zh(e);if(!s)return"";const o=n?s.setZone(n):s;return o.isValid?o.toFormat(t):""}const cm=()=>Rj(TF)||"UTC",xF=e=>({id:e.id,name:(e==null?void 0:e.name)??e.display_name,initial:e.initial,profile_image:e.profile_image,color:{bgColor:e.color.bgColor,textColor:e.color.textColor}}),Ec=e=>e!=null&&e.length?e.map(xF):[],EK=e=>{if(!(e!=null&&e.length))return[];const t=new Set;return e.filter(n=>t.has(n.id)?!1:(t.add(n.id),!0))},FF=e=>{if(!e)return null;const t=new Date(e);return Number.isNaN(t.getTime())?null:t},_K=e=>Object.fromEntries(Object.entries(e).filter(([t,n])=>n!==void 0)),PF=(e,t)=>{var s,o,i;const n={id:e.id,name:e.name,assignees:void 0,status:e.template_flow_status,dateRange:[FF(e.start_date),FF(e.due_date)],isStarted:!!Number(e.is_started),isCompleted:!!Number(e.is_completed),lastUpdated:{tooltip:e!=null&&e.last_updated_by?e.last_updated_by:"",value:IF(e.updated_at,"MMM dd, yyyy | HH:mm",t)||""},completedOn:{tooltip:e.actual_due_date==null?"Pending":e.last_completed_by?e.last_completed_by:"",value:IF(e.actual_due_date,"MMM dd, yyyy | HH:mm",t)},isDeleted:!1,isProcessing:e!=null&&e.bulk_process?{state:e==null?void 0:e.bulk_process.state,message:(e==null?void 0:e.bulk_process.message)||""}:void 0,disabled:((s=e==null?void 0:e.bulk_process)==null?void 0:s.state)==0,isArchived:((o=e.property)==null?void 0:o.is_archived)===1||e.status==0,isLocked:((i=e.property)==null?void 0:i.is_locked)===1};return _K(n)},AF={headphone:["headphones","headset"],sofa:["couch"],couch:["sofa"],run:["running","runner"]},Cb=e=>e.toLowerCase().trim(),RK=e=>Cb(e).split(/\s+/).filter(Boolean),kF=e=>e.replace(/(ing|ed|s)$/i,"");function DK(e){const t=new Set;for(const n of e){const s=kF(n);if(t.add(s),t.add(n),AF[s])for(const o of AF[s])t.add(kF(o))}return Array.from(t)}function TK(e,t){const n=Cb(e),s=DK(RK(t));let o=0;for(const i of s)i&&(n.includes(i)&&(o+=i.length*2),n.startsWith(i)&&(o+=3));return o}function IK(e,t){const n=i=>i.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),s=t.split(/\s+/).filter(Boolean).map(n);if(!s.length)return e;const o=new RegExp(`(${s.join("|")})`,"ig");return e.replace(o,"<mark>$1</mark>")}const OF=e=>{if(e!==null){if(Number(e.metric_type.id)==1)return["none","not","range"].includes(e.restricted_type)?"number":"dropdown";if(Number(e.metric_type.id)==2)return e.format_type=="icon"?"rating":"dropdown";if(Number(e.metric_type.id)==3)return"formula"}},bb=e=>!isNaN(e)&&isFinite(e),dm=(e,t)=>{var i;const{restricted_type:n}=e,s=Math.floor(Number(t)),o=((i=e.restricted_value)==null?void 0:i.split(",").map(Number))||[];if(n=="none")return!0;if(e.restricted_type=="not")return bb(s)&&!o.includes(s);if(e.restricted_type=="range"){const[r,a]=o;return bb(Number(t))&&Number(t)>=Number(r)&&Number(t)<=Number(a)}else if(n=="exact")return bb(s)&&o.includes(s);return!1},xK=(e,t)=>{var i;const n=_n.getInstance().getItem("ws.terminology"),s=n?JSON.parse(n):null;return` ${((i=s==null?void 0:s.find(r=>r.code==="scene"))==null?void 0:i.name)||"Scene"} ${t}`.trim()};/*! js-cookie v3.0.5 | MIT */function hm(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var s in n)e[s]=n[s]}return e}var FK={read:function(e){return e[0]==='"'&&(e=e.slice(1,-1)),e.replace(/(%[\dA-F]{2})+/gi,decodeURIComponent)},write:function(e){return encodeURIComponent(e).replace(/%(2[346BF]|3[AC-F]|40|5[BDE]|60|7[BCD])/g,decodeURIComponent)}};function Sb(e,t){function n(o,i,r){if(!(typeof document>"u")){r=hm({},t,r),typeof r.expires=="number"&&(r.expires=new Date(Date.now()+r.expires*864e5)),r.expires&&(r.expires=r.expires.toUTCString()),o=encodeURIComponent(o).replace(/%(2[346B]|5E|60|7C)/g,decodeURIComponent).replace(/[()]/g,escape);var a="";for(var l in r)r[l]&&(a+="; "+l,r[l]!==!0&&(a+="="+r[l].split(";")[0]));return document.cookie=o+"="+e.write(i,o)+a}}function s(o){if(!(typeof document>"u"||arguments.length&&!o)){for(var i=document.cookie?document.cookie.split("; "):[],r={},a=0;a<i.length;a++){var l=i[a].split("="),u=l.slice(1).join("=");try{var c=decodeURIComponent(l[0]);if(r[c]=e.read(u,c),o===c)break}catch{}}return o?r[o]:r}}return Object.create({set:n,get:s,remove:function(o,i){n(o,"",hm({},i,{expires:-1}))},withAttributes:function(o){return Sb(this.converter,hm({},this.attributes,o))},withConverter:function(o){return Sb(hm({},this.converter,o),this.attributes)}},{attributes:{value:Object.freeze(t)},converter:{value:Object.freeze(e)}})}var MF=Sb(FK,{path:"/"});const fm=({date:e,timezone:t,format:n})=>{if(!e)return"";const s=typeof e=="string"?bt.fromISO(e,{zone:t}):e,o=bt.now().setZone(t||"local"),i=s.setZone(t||"local"),r=o.startOf("day"),l=i.startOf("day").diff(r,"days").days;let u="";if(l===0?u="Today":l===-1?u="Yesterday":l===1&&(u="Tomorrow"),u&&(n!=null&&n.includes("HH:mm"))){const c=i.toFormat("HH:mm");return`${u} at ${c}`}else if(u)return u;return i.toFormat(n)},Eb=()=>MF.get("account.last_prefered_timezone")||"UTC",pm=e=>`${bt.fromJSDate(e,{zone:"UTC"}).toFormat("yyyy-MM-dd'T'HH:mm:ss.SSS")}999Z`,gm=e=>({id:e.id,label:e.name,value:e.id,data:e,color:e.color||{bgColor:"#CCCCCC",textColor:"#FFFFFF"},selected:!1,hover:!1,type:"text",disabled:!1,clickable:!0,danger:!1}),mm=e=>{var P;const t=En("filterParams",null),n=B(((P=e.value)==null?void 0:P.map(D=>D.id))??[]),s=B([]),o=B(!1),i=Si(e,"workspaceId"),r=Si(e,"entityId"),a=Si(e,"id"),l=Si(e,"ids"),u=Si(e,"isSelectAll"),c=Si(e,"isBulkUpdate"),d=e.updateRowData,h=B([]),{apiServices:f}=ts(!!e.params,e),p=Y(()=>{var O,$;const D=new Set(((O=e.value)==null?void 0:O.map(q=>q.id))??[]),F=(($=e.value)==null?void 0:$.map(q=>({...gm(q),selected:!0})))??[],k=s.value.filter(q=>!D.has(q.id));return uc(F,k,"id")}),g=D=>{const F=p.value.find(k=>k.id===D);return F==null?void 0:F.data},v=()=>{var D;return c.value&&u.value?[]:(D=l.value)!=null&&D.length?l.value:[String(a.value)]},C=async(D,F,k)=>{if(o.value||!f.value)return!1;o.value=!0;try{const O=await D();if((O==null?void 0:O.message)!=="Done")throw new Error("API call failed");return F(),!0}catch(O){return console.error("API call error:",O),k==null||k(O),!1}finally{o.value=!1}},S=Y(()=>!!(c.value&&u.value)),b=async()=>await C(()=>f.value.unAssignAll({workspaceId:String(i.value),userIds:[],itemIds:S.value?void 0:v(),entityId:S.value?String(r.value):void 0,filterParams:t!=null&&t.value?t.value:void 0}),()=>{d==null||d({assignees:[],type:"removeAll"}),n.value=[]},()=>{var F;console.error("Failed to unassign all assignees"),(F=e.errorCallback)==null||F.call(e)}),w=async D=>await C(()=>f.value.replaceAssignee(R(D)),()=>{n.value=[D];const k=g(D);k&&(d==null||d({assignees:Ec([k]),type:"overwrite"}))},()=>{var k;(k=e.errorCallback)==null||k.call(e)}),_=async D=>await C(()=>f.value.addAssignee(R(D)),()=>{var O,$,q;n.value.push(D);const k=g(D);if(k){const J=(q=($=(O=e.params)==null?void 0:O.api)==null?void 0:$.getRowNode(String(e.id)))==null?void 0:q.data,ee=(J==null?void 0:J.assignees)||[],X=uc([...ee,...Ec([k])],"id");d==null||d({assignees:X,type:"add"})}},()=>{var k;(k=e.errorCallback)==null||k.call(e)}),R=D=>{const F={workspaceId:String(i.value),userIds:[D],filterParams:t!=null&&t.value?t.value:void 0};return S.value?(F.itemIds=void 0,F.entityId=String(r.value)):F.itemIds=v(),F},T=async D=>await C(()=>f.value.removeAssignee(R(D)),()=>{var $,q,J;const k=(J=(q=($=e.params)==null?void 0:$.api)==null?void 0:q.getRowNode(String(e.id)))==null?void 0:J.data;n.value=n.value.filter(ee=>ee!==D);const O=Ec(((k==null?void 0:k.assignees)||[]).filter(ee=>ee.id!==D));d==null||d({assignees:O,type:"remove"})},()=>{var k;(k=e.errorCallback)==null||k.call(e)});return{isSubmitting:o,options:h,unAssignAll:b,replaceAssignees:w,addAssignee:_,removeAssignee:T,handleSelect:D=>{const F=String(D.id);n.value.includes(F)?T(F):_(F)},openPeopleInsight:D=>{if(!D||!i.value)return;const F=Ao({type:"people_insight",config:{user_id:D,ws_code:i.value,baseDomain:_n.getInstance().getItem("BASE_URL")||""}}).url;window.open(F,"_blank")},assigneeList:s,mergedOptions:p,selectedUserIds:n}},PK={placement:"bottom-start",theme:"light",trigger:"click",interactive:!0,appendTo:()=>document.getElementById("item-table-layout-id")||document.body,showArrow:!0,showOnInit:!1,alwaysShow:!1,debug:!1,content:void 0};function AK(e){return e.value?"$el"in e.value?e.value.$el:e.value:null}function Fs(e={}){const t=B(!1),n={...PK,...e},s=B(null),o=B(null),i=B(null),r=B(!1);let a=null,l=null;const u=S=>{(S.key==="Escape"||S.key==="Esc")&&p()},c=()=>{a&&l&&(l.removeEventListener("click",a),a=null,l=null),i.value&&(i.value.destroy(),i.value=null,r.value=!1),document.removeEventListener("keydown",u)},d=S=>{const{showOnInit:b,alwaysShow:w,showArrow:_,debug:R,...T}=n;return{...T,content:S,theme:n.theme,trigger:w||n.toggleOnClick?"manual":n.trigger,placement:n.placement||"bottom-start",arrow:!1,offset:n.offset,interactive:n.interactive,appendTo:n.appendTo,animation:"fade",maxWidth:n.maxWidth||350,onShow:I=>{if(e.disabled)return!1;if(r.value=!0,document.addEventListener("keydown",u),e.onShow)return e.onShow(I)},onHide:I=>{if(t.value)return setTimeout(()=>{t.value=!1},200),!1;if(w)return!1;if(r.value=!1,document.removeEventListener("keydown",u),e.onHide)return e.onHide(I)},onClickOutside:n.onClickOutside?n.onClickOutside:(I,x)=>{const P=x.target.closest(".notification-center"),D=x.target.closest("#people-insight-container");if(P||D){t.value=!0;return}if(e.onClickOutside)return e.onClickOutside(I,x);w||I.hide()},popperOptions:n.popperOptions||{modifiers:[{name:"computeStyles",options:{gpuAcceleration:!1}},{name:"preventOverflow",options:{padding:8}}]},hideOnClick:n.hideOnClick!==void 0?n.hideOnClick:!1}},h=()=>{var w;c();const S=AK(s),b=o.value;if(!(!S||!b)){b.style.display==="none"&&(b.style.display="");try{const _=d(b),R=Pa(S,_);i.value=Array.isArray(R)?R[0]:R,n.toggleOnClick&&!n.alwaysShow&&(a=()=>g(),l=S,S.addEventListener("click",a)),(n.showOnInit||n.alwaysShow)&&((w=i.value)==null||w.show())}catch(_){console.error("[useTippyComposable] Failed to create Tippy instance:",_)}}},f=S=>{S&&C(S),i.value&&i.value.show()},p=()=>{n.alwaysShow||i.value&&i.value.hide()},g=()=>{r.value?p():f()},v=S=>{i.value&&i.value.setContent(S)},C=S=>{i.value&&i.value.setProps(S)};return nt([s,o],h,{flush:"post"}),vs(()=>{c()}),{instance:i,isVisible:r,show:f,hide:p,toggle:g,triggerRef:s,popupRef:o,destroyTippy:c,setContent:v,setProps:C}}const NF=(e,t,n)=>{const s=B("Copy"),o=()=>{setTimeout(()=>{s.value="Copy"},5e3)};return{copyToClipboard:async r=>{r.stopPropagation(),r.preventDefault(),r.stopImmediatePropagation();try{return await navigator.clipboard.writeText(e),s.value="Copied",t==null||t(),o(),!0}catch(a){return console.error("Failed to copy text to clipboard:",a),s.value="Copy failed",o(),!1}},tooltip:s}},kK=(e,t,n)=>{const s={truncate:"End date cleared because it was before start. Please pick an end date.",swap:"Dates auto-swapped because start was after end.",...e.messages},o=So({startDate:null,endDate:null,timezone:e.timezone||"UTC",format:e.format||"",isSelectingStart:!1,isSelectingEnd:!1,rangeFeedback:{status:"idle",action:null,message:""},cacheStartDate:null,cacheEndDate:null,isDirty:!1});eh(()=>{var P;((P=e.value)==null?void 0:P.length)===2&&(o.startDate=e.value[0],o.endDate=e.value[1]),o.cacheStartDate=o.startDate,o.cacheEndDate=o.endDate,o.isSelectingStart=!1,o.isSelectingEnd=!1,e.timezone&&(o.timezone=e.timezone)});const i=B(!1),r=B(!1),a=()=>{var q,J,ee,X,ve,te,N,V;const P=i.value||((J=(q=o.startDate)==null?void 0:q.getTime)==null?void 0:J.call(q))!==((X=(ee=o.cacheStartDate)==null?void 0:ee.getTime)==null?void 0:X.call(ee)),D=r.value||((te=(ve=o.endDate)==null?void 0:ve.getTime)==null?void 0:te.call(ve))!==((V=(N=o.cacheEndDate)==null?void 0:N.getTime)==null?void 0:V.call(N)),F=o.startDate===null,k=o.endDate===null;let O,$;P&&D&&F&&k?(O=!0,$=!0,t("clearAll")):P&&!D?(O=!0,F?t("clearStart"):t("update:start",o.startDate)):D&&!P?($=!0,k?t("clearDue"):t("update:end",o.endDate)):P&&D&&(O=!0,$=!0,t("update",[o.startDate,o.endDate])),!(!O&&!$)&&(O&&!$?t("confirmed",{start:o.startDate}):!O&&$?t("confirmed",{end:o.endDate}):t("confirmed",{start:o.startDate,end:o.endDate}),o.isDirty=P||D)},l=(P,D)=>{const F=bt.fromObject({year:P.year,month:P.month,day:P.day},{zone:o.timezone});return(D==="start"?F.startOf("day"):F.endOf("day")).toJSDate()},u=()=>{o.rangeFeedback.status="idle",o.rangeFeedback.action=null,o.rangeFeedback.message=""},c=P=>{e.enableRangeFeedback&&(o.rangeFeedback.status="corrected",o.rangeFeedback.action=P,o.rangeFeedback.message=P==="swap"?s.swap:s.truncate)},d=P=>{if(!(!o.startDate||!o.endDate)){if(o.startDate.getTime()<=o.endDate.getTime()){e.enableRangeFeedback&&u();return}if(P==="select-start"){const D={start:o.startDate,end:o.endDate};o.endDate=null,t("range:invalid",D),t("range:corrected",{start:o.startDate,end:o.endDate,action:"truncate"}),o.isSelectingEnd=!0,c("truncate")}else{const D={start:o.startDate,end:o.endDate},F=o.startDate;o.startDate=o.endDate,o.endDate=F,t("range:invalid",D),t("range:corrected",{start:o.startDate,end:o.endDate,action:"swap"}),c("swap")}}},h=B(!1),f=B(!1),p=(P,D=!0)=>{i.value=!0,h.value=!1,!(e.disabled||e.readOnly)&&(o.startDate=l(P,"start"),D?(o.isSelectingStart=!1,o.isSelectingEnd=!0):(o.isSelectingStart=!0,o.isSelectingEnd=!1),d("select-start"))},g=P=>{r.value=!0,f.value=!1,!(e.disabled||e.readOnly)&&(o.endDate=l(P,"end"),d("select-end"))},v=()=>{i.value=!0,!(e.disabled||e.readOnly)&&(o.startDate=null,u())},C=()=>{r.value=!0,!(e.disabled||e.readOnly)&&(o.endDate=null,u())},S=()=>{i.value=!0,r.value=!0,!(e.disabled||e.readOnly)&&(o.startDate=null,o.endDate=null,u(),w())},b=()=>{e.disabled||e.readOnly||o.isDirty||(o.cacheStartDate=o.startDate,o.cacheEndDate=o.endDate)},w=()=>{e.disabled||e.readOnly||(a(),o.cacheStartDate=o.startDate,o.cacheEndDate=o.endDate,o.isDirty=!1)},_=()=>{e.disabled||e.readOnly||(o.startDate=o.cacheStartDate,o.endDate=o.cacheEndDate,u(),o.isDirty=!1)},R=Y(()=>o.startDate?bt.fromJSDate(o.startDate,{zone:o.timezone}).toFormat(o.format):e.startPlaceholder),T=Y(()=>o.endDate?bt.fromJSDate(o.endDate,{zone:o.timezone}).toFormat(o.format):e.duePlaceholder),I=Y(()=>!o.startDate&&!e.disabled?e.startTooltip:!o.startDate&&(e.disabled||e.readOnly)?e.startPlaceholder:o.startDate?bt.fromJSDate(o.startDate,{zone:o.timezone}).toFormat("LLL dd, yyyy | HH:mm:ss"):e.startTooltip),x=Y(()=>!o.endDate&&!e.disabled?e.dueTooltip:!o.endDate&&(e.disabled||e.readOnly)?e.startPlaceholder:o.endDate?bt.fromJSDate(o.endDate,{zone:o.timezone}).toFormat("LLL dd, yyyy | HH:mm:ss"):e.dueTooltip);return{states:o,displayStartDate:R,displayEndDate:T,tooltipStartDate:I,tooltipEndDate:x,showMultipleDueDates:f,showMultipleStartDates:h,selectEndDate:g,selectStartDate:p,clearDue:C,clearStart:v,clearAll:S,beginInteraction:b,confirmSelection:w,cancelSelection:_}},LF="MMM dd",OK=e=>{const t=e.timezone,n=Y(()=>e.start?fm({date:zh(e.start),timezone:t,format:LF}):"No start"),s=Y(()=>e.end?fm({date:zh(e.end),timezone:t,format:LF}):"No due"),o=d=>{if(!d)return null;const h=bt.now().setZone(t).startOf("day"),f=bt.fromISO(d).setZone(t).startOf("day");if(!f.isValid)return console.warn("Invalid date:",d,f.invalidReason),null;const p=f.diff(h,"days").days;return p===0?"today":p===1?"tomorrow":p===-1?"yesterday":p<-1?"past":"future"},i=Y(()=>o(e.start)),r=Y(()=>o(e.end)),a=Y(()=>{if(n.value==="No start")return["empty"];const d=[];return i.value&&d.push(`start-${i.value}`),e.isStarted&&d.push("actual"),d}),l=Y(()=>{if(s.value==="No due")return["empty"];const d=[];return r.value&&d.push(`end-${r.value}`),e.isEnded&&d.push("actual"),d}),u=Y(()=>e.start?fm({date:zh(e.start),timezone:t,format:"MMM dd, yyyy | HH:mm"}):"No start"),c=Y(()=>e.end?fm({date:zh(e.end),timezone:t,format:"MMM dd, yyyy | HH:mm"}):"No due");return{startDate:n,endDate:s,startClasses:a,endClasses:l,fullStartDate:u,fullEndDate:c}},MK="UserCache",NK="user",LK=()=>{const e=B({}),{getCachedValue:t,setCachedValue:n}=Dh({dbName:MK,storeName:NK}),s=async u=>u?await t(u):null;return{getCachedUser:s,setCachedUser:async u=>{if(!(u!=null&&u.id)){console.warn("Cannot cache user without id:",u);return}await n(u.id,u),e.value[u.id]=!0},getCachedUsers:async u=>{if(!u||u.length===0)return[];const c=u.map(h=>s(h));return(await Promise.all(c)).filter(h=>h!==null)},setCachedUsers:async u=>{if(!u||u.length===0)return;const d=uc(u,"id").filter(h=>h.id&&!e.value[h.id]).map(async h=>{await n(h.id,h),e.value[h.id]=!0});await Promise.all(d)},isUserCached:u=>!!e.value[u],clearCacheTracking:()=>{e.value={}}}},VK={placement:"bottom-start",theme:"light",trigger:"manual",interactive:!0,appendTo:()=>document.getElementById("item-table-layout-id")||document.body,showArrow:!0,showOnInit:!1,alwaysShow:!1,debug:!1,content:void 0,useTrigger:!0,showOverlay:!1,overlayOpacity:.5,closeOnOverlayClick:!0,centered:!1};let jh=0,Oo=null;function BK(e){return Oo||(Oo=document.createElement("div"),Oo.className="popup-overlay",Oo.style.cssText=`
|
|
114
114
|
position: fixed;
|
|
115
115
|
top: 0;
|
|
116
116
|
left: 0;
|
|
@@ -250,4 +250,4 @@ ${u}`:l)}else throw r},onCacheKey:r=>zve(t,n,r)}}function Twe(e){if(vt(e))return
|
|
|
250
250
|
*/const Lwe="9.14.5";function Vwe(){typeof __VUE_I18N_FULL_INSTALL__!="boolean"&&(pa().__VUE_I18N_FULL_INSTALL__=!0),typeof __VUE_I18N_LEGACY_API__!="boolean"&&(pa().__VUE_I18N_LEGACY_API__=!0),typeof __INTLIFY_JIT_COMPILATION__!="boolean"&&(pa().__INTLIFY_JIT_COMPILATION__=!1),typeof __INTLIFY_DROP_MESSAGE_COMPILER__!="boolean"&&(pa().__INTLIFY_DROP_MESSAGE_COMPILER__=!1),typeof __INTLIFY_PROD_DEVTOOLS__!="boolean"&&(pa().__INTLIFY_PROD_DEVTOOLS__=!1)}const oB=so.__EXTEND_POINT__,ma=yy(oB),Wn={FALLBACK_TO_ROOT:oB,NOT_SUPPORTED_PRESERVE:ma(),NOT_SUPPORTED_FORMATTER:ma(),NOT_SUPPORTED_PRESERVE_DIRECTIVE:ma(),NOT_SUPPORTED_GET_CHOICE_INDEX:ma(),COMPONENT_NAME_LEGACY_COMPATIBLE:ma(),NOT_FOUND_PARENT_SCOPE:ma(),IGNORE_OBJ_FLATTEN:ma(),NOTICE_DROP_ALLOW_COMPOSITION:ma(),NOTICE_DROP_TRANSLATE_EXIST_COMPATIBLE_FLAG:ma()},Bwe={[Wn.FALLBACK_TO_ROOT]:"Fall back to {type} '{key}' with root locale.",[Wn.NOT_SUPPORTED_PRESERVE]:"Not supported 'preserve'.",[Wn.NOT_SUPPORTED_FORMATTER]:"Not supported 'formatter'.",[Wn.NOT_SUPPORTED_PRESERVE_DIRECTIVE]:"Not supported 'preserveDirectiveContent'.",[Wn.NOT_SUPPORTED_GET_CHOICE_INDEX]:"Not supported 'getChoiceIndex'.",[Wn.COMPONENT_NAME_LEGACY_COMPATIBLE]:"Component name legacy compatible: '{name}' -> 'i18n'",[Wn.NOT_FOUND_PARENT_SCOPE]:"Not found parent scope. use the global scope.",[Wn.IGNORE_OBJ_FLATTEN]:"Ignore object flatten: '{key}' key has an string value",[Wn.NOTICE_DROP_ALLOW_COMPOSITION]:"'allowComposition' option will be dropped in the next major version. For more information, please see 👉 https://tinyurl.com/2p97mcze",[Wn.NOTICE_DROP_TRANSLATE_EXIST_COMPATIBLE_FLAG]:"'translateExistCompatible' option will be dropped in the next major version."};function vo(e,...t){return Z0(Bwe[e],...t)}const iB=Ts.__EXTEND_POINT__,yo=yy(iB),cn={UNEXPECTED_RETURN_TYPE:iB,INVALID_ARGUMENT:yo(),MUST_BE_CALL_SETUP_TOP:yo(),NOT_INSTALLED:yo(),NOT_AVAILABLE_IN_LEGACY_MODE:yo(),REQUIRED_VALUE:yo(),INVALID_VALUE:yo(),CANNOT_SETUP_VUE_DEVTOOLS_PLUGIN:yo(),NOT_INSTALLED_WITH_PROVIDE:yo(),UNEXPECTED_ERROR:yo(),NOT_COMPATIBLE_LEGACY_VUE_I18N:yo(),BRIDGE_SUPPORT_VUE_2_ONLY:yo(),MUST_DEFINE_I18N_OPTION_IN_ALLOW_COMPOSITION:yo(),NOT_AVAILABLE_COMPOSITION_IN_LEGACY:yo(),__EXTEND_POINT__:yo()};function Es(e,...t){return _d(e,null,K.env.NODE_ENV!=="production"?{messages:$we,args:t}:void 0)}const $we={[cn.UNEXPECTED_RETURN_TYPE]:"Unexpected return type in composer",[cn.INVALID_ARGUMENT]:"Invalid argument",[cn.MUST_BE_CALL_SETUP_TOP]:"Must be called at the top of a `setup` function",[cn.NOT_INSTALLED]:"Need to install with `app.use` function",[cn.UNEXPECTED_ERROR]:"Unexpected error",[cn.NOT_AVAILABLE_IN_LEGACY_MODE]:"Not available in legacy mode",[cn.REQUIRED_VALUE]:"Required in value: {0}",[cn.INVALID_VALUE]:"Invalid value",[cn.CANNOT_SETUP_VUE_DEVTOOLS_PLUGIN]:"Cannot setup vue-devtools plugin",[cn.NOT_INSTALLED_WITH_PROVIDE]:"Need to install with `provide` function",[cn.NOT_COMPATIBLE_LEGACY_VUE_I18N]:"Not compatible legacy VueI18n.",[cn.BRIDGE_SUPPORT_VUE_2_ONLY]:"vue-i18n-bridge support Vue 2.x only",[cn.MUST_DEFINE_I18N_OPTION_IN_ALLOW_COMPOSITION]:"Must define ‘i18n’ option or custom block in Composition API with using local scope in Legacy API mode",[cn.NOT_AVAILABLE_COMPOSITION_IN_LEGACY]:"Not available Compostion API in Legacy API mode. Please make sure that the legacy API mode is working properly"},c_=Dr("__translateVNode"),d_=Dr("__datetimeParts"),h_=Dr("__numberParts"),Fu=Dr("__enableEmitter"),pp=Dr("__disableEmitter"),rB=Dr("__setPluralRules"),aB=Dr("__injectWithOption"),f_=Dr("__dispose");function gp(e){if(!an(e)||hi(e))return e;for(const t in e)if(Hi(e,t))if(!t.includes("."))an(e[t])&&gp(e[t]);else{const n=t.split("."),s=n.length-1;let o=e,i=!1;for(let r=0;r<s;r++){if(n[r]==="__proto__")throw new Error(`unsafe key: ${n[r]}`);if(n[r]in o||(o[n[r]]=Dn()),!an(o[n[r]])){K.env.NODE_ENV!=="production"&&fs(vo(Wn.IGNORE_OBJ_FLATTEN,{key:n[r]})),i=!0;break}o=o[n[r]]}if(i||(hi(o)?b2.includes(n[s])||delete e[t]:(o[n[s]]=e[t],delete e[t])),!hi(o)){const r=o[n[s]];an(r)&&gp(r)}}return e}function Ty(e,t){const{messages:n,__i18n:s,messageResolver:o,flatJson:i}=t,r=Gt(n)?n:An(s)?Dn():{[e]:Dn()};if(An(s)&&s.forEach(a=>{if("locale"in a&&"resource"in a){const{locale:l,resource:u}=a;l?(r[l]=r[l]||Dn(),Cy(u,r[l])):Cy(u,r)}else vt(a)&&Cy(JSON.parse(a),r)}),o==null&&i)for(const a in r)Hi(r,a)&&gp(r[a]);return r}function lB(e){return e.type}function uB(e,t,n){let s=an(t.messages)?t.messages:Dn();"__i18nGlobal"in n&&(s=Ty(e.locale.value,{messages:s,__i18n:n.__i18nGlobal}));const o=Object.keys(s);o.length&&o.forEach(i=>{e.mergeLocaleMessage(i,s[i])});{if(an(t.datetimeFormats)){const i=Object.keys(t.datetimeFormats);i.length&&i.forEach(r=>{e.mergeDateTimeFormat(r,t.datetimeFormats[r])})}if(an(t.numberFormats)){const i=Object.keys(t.numberFormats);i.length&&i.forEach(r=>{e.mergeNumberFormat(r,t.numberFormats[r])})}}}function cB(e){return ge(Ra,null,e,0)}const dB="__INTLIFY_META__",hB=()=>[],Hwe=()=>!1;let fB=0;function pB(e){return(t,n,s,o)=>e(n,s,Yn()||void 0,o)}const Gwe=()=>{const e=Yn();let t=null;return e&&(t=lB(e)[dB])?{[dB]:t}:null};function p_(e={},t){const{__root:n,__injectWithOption:s}=e,o=n===void 0,i=e.flatJson,r=$i?B:Gp,a=!!e.translateExistCompatible;K.env.NODE_ENV!=="production"&&a&&QV(vo(Wn.NOTICE_DROP_TRANSLATE_EXIST_COMPATIBLE_FLAG));let l=Qt(e.inheritLocale)?e.inheritLocale:!0;const u=r(n&&l?n.locale.value:vt(e.locale)?e.locale:Td),c=r(n&&l?n.fallbackLocale.value:vt(e.fallbackLocale)||An(e.fallbackLocale)||Gt(e.fallbackLocale)||e.fallbackLocale===!1?e.fallbackLocale:u.value),d=r(Ty(u.value,e)),h=r(Gt(e.datetimeFormats)?e.datetimeFormats:{[u.value]:{}}),f=r(Gt(e.numberFormats)?e.numberFormats:{[u.value]:{}});let p=n?n.missingWarn:Qt(e.missingWarn)||cl(e.missingWarn)?e.missingWarn:!0,g=n?n.fallbackWarn:Qt(e.fallbackWarn)||cl(e.fallbackWarn)?e.fallbackWarn:!0,v=n?n.fallbackRoot:Qt(e.fallbackRoot)?e.fallbackRoot:!0,C=!!e.fallbackFormat,S=Tn(e.missing)?e.missing:null,b=Tn(e.missing)?pB(e.missing):null,w=Tn(e.postTranslation)?e.postTranslation:null,_=n?n.warnHtmlMessage:Qt(e.warnHtmlMessage)?e.warnHtmlMessage:!0,R=!!e.escapeParameter;const T=n?n.modifiers:Gt(e.modifiers)?e.modifiers:{};let I=e.pluralRules||n&&n.pluralRules,x;x=(()=>{o&&N2(null);const Se={version:Lwe,locale:u.value,fallbackLocale:c.value,messages:d.value,modifiers:T,pluralRules:I,missing:b===null?void 0:b,missingWarn:p,fallbackWarn:g,fallbackFormat:C,unresolving:!0,postTranslation:w===null?void 0:w,warnHtmlMessage:_,escapeParameter:R,messageResolver:e.messageResolver,messageCompiler:e.messageCompiler,__meta:{framework:"vue"}};Se.datetimeFormats=h.value,Se.numberFormats=f.value,Se.__datetimeFormatters=Gt(x)?x.__datetimeFormatters:void 0,Se.__numberFormatters=Gt(x)?x.__numberFormatters:void 0,K.env.NODE_ENV!=="production"&&(Se.__v_emitter=Gt(x)?x.__v_emitter:void 0);const Ve=ywe(Se);return o&&N2(Ve),Ve})(),fp(x,u.value,c.value);function D(){return[u.value,c.value,d.value,h.value,f.value]}const F=Y({get:()=>u.value,set:Se=>{u.value=Se,x.locale=u.value}}),k=Y({get:()=>c.value,set:Se=>{c.value=Se,x.fallbackLocale=c.value,fp(x,u.value,Se)}}),O=Y(()=>d.value),$=Y(()=>h.value),q=Y(()=>f.value);function J(){return Tn(w)?w:null}function ee(Se){w=Se,x.postTranslation=Se}function X(){return S}function ve(Se){Se!==null&&(b=pB(Se)),S=Se,x.missing=b}function te(Se,Ve){return Se!=="translate"||!Ve.resolvedMessage}const N=(Se,Ve,pt,At,Ut,Jt)=>{D();let zt;try{K.env.NODE_ENV!=="production"||__INTLIFY_PROD_DEVTOOLS__,o||(x.fallbackContext=n?vwe():void 0),zt=Se(x)}finally{K.env.NODE_ENV!=="production"||__INTLIFY_PROD_DEVTOOLS__,o||(x.fallbackContext=void 0)}if(pt!=="translate exists"&&rs(zt)&&zt===_y||pt==="translate exists"&&!zt){const[Ne,je]=Ve();if(K.env.NODE_ENV!=="production"&&n&&vt(Ne)&&te(pt,je)&&(v&&(Dy(g,Ne)||V2(p,Ne))&&fs(vo(Wn.FALLBACK_TO_ROOT,{key:Ne,type:pt})),K.env.NODE_ENV!=="production")){const{__v_emitter:yt}=x;yt&&v&&yt.emit("fallback",{type:pt,key:Ne,to:"global",groupId:`${pt}:${Ne}`})}return n&&v?At(n):Ut(Ne)}else{if(Jt(zt))return zt;throw Es(cn.UNEXPECTED_RETURN_TYPE)}};function V(...Se){return N(Ve=>Reflect.apply(j2,null,[Ve,...Se]),()=>r_(...Se),"translate",Ve=>Reflect.apply(Ve.t,Ve,[...Se]),Ve=>Ve,Ve=>vt(Ve))}function ne(...Se){const[Ve,pt,At]=Se;if(At&&!an(At))throw Es(cn.INVALID_ARGUMENT);return V(Ve,pt,Ms({resolvedMessage:!0},At||{}))}function ie(...Se){return N(Ve=>Reflect.apply(X2,null,[Ve,...Se]),()=>a_(...Se),"datetime format",Ve=>Reflect.apply(Ve.d,Ve,[...Se]),()=>Ry,Ve=>vt(Ve))}function pe(...Se){return N(Ve=>Reflect.apply(eB,null,[Ve,...Se]),()=>l_(...Se),"number format",Ve=>Reflect.apply(Ve.n,Ve,[...Se]),()=>Ry,Ve=>vt(Ve))}function ae(Se){return Se.map(Ve=>vt(Ve)||rs(Ve)||Qt(Ve)?cB(String(Ve)):Ve)}const W={normalize:ae,interpolate:Se=>Se,type:"vnode"};function fe(...Se){return N(Ve=>{let pt;const At=Ve;try{At.processor=W,pt=Reflect.apply(j2,null,[At,...Se])}finally{At.processor=null}return pt},()=>r_(...Se),"translate",Ve=>Ve[c_](...Se),Ve=>[cB(Ve)],Ve=>An(Ve))}function oe(...Se){return N(Ve=>Reflect.apply(eB,null,[Ve,...Se]),()=>l_(...Se),"number format",Ve=>Ve[h_](...Se),hB,Ve=>vt(Ve)||An(Ve))}function Ie(...Se){return N(Ve=>Reflect.apply(X2,null,[Ve,...Se]),()=>a_(...Se),"datetime format",Ve=>Ve[d_](...Se),hB,Ve=>vt(Ve)||An(Ve))}function G(Se){I=Se,x.pluralRules=I}function Z(Se,Ve){return N(()=>{if(!Se)return!1;const pt=vt(Ve)?Ve:u.value,At=Pe(pt),Ut=x.messageResolver(At,Se);return a?Ut!=null:hi(Ut)||fi(Ut)||vt(Ut)},()=>[Se],"translate exists",pt=>Reflect.apply(pt.te,pt,[Se,Ve]),Hwe,pt=>Qt(pt))}function de(Se){let Ve=null;const pt=T2(x,c.value,u.value);for(let At=0;At<pt.length;At++){const Ut=d.value[pt[At]]||{},Jt=x.messageResolver(Ut,Se);if(Jt!=null){Ve=Jt;break}}return Ve}function ke(Se){const Ve=de(Se);return Ve??(n?n.tm(Se)||{}:{})}function Pe(Se){return d.value[Se]||{}}function Le(Se,Ve){if(i){const pt={[Se]:Ve};for(const At in pt)Hi(pt,At)&&gp(pt[At]);Ve=pt[Se]}d.value[Se]=Ve,x.messages=d.value}function ye(Se,Ve){d.value[Se]=d.value[Se]||{};const pt={[Se]:Ve};if(i)for(const At in pt)Hi(pt,At)&&gp(pt[At]);Ve=pt[Se],Cy(Ve,d.value[Se]),x.messages=d.value}function M(Se){return h.value[Se]||{}}function H(Se,Ve){h.value[Se]=Ve,x.datetimeFormats=h.value,Q2(x,Se,Ve)}function le(Se,Ve){h.value[Se]=Ms(h.value[Se]||{},Ve),x.datetimeFormats=h.value,Q2(x,Se,Ve)}function Ge(Se){return f.value[Se]||{}}function we(Se,Ve){f.value[Se]=Ve,x.numberFormats=f.value,nB(x,Se,Ve)}function ze(Se,Ve){f.value[Se]=Ms(f.value[Se]||{},Ve),x.numberFormats=f.value,nB(x,Se,Ve)}fB++,n&&$i&&(nt(n.locale,Se=>{l&&(u.value=Se,x.locale=Se,fp(x,u.value,c.value))}),nt(n.fallbackLocale,Se=>{l&&(c.value=Se,x.fallbackLocale=Se,fp(x,u.value,c.value))}));const Ue={id:fB,locale:F,fallbackLocale:k,get inheritLocale(){return l},set inheritLocale(Se){l=Se,Se&&n&&(u.value=n.locale.value,c.value=n.fallbackLocale.value,fp(x,u.value,c.value))},get availableLocales(){return Object.keys(d.value).sort()},messages:O,get modifiers(){return T},get pluralRules(){return I||{}},get isGlobal(){return o},get missingWarn(){return p},set missingWarn(Se){p=Se,x.missingWarn=p},get fallbackWarn(){return g},set fallbackWarn(Se){g=Se,x.fallbackWarn=g},get fallbackRoot(){return v},set fallbackRoot(Se){v=Se},get fallbackFormat(){return C},set fallbackFormat(Se){C=Se,x.fallbackFormat=C},get warnHtmlMessage(){return _},set warnHtmlMessage(Se){_=Se,x.warnHtmlMessage=Se},get escapeParameter(){return R},set escapeParameter(Se){R=Se,x.escapeParameter=Se},t:V,getLocaleMessage:Pe,setLocaleMessage:Le,mergeLocaleMessage:ye,getPostTranslationHandler:J,setPostTranslationHandler:ee,getMissingHandler:X,setMissingHandler:ve,[rB]:G};return Ue.datetimeFormats=$,Ue.numberFormats=q,Ue.rt=ne,Ue.te=Z,Ue.tm=ke,Ue.d=ie,Ue.n=pe,Ue.getDateTimeFormat=M,Ue.setDateTimeFormat=H,Ue.mergeDateTimeFormat=le,Ue.getNumberFormat=Ge,Ue.setNumberFormat=we,Ue.mergeNumberFormat=ze,Ue[aB]=s,Ue[c_]=fe,Ue[d_]=Ie,Ue[h_]=oe,K.env.NODE_ENV!=="production"&&(Ue[Fu]=Se=>{x.__v_emitter=Se},Ue[pp]=()=>{x.__v_emitter=void 0}),Ue}function Uwe(e){const t=vt(e.locale)?e.locale:Td,n=vt(e.fallbackLocale)||An(e.fallbackLocale)||Gt(e.fallbackLocale)||e.fallbackLocale===!1?e.fallbackLocale:t,s=Tn(e.missing)?e.missing:void 0,o=Qt(e.silentTranslationWarn)||cl(e.silentTranslationWarn)?!e.silentTranslationWarn:!0,i=Qt(e.silentFallbackWarn)||cl(e.silentFallbackWarn)?!e.silentFallbackWarn:!0,r=Qt(e.fallbackRoot)?e.fallbackRoot:!0,a=!!e.formatFallbackMessages,l=Gt(e.modifiers)?e.modifiers:{},u=e.pluralizationRules,c=Tn(e.postTranslation)?e.postTranslation:void 0,d=vt(e.warnHtmlInMessage)?e.warnHtmlInMessage!=="off":!0,h=!!e.escapeParameterHtml,f=Qt(e.sync)?e.sync:!0;K.env.NODE_ENV!=="production"&&e.formatter&&fs(vo(Wn.NOT_SUPPORTED_FORMATTER)),K.env.NODE_ENV!=="production"&&e.preserveDirectiveContent&&fs(vo(Wn.NOT_SUPPORTED_PRESERVE_DIRECTIVE));let p=e.messages;if(Gt(e.sharedMessages)){const R=e.sharedMessages;p=Object.keys(R).reduce((I,x)=>{const P=I[x]||(I[x]={});return Ms(P,R[x]),I},p||{})}const{__i18n:g,__root:v,__injectWithOption:C}=e,S=e.datetimeFormats,b=e.numberFormats,w=e.flatJson,_=e.translateExistCompatible;return{locale:t,fallbackLocale:n,messages:p,flatJson:w,datetimeFormats:S,numberFormats:b,missing:s,missingWarn:o,fallbackWarn:i,fallbackRoot:r,fallbackFormat:a,modifiers:l,pluralRules:u,postTranslation:c,warnHtmlMessage:d,escapeParameter:h,messageResolver:e.messageResolver,inheritLocale:f,translateExistCompatible:_,__i18n:g,__root:v,__injectWithOption:C}}function g_(e={},t){{const n=p_(Uwe(e)),{__extender:s}=e,o={id:n.id,get locale(){return n.locale.value},set locale(i){n.locale.value=i},get fallbackLocale(){return n.fallbackLocale.value},set fallbackLocale(i){n.fallbackLocale.value=i},get messages(){return n.messages.value},get datetimeFormats(){return n.datetimeFormats.value},get numberFormats(){return n.numberFormats.value},get availableLocales(){return n.availableLocales},get formatter(){return K.env.NODE_ENV!=="production"&&fs(vo(Wn.NOT_SUPPORTED_FORMATTER)),{interpolate(){return[]}}},set formatter(i){K.env.NODE_ENV!=="production"&&fs(vo(Wn.NOT_SUPPORTED_FORMATTER))},get missing(){return n.getMissingHandler()},set missing(i){n.setMissingHandler(i)},get silentTranslationWarn(){return Qt(n.missingWarn)?!n.missingWarn:n.missingWarn},set silentTranslationWarn(i){n.missingWarn=Qt(i)?!i:i},get silentFallbackWarn(){return Qt(n.fallbackWarn)?!n.fallbackWarn:n.fallbackWarn},set silentFallbackWarn(i){n.fallbackWarn=Qt(i)?!i:i},get modifiers(){return n.modifiers},get formatFallbackMessages(){return n.fallbackFormat},set formatFallbackMessages(i){n.fallbackFormat=i},get postTranslation(){return n.getPostTranslationHandler()},set postTranslation(i){n.setPostTranslationHandler(i)},get sync(){return n.inheritLocale},set sync(i){n.inheritLocale=i},get warnHtmlInMessage(){return n.warnHtmlMessage?"warn":"off"},set warnHtmlInMessage(i){n.warnHtmlMessage=i!=="off"},get escapeParameterHtml(){return n.escapeParameter},set escapeParameterHtml(i){n.escapeParameter=i},get preserveDirectiveContent(){return K.env.NODE_ENV!=="production"&&fs(vo(Wn.NOT_SUPPORTED_PRESERVE_DIRECTIVE)),!0},set preserveDirectiveContent(i){K.env.NODE_ENV!=="production"&&fs(vo(Wn.NOT_SUPPORTED_PRESERVE_DIRECTIVE))},get pluralizationRules(){return n.pluralRules||{}},__composer:n,t(...i){const[r,a,l]=i,u={};let c=null,d=null;if(!vt(r))throw Es(cn.INVALID_ARGUMENT);const h=r;return vt(a)?u.locale=a:An(a)?c=a:Gt(a)&&(d=a),An(l)?c=l:Gt(l)&&(d=l),Reflect.apply(n.t,n,[h,c||d||{},u])},rt(...i){return Reflect.apply(n.rt,n,[...i])},tc(...i){const[r,a,l]=i,u={plural:1};let c=null,d=null;if(!vt(r))throw Es(cn.INVALID_ARGUMENT);const h=r;return vt(a)?u.locale=a:rs(a)?u.plural=a:An(a)?c=a:Gt(a)&&(d=a),vt(l)?u.locale=l:An(l)?c=l:Gt(l)&&(d=l),Reflect.apply(n.t,n,[h,c||d||{},u])},te(i,r){return n.te(i,r)},tm(i){return n.tm(i)},getLocaleMessage(i){return n.getLocaleMessage(i)},setLocaleMessage(i,r){n.setLocaleMessage(i,r)},mergeLocaleMessage(i,r){n.mergeLocaleMessage(i,r)},d(...i){return Reflect.apply(n.d,n,[...i])},getDateTimeFormat(i){return n.getDateTimeFormat(i)},setDateTimeFormat(i,r){n.setDateTimeFormat(i,r)},mergeDateTimeFormat(i,r){n.mergeDateTimeFormat(i,r)},n(...i){return Reflect.apply(n.n,n,[...i])},getNumberFormat(i){return n.getNumberFormat(i)},setNumberFormat(i,r){n.setNumberFormat(i,r)},mergeNumberFormat(i,r){n.mergeNumberFormat(i,r)},getChoiceIndex(i,r){return K.env.NODE_ENV!=="production"&&fs(vo(Wn.NOT_SUPPORTED_GET_CHOICE_INDEX)),-1}};return o.__extender=s,K.env.NODE_ENV!=="production"&&(o.__enableEmitter=i=>{const r=n;r[Fu]&&r[Fu](i)},o.__disableEmitter=()=>{const i=n;i[pp]&&i[pp]()}),o}}const m_={tag:{type:[String,Object]},locale:{type:String},scope:{type:String,validator:e=>e==="parent"||e==="global",default:"parent"},i18n:{type:Object}};function Wwe({slots:e},t){return t.length===1&&t[0]==="default"?(e.default?e.default():[]).reduce((s,o)=>[...s,...o.type===xt?o.children:[o]],[]):t.reduce((n,s)=>{const o=e[s];return o&&(n[s]=o()),n},Dn())}function gB(e){return xt}const v_=rt({name:"i18n-t",props:Ms({keypath:{type:String,required:!0},plural:{type:[Number,String],validator:e=>rs(e)||!isNaN(e)}},m_),setup(e,t){const{slots:n,attrs:s}=t,o=e.i18n||b_({useScope:e.scope,__useComponent:!0});return()=>{const i=Object.keys(n).filter(d=>d!=="_"),r=Dn();e.locale&&(r.locale=e.locale),e.plural!==void 0&&(r.plural=vt(e.plural)?+e.plural:e.plural);const a=Wwe(t,i),l=o[c_](e.keypath,a,r),u=Ms(Dn(),s),c=vt(e.tag)||an(e.tag)?e.tag:gB();return Zu(c,u,l)}}});function zwe(e){return An(e)&&!vt(e[0])}function mB(e,t,n,s){const{slots:o,attrs:i}=t;return()=>{const r={part:!0};let a=Dn();e.locale&&(r.locale=e.locale),vt(e.format)?r.key=e.format:an(e.format)&&(vt(e.format.key)&&(r.key=e.format.key),a=Object.keys(e.format).reduce((h,f)=>n.includes(f)?Ms(Dn(),h,{[f]:e.format[f]}):h,Dn()));const l=s(e.value,r,a);let u=[r.key];An(l)?u=l.map((h,f)=>{const p=o[h.type],g=p?p({[h.type]:h.value,index:f,parts:l}):[h.value];return zwe(g)&&(g[0].key=`${h.type}-${f}`),g}):vt(l)&&(u=[l]);const c=Ms(Dn(),i),d=vt(e.tag)||an(e.tag)?e.tag:gB();return Zu(d,c,u)}}const vB=rt({name:"i18n-n",props:Ms({value:{type:Number,required:!0},format:{type:[String,Object]}},m_),setup(e,t){const n=e.i18n||b_({useScope:e.scope,__useComponent:!0});return mB(e,t,tB,(...s)=>n[h_](...s))}}),yB=rt({name:"i18n-d",props:Ms({value:{type:[Number,Date],required:!0},format:{type:[String,Object]}},m_),setup(e,t){const n=e.i18n||b_({useScope:e.scope,__useComponent:!0});return mB(e,t,J2,(...s)=>n[d_](...s))}});function jwe(e,t){const n=e;if(e.mode==="composition")return n.__getInstance(t)||e.global;{const s=n.__getInstance(t);return s!=null?s.__composer:e.global.__composer}}function Kwe(e){const t=r=>{const{instance:a,modifiers:l,value:u}=r;if(!a||!a.$)throw Es(cn.UNEXPECTED_ERROR);const c=jwe(e,a.$);K.env.NODE_ENV!=="production"&&l.preserve&&fs(vo(Wn.NOT_SUPPORTED_PRESERVE));const d=wB(u);return[Reflect.apply(c.t,c,[...CB(d)]),c]};return{created:(r,a)=>{const[l,u]=t(a);$i&&e.global===u&&(r.__i18nWatcher=nt(u.locale,()=>{a.instance&&a.instance.$forceUpdate()})),r.__composer=u,r.textContent=l},unmounted:r=>{$i&&r.__i18nWatcher&&(r.__i18nWatcher(),r.__i18nWatcher=void 0,delete r.__i18nWatcher),r.__composer&&(r.__composer=void 0,delete r.__composer)},beforeUpdate:(r,{value:a})=>{if(r.__composer){const l=r.__composer,u=wB(a);r.textContent=Reflect.apply(l.t,l,[...CB(u)])}},getSSRProps:r=>{const[a]=t(r);return{textContent:a}}}}function wB(e){if(vt(e))return{path:e};if(Gt(e)){if(!("path"in e))throw Es(cn.REQUIRED_VALUE,"path");return e}else throw Es(cn.INVALID_VALUE)}function CB(e){const{path:t,locale:n,args:s,choice:o,plural:i}=e,r={},a=s||{};return vt(n)&&(r.locale=n),rs(o)&&(r.plural=o),rs(i)&&(r.plural=i),[t,a,r]}function qwe(e,t,...n){const s=Gt(n[0])?n[0]:{},o=!!s.useI18nComponentName,i=Qt(s.globalInstall)?s.globalInstall:!0;K.env.NODE_ENV!=="production"&&i&&o&&fs(vo(Wn.COMPONENT_NAME_LEGACY_COMPATIBLE,{name:v_.name})),i&&([o?"i18n":v_.name,"I18nT"].forEach(r=>e.component(r,v_)),[vB.name,"I18nN"].forEach(r=>e.component(r,vB)),[yB.name,"I18nD"].forEach(r=>e.component(r,yB))),e.directive("t",Kwe(t))}const y_={"vue-devtools-plugin-vue-i18n":"Vue I18n devtools","vue-i18n-resource-inspector":"I18n Resources","vue-i18n-timeline":"Vue I18n"},Ywe={"vue-i18n-resource-inspector":"Search for scopes ..."},Zwe={"vue-i18n-timeline":16764185},bB="vue-i18n: composer properties";let w_;async function Xwe(e,t){return new Promise((n,s)=>{try{Nwe({id:"vue-devtools-plugin-vue-i18n",label:y_["vue-devtools-plugin-vue-i18n"],packageName:"vue-i18n",homepage:"https://vue-i18n.intlify.dev",logo:"https://vue-i18n.intlify.dev/vue-i18n-devtools-logo.png",componentStateTypes:[bB],app:e},o=>{w_=o,o.on.visitComponentTree(({componentInstance:r,treeNode:a})=>{Jwe(r,a,t)}),o.on.inspectComponent(({componentInstance:r,instanceData:a})=>{r.vnode.el&&r.vnode.el.__VUE_I18N__&&a&&(t.mode==="legacy"?r.vnode.el.__VUE_I18N__!==t.global.__composer&&EB(a,r.vnode.el.__VUE_I18N__):EB(a,r.vnode.el.__VUE_I18N__))}),o.addInspector({id:"vue-i18n-resource-inspector",label:y_["vue-i18n-resource-inspector"],icon:"language",treeFilterPlaceholder:Ywe["vue-i18n-resource-inspector"]}),o.on.getInspectorTree(r=>{r.app===e&&r.inspectorId==="vue-i18n-resource-inspector"&&sCe(r,t)});const i=new Map;o.on.getInspectorState(async r=>{if(r.app===e&&r.inspectorId==="vue-i18n-resource-inspector")if(o.unhighlightElement(),iCe(r,t),r.nodeId==="global"){if(!i.has(r.app)){const[a]=await o.getComponentInstances(r.app);i.set(r.app,a)}o.highlightElement(i.get(r.app))}else{const a=oCe(r.nodeId,t);a&&o.highlightElement(a)}}),o.on.editInspectorState(r=>{r.app===e&&r.inspectorId==="vue-i18n-resource-inspector"&&aCe(r,t)}),o.addTimelineLayer({id:"vue-i18n-timeline",label:y_["vue-i18n-timeline"],color:Zwe["vue-i18n-timeline"]}),n(!0)})}catch(o){console.error(o),s(!1)}})}function SB(e){return e.type.name||e.type.displayName||e.type.__file||"Anonymous"}function Jwe(e,t,n){const s=n.mode==="composition"?n.global:n.global.__composer;if(e&&e.vnode.el&&e.vnode.el.__VUE_I18N__&&e.vnode.el.__VUE_I18N__!==s){const o={label:`i18n (${SB(e)} Scope)`,textColor:0,backgroundColor:16764185};t.tags.push(o)}}function EB(e,t){const n=bB;e.state.push({type:n,key:"locale",editable:!0,value:t.locale.value}),e.state.push({type:n,key:"availableLocales",editable:!1,value:t.availableLocales}),e.state.push({type:n,key:"fallbackLocale",editable:!0,value:t.fallbackLocale.value}),e.state.push({type:n,key:"inheritLocale",editable:!0,value:t.inheritLocale}),e.state.push({type:n,key:"messages",editable:!1,value:C_(t.messages.value)}),e.state.push({type:n,key:"datetimeFormats",editable:!1,value:t.datetimeFormats.value}),e.state.push({type:n,key:"numberFormats",editable:!1,value:t.numberFormats.value})}function C_(e){const t={};return Object.keys(e).forEach(n=>{const s=e[n];Tn(s)&&"source"in s?t[n]=nCe(s):hi(s)&&s.loc&&s.loc.source?t[n]=s.loc.source:an(s)?t[n]=C_(s):t[n]=s}),t}const Qwe={"<":"<",">":">",'"':""","&":"&"};function eCe(e){return e.replace(/[<>"&]/g,tCe)}function tCe(e){return Qwe[e]||e}function nCe(e){return{_custom:{type:"function",display:`<span>ƒ</span> ${e.source?`("${eCe(e.source)}")`:"(?)"}`}}}function sCe(e,t){e.rootNodes.push({id:"global",label:"Global Scope"});const n=t.mode==="composition"?t.global:t.global.__composer;for(const[s,o]of t.__instances){const i=t.mode==="composition"?o:o.__composer;n!==i&&e.rootNodes.push({id:i.id.toString(),label:`${SB(s)} Scope`})}}function oCe(e,t){let n=null;if(e!=="global"){for(const[s,o]of t.__instances.entries())if(o.id.toString()===e){n=s;break}}return n}function _B(e,t){if(e==="global")return t.mode==="composition"?t.global:t.global.__composer;{const n=Array.from(t.__instances.values()).find(s=>s.id.toString()===e);return n?t.mode==="composition"?n:n.__composer:null}}function iCe(e,t){const n=_B(e.nodeId,t);return n&&(e.state=rCe(n)),null}function rCe(e){const t={},n="Locale related info",s=[{type:n,key:"locale",editable:!0,value:e.locale.value},{type:n,key:"fallbackLocale",editable:!0,value:e.fallbackLocale.value},{type:n,key:"availableLocales",editable:!1,value:e.availableLocales},{type:n,key:"inheritLocale",editable:!0,value:e.inheritLocale}];t[n]=s;const o="Locale messages info",i=[{type:o,key:"messages",editable:!1,value:C_(e.messages.value)}];t[o]=i;{const r="Datetime formats info",a=[{type:r,key:"datetimeFormats",editable:!1,value:e.datetimeFormats.value}];t[r]=a;const l="Datetime formats info",u=[{type:l,key:"numberFormats",editable:!1,value:e.numberFormats.value}];t[l]=u}return t}function mp(e,t){if(w_){let n;t&&"groupId"in t&&(n=t.groupId,delete t.groupId),w_.addTimelineEvent({layerId:"vue-i18n-timeline",event:{title:e,groupId:n,time:Date.now(),meta:{},data:t||{},logType:e==="compile-error"?"error":e==="fallback"||e==="missing"?"warning":"default"}})}}function aCe(e,t){const n=_B(e.nodeId,t);if(n){const[s]=e.path;s==="locale"&&vt(e.state.value)?n.locale.value=e.state.value:s==="fallbackLocale"&&(vt(e.state.value)||An(e.state.value)||an(e.state.value))?n.fallbackLocale.value=e.state.value:s==="inheritLocale"&&Qt(e.state.value)&&(n.inheritLocale=e.state.value)}}function lCe(e,t,n){return{beforeCreate(){const s=Yn();if(!s)throw Es(cn.UNEXPECTED_ERROR);const o=this.$options;if(o.i18n){const i=o.i18n;if(o.__i18n&&(i.__i18n=o.__i18n),i.__root=t,this===this.$root)this.$i18n=RB(e,i);else{i.__injectWithOption=!0,i.__extender=n.__vueI18nExtend,this.$i18n=g_(i);const r=this.$i18n;r.__extender&&(r.__disposer=r.__extender(this.$i18n))}}else if(o.__i18n)if(this===this.$root)this.$i18n=RB(e,o);else{this.$i18n=g_({__i18n:o.__i18n,__injectWithOption:!0,__extender:n.__vueI18nExtend,__root:t});const i=this.$i18n;i.__extender&&(i.__disposer=i.__extender(this.$i18n))}else this.$i18n=e;o.__i18nGlobal&&uB(t,o,o),this.$t=(...i)=>this.$i18n.t(...i),this.$rt=(...i)=>this.$i18n.rt(...i),this.$tc=(...i)=>this.$i18n.tc(...i),this.$te=(i,r)=>this.$i18n.te(i,r),this.$d=(...i)=>this.$i18n.d(...i),this.$n=(...i)=>this.$i18n.n(...i),this.$tm=i=>this.$i18n.tm(i),n.__setInstance(s,this.$i18n)},mounted(){if(K.env.NODE_ENV!=="production"&&this.$el&&this.$i18n){const s=this.$i18n;this.$el.__VUE_I18N__=s.__composer;const o=this.__v_emitter=X0();s.__enableEmitter&&s.__enableEmitter(o),o.on("*",mp)}},unmounted(){const s=Yn();if(!s)throw Es(cn.UNEXPECTED_ERROR);const o=this.$i18n;K.env.NODE_ENV!=="production"&&this.$el&&this.$el.__VUE_I18N__&&(this.__v_emitter&&(this.__v_emitter.off("*",mp),delete this.__v_emitter),this.$i18n&&(o.__disableEmitter&&o.__disableEmitter(),delete this.$el.__VUE_I18N__)),delete this.$t,delete this.$rt,delete this.$tc,delete this.$te,delete this.$d,delete this.$n,delete this.$tm,o.__disposer&&(o.__disposer(),delete o.__disposer,delete o.__extender),n.__deleteInstance(s),delete this.$i18n}}}function RB(e,t){e.locale=t.locale||e.locale,e.fallbackLocale=t.fallbackLocale||e.fallbackLocale,e.missing=t.missing||e.missing,e.silentTranslationWarn=t.silentTranslationWarn||e.silentFallbackWarn,e.silentFallbackWarn=t.silentFallbackWarn||e.silentFallbackWarn,e.formatFallbackMessages=t.formatFallbackMessages||e.formatFallbackMessages,e.postTranslation=t.postTranslation||e.postTranslation,e.warnHtmlInMessage=t.warnHtmlInMessage||e.warnHtmlInMessage,e.escapeParameterHtml=t.escapeParameterHtml||e.escapeParameterHtml,e.sync=t.sync||e.sync,e.__composer[rB](t.pluralizationRules||e.pluralizationRules);const n=Ty(e.locale,{messages:t.messages,__i18n:t.__i18n});return Object.keys(n).forEach(s=>e.mergeLocaleMessage(s,n[s])),t.datetimeFormats&&Object.keys(t.datetimeFormats).forEach(s=>e.mergeDateTimeFormat(s,t.datetimeFormats[s])),t.numberFormats&&Object.keys(t.numberFormats).forEach(s=>e.mergeNumberFormat(s,t.numberFormats[s])),e}const uCe=Dr("global-vue-i18n");function cCe(e={},t){const n=__VUE_I18N_LEGACY_API__&&Qt(e.legacy)?e.legacy:__VUE_I18N_LEGACY_API__,s=Qt(e.globalInjection)?e.globalInjection:!0,o=__VUE_I18N_LEGACY_API__&&n?!!e.allowComposition:!0,i=new Map,[r,a]=dCe(e,n),l=Dr(K.env.NODE_ENV!=="production"?"vue-i18n":"");K.env.NODE_ENV!=="production"&&n&&o&&fs(vo(Wn.NOTICE_DROP_ALLOW_COMPOSITION));function u(h){return i.get(h)||null}function c(h,f){i.set(h,f)}function d(h){i.delete(h)}{const h={get mode(){return __VUE_I18N_LEGACY_API__&&n?"legacy":"composition"},get allowComposition(){return o},async install(f,...p){if(K.env.NODE_ENV!=="production"&&(f.__VUE_I18N__=h),f.__VUE_I18N_SYMBOL__=l,f.provide(f.__VUE_I18N_SYMBOL__,h),Gt(p[0])){const C=p[0];h.__composerExtend=C.__composerExtend,h.__vueI18nExtend=C.__vueI18nExtend}let g=null;!n&&s&&(g=CCe(f,h.global)),__VUE_I18N_FULL_INSTALL__&&qwe(f,h,...p),__VUE_I18N_LEGACY_API__&&n&&f.mixin(lCe(a,a.__composer,h));const v=f.unmount;if(f.unmount=()=>{g&&g(),h.dispose(),v()},K.env.NODE_ENV!=="production"){if(!await Xwe(f,h))throw Es(cn.CANNOT_SETUP_VUE_DEVTOOLS_PLUGIN);const S=X0();if(n){const b=a;b.__enableEmitter&&b.__enableEmitter(S)}else{const b=a;b[Fu]&&b[Fu](S)}S.on("*",mp)}},get global(){return a},dispose(){r.stop()},__instances:i,__getInstance:u,__setInstance:c,__deleteInstance:d};return h}}function b_(e={}){const t=Yn();if(t==null)throw Es(cn.MUST_BE_CALL_SETUP_TOP);if(!t.isCE&&t.appContext.app!=null&&!t.appContext.app.__VUE_I18N_SYMBOL__)throw Es(cn.NOT_INSTALLED);const n=hCe(t),s=pCe(n),o=lB(t),i=fCe(e,o);if(__VUE_I18N_LEGACY_API__&&n.mode==="legacy"&&!e.__useComponent){if(!n.allowComposition)throw Es(cn.NOT_AVAILABLE_IN_LEGACY_MODE);return yCe(t,i,s,e)}if(i==="global")return uB(s,e,o),s;if(i==="parent"){let l=gCe(n,t,e.__useComponent);return l==null&&(K.env.NODE_ENV!=="production"&&fs(vo(Wn.NOT_FOUND_PARENT_SCOPE)),l=s),l}const r=n;let a=r.__getInstance(t);if(a==null){const l=Ms({},e);"__i18n"in o&&(l.__i18n=o.__i18n),s&&(l.__root=s),a=p_(l),r.__composerExtend&&(a[f_]=r.__composerExtend(a)),vCe(r,t,a),r.__setInstance(t,a)}return a}function dCe(e,t,n){const s=ew();{const o=__VUE_I18N_LEGACY_API__&&t?s.run(()=>g_(e)):s.run(()=>p_(e));if(o==null)throw Es(cn.UNEXPECTED_ERROR);return[s,o]}}function hCe(e){{const t=En(e.isCE?uCe:e.appContext.app.__VUE_I18N_SYMBOL__);if(!t)throw Es(e.isCE?cn.NOT_INSTALLED_WITH_PROVIDE:cn.UNEXPECTED_ERROR);return t}}function fCe(e,t){return vy(e)?"__i18n"in t?"local":"global":e.useScope?e.useScope:"local"}function pCe(e){return e.mode==="composition"?e.global:e.global.__composer}function gCe(e,t,n=!1){let s=null;const o=t.root;let i=mCe(t,n);for(;i!=null;){const r=e;if(e.mode==="composition")s=r.__getInstance(i);else if(__VUE_I18N_LEGACY_API__){const a=r.__getInstance(i);a!=null&&(s=a.__composer,n&&s&&!s[aB]&&(s=null))}if(s!=null||o===i)break;i=i.parent}return s}function mCe(e,t=!1){return e==null?null:t&&e.vnode.ctx||e.parent}function vCe(e,t,n){let s=null;tn(()=>{if(K.env.NODE_ENV!=="production"&&t.vnode.el){t.vnode.el.__VUE_I18N__=n,s=X0();const o=n;o[Fu]&&o[Fu](s),s.on("*",mp)}},t),Il(()=>{const o=n;K.env.NODE_ENV!=="production"&&t.vnode.el&&t.vnode.el.__VUE_I18N__&&(s&&s.off("*",mp),o[pp]&&o[pp](),delete t.vnode.el.__VUE_I18N__),e.__deleteInstance(t);const i=o[f_];i&&(i(),delete o[f_])},t)}function yCe(e,t,n,s={}){const o=t==="local",i=Gp(null);if(o&&e.proxy&&!(e.proxy.$options.i18n||e.proxy.$options.__i18n))throw Es(cn.MUST_DEFINE_I18N_OPTION_IN_ALLOW_COMPOSITION);const r=Qt(s.inheritLocale)?s.inheritLocale:!vt(s.locale),a=B(!o||r?n.locale.value:vt(s.locale)?s.locale:Td),l=B(!o||r?n.fallbackLocale.value:vt(s.fallbackLocale)||An(s.fallbackLocale)||Gt(s.fallbackLocale)||s.fallbackLocale===!1?s.fallbackLocale:a.value),u=B(Ty(a.value,s)),c=B(Gt(s.datetimeFormats)?s.datetimeFormats:{[a.value]:{}}),d=B(Gt(s.numberFormats)?s.numberFormats:{[a.value]:{}}),h=o?n.missingWarn:Qt(s.missingWarn)||cl(s.missingWarn)?s.missingWarn:!0,f=o?n.fallbackWarn:Qt(s.fallbackWarn)||cl(s.fallbackWarn)?s.fallbackWarn:!0,p=o?n.fallbackRoot:Qt(s.fallbackRoot)?s.fallbackRoot:!0,g=!!s.fallbackFormat,v=Tn(s.missing)?s.missing:null,C=Tn(s.postTranslation)?s.postTranslation:null,S=o?n.warnHtmlMessage:Qt(s.warnHtmlMessage)?s.warnHtmlMessage:!0,b=!!s.escapeParameter,w=o?n.modifiers:Gt(s.modifiers)?s.modifiers:{},_=s.pluralRules||o&&n.pluralRules;function R(){return[a.value,l.value,u.value,c.value,d.value]}const T=Y({get:()=>i.value?i.value.locale.value:a.value,set:Z=>{i.value&&(i.value.locale.value=Z),a.value=Z}}),I=Y({get:()=>i.value?i.value.fallbackLocale.value:l.value,set:Z=>{i.value&&(i.value.fallbackLocale.value=Z),l.value=Z}}),x=Y(()=>i.value?i.value.messages.value:u.value),P=Y(()=>c.value),D=Y(()=>d.value);function F(){return i.value?i.value.getPostTranslationHandler():C}function k(Z){i.value&&i.value.setPostTranslationHandler(Z)}function O(){return i.value?i.value.getMissingHandler():v}function $(Z){i.value&&i.value.setMissingHandler(Z)}function q(Z){return R(),Z()}function J(...Z){return i.value?q(()=>Reflect.apply(i.value.t,null,[...Z])):q(()=>"")}function ee(...Z){return i.value?Reflect.apply(i.value.rt,null,[...Z]):""}function X(...Z){return i.value?q(()=>Reflect.apply(i.value.d,null,[...Z])):q(()=>"")}function ve(...Z){return i.value?q(()=>Reflect.apply(i.value.n,null,[...Z])):q(()=>"")}function te(Z){return i.value?i.value.tm(Z):{}}function N(Z,de){return i.value?i.value.te(Z,de):!1}function V(Z){return i.value?i.value.getLocaleMessage(Z):{}}function ne(Z,de){i.value&&(i.value.setLocaleMessage(Z,de),u.value[Z]=de)}function ie(Z,de){i.value&&i.value.mergeLocaleMessage(Z,de)}function pe(Z){return i.value?i.value.getDateTimeFormat(Z):{}}function ae(Z,de){i.value&&(i.value.setDateTimeFormat(Z,de),c.value[Z]=de)}function re(Z,de){i.value&&i.value.mergeDateTimeFormat(Z,de)}function W(Z){return i.value?i.value.getNumberFormat(Z):{}}function fe(Z,de){i.value&&(i.value.setNumberFormat(Z,de),d.value[Z]=de)}function oe(Z,de){i.value&&i.value.mergeNumberFormat(Z,de)}const Ie={get id(){return i.value?i.value.id:-1},locale:T,fallbackLocale:I,messages:x,datetimeFormats:P,numberFormats:D,get inheritLocale(){return i.value?i.value.inheritLocale:r},set inheritLocale(Z){i.value&&(i.value.inheritLocale=Z)},get availableLocales(){return i.value?i.value.availableLocales:Object.keys(u.value)},get modifiers(){return i.value?i.value.modifiers:w},get pluralRules(){return i.value?i.value.pluralRules:_},get isGlobal(){return i.value?i.value.isGlobal:!1},get missingWarn(){return i.value?i.value.missingWarn:h},set missingWarn(Z){i.value&&(i.value.missingWarn=Z)},get fallbackWarn(){return i.value?i.value.fallbackWarn:f},set fallbackWarn(Z){i.value&&(i.value.missingWarn=Z)},get fallbackRoot(){return i.value?i.value.fallbackRoot:p},set fallbackRoot(Z){i.value&&(i.value.fallbackRoot=Z)},get fallbackFormat(){return i.value?i.value.fallbackFormat:g},set fallbackFormat(Z){i.value&&(i.value.fallbackFormat=Z)},get warnHtmlMessage(){return i.value?i.value.warnHtmlMessage:S},set warnHtmlMessage(Z){i.value&&(i.value.warnHtmlMessage=Z)},get escapeParameter(){return i.value?i.value.escapeParameter:b},set escapeParameter(Z){i.value&&(i.value.escapeParameter=Z)},t:J,getPostTranslationHandler:F,setPostTranslationHandler:k,getMissingHandler:O,setMissingHandler:$,rt:ee,d:X,n:ve,tm:te,te:N,getLocaleMessage:V,setLocaleMessage:ne,mergeLocaleMessage:ie,getDateTimeFormat:pe,setDateTimeFormat:ae,mergeDateTimeFormat:re,getNumberFormat:W,setNumberFormat:fe,mergeNumberFormat:oe};function G(Z){Z.locale.value=a.value,Z.fallbackLocale.value=l.value,Object.keys(u.value).forEach(de=>{Z.mergeLocaleMessage(de,u.value[de])}),Object.keys(c.value).forEach(de=>{Z.mergeDateTimeFormat(de,c.value[de])}),Object.keys(d.value).forEach(de=>{Z.mergeNumberFormat(de,d.value[de])}),Z.escapeParameter=b,Z.fallbackFormat=g,Z.fallbackRoot=p,Z.fallbackWarn=f,Z.missingWarn=h,Z.warnHtmlMessage=S}return eh(()=>{if(e.proxy==null||e.proxy.$i18n==null)throw Es(cn.NOT_AVAILABLE_COMPOSITION_IN_LEGACY);const Z=i.value=e.proxy.$i18n.__composer;t==="global"?(a.value=Z.locale.value,l.value=Z.fallbackLocale.value,u.value=Z.messages.value,c.value=Z.datetimeFormats.value,d.value=Z.numberFormats.value):o&&G(Z)}),Ie}const wCe=["locale","fallbackLocale","availableLocales"],DB=["t","rt","d","n","tm","te"];function CCe(e,t){const n=Object.create(null);return wCe.forEach(o=>{const i=Object.getOwnPropertyDescriptor(t,o);if(!i)throw Es(cn.UNEXPECTED_ERROR);const r=gn(i.value)?{get(){return i.value.value},set(a){i.value.value=a}}:{get(){return i.get&&i.get()}};Object.defineProperty(n,o,r)}),e.config.globalProperties.$i18n=n,DB.forEach(o=>{const i=Object.getOwnPropertyDescriptor(t,o);if(!i||!i.value)throw Es(cn.UNEXPECTED_ERROR);Object.defineProperty(e.config.globalProperties,`$${o}`,i)}),()=>{delete e.config.globalProperties.$i18n,DB.forEach(o=>{delete e.config.globalProperties[`$${o}`]})}}if(Vwe(),__INTLIFY_JIT_COMPILATION__?P2(Ewe):P2(Swe),fwe(Kye),pwe(T2),K.env.NODE_ENV!=="production"||__INTLIFY_PROD_DEVTOOLS__){const e=pa();e.__INTLIFY__=!0,nwe(e.__INTLIFY_DEVTOOLS_GLOBAL_HOOK__)}K.env.NODE_ENV;async function bCe(){return cCe({legacy:!1,locale:"en",fallbackLocale:"en",messages:{en:{errorMessages:Wge}}})}const SCe=async()=>{const e=await bCe();return $ge(e.global),e},ECe={style:{color:"#ff5200"}},TB=_t(rt({__name:"ImportVisual",props:{state:{},errorMessage:{},overwrite:{type:Boolean}},setup(e){return(t,n)=>(j(),ce("div",{class:Q(t.$style["inform-layout"])},[e.state==="importing"?(j(),ce("div",{key:0,class:Q(t.$style["import-error"]),style:{width:"500px"}},[ge(U(Pm),{src:"UploadInProgress","max-height":180,"max-width":180})],2)):e.state==="error"?(j(),ce("div",{key:1,class:Q(t.$style["import-error"]),style:{width:"500px"}},[ge(U(Pm),{src:"Unsuccessful1","max-height":180,"max-width":180}),Ee("span",{class:Q(t.$style["step-title"])}," File doesn’t meet requirements. Check file and try again. ",2),Ee("div",ECe,[Ee("span",{class:Q(t.$style["step-description"])},"Error code",2),Ee("span",{class:Q(t.$style["step-description"])},wt(e.errorMessage),3)])],2)):e.state==="success"?(j(),ce(xt,{key:2},[ge(U(Pm),{src:"Successful1","max-height":180,"max-width":180}),Ee("span",{class:Q(t.$style["step-title"]),style:{"white-space":"pre-wrap","align-items":"center","text-align":"center"}},wt(e.overwrite?`Existing data will be overwritten in the background.
|
|
251
251
|
Refresh to see updates.`:`Work will be created in background.
|
|
252
252
|
Refresh to see updates.`),3)],64)):Je("",!0)],2))}}),[["__cssModules",{$style:{"inform-layout":"_inform-layout_16bpq_1","import-error":"_import-error_16bpq_11","step-title":"_step-title_16bpq_22","step-description":"_step-description_16bpq_27"}}]]),IB=_t(rt({__name:"DateRule",setup(e){const n=(()=>{const o=(h,f,p,g)=>{const v=document.createElement("span");return v.textContent=h,v.style.fontWeight=f,v.style.fontSize=p,v.style.color=g,v},i=document.createElement("div");i.style.display="flex",i.style.flexDirection="column";const r=document.createElement("div"),a=document.createElement("div"),l=o("Valid formats:","normal","14px","#02C39A"),u=o("Invalid formats:","normal","14px","#FF5200"),c=o(" 2025.12.31, 2025-12-31, 2025/12/31 ","normal","14px",""),d=o(" 12.31.2025, 2025.31.12","normal","14px","");return r.appendChild(l),r.appendChild(c),a.appendChild(u),a.appendChild(d),i.appendChild(r),i.appendChild(a),i.outerHTML})(),s=Xt;return(o,i)=>(j(),ce("div",{class:Q(o.$style["date-format-guide"])},[Ee("span",{class:Q(o.$style["step-title-2"])},[i[0]||(i[0]=tt(" Date format guide ",-1)),Ke(ge(U(lt),{src:"InfoCircle",color:"#A6A6A6"},null,512),[[U(s),{content:U(n)}]])],2),Ee("div",{class:Q(o.$style["date-rule-section"])},[i[3]||(i[3]=Ee("span",null,"Enter dates in one of these formats:",-1)),Ee("ul",{class:Q(o.$style["step-description"])},[Ee("li",{class:Q(o.$style["date-rule"])},[...i[1]||(i[1]=[Ee("b",null,"DD MM YYYY",-1),tt(" (Day-Month-Year) ",-1)])],2),Ee("li",{class:Q(o.$style["date-rule"])},[...i[2]||(i[2]=[Ee("b",null,"YYYY MM DD",-1),tt(" (Year-Month-Day) ",-1)])],2)],2)],2)],2))}}),[["__cssModules",{$style:{"date-format-guide":"_date-format-guide_1clky_1","step-title-2":"_step-title-2_1clky_13","date-rule-section":"_date-rule-section_1clky_25","step-description":"_step-description_1clky_29","date-rule":"_date-rule_1clky_25"}}]]),_Ce={key:1},RCe=_t(rt({__name:"PopupCreateScenes",props:{workspaceId:{},entityId:{}},emits:["import-success"],setup(e,{expose:t,emit:n}){const s=B(null),o=e,i=()=>{s.value&&s.value.show()},r=B(""),a=B("idle"),l=Y(()=>({error:"Import failed",importing:"Import in progress",success:"Import successful",idle:"Create new work"})[a.value]),u=B(null),c=B({file:null,format:null}),{apiServices:d}=ts(!1,o),h=async P=>{var F,k;if(((F=d==null?void 0:d.value)==null?void 0:F.getTemplateFlowStatuses)===void 0){console.error("API services not available",(k=d==null?void 0:d.value)==null?void 0:k.getTemplateFlowStatuses);return}return await d.value.getTemplateFlowStatuses({workspaceId:o.workspaceId,entityId:o.entityId,...P})},f=B(!1),p=async()=>{f.value=!0;const P=o.workspaceId,D=o.entityId;if(!P||!D||!d.value){console.error("Workspace ID or Entity ID is missing");return}try{if(!await d.value.downloadTemplate(P,D))throw new Error("No response from downloadTemplate API")}catch(F){console.error("Error downloading template:",F)}f.value=!1},g=async P=>{var k,O,$;const D=new FormData,F=((k=P.name.split(".").pop())==null?void 0:k.toString())||"";if(D.append("file",P),D.append("format",F),D.append("entity_id",o.entityId||""),D.append("template_flow_status_id",_.value||""),!d.value||!o.workspaceId||!o.entityId){console.error("API services not available");return}try{await d.value.addNewSceneViaImportFile(o.workspaceId,o.entityId,D),v()}catch(q){throw console.error("Error uploading file:",q),C((($=(O=q.response)==null?void 0:O.data)==null?void 0:$.message)||"An unknown error occurred during file upload."),q}},v=()=>{a.value="success"},C=P=>{r.value=P,a.value="error"},S=n,b=()=>{S("import-success"),x()},w=async()=>{if(!c.value||!c.value.file){console.error("No file to upload");return}a.value="importing",await g(c.value.file)};t({open:i});const _=B(null),R=Y(()=>!c.value.file||!c.value.format||!c.value.isValid||!_.value),T=B(null),I=()=>{var P,D;(P=u.value)==null||P.clear(),r.value="",c.value={file:null,format:null},_.value=null,(D=T==null?void 0:T.value)==null||D.clear(),a.value="idle"},x=()=>{var P;I(),(P=s.value)==null||P.hide()};return(P,D)=>(j(),qe(U(dV),{"popup-name":l.value,"show-overlay":!0,"overlay-opacity":.5,"close-on-overlay-click":!0,"close-on-escape":!0,ref_key:"popupRef",ref:s,onHidden:I},nh({default:me(()=>[a.value==="importing"||a.value==="error"||a.value==="success"?(j(),qe(TB,{key:0,state:a.value,"error-message":r.value},null,8,["state","error-message"])):(j(),ce("div",_Ce,[Ee("div",{class:Q(P.$style["step-section"])},[Ee("span",{class:Q(P.$style["step-title"])},"Step 1: Download sample file",2),Ee("span",{class:Q(P.$style["step-description"])}," Get a sample file with all columns ready for editing. ",2),ge(U(mt),{class:Q(P.$style["download-sample-btn"]),size:12,variant:"secondary",disabled:f.value,onHandleClick:p},{prefix:me(()=>[ge(U(lt),{src:"Download"})]),default:me(()=>[D[2]||(D[2]=tt(" Download sample file ",-1))]),_:1},8,["class","disabled"])],2),Ee("div",{class:Q(P.$style["step-section"])},[Ee("span",{class:Q(P.$style["step-title"])},"Step 2: Upload your file (.xlsx, .xls, .csv)",2),ge(U(ZV),{modelValue:c.value,"onUpdate:modelValue":D[0]||(D[0]=F=>c.value=F),ref_key:"filUploaderRef",ref:u},null,8,["modelValue"])],2),Ee("div",{class:Q(P.$style["step-section"])},[Ee("span",{class:Q(P.$style["step-title"])},"Step 3: Select status",2),Ee("span",{class:Q(P.$style["step-description"])},"Choose a status for the new work.",2),ge(U(nve),{ref_key:"statusRef",ref:T,modelValue:_.value,"onUpdate:modelValue":D[1]||(D[1]=F=>_.value=F),"get-status-func":h,"workspace-id":o.workspaceId,id:o.entityId},null,8,["modelValue","workspace-id","id"])],2),Ee("div",{class:Q(P.$style["step-section"]),style:{"padding-top":"0","padding-bottom":"0"}},[ge(IB)],2)]))]),_:2},[a.value==="idle"?{name:"footer",fn:me(()=>[ge(U(mt),{style:{flex:"1"},variant:"secondary",onClick:x},{default:me(()=>[...D[3]||(D[3]=[tt(" Cancel ",-1)])]),_:1}),ge(U(mt),{disabled:R.value,style:{flex:"1"},variant:"primary",onClick:w},{default:me(()=>[...D[4]||(D[4]=[tt(" Import ",-1)])]),_:1},8,["disabled"])]),key:"0"}:a.value==="success"?{name:"footer",fn:me(()=>[ge(U(mt),{style:{flex:"1"},variant:"primary",onClick:b},{default:me(()=>[...D[5]||(D[5]=[tt(" Close ",-1)])]),_:1})]),key:"1"}:a.value=="error"?{name:"footer",fn:me(()=>[ge(U(mt),{style:{flex:"1"},variant:"primary",onClick:I},{default:me(()=>[...D[6]||(D[6]=[tt(" Try Again ",-1)])]),_:1})]),key:"2"}:void 0]),1032,["popup-name"]))}}),[["__cssModules",{$style:{"step-section":"_step-section_1ml4p_1","step-title":"_step-title_1ml4p_11","step-title-2":"_step-title-2_1ml4p_17","step-description":"_step-description_1ml4p_23","date-format-guide":"_date-format-guide_1ml4p_28","import-error":"_import-error_1ml4p_39","drop-area":"_drop-area_1ml4p_49","is-dragging":"_is-dragging_1ml4p_49","drop-area-content":"_drop-area-content_1ml4p_52",browse:"_browse_1ml4p_61","download-sample-btn":"_download-sample-btn_1ml4p_65"}}]]),xB={text:il,id:void 0,assignees:dge,status:bge,dateRange:hge,isStarted:il,isCompleted:il,lastUpdated:il,completedOn:il,isDeleted:il,isArchived:il,isProcessing:il,name:aV,options:vY,metric:uV,__checkboxSelection:void 0},DCe={text:!1,id:!1,assignees:!0,status:!0,dateRange:!0,isStarted:!1,isCompleted:!1,lastUpdated:!1,completedOn:!1,isDeleted:!1,isArchived:!1,isProcessing:!1,name:!1,options:!0,metric:!1,__checkboxSelection:!1},TCe={text:null,id:void 0,assignees:UA,status:Bk,dateRange:fge,isStarted:void 0,isCompleted:void 0,lastUpdated:void 0,completedOn:void 0,isDeleted:void 0,isArchived:void 0,isProcessing:void 0,name:aV,options:rV,metric:void 0,__checkboxSelection:void 0},ICe={id:[100,100],assignees:[200,200],status:[200,200],dateRange:[255,255],isStarted:[150,150],isCompleted:[150,150],lastUpdated:[180,180],completedOn:[180,180],isDeleted:[void 0,void 0],isArchived:[void 0,void 0],isProcessing:[void 0,void 0],name:[350,500],options:[50,50],metric:[200,300],__checkboxSelection:[50,50],text:[200,300]},xCe={dateRange:{cellEditorPopupPosition:"under",cellEditorPopup:!1},name:{cellEditorPopupPosition:"over",cellEditor:!1,cellEditorPopup:!1},metric:{suppressKeyboardEvent:void 0,suppressNavigable:!1,suppressMovable:!1,cellClass:"ag-cell-optimized",editable:!0}},FCe=e=>{var t,n,s;if(e){if(Number((t=e.metric_type)==null?void 0:t.id)==1)return["none","not","range"].includes(e.restricted_type)?"number":"dropdown";if(Number((n=e.metric_type)==null?void 0:n.id)==2)return e.format_type=="icon"?"rating":"dropdown";if(Number((s=e.metric_type)==null?void 0:s.id)==3)return}},Fd=e=>{if(e)return FCe(e)};function FB(e,t){var o,i,r,a;const n=(o=t==null?void 0:t.data)==null?void 0:o.permissions;let s={disabled:!1,readOnly:!1,type:void 0};if(!t||!e)s={disabled:!1,readOnly:!0,type:void 0};else if(e==="options")s={disabled:!1,readOnly:!1,type:void 0};else if(e!=null&&e.includes("metric")){const l=`metric_permission_${e==null?void 0:e.replace("metric_","")}`;s={disabled:!1,readOnly:!((t==null?void 0:t.data)&&t.data[l]&&((i=t.data[l])==null?void 0:i.permission)==2&&!((r=t.colDef)!=null&&r.context.formula)&&!t.data.isLocked&&!t.data.isDeleted),type:Fd((a=t.colDef)==null?void 0:a.context)}}else{const u={assignees:(n==null?void 0:n.has_update_assignee_permission)??0,completedOn:0,name:(n==null?void 0:n.has_edit_permission)??0,permissions:0,status:(n==null?void 0:n.has_edit_template_flow_status_permission)??0,dateRange:(n==null?void 0:n.has_edit_date_permission)??0,isStarted:0,isDeleted:0,isArchived:0,isLocked:0,isProcessing:0,lastUpdated:0,id:0,isCompleted:0,options:1,disabled:0}[e]??0;s={disabled:u===-1,readOnly:u!==1,type:void 0}}return s}class S_{constructor(){es(this,"eGui");es(this,"params")}init(t){this.params=t}getGui(){var n,s,o,i,r;const t=document.createElement("div");return(n=this.params)!=null&&n.height&&t.style.setProperty("--height",(s=this.params)==null?void 0:s.height),(o=this.params)!=null&&o.width?t.style.setProperty("--width",(i=this.params)==null?void 0:i.width):(r=this.params)!=null&&r.fullwidth?t.style.setProperty("--width","100%"):t.style.setProperty("--width",`${Math.floor(Math.random()*50)+50}%`),t.className="ag-cell-skeleton",t.addEventListener("click",a=>{a.preventDefault(),a.stopPropagation(),a.stopImmediatePropagation()}),this.eGui=t,t}refresh(t){return!1}getValue(){var t;return(t=this.params)==null?void 0:t.value}isPopup(t){return!1}getPopupPosition(){}destroy(){}}const PB=new Map;class vp{static initialize(t){this.wrappers=t}static getWrappers(){if(!this.wrappers)throw new Error("CellRendererFactory: Not initialized. Please call CellRendererFactory.initialize() first.");return this.wrappers}static buildCommonCellParams(t,n){var u,c,d;const s=t.data||((u=t.node)==null?void 0:u.data),o=(c=t.colDef)==null?void 0:c.field,i=o&&s?s[o]:void 0,r=FB((d=t.colDef)==null?void 0:d.field,t),a=typeof n=="function"?n(t):n??{};return{...t,value:i,disabled:r==null?void 0:r.disabled,readOnly:r==null?void 0:r.readOnly,type:Fd(t.context),...a}}static resolveRendererComponent(t,n){let s;return t.includes("metric")&&xB.metric?Fd(n)==="rating"?s=Uve:s=uV:s=xB[t]??void 0,s}static resolveEditorComponent(t,n){const s=t.includes("metric");let o;const i=Fd(n);return s&&["number","dropdown"].includes(i)?o=ove:o=TCe[t],o}static canEditField(t,n){var i;if(n.data===void 0)return!1;const s=FB((i=n.colDef)==null?void 0:i.field,n),o=DCe[t]??!0;return!(s!=null&&s.disabled)&&!(s!=null&&s.readOnly)&&o&&(s==null?void 0:s.type)!=="rating"}static resolveSize(t){const[n=250,s=300]=ICe[t]??[];return{minWidth:n,maxWidth:s}}static buildHeaderComponentParams(t){return n=>typeof t=="function"?t(n):t??{}}static fromType(t){const{wrapVueCellEditor:n}=this.getWrappers(),s=String(t.field??""),o=this.resolveSize(s),i=xCe[s]??{},r=Fd(t.context),a=r==="number"||r==="rating",l=r=="rating"?t.context.range*24+20:o.minWidth;return{...t,headerName:t.headerName,...o,...t,cellEditorSelector:c=>{const d=this.resolveEditorComponent(s,t.context);return{component:n(d),params:this.buildCommonCellParams(c,t.cellRendererParams),popup:!a}},singleClickEdit:!0,cellEditorPopup:!a,cellEditorPopupPosition:a?void 0:"under",editable:c=>{let d;return c.data===void 0||c.data.isDeleted||c.node.data===void 0?d=!1:d=this.canEditField(s,c),d},minWidth:l,cellRendererSelector:c=>PCe(c,{component:n(this.resolveRendererComponent(s,t.context)),params:this.buildCommonCellParams(c,t.cellRendererParams)}),headerComponentParams:this.buildHeaderComponentParams(t.headerComponentParams),...i,cellClass:c=>`${r}--${c.colDef.field}`}}}es(vp,"wrappers",null);const PCe=(e,t)=>{var o;const n=(o=e.colDef)==null?void 0:o.field,s=`${n}-${e.node.rowIndex}`;return PB.set(s,(PB.get(s)??0)+1),n!=null&&n.includes("metric")?e.value===void 0?{component:S_,params:{fullwidth:!1}}:t:e.data&&e.value!==void 0?t:!n||n==="options"||n==="__checkboxSelection"?e.data?t:{component:S_,params:{fullwidth:!0,width:"24px",height:"24px"}}:!e.data||e.value===void 0?{component:S_,params:{fullwidth:!1}}:t},ACe=_t(rt({__name:"Vue3Wrapper",props:{component:{},params:{},disabled:{type:Boolean,default:!1},readOnly:{type:Boolean,default:!0},value:{},data:{},id:{},tooltip:{},isNoData:{type:Boolean,default:!1},workspaceId:{},entityId:{},axiosService:{},isSearching:{type:Boolean,default:!1},isFiltering:{type:Boolean,default:!1},sortType:{default:"default"},maxRating:{default:5},config:{}},setup(e,{expose:t}){const n=e,s=B(null),o=Y(()=>{var a;return((a=n.component)==null?void 0:a.name)||"UnknownComponent"}),i=Y(()=>{var a;return((a=n.component)==null?void 0:a.default)||n.component}),r=Y(()=>({params:n.params,disabled:n.disabled,readOnly:n.readOnly,value:n.value,maxRating:n.maxRating,data:n.data,id:n.id,workspaceId:n.workspaceId,entityId:n.entityId,axiosService:n.axiosService,tooltip:n.tooltip,isSearching:n.isSearching,isFiltering:n.isFiltering,isNoData:n.isNoData,config:n.config}));return t({focus:()=>{var a;return(a=s.value)!=null&&a.focus?s.value.focus():console.warn(`Component ${o.value} does not have a focus method.`),!0},blur:()=>{var a,l;return(l=(a=s.value)==null?void 0:a.blur)==null||l.call(a),!0},trigger:(a,l)=>{var u;return(u=s.value)==null||u.$emit(a,l),!0}}),(a,l)=>(j(),qe(bw(i.value),nn(r.value,{ref_key:"componentRef",ref:s}),null,16))}}),[["__cssModules",{$style:{skeleton:"_skeleton_7xde7_1",shimmer:"_shimmer_7xde7_16","skeleton-loading":"_skeleton-loading_7xde7_1"}}]]);function kCe(e){return"stopEditing"in e}const OCe=8,MCe=e=>{if(!e)return;const t=e.__vueParentComponent,n=t==null?void 0:t.exposed;n&&typeof n.triggerFocus=="function"?n.triggerFocus():e.focus()};function AB(e){return class{constructor(){es(this,"container");es(this,"vNode",null);es(this,"componentInstance",null);es(this,"componsenExposed",null);es(this,"params");es(this,"isEditor",!1);es(this,"_destroyed",!1)}init(n){var l,u,c,d;if(!n){console.error("[Vue3CellWrapper] Missing params");return}const s=performance.now();this.params=n,this.isEditor=kCe(n),this.container=document.createElement("div"),this.container.classList.add("ag-vue3-cell-wrapper"),this.container.style.width="100%",this.container.style.height="100%";const o=n.context.apiClass,i=n,r={component:e,params:Object.freeze(n),disabled:!1,readOnly:i.readOnly??!1,value:n.value,maxRating:i.maxRating??void 0,data:n.data,id:(l=n==null?void 0:n.data)==null?void 0:l.id,workspaceId:n.context.workspaceId,entityId:n.context.entityId,axiosService:o,tooltip:i.tooltip??void 0,isSearching:i.isSearching??!1,isFiltering:i.isFiltering??!1,isNoData:i.isNoData??!1,config:i.config,sceneId:(i==null?void 0:i.sceneId)||void 0};this.vNode=ge(ACe,r),Yw(this.vNode,this.container);const a=performance.now()-s;a>OCe&&console.warn(`[Vue3CellWrapper] Slow render (${a.toFixed(1)}ms) for "${(u=n.colDef)==null?void 0:u.field}"`),this.componentInstance=(c=this.vNode.component)==null?void 0:c.proxy,this.componsenExposed=(d=this.vNode.component)==null?void 0:d.exposed}getGui(){return this.container}refresh(n){return!1}focusUi(){var n;(n=this.componsenExposed)!=null&&n.focus?this.componsenExposed.focus():MCe(this.container)}getValue(){var n,s,o;return this.params._editorValue!==void 0?this.params._editorValue:this.componentInstance?((o=(s=this.componentInstance).getValue)==null?void 0:o.call(s))??this.componentInstance.value:(console.warn("[Vue3CellWrapper] getValue() called but component instance not available"),(n=this.params)==null?void 0:n.value)}isPopup(n){var r,a,l,u,c;const s=(l=(a=(r=this.params)==null?void 0:r.colDef)==null?void 0:a.field)==null?void 0:l.includes("metric"),o=((u=this.params)==null?void 0:u.context)&&Fd(this.params.context);return s||(o==="number"||o==="rating")||!this.isEditor?!1:(c=this.componentInstance)!=null&&c.isPopup?this.componentInstance.isPopup():!0}getPopupPosition(){var s,o,i;return this.isEditor?(s=this.componentInstance)!=null&&s.getPopupPosition?this.componentInstance.getPopupPosition():((i=(o=this.params)==null?void 0:o.colDef)==null?void 0:i.cellEditorPopupPosition)??"under":void 0}afterGuiAttached(){!this.isEditor||this.componentInstance}destroy(){if(!this._destroyed&&(this._destroyed=!0,!!this.container))try{const n=this.componentInstance;if(n){try{typeof n.$destroy=="function"&&n.$destroy()}catch(o){console.warn("[Vue3CellWrapper] Error during $destroy:",o)}try{typeof n.destroy=="function"&&n.destroy()}catch(o){console.warn("[Vue3CellWrapper] Error during destroy():",o)}}(typeof queueMicrotask=="function"?queueMicrotask:o=>Promise.resolve().then(o))(()=>{try{Yw(null,this.container)}catch(o){console.warn("[Vue3CellWrapper] Error during unmount:",o)}finally{this.container.textContent=""}})}catch(n){console.error("[Vue3CellWrapper] Error during cleanup:",n)}finally{this.vNode=null,this.componentInstance=null}}}}function Iy(e){return AB(e)}function kB(e){return AB(e)}let OB=!1;OB||(jJ.registerModules([ege,eV]),OB=!0);class NCe{constructor(t,n){es(this,"gridApi",null);es(this,"container");es(this,"config");es(this,"eventListeners",new Map);this.container=t,this.config=n}init(){if(this.gridApi)throw new Error("Grid already initialized");const{onGridReady:t,onCellClicked:n,onCellFocused:s,onRowSelected:o,...i}=this.config,r={...i,onGridReady:a=>{this.gridApi=a.api,t&&t(a)},onCellClicked:a=>{n&&n(a)},onCellFocused:a=>{s&&s(a)},onRowSelected:a=>{o&&o(a)}};return this.gridApi=Sue(this.container,r),this.gridApi}updateRowData(t){this.gridApi&&this.gridApi.setGridOption("rowData",t)}updateColumnDefs(t){this.gridApi&&this.gridApi.setGridOption("columnDefs",t)}setColumnWidth(t){var n;this.gridApi&&((n=this.gridApi)==null||n.applyColumnState({state:t,applyOrder:!1}))}updateDatasource(t){this.gridApi&&this.gridApi.setGridOption("datasource",t)}refreshInfiniteCache(){this.gridApi&&this.gridApi.refreshInfiniteCache()}sizeColumnsToFit(){this.gridApi}deselectAll(){this.gridApi&&this.gridApi.deselectAll()}getSelectedRows(){var t;return((t=this.gridApi)==null?void 0:t.getSelectedRows())||[]}setQuickFilterText(t){this.gridApi&&this.gridApi.setGridOption("quickFilterText",t)}getColumnState(){var t;return(t=this.gridApi)==null?void 0:t.getColumnState()}addEventListener(t,n){if(!this.gridApi)throw new Error("Grid not initialized");this.eventListeners.has(t)||this.eventListeners.set(t,new Set),this.eventListeners.get(t).add(n),this.gridApi.addEventListener(t,n)}addRow(t,n="bottom"){if(this.gridApi){const s={add:[t],addIndex:n==="bottom"?void 0:0};if(this.gridApi.applyTransaction(s),n==="bottom"){const o=this.gridApi.getDisplayedRowCount();o>0&&this.gridApi.ensureIndexVisible(o-1,"bottom")}}}addRows(t,n="bottom"){if(this.gridApi&&t.length>0){const s={add:t,addIndex:n==="bottom"?void 0:0};if(this.gridApi.applyTransaction(s),n==="bottom"){const o=this.gridApi.getDisplayedRowCount();o>0&&this.gridApi.ensureIndexVisible(o-1,"bottom")}}}destroy(){this.gridApi&&(this.eventListeners.forEach((t,n)=>{t.forEach(s=>{var o;(o=this.gridApi)==null||o.removeEventListener(n,s)})}),this.eventListeners.clear(),this.gridApi.destroy(),this.gridApi=null)}getApi(){return this.gridApi}switchTheme(t){document.body.dataset.agThemeMode=t==="dark"?"dark":"light"}}const LCe=$N.withParams({accentColor:"var(--primary-color)",backgroundColor:"#ffffff",borderColor:"#e5e7eb",borderRadius:4,browserColorScheme:"light",chromeBackgroundColor:"#f9fafb",columnBorder:!0,fontFamily:"inherit",fontSize:14,foregroundColor:"#111827",headerBackgroundColor:"#fff",headerFontSize:14,headerFontWeight:600,headerTextColor:"#374151",iconSize:16,rowBorder:!0,spacing:8,headerHeight:40,rowHeight:32,wrapperBorder:!0,wrapperBorderRadius:4},"light").withParams({accentColor:"var(--primary-color)",backgroundColor:"#1f2937",borderColor:"#374151",borderRadius:4,browserColorScheme:"dark",chromeBackgroundColor:"#111827",columnBorder:!0,fontFamily:"inherit",fontSize:14,foregroundColor:"#f9fafb",headerBackgroundColor:"#374151",headerFontSize:14,headerFontWeight:600,headerTextColor:"#f9fafb",iconSize:16,rowBorder:!0,spacing:8,headerHeight:40,rowHeight:32,wrapperBorder:!0,wrapperBorderRadius:4},"dark"),VCe=rt({__name:"AgTable",props:{statusBar:{},sideBar:{type:[Object,String,Array,Boolean,null]},suppressContextMenu:{type:Boolean},preventDefaultOnContextMenu:{type:Boolean},allowContextMenuWithControlKey:{type:Boolean},columnMenu:{},suppressMenuHide:{type:Boolean},enableBrowserTooltips:{type:Boolean},tooltipTrigger:{},tooltipShowDelay:{},tooltipHideDelay:{},tooltipMouseTrack:{type:Boolean},tooltipShowMode:{},tooltipInteraction:{type:Boolean},popupParent:{},copyHeadersToClipboard:{type:Boolean},copyGroupHeadersToClipboard:{type:Boolean},clipboardDelimiter:{},suppressCopyRowsToClipboard:{type:Boolean},suppressCopySingleCellRanges:{type:Boolean},suppressLastEmptyLineOnPaste:{type:Boolean},suppressClipboardPaste:{type:Boolean},suppressClipboardApi:{type:Boolean},suppressCutToClipboard:{type:Boolean},columnDefs:{},defaultColDef:{},defaultColGroupDef:{},columnTypes:{},dataTypeDefinitions:{},maintainColumnOrder:{type:Boolean},enableStrictPivotColumnOrder:{type:Boolean},suppressFieldDotNotation:{type:Boolean},headerHeight:{},groupHeaderHeight:{},floatingFiltersHeight:{},pivotHeaderHeight:{},pivotGroupHeaderHeight:{},hidePaddedHeaderRows:{type:Boolean},allowDragFromColumnsToolPanel:{type:Boolean},suppressMovableColumns:{type:Boolean},suppressColumnMoveAnimation:{type:Boolean},suppressMoveWhenColumnDragging:{type:Boolean},suppressDragLeaveHidesColumns:{type:Boolean},suppressGroupChangesColumnVisibility:{type:[Boolean,String]},suppressMakeColumnVisibleAfterUnGroup:{type:Boolean},suppressRowGroupHidesColumns:{type:Boolean},colResizeDefault:{},suppressAutoSize:{type:Boolean},autoSizePadding:{},skipHeaderOnAutoSize:{type:Boolean},autoSizeStrategy:{},components:{},editType:{},suppressStartEditOnTab:{type:Boolean},getFullRowEditValidationErrors:{type:Function},invalidEditValueMode:{},singleClickEdit:{type:Boolean},suppressClickEdit:{type:Boolean},readOnlyEdit:{type:Boolean},stopEditingWhenCellsLoseFocus:{type:Boolean},enterNavigatesVertically:{type:Boolean},enterNavigatesVerticallyAfterEdit:{type:Boolean},enableCellEditingOnBackspace:{type:Boolean},undoRedoCellEditing:{type:Boolean},undoRedoCellEditingLimit:{},defaultCsvExportParams:{},suppressCsvExport:{type:Boolean},defaultExcelExportParams:{},suppressExcelExport:{type:Boolean},excelStyles:{},findSearchValue:{},findOptions:{},quickFilterText:{},cacheQuickFilter:{type:Boolean},includeHiddenColumnsInQuickFilter:{type:Boolean},quickFilterParser:{type:Function},quickFilterMatcher:{type:Function},applyQuickFilterBeforePivotOrAgg:{type:Boolean},excludeChildrenWhenTreeDataFiltering:{type:Boolean},enableAdvancedFilter:{type:Boolean},alwaysPassFilter:{type:Function},includeHiddenColumnsInAdvancedFilter:{type:Boolean},advancedFilterParent:{},advancedFilterBuilderParams:{},advancedFilterParams:{},suppressAdvancedFilterEval:{type:Boolean},suppressSetFilterByDefault:{type:Boolean},enableFilterHandlers:{type:Boolean},filterHandlers:{},enableCharts:{type:Boolean},chartThemes:{},customChartThemes:{},chartThemeOverrides:{},chartToolPanelsDef:{},chartMenuItems:{type:[Array,Function]},loadingCellRenderer:{},loadingCellRendererParams:{},loadingCellRendererSelector:{type:Function},localeText:{},masterDetail:{type:Boolean},keepDetailRows:{type:Boolean},keepDetailRowsCount:{},detailCellRenderer:{},detailCellRendererParams:{},detailRowHeight:{},detailRowAutoHeight:{type:Boolean},context:{},alignedGrids:{type:[Array,Function]},tabIndex:{},rowBuffer:{},valueCache:{type:Boolean},valueCacheNeverExpires:{type:Boolean},enableCellExpressions:{type:Boolean},suppressTouch:{type:Boolean},suppressFocusAfterRefresh:{type:Boolean},suppressBrowserResizeObserver:{type:Boolean},suppressPropertyNamesCheck:{type:Boolean},suppressChangeDetection:{type:Boolean},debug:{type:Boolean},loading:{type:Boolean},overlayLoadingTemplate:{},loadingOverlayComponent:{},loadingOverlayComponentParams:{},suppressLoadingOverlay:{type:Boolean},overlayNoRowsTemplate:{},noRowsOverlayComponent:{},noRowsOverlayComponentParams:{},suppressNoRowsOverlay:{type:Boolean},pagination:{type:Boolean},paginationPageSize:{},paginationPageSizeSelector:{type:[Array,Boolean]},paginationAutoPageSize:{type:Boolean},paginateChildRows:{type:Boolean},suppressPaginationPanel:{type:Boolean},pivotMode:{type:Boolean},pivotPanelShow:{},pivotMaxGeneratedColumns:{},pivotDefaultExpanded:{},pivotColumnGroupTotals:{},pivotRowTotals:{},pivotSuppressAutoColumn:{type:Boolean},suppressExpandablePivotGroups:{type:Boolean},functionsReadOnly:{type:Boolean},aggFuncs:{},suppressAggFuncInHeader:{type:Boolean},alwaysAggregateAtRootLevel:{type:Boolean},aggregateOnlyChangedColumns:{type:Boolean},suppressAggFilteredOnly:{type:Boolean},removePivotHeaderRowWhenSingleValueColumn:{type:Boolean},animateRows:{type:Boolean},cellFlashDuration:{},cellFadeDuration:{},allowShowChangeAfterFilter:{type:Boolean},domLayout:{},ensureDomOrder:{type:Boolean},enableCellSpan:{type:Boolean},enableRtl:{type:Boolean},suppressColumnVirtualisation:{type:Boolean},suppressMaxRenderedRowRestriction:{type:Boolean},suppressRowVirtualisation:{type:Boolean},rowDragManaged:{type:Boolean},rowDragInsertDelay:{},suppressRowDrag:{type:Boolean},suppressMoveWhenRowDragging:{type:Boolean},rowDragEntireRow:{type:Boolean},rowDragMultiRow:{type:Boolean},rowDragText:{type:Function},dragAndDropImageComponent:{},dragAndDropImageComponentParams:{},fullWidthCellRenderer:{},fullWidthCellRendererParams:{},embedFullWidthRows:{type:Boolean},groupDisplayType:{},groupDefaultExpanded:{},autoGroupColumnDef:{},groupMaintainOrder:{type:Boolean},groupSelectsChildren:{type:Boolean},groupLockGroupColumns:{},groupAggFiltering:{type:[Boolean,Function]},groupTotalRow:{type:[String,Function]},grandTotalRow:{},suppressStickyTotalRow:{type:[Boolean,String]},groupSuppressBlankHeader:{type:Boolean},groupSelectsFiltered:{type:Boolean},showOpenedGroup:{type:Boolean},groupHideParentOfSingleChild:{type:[Boolean,String]},groupRemoveSingleChildren:{type:Boolean},groupRemoveLowestSingleChildren:{type:Boolean},groupHideOpenParents:{type:Boolean},groupAllowUnbalanced:{type:Boolean},rowGroupPanelShow:{},groupRowRenderer:{},groupRowRendererParams:{},treeData:{type:Boolean},treeDataChildrenField:{},treeDataParentIdField:{},rowGroupPanelSuppressSort:{type:Boolean},suppressGroupRowsSticky:{type:Boolean},groupHierarchyConfig:{},pinnedTopRowData:{},pinnedBottomRowData:{},enableRowPinning:{type:[Boolean,String]},isRowPinnable:{type:Function},isRowPinned:{type:Function},rowModelType:{},rowData:{},asyncTransactionWaitMillis:{},suppressModelUpdateAfterUpdateTransaction:{type:Boolean},datasource:{},cacheOverflowSize:{},infiniteInitialRowCount:{},serverSideInitialRowCount:{},suppressServerSideFullWidthLoadingRow:{type:Boolean},cacheBlockSize:{},maxBlocksInCache:{},maxConcurrentDatasourceRequests:{},blockLoadDebounceMillis:{},purgeClosedRowNodes:{type:Boolean},serverSideDatasource:{},serverSideSortAllLevels:{type:Boolean},serverSideEnableClientSideSort:{type:Boolean},serverSideOnlyRefreshFilteredGroups:{type:Boolean},serverSidePivotResultFieldSeparator:{},viewportDatasource:{},viewportRowModelPageSize:{},viewportRowModelBufferSize:{},alwaysShowHorizontalScroll:{type:Boolean},alwaysShowVerticalScroll:{type:Boolean},debounceVerticalScrollbar:{type:Boolean},suppressHorizontalScroll:{type:Boolean},suppressScrollOnNewData:{type:Boolean},suppressScrollWhenPopupsAreOpen:{type:Boolean},suppressAnimationFrame:{type:Boolean},suppressMiddleClickScrolls:{type:Boolean},suppressPreventDefaultOnMouseWheel:{type:Boolean},scrollbarWidth:{},rowSelection:{},cellSelection:{type:[Boolean,Object]},rowMultiSelectWithClick:{type:Boolean},suppressRowDeselection:{type:Boolean},suppressRowClickSelection:{type:Boolean},suppressCellFocus:{type:Boolean},suppressHeaderFocus:{type:Boolean},selectionColumnDef:{},rowNumbers:{type:[Boolean,Object]},suppressMultiRangeSelection:{type:Boolean},enableCellTextSelection:{type:Boolean},enableRangeSelection:{type:Boolean},enableRangeHandle:{type:Boolean},enableFillHandle:{type:Boolean},fillHandleDirection:{},suppressClearOnFillReduction:{type:Boolean},sortingOrder:{},accentedSort:{type:Boolean},unSortIcon:{type:Boolean},suppressMultiSort:{type:Boolean},alwaysMultiSort:{type:Boolean},multiSortKey:{},suppressMaintainUnsortedOrder:{type:Boolean},icons:{},rowHeight:{},rowStyle:{},rowClass:{},rowClassRules:{},suppressRowHoverHighlight:{type:Boolean},suppressRowTransform:{type:Boolean},columnHoverHighlight:{type:Boolean},gridId:{},deltaSort:{type:Boolean},treeDataDisplayType:{},enableGroupEdit:{type:Boolean},initialState:{},reactiveCustomComponents:{type:Boolean},renderingMode:{},theme:{},loadThemeGoogleFonts:{type:Boolean},themeCssLayer:{},styleNonce:{},themeStyleContainer:{},getContextMenuItems:{type:Function},getMainMenuItems:{type:Function},postProcessPopup:{type:Function},processUnpinnedColumns:{type:Function},processCellForClipboard:{type:Function},processHeaderForClipboard:{type:Function},processGroupHeaderForClipboard:{type:Function},processCellFromClipboard:{type:Function},sendToClipboard:{type:Function},processDataFromClipboard:{type:Function},isExternalFilterPresent:{type:Function},doesExternalFilterPass:{type:Function},getChartToolbarItems:{type:Function},createChartContainer:{type:Function},focusGridInnerElement:{type:Function},navigateToNextHeader:{type:Function},tabToNextHeader:{type:Function},navigateToNextCell:{type:Function},tabToNextCell:{type:Function},getLocaleText:{type:Function},getDocument:{type:Function},paginationNumberFormatter:{type:Function},getGroupRowAgg:{type:Function},isGroupOpenByDefault:{type:Function},ssrmExpandAllAffectsAllRows:{type:Boolean},initialGroupOrderComparator:{type:Function},processPivotResultColDef:{type:Function},processPivotResultColGroupDef:{type:Function},getDataPath:{type:Function},getChildCount:{type:Function},getServerSideGroupLevelParams:{type:Function},isServerSideGroupOpenByDefault:{type:Function},isApplyServerSideTransaction:{type:Function},isServerSideGroup:{type:Function},getServerSideGroupKey:{type:Function},getBusinessKeyForNode:{type:Function},getRowId:{type:Function},resetRowDataOnUpdate:{type:Boolean},processRowPostCreate:{type:Function},isRowSelectable:{type:Function},isRowMaster:{type:Function},fillOperation:{type:Function},postSortRows:{type:Function},getRowStyle:{type:Function},getRowClass:{type:Function},getRowHeight:{type:Function},isFullWidthRow:{type:Function},onToolPanelVisibleChanged:{type:Function},onToolPanelSizeChanged:{type:Function},onColumnMenuVisibleChanged:{type:Function},onContextMenuVisibleChanged:{type:Function},onCutStart:{type:Function},onCutEnd:{type:Function},onPasteStart:{type:Function},onPasteEnd:{type:Function},onColumnVisible:{type:Function},onColumnPinned:{type:Function},onColumnResized:{type:Function},onColumnMoved:{type:Function},onColumnValueChanged:{type:Function},onColumnPivotModeChanged:{type:Function},onColumnPivotChanged:{type:Function},onColumnGroupOpened:{type:Function},onNewColumnsLoaded:{type:Function},onGridColumnsChanged:{type:Function},onDisplayedColumnsChanged:{type:Function},onVirtualColumnsChanged:{type:Function},onColumnEverythingChanged:{type:Function},onColumnsReset:{type:Function},onColumnHeaderMouseOver:{type:Function},onColumnHeaderMouseLeave:{type:Function},onColumnHeaderClicked:{type:Function},onColumnHeaderContextMenu:{type:Function},onComponentStateChanged:{type:Function},onCellValueChanged:{type:Function},onCellEditRequest:{type:Function},onRowValueChanged:{type:Function},onCellEditingStarted:{type:Function},onCellEditingStopped:{type:Function},onRowEditingStarted:{type:Function},onRowEditingStopped:{type:Function},onBulkEditingStarted:{type:Function},onBulkEditingStopped:{type:Function},onBatchEditingStarted:{type:Function},onBatchEditingStopped:{type:Function},onUndoStarted:{type:Function},onUndoEnded:{type:Function},onRedoStarted:{type:Function},onRedoEnded:{type:Function},onCellSelectionDeleteStart:{type:Function},onCellSelectionDeleteEnd:{type:Function},onRangeDeleteStart:{type:Function},onRangeDeleteEnd:{type:Function},onFillStart:{type:Function},onFillEnd:{type:Function},onFilterOpened:{type:Function},onFilterChanged:{type:Function},onFilterModified:{type:Function},onFilterUiChanged:{type:Function},onFloatingFilterUiChanged:{type:Function},onAdvancedFilterBuilderVisibleChanged:{type:Function},onFindChanged:{type:Function},onChartCreated:{type:Function},onChartRangeSelectionChanged:{type:Function},onChartOptionsChanged:{type:Function},onChartDestroyed:{type:Function},onCellKeyDown:{type:Function},onGridReady:{type:Function},onGridPreDestroyed:{type:Function},onFirstDataRendered:{type:Function},onGridSizeChanged:{type:Function},onModelUpdated:{type:Function},onVirtualRowRemoved:{type:Function},onViewportChanged:{type:Function},onBodyScroll:{type:Function},onBodyScrollEnd:{type:Function},onDragStarted:{type:Function},onDragStopped:{type:Function},onDragCancelled:{type:Function},onStateUpdated:{type:Function},onPaginationChanged:{type:Function},onRowDragEnter:{type:Function},onRowDragMove:{type:Function},onRowDragLeave:{type:Function},onRowDragEnd:{type:Function},onRowDragCancel:{type:Function},isRowValidDropPosition:{type:Function},onRowResizeStarted:{type:Function},onRowResizeEnded:{type:Function},onColumnRowGroupChanged:{type:Function},onRowGroupOpened:{type:Function},onExpandOrCollapseAll:{type:Function},onPivotMaxColumnsExceeded:{type:Function},onPinnedRowDataChanged:{type:Function},onPinnedRowsChanged:{type:Function},onRowDataUpdated:{type:Function},onAsyncTransactionsFlushed:{type:Function},onStoreRefreshed:{type:Function},onHeaderFocused:{type:Function},onCellClicked:{type:Function},onCellDoubleClicked:{type:Function},onCellFocused:{type:Function},onCellMouseOver:{type:Function},onCellMouseOut:{type:Function},onCellMouseDown:{type:Function},onRowClicked:{type:Function},onRowDoubleClicked:{type:Function},onRowSelected:{type:Function},onSelectionChanged:{type:Function},onCellContextMenu:{type:Function},onRangeSelectionChanged:{type:Function},onCellSelectionChanged:{type:Function},onTooltipShow:{type:Function},onTooltipHide:{type:Function},onSortChanged:{type:Function},height:{},isSorting:{type:Boolean}},emits:["onGridReady","row-clicked","cell-clicked","cell-focused","row-selected"],setup(e,{expose:t,emit:n}){const s=e,o=n,i=B(null);sS(i,()=>{var v;const g=(v=r.value)==null?void 0:v.getApi();g==null||g.clearFocusedCell()});const r=B(null),a=Y(()=>({width:"100%",height:s.height||"500px"})),l=Y(()=>({...s,theme:LCe}));function u(){if(!i.value){console.warn("Grid container element not found");return}const g={...l.value,height:s.height};r.value=new NCe(i.value,g),r.value.init(),c()}function c(){var v;const g=((v=r.value)==null?void 0:v.getApi())??null;o("onGridReady",g)}function d(g){var C,S;if(!g)return;(C=r.value)==null||C.updateColumnDefs(g);const v=g.map(b=>b.field&&b.width&&!b.hide?{colId:b.field,width:b.width}:null).filter(b=>b!==null);(S=r.value)==null||S.setColumnWidth(v)}function h(){var g;(g=r.value)==null||g.destroy(),r.value=null}function f(){var g;return((g=r.value)==null?void 0:g.getApi())||void 0}function p(){return r.value||null}return nt(()=>s.columnDefs,(g,v)=>{const C=g==null?void 0:g.filter(b=>!b.hide).map(b=>b.field).join(","),S=v==null?void 0:v.filter(b=>!b.hide).map(b=>b.field).join(",");C!==S&&d(g)},{deep:!0}),vs(()=>{h()}),t({gridApi:f,gridManager:p,syncColumnDefs:d}),tn(()=>{u()}),vs(()=>{h()}),(g,v)=>(j(),ce("div",{ref_key:"gridContainerRef",ref:i,style:dn(a.value),class:Q(["ag-theme-quartz",["ag-table-container",s.isSorting?"is-sorting":""]])},null,6))}});function Pd(e){return kB(e)}const BCe=()=>[...[{headerName:"Name",field:"name",sortable:!1,filter:!1,pinned:"left",headerComponent:Pd(Ru),suppressMovable:!0},{headerName:"Assignee",field:"assignees",sortable:!1,filter:!1,headerComponent:Pd(Ru)},{headerName:"Status",field:"status",sortable:!1,filter:!1,headerComponent:Pd(Ru)},{headerName:"Date Range",field:"dateRange",sortable:!1,filter:!1,headerComponent:Pd(Ru)},{headerName:"Last Updated",field:"lastUpdated",sortable:!1,filter:!1,headerComponent:Pd(Ru),cellRendererParams:n=>{var s,o,i;return{...n,value:(s=n==null?void 0:n.data)==null?void 0:s.lastUpdated.value,tooltip:((i=(o=n==null?void 0:n.data)==null?void 0:o.lastUpdated)==null?void 0:i.tooltip)||void 0,readOnly:!0}}},{headerName:"Completed On",field:"completedOn",sortable:!1,filter:!1,headerComponent:Pd(Ru),cellRendererParams:n=>{var s,o,i;return{...n,value:(s=n==null?void 0:n.data)==null?void 0:s.completedOn.value,tooltip:((i=(o=n==null?void 0:n.data)==null?void 0:o.completedOn)==null?void 0:i.tooltip)||void 0,readOnly:!0}}}].map(n=>vp.fromType(n))],xy={WIDTH:60,HEADER_CLASS:"ag-checkbox-header"},$Ce={field:"blank",headerName:"",flex:1,editable:!1,sortable:!1,filter:!1,cellClass:"ag-cell-optimized",suppressMovable:!0,suppressNavigable:!0,suppressAutoSize:!1,suppressSizeToFit:!1},HCe=()=>({field:"__checkboxSelection",checkboxSelection:!0,headerCheckboxSelection:!0,pinned:"left",width:xy.WIDTH,minWidth:xy.WIDTH,maxWidth:xy.WIDTH,cellClass:"ag-checkbox-cell",headerClass:xy.HEADER_CLASS,headerComponent:Iy(wge),suppressMovable:!0}),GCe={headerName:"",field:"options",sortable:!1,filter:!1,editable:!0,pinned:"right",lockPosition:!0,suppressMovable:!0,resizable:!1},UCe=(e,t,n)=>{const{getCachedValue:s,setCachedValue:o}=Dh({dbName:"item_table_column_configs",storeName:"column_configs"}),i=async()=>{const c=await s(t);if(c&&typeof c=="string")try{return JSON.parse(c)}catch(d){return console.error("Failed to parse cached column config:",d),null}return null},r=B([]),a=HCe(),l=async c=>{const d=await i(),h=new Map;d==null||d.forEach(F=>{F.width&&h.set(F.field,F.width)});const f=BCe(),p=vp.fromType(GCe),v=((c==null?void 0:c.map(F=>{var k;return{headerName:F.name,field:`metric_${F.id}`,editable:((k=F==null?void 0:F.auth_permission)==null?void 0:k.permission)==2,sortable:!0,filter:!1,flex:1,context:{...F},hide:!(F.is_primary||F.is_point_metric),cellClass:"ag-cell-optimized",headerComponent:Iy(Ru),headerComponentParams:O=>({headerType:F.metric_type.code=="number"||F.metric_type.code=="formula"?"number":"default"}),width:h.get(`metric_${F.id}`)}}))||[]).map(F=>vp.fromType(F)),C=[a,...f,...v,$Ce,p],S=C.filter(F=>F.pinned==="left"),b=C.filter(F=>F.pinned==="right"||F.field==="blank"),w=C.filter(F=>!F.pinned&&F.field!=="blank");if(!d||d.length===0){r.value=C;return}const _=new Map(d.map(F=>[F.field,F])),R=new Map(w.map(F=>[F.field,F])),T=[];for(const F of d)if(F.field&&R.has(F.field)){const k=R.get(F.field);T.push({...k,hide:F.hide,width:F.width}),R.delete(F.field)}const I=Array.from(R.values()),x=[...T,...I],P=S.map(F=>{const k=_.get(F.field);return k!=null&&k.width?{...F,width:k.width}:F}),D=b.map(F=>{const k=_.get(F.field);return k!=null&&k.width?{...F,width:k.width}:F});r.value=[...P,...x,...D]};nt(e,c=>l(c),{immediate:!0});const u=Ti((c,d)=>{var C,S;if(c.source!==void 0)if(["uiColumnResized","uiColumnMoved","api"].indexOf(c.source)===-1){console.warn("Skipping saveColumnConfig for source:",c.source);return}else console.warn("Executing saveColumnConfig for source:",c.source);else console.warn("Executing saveColumnConfig for source:",c);const h=(C=n==null?void 0:n.value)==null?void 0:C.getColumnDefs(),f=(S=n==null?void 0:n.value)==null?void 0:S.getColumnState().reduce((b,w)=>(b[w.colId]=Number(w.width),b),{}),p=new Map;Object.entries(f||{}).forEach(([b,w])=>{p.set(b,w)}),r.value=h||r.value;const g=h==null?void 0:h.filter(b=>!b.pinned&&b.field!=="blank"),v=(g==null?void 0:g.map(b=>({field:b.field,hide:b.hide,width:p.get(b.field)||b.width,pinned:b.pinned})))||[];d&&o(t,JSON.stringify(v))},rr);return{columnDefs:r,checkboxColumn:a,saveColumnConfig:u}},WCe=()=>{const e=_n.getInstance().getItem("API_BASE_URL");return e!=null&&e.includes("v1")?e.slice(0,e.lastIndexOf("/v1")):String(e)},zCe=e=>{var F,k,O;const{showMessage:t,showErrorNetMessage:n}=Qf(),s=Yn(),o={domainApi:WCe(),wsCode:_n.getInstance().getItem("ws.code"),entityId:e.value.entityId},i=(O=(k=(F=s==null?void 0:s.appContext)==null?void 0:F.config)==null?void 0:k.globalProperties)==null?void 0:O.apiConfig;if(!i||o.domainApi===""||o.wsCode==="")throw new Error("API configuration is missing in useItems");const r=new Lk(i,o);r.on("call-api",$=>{$.success?t($.apiCode,"success"):n($)});const a=So({}),l=B([]),u=B(!1),c=B(null),d=B(null),h=B(1),f=B(20);let p=Promise.resolve();const{setCachedUsers:g}=LK(),v=$=>({workspaceId:e.value.workspaceId,entityIds:[e.value.entityId],orderBy:"id-asc",include_permission:"{include_permission}",include_permission_names:!0,q:$}),C=50,S=async($,q,J)=>{if(!$.length)return[];const ee=Z4($,q);return(await Promise.all(ee.map(J))).flat()},b=async $=>{try{return(await r.getPermissionForItems({workspaceId:e.value.workspaceId,itemIds:$})).data.map(J=>[J==null?void 0:J.id,J.permission])}catch(q){return console.error("Failed to fetch item permissions chunk:",q),[]}},w=async($,q)=>{try{const J=await r.getMetricValues({workspaceId:e.value.workspaceId,item_ids:$,per_page:$.length*q.length,metric_ids:q}),ee=J.data.map(ve=>{const te=new Map(ve.item_metrics.map(V=>[V.metric_id,{value:V.value,auth_permission:V==null?void 0:V.auth_permission}])),N=Object.fromEntries(q.map(V=>[V,te.get(V)??null]));return[ve==null?void 0:ve.id,N]}),X=new Set(J.data.map(ve=>ve==null?void 0:ve.id));for(const ve of $)if(!X.has(ve)){const te=Object.fromEntries(q.map(N=>[N,{value:null,auth_permission:void 0}]));ee.push([ve,te])}return ee}catch(J){return console.error("Failed to fetch a chunk of metric values:",J),$.map(X=>[X,Object.fromEntries(q.map(ve=>[ve,void 0]))])}},_=async $=>{try{const q=await r.getAssignedUser({workspaceId:e.value.workspaceId,item_ids:$,per_page:$.length}),J=q.data.flatMap(ee=>ee.assignees);return g(J),q.data.map(ee=>[ee==null?void 0:ee.id,ee==null?void 0:ee.assignees])}catch(q){return console.error("Failed to fetch a chunk of assigned users:",q),[]}},R=async $=>{if(!$.length)return console.warn("getPermissionForItems: Empty itemIds"),{};try{const q=await S($,C,b);return Object.fromEntries(q)}catch(q){return console.error("Failed to fetch item permissions:",q),{}}},T=async($,q)=>!$.length||!q.length?{}:(p=p.then(async()=>{try{const X=[];let ve=0;for(let N=0;N<q.length;N+=5){ve++;const V=q.slice(N,N+5),ne=[];for(let pe=0;pe<V.length;pe++){const ae=V[pe],re=await S($,C,W=>w(W,[ae]));ne.push(re),await new Promise(W=>setTimeout(W,500))}X.push(...ne);const ie=N+5>=q.length}const te={};for(const N of X.flat()){const[V,ne]=N;te[V]||(te[V]={}),Object.assign(te[V],ne)}return te}catch(J){return console.error("Failed to fetch metric values:",J),{}}}),p),I=async $=>{if(!$.length)return console.warn("getAssignedUsers: Empty itemIds"),{};try{const q=await S($,C,_);return Object.fromEntries(q)}catch(q){return console.error("Failed to fetch assigned users:",q),{}}};return{items:l,loading:u,error:c,pagination:d,currentPage:h,pageSize:f,cusorMap:a,fetchItems:async $=>{const{cursor:q,offset:J,size:ee,searchQuery:X}=$;let ve=[];u.value=!0,c.value=null;try{const te=await r.getAllItem_cursor({...$,cursor:q||void 0,offset:J||void 0,pageSize:ee||f.value,...v(X),sortBy:$.sort_by});return l.value=te.data,d.value=te.meta,h.value=te.meta.current_page||0,ve=te.data.map(N=>N==null?void 0:N.id),te}catch(te){throw c.value=te,console.error("Failed to fetch items (cursor):",te),te}finally{const te=async()=>{try{const[N,V]=await Promise.all([I(ve),R(ve)]);e.value.updateItemData({assignees:N,permission:V},ve);const ne=await T(ve,e.value.metricIds);e.value.setMetricValues(ne,new Set(ve),e.value.metricIds)}catch(N){console.error("Post-fetch processing failed:",N)}};u.value=!1,setTimeout(te)}},getAssignableStatus:async $=>{try{return await r.getAssignableStatus({workspaceId:e.value.workspaceId,itemIds:$})}catch(q){throw console.error("Failed to fetch assignable status:",q),q}},getMetricList:async $=>{try{return await r.getMetricList({workspaceId:e.value.workspaceId,entityId:$})}catch(q){throw console.error("Failed to fetch metric list:",q),q}},getMetricValues:T,getAssignedUsers:I}};function jCe(e){return{updateRowData:(s,o)=>{if(!e.value)return;const i=[],r=new Set,a=e.value.getColumnDefs();if(!a)return;const l=a.map(u=>{if(u.field&&u.field.startsWith("metric_")&&(u.hide===!1||u.hide===void 0))return u.field}).filter(Boolean);o.forEach(u=>{var d;const c=(d=e.value)==null?void 0:d.getRowNode(u);if(c){if(i.push(c),s.assignees){const h=EK((s.assignees[u]||[]).map(xF));c.data.assignees=h,r.add("assignees")}s.permission&&(c.data.permissions=s.permission[u]),l.forEach(h=>{c.data[h]=c.data[h]??null})}}),r.add("assignees"),r.add("status"),r.add("dateRange"),r.add("moreActions"),r.add("name"),e.value.refreshCells({rowNodes:i,columns:Array.from(r),force:!0})},setMetricValues:(s,o,i)=>{const r=e.value;if(!r)return;const a=new Map(Array.from(o).map(u=>[u,new Map(i.map(c=>[c,{value:null,auth_permission:void 0}]))]));Object.entries(s).forEach(([u,c])=>{Object.entries(c).forEach(([d,h])=>{var f;(f=a.get(u))==null||f.set(d,{value:h==null?void 0:h.value,auth_permission:h==null?void 0:h.auth_permission})})});const l=Array.from(a.entries()).map(([u,c])=>{const d=r.getRowNode(u);return d!=null&&d.data?(c.forEach((h,f)=>{const p=`metric_${f}`;d.data[p]=(h==null?void 0:h.value)||null;const g=`metric_permission_${f}`;d.data[p]=(h==null?void 0:h.value)||null,d.data[g]=(h==null?void 0:h.auth_permission)||null}),d):null});l.length>0&&r.refreshCells({rowNodes:l,columns:Array.from(i).map(u=>`metric_${u}`),force:!0})}}}function KCe(e,t,n,s,o){let i=!0;return{async getRows(r){try{s(!0),i&&(o(!0),i=!1);const a=Math.floor(r.startRow/t)+1,{rows:l,total:u}=await e({page:a,pageSize:t,filterText:n(),sort_by:r.sortModel});let c=-1;Number.isFinite(u)?c=u:l.length<t&&(c=r.startRow+l.length),r.context={pageSize:t,text:n()},r.successCallback(l,c),s(!1),o(!1)}catch(a){console.error("Datasource fetch error:",a),r.failCallback(),s(!1),o(!1)}}}}function qCe(e){const{selectRowData:t,isSidebarOpen:n,quickFilterText:s,gridApi:o,fetcher:i}=e,r=B(!0),a=B(!0),l=B(!1),u=()=>{n.value=!n.value},c=v=>{if(r.value=!1,o.value=v,!v)return null;const{addEventListener:C,setGridOption:S}=v;if(!i)return console.error("Fetcher function is undefined"),null;const b=KCe(i,e.perPage,()=>s.value,w=>{r.value=w},w=>{a.value=w});return S==null||S("datasource",b),C==null||C("selectionChanged",()=>{t.value=v.getSelectedRows()}),v||null},d=v=>{var C,S;if((C=o.value)==null||C.hideOverlay(),v!==void 0&&(s.value=v),(S=o.value)==null||S.deselectAll(),t.value=[],r.value=!0,!o.value||!i){console.error("Grid API or fetcher is not available"),r.value=!1;return}l.value=!0,a.value=!0,o.value.purgeInfiniteCache(),o.value.ensureIndexVisible(0,"top"),setTimeout(()=>{r.value=!1,setTimeout(()=>{l.value=!1},100)},300)},h=()=>{var v;(v=o.value)==null||v.deselectAll(),t.value=[]},f=Ti(v=>{d(v)},rr),p=()=>{o.value},g=B(!1);return{isLoading:r,toggleSidebar:u,onGridReady:c,onSearch:f,handleUnSelect:h,firstLoad:a,cacheCleared:l,handleSelectAll:p,isSelectAll:g}}const YCe={changelog:{"1.0.1":{date:"2024-06-20",changes:["Fixed styling issues for archived and deleted rows."]},"1.0.0":{date:"2024-06-15",changes:["Initial release of the Item Table package."]},"0.0.1-alpha.8":{date:"2024-06-10",changes:["Improved performance of row updates.","Added support for custom cell renderers.","Add row hover effect for better UX.","Add loading skeleton for filter","Beta release with core functionalities implemented."]},"0.0.1-alpha.9":{date:"2024-06-05",changes:["Add row selection feature.","Fix bug with column resizing.","Optimize rendering for large datasets.","Implement getLog function to retrieve changelog entries based on version.","Display app version and changelog in the Item Table component tooltip.","Clean up unused autocomplete and memoized config composables.","Update styles for better consistency and readability."]},"0.0.1-alpha.11":{date:"2024-06-18",changes:["Add bulk process status display: items now show an hourglass icon and tooltip when being processed.","Update data model: added isProcessing and bulk_process properties to track item status.","Improve row focus: focused rows now flash for better visibility.","Set 'Last Updated' and 'Completed On' columns as read-only.","Fix: resolve visual fetching issue in useRemoteFiles composable.","Fix: use correct upload icon in PopupCreateScenes component.","Enhance data conversion to include processing status in item rows."]},"0.0.1-alpha.12":{date:"2024-06-12",changes:["feat: enhance Snackbar component and notification handling","Refactor Snackbar.vue for improved readability and styling, including color adjustments for icons and text.","Add showMessage function in notifications store to display messages based on API keys, improving notification management.","Introduce notificationMessage constant to centralize notification messages for various API actions, enhancing maintainability.","Remove unnecessary console logs from useRemoteFiles and improve logging in notification store for better debugging."]},"0.0.1-alpha.16":{date:"2024-06-20",changes:["Add onboarding tour feature and enhance UI components with new dependencies","Refactor UI components for improved styling and functionality","Updated RatingComponent.vue to streamline class bindings and improve accessibility attributes.","Enhanced SearchBox.vue by adding a clear event handler and simplifying icon rendering.","Modified AssigneeGroupEditor.vue and AssigneeGroupRenderer.vue to remove unnecessary size attributes from icons.","Adjusted DateRangeRenderer.vue to remove size attributes from icons for consistency.","Updated HeaderCheckbox.vue to set dropdown placement to 'bottom-start'.","Refined HeaderSorting.vue to simplify sort option labels and improve sorting logic.","Enhanced HeaderWrapper.vue to utilize reactive properties for sorting state.","Improved HyperLinkEditor.vue and HyperLinkInlineEditor.vue by removing size attributes from icons.","Updated PopupLayout.vue to use a CSS variable for box-shadow styling.","Refined Snackbar.vue to standardize icon colors and improve styling consistency.","Adjusted useTippy.ts to set default placement and arrow visibility for tooltips.","Modified notificationMessage.ts to remove error messages for list fetching.","Cleaned up notifications.ts by removing console logs for a cleaner codebase.","Updated sortStore.ts to comment out unnecessary console logs for better performance.","Enhanced styles.scss by defining new icon size variables and standardizing box-shadow styles."]},"0.0.99":{date:"2024-06-24",changes:["Fix: resolve issue with incorrect version display in Item Table component.","Update changelog retrieval logic to ensure accurate version matching.","Enhance tooltip display for app version and changelog in Item Table component."]}}},ZCe=e=>{var t;return(t=Object.entries(YCe.changelog).find(([n,s])=>n===e))==null?void 0:t[1].changes},XCe={key:1},JCe=_t(rt({__name:"PopupOverwriteScenes",props:{workspaceId:{},entityId:{}},emits:["import-success"],setup(e,{expose:t,emit:n}){const s=B(null),o=e,i=()=>{s.value&&s.value.show()},r=B(""),a=B("idle"),l=B({file:null,format:null}),{apiServices:u}=ts(!1,{}),c=B(!1),d=async()=>{c.value=!0;const T=o.workspaceId,I=o.entityId;if(!T||!I||!u.value){console.error("Workspace ID or Entity ID is missing");return}try{if(!await u.value.downloadExportedItemsFile(T,I))throw new Error("No response from downloadTemplate API")}catch(x){console.error("Error downloading template:",x)}c.value=!1},h=n,f=()=>{h("import-success"),S()},p=async T=>{var P,D,F;const I=new FormData,x=((P=T.name.split(".").pop())==null?void 0:P.toString())||"";if(I.append("file",T),I.append("format",x),I.append("entity_id",o.entityId||""),!u.value){console.error("API services not available");return}try{await u.value.overwriteScenesViaImportFile(o.workspaceId,o.entityId,I),g()}catch(k){throw console.error("Error uploading file:",k),v(((F=(D=k.response)==null?void 0:D.data)==null?void 0:F.message)||"An unknown error occurred during file upload."),k}},g=()=>{a.value="success"},v=T=>{r.value=T,a.value="error"},C=async()=>{!l.value||!l.value.file||await p(l.value.file)},S=()=>{var T;R(),(T=s.value)==null||T.hide()};t({close:S,open:i});const b=Y(()=>({error:"Import failed",importing:"Import in progress",success:"Import successful",idle:"Update existing work"})[a.value]),w=Y(()=>l.value.file?!1:(console.error("No file selected"),!0)),_=B(null),R=()=>{var T;(T=_.value)==null||T.clear(),r.value="",l.value={file:null,format:null},a.value="idle"};return(T,I)=>(j(),qe(U(dV),{"popup-name":b.value,"show-overlay":!0,"overlay-opacity":.5,"close-on-overlay-click":!0,"close-on-escape":!0,ref_key:"popupRef",ref:s,onHidden:R},nh({default:me(()=>[a.value==="importing"||a.value==="error"||a.value==="success"?(j(),qe(TB,{key:0,state:a.value,"error-message":r.value,overwrite:!0},null,8,["state","error-message"])):(j(),ce("div",XCe,[Ee("div",{class:Q(T.$style["step-section"])},[Ee("span",{class:Q(T.$style["step-title"])},"Step 1: Download current data",2),Ee("span",{class:Q(T.$style["step-description"])},[...I[1]||(I[1]=[tt(" Download a file with all existing work and details. Edit it, then upload in Step 2. ",-1),Ee("br",null,null,-1),Ee("i",null,"Note: Empty cells and unchanged values will be skipped.",-1)])],2),ge(U(mt),{class:Q(T.$style["download-sample-btn"]),size:12,variant:"secondary",disabled:c.value,onHandleClick:d},{prefix:me(()=>[ge(U(lt),{src:"Download"})]),default:me(()=>[I[2]||(I[2]=tt(" Download file ",-1))]),_:1},8,["class","disabled"])],2),Ee("div",{class:Q(T.$style["step-section"])},[Ee("span",{class:Q(T.$style["step-title"])},"Step 2: Upload updated file (.xlsx, .xls, .csv)",2),ge(U(ZV),{modelValue:l.value,"onUpdate:modelValue":I[0]||(I[0]=x=>l.value=x),ref_key:"filUploaderRef",ref:_},null,8,["modelValue"])],2),Ee("div",{class:Q(T.$style["step-section"]),style:{"padding-top":"0","padding-bottom":"0"}},[ge(IB)],2)]))]),_:2},[a.value==="idle"?{name:"footer",fn:me(()=>[ge(U(mt),{style:{flex:"1"},variant:"secondary",onClick:S},{default:me(()=>[...I[3]||(I[3]=[tt(" Cancel ",-1)])]),_:1}),ge(U(mt),{disabled:w.value,style:{flex:"1"},variant:"primary",onClick:C},{default:me(()=>[...I[4]||(I[4]=[tt(" Import ",-1)])]),_:1},8,["disabled"])]),key:"0"}:a.value==="success"?{name:"footer",fn:me(()=>[ge(U(mt),{style:{flex:"1"},variant:"primary",onClick:f},{default:me(()=>[...I[5]||(I[5]=[tt(" Close ",-1)])]),_:1})]),key:"1"}:{name:"footer",fn:me(()=>[ge(U(mt),{style:{flex:"1"},variant:"primary",onClick:R},{default:me(()=>[...I[6]||(I[6]=[tt(" Try Again ",-1)])]),_:1})]),key:"2"}]),1032,["popup-name"]))}}),[["__cssModules",{$style:{"step-section":"_step-section_lw86z_1","step-title":"_step-title_lw86z_11","step-title-2":"_step-title-2_lw86z_17","step-description":"_step-description_lw86z_23","date-format-guide":"_date-format-guide_lw86z_28","import-error":"_import-error_lw86z_39","drop-area":"_drop-area_lw86z_49","is-dragging":"_is-dragging_lw86z_49","drop-area-content":"_drop-area-content_lw86z_52",browse:"_browse_lw86z_61","download-sample-btn":"_download-sample-btn_lw86z_65"}}]]),QCe={style:{cursor:"help"}},ebe=_t(rt({__name:"item-table",props:{entityId:{},workspaceId:{}},setup(e,{expose:t}){const n=To,s=Qb(),{setUserPermissions:o,setEntityPermissions:i}=s,{entityPermissions:r}=Qs(s),a=Xt,l=B(null),u={ROWS_PER_PAGE:50,ROW_HEIGHT:38,GRID_HEIGHT:"650px"},c=B(""),d=Y(()=>{var Ye;const Ae=((Ye=r.value)==null?void 0:Ye.has_create_item_permission)==1||!1;return[{label:"Create manually",value:"new_scene",icon:"Plus",type:"icon",id:"create_new_scene",hide:!Ae},{label:"Import from CSV or Excel",value:"import_scenes",icon:"FileImport",type:"icon",hide:!Ae,id:"import_scenes_option"},{label:"Update existing (CSV or Excel)",value:"overwrite_scenes",icon:"FilePen",type:"icon",hide:!Ae,id:"overwrite_scenes_option"}]}),h=e;vp.initialize({wrapVueCellRenderer:Iy,wrapVueCellEditor:kB});const f=tf(),{switchInstanceFunc:p}=Qs(f);tn(()=>{const Ae=Yn();p.value=Ae==null?void 0:Ae.appContext.config.globalProperties.switchInstance;const Ye=new BroadcastChannel("focusable_channel");Ct(()=>{setTimeout(()=>{Ye.postMessage("Focusable elements updated")},7e3)})});const g=B(null),v=B([]),C=Wm(),{rowCount:S}=Qs(C),b=B(!1),w=B(""),_=B(),R=zA(),{metricList:T}=Qs(R),I=B(""),x=B(!1),P=B(new Set),D=B(new Map),{apiServices:F}=ts(!1,h),{columnDefs:k,checkboxColumn:O,saveColumnConfig:$}=UCe(T,h.entityId,g),q=B();nt(()=>k,()=>{var Ae;(Ae=q.value)==null||Ae.updateColumnDefs(k.value)},{deep:!0});const J=(Ae,Ye)=>{$(Ae,Ye)},{updateRowData:ee,setMetricValues:X}=jCe(g),ve=Y(()=>({isSearching:w.value.length>0,isFiltering:!(Object.keys(ke.value||{}).length==1&&Object.keys(ke.value)[0]=="preflight_status")&&Object.keys(ke.value||{}).length>0})),te=Y(cm),N=Y(()=>k.value.filter(Ae=>{var Ye;return((Ye=Ae.field)==null?void 0:Ye.startsWith("metric_"))&&!Ae.hide}).map(Ae=>{var Ye;return((Ye=Ae.field)==null?void 0:Ye.replace("metric_",""))||""}));Zi("timezone",te);const V=Y(()=>({autoFetch:!1,workspaceId:h.workspaceId,entityId:h.entityId,metricIds:N.value,updateItemData:ee,setMetricValues:X})),{fetchItems:ne,getMetricList:ie,cusorMap:pe,getMetricValues:ae}=zCe(V),re=Y(()=>{if(!g.value)return!1;const Ae=g.value.getSelectedRows().length;return Ae>0&&Ae>=S.value.total}),W=Y(()=>{var Ae;return((Ae=l.value)==null?void 0:Ae.name)||"Items"}),fe=Ae=>{setTimeout(()=>{Ct(()=>{var Ye,jt;g.value&&(Ae?(Ye=g.value)==null||Ye.showNoRowsOverlay():(jt=g.value)==null||jt.hideOverlay())})},500)},oe=(Ae,Ye)=>{var jt;S.value.total=Ae.meta.total??0,(jt=Ae.meta.next)!=null&&jt.cursor&&(pe[Ye+1]=Ae.meta.next.cursor),I.value=Ae.meta["X-Tsr-signature"]||"",Ae.meta.total===0?fe(!0):fe(!1)},Ie=YV(),G=B(null),{sortingAPIConfiguration:Z,isSortingRunning:de}=Qs(Ie),ke=B({preflight_status:"1"}),Pe=Y(()=>({...ke.value,search:w.value}));Zi("filterParams",Pe);const Le=B([]),ye=async({page:Ae,pageSize:Ye,filterText:jt})=>{var ku;(ku=g.value)==null||ku.hideOverlay();const sn=pe[Ae],Wi=!sn&&Ae>1?(Ae-1)*Ye:void 0,js=Z.value;js.length>0&&(de.value=!0);try{const Co={cursor:sn,size:Ye,searchQuery:jt,offset:Wi,sort_by:js,...ke.value},Pr=await ne(Co);if(!Pr)return{rows:[],total:0};const Kn=(ya=>{const gi=ya.data.map(Ou=>PF(Ou,te.value));return gi.forEach(Ou=>{P.value.add(String(Ou.id)),D.value.set(String(Ou.id),{})}),gi})(Pr);return oe(Pr,Ae),{rows:Kn,total:S.value.total}}catch(Co){return console.error("Failed to fetch items:",Co),{rows:[],total:0}}finally{de.value=!1}},{isLoading:M,toggleSidebar:H,onGridReady:le,handleUnSelect:Ge,handleSelectAll:we,onSearch:ze,firstLoad:Ue}=qCe({selectRowData:B([]),isSidebarOpen:b,quickFilterText:w,gridApi:g,perPage:u.ROWS_PER_PAGE,fetcher:ye}),Se=B([]),Ve=()=>{var Ae;Se.value=((Ae=g.value)==null?void 0:Ae.getSelectedRows())||[]},pt=So({columnsDisplay:[],rowsDisplay:{fromIndex:0,toIndex:0}}),At=Y(()=>({blockLoadDebounceMillis:1e3,columnDefs:k.value,rowModelType:"infinite",cacheBlockSize:u.ROWS_PER_PAGE,infiniteInitialRowCount:20,popupParent:document.getElementById("item-table-layout-id")||void 0,rowSelection:{mode:"multiRow",checkboxes:!1,enableClickSelection:!1,enableSelectionWithoutKeys:!1},pagination:!1,rowHeight:u.ROW_HEIGHT,suppressHorizontalScroll:!1,suppressColumnVirtualisation:!1,debounceVerticalScrollbar:!1,animateRows:!1,suppressAnimationFrame:!1,suppressScrollOnNewData:!0,suppressScrollWhenPopupsAreOpen:!1,rowBuffer:20,enableCellTextSelection:!1,suppressDragLeaveHidesColumns:!0,suppressMaxRenderedRowRestriction:!1,height:u.GRID_HEIGHT,stopEditingWhenCellsLoseFocus:!0,onModelUpdated:Ut,noRowsOverlayComponent:Iy(ive),noRowsOverlayComponentParams:()=>ve.value,defaultColDef:{editable:!1,filter:!1,sortable:!1,flex:1,minWidth:100,suppressNavigable:!1},getRowId:Ae=>Ae.data.id,getRowClass:Ae=>{if(!Ae.data)return["row-empty"];const Ye=["row-highlight"];return Ae.data.id||Ye.push("row-inactive"),Ae.data.isDeleted&&Ye.push("row-deleted"),Ae.data.disabled&&Ye.push("row-deleted"),Ae.data.isArchived&&Ye.push("row-archived"),Ae.data.isLocked&&Ye.push("row-locked"),Ye},suppressRowTransform:!1,singleClickEdit:!0,context:{workspaceId:h.workspaceId,entityId:h.entityId,apiServices:F.value,sorting:de.value},onCellKeyDown:Ae=>{var Ye,jt,sn;if(Ae.data.isDeleted)return!1;if(((Ye=Ae==null?void 0:Ae.event)==null?void 0:Ye.key)==="Enter"){const{api:Wi,node:js,column:ku}=Ae,Co=Wi.getCellRendererInstances({rowNodes:[js],columns:[ku]});if(Co.length>0){const Pr=Co[0];Pr&&typeof((jt=Pr.componsenExposed)==null?void 0:jt.focus)=="function"&&((sn=Pr.componsenExposed)==null||sn.focus())}}},isRowSelectable:Ae=>!Ae.group,suppressKeyboardEvent:Ae=>{var sn;if((sn=Ae.data)!=null&&sn.isDeleted)return!0;const Ye=Ae.event.key,jt=Ae.editing;return jt&&Ye==="Tab"?!0:jt&&Ye==="Enter"?!1:Ye==="Enter"?(Ae.event.preventDefault(),Ae.event.stopPropagation(),!0):Ye==="ArrowUp"||Ye==="ArrowDown"||Ye==="ArrowLeft"||Ye==="ArrowRight"||Ye==="Tab"||Ye==="Enter"},navigateToNextCell:()=>null,onBodyScroll:Ae=>{const Ye=Ae.api.getFirstDisplayedRowIndex(),jt=Ae.api.getLastDisplayedRowIndex();pt.rowsDisplay.fromIndex=Ye,pt.rowsDisplay.toIndex=jt,pt.columnsDisplay=Ae.api.getAllDisplayedVirtualColumns().map(sn=>sn.getColId())},onViewportChanged:Ae=>{pt.columnsDisplay=Ae.api.getAllDisplayedVirtualColumns().map(Ye=>Ye.getColId())},suppressHeaderFocus:!0,onCellEditingStarted(Ae){if(Ae.data.isDeleted&&Ae.api.stopEditing(),Ae.colDef.field=="options"){const Ye=Ae.api.getCellRendererInstances({rowNodes:[Ae.node],columns:[Ae.column]});Ye.length>0&&Ye[0].focusUi()}},tabToNextCell:Ae=>{let Ye=Ae.nextCellPosition;if(Ye&&Ye.column.getColId()==="ag-Grid-SelectionColumn"){const jt=Ae.api.getAllDisplayedColumns(),sn=jt.indexOf(Ye.column),Wi=Ae.backwards?-1:1,js=jt[sn+Wi];if(js)return{rowIndex:Ye.rowIndex,column:js,rowPinned:Ye.rowPinned}}return Ye}}));function Ut(){if(!g.value)return;let Ae=0;g.value.forEachNode(Ye=>{Ye.data&&Ae++}),S.value.loaded=Math.min(Ae,S.value.total)}nt(()=>Z,()=>{g.value&&(I.value="",P.value.clear(),g.value.deselectAll(),Object.keys(pe).forEach(Ae=>delete pe[Number(Ae)]),g.value.purgeInfiniteCache(),g.value.ensureIndexVisible(0))},{deep:!0});const Jt=B(),zt=B(),Ne=()=>{var Ae;(Ae=zt.value)==null||Ae.open()},je=()=>{var Ae;(Ae=Jt.value)==null||Ae.open()},yt=async()=>{Ue.value=!0,g.value&&(I.value="",P.value.clear(),Object.keys(pe).forEach(Ae=>delete pe[Number(Ae)]),await g.value.deselectAll(),await g.value.ensureIndexVisible(0,"top"),await g.value.purgeInfiniteCache(),await g.value.refreshInfiniteCache())},Ot=Y(()=>_n.getInstance().getItem("ITEM_TABLE_APP_VERSION")||""),Wt=B(),st=Y(()=>{var Ae;return(Ae=ZCe(Ot.value))==null?void 0:Ae.map(Ye=>`<div>• ${Ye}</div>`).join(`
|
|
253
|
-
`)});function ps(Ae){var Ye;Ae==="new_scene"?(Ye=Wt.value)==null||Ye.show():Ae==="import_scenes"?je():Ae==="overwrite_scenes"&&Ne()}const Ui=Ae=>{v.value=Ae.api.getSelectedRows().map(Ye=>Ye.id)},pl=Ae=>{const Ye=le(Ae);return Ye&&(Ye.addEventListener("modelUpdated",Ut),Ye.addEventListener("bodyScroll",()=>Ye.stopEditing()),Ye.addEventListener("selectionChanged",Ve),Ye.addEventListener("columnMoved",sn=>J(sn,!0)),Ye.addEventListener("columnResized",sn=>J(sn,!0)),Ye.addEventListener("firstDataRendered",()=>{Ue.value=!1}),!document.querySelector(".ag-body-viewport")),Ye},wo=()=>{var Ae;c.value=(((Ae=document.getElementById("item-table-layout-id"))==null?void 0:Ae.clientHeight)??0)-78+"px"};tn(()=>{Ct(()=>{wo()}),window.addEventListener("resize",wo);function Ae(){requestAnimationFrame(Ae)}Ae()}),vs(()=>{window.removeEventListener("resize",wo)});const va=async({code:Ae,name:Ye})=>{await ze(Ae),setTimeout(()=>{var jt;(jt=_.value)==null||jt.setValue(Ye)},300)},gl=Ae=>{if(!g.value)return;const Ye=g.value.getRowNode(Ae);Ye?(g.value.ensureIndexVisible(Number(Ye.rowIndex),"middle"),g.value.flashCells({rowNodes:[Ye],flashDuration:3e3,fadeDuration:1e3})):g.value.ensureIndexVisible(S.value.total-1,"bottom")},Ir=Ae=>Ae.metric_type.code==="number"?"number":"default",xr=async()=>{if(h.entityId)try{const Ae=await ie(h.entityId);T.value=Ae.data.map(Ye=>({...Ye,sortType:Ir(Ye)}))}catch(Ae){console.error("Failed to initialize metric list:",Ae),T.value=[]}},pi=async()=>{if(F.value)try{const Ae=await F.value.getUserPermission(h.workspaceId);o(Ae)}catch(Ae){console.error("Failed to fetch user permissions:",Ae)}},Fr=async()=>{if(F.value)try{const Ae=await F.value.getEntityDetail(h.workspaceId,h.entityId);i(Ae.permission),l.value=Ae}catch(Ae){console.error("Failed to fetch entity details:",Ae)}},Au=my(),{setUser:kn}=Au,gs=async()=>{if(F.value)try{const Ae=await F.value.getMe();return kn(Ae),Ae}catch(Ae){console.error("Failed to fetch user details:",Ae)}},__=async()=>{var Ae;if(F.value)try{const Ye=await F.value.getWorkspaces(h.workspaceId),jt=(Ae=Ye.data[0])==null?void 0:Ae.ws_user_role_id;return jt&&Au.setUserRoleId(jt),Ye}catch(Ye){console.error("Failed to fetch workspace details:",Ye)}};nt(()=>[h.entityId,h.workspaceId],async([Ae,Ye])=>{!Ae||!Ye||(gs(),__(),xr(),pi(),Fr())},{immediate:!0,deep:!0}),nt(N,(Ae,Ye)=>{const jt=Ae.filter(sn=>!(Ye!=null&&Ye.includes(sn)));jt.length>0&&ae(Array.from(P.value),jt).then(sn=>{X(sn,P.value,jt)})},{immediate:!0,deep:!0}),nt(I,(Ae,Ye)=>{x.value=!!(Ye&&Ae&&Ye!==Ae)}),t({refreshTable:yt});const Ad=Ae=>{ke.value=Ae,yt()},kd=Ae=>{Le.value=Ae,yt()},Od=Ae=>{k.value=Ae||[],J({},!0)},R_=Y(()=>{var sn;const Ae=_n.getInstance().getItem("ws.terminology"),Ye=Ae?JSON.parse(Ae):null;return`New ${((sn=Ye==null?void 0:Ye.find(Wi=>Wi.code==="scene"))==null?void 0:sn.name)||"Scene"}`});return(Ae,Ye)=>{const jt=Eo("focusable");return j(),qe(U(pge),{"is-sidebar-open":b.value,onCloseSidebar:U(H),onSidebarClear:U(H),ref:"itemTableLayoutRef",id:"item-table-layout-id",onSidebarApply:U(H)},{"header-left":me(()=>{var sn;return[((sn=U(r))==null?void 0:sn.has_create_item_permission)==1?(j(),qe(U(_0),{key:0,variant:["primary"],options:d.value,onSelect:ps,onHandleClick:Ye[1]||(Ye[1]=Wi=>ps("new_scene")),id:"create_scene_dropdown",tabIndex:2},{prefix:me(()=>[Ke(ge(U(mt),{"data-focus-index":"1",id:"create_new_scene",variant:["primary"],onClick:Ye[0]||(Ye[0]=Wi=>ps("new_scene")),label:R_.value},null,8,["label"]),[[jt,1]])]),_:1},8,["options"])):Je("",!0),Ee("div",{class:Q(Ae.$style["beta-tag"])},"Beta",2),Ke((j(),ce("span",QCe,[tt(wt(Ot.value),1)])),[[U(a),st.value||""]])]}),"header-actions":me(()=>[ge(U(Gve),{"onUpdate:assignees":kd,onApplyFilter:Ad,loading:U(Ue),entityId:h.entityId},null,8,["loading","entityId"]),Ke(ge(U(iS),{focusIndex:"4",modelValue:w.value,"onUpdate:modelValue":Ye[2]||(Ye[2]=sn=>w.value=sn),onSearch:U(ze),class:Q(Ae.$style.itemSearchBox),onClear:Ye[3]||(Ye[3]=sn=>U(ze)("")),id:"item_search_box",ref_key:"searchBoxRef",ref:_},null,8,["modelValue","onSearch","class"]),[[U(n),{isLoading:U(Ue),fullwidth:!0}]]),Ke((j(),qe(U($A),{status:U(M)?"busy":"active",size:10,id:"refresh_table","status-tooltip":"Data has changed, please refresh the table",color:"var(--warning-color)","show-badge":x.value},{default:me(()=>[Ke((j(),qe(U(mt),{variant:["secondary","icon"],disabled:U(M),onClick:yt},{default:me(()=>[ge(U(lt),{src:"ArrowsRotate"})]),_:1},8,["disabled"])),[[jt,5],[U(a),"Refresh"]])]),_:1},8,["status","show-badge"])),[[U(n),{isLoading:U(Ue),fullwidth:!0}]]),Ke(ge(U(Hme),{"model-value":U(k),onChange:Ye[4]||(Ye[4]=sn=>Od(sn)),id:"table_customization",gridApi:g.value,ref_key:"tableCustomizationRef",ref:q,"checkbox-column":U(O),tableHeight:c.value},null,8,["model-value","gridApi","checkbox-column","tableHeight"]),[[U(n),{isLoading:U(Ue),fullwidth:!0}]])]),grid:me(({availableHeight:sn})=>[ge(U(VCe),nn({id:"item_table_main",ref_key:"agGrid",ref:G},At.value,{height:sn+"px",isSorting:U(de),onOnGridReady:pl,onSelectionChanged:Ui}),null,16,["height","isSorting"])]),footer:me(()=>[Ee("div",{class:Q(Ae.$style.tableFooter),id:"table_footer"},[Ee("span",null,[Ye[5]||(Ye[5]=tt(" Showing ",-1)),Ee("b",null,wt(U(S).loaded)+" of "+wt(U(S).total),1)])],2)]),"new-row":me(()=>[ge(U(yve),{ref_key:"createNewSceneRef",ref:Wt,onSearchForCode:va,onFocusOnId:gl},null,512)]),"bulk-update-actions":me(()=>[!b.value&&v.value.length>0?Ke((j(),qe(U(rge),{key:0,selectRowData:Se.value,"workspace-id":h.workspaceId,"entity-id":h.entityId,"grid-api":g.value,onUnselect:U(Ge),onSelectAll:U(we),"take-name":W.value,"selected-all":re.value,"total-rows":U(S).total,"visible-rows":U(S).loaded,onUpdated:Ve,loading:U(M)},null,8,["selectRowData","workspace-id","entity-id","grid-api","onUnselect","onSelectAll","take-name","selected-all","total-rows","visible-rows","loading"])),[[Do,!b.value&&v.value.length>0]]):Je("",!0)]),snackbar:me(()=>[ge(U(Zge))]),popup:me(()=>[ge(RCe,{ref_key:"popupCreateSceneRef",ref:Jt,"workspace-id":h.workspaceId,"entity-id":h.entityId,onImportSuccess:yt},null,8,["workspace-id","entity-id"]),ge(JCe,{ref_key:"popupOverwriteScenesRef",ref:zt,"workspace-id":h.workspaceId,"entity-id":h.entityId,onImportSuccess:yt},null,8,["workspace-id","entity-id"])]),_:1},8,["is-sidebar-open","onCloseSidebar","onSidebarClear","onSidebarApply"])}}}),[["__cssModules",{$style:{tableTitle:"_tableTitle_1sow5_1",tableFooter:"_tableFooter_1sow5_7",footerStart:"_footerStart_1sow5_17",newRow:"_newRow_1sow5_25","warning-text":"_warning-text_1sow5_43","has-error":"_has-error_1sow5_48",itemSearchBox:"_itemSearchBox_1sow5_52","beta-tag":"_beta-tag_1sow5_56"}}]]),MB="0.1.
|
|
253
|
+
`)});function ps(Ae){var Ye;Ae==="new_scene"?(Ye=Wt.value)==null||Ye.show():Ae==="import_scenes"?je():Ae==="overwrite_scenes"&&Ne()}const Ui=Ae=>{v.value=Ae.api.getSelectedRows().map(Ye=>Ye.id)},pl=Ae=>{const Ye=le(Ae);return Ye&&(Ye.addEventListener("modelUpdated",Ut),Ye.addEventListener("bodyScroll",()=>Ye.stopEditing()),Ye.addEventListener("selectionChanged",Ve),Ye.addEventListener("columnMoved",sn=>J(sn,!0)),Ye.addEventListener("columnResized",sn=>J(sn,!0)),Ye.addEventListener("firstDataRendered",()=>{Ue.value=!1}),!document.querySelector(".ag-body-viewport")),Ye},wo=()=>{var Ae;c.value=(((Ae=document.getElementById("item-table-layout-id"))==null?void 0:Ae.clientHeight)??0)-78+"px"};tn(()=>{Ct(()=>{wo()}),window.addEventListener("resize",wo);function Ae(){requestAnimationFrame(Ae)}Ae()}),vs(()=>{window.removeEventListener("resize",wo)});const va=async({code:Ae,name:Ye})=>{await ze(Ae),setTimeout(()=>{var jt;(jt=_.value)==null||jt.setValue(Ye)},300)},gl=Ae=>{if(!g.value)return;const Ye=g.value.getRowNode(Ae);Ye?(g.value.ensureIndexVisible(Number(Ye.rowIndex),"middle"),g.value.flashCells({rowNodes:[Ye],flashDuration:3e3,fadeDuration:1e3})):g.value.ensureIndexVisible(S.value.total-1,"bottom")},Ir=Ae=>Ae.metric_type.code==="number"?"number":"default",xr=async()=>{if(h.entityId)try{const Ae=await ie(h.entityId);T.value=Ae.data.map(Ye=>({...Ye,sortType:Ir(Ye)}))}catch(Ae){console.error("Failed to initialize metric list:",Ae),T.value=[]}},pi=async()=>{if(F.value)try{const Ae=await F.value.getUserPermission(h.workspaceId);o(Ae)}catch(Ae){console.error("Failed to fetch user permissions:",Ae)}},Fr=async()=>{if(F.value)try{const Ae=await F.value.getEntityDetail(h.workspaceId,h.entityId);i(Ae.permission),l.value=Ae}catch(Ae){console.error("Failed to fetch entity details:",Ae)}},Au=my(),{setUser:kn}=Au,gs=async()=>{if(F.value)try{const Ae=await F.value.getMe();return kn(Ae),Ae}catch(Ae){console.error("Failed to fetch user details:",Ae)}},__=async()=>{var Ae;if(F.value)try{const Ye=await F.value.getWorkspaces(h.workspaceId),jt=(Ae=Ye.data[0])==null?void 0:Ae.ws_user_role_id;return jt&&Au.setUserRoleId(jt),Ye}catch(Ye){console.error("Failed to fetch workspace details:",Ye)}};nt(()=>[h.entityId,h.workspaceId],async([Ae,Ye])=>{!Ae||!Ye||(gs(),__(),xr(),pi(),Fr())},{immediate:!0,deep:!0}),nt(N,(Ae,Ye)=>{const jt=Ae.filter(sn=>!(Ye!=null&&Ye.includes(sn)));jt.length>0&&ae(Array.from(P.value),jt).then(sn=>{X(sn,P.value,jt)})},{immediate:!0,deep:!0}),nt(I,(Ae,Ye)=>{x.value=!!(Ye&&Ae&&Ye!==Ae)}),t({refreshTable:yt});const Ad=Ae=>{ke.value=Ae,yt()},kd=Ae=>{Le.value=Ae,yt()},Od=Ae=>{k.value=Ae||[],J({},!0)},R_=Y(()=>{var sn;const Ae=_n.getInstance().getItem("ws.terminology"),Ye=Ae?JSON.parse(Ae):null;return`New ${((sn=Ye==null?void 0:Ye.find(Wi=>Wi.code==="scene"))==null?void 0:sn.name)||"Scene"}`});return(Ae,Ye)=>{const jt=Eo("focusable");return j(),qe(U(pge),{"is-sidebar-open":b.value,onCloseSidebar:U(H),onSidebarClear:U(H),ref:"itemTableLayoutRef",id:"item-table-layout-id",onSidebarApply:U(H)},{"header-left":me(()=>{var sn;return[((sn=U(r))==null?void 0:sn.has_create_item_permission)==1?(j(),qe(U(_0),{key:0,variant:["primary"],options:d.value,onSelect:ps,onHandleClick:Ye[1]||(Ye[1]=Wi=>ps("new_scene")),id:"create_scene_dropdown",tabIndex:2},{prefix:me(()=>[Ke(ge(U(mt),{"data-focus-index":"1",id:"create_new_scene",variant:["primary"],onClick:Ye[0]||(Ye[0]=Wi=>ps("new_scene")),label:R_.value},null,8,["label"]),[[jt,1]])]),_:1},8,["options"])):Je("",!0),Ee("div",{class:Q(Ae.$style["beta-tag"])},"Beta",2),Ke((j(),ce("span",QCe,[tt(wt(Ot.value),1)])),[[U(a),st.value||""]])]}),"header-actions":me(()=>[ge(U(Gve),{"onUpdate:assignees":kd,onApplyFilter:Ad,loading:U(Ue),entityId:h.entityId},null,8,["loading","entityId"]),Ke(ge(U(iS),{focusIndex:"4",modelValue:w.value,"onUpdate:modelValue":Ye[2]||(Ye[2]=sn=>w.value=sn),onSearch:U(ze),class:Q(Ae.$style.itemSearchBox),onClear:Ye[3]||(Ye[3]=sn=>U(ze)("")),id:"item_search_box",ref_key:"searchBoxRef",ref:_},null,8,["modelValue","onSearch","class"]),[[U(n),{isLoading:U(Ue),fullwidth:!0}]]),Ke((j(),qe(U($A),{status:U(M)?"busy":"active",size:10,id:"refresh_table","status-tooltip":"Data has changed, please refresh the table",color:"var(--warning-color)","show-badge":x.value},{default:me(()=>[Ke((j(),qe(U(mt),{variant:["secondary","icon"],disabled:U(M),onClick:yt},{default:me(()=>[ge(U(lt),{src:"ArrowsRotate"})]),_:1},8,["disabled"])),[[jt,5],[U(a),"Refresh"]])]),_:1},8,["status","show-badge"])),[[U(n),{isLoading:U(Ue),fullwidth:!0}]]),Ke(ge(U(Hme),{"model-value":U(k),onChange:Ye[4]||(Ye[4]=sn=>Od(sn)),id:"table_customization",gridApi:g.value,ref_key:"tableCustomizationRef",ref:q,"checkbox-column":U(O),tableHeight:c.value},null,8,["model-value","gridApi","checkbox-column","tableHeight"]),[[U(n),{isLoading:U(Ue),fullwidth:!0}]])]),grid:me(({availableHeight:sn})=>[ge(U(VCe),nn({id:"item_table_main",ref_key:"agGrid",ref:G},At.value,{height:sn+"px",isSorting:U(de),onOnGridReady:pl,onSelectionChanged:Ui}),null,16,["height","isSorting"])]),footer:me(()=>[Ee("div",{class:Q(Ae.$style.tableFooter),id:"table_footer"},[Ee("span",null,[Ye[5]||(Ye[5]=tt(" Showing ",-1)),Ee("b",null,wt(U(S).loaded)+" of "+wt(U(S).total),1)])],2)]),"new-row":me(()=>[ge(U(yve),{ref_key:"createNewSceneRef",ref:Wt,onSearchForCode:va,onFocusOnId:gl},null,512)]),"bulk-update-actions":me(()=>[!b.value&&v.value.length>0?Ke((j(),qe(U(rge),{key:0,selectRowData:Se.value,"workspace-id":h.workspaceId,"entity-id":h.entityId,"grid-api":g.value,onUnselect:U(Ge),onSelectAll:U(we),"take-name":W.value,"selected-all":re.value,"total-rows":U(S).total,"visible-rows":U(S).loaded,onUpdated:Ve,loading:U(M)},null,8,["selectRowData","workspace-id","entity-id","grid-api","onUnselect","onSelectAll","take-name","selected-all","total-rows","visible-rows","loading"])),[[Do,!b.value&&v.value.length>0]]):Je("",!0)]),snackbar:me(()=>[ge(U(Zge))]),popup:me(()=>[ge(RCe,{ref_key:"popupCreateSceneRef",ref:Jt,"workspace-id":h.workspaceId,"entity-id":h.entityId,onImportSuccess:yt},null,8,["workspace-id","entity-id"]),ge(JCe,{ref_key:"popupOverwriteScenesRef",ref:zt,"workspace-id":h.workspaceId,"entity-id":h.entityId,onImportSuccess:yt},null,8,["workspace-id","entity-id"])]),_:1},8,["is-sidebar-open","onCloseSidebar","onSidebarClear","onSidebarApply"])}}}),[["__cssModules",{$style:{tableTitle:"_tableTitle_1sow5_1",tableFooter:"_tableFooter_1sow5_7",footerStart:"_footerStart_1sow5_17",newRow:"_newRow_1sow5_25","warning-text":"_warning-text_1sow5_43","has-error":"_has-error_1sow5_48",itemSearchBox:"_itemSearchBox_1sow5_52","beta-tag":"_beta-tag_1sow5_56"}}]]),MB="0.1.95",tbe={key:0},nbe=_t(rt({__name:"app",setup(e){const t=Y(()=>n.id.length===0||n.workspaceId.length===0),n=So({id:"",workspaceId:"",apiConfig:{}}),s=Qf(),{showMessage:o,showErrorNetMessage:i}=s,r=["basicInfor"],a=h=>{h.success?o(h.apiCode,"success"):r.includes(h.apiCode)||i(h)},l=B(null),u=()=>{const h=_n.getInstance().getItem("API_BASE_URL");return h!=null&&h.includes("v1")?h.slice(0,h.lastIndexOf("/v1")):String(h)};eh(()=>{var h,f,p;sessionStorage.setItem("ITEM_TABLE_APP_VERSION",MB);try{if(l.value=Yn(),!l.value)throw new Error("Current instance is null");n.id=((h=l.value)==null?void 0:h.appContext.config.globalProperties.id)||"",n.workspaceId=((f=l.value)==null?void 0:f.appContext.config.globalProperties.workspaceId)||_n.getInstance().getItem("ws.code");const g={domainApi:u(),wsCode:_n.getInstance().getItem("ws.code"),entityId:n.id};if(n.apiConfig=(p=l.value)==null?void 0:p.appContext.config.globalProperties.apiConfig,!g.entityId||!g.wsCode||!g.domainApi)throw new Error("API configuration is missing in dashboardConfig");const v=new Lk(n.apiConfig,g);v.on("call-api",a),l.value.appContext.config.globalProperties.apiServices=v}catch(g){console.error("Error getting current instance:",g)}}),vs(()=>{l.value.appContext.config.globalProperties.apiServices.off("call-api",a)});const c=Y(()=>n.id),d=Y(()=>n.workspaceId);return Zi("workspaceId",d),Zi("entityId",c),(h,f)=>(j(),ce("div",{class:Q(h.$style.dashboardPluginWrapper)},[t.value?(j(),ce("span",tbe," There is no workspaceId or entityIds provided in global properties. Please set them to see the Item Table. ")):c.value?(j(),qe(U(ebe),{key:1,entityId:c.value,workspaceId:d.value},null,8,["entityId","workspaceId"])):Je("",!0)],2))}}),[["__cssModules",{$style:{dashboardPluginWrapper:"_dashboardPluginWrapper_1f1og_1"}}]]),E_=async(e={},t={})=>{const n=RT(nbe),s=lY();n.use(s);const o=["apiConfig","workspaceId","id"],i={};Object.entries(e).forEach(([a,l])=>{l!==void 0&&(n.config.globalProperties[a]=l,i[a]=l,o.includes(a)&&typeof l=="string"?sessionStorage.setItem(a,l):console.error(`[Config Error] Key "${a}" has an invalid value and will not be persisted.`))}),n.config.globalProperties.$arboConfig=i,Object.values(t).forEach(a=>{a&&typeof a.install=="function"&&n.use(a)}),n.config.errorHandler=(a,l,u)=>{console.error("[Vue Error]",a),u&&console.error("[Info]",u)},console.log(`%cArbo Dashboard Plugin v${MB}`,"color: #4CAF50; font-weight: bold;"),console.log(n.config.globalProperties),globalThis.window.$switchInstance=n.config.globalProperties.switchInstance,n.provide("switchInstance",n.config.globalProperties.switchInstance),n.directive("tooltip",Xt),n.directive("focusable",Ur);const r=await SCe();return n.use(r),n};globalThis.window!==void 0&&(globalThis.window.arboDashboard=E_),On.default=E_,On.initDashboard=E_,Object.defineProperties(On,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
|