4a5feb12465f66947af2f40a4785344e/******/////*///// 请勿使用非法用途


过安全狗、云锁、阿里云、360、护卫神、D盾、百度云、各种杀软!

iamH4CKEERRRRRRRRRRRS

I am a hacker in the dark of a very cold night

path :/home/drive/domains/drive.vcenetwork.com/public_html/public

upload file:

List of files:

name file size edit permission action
.htaccess1125 KBFebruary 26 2023 04:58:260644
1.zip1856 KBMay 26 2025 03:52:060644
arl.txt1 KBMay 26 2025 03:58:190644
build-August 19 2024 20:27:470755
cabs.jpg.phtml34996 KBMay 25 2025 13:50:430644
cool30203 KBMay 26 2025 03:49:270644
cool.php44 KBMay 26 2025 03:50:140644
favicon-May 26 2025 07:38:380755
favicon.ico502 KBAugust 19 2024 21:12:300644
htaccess.example1125 KBMay 20 2024 07:03:520755
images-August 19 2024 20:27:470755
index.php1949 KBMay 20 2024 07:03:520755
install_files-July 31 2023 19:05:060755
invoice.css99133 KBMay 20 2024 07:03:520644
manifest.json1055 KBAugust 19 2024 21:25:160644
robots.txt1154 KBJune 07 2025 12:24:520755
storage-May 25 2025 13:49:550755
style.php26 KBMay 26 2025 03:52:280644
swagger.yaml33646 KBMay 20 2024 07:03:520755
web.config914 KBMay 20 2024 07:03:520755
import{u as we,j as e,c as v,C as $r,T as r,a as $e,b as I,O as Js,d as Lr,E as Ea,s as Mr,m as h,k as Dr,R as $,r as d,e as Le,f as Pa,S as vs,I as g,g as k,K as Ys,h as E,$ as Ts,A as fs,i as Ta,l as $a,n as Rr,o as Qe,p as Q,D as Z,q as ne,t as ee,v as K,F as de,w as Vr,B as f,x as P,y as M,z as Ye,G as Zs,H as bs,J as as,P as La,L as Xs,M as R,N as D,Q as O,U as se,V as Fe,W as et,X as st,Y as xe,Z as Se,_ as p,a0 as At,a1 as qe,a2 as Et,a3 as B,a4 as ve,a5 as G,a6 as Or,a7 as Pt,a8 as Ma,a9 as Gs,aa as ls,ab as qr,ac as Da,ad as la,ae as ys,af as tt,ag as ns,ah as ae,ai as Tt,aj as os,ak as F,al as ze,am as Hr,an as Ra,ao as Va,ap as Br,aq as $s,ar as Oa,as as U,at as qa,au as Ae,av as Ur,aw as Wr,ax as Kr,ay as at,az as Gr,aA as Qr,aB as Ha,aC as Ls,aD as Ms,aE as cs,aF as $t,aG as Jr,aH as ue,aI as je,aJ as Ba,aK as Lt,aL as Ua,aM as Ze,aN as Mt,aO as ds,aP as Yr,aQ as oa,aR as nt,aS as ws,aT as Ss,aU as Dt,aV as rs,aW as Wa,aX as Zr,aY as Xr,aZ as ei,a_ as Ka,a$ as si,b0 as ti,b1 as ai,b2 as ni,b3 as ri,b4 as ii,b5 as li,b6 as oi,b7 as ci,b8 as di,b9 as ui,ba as Rt,bb as mi,bc as hi,bd as xi,be as gi,bf as pi,bg as ji,bh as fi,bi,bj as vi,bk as Ga,bl as yi,bm as wi,bn as Vt,bo as Qa,bp as Si,bq as ki,br as te,bs as Ni}from"./main-d4af3e3c.js";import{D as Ci,a as _i,b as Fi,c as zi,F as ie,d as oe,e as us,u as ks,K as Ds,f as Ot,I as Ii,N as Ai,g as Ei,C as Pi,S as Ti,B as $i,h as Li,T as Mi,A as _e,i as qt,j as Di,k as Ja,l as yt,m as L,n as Ri,o as Vi,p as wt,q as rt,r as Ue,s as Oi,t as qi,v as Hi,w as it,U as Bi,L as Ht,M as Ya,x as Ui,y as Wi,z as Ki,E as Gi,G as Qi,H as Ji,J as Yi,O as Zi,P as Xi,Q as el,R as sl,V as tl}from"./Info-61549577.js";import{S as Je,E as He,B as al,a as ca}from"./Edit-007bdb63.js";import{u as Za,a as nl}from"./use-resume-subscription-81a149c4.js";function rl({className:s,isCompactMode:t}){const{version:a}=we();return e.jsxs("div",{className:v(s,"relative flex flex-col gap-20 overflow-y-auto border-r bg-alt px-12 pb-16 pt-26 text-sm font-medium text-muted"),children:[e.jsx($r,{matchDescendants:n=>n==="/admin",menu:"admin-sidebar",orientation:"vertical",onlyShowIcons:t,itemClassName:({isActive:n})=>v("block w-full rounded-button py-12 px-16",n?"bg-primary/6 text-primary font-semibold":"hover:bg-hover"),gap:"gap-8"}),!t&&e.jsx("div",{className:"mt-auto gap-14 px-16 text-xs",children:e.jsx(r,{message:"Version: :number",values:{number:a}})})]})}function il(){return $e({queryKey:["admin-setup-alerts"],queryFn:()=>ll()})}function ll(){return I.get("admin/setup-alerts").then(s=>s.data)}function ol(){return e.jsxs(Ci,{name:"admin",leftSidenavCanBeCompact:!0,children:[e.jsx(_i,{size:"sm",menuPosition:"admin-navbar"}),e.jsx(Fi,{position:"left",size:"sm",children:e.jsx(rl,{})}),e.jsx(zi,{children:e.jsxs("div",{className:"bg dark:bg-alt",children:[e.jsx(cl,{}),e.jsx(Js,{})]})})]})}function cl(){const{data:s}=il(),[t]=Lr("admin-setup-alert-dismissed",null),a=!t||Date.now()-t.timestamp>864e5;return!(s!=null&&s.alerts.length)||!a?null:e.jsx("div",{className:"fixed left-0 right-0 top-24 z-10 mx-auto w-max overflow-hidden rounded-panel bg shadow-md",children:e.jsx(dl,{alert:s.alerts[0]})})}function dl({alert:s}){const t=e.jsx("div",{dangerouslySetInnerHTML:{__html:s.description}});return e.jsx(Je,{leadingIcon:e.jsx(Ea,{size:"xs",className:"text-danger"}),onClose:()=>{Mr("admin-setup-alert-dismissed",{timestamp:Date.now()})},title:s.title,description:t,color:"neutral"},s.title)}const ul=[{key:"email_verified_at",label:h("Email"),description:h("Email verification status"),defaultOperator:ie.ne,control:{type:oe.Select,defaultValue:"01",options:[{key:"01",label:h("is confirmed"),value:{value:null,operator:ie.ne}},{key:"02",label:h("is not confirmed"),value:{value:null,operator:ie.eq}}]}},us({description:h("Date user registered or was created")}),ks({description:h("Date user was last updated")}),{key:"subscriptions",label:h("Subscription"),description:h("Whether user is subscribed or not"),defaultOperator:ie.eq,control:{type:oe.Select,defaultValue:"01",options:[{key:"01",label:h("is subscribed"),value:{value:"*",operator:ie.has}},{key:"02",label:h("is not subscribed"),value:{value:"*",operator:ie.doesntHave}}]}}],Y=(s,t)=>{const a=s.split("/");return t&&a.push(t),a};function ml(s,t,a,n){return $e({queryKey:Y(s,t),queryFn:({signal:i})=>hl(s,t,n,i),placeholderData:Dr,...a})}async function hl(s,t,a,n){t.query&&await new Promise(l=>setTimeout(l,300));const i=await I.get(s,{params:t,signal:t.query?n:void 0}).then(l=>l.data);return a==null||a(i),i}const Xa=$.createContext(null);function lt(){return d.useContext(Xa)}function xl(s){return"next_cursor"in s?s.next_cursor!=null:"last_page"in s?s.current_page0&&s.data.length>=s.per_page}const gl=15,pl=[{key:10},{key:15},{key:20},{key:50},{key:100}];function jl({query:s,onPerPageChange:t,onPageChange:a,className:n}){var m;const i=Le(),l=Pa(),o=(m=s.data)==null?void 0:m.pagination;if(!o)return null;const c=t?e.jsx(vs,{minWidth:"min-w-auto",selectionMode:"single",disabled:s.isLoading,labelPosition:"side",size:"xs",label:e.jsx(r,{message:"Items per page"}),selectedValue:o.per_page||gl,onSelectionChange:u=>t(u),children:pl.map(u=>e.jsx(g,{value:u.key,children:u.key},u.key))}):null;return e.jsxs("div",{className:v("flex h-54 select-none items-center justify-end gap-20 px-20",n),children:[!i&&c,o.from&&o.to&&"total"in o?e.jsx("div",{className:"text-sm",children:e.jsx(r,{message:":from - :to of :total",values:{from:o.from,to:o.to,total:l.format(o.total)}})}):null,e.jsxs("div",{className:"text-muted",children:[e.jsx(k,{disabled:s.isFetching||o.current_page<2,onClick:()=>{a==null||a((o==null?void 0:o.current_page)-1)},children:e.jsx(Ys,{})}),e.jsx(k,{disabled:s.isFetching||!xl(o),onClick:()=>{a==null||a((o==null?void 0:o.current_page)+1)},children:e.jsx(Ds,{})})]})]})}const fl=E(e.jsx("path",{d:"M7 6h10l-5.01 6.3L7 6zm-2.75-.39C6.27 8.2 10 13 10 13v6c0 .55.45 1 1 1h2c.55 0 1-.45 1-1v-6s3.72-4.8 5.74-7.39c.51-.66.04-1.61-.79-1.61H5.04c-.83 0-1.3.95-.79 1.61z"}),"FilterAltOutlined"),da={variants:{open:{height:"auto",visibility:"visible",transitionEnd:{overflow:"auto"}},closed:{height:0,overflow:"hidden",transitionEnd:{visibility:"hidden"}}},transition:{type:"tween",duration:.2}},Xe=$.forwardRef(({variant:s="default",mode:t="single",children:a,className:n,isLazy:i,...l},o)=>{const[c,m]=Ts(l.expandedValues,l.defaultExpandedValues||[],l.onExpandedChange),u=$.Children.count(a);return e.jsx("div",{className:v(s==="outline"&&"space-y-10",n),ref:o,role:"presentation",children:e.jsx(fs,{children:e.jsx(Ta,{children:$.Children.map(a,(x,j)=>d.isValidElement(x)?d.cloneElement(x,{key:x.key||j,value:x.props.value||j,isFirst:j===0,isLast:j===u-1,mode:t,variant:s,expandedValues:c,setExpandedValues:m,isLazy:i}):null)})})})});function Ce(s){const{children:t,label:a,disabled:n,bodyClassName:i,labelClassName:l,buttonPadding:o="py-10 pl-14 pr-10",startIcon:c,description:m,endAppend:u,chevronPosition:x="right",isFirst:j,mode:b,isLazy:y,variant:w,footerContent:S,onHeaderMouseEnter:_,onHeaderMouseLeave:z}=s,A=s.expandedValues||[],N=s.value||0,J=s.setExpandedValues||(()=>{}),T=d.useRef(null),X=!n&&A.includes(N),le=d.useRef(!1);X&&(le.current=!0);const H=$a(),re=d.useId(),me=`${re}-button`,he=`${re}-panel`,De=ge=>{switch(ge.key){case"ArrowDown":H==null||H.focusNext();break;case"ArrowUp":H==null||H.focusPrevious();break;case"Home":H==null||H.focusFirst();break;case"End":H==null||H.focusLast();break}},Re=()=>{const ge=A.indexOf(N);if(ge>-1){const ss=[...A];ss.splice(ge,1),J(ss)}else J(b==="single"?[N]:[...A,N])},Ie=e.jsx("div",{className:v(w==="minimal"&&""),children:e.jsx(Rr,{"aria-hidden":"true",size:"md",className:v(n?"text-disabled":"text-muted",X&&"rotate-180 transition-transform")})});return e.jsxs("div",{className:v(w==="default"&&"border-b",w==="outline"&&"rounded-panel border",n&&"text-disabled"),children:[e.jsxs("h3",{className:v("flex w-full items-center justify-between text-sm",n&&"pointer-events-none",j&&w==="default"&&"border-t",X&&w!=="minimal"?"border-b":"border-b border-b-transparent",w==="outline"?X?"rounded-panel-t":"rounded-panel":void 0),onMouseEnter:_,onMouseLeave:z,children:[e.jsxs("button",{disabled:n,"aria-expanded":X,id:me,"aria-controls":he,type:"button",ref:T,onKeyDown:De,onClick:()=>{n||Re()},className:v("flex flex-auto items-center gap-10 text-left outline-none hover:bg-hover focus-visible:bg-primary/focus",o),children:[x==="left"&&Ie,c&&d.cloneElement(c,{size:"md",className:v(c.props.className,n?"text-disabled":"text-muted")}),e.jsxs("div",{className:"flex-auto overflow-hidden overflow-ellipsis",children:[e.jsx("div",{className:l,"data-testid":"accordion-label",children:a}),m&&e.jsx("div",{className:"text-xs text-muted",children:m})]}),x==="right"&&Ie]}),u&&e.jsx("div",{className:"flex-shrink-0 px-4 text-sm text-muted",children:u})]}),e.jsxs(Qe.div,{"aria-labelledby":re,role:"region",variants:da.variants,transition:da.transition,initial:!1,animate:X?"open":"closed",children:[e.jsx("div",{className:v("p-16",i),children:!y||le?t:null}),S]})]})}function bl({filter:s}){return null}function vl({filters:s}){const{decodedFilters:t}=Ot(s),{formId:a}=Q(),[n,i]=d.useState(()=>t.map(c=>c.key)),l=e.jsx(f,{size:"xs",variant:"outline",className:"mr-auto",onClick:()=>{i([])},children:e.jsx(r,{message:"Clear"})}),o=e.jsx(f,{size:"xs",variant:"flat",color:"primary",className:"ml-auto",type:"submit",form:a,children:e.jsx(r,{message:"Apply"})});return e.jsxs(Z,{className:"min-w-[300px]",maxWidth:"max-w-400",size:"auto",children:[e.jsx(ne,{padding:"px-14 py-10",leftAdornment:l,rightAdornment:o,children:e.jsx(r,{message:"Filter"})}),e.jsx(ee,{padding:"p-0",children:e.jsx(yl,{filters:s,expandedFilters:n,setExpandedFilters:i})})]})}function yl({filters:s,expandedFilters:t,setExpandedFilters:a}){const{decodedFilters:n,replaceAll:i}=Ot(s),l={};s.forEach(u=>{const x=n.find(j=>j.key===u.key);l[u.key]=(x==null?void 0:x.value)!==void 0?x:{value:u.control.defaultValue,operator:u.defaultOperator}});const o=K({defaultValues:l}),{formId:c,close:m}=Q();return e.jsx(de,{form:o,id:c,onSubmit:u=>{const x=Object.entries(u).filter(([j,b])=>t.includes(j)&&b!==void 0).map(([j,b])=>({key:j,...b}));i(x),m()},children:e.jsx(Xe,{mode:"multiple",expandedValues:t,onExpandedChange:a,children:s.map(u=>e.jsxs(Ce,{startIcon:e.jsx(Vr,{checked:t.includes(u.key)}),value:u.key,label:e.jsx(r,{...u.label}),bodyClassName:"max-h-288 overflow-y-auto compact-scrollbar",children:[u.description&&e.jsx("div",{className:v("text-xs text-muted",u.control.type!==oe.BooleanToggle&&"mb-14"),children:e.jsx(r,{...u.description})}),e.jsx(wl,{filter:u})]},u.key))})})}function wl({filter:s}){switch(s.control.type){case oe.Select:return e.jsx(Ti,{filter:s});case oe.ChipField:return e.jsx(Pi,{filter:s});case oe.DateRangePicker:return e.jsx(Ei,{filter:s});case oe.SelectModel:return e.jsx(Ai,{filter:s});case oe.Input:return e.jsx(Ii,{filter:s});case oe.BooleanToggle:return e.jsx(bl,{filter:s});case"custom":const t=s.control.panel;return e.jsx(t,{filter:s});default:return null}}function Sl({filters:s,icon:t=e.jsx(fl,{}),color:a="primary",variant:n="outline",size:i="sm",disabled:l,className:o}){const c=Le(),m=e.jsx(f,{variant:n,color:a,startIcon:t,disabled:l,size:i,className:o,children:e.jsx(r,{message:"Filter"})}),u=e.jsx(k,{color:a,size:"sm",variant:n,disabled:l,className:o,children:t});return e.jsxs(P,{type:"popover",children:[c?u:m,e.jsx(vl,{filters:s})]})}function kl({actions:s,filters:t,filtersLoading:a,searchPlaceholder:n=h("Type to search..."),searchValue:i="",onSearchChange:l}){const{trans:o}=M();return e.jsxs(en,{children:[e.jsx(Ye,{size:"sm",className:"mr-auto min-w-180 max-w-440 flex-auto",inputWrapperClassName:"mr-24 md:mr-0",placeholder:o(n),startAdornment:e.jsx(Zs,{size:"sm"}),value:i,onChange:c=>{l(c.target.value)}}),t&&e.jsx(Sl,{filters:t,disabled:a}),s]})}function en({children:s,...t}){return e.jsx("div",{className:"hidden-scrollbar relative mb-24 flex h-42 items-center gap-8 overflow-x-auto text-muted md:gap-12",...t,children:s})}function Nl({actions:s,selectedItemsCount:t}){return e.jsxs(en,{"data-testid":"datatable-selected-header",children:[e.jsx("div",{className:"mr-auto",children:e.jsx(r,{message:"[one 1 item|other :count items] selected",values:{count:t}})}),s]})}function Cl(){return e.jsxs(Qe.div,{className:"flex items-center gap-6 h-30",...bs,children:[e.jsx(as,{variant:"rect",size:"h-full w-144",radius:"rounded-md"}),e.jsx(as,{variant:"rect",size:"h-full w-112",radius:"rounded-md"}),e.jsx(as,{variant:"rect",size:"h-full w-172",radius:"rounded-md"})]},"filter-list-skeleton")}function sn({filters:s,filtersLoading:t,columns:a,searchPlaceholder:n,queryParams:i,endpoint:l,actions:o,selectedActions:c,emptyStateMessage:m,tableDomProps:u,onRowAction:x,enableSelection:j=!0,selectionStyle:b="checkbox",children:y,cellHeight:w,collapseTableOnMobile:S=!0}){var me;const _=Le(),{trans:z}=M(),{encodedFilters:A}=Ot(s),[N,J]=d.useState({perPage:15}),[T,X]=d.useState([]),le=ml(l,{...N,...i,[$i]:A},void 0,()=>X([])),H=!!(N.query||N.filters||A),re=(me=le.data)==null?void 0:me.pagination;return e.jsxs(Xa.Provider,{value:{selectedRows:T,setSelectedRows:X,endpoint:l,params:N,setParams:J,query:le},children:[y,e.jsx(fs,{initial:!1,mode:"wait",children:T.length?e.jsx(Nl,{selectedItemsCount:T.length,actions:c},"selected"):e.jsx(kl,{searchPlaceholder:n,searchValue:N.query,onSearchChange:he=>J({...N,query:he}),actions:o,filters:s,filtersLoading:t},"default")}),s&&e.jsx("div",{className:"mb-14",children:e.jsx(fs,{initial:!1,mode:"wait",children:t&&A?e.jsx(Cl,{}):e.jsx(Qe.div,{...bs,children:e.jsx(Li,{filters:s})},"filter-list")})}),e.jsxs("div",{className:v("relative rounded-panel",(!_||!S)&&"border"),children:[le.isFetching&&e.jsx(La,{isIndeterminate:!0,className:"absolute left-0 top-0 z-10 w-full","aria-label":z({message:"Loading"}),size:"xs"}),e.jsx("div",{className:"relative overflow-x-auto md:overflow-hidden",children:e.jsx(Mi,{...u,columns:a,data:(re==null?void 0:re.data)||[],sortDescriptor:N,onSortChange:he=>{J({...N,...he})},selectedRows:T,enableSelection:j,selectionStyle:b,onSelectionChange:X,onAction:x,collapseOnMobile:S,cellHeight:w})}),(le.isFetched||le.isPlaceholderData)&&!(re!=null&&re.data.length)?e.jsx("div",{className:"pt-50",children:d.cloneElement(m,{isFiltering:H})}):void 0,e.jsx(jl,{query:le,onPageChange:he=>J({...N,page:he}),onPerPageChange:he=>J({...N,perPage:he})})]})]})}function Ee({title:s,headerContent:t,headerItemsAlign:a="items-end",className:n,padding:i,...l}){const o=d.useId();return e.jsxs("div",{className:v(i??"p-12 md:p-24",n),children:[s&&e.jsxs("div",{className:v("mb-16",t&&`flex ${a} gap-4`),children:[e.jsx(Xs,{children:s}),e.jsx("h1",{className:"text-3xl font-light first:capitalize",id:o,children:s}),t]}),e.jsx(sn,{...l,tableDomProps:{"aria-labelledby":s?o:void 0}})]})}function _l(){const{endpoint:s,selectedRows:t,setSelectedRows:a}=lt();return R({mutationFn:()=>Fl(s,t),onSuccess:async()=>{await D.invalidateQueries({queryKey:Y(s)}),O(h("Deleted [one 1 record|other :count records]",{values:{count:t.length}})),a([])},onError:n=>se(n,h("Could not delete records"))})}function Fl(s,t){return I.delete(`${s}/${t.join(",")}`).then(a=>a.data)}function ms(){return e.jsxs(P,{type:"modal",children:[e.jsx(f,{variant:"flat",color:"danger",className:"ml-auto",children:e.jsx(r,{message:"Delete"})}),e.jsx(zl,{})]})}function zl(){const s=_l(),{selectedRows:t}=lt(),{close:a}=Q();return e.jsx(Fe,{isLoading:s.isPending,title:e.jsx(r,{message:"Delete [one 1 item|other :count items]?",values:{count:t.length}}),body:e.jsx(r,{message:"This will permanently remove the items and cannot be undone."}),confirm:e.jsx(r,{message:"Delete"}),isDanger:!0,onConfirm:()=>{s.mutate(void 0,{onSuccess:()=>a()})}})}function ye({isFiltering:s,title:t,filteringTitle:a,image:n,size:i,className:l}){const o=Le();return i||(i=o?"sm":"md"),e.jsx(et,{className:l,size:i,image:e.jsx(st,{src:n}),title:s&&a?a:t,description:s&&a?e.jsx(r,{message:"Try another search query or different filters"}):void 0})}const As=""+new URL("team-de984127.svg",import.meta.url).href,Me=$.forwardRef(({children:s,to:t,elementType:a,onClick:n,href:i,download:l,icon:o,disabled:c},m)=>Le()?e.jsx(k,{ref:m,variant:"flat",color:"primary",className:"flex-shrink-0",size:"sm",to:t,href:i,download:l,elementType:a,onClick:n,disabled:c,children:o||e.jsx(_e,{})}):e.jsx(f,{ref:m,startIcon:o||e.jsx(_e,{}),variant:"flat",color:"primary",size:"sm",to:t,href:i,download:l,elementType:a,onClick:n,disabled:c,children:s}));function Il(s){return R({mutationFn:t=>Al(s,t),onError:t=>se(t)})}function Al(s,t){return I.post(s,t).then(a=>a.data)}function El(){const{close:s}=Q();return e.jsxs(Z,{children:[e.jsx(ne,{children:e.jsx(r,{message:"Csv export"})}),e.jsx(ee,{children:e.jsx(r,{message:`Your request is being processed. We'll email you when the report is ready to download. In certain cases, it might take a little longer, depending on the number of items beings exported and the volume of activity.`})}),e.jsx(xe,{children:e.jsx(f,{variant:"flat",color:"primary",onClick:s,children:e.jsx(r,{message:"Got it"})})})]})}function tn({endpoint:s,payload:t}){const[a,n]=d.useState(!1),i=Il(s);return e.jsxs(d.Fragment,{children:[e.jsx(k,{variant:"outline",color:"primary",size:"sm",className:"flex-shrink-0",disabled:i.isPending,onClick:()=>{i.mutate(t,{onSuccess:l=>{l.downloadPath?qt(l.downloadPath):n(!0)}})},children:e.jsx(Di,{})}),e.jsx(P,{type:"modal",isOpen:a,onOpenChange:n,children:e.jsx(El,{})})]})}function es({image:s,label:t,description:a,labelClassName:n,avatarSize:i="md"}){return e.jsxs("div",{className:"flex items-center gap-12",children:[s&&e.jsx(Ja,{size:i,className:"flex-shrink-0",src:s}),e.jsxs("div",{className:"min-w-0 overflow-hidden",children:[e.jsx("div",{className:v(n,"overflow-hidden overflow-ellipsis"),children:t}),a&&e.jsx("div",{className:"overflow-hidden overflow-ellipsis text-xs text-muted",children:a})]})]})}const an=E(e.jsx("path",{d:"m20 17.17-3.37-3.38c.64.22 1.23.48 1.77.76.97.51 1.58 1.52 1.6 2.62zm1.19 4.02-1.41 1.41-2.61-2.6H4v-2.78c0-1.12.61-2.15 1.61-2.66 1.29-.66 2.87-1.22 4.67-1.45L1.39 4.22 2.8 2.81l18.39 18.38zM15.17 18l-3-3H12c-2.37 0-4.29.73-5.48 1.34-.32.16-.52.5-.52.88V18h9.17zM12 6c1.1 0 2 .9 2 2 0 .86-.54 1.59-1.3 1.87l1.48 1.48C15.28 10.64 16 9.4 16 8c0-2.21-1.79-4-4-4-1.4 0-2.64.72-3.35 1.82l1.48 1.48C10.41 6.54 11.14 6 12 6z"}),"PersonOffOutlined");function Pl(s,t){return R({mutationFn:a=>Tl(t,a),onSuccess:async()=>{O(h("User suspended")),await D.invalidateQueries({queryKey:["users"]})},onError:a=>Se(a,s)})}function Tl(s,t){return I.post(`users/${s}/ban`,t).then(a=>a.data)}function $l({user:s}){const{trans:t}=M(),{close:a,formId:n}=Q(),i=K({defaultValues:{permanent:!0}}),l=i.watch("permanent"),o=Pl(i,s.id);return e.jsxs(Z,{children:[e.jsx(ne,{children:e.jsx(r,{message:"Suspend “:name“",values:{name:s.display_name}})}),e.jsx(ee,{children:e.jsxs(de,{id:n,form:i,onSubmit:c=>o.mutate(c,{onSuccess:()=>a()}),children:[e.jsx(yt,{name:"ban_until",label:e.jsx(r,{message:"Suspend until"}),disabled:l}),e.jsx(L,{name:"permanent",className:"mt-12",children:e.jsx(r,{message:"Permanent"})}),e.jsx(p,{className:"mt-24",name:"comment",inputElementType:"textarea",maxLength:250,label:e.jsx(r,{message:"Reason"}),placeholder:t(h("Optional"))})]})}),e.jsxs(xe,{children:[e.jsx(f,{onClick:()=>a(),children:e.jsx(r,{message:"Cancel"})}),e.jsx(f,{form:n,variant:"flat",color:"primary",type:"submit",disabled:o.isPending,children:e.jsx(r,{message:"Suspend"})})]})]})}function Ll(s){return R({mutationFn:()=>Ml(s),onSuccess:()=>{O(h("User unsuspended")),D.invalidateQueries({queryKey:["users"]})},onError:t=>se(t)})}function Ml(s){return I.delete(`users/${s}/unban`).then(t=>t.data)}function Dl(){return R({mutationFn:s=>Rl(s),onSuccess:async s=>{O(h(`Impersonating User "${s.user.display_name}"`)),window.location.href="/"},onError:s=>se(s)})}function Rl(s){return I.post(`admin/users/impersonate/${s.userId}`,s).then(t=>t.data)}const ua=[{key:"name",allowsSorting:!0,sortingKey:"email",width:"flex-3 min-w-200",visibleInMode:"all",header:()=>e.jsx(r,{message:"User"}),body:s=>e.jsx(es,{image:s.avatar,label:s.display_name,description:s.email})},{key:"subscribed",header:()=>e.jsx(r,{message:"Subscribed"}),width:"w-96",body:s=>{var t;return(t=s.subscriptions)!=null&&t.length?e.jsx(At,{className:"text-positive icon-md"}):e.jsx(qe,{className:"text-danger icon-md"})}},{key:"roles",header:()=>e.jsx(r,{message:"Roles"}),body:s=>{var t;return e.jsx(Ri,{radius:"rounded",size:"xs",children:(t=s==null?void 0:s.roles)==null?void 0:t.map(a=>e.jsx(Et,{selectable:!0,children:e.jsx(B,{className:v("capitalize"),target:"_blank",to:`/admin/roles/${a.id}/edit`,children:e.jsx(r,{message:a.name})})},a.id))})}},{key:"firstName",allowsSorting:!0,header:()=>e.jsx(r,{message:"First name"}),body:s=>s.first_name},{key:"lastName",allowsSorting:!0,header:()=>e.jsx(r,{message:"Last name"}),body:s=>s.last_name},{key:"createdAt",allowsSorting:!0,width:"w-96",header:()=>e.jsx(r,{message:"Created at"}),body:s=>e.jsx("time",{children:e.jsx(ve,{date:s.created_at})})},{key:"actions",header:()=>e.jsx(r,{message:"Actions"}),width:"w-128 flex-shrink-0",hideHeader:!0,align:"end",visibleInMode:"all",body:s=>e.jsxs("div",{className:"text-muted",children:[e.jsx(B,{to:`${s.id}/edit`,children:e.jsx(G,{label:e.jsx(r,{message:"Edit user"}),children:e.jsx(k,{size:"md",children:e.jsx(He,{})})})}),s.banned_at?e.jsx(Vl,{user:s}):e.jsxs(P,{type:"modal",children:[e.jsx(G,{label:e.jsx(r,{message:"Suspend user"}),children:e.jsx(k,{size:"md",children:e.jsx(an,{})})}),e.jsx($l,{user:s})]}),e.jsx(Ol,{user:s})]})}];function Vl({user:s}){const t=Ll(s.id);return e.jsxs(P,{type:"modal",onClose:a=>{a&&t.mutate()},children:[e.jsx(G,{label:e.jsx(r,{message:"Remove suspension"}),children:e.jsx(k,{size:"md",color:"danger",children:e.jsx(an,{})})}),e.jsx(Fe,{isDanger:!0,title:e.jsx(r,{message:"Suspend “:name“",values:{name:s.display_name}}),body:e.jsx(r,{message:"Are you sure you want to remove suspension from this user?"}),confirm:e.jsx(r,{message:"Unsuspend"})})]})}function Ol({user:s}){const t=Dl();return e.jsxs(P,{type:"modal",children:[e.jsx(G,{label:e.jsx(r,{message:"Login as user"}),children:e.jsx(k,{size:"md",children:e.jsx(Or,{})})}),e.jsx(Fe,{title:e.jsx(r,{message:"Login as “:name“",values:{name:s.display_name}}),isLoading:t.isPending,body:e.jsx(r,{message:"Are you sure you want to login as this user?"}),confirm:e.jsx(r,{message:"Login"}),onConfirm:()=>{t.mutate({userId:s.id})}})]})}function ql(){const{billing:s}=we(),t=s.enable?ua:ua.filter(a=>a.key!=="subscribed");return e.jsx(d.Fragment,{children:e.jsx(Ee,{endpoint:"users",title:e.jsx(r,{message:"Users"}),filters:ul,columns:t,actions:e.jsx(Hl,{}),queryParams:{with:"subscriptions,bans"},selectedActions:e.jsx(ms,{}),emptyStateMessage:e.jsx(ye,{image:As,title:e.jsx(r,{message:"No users have been created yet"}),filteringTitle:e.jsx(r,{message:"No matching users"})})})})}function Hl(){return e.jsxs(d.Fragment,{children:[e.jsx(tn,{endpoint:"users/csv/export"}),e.jsx(Me,{elementType:B,to:"new",children:e.jsx(r,{message:"Add new user"})})]})}const Bl=s=>(t,a,n)=>{const i=n.subscribe;return n.subscribe=(o,c,m)=>{let u=o;if(c){const x=(m==null?void 0:m.equalityFn)||Object.is;let j=o(n.getState());u=b=>{const y=o(b);if(!x(j,y)){const w=j;c(j=y,w)}},m!=null&&m.fireImmediately&&c(j,j)}return i(u)},s(t,a,n)},Ul=Bl;function nn(s,t){return s.reduce((a,n,i)=>{const l=Math.floor(i/t);return a[l]||(a[l]=[]),a[l].push(n),a},[])}const Wl={preview:{defaultRoute:"/",navigationRoutes:[]},sections:{general:{label:h("General"),position:1,buildBreadcrumb:()=>[{label:h("General"),location:"general"}]},themes:{label:h("Themes"),position:2,buildBreadcrumb:(s,t)=>{var l;const a=s.split("/").filter(o=>!!o),[,,,n]=a,i=[{label:h("Themes"),location:"themes"}];return n!=null&&i.push({label:(l=t.appearance.themes.all[+n])==null?void 0:l.name,location:`themes/${n}`}),a.at(-1)==="font"&&i.push({label:h("Font"),location:`themes/${n}/font`}),a.at(-1)==="radius"&&i.push({label:h("Rounding"),location:`themes/${n}/radius`}),i}},menus:{label:h("Menus"),position:3,buildBreadcrumb:(s,t)=>{const a=s.split("/").filter(o=>!!o),[,,...n]=a,i=[{label:h("Menus"),location:"menus"}],l=nn(n,2);return l.forEach(([o,c],m)=>{var u,x;if(o==="menus"&&c!=null)i.push({label:(u=t.settings.menus[+c])==null?void 0:u.name,location:`menus/${c}`});else if(o==="items"&&c!=null){const[,j]=l[m-1];i.push({label:(x=t.settings.menus[+j].items[+c])==null?void 0:x.label,location:`menus/${j}/${c}`})}}),i},config:{availableRoutes:["/","/login","/register","/contact","/pricing","/account-settings","/admin","/admin/appearance","/admin/settings","/admin/plans","/admin/subscriptions","/admin/users","/admin/roles","/admin/pages","/admin/tags","/admin/files","/admin/localizations","/admin/ads","/admin/settings/authentication","/admin/settings/branding","/admin/settings/cache","/admin/settings/providers","/api-docs"],positions:["admin-navbar","admin-sidebar","custom-page-navbar","auth-page-footer","auth-dropdown","account-settings-page","billing-page","checkout-page-navbar","checkout-page-footer","pricing-table-page","contact-us-page","notifications-page","footer","footer-secondary"]}},"custom-code":{label:h("Custom Code"),position:4,buildBreadcrumb:()=>[{label:h("Custom code"),location:"custom-code"}]},"seo-settings":{label:h("SEO Settings"),position:5,buildBreadcrumb:()=>[{label:h("SEO"),location:"seo"}]}}};function Kl(s){const{size:t="md",inline:a,label:n,showValueLabel:i=!!n,className:l,width:o="w-full",slider:c,children:m,trackColor:u="primary",fillColor:x="primary"}=s,{domProps:j,trackRef:b,getThumbPercent:y,getThumbValueLabel:w,labelId:S,groupId:_,thumbIds:z,isDisabled:A,numberFormatter:N,minValue:J,maxValue:T,step:X,values:le,getValueLabel:H}=c;let re="",me=Math.max([...N.format(J)].length,[...N.format(T)].length,[...N.format(X)].length);H?re=H(le[0]):le.length===1?re=w(0):le.length===2&&(re=`${w(0)} – ${w(1)}`,me=3+2*Math.max(me,[...N.format(J)].length,[...N.format(T)].length));const he=Pt({size:t,disabled:A,labelDisplay:"flex"}),De=v("touch-none",l,o,{"flex items-center":a});return e.jsxs("div",{className:De,role:"group",id:_,children:[(n||i)&&e.jsxs("div",{className:v(he.label,"select-none"),children:[n&&e.jsx("label",{onClick:()=>{var Re;(Re=document.getElementById(z[0]))==null||Re.focus()},id:S,htmlFor:_,children:n}),i&&e.jsx("output",{htmlFor:z[0],className:"ml-auto text-right","aria-live":"off",style:me?{width:`${me}ch`,minWidth:`${me}ch`}:void 0,children:re})]}),e.jsxs("div",{ref:b,className:v("relative",Gl(s)),...j,role:"presentation",children:[e.jsx("div",{className:v("absolute inset-0 m-auto rounded",Ql(u,A),ma(t))}),e.jsx("div",{className:v("absolute inset-0 my-auto rounded",Jl(x,A),ma(t)),style:{width:`${Math.max(y(0)*100,0)}%`}}),m]})]})}function Gl({size:s,wrapperHeight:t}){if(t)return t;switch(s){case"xs":return"h-14";case"sm":return"h-20";default:return"h-30"}}function ma(s){switch(s){case"xs":return"h-2";case"sm":return"h-3";default:return"h-4"}}function Ql(s,t){switch(t&&(s="disabled"),s){case"disabled":return"bg-slider-disabled/60";case"primary":return"bg-primary-light";case"neutral":return"bg-divider";default:return s}}function Jl(s,t){switch(t&&(s="disabled"),s){case"disabled":return"bg-slider-disabled";case"primary":return"bg-primary";default:return s}}function Yl({minValue:s=0,maxValue:t=100,isDisabled:a=!1,step:n=1,formatOptions:i,onChangeEnd:l,onPointerDown:o,label:c,getValueLabel:m,showThumbOnHoverOnly:u,thumbSize:x,onPointerMove:j,...b}){const[y,w]=d.useState(!1),S=Pa(i),{addGlobalListener:_,removeGlobalListener:z}=Ma(),A=d.useRef(null),[N,J]=Ts(b.value?b.value:void 0,b.defaultValue??[s],b.onChange),T=d.useRef(null);T.current=N;const[X,le]=d.useState(new Array(N.length).fill(!1)),H=d.useRef(null);H.current=X;function re(C){return S.format(C)}const me=C=>{var W;return((W=H.current)==null?void 0:W[C])||!1},he=C=>re(N[C]),De=C=>C===0?s:N[C-1],Re=C=>C===N.length-1?t:N[C+1],Ie=(C,W)=>{if(a||!ut(C)||!T.current)return;const Pe=De(C),Be=Re(C);W=qr(W,Pe,Be,n),T.current=ha(T.current,C,W),J(T.current)},ge=(C,W)=>{var Be;if(a||!ut(C))return;const Pe=(Be=H.current)==null?void 0:Be[C];H.current=ha(H.current||[],C,W),le(H.current),l&&Pe&&!H.current.some(Boolean)&&l(T.current||[])},[ss,Cs]=d.useState(void 0),qs=C=>{const W=Math.min(1,(C-s)/(t-s));return isNaN(W)?0:W},Hs=C=>qs(T.current[C]),be=(C,W)=>{Ie(C,aa(W))},Cr=C=>Math.round((C-s)/n)*n+s,aa=C=>{const W=C*(t-s)+s;return Gs(Cr(W),s,t)},na=d.useRef(new Array(N.length).fill(!0)),ut=C=>na.current[C],_r=(C,W)=>{na.current[C]=W},Ne=d.useRef(null),ra=d.useRef(void 0),Fr=C=>{if(!(C.pointerType==="mouse"&&(C.button!==0||C.altKey||C.ctrlKey||C.metaKey))&&(o==null||o(),A.current&&!a&&N.every((W,Pe)=>!X[Pe]))){const W=A.current.offsetWidth,Pe=A.current.getBoundingClientRect().left,ht=(C.clientX-Pe)/W,Bs=aa(ht);let Ve;const ts=N.findIndex(xt=>Bs-xt<0);if(ts===0)Ve=ts;else if(ts===-1)Ve=N.length-1;else{const xt=N[ts-1],Tr=N[ts];Math.abs(xt-Bs)=0&&ut(Ve)?(C.preventDefault(),Ne.current=Ve,Cs(Ve),ra.current=C.pointerId,ge(Ne.current,!0),Ie(Ve,Bs),_(window,"pointerup",ia,!1)):Ne.current=null}},_s=d.useRef(null),{domProps:zr}=Vi({onPointerDown:Fr,onMoveStart(){_s.current=null},onMove(C,W){var Be;const Pe=((Be=A.current)==null?void 0:Be.offsetWidth)||0;if(_s.current==null&&(_s.current=Hs(Ne.current||0)*Pe),_s.current+=W,Ne.current!=null&&A.current){const ht=Gs(_s.current/Pe,0,1);be(Ne.current,ht)}},onMoveEnd(){Ne.current!=null&&(ge(Ne.current,!1),Ne.current=null)}}),Ir=ls(zr,{onPointerEnter:()=>{w(!0)},onPointerLeave:()=>{w(!1)},onPointerMove:C=>{j==null||j(C)}}),ia=C=>{C.pointerId===ra.current&&(Ne.current!=null&&(ge(Ne.current,!1),Ne.current=null),z(window,"pointerup",ia,!1))},mt=d.useId(),Ar=c?`${mt}-label`:void 0,Er=`${mt}-group`,Pr=[...Array(N.length)].map((C,W)=>`${mt}-thumb-${W}`);return{domProps:Ir,trackRef:A,isDisabled:a,step:n,values:N,minValue:s,maxValue:t,focusedThumb:ss,labelId:Ar,groupId:Er,thumbIds:Pr,numberFormatter:S,getThumbPercent:Hs,getThumbMinValue:De,getThumbMaxValue:Re,getThumbValueLabel:he,isThumbDragging:me,setThumbValue:Ie,updateDraggedThumbs:ge,setThumbEditable:_r,setFocusedThumb:Cs,getValueLabel:m,isPointerOver:y,showThumbOnHoverOnly:u,thumbSize:x}}function ha(s,t,a){return s[t]===a?s:[...s.slice(0,t),a,...s.slice(t+1)]}function Zl({index:s,slider:t,isDisabled:a,ariaLabel:n,inputRef:i,onBlur:l,fillColor:o="primary"}){const c=Da(i),{addGlobalListener:m,removeGlobalListener:u}=Ma(),{step:x,values:j,focusedThumb:b,labelId:y,thumbIds:w,isDisabled:S,getThumbPercent:_,getThumbMinValue:z,getThumbMaxValue:A,getThumbValueLabel:N,setThumbValue:J,updateDraggedThumbs:T,isThumbDragging:X,setThumbEditable:le,setFocusedThumb:H,isPointerOver:re,showThumbOnHoverOnly:me,thumbSize:he="w-18 h-18"}=t,De=X(s),Re=j[s];le(s,!a);const Ie=a||S,ge=d.useCallback(()=>{c.current&&c.current.focus({preventScroll:!0})},[c]),ss=b===s;d.useEffect(()=>{ss&&ge()},[ss,ge]);const Cs=d.useRef(void 0),qs=be=>{be.pointerId===Cs.current&&(ge(),T(s,!1),u(window,"pointerup",qs,!1))},Hs=v("outline-none rounded-full top-1/2 -translate-y-1/2 -translate-x-1/2 absolute inset-0 transition-button duration-200",he,!Ie&&"shadow-md",Xl({fillColor:o,isDisabled:Ie,isDragging:De}),!me||me&&De||re?"visible":"invisible");return e.jsx("div",{role:"presentation",className:Hs,style:{left:`${Math.max(_(s)*100,0)}%`},onPointerDown:be=>{be.button!==0||be.altKey||be.ctrlKey||be.metaKey||(ge(),Cs.current=be.pointerId,T(s,!0),m(window,"pointerup",qs,!1))},children:e.jsx("input",{id:w[s],onKeyDown:la(()=>{T(s,!0)}),onKeyUp:la(()=>{T(s,!1)}),ref:c,tabIndex:Ie?void 0:0,min:z(s),max:A(s),step:x,value:Re,disabled:Ie,"aria-label":n,"aria-labelledby":y,"aria-orientation":"horizontal","aria-valuetext":N(s),onFocus:()=>{H(s)},onBlur:be=>{H(void 0),T(s,!1),l==null||l(be)},onChange:be=>{J(s,parseFloat(be.target.value))},type:"range",className:"sr-only"})})}function Xl({isDisabled:s,isDragging:t,fillColor:a}){return s?"bg-slider-disabled cursor-default":a&&a!=="primary"?a:v("hover:bg-primary-dark",t?"bg-primary-dark":"bg-primary")}function eo({inputRef:s,onBlur:t,...a}){const{onChange:n,onChangeEnd:i,value:l,defaultValue:o,...c}=a,m={...c,value:l!=null?[l]:void 0,defaultValue:o!=null?[o]:void 0,onChange:x=>{n==null||n(x[0])},onChangeEnd:x=>{i==null||i(x[0])}},u=Yl(m);return e.jsx(Kl,{...m,slider:u,children:e.jsx(Zl,{fillColor:a.fillColor,index:0,slider:u,inputRef:s,onBlur:t})})}function so({name:s,...t}){const{field:{onChange:a,onBlur:n,value:i="",ref:l}}=ys({name:s}),o={onChange:a,onBlur:n,value:i||""};return e.jsx(eo,{inputRef:l,...ls(o,t)})}const pe=d.forwardRef(({startIcon:s,children:t,className:a,description:n,...i},l)=>e.jsxs(tt,{ref:l,display:"flex",className:v("relative mb-10 h-54 w-full items-center gap-10 rounded-input border bg px-14 text-sm hover:bg-hover",a),variant:null,...i,children:[s,e.jsxs("span",{className:"block min-w-0",children:[e.jsx("span",{className:"block",children:t}),n&&e.jsx("span",{className:"block overflow-hidden overflow-ellipsis whitespace-nowrap text-xs text-muted",children:n})]}),e.jsx(Ds,{"aria-hidden":!0,className:"ml-auto text-muted icon-sm"})]})),Bt=E(e.jsx("path",{stroke:"#E0E0E0",d:"M24,44c-7.168,0-13-5.816-13-12.971C11,24,24,4,24,4s13,20,13,27.029C37,38.184,31.168,44,24,44z"}));function Ns(){return(Ns=Object.assign||function(s){for(var t=1;t=0||(i[a]=s[a]);return i}function Es(s){var t=d.useRef(s),a=d.useRef(function(n){t.current&&t.current(n)});return t.current=s,a.current}var Ps=function(s,t,a){return t===void 0&&(t=0),a===void 0&&(a=1),s>a?a:s0:_.buttons>0)&&i.current?l(xa(i.current,_,c.current)):S(!1)},w=function(){return S(!1)};function S(_){var z=m.current,A=St(i.current),N=_?A.addEventListener:A.removeEventListener;N(z?"touchmove":"mousemove",y),N(z?"touchend":"mouseup",w)}return[function(_){var z=_.nativeEvent,A=i.current;if(A&&(ga(z),!function(J,T){return T&&!zs(J)}(z,m.current)&&A)){if(zs(z)){m.current=!0;var N=z.changedTouches||[];N.length&&(c.current=N[0].identifier)}A.focus(),l(xa(A,z,c.current)),S(!0)}},function(_){var z=_.which||_.keyCode;z<37||z>40||(_.preventDefault(),o({left:z===39?.05:z===37?-.05:0,top:z===40?.05:z===38?-.05:0}))},S]},[o,l]),x=u[0],j=u[1],b=u[2];return d.useEffect(function(){return b},[b]),$.createElement("div",Ns({},n,{onTouchStart:x,onMouseDown:x,className:"react-colorful__interactive",ref:i,onKeyDown:j,tabIndex:0,role:"slider"}))}),Ut=function(s){return s.filter(Boolean).join(" ")},ln=function(s){var t=s.color,a=s.left,n=s.top,i=n===void 0?.5:n,l=Ut(["react-colorful__pointer",s.className]);return $.createElement("div",{className:l,style:{top:100*i+"%",left:100*a+"%"}},$.createElement("div",{className:"react-colorful__pointer-fill",style:{backgroundColor:t}}))},ce=function(s,t,a){return t===void 0&&(t=0),a===void 0&&(a=Math.pow(10,t)),Math.round(a*s)/a},to=function(s){return lo(kt(s))},kt=function(s){return s[0]==="#"&&(s=s.substring(1)),s.length<6?{r:parseInt(s[0]+s[0],16),g:parseInt(s[1]+s[1],16),b:parseInt(s[2]+s[2],16),a:s.length===4?ce(parseInt(s[3]+s[3],16)/255,2):1}:{r:parseInt(s.substring(0,2),16),g:parseInt(s.substring(2,4),16),b:parseInt(s.substring(4,6),16),a:s.length===8?ce(parseInt(s.substring(6,8),16)/255,2):1}},ao=function(s){return io(ro(s))},no=function(s){var t=s.s,a=s.v,n=s.a,i=(200-t)*a/100;return{h:ce(s.h),s:ce(i>0&&i<200?t*a/100/(i<=100?i:200-i)*100:0),l:ce(i/2),a:ce(n,2)}},Nt=function(s){var t=no(s);return"hsl("+t.h+", "+t.s+"%, "+t.l+"%)"},ro=function(s){var t=s.h,a=s.s,n=s.v,i=s.a;t=t/360*6,a/=100,n/=100;var l=Math.floor(t),o=n*(1-a),c=n*(1-(t-l)*a),m=n*(1-(1-t+l)*a),u=l%6;return{r:ce(255*[n,c,o,o,m,n][u]),g:ce(255*[m,n,n,c,o,o][u]),b:ce(255*[o,o,m,n,n,c][u]),a:ce(i,2)}},Us=function(s){var t=s.toString(16);return t.length<2?"0"+t:t},io=function(s){var t=s.r,a=s.g,n=s.b,i=s.a,l=i<1?Us(ce(255*i)):"";return"#"+Us(t)+Us(a)+Us(n)+l},lo=function(s){var t=s.r,a=s.g,n=s.b,i=s.a,l=Math.max(t,a,n),o=l-Math.min(t,a,n),c=o?l===t?(a-n)/o:l===a?2+(n-t)/o:4+(t-a)/o:0;return{h:ce(60*(c<0?c+6:c)),s:ce(l?o/l*100:0),v:ce(l/255*100),a:i}},oo=$.memo(function(s){var t=s.hue,a=s.onChange,n=Ut(["react-colorful__hue",s.className]);return $.createElement("div",{className:n},$.createElement(rn,{onMove:function(i){a({h:360*i.left})},onKey:function(i){a({h:Ps(t+360*i.left,0,360)})},"aria-label":"Hue","aria-valuenow":ce(t),"aria-valuemax":"360","aria-valuemin":"0"},$.createElement(ln,{className:"react-colorful__hue-pointer",left:t/360,color:Nt({h:t,s:100,v:100,a:1})})))}),co=$.memo(function(s){var t=s.hsva,a=s.onChange,n={backgroundColor:Nt({h:t.h,s:100,v:100,a:1})};return $.createElement("div",{className:"react-colorful__saturation",style:n},$.createElement(rn,{onMove:function(i){a({s:100*i.left,v:100-100*i.top})},onKey:function(i){a({s:Ps(t.s+100*i.left,0,100),v:Ps(t.v-100*i.top,0,100)})},"aria-label":"Color","aria-valuetext":"Saturation "+ce(t.s)+"%, Brightness "+ce(t.v)+"%"},$.createElement(ln,{className:"react-colorful__saturation-pointer",top:1-t.v/100,left:t.s/100,color:Nt(t)})))}),on=function(s,t){if(s===t)return!0;for(var a in s)if(s[a]!==t[a])return!1;return!0},uo=function(s,t){return s.toLowerCase()===t.toLowerCase()||on(kt(s),kt(t))};function mo(s,t,a){var n=Es(a),i=d.useState(function(){return s.toHsva(t)}),l=i[0],o=i[1],c=d.useRef({color:t,hsva:l});d.useEffect(function(){if(!s.equal(t,c.current.color)){var u=s.toHsva(t);c.current={hsva:u,color:t},o(u)}},[t,s]),d.useEffect(function(){var u;on(l,c.current.hsva)||s.equal(u=s.fromHsva(l),c.current.color)||(c.current={hsva:l,color:u},n(u))},[l,s,n]);var m=d.useCallback(function(u){o(function(x){return Object.assign({},x,u)})},[]);return[l,m]}var ho=typeof window<"u"?d.useLayoutEffect:d.useEffect,xo=function(){return typeof __webpack_nonce__<"u"?__webpack_nonce__:void 0},pa=new Map,go=function(s){ho(function(){var t=s.current?s.current.ownerDocument:document;if(t!==void 0&&!pa.has(t)){var a=t.createElement("style");a.innerHTML=`.react-colorful{position:relative;display:flex;flex-direction:column;width:200px;height:200px;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;cursor:default}.react-colorful__saturation{position:relative;flex-grow:1;border-color:transparent;border-bottom:12px solid #000;border-radius:8px 8px 0 0;background-image:linear-gradient(0deg,#000,transparent),linear-gradient(90deg,#fff,hsla(0,0%,100%,0))}.react-colorful__alpha-gradient,.react-colorful__pointer-fill{content:"";position:absolute;left:0;top:0;right:0;bottom:0;pointer-events:none;border-radius:inherit}.react-colorful__alpha-gradient,.react-colorful__saturation{box-shadow:inset 0 0 0 1px rgba(0,0,0,.05)}.react-colorful__alpha,.react-colorful__hue{position:relative;height:24px}.react-colorful__hue{background:linear-gradient(90deg,red 0,#ff0 17%,#0f0 33%,#0ff 50%,#00f 67%,#f0f 83%,red)}.react-colorful__last-control{border-radius:0 0 8px 8px}.react-colorful__interactive{position:absolute;left:0;top:0;right:0;bottom:0;border-radius:inherit;outline:none;touch-action:none}.react-colorful__pointer{position:absolute;z-index:1;box-sizing:border-box;width:28px;height:28px;transform:translate(-50%,-50%);background-color:#fff;border:2px solid #fff;border-radius:50%;box-shadow:0 2px 4px rgba(0,0,0,.2)}.react-colorful__interactive:focus .react-colorful__pointer{transform:translate(-50%,-50%) scale(1.1)}.react-colorful__alpha,.react-colorful__alpha-pointer{background-color:#fff;background-image:url('data:image/svg+xml;charset=utf-8,')}.react-colorful__saturation-pointer{z-index:3}.react-colorful__hue-pointer{z-index:2}`,pa.set(t,a);var n=xo();n&&a.setAttribute("nonce",n),t.head.appendChild(a)}},[])},po=function(s){var t=s.className,a=s.colorModel,n=s.color,i=n===void 0?a.defaultColor:n,l=s.onChange,o=ot(s,["className","colorModel","color","onChange"]),c=d.useRef(null);go(c);var m=mo(a,i,l),u=m[0],x=m[1],j=Ut(["react-colorful",t]);return $.createElement("div",Ns({},o,{ref:c,className:j}),$.createElement(co,{hsva:u,onChange:x}),$.createElement(oo,{hue:u.h,onChange:x,className:"react-colorful__last-control"}))},jo={defaultColor:"000",toHsva:to,fromHsva:function(s){return ao({h:s.h,s:s.s,v:s.v,a:1})},equal:uo},fo=function(s){return $.createElement(po,Ns({},s,{colorModel:jo}))},bo=/^#?([0-9A-F]{3,8})$/i,vo=function(s){var t=s.color,a=t===void 0?"":t,n=s.onChange,i=s.onBlur,l=s.escape,o=s.validate,c=s.format,m=s.process,u=ot(s,["color","onChange","onBlur","escape","validate","format","process"]),x=d.useState(function(){return l(a)}),j=x[0],b=x[1],y=Es(n),w=Es(i),S=d.useCallback(function(z){var A=l(z.target.value);b(A),o(A)&&y(m?m(A):A)},[l,m,o,y]),_=d.useCallback(function(z){o(z.target.value)||b(l(a)),w(z)},[a,l,o,w]);return d.useEffect(function(){b(l(a))},[a,l]),$.createElement("input",Ns({},u,{value:c?c(j):j,spellCheck:"false",onChange:S,onBlur:_}))},ja=function(s){return"#"+s},yo=function(s){var t=s.prefixed,a=s.alpha,n=ot(s,["prefixed","alpha"]),i=d.useCallback(function(o){return o.replace(/([^0-9A-F]+)/gi,"").substring(0,a?8:6)},[a]),l=d.useCallback(function(o){return function(c,m){var u=bo.exec(c),x=u?u[1].length:0;return x===3||x===6||!!m&&x===4||!!m&&x===8}(o,a)},[a]);return $.createElement(vo,Ns({},n,{escape:i,format:t?ja:void 0,process:ja,validate:l}))};class wo{getStringForLocale(t,a){let n=this.strings[a];n||(n=So(a,this.strings,this.defaultLocale),this.strings[a]=n);let i=n[t];if(!i)throw new Error(`Could not find intl message ${t} in ${a} locale`);return i}constructor(t,a="en-US"){this.strings={...t},this.defaultLocale=a}}function So(s,t,a="en-US"){if(t[s])return t[s];let n=ko(s);if(t[n])return t[n];for(let i in t)if(i.startsWith(n+"-"))return t[i];return t[a]}function ko(s){return Intl.Locale?new Intl.Locale(s).language:s.split("-")[0]}function No(s){return s&&s.__esModule?s.default:s}var cn={},dn={};dn={alpha:"ألفا",blue:"أزرق",brightness:"السطوع",green:"أخضر",hue:"درجة اللون",lightness:"الإضاءة",red:"أحمر",saturation:"التشبع"};var un={};un={alpha:"Алфа",blue:"Синьо",brightness:"Яркост",green:"Зелено",hue:"Оттенък",lightness:"Лекота",red:"Червено",saturation:"Наситеност"};var mn={};mn={alpha:"Alfa",blue:"Modrá",brightness:"Jas",green:"Zelená",hue:"Odstín",lightness:"Světlost",red:"Červená",saturation:"Sytost"};var hn={};hn={alpha:"Alfa",blue:"Blå",brightness:"Lysstyrke",green:"Grøn",hue:"Tone",lightness:"Lyshed",red:"Rød",saturation:"Farvemætning"};var xn={};xn={alpha:"Alpha",blue:"Blau",brightness:"Helligkeit",green:"Grün",hue:"Farbton",lightness:"Leuchtkraft",red:"Rot",saturation:"Sättigung"};var gn={};gn={alpha:"Άλφα",blue:"Μπλε",brightness:"Φωτεινότητα",green:"Πράσινο",hue:"Τόνος",lightness:"Φωτεινότητα",red:"Κόκκινο",saturation:"Κορεσμός"};var pn={};pn={hue:"Hue",saturation:"Saturation",lightness:"Lightness",brightness:"Brightness",red:"Red",green:"Green",blue:"Blue",alpha:"Alpha"};var jn={};jn={alpha:"Alpha",blue:"Azul",brightness:"Brillo",green:"Verde",hue:"Tono",lightness:"Luminosidad",red:"Rojo",saturation:"Saturación"};var fn={};fn={alpha:"Alfa",blue:"Sinine",brightness:"Heledus",green:"Roheline",hue:"Värv",lightness:"Valgus",red:"Punane",saturation:"Küllastus"};var bn={};bn={alpha:"Alpha",blue:"Sininen",brightness:"Kirkkaus",green:"Vihreä",hue:"Sävy",lightness:"Valomäärä",red:"Punainen",saturation:"Värikylläisyys"};var vn={};vn={alpha:"Alpha",blue:"Bleu",brightness:"Luminosité",green:"Vert",hue:"Teinte",lightness:"Luminosité",red:"Rouge",saturation:"Saturation"};var yn={};yn={alpha:"אלפא",blue:"כחול",brightness:"בהירות",green:"ירוק",hue:"גוון",lightness:"כמות אור",red:"אדום",saturation:"רוויה"};var wn={};wn={alpha:"Alfa",blue:"Plava",brightness:"Svjetlina",green:"Zelena",hue:"Nijansa",lightness:"Osvijetljenost",red:"Crvena",saturation:"Zasićenost"};var Sn={};Sn={alpha:"Alfa",blue:"Kék",brightness:"Fényesség",green:"Zöld",hue:"Színárnyalat",lightness:"Világosság",red:"Piros",saturation:"Telítettség"};var kn={};kn={alpha:"Alfa",blue:"Blu",brightness:"Luminosità",green:"Verde",hue:"Tonalità",lightness:"Luminosità",red:"Rosso",saturation:"Saturazione"};var Nn={};Nn={alpha:"アルファ",blue:"青",brightness:"明るさ",green:"緑",hue:"色相",lightness:"明度",red:"赤",saturation:"彩度"};var Cn={};Cn={alpha:"알파",blue:"파랑",brightness:"명도",green:"초록",hue:"색조",lightness:"밝기",red:"빨강",saturation:"채도"};var _n={};_n={alpha:"Alfa",blue:"Mėlyna",brightness:"Ryškumas",green:"Žalia",hue:"Atspalvis",lightness:"Šviesumas",red:"Raudona",saturation:"Įsotinimas"};var Fn={};Fn={alpha:"Alfa",blue:"Zila",brightness:"Spilgtums",green:"Zaļa",hue:"Nokrāsa",lightness:"Gaišums",red:"Sarkana",saturation:"Piesātinājums"};var zn={};zn={alpha:"Alfa",blue:"Blå",brightness:"Lysstyrke",green:"Grønn",hue:"Fargetone",lightness:"Lyshet",red:"Rød",saturation:"Metning"};var In={};In={alpha:"Alfa",blue:"Blauw",brightness:"Helderheid",green:"Groen",hue:"Kleurtoon",lightness:"Lichtsterkte",red:"Rood",saturation:"Verzadiging"};var An={};An={alpha:"Alfa",blue:"Niebieski",brightness:"Jasność",green:"Zielony",hue:"Odcień",lightness:"Jaskrawość",red:"Czerwony",saturation:"Nasycenie"};var En={};En={alpha:"Alfa",blue:"Azul",brightness:"Brilho",green:"Verde",hue:"Matiz",lightness:"Luminosidade",red:"Vermelho",saturation:"Saturação"};var Pn={};Pn={alpha:"Alfa",blue:"Azul",brightness:"Luminosidade",green:"Verde",hue:"Tonalidade",lightness:"Claridade",red:"Vermelho",saturation:"Saturação"};var Tn={};Tn={alpha:"Alfa",blue:"Albastru",brightness:"Luminozitate",green:"Verde",hue:"Nuanță",lightness:"Luminozitate",red:"Roșu",saturation:"Saturație"};var $n={};$n={alpha:"Альфа",blue:"Синий",brightness:"Яркость",green:"Зеленый",hue:"Оттенок",lightness:"Освещенность",red:"Красный",saturation:"Насыщенность"};var Ln={};Ln={alpha:"Alfa",blue:"Modrá",brightness:"Jas",green:"Zelená",hue:"Odtieň",lightness:"Svetlosť",red:"Červená",saturation:"Sýtosť"};var Mn={};Mn={alpha:"Alfa",blue:"Modra",brightness:"Svetlost",green:"Zelena",hue:"Barva",lightness:"Lahkost",red:"Rdeča",saturation:"Nasičenost"};var Dn={};Dn={alpha:"Alfa",blue:"Plava",brightness:"Osvetljenost",green:"Zelena",hue:"Nijansa",lightness:"Osvetljenje",red:"Crvena",saturation:"Zasićenje"};var Rn={};Rn={alpha:"Alfa",blue:"Blått",brightness:"Ljusstyrka",green:"Grönt",hue:"Nyans",lightness:"Ljushet",red:"Rött",saturation:"Mättnad"};var Vn={};Vn={alpha:"Alfa",blue:"Mavi",brightness:"Parlaklık",green:"Yeşil",hue:"Ton",lightness:"Canlılık",red:"Kırmızı",saturation:"Doygunluk"};var On={};On={alpha:"Альфа",blue:"Синій",brightness:"Яскравість",green:"Зелений",hue:"Тон",lightness:"Освітленість",red:"Червоний",saturation:"Насиченість"};var qn={};qn={alpha:"Alpha",blue:"蓝色",brightness:"亮度",green:"绿色",hue:"色相",lightness:"明亮度",red:"红色",saturation:"饱和度"};var Hn={};Hn={alpha:"Alpha",blue:"藍色",brightness:"亮度",green:"綠色",hue:"色相",lightness:"明亮",red:"紅色",saturation:"飽和度"};cn={"ar-AE":dn,"bg-BG":un,"cs-CZ":mn,"da-DK":hn,"de-DE":xn,"el-GR":gn,"en-US":pn,"es-ES":jn,"et-EE":fn,"fi-FI":bn,"fr-FR":vn,"he-IL":yn,"hr-HR":wn,"hu-HU":Sn,"it-IT":kn,"ja-JP":Nn,"ko-KR":Cn,"lt-LT":_n,"lv-LV":Fn,"nb-NO":zn,"nl-NL":In,"pl-PL":An,"pt-BR":En,"pt-PT":Pn,"ro-RO":Tn,"ru-RU":$n,"sk-SK":Ln,"sl-SI":Mn,"sr-SP":Dn,"sv-SE":Rn,"tr-TR":Vn,"uk-UA":On,"zh-CN":qn,"zh-TW":Hn};const Co=new wo(No(cn));function hs(s){let t=We.parse(s)||Ke.parse(s)||Ge.parse(s);if(t)return t;throw new Error("Invalid color value: "+s)}class Wt{toHexInt(){return this.toFormat("rgb").toHexInt()}getChannelValue(t){if(t in this)return this[t];throw new Error("Unsupported color channel: "+t)}withChannelValue(t,a){if(t in this){let n=this.clone();return n[t]=a,n}throw new Error("Unsupported color channel: "+t)}getChannelName(t,a){return Co.getStringForLocale(t,a)}getColorSpaceAxes(t){let{xChannel:a,yChannel:n}=t,i=a||this.getColorChannels().find(c=>c!==n),l=n||this.getColorChannels().find(c=>c!==i),o=this.getColorChannels().find(c=>c!==i&&c!==l);return{xChannel:i,yChannel:l,zChannel:o}}}class We extends Wt{static parse(t){let a=[];if(/^#[\da-f]+$/i.test(t)&&[4,5,7,9].includes(t.length)){const l=(t.length<6?t.replace(/[^#]/gi,"$&$&"):t).slice(1).split("");for(;l.length>0;)a.push(parseInt(l.splice(0,2).join(""),16));a[3]=a[3]!==void 0?a[3]/255:void 0}const n=t.match(/^rgba?\((.*)\)$/);n!=null&&n[1]&&(a=n[1].split(",").map(l=>Number(l.trim())),a=a.map((l,o)=>ns(l,0,o<3?255:1)));var i;return a.length<3?void 0:new We(a[0],a[1],a[2],(i=a[3])!==null&&i!==void 0?i:1)}toString(t){switch(t){case"hex":return"#"+(this.red.toString(16).padStart(2,"0")+this.green.toString(16).padStart(2,"0")+this.blue.toString(16).padStart(2,"0")).toUpperCase();case"hexa":return"#"+(this.red.toString(16).padStart(2,"0")+this.green.toString(16).padStart(2,"0")+this.blue.toString(16).padStart(2,"0")+Math.round(this.alpha*255).toString(16).padStart(2,"0")).toUpperCase();case"rgb":return`rgb(${this.red}, ${this.green}, ${this.blue})`;case"css":case"rgba":return`rgba(${this.red}, ${this.green}, ${this.blue}, ${this.alpha})`;default:return this.toFormat(t).toString(t)}}toFormat(t){switch(t){case"hex":case"hexa":case"rgb":case"rgba":return this;case"hsb":case"hsba":return this.toHSB();case"hsl":case"hsla":return this.toHSL();default:throw new Error("Unsupported color conversion: rgb -> "+t)}}toHexInt(){return this.red<<16|this.green<<8|this.blue}toHSB(){const t=this.red/255,a=this.green/255,n=this.blue/255,i=Math.min(t,a,n),l=Math.max(t,a,n),o=l-i,c=l===0?0:o/l;let m=0;if(o!==0){switch(l){case t:m=(a-n)/o+(aNumber(m.trim().replace("%","")));return new Ke(Bn(i,360),ns(l,0,100),ns(o,0,100),ns(c??1,0,1))}}toString(t){switch(t){case"css":return this.toHSL().toString("css");case"hex":return this.toRGB().toString("hex");case"hexa":return this.toRGB().toString("hexa");case"hsb":return`hsb(${this.hue}, ${ae(this.saturation,2)}%, ${ae(this.brightness,2)}%)`;case"hsba":return`hsba(${this.hue}, ${ae(this.saturation,2)}%, ${ae(this.brightness,2)}%, ${this.alpha})`;default:return this.toFormat(t).toString(t)}}toFormat(t){switch(t){case"hsb":case"hsba":return this;case"hsl":case"hsla":return this.toHSL();case"rgb":case"rgba":return this.toRGB();default:throw new Error("Unsupported color conversion: hsb -> "+t)}}toHSL(){let t=this.saturation/100,a=this.brightness/100,n=a*(1-t/2);return t=n===0||n===1?0:(a-n)/Math.min(n,1-n),new Ge(ae(this.hue,2),ae(t*100,2),ae(n*100,2),this.alpha)}toRGB(){let t=this.hue,a=this.saturation/100,n=this.brightness/100,i=(l,o=(l+t/60)%6)=>n-a*n*Math.max(Math.min(o,4-o,1),0);return new We(Math.round(i(5)*255),Math.round(i(3)*255),Math.round(i(1)*255),this.alpha)}clone(){return new Ke(this.hue,this.saturation,this.brightness,this.alpha)}getChannelRange(t){switch(t){case"hue":return{minValue:0,maxValue:360,step:1,pageSize:15};case"saturation":case"brightness":return{minValue:0,maxValue:100,step:1,pageSize:10};case"alpha":return{minValue:0,maxValue:1,step:.01,pageSize:.1};default:throw new Error("Unknown color channel: "+t)}}formatChannelValue(t,a){let n,i=this.getChannelValue(t);switch(t){case"hue":n={style:"unit",unit:"degree",unitDisplay:"narrow"};break;case"saturation":case"brightness":n={style:"percent"},i/=100;break;case"alpha":n={style:"percent"};break;default:throw new Error("Unknown color channel: "+t)}return new Tt(a,n).format(i)}getColorSpace(){return"hsb"}getColorChannels(){return Ke.colorChannels}constructor(t,a,n,i){super(),this.hue=t,this.saturation=a,this.brightness=n,this.alpha=i}}Ke.colorChannels=["hue","saturation","brightness"];const Fo=/hsl\(([-+]?\d+(?:.\d+)?\s*,\s*[-+]?\d+(?:.\d+)?%\s*,\s*[-+]?\d+(?:.\d+)?%)\)|hsla\(([-+]?\d+(?:.\d+)?\s*,\s*[-+]?\d+(?:.\d+)?%\s*,\s*[-+]?\d+(?:.\d+)?%\s*,\s*[-+]?\d(.\d+)?)\)/;function Bn(s,t){return(s%t+t)%t}class Ge extends Wt{static parse(t){let a;if(a=t.match(Fo)){var n;const[i,l,o,c]=((n=a[1])!==null&&n!==void 0?n:a[2]).split(",").map(m=>Number(m.trim().replace("%","")));return new Ge(Bn(i,360),ns(l,0,100),ns(o,0,100),ns(c??1,0,1))}}toString(t){switch(t){case"hex":return this.toRGB().toString("hex");case"hexa":return this.toRGB().toString("hexa");case"hsl":return`hsl(${this.hue}, ${ae(this.saturation,2)}%, ${ae(this.lightness,2)}%)`;case"css":case"hsla":return`hsla(${this.hue}, ${ae(this.saturation,2)}%, ${ae(this.lightness,2)}%, ${this.alpha})`;default:return this.toFormat(t).toString(t)}}toFormat(t){switch(t){case"hsl":case"hsla":return this;case"hsb":case"hsba":return this.toHSB();case"rgb":case"rgba":return this.toRGB();default:throw new Error("Unsupported color conversion: hsl -> "+t)}}toHSB(){let t=this.saturation/100,a=this.lightness/100,n=a+t*Math.min(a,1-a);return t=n===0?0:2*(1-a/n),new Ke(ae(this.hue,2),ae(t*100,2),ae(n*100,2),this.alpha)}toRGB(){let t=this.hue,a=this.saturation/100,n=this.lightness/100,i=a*Math.min(n,1-n),l=(o,c=(o+t/30)%12)=>n-i*Math.max(Math.min(c-3,9-c,1),-1);return new We(Math.round(l(0)*255),Math.round(l(8)*255),Math.round(l(4)*255),this.alpha)}clone(){return new Ge(this.hue,this.saturation,this.lightness,this.alpha)}getChannelRange(t){switch(t){case"hue":return{minValue:0,maxValue:360,step:1,pageSize:15};case"saturation":case"lightness":return{minValue:0,maxValue:100,step:1,pageSize:10};case"alpha":return{minValue:0,maxValue:1,step:.01,pageSize:.1};default:throw new Error("Unknown color channel: "+t)}}formatChannelValue(t,a){let n,i=this.getChannelValue(t);switch(t){case"hue":n={style:"unit",unit:"degree",unitDisplay:"narrow"};break;case"saturation":case"lightness":n={style:"percent"},i/=100;break;case"alpha":n={style:"percent"};break;default:throw new Error("Unknown color channel: "+t)}return new Tt(a,n).format(i)}getColorSpace(){return"hsl"}getColorChannels(){return Ge.colorChannels}constructor(t,a,n,i){super(),this.hue=t,this.saturation=a,this.lightness=n,this.alpha=i}}Ge.colorChannels=["hue","saturation","lightness"];hs("#ffffff");hs("hsl(0, 100%, 50%)");const zo=hs("#000000"),Io=hs("#FFFFFF");zo.toHexInt();Io.toHexInt();function Ao({onChange:s,value:t,colors:a}){const n=a.map(i=>{const l=t===i;return e.jsx(tt,{onClick:()=>{s==null||s(i)},className:v("relative block flex-shrink-0 w-26 h-26 border rounded",l&&"shadow-md"),style:{backgroundColor:i},children:l&&e.jsx("span",{className:"absolute inset-0 m-auto rounded-full w-8 h-8 bg-white"})},i)});return e.jsx("div",{className:"flex flex-wrap gap-6",children:n})}const Eo=[{color:"rgb(255, 255, 255)",name:h("White")},{color:"rgb(239,245,245)",name:h("Solitude")},{color:"rgb(245,213,174)",name:h("Wheat")},{color:"rgb(253,227,167)",name:h("Cape Honey")},{color:"rgb(242,222,186)",name:h("Milk punch")},{color:"rgb(97,118,75)",name:h("Dingy"),foreground:"rgb(255, 255, 255)"},{color:"rgb(4, 147, 114)",name:h("Aquamarine"),foreground:"rgb(255, 255, 255)"},{color:"rgb(222,245,229)",name:h("Cosmic Latte")},{color:"rgb(233,119,119)",name:h("Geraldine"),foreground:"rgb(90,14,14)"},{color:"rgb(247,164,164)",name:h("Sundown")},{color:"rgb(30,139,195)",name:h("Pelorous"),foreground:"rgb(255, 255, 255)"},{color:"rgb(142,68,173)",name:h("Deep Lilac"),foreground:"rgb(255, 255, 255)"},{color:"rgb(108,74,182)",name:h("Blue marguerite"),foreground:"rgb(255, 255, 255)"},{color:"rgb(139,126,116)",name:h("Americano"),foreground:"rgb(255, 255, 255)"},{color:"rgb(0,0,0)",name:h("Black"),foreground:"rgb(255, 255, 255)"},{color:"rgb(64,66,88)",name:h("Blue zodiac"),foreground:"rgb(255, 255, 255)"},{color:"rgb(101,100,124)",name:h("Comet"),foreground:"rgb(255, 255, 255)"}],Po=Eo.map(({color:s})=>s).slice(0,14);function To({defaultValue:s,onChange:t,colorPresets:a,showInput:n}){const[i,l]=d.useState(s),o=a||Po,c=Pt({size:"sm"});return e.jsxs("div",{children:[e.jsx(fo,{className:"!w-auto",color:i,onChange:m=>{t==null||t(m),l(m)}}),e.jsxs("div",{className:"py-20 px-12",children:[o&&e.jsx(Ao,{colors:o,onChange:m=>{if(m){const u=hs(m).toString("hex");t==null||t(u),l(u)}},value:i}),n&&e.jsx("div",{className:"pt-20",children:e.jsx(yo,{autoComplete:"off",role:"textbox",autoCorrect:"off",spellCheck:"false",required:!0,"aria-label":"Hex color",prefixed:!0,className:c.input,color:i,onChange:m=>{t==null||t(m),l(m)}})})]})]})}function Kt({hideFooter:s=!1,showInput:t=!0}){const{close:a,value:n,setValue:i,initialValue:l}=Q();return e.jsxs(Z,{size:"2xs",children:[e.jsx(To,{showInput:t,defaultValue:l||"",onChange:o=>i(o)}),!s&&e.jsxs(xe,{dividerTop:!0,children:[e.jsx(f,{variant:"text",size:"xs",onClick:()=>a(),children:e.jsx(r,{message:"Cancel"})}),e.jsx(f,{variant:"flat",color:"primary",size:"xs",onClick:()=>a(n),children:e.jsx(r,{message:"Apply"})})]})]})}function $o(){return e.jsxs(d.Fragment,{children:[e.jsx(Lo,{}),e.jsxs("div",{className:"my-24 border-y py-24",children:[e.jsx(pe,{to:"action-buttons",elementType:B,className:"mb-20",children:e.jsx(r,{message:"Action buttons"})}),e.jsx(pe,{to:"primary-features",elementType:B,children:e.jsx(r,{message:"Primary features"})}),e.jsx(pe,{to:"secondary-features",elementType:B,children:e.jsx(r,{message:"Secondary features"})})]}),e.jsx(Mo,{})]})}function Lo(){const s=xs(t=>{var a,n;return(n=(a=t.defaults)==null?void 0:a.settings.homepage.appearance)==null?void 0:n.headerImage});return e.jsxs(e.Fragment,{children:[e.jsx(p,{label:e.jsx(r,{message:"Header title"}),className:"mb-20",name:"settings.homepage.appearance.headerTitle",onFocus:()=>{V().preview.setHighlight('[data-testid="headerTitle"]')}}),e.jsx(p,{label:e.jsx(r,{message:"Header subtitle"}),className:"mb-30",inputElementType:"textarea",rows:4,name:"settings.homepage.appearance.headerSubtitle",onFocus:()=>{V().preview.setHighlight('[data-testid="headerSubtitle"]')}}),e.jsx(os,{name:"settings.homepage.appearance.headerImage",className:"mb-30",label:e.jsx(r,{message:"Header image"}),defaultValue:s,diskPrefix:"homepage"}),e.jsx(so,{name:"settings.homepage.appearance.headerImageOpacity",label:e.jsx(r,{message:"Header image opacity"}),minValue:0,step:.1,maxValue:1,formatOptions:{style:"percent"}}),e.jsx("div",{className:"mb-20 text-xs text-muted",children:e.jsx(r,{message:"In order for overlay colors to appear, header image opacity will need to be less then 100%"})}),e.jsx(fa,{formKey:"settings.homepage.appearance.headerOverlayColor1",label:e.jsx(r,{message:"Header overlay color 1"})}),e.jsx(fa,{formKey:"settings.homepage.appearance.headerOverlayColor2",label:e.jsx(r,{message:"Header overlay color 2"})})]})}function Mo(){const s=xs(t=>{var a,n;return(n=(a=t.defaults)==null?void 0:a.settings.homepage.appearance)==null?void 0:n.footerImage});return e.jsxs(d.Fragment,{children:[e.jsx(p,{label:e.jsx(r,{message:"Footer title"}),className:"mb-20",name:"settings.homepage.appearance.footerTitle",onFocus:()=>{V().preview.setHighlight('[data-testid="footerTitle"]')}}),e.jsx(p,{label:e.jsx(r,{message:"Footer subtitle"}),className:"mb-20",name:"settings.homepage.appearance.footerSubtitle",onFocus:()=>{V().preview.setHighlight('[data-testid="footerSubtitle"]')}}),e.jsx(os,{name:"settings.homepage.appearance.footerImage",className:"mb-30",label:e.jsx(r,{message:"Footer background image"}),defaultValue:s,diskPrefix:"homepage"})]})}function fa({label:s,formKey:t}){const a=t,{watch:n,setValue:i}=F(),l=n(a),o=c=>{i(t,c,{shouldDirty:!0})};return e.jsxs(P,{type:"popover",value:l,alwaysReturnCurrentValueOnClose:!0,onValueChange:c=>o(c),onClose:c=>o(c),children:[e.jsx(pe,{className:"capitalize",startIcon:e.jsx(Bt,{viewBox:"0 0 48 48",className:"icon-lg",style:{fill:l}}),children:s}),e.jsx(Kt,{})]})}function Un(s){return s&&s.charAt(0).toUpperCase()+s.slice(1)}const Do=$.forwardRef(({valueListKey:s="permissions",...t},a)=>{const{data:n}=ze([s]),i=(n==null?void 0:n.permissions)||(n==null?void 0:n.workspacePermissions),[l,o]=Ts(t.value,[],t.onChange),[c,m]=d.useState(!1);if(!i)return null;const u=Wn(i,l,c),x=j=>{const b=[...l],y=b.findIndex(w=>w.id===j.id);y>-1&&b.splice(y,1,j),o(b)};return e.jsxs(d.Fragment,{children:[e.jsx(Xe,{variant:"outline",ref:a,children:u.map(({groupName:j,items:b,anyChecked:y})=>e.jsx(Ce,{label:e.jsx(r,{message:Qt(j)}),startIcon:y?e.jsx(Hr,{size:"sm"}):void 0,children:e.jsx(Ra,{children:b.map(w=>{const S=l.findIndex(z=>z.id===w.id),_=S>-1;return e.jsxs("div",{children:[e.jsx(Va,{onSelected:()=>{if(_){const z=[...l];z.splice(S,1),o(z)}else o([...l,w])},endSection:e.jsx(wt,{tabIndex:-1,checked:_,onChange:()=>{}}),description:e.jsx(r,{message:w.description}),children:e.jsx(r,{message:w.display_name||w.name})}),_&&e.jsx(Ro,{permission:w,onChange:x})]},w.id)})})},j))}),e.jsx(wt,{className:"mt-30",checked:c,onChange:j=>{m(j.target.checked)},children:e.jsx(r,{message:"Show advanced permissions"})})]})});function Ro({permission:s,onChange:t}){var n;if(!((n=s==null?void 0:s.restrictions)!=null&&n.length))return null;const a=(i,l)=>{const o=Br(s,c=>{const m=c.restrictions.find(u=>u.name===i);m&&(m.value=l)});t==null||t(o)};return e.jsx("div",{className:"px-40 py-20",children:s.restrictions.map((i,l)=>{const o=l===s.restrictions.length-1,c=e.jsx(r,{message:Qt(i.name)}),m=i.description?e.jsx(r,{message:i.description}):void 0;return i.type==="bool"?e.jsx(wt,{description:m,className:v(!o&&"mb-30"),checked:!!i.value,onChange:u=>{a(i.name,u.target.checked)},children:c},i.name):e.jsx(Ye,{size:"sm",label:c,description:m,type:"number",className:v(!o&&"mb-30"),value:i.value||"",onChange:u=>{a(i.name,u.target.value===""?void 0:parseInt(u.target.value))}},i.name)})})}function Gt(s){const{field:{onChange:t,value:a=[],ref:n}}=ys({name:s.name}),i={onChange:t,value:a};return e.jsx(Do,{ref:n,...ls(i,s)})}const Qt=s=>Un(s.replace("_"," "));function Wn(s,t,a){const n=[];return s.forEach(i=>{const l=t.findIndex(c=>c.id===i.id);if(!a&&i.advanced)return;let o=n.find(c=>c.groupName===i.group);if(o||(o={groupName:i.group,anyChecked:!1,items:[]},n.push(o)),l>-1){const c={...i,restrictions:Vo(i.restrictions,t[l].restrictions)};o.anyChecked=!0,o.items.push(c)}else o.items.push(i)}),n}function Vo(s,t){return s==null?void 0:s.map(a=>{const n=t.find(i=>i.name===a.name);return n?{...a,value:n.value}:a})}function Kn(){const s=Jt.sections.menus.config;return s?s.availableRoutes.map(t=>({id:t,label:t,action:t,type:"route",target:"_self"})):[]}const gt={grid:"flex flex-wrap gap-24",button:"flex flex-col items-center rounded hover:bg-hover h-90 aspect-square"},Oo=[...Array(60).keys()],qo=$.lazy(()=>$s(()=>import("./icon-list-bf038f20.js"),["./icon-list-bf038f20.js","./main-d4af3e3c.js","./main-57ebb2c7.css","./Info-61549577.js","./Edit-007bdb63.js","./ViewModule-5103cfe2.js","./OpenInNew-a258380a.js","./TaskAlt-c6a46604.js","./TrendingUp-a701ee5e.js","./use-resume-subscription-81a149c4.js"],import.meta.url));function Ho({onIconSelected:s}){const{trans:t}=M(),[a,n]=$.useState("");return e.jsxs("div",{className:"py-4",children:[e.jsx(Ye,{className:"mb-20",value:a,onChange:i=>{n(i.target.value)},placeholder:t({message:"Search icons..."})}),e.jsx(fs,{mode:"wait",children:e.jsx(d.Suspense,{fallback:e.jsx(Qe.div,{...bs,className:gt.grid,children:Oo.map((i,l)=>e.jsx("div",{className:gt.button,children:e.jsx(as,{variant:"rect"})},l))}),children:e.jsx(Qe.div,{...bs,className:gt.grid,children:e.jsx(qo,{searchQuery:a,onIconSelected:s})})})})]})}function Bo(){return e.jsxs(Z,{size:"w-850",className:"min-h-dialog",children:[e.jsx(ne,{children:e.jsx(r,{message:"Select icon"})}),e.jsx(ee,{children:e.jsx(Uo,{})})]})}function Uo(){const{close:s}=Q();return e.jsx(Ho,{onIconSelected:t=>{s(t)}})}function Wo(s){const t=d.useRef();return d.useEffect(()=>{t.current=s},[s]),t.current}function ps({formPathPrefix:s,hideRoleAndPermissionFields:t}){const{trans:a}=M(),n=i=>s?`${s}.${i}`:i;return e.jsxs(d.Fragment,{children:[e.jsx(p,{className:"mb-20",name:n("label"),label:e.jsx(r,{message:"Label"}),placeholder:a(h("No label...")),startAppend:e.jsx(Ko,{prefixName:n})}),e.jsx(Go,{prefixName:n}),!t&&e.jsxs(d.Fragment,{children:[e.jsx(Qo,{prefixName:n}),e.jsx(Jo,{prefixName:n})]}),e.jsx(Yo,{prefixName:n})]})}function Ko({prefixName:s,...t}){const{watch:a,setValue:n}=F(),i=s("icon"),l=a(i),o=l&&Oa(l);return e.jsxs(P,{type:"modal",onClose:c=>{(c||c===null)&&n(i,c,{shouldDirty:!0})},children:[e.jsx(k,{className:"text-muted icon-sm",variant:"outline",size:"md",...t,children:o?e.jsx(o,{}):e.jsx(He,{})}),e.jsx(Bo,{})]})}function Go({prefixName:s}){const t=F(),a=t.watch(s("type")),n=Wo(a),{data:i}=ze(["menuItemCategories"]),l=(i==null?void 0:i.menuItemCategories)||[],o=l.find(u=>u.type===a),{trans:c}=M(),m=Kn();return d.useEffect(()=>{n&&n!==a&&t.setValue(s("action"),"")},[a,n,t,s]),e.jsxs(d.Fragment,{children:[e.jsxs(U,{className:"mb-20",name:s("type"),selectionMode:"single",label:e.jsx(r,{message:"Type"}),children:[e.jsx(g,{value:"link",children:e.jsx(r,{message:"Custom link"})}),e.jsx(g,{value:"route",children:e.jsx(r,{message:"Site page"})}),l.map(u=>e.jsx(g,{value:u.type,children:u.name},u.type))]}),a==="link"&&e.jsx(p,{className:"mb-20",required:!0,type:"url",name:s("action"),placeholder:c({message:"Enter a url..."}),label:e.jsx(r,{message:"Url"})}),a==="route"&&e.jsx(U,{className:"mb-20",required:!0,items:m,name:s("action"),label:e.jsx(r,{message:"Page"}),searchPlaceholder:c(h("Search pages")),showSearchField:!0,selectionMode:"single",children:u=>e.jsx(g,{value:u.id,children:u.label},u.id)}),o&&e.jsx(U,{className:"mb-20",required:!0,items:o.items,name:s("action"),showSearchField:!0,searchPlaceholder:c(h("Search...")),selectionMode:"single",label:e.jsx(r,{message:o.name}),children:u=>e.jsx(g,{value:u.action,children:e.jsx(r,{message:u.label})})})]})}function Qo({prefixName:s}){const{data:t}=ze(["roles","permissions"]),a=(t==null?void 0:t.roles)||[],{trans:n}=M();return e.jsx(rt,{className:"mb-20",placeholder:n({message:"Add role..."}),label:e.jsx(r,{message:"Only show if user has role"}),name:s("roles"),chipSize:"sm",suggestions:a,valueKey:"id",displayWith:i=>{var l;return(l=a.find(o=>o.id===i.id))==null?void 0:l.name},children:i=>e.jsx(g,{value:i.id,capitalizeFirst:!0,children:e.jsx(r,{message:i.name})},i.id)})}function Jo({prefixName:s}){const{data:t}=ze(["roles","permissions"]),{trans:a}=M(),n=d.useMemo(()=>Wn((t==null?void 0:t.permissions)||[],[],!1),[t==null?void 0:t.permissions]);return e.jsx(rt,{label:e.jsx(r,{message:"Only show if user has permissions"}),placeholder:a({message:"Add permission..."}),chipSize:"sm",suggestions:n,name:s("permissions"),valueKey:"name",children:({groupName:i,items:l})=>e.jsx(qa,{label:Qt(i),children:l.map(o=>e.jsx(g,{value:o.name,description:e.jsx(r,{message:o.description}),children:e.jsx(r,{message:o.display_name||o.name})},o.name))},i)})}function Yo({prefixName:s}){return e.jsxs(U,{className:"mt-20",selectionMode:"single",name:s("target"),label:e.jsx(r,{message:"Open link in"}),children:[e.jsx(g,{value:"_self",children:e.jsx(r,{message:"Same window"})}),e.jsx(g,{value:"_blank",children:e.jsx(r,{message:"New window"})})]})}function Zo(){const[s,t]=d.useState(["cta1"]);return e.jsxs(Xe,{variant:"outline",expandedValues:s,onExpandedChange:a=>{t(a),a.length&&V().preview.setHighlight(`[data-testid="${a[0]}"]`)},children:[e.jsx(Ce,{value:"cta1",label:e.jsx(r,{message:"Header button 1"}),children:e.jsx(ps,{formPathPrefix:"settings.homepage.appearance.actions.cta1"})}),e.jsx(Ce,{value:"ct2",label:e.jsx(r,{message:"Header button 2"}),children:e.jsx(ps,{formPathPrefix:"settings.homepage.appearance.actions.cta2"})}),e.jsx(Ce,{value:"cta3",label:e.jsx(r,{message:"Footer button"}),children:e.jsx(ps,{formPathPrefix:"settings.homepage.appearance.actions.cta3"})})]})}function Xo(){const{fields:s,remove:t,append:a}=Ae({name:"settings.homepage.appearance.primaryFeatures"}),[n,i]=d.useState([0]);return e.jsxs("div",{children:[e.jsx(Xe,{variant:"outline",expandedValues:n,onExpandedChange:l=>{i(l),l.length&&V().preview.setHighlight(`[data-testid="primary-root-${l[0]}"]`)},children:s.map((l,o)=>e.jsxs(Ce,{value:o,label:e.jsx(r,{message:`Primary feature ${o+1}`}),children:[e.jsx(ec,{index:o}),e.jsx("div",{className:"text-right",children:e.jsx(f,{size:"xs",variant:"outline",color:"danger",onClick:()=>{t(o)},children:e.jsx(r,{message:"Remove"})})})]},l.id))}),e.jsx("div",{className:"mt-20 text-right",children:e.jsx(f,{size:"xs",variant:"outline",color:"primary",startIcon:e.jsx(_e,{}),onClick:()=>{a({}),i([s.length])},children:e.jsx(r,{message:"Add feature"})})})]})}function ec({index:s}){const t=xs(a=>{var n,i,l;return(l=(i=(n=a.defaults)==null?void 0:n.settings.homepage.appearance)==null?void 0:i.primaryFeatures[s])==null?void 0:l.image});return e.jsxs(e.Fragment,{children:[e.jsx(os,{name:`settings.homepage.appearance.primaryFeatures.${s}.image`,className:"mb-30",label:e.jsx(r,{message:"Image"}),defaultValue:t,diskPrefix:"homepage"}),e.jsx(p,{name:`settings.homepage.appearance.primaryFeatures.${s}.title`,label:e.jsx(r,{message:"Title"}),className:"mb-20",onFocus:()=>{V().preview.setHighlight(`[data-testid="primary-title-${s}"]`)}}),e.jsx(p,{name:`settings.homepage.appearance.primaryFeatures.${s}.subtitle`,label:e.jsx(r,{message:"Subtitle"}),className:"mb-20",inputElementType:"textarea",rows:4,onFocus:()=>{V().preview.setHighlight(`[data-testid="primary-subtitle-${s}"]`)}})]})}function sc(){const{fields:s,remove:t,append:a}=Ae({name:"settings.homepage.appearance.secondaryFeatures"}),[n,i]=d.useState([0]);return e.jsxs("div",{children:[e.jsx(Xe,{variant:"outline",expandedValues:n,onExpandedChange:l=>{i(l),l.length&&V().preview.setHighlight(`[data-testid="secondary-root-${l[0]}"]`)},children:s.map((l,o)=>e.jsxs(Ce,{value:o,label:e.jsx(r,{message:`Secondary feature ${o+1}`}),children:[e.jsx(tc,{index:o}),e.jsx("div",{className:"text-right",children:e.jsx(f,{size:"xs",variant:"outline",color:"danger",onClick:()=>{t(o)},children:e.jsx(r,{message:"Remove"})})})]},l.id))}),e.jsx("div",{className:"mt-20 text-right",children:e.jsx(f,{size:"xs",variant:"outline",color:"primary",startIcon:e.jsx(_e,{}),onClick:()=>{a({}),i([s.length])},children:e.jsx(r,{message:"Add feature"})})})]})}function tc({index:s}){return e.jsxs(e.Fragment,{children:[e.jsx(os,{name:`settings.homepage.appearance.secondaryFeatures.${s}.image`,className:"mb-30",label:e.jsx(r,{message:"Image"}),defaultValue:ac(s),diskPrefix:"homepage"}),e.jsx(p,{name:`settings.homepage.appearance.secondaryFeatures.${s}.title`,label:e.jsx(r,{message:"Title"}),className:"mb-20",onFocus:()=>{V().preview.setHighlight(`[data-testid="secondary-title-${s}"]`)}}),e.jsx(p,{name:`settings.homepage.appearance.secondaryFeatures.${s}.subtitle`,label:e.jsx(r,{message:"Subtitle"}),className:"mb-20",inputElementType:"textarea",rows:4,onFocus:()=>{V().preview.setHighlight(`[data-testid="secondary-subtitle-${s}"]`)}}),e.jsx(p,{name:`settings.homepage.appearance.secondaryFeatures.${s}.description`,label:e.jsx(r,{message:"Description"}),className:"mb-20",inputElementType:"textarea",rows:4,onFocus:()=>{V().preview.setHighlight(`[data-testid="secondary-description-${s}"]`)}})]})}function ac(s){var t,a;return(a=((t=V().defaults)==null?void 0:t.settings.homepage.appearance).secondaryFeatures[s])==null?void 0:a.image}const Gn={preview:{defaultRoute:"drive",navigationRoutes:["s","drive"]},sections:{"landing-page":{label:h("Landing Page"),position:1,previewRoute:"/",routes:[{path:"landing-page",element:e.jsx($o,{})},{path:"landing-page/action-buttons",element:e.jsx(Zo,{})},{path:"landing-page/primary-features",element:e.jsx(Xo,{})},{path:"landing-page/secondary-features",element:e.jsx(sc,{})}],buildBreadcrumb:(s,t)=>{const n=s.split("/").filter(l=>!!l).pop(),i=[{label:h("Landing page"),location:"landing-page"}];return n==="action-buttons"&&i.push({label:h("Action buttons"),location:"landing-page/action-buttons"}),n==="primary-features"&&i.push({label:h("Primary features"),location:"landing-page/primary-features"}),n==="secondary-features"&&i.push({label:h("Secondary features"),location:"landing-page/secondary-features"}),i}},menus:{config:{positions:["drive-navbar","drive-sidebar","homepage-navbar","shareable-link-page","footer","footer-secondary"],availableRoutes:["/drive","/drive/shares","/drive/recent","/drive/starred","/drive/trash"]}},"seo-settings":{config:{pages:[{key:"landing-page",label:h("Landing page")},{key:"shareable-link-page",label:h("Shareable link page")}]}}}},Jt=Ur.all([Wl,Gn]),xs=Wr()(Ul(Kr((s,t)=>({defaults:null,iframeWindow:null,config:Jt,setDefaults:a=>{s(n=>{n.defaults={...a}})},setIframeWindow:a=>{s(()=>({iframeWindow:a}))},preview:{navigate:a=>{var o;const n=(o=t().config)==null?void 0:o.sections[a],i=(n==null?void 0:n.previewRoute)||"/",l=t().iframeWindow;i&&gs(l,{type:"navigate",to:i})},setValues:a=>{const n=t().iframeWindow;gs(n,{type:"setValues",values:a})},setThemeFont:a=>{const n=t().iframeWindow;gs(n,{type:"setThemeFont",value:a})},setThemeValue:(a,n)=>{const i=t().iframeWindow;gs(i,{type:"setThemeValue",name:a,value:n})},setActiveTheme:a=>{const n=t().iframeWindow;gs(n,{type:"setActiveTheme",themeId:a})},setCustomCode:(a,n)=>{const i=t().iframeWindow;gs(i,{type:"setCustomCode",mode:a,value:n})},setHighlight:a=>{s(()=>{var l;let n=null;const i=(l=t().iframeWindow)==null?void 0:l.document;i&&a&&(n=i.querySelector(a)),n&&requestAnimationFrame(()=>{n&&n.scrollIntoView({behavior:"smooth",block:"center",inline:"center"})})})}}}))));function gs(s,t){s&&s.postMessage({source:"be-appearance-editor",...t},"*")}function V(){return xs.getState()}function nc(){return R({mutationFn:s=>rc(s),onSuccess:async()=>{await D.invalidateQueries({queryKey:["admin/appearance/values"]}),O(h("Changes saved"))},onError:s=>se(s)})}function rc(s){return I.post("admin/appearance",{changes:s}).then(t=>t.data)}function ic(){return $e({queryKey:["admin/appearance/values"],queryFn:()=>lc(),staleTime:1/0})}function lc(){return I.get("admin/appearance/values").then(s=>s.data)}function oc(){const{pathname:s}=at(),{getValues:t}=F(),[a,n]=d.useState(null);return d.useEffect(()=>{var l;const[,,i]=s.split("/").filter(o=>!!o);if(i){const o=(l=V().config)==null?void 0:l.sections[i];if(o){n([{label:h("Appearance"),location:""},...o.buildBreadcrumb(s,t())]);return}}n(null)},[s,t]),!a||a.length<2?null:e.jsxs("div",{className:"flex items-center border-b h-60 flex-shrink-0",children:[e.jsx(k,{iconSize:"md",radius:"rounded-none",className:"text-muted h-full w-50 flex-shrink-0",elementType:B,to:`/admin/appearance/${a[a.length-2].location}`,children:e.jsx(Ys,{})}),e.jsxs("div",{className:"border-l p-10 min-w-0",children:[e.jsx("div",{className:"text-xs text-muted",children:e.jsx(r,{message:"Customizing"})}),e.jsx("div",{className:"flex items-center gap-4 text-sm mt-2",children:a.map((i,l)=>{const o=a.length-1===l,c=l===0,m=e.jsx(Gr,{value:i.label});return c?null:e.jsxs(d.Fragment,{children:[e.jsx("div",{className:v("whitespace-nowrap overflow-hidden overflow-ellipsis min-w-0",o&&"text-primary",o?"flex-shrink-0":"flex-auto"),children:m}),!o&&e.jsx(Ds,{className:"icon-sm text-muted flex-shrink-0"})]},l)})})]})]})}function cc(){const{isAppearanceEditorActive:s}=Qr(),{data:t}=ic(),{base_url:a}=we(),n=d.useRef(null),{pathname:i}=at();return d.useEffect(()=>{t!=null&&t.defaults&&!V().defaults&&V().setDefaults(t.defaults)},[t]),d.useEffect(()=>{n.current&&V().setIframeWindow(n.current.contentWindow)},[]),d.useEffect(()=>{const l=i.split("/")[3];V().preview.navigate(l)},[i]),s?e.jsx(Ha,{to:"/admin"}):e.jsxs("div",{className:"h-screen items-center md:flex",children:[e.jsx(Xs,{children:e.jsx(r,{message:"Appearance"})}),e.jsx(dc,{values:t==null?void 0:t.values}),e.jsx("div",{className:"relative h-full flex-auto",children:e.jsx("iframe",{ref:n,className:"h-full w-full max-md:hidden",src:`${a}?appearanceEditor=true`})})]})}function dc({values:s}){const t=e.jsx("div",{className:"flex h-full flex-auto items-center justify-center",children:e.jsx(Ms,{isIndeterminate:!0,"aria-label":"Loading editor"})});return e.jsx("div",{className:"relative z-10 h-full w-full border-r bg shadow-lg @container md:w-320",children:s?e.jsx(uc,{defaultValues:s}):t})}function uc({defaultValues:s}){const t=K({defaultValues:s}),{watch:a,reset:n}=t,i=nc();return d.useEffect(()=>{const l=a(o=>{V().preview.setValues(o)});return()=>l.unsubscribe()},[a]),e.jsxs(de,{className:"flex h-full flex-col",form:t,onSubmit:l=>{i.mutate(l,{onSuccess:()=>n(l)})},children:[e.jsx(mc,{isLoading:i.isPending}),e.jsx(oc,{}),e.jsx("div",{className:"flex-auto overflow-y-auto px-14 py-20",children:e.jsx(Ls,{children:e.jsx(Js,{})})})]})}function mc({isLoading:s}){const{formState:{dirtyFields:t}}=F(),a=Object.keys(t).length;return e.jsxs("div",{className:"flex h-50 flex-shrink-0 items-center border-b pr-10",children:[e.jsx(k,{border:"border-r",className:"text-muted",elementType:B,to:"..",children:e.jsx(qe,{})}),e.jsx("div",{className:"pl-10",children:e.jsx(r,{message:"Appearance editor"})}),e.jsx(f,{variant:"flat",color:"primary",className:"ml-auto block",disabled:!a||s,type:"submit",children:a?e.jsx(r,{message:"Save"}):e.jsx(r,{message:"Saved"})})]})}function hc(){const s=cs(),{trans:t}=M(),{fields:a,append:n}=Ae({name:"settings.menus",keyName:"key"});return e.jsxs(d.Fragment,{children:[e.jsx("div",{children:a.map((i,l)=>e.jsx(pe,{to:`${l}`,elementType:B,children:i.name},i.key))}),e.jsx("div",{className:"text-right",children:e.jsx(f,{variant:"outline",color:"primary",startIcon:e.jsx(_e,{}),size:"xs",onClick:()=>{const i=$t(10);n({name:t(h("New menu :number",{values:{number:a.length+1}})),id:i,positions:[],items:[]}),s(`${a.length}`)},children:e.jsx(r,{message:"Create menu"})})})]})}function Qn({title:s=e.jsx(r,{message:"Add menu item"})}){const{data:t}=ze(["menuItemCategories"]),a=(t==null?void 0:t.menuItemCategories)||[],n=Kn();return e.jsxs(Z,{size:"sm",children:[e.jsx(ne,{children:s}),e.jsx(ee,{children:e.jsxs(Xe,{variant:"outline",children:[e.jsx(Ce,{label:e.jsx(r,{message:"Link"}),bodyClassName:"max-h-240 overflow-y-auto",children:e.jsx(xc,{})}),e.jsx(Ce,{label:e.jsx(r,{message:"Route"}),bodyClassName:"max-h-240 overflow-y-auto",children:e.jsx(ba,{items:n})}),a.map(i=>e.jsx(Ce,{label:e.jsx(r,{message:i.name}),children:e.jsx(ba,{items:i.items})},i.name))]})})]})}function xc(){const s=K({defaultValues:{id:$t(6),type:"link",target:"_blank"}}),{close:t}=Q();return e.jsxs(de,{form:s,onSubmit:a=>{t(a)},children:[e.jsx(p,{required:!0,name:"label",label:e.jsx(r,{message:"Label"}),className:"mb-20"}),e.jsx(p,{required:!0,type:"url",name:"action",placeholder:"https://",label:e.jsx(r,{message:"Url"}),className:"mb-20"}),e.jsx("div",{className:"text-right",children:e.jsx(f,{type:"submit",variant:"flat",color:"primary",size:"xs",children:e.jsx(r,{message:"Add to menu"})})})]})}function ba({items:s}){const{close:t}=Q();return e.jsx(Ra,{children:s.map(a=>e.jsx(Va,{startIcon:e.jsx(_e,{size:"sm"}),onSelected:()=>{if(a.label){const n=a.label.split("/").pop();a.label=n?Un(n):a.label,a.id=$t(6)}t(a)},children:a.label},a.id))})}const gc=E(e.jsx("path",{d:"M11 18c0 1.1-.9 2-2 2s-2-.9-2-2 .9-2 2-2 2 .9 2 2zm-2-8c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2zm0-6c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2zm6 4c1.1 0 2-.9 2-2s-.9-2-2-2-2 .9-2 2 .9 2 2 2zm0 2c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2zm0 6c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2z"}),"DragIndicatorOutlined"),pc=""+new URL("dropdown-menu-c9b3bd6a.svg",import.meta.url).href,jc={onDragStart:()=>{},onDragEnter:()=>{},onDragOver:({e:s,ref:t,item:a,sortSession:n,onDropPositionChange:i})=>{var m;const l=n.dropPosition;let o=null;const c=(m=Ue.get(a))==null?void 0:m.rect;if(c){const u=c.top+c.height/2;s.clientY<=u?o="before":s.clientY>=u&&(o="after")}if(o!==l){const u=n.sortables.indexOf(a);if(n.dropPosition=o,i==null||i(n.dropPosition),va(n),t.current)if(n.dropPosition==="after")pt(t.current,"bottom",n);else if(u===0)pt(t.current,"top",n);else{const b=n.sortables[u-1],y=Ue.get(b);y!=null&&y.ref.current&&pt(y.ref.current,"bottom",n)}const x=n.sortables.indexOf(a);if(n.activeIndex===x){n.finalIndex=n.activeIndex;return}(u>n.activeIndex?"after":"before")==="after"?n.finalIndex=n.dropPosition==="before"?x-1:x:n.finalIndex=n.dropPosition==="after"?x+1:x}},onDragEnd:s=>{va(s)}};function va(s){s!=null&&s.linePreviewEl&&(s.linePreviewEl.style.borderBottomColor="",s.linePreviewEl.style.borderTopColor="",s.linePreviewEl=void 0)}function pt(s,t,a){const n="rgb(var(--be-primary))";t==="top"?s.style.borderTopColor=n:s.style.borderBottomColor=n,a&&(a.linePreviewEl=s)}function Jn(s,t,a){const n=Gs(t,0,s.length-1),i=Gs(a,0,s.length-1);if(n===i)return s;const l=s[n],o=i{s.sortables.forEach((t,a)=>{const n=Ue.get(t);n!=null&&n.ref.current&&(n.ref.current.style.transition=bc,(s==null?void 0:s.activeIndex)===a&&(n.ref.current.style.opacity="0.4"))})},onDragEnter:(s,t,a)=>{Jn(s.sortables,a,t);const n=s.sortables.map(i=>{var l;return(l=Ue.get(i))==null?void 0:l.rect});s.sortables.forEach((i,l)=>{if(!s)return;const o=fc(n,t,s.activeIndex),c=n[l],m=o[l],u=Ue.get(i);if(u!=null&&u.ref.current&&m&&c){const x=m.left-c.left,j=m.top-c.top;u.ref.current.style.transform=`translate3d(${x}px, ${j}px, 0)`}}),s.finalIndex=t},onDragOver:()=>{},onDragEnd:s=>{s.sortables.forEach(t=>{const a=Ue.get(t);a!=null&&a.ref.current&&(a.ref.current.style.transform="",a.ref.current.style.transition="",a.ref.current.style.opacity="",a.ref.current.style.zIndex="")})}},yc={onDragStart:()=>{},onDragOver:()=>{},onDragEnter:(s,t,a)=>{var i;const n=(i=Ue.get(s.sortables[a]))==null?void 0:i.ref.current;n&&(wc(n,a,t),Jn(s.sortables,a,t),s.finalIndex=t)},onDragEnd:()=>{}};function wc(s,t,a){const n=s.parentElement;if(a<0)n.prepend(s);else{t>-1&&t<=a&&a++;const i=n.children.item(a);i?i.before(s):n.append(s)}}let q=null;const Ws={line:jc,liveSort:vc,moveNode:yc};function Sc({item:s,items:t,type:a,ref:n,onSortEnd:i,onSortStart:l,onDragEnd:o,preview:c,disabled:m,onDropPositionChange:u,strategy:x="liveSort"}){d.useEffect(()=>{q&&q.sortables.length!==t.length&&(q.sortables=[...t],q.activeIndex=t.indexOf(s))},[t,s]);const{draggableProps:j,dragHandleRef:b}=Oi({id:s,ref:n,type:a,preview:c,disabled:m,onDragStart:()=>{var w;q={sortables:[...t],activeSortable:s,activeIndex:t.indexOf(s),finalIndex:t.indexOf(s),dropPosition:null,ref:n,scrollParent:n.current?Jr(n.current):void 0,scrollListener:()=>{Hi(Ue)}},Ws[x].onDragStart(q),l==null||l(),(w=q.scrollParent)==null||w.addEventListener("scroll",q.scrollListener)},onDragEnd:()=>{var w;q&&(q.dropPosition=null,u==null||u(q.dropPosition),q.activeIndex!==q.finalIndex&&(i==null||i(q.activeIndex,q.finalIndex)),(w=q.scrollParent)==null||w.removeEventListener("scroll",q.scrollListener),Ws[x].onDragEnd(q),o==null||o(),q=null)},getData:()=>{}}),{droppableProps:y}=qi({id:s,ref:n,types:[a],disabled:m,allowDragEventsFromItself:!0,onDragOver:(w,S)=>{q&&Ws[x].onDragOver({e:S,ref:n,item:s,sortSession:q,onDropPositionChange:u})},onDragEnter:()=>{if(!q)return;const w=q.sortables.indexOf(s),S=q.sortables.indexOf(q.activeSortable);Ws[x].onDragEnter(q,w,S)},onDragLeave:()=>{q&&(q.dropPosition=null,u==null||u(q.dropPosition))}});return{sortableProps:{...ls(j,y)},dragHandleRef:b}}function kc(){const{menuIndex:s}=ue(),t=cs(),{getValues:a}=F(),n=`settings.menus.${s}`,i=a(n);return d.useEffect(()=>{i?V().preview.setHighlight(`[data-menu-id="${i.id}"]`):t("/admin/appearance/menus")},[t,i]),i?e.jsx(Nc,{formPath:n}):null}function Nc({formPath:s}){const{site:{has_mobile_app:t}}=we(),a=xs(l=>{var o;return(o=l.config)==null?void 0:o.sections.menus.config}),n=d.useMemo(()=>{const l=[...a==null?void 0:a.positions];return t&&l.push("mobile-app-about"),l.map(o=>({key:o,name:o.replaceAll("-"," ")}))},[a,t]),i=Ae({name:`${s}.items`,keyName:"key"});return e.jsxs(d.Fragment,{children:[e.jsxs("div",{className:"mb-30 border-b pb-30",children:[e.jsx(p,{name:`${s}.name`,label:e.jsx(r,{message:"Menu name"}),className:"mb-20",autoFocus:!0}),e.jsx(rt,{chipSize:"sm",name:`${s}.positions`,valueKey:"id",label:e.jsx(r,{message:"Menu positions"}),description:e.jsx(r,{message:"Where should this menu appear on the site"}),children:n.map(l=>e.jsx(g,{value:l.key,capitalizeFirst:!0,children:l.name},l.key))})]}),e.jsx(Cc,{fieldArray:i}),e.jsx("div",{className:"text-right",children:e.jsx(_c,{})})]})}function Cc({fieldArray:{append:s,fields:t,move:a}}){const n=cs();return e.jsxs(d.Fragment,{children:[e.jsxs("div",{className:"flex flex-shrink-0 items-center justify-between gap-16",children:[e.jsx(r,{message:"Menu items"}),e.jsxs(P,{type:"popover",placement:"right",offset:20,onClose:i=>{i&&(s({...i}),n(`items/${t.length}`))},children:[e.jsx(f,{variant:"outline",color:"primary",size:"xs",startIcon:e.jsx(_e,{}),children:e.jsx(r,{message:"Add"})}),e.jsx(Qn,{})]})]}),e.jsxs("div",{className:"mt-20 flex-shrink-0",children:[t.map((i,l)=>e.jsx(Fc,{item:i,items:t,index:l,onSortEnd:(o,c)=>{a(o,c)}},i.key)),t.length?null:e.jsx(et,{size:"xs",className:"my-40",image:e.jsx(st,{src:pc}),title:e.jsx(r,{message:"No menu items yet"}),description:e.jsx(r,{message:"Click “add“ button to start adding links, pages, routes and other items to this menu. "})})]})]})}function _c(){const s=cs(),{menuIndex:t}=ue(),{fields:a,remove:n}=Ae({name:"settings.menus",keyName:"key"});if(!t)return null;const i=a[+t];return e.jsxs(P,{type:"modal",onClose:l=>{if(l){const o=a.findIndex(c=>c.id===i.id);n(o),s("/admin/appearance/menus")}},children:[e.jsx(f,{variant:"outline",color:"danger",size:"xs",startIcon:e.jsx(it,{}),children:e.jsx(r,{message:"Delete menu"})}),e.jsx(Fe,{isDanger:!0,title:e.jsx(r,{message:"Delete menu"}),body:e.jsx(r,{message:"Are you sure you want to delete “:name“?",values:{name:i.name}}),confirm:e.jsx(r,{message:"Delete"})})]})}function Fc({item:s,items:t,index:a,onSortEnd:n}){const i=d.useRef(null),{sortableProps:l,dragHandleRef:o}=Sc({item:s,items:t,type:"menuEditorSortable",ref:i,onSortEnd:n,strategy:"liveSort"}),c=s.icon&&Oa(s.icon),m=e.jsxs("div",{className:"flex items-center gap-4 text-xs text-muted",children:[c&&e.jsx(c,{size:"sm"}),"(",e.jsx(r,{message:"No label..."}),")"]});return e.jsx(d.Fragment,{children:e.jsx(pe,{elementType:B,to:`items/${a}`,ref:i,...l,children:e.jsxs("div",{className:"flex items-center gap-10",children:[e.jsx(k,{ref:o,size:"sm",children:e.jsx(gc,{className:"text-muted hover:cursor-move"})}),e.jsx("div",{children:s.label||m})]})})})}function zc(){const{menuIndex:s,menuItemIndex:t}=ue(),a=je(),{getValues:n}=F(),i=`settings.menus.${s}.items.${t}`,l=n(i);return d.useEffect(()=>{l&&V().preview.setHighlight(`[data-menu-item-id="${l.id}"]`)},[a,l]),!l||t==null?null:e.jsx(Ic,{formPath:i})}function Ic({formPath:s}){return e.jsxs(d.Fragment,{children:[e.jsx(ps,{formPathPrefix:s}),e.jsx("div",{className:"text-right mt-40",children:e.jsx(Ac,{})})]})}function Ac(){const s=je(),{menuIndex:t,menuItemIndex:a}=ue(),{fields:n,remove:i}=Ae({name:`settings.menus.${+t}.items`});if(!a)return null;const l=n[+a];return e.jsxs(P,{type:"modal",onClose:o=>{o&&a&&(i(+a),s(`/admin/appearance/menus/${t}`))},children:[e.jsx(f,{variant:"outline",color:"danger",size:"xs",startIcon:e.jsx(it,{}),children:e.jsx(r,{message:"Delete this item"})}),e.jsx(Fe,{isDanger:!0,title:e.jsx(r,{message:"Delete menu item"}),body:e.jsx(r,{message:"Are you sure you want to delete “:name“?",values:{name:l.label}}),confirm:e.jsx(r,{message:"Delete"})})]})}function Ec(){return e.jsxs(d.Fragment,{children:[e.jsx(Fs,{label:e.jsx(r,{message:"Favicon"}),description:e.jsx(r,{message:"This will generate different size favicons. Image should be at least 512x512 in size."}),type:"favicon"}),e.jsx(Fs,{label:e.jsx(r,{message:"Light logo"}),description:e.jsx(r,{message:"Will be used on dark backgrounds."}),type:"logo_light"}),e.jsx(Fs,{label:e.jsx(r,{message:"Dark logo"}),description:e.jsx(r,{message:"Will be used on light backgrounds. Will default to light logo if left empty."}),type:"logo_dark"}),e.jsx(Fs,{label:e.jsx(r,{message:"Mobile light logo"}),description:e.jsx(r,{message:"Will be used on light backgrounds on mobile. Will default to desktop logo if left empty."}),type:"logo_light_mobile"}),e.jsx(Fs,{label:e.jsx(r,{message:"Mobile dark logo"}),description:e.jsx(r,{message:"Will be used on dark backgrounds on mobile. Will default to desktop if left empty."}),type:"logo_dark_mobile"}),e.jsx(Pc,{}),e.jsx(Tc,{})]})}function Fs({label:s,description:t,type:a}){const n=xs(i=>{var l;return(l=i.defaults)==null?void 0:l.settings.branding[a]});return e.jsx(os,{name:`settings.branding.${a}`,className:"border-b pb-30 mb-30",label:s,description:t,diskPrefix:"branding_media",defaultValue:n,onChange:()=>{V().preview.setHighlight('[data-logo="navbar"]')}})}function Pc(){return e.jsx(p,{name:"appearance.env.app_name",required:!0,className:"mt-20",label:e.jsx(r,{message:"Site name"})})}function Tc(){return e.jsx(p,{name:"settings.branding.site_description",className:"mt-20",inputElementType:"textarea",rows:4,label:e.jsx(r,{message:"Site description"})})}function $c(s=1,t=1e4){const a=new Uint32Array(1);window.crypto.getRandomValues(a);const n=a[0]/(4294967295+1);return s=Math.ceil(s),t=Math.floor(t),Math.floor(n*(t-s+1))+s}function Lc(){const{trans:s}=M(),t=cs(),{data:{themes:a}}=Ba(),{fields:n,append:i}=Ae({name:"appearance.themes.all",keyName:"key"});return d.useEffect(()=>{a.selectedThemeId&&V().preview.setActiveTheme(a.selectedThemeId)},[a.selectedThemeId]),e.jsxs(d.Fragment,{children:[e.jsx("div",{className:"mb-20",children:e.jsx(f,{size:"xs",variant:"outline",color:"primary",startIcon:e.jsx(_e,{}),onClick:()=>{var o;const l=(o=V().defaults)==null?void 0:o.appearance.themes.light;i({id:$c(),name:s(h("New theme")),values:l}),t(`${n.length+1}`)},children:e.jsx(r,{message:"New theme"})})}),n.map((l,o)=>e.jsx(pe,{to:`${o}`,elementType:Lt,children:l.name},l.key))]})}const Mc=$.lazy(()=>$s(()=>import("./ace-editor-8df6a268.js"),["./ace-editor-8df6a268.js","./main-d4af3e3c.js","./main-57ebb2c7.css","./index-899074d6.js"],import.meta.url));function Yt({defaultValue:s,mode:t="html",title:a,onSave:n,isSaving:i,footerStartAction:l,beautify:o,editorRef:c}){const[m,u]=d.useState(s),[x,j]=d.useState(!0);return e.jsxs(Z,{size:"fullscreen",className:"h-full w-full",children:[e.jsx(ne,{children:a}),e.jsx(ee,{className:"relative flex-auto",padding:"p-0",children:e.jsx(d.Suspense,{fallback:e.jsx("div",{className:"flex h-400 w-full items-center justify-center",children:e.jsx(Ms,{"aria-label":"Loading editor...",isIndeterminate:!0,size:"md"})}),children:e.jsx(Mc,{beautify:o,mode:t,onChange:b=>u(b),defaultValue:m||"",onIsValidChange:j,editorRef:c})})}),e.jsx(Dc,{disabled:!x||i,value:m,onSave:n,startAction:l})]})}function Dc({disabled:s,value:t,onSave:a,startAction:n}){const{close:i}=Q();return e.jsxs(xe,{dividerTop:!0,startAction:n,children:[e.jsx(f,{onClick:()=>i(),children:e.jsx(r,{message:"Cancel"})}),e.jsx(f,{disabled:s,variant:"flat",color:"primary",onClick:()=>{a?a(t):i(t)},children:e.jsx(r,{message:"Save"})})]})}function Yn(s){return $e({queryKey:["admin","seo-tags",s],queryFn:()=>Rc(s)})}function Rc(s){return I.get(`admin/appearance/seo-tags/${s}`).then(t=>t.data)}function Vc(s){const t=Ua();return R({mutationFn:a=>Oc(s,a.tags),onSuccess:async()=>{await t.invalidateQueries({queryKey:["admin","seo-tags",s]}),O(h("Updated SEO tags"))},onError:a=>se(a)})}function Oc(s,t){return I.put(`admin/appearance/seo-tags/${s}`,{tags:t}).then(a=>a.data)}var Aa;const Zn=((Aa=Jt.sections["seo-settings"].config)==null?void 0:Aa.pages)||[],Xn=Zn.map(s=>s.key);function qc(){const{isLoading:s}=Yn(Xn);return s?e.jsx(Ze,{}):e.jsx(d.Fragment,{children:Zn.map(t=>e.jsx(Hc,{label:t.label,name:t.key},t.key))})}function Hc({label:s,name:t}){const{data:a,isLoading:n}=Yn(Xn);return e.jsxs(P,{type:"modal",children:[e.jsx(pe,{disabled:n,children:e.jsx(r,{...s})}),a?e.jsx(Bc,{name:t,value:a[t]}):null]})}function Bc({name:s,value:t}){const{close:a}=Q(),n=Vc(s),i=d.useRef(null),l=e.jsx(f,{variant:"outline",color:"primary",onClick:()=>{i.current&&i.current.editor.setValue(t.original)},children:e.jsx(r,{message:"Reset to original"})});return e.jsx(Yt,{mode:"php_laravel_blade",title:e.jsx(r,{message:"Edit SEO meta tags"}),footerStartAction:l,editorRef:i,defaultValue:t.custom||t.original,isSaving:n.isPending,beautify:!1,onSave:o=>{o!=null&&n.mutate({tags:o},{onSuccess:()=>a()})}})}function Uc(){return e.jsxs(d.Fragment,{children:[e.jsx(ya,{mode:"css"}),e.jsx(ya,{mode:"html"})]})}function ya({mode:s}){const{getValues:t}=F(),{setValue:a}=F(),n=s==="html"?e.jsx(r,{message:"Custom HTML & JavaScript"}):e.jsx(r,{message:"Custom CSS"});return e.jsxs(P,{type:"modal",onClose:i=>{i!=null&&(a(`appearance.custom_code.${s}`,i,{shouldDirty:!0}),V().preview.setCustomCode(s,i))},children:[e.jsx(pe,{children:n}),e.jsx(Yt,{title:n,defaultValue:t(`appearance.custom_code.${s}`)||"",mode:s})]})}const Wc=""+new URL("articles-8bfd9f17.svg",import.meta.url).href,Kc=s=>{const t=s.customPages.types.length>1?[{control:{type:oe.Select,defaultValue:"default",options:s.customPages.types.map(a=>({value:a.type,label:a.label,key:a.type}))},key:"type",label:h("Type"),description:h("Type of the page"),defaultOperator:ie.eq}]:[];return[{key:"user_id",label:h("User"),description:h("User page was created by"),defaultOperator:ie.eq,control:{type:oe.SelectModel,model:Bi}},...t,us({description:h("Date page was created")}),ks({description:h("Date page was last updated")})]},Gc=[{key:"slug",allowsSorting:!0,width:"flex-2 min-w-200",visibleInMode:"all",header:()=>e.jsx(r,{message:"Slug"}),body:s=>e.jsx(B,{target:"_blank",to:`/pages/${s.slug}`,className:Mt,children:s.slug})},{key:"user_id",allowsSorting:!0,width:"flex-2 min-w-140",header:()=>e.jsx(r,{message:"Owner"}),body:s=>s.user&&e.jsx(es,{image:s.user.avatar,label:s.user.display_name,description:s.user.email})},{key:"type",maxWidth:"max-w-100",header:()=>e.jsx(r,{message:"Type"}),body:s=>e.jsx(r,{message:s.type})},{key:"updated_at",allowsSorting:!0,width:"w-100",header:()=>e.jsx(r,{message:"Last updated"}),body:s=>e.jsx(ve,{date:s.updated_at})},{key:"actions",header:()=>e.jsx(r,{message:"Actions"}),hideHeader:!0,align:"end",width:"w-84 flex-shrink-0",visibleInMode:"all",body:s=>e.jsx(k,{size:"md",className:"text-muted",elementType:B,to:`${s.id}/edit`,children:e.jsx(He,{})})}];function Qc(){const s=d.useContext(ds),t=d.useMemo(()=>Kc(s),[s]);return e.jsx(Ee,{endpoint:"custom-pages",title:e.jsx(r,{message:"Custom pages"}),filters:t,columns:Gc,queryParams:{with:"user"},actions:e.jsx(Jc,{}),selectedActions:e.jsx(ms,{}),emptyStateMessage:e.jsx(ye,{image:Wc,title:e.jsx(r,{message:"No pages have been created yet"}),filteringTitle:e.jsx(r,{message:"No matching pages"})})})}function Jc(){return e.jsx(Me,{elementType:B,to:"new",children:e.jsx(r,{message:"New page"})})}const Yc=[{label:h("Drive"),to:"drive"}],Zc=[{label:h("General"),to:"general"},...Yc,Yr().settings.billing.integrated&&{label:h("Subscriptions"),to:"subscriptions"},{label:h("Localization"),to:"localization"},{label:h("Authentication"),to:"authentication"},{label:h("Uploading"),to:"uploading"},{label:h("Outgoing email"),to:"outgoing-email"},{label:h("Cache"),to:"cache"},{label:h("Analytics"),to:"analytics"},{label:h("Logging"),to:"logging"},{label:h("Queue"),to:"queue"},{label:h("Recaptcha"),to:"recaptcha"},{label:h("GDPR"),to:"gdpr"},{label:h("Menus"),to:"/admin/appearance/menus"},{label:h("Seo"),to:"/admin/appearance/seo-settings"},{label:h("Themes"),to:"/admin/appearance/themes"}].filter(Boolean),er=Zc;function Xc({className:s}){const t=Le();return e.jsxs("div",{className:v(s,"container mx-auto min-h-full items-start gap-30 p-24 md:flex"),children:[e.jsx(Xs,{children:e.jsx(r,{message:"Settings"})}),t?e.jsx(ed,{}):e.jsx(sd,{}),e.jsx("div",{className:"relative max-w-500 flex-auto md:px-30",children:e.jsx(Js,{})})]})}function ed(){const{pathname:s}=at(),t=cs(),a=s.split("/").pop();return e.jsx(vs,{minWidth:"min-w-none",className:"mb-24 w-full bg",selectionMode:"single",selectedValue:a,onSelectionChange:n=>{t(n)},children:er.map(n=>e.jsx(g,{value:n.to,children:e.jsx(r,{...n.label})},n.to))})}function sd(){return e.jsx("div",{className:"sticky top-24 w-240 flex-shrink-0",children:er.map(s=>e.jsx(Lt,{to:s.to,className:({isActive:t})=>v("mb-8 block whitespace-nowrap rounded-button p-14 text-sm transition-bg-color",t?"bg-primary/6 font-semibold text-primary":"hover:bg-hover"),children:e.jsx(r,{...s.label})},s.to))})}function Rs(){return $e({queryKey:["fetchAdminSettings"],queryFn:()=>td(),staleTime:1/0})}function td(){return I.get("settings").then(s=>s.data)}function ad(){return I.post("sitemap/generate").then(s=>s.data)}function nd(){return R({mutationFn:()=>ad(),onSuccess:()=>{O(h("Sitemap generated"))},onError:s=>se(s)})}const jt=s=>s instanceof Date,rd=s=>Object.keys(s).length===0,Ct=s=>s!=null&&typeof s=="object",wa=(s,...t)=>Object.prototype.hasOwnProperty.call(s,...t),ft=s=>Ct(s)&&rd(s),id=()=>Object.create(null),_t=(s,t)=>{if(s===t)return{};if(!Ct(s)||!Ct(t))return t;const a=Object.keys(s).reduce((n,i)=>(wa(t,i)||(n[i]=void 0),n),id());return jt(s)||jt(t)?s.valueOf()==t.valueOf()?{}:t:Object.keys(t).reduce((n,i)=>{if(!wa(s,i))return n[i]=t[i],n;const l=_t(s[i],t[i]);return ft(l)&&!jt(l)&&(ft(s[i])||!ft(t[i]))||(n[i]=l),n},a)};function sr(s){const{data:t}=Rs();return R({mutationFn:a=>{var l,o,c,m,u,x,j,b,y,w,S;(o=(l=a.client)==null?void 0:l.cookie_notice)!=null&&o.button&&(a.client.cookie_notice.button=JSON.stringify(a.client.cookie_notice.button)),(m=(c=a.client)==null?void 0:c.registration)!=null&&m.policies&&(a.client.registration.policies=JSON.stringify(a.client.registration.policies)),(x=(u=a.client)==null?void 0:u.artistPage)!=null&&x.tabs&&(a.client.artistPage.tabs=JSON.stringify(a.client.artistPage.tabs)),(b=(j=a.client)==null?void 0:j.title_page)!=null&&b.sections&&(a.client.title_page.sections=JSON.stringify(a.client.title_page.sections)),(y=a.client)!=null&&y.incoming_email&&(a.client.incoming_email=JSON.stringify(a.client.incoming_email)),(S=(w=a.client)==null?void 0:w.publish)!=null&&S.default_credentials&&(a.client.publish.default_credentials=JSON.stringify(a.client.publish.default_credentials));const n=a.client?_t(t.client,a.client):null,i=a.server?_t(t.server,a.server):null;return ld({client:n,server:i,files:a.files})},onSuccess:()=>{O(h("Settings updated"),{position:"bottom-right"}),D.invalidateQueries({queryKey:["fetchAdminSettings"]})},onError:a=>Se(a,s)})}function ld({client:s,server:t,files:a}){const n=new FormData;return s&&n.set("client",JSON.stringify(oa.dot(s))),t&&n.set("server",JSON.stringify(oa.dot(t))),Object.entries(a||{}).forEach(([i,l])=>{n.set(i,l)}),I.post("settings",n,{headers:{"Content-Type":"multipart/form-data"}}).then(i=>i.data)}function ke({title:s,description:t,children:a,transformValues:n}){const{data:i}=Rs();return e.jsxs("section",{children:[e.jsxs("div",{className:"mb-40",children:[e.jsx("h2",{className:"mb-4 text-xl",children:s}),e.jsx("div",{className:"text-sm text-muted",children:t})]}),i?e.jsx(od,{defaultValues:i,transformValues:n,children:a}):e.jsx(Ms,{isIndeterminate:!0,"aria-label":"Loading settings..."})]})}function od({children:s,defaultValues:t,transformValues:a}){const n=K({defaultValues:t}),i=sr(n);return e.jsxs(d.Fragment,{children:[e.jsxs(de,{form:n,onBeforeSubmit:()=>{const l=n.formState.errors,o=Object.keys(l).filter(c=>c.endsWith("_group"));n.clearErrors(o)},onSubmit:l=>{l=a?a(l):l,i.mutate(l)},children:[s,e.jsx("div",{className:"mt-40",children:e.jsx(f,{type:"submit",variant:"flat",color:"primary",disabled:i.isPending,children:e.jsx(r,{message:"Update"})})})]}),i.isPending&&e.jsx(La,{size:"xs",className:"absolute -bottom-14 left-30 w-full",isIndeterminate:!0,"aria-label":"Saving settings..."})]})}function Oe(){return e.jsx("div",{className:"h-1 bg-divider my-30"})}function ct({link:s,className:t}){const{site:a}=we();return a.hide_docs_button?null:e.jsxs("div",{className:v("flex items-center gap-8",t),children:[e.jsx(Ht,{size:"sm"}),e.jsx(nt,{href:s,children:e.jsx(r,{message:"Learn more"})})]})}function cd(){return e.jsxs(ke,{title:e.jsx(r,{message:"General"}),description:e.jsx(r,{message:"Configure site url, homepage, theme and other general settings."}),children:[e.jsx(dd,{}),e.jsx(Oe,{}),e.jsx(ud,{}),e.jsx(Oe,{}),e.jsx(md,{}),e.jsx(Oe,{}),e.jsx(hd,{})]})}function dd(){const{data:s}=Rs();if(!s)return null;let t=null;const a=s.server,n=a.newAppUrl&&a.newAppUrl!==a.app_url;return n&&(t=e.jsx("div",{className:"mt-20 text-sm text-danger",children:e.jsx(r,{values:{baseUrl:a.app_url,currentUrl:a.newAppUrl,b:i=>e.jsx("b",{children:i})},message:"Base site url is set as :baseUrl in configuration, but current url is :currentUrl. It is recommended to set the primary url you want to use in configuration file and then redirect all other url versions to this primary version via cpanel or .htaccess file."})})),e.jsxs(d.Fragment,{children:[e.jsx(p,{invalid:!!n,name:"server.app_url",label:e.jsx(r,{message:"Primary site url"}),description:e.jsx(ct,{link:"https://support.vebto.com/help-center/articles/35/primary-site-url"})}),t]})}function ud(){var i,l;const{watch:s}=F(),{homepage:t}=d.useContext(ds),{data:a}=ze(["menuItemCategories"]),n=s("client.homepage.type");return e.jsxs("div",{children:[e.jsxs(U,{name:"client.homepage.type",selectionMode:"single",label:e.jsx(r,{message:"Site home page"}),description:e.jsx(r,{message:"Which page should be used as site homepage."}),children:[t.options.map(o=>e.jsx(g,{value:o.value,children:e.jsx(r,{...o.label})},o.value)),(i=a==null?void 0:a.menuItemCategories)==null?void 0:i.map(o=>e.jsx(g,{value:o.type,children:o.name},o.type))]}),(l=a==null?void 0:a.menuItemCategories)==null?void 0:l.map(o=>n===o.type?e.jsx(U,{className:"mt-24",name:"client.homepage.value",selectionMode:"single",label:e.jsx(r,{message:"Homepage :name",values:{name:o.name}}),children:o.items.map(c=>e.jsx(g,{value:c.model_id,children:c.label},c.label))},o.name):null)]})}function md(){const{data:{themes:s}}=Ba();return e.jsxs(d.Fragment,{children:[e.jsxs(U,{className:"mb-20",name:"client.themes.default_id",selectionMode:"single",label:e.jsx(r,{message:"Default site theme"}),description:e.jsx(r,{message:"Which theme to use for users that have not chosen a theme manually."}),children:[e.jsx(g,{value:0,children:e.jsx(r,{message:"System"})}),s.all.map(t=>e.jsx(g,{value:t.id,children:t.name},t.id))]}),e.jsx(L,{name:"client.themes.user_change",description:e.jsx(r,{message:"Allow users to manually change site theme."}),children:e.jsx(r,{message:"Allow theme change"})})]})}function hd(){const s=nd(),{base_url:t}=we(),a=`${t}/storage/sitemaps/sitemap-index.xml`,n=e.jsx(nt,{href:a,children:a});return e.jsxs(e.Fragment,{children:[e.jsx(f,{variant:"outline",size:"xs",color:"primary",disabled:s.isPending,onClick:()=>{s.mutate()},children:e.jsx(r,{message:"Generate sitemap"})}),e.jsx("div",{className:"mt-14 text-sm text-muted",children:e.jsx(r,{message:"Once generated, sitemap url will be: :url",values:{url:n}})})]})}function Sa(s){return hs(s).toString("rgb").replace("rgb(","").replace(")","").replace(/, ?/g," ")}const xd=E(e.jsx("path",{d:"M3 17v2h6v-2H3zM3 5v2h10V5H3zm10 16v-2h8v-2h-8v-2h-2v6h2zM7 9v2H3v2h4v2h2V9H7zm14 4v-2H11v2h10zm-6-4h2V7h4V5h-4V3h-2v6z"}),"TuneOutlined");function gd(){const{getValues:s,setValue:t}=F(),{themeIndex:a}=ue(),n=s(`appearance.themes.all.${+a}`);return e.jsxs(P,{type:"modal",onClose:i=>{i&&s("appearance.themes.all").forEach((l,o)=>{if(l.id===i.id){t(`appearance.themes.all.${o}`,i,{shouldDirty:!0});return}if(i.default_light){t(`appearance.themes.all.${o}`,{...l,default_light:!1},{shouldDirty:!0});return}if(i.default_dark){t(`appearance.themes.all.${o}`,{...l,default_dark:!1},{shouldDirty:!0});return}})},children:[e.jsx(f,{size:"xs",variant:"outline",color:"primary",startIcon:e.jsx(xd,{}),children:e.jsx(r,{message:"Settings"})}),e.jsx(pd,{theme:n})]})}function pd({theme:s}){const t=K({defaultValues:s}),{close:a,formId:n}=Q();return d.useEffect(()=>{const i=t.watch((l,{name:o})=>{o==="default_light"&&l.default_light&&t.setValue("default_dark",!1),o==="default_dark"&&l.default_dark&&t.setValue("default_light",!1)});return()=>i.unsubscribe()},[t]),e.jsxs(Z,{children:[e.jsx(ne,{children:e.jsx(r,{message:"Update settings"})}),e.jsx(ee,{children:e.jsxs(de,{form:t,id:n,onSubmit:i=>{a(i)},children:[e.jsx(p,{name:"name",label:e.jsx(r,{message:"Name"}),className:"mb-30",autoFocus:!0}),e.jsx(L,{name:"is_dark",className:"mb-20 pb-20 border-b",description:e.jsx(r,{message:"Whether this theme has light text on dark background."}),children:e.jsx(r,{message:"Dark theme"})}),e.jsx(L,{name:"default_light",className:"mb-30",description:e.jsx(r,{message:"When light mode is selected, this theme will be used."}),children:e.jsx(r,{message:"Default for light mode"})}),e.jsx(L,{name:"default_dark",description:e.jsx(r,{message:"When dark mode is selected, this theme will be used."}),children:e.jsx(r,{message:"Default for dark mode"})})]})}),e.jsxs(xe,{children:[e.jsx(f,{onClick:()=>{a()},children:e.jsx(r,{message:"Cancel"})}),e.jsx(f,{variant:"flat",color:"primary",type:"submit",form:n,disabled:!t.formState.isDirty,children:e.jsx(r,{message:"Save"})})]})]})}const jd=E(e.jsx("path",{d:"M6 13c0-1.65.67-3.15 1.76-4.24L6.34 7.34C4.9 8.79 4 10.79 4 13c0 4.08 3.05 7.44 7 7.93v-2.02c-2.83-.48-5-2.94-5-5.91zm14 0c0-4.42-3.58-8-8-8-.06 0-.12.01-.18.01l1.09-1.09L11.5 2.5 8 6l3.5 3.5 1.41-1.41-1.08-1.08c.06 0 .12-.01.17-.01 3.31 0 6 2.69 6 6 0 2.97-2.17 5.43-5 5.91v2.02c3.95-.49 7-3.85 7-7.93z"}),"RestartAltOutlined");function fd(){const s=je(),{themeIndex:t}=ue(),[a,n]=d.useState(!1),{setValue:i,getValues:l}=F(),{fields:o,remove:c}=Ae({name:"appearance.themes.all"}),m=()=>{if(o.length<=1){O.danger(h("At least one theme is required"));return}t&&(s("/admin/appearance/themes"),c(+t),i("appearance.themes.selectedThemeId",null))};return e.jsxs(d.Fragment,{children:[e.jsxs(ws,{onItemSelected:u=>{if(u==="delete")n(!0);else if(u==="reset"){const x=`appearance.themes.all.${+t}`,j=l(`${x}.is_dark`)?V().defaults.appearance.themes.dark:V().defaults.appearance.themes.light;Object.entries(j).forEach(([b,y])=>{V().preview.setThemeValue(b,y)}),V().preview.setThemeFont(null),i(`${x}.values`,j,{shouldDirty:!0}),i(`${x}.font`,void 0,{shouldDirty:!0})}},children:[e.jsx(k,{size:"md",className:"text-muted",children:e.jsx(Ya,{})}),e.jsxs(Ss,{children:[e.jsx(g,{value:"reset",startIcon:e.jsx(jd,{}),children:e.jsx(r,{message:"Reset colors"})}),e.jsx(g,{value:"delete",startIcon:e.jsx(it,{}),children:e.jsx(r,{message:"Delete"})})]})]}),e.jsx(P,{type:"modal",isOpen:a,onClose:u=>{u&&m(),n(!1)},children:e.jsx(Fe,{isDanger:!0,title:e.jsx(r,{message:"Delete theme"}),body:e.jsx(r,{message:"Are you sure you want to delete this theme?"}),confirm:e.jsx(r,{message:"Delete"})})})]})}const ka=[{label:h("Accent"),value:"primary",bgColor:"bg-primary",previewBgColor:"text-primary"},{label:h("Background"),value:"bg",bgColor:"bg-background",previewBgColor:"text-background"},{label:h("Background alt"),value:"bg-alt",bgColor:"bg-alt",previewBgColor:"text-background-alt"},{label:h("Transparent"),value:"transparent",bgColor:"bg-transparent",previewBgColor:"text-transparent"}];function bd(){var o;const{themeIndex:s}=ue(),{watch:t,setValue:a}=F(),n=`appearance.themes.all.${s}.values.--be-navbar-color`,i=t(n),l=(o=ka.find(({value:c})=>c===i))==null?void 0:o.previewBgColor;return e.jsxs(ws,{placement:"right",selectionMode:"single",selectedValue:i,onSelectionChange:c=>{a(n,c,{shouldDirty:!0})},children:[e.jsx(pe,{startIcon:e.jsx(Bt,{viewBox:"0 0 48 48",className:v("icon-lg",l)}),children:e.jsx(r,{message:"Navbar"})}),e.jsx(Ss,{children:ka.map(({label:c,value:m,bgColor:u})=>e.jsx(g,{value:m,startIcon:e.jsx("div",{className:v("h-20 w-20 rounded border",u)}),children:e.jsx(r,{...c})},m))})]})}function vd(s){try{return hs(`rgb(${s.split(" ").join(",")})`).toString("hex")}catch{return s}}const yd=[{label:h("Background"),key:"--be-background"},{label:h("Background alt"),key:"--be-background-alt"},{label:h("Foreground"),key:"--be-foreground-base"},{label:h("Accent light"),key:"--be-primary-light"},{label:h("Accent"),key:"--be-primary"},{label:h("Accent dark"),key:"--be-primary-dark"},{label:h("Text on accent"),key:"--be-on-primary"},{label:h("Chip"),key:"--be-background-chip"}];function wd(){const s=cs(),{themeIndex:t}=ue(),{getValues:a,watch:n}=F(),i=a(`appearance.themes.all.${+t}`),l=n(`appearance.themes.all.${+t}.font.family`);return d.useEffect(()=>{i||s("/admin/appearance/themes")},[s,i]),d.useEffect(()=>{i!=null&&i.id&&V().preview.setActiveTheme(i.id)},[i==null?void 0:i.id]),i?e.jsxs(d.Fragment,{children:[e.jsxs("div",{className:"mb-20 flex items-center justify-between gap-10",children:[e.jsx(gd,{}),e.jsx(fd,{})]}),e.jsxs("div",{children:[e.jsx(pe,{elementType:B,to:"font",description:l||e.jsx(r,{message:"System"}),children:e.jsx(r,{message:"Font"})}),e.jsx(pe,{elementType:B,to:"radius",children:e.jsx(r,{message:"Rounding"})}),e.jsx("div",{className:"mb-6 mt-22 text-sm font-semibold",children:e.jsx(r,{message:"Colors"})}),e.jsx(bd,{}),yd.map(o=>e.jsx(Sd,{colorName:o.key,label:e.jsx(r,{...o.label}),initialThemeValue:i.values[o.key],theme:i},o.key))]})]}):null}function Sd({label:s,theme:t,colorName:a,initialThemeValue:n}){const{setValue:i}=F(),{themeIndex:l}=ue(),[o,c]=d.useState(n),m=u=>{c(u),V().preview.setThemeValue(a,u)};return d.useEffect(()=>{c(n)},[n]),e.jsxs(P,{value:vd(o),type:"popover",placement:"right",offset:10,onValueChange:u=>{m(Sa(u))},onClose:(u,{valueChanged:x,initialValue:j})=>{u&&x?(i(`appearance.themes.all.${+l}.values.${a}`,Sa(u),{shouldDirty:!0}),i("appearance.themes.selectedThemeId",t.id)):m(j)},children:[e.jsx(pe,{className:"capitalize",startIcon:e.jsx(Bt,{viewBox:"0 0 48 48",className:"icon-lg",style:{fill:`rgb(${o})`}}),children:s}),e.jsx(Kt,{})]})}function kd(){return e.jsxs(ke,{title:e.jsx(r,{message:"Drive"}),description:e.jsx(r,{message:"Configure defaults for drive user dashboard."}),children:[e.jsxs(Dt,{required:!0,className:"mb-30",size:"md",name:"client.drive.default_view",orientation:"vertical",label:e.jsx(r,{message:"Default view mode"}),description:e.jsx(r,{message:"Which view mode should user drive use by default."}),children:[e.jsx(rs,{value:"list",children:e.jsx(r,{message:"List"})}),e.jsx(rs,{value:"grid",children:e.jsx(r,{message:"Grid"})})]}),e.jsx(L,{className:"mb-30",name:"client.drive.send_share_notification",description:e.jsx(r,{message:"Send a notification to user when a file or folder is shared with them."}),children:e.jsx(r,{message:"Share notifications"})}),e.jsx(L,{name:"client.share.suggest_emails",description:e.jsx(r,{message:"Suggest email address of existing users when sharing a file or folder."}),children:e.jsx(r,{message:"Suggest emails"})})]})}const Nd=[{path:"drive",element:e.jsx(kd,{})}];function fe({children:s,name:t,separatorBottom:a=!0,separatorTop:n=!0}){const{formState:{errors:i}}=F(),l=d.useRef(null),o=i[t];return d.useEffect(()=>{var c;o&&((c=l.current)==null||c.scrollIntoView({behavior:"smooth"}))},[o]),e.jsxs("div",{className:v(a&&"border-b mb-20 pb-20",n&&"border-t mt-20 pt-20",o&&"border-y-error"),ref:l,children:[s(!!o),o&&e.jsx("div",{className:"text-danger text-sm mt-20",dangerouslySetInnerHTML:{__html:o.message}})]})}function Ft({children:s,...t}){const{field:{onChange:a,onBlur:n,value:i=[],ref:l},fieldState:{invalid:o,error:c}}=ys({name:t.name}),m=d.useMemo(()=>{const x=i;return typeof x=="string"?JSON.parse(x):x},[i]),u={onChange:x=>{const j=JSON.stringify(x.map(b=>b.name));a(j)},onBlur:n,value:m,invalid:o,errorMessage:c==null?void 0:c.message};return e.jsx(Ui,{ref:l,...ls(u,t)})}const Vs=$.createContext(null);function Zt(s){const{size:t="md",children:a,className:n,isLazy:i,overflow:l="overflow-hidden"}=s,o=d.useRef([]),c=d.useId(),[m,u]=Ts(s.selectedTab,s.defaultSelectedTab||0,s.onTabChange),x=d.useMemo(()=>({selectedTab:m,setSelectedTab:u,tabsRef:o,size:t,isLazy:i,id:c}),[m,c,i,u,t]);return e.jsx(Vs.Provider,{value:x,children:e.jsx("div",{className:v(n,l,"max-w-full"),children:a})})}function Cd(){const{tabsRef:s,selectedTab:t}=d.useContext(Vs),[a,n]=d.useState({width:void 0,transform:void 0,className:void 0});return Wa(()=>{if(t!=null&&s.current){const i=s.current[t];if(!i)return;n(l=>({width:`${i.offsetWidth}px`,transform:`translateX(${i.offsetLeft}px)`,className:l.width===void 0?"":"transition-all"}))}},[n,t,s]),e.jsx("div",{className:v("absolute bottom-0 left-0 h-2 bg-primary",a.className),role:"presentation",style:{width:a.width,transform:a.transform}})}function Xt({children:s,center:t,expand:a,className:n}){const i=d.Children.toArray(s);return e.jsx(Ta,{children:e.jsxs("div",{className:v("flex relative max-w-full overflow-auto border-b max-sm:hidden-scrollbar md:compact-scrollbar",n),role:"tablist","aria-orientation":"horizontal",children:[i.map((l,o)=>d.isValidElement(l)?d.cloneElement(l,{index:o,className:v(l.props.className,a&&"flex-auto",t&&o===0&&"ml-auto",t&&o===i.length-1&&"mr-auto")}):null),e.jsx(Cd,{})]})})}function is({index:s,className:t,isDisabled:a,children:n,padding:i,elementType:l="button",to:o,relative:c,width:m="min-w-min"}){const{selectedTab:u,setSelectedTab:x,tabsRef:j,size:b="md",id:y}=d.useContext(Vs),w=s===u,S=$a(),_=i||(b==="sm"?"px-12":"px-18"),z=v("tracking-wide overflow-hidden capitalize text-sm flex items-center justify-center outline-none transition-colors","focus-visible:ring focus-visible:ring-2 ring-inset rounded whitespace-nowrap cursor-pointer",m,_d({isDisabled:a,isSelected:w}),t,b==="md"&&`${_} h-48`,b==="sm"&&`${_} h-32`,a&&"pointer-events-none"),A=T=>{switch(T.key){case"ArrowLeft":S==null||S.focusPrevious();break;case"ArrowRight":S==null||S.focusNext();break;case"Home":S==null||S.focusFirst();break;case"End":S==null||S.focusLast();break}},N=w?0:-1,J=l;return e.jsx(J,{disabled:a,id:`${y}-${s}-tab`,"aria-controls":`${y}-${s}-tabpanel`,type:"button",role:"tab","aria-selected":w,tabIndex:a?void 0:N,onKeyDown:A,onClick:()=>{x(s)},to:o,relative:c,className:z,ref:T=>{j.current&&T&&(j.current[s]=T)},children:n})}function _d({isDisabled:s,isSelected:t}){return s?"text-disabled cursor-default":t?"text-primary":"text-muted hover:text-main"}function tr({children:s,className:t}){const{selectedTab:a,isLazy:n}=d.useContext(Vs),i=d.Children.toArray(s).filter(o=>!!o);let l;if(n){const o=i[a];l=d.isValidElement(o)?d.cloneElement(i[a],{index:a}):null}else l=i.map((o,c)=>{if(d.isValidElement(o)){const m=c===a;return d.cloneElement(o,{index:c,"aria-hidden":!m,className:m?o.props.className:v(o.props.className,"hidden")})}return null});return e.jsx("div",{className:t,children:l})}function Qs({className:s,children:t,index:a,...n}){const{id:i}=d.useContext(Vs),[l,o]=d.useState(0),c=d.useRef(null);return Wa(()=>{if(c!=null&&c.current){const m=()=>{const x=Zr(c.current,{tabbable:!0});o(x.nextNode()?void 0:0)};m();const u=new MutationObserver(m);return u.observe(c.current,{subtree:!0,childList:!0,attributes:!0,attributeFilter:["tabIndex","disabled"]}),()=>{u.disconnect()}}},[c]),e.jsx("div",{tabIndex:l,ref:c,id:`${i}-${a}-tabpanel`,"aria-labelledby":`${i}-${a}-tab`,className:v(s,"focus-visible:outline-primary-light"),role:"tabpanel",...n,children:t})}function Fd(){const{trans:s}=M();return e.jsx(ke,{title:e.jsx(r,{message:"Subscriptions"}),description:e.jsx(r,{message:"Configure gateway integration, accepted cards, invoices and other related settings."}),children:e.jsxs(Zt,{children:[e.jsxs(Xt,{children:[e.jsx(is,{children:e.jsx(r,{message:"General"})}),e.jsx(is,{children:e.jsx(r,{message:"Invoices"})})]}),e.jsxs(tr,{className:"pt-30",children:[e.jsxs(Qs,{children:[e.jsx(L,{name:"client.billing.enable",description:e.jsx(r,{message:"Enable or disable all subscription related functionality across the site."}),children:e.jsx(r,{message:"Enable subscriptions"})}),e.jsx(Oe,{}),e.jsx(zd,{}),e.jsx(Id,{}),e.jsx(Oe,{}),e.jsx(Ft,{label:e.jsx(r,{message:"Accepted cards"}),name:"client.billing.accepted_cards",placeholder:s({message:"Add new card..."})})]}),e.jsxs(Qs,{children:[e.jsx(p,{inputElementType:"textarea",rows:5,label:e.jsx(r,{message:"Invoice address"}),name:"client.billing.invoice.address",className:"mb-30"}),e.jsx(p,{inputElementType:"textarea",rows:5,label:e.jsx(r,{message:"Invoice notes"}),description:e.jsx(r,{message:"Default notes to show under `notes` section of user invoice. Optional."}),name:"client.billing.invoice.notes"})]})]})]})})}function zd(){const{watch:s}=F(),t=s("client.billing.paypal.enable");return e.jsxs("div",{className:"mb-30",children:[e.jsx(L,{name:"client.billing.paypal.enable",description:e.jsxs("div",{children:[e.jsx(r,{message:"Enable PayPal payment gateway integration."}),e.jsx(ct,{className:"mt-6",link:"https://support.vebto.com/help-center/articles/147/configuring-paypal"})]}),children:e.jsx(r,{message:"PayPal gateway"})}),t?e.jsx(fe,{name:"paypal_group",children:a=>e.jsxs(d.Fragment,{children:[e.jsx(p,{name:"server.paypal_client_id",label:e.jsx(r,{message:"PayPal Client ID"}),required:!0,invalid:a,className:"mb-20"}),e.jsx(p,{name:"server.paypal_secret",label:e.jsx(r,{message:"PayPal Secret"}),required:!0,invalid:a,className:"mb-20"}),e.jsx(p,{name:"server.paypal_webhook_id",label:e.jsx(r,{message:"PayPal Webhook ID"}),required:!0,invalid:a,className:"mb-20"}),e.jsx(L,{name:"client.billing.paypal_test_mode",invalid:a,description:e.jsx("div",{children:e.jsx(r,{message:"Allows testing PayPal payments with sandbox accounts."})}),children:e.jsx(r,{message:"PayPal test mode"})})]})}):null]})}function Id(){const{watch:s}=F(),t=s("client.billing.stripe.enable");return e.jsxs(d.Fragment,{children:[e.jsx(L,{name:"client.billing.stripe.enable",description:e.jsxs("div",{children:[e.jsx(r,{message:"Enable Stripe payment gateway integration."}),e.jsx(ct,{className:"mt-6",link:"https://support.vebto.com/help-center/articles/148/configuring-stripe"})]}),children:e.jsx(r,{message:"Stripe gateway"})}),t?e.jsx(fe,{name:"stripe_group",separatorBottom:!1,children:a=>e.jsxs(d.Fragment,{children:[e.jsx(p,{name:"server.stripe_key",label:e.jsx(r,{message:"Stripe publishable key"}),required:!0,className:"mb-20",invalid:a}),e.jsx(p,{name:"server.stripe_secret",label:e.jsx(r,{message:"Stripe secret key"}),required:!0,className:"mb-20",invalid:a}),e.jsx(p,{name:"server.stripe_webhook_secret",label:e.jsx(r,{message:"Stripe webhook signing secret"}),className:"mb-20",invalid:a})]})}):null]})}function Ad(){const{data:s}=ze(["timezones","localizations"]),t=Wi(),{trans:a}=M();return e.jsxs(ke,{title:e.jsx(r,{message:"Localization"}),description:e.jsx(r,{message:"Configure global date, time and language settings."}),children:[e.jsxs(U,{className:"mb-30",required:!0,name:"client.dates.default_timezone",showSearchField:!0,selectionMode:"single",label:e.jsx(r,{message:"Default timezone"}),searchPlaceholder:a(h("Search timezones")),description:e.jsx(r,{message:"Which timezone should be selected by default for new users and guests."}),children:[e.jsx(g,{value:"auto",children:e.jsx(r,{message:"Auto"})},"auto"),Object.entries((s==null?void 0:s.timezones)||{}).map(([n,i])=>e.jsx(qa,{label:n,children:i.map(l=>e.jsx(g,{value:l.value,children:l.text},l.value))},n))]}),e.jsxs(U,{name:"client.locale.default",className:"mb-30",selectionMode:"single",label:e.jsx(r,{message:"Default language"}),description:e.jsx(r,{message:"Which localization should be selected by default for new users and guests."}),children:[e.jsx(g,{value:"auto",children:e.jsx(r,{message:"Auto"})},"auto"),((s==null?void 0:s.localizations)||[]).map(n=>e.jsx(g,{value:n.language,capitalizeFirst:!0,children:n.name},n.language))]}),e.jsxs(Dt,{required:!0,className:"mb-30",size:"sm",name:"client.dates.format",orientation:"vertical",label:e.jsx(r,{message:"Date verbosity"}),description:e.jsx(r,{message:"Default verbosity for all dates displayed across the site. Month/day order and separators will be adjusted automatically, based on user's locale."}),children:[e.jsx(rs,{value:"auto",children:e.jsx(r,{message:"Auto"})},"auto"),Object.entries(Xr).map(([n,i])=>e.jsx(rs,{value:n,children:e.jsx(ve,{date:t,options:i})},n))]}),e.jsx(L,{name:"client.i18n.enable",description:e.jsx(r,{message:"If disabled, site will always be shown in default language and user will not be able to change their locale."}),children:e.jsx(r,{message:"Enable translations"})})]})}function Ed(){return e.jsxs(ke,{title:e.jsx(r,{message:"Authentication"}),description:e.jsx(r,{message:"Configure registration, social login and related 3rd party integrations."}),children:[e.jsx(Td,{}),e.jsx(L,{className:"mb-24",name:"client.registration.disable",description:e.jsx(r,{message:"All registration related functionality (including social login) will be disabled."}),children:e.jsx(r,{message:"Disable registration"})}),e.jsx(L,{className:"mb-24",name:"client.single_device_login",description:e.jsx(r,{message:"Only allow one device to be logged into user account at the same time."}),children:e.jsx(r,{message:"Single device login"})}),e.jsx(L,{name:"client.social.compact_buttons",description:e.jsx(r,{message:"Use compact design for social login buttons."}),children:e.jsx(r,{message:"Compact buttons"})}),e.jsx($d,{}),e.jsx(Ld,{}),e.jsx(Md,{}),e.jsx(Dd,{}),e.jsx(Oe,{}),e.jsx(p,{inputElementType:"textarea",rows:3,className:"mt-24",name:"client.auth.domain_blacklist",label:e.jsx(r,{message:"Domain blacklist"}),description:e.jsx(r,{message:"Comma separated list of domains. Users will not be able to register or login using any email adress from specified domains."})})]})}function Pd(){const{watch:s}=F();return s("server.mail_setup")?null:e.jsx("p",{className:"mt-10 rounded-panel border p-10 text-sm text-danger",children:e.jsx(r,{message:"Outgoing mail method needs to be setup before enabling this setting. Fix now",values:{a:a=>e.jsx(f,{elementType:B,variant:"outline",size:"xs",display:"flex",className:"mt-10 max-w-max",to:"/admin/settings/outgoing-email",children:a})}})})}function Td(){return e.jsx(L,{className:"mb-30",name:"client.require_email_confirmation",description:e.jsxs(d.Fragment,{children:[e.jsx(r,{message:"Require newly registered users to validate their email address before being able to login."}),e.jsx(Pd,{})]}),children:e.jsx(r,{message:"Require email confirmation"})})}function $d(){var n;const{watch:s}=F(),t=we(),a=s("client.social.envato.enable");return(n=t.envato)!=null&&n.enable?e.jsx(fe,{separatorBottom:!1,name:"envato_group",children:i=>e.jsxs(e.Fragment,{children:[e.jsx(L,{invalid:i,name:"client.social.envato.enable",description:e.jsx(r,{message:"Enable logging into the site via envato."}),children:e.jsx(r,{message:"Envato login"})}),!!a&&e.jsxs(e.Fragment,{children:[e.jsx(p,{invalid:i,className:"mt-30",name:"server.envato_id",label:e.jsx(r,{message:"Envato ID"}),required:!0}),e.jsx(p,{invalid:i,className:"mt-30",name:"server.envato_secret",label:e.jsx(r,{message:"Envato secret"}),required:!0}),e.jsx(p,{invalid:i,className:"mt-30",name:"server.envato_personal_token",label:e.jsx(r,{message:"Envato personal token"}),required:!0})]})]})}):null}function Ld(){const{watch:s}=F(),t=s("client.social.google.enable");return e.jsx(fe,{name:"google_group",children:a=>e.jsxs(e.Fragment,{children:[e.jsx(L,{invalid:a,name:"client.social.google.enable",description:e.jsx(r,{message:"Enable logging into the site via google."}),children:e.jsx(r,{message:"Google login"})}),!!t&&e.jsxs(e.Fragment,{children:[e.jsx(p,{invalid:a,className:"mt-30",name:"server.google_id",label:e.jsx(r,{message:"Google client ID"}),required:!0}),e.jsx(p,{className:"mt-30",name:"server.google_secret",label:e.jsx(r,{message:"Google client secret"}),required:!0})]})]})})}function Md(){const{watch:s}=F(),t=s("client.social.facebook.enable");return e.jsx(fe,{name:"facebook_group",separatorTop:!1,children:a=>e.jsxs(e.Fragment,{children:[e.jsx(L,{invalid:a,name:"client.social.facebook.enable",description:e.jsx(r,{message:"Enable logging into the site via facebook."}),children:e.jsx(r,{message:"Facebook login"})}),!!t&&e.jsxs(e.Fragment,{children:[e.jsx(p,{invalid:a,className:"mt-30",name:"server.facebook_id",label:e.jsx(r,{message:"Facebook app ID"}),required:!0}),e.jsx(p,{invalid:a,className:"mt-30",name:"server.facebook_secret",label:e.jsx(r,{message:"Facebook app secret"}),required:!0})]})]})})}function Dd(){const{watch:s}=F(),t=s("client.social.twitter.enable");return e.jsx(fe,{name:"twitter_group",separatorTop:!1,separatorBottom:!1,children:a=>e.jsxs(e.Fragment,{children:[e.jsx(L,{invalid:a,name:"client.social.twitter.enable",description:e.jsx(r,{message:"Enable logging into the site via twitter."}),children:e.jsx(r,{message:"Twitter login"})}),!!t&&e.jsxs(e.Fragment,{children:[e.jsx(p,{invalid:a,className:"mt-30",name:"server.twitter_id",label:e.jsx(r,{message:"Twitter ID"}),required:!0}),e.jsx(p,{invalid:a,className:"mt-30",name:"server.twitter_secret",label:e.jsx(r,{message:"Twitter secret"}),required:!0})]})]})})}function Rd(){return I.get("uploads/server-max-file-size").then(s=>s.data)}function Vd(){return $e({queryKey:["MaxServerUploadSize"],queryFn:()=>Rd()})}const Od=["B","KB","MB","GB","TB","PB"];function Na(s,t){if(s==null)return 0;switch(t){case"KB":return s*1024;case"MB":return s*1024**2;case"GB":return s*1024**3;case"TB":return s*1024**4;case"PB":return s*1024**5;default:return s}}const qd=0x630000000000,Is=$.forwardRef(({name:s,...t},a)=>{const{field:{onChange:n,onBlur:i,value:l="",ref:o},fieldState:{invalid:c,error:m}}=ys({name:s}),[u,x]=d.useState(""),[j,b]=d.useState("MB");d.useEffect(()=>{if(l==null||l===""){x("");return}const{amount:S,unit:_}=Hd({bytes:Math.min(l,qd)});b(_||"MB"),x(Number.isNaN(S)?"":S)},[l,j]);const y={onChange:S=>{const _=parseInt(S.target.value);if(Number.isNaN(_))n(_);else{const z=Na(parseInt(S.target.value),j);n(z)}},onBlur:i,value:u,invalid:c,errorMessage:m==null?void 0:m.message,inputRef:o},w=e.jsx(vs,{minWidth:"min-w-80",selectionMode:"single",selectedValue:j,disabled:!l,onSelectionChange:S=>{const _=Na(u||0,S);n(_)},children:Od.slice(0,5).map(S=>e.jsx(g,{value:S,children:S==="B"?"Bytes":S},S))});return e.jsx(Ye,{...ls(y,t),type:"number",ref:a,endAppend:w})}),Hd=ei(({bytes:s})=>{const t=Ka(s);if(!t)return{amount:"",unit:"MB"};let a=parseInt(t.split(" ")[0]);return a=Math.round(a),{amount:a,unit:t.split(" ")[1]}});function Bd(){const{trans:s}=M();return R({mutationFn:()=>Ud(),onSuccess:()=>{O(s(h("CORS file updated")))},onError:t=>se(t)})}function Ud(){return I.post("s3/cors/upload").then(s=>s.data)}function Wd(){return R({mutationFn:s=>Kd(s),onError:s=>se(s)})}function Kd(s){return I.post("settings/uploading/dropbox-refresh-token",s).then(t=>t.data)}function Gd({isInvalid:s}){const{watch:t,setValue:a}=F(),n=t("server.storage_dropbox_app_key"),i=t("server.storage_dropbox_app_secret");return e.jsxs(d.Fragment,{children:[e.jsx(p,{invalid:s,className:"mb-20",name:"server.storage_dropbox_app_key",label:e.jsx(r,{message:"Dropbox application key"}),required:!0}),e.jsx(p,{invalid:s,className:"mb-20",name:"server.storage_dropbox_app_secret",label:e.jsx(r,{message:"Dropbox application secret"}),required:!0}),e.jsx(p,{invalid:s,className:"mb-20",name:"server.storage_dropbox_refresh_token",label:e.jsx(r,{message:"Dropbox refresh token"}),required:!0}),e.jsxs(P,{type:"modal",onClose:l=>{l&&a("server.storage_dropbox_refresh_token",l)},children:[e.jsx(f,{variant:"outline",color:"primary",size:"xs",disabled:!n||!i,children:e.jsx(r,{message:"Get dropbox refresh token"})}),e.jsx(Qd,{appKey:n,appSecret:i})]})]})}function Qd({appKey:s,appSecret:t}){const a=K(),{formId:n,close:i}=Q(),l=Wd();return e.jsxs(Z,{children:[e.jsx(ne,{children:e.jsx(r,{message:"Connected dropbox account"})}),e.jsx(ee,{children:e.jsxs(de,{id:n,form:a,onSubmit:o=>{l.mutate({app_key:s,app_secret:t,access_code:o.accessCode},{onSuccess:c=>{i(c.refreshToken)}})},children:[e.jsxs("div",{className:"mb-20 pb-20 border-b",children:[e.jsx("div",{className:"text-muted text-sm mb-10",children:e.jsx(r,{message:"Click the 'get access code' button to get dropbox access code, then paste it into the field below."})}),e.jsx(f,{variant:"outline",color:"primary",size:"xs",elementType:"a",target:"_blank",href:`https://www.dropbox.com/oauth2/authorize?client_id=${s}&token_access_type=offline&response_type=code`,children:e.jsx(r,{message:"Get access code"})})]}),e.jsx(p,{name:"accessCode",label:e.jsx(r,{message:"Dropbox access code"}),required:!0})]})}),e.jsxs(xe,{children:[e.jsx(f,{onClick:()=>{i()},children:e.jsx(r,{message:"Cancel"})}),e.jsx(f,{variant:"flat",color:"primary",form:n,type:"submit",disabled:!s||!t||l.isPending,children:e.jsx(r,{message:"Connect"})})]})]})}function Jd(){const{trans:s}=M();return e.jsxs(ke,{title:e.jsx(r,{message:"Uploading"}),description:e.jsx(r,{message:"Configure size and type of files that users are able to upload. This will affect all uploads across the site."}),children:[e.jsx(Zd,{}),e.jsx(Xd,{}),e.jsx(eu,{}),e.jsx(fe,{name:"static_delivery_group",children:t=>e.jsxs(Dt,{invalid:t,size:"sm",name:"server.static_file_delivery",orientation:"vertical",label:e.jsx(r,{message:"File delivery optimization"}),description:e.jsx(r,{message:"Both X-Sendfile and X-Accel need to be enabled on the server first. When enabled, it will reduce server memory and CPU usage when previewing or downloading files, especially for large files."}),children:[e.jsx(rs,{value:"",children:e.jsx(r,{message:"None"})}),e.jsx(rs,{value:"xsendfile",children:e.jsx(r,{message:"X-Sendfile (Apache)"})}),e.jsx(rs,{value:"xaccel",children:e.jsx(r,{message:"X-Accel (Nginx)"})})]})}),e.jsx(Is,{className:"mb-30",name:"client.uploads.chunk_size",min:1,label:e.jsx(r,{message:"Chunk size"}),placeholder:"Infinity",description:e.jsx(r,{message:"Size (in bytes) for each file chunk. It should only be changed if there is a maximum upload size on your server or proxy (for example cloudflare). If chunk size is larger then limit on the server, uploads will fail."})}),e.jsx(Yd,{}),e.jsx(Oe,{}),e.jsx(Is,{min:1,name:"client.uploads.max_size",className:"mb-30",label:e.jsx(r,{message:"Maximum file size"}),description:e.jsx(r,{message:"Maximum size (in bytes) for a single file user can upload."})}),e.jsx(Is,{min:1,name:"client.uploads.available_space",className:"mb-30",label:e.jsx(r,{message:"Available space"}),description:e.jsx(r,{message:"Disk space (in bytes) each user uploads are allowed to take up. This can be overridden per user."})}),e.jsx(Ft,{name:"client.uploads.allowed_extensions",className:"mb-30",label:e.jsx(r,{message:"Allowed extensions"}),placeholder:s(h("Add extension...")),description:e.jsx(r,{message:"List of allowed file types (jpg, mp3, pdf etc.). Leave empty to allow all file types."})}),e.jsx(Ft,{name:"client.uploads.blocked_extensions",label:e.jsx(r,{message:"Blocked extensions"}),placeholder:s(h("Add extension...")),description:e.jsx(r,{message:"Prevent uploading of these file types, even if they are allowed above."})})]})}function Yd(){const{data:s}=Vd();return e.jsx(Je,{color:"warning",description:e.jsx(r,{message:"Maximum upload size on your server currently is set to :size",values:{size:s==null?void 0:s.maxSize,b:t=>e.jsx("b",{children:t})}})})}function Zd(){const{watch:s,clearErrors:t}=F();return s("server.uploads_disk_driver")?e.jsxs(U,{className:"mb-30",selectionMode:"single",name:"server.uploads_disk_driver",label:e.jsx(r,{message:"User Uploads Storage Method"}),description:e.jsx(r,{message:"Where should user private file uploads be stored."}),onSelectionChange:()=>{t()},children:[e.jsx(g,{value:"local",children:e.jsx(r,{message:"Local Disk (Default)"})}),e.jsx(g,{value:"ftp",children:"FTP"}),e.jsx(g,{value:"digitalocean_s3",children:"DigitalOcean Spaces"}),e.jsx(g,{value:"backblaze_s3",children:"Backblaze"}),e.jsx(g,{value:"s3",children:"Amazon S3 (Or compatible service)"}),e.jsx(g,{value:"dropbox",children:"Dropbox"}),e.jsx(g,{value:"rackspace",children:"Rackspace"})]}):null}function Xd(){const{watch:s,clearErrors:t}=F();return s("server.public_disk_driver")?e.jsxs(U,{label:e.jsx(r,{message:"Public Uploads Storage Method"}),selectionMode:"single",name:"server.public_disk_driver",description:e.jsx(r,{message:"Where should user public uploads (like avatars) be stored."}),onSelectionChange:()=>{t()},children:[e.jsx(g,{value:"local",children:e.jsx(r,{message:"Local Disk (Default)"})}),e.jsx(g,{value:"s3",children:"Amazon S3"}),e.jsx(g,{value:"ftp",children:"FTP"}),e.jsx(g,{value:"digitalocean_s3",children:"DigitalOcean Spaces"}),e.jsx(g,{value:"backblaze_s3",children:"Backblaze"})]}):null}function eu(){const{watch:s}=F(),t=[s("server.uploads_disk_driver"),s("server.public_disk_driver")];return t[0]==="local"&&t[1]==="local"?null:e.jsx(fe,{separatorBottom:!1,name:"storage_group",children:a=>{if(t.includes("s3"))return e.jsx(su,{isInvalid:a});if(t.includes("ftp"))return e.jsx(nu,{isInvalid:a});if(t.includes("dropbox"))return e.jsx(Gd,{isInvalid:a});if(t.includes("digitalocean_s3"))return e.jsx(tu,{isInvalid:a});if(t.includes("backblaze_s3"))return e.jsx(au,{isInvalid:a})}})}function su({isInvalid:s}){return e.jsxs(d.Fragment,{children:[e.jsx(p,{invalid:s,className:"mb-30",name:"server.storage_s3_key",label:e.jsx(r,{message:"Amazon S3 key"}),required:!0}),e.jsx(p,{invalid:s,className:"mb-30",name:"server.storage_s3_secret",label:e.jsx(r,{message:"Amazon S3 secret"}),required:!0}),e.jsx(p,{invalid:s,className:"mb-30",name:"server.storage_s3_region",label:e.jsx(r,{message:"Amazon S3 region"}),pattern:"[a-z1-9\\-]+",placeholder:"us-east-1"}),e.jsx(p,{invalid:s,className:"mb-30",name:"server.storage_s3_bucket",label:e.jsx(r,{message:"Amazon S3 bucket"}),required:!0}),e.jsx(p,{invalid:s,name:"server.storage_s3_endpoint",label:e.jsx(r,{message:"Amazon S3 endpoint"}),description:e.jsx(r,{message:"Only change endpoint if you are using another S3 compatible storage service."})}),e.jsx(ea,{invalid:s})]})}function tu({isInvalid:s}){return e.jsxs(d.Fragment,{children:[e.jsx(p,{invalid:s,className:"mb-30",name:"server.storage_digitalocean_key",label:e.jsx(r,{message:"DigitalOcean key"}),required:!0}),e.jsx(p,{invalid:s,className:"mb-30",name:"server.storage_digitalocean_secret",label:e.jsx(r,{message:"DigitalOcean secret"}),required:!0}),e.jsx(p,{invalid:s,className:"mb-30",name:"server.storage_digitalocean_region",label:e.jsx(r,{message:"DigitalOcean region"}),pattern:"[a-z0-9\\-]+",placeholder:"us-east-1",required:!0}),e.jsx(p,{invalid:s,className:"mb-30",name:"server.storage_digitalocean_bucket",label:e.jsx(r,{message:"DigitalOcean bucket"}),required:!0}),e.jsx(ea,{invalid:s})]})}function au({isInvalid:s}){return e.jsxs(d.Fragment,{children:[e.jsx(p,{invalid:s,className:"mb-30",name:"server.storage_backblaze_key",label:e.jsx(r,{message:"Backblaze KeyID"}),required:!0}),e.jsx(p,{invalid:s,className:"mb-30",name:"server.storage_backblaze_secret",label:e.jsx(r,{message:"Backblaze applicationKey"}),required:!0}),e.jsx(p,{invalid:s,className:"mb-30",name:"server.storage_backblaze_region",label:e.jsx(r,{message:"Backblaze Region"}),pattern:"[a-z0-9\\-]+",placeholder:"us-west-002",required:!0}),e.jsx(p,{invalid:s,className:"mb-30",name:"server.storage_backblaze_bucket",label:e.jsx(r,{message:"Backblaze bucket name"}),required:!0}),e.jsx(ea,{invalid:s})]})}function ea({invalid:s}){var i,l;const t=Bd(),{data:a}=Rs(),n=((i=a==null?void 0:a.server.uploads_disk_driver)==null?void 0:i.endsWith("s3"))||((l=a==null?void 0:a.server.public_disk_driver)==null?void 0:l.endsWith("s3"));return e.jsxs(d.Fragment,{children:[e.jsx(L,{className:"mt-30",invalid:s,name:"client.uploads.s3_direct_upload",description:e.jsxs("div",{children:[e.jsx("p",{children:e.jsx(r,{message:"Upload files directly from the browser to s3 without going through the server. It will save on server bandwidth and should result in faster upload times. This should be enabled, unless storage provider does not support multipart uploads."})}),e.jsx("p",{className:"mt-10",children:e.jsx(r,{message:"If s3 provider is not configured to allow uploads from browser, this can be done automatically via CORS button below, when valid credentials are saved."})})]}),children:e.jsx(r,{message:"Direct upload"})}),e.jsx(f,{variant:"flat",color:"primary",size:"xs",className:"mt-20",onClick:()=>{t.mutate()},disabled:!n||t.isPending,children:e.jsx(r,{message:"Configure CORS"})})]})}function nu({isInvalid:s}){return e.jsxs(e.Fragment,{children:[e.jsx(p,{invalid:s,className:"mb-30",name:"server.storage_ftp_host",label:e.jsx(r,{message:"FTP hostname"}),required:!0}),e.jsx(p,{invalid:s,className:"mb-30",name:"server.storage_ftp_username",label:e.jsx(r,{message:"FTP username"}),required:!0}),e.jsx(p,{invalid:s,className:"mb-30",name:"server.storage_ftp_password",label:e.jsx(r,{message:"FTP password"}),type:"password",required:!0}),e.jsx(p,{invalid:s,className:"mb-30",name:"server.storage_ftp_root",label:e.jsx(r,{message:"FTP directory"}),placeholder:"/"}),e.jsx(p,{invalid:s,className:"mb-30",name:"server.storage_ftp_port",label:e.jsx(r,{message:"FTP port"}),type:"number",min:0,placeholder:"21"}),e.jsx(L,{invalid:s,name:"server.storage_ftp_passive",className:"mb-30",children:e.jsx(r,{message:"Passive"})}),e.jsx(L,{invalid:s,name:"server.storage_ftp_ssl",children:e.jsx(r,{message:"SSL"})})]})}function ru({isInvalid:s}){return e.jsxs(d.Fragment,{children:[e.jsx(p,{invalid:s,className:"mb-30",name:"server.mailgun_domain",label:e.jsx(r,{message:"Mailgun domain"}),description:e.jsx(r,{message:"Usually the domain of your site (site.com)"}),required:!0}),e.jsx(p,{invalid:s,className:"mb-30",name:"server.mailgun_secret",label:e.jsx(r,{message:"Mailgun API key"}),description:e.jsx(r,{message:"Should start with `key-`"}),required:!0}),e.jsx(p,{invalid:s,name:"server.mailgun_endpoint",label:e.jsx(r,{message:"Mailgun endpoint"}),description:e.jsx(r,{message:"Can be left empty, if your mailgun account is in the US region."}),placeholder:"api.eu.mailgun.net"})]})}function iu({isInvalid:s}){return e.jsxs(e.Fragment,{children:[e.jsx(p,{invalid:s,className:"mb-30",name:"server.mail_host",label:e.jsx(r,{message:"SMTP host"}),required:!0}),e.jsx(p,{invalid:s,className:"mb-30",name:"server.mail_username",label:e.jsx(r,{message:"SMTP username"}),required:!0}),e.jsx(p,{invalid:s,className:"mb-30",type:"password",name:"server.mail_password",label:e.jsx(r,{message:"SMTP password"}),required:!0}),e.jsx(p,{invalid:s,className:"mb-30",type:"number",name:"server.mail_port",label:e.jsx(r,{message:"SMTP port"})}),e.jsxs(U,{selectionMode:"single",invalid:s,className:"mb-30",name:"server.mail_encryption",label:e.jsx(r,{message:"SMTP encryption"}),children:[e.jsx(g,{value:"",children:e.jsx(r,{message:"None"})}),e.jsx(g,{value:"tls",children:e.jsx(r,{message:"TLS"})})]})]})}function lu({isInvalid:s}){return e.jsxs(d.Fragment,{children:[e.jsx(p,{invalid:s,className:"mb-30",name:"server.ses_key",label:e.jsx(r,{message:"SES key"}),required:!0}),e.jsx(p,{invalid:s,className:"mb-30",name:"server.ses_secret",label:e.jsx(r,{message:"SES secret"}),required:!0}),e.jsx(p,{invalid:s,name:"server.ses_region",label:e.jsx(r,{message:"SES region"}),placeholder:"us-east-1",required:!0})]})}function ou({isInvalid:s}){return e.jsx(p,{invalid:s,name:"server.postmark_token",label:e.jsx(r,{message:"Postmark token"}),required:!0})}const Ca=E([e.jsx("path",{fill:"#4caf50",d:"M45,16.2l-5,2.75l-5,4.75L35,40h7c1.657,0,3-1.343,3-3V16.2z"},"0"),e.jsx("path",{fill:"#1e88e5",d:"M3,16.2l3.614,1.71L13,23.7V40H6c-1.657,0-3-1.343-3-3V16.2z"},"1"),e.jsx("polygon",{fill:"#e53935",points:"35,11.2 24,19.45 13,11.2 12,17 13,23.7 24,31.95 35,23.7 36,17"},"2"),e.jsx("path",{fill:"#c62828",d:"M3,12.298V16.2l10,7.5V11.2L9.876,8.859C9.132,8.301,8.228,8,7.298,8h0C4.924,8,3,9.924,3,12.298z"},"3"),e.jsx("path",{fill:"#fbc02d",d:"M45,12.298V16.2l-10,7.5V11.2l3.124-2.341C38.868,8.301,39.772,8,40.702,8h0 C43.076,8,45,9.924,45,12.298z"},"4")],"Gmail","0 0 48 48");function cu(){const{watch:s,setValue:t}=F(),{connectSocial:a}=si(),n=s("server.connectedGmailAccount"),i=async()=>{const c=await a("secure/settings/mail/gmail/connect");if((c==null?void 0:c.status)==="SUCCESS"){const m=c.callbackData.profile.email;t("server.connectedGmailAccount",m),O(h("Connected gmail account: :email",{values:{email:m}}))}},l=e.jsx(f,{variant:"outline",color:"primary",startIcon:e.jsx(Ca,{}),onClick:()=>{i()},children:e.jsx(r,{message:"Connect gmail account"})}),o=e.jsxs("div",{className:"flex items-center gap-14 rounded border bg-alt px-14 py-6 text-sm",children:[e.jsx(Ca,{size:"lg"}),n,e.jsx(f,{variant:"text",color:"primary",className:"ml-auto",onClick:()=>{i()},children:e.jsx(r,{message:"Reconnect"})})]});return e.jsxs(d.Fragment,{children:[e.jsx("div",{className:"mb-6 text-sm",children:e.jsx(r,{message:"Gmail account"})}),n?o:l]})}function du(){const{watch:s,clearErrors:t}=F(),a=s("server.mail_driver"),n=[];return a==="mailgun"&&n.push(ru),a==="smtp"&&n.push(iu),a==="ses"&&n.push(lu),a==="postmark"&&n.push(ou),a==="gmailApi"&&n.push(cu),e.jsx(fe,{separatorTop:!1,separatorBottom:!1,name:"mail_group",children:i=>e.jsxs(d.Fragment,{children:[e.jsxs(U,{onSelectionChange:()=>{t()},invalid:i,selectionMode:"single",name:"server.mail_driver",label:e.jsx(r,{message:"Outgoing mail method"}),description:e.jsxs("div",{children:[e.jsx(r,{message:"Which method should be used for sending outgoing application emails (like registration confirmation)"}),e.jsx(ct,{className:"mt-8",link:"https://support.vebto.com/help-center/articles/42/44/155/incoming-emails"})]}),children:[e.jsx(g,{value:"mailgun",children:"Mailgun"}),e.jsx(g,{value:"gmailApi",children:"Gmail Api"}),e.jsx(g,{value:"smtp",children:"SMTP"}),e.jsx(g,{value:"postmark",children:"Postmark"}),e.jsx(g,{value:"ses",children:"Ses (Amazon Simple Email Service)"}),e.jsx(g,{value:"sendmail",children:"SendMail"}),e.jsx(g,{value:"log",children:"Log (Email will be saved to error log)"})]}),n.length?e.jsx("div",{className:"mt-30",children:n.map((l,o)=>e.jsx(l,{isInvalid:i},o))}):null]})})}function uu(){return e.jsxs(ke,{title:e.jsx(r,{message:"Outgoing email settings"}),description:e.jsx(r,{message:"Change outgoing email handlers, email credentials and other related settings."}),children:[e.jsx(p,{id:"outgoing-emails",className:"mb-30",type:"email",name:"server.mail_from_address",label:e.jsx(r,{message:"From address"}),description:e.jsx(r,{message:"All outgoing application emails will be sent from this email address."}),required:!0}),e.jsx(mu,{}),e.jsx(p,{className:"mb-30",name:"server.mail_from_name",label:e.jsx(r,{message:"From name"}),description:e.jsx(r,{message:"All outgoing application emails will be sent using this name."}),required:!0}),e.jsx(Je,{color:"warning",description:e.jsx(r,{message:"Your selected mail method must be authorized to send emails using this address and name."})}),e.jsx(Oe,{}),e.jsx(du,{})]})}function mu(){const{base_url:s}=we(),t=`${s}/contact`,a=e.jsx(nt,{href:t,children:t});return e.jsx(p,{className:"mb-30",type:"email",name:"client.mail.contact_page_address",label:e.jsx(r,{message:"Contact page address"}),description:e.jsx(r,{values:{contactPageUrl:a},message:"Where emails from :contactPageUrl page should be sent to."})})}function hu(){return I.post("cache/flush").then(s=>s.data)}function xu(){return R({mutationFn:()=>hu(),onSuccess:()=>{O(h("Cache cleared"))},onError:s=>se(s)})}function gu(){const s=xu();return e.jsxs(ke,{title:e.jsx(r,{message:"Cache settings"}),description:e.jsx(r,{message:"Select cache provider and manually clear cache."}),children:[e.jsx(pu,{}),e.jsx(f,{type:"button",variant:"outline",size:"xs",color:"primary",disabled:s.isPending,onClick:()=>{s.mutate()},children:e.jsx(r,{message:"Clear cache"})}),e.jsx(Je,{color:"warning",className:"mt-30",description:e.jsx(r,{message:'"File" is the best option for most cases and should not be changed, unless you are familiar with another cache method and have it set up on the server already.'})})]})}function pu(){const{watch:s,clearErrors:t}=F(),a=s("server.cache_driver");let n=null;return a==="memcached"&&(n=ju),e.jsx(fe,{separatorTop:!1,name:"cache_group",children:i=>e.jsxs(e.Fragment,{children:[e.jsxs(U,{invalid:i,onSelectionChange:()=>{t()},selectionMode:"single",name:"server.cache_driver",label:e.jsx(r,{message:"Cache method"}),description:e.jsx(r,{message:"Which method should be used for storing and retrieving cached items."}),children:[e.jsx(g,{value:"file",children:e.jsx(r,{message:"File (Default)"})}),e.jsx(g,{value:"array",children:e.jsx(r,{message:"None"})}),e.jsx(g,{value:"apc",children:"APC"}),e.jsx(g,{value:"memcached",children:"Memcached"}),e.jsx(g,{value:"redis",children:"Redis"})]}),n&&e.jsx("div",{className:"mt-30",children:e.jsx(n,{isInvalid:i})})]})})}function ju({isInvalid:s}){return e.jsxs(e.Fragment,{children:[e.jsx(p,{invalid:s,className:"mb-30",name:"server.memcached_host",label:e.jsx(r,{message:"Memcached host"}),required:!0}),e.jsx(p,{invalid:s,type:"number",name:"server.memcached_port",label:e.jsx(r,{message:"Memcached port"}),required:!0})]})}function fu(){return e.jsxs(ke,{title:e.jsx(r,{message:"Error logging"}),description:e.jsx(r,{message:"Configure site error logging and related 3rd party integrations."}),children:[e.jsx(bu,{}),e.jsx(Je,{className:"mt-30",color:"positive",description:e.jsx(r,{values:{a:s=>e.jsx(nt,{href:"https://sentry.io",children:s})},message:"Sentry integration provides real-time error tracking and helps identify and fix issues when site is in production."})})]})}function bu(){const{clearErrors:s}=F();return e.jsx(fe,{separatorTop:!1,separatorBottom:!1,name:"logging_group",children:t=>e.jsx(p,{onChange:()=>{s()},invalid:t,name:"server.sentry_dsn",type:"url",minLength:30,label:e.jsx(r,{message:"Sentry DSN"})})})}function vu(){return e.jsxs(ke,{title:e.jsx(r,{message:"Queue"}),description:e.jsx(r,{message:"Select active queue method and enter related 3rd party API keys."}),children:[e.jsx(Je,{color:"positive",className:"mb-30",description:e.jsx(r,{message:"Queues allow to defer time consuming tasks, such as sending an email, until a later time. Deferring these tasks can speed up web requests to the application."})}),e.jsx(Je,{color:"warning",className:"mb-30",description:e.jsx(r,{message:"All methods except sync require additional setup, which should be performed before changing the queue method. Consult documentation for more information."})}),e.jsx(yu,{})]})}function yu(){const{watch:s,clearErrors:t}=F(),a=s("server.queue_driver");let n=null;return a==="sqs"&&(n=wu),e.jsx(fe,{separatorTop:!1,separatorBottom:!1,name:"queue_group",children:i=>e.jsxs(e.Fragment,{children:[e.jsxs(U,{invalid:i,onSelectionChange:()=>{t()},selectionMode:"single",name:"server.queue_driver",label:e.jsx(r,{message:"Queue method"}),required:!0,children:[e.jsx(g,{value:"sync",children:e.jsx(r,{message:"Sync (Default)"})}),e.jsx(g,{value:"beanstalkd",children:"Beanstalkd"}),e.jsx(g,{value:"database",children:e.jsx(r,{message:"Database"})}),e.jsx(g,{value:"sqs",children:e.jsx(r,{message:"SQS (Amazon simple queue service)"})}),e.jsx(g,{value:"redis",children:"Redis"})]}),n&&e.jsx("div",{className:"mt-30",children:e.jsx(n,{isInvalid:i})})]})})}function wu({isInvalid:s}){return e.jsxs(e.Fragment,{children:[e.jsx(p,{invalid:s,className:"mb-30",name:"server.sqs_queue_key",label:e.jsx(r,{message:"SQS queue key"}),required:!0}),e.jsx(p,{invalid:s,className:"mb-30",name:"server.sqs_queue_secret",label:e.jsx(r,{message:"SQS queue secret"}),required:!0}),e.jsx(p,{invalid:s,className:"mb-30",name:"server.sqs_queue_prefix",label:e.jsx(r,{message:"SQS queue prefix"}),required:!0}),e.jsx(p,{invalid:s,className:"mb-30",name:"server.sqs_queue_name",label:e.jsx(r,{message:"SQS queue name"}),required:!0}),e.jsx(p,{invalid:s,className:"mb-30",name:"server.sqs_queue_region",label:e.jsx(r,{message:"SQS queue region"}),required:!0})]})}function Su(){const{settings:s}=d.useContext(ds);return e.jsxs(ke,{title:e.jsx(r,{message:"Recaptcha"}),description:e.jsx(r,{message:"Configure google recaptcha integration and credentials."}),children:[(s==null?void 0:s.showRecaptchaLinkSwitch)&&e.jsx(L,{className:"mb-30",name:"client.recaptcha.enable.link_creation",description:e.jsx(r,{message:"Enable recaptcha integration when creating links from homepage or user dashboard."}),children:e.jsx(r,{message:"Link creation"})}),e.jsx(L,{className:"mb-30",name:"client.recaptcha.enable.contact",description:e.jsx(r,{message:'Enable recaptcha integration for "contact us" page.'}),children:e.jsx(r,{message:"Contact page"})}),e.jsx(L,{className:"mb-30",name:"client.recaptcha.enable.register",description:e.jsx(r,{message:"Enable recaptcha integration for registration page."}),children:e.jsx(r,{message:"Registration page"})}),e.jsx(ku,{})]})}function ku(){const{clearErrors:s}=F();return e.jsx(fe,{separatorTop:!1,separatorBottom:!1,name:"recaptcha_group",children:t=>e.jsxs(e.Fragment,{children:[e.jsx(p,{className:"mb-30",onChange:()=>{s()},invalid:t,name:"client.recaptcha.site_key",label:e.jsx(r,{message:"Recaptcha v3 site key"})}),e.jsx(p,{onChange:()=>{s()},invalid:t,name:"client.recaptcha.secret_key",label:e.jsx(r,{message:"Recaptcha v3 secret key"})})]})})}const Nu=$.forwardRef((s,t)=>{const a=Da(t),{fieldProps:n,inputProps:i}=ti({...s,focusRef:a}),l=Pt(s);return e.jsx(ai,{ref:t,fieldClassNames:l,...n,children:e.jsx("input",{type:"file",ref:a,...i,className:v(l.input,"py-8","file:bg-primary file:text-on-primary file:border-none file:rounded file:text-sm file:font-semibold file:px-10 file:h-24 file:mr-10")})})});function Cu({name:s,...t}){const{field:{onChange:a,onBlur:n,ref:i},fieldState:{invalid:l,error:o}}=ys({name:s}),[c,m]=$.useState(""),u={onChange:x=>{var j;a((j=x.target.files)==null?void 0:j[0]),m(x.target.value)},onBlur:n,value:c,invalid:l,errorMessage:o==null?void 0:o.message};return e.jsx(Nu,{ref:i,...ls(u,t)})}function _u(){return e.jsx(ke,{title:e.jsx(r,{message:"Analytics"}),description:e.jsx(r,{message:"Configure google analytics integration and credentials."}),children:e.jsx(Fu,{})})}function Fu(){const{clearErrors:s}=F();return e.jsx(fe,{separatorTop:!1,separatorBottom:!1,name:"analytics_group",children:t=>e.jsxs(d.Fragment,{children:[e.jsx(Cu,{className:"mb-30",onChange:()=>{s()},invalid:t,name:"files.certificate",accept:".json",label:e.jsx(r,{message:"Google service account key file (.json)"})}),e.jsx(p,{className:"mb-30",onChange:()=>{s()},invalid:t,name:"server.analytics_property_id",type:"number",label:e.jsx(r,{message:"Google analytics property ID"})}),e.jsx(p,{className:"mb-30",onChange:()=>{s()},invalid:t,name:"client.analytics.tracking_code",placeholder:"G-******",min:"1",max:"20",description:e.jsx(r,{message:"Google analytics measurement ID only, not the whole javascript snippet."}),label:e.jsx(r,{message:"Google tag manager measurement ID"})}),e.jsx(p,{name:"client.analytics.gchart_api_key",label:e.jsx(r,{message:"Google maps javascript API key"}),description:e.jsx(r,{message:"Only required in order to show world geochart on integrated analytics pages."})})]})})}function zu(s){const t=je();return R({mutationFn:a=>Iu(a),onSuccess:(a,n)=>{O(h("User updated")),D.invalidateQueries({queryKey:["users"]}),t("/admin/users")},onError:a=>Se(a,s)})}function Iu({id:s,...t}){return t.roles&&(t.roles=t.roles.map(a=>a.id)),I.put(`users/${s}`,t).then(a=>a.data)}function ar(){const[s,t]=d.useState(!1),a=d.useRef(),n=d.useCallback(i=>{var l;if(i){const o=new IntersectionObserver(([c])=>t(c.intersectionRatio<1),{threshold:[1]});a.current=o,o.observe(i)}else a.current&&((l=a.current)==null||l.disconnect())},[]);return{isSticky:s,sentinelRef:n}}function Os({onSubmit:s,form:t,title:a,subTitle:n,children:i,actions:l,backButton:o,isLoading:c=!1,disableSaveWhenNotDirty:m=!1,wrapInContainer:u=!0}){const{isSticky:x,sentinelRef:j}=ar(),b=m?Object.keys(t.formState.dirtyFields).length:!0;return e.jsxs(de,{onSubmit:s,onBeforeSubmit:()=>t.clearErrors(),form:t,children:[e.jsx("div",{ref:j}),e.jsx("div",{className:v("sticky top-0 z-10 my-12 transition-shadow md:my-24",x&&"bg shadow"),children:e.jsxs("div",{className:v("flex items-center gap-24 py-14 md:items-start",u&&"container mx-auto px-24"),children:[o,e.jsxs("div",{className:"overflow-hidden overflow-ellipsis md:mr-64",children:[e.jsx("h1",{className:"overflow-hidden overflow-ellipsis whitespace-nowrap text-xl md:text-3xl",children:a}),n&&e.jsx("div",{className:"mt-4",children:n})]}),e.jsx("div",{className:"mr-auto"}),l,e.jsx(f,{variant:"flat",color:"primary",type:"submit",disabled:c||!b,children:e.jsx(r,{message:"Save"})})]})}),e.jsx("div",{className:u?"container mx-auto px-24 pb-24":void 0,children:e.jsx("div",{className:"rounded",children:i})})]})}function nr({onSubmit:s,form:t,title:a,subTitle:n,isLoading:i,avatarManager:l,resendEmailButton:o,children:c}){const{require_email_confirmation:m}=we(),{data:u}=ze(["roles","permissions"]);return e.jsxs(Os,{onSubmit:s,form:t,title:a,subTitle:n,isLoading:i,children:[e.jsxs("div",{className:"mb-40 flex items-start gap-40 md:gap-80",children:[l,e.jsxs("div",{className:"flex-auto",children:[c,e.jsx(p,{className:"mb-30",name:"first_name",label:e.jsx(r,{message:"First name"})}),e.jsx(p,{name:"last_name",label:e.jsx(r,{message:"Last name"})})]})]}),e.jsxs("div",{className:"mb-30 border-b border-t pb-30 pt-30",children:[e.jsx(L,{className:v(o&&"mb-30"),disabled:!m,name:"email_verified_at",description:e.jsx(r,{message:"Whether email address has been confirmed. User will not be able to login until address is confirmed, unless confirmation is disabled from settings page."}),children:e.jsx(r,{message:"Email confirmed"})}),o]}),e.jsx(Is,{className:"mb-30",name:"available_space",label:e.jsx(r,{message:"Allowed storage space"}),description:e.jsx(r,{values:{a:x=>e.jsx(B,{className:Mt,target:"_blank",to:"/admin/settings/uploading",children:x})},message:"Total storage space all user uploads are allowed to take up. If left empty, this value will be inherited from any roles or subscriptions user has, or from 'Available space' setting in Uploading settings page."})}),e.jsx(rt,{className:"mb-30",name:"roles",label:e.jsx(r,{message:"Roles"}),suggestions:u==null?void 0:u.roles,children:x=>e.jsx(g,{value:x.id,children:x.name},x.id)}),e.jsxs("div",{className:"mt-30 border-t pt-30",children:[e.jsx("div",{className:"mb-10 text-sm",children:e.jsx(r,{message:"Permissions"})}),e.jsx(Gt,{name:"permissions"})]})]})}const Au=E([e.jsx("path",{d:"M15.73 3H8.27L3 8.27v7.46L8.27 21h7.46L21 15.73V8.27L15.73 3zM19 14.9 14.9 19H9.1L5 14.9V9.1L9.1 5h5.8L19 9.1v5.8z"},"0"),e.jsx("circle",{cx:"12",cy:"16",r:"1"},"1"),e.jsx("path",{d:"M11 7h2v7h-2z"},"2")],"ReportOutlined");function Eu(){var u,x,j;const s=K(),{require_email_confirmation:t}=we(),{userId:a}=ue(),n=zu(s),i=ni(),{data:l,isLoading:o}=ri(a,{with:["subscriptions","roles","permissions","bans"]}),c=(x=(u=l==null?void 0:l.user.bans)==null?void 0:u[0])==null?void 0:x.comment;if(d.useEffect(()=>{l!=null&&l.user&&!s.getValues().id&&s.reset({first_name:l.user.first_name,last_name:l.user.last_name,roles:l.user.roles,permissions:l.user.permissions,id:l.user.id,email_verified_at:!!l.user.email_verified_at,available_space:l.user.available_space,avatar:l.user.avatar})},[l==null?void 0:l.user,s]),o)return e.jsx(Ze,{});const m=e.jsx(f,{size:"xs",variant:"outline",color:"primary",disabled:!t||i.isPending||((j=l==null?void 0:l.user)==null?void 0:j.email_verified_at)!=null,onClick:()=>{i.mutate({email:l.user.email})},children:e.jsx(r,{message:"Resend email"})});return e.jsx(nr,{onSubmit:b=>{n.mutate(b)},form:s,title:e.jsx(r,{values:{email:l==null?void 0:l.user.email},message:"Edit “:email“"}),subTitle:c&&e.jsxs("div",{className:"flex items-center gap-4 text-sm text-danger",children:[e.jsx(Au,{}),e.jsx("div",{children:e.jsx(r,{message:"Suspended: :reason",values:{reason:c}})})]}),isLoading:n.isPending,avatarManager:e.jsx(Pu,{user:l.user,onChange:()=>{D.invalidateQueries({queryKey:["users"]})}}),resendEmailButton:m,children:e.jsx(p,{className:"mb-30",name:"password",type:"password",label:e.jsx(r,{message:"New password"})})})}function Pu({user:s,onChange:t}){const a=ii({user:s}),n=li({user:s});return e.jsx(Ls,{children:e.jsx(os,{name:"avatar",diskPrefix:"avatars",variant:"avatar",stretchPreview:!0,label:e.jsx(r,{message:"Profile image"}),previewSize:"w-90 h-90",showRemoveButton:!0,onChange:i=>{i?a.mutate({url:i}):n.mutate(),t()}})})}function Tu(s){const t=je();return R({mutationFn:a=>$u(a),onSuccess:()=>{O(h("User created")),D.invalidateQueries({queryKey:Y("users")}),t("/admin/users")},onError:a=>Se(a,s)})}function $u(s){return s.roles&&(s.roles=s.roles.map(t=>t.id)),I.post("users",s).then(t=>t.data)}function Lu(){const s=K(),t=Tu(s),a=e.jsx(Ls,{children:e.jsx(os,{name:"avatar",diskPrefix:"avatars",variant:"avatar",stretchPreview:!0,label:e.jsx(r,{message:"Profile image"}),previewSize:"w-90 h-90",showRemoveButton:!0})});return e.jsxs(nr,{onSubmit:n=>{t.mutate(n)},form:s,title:e.jsx(r,{message:"Add new user"}),isLoading:t.isPending,avatarManager:a,children:[e.jsx(p,{className:"mb-30",name:"email",type:"email",label:e.jsx(r,{message:"Email"})}),e.jsx(p,{className:"mb-30",name:"password",type:"password",label:e.jsx(r,{message:"Password"})})]})}const Mu=E(e.jsx("path",{d:"m12.87 15.07-2.54-2.51.03-.03c1.74-1.94 2.98-4.17 3.71-6.53H17V4h-7V2H8v2H1v1.99h11.17C11.5 7.92 10.44 9.75 9 11.35 8.07 10.32 7.3 9.19 6.69 8h-2c.73 1.63 1.73 3.17 2.98 4.56l-5.09 5.02L4 19l5-5 3.11 3.11.76-2.04zM18.5 10h-2L12 22h2l1.12-3h4.75L21 22h2l-4.5-12zm-2.62 7 1.62-4.33L19.12 17h-3.24z"}),"TranslateOutlined"),rr=s=>{const t=["getLocaleWithLines"];return s!=null&&t.push(s),t};function Du(s){return $e({queryKey:rr(s),queryFn:()=>Ru(s),staleTime:1/0})}function Ru(s){return I.get(`localizations/${s}`).then(t=>t.data)}function Vu({id:s,...t}){return I.put(`localizations/${s}`,t).then(a=>a.data)}function ir(s){return R({mutationFn:t=>Vu(t),onSuccess:()=>{O(h("Localization updated")),D.invalidateQueries({queryKey:Y("localizations")}),D.invalidateQueries({queryKey:rr()})},onError:t=>s?Se(t,s):se(t)})}function Ou({localization:s}){const{trans:t}=M(),{formId:a,close:n}=Q(),i=K({defaultValues:{id:s.id,name:s.name,language:s.language}}),{data:l}=ze(["languages"]),o=(l==null?void 0:l.languages)||[],c=ir(i);return e.jsxs(Z,{children:[e.jsx(ne,{children:e.jsx(r,{message:"Update localization"})}),e.jsx(ee,{children:e.jsxs(de,{form:i,id:a,onSubmit:m=>{c.mutate(m,{onSuccess:n})},children:[e.jsx(p,{name:"name",label:e.jsx(r,{message:"Name"}),className:"mb-30",required:!0}),e.jsx(U,{required:!0,name:"language",label:e.jsx(r,{message:"Language"}),selectionMode:"single",showSearchField:!0,searchPlaceholder:t(h("Search languages")),children:o.map(m=>e.jsx(g,{value:m.code,children:m.name},m.code))})]})}),e.jsxs(xe,{children:[e.jsx(f,{onClick:n,children:e.jsx(r,{message:"Cancel"})}),e.jsx(f,{variant:"flat",color:"primary",type:"submit",form:a,disabled:c.isPending,children:e.jsx(r,{message:"Save"})})]})]})}function qu(s){return I.post("localizations",s).then(t=>t.data)}function Hu(s){const t=Ua();return R({mutationFn:a=>qu(a),onSuccess:()=>{O(h("Localization created")),t.invalidateQueries({queryKey:Y("localizations")})},onError:a=>Se(a,s)})}function Bu(){const{trans:s}=M(),{formId:t,close:a}=Q(),n=K({defaultValues:{language:"en"}}),{data:i}=ze(["languages"]),l=(i==null?void 0:i.languages)||[],o=Hu(n);return e.jsxs(Z,{children:[e.jsx(ne,{children:e.jsx(r,{message:"Create localization"})}),e.jsx(ee,{children:e.jsxs(de,{form:n,id:t,onSubmit:c=>{o.mutate(c,{onSuccess:a})},children:[e.jsx(p,{autoFocus:!0,name:"name",label:e.jsx(r,{message:"Name"}),className:"mb-30",required:!0}),e.jsx(U,{required:!0,name:"language",label:e.jsx(r,{message:"Language"}),selectionMode:"single",showSearchField:!0,searchPlaceholder:s(h("Search languages")),children:l.map(c=>e.jsx(g,{value:c.code,children:c.name},c.code))})]})}),e.jsxs(xe,{children:[e.jsx(f,{onClick:a,children:e.jsx(r,{message:"Cancel"})}),e.jsx(f,{variant:"flat",color:"primary",type:"submit",form:t,disabled:o.isPending,children:e.jsx(r,{message:"Save"})})]})]})}const Uu=""+new URL("around-the-world-df9b11c5.svg",import.meta.url).href,Wu=[{key:"name",allowsSorting:!0,sortingKey:"name",visibleInMode:"all",width:"flex-3 min-w-200",header:()=>e.jsx(r,{message:"Name"}),body:s=>s.name},{key:"language",allowsSorting:!0,sortingKey:"language",header:()=>e.jsx(r,{message:"Language code"}),body:s=>s.language},{key:"updatedAt",allowsSorting:!0,width:"w-100",header:()=>e.jsx(r,{message:"Last updated"}),body:s=>e.jsx(ve,{date:s.updated_at})},{key:"actions",header:()=>e.jsx(r,{message:"Actions"}),hideHeader:!0,align:"end",width:"w-84 flex-shrink-0",visibleInMode:"all",body:s=>e.jsxs("div",{className:"text-muted",children:[e.jsx(B,{to:`${s.id}/translate`,children:e.jsx(G,{label:e.jsx(r,{message:"Translate"}),children:e.jsx(k,{size:"md",children:e.jsx(Mu,{})})})}),e.jsxs(P,{type:"modal",children:[e.jsx(G,{label:e.jsx(r,{message:"Edit"}),children:e.jsx(k,{children:e.jsx(He,{})})}),e.jsx(Ou,{localization:s})]})]})}];function Ku(){return e.jsx(Ee,{endpoint:"localizations",title:e.jsx(r,{message:"Localizations"}),columns:Wu,actions:e.jsx(Gu,{}),selectedActions:e.jsx(ms,{}),emptyStateMessage:e.jsx(ye,{image:Uu,title:e.jsx(r,{message:"No localizations have been created yet"}),filteringTitle:e.jsx(r,{message:"No matching localizations"})})})}function Gu(){return e.jsx(d.Fragment,{children:e.jsxs(P,{type:"modal",children:[e.jsx(Me,{children:e.jsx(r,{message:"Add new localization"})}),e.jsx(Bu,{})]})})}function Qu(){const{formId:s,close:t}=Q(),a=K();return e.jsxs(Z,{children:[e.jsx(ne,{children:e.jsx(r,{message:"Add translation"})}),e.jsx(ee,{children:e.jsxs(de,{form:a,id:s,onSubmit:n=>{t(n)},children:[e.jsx(Je,{className:"mb-30",title:e.jsx(r,{message:"Add a new translation, if it does not exist already."}),description:e.jsx(r,{message:"This should only need to be done for things like custom menu items."})}),e.jsx(p,{inputElementType:"textarea",rows:2,autoFocus:!0,name:"key",label:e.jsx(r,{message:"Translation key"}),className:"mb-30",required:!0}),e.jsx(p,{inputElementType:"textarea",rows:2,name:"value",label:e.jsx(r,{message:"Translation value"}),required:!0})]})}),e.jsxs(xe,{children:[e.jsx(f,{onClick:t,children:e.jsx(r,{message:"Cancel"})}),e.jsx(f,{variant:"flat",color:"primary",type:"submit",form:s,children:e.jsx(r,{message:"Add"})})]})]})}function Ju(){const{localeId:s}=ue(),{data:t,isLoading:a}=Du(s),n=t==null?void 0:t.localization;return a||!n?e.jsx(Ze,{}):e.jsx(Yu,{localization:n})}function Yu({localization:s}){const[t,a]=d.useState(s.lines||{}),n=je(),i=ir(),[l,o]=d.useState("");return e.jsxs("form",{className:"p-14 md:p-24 flex flex-col h-full",onSubmit:c=>{c.preventDefault(),i.mutate({id:s.id,lines:t},{onSuccess:()=>{n("/admin/localizations")}})},children:[e.jsx(Zu,{localization:s,setLines:a,lines:t,searchQuery:l,setSearchQuery:o,isLoading:i.isPending}),e.jsx(Xu,{lines:t,setLines:a,searchQuery:l})]})}function Zu({localization:s,searchQuery:t,setSearchQuery:a,isLoading:n,lines:i,setLines:l}){const o=je(),c=Le(),{trans:m}=M();return e.jsxs("div",{className:"flex-shrink-0",children:[e.jsxs(al,{size:"lg",className:"mb-16",children:[e.jsx(ca,{onSelected:()=>{o("/admin/localizations")},children:e.jsx(r,{message:"Localizations"})}),e.jsx(ca,{children:e.jsx(r,{message:":locale translations",values:{locale:s.name}})})]}),e.jsxs("div",{className:"mb-24 flex items-center gap-32 md:gap-12",children:[e.jsx("div",{className:"max-w-440 flex-auto",children:e.jsx(Ye,{value:t,onChange:u=>a(u.target.value),startAdornment:e.jsx(Zs,{}),placeholder:m({message:"Type to search..."})})}),e.jsxs(P,{type:"modal",onClose:u=>{if(u){const x={...i};x[u.key]=u.value,l(x)}},children:[!c&&e.jsx(f,{className:"ml-auto",variant:"outline",color:"primary",startIcon:e.jsx(_e,{}),children:e.jsx(r,{message:"Add new"})}),e.jsx(Qu,{})]}),e.jsx(f,{variant:"flat",color:"primary",type:"submit",disabled:n,children:c?e.jsx(r,{message:"Save"}):e.jsx(r,{message:"Save translations"})})]})]})}function Xu({searchQuery:s,lines:t,setLines:a}){const n=d.useMemo(()=>Object.entries(t).filter(([o,c])=>{const m=s==null?void 0:s.toLowerCase();return!m||(o==null?void 0:o.toLowerCase().includes(m))||(c==null?void 0:c.toLowerCase().includes(m))}),[t,s]),i=d.useRef(null),l=Ki({count:n.length,getScrollElement:()=>i.current,estimateSize:()=>123});return e.jsx("div",{className:"flex-auto overflow-y-auto",ref:i,children:e.jsx("div",{className:"relative w-full",style:{height:`${l.getTotalSize()}px`},children:l.getVirtualItems().map(o=>{const[c,m]=n[o.index];return e.jsx("div",{className:"w-full absolute top-0 left-0",style:{height:`${o.size}px`,transform:`translateY(${o.start}px)`},children:e.jsxs("div",{className:"rounded border mb-10 md:mr-10",children:[e.jsxs("div",{className:"flex items-center gap-24 justify-between px-10 py-2 border-b",children:[e.jsx("label",{className:"text-xs font-semibold flex-auto",htmlFor:c,children:c}),e.jsx(k,{size:"xs",className:"text-muted",onClick:()=>{const u={...t};delete u[c],a(u)},children:e.jsx(qe,{})})]}),e.jsx("div",{children:e.jsx("textarea",{id:c,name:c,defaultValue:m,className:"w-full bg-inherit block rounded resize-none outline-none focus-visible:ring-2 p-10 text-sm",rows:2,onChange:u=>{const x={...t};x[c]=u.target.value,a(x)}})})]})},c)})})})}function em(s){const{close:t}=Q(),{image:a,images:n}=s,[i,l]=Ts(s.activeIndex,s.defaultActiveIndex,s.onActiveIndexChange),o=a||(n==null?void 0:n[i]);return e.jsx(Z,{size:"fullscreenTakeover",background:"bg-black/80",children:e.jsxs(ee,{padding:"p-0",className:"h-full w-full",children:[e.jsx(k,{size:"lg",color:"paper",className:"absolute right-0 top-0 z-20 text-white",onClick:()=>{t()},children:e.jsx(qe,{})}),e.jsxs("div",{className:"relative flex h-full w-full items-center justify-center p-40",children:[n!=null&&n.length?e.jsx(k,{size:"lg",color:"white",variant:"flat",className:"absolute bottom-0 left-20 top-0 my-auto",disabled:i<1,onClick:()=>{l(i-1)},children:e.jsx(Ys,{})}):null,e.jsx("img",{src:o,alt:"",className:"max-h-full w-auto object-contain shadow"}),n!=null&&n.length?e.jsx(k,{size:"lg",color:"white",variant:"flat",className:"absolute bottom-0 right-20 top-0 my-auto",disabled:i+1===(n==null?void 0:n.length),onClick:()=>{l(i+1)},children:e.jsx(Ds,{})}):null]})]})})}function sm(){var t;const s=Rs();return e.jsxs("div",{className:"container mx-auto p-12 md:p-24",children:[e.jsx(Xs,{children:e.jsx(r,{message:"Ads"})}),e.jsx("h1",{className:"mb-20 text-2xl font-light md:mb-40 md:text-3xl",children:e.jsx(r,{message:"Predefined Ad slots"})}),s.isLoading?e.jsx(Ms,{isIndeterminate:!0}):e.jsx(tm,{defaultValues:((t=s.data)==null?void 0:t.client.ads)||{}})]})}function tm({defaultValues:s}){const{admin:{ads:t}}=d.useContext(ds),a=K({defaultValues:{client:{ads:s}}}),n=sr(a);return e.jsxs(de,{form:a,onSubmit:i=>{n.mutate(i)},children:[t.map(i=>e.jsx(am,{adConfig:i},i.slot)),e.jsx(L,{name:"client.ads.disable",className:"mb-30",description:e.jsx(r,{message:"Disable all add related functionality across the site."}),children:e.jsx(r,{message:"Disable ads"})}),e.jsx(f,{type:"submit",variant:"flat",color:"primary",disabled:n.isPending,children:e.jsx(r,{message:"Save"})})]})}function am({adConfig:s}){return e.jsxs("div",{className:"flex items-center gap-24",children:[e.jsx(p,{className:"mb-30 flex-auto",name:`client.${s.slot}`,inputElementType:"textarea",rows:8,label:e.jsx(r,{...s.description})}),e.jsxs(P,{type:"modal",children:[e.jsx("button",{type:"button",className:"cursor-zoom-in overflow-hidden rounded outline-none transition hover:scale-105 focus-visible:ring max-md:hidden",children:e.jsx("img",{src:s.image,className:"h-[186px] w-auto border",alt:"Ad slot example"})}),e.jsx(em,{image:s.image})]})]})}function nm(){const s=xs(a=>{var n;return(n=a.config)==null?void 0:n.sections}),t=d.useMemo(()=>s?Object.entries(s||[]).map(([a,n])=>({...n,key:a})).sort((a,n)=>((a==null?void 0:a.position)||1)-((n==null?void 0:n.position)||1)):[],[s]);return e.jsx(d.Fragment,{children:t.map(a=>e.jsx(pe,{to:a.key,elementType:Lt,children:e.jsx(r,{...a.label})},a.key))})}const rm=[{key:"type",label:h("Type"),description:h("Type of the role"),defaultOperator:ie.ne,control:{type:oe.Select,defaultValue:"01",options:[{key:"01",label:h("Sitewide"),value:"sitewide"},{key:"02",label:h("Workspace"),value:"workspace"}]}},us({description:h("Date role was created")}),ks({description:h("Date role was last updated")})],im=[{key:"name",allowsSorting:!0,visibleInMode:"all",header:()=>e.jsx(r,{message:"Role"}),body:s=>e.jsxs("div",{children:[e.jsx("div",{children:e.jsx(r,{message:s.name})}),e.jsx("div",{className:"text-muted text-xs overflow-x-hidden overflow-ellipsis",children:s.description?e.jsx(r,{message:s.description}):void 0})]})},{key:"type",maxWidth:"max-w-100",allowsSorting:!0,header:()=>e.jsx(r,{message:"Type"}),body:s=>e.jsx(r,{message:s.type})},{key:"updated_at",maxWidth:"max-w-100",allowsSorting:!0,header:()=>e.jsx(r,{message:"Last updated"}),body:s=>e.jsx(ve,{date:s.updated_at})},{key:"actions",header:()=>e.jsx(r,{message:"Actions"}),hideHeader:!0,visibleInMode:"all",align:"end",width:"w-42 flex-shrink-0",body:s=>e.jsx(B,{to:`${s.id}/edit`,children:e.jsx(k,{size:"md",className:"text-muted",children:e.jsx(He,{})})})}];function lm(){return e.jsx(Ee,{endpoint:"roles",title:e.jsx(r,{message:"Roles"}),columns:im,filters:rm,actions:e.jsx(om,{}),selectedActions:e.jsx(ms,{}),emptyStateMessage:e.jsx(ye,{image:As,title:e.jsx(r,{message:"No roles have been created yet"}),filteringTitle:e.jsx(r,{message:"No matching roles"})})})}function om(){return e.jsxs(d.Fragment,{children:[e.jsx(tn,{endpoint:"roles/csv/export"}),e.jsx(Me,{elementType:B,to:"new",children:e.jsx(r,{message:"Add new role"})})]})}const lr=s=>`roles/${s}`;function cm(){const{roleId:s}=ue();return $e({queryKey:[lr(s)],queryFn:()=>dm(s)})}function dm(s){return I.get(lr(s)).then(t=>t.data)}const or=s=>`roles/${s}`;function um(){const{trans:s}=M(),t=je();return R({mutationFn:a=>mm(a),onSuccess:a=>{O(s(h("Role updated"))),D.invalidateQueries({queryKey:[or(a.role.id)]}),D.invalidateQueries({queryKey:Y("roles")}),t("/admin/roles")},onError:a=>se(a)})}function mm({id:s,...t}){return I.put(or(s),t).then(a=>a.data)}function cr({isInternal:s=!1}){const{trans:t}=M(),{workspaces:a}=we(),{watch:n}=F(),i=n("type");return e.jsxs(e.Fragment,{children:[e.jsx(p,{label:e.jsx(r,{message:"Name"}),name:"name",className:"mb-20",required:!0}),e.jsx(p,{label:e.jsx(r,{message:"Description"}),name:"description",inputElementType:"textarea",placeholder:t(h("Role description...")),rows:4,className:"mb-20"}),a.integrated&&e.jsxs(U,{label:e.jsx(r,{message:"Type"}),name:"type",selectionMode:"single",className:"mb-20",description:e.jsx(r,{message:"Whether this role will be assigned to users globally on the site or only within workspaces."}),children:[e.jsx(g,{value:"sitewide",children:e.jsx(r,{message:"Sitewide"})}),e.jsx(g,{value:"workspace",children:e.jsx(r,{message:"Workspace"})})]}),!s&&e.jsxs(e.Fragment,{children:[e.jsx(L,{name:"default",className:"mb-20",description:e.jsx(r,{message:"Assign this role to new users automatically."}),children:e.jsx(r,{message:"Default"})}),i==="sitewide"&&e.jsx(L,{name:"guests",description:e.jsx(r,{message:"Assign this role to guests (not logged in users)."}),children:e.jsx(r,{message:"Guests"})})]}),e.jsx("h2",{className:"mb-10 mt-30 text-lg",children:e.jsx(r,{message:"Permissions"})}),e.jsx(Gt,{name:"permissions",valueListKey:i==="sitewide"?"permissions":"workspacePermissions"})]})}function hm({onUserSelected:s}){var u;const{close:t}=Q(),[a,n]=d.useState(""),{trans:i}=M(),l=Gi("normalized-models/user",{query:a,perPage:14}),o=((u=l.data)==null?void 0:u.results)||[],c=e.jsx(et,{className:"pt-20",size:"sm",title:e.jsx(r,{message:"No matching users"}),description:e.jsx(r,{message:"Try another search query"}),image:e.jsx(st,{src:As})}),m=x=>{t(),s(x)};return e.jsxs(Z,{children:[e.jsx(ne,{children:e.jsx(r,{message:"Select a user"})}),e.jsxs(ee,{children:[e.jsx(Ye,{autoFocus:!0,className:"mb-20",startAdornment:e.jsx(Zs,{}),placeholder:i(h("Search for user by name or email")),value:a,onChange:x=>{n(x.target.value)}}),!l.isLoading&&!o.length&&c,e.jsx("div",{className:"grid grid-cols-2 gap-x-10",children:o.map(x=>e.jsx(xm,{user:x,onUserSelected:m},x.id))})]})]})}function xm({user:s,onUserSelected:t}){return e.jsxs("div",{className:"flex items-center gap-10 rounded p-10 outline-none ring-offset-4 hover:bg-hover focus-visible:ring",role:"button",tabIndex:0,onClick:()=>{t(s)},onKeyDown:a=>{(a.key==="Enter"||a.key===" ")&&(a.preventDefault(),t(s))},children:[e.jsx(Ja,{src:s.image}),e.jsxs("div",{className:"overflow-hidden",children:[e.jsx("div",{className:"overflow-hidden text-ellipsis",children:s.name}),e.jsx("div",{className:"overflow-hidden text-ellipsis text-muted",children:s.description})]})]},s.id)}function gm(s){return R({mutationFn:({userIds:t})=>pm({userIds:t,roleId:s.id}),onSuccess:(t,a)=>{O(h("Removed [one 1 user|other :count users] from “{role}“",{values:{count:a.userIds.length,role:s.name}}))},onError:t=>se(t)})}function pm({roleId:s,userIds:t}){return I.post(`roles/${s}/remove-users`,{userIds:t}).then(a=>a.data)}function jm(s){return R({mutationFn:({userIds:t})=>fm({userIds:t,roleId:s.id}),onSuccess:(t,a)=>{O(h("Assigned [one 1 user|other :count users] to {role}",{values:{count:a.userIds.length,role:s.name}}))},onError:t=>se(t)})}function fm({roleId:s,userIds:t}){return I.post(`roles/${s}/add-users`,{userIds:t}).then(a=>a.data)}const dr={key:"name",allowsSorting:!0,sortingKey:"email",header:()=>e.jsx(r,{message:"User"}),body:s=>e.jsx(es,{image:s.avatar,label:s.display_name,description:s.email}),width:"col-w-3"},bm=[dr,{key:"first_name",allowsSorting:!0,header:()=>e.jsx(r,{message:"First name"}),body:s=>s.first_name},{key:"last_name",allowsSorting:!0,header:()=>e.jsx(r,{message:"Last name"}),body:s=>s.last_name},{key:"created_at",allowsSorting:!0,header:()=>e.jsx(r,{message:"Assigned at"}),body:s=>e.jsx(ve,{date:s.created_at})}],vm=[dr];function ym({role:s}){const t=Le();return s.guests||s.type==="workspace"?e.jsx("div",{className:"pt-30 pb-10",children:e.jsx(ye,{image:As,title:e.jsx(r,{message:"Users can't be assigned to this role"})})}):e.jsx(sn,{endpoint:"users",columns:t?vm:bm,queryParams:{roleId:`${s.id}`},actions:e.jsx(wm,{role:s}),selectedActions:e.jsx(Sm,{role:s}),emptyStateMessage:e.jsx(ye,{image:As,title:e.jsx(r,{message:"No users have been assigned to this role yet"}),filteringTitle:e.jsx(r,{message:"No matching users"})})})}function wm({role:s}){const t=jm(s);return e.jsxs(P,{type:"modal",children:[e.jsx(f,{variant:"flat",color:"primary",disabled:t.isPending,children:e.jsx(r,{message:"Assign user"})}),e.jsx(hm,{onUserSelected:a=>{t.mutate({userIds:[a.id]},{onSuccess:()=>{D.invalidateQueries({queryKey:Y("users",{roleId:`${s.id}`})})}})}})]})}function Sm({role:s}){const t=gm(s),{selectedRows:a}=lt();return e.jsxs(P,{type:"modal",onClose:n=>{n&&t.mutate({userIds:a},{onSuccess:()=>{D.invalidateQueries({queryKey:Y("users",{roleId:`${s.id}`})})}})},children:[e.jsx(f,{variant:"flat",color:"danger",disabled:t.isPending,children:e.jsx(r,{message:"Remove users"})}),e.jsx(Fe,{title:e.jsx(r,{message:"Remove [one 1 user|other :count users] from “:name“ role?",values:{count:a.length,name:s.name}}),body:e.jsx(r,{message:"This will permanently remove the users."}),confirm:e.jsx(r,{message:"Remove"}),isDanger:!0})]})}function km(){const s=cm();return s.status!=="success"?e.jsx(Ze,{}):e.jsx(Nm,{role:s.data.role})}function Nm({role:s}){const t=K({defaultValues:s}),a=um();return e.jsx(Os,{form:t,onSubmit:n=>{a.mutate(n)},title:e.jsx(r,{message:"Edit “:name“ role",values:{name:s.name}}),isLoading:a.isPending,children:e.jsxs(Zt,{isLazy:!0,children:[e.jsxs(Xt,{children:[e.jsx(is,{children:e.jsx(r,{message:"Settings"})}),e.jsx(is,{children:e.jsx(r,{message:"Users"})})]}),e.jsxs(tr,{className:"pt-20",children:[e.jsx(Qs,{children:e.jsx(cr,{isInternal:s.internal})}),e.jsx(Qs,{children:e.jsx(ym,{role:s})})]})]})})}const Cm="roles";function _m(s){const{trans:t}=M();return R({mutationFn:a=>Fm(a),onSuccess:()=>{O(t(h("Created new role"))),D.invalidateQueries({queryKey:Y("roles")})},onError:a=>Se(a,s)})}function Fm({id:s,...t}){return I.post(Cm,t).then(a=>a.data)}function zm(){const s=K({defaultValues:{type:"sitewide"}}),t=_m(s),a=je();return e.jsx(Os,{form:s,onSubmit:n=>{t.mutate(n,{onSuccess:i=>{a(`/admin/roles/${i.role.id}/edit`)}})},title:e.jsx(r,{message:"Add new role"}),isLoading:t.isPending,children:e.jsx(cr,{})})}const Im=s=>[{key:"type",label:h("Type"),description:h("Type of the tag"),defaultOperator:ie.ne,control:{type:oe.Select,defaultValue:s[0].name,options:s.map(t=>({key:t.name,label:h(t.name),value:t.name}))}},us({description:h("Date tag was created")}),ks({description:h("Date tag was last updated")})],ur=""+new URL("software-engineer-ba026106.svg",import.meta.url).href;function mr({form:s,onSubmit:t,formId:a}){const{tags:{types:n}}=d.useContext(ds),i=s.watch("type"),l=!!n.find(o=>o.name===i&&o.system);return e.jsxs(de,{id:a,form:s,onSubmit:t,children:[e.jsx(p,{name:"name",label:e.jsx(r,{message:"Name"}),description:e.jsx(r,{message:"Unique tag identifier."}),className:"mb-20",required:!0,autoFocus:!0}),e.jsx(p,{name:"display_name",label:e.jsx(r,{message:"Display name"}),description:e.jsx(r,{message:"User friendly tag name."}),className:"mb-20"}),e.jsx(U,{label:e.jsx(r,{message:"Type"}),name:"type",selectionMode:"single",disabled:l,children:n.filter(o=>!o.system).map(o=>e.jsx(g,{value:o.name,children:e.jsx(r,{message:o.name})},o.name))})]})}var hr={exports:{}};(function(s,t){(function(a,n,i){s.exports=i(),s.exports.default=i()})("slugify",oi,function(){var a=JSON.parse(`{"$":"dollar","%":"percent","&":"and","<":"less",">":"greater","|":"or","¢":"cent","£":"pound","¤":"currency","¥":"yen","©":"(c)","ª":"a","®":"(r)","º":"o","À":"A","Á":"A","Â":"A","Ã":"A","Ä":"A","Å":"A","Æ":"AE","Ç":"C","È":"E","É":"E","Ê":"E","Ë":"E","Ì":"I","Í":"I","Î":"I","Ï":"I","Ð":"D","Ñ":"N","Ò":"O","Ó":"O","Ô":"O","Õ":"O","Ö":"O","Ø":"O","Ù":"U","Ú":"U","Û":"U","Ü":"U","Ý":"Y","Þ":"TH","ß":"ss","à":"a","á":"a","â":"a","ã":"a","ä":"a","å":"a","æ":"ae","ç":"c","è":"e","é":"e","ê":"e","ë":"e","ì":"i","í":"i","î":"i","ï":"i","ð":"d","ñ":"n","ò":"o","ó":"o","ô":"o","õ":"o","ö":"o","ø":"o","ù":"u","ú":"u","û":"u","ü":"u","ý":"y","þ":"th","ÿ":"y","Ā":"A","ā":"a","Ă":"A","ă":"a","Ą":"A","ą":"a","Ć":"C","ć":"c","Č":"C","č":"c","Ď":"D","ď":"d","Đ":"DJ","đ":"dj","Ē":"E","ē":"e","Ė":"E","ė":"e","Ę":"e","ę":"e","Ě":"E","ě":"e","Ğ":"G","ğ":"g","Ģ":"G","ģ":"g","Ĩ":"I","ĩ":"i","Ī":"i","ī":"i","Į":"I","į":"i","İ":"I","ı":"i","Ķ":"k","ķ":"k","Ļ":"L","ļ":"l","Ľ":"L","ľ":"l","Ł":"L","ł":"l","Ń":"N","ń":"n","Ņ":"N","ņ":"n","Ň":"N","ň":"n","Ō":"O","ō":"o","Ő":"O","ő":"o","Œ":"OE","œ":"oe","Ŕ":"R","ŕ":"r","Ř":"R","ř":"r","Ś":"S","ś":"s","Ş":"S","ş":"s","Š":"S","š":"s","Ţ":"T","ţ":"t","Ť":"T","ť":"t","Ũ":"U","ũ":"u","Ū":"u","ū":"u","Ů":"U","ů":"u","Ű":"U","ű":"u","Ų":"U","ų":"u","Ŵ":"W","ŵ":"w","Ŷ":"Y","ŷ":"y","Ÿ":"Y","Ź":"Z","ź":"z","Ż":"Z","ż":"z","Ž":"Z","ž":"z","Ə":"E","ƒ":"f","Ơ":"O","ơ":"o","Ư":"U","ư":"u","Lj":"LJ","lj":"lj","Nj":"NJ","nj":"nj","Ș":"S","ș":"s","Ț":"T","ț":"t","ə":"e","˚":"o","Ά":"A","Έ":"E","Ή":"H","Ί":"I","Ό":"O","Ύ":"Y","Ώ":"W","ΐ":"i","Α":"A","Β":"B","Γ":"G","Δ":"D","Ε":"E","Ζ":"Z","Η":"H","Θ":"8","Ι":"I","Κ":"K","Λ":"L","Μ":"M","Ν":"N","Ξ":"3","Ο":"O","Π":"P","Ρ":"R","Σ":"S","Τ":"T","Υ":"Y","Φ":"F","Χ":"X","Ψ":"PS","Ω":"W","Ϊ":"I","Ϋ":"Y","ά":"a","έ":"e","ή":"h","ί":"i","ΰ":"y","α":"a","β":"b","γ":"g","δ":"d","ε":"e","ζ":"z","η":"h","θ":"8","ι":"i","κ":"k","λ":"l","μ":"m","ν":"n","ξ":"3","ο":"o","π":"p","ρ":"r","ς":"s","σ":"s","τ":"t","υ":"y","φ":"f","χ":"x","ψ":"ps","ω":"w","ϊ":"i","ϋ":"y","ό":"o","ύ":"y","ώ":"w","Ё":"Yo","Ђ":"DJ","Є":"Ye","І":"I","Ї":"Yi","Ј":"J","Љ":"LJ","Њ":"NJ","Ћ":"C","Џ":"DZ","А":"A","Б":"B","В":"V","Г":"G","Д":"D","Е":"E","Ж":"Zh","З":"Z","И":"I","Й":"J","К":"K","Л":"L","М":"M","Н":"N","О":"O","П":"P","Р":"R","С":"S","Т":"T","У":"U","Ф":"F","Х":"H","Ц":"C","Ч":"Ch","Ш":"Sh","Щ":"Sh","Ъ":"U","Ы":"Y","Ь":"","Э":"E","Ю":"Yu","Я":"Ya","а":"a","б":"b","в":"v","г":"g","д":"d","е":"e","ж":"zh","з":"z","и":"i","й":"j","к":"k","л":"l","м":"m","н":"n","о":"o","п":"p","р":"r","с":"s","т":"t","у":"u","ф":"f","х":"h","ц":"c","ч":"ch","ш":"sh","щ":"sh","ъ":"u","ы":"y","ь":"","э":"e","ю":"yu","я":"ya","ё":"yo","ђ":"dj","є":"ye","і":"i","ї":"yi","ј":"j","љ":"lj","њ":"nj","ћ":"c","ѝ":"u","џ":"dz","Ґ":"G","ґ":"g","Ғ":"GH","ғ":"gh","Қ":"KH","қ":"kh","Ң":"NG","ң":"ng","Ү":"UE","ү":"ue","Ұ":"U","ұ":"u","Һ":"H","һ":"h","Ә":"AE","ә":"ae","Ө":"OE","ө":"oe","Ա":"A","Բ":"B","Գ":"G","Դ":"D","Ե":"E","Զ":"Z","Է":"E'","Ը":"Y'","Թ":"T'","Ժ":"JH","Ի":"I","Լ":"L","Խ":"X","Ծ":"C'","Կ":"K","Հ":"H","Ձ":"D'","Ղ":"GH","Ճ":"TW","Մ":"M","Յ":"Y","Ն":"N","Շ":"SH","Չ":"CH","Պ":"P","Ջ":"J","Ռ":"R'","Ս":"S","Վ":"V","Տ":"T","Ր":"R","Ց":"C","Փ":"P'","Ք":"Q'","Օ":"O''","Ֆ":"F","և":"EV","ء":"a","آ":"aa","أ":"a","ؤ":"u","إ":"i","ئ":"e","ا":"a","ب":"b","ة":"h","ت":"t","ث":"th","ج":"j","ح":"h","خ":"kh","د":"d","ذ":"th","ر":"r","ز":"z","س":"s","ش":"sh","ص":"s","ض":"dh","ط":"t","ظ":"z","ع":"a","غ":"gh","ف":"f","ق":"q","ك":"k","ل":"l","م":"m","ن":"n","ه":"h","و":"w","ى":"a","ي":"y","ً":"an","ٌ":"on","ٍ":"en","َ":"a","ُ":"u","ِ":"e","ْ":"","٠":"0","١":"1","٢":"2","٣":"3","٤":"4","٥":"5","٦":"6","٧":"7","٨":"8","٩":"9","پ":"p","چ":"ch","ژ":"zh","ک":"k","گ":"g","ی":"y","۰":"0","۱":"1","۲":"2","۳":"3","۴":"4","۵":"5","۶":"6","۷":"7","۸":"8","۹":"9","฿":"baht","ა":"a","ბ":"b","გ":"g","დ":"d","ე":"e","ვ":"v","ზ":"z","თ":"t","ი":"i","კ":"k","ლ":"l","მ":"m","ნ":"n","ო":"o","პ":"p","ჟ":"zh","რ":"r","ს":"s","ტ":"t","უ":"u","ფ":"f","ქ":"k","ღ":"gh","ყ":"q","შ":"sh","ჩ":"ch","ც":"ts","ძ":"dz","წ":"ts","ჭ":"ch","ხ":"kh","ჯ":"j","ჰ":"h","Ṣ":"S","ṣ":"s","Ẁ":"W","ẁ":"w","Ẃ":"W","ẃ":"w","Ẅ":"W","ẅ":"w","ẞ":"SS","Ạ":"A","ạ":"a","Ả":"A","ả":"a","Ấ":"A","ấ":"a","Ầ":"A","ầ":"a","Ẩ":"A","ẩ":"a","Ẫ":"A","ẫ":"a","Ậ":"A","ậ":"a","Ắ":"A","ắ":"a","Ằ":"A","ằ":"a","Ẳ":"A","ẳ":"a","Ẵ":"A","ẵ":"a","Ặ":"A","ặ":"a","Ẹ":"E","ẹ":"e","Ẻ":"E","ẻ":"e","Ẽ":"E","ẽ":"e","Ế":"E","ế":"e","Ề":"E","ề":"e","Ể":"E","ể":"e","Ễ":"E","ễ":"e","Ệ":"E","ệ":"e","Ỉ":"I","ỉ":"i","Ị":"I","ị":"i","Ọ":"O","ọ":"o","Ỏ":"O","ỏ":"o","Ố":"O","ố":"o","Ồ":"O","ồ":"o","Ổ":"O","ổ":"o","Ỗ":"O","ỗ":"o","Ộ":"O","ộ":"o","Ớ":"O","ớ":"o","Ờ":"O","ờ":"o","Ở":"O","ở":"o","Ỡ":"O","ỡ":"o","Ợ":"O","ợ":"o","Ụ":"U","ụ":"u","Ủ":"U","ủ":"u","Ứ":"U","ứ":"u","Ừ":"U","ừ":"u","Ử":"U","ử":"u","Ữ":"U","ữ":"u","Ự":"U","ự":"u","Ỳ":"Y","ỳ":"y","Ỵ":"Y","ỵ":"y","Ỷ":"Y","ỷ":"y","Ỹ":"Y","ỹ":"y","–":"-","‘":"'","’":"'","“":"\\"","”":"\\"","„":"\\"","†":"+","•":"*","…":"...","₠":"ecu","₢":"cruzeiro","₣":"french franc","₤":"lira","₥":"mill","₦":"naira","₧":"peseta","₨":"rupee","₩":"won","₪":"new shequel","₫":"dong","€":"euro","₭":"kip","₮":"tugrik","₯":"drachma","₰":"penny","₱":"peso","₲":"guarani","₳":"austral","₴":"hryvnia","₵":"cedi","₸":"kazakhstani tenge","₹":"indian rupee","₺":"turkish lira","₽":"russian ruble","₿":"bitcoin","℠":"sm","™":"tm","∂":"d","∆":"delta","∑":"sum","∞":"infinity","♥":"love","元":"yuan","円":"yen","﷼":"rial","ﻵ":"laa","ﻷ":"laa","ﻹ":"lai","ﻻ":"la"}`),n=JSON.parse('{"bg":{"Й":"Y","Ц":"Ts","Щ":"Sht","Ъ":"A","Ь":"Y","й":"y","ц":"ts","щ":"sht","ъ":"a","ь":"y"},"de":{"Ä":"AE","ä":"ae","Ö":"OE","ö":"oe","Ü":"UE","ü":"ue","ß":"ss","%":"prozent","&":"und","|":"oder","∑":"summe","∞":"unendlich","♥":"liebe"},"es":{"%":"por ciento","&":"y","<":"menor que",">":"mayor que","|":"o","¢":"centavos","£":"libras","¤":"moneda","₣":"francos","∑":"suma","∞":"infinito","♥":"amor"},"fr":{"%":"pourcent","&":"et","<":"plus petit",">":"plus grand","|":"ou","¢":"centime","£":"livre","¤":"devise","₣":"franc","∑":"somme","∞":"infini","♥":"amour"},"pt":{"%":"porcento","&":"e","<":"menor",">":"maior","|":"ou","¢":"centavo","∑":"soma","£":"libra","∞":"infinito","♥":"amor"},"uk":{"И":"Y","и":"y","Й":"Y","й":"y","Ц":"Ts","ц":"ts","Х":"Kh","х":"kh","Щ":"Shch","щ":"shch","Г":"H","г":"h"},"vi":{"Đ":"D","đ":"d"},"da":{"Ø":"OE","ø":"oe","Å":"AA","å":"aa","%":"procent","&":"og","|":"eller","$":"dollar","<":"mindre end",">":"større end"},"nb":{"&":"og","Å":"AA","Æ":"AE","Ø":"OE","å":"aa","æ":"ae","ø":"oe"},"it":{"&":"e"},"nl":{"&":"en"},"sv":{"&":"och","Å":"AA","Ä":"AE","Ö":"OE","å":"aa","ä":"ae","ö":"oe"}}');function i(l,o){if(typeof l!="string")throw new Error("slugify: string argument expected");o=typeof o=="string"?{replacement:o}:o||{};var c=n[o.locale]||{},m=o.replacement===void 0?"-":o.replacement,u=o.trim===void 0?!0:o.trim,x=l.normalize().split("").reduce(function(j,b){var y=c[b];return y===void 0&&(y=a[b]),y===void 0&&(y=b),y===m&&(y=" "),j+y.replace(o.remove||/[^\w\s$*_+~.()'"!\-:@]+/g,"")},"");return o.strict&&(x=x.replace(/[^A-Za-z0-9\s]/g,"")),u&&(x=x.trim()),x=x.replace(/\s+/g,m),o.lower&&(x=x.toLowerCase()),x}return i.extend=function(l){Object.assign(a,l)},i})})(hr);var Am=hr.exports;const Em=ci(Am);function sa(s,t="-",a=!1){if(!s)return s;let n=Em(s,{lower:!0,replacement:t,strict:a,remove:/[*+~.()'"!:@?\|/\\#]/g});return n||(n=s.replace(/\s+/g,"-").toLowerCase()),n}function Pm(s){const{trans:t}=M();return R({mutationFn:a=>Tm(a),onSuccess:()=>{O(t(h("Tag created"))),D.invalidateQueries({queryKey:Y("tags")})},onError:a=>Se(a,s)})}function Tm(s){return s.name=sa(s.name),I.post("tags",s).then(t=>t.data)}function $m(){const{close:s,formId:t}=Q(),{tags:{types:a}}=d.useContext(ds),n=K({defaultValues:{type:a[0].name}}),i=Pm(n);return e.jsxs(Z,{children:[e.jsx(ne,{children:e.jsx(r,{message:"Add new tag"})}),e.jsx(ee,{children:e.jsx(mr,{formId:t,form:n,onSubmit:l=>{i.mutate(l,{onSuccess:()=>{s()}})}})}),e.jsxs(xe,{children:[e.jsx(f,{onClick:()=>{s()},children:e.jsx(r,{message:"Cancel"})}),e.jsx(f,{form:t,disabled:i.isPending,variant:"flat",color:"primary",type:"submit",children:e.jsx(r,{message:"Save"})})]})]})}function Lm(s){const{trans:t}=M();return R({mutationFn:a=>Mm(a),onSuccess:()=>{O(t(h("Tag updated"))),D.invalidateQueries({queryKey:Y("tags")})},onError:a=>Se(a,s)})}function Mm({id:s,...t}){return t.name&&(t.name=sa(t.name)),I.put(`tags/${s}`,t).then(a=>a.data)}function Dm({tag:s}){const{close:t,formId:a}=Q(),n=K({defaultValues:{id:s.id,name:s.name,display_name:s.display_name,type:s.type}}),i=Lm(n);return e.jsxs(Z,{children:[e.jsx(ne,{children:e.jsx(r,{message:"Update “:name“ tag",values:{name:s.name}})}),e.jsx(ee,{children:e.jsx(mr,{formId:a,form:n,onSubmit:l=>{i.mutate(l,{onSuccess:()=>{t()}})}})}),e.jsxs(xe,{children:[e.jsx(f,{onClick:()=>{t()},children:e.jsx(r,{message:"Cancel"})}),e.jsx(f,{form:a,disabled:i.isPending,variant:"flat",color:"primary",type:"submit",children:e.jsx(r,{message:"Save"})})]})]})}const Rm=[{key:"name",allowsSorting:!0,visibleInMode:"all",width:"flex-3 min-w-200",header:()=>e.jsx(r,{message:"Name"}),body:s=>s.name},{key:"type",allowsSorting:!0,header:()=>e.jsx(r,{message:"Type"}),body:s=>s.type},{key:"display_name",allowsSorting:!0,header:()=>e.jsx(r,{message:"Display name"}),body:s=>s.display_name},{key:"updated_at",allowsSorting:!0,width:"w-100",header:()=>e.jsx(r,{message:"Last updated"}),body:s=>e.jsx(ve,{date:s.updated_at})},{key:"actions",header:()=>e.jsx(r,{message:"Actions"}),hideHeader:!0,align:"end",width:"w-42 flex-shrink-0",visibleInMode:"all",body:s=>e.jsxs(P,{type:"modal",children:[e.jsx(k,{size:"md",className:"text-muted",children:e.jsx(He,{})}),e.jsx(Dm,{tag:s})]})}];function Vm(){const{tags:s}=d.useContext(ds),t=d.useMemo(()=>Im(s.types),[s.types]);return e.jsx(Ee,{endpoint:"tags",title:e.jsx(r,{message:"Tags"}),columns:Rm,filters:t,actions:e.jsx(Om,{}),selectedActions:e.jsx(ms,{}),emptyStateMessage:e.jsx(ye,{image:ur,title:e.jsx(r,{message:"No tags have been created yet"}),filteringTitle:e.jsx(r,{message:"No matching tags"})})})}function Om(){return e.jsx(e.Fragment,{children:e.jsxs(P,{type:"modal",children:[e.jsx(Me,{children:e.jsx(r,{message:"Add new tag"})}),e.jsx($m,{})]})})}const xr=d.memo(({bytes:s})=>e.jsx(d.Fragment,{children:Ka(s)})),gr=E(e.jsx("path",{d:"M12 6c3.79 0 7.17 2.13 8.82 5.5C19.17 14.87 15.79 17 12 17s-7.17-2.13-8.82-5.5C4.83 8.13 8.21 6 12 6m0-2C7 4 2.73 7.11 1 11.5 2.73 15.89 7 19 12 19s9.27-3.11 11-7.5C21.27 7.11 17 4 12 4zm0 5c1.38 0 2.5 1.12 2.5 2.5S13.38 14 12 14s-2.5-1.12-2.5-2.5S10.62 9 12 9m0-2c-2.48 0-4.5 2.02-4.5 4.5S9.52 16 12 16s4.5-2.02 4.5-4.5S14.48 7 12 7z"}),"VisibilityOutlined"),qm=""+new URL("upload-cabfc914.svg",import.meta.url).href,Hm=[{key:"name",allowsSorting:!0,visibleInMode:"all",width:"flex-3 min-w-200",header:()=>e.jsx(r,{message:"Name"}),body:s=>e.jsxs(d.Fragment,{children:[e.jsx("div",{className:"overflow-x-hidden overflow-ellipsis",children:s.name}),e.jsx("div",{className:"text-muted text-xs overflow-x-hidden overflow-ellipsis",children:s.file_name})]})},{key:"owner_id",allowsSorting:!0,width:"flex-3 min-w-200",header:()=>e.jsx(r,{message:"Uploader"}),body:s=>{var a;const t=(a=s.users)==null?void 0:a[0];return t?e.jsx(es,{image:t.avatar,label:t.display_name,description:t.email}):null}},{key:"type",width:"w-100 flex-shrink-0",allowsSorting:!0,header:()=>e.jsx(r,{message:"Type"}),body:s=>e.jsxs("div",{className:"flex items-center gap-12",children:[e.jsx(di,{type:s.type,className:"w-24 h-24 overflow-hidden"}),e.jsx("div",{className:"capitalize",children:s.type})]})},{key:"public",allowsSorting:!0,width:"w-60 flex-shrink-0",header:()=>e.jsx(r,{message:"Public"}),body:s=>s.public?e.jsx(At,{className:"icon-md text-positive"}):e.jsx(qe,{className:"icon-md text-danger"})},{key:"file_size",allowsSorting:!0,maxWidth:"max-w-100",header:()=>e.jsx(r,{message:"File size"}),body:s=>e.jsx(xr,{bytes:s.file_size})},{key:"updated_at",allowsSorting:!0,width:"w-100",header:()=>e.jsx(r,{message:"Last updated"}),body:s=>e.jsx(ve,{date:s.updated_at})},{key:"actions",header:()=>e.jsx(r,{message:"Actions"}),hideHeader:!0,align:"end",width:"w-42 flex-shrink-0",visibleInMode:"all",body:s=>e.jsxs(P,{type:"modal",children:[e.jsx(k,{size:"md",className:"text-muted",children:e.jsx(gr,{})}),e.jsx(Ji,{entries:[s]})]})}];function Bm(){return e.jsx(Ee,{endpoint:"file-entries",title:e.jsx(r,{message:"Uploaded files and folders"}),columns:Hm,filters:Qi,selectedActions:e.jsx(ms,{}),emptyStateMessage:e.jsx(ye,{image:qm,title:e.jsx(r,{message:"Nothing has been uploaded yet"}),filteringTitle:e.jsx(r,{message:"No matching files or folders"})})})}const Um=[{key:"ends_at",label:h("Status"),description:h("Whether subscription is active or cancelled"),defaultOperator:ie.eq,control:{type:oe.Select,defaultValue:"active",options:[{key:"active",label:h("Active"),value:{value:null,operator:ie.eq}},{key:"cancelled",label:h("Cancelled"),value:{value:null,operator:ie.ne}}]}},{control:{type:oe.Select,defaultValue:"stripe",options:[{key:"stripe",label:h("Stripe"),value:"stripe"},{key:"paypal",label:h("PayPal"),value:"paypal"},{key:"none",label:h("None"),value:"none"}]},key:"gateway_name",label:h("Gateway"),description:h("With which payment provider was subscription created"),defaultOperator:ie.eq},Yi({key:"renews_at",label:h("Renew date"),description:h("Date subscription will renew")}),us({description:h("Date subscription was created")}),ks({description:h("Date subscription was last updated")})],Wm=""+new URL("subscriptions-7eacea42.svg",import.meta.url).href;function Km(s){const{trans:t}=M();return R({mutationFn:a=>Gm(a),onSuccess:()=>{O(t(h("Subscription updated"))),D.invalidateQueries({queryKey:Y("billing/subscriptions")})},onError:a=>Se(a,s)})}function Gm({id:s,...t}){return I.put(`billing/subscriptions/${s}`,t).then(a=>a.data)}function pr({form:s,onSubmit:t,formId:a}){var o,c;const n=ui(),i=s.watch("product_id"),l=(o=n.data)==null?void 0:o.products.find(m=>m.id===i);return e.jsxs(de,{id:a,form:s,onSubmit:t,children:[e.jsx(Zi,{name:"user_id",className:"mb-20",endpoint:"normalized-models/user",label:e.jsx(r,{message:"User"})}),e.jsx(U,{name:"product_id",selectionMode:"single",className:"mb-20",label:e.jsx(r,{message:"Plan"}),children:(c=n.data)==null?void 0:c.products.filter(m=>!m.free).map(m=>e.jsx(g,{value:m.id,children:e.jsx(r,{message:m.name})},m.id))}),!(l!=null&&l.free)&&e.jsx(U,{name:"price_id",selectionMode:"single",className:"mb-20",label:e.jsx(r,{message:"Price"}),children:l==null?void 0:l.prices.map(m=>e.jsx(g,{value:m.id,children:e.jsx(Rt,{price:m})},m.id))}),e.jsx(p,{inputElementType:"textarea",rows:3,name:"description",label:e.jsx(r,{message:"Description"}),className:"mb-20"}),e.jsx(yt,{className:"mb-20",name:"renews_at",granularity:"day",label:e.jsx(r,{message:"Renews at"}),description:e.jsx(r,{message:"This will only change local records. User will continue to be billed on their original cycle on the payment gateway."})}),e.jsx(yt,{className:"mb-20",name:"ends_at",granularity:"day",label:e.jsx(r,{message:"Ends at"}),description:e.jsx(r,{message:"This will only change local records. User will continue to be billed on their original cycle on the payment gateway."})})]})}function Qm({subscription:s}){const{close:t,formId:a}=Q(),n=K({defaultValues:{id:s.id,product_id:s.product_id,price_id:s.price_id,description:s.description,renews_at:s.renews_at,ends_at:s.ends_at,user_id:s.user_id}}),i=Km(n);return e.jsxs(Z,{size:"md",children:[e.jsx(ne,{children:e.jsx(r,{message:"Update subscription"})}),e.jsx(ee,{children:e.jsx(pr,{formId:a,form:n,onSubmit:l=>{i.mutate(l,{onSuccess:()=>{t()}})}})}),e.jsxs(xe,{children:[e.jsx(f,{onClick:()=>{t()},children:e.jsx(r,{message:"Cancel"})}),e.jsx(f,{form:a,disabled:i.isPending,variant:"flat",color:"primary",type:"submit",children:e.jsx(r,{message:"Save"})})]})]})}const jr="billing/subscriptions";function Jm(s){const{trans:t}=M();return R({mutationFn:a=>Ym(a),onSuccess:()=>{O(t(h("Subscription created"))),D.invalidateQueries({queryKey:Y(jr)})},onError:a=>Se(a,s)})}function Ym(s){return I.post(jr,s).then(t=>t.data)}function Zm(){const{close:s,formId:t}=Q(),a=K({}),n=Jm(a);return e.jsxs(Z,{children:[e.jsx(ne,{children:e.jsx(r,{message:"Add new subscription"})}),e.jsx(ee,{children:e.jsx(pr,{formId:t,form:a,onSubmit:i=>{n.mutate(i,{onSuccess:()=>{s()}})}})}),e.jsxs(xe,{children:[e.jsx(f,{onClick:()=>{s()},children:e.jsx(r,{message:"Cancel"})}),e.jsx(f,{form:t,disabled:n.isPending,variant:"flat",color:"primary",type:"submit",children:e.jsx(r,{message:"Save"})})]})]})}const Xm=E(e.jsx("path",{d:"M6 19h4V5H6v14zm8-14v14h4V5h-4z"}),"PauseOutlined"),eh=E(e.jsx("path",{d:"M10 8.64 15.27 12 10 15.36V8.64M8 5v14l11-7L8 5z"}),"PlayArrowOutlined"),dt="billing/subscriptions",sh=[{key:"user_id",allowsSorting:!0,width:"flex-3 min-w-200",visibleInMode:"all",header:()=>e.jsx(r,{message:"Customer"}),body:s=>s.user&&e.jsx(es,{image:s.user.avatar,label:s.user.display_name,description:s.user.email})},{key:"status",width:"w-100 flex-shrink-0",header:()=>e.jsx(r,{message:"Status"}),body:s=>e.jsx(Et,{size:"xs",color:s.valid?"positive":void 0,radius:"rounded",className:"w-max",children:s.gateway_status})},{key:"product_id",allowsSorting:!0,header:()=>e.jsx(r,{message:"Plan"}),body:s=>{var t;return(t=s.product)==null?void 0:t.name}},{key:"gateway_name",allowsSorting:!0,header:()=>e.jsx(r,{message:"Gateway"}),body:s=>e.jsx("span",{className:"capitalize",children:s.gateway_name})},{key:"renews_at",allowsSorting:!0,header:()=>e.jsx(r,{message:"Renews at"}),body:s=>e.jsx(ve,{date:s.renews_at})},{key:"ends_at",allowsSorting:!0,header:()=>e.jsx(r,{message:"Ends at"}),body:s=>e.jsx(ve,{date:s.ends_at})},{key:"created_at",allowsSorting:!0,header:()=>e.jsx(r,{message:"Created at"}),body:s=>e.jsx(ve,{date:s.created_at})},{key:"actions",header:()=>e.jsx(r,{message:"Actions"}),hideHeader:!0,align:"end",visibleInMode:"all",width:"w-128 flex-shrink-0",body:s=>e.jsx(nh,{subscription:s})}];function th(){return e.jsx(Ee,{endpoint:dt,title:e.jsx(r,{message:"Subscriptions"}),columns:sh,filters:Um,actions:e.jsx(ah,{}),enableSelection:!1,selectedActions:e.jsx(ms,{}),queryParams:{with:"product"},emptyStateMessage:e.jsx(ye,{image:Wm,title:e.jsx(r,{message:"No subscriptions have been created yet"}),filteringTitle:e.jsx(r,{message:"No matching subscriptions"})})})}function ah(){return e.jsx(e.Fragment,{children:e.jsxs(P,{type:"modal",children:[e.jsx(Me,{children:e.jsx(r,{message:"Add new subscription"})}),e.jsx(Zm,{})]})})}function nh({subscription:s}){return e.jsxs(d.Fragment,{children:[e.jsxs(P,{type:"modal",children:[e.jsx(k,{size:"md",className:"text-muted",children:e.jsx(He,{})}),e.jsx(Qm,{subscription:s})]}),s.cancelled&&s.on_grace_period?e.jsx(ih,{subscription:s}):null,s.active?e.jsx(rh,{subscription:s}):null,e.jsx(lh,{subscription:s})]})}function rh({subscription:s}){const t=Za(),a=()=>{t.mutate({subscriptionId:s.id},{onSuccess:()=>{D.invalidateQueries({queryKey:Y(dt)})}})};return e.jsxs(P,{type:"modal",onClose:n=>{n&&a()},children:[e.jsx(G,{label:e.jsx(r,{message:"Cancel subscription"}),children:e.jsx(k,{size:"md",className:"text-muted",disabled:t.isPending,children:e.jsx(Xm,{})})}),e.jsx(Fe,{title:e.jsx(r,{message:"Cancel subscription"}),body:e.jsxs("div",{children:[e.jsx(r,{message:"Are you sure you want to cancel this subscription?"}),e.jsx("div",{className:"mt-10 text-sm font-semibold",children:e.jsx(r,{message:"This will put user on grace period until their next scheduled renewal date. Subscription can be renewed until that date by user or from admin area."})})]}),confirm:e.jsx(r,{message:"Confirm"})})]})}function ih({subscription:s}){const t=nl(),a=()=>{t.mutate({subscriptionId:s.id},{onSuccess:()=>{D.invalidateQueries({queryKey:Y(dt)})}})};return e.jsxs(P,{type:"modal",onClose:n=>{n&&a()},children:[e.jsx(G,{label:e.jsx(r,{message:"Renew subscription"}),children:e.jsx(k,{size:"md",className:"text-muted",onClick:a,disabled:t.isPending,children:e.jsx(eh,{})})}),e.jsx(Fe,{title:e.jsx(r,{message:"Resume subscription"}),body:e.jsxs("div",{children:[e.jsx(r,{message:"Are you sure you want to resume this subscription?"}),e.jsx("div",{className:"mt-10 text-sm font-semibold",children:e.jsx(r,{message:"This will put user on their original plan and billing cycle."})})]}),confirm:e.jsx(r,{message:"Confirm"})})]})}function lh({subscription:s}){const t=Za(),a=()=>{t.mutate({subscriptionId:s.id,delete:!0},{onSuccess:()=>{D.invalidateQueries({queryKey:Y(dt)})}})};return e.jsxs(P,{type:"modal",onClose:n=>{n&&a()},children:[e.jsx(G,{label:e.jsx(r,{message:"Delete subscription"}),children:e.jsx(k,{size:"md",className:"text-muted",disabled:t.isPending,children:e.jsx(qe,{})})}),e.jsx(Fe,{isDanger:!0,title:e.jsx(r,{message:"Delete subscription"}),body:e.jsxs("div",{children:[e.jsx(r,{message:"Are you sure you want to delete this subscription?"}),e.jsx("div",{className:"mt-10 text-sm font-semibold",children:e.jsx(r,{message:"This will permanently delete the subscription and immediately cancel it on billing gateway. Subscription will not be renewable anymore."})})]}),confirm:e.jsx(r,{message:"Confirm"})})]})}const oh=E(e.jsx("path",{d:"M12 4V1L8 5l4 4V6c3.31 0 6 2.69 6 6 0 1.01-.25 1.97-.7 2.8l1.46 1.46C19.54 15.03 20 13.57 20 12c0-4.42-3.58-8-8-8zm0 14c-3.31 0-6-2.69-6-6 0-1.01.25-1.97.7-2.8L5.24 7.74C4.46 8.97 4 10.43 4 12c0 4.42 3.58 8 8 8v3l4-4-4-4v3z"}),"SyncOutlined");function ch(){const{trans:s}=M();return R({mutationFn:()=>dh(),onSuccess:()=>{O(s(h("Plans synced")))},onError:t=>se(t,h("Could not sync plans"))})}function dh(){return I.post("billing/products/sync").then(s=>s.data)}const uh=s=>`billing/products/${s}`;function mh(){const{trans:s}=M();return R({mutationFn:t=>hh(t),onSuccess:()=>{O(s(h("Plan deleted"))),D.invalidateQueries({queryKey:Y("billing/products")})},onError:t=>se(t)})}function hh({productId:s}){return I.delete(uh(s)).then(t=>t.data)}const xh=[{key:"subscriptions",label:h("Subscriptions"),description:h("Whether plan has any active subscriptions"),defaultOperator:ie.eq,control:{type:oe.Select,defaultValue:"01",options:[{key:"01",label:h("Has active subscriptions"),value:{value:"*",operator:ie.has}},{key:"02",label:h("Does not have active subscriptions"),value:{value:"*",operator:ie.doesntHave}}]}},us({description:h("Date plan was created")}),ks({description:h("Date plan was last updated")})],gh=[{key:"name",allowsSorting:!0,visibleInMode:"all",header:()=>e.jsx(r,{message:"Name"}),body:s=>{const t=s.prices[0];return e.jsx(es,{label:s.name,description:s.free?e.jsx(r,{message:"Free"}):e.jsx(Rt,{price:t})})}},{key:"created_at",allowsSorting:!0,maxWidth:"max-w-100",header:()=>e.jsx(r,{message:"Created"}),body:s=>e.jsx(ve,{date:s.created_at})},{key:"updated_at",allowsSorting:!0,maxWidth:"max-w-100",header:()=>e.jsx(r,{message:"Last updated"}),body:s=>e.jsx(ve,{date:s.updated_at})},{key:"actions",header:()=>e.jsx(r,{message:"Actions"}),visibleInMode:"all",hideHeader:!0,align:"end",maxWidth:"max-w-84",body:s=>e.jsxs(d.Fragment,{children:[e.jsx(k,{size:"md",className:"text-muted",elementType:B,to:`/admin/plans/${s.id}/edit`,children:e.jsx(He,{})}),e.jsx(jh,{product:s})]})}];function ph(){const s=je();return e.jsx(Ee,{endpoint:"billing/products",title:e.jsx(r,{message:"Subscription plans"}),columns:gh,actions:e.jsx(fh,{}),enableSelection:!1,filters:xh,onRowAction:t=>{s(`/admin/plans/${t.id}/edit`)},emptyStateMessage:e.jsx(ye,{image:ur,title:e.jsx(r,{message:"No plans have been created yet"}),filteringTitle:e.jsx(r,{message:"No matching plans"})})})}function jh({product:s}){const t=mh();return e.jsxs(P,{type:"modal",onClose:a=>{a&&t.mutate({productId:s.id})},children:[e.jsx(G,{label:e.jsx(r,{message:"Delete plan"}),children:e.jsx(k,{size:"md",className:"text-muted",disabled:t.isPending,children:e.jsx(it,{})})}),e.jsx(Fe,{title:e.jsx(r,{message:"Delete plan"}),body:e.jsx(r,{message:"Are you sure you want to delete this plan?"}),confirm:e.jsx(r,{message:"Delete"})})]})}function fh(){const s=ch();return e.jsxs(d.Fragment,{children:[e.jsx(G,{label:e.jsx(r,{message:"Sync plans with Stripe & PayPal"}),children:e.jsx(k,{color:"primary",variant:"outline",size:"sm",disabled:s.isPending,onClick:()=>{s.mutate()},children:e.jsx(oh,{})})}),e.jsx(Me,{elementType:B,to:"/admin/plans/new",children:e.jsx(r,{message:"Add new plan"})})]})}const fr=s=>`billing/products/${s}`;function bh(){const{productId:s}=ue();return $e({queryKey:[fr(s)],queryFn:()=>vh(s)})}function vh(s){return I.get(fr(s)).then(t=>t.data)}const zt=[{key:"day1",label:h("Daily"),interval:"day",interval_count:1},{key:"week1",label:h("Weekly"),interval:"week",interval_count:1},{key:"month1",label:h("Monthly"),interval:"month",interval_count:1},{key:"month3",label:h("Every 3 months"),interval:"month",interval_count:3},{key:"month6",label:h("Every 6 months"),interval:"month",interval_count:6},{key:"year1",label:h("Yearly"),interval:"year",interval_count:1},{key:"custom",label:h("Custom"),interval:null,interval_count:null}];function yh({index:s,onRemovePrice:t}){const{trans:a}=M(),n=ze(["currencies"]),i=d.useMemo(()=>{var y;return(y=n.data)!=null&&y.currencies?Object.values(n.data.currencies):[]},[n.data]),{watch:l,getValues:o}=F(),c=!l("id"),m=l(`prices.${s}.id`)==null,u=l(`prices.${s}.subscriptions_count`)||0,[x,j]=d.useState(()=>{const y=o(`prices.${s}.interval`),w=o(`prices.${s}.interval_count`),S=zt.find(_=>_.key===`${y}${w}`);return S?S.key:"custom"}),b=c||m||!u;return e.jsxs(d.Fragment,{children:[!b&&e.jsx("p",{className:"text-muted text-sm max-w-500 mb-20",children:e.jsx(r,{message:"This price can't modified or deleted, because it has [one 1 subscriber|other :count subscribers]. You can instead add a new price.",values:{count:u}})}),e.jsx(p,{required:!0,disabled:!b,label:e.jsx(r,{message:"Amount"}),type:"number",min:.1,step:.01,name:`prices.${s}.amount`,className:"mb-20"}),e.jsx(U,{required:!0,disabled:!b,label:e.jsx(r,{message:"Currency"}),name:`prices.${s}.currency`,items:i,showSearchField:!0,searchPlaceholder:a(h("Search currencies")),selectionMode:"single",className:"mb-20",children:y=>e.jsx(g,{value:y.code,children:`${y.code}: ${y.name}`},y.code)}),e.jsx(wh,{disabled:!b,index:s,value:x,onValueChange:j}),x==="custom"&&e.jsx(Sh,{disabled:!b,index:s}),e.jsx("div",{className:"text-right",children:e.jsx(f,{size:"xs",variant:"outline",color:"danger",disabled:!b,onClick:()=>{t()},children:e.jsx(r,{message:"Delete price"})})})]})}function wh({index:s,value:t,onValueChange:a,disabled:n}){const{setValue:i}=F();return e.jsx(vs,{label:e.jsx(r,{message:"Billing period"}),disabled:n,className:"mb-20",selectionMode:"single",selectedValue:t,onSelectionChange:l=>{if(a(l),l!=="custom"){const o=zt.find(c=>c.key===l);o&&(i(`prices.${s}.interval`,o.interval),i(`prices.${s}.interval_count`,o.interval_count))}},children:zt.map(l=>e.jsx(g,{value:l.key,children:e.jsx(r,{...l.label})},l.key))})}function Sh({index:s,disabled:t}){const{watch:a}=F(),n=a(`prices.${s}.interval`);let i;return n==="day"?i=365:n==="week"?i=52:i=12,e.jsxs("div",{className:"flex border rounded w-min",children:[e.jsx("div",{className:"px-18 flex items-center text-sm",children:e.jsx(r,{message:"Every"})}),e.jsx(p,{inputShadow:"shadow-none",inputBorder:"border-none",className:"border-l border-r w-80",name:`prices.${s}.interval_count`,type:"number",min:1,max:i,disabled:t,required:!0}),e.jsxs(U,{inputShadow:"shadow-none",inputBorder:"border-none",name:`prices.${s}.interval`,selectionMode:"single",disabled:t,children:[e.jsx(g,{value:"day",children:e.jsx(r,{message:"Days"})}),e.jsx(g,{value:"week",children:e.jsx(r,{message:"Weeks"})}),e.jsx(g,{value:"month",children:e.jsx(r,{message:"Months"})})]})]})}function br(){return e.jsxs(d.Fragment,{children:[e.jsx(p,{name:"name",label:e.jsx(r,{message:"Name"}),className:"mb-20",required:!0,autoFocus:!0}),e.jsx(p,{name:"description",label:e.jsx(r,{message:"Description"}),className:"mb-20",inputElementType:"textarea",rows:4}),e.jsxs(U,{name:"position",selectionMode:"single",label:e.jsx(r,{message:"Position in pricing table"}),className:"mb-20",children:[e.jsx(g,{value:0,children:e.jsx(r,{message:"First"})}),e.jsx(g,{value:1,children:e.jsx(r,{message:"Second"})}),e.jsx(g,{value:2,children:e.jsx(r,{message:"Third"})}),e.jsx(g,{value:3,children:e.jsx(r,{message:"Fourth"})}),e.jsx(g,{value:4,children:e.jsx(r,{message:"Fifth"})})]}),e.jsx(Is,{className:"mb-30",name:"available_space",label:e.jsx(r,{message:"Allowed storage space"}),description:e.jsx(r,{values:{a:s=>e.jsx(B,{className:Mt,target:"_blank",to:"/admin/settings/uploading",children:s})},message:"Total storage space all user uploads are allowed to take up."})}),e.jsx(L,{name:"recommended",className:"mb-20",description:e.jsx(r,{message:"Plan will be displayed more prominently on pricing page."}),children:e.jsx(r,{message:"Recommend"})}),e.jsx(L,{name:"hidden",className:"mb-20",description:e.jsx(r,{message:"Plan will not be shown on pricing or upgrade pages."}),children:e.jsx(r,{message:"Hidden"})}),e.jsx(L,{name:"free",className:"mb-20",description:e.jsx(r,{message:"Will be assigned to all users, if they are not subscribed already."}),children:e.jsx(r,{message:"Free"})}),e.jsx(It,{children:e.jsx(r,{message:"Feature list"})}),e.jsx(kh,{}),e.jsx(Nh,{}),e.jsx(It,{children:e.jsx(r,{message:"Permissions"})}),e.jsx(Gt,{name:"permissions"})]})}function It({children:s}){return e.jsx("h2",{className:"mt-40 mb-20 text-base font-semibold",children:s})}function kh(){const{fields:s,append:t,remove:a}=Ae({name:"feature_list"});return e.jsxs("div",{children:[s.map((n,i)=>e.jsxs("div",{className:"flex gap-10 mb-10",children:[e.jsx(p,{name:`feature_list.${i}.value`,size:"sm",className:"flex-auto"}),e.jsx(k,{size:"sm",color:"primary",className:"flex-shrink-0",onClick:()=>{a(i)},children:e.jsx(qe,{})})]},n.id)),e.jsx(f,{variant:"text",color:"primary",startIcon:e.jsx(_e,{}),size:"xs",onClick:()=>{t({value:""})},children:e.jsx(r,{message:"Add another line"})})]})}function Nh(){var l;const{watch:s,formState:{errors:t}}=F(),{fields:a,append:n,remove:i}=Ae({name:"prices",keyName:"key"});return s("free")?null:e.jsxs(d.Fragment,{children:[e.jsx(It,{children:e.jsx(r,{message:"Pricing"})}),((l=t.prices)==null?void 0:l.message)&&e.jsx("div",{className:"text-sm text-danger mb-20",children:t.prices.message}),e.jsx(Xe,{variant:"outline",className:"mb-10",children:a.map((o,c)=>e.jsx(Ce,{label:e.jsx(Rt,{price:o}),children:e.jsx(yh,{index:c,onRemovePrice:()=>{i(c)}})},o.key))}),e.jsx(f,{variant:"text",color:"primary",startIcon:e.jsx(_e,{}),size:"xs",onClick:()=>{n({currency:"USD",amount:1,interval_count:1,interval:"month"})},children:e.jsx(r,{message:"Add another price"})})]})}const vr=s=>`billing/products/${s}`;function Ch(s){const{trans:t}=M(),a=je();return R({mutationFn:n=>_h(n),onSuccess:n=>{O(t(h("Plan updated"))),D.invalidateQueries({queryKey:[vr(n.product.id)]}),D.invalidateQueries({queryKey:Y("billing/products")}),a("/admin/plans")},onError:n=>Se(n,s)})}function _h({id:s,...t}){const a={...t,feature_list:t.feature_list.map(n=>n.value)};return I.put(vr(s),a).then(n=>n.data)}function Fh(){const s=bh();return s.status!=="success"?e.jsx(Ze,{}):e.jsx(zh,{product:s.data.product})}function zh({product:s}){const t=K({defaultValues:{...s,feature_list:s.feature_list.map(n=>({value:n}))}}),a=Ch(t);return e.jsx(Os,{form:t,onSubmit:n=>{a.mutate(n)},title:e.jsx(r,{message:"Edit “:name“ plan",values:{name:s.name}}),isLoading:a.isPending,children:e.jsx(br,{})})}const yr="billing/products";function Ih(s){const{trans:t}=M(),a=je();return R({mutationFn:n=>Ah(n),onSuccess:()=>{O(t(h("Plan created"))),D.invalidateQueries({queryKey:[yr]}),D.invalidateQueries({queryKey:Y("billing/products")}),a("/admin/plans")},onError:n=>Se(n,s)})}function Ah(s){const t={...s,feature_list:s.feature_list.map(a=>a.value)};return I.post(yr,t).then(a=>a.data)}function Eh(){const s=K({defaultValues:{free:!1,recommended:!1}}),t=Ih(s);return e.jsx(Os,{form:s,onSubmit:a=>{t.mutate(a)},title:e.jsx(r,{message:"Create new plan"}),isLoading:t.isPending,children:e.jsx(br,{})})}function Ph(){return e.jsxs(ke,{title:e.jsx(r,{message:"GDPR"}),description:e.jsx(r,{message:"Configure settings related to EU General Data Protection Regulation."}),children:[e.jsx(Th,{}),e.jsx(Oe,{}),e.jsx($h,{})]})}function Th(){const{watch:s}=F(),t=s("client.cookie_notice.enable");return e.jsxs("div",{children:[e.jsx(L,{name:"client.cookie_notice.enable",className:"mb-20",description:e.jsx(r,{message:"Whether cookie notice should be shown automatically to users from EU until it is accepted."}),children:e.jsx(r,{message:"Enable cookie notice"})}),t&&e.jsxs(d.Fragment,{children:[e.jsxs("div",{className:"mb-20 border-b pb-6",children:[e.jsx("div",{className:"mb-20 border-b pb-10 text-sm font-medium",children:e.jsx(r,{message:"Information button"})}),e.jsx(ps,{hideRoleAndPermissionFields:!0,formPathPrefix:"client.cookie_notice.button"})]}),e.jsxs(U,{name:"client.cookie_notice.position",selectionMode:"single",label:e.jsx(r,{message:"Cookie notice position"}),className:"mb-20",children:[e.jsx(g,{value:"top",children:e.jsx(r,{message:"Top"})}),e.jsx(g,{value:"bottom",children:e.jsx(r,{message:"Bottom"})})]})]})]})}function $h(){const{fields:s,append:t,remove:a}=Ae({name:"client.registration.policies"});return e.jsxs(d.Fragment,{children:[e.jsx("div",{className:"mb-6 text-sm",children:e.jsx(r,{message:"Registration policies"})}),e.jsx("div",{className:"text-xs text-muted",children:e.jsx(r,{message:"Create policies that will be shown on registration page. User will be required to accept them by toggling a checkbox."})}),e.jsx(Xe,{className:"mt-16",variant:"outline",children:s.map((n,i)=>e.jsx(Ce,{label:n.label,chevronPosition:"left",endAppend:e.jsx(k,{variant:"text",color:"danger",size:"sm",onClick:()=>{a(i)},children:e.jsx(qe,{})}),children:e.jsx(ps,{hideRoleAndPermissionFields:!0,formPathPrefix:`client.register_policies.${i}`})},n.id))}),e.jsxs(P,{type:"modal",onClose:n=>{n&&t(n)},children:[e.jsx(f,{className:"mt-12",variant:"link",color:"primary",startIcon:e.jsx(_e,{}),size:"xs",children:e.jsx(r,{message:"Add another policy"})}),e.jsx(Qn,{title:e.jsx(r,{message:"Add policy"})})]})]})}const Lh=[];function Mh(s){const{pageId:t}=ue(),a=`${s||"custom-pages"}/${t}`;return R({mutationFn:n=>Dh(n,a),onError:n=>se(n),onSuccess:async()=>{await D.invalidateQueries({queryKey:["custom-pages"]}),await D.invalidateQueries({queryKey:Y(a)}),O(h("Page updated"))}})}function Dh(s,t){return I.put(`${t}`,s).then(a=>a.data)}function wr(){const[s,t]=d.useState(!1),{trans:a}=M(),i=F().watch("title"),l=a({message:"Title"});return s?e.jsx(p,{placeholder:l,autoFocus:!0,className:"mb-30",onBlur:()=>{t(!1)},name:"title",required:!0}):e.jsxs("h1",{tabIndex:0,onClick:()=>{t(!0)},onFocus:()=>{t(!0)},className:v("hover:bg-primary/focus rounded cursor-pointer",!i&&"text-muted"),children:[i||l,e.jsx(He,{className:"icon-sm mx-8 mt-8 align-top text-muted"})]})}function Rh({host:s,value:t="",placeholder:a,onChange:n,className:i,inputRef:l,onInputBlur:o,showLinkIcon:c=!0,pattern:m,minLength:u,maxLength:x,hideButton:j,...b}){const{base_url:y}=we(),w=b.prefix?`/${b.prefix}`:"",S=b.suffix?`/${b.suffix}`:"",[_,z]=d.useState(!1),[A,N]=d.useState(t);s=s||y,d.useEffect(()=>{N(t)},[t]);const J=()=>{_?(z(!1),A&&(n==null||n(A))):z(!0)};let T="";return A?T=A:a&&(T=sa(a)),e.jsxs("div",{className:v("flex items-center",i),children:[c&&e.jsx(Ht,{className:"icon-md text-muted"}),e.jsxs("div",{className:"text-primary ml-6 mr-14",children:[s,w,!_&&T&&e.jsxs(d.Fragment,{children:[e.jsx("span",{children:"/"}),e.jsx("span",{className:"font-medium",children:T})]}),_?null:S]}),_&&e.jsx(Ye,{pattern:m,minLength:u,maxLength:x,onKeyDown:X=>{X.key==="Enter"&&J()},ref:l,"aria-label":"slug",autoFocus:!0,className:"mr-14",size:"2xs",value:A,onBlur:o,onChange:X=>{N(X.target.value)}}),!j&&e.jsx(f,{type:"button",color:"chip",variant:"outline",size:"2xs",onClick:()=>{J()},children:_?e.jsx(r,{message:"Save"}):e.jsx(r,{message:"Edit"})})]})}const Vh=E(e.jsx("path",{d:"M12.5 8c-2.65 0-5.05.99-6.9 2.6L2 7v9h9l-3.62-3.62c1.39-1.16 3.16-1.88 5.12-1.88 3.54 0 6.55 2.31 7.6 5.5l2.37-.78C21.08 11.03 17.15 8 12.5 8z"}),"UndoOutlined"),Oh=E(e.jsx("path",{d:"M18.4 10.6C16.55 8.99 14.15 8 11.5 8c-4.65 0-8.58 3.03-9.96 7.22L3.9 16c1.05-3.19 4.05-5.5 7.6-5.5 1.95 0 3.73.72 5.12 1.88L13 16h9V7l-3.6 3.6z"}),"RedoOutlined");function qh({editor:s}){return e.jsxs("span",{children:[e.jsx(k,{size:"md",disabled:!s.can().undo(),onClick:()=>{s.commands.focus(),s.commands.undo()},children:e.jsx(Vh,{})}),e.jsx(k,{size:"md",disabled:!s.can().redo(),onClick:()=>{s.commands.focus(),s.commands.redo()},children:e.jsx(Oh,{})})]})}const Sr=E(e.jsx("path",{d:"M9.4 16.6 4.8 12l4.6-4.6L8 6l-6 6 6 6 1.4-1.4zm5.2 0 4.6-4.6-4.6-4.6L16 6l6 6-6 6-1.4-1.4z"}),"CodeOutlined");function Hh({editor:s}){return e.jsxs(P,{type:"modal",onClose:t=>{t!=null&&(s==null||s.commands.setContent(t))},children:[e.jsx(f,{variant:"text",startIcon:e.jsx(Sr,{}),children:e.jsx(r,{message:"Source"})}),e.jsx(Yt,{title:e.jsx(r,{message:"Source code"}),defaultValue:s.getHTML()})]})}function js(){return e.jsx("div",{className:"self-stretch mx-4 w-1 bg-divider flex-shrink-0"})}const Bh=E(e.jsx("path",{d:"M15.6 10.79c.97-.67 1.65-1.77 1.65-2.79 0-2.26-1.75-4-4-4H7v14h7.04c2.09 0 3.71-1.7 3.71-3.79 0-1.52-.86-2.82-2.15-3.42zM10 6.5h3c.83 0 1.5.67 1.5 1.5s-.67 1.5-1.5 1.5h-3v-3zm3.5 9H10v-3h3.5c.83 0 1.5.67 1.5 1.5s-.67 1.5-1.5 1.5z"}),"FormatBoldOutlined"),Uh=E(e.jsx("path",{d:"M10 4v3h2.21l-3.42 8H6v3h8v-3h-2.21l3.42-8H18V4h-8z"}),"FormatItalicOutlined"),Wh=E(e.jsx("path",{d:"M12 17c3.31 0 6-2.69 6-6V3h-2.5v8c0 1.93-1.57 3.5-3.5 3.5S8.5 12.93 8.5 11V3H6v8c0 3.31 2.69 6 6 6zm-7 2v2h14v-2H5z"}),"FormatUnderlinedOutlined");function Kh({editor:s,size:t}){return e.jsxs("span",{className:v("flex-shrink-0 whitespace-nowrap"),children:[e.jsx(G,{label:e.jsx(r,{message:"Bold"}),children:e.jsx(k,{size:t,color:s.isActive("bold")?"primary":null,onClick:()=>{s.commands.focus(),s.commands.toggleBold()},children:e.jsx(Bh,{})})}),e.jsx(G,{label:e.jsx(r,{message:"Italic"}),children:e.jsx(k,{size:t,color:s.isActive("italic")?"primary":null,onClick:()=>{s.commands.focus(),s.commands.toggleItalic()},children:e.jsx(Uh,{})})}),e.jsx(G,{label:e.jsx(r,{message:"Underline"}),children:e.jsx(k,{size:t,color:s.isActive("underline")?"primary":null,onClick:()=>{s.commands.focus(),s.commands.toggleUnderline()},children:e.jsx(Wh,{})})})]})}const Gh=E(e.jsx("path",{d:"M4 10.5c-.83 0-1.5.67-1.5 1.5s.67 1.5 1.5 1.5 1.5-.67 1.5-1.5-.67-1.5-1.5-1.5zm0-6c-.83 0-1.5.67-1.5 1.5S3.17 7.5 4 7.5 5.5 6.83 5.5 6 4.83 4.5 4 4.5zm0 12c-.83 0-1.5.68-1.5 1.5s.68 1.5 1.5 1.5 1.5-.68 1.5-1.5-.67-1.5-1.5-1.5zM7 19h14v-2H7v2zm0-6h14v-2H7v2zm0-8v2h14V5H7z"}),"FormatListBulletedOutlined"),Qh=E(e.jsx("path",{d:"M2 17h2v.5H3v1h1v.5H2v1h3v-4H2v1zm1-9h1V4H2v1h1v3zm-1 3h1.8L2 13.1v.9h3v-1H3.2L5 10.9V10H2v1zm5-6v2h14V5H7zm0 14h14v-2H7v2zm0-6h14v-2H7v2z"}),"FormatListNumberedOutlined");function Jh({editor:s,size:t}){const a=s.isActive("bulletList"),n=s.isActive("orderedList");return e.jsxs("span",{className:v("flex-shrink-0","whitespace-nowrap"),children:[e.jsx(G,{label:e.jsx(r,{message:"Bulleted list"}),children:e.jsx(k,{size:t,color:a?"primary":null,onClick:()=>{s.commands.focus(),s.commands.toggleBulletList()},children:e.jsx(Gh,{})})}),e.jsx(G,{label:e.jsx(r,{message:"Numbered list"}),children:e.jsx(k,{size:t,color:n?"primary":null,onClick:()=>{s.commands.focus(),s.commands.toggleOrderedList()},children:e.jsx(Qh,{})})})]})}function Yh(s,{text:t,target:a,href:n}){s.state.selection.empty&&t?s.commands.insertContent(`${t}`):s.state.selection.empty||(n?s.chain().focus().extendMarkRange("link").setLink({href:n,target:a}).run():s.chain().focus().extendMarkRange("link").unsetLink().run())}function Zh({editor:s,size:t}){return e.jsxs(P,{type:"modal",children:[e.jsx(G,{label:e.jsx(r,{message:"Insert link"}),children:e.jsx(k,{size:t,className:v("flex-shrink-0"),children:e.jsx(Ht,{})})}),e.jsx(Xh,{editor:s})]})}function Xh({editor:s}){const t=s.getAttributes("link").href,a=s.state.doc.textBetween(s.state.selection.from,s.state.selection.to,""),n=K({defaultValues:{href:t,text:a,target:"_blank"}}),{formId:i,close:l}=Q();return e.jsxs(Z,{children:[e.jsx(ne,{children:e.jsx(r,{message:"Insert link"})}),e.jsx(ee,{children:e.jsxs(de,{form:n,id:i,onSubmit:o=>{Yh(s,o),l()},children:[e.jsx(p,{name:"href",label:e.jsx(r,{message:"URL"}),autoFocus:!0,type:"url",className:"mb-20"}),e.jsx(p,{name:"text",label:e.jsx(r,{message:"Text to display"}),className:"mb-20"}),e.jsxs(U,{selectionMode:"single",name:"target",label:e.jsx(r,{message:"Open link in..."}),children:[e.jsx(g,{value:"_self",children:e.jsx(r,{message:"Current window"})}),e.jsx(g,{value:"_blank",children:e.jsx(r,{message:"New window"})})]})]})}),e.jsxs(xe,{children:[e.jsx(f,{onClick:l,variant:"text",children:e.jsx(r,{message:"Cancel"})}),e.jsx(f,{type:"submit",form:i,variant:"flat",color:"primary",children:e.jsx(r,{message:"Save"})})]})]})}const ex=E(e.jsx("path",{d:"M19 5v14H5V5h14m0-2H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2zm-4.86 8.86-3 3.87L9 13.14 6 17h12l-3.86-5.14z"}),"ImageOutlined"),sx=2097152;function tx({editor:s,size:t,diskPrefix:a="page_media"}){const{selectAndUploadFile:n}=mi(),i=()=>{n({showToastOnRestrictionFail:!0,restrictions:{allowedFileTypes:[hi.image],maxFileSize:sx},metadata:{diskPrefix:a,disk:xi.public},onSuccess:l=>{s.commands.focus(),s.commands.setImage({src:l.url})}})};return e.jsx(G,{label:e.jsx(r,{message:"Insert image"}),children:e.jsx(k,{size:t,onClick:i,className:v("flex-shrink-0"),children:e.jsx(ex,{})})})}const ax=E(e.jsx("path",{d:"M20 8V5H6.39l3 3h1.83l-.55 1.28 2.09 2.1L14.21 8zM3.41 4.86 2 6.27l6.97 6.97L6.5 19h3l1.57-3.66L16.73 21l1.41-1.41z"}),"FormatClearOutlined");function nx({editor:s,size:t}){return e.jsx(G,{label:e.jsx(r,{message:"Clear formatting"}),children:e.jsx(k,{className:v("flex-shrink-0"),size:t,onClick:()=>{s.chain().focus().clearNodes().unsetAllMarks().run()},children:e.jsx(ax,{})})})}const rx=E(e.jsx("path",{fillRule:"evenodd",d:"M4 11h16v2H4z"}),"HorizontalRuleOutlined"),ix=E([e.jsx("circle",{cx:"12",cy:"19",r:"2"},"0"),e.jsx("path",{d:"M10 3h4v12h-4z"},"1")],"PriorityHighOutlined"),lx=E(e.jsx("path",{d:"M16 4H4c-1.1 0-2 .9-2 2v12.01c0 1.1.9 1.99 2 1.99h16c1.1 0 2-.9 2-2v-8l-6-6zM4 18.01V6h11v5h5v7.01H4z"}),"NoteOutlined"),ox=E([e.jsx("path",{d:"M9.5 7.5v9l7-4.5z"},"0"),e.jsx("path",{d:"M20 4H4c-1.1 0-2 .9-2 2v12c0 1.1.9 2 2 2h16c1.1 0 2-.9 2-2V6c0-1.1-.9-2-2-2zm0 14.01H4V5.99h16v12.02z"},"1")],"SmartDisplayOutlined");function cx({editor:s,size:t}){const[a,n]=d.useState(!1);return e.jsxs(e.Fragment,{children:[e.jsxs(ws,{onItemSelected:i=>{i==="hr"?(s.commands.focus(),s.commands.setHorizontalRule()):i==="embed"?n("embed"):(s.commands.focus(),s.commands.addInfo({type:i}))},children:[e.jsx(k,{variant:"text",size:t,className:v("flex-shrink-0"),children:e.jsx(Ya,{})}),e.jsxs(Ss,{children:[e.jsx(g,{value:"hr",startIcon:e.jsx(rx,{}),children:e.jsx(r,{message:"Horizontal rule"})}),e.jsx(g,{value:"embed",startIcon:e.jsx(ox,{}),children:e.jsx(r,{message:"Embed"})}),e.jsx(g,{value:"important",startIcon:e.jsx(ix,{}),children:e.jsx(r,{message:"Important"})}),e.jsx(g,{value:"warning",startIcon:e.jsx(gi,{}),children:e.jsx(r,{message:"Warning"})}),e.jsx(g,{value:"success",startIcon:e.jsx(lx,{}),children:e.jsx(r,{message:"Note"})})]})]}),e.jsx(P,{type:"modal",isOpen:!!a,onClose:()=>{n(!1)},children:e.jsx(dx,{editor:s})})]})}function dx({editor:s}){const t=s.getAttributes("embed").src,a=K({defaultValues:{src:t}}),{formId:n,close:i}=Q();return e.jsxs(Z,{children:[e.jsx(ne,{children:e.jsx(r,{message:"Insert link"})}),e.jsx(ee,{children:e.jsx(de,{form:a,id:n,onSubmit:l=>{s.commands.setEmbed(l),i()},children:e.jsx(p,{name:"src",label:e.jsx(r,{message:"Embed URL"}),autoFocus:!0,type:"url",required:!0})})}),e.jsxs(xe,{children:[e.jsx(f,{onClick:i,variant:"text",children:e.jsx(r,{message:"Cancel"})}),e.jsx(f,{type:"submit",form:n,disabled:!a.formState.isValid,variant:"flat",color:"primary",children:e.jsx(r,{message:"Add"})})]})]})}function Te({children:s,modifier:t,separator:a="+"}){const n=pi()?e.jsx("span",{className:"text-base align-middle",children:"⌘"}):"Ctrl";return e.jsxs("kbd",{className:"text-xs text-muted",children:[t&&e.jsxs(e.Fragment,{children:[n,a]}),s]})}function ux({editor:s,size:t}){return e.jsxs(ws,{floatingMinWidth:"w-256",onItemSelected:a=>{s.commands.focus(),typeof a=="string"&&a.startsWith("h")?s.commands.toggleHeading({level:parseInt(a.replace("h",""))}):a==="code"?s.commands.toggleCode():a==="strike"?s.commands.toggleStrike():a==="super"?s.commands.toggleSuperscript():a==="sub"?s.commands.toggleSubscript():a==="blockquote"?s.commands.toggleBlockquote():a==="paragraph"&&s.commands.setParagraph()},children:[e.jsx(f,{className:v("flex-shrink-0"),variant:"text",size:t,endIcon:e.jsx(ji,{}),children:e.jsx(r,{message:"Format"})}),e.jsxs(Ss,{children:[e.jsx(g,{value:"h1",endSection:e.jsx(Te,{modifier:!0,children:"Alt+1"}),children:e.jsx(r,{message:"Heading :number",values:{number:1}})}),e.jsx(g,{value:"h2",endSection:e.jsx(Te,{modifier:!0,children:"Alt+2"}),children:e.jsx(r,{message:"Heading :number",values:{number:2}})}),e.jsx(g,{value:"h3",endSection:e.jsx(Te,{modifier:!0,children:"Alt+3"}),children:e.jsx(r,{message:"Heading :number",values:{number:3}})}),e.jsx(g,{value:"h4",endSection:e.jsx(Te,{modifier:!0,children:"Alt+4"}),children:e.jsx(r,{message:"Heading :number",values:{number:4}})}),e.jsx(g,{value:"code",endSection:e.jsx(Te,{modifier:!0,children:"E"}),children:e.jsx(r,{message:"Code"})}),e.jsx(g,{value:"strike",endSection:e.jsx(Te,{modifier:!0,children:"Shift+X"}),children:e.jsx(r,{message:"Strikethrough"})}),e.jsx(g,{value:"super",endSection:e.jsx(Te,{modifier:!0,separator:" ",children:"."}),children:e.jsx(r,{message:"Superscript"})}),e.jsx(g,{value:"sub",endSection:e.jsx(Te,{modifier:!0,separator:" ",children:","}),children:e.jsx(r,{message:"Subscript"})}),e.jsx(g,{value:"blockquote",endSection:e.jsx(Te,{modifier:!0,children:"Shift+B"}),children:e.jsx(r,{message:"Blockquote"})}),e.jsx(g,{value:"paragraph",endSection:e.jsx(Te,{modifier:!0,children:"Alt+0"}),children:e.jsx(r,{message:"Paragraph"})})]})]})}const mx=E(e.jsx("path",{d:"M2 20h20v4H2v-4zm3.49-3h2.42l1.27-3.58h5.65L16.09 17h2.42L13.25 3h-2.5L5.49 17zm4.42-5.61 2.03-5.79h.12l2.03 5.79H9.91z"}),"FormatColorTextOutlined"),hx=E(e.jsx("path",{d:"M16.56 8.94 7.62 0 6.21 1.41l2.38 2.38-5.15 5.15c-.59.59-.59 1.54 0 2.12l5.5 5.5c.29.29.68.44 1.06.44s.77-.15 1.06-.44l5.5-5.5c.59-.58.59-1.53 0-2.12zM5.21 10 10 5.21 14.79 10H5.21zM19 11.5s-2 2.17-2 3.5c0 1.1.9 2 2 2s2-.9 2-2c0-1.33-2-3.5-2-3.5zM2 20h20v4H2v-4z"}),"FormatColorFillOutlined");function xx({editor:s,size:t}){const[a,n]=d.useState(!1),i=s.getAttributes("textStyle").color,l=s.getAttributes("textStyle").backgroundColor;return e.jsxs(d.Fragment,{children:[e.jsxs("span",{className:v("flex-shrink-0 whitespace-nowrap"),children:[e.jsx(k,{size:t,color:i?"primary":null,onClick:()=>{n("text")},children:e.jsx(mx,{})}),e.jsx(k,{size:t,color:l?"primary":null,onClick:()=>{n("bg")},children:e.jsx(hx,{})})]}),e.jsx(P,{defaultValue:a==="text"?"#000000":"#FFFFFF",type:"modal",isOpen:!!a,onClose:o=>{o&&(a==="text"?s.commands.setColor(o):s.commands.setBackgroundColor(o)),n(!1)},children:e.jsx(Kt,{})})]})}const gx=E(e.jsx("path",{d:"M15 15H3v2h12v-2zm0-8H3v2h12V7zM3 13h18v-2H3v2zm0 8h18v-2H3v2zM3 3v2h18V3H3z"}),"FormatAlignLeftOutlined"),px=E(e.jsx("path",{d:"M7 15v2h10v-2H7zm-4 6h18v-2H3v2zm0-8h18v-2H3v2zm4-6v2h10V7H7zM3 3v2h18V3H3z"}),"FormatAlignCenterOutlined"),jx=E(e.jsx("path",{d:"M3 21h18v-2H3v2zm6-4h12v-2H9v2zm-6-4h18v-2H3v2zm6-4h12V7H9v2zM3 3v2h18V3H3z"}),"FormatAlignRightOutlined"),fx=E(e.jsx("path",{d:"M3 21h18v-2H3v2zm0-4h18v-2H3v2zm0-4h18v-2H3v2zm0-4h18V7H3v2zm0-6v2h18V3H3z"}),"FormatAlignJustifyOutlined"),Ks={left:{icon:gx,label:h("Align left")},center:{icon:px,label:h("Align center")},right:{icon:jx,label:h("Align right")},justify:{icon:fx,label:h("Justify")}};function bx({editor:s,size:t}){const a=Object.keys(Ks).find(i=>s.isActive({textAlign:i}))||"left",n=a?Ks[a].icon:Ks.left.icon;return e.jsxs(ws,{floatingWidth:"auto",selectionMode:"single",selectedValue:a,onSelectionChange:i=>{s.commands.focus(),s.commands.setTextAlign(i)},children:[e.jsx(k,{size:t,color:a?"primary":null,className:v("flex-shrink-0"),children:e.jsx(n,{})}),e.jsx(Ss,{children:Object.entries(Ks).map(([i,l])=>{const o=l.icon;return e.jsx(g,{value:i,startIcon:e.jsx(o,{size:"md"}),capitalizeFirst:!0,children:e.jsx(r,{message:l.label.message})},i)})})]})}const vx=E(e.jsx("path",{d:"M11 17h10v-2H11v2zm-8-5 4 4V8l-4 4zm0 9h18v-2H3v2zM3 3v2h18V3H3zm8 6h10V7H11v2zm0 4h10v-2H11v2z"}),"FormatIndentDecreaseOutlined"),yx=E(e.jsx("path",{d:"M3 21h18v-2H3v2zM3 8v8l4-4-4-4zm8 9h10v-2H11v2zM3 3v2h18V3H3zm8 6h10V7H11v2zm0 4h10v-2H11v2z"}),"FormatIndentIncreaseOutlined");function wx({editor:s,size:t}){return e.jsxs("span",{className:v("flex-shrink-0","whitespace-nowrap"),children:[e.jsx(G,{label:e.jsx(r,{message:"Decrease indent"}),children:e.jsx(k,{size:t,onClick:()=>{s.commands.focus(),s.commands.outdent()},children:e.jsx(vx,{})})}),e.jsx(G,{label:e.jsx(r,{message:"Increase indent"}),children:e.jsx(k,{size:t,onClick:()=>{s.commands.focus(),s.commands.indent()},children:e.jsx(yx,{})})})]})}function Sx({editor:s,size:t}){const a=s.getAttributes("codeBlock").language||"";return e.jsxs(ws,{selectionMode:"single",selectedValue:a,onSelectionChange:n=>{s.commands.toggleCodeBlock({language:n})},children:[e.jsx(G,{label:e.jsx(r,{message:"Codeblock"}),children:e.jsx(k,{className:v("flex-shrink-0"),size:t,color:a?"primary":null,children:e.jsx(Sr,{})})}),e.jsxs(Ss,{children:[e.jsx(g,{value:"html",children:"HTML"}),e.jsx(g,{value:"javascript",children:"JavaScript"}),e.jsx(g,{value:"css",children:"CSS"}),e.jsx(g,{value:"php",children:"PHP"}),e.jsx(g,{value:"shell",children:"Shell"}),e.jsx(g,{value:"bash",children:"Bash"}),e.jsx(g,{value:"ruby",children:"Ruby"}),e.jsx(g,{value:"python",children:"Python"}),e.jsx(g,{value:"java",children:"Java"}),e.jsx(g,{value:"c++",children:"C++"})]})]})}const kx=E(e.jsx("path",{d:"M7.41 18.59 8.83 20 12 16.83 15.17 20l1.41-1.41L12 14l-4.59 4.59zm9.18-13.18L15.17 4 12 7.17 8.83 4 7.41 5.41 12 10l4.59-4.59z"}),"UnfoldLessOutlined"),_a="flex items-center px-4 h-42 text-muted border-b overflow-hidden";function Nx({editor:s,size:t="md",justify:a="justify-center",hideInsertButton:n=!1,imageDiskPrefix:i}){const l=Le(),[o,c]=d.useState(!1);return e.jsxs("div",{className:v(o?"h-84":"h-42"),children:[e.jsxs("div",{className:v(_a,a,"relative z-20"),children:[e.jsx(ux,{editor:s,size:t}),e.jsx(js,{}),e.jsx(Kh,{editor:s,size:t}),e.jsx(js,{}),e.jsx(bx,{editor:s,size:t}),e.jsx(wx,{editor:s,size:t}),e.jsx(js,{}),l?e.jsx(k,{className:"flex-shrink-0",color:o?"primary":null,size:t,onClick:()=>{c(!o)},children:o?e.jsx(kx,{}):e.jsx(Xi,{})}):e.jsx(Fa,{editor:s,size:t,hideInsertButton:n,imageDiskPrefix:i})]}),e.jsx(fs,{children:o&&e.jsx(Qe.div,{className:v(_a,a,"absolute flex h-full w-full"),initial:{y:"-100%"},animate:{y:0},exit:{y:"-100%"},children:e.jsx(Fa,{editor:s,size:t,imageDiskPrefix:i})})})]})}function Fa({editor:s,size:t="md",hideInsertButton:a,imageDiskPrefix:n}){return e.jsxs(d.Fragment,{children:[e.jsx(Jh,{editor:s,size:t}),e.jsx(js,{}),e.jsx(Zh,{editor:s,size:t}),e.jsx(tx,{editor:s,size:t,diskPrefix:n}),!a&&e.jsx(cx,{editor:s,size:t}),e.jsx(js,{}),e.jsx(xx,{editor:s,size:t}),e.jsx(js,{}),e.jsx(Sx,{editor:s,size:t}),e.jsx(nx,{editor:s,size:t})]})}function kr({editor:s,allowSlugEditing:t=!0,onSave:a,saveButton:n,isLoading:i=!1,backLink:l,slugPrefix:o="pages",imageDiskPrefix:c}){const{isSticky:m,sentinelRef:u}=ar(),x=Le();return e.jsxs(d.Fragment,{children:[e.jsx("div",{ref:u}),e.jsxs("div",{className:v("sticky top-0 z-10 mb-20 bg",m&&"shadow"),children:[e.jsxs("div",{className:"flex items-center justify-between gap-20 border-b px-20 py-10 text-muted sm:justify-start",children:[!x&&e.jsxs(d.Fragment,{children:[e.jsx(f,{variant:"text",size:"sm",elementType:B,to:l,relative:"path",startIcon:e.jsx(el,{}),children:e.jsx(r,{message:"Back"})}),e.jsx("div",{className:"mr-auto",children:t&&e.jsx(_x,{name:"slug",showLinkIcon:!1,prefix:o})})]}),s&&e.jsx(qh,{editor:s}),!x&&e.jsx(Hh,{editor:s}),a&&e.jsx(Cx,{onSave:()=>{a(s.getHTML())},isLoading:i}),n]}),e.jsx(Nx,{editor:s,size:"sm",imageDiskPrefix:c})]})]})}function Cx({onSave:s,isLoading:t}){const n=F().watch("title");return e.jsx(f,{variant:"flat",size:"sm",color:"primary",className:"min-w-90",disabled:t||!n,onClick:()=>s(),children:e.jsx(r,{message:"Save"})})}function _x({name:s,...t}){const{field:{onChange:a,onBlur:n,value:i="",ref:l}}=ys({name:s}),o=d.useRef(!1),{watch:c,setValue:m}=F();return d.useEffect(()=>{const u=c((x,{name:j})=>{j==="title"&&!o.current&&m("slug",x.title)});return()=>u.unsubscribe()},[c,m]),e.jsx(Rh,{className:v(!i&&"invisible"),onChange:u=>{o.current=!0,a(u)},onInputBlur:n,value:i,inputRef:l,...t})}const Fx=$.lazy(()=>$s(()=>import("./article-body-editor-e3648148.js"),["./article-body-editor-e3648148.js","./main-d4af3e3c.js","./main-57ebb2c7.css","./highlight-material-palenight-6689bed9.js","./highlight-material-palenight-c0ff5600.css"],import.meta.url));function zx(){const s=fi();return s.data?e.jsxs(d.Fragment,{children:[e.jsx(bi,{query:s}),e.jsx(Ix,{page:s.data.page})]}):e.jsx("div",{className:"relative w-full h-full",children:e.jsx(vi,{query:s})})}function Ix({page:s}){const t=je(),a=Mh(),n=K({defaultValues:{title:s.title,slug:s.slug,body:s.body}}),i=l=>{a.mutate({...n.getValues(),body:l},{onSuccess:()=>t("../..",{relative:"path"})})};return e.jsx(d.Suspense,{fallback:e.jsx(Ze,{}),children:e.jsx(Fx,{initialContent:s.body,children:(l,o)=>e.jsx(Ls,{children:e.jsxs(Ga,{...n,children:[e.jsx(kr,{editor:o,backLink:"../..",isLoading:a.isPending,onSave:i}),e.jsx("div",{className:"mx-20",children:e.jsxs("div",{className:"prose dark:prose-invert mx-auto flex-auto",children:[e.jsx(wr,{}),l]})})]})})})})}function Ax(s){const t=s||"custom-pages";return R({mutationFn:a=>Ex(a,t),onError:a=>se(a),onSuccess:async()=>{await D.invalidateQueries({queryKey:["custom-pages"]}),await D.invalidateQueries({queryKey:Y(t)}),O(h("Page created"))}})}function Ex(s,t){return I.post(`${t}`,s).then(a=>a.data)}const Px=$.lazy(()=>$s(()=>import("./article-body-editor-e3648148.js"),["./article-body-editor-e3648148.js","./main-d4af3e3c.js","./main-57ebb2c7.css","./highlight-material-palenight-6689bed9.js","./highlight-material-palenight-c0ff5600.css"],import.meta.url));function Tx(){const s=je(),t=Ax(),a=K(),n=i=>{t.mutate({...a.getValues(),body:i},{onSuccess:()=>s("../",{relative:"path"})})};return e.jsx(d.Suspense,{fallback:e.jsx(Ze,{}),children:e.jsx(Px,{children:(i,l)=>e.jsx(Ls,{children:e.jsxs(Ga,{...a,children:[e.jsx(kr,{editor:l,isLoading:t.isPending,onSave:n,backLink:"../"}),e.jsx("div",{className:"mx-20",children:e.jsxs("div",{className:"prose dark:prose-invert mx-auto flex-auto",children:[e.jsx(wr,{}),i]})})]})})})})}const $x=""+new URL("font-a5a81d1a.svg",import.meta.url).href;function Lx({state:{filters:s,setFilters:t}}){const{trans:a}=M();return e.jsxs("div",{className:"mb-24 items-center gap-24 @xs:flex",children:[e.jsx(Ye,{className:"mb-12 flex-auto @xs:mb-0",value:s.query,onChange:n=>{t({...s,query:n.target.value})},startAdornment:e.jsx(Zs,{}),placeholder:a(h("Search fonts"))}),e.jsxs(vs,{className:"flex-auto",selectionMode:"single",selectedValue:s.category,onSelectionChange:n=>{t({...s,category:n})},children:[e.jsx(g,{value:"",children:e.jsx(r,{message:"All categories"})}),e.jsx(g,{value:"serif",children:e.jsx(r,{message:"Serif"})}),e.jsx(g,{value:"sans-serif",children:e.jsx(r,{message:"Sans serif"})}),e.jsx(g,{value:"display",children:e.jsx(r,{message:"Display"})}),e.jsx(g,{value:"handwriting",children:e.jsx(r,{message:"Handwriting"})}),e.jsx(g,{value:"monospace",children:e.jsx(r,{message:"Monospace"})})]})]})}function Mx(s){const t=yi({usage:"search",...s});return{startsWith(a,n){return n.length===0?!0:(a=a.normalize("NFC"),n=n.normalize("NFC"),t.compare(a.slice(0,n.length),n)===0)},endsWith(a,n){return n.length===0?!0:(a=a.normalize("NFC"),n=n.normalize("NFC"),t.compare(a.slice(-n.length),n)===0)},contains(a,n){if(n.length===0)return!0;a=a.normalize("NFC"),n=n.normalize("NFC");let i=0;const l=n.length;for(;i+l<=a.length;i++){const o=a.slice(i,i+l);if(t.compare(n,o)===0)return!0}return!1}}}const Dx=[{label:h("System"),family:'ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji"',category:"sans-serif"},{family:"Impact, Charcoal, sans-serif",category:"sans-serif"},{family:"Arial, Helvetica Neue, Helvetica, sans-serif",category:"serif"},{family:'"Comic Sans MS", cursive, sans-serif',category:"Handwriting"},{family:"Century Gothic, sans-serif",category:"sans-serif"},{family:'"Courier New", Courier, monospace',category:"monospace"},{family:'"Lucida Sans Unicode", "Lucida Grande", sans-serif',category:"sans-serif"},{family:'"Times New Roman", Times, serif',category:"serif"},{family:'"Lucida Console", Monaco, monospace',category:"monospace"},{family:'"Andele Mono", monospace, sans-serif',category:"sans-serif"},{family:"Verdana, Geneva, sans-serif",category:"sans-serif"},{family:'"Helvetica Neue", Helvetica, Arial, sans-serif',category:"sans-serif"}];function Rx({value:s,onChange:t}){const{data:a,isLoading:n}=ze(["googleFonts"]),[i,l]=d.useState(0),[o,c]=d.useState({query:"",category:(s==null?void 0:s.category)??""}),{contains:m}=Mx({sensitivity:"base"}),u=d.useCallback(w=>{c(w),l(0)},[]),x=d.useMemo(()=>Dx.concat((a==null?void 0:a.googleFonts)??[]),[a==null?void 0:a.googleFonts]),j=d.useMemo(()=>x.filter(w=>{var S;return m(w.family,o.query)&&(!o.category||((S=w.category)==null?void 0:S.toLowerCase())===o.category.toLowerCase())}),[x,o,m]),b=d.useMemo(()=>nn(j,20),[j]),y=b[i];return d.useEffect(()=>{const w="font-selector";y!=null&&y.length&&wi(y,{id:w})},[y,i]),{fonts:y||[],currentPage:i,filteredFonts:j||[],setCurrentPage:l,isLoading:n,filters:o,setFilters:u,value:s,onChange:t,pages:b}}function Vx({state:{currentPage:s=0,setCurrentPage:t,filteredFonts:a,pages:n}}){const i=(a==null?void 0:a.length)||0;return e.jsxs("div",{className:"flex items-center justify-end gap-24 text-sm mt-30 pt-14 border-t",children:[i>0&&e.jsx("div",{children:e.jsx(r,{message:":from - :to of :total",values:{from:s*20+1,to:Math.min((s+1)*20,i),total:i}})}),e.jsxs("div",{className:"text-muted",children:[e.jsx(k,{disabled:s<1,onClick:()=>{t(Math.max(0,s-1))},children:e.jsx(Ys,{})}),e.jsx(k,{disabled:s>=n.length-1,onClick:()=>{t(s+1)},children:e.jsx(Ds,{})})]})]})}function Ox(s){const t=Rx(s);return e.jsxs("div",{className:s.className,children:[e.jsx(Lx,{state:t}),e.jsx(fs,{initial:!1,mode:"wait",children:e.jsx(qx,{state:t})}),e.jsx(Vx,{state:t})]})}function qx({state:s}){const{isLoading:t,fonts:a}=s,n="grid gap-24 grid-cols-[repeat(auto-fill,minmax(90px,1fr))] items-start";return t?e.jsx(Bx,{className:n}):a!=null&&a.length?e.jsx(Qe.div,{...bs,className:n,children:a==null?void 0:a.map(i=>e.jsx(Hx,{font:i,state:s},i.family))},"font-list"):e.jsx(et,{className:"mt-60",size:"sm",image:e.jsx(st,{src:$x}),title:e.jsx(r,{message:"No matching fonts"}),description:e.jsx(r,{message:"Try another search query or different category"})})}function Hx({font:s,state:{value:t,onChange:a}}){const n=(t==null?void 0:t.family)===s.family,i=s.family.split(",")[0].replace(/"/g,"");return e.jsxs(tt,{display:"block",onClick:()=>{a(s)},children:[e.jsx("span",{className:v("flex aspect-square items-center justify-center rounded-panel border text-4xl transition-bg-color hover:bg-hover md:text-5xl",n&&"ring-2 ring-primary ring-offset-2"),children:e.jsx("span",{style:{fontFamily:s.family},children:"Aa"})}),e.jsx("span",{className:v("mt-6 block overflow-hidden overflow-ellipsis whitespace-nowrap text-sm",n&&"text-primary"),children:s.label?e.jsx(r,{...s.label}):i})]},s.family)}function Bx({className:s}){const t=Array.from(Array(20).keys());return e.jsx(Qe.div,{...bs,className:s,children:t.map(a=>e.jsxs("div",{children:[e.jsx("div",{className:"aspect-square",children:e.jsx(as,{display:"block",variant:"rect"})}),e.jsx(as,{className:"mt-6 text-sm"})]},a))},"font-list-skeleton")}function Ux(){const{setValue:s,watch:t}=F(),{themeIndex:a}=ue(),n=`appearance.themes.all.${a}.font`;return e.jsx(Ox,{value:t(n),onChange:i=>{s(n,i,{shouldDirty:!0}),V().preview.setThemeFont(i)}})}const Wx={"rounded-none":{label:h("Square"),value:"0px"},"rounded-sm":{label:h("Small"),value:"0.125rem"},"rounded-md":{label:h("Medium"),value:"0.25rem"},"rounded-lg":{label:h("Large"),value:"0.5rem"},"rounded-xl":{label:h("Larger"),value:"0.75rem"},"rounded-full":{label:h("Pill"),value:"9999px"}};function Kx(){return e.jsxs("div",{className:"space-y-24",children:[e.jsx(bt,{label:e.jsx(r,{message:"Button rounding"}),name:"button-radius"}),e.jsx(bt,{label:e.jsx(r,{message:"Input rounding"}),name:"input-radius"}),e.jsx(bt,{label:e.jsx(r,{message:"Panel rounding"}),name:"panel-radius",hidePill:!0})]})}function bt({label:s,name:t,hidePill:a}){const{themeIndex:n}=ue(),{watch:i,setValue:l}=F(),o=`appearance.themes.all.${n}.values.--be-${t}`,c=i(o);return e.jsxs("div",{children:[e.jsx("div",{className:"mb-10 text-sm font-semibold",children:s}),e.jsx("div",{className:"grid grid-cols-3 gap-10 text-sm",children:Object.entries(Wx).filter(([m])=>!a||!m.includes("full")).map(([m,{label:u,value:x}])=>e.jsx(Gx,{radius:m,isActive:x===c,onClick:()=>{l(o,x,{shouldDirty:!0})},children:e.jsx(r,{...u})},m))})]})}function Gx({radius:s,children:t,isActive:a,onClick:n}){return e.jsx(tt,{display:"block",className:v("h-36 border-2 hover:bg-hover",s,a&&"border-primary"),onClick:n,children:t})}const za=["schedule","error","outgoing-email"];function Qx(){const{pathname:s}=at(),t=s.split("/").pop(),a=za.includes(t)?za.indexOf(t):0;return e.jsxs(Zt,{className:"p-12 md:p-24",selectedTab:a,children:[e.jsxs(Xt,{children:[e.jsx(is,{elementType:B,to:"/admin/logs/schedule",replace:!0,children:e.jsx(r,{message:"Schedule"})}),e.jsx(is,{elementType:B,to:"/admin/logs/error",replace:!0,children:e.jsx(r,{message:"Error"})}),e.jsx(is,{elementType:B,to:"/admin/logs/outgoing-email",replace:!0,children:e.jsx(r,{message:"Email"})})]}),e.jsx(Js,{})]})}function Jx({value:s}){return s?e.jsx(At,{className:"icon-md text-positive"}):e.jsx(qe,{className:"icon-md text-danger"})}function Nr(){const{trans:s}=M();return R({mutationFn:t=>Yx(t),onSuccess:async(t,a)=>{await D.invalidateQueries({queryKey:Y("logs/schedule")}),O.positive(s(h("Command reran")))},onError:t=>se(t)})}function Yx({id:s}){return I.post(`logs/schedule/rerun/${s}`).then(t=>t.data)}const Zx=E(e.jsx("path",{d:"M21 12V6c0-1.1-.9-2-2-2h-1V2h-2v2H8V2H6v2H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h7v-2H5V10h14v2h2zm-2-4H5V6h14v2zm-3.36 12c.43 1.45 1.77 2.5 3.36 2.5 1.93 0 3.5-1.57 3.5-3.5s-1.57-3.5-3.5-3.5c-.95 0-1.82.38-2.45 1H18V18h-4v-4h1.5v1.43c.9-.88 2.14-1.43 3.5-1.43 2.76 0 5 2.24 5 5s-2.24 5-5 5c-2.42 0-4.44-1.72-4.9-4h1.54z"}),"EventRepeatOutlined"),Xx=[{key:"command",allowsSorting:!0,visibleInMode:"all",width:"flex-3 min-w-200",header:()=>e.jsx(r,{message:"Name"}),body:s=>e.jsx(es,{label:s.command,description:s.output})},{key:"ran_at",allowsSorting:!0,header:()=>e.jsx(r,{message:"Ran at"}),body:s=>e.jsx(Vt,{date:s.ran_at})},{key:"duration",allowsSorting:!0,header:()=>e.jsx(r,{message:"Duration"}),body:s=>`${s.duration}ms`},{key:"exit_code",allowsSorting:!0,header:()=>e.jsx(r,{message:"Completed"}),body:s=>e.jsx(Jx,{value:s.exit_code===0})},{key:"count_in_last_hour",allowsSorting:!0,header:()=>e.jsx(r,{message:"Runs recently"}),body:s=>e.jsx(sl,{value:s.count_in_last_hour})},{key:"actions",header:()=>e.jsx(r,{message:"Actions"}),hideHeader:!0,align:"end",width:"w-42 flex-shrink-0",visibleInMode:"all",body:s=>e.jsx(eg,{item:s})}];function eg({item:s}){const t=Nr();return e.jsx(G,{label:e.jsx(r,{message:"Rerun now"}),children:e.jsx(k,{size:"md",className:"text-muted",disabled:t.isPending,onClick:()=>{t.mutate({id:s.id})},children:e.jsx(Zx,{})})})}const sg=""+new URL("timeline-172fbeee.svg",import.meta.url).href,ta=E(e.jsx("path",{d:"M19 9h-4V3H9v6H5l7 7 7-7zm-8 2V5h2v6h1.17L12 13.17 9.83 11H11zm-6 7h14v2H5z"}),"DownloadOutlined");function Ia(){return e.jsx(Ee,{padding:"pt-12 md:pt-24",endpoint:"logs/schedule",title:e.jsx(r,{message:"CRON schedule log"}),columns:Xx,actions:e.jsx(tg,{}),enableSelection:!1,emptyStateMessage:e.jsx(ye,{image:sg,title:e.jsx(r,{message:"No scheduled commands have ran yet"}),filteringTitle:e.jsx(r,{message:"No matching scheduled commands"})})})}function tg(){return e.jsx(Me,{elementType:"a",href:"api/v1/logs/schedule/download",download:!0,icon:e.jsx(ta,{}),children:e.jsx(r,{message:"Download log"})})}const ag=""+new URL("bug-fixing-bd601a66.svg",import.meta.url).href,ng=[{key:"message",visibleInMode:"all",width:"flex-3 min-w-200",header:()=>e.jsx(r,{message:"Message"}),body:s=>s.message},{key:"datetime",header:()=>e.jsx(r,{message:"Date"}),body:s=>e.jsx(Vt,{date:s.datetime})},{key:"severity",header:()=>e.jsx(r,{message:"Severity"}),body:s=>e.jsxs("span",{className:v("flex items-center gap-6 text-xs capitalize",s.level==="error"?"text-danger":"text-primary"),children:[s.level==="error"?e.jsx(Ea,{size:"sm"}):e.jsx(tl,{size:"sm"}),s.level]})}];function rg({error:s}){return e.jsxs(Z,{size:"fullscreen",children:[e.jsx(ne,{showDivider:!0,padding:"px-24 py-10",actions:e.jsx(f,{variant:"outline",size:"xs",onClick:()=>ig(s),children:e.jsx(r,{message:"Download"})}),children:e.jsx(r,{message:"Error details"})}),e.jsx(ee,{children:e.jsx("pre",{className:"whitespace-pre-wrap break-words text-xs leading-5",children:s.exception})})]})}function ig(s){const t=document.createElement("a");t.setAttribute("href","data:text/plain;charset=utf-8,"+encodeURIComponent(s.exception)),t.setAttribute("download",`error-${s.id}.log`),t.style.display="none",document.body.appendChild(t),t.click(),document.body.removeChild(t)}function lg(){return R({mutationFn:s=>og(s),onSuccess:(s,t)=>{qt(s.url,t.name)},onError:s=>se(s)})}function og({identifier:s}){return I.get(`logs/error/${s}/download`).then(t=>t.data)}function cg(){const{trans:s}=M();return R({mutationFn:t=>dg(t),onSuccess:async()=>{await D.invalidateQueries({queryKey:Y("logs/error")}),O(s(h("Log file deleted")))},onError:t=>se(t)})}function dg({identifier:s}){return I.delete(`logs/error/${s}`).then(t=>t.data)}function ug(){return e.jsx(Ee,{padding:"pt-12 md:pt-24",endpoint:"logs/error",title:e.jsx(r,{message:"Error log"}),onRowAction:s=>{Qa(rg,{error:s})},columns:ng,actions:e.jsx(mg,{}),enableSelection:!1,emptyStateMessage:e.jsx(ye,{image:ag,title:e.jsx(r,{message:"No errors have been logged yet"}),filteringTitle:e.jsx(r,{message:"No matching error log entries"})})})}function mg(){var o;const s=lg(),{query:t,setParams:a}=lt(),n=d.useRef(!1),[i,l]=d.useState(null);return d.useEffect(()=>{var c,m;if((m=(c=t.data)==null?void 0:c.files)!=null&&m.length&&!n.current){n.current=!0;const u=t.data.files[0].identifier;l(t.data.files[0].identifier),u!==t.data.selectedFile&&a({file:t.data.files[0].identifier})}},[t.data,a,n]),e.jsxs(d.Fragment,{children:[e.jsx(hg,{files:((o=t.data)==null?void 0:o.files)??null,selectedFile:i,onSelected:c=>{l(c.identifier),a({file:c.identifier})}}),e.jsx(f,{variant:"outline",color:"danger",disabled:!i,onClick:()=>Qa(xg,{identifier:i}),children:e.jsx(r,{message:"Delete"})}),e.jsx(Me,{disabled:!i,onClick:()=>{var c,m;if(i){const u=(m=(c=t.data)==null?void 0:c.files.find(x=>x.identifier===i))==null?void 0:m.name;s.mutate({identifier:i,name:u})}},icon:e.jsx(ta,{}),children:e.jsx(r,{message:"Download log"})})]})}function hg({files:s,selectedFile:t,onSelected:a}){return s?s.length?e.jsx(vs,{selectionMode:"single",selectedValue:t,size:"sm",minWidth:"min-w-[210px]",children:s==null?void 0:s.map(n=>e.jsxs(g,{value:n.identifier,onSelected:()=>a(n),children:[n.name," (",e.jsx(xr,{bytes:n.size}),")"]},n.identifier))}):null:e.jsx(as,{variant:"rect",className:"max-w-[210px]"})}function xg({identifier:s}){const t=cg();return e.jsx(Fe,{title:e.jsx(r,{message:"Delete log file"}),body:e.jsx(r,{message:"Are you sure you want to delete this log file?"}),confirm:e.jsx(r,{message:"Delete"}),onConfirm:()=>t.mutate({identifier:s},{onSuccess:()=>Si()}),isLoading:t.isPending,isDanger:!0})}const gg=""+new URL("opened-4dded9dc.svg",import.meta.url).href;function pg(s){return $e({queryKey:["logs/outgoing-email",s],queryFn:()=>jg(s)})}function jg(s){return I.get(`logs/outgoing-email/${s}`).then(t=>t.data)}function fg({logItemId:s}){const{data:t}=pg(s),{base_url:a}=we();return e.jsxs(Z,{size:"fullscreen",children:[e.jsx(ne,{showDivider:!0,padding:"px-24 py-10",actions:e.jsx(f,{variant:"outline",size:"xs",disabled:!t,type:"button",onClick:t?()=>qt(`${a}/api/v1/logs/outgoing-email/${s}/download`):void 0,children:e.jsx(r,{message:"Download"})}),children:e.jsx(r,{message:"Email preview"})}),e.jsx(ee,{children:t?e.jsx("iframe",{srcDoc:t.logItem.parsed_message.body.html,className:"h-max w-full border-none",onLoad:n=>{const i=n.target;i.style.height=i.contentWindow.document.body.scrollHeight+"px"}}):e.jsx("div",{className:"flex min-h-200 items-center justify-center",children:e.jsx(Ms,{isIndeterminate:!0})})})]})}const bg=[{key:"message_id",allowsSorting:!0,visibleInMode:"all",width:"flex-3 min-w-200",header:()=>e.jsx(r,{message:"Subject"}),body:s=>e.jsx(es,{label:s.subject,description:s.message_id})},{key:"status",allowsSorting:!0,header:()=>e.jsx(r,{message:"Status"}),body:s=>{switch(s.status){case"sent":return e.jsx(vt,{color:"positive",children:e.jsx(r,{message:"Sent"})});case"not-sent":return e.jsx(vt,{color:void 0,children:e.jsx(r,{message:"Not sent"})});case"error":return e.jsx(vt,{color:"danger",children:e.jsx(r,{message:"Error"})})}}},{key:"from",allowsSorting:!0,header:()=>e.jsx(r,{message:"From"}),body:s=>s.from},{key:"to",allowsSorting:!0,header:()=>e.jsx(r,{message:"To"}),body:s=>s.to},{key:"created_at",allowsSorting:!0,header:()=>e.jsx(r,{message:"Date"}),body:s=>e.jsx(Vt,{date:s.created_at})},{key:"actions",header:()=>e.jsx(r,{message:"Actions"}),hideHeader:!0,align:"end",width:"w-42 flex-shrink-0",visibleInMode:"all",body:s=>e.jsx(vg,{item:s})}];function vg({item:s}){const t=Nr();return e.jsxs(P,{type:"modal",children:[e.jsx(G,{label:e.jsx(r,{message:"Preview"}),children:e.jsx(k,{size:"md",className:"text-muted",disabled:t.isPending,onClick:()=>{t.mutate({id:s.id})},children:e.jsx(gr,{})})}),e.jsx(fg,{logItemId:s.id})]})}function vt({color:s,children:t}){return e.jsx(Et,{color:s,size:"xs",className:"w-max min-w-50 text-center",children:t})}const yg=[{key:"status",label:h("Status"),description:h("Status of the outgoing email"),defaultOperator:ie.eq,control:{type:oe.Select,defaultValue:"01",options:[{key:"01",label:h("Not sent"),value:"no-sent"},{key:"02",label:h("Sent"),value:"sent"},{key:"03",label:h("Error"),value:"error"}]}},us({description:h("Date email send was attempted")})];function wg(){return e.jsx(Ee,{padding:"pt-12 md:pt-24",endpoint:"logs/outgoing-email",title:e.jsx(r,{message:"Outgoing email"}),columns:bg,filters:yg,actions:e.jsx(Sg,{}),enableSelection:!1,emptyStateMessage:e.jsx(ye,{image:gg,title:e.jsx(r,{message:"No outgoing emails have been logged yet"}),filteringTitle:e.jsx(r,{message:"No matching emails"})})})}function Sg(){return e.jsx(Me,{elementType:"a",href:"api/v1/logs/outgoing-email/download",download:!0,icon:e.jsx(ta,{}),children:e.jsx(r,{message:"Download log"})})}const kg=$.lazy(()=>$s(()=>import("./admin-report-page-1fe39517.js"),["./admin-report-page-1fe39517.js","./main-d4af3e3c.js","./main-57ebb2c7.css","./TrendingUp-a701ee5e.js","./Info-61549577.js","./Edit-007bdb63.js","./use-resume-subscription-81a149c4.js"],import.meta.url)),Ng=[{path:"appearance",element:e.jsx(te,{permission:"appearance.update",children:e.jsx(cc,{})}),children:[{index:!0,element:e.jsx(nm,{})},{path:"general",element:e.jsx(Ec,{})},{path:"seo-settings",element:e.jsx(qc,{})},{path:"custom-code",element:e.jsx(Uc,{})},{path:"themes",element:e.jsx(Lc,{})},{path:"themes/:themeIndex",element:e.jsx(wd,{})},{path:"themes/:themeIndex/font",element:e.jsx(Ux,{})},{path:"themes/:themeIndex/radius",element:e.jsx(Kx,{})},{path:"menus",element:e.jsx(hc,{})},{path:"menus/:menuIndex",element:e.jsx(kc,{})},{path:"menus/:menuIndex/items/:menuItemIndex",element:e.jsx(zc,{})},...Object.values(Gn.sections).flatMap(s=>s.routes||[])]},{path:"/",element:e.jsx(ol,{}),children:[...Lh,{path:"/",element:e.jsx($.Suspense,{fallback:e.jsx(Ze,{screen:!0}),children:e.jsx(kg,{})})},{path:"users",element:e.jsx(te,{permission:"users.update",children:e.jsx(ql,{})})},{path:"users/new",element:e.jsx(te,{permission:"users.update",children:e.jsx(Lu,{})})},{path:"users/:userId/edit",element:e.jsx(te,{permission:"users.update",children:e.jsx(Eu,{})})},{path:"roles",element:e.jsx(te,{permission:"roles.update",children:e.jsx(lm,{})})},{path:"roles/new",element:e.jsx(te,{permission:"roles.update",children:e.jsx(zm,{})})},{path:"roles/:roleId/edit",element:e.jsx(te,{permission:"roles.update",children:e.jsx(km,{})})},{path:"subscriptions",element:e.jsx(te,{permission:"subscriptions.update",children:e.jsx(th,{})})},{path:"plans",element:e.jsx(te,{permission:"plans.update",children:e.jsx(ph,{})})},{path:"plans/new",element:e.jsx(te,{permission:"plans.update",children:e.jsx(Eh,{})})},{path:"plans/:productId/edit",element:e.jsx(te,{permission:"plans.update",children:e.jsx(Fh,{})})},{path:"custom-pages",element:e.jsx(te,{permission:"custom_pages.update",children:e.jsx(Qc,{})})},{path:"custom-pages/new",element:e.jsx(te,{permission:"custom_pages.update",children:e.jsx(Tx,{})})},{path:"custom-pages/:pageId/edit",element:e.jsx(te,{permission:"custom_pages.update",children:e.jsx(zx,{})})},{path:"tags",element:e.jsx(te,{permission:"tags.update",children:e.jsx(Vm,{})})},{path:"localizations",element:e.jsx(te,{permission:"localizations.update",children:e.jsx(Ku,{})})},{path:"localizations/:localeId/translate",element:e.jsx(Ju,{})},{path:"files",element:e.jsx(te,{permission:"files.update",children:e.jsx(Bm,{})})},{path:"ads",element:e.jsx(te,{permission:"settings.update",children:e.jsx(sm,{})})},{path:"settings",element:e.jsx(te,{permission:"settings.update",children:e.jsx(Xc,{})}),children:[{index:!0,element:e.jsx(Ha,{to:"general",replace:!0})},{path:"general",element:e.jsx(cd,{})},{path:"subscriptions",element:e.jsx(Fd,{})},{path:"localization",element:e.jsx(Ad,{})},{path:"authentication",element:e.jsx(Ed,{})},{path:"uploading",element:e.jsx(Jd,{})},{path:"outgoing-email",element:e.jsx(uu,{})},{path:"cache",element:e.jsx(gu,{})},{path:"analytics",element:e.jsx(_u,{})},{path:"logging",element:e.jsx(fu,{})},{path:"queue",element:e.jsx(vu,{})},{path:"recaptcha",element:e.jsx(Su,{})},{path:"gdpr",element:e.jsx(Ph,{})},...Nd]},{path:"logs",element:e.jsx(te,{permission:"logs.view",children:e.jsx(Qx,{})}),children:[{index:!0,element:e.jsx(Ia,{})},{path:"schedule",element:e.jsx(Ia,{})},{path:"error",element:e.jsx(ug,{})},{path:"outgoing-email",element:e.jsx(wg,{})}]}]},{path:"*",element:e.jsx(Ni,{})}];function Cg(){return ki(Ng)}const Ag=Object.freeze(Object.defineProperty({__proto__:null,default:Cg},Symbol.toStringTag,{value:"Module"}));export{gt as A,Ag as B,Sr as C,ta as D,Zx as E,xr as F,rx as H,ex as I,lx as N,Xm as P,Oh as R,ox as S,Mu as T,Vh as U,gr as V,gc as a,fl as b,px as c,fx as d,gx as e,jx as f,Bh as g,ax as h,hx as i,mx as j,vx as k,yx as l,Uh as m,Gh as n,Qh as o,Wh as p,an as q,eh as r,ix as s,vd as t,Au as u,jd as v,oh as w,xd as x,kx as y,Mx as z}; //# sourceMappingURL=admin-routes-8ad01f06.js.map