@applica-software-guru/react-admin 1.3.153 → 1.3.155

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.
@@ -94,7 +94,7 @@ __p += '`),Ze&&(se+=`' +
94
94
  function print() { __p += __j.call(arguments, '') }
95
95
  `:`;
96
96
  `)+se+`return __p
97
- }`;var Ye=Cm(function(){return tt(T,be+"return "+se).apply(n,M)});if(Ye.source=se,XA(Ye))throw Ye;return Ye}function _S(i){return rt(i).toLowerCase()}function $S(i){return rt(i).toUpperCase()}function eR(i,a,d){if(i=rt(i),i&&(d||a===n))return xh(i);if(!i||!(a=xn(a)))return i;var E=ir(i),y=ir(a),T=wh(E,y),M=Th(E,y)+1;return io(E,T,M).join("")}function tR(i,a,d){if(i=rt(i),i&&(d||a===n))return i.slice(0,Sh(i)+1);if(!i||!(a=xn(a)))return i;var E=ir(i),y=Th(E,ir(a))+1;return io(E,0,y).join("")}function nR(i,a,d){if(i=rt(i),i&&(d||a===n))return i.replace(Sr,"");if(!i||!(a=xn(a)))return i;var E=ir(i),y=wh(E,ir(a));return io(E,y).join("")}function rR(i,a){var d=U,E=_;if(Pt(a)){var y="separator"in a?a.separator:y;d="length"in a?He(a.length):d,E="omission"in a?xn(a.omission):E}i=rt(i);var T=i.length;if(hi(i)){var M=ir(i);T=M.length}if(d>=T)return i;var N=d-Ci(E);if(N<1)return E;var Y=M?io(M,0,N).join(""):i.slice(0,N);if(y===n)return Y+E;if(M&&(N+=Y.length-N),ZA(y)){if(i.slice(N).search(y)){var re,oe=Y;for(y.global||(y=gA(y.source,rt(xs.exec(y))+"g")),y.lastIndex=0;re=y.exec(oe);)var se=re.index;Y=Y.slice(0,se===n?N:se)}}else if(i.indexOf(xn(y),N)!=N){var Ee=Y.lastIndexOf(y);Ee>-1&&(Y=Y.slice(0,Ee))}return Y+E}function oR(i){return i=rt(i),i&&Ya.test(i)?i.replace(Ua,j1):i}var iR=bi(function(i,a,d){return i+(d?" ":"")+a.toUpperCase()}),ed=mC("toUpperCase");function hm(i,a,d){return i=rt(i),a=d?n:a,a===n?T1(i)?k1(i):E1(i):i.match(a)||[]}var Cm=qe(function(i,a){try{return bn(i,n,a)}catch(d){return XA(d)?d:new Fe(d)}}),sR=Dr(function(i,a){return Hn(a,function(d){d=Ir(d),jr(i,d,qA(i[d],i))}),i});function aR(i){var a=i==null?0:i.length,d=Re();return i=a?Qt(i,function(E){if(typeof E[1]!="function")throw new Wn(l);return[d(E[0]),E[1]]}):[],qe(function(E){for(var y=-1;++y<a;){var T=i[y];if(bn(T[0],this,E))return bn(T[1],this,E)}})}function lR(i){return jw(Un(i,C))}function td(i){return function(){return i}}function cR(i,a){return i==null||i!==i?a:i}var uR=IC(),AR=IC(!0);function Cn(i){return i}function nd(i){return Xh(typeof i=="function"?i:Un(i,C))}function dR(i){return _h(Un(i,C))}function gR(i,a){return $h(i,Un(a,C))}var fR=qe(function(i,a){return function(d){return Ds(d,i,a)}}),pR=qe(function(i,a){return function(d){return Ds(i,d,a)}});function rd(i,a,d){var E=Jt(a),y=El(a,E);d==null&&!(Pt(a)&&(y.length||!E.length))&&(d=a,a=i,i=this,y=El(a,Jt(a)));var T=!(Pt(d)&&"chain"in d)||!!d.chain,M=Fr(i);return Hn(y,function(N){var Y=a[N];i[N]=Y,M&&(i.prototype[N]=function(){var re=this.__chain__;if(T||re){var oe=i(this.__wrapped__),se=oe.__actions__=fn(this.__actions__);return se.push({func:Y,args:arguments,thisArg:i}),oe.__chain__=re,oe}return Y.apply(i,$r([this.value()],arguments))})}),i}function hR(){return $t._===this&&($t._=W1),this}function od(){}function CR(i){return i=He(i),qe(function(a){return eC(a,i)})}var mR=DA(Qt),ER=DA(Bh),IR=DA(sA);function mm(i){return WA(i)?aA(Ir(i)):Xw(i)}function BR(i){return function(a){return i==null?n:No(i,a)}}var vR=vC(),yR=vC(!0);function id(){return[]}function sd(){return!1}function bR(){return{}}function QR(){return""}function xR(){return!0}function wR(i,a){if(i=He(i),i<1||i>F)return[];var d=X,E=tn(i,X);a=Re(a),i-=X;for(var y=uA(E,a);++d<i;)a(d);return y}function TR(i){return Le(i)?Qt(i,Ir):wn(i)?[i]:fn(LC(rt(i)))}function PR(i){var a=++V1;return rt(i)+a}var SR=Ql(function(i,a){return i+a},0),RR=kA("ceil"),OR=Ql(function(i,a){return i/a},1),jR=kA("floor");function MR(i){return i&&i.length?ml(i,Cn,BA):n}function DR(i,a){return i&&i.length?ml(i,Re(a,2),BA):n}function kR(i){return bh(i,Cn)}function FR(i,a){return bh(i,Re(a,2))}function LR(i){return i&&i.length?ml(i,Cn,QA):n}function NR(i,a){return i&&i.length?ml(i,Re(a,2),QA):n}var VR=Ql(function(i,a){return i*a},1),HR=kA("round"),WR=Ql(function(i,a){return i-a},0);function zR(i){return i&&i.length?cA(i,Cn):0}function UR(i,a){return i&&i.length?cA(i,Re(a,2)):0}return Q.after=dP,Q.ary=JC,Q.assign=$P,Q.assignIn=cm,Q.assignInWith=Ll,Q.assignWith=eS,Q.at=tS,Q.before=XC,Q.bind=qA,Q.bindAll=sR,Q.bindKey=ZC,Q.castArray=bP,Q.chain=GC,Q.chunk=jT,Q.compact=MT,Q.concat=DT,Q.cond=aR,Q.conforms=lR,Q.constant=td,Q.countBy=z2,Q.create=nS,Q.curry=_C,Q.curryRight=$C,Q.debounce=em,Q.defaults=rS,Q.defaultsDeep=oS,Q.defer=gP,Q.delay=fP,Q.difference=kT,Q.differenceBy=FT,Q.differenceWith=LT,Q.drop=NT,Q.dropRight=VT,Q.dropRightWhile=HT,Q.dropWhile=WT,Q.fill=zT,Q.filter=Y2,Q.flatMap=q2,Q.flatMapDeep=J2,Q.flatMapDepth=X2,Q.flatten=WC,Q.flattenDeep=UT,Q.flattenDepth=YT,Q.flip=pP,Q.flow=uR,Q.flowRight=AR,Q.fromPairs=GT,Q.functions=AS,Q.functionsIn=dS,Q.groupBy=Z2,Q.initial=qT,Q.intersection=JT,Q.intersectionBy=XT,Q.intersectionWith=ZT,Q.invert=fS,Q.invertBy=pS,Q.invokeMap=$2,Q.iteratee=nd,Q.keyBy=eP,Q.keys=Jt,Q.keysIn=hn,Q.map=Ol,Q.mapKeys=CS,Q.mapValues=mS,Q.matches=dR,Q.matchesProperty=gR,Q.memoize=Ml,Q.merge=ES,Q.mergeWith=um,Q.method=fR,Q.methodOf=pR,Q.mixin=rd,Q.negate=Dl,Q.nthArg=CR,Q.omit=IS,Q.omitBy=BS,Q.once=hP,Q.orderBy=tP,Q.over=mR,Q.overArgs=CP,Q.overEvery=ER,Q.overSome=IR,Q.partial=JA,Q.partialRight=tm,Q.partition=nP,Q.pick=vS,Q.pickBy=Am,Q.property=mm,Q.propertyOf=BR,Q.pull=t2,Q.pullAll=UC,Q.pullAllBy=n2,Q.pullAllWith=r2,Q.pullAt=o2,Q.range=vR,Q.rangeRight=yR,Q.rearg=mP,Q.reject=iP,Q.remove=i2,Q.rest=EP,Q.reverse=GA,Q.sampleSize=aP,Q.set=bS,Q.setWith=QS,Q.shuffle=lP,Q.slice=s2,Q.sortBy=AP,Q.sortedUniq=g2,Q.sortedUniqBy=f2,Q.split=qS,Q.spread=IP,Q.tail=p2,Q.take=h2,Q.takeRight=C2,Q.takeRightWhile=m2,Q.takeWhile=E2,Q.tap=M2,Q.throttle=BP,Q.thru=Rl,Q.toArray=sm,Q.toPairs=dm,Q.toPairsIn=gm,Q.toPath=TR,Q.toPlainObject=lm,Q.transform=xS,Q.unary=vP,Q.union=I2,Q.unionBy=B2,Q.unionWith=v2,Q.uniq=y2,Q.uniqBy=b2,Q.uniqWith=Q2,Q.unset=wS,Q.unzip=KA,Q.unzipWith=YC,Q.update=TS,Q.updateWith=PS,Q.values=wi,Q.valuesIn=SS,Q.without=x2,Q.words=hm,Q.wrap=yP,Q.xor=w2,Q.xorBy=T2,Q.xorWith=P2,Q.zip=S2,Q.zipObject=R2,Q.zipObjectDeep=O2,Q.zipWith=j2,Q.entries=dm,Q.entriesIn=gm,Q.extend=cm,Q.extendWith=Ll,rd(Q,Q),Q.add=SR,Q.attempt=Cm,Q.camelCase=MS,Q.capitalize=fm,Q.ceil=RR,Q.clamp=RS,Q.clone=QP,Q.cloneDeep=wP,Q.cloneDeepWith=TP,Q.cloneWith=xP,Q.conformsTo=PP,Q.deburr=pm,Q.defaultTo=cR,Q.divide=OR,Q.endsWith=DS,Q.eq=ar,Q.escape=kS,Q.escapeRegExp=FS,Q.every=U2,Q.find=G2,Q.findIndex=VC,Q.findKey=iS,Q.findLast=K2,Q.findLastIndex=HC,Q.findLastKey=sS,Q.floor=jR,Q.forEach=KC,Q.forEachRight=qC,Q.forIn=aS,Q.forInRight=lS,Q.forOwn=cS,Q.forOwnRight=uS,Q.get=_A,Q.gt=SP,Q.gte=RP,Q.has=gS,Q.hasIn=$A,Q.head=zC,Q.identity=Cn,Q.includes=_2,Q.indexOf=KT,Q.inRange=OS,Q.invoke=hS,Q.isArguments=Wo,Q.isArray=Le,Q.isArrayBuffer=OP,Q.isArrayLike=pn,Q.isArrayLikeObject=Ft,Q.isBoolean=jP,Q.isBuffer=so,Q.isDate=MP,Q.isElement=DP,Q.isEmpty=kP,Q.isEqual=FP,Q.isEqualWith=LP,Q.isError=XA,Q.isFinite=NP,Q.isFunction=Fr,Q.isInteger=nm,Q.isLength=kl,Q.isMap=rm,Q.isMatch=VP,Q.isMatchWith=HP,Q.isNaN=WP,Q.isNative=zP,Q.isNil=YP,Q.isNull=UP,Q.isNumber=om,Q.isObject=Pt,Q.isObjectLike=Ot,Q.isPlainObject=Hs,Q.isRegExp=ZA,Q.isSafeInteger=GP,Q.isSet=im,Q.isString=Fl,Q.isSymbol=wn,Q.isTypedArray=xi,Q.isUndefined=KP,Q.isWeakMap=qP,Q.isWeakSet=JP,Q.join=_T,Q.kebabCase=LS,Q.last=Gn,Q.lastIndexOf=$T,Q.lowerCase=NS,Q.lowerFirst=VS,Q.lt=XP,Q.lte=ZP,Q.max=MR,Q.maxBy=DR,Q.mean=kR,Q.meanBy=FR,Q.min=LR,Q.minBy=NR,Q.stubArray=id,Q.stubFalse=sd,Q.stubObject=bR,Q.stubString=QR,Q.stubTrue=xR,Q.multiply=VR,Q.nth=e2,Q.noConflict=hR,Q.noop=od,Q.now=jl,Q.pad=HS,Q.padEnd=WS,Q.padStart=zS,Q.parseInt=US,Q.random=jS,Q.reduce=rP,Q.reduceRight=oP,Q.repeat=YS,Q.replace=GS,Q.result=yS,Q.round=HR,Q.runInContext=z,Q.sample=sP,Q.size=cP,Q.snakeCase=KS,Q.some=uP,Q.sortedIndex=a2,Q.sortedIndexBy=l2,Q.sortedIndexOf=c2,Q.sortedLastIndex=u2,Q.sortedLastIndexBy=A2,Q.sortedLastIndexOf=d2,Q.startCase=JS,Q.startsWith=XS,Q.subtract=WR,Q.sum=zR,Q.sumBy=UR,Q.template=ZS,Q.times=wR,Q.toFinite=Lr,Q.toInteger=He,Q.toLength=am,Q.toLower=_S,Q.toNumber=Kn,Q.toSafeInteger=_P,Q.toString=rt,Q.toUpper=$S,Q.trim=eR,Q.trimEnd=tR,Q.trimStart=nR,Q.truncate=rR,Q.unescape=oR,Q.uniqueId=PR,Q.upperCase=iR,Q.upperFirst=ed,Q.each=KC,Q.eachRight=qC,Q.first=zC,rd(Q,function(){var i={};return mr(Q,function(a,d){At.call(Q.prototype,d)||(i[d]=a)}),i}(),{chain:!1}),Q.VERSION=r,Hn(["bind","bindKey","curry","curryRight","partial","partialRight"],function(i){Q[i].placeholder=Q}),Hn(["drop","take"],function(i,a){Xe.prototype[i]=function(d){d=d===n?1:Kt(He(d),0);var E=this.__filtered__&&!a?new Xe(this):this.clone();return E.__filtered__?E.__takeCount__=tn(d,E.__takeCount__):E.__views__.push({size:tn(d,X),type:i+(E.__dir__<0?"Right":"")}),E},Xe.prototype[i+"Right"]=function(d){return this.reverse()[i](d).reverse()}}),Hn(["filter","map","takeWhile"],function(i,a){var d=a+1,E=d==Z||d==V;Xe.prototype[i]=function(y){var T=this.clone();return T.__iteratees__.push({iteratee:Re(y,3),type:d}),T.__filtered__=T.__filtered__||E,T}}),Hn(["head","last"],function(i,a){var d="take"+(a?"Right":"");Xe.prototype[i]=function(){return this[d](1).value()[0]}}),Hn(["initial","tail"],function(i,a){var d="drop"+(a?"":"Right");Xe.prototype[i]=function(){return this.__filtered__?new Xe(this):this[d](1)}}),Xe.prototype.compact=function(){return this.filter(Cn)},Xe.prototype.find=function(i){return this.filter(i).head()},Xe.prototype.findLast=function(i){return this.reverse().find(i)},Xe.prototype.invokeMap=qe(function(i,a){return typeof i=="function"?new Xe(this):this.map(function(d){return Ds(d,i,a)})}),Xe.prototype.reject=function(i){return this.filter(Dl(Re(i)))},Xe.prototype.slice=function(i,a){i=He(i);var d=this;return d.__filtered__&&(i>0||a<0)?new Xe(d):(i<0?d=d.takeRight(-i):i&&(d=d.drop(i)),a!==n&&(a=He(a),d=a<0?d.dropRight(-a):d.take(a-i)),d)},Xe.prototype.takeRightWhile=function(i){return this.reverse().takeWhile(i).reverse()},Xe.prototype.toArray=function(){return this.take(X)},mr(Xe.prototype,function(i,a){var d=/^(?:filter|find|map|reject)|While$/.test(a),E=/^(?:head|last)$/.test(a),y=Q[E?"take"+(a=="last"?"Right":""):a],T=E||/^find/.test(a);y&&(Q.prototype[a]=function(){var M=this.__wrapped__,N=E?[1]:arguments,Y=M instanceof Xe,re=N[0],oe=Y||Le(M),se=function(Je){var Ze=y.apply(Q,$r([Je],N));return E&&Ee?Ze[0]:Ze};oe&&d&&typeof re=="function"&&re.length!=1&&(Y=oe=!1);var Ee=this.__chain__,be=!!this.__actions__.length,Oe=T&&!Ee,Ye=Y&&!be;if(!T&&oe){M=Ye?M:new Xe(this);var je=i.apply(M,N);return je.__actions__.push({func:Rl,args:[se],thisArg:n}),new zn(je,Ee)}return Oe&&Ye?i.apply(this,N):(je=this.thru(se),Oe?E?je.value()[0]:je.value():je)})}),Hn(["pop","push","shift","sort","splice","unshift"],function(i){var a=rl[i],d=/^(?:push|sort|unshift)$/.test(i)?"tap":"thru",E=/^(?:pop|shift)$/.test(i);Q.prototype[i]=function(){var y=arguments;if(E&&!this.__chain__){var T=this.value();return a.apply(Le(T)?T:[],y)}return this[d](function(M){return a.apply(Le(M)?M:[],y)})}}),mr(Xe.prototype,function(i,a){var d=Q[a];if(d){var E=d.name+"";At.call(Bi,E)||(Bi[E]=[]),Bi[E].push({name:a,func:d})}}),Bi[bl(n,O).name]=[{name:"wrapper",func:n}],Xe.prototype.clone=ow,Xe.prototype.reverse=iw,Xe.prototype.value=sw,Q.prototype.at=D2,Q.prototype.chain=k2,Q.prototype.commit=F2,Q.prototype.next=L2,Q.prototype.plant=V2,Q.prototype.reverse=H2,Q.prototype.toJSON=Q.prototype.valueOf=Q.prototype.value=W2,Q.prototype.first=Q.prototype.head,Ts&&(Q.prototype[Ts]=N2),Q},mi=F1();Mo?((Mo.exports=mi)._=mi,nA._=mi):$t._=mi}).call(Xn)})(Ic,Ic.exports);var dt=Ic.exports;const Ae=bo(dt),$m=e=>function(){return e.apply(this,arguments)},ns=c.shape({id:c.string,title:c.string,type:c.oneOf(["group","item","collapse"]),icon:c.elementType,url:c.string,parent:c.shape($m(()=>ns)),children:c.arrayOf($m(()=>ns)),resource:c.bool}),$0={fontFamily:"'Inter', sans-serif",menuOrientation:"vertical",miniDrawer:!1,container:!1,mode:"light",presetColor:"theme4",themeDirection:"ltr",appDefaultPath:"/",drawerWidth:260,horizontalMaxItems:6,spacing:2},Xg=w.createContext($0),_j=e=>e==="vertical",$j=e=>e==="horizontal",Bc=({initialConfig:e,children:t})=>{const[n,r]=of("theme-config",{...$0,...e}),o=I=>r(B=>({...B,fontFamily:I})),s=I=>r(B=>({...B,menuOrientation:I})),l=I=>r(B=>({...B,miniDrawer:I})),u=I=>r(B=>({...B,container:I})),A=I=>r(B=>({...B,mode:I})),g=I=>r(B=>({...B,presetColor:I})),p=I=>r(B=>({...B,themeDirection:I})),C=I=>r(B=>({...B,appDefaultPath:I})),h=I=>r(B=>({...B,drawerWidth:I})),m=I=>r(B=>({...B,horizontalMaxItems:I}));return f.jsx(Xg.Provider,{value:{...n,setFontFamily:o,setMenuOrientation:s,setMiniDrawer:l,setContainer:u,setMode:A,setPresetColor:g,setThemeDirection:p,setAppDefaultPath:C,setDrawerWidth:h,setHorizontalMaxItems:m,isVerticalLayout:_j,isHorizontalLayout:$j},children:t})};Bc.propTypes={children:c.node};const eB={openItem:["dashboard"],openComponent:"buttons",selectedID:null,drawerOpen:!1,componentDrawerOpen:!0,menuDashboard:{},error:null},Zg=w.createContext(eB),_g=({menu:e,children:t})=>{const[n,r]=of("menu-config",{...eB}),o=C=>{r(h=>({...h,openItem:C}))},s=C=>{r(h=>({...h,selectedID:C}))},l=C=>{r(h=>({...h,openComponent:C}))},u=C=>{r(h=>({...h,drawerOpen:C}))},A=C=>{r(h=>({...h,componentDrawerOpen:C}))},g=C=>{r(h=>({...h,menuDashboard:C}))},p=C=>{r(h=>({...h,error:C}))};return f.jsx(Zg.Provider,{value:{...n,groups:e,activeItem:o,activeComponent:l,openDrawer:u,openComponentDrawer:A,activeID:s,getMenuSuccess:g,hasError:p},children:t})};_g.propTypes={children:c.node,menu:c.arrayOf(ns)};const $g=w.createContext(void 0),ef=w.createContext(void 0),Io=()=>w.useContext(Zg),eM=["e-","entities/"],tM=e=>{let t=e;return eM.forEach(n=>{t=t!=null&&t.startsWith(n)?t==null?void 0:t.substring(n.length):t}),t},nM=(e,t)=>{var n,r;return((n=t.options)==null?void 0:n.group)===e.id||!((r=t.options)!=null&&r.group)&&e.id==="admin"},rM=(e,t)=>{const n=tM(e.name);return t==null?void 0:t.includes(`${n}:list`)},$d=(e,t)=>{let n=e.find(r=>r.id===t);if(!n)for(let r=0;r<e.length;r++){const o=e[r];if(o.children&&(n=$d(o.children,t),n))return n}return n},tB=(e,t,n)=>{let r=e.find(o=>["group","collapse"].indexOf(o.type)!==-1&&nM(o,t));if(!r)for(let o=0;o<e.length;o++){const s=e[o];if(s.children&&(r=tB(s.children,t),r))return r}return r},nB=(e,t)=>{let n=e.find(r=>r.id===t);if(!n)for(let r=0;r<e.length;r++){const o=e[r];if(o.children&&(n=nB(o.children,t),n))return n}return n},rB=e=>e?e.type==="item"?!0:(e.children&&(e.children=e.children.filter(rB)),e.children&&e.children.length>0):!1,oB=e=>(e.children&&e.children.forEach(t=>{t.parent=e,oB(t)}),e),oM=({userGroups:e,resources:t,permissions:n,translate:r,roles:o})=>{const s=C=>(C.title=r(C.title,{_:C.title}),C.children&&C.children.forEach(h=>s(h)),C),l=Object.keys(t),u=(C,h)=>(C.children&&(C.children=C.children.filter(m=>{if(m.resource===!1){const I=m.roles||[];return!!(I.length===0||I.some(B=>o.includes(B)))}return m.type==="item"?h.includes(m.id):(u(m,h),m.children&&m.children.length>0)})),C),A=dt.cloneDeep(e).map(C=>({type:"group",icon:et.AntDesignOutlined,children:[],...C})).map(s).map(C=>u(C,l)),g=Object.values(t).map(C=>{var h;return((h=C.options)==null?void 0:h.group)||"admin"}).filter((C,h,m)=>m.indexOf(C)===h).filter(C=>C!==void 0&&nB(e,C)===null).map(C=>({id:C,title:r(`ra.menu.group.${C}`),type:"group",icon:et.AntDesignOutlined,children:[]})),p=[...A,...g];return Object.values(t).forEach(C=>{var j,x,S,P;const h=tB(p,C),m=(j=h==null?void 0:h.children)==null?void 0:j.find(L=>L.id===C.name),I=(x=h==null?void 0:h.children)==null?void 0:x.some(L=>L.id===C.name),B=(m==null?void 0:m.roles)||((S=C.options)==null?void 0:S.roles)||[],v=!B||B.length===0||B.some(L=>o.includes(L));if(!rM(C,n)||!C.hasList||!v){I&&((P=h==null?void 0:h.children)==null?void 0:P.length)>0&&(h.children=h.children.filter(L=>L.id!==C.name));return}h&&(h.children||(h.children=[]))}),p.filter(rB).map(oB)},tf=()=>{const e=R.useResourceDefinitions(),{isLoading:t,data:n}=R.useGetIdentity(),r=n&&n.id>0,{isLoading:o,permissions:s}=R.usePermissions(r),{groups:l}=Io(),u=R.useTranslate(),A=w.useMemo(()=>{if(t||!n||n===null||(n==null?void 0:n.id)<=0)return null;const p=((n==null?void 0:n.roles)||[]).map(h=>h.id);return oM({resources:e,permissions:s,translate:u,userGroups:l,roles:p})},[t,o,n,e,s,u,l]),g=w.useMemo(()=>t,[t]);return{menu:A,isLoading:g,getItem:p=>g?!1:$d(A,p),findInMenu:g?()=>{}:$d}},iB=()=>{const e=R.useTranslate(),{isLoading:t,menu:n,findInMenu:r}=tf(),{pathname:o}=Bt.useLocation();return w.useMemo(()=>{var C;const s=o.split("/").filter(h=>h);let l=dt.cloneDeep(n),u=o,A=r(l,o);if(A||(A=r(l,s[s.length-1]),u=A?A.id:u),!A)for(let h=s.length;h>=0;h--){let m=s.slice(0,h).join("/");if(A=r(l,m),A){u=A.id;break}}const g=(C=A==null?void 0:A.url)==null?void 0:C.split("/");if(s.length>=(g==null?void 0:g.length)){const h=s[s.length-1];if(A){const m=h==="create"||o===A.url?"create":"edit",I=`resources.${u}.breadcrumbs.${m}`,B={id:`${u}-${m}`,type:"item",title:e(I,{_:e(I,{_:I})}),url:o,breadcrumbs:!0,parent:A};A.type="collapse",A.breadcrumbs=!0,A.children=A.children||[],A.children.push(B),A=B}}let p=[];if(A){let h={...A,last:!0};for(;h;)p.push(h),h=h.parent;p=p.reverse()}return{isLoading:t,navigation:{items:l},breadcrumbs:p}},[t,o,n,r,e])};var sB={exports:{}};(function(e,t){(function(n,r){e.exports=r()})(Xn,function(){var n=1e3,r=6e4,o=36e5,s="millisecond",l="second",u="minute",A="hour",g="day",p="week",C="month",h="quarter",m="year",I="date",B="Invalid Date",v=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,O=/\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,j={name:"en",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),ordinal:function(Z){var K=["th","st","nd","rd"],V=Z%100;return"["+Z+(K[(V-20)%10]||K[V]||K[0])+"]"}},x=function(Z,K,V){var G=String(Z);return!G||G.length>=K?Z:""+Array(K+1-G.length).join(V)+Z},S={s:x,z:function(Z){var K=-Z.utcOffset(),V=Math.abs(K),G=Math.floor(V/60),F=V%60;return(K<=0?"+":"-")+x(G,2,"0")+":"+x(F,2,"0")},m:function Z(K,V){if(K.date()<V.date())return-Z(V,K);var G=12*(V.year()-K.year())+(V.month()-K.month()),F=K.clone().add(G,C),$=V-F<0,H=K.clone().add(G+($?-1:1),C);return+(-(G+(V-F)/($?F-H:H-F))||0)},a:function(Z){return Z<0?Math.ceil(Z)||0:Math.floor(Z)},p:function(Z){return{M:C,y:m,w:p,d:g,D:I,h:A,m:u,s:l,ms:s,Q:h}[Z]||String(Z||"").toLowerCase().replace(/s$/,"")},u:function(Z){return Z===void 0}},P="en",L={};L[P]=j;var k="$isDayjsObject",q=function(Z){return Z instanceof le||!(!Z||!Z[k])},J=function Z(K,V,G){var F;if(!K)return P;if(typeof K=="string"){var $=K.toLowerCase();L[$]&&(F=$),V&&(L[$]=V,F=$);var H=K.split("-");if(!F&&H.length>1)return Z(H[0])}else{var X=K.name;L[X]=K,F=X}return!G&&F&&(P=F),F||!G&&P},U=function(Z,K){if(q(Z))return Z.clone();var V=typeof K=="object"?K:{};return V.date=Z,V.args=arguments,new le(V)},_=S;_.l=J,_.i=q,_.w=function(Z,K){return U(Z,{locale:K.$L,utc:K.$u,x:K.$x,$offset:K.$offset})};var le=function(){function Z(V){this.$L=J(V.locale,null,!0),this.parse(V),this.$x=this.$x||V.x||{},this[k]=!0}var K=Z.prototype;return K.parse=function(V){this.$d=function(G){var F=G.date,$=G.utc;if(F===null)return new Date(NaN);if(_.u(F))return new Date;if(F instanceof Date)return new Date(F);if(typeof F=="string"&&!/Z$/i.test(F)){var H=F.match(v);if(H){var X=H[2]-1||0,ge=(H[7]||"0").substring(0,3);return $?new Date(Date.UTC(H[1],X,H[3]||1,H[4]||0,H[5]||0,H[6]||0,ge)):new Date(H[1],X,H[3]||1,H[4]||0,H[5]||0,H[6]||0,ge)}}return new Date(F)}(V),this.init()},K.init=function(){var V=this.$d;this.$y=V.getFullYear(),this.$M=V.getMonth(),this.$D=V.getDate(),this.$W=V.getDay(),this.$H=V.getHours(),this.$m=V.getMinutes(),this.$s=V.getSeconds(),this.$ms=V.getMilliseconds()},K.$utils=function(){return _},K.isValid=function(){return this.$d.toString()!==B},K.isSame=function(V,G){var F=U(V);return this.startOf(G)<=F&&F<=this.endOf(G)},K.isAfter=function(V,G){return U(V)<this.startOf(G)},K.isBefore=function(V,G){return this.endOf(G)<U(V)},K.$g=function(V,G,F){return _.u(V)?this[G]:this.set(F,V)},K.unix=function(){return Math.floor(this.valueOf()/1e3)},K.valueOf=function(){return this.$d.getTime()},K.startOf=function(V,G){var F=this,$=!!_.u(G)||G,H=_.p(V),X=function(Ce,Ie){var Qe=_.w(F.$u?Date.UTC(F.$y,Ie,Ce):new Date(F.$y,Ie,Ce),F);return $?Qe:Qe.endOf(g)},ge=function(Ce,Ie){return _.w(F.toDate()[Ce].apply(F.toDate("s"),($?[0,0,0,0]:[23,59,59,999]).slice(Ie)),F)},pe=this.$W,ce=this.$M,fe=this.$D,he="set"+(this.$u?"UTC":"");switch(H){case m:return $?X(1,0):X(31,11);case C:return $?X(1,ce):X(0,ce+1);case p:var Be=this.$locale().weekStart||0,me=(pe<Be?pe+7:pe)-Be;return X($?fe-me:fe+(6-me),ce);case g:case I:return ge(he+"Hours",0);case A:return ge(he+"Minutes",1);case u:return ge(he+"Seconds",2);case l:return ge(he+"Milliseconds",3);default:return this.clone()}},K.endOf=function(V){return this.startOf(V,!1)},K.$set=function(V,G){var F,$=_.p(V),H="set"+(this.$u?"UTC":""),X=(F={},F[g]=H+"Date",F[I]=H+"Date",F[C]=H+"Month",F[m]=H+"FullYear",F[A]=H+"Hours",F[u]=H+"Minutes",F[l]=H+"Seconds",F[s]=H+"Milliseconds",F)[$],ge=$===g?this.$D+(G-this.$W):G;if($===C||$===m){var pe=this.clone().set(I,1);pe.$d[X](ge),pe.init(),this.$d=pe.set(I,Math.min(this.$D,pe.daysInMonth())).$d}else X&&this.$d[X](ge);return this.init(),this},K.set=function(V,G){return this.clone().$set(V,G)},K.get=function(V){return this[_.p(V)]()},K.add=function(V,G){var F,$=this;V=Number(V);var H=_.p(G),X=function(ce){var fe=U($);return _.w(fe.date(fe.date()+Math.round(ce*V)),$)};if(H===C)return this.set(C,this.$M+V);if(H===m)return this.set(m,this.$y+V);if(H===g)return X(1);if(H===p)return X(7);var ge=(F={},F[u]=r,F[A]=o,F[l]=n,F)[H]||1,pe=this.$d.getTime()+V*ge;return _.w(pe,this)},K.subtract=function(V,G){return this.add(-1*V,G)},K.format=function(V){var G=this,F=this.$locale();if(!this.isValid())return F.invalidDate||B;var $=V||"YYYY-MM-DDTHH:mm:ssZ",H=_.z(this),X=this.$H,ge=this.$m,pe=this.$M,ce=F.weekdays,fe=F.months,he=F.meridiem,Be=function(Ie,Qe,ae,Ne){return Ie&&(Ie[Qe]||Ie(G,$))||ae[Qe].slice(0,Ne)},me=function(Ie){return _.s(X%12||12,Ie,"0")},Ce=he||function(Ie,Qe,ae){var Ne=Ie<12?"AM":"PM";return ae?Ne.toLowerCase():Ne};return $.replace(O,function(Ie,Qe){return Qe||function(ae){switch(ae){case"YY":return String(G.$y).slice(-2);case"YYYY":return _.s(G.$y,4,"0");case"M":return pe+1;case"MM":return _.s(pe+1,2,"0");case"MMM":return Be(F.monthsShort,pe,fe,3);case"MMMM":return Be(fe,pe);case"D":return G.$D;case"DD":return _.s(G.$D,2,"0");case"d":return String(G.$W);case"dd":return Be(F.weekdaysMin,G.$W,ce,2);case"ddd":return Be(F.weekdaysShort,G.$W,ce,3);case"dddd":return ce[G.$W];case"H":return String(X);case"HH":return _.s(X,2,"0");case"h":return me(1);case"hh":return me(2);case"a":return Ce(X,ge,!0);case"A":return Ce(X,ge,!1);case"m":return String(ge);case"mm":return _.s(ge,2,"0");case"s":return String(G.$s);case"ss":return _.s(G.$s,2,"0");case"SSS":return _.s(G.$ms,3,"0");case"Z":return H}return null}(Ie)||H.replace(":","")})},K.utcOffset=function(){return 15*-Math.round(this.$d.getTimezoneOffset()/15)},K.diff=function(V,G,F){var $,H=this,X=_.p(G),ge=U(V),pe=(ge.utcOffset()-this.utcOffset())*r,ce=this-ge,fe=function(){return _.m(H,ge)};switch(X){case m:$=fe()/12;break;case C:$=fe();break;case h:$=fe()/3;break;case p:$=(ce-pe)/6048e5;break;case g:$=(ce-pe)/864e5;break;case A:$=ce/o;break;case u:$=ce/r;break;case l:$=ce/n;break;default:$=ce}return F?$:_.a($)},K.daysInMonth=function(){return this.endOf(C).$D},K.$locale=function(){return L[this.$L]},K.locale=function(V,G){if(!V)return this.$L;var F=this.clone(),$=J(V,G,!0);return $&&(F.$L=$),F},K.clone=function(){return _.w(this.$d,this)},K.toDate=function(){return new Date(this.valueOf())},K.toJSON=function(){return this.isValid()?this.toISOString():null},K.toISOString=function(){return this.$d.toISOString()},K.toString=function(){return this.$d.toUTCString()},Z}(),ie=le.prototype;return U.prototype=ie,[["$ms",s],["$s",l],["$m",u],["$H",A],["$W",g],["$M",C],["$y",m],["$D",I]].forEach(function(Z){ie[Z[1]]=function(K){return this.$g(K,Z[0],Z[1])}}),U.extend=function(Z,K){return Z.$i||(Z(K,le,U),Z.$i=!0),U},U.locale=J,U.isDayjs=q,U.unix=function(Z){return U(1e3*Z)},U.en=L[P],U.Ls=L,U.p={},U})})(sB);var iM=sB.exports;const qr=bo(iM),aB=e=>{const t=e.split(":");t.length===1&&t.push("00");const n=parseInt(t[0]),r=parseInt(t[1]);return qr().hour(n).minute(r)};function sM(){let e=new Date().getTime();return window.performance&&typeof window.performance.now=="function"&&(e+=performance.now()),"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(n){const r=(e+Math.random()*16)%16|0;return e=Math.floor(e/16),(n=="x"?r:r&3|8).toString(16)})}function nf(e={},t=[],n={}){const{isEmpty:r=Ae.isEmpty}=n;return!Ae.some(t,o=>r((e??{})[o.locale]))}function rf(e,t,n){if(!Ae.isPlainObject(e)||t===void 0)return;const r=Ae.isPlainObject(n)?n:{},o=!!((r==null?void 0:r.fallback)??!0);let s=e[String(t)];if(s===void 0&&o){const l=Ae.isArray(r.fallbackLocales)&&!Ae.isEmpty(r.fallbackLocales)?r.fallbackLocales:["en"];s=Ae.chain(l).map(u=>e[String(u)]).reject(Ae.isUndefined).first().value(),s===void 0&&(s=Ae.chain(e).values().first().value())}return s}function lB(e){const[t]=de.useLocaleState();return e!==void 0?String(e):t}function aM(e,t){const n=lB(t==null?void 0:t.locale);return rf(e,n,t)}function lM(e){const t=lB(e==null?void 0:e.locale);return w.useCallback(r=>rf(r,t,e),[t,e])}function of(e,t){const[n,r]=w.useState(()=>{const s=typeof window<"u"?localStorage.getItem(e):null;return s===null?t:JSON.parse(s)});return w.useEffect(()=>{const s=l=>{typeof window<"u"&&l.storageArea===localStorage&&l.key===e&&r(l.newValue?JSON.parse(l.newValue):l.newValue)};return window.addEventListener("storage",s),()=>{window.removeEventListener("storage",s)}},[e,t]),[n,s=>{r(l=>{const u=typeof s=="function"?s(l):s;return typeof window<"u"&&localStorage.setItem(e,JSON.stringify(u)),u})}]}function cB(e){if(!Ae.isPlainObject(e))throw new Error("[useMemoizedObject]: param must be a plain JS object");const[t,n]=w.useState(e);return w.useEffect(()=>{Ae.isEqual(e,t)||n(e)},[e,t]),t}function ou(){const[e,t]=w.useState(null),n=!!e,r=w.useCallback(l=>t(l==null?void 0:l.currentTarget),[t]),o=w.useCallback(()=>t(null),[t]),s=w.useCallback(l=>{n?o():r(l)},[n,r,o]);return{anchorEl:e,open:n,handleClick:r,handleClose:o,handleToggle:s}}function cM(e,t){const[n,r]=w.useState({width:1,height:1}),o=e.current;return w.useEffect(()=>{function s(){var g;let u=0,A=0;switch(t){case"client":u=(o==null?void 0:o.clientWidth)??0,A=(o==null?void 0:o.clientHeight)??0;break;case"offset":u=(o==null?void 0:o.offsetWidth)??0,A=(o==null?void 0:o.offsetHeight)??0;break;case"scroll":u=(o==null?void 0:o.scrollWidth)??0,A=(o==null?void 0:o.scrollHeight)??0;break;case"bounding":default:{const p=((g=e.current)==null?void 0:g.getBoundingClientRect())??{width:0,height:0};u=p.width,A=p.height;break}}r({width:u,height:A})}const l=new ResizeObserver(s);return Ae.isEmpty(e==null?void 0:e.current)||(l.observe(e==null?void 0:e.current),s()),()=>{l.disconnect()}},[o,t]),n}const sf=e=>{const t=R.useRecordContext(),n=R.useTranslate(),r=R.useResourceContext(),o=t!=null&&t.id?"edit":"create";return w.useMemo(()=>{if(e===!1)return;const l=`resources.${r}.title`;return e||n(`resources.${r}.title.${o}`,{_:n(l,{_:l}),...t})},[o,t,r,n,e])};function Pr(e,t,n){const r=Ae.chain((e==null?void 0:e.sx)??{}).cloneDeepWith(l=>Ae.isFunction(l)?l:void 0).value();n!=null&&n.defaults?Ae.defaultsDeep(r,t):Ae.merge(r,t);const[o,s]=w.useState(r);return w.useEffect(()=>{Ae.isEqual(o,r)||s(r)},[o,r]),o}const uB=()=>w.useContext($g),uM=()=>w.useContext(ef),Ln=()=>w.useContext(Xg),AB=ue(Zj,{shouldForwardProp:e=>e!=="open"})(({theme:e,open:t})=>{const{drawerWidth:n}=Ln();return{zIndex:e.zIndex.drawer+1,transition:e.transitions.create(["width","margin"],{easing:e.transitions.easing.sharp,duration:e.transitions.duration.leavingScreen}),...!t&&{width:`calc(100% - ${e.spacing(7.5)})`},...t&&{marginLeft:n,width:`calc(100% - ${n}px)`,transition:e.transitions.create(["width","margin"],{easing:e.transitions.easing.sharp,duration:e.transitions.duration.enteringScreen})}}});AB.propTypes={open:c.bool};const AM=w.forwardRef(function(t,n){const r=Pr(t,{color:"text.primary"},{defaults:!0});return f.jsx(b.Button,{ref:n,...t,color:"secondary",variant:"text",sx:r})}),dB=w.createContext({transformPagePoint:e=>e,isStatic:!1,reducedMotion:"never"}),iu=w.createContext({}),af=w.createContext(null),su=typeof document<"u",dM=su?w.useLayoutEffect:w.useEffect,gB=w.createContext({strict:!1});function gM(e,t,n,r){const{visualElement:o}=w.useContext(iu),s=w.useContext(gB),l=w.useContext(af),u=w.useContext(dB).reducedMotion,A=w.useRef();r=r||s.renderer,!A.current&&r&&(A.current=r(e,{visualState:t,parent:o,props:n,presenceContext:l,blockInitialAnimation:l?l.initial===!1:!1,reducedMotionConfig:u}));const g=A.current;w.useInsertionEffect(()=>{g&&g.update(n,l)});const p=w.useRef(!!window.HandoffAppearAnimations);return dM(()=>{g&&(g.render(),p.current&&g.animationState&&g.animationState.animateChanges())}),w.useEffect(()=>{g&&(g.updateFeatures(),!p.current&&g.animationState&&g.animationState.animateChanges(),window.HandoffAppearAnimations=void 0,p.current=!1)}),g}function zi(e){return typeof e=="object"&&Object.prototype.hasOwnProperty.call(e,"current")}function fM(e,t,n){return w.useCallback(r=>{r&&e.mount&&e.mount(r),t&&(r?t.mount(r):t.unmount()),n&&(typeof n=="function"?n(r):zi(n)&&(n.current=r))},[t])}function fa(e){return typeof e=="string"||Array.isArray(e)}function au(e){return typeof e=="object"&&typeof e.start=="function"}const lf=["animate","whileInView","whileFocus","whileHover","whileTap","whileDrag","exit"],cf=["initial",...lf];function lu(e){return au(e.animate)||cf.some(t=>fa(e[t]))}function fB(e){return!!(lu(e)||e.variants)}function pM(e,t){if(lu(e)){const{initial:n,animate:r}=e;return{initial:n===!1||fa(n)?n:void 0,animate:fa(r)?r:void 0}}return e.inherit!==!1?t:{}}function hM(e){const{initial:t,animate:n}=pM(e,w.useContext(iu));return w.useMemo(()=>({initial:t,animate:n}),[eE(t),eE(n)])}function eE(e){return Array.isArray(e)?e.join(" "):e}const tE={animation:["animate","variants","whileHover","whileTap","exit","whileInView","whileFocus","whileDrag"],exit:["exit"],drag:["drag","dragControls"],focus:["whileFocus"],hover:["whileHover","onHoverStart","onHoverEnd"],tap:["whileTap","onTap","onTapStart","onTapCancel"],pan:["onPan","onPanStart","onPanSessionStart","onPanEnd"],inView:["whileInView","onViewportEnter","onViewportLeave"],layout:["layout","layoutId"]},pa={};for(const e in tE)pa[e]={isEnabled:t=>tE[e].some(n=>!!t[n])};function CM(e){for(const t in e)pa[t]={...pa[t],...e[t]}}const pB=w.createContext({}),hB=w.createContext({}),mM=Symbol.for("motionComponentSymbol");function EM({preloadedFeatures:e,createVisualElement:t,useRender:n,useVisualState:r,Component:o}){e&&CM(e);function s(u,A){let g;const p={...w.useContext(dB),...u,layoutId:IM(u)},{isStatic:C}=p,h=hM(u),m=r(u,C);if(!C&&su){h.visualElement=gM(o,m,p,t);const I=w.useContext(hB),B=w.useContext(gB).strict;h.visualElement&&(g=h.visualElement.loadFeatures(p,B,e,I))}return D.createElement(iu.Provider,{value:h},g&&h.visualElement?D.createElement(g,{visualElement:h.visualElement,...p}):null,n(o,u,fM(m,h.visualElement,A),m,C,h.visualElement))}const l=w.forwardRef(s);return l[mM]=o,l}function IM({layoutId:e}){const t=w.useContext(pB).id;return t&&e!==void 0?t+"-"+e:e}function BM(e){function t(r,o={}){return EM(e(r,o))}if(typeof Proxy>"u")return t;const n=new Map;return new Proxy(t,{get:(r,o)=>(n.has(o)||n.set(o,t(o)),n.get(o))})}const vM=["animate","circle","defs","desc","ellipse","g","image","line","filter","marker","mask","metadata","path","pattern","polygon","polyline","rect","stop","switch","symbol","svg","text","tspan","use","view"];function uf(e){return typeof e!="string"||e.includes("-")?!1:!!(vM.indexOf(e)>-1||/[A-Z]/.test(e))}const vc={};function yM(e){Object.assign(vc,e)}const Pa=["transformPerspective","x","y","z","translateX","translateY","translateZ","scale","scaleX","scaleY","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"],ui=new Set(Pa);function CB(e,{layout:t,layoutId:n}){return ui.has(e)||e.startsWith("origin")||(t||n!==void 0)&&(!!vc[e]||e==="opacity")}const vn=e=>!!(e&&e.getVelocity),bM={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},QM=Pa.length;function xM(e,{enableHardwareAcceleration:t=!0,allowTransformNone:n=!0},r,o){let s="";for(let l=0;l<QM;l++){const u=Pa[l];if(e[u]!==void 0){const A=bM[u]||u;s+=`${A}(${e[u]}) `}}return t&&!e.z&&(s+="translateZ(0)"),s=s.trim(),o?s=o(e,r?"":s):n&&r&&(s="none"),s}const mB=e=>t=>typeof t=="string"&&t.startsWith(e),EB=mB("--"),eg=mB("var(--"),wM=/var\s*\(\s*--[\w-]+(\s*,\s*(?:(?:[^)(]|\((?:[^)(]+|\([^)(]*\))*\))*)+)?\s*\)/g,TM=(e,t)=>t&&typeof e=="number"?t.transform(e):e,Bo=(e,t,n)=>Math.min(Math.max(n,e),t),Ai={test:e=>typeof e=="number",parse:parseFloat,transform:e=>e},na={...Ai,transform:e=>Bo(0,1,e)},Hl={...Ai,default:1},ra=e=>Math.round(e*1e5)/1e5,cu=/(-)?([\d]*\.?[\d])+/g,IB=/(#[0-9a-f]{3,8}|(rgb|hsl)a?\((-?[\d\.]+%?[,\s]+){2}(-?[\d\.]+%?)\s*[\,\/]?\s*[\d\.]*%?\))/gi,PM=/^(#[0-9a-f]{3,8}|(rgb|hsl)a?\((-?[\d\.]+%?[,\s]+){2}(-?[\d\.]+%?)\s*[\,\/]?\s*[\d\.]*%?\))$/i;function Sa(e){return typeof e=="string"}const Ra=e=>({test:t=>Sa(t)&&t.endsWith(e)&&t.split(" ").length===1,parse:parseFloat,transform:t=>`${t}${e}`}),Ao=Ra("deg"),br=Ra("%"),Me=Ra("px"),SM=Ra("vh"),RM=Ra("vw"),nE={...br,parse:e=>br.parse(e)/100,transform:e=>br.transform(e*100)},rE={...Ai,transform:Math.round},BB={borderWidth:Me,borderTopWidth:Me,borderRightWidth:Me,borderBottomWidth:Me,borderLeftWidth:Me,borderRadius:Me,radius:Me,borderTopLeftRadius:Me,borderTopRightRadius:Me,borderBottomRightRadius:Me,borderBottomLeftRadius:Me,width:Me,maxWidth:Me,height:Me,maxHeight:Me,size:Me,top:Me,right:Me,bottom:Me,left:Me,padding:Me,paddingTop:Me,paddingRight:Me,paddingBottom:Me,paddingLeft:Me,margin:Me,marginTop:Me,marginRight:Me,marginBottom:Me,marginLeft:Me,rotate:Ao,rotateX:Ao,rotateY:Ao,rotateZ:Ao,scale:Hl,scaleX:Hl,scaleY:Hl,scaleZ:Hl,skew:Ao,skewX:Ao,skewY:Ao,distance:Me,translateX:Me,translateY:Me,translateZ:Me,x:Me,y:Me,z:Me,perspective:Me,transformPerspective:Me,opacity:na,originX:nE,originY:nE,originZ:Me,zIndex:rE,fillOpacity:na,strokeOpacity:na,numOctaves:rE};function Af(e,t,n,r){const{style:o,vars:s,transform:l,transformOrigin:u}=e;let A=!1,g=!1,p=!0;for(const C in t){const h=t[C];if(EB(C)){s[C]=h;continue}const m=BB[C],I=TM(h,m);if(ui.has(C)){if(A=!0,l[C]=I,!p)continue;h!==(m.default||0)&&(p=!1)}else C.startsWith("origin")?(g=!0,u[C]=I):o[C]=I}if(t.transform||(A||r?o.transform=xM(e.transform,n,p,r):o.transform&&(o.transform="none")),g){const{originX:C="50%",originY:h="50%",originZ:m=0}=u;o.transformOrigin=`${C} ${h} ${m}`}}const df=()=>({style:{},transform:{},transformOrigin:{},vars:{}});function vB(e,t,n){for(const r in t)!vn(t[r])&&!CB(r,n)&&(e[r]=t[r])}function OM({transformTemplate:e},t,n){return w.useMemo(()=>{const r=df();return Af(r,t,{enableHardwareAcceleration:!n},e),Object.assign({},r.vars,r.style)},[t])}function jM(e,t,n){const r=e.style||{},o={};return vB(o,r,e),Object.assign(o,OM(e,t,n)),e.transformValues?e.transformValues(o):o}function MM(e,t,n){const r={},o=jM(e,t,n);return e.drag&&e.dragListener!==!1&&(r.draggable=!1,o.userSelect=o.WebkitUserSelect=o.WebkitTouchCallout="none",o.touchAction=e.drag===!0?"none":`pan-${e.drag==="x"?"y":"x"}`),e.tabIndex===void 0&&(e.onTap||e.onTapStart||e.whileTap)&&(r.tabIndex=0),r.style=o,r}const DM=new Set(["animate","exit","variants","initial","style","values","variants","transition","transformTemplate","transformValues","custom","inherit","onLayoutAnimationStart","onLayoutAnimationComplete","onLayoutMeasure","onBeforeLayoutMeasure","onAnimationStart","onAnimationComplete","onUpdate","onDragStart","onDrag","onDragEnd","onMeasureDragConstraints","onDirectionLock","onDragTransitionEnd","_dragX","_dragY","onHoverStart","onHoverEnd","onViewportEnter","onViewportLeave","ignoreStrict","viewport"]);function yc(e){return e.startsWith("while")||e.startsWith("drag")&&e!=="draggable"||e.startsWith("layout")||e.startsWith("onTap")||e.startsWith("onPan")||DM.has(e)}let yB=e=>!yc(e);function kM(e){e&&(yB=t=>t.startsWith("on")?!yc(t):e(t))}try{kM(require("@emotion/is-prop-valid").default)}catch{}function FM(e,t,n){const r={};for(const o in e)o==="values"&&typeof e.values=="object"||(yB(o)||n===!0&&yc(o)||!t&&!yc(o)||e.draggable&&o.startsWith("onDrag"))&&(r[o]=e[o]);return r}function oE(e,t,n){return typeof e=="string"?e:Me.transform(t+n*e)}function LM(e,t,n){const r=oE(t,e.x,e.width),o=oE(n,e.y,e.height);return`${r} ${o}`}const NM={offset:"stroke-dashoffset",array:"stroke-dasharray"},VM={offset:"strokeDashoffset",array:"strokeDasharray"};function HM(e,t,n=1,r=0,o=!0){e.pathLength=1;const s=o?NM:VM;e[s.offset]=Me.transform(-r);const l=Me.transform(t),u=Me.transform(n);e[s.array]=`${l} ${u}`}function gf(e,{attrX:t,attrY:n,attrScale:r,originX:o,originY:s,pathLength:l,pathSpacing:u=1,pathOffset:A=0,...g},p,C,h){if(Af(e,g,p,h),C){e.style.viewBox&&(e.attrs.viewBox=e.style.viewBox);return}e.attrs=e.style,e.style={};const{attrs:m,style:I,dimensions:B}=e;m.transform&&(B&&(I.transform=m.transform),delete m.transform),B&&(o!==void 0||s!==void 0||I.transform)&&(I.transformOrigin=LM(B,o!==void 0?o:.5,s!==void 0?s:.5)),t!==void 0&&(m.x=t),n!==void 0&&(m.y=n),r!==void 0&&(m.scale=r),l!==void 0&&HM(m,l,u,A,!1)}const bB=()=>({...df(),attrs:{}}),ff=e=>typeof e=="string"&&e.toLowerCase()==="svg";function WM(e,t,n,r){const o=w.useMemo(()=>{const s=bB();return gf(s,t,{enableHardwareAcceleration:!1},ff(r),e.transformTemplate),{...s.attrs,style:{...s.style}}},[t]);if(e.style){const s={};vB(s,e.style,e),o.style={...s,...o.style}}return o}function zM(e=!1){return(n,r,o,{latestValues:s},l)=>{const A=(uf(n)?WM:MM)(r,s,l,n),p={...FM(r,typeof n=="string",e),...A,ref:o},{children:C}=r,h=w.useMemo(()=>vn(C)?C.get():C,[C]);return w.createElement(n,{...p,children:h})}}const pf=e=>e.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase();function QB(e,{style:t,vars:n},r,o){Object.assign(e.style,t,o&&o.getProjectionStyles(r));for(const s in n)e.style.setProperty(s,n[s])}const xB=new Set(["baseFrequency","diffuseConstant","kernelMatrix","kernelUnitLength","keySplines","keyTimes","limitingConeAngle","markerHeight","markerWidth","numOctaves","targetX","targetY","surfaceScale","specularConstant","specularExponent","stdDeviation","tableValues","viewBox","gradientTransform","pathLength","startOffset","textLength","lengthAdjust"]);function wB(e,t,n,r){QB(e,t,void 0,r);for(const o in t.attrs)e.setAttribute(xB.has(o)?o:pf(o),t.attrs[o])}function hf(e,t){const{style:n}=e,r={};for(const o in n)(vn(n[o])||t.style&&vn(t.style[o])||CB(o,e))&&(r[o]=n[o]);return r}function TB(e,t){const n=hf(e,t);for(const r in e)if(vn(e[r])||vn(t[r])){const o=Pa.indexOf(r)!==-1?"attr"+r.charAt(0).toUpperCase()+r.substring(1):r;n[o]=e[r]}return n}function Cf(e,t,n,r={},o={}){return typeof t=="function"&&(t=t(n!==void 0?n:e.custom,r,o)),typeof t=="string"&&(t=e.variants&&e.variants[t]),typeof t=="function"&&(t=t(n!==void 0?n:e.custom,r,o)),t}function UM(e){const t=w.useRef(null);return t.current===null&&(t.current=e()),t.current}const bc=e=>Array.isArray(e),YM=e=>!!(e&&typeof e=="object"&&e.mix&&e.toValue),GM=e=>bc(e)?e[e.length-1]||0:e;function ic(e){const t=vn(e)?e.get():e;return YM(t)?t.toValue():t}function KM({scrapeMotionValuesFromProps:e,createRenderState:t,onMount:n},r,o,s){const l={latestValues:qM(r,o,s,e),renderState:t()};return n&&(l.mount=u=>n(r,u,l)),l}const PB=e=>(t,n)=>{const r=w.useContext(iu),o=w.useContext(af),s=()=>KM(e,t,r,o);return n?s():UM(s)};function qM(e,t,n,r){const o={},s=r(e,{});for(const h in s)o[h]=ic(s[h]);let{initial:l,animate:u}=e;const A=lu(e),g=fB(e);t&&g&&!A&&e.inherit!==!1&&(l===void 0&&(l=t.initial),u===void 0&&(u=t.animate));let p=n?n.initial===!1:!1;p=p||l===!1;const C=p?u:l;return C&&typeof C!="boolean"&&!au(C)&&(Array.isArray(C)?C:[C]).forEach(m=>{const I=Cf(e,m);if(!I)return;const{transitionEnd:B,transition:v,...O}=I;for(const j in O){let x=O[j];if(Array.isArray(x)){const S=p?x.length-1:0;x=x[S]}x!==null&&(o[j]=x)}for(const j in B)o[j]=B[j]}),o}const Dt=e=>e;class iE{constructor(){this.order=[],this.scheduled=new Set}add(t){if(!this.scheduled.has(t))return this.scheduled.add(t),this.order.push(t),!0}remove(t){const n=this.order.indexOf(t);n!==-1&&(this.order.splice(n,1),this.scheduled.delete(t))}clear(){this.order.length=0,this.scheduled.clear()}}function JM(e){let t=new iE,n=new iE,r=0,o=!1,s=!1;const l=new WeakSet,u={schedule:(A,g=!1,p=!1)=>{const C=p&&o,h=C?t:n;return g&&l.add(A),h.add(A)&&C&&o&&(r=t.order.length),A},cancel:A=>{n.remove(A),l.delete(A)},process:A=>{if(o){s=!0;return}if(o=!0,[t,n]=[n,t],n.clear(),r=t.order.length,r)for(let g=0;g<r;g++){const p=t.order[g];p(A),l.has(p)&&(u.schedule(p),e())}o=!1,s&&(s=!1,u.process(A))}};return u}const Wl=["prepare","read","update","preRender","render","postRender"],XM=40;function ZM(e,t){let n=!1,r=!0;const o={delta:0,timestamp:0,isProcessing:!1},s=Wl.reduce((C,h)=>(C[h]=JM(()=>n=!0),C),{}),l=C=>s[C].process(o),u=()=>{const C=performance.now();n=!1,o.delta=r?1e3/60:Math.max(Math.min(C-o.timestamp,XM),1),o.timestamp=C,o.isProcessing=!0,Wl.forEach(l),o.isProcessing=!1,n&&t&&(r=!1,e(u))},A=()=>{n=!0,r=!0,o.isProcessing||e(u)};return{schedule:Wl.reduce((C,h)=>{const m=s[h];return C[h]=(I,B=!1,v=!1)=>(n||A(),m.schedule(I,B,v)),C},{}),cancel:C=>Wl.forEach(h=>s[h].cancel(C)),state:o,steps:s}}const{schedule:vt,cancel:Jr,state:Xt,steps:pd}=ZM(typeof requestAnimationFrame<"u"?requestAnimationFrame:Dt,!0),_M={useVisualState:PB({scrapeMotionValuesFromProps:TB,createRenderState:bB,onMount:(e,t,{renderState:n,latestValues:r})=>{vt.read(()=>{try{n.dimensions=typeof t.getBBox=="function"?t.getBBox():t.getBoundingClientRect()}catch{n.dimensions={x:0,y:0,width:0,height:0}}}),vt.render(()=>{gf(n,r,{enableHardwareAcceleration:!1},ff(t.tagName),e.transformTemplate),wB(t,n)})}})},$M={useVisualState:PB({scrapeMotionValuesFromProps:hf,createRenderState:df})};function e3(e,{forwardMotionProps:t=!1},n,r){return{...uf(e)?_M:$M,preloadedFeatures:n,useRender:zM(t),createVisualElement:r,Component:e}}function Ur(e,t,n,r={passive:!0}){return e.addEventListener(t,n,r),()=>e.removeEventListener(t,n)}const SB=e=>e.pointerType==="mouse"?typeof e.button!="number"||e.button<=0:e.isPrimary!==!1;function uu(e,t="page"){return{point:{x:e[t+"X"],y:e[t+"Y"]}}}const t3=e=>t=>SB(t)&&e(t,uu(t));function Yr(e,t,n,r){return Ur(e,t,t3(n),r)}const n3=(e,t)=>n=>t(e(n)),mo=(...e)=>e.reduce(n3);function RB(e){let t=null;return()=>{const n=()=>{t=null};return t===null?(t=e,n):!1}}const sE=RB("dragHorizontal"),aE=RB("dragVertical");function OB(e){let t=!1;if(e==="y")t=aE();else if(e==="x")t=sE();else{const n=sE(),r=aE();n&&r?t=()=>{n(),r()}:(n&&n(),r&&r())}return t}function jB(){const e=OB(!0);return e?(e(),!1):!0}class xo{constructor(t){this.isMounted=!1,this.node=t}update(){}}function lE(e,t){const n="pointer"+(t?"enter":"leave"),r="onHover"+(t?"Start":"End"),o=(s,l)=>{if(s.type==="touch"||jB())return;const u=e.getProps();e.animationState&&u.whileHover&&e.animationState.setActive("whileHover",t),u[r]&&vt.update(()=>u[r](s,l))};return Yr(e.current,n,o,{passive:!e.getProps()[r]})}class r3 extends xo{mount(){this.unmount=mo(lE(this.node,!0),lE(this.node,!1))}unmount(){}}class o3 extends xo{constructor(){super(...arguments),this.isActive=!1}onFocus(){let t=!1;try{t=this.node.current.matches(":focus-visible")}catch{t=!0}!t||!this.node.animationState||(this.node.animationState.setActive("whileFocus",!0),this.isActive=!0)}onBlur(){!this.isActive||!this.node.animationState||(this.node.animationState.setActive("whileFocus",!1),this.isActive=!1)}mount(){this.unmount=mo(Ur(this.node.current,"focus",()=>this.onFocus()),Ur(this.node.current,"blur",()=>this.onBlur()))}unmount(){}}const MB=(e,t)=>t?e===t?!0:MB(e,t.parentElement):!1;function hd(e,t){if(!t)return;const n=new PointerEvent("pointer"+e);t(n,uu(n))}class i3 extends xo{constructor(){super(...arguments),this.removeStartListeners=Dt,this.removeEndListeners=Dt,this.removeAccessibleListeners=Dt,this.startPointerPress=(t,n)=>{if(this.removeEndListeners(),this.isPressing)return;const r=this.node.getProps(),s=Yr(window,"pointerup",(u,A)=>{if(!this.checkPressEnd())return;const{onTap:g,onTapCancel:p}=this.node.getProps();vt.update(()=>{MB(this.node.current,u.target)?g&&g(u,A):p&&p(u,A)})},{passive:!(r.onTap||r.onPointerUp)}),l=Yr(window,"pointercancel",(u,A)=>this.cancelPress(u,A),{passive:!(r.onTapCancel||r.onPointerCancel)});this.removeEndListeners=mo(s,l),this.startPress(t,n)},this.startAccessiblePress=()=>{const t=s=>{if(s.key!=="Enter"||this.isPressing)return;const l=u=>{u.key!=="Enter"||!this.checkPressEnd()||hd("up",(A,g)=>{const{onTap:p}=this.node.getProps();p&&vt.update(()=>p(A,g))})};this.removeEndListeners(),this.removeEndListeners=Ur(this.node.current,"keyup",l),hd("down",(u,A)=>{this.startPress(u,A)})},n=Ur(this.node.current,"keydown",t),r=()=>{this.isPressing&&hd("cancel",(s,l)=>this.cancelPress(s,l))},o=Ur(this.node.current,"blur",r);this.removeAccessibleListeners=mo(n,o)}}startPress(t,n){this.isPressing=!0;const{onTapStart:r,whileTap:o}=this.node.getProps();o&&this.node.animationState&&this.node.animationState.setActive("whileTap",!0),r&&vt.update(()=>r(t,n))}checkPressEnd(){return this.removeEndListeners(),this.isPressing=!1,this.node.getProps().whileTap&&this.node.animationState&&this.node.animationState.setActive("whileTap",!1),!jB()}cancelPress(t,n){if(!this.checkPressEnd())return;const{onTapCancel:r}=this.node.getProps();r&&vt.update(()=>r(t,n))}mount(){const t=this.node.getProps(),n=Yr(this.node.current,"pointerdown",this.startPointerPress,{passive:!(t.onTapStart||t.onPointerStart)}),r=Ur(this.node.current,"focus",this.startAccessiblePress);this.removeStartListeners=mo(n,r)}unmount(){this.removeStartListeners(),this.removeEndListeners(),this.removeAccessibleListeners()}}const tg=new WeakMap,Cd=new WeakMap,s3=e=>{const t=tg.get(e.target);t&&t(e)},a3=e=>{e.forEach(s3)};function l3({root:e,...t}){const n=e||document;Cd.has(n)||Cd.set(n,{});const r=Cd.get(n),o=JSON.stringify(t);return r[o]||(r[o]=new IntersectionObserver(a3,{root:e,...t})),r[o]}function c3(e,t,n){const r=l3(t);return tg.set(e,n),r.observe(e),()=>{tg.delete(e),r.unobserve(e)}}const u3={some:0,all:1};class A3 extends xo{constructor(){super(...arguments),this.hasEnteredView=!1,this.isInView=!1}startObserver(){this.unmount();const{viewport:t={}}=this.node.getProps(),{root:n,margin:r,amount:o="some",once:s}=t,l={root:n?n.current:void 0,rootMargin:r,threshold:typeof o=="number"?o:u3[o]},u=A=>{const{isIntersecting:g}=A;if(this.isInView===g||(this.isInView=g,s&&!g&&this.hasEnteredView))return;g&&(this.hasEnteredView=!0),this.node.animationState&&this.node.animationState.setActive("whileInView",g);const{onViewportEnter:p,onViewportLeave:C}=this.node.getProps(),h=g?p:C;h&&h(A)};return c3(this.node.current,l,u)}mount(){this.startObserver()}update(){if(typeof IntersectionObserver>"u")return;const{props:t,prevProps:n}=this.node;["amount","margin","root"].some(d3(t,n))&&this.startObserver()}unmount(){}}function d3({viewport:e={}},{viewport:t={}}={}){return n=>e[n]!==t[n]}const g3={inView:{Feature:A3},tap:{Feature:i3},focus:{Feature:o3},hover:{Feature:r3}};function DB(e,t){if(!Array.isArray(t))return!1;const n=t.length;if(n!==e.length)return!1;for(let r=0;r<n;r++)if(t[r]!==e[r])return!1;return!0}function f3(e){const t={};return e.values.forEach((n,r)=>t[r]=n.get()),t}function p3(e){const t={};return e.values.forEach((n,r)=>t[r]=n.getVelocity()),t}function Au(e,t,n){const r=e.getProps();return Cf(r,t,n!==void 0?n:r.custom,f3(e),p3(e))}const h3="framerAppearId",C3="data-"+pf(h3);let Oa=Dt,xr=Dt;process.env.NODE_ENV!=="production"&&(Oa=(e,t)=>{!e&&typeof console<"u"&&console.warn(t)},xr=(e,t)=>{if(!e)throw new Error(t)});const Eo=e=>e*1e3,Gr=e=>e/1e3,m3={current:!1},kB=e=>Array.isArray(e)&&typeof e[0]=="number";function FB(e){return!!(!e||typeof e=="string"&&LB[e]||kB(e)||Array.isArray(e)&&e.every(FB))}const Zs=([e,t,n,r])=>`cubic-bezier(${e}, ${t}, ${n}, ${r})`,LB={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",circIn:Zs([0,.65,.55,1]),circOut:Zs([.55,0,1,.45]),backIn:Zs([.31,.01,.66,-.59]),backOut:Zs([.33,1.53,.69,.99])};function NB(e){if(e)return kB(e)?Zs(e):Array.isArray(e)?e.map(NB):LB[e]}function E3(e,t,n,{delay:r=0,duration:o,repeat:s=0,repeatType:l="loop",ease:u,times:A}={}){const g={[t]:n};A&&(g.offset=A);const p=NB(u);return Array.isArray(p)&&(g.easing=p),e.animate(g,{delay:r,duration:o,easing:Array.isArray(p)?"linear":p,fill:"both",iterations:s+1,direction:l==="reverse"?"alternate":"normal"})}function I3(e,{repeat:t,repeatType:n="loop"}){const r=t&&n!=="loop"&&t%2===1?0:e.length-1;return e[r]}const VB=(e,t,n)=>(((1-3*n+3*t)*e+(3*n-6*t))*e+3*t)*e,B3=1e-7,v3=12;function y3(e,t,n,r,o){let s,l,u=0;do l=t+(n-t)/2,s=VB(l,r,o)-e,s>0?n=l:t=l;while(Math.abs(s)>B3&&++u<v3);return l}function ja(e,t,n,r){if(e===t&&n===r)return Dt;const o=s=>y3(s,0,1,e,n);return s=>s===0||s===1?s:VB(o(s),t,r)}const b3=ja(.42,0,1,1),Q3=ja(0,0,.58,1),HB=ja(.42,0,.58,1),x3=e=>Array.isArray(e)&&typeof e[0]!="number",WB=e=>t=>t<=.5?e(2*t)/2:(2-e(2*(1-t)))/2,zB=e=>t=>1-e(1-t),UB=e=>1-Math.sin(Math.acos(e)),mf=zB(UB),w3=WB(mf),YB=ja(.33,1.53,.69,.99),Ef=zB(YB),T3=WB(Ef),P3=e=>(e*=2)<1?.5*Ef(e):.5*(2-Math.pow(2,-10*(e-1))),cE={linear:Dt,easeIn:b3,easeInOut:HB,easeOut:Q3,circIn:UB,circInOut:w3,circOut:mf,backIn:Ef,backInOut:T3,backOut:YB,anticipate:P3},uE=e=>{if(Array.isArray(e)){xr(e.length===4,"Cubic bezier arrays must contain four numerical values.");const[t,n,r,o]=e;return ja(t,n,r,o)}else if(typeof e=="string")return xr(cE[e]!==void 0,`Invalid easing type '${e}'`),cE[e];return e},If=(e,t)=>n=>!!(Sa(n)&&PM.test(n)&&n.startsWith(e)||t&&Object.prototype.hasOwnProperty.call(n,t)),GB=(e,t,n)=>r=>{if(!Sa(r))return r;const[o,s,l,u]=r.match(cu);return{[e]:parseFloat(o),[t]:parseFloat(s),[n]:parseFloat(l),alpha:u!==void 0?parseFloat(u):1}},S3=e=>Bo(0,255,e),md={...Ai,transform:e=>Math.round(S3(e))},ei={test:If("rgb","red"),parse:GB("red","green","blue"),transform:({red:e,green:t,blue:n,alpha:r=1})=>"rgba("+md.transform(e)+", "+md.transform(t)+", "+md.transform(n)+", "+ra(na.transform(r))+")"};function R3(e){let t="",n="",r="",o="";return e.length>5?(t=e.substring(1,3),n=e.substring(3,5),r=e.substring(5,7),o=e.substring(7,9)):(t=e.substring(1,2),n=e.substring(2,3),r=e.substring(3,4),o=e.substring(4,5),t+=t,n+=n,r+=r,o+=o),{red:parseInt(t,16),green:parseInt(n,16),blue:parseInt(r,16),alpha:o?parseInt(o,16)/255:1}}const ng={test:If("#"),parse:R3,transform:ei.transform},Ui={test:If("hsl","hue"),parse:GB("hue","saturation","lightness"),transform:({hue:e,saturation:t,lightness:n,alpha:r=1})=>"hsla("+Math.round(e)+", "+br.transform(ra(t))+", "+br.transform(ra(n))+", "+ra(na.transform(r))+")"},dn={test:e=>ei.test(e)||ng.test(e)||Ui.test(e),parse:e=>ei.test(e)?ei.parse(e):Ui.test(e)?Ui.parse(e):ng.parse(e),transform:e=>Sa(e)?e:e.hasOwnProperty("red")?ei.transform(e):Ui.transform(e)},St=(e,t,n)=>-n*e+n*t+e;function Ed(e,t,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?e+(t-e)*6*n:n<1/2?t:n<2/3?e+(t-e)*(2/3-n)*6:e}function O3({hue:e,saturation:t,lightness:n,alpha:r}){e/=360,t/=100,n/=100;let o=0,s=0,l=0;if(!t)o=s=l=n;else{const u=n<.5?n*(1+t):n+t-n*t,A=2*n-u;o=Ed(A,u,e+1/3),s=Ed(A,u,e),l=Ed(A,u,e-1/3)}return{red:Math.round(o*255),green:Math.round(s*255),blue:Math.round(l*255),alpha:r}}const Id=(e,t,n)=>{const r=e*e;return Math.sqrt(Math.max(0,n*(t*t-r)+r))},j3=[ng,ei,Ui],M3=e=>j3.find(t=>t.test(e));function AE(e){const t=M3(e);xr(!!t,`'${e}' is not an animatable color. Use the equivalent color code instead.`);let n=t.parse(e);return t===Ui&&(n=O3(n)),n}const KB=(e,t)=>{const n=AE(e),r=AE(t),o={...n};return s=>(o.red=Id(n.red,r.red,s),o.green=Id(n.green,r.green,s),o.blue=Id(n.blue,r.blue,s),o.alpha=St(n.alpha,r.alpha,s),ei.transform(o))};function D3(e){var t,n;return isNaN(e)&&Sa(e)&&(((t=e.match(cu))===null||t===void 0?void 0:t.length)||0)+(((n=e.match(IB))===null||n===void 0?void 0:n.length)||0)>0}const qB={regex:wM,countKey:"Vars",token:"${v}",parse:Dt},JB={regex:IB,countKey:"Colors",token:"${c}",parse:dn.parse},XB={regex:cu,countKey:"Numbers",token:"${n}",parse:Ai.parse};function Bd(e,{regex:t,countKey:n,token:r,parse:o}){const s=e.tokenised.match(t);s&&(e["num"+n]=s.length,e.tokenised=e.tokenised.replace(t,r),e.values.push(...s.map(o)))}function Qc(e){const t=e.toString(),n={value:t,tokenised:t,values:[],numVars:0,numColors:0,numNumbers:0};return n.value.includes("var(--")&&Bd(n,qB),Bd(n,JB),Bd(n,XB),n}function ZB(e){return Qc(e).values}function _B(e){const{values:t,numColors:n,numVars:r,tokenised:o}=Qc(e),s=t.length;return l=>{let u=o;for(let A=0;A<s;A++)A<r?u=u.replace(qB.token,l[A]):A<r+n?u=u.replace(JB.token,dn.transform(l[A])):u=u.replace(XB.token,ra(l[A]));return u}}const k3=e=>typeof e=="number"?0:e;function F3(e){const t=ZB(e);return _B(e)(t.map(k3))}const vo={test:D3,parse:ZB,createTransformer:_B,getAnimatableNone:F3},$B=(e,t)=>n=>`${n>0?t:e}`;function ev(e,t){return typeof e=="number"?n=>St(e,t,n):dn.test(e)?KB(e,t):e.startsWith("var(")?$B(e,t):nv(e,t)}const tv=(e,t)=>{const n=[...e],r=n.length,o=e.map((s,l)=>ev(s,t[l]));return s=>{for(let l=0;l<r;l++)n[l]=o[l](s);return n}},L3=(e,t)=>{const n={...e,...t},r={};for(const o in n)e[o]!==void 0&&t[o]!==void 0&&(r[o]=ev(e[o],t[o]));return o=>{for(const s in r)n[s]=r[s](o);return n}},nv=(e,t)=>{const n=vo.createTransformer(t),r=Qc(e),o=Qc(t);return r.numVars===o.numVars&&r.numColors===o.numColors&&r.numNumbers>=o.numNumbers?mo(tv(r.values,o.values),n):(Oa(!0,`Complex values '${e}' and '${t}' too different to mix. Ensure all colors are of the same type, and that each contains the same quantity of number and color values. Falling back to instant transition.`),$B(e,t))},ha=(e,t,n)=>{const r=t-e;return r===0?1:(n-e)/r},dE=(e,t)=>n=>St(e,t,n);function N3(e){return typeof e=="number"?dE:typeof e=="string"?dn.test(e)?KB:nv:Array.isArray(e)?tv:typeof e=="object"?L3:dE}function V3(e,t,n){const r=[],o=n||N3(e[0]),s=e.length-1;for(let l=0;l<s;l++){let u=o(e[l],e[l+1]);if(t){const A=Array.isArray(t)?t[l]||Dt:t;u=mo(A,u)}r.push(u)}return r}function rv(e,t,{clamp:n=!0,ease:r,mixer:o}={}){const s=e.length;if(xr(s===t.length,"Both input and output ranges must be the same length"),s===1)return()=>t[0];e[0]>e[s-1]&&(e=[...e].reverse(),t=[...t].reverse());const l=V3(t,r,o),u=l.length,A=g=>{let p=0;if(u>1)for(;p<e.length-2&&!(g<e[p+1]);p++);const C=ha(e[p],e[p+1],g);return l[p](C)};return n?g=>A(Bo(e[0],e[s-1],g)):A}function H3(e,t){const n=e[e.length-1];for(let r=1;r<=t;r++){const o=ha(0,t,r);e.push(St(n,1,o))}}function W3(e){const t=[0];return H3(t,e.length-1),t}function z3(e,t){return e.map(n=>n*t)}function U3(e,t){return e.map(()=>t||HB).splice(0,e.length-1)}function xc({duration:e=300,keyframes:t,times:n,ease:r="easeInOut"}){const o=x3(r)?r.map(uE):uE(r),s={done:!1,value:t[0]},l=z3(n&&n.length===t.length?n:W3(t),e),u=rv(l,t,{ease:Array.isArray(o)?o:U3(t,o)});return{calculatedDuration:e,next:A=>(s.value=u(A),s.done=A>=e,s)}}function ov(e,t){return t?e*(1e3/t):0}const Y3=5;function iv(e,t,n){const r=Math.max(t-Y3,0);return ov(n-e(r),t-r)}const vd=.001,G3=.01,gE=10,K3=.05,q3=1;function J3({duration:e=800,bounce:t=.25,velocity:n=0,mass:r=1}){let o,s;Oa(e<=Eo(gE),"Spring duration must be 10 seconds or less");let l=1-t;l=Bo(K3,q3,l),e=Bo(G3,gE,Gr(e)),l<1?(o=g=>{const p=g*l,C=p*e,h=p-n,m=rg(g,l),I=Math.exp(-C);return vd-h/m*I},s=g=>{const C=g*l*e,h=C*n+n,m=Math.pow(l,2)*Math.pow(g,2)*e,I=Math.exp(-C),B=rg(Math.pow(g,2),l);return(-o(g)+vd>0?-1:1)*((h-m)*I)/B}):(o=g=>{const p=Math.exp(-g*e),C=(g-n)*e+1;return-vd+p*C},s=g=>{const p=Math.exp(-g*e),C=(n-g)*(e*e);return p*C});const u=5/e,A=Z3(o,s,u);if(e=Eo(e),isNaN(A))return{stiffness:100,damping:10,duration:e};{const g=Math.pow(A,2)*r;return{stiffness:g,damping:l*2*Math.sqrt(r*g),duration:e}}}const X3=12;function Z3(e,t,n){let r=n;for(let o=1;o<X3;o++)r=r-e(r)/t(r);return r}function rg(e,t){return e*Math.sqrt(1-t*t)}const _3=["duration","bounce"],$3=["stiffness","damping","mass"];function fE(e,t){return t.some(n=>e[n]!==void 0)}function eD(e){let t={velocity:0,stiffness:100,damping:10,mass:1,isResolvedFromDuration:!1,...e};if(!fE(e,$3)&&fE(e,_3)){const n=J3(e);t={...t,...n,velocity:0,mass:1},t.isResolvedFromDuration=!0}return t}function sv({keyframes:e,restDelta:t,restSpeed:n,...r}){const o=e[0],s=e[e.length-1],l={done:!1,value:o},{stiffness:u,damping:A,mass:g,velocity:p,duration:C,isResolvedFromDuration:h}=eD(r),m=p?-Gr(p):0,I=A/(2*Math.sqrt(u*g)),B=s-o,v=Gr(Math.sqrt(u/g)),O=Math.abs(B)<5;n||(n=O?.01:2),t||(t=O?.005:.5);let j;if(I<1){const x=rg(v,I);j=S=>{const P=Math.exp(-I*v*S);return s-P*((m+I*v*B)/x*Math.sin(x*S)+B*Math.cos(x*S))}}else if(I===1)j=x=>s-Math.exp(-v*x)*(B+(m+v*B)*x);else{const x=v*Math.sqrt(I*I-1);j=S=>{const P=Math.exp(-I*v*S),L=Math.min(x*S,300);return s-P*((m+I*v*B)*Math.sinh(L)+x*B*Math.cosh(L))/x}}return{calculatedDuration:h&&C||null,next:x=>{const S=j(x);if(h)l.done=x>=C;else{let P=m;x!==0&&(I<1?P=iv(j,x,S):P=0);const L=Math.abs(P)<=n,k=Math.abs(s-S)<=t;l.done=L&&k}return l.value=l.done?s:S,l}}}function pE({keyframes:e,velocity:t=0,power:n=.8,timeConstant:r=325,bounceDamping:o=10,bounceStiffness:s=500,modifyTarget:l,min:u,max:A,restDelta:g=.5,restSpeed:p}){const C=e[0],h={done:!1,value:C},m=q=>u!==void 0&&q<u||A!==void 0&&q>A,I=q=>u===void 0?A:A===void 0||Math.abs(u-q)<Math.abs(A-q)?u:A;let B=n*t;const v=C+B,O=l===void 0?v:l(v);O!==v&&(B=O-C);const j=q=>-B*Math.exp(-q/r),x=q=>O+j(q),S=q=>{const J=j(q),U=x(q);h.done=Math.abs(J)<=g,h.value=h.done?O:U};let P,L;const k=q=>{m(h.value)&&(P=q,L=sv({keyframes:[h.value,I(h.value)],velocity:iv(x,q,h.value),damping:o,stiffness:s,restDelta:g,restSpeed:p}))};return k(0),{calculatedDuration:null,next:q=>{let J=!1;return!L&&P===void 0&&(J=!0,S(q),k(q)),P!==void 0&&q>P?L.next(q-P):(!J&&S(q),h)}}}const tD=e=>{const t=({timestamp:n})=>e(n);return{start:()=>vt.update(t,!0),stop:()=>Jr(t),now:()=>Xt.isProcessing?Xt.timestamp:performance.now()}},hE=2e4;function CE(e){let t=0;const n=50;let r=e.next(t);for(;!r.done&&t<hE;)t+=n,r=e.next(t);return t>=hE?1/0:t}const nD={decay:pE,inertia:pE,tween:xc,keyframes:xc,spring:sv};function wc({autoplay:e=!0,delay:t=0,driver:n=tD,keyframes:r,type:o="keyframes",repeat:s=0,repeatDelay:l=0,repeatType:u="loop",onPlay:A,onStop:g,onComplete:p,onUpdate:C,...h}){let m=1,I=!1,B,v;const O=()=>{v=new Promise(X=>{B=X})};O();let j;const x=nD[o]||xc;let S;x!==xc&&typeof r[0]!="number"&&(S=rv([0,100],r,{clamp:!1}),r=[0,100]);const P=x({...h,keyframes:r});let L;u==="mirror"&&(L=x({...h,keyframes:[...r].reverse(),velocity:-(h.velocity||0)}));let k="idle",q=null,J=null,U=null;P.calculatedDuration===null&&s&&(P.calculatedDuration=CE(P));const{calculatedDuration:_}=P;let le=1/0,ie=1/0;_!==null&&(le=_+l,ie=le*(s+1)-l);let Z=0;const K=X=>{if(J===null)return;m>0&&(J=Math.min(J,X)),m<0&&(J=Math.min(X-ie/m,J)),q!==null?Z=q:Z=Math.round(X-J)*m;const ge=Z-t*(m>=0?1:-1),pe=m>=0?ge<0:ge>ie;Z=Math.max(ge,0),k==="finished"&&q===null&&(Z=ie);let ce=Z,fe=P;if(s){const Ce=Z/le;let Ie=Math.floor(Ce),Qe=Ce%1;!Qe&&Ce>=1&&(Qe=1),Qe===1&&Ie--,Ie=Math.min(Ie,s+1);const ae=!!(Ie%2);ae&&(u==="reverse"?(Qe=1-Qe,l&&(Qe-=l/le)):u==="mirror"&&(fe=L));let Ne=Bo(0,1,Qe);Z>ie&&(Ne=u==="reverse"&&ae?1:0),ce=Ne*le}const he=pe?{done:!1,value:r[0]}:fe.next(ce);S&&(he.value=S(he.value));let{done:Be}=he;!pe&&_!==null&&(Be=m>=0?Z>=ie:Z<=0);const me=q===null&&(k==="finished"||k==="running"&&Be);return C&&C(he.value),me&&F(),he},V=()=>{j&&j.stop(),j=void 0},G=()=>{k="idle",V(),B(),O(),J=U=null},F=()=>{k="finished",p&&p(),V(),B()},$=()=>{if(I)return;j||(j=n(K));const X=j.now();A&&A(),q!==null?J=X-q:(!J||k==="finished")&&(J=X),k==="finished"&&O(),U=J,q=null,k="running",j.start()};e&&$();const H={then(X,ge){return v.then(X,ge)},get time(){return Gr(Z)},set time(X){X=Eo(X),Z=X,q!==null||!j||m===0?q=X:J=j.now()-X/m},get duration(){const X=P.calculatedDuration===null?CE(P):P.calculatedDuration;return Gr(X)},get speed(){return m},set speed(X){X===m||!j||(m=X,H.time=Gr(Z))},get state(){return k},play:$,pause:()=>{k="paused",q=Z},stop:()=>{I=!0,k!=="idle"&&(k="idle",g&&g(),G())},cancel:()=>{U!==null&&K(U),G()},complete:()=>{k="finished"},sample:X=>(J=0,K(X))};return H}function rD(e){let t;return()=>(t===void 0&&(t=e()),t)}const oD=rD(()=>Object.hasOwnProperty.call(Element.prototype,"animate")),iD=new Set(["opacity","clipPath","filter","transform","backgroundColor"]),zl=10,sD=2e4,aD=(e,t)=>t.type==="spring"||e==="backgroundColor"||!FB(t.ease);function lD(e,t,{onUpdate:n,onComplete:r,...o}){if(!(oD()&&iD.has(t)&&!o.repeatDelay&&o.repeatType!=="mirror"&&o.damping!==0&&o.type!=="inertia"))return!1;let l=!1,u,A;const g=()=>{A=new Promise(j=>{u=j})};g();let{keyframes:p,duration:C=300,ease:h,times:m}=o;if(aD(t,o)){const j=wc({...o,repeat:0,delay:0});let x={done:!1,value:p[0]};const S=[];let P=0;for(;!x.done&&P<sD;)x=j.sample(P),S.push(x.value),P+=zl;m=void 0,p=S,C=P-zl,h="linear"}const I=E3(e.owner.current,t,p,{...o,duration:C,ease:h,times:m});o.syncStart&&(I.startTime=Xt.isProcessing?Xt.timestamp:document.timeline?document.timeline.currentTime:performance.now());const B=()=>I.cancel(),v=()=>{vt.update(B),u(),g()};return I.onfinish=()=>{e.set(I3(p,o)),r&&r(),v()},{then(j,x){return A.then(j,x)},attachTimeline(j){return I.timeline=j,I.onfinish=null,Dt},get time(){return Gr(I.currentTime||0)},set time(j){I.currentTime=Eo(j)},get speed(){return I.playbackRate},set speed(j){I.playbackRate=j},get duration(){return Gr(C)},play:()=>{l||(I.play(),Jr(B))},pause:()=>I.pause(),stop:()=>{if(l=!0,I.playState==="idle")return;const{currentTime:j}=I;if(j){const x=wc({...o,autoplay:!1});e.setWithVelocity(x.sample(j-zl).value,x.sample(j).value,zl)}v()},complete:()=>I.finish(),cancel:v}}function cD({keyframes:e,delay:t,onUpdate:n,onComplete:r}){const o=()=>(n&&n(e[e.length-1]),r&&r(),{time:0,speed:1,duration:0,play:Dt,pause:Dt,stop:Dt,then:s=>(s(),Promise.resolve()),cancel:Dt,complete:Dt});return t?wc({keyframes:[0,1],duration:0,delay:t,onComplete:o}):o()}const uD={type:"spring",stiffness:500,damping:25,restSpeed:10},AD=e=>({type:"spring",stiffness:550,damping:e===0?2*Math.sqrt(550):30,restSpeed:10}),dD={type:"keyframes",duration:.8},gD={type:"keyframes",ease:[.25,.1,.35,1],duration:.3},fD=(e,{keyframes:t})=>t.length>2?dD:ui.has(e)?e.startsWith("scale")?AD(t[1]):uD:gD,og=(e,t)=>e==="zIndex"?!1:!!(typeof t=="number"||Array.isArray(t)||typeof t=="string"&&(vo.test(t)||t==="0")&&!t.startsWith("url(")),pD=new Set(["brightness","contrast","saturate","opacity"]);function hD(e){const[t,n]=e.slice(0,-1).split("(");if(t==="drop-shadow")return e;const[r]=n.match(cu)||[];if(!r)return e;const o=n.replace(r,"");let s=pD.has(t)?1:0;return r!==n&&(s*=100),t+"("+s+o+")"}const CD=/([a-z-]*)\(.*?\)/g,ig={...vo,getAnimatableNone:e=>{const t=e.match(CD);return t?t.map(hD).join(" "):e}},mD={...BB,color:dn,backgroundColor:dn,outlineColor:dn,fill:dn,stroke:dn,borderColor:dn,borderTopColor:dn,borderRightColor:dn,borderBottomColor:dn,borderLeftColor:dn,filter:ig,WebkitFilter:ig},Bf=e=>mD[e];function av(e,t){let n=Bf(e);return n!==ig&&(n=vo),n.getAnimatableNone?n.getAnimatableNone(t):void 0}const lv=e=>/^0[^.\s]+$/.test(e);function ED(e){if(typeof e=="number")return e===0;if(e!==null)return e==="none"||e==="0"||lv(e)}function ID(e,t,n,r){const o=og(t,n);let s;Array.isArray(n)?s=[...n]:s=[null,n];const l=r.from!==void 0?r.from:e.get();let u;const A=[];for(let g=0;g<s.length;g++)s[g]===null&&(s[g]=g===0?l:s[g-1]),ED(s[g])&&A.push(g),typeof s[g]=="string"&&s[g]!=="none"&&s[g]!=="0"&&(u=s[g]);if(o&&A.length&&u)for(let g=0;g<A.length;g++){const p=A[g];s[p]=av(t,u)}return s}function BD({when:e,delay:t,delayChildren:n,staggerChildren:r,staggerDirection:o,repeat:s,repeatType:l,repeatDelay:u,from:A,elapsed:g,...p}){return!!Object.keys(p).length}function cv(e,t){return e[t]||e.default||e}const vf=(e,t,n,r={})=>o=>{const s=cv(r,e)||{},l=s.delay||r.delay||0;let{elapsed:u=0}=r;u=u-Eo(l);const A=ID(t,e,n,s),g=A[0],p=A[A.length-1],C=og(e,g),h=og(e,p);Oa(C===h,`You are trying to animate ${e} from "${g}" to "${p}". ${g} is not an animatable value - to enable this animation set ${g} to a value animatable to ${p} via the \`style\` property.`);let m={keyframes:A,velocity:t.getVelocity(),ease:"easeOut",...s,delay:-u,onUpdate:I=>{t.set(I),s.onUpdate&&s.onUpdate(I)},onComplete:()=>{o(),s.onComplete&&s.onComplete()}};if(BD(s)||(m={...m,...fD(e,m)}),m.duration&&(m.duration=Eo(m.duration)),m.repeatDelay&&(m.repeatDelay=Eo(m.repeatDelay)),!C||!h||m3.current||s.type===!1)return cD(m);if(t.owner&&t.owner.current instanceof HTMLElement&&!t.owner.getProps().onUpdate){const I=lD(t,e,m);if(I)return I}return wc(m)};function Tc(e){return!!(vn(e)&&e.add)}const uv=e=>/^\-?\d*\.?\d+$/.test(e);function yf(e,t){e.indexOf(t)===-1&&e.push(t)}function bf(e,t){const n=e.indexOf(t);n>-1&&e.splice(n,1)}class Qf{constructor(){this.subscriptions=[]}add(t){return yf(this.subscriptions,t),()=>bf(this.subscriptions,t)}notify(t,n,r){const o=this.subscriptions.length;if(o)if(o===1)this.subscriptions[0](t,n,r);else for(let s=0;s<o;s++){const l=this.subscriptions[s];l&&l(t,n,r)}}getSize(){return this.subscriptions.length}clear(){this.subscriptions.length=0}}const mE=new Set;function xf(e,t,n){e||mE.has(t)||(console.warn(t),n&&console.warn(n),mE.add(t))}const vD=e=>!isNaN(parseFloat(e));class yD{constructor(t,n={}){this.version="10.16.4",this.timeDelta=0,this.lastUpdated=0,this.canTrackVelocity=!1,this.events={},this.updateAndNotify=(r,o=!0)=>{this.prev=this.current,this.current=r;const{delta:s,timestamp:l}=Xt;this.lastUpdated!==l&&(this.timeDelta=s,this.lastUpdated=l,vt.postRender(this.scheduleVelocityCheck)),this.prev!==this.current&&this.events.change&&this.events.change.notify(this.current),this.events.velocityChange&&this.events.velocityChange.notify(this.getVelocity()),o&&this.events.renderRequest&&this.events.renderRequest.notify(this.current)},this.scheduleVelocityCheck=()=>vt.postRender(this.velocityCheck),this.velocityCheck=({timestamp:r})=>{r!==this.lastUpdated&&(this.prev=this.current,this.events.velocityChange&&this.events.velocityChange.notify(this.getVelocity()))},this.hasAnimated=!1,this.prev=this.current=t,this.canTrackVelocity=vD(this.current),this.owner=n.owner}onChange(t){return process.env.NODE_ENV!=="production"&&xf(!1,'value.onChange(callback) is deprecated. Switch to value.on("change", callback).'),this.on("change",t)}on(t,n){this.events[t]||(this.events[t]=new Qf);const r=this.events[t].add(n);return t==="change"?()=>{r(),vt.read(()=>{this.events.change.getSize()||this.stop()})}:r}clearListeners(){for(const t in this.events)this.events[t].clear()}attach(t,n){this.passiveEffect=t,this.stopPassiveEffect=n}set(t,n=!0){!n||!this.passiveEffect?this.updateAndNotify(t,n):this.passiveEffect(t,this.updateAndNotify)}setWithVelocity(t,n,r){this.set(n),this.prev=t,this.timeDelta=r}jump(t){this.updateAndNotify(t),this.prev=t,this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}get(){return this.current}getPrevious(){return this.prev}getVelocity(){return this.canTrackVelocity?ov(parseFloat(this.current)-parseFloat(this.prev),this.timeDelta):0}start(t){return this.stop(),new Promise(n=>{this.hasAnimated=!0,this.animation=t(n),this.events.animationStart&&this.events.animationStart.notify()}).then(()=>{this.events.animationComplete&&this.events.animationComplete.notify(),this.clearAnimation()})}stop(){this.animation&&(this.animation.stop(),this.events.animationCancel&&this.events.animationCancel.notify()),this.clearAnimation()}isAnimating(){return!!this.animation}clearAnimation(){delete this.animation}destroy(){this.clearListeners(),this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}}function rs(e,t){return new yD(e,t)}const Av=e=>t=>t.test(e),bD={test:e=>e==="auto",parse:e=>e},dv=[Ai,Me,br,Ao,RM,SM,bD],Us=e=>dv.find(Av(e)),QD=[...dv,dn,vo],xD=e=>QD.find(Av(e));function wD(e,t,n){e.hasValue(t)?e.getValue(t).set(n):e.addValue(t,rs(n))}function TD(e,t){const n=Au(e,t);let{transitionEnd:r={},transition:o={},...s}=n?e.makeTargetAnimatable(n,!1):{};s={...s,...r};for(const l in s){const u=GM(s[l]);wD(e,l,u)}}function PD(e,t,n){var r,o;const s=Object.keys(t).filter(u=>!e.hasValue(u)),l=s.length;if(l)for(let u=0;u<l;u++){const A=s[u],g=t[A];let p=null;Array.isArray(g)&&(p=g[0]),p===null&&(p=(o=(r=n[A])!==null&&r!==void 0?r:e.readValue(A))!==null&&o!==void 0?o:t[A]),p!=null&&(typeof p=="string"&&(uv(p)||lv(p))?p=parseFloat(p):!xD(p)&&vo.test(g)&&(p=av(A,g)),e.addValue(A,rs(p,{owner:e})),n[A]===void 0&&(n[A]=p),p!==null&&e.setBaseTarget(A,p))}}function SD(e,t){return t?(t[e]||t.default||t).from:void 0}function RD(e,t,n){const r={};for(const o in e){const s=SD(o,t);if(s!==void 0)r[o]=s;else{const l=n.getValue(o);l&&(r[o]=l.get())}}return r}function OD({protectedKeys:e,needsAnimating:t},n){const r=e.hasOwnProperty(n)&&t[n]!==!0;return t[n]=!1,r}function gv(e,t,{delay:n=0,transitionOverride:r,type:o}={}){let{transition:s=e.getDefaultTransition(),transitionEnd:l,...u}=e.makeTargetAnimatable(t);const A=e.getValue("willChange");r&&(s=r);const g=[],p=o&&e.animationState&&e.animationState.getState()[o];for(const C in u){const h=e.getValue(C),m=u[C];if(!h||m===void 0||p&&OD(p,C))continue;const I={delay:n,elapsed:0,...s};if(window.HandoffAppearAnimations&&!h.hasAnimated){const v=e.getProps()[C3];v&&(I.elapsed=window.HandoffAppearAnimations(v,C,h,vt),I.syncStart=!0)}h.start(vf(C,h,m,e.shouldReduceMotion&&ui.has(C)?{type:!1}:I));const B=h.animation;Tc(A)&&(A.add(C),B.then(()=>A.remove(C))),g.push(B)}return l&&Promise.all(g).then(()=>{l&&TD(e,l)}),g}function sg(e,t,n={}){const r=Au(e,t,n.custom);let{transition:o=e.getDefaultTransition()||{}}=r||{};n.transitionOverride&&(o=n.transitionOverride);const s=r?()=>Promise.all(gv(e,r,n)):()=>Promise.resolve(),l=e.variantChildren&&e.variantChildren.size?(A=0)=>{const{delayChildren:g=0,staggerChildren:p,staggerDirection:C}=o;return jD(e,t,g+A,p,C,n)}:()=>Promise.resolve(),{when:u}=o;if(u){const[A,g]=u==="beforeChildren"?[s,l]:[l,s];return A().then(()=>g())}else return Promise.all([s(),l(n.delay)])}function jD(e,t,n=0,r=0,o=1,s){const l=[],u=(e.variantChildren.size-1)*r,A=o===1?(g=0)=>g*r:(g=0)=>u-g*r;return Array.from(e.variantChildren).sort(MD).forEach((g,p)=>{g.notify("AnimationStart",t),l.push(sg(g,t,{...s,delay:n+A(p)}).then(()=>g.notify("AnimationComplete",t)))}),Promise.all(l)}function MD(e,t){return e.sortNodePosition(t)}function DD(e,t,n={}){e.notify("AnimationStart",t);let r;if(Array.isArray(t)){const o=t.map(s=>sg(e,s,n));r=Promise.all(o)}else if(typeof t=="string")r=sg(e,t,n);else{const o=typeof t=="function"?Au(e,t,n.custom):t;r=Promise.all(gv(e,o,n))}return r.then(()=>e.notify("AnimationComplete",t))}const kD=[...lf].reverse(),FD=lf.length;function LD(e){return t=>Promise.all(t.map(({animation:n,options:r})=>DD(e,n,r)))}function ND(e){let t=LD(e);const n=HD();let r=!0;const o=(A,g)=>{const p=Au(e,g);if(p){const{transition:C,transitionEnd:h,...m}=p;A={...A,...m,...h}}return A};function s(A){t=A(e)}function l(A,g){const p=e.getProps(),C=e.getVariantContext(!0)||{},h=[],m=new Set;let I={},B=1/0;for(let O=0;O<FD;O++){const j=kD[O],x=n[j],S=p[j]!==void 0?p[j]:C[j],P=fa(S),L=j===g?x.isActive:null;L===!1&&(B=O);let k=S===C[j]&&S!==p[j]&&P;if(k&&r&&e.manuallyAnimateOnMount&&(k=!1),x.protectedKeys={...I},!x.isActive&&L===null||!S&&!x.prevProp||au(S)||typeof S=="boolean")continue;const q=VD(x.prevProp,S);let J=q||j===g&&x.isActive&&!k&&P||O>B&&P;const U=Array.isArray(S)?S:[S];let _=U.reduce(o,{});L===!1&&(_={});const{prevResolvedValues:le={}}=x,ie={...le,..._},Z=K=>{J=!0,m.delete(K),x.needsAnimating[K]=!0};for(const K in ie){const V=_[K],G=le[K];I.hasOwnProperty(K)||(V!==G?bc(V)&&bc(G)?!DB(V,G)||q?Z(K):x.protectedKeys[K]=!0:V!==void 0?Z(K):m.add(K):V!==void 0&&m.has(K)?Z(K):x.protectedKeys[K]=!0)}x.prevProp=S,x.prevResolvedValues=_,x.isActive&&(I={...I,..._}),r&&e.blockInitialAnimation&&(J=!1),J&&!k&&h.push(...U.map(K=>({animation:K,options:{type:j,...A}})))}if(m.size){const O={};m.forEach(j=>{const x=e.getBaseTarget(j);x!==void 0&&(O[j]=x)}),h.push({animation:O})}let v=!!h.length;return r&&p.initial===!1&&!e.manuallyAnimateOnMount&&(v=!1),r=!1,v?t(h):Promise.resolve()}function u(A,g,p){var C;if(n[A].isActive===g)return Promise.resolve();(C=e.variantChildren)===null||C===void 0||C.forEach(m=>{var I;return(I=m.animationState)===null||I===void 0?void 0:I.setActive(A,g)}),n[A].isActive=g;const h=l(p,A);for(const m in n)n[m].protectedKeys={};return h}return{animateChanges:l,setActive:u,setAnimateFunction:s,getState:()=>n}}function VD(e,t){return typeof t=="string"?t!==e:Array.isArray(t)?!DB(t,e):!1}function Uo(e=!1){return{isActive:e,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}function HD(){return{animate:Uo(!0),whileInView:Uo(),whileHover:Uo(),whileTap:Uo(),whileDrag:Uo(),whileFocus:Uo(),exit:Uo()}}class WD extends xo{constructor(t){super(t),t.animationState||(t.animationState=ND(t))}updateAnimationControlsSubscription(){const{animate:t}=this.node.getProps();this.unmount(),au(t)&&(this.unmount=t.subscribe(this.node))}mount(){this.updateAnimationControlsSubscription()}update(){const{animate:t}=this.node.getProps(),{animate:n}=this.node.prevProps||{};t!==n&&this.updateAnimationControlsSubscription()}unmount(){}}let zD=0;class UD extends xo{constructor(){super(...arguments),this.id=zD++}update(){if(!this.node.presenceContext)return;const{isPresent:t,onExitComplete:n,custom:r}=this.node.presenceContext,{isPresent:o}=this.node.prevPresenceContext||{};if(!this.node.animationState||t===o)return;const s=this.node.animationState.setActive("exit",!t,{custom:r??this.node.getProps().custom});n&&!t&&s.then(()=>n(this.id))}mount(){const{register:t}=this.node.presenceContext||{};t&&(this.unmount=t(this.id))}unmount(){}}const YD={animation:{Feature:WD},exit:{Feature:UD}},EE=(e,t)=>Math.abs(e-t);function GD(e,t){const n=EE(e.x,t.x),r=EE(e.y,t.y);return Math.sqrt(n**2+r**2)}class fv{constructor(t,n,{transformPagePoint:r}={}){if(this.startEvent=null,this.lastMoveEvent=null,this.lastMoveEventInfo=null,this.handlers={},this.updatePoint=()=>{if(!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const g=bd(this.lastMoveEventInfo,this.history),p=this.startEvent!==null,C=GD(g.offset,{x:0,y:0})>=3;if(!p&&!C)return;const{point:h}=g,{timestamp:m}=Xt;this.history.push({...h,timestamp:m});const{onStart:I,onMove:B}=this.handlers;p||(I&&I(this.lastMoveEvent,g),this.startEvent=this.lastMoveEvent),B&&B(this.lastMoveEvent,g)},this.handlePointerMove=(g,p)=>{this.lastMoveEvent=g,this.lastMoveEventInfo=yd(p,this.transformPagePoint),vt.update(this.updatePoint,!0)},this.handlePointerUp=(g,p)=>{if(this.end(),!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const{onEnd:C,onSessionEnd:h}=this.handlers,m=bd(g.type==="pointercancel"?this.lastMoveEventInfo:yd(p,this.transformPagePoint),this.history);this.startEvent&&C&&C(g,m),h&&h(g,m)},!SB(t))return;this.handlers=n,this.transformPagePoint=r;const o=uu(t),s=yd(o,this.transformPagePoint),{point:l}=s,{timestamp:u}=Xt;this.history=[{...l,timestamp:u}];const{onSessionStart:A}=n;A&&A(t,bd(s,this.history)),this.removeListeners=mo(Yr(window,"pointermove",this.handlePointerMove),Yr(window,"pointerup",this.handlePointerUp),Yr(window,"pointercancel",this.handlePointerUp))}updateHandlers(t){this.handlers=t}end(){this.removeListeners&&this.removeListeners(),Jr(this.updatePoint)}}function yd(e,t){return t?{point:t(e.point)}:e}function IE(e,t){return{x:e.x-t.x,y:e.y-t.y}}function bd({point:e},t){return{point:e,delta:IE(e,pv(t)),offset:IE(e,KD(t)),velocity:qD(t,.1)}}function KD(e){return e[0]}function pv(e){return e[e.length-1]}function qD(e,t){if(e.length<2)return{x:0,y:0};let n=e.length-1,r=null;const o=pv(e);for(;n>=0&&(r=e[n],!(o.timestamp-r.timestamp>Eo(t)));)n--;if(!r)return{x:0,y:0};const s=Gr(o.timestamp-r.timestamp);if(s===0)return{x:0,y:0};const l={x:(o.x-r.x)/s,y:(o.y-r.y)/s};return l.x===1/0&&(l.x=0),l.y===1/0&&(l.y=0),l}function kn(e){return e.max-e.min}function ag(e,t=0,n=.01){return Math.abs(e-t)<=n}function BE(e,t,n,r=.5){e.origin=r,e.originPoint=St(t.min,t.max,e.origin),e.scale=kn(n)/kn(t),(ag(e.scale,1,1e-4)||isNaN(e.scale))&&(e.scale=1),e.translate=St(n.min,n.max,e.origin)-e.originPoint,(ag(e.translate)||isNaN(e.translate))&&(e.translate=0)}function oa(e,t,n,r){BE(e.x,t.x,n.x,r?r.originX:void 0),BE(e.y,t.y,n.y,r?r.originY:void 0)}function vE(e,t,n){e.min=n.min+t.min,e.max=e.min+kn(t)}function JD(e,t,n){vE(e.x,t.x,n.x),vE(e.y,t.y,n.y)}function yE(e,t,n){e.min=t.min-n.min,e.max=e.min+kn(t)}function ia(e,t,n){yE(e.x,t.x,n.x),yE(e.y,t.y,n.y)}function XD(e,{min:t,max:n},r){return t!==void 0&&e<t?e=r?St(t,e,r.min):Math.max(e,t):n!==void 0&&e>n&&(e=r?St(n,e,r.max):Math.min(e,n)),e}function bE(e,t,n){return{min:t!==void 0?e.min+t:void 0,max:n!==void 0?e.max+n-(e.max-e.min):void 0}}function ZD(e,{top:t,left:n,bottom:r,right:o}){return{x:bE(e.x,n,o),y:bE(e.y,t,r)}}function QE(e,t){let n=t.min-e.min,r=t.max-e.max;return t.max-t.min<e.max-e.min&&([n,r]=[r,n]),{min:n,max:r}}function _D(e,t){return{x:QE(e.x,t.x),y:QE(e.y,t.y)}}function $D(e,t){let n=.5;const r=kn(e),o=kn(t);return o>r?n=ha(t.min,t.max-r,e.min):r>o&&(n=ha(e.min,e.max-o,t.min)),Bo(0,1,n)}function ek(e,t){const n={};return t.min!==void 0&&(n.min=t.min-e.min),t.max!==void 0&&(n.max=t.max-e.min),n}const lg=.35;function tk(e=lg){return e===!1?e=0:e===!0&&(e=lg),{x:xE(e,"left","right"),y:xE(e,"top","bottom")}}function xE(e,t,n){return{min:wE(e,t),max:wE(e,n)}}function wE(e,t){return typeof e=="number"?e:e[t]||0}const TE=()=>({translate:0,scale:1,origin:0,originPoint:0}),Yi=()=>({x:TE(),y:TE()}),PE=()=>({min:0,max:0}),zt=()=>({x:PE(),y:PE()});function Br(e){return[e("x"),e("y")]}function hv({top:e,left:t,right:n,bottom:r}){return{x:{min:t,max:n},y:{min:e,max:r}}}function nk({x:e,y:t}){return{top:t.min,right:e.max,bottom:t.max,left:e.min}}function rk(e,t){if(!t)return e;const n=t({x:e.left,y:e.top}),r=t({x:e.right,y:e.bottom});return{top:n.y,left:n.x,bottom:r.y,right:r.x}}function Qd(e){return e===void 0||e===1}function cg({scale:e,scaleX:t,scaleY:n}){return!Qd(e)||!Qd(t)||!Qd(n)}function qo(e){return cg(e)||Cv(e)||e.z||e.rotate||e.rotateX||e.rotateY}function Cv(e){return SE(e.x)||SE(e.y)}function SE(e){return e&&e!=="0%"}function Pc(e,t,n){const r=e-n,o=t*r;return n+o}function RE(e,t,n,r,o){return o!==void 0&&(e=Pc(e,o,r)),Pc(e,n,r)+t}function ug(e,t=0,n=1,r,o){e.min=RE(e.min,t,n,r,o),e.max=RE(e.max,t,n,r,o)}function mv(e,{x:t,y:n}){ug(e.x,t.translate,t.scale,t.originPoint),ug(e.y,n.translate,n.scale,n.originPoint)}function ok(e,t,n,r=!1){const o=n.length;if(!o)return;t.x=t.y=1;let s,l;for(let u=0;u<o;u++){s=n[u],l=s.projectionDelta;const A=s.instance;A&&A.style&&A.style.display==="contents"||(r&&s.options.layoutScroll&&s.scroll&&s!==s.root&&Gi(e,{x:-s.scroll.offset.x,y:-s.scroll.offset.y}),l&&(t.x*=l.x.scale,t.y*=l.y.scale,mv(e,l)),r&&qo(s.latestValues)&&Gi(e,s.latestValues))}t.x=OE(t.x),t.y=OE(t.y)}function OE(e){return Number.isInteger(e)||e>1.0000000000001||e<.999999999999?e:1}function go(e,t){e.min=e.min+t,e.max=e.max+t}function jE(e,t,[n,r,o]){const s=t[o]!==void 0?t[o]:.5,l=St(e.min,e.max,s);ug(e,t[n],t[r],l,t.scale)}const ik=["x","scaleX","originX"],sk=["y","scaleY","originY"];function Gi(e,t){jE(e.x,t,ik),jE(e.y,t,sk)}function Ev(e,t){return hv(rk(e.getBoundingClientRect(),t))}function ak(e,t,n){const r=Ev(e,n),{scroll:o}=t;return o&&(go(r.x,o.offset.x),go(r.y,o.offset.y)),r}const lk=new WeakMap;class ck{constructor(t){this.openGlobalLock=null,this.isDragging=!1,this.currentDirection=null,this.originPoint={x:0,y:0},this.constraints=!1,this.hasMutatedConstraints=!1,this.elastic=zt(),this.visualElement=t}start(t,{snapToCursor:n=!1}={}){const{presenceContext:r}=this.visualElement;if(r&&r.isPresent===!1)return;const o=A=>{this.stopAnimation(),n&&this.snapToCursor(uu(A,"page").point)},s=(A,g)=>{const{drag:p,dragPropagation:C,onDragStart:h}=this.getProps();if(p&&!C&&(this.openGlobalLock&&this.openGlobalLock(),this.openGlobalLock=OB(p),!this.openGlobalLock))return;this.isDragging=!0,this.currentDirection=null,this.resolveConstraints(),this.visualElement.projection&&(this.visualElement.projection.isAnimationBlocked=!0,this.visualElement.projection.target=void 0),Br(I=>{let B=this.getAxisMotionValue(I).get()||0;if(br.test(B)){const{projection:v}=this.visualElement;if(v&&v.layout){const O=v.layout.layoutBox[I];O&&(B=kn(O)*(parseFloat(B)/100))}}this.originPoint[I]=B}),h&&vt.update(()=>h(A,g),!1,!0);const{animationState:m}=this.visualElement;m&&m.setActive("whileDrag",!0)},l=(A,g)=>{const{dragPropagation:p,dragDirectionLock:C,onDirectionLock:h,onDrag:m}=this.getProps();if(!p&&!this.openGlobalLock)return;const{offset:I}=g;if(C&&this.currentDirection===null){this.currentDirection=uk(I),this.currentDirection!==null&&h&&h(this.currentDirection);return}this.updateAxis("x",g.point,I),this.updateAxis("y",g.point,I),this.visualElement.render(),m&&m(A,g)},u=(A,g)=>this.stop(A,g);this.panSession=new fv(t,{onSessionStart:o,onStart:s,onMove:l,onSessionEnd:u},{transformPagePoint:this.visualElement.getTransformPagePoint()})}stop(t,n){const r=this.isDragging;if(this.cancel(),!r)return;const{velocity:o}=n;this.startAnimation(o);const{onDragEnd:s}=this.getProps();s&&vt.update(()=>s(t,n))}cancel(){this.isDragging=!1;const{projection:t,animationState:n}=this.visualElement;t&&(t.isAnimationBlocked=!1),this.panSession&&this.panSession.end(),this.panSession=void 0;const{dragPropagation:r}=this.getProps();!r&&this.openGlobalLock&&(this.openGlobalLock(),this.openGlobalLock=null),n&&n.setActive("whileDrag",!1)}updateAxis(t,n,r){const{drag:o}=this.getProps();if(!r||!Ul(t,o,this.currentDirection))return;const s=this.getAxisMotionValue(t);let l=this.originPoint[t]+r[t];this.constraints&&this.constraints[t]&&(l=XD(l,this.constraints[t],this.elastic[t])),s.set(l)}resolveConstraints(){const{dragConstraints:t,dragElastic:n}=this.getProps(),{layout:r}=this.visualElement.projection||{},o=this.constraints;t&&zi(t)?this.constraints||(this.constraints=this.resolveRefConstraints()):t&&r?this.constraints=ZD(r.layoutBox,t):this.constraints=!1,this.elastic=tk(n),o!==this.constraints&&r&&this.constraints&&!this.hasMutatedConstraints&&Br(s=>{this.getAxisMotionValue(s)&&(this.constraints[s]=ek(r.layoutBox[s],this.constraints[s]))})}resolveRefConstraints(){const{dragConstraints:t,onMeasureDragConstraints:n}=this.getProps();if(!t||!zi(t))return!1;const r=t.current;xr(r!==null,"If `dragConstraints` is set as a React ref, that ref must be passed to another component's `ref` prop.");const{projection:o}=this.visualElement;if(!o||!o.layout)return!1;const s=ak(r,o.root,this.visualElement.getTransformPagePoint());let l=_D(o.layout.layoutBox,s);if(n){const u=n(nk(l));this.hasMutatedConstraints=!!u,u&&(l=hv(u))}return l}startAnimation(t){const{drag:n,dragMomentum:r,dragElastic:o,dragTransition:s,dragSnapToOrigin:l,onDragTransitionEnd:u}=this.getProps(),A=this.constraints||{},g=Br(p=>{if(!Ul(p,n,this.currentDirection))return;let C=A&&A[p]||{};l&&(C={min:0,max:0});const h=o?200:1e6,m=o?40:1e7,I={type:"inertia",velocity:r?t[p]:0,bounceStiffness:h,bounceDamping:m,timeConstant:750,restDelta:1,restSpeed:10,...s,...C};return this.startAxisValueAnimation(p,I)});return Promise.all(g).then(u)}startAxisValueAnimation(t,n){const r=this.getAxisMotionValue(t);return r.start(vf(t,r,0,n))}stopAnimation(){Br(t=>this.getAxisMotionValue(t).stop())}getAxisMotionValue(t){const n="_drag"+t.toUpperCase(),r=this.visualElement.getProps(),o=r[n];return o||this.visualElement.getValue(t,(r.initial?r.initial[t]:void 0)||0)}snapToCursor(t){Br(n=>{const{drag:r}=this.getProps();if(!Ul(n,r,this.currentDirection))return;const{projection:o}=this.visualElement,s=this.getAxisMotionValue(n);if(o&&o.layout){const{min:l,max:u}=o.layout.layoutBox[n];s.set(t[n]-St(l,u,.5))}})}scalePositionWithinConstraints(){if(!this.visualElement.current)return;const{drag:t,dragConstraints:n}=this.getProps(),{projection:r}=this.visualElement;if(!zi(n)||!r||!this.constraints)return;this.stopAnimation();const o={x:0,y:0};Br(l=>{const u=this.getAxisMotionValue(l);if(u){const A=u.get();o[l]=$D({min:A,max:A},this.constraints[l])}});const{transformTemplate:s}=this.visualElement.getProps();this.visualElement.current.style.transform=s?s({},""):"none",r.root&&r.root.updateScroll(),r.updateLayout(),this.resolveConstraints(),Br(l=>{if(!Ul(l,t,null))return;const u=this.getAxisMotionValue(l),{min:A,max:g}=this.constraints[l];u.set(St(A,g,o[l]))})}addListeners(){if(!this.visualElement.current)return;lk.set(this.visualElement,this);const t=this.visualElement.current,n=Yr(t,"pointerdown",A=>{const{drag:g,dragListener:p=!0}=this.getProps();g&&p&&this.start(A)}),r=()=>{const{dragConstraints:A}=this.getProps();zi(A)&&(this.constraints=this.resolveRefConstraints())},{projection:o}=this.visualElement,s=o.addEventListener("measure",r);o&&!o.layout&&(o.root&&o.root.updateScroll(),o.updateLayout()),r();const l=Ur(window,"resize",()=>this.scalePositionWithinConstraints()),u=o.addEventListener("didUpdate",({delta:A,hasLayoutChanged:g})=>{this.isDragging&&g&&(Br(p=>{const C=this.getAxisMotionValue(p);C&&(this.originPoint[p]+=A[p].translate,C.set(C.get()+A[p].translate))}),this.visualElement.render())});return()=>{l(),n(),s(),u&&u()}}getProps(){const t=this.visualElement.getProps(),{drag:n=!1,dragDirectionLock:r=!1,dragPropagation:o=!1,dragConstraints:s=!1,dragElastic:l=lg,dragMomentum:u=!0}=t;return{...t,drag:n,dragDirectionLock:r,dragPropagation:o,dragConstraints:s,dragElastic:l,dragMomentum:u}}}function Ul(e,t,n){return(t===!0||t===e)&&(n===null||n===e)}function uk(e,t=10){let n=null;return Math.abs(e.y)>t?n="y":Math.abs(e.x)>t&&(n="x"),n}class Ak extends xo{constructor(t){super(t),this.removeGroupControls=Dt,this.removeListeners=Dt,this.controls=new ck(t)}mount(){const{dragControls:t}=this.node.getProps();t&&(this.removeGroupControls=t.subscribe(this.controls)),this.removeListeners=this.controls.addListeners()||Dt}unmount(){this.removeGroupControls(),this.removeListeners()}}const ME=e=>(t,n)=>{e&&vt.update(()=>e(t,n))};class dk extends xo{constructor(){super(...arguments),this.removePointerDownListener=Dt}onPointerDown(t){this.session=new fv(t,this.createPanHandlers(),{transformPagePoint:this.node.getTransformPagePoint()})}createPanHandlers(){const{onPanSessionStart:t,onPanStart:n,onPan:r,onPanEnd:o}=this.node.getProps();return{onSessionStart:ME(t),onStart:ME(n),onMove:r,onEnd:(s,l)=>{delete this.session,o&&vt.update(()=>o(s,l))}}}mount(){this.removePointerDownListener=Yr(this.node.current,"pointerdown",t=>this.onPointerDown(t))}update(){this.session&&this.session.updateHandlers(this.createPanHandlers())}unmount(){this.removePointerDownListener(),this.session&&this.session.end()}}function gk(){const e=w.useContext(af);if(e===null)return[!0,null];const{isPresent:t,onExitComplete:n,register:r}=e,o=w.useId();return w.useEffect(()=>r(o),[]),!t&&n?[!1,()=>n&&n(o)]:[!0]}const sc={hasAnimatedSinceResize:!0,hasEverUpdated:!1};function DE(e,t){return t.max===t.min?0:e/(t.max-t.min)*100}const Ys={correct:(e,t)=>{if(!t.target)return e;if(typeof e=="string")if(Me.test(e))e=parseFloat(e);else return e;const n=DE(e,t.target.x),r=DE(e,t.target.y);return`${n}% ${r}%`}},fk={correct:(e,{treeScale:t,projectionDelta:n})=>{const r=e,o=vo.parse(e);if(o.length>5)return r;const s=vo.createTransformer(e),l=typeof o[0]!="number"?1:0,u=n.x.scale*t.x,A=n.y.scale*t.y;o[0+l]/=u,o[1+l]/=A;const g=St(u,A,.5);return typeof o[2+l]=="number"&&(o[2+l]/=g),typeof o[3+l]=="number"&&(o[3+l]/=g),s(o)}};class pk extends w.Component{componentDidMount(){const{visualElement:t,layoutGroup:n,switchLayoutGroup:r,layoutId:o}=this.props,{projection:s}=t;yM(hk),s&&(n.group&&n.group.add(s),r&&r.register&&o&&r.register(s),s.root.didUpdate(),s.addEventListener("animationComplete",()=>{this.safeToRemove()}),s.setOptions({...s.options,onExitComplete:()=>this.safeToRemove()})),sc.hasEverUpdated=!0}getSnapshotBeforeUpdate(t){const{layoutDependency:n,visualElement:r,drag:o,isPresent:s}=this.props,l=r.projection;return l&&(l.isPresent=s,o||t.layoutDependency!==n||n===void 0?l.willUpdate():this.safeToRemove(),t.isPresent!==s&&(s?l.promote():l.relegate()||vt.postRender(()=>{const u=l.getStack();(!u||!u.members.length)&&this.safeToRemove()}))),null}componentDidUpdate(){const{projection:t}=this.props.visualElement;t&&(t.root.didUpdate(),queueMicrotask(()=>{!t.currentAnimation&&t.isLead()&&this.safeToRemove()}))}componentWillUnmount(){const{visualElement:t,layoutGroup:n,switchLayoutGroup:r}=this.props,{projection:o}=t;o&&(o.scheduleCheckAfterUnmount(),n&&n.group&&n.group.remove(o),r&&r.deregister&&r.deregister(o))}safeToRemove(){const{safeToRemove:t}=this.props;t&&t()}render(){return null}}function Iv(e){const[t,n]=gk(),r=w.useContext(pB);return w.createElement(pk,{...e,layoutGroup:r,switchLayoutGroup:w.useContext(hB),isPresent:t,safeToRemove:n})}const hk={borderRadius:{...Ys,applyTo:["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"]},borderTopLeftRadius:Ys,borderTopRightRadius:Ys,borderBottomLeftRadius:Ys,borderBottomRightRadius:Ys,boxShadow:fk},Bv=["TopLeft","TopRight","BottomLeft","BottomRight"],Ck=Bv.length,kE=e=>typeof e=="string"?parseFloat(e):e,FE=e=>typeof e=="number"||Me.test(e);function mk(e,t,n,r,o,s){o?(e.opacity=St(0,n.opacity!==void 0?n.opacity:1,Ek(r)),e.opacityExit=St(t.opacity!==void 0?t.opacity:1,0,Ik(r))):s&&(e.opacity=St(t.opacity!==void 0?t.opacity:1,n.opacity!==void 0?n.opacity:1,r));for(let l=0;l<Ck;l++){const u=`border${Bv[l]}Radius`;let A=LE(t,u),g=LE(n,u);if(A===void 0&&g===void 0)continue;A||(A=0),g||(g=0),A===0||g===0||FE(A)===FE(g)?(e[u]=Math.max(St(kE(A),kE(g),r),0),(br.test(g)||br.test(A))&&(e[u]+="%")):e[u]=g}(t.rotate||n.rotate)&&(e.rotate=St(t.rotate||0,n.rotate||0,r))}function LE(e,t){return e[t]!==void 0?e[t]:e.borderRadius}const Ek=vv(0,.5,mf),Ik=vv(.5,.95,Dt);function vv(e,t,n){return r=>r<e?0:r>t?1:n(ha(e,t,r))}function NE(e,t){e.min=t.min,e.max=t.max}function qn(e,t){NE(e.x,t.x),NE(e.y,t.y)}function VE(e,t,n,r,o){return e-=t,e=Pc(e,1/n,r),o!==void 0&&(e=Pc(e,1/o,r)),e}function Bk(e,t=0,n=1,r=.5,o,s=e,l=e){if(br.test(t)&&(t=parseFloat(t),t=St(l.min,l.max,t/100)-l.min),typeof t!="number")return;let u=St(s.min,s.max,r);e===s&&(u-=t),e.min=VE(e.min,t,n,u,o),e.max=VE(e.max,t,n,u,o)}function HE(e,t,[n,r,o],s,l){Bk(e,t[n],t[r],t[o],t.scale,s,l)}const vk=["x","scaleX","originX"],yk=["y","scaleY","originY"];function WE(e,t,n,r){HE(e.x,t,vk,n?n.x:void 0,r?r.x:void 0),HE(e.y,t,yk,n?n.y:void 0,r?r.y:void 0)}function zE(e){return e.translate===0&&e.scale===1}function yv(e){return zE(e.x)&&zE(e.y)}function bk(e,t){return e.x.min===t.x.min&&e.x.max===t.x.max&&e.y.min===t.y.min&&e.y.max===t.y.max}function bv(e,t){return Math.round(e.x.min)===Math.round(t.x.min)&&Math.round(e.x.max)===Math.round(t.x.max)&&Math.round(e.y.min)===Math.round(t.y.min)&&Math.round(e.y.max)===Math.round(t.y.max)}function UE(e){return kn(e.x)/kn(e.y)}class Qk{constructor(){this.members=[]}add(t){yf(this.members,t),t.scheduleRender()}remove(t){if(bf(this.members,t),t===this.prevLead&&(this.prevLead=void 0),t===this.lead){const n=this.members[this.members.length-1];n&&this.promote(n)}}relegate(t){const n=this.members.findIndex(o=>t===o);if(n===0)return!1;let r;for(let o=n;o>=0;o--){const s=this.members[o];if(s.isPresent!==!1){r=s;break}}return r?(this.promote(r),!0):!1}promote(t,n){const r=this.lead;if(t!==r&&(this.prevLead=r,this.lead=t,t.show(),r)){r.instance&&r.scheduleRender(),t.scheduleRender(),t.resumeFrom=r,n&&(t.resumeFrom.preserveOpacity=!0),r.snapshot&&(t.snapshot=r.snapshot,t.snapshot.latestValues=r.animationValues||r.latestValues),t.root&&t.root.isUpdating&&(t.isLayoutDirty=!0);const{crossfade:o}=t.options;o===!1&&r.hide()}}exitAnimationComplete(){this.members.forEach(t=>{const{options:n,resumingFrom:r}=t;n.onExitComplete&&n.onExitComplete(),r&&r.options.onExitComplete&&r.options.onExitComplete()})}scheduleRender(){this.members.forEach(t=>{t.instance&&t.scheduleRender(!1)})}removeLeadSnapshot(){this.lead&&this.lead.snapshot&&(this.lead.snapshot=void 0)}}function YE(e,t,n){let r="";const o=e.x.translate/t.x,s=e.y.translate/t.y;if((o||s)&&(r=`translate3d(${o}px, ${s}px, 0) `),(t.x!==1||t.y!==1)&&(r+=`scale(${1/t.x}, ${1/t.y}) `),n){const{rotate:A,rotateX:g,rotateY:p}=n;A&&(r+=`rotate(${A}deg) `),g&&(r+=`rotateX(${g}deg) `),p&&(r+=`rotateY(${p}deg) `)}const l=e.x.scale*t.x,u=e.y.scale*t.y;return(l!==1||u!==1)&&(r+=`scale(${l}, ${u})`),r||"none"}const xk=(e,t)=>e.depth-t.depth;class wk{constructor(){this.children=[],this.isDirty=!1}add(t){yf(this.children,t),this.isDirty=!0}remove(t){bf(this.children,t),this.isDirty=!0}forEach(t){this.isDirty&&this.children.sort(xk),this.isDirty=!1,this.children.forEach(t)}}function Tk(e,t){const n=performance.now(),r=({timestamp:o})=>{const s=o-n;s>=t&&(Jr(r),e(s-t))};return vt.read(r,!0),()=>Jr(r)}function Pk(e){window.MotionDebug&&window.MotionDebug.record(e)}function Sk(e){return e instanceof SVGElement&&e.tagName!=="svg"}function Rk(e,t,n){const r=vn(e)?e:rs(e);return r.start(vf("",r,t,n)),r.animation}const GE=["","X","Y","Z"],KE=1e3;let Ok=0;const Jo={type:"projectionFrame",totalNodes:0,resolvedTargetDeltas:0,recalculatedProjection:0};function Qv({attachResizeListener:e,defaultParent:t,measureScroll:n,checkIsScrollRoot:r,resetTransform:o}){return class{constructor(l={},u=t==null?void 0:t()){this.id=Ok++,this.animationId=0,this.children=new Set,this.options={},this.isTreeAnimating=!1,this.isAnimationBlocked=!1,this.isLayoutDirty=!1,this.isProjectionDirty=!1,this.isSharedProjectionDirty=!1,this.isTransformDirty=!1,this.updateManuallyBlocked=!1,this.updateBlockedByResize=!1,this.isUpdating=!1,this.isSVG=!1,this.needsReset=!1,this.shouldResetTransform=!1,this.treeScale={x:1,y:1},this.eventHandlers=new Map,this.hasTreeAnimated=!1,this.updateScheduled=!1,this.checkUpdateFailed=()=>{this.isUpdating&&(this.isUpdating=!1,this.clearAllSnapshots())},this.updateProjection=()=>{Jo.totalNodes=Jo.resolvedTargetDeltas=Jo.recalculatedProjection=0,this.nodes.forEach(Dk),this.nodes.forEach(Vk),this.nodes.forEach(Hk),this.nodes.forEach(kk),Pk(Jo)},this.hasProjected=!1,this.isVisible=!0,this.animationProgress=0,this.sharedNodes=new Map,this.latestValues=l,this.root=u?u.root||u:this,this.path=u?[...u.path,u]:[],this.parent=u,this.depth=u?u.depth+1:0;for(let A=0;A<this.path.length;A++)this.path[A].shouldResetTransform=!0;this.root===this&&(this.nodes=new wk)}addEventListener(l,u){return this.eventHandlers.has(l)||this.eventHandlers.set(l,new Qf),this.eventHandlers.get(l).add(u)}notifyListeners(l,...u){const A=this.eventHandlers.get(l);A&&A.notify(...u)}hasListeners(l){return this.eventHandlers.has(l)}mount(l,u=this.root.hasTreeAnimated){if(this.instance)return;this.isSVG=Sk(l),this.instance=l;const{layoutId:A,layout:g,visualElement:p}=this.options;if(p&&!p.current&&p.mount(l),this.root.nodes.add(this),this.parent&&this.parent.children.add(this),u&&(g||A)&&(this.isLayoutDirty=!0),e){let C;const h=()=>this.root.updateBlockedByResize=!1;e(l,()=>{this.root.updateBlockedByResize=!0,C&&C(),C=Tk(h,250),sc.hasAnimatedSinceResize&&(sc.hasAnimatedSinceResize=!1,this.nodes.forEach(JE))})}A&&this.root.registerSharedNode(A,this),this.options.animate!==!1&&p&&(A||g)&&this.addEventListener("didUpdate",({delta:C,hasLayoutChanged:h,hasRelativeTargetChanged:m,layout:I})=>{if(this.isTreeAnimationBlocked()){this.target=void 0,this.relativeTarget=void 0;return}const B=this.options.transition||p.getDefaultTransition()||Gk,{onLayoutAnimationStart:v,onLayoutAnimationComplete:O}=p.getProps(),j=!this.targetLayout||!bv(this.targetLayout,I)||m,x=!h&&m;if(this.options.layoutRoot||this.resumeFrom&&this.resumeFrom.instance||x||h&&(j||!this.currentAnimation)){this.resumeFrom&&(this.resumingFrom=this.resumeFrom,this.resumingFrom.resumingFrom=void 0),this.setAnimationOrigin(C,x);const S={...cv(B,"layout"),onPlay:v,onComplete:O};(p.shouldReduceMotion||this.options.layoutRoot)&&(S.delay=0,S.type=!1),this.startAnimation(S)}else h||JE(this),this.isLead()&&this.options.onExitComplete&&this.options.onExitComplete();this.targetLayout=I})}unmount(){this.options.layoutId&&this.willUpdate(),this.root.nodes.remove(this);const l=this.getStack();l&&l.remove(this),this.parent&&this.parent.children.delete(this),this.instance=void 0,Jr(this.updateProjection)}blockUpdate(){this.updateManuallyBlocked=!0}unblockUpdate(){this.updateManuallyBlocked=!1}isUpdateBlocked(){return this.updateManuallyBlocked||this.updateBlockedByResize}isTreeAnimationBlocked(){return this.isAnimationBlocked||this.parent&&this.parent.isTreeAnimationBlocked()||!1}startUpdate(){this.isUpdateBlocked()||(this.isUpdating=!0,this.nodes&&this.nodes.forEach(Wk),this.animationId++)}getTransformTemplate(){const{visualElement:l}=this.options;return l&&l.getProps().transformTemplate}willUpdate(l=!0){if(this.root.hasTreeAnimated=!0,this.root.isUpdateBlocked()){this.options.onExitComplete&&this.options.onExitComplete();return}if(!this.root.isUpdating&&this.root.startUpdate(),this.isLayoutDirty)return;this.isLayoutDirty=!0;for(let p=0;p<this.path.length;p++){const C=this.path[p];C.shouldResetTransform=!0,C.updateScroll("snapshot"),C.options.layoutRoot&&C.willUpdate(!1)}const{layoutId:u,layout:A}=this.options;if(u===void 0&&!A)return;const g=this.getTransformTemplate();this.prevTransformTemplateValue=g?g(this.latestValues,""):void 0,this.updateSnapshot(),l&&this.notifyListeners("willUpdate")}update(){if(this.updateScheduled=!1,this.isUpdateBlocked()){this.unblockUpdate(),this.clearAllSnapshots(),this.nodes.forEach(qE);return}this.isUpdating||this.nodes.forEach(Lk),this.isUpdating=!1,this.nodes.forEach(Nk),this.nodes.forEach(jk),this.nodes.forEach(Mk),this.clearAllSnapshots();const u=performance.now();Xt.delta=Bo(0,1e3/60,u-Xt.timestamp),Xt.timestamp=u,Xt.isProcessing=!0,pd.update.process(Xt),pd.preRender.process(Xt),pd.render.process(Xt),Xt.isProcessing=!1}didUpdate(){this.updateScheduled||(this.updateScheduled=!0,queueMicrotask(()=>this.update()))}clearAllSnapshots(){this.nodes.forEach(Fk),this.sharedNodes.forEach(zk)}scheduleUpdateProjection(){vt.preRender(this.updateProjection,!1,!0)}scheduleCheckAfterUnmount(){vt.postRender(()=>{this.isLayoutDirty?this.root.didUpdate():this.root.checkUpdateFailed()})}updateSnapshot(){this.snapshot||!this.instance||(this.snapshot=this.measure())}updateLayout(){if(!this.instance||(this.updateScroll(),!(this.options.alwaysMeasureLayout&&this.isLead())&&!this.isLayoutDirty))return;if(this.resumeFrom&&!this.resumeFrom.instance)for(let A=0;A<this.path.length;A++)this.path[A].updateScroll();const l=this.layout;this.layout=this.measure(!1),this.layoutCorrected=zt(),this.isLayoutDirty=!1,this.projectionDelta=void 0,this.notifyListeners("measure",this.layout.layoutBox);const{visualElement:u}=this.options;u&&u.notify("LayoutMeasure",this.layout.layoutBox,l?l.layoutBox:void 0)}updateScroll(l="measure"){let u=!!(this.options.layoutScroll&&this.instance);this.scroll&&this.scroll.animationId===this.root.animationId&&this.scroll.phase===l&&(u=!1),u&&(this.scroll={animationId:this.root.animationId,phase:l,isRoot:r(this.instance),offset:n(this.instance)})}resetTransform(){if(!o)return;const l=this.isLayoutDirty||this.shouldResetTransform,u=this.projectionDelta&&!yv(this.projectionDelta),A=this.getTransformTemplate(),g=A?A(this.latestValues,""):void 0,p=g!==this.prevTransformTemplateValue;l&&(u||qo(this.latestValues)||p)&&(o(this.instance,g),this.shouldResetTransform=!1,this.scheduleRender())}measure(l=!0){const u=this.measurePageBox();let A=this.removeElementScroll(u);return l&&(A=this.removeTransform(A)),Kk(A),{animationId:this.root.animationId,measuredBox:u,layoutBox:A,latestValues:{},source:this.id}}measurePageBox(){const{visualElement:l}=this.options;if(!l)return zt();const u=l.measureViewportBox(),{scroll:A}=this.root;return A&&(go(u.x,A.offset.x),go(u.y,A.offset.y)),u}removeElementScroll(l){const u=zt();qn(u,l);for(let A=0;A<this.path.length;A++){const g=this.path[A],{scroll:p,options:C}=g;if(g!==this.root&&p&&C.layoutScroll){if(p.isRoot){qn(u,l);const{scroll:h}=this.root;h&&(go(u.x,-h.offset.x),go(u.y,-h.offset.y))}go(u.x,p.offset.x),go(u.y,p.offset.y)}}return u}applyTransform(l,u=!1){const A=zt();qn(A,l);for(let g=0;g<this.path.length;g++){const p=this.path[g];!u&&p.options.layoutScroll&&p.scroll&&p!==p.root&&Gi(A,{x:-p.scroll.offset.x,y:-p.scroll.offset.y}),qo(p.latestValues)&&Gi(A,p.latestValues)}return qo(this.latestValues)&&Gi(A,this.latestValues),A}removeTransform(l){const u=zt();qn(u,l);for(let A=0;A<this.path.length;A++){const g=this.path[A];if(!g.instance||!qo(g.latestValues))continue;cg(g.latestValues)&&g.updateSnapshot();const p=zt(),C=g.measurePageBox();qn(p,C),WE(u,g.latestValues,g.snapshot?g.snapshot.layoutBox:void 0,p)}return qo(this.latestValues)&&WE(u,this.latestValues),u}setTargetDelta(l){this.targetDelta=l,this.root.scheduleUpdateProjection(),this.isProjectionDirty=!0}setOptions(l){this.options={...this.options,...l,crossfade:l.crossfade!==void 0?l.crossfade:!0}}clearMeasurements(){this.scroll=void 0,this.layout=void 0,this.snapshot=void 0,this.prevTransformTemplateValue=void 0,this.targetDelta=void 0,this.target=void 0,this.isLayoutDirty=!1}forceRelativeParentToResolveTarget(){this.relativeParent&&this.relativeParent.resolvedRelativeTargetAt!==Xt.timestamp&&this.relativeParent.resolveTargetDelta(!0)}resolveTargetDelta(l=!1){var u;const A=this.getLead();this.isProjectionDirty||(this.isProjectionDirty=A.isProjectionDirty),this.isTransformDirty||(this.isTransformDirty=A.isTransformDirty),this.isSharedProjectionDirty||(this.isSharedProjectionDirty=A.isSharedProjectionDirty);const g=!!this.resumingFrom||this!==A;if(!(l||g&&this.isSharedProjectionDirty||this.isProjectionDirty||!((u=this.parent)===null||u===void 0)&&u.isProjectionDirty||this.attemptToResolveRelativeTarget))return;const{layout:C,layoutId:h}=this.options;if(!(!this.layout||!(C||h))){if(this.resolvedRelativeTargetAt=Xt.timestamp,!this.targetDelta&&!this.relativeTarget){const m=this.getClosestProjectingParent();m&&m.layout&&this.animationProgress!==1?(this.relativeParent=m,this.forceRelativeParentToResolveTarget(),this.relativeTarget=zt(),this.relativeTargetOrigin=zt(),ia(this.relativeTargetOrigin,this.layout.layoutBox,m.layout.layoutBox),qn(this.relativeTarget,this.relativeTargetOrigin)):this.relativeParent=this.relativeTarget=void 0}if(!(!this.relativeTarget&&!this.targetDelta)){if(this.target||(this.target=zt(),this.targetWithTransforms=zt()),this.relativeTarget&&this.relativeTargetOrigin&&this.relativeParent&&this.relativeParent.target?(this.forceRelativeParentToResolveTarget(),JD(this.target,this.relativeTarget,this.relativeParent.target)):this.targetDelta?(this.resumingFrom?this.target=this.applyTransform(this.layout.layoutBox):qn(this.target,this.layout.layoutBox),mv(this.target,this.targetDelta)):qn(this.target,this.layout.layoutBox),this.attemptToResolveRelativeTarget){this.attemptToResolveRelativeTarget=!1;const m=this.getClosestProjectingParent();m&&!!m.resumingFrom==!!this.resumingFrom&&!m.options.layoutScroll&&m.target&&this.animationProgress!==1?(this.relativeParent=m,this.forceRelativeParentToResolveTarget(),this.relativeTarget=zt(),this.relativeTargetOrigin=zt(),ia(this.relativeTargetOrigin,this.target,m.target),qn(this.relativeTarget,this.relativeTargetOrigin)):this.relativeParent=this.relativeTarget=void 0}Jo.resolvedTargetDeltas++}}}getClosestProjectingParent(){if(!(!this.parent||cg(this.parent.latestValues)||Cv(this.parent.latestValues)))return this.parent.isProjecting()?this.parent:this.parent.getClosestProjectingParent()}isProjecting(){return!!((this.relativeTarget||this.targetDelta||this.options.layoutRoot)&&this.layout)}calcProjection(){var l;const u=this.getLead(),A=!!this.resumingFrom||this!==u;let g=!0;if((this.isProjectionDirty||!((l=this.parent)===null||l===void 0)&&l.isProjectionDirty)&&(g=!1),A&&(this.isSharedProjectionDirty||this.isTransformDirty)&&(g=!1),this.resolvedRelativeTargetAt===Xt.timestamp&&(g=!1),g)return;const{layout:p,layoutId:C}=this.options;if(this.isTreeAnimating=!!(this.parent&&this.parent.isTreeAnimating||this.currentAnimation||this.pendingAnimation),this.isTreeAnimating||(this.targetDelta=this.relativeTarget=void 0),!this.layout||!(p||C))return;qn(this.layoutCorrected,this.layout.layoutBox);const h=this.treeScale.x,m=this.treeScale.y;ok(this.layoutCorrected,this.treeScale,this.path,A),u.layout&&!u.target&&(this.treeScale.x!==1||this.treeScale.y!==1)&&(u.target=u.layout.layoutBox);const{target:I}=u;if(!I){this.projectionTransform&&(this.projectionDelta=Yi(),this.projectionTransform="none",this.scheduleRender());return}this.projectionDelta||(this.projectionDelta=Yi(),this.projectionDeltaWithTransform=Yi());const B=this.projectionTransform;oa(this.projectionDelta,this.layoutCorrected,I,this.latestValues),this.projectionTransform=YE(this.projectionDelta,this.treeScale),(this.projectionTransform!==B||this.treeScale.x!==h||this.treeScale.y!==m)&&(this.hasProjected=!0,this.scheduleRender(),this.notifyListeners("projectionUpdate",I)),Jo.recalculatedProjection++}hide(){this.isVisible=!1}show(){this.isVisible=!0}scheduleRender(l=!0){if(this.options.scheduleRender&&this.options.scheduleRender(),l){const u=this.getStack();u&&u.scheduleRender()}this.resumingFrom&&!this.resumingFrom.instance&&(this.resumingFrom=void 0)}setAnimationOrigin(l,u=!1){const A=this.snapshot,g=A?A.latestValues:{},p={...this.latestValues},C=Yi();(!this.relativeParent||!this.relativeParent.options.layoutRoot)&&(this.relativeTarget=this.relativeTargetOrigin=void 0),this.attemptToResolveRelativeTarget=!u;const h=zt(),m=A?A.source:void 0,I=this.layout?this.layout.source:void 0,B=m!==I,v=this.getStack(),O=!v||v.members.length<=1,j=!!(B&&!O&&this.options.crossfade===!0&&!this.path.some(Yk));this.animationProgress=0;let x;this.mixTargetDelta=S=>{const P=S/1e3;XE(C.x,l.x,P),XE(C.y,l.y,P),this.setTargetDelta(C),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&this.relativeParent&&this.relativeParent.layout&&(ia(h,this.layout.layoutBox,this.relativeParent.layout.layoutBox),Uk(this.relativeTarget,this.relativeTargetOrigin,h,P),x&&bk(this.relativeTarget,x)&&(this.isProjectionDirty=!1),x||(x=zt()),qn(x,this.relativeTarget)),B&&(this.animationValues=p,mk(p,g,this.latestValues,P,j,O)),this.root.scheduleUpdateProjection(),this.scheduleRender(),this.animationProgress=P},this.mixTargetDelta(this.options.layoutRoot?1e3:0)}startAnimation(l){this.notifyListeners("animationStart"),this.currentAnimation&&this.currentAnimation.stop(),this.resumingFrom&&this.resumingFrom.currentAnimation&&this.resumingFrom.currentAnimation.stop(),this.pendingAnimation&&(Jr(this.pendingAnimation),this.pendingAnimation=void 0),this.pendingAnimation=vt.update(()=>{sc.hasAnimatedSinceResize=!0,this.currentAnimation=Rk(0,KE,{...l,onUpdate:u=>{this.mixTargetDelta(u),l.onUpdate&&l.onUpdate(u)},onComplete:()=>{l.onComplete&&l.onComplete(),this.completeAnimation()}}),this.resumingFrom&&(this.resumingFrom.currentAnimation=this.currentAnimation),this.pendingAnimation=void 0})}completeAnimation(){this.resumingFrom&&(this.resumingFrom.currentAnimation=void 0,this.resumingFrom.preserveOpacity=void 0);const l=this.getStack();l&&l.exitAnimationComplete(),this.resumingFrom=this.currentAnimation=this.animationValues=void 0,this.notifyListeners("animationComplete")}finishAnimation(){this.currentAnimation&&(this.mixTargetDelta&&this.mixTargetDelta(KE),this.currentAnimation.stop()),this.completeAnimation()}applyTransformsToTarget(){const l=this.getLead();let{targetWithTransforms:u,target:A,layout:g,latestValues:p}=l;if(!(!u||!A||!g)){if(this!==l&&this.layout&&g&&xv(this.options.animationType,this.layout.layoutBox,g.layoutBox)){A=this.target||zt();const C=kn(this.layout.layoutBox.x);A.x.min=l.target.x.min,A.x.max=A.x.min+C;const h=kn(this.layout.layoutBox.y);A.y.min=l.target.y.min,A.y.max=A.y.min+h}qn(u,A),Gi(u,p),oa(this.projectionDeltaWithTransform,this.layoutCorrected,u,p)}}registerSharedNode(l,u){this.sharedNodes.has(l)||this.sharedNodes.set(l,new Qk),this.sharedNodes.get(l).add(u);const g=u.options.initialPromotionConfig;u.promote({transition:g?g.transition:void 0,preserveFollowOpacity:g&&g.shouldPreserveFollowOpacity?g.shouldPreserveFollowOpacity(u):void 0})}isLead(){const l=this.getStack();return l?l.lead===this:!0}getLead(){var l;const{layoutId:u}=this.options;return u?((l=this.getStack())===null||l===void 0?void 0:l.lead)||this:this}getPrevLead(){var l;const{layoutId:u}=this.options;return u?(l=this.getStack())===null||l===void 0?void 0:l.prevLead:void 0}getStack(){const{layoutId:l}=this.options;if(l)return this.root.sharedNodes.get(l)}promote({needsReset:l,transition:u,preserveFollowOpacity:A}={}){const g=this.getStack();g&&g.promote(this,A),l&&(this.projectionDelta=void 0,this.needsReset=!0),u&&this.setOptions({transition:u})}relegate(){const l=this.getStack();return l?l.relegate(this):!1}resetRotation(){const{visualElement:l}=this.options;if(!l)return;let u=!1;const{latestValues:A}=l;if((A.rotate||A.rotateX||A.rotateY||A.rotateZ)&&(u=!0),!u)return;const g={};for(let p=0;p<GE.length;p++){const C="rotate"+GE[p];A[C]&&(g[C]=A[C],l.setStaticValue(C,0))}l.render();for(const p in g)l.setStaticValue(p,g[p]);l.scheduleRender()}getProjectionStyles(l={}){var u,A;const g={};if(!this.instance||this.isSVG)return g;if(this.isVisible)g.visibility="";else return{visibility:"hidden"};const p=this.getTransformTemplate();if(this.needsReset)return this.needsReset=!1,g.opacity="",g.pointerEvents=ic(l.pointerEvents)||"",g.transform=p?p(this.latestValues,""):"none",g;const C=this.getLead();if(!this.projectionDelta||!this.layout||!C.target){const B={};return this.options.layoutId&&(B.opacity=this.latestValues.opacity!==void 0?this.latestValues.opacity:1,B.pointerEvents=ic(l.pointerEvents)||""),this.hasProjected&&!qo(this.latestValues)&&(B.transform=p?p({},""):"none",this.hasProjected=!1),B}const h=C.animationValues||C.latestValues;this.applyTransformsToTarget(),g.transform=YE(this.projectionDeltaWithTransform,this.treeScale,h),p&&(g.transform=p(h,g.transform));const{x:m,y:I}=this.projectionDelta;g.transformOrigin=`${m.origin*100}% ${I.origin*100}% 0`,C.animationValues?g.opacity=C===this?(A=(u=h.opacity)!==null&&u!==void 0?u:this.latestValues.opacity)!==null&&A!==void 0?A:1:this.preserveOpacity?this.latestValues.opacity:h.opacityExit:g.opacity=C===this?h.opacity!==void 0?h.opacity:"":h.opacityExit!==void 0?h.opacityExit:0;for(const B in vc){if(h[B]===void 0)continue;const{correct:v,applyTo:O}=vc[B],j=g.transform==="none"?h[B]:v(h[B],C);if(O){const x=O.length;for(let S=0;S<x;S++)g[O[S]]=j}else g[B]=j}return this.options.layoutId&&(g.pointerEvents=C===this?ic(l.pointerEvents)||"":"none"),g}clearSnapshot(){this.resumeFrom=this.snapshot=void 0}resetTree(){this.root.nodes.forEach(l=>{var u;return(u=l.currentAnimation)===null||u===void 0?void 0:u.stop()}),this.root.nodes.forEach(qE),this.root.sharedNodes.clear()}}}function jk(e){e.updateLayout()}function Mk(e){var t;const n=((t=e.resumeFrom)===null||t===void 0?void 0:t.snapshot)||e.snapshot;if(e.isLead()&&e.layout&&n&&e.hasListeners("didUpdate")){const{layoutBox:r,measuredBox:o}=e.layout,{animationType:s}=e.options,l=n.source!==e.layout.source;s==="size"?Br(C=>{const h=l?n.measuredBox[C]:n.layoutBox[C],m=kn(h);h.min=r[C].min,h.max=h.min+m}):xv(s,n.layoutBox,r)&&Br(C=>{const h=l?n.measuredBox[C]:n.layoutBox[C],m=kn(r[C]);h.max=h.min+m,e.relativeTarget&&!e.currentAnimation&&(e.isProjectionDirty=!0,e.relativeTarget[C].max=e.relativeTarget[C].min+m)});const u=Yi();oa(u,r,n.layoutBox);const A=Yi();l?oa(A,e.applyTransform(o,!0),n.measuredBox):oa(A,r,n.layoutBox);const g=!yv(u);let p=!1;if(!e.resumeFrom){const C=e.getClosestProjectingParent();if(C&&!C.resumeFrom){const{snapshot:h,layout:m}=C;if(h&&m){const I=zt();ia(I,n.layoutBox,h.layoutBox);const B=zt();ia(B,r,m.layoutBox),bv(I,B)||(p=!0),C.options.layoutRoot&&(e.relativeTarget=B,e.relativeTargetOrigin=I,e.relativeParent=C)}}}e.notifyListeners("didUpdate",{layout:r,snapshot:n,delta:A,layoutDelta:u,hasLayoutChanged:g,hasRelativeTargetChanged:p})}else if(e.isLead()){const{onExitComplete:r}=e.options;r&&r()}e.options.transition=void 0}function Dk(e){Jo.totalNodes++,e.parent&&(e.isProjecting()||(e.isProjectionDirty=e.parent.isProjectionDirty),e.isSharedProjectionDirty||(e.isSharedProjectionDirty=!!(e.isProjectionDirty||e.parent.isProjectionDirty||e.parent.isSharedProjectionDirty)),e.isTransformDirty||(e.isTransformDirty=e.parent.isTransformDirty))}function kk(e){e.isProjectionDirty=e.isSharedProjectionDirty=e.isTransformDirty=!1}function Fk(e){e.clearSnapshot()}function qE(e){e.clearMeasurements()}function Lk(e){e.isLayoutDirty=!1}function Nk(e){const{visualElement:t}=e.options;t&&t.getProps().onBeforeLayoutMeasure&&t.notify("BeforeLayoutMeasure"),e.resetTransform()}function JE(e){e.finishAnimation(),e.targetDelta=e.relativeTarget=e.target=void 0,e.isProjectionDirty=!0}function Vk(e){e.resolveTargetDelta()}function Hk(e){e.calcProjection()}function Wk(e){e.resetRotation()}function zk(e){e.removeLeadSnapshot()}function XE(e,t,n){e.translate=St(t.translate,0,n),e.scale=St(t.scale,1,n),e.origin=t.origin,e.originPoint=t.originPoint}function ZE(e,t,n,r){e.min=St(t.min,n.min,r),e.max=St(t.max,n.max,r)}function Uk(e,t,n,r){ZE(e.x,t.x,n.x,r),ZE(e.y,t.y,n.y,r)}function Yk(e){return e.animationValues&&e.animationValues.opacityExit!==void 0}const Gk={duration:.45,ease:[.4,0,.1,1]},_E=e=>typeof navigator<"u"&&navigator.userAgent.toLowerCase().includes(e),$E=_E("applewebkit/")&&!_E("chrome/")?Math.round:Dt;function eI(e){e.min=$E(e.min),e.max=$E(e.max)}function Kk(e){eI(e.x),eI(e.y)}function xv(e,t,n){return e==="position"||e==="preserve-aspect"&&!ag(UE(t),UE(n),.2)}const qk=Qv({attachResizeListener:(e,t)=>Ur(e,"resize",t),measureScroll:()=>({x:document.documentElement.scrollLeft||document.body.scrollLeft,y:document.documentElement.scrollTop||document.body.scrollTop}),checkIsScrollRoot:()=>!0}),xd={current:void 0},wv=Qv({measureScroll:e=>({x:e.scrollLeft,y:e.scrollTop}),defaultParent:()=>{if(!xd.current){const e=new qk({});e.mount(window),e.setOptions({layoutScroll:!0}),xd.current=e}return xd.current},resetTransform:(e,t)=>{e.style.transform=t!==void 0?t:"none"},checkIsScrollRoot:e=>window.getComputedStyle(e).position==="fixed"}),Jk={pan:{Feature:dk},drag:{Feature:Ak,ProjectionNode:wv,MeasureLayout:Iv}},Xk=/var\((--[a-zA-Z0-9-_]+),? ?([a-zA-Z0-9 ()%#.,-]+)?\)/;function Zk(e){const t=Xk.exec(e);if(!t)return[,];const[,n,r]=t;return[n,r]}const _k=4;function Ag(e,t,n=1){xr(n<=_k,`Max CSS variable fallback depth detected in property "${e}". This may indicate a circular fallback dependency.`);const[r,o]=Zk(e);if(!r)return;const s=window.getComputedStyle(t).getPropertyValue(r);if(s){const l=s.trim();return uv(l)?parseFloat(l):l}else return eg(o)?Ag(o,t,n+1):o}function $k(e,{...t},n){const r=e.current;if(!(r instanceof Element))return{target:t,transitionEnd:n};n&&(n={...n}),e.values.forEach(o=>{const s=o.get();if(!eg(s))return;const l=Ag(s,r);l&&o.set(l)});for(const o in t){const s=t[o];if(!eg(s))continue;const l=Ag(s,r);l&&(t[o]=l,n||(n={}),n[o]===void 0&&(n[o]=s))}return{target:t,transitionEnd:n}}const e5=new Set(["width","height","top","left","right","bottom","x","y","translateX","translateY"]),Tv=e=>e5.has(e),t5=e=>Object.keys(e).some(Tv),Yl=e=>e===Ai||e===Me,tI=(e,t)=>parseFloat(e.split(", ")[t]),nI=(e,t)=>(n,{transform:r})=>{if(r==="none"||!r)return 0;const o=r.match(/^matrix3d\((.+)\)$/);if(o)return tI(o[1],t);{const s=r.match(/^matrix\((.+)\)$/);return s?tI(s[1],e):0}},n5=new Set(["x","y","z"]),r5=Pa.filter(e=>!n5.has(e));function o5(e){const t=[];return r5.forEach(n=>{const r=e.getValue(n);r!==void 0&&(t.push([n,r.get()]),r.set(n.startsWith("scale")?1:0))}),t.length&&e.render(),t}const os={width:({x:e},{paddingLeft:t="0",paddingRight:n="0"})=>e.max-e.min-parseFloat(t)-parseFloat(n),height:({y:e},{paddingTop:t="0",paddingBottom:n="0"})=>e.max-e.min-parseFloat(t)-parseFloat(n),top:(e,{top:t})=>parseFloat(t),left:(e,{left:t})=>parseFloat(t),bottom:({y:e},{top:t})=>parseFloat(t)+(e.max-e.min),right:({x:e},{left:t})=>parseFloat(t)+(e.max-e.min),x:nI(4,13),y:nI(5,14)};os.translateX=os.x;os.translateY=os.y;const i5=(e,t,n)=>{const r=t.measureViewportBox(),o=t.current,s=getComputedStyle(o),{display:l}=s,u={};l==="none"&&t.setStaticValue("display",e.display||"block"),n.forEach(g=>{u[g]=os[g](r,s)}),t.render();const A=t.measureViewportBox();return n.forEach(g=>{const p=t.getValue(g);p&&p.jump(u[g]),e[g]=os[g](A,s)}),e},s5=(e,t,n={},r={})=>{t={...t},r={...r};const o=Object.keys(t).filter(Tv);let s=[],l=!1;const u=[];if(o.forEach(A=>{const g=e.getValue(A);if(!e.hasValue(A))return;let p=n[A],C=Us(p);const h=t[A];let m;if(bc(h)){const I=h.length,B=h[0]===null?1:0;p=h[B],C=Us(p);for(let v=B;v<I&&h[v]!==null;v++)m?xr(Us(h[v])===m,"All keyframes must be of the same type"):(m=Us(h[v]),xr(m===C||Yl(C)&&Yl(m),"Keyframes must be of the same dimension as the current value"))}else m=Us(h);if(C!==m)if(Yl(C)&&Yl(m)){const I=g.get();typeof I=="string"&&g.set(parseFloat(I)),typeof h=="string"?t[A]=parseFloat(h):Array.isArray(h)&&m===Me&&(t[A]=h.map(parseFloat))}else C!=null&&C.transform&&(m!=null&&m.transform)&&(p===0||h===0)?p===0?g.set(m.transform(p)):t[A]=C.transform(h):(l||(s=o5(e),l=!0),u.push(A),r[A]=r[A]!==void 0?r[A]:t[A],g.jump(h))}),u.length){const A=u.indexOf("height")>=0?window.pageYOffset:null,g=i5(t,e,u);return s.length&&s.forEach(([p,C])=>{e.getValue(p).set(C)}),e.render(),su&&A!==null&&window.scrollTo({top:A}),{target:g,transitionEnd:r}}else return{target:t,transitionEnd:r}};function a5(e,t,n,r){return t5(t)?s5(e,t,n,r):{target:t,transitionEnd:r}}const l5=(e,t,n,r)=>{const o=$k(e,t,r);return t=o.target,r=o.transitionEnd,a5(e,t,n,r)},dg={current:null},Pv={current:!1};function c5(){if(Pv.current=!0,!!su)if(window.matchMedia){const e=window.matchMedia("(prefers-reduced-motion)"),t=()=>dg.current=e.matches;e.addListener(t),t()}else dg.current=!1}function u5(e,t,n){const{willChange:r}=t;for(const o in t){const s=t[o],l=n[o];if(vn(s))e.addValue(o,s),Tc(r)&&r.add(o),process.env.NODE_ENV==="development"&&xf(s.version==="10.16.4",`Attempting to mix Framer Motion versions ${s.version} with 10.16.4 may not work as expected.`);else if(vn(l))e.addValue(o,rs(s,{owner:e})),Tc(r)&&r.remove(o);else if(l!==s)if(e.hasValue(o)){const u=e.getValue(o);!u.hasAnimated&&u.set(s)}else{const u=e.getStaticValue(o);e.addValue(o,rs(u!==void 0?u:s,{owner:e}))}}for(const o in n)t[o]===void 0&&e.removeValue(o);return t}const rI=new WeakMap,Sv=Object.keys(pa),A5=Sv.length,oI=["AnimationStart","AnimationComplete","Update","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"],d5=cf.length;class g5{constructor({parent:t,props:n,presenceContext:r,reducedMotionConfig:o,visualState:s},l={}){this.current=null,this.children=new Set,this.isVariantNode=!1,this.isControllingVariants=!1,this.shouldReduceMotion=null,this.values=new Map,this.features={},this.valueSubscriptions=new Map,this.prevMotionValues={},this.events={},this.propEventSubscriptions={},this.notifyUpdate=()=>this.notify("Update",this.latestValues),this.render=()=>{this.current&&(this.triggerBuild(),this.renderInstance(this.current,this.renderState,this.props.style,this.projection))},this.scheduleRender=()=>vt.render(this.render,!1,!0);const{latestValues:u,renderState:A}=s;this.latestValues=u,this.baseTarget={...u},this.initialValues=n.initial?{...u}:{},this.renderState=A,this.parent=t,this.props=n,this.presenceContext=r,this.depth=t?t.depth+1:0,this.reducedMotionConfig=o,this.options=l,this.isControllingVariants=lu(n),this.isVariantNode=fB(n),this.isVariantNode&&(this.variantChildren=new Set),this.manuallyAnimateOnMount=!!(t&&t.current);const{willChange:g,...p}=this.scrapeMotionValuesFromProps(n,{});for(const C in p){const h=p[C];u[C]!==void 0&&vn(h)&&(h.set(u[C],!1),Tc(g)&&g.add(C))}}scrapeMotionValuesFromProps(t,n){return{}}mount(t){this.current=t,rI.set(t,this),this.projection&&!this.projection.instance&&this.projection.mount(t),this.parent&&this.isVariantNode&&!this.isControllingVariants&&(this.removeFromVariantTree=this.parent.addVariantChild(this)),this.values.forEach((n,r)=>this.bindToMotionValue(r,n)),Pv.current||c5(),this.shouldReduceMotion=this.reducedMotionConfig==="never"?!1:this.reducedMotionConfig==="always"?!0:dg.current,process.env.NODE_ENV!=="production"&&xf(this.shouldReduceMotion!==!0,"You have Reduced Motion enabled on your device. Animations may not appear as expected."),this.parent&&this.parent.children.add(this),this.update(this.props,this.presenceContext)}unmount(){rI.delete(this.current),this.projection&&this.projection.unmount(),Jr(this.notifyUpdate),Jr(this.render),this.valueSubscriptions.forEach(t=>t()),this.removeFromVariantTree&&this.removeFromVariantTree(),this.parent&&this.parent.children.delete(this);for(const t in this.events)this.events[t].clear();for(const t in this.features)this.features[t].unmount();this.current=null}bindToMotionValue(t,n){const r=ui.has(t),o=n.on("change",l=>{this.latestValues[t]=l,this.props.onUpdate&&vt.update(this.notifyUpdate,!1,!0),r&&this.projection&&(this.projection.isTransformDirty=!0)}),s=n.on("renderRequest",this.scheduleRender);this.valueSubscriptions.set(t,()=>{o(),s()})}sortNodePosition(t){return!this.current||!this.sortInstanceNodePosition||this.type!==t.type?0:this.sortInstanceNodePosition(this.current,t.current)}loadFeatures({children:t,...n},r,o,s){let l,u;if(process.env.NODE_ENV!=="production"&&o&&r){const A="You have rendered a `motion` component within a `LazyMotion` component. This will break tree shaking. Import and render a `m` component instead.";n.ignoreStrict?Oa(!1,A):xr(!1,A)}for(let A=0;A<A5;A++){const g=Sv[A],{isEnabled:p,Feature:C,ProjectionNode:h,MeasureLayout:m}=pa[g];h&&(l=h),p(n)&&(!this.features[g]&&C&&(this.features[g]=new C(this)),m&&(u=m))}if(!this.projection&&l){this.projection=new l(this.latestValues,this.parent&&this.parent.projection);const{layoutId:A,layout:g,drag:p,dragConstraints:C,layoutScroll:h,layoutRoot:m}=n;this.projection.setOptions({layoutId:A,layout:g,alwaysMeasureLayout:!!p||C&&zi(C),visualElement:this,scheduleRender:()=>this.scheduleRender(),animationType:typeof g=="string"?g:"both",initialPromotionConfig:s,layoutScroll:h,layoutRoot:m})}return u}updateFeatures(){for(const t in this.features){const n=this.features[t];n.isMounted?n.update():(n.mount(),n.isMounted=!0)}}triggerBuild(){this.build(this.renderState,this.latestValues,this.options,this.props)}measureViewportBox(){return this.current?this.measureInstanceViewportBox(this.current,this.props):zt()}getStaticValue(t){return this.latestValues[t]}setStaticValue(t,n){this.latestValues[t]=n}makeTargetAnimatable(t,n=!0){return this.makeTargetAnimatableFromInstance(t,this.props,n)}update(t,n){(t.transformTemplate||this.props.transformTemplate)&&this.scheduleRender(),this.prevProps=this.props,this.props=t,this.prevPresenceContext=this.presenceContext,this.presenceContext=n;for(let r=0;r<oI.length;r++){const o=oI[r];this.propEventSubscriptions[o]&&(this.propEventSubscriptions[o](),delete this.propEventSubscriptions[o]);const s=t["on"+o];s&&(this.propEventSubscriptions[o]=this.on(o,s))}this.prevMotionValues=u5(this,this.scrapeMotionValuesFromProps(t,this.prevProps),this.prevMotionValues),this.handleChildMotionValue&&this.handleChildMotionValue()}getProps(){return this.props}getVariant(t){return this.props.variants?this.props.variants[t]:void 0}getDefaultTransition(){return this.props.transition}getTransformPagePoint(){return this.props.transformPagePoint}getClosestVariantNode(){return this.isVariantNode?this:this.parent?this.parent.getClosestVariantNode():void 0}getVariantContext(t=!1){if(t)return this.parent?this.parent.getVariantContext():void 0;if(!this.isControllingVariants){const r=this.parent?this.parent.getVariantContext()||{}:{};return this.props.initial!==void 0&&(r.initial=this.props.initial),r}const n={};for(let r=0;r<d5;r++){const o=cf[r],s=this.props[o];(fa(s)||s===!1)&&(n[o]=s)}return n}addVariantChild(t){const n=this.getClosestVariantNode();if(n)return n.variantChildren&&n.variantChildren.add(t),()=>n.variantChildren.delete(t)}addValue(t,n){n!==this.values.get(t)&&(this.removeValue(t),this.bindToMotionValue(t,n)),this.values.set(t,n),this.latestValues[t]=n.get()}removeValue(t){this.values.delete(t);const n=this.valueSubscriptions.get(t);n&&(n(),this.valueSubscriptions.delete(t)),delete this.latestValues[t],this.removeValueFromRenderState(t,this.renderState)}hasValue(t){return this.values.has(t)}getValue(t,n){if(this.props.values&&this.props.values[t])return this.props.values[t];let r=this.values.get(t);return r===void 0&&n!==void 0&&(r=rs(n,{owner:this}),this.addValue(t,r)),r}readValue(t){var n;return this.latestValues[t]!==void 0||!this.current?this.latestValues[t]:(n=this.getBaseTargetFromProps(this.props,t))!==null&&n!==void 0?n:this.readValueFromInstance(this.current,t,this.options)}setBaseTarget(t,n){this.baseTarget[t]=n}getBaseTarget(t){var n;const{initial:r}=this.props,o=typeof r=="string"||typeof r=="object"?(n=Cf(this.props,r))===null||n===void 0?void 0:n[t]:void 0;if(r&&o!==void 0)return o;const s=this.getBaseTargetFromProps(this.props,t);return s!==void 0&&!vn(s)?s:this.initialValues[t]!==void 0&&o===void 0?void 0:this.baseTarget[t]}on(t,n){return this.events[t]||(this.events[t]=new Qf),this.events[t].add(n)}notify(t,...n){this.events[t]&&this.events[t].notify(...n)}}class Rv extends g5{sortInstanceNodePosition(t,n){return t.compareDocumentPosition(n)&2?1:-1}getBaseTargetFromProps(t,n){return t.style?t.style[n]:void 0}removeValueFromRenderState(t,{vars:n,style:r}){delete n[t],delete r[t]}makeTargetAnimatableFromInstance({transition:t,transitionEnd:n,...r},{transformValues:o},s){let l=RD(r,t||{},this);if(o&&(n&&(n=o(n)),r&&(r=o(r)),l&&(l=o(l))),s){PD(this,r,l);const u=l5(this,r,l,n);n=u.transitionEnd,r=u.target}return{transition:t,transitionEnd:n,...r}}}function f5(e){return window.getComputedStyle(e)}class p5 extends Rv{readValueFromInstance(t,n){if(ui.has(n)){const r=Bf(n);return r&&r.default||0}else{const r=f5(t),o=(EB(n)?r.getPropertyValue(n):r[n])||0;return typeof o=="string"?o.trim():o}}measureInstanceViewportBox(t,{transformPagePoint:n}){return Ev(t,n)}build(t,n,r,o){Af(t,n,r,o.transformTemplate)}scrapeMotionValuesFromProps(t,n){return hf(t,n)}handleChildMotionValue(){this.childSubscription&&(this.childSubscription(),delete this.childSubscription);const{children:t}=this.props;vn(t)&&(this.childSubscription=t.on("change",n=>{this.current&&(this.current.textContent=`${n}`)}))}renderInstance(t,n,r,o){QB(t,n,r,o)}}class h5 extends Rv{constructor(){super(...arguments),this.isSVGTag=!1}getBaseTargetFromProps(t,n){return t[n]}readValueFromInstance(t,n){if(ui.has(n)){const r=Bf(n);return r&&r.default||0}return n=xB.has(n)?n:pf(n),t.getAttribute(n)}measureInstanceViewportBox(){return zt()}scrapeMotionValuesFromProps(t,n){return TB(t,n)}build(t,n,r,o){gf(t,n,r,this.isSVGTag,o.transformTemplate)}renderInstance(t,n,r,o){wB(t,n,r,o)}mount(t){this.isSVGTag=ff(t.tagName),super.mount(t)}}const C5=(e,t)=>uf(e)?new h5(t,{enableHardwareAcceleration:!1}):new p5(t,{enableHardwareAcceleration:!0}),m5={layout:{ProjectionNode:wv,MeasureLayout:Iv}},E5={...YD,...g3,...Jk,...m5},Gl=BM((e,t)=>e3(e,t,E5,C5)),I5=(e,t,n)=>{const r=t-e;return((n-e)%r+r)%r+e};function iI(...e){const t=w.useRef(0),[n,r]=w.useState(e[t.current]),o=w.useCallback(s=>{t.current=typeof s!="number"?I5(0,e.length,t.current+1):s,r(e[t.current])},[e.length,...e]);return[n,o]}function Ov({children:e,type:t="scale",direction:n="right",offset:r=10,scale:o={hover:1.05,tap:.95}}){let s,l;switch(n){case"up":case"left":s=r,l=0;break;case"right":case"down":default:s=0,l=r;break}const[u,A]=iI(s,l),[g,p]=iI(s,l);switch(t){case"rotate":return f.jsx(Gl.div,{animate:{rotate:360},transition:{repeat:1/0,repeatType:"loop",duration:2,repeatDelay:0},children:e});case"slide":return n==="up"||n==="down"?f.jsx(Gl.div,{animate:{y:g!==void 0?g:""},onHoverEnd:()=>p(),onHoverStart:()=>p(),children:e}):f.jsx(Gl.div,{animate:{x:u!==void 0?u:""},onHoverEnd:()=>A(),onHoverStart:()=>A(),children:e});case"scale":default:return typeof o=="number"&&(o={hover:o,tap:o}),f.jsx(Gl.div,{whileHover:{scale:o==null?void 0:o.hover},whileTap:{scale:o==null?void 0:o.tap},children:e})}}Ov.propTypes={children:c.node,offset:c.number,type:c.oneOf(["slide","scale","rotate"]),direction:c.oneOf(["up","down","left","right"]),scale:c.oneOfType([c.number,c.object])};function B5(e){return Nt("MuiSvgIcon",e)}Ut("MuiSvgIcon",["root","colorPrimary","colorSecondary","colorAction","colorError","colorDisabled","fontSizeInherit","fontSizeSmall","fontSizeMedium","fontSizeLarge"]);const v5=["children","className","color","component","fontSize","htmlColor","inheritViewBox","titleAccess","viewBox"],y5=e=>{const{color:t,fontSize:n,classes:r}=e,o={root:["root",t!=="inherit"&&`color${Pe(t)}`,`fontSize${Pe(n)}`]};return sn(o,B5,r)},b5=ue("svg",{name:"MuiSvgIcon",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.root,n.color!=="inherit"&&t[`color${Pe(n.color)}`],t[`fontSize${Pe(n.fontSize)}`]]}})(({theme:e,ownerState:t})=>{var n,r,o,s,l,u,A,g,p,C,h,m,I;return{userSelect:"none",width:"1em",height:"1em",display:"inline-block",fill:t.hasSvgAsChild?void 0:"currentColor",flexShrink:0,transition:(n=e.transitions)==null||(r=n.create)==null?void 0:r.call(n,"fill",{duration:(o=e.transitions)==null||(o=o.duration)==null?void 0:o.shorter}),fontSize:{inherit:"inherit",small:((s=e.typography)==null||(l=s.pxToRem)==null?void 0:l.call(s,20))||"1.25rem",medium:((u=e.typography)==null||(A=u.pxToRem)==null?void 0:A.call(u,24))||"1.5rem",large:((g=e.typography)==null||(p=g.pxToRem)==null?void 0:p.call(g,35))||"2.1875rem"}[t.fontSize],color:(C=(h=(e.vars||e).palette)==null||(h=h[t.color])==null?void 0:h.main)!=null?C:{action:(m=(e.vars||e).palette)==null||(m=m.action)==null?void 0:m.active,disabled:(I=(e.vars||e).palette)==null||(I=I.action)==null?void 0:I.disabled,inherit:void 0}[t.color]}}),wf=D.forwardRef(function(t,n){const r=Yt({props:t,name:"MuiSvgIcon"}),{children:o,className:s,color:l="inherit",component:u="svg",fontSize:A="medium",htmlColor:g,inheritViewBox:p=!1,titleAccess:C,viewBox:h="0 0 24 24"}=r,m=Ke(r,v5),I=D.isValidElement(o)&&o.type==="svg",B=W({},r,{color:l,component:u,fontSize:A,instanceFontSize:t.fontSize,inheritViewBox:p,viewBox:h,hasSvgAsChild:I}),v={};p||(v.viewBox=h);const O=y5(B);return f.jsxs(b5,W({as:u,className:Ge(O.root,s),focusable:"false",color:g,"aria-hidden":C?void 0:!0,role:C?"img":void 0,ref:n},v,m,I&&o.props,{ownerState:B,children:[I?o.props.children:o,C?f.jsx("title",{children:C}):null]}))});process.env.NODE_ENV!=="production"&&(wf.propTypes={children:c.node,classes:c.object,className:c.string,color:c.oneOfType([c.oneOf(["inherit","action","disabled","primary","secondary","error","info","success","warning"]),c.string]),component:c.elementType,fontSize:c.oneOfType([c.oneOf(["inherit","large","medium","small"]),c.string]),htmlColor:c.string,inheritViewBox:c.bool,shapeRendering:c.string,sx:c.oneOfType([c.arrayOf(c.oneOfType([c.func,c.object,c.bool])),c.func,c.object]),titleAccess:c.string,viewBox:c.string});wf.muiName="SvgIcon";const sI=wf;function Tf(e,t){function n(r,o){return f.jsx(sI,W({"data-testid":`${t}Icon`,ref:o},r,{children:e}))}return process.env.NODE_ENV!=="production"&&(n.displayName=`${t}Icon`),n.muiName=sI.muiName,D.memo(D.forwardRef(n))}const Q5=Tf(f.jsx("path",{d:"M12 12c2.21 0 4-1.79 4-4s-1.79-4-4-4-4 1.79-4 4 1.79 4 4 4zm0 2c-2.67 0-8 1.34-8 4v2h16v-2c0-2.66-5.33-4-8-4z"}),"Person");function x5(e){return Nt("MuiAvatar",e)}Ut("MuiAvatar",["root","colorDefault","circular","rounded","square","img","fallback"]);const w5=["alt","children","className","component","imgProps","sizes","src","srcSet","variant"],T5=e=>{const{classes:t,variant:n,colorDefault:r}=e;return sn({root:["root",n,r&&"colorDefault"],img:["img"],fallback:["fallback"]},x5,t)},P5=ue("div",{name:"MuiAvatar",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.root,t[n.variant],n.colorDefault&&t.colorDefault]}})(({theme:e,ownerState:t})=>W({position:"relative",display:"flex",alignItems:"center",justifyContent:"center",flexShrink:0,width:40,height:40,fontFamily:e.typography.fontFamily,fontSize:e.typography.pxToRem(20),lineHeight:1,borderRadius:"50%",overflow:"hidden",userSelect:"none"},t.variant==="rounded"&&{borderRadius:(e.vars||e).shape.borderRadius},t.variant==="square"&&{borderRadius:0},t.colorDefault&&W({color:(e.vars||e).palette.background.default},e.vars?{backgroundColor:e.vars.palette.Avatar.defaultBg}:{backgroundColor:e.palette.mode==="light"?e.palette.grey[400]:e.palette.grey[600]}))),S5=ue("img",{name:"MuiAvatar",slot:"Img",overridesResolver:(e,t)=>t.img})({width:"100%",height:"100%",textAlign:"center",objectFit:"cover",color:"transparent",textIndent:1e4}),R5=ue(Q5,{name:"MuiAvatar",slot:"Fallback",overridesResolver:(e,t)=>t.fallback})({width:"75%",height:"75%"});function O5({crossOrigin:e,referrerPolicy:t,src:n,srcSet:r}){const[o,s]=D.useState(!1);return D.useEffect(()=>{if(!n&&!r)return;s(!1);let l=!0;const u=new Image;return u.onload=()=>{l&&s("loaded")},u.onerror=()=>{l&&s("error")},u.crossOrigin=e,u.referrerPolicy=t,u.src=n,r&&(u.srcset=r),()=>{l=!1}},[e,t,n,r]),o}const jv=D.forwardRef(function(t,n){const r=Yt({props:t,name:"MuiAvatar"}),{alt:o,children:s,className:l,component:u="div",imgProps:A,sizes:g,src:p,srcSet:C,variant:h="circular"}=r,m=Ke(r,w5);let I=null;const B=O5(W({},A,{src:p,srcSet:C})),v=p||C,O=v&&B!=="error",j=W({},r,{colorDefault:!O,component:u,variant:h}),x=T5(j);return O?I=f.jsx(S5,W({alt:o,srcSet:C,src:p,sizes:g,ownerState:j,className:x.img},A)):s!=null?I=s:v&&o?I=o[0]:I=f.jsx(R5,{ownerState:j,className:x.fallback}),f.jsx(P5,W({as:u,ownerState:j,className:Ge(x.root,l),ref:n},m,{children:I}))});process.env.NODE_ENV!=="production"&&(jv.propTypes={alt:c.string,children:c.node,classes:c.object,className:c.string,component:c.elementType,imgProps:c.object,sizes:c.string,src:c.string,srcSet:c.string,sx:c.oneOfType([c.arrayOf(c.oneOfType([c.func,c.object,c.bool])),c.func,c.object]),variant:c.oneOfType([c.oneOf(["circular","rounded","square"]),c.string])});const j5=jv,an=(e,t)=>{switch(t){case"secondary":return e.palette.secondary;case"error":return e.palette.error;case"warning":return e.palette.warning;case"info":return e.palette.info;case"success":return e.palette.success;default:return e.palette.primary}};function M5({theme:e,color:t,type:n}){const r=an(e,t),{lighter:o,light:s,main:l,contrastText:u}=r;switch(n){case"filled":return{color:u,backgroundColor:l};case"outlined":return{color:l,border:"1px solid",borderColor:l,backgroundColor:"transparent"};case"combined":return{color:l,border:"1px solid",borderColor:s,backgroundColor:o};default:return{color:l,backgroundColor:o}}}function D5(e){switch(e){case"badge":return{border:"2px solid",fontSize:"0.675rem",width:20,height:20};case"xs":return{fontSize:"0.75rem",width:24,height:24};case"sm":return{fontSize:"0.875rem",width:32,height:32};case"lg":return{fontSize:"1.2rem",width:52,height:52};case"xl":return{fontSize:"1.5rem",width:64,height:64};case"md":default:return{fontSize:"1rem",width:40,height:40}}}const k5=ue(j5,{shouldForwardProp:e=>e!=="color"&&e!=="type"&&e!=="size"})(({theme:e,variant:t,color:n,type:r,size:o})=>({...D5(o),...M5({variant:t,theme:e,color:n,type:r}),...o==="badge"&&{borderColor:e.palette.background.default}}));function Ca({variant:e="circular",children:t,color:n="primary",type:r,size:o="md",...s}){const l=Rt();return f.jsx(k5,{variant:e,theme:l,color:n,type:r,size:o,...s,children:t})}Ca.propTypes={children:c.node,color:c.string,type:c.string,size:c.string,variant:c.string};const aI={p:2.5,"& .MuiCardHeader-action":{m:"0px auto",alignSelf:"center"}},Zn=w.forwardRef(({border:e=!0,boxShadow:t,children:n,subheader:r,content:o=!0,contentSX:s={},darkTitle:l,divider:u=!0,elevation:A,secondary:g,shadow:p,sx:C={},title:h,modal:m=!1,color:I="default",...B},v)=>{const O=Rt();return t=O.palette.mode==="dark"?t||!0:t,f.jsxs(b.Card,{elevation:A||0,ref:v,...B,sx:{position:"relative",border:e?"1px solid":"none",borderRadius:1,borderColor:O.palette.mode==="dark"?O.palette.divider:O.palette.grey.A800,boxShadow:t&&(!e||O.palette.mode==="dark")?p||O.customShadows.z1:"inherit",":hover":{boxShadow:t?p||O.customShadows.z1:"inherit"},backgroundColor:I==="default"?O.palette.background.paper:ts(I==="primary"?O.palette.primary[100]:O.palette.secondary[100],.5),...m&&{position:"absolute",top:"50%",left:"50%",transform:"translate(-50%, -50%)",width:{xs:"calc( 100% - 50px)",sm:"auto"},"& .MuiCardContent-root":{overflowY:"auto",minHeight:"auto",maxHeight:"calc(100vh - 200px)"}},...C},children:[!l&&h&&f.jsx(b.CardHeader,{sx:aI,titleTypographyProps:{variant:"subtitle1"},title:h,action:g,subheader:r}),l&&h&&f.jsx(b.CardHeader,{sx:aI,title:f.jsx(b.Typography,{variant:"h4",children:h}),action:g}),h&&u&&f.jsx(b.Divider,{}),o&&f.jsx(b.CardContent,{sx:s,children:n}),!o&&n]})});Zn.propTypes={border:c.bool,boxShadow:c.bool,children:c.oneOfType([c.node,c.arrayOf(c.node)]),subheader:c.oneOfType([c.node,c.string]),content:c.bool,contentClass:c.string,contentSX:c.object,darkTitle:c.bool,divider:c.bool,elevation:c.number,secondary:c.oneOfType([c.node,c.string,c.object]),shadow:c.string,sx:c.object,title:c.oneOfType([c.node,c.string,c.object]),modal:c.bool,color:c.oneOf(["default","primary","secondary"])};var gg={exports:{}},lt={};/**
97
+ }`;var Ye=Cm(function(){return tt(T,be+"return "+se).apply(n,M)});if(Ye.source=se,XA(Ye))throw Ye;return Ye}function _S(i){return rt(i).toLowerCase()}function $S(i){return rt(i).toUpperCase()}function eR(i,a,d){if(i=rt(i),i&&(d||a===n))return xh(i);if(!i||!(a=xn(a)))return i;var E=ir(i),y=ir(a),T=wh(E,y),M=Th(E,y)+1;return io(E,T,M).join("")}function tR(i,a,d){if(i=rt(i),i&&(d||a===n))return i.slice(0,Sh(i)+1);if(!i||!(a=xn(a)))return i;var E=ir(i),y=Th(E,ir(a))+1;return io(E,0,y).join("")}function nR(i,a,d){if(i=rt(i),i&&(d||a===n))return i.replace(Sr,"");if(!i||!(a=xn(a)))return i;var E=ir(i),y=wh(E,ir(a));return io(E,y).join("")}function rR(i,a){var d=U,E=_;if(Pt(a)){var y="separator"in a?a.separator:y;d="length"in a?He(a.length):d,E="omission"in a?xn(a.omission):E}i=rt(i);var T=i.length;if(hi(i)){var M=ir(i);T=M.length}if(d>=T)return i;var N=d-Ci(E);if(N<1)return E;var Y=M?io(M,0,N).join(""):i.slice(0,N);if(y===n)return Y+E;if(M&&(N+=Y.length-N),ZA(y)){if(i.slice(N).search(y)){var re,oe=Y;for(y.global||(y=gA(y.source,rt(xs.exec(y))+"g")),y.lastIndex=0;re=y.exec(oe);)var se=re.index;Y=Y.slice(0,se===n?N:se)}}else if(i.indexOf(xn(y),N)!=N){var Ee=Y.lastIndexOf(y);Ee>-1&&(Y=Y.slice(0,Ee))}return Y+E}function oR(i){return i=rt(i),i&&Ya.test(i)?i.replace(Ua,j1):i}var iR=bi(function(i,a,d){return i+(d?" ":"")+a.toUpperCase()}),ed=mC("toUpperCase");function hm(i,a,d){return i=rt(i),a=d?n:a,a===n?T1(i)?k1(i):E1(i):i.match(a)||[]}var Cm=qe(function(i,a){try{return bn(i,n,a)}catch(d){return XA(d)?d:new Fe(d)}}),sR=Dr(function(i,a){return Hn(a,function(d){d=Ir(d),jr(i,d,qA(i[d],i))}),i});function aR(i){var a=i==null?0:i.length,d=Re();return i=a?Qt(i,function(E){if(typeof E[1]!="function")throw new Wn(l);return[d(E[0]),E[1]]}):[],qe(function(E){for(var y=-1;++y<a;){var T=i[y];if(bn(T[0],this,E))return bn(T[1],this,E)}})}function lR(i){return jw(Un(i,C))}function td(i){return function(){return i}}function cR(i,a){return i==null||i!==i?a:i}var uR=IC(),AR=IC(!0);function Cn(i){return i}function nd(i){return Xh(typeof i=="function"?i:Un(i,C))}function dR(i){return _h(Un(i,C))}function gR(i,a){return $h(i,Un(a,C))}var fR=qe(function(i,a){return function(d){return Ds(d,i,a)}}),pR=qe(function(i,a){return function(d){return Ds(i,d,a)}});function rd(i,a,d){var E=Jt(a),y=El(a,E);d==null&&!(Pt(a)&&(y.length||!E.length))&&(d=a,a=i,i=this,y=El(a,Jt(a)));var T=!(Pt(d)&&"chain"in d)||!!d.chain,M=Fr(i);return Hn(y,function(N){var Y=a[N];i[N]=Y,M&&(i.prototype[N]=function(){var re=this.__chain__;if(T||re){var oe=i(this.__wrapped__),se=oe.__actions__=fn(this.__actions__);return se.push({func:Y,args:arguments,thisArg:i}),oe.__chain__=re,oe}return Y.apply(i,$r([this.value()],arguments))})}),i}function hR(){return $t._===this&&($t._=W1),this}function od(){}function CR(i){return i=He(i),qe(function(a){return eC(a,i)})}var mR=DA(Qt),ER=DA(Bh),IR=DA(sA);function mm(i){return WA(i)?aA(Ir(i)):Xw(i)}function BR(i){return function(a){return i==null?n:No(i,a)}}var vR=vC(),yR=vC(!0);function id(){return[]}function sd(){return!1}function bR(){return{}}function QR(){return""}function xR(){return!0}function wR(i,a){if(i=He(i),i<1||i>F)return[];var d=X,E=tn(i,X);a=Re(a),i-=X;for(var y=uA(E,a);++d<i;)a(d);return y}function TR(i){return Le(i)?Qt(i,Ir):wn(i)?[i]:fn(LC(rt(i)))}function PR(i){var a=++V1;return rt(i)+a}var SR=Ql(function(i,a){return i+a},0),RR=kA("ceil"),OR=Ql(function(i,a){return i/a},1),jR=kA("floor");function MR(i){return i&&i.length?ml(i,Cn,BA):n}function DR(i,a){return i&&i.length?ml(i,Re(a,2),BA):n}function kR(i){return bh(i,Cn)}function FR(i,a){return bh(i,Re(a,2))}function LR(i){return i&&i.length?ml(i,Cn,QA):n}function NR(i,a){return i&&i.length?ml(i,Re(a,2),QA):n}var VR=Ql(function(i,a){return i*a},1),HR=kA("round"),WR=Ql(function(i,a){return i-a},0);function zR(i){return i&&i.length?cA(i,Cn):0}function UR(i,a){return i&&i.length?cA(i,Re(a,2)):0}return Q.after=dP,Q.ary=JC,Q.assign=$P,Q.assignIn=cm,Q.assignInWith=Ll,Q.assignWith=eS,Q.at=tS,Q.before=XC,Q.bind=qA,Q.bindAll=sR,Q.bindKey=ZC,Q.castArray=bP,Q.chain=GC,Q.chunk=jT,Q.compact=MT,Q.concat=DT,Q.cond=aR,Q.conforms=lR,Q.constant=td,Q.countBy=z2,Q.create=nS,Q.curry=_C,Q.curryRight=$C,Q.debounce=em,Q.defaults=rS,Q.defaultsDeep=oS,Q.defer=gP,Q.delay=fP,Q.difference=kT,Q.differenceBy=FT,Q.differenceWith=LT,Q.drop=NT,Q.dropRight=VT,Q.dropRightWhile=HT,Q.dropWhile=WT,Q.fill=zT,Q.filter=Y2,Q.flatMap=q2,Q.flatMapDeep=J2,Q.flatMapDepth=X2,Q.flatten=WC,Q.flattenDeep=UT,Q.flattenDepth=YT,Q.flip=pP,Q.flow=uR,Q.flowRight=AR,Q.fromPairs=GT,Q.functions=AS,Q.functionsIn=dS,Q.groupBy=Z2,Q.initial=qT,Q.intersection=JT,Q.intersectionBy=XT,Q.intersectionWith=ZT,Q.invert=fS,Q.invertBy=pS,Q.invokeMap=$2,Q.iteratee=nd,Q.keyBy=eP,Q.keys=Jt,Q.keysIn=hn,Q.map=Ol,Q.mapKeys=CS,Q.mapValues=mS,Q.matches=dR,Q.matchesProperty=gR,Q.memoize=Ml,Q.merge=ES,Q.mergeWith=um,Q.method=fR,Q.methodOf=pR,Q.mixin=rd,Q.negate=Dl,Q.nthArg=CR,Q.omit=IS,Q.omitBy=BS,Q.once=hP,Q.orderBy=tP,Q.over=mR,Q.overArgs=CP,Q.overEvery=ER,Q.overSome=IR,Q.partial=JA,Q.partialRight=tm,Q.partition=nP,Q.pick=vS,Q.pickBy=Am,Q.property=mm,Q.propertyOf=BR,Q.pull=t2,Q.pullAll=UC,Q.pullAllBy=n2,Q.pullAllWith=r2,Q.pullAt=o2,Q.range=vR,Q.rangeRight=yR,Q.rearg=mP,Q.reject=iP,Q.remove=i2,Q.rest=EP,Q.reverse=GA,Q.sampleSize=aP,Q.set=bS,Q.setWith=QS,Q.shuffle=lP,Q.slice=s2,Q.sortBy=AP,Q.sortedUniq=g2,Q.sortedUniqBy=f2,Q.split=qS,Q.spread=IP,Q.tail=p2,Q.take=h2,Q.takeRight=C2,Q.takeRightWhile=m2,Q.takeWhile=E2,Q.tap=M2,Q.throttle=BP,Q.thru=Rl,Q.toArray=sm,Q.toPairs=dm,Q.toPairsIn=gm,Q.toPath=TR,Q.toPlainObject=lm,Q.transform=xS,Q.unary=vP,Q.union=I2,Q.unionBy=B2,Q.unionWith=v2,Q.uniq=y2,Q.uniqBy=b2,Q.uniqWith=Q2,Q.unset=wS,Q.unzip=KA,Q.unzipWith=YC,Q.update=TS,Q.updateWith=PS,Q.values=wi,Q.valuesIn=SS,Q.without=x2,Q.words=hm,Q.wrap=yP,Q.xor=w2,Q.xorBy=T2,Q.xorWith=P2,Q.zip=S2,Q.zipObject=R2,Q.zipObjectDeep=O2,Q.zipWith=j2,Q.entries=dm,Q.entriesIn=gm,Q.extend=cm,Q.extendWith=Ll,rd(Q,Q),Q.add=SR,Q.attempt=Cm,Q.camelCase=MS,Q.capitalize=fm,Q.ceil=RR,Q.clamp=RS,Q.clone=QP,Q.cloneDeep=wP,Q.cloneDeepWith=TP,Q.cloneWith=xP,Q.conformsTo=PP,Q.deburr=pm,Q.defaultTo=cR,Q.divide=OR,Q.endsWith=DS,Q.eq=ar,Q.escape=kS,Q.escapeRegExp=FS,Q.every=U2,Q.find=G2,Q.findIndex=VC,Q.findKey=iS,Q.findLast=K2,Q.findLastIndex=HC,Q.findLastKey=sS,Q.floor=jR,Q.forEach=KC,Q.forEachRight=qC,Q.forIn=aS,Q.forInRight=lS,Q.forOwn=cS,Q.forOwnRight=uS,Q.get=_A,Q.gt=SP,Q.gte=RP,Q.has=gS,Q.hasIn=$A,Q.head=zC,Q.identity=Cn,Q.includes=_2,Q.indexOf=KT,Q.inRange=OS,Q.invoke=hS,Q.isArguments=Wo,Q.isArray=Le,Q.isArrayBuffer=OP,Q.isArrayLike=pn,Q.isArrayLikeObject=Ft,Q.isBoolean=jP,Q.isBuffer=so,Q.isDate=MP,Q.isElement=DP,Q.isEmpty=kP,Q.isEqual=FP,Q.isEqualWith=LP,Q.isError=XA,Q.isFinite=NP,Q.isFunction=Fr,Q.isInteger=nm,Q.isLength=kl,Q.isMap=rm,Q.isMatch=VP,Q.isMatchWith=HP,Q.isNaN=WP,Q.isNative=zP,Q.isNil=YP,Q.isNull=UP,Q.isNumber=om,Q.isObject=Pt,Q.isObjectLike=Ot,Q.isPlainObject=Hs,Q.isRegExp=ZA,Q.isSafeInteger=GP,Q.isSet=im,Q.isString=Fl,Q.isSymbol=wn,Q.isTypedArray=xi,Q.isUndefined=KP,Q.isWeakMap=qP,Q.isWeakSet=JP,Q.join=_T,Q.kebabCase=LS,Q.last=Gn,Q.lastIndexOf=$T,Q.lowerCase=NS,Q.lowerFirst=VS,Q.lt=XP,Q.lte=ZP,Q.max=MR,Q.maxBy=DR,Q.mean=kR,Q.meanBy=FR,Q.min=LR,Q.minBy=NR,Q.stubArray=id,Q.stubFalse=sd,Q.stubObject=bR,Q.stubString=QR,Q.stubTrue=xR,Q.multiply=VR,Q.nth=e2,Q.noConflict=hR,Q.noop=od,Q.now=jl,Q.pad=HS,Q.padEnd=WS,Q.padStart=zS,Q.parseInt=US,Q.random=jS,Q.reduce=rP,Q.reduceRight=oP,Q.repeat=YS,Q.replace=GS,Q.result=yS,Q.round=HR,Q.runInContext=z,Q.sample=sP,Q.size=cP,Q.snakeCase=KS,Q.some=uP,Q.sortedIndex=a2,Q.sortedIndexBy=l2,Q.sortedIndexOf=c2,Q.sortedLastIndex=u2,Q.sortedLastIndexBy=A2,Q.sortedLastIndexOf=d2,Q.startCase=JS,Q.startsWith=XS,Q.subtract=WR,Q.sum=zR,Q.sumBy=UR,Q.template=ZS,Q.times=wR,Q.toFinite=Lr,Q.toInteger=He,Q.toLength=am,Q.toLower=_S,Q.toNumber=Kn,Q.toSafeInteger=_P,Q.toString=rt,Q.toUpper=$S,Q.trim=eR,Q.trimEnd=tR,Q.trimStart=nR,Q.truncate=rR,Q.unescape=oR,Q.uniqueId=PR,Q.upperCase=iR,Q.upperFirst=ed,Q.each=KC,Q.eachRight=qC,Q.first=zC,rd(Q,function(){var i={};return mr(Q,function(a,d){At.call(Q.prototype,d)||(i[d]=a)}),i}(),{chain:!1}),Q.VERSION=r,Hn(["bind","bindKey","curry","curryRight","partial","partialRight"],function(i){Q[i].placeholder=Q}),Hn(["drop","take"],function(i,a){Xe.prototype[i]=function(d){d=d===n?1:Kt(He(d),0);var E=this.__filtered__&&!a?new Xe(this):this.clone();return E.__filtered__?E.__takeCount__=tn(d,E.__takeCount__):E.__views__.push({size:tn(d,X),type:i+(E.__dir__<0?"Right":"")}),E},Xe.prototype[i+"Right"]=function(d){return this.reverse()[i](d).reverse()}}),Hn(["filter","map","takeWhile"],function(i,a){var d=a+1,E=d==Z||d==V;Xe.prototype[i]=function(y){var T=this.clone();return T.__iteratees__.push({iteratee:Re(y,3),type:d}),T.__filtered__=T.__filtered__||E,T}}),Hn(["head","last"],function(i,a){var d="take"+(a?"Right":"");Xe.prototype[i]=function(){return this[d](1).value()[0]}}),Hn(["initial","tail"],function(i,a){var d="drop"+(a?"":"Right");Xe.prototype[i]=function(){return this.__filtered__?new Xe(this):this[d](1)}}),Xe.prototype.compact=function(){return this.filter(Cn)},Xe.prototype.find=function(i){return this.filter(i).head()},Xe.prototype.findLast=function(i){return this.reverse().find(i)},Xe.prototype.invokeMap=qe(function(i,a){return typeof i=="function"?new Xe(this):this.map(function(d){return Ds(d,i,a)})}),Xe.prototype.reject=function(i){return this.filter(Dl(Re(i)))},Xe.prototype.slice=function(i,a){i=He(i);var d=this;return d.__filtered__&&(i>0||a<0)?new Xe(d):(i<0?d=d.takeRight(-i):i&&(d=d.drop(i)),a!==n&&(a=He(a),d=a<0?d.dropRight(-a):d.take(a-i)),d)},Xe.prototype.takeRightWhile=function(i){return this.reverse().takeWhile(i).reverse()},Xe.prototype.toArray=function(){return this.take(X)},mr(Xe.prototype,function(i,a){var d=/^(?:filter|find|map|reject)|While$/.test(a),E=/^(?:head|last)$/.test(a),y=Q[E?"take"+(a=="last"?"Right":""):a],T=E||/^find/.test(a);y&&(Q.prototype[a]=function(){var M=this.__wrapped__,N=E?[1]:arguments,Y=M instanceof Xe,re=N[0],oe=Y||Le(M),se=function(Je){var Ze=y.apply(Q,$r([Je],N));return E&&Ee?Ze[0]:Ze};oe&&d&&typeof re=="function"&&re.length!=1&&(Y=oe=!1);var Ee=this.__chain__,be=!!this.__actions__.length,Oe=T&&!Ee,Ye=Y&&!be;if(!T&&oe){M=Ye?M:new Xe(this);var je=i.apply(M,N);return je.__actions__.push({func:Rl,args:[se],thisArg:n}),new zn(je,Ee)}return Oe&&Ye?i.apply(this,N):(je=this.thru(se),Oe?E?je.value()[0]:je.value():je)})}),Hn(["pop","push","shift","sort","splice","unshift"],function(i){var a=rl[i],d=/^(?:push|sort|unshift)$/.test(i)?"tap":"thru",E=/^(?:pop|shift)$/.test(i);Q.prototype[i]=function(){var y=arguments;if(E&&!this.__chain__){var T=this.value();return a.apply(Le(T)?T:[],y)}return this[d](function(M){return a.apply(Le(M)?M:[],y)})}}),mr(Xe.prototype,function(i,a){var d=Q[a];if(d){var E=d.name+"";At.call(Bi,E)||(Bi[E]=[]),Bi[E].push({name:a,func:d})}}),Bi[bl(n,O).name]=[{name:"wrapper",func:n}],Xe.prototype.clone=ow,Xe.prototype.reverse=iw,Xe.prototype.value=sw,Q.prototype.at=D2,Q.prototype.chain=k2,Q.prototype.commit=F2,Q.prototype.next=L2,Q.prototype.plant=V2,Q.prototype.reverse=H2,Q.prototype.toJSON=Q.prototype.valueOf=Q.prototype.value=W2,Q.prototype.first=Q.prototype.head,Ts&&(Q.prototype[Ts]=N2),Q},mi=F1();Mo?((Mo.exports=mi)._=mi,nA._=mi):$t._=mi}).call(Xn)})(Ic,Ic.exports);var dt=Ic.exports;const Ae=bo(dt),$m=e=>function(){return e.apply(this,arguments)},ns=c.shape({id:c.string,title:c.string,type:c.oneOf(["group","item","collapse"]),icon:c.elementType,url:c.string,parent:c.shape($m(()=>ns)),children:c.arrayOf($m(()=>ns)),resource:c.bool}),$0={fontFamily:"'Inter', sans-serif",menuOrientation:"vertical",miniDrawer:!1,container:!1,mode:"light",presetColor:"theme4",themeDirection:"ltr",appDefaultPath:"/",drawerWidth:260,horizontalMaxItems:6,spacing:2},Xg=w.createContext($0),_j=e=>e==="vertical",$j=e=>e==="horizontal",Bc=({initialConfig:e,children:t})=>{const[n,r]=of("theme-config",{...$0,...e}),o=I=>r(B=>({...B,fontFamily:I})),s=I=>r(B=>({...B,menuOrientation:I})),l=I=>r(B=>({...B,miniDrawer:I})),u=I=>r(B=>({...B,container:I})),A=I=>r(B=>({...B,mode:I})),g=I=>r(B=>({...B,presetColor:I})),p=I=>r(B=>({...B,themeDirection:I})),C=I=>r(B=>({...B,appDefaultPath:I})),h=I=>r(B=>({...B,drawerWidth:I})),m=I=>r(B=>({...B,horizontalMaxItems:I}));return f.jsx(Xg.Provider,{value:{...n,setFontFamily:o,setMenuOrientation:s,setMiniDrawer:l,setContainer:u,setMode:A,setPresetColor:g,setThemeDirection:p,setAppDefaultPath:C,setDrawerWidth:h,setHorizontalMaxItems:m,isVerticalLayout:_j,isHorizontalLayout:$j},children:t})};Bc.propTypes={children:c.node};const eB={openItem:["dashboard"],openComponent:"buttons",selectedID:null,drawerOpen:!1,componentDrawerOpen:!0,menuDashboard:{},error:null},Zg=w.createContext(eB),_g=({menu:e,children:t})=>{const[n,r]=of("menu-config",{...eB}),o=C=>{r(h=>({...h,openItem:C}))},s=C=>{r(h=>({...h,selectedID:C}))},l=C=>{r(h=>({...h,openComponent:C}))},u=C=>{r(h=>({...h,drawerOpen:C}))},A=C=>{r(h=>({...h,componentDrawerOpen:C}))},g=C=>{r(h=>({...h,menuDashboard:C}))},p=C=>{r(h=>({...h,error:C}))};return f.jsx(Zg.Provider,{value:{...n,groups:e,activeItem:o,activeComponent:l,openDrawer:u,openComponentDrawer:A,activeID:s,getMenuSuccess:g,hasError:p},children:t})};_g.propTypes={children:c.node,menu:c.arrayOf(ns)};const $g=w.createContext(void 0),ef=w.createContext(void 0),Io=()=>w.useContext(Zg),eM=["e-","entities/"],tM=e=>{let t=e;return eM.forEach(n=>{t=t!=null&&t.startsWith(n)?t==null?void 0:t.substring(n.length):t}),t},nM=(e,t)=>{var n,r;return((n=t.options)==null?void 0:n.group)===e.id||!((r=t.options)!=null&&r.group)&&e.id==="admin"},rM=(e,t)=>{const n=tM(e.name);return t==null?void 0:t.includes(`${n}:list`)},$d=(e,t)=>{let n=e.find(r=>r.id===t);if(!n)for(let r=0;r<e.length;r++){const o=e[r];if(o.children&&(n=$d(o.children,t),n))return n}return n},tB=(e,t,n)=>{let r=e.find(o=>["group","collapse"].indexOf(o.type)!==-1&&nM(o,t));if(!r)for(let o=0;o<e.length;o++){const s=e[o];if(s.children&&(r=tB(s.children,t),r))return r}return r},nB=(e,t)=>{let n=e.find(r=>r.id===t);if(!n)for(let r=0;r<e.length;r++){const o=e[r];if(o.children&&(n=nB(o.children,t),n))return n}return n},rB=e=>e?e.type==="item"?!0:(e.children&&(e.children=e.children.filter(rB)),e.children&&e.children.length>0):!1,oB=e=>(e.children&&e.children.forEach(t=>{t.parent=e,oB(t)}),e),oM=({userGroups:e,resources:t,permissions:n,translate:r,roles:o})=>{const s=C=>(C.title=r(C.title,{_:C.title}),C.children&&C.children.forEach(h=>s(h)),C),l=Object.keys(t),u=(C,h)=>(C.children&&(C.children=C.children.filter(m=>{if(m.resource===!1){const I=m.roles||[];return!!(I.length===0||I.some(B=>o.includes(B)))}return m.type==="item"?h.includes(m.id):(u(m,h),m.children&&m.children.length>0)})),C),A=dt.cloneDeep(e).map(C=>({type:"group",icon:et.AntDesignOutlined,children:[],...C})).map(s).map(C=>u(C,l)),g=Object.values(t).map(C=>{var h;return((h=C.options)==null?void 0:h.group)||"admin"}).filter((C,h,m)=>m.indexOf(C)===h).filter(C=>C!==void 0&&nB(e,C)===null).map(C=>({id:C,title:r(`ra.menu.group.${C}`),type:"group",icon:et.AntDesignOutlined,children:[]})),p=[...A,...g];return Object.values(t).forEach(C=>{var j,x,S,P;const h=tB(p,C),m=(j=h==null?void 0:h.children)==null?void 0:j.find(L=>L.id===C.name),I=(x=h==null?void 0:h.children)==null?void 0:x.some(L=>L.id===C.name),B=(m==null?void 0:m.roles)||((S=C.options)==null?void 0:S.roles)||[],v=!B||B.length===0||B.some(L=>o.includes(L));if(!rM(C,n)||!C.hasList||!v){I&&((P=h==null?void 0:h.children)==null?void 0:P.length)>0&&(h.children=h.children.filter(L=>L.id!==C.name));return}h&&(h.children||(h.children=[]))}),p.filter(rB).map(oB)},tf=()=>{const e=R.useResourceDefinitions(),{isLoading:t,data:n}=R.useGetIdentity(),r=n&&n.id>0,{isLoading:o,permissions:s}=R.usePermissions(r),{groups:l}=Io(),u=R.useTranslate(),A=w.useMemo(()=>{if(t||!n||n===null||(n==null?void 0:n.id)<=0)return null;const p=((n==null?void 0:n.roles)||[]).map(h=>h.id);return oM({resources:e,permissions:s,translate:u,userGroups:l,roles:p})},[t,o,n,e,s,u,l]),g=w.useMemo(()=>t,[t]);return{menu:A,isLoading:g,getItem:p=>g?!1:$d(A,p),findInMenu:g?()=>{}:$d}},iB=()=>{const e=R.useTranslate(),{isLoading:t,menu:n,findInMenu:r}=tf(),{pathname:o}=Bt.useLocation();return w.useMemo(()=>{var C;const s=o.split("/").filter(h=>h);let l=dt.cloneDeep(n),u=o,A=r(l,o);if(A||(A=r(l,s[s.length-1]),u=A?A.id:u),!A)for(let h=s.length;h>=0;h--){let m=s.slice(0,h).join("/");if(A=r(l,m),A){u=A.id;break}}const g=(C=A==null?void 0:A.url)==null?void 0:C.split("/");if(s.length>=(g==null?void 0:g.length)){const h=s[s.length-1];if(A){const m=h==="create"||o===A.url?"create":"edit",I=`resources.${u}.breadcrumbs.${m}`,B={id:`${u}-${m}`,type:"item",title:e(I,{_:e(I,{_:I})}),url:o,breadcrumbs:!0,parent:A};A.type="collapse",A.breadcrumbs=!0,A.children=A.children||[],A.children.push(B),A=B}}let p=[];if(A){let h={...A,last:!0};for(;h;)p.push(h),h=h.parent;p=p.reverse()}return{isLoading:t,navigation:{items:l},breadcrumbs:p}},[t,o,n,r,e])};var sB={exports:{}};(function(e,t){(function(n,r){e.exports=r()})(Xn,function(){var n=1e3,r=6e4,o=36e5,s="millisecond",l="second",u="minute",A="hour",g="day",p="week",C="month",h="quarter",m="year",I="date",B="Invalid Date",v=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,O=/\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,j={name:"en",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),ordinal:function(Z){var K=["th","st","nd","rd"],V=Z%100;return"["+Z+(K[(V-20)%10]||K[V]||K[0])+"]"}},x=function(Z,K,V){var G=String(Z);return!G||G.length>=K?Z:""+Array(K+1-G.length).join(V)+Z},S={s:x,z:function(Z){var K=-Z.utcOffset(),V=Math.abs(K),G=Math.floor(V/60),F=V%60;return(K<=0?"+":"-")+x(G,2,"0")+":"+x(F,2,"0")},m:function Z(K,V){if(K.date()<V.date())return-Z(V,K);var G=12*(V.year()-K.year())+(V.month()-K.month()),F=K.clone().add(G,C),$=V-F<0,H=K.clone().add(G+($?-1:1),C);return+(-(G+(V-F)/($?F-H:H-F))||0)},a:function(Z){return Z<0?Math.ceil(Z)||0:Math.floor(Z)},p:function(Z){return{M:C,y:m,w:p,d:g,D:I,h:A,m:u,s:l,ms:s,Q:h}[Z]||String(Z||"").toLowerCase().replace(/s$/,"")},u:function(Z){return Z===void 0}},P="en",L={};L[P]=j;var k="$isDayjsObject",q=function(Z){return Z instanceof le||!(!Z||!Z[k])},J=function Z(K,V,G){var F;if(!K)return P;if(typeof K=="string"){var $=K.toLowerCase();L[$]&&(F=$),V&&(L[$]=V,F=$);var H=K.split("-");if(!F&&H.length>1)return Z(H[0])}else{var X=K.name;L[X]=K,F=X}return!G&&F&&(P=F),F||!G&&P},U=function(Z,K){if(q(Z))return Z.clone();var V=typeof K=="object"?K:{};return V.date=Z,V.args=arguments,new le(V)},_=S;_.l=J,_.i=q,_.w=function(Z,K){return U(Z,{locale:K.$L,utc:K.$u,x:K.$x,$offset:K.$offset})};var le=function(){function Z(V){this.$L=J(V.locale,null,!0),this.parse(V),this.$x=this.$x||V.x||{},this[k]=!0}var K=Z.prototype;return K.parse=function(V){this.$d=function(G){var F=G.date,$=G.utc;if(F===null)return new Date(NaN);if(_.u(F))return new Date;if(F instanceof Date)return new Date(F);if(typeof F=="string"&&!/Z$/i.test(F)){var H=F.match(v);if(H){var X=H[2]-1||0,ge=(H[7]||"0").substring(0,3);return $?new Date(Date.UTC(H[1],X,H[3]||1,H[4]||0,H[5]||0,H[6]||0,ge)):new Date(H[1],X,H[3]||1,H[4]||0,H[5]||0,H[6]||0,ge)}}return new Date(F)}(V),this.init()},K.init=function(){var V=this.$d;this.$y=V.getFullYear(),this.$M=V.getMonth(),this.$D=V.getDate(),this.$W=V.getDay(),this.$H=V.getHours(),this.$m=V.getMinutes(),this.$s=V.getSeconds(),this.$ms=V.getMilliseconds()},K.$utils=function(){return _},K.isValid=function(){return this.$d.toString()!==B},K.isSame=function(V,G){var F=U(V);return this.startOf(G)<=F&&F<=this.endOf(G)},K.isAfter=function(V,G){return U(V)<this.startOf(G)},K.isBefore=function(V,G){return this.endOf(G)<U(V)},K.$g=function(V,G,F){return _.u(V)?this[G]:this.set(F,V)},K.unix=function(){return Math.floor(this.valueOf()/1e3)},K.valueOf=function(){return this.$d.getTime()},K.startOf=function(V,G){var F=this,$=!!_.u(G)||G,H=_.p(V),X=function(Ce,Ie){var Qe=_.w(F.$u?Date.UTC(F.$y,Ie,Ce):new Date(F.$y,Ie,Ce),F);return $?Qe:Qe.endOf(g)},ge=function(Ce,Ie){return _.w(F.toDate()[Ce].apply(F.toDate("s"),($?[0,0,0,0]:[23,59,59,999]).slice(Ie)),F)},pe=this.$W,ce=this.$M,fe=this.$D,he="set"+(this.$u?"UTC":"");switch(H){case m:return $?X(1,0):X(31,11);case C:return $?X(1,ce):X(0,ce+1);case p:var Be=this.$locale().weekStart||0,me=(pe<Be?pe+7:pe)-Be;return X($?fe-me:fe+(6-me),ce);case g:case I:return ge(he+"Hours",0);case A:return ge(he+"Minutes",1);case u:return ge(he+"Seconds",2);case l:return ge(he+"Milliseconds",3);default:return this.clone()}},K.endOf=function(V){return this.startOf(V,!1)},K.$set=function(V,G){var F,$=_.p(V),H="set"+(this.$u?"UTC":""),X=(F={},F[g]=H+"Date",F[I]=H+"Date",F[C]=H+"Month",F[m]=H+"FullYear",F[A]=H+"Hours",F[u]=H+"Minutes",F[l]=H+"Seconds",F[s]=H+"Milliseconds",F)[$],ge=$===g?this.$D+(G-this.$W):G;if($===C||$===m){var pe=this.clone().set(I,1);pe.$d[X](ge),pe.init(),this.$d=pe.set(I,Math.min(this.$D,pe.daysInMonth())).$d}else X&&this.$d[X](ge);return this.init(),this},K.set=function(V,G){return this.clone().$set(V,G)},K.get=function(V){return this[_.p(V)]()},K.add=function(V,G){var F,$=this;V=Number(V);var H=_.p(G),X=function(ce){var fe=U($);return _.w(fe.date(fe.date()+Math.round(ce*V)),$)};if(H===C)return this.set(C,this.$M+V);if(H===m)return this.set(m,this.$y+V);if(H===g)return X(1);if(H===p)return X(7);var ge=(F={},F[u]=r,F[A]=o,F[l]=n,F)[H]||1,pe=this.$d.getTime()+V*ge;return _.w(pe,this)},K.subtract=function(V,G){return this.add(-1*V,G)},K.format=function(V){var G=this,F=this.$locale();if(!this.isValid())return F.invalidDate||B;var $=V||"YYYY-MM-DDTHH:mm:ssZ",H=_.z(this),X=this.$H,ge=this.$m,pe=this.$M,ce=F.weekdays,fe=F.months,he=F.meridiem,Be=function(Ie,Qe,ae,Ne){return Ie&&(Ie[Qe]||Ie(G,$))||ae[Qe].slice(0,Ne)},me=function(Ie){return _.s(X%12||12,Ie,"0")},Ce=he||function(Ie,Qe,ae){var Ne=Ie<12?"AM":"PM";return ae?Ne.toLowerCase():Ne};return $.replace(O,function(Ie,Qe){return Qe||function(ae){switch(ae){case"YY":return String(G.$y).slice(-2);case"YYYY":return _.s(G.$y,4,"0");case"M":return pe+1;case"MM":return _.s(pe+1,2,"0");case"MMM":return Be(F.monthsShort,pe,fe,3);case"MMMM":return Be(fe,pe);case"D":return G.$D;case"DD":return _.s(G.$D,2,"0");case"d":return String(G.$W);case"dd":return Be(F.weekdaysMin,G.$W,ce,2);case"ddd":return Be(F.weekdaysShort,G.$W,ce,3);case"dddd":return ce[G.$W];case"H":return String(X);case"HH":return _.s(X,2,"0");case"h":return me(1);case"hh":return me(2);case"a":return Ce(X,ge,!0);case"A":return Ce(X,ge,!1);case"m":return String(ge);case"mm":return _.s(ge,2,"0");case"s":return String(G.$s);case"ss":return _.s(G.$s,2,"0");case"SSS":return _.s(G.$ms,3,"0");case"Z":return H}return null}(Ie)||H.replace(":","")})},K.utcOffset=function(){return 15*-Math.round(this.$d.getTimezoneOffset()/15)},K.diff=function(V,G,F){var $,H=this,X=_.p(G),ge=U(V),pe=(ge.utcOffset()-this.utcOffset())*r,ce=this-ge,fe=function(){return _.m(H,ge)};switch(X){case m:$=fe()/12;break;case C:$=fe();break;case h:$=fe()/3;break;case p:$=(ce-pe)/6048e5;break;case g:$=(ce-pe)/864e5;break;case A:$=ce/o;break;case u:$=ce/r;break;case l:$=ce/n;break;default:$=ce}return F?$:_.a($)},K.daysInMonth=function(){return this.endOf(C).$D},K.$locale=function(){return L[this.$L]},K.locale=function(V,G){if(!V)return this.$L;var F=this.clone(),$=J(V,G,!0);return $&&(F.$L=$),F},K.clone=function(){return _.w(this.$d,this)},K.toDate=function(){return new Date(this.valueOf())},K.toJSON=function(){return this.isValid()?this.toISOString():null},K.toISOString=function(){return this.$d.toISOString()},K.toString=function(){return this.$d.toUTCString()},Z}(),ie=le.prototype;return U.prototype=ie,[["$ms",s],["$s",l],["$m",u],["$H",A],["$W",g],["$M",C],["$y",m],["$D",I]].forEach(function(Z){ie[Z[1]]=function(K){return this.$g(K,Z[0],Z[1])}}),U.extend=function(Z,K){return Z.$i||(Z(K,le,U),Z.$i=!0),U},U.locale=J,U.isDayjs=q,U.unix=function(Z){return U(1e3*Z)},U.en=L[P],U.Ls=L,U.p={},U})})(sB);var iM=sB.exports;const qr=bo(iM),aB=e=>{const t=e.split(":");t.length===1&&t.push("00");const n=parseInt(t[0]),r=parseInt(t[1]);return qr().hour(n).minute(r)};function sM(){let e=new Date().getTime();return window.performance&&typeof window.performance.now=="function"&&(e+=performance.now()),"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(n){const r=(e+Math.random()*16)%16|0;return e=Math.floor(e/16),(n=="x"?r:r&3|8).toString(16)})}function nf(e={},t=[],n={}){const{isEmpty:r=Ae.isEmpty}=n;return!Ae.some(t,o=>r((e??{})[o.locale]))}function rf(e,t,n){if(!Ae.isPlainObject(e)||t===void 0)return;const r=Ae.isPlainObject(n)?n:{},o=!!((r==null?void 0:r.fallback)??!0);let s=e[String(t)];if(s===void 0&&o){const l=Ae.isArray(r.fallbackLocales)&&!Ae.isEmpty(r.fallbackLocales)?r.fallbackLocales:["en"];s=Ae.chain(l).map(u=>e[String(u)]).reject(Ae.isUndefined).first().value(),s===void 0&&(s=Ae.chain(e).values().first().value())}return s}function lB(e){const[t]=de.useLocaleState();return e!==void 0?String(e):t}function aM(e,t){const n=lB(t==null?void 0:t.locale);return rf(e,n,t)}function lM(e){const t=lB(e==null?void 0:e.locale);return w.useCallback(r=>rf(r,t,e),[t,e])}function of(e,t){const[n,r]=w.useState(()=>{const s=typeof window<"u"?localStorage.getItem(e):null;return s===null?t:JSON.parse(s)});return w.useEffect(()=>{const s=l=>{typeof window<"u"&&l.storageArea===localStorage&&l.key===e&&r(l.newValue?JSON.parse(l.newValue):l.newValue)};return window.addEventListener("storage",s),()=>{window.removeEventListener("storage",s)}},[e,t]),[n,s=>{r(l=>{const u=typeof s=="function"?s(l):s;return typeof window<"u"&&localStorage.setItem(e,JSON.stringify(u)),u})}]}function cB(e){if(!Ae.isPlainObject(e))throw new Error("[useMemoizedObject]: param must be a plain JS object");const[t,n]=w.useState(e);return w.useEffect(()=>{Ae.isEqual(e,t)||n(e)},[e,t]),t}function ou(){const[e,t]=w.useState(null),n=!!e,r=w.useCallback(l=>t((l==null?void 0:l.currentTarget)??null),[t]),o=w.useCallback(()=>t(null),[t]),s=w.useCallback(l=>{n?o():r(l)},[n,r,o]);return{anchorEl:e,open:n,handleClick:r,handleClose:o,handleToggle:s}}function cM(e,t){const[n,r]=w.useState({width:1,height:1}),o=e.current;return w.useEffect(()=>{function s(){var g;let u=0,A=0;switch(t){case"client":u=(o==null?void 0:o.clientWidth)??0,A=(o==null?void 0:o.clientHeight)??0;break;case"offset":u=(o==null?void 0:o.offsetWidth)??0,A=(o==null?void 0:o.offsetHeight)??0;break;case"scroll":u=(o==null?void 0:o.scrollWidth)??0,A=(o==null?void 0:o.scrollHeight)??0;break;case"bounding":default:{const p=((g=e.current)==null?void 0:g.getBoundingClientRect())??{width:0,height:0};u=p.width,A=p.height;break}}r({width:u,height:A})}const l=new ResizeObserver(s);return Ae.isEmpty(e==null?void 0:e.current)||(l.observe(e==null?void 0:e.current),s()),()=>{l.disconnect()}},[o,t]),n}const sf=e=>{const t=R.useRecordContext(),n=R.useTranslate(),r=R.useResourceContext(),o=t!=null&&t.id?"edit":"create";return w.useMemo(()=>{if(e===!1)return;const l=`resources.${r}.title`;return e||n(`resources.${r}.title.${o}`,{_:n(l,{_:l}),...t})},[o,t,r,n,e])};function Pr(e,t,n){const r=Ae.chain((e==null?void 0:e.sx)??{}).cloneDeepWith(l=>Ae.isFunction(l)?l:void 0).value();n!=null&&n.defaults?Ae.defaultsDeep(r,t):Ae.merge(r,t);const[o,s]=w.useState(r);return w.useEffect(()=>{Ae.isEqual(o,r)||s(r)},[o,r]),o}const uB=()=>w.useContext($g),uM=()=>w.useContext(ef),Ln=()=>w.useContext(Xg),AB=ue(Zj,{shouldForwardProp:e=>e!=="open"})(({theme:e,open:t})=>{const{drawerWidth:n}=Ln();return{zIndex:e.zIndex.drawer+1,transition:e.transitions.create(["width","margin"],{easing:e.transitions.easing.sharp,duration:e.transitions.duration.leavingScreen}),...!t&&{width:`calc(100% - ${e.spacing(7.5)})`},...t&&{marginLeft:n,width:`calc(100% - ${n}px)`,transition:e.transitions.create(["width","margin"],{easing:e.transitions.easing.sharp,duration:e.transitions.duration.enteringScreen})}}});AB.propTypes={open:c.bool};const AM=w.forwardRef(function(t,n){const r=Pr(t,{color:"text.primary"},{defaults:!0});return f.jsx(b.Button,{ref:n,...t,color:"secondary",variant:"text",sx:r})}),dB=w.createContext({transformPagePoint:e=>e,isStatic:!1,reducedMotion:"never"}),iu=w.createContext({}),af=w.createContext(null),su=typeof document<"u",dM=su?w.useLayoutEffect:w.useEffect,gB=w.createContext({strict:!1});function gM(e,t,n,r){const{visualElement:o}=w.useContext(iu),s=w.useContext(gB),l=w.useContext(af),u=w.useContext(dB).reducedMotion,A=w.useRef();r=r||s.renderer,!A.current&&r&&(A.current=r(e,{visualState:t,parent:o,props:n,presenceContext:l,blockInitialAnimation:l?l.initial===!1:!1,reducedMotionConfig:u}));const g=A.current;w.useInsertionEffect(()=>{g&&g.update(n,l)});const p=w.useRef(!!window.HandoffAppearAnimations);return dM(()=>{g&&(g.render(),p.current&&g.animationState&&g.animationState.animateChanges())}),w.useEffect(()=>{g&&(g.updateFeatures(),!p.current&&g.animationState&&g.animationState.animateChanges(),window.HandoffAppearAnimations=void 0,p.current=!1)}),g}function zi(e){return typeof e=="object"&&Object.prototype.hasOwnProperty.call(e,"current")}function fM(e,t,n){return w.useCallback(r=>{r&&e.mount&&e.mount(r),t&&(r?t.mount(r):t.unmount()),n&&(typeof n=="function"?n(r):zi(n)&&(n.current=r))},[t])}function fa(e){return typeof e=="string"||Array.isArray(e)}function au(e){return typeof e=="object"&&typeof e.start=="function"}const lf=["animate","whileInView","whileFocus","whileHover","whileTap","whileDrag","exit"],cf=["initial",...lf];function lu(e){return au(e.animate)||cf.some(t=>fa(e[t]))}function fB(e){return!!(lu(e)||e.variants)}function pM(e,t){if(lu(e)){const{initial:n,animate:r}=e;return{initial:n===!1||fa(n)?n:void 0,animate:fa(r)?r:void 0}}return e.inherit!==!1?t:{}}function hM(e){const{initial:t,animate:n}=pM(e,w.useContext(iu));return w.useMemo(()=>({initial:t,animate:n}),[eE(t),eE(n)])}function eE(e){return Array.isArray(e)?e.join(" "):e}const tE={animation:["animate","variants","whileHover","whileTap","exit","whileInView","whileFocus","whileDrag"],exit:["exit"],drag:["drag","dragControls"],focus:["whileFocus"],hover:["whileHover","onHoverStart","onHoverEnd"],tap:["whileTap","onTap","onTapStart","onTapCancel"],pan:["onPan","onPanStart","onPanSessionStart","onPanEnd"],inView:["whileInView","onViewportEnter","onViewportLeave"],layout:["layout","layoutId"]},pa={};for(const e in tE)pa[e]={isEnabled:t=>tE[e].some(n=>!!t[n])};function CM(e){for(const t in e)pa[t]={...pa[t],...e[t]}}const pB=w.createContext({}),hB=w.createContext({}),mM=Symbol.for("motionComponentSymbol");function EM({preloadedFeatures:e,createVisualElement:t,useRender:n,useVisualState:r,Component:o}){e&&CM(e);function s(u,A){let g;const p={...w.useContext(dB),...u,layoutId:IM(u)},{isStatic:C}=p,h=hM(u),m=r(u,C);if(!C&&su){h.visualElement=gM(o,m,p,t);const I=w.useContext(hB),B=w.useContext(gB).strict;h.visualElement&&(g=h.visualElement.loadFeatures(p,B,e,I))}return D.createElement(iu.Provider,{value:h},g&&h.visualElement?D.createElement(g,{visualElement:h.visualElement,...p}):null,n(o,u,fM(m,h.visualElement,A),m,C,h.visualElement))}const l=w.forwardRef(s);return l[mM]=o,l}function IM({layoutId:e}){const t=w.useContext(pB).id;return t&&e!==void 0?t+"-"+e:e}function BM(e){function t(r,o={}){return EM(e(r,o))}if(typeof Proxy>"u")return t;const n=new Map;return new Proxy(t,{get:(r,o)=>(n.has(o)||n.set(o,t(o)),n.get(o))})}const vM=["animate","circle","defs","desc","ellipse","g","image","line","filter","marker","mask","metadata","path","pattern","polygon","polyline","rect","stop","switch","symbol","svg","text","tspan","use","view"];function uf(e){return typeof e!="string"||e.includes("-")?!1:!!(vM.indexOf(e)>-1||/[A-Z]/.test(e))}const vc={};function yM(e){Object.assign(vc,e)}const Pa=["transformPerspective","x","y","z","translateX","translateY","translateZ","scale","scaleX","scaleY","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"],ui=new Set(Pa);function CB(e,{layout:t,layoutId:n}){return ui.has(e)||e.startsWith("origin")||(t||n!==void 0)&&(!!vc[e]||e==="opacity")}const vn=e=>!!(e&&e.getVelocity),bM={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},QM=Pa.length;function xM(e,{enableHardwareAcceleration:t=!0,allowTransformNone:n=!0},r,o){let s="";for(let l=0;l<QM;l++){const u=Pa[l];if(e[u]!==void 0){const A=bM[u]||u;s+=`${A}(${e[u]}) `}}return t&&!e.z&&(s+="translateZ(0)"),s=s.trim(),o?s=o(e,r?"":s):n&&r&&(s="none"),s}const mB=e=>t=>typeof t=="string"&&t.startsWith(e),EB=mB("--"),eg=mB("var(--"),wM=/var\s*\(\s*--[\w-]+(\s*,\s*(?:(?:[^)(]|\((?:[^)(]+|\([^)(]*\))*\))*)+)?\s*\)/g,TM=(e,t)=>t&&typeof e=="number"?t.transform(e):e,Bo=(e,t,n)=>Math.min(Math.max(n,e),t),Ai={test:e=>typeof e=="number",parse:parseFloat,transform:e=>e},na={...Ai,transform:e=>Bo(0,1,e)},Hl={...Ai,default:1},ra=e=>Math.round(e*1e5)/1e5,cu=/(-)?([\d]*\.?[\d])+/g,IB=/(#[0-9a-f]{3,8}|(rgb|hsl)a?\((-?[\d\.]+%?[,\s]+){2}(-?[\d\.]+%?)\s*[\,\/]?\s*[\d\.]*%?\))/gi,PM=/^(#[0-9a-f]{3,8}|(rgb|hsl)a?\((-?[\d\.]+%?[,\s]+){2}(-?[\d\.]+%?)\s*[\,\/]?\s*[\d\.]*%?\))$/i;function Sa(e){return typeof e=="string"}const Ra=e=>({test:t=>Sa(t)&&t.endsWith(e)&&t.split(" ").length===1,parse:parseFloat,transform:t=>`${t}${e}`}),Ao=Ra("deg"),br=Ra("%"),Me=Ra("px"),SM=Ra("vh"),RM=Ra("vw"),nE={...br,parse:e=>br.parse(e)/100,transform:e=>br.transform(e*100)},rE={...Ai,transform:Math.round},BB={borderWidth:Me,borderTopWidth:Me,borderRightWidth:Me,borderBottomWidth:Me,borderLeftWidth:Me,borderRadius:Me,radius:Me,borderTopLeftRadius:Me,borderTopRightRadius:Me,borderBottomRightRadius:Me,borderBottomLeftRadius:Me,width:Me,maxWidth:Me,height:Me,maxHeight:Me,size:Me,top:Me,right:Me,bottom:Me,left:Me,padding:Me,paddingTop:Me,paddingRight:Me,paddingBottom:Me,paddingLeft:Me,margin:Me,marginTop:Me,marginRight:Me,marginBottom:Me,marginLeft:Me,rotate:Ao,rotateX:Ao,rotateY:Ao,rotateZ:Ao,scale:Hl,scaleX:Hl,scaleY:Hl,scaleZ:Hl,skew:Ao,skewX:Ao,skewY:Ao,distance:Me,translateX:Me,translateY:Me,translateZ:Me,x:Me,y:Me,z:Me,perspective:Me,transformPerspective:Me,opacity:na,originX:nE,originY:nE,originZ:Me,zIndex:rE,fillOpacity:na,strokeOpacity:na,numOctaves:rE};function Af(e,t,n,r){const{style:o,vars:s,transform:l,transformOrigin:u}=e;let A=!1,g=!1,p=!0;for(const C in t){const h=t[C];if(EB(C)){s[C]=h;continue}const m=BB[C],I=TM(h,m);if(ui.has(C)){if(A=!0,l[C]=I,!p)continue;h!==(m.default||0)&&(p=!1)}else C.startsWith("origin")?(g=!0,u[C]=I):o[C]=I}if(t.transform||(A||r?o.transform=xM(e.transform,n,p,r):o.transform&&(o.transform="none")),g){const{originX:C="50%",originY:h="50%",originZ:m=0}=u;o.transformOrigin=`${C} ${h} ${m}`}}const df=()=>({style:{},transform:{},transformOrigin:{},vars:{}});function vB(e,t,n){for(const r in t)!vn(t[r])&&!CB(r,n)&&(e[r]=t[r])}function OM({transformTemplate:e},t,n){return w.useMemo(()=>{const r=df();return Af(r,t,{enableHardwareAcceleration:!n},e),Object.assign({},r.vars,r.style)},[t])}function jM(e,t,n){const r=e.style||{},o={};return vB(o,r,e),Object.assign(o,OM(e,t,n)),e.transformValues?e.transformValues(o):o}function MM(e,t,n){const r={},o=jM(e,t,n);return e.drag&&e.dragListener!==!1&&(r.draggable=!1,o.userSelect=o.WebkitUserSelect=o.WebkitTouchCallout="none",o.touchAction=e.drag===!0?"none":`pan-${e.drag==="x"?"y":"x"}`),e.tabIndex===void 0&&(e.onTap||e.onTapStart||e.whileTap)&&(r.tabIndex=0),r.style=o,r}const DM=new Set(["animate","exit","variants","initial","style","values","variants","transition","transformTemplate","transformValues","custom","inherit","onLayoutAnimationStart","onLayoutAnimationComplete","onLayoutMeasure","onBeforeLayoutMeasure","onAnimationStart","onAnimationComplete","onUpdate","onDragStart","onDrag","onDragEnd","onMeasureDragConstraints","onDirectionLock","onDragTransitionEnd","_dragX","_dragY","onHoverStart","onHoverEnd","onViewportEnter","onViewportLeave","ignoreStrict","viewport"]);function yc(e){return e.startsWith("while")||e.startsWith("drag")&&e!=="draggable"||e.startsWith("layout")||e.startsWith("onTap")||e.startsWith("onPan")||DM.has(e)}let yB=e=>!yc(e);function kM(e){e&&(yB=t=>t.startsWith("on")?!yc(t):e(t))}try{kM(require("@emotion/is-prop-valid").default)}catch{}function FM(e,t,n){const r={};for(const o in e)o==="values"&&typeof e.values=="object"||(yB(o)||n===!0&&yc(o)||!t&&!yc(o)||e.draggable&&o.startsWith("onDrag"))&&(r[o]=e[o]);return r}function oE(e,t,n){return typeof e=="string"?e:Me.transform(t+n*e)}function LM(e,t,n){const r=oE(t,e.x,e.width),o=oE(n,e.y,e.height);return`${r} ${o}`}const NM={offset:"stroke-dashoffset",array:"stroke-dasharray"},VM={offset:"strokeDashoffset",array:"strokeDasharray"};function HM(e,t,n=1,r=0,o=!0){e.pathLength=1;const s=o?NM:VM;e[s.offset]=Me.transform(-r);const l=Me.transform(t),u=Me.transform(n);e[s.array]=`${l} ${u}`}function gf(e,{attrX:t,attrY:n,attrScale:r,originX:o,originY:s,pathLength:l,pathSpacing:u=1,pathOffset:A=0,...g},p,C,h){if(Af(e,g,p,h),C){e.style.viewBox&&(e.attrs.viewBox=e.style.viewBox);return}e.attrs=e.style,e.style={};const{attrs:m,style:I,dimensions:B}=e;m.transform&&(B&&(I.transform=m.transform),delete m.transform),B&&(o!==void 0||s!==void 0||I.transform)&&(I.transformOrigin=LM(B,o!==void 0?o:.5,s!==void 0?s:.5)),t!==void 0&&(m.x=t),n!==void 0&&(m.y=n),r!==void 0&&(m.scale=r),l!==void 0&&HM(m,l,u,A,!1)}const bB=()=>({...df(),attrs:{}}),ff=e=>typeof e=="string"&&e.toLowerCase()==="svg";function WM(e,t,n,r){const o=w.useMemo(()=>{const s=bB();return gf(s,t,{enableHardwareAcceleration:!1},ff(r),e.transformTemplate),{...s.attrs,style:{...s.style}}},[t]);if(e.style){const s={};vB(s,e.style,e),o.style={...s,...o.style}}return o}function zM(e=!1){return(n,r,o,{latestValues:s},l)=>{const A=(uf(n)?WM:MM)(r,s,l,n),p={...FM(r,typeof n=="string",e),...A,ref:o},{children:C}=r,h=w.useMemo(()=>vn(C)?C.get():C,[C]);return w.createElement(n,{...p,children:h})}}const pf=e=>e.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase();function QB(e,{style:t,vars:n},r,o){Object.assign(e.style,t,o&&o.getProjectionStyles(r));for(const s in n)e.style.setProperty(s,n[s])}const xB=new Set(["baseFrequency","diffuseConstant","kernelMatrix","kernelUnitLength","keySplines","keyTimes","limitingConeAngle","markerHeight","markerWidth","numOctaves","targetX","targetY","surfaceScale","specularConstant","specularExponent","stdDeviation","tableValues","viewBox","gradientTransform","pathLength","startOffset","textLength","lengthAdjust"]);function wB(e,t,n,r){QB(e,t,void 0,r);for(const o in t.attrs)e.setAttribute(xB.has(o)?o:pf(o),t.attrs[o])}function hf(e,t){const{style:n}=e,r={};for(const o in n)(vn(n[o])||t.style&&vn(t.style[o])||CB(o,e))&&(r[o]=n[o]);return r}function TB(e,t){const n=hf(e,t);for(const r in e)if(vn(e[r])||vn(t[r])){const o=Pa.indexOf(r)!==-1?"attr"+r.charAt(0).toUpperCase()+r.substring(1):r;n[o]=e[r]}return n}function Cf(e,t,n,r={},o={}){return typeof t=="function"&&(t=t(n!==void 0?n:e.custom,r,o)),typeof t=="string"&&(t=e.variants&&e.variants[t]),typeof t=="function"&&(t=t(n!==void 0?n:e.custom,r,o)),t}function UM(e){const t=w.useRef(null);return t.current===null&&(t.current=e()),t.current}const bc=e=>Array.isArray(e),YM=e=>!!(e&&typeof e=="object"&&e.mix&&e.toValue),GM=e=>bc(e)?e[e.length-1]||0:e;function ic(e){const t=vn(e)?e.get():e;return YM(t)?t.toValue():t}function KM({scrapeMotionValuesFromProps:e,createRenderState:t,onMount:n},r,o,s){const l={latestValues:qM(r,o,s,e),renderState:t()};return n&&(l.mount=u=>n(r,u,l)),l}const PB=e=>(t,n)=>{const r=w.useContext(iu),o=w.useContext(af),s=()=>KM(e,t,r,o);return n?s():UM(s)};function qM(e,t,n,r){const o={},s=r(e,{});for(const h in s)o[h]=ic(s[h]);let{initial:l,animate:u}=e;const A=lu(e),g=fB(e);t&&g&&!A&&e.inherit!==!1&&(l===void 0&&(l=t.initial),u===void 0&&(u=t.animate));let p=n?n.initial===!1:!1;p=p||l===!1;const C=p?u:l;return C&&typeof C!="boolean"&&!au(C)&&(Array.isArray(C)?C:[C]).forEach(m=>{const I=Cf(e,m);if(!I)return;const{transitionEnd:B,transition:v,...O}=I;for(const j in O){let x=O[j];if(Array.isArray(x)){const S=p?x.length-1:0;x=x[S]}x!==null&&(o[j]=x)}for(const j in B)o[j]=B[j]}),o}const Dt=e=>e;class iE{constructor(){this.order=[],this.scheduled=new Set}add(t){if(!this.scheduled.has(t))return this.scheduled.add(t),this.order.push(t),!0}remove(t){const n=this.order.indexOf(t);n!==-1&&(this.order.splice(n,1),this.scheduled.delete(t))}clear(){this.order.length=0,this.scheduled.clear()}}function JM(e){let t=new iE,n=new iE,r=0,o=!1,s=!1;const l=new WeakSet,u={schedule:(A,g=!1,p=!1)=>{const C=p&&o,h=C?t:n;return g&&l.add(A),h.add(A)&&C&&o&&(r=t.order.length),A},cancel:A=>{n.remove(A),l.delete(A)},process:A=>{if(o){s=!0;return}if(o=!0,[t,n]=[n,t],n.clear(),r=t.order.length,r)for(let g=0;g<r;g++){const p=t.order[g];p(A),l.has(p)&&(u.schedule(p),e())}o=!1,s&&(s=!1,u.process(A))}};return u}const Wl=["prepare","read","update","preRender","render","postRender"],XM=40;function ZM(e,t){let n=!1,r=!0;const o={delta:0,timestamp:0,isProcessing:!1},s=Wl.reduce((C,h)=>(C[h]=JM(()=>n=!0),C),{}),l=C=>s[C].process(o),u=()=>{const C=performance.now();n=!1,o.delta=r?1e3/60:Math.max(Math.min(C-o.timestamp,XM),1),o.timestamp=C,o.isProcessing=!0,Wl.forEach(l),o.isProcessing=!1,n&&t&&(r=!1,e(u))},A=()=>{n=!0,r=!0,o.isProcessing||e(u)};return{schedule:Wl.reduce((C,h)=>{const m=s[h];return C[h]=(I,B=!1,v=!1)=>(n||A(),m.schedule(I,B,v)),C},{}),cancel:C=>Wl.forEach(h=>s[h].cancel(C)),state:o,steps:s}}const{schedule:vt,cancel:Jr,state:Xt,steps:pd}=ZM(typeof requestAnimationFrame<"u"?requestAnimationFrame:Dt,!0),_M={useVisualState:PB({scrapeMotionValuesFromProps:TB,createRenderState:bB,onMount:(e,t,{renderState:n,latestValues:r})=>{vt.read(()=>{try{n.dimensions=typeof t.getBBox=="function"?t.getBBox():t.getBoundingClientRect()}catch{n.dimensions={x:0,y:0,width:0,height:0}}}),vt.render(()=>{gf(n,r,{enableHardwareAcceleration:!1},ff(t.tagName),e.transformTemplate),wB(t,n)})}})},$M={useVisualState:PB({scrapeMotionValuesFromProps:hf,createRenderState:df})};function e3(e,{forwardMotionProps:t=!1},n,r){return{...uf(e)?_M:$M,preloadedFeatures:n,useRender:zM(t),createVisualElement:r,Component:e}}function Ur(e,t,n,r={passive:!0}){return e.addEventListener(t,n,r),()=>e.removeEventListener(t,n)}const SB=e=>e.pointerType==="mouse"?typeof e.button!="number"||e.button<=0:e.isPrimary!==!1;function uu(e,t="page"){return{point:{x:e[t+"X"],y:e[t+"Y"]}}}const t3=e=>t=>SB(t)&&e(t,uu(t));function Yr(e,t,n,r){return Ur(e,t,t3(n),r)}const n3=(e,t)=>n=>t(e(n)),mo=(...e)=>e.reduce(n3);function RB(e){let t=null;return()=>{const n=()=>{t=null};return t===null?(t=e,n):!1}}const sE=RB("dragHorizontal"),aE=RB("dragVertical");function OB(e){let t=!1;if(e==="y")t=aE();else if(e==="x")t=sE();else{const n=sE(),r=aE();n&&r?t=()=>{n(),r()}:(n&&n(),r&&r())}return t}function jB(){const e=OB(!0);return e?(e(),!1):!0}class xo{constructor(t){this.isMounted=!1,this.node=t}update(){}}function lE(e,t){const n="pointer"+(t?"enter":"leave"),r="onHover"+(t?"Start":"End"),o=(s,l)=>{if(s.type==="touch"||jB())return;const u=e.getProps();e.animationState&&u.whileHover&&e.animationState.setActive("whileHover",t),u[r]&&vt.update(()=>u[r](s,l))};return Yr(e.current,n,o,{passive:!e.getProps()[r]})}class r3 extends xo{mount(){this.unmount=mo(lE(this.node,!0),lE(this.node,!1))}unmount(){}}class o3 extends xo{constructor(){super(...arguments),this.isActive=!1}onFocus(){let t=!1;try{t=this.node.current.matches(":focus-visible")}catch{t=!0}!t||!this.node.animationState||(this.node.animationState.setActive("whileFocus",!0),this.isActive=!0)}onBlur(){!this.isActive||!this.node.animationState||(this.node.animationState.setActive("whileFocus",!1),this.isActive=!1)}mount(){this.unmount=mo(Ur(this.node.current,"focus",()=>this.onFocus()),Ur(this.node.current,"blur",()=>this.onBlur()))}unmount(){}}const MB=(e,t)=>t?e===t?!0:MB(e,t.parentElement):!1;function hd(e,t){if(!t)return;const n=new PointerEvent("pointer"+e);t(n,uu(n))}class i3 extends xo{constructor(){super(...arguments),this.removeStartListeners=Dt,this.removeEndListeners=Dt,this.removeAccessibleListeners=Dt,this.startPointerPress=(t,n)=>{if(this.removeEndListeners(),this.isPressing)return;const r=this.node.getProps(),s=Yr(window,"pointerup",(u,A)=>{if(!this.checkPressEnd())return;const{onTap:g,onTapCancel:p}=this.node.getProps();vt.update(()=>{MB(this.node.current,u.target)?g&&g(u,A):p&&p(u,A)})},{passive:!(r.onTap||r.onPointerUp)}),l=Yr(window,"pointercancel",(u,A)=>this.cancelPress(u,A),{passive:!(r.onTapCancel||r.onPointerCancel)});this.removeEndListeners=mo(s,l),this.startPress(t,n)},this.startAccessiblePress=()=>{const t=s=>{if(s.key!=="Enter"||this.isPressing)return;const l=u=>{u.key!=="Enter"||!this.checkPressEnd()||hd("up",(A,g)=>{const{onTap:p}=this.node.getProps();p&&vt.update(()=>p(A,g))})};this.removeEndListeners(),this.removeEndListeners=Ur(this.node.current,"keyup",l),hd("down",(u,A)=>{this.startPress(u,A)})},n=Ur(this.node.current,"keydown",t),r=()=>{this.isPressing&&hd("cancel",(s,l)=>this.cancelPress(s,l))},o=Ur(this.node.current,"blur",r);this.removeAccessibleListeners=mo(n,o)}}startPress(t,n){this.isPressing=!0;const{onTapStart:r,whileTap:o}=this.node.getProps();o&&this.node.animationState&&this.node.animationState.setActive("whileTap",!0),r&&vt.update(()=>r(t,n))}checkPressEnd(){return this.removeEndListeners(),this.isPressing=!1,this.node.getProps().whileTap&&this.node.animationState&&this.node.animationState.setActive("whileTap",!1),!jB()}cancelPress(t,n){if(!this.checkPressEnd())return;const{onTapCancel:r}=this.node.getProps();r&&vt.update(()=>r(t,n))}mount(){const t=this.node.getProps(),n=Yr(this.node.current,"pointerdown",this.startPointerPress,{passive:!(t.onTapStart||t.onPointerStart)}),r=Ur(this.node.current,"focus",this.startAccessiblePress);this.removeStartListeners=mo(n,r)}unmount(){this.removeStartListeners(),this.removeEndListeners(),this.removeAccessibleListeners()}}const tg=new WeakMap,Cd=new WeakMap,s3=e=>{const t=tg.get(e.target);t&&t(e)},a3=e=>{e.forEach(s3)};function l3({root:e,...t}){const n=e||document;Cd.has(n)||Cd.set(n,{});const r=Cd.get(n),o=JSON.stringify(t);return r[o]||(r[o]=new IntersectionObserver(a3,{root:e,...t})),r[o]}function c3(e,t,n){const r=l3(t);return tg.set(e,n),r.observe(e),()=>{tg.delete(e),r.unobserve(e)}}const u3={some:0,all:1};class A3 extends xo{constructor(){super(...arguments),this.hasEnteredView=!1,this.isInView=!1}startObserver(){this.unmount();const{viewport:t={}}=this.node.getProps(),{root:n,margin:r,amount:o="some",once:s}=t,l={root:n?n.current:void 0,rootMargin:r,threshold:typeof o=="number"?o:u3[o]},u=A=>{const{isIntersecting:g}=A;if(this.isInView===g||(this.isInView=g,s&&!g&&this.hasEnteredView))return;g&&(this.hasEnteredView=!0),this.node.animationState&&this.node.animationState.setActive("whileInView",g);const{onViewportEnter:p,onViewportLeave:C}=this.node.getProps(),h=g?p:C;h&&h(A)};return c3(this.node.current,l,u)}mount(){this.startObserver()}update(){if(typeof IntersectionObserver>"u")return;const{props:t,prevProps:n}=this.node;["amount","margin","root"].some(d3(t,n))&&this.startObserver()}unmount(){}}function d3({viewport:e={}},{viewport:t={}}={}){return n=>e[n]!==t[n]}const g3={inView:{Feature:A3},tap:{Feature:i3},focus:{Feature:o3},hover:{Feature:r3}};function DB(e,t){if(!Array.isArray(t))return!1;const n=t.length;if(n!==e.length)return!1;for(let r=0;r<n;r++)if(t[r]!==e[r])return!1;return!0}function f3(e){const t={};return e.values.forEach((n,r)=>t[r]=n.get()),t}function p3(e){const t={};return e.values.forEach((n,r)=>t[r]=n.getVelocity()),t}function Au(e,t,n){const r=e.getProps();return Cf(r,t,n!==void 0?n:r.custom,f3(e),p3(e))}const h3="framerAppearId",C3="data-"+pf(h3);let Oa=Dt,xr=Dt;process.env.NODE_ENV!=="production"&&(Oa=(e,t)=>{!e&&typeof console<"u"&&console.warn(t)},xr=(e,t)=>{if(!e)throw new Error(t)});const Eo=e=>e*1e3,Gr=e=>e/1e3,m3={current:!1},kB=e=>Array.isArray(e)&&typeof e[0]=="number";function FB(e){return!!(!e||typeof e=="string"&&LB[e]||kB(e)||Array.isArray(e)&&e.every(FB))}const Zs=([e,t,n,r])=>`cubic-bezier(${e}, ${t}, ${n}, ${r})`,LB={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",circIn:Zs([0,.65,.55,1]),circOut:Zs([.55,0,1,.45]),backIn:Zs([.31,.01,.66,-.59]),backOut:Zs([.33,1.53,.69,.99])};function NB(e){if(e)return kB(e)?Zs(e):Array.isArray(e)?e.map(NB):LB[e]}function E3(e,t,n,{delay:r=0,duration:o,repeat:s=0,repeatType:l="loop",ease:u,times:A}={}){const g={[t]:n};A&&(g.offset=A);const p=NB(u);return Array.isArray(p)&&(g.easing=p),e.animate(g,{delay:r,duration:o,easing:Array.isArray(p)?"linear":p,fill:"both",iterations:s+1,direction:l==="reverse"?"alternate":"normal"})}function I3(e,{repeat:t,repeatType:n="loop"}){const r=t&&n!=="loop"&&t%2===1?0:e.length-1;return e[r]}const VB=(e,t,n)=>(((1-3*n+3*t)*e+(3*n-6*t))*e+3*t)*e,B3=1e-7,v3=12;function y3(e,t,n,r,o){let s,l,u=0;do l=t+(n-t)/2,s=VB(l,r,o)-e,s>0?n=l:t=l;while(Math.abs(s)>B3&&++u<v3);return l}function ja(e,t,n,r){if(e===t&&n===r)return Dt;const o=s=>y3(s,0,1,e,n);return s=>s===0||s===1?s:VB(o(s),t,r)}const b3=ja(.42,0,1,1),Q3=ja(0,0,.58,1),HB=ja(.42,0,.58,1),x3=e=>Array.isArray(e)&&typeof e[0]!="number",WB=e=>t=>t<=.5?e(2*t)/2:(2-e(2*(1-t)))/2,zB=e=>t=>1-e(1-t),UB=e=>1-Math.sin(Math.acos(e)),mf=zB(UB),w3=WB(mf),YB=ja(.33,1.53,.69,.99),Ef=zB(YB),T3=WB(Ef),P3=e=>(e*=2)<1?.5*Ef(e):.5*(2-Math.pow(2,-10*(e-1))),cE={linear:Dt,easeIn:b3,easeInOut:HB,easeOut:Q3,circIn:UB,circInOut:w3,circOut:mf,backIn:Ef,backInOut:T3,backOut:YB,anticipate:P3},uE=e=>{if(Array.isArray(e)){xr(e.length===4,"Cubic bezier arrays must contain four numerical values.");const[t,n,r,o]=e;return ja(t,n,r,o)}else if(typeof e=="string")return xr(cE[e]!==void 0,`Invalid easing type '${e}'`),cE[e];return e},If=(e,t)=>n=>!!(Sa(n)&&PM.test(n)&&n.startsWith(e)||t&&Object.prototype.hasOwnProperty.call(n,t)),GB=(e,t,n)=>r=>{if(!Sa(r))return r;const[o,s,l,u]=r.match(cu);return{[e]:parseFloat(o),[t]:parseFloat(s),[n]:parseFloat(l),alpha:u!==void 0?parseFloat(u):1}},S3=e=>Bo(0,255,e),md={...Ai,transform:e=>Math.round(S3(e))},ei={test:If("rgb","red"),parse:GB("red","green","blue"),transform:({red:e,green:t,blue:n,alpha:r=1})=>"rgba("+md.transform(e)+", "+md.transform(t)+", "+md.transform(n)+", "+ra(na.transform(r))+")"};function R3(e){let t="",n="",r="",o="";return e.length>5?(t=e.substring(1,3),n=e.substring(3,5),r=e.substring(5,7),o=e.substring(7,9)):(t=e.substring(1,2),n=e.substring(2,3),r=e.substring(3,4),o=e.substring(4,5),t+=t,n+=n,r+=r,o+=o),{red:parseInt(t,16),green:parseInt(n,16),blue:parseInt(r,16),alpha:o?parseInt(o,16)/255:1}}const ng={test:If("#"),parse:R3,transform:ei.transform},Ui={test:If("hsl","hue"),parse:GB("hue","saturation","lightness"),transform:({hue:e,saturation:t,lightness:n,alpha:r=1})=>"hsla("+Math.round(e)+", "+br.transform(ra(t))+", "+br.transform(ra(n))+", "+ra(na.transform(r))+")"},dn={test:e=>ei.test(e)||ng.test(e)||Ui.test(e),parse:e=>ei.test(e)?ei.parse(e):Ui.test(e)?Ui.parse(e):ng.parse(e),transform:e=>Sa(e)?e:e.hasOwnProperty("red")?ei.transform(e):Ui.transform(e)},St=(e,t,n)=>-n*e+n*t+e;function Ed(e,t,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?e+(t-e)*6*n:n<1/2?t:n<2/3?e+(t-e)*(2/3-n)*6:e}function O3({hue:e,saturation:t,lightness:n,alpha:r}){e/=360,t/=100,n/=100;let o=0,s=0,l=0;if(!t)o=s=l=n;else{const u=n<.5?n*(1+t):n+t-n*t,A=2*n-u;o=Ed(A,u,e+1/3),s=Ed(A,u,e),l=Ed(A,u,e-1/3)}return{red:Math.round(o*255),green:Math.round(s*255),blue:Math.round(l*255),alpha:r}}const Id=(e,t,n)=>{const r=e*e;return Math.sqrt(Math.max(0,n*(t*t-r)+r))},j3=[ng,ei,Ui],M3=e=>j3.find(t=>t.test(e));function AE(e){const t=M3(e);xr(!!t,`'${e}' is not an animatable color. Use the equivalent color code instead.`);let n=t.parse(e);return t===Ui&&(n=O3(n)),n}const KB=(e,t)=>{const n=AE(e),r=AE(t),o={...n};return s=>(o.red=Id(n.red,r.red,s),o.green=Id(n.green,r.green,s),o.blue=Id(n.blue,r.blue,s),o.alpha=St(n.alpha,r.alpha,s),ei.transform(o))};function D3(e){var t,n;return isNaN(e)&&Sa(e)&&(((t=e.match(cu))===null||t===void 0?void 0:t.length)||0)+(((n=e.match(IB))===null||n===void 0?void 0:n.length)||0)>0}const qB={regex:wM,countKey:"Vars",token:"${v}",parse:Dt},JB={regex:IB,countKey:"Colors",token:"${c}",parse:dn.parse},XB={regex:cu,countKey:"Numbers",token:"${n}",parse:Ai.parse};function Bd(e,{regex:t,countKey:n,token:r,parse:o}){const s=e.tokenised.match(t);s&&(e["num"+n]=s.length,e.tokenised=e.tokenised.replace(t,r),e.values.push(...s.map(o)))}function Qc(e){const t=e.toString(),n={value:t,tokenised:t,values:[],numVars:0,numColors:0,numNumbers:0};return n.value.includes("var(--")&&Bd(n,qB),Bd(n,JB),Bd(n,XB),n}function ZB(e){return Qc(e).values}function _B(e){const{values:t,numColors:n,numVars:r,tokenised:o}=Qc(e),s=t.length;return l=>{let u=o;for(let A=0;A<s;A++)A<r?u=u.replace(qB.token,l[A]):A<r+n?u=u.replace(JB.token,dn.transform(l[A])):u=u.replace(XB.token,ra(l[A]));return u}}const k3=e=>typeof e=="number"?0:e;function F3(e){const t=ZB(e);return _B(e)(t.map(k3))}const vo={test:D3,parse:ZB,createTransformer:_B,getAnimatableNone:F3},$B=(e,t)=>n=>`${n>0?t:e}`;function ev(e,t){return typeof e=="number"?n=>St(e,t,n):dn.test(e)?KB(e,t):e.startsWith("var(")?$B(e,t):nv(e,t)}const tv=(e,t)=>{const n=[...e],r=n.length,o=e.map((s,l)=>ev(s,t[l]));return s=>{for(let l=0;l<r;l++)n[l]=o[l](s);return n}},L3=(e,t)=>{const n={...e,...t},r={};for(const o in n)e[o]!==void 0&&t[o]!==void 0&&(r[o]=ev(e[o],t[o]));return o=>{for(const s in r)n[s]=r[s](o);return n}},nv=(e,t)=>{const n=vo.createTransformer(t),r=Qc(e),o=Qc(t);return r.numVars===o.numVars&&r.numColors===o.numColors&&r.numNumbers>=o.numNumbers?mo(tv(r.values,o.values),n):(Oa(!0,`Complex values '${e}' and '${t}' too different to mix. Ensure all colors are of the same type, and that each contains the same quantity of number and color values. Falling back to instant transition.`),$B(e,t))},ha=(e,t,n)=>{const r=t-e;return r===0?1:(n-e)/r},dE=(e,t)=>n=>St(e,t,n);function N3(e){return typeof e=="number"?dE:typeof e=="string"?dn.test(e)?KB:nv:Array.isArray(e)?tv:typeof e=="object"?L3:dE}function V3(e,t,n){const r=[],o=n||N3(e[0]),s=e.length-1;for(let l=0;l<s;l++){let u=o(e[l],e[l+1]);if(t){const A=Array.isArray(t)?t[l]||Dt:t;u=mo(A,u)}r.push(u)}return r}function rv(e,t,{clamp:n=!0,ease:r,mixer:o}={}){const s=e.length;if(xr(s===t.length,"Both input and output ranges must be the same length"),s===1)return()=>t[0];e[0]>e[s-1]&&(e=[...e].reverse(),t=[...t].reverse());const l=V3(t,r,o),u=l.length,A=g=>{let p=0;if(u>1)for(;p<e.length-2&&!(g<e[p+1]);p++);const C=ha(e[p],e[p+1],g);return l[p](C)};return n?g=>A(Bo(e[0],e[s-1],g)):A}function H3(e,t){const n=e[e.length-1];for(let r=1;r<=t;r++){const o=ha(0,t,r);e.push(St(n,1,o))}}function W3(e){const t=[0];return H3(t,e.length-1),t}function z3(e,t){return e.map(n=>n*t)}function U3(e,t){return e.map(()=>t||HB).splice(0,e.length-1)}function xc({duration:e=300,keyframes:t,times:n,ease:r="easeInOut"}){const o=x3(r)?r.map(uE):uE(r),s={done:!1,value:t[0]},l=z3(n&&n.length===t.length?n:W3(t),e),u=rv(l,t,{ease:Array.isArray(o)?o:U3(t,o)});return{calculatedDuration:e,next:A=>(s.value=u(A),s.done=A>=e,s)}}function ov(e,t){return t?e*(1e3/t):0}const Y3=5;function iv(e,t,n){const r=Math.max(t-Y3,0);return ov(n-e(r),t-r)}const vd=.001,G3=.01,gE=10,K3=.05,q3=1;function J3({duration:e=800,bounce:t=.25,velocity:n=0,mass:r=1}){let o,s;Oa(e<=Eo(gE),"Spring duration must be 10 seconds or less");let l=1-t;l=Bo(K3,q3,l),e=Bo(G3,gE,Gr(e)),l<1?(o=g=>{const p=g*l,C=p*e,h=p-n,m=rg(g,l),I=Math.exp(-C);return vd-h/m*I},s=g=>{const C=g*l*e,h=C*n+n,m=Math.pow(l,2)*Math.pow(g,2)*e,I=Math.exp(-C),B=rg(Math.pow(g,2),l);return(-o(g)+vd>0?-1:1)*((h-m)*I)/B}):(o=g=>{const p=Math.exp(-g*e),C=(g-n)*e+1;return-vd+p*C},s=g=>{const p=Math.exp(-g*e),C=(n-g)*(e*e);return p*C});const u=5/e,A=Z3(o,s,u);if(e=Eo(e),isNaN(A))return{stiffness:100,damping:10,duration:e};{const g=Math.pow(A,2)*r;return{stiffness:g,damping:l*2*Math.sqrt(r*g),duration:e}}}const X3=12;function Z3(e,t,n){let r=n;for(let o=1;o<X3;o++)r=r-e(r)/t(r);return r}function rg(e,t){return e*Math.sqrt(1-t*t)}const _3=["duration","bounce"],$3=["stiffness","damping","mass"];function fE(e,t){return t.some(n=>e[n]!==void 0)}function eD(e){let t={velocity:0,stiffness:100,damping:10,mass:1,isResolvedFromDuration:!1,...e};if(!fE(e,$3)&&fE(e,_3)){const n=J3(e);t={...t,...n,velocity:0,mass:1},t.isResolvedFromDuration=!0}return t}function sv({keyframes:e,restDelta:t,restSpeed:n,...r}){const o=e[0],s=e[e.length-1],l={done:!1,value:o},{stiffness:u,damping:A,mass:g,velocity:p,duration:C,isResolvedFromDuration:h}=eD(r),m=p?-Gr(p):0,I=A/(2*Math.sqrt(u*g)),B=s-o,v=Gr(Math.sqrt(u/g)),O=Math.abs(B)<5;n||(n=O?.01:2),t||(t=O?.005:.5);let j;if(I<1){const x=rg(v,I);j=S=>{const P=Math.exp(-I*v*S);return s-P*((m+I*v*B)/x*Math.sin(x*S)+B*Math.cos(x*S))}}else if(I===1)j=x=>s-Math.exp(-v*x)*(B+(m+v*B)*x);else{const x=v*Math.sqrt(I*I-1);j=S=>{const P=Math.exp(-I*v*S),L=Math.min(x*S,300);return s-P*((m+I*v*B)*Math.sinh(L)+x*B*Math.cosh(L))/x}}return{calculatedDuration:h&&C||null,next:x=>{const S=j(x);if(h)l.done=x>=C;else{let P=m;x!==0&&(I<1?P=iv(j,x,S):P=0);const L=Math.abs(P)<=n,k=Math.abs(s-S)<=t;l.done=L&&k}return l.value=l.done?s:S,l}}}function pE({keyframes:e,velocity:t=0,power:n=.8,timeConstant:r=325,bounceDamping:o=10,bounceStiffness:s=500,modifyTarget:l,min:u,max:A,restDelta:g=.5,restSpeed:p}){const C=e[0],h={done:!1,value:C},m=q=>u!==void 0&&q<u||A!==void 0&&q>A,I=q=>u===void 0?A:A===void 0||Math.abs(u-q)<Math.abs(A-q)?u:A;let B=n*t;const v=C+B,O=l===void 0?v:l(v);O!==v&&(B=O-C);const j=q=>-B*Math.exp(-q/r),x=q=>O+j(q),S=q=>{const J=j(q),U=x(q);h.done=Math.abs(J)<=g,h.value=h.done?O:U};let P,L;const k=q=>{m(h.value)&&(P=q,L=sv({keyframes:[h.value,I(h.value)],velocity:iv(x,q,h.value),damping:o,stiffness:s,restDelta:g,restSpeed:p}))};return k(0),{calculatedDuration:null,next:q=>{let J=!1;return!L&&P===void 0&&(J=!0,S(q),k(q)),P!==void 0&&q>P?L.next(q-P):(!J&&S(q),h)}}}const tD=e=>{const t=({timestamp:n})=>e(n);return{start:()=>vt.update(t,!0),stop:()=>Jr(t),now:()=>Xt.isProcessing?Xt.timestamp:performance.now()}},hE=2e4;function CE(e){let t=0;const n=50;let r=e.next(t);for(;!r.done&&t<hE;)t+=n,r=e.next(t);return t>=hE?1/0:t}const nD={decay:pE,inertia:pE,tween:xc,keyframes:xc,spring:sv};function wc({autoplay:e=!0,delay:t=0,driver:n=tD,keyframes:r,type:o="keyframes",repeat:s=0,repeatDelay:l=0,repeatType:u="loop",onPlay:A,onStop:g,onComplete:p,onUpdate:C,...h}){let m=1,I=!1,B,v;const O=()=>{v=new Promise(X=>{B=X})};O();let j;const x=nD[o]||xc;let S;x!==xc&&typeof r[0]!="number"&&(S=rv([0,100],r,{clamp:!1}),r=[0,100]);const P=x({...h,keyframes:r});let L;u==="mirror"&&(L=x({...h,keyframes:[...r].reverse(),velocity:-(h.velocity||0)}));let k="idle",q=null,J=null,U=null;P.calculatedDuration===null&&s&&(P.calculatedDuration=CE(P));const{calculatedDuration:_}=P;let le=1/0,ie=1/0;_!==null&&(le=_+l,ie=le*(s+1)-l);let Z=0;const K=X=>{if(J===null)return;m>0&&(J=Math.min(J,X)),m<0&&(J=Math.min(X-ie/m,J)),q!==null?Z=q:Z=Math.round(X-J)*m;const ge=Z-t*(m>=0?1:-1),pe=m>=0?ge<0:ge>ie;Z=Math.max(ge,0),k==="finished"&&q===null&&(Z=ie);let ce=Z,fe=P;if(s){const Ce=Z/le;let Ie=Math.floor(Ce),Qe=Ce%1;!Qe&&Ce>=1&&(Qe=1),Qe===1&&Ie--,Ie=Math.min(Ie,s+1);const ae=!!(Ie%2);ae&&(u==="reverse"?(Qe=1-Qe,l&&(Qe-=l/le)):u==="mirror"&&(fe=L));let Ne=Bo(0,1,Qe);Z>ie&&(Ne=u==="reverse"&&ae?1:0),ce=Ne*le}const he=pe?{done:!1,value:r[0]}:fe.next(ce);S&&(he.value=S(he.value));let{done:Be}=he;!pe&&_!==null&&(Be=m>=0?Z>=ie:Z<=0);const me=q===null&&(k==="finished"||k==="running"&&Be);return C&&C(he.value),me&&F(),he},V=()=>{j&&j.stop(),j=void 0},G=()=>{k="idle",V(),B(),O(),J=U=null},F=()=>{k="finished",p&&p(),V(),B()},$=()=>{if(I)return;j||(j=n(K));const X=j.now();A&&A(),q!==null?J=X-q:(!J||k==="finished")&&(J=X),k==="finished"&&O(),U=J,q=null,k="running",j.start()};e&&$();const H={then(X,ge){return v.then(X,ge)},get time(){return Gr(Z)},set time(X){X=Eo(X),Z=X,q!==null||!j||m===0?q=X:J=j.now()-X/m},get duration(){const X=P.calculatedDuration===null?CE(P):P.calculatedDuration;return Gr(X)},get speed(){return m},set speed(X){X===m||!j||(m=X,H.time=Gr(Z))},get state(){return k},play:$,pause:()=>{k="paused",q=Z},stop:()=>{I=!0,k!=="idle"&&(k="idle",g&&g(),G())},cancel:()=>{U!==null&&K(U),G()},complete:()=>{k="finished"},sample:X=>(J=0,K(X))};return H}function rD(e){let t;return()=>(t===void 0&&(t=e()),t)}const oD=rD(()=>Object.hasOwnProperty.call(Element.prototype,"animate")),iD=new Set(["opacity","clipPath","filter","transform","backgroundColor"]),zl=10,sD=2e4,aD=(e,t)=>t.type==="spring"||e==="backgroundColor"||!FB(t.ease);function lD(e,t,{onUpdate:n,onComplete:r,...o}){if(!(oD()&&iD.has(t)&&!o.repeatDelay&&o.repeatType!=="mirror"&&o.damping!==0&&o.type!=="inertia"))return!1;let l=!1,u,A;const g=()=>{A=new Promise(j=>{u=j})};g();let{keyframes:p,duration:C=300,ease:h,times:m}=o;if(aD(t,o)){const j=wc({...o,repeat:0,delay:0});let x={done:!1,value:p[0]};const S=[];let P=0;for(;!x.done&&P<sD;)x=j.sample(P),S.push(x.value),P+=zl;m=void 0,p=S,C=P-zl,h="linear"}const I=E3(e.owner.current,t,p,{...o,duration:C,ease:h,times:m});o.syncStart&&(I.startTime=Xt.isProcessing?Xt.timestamp:document.timeline?document.timeline.currentTime:performance.now());const B=()=>I.cancel(),v=()=>{vt.update(B),u(),g()};return I.onfinish=()=>{e.set(I3(p,o)),r&&r(),v()},{then(j,x){return A.then(j,x)},attachTimeline(j){return I.timeline=j,I.onfinish=null,Dt},get time(){return Gr(I.currentTime||0)},set time(j){I.currentTime=Eo(j)},get speed(){return I.playbackRate},set speed(j){I.playbackRate=j},get duration(){return Gr(C)},play:()=>{l||(I.play(),Jr(B))},pause:()=>I.pause(),stop:()=>{if(l=!0,I.playState==="idle")return;const{currentTime:j}=I;if(j){const x=wc({...o,autoplay:!1});e.setWithVelocity(x.sample(j-zl).value,x.sample(j).value,zl)}v()},complete:()=>I.finish(),cancel:v}}function cD({keyframes:e,delay:t,onUpdate:n,onComplete:r}){const o=()=>(n&&n(e[e.length-1]),r&&r(),{time:0,speed:1,duration:0,play:Dt,pause:Dt,stop:Dt,then:s=>(s(),Promise.resolve()),cancel:Dt,complete:Dt});return t?wc({keyframes:[0,1],duration:0,delay:t,onComplete:o}):o()}const uD={type:"spring",stiffness:500,damping:25,restSpeed:10},AD=e=>({type:"spring",stiffness:550,damping:e===0?2*Math.sqrt(550):30,restSpeed:10}),dD={type:"keyframes",duration:.8},gD={type:"keyframes",ease:[.25,.1,.35,1],duration:.3},fD=(e,{keyframes:t})=>t.length>2?dD:ui.has(e)?e.startsWith("scale")?AD(t[1]):uD:gD,og=(e,t)=>e==="zIndex"?!1:!!(typeof t=="number"||Array.isArray(t)||typeof t=="string"&&(vo.test(t)||t==="0")&&!t.startsWith("url(")),pD=new Set(["brightness","contrast","saturate","opacity"]);function hD(e){const[t,n]=e.slice(0,-1).split("(");if(t==="drop-shadow")return e;const[r]=n.match(cu)||[];if(!r)return e;const o=n.replace(r,"");let s=pD.has(t)?1:0;return r!==n&&(s*=100),t+"("+s+o+")"}const CD=/([a-z-]*)\(.*?\)/g,ig={...vo,getAnimatableNone:e=>{const t=e.match(CD);return t?t.map(hD).join(" "):e}},mD={...BB,color:dn,backgroundColor:dn,outlineColor:dn,fill:dn,stroke:dn,borderColor:dn,borderTopColor:dn,borderRightColor:dn,borderBottomColor:dn,borderLeftColor:dn,filter:ig,WebkitFilter:ig},Bf=e=>mD[e];function av(e,t){let n=Bf(e);return n!==ig&&(n=vo),n.getAnimatableNone?n.getAnimatableNone(t):void 0}const lv=e=>/^0[^.\s]+$/.test(e);function ED(e){if(typeof e=="number")return e===0;if(e!==null)return e==="none"||e==="0"||lv(e)}function ID(e,t,n,r){const o=og(t,n);let s;Array.isArray(n)?s=[...n]:s=[null,n];const l=r.from!==void 0?r.from:e.get();let u;const A=[];for(let g=0;g<s.length;g++)s[g]===null&&(s[g]=g===0?l:s[g-1]),ED(s[g])&&A.push(g),typeof s[g]=="string"&&s[g]!=="none"&&s[g]!=="0"&&(u=s[g]);if(o&&A.length&&u)for(let g=0;g<A.length;g++){const p=A[g];s[p]=av(t,u)}return s}function BD({when:e,delay:t,delayChildren:n,staggerChildren:r,staggerDirection:o,repeat:s,repeatType:l,repeatDelay:u,from:A,elapsed:g,...p}){return!!Object.keys(p).length}function cv(e,t){return e[t]||e.default||e}const vf=(e,t,n,r={})=>o=>{const s=cv(r,e)||{},l=s.delay||r.delay||0;let{elapsed:u=0}=r;u=u-Eo(l);const A=ID(t,e,n,s),g=A[0],p=A[A.length-1],C=og(e,g),h=og(e,p);Oa(C===h,`You are trying to animate ${e} from "${g}" to "${p}". ${g} is not an animatable value - to enable this animation set ${g} to a value animatable to ${p} via the \`style\` property.`);let m={keyframes:A,velocity:t.getVelocity(),ease:"easeOut",...s,delay:-u,onUpdate:I=>{t.set(I),s.onUpdate&&s.onUpdate(I)},onComplete:()=>{o(),s.onComplete&&s.onComplete()}};if(BD(s)||(m={...m,...fD(e,m)}),m.duration&&(m.duration=Eo(m.duration)),m.repeatDelay&&(m.repeatDelay=Eo(m.repeatDelay)),!C||!h||m3.current||s.type===!1)return cD(m);if(t.owner&&t.owner.current instanceof HTMLElement&&!t.owner.getProps().onUpdate){const I=lD(t,e,m);if(I)return I}return wc(m)};function Tc(e){return!!(vn(e)&&e.add)}const uv=e=>/^\-?\d*\.?\d+$/.test(e);function yf(e,t){e.indexOf(t)===-1&&e.push(t)}function bf(e,t){const n=e.indexOf(t);n>-1&&e.splice(n,1)}class Qf{constructor(){this.subscriptions=[]}add(t){return yf(this.subscriptions,t),()=>bf(this.subscriptions,t)}notify(t,n,r){const o=this.subscriptions.length;if(o)if(o===1)this.subscriptions[0](t,n,r);else for(let s=0;s<o;s++){const l=this.subscriptions[s];l&&l(t,n,r)}}getSize(){return this.subscriptions.length}clear(){this.subscriptions.length=0}}const mE=new Set;function xf(e,t,n){e||mE.has(t)||(console.warn(t),n&&console.warn(n),mE.add(t))}const vD=e=>!isNaN(parseFloat(e));class yD{constructor(t,n={}){this.version="10.16.4",this.timeDelta=0,this.lastUpdated=0,this.canTrackVelocity=!1,this.events={},this.updateAndNotify=(r,o=!0)=>{this.prev=this.current,this.current=r;const{delta:s,timestamp:l}=Xt;this.lastUpdated!==l&&(this.timeDelta=s,this.lastUpdated=l,vt.postRender(this.scheduleVelocityCheck)),this.prev!==this.current&&this.events.change&&this.events.change.notify(this.current),this.events.velocityChange&&this.events.velocityChange.notify(this.getVelocity()),o&&this.events.renderRequest&&this.events.renderRequest.notify(this.current)},this.scheduleVelocityCheck=()=>vt.postRender(this.velocityCheck),this.velocityCheck=({timestamp:r})=>{r!==this.lastUpdated&&(this.prev=this.current,this.events.velocityChange&&this.events.velocityChange.notify(this.getVelocity()))},this.hasAnimated=!1,this.prev=this.current=t,this.canTrackVelocity=vD(this.current),this.owner=n.owner}onChange(t){return process.env.NODE_ENV!=="production"&&xf(!1,'value.onChange(callback) is deprecated. Switch to value.on("change", callback).'),this.on("change",t)}on(t,n){this.events[t]||(this.events[t]=new Qf);const r=this.events[t].add(n);return t==="change"?()=>{r(),vt.read(()=>{this.events.change.getSize()||this.stop()})}:r}clearListeners(){for(const t in this.events)this.events[t].clear()}attach(t,n){this.passiveEffect=t,this.stopPassiveEffect=n}set(t,n=!0){!n||!this.passiveEffect?this.updateAndNotify(t,n):this.passiveEffect(t,this.updateAndNotify)}setWithVelocity(t,n,r){this.set(n),this.prev=t,this.timeDelta=r}jump(t){this.updateAndNotify(t),this.prev=t,this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}get(){return this.current}getPrevious(){return this.prev}getVelocity(){return this.canTrackVelocity?ov(parseFloat(this.current)-parseFloat(this.prev),this.timeDelta):0}start(t){return this.stop(),new Promise(n=>{this.hasAnimated=!0,this.animation=t(n),this.events.animationStart&&this.events.animationStart.notify()}).then(()=>{this.events.animationComplete&&this.events.animationComplete.notify(),this.clearAnimation()})}stop(){this.animation&&(this.animation.stop(),this.events.animationCancel&&this.events.animationCancel.notify()),this.clearAnimation()}isAnimating(){return!!this.animation}clearAnimation(){delete this.animation}destroy(){this.clearListeners(),this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}}function rs(e,t){return new yD(e,t)}const Av=e=>t=>t.test(e),bD={test:e=>e==="auto",parse:e=>e},dv=[Ai,Me,br,Ao,RM,SM,bD],Us=e=>dv.find(Av(e)),QD=[...dv,dn,vo],xD=e=>QD.find(Av(e));function wD(e,t,n){e.hasValue(t)?e.getValue(t).set(n):e.addValue(t,rs(n))}function TD(e,t){const n=Au(e,t);let{transitionEnd:r={},transition:o={},...s}=n?e.makeTargetAnimatable(n,!1):{};s={...s,...r};for(const l in s){const u=GM(s[l]);wD(e,l,u)}}function PD(e,t,n){var r,o;const s=Object.keys(t).filter(u=>!e.hasValue(u)),l=s.length;if(l)for(let u=0;u<l;u++){const A=s[u],g=t[A];let p=null;Array.isArray(g)&&(p=g[0]),p===null&&(p=(o=(r=n[A])!==null&&r!==void 0?r:e.readValue(A))!==null&&o!==void 0?o:t[A]),p!=null&&(typeof p=="string"&&(uv(p)||lv(p))?p=parseFloat(p):!xD(p)&&vo.test(g)&&(p=av(A,g)),e.addValue(A,rs(p,{owner:e})),n[A]===void 0&&(n[A]=p),p!==null&&e.setBaseTarget(A,p))}}function SD(e,t){return t?(t[e]||t.default||t).from:void 0}function RD(e,t,n){const r={};for(const o in e){const s=SD(o,t);if(s!==void 0)r[o]=s;else{const l=n.getValue(o);l&&(r[o]=l.get())}}return r}function OD({protectedKeys:e,needsAnimating:t},n){const r=e.hasOwnProperty(n)&&t[n]!==!0;return t[n]=!1,r}function gv(e,t,{delay:n=0,transitionOverride:r,type:o}={}){let{transition:s=e.getDefaultTransition(),transitionEnd:l,...u}=e.makeTargetAnimatable(t);const A=e.getValue("willChange");r&&(s=r);const g=[],p=o&&e.animationState&&e.animationState.getState()[o];for(const C in u){const h=e.getValue(C),m=u[C];if(!h||m===void 0||p&&OD(p,C))continue;const I={delay:n,elapsed:0,...s};if(window.HandoffAppearAnimations&&!h.hasAnimated){const v=e.getProps()[C3];v&&(I.elapsed=window.HandoffAppearAnimations(v,C,h,vt),I.syncStart=!0)}h.start(vf(C,h,m,e.shouldReduceMotion&&ui.has(C)?{type:!1}:I));const B=h.animation;Tc(A)&&(A.add(C),B.then(()=>A.remove(C))),g.push(B)}return l&&Promise.all(g).then(()=>{l&&TD(e,l)}),g}function sg(e,t,n={}){const r=Au(e,t,n.custom);let{transition:o=e.getDefaultTransition()||{}}=r||{};n.transitionOverride&&(o=n.transitionOverride);const s=r?()=>Promise.all(gv(e,r,n)):()=>Promise.resolve(),l=e.variantChildren&&e.variantChildren.size?(A=0)=>{const{delayChildren:g=0,staggerChildren:p,staggerDirection:C}=o;return jD(e,t,g+A,p,C,n)}:()=>Promise.resolve(),{when:u}=o;if(u){const[A,g]=u==="beforeChildren"?[s,l]:[l,s];return A().then(()=>g())}else return Promise.all([s(),l(n.delay)])}function jD(e,t,n=0,r=0,o=1,s){const l=[],u=(e.variantChildren.size-1)*r,A=o===1?(g=0)=>g*r:(g=0)=>u-g*r;return Array.from(e.variantChildren).sort(MD).forEach((g,p)=>{g.notify("AnimationStart",t),l.push(sg(g,t,{...s,delay:n+A(p)}).then(()=>g.notify("AnimationComplete",t)))}),Promise.all(l)}function MD(e,t){return e.sortNodePosition(t)}function DD(e,t,n={}){e.notify("AnimationStart",t);let r;if(Array.isArray(t)){const o=t.map(s=>sg(e,s,n));r=Promise.all(o)}else if(typeof t=="string")r=sg(e,t,n);else{const o=typeof t=="function"?Au(e,t,n.custom):t;r=Promise.all(gv(e,o,n))}return r.then(()=>e.notify("AnimationComplete",t))}const kD=[...lf].reverse(),FD=lf.length;function LD(e){return t=>Promise.all(t.map(({animation:n,options:r})=>DD(e,n,r)))}function ND(e){let t=LD(e);const n=HD();let r=!0;const o=(A,g)=>{const p=Au(e,g);if(p){const{transition:C,transitionEnd:h,...m}=p;A={...A,...m,...h}}return A};function s(A){t=A(e)}function l(A,g){const p=e.getProps(),C=e.getVariantContext(!0)||{},h=[],m=new Set;let I={},B=1/0;for(let O=0;O<FD;O++){const j=kD[O],x=n[j],S=p[j]!==void 0?p[j]:C[j],P=fa(S),L=j===g?x.isActive:null;L===!1&&(B=O);let k=S===C[j]&&S!==p[j]&&P;if(k&&r&&e.manuallyAnimateOnMount&&(k=!1),x.protectedKeys={...I},!x.isActive&&L===null||!S&&!x.prevProp||au(S)||typeof S=="boolean")continue;const q=VD(x.prevProp,S);let J=q||j===g&&x.isActive&&!k&&P||O>B&&P;const U=Array.isArray(S)?S:[S];let _=U.reduce(o,{});L===!1&&(_={});const{prevResolvedValues:le={}}=x,ie={...le,..._},Z=K=>{J=!0,m.delete(K),x.needsAnimating[K]=!0};for(const K in ie){const V=_[K],G=le[K];I.hasOwnProperty(K)||(V!==G?bc(V)&&bc(G)?!DB(V,G)||q?Z(K):x.protectedKeys[K]=!0:V!==void 0?Z(K):m.add(K):V!==void 0&&m.has(K)?Z(K):x.protectedKeys[K]=!0)}x.prevProp=S,x.prevResolvedValues=_,x.isActive&&(I={...I,..._}),r&&e.blockInitialAnimation&&(J=!1),J&&!k&&h.push(...U.map(K=>({animation:K,options:{type:j,...A}})))}if(m.size){const O={};m.forEach(j=>{const x=e.getBaseTarget(j);x!==void 0&&(O[j]=x)}),h.push({animation:O})}let v=!!h.length;return r&&p.initial===!1&&!e.manuallyAnimateOnMount&&(v=!1),r=!1,v?t(h):Promise.resolve()}function u(A,g,p){var C;if(n[A].isActive===g)return Promise.resolve();(C=e.variantChildren)===null||C===void 0||C.forEach(m=>{var I;return(I=m.animationState)===null||I===void 0?void 0:I.setActive(A,g)}),n[A].isActive=g;const h=l(p,A);for(const m in n)n[m].protectedKeys={};return h}return{animateChanges:l,setActive:u,setAnimateFunction:s,getState:()=>n}}function VD(e,t){return typeof t=="string"?t!==e:Array.isArray(t)?!DB(t,e):!1}function Uo(e=!1){return{isActive:e,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}function HD(){return{animate:Uo(!0),whileInView:Uo(),whileHover:Uo(),whileTap:Uo(),whileDrag:Uo(),whileFocus:Uo(),exit:Uo()}}class WD extends xo{constructor(t){super(t),t.animationState||(t.animationState=ND(t))}updateAnimationControlsSubscription(){const{animate:t}=this.node.getProps();this.unmount(),au(t)&&(this.unmount=t.subscribe(this.node))}mount(){this.updateAnimationControlsSubscription()}update(){const{animate:t}=this.node.getProps(),{animate:n}=this.node.prevProps||{};t!==n&&this.updateAnimationControlsSubscription()}unmount(){}}let zD=0;class UD extends xo{constructor(){super(...arguments),this.id=zD++}update(){if(!this.node.presenceContext)return;const{isPresent:t,onExitComplete:n,custom:r}=this.node.presenceContext,{isPresent:o}=this.node.prevPresenceContext||{};if(!this.node.animationState||t===o)return;const s=this.node.animationState.setActive("exit",!t,{custom:r??this.node.getProps().custom});n&&!t&&s.then(()=>n(this.id))}mount(){const{register:t}=this.node.presenceContext||{};t&&(this.unmount=t(this.id))}unmount(){}}const YD={animation:{Feature:WD},exit:{Feature:UD}},EE=(e,t)=>Math.abs(e-t);function GD(e,t){const n=EE(e.x,t.x),r=EE(e.y,t.y);return Math.sqrt(n**2+r**2)}class fv{constructor(t,n,{transformPagePoint:r}={}){if(this.startEvent=null,this.lastMoveEvent=null,this.lastMoveEventInfo=null,this.handlers={},this.updatePoint=()=>{if(!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const g=bd(this.lastMoveEventInfo,this.history),p=this.startEvent!==null,C=GD(g.offset,{x:0,y:0})>=3;if(!p&&!C)return;const{point:h}=g,{timestamp:m}=Xt;this.history.push({...h,timestamp:m});const{onStart:I,onMove:B}=this.handlers;p||(I&&I(this.lastMoveEvent,g),this.startEvent=this.lastMoveEvent),B&&B(this.lastMoveEvent,g)},this.handlePointerMove=(g,p)=>{this.lastMoveEvent=g,this.lastMoveEventInfo=yd(p,this.transformPagePoint),vt.update(this.updatePoint,!0)},this.handlePointerUp=(g,p)=>{if(this.end(),!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const{onEnd:C,onSessionEnd:h}=this.handlers,m=bd(g.type==="pointercancel"?this.lastMoveEventInfo:yd(p,this.transformPagePoint),this.history);this.startEvent&&C&&C(g,m),h&&h(g,m)},!SB(t))return;this.handlers=n,this.transformPagePoint=r;const o=uu(t),s=yd(o,this.transformPagePoint),{point:l}=s,{timestamp:u}=Xt;this.history=[{...l,timestamp:u}];const{onSessionStart:A}=n;A&&A(t,bd(s,this.history)),this.removeListeners=mo(Yr(window,"pointermove",this.handlePointerMove),Yr(window,"pointerup",this.handlePointerUp),Yr(window,"pointercancel",this.handlePointerUp))}updateHandlers(t){this.handlers=t}end(){this.removeListeners&&this.removeListeners(),Jr(this.updatePoint)}}function yd(e,t){return t?{point:t(e.point)}:e}function IE(e,t){return{x:e.x-t.x,y:e.y-t.y}}function bd({point:e},t){return{point:e,delta:IE(e,pv(t)),offset:IE(e,KD(t)),velocity:qD(t,.1)}}function KD(e){return e[0]}function pv(e){return e[e.length-1]}function qD(e,t){if(e.length<2)return{x:0,y:0};let n=e.length-1,r=null;const o=pv(e);for(;n>=0&&(r=e[n],!(o.timestamp-r.timestamp>Eo(t)));)n--;if(!r)return{x:0,y:0};const s=Gr(o.timestamp-r.timestamp);if(s===0)return{x:0,y:0};const l={x:(o.x-r.x)/s,y:(o.y-r.y)/s};return l.x===1/0&&(l.x=0),l.y===1/0&&(l.y=0),l}function kn(e){return e.max-e.min}function ag(e,t=0,n=.01){return Math.abs(e-t)<=n}function BE(e,t,n,r=.5){e.origin=r,e.originPoint=St(t.min,t.max,e.origin),e.scale=kn(n)/kn(t),(ag(e.scale,1,1e-4)||isNaN(e.scale))&&(e.scale=1),e.translate=St(n.min,n.max,e.origin)-e.originPoint,(ag(e.translate)||isNaN(e.translate))&&(e.translate=0)}function oa(e,t,n,r){BE(e.x,t.x,n.x,r?r.originX:void 0),BE(e.y,t.y,n.y,r?r.originY:void 0)}function vE(e,t,n){e.min=n.min+t.min,e.max=e.min+kn(t)}function JD(e,t,n){vE(e.x,t.x,n.x),vE(e.y,t.y,n.y)}function yE(e,t,n){e.min=t.min-n.min,e.max=e.min+kn(t)}function ia(e,t,n){yE(e.x,t.x,n.x),yE(e.y,t.y,n.y)}function XD(e,{min:t,max:n},r){return t!==void 0&&e<t?e=r?St(t,e,r.min):Math.max(e,t):n!==void 0&&e>n&&(e=r?St(n,e,r.max):Math.min(e,n)),e}function bE(e,t,n){return{min:t!==void 0?e.min+t:void 0,max:n!==void 0?e.max+n-(e.max-e.min):void 0}}function ZD(e,{top:t,left:n,bottom:r,right:o}){return{x:bE(e.x,n,o),y:bE(e.y,t,r)}}function QE(e,t){let n=t.min-e.min,r=t.max-e.max;return t.max-t.min<e.max-e.min&&([n,r]=[r,n]),{min:n,max:r}}function _D(e,t){return{x:QE(e.x,t.x),y:QE(e.y,t.y)}}function $D(e,t){let n=.5;const r=kn(e),o=kn(t);return o>r?n=ha(t.min,t.max-r,e.min):r>o&&(n=ha(e.min,e.max-o,t.min)),Bo(0,1,n)}function ek(e,t){const n={};return t.min!==void 0&&(n.min=t.min-e.min),t.max!==void 0&&(n.max=t.max-e.min),n}const lg=.35;function tk(e=lg){return e===!1?e=0:e===!0&&(e=lg),{x:xE(e,"left","right"),y:xE(e,"top","bottom")}}function xE(e,t,n){return{min:wE(e,t),max:wE(e,n)}}function wE(e,t){return typeof e=="number"?e:e[t]||0}const TE=()=>({translate:0,scale:1,origin:0,originPoint:0}),Yi=()=>({x:TE(),y:TE()}),PE=()=>({min:0,max:0}),zt=()=>({x:PE(),y:PE()});function Br(e){return[e("x"),e("y")]}function hv({top:e,left:t,right:n,bottom:r}){return{x:{min:t,max:n},y:{min:e,max:r}}}function nk({x:e,y:t}){return{top:t.min,right:e.max,bottom:t.max,left:e.min}}function rk(e,t){if(!t)return e;const n=t({x:e.left,y:e.top}),r=t({x:e.right,y:e.bottom});return{top:n.y,left:n.x,bottom:r.y,right:r.x}}function Qd(e){return e===void 0||e===1}function cg({scale:e,scaleX:t,scaleY:n}){return!Qd(e)||!Qd(t)||!Qd(n)}function qo(e){return cg(e)||Cv(e)||e.z||e.rotate||e.rotateX||e.rotateY}function Cv(e){return SE(e.x)||SE(e.y)}function SE(e){return e&&e!=="0%"}function Pc(e,t,n){const r=e-n,o=t*r;return n+o}function RE(e,t,n,r,o){return o!==void 0&&(e=Pc(e,o,r)),Pc(e,n,r)+t}function ug(e,t=0,n=1,r,o){e.min=RE(e.min,t,n,r,o),e.max=RE(e.max,t,n,r,o)}function mv(e,{x:t,y:n}){ug(e.x,t.translate,t.scale,t.originPoint),ug(e.y,n.translate,n.scale,n.originPoint)}function ok(e,t,n,r=!1){const o=n.length;if(!o)return;t.x=t.y=1;let s,l;for(let u=0;u<o;u++){s=n[u],l=s.projectionDelta;const A=s.instance;A&&A.style&&A.style.display==="contents"||(r&&s.options.layoutScroll&&s.scroll&&s!==s.root&&Gi(e,{x:-s.scroll.offset.x,y:-s.scroll.offset.y}),l&&(t.x*=l.x.scale,t.y*=l.y.scale,mv(e,l)),r&&qo(s.latestValues)&&Gi(e,s.latestValues))}t.x=OE(t.x),t.y=OE(t.y)}function OE(e){return Number.isInteger(e)||e>1.0000000000001||e<.999999999999?e:1}function go(e,t){e.min=e.min+t,e.max=e.max+t}function jE(e,t,[n,r,o]){const s=t[o]!==void 0?t[o]:.5,l=St(e.min,e.max,s);ug(e,t[n],t[r],l,t.scale)}const ik=["x","scaleX","originX"],sk=["y","scaleY","originY"];function Gi(e,t){jE(e.x,t,ik),jE(e.y,t,sk)}function Ev(e,t){return hv(rk(e.getBoundingClientRect(),t))}function ak(e,t,n){const r=Ev(e,n),{scroll:o}=t;return o&&(go(r.x,o.offset.x),go(r.y,o.offset.y)),r}const lk=new WeakMap;class ck{constructor(t){this.openGlobalLock=null,this.isDragging=!1,this.currentDirection=null,this.originPoint={x:0,y:0},this.constraints=!1,this.hasMutatedConstraints=!1,this.elastic=zt(),this.visualElement=t}start(t,{snapToCursor:n=!1}={}){const{presenceContext:r}=this.visualElement;if(r&&r.isPresent===!1)return;const o=A=>{this.stopAnimation(),n&&this.snapToCursor(uu(A,"page").point)},s=(A,g)=>{const{drag:p,dragPropagation:C,onDragStart:h}=this.getProps();if(p&&!C&&(this.openGlobalLock&&this.openGlobalLock(),this.openGlobalLock=OB(p),!this.openGlobalLock))return;this.isDragging=!0,this.currentDirection=null,this.resolveConstraints(),this.visualElement.projection&&(this.visualElement.projection.isAnimationBlocked=!0,this.visualElement.projection.target=void 0),Br(I=>{let B=this.getAxisMotionValue(I).get()||0;if(br.test(B)){const{projection:v}=this.visualElement;if(v&&v.layout){const O=v.layout.layoutBox[I];O&&(B=kn(O)*(parseFloat(B)/100))}}this.originPoint[I]=B}),h&&vt.update(()=>h(A,g),!1,!0);const{animationState:m}=this.visualElement;m&&m.setActive("whileDrag",!0)},l=(A,g)=>{const{dragPropagation:p,dragDirectionLock:C,onDirectionLock:h,onDrag:m}=this.getProps();if(!p&&!this.openGlobalLock)return;const{offset:I}=g;if(C&&this.currentDirection===null){this.currentDirection=uk(I),this.currentDirection!==null&&h&&h(this.currentDirection);return}this.updateAxis("x",g.point,I),this.updateAxis("y",g.point,I),this.visualElement.render(),m&&m(A,g)},u=(A,g)=>this.stop(A,g);this.panSession=new fv(t,{onSessionStart:o,onStart:s,onMove:l,onSessionEnd:u},{transformPagePoint:this.visualElement.getTransformPagePoint()})}stop(t,n){const r=this.isDragging;if(this.cancel(),!r)return;const{velocity:o}=n;this.startAnimation(o);const{onDragEnd:s}=this.getProps();s&&vt.update(()=>s(t,n))}cancel(){this.isDragging=!1;const{projection:t,animationState:n}=this.visualElement;t&&(t.isAnimationBlocked=!1),this.panSession&&this.panSession.end(),this.panSession=void 0;const{dragPropagation:r}=this.getProps();!r&&this.openGlobalLock&&(this.openGlobalLock(),this.openGlobalLock=null),n&&n.setActive("whileDrag",!1)}updateAxis(t,n,r){const{drag:o}=this.getProps();if(!r||!Ul(t,o,this.currentDirection))return;const s=this.getAxisMotionValue(t);let l=this.originPoint[t]+r[t];this.constraints&&this.constraints[t]&&(l=XD(l,this.constraints[t],this.elastic[t])),s.set(l)}resolveConstraints(){const{dragConstraints:t,dragElastic:n}=this.getProps(),{layout:r}=this.visualElement.projection||{},o=this.constraints;t&&zi(t)?this.constraints||(this.constraints=this.resolveRefConstraints()):t&&r?this.constraints=ZD(r.layoutBox,t):this.constraints=!1,this.elastic=tk(n),o!==this.constraints&&r&&this.constraints&&!this.hasMutatedConstraints&&Br(s=>{this.getAxisMotionValue(s)&&(this.constraints[s]=ek(r.layoutBox[s],this.constraints[s]))})}resolveRefConstraints(){const{dragConstraints:t,onMeasureDragConstraints:n}=this.getProps();if(!t||!zi(t))return!1;const r=t.current;xr(r!==null,"If `dragConstraints` is set as a React ref, that ref must be passed to another component's `ref` prop.");const{projection:o}=this.visualElement;if(!o||!o.layout)return!1;const s=ak(r,o.root,this.visualElement.getTransformPagePoint());let l=_D(o.layout.layoutBox,s);if(n){const u=n(nk(l));this.hasMutatedConstraints=!!u,u&&(l=hv(u))}return l}startAnimation(t){const{drag:n,dragMomentum:r,dragElastic:o,dragTransition:s,dragSnapToOrigin:l,onDragTransitionEnd:u}=this.getProps(),A=this.constraints||{},g=Br(p=>{if(!Ul(p,n,this.currentDirection))return;let C=A&&A[p]||{};l&&(C={min:0,max:0});const h=o?200:1e6,m=o?40:1e7,I={type:"inertia",velocity:r?t[p]:0,bounceStiffness:h,bounceDamping:m,timeConstant:750,restDelta:1,restSpeed:10,...s,...C};return this.startAxisValueAnimation(p,I)});return Promise.all(g).then(u)}startAxisValueAnimation(t,n){const r=this.getAxisMotionValue(t);return r.start(vf(t,r,0,n))}stopAnimation(){Br(t=>this.getAxisMotionValue(t).stop())}getAxisMotionValue(t){const n="_drag"+t.toUpperCase(),r=this.visualElement.getProps(),o=r[n];return o||this.visualElement.getValue(t,(r.initial?r.initial[t]:void 0)||0)}snapToCursor(t){Br(n=>{const{drag:r}=this.getProps();if(!Ul(n,r,this.currentDirection))return;const{projection:o}=this.visualElement,s=this.getAxisMotionValue(n);if(o&&o.layout){const{min:l,max:u}=o.layout.layoutBox[n];s.set(t[n]-St(l,u,.5))}})}scalePositionWithinConstraints(){if(!this.visualElement.current)return;const{drag:t,dragConstraints:n}=this.getProps(),{projection:r}=this.visualElement;if(!zi(n)||!r||!this.constraints)return;this.stopAnimation();const o={x:0,y:0};Br(l=>{const u=this.getAxisMotionValue(l);if(u){const A=u.get();o[l]=$D({min:A,max:A},this.constraints[l])}});const{transformTemplate:s}=this.visualElement.getProps();this.visualElement.current.style.transform=s?s({},""):"none",r.root&&r.root.updateScroll(),r.updateLayout(),this.resolveConstraints(),Br(l=>{if(!Ul(l,t,null))return;const u=this.getAxisMotionValue(l),{min:A,max:g}=this.constraints[l];u.set(St(A,g,o[l]))})}addListeners(){if(!this.visualElement.current)return;lk.set(this.visualElement,this);const t=this.visualElement.current,n=Yr(t,"pointerdown",A=>{const{drag:g,dragListener:p=!0}=this.getProps();g&&p&&this.start(A)}),r=()=>{const{dragConstraints:A}=this.getProps();zi(A)&&(this.constraints=this.resolveRefConstraints())},{projection:o}=this.visualElement,s=o.addEventListener("measure",r);o&&!o.layout&&(o.root&&o.root.updateScroll(),o.updateLayout()),r();const l=Ur(window,"resize",()=>this.scalePositionWithinConstraints()),u=o.addEventListener("didUpdate",({delta:A,hasLayoutChanged:g})=>{this.isDragging&&g&&(Br(p=>{const C=this.getAxisMotionValue(p);C&&(this.originPoint[p]+=A[p].translate,C.set(C.get()+A[p].translate))}),this.visualElement.render())});return()=>{l(),n(),s(),u&&u()}}getProps(){const t=this.visualElement.getProps(),{drag:n=!1,dragDirectionLock:r=!1,dragPropagation:o=!1,dragConstraints:s=!1,dragElastic:l=lg,dragMomentum:u=!0}=t;return{...t,drag:n,dragDirectionLock:r,dragPropagation:o,dragConstraints:s,dragElastic:l,dragMomentum:u}}}function Ul(e,t,n){return(t===!0||t===e)&&(n===null||n===e)}function uk(e,t=10){let n=null;return Math.abs(e.y)>t?n="y":Math.abs(e.x)>t&&(n="x"),n}class Ak extends xo{constructor(t){super(t),this.removeGroupControls=Dt,this.removeListeners=Dt,this.controls=new ck(t)}mount(){const{dragControls:t}=this.node.getProps();t&&(this.removeGroupControls=t.subscribe(this.controls)),this.removeListeners=this.controls.addListeners()||Dt}unmount(){this.removeGroupControls(),this.removeListeners()}}const ME=e=>(t,n)=>{e&&vt.update(()=>e(t,n))};class dk extends xo{constructor(){super(...arguments),this.removePointerDownListener=Dt}onPointerDown(t){this.session=new fv(t,this.createPanHandlers(),{transformPagePoint:this.node.getTransformPagePoint()})}createPanHandlers(){const{onPanSessionStart:t,onPanStart:n,onPan:r,onPanEnd:o}=this.node.getProps();return{onSessionStart:ME(t),onStart:ME(n),onMove:r,onEnd:(s,l)=>{delete this.session,o&&vt.update(()=>o(s,l))}}}mount(){this.removePointerDownListener=Yr(this.node.current,"pointerdown",t=>this.onPointerDown(t))}update(){this.session&&this.session.updateHandlers(this.createPanHandlers())}unmount(){this.removePointerDownListener(),this.session&&this.session.end()}}function gk(){const e=w.useContext(af);if(e===null)return[!0,null];const{isPresent:t,onExitComplete:n,register:r}=e,o=w.useId();return w.useEffect(()=>r(o),[]),!t&&n?[!1,()=>n&&n(o)]:[!0]}const sc={hasAnimatedSinceResize:!0,hasEverUpdated:!1};function DE(e,t){return t.max===t.min?0:e/(t.max-t.min)*100}const Ys={correct:(e,t)=>{if(!t.target)return e;if(typeof e=="string")if(Me.test(e))e=parseFloat(e);else return e;const n=DE(e,t.target.x),r=DE(e,t.target.y);return`${n}% ${r}%`}},fk={correct:(e,{treeScale:t,projectionDelta:n})=>{const r=e,o=vo.parse(e);if(o.length>5)return r;const s=vo.createTransformer(e),l=typeof o[0]!="number"?1:0,u=n.x.scale*t.x,A=n.y.scale*t.y;o[0+l]/=u,o[1+l]/=A;const g=St(u,A,.5);return typeof o[2+l]=="number"&&(o[2+l]/=g),typeof o[3+l]=="number"&&(o[3+l]/=g),s(o)}};class pk extends w.Component{componentDidMount(){const{visualElement:t,layoutGroup:n,switchLayoutGroup:r,layoutId:o}=this.props,{projection:s}=t;yM(hk),s&&(n.group&&n.group.add(s),r&&r.register&&o&&r.register(s),s.root.didUpdate(),s.addEventListener("animationComplete",()=>{this.safeToRemove()}),s.setOptions({...s.options,onExitComplete:()=>this.safeToRemove()})),sc.hasEverUpdated=!0}getSnapshotBeforeUpdate(t){const{layoutDependency:n,visualElement:r,drag:o,isPresent:s}=this.props,l=r.projection;return l&&(l.isPresent=s,o||t.layoutDependency!==n||n===void 0?l.willUpdate():this.safeToRemove(),t.isPresent!==s&&(s?l.promote():l.relegate()||vt.postRender(()=>{const u=l.getStack();(!u||!u.members.length)&&this.safeToRemove()}))),null}componentDidUpdate(){const{projection:t}=this.props.visualElement;t&&(t.root.didUpdate(),queueMicrotask(()=>{!t.currentAnimation&&t.isLead()&&this.safeToRemove()}))}componentWillUnmount(){const{visualElement:t,layoutGroup:n,switchLayoutGroup:r}=this.props,{projection:o}=t;o&&(o.scheduleCheckAfterUnmount(),n&&n.group&&n.group.remove(o),r&&r.deregister&&r.deregister(o))}safeToRemove(){const{safeToRemove:t}=this.props;t&&t()}render(){return null}}function Iv(e){const[t,n]=gk(),r=w.useContext(pB);return w.createElement(pk,{...e,layoutGroup:r,switchLayoutGroup:w.useContext(hB),isPresent:t,safeToRemove:n})}const hk={borderRadius:{...Ys,applyTo:["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"]},borderTopLeftRadius:Ys,borderTopRightRadius:Ys,borderBottomLeftRadius:Ys,borderBottomRightRadius:Ys,boxShadow:fk},Bv=["TopLeft","TopRight","BottomLeft","BottomRight"],Ck=Bv.length,kE=e=>typeof e=="string"?parseFloat(e):e,FE=e=>typeof e=="number"||Me.test(e);function mk(e,t,n,r,o,s){o?(e.opacity=St(0,n.opacity!==void 0?n.opacity:1,Ek(r)),e.opacityExit=St(t.opacity!==void 0?t.opacity:1,0,Ik(r))):s&&(e.opacity=St(t.opacity!==void 0?t.opacity:1,n.opacity!==void 0?n.opacity:1,r));for(let l=0;l<Ck;l++){const u=`border${Bv[l]}Radius`;let A=LE(t,u),g=LE(n,u);if(A===void 0&&g===void 0)continue;A||(A=0),g||(g=0),A===0||g===0||FE(A)===FE(g)?(e[u]=Math.max(St(kE(A),kE(g),r),0),(br.test(g)||br.test(A))&&(e[u]+="%")):e[u]=g}(t.rotate||n.rotate)&&(e.rotate=St(t.rotate||0,n.rotate||0,r))}function LE(e,t){return e[t]!==void 0?e[t]:e.borderRadius}const Ek=vv(0,.5,mf),Ik=vv(.5,.95,Dt);function vv(e,t,n){return r=>r<e?0:r>t?1:n(ha(e,t,r))}function NE(e,t){e.min=t.min,e.max=t.max}function qn(e,t){NE(e.x,t.x),NE(e.y,t.y)}function VE(e,t,n,r,o){return e-=t,e=Pc(e,1/n,r),o!==void 0&&(e=Pc(e,1/o,r)),e}function Bk(e,t=0,n=1,r=.5,o,s=e,l=e){if(br.test(t)&&(t=parseFloat(t),t=St(l.min,l.max,t/100)-l.min),typeof t!="number")return;let u=St(s.min,s.max,r);e===s&&(u-=t),e.min=VE(e.min,t,n,u,o),e.max=VE(e.max,t,n,u,o)}function HE(e,t,[n,r,o],s,l){Bk(e,t[n],t[r],t[o],t.scale,s,l)}const vk=["x","scaleX","originX"],yk=["y","scaleY","originY"];function WE(e,t,n,r){HE(e.x,t,vk,n?n.x:void 0,r?r.x:void 0),HE(e.y,t,yk,n?n.y:void 0,r?r.y:void 0)}function zE(e){return e.translate===0&&e.scale===1}function yv(e){return zE(e.x)&&zE(e.y)}function bk(e,t){return e.x.min===t.x.min&&e.x.max===t.x.max&&e.y.min===t.y.min&&e.y.max===t.y.max}function bv(e,t){return Math.round(e.x.min)===Math.round(t.x.min)&&Math.round(e.x.max)===Math.round(t.x.max)&&Math.round(e.y.min)===Math.round(t.y.min)&&Math.round(e.y.max)===Math.round(t.y.max)}function UE(e){return kn(e.x)/kn(e.y)}class Qk{constructor(){this.members=[]}add(t){yf(this.members,t),t.scheduleRender()}remove(t){if(bf(this.members,t),t===this.prevLead&&(this.prevLead=void 0),t===this.lead){const n=this.members[this.members.length-1];n&&this.promote(n)}}relegate(t){const n=this.members.findIndex(o=>t===o);if(n===0)return!1;let r;for(let o=n;o>=0;o--){const s=this.members[o];if(s.isPresent!==!1){r=s;break}}return r?(this.promote(r),!0):!1}promote(t,n){const r=this.lead;if(t!==r&&(this.prevLead=r,this.lead=t,t.show(),r)){r.instance&&r.scheduleRender(),t.scheduleRender(),t.resumeFrom=r,n&&(t.resumeFrom.preserveOpacity=!0),r.snapshot&&(t.snapshot=r.snapshot,t.snapshot.latestValues=r.animationValues||r.latestValues),t.root&&t.root.isUpdating&&(t.isLayoutDirty=!0);const{crossfade:o}=t.options;o===!1&&r.hide()}}exitAnimationComplete(){this.members.forEach(t=>{const{options:n,resumingFrom:r}=t;n.onExitComplete&&n.onExitComplete(),r&&r.options.onExitComplete&&r.options.onExitComplete()})}scheduleRender(){this.members.forEach(t=>{t.instance&&t.scheduleRender(!1)})}removeLeadSnapshot(){this.lead&&this.lead.snapshot&&(this.lead.snapshot=void 0)}}function YE(e,t,n){let r="";const o=e.x.translate/t.x,s=e.y.translate/t.y;if((o||s)&&(r=`translate3d(${o}px, ${s}px, 0) `),(t.x!==1||t.y!==1)&&(r+=`scale(${1/t.x}, ${1/t.y}) `),n){const{rotate:A,rotateX:g,rotateY:p}=n;A&&(r+=`rotate(${A}deg) `),g&&(r+=`rotateX(${g}deg) `),p&&(r+=`rotateY(${p}deg) `)}const l=e.x.scale*t.x,u=e.y.scale*t.y;return(l!==1||u!==1)&&(r+=`scale(${l}, ${u})`),r||"none"}const xk=(e,t)=>e.depth-t.depth;class wk{constructor(){this.children=[],this.isDirty=!1}add(t){yf(this.children,t),this.isDirty=!0}remove(t){bf(this.children,t),this.isDirty=!0}forEach(t){this.isDirty&&this.children.sort(xk),this.isDirty=!1,this.children.forEach(t)}}function Tk(e,t){const n=performance.now(),r=({timestamp:o})=>{const s=o-n;s>=t&&(Jr(r),e(s-t))};return vt.read(r,!0),()=>Jr(r)}function Pk(e){window.MotionDebug&&window.MotionDebug.record(e)}function Sk(e){return e instanceof SVGElement&&e.tagName!=="svg"}function Rk(e,t,n){const r=vn(e)?e:rs(e);return r.start(vf("",r,t,n)),r.animation}const GE=["","X","Y","Z"],KE=1e3;let Ok=0;const Jo={type:"projectionFrame",totalNodes:0,resolvedTargetDeltas:0,recalculatedProjection:0};function Qv({attachResizeListener:e,defaultParent:t,measureScroll:n,checkIsScrollRoot:r,resetTransform:o}){return class{constructor(l={},u=t==null?void 0:t()){this.id=Ok++,this.animationId=0,this.children=new Set,this.options={},this.isTreeAnimating=!1,this.isAnimationBlocked=!1,this.isLayoutDirty=!1,this.isProjectionDirty=!1,this.isSharedProjectionDirty=!1,this.isTransformDirty=!1,this.updateManuallyBlocked=!1,this.updateBlockedByResize=!1,this.isUpdating=!1,this.isSVG=!1,this.needsReset=!1,this.shouldResetTransform=!1,this.treeScale={x:1,y:1},this.eventHandlers=new Map,this.hasTreeAnimated=!1,this.updateScheduled=!1,this.checkUpdateFailed=()=>{this.isUpdating&&(this.isUpdating=!1,this.clearAllSnapshots())},this.updateProjection=()=>{Jo.totalNodes=Jo.resolvedTargetDeltas=Jo.recalculatedProjection=0,this.nodes.forEach(Dk),this.nodes.forEach(Vk),this.nodes.forEach(Hk),this.nodes.forEach(kk),Pk(Jo)},this.hasProjected=!1,this.isVisible=!0,this.animationProgress=0,this.sharedNodes=new Map,this.latestValues=l,this.root=u?u.root||u:this,this.path=u?[...u.path,u]:[],this.parent=u,this.depth=u?u.depth+1:0;for(let A=0;A<this.path.length;A++)this.path[A].shouldResetTransform=!0;this.root===this&&(this.nodes=new wk)}addEventListener(l,u){return this.eventHandlers.has(l)||this.eventHandlers.set(l,new Qf),this.eventHandlers.get(l).add(u)}notifyListeners(l,...u){const A=this.eventHandlers.get(l);A&&A.notify(...u)}hasListeners(l){return this.eventHandlers.has(l)}mount(l,u=this.root.hasTreeAnimated){if(this.instance)return;this.isSVG=Sk(l),this.instance=l;const{layoutId:A,layout:g,visualElement:p}=this.options;if(p&&!p.current&&p.mount(l),this.root.nodes.add(this),this.parent&&this.parent.children.add(this),u&&(g||A)&&(this.isLayoutDirty=!0),e){let C;const h=()=>this.root.updateBlockedByResize=!1;e(l,()=>{this.root.updateBlockedByResize=!0,C&&C(),C=Tk(h,250),sc.hasAnimatedSinceResize&&(sc.hasAnimatedSinceResize=!1,this.nodes.forEach(JE))})}A&&this.root.registerSharedNode(A,this),this.options.animate!==!1&&p&&(A||g)&&this.addEventListener("didUpdate",({delta:C,hasLayoutChanged:h,hasRelativeTargetChanged:m,layout:I})=>{if(this.isTreeAnimationBlocked()){this.target=void 0,this.relativeTarget=void 0;return}const B=this.options.transition||p.getDefaultTransition()||Gk,{onLayoutAnimationStart:v,onLayoutAnimationComplete:O}=p.getProps(),j=!this.targetLayout||!bv(this.targetLayout,I)||m,x=!h&&m;if(this.options.layoutRoot||this.resumeFrom&&this.resumeFrom.instance||x||h&&(j||!this.currentAnimation)){this.resumeFrom&&(this.resumingFrom=this.resumeFrom,this.resumingFrom.resumingFrom=void 0),this.setAnimationOrigin(C,x);const S={...cv(B,"layout"),onPlay:v,onComplete:O};(p.shouldReduceMotion||this.options.layoutRoot)&&(S.delay=0,S.type=!1),this.startAnimation(S)}else h||JE(this),this.isLead()&&this.options.onExitComplete&&this.options.onExitComplete();this.targetLayout=I})}unmount(){this.options.layoutId&&this.willUpdate(),this.root.nodes.remove(this);const l=this.getStack();l&&l.remove(this),this.parent&&this.parent.children.delete(this),this.instance=void 0,Jr(this.updateProjection)}blockUpdate(){this.updateManuallyBlocked=!0}unblockUpdate(){this.updateManuallyBlocked=!1}isUpdateBlocked(){return this.updateManuallyBlocked||this.updateBlockedByResize}isTreeAnimationBlocked(){return this.isAnimationBlocked||this.parent&&this.parent.isTreeAnimationBlocked()||!1}startUpdate(){this.isUpdateBlocked()||(this.isUpdating=!0,this.nodes&&this.nodes.forEach(Wk),this.animationId++)}getTransformTemplate(){const{visualElement:l}=this.options;return l&&l.getProps().transformTemplate}willUpdate(l=!0){if(this.root.hasTreeAnimated=!0,this.root.isUpdateBlocked()){this.options.onExitComplete&&this.options.onExitComplete();return}if(!this.root.isUpdating&&this.root.startUpdate(),this.isLayoutDirty)return;this.isLayoutDirty=!0;for(let p=0;p<this.path.length;p++){const C=this.path[p];C.shouldResetTransform=!0,C.updateScroll("snapshot"),C.options.layoutRoot&&C.willUpdate(!1)}const{layoutId:u,layout:A}=this.options;if(u===void 0&&!A)return;const g=this.getTransformTemplate();this.prevTransformTemplateValue=g?g(this.latestValues,""):void 0,this.updateSnapshot(),l&&this.notifyListeners("willUpdate")}update(){if(this.updateScheduled=!1,this.isUpdateBlocked()){this.unblockUpdate(),this.clearAllSnapshots(),this.nodes.forEach(qE);return}this.isUpdating||this.nodes.forEach(Lk),this.isUpdating=!1,this.nodes.forEach(Nk),this.nodes.forEach(jk),this.nodes.forEach(Mk),this.clearAllSnapshots();const u=performance.now();Xt.delta=Bo(0,1e3/60,u-Xt.timestamp),Xt.timestamp=u,Xt.isProcessing=!0,pd.update.process(Xt),pd.preRender.process(Xt),pd.render.process(Xt),Xt.isProcessing=!1}didUpdate(){this.updateScheduled||(this.updateScheduled=!0,queueMicrotask(()=>this.update()))}clearAllSnapshots(){this.nodes.forEach(Fk),this.sharedNodes.forEach(zk)}scheduleUpdateProjection(){vt.preRender(this.updateProjection,!1,!0)}scheduleCheckAfterUnmount(){vt.postRender(()=>{this.isLayoutDirty?this.root.didUpdate():this.root.checkUpdateFailed()})}updateSnapshot(){this.snapshot||!this.instance||(this.snapshot=this.measure())}updateLayout(){if(!this.instance||(this.updateScroll(),!(this.options.alwaysMeasureLayout&&this.isLead())&&!this.isLayoutDirty))return;if(this.resumeFrom&&!this.resumeFrom.instance)for(let A=0;A<this.path.length;A++)this.path[A].updateScroll();const l=this.layout;this.layout=this.measure(!1),this.layoutCorrected=zt(),this.isLayoutDirty=!1,this.projectionDelta=void 0,this.notifyListeners("measure",this.layout.layoutBox);const{visualElement:u}=this.options;u&&u.notify("LayoutMeasure",this.layout.layoutBox,l?l.layoutBox:void 0)}updateScroll(l="measure"){let u=!!(this.options.layoutScroll&&this.instance);this.scroll&&this.scroll.animationId===this.root.animationId&&this.scroll.phase===l&&(u=!1),u&&(this.scroll={animationId:this.root.animationId,phase:l,isRoot:r(this.instance),offset:n(this.instance)})}resetTransform(){if(!o)return;const l=this.isLayoutDirty||this.shouldResetTransform,u=this.projectionDelta&&!yv(this.projectionDelta),A=this.getTransformTemplate(),g=A?A(this.latestValues,""):void 0,p=g!==this.prevTransformTemplateValue;l&&(u||qo(this.latestValues)||p)&&(o(this.instance,g),this.shouldResetTransform=!1,this.scheduleRender())}measure(l=!0){const u=this.measurePageBox();let A=this.removeElementScroll(u);return l&&(A=this.removeTransform(A)),Kk(A),{animationId:this.root.animationId,measuredBox:u,layoutBox:A,latestValues:{},source:this.id}}measurePageBox(){const{visualElement:l}=this.options;if(!l)return zt();const u=l.measureViewportBox(),{scroll:A}=this.root;return A&&(go(u.x,A.offset.x),go(u.y,A.offset.y)),u}removeElementScroll(l){const u=zt();qn(u,l);for(let A=0;A<this.path.length;A++){const g=this.path[A],{scroll:p,options:C}=g;if(g!==this.root&&p&&C.layoutScroll){if(p.isRoot){qn(u,l);const{scroll:h}=this.root;h&&(go(u.x,-h.offset.x),go(u.y,-h.offset.y))}go(u.x,p.offset.x),go(u.y,p.offset.y)}}return u}applyTransform(l,u=!1){const A=zt();qn(A,l);for(let g=0;g<this.path.length;g++){const p=this.path[g];!u&&p.options.layoutScroll&&p.scroll&&p!==p.root&&Gi(A,{x:-p.scroll.offset.x,y:-p.scroll.offset.y}),qo(p.latestValues)&&Gi(A,p.latestValues)}return qo(this.latestValues)&&Gi(A,this.latestValues),A}removeTransform(l){const u=zt();qn(u,l);for(let A=0;A<this.path.length;A++){const g=this.path[A];if(!g.instance||!qo(g.latestValues))continue;cg(g.latestValues)&&g.updateSnapshot();const p=zt(),C=g.measurePageBox();qn(p,C),WE(u,g.latestValues,g.snapshot?g.snapshot.layoutBox:void 0,p)}return qo(this.latestValues)&&WE(u,this.latestValues),u}setTargetDelta(l){this.targetDelta=l,this.root.scheduleUpdateProjection(),this.isProjectionDirty=!0}setOptions(l){this.options={...this.options,...l,crossfade:l.crossfade!==void 0?l.crossfade:!0}}clearMeasurements(){this.scroll=void 0,this.layout=void 0,this.snapshot=void 0,this.prevTransformTemplateValue=void 0,this.targetDelta=void 0,this.target=void 0,this.isLayoutDirty=!1}forceRelativeParentToResolveTarget(){this.relativeParent&&this.relativeParent.resolvedRelativeTargetAt!==Xt.timestamp&&this.relativeParent.resolveTargetDelta(!0)}resolveTargetDelta(l=!1){var u;const A=this.getLead();this.isProjectionDirty||(this.isProjectionDirty=A.isProjectionDirty),this.isTransformDirty||(this.isTransformDirty=A.isTransformDirty),this.isSharedProjectionDirty||(this.isSharedProjectionDirty=A.isSharedProjectionDirty);const g=!!this.resumingFrom||this!==A;if(!(l||g&&this.isSharedProjectionDirty||this.isProjectionDirty||!((u=this.parent)===null||u===void 0)&&u.isProjectionDirty||this.attemptToResolveRelativeTarget))return;const{layout:C,layoutId:h}=this.options;if(!(!this.layout||!(C||h))){if(this.resolvedRelativeTargetAt=Xt.timestamp,!this.targetDelta&&!this.relativeTarget){const m=this.getClosestProjectingParent();m&&m.layout&&this.animationProgress!==1?(this.relativeParent=m,this.forceRelativeParentToResolveTarget(),this.relativeTarget=zt(),this.relativeTargetOrigin=zt(),ia(this.relativeTargetOrigin,this.layout.layoutBox,m.layout.layoutBox),qn(this.relativeTarget,this.relativeTargetOrigin)):this.relativeParent=this.relativeTarget=void 0}if(!(!this.relativeTarget&&!this.targetDelta)){if(this.target||(this.target=zt(),this.targetWithTransforms=zt()),this.relativeTarget&&this.relativeTargetOrigin&&this.relativeParent&&this.relativeParent.target?(this.forceRelativeParentToResolveTarget(),JD(this.target,this.relativeTarget,this.relativeParent.target)):this.targetDelta?(this.resumingFrom?this.target=this.applyTransform(this.layout.layoutBox):qn(this.target,this.layout.layoutBox),mv(this.target,this.targetDelta)):qn(this.target,this.layout.layoutBox),this.attemptToResolveRelativeTarget){this.attemptToResolveRelativeTarget=!1;const m=this.getClosestProjectingParent();m&&!!m.resumingFrom==!!this.resumingFrom&&!m.options.layoutScroll&&m.target&&this.animationProgress!==1?(this.relativeParent=m,this.forceRelativeParentToResolveTarget(),this.relativeTarget=zt(),this.relativeTargetOrigin=zt(),ia(this.relativeTargetOrigin,this.target,m.target),qn(this.relativeTarget,this.relativeTargetOrigin)):this.relativeParent=this.relativeTarget=void 0}Jo.resolvedTargetDeltas++}}}getClosestProjectingParent(){if(!(!this.parent||cg(this.parent.latestValues)||Cv(this.parent.latestValues)))return this.parent.isProjecting()?this.parent:this.parent.getClosestProjectingParent()}isProjecting(){return!!((this.relativeTarget||this.targetDelta||this.options.layoutRoot)&&this.layout)}calcProjection(){var l;const u=this.getLead(),A=!!this.resumingFrom||this!==u;let g=!0;if((this.isProjectionDirty||!((l=this.parent)===null||l===void 0)&&l.isProjectionDirty)&&(g=!1),A&&(this.isSharedProjectionDirty||this.isTransformDirty)&&(g=!1),this.resolvedRelativeTargetAt===Xt.timestamp&&(g=!1),g)return;const{layout:p,layoutId:C}=this.options;if(this.isTreeAnimating=!!(this.parent&&this.parent.isTreeAnimating||this.currentAnimation||this.pendingAnimation),this.isTreeAnimating||(this.targetDelta=this.relativeTarget=void 0),!this.layout||!(p||C))return;qn(this.layoutCorrected,this.layout.layoutBox);const h=this.treeScale.x,m=this.treeScale.y;ok(this.layoutCorrected,this.treeScale,this.path,A),u.layout&&!u.target&&(this.treeScale.x!==1||this.treeScale.y!==1)&&(u.target=u.layout.layoutBox);const{target:I}=u;if(!I){this.projectionTransform&&(this.projectionDelta=Yi(),this.projectionTransform="none",this.scheduleRender());return}this.projectionDelta||(this.projectionDelta=Yi(),this.projectionDeltaWithTransform=Yi());const B=this.projectionTransform;oa(this.projectionDelta,this.layoutCorrected,I,this.latestValues),this.projectionTransform=YE(this.projectionDelta,this.treeScale),(this.projectionTransform!==B||this.treeScale.x!==h||this.treeScale.y!==m)&&(this.hasProjected=!0,this.scheduleRender(),this.notifyListeners("projectionUpdate",I)),Jo.recalculatedProjection++}hide(){this.isVisible=!1}show(){this.isVisible=!0}scheduleRender(l=!0){if(this.options.scheduleRender&&this.options.scheduleRender(),l){const u=this.getStack();u&&u.scheduleRender()}this.resumingFrom&&!this.resumingFrom.instance&&(this.resumingFrom=void 0)}setAnimationOrigin(l,u=!1){const A=this.snapshot,g=A?A.latestValues:{},p={...this.latestValues},C=Yi();(!this.relativeParent||!this.relativeParent.options.layoutRoot)&&(this.relativeTarget=this.relativeTargetOrigin=void 0),this.attemptToResolveRelativeTarget=!u;const h=zt(),m=A?A.source:void 0,I=this.layout?this.layout.source:void 0,B=m!==I,v=this.getStack(),O=!v||v.members.length<=1,j=!!(B&&!O&&this.options.crossfade===!0&&!this.path.some(Yk));this.animationProgress=0;let x;this.mixTargetDelta=S=>{const P=S/1e3;XE(C.x,l.x,P),XE(C.y,l.y,P),this.setTargetDelta(C),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&this.relativeParent&&this.relativeParent.layout&&(ia(h,this.layout.layoutBox,this.relativeParent.layout.layoutBox),Uk(this.relativeTarget,this.relativeTargetOrigin,h,P),x&&bk(this.relativeTarget,x)&&(this.isProjectionDirty=!1),x||(x=zt()),qn(x,this.relativeTarget)),B&&(this.animationValues=p,mk(p,g,this.latestValues,P,j,O)),this.root.scheduleUpdateProjection(),this.scheduleRender(),this.animationProgress=P},this.mixTargetDelta(this.options.layoutRoot?1e3:0)}startAnimation(l){this.notifyListeners("animationStart"),this.currentAnimation&&this.currentAnimation.stop(),this.resumingFrom&&this.resumingFrom.currentAnimation&&this.resumingFrom.currentAnimation.stop(),this.pendingAnimation&&(Jr(this.pendingAnimation),this.pendingAnimation=void 0),this.pendingAnimation=vt.update(()=>{sc.hasAnimatedSinceResize=!0,this.currentAnimation=Rk(0,KE,{...l,onUpdate:u=>{this.mixTargetDelta(u),l.onUpdate&&l.onUpdate(u)},onComplete:()=>{l.onComplete&&l.onComplete(),this.completeAnimation()}}),this.resumingFrom&&(this.resumingFrom.currentAnimation=this.currentAnimation),this.pendingAnimation=void 0})}completeAnimation(){this.resumingFrom&&(this.resumingFrom.currentAnimation=void 0,this.resumingFrom.preserveOpacity=void 0);const l=this.getStack();l&&l.exitAnimationComplete(),this.resumingFrom=this.currentAnimation=this.animationValues=void 0,this.notifyListeners("animationComplete")}finishAnimation(){this.currentAnimation&&(this.mixTargetDelta&&this.mixTargetDelta(KE),this.currentAnimation.stop()),this.completeAnimation()}applyTransformsToTarget(){const l=this.getLead();let{targetWithTransforms:u,target:A,layout:g,latestValues:p}=l;if(!(!u||!A||!g)){if(this!==l&&this.layout&&g&&xv(this.options.animationType,this.layout.layoutBox,g.layoutBox)){A=this.target||zt();const C=kn(this.layout.layoutBox.x);A.x.min=l.target.x.min,A.x.max=A.x.min+C;const h=kn(this.layout.layoutBox.y);A.y.min=l.target.y.min,A.y.max=A.y.min+h}qn(u,A),Gi(u,p),oa(this.projectionDeltaWithTransform,this.layoutCorrected,u,p)}}registerSharedNode(l,u){this.sharedNodes.has(l)||this.sharedNodes.set(l,new Qk),this.sharedNodes.get(l).add(u);const g=u.options.initialPromotionConfig;u.promote({transition:g?g.transition:void 0,preserveFollowOpacity:g&&g.shouldPreserveFollowOpacity?g.shouldPreserveFollowOpacity(u):void 0})}isLead(){const l=this.getStack();return l?l.lead===this:!0}getLead(){var l;const{layoutId:u}=this.options;return u?((l=this.getStack())===null||l===void 0?void 0:l.lead)||this:this}getPrevLead(){var l;const{layoutId:u}=this.options;return u?(l=this.getStack())===null||l===void 0?void 0:l.prevLead:void 0}getStack(){const{layoutId:l}=this.options;if(l)return this.root.sharedNodes.get(l)}promote({needsReset:l,transition:u,preserveFollowOpacity:A}={}){const g=this.getStack();g&&g.promote(this,A),l&&(this.projectionDelta=void 0,this.needsReset=!0),u&&this.setOptions({transition:u})}relegate(){const l=this.getStack();return l?l.relegate(this):!1}resetRotation(){const{visualElement:l}=this.options;if(!l)return;let u=!1;const{latestValues:A}=l;if((A.rotate||A.rotateX||A.rotateY||A.rotateZ)&&(u=!0),!u)return;const g={};for(let p=0;p<GE.length;p++){const C="rotate"+GE[p];A[C]&&(g[C]=A[C],l.setStaticValue(C,0))}l.render();for(const p in g)l.setStaticValue(p,g[p]);l.scheduleRender()}getProjectionStyles(l={}){var u,A;const g={};if(!this.instance||this.isSVG)return g;if(this.isVisible)g.visibility="";else return{visibility:"hidden"};const p=this.getTransformTemplate();if(this.needsReset)return this.needsReset=!1,g.opacity="",g.pointerEvents=ic(l.pointerEvents)||"",g.transform=p?p(this.latestValues,""):"none",g;const C=this.getLead();if(!this.projectionDelta||!this.layout||!C.target){const B={};return this.options.layoutId&&(B.opacity=this.latestValues.opacity!==void 0?this.latestValues.opacity:1,B.pointerEvents=ic(l.pointerEvents)||""),this.hasProjected&&!qo(this.latestValues)&&(B.transform=p?p({},""):"none",this.hasProjected=!1),B}const h=C.animationValues||C.latestValues;this.applyTransformsToTarget(),g.transform=YE(this.projectionDeltaWithTransform,this.treeScale,h),p&&(g.transform=p(h,g.transform));const{x:m,y:I}=this.projectionDelta;g.transformOrigin=`${m.origin*100}% ${I.origin*100}% 0`,C.animationValues?g.opacity=C===this?(A=(u=h.opacity)!==null&&u!==void 0?u:this.latestValues.opacity)!==null&&A!==void 0?A:1:this.preserveOpacity?this.latestValues.opacity:h.opacityExit:g.opacity=C===this?h.opacity!==void 0?h.opacity:"":h.opacityExit!==void 0?h.opacityExit:0;for(const B in vc){if(h[B]===void 0)continue;const{correct:v,applyTo:O}=vc[B],j=g.transform==="none"?h[B]:v(h[B],C);if(O){const x=O.length;for(let S=0;S<x;S++)g[O[S]]=j}else g[B]=j}return this.options.layoutId&&(g.pointerEvents=C===this?ic(l.pointerEvents)||"":"none"),g}clearSnapshot(){this.resumeFrom=this.snapshot=void 0}resetTree(){this.root.nodes.forEach(l=>{var u;return(u=l.currentAnimation)===null||u===void 0?void 0:u.stop()}),this.root.nodes.forEach(qE),this.root.sharedNodes.clear()}}}function jk(e){e.updateLayout()}function Mk(e){var t;const n=((t=e.resumeFrom)===null||t===void 0?void 0:t.snapshot)||e.snapshot;if(e.isLead()&&e.layout&&n&&e.hasListeners("didUpdate")){const{layoutBox:r,measuredBox:o}=e.layout,{animationType:s}=e.options,l=n.source!==e.layout.source;s==="size"?Br(C=>{const h=l?n.measuredBox[C]:n.layoutBox[C],m=kn(h);h.min=r[C].min,h.max=h.min+m}):xv(s,n.layoutBox,r)&&Br(C=>{const h=l?n.measuredBox[C]:n.layoutBox[C],m=kn(r[C]);h.max=h.min+m,e.relativeTarget&&!e.currentAnimation&&(e.isProjectionDirty=!0,e.relativeTarget[C].max=e.relativeTarget[C].min+m)});const u=Yi();oa(u,r,n.layoutBox);const A=Yi();l?oa(A,e.applyTransform(o,!0),n.measuredBox):oa(A,r,n.layoutBox);const g=!yv(u);let p=!1;if(!e.resumeFrom){const C=e.getClosestProjectingParent();if(C&&!C.resumeFrom){const{snapshot:h,layout:m}=C;if(h&&m){const I=zt();ia(I,n.layoutBox,h.layoutBox);const B=zt();ia(B,r,m.layoutBox),bv(I,B)||(p=!0),C.options.layoutRoot&&(e.relativeTarget=B,e.relativeTargetOrigin=I,e.relativeParent=C)}}}e.notifyListeners("didUpdate",{layout:r,snapshot:n,delta:A,layoutDelta:u,hasLayoutChanged:g,hasRelativeTargetChanged:p})}else if(e.isLead()){const{onExitComplete:r}=e.options;r&&r()}e.options.transition=void 0}function Dk(e){Jo.totalNodes++,e.parent&&(e.isProjecting()||(e.isProjectionDirty=e.parent.isProjectionDirty),e.isSharedProjectionDirty||(e.isSharedProjectionDirty=!!(e.isProjectionDirty||e.parent.isProjectionDirty||e.parent.isSharedProjectionDirty)),e.isTransformDirty||(e.isTransformDirty=e.parent.isTransformDirty))}function kk(e){e.isProjectionDirty=e.isSharedProjectionDirty=e.isTransformDirty=!1}function Fk(e){e.clearSnapshot()}function qE(e){e.clearMeasurements()}function Lk(e){e.isLayoutDirty=!1}function Nk(e){const{visualElement:t}=e.options;t&&t.getProps().onBeforeLayoutMeasure&&t.notify("BeforeLayoutMeasure"),e.resetTransform()}function JE(e){e.finishAnimation(),e.targetDelta=e.relativeTarget=e.target=void 0,e.isProjectionDirty=!0}function Vk(e){e.resolveTargetDelta()}function Hk(e){e.calcProjection()}function Wk(e){e.resetRotation()}function zk(e){e.removeLeadSnapshot()}function XE(e,t,n){e.translate=St(t.translate,0,n),e.scale=St(t.scale,1,n),e.origin=t.origin,e.originPoint=t.originPoint}function ZE(e,t,n,r){e.min=St(t.min,n.min,r),e.max=St(t.max,n.max,r)}function Uk(e,t,n,r){ZE(e.x,t.x,n.x,r),ZE(e.y,t.y,n.y,r)}function Yk(e){return e.animationValues&&e.animationValues.opacityExit!==void 0}const Gk={duration:.45,ease:[.4,0,.1,1]},_E=e=>typeof navigator<"u"&&navigator.userAgent.toLowerCase().includes(e),$E=_E("applewebkit/")&&!_E("chrome/")?Math.round:Dt;function eI(e){e.min=$E(e.min),e.max=$E(e.max)}function Kk(e){eI(e.x),eI(e.y)}function xv(e,t,n){return e==="position"||e==="preserve-aspect"&&!ag(UE(t),UE(n),.2)}const qk=Qv({attachResizeListener:(e,t)=>Ur(e,"resize",t),measureScroll:()=>({x:document.documentElement.scrollLeft||document.body.scrollLeft,y:document.documentElement.scrollTop||document.body.scrollTop}),checkIsScrollRoot:()=>!0}),xd={current:void 0},wv=Qv({measureScroll:e=>({x:e.scrollLeft,y:e.scrollTop}),defaultParent:()=>{if(!xd.current){const e=new qk({});e.mount(window),e.setOptions({layoutScroll:!0}),xd.current=e}return xd.current},resetTransform:(e,t)=>{e.style.transform=t!==void 0?t:"none"},checkIsScrollRoot:e=>window.getComputedStyle(e).position==="fixed"}),Jk={pan:{Feature:dk},drag:{Feature:Ak,ProjectionNode:wv,MeasureLayout:Iv}},Xk=/var\((--[a-zA-Z0-9-_]+),? ?([a-zA-Z0-9 ()%#.,-]+)?\)/;function Zk(e){const t=Xk.exec(e);if(!t)return[,];const[,n,r]=t;return[n,r]}const _k=4;function Ag(e,t,n=1){xr(n<=_k,`Max CSS variable fallback depth detected in property "${e}". This may indicate a circular fallback dependency.`);const[r,o]=Zk(e);if(!r)return;const s=window.getComputedStyle(t).getPropertyValue(r);if(s){const l=s.trim();return uv(l)?parseFloat(l):l}else return eg(o)?Ag(o,t,n+1):o}function $k(e,{...t},n){const r=e.current;if(!(r instanceof Element))return{target:t,transitionEnd:n};n&&(n={...n}),e.values.forEach(o=>{const s=o.get();if(!eg(s))return;const l=Ag(s,r);l&&o.set(l)});for(const o in t){const s=t[o];if(!eg(s))continue;const l=Ag(s,r);l&&(t[o]=l,n||(n={}),n[o]===void 0&&(n[o]=s))}return{target:t,transitionEnd:n}}const e5=new Set(["width","height","top","left","right","bottom","x","y","translateX","translateY"]),Tv=e=>e5.has(e),t5=e=>Object.keys(e).some(Tv),Yl=e=>e===Ai||e===Me,tI=(e,t)=>parseFloat(e.split(", ")[t]),nI=(e,t)=>(n,{transform:r})=>{if(r==="none"||!r)return 0;const o=r.match(/^matrix3d\((.+)\)$/);if(o)return tI(o[1],t);{const s=r.match(/^matrix\((.+)\)$/);return s?tI(s[1],e):0}},n5=new Set(["x","y","z"]),r5=Pa.filter(e=>!n5.has(e));function o5(e){const t=[];return r5.forEach(n=>{const r=e.getValue(n);r!==void 0&&(t.push([n,r.get()]),r.set(n.startsWith("scale")?1:0))}),t.length&&e.render(),t}const os={width:({x:e},{paddingLeft:t="0",paddingRight:n="0"})=>e.max-e.min-parseFloat(t)-parseFloat(n),height:({y:e},{paddingTop:t="0",paddingBottom:n="0"})=>e.max-e.min-parseFloat(t)-parseFloat(n),top:(e,{top:t})=>parseFloat(t),left:(e,{left:t})=>parseFloat(t),bottom:({y:e},{top:t})=>parseFloat(t)+(e.max-e.min),right:({x:e},{left:t})=>parseFloat(t)+(e.max-e.min),x:nI(4,13),y:nI(5,14)};os.translateX=os.x;os.translateY=os.y;const i5=(e,t,n)=>{const r=t.measureViewportBox(),o=t.current,s=getComputedStyle(o),{display:l}=s,u={};l==="none"&&t.setStaticValue("display",e.display||"block"),n.forEach(g=>{u[g]=os[g](r,s)}),t.render();const A=t.measureViewportBox();return n.forEach(g=>{const p=t.getValue(g);p&&p.jump(u[g]),e[g]=os[g](A,s)}),e},s5=(e,t,n={},r={})=>{t={...t},r={...r};const o=Object.keys(t).filter(Tv);let s=[],l=!1;const u=[];if(o.forEach(A=>{const g=e.getValue(A);if(!e.hasValue(A))return;let p=n[A],C=Us(p);const h=t[A];let m;if(bc(h)){const I=h.length,B=h[0]===null?1:0;p=h[B],C=Us(p);for(let v=B;v<I&&h[v]!==null;v++)m?xr(Us(h[v])===m,"All keyframes must be of the same type"):(m=Us(h[v]),xr(m===C||Yl(C)&&Yl(m),"Keyframes must be of the same dimension as the current value"))}else m=Us(h);if(C!==m)if(Yl(C)&&Yl(m)){const I=g.get();typeof I=="string"&&g.set(parseFloat(I)),typeof h=="string"?t[A]=parseFloat(h):Array.isArray(h)&&m===Me&&(t[A]=h.map(parseFloat))}else C!=null&&C.transform&&(m!=null&&m.transform)&&(p===0||h===0)?p===0?g.set(m.transform(p)):t[A]=C.transform(h):(l||(s=o5(e),l=!0),u.push(A),r[A]=r[A]!==void 0?r[A]:t[A],g.jump(h))}),u.length){const A=u.indexOf("height")>=0?window.pageYOffset:null,g=i5(t,e,u);return s.length&&s.forEach(([p,C])=>{e.getValue(p).set(C)}),e.render(),su&&A!==null&&window.scrollTo({top:A}),{target:g,transitionEnd:r}}else return{target:t,transitionEnd:r}};function a5(e,t,n,r){return t5(t)?s5(e,t,n,r):{target:t,transitionEnd:r}}const l5=(e,t,n,r)=>{const o=$k(e,t,r);return t=o.target,r=o.transitionEnd,a5(e,t,n,r)},dg={current:null},Pv={current:!1};function c5(){if(Pv.current=!0,!!su)if(window.matchMedia){const e=window.matchMedia("(prefers-reduced-motion)"),t=()=>dg.current=e.matches;e.addListener(t),t()}else dg.current=!1}function u5(e,t,n){const{willChange:r}=t;for(const o in t){const s=t[o],l=n[o];if(vn(s))e.addValue(o,s),Tc(r)&&r.add(o),process.env.NODE_ENV==="development"&&xf(s.version==="10.16.4",`Attempting to mix Framer Motion versions ${s.version} with 10.16.4 may not work as expected.`);else if(vn(l))e.addValue(o,rs(s,{owner:e})),Tc(r)&&r.remove(o);else if(l!==s)if(e.hasValue(o)){const u=e.getValue(o);!u.hasAnimated&&u.set(s)}else{const u=e.getStaticValue(o);e.addValue(o,rs(u!==void 0?u:s,{owner:e}))}}for(const o in n)t[o]===void 0&&e.removeValue(o);return t}const rI=new WeakMap,Sv=Object.keys(pa),A5=Sv.length,oI=["AnimationStart","AnimationComplete","Update","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"],d5=cf.length;class g5{constructor({parent:t,props:n,presenceContext:r,reducedMotionConfig:o,visualState:s},l={}){this.current=null,this.children=new Set,this.isVariantNode=!1,this.isControllingVariants=!1,this.shouldReduceMotion=null,this.values=new Map,this.features={},this.valueSubscriptions=new Map,this.prevMotionValues={},this.events={},this.propEventSubscriptions={},this.notifyUpdate=()=>this.notify("Update",this.latestValues),this.render=()=>{this.current&&(this.triggerBuild(),this.renderInstance(this.current,this.renderState,this.props.style,this.projection))},this.scheduleRender=()=>vt.render(this.render,!1,!0);const{latestValues:u,renderState:A}=s;this.latestValues=u,this.baseTarget={...u},this.initialValues=n.initial?{...u}:{},this.renderState=A,this.parent=t,this.props=n,this.presenceContext=r,this.depth=t?t.depth+1:0,this.reducedMotionConfig=o,this.options=l,this.isControllingVariants=lu(n),this.isVariantNode=fB(n),this.isVariantNode&&(this.variantChildren=new Set),this.manuallyAnimateOnMount=!!(t&&t.current);const{willChange:g,...p}=this.scrapeMotionValuesFromProps(n,{});for(const C in p){const h=p[C];u[C]!==void 0&&vn(h)&&(h.set(u[C],!1),Tc(g)&&g.add(C))}}scrapeMotionValuesFromProps(t,n){return{}}mount(t){this.current=t,rI.set(t,this),this.projection&&!this.projection.instance&&this.projection.mount(t),this.parent&&this.isVariantNode&&!this.isControllingVariants&&(this.removeFromVariantTree=this.parent.addVariantChild(this)),this.values.forEach((n,r)=>this.bindToMotionValue(r,n)),Pv.current||c5(),this.shouldReduceMotion=this.reducedMotionConfig==="never"?!1:this.reducedMotionConfig==="always"?!0:dg.current,process.env.NODE_ENV!=="production"&&xf(this.shouldReduceMotion!==!0,"You have Reduced Motion enabled on your device. Animations may not appear as expected."),this.parent&&this.parent.children.add(this),this.update(this.props,this.presenceContext)}unmount(){rI.delete(this.current),this.projection&&this.projection.unmount(),Jr(this.notifyUpdate),Jr(this.render),this.valueSubscriptions.forEach(t=>t()),this.removeFromVariantTree&&this.removeFromVariantTree(),this.parent&&this.parent.children.delete(this);for(const t in this.events)this.events[t].clear();for(const t in this.features)this.features[t].unmount();this.current=null}bindToMotionValue(t,n){const r=ui.has(t),o=n.on("change",l=>{this.latestValues[t]=l,this.props.onUpdate&&vt.update(this.notifyUpdate,!1,!0),r&&this.projection&&(this.projection.isTransformDirty=!0)}),s=n.on("renderRequest",this.scheduleRender);this.valueSubscriptions.set(t,()=>{o(),s()})}sortNodePosition(t){return!this.current||!this.sortInstanceNodePosition||this.type!==t.type?0:this.sortInstanceNodePosition(this.current,t.current)}loadFeatures({children:t,...n},r,o,s){let l,u;if(process.env.NODE_ENV!=="production"&&o&&r){const A="You have rendered a `motion` component within a `LazyMotion` component. This will break tree shaking. Import and render a `m` component instead.";n.ignoreStrict?Oa(!1,A):xr(!1,A)}for(let A=0;A<A5;A++){const g=Sv[A],{isEnabled:p,Feature:C,ProjectionNode:h,MeasureLayout:m}=pa[g];h&&(l=h),p(n)&&(!this.features[g]&&C&&(this.features[g]=new C(this)),m&&(u=m))}if(!this.projection&&l){this.projection=new l(this.latestValues,this.parent&&this.parent.projection);const{layoutId:A,layout:g,drag:p,dragConstraints:C,layoutScroll:h,layoutRoot:m}=n;this.projection.setOptions({layoutId:A,layout:g,alwaysMeasureLayout:!!p||C&&zi(C),visualElement:this,scheduleRender:()=>this.scheduleRender(),animationType:typeof g=="string"?g:"both",initialPromotionConfig:s,layoutScroll:h,layoutRoot:m})}return u}updateFeatures(){for(const t in this.features){const n=this.features[t];n.isMounted?n.update():(n.mount(),n.isMounted=!0)}}triggerBuild(){this.build(this.renderState,this.latestValues,this.options,this.props)}measureViewportBox(){return this.current?this.measureInstanceViewportBox(this.current,this.props):zt()}getStaticValue(t){return this.latestValues[t]}setStaticValue(t,n){this.latestValues[t]=n}makeTargetAnimatable(t,n=!0){return this.makeTargetAnimatableFromInstance(t,this.props,n)}update(t,n){(t.transformTemplate||this.props.transformTemplate)&&this.scheduleRender(),this.prevProps=this.props,this.props=t,this.prevPresenceContext=this.presenceContext,this.presenceContext=n;for(let r=0;r<oI.length;r++){const o=oI[r];this.propEventSubscriptions[o]&&(this.propEventSubscriptions[o](),delete this.propEventSubscriptions[o]);const s=t["on"+o];s&&(this.propEventSubscriptions[o]=this.on(o,s))}this.prevMotionValues=u5(this,this.scrapeMotionValuesFromProps(t,this.prevProps),this.prevMotionValues),this.handleChildMotionValue&&this.handleChildMotionValue()}getProps(){return this.props}getVariant(t){return this.props.variants?this.props.variants[t]:void 0}getDefaultTransition(){return this.props.transition}getTransformPagePoint(){return this.props.transformPagePoint}getClosestVariantNode(){return this.isVariantNode?this:this.parent?this.parent.getClosestVariantNode():void 0}getVariantContext(t=!1){if(t)return this.parent?this.parent.getVariantContext():void 0;if(!this.isControllingVariants){const r=this.parent?this.parent.getVariantContext()||{}:{};return this.props.initial!==void 0&&(r.initial=this.props.initial),r}const n={};for(let r=0;r<d5;r++){const o=cf[r],s=this.props[o];(fa(s)||s===!1)&&(n[o]=s)}return n}addVariantChild(t){const n=this.getClosestVariantNode();if(n)return n.variantChildren&&n.variantChildren.add(t),()=>n.variantChildren.delete(t)}addValue(t,n){n!==this.values.get(t)&&(this.removeValue(t),this.bindToMotionValue(t,n)),this.values.set(t,n),this.latestValues[t]=n.get()}removeValue(t){this.values.delete(t);const n=this.valueSubscriptions.get(t);n&&(n(),this.valueSubscriptions.delete(t)),delete this.latestValues[t],this.removeValueFromRenderState(t,this.renderState)}hasValue(t){return this.values.has(t)}getValue(t,n){if(this.props.values&&this.props.values[t])return this.props.values[t];let r=this.values.get(t);return r===void 0&&n!==void 0&&(r=rs(n,{owner:this}),this.addValue(t,r)),r}readValue(t){var n;return this.latestValues[t]!==void 0||!this.current?this.latestValues[t]:(n=this.getBaseTargetFromProps(this.props,t))!==null&&n!==void 0?n:this.readValueFromInstance(this.current,t,this.options)}setBaseTarget(t,n){this.baseTarget[t]=n}getBaseTarget(t){var n;const{initial:r}=this.props,o=typeof r=="string"||typeof r=="object"?(n=Cf(this.props,r))===null||n===void 0?void 0:n[t]:void 0;if(r&&o!==void 0)return o;const s=this.getBaseTargetFromProps(this.props,t);return s!==void 0&&!vn(s)?s:this.initialValues[t]!==void 0&&o===void 0?void 0:this.baseTarget[t]}on(t,n){return this.events[t]||(this.events[t]=new Qf),this.events[t].add(n)}notify(t,...n){this.events[t]&&this.events[t].notify(...n)}}class Rv extends g5{sortInstanceNodePosition(t,n){return t.compareDocumentPosition(n)&2?1:-1}getBaseTargetFromProps(t,n){return t.style?t.style[n]:void 0}removeValueFromRenderState(t,{vars:n,style:r}){delete n[t],delete r[t]}makeTargetAnimatableFromInstance({transition:t,transitionEnd:n,...r},{transformValues:o},s){let l=RD(r,t||{},this);if(o&&(n&&(n=o(n)),r&&(r=o(r)),l&&(l=o(l))),s){PD(this,r,l);const u=l5(this,r,l,n);n=u.transitionEnd,r=u.target}return{transition:t,transitionEnd:n,...r}}}function f5(e){return window.getComputedStyle(e)}class p5 extends Rv{readValueFromInstance(t,n){if(ui.has(n)){const r=Bf(n);return r&&r.default||0}else{const r=f5(t),o=(EB(n)?r.getPropertyValue(n):r[n])||0;return typeof o=="string"?o.trim():o}}measureInstanceViewportBox(t,{transformPagePoint:n}){return Ev(t,n)}build(t,n,r,o){Af(t,n,r,o.transformTemplate)}scrapeMotionValuesFromProps(t,n){return hf(t,n)}handleChildMotionValue(){this.childSubscription&&(this.childSubscription(),delete this.childSubscription);const{children:t}=this.props;vn(t)&&(this.childSubscription=t.on("change",n=>{this.current&&(this.current.textContent=`${n}`)}))}renderInstance(t,n,r,o){QB(t,n,r,o)}}class h5 extends Rv{constructor(){super(...arguments),this.isSVGTag=!1}getBaseTargetFromProps(t,n){return t[n]}readValueFromInstance(t,n){if(ui.has(n)){const r=Bf(n);return r&&r.default||0}return n=xB.has(n)?n:pf(n),t.getAttribute(n)}measureInstanceViewportBox(){return zt()}scrapeMotionValuesFromProps(t,n){return TB(t,n)}build(t,n,r,o){gf(t,n,r,this.isSVGTag,o.transformTemplate)}renderInstance(t,n,r,o){wB(t,n,r,o)}mount(t){this.isSVGTag=ff(t.tagName),super.mount(t)}}const C5=(e,t)=>uf(e)?new h5(t,{enableHardwareAcceleration:!1}):new p5(t,{enableHardwareAcceleration:!0}),m5={layout:{ProjectionNode:wv,MeasureLayout:Iv}},E5={...YD,...g3,...Jk,...m5},Gl=BM((e,t)=>e3(e,t,E5,C5)),I5=(e,t,n)=>{const r=t-e;return((n-e)%r+r)%r+e};function iI(...e){const t=w.useRef(0),[n,r]=w.useState(e[t.current]),o=w.useCallback(s=>{t.current=typeof s!="number"?I5(0,e.length,t.current+1):s,r(e[t.current])},[e.length,...e]);return[n,o]}function Ov({children:e,type:t="scale",direction:n="right",offset:r=10,scale:o={hover:1.05,tap:.95}}){let s,l;switch(n){case"up":case"left":s=r,l=0;break;case"right":case"down":default:s=0,l=r;break}const[u,A]=iI(s,l),[g,p]=iI(s,l);switch(t){case"rotate":return f.jsx(Gl.div,{animate:{rotate:360},transition:{repeat:1/0,repeatType:"loop",duration:2,repeatDelay:0},children:e});case"slide":return n==="up"||n==="down"?f.jsx(Gl.div,{animate:{y:g!==void 0?g:""},onHoverEnd:()=>p(),onHoverStart:()=>p(),children:e}):f.jsx(Gl.div,{animate:{x:u!==void 0?u:""},onHoverEnd:()=>A(),onHoverStart:()=>A(),children:e});case"scale":default:return typeof o=="number"&&(o={hover:o,tap:o}),f.jsx(Gl.div,{whileHover:{scale:o==null?void 0:o.hover},whileTap:{scale:o==null?void 0:o.tap},children:e})}}Ov.propTypes={children:c.node,offset:c.number,type:c.oneOf(["slide","scale","rotate"]),direction:c.oneOf(["up","down","left","right"]),scale:c.oneOfType([c.number,c.object])};function B5(e){return Nt("MuiSvgIcon",e)}Ut("MuiSvgIcon",["root","colorPrimary","colorSecondary","colorAction","colorError","colorDisabled","fontSizeInherit","fontSizeSmall","fontSizeMedium","fontSizeLarge"]);const v5=["children","className","color","component","fontSize","htmlColor","inheritViewBox","titleAccess","viewBox"],y5=e=>{const{color:t,fontSize:n,classes:r}=e,o={root:["root",t!=="inherit"&&`color${Pe(t)}`,`fontSize${Pe(n)}`]};return sn(o,B5,r)},b5=ue("svg",{name:"MuiSvgIcon",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.root,n.color!=="inherit"&&t[`color${Pe(n.color)}`],t[`fontSize${Pe(n.fontSize)}`]]}})(({theme:e,ownerState:t})=>{var n,r,o,s,l,u,A,g,p,C,h,m,I;return{userSelect:"none",width:"1em",height:"1em",display:"inline-block",fill:t.hasSvgAsChild?void 0:"currentColor",flexShrink:0,transition:(n=e.transitions)==null||(r=n.create)==null?void 0:r.call(n,"fill",{duration:(o=e.transitions)==null||(o=o.duration)==null?void 0:o.shorter}),fontSize:{inherit:"inherit",small:((s=e.typography)==null||(l=s.pxToRem)==null?void 0:l.call(s,20))||"1.25rem",medium:((u=e.typography)==null||(A=u.pxToRem)==null?void 0:A.call(u,24))||"1.5rem",large:((g=e.typography)==null||(p=g.pxToRem)==null?void 0:p.call(g,35))||"2.1875rem"}[t.fontSize],color:(C=(h=(e.vars||e).palette)==null||(h=h[t.color])==null?void 0:h.main)!=null?C:{action:(m=(e.vars||e).palette)==null||(m=m.action)==null?void 0:m.active,disabled:(I=(e.vars||e).palette)==null||(I=I.action)==null?void 0:I.disabled,inherit:void 0}[t.color]}}),wf=D.forwardRef(function(t,n){const r=Yt({props:t,name:"MuiSvgIcon"}),{children:o,className:s,color:l="inherit",component:u="svg",fontSize:A="medium",htmlColor:g,inheritViewBox:p=!1,titleAccess:C,viewBox:h="0 0 24 24"}=r,m=Ke(r,v5),I=D.isValidElement(o)&&o.type==="svg",B=W({},r,{color:l,component:u,fontSize:A,instanceFontSize:t.fontSize,inheritViewBox:p,viewBox:h,hasSvgAsChild:I}),v={};p||(v.viewBox=h);const O=y5(B);return f.jsxs(b5,W({as:u,className:Ge(O.root,s),focusable:"false",color:g,"aria-hidden":C?void 0:!0,role:C?"img":void 0,ref:n},v,m,I&&o.props,{ownerState:B,children:[I?o.props.children:o,C?f.jsx("title",{children:C}):null]}))});process.env.NODE_ENV!=="production"&&(wf.propTypes={children:c.node,classes:c.object,className:c.string,color:c.oneOfType([c.oneOf(["inherit","action","disabled","primary","secondary","error","info","success","warning"]),c.string]),component:c.elementType,fontSize:c.oneOfType([c.oneOf(["inherit","large","medium","small"]),c.string]),htmlColor:c.string,inheritViewBox:c.bool,shapeRendering:c.string,sx:c.oneOfType([c.arrayOf(c.oneOfType([c.func,c.object,c.bool])),c.func,c.object]),titleAccess:c.string,viewBox:c.string});wf.muiName="SvgIcon";const sI=wf;function Tf(e,t){function n(r,o){return f.jsx(sI,W({"data-testid":`${t}Icon`,ref:o},r,{children:e}))}return process.env.NODE_ENV!=="production"&&(n.displayName=`${t}Icon`),n.muiName=sI.muiName,D.memo(D.forwardRef(n))}const Q5=Tf(f.jsx("path",{d:"M12 12c2.21 0 4-1.79 4-4s-1.79-4-4-4-4 1.79-4 4 1.79 4 4 4zm0 2c-2.67 0-8 1.34-8 4v2h16v-2c0-2.66-5.33-4-8-4z"}),"Person");function x5(e){return Nt("MuiAvatar",e)}Ut("MuiAvatar",["root","colorDefault","circular","rounded","square","img","fallback"]);const w5=["alt","children","className","component","imgProps","sizes","src","srcSet","variant"],T5=e=>{const{classes:t,variant:n,colorDefault:r}=e;return sn({root:["root",n,r&&"colorDefault"],img:["img"],fallback:["fallback"]},x5,t)},P5=ue("div",{name:"MuiAvatar",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.root,t[n.variant],n.colorDefault&&t.colorDefault]}})(({theme:e,ownerState:t})=>W({position:"relative",display:"flex",alignItems:"center",justifyContent:"center",flexShrink:0,width:40,height:40,fontFamily:e.typography.fontFamily,fontSize:e.typography.pxToRem(20),lineHeight:1,borderRadius:"50%",overflow:"hidden",userSelect:"none"},t.variant==="rounded"&&{borderRadius:(e.vars||e).shape.borderRadius},t.variant==="square"&&{borderRadius:0},t.colorDefault&&W({color:(e.vars||e).palette.background.default},e.vars?{backgroundColor:e.vars.palette.Avatar.defaultBg}:{backgroundColor:e.palette.mode==="light"?e.palette.grey[400]:e.palette.grey[600]}))),S5=ue("img",{name:"MuiAvatar",slot:"Img",overridesResolver:(e,t)=>t.img})({width:"100%",height:"100%",textAlign:"center",objectFit:"cover",color:"transparent",textIndent:1e4}),R5=ue(Q5,{name:"MuiAvatar",slot:"Fallback",overridesResolver:(e,t)=>t.fallback})({width:"75%",height:"75%"});function O5({crossOrigin:e,referrerPolicy:t,src:n,srcSet:r}){const[o,s]=D.useState(!1);return D.useEffect(()=>{if(!n&&!r)return;s(!1);let l=!0;const u=new Image;return u.onload=()=>{l&&s("loaded")},u.onerror=()=>{l&&s("error")},u.crossOrigin=e,u.referrerPolicy=t,u.src=n,r&&(u.srcset=r),()=>{l=!1}},[e,t,n,r]),o}const jv=D.forwardRef(function(t,n){const r=Yt({props:t,name:"MuiAvatar"}),{alt:o,children:s,className:l,component:u="div",imgProps:A,sizes:g,src:p,srcSet:C,variant:h="circular"}=r,m=Ke(r,w5);let I=null;const B=O5(W({},A,{src:p,srcSet:C})),v=p||C,O=v&&B!=="error",j=W({},r,{colorDefault:!O,component:u,variant:h}),x=T5(j);return O?I=f.jsx(S5,W({alt:o,srcSet:C,src:p,sizes:g,ownerState:j,className:x.img},A)):s!=null?I=s:v&&o?I=o[0]:I=f.jsx(R5,{ownerState:j,className:x.fallback}),f.jsx(P5,W({as:u,ownerState:j,className:Ge(x.root,l),ref:n},m,{children:I}))});process.env.NODE_ENV!=="production"&&(jv.propTypes={alt:c.string,children:c.node,classes:c.object,className:c.string,component:c.elementType,imgProps:c.object,sizes:c.string,src:c.string,srcSet:c.string,sx:c.oneOfType([c.arrayOf(c.oneOfType([c.func,c.object,c.bool])),c.func,c.object]),variant:c.oneOfType([c.oneOf(["circular","rounded","square"]),c.string])});const j5=jv,an=(e,t)=>{switch(t){case"secondary":return e.palette.secondary;case"error":return e.palette.error;case"warning":return e.palette.warning;case"info":return e.palette.info;case"success":return e.palette.success;default:return e.palette.primary}};function M5({theme:e,color:t,type:n}){const r=an(e,t),{lighter:o,light:s,main:l,contrastText:u}=r;switch(n){case"filled":return{color:u,backgroundColor:l};case"outlined":return{color:l,border:"1px solid",borderColor:l,backgroundColor:"transparent"};case"combined":return{color:l,border:"1px solid",borderColor:s,backgroundColor:o};default:return{color:l,backgroundColor:o}}}function D5(e){switch(e){case"badge":return{border:"2px solid",fontSize:"0.675rem",width:20,height:20};case"xs":return{fontSize:"0.75rem",width:24,height:24};case"sm":return{fontSize:"0.875rem",width:32,height:32};case"lg":return{fontSize:"1.2rem",width:52,height:52};case"xl":return{fontSize:"1.5rem",width:64,height:64};case"md":default:return{fontSize:"1rem",width:40,height:40}}}const k5=ue(j5,{shouldForwardProp:e=>e!=="color"&&e!=="type"&&e!=="size"})(({theme:e,variant:t,color:n,type:r,size:o})=>({...D5(o),...M5({variant:t,theme:e,color:n,type:r}),...o==="badge"&&{borderColor:e.palette.background.default}}));function Ca({variant:e="circular",children:t,color:n="primary",type:r,size:o="md",...s}){const l=Rt();return f.jsx(k5,{variant:e,theme:l,color:n,type:r,size:o,...s,children:t})}Ca.propTypes={children:c.node,color:c.string,type:c.string,size:c.string,variant:c.string};const aI={p:2.5,"& .MuiCardHeader-action":{m:"0px auto",alignSelf:"center"}},Zn=w.forwardRef(({border:e=!0,boxShadow:t,children:n,subheader:r,content:o=!0,contentSX:s={},darkTitle:l,divider:u=!0,elevation:A,secondary:g,shadow:p,sx:C={},title:h,modal:m=!1,color:I="default",...B},v)=>{const O=Rt();return t=O.palette.mode==="dark"?t||!0:t,f.jsxs(b.Card,{elevation:A||0,ref:v,...B,sx:{position:"relative",border:e?"1px solid":"none",borderRadius:1,borderColor:O.palette.mode==="dark"?O.palette.divider:O.palette.grey.A800,boxShadow:t&&(!e||O.palette.mode==="dark")?p||O.customShadows.z1:"inherit",":hover":{boxShadow:t?p||O.customShadows.z1:"inherit"},backgroundColor:I==="default"?O.palette.background.paper:ts(I==="primary"?O.palette.primary[100]:O.palette.secondary[100],.5),...m&&{position:"absolute",top:"50%",left:"50%",transform:"translate(-50%, -50%)",width:{xs:"calc( 100% - 50px)",sm:"auto"},"& .MuiCardContent-root":{overflowY:"auto",minHeight:"auto",maxHeight:"calc(100vh - 200px)"}},...C},children:[!l&&h&&f.jsx(b.CardHeader,{sx:aI,titleTypographyProps:{variant:"subtitle1"},title:h,action:g,subheader:r}),l&&h&&f.jsx(b.CardHeader,{sx:aI,title:f.jsx(b.Typography,{variant:"h4",children:h}),action:g}),h&&u&&f.jsx(b.Divider,{}),o&&f.jsx(b.CardContent,{sx:s,children:n}),!o&&n]})});Zn.propTypes={border:c.bool,boxShadow:c.bool,children:c.oneOfType([c.node,c.arrayOf(c.node)]),subheader:c.oneOfType([c.node,c.string]),content:c.bool,contentClass:c.string,contentSX:c.object,darkTitle:c.bool,divider:c.bool,elevation:c.number,secondary:c.oneOfType([c.node,c.string,c.object]),shadow:c.string,sx:c.object,title:c.oneOfType([c.node,c.string,c.object]),modal:c.bool,color:c.oneOf(["default","primary","secondary"])};var gg={exports:{}},lt={};/**
98
98
  * @license React
99
99
  * react-is.production.min.js
100
100
  *
@@ -215,7 +215,7 @@ function print() { __p += __j.call(arguments, '') }
215
215
  animation: ${0} 1.4s linear infinite;
216
216
  `),_F)),n8=ue("svg",{name:"MuiCircularProgress",slot:"Svg",overridesResolver:(e,t)=>t.svg})({display:"block"}),r8=ue("circle",{name:"MuiCircularProgress",slot:"Circle",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.circle,t[`circle${Pe(n.variant)}`],n.disableShrink&&t.circleDisableShrink]}})(({ownerState:e,theme:t})=>W({stroke:"currentColor"},e.variant==="determinate"&&{transition:t.transitions.create("stroke-dashoffset")},e.variant==="indeterminate"&&{strokeDasharray:"80px, 200px",strokeDashoffset:0}),({ownerState:e})=>e.variant==="indeterminate"&&!e.disableShrink&&_t.css(EI||(EI=pu`
217
217
  animation: ${0} 1.4s ease-in-out infinite;
218
- `),$F)),Gv=D.forwardRef(function(t,n){const r=Yt({props:t,name:"MuiCircularProgress"}),{className:o,color:s="primary",disableShrink:l=!1,size:u=40,style:A,thickness:g=3.6,value:p=0,variant:C="indeterminate"}=r,h=Ke(r,ZF),m=W({},r,{color:s,disableShrink:l,size:u,thickness:g,value:p,variant:C}),I=e8(m),B={},v={},O={};if(C==="determinate"){const j=2*Math.PI*((ao-g)/2);B.strokeDasharray=j.toFixed(3),O["aria-valuenow"]=Math.round(p),B.strokeDashoffset=`${((100-p)/100*j).toFixed(3)}px`,v.transform="rotate(-90deg)"}return f.jsx(t8,W({className:Ge(I.root,o),style:W({width:u,height:u},v,A),ownerState:m,ref:n,role:"progressbar"},O,h,{children:f.jsx(n8,{className:I.svg,ownerState:m,viewBox:`${ao/2} ${ao/2} ${ao} ${ao}`,children:f.jsx(r8,{className:I.circle,style:B,ownerState:m,cx:ao,cy:ao,r:(ao-g)/2,fill:"none",strokeWidth:g})})}))});process.env.NODE_ENV!=="production"&&(Gv.propTypes={classes:c.object,className:c.string,color:c.oneOfType([c.oneOf(["inherit","primary","secondary","error","info","success","warning"]),c.string]),disableShrink:Tr(c.bool,e=>e.disableShrink&&e.variant&&e.variant!=="indeterminate"?new Error("MUI: You have provided the `disableShrink` prop with a variant other than `indeterminate`. This will have no effect."):null),size:c.oneOfType([c.number,c.string]),style:c.object,sx:c.oneOfType([c.arrayOf(c.oneOfType([c.func,c.object,c.bool])),c.func,c.object]),thickness:c.number,value:c.number,variant:c.oneOf(["determinate","indeterminate"])});const Df=Gv;function o8(e){return Nt("MuiLoadingButton",e)}const i8=Ut("MuiLoadingButton",["root","loading","loadingIndicator","loadingIndicatorCenter","loadingIndicatorStart","loadingIndicatorEnd","endIconLoadingEnd","startIconLoadingStart"]),Vr=i8,s8=["children","disabled","id","loading","loadingIndicator","loadingPosition","variant"],a8=e=>{const{loading:t,loadingPosition:n,classes:r}=e,o={root:["root",t&&"loading"],startIcon:[t&&`startIconLoading${Pe(n)}`],endIcon:[t&&`endIconLoading${Pe(n)}`],loadingIndicator:["loadingIndicator",t&&`loadingIndicator${Pe(n)}`]},s=dr.unstable_composeClasses(o,o8,r);return W({},r,s)},l8=e=>e!=="ownerState"&&e!=="theme"&&e!=="sx"&&e!=="as"&&e!=="classes",c8=ue(JF,{shouldForwardProp:e=>l8(e)||e==="classes",name:"MuiLoadingButton",slot:"Root",overridesResolver:(e,t)=>[t.root,t.startIconLoadingStart&&{[`& .${Vr.startIconLoadingStart}`]:t.startIconLoadingStart},t.endIconLoadingEnd&&{[`& .${Vr.endIconLoadingEnd}`]:t.endIconLoadingEnd}]})(({ownerState:e,theme:t})=>W({[`& .${Vr.startIconLoadingStart}, & .${Vr.endIconLoadingEnd}`]:{transition:t.transitions.create(["opacity"],{duration:t.transitions.duration.short}),opacity:0}},e.loadingPosition==="center"&&{transition:t.transitions.create(["background-color","box-shadow","border-color"],{duration:t.transitions.duration.short}),[`&.${Vr.loading}`]:{color:"transparent"}},e.loadingPosition==="start"&&e.fullWidth&&{[`& .${Vr.startIconLoadingStart}, & .${Vr.endIconLoadingEnd}`]:{transition:t.transitions.create(["opacity"],{duration:t.transitions.duration.short}),opacity:0,marginRight:-8}},e.loadingPosition==="end"&&e.fullWidth&&{[`& .${Vr.startIconLoadingStart}, & .${Vr.endIconLoadingEnd}`]:{transition:t.transitions.create(["opacity"],{duration:t.transitions.duration.short}),opacity:0,marginLeft:-8}})),u8=ue("span",{name:"MuiLoadingButton",slot:"LoadingIndicator",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.loadingIndicator,t[`loadingIndicator${Pe(n.loadingPosition)}`]]}})(({theme:e,ownerState:t})=>W({position:"absolute",visibility:"visible",display:"flex"},t.loadingPosition==="start"&&(t.variant==="outlined"||t.variant==="contained")&&{left:t.size==="small"?10:14},t.loadingPosition==="start"&&t.variant==="text"&&{left:6},t.loadingPosition==="center"&&{left:"50%",transform:"translate(-50%)",color:(e.vars||e).palette.action.disabled},t.loadingPosition==="end"&&(t.variant==="outlined"||t.variant==="contained")&&{right:t.size==="small"?10:14},t.loadingPosition==="end"&&t.variant==="text"&&{right:6},t.loadingPosition==="start"&&t.fullWidth&&{position:"relative",left:-10},t.loadingPosition==="end"&&t.fullWidth&&{position:"relative",right:-10})),Kv=D.forwardRef(function(t,n){const r=Yt({props:t,name:"MuiLoadingButton"}),{children:o,disabled:s=!1,id:l,loading:u=!1,loadingIndicator:A,loadingPosition:g="center",variant:p="text"}=r,C=Ke(r,s8),h=Mg(l),m=A??f.jsx(Df,{"aria-labelledby":h,color:"inherit",size:16}),I=W({},r,{disabled:s,loading:u,loadingIndicator:m,loadingPosition:g,variant:p}),B=a8(I),v=u?f.jsx(u8,{className:B.loadingIndicator,ownerState:I,children:m}):null;return f.jsxs(c8,W({disabled:s||u,id:h,ref:n},C,{variant:p,classes:B,ownerState:I,children:[I.loadingPosition==="end"?o:v,I.loadingPosition==="end"?v:o]}))});process.env.NODE_ENV!=="production"&&(Kv.propTypes={children:c.node,classes:c.object,disabled:c.bool,id:c.string,loading:c.bool,loadingIndicator:c.node,loadingPosition:Tr(c.oneOf(["start","end","center"]),e=>e.loadingPosition==="start"&&!e.startIcon?new Error('MUI: The loadingPosition="start" should be used in combination with startIcon.'):e.loadingPosition==="end"&&!e.endIcon?new Error('MUI: The loadingPosition="end" should be used in combination with endIcon.'):null),sx:c.oneOfType([c.arrayOf(c.oneOfType([c.func,c.object,c.bool])),c.func,c.object]),variant:c.oneOfType([c.oneOf(["contained","outlined","text"]),c.string])});const A8=Kv;function Td({variant:e,theme:t,color:n,loadingPosition:r}){const o=an(t,n),{lighter:s,main:l,dark:u,contrastText:A}=o,g=`${n}Button`,p=ds(t,g),C={"& .MuiLoadingButton-loadingIndicator":{color:l}},h={...r&&r!=="center"&&{color:l}},m={"&::after":{boxShadow:`0 0 6px 6px ${We(l,.9)}`},"&:active::after":{boxShadow:`0 0 0 0 ${We(l,.9)}`},"&:focus-visible":{outline:`2px solid ${u}`,outlineOffset:2}};switch(e){case"contained":return{backgroundColor:l,...r&&r!=="center"&&{color:A},"& .MuiLoadingButton-loadingIndicator":{color:A},"&:hover":{backgroundColor:u,color:A},...m};case"light":return{backgroundColor:l,...r&&r!=="center"&&{color:A},"& .MuiLoadingButton-loadingIndicator":{color:A},"&:hover":{backgroundColor:u,color:A},...m};case"shadow":return{boxShadow:p,backgroundColor:l,...r&&r!=="center"&&{color:A},"& .MuiLoadingButton-loadingIndicator":{color:A},"&:hover":{boxShadow:"none",backgroundColor:u,color:A},...m};case"outlined":return{backgroundColor:"transparent",borderColor:l,...h,...C};case"dashed":return{backgroundColor:s,borderColor:l,...h,...C,...m};case"text":default:return{color:l,...C,...m}}}const d8=ue(A8,{shouldForwardProp:e=>e!=="shape"&&e!=="variant"})(({theme:e,variant:t,shape:n,color:r,loading:o,loadingPosition:s})=>({"::after":{content:'""',display:"block",position:"absolute",left:0,top:0,width:"100%",height:"100%",borderRadius:n==="rounded"?"50%":4,opacity:0,transition:"all 0.5s"},":active::after":{position:"absolute",borderRadius:n==="rounded"?"50%":4,left:0,top:0,opacity:1,transition:"0s"},...t==="text"&&{...Td({variant:t,theme:e,color:r,loadingPosition:s}),"&.MuiButton-sizeMedium":{height:36},"&.MuiButton-sizeSmall":{height:30},"&.MuiButton-sizeLarge":{height:44}},...n&&{minWidth:0,"&.MuiButton-sizeMedium":{width:36,height:36},"&.MuiButton-sizeSmall":{width:30,height:30},"&.MuiButton-sizeLarge":{width:44,height:44},...n==="rounded"&&{borderRadius:"50%"}},...t==="outlined"&&{border:"1px solid"},...t==="dashed"&&{border:"1px dashed"},...(t==="contained"||t==="shadow")&&!o&&{color:"#fff"},...t!=="text"&&{...Td({variant:t,theme:e,color:r,loadingPosition:s})},"&.Mui-disabled":{...t!=="text"&&{...Td({variant:t,theme:e,color:r,loadingPosition:s})}}})),kf=w.forwardRef(({variant:e="text",shape:t,children:n,color:r="primary",...o},s)=>{const l=Rt();return f.jsx(d8,{ref:s,variant:e,shape:t,theme:l,loadingPosition:o.loadingPosition,loading:o.loading,color:r,...o,children:n})});kf.propTypes={variant:c.string,shape:c.string,children:c.node,color:c.string};kf.displayName="LoadingButton";function g8({color:e,theme:t,labelColor:n}){const r=an(t,e),{main:o,contrastText:s}=r;let l=e||"";return["primary","secondary","info","success","warning","error"].includes(l)?{[`& .${b.tooltipClasses.tooltip}`]:{backgroundColor:o,color:n||s},[`& .${b.tooltipClasses.arrow}`]:{color:o}}:{[`& .${b.tooltipClasses.tooltip}`]:{backgroundColor:l,color:n||s,boxShadow:t.shadows[1]},[`& .${b.tooltipClasses.arrow}`]:{color:l}}}const f8=ue(({className:e,...t})=>f.jsx(b.Tooltip,{...t,classes:{popper:e}}),{shouldForwardProp:e=>e!=="color"&&e!=="labelColor"})(({theme:e,color:t,labelColor:n})=>({...t&&g8({color:t,theme:e,labelColor:n})}));function Ff({children:e,arrow:t,labelColor:n="",...r}){const o=Rt();return f.jsx(b.Box,{display:"flex",children:f.jsx(f8,{arrow:t,...r,theme:o,labelColor:n,children:e})})}Ff.propTypes={children:c.element,arrow:c.bool,labelColor:c.string,rest:c.array};const yo=w.forwardRef(({children:e,position:t="top-left",type:n="grow",direction:r="up",...o},s)=>{let l={transformOrigin:"0 0 0"};switch(t){case"top-right":l={transformOrigin:"top right"};break;case"top":l={transformOrigin:"top"};break;case"bottom-left":l={transformOrigin:"bottom left"};break;case"bottom-right":l={transformOrigin:"bottom right"};break;case"bottom":l={transformOrigin:"bottom"};break;case"top-left":default:l={transformOrigin:"0 0 0"};break}return f.jsxs(b.Box,{ref:s,children:[n==="grow"&&f.jsx(b.Grow,{...o,timeout:{appear:0,enter:150,exit:150},children:f.jsx(b.Box,{sx:l,children:e})}),n==="collapse"&&f.jsx(b.Collapse,{...o,sx:l,children:e}),n==="fade"&&f.jsx(b.Fade,{...o,timeout:{appear:0,enter:300,exit:150},children:f.jsx(b.Box,{sx:l,children:e})}),n==="slide"&&f.jsx(b.Slide,{...o,timeout:{appear:0,enter:150,exit:150},direction:r,children:f.jsx(b.Box,{sx:l,children:e})}),n==="zoom"&&f.jsx(b.Zoom,{...o,children:f.jsx(b.Box,{sx:l,children:e})})]})});yo.propTypes={children:c.node,type:c.oneOf(["grow","fade","collapse","slide","zoom"]),position:c.oneOf(["top-left","top-right","top","bottom-left","bottom-right","bottom"]),direction:c.oneOf(["up","down","left","right"])};w.forwardRef(function(t,n){return f.jsx(b.Zoom,{ref:n,timeout:200,...t})});function qv({value:e,...t}){return f.jsxs(b.Box,{sx:{position:"relative",display:"inline-flex"},children:[f.jsx(b.CircularProgress,{variant:"determinate",value:e,...t}),f.jsx(b.Box,{sx:{top:0,left:0,bottom:0,right:0,position:"absolute",display:"flex",alignItems:"center",justifyContent:"center"},children:f.jsx(b.Typography,{variant:"caption",component:"div",color:"text.secondary",children:`${Math.round(e)}%`})})]})}qv.propTypes={value:c.number};function Jv({value:e,size:t,variant:n,thickness:r,showLabel:o,pathColor:s,sx:l,...u}){return f.jsxs(b.Box,{sx:{position:"relative",display:"inline-flex"},children:[f.jsx(b.CircularProgress,{variant:"determinate",sx:{color:s||"grey.200"},size:t,thickness:r,...u,value:100}),o&&f.jsx(b.Box,{sx:{top:0,left:0,bottom:0,right:0,position:"absolute",display:"flex",alignItems:"center",justifyContent:"center"},children:f.jsx(b.Typography,{variant:"caption",component:"div",color:"text.secondary",children:e?`${Math.round(e)}%`:"0%"})}),f.jsx(b.CircularProgress,{variant:n,sx:{...l,position:"absolute",left:0,[`& .${b.circularProgressClasses.circle}`]:{strokeLinecap:"round"}},size:t,thickness:r,value:e,...u})]})}Jv.propTypes={value:c.number,size:c.number,variant:c.string,thickness:c.number,showLabel:c.bool,pathColor:c.string,sx:c.array,others:c.array};function Xv({icon:e,value:t,...n}){return f.jsxs(b.Box,{sx:{display:"flex",alignItems:"center"},children:[f.jsx(b.Box,{sx:{width:"100%",mr:1},children:f.jsx(b.LinearProgress,{variant:"determinate",value:t,...n})}),f.jsx(b.Box,{sx:{minWidth:35},children:e})]})}Xv.propTypes={icon:c.node,value:c.number};function Zv({value:e,...t}){return f.jsxs(b.Box,{sx:{display:"flex",alignItems:"center"},children:[f.jsx(b.Box,{sx:{width:"100%",mr:1},children:f.jsx(b.LinearProgress,{variant:"determinate",value:e,...t})}),f.jsx(b.Box,{sx:{minWidth:35},children:f.jsx(b.Typography,{variant:"body2",color:"text.secondary",children:`${Math.round(e)}%`})})]})}Zv.propTypes={value:c.number};const p8=w.forwardRef(function(t,n){const r=Pr(t,{color:"text.primary"},{defaults:!0});return f.jsx(gs,{ref:n,...t,color:"secondary",variant:"text",sx:r})}),Ma=w.forwardRef(function(t,n){const r=Pr(t,{color:"text.primary",borderStyle:"none",padding:1,fontSize:"1.5rem",width:36,height:36},{defaults:!0});return f.jsx(b.ToggleButton,{ref:n,...t,color:"secondary",sx:r})}),_v=w.createContext({});function h8(e){const{useDefaults:t=!1,queryOptions:n={}}=e,r=R.useResourceContext(),o=R.useDataProvider(),{search:s}=_i.useLocation(),l=`${r}/new`,u=w.useCallback(()=>{if(!t||!Ae.isFunction(o.get))return Promise.resolve({});const h={};return new URLSearchParams(s??"").forEach((m,I)=>{h[I]=m}),o.get(l,h).then(m=>m.data).then(m=>{const{responseCode:I,value:B}=m;return I==="ok"?B:Promise.reject(m)})},[r,t,s,o]),A=w.useMemo(()=>Ae.chain(n).extend({queryKey:[r,s],queryFn:u}).value(),[r,s,u,n]),{data:g,isLoading:p}=Rg.useQuery(A),C=Ae.omit(e,["useDefaults"]);return p?f.jsx(b.Stack,{alignItems:"center",justifyContent:"center",flex:1,p:2,children:f.jsx(b.CircularProgress,{})}):f.jsx(_v.Provider,{value:g??{},children:f.jsx(R.Create,{...C})})}function C8(){return w.useContext(_v)}const m8=ue(h8,{name:"RaApplicaEdit",slot:"root"})(({theme:e})=>({"& .RaCreate-card, & > div > div > form":{backgroundColor:e.palette.background.default},"& .RaCreate-main>.MuiPaper-root:first-of-type":{overflow:"visible",backgroundColor:e.palette.background.default}})),E8=Ta(R.Toolbar,{name:"RaApplicaToolbar",slot:"Root"})(({theme:e})=>({...e.mixins.toolbar,backgroundColor:e.palette.background.paper,justifyContent:"flex-end","& .RaToolbar-defaultToolbar":{justifyContent:"right",paddingBottom:e.spacing(2),"& > *":{marginLeft:e.spacing(1)}},"& .MuiButtonBase-root":{marginLeft:e.spacing(1)}})),pr=e=>f.jsx(E8,{...e});pr.defaultProps={...R.Toolbar.defaultProps};pr.propTypes={...R.Toolbar.propTypes};const Lf=({children:e,content:t,title:n,subheader:r,secondary:o,toolbar:s,...l})=>{const u=R.useTranslate(),A=R.useResourceContext(),{cardTitle:g,cardSubheader:p}=w.useMemo(()=>{const C=n||`resources.${A}.title`;return{cardTitle:u(C,{_:C}),cardSubheader:r!==null?u(r,{_:r}):null}},[A,r,n,u]);return f.jsx(b.Grid,{item:!0,...l,children:f.jsx(Zn,{content:t,title:g,subheader:p,secondary:o,divider:!0,children:f.jsxs(w.Fragment,{children:[e,s===!0?f.jsx(pr,{children:f.jsx(R.SaveButton,{})}):s]})})})};Lf.defaultProps={...b.Grid.defaultProps,content:!0,subheader:null,title:null,secondary:null,toolbar:!1,item:!0,lg:12,md:12,sm:12,xs:12};Lf.propTypes={...b.Grid.propTypes,children:c.oneOfType([c.node,c.arrayOf(c.node)]),contained:c.bool,content:c.bool,subheader:c.oneOfType([c.string,c.node]),title:c.oneOfType([c.string,c.node]),secondary:c.oneOfType([c.node,c.string,c.object]),spacing:c.number,toolbar:c.oneOfType([c.node,c.bool])};const I8=ue(R.Form,{name:"RaApplicaCardForm",slot:"root"})(({theme:e,spacing:t})=>({backgroundColor:"transparent","& .RaToolbar-desktopToolbar":{marginTop:e.spacing(t*2),padding:0}})),hu=({children:e,spacing:t,defaultValues:n,...r})=>{const{spacing:o}=Ln();return f.jsx(I8,{defaultValues:n,spacing:t||o,children:f.jsx(b.Grid,{container:!0,...r,spacing:t||o,children:e})})};hu.propTypes={...b.Grid.propTypes,...R.Form.propTypes,children:c.oneOfType([c.node,c.arrayOf(c.node)]),spacing:c.number,defaultValues:c.oneOfType([c.object,c.func]),record:c.object,validate:c.func};hu.defaultProps={...b.Stack.defaultProps};hu.Section=Lf;const B8=Ta(R.SimpleForm,{name:"RaApplicaSimpleForm",slot:"Root"})(({theme:e,modal:t})=>({"& .MuiGrid-root.MuiGrid-container":{paddingBottom:e.spacing(t?0:1)},[e.breakpoints.down("sm")]:{paddingBottom:0}})),Cu=({title:e,modal:t,content:n,subheader:r,secondary:o,sx:s,...l})=>{const u=sf(e),A=R.useRecordContext();return f.jsx(Zn,{content:n,title:u,subheader:r,secondary:A!=null&&A.id?o:null,sx:{...s,"& .MuiToolbar-root":{paddingLeft:"20px !important",paddingRight:"20px !important"}},border:!t,divider:!0,children:f.jsx(B8,{toolbar:f.jsx(pr,{}),...l})})};Cu.defaultProps={modal:!1,content:!1,subheader:null,title:null,toolbar:f.jsx(pr,{children:f.jsx(R.SaveButton,{type:"button"})}),secondary:f.jsx(li,{children:f.jsx(R.DeleteWithConfirmButton,{})})};Cu.propTypes={...R.SimpleForm.propTypes,modal:c.bool,content:c.bool,contained:c.bool,subheader:c.oneOfType([c.string,c.node]),title:c.oneOfType([c.string,c.node]),secondary:c.oneOfType([c.node,c.string,c.object])};const mu=({label:e,children:t,display:n,helperText:r,sx:o,addLabel:s,divider:l,...u})=>{const A=_t.useTheme(),{getCurrentDialog:g}=ci(),{source:p,resource:C,isRequired:h}=u,{getFieldState:m,formState:I}=ai.useFormContext(),{error:B}=m(p,I),v=g();return f.jsxs(b.Stack,{spacing:1,sx:{"& .MuiFormHelperText-root":{color:B?A.palette.error.main:A.palette.text.secondary,"& span":{display:"none"}},...o},children:[n==="label"&&e!==!1&&s!==!1&&f.jsx(b.InputLabel,{error:!!B,sx:{borderBottom:l?`1px solid ${A.palette.divider}`:"none",pb:l?1:0,mt:l?1:0},children:f.jsx(R.FieldTitle,{label:e,source:p,resource:v||C,isRequired:h})}),w.isValidElement(t)?w.cloneElement(t,{...t.props,...u,label:n==="legend"?e:!1}):t,n==="label"&&r&&f.jsx(b.FormHelperText,{sx:{pl:1.8,pb:2,marginTop:"0 !important"},error:!!B,children:r})]})};mu.propTypes={sx:c.object,children:c.element,label:c.oneOfType([c.string,c.bool]),addLabel:c.bool,resource:c.string,isRequired:c.bool,source:c.string,display:c.oneOf(["legend","label"]),helperText:c.oneOfType([c.string,c.bool]),divider:c.bool};mu.defaultProps={display:"label",divider:!1};const v8=ue(R.ArrayInput,{name:"ApplicaArrayInput",slot:"root"})(({theme:e})=>({"& .MuiStack-root > label":{marginTop:e.spacing(2)},"& .MuiInputLabel-shrink":{paddingBottom:0},marginTop:"0 !important","& .RaSimpleFormIterator-line > .RaSimpleFormIterator-form":{paddingBottom:e.spacing(.5),"& > div":{width:"100%"}}})),y8=({label:e,addLabel:t,source:n,helperText:r,divider:o=!0,...s})=>f.jsx(mu,{label:e,addLabel:t,source:n,helperText:r,divider:o,children:f.jsx(v8,{source:n,label:!1,...s})}),Nf=({canEdit:e,canDelete:t,canClone:n})=>!e&&!t&&!n?null:f.jsxs(li,{children:[e&&f.jsx(R.EditButton,{}),t&&f.jsx(R.DeleteWithConfirmButton,{}),n&&f.jsx(R.CloneButton,{})]});Nf.defaultProps={canEdit:!0,canDelete:!0,canClone:!1};Nf.propTypes={canEdit:c.bool,canDelete:c.bool,canClone:c.bool};const II=ue("div",{name:"ApplicaBaseAttachmentField",overridesResolver:(e,t)=>t.root})({display:"inline-block"}),b8=ue("ul")({display:"inline-block"}),$v=e=>{var p;const{className:t,emptyText:n,source:r,title:o,...s}=e,l=de.useRecordContext(e),u=dt.get(l,r),A=de.useTranslate();if(!u)return n?f.jsx(b.Typography,{component:"span",variant:"body2",className:t,...s,children:n&&A(n,{_:n})}):f.jsx(II,{className:t,...s});if(Array.isArray(u))return f.jsx(b8,{className:t,...s,children:u.map((C,h)=>{var I;const m=o instanceof String?(I=dt.get(C,o))==null?void 0:I.toString():o;return f.jsx("li",{children:m},h)})});const g=o instanceof String?(p=dt.get(l,o))==null?void 0:p.toString():o;return f.jsx(II,{className:t,...s,children:g})};$v.propTypes={className:c.string,emptyText:c.string,source:c.string.isRequired,src:c.string,title:c.oneOfType([c.string,c.element]),target:c.string,download:c.oneOfType([c.bool,c.string]),ping:c.string,rel:c.string};const Vf=({entityId:e,property:t,disabled:n,userResource:r="entities/user",...o})=>{const[s,l]=w.useState(null),u=R.useRecordContext(o),A=R.useDataProvider(),g=R.useResourceContext(),p=w.useCallback(async m=>{m.preventDefault(),m.stopPropagation();const I=dt.get(u,o==null?void 0:o.source),B=g.replace("entities/",""),v=await A.getFile(`/attachments/${B}/${e||(u==null?void 0:u.id)}/${t||(o==null?void 0:o.source)}/${(I==null?void 0:I.id)||(u==null?void 0:u.id)}`),O=document.createElement("a");O.href=v,O.download=dt.get(u,(o==null?void 0:o.title)||(o==null?void 0:o.source)),O.click()},[A,u,e,g,t,o==null?void 0:o.source,o==null?void 0:o.title]),C=w.useMemo(()=>({...u,[o==null?void 0:o.source]:(u==null?void 0:u.src)||dt.get(u,o==null?void 0:o.source),[o==null?void 0:o.title]:(u==null?void 0:u.title)||dt.get(u,(o==null?void 0:o.title)||(o==null?void 0:o.source))}),[u,o==null?void 0:o.source,o==null?void 0:o.title]),h=R.useTranslate();return w.useEffect(()=>{!u||!(u!=null&&u.userId)||A.getOne(r,{id:u==null?void 0:u.userId}).then(({data:m})=>l(m)).catch(()=>l(null))},[u,A,r]),f.jsx($v,{...o,disabled:n,record:C,onClick:p,title:f.jsxs(b.Box,{sx:{cursor:"pointer"},children:[f.jsx(b.Typography,{variant:"subtitle1",children:dt.get(C,(o==null?void 0:o.title)||(o==null?void 0:o.source))}),f.jsxs(b.Typography,{variant:"caption",color:"secondary",children:[dt.get(C,"sizeDescription"),s&&" | ",s&&h("ra.attachment.info",{user:s==null?void 0:s.name,created:qr(C==null?void 0:C.createdAt).format("DD/MM/YYYY HH:mm")})]})]})})};Vf.propTypes={...R.FileField.propTypes,source:c.string,title:c.string,disabled:c.bool};const Q8=ue(R.ImageField,{name:"RaApplicaImageField",slot:"root"})(()=>({})),Da=e=>{const t=`_${e==null?void 0:e.source}`;return f.jsx(Q8,{...e,source:t})};Da.propTypes={...R.ImageField.propTypes,source:c.string};const Eu=({width:e,height:t,circle:n,justify:r,record:o,...s})=>{const l=w.useMemo(()=>({width:typeof e=="number"?`${e}px !important`:`${e} !important`,height:typeof t=="number"?`${t}px !important`:`${t} !important`,borderRadius:n?"50%":1.5}),[e,t,n]),u=R.useRecordContext(),A=o||u;return f.jsx(Da,{sx:g=>({margin:0,display:"flex",justifyContent:r,"& img":{margin:"0px !important",border:`1px solid ${g.palette.divider}`,objectFit:"cover !important",...l,minWidth:l.width,minHeight:l.height}}),...s,record:A})};Eu.defaultProps={...Da.defaultProps,width:150,height:150,circle:!1,justify:"flex-start"};Eu.propTypes={...Da.propTypes,width:c.oneOfType([c.number,c.string]),height:c.oneOfType([c.number,c.string]),circle:c.bool,justify:c.oneOf(["flex-start","center","flex-end"])};var ey={exports:{}};(function(e,t){(function(n,r){e.exports=r()})(Xn,function(){return function(n,r,o){n=n||{};var s=r.prototype,l={future:"in %s",past:"%s ago",s:"a few seconds",m:"a minute",mm:"%d minutes",h:"an hour",hh:"%d hours",d:"a day",dd:"%d days",M:"a month",MM:"%d months",y:"a year",yy:"%d years"};function u(g,p,C,h){return s.fromToBase(g,p,C,h)}o.en.relativeTime=l,s.fromToBase=function(g,p,C,h,m){for(var I,B,v,O=C.$locale().relativeTime||l,j=n.thresholds||[{l:"s",r:44,d:"second"},{l:"m",r:89},{l:"mm",r:44,d:"minute"},{l:"h",r:89},{l:"hh",r:21,d:"hour"},{l:"d",r:35},{l:"dd",r:25,d:"day"},{l:"M",r:45},{l:"MM",r:10,d:"month"},{l:"y",r:17},{l:"yy",d:"year"}],x=j.length,S=0;S<x;S+=1){var P=j[S];P.d&&(I=h?o(g).diff(C,P.d,!0):C.diff(g,P.d,!0));var L=(n.rounding||Math.round)(Math.abs(I));if(v=I>0,L<=P.r||!P.r){L<=1&&S>0&&(P=j[S-1]);var k=O[P.l];m&&(L=m(""+L)),B=typeof k=="string"?k.replace("%d",L):k(L,p,P.l,v);break}}if(p)return B;var q=v?O.future:O.past;return typeof q=="function"?q(B):q.replace("%s",B)},s.to=function(g,p){return u(g,p,this,!0)},s.from=function(g,p){return u(g,p,this)};var A=function(g){return g.$u?o.utc():o()};s.toNow=function(g){return this.to(A(this),g)},s.fromNow=function(g){return this.from(A(this),g)}}})})(ey);var x8=ey.exports;const w8=bo(x8);qr.extend(w8);const Iu=e=>{const t=R.useRecordContext(e),[n]=R.useLocaleState(),r=w.useMemo(()=>qr(dt.get(t,e==null?void 0:e.source)).locale(n).fromNow(),[t,e==null?void 0:e.source,n]);return f.jsxs(w.Fragment,{children:[f.jsx(R.DateField,{record:t,source:e.source,showTime:!0}),f.jsx("br",{}),f.jsx(b.Typography,{variant:"caption",color:"textSecondary",children:r})]})};Iu.displayName="DateAgoField";Iu.propTypes={source:c.string.isRequired};const ty=ue(R.DateField,{name:"RaApplicaDateField",slot:"Root"})(()=>({}));ty.propTypes={...R.DateField.propTypes};const Hf=e=>f.jsx(ty,{...e});Hf.defaultProps={...R.DateField.defaultProps,variant:"body1"};Hf.propTypes={...R.DateField.propTypes};const ny=ue(R.EmailField,{name:"RaApplicaEmailField",slot:"Root"})(()=>({}));ny.propTypes={...R.EmailField.propTypes};const Wf=e=>f.jsx(ny,{...e});Wf.defaultProps={...R.EmailField.defaultProps,variant:"body1"};Wf.propTypes={...R.EmailField.propTypes};const T8=ue(R.FileField,{name:"RaApplicaFileField",slot:"root"})(()=>({})),zf=({...e})=>{const t=R.useRecordContext(e),n=w.useCallback(r=>{r.preventDefault(),r.stopPropagation();const o=dt.get(t,`_${e==null?void 0:e.source}`,dt.get(t,e==null?void 0:e.source)),s=dt.get(t,(e==null?void 0:e.title)||(e==null?void 0:e.source))||(e==null?void 0:e.title),l=document.createElement("a");l.href=o,l.download=s,l.click()},[e==null?void 0:e.source,t,e==null?void 0:e.title]);return f.jsx(T8,{...e,record:t,onClick:n})};zf.propTypes={...R.FileField.propTypes,source:c.string,title:c.string};const ry=e=>f.jsx(R.FunctionField,{...e});ry.defaultProps={variant:"body1"};const oy=ue(R.TextField,{name:"RaApplicaTextField",slot:"Root"})(()=>({}));oy.propTypes={...R.TextField.propTypes};const Bu=e=>f.jsx(oy,{...e});Bu.defaultProps={...R.TextField.defaultProps,variant:"body1"};Bu.propTypes={...R.TextField.propTypes};function P8(e){const t=b.useTheme(),n=de.useLocales(),{source:r=""}=e,o=de.useRecordContext(e),s=o[r],l=!nf(s,n),u=Pr(e,{flex:1}),[A]=de.useLocaleState(),g=w.useMemo(()=>l?f.jsx(et.FlagFilled,{style:{color:t.palette.warning.main}}):f.jsx(et.FlagOutlined,{}),[l]),p=w.useMemo(()=>f.jsx(b.Stack,{children:Ae.map(n,(C,h)=>f.jsx(b.Typography,{children:`${C.locale.toUpperCase()}: ${(s??{})[C.locale]??""}`},h))}),[s,n]);return f.jsx(Ff,{title:p,arrow:!1,children:f.jsxs(b.Stack,{alignItems:"center",direction:"row",gap:1,children:[g,f.jsx(Bu,{...e,source:`${r}.${A}`,sx:u})]})})}const S8=ue("div")(({theme:e})=>({borderBottom:`1px solid ${e.palette.divider}`,paddingTop:e.spacing(1),paddingBottom:e.spacing(1),marginBottom:e.spacing(1),whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis",[e.breakpoints.down("sm")]:{whiteSpace:"normal",overflow:"visible",textOverflow:"inherit"}})),Uf=({source:e,defaultValue:t,...n})=>{const r=R.useRecordContext(n),o=dt.get(r,e,t);return f.jsx("span",{dangerouslySetInnerHTML:{__html:o&&o!==null?o:t}})};Uf.propTypes={defaultValue:c.any,source:c.string,record:c.object};Uf.defaultProps={defaultValue:"&nbsp;"};const iy=({title:e,children:t})=>e&&e!==!1?f.jsx(b.Tooltip,{title:e,placement:"top",children:t}):t;iy.propTypes={title:c.oneOfType([c.string,c.bool]),children:c.oneOfType([c.element,c.arrayOf(c.element)])};const Yf=({label:e,source:t,defaultValue:n,children:r,tooltip:o,...s})=>{const{getCurrentDialog:l}=ci(),u=R.useRecordContext(s),A=R.useResourceContext(s),g=l(),p=w.useMemo(()=>!o||o===!1?!1:typeof o=="function"?o(u):typeof o=="string"?dt.get(u,o,o):o,[u,o]);return f.jsx(iy,{title:p,children:f.jsxs(w.Fragment,{children:[f.jsx(b.InputLabel,{children:f.jsx(R.FieldTitle,{label:e,source:t,resource:g||A})}),f.jsx(S8,{...s,children:w.cloneElement(r,{source:t,record:u,defaultValue:n,resource:g||A})})]})})};Yf.propTypes={defaultValue:c.any,tooltip:c.oneOfType([c.string,c.bool,c.func]),source:c.string,label:c.string,name:c.string,children:c.element};Yf.defaultProps={defaultValue:"&nbsp;",children:f.jsx(Uf,{})};const Gf=function({children:e,className:t}){return f.jsx("div",{className:t,children:e})};Gf.defaultProps={children:null,className:""};Gf.propTypes={children:c.node,className:c.string};const R8=Ta(Gf,{name:"RaApplicaReferenceManyField",slot:"root"})(({theme:e,margin:t,border:n,bulkActionButtons:r})=>({marginLeft:t?0:`-${e.spacing(2.5)}`,marginRight:t?0:`-${e.spacing(2.5)}`,borderBottom:n?`1px solid ${e.palette.divider}`:"none","& form":{padding:e.spacing(2)},"& .MuiCardContent-root":{borderTop:n?`1px solid ${e.palette.divider}`:"none"},"& .MuiToolbar-root":{[e.breakpoints.up("sm")]:{marginTop:`-${e.spacing(2)}`,marginBottom:e.spacing(t?0:1),marginLeft:e.spacing(t?1:2),marginRight:e.spacing(t?1:2),width:t?"auto":`calc(100% - ${e.spacing(5)})`},[e.breakpoints.down("md")]:{marginTop:0}},"& .RaDatagrid-root":{overflowX:"auto",paddingTop:r===!1?0:48,[e.breakpoints.down("sm")]:{width:"calc(100vw - 34px)"}},"& .RaDatagrid-table":{borderBottom:`1px solid ${e.palette.divider}`},"& .MuiTablePagination-toolbar":{marginTop:e.spacing(1),marginBottom:0},"& .RaBulkActionsToolbar-collapsed.RaBulkActionsToolbar-toolbar":{minHeight:0},"& .RaBulkActionsToolbar-toolbar":{minHeight:48,bottom:-56,"& h6":{marginTop:e.spacing(.5)},"& .RaBulkActionsToolbar-topToolbar":{marginTop:e.spacing(1)},[e.breakpoints.down("sm")]:{bottom:-48,borderRadius:0}}})),fs=e=>f.jsx(R8,{...e,children:f.jsx(R.ReferenceManyField,{pagination:f.jsx(R.Pagination,{}),...e})});fs.defaultProps={margin:!1,border:!1};fs.propTypes={...R.ReferenceManyField.propTypes,margin:c.bool,border:c.bool};const sy=({source:e,...t})=>{const n=R.useRecordContext(t),r=dt.get(n,e,0),o=r/1024,s=o/1024,l=s/1024,u=l>1?`${l.toFixed(2)} GB`:s>1?`${s.toFixed(2)} MB`:o>1?`${o.toFixed(2)} KB`:`${r.toFixed(2)} B`;return f.jsx(b.Typography,{component:"span",variant:"body1",...t,children:u})};sy.propTypes={record:c.object,source:c.string};const nt=({label:e,children:t,display:n,helperText:r,sx:o,addLabel:s,divider:l,...u})=>{const A=_t.useTheme(),{getCurrentDialog:g}=ci(),{source:p,resource:C,isRequired:h}=u,{fieldState:{invalid:m}}=R.useInput(u),I=g();return f.jsxs(b.Stack,{spacing:1,sx:{width:u!=null&&u.fullWidth?"100%":"auto","& .MuiFormHelperText-root":{color:m?A.palette.error.main:A.palette.text.secondary,"& span":{display:"none"}},...o},children:[n==="label"&&e!==!1&&s!==!1&&f.jsx(b.InputLabel,{error:m===!0,sx:{borderBottom:l?`1px solid ${A.palette.divider}`:"none",pb:l?1:0,mt:l?1:0},children:f.jsx(R.FieldTitle,{label:e,source:p,resource:I||C,isRequired:h})}),w.isValidElement(t)?w.cloneElement(t,{...t.props,...u,label:n==="legend"?e:!1}):t,n==="label"&&r&&f.jsx(b.FormHelperText,{sx:{pl:1.8,pb:2,marginTop:"0 !important"},error:m===!0,children:r})]})};nt.propTypes={sx:c.object,children:c.element,label:c.oneOfType([c.string,c.bool]),addLabel:c.bool,resource:c.string,isRequired:c.bool,source:c.string,display:c.oneOf(["legend","label"]),helperText:c.oneOfType([c.string,c.bool]),divider:c.bool};nt.defaultProps={display:"label",divider:!1};const O8=e=>e?{"& .RaFileInput-removeButton > .RaFileInputPreview-removeButton":{display:"none",visiblity:"hidden"},"& .RaFileInput-dropZone":{display:"none",visiblity:"hidden"}}:{},j8=ue(R.FileInput,{name:"RaApplicaFileInput",slot:"root"})(({disabled:e,theme:t})=>({"& .previews":{},"& .previews>div":{marginTop:t.spacing(1),padding:t.spacing(1.5),border:`1px solid ${t.palette.divider}`,borderRadius:t.shape.borderRadius,"& button":{float:"right",placeItems:"flex-end",verticalAlign:"middle"},"&:hover":{backgroundColor:t.palette.action.hover},"& .MuiLink-root":{fontSize:t.typography.body1.fontSize}},...O8(e)})),Kf=({children:e,disabled:t,type:n,...r})=>{const o=R.useRecordContext(r),s=r==null?void 0:r.source,l=o==null?void 0:o.id;return R.useInput({source:`__${n}__${r==null?void 0:r.source}`,defaultValue:r==null?void 0:r.source}),f.jsx(nt,{...r,children:f.jsx(j8,{disabled:t,children:w.cloneElement(e,{...e.props,entityId:l,property:s})})})};Kf.propTypes={...R.FileInput.propTypes,children:c.node,multiple:c.bool,disabled:c.bool};Kf.defaultProps={children:f.jsx(Vf,{title:"name",source:"path"}),multiple:!0,disabled:!1,type:"attachment"};const M8=ue(R.AutocompleteArrayInput,{name:"StyledAutocompleteInput",root:"root"})(({label:e})=>({"& legend":{width:e===!1?0:"auto"},"& .MuiAutocomplete-inputRoot":{padding:"0px 9px"},'& label.MuiFormLabel-root[data-shrink="false"]':{minHeight:"18px"}})),qf=({...e})=>f.jsx(nt,{...e,children:f.jsx(M8,{})});qf.propTypes={...R.AutocompleteArrayInput.propTypes,...nt.propTypes};qf.defaultProps={...R.AutocompleteArrayInput.defaultProps,size:"small"};const D8=ue(R.AutocompleteInput,{name:"StyledAutocompleteInput",root:"root"})(({label:e})=>({"& legend":{width:e===!1?0:"auto"},'& label.MuiFormLabel-root[data-shrink="false"]':{minHeight:"18px"},"& .MuiAutocomplete-inputRoot":{padding:"0px 9px"},"& .MuiOutlinedInput-root.MuiInputBase-sizeSmall":{paddingTop:"4px"}})),Jf=e=>{const{perPage:t,...n}=e;return f.jsx(nt,{...n,children:f.jsx(D8,{})})};Jf.propTypes={...R.AutocompleteInput.propTypes,...nt.propTypes};Jf.defaultProps={...R.AutocompleteInput.defaultProps,size:"small"};const k8=ue(R.BooleanInput,{name:"RaApplicaBooleanInput",slot:"Root"})(()=>({})),Xf=({horizontal:e,...t})=>{const n=Rt();return f.jsx(nt,{...t,sx:e?{flexDirection:e?"row":"column",alignItems:e?"center":"flex-start","& .MuiFormGroup-root":{margin:0},"& .MuiFormControlLabel-root":{margin:0,"& .MuiTypography-root":{display:"none",visibility:"hidden"},"& .MuiSwitch-root":{marginRight:`-${n.spacing(.5)}`}}}:{},children:f.jsx(k8,{})})};Xf.defaultProps={...R.BooleanInput.defaultProps,...nt.defaultProps};Xf.propTypes={...R.BooleanInput.propTypes,...nt.propTypes,horizontal:c.bool};const F8=ue(R.DateInput,{name:"RaApplicaDateInput",slot:"root"})(({label:e})=>({"& legend":{width:e===!1?0:"auto"}})),Zf=e=>f.jsx(nt,{...e,children:f.jsx(F8,{})});Zf.propTypes={...R.DateInput.propTypes,...nt.propTypes};Zf.defaultProps={...R.DateInput.defaultProps,...nt.defaultProps};const L8=ue(R.DateTimeInput,{name:"RaApplicaDateTimeInput",slot:"root"})(({label:e})=>({"& legend":{width:e===!1?0:"auto"}})),_f=e=>f.jsx(nt,{...e,children:f.jsx(L8,{})});_f.propTypes={...R.DateTimeInput.propTypes,...nt.propTypes};_f.defaultProps={...nt.defaultProps};const N8=ue(R.FileInput,{name:"RaApplicaFileInput",slot:"root"})(({theme:e})=>({"& .previews":{},"& .previews>div":{marginTop:e.spacing(1),padding:e.spacing(1.5),border:`1px solid ${e.palette.divider}`,borderRadius:e.shape.borderRadius,"& button":{float:"right",placeItems:"flex-end",verticalAlign:"middle"},"&:hover":{backgroundColor:e.palette.action.hover},"& .MuiLink-root":{fontSize:e.typography.body1.fontSize}}})),$f=({children:e,title:t,...n})=>{const r=ai.useWatch({name:n.source}),o=R.useRecordContext(n),{source:s}=n,l=w.useMemo(()=>{if(r&&(r!=null&&r.title))return r==null?void 0:r.title;const u=dt.get(o,s);if(u){const A=u.split("__");return A.length>0?A[A.length-1]:u}return u},[o,s,r]);return f.jsx(nt,{...n,children:f.jsx(N8,{children:w.cloneElement(e,{...e.props,title:t||s,source:s,record:{...o,[s]:(r==null?void 0:r.title)||dt.get(o,s),[`_${s}`]:(r==null?void 0:r.src)||dt.get(o,`_${s}`),[t||s]:l}})})})};$f.propTypes={...R.FileInput.propTypes,source:c.string,title:c.string,children:c.node};$f.defaultProps={children:f.jsx(zf,{})};const ep=({children:e,title:t,...n})=>{const r=ai.useWatch({name:n.source}),o=R.useRecordContext(n),{source:s}=n;return R.useInput({source:`__image__${n==null?void 0:n.source}`,defaultValue:n==null?void 0:n.source}),f.jsx(nt,{...n,children:f.jsx(R.ImageInput,{accept:"image/*",children:w.cloneElement(e,{...e.props,title:t,source:s,record:{...o,[s]:(r==null?void 0:r.title)||dt.get(o,s),[`_${s}`]:(r==null?void 0:r.src)||dt.get(o,`_${s}`)}})})})};ep.defaultProps={children:f.jsx(Eu,{}),multiple:!1};ep.propTypes={...R.ImageInput.propTypes,source:c.string,title:c.string,children:c.node,multiple:c.bool};const Mn=e=>f.jsx(nt,{...e,children:f.jsx(R.TextInput,{})});Mn.propTypes={...R.TextInput.propTypes,...nt.propTypes};const V8={vertical:"bottom",horizontal:"right"},H8={vertical:"top",horizontal:"right"};function W8(e){const{source:t}=e,{fieldState:n}=de.useInput(e),r=ai.useWatch({name:t}),{error:o}=n,s=de.useLocales(),l=!nf(r,s),[u]=de.useLocaleState(),[A,g]=w.useState(u),[p,C]=w.useState(null),h=!!p,m=w.useCallback(v=>C(h?null:v.currentTarget),[h,C]),I=w.useCallback(()=>C(null),[C]),B=w.useMemo(()=>Ae.map(s,(v,O)=>f.jsx(b.MenuItem,{onClick:()=>{g(v.locale),I()},children:f.jsx(b.ListItemText,{primary:`${v.locale.toUpperCase()}: ${(r??{})[v.locale]??""}`})},O)),[s,g,I,r]);return f.jsx(nt,{...e,helperText:o==null?void 0:o.message,children:f.jsxs(b.Box,{flex:1,children:[Ae.map(s,(v,O)=>f.jsx(Mn,{...e,source:`${t}.${v.locale}`,sx:{width:"100%",display:v.locale===A?"inline-flex":"none"},label:!1,InputProps:{endAdornment:f.jsx(b.Chip,{label:f.jsx(b.Typography,{variant:"button",children:A}),size:"small",onClick:m,color:l?"warning":void 0})}},O)),f.jsx(b.Menu,{anchorEl:p,open:h,anchorOrigin:V8,transformOrigin:H8,onClose:I,children:B})]})})}const z8=ue(R.NumberInput,{name:"RaApplicaNumberInput",slot:"root"})(({label:e})=>({"& legend":{width:e===!1?0:"auto"}})),tp=e=>f.jsx(nt,{...e,children:f.jsx(z8,{})});tp.propTypes={...R.NumberInput.propTypes,...nt.propTypes};tp.defaultProps={...R.NumberInput.defaultProps,...nt.defaultProps};const ay=({source:e,minWidth:t=300,children:n})=>{const r=R.useResourceContext(),o=R.useRecordContext(),[s,l]=w.useState(dt.get(o,e,"")),[u,A]=w.useState(!1),g=w.useCallback(I=>l(I.target.value),[]),p=R.useDataProvider(),C=w.useCallback(I=>{I.key==="Enter"&&(A(!0),p.update(r,{id:o.id,data:{...o,[e]:s,_changed:e}}).then(()=>A(!1)))},[s,p,r,o,e]),h=w.useCallback(()=>{dt.get(o,e)!==s&&(A(!0),p.update(r,{id:o.id,data:{...o,[e]:s,_changed:e}}).then(()=>A(!1)))},[s,p,r,e,o]),m=w.useCallback(I=>{A(!0),p.update(r,{id:o.id,data:{...o,[e]:I,_changed:e}}).then(()=>A(!1))},[p,r,e,o]);return w.useEffect(()=>l(dt.get(o,e)),[o,e]),n?w.cloneElement(n,{...n.props,source:e,value:s,onChange:m}):f.jsx(b.TextField,{value:s,disabled:u,onChange:g,onKeyPress:C,onBlur:h,style:{minWidth:t,width:"100%"},multiline:!0,InputProps:{"arial-label":"naked"},size:"small"})};ay.propTypes={source:c.string.isRequired,minWidth:c.number,children:c.element};const np=({children:e,...t})=>f.jsx(R.ReferenceArrayInput,{...t,children:w.cloneElement(e,{...t,source:e.props.source||t.source})});np.propTypes={...R.ReferenceArrayInput.propTypes,children:c.element};np.defaultProps={...R.ReferenceArrayInput.defaultProps};const rp=({children:e,...t})=>f.jsx(R.ReferenceInput,{...t,children:w.cloneElement(e,{...t,source:e.props.source||t.source})});rp.propTypes={...R.ReferenceInput.propTypes,children:c.element};rp.defaultProps={...R.ReferenceInput.defaultProps};const op=({reference:e,target:t,children:n,filters:r,actions:o,...s})=>f.jsx(R.ResourceContextProvider,{value:e,children:f.jsx(fs,{perPage:5,pagination:f.jsx(R.Pagination,{}),...s,reference:e,target:t,children:f.jsxs(w.Fragment,{children:[f.jsx(R.ListToolbar,{filters:r,actions:o}),n]})})});op.propTypes={...fs.propTypes,children:c.node.isRequired,reference:c.string.isRequired,target:c.string.isRequired,filters:c.oneOfType([c.element,c.func,c.element,c.arrayOf(c.node)]),actions:c.oneOfType([c.element,c.func,c.element])};op.defaultProps={...fs.defaultProps};const U8=ue(R.SearchInput,{name:"RaApplicaSearchInput",slot:"root"})(()=>({})),Y8=e=>f.jsx(U8,{...e}),ly=ue(R.SelectArrayInput,{name:"RaApplicaSelectArrayInput",slot:"Root"})(({label:e})=>({"& legend":{width:e===!1?0:"auto"},"& .RaSelectArrayInput-chips > .RaSelectArrayInput-chip":{marginTop:"-2px",marginBottom:"-2px"},'& label.MuiFormLabel-root[data-shrink="false"]':{marginTop:"2px"}}));ly.propTypes={...R.SelectArrayInput.propTypes};const ip=e=>f.jsx(nt,{...e,children:f.jsx(ly,{options:{autoWidth:!1}})});ip.defaultProps={optionText:"name",optionValue:"id"};ip.propTypes={...R.SelectArrayInput.propTypes,...nt.propTypes};const G8=ue(R.SelectInput,{name:"RaApplicaSelectArrayInput",slot:"Root"})(({label:e})=>({"& legend":{width:e===!1?0:"auto"},'& label.MuiFormLabel-root[data-shrink="false"]':{marginTop:"2px"}})),cy=e=>f.jsx(nt,{...e,children:f.jsx(G8,{})});cy.propTypes={...R.SelectInput.propTypes,...nt.propTypes};const vu=({...e})=>{var u,A;const t=R.useTranslate(),n=R.maxLength(e==null?void 0:e.maxLength,"app.input.max_length_error"),r=(A=(u=ai.useController({name:e==null?void 0:e.source}))==null?void 0:u.field)==null?void 0:A.value;let o=e.helperText,s=e.validate;s?Array.isArray(s)&&s.indexOf(n)===-1&&s.push(n):s=[n];const l=t("app.input.max_length_info",{count:(r==null?void 0:r.length)||0,max:e==null?void 0:e.maxLength});return e!=null&&e.maxLength&&(o=o&&o.length>0?`${l} - ${t(o)}`:l),f.jsx(Mn,{...e,validate:s,helperText:o,inputProps:{maxLength:e==null?void 0:e.maxLength}})};vu.displayName="SmartTextInput";vu.defaultProps={multiline:!1};vu.propTypes={...Mn.propTypes,maxLength:c.number,multiline:c.bool,rows:c.number};const K8=e=>{if(!e)return"";const t=aB(e);return t?t.format("HH:mm"):""},q8=e=>e,J8=ue(R.TimeInput,{name:"RaApplicaTimeInput",slot:"root"})(({label:e})=>({"& legend":{width:e===!1?0:"auto"}})),sp=e=>f.jsx(nt,{...e,children:f.jsx(J8,{})});sp.defaultProps={...R.TimeInput.defaultProps,format:K8,parse:q8};sp.propTypes={...R.TimeInput.propTypes,...nt.propTypes};const ap=({onSuccess:e,firstAccess:t})=>{const{spacing:n}=Ln(),[r,o]=w.useState(!1),s=de.useAuthProvider(),l=de.useTranslate(),u=de.useNotify(),A=w.useCallback(g=>{const{oldPassword:p,newPassword:C}=g;o(!0),s==null||s.changePassword(p,C).then(()=>{u("ra.auth.password_changed"),e()}).catch(h=>{u((h==null?void 0:h.message)||(h==null?void 0:h.toString()),{type:"error"})}).finally(()=>o(!1))},[s,e]);return f.jsx(de.ResourceContextProvider,{value:"user/change-password",children:f.jsx(de.EditContextProvider,{value:{record:{},resource:"user/change-password",save:A},children:f.jsx(Cu,{onSubmit:A,toolbar:f.jsx(pr,{children:f.jsx(R.SaveButton,{disabled:r})}),children:f.jsxs(b.Grid,{container:!0,spacing:n,children:[t===!0&&f.jsx(b.Grid,{item:!0,xs:12,children:f.jsxs(b.Alert,{severity:"warning",children:[f.jsx(b.AlertTitle,{children:l("ra.auth.first_access.change_password")}),l("ra.auth.first_access.change_password_helper")]})}),f.jsx(b.Grid,{item:!0,xs:12,children:f.jsx(Mn,{source:"oldPassword",type:"password",validate:de.required()})}),f.jsx(b.Grid,{item:!0,xs:12,children:f.jsx(Mn,{source:"newPassword",type:"password",validate:de.required()})})]})})})})},X8=ue(R.Edit,{name:"RaApplicaEdit",slot:"root"})(({theme:e})=>({"&>.MuiToolbar-root:first-of-type":{backgroundColor:e.palette.background.default},"& .RaEdit-card":{[e.breakpoints.down("sm")]:{marginBottom:e.spacing(6)}},"& .RaEdi-card, & > div > div > form":{backgroundColor:e.palette.background.default},"& .RaToolbar-mobileToolbar":{borderTop:`1px solid ${e.palette.divider}`},"& .RaEdit-main>.MuiPaper-root:first-of-type":{overflow:"visible",backgroundColor:e.palette.background.default}})),Z8=ue(b.CardHeader)(({theme:e})=>({marginTop:e.spacing(4),marginLeft:0,marginRight:0,paddingLeft:0,paddingRight:0})),_8=ue(b.Divider)(({theme:e})=>({marginLeft:`-${e.spacing(2.5)}`,marginRight:`-${e.spacing(2.5)}`,marginBottom:e.spacing(2),width:`calc(100% + ${e.spacing(5)})`})),lp=({title:e,divider:t,variant:n})=>{const r=R.useTranslate();return f.jsxs(w.Fragment,{children:[f.jsx(Z8,{title:r(e,{_:e}),titleTypographyProps:{variant:n}}),t&&f.jsx(_8,{})]})};lp.propTypes={title:c.string.isRequired,divider:c.bool,variant:c.oneOf(["h1","h2","h3","h4","h5","h6"])};lp.defaultProps={divider:!0,variant:"h4"};const $8=ue(b.Grid,{name:"ApplicaLongFormView",slot:"Root"})(({theme:e})=>({"& .MuiToolbar-root":{position:"initial",marginTop:e.spacing(2),marginLeft:`-${e.spacing(3)}`,marginRight:`-${e.spacing(3)}`,marginBottom:`-${e.spacing(2)}`,borderTop:`1px solid ${e.palette.divider}`,[e.breakpoints.down("sm")]:{position:"initial !important",width:"auto !important",marginRight:0}},"& form > .MuiToolbar-root":{margin:0,marginRight:`-${e.spacing(.5)}`,[e.breakpoints.down("sm")]:{marginRight:e.spacing(.5)}}}));function uy(e){const{spacing:t}=Ln(),{spacing:n=t}=e,r=Ae.omit(e,["spacing"]);return f.jsx(R.Form,{...r,children:f.jsx($8,{container:!0,spacing:n*2,children:e.children})})}function Cg(e){return e.id??e.label}function Ay(e,t){const n=`^${e}.`.replaceAll(".","\\."),r=new RegExp(n,"g");return t.match(r)!==null}function e6(e){return Ae.map(e,"id")}function Rc(e){const t=e.match(new RegExp("[^.]+","g"));return t===null?0:t.length}function dy(e,t){const n=e!==void 0?Rc(e):0;return Ae.chain(t).filter(o=>e!==void 0?Ay(e,o.id):!0).filter(o=>Rc(o.id)===n+1).value()}function t6(e,t){var s;const n=Ae.clone(e),{type:r,payload:o}=t;switch(r){case"setFormRootPath":return Ae.extend(n,{formRootPath:o});case"setSyncWithLocation":return Ae.extend(n,{syncWithLocation:o});case"setErrorCount":return Ae.extend(n,{errorCount:o});case"setActiveItem":return Ae.includes(e6(e.items),o)?Ae.extend(n,{activeItem:o}):n;case"addItem":{const{id:l}=o;return Ae.extend(n,{items:Ae.chain(n.items).clone().reject(u=>u.id===l).concat([o]).orderBy(u=>u.index).value()})}case"removeItem":{const l=Ae.isString(o)?o:o.id,u=Ae.chain(n.items).clone().reject(A=>A.id===l).value();return Ae.extend(n,{items:u}),n.activeItem===l&&Ae.extend(n,{activeItem:((s=Ae.first(u))==null?void 0:s.id)??void 0}),n}default:return n}}const n6={syncWithLocation:!0,errorCount:!0,items:[],activeItem:void 0},gy=w.createContext(void 0);function fy(e){const t=!!(e.syncWithLocation??!0),n=!!(e.errorCount??!0),{rootMatchString:r}=e,{pathname:o}=_i.useLocation(),[s,l]=w.useReducer(t6,Ae.cloneDeep(n6)),{formRootPath:u,items:A}=s,g=w.useMemo(()=>({state:s,dispatch:l}),[s,l]);return w.useEffect(()=>{const p=["entities/:resource/create/*",":resource/create/*","entities/:resource/:id/show/*",":resource/:id/show/*","entities/:resource/:id/*",":resource/:id/*"];r!==void 0&&p.push(r);const C=Ae.chain(p).map(m=>_i.matchPath(m,o)).reject(m=>m===null).first().value(),h=C==null?void 0:C.pathnameBase;h!==void 0&&h!==u&&l({type:"setFormRootPath",payload:h})},[o,u,r]),w.useEffect(()=>{l({type:"setSyncWithLocation",payload:!!t})},[t,l]),w.useEffect(()=>{l({type:"setErrorCount",payload:!!n})},[n,l]),w.useEffect(()=>{var p;if(t&&u!==void 0){let C=o.replace(u,"").replace(new RegExp(/^\/?/),"");Ae.isEmpty(C)&&(C=((p=Ae.chain(A).filter(h=>dy(h.id,A).length===0).orderBy([h=>Rc(h.id),h=>h.index]).first().value())==null?void 0:p.id)??void 0),l({type:"setActiveItem",payload:C})}},[l,u,o,A]),f.jsx(gy.Provider,{value:g,children:e.children})}function py(){const e=w.useContext(gy);if(e===void 0)throw new Error("[LongForm] useFormContext: context undefined. Please provide a valid Context using LongForm.Provider");return e}function ka(){return py().state}function cp(){return py().dispatch}function hy(){return ka().formRootPath}function Cy(){return ka().activeItem}function my(){return ka().items}function Ey(){return ka().syncWithLocation}function Iy(){return ka().errorCount}function By(){const e=cp();return w.useCallback(n=>{e({type:"setActiveItem",payload:n})},[e])}function vy(){const e=cp();return w.useCallback(n=>{e({type:"addItem",payload:n})},[e])}function yy(){const e=cp();return w.useCallback(n=>{e({type:"removeItem",payload:n})},[e])}var r6=e=>{let t=e;for(;t=t.parentElement;){const n=getComputedStyle(t,null).getPropertyValue("overflow-y");if(t===document.body)return window;if(n==="auto"||n==="scroll"||n==="overlay")return t}return window},by=e=>e.firstChild?e.firstChild.offsetParent===e:!0,o6=(e,t)=>{let n=e,r=0;by(t)||(r+=e.offsetTop-t.offsetTop,t=e.offsetParent,r+=-e.offsetTop);do r+=n.offsetTop,n=n.offsetParent;while(n&&n!==t);return r},i6=e=>{let t=e.parentElement;for(;t&&getComputedStyle(t,null).getPropertyValue("display")==="contents";)t=t.parentElement;return t||window},ma=null;typeof CSS<"u"&&CSS.supports&&(CSS.supports("position","sticky")?ma="sticky":CSS.supports("position","-webkit-sticky")&&(ma="-webkit-sticky"));var Oc=!1;try{const e=Object.defineProperty({},"passive",{get(){Oc={passive:!0}}}),t=()=>{};window.addEventListener("testPassive",t,e),window.removeEventListener("testPassive",t,e)}catch{}var Pd=e=>{const{el:t,onChange:n,unsubs:r,measure:o}=e;if(t===window){const s=()=>({top:0,left:0,height:window.innerHeight,width:window.innerWidth}),l=o(s()),u=()=>{Object.assign(l,o(s())),n()};return window.addEventListener("resize",u,Oc),r.push(()=>window.removeEventListener("resize",u)),l}else{const s=o(t.getBoundingClientRect()),l=()=>{Object.assign(s,o(t.getBoundingClientRect())),n()},u=new ResizeObserver(l);return u.observe(t),r.push(()=>u.disconnect()),s}},s6=e=>{const t=getComputedStyle(e,null),n=parseInt(t.getPropertyValue("padding-top"),10),r=parseInt(t.getPropertyValue("padding-bottom"),10);return{top:n,bottom:r}},a6=(e,t,n)=>{const{bottom:r,offsetBottom:o,offsetTop:s}=n,l=r6(e);let u=!1;const A=()=>{u||requestAnimationFrame(()=>{const k=C();k!==x&&S(k),u=!1}),u=!0};let g=l===window?window.scrollY:l.scrollTop;const p=k=>{const{offsetTop:q,height:J}=m,{naturalTop:U}=v,{height:_}=O;return k+q+J>=U+_+j+o},C=()=>{const{height:k}=m,{height:q}=O;return q+s+o<=k?3:p(g)?1:2},h=l!==window&&by(l),m=Pd({el:l,onChange:A,unsubs:t,measure:({height:k,top:q})=>({height:k,offsetTop:h?q:0})}),I=i6(e),B=I===window?{top:0,bottom:0}:s6(I),v=Pd({el:I,onChange:A,unsubs:t,measure:({height:k})=>({height:k-B.top-B.bottom,naturalTop:I===window?0:o6(I,l)+B.top+m.offsetTop})}),O=Pd({el:e,onChange:A,unsubs:t,measure:({height:k})=>({height:k})});let j=0,x=C();const S=k=>{const q=x;if(x=k,q===2&&(j=-1),k===3){e.style.position=ma,r?e.style.bottom=`${o}px`:e.style.top=`${s}px`;return}const{height:J,offsetTop:U}=m,{height:_,naturalTop:le}=v,{height:ie}=O;if(k===2)if(e.style.position="relative",j=q===0?Math.max(0,U+g-le+s):Math.max(0,U+g+J-(le+ie+o)),r){const Z=Math.max(0,_-ie-j);e.style.bottom=`${Z}px`}else e.style.top=`${j}px`;else e.style.position=ma,k===1?r?e.style.bottom=`${o}px`:e.style.top=`${J-ie-o}px`:r?e.style.bottom=`${J-ie-o}px`:e.style.top=`${s}px`};S(x);const P=k=>{if(k===g)return;const q=k-g;if(g=k,x===3)return;const{offsetTop:J,height:U}=m,{naturalTop:_,height:le}=v,{height:ie}=O;if(q>0)if(x===0){if(k+J+s>_){const Z=Math.max(0,J+g-_+s);k+J+U<=_+ie+Z+o?S(2):S(1)}}else x===2&&p(k)&&S(1);else if(x===1){if(J+k+U<_+le+o){const Z=Math.max(0,J+g+U-(_+ie+o));J+k+s>=_+Z?S(2):S(0)}}else x===2&&J+k+s<_+j&&S(0)},L=l===window?()=>P(window.scrollY):()=>P(l.scrollTop);l.addEventListener("scroll",L,Oc),l.addEventListener("mousewheel",L,Oc),t.push(()=>l.removeEventListener("scroll",L),()=>l.removeEventListener("mousewheel",L))},l6=({offsetTop:e=0,offsetBottom:t=0,bottom:n=!1}={})=>{const[r,o]=w.useState(null);return w.useEffect(()=>{if(!r||!ma)return;const s=[];return a6(r,s,{offsetBottom:t,offsetTop:e,bottom:n}),()=>{s.forEach(l=>l())}},[r,t,e,n]),o},c6=e=>{const{offsetTop:t,offsetBottom:n,bottom:r,children:o,className:s,style:l}=e,u=l6({offsetTop:t,offsetBottom:n,bottom:r});return f.jsx("div",{className:s,style:l,ref:u,children:o})},u6=c6,Qy=(e=>(e.TOP="top",e.BOTTOM="bottom",e))(Qy||{});function xy(e){const{sticky:t=!0,disposition:n={xl:3,lg:3,md:4,sm:4,xs:12},spacing:r=2}=e,o=Ae.omit(e,["sticky","disposition","spacing"]),s=t?u6:b.Box,l=w.useMemo(()=>t?{offsetTop:74,offsetBottom:r*2}:{},[t,r]);return f.jsx(b.Grid,{...o,item:!0,...n,children:f.jsx(s,{...l,children:f.jsx(b.Stack,{spacing:r,children:e.children})})})}function wy(e){return f.jsx(f.Fragment,{children:e.children})}function Ty(e){const{children:t}=e;return w.useMemo(()=>{const r={top:[],bottom:[]};return w.Children.forEach(t,o=>{if(w.isValidElement(o)&&(o==null?void 0:o.type)===wy){const{position:s}=o.props;switch(s){case"top":r.top.push(o);break;case"bottom":r.bottom.push(o);break}}}),r},[t])}function Py(e){const{disposition:t={xl:9,lg:9,md:8,sm:8,xs:12}}=e,n=Ae.omit(e,["disposition"]);return f.jsx(b.Grid,{...n,item:!0,...t,children:e.children})}function Sy(e){const t=Cy();return t===void 0?!1:e===t||Ay(e,t)}function Ry(e){const t=my();return w.useMemo(()=>dy(e,t),[t,e])}function A6(){const e=hy(),{search:t}=_i.useLocation(),n=_i.useNavigate();return w.useCallback(o=>{n(`${e}/${o}${t}`)},[e,n])}function Oy(){const e=Ry();return f.jsx(b.Card,{variant:"outlined",children:f.jsx(b.List,{sx:{"& .MuiListItemButton-root.Mui-selected":{borderColor:"palette.primary.main",borderRightStyle:"solid",borderRightWidth:2},"& .MuiListItemAvatar-root":{minWidth:24}},children:Ae.map(e,(t,n)=>f.jsx(up,{...t},n))})})}function up(e){const t=de.useTranslate()??Ae.identity,n=jy(e),{selected:r,label:o,icon:s,onClick:l,badge:u,items:A,isGroup:g,level:p,errors:C=0}=n,{spacing:h}=Ln(),[m,I]=w.useState(r),B=w.useCallback(j=>{I(!m),l(j)},[l,m]),v=s!==void 0,O=Ae.omit(e,["label","icon","selected","badge"]);return w.useEffect(()=>{r&&!m&&I(r)},[r,m,I]),f.jsxs(f.Fragment,{children:[f.jsx(b.ListItem,{...O,disablePadding:!0,children:f.jsxs(b.ListItemButton,{selected:r&&!g,onClick:B,sx:{pl:h*p},children:[v&&f.jsx(b.ListItemIcon,{children:s}),f.jsx(b.ListItemText,{inset:!v,primary:C===0?t(o):f.jsx(b.Badge,{variant:"dot",color:"error",sx:{"& > .MuiBadge-badge":{transform:"scale(1) translate(125%, 0)"}},children:t(o)})}),u&&f.jsx(b.ListItemAvatar,{children:f.jsx(Ca,{type:"filled",size:"xs",color:u.color??"default",children:u.content})}),g&&(m?f.jsx(Bn.ExpandLess,{}):f.jsx(Bn.ExpandMore,{}))]})}),g&&f.jsx(b.Collapse,{in:m,timeout:"auto",children:f.jsx(b.List,{children:Ae.map(A,(j,x)=>f.jsx(up,{...j},x))})})]})}function jy(e){const{id:t}=e,n=Sy(t),r=Rc(t),o=A6(),s=Ey(),l=By(),u=Ry(t),A=!Ae.isEmpty(u),g=w.useCallback(C=>{A||(s?o(e.id):l(e.id)),Ae.isFunction(e.onClick)&&e.onClick(C)},[l,o,e,s,A]);return w.useMemo(()=>({...e,selected:n,onClick:g,items:u,isGroup:A,level:r}),[e,n,g,u,A])}function My(e=[],t){const n=Ae.isArray(e)?e:[e],r=Ae.filter(n,o=>w.isValidElement(o));Ae.each(r,o=>{var s;t(o),My(((s=o==null?void 0:o.props)==null?void 0:s.children)??[],t)})}function Dy(e){const{errors:t}=ai.useFormState(),n=Iy(),{label:r,icon:o,badge:s,index:l=0,children:u}=e,A=Cg(e),g=vy(),p=yy(),C=Sy(A),h=[];n&&(e.sources!==void 0?h.push(...e.sources):My(u,I=>{var B;((B=I==null?void 0:I.props)==null?void 0:B.source)!==void 0&&h.push(I.props.source)}));const m=Ae.chain(h).uniq().map(I=>Ae.get(t,I)).reject(I=>I===void 0).value().length;return w.useEffect(()=>{g({id:A,index:l,label:r,icon:o,badge:s,errors:m})},[g,p,r,o,A,s,l,m]),w.useEffect(()=>()=>{p(A)},[A]),f.jsx(b.Box,{display:C?"unset":"none",children:e.children})}function ky(e){const t=Ap(e),n=Cg(e);return f.jsx(Dy,{...e,id:n,children:w.Children.map(t,r=>{const o=Cg(r.props);return w.cloneElement(r,{id:`${n}.${o}`})})})}function Fy(e){return f.jsx(Dy,{...e})}function Ap(e){const{children:t}=e;return w.useMemo(()=>Ae.chain(w.Children.toArray(t)).filter(r=>w.isValidElement(r)&&((r==null?void 0:r.type)===Fy||(r==null?void 0:r.type)===ky)).map((r,o)=>w.cloneElement(r,{index:o})).value(),[t])}function d6(e){const{tabsDisposition:t,contentDisposition:n,spacing:r=2}=e,o=Ae.pick(e,["syncWithLocation","errorCount"]),s=Ae.omit(e,["tabsDisposition","contentDisposition","syncWithLocation"]),{top:l,bottom:u}=Ty(e),A=Ap(e);return f.jsx(fy,{...o,children:f.jsxs(uy,{...s,spacing:r,children:[f.jsxs(xy,{disposition:t,spacing:r,children:[l,f.jsx(Oy,{}),u]}),f.jsx(Py,{disposition:n,children:A})]})})}const kt=d6;kt.BaseForm=uy;kt.Content=Py;kt.Provider=fy;kt.useItems=my;kt.useSyncWithLocation=Ey;kt.useErrorCount=Iy;kt.useFormRootPath=hy;kt.useActiveItem=Cy;kt.useSetActiveItem=By;kt.useAddItem=vy;kt.useRemoveItem=yy;kt.Sidebar=xy;kt.SidebarSection=wy;kt.SidebarSectionPosition=Qy;kt.useSidebarChildren=Ty;kt.NavMenu=Oy;kt.NavMenuItem=up;kt.useNavMenuItem=jy;kt.Tab=Fy;kt.Group=ky;kt.useBaseItemChildren=Ap;const g6=ue(R.Show,{name:"RaApplicaShow",slot:"root"})(({theme:e})=>({"&>.MuiToolbar-root:first-of-type":{backgroundColor:e.palette.background.default},"& .RaShow-card, & > div > div > form":{backgroundColor:e.palette.background.default},"& .RaShow-main>.MuiPaper-root:first-of-type":{overflow:"visible"}})),f6=ue(R.SimpleFormIterator,{name:"ApplicaSimpleFormIterator",root:"root"})(({theme:e})=>({"& .RaSimpleFormIterator-line":{paddingTop:e.spacing(1),paddingBottom:e.spacing(.5)},"& .RaSimpleFormIterator-action":{display:"flex",flexDirection:"row",alignItems:"center",mb:1.5},"& section":{width:"100%","& label":{position:"relative",overflow:"visible",transform:"none",marginLeft:0}}})),p6=Ta(R.TabbedForm,{name:"RaApplicaTabbedForm",slot:"Root"})(({theme:e,modal:t})=>({"& .MuiGrid-root.MuiGrid-container":{paddingBottom:e.spacing(t?0:1)},[e.breakpoints.down("sm")]:{paddingBottom:0}})),dp=e=>{const{title:t,modal:n,content:r,subheader:o,secondary:s,sx:l,...u}=e,A=sf(t);return f.jsx(Zn,{title:A,modal:n,content:r,subheader:o,secondary:s,sx:{...l,"& .MuiToolbar-root":{paddingLeft:"20px !important",paddingRight:"20px !important"}},border:!n,divider:!0,children:f.jsx(p6,{toolbar:f.jsx(pr,{}),...u})})};dp.defaultProps={toolbar:f.jsx(pr,{children:f.jsx(R.SaveButton,{type:"button"})}),secondary:f.jsx(li,{children:f.jsx(R.DeleteWithConfirmButton,{})})};dp.Tab=R.TabbedForm.Tab;const h6=D.forwardRef((e,t)=>{const{children:n,disabled:r,disableActions:o=!1,index:s,member:l,resource:u}=e,A=R.useTranslate(),[g,p]=D.useState(!1),{total:C,remove:h}=uB(),m=D.useCallback(()=>{p(!1),h(s)},[s,h]),I=w.useMemo(()=>({index:s,total:C,remove:()=>h(s)}),[s,C,h]);return f.jsxs(ef.Provider,{value:I,children:[w.Children.map(n,(B,v)=>{if(!w.isValidElement(B))return null;const{source:O,...j}=B.props;return f.jsx(b.TableCell,{sx:{border:0,verticalAlign:"top"},children:w.cloneElement(B,{source:O?`${l}.${O}`:l,index:O?void 0:v,resource:u,disabled:r,...j,label:""})})}),!o&&f.jsx(b.TableCell,{sx:{display:"flex",justifyContent:"center",alignItems:"center",border:0,pt:2.5},children:f.jsx(li,{horizontal:!0,children:f.jsx(b.Typography,{color:"error",onClick:()=>p(!0),children:A("ra.action.delete")})})}),n.length>0&&f.jsx(R.Confirm,{isOpen:g,title:A("ra.action.remove_item"),content:A("ra.message.remove_item"),onConfirm:m,onClose:()=>p(!1)})]})});var C6=Array.isArray,yu=C6,m6=typeof Xn=="object"&&Xn&&Xn.Object===Object&&Xn,E6=m6,I6=E6,B6=typeof self=="object"&&self&&self.Object===Object&&self,v6=I6||B6||Function("return this")(),bu=v6,y6=bu,b6=y6.Symbol,Qu=b6,BI=Qu,Ly=Object.prototype,Q6=Ly.hasOwnProperty,x6=Ly.toString,Gs=BI?BI.toStringTag:void 0;function w6(e){var t=Q6.call(e,Gs),n=e[Gs];try{e[Gs]=void 0;var r=!0}catch{}var o=x6.call(e);return r&&(t?e[Gs]=n:delete e[Gs]),o}var T6=w6,P6=Object.prototype,S6=P6.toString;function R6(e){return S6.call(e)}var O6=R6,vI=Qu,j6=T6,M6=O6,D6="[object Null]",k6="[object Undefined]",yI=vI?vI.toStringTag:void 0;function F6(e){return e==null?e===void 0?k6:D6:yI&&yI in Object(e)?j6(e):M6(e)}var gp=F6;function L6(e){return e!=null&&typeof e=="object"}var xu=L6,N6=gp,V6=xu,H6="[object Symbol]";function W6(e){return typeof e=="symbol"||V6(e)&&N6(e)==H6}var fp=W6,z6=yu,U6=fp,Y6=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,G6=/^\w*$/;function K6(e,t){if(z6(e))return!1;var n=typeof e;return n=="number"||n=="symbol"||n=="boolean"||e==null||U6(e)?!0:G6.test(e)||!Y6.test(e)||t!=null&&e in Object(t)}var q6=K6;function J6(e){var t=typeof e;return e!=null&&(t=="object"||t=="function")}var Ny=J6,X6=gp,Z6=Ny,_6="[object AsyncFunction]",$6="[object Function]",eL="[object GeneratorFunction]",tL="[object Proxy]";function nL(e){if(!Z6(e))return!1;var t=X6(e);return t==$6||t==eL||t==_6||t==tL}var Vy=nL,rL=bu,oL=rL["__core-js_shared__"],iL=oL,Sd=iL,bI=function(){var e=/[^.]+$/.exec(Sd&&Sd.keys&&Sd.keys.IE_PROTO||"");return e?"Symbol(src)_1."+e:""}();function sL(e){return!!bI&&bI in e}var aL=sL,lL=Function.prototype,cL=lL.toString;function uL(e){if(e!=null){try{return cL.call(e)}catch{}try{return e+""}catch{}}return""}var AL=uL,dL=Vy,gL=aL,fL=Ny,pL=AL,hL=/[\\^$.*+?()[\]{}|]/g,CL=/^\[object .+?Constructor\]$/,mL=Function.prototype,EL=Object.prototype,IL=mL.toString,BL=EL.hasOwnProperty,vL=RegExp("^"+IL.call(BL).replace(hL,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function yL(e){if(!fL(e)||gL(e))return!1;var t=dL(e)?vL:CL;return t.test(pL(e))}var bL=yL;function QL(e,t){return e==null?void 0:e[t]}var xL=QL,wL=bL,TL=xL;function PL(e,t){var n=TL(e,t);return wL(n)?n:void 0}var wu=PL,SL=wu,RL=SL(Object,"create"),Tu=RL,QI=Tu;function OL(){this.__data__=QI?QI(null):{},this.size=0}var jL=OL;function ML(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t}var DL=ML,kL=Tu,FL="__lodash_hash_undefined__",LL=Object.prototype,NL=LL.hasOwnProperty;function VL(e){var t=this.__data__;if(kL){var n=t[e];return n===FL?void 0:n}return NL.call(t,e)?t[e]:void 0}var HL=VL,WL=Tu,zL=Object.prototype,UL=zL.hasOwnProperty;function YL(e){var t=this.__data__;return WL?t[e]!==void 0:UL.call(t,e)}var GL=YL,KL=Tu,qL="__lodash_hash_undefined__";function JL(e,t){var n=this.__data__;return this.size+=this.has(e)?0:1,n[e]=KL&&t===void 0?qL:t,this}var XL=JL,ZL=jL,_L=DL,$L=HL,e9=GL,t9=XL;function ps(e){var t=-1,n=e==null?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}ps.prototype.clear=ZL;ps.prototype.delete=_L;ps.prototype.get=$L;ps.prototype.has=e9;ps.prototype.set=t9;var n9=ps;function r9(){this.__data__=[],this.size=0}var o9=r9;function i9(e,t){return e===t||e!==e&&t!==t}var s9=i9,a9=s9;function l9(e,t){for(var n=e.length;n--;)if(a9(e[n][0],t))return n;return-1}var Pu=l9,c9=Pu,u9=Array.prototype,A9=u9.splice;function d9(e){var t=this.__data__,n=c9(t,e);if(n<0)return!1;var r=t.length-1;return n==r?t.pop():A9.call(t,n,1),--this.size,!0}var g9=d9,f9=Pu;function p9(e){var t=this.__data__,n=f9(t,e);return n<0?void 0:t[n][1]}var h9=p9,C9=Pu;function m9(e){return C9(this.__data__,e)>-1}var E9=m9,I9=Pu;function B9(e,t){var n=this.__data__,r=I9(n,e);return r<0?(++this.size,n.push([e,t])):n[r][1]=t,this}var v9=B9,y9=o9,b9=g9,Q9=h9,x9=E9,w9=v9;function hs(e){var t=-1,n=e==null?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}hs.prototype.clear=y9;hs.prototype.delete=b9;hs.prototype.get=Q9;hs.prototype.has=x9;hs.prototype.set=w9;var T9=hs,P9=wu,S9=bu,R9=P9(S9,"Map"),O9=R9,xI=n9,j9=T9,M9=O9;function D9(){this.size=0,this.__data__={hash:new xI,map:new(M9||j9),string:new xI}}var k9=D9;function F9(e){var t=typeof e;return t=="string"||t=="number"||t=="symbol"||t=="boolean"?e!=="__proto__":e===null}var L9=F9,N9=L9;function V9(e,t){var n=e.__data__;return N9(t)?n[typeof t=="string"?"string":"hash"]:n.map}var Su=V9,H9=Su;function W9(e){var t=H9(this,e).delete(e);return this.size-=t?1:0,t}var z9=W9,U9=Su;function Y9(e){return U9(this,e).get(e)}var G9=Y9,K9=Su;function q9(e){return K9(this,e).has(e)}var J9=q9,X9=Su;function Z9(e,t){var n=X9(this,e),r=n.size;return n.set(e,t),this.size+=n.size==r?0:1,this}var _9=Z9,$9=k9,eN=z9,tN=G9,nN=J9,rN=_9;function Cs(e){var t=-1,n=e==null?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}Cs.prototype.clear=$9;Cs.prototype.delete=eN;Cs.prototype.get=tN;Cs.prototype.has=nN;Cs.prototype.set=rN;var Hy=Cs,Wy=Hy,oN="Expected a function";function pp(e,t){if(typeof e!="function"||t!=null&&typeof t!="function")throw new TypeError(oN);var n=function(){var r=arguments,o=t?t.apply(this,r):r[0],s=n.cache;if(s.has(o))return s.get(o);var l=e.apply(this,r);return n.cache=s.set(o,l)||s,l};return n.cache=new(pp.Cache||Wy),n}pp.Cache=Wy;var iN=pp,sN=iN,aN=500;function lN(e){var t=sN(e,function(r){return n.size===aN&&n.clear(),r}),n=t.cache;return t}var cN=lN,uN=cN,AN=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,dN=/\\(\\)?/g,gN=uN(function(e){var t=[];return e.charCodeAt(0)===46&&t.push(""),e.replace(AN,function(n,r,o,s){t.push(o?s.replace(dN,"$1"):r||n)}),t}),fN=gN;function pN(e,t){for(var n=-1,r=e==null?0:e.length,o=Array(r);++n<r;)o[n]=t(e[n],n,e);return o}var zy=pN,wI=Qu,hN=zy,CN=yu,mN=fp,EN=1/0,TI=wI?wI.prototype:void 0,PI=TI?TI.toString:void 0;function Uy(e){if(typeof e=="string")return e;if(CN(e))return hN(e,Uy)+"";if(mN(e))return PI?PI.call(e):"";var t=e+"";return t=="0"&&1/e==-EN?"-0":t}var IN=Uy,BN=IN;function vN(e){return e==null?"":BN(e)}var yN=vN,bN=yu,QN=q6,xN=fN,wN=yN;function TN(e,t){return bN(e)?e:QN(e,t)?[e]:xN(wN(e))}var PN=TN,SN=fp,RN=1/0;function ON(e){if(typeof e=="string"||SN(e))return e;var t=e+"";return t=="0"&&1/e==-RN?"-0":t}var jN=ON,MN=PN,DN=jN;function kN(e,t){t=MN(t,e);for(var n=0,r=t.length;e!=null&&n<r;)e=e[DN(t[n++])];return n&&n==r?e:void 0}var FN=kN,LN=FN;function NN(e,t,n){var r=e==null?void 0:LN(e,t);return r===void 0?n:r}var VN=NN;const HN=bo(VN),Yy=e=>{var Z,K;const{children:t,resource:n,source:r,label:o,disableActions:s=!1,disableAdd:l=!1,disableRemove:u=!1,className:A,empty:g,template:p={}}=e,[C,h]=w.useState(!1),{fields:m,remove:I,replace:B,append:v}=R.useArrayInput(e),{resetField:O}=ai.useFormContext(),j=Rt(),x=de.useTranslate(),S=de.useRecordContext(e),P=w.useRef(p||{}),L=de.useTranslateLabel(),k=w.useCallback(V=>{I(V)},[I]);if(m.length>0){const{...V}=m[0];P.current=V;for(const G in P.current)P.current[G]=null}const q=w.useCallback((V=void 0)=>{let G=V;V==null&&(G=P.current,w.Children.count(t)===1&&D.isValidElement(w.Children.only(t))&&!w.Children.only(t).props.source&&w.Children.map(t,$=>D.isValidElement($)&&$.type!==de.FormDataConsumer).some(Boolean)?G="":(G=G||{},w.Children.forEach(t,$=>{D.isValidElement($)&&$.type!==de.FormDataConsumer&&$.props.source&&(G[$.props.source]=$.props.defaultValue??null)})));const F={...G,...p};v(F),O(`${r}.${m.length}`,{defaultValue:G})},[v,t,O,r,m.length,p]),J=V=>G=>{q(),V&&V(G)},U=w.useCallback(()=>{B([]),h(!1)},[B]),_=HN(S,r),le=w.useMemo(()=>({total:m.length,remove:k,source:r}),[m.length,k,r]),ie=j.palette.mode==="dark"?j.palette.grey.A400:j.palette.grey.A800;return m?f.jsx($g.Provider,{value:le,children:f.jsxs("div",{className:A,children:[D.cloneElement(f.jsx(Gy,{}),{label:o,source:r,disableAdd:l,template:p,onClick:J((K=(Z=e==null?void 0:e.addButton)==null?void 0:Z.props)==null?void 0:K.onClick)}),f.jsx(b.TableContainer,{component:b.Paper,sx:{mt:2,border:`1px solid ${ie}`},children:f.jsxs(b.Table,{children:[f.jsx(b.TableHead,{sx:{borderTop:0,borderBottom:`1px solid ${ie}`},children:f.jsxs(b.TableRow,{children:[w.Children.map(t,(V,G)=>D.isValidElement(V)?f.jsx(b.TableCell,{children:f.jsx(b.Typography,{display:"flex",variant:"subtitle1",fontWeight:500,color:"text.primary",textTransform:"none",children:L({...V.props,resource:n})})},G):null),!s&&f.jsx(b.TableCell,{sx:{display:"flex",justifyContent:"center",alignItems:"center",verticalAlign:"top"},children:f.jsx(b.Typography,{display:"flex",variant:"subtitle1",fontWeight:500,color:"text.primary",textTransform:"none"})},"actions")]})}),f.jsxs(b.TableBody,{children:[m.length===0&&f.jsx(b.TableRow,{sx:{"&:last-child td, &:last-child th":{border:0}},children:f.jsx(b.TableCell,{colSpan:4+(s?0:1),align:"center",children:g||f.jsx(b.Typography,{variant:"body1",color:"text.secondary",children:"-"})})}),m.length>0&&m.map((V,G)=>f.jsx(b.TableRow,{sx:{borderBottom:`1px solid ${ie}}`},children:f.jsx(h6,{disableRemove:u,disableActions:s,index:G,member:`${r}.${G}`,onRemoveField:k,record:_&&_[G]||{},resource:n,source:r,children:t})},V.id))]})]})}),m.length>0&&f.jsx(R.Confirm,{isOpen:C,title:x("ra.action.clear_array_input"),content:x("ra.message.clear_array_input"),onConfirm:U,onClose:()=>h(!1)})]})}):null},Gy=e=>{const{label:t,disableAdd:n,onClick:r}=e,o=Rt(),s=o.palette.mode==="dark"?o.palette.grey.A400:o.palette.grey.A800,l=o.palette.mode==="light"?"#000000":"#FFFFFF";return f.jsxs(b.Stack,{justifyContent:"space-between",alignItems:"center",flexDirection:"row",children:[t!==!1&&f.jsx(b.Typography,{children:t}),!n&&(D.isValidElement(e==null?void 0:e.addButton)?D.cloneElement(e==null?void 0:e.addButton,{onClick:r}):f.jsx(b.IconButton,{size:"small",color:"secondary",sx:{border:`1px solid ${s}`},onClick:r,children:f.jsx(et.PlusCircleOutlined,{style:{color:l}})}))]})},WN=ue(Yy,{name:"RaApplicaTableFormIterator",slot:"Root"})(({theme:e})=>({"& > div.MuiPaper-root":{overflowX:"auto",[e.breakpoints.down("sm")]:{width:`calc(100vw - ${e.spacing(8)})`}}}));Gy.propTypes={label:c.oneOfType([c.string,c.bool]),source:c.string,defaultValue:c.any};Yy.propTypes={addButton:c.element,children:c.node,className:c.string,field:c.object,fields:c.array,fieldState:c.object,formState:c.object,record:c.object,source:c.string,label:c.oneOfType([c.string,c.bool]),resource:c.string,translate:c.func,disableAdd:c.bool,disableRemove:c.oneOfType([c.func,c.bool]),TransitionProps:c.shape({}),empty:c.oneOfType([c.node,c.string]),template:c.object};function zN(e,t){const n=Ae.clone(e),{type:r,payload:o}=t;switch(r){case"updateMedia":{const s=Ae.chain(n.media).clone().extend(o).value();return Ae.extend(n,{media:s})}case"updateDrawer":{const s=Ae.chain(n.drawer).clone().extend(o).value();return Ae.extend(n,{drawer:s})}case"updateLogo":{const s=Ae.chain(n.logo).clone().extend(o).value();return Ae.extend(n,{logo:s})}case"updateNotifications":{const s=Ae.chain(n.notifications).clone().extend(o).value();return Ae.extend(n,{notifications:s})}case"updateTheme":{const s=Ae.chain(n.theme).clone().extend(o).value();return Ae.extend(n,{theme:s})}default:return n}}const UN={drawer:{open:!0,width:260,handleDrawerToggle:()=>{}},media:{downMd:!1,downLg:!1,downXl:!1,horizontal:!1},logo:{},notifications:{enable:!0,resource:"entities/notification"},theme:{iconColor:"grey.300",iconColorOpen:"grey.100"}},Ky=w.createContext(void 0);function qy(e){var J;const t=de.useAuthProvider(),n=de.useGetIdentity(),r=b.useTheme(),o=b.useMediaQuery(r.breakpoints.down("md")),s=b.useMediaQuery(r.breakpoints.down("lg")),l=b.useMediaQuery(r.breakpoints.down("xl")),{miniDrawer:u,isHorizontalLayout:A,menuOrientation:g,drawerWidth:p}=Ln(),C=A(g)&&!s,{drawerOpen:h,openDrawer:m}=Io(),I=w.useCallback(()=>{m(!h)},[h,m]),[B,v]=w.useState(!1),[O,j]=w.useReducer(zN,Ae.chain(UN).clone().merge({drawer:{open:!u||h}}).value()),x=w.useCallback(()=>v(!1),[]),S=w.useMemo(()=>({state:O,dispatch:j}),[O,j]),{logoIcon:P,logoMain:L,enableNotification:k,notification:q}=e;return w.useEffect(()=>{j({type:"updateMedia",payload:{downMd:o,downLg:s,downXl:l,horizontal:C}})},[g,o,s,l]),w.useEffect(()=>{j({type:"updateDrawer",payload:{open:h,width:p,handleDrawerToggle:I}})},[h,p,I]),w.useEffect(()=>{u||m(!l)},[l,u]),w.useEffect(()=>{j({type:"updateLogo",payload:{main:L,icon:P}})},[P,L]),w.useEffect(()=>{j({type:"updateNotifications",payload:{enable:k,resource:q??"entities/notification"}})},[k,q]),w.useEffect(()=>{j({type:"updateTheme",payload:{iconColorOpen:r.palette.mode==="dark"?"grey.200":"grey.300",iconColor:r.palette.mode==="dark"?"background.default":"grey.100"}})},[r.palette.mode]),w.useEffect(()=>{t.isImpersonating().then(U=>{var _;v(!U&&((_=n==null?void 0:n.data)==null?void 0:_.needToChangePassword)===!0)})},[(J=n==null?void 0:n.data)==null?void 0:J.needToChangePassword,t]),f.jsxs(Ky.Provider,{value:S,children:[f.jsx(b.Dialog,{open:B,maxWidth:"xs",fullWidth:!0,children:f.jsx(ap,{onSuccess:x,firstAccess:!0})}),e.children]})}function Jy(e){return w.forwardRef((t,n)=>{const{logoIcon:r,logoMain:o,enableNotification:s}=t;return f.jsx(qy,{logoIcon:r,logoMain:o,enableNotification:s,children:f.jsx(e,{ref:n,...t})})})}function hp(){const e=w.useContext(Ky);if(e===void 0)throw new Error("[Layout] useLayoutContext: context undefined. Please provide a valid LayoutContext using LayoutProvider");return e}function YN(){return hp().dispatch}function ms(){return hp().state}function nr(){return ms().media}function di(){return ms().drawer}function Xy(){return ms().logo}function Ru(){return ms().notifications}function GN(){return ms().theme}const KN={ml:{xs:0,lg:-2}};function Zy(){const{open:e,handleDrawerToggle:t}=di();return f.jsx(Ma,{value:"drawer","aria-label":"open drawer",sx:KN,onChange:t,selected:e,children:e?f.jsx(et.MenuFoldOutlined,{}):f.jsx(et.MenuUnfoldOutlined,{})})}function _y(e){const t=w.useRef(),n=b.useTheme(),{downLg:r,horizontal:o}=nr(),{open:s,width:l}=di(),u=r?b.AppBar:AB,A=Pr(e,{borderBottom:`1px solid ${n.palette.divider}`,zIndex:1200,width:o?"100%":s?`calc(100% - ${l}px)`:{xs:"100%",lg:"calc(100% - 60px)"}}),g={position:"fixed",color:"inherit",elevation:0,sx:A};return r||Ae.extend(g,{open:s}),f.jsx(u,{ref:t,...g,children:f.jsxs(b.Toolbar,{sx:{"& > *":{marginX:n.spacing(.325)}},children:[!o&&f.jsx(Zy,{}),e.children]})})}function qN(e){const t=b.useTheme(),{notification:n,onClick:r,selected:o,divider:s}=e,{resource:l}=Ru(),u=de.useNotify(),A=de.useRedirect(),[g]=de.useUpdate(l,{id:n==null?void 0:n.id,data:{...n,readed:qr().format("YYYY-MM-DD HH:mm:ss")}},{onSuccess:()=>{n!=null&&n.resource?n!=null&&n.resource.startsWith("/")?(A(n==null?void 0:n.resource),r()):(r(),document.location.href=n==null?void 0:n.resource):r()},onFailure:()=>{u("resources.notifications.messages.readed.error","warning")}}),p=w.useCallback(()=>g(),[g]),[C]=de.useLocaleState(),h=w.useMemo(()=>qr(n.created).locale(C).fromNow(),[n,C]);return f.jsx(b.ListItem,{disablePadding:!0,divider:s,children:f.jsxs(b.ListItemButton,{selected:o,onClick:p,children:[f.jsx(b.ListItemAvatar,{children:f.jsx(b.Avatar,{sx:{color:"primary.main",bgcolor:"primary.lighter"},children:f.jsx(et.MessageOutlined,{})})}),f.jsx(b.ListItemText,{primary:n.title,secondary:n.content}),f.jsx(b.Box,{flexGrow:1,flexShrink:1,minWidth:t.spacing(2)}),f.jsx(b.ListItemText,{primary:h,primaryTypographyProps:{variant:"caption"}})]})})}const JN={width:36,height:36,fontSize:"1rem"},XN={mt:"6px",ml:1,top:"auto",right:"auto",alignSelf:"flex-start",transform:"none"};function $y(){const{enable:e}=Ru();return e?f.jsx(ZN,{}):null}function ZN(){const e=de.useTranslate(),t=b.useTheme(),{downMd:n}=nr(),{resource:r}=Ru(),[o,s]=w.useState([]),{data:l,isLoading:u}=de.useGetList(r,{pagination:{page:1,perPage:25},sort:{field:"created",order:"DESC"},filter:{readed:!1}}),A=o.filter(m=>m.readed===null).length,{open:g,anchorEl:p,handleClose:C,handleToggle:h}=ou();return w.useEffect(()=>{!u&&l&&s(l??[])},[l,u]),f.jsxs(f.Fragment,{children:[f.jsx(Ma,{value:"notifications",selected:g,onChange:h,children:f.jsx(b.Badge,{badgeContent:A,color:"primary",children:f.jsx(et.BellOutlined,{})})}),f.jsx(b.Popper,{placement:n?"bottom":"bottom-end",open:g,anchorEl:p,role:void 0,transition:!0,disablePortal:!0,popperOptions:{modifiers:[{name:"offset",options:{offset:[n?-5:0,9]}}]},children:({TransitionProps:m})=>f.jsx(yo,{type:"grow",position:n?"top":"top-right",in:g,...m,children:f.jsx(b.Paper,{sx:{boxShadow:t.customShadows.z1,width:"100%",minWidth:285,maxWidth:420,[t.breakpoints.down("md")]:{maxWidth:285}},children:f.jsx(b.ClickAwayListener,{onClickAway:C,children:f.jsxs(Zn,{title:"Notification",elevation:0,border:!1,content:!1,secondary:f.jsx(f.Fragment,{children:A>0&&f.jsx(b.Tooltip,{title:"Mark as all read",children:f.jsx(gs,{color:"success",size:"small",children:f.jsx(et.CheckCircleOutlined,{style:{fontSize:"1.15rem"}})})})}),children:[f.jsx(b.List,{component:"nav",sx:{p:0,"& .MuiListItemButton-root":{py:.5,"&.Mui-selected":{bgcolor:"grey.50",color:"text.primary"},"& .MuiAvatar-root":JN,"& .MuiListItemSecondaryAction-root":{...XN,position:"relative"}},maxHeight:"calc(100vh - 240px)",overflow:"auto"},children:o.map((I,B)=>f.jsx(qN,{selected:A>0,notification:I,onClick:C,divider:B<o.length-1},I.id))}),f.jsx(b.ListItemButton,{sx:{textAlign:"center",py:"12px !important"},to:`/${r}`,LinkComponent:Bt.Link,onClick:C,children:f.jsx(b.ListItemText,{primary:f.jsx(b.Typography,{variant:"h6",color:"primary",children:e("ra.notification.view_all")})})}),f.jsx(b.Divider,{})]})})})})})]})}const _N=()=>{const[e,t]=w.useState(!1),n=w.useCallback(()=>t(!1),[t]),r=w.useCallback(()=>t(!0),[t]),o=de.useTranslate();return f.jsxs(w.Fragment,{children:[f.jsxs(b.ListItemButton,{onClick:r,children:[f.jsx(b.ListItemIcon,{children:f.jsx(Bn.Key,{})}),f.jsx(b.ListItemText,{primary:o("ra.auth.change_password")})]}),f.jsx(b.Dialog,{open:e,onClose:()=>t(!1),maxWidth:"xs",fullWidth:!0,children:f.jsx(ap,{onSuccess:n})})]})},$N=()=>{const e=de.useLogout(),t=de.useTranslate();return f.jsx(w.Fragment,{children:f.jsxs(b.ListItemButton,{onClick:e,children:[f.jsx(b.ListItemIcon,{children:f.jsx(Bn.LogoutOutlined,{})}),f.jsx(b.ListItemText,{primary:t("ra.auth.logout")})]})})},e7=()=>{const e=de.useTranslate(),t=de.useAuthProvider(),n=w.useCallback(()=>t.stopImpersonate().then(()=>document.location.href="/"),[t==null?void 0:t.stopImpersonating]),[r,o]=w.useState(!1);return w.useEffect(()=>{t.isImpersonating&&t.isImpersonating().then(s=>o(s))},[t,o]),r?f.jsx(w.Fragment,{children:f.jsxs(b.ListItemButton,{onClick:n,children:[f.jsx(b.ListItemIcon,{children:f.jsx(Bn.LogoutOutlined,{})}),f.jsx(b.ListItemText,{primary:e("ra.auth.stop_impersonate")})]})}):null};function eb(){var m;const e=b.useTheme(),t=de.useDataProvider(),n=de.useAuthProvider(),{identity:r}=de.useGetIdentity(),o=r!==void 0&&r.image&&r.image!==null&&r.image!=="",[s,l]=w.useState(null),{open:u,anchorEl:A,handleToggle:g,handleClose:p}=ou(),C=de.useLogout(),h=w.useCallback(()=>{C()},[n,C]);return w.useEffect(()=>{o&&t.getFile("/profile/me/image").then(I=>l(I))},[t,o]),f.jsxs(f.Fragment,{children:[f.jsx(Ma,{sx:{p:.25,width:"auto"},onClick:g,value:"profile",selected:u,children:f.jsxs(b.Stack,{direction:"row",spacing:2,alignItems:"center",sx:{p:.5},children:[f.jsx(Ca,{alt:(m=r==null?void 0:r.name)==null?void 0:m.toUpperCase(),src:s,size:"xs"}),f.jsx(b.Typography,{variant:"subtitle1",children:r==null?void 0:r.name})]})}),f.jsx(dr.Popper,{placement:"bottom-end",open:u,anchorEl:A,role:void 0,transition:!0,disablePortal:!0,popperOptions:{modifiers:[{name:"offset",options:{offset:[0,9]}}]},children:({TransitionProps:I})=>{var B;return f.jsx(yo,{type:"grow",position:"top-right",in:u,...I,children:f.jsx(b.Paper,{sx:{boxShadow:e.customShadows.z1,width:290,minWidth:240,maxWidth:290,[e.breakpoints.down("md")]:{maxWidth:250}},children:f.jsx(b.ClickAwayListener,{onClickAway:p,children:f.jsxs(Zn,{elevation:0,border:!1,content:!1,children:[f.jsx(b.CardContent,{sx:{px:2.5,pt:3},children:f.jsxs(b.Grid,{container:!0,justifyContent:"space-between",alignItems:"center",children:[f.jsx(b.Grid,{item:!0,children:f.jsxs(b.Stack,{direction:"row",spacing:1.25,alignItems:"center",children:[f.jsx(Ca,{alt:"profile user",src:s,sx:{width:32,height:32}}),f.jsxs(b.Stack,{children:[f.jsx(b.Typography,{variant:"h6",children:r==null?void 0:r.name}),f.jsx(b.Typography,{variant:"body2",color:"textSecondary",children:(B=r==null?void 0:r.roles)==null?void 0:B.map(v=>v.name.replace("ROLE_","")).join(",")})]})]})}),f.jsx(b.Grid,{item:!0,children:f.jsx(b.Tooltip,{title:"Logout",children:f.jsx(gs,{size:"large",sx:{color:"text.primary"},onClick:h,children:f.jsx(et.LogoutOutlined,{})})})})]})}),f.jsx(b.Grid,{container:!0,children:f.jsx(b.Grid,{item:!0,xs:12,children:f.jsxs(b.List,{component:"nav",sx:{p:0,"& .MuiListItemIcon-root":{minWidth:32}},children:[f.jsx(_N,{}),f.jsx($N,{}),f.jsx(e7,{})]})})})]})})})})}})]})}const tb=e=>{const t=Rt(),{downMd:n}=nr(),{open:r,anchorEl:o,handleToggle:s,handleClose:l}=ou();return n?f.jsxs(f.Fragment,{children:[f.jsx(Ma,{"aria-label":"open more menu","aria-controls":r?"menu-list-grow":void 0,"aria-haspopup":"true",onClick:s,selected:r,children:f.jsx(et.MoreOutlined,{})}),f.jsx(b.Popper,{placement:"bottom-end",open:r,anchorEl:o,role:void 0,transition:!0,disablePortal:!0,style:{width:"100%"},popperOptions:{modifiers:[{name:"offset",options:{offset:[0,9]}}]},children:({TransitionProps:u})=>f.jsx(yo,{type:"fade",in:r,...u,children:f.jsx(b.Paper,{sx:{boxShadow:t.customShadows.z1},children:f.jsx(b.ClickAwayListener,{onClickAway:l,children:f.jsx(b.AppBar,{color:"inherit",children:f.jsx(b.Toolbar,{children:e.children})})})})})})]}):f.jsx(f.Fragment,{children:e.children})};function nb(e){return f.jsx(b.Box,{...e,flex:1})}function Fa(e){const{name:t,version:n}=e;return f.jsx(b.Stack,{direction:"row",justifyContent:"space-between",alignItems:"center",sx:{p:"24px 16px 0px",mt:"auto"},children:f.jsxs(b.Typography,{variant:"caption",children:[f.jsx("span",{dangerouslySetInnerHTML:{__html:(e==null?void 0:e.copy)||""}})," ",t," - ",n]})})}Fa.propTypes={name:c.string.isRequired,version:c.string.isRequired,copy:c.string};Fa.defaultProps={copy:"&copy; Applica Software Guru for"};var rb={exports:{}};(function(e){function t(n){return n&&n.__esModule?n:{default:n}}e.exports=t,e.exports.__esModule=!0,e.exports.default=e.exports})(rb);var Ou=rb.exports,Rd={};const t7=XR(NF);var SI;function ju(){return SI||(SI=1,function(e){"use client";Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"default",{enumerable:!0,get:function(){return t.createSvgIcon}});var t=t7}(Rd)),Rd}function ob(e){var t,n,r="";if(typeof e=="string"||typeof e=="number")r+=e;else if(typeof e=="object")if(Array.isArray(e))for(t=0;t<e.length;t++)e[t]&&(n=ob(e[t]))&&(r&&(r+=" "),r+=n);else for(t in e)e[t]&&(r&&(r+=" "),r+=t);return r}function ib(){for(var e,t,n=0,r="";n<arguments.length;)(e=arguments[n++])&&(t=ob(e))&&(r&&(r+=" "),r+=t);return r}var n7="__lodash_hash_undefined__";function r7(e){return this.__data__.set(e,n7),this}var o7=r7;function i7(e){return this.__data__.has(e)}var s7=i7,a7=Hy,l7=o7,c7=s7;function jc(e){var t=-1,n=e==null?0:e.length;for(this.__data__=new a7;++t<n;)this.add(e[t])}jc.prototype.add=jc.prototype.push=l7;jc.prototype.has=c7;var sb=jc;function u7(e,t){return e.has(t)}var ab=u7;function A7(e){var t=-1,n=Array(e.size);return e.forEach(function(r){n[++t]=r}),n}var lb=A7;function d7(e,t){for(var n=-1,r=t.length,o=e.length;++n<r;)e[o+n]=t[n];return e}var g7=d7,f7=gp,p7=xu,h7="[object Arguments]";function C7(e){return p7(e)&&f7(e)==h7}var m7=C7,RI=m7,E7=xu,cb=Object.prototype,I7=cb.hasOwnProperty,B7=cb.propertyIsEnumerable,v7=RI(function(){return arguments}())?RI:function(e){return E7(e)&&I7.call(e,"callee")&&!B7.call(e,"callee")},y7=v7,b7=9007199254740991;function Q7(e){return typeof e=="number"&&e>-1&&e%1==0&&e<=b7}var x7=Q7;function w7(e){return function(t){return e(t)}}var T7=w7,P7=Vy,S7=x7;function R7(e){return e!=null&&S7(e.length)&&!P7(e)}var O7=R7,j7=wu,M7=bu,D7=j7(M7,"Set"),k7=D7,mg=globalThis&&globalThis.__assign||function(){return mg=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++){t=arguments[n];for(var o in t)Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o])}return e},mg.apply(this,arguments)},F7=globalThis&&globalThis.__rest||function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var o=0,r=Object.getOwnPropertySymbols(e);o<r.length;o++)t.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]]);return n},ub=function(e){var t=e.className,n=e.sx,r=F7(e,["className","sx"]),o=de.useLoading(),s=Rt();return D.createElement(L7,{className:t,sx:n},o?D.createElement(Df,mg({className:ib("app-loader",Mc.loader),color:"inherit",size:s.spacing(2),thickness:6},r)):D.createElement(Fb,{className:Mc.loadedIcon}))};ub.propTypes={classes:c.object,className:c.string,width:c.string};var Eg="RaLoadingIndicator",Mc={loader:"".concat(Eg,"-loader"),loadedIcon:"".concat(Eg,"-loadedIcon")},L7=ue("div",{name:Eg,overridesResolver:function(e,t){return t.root}})(function(e){var t,n=e.theme;return t={},t["& .".concat(Mc.loader)]={marginLeft:n.spacing(1.5),marginRight:n.spacing(1.5)},t["& .".concat(Mc.loadedIcon)]={},t});const Cp=e=>e.scrollTop;function is(e,t){var n,r;const{timeout:o,easing:s,style:l={}}=e;return{duration:(n=l.transitionDuration)!=null?n:typeof o=="number"?o:o[t.mode]||0,easing:(r=l.transitionTimingFunction)!=null?r:typeof s=="object"?s[t.mode]:s,delay:l.transitionDelay}}const N7=["addEndListener","appear","children","container","direction","easing","in","onEnter","onEntered","onEntering","onExit","onExited","onExiting","style","timeout","TransitionComponent"];function V7(e,t,n){const r=t.getBoundingClientRect(),o=n&&n.getBoundingClientRect(),s=As(t);let l;if(t.fakeTransform)l=t.fakeTransform;else{const g=s.getComputedStyle(t);l=g.getPropertyValue("-webkit-transform")||g.getPropertyValue("transform")}let u=0,A=0;if(l&&l!=="none"&&typeof l=="string"){const g=l.split("(")[1].split(")")[0].split(",");u=parseInt(g[4],10),A=parseInt(g[5],10)}return e==="left"?o?`translateX(${o.right+u-r.left}px)`:`translateX(${s.innerWidth+u-r.left}px)`:e==="right"?o?`translateX(-${r.right-o.left-u}px)`:`translateX(-${r.left+r.width-u}px)`:e==="up"?o?`translateY(${o.bottom+A-r.top}px)`:`translateY(${s.innerHeight+A-r.top}px)`:o?`translateY(-${r.top-o.top+r.height-A}px)`:`translateY(-${r.top+r.height-A}px)`}function Ab(e){return typeof e=="function"?e():e}function ql(e,t,n){const r=Ab(n),o=V7(e,t,r);o&&(t.style.webkitTransform=o,t.style.transform=o)}const db=D.forwardRef(function(t,n){const r=Rt(),o={enter:r.transitions.easing.easeOut,exit:r.transitions.easing.sharp},s={enter:r.transitions.duration.enteringScreen,exit:r.transitions.duration.leavingScreen},{addEndListener:l,appear:u=!0,children:A,container:g,direction:p="down",easing:C=o,in:h,onEnter:m,onEntered:I,onEntering:B,onExit:v,onExited:O,onExiting:j,style:x,timeout:S=s,TransitionComponent:P=Sf}=t,L=Ke(t,N7),k=D.useRef(null),q=Dn(A.ref,k,n),J=F=>$=>{F&&($===void 0?F(k.current):F(k.current,$))},U=J((F,$)=>{ql(p,F,g),Cp(F),m&&m(F,$)}),_=J((F,$)=>{const H=is({timeout:S,style:x,easing:C},{mode:"enter"});F.style.webkitTransition=r.transitions.create("-webkit-transform",W({},H)),F.style.transition=r.transitions.create("transform",W({},H)),F.style.webkitTransform="none",F.style.transform="none",B&&B(F,$)}),le=J(I),ie=J(j),Z=J(F=>{const $=is({timeout:S,style:x,easing:C},{mode:"exit"});F.style.webkitTransition=r.transitions.create("-webkit-transform",$),F.style.transition=r.transitions.create("transform",$),ql(p,F,g),v&&v(F)}),K=J(F=>{F.style.webkitTransition="",F.style.transition="",O&&O(F)}),V=F=>{l&&l(k.current,F)},G=D.useCallback(()=>{k.current&&ql(p,k.current,g)},[p,g]);return D.useEffect(()=>{if(h||p==="down"||p==="right")return;const F=M0(()=>{k.current&&ql(p,k.current,g)}),$=As(k.current);return $.addEventListener("resize",F),()=>{F.clear(),$.removeEventListener("resize",F)}},[p,h,g]),D.useEffect(()=>{h||G()},[h,G]),f.jsx(P,W({nodeRef:k,onEnter:U,onEntered:le,onEntering:_,onExit:Z,onExited:K,onExiting:ie,addEndListener:V,appear:u,in:h,timeout:S},L,{children:(F,$)=>D.cloneElement(A,W({ref:q,style:W({visibility:F==="exited"&&!h?"hidden":void 0},x,A.props.style)},$))}))});process.env.NODE_ENV!=="production"&&(db.propTypes={addEndListener:c.func,appear:c.bool,children:us.isRequired,container:Tr(c.oneOfType([oi,c.func]),e=>{if(e.open){const t=Ab(e.container);if(t&&t.nodeType===1){const n=t.getBoundingClientRect();if(process.env.NODE_ENV!=="test"&&n.top===0&&n.left===0&&n.right===0&&n.bottom===0)return new Error(["MUI: The `container` prop provided to the component is invalid.","The anchor element should be part of the document layout.","Make sure the element is present in the document or that it's not display none."].join(`
218
+ `),$F)),Gv=D.forwardRef(function(t,n){const r=Yt({props:t,name:"MuiCircularProgress"}),{className:o,color:s="primary",disableShrink:l=!1,size:u=40,style:A,thickness:g=3.6,value:p=0,variant:C="indeterminate"}=r,h=Ke(r,ZF),m=W({},r,{color:s,disableShrink:l,size:u,thickness:g,value:p,variant:C}),I=e8(m),B={},v={},O={};if(C==="determinate"){const j=2*Math.PI*((ao-g)/2);B.strokeDasharray=j.toFixed(3),O["aria-valuenow"]=Math.round(p),B.strokeDashoffset=`${((100-p)/100*j).toFixed(3)}px`,v.transform="rotate(-90deg)"}return f.jsx(t8,W({className:Ge(I.root,o),style:W({width:u,height:u},v,A),ownerState:m,ref:n,role:"progressbar"},O,h,{children:f.jsx(n8,{className:I.svg,ownerState:m,viewBox:`${ao/2} ${ao/2} ${ao} ${ao}`,children:f.jsx(r8,{className:I.circle,style:B,ownerState:m,cx:ao,cy:ao,r:(ao-g)/2,fill:"none",strokeWidth:g})})}))});process.env.NODE_ENV!=="production"&&(Gv.propTypes={classes:c.object,className:c.string,color:c.oneOfType([c.oneOf(["inherit","primary","secondary","error","info","success","warning"]),c.string]),disableShrink:Tr(c.bool,e=>e.disableShrink&&e.variant&&e.variant!=="indeterminate"?new Error("MUI: You have provided the `disableShrink` prop with a variant other than `indeterminate`. This will have no effect."):null),size:c.oneOfType([c.number,c.string]),style:c.object,sx:c.oneOfType([c.arrayOf(c.oneOfType([c.func,c.object,c.bool])),c.func,c.object]),thickness:c.number,value:c.number,variant:c.oneOf(["determinate","indeterminate"])});const Df=Gv;function o8(e){return Nt("MuiLoadingButton",e)}const i8=Ut("MuiLoadingButton",["root","loading","loadingIndicator","loadingIndicatorCenter","loadingIndicatorStart","loadingIndicatorEnd","endIconLoadingEnd","startIconLoadingStart"]),Vr=i8,s8=["children","disabled","id","loading","loadingIndicator","loadingPosition","variant"],a8=e=>{const{loading:t,loadingPosition:n,classes:r}=e,o={root:["root",t&&"loading"],startIcon:[t&&`startIconLoading${Pe(n)}`],endIcon:[t&&`endIconLoading${Pe(n)}`],loadingIndicator:["loadingIndicator",t&&`loadingIndicator${Pe(n)}`]},s=dr.unstable_composeClasses(o,o8,r);return W({},r,s)},l8=e=>e!=="ownerState"&&e!=="theme"&&e!=="sx"&&e!=="as"&&e!=="classes",c8=ue(JF,{shouldForwardProp:e=>l8(e)||e==="classes",name:"MuiLoadingButton",slot:"Root",overridesResolver:(e,t)=>[t.root,t.startIconLoadingStart&&{[`& .${Vr.startIconLoadingStart}`]:t.startIconLoadingStart},t.endIconLoadingEnd&&{[`& .${Vr.endIconLoadingEnd}`]:t.endIconLoadingEnd}]})(({ownerState:e,theme:t})=>W({[`& .${Vr.startIconLoadingStart}, & .${Vr.endIconLoadingEnd}`]:{transition:t.transitions.create(["opacity"],{duration:t.transitions.duration.short}),opacity:0}},e.loadingPosition==="center"&&{transition:t.transitions.create(["background-color","box-shadow","border-color"],{duration:t.transitions.duration.short}),[`&.${Vr.loading}`]:{color:"transparent"}},e.loadingPosition==="start"&&e.fullWidth&&{[`& .${Vr.startIconLoadingStart}, & .${Vr.endIconLoadingEnd}`]:{transition:t.transitions.create(["opacity"],{duration:t.transitions.duration.short}),opacity:0,marginRight:-8}},e.loadingPosition==="end"&&e.fullWidth&&{[`& .${Vr.startIconLoadingStart}, & .${Vr.endIconLoadingEnd}`]:{transition:t.transitions.create(["opacity"],{duration:t.transitions.duration.short}),opacity:0,marginLeft:-8}})),u8=ue("span",{name:"MuiLoadingButton",slot:"LoadingIndicator",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.loadingIndicator,t[`loadingIndicator${Pe(n.loadingPosition)}`]]}})(({theme:e,ownerState:t})=>W({position:"absolute",visibility:"visible",display:"flex"},t.loadingPosition==="start"&&(t.variant==="outlined"||t.variant==="contained")&&{left:t.size==="small"?10:14},t.loadingPosition==="start"&&t.variant==="text"&&{left:6},t.loadingPosition==="center"&&{left:"50%",transform:"translate(-50%)",color:(e.vars||e).palette.action.disabled},t.loadingPosition==="end"&&(t.variant==="outlined"||t.variant==="contained")&&{right:t.size==="small"?10:14},t.loadingPosition==="end"&&t.variant==="text"&&{right:6},t.loadingPosition==="start"&&t.fullWidth&&{position:"relative",left:-10},t.loadingPosition==="end"&&t.fullWidth&&{position:"relative",right:-10})),Kv=D.forwardRef(function(t,n){const r=Yt({props:t,name:"MuiLoadingButton"}),{children:o,disabled:s=!1,id:l,loading:u=!1,loadingIndicator:A,loadingPosition:g="center",variant:p="text"}=r,C=Ke(r,s8),h=Mg(l),m=A??f.jsx(Df,{"aria-labelledby":h,color:"inherit",size:16}),I=W({},r,{disabled:s,loading:u,loadingIndicator:m,loadingPosition:g,variant:p}),B=a8(I),v=u?f.jsx(u8,{className:B.loadingIndicator,ownerState:I,children:m}):null;return f.jsxs(c8,W({disabled:s||u,id:h,ref:n},C,{variant:p,classes:B,ownerState:I,children:[I.loadingPosition==="end"?o:v,I.loadingPosition==="end"?v:o]}))});process.env.NODE_ENV!=="production"&&(Kv.propTypes={children:c.node,classes:c.object,disabled:c.bool,id:c.string,loading:c.bool,loadingIndicator:c.node,loadingPosition:Tr(c.oneOf(["start","end","center"]),e=>e.loadingPosition==="start"&&!e.startIcon?new Error('MUI: The loadingPosition="start" should be used in combination with startIcon.'):e.loadingPosition==="end"&&!e.endIcon?new Error('MUI: The loadingPosition="end" should be used in combination with endIcon.'):null),sx:c.oneOfType([c.arrayOf(c.oneOfType([c.func,c.object,c.bool])),c.func,c.object]),variant:c.oneOfType([c.oneOf(["contained","outlined","text"]),c.string])});const A8=Kv;function Td({variant:e,theme:t,color:n,loadingPosition:r}){const o=an(t,n),{lighter:s,main:l,dark:u,contrastText:A}=o,g=`${n}Button`,p=ds(t,g),C={"& .MuiLoadingButton-loadingIndicator":{color:l}},h={...r&&r!=="center"&&{color:l}},m={"&::after":{boxShadow:`0 0 6px 6px ${We(l,.9)}`},"&:active::after":{boxShadow:`0 0 0 0 ${We(l,.9)}`},"&:focus-visible":{outline:`2px solid ${u}`,outlineOffset:2}};switch(e){case"contained":return{backgroundColor:l,...r&&r!=="center"&&{color:A},"& .MuiLoadingButton-loadingIndicator":{color:A},"&:hover":{backgroundColor:u,color:A},...m};case"light":return{backgroundColor:l,...r&&r!=="center"&&{color:A},"& .MuiLoadingButton-loadingIndicator":{color:A},"&:hover":{backgroundColor:u,color:A},...m};case"shadow":return{boxShadow:p,backgroundColor:l,...r&&r!=="center"&&{color:A},"& .MuiLoadingButton-loadingIndicator":{color:A},"&:hover":{boxShadow:"none",backgroundColor:u,color:A},...m};case"outlined":return{backgroundColor:"transparent",borderColor:l,...h,...C};case"dashed":return{backgroundColor:s,borderColor:l,...h,...C,...m};case"text":default:return{color:l,...C,...m}}}const d8=ue(A8,{shouldForwardProp:e=>e!=="shape"&&e!=="variant"})(({theme:e,variant:t,shape:n,color:r,loading:o,loadingPosition:s})=>({"::after":{content:'""',display:"block",position:"absolute",left:0,top:0,width:"100%",height:"100%",borderRadius:n==="rounded"?"50%":4,opacity:0,transition:"all 0.5s"},":active::after":{position:"absolute",borderRadius:n==="rounded"?"50%":4,left:0,top:0,opacity:1,transition:"0s"},...t==="text"&&{...Td({variant:t,theme:e,color:r,loadingPosition:s}),"&.MuiButton-sizeMedium":{height:36},"&.MuiButton-sizeSmall":{height:30},"&.MuiButton-sizeLarge":{height:44}},...n&&{minWidth:0,"&.MuiButton-sizeMedium":{width:36,height:36},"&.MuiButton-sizeSmall":{width:30,height:30},"&.MuiButton-sizeLarge":{width:44,height:44},...n==="rounded"&&{borderRadius:"50%"}},...t==="outlined"&&{border:"1px solid"},...t==="dashed"&&{border:"1px dashed"},...(t==="contained"||t==="shadow")&&!o&&{color:"#fff"},...t!=="text"&&{...Td({variant:t,theme:e,color:r,loadingPosition:s})},"&.Mui-disabled":{...t!=="text"&&{...Td({variant:t,theme:e,color:r,loadingPosition:s})}}})),kf=w.forwardRef(({variant:e="text",shape:t,children:n,color:r="primary",...o},s)=>{const l=Rt();return f.jsx(d8,{ref:s,variant:e,shape:t,theme:l,loadingPosition:o.loadingPosition,loading:o.loading,color:r,...o,children:n})});kf.propTypes={variant:c.string,shape:c.string,children:c.node,color:c.string};kf.displayName="LoadingButton";function g8({color:e,theme:t,labelColor:n}){const r=an(t,e),{main:o,contrastText:s}=r;let l=e||"";return["primary","secondary","info","success","warning","error"].includes(l)?{[`& .${b.tooltipClasses.tooltip}`]:{backgroundColor:o,color:n||s},[`& .${b.tooltipClasses.arrow}`]:{color:o}}:{[`& .${b.tooltipClasses.tooltip}`]:{backgroundColor:l,color:n||s,boxShadow:t.shadows[1]},[`& .${b.tooltipClasses.arrow}`]:{color:l}}}const f8=ue(({className:e,...t})=>f.jsx(b.Tooltip,{...t,classes:{popper:e}}),{shouldForwardProp:e=>e!=="color"&&e!=="labelColor"})(({theme:e,color:t,labelColor:n})=>({...t&&g8({color:t,theme:e,labelColor:n})}));function Ff({children:e,arrow:t,labelColor:n="",...r}){const o=Rt();return f.jsx(b.Box,{display:"flex",children:f.jsx(f8,{arrow:t,...r,theme:o,labelColor:n,children:e})})}Ff.propTypes={children:c.element,arrow:c.bool,labelColor:c.string,rest:c.array};const yo=w.forwardRef(({children:e,position:t="top-left",type:n="grow",direction:r="up",...o},s)=>{let l={transformOrigin:"0 0 0"};switch(t){case"top-right":l={transformOrigin:"top right"};break;case"top":l={transformOrigin:"top"};break;case"bottom-left":l={transformOrigin:"bottom left"};break;case"bottom-right":l={transformOrigin:"bottom right"};break;case"bottom":l={transformOrigin:"bottom"};break;case"top-left":default:l={transformOrigin:"0 0 0"};break}return f.jsxs(b.Box,{ref:s,children:[n==="grow"&&f.jsx(b.Grow,{...o,timeout:{appear:0,enter:150,exit:150},children:f.jsx(b.Box,{sx:l,children:e})}),n==="collapse"&&f.jsx(b.Collapse,{...o,sx:l,children:e}),n==="fade"&&f.jsx(b.Fade,{...o,timeout:{appear:0,enter:300,exit:150},children:f.jsx(b.Box,{sx:l,children:e})}),n==="slide"&&f.jsx(b.Slide,{...o,timeout:{appear:0,enter:150,exit:150},direction:r,children:f.jsx(b.Box,{sx:l,children:e})}),n==="zoom"&&f.jsx(b.Zoom,{...o,children:f.jsx(b.Box,{sx:l,children:e})})]})});yo.propTypes={children:c.node,type:c.oneOf(["grow","fade","collapse","slide","zoom"]),position:c.oneOf(["top-left","top-right","top","bottom-left","bottom-right","bottom"]),direction:c.oneOf(["up","down","left","right"])};w.forwardRef(function(t,n){return f.jsx(b.Zoom,{ref:n,timeout:200,...t})});function qv({value:e,...t}){return f.jsxs(b.Box,{sx:{position:"relative",display:"inline-flex"},children:[f.jsx(b.CircularProgress,{variant:"determinate",value:e,...t}),f.jsx(b.Box,{sx:{top:0,left:0,bottom:0,right:0,position:"absolute",display:"flex",alignItems:"center",justifyContent:"center"},children:f.jsx(b.Typography,{variant:"caption",component:"div",color:"text.secondary",children:`${Math.round(e)}%`})})]})}qv.propTypes={value:c.number};function Jv({value:e,size:t,variant:n,thickness:r,showLabel:o,pathColor:s,sx:l,...u}){return f.jsxs(b.Box,{sx:{position:"relative",display:"inline-flex"},children:[f.jsx(b.CircularProgress,{variant:"determinate",sx:{color:s||"grey.200"},size:t,thickness:r,...u,value:100}),o&&f.jsx(b.Box,{sx:{top:0,left:0,bottom:0,right:0,position:"absolute",display:"flex",alignItems:"center",justifyContent:"center"},children:f.jsx(b.Typography,{variant:"caption",component:"div",color:"text.secondary",children:e?`${Math.round(e)}%`:"0%"})}),f.jsx(b.CircularProgress,{variant:n,sx:{...l,position:"absolute",left:0,[`& .${b.circularProgressClasses.circle}`]:{strokeLinecap:"round"}},size:t,thickness:r,value:e,...u})]})}Jv.propTypes={value:c.number,size:c.number,variant:c.string,thickness:c.number,showLabel:c.bool,pathColor:c.string,sx:c.array,others:c.array};function Xv({icon:e,value:t,...n}){return f.jsxs(b.Box,{sx:{display:"flex",alignItems:"center"},children:[f.jsx(b.Box,{sx:{width:"100%",mr:1},children:f.jsx(b.LinearProgress,{variant:"determinate",value:t,...n})}),f.jsx(b.Box,{sx:{minWidth:35},children:e})]})}Xv.propTypes={icon:c.node,value:c.number};function Zv({value:e,...t}){return f.jsxs(b.Box,{sx:{display:"flex",alignItems:"center"},children:[f.jsx(b.Box,{sx:{width:"100%",mr:1},children:f.jsx(b.LinearProgress,{variant:"determinate",value:e,...t})}),f.jsx(b.Box,{sx:{minWidth:35},children:f.jsx(b.Typography,{variant:"body2",color:"text.secondary",children:`${Math.round(e)}%`})})]})}Zv.propTypes={value:c.number};const p8=w.forwardRef(function(t,n){const r=Pr(t,{color:"text.primary"},{defaults:!0});return f.jsx(gs,{ref:n,...t,color:"secondary",variant:"text",sx:r})}),Ma=w.forwardRef(function(t,n){const r=Pr(t,{color:"text.primary",borderStyle:"none",padding:1,fontSize:"1.5rem",width:36,height:36},{defaults:!0});return f.jsx(b.ToggleButton,{ref:n,...t,color:"secondary",sx:r})}),_v=w.createContext({});function h8(e){const{useDefaults:t=!1,queryOptions:n={}}=e,r=R.useResourceContext(),o=R.useDataProvider(),{search:s}=_i.useLocation(),l=`${r}/new`,u=w.useCallback(()=>{if(!t||!Ae.isFunction(o.get))return Promise.resolve({});const h={};return new URLSearchParams(s??"").forEach((m,I)=>{h[I]=m}),o.get(l,h).then(m=>m.data).then(m=>{const{responseCode:I,value:B}=m;return I==="ok"?B:Promise.reject(m)})},[r,t,s,o]),A=w.useMemo(()=>Ae.chain(n).extend({queryKey:[r,s],queryFn:u}).value(),[r,s,u,n]),{data:g,isLoading:p}=Rg.useQuery(A),C=Ae.omit(e,["useDefaults"]);return p?f.jsx(b.Stack,{alignItems:"center",justifyContent:"center",flex:1,p:2,children:f.jsx(b.CircularProgress,{})}):f.jsx(_v.Provider,{value:g??{},children:f.jsx(R.Create,{...C})})}function C8(){return w.useContext(_v)}const m8=ue(h8,{name:"RaApplicaEdit",slot:"root"})(({theme:e})=>({"& .RaCreate-card, & > div > div > form":{backgroundColor:e.palette.background.default},"& .RaCreate-main>.MuiPaper-root:first-of-type":{overflow:"visible",backgroundColor:e.palette.background.default}})),E8=Ta(R.Toolbar,{name:"RaApplicaToolbar",slot:"Root"})(({theme:e})=>({...e.mixins.toolbar,backgroundColor:e.palette.background.paper,justifyContent:"flex-end","& .RaToolbar-defaultToolbar":{justifyContent:"right",paddingBottom:e.spacing(2),"& > *":{marginLeft:e.spacing(1)}},"& .MuiButtonBase-root":{marginLeft:e.spacing(1)}})),pr=e=>f.jsx(E8,{...e});pr.defaultProps={...R.Toolbar.defaultProps};pr.propTypes={...R.Toolbar.propTypes};const Lf=({children:e,content:t,title:n,subheader:r,secondary:o,toolbar:s,...l})=>{const u=R.useTranslate(),A=R.useResourceContext(),{cardTitle:g,cardSubheader:p}=w.useMemo(()=>{const C=n||`resources.${A}.title`;return{cardTitle:u(C,{_:C}),cardSubheader:r!==null?u(r,{_:r}):null}},[A,r,n,u]);return f.jsx(b.Grid,{item:!0,...l,children:f.jsx(Zn,{content:t,title:g,subheader:p,secondary:o,divider:!0,children:f.jsxs(w.Fragment,{children:[e,s===!0?f.jsx(pr,{children:f.jsx(R.SaveButton,{})}):s]})})})};Lf.defaultProps={...b.Grid.defaultProps,content:!0,subheader:null,title:null,secondary:null,toolbar:!1,item:!0,lg:12,md:12,sm:12,xs:12};Lf.propTypes={...b.Grid.propTypes,children:c.oneOfType([c.node,c.arrayOf(c.node)]),contained:c.bool,content:c.bool,subheader:c.oneOfType([c.string,c.node]),title:c.oneOfType([c.string,c.node]),secondary:c.oneOfType([c.node,c.string,c.object]),spacing:c.number,toolbar:c.oneOfType([c.node,c.bool])};const I8=ue(R.Form,{name:"RaApplicaCardForm",slot:"root"})(({theme:e,spacing:t})=>({backgroundColor:"transparent","& .RaToolbar-desktopToolbar":{marginTop:e.spacing(t*2),padding:0}})),hu=({children:e,spacing:t,defaultValues:n,...r})=>{const{spacing:o}=Ln();return f.jsx(I8,{defaultValues:n,spacing:t||o,children:f.jsx(b.Grid,{container:!0,...r,spacing:t||o,children:e})})};hu.propTypes={...b.Grid.propTypes,...R.Form.propTypes,children:c.oneOfType([c.node,c.arrayOf(c.node)]),spacing:c.number,defaultValues:c.oneOfType([c.object,c.func]),record:c.object,validate:c.func};hu.defaultProps={...b.Stack.defaultProps};hu.Section=Lf;const B8=Ta(R.SimpleForm,{name:"RaApplicaSimpleForm",slot:"Root"})(({theme:e,modal:t})=>({"& .MuiGrid-root.MuiGrid-container":{paddingBottom:e.spacing(t?0:1)},[e.breakpoints.down("sm")]:{paddingBottom:0}})),Cu=({title:e,modal:t,content:n,subheader:r,secondary:o,sx:s,...l})=>{const u=sf(e),A=R.useRecordContext();return f.jsx(Zn,{content:n,title:u,subheader:r,secondary:A!=null&&A.id?o:null,sx:{...s,"& .MuiToolbar-root":{paddingLeft:"20px !important",paddingRight:"20px !important"}},border:!t,divider:!0,children:f.jsx(B8,{toolbar:f.jsx(pr,{}),...l})})};Cu.defaultProps={modal:!1,content:!1,subheader:null,title:null,toolbar:f.jsx(pr,{children:f.jsx(R.SaveButton,{type:"button"})}),secondary:f.jsx(li,{children:f.jsx(R.DeleteWithConfirmButton,{})})};Cu.propTypes={...R.SimpleForm.propTypes,modal:c.bool,content:c.bool,contained:c.bool,subheader:c.oneOfType([c.string,c.node]),title:c.oneOfType([c.string,c.node]),secondary:c.oneOfType([c.node,c.string,c.object])};const mu=({label:e,children:t,display:n,helperText:r,sx:o,addLabel:s,divider:l,...u})=>{const A=_t.useTheme(),{getCurrentDialog:g}=ci(),{source:p,resource:C,isRequired:h}=u,{getFieldState:m,formState:I}=ai.useFormContext(),{error:B}=m(p,I),v=g();return f.jsxs(b.Stack,{spacing:1,sx:{"& .MuiFormHelperText-root":{color:B?A.palette.error.main:A.palette.text.secondary,"& span":{display:"none"}},...o},children:[n==="label"&&e!==!1&&s!==!1&&f.jsx(b.InputLabel,{error:!!B,sx:{borderBottom:l?`1px solid ${A.palette.divider}`:"none",pb:l?1:0,mt:l?1:0},children:f.jsx(R.FieldTitle,{label:e,source:p,resource:v||C,isRequired:h})}),w.isValidElement(t)?w.cloneElement(t,{...t.props,...u,label:n==="legend"?e:!1}):t,n==="label"&&r&&f.jsx(b.FormHelperText,{sx:{pl:1.8,pb:2,marginTop:"0 !important"},error:!!B,children:r})]})};mu.propTypes={sx:c.object,children:c.element,label:c.oneOfType([c.string,c.bool]),addLabel:c.bool,resource:c.string,isRequired:c.bool,source:c.string,display:c.oneOf(["legend","label"]),helperText:c.oneOfType([c.string,c.bool]),divider:c.bool};mu.defaultProps={display:"label",divider:!1};const v8=ue(R.ArrayInput,{name:"ApplicaArrayInput",slot:"root"})(({theme:e})=>({"& .MuiStack-root > label":{marginTop:e.spacing(2)},"& .MuiInputLabel-shrink":{paddingBottom:0},marginTop:"0 !important","& .RaSimpleFormIterator-line > .RaSimpleFormIterator-form":{paddingBottom:e.spacing(.5),"& > div":{width:"100%"}}})),y8=({label:e,addLabel:t,source:n,helperText:r,divider:o=!0,...s})=>f.jsx(mu,{label:e,addLabel:t,source:n,helperText:r,divider:o,children:f.jsx(v8,{source:n,label:!1,...s})}),Nf=({canEdit:e,canDelete:t,canClone:n})=>!e&&!t&&!n?null:f.jsxs(li,{children:[e&&f.jsx(R.EditButton,{}),t&&f.jsx(R.DeleteWithConfirmButton,{}),n&&f.jsx(R.CloneButton,{})]});Nf.defaultProps={canEdit:!0,canDelete:!0,canClone:!1};Nf.propTypes={canEdit:c.bool,canDelete:c.bool,canClone:c.bool};const II=ue("div",{name:"ApplicaBaseAttachmentField",overridesResolver:(e,t)=>t.root})({display:"inline-block"}),b8=ue("ul")({display:"inline-block"}),$v=e=>{var p;const{className:t,emptyText:n,source:r,title:o,...s}=e,l=de.useRecordContext(e),u=dt.get(l,r),A=de.useTranslate();if(!u)return n?f.jsx(b.Typography,{component:"span",variant:"body2",className:t,...s,children:n&&A(n,{_:n})}):f.jsx(II,{className:t,...s});if(Array.isArray(u))return f.jsx(b8,{className:t,...s,children:u.map((C,h)=>{var I;const m=o instanceof String?(I=dt.get(C,o))==null?void 0:I.toString():o;return f.jsx("li",{children:m},h)})});const g=o instanceof String?(p=dt.get(l,o))==null?void 0:p.toString():o;return f.jsx(II,{className:t,...s,children:g})};$v.propTypes={className:c.string,emptyText:c.string,source:c.string.isRequired,src:c.string,title:c.oneOfType([c.string,c.element]),target:c.string,download:c.oneOfType([c.bool,c.string]),ping:c.string,rel:c.string};const Vf=({entityId:e,property:t,disabled:n,userResource:r="entities/user",...o})=>{const[s,l]=w.useState(null),u=R.useRecordContext(o),A=R.useDataProvider(),g=R.useResourceContext(),p=w.useCallback(async m=>{m.preventDefault(),m.stopPropagation();const I=dt.get(u,o==null?void 0:o.source),B=g.replace("entities/",""),v=await A.getFile(`/attachments/${B}/${e||(u==null?void 0:u.id)}/${t||(o==null?void 0:o.source)}/${(I==null?void 0:I.id)||(u==null?void 0:u.id)}`),O=document.createElement("a");O.href=v,O.download=dt.get(u,(o==null?void 0:o.title)||(o==null?void 0:o.source)),O.click()},[A,u,e,g,t,o==null?void 0:o.source,o==null?void 0:o.title]),C=w.useMemo(()=>({...u,[o==null?void 0:o.source]:(u==null?void 0:u.src)||dt.get(u,o==null?void 0:o.source),[o==null?void 0:o.title]:(u==null?void 0:u.title)||dt.get(u,(o==null?void 0:o.title)||(o==null?void 0:o.source))}),[u,o==null?void 0:o.source,o==null?void 0:o.title]),h=R.useTranslate();return w.useEffect(()=>{!u||!(u!=null&&u.userId)||A.getOne(r,{id:u==null?void 0:u.userId}).then(({data:m})=>l(m)).catch(()=>l(null))},[u,A,r]),f.jsx($v,{...o,disabled:n,record:C,onClick:p,title:f.jsxs(b.Box,{sx:{cursor:"pointer"},children:[f.jsx(b.Typography,{variant:"subtitle1",children:dt.get(C,(o==null?void 0:o.title)||(o==null?void 0:o.source))}),f.jsxs(b.Typography,{variant:"caption",color:"secondary",children:[dt.get(C,"sizeDescription"),s&&" | ",s&&h("ra.attachment.info",{user:s==null?void 0:s.name,created:qr(C==null?void 0:C.createdAt).format("DD/MM/YYYY HH:mm")})]})]})})};Vf.propTypes={...R.FileField.propTypes,source:c.string,title:c.string,disabled:c.bool};const Q8=ue(R.ImageField,{name:"RaApplicaImageField",slot:"root"})(()=>({})),Da=e=>{const t=`_${e==null?void 0:e.source}`;return f.jsx(Q8,{...e,source:t})};Da.propTypes={...R.ImageField.propTypes,source:c.string};const Eu=({width:e,height:t,circle:n,justify:r,record:o,...s})=>{const l=w.useMemo(()=>({width:typeof e=="number"?`${e}px !important`:`${e} !important`,height:typeof t=="number"?`${t}px !important`:`${t} !important`,borderRadius:n?"50%":1.5}),[e,t,n]),u=R.useRecordContext(),A=o||u;return f.jsx(Da,{sx:g=>({margin:0,display:"flex",justifyContent:r,"& img":{margin:"0px !important",border:`1px solid ${g.palette.divider}`,objectFit:"cover !important",...l,minWidth:l.width,minHeight:l.height}}),...s,record:A})};Eu.defaultProps={...Da.defaultProps,width:150,height:150,circle:!1,justify:"flex-start"};Eu.propTypes={...Da.propTypes,width:c.oneOfType([c.number,c.string]),height:c.oneOfType([c.number,c.string]),circle:c.bool,justify:c.oneOf(["flex-start","center","flex-end"])};var ey={exports:{}};(function(e,t){(function(n,r){e.exports=r()})(Xn,function(){return function(n,r,o){n=n||{};var s=r.prototype,l={future:"in %s",past:"%s ago",s:"a few seconds",m:"a minute",mm:"%d minutes",h:"an hour",hh:"%d hours",d:"a day",dd:"%d days",M:"a month",MM:"%d months",y:"a year",yy:"%d years"};function u(g,p,C,h){return s.fromToBase(g,p,C,h)}o.en.relativeTime=l,s.fromToBase=function(g,p,C,h,m){for(var I,B,v,O=C.$locale().relativeTime||l,j=n.thresholds||[{l:"s",r:44,d:"second"},{l:"m",r:89},{l:"mm",r:44,d:"minute"},{l:"h",r:89},{l:"hh",r:21,d:"hour"},{l:"d",r:35},{l:"dd",r:25,d:"day"},{l:"M",r:45},{l:"MM",r:10,d:"month"},{l:"y",r:17},{l:"yy",d:"year"}],x=j.length,S=0;S<x;S+=1){var P=j[S];P.d&&(I=h?o(g).diff(C,P.d,!0):C.diff(g,P.d,!0));var L=(n.rounding||Math.round)(Math.abs(I));if(v=I>0,L<=P.r||!P.r){L<=1&&S>0&&(P=j[S-1]);var k=O[P.l];m&&(L=m(""+L)),B=typeof k=="string"?k.replace("%d",L):k(L,p,P.l,v);break}}if(p)return B;var q=v?O.future:O.past;return typeof q=="function"?q(B):q.replace("%s",B)},s.to=function(g,p){return u(g,p,this,!0)},s.from=function(g,p){return u(g,p,this)};var A=function(g){return g.$u?o.utc():o()};s.toNow=function(g){return this.to(A(this),g)},s.fromNow=function(g){return this.from(A(this),g)}}})})(ey);var x8=ey.exports;const w8=bo(x8);qr.extend(w8);const Iu=e=>{const t=R.useRecordContext(e),[n]=R.useLocaleState(),r=w.useMemo(()=>qr(dt.get(t,e==null?void 0:e.source)).locale(n).fromNow(),[t,e==null?void 0:e.source,n]);return f.jsxs(w.Fragment,{children:[f.jsx(R.DateField,{record:t,source:e.source,showTime:!0}),f.jsx("br",{}),f.jsx(b.Typography,{variant:"caption",color:"textSecondary",children:r})]})};Iu.displayName="DateAgoField";Iu.propTypes={source:c.string.isRequired};const ty=ue(R.DateField,{name:"RaApplicaDateField",slot:"Root"})(()=>({}));ty.propTypes={...R.DateField.propTypes};const Hf=e=>f.jsx(ty,{...e});Hf.defaultProps={...R.DateField.defaultProps,variant:"body1"};Hf.propTypes={...R.DateField.propTypes};const ny=ue(R.EmailField,{name:"RaApplicaEmailField",slot:"Root"})(()=>({}));ny.propTypes={...R.EmailField.propTypes};const Wf=e=>f.jsx(ny,{...e});Wf.defaultProps={...R.EmailField.defaultProps,variant:"body1"};Wf.propTypes={...R.EmailField.propTypes};const T8=ue(R.FileField,{name:"RaApplicaFileField",slot:"root"})(()=>({})),zf=({...e})=>{const t=R.useRecordContext(e),n=w.useCallback(r=>{r.preventDefault(),r.stopPropagation();const o=dt.get(t,`_${e==null?void 0:e.source}`,dt.get(t,e==null?void 0:e.source)),s=dt.get(t,(e==null?void 0:e.title)||(e==null?void 0:e.source))||(e==null?void 0:e.title),l=document.createElement("a");l.href=o,l.download=s,l.click()},[e==null?void 0:e.source,t,e==null?void 0:e.title]);return f.jsx(T8,{...e,record:t,onClick:n})};zf.propTypes={...R.FileField.propTypes,source:c.string,title:c.string};const ry=e=>f.jsx(R.FunctionField,{...e});ry.defaultProps={variant:"body1"};const oy=ue(R.TextField,{name:"RaApplicaTextField",slot:"Root"})(()=>({}));oy.propTypes={...R.TextField.propTypes};const Bu=e=>f.jsx(oy,{...e});Bu.defaultProps={...R.TextField.defaultProps,variant:"body1"};Bu.propTypes={...R.TextField.propTypes};function P8(e){const t=b.useTheme(),n=de.useLocales(),{source:r=""}=e,o=de.useRecordContext(e),s=o[r],l=!nf(s,n),u=Pr(e,{flex:1}),[A]=de.useLocaleState(),g=w.useMemo(()=>l?f.jsx(et.FlagFilled,{style:{color:t.palette.warning.main}}):f.jsx(et.FlagOutlined,{}),[l]),p=w.useMemo(()=>f.jsx(b.Stack,{children:Ae.map(n,(C,h)=>f.jsx(b.Typography,{children:`${C.locale.toUpperCase()}: ${(s??{})[C.locale]??""}`},h))}),[s,n]);return f.jsx(Ff,{title:p,arrow:!1,children:f.jsxs(b.Stack,{alignItems:"center",direction:"row",gap:1,children:[g,f.jsx(Bu,{...e,source:`${r}.${A}`,sx:u})]})})}const S8=ue("div")(({theme:e})=>({borderBottom:`1px solid ${e.palette.divider}`,paddingTop:e.spacing(1),paddingBottom:e.spacing(1),marginBottom:e.spacing(1),whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis",[e.breakpoints.down("sm")]:{whiteSpace:"normal",overflow:"visible",textOverflow:"inherit"}})),Uf=({source:e,defaultValue:t,...n})=>{const r=R.useRecordContext(n),o=dt.get(r,e,t);return f.jsx("span",{dangerouslySetInnerHTML:{__html:o&&o!==null?o:t}})};Uf.propTypes={defaultValue:c.any,source:c.string,record:c.object};Uf.defaultProps={defaultValue:"&nbsp;"};const iy=({title:e,children:t})=>e&&e!==!1?f.jsx(b.Tooltip,{title:e,placement:"top",children:t}):t;iy.propTypes={title:c.oneOfType([c.string,c.bool]),children:c.oneOfType([c.element,c.arrayOf(c.element)])};const Yf=({label:e,source:t,defaultValue:n,children:r,tooltip:o,...s})=>{const{getCurrentDialog:l}=ci(),u=R.useRecordContext(s),A=R.useResourceContext(s),g=l(),p=w.useMemo(()=>!o||o===!1?!1:typeof o=="function"?o(u):typeof o=="string"?dt.get(u,o,o):o,[u,o]);return f.jsx(iy,{title:p,children:f.jsxs(w.Fragment,{children:[f.jsx(b.InputLabel,{children:f.jsx(R.FieldTitle,{label:e,source:t,resource:g||A})}),f.jsx(S8,{...s,children:w.cloneElement(r,{source:t,record:u,defaultValue:n,resource:g||A})})]})})};Yf.propTypes={defaultValue:c.any,tooltip:c.oneOfType([c.string,c.bool,c.func]),source:c.string,label:c.string,name:c.string,children:c.element};Yf.defaultProps={defaultValue:"&nbsp;",children:f.jsx(Uf,{})};const Gf=function({children:e,className:t}){return f.jsx("div",{className:t,children:e})};Gf.defaultProps={children:null,className:""};Gf.propTypes={children:c.node,className:c.string};const R8=Ta(Gf,{name:"RaApplicaReferenceManyField",slot:"root"})(({theme:e,margin:t,border:n,bulkActionButtons:r})=>({marginLeft:t?0:`-${e.spacing(2.5)}`,marginRight:t?0:`-${e.spacing(2.5)}`,borderBottom:n?`1px solid ${e.palette.divider}`:"none","& form":{padding:e.spacing(2)},"& .MuiCardContent-root":{borderTop:n?`1px solid ${e.palette.divider}`:"none"},"& .MuiToolbar-root":{[e.breakpoints.up("sm")]:{marginTop:`-${e.spacing(2)}`,marginBottom:e.spacing(t?0:1),marginLeft:e.spacing(t?1:2),marginRight:e.spacing(t?1:2),width:t?"auto":`calc(100% - ${e.spacing(5)})`},[e.breakpoints.down("md")]:{marginTop:0}},"& .RaDatagrid-root":{overflowX:"auto",paddingTop:r===!1?0:48,[e.breakpoints.down("sm")]:{width:"calc(100vw - 34px)"}},"& .RaDatagrid-table":{borderBottom:`1px solid ${e.palette.divider}`},"& .MuiTablePagination-toolbar":{marginTop:e.spacing(1),marginBottom:0},"& .RaBulkActionsToolbar-collapsed.RaBulkActionsToolbar-toolbar":{minHeight:0},"& .RaBulkActionsToolbar-toolbar":{minHeight:48,bottom:-56,"& h6":{marginTop:e.spacing(.5)},"& .RaBulkActionsToolbar-topToolbar":{marginTop:e.spacing(1)},[e.breakpoints.down("sm")]:{bottom:-48,borderRadius:0}}})),fs=e=>f.jsx(R8,{...e,children:f.jsx(R.ReferenceManyField,{pagination:f.jsx(R.Pagination,{}),...e})});fs.defaultProps={margin:!1,border:!1};fs.propTypes={...R.ReferenceManyField.propTypes,margin:c.bool,border:c.bool};const sy=({source:e,...t})=>{const n=R.useRecordContext(t),r=dt.get(n,e,0),o=r/1024,s=o/1024,l=s/1024,u=l>1?`${l.toFixed(2)} GB`:s>1?`${s.toFixed(2)} MB`:o>1?`${o.toFixed(2)} KB`:`${r.toFixed(2)} B`;return f.jsx(b.Typography,{component:"span",variant:"body1",...t,children:u})};sy.propTypes={record:c.object,source:c.string};const nt=({label:e,children:t,display:n,helperText:r,sx:o,addLabel:s,divider:l,...u})=>{const A=_t.useTheme(),{getCurrentDialog:g}=ci(),{source:p,resource:C,isRequired:h}=u,{fieldState:{invalid:m}}=R.useInput(u),I=g();return f.jsxs(b.Stack,{spacing:1,sx:{width:u!=null&&u.fullWidth?"100%":"auto","& .MuiFormHelperText-root":{color:m?A.palette.error.main:A.palette.text.secondary,"& span":{display:"none"}},...o},children:[n==="label"&&e!==!1&&s!==!1&&f.jsx(b.InputLabel,{error:m===!0,sx:{borderBottom:l?`1px solid ${A.palette.divider}`:"none",pb:l?1:0,mt:l?1:0},children:f.jsx(R.FieldTitle,{label:e,source:p,resource:I||C,isRequired:h})}),w.isValidElement(t)?w.cloneElement(t,{...t.props,...u,label:n==="legend"?e:!1}):t,n==="label"&&r&&f.jsx(b.FormHelperText,{sx:{pl:1.8,pb:2,marginTop:"0 !important"},error:m===!0,children:r})]})};nt.propTypes={sx:c.object,children:c.element,label:c.oneOfType([c.string,c.bool]),addLabel:c.bool,resource:c.string,isRequired:c.bool,source:c.string,display:c.oneOf(["legend","label"]),helperText:c.oneOfType([c.string,c.bool]),divider:c.bool};nt.defaultProps={display:"label",divider:!1};const O8=e=>e?{"& .RaFileInput-removeButton > .RaFileInputPreview-removeButton":{display:"none",visiblity:"hidden"},"& .RaFileInput-dropZone":{display:"none",visiblity:"hidden"}}:{},j8=ue(R.FileInput,{name:"RaApplicaFileInput",slot:"root"})(({disabled:e,theme:t})=>({"& .previews":{},"& .previews>div":{marginTop:t.spacing(1),padding:t.spacing(1.5),border:`1px solid ${t.palette.divider}`,borderRadius:t.shape.borderRadius,"& button":{float:"right",placeItems:"flex-end",verticalAlign:"middle"},"&:hover":{backgroundColor:t.palette.action.hover},"& .MuiLink-root":{fontSize:t.typography.body1.fontSize}},...O8(e)})),Kf=({children:e,disabled:t,type:n,...r})=>{const o=R.useRecordContext(r),s=r==null?void 0:r.source,l=o==null?void 0:o.id;return R.useInput({source:`__${n}__${r==null?void 0:r.source}`,defaultValue:r==null?void 0:r.source}),f.jsx(nt,{...r,children:f.jsx(j8,{disabled:t,children:w.cloneElement(e,{...e.props,entityId:l,property:s})})})};Kf.propTypes={...R.FileInput.propTypes,children:c.node,multiple:c.bool,disabled:c.bool};Kf.defaultProps={children:f.jsx(Vf,{title:"name",source:"path"}),multiple:!0,disabled:!1,type:"attachment"};const M8=ue(R.AutocompleteArrayInput,{name:"StyledAutocompleteInput",root:"root"})(({label:e})=>({"& legend":{width:e===!1?0:"auto"},"& .MuiAutocomplete-inputRoot":{padding:"0px 9px"},'& label.MuiFormLabel-root[data-shrink="false"]':{minHeight:"18px"}})),qf=({...e})=>f.jsx(nt,{...e,children:f.jsx(M8,{})});qf.propTypes={...R.AutocompleteArrayInput.propTypes,...nt.propTypes};qf.defaultProps={...R.AutocompleteArrayInput.defaultProps,size:"small"};const D8=ue(R.AutocompleteInput,{name:"StyledAutocompleteInput",root:"root"})(({label:e})=>({"& legend":{width:e===!1?0:"auto"},'& label.MuiFormLabel-root[data-shrink="false"]':{minHeight:"18px"},"& .MuiAutocomplete-inputRoot":{padding:"0px 9px"},"& .MuiOutlinedInput-root.MuiInputBase-sizeSmall":{paddingTop:"4px"}})),Jf=e=>{const{perPage:t,...n}=e;return f.jsx(nt,{...n,children:f.jsx(D8,{})})};Jf.propTypes={...R.AutocompleteInput.propTypes,...nt.propTypes};Jf.defaultProps={...R.AutocompleteInput.defaultProps,size:"small"};const k8=ue(R.BooleanInput,{name:"RaApplicaBooleanInput",slot:"Root"})(()=>({})),Xf=({horizontal:e,...t})=>{const n=Rt();return f.jsx(nt,{...t,sx:e?{flexDirection:e?"row":"column",alignItems:e?"center":"flex-start","& .MuiFormGroup-root":{margin:0},"& .MuiFormControlLabel-root":{margin:0,"& .MuiTypography-root":{display:"none",visibility:"hidden"},"& .MuiSwitch-root":{marginRight:`-${n.spacing(.5)}`}}}:{},children:f.jsx(k8,{})})};Xf.defaultProps={...R.BooleanInput.defaultProps,...nt.defaultProps};Xf.propTypes={...R.BooleanInput.propTypes,...nt.propTypes,horizontal:c.bool};const F8=ue(R.DateInput,{name:"RaApplicaDateInput",slot:"root"})(({label:e})=>({"& legend":{width:e===!1?0:"auto"}})),Zf=e=>f.jsx(nt,{...e,children:f.jsx(F8,{})});Zf.propTypes={...R.DateInput.propTypes,...nt.propTypes};Zf.defaultProps={...R.DateInput.defaultProps,...nt.defaultProps};const L8=ue(R.DateTimeInput,{name:"RaApplicaDateTimeInput",slot:"root"})(({label:e})=>({"& legend":{width:e===!1?0:"auto"}})),_f=e=>f.jsx(nt,{...e,children:f.jsx(L8,{})});_f.propTypes={...R.DateTimeInput.propTypes,...nt.propTypes};_f.defaultProps={...nt.defaultProps};const N8=ue(R.FileInput,{name:"RaApplicaFileInput",slot:"root"})(({theme:e})=>({"& .previews":{},"& .previews>div":{marginTop:e.spacing(1),padding:e.spacing(1.5),border:`1px solid ${e.palette.divider}`,borderRadius:e.shape.borderRadius,"& button":{float:"right",placeItems:"flex-end",verticalAlign:"middle"},"&:hover":{backgroundColor:e.palette.action.hover},"& .MuiLink-root":{fontSize:e.typography.body1.fontSize}}})),$f=({children:e,title:t,...n})=>{const r=ai.useWatch({name:n.source}),o=R.useRecordContext(n),{source:s}=n,l=w.useMemo(()=>{if(r&&(r!=null&&r.title))return r==null?void 0:r.title;const u=dt.get(o,s);if(u){const A=u.split("__");return A.length>0?A[A.length-1]:u}return u},[o,s,r]);return f.jsx(nt,{...n,children:f.jsx(N8,{children:w.cloneElement(e,{...e.props,title:t||s,source:s,record:{...o,[s]:(r==null?void 0:r.title)||dt.get(o,s),[`_${s}`]:(r==null?void 0:r.src)||dt.get(o,`_${s}`),[t||s]:l}})})})};$f.propTypes={...R.FileInput.propTypes,source:c.string,title:c.string,children:c.node};$f.defaultProps={children:f.jsx(zf,{})};const ep=({children:e,title:t,...n})=>{const r=ai.useWatch({name:n.source}),o=R.useRecordContext(n),{source:s}=n;return R.useInput({source:`__image__${n==null?void 0:n.source}`,defaultValue:n==null?void 0:n.source}),f.jsx(nt,{...n,children:f.jsx(R.ImageInput,{accept:"image/*",children:w.cloneElement(e,{...e.props,title:t,source:s,record:{...o,[s]:(r==null?void 0:r.title)||dt.get(o,s),[`_${s}`]:(r==null?void 0:r.src)||dt.get(o,`_${s}`)}})})})};ep.defaultProps={children:f.jsx(Eu,{}),multiple:!1};ep.propTypes={...R.ImageInput.propTypes,source:c.string,title:c.string,children:c.node,multiple:c.bool};const Mn=e=>f.jsx(nt,{...e,children:f.jsx(R.TextInput,{})});Mn.propTypes={...R.TextInput.propTypes,...nt.propTypes};const V8={vertical:"bottom",horizontal:"right"},H8={vertical:"top",horizontal:"right"};function W8(e){const{source:t}=e,{fieldState:n}=de.useInput(e),r=ai.useWatch({name:t}),{error:o}=n,s=de.useLocales(),l=!nf(r,s),[u]=de.useLocaleState(),[A,g]=w.useState(u),[p,C]=w.useState(null),h=!!p,m=w.useCallback(v=>C(h?null:v.currentTarget),[h,C]),I=w.useCallback(()=>C(null),[C]),B=w.useMemo(()=>Ae.map(s,(v,O)=>f.jsx(b.MenuItem,{onClick:()=>{g(v.locale),I()},children:f.jsx(b.ListItemText,{primary:`${v.locale.toUpperCase()}: ${(r??{})[v.locale]??""}`})},O)),[s,g,I,r]);return f.jsx(nt,{...e,helperText:o==null?void 0:o.message,children:f.jsxs(b.Box,{flex:1,children:[Ae.map(s,(v,O)=>f.jsx(Mn,{...e,source:`${t}.${v.locale}`,sx:{width:"100%",display:v.locale===A?"inline-flex":"none"},label:!1,InputProps:{endAdornment:f.jsx(b.Chip,{label:f.jsx(b.Typography,{variant:"button",children:A}),size:"small",onClick:m,color:l?"warning":void 0})}},O)),f.jsx(b.Menu,{anchorEl:p,open:h,anchorOrigin:V8,transformOrigin:H8,onClose:I,children:B})]})})}const z8=ue(R.NumberInput,{name:"RaApplicaNumberInput",slot:"root"})(({label:e})=>({"& legend":{width:e===!1?0:"auto"}})),tp=e=>f.jsx(nt,{...e,children:f.jsx(z8,{})});tp.propTypes={...R.NumberInput.propTypes,...nt.propTypes};tp.defaultProps={...R.NumberInput.defaultProps,...nt.defaultProps};const ay=({source:e,minWidth:t=300,children:n})=>{const r=R.useResourceContext(),o=R.useRecordContext(),[s,l]=w.useState(dt.get(o,e,"")),[u,A]=w.useState(!1),g=w.useCallback(I=>l(I.target.value),[]),p=R.useDataProvider(),C=w.useCallback(I=>{I.key==="Enter"&&(A(!0),p.update(r,{id:o.id,data:{...o,[e]:s,_changed:e}}).then(()=>A(!1)))},[s,p,r,o,e]),h=w.useCallback(()=>{dt.get(o,e)!==s&&(A(!0),p.update(r,{id:o.id,data:{...o,[e]:s,_changed:e}}).then(()=>A(!1)))},[s,p,r,e,o]),m=w.useCallback(I=>{A(!0),p.update(r,{id:o.id,data:{...o,[e]:I,_changed:e}}).then(()=>A(!1))},[p,r,e,o]);return w.useEffect(()=>l(dt.get(o,e)),[o,e]),n?w.cloneElement(n,{...n.props,source:e,value:s,onChange:m}):f.jsx(b.TextField,{value:s,disabled:u,onChange:g,onKeyPress:C,onBlur:h,style:{minWidth:t,width:"100%"},multiline:!0,InputProps:{"arial-label":"naked"},size:"small"})};ay.propTypes={source:c.string.isRequired,minWidth:c.number,children:c.element};const np=({children:e,...t})=>f.jsx(R.ReferenceArrayInput,{...t,children:w.cloneElement(e,{...t,source:e.props.source||t.source})});np.propTypes={...R.ReferenceArrayInput.propTypes,children:c.element};np.defaultProps={...R.ReferenceArrayInput.defaultProps};const rp=({children:e,...t})=>f.jsx(R.ReferenceInput,{...t,children:w.cloneElement(e,{...t,source:e.props.source||t.source})});rp.propTypes={...R.ReferenceInput.propTypes,children:c.element};rp.defaultProps={...R.ReferenceInput.defaultProps};const op=({reference:e,target:t,children:n,filters:r,actions:o,...s})=>f.jsx(R.ResourceContextProvider,{value:e,children:f.jsx(fs,{perPage:5,pagination:f.jsx(R.Pagination,{}),...s,reference:e,target:t,children:f.jsxs(w.Fragment,{children:[f.jsx(R.ListToolbar,{filters:r,actions:o}),n]})})});op.propTypes={...fs.propTypes,children:c.node.isRequired,reference:c.string.isRequired,target:c.string.isRequired,filters:c.oneOfType([c.element,c.func,c.element,c.arrayOf(c.node)]),actions:c.oneOfType([c.element,c.func,c.element])};op.defaultProps={...fs.defaultProps};const U8=ue(R.SearchInput,{name:"RaApplicaSearchInput",slot:"root"})(()=>({})),Y8=e=>f.jsx(U8,{...e}),ly=ue(R.SelectArrayInput,{name:"RaApplicaSelectArrayInput",slot:"Root"})(({label:e})=>({"& legend":{width:e===!1?0:"auto"},"& .RaSelectArrayInput-chips > .RaSelectArrayInput-chip":{marginTop:"-2px",marginBottom:"-2px"},'& label.MuiFormLabel-root[data-shrink="false"]':{marginTop:"2px"}}));ly.propTypes={...R.SelectArrayInput.propTypes};const ip=e=>f.jsx(nt,{...e,children:f.jsx(ly,{options:{autoWidth:!1}})});ip.defaultProps={optionText:"name",optionValue:"id"};ip.propTypes={...R.SelectArrayInput.propTypes,...nt.propTypes};const G8=ue(R.SelectInput,{name:"RaApplicaSelectArrayInput",slot:"Root"})(({label:e})=>({"& legend":{width:e===!1?0:"auto"},'& label.MuiFormLabel-root[data-shrink="false"]':{marginTop:"2px"}})),cy=e=>f.jsx(nt,{...e,children:f.jsx(G8,{})});cy.propTypes={...R.SelectInput.propTypes,...nt.propTypes};const vu=({...e})=>{var u,A;const t=R.useTranslate(),n=R.maxLength(e==null?void 0:e.maxLength,"app.input.max_length_error"),r=(A=(u=ai.useController({name:e==null?void 0:e.source}))==null?void 0:u.field)==null?void 0:A.value;let o=e.helperText,s=e.validate;s?Array.isArray(s)&&s.indexOf(n)===-1&&s.push(n):s=[n];const l=t("app.input.max_length_info",{count:(r==null?void 0:r.length)||0,max:e==null?void 0:e.maxLength});return e!=null&&e.maxLength&&(o=o&&o.length>0?`${l} - ${t(o)}`:l),f.jsx(Mn,{...e,validate:s,helperText:o,inputProps:{maxLength:e==null?void 0:e.maxLength}})};vu.displayName="SmartTextInput";vu.defaultProps={multiline:!1};vu.propTypes={...Mn.propTypes,maxLength:c.number,multiline:c.bool,rows:c.number};const K8=e=>{if(!e)return"";const t=aB(e);return t?t.format("HH:mm"):""},q8=e=>e,J8=ue(R.TimeInput,{name:"RaApplicaTimeInput",slot:"root"})(({label:e})=>({"& legend":{width:e===!1?0:"auto"}})),sp=e=>f.jsx(nt,{...e,children:f.jsx(J8,{})});sp.defaultProps={...R.TimeInput.defaultProps,format:K8,parse:q8};sp.propTypes={...R.TimeInput.propTypes,...nt.propTypes};const ap=({onSuccess:e,firstAccess:t})=>{const{spacing:n}=Ln(),[r,o]=w.useState(!1),s=de.useAuthProvider(),l=de.useTranslate(),u=de.useNotify(),A=w.useCallback(g=>{const{oldPassword:p,newPassword:C}=g;o(!0),s==null||s.changePassword(p,C).then(()=>{u("ra.auth.password_changed"),e()}).catch(h=>{u((h==null?void 0:h.message)||(h==null?void 0:h.toString()),{type:"error"})}).finally(()=>o(!1))},[s,e]);return f.jsx(de.ResourceContextProvider,{value:"user/change-password",children:f.jsx(de.EditContextProvider,{value:{record:{},resource:"user/change-password",save:A},children:f.jsx(Cu,{onSubmit:A,toolbar:f.jsx(pr,{children:f.jsx(R.SaveButton,{disabled:r})}),children:f.jsxs(b.Grid,{container:!0,spacing:n,children:[t===!0&&f.jsx(b.Grid,{item:!0,xs:12,children:f.jsxs(b.Alert,{severity:"warning",children:[f.jsx(b.AlertTitle,{children:l("ra.auth.first_access.change_password")}),l("ra.auth.first_access.change_password_helper")]})}),f.jsx(b.Grid,{item:!0,xs:12,children:f.jsx(Mn,{source:"oldPassword",type:"password",validate:de.required()})}),f.jsx(b.Grid,{item:!0,xs:12,children:f.jsx(Mn,{source:"newPassword",type:"password",validate:de.required()})})]})})})})},X8=ue(R.Edit,{name:"RaApplicaEdit",slot:"root"})(({theme:e})=>({"&>.MuiToolbar-root:first-of-type":{backgroundColor:e.palette.background.default},"& .RaEdit-card":{[e.breakpoints.down("sm")]:{marginBottom:e.spacing(6)}},"& .RaEdi-card, & > div > div > form":{backgroundColor:e.palette.background.default},"& .RaToolbar-mobileToolbar":{borderTop:`1px solid ${e.palette.divider}`},"& .RaEdit-main>.MuiPaper-root:first-of-type":{overflow:"visible",backgroundColor:e.palette.background.default}})),Z8=ue(b.CardHeader)(({theme:e})=>({marginTop:e.spacing(4),marginLeft:0,marginRight:0,paddingLeft:0,paddingRight:0})),_8=ue(b.Divider)(({theme:e})=>({marginLeft:`-${e.spacing(2.5)}`,marginRight:`-${e.spacing(2.5)}`,marginBottom:e.spacing(2),width:`calc(100% + ${e.spacing(5)})`})),lp=({title:e,divider:t,variant:n})=>{const r=R.useTranslate();return f.jsxs(w.Fragment,{children:[f.jsx(Z8,{title:r(e,{_:e}),titleTypographyProps:{variant:n}}),t&&f.jsx(_8,{})]})};lp.propTypes={title:c.string.isRequired,divider:c.bool,variant:c.oneOf(["h1","h2","h3","h4","h5","h6"])};lp.defaultProps={divider:!0,variant:"h4"};const $8=ue(b.Grid,{name:"ApplicaLongFormView",slot:"Root"})(({theme:e})=>({"& .MuiToolbar-root":{position:"initial",marginTop:e.spacing(2),marginLeft:`-${e.spacing(3)}`,marginRight:`-${e.spacing(3)}`,marginBottom:`-${e.spacing(2)}`,borderTop:`1px solid ${e.palette.divider}`,[e.breakpoints.down("sm")]:{position:"initial !important",width:"auto !important",marginRight:0}},"& form > .MuiToolbar-root":{margin:0,marginRight:`-${e.spacing(.5)}`,[e.breakpoints.down("sm")]:{marginRight:e.spacing(.5)}}}));function uy(e){const{spacing:t}=Ln(),{spacing:n=t}=e,r=Ae.omit(e,["spacing"]);return f.jsx(R.Form,{...r,children:f.jsx($8,{container:!0,spacing:n*2,children:e.children})})}function Cg(e){return e.id??e.label}function Ay(e,t){const n=`^${e}.`.replaceAll(".","\\."),r=new RegExp(n,"g");return t.match(r)!==null}function e6(e){return Ae.map(e,"id")}function Rc(e){const t=e.match(new RegExp("[^.]+","g"));return t===null?0:t.length}function dy(e,t){const n=e!==void 0?Rc(e):0;return Ae.chain(t).filter(o=>e!==void 0?Ay(e,o.id):!0).filter(o=>Rc(o.id)===n+1).value()}function t6(e,t){var s;const n=Ae.clone(e),{type:r,payload:o}=t;switch(r){case"setFormRootPath":return Ae.extend(n,{formRootPath:o});case"setSyncWithLocation":return Ae.extend(n,{syncWithLocation:o});case"setErrorCount":return Ae.extend(n,{errorCount:o});case"setActiveItem":return Ae.includes(e6(e.items),o)?Ae.extend(n,{activeItem:o}):n;case"addItem":{const{id:l}=o;return Ae.extend(n,{items:Ae.chain(n.items).clone().reject(u=>u.id===l).concat([o]).orderBy(u=>u.index).value()})}case"removeItem":{const l=Ae.isString(o)?o:o.id,u=Ae.chain(n.items).clone().reject(A=>A.id===l).value();return Ae.extend(n,{items:u}),n.activeItem===l&&Ae.extend(n,{activeItem:((s=Ae.first(u))==null?void 0:s.id)??void 0}),n}default:return n}}const n6={syncWithLocation:!0,errorCount:!0,items:[],activeItem:void 0},gy=w.createContext(void 0);function fy(e){const t=!!(e.syncWithLocation??!0),n=!!(e.errorCount??!0),{rootMatchString:r}=e,{pathname:o}=_i.useLocation(),[s,l]=w.useReducer(t6,Ae.cloneDeep(n6)),{formRootPath:u,items:A}=s,g=w.useMemo(()=>({state:s,dispatch:l}),[s,l]);return w.useEffect(()=>{const p=["entities/:resource/create/*",":resource/create/*","entities/:resource/:id/show/*",":resource/:id/show/*","entities/:resource/:id/*",":resource/:id/*"];r!==void 0&&p.push(r);const C=Ae.chain(p).map(m=>_i.matchPath(m,o)).reject(m=>m===null).first().value(),h=C==null?void 0:C.pathnameBase;h!==void 0&&h!==u&&l({type:"setFormRootPath",payload:h})},[o,u,r]),w.useEffect(()=>{l({type:"setSyncWithLocation",payload:!!t})},[t,l]),w.useEffect(()=>{l({type:"setErrorCount",payload:!!n})},[n,l]),w.useEffect(()=>{var p;if(t&&u!==void 0){let C=o.replace(u,"").replace(new RegExp(/^\/?/),"");Ae.isEmpty(C)&&(C=((p=Ae.chain(A).filter(h=>dy(h.id,A).length===0).orderBy([h=>Rc(h.id),h=>h.index]).first().value())==null?void 0:p.id)??void 0),l({type:"setActiveItem",payload:C})}},[l,u,o,A]),f.jsx(gy.Provider,{value:g,children:e.children})}function py(){const e=w.useContext(gy);if(e===void 0)throw new Error("[LongForm] useFormContext: context undefined. Please provide a valid Context using LongForm.Provider");return e}function ka(){return py().state}function cp(){return py().dispatch}function hy(){return ka().formRootPath}function Cy(){return ka().activeItem}function my(){return ka().items}function Ey(){return ka().syncWithLocation}function Iy(){return ka().errorCount}function By(){const e=cp();return w.useCallback(n=>{e({type:"setActiveItem",payload:n})},[e])}function vy(){const e=cp();return w.useCallback(n=>{e({type:"addItem",payload:n})},[e])}function yy(){const e=cp();return w.useCallback(n=>{e({type:"removeItem",payload:n})},[e])}var r6=e=>{let t=e;for(;t=t.parentElement;){const n=getComputedStyle(t,null).getPropertyValue("overflow-y");if(t===document.body)return window;if(n==="auto"||n==="scroll"||n==="overlay")return t}return window},by=e=>e.firstChild?e.firstChild.offsetParent===e:!0,o6=(e,t)=>{let n=e,r=0;by(t)||(r+=e.offsetTop-t.offsetTop,t=e.offsetParent,r+=-e.offsetTop);do r+=n.offsetTop,n=n.offsetParent;while(n&&n!==t);return r},i6=e=>{let t=e.parentElement;for(;t&&getComputedStyle(t,null).getPropertyValue("display")==="contents";)t=t.parentElement;return t||window},ma=null;typeof CSS<"u"&&CSS.supports&&(CSS.supports("position","sticky")?ma="sticky":CSS.supports("position","-webkit-sticky")&&(ma="-webkit-sticky"));var Oc=!1;try{const e=Object.defineProperty({},"passive",{get(){Oc={passive:!0}}}),t=()=>{};window.addEventListener("testPassive",t,e),window.removeEventListener("testPassive",t,e)}catch{}var Pd=e=>{const{el:t,onChange:n,unsubs:r,measure:o}=e;if(t===window){const s=()=>({top:0,left:0,height:window.innerHeight,width:window.innerWidth}),l=o(s()),u=()=>{Object.assign(l,o(s())),n()};return window.addEventListener("resize",u,Oc),r.push(()=>window.removeEventListener("resize",u)),l}else{const s=o(t.getBoundingClientRect()),l=()=>{Object.assign(s,o(t.getBoundingClientRect())),n()},u=new ResizeObserver(l);return u.observe(t),r.push(()=>u.disconnect()),s}},s6=e=>{const t=getComputedStyle(e,null),n=parseInt(t.getPropertyValue("padding-top"),10),r=parseInt(t.getPropertyValue("padding-bottom"),10);return{top:n,bottom:r}},a6=(e,t,n)=>{const{bottom:r,offsetBottom:o,offsetTop:s}=n,l=r6(e);let u=!1;const A=()=>{u||requestAnimationFrame(()=>{const k=C();k!==x&&S(k),u=!1}),u=!0};let g=l===window?window.scrollY:l.scrollTop;const p=k=>{const{offsetTop:q,height:J}=m,{naturalTop:U}=v,{height:_}=O;return k+q+J>=U+_+j+o},C=()=>{const{height:k}=m,{height:q}=O;return q+s+o<=k?3:p(g)?1:2},h=l!==window&&by(l),m=Pd({el:l,onChange:A,unsubs:t,measure:({height:k,top:q})=>({height:k,offsetTop:h?q:0})}),I=i6(e),B=I===window?{top:0,bottom:0}:s6(I),v=Pd({el:I,onChange:A,unsubs:t,measure:({height:k})=>({height:k-B.top-B.bottom,naturalTop:I===window?0:o6(I,l)+B.top+m.offsetTop})}),O=Pd({el:e,onChange:A,unsubs:t,measure:({height:k})=>({height:k})});let j=0,x=C();const S=k=>{const q=x;if(x=k,q===2&&(j=-1),k===3){e.style.position=ma,r?e.style.bottom=`${o}px`:e.style.top=`${s}px`;return}const{height:J,offsetTop:U}=m,{height:_,naturalTop:le}=v,{height:ie}=O;if(k===2)if(e.style.position="relative",j=q===0?Math.max(0,U+g-le+s):Math.max(0,U+g+J-(le+ie+o)),r){const Z=Math.max(0,_-ie-j);e.style.bottom=`${Z}px`}else e.style.top=`${j}px`;else e.style.position=ma,k===1?r?e.style.bottom=`${o}px`:e.style.top=`${J-ie-o}px`:r?e.style.bottom=`${J-ie-o}px`:e.style.top=`${s}px`};S(x);const P=k=>{if(k===g)return;const q=k-g;if(g=k,x===3)return;const{offsetTop:J,height:U}=m,{naturalTop:_,height:le}=v,{height:ie}=O;if(q>0)if(x===0){if(k+J+s>_){const Z=Math.max(0,J+g-_+s);k+J+U<=_+ie+Z+o?S(2):S(1)}}else x===2&&p(k)&&S(1);else if(x===1){if(J+k+U<_+le+o){const Z=Math.max(0,J+g+U-(_+ie+o));J+k+s>=_+Z?S(2):S(0)}}else x===2&&J+k+s<_+j&&S(0)},L=l===window?()=>P(window.scrollY):()=>P(l.scrollTop);l.addEventListener("scroll",L,Oc),l.addEventListener("mousewheel",L,Oc),t.push(()=>l.removeEventListener("scroll",L),()=>l.removeEventListener("mousewheel",L))},l6=({offsetTop:e=0,offsetBottom:t=0,bottom:n=!1}={})=>{const[r,o]=w.useState(null);return w.useEffect(()=>{if(!r||!ma)return;const s=[];return a6(r,s,{offsetBottom:t,offsetTop:e,bottom:n}),()=>{s.forEach(l=>l())}},[r,t,e,n]),o},c6=e=>{const{offsetTop:t,offsetBottom:n,bottom:r,children:o,className:s,style:l}=e,u=l6({offsetTop:t,offsetBottom:n,bottom:r});return f.jsx("div",{className:s,style:l,ref:u,children:o})},u6=c6,Qy=(e=>(e.TOP="top",e.BOTTOM="bottom",e))(Qy||{});function xy(e){const{sticky:t=!0,disposition:n={xl:3,lg:3,md:4,sm:4,xs:12},spacing:r=2}=e,o=Ae.omit(e,["sticky","disposition","spacing"]),s=t?u6:b.Box,l=w.useMemo(()=>t?{offsetTop:74,offsetBottom:r*2}:{},[t,r]);return f.jsx(b.Grid,{...o,item:!0,...n,children:f.jsx(s,{...l,children:f.jsx(b.Stack,{spacing:r,children:e.children})})})}function wy(e){return f.jsx(f.Fragment,{children:e.children})}function Ty(e){const{children:t}=e;return w.useMemo(()=>{const r={top:[],bottom:[]};return w.Children.forEach(t,o=>{if(w.isValidElement(o)&&(o==null?void 0:o.type)===wy){const{position:s}=o.props;switch(s){case"top":r.top.push(o);break;case"bottom":r.bottom.push(o);break}}}),r},[t])}function Py(e){const{disposition:t={xl:9,lg:9,md:8,sm:8,xs:12}}=e,n=Ae.omit(e,["disposition"]);return f.jsx(b.Grid,{...n,item:!0,...t,children:e.children})}function Sy(e){const t=Cy();return t===void 0?!1:e===t||Ay(e,t)}function Ry(e){const t=my();return w.useMemo(()=>dy(e,t),[t,e])}function A6(){const e=hy(),{search:t}=_i.useLocation(),n=_i.useNavigate();return w.useCallback(o=>{n(`${e}/${o}${t}`)},[e,n])}function Oy(){const e=Ry();return f.jsx(b.Card,{variant:"outlined",children:f.jsx(b.List,{sx:{"& .MuiListItemButton-root.Mui-selected":{borderColor:"palette.primary.main",borderRightStyle:"solid",borderRightWidth:2},"& .MuiListItemAvatar-root":{minWidth:24}},children:Ae.map(e,(t,n)=>f.jsx(up,{...t},n))})})}function up(e){const t=de.useTranslate()??Ae.identity,n=jy(e),{selected:r,label:o,icon:s,onClick:l,badge:u,items:A,isGroup:g,level:p,errors:C=0}=n,{spacing:h}=Ln(),[m,I]=w.useState(r),B=w.useCallback(j=>{I(!m),l(j)},[l,m]),v=s!==void 0,O=Ae.omit(e,["label","icon","selected","badge"]);return w.useEffect(()=>{r&&!m&&I(r)},[r,m,I]),f.jsxs(f.Fragment,{children:[f.jsx(b.ListItem,{...O,disablePadding:!0,children:f.jsxs(b.ListItemButton,{selected:r&&!g,onClick:B,sx:{pl:h*p},children:[v&&f.jsx(b.ListItemIcon,{children:s}),f.jsx(b.ListItemText,{inset:!v,primary:C===0?t(o):f.jsx(b.Badge,{variant:"dot",color:"error",sx:{"& > .MuiBadge-badge":{transform:"scale(1) translate(125%, 0)"}},children:t(o)})}),u&&f.jsx(b.ListItemAvatar,{children:f.jsx(Ca,{type:"filled",size:"xs",color:u.color??"default",children:u.content})}),g&&(m?f.jsx(Bn.ExpandLess,{}):f.jsx(Bn.ExpandMore,{}))]})}),g&&f.jsx(b.Collapse,{in:m,timeout:"auto",children:f.jsx(b.List,{children:Ae.map(A,(j,x)=>f.jsx(up,{...j},x))})})]})}function jy(e){const{id:t}=e,n=Sy(t),r=Rc(t),o=A6(),s=Ey(),l=By(),u=Ry(t),A=!Ae.isEmpty(u),g=w.useCallback(C=>{A||(s?o(e.id):l(e.id)),Ae.isFunction(e.onClick)&&e.onClick(C)},[l,o,e,s,A]);return w.useMemo(()=>({...e,selected:n,onClick:g,items:u,isGroup:A,level:r}),[e,n,g,u,A])}function My(e=[],t){const n=Ae.isArray(e)?e:[e],r=Ae.filter(n,o=>w.isValidElement(o));Ae.each(r,o=>{var s;t(o),My(((s=o==null?void 0:o.props)==null?void 0:s.children)??[],t)})}function Dy(e){const{errors:t}=ai.useFormState(),n=Iy(),{label:r,icon:o,badge:s,index:l=0,children:u}=e,A=Cg(e),g=vy(),p=yy(),C=Sy(A),h=[];n&&(e.sources!==void 0?h.push(...e.sources):My(u,I=>{var B;((B=I==null?void 0:I.props)==null?void 0:B.source)!==void 0&&h.push(I.props.source)}));const m=Ae.chain(h).uniq().map(I=>Ae.get(t,I)).reject(I=>I===void 0).value().length;return w.useEffect(()=>{g({id:A,index:l,label:r,icon:o,badge:s,errors:m})},[g,p,r,o,A,s,l,m]),w.useEffect(()=>()=>{p(A)},[A]),f.jsx(b.Box,{display:C?"unset":"none",children:e.children})}function ky(e){const t=Ap(e),n=Cg(e);return f.jsx(Dy,{...e,id:n,children:w.Children.map(t,r=>{const o=Cg(r.props);return w.cloneElement(r,{id:`${n}.${o}`})})})}function Fy(e){return f.jsx(Dy,{...e})}function Ap(e){const{children:t}=e;return w.useMemo(()=>Ae.chain(w.Children.toArray(t)).filter(r=>w.isValidElement(r)&&((r==null?void 0:r.type)===Fy||(r==null?void 0:r.type)===ky)).map((r,o)=>w.cloneElement(r,{index:o})).value(),[t])}function d6(e){const{tabsDisposition:t,contentDisposition:n,spacing:r=2}=e,o=Ae.pick(e,["syncWithLocation","errorCount"]),s=Ae.omit(e,["tabsDisposition","contentDisposition","syncWithLocation"]),{top:l,bottom:u}=Ty(e),A=Ap(e);return f.jsx(fy,{...o,children:f.jsxs(uy,{...s,spacing:r,children:[f.jsxs(xy,{disposition:t,spacing:r,children:[l,f.jsx(Oy,{}),u]}),f.jsx(Py,{disposition:n,children:A})]})})}const kt=d6;kt.BaseForm=uy;kt.Content=Py;kt.Provider=fy;kt.useItems=my;kt.useSyncWithLocation=Ey;kt.useErrorCount=Iy;kt.useFormRootPath=hy;kt.useActiveItem=Cy;kt.useSetActiveItem=By;kt.useAddItem=vy;kt.useRemoveItem=yy;kt.Sidebar=xy;kt.SidebarSection=wy;kt.SidebarSectionPosition=Qy;kt.useSidebarChildren=Ty;kt.NavMenu=Oy;kt.NavMenuItem=up;kt.useNavMenuItem=jy;kt.Tab=Fy;kt.Group=ky;kt.useBaseItemChildren=Ap;const g6=ue(R.Show,{name:"RaApplicaShow",slot:"root"})(({theme:e})=>({"&>.MuiToolbar-root:first-of-type":{backgroundColor:e.palette.background.default},"& .RaShow-card, & > div > div > form":{backgroundColor:e.palette.background.default},"& .RaShow-main>.MuiPaper-root:first-of-type":{overflow:"visible"}})),f6=ue(R.SimpleFormIterator,{name:"ApplicaSimpleFormIterator",root:"root"})(({theme:e})=>({"& .RaSimpleFormIterator-line":{paddingTop:e.spacing(1),paddingBottom:e.spacing(.5)},"& .RaSimpleFormIterator-action":{display:"flex",flexDirection:"row",alignItems:"center",mb:1.5},"& section":{width:"100%","& label":{position:"relative",overflow:"visible",transform:"none",marginLeft:0}}})),p6=Ta(R.TabbedForm,{name:"RaApplicaTabbedForm",slot:"Root"})(({theme:e,modal:t})=>({"& .MuiGrid-root.MuiGrid-container":{paddingBottom:e.spacing(t?0:1)},[e.breakpoints.down("sm")]:{paddingBottom:0}})),dp=e=>{const{title:t,modal:n,content:r,subheader:o,secondary:s,sx:l,...u}=e,A=sf(t);return f.jsx(Zn,{title:A,modal:n,content:r,subheader:o,secondary:s,sx:{...l,"& .MuiToolbar-root":{paddingLeft:"20px !important",paddingRight:"20px !important"}},border:!n,divider:!0,children:f.jsx(p6,{toolbar:f.jsx(pr,{}),...u})})};dp.defaultProps={toolbar:f.jsx(pr,{children:f.jsx(R.SaveButton,{type:"button"})}),secondary:f.jsx(li,{children:f.jsx(R.DeleteWithConfirmButton,{})})};dp.Tab=R.TabbedForm.Tab;const h6=D.forwardRef((e,t)=>{const{children:n,disabled:r,disableActions:o=!1,index:s,member:l,resource:u}=e,A=R.useTranslate(),[g,p]=D.useState(!1),{total:C,remove:h}=uB(),m=D.useCallback(()=>{p(!1),h(s)},[s,h]),I=w.useMemo(()=>({index:s,total:C,remove:()=>h(s)}),[s,C,h]);return f.jsxs(ef.Provider,{value:I,children:[w.Children.map(n,(B,v)=>{if(!w.isValidElement(B))return null;const{source:O,...j}=B.props;return f.jsx(b.TableCell,{sx:{border:0,verticalAlign:"top"},children:w.cloneElement(B,{source:O?`${l}.${O}`:l,index:O?void 0:v,resource:u,disabled:r,...j,label:""})})}),!o&&f.jsx(b.TableCell,{sx:{display:"flex",justifyContent:"center",alignItems:"center",border:0,pt:2.5},children:f.jsx(li,{horizontal:!0,children:f.jsx(b.Typography,{color:"error",onClick:()=>p(!0),children:A("ra.action.delete")})})}),n.length>0&&f.jsx(R.Confirm,{isOpen:g,title:A("ra.action.remove_item"),content:A("ra.message.remove_item"),onConfirm:m,onClose:()=>p(!1)})]})});var C6=Array.isArray,yu=C6,m6=typeof Xn=="object"&&Xn&&Xn.Object===Object&&Xn,E6=m6,I6=E6,B6=typeof self=="object"&&self&&self.Object===Object&&self,v6=I6||B6||Function("return this")(),bu=v6,y6=bu,b6=y6.Symbol,Qu=b6,BI=Qu,Ly=Object.prototype,Q6=Ly.hasOwnProperty,x6=Ly.toString,Gs=BI?BI.toStringTag:void 0;function w6(e){var t=Q6.call(e,Gs),n=e[Gs];try{e[Gs]=void 0;var r=!0}catch{}var o=x6.call(e);return r&&(t?e[Gs]=n:delete e[Gs]),o}var T6=w6,P6=Object.prototype,S6=P6.toString;function R6(e){return S6.call(e)}var O6=R6,vI=Qu,j6=T6,M6=O6,D6="[object Null]",k6="[object Undefined]",yI=vI?vI.toStringTag:void 0;function F6(e){return e==null?e===void 0?k6:D6:yI&&yI in Object(e)?j6(e):M6(e)}var gp=F6;function L6(e){return e!=null&&typeof e=="object"}var xu=L6,N6=gp,V6=xu,H6="[object Symbol]";function W6(e){return typeof e=="symbol"||V6(e)&&N6(e)==H6}var fp=W6,z6=yu,U6=fp,Y6=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,G6=/^\w*$/;function K6(e,t){if(z6(e))return!1;var n=typeof e;return n=="number"||n=="symbol"||n=="boolean"||e==null||U6(e)?!0:G6.test(e)||!Y6.test(e)||t!=null&&e in Object(t)}var q6=K6;function J6(e){var t=typeof e;return e!=null&&(t=="object"||t=="function")}var Ny=J6,X6=gp,Z6=Ny,_6="[object AsyncFunction]",$6="[object Function]",eL="[object GeneratorFunction]",tL="[object Proxy]";function nL(e){if(!Z6(e))return!1;var t=X6(e);return t==$6||t==eL||t==_6||t==tL}var Vy=nL,rL=bu,oL=rL["__core-js_shared__"],iL=oL,Sd=iL,bI=function(){var e=/[^.]+$/.exec(Sd&&Sd.keys&&Sd.keys.IE_PROTO||"");return e?"Symbol(src)_1."+e:""}();function sL(e){return!!bI&&bI in e}var aL=sL,lL=Function.prototype,cL=lL.toString;function uL(e){if(e!=null){try{return cL.call(e)}catch{}try{return e+""}catch{}}return""}var AL=uL,dL=Vy,gL=aL,fL=Ny,pL=AL,hL=/[\\^$.*+?()[\]{}|]/g,CL=/^\[object .+?Constructor\]$/,mL=Function.prototype,EL=Object.prototype,IL=mL.toString,BL=EL.hasOwnProperty,vL=RegExp("^"+IL.call(BL).replace(hL,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function yL(e){if(!fL(e)||gL(e))return!1;var t=dL(e)?vL:CL;return t.test(pL(e))}var bL=yL;function QL(e,t){return e==null?void 0:e[t]}var xL=QL,wL=bL,TL=xL;function PL(e,t){var n=TL(e,t);return wL(n)?n:void 0}var wu=PL,SL=wu,RL=SL(Object,"create"),Tu=RL,QI=Tu;function OL(){this.__data__=QI?QI(null):{},this.size=0}var jL=OL;function ML(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t}var DL=ML,kL=Tu,FL="__lodash_hash_undefined__",LL=Object.prototype,NL=LL.hasOwnProperty;function VL(e){var t=this.__data__;if(kL){var n=t[e];return n===FL?void 0:n}return NL.call(t,e)?t[e]:void 0}var HL=VL,WL=Tu,zL=Object.prototype,UL=zL.hasOwnProperty;function YL(e){var t=this.__data__;return WL?t[e]!==void 0:UL.call(t,e)}var GL=YL,KL=Tu,qL="__lodash_hash_undefined__";function JL(e,t){var n=this.__data__;return this.size+=this.has(e)?0:1,n[e]=KL&&t===void 0?qL:t,this}var XL=JL,ZL=jL,_L=DL,$L=HL,e9=GL,t9=XL;function ps(e){var t=-1,n=e==null?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}ps.prototype.clear=ZL;ps.prototype.delete=_L;ps.prototype.get=$L;ps.prototype.has=e9;ps.prototype.set=t9;var n9=ps;function r9(){this.__data__=[],this.size=0}var o9=r9;function i9(e,t){return e===t||e!==e&&t!==t}var s9=i9,a9=s9;function l9(e,t){for(var n=e.length;n--;)if(a9(e[n][0],t))return n;return-1}var Pu=l9,c9=Pu,u9=Array.prototype,A9=u9.splice;function d9(e){var t=this.__data__,n=c9(t,e);if(n<0)return!1;var r=t.length-1;return n==r?t.pop():A9.call(t,n,1),--this.size,!0}var g9=d9,f9=Pu;function p9(e){var t=this.__data__,n=f9(t,e);return n<0?void 0:t[n][1]}var h9=p9,C9=Pu;function m9(e){return C9(this.__data__,e)>-1}var E9=m9,I9=Pu;function B9(e,t){var n=this.__data__,r=I9(n,e);return r<0?(++this.size,n.push([e,t])):n[r][1]=t,this}var v9=B9,y9=o9,b9=g9,Q9=h9,x9=E9,w9=v9;function hs(e){var t=-1,n=e==null?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}hs.prototype.clear=y9;hs.prototype.delete=b9;hs.prototype.get=Q9;hs.prototype.has=x9;hs.prototype.set=w9;var T9=hs,P9=wu,S9=bu,R9=P9(S9,"Map"),O9=R9,xI=n9,j9=T9,M9=O9;function D9(){this.size=0,this.__data__={hash:new xI,map:new(M9||j9),string:new xI}}var k9=D9;function F9(e){var t=typeof e;return t=="string"||t=="number"||t=="symbol"||t=="boolean"?e!=="__proto__":e===null}var L9=F9,N9=L9;function V9(e,t){var n=e.__data__;return N9(t)?n[typeof t=="string"?"string":"hash"]:n.map}var Su=V9,H9=Su;function W9(e){var t=H9(this,e).delete(e);return this.size-=t?1:0,t}var z9=W9,U9=Su;function Y9(e){return U9(this,e).get(e)}var G9=Y9,K9=Su;function q9(e){return K9(this,e).has(e)}var J9=q9,X9=Su;function Z9(e,t){var n=X9(this,e),r=n.size;return n.set(e,t),this.size+=n.size==r?0:1,this}var _9=Z9,$9=k9,eN=z9,tN=G9,nN=J9,rN=_9;function Cs(e){var t=-1,n=e==null?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}Cs.prototype.clear=$9;Cs.prototype.delete=eN;Cs.prototype.get=tN;Cs.prototype.has=nN;Cs.prototype.set=rN;var Hy=Cs,Wy=Hy,oN="Expected a function";function pp(e,t){if(typeof e!="function"||t!=null&&typeof t!="function")throw new TypeError(oN);var n=function(){var r=arguments,o=t?t.apply(this,r):r[0],s=n.cache;if(s.has(o))return s.get(o);var l=e.apply(this,r);return n.cache=s.set(o,l)||s,l};return n.cache=new(pp.Cache||Wy),n}pp.Cache=Wy;var iN=pp,sN=iN,aN=500;function lN(e){var t=sN(e,function(r){return n.size===aN&&n.clear(),r}),n=t.cache;return t}var cN=lN,uN=cN,AN=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,dN=/\\(\\)?/g,gN=uN(function(e){var t=[];return e.charCodeAt(0)===46&&t.push(""),e.replace(AN,function(n,r,o,s){t.push(o?s.replace(dN,"$1"):r||n)}),t}),fN=gN;function pN(e,t){for(var n=-1,r=e==null?0:e.length,o=Array(r);++n<r;)o[n]=t(e[n],n,e);return o}var zy=pN,wI=Qu,hN=zy,CN=yu,mN=fp,EN=1/0,TI=wI?wI.prototype:void 0,PI=TI?TI.toString:void 0;function Uy(e){if(typeof e=="string")return e;if(CN(e))return hN(e,Uy)+"";if(mN(e))return PI?PI.call(e):"";var t=e+"";return t=="0"&&1/e==-EN?"-0":t}var IN=Uy,BN=IN;function vN(e){return e==null?"":BN(e)}var yN=vN,bN=yu,QN=q6,xN=fN,wN=yN;function TN(e,t){return bN(e)?e:QN(e,t)?[e]:xN(wN(e))}var PN=TN,SN=fp,RN=1/0;function ON(e){if(typeof e=="string"||SN(e))return e;var t=e+"";return t=="0"&&1/e==-RN?"-0":t}var jN=ON,MN=PN,DN=jN;function kN(e,t){t=MN(t,e);for(var n=0,r=t.length;e!=null&&n<r;)e=e[DN(t[n++])];return n&&n==r?e:void 0}var FN=kN,LN=FN;function NN(e,t,n){var r=e==null?void 0:LN(e,t);return r===void 0?n:r}var VN=NN;const HN=bo(VN),Yy=e=>{var Z,K;const{children:t,resource:n,source:r,label:o,disableActions:s=!1,disableAdd:l=!1,disableRemove:u=!1,className:A,empty:g,template:p={}}=e,[C,h]=w.useState(!1),{fields:m,remove:I,replace:B,append:v}=R.useArrayInput(e),{resetField:O}=ai.useFormContext(),j=Rt(),x=de.useTranslate(),S=de.useRecordContext(e),P=w.useRef(p||{}),L=de.useTranslateLabel(),k=w.useCallback(V=>{I(V)},[I]);if(m.length>0){const{...V}=m[0];P.current=V;for(const G in P.current)P.current[G]=null}const q=w.useCallback((V=void 0)=>{let G=V;V==null&&(G=P.current,w.Children.count(t)===1&&D.isValidElement(w.Children.only(t))&&!w.Children.only(t).props.source&&w.Children.map(t,$=>D.isValidElement($)&&$.type!==de.FormDataConsumer).some(Boolean)?G="":(G=G||{},w.Children.forEach(t,$=>{D.isValidElement($)&&$.type!==de.FormDataConsumer&&$.props.source&&(G[$.props.source]=$.props.defaultValue??null)})));const F={...G,...p};v(F),O(`${r}.${m.length}`,{defaultValue:G})},[v,t,O,r,m.length,p]),J=V=>G=>{q(),V&&V(G)},U=w.useCallback(()=>{B([]),h(!1)},[B]),_=HN(S,r),le=w.useMemo(()=>({total:m.length,remove:k,source:r}),[m.length,k,r]),ie=j.palette.mode==="dark"?j.palette.grey.A400:j.palette.grey.A800;return m?f.jsx($g.Provider,{value:le,children:f.jsxs("div",{className:A,children:[D.cloneElement(f.jsx(Gy,{}),{label:o,source:r,disableAdd:l,template:p,onClick:J((K=(Z=e==null?void 0:e.addButton)==null?void 0:Z.props)==null?void 0:K.onClick)}),f.jsx(b.TableContainer,{component:b.Paper,sx:{mt:2,border:`1px solid ${ie}`},children:f.jsxs(b.Table,{children:[f.jsx(b.TableHead,{sx:{borderTop:0,borderBottom:`1px solid ${ie}`},children:f.jsxs(b.TableRow,{children:[w.Children.map(t,(V,G)=>D.isValidElement(V)?f.jsx(b.TableCell,{children:f.jsx(b.Typography,{display:"flex",variant:"subtitle1",fontWeight:500,color:"text.primary",textTransform:"none",children:L({...V.props,resource:n})})},G):null),!s&&f.jsx(b.TableCell,{sx:{display:"flex",justifyContent:"center",alignItems:"center",verticalAlign:"top"},children:f.jsx(b.Typography,{display:"flex",variant:"subtitle1",fontWeight:500,color:"text.primary",textTransform:"none"})},"actions")]})}),f.jsxs(b.TableBody,{children:[m.length===0&&f.jsx(b.TableRow,{sx:{"&:last-child td, &:last-child th":{border:0}},children:f.jsx(b.TableCell,{colSpan:4+(s?0:1),align:"center",children:g||f.jsx(b.Typography,{variant:"body1",color:"text.secondary",children:"-"})})}),m.length>0&&m.map((V,G)=>f.jsx(b.TableRow,{sx:{borderBottom:`1px solid ${ie}}`},children:f.jsx(h6,{disableRemove:u,disableActions:s,index:G,member:`${r}.${G}`,onRemoveField:k,record:_&&_[G]||{},resource:n,source:r,children:t})},V.id))]})]})}),m.length>0&&f.jsx(R.Confirm,{isOpen:C,title:x("ra.action.clear_array_input"),content:x("ra.message.clear_array_input"),onConfirm:U,onClose:()=>h(!1)})]})}):null},Gy=e=>{const{label:t,disableAdd:n,onClick:r}=e,o=Rt(),s=o.palette.mode==="dark"?o.palette.grey.A400:o.palette.grey.A800,l=o.palette.mode==="light"?"#000000":"#FFFFFF";return f.jsxs(b.Stack,{justifyContent:"space-between",alignItems:"center",flexDirection:"row",children:[t!==!1&&f.jsx(b.Typography,{children:t}),!n&&(D.isValidElement(e==null?void 0:e.addButton)?D.cloneElement(e==null?void 0:e.addButton,{onClick:r}):f.jsx(b.IconButton,{size:"small",color:"secondary",sx:{border:`1px solid ${s}`},onClick:r,children:f.jsx(et.PlusCircleOutlined,{style:{color:l}})}))]})},WN=ue(Yy,{name:"RaApplicaTableFormIterator",slot:"Root"})(({theme:e})=>({"& > div.MuiPaper-root":{overflowX:"auto",[e.breakpoints.down("sm")]:{width:`calc(100vw - ${e.spacing(8)})`}}}));Gy.propTypes={label:c.oneOfType([c.string,c.bool]),source:c.string,defaultValue:c.any};Yy.propTypes={addButton:c.element,children:c.node,className:c.string,field:c.object,fields:c.array,fieldState:c.object,formState:c.object,record:c.object,source:c.string,label:c.oneOfType([c.string,c.bool]),resource:c.string,translate:c.func,disableAdd:c.bool,disableRemove:c.oneOfType([c.func,c.bool]),TransitionProps:c.shape({}),empty:c.oneOfType([c.node,c.string]),template:c.object};function zN(e,t){const n=Ae.clone(e),{type:r,payload:o}=t;switch(r){case"updateMedia":{const s=Ae.chain(n.media).clone().extend(o).value();return Ae.extend(n,{media:s})}case"updateDrawer":{const s=Ae.chain(n.drawer).clone().extend(o).value();return Ae.extend(n,{drawer:s})}case"updateLogo":{const s=Ae.chain(n.logo).clone().extend(o).value();return Ae.extend(n,{logo:s})}case"updateNotifications":{const s=Ae.chain(n.notifications).clone().extend(o).value();return Ae.extend(n,s)}case"updateTheme":{const s=Ae.chain(n.theme).clone().extend(o).value();return Ae.extend(n,{theme:s})}default:return n}}const UN={drawer:{open:!0,width:260,handleDrawerToggle:()=>{}},media:{downMd:!1,downLg:!1,downXl:!1,horizontal:!1},logo:{},notifications:{enable:!0,resource:"entities/notification"},theme:{iconColor:"grey.300",iconColorOpen:"grey.100"}},Ky=w.createContext(void 0);function qy(e){var J;const t=de.useAuthProvider(),n=de.useGetIdentity(),r=b.useTheme(),o=b.useMediaQuery(r.breakpoints.down("md")),s=b.useMediaQuery(r.breakpoints.down("lg")),l=b.useMediaQuery(r.breakpoints.down("xl")),{miniDrawer:u,isHorizontalLayout:A,menuOrientation:g,drawerWidth:p}=Ln(),C=A(g)&&!s,{drawerOpen:h,openDrawer:m}=Io(),I=w.useCallback(()=>{m(!h)},[h,m]),[B,v]=w.useState(!1),[O,j]=w.useReducer(zN,Ae.chain(UN).clone().merge({drawer:{open:!u||h}}).value()),x=w.useCallback(()=>v(!1),[]),S=w.useMemo(()=>({state:O,dispatch:j}),[O,j]),{logoIcon:P,logoMain:L,enableNotification:k,notification:q}=e;return w.useEffect(()=>{j({type:"updateMedia",payload:{downMd:o,downLg:s,downXl:l,horizontal:C}})},[g,o,s,l]),w.useEffect(()=>{j({type:"updateDrawer",payload:{open:h,width:p,handleDrawerToggle:I}})},[h,p,I]),w.useEffect(()=>{u||m(!l)},[l,u]),w.useEffect(()=>{j({type:"updateLogo",payload:{main:L,icon:P}})},[P,L]),w.useEffect(()=>{j({type:"updateNotifications",payload:{enable:k,resource:q??"entities/notification"}})},[k,q]),w.useEffect(()=>{j({type:"updateTheme",payload:{iconColorOpen:r.palette.mode==="dark"?"grey.200":"grey.300",iconColor:r.palette.mode==="dark"?"background.default":"grey.100"}})},[r.palette.mode]),w.useEffect(()=>{t.isImpersonating().then(U=>{var _;v(!U&&((_=n==null?void 0:n.data)==null?void 0:_.needToChangePassword)===!0)})},[(J=n==null?void 0:n.data)==null?void 0:J.needToChangePassword,t]),f.jsxs(Ky.Provider,{value:S,children:[f.jsx(b.Dialog,{open:B,maxWidth:"xs",fullWidth:!0,children:f.jsx(ap,{onSuccess:x,firstAccess:!0})}),e.children]})}function Jy(e){return w.forwardRef((t,n)=>{const{logoIcon:r,logoMain:o,enableNotification:s,notification:l}=t;return f.jsx(qy,{logoIcon:r,logoMain:o,enableNotification:s,notification:l,children:f.jsx(e,{ref:n,...t})})})}function hp(){const e=w.useContext(Ky);if(e===void 0)throw new Error("[Layout] useLayoutContext: context undefined. Please provide a valid LayoutContext using LayoutProvider");return e}function YN(){return hp().dispatch}function ms(){return hp().state}function nr(){return ms().media}function di(){return ms().drawer}function Xy(){return ms().logo}function Ru(){return ms().notifications}function GN(){return ms().theme}const KN={ml:{xs:0,lg:-2}};function Zy(){const{open:e,handleDrawerToggle:t}=di();return f.jsx(Ma,{value:"drawer","aria-label":"open drawer",sx:KN,onChange:t,selected:e,children:e?f.jsx(et.MenuFoldOutlined,{}):f.jsx(et.MenuUnfoldOutlined,{})})}function _y(e){const t=w.useRef(),n=b.useTheme(),{downLg:r,horizontal:o}=nr(),{open:s,width:l}=di(),u=r?b.AppBar:AB,A=Pr(e,{borderBottom:`1px solid ${n.palette.divider}`,zIndex:1200,width:o?"100%":s?`calc(100% - ${l}px)`:{xs:"100%",lg:"calc(100% - 60px)"}}),g={position:"fixed",color:"inherit",elevation:0,sx:A};return r||Ae.extend(g,{open:s}),f.jsx(u,{ref:t,...g,children:f.jsxs(b.Toolbar,{sx:{"& > *":{marginX:n.spacing(.325)}},children:[!o&&f.jsx(Zy,{}),e.children]})})}function qN(e){const t=b.useTheme(),{notification:n,onClick:r,selected:o,divider:s}=e,{resource:l}=Ru(),u=de.useNotify(),A=de.useRedirect(),[g]=de.useUpdate(l,{id:n==null?void 0:n.id,data:{...n,readed:qr().format("YYYY-MM-DD HH:mm:ss")}},{onSuccess:()=>{n!=null&&n.resource?n!=null&&n.resource.startsWith("/")?(A(n==null?void 0:n.resource),r()):(r(),document.location.href=n==null?void 0:n.resource):r()},onFailure:()=>{u("resources.notifications.messages.readed.error","warning")}}),p=w.useCallback(()=>g(),[g]),[C]=de.useLocaleState(),h=w.useMemo(()=>qr(n.created).locale(C).fromNow(),[n,C]);return f.jsx(b.ListItem,{disablePadding:!0,divider:s,children:f.jsxs(b.ListItemButton,{selected:o,onClick:p,children:[f.jsx(b.ListItemAvatar,{children:f.jsx(b.Avatar,{sx:{color:"primary.main",bgcolor:"primary.lighter"},children:f.jsx(et.MessageOutlined,{})})}),f.jsx(b.ListItemText,{primary:n.title,secondary:n.content}),f.jsx(b.Box,{flexGrow:1,flexShrink:1,minWidth:t.spacing(2)}),f.jsx(b.ListItemText,{primary:h,primaryTypographyProps:{variant:"caption"}})]})})}const JN={width:36,height:36,fontSize:"1rem"},XN={mt:"6px",ml:1,top:"auto",right:"auto",alignSelf:"flex-start",transform:"none"};function $y(){const{enable:e}=Ru();return e?f.jsx(ZN,{}):null}function ZN(){const e=de.useTranslate(),t=b.useTheme(),{downMd:n}=nr(),{resource:r}=Ru(),[o,s]=w.useState([]),{data:l,isLoading:u}=de.useGetList(r,{pagination:{page:1,perPage:25},sort:{field:"created",order:"DESC"},filter:{readed:!1}}),A=o.filter(m=>m.readed===null).length,{open:g,anchorEl:p,handleClose:C,handleToggle:h}=ou();return w.useEffect(()=>{!u&&l&&s(l??[])},[l,u]),f.jsxs(f.Fragment,{children:[f.jsx(Ma,{value:"notifications",selected:g,onChange:h,children:f.jsx(b.Badge,{badgeContent:A,color:"primary",children:f.jsx(et.BellOutlined,{})})}),f.jsx(b.Popper,{placement:n?"bottom":"bottom-end",open:g,anchorEl:p,role:void 0,transition:!0,disablePortal:!0,popperOptions:{modifiers:[{name:"offset",options:{offset:[n?-5:0,9]}}]},children:({TransitionProps:m})=>f.jsx(yo,{type:"grow",position:n?"top":"top-right",in:g,...m,children:f.jsx(b.Paper,{sx:{boxShadow:t.customShadows.z1,width:"100%",minWidth:285,maxWidth:420,[t.breakpoints.down("md")]:{maxWidth:285}},children:f.jsx(b.ClickAwayListener,{onClickAway:C,children:f.jsxs(Zn,{title:"Notification",elevation:0,border:!1,content:!1,secondary:f.jsx(f.Fragment,{children:A>0&&f.jsx(b.Tooltip,{title:"Mark as all read",children:f.jsx(gs,{color:"success",size:"small",children:f.jsx(et.CheckCircleOutlined,{style:{fontSize:"1.15rem"}})})})}),children:[f.jsx(b.List,{component:"nav",sx:{p:0,"& .MuiListItemButton-root":{py:.5,"&.Mui-selected":{bgcolor:"grey.50",color:"text.primary"},"& .MuiAvatar-root":JN,"& .MuiListItemSecondaryAction-root":{...XN,position:"relative"}},maxHeight:"calc(100vh - 240px)",overflow:"auto"},children:o.map((I,B)=>f.jsx(qN,{selected:A>0,notification:I,onClick:C,divider:B<o.length-1},I.id))}),f.jsx(b.ListItemButton,{sx:{textAlign:"center",py:"12px !important"},to:`/${r}`,LinkComponent:Bt.Link,onClick:C,children:f.jsx(b.ListItemText,{primary:f.jsx(b.Typography,{variant:"h6",color:"primary",children:e("ra.notification.view_all")})})}),f.jsx(b.Divider,{})]})})})})})]})}const _N=()=>{const[e,t]=w.useState(!1),n=w.useCallback(()=>t(!1),[t]),r=w.useCallback(()=>t(!0),[t]),o=de.useTranslate();return f.jsxs(w.Fragment,{children:[f.jsxs(b.ListItemButton,{onClick:r,children:[f.jsx(b.ListItemIcon,{children:f.jsx(Bn.Key,{})}),f.jsx(b.ListItemText,{primary:o("ra.auth.change_password")})]}),f.jsx(b.Dialog,{open:e,onClose:()=>t(!1),maxWidth:"xs",fullWidth:!0,children:f.jsx(ap,{onSuccess:n})})]})},$N=()=>{const e=de.useLogout(),t=de.useTranslate();return f.jsx(w.Fragment,{children:f.jsxs(b.ListItemButton,{onClick:e,children:[f.jsx(b.ListItemIcon,{children:f.jsx(Bn.LogoutOutlined,{})}),f.jsx(b.ListItemText,{primary:t("ra.auth.logout")})]})})},e7=()=>{const e=de.useTranslate(),t=de.useAuthProvider(),n=w.useCallback(()=>t.stopImpersonate().then(()=>document.location.href="/"),[t==null?void 0:t.stopImpersonating]),[r,o]=w.useState(!1);return w.useEffect(()=>{t.isImpersonating&&t.isImpersonating().then(s=>o(s))},[t,o]),r?f.jsx(w.Fragment,{children:f.jsxs(b.ListItemButton,{onClick:n,children:[f.jsx(b.ListItemIcon,{children:f.jsx(Bn.LogoutOutlined,{})}),f.jsx(b.ListItemText,{primary:e("ra.auth.stop_impersonate")})]})}):null};function eb(){var m;const e=b.useTheme(),t=de.useDataProvider(),n=de.useAuthProvider(),{identity:r}=de.useGetIdentity(),o=r!==void 0&&r.image&&r.image!==null&&r.image!=="",[s,l]=w.useState(null),{open:u,anchorEl:A,handleToggle:g,handleClose:p}=ou(),C=de.useLogout(),h=w.useCallback(()=>{C()},[n,C]);return w.useEffect(()=>{o&&t.getFile("/profile/me/image").then(I=>l(I))},[t,o]),f.jsxs(f.Fragment,{children:[f.jsx(Ma,{sx:{p:.25,width:"auto"},onClick:g,value:"profile",selected:u,children:f.jsxs(b.Stack,{direction:"row",spacing:2,alignItems:"center",sx:{p:.5},children:[f.jsx(Ca,{alt:(m=r==null?void 0:r.name)==null?void 0:m.toUpperCase(),src:s,size:"xs"}),f.jsx(b.Typography,{variant:"subtitle1",children:r==null?void 0:r.name})]})}),f.jsx(dr.Popper,{placement:"bottom-end",open:u,anchorEl:A,role:void 0,transition:!0,disablePortal:!0,popperOptions:{modifiers:[{name:"offset",options:{offset:[0,9]}}]},children:({TransitionProps:I})=>{var B;return f.jsx(yo,{type:"grow",position:"top-right",in:u,...I,children:f.jsx(b.Paper,{sx:{boxShadow:e.customShadows.z1,width:290,minWidth:240,maxWidth:290,[e.breakpoints.down("md")]:{maxWidth:250}},children:f.jsx(b.ClickAwayListener,{onClickAway:p,children:f.jsxs(Zn,{elevation:0,border:!1,content:!1,children:[f.jsx(b.CardContent,{sx:{px:2.5,pt:3},children:f.jsxs(b.Grid,{container:!0,justifyContent:"space-between",alignItems:"center",children:[f.jsx(b.Grid,{item:!0,children:f.jsxs(b.Stack,{direction:"row",spacing:1.25,alignItems:"center",children:[f.jsx(Ca,{alt:"profile user",src:s,sx:{width:32,height:32}}),f.jsxs(b.Stack,{children:[f.jsx(b.Typography,{variant:"h6",children:r==null?void 0:r.name}),f.jsx(b.Typography,{variant:"body2",color:"textSecondary",children:(B=r==null?void 0:r.roles)==null?void 0:B.map(v=>v.name.replace("ROLE_","")).join(",")})]})]})}),f.jsx(b.Grid,{item:!0,children:f.jsx(b.Tooltip,{title:"Logout",children:f.jsx(gs,{size:"large",sx:{color:"text.primary"},onClick:h,children:f.jsx(et.LogoutOutlined,{})})})})]})}),f.jsx(b.Grid,{container:!0,children:f.jsx(b.Grid,{item:!0,xs:12,children:f.jsxs(b.List,{component:"nav",sx:{p:0,"& .MuiListItemIcon-root":{minWidth:32}},children:[f.jsx(_N,{}),f.jsx($N,{}),f.jsx(e7,{})]})})})]})})})})}})]})}const tb=e=>{const t=Rt(),{downMd:n}=nr(),{open:r,anchorEl:o,handleToggle:s,handleClose:l}=ou();return n?f.jsxs(f.Fragment,{children:[f.jsx(Ma,{"aria-label":"open more menu","aria-controls":r?"menu-list-grow":void 0,"aria-haspopup":"true",onClick:s,selected:r,children:f.jsx(et.MoreOutlined,{})}),f.jsx(b.Popper,{placement:"bottom-end",open:r,anchorEl:o,role:void 0,transition:!0,disablePortal:!0,style:{width:"100%"},popperOptions:{modifiers:[{name:"offset",options:{offset:[0,9]}}]},children:({TransitionProps:u})=>f.jsx(yo,{type:"fade",in:r,...u,children:f.jsx(b.Paper,{sx:{boxShadow:t.customShadows.z1},children:f.jsx(b.ClickAwayListener,{onClickAway:l,children:f.jsx(b.AppBar,{color:"inherit",children:f.jsx(b.Toolbar,{children:e.children})})})})})})]}):f.jsx(f.Fragment,{children:e.children})};function nb(e){return f.jsx(b.Box,{...e,flex:1})}function Fa(e){const{name:t,version:n}=e;return f.jsx(b.Stack,{direction:"row",justifyContent:"space-between",alignItems:"center",sx:{p:"24px 16px 0px",mt:"auto"},children:f.jsxs(b.Typography,{variant:"caption",children:[f.jsx("span",{dangerouslySetInnerHTML:{__html:(e==null?void 0:e.copy)||""}})," ",t," - ",n]})})}Fa.propTypes={name:c.string.isRequired,version:c.string.isRequired,copy:c.string};Fa.defaultProps={copy:"&copy; Applica Software Guru for"};var rb={exports:{}};(function(e){function t(n){return n&&n.__esModule?n:{default:n}}e.exports=t,e.exports.__esModule=!0,e.exports.default=e.exports})(rb);var Ou=rb.exports,Rd={};const t7=XR(NF);var SI;function ju(){return SI||(SI=1,function(e){"use client";Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"default",{enumerable:!0,get:function(){return t.createSvgIcon}});var t=t7}(Rd)),Rd}function ob(e){var t,n,r="";if(typeof e=="string"||typeof e=="number")r+=e;else if(typeof e=="object")if(Array.isArray(e))for(t=0;t<e.length;t++)e[t]&&(n=ob(e[t]))&&(r&&(r+=" "),r+=n);else for(t in e)e[t]&&(r&&(r+=" "),r+=t);return r}function ib(){for(var e,t,n=0,r="";n<arguments.length;)(e=arguments[n++])&&(t=ob(e))&&(r&&(r+=" "),r+=t);return r}var n7="__lodash_hash_undefined__";function r7(e){return this.__data__.set(e,n7),this}var o7=r7;function i7(e){return this.__data__.has(e)}var s7=i7,a7=Hy,l7=o7,c7=s7;function jc(e){var t=-1,n=e==null?0:e.length;for(this.__data__=new a7;++t<n;)this.add(e[t])}jc.prototype.add=jc.prototype.push=l7;jc.prototype.has=c7;var sb=jc;function u7(e,t){return e.has(t)}var ab=u7;function A7(e){var t=-1,n=Array(e.size);return e.forEach(function(r){n[++t]=r}),n}var lb=A7;function d7(e,t){for(var n=-1,r=t.length,o=e.length;++n<r;)e[o+n]=t[n];return e}var g7=d7,f7=gp,p7=xu,h7="[object Arguments]";function C7(e){return p7(e)&&f7(e)==h7}var m7=C7,RI=m7,E7=xu,cb=Object.prototype,I7=cb.hasOwnProperty,B7=cb.propertyIsEnumerable,v7=RI(function(){return arguments}())?RI:function(e){return E7(e)&&I7.call(e,"callee")&&!B7.call(e,"callee")},y7=v7,b7=9007199254740991;function Q7(e){return typeof e=="number"&&e>-1&&e%1==0&&e<=b7}var x7=Q7;function w7(e){return function(t){return e(t)}}var T7=w7,P7=Vy,S7=x7;function R7(e){return e!=null&&S7(e.length)&&!P7(e)}var O7=R7,j7=wu,M7=bu,D7=j7(M7,"Set"),k7=D7,mg=globalThis&&globalThis.__assign||function(){return mg=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++){t=arguments[n];for(var o in t)Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o])}return e},mg.apply(this,arguments)},F7=globalThis&&globalThis.__rest||function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var o=0,r=Object.getOwnPropertySymbols(e);o<r.length;o++)t.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]]);return n},ub=function(e){var t=e.className,n=e.sx,r=F7(e,["className","sx"]),o=de.useLoading(),s=Rt();return D.createElement(L7,{className:t,sx:n},o?D.createElement(Df,mg({className:ib("app-loader",Mc.loader),color:"inherit",size:s.spacing(2),thickness:6},r)):D.createElement(Fb,{className:Mc.loadedIcon}))};ub.propTypes={classes:c.object,className:c.string,width:c.string};var Eg="RaLoadingIndicator",Mc={loader:"".concat(Eg,"-loader"),loadedIcon:"".concat(Eg,"-loadedIcon")},L7=ue("div",{name:Eg,overridesResolver:function(e,t){return t.root}})(function(e){var t,n=e.theme;return t={},t["& .".concat(Mc.loader)]={marginLeft:n.spacing(1.5),marginRight:n.spacing(1.5)},t["& .".concat(Mc.loadedIcon)]={},t});const Cp=e=>e.scrollTop;function is(e,t){var n,r;const{timeout:o,easing:s,style:l={}}=e;return{duration:(n=l.transitionDuration)!=null?n:typeof o=="number"?o:o[t.mode]||0,easing:(r=l.transitionTimingFunction)!=null?r:typeof s=="object"?s[t.mode]:s,delay:l.transitionDelay}}const N7=["addEndListener","appear","children","container","direction","easing","in","onEnter","onEntered","onEntering","onExit","onExited","onExiting","style","timeout","TransitionComponent"];function V7(e,t,n){const r=t.getBoundingClientRect(),o=n&&n.getBoundingClientRect(),s=As(t);let l;if(t.fakeTransform)l=t.fakeTransform;else{const g=s.getComputedStyle(t);l=g.getPropertyValue("-webkit-transform")||g.getPropertyValue("transform")}let u=0,A=0;if(l&&l!=="none"&&typeof l=="string"){const g=l.split("(")[1].split(")")[0].split(",");u=parseInt(g[4],10),A=parseInt(g[5],10)}return e==="left"?o?`translateX(${o.right+u-r.left}px)`:`translateX(${s.innerWidth+u-r.left}px)`:e==="right"?o?`translateX(-${r.right-o.left-u}px)`:`translateX(-${r.left+r.width-u}px)`:e==="up"?o?`translateY(${o.bottom+A-r.top}px)`:`translateY(${s.innerHeight+A-r.top}px)`:o?`translateY(-${r.top-o.top+r.height-A}px)`:`translateY(-${r.top+r.height-A}px)`}function Ab(e){return typeof e=="function"?e():e}function ql(e,t,n){const r=Ab(n),o=V7(e,t,r);o&&(t.style.webkitTransform=o,t.style.transform=o)}const db=D.forwardRef(function(t,n){const r=Rt(),o={enter:r.transitions.easing.easeOut,exit:r.transitions.easing.sharp},s={enter:r.transitions.duration.enteringScreen,exit:r.transitions.duration.leavingScreen},{addEndListener:l,appear:u=!0,children:A,container:g,direction:p="down",easing:C=o,in:h,onEnter:m,onEntered:I,onEntering:B,onExit:v,onExited:O,onExiting:j,style:x,timeout:S=s,TransitionComponent:P=Sf}=t,L=Ke(t,N7),k=D.useRef(null),q=Dn(A.ref,k,n),J=F=>$=>{F&&($===void 0?F(k.current):F(k.current,$))},U=J((F,$)=>{ql(p,F,g),Cp(F),m&&m(F,$)}),_=J((F,$)=>{const H=is({timeout:S,style:x,easing:C},{mode:"enter"});F.style.webkitTransition=r.transitions.create("-webkit-transform",W({},H)),F.style.transition=r.transitions.create("transform",W({},H)),F.style.webkitTransform="none",F.style.transform="none",B&&B(F,$)}),le=J(I),ie=J(j),Z=J(F=>{const $=is({timeout:S,style:x,easing:C},{mode:"exit"});F.style.webkitTransition=r.transitions.create("-webkit-transform",$),F.style.transition=r.transitions.create("transform",$),ql(p,F,g),v&&v(F)}),K=J(F=>{F.style.webkitTransition="",F.style.transition="",O&&O(F)}),V=F=>{l&&l(k.current,F)},G=D.useCallback(()=>{k.current&&ql(p,k.current,g)},[p,g]);return D.useEffect(()=>{if(h||p==="down"||p==="right")return;const F=M0(()=>{k.current&&ql(p,k.current,g)}),$=As(k.current);return $.addEventListener("resize",F),()=>{F.clear(),$.removeEventListener("resize",F)}},[p,h,g]),D.useEffect(()=>{h||G()},[h,G]),f.jsx(P,W({nodeRef:k,onEnter:U,onEntered:le,onEntering:_,onExit:Z,onExited:K,onExiting:ie,addEndListener:V,appear:u,in:h,timeout:S},L,{children:(F,$)=>D.cloneElement(A,W({ref:q,style:W({visibility:F==="exited"&&!h?"hidden":void 0},x,A.props.style)},$))}))});process.env.NODE_ENV!=="production"&&(db.propTypes={addEndListener:c.func,appear:c.bool,children:us.isRequired,container:Tr(c.oneOfType([oi,c.func]),e=>{if(e.open){const t=Ab(e.container);if(t&&t.nodeType===1){const n=t.getBoundingClientRect();if(process.env.NODE_ENV!=="test"&&n.top===0&&n.left===0&&n.right===0&&n.bottom===0)return new Error(["MUI: The `container` prop provided to the component is invalid.","The anchor element should be part of the document layout.","Make sure the element is present in the document or that it's not display none."].join(`
219
219
  `))}else if(!t||typeof t.getBoundingClientRect!="function"||t.contextElement!=null&&t.contextElement.nodeType!==1)return new Error(["MUI: The `container` prop provided to the component is invalid.","It should be an HTML element instance."].join(`
220
220
  `))}return null}),direction:c.oneOf(["down","left","right","up"]),easing:c.oneOfType([c.shape({enter:c.string,exit:c.string}),c.string]),in:c.bool,onEnter:c.func,onEntered:c.func,onEntering:c.func,onExit:c.func,onExited:c.func,onExiting:c.func,style:c.object,timeout:c.oneOfType([c.number,c.shape({appear:c.number,enter:c.number,exit:c.number})])});const H7=db;function W7(e){return typeof e=="string"}function z7(e,t,n){return e===void 0||W7(e)?t:W({},t,{ownerState:W({},t.ownerState,n)})}const U7={disableDefaultClasses:!1},Y7=D.createContext(U7);function G7(e){const{disableDefaultClasses:t}=D.useContext(Y7);return n=>t?"":e(n)}function gb(e,t=[]){if(e===void 0)return{};const n={};return Object.keys(e).filter(r=>r.match(/^on[A-Z]/)&&typeof e[r]=="function"&&!t.includes(r)).forEach(r=>{n[r]=e[r]}),n}function K7(e,t,n){return typeof e=="function"?e(t,n):e}function OI(e){if(e===void 0)return{};const t={};return Object.keys(e).filter(n=>!(n.match(/^on[A-Z]/)&&typeof e[n]=="function")).forEach(n=>{t[n]=e[n]}),t}function q7(e){const{getSlotProps:t,additionalProps:n,externalSlotProps:r,externalForwardedProps:o,className:s}=e;if(!t){const m=Ge(o==null?void 0:o.className,r==null?void 0:r.className,s,n==null?void 0:n.className),I=W({},n==null?void 0:n.style,o==null?void 0:o.style,r==null?void 0:r.style),B=W({},n,o,r);return m.length>0&&(B.className=m),Object.keys(I).length>0&&(B.style=I),{props:B,internalRef:void 0}}const l=gb(W({},o,r)),u=OI(r),A=OI(o),g=t(l),p=Ge(g==null?void 0:g.className,n==null?void 0:n.className,s,o==null?void 0:o.className,r==null?void 0:r.className),C=W({},g==null?void 0:g.style,n==null?void 0:n.style,o==null?void 0:o.style,r==null?void 0:r.style),h=W({},g,n,A,u);return p.length>0&&(h.className=p),Object.keys(C).length>0&&(h.style=C),{props:h,internalRef:g.ref}}const J7=["elementType","externalSlotProps","ownerState","skipResolvingSlotProps"];function X7(e){var t;const{elementType:n,externalSlotProps:r,ownerState:o,skipResolvingSlotProps:s=!1}=e,l=Ke(e,J7),u=s?{}:K7(r,o),{props:A,internalRef:g}=q7(W({},l,{externalSlotProps:u})),p=Dn(g,u==null?void 0:u.ref,(t=e.additionalProps)==null?void 0:t.ref);return z7(n,W({},A,{ref:p}),o)}function Z7(e){const t=fr(e);return t.body===e?As(e).innerWidth>t.documentElement.clientWidth:e.scrollHeight>e.clientHeight}function sa(e,t){t?e.setAttribute("aria-hidden","true"):e.removeAttribute("aria-hidden")}function jI(e){return parseInt(As(e).getComputedStyle(e).paddingRight,10)||0}function _7(e){const n=["TEMPLATE","SCRIPT","STYLE","LINK","MAP","META","NOSCRIPT","PICTURE","COL","COLGROUP","PARAM","SLOT","SOURCE","TRACK"].indexOf(e.tagName)!==-1,r=e.tagName==="INPUT"&&e.getAttribute("type")==="hidden";return n||r}function MI(e,t,n,r,o){const s=[t,n,...r];[].forEach.call(e.children,l=>{const u=s.indexOf(l)===-1,A=!_7(l);u&&A&&sa(l,o)})}function Od(e,t){let n=-1;return e.some((r,o)=>t(r)?(n=o,!0):!1),n}function $7(e,t){const n=[],r=e.container;if(!t.disableScrollLock){if(Z7(r)){const l=P4(fr(r));n.push({value:r.style.paddingRight,property:"padding-right",el:r}),r.style.paddingRight=`${jI(r)+l}px`;const u=fr(r).querySelectorAll(".mui-fixed");[].forEach.call(u,A=>{n.push({value:A.style.paddingRight,property:"padding-right",el:A}),A.style.paddingRight=`${jI(A)+l}px`})}let s;if(r.parentNode instanceof DocumentFragment)s=fr(r).body;else{const l=r.parentElement,u=As(r);s=(l==null?void 0:l.nodeName)==="HTML"&&u.getComputedStyle(l).overflowY==="scroll"?l:r}n.push({value:s.style.overflow,property:"overflow",el:s},{value:s.style.overflowX,property:"overflow-x",el:s},{value:s.style.overflowY,property:"overflow-y",el:s}),s.style.overflow="hidden"}return()=>{n.forEach(({value:s,el:l,property:u})=>{s?l.style.setProperty(u,s):l.style.removeProperty(u)})}}function eV(e){const t=[];return[].forEach.call(e.children,n=>{n.getAttribute("aria-hidden")==="true"&&t.push(n)}),t}class tV{constructor(){this.containers=void 0,this.modals=void 0,this.modals=[],this.containers=[]}add(t,n){let r=this.modals.indexOf(t);if(r!==-1)return r;r=this.modals.length,this.modals.push(t),t.modalRef&&sa(t.modalRef,!1);const o=eV(n);MI(n,t.mount,t.modalRef,o,!0);const s=Od(this.containers,l=>l.container===n);return s!==-1?(this.containers[s].modals.push(t),r):(this.containers.push({modals:[t],container:n,restore:null,hiddenSiblings:o}),r)}mount(t,n){const r=Od(this.containers,s=>s.modals.indexOf(t)!==-1),o=this.containers[r];o.restore||(o.restore=$7(o,n))}remove(t,n=!0){const r=this.modals.indexOf(t);if(r===-1)return r;const o=Od(this.containers,l=>l.modals.indexOf(t)!==-1),s=this.containers[o];if(s.modals.splice(s.modals.indexOf(t),1),this.modals.splice(r,1),s.modals.length===0)s.restore&&s.restore(),t.modalRef&&sa(t.modalRef,n),MI(s.container,t.mount,t.modalRef,s.hiddenSiblings,!1),this.containers.splice(o,1);else{const l=s.modals[s.modals.length-1];l.modalRef&&sa(l.modalRef,!1)}return r}isTopModal(t){return this.modals.length>0&&this.modals[this.modals.length-1]===t}}function nV(e){return typeof e=="function"?e():e}function rV(e){return e?e.props.hasOwnProperty("in"):!1}const oV=new tV;function iV(e){const{container:t,disableEscapeKeyDown:n=!1,disableScrollLock:r=!1,manager:o=oV,closeAfterTransition:s=!1,onTransitionEnter:l,onTransitionExited:u,children:A,onClose:g,open:p,rootRef:C}=e,h=D.useRef({}),m=D.useRef(null),I=D.useRef(null),B=Dn(I,C),[v,O]=D.useState(!p),j=rV(A);let x=!0;(e["aria-hidden"]==="false"||e["aria-hidden"]===!1)&&(x=!1);const S=()=>fr(m.current),P=()=>(h.current.modalRef=I.current,h.current.mount=m.current,h.current),L=()=>{o.mount(P(),{disableScrollLock:r}),I.current&&(I.current.scrollTop=0)},k=fo(()=>{const V=nV(t)||S().body;o.add(P(),V),I.current&&L()}),q=D.useCallback(()=>o.isTopModal(P()),[o]),J=fo(V=>{m.current=V,V&&(p&&q()?L():I.current&&sa(I.current,x))}),U=D.useCallback(()=>{o.remove(P(),x)},[x,o]);D.useEffect(()=>()=>{U()},[U]),D.useEffect(()=>{p?k():(!j||!s)&&U()},[p,U,j,s,k]);const _=V=>G=>{var F;(F=V.onKeyDown)==null||F.call(V,G),!(G.key!=="Escape"||!q())&&(n||(G.stopPropagation(),g&&g(G,"escapeKeyDown")))},le=V=>G=>{var F;(F=V.onClick)==null||F.call(V,G),G.target===G.currentTarget&&g&&g(G,"backdropClick")};return{getRootProps:(V={})=>{const G=gb(e);delete G.onTransitionEnter,delete G.onTransitionExited;const F=W({},G,V);return W({role:"presentation"},F,{onKeyDown:_(F),ref:B})},getBackdropProps:(V={})=>{const G=V;return W({"aria-hidden":!0},G,{onClick:le(G),open:p})},getTransitionProps:()=>{const V=()=>{O(!1),l&&l()},G=()=>{O(!0),u&&u(),s&&U()};return{onEnter:Jd(V,A==null?void 0:A.props.onEnter),onExited:Jd(G,A==null?void 0:A.props.onExited)}},rootRef:B,portalRef:J,isTopModal:q,exited:v,hasTransition:j}}const sV=["input","select","textarea","a[href]","button","[tabindex]","audio[controls]","video[controls]",'[contenteditable]:not([contenteditable="false"])'].join(",");function aV(e){const t=parseInt(e.getAttribute("tabindex")||"",10);return Number.isNaN(t)?e.contentEditable==="true"||(e.nodeName==="AUDIO"||e.nodeName==="VIDEO"||e.nodeName==="DETAILS")&&e.getAttribute("tabindex")===null?0:e.tabIndex:t}function lV(e){if(e.tagName!=="INPUT"||e.type!=="radio"||!e.name)return!1;const t=r=>e.ownerDocument.querySelector(`input[type="radio"]${r}`);let n=t(`[name="${e.name}"]:checked`);return n||(n=t(`[name="${e.name}"]`)),n!==e}function cV(e){return!(e.disabled||e.tagName==="INPUT"&&e.type==="hidden"||lV(e))}function uV(e){const t=[],n=[];return Array.from(e.querySelectorAll(sV)).forEach((r,o)=>{const s=aV(r);s===-1||!cV(r)||(s===0?t.push(r):n.push({documentOrder:o,tabIndex:s,node:r}))}),n.sort((r,o)=>r.tabIndex===o.tabIndex?r.documentOrder-o.documentOrder:r.tabIndex-o.tabIndex).map(r=>r.node).concat(t)}function AV(){return!0}function Dc(e){const{children:t,disableAutoFocus:n=!1,disableEnforceFocus:r=!1,disableRestoreFocus:o=!1,getTabbable:s=uV,isEnabled:l=AV,open:u}=e,A=D.useRef(!1),g=D.useRef(null),p=D.useRef(null),C=D.useRef(null),h=D.useRef(null),m=D.useRef(!1),I=D.useRef(null),B=Dn(t.ref,I),v=D.useRef(null);D.useEffect(()=>{!u||!I.current||(m.current=!n)},[n,u]),D.useEffect(()=>{if(!u||!I.current)return;const x=fr(I.current);return I.current.contains(x.activeElement)||(I.current.hasAttribute("tabIndex")||(process.env.NODE_ENV!=="production"&&console.error(["MUI: The modal content node does not accept focus.",'For the benefit of assistive technologies, the tabIndex of the node is being set to "-1".'].join(`
221
221
  `)),I.current.setAttribute("tabIndex","-1")),m.current&&I.current.focus()),()=>{o||(C.current&&C.current.focus&&(A.current=!0,C.current.focus()),C.current=null)}},[u]),D.useEffect(()=>{if(!u||!I.current)return;const x=fr(I.current),S=k=>{v.current=k,!(r||!l()||k.key!=="Tab")&&x.activeElement===I.current&&k.shiftKey&&(A.current=!0,p.current&&p.current.focus())},P=()=>{const k=I.current;if(k===null)return;if(!x.hasFocus()||!l()||A.current){A.current=!1;return}if(k.contains(x.activeElement)||r&&x.activeElement!==g.current&&x.activeElement!==p.current)return;if(x.activeElement!==h.current)h.current=null;else if(h.current!==null)return;if(!m.current)return;let q=[];if((x.activeElement===g.current||x.activeElement===p.current)&&(q=s(I.current)),q.length>0){var J,U;const _=!!((J=v.current)!=null&&J.shiftKey&&((U=v.current)==null?void 0:U.key)==="Tab"),le=q[0],ie=q[q.length-1];typeof le!="string"&&typeof ie!="string"&&(_?ie.focus():le.focus())}else k.focus()};x.addEventListener("focusin",P),x.addEventListener("keydown",S,!0);const L=setInterval(()=>{x.activeElement&&x.activeElement.tagName==="BODY"&&P()},50);return()=>{clearInterval(L),x.removeEventListener("focusin",P),x.removeEventListener("keydown",S,!0)}},[n,r,o,l,u,s]);const O=x=>{C.current===null&&(C.current=x.relatedTarget),m.current=!0,h.current=x.target;const S=t.props.onFocus;S&&S(x)},j=x=>{C.current===null&&(C.current=x.relatedTarget),m.current=!0};return f.jsxs(D.Fragment,{children:[f.jsx("div",{tabIndex:u?0:-1,onFocus:j,ref:g,"data-testid":"sentinelStart"}),D.cloneElement(t,{ref:B,onFocus:O}),f.jsx("div",{tabIndex:u?0:-1,onFocus:j,ref:p,"data-testid":"sentinelEnd"})]})}process.env.NODE_ENV!=="production"&&(Dc.propTypes={children:us,disableAutoFocus:c.bool,disableEnforceFocus:c.bool,disableRestoreFocus:c.bool,getTabbable:c.func,isEnabled:c.func,open:c.bool.isRequired});process.env.NODE_ENV!=="production"&&(Dc["propTypes"]=Yc(Dc.propTypes));function dV(e){return typeof e=="function"?e():e}const Ea=D.forwardRef(function(t,n){const{children:r,container:o,disablePortal:s=!1}=t,[l,u]=D.useState(null),A=Dn(D.isValidElement(r)?r.ref:null,n);if(es(()=>{s||u(dV(o)||document.body)},[o,s]),es(()=>{if(l&&!s)return fc(n,l),()=>{fc(n,null)}},[n,l,s]),s){if(D.isValidElement(r)){const g={ref:A};return D.cloneElement(r,g)}return f.jsx(D.Fragment,{children:r})}return f.jsx(D.Fragment,{children:l&&JR.createPortal(r,l)})});process.env.NODE_ENV!=="production"&&(Ea.propTypes={children:c.node,container:c.oneOfType([oi,c.func]),disablePortal:c.bool});process.env.NODE_ENV!=="production"&&(Ea["propTypes"]=Yc(Ea.propTypes));const gV=["addEndListener","appear","children","easing","in","onEnter","onEntered","onEntering","onExit","onExited","onExiting","style","timeout","TransitionComponent"],fV={entering:{opacity:1},entered:{opacity:1}},fb=D.forwardRef(function(t,n){const r=Rt(),o={enter:r.transitions.duration.enteringScreen,exit:r.transitions.duration.leavingScreen},{addEndListener:s,appear:l=!0,children:u,easing:A,in:g,onEnter:p,onEntered:C,onEntering:h,onExit:m,onExited:I,onExiting:B,style:v,timeout:O=o,TransitionComponent:j=Sf}=t,x=Ke(t,gV),S=D.useRef(null),P=Dn(S,u.ref,n),L=Z=>K=>{if(Z){const V=S.current;K===void 0?Z(V):Z(V,K)}},k=L(h),q=L((Z,K)=>{Cp(Z);const V=is({style:v,timeout:O,easing:A},{mode:"enter"});Z.style.webkitTransition=r.transitions.create("opacity",V),Z.style.transition=r.transitions.create("opacity",V),p&&p(Z,K)}),J=L(C),U=L(B),_=L(Z=>{const K=is({style:v,timeout:O,easing:A},{mode:"exit"});Z.style.webkitTransition=r.transitions.create("opacity",K),Z.style.transition=r.transitions.create("opacity",K),m&&m(Z)}),le=L(I),ie=Z=>{s&&s(S.current,Z)};return f.jsx(j,W({appear:l,in:g,nodeRef:S,onEnter:q,onEntered:J,onEntering:k,onExit:_,onExited:le,onExiting:U,addEndListener:ie,timeout:O},x,{children:(Z,K)=>D.cloneElement(u,W({style:W({opacity:0,visibility:Z==="exited"&&!g?"hidden":void 0},fV[Z],v,u.props.style),ref:P},K))}))});process.env.NODE_ENV!=="production"&&(fb.propTypes={addEndListener:c.func,appear:c.bool,children:us.isRequired,easing:c.oneOfType([c.shape({enter:c.string,exit:c.string}),c.string]),in:c.bool,onEnter:c.func,onEntered:c.func,onEntering:c.func,onExit:c.func,onExited:c.func,onExiting:c.func,style:c.object,timeout:c.oneOfType([c.number,c.shape({appear:c.number,enter:c.number,exit:c.number})])});const pV=fb;function hV(e){return Nt("MuiBackdrop",e)}Ut("MuiBackdrop",["root","invisible"]);const CV=["children","className","component","components","componentsProps","invisible","open","slotProps","slots","TransitionComponent","transitionDuration"],mV=e=>{const{classes:t,invisible:n}=e;return sn({root:["root",n&&"invisible"]},hV,t)},EV=ue("div",{name:"MuiBackdrop",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.root,n.invisible&&t.invisible]}})(({ownerState:e})=>W({position:"fixed",display:"flex",alignItems:"center",justifyContent:"center",right:0,bottom:0,top:0,left:0,backgroundColor:"rgba(0, 0, 0, 0.5)",WebkitTapHighlightColor:"transparent"},e.invisible&&{backgroundColor:"transparent"})),pb=D.forwardRef(function(t,n){var r,o,s;const l=Yt({props:t,name:"MuiBackdrop"}),{children:u,className:A,component:g="div",components:p={},componentsProps:C={},invisible:h=!1,open:m,slotProps:I={},slots:B={},TransitionComponent:v=pV,transitionDuration:O}=l,j=Ke(l,CV),x=W({},l,{component:g,invisible:h}),S=mV(x),P=(r=I.root)!=null?r:C.root;return f.jsx(v,W({in:m,timeout:O},j,{children:f.jsx(EV,W({"aria-hidden":!0},P,{as:(o=(s=B.root)!=null?s:p.Root)!=null?o:g,className:Ge(S.root,A,P==null?void 0:P.className),ownerState:W({},x,P==null?void 0:P.ownerState),classes:S,ref:n,children:u}))}))});process.env.NODE_ENV!=="production"&&(pb.propTypes={children:c.node,classes:c.object,className:c.string,component:c.elementType,components:c.shape({Root:c.elementType}),componentsProps:c.shape({root:c.object}),invisible:c.bool,open:c.bool.isRequired,slotProps:c.shape({root:c.object}),slots:c.shape({root:c.elementType}),sx:c.oneOfType([c.arrayOf(c.oneOfType([c.func,c.object,c.bool])),c.func,c.object]),TransitionComponent:c.elementType,transitionDuration:c.oneOfType([c.number,c.shape({appear:c.number,enter:c.number,exit:c.number})])});const IV=pb;function BV(e){return Nt("MuiModal",e)}Ut("MuiModal",["root","hidden","backdrop"]);const vV=["BackdropComponent","BackdropProps","classes","className","closeAfterTransition","children","container","component","components","componentsProps","disableAutoFocus","disableEnforceFocus","disableEscapeKeyDown","disablePortal","disableRestoreFocus","disableScrollLock","hideBackdrop","keepMounted","onBackdropClick","onClose","onTransitionEnter","onTransitionExited","open","slotProps","slots","theme"],yV=e=>{const{open:t,exited:n,classes:r}=e;return sn({root:["root",!t&&n&&"hidden"],backdrop:["backdrop"]},BV,r)},bV=ue("div",{name:"MuiModal",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.root,!n.open&&n.exited&&t.hidden]}})(({theme:e,ownerState:t})=>W({position:"fixed",zIndex:(e.vars||e).zIndex.modal,right:0,bottom:0,top:0,left:0},!t.open&&t.exited&&{visibility:"hidden"})),QV=ue(IV,{name:"MuiModal",slot:"Backdrop",overridesResolver:(e,t)=>t.backdrop})({zIndex:-1}),hb=D.forwardRef(function(t,n){var r,o,s,l,u,A;const g=Yt({name:"MuiModal",props:t}),{BackdropComponent:p=QV,BackdropProps:C,className:h,closeAfterTransition:m=!1,children:I,container:B,component:v,components:O={},componentsProps:j={},disableAutoFocus:x=!1,disableEnforceFocus:S=!1,disableEscapeKeyDown:P=!1,disablePortal:L=!1,disableRestoreFocus:k=!1,disableScrollLock:q=!1,hideBackdrop:J=!1,keepMounted:U=!1,onBackdropClick:_,open:le,slotProps:ie,slots:Z}=g,K=Ke(g,vV),V=W({},g,{closeAfterTransition:m,disableAutoFocus:x,disableEnforceFocus:S,disableEscapeKeyDown:P,disablePortal:L,disableRestoreFocus:k,disableScrollLock:q,hideBackdrop:J,keepMounted:U}),{getRootProps:G,getBackdropProps:F,getTransitionProps:$,portalRef:H,isTopModal:X,exited:ge,hasTransition:pe}=iV(W({},V,{rootRef:n})),ce=W({},V,{exited:ge}),fe=yV(ce),he={};if(I.props.tabIndex===void 0&&(he.tabIndex="-1"),pe){const{onEnter:Ne,onExited:te}=$();he.onEnter=Ne,he.onExited=te}const Be=(r=(o=Z==null?void 0:Z.root)!=null?o:O.Root)!=null?r:bV,me=(s=(l=Z==null?void 0:Z.backdrop)!=null?l:O.Backdrop)!=null?s:p,Ce=(u=ie==null?void 0:ie.root)!=null?u:j.root,Ie=(A=ie==null?void 0:ie.backdrop)!=null?A:j.backdrop,Qe=dr.useSlotProps({elementType:Be,externalSlotProps:Ce,externalForwardedProps:K,getSlotProps:G,additionalProps:{ref:n,as:v},ownerState:ce,className:Ge(h,Ce==null?void 0:Ce.className,fe==null?void 0:fe.root,!ce.open&&ce.exited&&(fe==null?void 0:fe.hidden))}),ae=dr.useSlotProps({elementType:me,externalSlotProps:Ie,additionalProps:C,getSlotProps:Ne=>F(W({},Ne,{onClick:te=>{_&&_(te),Ne!=null&&Ne.onClick&&Ne.onClick(te)}})),className:Ge(Ie==null?void 0:Ie.className,C==null?void 0:C.className,fe==null?void 0:fe.backdrop),ownerState:ce});return!U&&!le&&(!pe||ge)?null:f.jsx(Ea,{ref:H,container:B,disablePortal:L,children:f.jsxs(Be,W({},Qe,{children:[!J&&p?f.jsx(me,W({},ae)):null,f.jsx(Dc,{disableEnforceFocus:S,disableAutoFocus:x,disableRestoreFocus:k,isEnabled:X,open:le,children:D.cloneElement(I,he)})]}))})});process.env.NODE_ENV!=="production"&&(hb.propTypes={BackdropComponent:c.elementType,BackdropProps:c.object,children:us.isRequired,classes:c.object,className:c.string,closeAfterTransition:c.bool,component:c.elementType,components:c.shape({Backdrop:c.elementType,Root:c.elementType}),componentsProps:c.shape({backdrop:c.oneOfType([c.func,c.object]),root:c.oneOfType([c.func,c.object])}),container:c.oneOfType([oi,c.func]),disableAutoFocus:c.bool,disableEnforceFocus:c.bool,disableEscapeKeyDown:c.bool,disablePortal:c.bool,disableRestoreFocus:c.bool,disableScrollLock:c.bool,hideBackdrop:c.bool,keepMounted:c.bool,onBackdropClick:c.func,onClose:c.func,onTransitionEnter:c.func,onTransitionExited:c.func,open:c.bool.isRequired,slotProps:c.shape({backdrop:c.oneOfType([c.func,c.object]),root:c.oneOfType([c.func,c.object])}),slots:c.shape({backdrop:c.elementType,root:c.elementType}),sx:c.oneOfType([c.arrayOf(c.oneOfType([c.func,c.object,c.bool])),c.func,c.object])});const xV=hb;var mp={},wV=Ou;Object.defineProperty(mp,"__esModule",{value:!0});var Cb=mp.default=void 0,TV=wV(ju()),PV=f,SV=(0,TV.default)((0,PV.jsx)("path",{d:"M13 3c-4.97 0-9 4.03-9 9H1l3.89 3.89.07.14L9 12H6c0-3.87 3.13-7 7-7s7 3.13 7 7-3.13 7-7 7c-1.93 0-3.68-.79-4.94-2.06l-1.42 1.42C8.27 19.99 10.51 21 13 21c4.97 0 9-4.03 9-9s-4.03-9-9-9zm-1 5v5l4.28 2.54.72-1.21-3.5-2.08V8H12z"}),"History");Cb=mp.default=SV;var Ep={},RV=Ou;Object.defineProperty(Ep,"__esModule",{value:!0});var mb=Ep.default=void 0,OV=RV(ju()),jV=f,MV=(0,OV.default)((0,jV.jsx)("path",{d:"M19.14 12.94c.04-.3.06-.61.06-.94 0-.32-.02-.64-.07-.94l2.03-1.58c.18-.14.23-.41.12-.61l-1.92-3.32c-.12-.22-.37-.29-.59-.22l-2.39.96c-.5-.38-1.03-.7-1.62-.94l-.36-2.54c-.04-.24-.24-.41-.48-.41h-3.84c-.24 0-.43.17-.47.41l-.36 2.54c-.59.24-1.13.57-1.62.94l-2.39-.96c-.22-.08-.47 0-.59.22L2.74 8.87c-.12.21-.08.47.12.61l2.03 1.58c-.05.3-.09.63-.09.94s.02.64.07.94l-2.03 1.58c-.18.14-.23.41-.12.61l1.92 3.32c.12.22.37.29.59.22l2.39-.96c.5.38 1.03.7 1.62.94l.36 2.54c.05.24.24.41.48.41h3.84c.24 0 .44-.17.47-.41l.36-2.54c.59-.24 1.13-.56 1.62-.94l2.39.96c.22.08.47 0 .59-.22l1.92-3.32c.12-.22.07-.47-.12-.61l-2.01-1.58zM12 15.6c-1.98 0-3.6-1.62-3.6-3.6s1.62-3.6 3.6-3.6 3.6 1.62 3.6 3.6-1.62 3.6-3.6 3.6z"}),"Settings");mb=Ep.default=MV;var DV=function(e){var t=e.children,n=e.editor,r=e.preferenceKey,o=e.openButtonLabel,s=o===void 0?"ra.configurable.customize":o,l=e.sx,u="preferences.".concat(r),A=de.usePreferencesEditor(),g=!!A,p=de.useTranslate(),C=A||{},h=C.isEnabled,m=C.setEditor,I=C.preferenceKey,B=C.setPreferenceKey,v=u===I,O=w.useRef(v),j=w.useRef(null),x=w.useState(!1),S=x[0],P=x[1];if(w.useEffect(function(){O.current=v},[v]),w.useEffect(function(){return function(){O.current&&(B&&B(null),m&&m(null))}},[m,B]),!g)return t;var L=function(){m(w.cloneElement(n,{preferenceKey:u,key:u})),B(u)},k=function(){P(!0)},q=function(){P(!1)};return D.createElement(de.PreferenceKeyContextProvider,{value:u},D.createElement(kV,{className:ib(Wr.root,h&&Wr.editMode,v&&Wr.editorActive),sx:l,ref:j,onMouseEnter:h?k:void 0,onMouseLeave:h?q:void 0},t),D.createElement(b.Popover,{open:h&&(S||v),sx:{pointerEvents:"none","& .MuiPaper-root":{pointerEvents:"auto",borderRadius:10,padding:"2px",lineHeight:0,backgroundColor:"warning.light",color:"warning.contrastText","&:hover":{cursor:"pointer"}}},anchorEl:j.current,anchorOrigin:{vertical:"top",horizontal:"right"},transformOrigin:{vertical:"center",horizontal:"center"},onClose:q,PaperProps:{elevation:1,onMouseEnter:k,onMouseLeave:q,title:p(s),onClick:L},disableAutoFocus:!0,disableRestoreFocus:!0,disableEnforceFocus:!0,disableScrollLock:!0,marginThreshold:8},D.createElement(mb,{fontSize:"12px"})))},ac="RaConfigurable",Wr={root:"".concat(ac,"-root"),editMode:"".concat(ac,"-editMode"),editorActive:"".concat(ac,"-editorActive")},kV=ue("span",{name:ac,overridesResolver:function(e,t){return t.root}})(function(e){var t,n=e.theme;return t={position:"relative",display:"inline-block"},t["&.".concat(Wr.editMode)]={transition:n.transitions.create("outline"),outline:"".concat(b.alpha(n.palette.warning.main,.3)," solid 2px")},t["&.".concat(Wr.editMode,":hover ")]={outline:"".concat(b.alpha(n.palette.warning.main,.5)," solid 2px")},t["&.".concat(Wr.editMode,".").concat(Wr.editorActive," , &.").concat(Wr.editMode,".").concat(Wr.editorActive,":hover ")]={outline:"".concat(n.palette.warning.main," solid 2px")},t}),$o=globalThis&&globalThis.__assign||function(){return $o=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++){t=arguments[n];for(var o in t)Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o])}return e},$o.apply(this,arguments)},FV=globalThis&&globalThis.__rest||function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var o=0,r=Object.getOwnPropertySymbols(e);o<r.length;o++)t.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]]);return n},LV=function(e){var t=e.title,n=e.defaultTitle,r=e.className,o=FV(e,["title","defaultTitle","className"]),s=de.usePreference()[0],l=de.useTranslate(),u=de.useRecordContext();return s?D.createElement("span",$o({className:r},o),l(s,$o($o({},u),{_:s}))):D.createElement("span",{className:r},t?typeof t=="string"?D.createElement("span",$o({},o),l(t,{_:t})):t:D.createElement("span",$o({},o),n))},kc=globalThis&&globalThis.__assign||function(){return kc=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++){t=arguments[n];for(var o in t)Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o])}return e},kc.apply(this,arguments)},NV=globalThis&&globalThis.__rest||function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var o=0,r=Object.getOwnPropertySymbols(e);o<r.length;o++)t.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]]);return n},VV=function(){var e=de.usePreferenceInput();return D.createElement("form",null,D.createElement(b.TextField,kc({label:"title",variant:"filled",size:"small",fullWidth:!0,sx:{mb:1}},e)))},HV=function(e){var t=e.preferenceKey,n=NV(e,["preferenceKey"]),r=Bt.useLocation().pathname;return D.createElement(DV,{editor:D.createElement(VV,null),preferenceKey:t||"".concat(r,".title"),sx:{"&.RaConfigurable-editMode":{margin:"2px"}}},D.createElement(LV,kc({},n)))},Ig=globalThis&&globalThis.__assign||function(){return Ig=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++){t=arguments[n];for(var o in t)Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o])}return e},Ig.apply(this,arguments)},WV=globalThis&&globalThis.__rest||function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var o=0,r=Object.getOwnPropertySymbols(e);o<r.length;o++)t.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]]);return n},Eb=function(e){var t=e.defaultTitle,n=e.title,r=e.preferenceKey,o=WV(e,["defaultTitle","title","preferenceKey"]),s=w.useState(function(){return typeof document<"u"?document.getElementById("react-admin-title"):null}),l=s[0],u=s[1];return w.useEffect(function(){u(function(A){var g=typeof document<"u"&&document.body.contains(A);return A&&g?A:typeof document<"u"?document.getElementById("react-admin-title"):null})},[]),l?(de.warning(!t&&!n,"Missing title prop in <Title> element"),Wi.createPortal(D.createElement(HV,Ig({title:n,defaultTitle:t,preferenceKey:r},o)),l)):null},Ib=c.oneOfType([c.string,c.element]);Eb.propTypes={defaultTitle:c.string,className:c.string,record:c.any,title:Ib};var zV=function(e){var t=_i.useLocation().pathname,n=w.useRef(t);w.useEffect(function(){t!==n.current&&e()},[t,e])},UV=function(t,n){return t===void 0&&(t=[]),n===void 0&&(n=[]),t.length!==n.length||t.some(function(r,o){return!Object.is(r,n[o])})},DI={error:null},YV=function(e){Pf(t,e);function t(){for(var r,o=arguments.length,s=new Array(o),l=0;l<o;l++)s[l]=arguments[l];return r=e.call.apply(e,[this].concat(s))||this,r.state=DI,r.resetErrorBoundary=function(){for(var u,A=arguments.length,g=new Array(A),p=0;p<A;p++)g[p]=arguments[p];r.props.onReset==null||(u=r.props).onReset.apply(u,g),r.reset()},r}t.getDerivedStateFromError=function(o){return{error:o}};var n=t.prototype;return n.reset=function(){this.setState(DI)},n.componentDidCatch=function(o,s){var l,u;(l=(u=this.props).onError)==null||l.call(u,o,s)},n.componentDidUpdate=function(o,s){var l=this.state.error,u=this.props.resetKeys;if(l!==null&&s.error!==null&&UV(o.resetKeys,u)){var A,g;(A=(g=this.props).onResetKeysChange)==null||A.call(g,o.resetKeys,u),this.reset()}},n.render=function(){var o=this.state.error,s=this.props,l=s.fallbackRender,u=s.FallbackComponent,A=s.fallback;if(o!==null){var g={error:o,resetErrorBoundary:this.resetErrorBoundary};if(D.isValidElement(A))return A;if(typeof l=="function")return l(g);if(u)return D.createElement(u,g);throw new Error("react-error-boundary requires either a fallback, fallbackRender, or FallbackComponent prop")}return this.props.children},t}(D.Component),Bg=globalThis&&globalThis.__assign||function(){return Bg=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++){t=arguments[n];for(var o in t)Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o])}return e},Bg.apply(this,arguments)},GV=globalThis&&globalThis.__rest||function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var o=0,r=Object.getOwnPropertySymbols(e);o<r.length;o++)t.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]]);return n},Bb=function(e){var t=e.className,n=e.loadingPrimary,r=n===void 0?"ra.page.loading":n,o=e.loadingSecondary,s=o===void 0?"ra.message.loading":o,l=GV(e,["className","loadingPrimary","loadingSecondary"]),u=de.useTimeout(1e3),A=de.useTranslate();return u?D.createElement(KV,Bg({className:t},l),D.createElement("div",{className:Fc.message},D.createElement(Df,{className:Fc.icon}),D.createElement(b.Typography,{variant:"h5",mt:3,color:"text.secondary"},A(r,{_:r})),D.createElement(b.Typography,{variant:"body2"},A(s,{_:s})))):null};Bb.propTypes={className:c.string,loadingPrimary:c.string,loadingSecondary:c.string};var lc="RaLoading",Fc={root:"".concat(lc,"-root"),icon:"".concat(lc,"-icon"),message:"".concat(lc,"-message")},KV=ue("div",{name:lc,overridesResolver:function(e,t){return t.root}})(function(e){var t,n=e.theme;return t={display:"flex",flexDirection:"column",justifyContent:"center",alignItems:"center",height:"100%"},t["& .".concat(Fc.message)]={textAlign:"center",fontFamily:"Roboto, sans-serif",color:n.palette.text.disabled,paddingTop:"1em",paddingBottom:"1em"},t["& .".concat(Fc.icon)]={width:"9em",height:"9em"},t});function qV(e){return Nt("MuiToolbar",e)}Ut("MuiToolbar",["root","gutters","regular","dense"]);const JV=["className","component","disableGutters","variant"],XV=e=>{const{classes:t,disableGutters:n,variant:r}=e;return sn({root:["root",!n&&"gutters",r]},qV,t)},ZV=ue("div",{name:"MuiToolbar",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.root,!n.disableGutters&&t.gutters,t[n.variant]]}})(({theme:e,ownerState:t})=>W({position:"relative",display:"flex",alignItems:"center"},!t.disableGutters&&{paddingLeft:e.spacing(2),paddingRight:e.spacing(2),[e.breakpoints.up("sm")]:{paddingLeft:e.spacing(3),paddingRight:e.spacing(3)}},t.variant==="dense"&&{minHeight:48}),({theme:e,ownerState:t})=>t.variant==="regular"&&e.mixins.toolbar),vb=D.forwardRef(function(t,n){const r=Yt({props:t,name:"MuiToolbar"}),{className:o,component:s="div",disableGutters:l=!1,variant:u="regular"}=r,A=Ke(r,JV),g=W({},r,{component:s,disableGutters:l,variant:u}),p=XV(g);return f.jsx(ZV,W({as:s,className:Ge(p.root,o),ref:n,ownerState:g},A))});process.env.NODE_ENV!=="production"&&(vb.propTypes={children:c.node,classes:c.object,className:c.string,component:c.elementType,disableGutters:c.bool,sx:c.oneOfType([c.arrayOf(c.oneOfType([c.func,c.object,c.bool])),c.func,c.object]),variant:c.oneOfType([c.oneOf(["dense","regular"]),c.string])});const _V=vb;var Ip={},$V=Ou;Object.defineProperty(Ip,"__esModule",{value:!0});var yb=Ip.default=void 0,eH=$V(ju()),tH=f,nH=(0,eH.default)((0,tH.jsx)("path",{d:"M17.65 6.35C16.2 4.9 14.21 4 12 4c-4.42 0-7.99 3.58-7.99 8s3.57 8 7.99 8c3.73 0 6.84-2.55 7.73-6h-2.08c-.82 2.33-3.04 4-5.65 4-3.31 0-6-2.69-6-6s2.69-6 6-6c1.66 0 3.14.69 4.22 1.78L13 11h7V4l-2.35 2.35z"}),"Refresh");yb=Ip.default=nH;const rH=["addEndListener","appear","children","easing","in","onEnter","onEntered","onEntering","onExit","onExited","onExiting","style","timeout","TransitionComponent"];function vg(e){return`scale(${e}, ${e**2})`}const oH={entering:{opacity:1,transform:vg(1)},entered:{opacity:1,transform:"none"}},jd=typeof navigator<"u"&&/^((?!chrome|android).)*(safari|mobile)/i.test(navigator.userAgent)&&/(os |version\/)15(.|_)4/i.test(navigator.userAgent),Bp=D.forwardRef(function(t,n){const{addEndListener:r,appear:o=!0,children:s,easing:l,in:u,onEnter:A,onEntered:g,onEntering:p,onExit:C,onExited:h,onExiting:m,style:I,timeout:B="auto",TransitionComponent:v=Sf}=t,O=Ke(t,rH),j=D.useRef(),x=D.useRef(),S=Rt(),P=D.useRef(null),L=Dn(P,s.ref,n),k=K=>V=>{if(K){const G=P.current;V===void 0?K(G):K(G,V)}},q=k(p),J=k((K,V)=>{Cp(K);const{duration:G,delay:F,easing:$}=is({style:I,timeout:B,easing:l},{mode:"enter"});let H;B==="auto"?(H=S.transitions.getAutoHeightDuration(K.clientHeight),x.current=H):H=G,K.style.transition=[S.transitions.create("opacity",{duration:H,delay:F}),S.transitions.create("transform",{duration:jd?H:H*.666,delay:F,easing:$})].join(","),A&&A(K,V)}),U=k(g),_=k(m),le=k(K=>{const{duration:V,delay:G,easing:F}=is({style:I,timeout:B,easing:l},{mode:"exit"});let $;B==="auto"?($=S.transitions.getAutoHeightDuration(K.clientHeight),x.current=$):$=V,K.style.transition=[S.transitions.create("opacity",{duration:$,delay:G}),S.transitions.create("transform",{duration:jd?$:$*.666,delay:jd?G:G||$*.333,easing:F})].join(","),K.style.opacity=0,K.style.transform=vg(.75),C&&C(K)}),ie=k(h),Z=K=>{B==="auto"&&(j.current=setTimeout(K,x.current||0)),r&&r(P.current,K)};return D.useEffect(()=>()=>{clearTimeout(j.current)},[]),f.jsx(v,W({appear:o,in:u,nodeRef:P,onEnter:J,onEntered:U,onEntering:q,onExit:le,onExited:ie,onExiting:_,addEndListener:Z,timeout:B==="auto"?null:B},O,{children:(K,V)=>D.cloneElement(s,W({style:W({opacity:0,transform:vg(.75),visibility:K==="exited"&&!u?"hidden":void 0},oH[K],I,s.props.style),ref:L},V))}))});process.env.NODE_ENV!=="production"&&(Bp.propTypes={addEndListener:c.func,appear:c.bool,children:us.isRequired,easing:c.oneOfType([c.shape({enter:c.string,exit:c.string}),c.string]),in:c.bool,onEnter:c.func,onEntered:c.func,onEntering:c.func,onExit:c.func,onExited:c.func,onExiting:c.func,style:c.object,timeout:c.oneOfType([c.oneOf(["auto"]),c.number,c.shape({appear:c.number,enter:c.number,exit:c.number})])});Bp.muiSupportAuto=!0;const kI=Bp;var En="top",er="bottom",tr="right",In="left",vp="auto",La=[En,er,tr,In],ss="start",Ia="end",iH="clippingParents",bb="viewport",Ks="popper",sH="reference",FI=La.reduce(function(e,t){return e.concat([t+"-"+ss,t+"-"+Ia])},[]),Qb=[].concat(La,[vp]).reduce(function(e,t){return e.concat([t,t+"-"+ss,t+"-"+Ia])},[]),aH="beforeRead",lH="read",cH="afterRead",uH="beforeMain",AH="main",dH="afterMain",gH="beforeWrite",fH="write",pH="afterWrite",hH=[aH,lH,cH,uH,AH,dH,gH,fH,pH];function wr(e){return e?(e.nodeName||"").toLowerCase():null}function Fn(e){if(e==null)return window;if(e.toString()!=="[object Window]"){var t=e.ownerDocument;return t&&t.defaultView||window}return e}function si(e){var t=Fn(e).Element;return e instanceof t||e instanceof Element}function _n(e){var t=Fn(e).HTMLElement;return e instanceof t||e instanceof HTMLElement}function yp(e){if(typeof ShadowRoot>"u")return!1;var t=Fn(e).ShadowRoot;return e instanceof t||e instanceof ShadowRoot}function CH(e){var t=e.state;Object.keys(t.elements).forEach(function(n){var r=t.styles[n]||{},o=t.attributes[n]||{},s=t.elements[n];!_n(s)||!wr(s)||(Object.assign(s.style,r),Object.keys(o).forEach(function(l){var u=o[l];u===!1?s.removeAttribute(l):s.setAttribute(l,u===!0?"":u)}))})}function mH(e){var t=e.state,n={popper:{position:t.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};return Object.assign(t.elements.popper.style,n.popper),t.styles=n,t.elements.arrow&&Object.assign(t.elements.arrow.style,n.arrow),function(){Object.keys(t.elements).forEach(function(r){var o=t.elements[r],s=t.attributes[r]||{},l=Object.keys(t.styles.hasOwnProperty(r)?t.styles[r]:n[r]),u=l.reduce(function(A,g){return A[g]="",A},{});!_n(o)||!wr(o)||(Object.assign(o.style,u),Object.keys(s).forEach(function(A){o.removeAttribute(A)}))})}}const EH={name:"applyStyles",enabled:!0,phase:"write",fn:CH,effect:mH,requires:["computeStyles"]};function Qr(e){return e.split("-")[0]}var ri=Math.max,Lc=Math.min,as=Math.round;function yg(){var e=navigator.userAgentData;return e!=null&&e.brands&&Array.isArray(e.brands)?e.brands.map(function(t){return t.brand+"/"+t.version}).join(" "):navigator.userAgent}function xb(){return!/^((?!chrome|android).)*safari/i.test(yg())}function ls(e,t,n){t===void 0&&(t=!1),n===void 0&&(n=!1);var r=e.getBoundingClientRect(),o=1,s=1;t&&_n(e)&&(o=e.offsetWidth>0&&as(r.width)/e.offsetWidth||1,s=e.offsetHeight>0&&as(r.height)/e.offsetHeight||1);var l=si(e)?Fn(e):window,u=l.visualViewport,A=!xb()&&n,g=(r.left+(A&&u?u.offsetLeft:0))/o,p=(r.top+(A&&u?u.offsetTop:0))/s,C=r.width/o,h=r.height/s;return{width:C,height:h,top:p,right:g+C,bottom:p+h,left:g,x:g,y:p}}function bp(e){var t=ls(e),n=e.offsetWidth,r=e.offsetHeight;return Math.abs(t.width-n)<=1&&(n=t.width),Math.abs(t.height-r)<=1&&(r=t.height),{x:e.offsetLeft,y:e.offsetTop,width:n,height:r}}function wb(e,t){var n=t.getRootNode&&t.getRootNode();if(e.contains(t))return!0;if(n&&yp(n)){var r=t;do{if(r&&e.isSameNode(r))return!0;r=r.parentNode||r.host}while(r)}return!1}function Xr(e){return Fn(e).getComputedStyle(e)}function IH(e){return["table","td","th"].indexOf(wr(e))>=0}function wo(e){return((si(e)?e.ownerDocument:e.document)||window.document).documentElement}function Mu(e){return wr(e)==="html"?e:e.assignedSlot||e.parentNode||(yp(e)?e.host:null)||wo(e)}function LI(e){return!_n(e)||Xr(e).position==="fixed"?null:e.offsetParent}function BH(e){var t=/firefox/i.test(yg()),n=/Trident/i.test(yg());if(n&&_n(e)){var r=Xr(e);if(r.position==="fixed")return null}var o=Mu(e);for(yp(o)&&(o=o.host);_n(o)&&["html","body"].indexOf(wr(o))<0;){var s=Xr(o);if(s.transform!=="none"||s.perspective!=="none"||s.contain==="paint"||["transform","perspective"].indexOf(s.willChange)!==-1||t&&s.willChange==="filter"||t&&s.filter&&s.filter!=="none")return o;o=o.parentNode}return null}function Na(e){for(var t=Fn(e),n=LI(e);n&&IH(n)&&Xr(n).position==="static";)n=LI(n);return n&&(wr(n)==="html"||wr(n)==="body"&&Xr(n).position==="static")?t:n||BH(e)||t}function Qp(e){return["top","bottom"].indexOf(e)>=0?"x":"y"}function aa(e,t,n){return ri(e,Lc(t,n))}function vH(e,t,n){var r=aa(e,t,n);return r>n?n:r}function Tb(){return{top:0,right:0,bottom:0,left:0}}function Pb(e){return Object.assign({},Tb(),e)}function Sb(e,t){return t.reduce(function(n,r){return n[r]=e,n},{})}var yH=function(t,n){return t=typeof t=="function"?t(Object.assign({},n.rects,{placement:n.placement})):t,Pb(typeof t!="number"?t:Sb(t,La))};function bH(e){var t,n=e.state,r=e.name,o=e.options,s=n.elements.arrow,l=n.modifiersData.popperOffsets,u=Qr(n.placement),A=Qp(u),g=[In,tr].indexOf(u)>=0,p=g?"height":"width";if(!(!s||!l)){var C=yH(o.padding,n),h=bp(s),m=A==="y"?En:In,I=A==="y"?er:tr,B=n.rects.reference[p]+n.rects.reference[A]-l[A]-n.rects.popper[p],v=l[A]-n.rects.reference[A],O=Na(s),j=O?A==="y"?O.clientHeight||0:O.clientWidth||0:0,x=B/2-v/2,S=C[m],P=j-h[p]-C[I],L=j/2-h[p]/2+x,k=aa(S,L,P),q=A;n.modifiersData[r]=(t={},t[q]=k,t.centerOffset=k-L,t)}}function QH(e){var t=e.state,n=e.options,r=n.element,o=r===void 0?"[data-popper-arrow]":r;o!=null&&(typeof o=="string"&&(o=t.elements.popper.querySelector(o),!o)||wb(t.elements.popper,o)&&(t.elements.arrow=o))}const xH={name:"arrow",enabled:!0,phase:"main",fn:bH,effect:QH,requires:["popperOffsets"],requiresIfExists:["preventOverflow"]};function cs(e){return e.split("-")[1]}var wH={top:"auto",right:"auto",bottom:"auto",left:"auto"};function TH(e,t){var n=e.x,r=e.y,o=t.devicePixelRatio||1;return{x:as(n*o)/o||0,y:as(r*o)/o||0}}function NI(e){var t,n=e.popper,r=e.popperRect,o=e.placement,s=e.variation,l=e.offsets,u=e.position,A=e.gpuAcceleration,g=e.adaptive,p=e.roundOffsets,C=e.isFixed,h=l.x,m=h===void 0?0:h,I=l.y,B=I===void 0?0:I,v=typeof p=="function"?p({x:m,y:B}):{x:m,y:B};m=v.x,B=v.y;var O=l.hasOwnProperty("x"),j=l.hasOwnProperty("y"),x=In,S=En,P=window;if(g){var L=Na(n),k="clientHeight",q="clientWidth";if(L===Fn(n)&&(L=wo(n),Xr(L).position!=="static"&&u==="absolute"&&(k="scrollHeight",q="scrollWidth")),L=L,o===En||(o===In||o===tr)&&s===Ia){S=er;var J=C&&L===P&&P.visualViewport?P.visualViewport.height:L[k];B-=J-r.height,B*=A?1:-1}if(o===In||(o===En||o===er)&&s===Ia){x=tr;var U=C&&L===P&&P.visualViewport?P.visualViewport.width:L[q];m-=U-r.width,m*=A?1:-1}}var _=Object.assign({position:u},g&&wH),le=p===!0?TH({x:m,y:B},Fn(n)):{x:m,y:B};if(m=le.x,B=le.y,A){var ie;return Object.assign({},_,(ie={},ie[S]=j?"0":"",ie[x]=O?"0":"",ie.transform=(P.devicePixelRatio||1)<=1?"translate("+m+"px, "+B+"px)":"translate3d("+m+"px, "+B+"px, 0)",ie))}return Object.assign({},_,(t={},t[S]=j?B+"px":"",t[x]=O?m+"px":"",t.transform="",t))}function PH(e){var t=e.state,n=e.options,r=n.gpuAcceleration,o=r===void 0?!0:r,s=n.adaptive,l=s===void 0?!0:s,u=n.roundOffsets,A=u===void 0?!0:u,g={placement:Qr(t.placement),variation:cs(t.placement),popper:t.elements.popper,popperRect:t.rects.popper,gpuAcceleration:o,isFixed:t.options.strategy==="fixed"};t.modifiersData.popperOffsets!=null&&(t.styles.popper=Object.assign({},t.styles.popper,NI(Object.assign({},g,{offsets:t.modifiersData.popperOffsets,position:t.options.strategy,adaptive:l,roundOffsets:A})))),t.modifiersData.arrow!=null&&(t.styles.arrow=Object.assign({},t.styles.arrow,NI(Object.assign({},g,{offsets:t.modifiersData.arrow,position:"absolute",adaptive:!1,roundOffsets:A})))),t.attributes.popper=Object.assign({},t.attributes.popper,{"data-popper-placement":t.placement})}const SH={name:"computeStyles",enabled:!0,phase:"beforeWrite",fn:PH,data:{}};var Jl={passive:!0};function RH(e){var t=e.state,n=e.instance,r=e.options,o=r.scroll,s=o===void 0?!0:o,l=r.resize,u=l===void 0?!0:l,A=Fn(t.elements.popper),g=[].concat(t.scrollParents.reference,t.scrollParents.popper);return s&&g.forEach(function(p){p.addEventListener("scroll",n.update,Jl)}),u&&A.addEventListener("resize",n.update,Jl),function(){s&&g.forEach(function(p){p.removeEventListener("scroll",n.update,Jl)}),u&&A.removeEventListener("resize",n.update,Jl)}}const OH={name:"eventListeners",enabled:!0,phase:"write",fn:function(){},effect:RH,data:{}};var jH={left:"right",right:"left",bottom:"top",top:"bottom"};function cc(e){return e.replace(/left|right|bottom|top/g,function(t){return jH[t]})}var MH={start:"end",end:"start"};function VI(e){return e.replace(/start|end/g,function(t){return MH[t]})}function xp(e){var t=Fn(e),n=t.pageXOffset,r=t.pageYOffset;return{scrollLeft:n,scrollTop:r}}function wp(e){return ls(wo(e)).left+xp(e).scrollLeft}function DH(e,t){var n=Fn(e),r=wo(e),o=n.visualViewport,s=r.clientWidth,l=r.clientHeight,u=0,A=0;if(o){s=o.width,l=o.height;var g=xb();(g||!g&&t==="fixed")&&(u=o.offsetLeft,A=o.offsetTop)}return{width:s,height:l,x:u+wp(e),y:A}}function kH(e){var t,n=wo(e),r=xp(e),o=(t=e.ownerDocument)==null?void 0:t.body,s=ri(n.scrollWidth,n.clientWidth,o?o.scrollWidth:0,o?o.clientWidth:0),l=ri(n.scrollHeight,n.clientHeight,o?o.scrollHeight:0,o?o.clientHeight:0),u=-r.scrollLeft+wp(e),A=-r.scrollTop;return Xr(o||n).direction==="rtl"&&(u+=ri(n.clientWidth,o?o.clientWidth:0)-s),{width:s,height:l,x:u,y:A}}function Tp(e){var t=Xr(e),n=t.overflow,r=t.overflowX,o=t.overflowY;return/auto|scroll|overlay|hidden/.test(n+o+r)}function Rb(e){return["html","body","#document"].indexOf(wr(e))>=0?e.ownerDocument.body:_n(e)&&Tp(e)?e:Rb(Mu(e))}function la(e,t){var n;t===void 0&&(t=[]);var r=Rb(e),o=r===((n=e.ownerDocument)==null?void 0:n.body),s=Fn(r),l=o?[s].concat(s.visualViewport||[],Tp(r)?r:[]):r,u=t.concat(l);return o?u:u.concat(la(Mu(l)))}function bg(e){return Object.assign({},e,{left:e.x,top:e.y,right:e.x+e.width,bottom:e.y+e.height})}function FH(e,t){var n=ls(e,!1,t==="fixed");return n.top=n.top+e.clientTop,n.left=n.left+e.clientLeft,n.bottom=n.top+e.clientHeight,n.right=n.left+e.clientWidth,n.width=e.clientWidth,n.height=e.clientHeight,n.x=n.left,n.y=n.top,n}function HI(e,t,n){return t===bb?bg(DH(e,n)):si(t)?FH(t,n):bg(kH(wo(e)))}function LH(e){var t=la(Mu(e)),n=["absolute","fixed"].indexOf(Xr(e).position)>=0,r=n&&_n(e)?Na(e):e;return si(r)?t.filter(function(o){return si(o)&&wb(o,r)&&wr(o)!=="body"}):[]}function NH(e,t,n,r){var o=t==="clippingParents"?LH(e):[].concat(t),s=[].concat(o,[n]),l=s[0],u=s.reduce(function(A,g){var p=HI(e,g,r);return A.top=ri(p.top,A.top),A.right=Lc(p.right,A.right),A.bottom=Lc(p.bottom,A.bottom),A.left=ri(p.left,A.left),A},HI(e,l,r));return u.width=u.right-u.left,u.height=u.bottom-u.top,u.x=u.left,u.y=u.top,u}function Ob(e){var t=e.reference,n=e.element,r=e.placement,o=r?Qr(r):null,s=r?cs(r):null,l=t.x+t.width/2-n.width/2,u=t.y+t.height/2-n.height/2,A;switch(o){case En:A={x:l,y:t.y-n.height};break;case er:A={x:l,y:t.y+t.height};break;case tr:A={x:t.x+t.width,y:u};break;case In:A={x:t.x-n.width,y:u};break;default:A={x:t.x,y:t.y}}var g=o?Qp(o):null;if(g!=null){var p=g==="y"?"height":"width";switch(s){case ss:A[g]=A[g]-(t[p]/2-n[p]/2);break;case Ia:A[g]=A[g]+(t[p]/2-n[p]/2);break}}return A}function Ba(e,t){t===void 0&&(t={});var n=t,r=n.placement,o=r===void 0?e.placement:r,s=n.strategy,l=s===void 0?e.strategy:s,u=n.boundary,A=u===void 0?iH:u,g=n.rootBoundary,p=g===void 0?bb:g,C=n.elementContext,h=C===void 0?Ks:C,m=n.altBoundary,I=m===void 0?!1:m,B=n.padding,v=B===void 0?0:B,O=Pb(typeof v!="number"?v:Sb(v,La)),j=h===Ks?sH:Ks,x=e.rects.popper,S=e.elements[I?j:h],P=NH(si(S)?S:S.contextElement||wo(e.elements.popper),A,p,l),L=ls(e.elements.reference),k=Ob({reference:L,element:x,strategy:"absolute",placement:o}),q=bg(Object.assign({},x,k)),J=h===Ks?q:L,U={top:P.top-J.top+O.top,bottom:J.bottom-P.bottom+O.bottom,left:P.left-J.left+O.left,right:J.right-P.right+O.right},_=e.modifiersData.offset;if(h===Ks&&_){var le=_[o];Object.keys(U).forEach(function(ie){var Z=[tr,er].indexOf(ie)>=0?1:-1,K=[En,er].indexOf(ie)>=0?"y":"x";U[ie]+=le[K]*Z})}return U}function VH(e,t){t===void 0&&(t={});var n=t,r=n.placement,o=n.boundary,s=n.rootBoundary,l=n.padding,u=n.flipVariations,A=n.allowedAutoPlacements,g=A===void 0?Qb:A,p=cs(r),C=p?u?FI:FI.filter(function(I){return cs(I)===p}):La,h=C.filter(function(I){return g.indexOf(I)>=0});h.length===0&&(h=C);var m=h.reduce(function(I,B){return I[B]=Ba(e,{placement:B,boundary:o,rootBoundary:s,padding:l})[Qr(B)],I},{});return Object.keys(m).sort(function(I,B){return m[I]-m[B]})}function HH(e){if(Qr(e)===vp)return[];var t=cc(e);return[VI(e),t,VI(t)]}function WH(e){var t=e.state,n=e.options,r=e.name;if(!t.modifiersData[r]._skip){for(var o=n.mainAxis,s=o===void 0?!0:o,l=n.altAxis,u=l===void 0?!0:l,A=n.fallbackPlacements,g=n.padding,p=n.boundary,C=n.rootBoundary,h=n.altBoundary,m=n.flipVariations,I=m===void 0?!0:m,B=n.allowedAutoPlacements,v=t.options.placement,O=Qr(v),j=O===v,x=A||(j||!I?[cc(v)]:HH(v)),S=[v].concat(x).reduce(function(ce,fe){return ce.concat(Qr(fe)===vp?VH(t,{placement:fe,boundary:p,rootBoundary:C,padding:g,flipVariations:I,allowedAutoPlacements:B}):fe)},[]),P=t.rects.reference,L=t.rects.popper,k=new Map,q=!0,J=S[0],U=0;U<S.length;U++){var _=S[U],le=Qr(_),ie=cs(_)===ss,Z=[En,er].indexOf(le)>=0,K=Z?"width":"height",V=Ba(t,{placement:_,boundary:p,rootBoundary:C,altBoundary:h,padding:g}),G=Z?ie?tr:In:ie?er:En;P[K]>L[K]&&(G=cc(G));var F=cc(G),$=[];if(s&&$.push(V[le]<=0),u&&$.push(V[G]<=0,V[F]<=0),$.every(function(ce){return ce})){J=_,q=!1;break}k.set(_,$)}if(q)for(var H=I?3:1,X=function(fe){var he=S.find(function(Be){var me=k.get(Be);if(me)return me.slice(0,fe).every(function(Ce){return Ce})});if(he)return J=he,"break"},ge=H;ge>0;ge--){var pe=X(ge);if(pe==="break")break}t.placement!==J&&(t.modifiersData[r]._skip=!0,t.placement=J,t.reset=!0)}}const zH={name:"flip",enabled:!0,phase:"main",fn:WH,requiresIfExists:["offset"],data:{_skip:!1}};function WI(e,t,n){return n===void 0&&(n={x:0,y:0}),{top:e.top-t.height-n.y,right:e.right-t.width+n.x,bottom:e.bottom-t.height+n.y,left:e.left-t.width-n.x}}function zI(e){return[En,tr,er,In].some(function(t){return e[t]>=0})}function UH(e){var t=e.state,n=e.name,r=t.rects.reference,o=t.rects.popper,s=t.modifiersData.preventOverflow,l=Ba(t,{elementContext:"reference"}),u=Ba(t,{altBoundary:!0}),A=WI(l,r),g=WI(u,o,s),p=zI(A),C=zI(g);t.modifiersData[n]={referenceClippingOffsets:A,popperEscapeOffsets:g,isReferenceHidden:p,hasPopperEscaped:C},t.attributes.popper=Object.assign({},t.attributes.popper,{"data-popper-reference-hidden":p,"data-popper-escaped":C})}const YH={name:"hide",enabled:!0,phase:"main",requiresIfExists:["preventOverflow"],fn:UH};function GH(e,t,n){var r=Qr(e),o=[In,En].indexOf(r)>=0?-1:1,s=typeof n=="function"?n(Object.assign({},t,{placement:e})):n,l=s[0],u=s[1];return l=l||0,u=(u||0)*o,[In,tr].indexOf(r)>=0?{x:u,y:l}:{x:l,y:u}}function KH(e){var t=e.state,n=e.options,r=e.name,o=n.offset,s=o===void 0?[0,0]:o,l=Qb.reduce(function(p,C){return p[C]=GH(C,t.rects,s),p},{}),u=l[t.placement],A=u.x,g=u.y;t.modifiersData.popperOffsets!=null&&(t.modifiersData.popperOffsets.x+=A,t.modifiersData.popperOffsets.y+=g),t.modifiersData[r]=l}const qH={name:"offset",enabled:!0,phase:"main",requires:["popperOffsets"],fn:KH};function JH(e){var t=e.state,n=e.name;t.modifiersData[n]=Ob({reference:t.rects.reference,element:t.rects.popper,strategy:"absolute",placement:t.placement})}const XH={name:"popperOffsets",enabled:!0,phase:"read",fn:JH,data:{}};function ZH(e){return e==="x"?"y":"x"}function _H(e){var t=e.state,n=e.options,r=e.name,o=n.mainAxis,s=o===void 0?!0:o,l=n.altAxis,u=l===void 0?!1:l,A=n.boundary,g=n.rootBoundary,p=n.altBoundary,C=n.padding,h=n.tether,m=h===void 0?!0:h,I=n.tetherOffset,B=I===void 0?0:I,v=Ba(t,{boundary:A,rootBoundary:g,padding:C,altBoundary:p}),O=Qr(t.placement),j=cs(t.placement),x=!j,S=Qp(O),P=ZH(S),L=t.modifiersData.popperOffsets,k=t.rects.reference,q=t.rects.popper,J=typeof B=="function"?B(Object.assign({},t.rects,{placement:t.placement})):B,U=typeof J=="number"?{mainAxis:J,altAxis:J}:Object.assign({mainAxis:0,altAxis:0},J),_=t.modifiersData.offset?t.modifiersData.offset[t.placement]:null,le={x:0,y:0};if(L){if(s){var ie,Z=S==="y"?En:In,K=S==="y"?er:tr,V=S==="y"?"height":"width",G=L[S],F=G+v[Z],$=G-v[K],H=m?-q[V]/2:0,X=j===ss?k[V]:q[V],ge=j===ss?-q[V]:-k[V],pe=t.elements.arrow,ce=m&&pe?bp(pe):{width:0,height:0},fe=t.modifiersData["arrow#persistent"]?t.modifiersData["arrow#persistent"].padding:Tb(),he=fe[Z],Be=fe[K],me=aa(0,k[V],ce[V]),Ce=x?k[V]/2-H-me-he-U.mainAxis:X-me-he-U.mainAxis,Ie=x?-k[V]/2+H+me+Be+U.mainAxis:ge+me+Be+U.mainAxis,Qe=t.elements.arrow&&Na(t.elements.arrow),ae=Qe?S==="y"?Qe.clientTop||0:Qe.clientLeft||0:0,Ne=(ie=_==null?void 0:_[S])!=null?ie:0,te=G+Ce-Ne-ae,_e=G+Ie-Ne,yt=aa(m?Lc(F,te):F,G,m?ri($,_e):$);L[S]=yt,le[S]=yt-G}if(u){var gt,Tt=S==="x"?En:In,hr=S==="x"?er:tr,bt=L[P],Et=P==="y"?"height":"width",ft=bt+v[Tt],Vt=bt-v[hr],Ht=[En,In].indexOf(O)!==-1,Se=(gt=_==null?void 0:_[P])!=null?gt:0,ke=Ht?ft:bt-k[Et]-q[Et]-Se+U.altAxis,we=Ht?bt+k[Et]+q[Et]-Se-U.altAxis:Vt,ze=m&&Ht?vH(ke,bt,we):aa(m?ke:ft,bt,m?we:Vt);L[P]=ze,le[P]=ze-bt}t.modifiersData[r]=le}}const $H={name:"preventOverflow",enabled:!0,phase:"main",fn:_H,requiresIfExists:["offset"]};function eW(e){return{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}}function tW(e){return e===Fn(e)||!_n(e)?xp(e):eW(e)}function nW(e){var t=e.getBoundingClientRect(),n=as(t.width)/e.offsetWidth||1,r=as(t.height)/e.offsetHeight||1;return n!==1||r!==1}function rW(e,t,n){n===void 0&&(n=!1);var r=_n(t),o=_n(t)&&nW(t),s=wo(t),l=ls(e,o,n),u={scrollLeft:0,scrollTop:0},A={x:0,y:0};return(r||!r&&!n)&&((wr(t)!=="body"||Tp(s))&&(u=tW(t)),_n(t)?(A=ls(t,!0),A.x+=t.clientLeft,A.y+=t.clientTop):s&&(A.x=wp(s))),{x:l.left+u.scrollLeft-A.x,y:l.top+u.scrollTop-A.y,width:l.width,height:l.height}}function oW(e){var t=new Map,n=new Set,r=[];e.forEach(function(s){t.set(s.name,s)});function o(s){n.add(s.name);var l=[].concat(s.requires||[],s.requiresIfExists||[]);l.forEach(function(u){if(!n.has(u)){var A=t.get(u);A&&o(A)}}),r.push(s)}return e.forEach(function(s){n.has(s.name)||o(s)}),r}function iW(e){var t=oW(e);return hH.reduce(function(n,r){return n.concat(t.filter(function(o){return o.phase===r}))},[])}function sW(e){var t;return function(){return t||(t=new Promise(function(n){Promise.resolve().then(function(){t=void 0,n(e())})})),t}}function aW(e){var t=e.reduce(function(n,r){var o=n[r.name];return n[r.name]=o?Object.assign({},o,r,{options:Object.assign({},o.options,r.options),data:Object.assign({},o.data,r.data)}):r,n},{});return Object.keys(t).map(function(n){return t[n]})}var UI={placement:"bottom",modifiers:[],strategy:"absolute"};function YI(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return!t.some(function(r){return!(r&&typeof r.getBoundingClientRect=="function")})}function lW(e){e===void 0&&(e={});var t=e,n=t.defaultModifiers,r=n===void 0?[]:n,o=t.defaultOptions,s=o===void 0?UI:o;return function(u,A,g){g===void 0&&(g=s);var p={placement:"bottom",orderedModifiers:[],options:Object.assign({},UI,s),modifiersData:{},elements:{reference:u,popper:A},attributes:{},styles:{}},C=[],h=!1,m={state:p,setOptions:function(O){var j=typeof O=="function"?O(p.options):O;B(),p.options=Object.assign({},s,p.options,j),p.scrollParents={reference:si(u)?la(u):u.contextElement?la(u.contextElement):[],popper:la(A)};var x=iW(aW([].concat(r,p.options.modifiers)));return p.orderedModifiers=x.filter(function(S){return S.enabled}),I(),m.update()},forceUpdate:function(){if(!h){var O=p.elements,j=O.reference,x=O.popper;if(YI(j,x)){p.rects={reference:rW(j,Na(x),p.options.strategy==="fixed"),popper:bp(x)},p.reset=!1,p.placement=p.options.placement,p.orderedModifiers.forEach(function(U){return p.modifiersData[U.name]=Object.assign({},U.data)});for(var S=0;S<p.orderedModifiers.length;S++){if(p.reset===!0){p.reset=!1,S=-1;continue}var P=p.orderedModifiers[S],L=P.fn,k=P.options,q=k===void 0?{}:k,J=P.name;typeof L=="function"&&(p=L({state:p,options:q,name:J,instance:m})||p)}}}},update:sW(function(){return new Promise(function(v){m.forceUpdate(),v(p)})}),destroy:function(){B(),h=!0}};if(!YI(u,A))return m;m.setOptions(g).then(function(v){!h&&g.onFirstUpdate&&g.onFirstUpdate(v)});function I(){p.orderedModifiers.forEach(function(v){var O=v.name,j=v.options,x=j===void 0?{}:j,S=v.effect;if(typeof S=="function"){var P=S({state:p,name:O,instance:m,options:x}),L=function(){};C.push(P||L)}})}function B(){C.forEach(function(v){return v()}),C=[]}return m}}var cW=[OH,XH,SH,EH,qH,zH,$H,xH,YH],uW=lW({defaultModifiers:cW});function AW(e){return Nt("MuiPopper",e)}Ut("MuiPopper",["root"]);const dW=["anchorEl","children","direction","disablePortal","modifiers","open","placement","popperOptions","popperRef","slotProps","slots","TransitionProps","ownerState"],gW=["anchorEl","children","container","direction","disablePortal","keepMounted","modifiers","open","placement","popperOptions","popperRef","style","transition","slotProps","slots"];function fW(e,t){if(t==="ltr")return e;switch(e){case"bottom-end":return"bottom-start";case"bottom-start":return"bottom-end";case"top-end":return"top-start";case"top-start":return"top-end";default:return e}}function Nc(e){return typeof e=="function"?e():e}function Du(e){return e.nodeType!==void 0}function pW(e){return!Du(e)}const hW=()=>sn({root:["root"]},G7(AW)),CW={},mW=D.forwardRef(function(t,n){var r;const{anchorEl:o,children:s,direction:l,disablePortal:u,modifiers:A,open:g,placement:p,popperOptions:C,popperRef:h,slotProps:m={},slots:I={},TransitionProps:B}=t,v=Ke(t,dW),O=D.useRef(null),j=Dn(O,n),x=D.useRef(null),S=Dn(x,h),P=D.useRef(S);es(()=>{P.current=S},[S]),D.useImperativeHandle(h,()=>x.current,[]);const L=fW(p,l),[k,q]=D.useState(L),[J,U]=D.useState(Nc(o));D.useEffect(()=>{x.current&&x.current.forceUpdate()}),D.useEffect(()=>{o&&U(Nc(o))},[o]),es(()=>{if(!J||!g)return;const K=F=>{q(F.placement)};if(process.env.NODE_ENV!=="production"&&J&&Du(J)&&J.nodeType===1){const F=J.getBoundingClientRect();process.env.NODE_ENV!=="test"&&F.top===0&&F.left===0&&F.right===0&&F.bottom===0&&console.warn(["MUI: The `anchorEl` prop provided to the component is invalid.","The anchor element should be part of the document layout.","Make sure the element is present in the document or that it's not display none."].join(`