@luminix/mui-cms 1.1.0 → 1.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CLAUDE.md +8 -0
- package/bundle/mui-cms.bundle.iife.js +1 -1
- package/dist/mui-cms.js +15 -13
- package/docs/configuracao.md +44 -1
- package/package.json +1 -1
- package/types/types/PropTypes.d.ts +4 -0
package/CLAUDE.md
ADDED
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
# @luminix/mui-cms
|
|
2
|
+
|
|
3
|
+
This project is a TypeScript/React library to create admin areas on Laravel applications. Part of the Luminix stack. Check if the skills `/luminix` and/or `/luminix-cms` are available to understand the ecossystem and how to use this library.
|
|
4
|
+
|
|
5
|
+
## When working on this project
|
|
6
|
+
|
|
7
|
+
- Always update and/or create new tests, relevant to the context, unless the user explicitly tells you not to.
|
|
8
|
+
- Always update the documentation, keeping its current style, again, unless the user explicitly tells you not to.
|
|
@@ -182,4 +182,4 @@ Error generating stack: `+C.message+`
|
|
|
182
182
|
`);return l===-1?"":o.stack.slice(l+1)})();try{if(!r.stack)r.stack=s;else if(s){const l=s.indexOf(`
|
|
183
183
|
`),c=l===-1?-1:s.indexOf(`
|
|
184
184
|
`,l+1),u=c===-1?"":s.slice(c+1);String(r.stack).endsWith(u)||(r.stack+=`
|
|
185
|
-
`+s)}}catch{}}throw r}}_request(t,n){typeof t=="string"?(n=n||{},n.url=t):n=t||{},n=Vs(this.defaults,n);const{transitional:r,paramsSerializer:o,headers:s}=n;r!==void 0&&sp.assertOptions(r,{silentJSONParsing:uo.transitional(uo.boolean),forcedJSONParsing:uo.transitional(uo.boolean),clarifyTimeoutError:uo.transitional(uo.boolean),legacyInterceptorReqResOrdering:uo.transitional(uo.boolean)},!1),o!=null&&(re.isFunction(o)?n.paramsSerializer={serialize:o}:sp.assertOptions(o,{encode:uo.function,serialize:uo.function},!0)),n.allowAbsoluteUrls!==void 0||(this.defaults.allowAbsoluteUrls!==void 0?n.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls:n.allowAbsoluteUrls=!0),sp.assertOptions(n,{baseUrl:uo.spelling("baseURL"),withXsrfToken:uo.spelling("withXSRFToken")},!0),n.method=(n.method||this.defaults.method||"get").toLowerCase();let l=s&&re.merge(s.common,s[n.method]);s&&re.forEach(["delete","get","head","post","put","patch","query","common"],w=>{delete s[w]}),n.headers=ur.concat(l,s);const c=[];let u=!0;this.interceptors.request.forEach(function(v){if(typeof v.runWhen=="function"&&v.runWhen(n)===!1)return;u=u&&v.synchronous;const x=n.transitional||Yy;x&&x.legacyInterceptorReqResOrdering?c.unshift(v.fulfilled,v.rejected):c.push(v.fulfilled,v.rejected)});const f=[];this.interceptors.response.forEach(function(v){f.push(v.fulfilled,v.rejected)});let p,m=0,g;if(!u){const w=[iP.bind(this),void 0];for(w.unshift(...c),w.push(...f),g=w.length,p=Promise.resolve(n);m<g;)p=p.then(w[m++],w[m++]);return p}g=c.length;let S=n;for(;m<g;){const w=c[m++],v=c[m++];try{S=w(S)}catch(x){v.call(this,x);break}}try{p=iP.call(this,S)}catch(w){return Promise.reject(w)}for(m=0,g=f.length;m<g;)p=p.then(f[m++],f[m++]);return p}getUri(t){t=Vs(this.defaults,t);const n=Yk(t.baseURL,t.url,t.allowAbsoluteUrls);return Wk(n,t.params,t.paramsSerializer)}};re.forEach(["delete","get","head","options"],function(t){Ks.prototype[t]=function(n,r){return this.request(Vs(r||{},{method:t,url:n,data:(r||{}).data}))}}),re.forEach(["post","put","patch","query"],function(t){function n(r){return function(s,l,c){return this.request(Vs(c||{},{method:t,headers:r?{"Content-Type":"multipart/form-data"}:{},url:s,data:l}))}}Ks.prototype[t]=n(),t!=="query"&&(Ks.prototype[t+"Form"]=n(!0))});let QX=class t2{constructor(t){if(typeof t!="function")throw new TypeError("executor must be a function.");let n;this.promise=new Promise(function(s){n=s});const r=this;this.promise.then(o=>{if(!r._listeners)return;let s=r._listeners.length;for(;s-- >0;)r._listeners[s](o);r._listeners=null}),this.promise.then=o=>{let s;const l=new Promise(c=>{r.subscribe(c),s=c}).then(o);return l.cancel=function(){r.unsubscribe(s)},l},t(function(s,l,c){r.reason||(r.reason=new uu(s,l,c),n(r.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(t){if(this.reason){t(this.reason);return}this._listeners?this._listeners.push(t):this._listeners=[t]}unsubscribe(t){if(!this._listeners)return;const n=this._listeners.indexOf(t);n!==-1&&this._listeners.splice(n,1)}toAbortSignal(){const t=new AbortController,n=r=>{t.abort(r)};return this.subscribe(n),t.signal.unsubscribe=()=>this.unsubscribe(n),t.signal}static source(){let t;return{token:new t2(function(o){t=o}),cancel:t}}};function YX(e){return function(n){return e.apply(null,n)}}function JX(e){return re.isObject(e)&&e.isAxiosError===!0}const rv={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511,WebServerIsDown:521,ConnectionTimedOut:522,OriginIsUnreachable:523,TimeoutOccurred:524,SslHandshakeFailed:525,InvalidSslCertificate:526};Object.entries(rv).forEach(([e,t])=>{rv[t]=e});function aP(e){const t=new Ks(e),n=Ok(Ks.prototype.request,t);return re.extend(n,Ks.prototype,t,{allOwnKeys:!0}),re.extend(n,t,null,{allOwnKeys:!0}),n.create=function(o){return aP(Vs(e,o))},n}const Tn=aP(cu);Tn.Axios=Ks,Tn.CanceledError=uu,Tn.CancelToken=QX,Tn.isCancel=Kk,Tn.VERSION=ev,Tn.toFormData=np,Tn.AxiosError=et,Tn.Cancel=Tn.CanceledError,Tn.all=function(t){return Promise.all(t)},Tn.spread=YX,Tn.isAxiosError=JX,Tn.mergeConfig=Vs,Tn.AxiosHeaders=ur,Tn.formToJSON=e=>Vk(re.isHTMLForm(e)?new FormData(e):e),Tn.getAdapter=oP.getAdapter,Tn.HttpStatusCode=rv,Tn.default=Tn;const{Axios:Yne,AxiosError:Jne,CanceledError:Xne,isCancel:Zne,CancelToken:ere,VERSION:tre,all:nre,Cancel:rre,isAxiosError:XX,spread:ore,toFormData:ire,AxiosHeaders:sre,HttpStatusCode:are,formToJSON:lre,getAdapter:cre,mergeConfig:ure,create:dre}=Tn;function qs(e){return t=>{var n;if(!(t instanceof Error))throw t;e({message:XX(t)?((n=t.response)==null?void 0:n.data.message)??t.message:t.message,severity:"error"})}}function ov(){return te.useContext(By).notify}function ZX(){const e=ov();return te.useCallback(t=>{qs(e)(t)},[e])}const eZ=({create:e=!1})=>{const[t,n]=te.useState(),{id:r}=xB(),{t:o}=Nn(),s=ov(),l=yc(),c=Si(),u=Hr("breakpoint","md");Uy(t!=null&&t.exists?o("Edit :model “:label“",{model:c.singular(),label:(t==null?void 0:t.getLabel())||"..."}):o("Create :model",{model:c.singular()})),hJ();const f=kt("cms").getComponent("Breadcrumbs");te.useEffect(()=>{e?n(new c):c.find(r).then(S=>n(S??void 0))},[r,c,e]);const p=te.useCallback(()=>{s(o(":model saved successfully",{model:c.singular()})),t!=null&&t.wasRecentlyCreated&&l(`/${Ke.kebab(c.plural())}/${t.getKey()}`)},[s,l,c,t,o]),m=ZX(),g=te.useMemo(()=>kt("cms").getModelFormProps(t),[t]);return t?y.jsx(Wr,{sx:{p:{xs:1,sm:2,md:3}},children:y.jsxs(xi,{container:!0,children:[y.jsx(xi,{xs:12,children:y.jsx(f,{parts:[{name:c.plural(),href:"/"+Ke.kebab(c.plural())},{name:t.exists?t.getLabel():o("New")}]})}),y.jsx(xi,{xs:12,[u]:6,children:y.jsx(qd,{submitText:o("Save"),...g,item:t,onSuccess:p,onError:m})})]})}):null};function tZ(e){const{setDisplacement:t}=te.useContext(By),n=Sr(),r=Rn(),o=n.spacing(r?3:1),s=e===!1?o:n.spacing(e);te.useEffect(()=>(t(s),()=>{t(o)}),[s,o,t])}function nZ(){return te.useContext(gk).dialog}function iv(){const e=yc(),t=ov(),n=nZ(),{t:r}=Nn(),{refresh:o}=bc();return{navigate:e,notify:t,dialog:n,t:r,refresh:o}}const rZ=ce(hy)(({theme:e})=>({position:"fixed",bottom:e.spacing(2),right:e.spacing(2)})),oZ=ce(MG)(({theme:e})=>({position:"fixed",bottom:e.spacing(2),right:e.spacing(2)})),iZ=({variant:e="default"})=>{const t=Si(),n=Rn(),[r]=Ro(),o=r.get("tab")??"all",[s,l]=te.useState(!1),c=te.useRef(null),[u,f]=te.useState(0),p=iv(),m=te.useMemo(()=>kt("cms").getStaticActions(t,o),[t,o]);if(tZ(e==="fab"&&m.length>0?n?12:10:!1),m.length===0)return null;const g=(v,x)=>{f(x),l(!1)},S=()=>{l(v=>!v)},w=v=>{c.current&&c.current.contains(v.target)||l(!1)};return e==="fab"?m.length===1?bs.createPortal(y.jsx(rZ,{color:"primary",onClick:()=>m[0].callback(p),children:m[0].icon||m[0].label.charAt(0).toUpperCase()}),document.body):bs.createPortal(y.jsx(oZ,{ariaLabel:`actions for ${t.singular()}`,icon:y.jsx(JE,{}),color:"primary",onClose:()=>l(!1),onOpen:()=>l(!0),open:s,children:m.map(v=>y.jsx(GG,{icon:v.icon||v.label.charAt(0).toUpperCase(),tooltipTitle:v.label,onClick:()=>v.callback(p)},v.label))}),document.body):y.jsxs(y.Fragment,{children:[y.jsxs(DH,{variant:"contained",ref:c,"aria-label":m[u].label,children:[y.jsx(ar,{onClick:()=>m[u].callback(p),children:m[u].label}),m.length>1&&y.jsx(ar,{variant:"contained",size:"small","aria-controls":s?"split-button-menu":void 0,"aria-expanded":s?"true":void 0,"aria-label":`select ${t.singular()} actions`,"aria-haspopup":"menu",onClick:S,children:y.jsx(bk,{})})]}),y.jsx(Qc,{open:s,anchorEl:c.current,role:void 0,transition:!0,children:({TransitionProps:v,placement:x})=>y.jsx(tl,{...v,style:{transformOrigin:x==="bottom"?"center top":"center bottom"},children:y.jsx(io,{children:y.jsx(aE,{onClickAway:w,children:y.jsx(kE,{id:"split-button-menu",children:m.map((R,k)=>y.jsx(Gi,{selected:k===u,onClick:O=>g(O,k),children:R.label},R.label))})})})})})]})};function sv(){const{open:e,setOpen:t}=te.useContext(Jo);return{open:e,handleDrawerOpen:()=>{t(!0)},handleDrawerClose:()=>{t(!1)},toggle:()=>{t(s=>!s)}}}function lP(){const{currentPage:e}=te.useContext(Jo);return e}function cP(){const{showSearch:e}=te.useContext(Jo);return e}function uP(){const{showBackButton:e}=te.useContext(Jo);return e}const sZ=ce(xR,{shouldForwardProp:e=>!["open","drawerWidth","height"].includes(String(e))})(({theme:e,open:t,drawerWidth:n,height:r})=>({zIndex:e.zIndex.drawer+1,transition:e.transitions.create(["width","margin"],{easing:e.transitions.easing.sharp,duration:e.transitions.duration.leavingScreen}),height:r,...t&&{marginLeft:n,width:`calc(100% - ${n}px)`,transition:e.transitions.create(["width","margin"],{easing:e.transitions.easing.sharp,duration:e.transitions.duration.enteringScreen})}})),aZ=ce(xR,{shouldForwardProp:e=>!["open","drawerWidth","height"].includes(String(e))})(({height:e})=>({height:e})),lZ=({slots:e={},...t})=>{const n=Rn(),r=n?sZ:aZ,{["Layout.AppBar.MenuButton"]:o,["Layout.SearchBar"]:s,["Layout.BackButton"]:l,["Layout.AppLogo"]:c}=kt("cms").getComponents(),{open:u}=sv(),f=cP(),p=uP(),m=Hr("appBar.height"),g=Hr("drawer.width",280),{start:S=null,end:w=null}=e,v=lP();return y.jsx(r,{open:u,height:m,drawerWidth:g,...t,children:y.jsxs(QQ,{children:[(n&&!u||!n&&!p)&&y.jsx(o,{}),!n&&p&&y.jsx(l,{}),n?null:S,y.jsx(bn,{width:"100%",variant:"h6",noWrap:!0,component:"div",children:!n&&v||_i("app.name",document.title)}),y.jsx(Wr,{sx:{flexGrow:1}}),y.jsxs(Wr,{display:"flex",alignItems:"center",children:[f&&y.jsx(s,{}),w||y.jsx(c,{})]})]})})};function cZ(e){return y.jsx(Vn,{component:Hd,to:-1,edge:"start",color:"inherit","aria-label":"back",...e,children:y.jsx(qf,{})})}const dP=(e,t)=>({width:t,transition:e.transitions.create("width",{easing:e.transitions.easing.sharp,duration:e.transitions.duration.enteringScreen}),overflowX:"hidden"}),fP=e=>({transition:e.transitions.create("width",{easing:e.transitions.easing.sharp,duration:e.transitions.duration.leavingScreen}),overflowX:"hidden",width:`calc(${e.spacing(9)} + 1px)`,[e.breakpoints.up("sm")]:{width:`calc(${e.spacing(10)} + 1px)`}}),uZ=ce(mE,{shouldForwardProp:e=>!["open","width"].includes(String(e))})(({theme:e,open:t,width:n})=>({flexShrink:0,whiteSpace:"nowrap",boxSizing:"border-box",...t&&{...dP(e,n),"& .MuiDrawer-paper":dP(e,n)},...!t&&{...fP(e),"& .MuiDrawer-paper":fP(e)}})),dZ=ce(mE,{shouldForwardProp:e=>e!=="width"})(()=>({})),fZ=ce("div")(({theme:e})=>({display:"flex",alignItems:"center",justifyContent:"space-between",padding:e.spacing(0,1),...e.mixins.toolbar})),pZ=e=>{const t=Sr(),n=Rn(),{open:r,handleDrawerClose:o}=sv(),s=n?uZ:dZ,l=Hr("drawer.width",280),c=Hr("appBar.height"),u=kt("cms").getComponent("RecursiveList"),f=kt("cms").getComponent("Layout.Drawer.LogoutButton"),p=kt("cms").getMenuItems();return y.jsxs(s,{variant:n?"permanent":"temporary",open:r,width:l,onClose:o,PaperProps:{sx:{width:l,display:"flex",flexDirection:"column"}},sx:{display:"flex",direction:"flex-column",flexWrap:"nowrap",height:"100%"},...e,children:[y.jsx(fZ,{style:{height:c},children:y.jsx(Vn,{onClick:o,children:t.direction==="ltr"?y.jsx(qf,{}):y.jsx(Gf,{})})}),y.jsx(el,{}),y.jsx(Wr,{sx:{flexGrow:1,overflowY:"auto",overflowX:"hidden"},children:y.jsx(u,{collapsed:!r&&n,items:p,onClick:()=>!n&&o()})}),y.jsx(f,{collapsed:!r&&n})]})},hZ=()=>{const e=lP(),t=Hr("breakpoint","md"),n=uP(),{["Layout.BackButton"]:r}=kt("cms").getComponents();return y.jsxs(io,{sx:{display:{xs:"none",[t]:"flex"},boxShadow:o=>o.shadows[3],py:2,px:3,borderRadius:0,alignItems:"center"},children:[n&&y.jsx(r,{}),y.jsx(bn,{variant:"h5",noWrap:!0,children:e})]})},av=te.createContext({Model:null,anchorEl:null,setAnchorEl:()=>{},columnsFilter:[],setColumnsFilter:()=>{},searchParams:new URLSearchParams,setSearchParams:()=>{},handleApplyFilters:()=>{},clearSearchParams:()=>{},clearFilters:()=>{}}),ul=te.createContext({key:"",type:"",operator:"",value:"",isRelation:!1,setKey:()=>{},setType:()=>{},setOperator:()=>{},setValue:()=>{},setIsRelation:()=>{}}),mZ=e=>{if(!Array.isArray(e))return e;let t;return Me.isEmpty(e)?t="":t=e[0],t},gZ=e=>{if(Array.isArray(e))return e;let t;return Me.isEmpty(e)?t=[]:t=[e,""],t},yZ=async(e,t,n)=>{const r=e.getSchema().relations[t],o=lc().make(r.model),s=o.getSchema().primaryKey,l=[];for(const c of n){const u=await o.where(s,c).first();l.push(u)}return l};function vZ(e,t){const n=kt("filter"),{Model:r,setColumnsFilter:o}=te.useContext(av),[s,l]=te.useState(t.key),[c,u]=te.useState(t.operator),[f,p]=te.useState(t.type),[m,g]=te.useState(t.value),[S,w]=te.useState(t.nullable),[v,x]=te.useState(t.is_relation),R=te.useMemo(()=>n.getFilterableColumns(r),[r]),k=j=>()=>{o(T=>T.filter((M,N)=>N!==j))},O=async j=>{var W;const T=j.target.value,M=R.find(q=>q.key===T),N=(M==null?void 0:M.type)??"text",F=(M==null?void 0:M.nullable)??!1,D=(M==null?void 0:M.is_relation)??!1;u(((W=n.getMatchingOperators(M)[0])==null?void 0:W.key)??"equals"),D&&g([]),x(D),w(F),N!==f&&g(()=>{if(["between","notBetween"].includes(c))return[];switch(n.getInputType(N)){case"number":return 0;case"boolean":return 0;default:return""}}),l(T),p(N)},$=async j=>{const T=j.target.value;c!==T&&g(M=>{switch(T){case"between":case"notBetween":return gZ(M);case"null":case"notNull":return"1";default:return mZ(M)}}),u(T)};return te.useEffect(()=>{o(j=>j.map((M,N)=>e===N?{...M,key:s,operator:c,type:f,value:m,nullable:S,is_relation:v}:M))},[s,c,f,m,S,v]),{columns:R,key:s,setKey:l,operator:c,setOperator:u,type:f,setType:p,value:m,setValue:g,nullable:S,setNullable:w,isRelation:v,setIsRelation:x,handleKey:O,handleOperator:$,handleRemoveColumn:k}}const pP=async(e,t,n)=>{const r=e.getSchema().relations[t].model,{data:o}=await lc().make(r).get(),s=o.all().filter(f=>!n.find(p=>p.getKey()===f.getKey())),l=s.length,c=n.length,u=15;return l+c>u?Wn([...n,...s.slice(0,u-c)]):Wn([...n,...s])},bZ=async(e,t,n="",r)=>{const o=e.getSchema().relations[t],s=lc().make(o.model),l=s.getSchema().primaryKey,{data:c}=await s.searchBy(n).get();return Wn([...r,...c]).unique(l)},xZ=()=>{const e=Rn(),t=Si(),{key:n,value:r,setValue:o}=te.useContext(ul),[s,l]=te.useState(!1),[c,u]=te.useState(""),[f,p]=te.useState(Wn([])),[m,g]=te.useState([]),S=te.useMemo(()=>s&&f.count()===0,[s,f]),w=async(v,x)=>{u(x),Me.isEmpty(x)||p(await bZ(t,n,x,Wn(m)))};return te.useEffect(()=>{r.length>0&&(async()=>g(await yZ(t,n,r)))()},[]),te.useEffect(()=>{let v=!0;if(S)return(async()=>v&&p(await pP(t,n,m)))(),()=>{v=!1}},[S]),te.useEffect(()=>{o(m.map(v=>v.getKey())),Me.isEmpty(c)?(async()=>p(await pP(t,n,m)))():p(Wn([]))},[m]),y.jsx(W9,{sx:{width:e?377:"100%"},open:s,onOpen:()=>{l(!0)},onClose:()=>{l(!1)},value:m,onChange:(v,x)=>{g(x)},inputValue:c,onInputChange:w,options:f.all()||[],getOptionLabel:v=>v.getLabel(),isOptionEqualToValue:(v,x)=>v.getKey()===x.getKey(),filterOptions:v=>v,renderInput:v=>y.jsx(wZ,{params:v,loading:S}),size:"small",loading:S,disableCloseOnSelect:!0,autoHighlight:!0,multiple:!0})},wZ=({params:e,loading:t})=>{const{t:n}=Nn();return y.jsx(sl,{...e,label:n("Value"),InputProps:{...e.InputProps,endAdornment:y.jsxs(te.Fragment,{children:[t?y.jsx(l7,{color:"inherit",size:20}):null,e.InputProps.endAdornment]})}})},lv=({index:e=null})=>{const{t}=Nn(),n=Rn(),r=kt("filter"),{type:o,value:s,setValue:l}=te.useContext(ul),u=r.getInputType(o)==="datetime-local"?230:167.5,f=e!==null?`${t("Date")} ${e+1}`:`${t("Date")}`,p=te.useMemo(()=>e!==null?s[e]:s,[s]),m=g=>{l(typeof e=="number"?S=>{const w=S;return w[e]=g.target.value,[...w]}:g.target.value)};return y.jsx(sl,{type:r.getInputType(o),label:f,value:sc.toDateTimeLocal(sc.parse(p)),onChange:m,size:"small",sx:{width:n?u:"100%"}})},SZ=()=>{const e=Rn(),{value:t,setValue:n}=te.useContext(ul),r=o=>{const s=o.target.checked;n(s?1:0)};return y.jsxs(y.Fragment,{children:[y.jsx(aQ,{checked:t,onChange:r,inputProps:{"aria-label":"filter-controlled"},size:"small"}),e&&y.jsx(Wr,{width:325})]})},cv=({index:e=null})=>{const{t}=Nn(),n=Rn(),r=kt("filter"),{type:o,value:s,setValue:l}=te.useContext(ul),c=e!==null?`${t("Value")} ${e+1}`:`${t("Value")}`,u=te.useMemo(()=>e!==null?s[e]:s,[s]),f=p=>{l(typeof e=="number"?m=>{const g=m;return g[e]=p.target.value,[...g]}:p.target.value)};return y.jsx(sl,{type:r.getInputType(o),label:c,value:u||"",onChange:f,sx:{width:n?167.5:"100%"},size:"small"})},uv=()=>{const e=Rn(),t=kt("filter"),{type:n,operator:r}=te.useContext(ul),o=te.useMemo(()=>["between","notBetween"].includes(r),[r]);if(["null","notNull"].includes(r))return e?y.jsx(Wr,{width:230}):null;if(o)switch(t.getInputType(n)){case"date":case"datetime-local":return y.jsxs(y.Fragment,{children:[y.jsx(lv,{index:0}),y.jsx(lv,{index:1})]});default:return y.jsxs(y.Fragment,{children:[y.jsx(cv,{index:0}),y.jsx(cv,{index:1})]})}switch(t.getInputType(n)){case"date":case"datetime-local":return y.jsx(lv,{});case"autocomplete":return y.jsx(xZ,{});case"boolean":return y.jsx(SZ,{});default:return y.jsx(cv,{})}},CZ=({index:e,column:t})=>{const{t:n}=Nn(),r=Rn(),o=Hr("breakpoint","md"),s=kt("filter"),l=te.useMemo(()=>s.getMatchingOperators(t),[t]),{columns:c,key:u,setKey:f,operator:p,setOperator:m,type:g,setType:S,value:w,setValue:v,isRelation:x,setIsRelation:R,handleKey:k,handleOperator:O,handleRemoveColumn:$}=vZ(e,t),j=["boolean"].includes(s.getInputType(g));return y.jsx(ul.Provider,{value:{key:u,setKey:f,type:g,setType:S,operator:p,setOperator:m,value:w,setValue:v,isRelation:x,setIsRelation:R},children:y.jsxs(xi,{container:!0,display:"flex",flexDirection:{xs:"column",[o]:"row"},flexWrap:{xs:"wrap",[o]:"nowrap"},alignItems:"center",justifyContent:"space-between",gap:.5,children:[y.jsxs(lr,{display:"flex",flexDirection:{xs:"column",[o]:"row"},alignItems:"center",width:"100%",my:1,gap:1.5,children:[y.jsxs(lr,{direction:"row",alignItems:"center",...!r&&{width:"100%"},gap:1,children:[y.jsxs(Df,{sx:{width:r?195:`calc(100% - ${j?88:44}px)`},children:[y.jsx(Ff,{id:"filter-column-select-label",size:"small",children:n("Column")}),y.jsx(ol,{labelId:"filter-column-select-label",id:"filter-column-select",value:u,label:n("Column"),onChange:k,size:"small",children:c.map(({key:T,label:M})=>y.jsx(Gi,{value:T,children:n(M)},`column_${T}_option`))})]}),!r&&y.jsxs(lr,{direction:"row",alignItems:"center",children:[j&&y.jsx(uv,{}),y.jsx(Vn,{color:"error",onClick:$(e),children:y.jsx(Ny,{})})]})]}),!x&&!j&&y.jsxs(Df,{sx:{width:r?147.5:"100%"},children:[y.jsx(Ff,{id:"filter-operator-select-label",size:"small",children:n("Operator")}),y.jsx(ol,{labelId:"filter-operator-select-label",id:"filter-operator-select",value:p,label:n("Operator"),onChange:O,size:"small",children:l.map(({key:T,label:M})=>y.jsx(Gi,{value:T,children:n(M)},`operator_${T}_option`))})]}),r?y.jsx(uv,{}):!j&&y.jsx(uv,{})]},`filter_${u}_${e}`),r&&y.jsx(Vn,{color:"error",onClick:$(e),children:y.jsx(Ny,{})})]})})},hP=({dialog:e=!1})=>{const{t}=Nn(),n=Rn(),r=Hr("breakpoint","md"),o=kt("filter"),{columnsFilter:s,setColumnsFilter:l,handleApplyFilters:c,clearFilters:u}=te.useContext(av),f=()=>{l(p=>[...p,{key:"",operator:"contains",type:"text",value:"",appended:!1,nullable:!1,is_relation:!1}])};return y.jsxs(Wr,{sx:{minWidth:{[r]:567.5},p:e?0:2},children:[y.jsx(lr,{children:s.map((p,m,g)=>{const S=m==g.length-1;return y.jsxs(y.Fragment,{children:[y.jsx(CZ,{index:m,column:p},`row_${p.key}`),!n&&y.jsx(el,{sx:{mt:S?.625:1.25,mb:S?.75:1.5,...S&&{border:"none"}}})]})})}),y.jsx(lr,{direction:"row",alignItems:"center",justifyContent:"center",children:n?y.jsx(ar,{variant:"outlined",onClick:f,fullWidth:!0,sx:{mt:.75},children:`+ ${t("Add Column")}`}):y.jsx(Vn,{onClick:f,color:"primary",sx:{fontSize:32},children:y.jsx(yk,{fontSize:"inherit"})})}),n&&y.jsxs(lr,{direction:"row",justifyContent:"space-between",mt:2,children:[y.jsx(ar,{onClick:u,children:t("Clear")}),y.jsx(ar,{variant:"contained",onClick:c,disabled:o.checkIfCanApplyFilters(s),children:t("Apply")})]})]})};function RZ(e,t){const n=[],r=js.toObject(t);return!("where"in r)||Me.isEmpty(r.where)?[]:(Object.entries(r.where).forEach(([o,s])=>{let[l,c="equals"]=o.split(":");const u=e.find(p=>p.key===l);if(!u)return;c==="equals"&&u.is_relation&&(c="relation");let f=s;switch(u.type){case"text":{Array.isArray(s)&&(f=s.join(","));break}case"datetime-local":{Array.isArray(s)?f=s.map(p=>sc.toDateTimeLocal(p)):f=sc.toDateTimeLocal(s);break}case"boolean":{f=Number(s);break}}n.push({key:u.key,operator:c,type:u.type,value:f,nullable:u.nullable,is_relation:u.is_relation})}),n)}const EZ=e=>{const t=kt("filter"),n=new URLSearchParams;return e.forEach(r=>{const{key:o,operator:s,value:l,type:c}=r;let u=`:${s}`;if(["equals"].includes(s)&&(u=""),Array.isArray(l))l.forEach((f,p)=>{let m=f;switch(t.getInputType(c)){case"datetime-local":{m=new Date(f).toISOString();break}}n.set(`where[${o}${u}][${p}]`,m)});else{let f=l;switch(t.getInputType(c)){case"datetime-local":{f=new Date(l).toISOString();break}}n.set(`where[${o}${u}]`,f)}}),n},kZ=()=>{const{t:e}=Nn(),t=kt("filter"),n=Rn(),r=Si(),[o,s]=Ro(),l=te.useMemo(()=>"where"in js.toObject(o),[o]),[c,u]=te.useState(null),[f,p]=te.useState([]),m=!!c,g=te.useMemo(()=>t.getFilterableColumns(r),[r]),S=k=>{u(k.currentTarget)},w=()=>{u(null),setTimeout(()=>{p([])},300)},v=()=>{x();const k=EZ(f);s(k,{replace:!0}),w()},x=()=>{s(k=>{const O=new URLSearchParams(k);for(const[$]of k.entries())$.startsWith("where[")&&O.delete($);return O})},R=()=>{x(),w(),setTimeout(()=>{p([])},300)};return te.useEffect(()=>{const k=RZ(g,o);p(k)},[g,o,c]),y.jsxs(av.Provider,{value:{Model:r,anchorEl:c,setAnchorEl:u,columnsFilter:f,setColumnsFilter:p,searchParams:o,setSearchParams:s,handleApplyFilters:v,clearSearchParams:x,clearFilters:R},children:[y.jsx(Vn,{"aria-describedby":"model-filter-popover-button","aria-label":"filter",onClick:S,children:y.jsx(ry,{color:"secondary",variant:"dot",invisible:!l,children:y.jsx(Ck,{})})}),n?y.jsx(jE,{id:"model-filter-popover",open:m,anchorEl:c,onClose:w,anchorOrigin:{vertical:"bottom",horizontal:"left"},children:y.jsx(hP,{})}):y.jsxs(uy,{open:m,onClose:w,fullWidth:!0,children:[y.jsxs(py,{children:[e("Filter :model",{model:r.plural()}),y.jsx(Vn,{onClick:w,sx:{position:"absolute",right:8,top:8},children:y.jsx(Qf,{})})]}),y.jsx(fy,{dividers:!0,children:y.jsx(hP,{dialog:!0})}),y.jsxs(dy,{children:[y.jsx(ar,{onClick:R,sx:{mr:"auto"},children:e("Clear")}),y.jsx(ar,{variant:"contained",onClick:v,disabled:t.checkIfCanApplyFilters(f),children:e("Apply")})]})]})]})},dv=te.createContext({columns:[],columnCount:0,selected:Wn([]),massActions:[],items:Wn([]),error:new Error("Trying to access TableContext outside of TableProvider"),Model:null});function fv(){const{selected:e,items:t}=te.useContext(dv),n=Jm(e),r=()=>{e.splice(0,e.count())},o=f=>{const p=e.search(f);if(p!==!1){e.pull(p);return}e.push(f)},s=()=>{if(t){if(e.count()===t.count()){r();return}e.splice(0,e.count(),...t)}},l=f=>n.contains(f),c=t?n.count()>0&&n.count()<t.count():!1,u=t&&t.count()?n.count()===t.count():!1;return{selected:n,indeterminate:c,allSelected:u,isSelected:l,handleClearSelected:r,handleSelectToggle:o,handleSelectToggleAll:s}}function Xi(){return te.useContext(dv)}function PZ(e){const[t,n]=te.useState(""),{selected:r}=fv(),{t:o}=Nn(),s=iv(),{massActions:l}=Xi(),c=f=>{n(f.target.value)};if(te.useEffect(()=>{r.isEmpty()&&n("")},[r]),l.length===0)return null;const u=r.isEmpty()?o("Select items to apply"):o("Select action");return y.jsxs(lr,{direction:"row",alignItems:"center",...e,children:[y.jsxs(Df,{sx:{m:1,minWidth:200},size:"small",children:[y.jsx(Ff,{id:"mass-actions-select-label",children:u}),y.jsxs(ol,{labelId:"mass-actions-select-label",id:"mass-actions-select",value:t,label:u,onChange:c,disabled:r.isEmpty(),children:[y.jsx(Gi,{value:"",children:y.jsx("em",{children:o("None")})}),l.map(f=>y.jsx(Gi,{value:f.key,children:f.label},f.key))]})]}),y.jsx(ar,{size:"small",disabled:r.isEmpty()||!t,onClick:()=>{var f;(f=l.find(p=>p.key===t))==null||f.callback({selected:r,...s})},children:o("Apply")})]})}const OZ=()=>{const{handleDrawerOpen:e}=sv();return y.jsx(Vn,{color:"inherit","aria-label":"open drawer",edge:"start",onClick:e,sx:{mr:{md:2}},children:y.jsx(kk,{})})},ap=te.forwardRef(({to:e,children:t,...n},r)=>y.jsx(xy,{component:Hd,to:e,ref:r,sx:{textDecoration:"none"},...n,children:t}));ap.displayName="Link";const TZ=({label:e})=>{if(isNaN(e)||isNaN(parseFloat(e))){const t={"« Previous":y.jsx(qf,{}),"Next »":y.jsx(Gf,{}),"Last »":y.jsx(Ek,{}),"« First":y.jsx(Rk,{})};return y.jsx(y.Fragment,{children:t[e]||e})}return y.jsx(y.Fragment,{children:e})},$Z=({variant:e="default",...t})=>{const n=e==="default",[r,o]=Ro(),[s,l]=te.useState(r.get("page")||"1"),{links:c,meta:{current_page:u=1,links:f=[],last_page:p=1}={}}=bc(),{first:m,prev:g,next:S,last:w}=c||{},v=R=>{R.preventDefault(),o(k=>(k.set("page",s||"1"),k))},x=[{url:u>1?m:null,label:"« First",active:!1},{url:g,label:"« Previous",active:!1},{element:y.jsx(a4,{onSubmit:v,preventScrollReset:!0,children:y.jsx(sl,{size:"small",type:"number",variant:"standard",sx:{width:56,"& input":{textAlign:"center","&::-webkit-outer-spin-button, &::-webkit-inner-spin-button":{WebkitAppearance:"none",margin:0}}},value:s,error:Number(s)>p,helperText:Number(s)>p?`Max ${p}`:void 0,onChange:R=>{!Number.isNaN(Number(R.target.value))&&Number(R.target.value)>0&&l(R.target.value),R.target.value===""&&l("")},onBlur:R=>{o(k=>(k.set("page",R.target.value||"1"),k),{replace:!0})},disabled:p===1,"aria-label":"Page number"})},"page")},{url:S,label:"Next »",active:!1},{url:u<p?w:null,label:"Last »",active:!1}];return te.useEffect(()=>{u&&l(String(u))},[u]),y.jsx(lr,{spacing:1,direction:"row",justifyContent:"center",alignItems:"center",...t,children:(n?f:x).map((R,k)=>R.element||y.jsx(ar,{variant:R.active?"contained":"text",color:"primary",size:"small",sx:{minWidth:"unset",width:32,height:32,borderRadius:"50%"},disabled:!R.url,component:ap,to:R.url,children:y.jsx(TZ,{label:R.label})},k))})},jZ=()=>{const{t:e}=Nn(),{meta:{total:t=0,from:n=0,to:r=0}={}}=bc();return y.jsx(bn,{variant:"caption",noWrap:!0,children:e(":from–:to of :total",{from:n,to:r,total:t})})},AZ=()=>{const{t:e}=Nn(),{meta:{per_page:t=15}={}}=bc(),[,n]=Ro(),r=s=>{n(l=>{const c=new URLSearchParams(l);return c.set("per_page",s.target.value.toString()),c})},o=Xm(kt("cms"),"perPageOptions",[15,30,75,150]);return y.jsxs(lr,{direction:"row",alignItems:"center",gap:1,children:[y.jsxs(bn,{variant:"caption",children:[e("Rows per page"),":"]}),y.jsx(ol,{value:t,onChange:r,size:"small",variant:"standard",sx:{fontSize:s=>s.typography.caption.fontSize,"& .MuiSelect-select":{py:.5}},children:o.map(s=>y.jsx(Gi,{value:s,sx:{fontSize:l=>l.typography.caption.fontSize,minHeight:"unset",lineHeight:1,py:1.5},children:s},s))})]})};function MZ(e,t){const[n,r]=te.useState(!1);return te.useEffect(()=>{const o=new Set,s=c=>{o.add(c.key),e.every(u=>o.has(u))&&(r(!0),t&&t())},l=c=>{o.delete(c.key),e.every(u=>!o.has(u))&&r(!1)};return window.addEventListener("keydown",s),window.addEventListener("keyup",l),()=>{window.removeEventListener("keydown",s),window.removeEventListener("keyup",l)}},[e,t]),n}const _Z=ce(sl)(({theme:e})=>({"& .MuiInputBase-root":{backgroundColor:e.palette.background.paper}})),IZ=Rm.throttle((e,t)=>{t(n=>{const r=new URLSearchParams(n);return e?r.set("q",e):r.delete("q"),r})},500),LZ=()=>{const[e,t]=Ro(),n=e.get("q")||"",[r,o]=te.useState(n),[s,l]=te.useState(!1),c=te.useRef(null),{t:u}=Nn();te.useEffect(()=>{o(n)},[n]);const f=g=>{o(g.target.value),IZ(g.target.value,t)},p=Rn();MZ(["Control","/"],()=>{c.current.focus()});const m=p?300:"calc(100vw - 58px)";return y.jsxs(y.Fragment,{children:[!p&&!s&&y.jsx(Vn,{color:"inherit",onClick:()=>l(!0),children:y.jsx(ry,{variant:"dot",color:"secondary",invisible:!n,anchorOrigin:{vertical:"bottom",horizontal:"left"},children:y.jsx(Fy,{})})}),y.jsx(Fg,{orientation:"horizontal",in:p||s,addEndListener:()=>{var g;!p&&s&&((g=c.current)==null||g.focus())},unmountOnExit:!1,children:y.jsx(_Z,{placeholder:p?`(Ctrl + /) ${u("Search...")}`:`${u("Search...")}`,value:r,InputProps:{endAdornment:y.jsx(Fy,{})},inputProps:{ref:c},onChange:f,onBlur:()=>l(!1),sx:{width:m},size:"small"})})]})},NZ=({children:e,...t})=>y.jsx(wi,{sx:{width:"1px"},padding:"checkbox",...t,children:e}),DZ=()=>{const{t:e}=Nn(),[t,n]=Ro(),{columns:r,Model:o}=Xi(),s=t.get("order_by")||"",[l="",c=""]=s.split(":"),[u,f]=te.useState(l),[p,m]=te.useState(c),[g,S]=te.useState(!1),w=()=>{S(!0)},v=()=>{S(!1),f(l),m(c)},x=()=>{if(!u||!p){S(!1);return}n(k=>{const O=new URLSearchParams(k);return O.set("order_by",`${u}:${p}`),O}),S(!1)},R=()=>{n(k=>{const O=new URLSearchParams(k);return O.delete("order_by"),O}),S(!1),f(""),m("")};return y.jsxs(y.Fragment,{children:[y.jsx(Vn,{onClick:w,children:y.jsx(ry,{color:"secondary",variant:"dot",invisible:!l,children:y.jsx(Pk,{})})}),y.jsxs(uy,{open:g,onClose:v,fullWidth:!0,children:[y.jsxs(py,{children:[e("Sort :model",{model:o.plural()}),y.jsx(Vn,{onClick:v,sx:{position:"absolute",right:8,top:8},children:y.jsx(Qf,{})})]}),y.jsxs(fy,{dividers:!0,children:[y.jsxs(BE,{value:u,onChange:k=>{f(k.target.value),p||m("asc")},children:[y.jsx(bn,{variant:"caption",children:e("Column")}),y.jsx(el,{}),Wn(r).whereStrict("sortable","!=",!1).map(({key:k,label:O})=>y.jsx(gy,{value:k,control:y.jsx(Ty,{}),label:O},k))]}),y.jsx(bn,{variant:"caption",children:e("Direction")}),y.jsx(el,{}),y.jsxs(BE,{value:p,onChange:k=>m(k.target.value),children:[y.jsx(gy,{value:"asc",control:y.jsx(Ty,{}),label:y.jsxs(y.Fragment,{children:[e("Ascending"),y.jsx(xk,{})]})}),y.jsx(gy,{value:"desc",control:y.jsx(Ty,{}),label:y.jsxs(y.Fragment,{children:[e("Descending"),y.jsx(vk,{})]})})]})]}),y.jsxs(dy,{children:[y.jsx(ar,{onClick:R,sx:{mr:"auto"},children:e("Clear")}),y.jsx(ar,{onClick:x,variant:"contained",children:e("Apply")})]})]})]})},FZ=({items:e,loading:t,children:n,error:r})=>{const o=Si(),s=te.useMemo(()=>Wn([]),[o,e]),[l]=Ro(),c=l.get("tab")??"all",u=te.useMemo(()=>[{key:o.getSchema().labeledBy,label:Ke.human(o.getSchema().labeledBy)}],[o]),f=Rn(),p=te.useMemo(()=>kt("cms").getMassActions(o,c),[o,c]),m=Xm(kt("cms"),`model${Ke.studly(o.getSchemaName())}Columns`,u),S=(f?m.length:1)+(p.length>0?2:1),w={columns:m,columnCount:S,massActions:p,items:e,loading:t,selected:s,error:r,Model:o};return y.jsx(dv.Provider,{value:w,children:n})},BZ=({items:e,loading:t,error:n,children:r,...o})=>y.jsx(FZ,{items:e,loading:t,error:n,children:y.jsx(AQ,{component:io,children:y.jsx(gQ,{...o,children:r})})}),zZ=({children:e,...t})=>{const{massActions:n,columns:r,items:o}=Xi(),s=Rn(),[l,c]=Ro(),{indeterminate:u,allSelected:f,handleSelectToggleAll:p}=fv(),{["ModelIndex.Table.ShrinkedCell"]:m}=kt("cms").getComponents(),g=l.get("order_by")||"",[S,w]=g.split(":"),v=x=>()=>{c(S===x?R=>{const k=new URLSearchParams(R);return w?w==="desc"?(k.delete("order_by"),k):(k.set("order_by",`${x}:desc`),k):(k.set("order_by",`${x}:asc`),k)}:R=>{const k=new URLSearchParams(R);return k.set("order_by",`${x}:asc`),k})};return y.jsxs(HQ,{...t,children:[e,s&&y.jsxs(il,{children:[n.length>0&&y.jsx(m,{children:y.jsx(sy,{indeterminate:u,checked:f,onChange:p,disabled:o&&o.count()===0})}),r.map(({key:x,label:R,sortable:k=!0,...O})=>y.jsx(wi,{sortDirection:k&&S===x&&w||!1,...O,children:y.jsxs(lY,{active:k&&S===x,direction:w,onClick:v(x),children:[R,k&&S===x?y.jsx(Wr,{component:"span",sx:{visibility:"hidden",display:"none"},children:w==="desc"?"sorted descending":"sorted ascending"}):null]})},x)),y.jsx(m,{})]})]})},UZ=()=>{const{massActions:e,columns:t,items:n}=Xi(),r=Rn(),{["ModelIndex.Table.ShrinkedCell"]:o}=kt("cms").getComponents(),s=(n==null?void 0:n.count())||15;return y.jsx(y.Fragment,{children:Array.from({length:s}).map((l,c)=>y.jsxs(il,{children:[e.length>0&&y.jsx(o,{children:y.jsx(sy,{})}),r&&t.map(({key:u,label:f,sortable:p,...m},g)=>y.jsx(wi,{...m,children:y.jsx(qE,{variant:"text",height:24})},g)),!r&&y.jsx(wi,{sx:{px:0},children:Array.from({length:t.length}).map((u,f)=>y.jsx(qE,{variant:"text",width:"100%",height:24},f))}),y.jsx(o,{children:y.jsx(Vn,{children:y.jsx(Dy,{})})})]},c))})},WZ=({children:e,...t})=>{const n=Si(),{t:r}=Nn(),{items:o,loading:s,columnCount:l}=Xi(),{["ModelIndex.StaticActions"]:c}=kt("cms").getComponents(),u=te.isValidElement(e)?e:(o||Wn([])).map(e);return y.jsx(SQ,{...t,children:s||!(o!=null&&o.every(f=>f.getType()===n.getSchemaName()))?y.jsx(UZ,{}):o&&o.count()?u:y.jsx(il,{children:y.jsxs(wi,{colSpan:l,sx:{textAlign:"center",py:10},children:[y.jsx(bn,{children:r("No :model found",{model:n.plural().toLocaleLowerCase()})}),y.jsx("br",{}),y.jsx(c,{})]})})})};class HZ{getFacadeAccessor(){return"cms"}}const dr=So(HZ,_r),dl=ce(bn)(()=>({whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis","& label":{fontWeight:"bold"}})),VZ=({content:e})=>["string","number"].includes(typeof e)?y.jsx(dl,{children:e}):e instanceof Date?y.jsx(dl,{children:e.toLocaleString(_i("app.locale","en"))}):typeof e=="object"&&!te.isValidElement(e)?y.jsx(dl,{children:JSON.stringify(e)}):y.jsx(te.Fragment,{children:e}),KZ=({label:e,content:t})=>["string","number"].includes(typeof t)?y.jsxs(dl,{children:[y.jsxs("label",{children:[e,":"]})," ",t]}):t instanceof Date?y.jsxs(dl,{children:[y.jsxs("label",{children:[e,":"]}),t.toLocaleString(_i("app.locale","en"))]}):typeof t=="object"&&!te.isValidElement(t)?y.jsxs(dl,{children:[y.jsxs("label",{children:[e,":"]})," ",JSON.stringify(t)]}):y.jsxs(te.Fragment,{children:[y.jsx(bn,{sx:{display:"inline"},children:y.jsxs("b",{children:[e,":"]})})," ",t]}),qZ=({item:e,...t})=>{const n=Rn(),r=yc(),o=Si(),{massActions:s,columns:l}=Xi(),c=te.useMemo(()=>l.map(g=>({...g,content:dr[`model${Ke.studly(e.getType())}Get${Ke.studly(g.key)}Content`](Me.get(e,g.key),e)})),[l,e]),{["ModelIndex.Table.ShrinkedCell"]:u,["ModelIndex.InstanceActions"]:f}=dr.getComponents(),{isSelected:p,handleSelectToggle:m}=fv();return y.jsxs(il,{...t,sx:{cursor:e.deletedAt?"default":"pointer"},selected:p(e),hover:!e.deletedAt,children:[s.length>0&&y.jsx(u,{children:y.jsx(sy,{checked:p(e),onChange:()=>m(e)})}),n&&c.map(({key:g,label:S,sortable:w,content:v,...x})=>y.jsx(wi,{...x,onClick:()=>{e.deletedAt||r(`/${Ke.kebab(o.plural())}/${e.getKey()}`)},children:y.jsx(VZ,{label:S,content:v})},g)),!n&&y.jsx(wi,{sx:{maxWidth:0,px:0},onClick:()=>{e.deletedAt||r(`/${Ke.kebab(o.plural())}/${e.getKey()}`)},children:c.map(({key:g,...S})=>y.jsx(KZ,{...S},g))}),y.jsx(u,{children:y.jsx(f,{item:e})})]})},GZ=({children:e,...t})=>{const{columnCount:n}=Xi(),r=Rn(),o=Hr("breakpoint","md"),{["ModelIndex.Pagination"]:s,["ModelIndex.PaginationDetails"]:l,["ModelIndex.PerPageSwitch"]:c}=kt("cms").getComponents();return y.jsxs(DQ,{...t,children:[y.jsx(il,{children:y.jsx(wi,{colSpan:n,children:y.jsxs(lr,{direction:r?"row":"column-reverse",alignItems:"center",justifyContent:"space-between",gap:3,children:[y.jsxs(lr,{direction:r?"row":"column-reverse",alignItems:r?"center":"flex-start",justifyContent:"flex-start",width:{xs:"100%",[o]:"auto"},gap:r?2:0,children:[y.jsx(c,{}),y.jsx(l,{})]}),y.jsx(s,{variant:r?"default":"compact",justifyContent:{xs:"center",[o]:"flex-end"}})]})})}),e]})},QZ=()=>{const{columnCount:e}=Xi(),{["ModelIndex.Filter"]:t,["ModelIndex.MassActions"]:n,["ModelIndex.Sort"]:r,["ModelIndex.Pagination"]:o}=kt("cms").getComponents(),s=Rn(),l=Hr("breakpoint","md");return y.jsx(il,{children:y.jsx(wi,{colSpan:e,sx:{p:1},children:y.jsxs(lr,{direction:{xs:"column",[l]:"row"},justifyContent:"space-between",spacing:1,children:[y.jsxs(lr,{direction:"row",alignItems:"center",width:{[l]:"100%"},children:[y.jsx(t,{}),!s&&y.jsx(r,{})]}),s&&y.jsx(lr,{direction:"row",alignItems:"center",justifyContent:{xs:"center",[l]:"flex-end"},rowGap:2,children:y.jsx(o,{variant:"compact",justifyContent:"end"})}),y.jsx(n,{})]})})})};function YZ(){const e=Si(),{t}=Nn(),[n,r]=Ro(),o=n.get("tab")||"all",s=(u,f)=>{r(()=>{const p=new URLSearchParams;return f!=="all"&&p.set("tab",f),p})},l=te.useMemo(()=>e.getSchema().softDeletes?[{label:t("Trashed"),value:"trashed"}]:[],[e,t]),c=Xm(kt("cms"),`model${Ke.studly(e.getSchemaName())}Tabs`,l);return c.length===0?null:y.jsx(Wr,{sx:{maxWidth:{xs:320,sm:480},bgcolor:"background.paper"},children:y.jsxs(OY,{value:o,onChange:s,variant:"scrollable",scrollButtons:"auto","aria-label":`tabs for ${e.singular()}`,allowScrollButtonsMobile:!0,children:[y.jsx(XE,{label:t("All"),value:"all"}),c.map(u=>y.jsx(XE,{label:u.label,value:u.value},u.value))]})})}function JZ(e){const{parts:t,...n}=e;return y.jsxs(kH,{"aria-label":"breadcrumb",...n,children:[y.jsx(xy,{underline:"hover",color:"inherit",to:"/",component:Hd,children:_i("app.name","Laravel")}),t==null?void 0:t.map(({name:r,href:o},s)=>o?y.jsx(xy,{underline:"hover",color:"inherit",to:o,component:Hd,children:r},s):y.jsx(bn,{color:"text.primary",children:r},s))]})}const mP=({collapsed:e=!1,items:t,onClick:n,...r})=>{const[o,s]=te.useState(null),[l,c]=te.useState(null),[u,f]=te.useState({}),p=Hr("drawer.width",280),m=kt("cms").getComponent("RecursiveMenu");return y.jsxs(wy,{...r,children:[t.map(g=>{const{text:S,icon:w,element:v=null,key:x,children:R,to:k,onClick:O}=g;return v?y.jsx(te.Fragment,{children:v},x):y.jsxs(SE,{disablePadding:!0,sx:{display:"block"},children:[y.jsxs(xE,{sx:{minHeight:48,justifyContent:e?"center":"initial",px:2.5},onClick:$=>{if(O&&O($),R){if(e){c(()=>(s($.currentTarget),R));return}f({...u,[x]:!u[x]});return}n&&n($)},...k?{to:k,component:ap}:{},children:[y.jsxs(Sy,{sx:{minWidth:0,mr:e?"unset":3,justifyContent:"center",flexDirection:"column",alignItems:"center",color:"inherit"},children:[w,e&&y.jsx(bn,{fontSize:10,sx:{mt:.5},children:S})]}),!e&&y.jsx(Cy,{primary:S}),!e&&R&&(u[x]?y.jsx(wk,{}):y.jsx(Sk,{}))]}),R&&!e&&y.jsx(Fg,{in:u[x],timeout:"auto",unmountOnExit:!0,children:y.jsx(mP,{items:R,onClick:n,collapsed:e,sx:{pl:e?0:2,pb:0}})})]},x)}),e&&y.jsx(m,{items:l||[],onClick:n,collapsed:!1,sx:{pl:e?0:2,pb:0},anchorEl:o,anchorOrigin:{vertical:"top",horizontal:"right"},onClose:()=>{s(null),c(null)},open:!!o,slotProps:{paper:{sx:{minWidth:p}}}})]})},gP=({collapsed:e=!1,items:t,onClick:n,...r})=>{const[o,s]=te.useState({}),l=Hr("drawer.width",280);return y.jsxs(y.Fragment,{children:[y.jsx(ky,{...r,children:t.map(c=>{const{text:u,icon:f,element:p=null,key:m,children:g,onClick:S,to:w}=c;return p?te.cloneElement(p,{key:m}):y.jsxs(Gi,{onClick:v=>{if(S&&S(v),g){s({...o,[m]:o[m]?null:v.currentTarget});return}n&&n(v)},...w?{component:ap,to:w}:{},children:[f&&y.jsx(Sy,{sx:{minWidth:0,mr:e?"auto":3,justifyContent:"center",color:"inherit"},children:f}),y.jsx(Cy,{sx:{opacity:e?0:1},children:u}),!e&&g&&y.jsx(Gf,{})]},m)})}),t.map(c=>{const{key:u,children:f}=c;return f?y.jsx(gP,{items:f,onClick:n,collapsed:e,sx:{pl:e?0:2,pb:0},open:!!o[u],anchorEl:o[u],anchorOrigin:{vertical:"top",horizontal:"right"},onClose:()=>s({...o,[u]:null}),slotProps:{paper:{sx:{minWidth:l}}}},u):null})]})},pv={delete:e=>async({selected:t,notify:n,dialog:r,refresh:o,t:s})=>{const l=e.getSchema().softDeletes?"send to trash":"delete permanently",c=e.getSchema().softDeletes?"sent to trash":"deleted";if(await r({title:e.getSchema().softDeletes?s("Confirm send to trash"):s("Confirm delete permanently"),message:s(`Are you sure you want to ${l} :count :model?`,{count:t.count(),model:Ke.lcfirst(t.count()===1?e.singular():e.plural())}),type:"confirm"}))try{await e.delete(t.pluck(e.getSchema().primaryKey).all()),n(s(`Successfully ${c} :count :model`,{count:t.count(),model:Ke.lcfirst(t.count()===1?e.singular():e.plural())})),o()}catch(f){qs(n)(f)}},restore:e=>async({selected:t,notify:n,dialog:r,refresh:o,t:s})=>{if(await r({title:s("Confirm restore"),message:s("Are you sure you want to restore :count :model?",{count:t.count(),model:Ke.lcfirst(t.count()===1?e.singular():e.plural())}),type:"confirm"}))try{await e.restore(t.pluck(e.getSchema().primaryKey).all()),n(s("Successfully restored :count :model",{count:t.count(),model:Ke.lcfirst(t.count()===1?e.singular():e.plural())})),o()}catch(c){qs(n)(c)}},forceDelete:e=>async({selected:t,notify:n,dialog:r,refresh:o,t:s})=>{if(await r({title:s("Confirm permanent deletion"),message:s("Are you sure you want to delete permanently :count :model?",{count:t.count(),model:Ke.lcfirst(t.count()===1?e.singular():e.plural())}),type:"confirm"}))try{await e.forceDelete(t.pluck(e.getSchema().primaryKey).all()),n(s("Successfully deleted :count :model",{count:t.count(),model:Ke.lcfirst(t.count()===1?e.singular():e.plural())})),o()}catch(c){qs(n)(c)}}},hv={delete:e=>async({item:t,notify:n,dialog:r,refresh:o,t:s})=>{const l=e.getSchema().softDeletes?"send :model “:label” to trash":"delete :model “:label” permanently",c=e.getSchema().softDeletes?"sent :model “:label” to trash":"deleted :model “:label”";if(await r({title:e.getSchema().softDeletes?s("Confirm send to trash"):s("Confirm permanent deletion"),message:s(`Are you sure you want to ${l}?`,{model:Ke.lcfirst(e.singular()),label:t.getLabel()}),type:"confirm"}))try{await t.delete(),n(s(`Successfully ${c}`,{model:e.singular(),label:t.getLabel()})),o()}catch(f){qs(n)(f)}},restore:e=>async({item:t,notify:n,dialog:r,refresh:o,t:s})=>{if(await r({title:s("Confirm restore"),message:s("Are you sure you want to restore :model “:label”?",{model:Ke.lcfirst(e.singular()),label:t.getLabel()}),type:"confirm"}))try{await t.restore(),n(s("Successfully restored :model “:label”",{model:e.singular(),label:t.getLabel()})),o()}catch(c){qs(n)(c)}},forceDelete:e=>async({item:t,notify:n,dialog:r,refresh:o,t:s})=>{if(await r({title:s("Confirm permanent deletion"),message:s("Are you sure you want to delete :model “:label” permanently?",{model:Ke.lcfirst(e.singular()),label:t.getLabel()}),type:"confirm"}))try{await t.forceDelete(),n(s("Successfully deleted :model “:label”",{model:e.singular(),label:t.getLabel()})),o()}catch(c){qs(n)(c)}}},XZ={create:e=>({navigate:t})=>{t(`/${Ke.kebab(e.plural())}/create`)}};class ZZ{getFacadeAccessor(){return"icon"}}const lp=So(ZZ,_r);class eee{constructor(){Gu(this,"components",{});Gu(this,"logoutCallback",null)}booted(){this.components=this.componentMap({})}getComponents(){return this.components}getComponent(t){return this.getComponents()[t]}getRoutes(){return this.cmsRoutes([],this.getComponents(),lc().make())}getMenuItems(){return this.menuItems([],lc().make())}logoutUsing(t){this.logoutCallback=t}getLogoutCallback(){return this.logoutCallback??(()=>mF().logout())}getModelFormProps(t){return this.wireModelFormProps({},t)}getMassActions(t,n){return this[`mass${Ke.studly(t.getSchemaName())}Actions`](this.massActions([],t,n),t,n)}getInstanceActions(t,n){return this[`instance${Ke.studly(t.getSchemaName())}Actions`](this.instanceActions([],t,n),t,n)}getStaticActions(t,n){return this[`static${Ke.studly(t.getSchemaName())}Actions`](this.staticActions([],t,n),t,n)}}const tee=xa(eee),du=e=>!(typeof e>"u"||e===null||Me.isEmpty(e));class nee{getInputType(t){switch(t){case"int":case"float":case"number":return"number";case"date":return"date";case"datetime":case"timestamp":return"datetime-local";case"autocomplete":return"autocomplete";case"bool":case"boolean":return"boolean";default:return"text"}}getOperators(){return _i("luminix.admin.filter.operators")}getMatchingOperators(t){return this.getOperators().filter(n=>["like"].includes(n)||!t.is_relation&&["relation"].includes(n)||["text"].includes(this.getInputType(t.type))&&["greaterThan","greaterThanOrEquals","lessThan","lessThanOrEquals","between","notBetween"].includes(n)||["number","date","datetime-local","boolean"].includes(this.getInputType(t.type))&&["like","contains","startsWith","endsWith"].includes(n)||!t.nullable&&["null","notNull"].includes(n)?!1:n).map(n=>{let r=n;switch(n){case"equals":r="=";break;case"notEquals":r="!=";break;case"greaterThan":r=">";break;case"greaterThanOrEquals":r=">=";break;case"lessThan":r="<";break;case"lessThanOrEquals":r="<=";break;default:r=Ke.human(r);break}return{key:n,label:r}})}getFilterableColumns(t){const{attributes:n=[],relations:r={}}=t.getSchema(),o=[...n.filter(s=>!s.hidden&&!s.appended&&!s.virtual).map(s=>{let l=s.phpType??"string";return s.cast!==null&&!Me.isEmpty(s.cast)&&(l=s.cast),{key:s.name,label:Ke.human(s.name),type:l,nullable:s.nullable,is_relation:!1}}),...Object.entries(r??{}).reduce((s,[l])=>[...s,{key:l,label:Ke.human(l),type:"autocomplete",nullable:!1,is_relation:!0}],[])];return this.filterableColumns(o,t)}checkIfCanApplyFilters(t){return!!(t.length===0||t.map(r=>{if(!du(r.key)||!du(r.operator))return!0;if(["boolean"].includes(this.getInputType(r.type))){if(typeof r.value>"u"||Me.isNull(r.value))return!0}else if(!du(r.value))return!0;return!!(Array.isArray(r.value)&&["between","notBetween"].includes(r.operator)&&(!du(r.value[0])||!du(r.value[1])))}).includes(!0))}}const ree=xa(nee);class oee{constructor(){Gu(this,"icons",[]);cc.reducer("model",t=>{const n=this;return class extends t{static icon(){return n.render("CategoryOutlined")}}},0)}forModel(t,n){cc.reducer(`model${Ke.studly(t)}`,r=>{const o=this;return class extends r{static icon(){return o.render(n)}}})}registerIcon(t,n){typeof t=="string"&&n?this.icons.push({name:t,component:n}):Object.entries(t).forEach(([r,o])=>{this.icons.push({name:r,component:o})})}make(t){return this.icons.find(n=>n.name===t).component}render(t,n={}){const r=this.make(t);return r?y.jsx(r,{...n}):null}all(){return this.icons.map(t=>t.name)}}const iee=({item:e})=>{const t=iv(),[n]=Ro(),r=n.get("tab")??"all",o=te.useMemo(()=>kt("cms").getInstanceActions(kt("model").make(e.getType()),r),[e,r]),[s,l]=te.useState(null),c=!!s,u=p=>{l(p.currentTarget)},f=()=>{l(null)};return o.length===0?null:y.jsxs(y.Fragment,{children:[y.jsx(Vn,{"aria-describedby":"model-item-actions","aria-label":"filter",onClick:u,children:y.jsx(Dy,{})}),y.jsx(ky,{id:"model-item-actions",anchorEl:s,open:c,onClose:f,MenuListProps:{"aria-labelledby":"model-item-action"},children:o.map(p=>y.jsxs(Gi,{onClick:()=>{p.callback({item:e,...t}),f()},sx:{px:1,gap:.75},children:[p.icon,p.label]},p.label))})]})},see="data:image/png;base64,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",aee="data:image/png;base64,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";function lee(){const e=df("(prefers-color-scheme: dark)"),t=cP();return y.jsx(X9,{src:e?see:aee,alt:"Luminix",variant:"square",sx:{width:40,height:40,marginLeft:t?2:0}})}const cee=({collapsed:e=!1})=>{const t=kt("cms").getLogoutCallback(),{t:n}=Nn(),r=y.jsx(SE,{disablePadding:!0,sx:{display:"block"},children:y.jsxs(xE,{onClick:t,sx:{minHeight:48,justifyContent:e?"center":"initial",px:2.5},children:[y.jsx(Sy,{sx:{minWidth:0,mr:e?"auto":3,justifyContent:"center"},children:y.jsx(nJ,{})}),!e&&y.jsx(Cy,{primary:n("Logout")})]})});return y.jsxs(y.Fragment,{children:[y.jsx(el,{}),y.jsx(wy,{disablePadding:!0,children:e?y.jsx(YE,{title:n("Logout"),placement:"right",children:r}):r})]})},mp=class mp extends Id{register(){this.app.singleton("cms",()=>new tee),this.app.singleton("filter",()=>new ree),this.app.singleton("icon",()=>new oee),this.registerIcons()}boot(){this.bootComponents(),this.bootRoutes(),this.bootMenu(),this.bootMassActions(),this.bootInstanceActions(),this.bootStaticActions(),mp.applyUserDefaults&&this.bootDefaultUserModifiers(),this.app.on("booted",()=>{this.app.make("cms").booted()})}registerIcons(){lp.registerIcon({Add:ZY,AddCircleOutline:yk,ArrowDownward:vk,ArrowDropDown:bk,ArrowUpward:xk,CategoryOutlined:eJ,ChevronLeft:qf,ChevronRight:Gf,Close:Qf,DashboardOutlined:tJ,ExpandLess:wk,ExpandMore:Sk,FilterList:Ck,FirstPage:Rk,HighlightOffOutlined:Ny,LastPage:Ek,Menu:kk,MoreVert:Dy,PeopleOutlined:rJ,Search:Fy,SwapVert:Pk}),lp.forModel("user","PeopleOutlined")}bootRoutes(){dr.reducer("cmsRoutes",aJ,0),Pm.reducer("domRouterOptions",t=>({...t,basename:Ii.get("luminix.admin.url","/admin")}))}bootComponents(){dr.reducer("componentMap",()=>({Layout:dJ,Dashboard:lJ,ModelIndex:pJ,ModelItem:eZ,Error:cJ,DesktopPageTitle:hZ,RecursiveList:mP,RecursiveMenu:gP,Breadcrumbs:JZ,"Layout.AppBar":lZ,"Layout.AppLogo":lee,"Layout.Drawer":pZ,"Layout.Drawer.LogoutButton":cee,"Layout.AppBar.MenuButton":OZ,"Layout.SearchBar":LZ,"Layout.BackButton":cZ,"ModelIndex.Filter":kZ,"ModelIndex.InstanceActions":iee,"ModelIndex.MassActions":PZ,"ModelIndex.Pagination":$Z,"ModelIndex.PaginationDetails":jZ,"ModelIndex.PerPageSwitch":AZ,"ModelIndex.Sort":DZ,"ModelIndex.StaticActions":iZ,"ModelIndex.Table":BZ,"ModelIndex.Table.TableHead":zZ,"ModelIndex.Table.TableBody":WZ,"ModelIndex.Table.TableFooter":GZ,"ModelIndex.Table.TableToolbar":QZ,"ModelIndex.Table.TableBody.TableRow":qZ,"ModelIndex.Table.ShrinkedCell":NZ,"ModelIndex.Tabs":YZ}),0)}bootMenu(){dr.reducer("menuItems",(t,n)=>[...t,{key:"dashboard",text:"Dashboard",to:"/",icon:lp.render("DashboardOutlined")},...Object.entries(n).sort(([r],[o])=>r.localeCompare(o)).map(([r,o])=>({key:r,text:o.plural(),to:"/"+Ke.kebab(o.plural()),icon:o.icon()}))],0)}bootDefaultUserModifiers(){dr.reducer("modelUserColumns",()=>[{key:"name",label:"Name",scope:"row",component:"th"},{key:"email",label:"Email",align:"right",size:"small"},{key:"created_at",label:"Created At",align:"right",size:"small"}],1),dr.reducer("wireModelFormProps",(t,n)=>(n==null?void 0:n.getType())==="user"?{...t,confirmed:"password"}:t)}bootMassActions(){dr.reducer("massActions",(t,n,r)=>{const o=[],{softDeletes:s}=n.getSchema();return r!=="trashed"?o.push({key:"delete",label:s?"Send to trash":"Delete permanently",callback:pv.delete(n)}):(o.push({key:"restore",label:"Restore",callback:pv.restore(n)}),o.push({key:"forceDelete",label:"Delete permanently",callback:pv.forceDelete(n)})),[...t,...o]},0)}bootInstanceActions(){dr.reducer("instanceActions",(t,n,r)=>{const o=[],{softDeletes:s}=n.getSchema();return r!=="trashed"?o.push({label:s?"Send to trash":"Delete permanently",callback:hv.delete(n)}):(o.push({label:"Restore",callback:hv.restore(n)}),o.push({label:"Delete permanently",callback:hv.forceDelete(n)})),[...t,...o]},0)}bootStaticActions(){dr.reducer("staticActions",(t,n,r)=>r==="trashed"?t:[...t,{key:"create",label:`Create ${n.singular()}`,callback:XZ.create(n),icon:lp.render("Add")}],0)}};Gu(mp,"applyUserDefaults",!0);let mv=mp;const uee={type:"logger",log(e){this.output("log",e)},warn(e){this.output("warn",e)},error(e){this.output("error",e)},output(e,t){console&&console[e]&&console[e].apply(console,t)}};class cp{constructor(t){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};this.init(t,n)}init(t){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};this.prefix=n.prefix||"i18next:",this.logger=t||uee,this.options=n,this.debug=n.debug}log(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return this.forward(n,"log","",!0)}warn(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return this.forward(n,"warn","",!0)}error(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return this.forward(n,"error","")}deprecate(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return this.forward(n,"warn","WARNING DEPRECATED: ",!0)}forward(t,n,r,o){return o&&!this.debug?null:(typeof t[0]=="string"&&(t[0]=`${r}${this.prefix} ${t[0]}`),this.logger[n](t))}create(t){return new cp(this.logger,{prefix:`${this.prefix}:${t}:`,...this.options})}clone(t){return t=t||this.options,t.prefix=t.prefix||this.prefix,new cp(this.logger,t)}}var Xo=new cp;class up{constructor(){this.observers={}}on(t,n){return t.split(" ").forEach(r=>{this.observers[r]||(this.observers[r]=new Map);const o=this.observers[r].get(n)||0;this.observers[r].set(n,o+1)}),this}off(t,n){if(this.observers[t]){if(!n){delete this.observers[t];return}this.observers[t].delete(n)}}emit(t){for(var n=arguments.length,r=new Array(n>1?n-1:0),o=1;o<n;o++)r[o-1]=arguments[o];this.observers[t]&&Array.from(this.observers[t].entries()).forEach(l=>{let[c,u]=l;for(let f=0;f<u;f++)c(...r)}),this.observers["*"]&&Array.from(this.observers["*"].entries()).forEach(l=>{let[c,u]=l;for(let f=0;f<u;f++)c.apply(c,[t,...r])})}}function fu(){let e,t;const n=new Promise((r,o)=>{e=r,t=o});return n.resolve=e,n.reject=t,n}function yP(e){return e==null?"":""+e}function dee(e,t,n){e.forEach(r=>{t[r]&&(n[r]=t[r])})}const fee=/###/g;function pu(e,t,n){function r(c){return c&&c.indexOf("###")>-1?c.replace(fee,"."):c}function o(){return!e||typeof e=="string"}const s=typeof t!="string"?t:t.split(".");let l=0;for(;l<s.length-1;){if(o())return{};const c=r(s[l]);!e[c]&&n&&(e[c]=new n),Object.prototype.hasOwnProperty.call(e,c)?e=e[c]:e={},++l}return o()?{}:{obj:e,k:r(s[l])}}function vP(e,t,n){const{obj:r,k:o}=pu(e,t,Object);if(r!==void 0||t.length===1){r[o]=n;return}let s=t[t.length-1],l=t.slice(0,t.length-1),c=pu(e,l,Object);for(;c.obj===void 0&&l.length;)s=`${l[l.length-1]}.${s}`,l=l.slice(0,l.length-1),c=pu(e,l,Object),c&&c.obj&&typeof c.obj[`${c.k}.${s}`]<"u"&&(c.obj=void 0);c.obj[`${c.k}.${s}`]=n}function pee(e,t,n,r){const{obj:o,k:s}=pu(e,t,Object);o[s]=o[s]||[],o[s].push(n)}function dp(e,t){const{obj:n,k:r}=pu(e,t);if(n)return n[r]}function hee(e,t,n){const r=dp(e,n);return r!==void 0?r:dp(t,n)}function bP(e,t,n){for(const r in t)r!=="__proto__"&&r!=="constructor"&&(r in e?typeof e[r]=="string"||e[r]instanceof String||typeof t[r]=="string"||t[r]instanceof String?n&&(e[r]=t[r]):bP(e[r],t[r],n):e[r]=t[r]);return e}function fl(e){return e.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&")}var mee={"&":"&","<":"<",">":">",'"':""","'":"'","/":"/"};function gee(e){return typeof e=="string"?e.replace(/[&<>"'\/]/g,t=>mee[t]):e}class yee{constructor(t){this.capacity=t,this.regExpMap=new Map,this.regExpQueue=[]}getRegExp(t){const n=this.regExpMap.get(t);if(n!==void 0)return n;const r=new RegExp(t);return this.regExpQueue.length===this.capacity&&this.regExpMap.delete(this.regExpQueue.shift()),this.regExpMap.set(t,r),this.regExpQueue.push(t),r}}const vee=[" ",",","?","!",";"],bee=new yee(20);function xee(e,t,n){t=t||"",n=n||"";const r=vee.filter(l=>t.indexOf(l)<0&&n.indexOf(l)<0);if(r.length===0)return!0;const o=bee.getRegExp(`(${r.map(l=>l==="?"?"\\?":l).join("|")})`);let s=!o.test(e);if(!s){const l=e.indexOf(n);l>0&&!o.test(e.substring(0,l))&&(s=!0)}return s}function gv(e,t){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:".";if(!e)return;if(e[t])return e[t];const r=t.split(n);let o=e;for(let s=0;s<r.length;){if(!o||typeof o!="object")return;let l,c="";for(let u=s;u<r.length;++u)if(u!==s&&(c+=n),c+=r[u],l=o[c],l!==void 0){if(["string","number","boolean"].indexOf(typeof l)>-1&&u<r.length-1)continue;s+=u-s+1;break}o=l}return o}function fp(e){return e&&e.indexOf("_")>0?e.replace("_","-"):e}class xP extends up{constructor(t){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{ns:["translation"],defaultNS:"translation"};super(),this.data=t||{},this.options=n,this.options.keySeparator===void 0&&(this.options.keySeparator="."),this.options.ignoreJSONStructure===void 0&&(this.options.ignoreJSONStructure=!0)}addNamespaces(t){this.options.ns.indexOf(t)<0&&this.options.ns.push(t)}removeNamespaces(t){const n=this.options.ns.indexOf(t);n>-1&&this.options.ns.splice(n,1)}getResource(t,n,r){let o=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{};const s=o.keySeparator!==void 0?o.keySeparator:this.options.keySeparator,l=o.ignoreJSONStructure!==void 0?o.ignoreJSONStructure:this.options.ignoreJSONStructure;let c;t.indexOf(".")>-1?c=t.split("."):(c=[t,n],r&&(Array.isArray(r)?c.push(...r):typeof r=="string"&&s?c.push(...r.split(s)):c.push(r)));const u=dp(this.data,c);return!u&&!n&&!r&&t.indexOf(".")>-1&&(t=c[0],n=c[1],r=c.slice(2).join(".")),u||!l||typeof r!="string"?u:gv(this.data&&this.data[t]&&this.data[t][n],r,s)}addResource(t,n,r,o){let s=arguments.length>4&&arguments[4]!==void 0?arguments[4]:{silent:!1};const l=s.keySeparator!==void 0?s.keySeparator:this.options.keySeparator;let c=[t,n];r&&(c=c.concat(l?r.split(l):r)),t.indexOf(".")>-1&&(c=t.split("."),o=n,n=c[1]),this.addNamespaces(n),vP(this.data,c,o),s.silent||this.emit("added",t,n,r,o)}addResources(t,n,r){let o=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{silent:!1};for(const s in r)(typeof r[s]=="string"||Array.isArray(r[s]))&&this.addResource(t,n,s,r[s],{silent:!0});o.silent||this.emit("added",t,n,r)}addResourceBundle(t,n,r,o,s){let l=arguments.length>5&&arguments[5]!==void 0?arguments[5]:{silent:!1,skipCopy:!1},c=[t,n];t.indexOf(".")>-1&&(c=t.split("."),o=r,r=n,n=c[1]),this.addNamespaces(n);let u=dp(this.data,c)||{};l.skipCopy||(r=JSON.parse(JSON.stringify(r))),o?bP(u,r,s):u={...u,...r},vP(this.data,c,u),l.silent||this.emit("added",t,n,r)}removeResourceBundle(t,n){this.hasResourceBundle(t,n)&&delete this.data[t][n],this.removeNamespaces(n),this.emit("removed",t,n)}hasResourceBundle(t,n){return this.getResource(t,n)!==void 0}getResourceBundle(t,n){return n||(n=this.options.defaultNS),this.options.compatibilityAPI==="v1"?{...this.getResource(t,n)}:this.getResource(t,n)}getDataByLanguage(t){return this.data[t]}hasLanguageSomeTranslations(t){const n=this.getDataByLanguage(t);return!!(n&&Object.keys(n)||[]).find(o=>n[o]&&Object.keys(n[o]).length>0)}toJSON(){return this.data}}var wP={processors:{},addPostProcessor(e){this.processors[e.name]=e},handle(e,t,n,r,o){return e.forEach(s=>{this.processors[s]&&(t=this.processors[s].process(t,n,r,o))}),t}};const SP={};class pp extends up{constructor(t){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};super(),dee(["resourceStore","languageUtils","pluralResolver","interpolator","backendConnector","i18nFormat","utils"],t,this),this.options=n,this.options.keySeparator===void 0&&(this.options.keySeparator="."),this.logger=Xo.create("translator")}changeLanguage(t){t&&(this.language=t)}exists(t){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{interpolation:{}};if(t==null)return!1;const r=this.resolve(t,n);return r&&r.res!==void 0}extractFromKey(t,n){let r=n.nsSeparator!==void 0?n.nsSeparator:this.options.nsSeparator;r===void 0&&(r=":");const o=n.keySeparator!==void 0?n.keySeparator:this.options.keySeparator;let s=n.ns||this.options.defaultNS||[];const l=r&&t.indexOf(r)>-1,c=!this.options.userDefinedKeySeparator&&!n.keySeparator&&!this.options.userDefinedNsSeparator&&!n.nsSeparator&&!xee(t,r,o);if(l&&!c){const u=t.match(this.interpolator.nestingRegexp);if(u&&u.length>0)return{key:t,namespaces:s};const f=t.split(r);(r!==o||r===o&&this.options.ns.indexOf(f[0])>-1)&&(s=f.shift()),t=f.join(o)}return typeof s=="string"&&(s=[s]),{key:t,namespaces:s}}translate(t,n,r){if(typeof n!="object"&&this.options.overloadTranslationOptionHandler&&(n=this.options.overloadTranslationOptionHandler(arguments)),typeof n=="object"&&(n={...n}),n||(n={}),t==null)return"";Array.isArray(t)||(t=[String(t)]);const o=n.returnDetails!==void 0?n.returnDetails:this.options.returnDetails,s=n.keySeparator!==void 0?n.keySeparator:this.options.keySeparator,{key:l,namespaces:c}=this.extractFromKey(t[t.length-1],n),u=c[c.length-1],f=n.lng||this.language,p=n.appendNamespaceToCIMode||this.options.appendNamespaceToCIMode;if(f&&f.toLowerCase()==="cimode"){if(p){const $=n.nsSeparator||this.options.nsSeparator;return o?{res:`${u}${$}${l}`,usedKey:l,exactUsedKey:l,usedLng:f,usedNS:u,usedParams:this.getUsedParamsDetails(n)}:`${u}${$}${l}`}return o?{res:l,usedKey:l,exactUsedKey:l,usedLng:f,usedNS:u,usedParams:this.getUsedParamsDetails(n)}:l}const m=this.resolve(t,n);let g=m&&m.res;const S=m&&m.usedKey||l,w=m&&m.exactUsedKey||l,v=Object.prototype.toString.apply(g),x=["[object Number]","[object Function]","[object RegExp]"],R=n.joinArrays!==void 0?n.joinArrays:this.options.joinArrays,k=!this.i18nFormat||this.i18nFormat.handleAsObject;if(k&&g&&(typeof g!="string"&&typeof g!="boolean"&&typeof g!="number")&&x.indexOf(v)<0&&!(typeof R=="string"&&Array.isArray(g))){if(!n.returnObjects&&!this.options.returnObjects){this.options.returnedObjectHandler||this.logger.warn("accessing an object - but returnObjects options is not enabled!");const $=this.options.returnedObjectHandler?this.options.returnedObjectHandler(S,g,{...n,ns:c}):`key '${l} (${this.language})' returned an object instead of string.`;return o?(m.res=$,m.usedParams=this.getUsedParamsDetails(n),m):$}if(s){const $=Array.isArray(g),j=$?[]:{},T=$?w:S;for(const M in g)if(Object.prototype.hasOwnProperty.call(g,M)){const N=`${T}${s}${M}`;j[M]=this.translate(N,{...n,joinArrays:!1,ns:c}),j[M]===N&&(j[M]=g[M])}g=j}}else if(k&&typeof R=="string"&&Array.isArray(g))g=g.join(R),g&&(g=this.extendTranslation(g,t,n,r));else{let $=!1,j=!1;const T=n.count!==void 0&&typeof n.count!="string",M=pp.hasDefaultValue(n),N=T?this.pluralResolver.getSuffix(f,n.count,n):"",F=n.ordinal&&T?this.pluralResolver.getSuffix(f,n.count,{ordinal:!1}):"",D=T&&!n.ordinal&&n.count===0&&this.pluralResolver.shouldUseIntlApi(),W=D&&n[`defaultValue${this.options.pluralSeparator}zero`]||n[`defaultValue${N}`]||n[`defaultValue${F}`]||n.defaultValue;!this.isValidLookup(g)&&M&&($=!0,g=W),this.isValidLookup(g)||(j=!0,g=l);const ee=(n.missingKeyNoValueFallbackToKey||this.options.missingKeyNoValueFallbackToKey)&&j?void 0:g,z=M&&W!==g&&this.options.updateMissing;if(j||$||z){if(this.logger.log(z?"updateKey":"missingKey",f,u,l,z?W:g),s){const _=this.resolve(l,{...n,keySeparator:!1});_&&_.res&&this.logger.warn("Seems the loaded translations were in flat JSON format instead of nested. Either set keySeparator: false on init or make sure your translations are published in nested format.")}let ne=[];const V=this.languageUtils.getFallbackCodes(this.options.fallbackLng,n.lng||this.language);if(this.options.saveMissingTo==="fallback"&&V&&V[0])for(let _=0;_<V.length;_++)ne.push(V[_]);else this.options.saveMissingTo==="all"?ne=this.languageUtils.toResolveHierarchy(n.lng||this.language):ne.push(n.lng||this.language);const K=(_,H,X)=>{const I=M&&X!==g?X:ee;this.options.missingKeyHandler?this.options.missingKeyHandler(_,u,H,I,z,n):this.backendConnector&&this.backendConnector.saveMissing&&this.backendConnector.saveMissing(_,u,H,I,z,n),this.emit("missingKey",_,u,H,g)};this.options.saveMissing&&(this.options.saveMissingPlurals&&T?ne.forEach(_=>{const H=this.pluralResolver.getSuffixes(_,n);D&&n[`defaultValue${this.options.pluralSeparator}zero`]&&H.indexOf(`${this.options.pluralSeparator}zero`)<0&&H.push(`${this.options.pluralSeparator}zero`),H.forEach(X=>{K([_],l+X,n[`defaultValue${X}`]||W)})}):K(ne,l,W))}g=this.extendTranslation(g,t,n,m,r),j&&g===l&&this.options.appendNamespaceToMissingKey&&(g=`${u}:${l}`),(j||$)&&this.options.parseMissingKeyHandler&&(this.options.compatibilityAPI!=="v1"?g=this.options.parseMissingKeyHandler(this.options.appendNamespaceToMissingKey?`${u}:${l}`:l,$?g:void 0):g=this.options.parseMissingKeyHandler(g))}return o?(m.res=g,m.usedParams=this.getUsedParamsDetails(n),m):g}extendTranslation(t,n,r,o,s){var l=this;if(this.i18nFormat&&this.i18nFormat.parse)t=this.i18nFormat.parse(t,{...this.options.interpolation.defaultVariables,...r},r.lng||this.language||o.usedLng,o.usedNS,o.usedKey,{resolved:o});else if(!r.skipInterpolation){r.interpolation&&this.interpolator.init({...r,interpolation:{...this.options.interpolation,...r.interpolation}});const f=typeof t=="string"&&(r&&r.interpolation&&r.interpolation.skipOnVariables!==void 0?r.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables);let p;if(f){const g=t.match(this.interpolator.nestingRegexp);p=g&&g.length}let m=r.replace&&typeof r.replace!="string"?r.replace:r;if(this.options.interpolation.defaultVariables&&(m={...this.options.interpolation.defaultVariables,...m}),t=this.interpolator.interpolate(t,m,r.lng||this.language||o.usedLng,r),f){const g=t.match(this.interpolator.nestingRegexp),S=g&&g.length;p<S&&(r.nest=!1)}!r.lng&&this.options.compatibilityAPI!=="v1"&&o&&o.res&&(r.lng=this.language||o.usedLng),r.nest!==!1&&(t=this.interpolator.nest(t,function(){for(var g=arguments.length,S=new Array(g),w=0;w<g;w++)S[w]=arguments[w];return s&&s[0]===S[0]&&!r.context?(l.logger.warn(`It seems you are nesting recursively key: ${S[0]} in key: ${n[0]}`),null):l.translate(...S,n)},r)),r.interpolation&&this.interpolator.reset()}const c=r.postProcess||this.options.postProcess,u=typeof c=="string"?[c]:c;return t!=null&&u&&u.length&&r.applyPostProcessor!==!1&&(t=wP.handle(u,t,n,this.options&&this.options.postProcessPassResolved?{i18nResolved:{...o,usedParams:this.getUsedParamsDetails(r)},...r}:r,this)),t}resolve(t){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},r,o,s,l,c;return typeof t=="string"&&(t=[t]),t.forEach(u=>{if(this.isValidLookup(r))return;const f=this.extractFromKey(u,n),p=f.key;o=p;let m=f.namespaces;this.options.fallbackNS&&(m=m.concat(this.options.fallbackNS));const g=n.count!==void 0&&typeof n.count!="string",S=g&&!n.ordinal&&n.count===0&&this.pluralResolver.shouldUseIntlApi(),w=n.context!==void 0&&(typeof n.context=="string"||typeof n.context=="number")&&n.context!=="",v=n.lngs?n.lngs:this.languageUtils.toResolveHierarchy(n.lng||this.language,n.fallbackLng);m.forEach(x=>{this.isValidLookup(r)||(c=x,!SP[`${v[0]}-${x}`]&&this.utils&&this.utils.hasLoadedNamespace&&!this.utils.hasLoadedNamespace(c)&&(SP[`${v[0]}-${x}`]=!0,this.logger.warn(`key "${o}" for languages "${v.join(", ")}" won't get resolved as namespace "${c}" was not yet loaded`,"This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!")),v.forEach(R=>{if(this.isValidLookup(r))return;l=R;const k=[p];if(this.i18nFormat&&this.i18nFormat.addLookupKeys)this.i18nFormat.addLookupKeys(k,p,R,x,n);else{let $;g&&($=this.pluralResolver.getSuffix(R,n.count,n));const j=`${this.options.pluralSeparator}zero`,T=`${this.options.pluralSeparator}ordinal${this.options.pluralSeparator}`;if(g&&(k.push(p+$),n.ordinal&&$.indexOf(T)===0&&k.push(p+$.replace(T,this.options.pluralSeparator)),S&&k.push(p+j)),w){const M=`${p}${this.options.contextSeparator}${n.context}`;k.push(M),g&&(k.push(M+$),n.ordinal&&$.indexOf(T)===0&&k.push(M+$.replace(T,this.options.pluralSeparator)),S&&k.push(M+j))}}let O;for(;O=k.pop();)this.isValidLookup(r)||(s=O,r=this.getResource(R,x,O,n))}))})}),{res:r,usedKey:o,exactUsedKey:s,usedLng:l,usedNS:c}}isValidLookup(t){return t!==void 0&&!(!this.options.returnNull&&t===null)&&!(!this.options.returnEmptyString&&t==="")}getResource(t,n,r){let o=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{};return this.i18nFormat&&this.i18nFormat.getResource?this.i18nFormat.getResource(t,n,r,o):this.resourceStore.getResource(t,n,r,o)}getUsedParamsDetails(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};const n=["defaultValue","ordinal","context","replace","lng","lngs","fallbackLng","ns","keySeparator","nsSeparator","returnObjects","returnDetails","joinArrays","postProcess","interpolation"],r=t.replace&&typeof t.replace!="string";let o=r?t.replace:t;if(r&&typeof t.count<"u"&&(o.count=t.count),this.options.interpolation.defaultVariables&&(o={...this.options.interpolation.defaultVariables,...o}),!r){o={...o};for(const s of n)delete o[s]}return o}static hasDefaultValue(t){const n="defaultValue";for(const r in t)if(Object.prototype.hasOwnProperty.call(t,r)&&n===r.substring(0,n.length)&&t[r]!==void 0)return!0;return!1}}function yv(e){return e.charAt(0).toUpperCase()+e.slice(1)}class CP{constructor(t){this.options=t,this.supportedLngs=this.options.supportedLngs||!1,this.logger=Xo.create("languageUtils")}getScriptPartFromCode(t){if(t=fp(t),!t||t.indexOf("-")<0)return null;const n=t.split("-");return n.length===2||(n.pop(),n[n.length-1].toLowerCase()==="x")?null:this.formatLanguageCode(n.join("-"))}getLanguagePartFromCode(t){if(t=fp(t),!t||t.indexOf("-")<0)return t;const n=t.split("-");return this.formatLanguageCode(n[0])}formatLanguageCode(t){if(typeof t=="string"&&t.indexOf("-")>-1){const n=["hans","hant","latn","cyrl","cans","mong","arab"];let r=t.split("-");return this.options.lowerCaseLng?r=r.map(o=>o.toLowerCase()):r.length===2?(r[0]=r[0].toLowerCase(),r[1]=r[1].toUpperCase(),n.indexOf(r[1].toLowerCase())>-1&&(r[1]=yv(r[1].toLowerCase()))):r.length===3&&(r[0]=r[0].toLowerCase(),r[1].length===2&&(r[1]=r[1].toUpperCase()),r[0]!=="sgn"&&r[2].length===2&&(r[2]=r[2].toUpperCase()),n.indexOf(r[1].toLowerCase())>-1&&(r[1]=yv(r[1].toLowerCase())),n.indexOf(r[2].toLowerCase())>-1&&(r[2]=yv(r[2].toLowerCase()))),r.join("-")}return this.options.cleanCode||this.options.lowerCaseLng?t.toLowerCase():t}isSupportedCode(t){return(this.options.load==="languageOnly"||this.options.nonExplicitSupportedLngs)&&(t=this.getLanguagePartFromCode(t)),!this.supportedLngs||!this.supportedLngs.length||this.supportedLngs.indexOf(t)>-1}getBestMatchFromCodes(t){if(!t)return null;let n;return t.forEach(r=>{if(n)return;const o=this.formatLanguageCode(r);(!this.options.supportedLngs||this.isSupportedCode(o))&&(n=o)}),!n&&this.options.supportedLngs&&t.forEach(r=>{if(n)return;const o=this.getLanguagePartFromCode(r);if(this.isSupportedCode(o))return n=o;n=this.options.supportedLngs.find(s=>{if(s===o)return s;if(!(s.indexOf("-")<0&&o.indexOf("-")<0)&&(s.indexOf("-")>0&&o.indexOf("-")<0&&s.substring(0,s.indexOf("-"))===o||s.indexOf(o)===0&&o.length>1))return s})}),n||(n=this.getFallbackCodes(this.options.fallbackLng)[0]),n}getFallbackCodes(t,n){if(!t)return[];if(typeof t=="function"&&(t=t(n)),typeof t=="string"&&(t=[t]),Array.isArray(t))return t;if(!n)return t.default||[];let r=t[n];return r||(r=t[this.getScriptPartFromCode(n)]),r||(r=t[this.formatLanguageCode(n)]),r||(r=t[this.getLanguagePartFromCode(n)]),r||(r=t.default),r||[]}toResolveHierarchy(t,n){const r=this.getFallbackCodes(n||this.options.fallbackLng||[],t),o=[],s=l=>{l&&(this.isSupportedCode(l)?o.push(l):this.logger.warn(`rejecting language code not found in supportedLngs: ${l}`))};return typeof t=="string"&&(t.indexOf("-")>-1||t.indexOf("_")>-1)?(this.options.load!=="languageOnly"&&s(this.formatLanguageCode(t)),this.options.load!=="languageOnly"&&this.options.load!=="currentOnly"&&s(this.getScriptPartFromCode(t)),this.options.load!=="currentOnly"&&s(this.getLanguagePartFromCode(t))):typeof t=="string"&&s(this.formatLanguageCode(t)),r.forEach(l=>{o.indexOf(l)<0&&s(this.formatLanguageCode(l))}),o}}let wee=[{lngs:["ach","ak","am","arn","br","fil","gun","ln","mfe","mg","mi","oc","pt","pt-BR","tg","tl","ti","tr","uz","wa"],nr:[1,2],fc:1},{lngs:["af","an","ast","az","bg","bn","ca","da","de","dev","el","en","eo","es","et","eu","fi","fo","fur","fy","gl","gu","ha","hi","hu","hy","ia","it","kk","kn","ku","lb","mai","ml","mn","mr","nah","nap","nb","ne","nl","nn","no","nso","pa","pap","pms","ps","pt-PT","rm","sco","se","si","so","son","sq","sv","sw","ta","te","tk","ur","yo"],nr:[1,2],fc:2},{lngs:["ay","bo","cgg","fa","ht","id","ja","jbo","ka","km","ko","ky","lo","ms","sah","su","th","tt","ug","vi","wo","zh"],nr:[1],fc:3},{lngs:["be","bs","cnr","dz","hr","ru","sr","uk"],nr:[1,2,5],fc:4},{lngs:["ar"],nr:[0,1,2,3,11,100],fc:5},{lngs:["cs","sk"],nr:[1,2,5],fc:6},{lngs:["csb","pl"],nr:[1,2,5],fc:7},{lngs:["cy"],nr:[1,2,3,8],fc:8},{lngs:["fr"],nr:[1,2],fc:9},{lngs:["ga"],nr:[1,2,3,7,11],fc:10},{lngs:["gd"],nr:[1,2,3,20],fc:11},{lngs:["is"],nr:[1,2],fc:12},{lngs:["jv"],nr:[0,1],fc:13},{lngs:["kw"],nr:[1,2,3,4],fc:14},{lngs:["lt"],nr:[1,2,10],fc:15},{lngs:["lv"],nr:[1,2,0],fc:16},{lngs:["mk"],nr:[1,2],fc:17},{lngs:["mnk"],nr:[0,1,2],fc:18},{lngs:["mt"],nr:[1,2,11,20],fc:19},{lngs:["or"],nr:[2,1],fc:2},{lngs:["ro"],nr:[1,2,20],fc:20},{lngs:["sl"],nr:[5,1,2,3],fc:21},{lngs:["he","iw"],nr:[1,2,20,21],fc:22}],See={1:function(e){return+(e>1)},2:function(e){return+(e!=1)},3:function(e){return 0},4:function(e){return e%10==1&&e%100!=11?0:e%10>=2&&e%10<=4&&(e%100<10||e%100>=20)?1:2},5:function(e){return e==0?0:e==1?1:e==2?2:e%100>=3&&e%100<=10?3:e%100>=11?4:5},6:function(e){return e==1?0:e>=2&&e<=4?1:2},7:function(e){return e==1?0:e%10>=2&&e%10<=4&&(e%100<10||e%100>=20)?1:2},8:function(e){return e==1?0:e==2?1:e!=8&&e!=11?2:3},9:function(e){return+(e>=2)},10:function(e){return e==1?0:e==2?1:e<7?2:e<11?3:4},11:function(e){return e==1||e==11?0:e==2||e==12?1:e>2&&e<20?2:3},12:function(e){return+(e%10!=1||e%100==11)},13:function(e){return+(e!==0)},14:function(e){return e==1?0:e==2?1:e==3?2:3},15:function(e){return e%10==1&&e%100!=11?0:e%10>=2&&(e%100<10||e%100>=20)?1:2},16:function(e){return e%10==1&&e%100!=11?0:e!==0?1:2},17:function(e){return e==1||e%10==1&&e%100!=11?0:1},18:function(e){return e==0?0:e==1?1:2},19:function(e){return e==1?0:e==0||e%100>1&&e%100<11?1:e%100>10&&e%100<20?2:3},20:function(e){return e==1?0:e==0||e%100>0&&e%100<20?1:2},21:function(e){return e%100==1?1:e%100==2?2:e%100==3||e%100==4?3:0},22:function(e){return e==1?0:e==2?1:(e<0||e>10)&&e%10==0?2:3}};const Cee=["v1","v2","v3"],Ree=["v4"],RP={zero:0,one:1,two:2,few:3,many:4,other:5};function Eee(){const e={};return wee.forEach(t=>{t.lngs.forEach(n=>{e[n]={numbers:t.nr,plurals:See[t.fc]}})}),e}class kee{constructor(t){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};this.languageUtils=t,this.options=n,this.logger=Xo.create("pluralResolver"),(!this.options.compatibilityJSON||Ree.includes(this.options.compatibilityJSON))&&(typeof Intl>"u"||!Intl.PluralRules)&&(this.options.compatibilityJSON="v3",this.logger.error("Your environment seems not to be Intl API compatible, use an Intl.PluralRules polyfill. Will fallback to the compatibilityJSON v3 format handling.")),this.rules=Eee()}addRule(t,n){this.rules[t]=n}getRule(t){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(this.shouldUseIntlApi())try{return new Intl.PluralRules(fp(t==="dev"?"en":t),{type:n.ordinal?"ordinal":"cardinal"})}catch{return}return this.rules[t]||this.rules[this.languageUtils.getLanguagePartFromCode(t)]}needsPlural(t){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};const r=this.getRule(t,n);return this.shouldUseIntlApi()?r&&r.resolvedOptions().pluralCategories.length>1:r&&r.numbers.length>1}getPluralFormsOfKey(t,n){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};return this.getSuffixes(t,r).map(o=>`${n}${o}`)}getSuffixes(t){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};const r=this.getRule(t,n);return r?this.shouldUseIntlApi()?r.resolvedOptions().pluralCategories.sort((o,s)=>RP[o]-RP[s]).map(o=>`${this.options.prepend}${n.ordinal?`ordinal${this.options.prepend}`:""}${o}`):r.numbers.map(o=>this.getSuffix(t,o,n)):[]}getSuffix(t,n){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};const o=this.getRule(t,r);return o?this.shouldUseIntlApi()?`${this.options.prepend}${r.ordinal?`ordinal${this.options.prepend}`:""}${o.select(n)}`:this.getSuffixRetroCompatible(o,n):(this.logger.warn(`no plural rule found for: ${t}`),"")}getSuffixRetroCompatible(t,n){const r=t.noAbs?t.plurals(n):t.plurals(Math.abs(n));let o=t.numbers[r];this.options.simplifyPluralSuffix&&t.numbers.length===2&&t.numbers[0]===1&&(o===2?o="plural":o===1&&(o=""));const s=()=>this.options.prepend&&o.toString()?this.options.prepend+o.toString():o.toString();return this.options.compatibilityJSON==="v1"?o===1?"":typeof o=="number"?`_plural_${o.toString()}`:s():this.options.compatibilityJSON==="v2"||this.options.simplifyPluralSuffix&&t.numbers.length===2&&t.numbers[0]===1?s():this.options.prepend&&r.toString()?this.options.prepend+r.toString():r.toString()}shouldUseIntlApi(){return!Cee.includes(this.options.compatibilityJSON)}}function EP(e,t,n){let r=arguments.length>3&&arguments[3]!==void 0?arguments[3]:".",o=arguments.length>4&&arguments[4]!==void 0?arguments[4]:!0,s=hee(e,t,n);return!s&&o&&typeof n=="string"&&(s=gv(e,n,r),s===void 0&&(s=gv(t,n,r))),s}class Pee{constructor(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};this.logger=Xo.create("interpolator"),this.options=t,this.format=t.interpolation&&t.interpolation.format||(n=>n),this.init(t)}init(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};t.interpolation||(t.interpolation={escapeValue:!0});const{escape:n,escapeValue:r,useRawValueToEscape:o,prefix:s,prefixEscaped:l,suffix:c,suffixEscaped:u,formatSeparator:f,unescapeSuffix:p,unescapePrefix:m,nestingPrefix:g,nestingPrefixEscaped:S,nestingSuffix:w,nestingSuffixEscaped:v,nestingOptionsSeparator:x,maxReplaces:R,alwaysFormat:k}=t.interpolation;this.escape=n!==void 0?n:gee,this.escapeValue=r!==void 0?r:!0,this.useRawValueToEscape=o!==void 0?o:!1,this.prefix=s?fl(s):l||"{{",this.suffix=c?fl(c):u||"}}",this.formatSeparator=f||",",this.unescapePrefix=p?"":m||"-",this.unescapeSuffix=this.unescapePrefix?"":p||"",this.nestingPrefix=g?fl(g):S||fl("$t("),this.nestingSuffix=w?fl(w):v||fl(")"),this.nestingOptionsSeparator=x||",",this.maxReplaces=R||1e3,this.alwaysFormat=k!==void 0?k:!1,this.resetRegExp()}reset(){this.options&&this.init(this.options)}resetRegExp(){const t=(n,r)=>n&&n.source===r?(n.lastIndex=0,n):new RegExp(r,"g");this.regexp=t(this.regexp,`${this.prefix}(.+?)${this.suffix}`),this.regexpUnescape=t(this.regexpUnescape,`${this.prefix}${this.unescapePrefix}(.+?)${this.unescapeSuffix}${this.suffix}`),this.nestingRegexp=t(this.nestingRegexp,`${this.nestingPrefix}(.+?)${this.nestingSuffix}`)}interpolate(t,n,r,o){let s,l,c;const u=this.options&&this.options.interpolation&&this.options.interpolation.defaultVariables||{};function f(w){return w.replace(/\$/g,"$$$$")}const p=w=>{if(w.indexOf(this.formatSeparator)<0){const k=EP(n,u,w,this.options.keySeparator,this.options.ignoreJSONStructure);return this.alwaysFormat?this.format(k,void 0,r,{...o,...n,interpolationkey:w}):k}const v=w.split(this.formatSeparator),x=v.shift().trim(),R=v.join(this.formatSeparator).trim();return this.format(EP(n,u,x,this.options.keySeparator,this.options.ignoreJSONStructure),R,r,{...o,...n,interpolationkey:x})};this.resetRegExp();const m=o&&o.missingInterpolationHandler||this.options.missingInterpolationHandler,g=o&&o.interpolation&&o.interpolation.skipOnVariables!==void 0?o.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables;return[{regex:this.regexpUnescape,safeValue:w=>f(w)},{regex:this.regexp,safeValue:w=>this.escapeValue?f(this.escape(w)):f(w)}].forEach(w=>{for(c=0;s=w.regex.exec(t);){const v=s[1].trim();if(l=p(v),l===void 0)if(typeof m=="function"){const R=m(t,s,o);l=typeof R=="string"?R:""}else if(o&&Object.prototype.hasOwnProperty.call(o,v))l="";else if(g){l=s[0];continue}else this.logger.warn(`missed to pass in variable ${v} for interpolating ${t}`),l="";else typeof l!="string"&&!this.useRawValueToEscape&&(l=yP(l));const x=w.safeValue(l);if(t=t.replace(s[0],x),g?(w.regex.lastIndex+=l.length,w.regex.lastIndex-=s[0].length):w.regex.lastIndex=0,c++,c>=this.maxReplaces)break}}),t}nest(t,n){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},o,s,l;function c(u,f){const p=this.nestingOptionsSeparator;if(u.indexOf(p)<0)return u;const m=u.split(new RegExp(`${p}[ ]*{`));let g=`{${m[1]}`;u=m[0],g=this.interpolate(g,l);const S=g.match(/'/g),w=g.match(/"/g);(S&&S.length%2===0&&!w||w.length%2!==0)&&(g=g.replace(/'/g,'"'));try{l=JSON.parse(g),f&&(l={...f,...l})}catch(v){return this.logger.warn(`failed parsing options string in nesting for key ${u}`,v),`${u}${p}${g}`}return l.defaultValue&&l.defaultValue.indexOf(this.prefix)>-1&&delete l.defaultValue,u}for(;o=this.nestingRegexp.exec(t);){let u=[];l={...r},l=l.replace&&typeof l.replace!="string"?l.replace:l,l.applyPostProcessor=!1,delete l.defaultValue;let f=!1;if(o[0].indexOf(this.formatSeparator)!==-1&&!/{.*}/.test(o[1])){const p=o[1].split(this.formatSeparator).map(m=>m.trim());o[1]=p.shift(),u=p,f=!0}if(s=n(c.call(this,o[1].trim(),l),l),s&&o[0]===t&&typeof s!="string")return s;typeof s!="string"&&(s=yP(s)),s||(this.logger.warn(`missed to resolve ${o[1]} for nesting ${t}`),s=""),f&&(s=u.reduce((p,m)=>this.format(p,m,r.lng,{...r,interpolationkey:o[1].trim()}),s.trim())),t=t.replace(o[0],s),this.regexp.lastIndex=0}return t}}function Oee(e){let t=e.toLowerCase().trim();const n={};if(e.indexOf("(")>-1){const r=e.split("(");t=r[0].toLowerCase().trim();const o=r[1].substring(0,r[1].length-1);t==="currency"&&o.indexOf(":")<0?n.currency||(n.currency=o.trim()):t==="relativetime"&&o.indexOf(":")<0?n.range||(n.range=o.trim()):o.split(";").forEach(l=>{if(l){const[c,...u]=l.split(":"),f=u.join(":").trim().replace(/^'+|'+$/g,""),p=c.trim();n[p]||(n[p]=f),f==="false"&&(n[p]=!1),f==="true"&&(n[p]=!0),isNaN(f)||(n[p]=parseInt(f,10))}})}return{formatName:t,formatOptions:n}}function pl(e){const t={};return function(r,o,s){const l=o+JSON.stringify(s);let c=t[l];return c||(c=e(fp(o),s),t[l]=c),c(r)}}class Tee{constructor(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};this.logger=Xo.create("formatter"),this.options=t,this.formats={number:pl((n,r)=>{const o=new Intl.NumberFormat(n,{...r});return s=>o.format(s)}),currency:pl((n,r)=>{const o=new Intl.NumberFormat(n,{...r,style:"currency"});return s=>o.format(s)}),datetime:pl((n,r)=>{const o=new Intl.DateTimeFormat(n,{...r});return s=>o.format(s)}),relativetime:pl((n,r)=>{const o=new Intl.RelativeTimeFormat(n,{...r});return s=>o.format(s,r.range||"day")}),list:pl((n,r)=>{const o=new Intl.ListFormat(n,{...r});return s=>o.format(s)})},this.init(t)}init(t){const r=(arguments.length>1&&arguments[1]!==void 0?arguments[1]:{interpolation:{}}).interpolation;this.formatSeparator=r.formatSeparator?r.formatSeparator:r.formatSeparator||","}add(t,n){this.formats[t.toLowerCase().trim()]=n}addCached(t,n){this.formats[t.toLowerCase().trim()]=pl(n)}format(t,n,r){let o=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{};return n.split(this.formatSeparator).reduce((c,u)=>{const{formatName:f,formatOptions:p}=Oee(u);if(this.formats[f]){let m=c;try{const g=o&&o.formatParams&&o.formatParams[o.interpolationkey]||{},S=g.locale||g.lng||o.locale||o.lng||r;m=this.formats[f](c,S,{...p,...o,...g})}catch(g){this.logger.warn(g)}return m}else this.logger.warn(`there was no format function for ${f}`);return c},t)}}function $ee(e,t){e.pending[t]!==void 0&&(delete e.pending[t],e.pendingCount--)}class jee extends up{constructor(t,n,r){let o=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{};super(),this.backend=t,this.store=n,this.services=r,this.languageUtils=r.languageUtils,this.options=o,this.logger=Xo.create("backendConnector"),this.waitingReads=[],this.maxParallelReads=o.maxParallelReads||10,this.readingCalls=0,this.maxRetries=o.maxRetries>=0?o.maxRetries:5,this.retryTimeout=o.retryTimeout>=1?o.retryTimeout:350,this.state={},this.queue=[],this.backend&&this.backend.init&&this.backend.init(r,o.backend,o)}queueLoad(t,n,r,o){const s={},l={},c={},u={};return t.forEach(f=>{let p=!0;n.forEach(m=>{const g=`${f}|${m}`;!r.reload&&this.store.hasResourceBundle(f,m)?this.state[g]=2:this.state[g]<0||(this.state[g]===1?l[g]===void 0&&(l[g]=!0):(this.state[g]=1,p=!1,l[g]===void 0&&(l[g]=!0),s[g]===void 0&&(s[g]=!0),u[m]===void 0&&(u[m]=!0)))}),p||(c[f]=!0)}),(Object.keys(s).length||Object.keys(l).length)&&this.queue.push({pending:l,pendingCount:Object.keys(l).length,loaded:{},errors:[],callback:o}),{toLoad:Object.keys(s),pending:Object.keys(l),toLoadLanguages:Object.keys(c),toLoadNamespaces:Object.keys(u)}}loaded(t,n,r){const o=t.split("|"),s=o[0],l=o[1];n&&this.emit("failedLoading",s,l,n),r&&this.store.addResourceBundle(s,l,r,void 0,void 0,{skipCopy:!0}),this.state[t]=n?-1:2;const c={};this.queue.forEach(u=>{pee(u.loaded,[s],l),$ee(u,t),n&&u.errors.push(n),u.pendingCount===0&&!u.done&&(Object.keys(u.loaded).forEach(f=>{c[f]||(c[f]={});const p=u.loaded[f];p.length&&p.forEach(m=>{c[f][m]===void 0&&(c[f][m]=!0)})}),u.done=!0,u.errors.length?u.callback(u.errors):u.callback())}),this.emit("loaded",c),this.queue=this.queue.filter(u=>!u.done)}read(t,n,r){let o=arguments.length>3&&arguments[3]!==void 0?arguments[3]:0,s=arguments.length>4&&arguments[4]!==void 0?arguments[4]:this.retryTimeout,l=arguments.length>5?arguments[5]:void 0;if(!t.length)return l(null,{});if(this.readingCalls>=this.maxParallelReads){this.waitingReads.push({lng:t,ns:n,fcName:r,tried:o,wait:s,callback:l});return}this.readingCalls++;const c=(f,p)=>{if(this.readingCalls--,this.waitingReads.length>0){const m=this.waitingReads.shift();this.read(m.lng,m.ns,m.fcName,m.tried,m.wait,m.callback)}if(f&&p&&o<this.maxRetries){setTimeout(()=>{this.read.call(this,t,n,r,o+1,s*2,l)},s);return}l(f,p)},u=this.backend[r].bind(this.backend);if(u.length===2){try{const f=u(t,n);f&&typeof f.then=="function"?f.then(p=>c(null,p)).catch(c):c(null,f)}catch(f){c(f)}return}return u(t,n,c)}prepareLoading(t,n){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},o=arguments.length>3?arguments[3]:void 0;if(!this.backend)return this.logger.warn("No backend was added via i18next.use. Will not load resources."),o&&o();typeof t=="string"&&(t=this.languageUtils.toResolveHierarchy(t)),typeof n=="string"&&(n=[n]);const s=this.queueLoad(t,n,r,o);if(!s.toLoad.length)return s.pending.length||o(),null;s.toLoad.forEach(l=>{this.loadOne(l)})}load(t,n,r){this.prepareLoading(t,n,{},r)}reload(t,n,r){this.prepareLoading(t,n,{reload:!0},r)}loadOne(t){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"";const r=t.split("|"),o=r[0],s=r[1];this.read(o,s,"read",void 0,void 0,(l,c)=>{l&&this.logger.warn(`${n}loading namespace ${s} for language ${o} failed`,l),!l&&c&&this.logger.log(`${n}loaded namespace ${s} for language ${o}`,c),this.loaded(t,l,c)})}saveMissing(t,n,r,o,s){let l=arguments.length>5&&arguments[5]!==void 0?arguments[5]:{},c=arguments.length>6&&arguments[6]!==void 0?arguments[6]:()=>{};if(this.services.utils&&this.services.utils.hasLoadedNamespace&&!this.services.utils.hasLoadedNamespace(n)){this.logger.warn(`did not save key "${r}" as the namespace "${n}" was not yet loaded`,"This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!");return}if(!(r==null||r==="")){if(this.backend&&this.backend.create){const u={...l,isUpdate:s},f=this.backend.create.bind(this.backend);if(f.length<6)try{let p;f.length===5?p=f(t,n,r,o,u):p=f(t,n,r,o),p&&typeof p.then=="function"?p.then(m=>c(null,m)).catch(c):c(null,p)}catch(p){c(p)}else f(t,n,r,o,c,u)}!t||!t[0]||this.store.addResource(t[0],n,r,o)}}}function kP(){return{debug:!1,initImmediate:!0,ns:["translation"],defaultNS:["translation"],fallbackLng:["dev"],fallbackNS:!1,supportedLngs:!1,nonExplicitSupportedLngs:!1,load:"all",preload:!1,simplifyPluralSuffix:!0,keySeparator:".",nsSeparator:":",pluralSeparator:"_",contextSeparator:"_",partialBundledLanguages:!1,saveMissing:!1,updateMissing:!1,saveMissingTo:"fallback",saveMissingPlurals:!0,missingKeyHandler:!1,missingInterpolationHandler:!1,postProcess:!1,postProcessPassResolved:!1,returnNull:!1,returnEmptyString:!0,returnObjects:!1,joinArrays:!1,returnedObjectHandler:!1,parseMissingKeyHandler:!1,appendNamespaceToMissingKey:!1,appendNamespaceToCIMode:!1,overloadTranslationOptionHandler:function(t){let n={};if(typeof t[1]=="object"&&(n=t[1]),typeof t[1]=="string"&&(n.defaultValue=t[1]),typeof t[2]=="string"&&(n.tDescription=t[2]),typeof t[2]=="object"||typeof t[3]=="object"){const r=t[3]||t[2];Object.keys(r).forEach(o=>{n[o]=r[o]})}return n},interpolation:{escapeValue:!0,format:e=>e,prefix:"{{",suffix:"}}",formatSeparator:",",unescapePrefix:"-",nestingPrefix:"$t(",nestingSuffix:")",nestingOptionsSeparator:",",maxReplaces:1e3,skipOnVariables:!0}}}function PP(e){return typeof e.ns=="string"&&(e.ns=[e.ns]),typeof e.fallbackLng=="string"&&(e.fallbackLng=[e.fallbackLng]),typeof e.fallbackNS=="string"&&(e.fallbackNS=[e.fallbackNS]),e.supportedLngs&&e.supportedLngs.indexOf("cimode")<0&&(e.supportedLngs=e.supportedLngs.concat(["cimode"])),e}function hp(){}function Aee(e){Object.getOwnPropertyNames(Object.getPrototypeOf(e)).forEach(n=>{typeof e[n]=="function"&&(e[n]=e[n].bind(e))})}class hu extends up{constructor(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},n=arguments.length>1?arguments[1]:void 0;if(super(),this.options=PP(t),this.services={},this.logger=Xo,this.modules={external:[]},Aee(this),n&&!this.isInitialized&&!t.isClone){if(!this.options.initImmediate)return this.init(t,n),this;setTimeout(()=>{this.init(t,n)},0)}}init(){var t=this;let n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},r=arguments.length>1?arguments[1]:void 0;this.isInitializing=!0,typeof n=="function"&&(r=n,n={}),!n.defaultNS&&n.defaultNS!==!1&&n.ns&&(typeof n.ns=="string"?n.defaultNS=n.ns:n.ns.indexOf("translation")<0&&(n.defaultNS=n.ns[0]));const o=kP();this.options={...o,...this.options,...PP(n)},this.options.compatibilityAPI!=="v1"&&(this.options.interpolation={...o.interpolation,...this.options.interpolation}),n.keySeparator!==void 0&&(this.options.userDefinedKeySeparator=n.keySeparator),n.nsSeparator!==void 0&&(this.options.userDefinedNsSeparator=n.nsSeparator);function s(p){return p?typeof p=="function"?new p:p:null}if(!this.options.isClone){this.modules.logger?Xo.init(s(this.modules.logger),this.options):Xo.init(null,this.options);let p;this.modules.formatter?p=this.modules.formatter:typeof Intl<"u"&&(p=Tee);const m=new CP(this.options);this.store=new xP(this.options.resources,this.options);const g=this.services;g.logger=Xo,g.resourceStore=this.store,g.languageUtils=m,g.pluralResolver=new kee(m,{prepend:this.options.pluralSeparator,compatibilityJSON:this.options.compatibilityJSON,simplifyPluralSuffix:this.options.simplifyPluralSuffix}),p&&(!this.options.interpolation.format||this.options.interpolation.format===o.interpolation.format)&&(g.formatter=s(p),g.formatter.init(g,this.options),this.options.interpolation.format=g.formatter.format.bind(g.formatter)),g.interpolator=new Pee(this.options),g.utils={hasLoadedNamespace:this.hasLoadedNamespace.bind(this)},g.backendConnector=new jee(s(this.modules.backend),g.resourceStore,g,this.options),g.backendConnector.on("*",function(S){for(var w=arguments.length,v=new Array(w>1?w-1:0),x=1;x<w;x++)v[x-1]=arguments[x];t.emit(S,...v)}),this.modules.languageDetector&&(g.languageDetector=s(this.modules.languageDetector),g.languageDetector.init&&g.languageDetector.init(g,this.options.detection,this.options)),this.modules.i18nFormat&&(g.i18nFormat=s(this.modules.i18nFormat),g.i18nFormat.init&&g.i18nFormat.init(this)),this.translator=new pp(this.services,this.options),this.translator.on("*",function(S){for(var w=arguments.length,v=new Array(w>1?w-1:0),x=1;x<w;x++)v[x-1]=arguments[x];t.emit(S,...v)}),this.modules.external.forEach(S=>{S.init&&S.init(this)})}if(this.format=this.options.interpolation.format,r||(r=hp),this.options.fallbackLng&&!this.services.languageDetector&&!this.options.lng){const p=this.services.languageUtils.getFallbackCodes(this.options.fallbackLng);p.length>0&&p[0]!=="dev"&&(this.options.lng=p[0])}!this.services.languageDetector&&!this.options.lng&&this.logger.warn("init: no languageDetector is used and no lng is defined"),["getResource","hasResourceBundle","getResourceBundle","getDataByLanguage"].forEach(p=>{this[p]=function(){return t.store[p](...arguments)}}),["addResource","addResources","addResourceBundle","removeResourceBundle"].forEach(p=>{this[p]=function(){return t.store[p](...arguments),t}});const u=fu(),f=()=>{const p=(m,g)=>{this.isInitializing=!1,this.isInitialized&&!this.initializedStoreOnce&&this.logger.warn("init: i18next is already initialized. You should call init just once!"),this.isInitialized=!0,this.options.isClone||this.logger.log("initialized",this.options),this.emit("initialized",this.options),u.resolve(g),r(m,g)};if(this.languages&&this.options.compatibilityAPI!=="v1"&&!this.isInitialized)return p(null,this.t.bind(this));this.changeLanguage(this.options.lng,p)};return this.options.resources||!this.options.initImmediate?f():setTimeout(f,0),u}loadResources(t){let r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:hp;const o=typeof t=="string"?t:this.language;if(typeof t=="function"&&(r=t),!this.options.resources||this.options.partialBundledLanguages){if(o&&o.toLowerCase()==="cimode"&&(!this.options.preload||this.options.preload.length===0))return r();const s=[],l=c=>{if(!c||c==="cimode")return;this.services.languageUtils.toResolveHierarchy(c).forEach(f=>{f!=="cimode"&&s.indexOf(f)<0&&s.push(f)})};o?l(o):this.services.languageUtils.getFallbackCodes(this.options.fallbackLng).forEach(u=>l(u)),this.options.preload&&this.options.preload.forEach(c=>l(c)),this.services.backendConnector.load(s,this.options.ns,c=>{!c&&!this.resolvedLanguage&&this.language&&this.setResolvedLanguage(this.language),r(c)})}else r(null)}reloadResources(t,n,r){const o=fu();return t||(t=this.languages),n||(n=this.options.ns),r||(r=hp),this.services.backendConnector.reload(t,n,s=>{o.resolve(),r(s)}),o}use(t){if(!t)throw new Error("You are passing an undefined module! Please check the object you are passing to i18next.use()");if(!t.type)throw new Error("You are passing a wrong module! Please check the object you are passing to i18next.use()");return t.type==="backend"&&(this.modules.backend=t),(t.type==="logger"||t.log&&t.warn&&t.error)&&(this.modules.logger=t),t.type==="languageDetector"&&(this.modules.languageDetector=t),t.type==="i18nFormat"&&(this.modules.i18nFormat=t),t.type==="postProcessor"&&wP.addPostProcessor(t),t.type==="formatter"&&(this.modules.formatter=t),t.type==="3rdParty"&&this.modules.external.push(t),this}setResolvedLanguage(t){if(!(!t||!this.languages)&&!(["cimode","dev"].indexOf(t)>-1))for(let n=0;n<this.languages.length;n++){const r=this.languages[n];if(!(["cimode","dev"].indexOf(r)>-1)&&this.store.hasLanguageSomeTranslations(r)){this.resolvedLanguage=r;break}}}changeLanguage(t,n){var r=this;this.isLanguageChangingTo=t;const o=fu();this.emit("languageChanging",t);const s=u=>{this.language=u,this.languages=this.services.languageUtils.toResolveHierarchy(u),this.resolvedLanguage=void 0,this.setResolvedLanguage(u)},l=(u,f)=>{f?(s(f),this.translator.changeLanguage(f),this.isLanguageChangingTo=void 0,this.emit("languageChanged",f),this.logger.log("languageChanged",f)):this.isLanguageChangingTo=void 0,o.resolve(function(){return r.t(...arguments)}),n&&n(u,function(){return r.t(...arguments)})},c=u=>{!t&&!u&&this.services.languageDetector&&(u=[]);const f=typeof u=="string"?u:this.services.languageUtils.getBestMatchFromCodes(u);f&&(this.language||s(f),this.translator.language||this.translator.changeLanguage(f),this.services.languageDetector&&this.services.languageDetector.cacheUserLanguage&&this.services.languageDetector.cacheUserLanguage(f)),this.loadResources(f,p=>{l(p,f)})};return!t&&this.services.languageDetector&&!this.services.languageDetector.async?c(this.services.languageDetector.detect()):!t&&this.services.languageDetector&&this.services.languageDetector.async?this.services.languageDetector.detect.length===0?this.services.languageDetector.detect().then(c):this.services.languageDetector.detect(c):c(t),o}getFixedT(t,n,r){var o=this;const s=function(l,c){let u;if(typeof c!="object"){for(var f=arguments.length,p=new Array(f>2?f-2:0),m=2;m<f;m++)p[m-2]=arguments[m];u=o.options.overloadTranslationOptionHandler([l,c].concat(p))}else u={...c};u.lng=u.lng||s.lng,u.lngs=u.lngs||s.lngs,u.ns=u.ns||s.ns,u.keyPrefix!==""&&(u.keyPrefix=u.keyPrefix||r||s.keyPrefix);const g=o.options.keySeparator||".";let S;return u.keyPrefix&&Array.isArray(l)?S=l.map(w=>`${u.keyPrefix}${g}${w}`):S=u.keyPrefix?`${u.keyPrefix}${g}${l}`:l,o.t(S,u)};return typeof t=="string"?s.lng=t:s.lngs=t,s.ns=n,s.keyPrefix=r,s}t(){return this.translator&&this.translator.translate(...arguments)}exists(){return this.translator&&this.translator.exists(...arguments)}setDefaultNamespace(t){this.options.defaultNS=t}hasLoadedNamespace(t){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(!this.isInitialized)return this.logger.warn("hasLoadedNamespace: i18next was not initialized",this.languages),!1;if(!this.languages||!this.languages.length)return this.logger.warn("hasLoadedNamespace: i18n.languages were undefined or empty",this.languages),!1;const r=n.lng||this.resolvedLanguage||this.languages[0],o=this.options?this.options.fallbackLng:!1,s=this.languages[this.languages.length-1];if(r.toLowerCase()==="cimode")return!0;const l=(c,u)=>{const f=this.services.backendConnector.state[`${c}|${u}`];return f===-1||f===2};if(n.precheck){const c=n.precheck(this,l);if(c!==void 0)return c}return!!(this.hasResourceBundle(r,t)||!this.services.backendConnector.backend||this.options.resources&&!this.options.partialBundledLanguages||l(r,t)&&(!o||l(s,t)))}loadNamespaces(t,n){const r=fu();return this.options.ns?(typeof t=="string"&&(t=[t]),t.forEach(o=>{this.options.ns.indexOf(o)<0&&this.options.ns.push(o)}),this.loadResources(o=>{r.resolve(),n&&n(o)}),r):(n&&n(),Promise.resolve())}loadLanguages(t,n){const r=fu();typeof t=="string"&&(t=[t]);const o=this.options.preload||[],s=t.filter(l=>o.indexOf(l)<0&&this.services.languageUtils.isSupportedCode(l));return s.length?(this.options.preload=o.concat(s),this.loadResources(l=>{r.resolve(),n&&n(l)}),r):(n&&n(),Promise.resolve())}dir(t){if(t||(t=this.resolvedLanguage||(this.languages&&this.languages.length>0?this.languages[0]:this.language)),!t)return"rtl";const n=["ar","shu","sqr","ssh","xaa","yhd","yud","aao","abh","abv","acm","acq","acw","acx","acy","adf","ads","aeb","aec","afb","ajp","apc","apd","arb","arq","ars","ary","arz","auz","avl","ayh","ayl","ayn","ayp","bbz","pga","he","iw","ps","pbt","pbu","pst","prp","prd","ug","ur","ydd","yds","yih","ji","yi","hbo","men","xmn","fa","jpr","peo","pes","prs","dv","sam","ckb"],r=this.services&&this.services.languageUtils||new CP(kP());return n.indexOf(r.getLanguagePartFromCode(t))>-1||t.toLowerCase().indexOf("-arab")>1?"rtl":"ltr"}static createInstance(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},n=arguments.length>1?arguments[1]:void 0;return new hu(t,n)}cloneInstance(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:hp;const r=t.forkResourceStore;r&&delete t.forkResourceStore;const o={...this.options,...t,isClone:!0},s=new hu(o);return(t.debug!==void 0||t.prefix!==void 0)&&(s.logger=s.logger.clone(t)),["store","services","language"].forEach(c=>{s[c]=this[c]}),s.services={...this.services},s.services.utils={hasLoadedNamespace:s.hasLoadedNamespace.bind(s)},r&&(s.store=new xP(this.store.data,o),s.services.resourceStore=s.store),s.translator=new pp(s.services,o),s.translator.on("*",function(c){for(var u=arguments.length,f=new Array(u>1?u-1:0),p=1;p<u;p++)f[p-1]=arguments[p];s.emit(c,...f)}),s.init(o,n),s.translator.options=o,s.translator.backendConnector.services.utils={hasLoadedNamespace:s.hasLoadedNamespace.bind(s)},s}toJSON(){return{options:this.options,store:this.store,language:this.language,languages:this.languages,resolvedLanguage:this.resolvedLanguage}}}const ln=hu.createInstance();ln.createInstance=hu.createInstance,ln.createInstance,ln.dir,ln.init,ln.loadResources,ln.reloadResources,ln.use,ln.changeLanguage,ln.getFixedT,ln.t,ln.exists,ln.setDefaultNamespace,ln.hasLoadedNamespace,ln.loadNamespaces,ln.loadLanguages;class Mee extends Id{register(){this.app.once("booting",()=>{this.initI18Next(),this.translateModelNames()})}boot(){this.translateModelColumns(),this.translateMenuEntries(),this.translateInstanceActions(),this.translateMassActions(),this.translateFormLabels(),this.translateStaticActions()}initI18Next(){ln.use(KY).init({lng:Ii.get("app.locale","en"),fallbackLng:Ii.get("app.fallback_locale","en"),resources:{[Ii.get("app.locale","en")]:{translation:Ii.get("trans",{})}},...Ii.get("i18n",{}),interpolation:{prefix:":",suffix:"",prefixEscaped:":\\b",suffixEscaped:"(?:\\b)",...Ii.get("i18n.interpolation",{})},debug:Ii.get("app.debug",!1)})}translateModelNames(){cc.reducer("model",t=>class extends t{static singular(){return ln.t(t.singular())}static plural(){return ln.t(t.plural())}},0)}translateModelColumns(){for(const t of Object.keys(cc.make()))dr.reducer(`model${Ke.studly(t)}Columns`,n=>n.map(r=>({...r,label:ln.t(r.label)})),99)}translateMenuEntries(){dr.reducer("menuItems",t=>{const n=t.find(r=>r.key==="dashboard");return n&&(n.text=ln.t(n.text)),t},5)}translateMassActions(){dr.reducer("massActions",t=>t.map(n=>({...n,label:ln.t(n.label)})),99)}translateInstanceActions(){dr.reducer("instanceActions",t=>t.map(n=>({...n,label:ln.t(n.label)})),99)}translateStaticActions(){dr.reducer("staticActions",(t,n)=>{const r=t.find(({key:o})=>o==="create");return r&&(r.label=ln.t("Create :model",{model:n.singular()})),t})}translateFormLabels(){zi.reducer("getDefaultInputProps",t=>Array.isArray(t)?t.map(n=>({...n,label:n!=null&&n.label?ln.t(n.label):n==null?void 0:n.label})):{...t,label:t!=null&&t.label?ln.t(t.label):t==null?void 0:t.label},99)}}const _ee={palette:{primary:{main:"#1d9798"},secondary:{main:"#fa510c"}}},Iee=e=>e.make("cms").getRoutes(),Lee=({theme:e=_ee,themeArgs:t,providers:n,...r})=>{const o=df("(prefers-color-scheme: dark)"),s=te.useMemo(()=>$g({...e,palette:{...e.palette,mode:o?"dark":"light"}},...t??[]),[e,o,t]),l=te.useMemo(()=>[mv,Mee,...n||[]],[n]);return y.jsxs(h6,{theme:s,children:[y.jsx(p7,{}),y.jsx(I4,{routes:Iee,providers:l,...r})]})},OP=document.getElementById("root");if(!OP)throw new Error("Failed to find the root element");xh.createRoot(OP).render(y.jsx(te.StrictMode,{children:y.jsx(Lee,{})}))})();
|
|
185
|
+
`+s)}}catch{}}throw r}}_request(t,n){typeof t=="string"?(n=n||{},n.url=t):n=t||{},n=Vs(this.defaults,n);const{transitional:r,paramsSerializer:o,headers:s}=n;r!==void 0&&sp.assertOptions(r,{silentJSONParsing:uo.transitional(uo.boolean),forcedJSONParsing:uo.transitional(uo.boolean),clarifyTimeoutError:uo.transitional(uo.boolean),legacyInterceptorReqResOrdering:uo.transitional(uo.boolean)},!1),o!=null&&(re.isFunction(o)?n.paramsSerializer={serialize:o}:sp.assertOptions(o,{encode:uo.function,serialize:uo.function},!0)),n.allowAbsoluteUrls!==void 0||(this.defaults.allowAbsoluteUrls!==void 0?n.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls:n.allowAbsoluteUrls=!0),sp.assertOptions(n,{baseUrl:uo.spelling("baseURL"),withXsrfToken:uo.spelling("withXSRFToken")},!0),n.method=(n.method||this.defaults.method||"get").toLowerCase();let l=s&&re.merge(s.common,s[n.method]);s&&re.forEach(["delete","get","head","post","put","patch","query","common"],w=>{delete s[w]}),n.headers=ur.concat(l,s);const c=[];let u=!0;this.interceptors.request.forEach(function(v){if(typeof v.runWhen=="function"&&v.runWhen(n)===!1)return;u=u&&v.synchronous;const x=n.transitional||Yy;x&&x.legacyInterceptorReqResOrdering?c.unshift(v.fulfilled,v.rejected):c.push(v.fulfilled,v.rejected)});const f=[];this.interceptors.response.forEach(function(v){f.push(v.fulfilled,v.rejected)});let p,m=0,g;if(!u){const w=[iP.bind(this),void 0];for(w.unshift(...c),w.push(...f),g=w.length,p=Promise.resolve(n);m<g;)p=p.then(w[m++],w[m++]);return p}g=c.length;let S=n;for(;m<g;){const w=c[m++],v=c[m++];try{S=w(S)}catch(x){v.call(this,x);break}}try{p=iP.call(this,S)}catch(w){return Promise.reject(w)}for(m=0,g=f.length;m<g;)p=p.then(f[m++],f[m++]);return p}getUri(t){t=Vs(this.defaults,t);const n=Yk(t.baseURL,t.url,t.allowAbsoluteUrls);return Wk(n,t.params,t.paramsSerializer)}};re.forEach(["delete","get","head","options"],function(t){Ks.prototype[t]=function(n,r){return this.request(Vs(r||{},{method:t,url:n,data:(r||{}).data}))}}),re.forEach(["post","put","patch","query"],function(t){function n(r){return function(s,l,c){return this.request(Vs(c||{},{method:t,headers:r?{"Content-Type":"multipart/form-data"}:{},url:s,data:l}))}}Ks.prototype[t]=n(),t!=="query"&&(Ks.prototype[t+"Form"]=n(!0))});let QX=class t2{constructor(t){if(typeof t!="function")throw new TypeError("executor must be a function.");let n;this.promise=new Promise(function(s){n=s});const r=this;this.promise.then(o=>{if(!r._listeners)return;let s=r._listeners.length;for(;s-- >0;)r._listeners[s](o);r._listeners=null}),this.promise.then=o=>{let s;const l=new Promise(c=>{r.subscribe(c),s=c}).then(o);return l.cancel=function(){r.unsubscribe(s)},l},t(function(s,l,c){r.reason||(r.reason=new uu(s,l,c),n(r.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(t){if(this.reason){t(this.reason);return}this._listeners?this._listeners.push(t):this._listeners=[t]}unsubscribe(t){if(!this._listeners)return;const n=this._listeners.indexOf(t);n!==-1&&this._listeners.splice(n,1)}toAbortSignal(){const t=new AbortController,n=r=>{t.abort(r)};return this.subscribe(n),t.signal.unsubscribe=()=>this.unsubscribe(n),t.signal}static source(){let t;return{token:new t2(function(o){t=o}),cancel:t}}};function YX(e){return function(n){return e.apply(null,n)}}function JX(e){return re.isObject(e)&&e.isAxiosError===!0}const rv={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511,WebServerIsDown:521,ConnectionTimedOut:522,OriginIsUnreachable:523,TimeoutOccurred:524,SslHandshakeFailed:525,InvalidSslCertificate:526};Object.entries(rv).forEach(([e,t])=>{rv[t]=e});function aP(e){const t=new Ks(e),n=Ok(Ks.prototype.request,t);return re.extend(n,Ks.prototype,t,{allOwnKeys:!0}),re.extend(n,t,null,{allOwnKeys:!0}),n.create=function(o){return aP(Vs(e,o))},n}const Tn=aP(cu);Tn.Axios=Ks,Tn.CanceledError=uu,Tn.CancelToken=QX,Tn.isCancel=Kk,Tn.VERSION=ev,Tn.toFormData=np,Tn.AxiosError=et,Tn.Cancel=Tn.CanceledError,Tn.all=function(t){return Promise.all(t)},Tn.spread=YX,Tn.isAxiosError=JX,Tn.mergeConfig=Vs,Tn.AxiosHeaders=ur,Tn.formToJSON=e=>Vk(re.isHTMLForm(e)?new FormData(e):e),Tn.getAdapter=oP.getAdapter,Tn.HttpStatusCode=rv,Tn.default=Tn;const{Axios:Yne,AxiosError:Jne,CanceledError:Xne,isCancel:Zne,CancelToken:ere,VERSION:tre,all:nre,Cancel:rre,isAxiosError:XX,spread:ore,toFormData:ire,AxiosHeaders:sre,HttpStatusCode:are,formToJSON:lre,getAdapter:cre,mergeConfig:ure,create:dre}=Tn;function qs(e){return t=>{var n;if(!(t instanceof Error))throw t;e({message:XX(t)?((n=t.response)==null?void 0:n.data.message)??t.message:t.message,severity:"error"})}}function ov(){return te.useContext(By).notify}function ZX(){const e=ov();return te.useCallback(t=>{qs(e)(t)},[e])}const eZ=({create:e=!1})=>{const[t,n]=te.useState(),{id:r}=xB(),{t:o}=Nn(),s=ov(),l=yc(),c=Si(),u=Hr("breakpoint","md");Uy(t!=null&&t.exists?o("Edit :model “:label“",{model:c.singular(),label:(t==null?void 0:t.getLabel())||"..."}):o("Create :model",{model:c.singular()})),hJ();const f=kt("cms").getComponent("Breadcrumbs");te.useEffect(()=>{e?n(new c):c.find(r).then(S=>n(S??void 0))},[r,c,e]);const p=te.useCallback(()=>{s(o(":model saved successfully",{model:c.singular()})),t!=null&&t.wasRecentlyCreated&&l(`/${Ke.kebab(c.plural())}/${t.getKey()}`)},[s,l,c,t,o]),m=ZX(),g=te.useMemo(()=>kt("cms").getModelFormProps(t),[t]);return t?y.jsx(Wr,{sx:{p:{xs:1,sm:2,md:3}},children:y.jsxs(xi,{container:!0,children:[y.jsx(xi,{xs:12,children:y.jsx(f,{parts:[{name:c.plural(),href:"/"+Ke.kebab(c.plural())},{name:t.exists?t.getLabel():o("New")}]})}),y.jsx(xi,{xs:12,[u]:6,children:y.jsx(qd,{submitText:o("Save"),...g,item:t,onSuccess:p,onError:m})})]})}):null};function tZ(e){const{setDisplacement:t}=te.useContext(By),n=Sr(),r=Rn(),o=n.spacing(r?3:1),s=e===!1?o:n.spacing(e);te.useEffect(()=>(t(s),()=>{t(o)}),[s,o,t])}function nZ(){return te.useContext(gk).dialog}function iv(){const e=yc(),t=ov(),n=nZ(),{t:r}=Nn(),{refresh:o}=bc();return{navigate:e,notify:t,dialog:n,t:r,refresh:o}}const rZ=ce(hy)(({theme:e})=>({position:"fixed",bottom:e.spacing(2),right:e.spacing(2)})),oZ=ce(MG)(({theme:e})=>({position:"fixed",bottom:e.spacing(2),right:e.spacing(2)})),iZ=({variant:e="default"})=>{const t=Si(),n=Rn(),[r]=Ro(),o=r.get("tab")??"all",[s,l]=te.useState(!1),c=te.useRef(null),[u,f]=te.useState(0),p=iv(),m=te.useMemo(()=>kt("cms").getStaticActions(t,o),[t,o]);if(tZ(e==="fab"&&m.length>0?n?12:10:!1),m.length===0)return null;const g=(v,x)=>{f(x),l(!1)},S=()=>{l(v=>!v)},w=v=>{c.current&&c.current.contains(v.target)||l(!1)};return e==="fab"?m.length===1?bs.createPortal(y.jsx(rZ,{color:"primary",onClick:()=>m[0].callback(p),children:m[0].icon||m[0].label.charAt(0).toUpperCase()}),document.body):bs.createPortal(y.jsx(oZ,{ariaLabel:`actions for ${t.singular()}`,icon:y.jsx(JE,{}),color:"primary",onClose:()=>l(!1),onOpen:()=>l(!0),open:s,children:m.map(v=>y.jsx(GG,{icon:v.icon||v.label.charAt(0).toUpperCase(),tooltipTitle:v.label,onClick:()=>v.callback(p)},v.label))}),document.body):y.jsxs(y.Fragment,{children:[y.jsxs(DH,{variant:"contained",ref:c,"aria-label":m[u].label,children:[y.jsx(ar,{onClick:()=>m[u].callback(p),children:m[u].label}),m.length>1&&y.jsx(ar,{variant:"contained",size:"small","aria-controls":s?"split-button-menu":void 0,"aria-expanded":s?"true":void 0,"aria-label":`select ${t.singular()} actions`,"aria-haspopup":"menu",onClick:S,children:y.jsx(bk,{})})]}),y.jsx(Qc,{open:s,anchorEl:c.current,role:void 0,transition:!0,children:({TransitionProps:v,placement:x})=>y.jsx(tl,{...v,style:{transformOrigin:x==="bottom"?"center top":"center bottom"},children:y.jsx(io,{children:y.jsx(aE,{onClickAway:w,children:y.jsx(kE,{id:"split-button-menu",children:m.map((R,k)=>y.jsx(Gi,{selected:k===u,onClick:O=>g(O,k),children:R.label},R.label))})})})})})]})};function sv(){const{open:e,setOpen:t}=te.useContext(Jo);return{open:e,handleDrawerOpen:()=>{t(!0)},handleDrawerClose:()=>{t(!1)},toggle:()=>{t(s=>!s)}}}function lP(){const{currentPage:e}=te.useContext(Jo);return e}function cP(){const{showSearch:e}=te.useContext(Jo);return e}function uP(){const{showBackButton:e}=te.useContext(Jo);return e}const sZ=ce(xR,{shouldForwardProp:e=>!["open","drawerWidth","height"].includes(String(e))})(({theme:e,open:t,drawerWidth:n,height:r})=>({zIndex:e.zIndex.drawer+1,transition:e.transitions.create(["width","margin"],{easing:e.transitions.easing.sharp,duration:e.transitions.duration.leavingScreen}),height:r,...t&&{marginLeft:n,width:`calc(100% - ${n}px)`,transition:e.transitions.create(["width","margin"],{easing:e.transitions.easing.sharp,duration:e.transitions.duration.enteringScreen})}})),aZ=ce(xR,{shouldForwardProp:e=>!["open","drawerWidth","height"].includes(String(e))})(({height:e})=>({height:e})),lZ=({slots:e={},...t})=>{const n=Rn(),r=n?sZ:aZ,{["Layout.AppBar.MenuButton"]:o,["Layout.SearchBar"]:s,["Layout.BackButton"]:l,["Layout.AppLogo"]:c}=kt("cms").getComponents(),{open:u}=sv(),f=cP(),p=uP(),m=Hr("appBar.height"),g=Hr("drawer.width",280),{start:S=null,end:w=null}=e,v=lP();return y.jsx(r,{open:u,height:m,drawerWidth:g,...t,children:y.jsxs(QQ,{children:[(n&&!u||!n&&!p)&&y.jsx(o,{}),!n&&p&&y.jsx(l,{}),n?null:S,y.jsx(bn,{width:"100%",variant:"h6",noWrap:!0,component:"div",children:!n&&v||_i("app.name",document.title)}),y.jsx(Wr,{sx:{flexGrow:1}}),y.jsxs(Wr,{display:"flex",alignItems:"center",children:[f&&y.jsx(s,{}),w||y.jsx(c,{})]})]})})};function cZ(e){return y.jsx(Vn,{component:Hd,to:-1,edge:"start",color:"inherit","aria-label":"back",...e,children:y.jsx(qf,{})})}const dP=(e,t)=>({width:t,transition:e.transitions.create("width",{easing:e.transitions.easing.sharp,duration:e.transitions.duration.enteringScreen}),overflowX:"hidden"}),fP=e=>({transition:e.transitions.create("width",{easing:e.transitions.easing.sharp,duration:e.transitions.duration.leavingScreen}),overflowX:"hidden",width:`calc(${e.spacing(9)} + 1px)`,[e.breakpoints.up("sm")]:{width:`calc(${e.spacing(10)} + 1px)`}}),uZ=ce(mE,{shouldForwardProp:e=>!["open","width"].includes(String(e))})(({theme:e,open:t,width:n})=>({flexShrink:0,whiteSpace:"nowrap",boxSizing:"border-box",...t&&{...dP(e,n),"& .MuiDrawer-paper":dP(e,n)},...!t&&{...fP(e),"& .MuiDrawer-paper":fP(e)}})),dZ=ce(mE,{shouldForwardProp:e=>e!=="width"})(()=>({})),fZ=ce("div")(({theme:e})=>({display:"flex",alignItems:"center",justifyContent:"space-between",padding:e.spacing(0,1),...e.mixins.toolbar})),pZ=e=>{const t=Sr(),n=Rn(),{open:r,handleDrawerClose:o}=sv(),s=n?uZ:dZ,l=Hr("drawer.width",280),c=Hr("appBar.height"),u=kt("cms").getComponent("RecursiveList"),f=kt("cms").getComponent("Layout.Drawer.LogoutButton"),p=kt("cms").getMenuItems();return y.jsxs(s,{variant:n?"permanent":"temporary",open:r,width:l,onClose:o,PaperProps:{sx:{width:l,display:"flex",flexDirection:"column"}},sx:{display:"flex",direction:"flex-column",flexWrap:"nowrap",height:"100%"},...e,children:[y.jsx(fZ,{style:{height:c},children:y.jsx(Vn,{onClick:o,children:t.direction==="ltr"?y.jsx(qf,{}):y.jsx(Gf,{})})}),y.jsx(el,{}),y.jsx(Wr,{sx:{flexGrow:1,overflowY:"auto",overflowX:"hidden"},children:y.jsx(u,{collapsed:!r&&n,items:p,onClick:()=>!n&&o()})}),y.jsx(f,{collapsed:!r&&n})]})},hZ=()=>{const e=lP(),t=Hr("breakpoint","md"),n=uP(),{["Layout.BackButton"]:r}=kt("cms").getComponents();return y.jsxs(io,{sx:{display:{xs:"none",[t]:"flex"},boxShadow:o=>o.shadows[3],py:2,px:3,borderRadius:0,alignItems:"center"},children:[n&&y.jsx(r,{}),y.jsx(bn,{variant:"h5",noWrap:!0,children:e})]})},av=te.createContext({Model:null,anchorEl:null,setAnchorEl:()=>{},columnsFilter:[],setColumnsFilter:()=>{},searchParams:new URLSearchParams,setSearchParams:()=>{},handleApplyFilters:()=>{},clearSearchParams:()=>{},clearFilters:()=>{}}),ul=te.createContext({key:"",type:"",operator:"",value:"",isRelation:!1,setKey:()=>{},setType:()=>{},setOperator:()=>{},setValue:()=>{},setIsRelation:()=>{}}),mZ=e=>{if(!Array.isArray(e))return e;let t;return Me.isEmpty(e)?t="":t=e[0],t},gZ=e=>{if(Array.isArray(e))return e;let t;return Me.isEmpty(e)?t=[]:t=[e,""],t},yZ=async(e,t,n)=>{const r=e.getSchema().relations[t],o=lc().make(r.model),s=o.getSchema().primaryKey,l=[];for(const c of n){const u=await o.where(s,c).first();l.push(u)}return l};function vZ(e,t){const n=kt("filter"),{Model:r,setColumnsFilter:o}=te.useContext(av),[s,l]=te.useState(t.key),[c,u]=te.useState(t.operator),[f,p]=te.useState(t.type),[m,g]=te.useState(t.value),[S,w]=te.useState(t.nullable),[v,x]=te.useState(t.is_relation),R=te.useMemo(()=>n.getFilterableColumns(r),[r]),k=j=>()=>{o(T=>T.filter((M,N)=>N!==j))},O=async j=>{var W;const T=j.target.value,M=R.find(q=>q.key===T),N=(M==null?void 0:M.type)??"text",F=(M==null?void 0:M.nullable)??!1,D=(M==null?void 0:M.is_relation)??!1;u(((W=n.getMatchingOperators(M)[0])==null?void 0:W.key)??"equals"),D&&g([]),x(D),w(F),N!==f&&g(()=>{if(["between","notBetween"].includes(c))return[];switch(n.getInputType(N)){case"number":return 0;case"boolean":return 0;default:return""}}),l(T),p(N)},$=async j=>{const T=j.target.value;c!==T&&g(M=>{switch(T){case"between":case"notBetween":return gZ(M);case"null":case"notNull":return"1";default:return mZ(M)}}),u(T)};return te.useEffect(()=>{o(j=>j.map((M,N)=>e===N?{...M,key:s,operator:c,type:f,value:m,nullable:S,is_relation:v}:M))},[s,c,f,m,S,v]),{columns:R,key:s,setKey:l,operator:c,setOperator:u,type:f,setType:p,value:m,setValue:g,nullable:S,setNullable:w,isRelation:v,setIsRelation:x,handleKey:O,handleOperator:$,handleRemoveColumn:k}}const pP=async(e,t,n)=>{const r=e.getSchema().relations[t].model,{data:o}=await lc().make(r).get(),s=o.all().filter(f=>!n.find(p=>p.getKey()===f.getKey())),l=s.length,c=n.length,u=15;return l+c>u?Wn([...n,...s.slice(0,u-c)]):Wn([...n,...s])},bZ=async(e,t,n="",r)=>{const o=e.getSchema().relations[t],s=lc().make(o.model),l=s.getSchema().primaryKey,{data:c}=await s.searchBy(n).get();return Wn([...r,...c]).unique(l)},xZ=()=>{const e=Rn(),t=Si(),{key:n,value:r,setValue:o}=te.useContext(ul),[s,l]=te.useState(!1),[c,u]=te.useState(""),[f,p]=te.useState(Wn([])),[m,g]=te.useState([]),S=te.useMemo(()=>s&&f.count()===0,[s,f]),w=async(v,x)=>{u(x),Me.isEmpty(x)||p(await bZ(t,n,x,Wn(m)))};return te.useEffect(()=>{r.length>0&&(async()=>g(await yZ(t,n,r)))()},[]),te.useEffect(()=>{let v=!0;if(S)return(async()=>v&&p(await pP(t,n,m)))(),()=>{v=!1}},[S]),te.useEffect(()=>{o(m.map(v=>v.getKey())),Me.isEmpty(c)?(async()=>p(await pP(t,n,m)))():p(Wn([]))},[m]),y.jsx(W9,{sx:{width:e?377:"100%"},open:s,onOpen:()=>{l(!0)},onClose:()=>{l(!1)},value:m,onChange:(v,x)=>{g(x)},inputValue:c,onInputChange:w,options:f.all()||[],getOptionLabel:v=>v.getLabel(),isOptionEqualToValue:(v,x)=>v.getKey()===x.getKey(),filterOptions:v=>v,renderInput:v=>y.jsx(wZ,{params:v,loading:S}),size:"small",loading:S,disableCloseOnSelect:!0,autoHighlight:!0,multiple:!0})},wZ=({params:e,loading:t})=>{const{t:n}=Nn();return y.jsx(sl,{...e,label:n("Value"),InputProps:{...e.InputProps,endAdornment:y.jsxs(te.Fragment,{children:[t?y.jsx(l7,{color:"inherit",size:20}):null,e.InputProps.endAdornment]})}})},lv=({index:e=null})=>{const{t}=Nn(),n=Rn(),r=kt("filter"),{type:o,value:s,setValue:l}=te.useContext(ul),u=r.getInputType(o)==="datetime-local"?230:167.5,f=e!==null?`${t("Date")} ${e+1}`:`${t("Date")}`,p=te.useMemo(()=>e!==null?s[e]:s,[s]),m=g=>{l(typeof e=="number"?S=>{const w=S;return w[e]=g.target.value,[...w]}:g.target.value)};return y.jsx(sl,{type:r.getInputType(o),label:f,value:sc.toDateTimeLocal(sc.parse(p)),onChange:m,size:"small",sx:{width:n?u:"100%"}})},SZ=()=>{const e=Rn(),{value:t,setValue:n}=te.useContext(ul),r=o=>{const s=o.target.checked;n(s?1:0)};return y.jsxs(y.Fragment,{children:[y.jsx(aQ,{checked:t,onChange:r,inputProps:{"aria-label":"filter-controlled"},size:"small"}),e&&y.jsx(Wr,{width:325})]})},cv=({index:e=null})=>{const{t}=Nn(),n=Rn(),r=kt("filter"),{type:o,value:s,setValue:l}=te.useContext(ul),c=e!==null?`${t("Value")} ${e+1}`:`${t("Value")}`,u=te.useMemo(()=>e!==null?s[e]:s,[s]),f=p=>{l(typeof e=="number"?m=>{const g=m;return g[e]=p.target.value,[...g]}:p.target.value)};return y.jsx(sl,{type:r.getInputType(o),label:c,value:u||"",onChange:f,sx:{width:n?167.5:"100%"},size:"small"})},uv=()=>{const e=Rn(),t=kt("filter"),{type:n,operator:r}=te.useContext(ul),o=te.useMemo(()=>["between","notBetween"].includes(r),[r]);if(["null","notNull"].includes(r))return e?y.jsx(Wr,{width:230}):null;if(o)switch(t.getInputType(n)){case"date":case"datetime-local":return y.jsxs(y.Fragment,{children:[y.jsx(lv,{index:0}),y.jsx(lv,{index:1})]});default:return y.jsxs(y.Fragment,{children:[y.jsx(cv,{index:0}),y.jsx(cv,{index:1})]})}switch(t.getInputType(n)){case"date":case"datetime-local":return y.jsx(lv,{});case"autocomplete":return y.jsx(xZ,{});case"boolean":return y.jsx(SZ,{});default:return y.jsx(cv,{})}},CZ=({index:e,column:t})=>{const{t:n}=Nn(),r=Rn(),o=Hr("breakpoint","md"),s=kt("filter"),l=te.useMemo(()=>s.getMatchingOperators(t),[t]),{columns:c,key:u,setKey:f,operator:p,setOperator:m,type:g,setType:S,value:w,setValue:v,isRelation:x,setIsRelation:R,handleKey:k,handleOperator:O,handleRemoveColumn:$}=vZ(e,t),j=["boolean"].includes(s.getInputType(g));return y.jsx(ul.Provider,{value:{key:u,setKey:f,type:g,setType:S,operator:p,setOperator:m,value:w,setValue:v,isRelation:x,setIsRelation:R},children:y.jsxs(xi,{container:!0,display:"flex",flexDirection:{xs:"column",[o]:"row"},flexWrap:{xs:"wrap",[o]:"nowrap"},alignItems:"center",justifyContent:"space-between",gap:.5,children:[y.jsxs(lr,{display:"flex",flexDirection:{xs:"column",[o]:"row"},alignItems:"center",width:"100%",my:1,gap:1.5,children:[y.jsxs(lr,{direction:"row",alignItems:"center",...!r&&{width:"100%"},gap:1,children:[y.jsxs(Df,{sx:{width:r?195:`calc(100% - ${j?88:44}px)`},children:[y.jsx(Ff,{id:"filter-column-select-label",size:"small",children:n("Column")}),y.jsx(ol,{labelId:"filter-column-select-label",id:"filter-column-select",value:u,label:n("Column"),onChange:k,size:"small",children:c.map(({key:T,label:M})=>y.jsx(Gi,{value:T,children:n(M)},`column_${T}_option`))})]}),!r&&y.jsxs(lr,{direction:"row",alignItems:"center",children:[j&&y.jsx(uv,{}),y.jsx(Vn,{color:"error",onClick:$(e),children:y.jsx(Ny,{})})]})]}),!x&&!j&&y.jsxs(Df,{sx:{width:r?147.5:"100%"},children:[y.jsx(Ff,{id:"filter-operator-select-label",size:"small",children:n("Operator")}),y.jsx(ol,{labelId:"filter-operator-select-label",id:"filter-operator-select",value:p,label:n("Operator"),onChange:O,size:"small",children:l.map(({key:T,label:M})=>y.jsx(Gi,{value:T,children:n(M)},`operator_${T}_option`))})]}),r?y.jsx(uv,{}):!j&&y.jsx(uv,{})]},`filter_${u}_${e}`),r&&y.jsx(Vn,{color:"error",onClick:$(e),children:y.jsx(Ny,{})})]})})},hP=({dialog:e=!1})=>{const{t}=Nn(),n=Rn(),r=Hr("breakpoint","md"),o=kt("filter"),{columnsFilter:s,setColumnsFilter:l,handleApplyFilters:c,clearFilters:u}=te.useContext(av),f=()=>{l(p=>[...p,{key:"",operator:"contains",type:"text",value:"",appended:!1,nullable:!1,is_relation:!1}])};return y.jsxs(Wr,{sx:{minWidth:{[r]:567.5},p:e?0:2},children:[y.jsx(lr,{children:s.map((p,m,g)=>{const S=m==g.length-1;return y.jsxs(y.Fragment,{children:[y.jsx(CZ,{index:m,column:p},`row_${p.key}`),!n&&y.jsx(el,{sx:{mt:S?.625:1.25,mb:S?.75:1.5,...S&&{border:"none"}}})]})})}),y.jsx(lr,{direction:"row",alignItems:"center",justifyContent:"center",children:n?y.jsx(ar,{variant:"outlined",onClick:f,fullWidth:!0,sx:{mt:.75},children:`+ ${t("Add Column")}`}):y.jsx(Vn,{onClick:f,color:"primary",sx:{fontSize:32},children:y.jsx(yk,{fontSize:"inherit"})})}),n&&y.jsxs(lr,{direction:"row",justifyContent:"space-between",mt:2,children:[y.jsx(ar,{onClick:u,children:t("Clear")}),y.jsx(ar,{variant:"contained",onClick:c,disabled:o.checkIfCanApplyFilters(s),children:t("Apply")})]})]})};function RZ(e,t){const n=[],r=js.toObject(t);return!("where"in r)||Me.isEmpty(r.where)?[]:(Object.entries(r.where).forEach(([o,s])=>{let[l,c="equals"]=o.split(":");const u=e.find(p=>p.key===l);if(!u)return;c==="equals"&&u.is_relation&&(c="relation");let f=s;switch(u.type){case"text":{Array.isArray(s)&&(f=s.join(","));break}case"datetime-local":{Array.isArray(s)?f=s.map(p=>sc.toDateTimeLocal(p)):f=sc.toDateTimeLocal(s);break}case"boolean":{f=Number(s);break}}n.push({key:u.key,operator:c,type:u.type,value:f,nullable:u.nullable,is_relation:u.is_relation})}),n)}const EZ=e=>{const t=kt("filter"),n=new URLSearchParams;return e.forEach(r=>{const{key:o,operator:s,value:l,type:c}=r;let u=`:${s}`;if(["equals"].includes(s)&&(u=""),Array.isArray(l))l.forEach((f,p)=>{let m=f;switch(t.getInputType(c)){case"datetime-local":{m=new Date(f).toISOString();break}}n.set(`where[${o}${u}][${p}]`,m)});else{let f=l;switch(t.getInputType(c)){case"datetime-local":{f=new Date(l).toISOString();break}}n.set(`where[${o}${u}]`,f)}}),n},kZ=()=>{const{t:e}=Nn(),t=kt("filter"),n=Rn(),r=Si(),[o,s]=Ro(),l=te.useMemo(()=>"where"in js.toObject(o),[o]),[c,u]=te.useState(null),[f,p]=te.useState([]),m=!!c,g=te.useMemo(()=>t.getFilterableColumns(r),[r]),S=k=>{u(k.currentTarget)},w=()=>{u(null),setTimeout(()=>{p([])},300)},v=()=>{x();const k=EZ(f);s(k,{replace:!0}),w()},x=()=>{s(k=>{const O=new URLSearchParams(k);for(const[$]of k.entries())$.startsWith("where[")&&O.delete($);return O})},R=()=>{x(),w(),setTimeout(()=>{p([])},300)};return te.useEffect(()=>{const k=RZ(g,o);p(k)},[g,o,c]),y.jsxs(av.Provider,{value:{Model:r,anchorEl:c,setAnchorEl:u,columnsFilter:f,setColumnsFilter:p,searchParams:o,setSearchParams:s,handleApplyFilters:v,clearSearchParams:x,clearFilters:R},children:[y.jsx(Vn,{"aria-describedby":"model-filter-popover-button","aria-label":"filter",onClick:S,children:y.jsx(ry,{color:"secondary",variant:"dot",invisible:!l,children:y.jsx(Ck,{})})}),n?y.jsx(jE,{id:"model-filter-popover",open:m,anchorEl:c,onClose:w,anchorOrigin:{vertical:"bottom",horizontal:"left"},children:y.jsx(hP,{})}):y.jsxs(uy,{open:m,onClose:w,fullWidth:!0,children:[y.jsxs(py,{children:[e("Filter :model",{model:r.plural()}),y.jsx(Vn,{onClick:w,sx:{position:"absolute",right:8,top:8},children:y.jsx(Qf,{})})]}),y.jsx(fy,{dividers:!0,children:y.jsx(hP,{dialog:!0})}),y.jsxs(dy,{children:[y.jsx(ar,{onClick:R,sx:{mr:"auto"},children:e("Clear")}),y.jsx(ar,{variant:"contained",onClick:v,disabled:t.checkIfCanApplyFilters(f),children:e("Apply")})]})]})]})},dv=te.createContext({columns:[],columnCount:0,selected:Wn([]),massActions:[],items:Wn([]),error:new Error("Trying to access TableContext outside of TableProvider"),Model:null});function fv(){const{selected:e,items:t}=te.useContext(dv),n=Jm(e),r=()=>{e.splice(0,e.count())},o=f=>{const p=e.search(f);if(p!==!1){e.pull(p);return}e.push(f)},s=()=>{if(t){if(e.count()===t.count()){r();return}e.splice(0,e.count(),...t)}},l=f=>n.contains(f),c=t?n.count()>0&&n.count()<t.count():!1,u=t&&t.count()?n.count()===t.count():!1;return{selected:n,indeterminate:c,allSelected:u,isSelected:l,handleClearSelected:r,handleSelectToggle:o,handleSelectToggleAll:s}}function Xi(){return te.useContext(dv)}function PZ(e){const[t,n]=te.useState(""),{selected:r}=fv(),{t:o}=Nn(),s=iv(),{massActions:l}=Xi(),c=f=>{n(f.target.value)};if(te.useEffect(()=>{r.isEmpty()&&n("")},[r]),l.length===0)return null;const u=r.isEmpty()?o("Select items to apply"):o("Select action");return y.jsxs(lr,{direction:"row",alignItems:"center",...e,children:[y.jsxs(Df,{sx:{m:1,minWidth:200},size:"small",children:[y.jsx(Ff,{id:"mass-actions-select-label",children:u}),y.jsxs(ol,{labelId:"mass-actions-select-label",id:"mass-actions-select",value:t,label:u,onChange:c,disabled:r.isEmpty(),children:[y.jsx(Gi,{value:"",children:y.jsx("em",{children:o("None")})}),l.map(f=>y.jsx(Gi,{value:f.key,children:f.label},f.key))]})]}),y.jsx(ar,{size:"small",disabled:r.isEmpty()||!t,onClick:()=>{var f;(f=l.find(p=>p.key===t))==null||f.callback({selected:r,...s})},children:o("Apply")})]})}const OZ=()=>{const{handleDrawerOpen:e}=sv();return y.jsx(Vn,{color:"inherit","aria-label":"open drawer",edge:"start",onClick:e,sx:{mr:{md:2}},children:y.jsx(kk,{})})},ap=te.forwardRef(({to:e,children:t,...n},r)=>y.jsx(xy,{component:Hd,to:e,ref:r,sx:{textDecoration:"none"},...n,children:t}));ap.displayName="Link";const TZ=({label:e})=>{if(isNaN(e)||isNaN(parseFloat(e))){const t={"« Previous":y.jsx(qf,{}),"Next »":y.jsx(Gf,{}),"Last »":y.jsx(Ek,{}),"« First":y.jsx(Rk,{})};return y.jsx(y.Fragment,{children:t[e]||e})}return y.jsx(y.Fragment,{children:e})},$Z=({variant:e="default",...t})=>{const n=e==="default",[r,o]=Ro(),[s,l]=te.useState(r.get("page")||"1"),{links:c,meta:{current_page:u=1,links:f=[],last_page:p=1}={}}=bc(),{first:m,prev:g,next:S,last:w}=c||{},v=R=>{R.preventDefault(),o(k=>(k.set("page",s||"1"),k))},x=[{url:u>1?m:null,label:"« First",active:!1},{url:g,label:"« Previous",active:!1},{element:y.jsx(a4,{onSubmit:v,preventScrollReset:!0,children:y.jsx(sl,{size:"small",type:"number",variant:"standard",sx:{width:56,"& input":{textAlign:"center","&::-webkit-outer-spin-button, &::-webkit-inner-spin-button":{WebkitAppearance:"none",margin:0}}},value:s,error:Number(s)>p,helperText:Number(s)>p?`Max ${p}`:void 0,onChange:R=>{!Number.isNaN(Number(R.target.value))&&Number(R.target.value)>0&&l(R.target.value),R.target.value===""&&l("")},onBlur:R=>{o(k=>(k.set("page",R.target.value||"1"),k),{replace:!0})},disabled:p===1,"aria-label":"Page number"})},"page")},{url:S,label:"Next »",active:!1},{url:u<p?w:null,label:"Last »",active:!1}];return te.useEffect(()=>{u&&l(String(u))},[u]),y.jsx(lr,{spacing:1,direction:"row",justifyContent:"center",alignItems:"center",...t,children:(n?f:x).map((R,k)=>R.element||y.jsx(ar,{variant:R.active?"contained":"text",color:"primary",size:"small",sx:{minWidth:"unset",width:32,height:32,borderRadius:"50%"},disabled:!R.url,component:ap,to:R.url,children:y.jsx(TZ,{label:R.label})},k))})},jZ=()=>{const{t:e}=Nn(),{meta:{total:t=0,from:n=0,to:r=0}={}}=bc();return y.jsx(bn,{variant:"caption",noWrap:!0,children:e(":from–:to of :total",{from:n,to:r,total:t})})},AZ=()=>{const{t:e}=Nn(),{meta:{per_page:t=15}={}}=bc(),[,n]=Ro(),r=s=>{n(l=>{const c=new URLSearchParams(l);return c.set("per_page",s.target.value.toString()),c})},o=Xm(kt("cms"),"perPageOptions",[15,30,75,150]);return y.jsxs(lr,{direction:"row",alignItems:"center",gap:1,children:[y.jsxs(bn,{variant:"caption",children:[e("Rows per page"),":"]}),y.jsx(ol,{value:t,onChange:r,size:"small",variant:"standard",sx:{fontSize:s=>s.typography.caption.fontSize,"& .MuiSelect-select":{py:.5}},children:o.map(s=>y.jsx(Gi,{value:s,sx:{fontSize:l=>l.typography.caption.fontSize,minHeight:"unset",lineHeight:1,py:1.5},children:s},s))})]})};function MZ(e,t){const[n,r]=te.useState(!1);return te.useEffect(()=>{const o=new Set,s=c=>{o.add(c.key),e.every(u=>o.has(u))&&(r(!0),t&&t())},l=c=>{o.delete(c.key),e.every(u=>!o.has(u))&&r(!1)};return window.addEventListener("keydown",s),window.addEventListener("keyup",l),()=>{window.removeEventListener("keydown",s),window.removeEventListener("keyup",l)}},[e,t]),n}const _Z=ce(sl)(({theme:e})=>({"& .MuiInputBase-root":{backgroundColor:e.palette.background.paper}})),IZ=Rm.throttle((e,t)=>{t(n=>{const r=new URLSearchParams(n);return e?r.set("q",e):r.delete("q"),r})},500),LZ=()=>{const[e,t]=Ro(),n=e.get("q")||"",[r,o]=te.useState(n),[s,l]=te.useState(!1),c=te.useRef(null),{t:u}=Nn();te.useEffect(()=>{o(n)},[n]);const f=g=>{o(g.target.value),IZ(g.target.value,t)},p=Rn();MZ(["Control","/"],()=>{c.current.focus()});const m=p?300:"calc(100vw - 58px)";return y.jsxs(y.Fragment,{children:[!p&&!s&&y.jsx(Vn,{color:"inherit",onClick:()=>l(!0),children:y.jsx(ry,{variant:"dot",color:"secondary",invisible:!n,anchorOrigin:{vertical:"bottom",horizontal:"left"},children:y.jsx(Fy,{})})}),y.jsx(Fg,{orientation:"horizontal",in:p||s,addEndListener:()=>{var g;!p&&s&&((g=c.current)==null||g.focus())},unmountOnExit:!1,children:y.jsx(_Z,{placeholder:p?`(Ctrl + /) ${u("Search...")}`:`${u("Search...")}`,value:r,InputProps:{endAdornment:y.jsx(Fy,{})},inputProps:{ref:c},onChange:f,onBlur:()=>l(!1),sx:{width:m},size:"small"})})]})},NZ=({children:e,...t})=>y.jsx(wi,{sx:{width:"1px"},padding:"checkbox",...t,children:e}),DZ=()=>{const{t:e}=Nn(),[t,n]=Ro(),{columns:r,Model:o}=Xi(),s=t.get("order_by")||"",[l="",c=""]=s.split(":"),[u,f]=te.useState(l),[p,m]=te.useState(c),[g,S]=te.useState(!1),w=()=>{S(!0)},v=()=>{S(!1),f(l),m(c)},x=()=>{if(!u||!p){S(!1);return}n(k=>{const O=new URLSearchParams(k);return O.set("order_by",`${u}:${p}`),O}),S(!1)},R=()=>{n(k=>{const O=new URLSearchParams(k);return O.delete("order_by"),O}),S(!1),f(""),m("")};return y.jsxs(y.Fragment,{children:[y.jsx(Vn,{onClick:w,children:y.jsx(ry,{color:"secondary",variant:"dot",invisible:!l,children:y.jsx(Pk,{})})}),y.jsxs(uy,{open:g,onClose:v,fullWidth:!0,children:[y.jsxs(py,{children:[e("Sort :model",{model:o.plural()}),y.jsx(Vn,{onClick:v,sx:{position:"absolute",right:8,top:8},children:y.jsx(Qf,{})})]}),y.jsxs(fy,{dividers:!0,children:[y.jsxs(BE,{value:u,onChange:k=>{f(k.target.value),p||m("asc")},children:[y.jsx(bn,{variant:"caption",children:e("Column")}),y.jsx(el,{}),Wn(r).whereStrict("sortable","!=",!1).map(({key:k,label:O})=>y.jsx(gy,{value:k,control:y.jsx(Ty,{}),label:O},k))]}),y.jsx(bn,{variant:"caption",children:e("Direction")}),y.jsx(el,{}),y.jsxs(BE,{value:p,onChange:k=>m(k.target.value),children:[y.jsx(gy,{value:"asc",control:y.jsx(Ty,{}),label:y.jsxs(y.Fragment,{children:[e("Ascending"),y.jsx(xk,{})]})}),y.jsx(gy,{value:"desc",control:y.jsx(Ty,{}),label:y.jsxs(y.Fragment,{children:[e("Descending"),y.jsx(vk,{})]})})]})]}),y.jsxs(dy,{children:[y.jsx(ar,{onClick:R,sx:{mr:"auto"},children:e("Clear")}),y.jsx(ar,{onClick:x,variant:"contained",children:e("Apply")})]})]})]})},FZ=({items:e,loading:t,children:n,error:r})=>{const o=Si(),s=te.useMemo(()=>Wn([]),[o,e]),[l]=Ro(),c=l.get("tab")??"all",u=te.useMemo(()=>[{key:o.getSchema().labeledBy,label:Ke.human(o.getSchema().labeledBy)}],[o]),f=Rn(),p=te.useMemo(()=>kt("cms").getMassActions(o,c),[o,c]),m=Xm(kt("cms"),`model${Ke.studly(o.getSchemaName())}Columns`,u),S=(f?m.length:1)+(p.length>0?2:1),w={columns:m,columnCount:S,massActions:p,items:e,loading:t,selected:s,error:r,Model:o};return y.jsx(dv.Provider,{value:w,children:n})},BZ=({items:e,loading:t,error:n,children:r,...o})=>y.jsx(FZ,{items:e,loading:t,error:n,children:y.jsx(AQ,{component:io,children:y.jsx(gQ,{...o,children:r})})}),zZ=({children:e,...t})=>{const{massActions:n,columns:r,items:o}=Xi(),s=Rn(),[l,c]=Ro(),{indeterminate:u,allSelected:f,handleSelectToggleAll:p}=fv(),{["ModelIndex.Table.ShrinkedCell"]:m}=kt("cms").getComponents(),g=l.get("order_by")||"",[S,w]=g.split(":"),v=x=>()=>{c(S===x?R=>{const k=new URLSearchParams(R);return w?w==="desc"?(k.delete("order_by"),k):(k.set("order_by",`${x}:desc`),k):(k.set("order_by",`${x}:asc`),k)}:R=>{const k=new URLSearchParams(R);return k.set("order_by",`${x}:asc`),k})};return y.jsxs(HQ,{...t,children:[e,s&&y.jsxs(il,{children:[n.length>0&&y.jsx(m,{children:y.jsx(sy,{indeterminate:u,checked:f,onChange:p,disabled:o&&o.count()===0})}),r.map(({key:x,label:R,sortable:k=!0,...O})=>y.jsx(wi,{sortDirection:k&&S===x&&w||!1,...O,children:y.jsxs(lY,{active:k&&S===x,direction:w,onClick:v(x),children:[R,k&&S===x?y.jsx(Wr,{component:"span",sx:{visibility:"hidden",display:"none"},children:w==="desc"?"sorted descending":"sorted ascending"}):null]})},x)),y.jsx(m,{})]})]})},UZ=()=>{const{massActions:e,columns:t,items:n}=Xi(),r=Rn(),{["ModelIndex.Table.ShrinkedCell"]:o}=kt("cms").getComponents(),s=(n==null?void 0:n.count())||15;return y.jsx(y.Fragment,{children:Array.from({length:s}).map((l,c)=>y.jsxs(il,{children:[e.length>0&&y.jsx(o,{children:y.jsx(sy,{})}),r&&t.map(({key:u,label:f,sortable:p,...m},g)=>y.jsx(wi,{...m,children:y.jsx(qE,{variant:"text",height:24})},g)),!r&&y.jsx(wi,{sx:{px:0},children:Array.from({length:t.length}).map((u,f)=>y.jsx(qE,{variant:"text",width:"100%",height:24},f))}),y.jsx(o,{children:y.jsx(Vn,{children:y.jsx(Dy,{})})})]},c))})},WZ=({children:e,...t})=>{const n=Si(),{t:r}=Nn(),{items:o,loading:s,columnCount:l}=Xi(),{["ModelIndex.StaticActions"]:c}=kt("cms").getComponents(),u=te.isValidElement(e)?e:(o||Wn([])).map(e);return y.jsx(SQ,{...t,children:s||!(o!=null&&o.every(f=>f.getType()===n.getSchemaName()))?y.jsx(UZ,{}):o&&o.count()?u:y.jsx(il,{children:y.jsxs(wi,{colSpan:l,sx:{textAlign:"center",py:10},children:[y.jsx(bn,{children:r("No :model found",{model:n.plural().toLocaleLowerCase()})}),y.jsx("br",{}),y.jsx(c,{})]})})})};class HZ{getFacadeAccessor(){return"cms"}}const dr=So(HZ,_r),dl=ce(bn)(()=>({whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis","& label":{fontWeight:"bold"}})),VZ=({content:e})=>["string","number"].includes(typeof e)?y.jsx(dl,{children:e}):e instanceof Date?y.jsx(dl,{children:e.toLocaleString(_i("app.locale","en"))}):typeof e=="object"&&!te.isValidElement(e)?y.jsx(dl,{children:JSON.stringify(e)}):y.jsx(te.Fragment,{children:e}),KZ=({label:e,content:t})=>["string","number"].includes(typeof t)?y.jsxs(dl,{children:[y.jsxs("label",{children:[e,":"]})," ",t]}):t instanceof Date?y.jsxs(dl,{children:[y.jsxs("label",{children:[e,":"]}),t.toLocaleString(_i("app.locale","en"))]}):typeof t=="object"&&!te.isValidElement(t)?y.jsxs(dl,{children:[y.jsxs("label",{children:[e,":"]})," ",JSON.stringify(t)]}):y.jsxs(te.Fragment,{children:[y.jsx(bn,{sx:{display:"inline"},children:y.jsxs("b",{children:[e,":"]})})," ",t]}),qZ=({item:e,...t})=>{const n=Rn(),r=yc(),o=Si(),{massActions:s,columns:l}=Xi(),c=te.useMemo(()=>l.map(g=>({...g,content:dr[`model${Ke.studly(e.getType())}Get${Ke.studly(g.key)}Content`](Me.get(e,g.key),e)})),[l,e]),{["ModelIndex.Table.ShrinkedCell"]:u,["ModelIndex.InstanceActions"]:f}=dr.getComponents(),{isSelected:p,handleSelectToggle:m}=fv();return y.jsxs(il,{...t,sx:{cursor:e.deletedAt?"default":"pointer"},selected:p(e),hover:!e.deletedAt,children:[s.length>0&&y.jsx(u,{children:y.jsx(sy,{checked:p(e),onChange:()=>m(e)})}),n&&c.map(({key:g,label:S,sortable:w,content:v,...x})=>y.jsx(wi,{...x,onClick:()=>{e.deletedAt||r(`/${Ke.kebab(o.plural())}/${e.getKey()}`)},children:y.jsx(VZ,{label:S,content:v})},g)),!n&&y.jsx(wi,{sx:{maxWidth:0,px:0},onClick:()=>{e.deletedAt||r(`/${Ke.kebab(o.plural())}/${e.getKey()}`)},children:c.map(({key:g,...S})=>y.jsx(KZ,{...S},g))}),y.jsx(u,{children:y.jsx(f,{item:e})})]})},GZ=({children:e,...t})=>{const{columnCount:n}=Xi(),r=Rn(),o=Hr("breakpoint","md"),{["ModelIndex.Pagination"]:s,["ModelIndex.PaginationDetails"]:l,["ModelIndex.PerPageSwitch"]:c}=kt("cms").getComponents();return y.jsxs(DQ,{...t,children:[y.jsx(il,{children:y.jsx(wi,{colSpan:n,children:y.jsxs(lr,{direction:r?"row":"column-reverse",alignItems:"center",justifyContent:"space-between",gap:3,children:[y.jsxs(lr,{direction:r?"row":"column-reverse",alignItems:r?"center":"flex-start",justifyContent:"flex-start",width:{xs:"100%",[o]:"auto"},gap:r?2:0,children:[y.jsx(c,{}),y.jsx(l,{})]}),y.jsx(s,{variant:r?"default":"compact",justifyContent:{xs:"center",[o]:"flex-end"}})]})})}),e]})},QZ=()=>{const{columnCount:e}=Xi(),{["ModelIndex.Filter"]:t,["ModelIndex.MassActions"]:n,["ModelIndex.Sort"]:r,["ModelIndex.Pagination"]:o}=kt("cms").getComponents(),s=Rn(),l=Hr("breakpoint","md");return y.jsx(il,{children:y.jsx(wi,{colSpan:e,sx:{p:1},children:y.jsxs(lr,{direction:{xs:"column",[l]:"row"},justifyContent:"space-between",spacing:1,children:[y.jsxs(lr,{direction:"row",alignItems:"center",width:{[l]:"100%"},children:[y.jsx(t,{}),!s&&y.jsx(r,{})]}),s&&y.jsx(lr,{direction:"row",alignItems:"center",justifyContent:{xs:"center",[l]:"flex-end"},rowGap:2,children:y.jsx(o,{variant:"compact",justifyContent:"end"})}),y.jsx(n,{})]})})})};function YZ(){const e=Si(),{t}=Nn(),[n,r]=Ro(),o=n.get("tab")||"all",s=(u,f)=>{r(()=>{const p=new URLSearchParams;return f!=="all"&&p.set("tab",f),p})},l=te.useMemo(()=>e.getSchema().softDeletes?[{label:t("Trashed"),value:"trashed"}]:[],[e,t]),c=Xm(kt("cms"),`model${Ke.studly(e.getSchemaName())}Tabs`,l);return c.length===0?null:y.jsx(Wr,{sx:{maxWidth:{xs:320,sm:480},bgcolor:"background.paper"},children:y.jsxs(OY,{value:o,onChange:s,variant:"scrollable",scrollButtons:"auto","aria-label":`tabs for ${e.singular()}`,allowScrollButtonsMobile:!0,children:[y.jsx(XE,{label:t("All"),value:"all"}),c.map(u=>y.jsx(XE,{label:u.label,value:u.value},u.value))]})})}function JZ(e){const{parts:t,...n}=e;return y.jsxs(kH,{"aria-label":"breadcrumb",...n,children:[y.jsx(xy,{underline:"hover",color:"inherit",to:"/",component:Hd,children:_i("app.name","Laravel")}),t==null?void 0:t.map(({name:r,href:o},s)=>o?y.jsx(xy,{underline:"hover",color:"inherit",to:o,component:Hd,children:r},s):y.jsx(bn,{color:"text.primary",children:r},s))]})}const mP=({collapsed:e=!1,items:t,onClick:n,...r})=>{const[o,s]=te.useState(null),[l,c]=te.useState(null),[u,f]=te.useState({}),p=Hr("drawer.width",280),m=kt("cms").getComponent("RecursiveMenu");return y.jsxs(wy,{...r,children:[t.map(g=>{const{text:S,icon:w,element:v=null,key:x,children:R,to:k,onClick:O}=g;return v?y.jsx(te.Fragment,{children:v},x):y.jsxs(SE,{disablePadding:!0,sx:{display:"block"},children:[y.jsxs(xE,{sx:{minHeight:48,justifyContent:e?"center":"initial",px:2.5},onClick:$=>{if(O&&O($),R){if(e){c(()=>(s($.currentTarget),R));return}f({...u,[x]:!u[x]});return}n&&n($)},...k?{to:k,component:ap}:{},children:[y.jsxs(Sy,{sx:{minWidth:0,mr:e?"unset":3,justifyContent:"center",flexDirection:"column",alignItems:"center",color:"inherit"},children:[w,e&&y.jsx(bn,{fontSize:10,sx:{mt:.5},children:S})]}),!e&&y.jsx(Cy,{primary:S}),!e&&R&&(u[x]?y.jsx(wk,{}):y.jsx(Sk,{}))]}),R&&!e&&y.jsx(Fg,{in:u[x],timeout:"auto",unmountOnExit:!0,children:y.jsx(mP,{items:R,onClick:n,collapsed:e,sx:{pl:e?0:2,pb:0}})})]},x)}),e&&y.jsx(m,{items:l||[],onClick:n,collapsed:!1,sx:{pl:e?0:2,pb:0},anchorEl:o,anchorOrigin:{vertical:"top",horizontal:"right"},onClose:()=>{s(null),c(null)},open:!!o,slotProps:{paper:{sx:{minWidth:p}}}})]})},gP=({collapsed:e=!1,items:t,onClick:n,...r})=>{const[o,s]=te.useState({}),l=Hr("drawer.width",280);return y.jsxs(y.Fragment,{children:[y.jsx(ky,{...r,children:t.map(c=>{const{text:u,icon:f,element:p=null,key:m,children:g,onClick:S,to:w}=c;return p?te.cloneElement(p,{key:m}):y.jsxs(Gi,{onClick:v=>{if(S&&S(v),g){s({...o,[m]:o[m]?null:v.currentTarget});return}n&&n(v)},...w?{component:ap,to:w}:{},children:[f&&y.jsx(Sy,{sx:{minWidth:0,mr:e?"auto":3,justifyContent:"center",color:"inherit"},children:f}),y.jsx(Cy,{sx:{opacity:e?0:1},children:u}),!e&&g&&y.jsx(Gf,{})]},m)})}),t.map(c=>{const{key:u,children:f}=c;return f?y.jsx(gP,{items:f,onClick:n,collapsed:e,sx:{pl:e?0:2,pb:0},open:!!o[u],anchorEl:o[u],anchorOrigin:{vertical:"top",horizontal:"right"},onClose:()=>s({...o,[u]:null}),slotProps:{paper:{sx:{minWidth:l}}}},u):null})]})},pv={delete:e=>async({selected:t,notify:n,dialog:r,refresh:o,t:s})=>{const l=e.getSchema().softDeletes?"send to trash":"delete permanently",c=e.getSchema().softDeletes?"sent to trash":"deleted";if(await r({title:e.getSchema().softDeletes?s("Confirm send to trash"):s("Confirm delete permanently"),message:s(`Are you sure you want to ${l} :count :model?`,{count:t.count(),model:Ke.lcfirst(t.count()===1?e.singular():e.plural())}),type:"confirm"}))try{await e.delete(t.pluck(e.getSchema().primaryKey).all()),n(s(`Successfully ${c} :count :model`,{count:t.count(),model:Ke.lcfirst(t.count()===1?e.singular():e.plural())})),o()}catch(f){qs(n)(f)}},restore:e=>async({selected:t,notify:n,dialog:r,refresh:o,t:s})=>{if(await r({title:s("Confirm restore"),message:s("Are you sure you want to restore :count :model?",{count:t.count(),model:Ke.lcfirst(t.count()===1?e.singular():e.plural())}),type:"confirm"}))try{await e.restore(t.pluck(e.getSchema().primaryKey).all()),n(s("Successfully restored :count :model",{count:t.count(),model:Ke.lcfirst(t.count()===1?e.singular():e.plural())})),o()}catch(c){qs(n)(c)}},forceDelete:e=>async({selected:t,notify:n,dialog:r,refresh:o,t:s})=>{if(await r({title:s("Confirm permanent deletion"),message:s("Are you sure you want to delete permanently :count :model?",{count:t.count(),model:Ke.lcfirst(t.count()===1?e.singular():e.plural())}),type:"confirm"}))try{await e.forceDelete(t.pluck(e.getSchema().primaryKey).all()),n(s("Successfully deleted :count :model",{count:t.count(),model:Ke.lcfirst(t.count()===1?e.singular():e.plural())})),o()}catch(c){qs(n)(c)}}},hv={delete:e=>async({item:t,notify:n,dialog:r,refresh:o,t:s})=>{const l=e.getSchema().softDeletes?"send :model “:label” to trash":"delete :model “:label” permanently",c=e.getSchema().softDeletes?"sent :model “:label” to trash":"deleted :model “:label”";if(await r({title:e.getSchema().softDeletes?s("Confirm send to trash"):s("Confirm permanent deletion"),message:s(`Are you sure you want to ${l}?`,{model:Ke.lcfirst(e.singular()),label:t.getLabel()}),type:"confirm"}))try{await t.delete(),n(s(`Successfully ${c}`,{model:e.singular(),label:t.getLabel()})),o()}catch(f){qs(n)(f)}},restore:e=>async({item:t,notify:n,dialog:r,refresh:o,t:s})=>{if(await r({title:s("Confirm restore"),message:s("Are you sure you want to restore :model “:label”?",{model:Ke.lcfirst(e.singular()),label:t.getLabel()}),type:"confirm"}))try{await t.restore(),n(s("Successfully restored :model “:label”",{model:e.singular(),label:t.getLabel()})),o()}catch(c){qs(n)(c)}},forceDelete:e=>async({item:t,notify:n,dialog:r,refresh:o,t:s})=>{if(await r({title:s("Confirm permanent deletion"),message:s("Are you sure you want to delete :model “:label” permanently?",{model:Ke.lcfirst(e.singular()),label:t.getLabel()}),type:"confirm"}))try{await t.forceDelete(),n(s("Successfully deleted :model “:label”",{model:e.singular(),label:t.getLabel()})),o()}catch(c){qs(n)(c)}}},XZ={create:e=>({navigate:t})=>{t(`/${Ke.kebab(e.plural())}/create`)}};class ZZ{getFacadeAccessor(){return"icon"}}const lp=So(ZZ,_r);class eee{constructor(){Gu(this,"components",{});Gu(this,"logoutCallback",null)}booted(){this.components=this.componentMap({})}getComponents(){return this.components}getComponent(t){return this.getComponents()[t]}getRoutes(){return this.cmsRoutes([],this.getComponents(),lc().make())}getMenuItems(){return this.menuItems([],lc().make())}logoutUsing(t){this.logoutCallback=t}getLogoutCallback(){return this.logoutCallback??(()=>mF().logout())}getModelFormProps(t){return this.wireModelFormProps({},t)}getMassActions(t,n){return this[`mass${Ke.studly(t.getSchemaName())}Actions`](this.massActions([],t,n),t,n)}getInstanceActions(t,n){return this[`instance${Ke.studly(t.getSchemaName())}Actions`](this.instanceActions([],t,n),t,n)}getStaticActions(t,n){return this[`static${Ke.studly(t.getSchemaName())}Actions`](this.staticActions([],t,n),t,n)}}const tee=xa(eee),du=e=>!(typeof e>"u"||e===null||Me.isEmpty(e));class nee{getInputType(t){switch(t){case"int":case"float":case"number":return"number";case"date":return"date";case"datetime":case"timestamp":return"datetime-local";case"autocomplete":return"autocomplete";case"bool":case"boolean":return"boolean";default:return"text"}}getOperators(){return _i("luminix.admin.filter.operators")}getMatchingOperators(t){return this.getOperators().filter(n=>["like"].includes(n)||!t.is_relation&&["relation"].includes(n)||["text"].includes(this.getInputType(t.type))&&["greaterThan","greaterThanOrEquals","lessThan","lessThanOrEquals","between","notBetween"].includes(n)||["number","date","datetime-local","boolean"].includes(this.getInputType(t.type))&&["like","contains","startsWith","endsWith"].includes(n)||!t.nullable&&["null","notNull"].includes(n)?!1:n).map(n=>{let r=n;switch(n){case"equals":r="=";break;case"notEquals":r="!=";break;case"greaterThan":r=">";break;case"greaterThanOrEquals":r=">=";break;case"lessThan":r="<";break;case"lessThanOrEquals":r="<=";break;default:r=Ke.human(r);break}return{key:n,label:r}})}getFilterableColumns(t){const{attributes:n=[],relations:r={}}=t.getSchema(),o=[...n.filter(s=>!s.hidden&&!s.appended&&!s.virtual).map(s=>{let l=s.phpType??"string";return s.cast!==null&&!Me.isEmpty(s.cast)&&(l=s.cast),{key:s.name,label:Ke.human(s.name),type:l,nullable:s.nullable,is_relation:!1}}),...Object.entries(r??{}).reduce((s,[l])=>[...s,{key:l,label:Ke.human(l),type:"autocomplete",nullable:!1,is_relation:!0}],[])];return this.filterableColumns(o,t)}checkIfCanApplyFilters(t){return!!(t.length===0||t.map(r=>{if(!du(r.key)||!du(r.operator))return!0;if(["boolean"].includes(this.getInputType(r.type))){if(typeof r.value>"u"||Me.isNull(r.value))return!0}else if(!du(r.value))return!0;return!!(Array.isArray(r.value)&&["between","notBetween"].includes(r.operator)&&(!du(r.value[0])||!du(r.value[1])))}).includes(!0))}}const ree=xa(nee);class oee{constructor(){Gu(this,"icons",[]);cc.reducer("model",t=>{const n=this;return class extends t{static icon(){return n.render("CategoryOutlined")}}},0)}forModel(t,n){cc.reducer(`model${Ke.studly(t)}`,r=>{const o=this;return class extends r{static icon(){return o.render(n)}}})}registerIcon(t,n){typeof t=="string"&&n?this.icons.push({name:t,component:n}):Object.entries(t).forEach(([r,o])=>{this.icons.push({name:r,component:o})})}make(t){return this.icons.find(n=>n.name===t).component}render(t,n={}){const r=this.make(t);return r?y.jsx(r,{...n}):null}all(){return this.icons.map(t=>t.name)}}const iee=({item:e})=>{const t=iv(),[n]=Ro(),r=n.get("tab")??"all",o=te.useMemo(()=>kt("cms").getInstanceActions(kt("model").make(e.getType()),r),[e,r]),[s,l]=te.useState(null),c=!!s,u=p=>{l(p.currentTarget)},f=()=>{l(null)};return o.length===0?null:y.jsxs(y.Fragment,{children:[y.jsx(Vn,{"aria-describedby":"model-item-actions","aria-label":"filter",onClick:u,children:y.jsx(Dy,{})}),y.jsx(ky,{id:"model-item-actions",anchorEl:s,open:c,onClose:f,MenuListProps:{"aria-labelledby":"model-item-action"},children:o.map(p=>y.jsxs(Gi,{onClick:()=>{p.callback({item:e,...t}),f()},sx:{px:1,gap:.75},children:[p.icon,p.label]},p.label))})]})},see="data:image/png;base64,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",aee="data:image/png;base64,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";function lee(){const e=df("(prefers-color-scheme: dark)"),t=cP();return y.jsx(X9,{src:e?see:aee,alt:"Luminix",variant:"square",sx:{width:40,height:40,marginLeft:t?2:0}})}const cee=({collapsed:e=!1})=>{const t=kt("cms").getLogoutCallback(),{t:n}=Nn(),r=y.jsx(SE,{disablePadding:!0,sx:{display:"block"},children:y.jsxs(xE,{onClick:t,sx:{minHeight:48,justifyContent:e?"center":"initial",px:2.5},children:[y.jsx(Sy,{sx:{minWidth:0,mr:e?"auto":3,justifyContent:"center"},children:y.jsx(nJ,{})}),!e&&y.jsx(Cy,{primary:n("Logout")})]})});return y.jsxs(y.Fragment,{children:[y.jsx(el,{}),y.jsx(wy,{disablePadding:!0,children:e?y.jsx(YE,{title:n("Logout"),placement:"right",children:r}):r})]})},mp=class mp extends Id{register(){this.app.singleton("cms",()=>new tee),this.app.singleton("filter",()=>new ree),this.app.singleton("icon",()=>new oee),this.registerIcons()}boot(){this.bootComponents(),this.bootRoutes(),this.bootMenu(),this.bootMassActions(),this.bootInstanceActions(),this.bootStaticActions(),mp.applyUserDefaults&&this.bootDefaultUserModifiers(),this.app.on("booted",()=>{this.app.make("cms").booted()})}registerIcons(){lp.registerIcon({Add:ZY,AddCircleOutline:yk,ArrowDownward:vk,ArrowDropDown:bk,ArrowUpward:xk,CategoryOutlined:eJ,ChevronLeft:qf,ChevronRight:Gf,Close:Qf,DashboardOutlined:tJ,ExpandLess:wk,ExpandMore:Sk,FilterList:Ck,FirstPage:Rk,HighlightOffOutlined:Ny,LastPage:Ek,Menu:kk,MoreVert:Dy,PeopleOutlined:rJ,Search:Fy,SwapVert:Pk}),lp.forModel("user","PeopleOutlined")}bootRoutes(){dr.reducer("cmsRoutes",aJ,0),Pm.reducer("domRouterOptions",t=>({...t,basename:Ii.get("luminix.admin.url","/admin")}))}bootComponents(){dr.reducer("componentMap",()=>({Layout:dJ,Dashboard:lJ,ModelIndex:pJ,ModelItem:eZ,Error:cJ,DesktopPageTitle:hZ,RecursiveList:mP,RecursiveMenu:gP,Breadcrumbs:JZ,"Layout.AppBar":lZ,"Layout.AppLogo":lee,"Layout.Drawer":pZ,"Layout.Drawer.LogoutButton":cee,"Layout.AppBar.MenuButton":OZ,"Layout.SearchBar":LZ,"Layout.BackButton":cZ,"ModelIndex.Filter":kZ,"ModelIndex.InstanceActions":iee,"ModelIndex.MassActions":PZ,"ModelIndex.Pagination":$Z,"ModelIndex.PaginationDetails":jZ,"ModelIndex.PerPageSwitch":AZ,"ModelIndex.Sort":DZ,"ModelIndex.StaticActions":iZ,"ModelIndex.Table":BZ,"ModelIndex.Table.TableHead":zZ,"ModelIndex.Table.TableBody":WZ,"ModelIndex.Table.TableFooter":GZ,"ModelIndex.Table.TableToolbar":QZ,"ModelIndex.Table.TableBody.TableRow":qZ,"ModelIndex.Table.ShrinkedCell":NZ,"ModelIndex.Tabs":YZ}),0)}bootMenu(){dr.reducer("menuItems",(t,n)=>[...t,{key:"dashboard",text:"Dashboard",to:"/",icon:lp.render("DashboardOutlined")},...Object.entries(n).sort(([r],[o])=>r.localeCompare(o)).map(([r,o])=>({key:r,text:o.plural(),to:"/"+Ke.kebab(o.plural()),icon:o.icon()}))],0)}bootDefaultUserModifiers(){dr.reducer("modelUserColumns",()=>[{key:"name",label:"Name",scope:"row",component:"th"},{key:"email",label:"Email",align:"right",size:"small"},{key:"created_at",label:"Created At",align:"right",size:"small"}],1),dr.reducer("wireModelFormProps",(t,n)=>(n==null?void 0:n.getType())==="user"?{...t,confirmed:"password"}:t)}bootMassActions(){dr.reducer("massActions",(t,n,r)=>{const o=[],{softDeletes:s}=n.getSchema();return r!=="trashed"?o.push({key:"delete",label:s?"Send to trash":"Delete permanently",callback:pv.delete(n)}):(o.push({key:"restore",label:"Restore",callback:pv.restore(n)}),o.push({key:"forceDelete",label:"Delete permanently",callback:pv.forceDelete(n)})),[...t,...o]},0)}bootInstanceActions(){dr.reducer("instanceActions",(t,n,r)=>{const o=[],{softDeletes:s}=n.getSchema();return r!=="trashed"?o.push({label:s?"Send to trash":"Delete permanently",callback:hv.delete(n)}):(o.push({label:"Restore",callback:hv.restore(n)}),o.push({label:"Delete permanently",callback:hv.forceDelete(n)})),[...t,...o]},0)}bootStaticActions(){dr.reducer("staticActions",(t,n,r)=>r==="trashed"?t:[...t,{key:"create",label:`Create ${n.singular()}`,callback:XZ.create(n),icon:lp.render("Add")}],0)}};Gu(mp,"applyUserDefaults",!0);let mv=mp;const uee={type:"logger",log(e){this.output("log",e)},warn(e){this.output("warn",e)},error(e){this.output("error",e)},output(e,t){console&&console[e]&&console[e].apply(console,t)}};class cp{constructor(t){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};this.init(t,n)}init(t){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};this.prefix=n.prefix||"i18next:",this.logger=t||uee,this.options=n,this.debug=n.debug}log(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return this.forward(n,"log","",!0)}warn(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return this.forward(n,"warn","",!0)}error(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return this.forward(n,"error","")}deprecate(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return this.forward(n,"warn","WARNING DEPRECATED: ",!0)}forward(t,n,r,o){return o&&!this.debug?null:(typeof t[0]=="string"&&(t[0]=`${r}${this.prefix} ${t[0]}`),this.logger[n](t))}create(t){return new cp(this.logger,{prefix:`${this.prefix}:${t}:`,...this.options})}clone(t){return t=t||this.options,t.prefix=t.prefix||this.prefix,new cp(this.logger,t)}}var Xo=new cp;class up{constructor(){this.observers={}}on(t,n){return t.split(" ").forEach(r=>{this.observers[r]||(this.observers[r]=new Map);const o=this.observers[r].get(n)||0;this.observers[r].set(n,o+1)}),this}off(t,n){if(this.observers[t]){if(!n){delete this.observers[t];return}this.observers[t].delete(n)}}emit(t){for(var n=arguments.length,r=new Array(n>1?n-1:0),o=1;o<n;o++)r[o-1]=arguments[o];this.observers[t]&&Array.from(this.observers[t].entries()).forEach(l=>{let[c,u]=l;for(let f=0;f<u;f++)c(...r)}),this.observers["*"]&&Array.from(this.observers["*"].entries()).forEach(l=>{let[c,u]=l;for(let f=0;f<u;f++)c.apply(c,[t,...r])})}}function fu(){let e,t;const n=new Promise((r,o)=>{e=r,t=o});return n.resolve=e,n.reject=t,n}function yP(e){return e==null?"":""+e}function dee(e,t,n){e.forEach(r=>{t[r]&&(n[r]=t[r])})}const fee=/###/g;function pu(e,t,n){function r(c){return c&&c.indexOf("###")>-1?c.replace(fee,"."):c}function o(){return!e||typeof e=="string"}const s=typeof t!="string"?t:t.split(".");let l=0;for(;l<s.length-1;){if(o())return{};const c=r(s[l]);!e[c]&&n&&(e[c]=new n),Object.prototype.hasOwnProperty.call(e,c)?e=e[c]:e={},++l}return o()?{}:{obj:e,k:r(s[l])}}function vP(e,t,n){const{obj:r,k:o}=pu(e,t,Object);if(r!==void 0||t.length===1){r[o]=n;return}let s=t[t.length-1],l=t.slice(0,t.length-1),c=pu(e,l,Object);for(;c.obj===void 0&&l.length;)s=`${l[l.length-1]}.${s}`,l=l.slice(0,l.length-1),c=pu(e,l,Object),c&&c.obj&&typeof c.obj[`${c.k}.${s}`]<"u"&&(c.obj=void 0);c.obj[`${c.k}.${s}`]=n}function pee(e,t,n,r){const{obj:o,k:s}=pu(e,t,Object);o[s]=o[s]||[],o[s].push(n)}function dp(e,t){const{obj:n,k:r}=pu(e,t);if(n)return n[r]}function hee(e,t,n){const r=dp(e,n);return r!==void 0?r:dp(t,n)}function bP(e,t,n){for(const r in t)r!=="__proto__"&&r!=="constructor"&&(r in e?typeof e[r]=="string"||e[r]instanceof String||typeof t[r]=="string"||t[r]instanceof String?n&&(e[r]=t[r]):bP(e[r],t[r],n):e[r]=t[r]);return e}function fl(e){return e.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&")}var mee={"&":"&","<":"<",">":">",'"':""","'":"'","/":"/"};function gee(e){return typeof e=="string"?e.replace(/[&<>"'\/]/g,t=>mee[t]):e}class yee{constructor(t){this.capacity=t,this.regExpMap=new Map,this.regExpQueue=[]}getRegExp(t){const n=this.regExpMap.get(t);if(n!==void 0)return n;const r=new RegExp(t);return this.regExpQueue.length===this.capacity&&this.regExpMap.delete(this.regExpQueue.shift()),this.regExpMap.set(t,r),this.regExpQueue.push(t),r}}const vee=[" ",",","?","!",";"],bee=new yee(20);function xee(e,t,n){t=t||"",n=n||"";const r=vee.filter(l=>t.indexOf(l)<0&&n.indexOf(l)<0);if(r.length===0)return!0;const o=bee.getRegExp(`(${r.map(l=>l==="?"?"\\?":l).join("|")})`);let s=!o.test(e);if(!s){const l=e.indexOf(n);l>0&&!o.test(e.substring(0,l))&&(s=!0)}return s}function gv(e,t){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:".";if(!e)return;if(e[t])return e[t];const r=t.split(n);let o=e;for(let s=0;s<r.length;){if(!o||typeof o!="object")return;let l,c="";for(let u=s;u<r.length;++u)if(u!==s&&(c+=n),c+=r[u],l=o[c],l!==void 0){if(["string","number","boolean"].indexOf(typeof l)>-1&&u<r.length-1)continue;s+=u-s+1;break}o=l}return o}function fp(e){return e&&e.indexOf("_")>0?e.replace("_","-"):e}class xP extends up{constructor(t){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{ns:["translation"],defaultNS:"translation"};super(),this.data=t||{},this.options=n,this.options.keySeparator===void 0&&(this.options.keySeparator="."),this.options.ignoreJSONStructure===void 0&&(this.options.ignoreJSONStructure=!0)}addNamespaces(t){this.options.ns.indexOf(t)<0&&this.options.ns.push(t)}removeNamespaces(t){const n=this.options.ns.indexOf(t);n>-1&&this.options.ns.splice(n,1)}getResource(t,n,r){let o=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{};const s=o.keySeparator!==void 0?o.keySeparator:this.options.keySeparator,l=o.ignoreJSONStructure!==void 0?o.ignoreJSONStructure:this.options.ignoreJSONStructure;let c;t.indexOf(".")>-1?c=t.split("."):(c=[t,n],r&&(Array.isArray(r)?c.push(...r):typeof r=="string"&&s?c.push(...r.split(s)):c.push(r)));const u=dp(this.data,c);return!u&&!n&&!r&&t.indexOf(".")>-1&&(t=c[0],n=c[1],r=c.slice(2).join(".")),u||!l||typeof r!="string"?u:gv(this.data&&this.data[t]&&this.data[t][n],r,s)}addResource(t,n,r,o){let s=arguments.length>4&&arguments[4]!==void 0?arguments[4]:{silent:!1};const l=s.keySeparator!==void 0?s.keySeparator:this.options.keySeparator;let c=[t,n];r&&(c=c.concat(l?r.split(l):r)),t.indexOf(".")>-1&&(c=t.split("."),o=n,n=c[1]),this.addNamespaces(n),vP(this.data,c,o),s.silent||this.emit("added",t,n,r,o)}addResources(t,n,r){let o=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{silent:!1};for(const s in r)(typeof r[s]=="string"||Array.isArray(r[s]))&&this.addResource(t,n,s,r[s],{silent:!0});o.silent||this.emit("added",t,n,r)}addResourceBundle(t,n,r,o,s){let l=arguments.length>5&&arguments[5]!==void 0?arguments[5]:{silent:!1,skipCopy:!1},c=[t,n];t.indexOf(".")>-1&&(c=t.split("."),o=r,r=n,n=c[1]),this.addNamespaces(n);let u=dp(this.data,c)||{};l.skipCopy||(r=JSON.parse(JSON.stringify(r))),o?bP(u,r,s):u={...u,...r},vP(this.data,c,u),l.silent||this.emit("added",t,n,r)}removeResourceBundle(t,n){this.hasResourceBundle(t,n)&&delete this.data[t][n],this.removeNamespaces(n),this.emit("removed",t,n)}hasResourceBundle(t,n){return this.getResource(t,n)!==void 0}getResourceBundle(t,n){return n||(n=this.options.defaultNS),this.options.compatibilityAPI==="v1"?{...this.getResource(t,n)}:this.getResource(t,n)}getDataByLanguage(t){return this.data[t]}hasLanguageSomeTranslations(t){const n=this.getDataByLanguage(t);return!!(n&&Object.keys(n)||[]).find(o=>n[o]&&Object.keys(n[o]).length>0)}toJSON(){return this.data}}var wP={processors:{},addPostProcessor(e){this.processors[e.name]=e},handle(e,t,n,r,o){return e.forEach(s=>{this.processors[s]&&(t=this.processors[s].process(t,n,r,o))}),t}};const SP={};class pp extends up{constructor(t){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};super(),dee(["resourceStore","languageUtils","pluralResolver","interpolator","backendConnector","i18nFormat","utils"],t,this),this.options=n,this.options.keySeparator===void 0&&(this.options.keySeparator="."),this.logger=Xo.create("translator")}changeLanguage(t){t&&(this.language=t)}exists(t){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{interpolation:{}};if(t==null)return!1;const r=this.resolve(t,n);return r&&r.res!==void 0}extractFromKey(t,n){let r=n.nsSeparator!==void 0?n.nsSeparator:this.options.nsSeparator;r===void 0&&(r=":");const o=n.keySeparator!==void 0?n.keySeparator:this.options.keySeparator;let s=n.ns||this.options.defaultNS||[];const l=r&&t.indexOf(r)>-1,c=!this.options.userDefinedKeySeparator&&!n.keySeparator&&!this.options.userDefinedNsSeparator&&!n.nsSeparator&&!xee(t,r,o);if(l&&!c){const u=t.match(this.interpolator.nestingRegexp);if(u&&u.length>0)return{key:t,namespaces:s};const f=t.split(r);(r!==o||r===o&&this.options.ns.indexOf(f[0])>-1)&&(s=f.shift()),t=f.join(o)}return typeof s=="string"&&(s=[s]),{key:t,namespaces:s}}translate(t,n,r){if(typeof n!="object"&&this.options.overloadTranslationOptionHandler&&(n=this.options.overloadTranslationOptionHandler(arguments)),typeof n=="object"&&(n={...n}),n||(n={}),t==null)return"";Array.isArray(t)||(t=[String(t)]);const o=n.returnDetails!==void 0?n.returnDetails:this.options.returnDetails,s=n.keySeparator!==void 0?n.keySeparator:this.options.keySeparator,{key:l,namespaces:c}=this.extractFromKey(t[t.length-1],n),u=c[c.length-1],f=n.lng||this.language,p=n.appendNamespaceToCIMode||this.options.appendNamespaceToCIMode;if(f&&f.toLowerCase()==="cimode"){if(p){const $=n.nsSeparator||this.options.nsSeparator;return o?{res:`${u}${$}${l}`,usedKey:l,exactUsedKey:l,usedLng:f,usedNS:u,usedParams:this.getUsedParamsDetails(n)}:`${u}${$}${l}`}return o?{res:l,usedKey:l,exactUsedKey:l,usedLng:f,usedNS:u,usedParams:this.getUsedParamsDetails(n)}:l}const m=this.resolve(t,n);let g=m&&m.res;const S=m&&m.usedKey||l,w=m&&m.exactUsedKey||l,v=Object.prototype.toString.apply(g),x=["[object Number]","[object Function]","[object RegExp]"],R=n.joinArrays!==void 0?n.joinArrays:this.options.joinArrays,k=!this.i18nFormat||this.i18nFormat.handleAsObject;if(k&&g&&(typeof g!="string"&&typeof g!="boolean"&&typeof g!="number")&&x.indexOf(v)<0&&!(typeof R=="string"&&Array.isArray(g))){if(!n.returnObjects&&!this.options.returnObjects){this.options.returnedObjectHandler||this.logger.warn("accessing an object - but returnObjects options is not enabled!");const $=this.options.returnedObjectHandler?this.options.returnedObjectHandler(S,g,{...n,ns:c}):`key '${l} (${this.language})' returned an object instead of string.`;return o?(m.res=$,m.usedParams=this.getUsedParamsDetails(n),m):$}if(s){const $=Array.isArray(g),j=$?[]:{},T=$?w:S;for(const M in g)if(Object.prototype.hasOwnProperty.call(g,M)){const N=`${T}${s}${M}`;j[M]=this.translate(N,{...n,joinArrays:!1,ns:c}),j[M]===N&&(j[M]=g[M])}g=j}}else if(k&&typeof R=="string"&&Array.isArray(g))g=g.join(R),g&&(g=this.extendTranslation(g,t,n,r));else{let $=!1,j=!1;const T=n.count!==void 0&&typeof n.count!="string",M=pp.hasDefaultValue(n),N=T?this.pluralResolver.getSuffix(f,n.count,n):"",F=n.ordinal&&T?this.pluralResolver.getSuffix(f,n.count,{ordinal:!1}):"",D=T&&!n.ordinal&&n.count===0&&this.pluralResolver.shouldUseIntlApi(),W=D&&n[`defaultValue${this.options.pluralSeparator}zero`]||n[`defaultValue${N}`]||n[`defaultValue${F}`]||n.defaultValue;!this.isValidLookup(g)&&M&&($=!0,g=W),this.isValidLookup(g)||(j=!0,g=l);const ee=(n.missingKeyNoValueFallbackToKey||this.options.missingKeyNoValueFallbackToKey)&&j?void 0:g,z=M&&W!==g&&this.options.updateMissing;if(j||$||z){if(this.logger.log(z?"updateKey":"missingKey",f,u,l,z?W:g),s){const _=this.resolve(l,{...n,keySeparator:!1});_&&_.res&&this.logger.warn("Seems the loaded translations were in flat JSON format instead of nested. Either set keySeparator: false on init or make sure your translations are published in nested format.")}let ne=[];const V=this.languageUtils.getFallbackCodes(this.options.fallbackLng,n.lng||this.language);if(this.options.saveMissingTo==="fallback"&&V&&V[0])for(let _=0;_<V.length;_++)ne.push(V[_]);else this.options.saveMissingTo==="all"?ne=this.languageUtils.toResolveHierarchy(n.lng||this.language):ne.push(n.lng||this.language);const K=(_,H,X)=>{const I=M&&X!==g?X:ee;this.options.missingKeyHandler?this.options.missingKeyHandler(_,u,H,I,z,n):this.backendConnector&&this.backendConnector.saveMissing&&this.backendConnector.saveMissing(_,u,H,I,z,n),this.emit("missingKey",_,u,H,g)};this.options.saveMissing&&(this.options.saveMissingPlurals&&T?ne.forEach(_=>{const H=this.pluralResolver.getSuffixes(_,n);D&&n[`defaultValue${this.options.pluralSeparator}zero`]&&H.indexOf(`${this.options.pluralSeparator}zero`)<0&&H.push(`${this.options.pluralSeparator}zero`),H.forEach(X=>{K([_],l+X,n[`defaultValue${X}`]||W)})}):K(ne,l,W))}g=this.extendTranslation(g,t,n,m,r),j&&g===l&&this.options.appendNamespaceToMissingKey&&(g=`${u}:${l}`),(j||$)&&this.options.parseMissingKeyHandler&&(this.options.compatibilityAPI!=="v1"?g=this.options.parseMissingKeyHandler(this.options.appendNamespaceToMissingKey?`${u}:${l}`:l,$?g:void 0):g=this.options.parseMissingKeyHandler(g))}return o?(m.res=g,m.usedParams=this.getUsedParamsDetails(n),m):g}extendTranslation(t,n,r,o,s){var l=this;if(this.i18nFormat&&this.i18nFormat.parse)t=this.i18nFormat.parse(t,{...this.options.interpolation.defaultVariables,...r},r.lng||this.language||o.usedLng,o.usedNS,o.usedKey,{resolved:o});else if(!r.skipInterpolation){r.interpolation&&this.interpolator.init({...r,interpolation:{...this.options.interpolation,...r.interpolation}});const f=typeof t=="string"&&(r&&r.interpolation&&r.interpolation.skipOnVariables!==void 0?r.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables);let p;if(f){const g=t.match(this.interpolator.nestingRegexp);p=g&&g.length}let m=r.replace&&typeof r.replace!="string"?r.replace:r;if(this.options.interpolation.defaultVariables&&(m={...this.options.interpolation.defaultVariables,...m}),t=this.interpolator.interpolate(t,m,r.lng||this.language||o.usedLng,r),f){const g=t.match(this.interpolator.nestingRegexp),S=g&&g.length;p<S&&(r.nest=!1)}!r.lng&&this.options.compatibilityAPI!=="v1"&&o&&o.res&&(r.lng=this.language||o.usedLng),r.nest!==!1&&(t=this.interpolator.nest(t,function(){for(var g=arguments.length,S=new Array(g),w=0;w<g;w++)S[w]=arguments[w];return s&&s[0]===S[0]&&!r.context?(l.logger.warn(`It seems you are nesting recursively key: ${S[0]} in key: ${n[0]}`),null):l.translate(...S,n)},r)),r.interpolation&&this.interpolator.reset()}const c=r.postProcess||this.options.postProcess,u=typeof c=="string"?[c]:c;return t!=null&&u&&u.length&&r.applyPostProcessor!==!1&&(t=wP.handle(u,t,n,this.options&&this.options.postProcessPassResolved?{i18nResolved:{...o,usedParams:this.getUsedParamsDetails(r)},...r}:r,this)),t}resolve(t){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},r,o,s,l,c;return typeof t=="string"&&(t=[t]),t.forEach(u=>{if(this.isValidLookup(r))return;const f=this.extractFromKey(u,n),p=f.key;o=p;let m=f.namespaces;this.options.fallbackNS&&(m=m.concat(this.options.fallbackNS));const g=n.count!==void 0&&typeof n.count!="string",S=g&&!n.ordinal&&n.count===0&&this.pluralResolver.shouldUseIntlApi(),w=n.context!==void 0&&(typeof n.context=="string"||typeof n.context=="number")&&n.context!=="",v=n.lngs?n.lngs:this.languageUtils.toResolveHierarchy(n.lng||this.language,n.fallbackLng);m.forEach(x=>{this.isValidLookup(r)||(c=x,!SP[`${v[0]}-${x}`]&&this.utils&&this.utils.hasLoadedNamespace&&!this.utils.hasLoadedNamespace(c)&&(SP[`${v[0]}-${x}`]=!0,this.logger.warn(`key "${o}" for languages "${v.join(", ")}" won't get resolved as namespace "${c}" was not yet loaded`,"This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!")),v.forEach(R=>{if(this.isValidLookup(r))return;l=R;const k=[p];if(this.i18nFormat&&this.i18nFormat.addLookupKeys)this.i18nFormat.addLookupKeys(k,p,R,x,n);else{let $;g&&($=this.pluralResolver.getSuffix(R,n.count,n));const j=`${this.options.pluralSeparator}zero`,T=`${this.options.pluralSeparator}ordinal${this.options.pluralSeparator}`;if(g&&(k.push(p+$),n.ordinal&&$.indexOf(T)===0&&k.push(p+$.replace(T,this.options.pluralSeparator)),S&&k.push(p+j)),w){const M=`${p}${this.options.contextSeparator}${n.context}`;k.push(M),g&&(k.push(M+$),n.ordinal&&$.indexOf(T)===0&&k.push(M+$.replace(T,this.options.pluralSeparator)),S&&k.push(M+j))}}let O;for(;O=k.pop();)this.isValidLookup(r)||(s=O,r=this.getResource(R,x,O,n))}))})}),{res:r,usedKey:o,exactUsedKey:s,usedLng:l,usedNS:c}}isValidLookup(t){return t!==void 0&&!(!this.options.returnNull&&t===null)&&!(!this.options.returnEmptyString&&t==="")}getResource(t,n,r){let o=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{};return this.i18nFormat&&this.i18nFormat.getResource?this.i18nFormat.getResource(t,n,r,o):this.resourceStore.getResource(t,n,r,o)}getUsedParamsDetails(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};const n=["defaultValue","ordinal","context","replace","lng","lngs","fallbackLng","ns","keySeparator","nsSeparator","returnObjects","returnDetails","joinArrays","postProcess","interpolation"],r=t.replace&&typeof t.replace!="string";let o=r?t.replace:t;if(r&&typeof t.count<"u"&&(o.count=t.count),this.options.interpolation.defaultVariables&&(o={...this.options.interpolation.defaultVariables,...o}),!r){o={...o};for(const s of n)delete o[s]}return o}static hasDefaultValue(t){const n="defaultValue";for(const r in t)if(Object.prototype.hasOwnProperty.call(t,r)&&n===r.substring(0,n.length)&&t[r]!==void 0)return!0;return!1}}function yv(e){return e.charAt(0).toUpperCase()+e.slice(1)}class CP{constructor(t){this.options=t,this.supportedLngs=this.options.supportedLngs||!1,this.logger=Xo.create("languageUtils")}getScriptPartFromCode(t){if(t=fp(t),!t||t.indexOf("-")<0)return null;const n=t.split("-");return n.length===2||(n.pop(),n[n.length-1].toLowerCase()==="x")?null:this.formatLanguageCode(n.join("-"))}getLanguagePartFromCode(t){if(t=fp(t),!t||t.indexOf("-")<0)return t;const n=t.split("-");return this.formatLanguageCode(n[0])}formatLanguageCode(t){if(typeof t=="string"&&t.indexOf("-")>-1){const n=["hans","hant","latn","cyrl","cans","mong","arab"];let r=t.split("-");return this.options.lowerCaseLng?r=r.map(o=>o.toLowerCase()):r.length===2?(r[0]=r[0].toLowerCase(),r[1]=r[1].toUpperCase(),n.indexOf(r[1].toLowerCase())>-1&&(r[1]=yv(r[1].toLowerCase()))):r.length===3&&(r[0]=r[0].toLowerCase(),r[1].length===2&&(r[1]=r[1].toUpperCase()),r[0]!=="sgn"&&r[2].length===2&&(r[2]=r[2].toUpperCase()),n.indexOf(r[1].toLowerCase())>-1&&(r[1]=yv(r[1].toLowerCase())),n.indexOf(r[2].toLowerCase())>-1&&(r[2]=yv(r[2].toLowerCase()))),r.join("-")}return this.options.cleanCode||this.options.lowerCaseLng?t.toLowerCase():t}isSupportedCode(t){return(this.options.load==="languageOnly"||this.options.nonExplicitSupportedLngs)&&(t=this.getLanguagePartFromCode(t)),!this.supportedLngs||!this.supportedLngs.length||this.supportedLngs.indexOf(t)>-1}getBestMatchFromCodes(t){if(!t)return null;let n;return t.forEach(r=>{if(n)return;const o=this.formatLanguageCode(r);(!this.options.supportedLngs||this.isSupportedCode(o))&&(n=o)}),!n&&this.options.supportedLngs&&t.forEach(r=>{if(n)return;const o=this.getLanguagePartFromCode(r);if(this.isSupportedCode(o))return n=o;n=this.options.supportedLngs.find(s=>{if(s===o)return s;if(!(s.indexOf("-")<0&&o.indexOf("-")<0)&&(s.indexOf("-")>0&&o.indexOf("-")<0&&s.substring(0,s.indexOf("-"))===o||s.indexOf(o)===0&&o.length>1))return s})}),n||(n=this.getFallbackCodes(this.options.fallbackLng)[0]),n}getFallbackCodes(t,n){if(!t)return[];if(typeof t=="function"&&(t=t(n)),typeof t=="string"&&(t=[t]),Array.isArray(t))return t;if(!n)return t.default||[];let r=t[n];return r||(r=t[this.getScriptPartFromCode(n)]),r||(r=t[this.formatLanguageCode(n)]),r||(r=t[this.getLanguagePartFromCode(n)]),r||(r=t.default),r||[]}toResolveHierarchy(t,n){const r=this.getFallbackCodes(n||this.options.fallbackLng||[],t),o=[],s=l=>{l&&(this.isSupportedCode(l)?o.push(l):this.logger.warn(`rejecting language code not found in supportedLngs: ${l}`))};return typeof t=="string"&&(t.indexOf("-")>-1||t.indexOf("_")>-1)?(this.options.load!=="languageOnly"&&s(this.formatLanguageCode(t)),this.options.load!=="languageOnly"&&this.options.load!=="currentOnly"&&s(this.getScriptPartFromCode(t)),this.options.load!=="currentOnly"&&s(this.getLanguagePartFromCode(t))):typeof t=="string"&&s(this.formatLanguageCode(t)),r.forEach(l=>{o.indexOf(l)<0&&s(this.formatLanguageCode(l))}),o}}let wee=[{lngs:["ach","ak","am","arn","br","fil","gun","ln","mfe","mg","mi","oc","pt","pt-BR","tg","tl","ti","tr","uz","wa"],nr:[1,2],fc:1},{lngs:["af","an","ast","az","bg","bn","ca","da","de","dev","el","en","eo","es","et","eu","fi","fo","fur","fy","gl","gu","ha","hi","hu","hy","ia","it","kk","kn","ku","lb","mai","ml","mn","mr","nah","nap","nb","ne","nl","nn","no","nso","pa","pap","pms","ps","pt-PT","rm","sco","se","si","so","son","sq","sv","sw","ta","te","tk","ur","yo"],nr:[1,2],fc:2},{lngs:["ay","bo","cgg","fa","ht","id","ja","jbo","ka","km","ko","ky","lo","ms","sah","su","th","tt","ug","vi","wo","zh"],nr:[1],fc:3},{lngs:["be","bs","cnr","dz","hr","ru","sr","uk"],nr:[1,2,5],fc:4},{lngs:["ar"],nr:[0,1,2,3,11,100],fc:5},{lngs:["cs","sk"],nr:[1,2,5],fc:6},{lngs:["csb","pl"],nr:[1,2,5],fc:7},{lngs:["cy"],nr:[1,2,3,8],fc:8},{lngs:["fr"],nr:[1,2],fc:9},{lngs:["ga"],nr:[1,2,3,7,11],fc:10},{lngs:["gd"],nr:[1,2,3,20],fc:11},{lngs:["is"],nr:[1,2],fc:12},{lngs:["jv"],nr:[0,1],fc:13},{lngs:["kw"],nr:[1,2,3,4],fc:14},{lngs:["lt"],nr:[1,2,10],fc:15},{lngs:["lv"],nr:[1,2,0],fc:16},{lngs:["mk"],nr:[1,2],fc:17},{lngs:["mnk"],nr:[0,1,2],fc:18},{lngs:["mt"],nr:[1,2,11,20],fc:19},{lngs:["or"],nr:[2,1],fc:2},{lngs:["ro"],nr:[1,2,20],fc:20},{lngs:["sl"],nr:[5,1,2,3],fc:21},{lngs:["he","iw"],nr:[1,2,20,21],fc:22}],See={1:function(e){return+(e>1)},2:function(e){return+(e!=1)},3:function(e){return 0},4:function(e){return e%10==1&&e%100!=11?0:e%10>=2&&e%10<=4&&(e%100<10||e%100>=20)?1:2},5:function(e){return e==0?0:e==1?1:e==2?2:e%100>=3&&e%100<=10?3:e%100>=11?4:5},6:function(e){return e==1?0:e>=2&&e<=4?1:2},7:function(e){return e==1?0:e%10>=2&&e%10<=4&&(e%100<10||e%100>=20)?1:2},8:function(e){return e==1?0:e==2?1:e!=8&&e!=11?2:3},9:function(e){return+(e>=2)},10:function(e){return e==1?0:e==2?1:e<7?2:e<11?3:4},11:function(e){return e==1||e==11?0:e==2||e==12?1:e>2&&e<20?2:3},12:function(e){return+(e%10!=1||e%100==11)},13:function(e){return+(e!==0)},14:function(e){return e==1?0:e==2?1:e==3?2:3},15:function(e){return e%10==1&&e%100!=11?0:e%10>=2&&(e%100<10||e%100>=20)?1:2},16:function(e){return e%10==1&&e%100!=11?0:e!==0?1:2},17:function(e){return e==1||e%10==1&&e%100!=11?0:1},18:function(e){return e==0?0:e==1?1:2},19:function(e){return e==1?0:e==0||e%100>1&&e%100<11?1:e%100>10&&e%100<20?2:3},20:function(e){return e==1?0:e==0||e%100>0&&e%100<20?1:2},21:function(e){return e%100==1?1:e%100==2?2:e%100==3||e%100==4?3:0},22:function(e){return e==1?0:e==2?1:(e<0||e>10)&&e%10==0?2:3}};const Cee=["v1","v2","v3"],Ree=["v4"],RP={zero:0,one:1,two:2,few:3,many:4,other:5};function Eee(){const e={};return wee.forEach(t=>{t.lngs.forEach(n=>{e[n]={numbers:t.nr,plurals:See[t.fc]}})}),e}class kee{constructor(t){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};this.languageUtils=t,this.options=n,this.logger=Xo.create("pluralResolver"),(!this.options.compatibilityJSON||Ree.includes(this.options.compatibilityJSON))&&(typeof Intl>"u"||!Intl.PluralRules)&&(this.options.compatibilityJSON="v3",this.logger.error("Your environment seems not to be Intl API compatible, use an Intl.PluralRules polyfill. Will fallback to the compatibilityJSON v3 format handling.")),this.rules=Eee()}addRule(t,n){this.rules[t]=n}getRule(t){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(this.shouldUseIntlApi())try{return new Intl.PluralRules(fp(t==="dev"?"en":t),{type:n.ordinal?"ordinal":"cardinal"})}catch{return}return this.rules[t]||this.rules[this.languageUtils.getLanguagePartFromCode(t)]}needsPlural(t){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};const r=this.getRule(t,n);return this.shouldUseIntlApi()?r&&r.resolvedOptions().pluralCategories.length>1:r&&r.numbers.length>1}getPluralFormsOfKey(t,n){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};return this.getSuffixes(t,r).map(o=>`${n}${o}`)}getSuffixes(t){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};const r=this.getRule(t,n);return r?this.shouldUseIntlApi()?r.resolvedOptions().pluralCategories.sort((o,s)=>RP[o]-RP[s]).map(o=>`${this.options.prepend}${n.ordinal?`ordinal${this.options.prepend}`:""}${o}`):r.numbers.map(o=>this.getSuffix(t,o,n)):[]}getSuffix(t,n){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};const o=this.getRule(t,r);return o?this.shouldUseIntlApi()?`${this.options.prepend}${r.ordinal?`ordinal${this.options.prepend}`:""}${o.select(n)}`:this.getSuffixRetroCompatible(o,n):(this.logger.warn(`no plural rule found for: ${t}`),"")}getSuffixRetroCompatible(t,n){const r=t.noAbs?t.plurals(n):t.plurals(Math.abs(n));let o=t.numbers[r];this.options.simplifyPluralSuffix&&t.numbers.length===2&&t.numbers[0]===1&&(o===2?o="plural":o===1&&(o=""));const s=()=>this.options.prepend&&o.toString()?this.options.prepend+o.toString():o.toString();return this.options.compatibilityJSON==="v1"?o===1?"":typeof o=="number"?`_plural_${o.toString()}`:s():this.options.compatibilityJSON==="v2"||this.options.simplifyPluralSuffix&&t.numbers.length===2&&t.numbers[0]===1?s():this.options.prepend&&r.toString()?this.options.prepend+r.toString():r.toString()}shouldUseIntlApi(){return!Cee.includes(this.options.compatibilityJSON)}}function EP(e,t,n){let r=arguments.length>3&&arguments[3]!==void 0?arguments[3]:".",o=arguments.length>4&&arguments[4]!==void 0?arguments[4]:!0,s=hee(e,t,n);return!s&&o&&typeof n=="string"&&(s=gv(e,n,r),s===void 0&&(s=gv(t,n,r))),s}class Pee{constructor(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};this.logger=Xo.create("interpolator"),this.options=t,this.format=t.interpolation&&t.interpolation.format||(n=>n),this.init(t)}init(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};t.interpolation||(t.interpolation={escapeValue:!0});const{escape:n,escapeValue:r,useRawValueToEscape:o,prefix:s,prefixEscaped:l,suffix:c,suffixEscaped:u,formatSeparator:f,unescapeSuffix:p,unescapePrefix:m,nestingPrefix:g,nestingPrefixEscaped:S,nestingSuffix:w,nestingSuffixEscaped:v,nestingOptionsSeparator:x,maxReplaces:R,alwaysFormat:k}=t.interpolation;this.escape=n!==void 0?n:gee,this.escapeValue=r!==void 0?r:!0,this.useRawValueToEscape=o!==void 0?o:!1,this.prefix=s?fl(s):l||"{{",this.suffix=c?fl(c):u||"}}",this.formatSeparator=f||",",this.unescapePrefix=p?"":m||"-",this.unescapeSuffix=this.unescapePrefix?"":p||"",this.nestingPrefix=g?fl(g):S||fl("$t("),this.nestingSuffix=w?fl(w):v||fl(")"),this.nestingOptionsSeparator=x||",",this.maxReplaces=R||1e3,this.alwaysFormat=k!==void 0?k:!1,this.resetRegExp()}reset(){this.options&&this.init(this.options)}resetRegExp(){const t=(n,r)=>n&&n.source===r?(n.lastIndex=0,n):new RegExp(r,"g");this.regexp=t(this.regexp,`${this.prefix}(.+?)${this.suffix}`),this.regexpUnescape=t(this.regexpUnescape,`${this.prefix}${this.unescapePrefix}(.+?)${this.unescapeSuffix}${this.suffix}`),this.nestingRegexp=t(this.nestingRegexp,`${this.nestingPrefix}(.+?)${this.nestingSuffix}`)}interpolate(t,n,r,o){let s,l,c;const u=this.options&&this.options.interpolation&&this.options.interpolation.defaultVariables||{};function f(w){return w.replace(/\$/g,"$$$$")}const p=w=>{if(w.indexOf(this.formatSeparator)<0){const k=EP(n,u,w,this.options.keySeparator,this.options.ignoreJSONStructure);return this.alwaysFormat?this.format(k,void 0,r,{...o,...n,interpolationkey:w}):k}const v=w.split(this.formatSeparator),x=v.shift().trim(),R=v.join(this.formatSeparator).trim();return this.format(EP(n,u,x,this.options.keySeparator,this.options.ignoreJSONStructure),R,r,{...o,...n,interpolationkey:x})};this.resetRegExp();const m=o&&o.missingInterpolationHandler||this.options.missingInterpolationHandler,g=o&&o.interpolation&&o.interpolation.skipOnVariables!==void 0?o.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables;return[{regex:this.regexpUnescape,safeValue:w=>f(w)},{regex:this.regexp,safeValue:w=>this.escapeValue?f(this.escape(w)):f(w)}].forEach(w=>{for(c=0;s=w.regex.exec(t);){const v=s[1].trim();if(l=p(v),l===void 0)if(typeof m=="function"){const R=m(t,s,o);l=typeof R=="string"?R:""}else if(o&&Object.prototype.hasOwnProperty.call(o,v))l="";else if(g){l=s[0];continue}else this.logger.warn(`missed to pass in variable ${v} for interpolating ${t}`),l="";else typeof l!="string"&&!this.useRawValueToEscape&&(l=yP(l));const x=w.safeValue(l);if(t=t.replace(s[0],x),g?(w.regex.lastIndex+=l.length,w.regex.lastIndex-=s[0].length):w.regex.lastIndex=0,c++,c>=this.maxReplaces)break}}),t}nest(t,n){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},o,s,l;function c(u,f){const p=this.nestingOptionsSeparator;if(u.indexOf(p)<0)return u;const m=u.split(new RegExp(`${p}[ ]*{`));let g=`{${m[1]}`;u=m[0],g=this.interpolate(g,l);const S=g.match(/'/g),w=g.match(/"/g);(S&&S.length%2===0&&!w||w.length%2!==0)&&(g=g.replace(/'/g,'"'));try{l=JSON.parse(g),f&&(l={...f,...l})}catch(v){return this.logger.warn(`failed parsing options string in nesting for key ${u}`,v),`${u}${p}${g}`}return l.defaultValue&&l.defaultValue.indexOf(this.prefix)>-1&&delete l.defaultValue,u}for(;o=this.nestingRegexp.exec(t);){let u=[];l={...r},l=l.replace&&typeof l.replace!="string"?l.replace:l,l.applyPostProcessor=!1,delete l.defaultValue;let f=!1;if(o[0].indexOf(this.formatSeparator)!==-1&&!/{.*}/.test(o[1])){const p=o[1].split(this.formatSeparator).map(m=>m.trim());o[1]=p.shift(),u=p,f=!0}if(s=n(c.call(this,o[1].trim(),l),l),s&&o[0]===t&&typeof s!="string")return s;typeof s!="string"&&(s=yP(s)),s||(this.logger.warn(`missed to resolve ${o[1]} for nesting ${t}`),s=""),f&&(s=u.reduce((p,m)=>this.format(p,m,r.lng,{...r,interpolationkey:o[1].trim()}),s.trim())),t=t.replace(o[0],s),this.regexp.lastIndex=0}return t}}function Oee(e){let t=e.toLowerCase().trim();const n={};if(e.indexOf("(")>-1){const r=e.split("(");t=r[0].toLowerCase().trim();const o=r[1].substring(0,r[1].length-1);t==="currency"&&o.indexOf(":")<0?n.currency||(n.currency=o.trim()):t==="relativetime"&&o.indexOf(":")<0?n.range||(n.range=o.trim()):o.split(";").forEach(l=>{if(l){const[c,...u]=l.split(":"),f=u.join(":").trim().replace(/^'+|'+$/g,""),p=c.trim();n[p]||(n[p]=f),f==="false"&&(n[p]=!1),f==="true"&&(n[p]=!0),isNaN(f)||(n[p]=parseInt(f,10))}})}return{formatName:t,formatOptions:n}}function pl(e){const t={};return function(r,o,s){const l=o+JSON.stringify(s);let c=t[l];return c||(c=e(fp(o),s),t[l]=c),c(r)}}class Tee{constructor(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};this.logger=Xo.create("formatter"),this.options=t,this.formats={number:pl((n,r)=>{const o=new Intl.NumberFormat(n,{...r});return s=>o.format(s)}),currency:pl((n,r)=>{const o=new Intl.NumberFormat(n,{...r,style:"currency"});return s=>o.format(s)}),datetime:pl((n,r)=>{const o=new Intl.DateTimeFormat(n,{...r});return s=>o.format(s)}),relativetime:pl((n,r)=>{const o=new Intl.RelativeTimeFormat(n,{...r});return s=>o.format(s,r.range||"day")}),list:pl((n,r)=>{const o=new Intl.ListFormat(n,{...r});return s=>o.format(s)})},this.init(t)}init(t){const r=(arguments.length>1&&arguments[1]!==void 0?arguments[1]:{interpolation:{}}).interpolation;this.formatSeparator=r.formatSeparator?r.formatSeparator:r.formatSeparator||","}add(t,n){this.formats[t.toLowerCase().trim()]=n}addCached(t,n){this.formats[t.toLowerCase().trim()]=pl(n)}format(t,n,r){let o=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{};return n.split(this.formatSeparator).reduce((c,u)=>{const{formatName:f,formatOptions:p}=Oee(u);if(this.formats[f]){let m=c;try{const g=o&&o.formatParams&&o.formatParams[o.interpolationkey]||{},S=g.locale||g.lng||o.locale||o.lng||r;m=this.formats[f](c,S,{...p,...o,...g})}catch(g){this.logger.warn(g)}return m}else this.logger.warn(`there was no format function for ${f}`);return c},t)}}function $ee(e,t){e.pending[t]!==void 0&&(delete e.pending[t],e.pendingCount--)}class jee extends up{constructor(t,n,r){let o=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{};super(),this.backend=t,this.store=n,this.services=r,this.languageUtils=r.languageUtils,this.options=o,this.logger=Xo.create("backendConnector"),this.waitingReads=[],this.maxParallelReads=o.maxParallelReads||10,this.readingCalls=0,this.maxRetries=o.maxRetries>=0?o.maxRetries:5,this.retryTimeout=o.retryTimeout>=1?o.retryTimeout:350,this.state={},this.queue=[],this.backend&&this.backend.init&&this.backend.init(r,o.backend,o)}queueLoad(t,n,r,o){const s={},l={},c={},u={};return t.forEach(f=>{let p=!0;n.forEach(m=>{const g=`${f}|${m}`;!r.reload&&this.store.hasResourceBundle(f,m)?this.state[g]=2:this.state[g]<0||(this.state[g]===1?l[g]===void 0&&(l[g]=!0):(this.state[g]=1,p=!1,l[g]===void 0&&(l[g]=!0),s[g]===void 0&&(s[g]=!0),u[m]===void 0&&(u[m]=!0)))}),p||(c[f]=!0)}),(Object.keys(s).length||Object.keys(l).length)&&this.queue.push({pending:l,pendingCount:Object.keys(l).length,loaded:{},errors:[],callback:o}),{toLoad:Object.keys(s),pending:Object.keys(l),toLoadLanguages:Object.keys(c),toLoadNamespaces:Object.keys(u)}}loaded(t,n,r){const o=t.split("|"),s=o[0],l=o[1];n&&this.emit("failedLoading",s,l,n),r&&this.store.addResourceBundle(s,l,r,void 0,void 0,{skipCopy:!0}),this.state[t]=n?-1:2;const c={};this.queue.forEach(u=>{pee(u.loaded,[s],l),$ee(u,t),n&&u.errors.push(n),u.pendingCount===0&&!u.done&&(Object.keys(u.loaded).forEach(f=>{c[f]||(c[f]={});const p=u.loaded[f];p.length&&p.forEach(m=>{c[f][m]===void 0&&(c[f][m]=!0)})}),u.done=!0,u.errors.length?u.callback(u.errors):u.callback())}),this.emit("loaded",c),this.queue=this.queue.filter(u=>!u.done)}read(t,n,r){let o=arguments.length>3&&arguments[3]!==void 0?arguments[3]:0,s=arguments.length>4&&arguments[4]!==void 0?arguments[4]:this.retryTimeout,l=arguments.length>5?arguments[5]:void 0;if(!t.length)return l(null,{});if(this.readingCalls>=this.maxParallelReads){this.waitingReads.push({lng:t,ns:n,fcName:r,tried:o,wait:s,callback:l});return}this.readingCalls++;const c=(f,p)=>{if(this.readingCalls--,this.waitingReads.length>0){const m=this.waitingReads.shift();this.read(m.lng,m.ns,m.fcName,m.tried,m.wait,m.callback)}if(f&&p&&o<this.maxRetries){setTimeout(()=>{this.read.call(this,t,n,r,o+1,s*2,l)},s);return}l(f,p)},u=this.backend[r].bind(this.backend);if(u.length===2){try{const f=u(t,n);f&&typeof f.then=="function"?f.then(p=>c(null,p)).catch(c):c(null,f)}catch(f){c(f)}return}return u(t,n,c)}prepareLoading(t,n){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},o=arguments.length>3?arguments[3]:void 0;if(!this.backend)return this.logger.warn("No backend was added via i18next.use. Will not load resources."),o&&o();typeof t=="string"&&(t=this.languageUtils.toResolveHierarchy(t)),typeof n=="string"&&(n=[n]);const s=this.queueLoad(t,n,r,o);if(!s.toLoad.length)return s.pending.length||o(),null;s.toLoad.forEach(l=>{this.loadOne(l)})}load(t,n,r){this.prepareLoading(t,n,{},r)}reload(t,n,r){this.prepareLoading(t,n,{reload:!0},r)}loadOne(t){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"";const r=t.split("|"),o=r[0],s=r[1];this.read(o,s,"read",void 0,void 0,(l,c)=>{l&&this.logger.warn(`${n}loading namespace ${s} for language ${o} failed`,l),!l&&c&&this.logger.log(`${n}loaded namespace ${s} for language ${o}`,c),this.loaded(t,l,c)})}saveMissing(t,n,r,o,s){let l=arguments.length>5&&arguments[5]!==void 0?arguments[5]:{},c=arguments.length>6&&arguments[6]!==void 0?arguments[6]:()=>{};if(this.services.utils&&this.services.utils.hasLoadedNamespace&&!this.services.utils.hasLoadedNamespace(n)){this.logger.warn(`did not save key "${r}" as the namespace "${n}" was not yet loaded`,"This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!");return}if(!(r==null||r==="")){if(this.backend&&this.backend.create){const u={...l,isUpdate:s},f=this.backend.create.bind(this.backend);if(f.length<6)try{let p;f.length===5?p=f(t,n,r,o,u):p=f(t,n,r,o),p&&typeof p.then=="function"?p.then(m=>c(null,m)).catch(c):c(null,p)}catch(p){c(p)}else f(t,n,r,o,c,u)}!t||!t[0]||this.store.addResource(t[0],n,r,o)}}}function kP(){return{debug:!1,initImmediate:!0,ns:["translation"],defaultNS:["translation"],fallbackLng:["dev"],fallbackNS:!1,supportedLngs:!1,nonExplicitSupportedLngs:!1,load:"all",preload:!1,simplifyPluralSuffix:!0,keySeparator:".",nsSeparator:":",pluralSeparator:"_",contextSeparator:"_",partialBundledLanguages:!1,saveMissing:!1,updateMissing:!1,saveMissingTo:"fallback",saveMissingPlurals:!0,missingKeyHandler:!1,missingInterpolationHandler:!1,postProcess:!1,postProcessPassResolved:!1,returnNull:!1,returnEmptyString:!0,returnObjects:!1,joinArrays:!1,returnedObjectHandler:!1,parseMissingKeyHandler:!1,appendNamespaceToMissingKey:!1,appendNamespaceToCIMode:!1,overloadTranslationOptionHandler:function(t){let n={};if(typeof t[1]=="object"&&(n=t[1]),typeof t[1]=="string"&&(n.defaultValue=t[1]),typeof t[2]=="string"&&(n.tDescription=t[2]),typeof t[2]=="object"||typeof t[3]=="object"){const r=t[3]||t[2];Object.keys(r).forEach(o=>{n[o]=r[o]})}return n},interpolation:{escapeValue:!0,format:e=>e,prefix:"{{",suffix:"}}",formatSeparator:",",unescapePrefix:"-",nestingPrefix:"$t(",nestingSuffix:")",nestingOptionsSeparator:",",maxReplaces:1e3,skipOnVariables:!0}}}function PP(e){return typeof e.ns=="string"&&(e.ns=[e.ns]),typeof e.fallbackLng=="string"&&(e.fallbackLng=[e.fallbackLng]),typeof e.fallbackNS=="string"&&(e.fallbackNS=[e.fallbackNS]),e.supportedLngs&&e.supportedLngs.indexOf("cimode")<0&&(e.supportedLngs=e.supportedLngs.concat(["cimode"])),e}function hp(){}function Aee(e){Object.getOwnPropertyNames(Object.getPrototypeOf(e)).forEach(n=>{typeof e[n]=="function"&&(e[n]=e[n].bind(e))})}class hu extends up{constructor(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},n=arguments.length>1?arguments[1]:void 0;if(super(),this.options=PP(t),this.services={},this.logger=Xo,this.modules={external:[]},Aee(this),n&&!this.isInitialized&&!t.isClone){if(!this.options.initImmediate)return this.init(t,n),this;setTimeout(()=>{this.init(t,n)},0)}}init(){var t=this;let n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},r=arguments.length>1?arguments[1]:void 0;this.isInitializing=!0,typeof n=="function"&&(r=n,n={}),!n.defaultNS&&n.defaultNS!==!1&&n.ns&&(typeof n.ns=="string"?n.defaultNS=n.ns:n.ns.indexOf("translation")<0&&(n.defaultNS=n.ns[0]));const o=kP();this.options={...o,...this.options,...PP(n)},this.options.compatibilityAPI!=="v1"&&(this.options.interpolation={...o.interpolation,...this.options.interpolation}),n.keySeparator!==void 0&&(this.options.userDefinedKeySeparator=n.keySeparator),n.nsSeparator!==void 0&&(this.options.userDefinedNsSeparator=n.nsSeparator);function s(p){return p?typeof p=="function"?new p:p:null}if(!this.options.isClone){this.modules.logger?Xo.init(s(this.modules.logger),this.options):Xo.init(null,this.options);let p;this.modules.formatter?p=this.modules.formatter:typeof Intl<"u"&&(p=Tee);const m=new CP(this.options);this.store=new xP(this.options.resources,this.options);const g=this.services;g.logger=Xo,g.resourceStore=this.store,g.languageUtils=m,g.pluralResolver=new kee(m,{prepend:this.options.pluralSeparator,compatibilityJSON:this.options.compatibilityJSON,simplifyPluralSuffix:this.options.simplifyPluralSuffix}),p&&(!this.options.interpolation.format||this.options.interpolation.format===o.interpolation.format)&&(g.formatter=s(p),g.formatter.init(g,this.options),this.options.interpolation.format=g.formatter.format.bind(g.formatter)),g.interpolator=new Pee(this.options),g.utils={hasLoadedNamespace:this.hasLoadedNamespace.bind(this)},g.backendConnector=new jee(s(this.modules.backend),g.resourceStore,g,this.options),g.backendConnector.on("*",function(S){for(var w=arguments.length,v=new Array(w>1?w-1:0),x=1;x<w;x++)v[x-1]=arguments[x];t.emit(S,...v)}),this.modules.languageDetector&&(g.languageDetector=s(this.modules.languageDetector),g.languageDetector.init&&g.languageDetector.init(g,this.options.detection,this.options)),this.modules.i18nFormat&&(g.i18nFormat=s(this.modules.i18nFormat),g.i18nFormat.init&&g.i18nFormat.init(this)),this.translator=new pp(this.services,this.options),this.translator.on("*",function(S){for(var w=arguments.length,v=new Array(w>1?w-1:0),x=1;x<w;x++)v[x-1]=arguments[x];t.emit(S,...v)}),this.modules.external.forEach(S=>{S.init&&S.init(this)})}if(this.format=this.options.interpolation.format,r||(r=hp),this.options.fallbackLng&&!this.services.languageDetector&&!this.options.lng){const p=this.services.languageUtils.getFallbackCodes(this.options.fallbackLng);p.length>0&&p[0]!=="dev"&&(this.options.lng=p[0])}!this.services.languageDetector&&!this.options.lng&&this.logger.warn("init: no languageDetector is used and no lng is defined"),["getResource","hasResourceBundle","getResourceBundle","getDataByLanguage"].forEach(p=>{this[p]=function(){return t.store[p](...arguments)}}),["addResource","addResources","addResourceBundle","removeResourceBundle"].forEach(p=>{this[p]=function(){return t.store[p](...arguments),t}});const u=fu(),f=()=>{const p=(m,g)=>{this.isInitializing=!1,this.isInitialized&&!this.initializedStoreOnce&&this.logger.warn("init: i18next is already initialized. You should call init just once!"),this.isInitialized=!0,this.options.isClone||this.logger.log("initialized",this.options),this.emit("initialized",this.options),u.resolve(g),r(m,g)};if(this.languages&&this.options.compatibilityAPI!=="v1"&&!this.isInitialized)return p(null,this.t.bind(this));this.changeLanguage(this.options.lng,p)};return this.options.resources||!this.options.initImmediate?f():setTimeout(f,0),u}loadResources(t){let r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:hp;const o=typeof t=="string"?t:this.language;if(typeof t=="function"&&(r=t),!this.options.resources||this.options.partialBundledLanguages){if(o&&o.toLowerCase()==="cimode"&&(!this.options.preload||this.options.preload.length===0))return r();const s=[],l=c=>{if(!c||c==="cimode")return;this.services.languageUtils.toResolveHierarchy(c).forEach(f=>{f!=="cimode"&&s.indexOf(f)<0&&s.push(f)})};o?l(o):this.services.languageUtils.getFallbackCodes(this.options.fallbackLng).forEach(u=>l(u)),this.options.preload&&this.options.preload.forEach(c=>l(c)),this.services.backendConnector.load(s,this.options.ns,c=>{!c&&!this.resolvedLanguage&&this.language&&this.setResolvedLanguage(this.language),r(c)})}else r(null)}reloadResources(t,n,r){const o=fu();return t||(t=this.languages),n||(n=this.options.ns),r||(r=hp),this.services.backendConnector.reload(t,n,s=>{o.resolve(),r(s)}),o}use(t){if(!t)throw new Error("You are passing an undefined module! Please check the object you are passing to i18next.use()");if(!t.type)throw new Error("You are passing a wrong module! Please check the object you are passing to i18next.use()");return t.type==="backend"&&(this.modules.backend=t),(t.type==="logger"||t.log&&t.warn&&t.error)&&(this.modules.logger=t),t.type==="languageDetector"&&(this.modules.languageDetector=t),t.type==="i18nFormat"&&(this.modules.i18nFormat=t),t.type==="postProcessor"&&wP.addPostProcessor(t),t.type==="formatter"&&(this.modules.formatter=t),t.type==="3rdParty"&&this.modules.external.push(t),this}setResolvedLanguage(t){if(!(!t||!this.languages)&&!(["cimode","dev"].indexOf(t)>-1))for(let n=0;n<this.languages.length;n++){const r=this.languages[n];if(!(["cimode","dev"].indexOf(r)>-1)&&this.store.hasLanguageSomeTranslations(r)){this.resolvedLanguage=r;break}}}changeLanguage(t,n){var r=this;this.isLanguageChangingTo=t;const o=fu();this.emit("languageChanging",t);const s=u=>{this.language=u,this.languages=this.services.languageUtils.toResolveHierarchy(u),this.resolvedLanguage=void 0,this.setResolvedLanguage(u)},l=(u,f)=>{f?(s(f),this.translator.changeLanguage(f),this.isLanguageChangingTo=void 0,this.emit("languageChanged",f),this.logger.log("languageChanged",f)):this.isLanguageChangingTo=void 0,o.resolve(function(){return r.t(...arguments)}),n&&n(u,function(){return r.t(...arguments)})},c=u=>{!t&&!u&&this.services.languageDetector&&(u=[]);const f=typeof u=="string"?u:this.services.languageUtils.getBestMatchFromCodes(u);f&&(this.language||s(f),this.translator.language||this.translator.changeLanguage(f),this.services.languageDetector&&this.services.languageDetector.cacheUserLanguage&&this.services.languageDetector.cacheUserLanguage(f)),this.loadResources(f,p=>{l(p,f)})};return!t&&this.services.languageDetector&&!this.services.languageDetector.async?c(this.services.languageDetector.detect()):!t&&this.services.languageDetector&&this.services.languageDetector.async?this.services.languageDetector.detect.length===0?this.services.languageDetector.detect().then(c):this.services.languageDetector.detect(c):c(t),o}getFixedT(t,n,r){var o=this;const s=function(l,c){let u;if(typeof c!="object"){for(var f=arguments.length,p=new Array(f>2?f-2:0),m=2;m<f;m++)p[m-2]=arguments[m];u=o.options.overloadTranslationOptionHandler([l,c].concat(p))}else u={...c};u.lng=u.lng||s.lng,u.lngs=u.lngs||s.lngs,u.ns=u.ns||s.ns,u.keyPrefix!==""&&(u.keyPrefix=u.keyPrefix||r||s.keyPrefix);const g=o.options.keySeparator||".";let S;return u.keyPrefix&&Array.isArray(l)?S=l.map(w=>`${u.keyPrefix}${g}${w}`):S=u.keyPrefix?`${u.keyPrefix}${g}${l}`:l,o.t(S,u)};return typeof t=="string"?s.lng=t:s.lngs=t,s.ns=n,s.keyPrefix=r,s}t(){return this.translator&&this.translator.translate(...arguments)}exists(){return this.translator&&this.translator.exists(...arguments)}setDefaultNamespace(t){this.options.defaultNS=t}hasLoadedNamespace(t){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(!this.isInitialized)return this.logger.warn("hasLoadedNamespace: i18next was not initialized",this.languages),!1;if(!this.languages||!this.languages.length)return this.logger.warn("hasLoadedNamespace: i18n.languages were undefined or empty",this.languages),!1;const r=n.lng||this.resolvedLanguage||this.languages[0],o=this.options?this.options.fallbackLng:!1,s=this.languages[this.languages.length-1];if(r.toLowerCase()==="cimode")return!0;const l=(c,u)=>{const f=this.services.backendConnector.state[`${c}|${u}`];return f===-1||f===2};if(n.precheck){const c=n.precheck(this,l);if(c!==void 0)return c}return!!(this.hasResourceBundle(r,t)||!this.services.backendConnector.backend||this.options.resources&&!this.options.partialBundledLanguages||l(r,t)&&(!o||l(s,t)))}loadNamespaces(t,n){const r=fu();return this.options.ns?(typeof t=="string"&&(t=[t]),t.forEach(o=>{this.options.ns.indexOf(o)<0&&this.options.ns.push(o)}),this.loadResources(o=>{r.resolve(),n&&n(o)}),r):(n&&n(),Promise.resolve())}loadLanguages(t,n){const r=fu();typeof t=="string"&&(t=[t]);const o=this.options.preload||[],s=t.filter(l=>o.indexOf(l)<0&&this.services.languageUtils.isSupportedCode(l));return s.length?(this.options.preload=o.concat(s),this.loadResources(l=>{r.resolve(),n&&n(l)}),r):(n&&n(),Promise.resolve())}dir(t){if(t||(t=this.resolvedLanguage||(this.languages&&this.languages.length>0?this.languages[0]:this.language)),!t)return"rtl";const n=["ar","shu","sqr","ssh","xaa","yhd","yud","aao","abh","abv","acm","acq","acw","acx","acy","adf","ads","aeb","aec","afb","ajp","apc","apd","arb","arq","ars","ary","arz","auz","avl","ayh","ayl","ayn","ayp","bbz","pga","he","iw","ps","pbt","pbu","pst","prp","prd","ug","ur","ydd","yds","yih","ji","yi","hbo","men","xmn","fa","jpr","peo","pes","prs","dv","sam","ckb"],r=this.services&&this.services.languageUtils||new CP(kP());return n.indexOf(r.getLanguagePartFromCode(t))>-1||t.toLowerCase().indexOf("-arab")>1?"rtl":"ltr"}static createInstance(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},n=arguments.length>1?arguments[1]:void 0;return new hu(t,n)}cloneInstance(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:hp;const r=t.forkResourceStore;r&&delete t.forkResourceStore;const o={...this.options,...t,isClone:!0},s=new hu(o);return(t.debug!==void 0||t.prefix!==void 0)&&(s.logger=s.logger.clone(t)),["store","services","language"].forEach(c=>{s[c]=this[c]}),s.services={...this.services},s.services.utils={hasLoadedNamespace:s.hasLoadedNamespace.bind(s)},r&&(s.store=new xP(this.store.data,o),s.services.resourceStore=s.store),s.translator=new pp(s.services,o),s.translator.on("*",function(c){for(var u=arguments.length,f=new Array(u>1?u-1:0),p=1;p<u;p++)f[p-1]=arguments[p];s.emit(c,...f)}),s.init(o,n),s.translator.options=o,s.translator.backendConnector.services.utils={hasLoadedNamespace:s.hasLoadedNamespace.bind(s)},s}toJSON(){return{options:this.options,store:this.store,language:this.language,languages:this.languages,resolvedLanguage:this.resolvedLanguage}}}const ln=hu.createInstance();ln.createInstance=hu.createInstance,ln.createInstance,ln.dir,ln.init,ln.loadResources,ln.reloadResources,ln.use,ln.changeLanguage,ln.getFixedT,ln.t,ln.exists,ln.setDefaultNamespace,ln.hasLoadedNamespace,ln.loadNamespaces,ln.loadLanguages;class Mee extends Id{register(){this.app.once("booting",()=>{this.initI18Next(),this.translateModelNames()})}boot(){this.translateModelColumns(),this.translateMenuEntries(),this.translateInstanceActions(),this.translateMassActions(),this.translateFormLabels(),this.translateStaticActions()}initI18Next(){ln.use(KY).init({lng:Ii.get("app.locale","en"),fallbackLng:Ii.get("app.fallback_locale","en"),resources:{[Ii.get("app.locale","en")]:{translation:Ii.get("trans",{})}},...Ii.get("i18n",{}),interpolation:{prefix:":",suffix:"",prefixEscaped:":\\b",suffixEscaped:"(?:\\b)",...Ii.get("i18n.interpolation",{})},debug:Ii.get("app.debug",!1)})}translateModelNames(){cc.reducer("model",t=>class extends t{static singular(){return ln.t(t.singular())}static plural(){return ln.t(t.plural())}},0)}translateModelColumns(){for(const t of Object.keys(cc.make()))dr.reducer(`model${Ke.studly(t)}Columns`,n=>n.map(r=>({...r,label:ln.t(r.label)})),99)}translateMenuEntries(){dr.reducer("menuItems",t=>{const n=t.find(r=>r.key==="dashboard");return n&&(n.text=ln.t(n.text)),t},5)}translateMassActions(){dr.reducer("massActions",t=>t.map(n=>({...n,label:ln.t(n.label)})),99)}translateInstanceActions(){dr.reducer("instanceActions",t=>t.map(n=>({...n,label:ln.t(n.label)})),99)}translateStaticActions(){dr.reducer("staticActions",(t,n)=>{const r=t.find(({key:o})=>o==="create");return r&&(r.label=ln.t("Create :model",{model:n.singular()})),t})}translateFormLabels(){zi.reducer("getDefaultInputProps",t=>Array.isArray(t)?t.map(n=>({...n,label:n!=null&&n.label?ln.t(n.label):n==null?void 0:n.label})):{...t,label:t!=null&&t.label?ln.t(t.label):t==null?void 0:t.label},99)}}const _ee={palette:{primary:{main:"#1d9798"},secondary:{main:"#fa510c"}}},Iee=e=>e.make("cms").getRoutes(),Lee=({theme:e=_ee,darkTheme:t,themeArgs:n,colorScheme:r="auto",providers:o,...s})=>{const l=df("(prefers-color-scheme: dark)"),c=r==="auto"?l?"dark":"light":r,u=r==="auto"&&l&&t?t:e,f=te.useMemo(()=>$g({...u,palette:{...u.palette,mode:c}},...n??[]),[u,c,n]),p=te.useMemo(()=>[mv,Mee,...o||[]],[o]);return y.jsxs(h6,{theme:f,children:[y.jsx(p7,{}),y.jsx(I4,{routes:Iee,providers:p,...s})]})},OP=document.getElementById("root");if(!OP)throw new Error("Failed to find the root element");xh.createRoot(OP).render(y.jsx(te.StrictMode,{children:y.jsx(Lee,{})}))})();
|
package/dist/mui-cms.js
CHANGED
|
@@ -5458,29 +5458,31 @@ const ol = {
|
|
|
5458
5458
|
}
|
|
5459
5459
|
}, sl = (e) => e.make("cms").getRoutes(), Ul = ({
|
|
5460
5460
|
theme: e = ol,
|
|
5461
|
-
|
|
5462
|
-
|
|
5463
|
-
|
|
5461
|
+
darkTheme: t,
|
|
5462
|
+
themeArgs: n,
|
|
5463
|
+
colorScheme: r = "auto",
|
|
5464
|
+
providers: o,
|
|
5465
|
+
...s
|
|
5464
5466
|
}) => {
|
|
5465
|
-
const
|
|
5466
|
-
...
|
|
5467
|
+
const a = ot("(prefers-color-scheme: dark)"), i = r === "auto" ? a ? "dark" : "light" : r, c = r === "auto" && a && t ? t : e, d = g.useMemo(() => Uo({
|
|
5468
|
+
...c,
|
|
5467
5469
|
palette: {
|
|
5468
|
-
...
|
|
5469
|
-
mode:
|
|
5470
|
+
...c.palette,
|
|
5471
|
+
mode: i
|
|
5470
5472
|
}
|
|
5471
|
-
}, ...
|
|
5473
|
+
}, ...n ?? []), [c, i, n]), u = g.useMemo(() => [
|
|
5472
5474
|
qt,
|
|
5473
5475
|
rl,
|
|
5474
|
-
...
|
|
5475
|
-
], [
|
|
5476
|
-
return /* @__PURE__ */ S(jo, { theme:
|
|
5476
|
+
...o || []
|
|
5477
|
+
], [o]);
|
|
5478
|
+
return /* @__PURE__ */ S(jo, { theme: d, children: [
|
|
5477
5479
|
/* @__PURE__ */ l(Lo, {}),
|
|
5478
5480
|
/* @__PURE__ */ l(
|
|
5479
5481
|
to,
|
|
5480
5482
|
{
|
|
5481
5483
|
routes: sl,
|
|
5482
|
-
providers:
|
|
5483
|
-
...
|
|
5484
|
+
providers: u,
|
|
5485
|
+
...s
|
|
5484
5486
|
}
|
|
5485
5487
|
)
|
|
5486
5488
|
] });
|
package/docs/configuracao.md
CHANGED
|
@@ -29,7 +29,50 @@ Para sobrescrever, passe seu próprio objeto:
|
|
|
29
29
|
/>
|
|
30
30
|
```
|
|
31
31
|
|
|
32
|
-
O modo
|
|
32
|
+
O modo de cor padrão é `auto`: segue automaticamente a preferência do sistema operacional (`prefers-color-scheme: dark`).
|
|
33
|
+
|
|
34
|
+
### colorScheme
|
|
35
|
+
|
|
36
|
+
Use a prop `colorScheme` para controlar o modo de cor:
|
|
37
|
+
|
|
38
|
+
| Valor | Comportamento |
|
|
39
|
+
|-------|--------------|
|
|
40
|
+
| `'auto'` (padrão) | Segue a preferência do sistema operacional |
|
|
41
|
+
| `'light'` | Sempre usa o tema claro |
|
|
42
|
+
| `'dark'` | Sempre usa o tema escuro |
|
|
43
|
+
|
|
44
|
+
```tsx
|
|
45
|
+
// sempre claro
|
|
46
|
+
<LuminixCms colorScheme="light" />
|
|
47
|
+
|
|
48
|
+
// sempre escuro
|
|
49
|
+
<LuminixCms colorScheme="dark" />
|
|
50
|
+
|
|
51
|
+
// automático (padrão — mantém o comportamento anterior)
|
|
52
|
+
<LuminixCms colorScheme="auto" />
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
### darkTheme
|
|
56
|
+
|
|
57
|
+
Quando `colorScheme="auto"`, use `darkTheme` para fornecer um objeto de tema distinto para o modo escuro. O `theme` continuará sendo o tema claro.
|
|
58
|
+
|
|
59
|
+
```tsx
|
|
60
|
+
<LuminixCms
|
|
61
|
+
colorScheme="auto"
|
|
62
|
+
theme={{
|
|
63
|
+
palette: {
|
|
64
|
+
primary: { main: '#1d9798' },
|
|
65
|
+
},
|
|
66
|
+
}}
|
|
67
|
+
darkTheme={{
|
|
68
|
+
palette: {
|
|
69
|
+
primary: { main: '#90caf9' },
|
|
70
|
+
},
|
|
71
|
+
}}
|
|
72
|
+
/>
|
|
73
|
+
```
|
|
74
|
+
|
|
75
|
+
> **Nota:** `darkTheme` só tem efeito quando `colorScheme="auto"`. Para `colorScheme="dark"`, passe diretamente o tema desejado via `theme`.
|
|
33
76
|
|
|
34
77
|
### themeArgs
|
|
35
78
|
|
package/package.json
CHANGED
|
@@ -5,9 +5,13 @@ import { DrawerProps as MuiDrawerProps, AppBarProps as MuiAppBarProps, BoxProps,
|
|
|
5
5
|
import { ListTypeMap } from '@mui/material/List';
|
|
6
6
|
import { DefaultComponentProps } from '@mui/material/OverridableComponent';
|
|
7
7
|
import { MenuItem } from './Menu';
|
|
8
|
+
export type ColorScheme = 'auto' | 'light' | 'dark';
|
|
8
9
|
export type LuminixCmsProps = Partial<LuminixProviderProps> & {
|
|
9
10
|
theme?: ThemeOptions;
|
|
11
|
+
/** Only applied when `colorScheme="auto"` and the OS prefers dark mode. */
|
|
12
|
+
darkTheme?: ThemeOptions;
|
|
10
13
|
themeArgs?: object[];
|
|
14
|
+
colorScheme?: ColorScheme;
|
|
11
15
|
};
|
|
12
16
|
export type LayoutProps = BoxProps & {
|
|
13
17
|
slotProps?: {
|