semaphor 0.0.30 → 0.0.31
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/react-semaphor.js
CHANGED
|
@@ -10495,9 +10495,8 @@ const qa = /* @__PURE__ */ Nd(Ru), pC = ["lg", "md", "sm", "xs", "xxs"], be = NP
|
|
|
10495
10495
|
minW: 6,
|
|
10496
10496
|
minH: 2
|
|
10497
10497
|
};
|
|
10498
|
-
(c = o.layout) == null || c.push(f), pC.forEach((g) => {
|
|
10499
|
-
|
|
10500
|
-
(m = (p = o.layouts) == null ? void 0 : p[g]) == null || m.push(f);
|
|
10498
|
+
(c = o.layout) == null || c.push(f), o != null && o.layouts || (o.layouts = {}), pC.forEach((g) => {
|
|
10499
|
+
o.layouts[g] || (o.layouts[g] = []), o.layouts[g].push(f);
|
|
10501
10500
|
}), (d = i.onAddFrame) == null || d.call(i, r, n);
|
|
10502
10501
|
}
|
|
10503
10502
|
});
|
|
@@ -82,7 +82,7 @@ __p += '`),Et&&(Se+=`' +
|
|
|
82
82
|
function print() { __p += __j.call(arguments, '') }
|
|
83
83
|
`:`;
|
|
84
84
|
`)+Se+`return __p
|
|
85
|
-
}`;var mt=wN(function(){return Tt(L,ze+"return "+Se).apply(n,z)});if(mt.source=Se,B1(mt))throw mt;return mt}function tde(u){return Lt(u).toLowerCase()}function nde(u){return Lt(u).toUpperCase()}function rde(u,h,b){if(u=Lt(u),u&&(b||h===n))return MA(u);if(!u||!(h=Ur(h)))return u;var E=ki(u),T=ki(h),L=TA(E,T),z=AA(E,T)+1;return Rs(E,L,z).join("")}function ide(u,h,b){if(u=Lt(u),u&&(b||h===n))return u.slice(0,NA(u)+1);if(!u||!(h=Ur(h)))return u;var E=ki(u),T=AA(E,ki(h))+1;return Rs(E,0,T).join("")}function ode(u,h,b){if(u=Lt(u),u&&(b||h===n))return u.replace(Ka,"");if(!u||!(h=Ur(h)))return u;var E=ki(u),T=TA(E,ki(h));return Rs(E,T).join("")}function sde(u,h){var b=j,E=B;if(un(h)){var T="separator"in h?h.separator:T;b="length"in h?ft(h.length):b,E="omission"in h?Ur(h.omission):E}u=Lt(u);var L=u.length;if(Sc(u)){var z=ki(u);L=z.length}if(b>=L)return u;var W=b-Cc(E);if(W<1)return E;var ee=z?Rs(z,0,W).join(""):u.slice(0,W);if(T===n)return ee+E;if(z&&(W+=ee.length-W),V1(T)){if(u.slice(W).search(T)){var be,xe=ee;for(T.global||(T=i1(T.source,Lt(Be.exec(T))+"g")),T.lastIndex=0;be=T.exec(xe);)var Se=be.index;ee=ee.slice(0,Se===n?W:Se)}}else if(u.indexOf(Ur(T),W)!=W){var Te=ee.lastIndexOf(T);Te>-1&&(ee=ee.slice(0,Te))}return ee+E}function ade(u){return u=Lt(u),u&&Ao.test(u)?u.replace(Yn,Loe):u}var lde=Tc(function(u,h,b){return u+(b?" ":"")+h.toUpperCase()}),U1=_I("toUpperCase");function xN(u,h,b){return u=Lt(u),h=b?n:h,h===n?Toe(u)?joe(u):_oe(u):u.match(h)||[]}var wN=vt(function(u,h){try{return Hr(u,n,h)}catch(b){return B1(b)?b:new nt(b)}}),cde=Fo(function(u,h){return ci(h,function(b){b=io(b),Ro(u,b,j1(u[b],u))}),u});function ude(u){var h=u==null?0:u.length,b=Ge();return u=h?sn(u,function(E){if(typeof E[1]!="function")throw new ui(s);return[b(E[0]),E[1]]}):[],vt(function(E){for(var T=-1;++T<h;){var L=u[T];if(Hr(L[0],this,E))return Hr(L[1],this,E)}})}function dde(u){return Lse(fi(u,f))}function q1(u){return function(){return u}}function fde(u,h){return u==null||u!==u?h:u}var hde=CI(),pde=CI(!0);function wr(u){return u}function G1(u){return eI(typeof u=="function"?u:fi(u,f))}function gde(u){return nI(fi(u,f))}function mde(u,h){return rI(u,fi(h,f))}var vde=vt(function(u,h){return function(b){return Xd(b,u,h)}}),bde=vt(function(u,h){return function(b){return Xd(u,b,h)}});function Y1(u,h,b){var E=An(h),T=jg(h,E);b==null&&!(un(h)&&(T.length||!E.length))&&(b=h,h=u,u=this,T=jg(h,An(h)));var L=!(un(b)&&"chain"in b)||!!b.chain,z=jo(u);return ci(T,function(W){var ee=h[W];u[W]=ee,z&&(u.prototype[W]=function(){var be=this.__chain__;if(L||be){var xe=u(this.__wrapped__),Se=xe.__actions__=br(this.__actions__);return Se.push({func:ee,args:arguments,thisArg:u}),xe.__chain__=be,xe}return ee.apply(u,Ds([this.value()],arguments))})}),u}function yde(){return zn._===this&&(zn._=Uoe),this}function K1(){}function xde(u){return u=ft(u),vt(function(h){return iI(h,u)})}var wde=O1(sn),_de=O1(EA),Sde=O1(Qx);function _N(u){return I1(u)?Zx(io(u)):Jse(u)}function Cde(u){return function(h){return u==null?n:nl(u,h)}}var Ede=OI(),Ode=OI(!0);function X1(){return[]}function Q1(){return!1}function Pde(){return{}}function kde(){return""}function Dde(){return!0}function Mde(u,h){if(u=ft(u),u<1||u>X)return[];var b=H,E=Kn(u,H);h=Ge(h),u-=H;for(var T=t1(E,h);++b<u;)h(b);return T}function Tde(u){return at(u)?sn(u,io):qr(u)?[u]:br(VI(Lt(u)))}function Ade(u){var h=++Hoe;return Lt(u)+h}var Ide=Ug(function(u,h){return u+h},0),Nde=P1("ceil"),Rde=Ug(function(u,h){return u/h},1),Lde=P1("floor");function Fde(u){return u&&u.length?$g(u,wr,f1):n}function $de(u,h){return u&&u.length?$g(u,Ge(h,2),f1):n}function jde(u){return kA(u,wr)}function zde(u,h){return kA(u,Ge(h,2))}function Bde(u){return u&&u.length?$g(u,wr,m1):n}function Vde(u,h){return u&&u.length?$g(u,Ge(h,2),m1):n}var Hde=Ug(function(u,h){return u*h},1),Wde=P1("round"),Ude=Ug(function(u,h){return u-h},0);function qde(u){return u&&u.length?e1(u,wr):0}function Gde(u,h){return u&&u.length?e1(u,Ge(h,2)):0}return I.after=gce,I.ary=JI,I.assign=nue,I.assignIn=hN,I.assignInWith=im,I.assignWith=rue,I.at=iue,I.before=eN,I.bind=j1,I.bindAll=cde,I.bindKey=tN,I.castArray=Pce,I.chain=XI,I.chunk=Lae,I.compact=Fae,I.concat=$ae,I.cond=ude,I.conforms=dde,I.constant=q1,I.countBy=qle,I.create=oue,I.curry=nN,I.curryRight=rN,I.debounce=iN,I.defaults=sue,I.defaultsDeep=aue,I.defer=mce,I.delay=vce,I.difference=jae,I.differenceBy=zae,I.differenceWith=Bae,I.drop=Vae,I.dropRight=Hae,I.dropRightWhile=Wae,I.dropWhile=Uae,I.fill=qae,I.filter=Yle,I.flatMap=Qle,I.flatMapDeep=Zle,I.flatMapDepth=Jle,I.flatten=qI,I.flattenDeep=Gae,I.flattenDepth=Yae,I.flip=bce,I.flow=hde,I.flowRight=pde,I.fromPairs=Kae,I.functions=pue,I.functionsIn=gue,I.groupBy=ece,I.initial=Qae,I.intersection=Zae,I.intersectionBy=Jae,I.intersectionWith=ele,I.invert=vue,I.invertBy=bue,I.invokeMap=nce,I.iteratee=G1,I.keyBy=rce,I.keys=An,I.keysIn=xr,I.map=Zg,I.mapKeys=xue,I.mapValues=wue,I.matches=gde,I.matchesProperty=mde,I.memoize=em,I.merge=_ue,I.mergeWith=pN,I.method=vde,I.methodOf=bde,I.mixin=Y1,I.negate=tm,I.nthArg=xde,I.omit=Sue,I.omitBy=Cue,I.once=yce,I.orderBy=ice,I.over=wde,I.overArgs=xce,I.overEvery=_de,I.overSome=Sde,I.partial=z1,I.partialRight=oN,I.partition=oce,I.pick=Eue,I.pickBy=gN,I.property=_N,I.propertyOf=Cde,I.pull=ile,I.pullAll=YI,I.pullAllBy=ole,I.pullAllWith=sle,I.pullAt=ale,I.range=Ede,I.rangeRight=Ode,I.rearg=wce,I.reject=lce,I.remove=lle,I.rest=_ce,I.reverse=F1,I.sampleSize=uce,I.set=Pue,I.setWith=kue,I.shuffle=dce,I.slice=cle,I.sortBy=pce,I.sortedUniq=mle,I.sortedUniqBy=vle,I.split=Que,I.spread=Sce,I.tail=ble,I.take=yle,I.takeRight=xle,I.takeRightWhile=wle,I.takeWhile=_le,I.tap=Fle,I.throttle=Cce,I.thru=Qg,I.toArray=uN,I.toPairs=mN,I.toPairsIn=vN,I.toPath=Tde,I.toPlainObject=fN,I.transform=Due,I.unary=Ece,I.union=Sle,I.unionBy=Cle,I.unionWith=Ele,I.uniq=Ole,I.uniqBy=Ple,I.uniqWith=kle,I.unset=Mue,I.unzip=$1,I.unzipWith=KI,I.update=Tue,I.updateWith=Aue,I.values=Nc,I.valuesIn=Iue,I.without=Dle,I.words=xN,I.wrap=Oce,I.xor=Mle,I.xorBy=Tle,I.xorWith=Ale,I.zip=Ile,I.zipObject=Nle,I.zipObjectDeep=Rle,I.zipWith=Lle,I.entries=mN,I.entriesIn=vN,I.extend=hN,I.extendWith=im,Y1(I,I),I.add=Ide,I.attempt=wN,I.camelCase=Fue,I.capitalize=bN,I.ceil=Nde,I.clamp=Nue,I.clone=kce,I.cloneDeep=Mce,I.cloneDeepWith=Tce,I.cloneWith=Dce,I.conformsTo=Ace,I.deburr=yN,I.defaultTo=fde,I.divide=Rde,I.endsWith=$ue,I.eq=Mi,I.escape=jue,I.escapeRegExp=zue,I.every=Gle,I.find=Kle,I.findIndex=WI,I.findKey=lue,I.findLast=Xle,I.findLastIndex=UI,I.findLastKey=cue,I.floor=Lde,I.forEach=QI,I.forEachRight=ZI,I.forIn=uue,I.forInRight=due,I.forOwn=fue,I.forOwnRight=hue,I.get=H1,I.gt=Ice,I.gte=Nce,I.has=mue,I.hasIn=W1,I.head=GI,I.identity=wr,I.includes=tce,I.indexOf=Xae,I.inRange=Rue,I.invoke=yue,I.isArguments=ol,I.isArray=at,I.isArrayBuffer=Rce,I.isArrayLike=yr,I.isArrayLikeObject=vn,I.isBoolean=Lce,I.isBuffer=Ls,I.isDate=Fce,I.isElement=$ce,I.isEmpty=jce,I.isEqual=zce,I.isEqualWith=Bce,I.isError=B1,I.isFinite=Vce,I.isFunction=jo,I.isInteger=sN,I.isLength=nm,I.isMap=aN,I.isMatch=Hce,I.isMatchWith=Wce,I.isNaN=Uce,I.isNative=qce,I.isNil=Yce,I.isNull=Gce,I.isNumber=lN,I.isObject=un,I.isObjectLike=hn,I.isPlainObject=nf,I.isRegExp=V1,I.isSafeInteger=Kce,I.isSet=cN,I.isString=rm,I.isSymbol=qr,I.isTypedArray=Ic,I.isUndefined=Xce,I.isWeakMap=Qce,I.isWeakSet=Zce,I.join=tle,I.kebabCase=Bue,I.last=pi,I.lastIndexOf=nle,I.lowerCase=Vue,I.lowerFirst=Hue,I.lt=Jce,I.lte=eue,I.max=Fde,I.maxBy=$de,I.mean=jde,I.meanBy=zde,I.min=Bde,I.minBy=Vde,I.stubArray=X1,I.stubFalse=Q1,I.stubObject=Pde,I.stubString=kde,I.stubTrue=Dde,I.multiply=Hde,I.nth=rle,I.noConflict=yde,I.noop=K1,I.now=Jg,I.pad=Wue,I.padEnd=Uue,I.padStart=que,I.parseInt=Gue,I.random=Lue,I.reduce=sce,I.reduceRight=ace,I.repeat=Yue,I.replace=Kue,I.result=Oue,I.round=Wde,I.runInContext=K,I.sample=cce,I.size=fce,I.snakeCase=Xue,I.some=hce,I.sortedIndex=ule,I.sortedIndexBy=dle,I.sortedIndexOf=fle,I.sortedLastIndex=hle,I.sortedLastIndexBy=ple,I.sortedLastIndexOf=gle,I.startCase=Zue,I.startsWith=Jue,I.subtract=Ude,I.sum=qde,I.sumBy=Gde,I.template=ede,I.times=Mde,I.toFinite=zo,I.toInteger=ft,I.toLength=dN,I.toLower=tde,I.toNumber=gi,I.toSafeInteger=tue,I.toString=Lt,I.toUpper=nde,I.trim=rde,I.trimEnd=ide,I.trimStart=ode,I.truncate=sde,I.unescape=ade,I.uniqueId=Ade,I.upperCase=lde,I.upperFirst=U1,I.each=QI,I.eachRight=ZI,I.first=GI,Y1(I,function(){var u={};return no(I,function(h,b){jt.call(I.prototype,b)||(u[b]=h)}),u}(),{chain:!1}),I.VERSION=r,ci(["bind","bindKey","curry","curryRight","partial","partialRight"],function(u){I[u].placeholder=I}),ci(["drop","take"],function(u,h){Ct.prototype[u]=function(b){b=b===n?1:Pn(ft(b),0);var E=this.__filtered__&&!h?new Ct(this):this.clone();return E.__filtered__?E.__takeCount__=Kn(b,E.__takeCount__):E.__views__.push({size:Kn(b,H),type:u+(E.__dir__<0?"Right":"")}),E},Ct.prototype[u+"Right"]=function(b){return this.reverse()[u](b).reverse()}}),ci(["filter","map","takeWhile"],function(u,h){var b=h+1,E=b==te||b==Z;Ct.prototype[u]=function(T){var L=this.clone();return L.__iteratees__.push({iteratee:Ge(T,3),type:b}),L.__filtered__=L.__filtered__||E,L}}),ci(["head","last"],function(u,h){var b="take"+(h?"Right":"");Ct.prototype[u]=function(){return this[b](1).value()[0]}}),ci(["initial","tail"],function(u,h){var b="drop"+(h?"":"Right");Ct.prototype[u]=function(){return this.__filtered__?new Ct(this):this[b](1)}}),Ct.prototype.compact=function(){return this.filter(wr)},Ct.prototype.find=function(u){return this.filter(u).head()},Ct.prototype.findLast=function(u){return this.reverse().find(u)},Ct.prototype.invokeMap=vt(function(u,h){return typeof u=="function"?new Ct(this):this.map(function(b){return Xd(b,u,h)})}),Ct.prototype.reject=function(u){return this.filter(tm(Ge(u)))},Ct.prototype.slice=function(u,h){u=ft(u);var b=this;return b.__filtered__&&(u>0||h<0)?new Ct(b):(u<0?b=b.takeRight(-u):u&&(b=b.drop(u)),h!==n&&(h=ft(h),b=h<0?b.dropRight(-h):b.take(h-u)),b)},Ct.prototype.takeRightWhile=function(u){return this.reverse().takeWhile(u).reverse()},Ct.prototype.toArray=function(){return this.take(H)},no(Ct.prototype,function(u,h){var b=/^(?:filter|find|map|reject)|While$/.test(h),E=/^(?:head|last)$/.test(h),T=I[E?"take"+(h=="last"?"Right":""):h],L=E||/^find/.test(h);T&&(I.prototype[h]=function(){var z=this.__wrapped__,W=E?[1]:arguments,ee=z instanceof Ct,be=W[0],xe=ee||at(z),Se=function(St){var Et=T.apply(I,Ds([St],W));return E&&Te?Et[0]:Et};xe&&b&&typeof be=="function"&&be.length!=1&&(ee=xe=!1);var Te=this.__chain__,ze=!!this.__actions__.length,Ye=L&&!Te,mt=ee&&!ze;if(!L&&xe){z=mt?z:new Ct(this);var Ke=u.apply(z,W);return Ke.__actions__.push({func:Qg,args:[Se],thisArg:n}),new di(Ke,Te)}return Ye&&mt?u.apply(this,W):(Ke=this.thru(Se),Ye?E?Ke.value()[0]:Ke.value():Ke)})}),ci(["pop","push","shift","sort","splice","unshift"],function(u){var h=Sg[u],b=/^(?:push|sort|unshift)$/.test(u)?"tap":"thru",E=/^(?:pop|shift)$/.test(u);I.prototype[u]=function(){var T=arguments;if(E&&!this.__chain__){var L=this.value();return h.apply(at(L)?L:[],T)}return this[b](function(z){return h.apply(at(z)?z:[],T)})}}),no(Ct.prototype,function(u,h){var b=I[h];if(b){var E=b.name+"";jt.call(kc,E)||(kc[E]=[]),kc[E].push({name:h,func:b})}}),kc[Wg(n,w).name]=[{name:"wrapper",func:n}],Ct.prototype.clone=ase,Ct.prototype.reverse=lse,Ct.prototype.value=cse,I.prototype.at=$le,I.prototype.chain=jle,I.prototype.commit=zle,I.prototype.next=Ble,I.prototype.plant=Hle,I.prototype.reverse=Wle,I.prototype.toJSON=I.prototype.valueOf=I.prototype.value=Ule,I.prototype.first=I.prototype.head,Hd&&(I.prototype[Hd]=Vle),I},Ec=zoe();Qa?((Qa.exports=Ec)._=Ec,Gx._=Ec):zn._=Ec}).call(Ho)}(xf,xf.exports);var Gc=xf.exports;const Hs=Rc(Gc),u_=["lg","md","sm","xs","xxs"],ge=Ow()($w((e,t)=>({currentBreakpoint:"lg",dashboard:{id:"",style:km},showContext:!1,selectedSheetId:null,selectedCardId:null,selectedFrameId:null,selectedCard:null,showFilters:!1,isDashboardEditing:!1,isVisualEditing:!1,showDashboardJSON:!1,filteringCards:[],actions:{setCurrentBreakpoint:n=>{e(()=>({currentBreakpoint:n}))},addFilteringCard:n=>{e(r=>{var i;(i=r.filteringCards)==null||i.push(n)})},removeFilteringCard:n=>{e(r=>{var o,s;const i=(o=r.filteringCards)==null?void 0:o.findIndex(a=>a.id===n.id);i!==void 0&&i>-1&&((s=r.filteringCards)==null||s.splice(i,1))})},setCustomCards:n=>{e(r=>{r.dashboard.customCards=n})},setAuthToken:n=>{e(()=>({authToken:n}))},setThemeStyle:n=>{e(()=>({themeStyle:n}))},setDashboard:n=>e({dashboard:n}),setBookmarkKey:n=>{e(()=>({bookmarkKey:n}))},setDashboardTheme:n=>{e(r=>{r.theme=n})},setSheets:n=>{e(r=>{r.dashboard&&(r.dashboard.sheets=n)})},setCardTitle:(n,r,i)=>{e(o=>{var a,l;const s=(l=(a=o.dashboard)==null?void 0:a.sheets)==null?void 0:l.find(c=>c.id===n);s&&Gc.forEach(s.frames,c=>{var f;const d=(f=c.cards)==null?void 0:f.find(g=>g.id===r);d&&(d.title=i)})})},setCardInfo:(n,r)=>{e(i=>{var s,a;const o=(a=(s=i.dashboard)==null?void 0:s.sheets)==null?void 0:a.find(l=>l.id===i.selectedSheetId);o&&Gc.forEach(o.frames,l=>{var d;const c=(d=l.cards)==null?void 0:d.find(f=>f.id===n);c&&(c.info=r)})})},setCardDescription:(n,r,i)=>{e(o=>{var a,l;const s=(l=(a=o.dashboard)==null?void 0:a.sheets)==null?void 0:l.find(c=>c.id===n);s&&Gc.forEach(s.frames,c=>{var f;const d=(f=c.cards)==null?void 0:f.find(g=>g.id===r);d&&(d.description=i)})})},setCardSql:(n,r,i)=>{e(o=>{var a,l,c,d;const s=(l=(a=o.dashboard)==null?void 0:a.sheets)==null?void 0:l.find(f=>f.id===n);if(s){const f=(c=s.cards)==null?void 0:c.find(g=>g.id===r);f&&(f.sql=i,(d=o.onUpdateCard)==null||d.call(o,f,n))}})},setFrameCardData:(n,r,i)=>{e(o=>{var a,l;const s=(l=(a=o.dashboard)==null?void 0:a.sheets)==null?void 0:l.find(c=>c.id===n);s&&Gc.forEach(s.frames,c=>{var f;const d=(f=c.cards)==null?void 0:f.find(g=>g.id===r);d&&(d.data=i)})})},setSheetLayout:(n,r)=>{e(i=>{var s,a;const o=(a=(s=i.dashboard)==null?void 0:s.sheets)==null?void 0:a.find(l=>l.id===n);o&&(o.layout=r)})},setSheetLayouts:(n,r)=>{e(i=>{var s,a;const o=(a=(s=i.dashboard)==null?void 0:s.sheets)==null?void 0:a.find(l=>l.id===n);o&&(o.layouts=r)})},setShowContext:n=>{e(()=>({showContext:n}))},setShowFilters:n=>{e(()=>({showFilters:n}))},setFilterValues:n=>{e(()=>({filterValues:n}))},addOrUpdateFilterValue:n=>{e(r=>{if(r.filterValues){const i=r.filterValues.findIndex(o=>o.filterId===n.filterId);i>-1?r.filterValues.splice(i,1,n):r.filterValues.push(n)}else r.filterValues=[n]})},removeFilterValue:n=>{e(r=>{if(r.filterValues){const i=r.filterValues.findIndex(o=>o.filterId===n);i>-1&&r.filterValues.splice(i,1)}})},replaceFilterValue:n=>{e(r=>{if(r.filterValues){const i=r.filterValues.findIndex(o=>o.filterId===n.filterId);i>-1&&r.filterValues.splice(i,1,n)}})},addFilter:n=>{e(r=>{var i;r.dashboard.filters?(i=r.dashboard.filters)==null||i.push(n):r.dashboard.filters=[n]})},removeFilter:n=>{e(r=>{var i,o;if(r.dashboard.filters){const s=(i=r.dashboard.filters)==null?void 0:i.findIndex(a=>a.id===n);console.log("index",s),s>-1&&((o=r.dashboard.filters)==null||o.splice(s,1))}})},updateFrameCard:(n,r,i)=>{e(o=>{var l,c,d,f,g;const s=(c=(l=o.dashboard)==null?void 0:l.sheets)==null?void 0:c.find(p=>p.id===n);if(!s)return;const a=(d=s==null?void 0:s.frames)==null?void 0:d.find(p=>p.id===r);if(a){const p=(f=a.cards)==null?void 0:f.findIndex(v=>v.id===i.id);p>-1&&((g=a.cards)==null||g.splice(p,1,i))}})},updateFilter:n=>{e(r=>{var i,o;if(r.dashboard.filters){const s=(i=r.dashboard.filters)==null?void 0:i.findIndex(a=>a.id===n.id);s>-1&&((o=r.dashboard.filters)==null||o.splice(s,1,n))}})},setIsDashboardEditing:n=>{e(()=>({isDashboardEditing:n}))},setShowDashboardJSON:n=>{e(()=>({showDashboardJSON:n}))},setIsVisualEditing:n=>{e(()=>({isVisualEditing:n}))},addFrame:(n,r)=>{e(i=>{var s,a,l,c,d;const o=(a=(s=i.dashboard)==null?void 0:s.sheets)==null?void 0:a.find(f=>f.id===n);if(o){o.frames||(o.frames=[]),(l=o.frames)==null||l.push(r);const f={i:r.id,x:0,y:1/0,w:20,h:7,minW:6,minH:2};(c=o.layout)==null||c.push(f),u_.forEach(g=>{var p,v;(v=(p=o.layouts)==null?void 0:p[g])==null||v.push(f)}),(d=i.onAddFrame)==null||d.call(i,r,n)}})},removeFrame:(n,r)=>{e(i=>{var s,a,l,c,d;const o=(a=(s=i.dashboard)==null?void 0:s.sheets)==null?void 0:a.find(f=>f.id===n);if(o){const f=(l=o.frames)==null?void 0:l.findIndex(g=>g.id===r);console.log(f),typeof f=="number"&&f>-1&&((c=o.frames)==null||c.splice(f,1),(d=o.layout)==null||d.splice(f,1),o.layouts=u_.reduce((g,p)=>{if(g&&g[p]){const v=g[p].findIndex(y=>y.i===r);typeof v=="number"&&v>-1&&g[p].splice(v,1)}return g},o.layouts))}})},updateFrame:(n,r)=>{e(i=>{var a,l,c,d;const o=(l=(a=i.dashboard)==null?void 0:a.sheets)==null?void 0:l.find(f=>f.id===n),s=(c=o==null?void 0:o.frames)==null?void 0:c.findIndex(f=>f.id===r.id);o&&((d=o.frames)==null||d.splice(s,1,r))})},updateCard:(n,r)=>{e(i=>{var a,l,c,d,f;const o=(l=(a=i.dashboard)==null?void 0:a.sheets)==null?void 0:l.find(g=>g.id===n),s=(c=o==null?void 0:o.cards)==null?void 0:c.findIndex(g=>g.id===r.id);o&&((d=o.cards)==null||d.splice(s,1,r),(f=i.onUpdateCard)==null||f.call(i,r,n))})},removeCard:(n,r)=>{e(i=>{var a,l,c,d,f,g;const o=(l=(a=i.dashboard)==null?void 0:a.sheets)==null?void 0:l.find(p=>p.id===n),s=(c=o==null?void 0:o.cards)==null?void 0:c.findIndex(p=>p.id===r.id);o&&((d=o.cards)==null||d.splice(s,1),(f=o.layout)==null||f.splice(s,1),(g=i.onRemoveCard)==null||g.call(i,r,n))})},setStyle:n=>{e(r=>{r.dashboard&&(r.dashboard.style=n)})},setSelectedCardId:(n,r)=>{e(i=>{var s,a,l;const o=(a=(s=i.dashboard)==null?void 0:s.sheets)==null?void 0:a.find(c=>c.id===n);o&&(((l=o.cards)==null?void 0:l.find(d=>d.id===r))?i.selectedCardId=r:i.selectedCardId=null)})},setSelectedFrameId:n=>{e(r=>{var o,s;((s=(o=r.dashboard)==null?void 0:o.sheets)==null?void 0:s.find(a=>a.id===r.selectedSheetId))&&(r.selectedFrameId=n)})},setSelectedSheetId:n=>{e(r=>{var o,s;((s=(o=r.dashboard)==null?void 0:o.sheets)==null?void 0:s.find(a=>a.id===n))&&(r.selectedSheetId=n)})},setOnSaveFunction:n=>{e(()=>({onSaveFunction:n}))},setOnAddCard:n=>{e(()=>({onAddCard:n}))},setOnUpdateCard:n=>{e(()=>({onUpdateCard:n}))},setOnRemoveCard:n=>{e(()=>({onRemoveCard:n}))},setOnEvent:n=>{e(()=>({onEvent:n}))},getDashboard:()=>t().dashboard,getSelectedSheet:()=>{var n,r;return(r=(n=t().dashboard)==null?void 0:n.sheets)==null?void 0:r.find(i=>i.id===t().selectedSheetId)},getSelectedFrame:()=>{var r,i,o;const n=(i=(r=t().dashboard)==null?void 0:r.sheets)==null?void 0:i.find(s=>s.id===t().selectedSheetId);return(o=n==null?void 0:n.frames)==null?void 0:o.find(s=>s.id===t().selectedFrameId)},getCard:n=>{var i,o;const r=(i=t().dashboard)==null?void 0:i.sheets;if(r)for(let s=0;s<r.length;s++){const a=r[s].frames;if(a)for(let l=0;l<a.length;l++){const c=(o=a[l].cards)==null?void 0:o.find(d=>d.id===n);if(c)return c}}},getSelectedSheetLayout:()=>{var r,i;const n=(i=(r=t().dashboard)==null?void 0:r.sheets)==null?void 0:i.find(o=>o.id===t().selectedSheetId);return n==null?void 0:n.layout},getSelectedSheetLayouts:()=>{var r,i;const n=(i=(r=t().dashboard)==null?void 0:r.sheets)==null?void 0:i.find(o=>o.id===t().selectedSheetId);return n==null?void 0:n.layouts},getStyle:()=>{var n;return(n=t().dashboard)==null?void 0:n.style},handleDataPointClickAction:(n,r)=>{w4({card:n,dataPoint:r,set:e,get:t})}}}))),Yc=()=>ge(e=>e.actions);process.env.NODE_ENV==="development"&&zw("DashboardStore",ge);const _4={theme:"system",setTheme:()=>null},d_=m.createContext(_4);function S4({children:e,defaultTheme:t="system",storageKey:n="vite-ui-theme",...r}){const[i,o]=m.useState(()=>localStorage.getItem(n)||t);m.useEffect(()=>{const a=window.document.documentElement;if(a.classList.remove("light","dark"),i==="system"){const l=window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light";a.classList.add(l);return}a.classList.add(i)},[i]);const s={theme:i,setTheme:a=>{localStorage.setItem(n,a),o(a)}};return _.jsx(d_.Provider,{...r,value:s,children:e})}const $m=()=>{const e=m.useContext(d_);if(e===void 0)throw new Error("useTheme must be used within a ThemeProvider");return e};async function C4(e,t,n){return await(await fetch(`https://semaphor.cloud/api/v1/dashboard?id=${e}&version=${t}`,{headers:{Authorization:`Bearer ${n}`}})).json()}function f_(e){return e==="system"?window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light":e}function h_(e,t){const n=f_(e);return n==="dark"?Hs.merge({...t==null?void 0:t.default},{...t==null?void 0:t.dark}):t==null?void 0:t.default}function p_({id:e,version:t,authToken:n,customStyle:r,currentTheme:i,onSave:o,onEvent:s}){const{data:a,refetch:l,isLoading:c,isError:d}=vi({queryKey:[e],queryFn:()=>C4(e,t||"",n==null?void 0:n.accessToken),enabled:!1}),{theme:f,setTheme:g}=$m(),{setDashboard:p,setSelectedSheetId:v,setStyle:y,setOnSaveFunction:x}=ge(M=>M.actions);ge(M=>M.actions.setCustomCards);const w=ge(M=>M.actions.setFilterValues),S=ge(M=>M.actions.setBookmarkKey),C=ge(M=>M.actions.setAuthToken),P=ge(M=>M.actions.setThemeStyle),O=ge(M=>M.actions.setDashboardTheme),k=ge(M=>M.actions.setOnEvent);return m.useEffect(()=>{if(f){const M=f_(f);O(M)}},[f,O]),m.useEffect(()=>{i&&g(i)},[i,g]),m.useEffect(()=>{const M=Hs.cloneDeep(km);if(r){const N=Hs.merge(M,r),F=h_(f,N);P(F),y(N)}else{const N=h_(f,M);P(N),y(km)}},[f,r,y,P]),m.useEffect(()=>{var B;if(!a||!a.dashboard)return;const M=a.dashboard,N=ms(M.id),F=JSON.parse(localStorage.getItem(N)||"[]"),j=F.find(V=>V.default===!0);if(j)p(j.template),S(j.name),j.filterValues&&w(j.filterValues);else{p(M);const V=F.find(G=>(G==null?void 0:G.name)==="Original");V?V.template=M:F.push({name:"Original",template:M,default:!1}),localStorage.setItem(N,JSON.stringify(F))}v((B=M.sheets)==null?void 0:B[0].id)},[a,p,v,w,S]),m.useEffect(()=>{o&&x(o),s&&k(s)},[o,x,s,k]),m.useEffect(()=>{n&&n.accessToken&&(C(n),l())},[n,l,C]),{isLoading:c,isError:d}}function wf({className:e,...t}){return _.jsx("div",{className:ke("animate-pulse rounded-md bg-muted",e),...t})}function g_({className:e,style:t,onSave:n,onEvent:r,LoadingComponent:i,ErrorComponent:o,onChartElementClicked:s,id:a,authToken:l,currentTheme:c,version:d,customCards:f,...g}){ge(w=>w.selectedSheetId);const p=ge(w=>w.themeStyle),v=ge(w=>w.onEvent),{isLoading:y,isError:x}=p_({id:a,version:d,authToken:l,customStyle:t,currentTheme:c,onSave:n,onEvent:r});return y||!l?(v==null||v({type:"info",message:`isLoading: ${y}, accessToken: ${l==null?void 0:l.accessToken}`}),i?_.jsx(i,{message:"loading"}):_.jsx("div",{className:" flex items-center gap-3",children:_.jsx(wf,{className:"dark:h-[2px] h-1 w-full"})})):x?(v==null||v({type:"error",message:"Error fetching dashboard"}),o?(console.log("Error fetching dashboard"),_.jsx(o,{})):_.jsx("div",{children:"Error"})):_.jsx("div",{className:ke(" h-full flex flex-col justify-between",p==null?void 0:p.dashboardPanel,e),role:"dashboard-panel",...g})}function se(){return se=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},se.apply(this,arguments)}function Oe(e,t,{checkForDefaultPrevented:n=!0}={}){return function(i){if(e==null||e(i),n===!1||!i.defaultPrevented)return t==null?void 0:t(i)}}function kn(e,t=[]){let n=[];function r(o,s){const a=m.createContext(s),l=n.length;n=[...n,s];function c(f){const{scope:g,children:p,...v}=f,y=(g==null?void 0:g[e][l])||a,x=m.useMemo(()=>v,Object.values(v));return m.createElement(y.Provider,{value:x},p)}function d(f,g){const p=(g==null?void 0:g[e][l])||a,v=m.useContext(p);if(v)return v;if(s!==void 0)return s;throw new Error(`\`${f}\` must be used within \`${o}\``)}return c.displayName=o+"Provider",[c,d]}const i=()=>{const o=n.map(s=>m.createContext(s));return function(a){const l=(a==null?void 0:a[e])||o;return m.useMemo(()=>({[`__scope${e}`]:{...a,[e]:l}}),[a,l])}};return i.scopeName=e,[r,E4(i,...t)]}function E4(...e){const t=e[0];if(e.length===1)return t;const n=()=>{const r=e.map(i=>({useScope:i(),scopeName:i.scopeName}));return function(o){const s=r.reduce((a,{useScope:l,scopeName:c})=>{const f=l(o)[`__scope${c}`];return{...a,...f}},{});return m.useMemo(()=>({[`__scope${t.scopeName}`]:s}),[s])}};return n.scopeName=t.scopeName,n}function O4(e,t){typeof e=="function"?e(t):e!=null&&(e.current=t)}function _f(...e){return t=>e.forEach(n=>O4(n,t))}function rt(...e){return m.useCallback(_f(...e),e)}const so=m.forwardRef((e,t)=>{const{children:n,...r}=e,i=m.Children.toArray(n),o=i.find(P4);if(o){const s=o.props.children,a=i.map(l=>l===o?m.Children.count(s)>1?m.Children.only(null):m.isValidElement(s)?s.props.children:null:l);return m.createElement(jm,se({},r,{ref:t}),m.isValidElement(s)?m.cloneElement(s,void 0,a):null)}return m.createElement(jm,se({},r,{ref:t}),n)});so.displayName="Slot";const jm=m.forwardRef((e,t)=>{const{children:n,...r}=e;return m.isValidElement(n)?m.cloneElement(n,{...k4(r,n.props),ref:t?_f(t,n.ref):n.ref}):m.Children.count(n)>1?m.Children.only(null):null});jm.displayName="SlotClone";const m_=({children:e})=>m.createElement(m.Fragment,null,e);function P4(e){return m.isValidElement(e)&&e.type===m_}function k4(e,t){const n={...t};for(const r in t){const i=e[r],o=t[r];/^on[A-Z]/.test(r)?i&&o?n[r]=(...a)=>{o(...a),i(...a)}:i&&(n[r]=i):r==="style"?n[r]={...i,...o}:r==="className"&&(n[r]=[i,o].filter(Boolean).join(" "))}return{...e,...n}}function Sf(e){const t=e+"CollectionProvider",[n,r]=kn(t),[i,o]=n(t,{collectionRef:{current:null},itemMap:new Map}),s=p=>{const{scope:v,children:y}=p,x=m.useRef(null),w=m.useRef(new Map).current;return m.createElement(i,{scope:v,itemMap:w,collectionRef:x},y)},a=e+"CollectionSlot",l=m.forwardRef((p,v)=>{const{scope:y,children:x}=p,w=o(a,y),S=rt(v,w.collectionRef);return m.createElement(so,{ref:S},x)}),c=e+"CollectionItemSlot",d="data-radix-collection-item",f=m.forwardRef((p,v)=>{const{scope:y,children:x,...w}=p,S=m.useRef(null),C=rt(v,S),P=o(c,y);return m.useEffect(()=>(P.itemMap.set(S,{ref:S,...w}),()=>void P.itemMap.delete(S))),m.createElement(so,{[d]:"",ref:C},x)});function g(p){const v=o(e+"CollectionConsumer",p);return m.useCallback(()=>{const x=v.collectionRef.current;if(!x)return[];const w=Array.from(x.querySelectorAll(`[${d}]`));return Array.from(v.itemMap.values()).sort((P,O)=>w.indexOf(P.ref.current)-w.indexOf(O.ref.current))},[v.collectionRef,v.itemMap])}return[{Provider:s,Slot:l,ItemSlot:f},g,r]}const Vn=globalThis!=null&&globalThis.document?m.useLayoutEffect:()=>{},D4=de.useId||(()=>{});let M4=0;function or(e){const[t,n]=de.useState(D4());return Vn(()=>{e||n(r=>r??String(M4++))},[e]),e||(t?`radix-${t}`:"")}const He=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","span","svg","ul"].reduce((e,t)=>{const n=m.forwardRef((r,i)=>{const{asChild:o,...s}=r,a=o?so:t;return m.useEffect(()=>{window[Symbol.for("radix-ui")]=!0},[]),m.createElement(a,se({},s,{ref:i}))});return n.displayName=`Primitive.${t}`,{...e,[t]:n}},{});function v_(e,t){e&&kt.flushSync(()=>e.dispatchEvent(t))}function _n(e){const t=m.useRef(e);return m.useEffect(()=>{t.current=e}),m.useMemo(()=>(...n)=>{var r;return(r=t.current)===null||r===void 0?void 0:r.call(t,...n)},[])}function Qn({prop:e,defaultProp:t,onChange:n=()=>{}}){const[r,i]=T4({defaultProp:t,onChange:n}),o=e!==void 0,s=o?e:r,a=_n(n),l=m.useCallback(c=>{if(o){const f=typeof c=="function"?c(e):c;f!==e&&a(f)}else i(c)},[o,e,i,a]);return[s,l]}function T4({defaultProp:e,onChange:t}){const n=m.useState(e),[r]=n,i=m.useRef(r),o=_n(t);return m.useEffect(()=>{i.current!==r&&(o(r),i.current=r)},[r,i,o]),n}const A4=m.createContext(void 0);function Ws(e){const t=m.useContext(A4);return e||t||"ltr"}const zm="rovingFocusGroup.onEntryFocus",I4={bubbles:!1,cancelable:!0},Bm="RovingFocusGroup",[Vm,b_,N4]=Sf(Bm),[R4,dl]=kn(Bm,[N4]),[L4,F4]=R4(Bm),$4=m.forwardRef((e,t)=>m.createElement(Vm.Provider,{scope:e.__scopeRovingFocusGroup},m.createElement(Vm.Slot,{scope:e.__scopeRovingFocusGroup},m.createElement(j4,se({},e,{ref:t}))))),j4=m.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,orientation:r,loop:i=!1,dir:o,currentTabStopId:s,defaultCurrentTabStopId:a,onCurrentTabStopIdChange:l,onEntryFocus:c,...d}=e,f=m.useRef(null),g=rt(t,f),p=Ws(o),[v=null,y]=Qn({prop:s,defaultProp:a,onChange:l}),[x,w]=m.useState(!1),S=_n(c),C=b_(n),P=m.useRef(!1),[O,k]=m.useState(0);return m.useEffect(()=>{const M=f.current;if(M)return M.addEventListener(zm,S),()=>M.removeEventListener(zm,S)},[S]),m.createElement(L4,{scope:n,orientation:r,dir:p,loop:i,currentTabStopId:v,onItemFocus:m.useCallback(M=>y(M),[y]),onItemShiftTab:m.useCallback(()=>w(!0),[]),onFocusableItemAdd:m.useCallback(()=>k(M=>M+1),[]),onFocusableItemRemove:m.useCallback(()=>k(M=>M-1),[])},m.createElement(He.div,se({tabIndex:x||O===0?-1:0,"data-orientation":r},d,{ref:g,style:{outline:"none",...e.style},onMouseDown:Oe(e.onMouseDown,()=>{P.current=!0}),onFocus:Oe(e.onFocus,M=>{const N=!P.current;if(M.target===M.currentTarget&&N&&!x){const F=new CustomEvent(zm,I4);if(M.currentTarget.dispatchEvent(F),!F.defaultPrevented){const j=C().filter($=>$.focusable),B=j.find($=>$.active),V=j.find($=>$.id===v),te=[B,V,...j].filter(Boolean).map($=>$.ref.current);y_(te)}}P.current=!1}),onBlur:Oe(e.onBlur,()=>w(!1))})))}),z4="RovingFocusGroupItem",B4=m.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,focusable:r=!0,active:i=!1,tabStopId:o,...s}=e,a=or(),l=o||a,c=F4(z4,n),d=c.currentTabStopId===l,f=b_(n),{onFocusableItemAdd:g,onFocusableItemRemove:p}=c;return m.useEffect(()=>{if(r)return g(),()=>p()},[r,g,p]),m.createElement(Vm.ItemSlot,{scope:n,id:l,focusable:r,active:i},m.createElement(He.span,se({tabIndex:d?0:-1,"data-orientation":c.orientation},s,{ref:t,onMouseDown:Oe(e.onMouseDown,v=>{r?c.onItemFocus(l):v.preventDefault()}),onFocus:Oe(e.onFocus,()=>c.onItemFocus(l)),onKeyDown:Oe(e.onKeyDown,v=>{if(v.key==="Tab"&&v.shiftKey){c.onItemShiftTab();return}if(v.target!==v.currentTarget)return;const y=W4(v,c.orientation,c.dir);if(y!==void 0){v.preventDefault();let w=f().filter(S=>S.focusable).map(S=>S.ref.current);if(y==="last")w.reverse();else if(y==="prev"||y==="next"){y==="prev"&&w.reverse();const S=w.indexOf(v.currentTarget);w=c.loop?U4(w,S+1):w.slice(S+1)}setTimeout(()=>y_(w))}})})))}),V4={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function H4(e,t){return t!=="rtl"?e:e==="ArrowLeft"?"ArrowRight":e==="ArrowRight"?"ArrowLeft":e}function W4(e,t,n){const r=H4(e.key,n);if(!(t==="vertical"&&["ArrowLeft","ArrowRight"].includes(r))&&!(t==="horizontal"&&["ArrowUp","ArrowDown"].includes(r)))return V4[r]}function y_(e){const t=document.activeElement;for(const n of e)if(n===t||(n.focus(),document.activeElement!==t))return}function U4(e,t){return e.map((n,r)=>e[(t+r)%e.length])}const Hm=$4,Wm=B4;function q4(e,t){return m.useReducer((n,r)=>{const i=t[n][r];return i??n},e)}const yn=e=>{const{present:t,children:n}=e,r=G4(t),i=typeof n=="function"?n({present:r.isPresent}):m.Children.only(n),o=rt(r.ref,i.ref);return typeof n=="function"||r.isPresent?m.cloneElement(i,{ref:o}):null};yn.displayName="Presence";function G4(e){const[t,n]=m.useState(),r=m.useRef({}),i=m.useRef(e),o=m.useRef("none"),s=e?"mounted":"unmounted",[a,l]=q4(s,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return m.useEffect(()=>{const c=Cf(r.current);o.current=a==="mounted"?c:"none"},[a]),Vn(()=>{const c=r.current,d=i.current;if(d!==e){const g=o.current,p=Cf(c);e?l("MOUNT"):p==="none"||(c==null?void 0:c.display)==="none"?l("UNMOUNT"):l(d&&g!==p?"ANIMATION_OUT":"UNMOUNT"),i.current=e}},[e,l]),Vn(()=>{if(t){const c=f=>{const p=Cf(r.current).includes(f.animationName);f.target===t&&p&&kt.flushSync(()=>l("ANIMATION_END"))},d=f=>{f.target===t&&(o.current=Cf(r.current))};return t.addEventListener("animationstart",d),t.addEventListener("animationcancel",c),t.addEventListener("animationend",c),()=>{t.removeEventListener("animationstart",d),t.removeEventListener("animationcancel",c),t.removeEventListener("animationend",c)}}else l("ANIMATION_END")},[t,l]),{isPresent:["mounted","unmountSuspended"].includes(a),ref:m.useCallback(c=>{c&&(r.current=getComputedStyle(c)),n(c)},[])}}function Cf(e){return(e==null?void 0:e.animationName)||"none"}const x_="Tabs",[Y4,Jde]=kn(x_,[dl]),w_=dl(),[K4,Um]=Y4(x_),X4=m.forwardRef((e,t)=>{const{__scopeTabs:n,value:r,onValueChange:i,defaultValue:o,orientation:s="horizontal",dir:a,activationMode:l="automatic",...c}=e,d=Ws(a),[f,g]=Qn({prop:r,onChange:i,defaultProp:o});return m.createElement(K4,{scope:n,baseId:or(),value:f,onValueChange:g,orientation:s,dir:d,activationMode:l},m.createElement(He.div,se({dir:d,"data-orientation":s},c,{ref:t})))}),Q4="TabsList",Z4=m.forwardRef((e,t)=>{const{__scopeTabs:n,loop:r=!0,...i}=e,o=Um(Q4,n),s=w_(n);return m.createElement(Hm,se({asChild:!0},s,{orientation:o.orientation,dir:o.dir,loop:r}),m.createElement(He.div,se({role:"tablist","aria-orientation":o.orientation},i,{ref:t})))}),J4="TabsTrigger",eR=m.forwardRef((e,t)=>{const{__scopeTabs:n,value:r,disabled:i=!1,...o}=e,s=Um(J4,n),a=w_(n),l=__(s.baseId,r),c=S_(s.baseId,r),d=r===s.value;return m.createElement(Wm,se({asChild:!0},a,{focusable:!i,active:d}),m.createElement(He.button,se({type:"button",role:"tab","aria-selected":d,"aria-controls":c,"data-state":d?"active":"inactive","data-disabled":i?"":void 0,disabled:i,id:l},o,{ref:t,onMouseDown:Oe(e.onMouseDown,f=>{!i&&f.button===0&&f.ctrlKey===!1?s.onValueChange(r):f.preventDefault()}),onKeyDown:Oe(e.onKeyDown,f=>{[" ","Enter"].includes(f.key)&&s.onValueChange(r)}),onFocus:Oe(e.onFocus,()=>{const f=s.activationMode!=="manual";!d&&!i&&f&&s.onValueChange(r)})})))}),tR="TabsContent",nR=m.forwardRef((e,t)=>{const{__scopeTabs:n,value:r,forceMount:i,children:o,...s}=e,a=Um(tR,n),l=__(a.baseId,r),c=S_(a.baseId,r),d=r===a.value,f=m.useRef(d);return m.useEffect(()=>{const g=requestAnimationFrame(()=>f.current=!1);return()=>cancelAnimationFrame(g)},[]),m.createElement(yn,{present:i||d},({present:g})=>m.createElement(He.div,se({"data-state":d?"active":"inactive","data-orientation":a.orientation,role:"tabpanel","aria-labelledby":l,hidden:!g,id:c,tabIndex:0},s,{ref:t,style:{...e.style,animationDuration:f.current?"0s":void 0}}),g&&o))});function __(e,t){return`${e}-trigger-${t}`}function S_(e,t){return`${e}-content-${t}`}const rR=X4,C_=Z4,E_=eR,O_=nR,P_=rR,k_=de.forwardRef(({className:e,...t},n)=>_.jsx(C_,{ref:n,className:ke("inline-flex h-10 items-center justify-center rounded-md bg-muted p-1 text-muted-foreground",e),...t}));k_.displayName=C_.displayName;const qm=de.forwardRef(({className:e,...t},n)=>_.jsx(E_,{ref:n,className:ke("inline-flex items-center justify-center whitespace-nowrap rounded-sm px-3 py-1.5 text-sm font-medium ring-offset-background transition-all focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 data-[state=active]:bg-background data-[state=active]:text-foreground data-[state=active]:shadow-sm",e),...t}));qm.displayName=E_.displayName;const Ef=de.forwardRef(({className:e,...t},n)=>_.jsx(O_,{ref:n,className:ke("mt-2 ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2",e),...t}));Ef.displayName=O_.displayName;var D_={exports:{}},Kc={},Gm={exports:{}};(function(e,t){(function(n,r){r(t)})(Ho,function(n){function r(ne){return function(re,we,U,Ne,le,je,Ue){return ne(re,we,Ue)}}function i(ne){return function(re,we,U,Ne){if(!re||!we||typeof re!="object"||typeof we!="object")return ne(re,we,U,Ne);var le=Ne.get(re),je=Ne.get(we);if(le&&je)return le===we&&je===re;Ne.set(re,we),Ne.set(we,re);var Ue=ne(re,we,U,Ne);return Ne.delete(re),Ne.delete(we),Ue}}function o(ne,J){var re={};for(var we in ne)re[we]=ne[we];for(var we in J)re[we]=J[we];return re}function s(ne){return ne.constructor===Object||ne.constructor==null}function a(ne){return typeof ne.then=="function"}function l(ne,J){return ne===J||ne!==ne&&J!==J}var c="[object Arguments]",d="[object Boolean]",f="[object Date]",g="[object RegExp]",p="[object Map]",v="[object Number]",y="[object Object]",x="[object Set]",w="[object String]",S=Object.prototype.toString;function C(ne){var J=ne.areArraysEqual,re=ne.areDatesEqual,we=ne.areMapsEqual,U=ne.areObjectsEqual,Ne=ne.areRegExpsEqual,le=ne.areSetsEqual,je=ne.createIsNestedEqual,Ue=je(tt);function tt(qe,gt,Gt){if(qe===gt)return!0;if(!qe||!gt||typeof qe!="object"||typeof gt!="object")return qe!==qe&>!==gt;if(s(qe)&&s(gt))return U(qe,gt,Ue,Gt);var Bt=Array.isArray(qe),gn=Array.isArray(gt);if(Bt||gn)return Bt===gn&&J(qe,gt,Ue,Gt);var Rt=S.call(qe);return Rt!==S.call(gt)?!1:Rt===f?re(qe,gt,Ue,Gt):Rt===g?Ne(qe,gt,Ue,Gt):Rt===p?we(qe,gt,Ue,Gt):Rt===x?le(qe,gt,Ue,Gt):Rt===y||Rt===c?a(qe)||a(gt)?!1:U(qe,gt,Ue,Gt):Rt===d||Rt===v||Rt===w?l(qe.valueOf(),gt.valueOf()):!1}return tt}function P(ne,J,re,we){var U=ne.length;if(J.length!==U)return!1;for(;U-- >0;)if(!re(ne[U],J[U],U,U,ne,J,we))return!1;return!0}var O=i(P);function k(ne,J){return l(ne.valueOf(),J.valueOf())}function M(ne,J,re,we){var U=ne.size===J.size;if(!U)return!1;if(!ne.size)return!0;var Ne={},le=0;return ne.forEach(function(je,Ue){if(U){var tt=!1,qe=0;J.forEach(function(gt,Gt){!tt&&!Ne[qe]&&(tt=re(Ue,Gt,le,qe,ne,J,we)&&re(je,gt,Ue,Gt,ne,J,we))&&(Ne[qe]=!0),qe++}),le++,U=tt}}),U}var N=i(M),F="_owner",j=Object.prototype.hasOwnProperty;function B(ne,J,re,we){var U=Object.keys(ne),Ne=U.length;if(Object.keys(J).length!==Ne)return!1;for(var le;Ne-- >0;){if(le=U[Ne],le===F){var je=!!ne.$$typeof,Ue=!!J.$$typeof;if((je||Ue)&&je!==Ue)return!1}if(!j.call(J,le)||!re(ne[le],J[le],le,le,ne,J,we))return!1}return!0}var V=i(B);function G(ne,J){return ne.source===J.source&&ne.flags===J.flags}function te(ne,J,re,we){var U=ne.size===J.size;if(!U)return!1;if(!ne.size)return!0;var Ne={};return ne.forEach(function(le,je){if(U){var Ue=!1,tt=0;J.forEach(function(qe,gt){!Ue&&!Ne[tt]&&(Ue=re(le,qe,je,gt,ne,J,we))&&(Ne[tt]=!0),tt++}),U=Ue}}),U}var $=i(te),Z=Object.freeze({areArraysEqual:P,areDatesEqual:k,areMapsEqual:M,areObjectsEqual:B,areRegExpsEqual:G,areSetsEqual:te,createIsNestedEqual:r}),q=Object.freeze({areArraysEqual:O,areDatesEqual:k,areMapsEqual:N,areObjectsEqual:V,areRegExpsEqual:G,areSetsEqual:$,createIsNestedEqual:r}),X=C(Z);function ae(ne,J){return X(ne,J,void 0)}var A=C(o(Z,{createIsNestedEqual:function(){return l}}));function H(ne,J){return A(ne,J,void 0)}var ie=C(q);function R(ne,J){return ie(ne,J,new WeakMap)}var ue=C(o(q,{createIsNestedEqual:function(){return l}}));function ye(ne,J){return ue(ne,J,new WeakMap)}function pe(ne){return C(o(Z,ne(Z)))}function he(ne){var J=C(o(q,ne(q)));return function(re,we,U){return U===void 0&&(U=new WeakMap),J(re,we,U)}}n.circularDeepEqual=R,n.circularShallowEqual=ye,n.createCustomCircularEqual=he,n.createCustomEqual=pe,n.deepEqual=ae,n.sameValueZeroEqual=l,n.shallowEqual=H,Object.defineProperty(n,"__esModule",{value:!0})})})(Gm,Gm.exports);var Ym=Gm.exports;const Km=am(kN);var bt={},iR=function(t,n,r){return t===n?!0:t.className===n.className&&r(t.style,n.style)&&t.width===n.width&&t.autoSize===n.autoSize&&t.cols===n.cols&&t.draggableCancel===n.draggableCancel&&t.draggableHandle===n.draggableHandle&&r(t.verticalCompact,n.verticalCompact)&&r(t.compactType,n.compactType)&&r(t.layout,n.layout)&&r(t.margin,n.margin)&&r(t.containerPadding,n.containerPadding)&&t.rowHeight===n.rowHeight&&t.maxRows===n.maxRows&&t.isBounded===n.isBounded&&t.isDraggable===n.isDraggable&&t.isResizable===n.isResizable&&t.allowOverlap===n.allowOverlap&&t.preventCollision===n.preventCollision&&t.useCSSTransforms===n.useCSSTransforms&&t.transformScale===n.transformScale&&t.isDroppable===n.isDroppable&&r(t.resizeHandles,n.resizeHandles)&&r(t.resizeHandle,n.resizeHandle)&&t.onLayoutChange===n.onLayoutChange&&t.onDragStart===n.onDragStart&&t.onDrag===n.onDrag&&t.onDragStop===n.onDragStop&&t.onResizeStart===n.onResizeStart&&t.onResize===n.onResize&&t.onResizeStop===n.onResizeStop&&t.onDrop===n.onDrop&&r(t.droppingItem,n.droppingItem)&&r(t.innerRef,n.innerRef)};Object.defineProperty(bt,"__esModule",{value:!0}),bt.bottom=Xm,bt.childrenEqual=lR,bt.cloneLayout=T_,bt.cloneLayoutItem=Us,bt.collides=Of,bt.compact=I_,bt.compactItem=N_,bt.compactType=bR,bt.correctBounds=R_,bt.fastPositionEqual=uR,bt.fastRGLPropsEqual=void 0,bt.getAllCollisions=L_,bt.getFirstCollision=qs,bt.getLayoutItem=Zm,bt.getStatics=Jm,bt.modifyLayout=A_,bt.moveElement=Qc,bt.moveElementAwayFromCollision=ev,bt.noop=void 0,bt.perc=fR,bt.resizeItemInDirection=pR,bt.setTopLeft=mR,bt.setTransform=gR,bt.sortLayoutItems=sv,bt.sortLayoutItemsByColRow=B_,bt.sortLayoutItemsByRowCol=z_,bt.synchronizeLayoutWithChildren=vR,bt.validateLayout=V_,bt.withLayoutItem=aR;var M_=Ym,Xc=oR(m);function oR(e){return e&&e.__esModule?e:{default:e}}const sR=process.env.NODE_ENV==="production";function Xm(e){let t=0,n;for(let r=0,i=e.length;r<i;r++)n=e[r].y+e[r].h,n>t&&(t=n);return t}function T_(e){const t=Array(e.length);for(let n=0,r=e.length;n<r;n++)t[n]=Us(e[n]);return t}function A_(e,t){const n=Array(e.length);for(let r=0,i=e.length;r<i;r++)t.i===e[r].i?n[r]=t:n[r]=e[r];return n}function aR(e,t,n){let r=Zm(e,t);return r?(r=n(Us(r)),e=A_(e,r),[e,r]):[e,null]}function Us(e){return{w:e.w,h:e.h,x:e.x,y:e.y,i:e.i,minW:e.minW,maxW:e.maxW,minH:e.minH,maxH:e.maxH,moved:!!e.moved,static:!!e.static,isDraggable:e.isDraggable,isResizable:e.isResizable,resizeHandles:e.resizeHandles,isBounded:e.isBounded}}function lR(e,t){return(0,M_.deepEqual)(Xc.default.Children.map(e,n=>n==null?void 0:n.key),Xc.default.Children.map(t,n=>n==null?void 0:n.key))&&(0,M_.deepEqual)(Xc.default.Children.map(e,n=>n==null?void 0:n.props["data-grid"]),Xc.default.Children.map(t,n=>n==null?void 0:n.props["data-grid"]))}const cR=iR;bt.fastRGLPropsEqual=cR;function uR(e,t){return e.left===t.left&&e.top===t.top&&e.width===t.width&&e.height===t.height}function Of(e,t){return!(e.i===t.i||e.x+e.w<=t.x||e.x>=t.x+t.w||e.y+e.h<=t.y||e.y>=t.y+t.h)}function I_(e,t,n,r){const i=Jm(e),o=sv(e,t),s=Array(e.length);for(let a=0,l=o.length;a<l;a++){let c=Us(o[a]);c.static||(c=N_(i,c,t,n,o,r),i.push(c)),s[e.indexOf(o[a])]=c,c.moved=!1}return s}const dR={x:"w",y:"h"};function Qm(e,t,n,r){const i=dR[r];t[r]+=1;const o=e.map(s=>s.i).indexOf(t.i);for(let s=o+1;s<e.length;s++){const a=e[s];if(!a.static){if(a.y>t.y+t.h)break;Of(t,a)&&Qm(e,a,n+t[i],r)}}t[r]=n}function N_(e,t,n,r,i,o){const s=n==="vertical",a=n==="horizontal";if(s)for(t.y=Math.min(Xm(e),t.y);t.y>0&&!qs(e,t);)t.y--;else if(a)for(;t.x>0&&!qs(e,t);)t.x--;let l;for(;(l=qs(e,t))&&!(n===null&&o);)if(a?Qm(i,t,l.x+l.w,"x"):Qm(i,t,l.y+l.h,"y"),a&&t.x+t.w>r)for(t.x=r-t.w,t.y++;t.x>0&&!qs(e,t);)t.x--;return t.y=Math.max(t.y,0),t.x=Math.max(t.x,0),t}function R_(e,t){const n=Jm(e);for(let r=0,i=e.length;r<i;r++){const o=e[r];if(o.x+o.w>t.cols&&(o.x=t.cols-o.w),o.x<0&&(o.x=0,o.w=t.cols),!o.static)n.push(o);else for(;qs(n,o);)o.y++}return e}function Zm(e,t){for(let n=0,r=e.length;n<r;n++)if(e[n].i===t)return e[n]}function qs(e,t){for(let n=0,r=e.length;n<r;n++)if(Of(e[n],t))return e[n]}function L_(e,t){return e.filter(n=>Of(n,t))}function Jm(e){return e.filter(t=>t.static)}function Qc(e,t,n,r,i,o,s,a,l){if(t.static&&t.isDraggable!==!0||t.y===r&&t.x===n)return e;"Moving element ".concat(t.i," to [").concat(String(n),",").concat(String(r),"] from [").concat(t.x,",").concat(t.y,"]");const c=t.x,d=t.y;typeof n=="number"&&(t.x=n),typeof r=="number"&&(t.y=r),t.moved=!0;let f=sv(e,s);(s==="vertical"&&typeof r=="number"?d>=r:s==="horizontal"&&typeof n=="number"?c>=n:!1)&&(f=f.reverse());const p=L_(f,t),v=p.length>0;if(v&&l)return T_(e);if(v&&o)return"Collision prevented on ".concat(t.i,", reverting."),t.x=c,t.y=d,t.moved=!1,e;for(let y=0,x=p.length;y<x;y++){const w=p[y];"Resolving collision between ".concat(t.i," at [").concat(t.x,",").concat(t.y,"] and ").concat(w.i," at [").concat(w.x,",").concat(w.y,"]"),!w.moved&&(w.static?e=ev(e,w,t,i,s):e=ev(e,t,w,i,s))}return e}function ev(e,t,n,r,i,o){const s=i==="horizontal",a=i==="vertical",l=t.static;if(r){r=!1;const f={x:s?Math.max(t.x-n.w,0):n.x,y:a?Math.max(t.y-n.h,0):n.y,w:n.w,h:n.h,i:"-1"},g=qs(e,f),p=g&&g.y+g.h>t.y,v=g&&t.x+t.w>g.x;if(g){if(p&&a)return Qc(e,n,void 0,t.y+1,r,l,i);if(p&&i==null)return t.y=n.y,n.y=n.y+n.h,e;if(v&&s)return Qc(e,t,n.x,void 0,r,l,i)}else return"Doing reverse collision on ".concat(n.i," up to [").concat(f.x,",").concat(f.y,"]."),Qc(e,n,s?f.x:void 0,a?f.y:void 0,r,l,i)}const c=s?n.x+1:void 0,d=a?n.y+1:void 0;return c==null&&d==null?e:Qc(e,n,s?n.x+1:void 0,a?n.y+1:void 0,r,l,i)}function fR(e){return e*100+"%"}const F_=(e,t,n,r)=>e+n>r?t:n,$_=(e,t,n)=>e<0?t:n,j_=e=>Math.max(0,e),tv=e=>Math.max(0,e),nv=(e,t,n)=>{let{left:r,height:i,width:o}=t;const s=e.top-(i-e.height);return{left:r,width:o,height:$_(s,e.height,i),top:tv(s)}},rv=(e,t,n)=>{let{top:r,left:i,height:o,width:s}=t;return{top:r,height:o,width:F_(e.left,e.width,s,n),left:j_(i)}},iv=(e,t,n)=>{let{top:r,height:i,width:o}=t;const s=e.left-(o-e.width);return{height:i,width:s<0?e.width:F_(e.left,e.width,o,n),top:tv(r),left:j_(s)}},ov=(e,t,n)=>{let{top:r,left:i,height:o,width:s}=t;return{width:s,left:i,height:$_(r,e.height,o),top:tv(r)}},hR={n:nv,ne:function(){return nv(arguments.length<=0?void 0:arguments[0],rv(...arguments))},e:rv,se:function(){return ov(arguments.length<=0?void 0:arguments[0],rv(...arguments))},s:ov,sw:function(){return ov(arguments.length<=0?void 0:arguments[0],iv(...arguments))},w:iv,nw:function(){return nv(arguments.length<=0?void 0:arguments[0],iv(...arguments))}};function pR(e,t,n,r){const i=hR[e];return i?i(t,{...t,...n},r):n}function gR(e){let{top:t,left:n,width:r,height:i}=e;const o="translate(".concat(n,"px,").concat(t,"px)");return{transform:o,WebkitTransform:o,MozTransform:o,msTransform:o,OTransform:o,width:"".concat(r,"px"),height:"".concat(i,"px"),position:"absolute"}}function mR(e){let{top:t,left:n,width:r,height:i}=e;return{top:"".concat(t,"px"),left:"".concat(n,"px"),width:"".concat(r,"px"),height:"".concat(i,"px"),position:"absolute"}}function sv(e,t){return t==="horizontal"?B_(e):t==="vertical"?z_(e):e}function z_(e){return e.slice(0).sort(function(t,n){return t.y>n.y||t.y===n.y&&t.x>n.x?1:t.y===n.y&&t.x===n.x?0:-1})}function B_(e){return e.slice(0).sort(function(t,n){return t.x>n.x||t.x===n.x&&t.y>n.y?1:-1})}function vR(e,t,n,r,i){e=e||[];const o=[];Xc.default.Children.forEach(t,a=>{if((a==null?void 0:a.key)==null)return;const l=Zm(e,String(a.key)),c=a.props["data-grid"];l&&c==null?o.push(Us(l)):c?(sR||V_([c],"ReactGridLayout.children"),o.push(Us({...c,i:a.key}))):o.push(Us({w:1,h:1,x:0,y:Xm(o),i:String(a.key)}))});const s=R_(o,{cols:n});return i?s:I_(s,r,n)}function V_(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"Layout";const n=["x","y","w","h"];if(!Array.isArray(e))throw new Error(t+" must be an array!");for(let r=0,i=e.length;r<i;r++){const o=e[r];for(let s=0;s<n.length;s++)if(typeof o[n[s]]!="number")throw new Error("ReactGridLayout: "+t+"["+r+"]."+n[s]+" must be a number!")}}function bR(e){const{verticalCompact:t,compactType:n}=e||{};return t===!1?null:n}function ife(){}const yR=()=>{};bt.noop=yR;var Ai={};Object.defineProperty(Ai,"__esModule",{value:!0}),Ai.calcGridColWidth=Pf,Ai.calcGridItemPosition=xR,Ai.calcGridItemWHPx=av,Ai.calcWH=_R,Ai.calcXY=wR,Ai.clamp=Gs;function Pf(e){const{margin:t,containerPadding:n,containerWidth:r,cols:i}=e;return(r-t[0]*(i-1)-n[0]*2)/i}function av(e,t,n){return Number.isFinite(e)?Math.round(t*e+Math.max(0,e-1)*n):e}function xR(e,t,n,r,i,o){const{margin:s,containerPadding:a,rowHeight:l}=e,c=Pf(e),d={};return o&&o.resizing?(d.width=Math.round(o.resizing.width),d.height=Math.round(o.resizing.height)):(d.width=av(r,c,s[0]),d.height=av(i,l,s[1])),o&&o.dragging?(d.top=Math.round(o.dragging.top),d.left=Math.round(o.dragging.left)):o&&o.resizing&&typeof o.resizing.top=="number"&&typeof o.resizing.left=="number"?(d.top=Math.round(o.resizing.top),d.left=Math.round(o.resizing.left)):(d.top=Math.round((l+s[1])*n+a[1]),d.left=Math.round((c+s[0])*t+a[0])),d}function wR(e,t,n,r,i){const{margin:o,cols:s,rowHeight:a,maxRows:l}=e,c=Pf(e);let d=Math.round((n-o[0])/(c+o[0])),f=Math.round((t-o[1])/(a+o[1]));return d=Gs(d,0,s-r),f=Gs(f,0,l-i),{x:d,y:f}}function _R(e,t,n,r,i,o){const{margin:s,maxRows:a,cols:l,rowHeight:c}=e,d=Pf(e);let f=Math.round((t+s[0])/(d+s[0])),g=Math.round((n+s[1])/(c+s[1])),p=Gs(f,0,l-r),v=Gs(g,0,a-i);return["sw","w","nw"].indexOf(o)!==-1&&(p=Gs(f,0,l)),["nw","n","ne"].indexOf(o)!==-1&&(v=Gs(g,0,a)),{w:p,h:v}}function Gs(e,t,n){return Math.max(Math.min(e,n),t)}var kf={},lv={exports:{}},cv,H_;function uv(){if(H_)return cv;H_=1;var e="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED";return cv=e,cv}var dv,W_;function SR(){if(W_)return dv;W_=1;var e=uv();function t(){}function n(){}return n.resetWarningCache=t,dv=function(){function r(s,a,l,c,d,f){if(f!==e){var g=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw g.name="Invariant Violation",g}}r.isRequired=r;function i(){return r}var o={array:r,bigint:r,bool:r,func:r,number:r,object:r,string:r,symbol:r,any:r,arrayOf:i,element:r,elementType:r,instanceOf:i,node:r,objectOf:i,oneOf:i,oneOfType:i,shape:i,exact:i,checkPropTypes:n,resetWarningCache:t};return o.PropTypes=o,o},dv}var Df={exports:{}},At={};/** @license React v16.13.1
|
|
85
|
+
}`;var mt=wN(function(){return Tt(L,ze+"return "+Se).apply(n,z)});if(mt.source=Se,B1(mt))throw mt;return mt}function tde(u){return Lt(u).toLowerCase()}function nde(u){return Lt(u).toUpperCase()}function rde(u,h,b){if(u=Lt(u),u&&(b||h===n))return MA(u);if(!u||!(h=Ur(h)))return u;var E=ki(u),T=ki(h),L=TA(E,T),z=AA(E,T)+1;return Rs(E,L,z).join("")}function ide(u,h,b){if(u=Lt(u),u&&(b||h===n))return u.slice(0,NA(u)+1);if(!u||!(h=Ur(h)))return u;var E=ki(u),T=AA(E,ki(h))+1;return Rs(E,0,T).join("")}function ode(u,h,b){if(u=Lt(u),u&&(b||h===n))return u.replace(Ka,"");if(!u||!(h=Ur(h)))return u;var E=ki(u),T=TA(E,ki(h));return Rs(E,T).join("")}function sde(u,h){var b=j,E=B;if(un(h)){var T="separator"in h?h.separator:T;b="length"in h?ft(h.length):b,E="omission"in h?Ur(h.omission):E}u=Lt(u);var L=u.length;if(Sc(u)){var z=ki(u);L=z.length}if(b>=L)return u;var W=b-Cc(E);if(W<1)return E;var ee=z?Rs(z,0,W).join(""):u.slice(0,W);if(T===n)return ee+E;if(z&&(W+=ee.length-W),V1(T)){if(u.slice(W).search(T)){var be,xe=ee;for(T.global||(T=i1(T.source,Lt(Be.exec(T))+"g")),T.lastIndex=0;be=T.exec(xe);)var Se=be.index;ee=ee.slice(0,Se===n?W:Se)}}else if(u.indexOf(Ur(T),W)!=W){var Te=ee.lastIndexOf(T);Te>-1&&(ee=ee.slice(0,Te))}return ee+E}function ade(u){return u=Lt(u),u&&Ao.test(u)?u.replace(Yn,Loe):u}var lde=Tc(function(u,h,b){return u+(b?" ":"")+h.toUpperCase()}),U1=_I("toUpperCase");function xN(u,h,b){return u=Lt(u),h=b?n:h,h===n?Toe(u)?joe(u):_oe(u):u.match(h)||[]}var wN=vt(function(u,h){try{return Hr(u,n,h)}catch(b){return B1(b)?b:new nt(b)}}),cde=Fo(function(u,h){return ci(h,function(b){b=io(b),Ro(u,b,j1(u[b],u))}),u});function ude(u){var h=u==null?0:u.length,b=Ge();return u=h?sn(u,function(E){if(typeof E[1]!="function")throw new ui(s);return[b(E[0]),E[1]]}):[],vt(function(E){for(var T=-1;++T<h;){var L=u[T];if(Hr(L[0],this,E))return Hr(L[1],this,E)}})}function dde(u){return Lse(fi(u,f))}function q1(u){return function(){return u}}function fde(u,h){return u==null||u!==u?h:u}var hde=CI(),pde=CI(!0);function wr(u){return u}function G1(u){return eI(typeof u=="function"?u:fi(u,f))}function gde(u){return nI(fi(u,f))}function mde(u,h){return rI(u,fi(h,f))}var vde=vt(function(u,h){return function(b){return Xd(b,u,h)}}),bde=vt(function(u,h){return function(b){return Xd(u,b,h)}});function Y1(u,h,b){var E=An(h),T=jg(h,E);b==null&&!(un(h)&&(T.length||!E.length))&&(b=h,h=u,u=this,T=jg(h,An(h)));var L=!(un(b)&&"chain"in b)||!!b.chain,z=jo(u);return ci(T,function(W){var ee=h[W];u[W]=ee,z&&(u.prototype[W]=function(){var be=this.__chain__;if(L||be){var xe=u(this.__wrapped__),Se=xe.__actions__=br(this.__actions__);return Se.push({func:ee,args:arguments,thisArg:u}),xe.__chain__=be,xe}return ee.apply(u,Ds([this.value()],arguments))})}),u}function yde(){return zn._===this&&(zn._=Uoe),this}function K1(){}function xde(u){return u=ft(u),vt(function(h){return iI(h,u)})}var wde=O1(sn),_de=O1(EA),Sde=O1(Qx);function _N(u){return I1(u)?Zx(io(u)):Jse(u)}function Cde(u){return function(h){return u==null?n:nl(u,h)}}var Ede=OI(),Ode=OI(!0);function X1(){return[]}function Q1(){return!1}function Pde(){return{}}function kde(){return""}function Dde(){return!0}function Mde(u,h){if(u=ft(u),u<1||u>X)return[];var b=H,E=Kn(u,H);h=Ge(h),u-=H;for(var T=t1(E,h);++b<u;)h(b);return T}function Tde(u){return at(u)?sn(u,io):qr(u)?[u]:br(VI(Lt(u)))}function Ade(u){var h=++Hoe;return Lt(u)+h}var Ide=Ug(function(u,h){return u+h},0),Nde=P1("ceil"),Rde=Ug(function(u,h){return u/h},1),Lde=P1("floor");function Fde(u){return u&&u.length?$g(u,wr,f1):n}function $de(u,h){return u&&u.length?$g(u,Ge(h,2),f1):n}function jde(u){return kA(u,wr)}function zde(u,h){return kA(u,Ge(h,2))}function Bde(u){return u&&u.length?$g(u,wr,m1):n}function Vde(u,h){return u&&u.length?$g(u,Ge(h,2),m1):n}var Hde=Ug(function(u,h){return u*h},1),Wde=P1("round"),Ude=Ug(function(u,h){return u-h},0);function qde(u){return u&&u.length?e1(u,wr):0}function Gde(u,h){return u&&u.length?e1(u,Ge(h,2)):0}return I.after=gce,I.ary=JI,I.assign=nue,I.assignIn=hN,I.assignInWith=im,I.assignWith=rue,I.at=iue,I.before=eN,I.bind=j1,I.bindAll=cde,I.bindKey=tN,I.castArray=Pce,I.chain=XI,I.chunk=Lae,I.compact=Fae,I.concat=$ae,I.cond=ude,I.conforms=dde,I.constant=q1,I.countBy=qle,I.create=oue,I.curry=nN,I.curryRight=rN,I.debounce=iN,I.defaults=sue,I.defaultsDeep=aue,I.defer=mce,I.delay=vce,I.difference=jae,I.differenceBy=zae,I.differenceWith=Bae,I.drop=Vae,I.dropRight=Hae,I.dropRightWhile=Wae,I.dropWhile=Uae,I.fill=qae,I.filter=Yle,I.flatMap=Qle,I.flatMapDeep=Zle,I.flatMapDepth=Jle,I.flatten=qI,I.flattenDeep=Gae,I.flattenDepth=Yae,I.flip=bce,I.flow=hde,I.flowRight=pde,I.fromPairs=Kae,I.functions=pue,I.functionsIn=gue,I.groupBy=ece,I.initial=Qae,I.intersection=Zae,I.intersectionBy=Jae,I.intersectionWith=ele,I.invert=vue,I.invertBy=bue,I.invokeMap=nce,I.iteratee=G1,I.keyBy=rce,I.keys=An,I.keysIn=xr,I.map=Zg,I.mapKeys=xue,I.mapValues=wue,I.matches=gde,I.matchesProperty=mde,I.memoize=em,I.merge=_ue,I.mergeWith=pN,I.method=vde,I.methodOf=bde,I.mixin=Y1,I.negate=tm,I.nthArg=xde,I.omit=Sue,I.omitBy=Cue,I.once=yce,I.orderBy=ice,I.over=wde,I.overArgs=xce,I.overEvery=_de,I.overSome=Sde,I.partial=z1,I.partialRight=oN,I.partition=oce,I.pick=Eue,I.pickBy=gN,I.property=_N,I.propertyOf=Cde,I.pull=ile,I.pullAll=YI,I.pullAllBy=ole,I.pullAllWith=sle,I.pullAt=ale,I.range=Ede,I.rangeRight=Ode,I.rearg=wce,I.reject=lce,I.remove=lle,I.rest=_ce,I.reverse=F1,I.sampleSize=uce,I.set=Pue,I.setWith=kue,I.shuffle=dce,I.slice=cle,I.sortBy=pce,I.sortedUniq=mle,I.sortedUniqBy=vle,I.split=Que,I.spread=Sce,I.tail=ble,I.take=yle,I.takeRight=xle,I.takeRightWhile=wle,I.takeWhile=_le,I.tap=Fle,I.throttle=Cce,I.thru=Qg,I.toArray=uN,I.toPairs=mN,I.toPairsIn=vN,I.toPath=Tde,I.toPlainObject=fN,I.transform=Due,I.unary=Ece,I.union=Sle,I.unionBy=Cle,I.unionWith=Ele,I.uniq=Ole,I.uniqBy=Ple,I.uniqWith=kle,I.unset=Mue,I.unzip=$1,I.unzipWith=KI,I.update=Tue,I.updateWith=Aue,I.values=Nc,I.valuesIn=Iue,I.without=Dle,I.words=xN,I.wrap=Oce,I.xor=Mle,I.xorBy=Tle,I.xorWith=Ale,I.zip=Ile,I.zipObject=Nle,I.zipObjectDeep=Rle,I.zipWith=Lle,I.entries=mN,I.entriesIn=vN,I.extend=hN,I.extendWith=im,Y1(I,I),I.add=Ide,I.attempt=wN,I.camelCase=Fue,I.capitalize=bN,I.ceil=Nde,I.clamp=Nue,I.clone=kce,I.cloneDeep=Mce,I.cloneDeepWith=Tce,I.cloneWith=Dce,I.conformsTo=Ace,I.deburr=yN,I.defaultTo=fde,I.divide=Rde,I.endsWith=$ue,I.eq=Mi,I.escape=jue,I.escapeRegExp=zue,I.every=Gle,I.find=Kle,I.findIndex=WI,I.findKey=lue,I.findLast=Xle,I.findLastIndex=UI,I.findLastKey=cue,I.floor=Lde,I.forEach=QI,I.forEachRight=ZI,I.forIn=uue,I.forInRight=due,I.forOwn=fue,I.forOwnRight=hue,I.get=H1,I.gt=Ice,I.gte=Nce,I.has=mue,I.hasIn=W1,I.head=GI,I.identity=wr,I.includes=tce,I.indexOf=Xae,I.inRange=Rue,I.invoke=yue,I.isArguments=ol,I.isArray=at,I.isArrayBuffer=Rce,I.isArrayLike=yr,I.isArrayLikeObject=vn,I.isBoolean=Lce,I.isBuffer=Ls,I.isDate=Fce,I.isElement=$ce,I.isEmpty=jce,I.isEqual=zce,I.isEqualWith=Bce,I.isError=B1,I.isFinite=Vce,I.isFunction=jo,I.isInteger=sN,I.isLength=nm,I.isMap=aN,I.isMatch=Hce,I.isMatchWith=Wce,I.isNaN=Uce,I.isNative=qce,I.isNil=Yce,I.isNull=Gce,I.isNumber=lN,I.isObject=un,I.isObjectLike=hn,I.isPlainObject=nf,I.isRegExp=V1,I.isSafeInteger=Kce,I.isSet=cN,I.isString=rm,I.isSymbol=qr,I.isTypedArray=Ic,I.isUndefined=Xce,I.isWeakMap=Qce,I.isWeakSet=Zce,I.join=tle,I.kebabCase=Bue,I.last=pi,I.lastIndexOf=nle,I.lowerCase=Vue,I.lowerFirst=Hue,I.lt=Jce,I.lte=eue,I.max=Fde,I.maxBy=$de,I.mean=jde,I.meanBy=zde,I.min=Bde,I.minBy=Vde,I.stubArray=X1,I.stubFalse=Q1,I.stubObject=Pde,I.stubString=kde,I.stubTrue=Dde,I.multiply=Hde,I.nth=rle,I.noConflict=yde,I.noop=K1,I.now=Jg,I.pad=Wue,I.padEnd=Uue,I.padStart=que,I.parseInt=Gue,I.random=Lue,I.reduce=sce,I.reduceRight=ace,I.repeat=Yue,I.replace=Kue,I.result=Oue,I.round=Wde,I.runInContext=K,I.sample=cce,I.size=fce,I.snakeCase=Xue,I.some=hce,I.sortedIndex=ule,I.sortedIndexBy=dle,I.sortedIndexOf=fle,I.sortedLastIndex=hle,I.sortedLastIndexBy=ple,I.sortedLastIndexOf=gle,I.startCase=Zue,I.startsWith=Jue,I.subtract=Ude,I.sum=qde,I.sumBy=Gde,I.template=ede,I.times=Mde,I.toFinite=zo,I.toInteger=ft,I.toLength=dN,I.toLower=tde,I.toNumber=gi,I.toSafeInteger=tue,I.toString=Lt,I.toUpper=nde,I.trim=rde,I.trimEnd=ide,I.trimStart=ode,I.truncate=sde,I.unescape=ade,I.uniqueId=Ade,I.upperCase=lde,I.upperFirst=U1,I.each=QI,I.eachRight=ZI,I.first=GI,Y1(I,function(){var u={};return no(I,function(h,b){jt.call(I.prototype,b)||(u[b]=h)}),u}(),{chain:!1}),I.VERSION=r,ci(["bind","bindKey","curry","curryRight","partial","partialRight"],function(u){I[u].placeholder=I}),ci(["drop","take"],function(u,h){Ct.prototype[u]=function(b){b=b===n?1:Pn(ft(b),0);var E=this.__filtered__&&!h?new Ct(this):this.clone();return E.__filtered__?E.__takeCount__=Kn(b,E.__takeCount__):E.__views__.push({size:Kn(b,H),type:u+(E.__dir__<0?"Right":"")}),E},Ct.prototype[u+"Right"]=function(b){return this.reverse()[u](b).reverse()}}),ci(["filter","map","takeWhile"],function(u,h){var b=h+1,E=b==te||b==Z;Ct.prototype[u]=function(T){var L=this.clone();return L.__iteratees__.push({iteratee:Ge(T,3),type:b}),L.__filtered__=L.__filtered__||E,L}}),ci(["head","last"],function(u,h){var b="take"+(h?"Right":"");Ct.prototype[u]=function(){return this[b](1).value()[0]}}),ci(["initial","tail"],function(u,h){var b="drop"+(h?"":"Right");Ct.prototype[u]=function(){return this.__filtered__?new Ct(this):this[b](1)}}),Ct.prototype.compact=function(){return this.filter(wr)},Ct.prototype.find=function(u){return this.filter(u).head()},Ct.prototype.findLast=function(u){return this.reverse().find(u)},Ct.prototype.invokeMap=vt(function(u,h){return typeof u=="function"?new Ct(this):this.map(function(b){return Xd(b,u,h)})}),Ct.prototype.reject=function(u){return this.filter(tm(Ge(u)))},Ct.prototype.slice=function(u,h){u=ft(u);var b=this;return b.__filtered__&&(u>0||h<0)?new Ct(b):(u<0?b=b.takeRight(-u):u&&(b=b.drop(u)),h!==n&&(h=ft(h),b=h<0?b.dropRight(-h):b.take(h-u)),b)},Ct.prototype.takeRightWhile=function(u){return this.reverse().takeWhile(u).reverse()},Ct.prototype.toArray=function(){return this.take(H)},no(Ct.prototype,function(u,h){var b=/^(?:filter|find|map|reject)|While$/.test(h),E=/^(?:head|last)$/.test(h),T=I[E?"take"+(h=="last"?"Right":""):h],L=E||/^find/.test(h);T&&(I.prototype[h]=function(){var z=this.__wrapped__,W=E?[1]:arguments,ee=z instanceof Ct,be=W[0],xe=ee||at(z),Se=function(St){var Et=T.apply(I,Ds([St],W));return E&&Te?Et[0]:Et};xe&&b&&typeof be=="function"&&be.length!=1&&(ee=xe=!1);var Te=this.__chain__,ze=!!this.__actions__.length,Ye=L&&!Te,mt=ee&&!ze;if(!L&&xe){z=mt?z:new Ct(this);var Ke=u.apply(z,W);return Ke.__actions__.push({func:Qg,args:[Se],thisArg:n}),new di(Ke,Te)}return Ye&&mt?u.apply(this,W):(Ke=this.thru(Se),Ye?E?Ke.value()[0]:Ke.value():Ke)})}),ci(["pop","push","shift","sort","splice","unshift"],function(u){var h=Sg[u],b=/^(?:push|sort|unshift)$/.test(u)?"tap":"thru",E=/^(?:pop|shift)$/.test(u);I.prototype[u]=function(){var T=arguments;if(E&&!this.__chain__){var L=this.value();return h.apply(at(L)?L:[],T)}return this[b](function(z){return h.apply(at(z)?z:[],T)})}}),no(Ct.prototype,function(u,h){var b=I[h];if(b){var E=b.name+"";jt.call(kc,E)||(kc[E]=[]),kc[E].push({name:h,func:b})}}),kc[Wg(n,w).name]=[{name:"wrapper",func:n}],Ct.prototype.clone=ase,Ct.prototype.reverse=lse,Ct.prototype.value=cse,I.prototype.at=$le,I.prototype.chain=jle,I.prototype.commit=zle,I.prototype.next=Ble,I.prototype.plant=Hle,I.prototype.reverse=Wle,I.prototype.toJSON=I.prototype.valueOf=I.prototype.value=Ule,I.prototype.first=I.prototype.head,Hd&&(I.prototype[Hd]=Vle),I},Ec=zoe();Qa?((Qa.exports=Ec)._=Ec,Gx._=Ec):zn._=Ec}).call(Ho)}(xf,xf.exports);var Gc=xf.exports;const Hs=Rc(Gc),u_=["lg","md","sm","xs","xxs"],ge=Ow()($w((e,t)=>({currentBreakpoint:"lg",dashboard:{id:"",style:km},showContext:!1,selectedSheetId:null,selectedCardId:null,selectedFrameId:null,selectedCard:null,showFilters:!1,isDashboardEditing:!1,isVisualEditing:!1,showDashboardJSON:!1,filteringCards:[],actions:{setCurrentBreakpoint:n=>{e(()=>({currentBreakpoint:n}))},addFilteringCard:n=>{e(r=>{var i;(i=r.filteringCards)==null||i.push(n)})},removeFilteringCard:n=>{e(r=>{var o,s;const i=(o=r.filteringCards)==null?void 0:o.findIndex(a=>a.id===n.id);i!==void 0&&i>-1&&((s=r.filteringCards)==null||s.splice(i,1))})},setCustomCards:n=>{e(r=>{r.dashboard.customCards=n})},setAuthToken:n=>{e(()=>({authToken:n}))},setThemeStyle:n=>{e(()=>({themeStyle:n}))},setDashboard:n=>e({dashboard:n}),setBookmarkKey:n=>{e(()=>({bookmarkKey:n}))},setDashboardTheme:n=>{e(r=>{r.theme=n})},setSheets:n=>{e(r=>{r.dashboard&&(r.dashboard.sheets=n)})},setCardTitle:(n,r,i)=>{e(o=>{var a,l;const s=(l=(a=o.dashboard)==null?void 0:a.sheets)==null?void 0:l.find(c=>c.id===n);s&&Gc.forEach(s.frames,c=>{var f;const d=(f=c.cards)==null?void 0:f.find(g=>g.id===r);d&&(d.title=i)})})},setCardInfo:(n,r)=>{e(i=>{var s,a;const o=(a=(s=i.dashboard)==null?void 0:s.sheets)==null?void 0:a.find(l=>l.id===i.selectedSheetId);o&&Gc.forEach(o.frames,l=>{var d;const c=(d=l.cards)==null?void 0:d.find(f=>f.id===n);c&&(c.info=r)})})},setCardDescription:(n,r,i)=>{e(o=>{var a,l;const s=(l=(a=o.dashboard)==null?void 0:a.sheets)==null?void 0:l.find(c=>c.id===n);s&&Gc.forEach(s.frames,c=>{var f;const d=(f=c.cards)==null?void 0:f.find(g=>g.id===r);d&&(d.description=i)})})},setCardSql:(n,r,i)=>{e(o=>{var a,l,c,d;const s=(l=(a=o.dashboard)==null?void 0:a.sheets)==null?void 0:l.find(f=>f.id===n);if(s){const f=(c=s.cards)==null?void 0:c.find(g=>g.id===r);f&&(f.sql=i,(d=o.onUpdateCard)==null||d.call(o,f,n))}})},setFrameCardData:(n,r,i)=>{e(o=>{var a,l;const s=(l=(a=o.dashboard)==null?void 0:a.sheets)==null?void 0:l.find(c=>c.id===n);s&&Gc.forEach(s.frames,c=>{var f;const d=(f=c.cards)==null?void 0:f.find(g=>g.id===r);d&&(d.data=i)})})},setSheetLayout:(n,r)=>{e(i=>{var s,a;const o=(a=(s=i.dashboard)==null?void 0:s.sheets)==null?void 0:a.find(l=>l.id===n);o&&(o.layout=r)})},setSheetLayouts:(n,r)=>{e(i=>{var s,a;const o=(a=(s=i.dashboard)==null?void 0:s.sheets)==null?void 0:a.find(l=>l.id===n);o&&(o.layouts=r)})},setShowContext:n=>{e(()=>({showContext:n}))},setShowFilters:n=>{e(()=>({showFilters:n}))},setFilterValues:n=>{e(()=>({filterValues:n}))},addOrUpdateFilterValue:n=>{e(r=>{if(r.filterValues){const i=r.filterValues.findIndex(o=>o.filterId===n.filterId);i>-1?r.filterValues.splice(i,1,n):r.filterValues.push(n)}else r.filterValues=[n]})},removeFilterValue:n=>{e(r=>{if(r.filterValues){const i=r.filterValues.findIndex(o=>o.filterId===n);i>-1&&r.filterValues.splice(i,1)}})},replaceFilterValue:n=>{e(r=>{if(r.filterValues){const i=r.filterValues.findIndex(o=>o.filterId===n.filterId);i>-1&&r.filterValues.splice(i,1,n)}})},addFilter:n=>{e(r=>{var i;r.dashboard.filters?(i=r.dashboard.filters)==null||i.push(n):r.dashboard.filters=[n]})},removeFilter:n=>{e(r=>{var i,o;if(r.dashboard.filters){const s=(i=r.dashboard.filters)==null?void 0:i.findIndex(a=>a.id===n);console.log("index",s),s>-1&&((o=r.dashboard.filters)==null||o.splice(s,1))}})},updateFrameCard:(n,r,i)=>{e(o=>{var l,c,d,f,g;const s=(c=(l=o.dashboard)==null?void 0:l.sheets)==null?void 0:c.find(p=>p.id===n);if(!s)return;const a=(d=s==null?void 0:s.frames)==null?void 0:d.find(p=>p.id===r);if(a){const p=(f=a.cards)==null?void 0:f.findIndex(v=>v.id===i.id);p>-1&&((g=a.cards)==null||g.splice(p,1,i))}})},updateFilter:n=>{e(r=>{var i,o;if(r.dashboard.filters){const s=(i=r.dashboard.filters)==null?void 0:i.findIndex(a=>a.id===n.id);s>-1&&((o=r.dashboard.filters)==null||o.splice(s,1,n))}})},setIsDashboardEditing:n=>{e(()=>({isDashboardEditing:n}))},setShowDashboardJSON:n=>{e(()=>({showDashboardJSON:n}))},setIsVisualEditing:n=>{e(()=>({isVisualEditing:n}))},addFrame:(n,r)=>{e(i=>{var s,a,l,c,d;const o=(a=(s=i.dashboard)==null?void 0:s.sheets)==null?void 0:a.find(f=>f.id===n);if(o){o.frames||(o.frames=[]),(l=o.frames)==null||l.push(r);const f={i:r.id,x:0,y:1/0,w:20,h:7,minW:6,minH:2};(c=o.layout)==null||c.push(f),o!=null&&o.layouts||(o.layouts={}),u_.forEach(g=>{o.layouts[g]||(o.layouts[g]=[]),o.layouts[g].push(f)}),(d=i.onAddFrame)==null||d.call(i,r,n)}})},removeFrame:(n,r)=>{e(i=>{var s,a,l,c,d;const o=(a=(s=i.dashboard)==null?void 0:s.sheets)==null?void 0:a.find(f=>f.id===n);if(o){const f=(l=o.frames)==null?void 0:l.findIndex(g=>g.id===r);console.log(f),typeof f=="number"&&f>-1&&((c=o.frames)==null||c.splice(f,1),(d=o.layout)==null||d.splice(f,1),o.layouts=u_.reduce((g,p)=>{if(g&&g[p]){const v=g[p].findIndex(y=>y.i===r);typeof v=="number"&&v>-1&&g[p].splice(v,1)}return g},o.layouts))}})},updateFrame:(n,r)=>{e(i=>{var a,l,c,d;const o=(l=(a=i.dashboard)==null?void 0:a.sheets)==null?void 0:l.find(f=>f.id===n),s=(c=o==null?void 0:o.frames)==null?void 0:c.findIndex(f=>f.id===r.id);o&&((d=o.frames)==null||d.splice(s,1,r))})},updateCard:(n,r)=>{e(i=>{var a,l,c,d,f;const o=(l=(a=i.dashboard)==null?void 0:a.sheets)==null?void 0:l.find(g=>g.id===n),s=(c=o==null?void 0:o.cards)==null?void 0:c.findIndex(g=>g.id===r.id);o&&((d=o.cards)==null||d.splice(s,1,r),(f=i.onUpdateCard)==null||f.call(i,r,n))})},removeCard:(n,r)=>{e(i=>{var a,l,c,d,f,g;const o=(l=(a=i.dashboard)==null?void 0:a.sheets)==null?void 0:l.find(p=>p.id===n),s=(c=o==null?void 0:o.cards)==null?void 0:c.findIndex(p=>p.id===r.id);o&&((d=o.cards)==null||d.splice(s,1),(f=o.layout)==null||f.splice(s,1),(g=i.onRemoveCard)==null||g.call(i,r,n))})},setStyle:n=>{e(r=>{r.dashboard&&(r.dashboard.style=n)})},setSelectedCardId:(n,r)=>{e(i=>{var s,a,l;const o=(a=(s=i.dashboard)==null?void 0:s.sheets)==null?void 0:a.find(c=>c.id===n);o&&(((l=o.cards)==null?void 0:l.find(d=>d.id===r))?i.selectedCardId=r:i.selectedCardId=null)})},setSelectedFrameId:n=>{e(r=>{var o,s;((s=(o=r.dashboard)==null?void 0:o.sheets)==null?void 0:s.find(a=>a.id===r.selectedSheetId))&&(r.selectedFrameId=n)})},setSelectedSheetId:n=>{e(r=>{var o,s;((s=(o=r.dashboard)==null?void 0:o.sheets)==null?void 0:s.find(a=>a.id===n))&&(r.selectedSheetId=n)})},setOnSaveFunction:n=>{e(()=>({onSaveFunction:n}))},setOnAddCard:n=>{e(()=>({onAddCard:n}))},setOnUpdateCard:n=>{e(()=>({onUpdateCard:n}))},setOnRemoveCard:n=>{e(()=>({onRemoveCard:n}))},setOnEvent:n=>{e(()=>({onEvent:n}))},getDashboard:()=>t().dashboard,getSelectedSheet:()=>{var n,r;return(r=(n=t().dashboard)==null?void 0:n.sheets)==null?void 0:r.find(i=>i.id===t().selectedSheetId)},getSelectedFrame:()=>{var r,i,o;const n=(i=(r=t().dashboard)==null?void 0:r.sheets)==null?void 0:i.find(s=>s.id===t().selectedSheetId);return(o=n==null?void 0:n.frames)==null?void 0:o.find(s=>s.id===t().selectedFrameId)},getCard:n=>{var i,o;const r=(i=t().dashboard)==null?void 0:i.sheets;if(r)for(let s=0;s<r.length;s++){const a=r[s].frames;if(a)for(let l=0;l<a.length;l++){const c=(o=a[l].cards)==null?void 0:o.find(d=>d.id===n);if(c)return c}}},getSelectedSheetLayout:()=>{var r,i;const n=(i=(r=t().dashboard)==null?void 0:r.sheets)==null?void 0:i.find(o=>o.id===t().selectedSheetId);return n==null?void 0:n.layout},getSelectedSheetLayouts:()=>{var r,i;const n=(i=(r=t().dashboard)==null?void 0:r.sheets)==null?void 0:i.find(o=>o.id===t().selectedSheetId);return n==null?void 0:n.layouts},getStyle:()=>{var n;return(n=t().dashboard)==null?void 0:n.style},handleDataPointClickAction:(n,r)=>{w4({card:n,dataPoint:r,set:e,get:t})}}}))),Yc=()=>ge(e=>e.actions);process.env.NODE_ENV==="development"&&zw("DashboardStore",ge);const _4={theme:"system",setTheme:()=>null},d_=m.createContext(_4);function S4({children:e,defaultTheme:t="system",storageKey:n="vite-ui-theme",...r}){const[i,o]=m.useState(()=>localStorage.getItem(n)||t);m.useEffect(()=>{const a=window.document.documentElement;if(a.classList.remove("light","dark"),i==="system"){const l=window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light";a.classList.add(l);return}a.classList.add(i)},[i]);const s={theme:i,setTheme:a=>{localStorage.setItem(n,a),o(a)}};return _.jsx(d_.Provider,{...r,value:s,children:e})}const $m=()=>{const e=m.useContext(d_);if(e===void 0)throw new Error("useTheme must be used within a ThemeProvider");return e};async function C4(e,t,n){return await(await fetch(`https://semaphor.cloud/api/v1/dashboard?id=${e}&version=${t}`,{headers:{Authorization:`Bearer ${n}`}})).json()}function f_(e){return e==="system"?window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light":e}function h_(e,t){const n=f_(e);return n==="dark"?Hs.merge({...t==null?void 0:t.default},{...t==null?void 0:t.dark}):t==null?void 0:t.default}function p_({id:e,version:t,authToken:n,customStyle:r,currentTheme:i,onSave:o,onEvent:s}){const{data:a,refetch:l,isLoading:c,isError:d}=vi({queryKey:[e],queryFn:()=>C4(e,t||"",n==null?void 0:n.accessToken),enabled:!1}),{theme:f,setTheme:g}=$m(),{setDashboard:p,setSelectedSheetId:v,setStyle:y,setOnSaveFunction:x}=ge(M=>M.actions);ge(M=>M.actions.setCustomCards);const w=ge(M=>M.actions.setFilterValues),S=ge(M=>M.actions.setBookmarkKey),C=ge(M=>M.actions.setAuthToken),P=ge(M=>M.actions.setThemeStyle),O=ge(M=>M.actions.setDashboardTheme),k=ge(M=>M.actions.setOnEvent);return m.useEffect(()=>{if(f){const M=f_(f);O(M)}},[f,O]),m.useEffect(()=>{i&&g(i)},[i,g]),m.useEffect(()=>{const M=Hs.cloneDeep(km);if(r){const N=Hs.merge(M,r),F=h_(f,N);P(F),y(N)}else{const N=h_(f,M);P(N),y(km)}},[f,r,y,P]),m.useEffect(()=>{var B;if(!a||!a.dashboard)return;const M=a.dashboard,N=ms(M.id),F=JSON.parse(localStorage.getItem(N)||"[]"),j=F.find(V=>V.default===!0);if(j)p(j.template),S(j.name),j.filterValues&&w(j.filterValues);else{p(M);const V=F.find(G=>(G==null?void 0:G.name)==="Original");V?V.template=M:F.push({name:"Original",template:M,default:!1}),localStorage.setItem(N,JSON.stringify(F))}v((B=M.sheets)==null?void 0:B[0].id)},[a,p,v,w,S]),m.useEffect(()=>{o&&x(o),s&&k(s)},[o,x,s,k]),m.useEffect(()=>{n&&n.accessToken&&(C(n),l())},[n,l,C]),{isLoading:c,isError:d}}function wf({className:e,...t}){return _.jsx("div",{className:ke("animate-pulse rounded-md bg-muted",e),...t})}function g_({className:e,style:t,onSave:n,onEvent:r,LoadingComponent:i,ErrorComponent:o,onChartElementClicked:s,id:a,authToken:l,currentTheme:c,version:d,customCards:f,...g}){ge(w=>w.selectedSheetId);const p=ge(w=>w.themeStyle),v=ge(w=>w.onEvent),{isLoading:y,isError:x}=p_({id:a,version:d,authToken:l,customStyle:t,currentTheme:c,onSave:n,onEvent:r});return y||!l?(v==null||v({type:"info",message:`isLoading: ${y}, accessToken: ${l==null?void 0:l.accessToken}`}),i?_.jsx(i,{message:"loading"}):_.jsx("div",{className:" flex items-center gap-3",children:_.jsx(wf,{className:"dark:h-[2px] h-1 w-full"})})):x?(v==null||v({type:"error",message:"Error fetching dashboard"}),o?(console.log("Error fetching dashboard"),_.jsx(o,{})):_.jsx("div",{children:"Error"})):_.jsx("div",{className:ke(" h-full flex flex-col justify-between",p==null?void 0:p.dashboardPanel,e),role:"dashboard-panel",...g})}function se(){return se=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},se.apply(this,arguments)}function Oe(e,t,{checkForDefaultPrevented:n=!0}={}){return function(i){if(e==null||e(i),n===!1||!i.defaultPrevented)return t==null?void 0:t(i)}}function kn(e,t=[]){let n=[];function r(o,s){const a=m.createContext(s),l=n.length;n=[...n,s];function c(f){const{scope:g,children:p,...v}=f,y=(g==null?void 0:g[e][l])||a,x=m.useMemo(()=>v,Object.values(v));return m.createElement(y.Provider,{value:x},p)}function d(f,g){const p=(g==null?void 0:g[e][l])||a,v=m.useContext(p);if(v)return v;if(s!==void 0)return s;throw new Error(`\`${f}\` must be used within \`${o}\``)}return c.displayName=o+"Provider",[c,d]}const i=()=>{const o=n.map(s=>m.createContext(s));return function(a){const l=(a==null?void 0:a[e])||o;return m.useMemo(()=>({[`__scope${e}`]:{...a,[e]:l}}),[a,l])}};return i.scopeName=e,[r,E4(i,...t)]}function E4(...e){const t=e[0];if(e.length===1)return t;const n=()=>{const r=e.map(i=>({useScope:i(),scopeName:i.scopeName}));return function(o){const s=r.reduce((a,{useScope:l,scopeName:c})=>{const f=l(o)[`__scope${c}`];return{...a,...f}},{});return m.useMemo(()=>({[`__scope${t.scopeName}`]:s}),[s])}};return n.scopeName=t.scopeName,n}function O4(e,t){typeof e=="function"?e(t):e!=null&&(e.current=t)}function _f(...e){return t=>e.forEach(n=>O4(n,t))}function rt(...e){return m.useCallback(_f(...e),e)}const so=m.forwardRef((e,t)=>{const{children:n,...r}=e,i=m.Children.toArray(n),o=i.find(P4);if(o){const s=o.props.children,a=i.map(l=>l===o?m.Children.count(s)>1?m.Children.only(null):m.isValidElement(s)?s.props.children:null:l);return m.createElement(jm,se({},r,{ref:t}),m.isValidElement(s)?m.cloneElement(s,void 0,a):null)}return m.createElement(jm,se({},r,{ref:t}),n)});so.displayName="Slot";const jm=m.forwardRef((e,t)=>{const{children:n,...r}=e;return m.isValidElement(n)?m.cloneElement(n,{...k4(r,n.props),ref:t?_f(t,n.ref):n.ref}):m.Children.count(n)>1?m.Children.only(null):null});jm.displayName="SlotClone";const m_=({children:e})=>m.createElement(m.Fragment,null,e);function P4(e){return m.isValidElement(e)&&e.type===m_}function k4(e,t){const n={...t};for(const r in t){const i=e[r],o=t[r];/^on[A-Z]/.test(r)?i&&o?n[r]=(...a)=>{o(...a),i(...a)}:i&&(n[r]=i):r==="style"?n[r]={...i,...o}:r==="className"&&(n[r]=[i,o].filter(Boolean).join(" "))}return{...e,...n}}function Sf(e){const t=e+"CollectionProvider",[n,r]=kn(t),[i,o]=n(t,{collectionRef:{current:null},itemMap:new Map}),s=p=>{const{scope:v,children:y}=p,x=m.useRef(null),w=m.useRef(new Map).current;return m.createElement(i,{scope:v,itemMap:w,collectionRef:x},y)},a=e+"CollectionSlot",l=m.forwardRef((p,v)=>{const{scope:y,children:x}=p,w=o(a,y),S=rt(v,w.collectionRef);return m.createElement(so,{ref:S},x)}),c=e+"CollectionItemSlot",d="data-radix-collection-item",f=m.forwardRef((p,v)=>{const{scope:y,children:x,...w}=p,S=m.useRef(null),C=rt(v,S),P=o(c,y);return m.useEffect(()=>(P.itemMap.set(S,{ref:S,...w}),()=>void P.itemMap.delete(S))),m.createElement(so,{[d]:"",ref:C},x)});function g(p){const v=o(e+"CollectionConsumer",p);return m.useCallback(()=>{const x=v.collectionRef.current;if(!x)return[];const w=Array.from(x.querySelectorAll(`[${d}]`));return Array.from(v.itemMap.values()).sort((P,O)=>w.indexOf(P.ref.current)-w.indexOf(O.ref.current))},[v.collectionRef,v.itemMap])}return[{Provider:s,Slot:l,ItemSlot:f},g,r]}const Vn=globalThis!=null&&globalThis.document?m.useLayoutEffect:()=>{},D4=de.useId||(()=>{});let M4=0;function or(e){const[t,n]=de.useState(D4());return Vn(()=>{e||n(r=>r??String(M4++))},[e]),e||(t?`radix-${t}`:"")}const He=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","span","svg","ul"].reduce((e,t)=>{const n=m.forwardRef((r,i)=>{const{asChild:o,...s}=r,a=o?so:t;return m.useEffect(()=>{window[Symbol.for("radix-ui")]=!0},[]),m.createElement(a,se({},s,{ref:i}))});return n.displayName=`Primitive.${t}`,{...e,[t]:n}},{});function v_(e,t){e&&kt.flushSync(()=>e.dispatchEvent(t))}function _n(e){const t=m.useRef(e);return m.useEffect(()=>{t.current=e}),m.useMemo(()=>(...n)=>{var r;return(r=t.current)===null||r===void 0?void 0:r.call(t,...n)},[])}function Qn({prop:e,defaultProp:t,onChange:n=()=>{}}){const[r,i]=T4({defaultProp:t,onChange:n}),o=e!==void 0,s=o?e:r,a=_n(n),l=m.useCallback(c=>{if(o){const f=typeof c=="function"?c(e):c;f!==e&&a(f)}else i(c)},[o,e,i,a]);return[s,l]}function T4({defaultProp:e,onChange:t}){const n=m.useState(e),[r]=n,i=m.useRef(r),o=_n(t);return m.useEffect(()=>{i.current!==r&&(o(r),i.current=r)},[r,i,o]),n}const A4=m.createContext(void 0);function Ws(e){const t=m.useContext(A4);return e||t||"ltr"}const zm="rovingFocusGroup.onEntryFocus",I4={bubbles:!1,cancelable:!0},Bm="RovingFocusGroup",[Vm,b_,N4]=Sf(Bm),[R4,dl]=kn(Bm,[N4]),[L4,F4]=R4(Bm),$4=m.forwardRef((e,t)=>m.createElement(Vm.Provider,{scope:e.__scopeRovingFocusGroup},m.createElement(Vm.Slot,{scope:e.__scopeRovingFocusGroup},m.createElement(j4,se({},e,{ref:t}))))),j4=m.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,orientation:r,loop:i=!1,dir:o,currentTabStopId:s,defaultCurrentTabStopId:a,onCurrentTabStopIdChange:l,onEntryFocus:c,...d}=e,f=m.useRef(null),g=rt(t,f),p=Ws(o),[v=null,y]=Qn({prop:s,defaultProp:a,onChange:l}),[x,w]=m.useState(!1),S=_n(c),C=b_(n),P=m.useRef(!1),[O,k]=m.useState(0);return m.useEffect(()=>{const M=f.current;if(M)return M.addEventListener(zm,S),()=>M.removeEventListener(zm,S)},[S]),m.createElement(L4,{scope:n,orientation:r,dir:p,loop:i,currentTabStopId:v,onItemFocus:m.useCallback(M=>y(M),[y]),onItemShiftTab:m.useCallback(()=>w(!0),[]),onFocusableItemAdd:m.useCallback(()=>k(M=>M+1),[]),onFocusableItemRemove:m.useCallback(()=>k(M=>M-1),[])},m.createElement(He.div,se({tabIndex:x||O===0?-1:0,"data-orientation":r},d,{ref:g,style:{outline:"none",...e.style},onMouseDown:Oe(e.onMouseDown,()=>{P.current=!0}),onFocus:Oe(e.onFocus,M=>{const N=!P.current;if(M.target===M.currentTarget&&N&&!x){const F=new CustomEvent(zm,I4);if(M.currentTarget.dispatchEvent(F),!F.defaultPrevented){const j=C().filter($=>$.focusable),B=j.find($=>$.active),V=j.find($=>$.id===v),te=[B,V,...j].filter(Boolean).map($=>$.ref.current);y_(te)}}P.current=!1}),onBlur:Oe(e.onBlur,()=>w(!1))})))}),z4="RovingFocusGroupItem",B4=m.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,focusable:r=!0,active:i=!1,tabStopId:o,...s}=e,a=or(),l=o||a,c=F4(z4,n),d=c.currentTabStopId===l,f=b_(n),{onFocusableItemAdd:g,onFocusableItemRemove:p}=c;return m.useEffect(()=>{if(r)return g(),()=>p()},[r,g,p]),m.createElement(Vm.ItemSlot,{scope:n,id:l,focusable:r,active:i},m.createElement(He.span,se({tabIndex:d?0:-1,"data-orientation":c.orientation},s,{ref:t,onMouseDown:Oe(e.onMouseDown,v=>{r?c.onItemFocus(l):v.preventDefault()}),onFocus:Oe(e.onFocus,()=>c.onItemFocus(l)),onKeyDown:Oe(e.onKeyDown,v=>{if(v.key==="Tab"&&v.shiftKey){c.onItemShiftTab();return}if(v.target!==v.currentTarget)return;const y=W4(v,c.orientation,c.dir);if(y!==void 0){v.preventDefault();let w=f().filter(S=>S.focusable).map(S=>S.ref.current);if(y==="last")w.reverse();else if(y==="prev"||y==="next"){y==="prev"&&w.reverse();const S=w.indexOf(v.currentTarget);w=c.loop?U4(w,S+1):w.slice(S+1)}setTimeout(()=>y_(w))}})})))}),V4={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function H4(e,t){return t!=="rtl"?e:e==="ArrowLeft"?"ArrowRight":e==="ArrowRight"?"ArrowLeft":e}function W4(e,t,n){const r=H4(e.key,n);if(!(t==="vertical"&&["ArrowLeft","ArrowRight"].includes(r))&&!(t==="horizontal"&&["ArrowUp","ArrowDown"].includes(r)))return V4[r]}function y_(e){const t=document.activeElement;for(const n of e)if(n===t||(n.focus(),document.activeElement!==t))return}function U4(e,t){return e.map((n,r)=>e[(t+r)%e.length])}const Hm=$4,Wm=B4;function q4(e,t){return m.useReducer((n,r)=>{const i=t[n][r];return i??n},e)}const yn=e=>{const{present:t,children:n}=e,r=G4(t),i=typeof n=="function"?n({present:r.isPresent}):m.Children.only(n),o=rt(r.ref,i.ref);return typeof n=="function"||r.isPresent?m.cloneElement(i,{ref:o}):null};yn.displayName="Presence";function G4(e){const[t,n]=m.useState(),r=m.useRef({}),i=m.useRef(e),o=m.useRef("none"),s=e?"mounted":"unmounted",[a,l]=q4(s,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return m.useEffect(()=>{const c=Cf(r.current);o.current=a==="mounted"?c:"none"},[a]),Vn(()=>{const c=r.current,d=i.current;if(d!==e){const g=o.current,p=Cf(c);e?l("MOUNT"):p==="none"||(c==null?void 0:c.display)==="none"?l("UNMOUNT"):l(d&&g!==p?"ANIMATION_OUT":"UNMOUNT"),i.current=e}},[e,l]),Vn(()=>{if(t){const c=f=>{const p=Cf(r.current).includes(f.animationName);f.target===t&&p&&kt.flushSync(()=>l("ANIMATION_END"))},d=f=>{f.target===t&&(o.current=Cf(r.current))};return t.addEventListener("animationstart",d),t.addEventListener("animationcancel",c),t.addEventListener("animationend",c),()=>{t.removeEventListener("animationstart",d),t.removeEventListener("animationcancel",c),t.removeEventListener("animationend",c)}}else l("ANIMATION_END")},[t,l]),{isPresent:["mounted","unmountSuspended"].includes(a),ref:m.useCallback(c=>{c&&(r.current=getComputedStyle(c)),n(c)},[])}}function Cf(e){return(e==null?void 0:e.animationName)||"none"}const x_="Tabs",[Y4,Jde]=kn(x_,[dl]),w_=dl(),[K4,Um]=Y4(x_),X4=m.forwardRef((e,t)=>{const{__scopeTabs:n,value:r,onValueChange:i,defaultValue:o,orientation:s="horizontal",dir:a,activationMode:l="automatic",...c}=e,d=Ws(a),[f,g]=Qn({prop:r,onChange:i,defaultProp:o});return m.createElement(K4,{scope:n,baseId:or(),value:f,onValueChange:g,orientation:s,dir:d,activationMode:l},m.createElement(He.div,se({dir:d,"data-orientation":s},c,{ref:t})))}),Q4="TabsList",Z4=m.forwardRef((e,t)=>{const{__scopeTabs:n,loop:r=!0,...i}=e,o=Um(Q4,n),s=w_(n);return m.createElement(Hm,se({asChild:!0},s,{orientation:o.orientation,dir:o.dir,loop:r}),m.createElement(He.div,se({role:"tablist","aria-orientation":o.orientation},i,{ref:t})))}),J4="TabsTrigger",eR=m.forwardRef((e,t)=>{const{__scopeTabs:n,value:r,disabled:i=!1,...o}=e,s=Um(J4,n),a=w_(n),l=__(s.baseId,r),c=S_(s.baseId,r),d=r===s.value;return m.createElement(Wm,se({asChild:!0},a,{focusable:!i,active:d}),m.createElement(He.button,se({type:"button",role:"tab","aria-selected":d,"aria-controls":c,"data-state":d?"active":"inactive","data-disabled":i?"":void 0,disabled:i,id:l},o,{ref:t,onMouseDown:Oe(e.onMouseDown,f=>{!i&&f.button===0&&f.ctrlKey===!1?s.onValueChange(r):f.preventDefault()}),onKeyDown:Oe(e.onKeyDown,f=>{[" ","Enter"].includes(f.key)&&s.onValueChange(r)}),onFocus:Oe(e.onFocus,()=>{const f=s.activationMode!=="manual";!d&&!i&&f&&s.onValueChange(r)})})))}),tR="TabsContent",nR=m.forwardRef((e,t)=>{const{__scopeTabs:n,value:r,forceMount:i,children:o,...s}=e,a=Um(tR,n),l=__(a.baseId,r),c=S_(a.baseId,r),d=r===a.value,f=m.useRef(d);return m.useEffect(()=>{const g=requestAnimationFrame(()=>f.current=!1);return()=>cancelAnimationFrame(g)},[]),m.createElement(yn,{present:i||d},({present:g})=>m.createElement(He.div,se({"data-state":d?"active":"inactive","data-orientation":a.orientation,role:"tabpanel","aria-labelledby":l,hidden:!g,id:c,tabIndex:0},s,{ref:t,style:{...e.style,animationDuration:f.current?"0s":void 0}}),g&&o))});function __(e,t){return`${e}-trigger-${t}`}function S_(e,t){return`${e}-content-${t}`}const rR=X4,C_=Z4,E_=eR,O_=nR,P_=rR,k_=de.forwardRef(({className:e,...t},n)=>_.jsx(C_,{ref:n,className:ke("inline-flex h-10 items-center justify-center rounded-md bg-muted p-1 text-muted-foreground",e),...t}));k_.displayName=C_.displayName;const qm=de.forwardRef(({className:e,...t},n)=>_.jsx(E_,{ref:n,className:ke("inline-flex items-center justify-center whitespace-nowrap rounded-sm px-3 py-1.5 text-sm font-medium ring-offset-background transition-all focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 data-[state=active]:bg-background data-[state=active]:text-foreground data-[state=active]:shadow-sm",e),...t}));qm.displayName=E_.displayName;const Ef=de.forwardRef(({className:e,...t},n)=>_.jsx(O_,{ref:n,className:ke("mt-2 ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2",e),...t}));Ef.displayName=O_.displayName;var D_={exports:{}},Kc={},Gm={exports:{}};(function(e,t){(function(n,r){r(t)})(Ho,function(n){function r(ne){return function(re,we,U,Ne,le,je,Ue){return ne(re,we,Ue)}}function i(ne){return function(re,we,U,Ne){if(!re||!we||typeof re!="object"||typeof we!="object")return ne(re,we,U,Ne);var le=Ne.get(re),je=Ne.get(we);if(le&&je)return le===we&&je===re;Ne.set(re,we),Ne.set(we,re);var Ue=ne(re,we,U,Ne);return Ne.delete(re),Ne.delete(we),Ue}}function o(ne,J){var re={};for(var we in ne)re[we]=ne[we];for(var we in J)re[we]=J[we];return re}function s(ne){return ne.constructor===Object||ne.constructor==null}function a(ne){return typeof ne.then=="function"}function l(ne,J){return ne===J||ne!==ne&&J!==J}var c="[object Arguments]",d="[object Boolean]",f="[object Date]",g="[object RegExp]",p="[object Map]",v="[object Number]",y="[object Object]",x="[object Set]",w="[object String]",S=Object.prototype.toString;function C(ne){var J=ne.areArraysEqual,re=ne.areDatesEqual,we=ne.areMapsEqual,U=ne.areObjectsEqual,Ne=ne.areRegExpsEqual,le=ne.areSetsEqual,je=ne.createIsNestedEqual,Ue=je(tt);function tt(qe,gt,Gt){if(qe===gt)return!0;if(!qe||!gt||typeof qe!="object"||typeof gt!="object")return qe!==qe&>!==gt;if(s(qe)&&s(gt))return U(qe,gt,Ue,Gt);var Bt=Array.isArray(qe),gn=Array.isArray(gt);if(Bt||gn)return Bt===gn&&J(qe,gt,Ue,Gt);var Rt=S.call(qe);return Rt!==S.call(gt)?!1:Rt===f?re(qe,gt,Ue,Gt):Rt===g?Ne(qe,gt,Ue,Gt):Rt===p?we(qe,gt,Ue,Gt):Rt===x?le(qe,gt,Ue,Gt):Rt===y||Rt===c?a(qe)||a(gt)?!1:U(qe,gt,Ue,Gt):Rt===d||Rt===v||Rt===w?l(qe.valueOf(),gt.valueOf()):!1}return tt}function P(ne,J,re,we){var U=ne.length;if(J.length!==U)return!1;for(;U-- >0;)if(!re(ne[U],J[U],U,U,ne,J,we))return!1;return!0}var O=i(P);function k(ne,J){return l(ne.valueOf(),J.valueOf())}function M(ne,J,re,we){var U=ne.size===J.size;if(!U)return!1;if(!ne.size)return!0;var Ne={},le=0;return ne.forEach(function(je,Ue){if(U){var tt=!1,qe=0;J.forEach(function(gt,Gt){!tt&&!Ne[qe]&&(tt=re(Ue,Gt,le,qe,ne,J,we)&&re(je,gt,Ue,Gt,ne,J,we))&&(Ne[qe]=!0),qe++}),le++,U=tt}}),U}var N=i(M),F="_owner",j=Object.prototype.hasOwnProperty;function B(ne,J,re,we){var U=Object.keys(ne),Ne=U.length;if(Object.keys(J).length!==Ne)return!1;for(var le;Ne-- >0;){if(le=U[Ne],le===F){var je=!!ne.$$typeof,Ue=!!J.$$typeof;if((je||Ue)&&je!==Ue)return!1}if(!j.call(J,le)||!re(ne[le],J[le],le,le,ne,J,we))return!1}return!0}var V=i(B);function G(ne,J){return ne.source===J.source&&ne.flags===J.flags}function te(ne,J,re,we){var U=ne.size===J.size;if(!U)return!1;if(!ne.size)return!0;var Ne={};return ne.forEach(function(le,je){if(U){var Ue=!1,tt=0;J.forEach(function(qe,gt){!Ue&&!Ne[tt]&&(Ue=re(le,qe,je,gt,ne,J,we))&&(Ne[tt]=!0),tt++}),U=Ue}}),U}var $=i(te),Z=Object.freeze({areArraysEqual:P,areDatesEqual:k,areMapsEqual:M,areObjectsEqual:B,areRegExpsEqual:G,areSetsEqual:te,createIsNestedEqual:r}),q=Object.freeze({areArraysEqual:O,areDatesEqual:k,areMapsEqual:N,areObjectsEqual:V,areRegExpsEqual:G,areSetsEqual:$,createIsNestedEqual:r}),X=C(Z);function ae(ne,J){return X(ne,J,void 0)}var A=C(o(Z,{createIsNestedEqual:function(){return l}}));function H(ne,J){return A(ne,J,void 0)}var ie=C(q);function R(ne,J){return ie(ne,J,new WeakMap)}var ue=C(o(q,{createIsNestedEqual:function(){return l}}));function ye(ne,J){return ue(ne,J,new WeakMap)}function pe(ne){return C(o(Z,ne(Z)))}function he(ne){var J=C(o(q,ne(q)));return function(re,we,U){return U===void 0&&(U=new WeakMap),J(re,we,U)}}n.circularDeepEqual=R,n.circularShallowEqual=ye,n.createCustomCircularEqual=he,n.createCustomEqual=pe,n.deepEqual=ae,n.sameValueZeroEqual=l,n.shallowEqual=H,Object.defineProperty(n,"__esModule",{value:!0})})})(Gm,Gm.exports);var Ym=Gm.exports;const Km=am(kN);var bt={},iR=function(t,n,r){return t===n?!0:t.className===n.className&&r(t.style,n.style)&&t.width===n.width&&t.autoSize===n.autoSize&&t.cols===n.cols&&t.draggableCancel===n.draggableCancel&&t.draggableHandle===n.draggableHandle&&r(t.verticalCompact,n.verticalCompact)&&r(t.compactType,n.compactType)&&r(t.layout,n.layout)&&r(t.margin,n.margin)&&r(t.containerPadding,n.containerPadding)&&t.rowHeight===n.rowHeight&&t.maxRows===n.maxRows&&t.isBounded===n.isBounded&&t.isDraggable===n.isDraggable&&t.isResizable===n.isResizable&&t.allowOverlap===n.allowOverlap&&t.preventCollision===n.preventCollision&&t.useCSSTransforms===n.useCSSTransforms&&t.transformScale===n.transformScale&&t.isDroppable===n.isDroppable&&r(t.resizeHandles,n.resizeHandles)&&r(t.resizeHandle,n.resizeHandle)&&t.onLayoutChange===n.onLayoutChange&&t.onDragStart===n.onDragStart&&t.onDrag===n.onDrag&&t.onDragStop===n.onDragStop&&t.onResizeStart===n.onResizeStart&&t.onResize===n.onResize&&t.onResizeStop===n.onResizeStop&&t.onDrop===n.onDrop&&r(t.droppingItem,n.droppingItem)&&r(t.innerRef,n.innerRef)};Object.defineProperty(bt,"__esModule",{value:!0}),bt.bottom=Xm,bt.childrenEqual=lR,bt.cloneLayout=T_,bt.cloneLayoutItem=Us,bt.collides=Of,bt.compact=I_,bt.compactItem=N_,bt.compactType=bR,bt.correctBounds=R_,bt.fastPositionEqual=uR,bt.fastRGLPropsEqual=void 0,bt.getAllCollisions=L_,bt.getFirstCollision=qs,bt.getLayoutItem=Zm,bt.getStatics=Jm,bt.modifyLayout=A_,bt.moveElement=Qc,bt.moveElementAwayFromCollision=ev,bt.noop=void 0,bt.perc=fR,bt.resizeItemInDirection=pR,bt.setTopLeft=mR,bt.setTransform=gR,bt.sortLayoutItems=sv,bt.sortLayoutItemsByColRow=B_,bt.sortLayoutItemsByRowCol=z_,bt.synchronizeLayoutWithChildren=vR,bt.validateLayout=V_,bt.withLayoutItem=aR;var M_=Ym,Xc=oR(m);function oR(e){return e&&e.__esModule?e:{default:e}}const sR=process.env.NODE_ENV==="production";function Xm(e){let t=0,n;for(let r=0,i=e.length;r<i;r++)n=e[r].y+e[r].h,n>t&&(t=n);return t}function T_(e){const t=Array(e.length);for(let n=0,r=e.length;n<r;n++)t[n]=Us(e[n]);return t}function A_(e,t){const n=Array(e.length);for(let r=0,i=e.length;r<i;r++)t.i===e[r].i?n[r]=t:n[r]=e[r];return n}function aR(e,t,n){let r=Zm(e,t);return r?(r=n(Us(r)),e=A_(e,r),[e,r]):[e,null]}function Us(e){return{w:e.w,h:e.h,x:e.x,y:e.y,i:e.i,minW:e.minW,maxW:e.maxW,minH:e.minH,maxH:e.maxH,moved:!!e.moved,static:!!e.static,isDraggable:e.isDraggable,isResizable:e.isResizable,resizeHandles:e.resizeHandles,isBounded:e.isBounded}}function lR(e,t){return(0,M_.deepEqual)(Xc.default.Children.map(e,n=>n==null?void 0:n.key),Xc.default.Children.map(t,n=>n==null?void 0:n.key))&&(0,M_.deepEqual)(Xc.default.Children.map(e,n=>n==null?void 0:n.props["data-grid"]),Xc.default.Children.map(t,n=>n==null?void 0:n.props["data-grid"]))}const cR=iR;bt.fastRGLPropsEqual=cR;function uR(e,t){return e.left===t.left&&e.top===t.top&&e.width===t.width&&e.height===t.height}function Of(e,t){return!(e.i===t.i||e.x+e.w<=t.x||e.x>=t.x+t.w||e.y+e.h<=t.y||e.y>=t.y+t.h)}function I_(e,t,n,r){const i=Jm(e),o=sv(e,t),s=Array(e.length);for(let a=0,l=o.length;a<l;a++){let c=Us(o[a]);c.static||(c=N_(i,c,t,n,o,r),i.push(c)),s[e.indexOf(o[a])]=c,c.moved=!1}return s}const dR={x:"w",y:"h"};function Qm(e,t,n,r){const i=dR[r];t[r]+=1;const o=e.map(s=>s.i).indexOf(t.i);for(let s=o+1;s<e.length;s++){const a=e[s];if(!a.static){if(a.y>t.y+t.h)break;Of(t,a)&&Qm(e,a,n+t[i],r)}}t[r]=n}function N_(e,t,n,r,i,o){const s=n==="vertical",a=n==="horizontal";if(s)for(t.y=Math.min(Xm(e),t.y);t.y>0&&!qs(e,t);)t.y--;else if(a)for(;t.x>0&&!qs(e,t);)t.x--;let l;for(;(l=qs(e,t))&&!(n===null&&o);)if(a?Qm(i,t,l.x+l.w,"x"):Qm(i,t,l.y+l.h,"y"),a&&t.x+t.w>r)for(t.x=r-t.w,t.y++;t.x>0&&!qs(e,t);)t.x--;return t.y=Math.max(t.y,0),t.x=Math.max(t.x,0),t}function R_(e,t){const n=Jm(e);for(let r=0,i=e.length;r<i;r++){const o=e[r];if(o.x+o.w>t.cols&&(o.x=t.cols-o.w),o.x<0&&(o.x=0,o.w=t.cols),!o.static)n.push(o);else for(;qs(n,o);)o.y++}return e}function Zm(e,t){for(let n=0,r=e.length;n<r;n++)if(e[n].i===t)return e[n]}function qs(e,t){for(let n=0,r=e.length;n<r;n++)if(Of(e[n],t))return e[n]}function L_(e,t){return e.filter(n=>Of(n,t))}function Jm(e){return e.filter(t=>t.static)}function Qc(e,t,n,r,i,o,s,a,l){if(t.static&&t.isDraggable!==!0||t.y===r&&t.x===n)return e;"Moving element ".concat(t.i," to [").concat(String(n),",").concat(String(r),"] from [").concat(t.x,",").concat(t.y,"]");const c=t.x,d=t.y;typeof n=="number"&&(t.x=n),typeof r=="number"&&(t.y=r),t.moved=!0;let f=sv(e,s);(s==="vertical"&&typeof r=="number"?d>=r:s==="horizontal"&&typeof n=="number"?c>=n:!1)&&(f=f.reverse());const p=L_(f,t),v=p.length>0;if(v&&l)return T_(e);if(v&&o)return"Collision prevented on ".concat(t.i,", reverting."),t.x=c,t.y=d,t.moved=!1,e;for(let y=0,x=p.length;y<x;y++){const w=p[y];"Resolving collision between ".concat(t.i," at [").concat(t.x,",").concat(t.y,"] and ").concat(w.i," at [").concat(w.x,",").concat(w.y,"]"),!w.moved&&(w.static?e=ev(e,w,t,i,s):e=ev(e,t,w,i,s))}return e}function ev(e,t,n,r,i,o){const s=i==="horizontal",a=i==="vertical",l=t.static;if(r){r=!1;const f={x:s?Math.max(t.x-n.w,0):n.x,y:a?Math.max(t.y-n.h,0):n.y,w:n.w,h:n.h,i:"-1"},g=qs(e,f),p=g&&g.y+g.h>t.y,v=g&&t.x+t.w>g.x;if(g){if(p&&a)return Qc(e,n,void 0,t.y+1,r,l,i);if(p&&i==null)return t.y=n.y,n.y=n.y+n.h,e;if(v&&s)return Qc(e,t,n.x,void 0,r,l,i)}else return"Doing reverse collision on ".concat(n.i," up to [").concat(f.x,",").concat(f.y,"]."),Qc(e,n,s?f.x:void 0,a?f.y:void 0,r,l,i)}const c=s?n.x+1:void 0,d=a?n.y+1:void 0;return c==null&&d==null?e:Qc(e,n,s?n.x+1:void 0,a?n.y+1:void 0,r,l,i)}function fR(e){return e*100+"%"}const F_=(e,t,n,r)=>e+n>r?t:n,$_=(e,t,n)=>e<0?t:n,j_=e=>Math.max(0,e),tv=e=>Math.max(0,e),nv=(e,t,n)=>{let{left:r,height:i,width:o}=t;const s=e.top-(i-e.height);return{left:r,width:o,height:$_(s,e.height,i),top:tv(s)}},rv=(e,t,n)=>{let{top:r,left:i,height:o,width:s}=t;return{top:r,height:o,width:F_(e.left,e.width,s,n),left:j_(i)}},iv=(e,t,n)=>{let{top:r,height:i,width:o}=t;const s=e.left-(o-e.width);return{height:i,width:s<0?e.width:F_(e.left,e.width,o,n),top:tv(r),left:j_(s)}},ov=(e,t,n)=>{let{top:r,left:i,height:o,width:s}=t;return{width:s,left:i,height:$_(r,e.height,o),top:tv(r)}},hR={n:nv,ne:function(){return nv(arguments.length<=0?void 0:arguments[0],rv(...arguments))},e:rv,se:function(){return ov(arguments.length<=0?void 0:arguments[0],rv(...arguments))},s:ov,sw:function(){return ov(arguments.length<=0?void 0:arguments[0],iv(...arguments))},w:iv,nw:function(){return nv(arguments.length<=0?void 0:arguments[0],iv(...arguments))}};function pR(e,t,n,r){const i=hR[e];return i?i(t,{...t,...n},r):n}function gR(e){let{top:t,left:n,width:r,height:i}=e;const o="translate(".concat(n,"px,").concat(t,"px)");return{transform:o,WebkitTransform:o,MozTransform:o,msTransform:o,OTransform:o,width:"".concat(r,"px"),height:"".concat(i,"px"),position:"absolute"}}function mR(e){let{top:t,left:n,width:r,height:i}=e;return{top:"".concat(t,"px"),left:"".concat(n,"px"),width:"".concat(r,"px"),height:"".concat(i,"px"),position:"absolute"}}function sv(e,t){return t==="horizontal"?B_(e):t==="vertical"?z_(e):e}function z_(e){return e.slice(0).sort(function(t,n){return t.y>n.y||t.y===n.y&&t.x>n.x?1:t.y===n.y&&t.x===n.x?0:-1})}function B_(e){return e.slice(0).sort(function(t,n){return t.x>n.x||t.x===n.x&&t.y>n.y?1:-1})}function vR(e,t,n,r,i){e=e||[];const o=[];Xc.default.Children.forEach(t,a=>{if((a==null?void 0:a.key)==null)return;const l=Zm(e,String(a.key)),c=a.props["data-grid"];l&&c==null?o.push(Us(l)):c?(sR||V_([c],"ReactGridLayout.children"),o.push(Us({...c,i:a.key}))):o.push(Us({w:1,h:1,x:0,y:Xm(o),i:String(a.key)}))});const s=R_(o,{cols:n});return i?s:I_(s,r,n)}function V_(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"Layout";const n=["x","y","w","h"];if(!Array.isArray(e))throw new Error(t+" must be an array!");for(let r=0,i=e.length;r<i;r++){const o=e[r];for(let s=0;s<n.length;s++)if(typeof o[n[s]]!="number")throw new Error("ReactGridLayout: "+t+"["+r+"]."+n[s]+" must be a number!")}}function bR(e){const{verticalCompact:t,compactType:n}=e||{};return t===!1?null:n}function ife(){}const yR=()=>{};bt.noop=yR;var Ai={};Object.defineProperty(Ai,"__esModule",{value:!0}),Ai.calcGridColWidth=Pf,Ai.calcGridItemPosition=xR,Ai.calcGridItemWHPx=av,Ai.calcWH=_R,Ai.calcXY=wR,Ai.clamp=Gs;function Pf(e){const{margin:t,containerPadding:n,containerWidth:r,cols:i}=e;return(r-t[0]*(i-1)-n[0]*2)/i}function av(e,t,n){return Number.isFinite(e)?Math.round(t*e+Math.max(0,e-1)*n):e}function xR(e,t,n,r,i,o){const{margin:s,containerPadding:a,rowHeight:l}=e,c=Pf(e),d={};return o&&o.resizing?(d.width=Math.round(o.resizing.width),d.height=Math.round(o.resizing.height)):(d.width=av(r,c,s[0]),d.height=av(i,l,s[1])),o&&o.dragging?(d.top=Math.round(o.dragging.top),d.left=Math.round(o.dragging.left)):o&&o.resizing&&typeof o.resizing.top=="number"&&typeof o.resizing.left=="number"?(d.top=Math.round(o.resizing.top),d.left=Math.round(o.resizing.left)):(d.top=Math.round((l+s[1])*n+a[1]),d.left=Math.round((c+s[0])*t+a[0])),d}function wR(e,t,n,r,i){const{margin:o,cols:s,rowHeight:a,maxRows:l}=e,c=Pf(e);let d=Math.round((n-o[0])/(c+o[0])),f=Math.round((t-o[1])/(a+o[1]));return d=Gs(d,0,s-r),f=Gs(f,0,l-i),{x:d,y:f}}function _R(e,t,n,r,i,o){const{margin:s,maxRows:a,cols:l,rowHeight:c}=e,d=Pf(e);let f=Math.round((t+s[0])/(d+s[0])),g=Math.round((n+s[1])/(c+s[1])),p=Gs(f,0,l-r),v=Gs(g,0,a-i);return["sw","w","nw"].indexOf(o)!==-1&&(p=Gs(f,0,l)),["nw","n","ne"].indexOf(o)!==-1&&(v=Gs(g,0,a)),{w:p,h:v}}function Gs(e,t,n){return Math.max(Math.min(e,n),t)}var kf={},lv={exports:{}},cv,H_;function uv(){if(H_)return cv;H_=1;var e="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED";return cv=e,cv}var dv,W_;function SR(){if(W_)return dv;W_=1;var e=uv();function t(){}function n(){}return n.resetWarningCache=t,dv=function(){function r(s,a,l,c,d,f){if(f!==e){var g=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw g.name="Invariant Violation",g}}r.isRequired=r;function i(){return r}var o={array:r,bigint:r,bool:r,func:r,number:r,object:r,string:r,symbol:r,any:r,arrayOf:i,element:r,elementType:r,instanceOf:i,node:r,objectOf:i,oneOf:i,oneOfType:i,shape:i,exact:i,checkPropTypes:n,resetWarningCache:t};return o.PropTypes=o,o},dv}var Df={exports:{}},At={};/** @license React v16.13.1
|
|
86
86
|
* react-is.development.js
|
|
87
87
|
*
|
|
88
88
|
* Copyright (c) Facebook, Inc. and its affiliates.
|