adminizer 4.5.0-build.197 → 4.5.0-build.199

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/assets/app.js CHANGED
@@ -1,4 +1,4 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./add-group-sofsuFYA.js","./app-layout-DM2_7wxW.js","./app-shell-CwiL9UZ5.js","./handsontable-PxYdjN8c.js","./jsoneditor-De1FvcYu.js","./monaco-BhBYtg3d.js","./app-sidebar-C7TXiSvV.js","./nav-main-G6VwCche.js","./material-icon-DZVU9Gse.js","./app-sidebar-header-qHEOMq5D.js","./breadcrumbs-D5PCyRGn.js","./nav-user-BfROibnw.js","./user-info-gFSwypEN.js","./user-menu-content-CjsydEH4.js","./theme-switcher-BURZ8Tza.js","./icon-FyVrxiPs.js","./add-group-form-DUhDxVwB.js","./add-user-DM1nsN83.js","./add-user-form-Ct4i6Dse.js","./input-error-cgnQ235Q.js","./add-D9qTFgIT.js","./add-form-Nn7zuSFW.js","./field-renderer-Ddc4u-gC.js","./dynamic-controls-k61T9W2P.js","./field-renderer-DV8OITPR.css","./DiffViewer-DL5uCv8d.js","./catalog-BIwiWMeW.js","./del-modal-yU9LPEgz.js","./catalog-D4n6dpGl.css","./dashboard-C2Y09gw1.js","./dashboard-BOltB2Hq.css","./form-P1bFGHCF.js","./form-G2lvZbid.js","./history-DHZfSpf_.js","./home-Do0C-Tzu.js","./init-user-DhzPzTRM.js","./list-D72uhn00.js","./list-table-BxVhDSbv.js","./pagination-render-CqNIIF8P.js","./login-CyEIe-hN.js","./module-DI6zzr4C.js","./notification-BZzAyhJ1.js","./tabs-BhUuWdzc.js","./register-Bt0RP4PE.js","./welcome-8dJL4cIX.js"])))=>i.map(i=>d[i]);
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./add-group-sofsuFYA.js","./app-layout-DM2_7wxW.js","./app-shell-CwiL9UZ5.js","./handsontable-PxYdjN8c.js","./jsoneditor-De1FvcYu.js","./monaco-BhBYtg3d.js","./app-sidebar-C7TXiSvV.js","./nav-main-G6VwCche.js","./material-icon-DZVU9Gse.js","./app-sidebar-header-qHEOMq5D.js","./breadcrumbs-D5PCyRGn.js","./nav-user-BfROibnw.js","./user-info-gFSwypEN.js","./user-menu-content-CjsydEH4.js","./theme-switcher-BURZ8Tza.js","./icon-FyVrxiPs.js","./add-group-form-DUhDxVwB.js","./add-user-DM1nsN83.js","./add-user-form-Ct4i6Dse.js","./input-error-cgnQ235Q.js","./add-D9qTFgIT.js","./add-form-Nn7zuSFW.js","./field-renderer-Ddc4u-gC.js","./dynamic-controls-k61T9W2P.js","./field-renderer-DV8OITPR.css","./DiffViewer-DL5uCv8d.js","./catalog-BIwiWMeW.js","./del-modal-yU9LPEgz.js","./catalog-D4n6dpGl.css","./dashboard-C2Y09gw1.js","./dashboard-BOltB2Hq.css","./form-P1bFGHCF.js","./form-G2lvZbid.js","./history-DHZfSpf_.js","./home-Do0C-Tzu.js","./init-user-DhzPzTRM.js","./list-D72uhn00.js","./list-table-BxVhDSbv.js","./pagination-render-CqNIIF8P.js","./login-Cla-c7nv.js","./module-DI6zzr4C.js","./notification-BZzAyhJ1.js","./tabs-BhUuWdzc.js","./register-Bt0RP4PE.js","./welcome-8dJL4cIX.js"])))=>i.map(i=>d[i]);
2
2
  import{a as cee,c as UH,b as xa,s as Ma,d as ga,i as Mi,h as SF,m as Rj,e as see,f as lee,z as dee,v as uee,_ as vn}from"./jsoneditor-De1FvcYu.js";import{r as p,e as ke,a as Kd,b as CF,c as hee,R as MP,d as ur,F as Ca,f as Na,g as La,h as Ea,i as Ia,j as Aa,k as Ta,l as Ra,m as $a,n as ja,o as Pa,p as Oa,q as Da,s as za,t as qa,u as Ha,v as Va,w as Ba,x as Fa,y as Ua,z as Ga,A as Wa,B as Za,C as Xa,D as Ka,E as Ya,G as Qa,H as Ja,I as eo,J as to,K as no,L as ao,M as oo,N as ro,O as io,P as co,Q as so,S as lo,T as uo,U as ho,V as po,W as fo,X as yo,Y as mo,Z as vo,_ as ko,$ as go,a0 as Mo,a1 as xo,a2 as bo,a3 as wo,a4 as _o,a5 as So,a6 as Co,a7 as No,a8 as Lo,a9 as Eo,aa as Io,ab as Ao,ac as To,ad as Ro,ae as $o,af as jo,ag as Po,ah as Oo,ai as Do,aj as zo,ak as qo,al as Ho,am as Vo,an as Bo,ao as Fo,ap as Yd,aq as Qd,ar as Jd,as as pee,at as fee,au as yee,av as mee,aw as vee,ax as kee,ay as gee,az as Mee}from"./handsontable-PxYdjN8c.js";import{F as xee}from"./monaco-BhBYtg3d.js";var a$={exports:{}},e2={};/**
3
3
  * @license React
4
4
  * react-jsx-runtime.production.js
@@ -8070,4 +8070,4 @@ For more information, see https://radix-ui.com/primitives/docs/components/${t.do
8070
8070
  * Last updated: Mar 09, 2023
8071
8071
  *
8072
8072
  * Description: Definition file for Chinese - China language-country.
8073
- */const PHe={languageCode:"zh-CN",[Fo]:"上方插入行",[Bo]:"下方插入行",[Vo]:"左方插入列",[Ho]:"右方插入列",[qo]:["移除该行","移除多行"],[zo]:["移除该列","移除多列"],[Do]:"撤销",[Oo]:"恢复",[Po]:"只读",[jo]:"清空该列",[$o]:"对齐",[Ro]:"左对齐",[To]:"水平居中",[Ao]:"右对齐",[Io]:"两端对齐",[Eo]:"顶端对齐",[Lo]:"垂直居中",[No]:"底端对齐",[Co]:"冻结该列",[So]:"取消冻结",[_o]:"边框",[wo]:"上",[bo]:"右",[xo]:"下",[Mo]:"左",[go]:"移除边框",[ko]:"插入批注",[vo]:"编辑批注",[mo]:"删除批注",[yo]:"只读批注",[fo]:"合并",[po]:"取消合并",[ho]:"复制",[Jd]:"带标题的复制",[Qd]:"带标题组的复制",[Yd]:"仅复制标题",[uo]:"剪切",[lo]:"插入子行",[so]:"与母行分离",[co]:["隐藏该列","隐藏多列"],[io]:["显示该列","显示多列"],[ro]:["隐藏该行","隐藏多行"],[oo]:["显示该行","显示多行"],[ao]:"无",[no]:"为空",[to]:"不为空",[eo]:"等于",[Ja]:"不等于",[Qa]:"开头是",[Ya]:"结尾是",[Ka]:"包含",[Xa]:"不包含",[Za]:"大于",[Wa]:"大于或等于",[Ga]:"小于",[Ua]:"小于或等于",[Fa]:"在此范围",[Ba]:"不在此范围",[Va]:"之后",[Ha]:"之前",[qa]:"今天",[za]:"明天",[Da]:"昨天",[Oa]:"空白单元格",[Pa]:"按条件过滤",[ja]:"按值过滤",[$a]:"且",[Ra]:"或",[Ta]:"全选",[Aa]:"清除",[Ia]:"确认",[Ea]:"取消",[La]:"搜索",[Na]:"值",[Ca]:"第二值"};mee();const bF={de:CHe,en:gee,es:NHe,fr:LHe,it:EHe,ja:IHe,ko:AHe,nl:THe,pl:RHe,pt:$He,ru:jHe,zh:PHe},OHe=document.documentElement.lang,ZY=bF[OHe]??bF.en;vee(ZY);const XY=({config:e,data:t=[],onChange:a,disabled:o})=>{const{appearance:i}=JO(),[s,l]=p.useState("ht-theme-main"),[h,f]=p.useState(!1),y=p.useCallback((m,x)=>{var b,w;if(x==="loadData")return;const S=(w=(b=k.current)==null?void 0:b.hotInstance)==null?void 0:w.getSourceData();a(S)},[]),k=p.useRef(null);return p.useEffect(()=>{const m=setTimeout(()=>{var x;(x=k.current)!=null&&x.hotInstance&&(k.current.hotInstance.loadData(t??[]),f(!0))},100);return()=>clearTimeout(m)},[t]),p.useEffect(()=>{l(i==="dark"?"ht-theme-main-dark":"ht-theme-main")},[i]),M.jsx("div",{style:{opacity:h?1:0},children:M.jsx(kee,{className:o?"pointer-events-none opacity-50":"",themeName:s,language:ZY.languageCode,ref:k,...e,afterChange:y,children:e.columns.map(m=>M.jsx(Mee,{data:m.data,...m},m.data))})})},vVe=Object.freeze(Object.defineProperty({__proto__:null,default:XY},Symbol.toStringTag,{value:"Module"})),DHe=()=>{const[e,t]=p.useState({width:typeof window<"u"?window.innerWidth:1024,height:typeof window<"u"?window.innerHeight:768});return p.useEffect(()=>{if(typeof window>"u")return;const a=()=>{t({width:window.innerWidth,height:window.innerHeight})};return window.addEventListener("resize",a),()=>window.removeEventListener("resize",a)},[]),e},KY=({onChange:e,value:t,options:a,disabled:o})=>{const{appearance:i}=JO(),[s,l]=p.useState("light"),h=p.useRef(null),f=p.useRef(null),{width:y}=DHe(),k=y<768,m=y>=768&&y<1024,x=_=>{e(_)},S=_=>{h.current=_,b()},b=()=>{var N;if(!h.current)return;const _={minimap:{enabled:!k},fontSize:k?12:m?13:14,lineNumbers:k?"off":"on",lineDecorationsWidth:k?5:10,scrollBeyondLastLine:!k,wordWrap:k?"on":"bounded",renderWhitespace:k?"none":"selection",padding:{top:k?8:16,bottom:k?8:16}};h.current.updateOptions(_),(N=f.current)==null||N.classList.add("overflow-hidden"),setTimeout(()=>{var L,I;(L=h.current)==null||L.layout(),(I=f.current)==null||I.classList.remove("overflow-hidden")},100)};p.useEffect(()=>{l(i==="dark"?"vs-dark":"light")},[i]),p.useEffect(()=>{b()},[y]);const w=k?"300px":m?"400px":"500px";return M.jsx("div",{className:`border rounded-lg ${k?"p-1":"p-2"}`,ref:f,children:M.jsx(xee,{height:w,language:a.language,value:t,theme:s,options:{automaticLayout:!0,...k&&{wordWrap:"on"},minimap:{enabled:!k}},onChange:x,onMount:S,className:`transition-all duration-200 ease-in-out ${o?"pointer-events-none opacity-50 cursor-not-allowed":""}`})})},kVe=Object.freeze(Object.defineProperty({__proto__:null,default:KY},Symbol.toStringTag,{value:"Module"})),wF=gA("m-1 flex items-center border rounded-sm px-1",{variants:{variant:{default:"border-foreground/10 text-foreground bg-card hover:bg-card/80",secondary:"border-foreground/10 bg-secondary text-secondary-foreground hover:bg-secondary/80",destructive:"border-transparent bg-destructive text-destructive-foreground hover:bg-destructive/80",inverted:"inverted"}},defaultVariants:{variant:"default"}}),eD=p.forwardRef(({options:e,onValueChange:t,variant:a,processing:o,disabled:i,defaultValue:s=[],placeholder:l="",notFound:h="",search:f="",animation:y=0,maxCount:k=3,modalPopover:m=!1,asChild:x=!1,className:S,mode:b="multiple",...w},_)=>{const[N,L]=p.useState(s),[I,j]=p.useState(!1),[O,P]=p.useState(!1);p.useEffect(()=>{s&&L(s)},[s]);const A=q=>{if(q.key==="Enter")j(!0);else if(q.key==="Backspace"&&!q.currentTarget.value){const B=[...N];B.pop(),L(B),t(B)}},$=q=>{let B;b==="single"?B=N.includes(q)?[]:[q]:B=N.includes(q)?N.filter(Y=>Y!==q):[...N,q],L(B),t(B),b==="single"&&j(!1)},F=()=>{L([]),t([])},X=()=>{j(q=>!q)},H=()=>{const q=N.slice(0,k);L(q),t(q)};return M.jsxs(gK,{open:I,onOpenChange:j,modal:m,children:[M.jsx(MK,{asChild:!0,children:M.jsx(MA,{ref:_,...w,onClick:X,disabled:i,className:te("flex w-full p-1 rounded-md border-input border-1 min-h-10 h-auto items-center justify-between bg-inherit hover:bg-inherit [&_svg]:pointer-events-auto",S),children:N.length>0?M.jsxs("div",{className:"flex justify-between items-center w-full",children:[M.jsxs("div",{className:"flex flex-wrap items-center",children:[N.slice(0,k).map(q=>{const B=e.find(ue=>ue.value===q),Y=B==null?void 0:B.icon;return M.jsxs("div",{className:te(O?"animate-bounce":"",wF({variant:a})),style:{animationDuration:`${y}s`},children:[Y&&M.jsx(Y,{className:"h-4 w-4 mr-2"}),B==null?void 0:B.label,M.jsx(Or,{className:"ml-2 h-4 w-4 cursor-pointer",onClick:ue=>{ue.stopPropagation(),o||$(q)}})]},q)}),b==="multiple"&&N.length>k&&M.jsxs("div",{className:te("bg-transparent text-foreground border-foreground/1 hover:bg-transparent",O?"animate-bounce":"",wF({variant:a})),style:{animationDuration:`${y}s`},children:[`+ ${N.length-k} more`,M.jsx(Or,{className:"ml-2 h-4 w-4 cursor-pointer",onClick:q=>{q.stopPropagation(),H()}})]})]}),M.jsxs("div",{className:"flex items-center justify-between",children:[N.length>0&&M.jsxs(M.Fragment,{children:[M.jsx(bi,{className:"h-4 mx-2 cursor-pointer text-muted-foreground",onClick:q=>{q.stopPropagation(),F()}}),M.jsx(ZO,{orientation:"vertical",className:"flex min-h-6 h-full"})]}),M.jsx(xi,{className:"h-4 mx-2 cursor-pointer text-muted-foreground"})]})]}):M.jsxs("div",{className:"flex items-center justify-between w-full mx-auto",children:[M.jsx("span",{className:"text-sm text-muted-foreground mx-3",children:l}),M.jsx(xi,{className:"h-4 cursor-pointer text-muted-foreground mx-2"})]})})}),M.jsx(xK,{className:"w-auto p-0 z-[1003]",align:"start",onEscapeKeyDown:()=>j(!1),children:M.jsxs(sO,{children:[M.jsx(zW,{placeholder:f,onKeyDown:A}),M.jsxs(qW,{children:[M.jsx(HW,{children:h}),M.jsx(VW,{children:e.map(q=>{const B=N.includes(q.value);return M.jsxs(FW,{onSelect:()=>$(q.value),className:"cursor-pointer",children:[M.jsx("div",{className:te("mr-2 flex h-5 w-5 items-center justify-center rounded border border-primary",B?"bg-primary text-primary-foreground":"opacity-50 [&_svg]:invisible"),children:M.jsx(sr,{className:"h-4 w-4 text-primary-foreground"})}),q.icon&&M.jsx(q.icon,{className:"mr-2 h-4 w-4 text-muted-foreground"}),M.jsx("span",{children:q.label})]},q.value)})}),M.jsx(BW,{})]})]})}),y>0&&N.length>0&&b==="multiple"&&M.jsx(ki,{className:te("cursor-pointer my-2 text-foreground bg-background w-3 h-3",O?"":"text-muted-foreground"),onClick:()=>P(!O)})]})});eD.displayName="MultiSelect";const gVe=Object.freeze(Object.defineProperty({__proto__:null,default:eD},Symbol.toStringTag,{value:"Module"}));function zHe(){window.UIComponents??(window.UIComponents={}),window.JSComponents??(window.JSComponents={}),window.axios=Nt,window.sonner=Xqe,Object.assign(window.UIComponents,{Avatar:Dre,AvatarImage:zre,AvatarFallback:qre,Badge:Vre,Breadcrumb:F_e,BreadcrumbList:U_e,BreadcrumbItem:G_e,BreadcrumbLink:W_e,BreadcrumbPage:Z_e,BreadcrumbSeparator:X_e,BreadcrumbEllipsis:K_e,Button:MA,Calendar:ONe,Card:DNe,CardHeader:zNe,CardFooter:FNe,CardTitle:qNe,CardAction:VNe,CardDescription:HNe,CardContent:BNe,Checkbox:dLe,Collapsible:CLe,CollapsibleTrigger:NLe,CollapsibleContent:LLe,Command:sO,CommandDialog:OIe,CommandInput:zW,CommandList:qW,CommandEmpty:HW,CommandGroup:VW,CommandItem:FW,CommandShortcut:DIe,CommandSeparator:BW,ContextMenu:s$e,ContextMenuTrigger:l$e,ContextMenuContent:m$e,ContextMenuItem:v$e,ContextMenuCheckboxItem:k$e,ContextMenuRadioItem:g$e,ContextMenuLabel:M$e,ContextMenuSeparator:x$e,ContextMenuShortcut:b$e,ContextMenuGroup:d$e,ContextMenuPortal:u$e,ContextMenuSub:h$e,ContextMenuSubContent:y$e,ContextMenuSubTrigger:f$e,ContextMenuRadioGroup:p$e,Dialog:TW,DialogClose:jIe,DialogContent:jW,DialogDescription:DW,DialogFooter:PIe,DialogHeader:PW,DialogOverlay:$W,DialogPortal:RW,DialogTitle:OW,DialogTrigger:$Ie,DialogStack:yX,DialogStackTrigger:S$e,DialogStackOverlay:C$e,DialogStackBody:N$e,DialogStackContent:L$e,DialogStackTitle:E$e,DialogStackDescription:I$e,DialogStackHeader:A$e,DialogStackFooter:T$e,DialogStackNext:R$e,DialogStackPrevious:$$e,DropdownMenu:Mje,DropdownMenuPortal:xje,DropdownMenuTrigger:bje,DropdownMenuContent:wje,DropdownMenuGroup:_je,DropdownMenuLabel:Eje,DropdownMenuItem:Sje,DropdownMenuCheckboxItem:Cje,DropdownMenuRadioGroup:Nje,DropdownMenuRadioItem:Lje,DropdownMenuSeparator:Ije,DropdownMenuShortcut:Aje,DropdownMenuSub:Tje,DropdownMenuSubTrigger:Rje,DropdownMenuSubContent:$je,Input:jX,Label:Oje,Menubar:CPe,MenubarPortal:rK,MenubarMenu:NPe,MenubarTrigger:IPe,MenubarContent:APe,MenubarGroup:LPe,MenubarSeparator:PPe,MenubarLabel:jPe,MenubarItem:TPe,MenubarShortcut:OPe,MenubarCheckboxItem:RPe,MenubarRadioGroup:EPe,MenubarRadioItem:$Pe,MenubarSub:DPe,MenubarSubTrigger:zPe,MenubarSubContent:qPe,Pagination:HPe,PaginationContent:VPe,PaginationLink:FO,PaginationItem:BPe,PaginationPrevious:FPe,PaginationNext:UPe,PaginationEllipsis:GPe,Popover:gK,PopoverTrigger:MK,PopoverContent:xK,PopoverAnchor:mOe,Select:vDe,SelectContent:xDe,SelectGroup:kDe,SelectItem:wDe,SelectLabel:bDe,SelectScrollDownButton:nY,SelectScrollUpButton:tY,SelectSeparator:_De,SelectTrigger:MDe,SelectValue:gDe,Separator:ZO,Sheet:oY,SheetTrigger:EDe,SheetClose:IDe,SheetContent:rY,SheetHeader:iY,SheetFooter:RDe,SheetTitle:cY,SheetDescription:sY,Sidebar:gze,SidebarContent:Nze,SidebarFooter:Sze,SidebarGroup:Lze,SidebarGroupAction:Ize,SidebarGroupContent:Aze,SidebarGroupLabel:Eze,SidebarHeader:_ze,SidebarInput:wze,SidebarInset:bze,SidebarMenu:Tze,SidebarMenuAction:Pze,SidebarMenuBadge:Oze,SidebarMenuButton:jze,SidebarMenuItem:Rze,SidebarMenuSkeleton:Dze,SidebarMenuSub:zze,SidebarMenuSubButton:Hze,SidebarMenuSubItem:qze,SidebarProvider:kze,SidebarRail:xze,SidebarSeparator:Cze,SidebarTrigger:Mze,useSidebar:Y2,Skeleton:hP,Slider:mqe,Toaster:Kqe,Switch:hHe,Table:pHe,TableHeader:fHe,TableBody:yHe,TableFooter:mHe,TableHead:kHe,TableRow:vHe,TableCell:gHe,TableCaption:MHe,Textarea:xHe,Tooltip:xY,TooltipTrigger:bY,TooltipContent:wY,TooltipProvider:YO,VanillaJSONEditor:gP}),Object.assign(window.JSComponents,{VanillaJSONEditor:gP,HandsonTable:XY,MonacoEditor:KY,MultiSelect:eD})}const{createInertiaApp:qHe,router:YY}=HU;window.React=ke;window.ReactDOM=ur;window.InertiajsReact=HU;window.LucideReact=B_e;zHe();async function HHe(e,t){for(const a of Array.isArray(e)?e:[e]){const o=t[a];if(!(typeof o>"u"))return typeof o=="function"?o():o}throw new Error(`Page not found: ${e}`)}let tD=!1;YY.on("navigate",e=>{tD=!0});YY.on("finish",e=>{tD=!1});const _F=document.createElement.bind(document);document.createElement=function(e,t){const a=_F(e,t);return e.toLowerCase()==="iframe"&&tD?(console.warn("[Adminizer] Prevented iframe creation, forcing full page reload"),setTimeout(()=>{window.location.reload()},0),_F("div")):a};qHe({title:e=>`${e}`,resolve:e=>HHe(`./pages/${e}.tsx`,Object.assign({"./pages/add-group.tsx":()=>vn(()=>import("./add-group-sofsuFYA.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16]),import.meta.url),"./pages/add-user.tsx":()=>vn(()=>import("./add-user-DM1nsN83.js"),__vite__mapDeps([17,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,18,19]),import.meta.url),"./pages/add.tsx":()=>vn(()=>import("./add-D9qTFgIT.js"),__vite__mapDeps([20,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,21,22,23,24,19,25]),import.meta.url),"./pages/catalog.tsx":()=>vn(()=>import("./catalog-BIwiWMeW.js"),__vite__mapDeps([26,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,27,21,22,23,24,19,25,28]),import.meta.url),"./pages/dashboard.tsx":()=>vn(()=>import("./dashboard-C2Y09gw1.js"),__vite__mapDeps([29,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,30]),import.meta.url),"./pages/form.tsx":()=>vn(()=>import("./form-P1bFGHCF.js"),__vite__mapDeps([31,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,32,21,22,23,24,19,25]),import.meta.url),"./pages/history.tsx":()=>vn(()=>import("./history-DHZfSpf_.js"),__vite__mapDeps([33,3,4,25,1,2,5,6,7,8,9,10,11,12,13,14,15]),import.meta.url),"./pages/home.tsx":()=>vn(()=>import("./home-Do0C-Tzu.js"),__vite__mapDeps([34,4,3,5]),import.meta.url),"./pages/init-user.tsx":()=>vn(()=>import("./init-user-DhzPzTRM.js"),__vite__mapDeps([35,3,4,19,5]),import.meta.url),"./pages/list.tsx":()=>vn(()=>import("./list-D72uhn00.js"),__vite__mapDeps([36,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,37,27,38]),import.meta.url),"./pages/login.tsx":()=>vn(()=>import("./login-CyEIe-hN.js"),__vite__mapDeps([39,15,4,3,5,19]),import.meta.url),"./pages/module.tsx":()=>vn(()=>import("./module-DI6zzr4C.js"),__vite__mapDeps([40,3,4,1,2,5,6,7,8,9,10,11,12,13,14,15]),import.meta.url),"./pages/notification.tsx":()=>vn(()=>import("./notification-BZzAyhJ1.js"),__vite__mapDeps([41,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,42]),import.meta.url),"./pages/register.tsx":()=>vn(()=>import("./register-Bt0RP4PE.js"),__vite__mapDeps([43,3,4,19,5]),import.meta.url),"./pages/welcome.tsx":()=>vn(()=>import("./welcome-8dJL4cIX.js"),__vite__mapDeps([44,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15]),import.meta.url)})),setup({el:e,App:t,props:a}){Noe.createRoot(e).render(M.jsx(t,{...a}))},progress:{color:"#0f4898"}});export{MK as $,v$e as A,MA as B,lr as C,yX as D,s5 as E,DNe as F,zNe as G,qNe as H,jX as I,FNe as J,YO as K,Fs as L,xY as M,bY as N,wY as O,I9 as P,hHe as Q,S$e as R,vDe as S,Kqe as T,E$e as U,hr as V,uj as W,c2 as X,s2 as Y,wSe as Z,gK as _,i5 as a,_ze as a$,lv as a0,W1 as a1,xK as a2,ONe as a3,pHe as a4,fHe as a5,vHe as a6,kHe as a7,yHe as a8,gHe as a9,PIe as aA,jIe as aB,yf as aC,Kp as aD,ef as aE,of as aF,$Ie as aG,Rs as aH,kt as aI,z2 as aJ,bn as aK,It as aL,xZ as aM,bZ as aN,xe as aO,Pn as aP,DA as aQ,O7 as aR,fM as aS,kze as aT,Mje as aU,gy as aV,Sje as aW,Ije as aX,Mze as aY,U8 as aZ,gze as a_,vc as aa,TW as ab,jW as ac,PW as ad,OW as ae,vG as af,moe as ag,koe as ah,$U as ai,hVe as aj,jE as ak,Rx as al,bze as am,vl as an,bi as ao,YU as ap,xHe as aq,DHe as ar,JO as as,cb as at,B8 as au,v_ as av,sr as aw,UL as ax,M1 as ay,te as az,Oje as b,Tze as b0,Rze as b1,CPe as b2,NPe as b3,IPe as b4,jze as b5,Qv as b6,APe as b7,DPe as b8,zPe as b9,Dre as bA,zre as bB,qre as bC,Eje as bD,jx as bE,yVe as bF,fVe as bG,pVe as bH,eD as bI,mqe as bJ,Un as bK,c7 as bL,dVe as bM,lf as bN,v2 as bO,r1 as bP,__ as bQ,HPe as bR,VPe as bS,BPe as bT,FO as bU,FPe as bV,UPe as bW,mVe as bX,vVe as bY,kVe as bZ,gVe as b_,qPe as ba,TPe as bb,Lze as bc,HG as bd,NLe as be,FG as bf,zze as bg,qze as bh,Hze as bi,Nze as bj,Sze as bk,F_e as bl,U_e as bm,G_e as bn,Z_e as bo,W_e as bp,X_e as bq,Eze as br,Aze as bs,CLe as bt,LLe as bu,Y2 as bv,$De as bw,wN as bx,b7 as by,SN as bz,MDe as c,gDe as d,xDe as e,wDe as f,dLe as g,Nt as h,C$e as i,M as j,N$e as k,L$e as l,hP as m,Yw as n,Bf as o,vX as p,bje as q,qU as r,fc as s,Oqe as t,TP as u,wje as v,_je as w,s$e as x,l$e as y,m$e as z};
8073
+ */const PHe={languageCode:"zh-CN",[Fo]:"上方插入行",[Bo]:"下方插入行",[Vo]:"左方插入列",[Ho]:"右方插入列",[qo]:["移除该行","移除多行"],[zo]:["移除该列","移除多列"],[Do]:"撤销",[Oo]:"恢复",[Po]:"只读",[jo]:"清空该列",[$o]:"对齐",[Ro]:"左对齐",[To]:"水平居中",[Ao]:"右对齐",[Io]:"两端对齐",[Eo]:"顶端对齐",[Lo]:"垂直居中",[No]:"底端对齐",[Co]:"冻结该列",[So]:"取消冻结",[_o]:"边框",[wo]:"上",[bo]:"右",[xo]:"下",[Mo]:"左",[go]:"移除边框",[ko]:"插入批注",[vo]:"编辑批注",[mo]:"删除批注",[yo]:"只读批注",[fo]:"合并",[po]:"取消合并",[ho]:"复制",[Jd]:"带标题的复制",[Qd]:"带标题组的复制",[Yd]:"仅复制标题",[uo]:"剪切",[lo]:"插入子行",[so]:"与母行分离",[co]:["隐藏该列","隐藏多列"],[io]:["显示该列","显示多列"],[ro]:["隐藏该行","隐藏多行"],[oo]:["显示该行","显示多行"],[ao]:"无",[no]:"为空",[to]:"不为空",[eo]:"等于",[Ja]:"不等于",[Qa]:"开头是",[Ya]:"结尾是",[Ka]:"包含",[Xa]:"不包含",[Za]:"大于",[Wa]:"大于或等于",[Ga]:"小于",[Ua]:"小于或等于",[Fa]:"在此范围",[Ba]:"不在此范围",[Va]:"之后",[Ha]:"之前",[qa]:"今天",[za]:"明天",[Da]:"昨天",[Oa]:"空白单元格",[Pa]:"按条件过滤",[ja]:"按值过滤",[$a]:"且",[Ra]:"或",[Ta]:"全选",[Aa]:"清除",[Ia]:"确认",[Ea]:"取消",[La]:"搜索",[Na]:"值",[Ca]:"第二值"};mee();const bF={de:CHe,en:gee,es:NHe,fr:LHe,it:EHe,ja:IHe,ko:AHe,nl:THe,pl:RHe,pt:$He,ru:jHe,zh:PHe},OHe=document.documentElement.lang,ZY=bF[OHe]??bF.en;vee(ZY);const XY=({config:e,data:t=[],onChange:a,disabled:o})=>{const{appearance:i}=JO(),[s,l]=p.useState("ht-theme-main"),[h,f]=p.useState(!1),y=p.useCallback((m,x)=>{var b,w;if(x==="loadData")return;const S=(w=(b=k.current)==null?void 0:b.hotInstance)==null?void 0:w.getSourceData();a(S)},[]),k=p.useRef(null);return p.useEffect(()=>{const m=setTimeout(()=>{var x;(x=k.current)!=null&&x.hotInstance&&(k.current.hotInstance.loadData(t??[]),f(!0))},100);return()=>clearTimeout(m)},[t]),p.useEffect(()=>{l(i==="dark"?"ht-theme-main-dark":"ht-theme-main")},[i]),M.jsx("div",{style:{opacity:h?1:0},children:M.jsx(kee,{className:o?"pointer-events-none opacity-50":"",themeName:s,language:ZY.languageCode,ref:k,...e,afterChange:y,children:e.columns.map(m=>M.jsx(Mee,{data:m.data,...m},m.data))})})},vVe=Object.freeze(Object.defineProperty({__proto__:null,default:XY},Symbol.toStringTag,{value:"Module"})),DHe=()=>{const[e,t]=p.useState({width:typeof window<"u"?window.innerWidth:1024,height:typeof window<"u"?window.innerHeight:768});return p.useEffect(()=>{if(typeof window>"u")return;const a=()=>{t({width:window.innerWidth,height:window.innerHeight})};return window.addEventListener("resize",a),()=>window.removeEventListener("resize",a)},[]),e},KY=({onChange:e,value:t,options:a,disabled:o})=>{const{appearance:i}=JO(),[s,l]=p.useState("light"),h=p.useRef(null),f=p.useRef(null),{width:y}=DHe(),k=y<768,m=y>=768&&y<1024,x=_=>{e(_)},S=_=>{h.current=_,b()},b=()=>{var N;if(!h.current)return;const _={minimap:{enabled:!k},fontSize:k?12:m?13:14,lineNumbers:k?"off":"on",lineDecorationsWidth:k?5:10,scrollBeyondLastLine:!k,wordWrap:k?"on":"bounded",renderWhitespace:k?"none":"selection",padding:{top:k?8:16,bottom:k?8:16}};h.current.updateOptions(_),(N=f.current)==null||N.classList.add("overflow-hidden"),setTimeout(()=>{var L,I;(L=h.current)==null||L.layout(),(I=f.current)==null||I.classList.remove("overflow-hidden")},100)};p.useEffect(()=>{l(i==="dark"?"vs-dark":"light")},[i]),p.useEffect(()=>{b()},[y]);const w=k?"300px":m?"400px":"500px";return M.jsx("div",{className:`border rounded-lg ${k?"p-1":"p-2"}`,ref:f,children:M.jsx(xee,{height:w,language:a.language,value:t,theme:s,options:{automaticLayout:!0,...k&&{wordWrap:"on"},minimap:{enabled:!k}},onChange:x,onMount:S,className:`transition-all duration-200 ease-in-out ${o?"pointer-events-none opacity-50 cursor-not-allowed":""}`})})},kVe=Object.freeze(Object.defineProperty({__proto__:null,default:KY},Symbol.toStringTag,{value:"Module"})),wF=gA("m-1 flex items-center border rounded-sm px-1",{variants:{variant:{default:"border-foreground/10 text-foreground bg-card hover:bg-card/80",secondary:"border-foreground/10 bg-secondary text-secondary-foreground hover:bg-secondary/80",destructive:"border-transparent bg-destructive text-destructive-foreground hover:bg-destructive/80",inverted:"inverted"}},defaultVariants:{variant:"default"}}),eD=p.forwardRef(({options:e,onValueChange:t,variant:a,processing:o,disabled:i,defaultValue:s=[],placeholder:l="",notFound:h="",search:f="",animation:y=0,maxCount:k=3,modalPopover:m=!1,asChild:x=!1,className:S,mode:b="multiple",...w},_)=>{const[N,L]=p.useState(s),[I,j]=p.useState(!1),[O,P]=p.useState(!1);p.useEffect(()=>{s&&L(s)},[s]);const A=q=>{if(q.key==="Enter")j(!0);else if(q.key==="Backspace"&&!q.currentTarget.value){const B=[...N];B.pop(),L(B),t(B)}},$=q=>{let B;b==="single"?B=N.includes(q)?[]:[q]:B=N.includes(q)?N.filter(Y=>Y!==q):[...N,q],L(B),t(B),b==="single"&&j(!1)},F=()=>{L([]),t([])},X=()=>{j(q=>!q)},H=()=>{const q=N.slice(0,k);L(q),t(q)};return M.jsxs(gK,{open:I,onOpenChange:j,modal:m,children:[M.jsx(MK,{asChild:!0,children:M.jsx(MA,{ref:_,...w,onClick:X,disabled:i,className:te("flex w-full p-1 rounded-md border-input border-1 min-h-10 h-auto items-center justify-between bg-inherit hover:bg-inherit [&_svg]:pointer-events-auto",S),children:N.length>0?M.jsxs("div",{className:"flex justify-between items-center w-full",children:[M.jsxs("div",{className:"flex flex-wrap items-center",children:[N.slice(0,k).map(q=>{const B=e.find(ue=>ue.value===q),Y=B==null?void 0:B.icon;return M.jsxs("div",{className:te(O?"animate-bounce":"",wF({variant:a})),style:{animationDuration:`${y}s`},children:[Y&&M.jsx(Y,{className:"h-4 w-4 mr-2"}),B==null?void 0:B.label,M.jsx(Or,{className:"ml-2 h-4 w-4 cursor-pointer",onClick:ue=>{ue.stopPropagation(),o||$(q)}})]},q)}),b==="multiple"&&N.length>k&&M.jsxs("div",{className:te("bg-transparent text-foreground border-foreground/1 hover:bg-transparent",O?"animate-bounce":"",wF({variant:a})),style:{animationDuration:`${y}s`},children:[`+ ${N.length-k} more`,M.jsx(Or,{className:"ml-2 h-4 w-4 cursor-pointer",onClick:q=>{q.stopPropagation(),H()}})]})]}),M.jsxs("div",{className:"flex items-center justify-between",children:[N.length>0&&M.jsxs(M.Fragment,{children:[M.jsx(bi,{className:"h-4 mx-2 cursor-pointer text-muted-foreground",onClick:q=>{q.stopPropagation(),F()}}),M.jsx(ZO,{orientation:"vertical",className:"flex min-h-6 h-full"})]}),M.jsx(xi,{className:"h-4 mx-2 cursor-pointer text-muted-foreground"})]})]}):M.jsxs("div",{className:"flex items-center justify-between w-full mx-auto",children:[M.jsx("span",{className:"text-sm text-muted-foreground mx-3",children:l}),M.jsx(xi,{className:"h-4 cursor-pointer text-muted-foreground mx-2"})]})})}),M.jsx(xK,{className:"w-auto p-0 z-[1003]",align:"start",onEscapeKeyDown:()=>j(!1),children:M.jsxs(sO,{children:[M.jsx(zW,{placeholder:f,onKeyDown:A}),M.jsxs(qW,{children:[M.jsx(HW,{children:h}),M.jsx(VW,{children:e.map(q=>{const B=N.includes(q.value);return M.jsxs(FW,{onSelect:()=>$(q.value),className:"cursor-pointer",children:[M.jsx("div",{className:te("mr-2 flex h-5 w-5 items-center justify-center rounded border border-primary",B?"bg-primary text-primary-foreground":"opacity-50 [&_svg]:invisible"),children:M.jsx(sr,{className:"h-4 w-4 text-primary-foreground"})}),q.icon&&M.jsx(q.icon,{className:"mr-2 h-4 w-4 text-muted-foreground"}),M.jsx("span",{children:q.label})]},q.value)})}),M.jsx(BW,{})]})]})}),y>0&&N.length>0&&b==="multiple"&&M.jsx(ki,{className:te("cursor-pointer my-2 text-foreground bg-background w-3 h-3",O?"":"text-muted-foreground"),onClick:()=>P(!O)})]})});eD.displayName="MultiSelect";const gVe=Object.freeze(Object.defineProperty({__proto__:null,default:eD},Symbol.toStringTag,{value:"Module"}));function zHe(){window.UIComponents??(window.UIComponents={}),window.JSComponents??(window.JSComponents={}),window.axios=Nt,window.sonner=Xqe,Object.assign(window.UIComponents,{Avatar:Dre,AvatarImage:zre,AvatarFallback:qre,Badge:Vre,Breadcrumb:F_e,BreadcrumbList:U_e,BreadcrumbItem:G_e,BreadcrumbLink:W_e,BreadcrumbPage:Z_e,BreadcrumbSeparator:X_e,BreadcrumbEllipsis:K_e,Button:MA,Calendar:ONe,Card:DNe,CardHeader:zNe,CardFooter:FNe,CardTitle:qNe,CardAction:VNe,CardDescription:HNe,CardContent:BNe,Checkbox:dLe,Collapsible:CLe,CollapsibleTrigger:NLe,CollapsibleContent:LLe,Command:sO,CommandDialog:OIe,CommandInput:zW,CommandList:qW,CommandEmpty:HW,CommandGroup:VW,CommandItem:FW,CommandShortcut:DIe,CommandSeparator:BW,ContextMenu:s$e,ContextMenuTrigger:l$e,ContextMenuContent:m$e,ContextMenuItem:v$e,ContextMenuCheckboxItem:k$e,ContextMenuRadioItem:g$e,ContextMenuLabel:M$e,ContextMenuSeparator:x$e,ContextMenuShortcut:b$e,ContextMenuGroup:d$e,ContextMenuPortal:u$e,ContextMenuSub:h$e,ContextMenuSubContent:y$e,ContextMenuSubTrigger:f$e,ContextMenuRadioGroup:p$e,Dialog:TW,DialogClose:jIe,DialogContent:jW,DialogDescription:DW,DialogFooter:PIe,DialogHeader:PW,DialogOverlay:$W,DialogPortal:RW,DialogTitle:OW,DialogTrigger:$Ie,DialogStack:yX,DialogStackTrigger:S$e,DialogStackOverlay:C$e,DialogStackBody:N$e,DialogStackContent:L$e,DialogStackTitle:E$e,DialogStackDescription:I$e,DialogStackHeader:A$e,DialogStackFooter:T$e,DialogStackNext:R$e,DialogStackPrevious:$$e,DropdownMenu:Mje,DropdownMenuPortal:xje,DropdownMenuTrigger:bje,DropdownMenuContent:wje,DropdownMenuGroup:_je,DropdownMenuLabel:Eje,DropdownMenuItem:Sje,DropdownMenuCheckboxItem:Cje,DropdownMenuRadioGroup:Nje,DropdownMenuRadioItem:Lje,DropdownMenuSeparator:Ije,DropdownMenuShortcut:Aje,DropdownMenuSub:Tje,DropdownMenuSubTrigger:Rje,DropdownMenuSubContent:$je,Input:jX,Label:Oje,Menubar:CPe,MenubarPortal:rK,MenubarMenu:NPe,MenubarTrigger:IPe,MenubarContent:APe,MenubarGroup:LPe,MenubarSeparator:PPe,MenubarLabel:jPe,MenubarItem:TPe,MenubarShortcut:OPe,MenubarCheckboxItem:RPe,MenubarRadioGroup:EPe,MenubarRadioItem:$Pe,MenubarSub:DPe,MenubarSubTrigger:zPe,MenubarSubContent:qPe,Pagination:HPe,PaginationContent:VPe,PaginationLink:FO,PaginationItem:BPe,PaginationPrevious:FPe,PaginationNext:UPe,PaginationEllipsis:GPe,Popover:gK,PopoverTrigger:MK,PopoverContent:xK,PopoverAnchor:mOe,Select:vDe,SelectContent:xDe,SelectGroup:kDe,SelectItem:wDe,SelectLabel:bDe,SelectScrollDownButton:nY,SelectScrollUpButton:tY,SelectSeparator:_De,SelectTrigger:MDe,SelectValue:gDe,Separator:ZO,Sheet:oY,SheetTrigger:EDe,SheetClose:IDe,SheetContent:rY,SheetHeader:iY,SheetFooter:RDe,SheetTitle:cY,SheetDescription:sY,Sidebar:gze,SidebarContent:Nze,SidebarFooter:Sze,SidebarGroup:Lze,SidebarGroupAction:Ize,SidebarGroupContent:Aze,SidebarGroupLabel:Eze,SidebarHeader:_ze,SidebarInput:wze,SidebarInset:bze,SidebarMenu:Tze,SidebarMenuAction:Pze,SidebarMenuBadge:Oze,SidebarMenuButton:jze,SidebarMenuItem:Rze,SidebarMenuSkeleton:Dze,SidebarMenuSub:zze,SidebarMenuSubButton:Hze,SidebarMenuSubItem:qze,SidebarProvider:kze,SidebarRail:xze,SidebarSeparator:Cze,SidebarTrigger:Mze,useSidebar:Y2,Skeleton:hP,Slider:mqe,Toaster:Kqe,Switch:hHe,Table:pHe,TableHeader:fHe,TableBody:yHe,TableFooter:mHe,TableHead:kHe,TableRow:vHe,TableCell:gHe,TableCaption:MHe,Textarea:xHe,Tooltip:xY,TooltipTrigger:bY,TooltipContent:wY,TooltipProvider:YO,VanillaJSONEditor:gP}),Object.assign(window.JSComponents,{VanillaJSONEditor:gP,HandsonTable:XY,MonacoEditor:KY,MultiSelect:eD})}const{createInertiaApp:qHe,router:YY}=HU;window.React=ke;window.ReactDOM=ur;window.InertiajsReact=HU;window.LucideReact=B_e;zHe();async function HHe(e,t){for(const a of Array.isArray(e)?e:[e]){const o=t[a];if(!(typeof o>"u"))return typeof o=="function"?o():o}throw new Error(`Page not found: ${e}`)}let tD=!1;YY.on("navigate",e=>{tD=!0});YY.on("finish",e=>{tD=!1});const _F=document.createElement.bind(document);document.createElement=function(e,t){const a=_F(e,t);return e.toLowerCase()==="iframe"&&tD?(console.warn("[Adminizer] Prevented iframe creation, forcing full page reload"),setTimeout(()=>{window.location.reload()},0),_F("div")):a};qHe({title:e=>`${e}`,resolve:e=>HHe(`./pages/${e}.tsx`,Object.assign({"./pages/add-group.tsx":()=>vn(()=>import("./add-group-sofsuFYA.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16]),import.meta.url),"./pages/add-user.tsx":()=>vn(()=>import("./add-user-DM1nsN83.js"),__vite__mapDeps([17,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,18,19]),import.meta.url),"./pages/add.tsx":()=>vn(()=>import("./add-D9qTFgIT.js"),__vite__mapDeps([20,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,21,22,23,24,19,25]),import.meta.url),"./pages/catalog.tsx":()=>vn(()=>import("./catalog-BIwiWMeW.js"),__vite__mapDeps([26,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,27,21,22,23,24,19,25,28]),import.meta.url),"./pages/dashboard.tsx":()=>vn(()=>import("./dashboard-C2Y09gw1.js"),__vite__mapDeps([29,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,30]),import.meta.url),"./pages/form.tsx":()=>vn(()=>import("./form-P1bFGHCF.js"),__vite__mapDeps([31,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,32,21,22,23,24,19,25]),import.meta.url),"./pages/history.tsx":()=>vn(()=>import("./history-DHZfSpf_.js"),__vite__mapDeps([33,3,4,25,1,2,5,6,7,8,9,10,11,12,13,14,15]),import.meta.url),"./pages/home.tsx":()=>vn(()=>import("./home-Do0C-Tzu.js"),__vite__mapDeps([34,4,3,5]),import.meta.url),"./pages/init-user.tsx":()=>vn(()=>import("./init-user-DhzPzTRM.js"),__vite__mapDeps([35,3,4,19,5]),import.meta.url),"./pages/list.tsx":()=>vn(()=>import("./list-D72uhn00.js"),__vite__mapDeps([36,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,37,27,38]),import.meta.url),"./pages/login.tsx":()=>vn(()=>import("./login-Cla-c7nv.js"),__vite__mapDeps([39,15,4,3,5,19]),import.meta.url),"./pages/module.tsx":()=>vn(()=>import("./module-DI6zzr4C.js"),__vite__mapDeps([40,3,4,1,2,5,6,7,8,9,10,11,12,13,14,15]),import.meta.url),"./pages/notification.tsx":()=>vn(()=>import("./notification-BZzAyhJ1.js"),__vite__mapDeps([41,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,42]),import.meta.url),"./pages/register.tsx":()=>vn(()=>import("./register-Bt0RP4PE.js"),__vite__mapDeps([43,3,4,19,5]),import.meta.url),"./pages/welcome.tsx":()=>vn(()=>import("./welcome-8dJL4cIX.js"),__vite__mapDeps([44,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15]),import.meta.url)})),setup({el:e,App:t,props:a}){Noe.createRoot(e).render(M.jsx(t,{...a}))},progress:{color:"#0f4898"}});export{MK as $,v$e as A,MA as B,lr as C,yX as D,s5 as E,DNe as F,zNe as G,qNe as H,jX as I,FNe as J,YO as K,Fs as L,xY as M,bY as N,wY as O,I9 as P,hHe as Q,S$e as R,vDe as S,Kqe as T,E$e as U,hr as V,uj as W,c2 as X,s2 as Y,wSe as Z,gK as _,i5 as a,_ze as a$,lv as a0,W1 as a1,xK as a2,ONe as a3,pHe as a4,fHe as a5,vHe as a6,kHe as a7,yHe as a8,gHe as a9,PIe as aA,jIe as aB,yf as aC,Kp as aD,ef as aE,of as aF,$Ie as aG,Rs as aH,kt as aI,z2 as aJ,bn as aK,It as aL,xZ as aM,bZ as aN,xe as aO,Pn as aP,DA as aQ,O7 as aR,fM as aS,kze as aT,Mje as aU,gy as aV,Sje as aW,Ije as aX,Mze as aY,U8 as aZ,gze as a_,vc as aa,TW as ab,jW as ac,PW as ad,OW as ae,vG as af,moe as ag,koe as ah,$U as ai,hVe as aj,jE as ak,Rx as al,bze as am,vl as an,bi as ao,YU as ap,xHe as aq,DHe as ar,JO as as,cb as at,B8 as au,v_ as av,sr as aw,UL as ax,M1 as ay,te as az,Oje as b,Tze as b0,Rze as b1,CPe as b2,NPe as b3,IPe as b4,jze as b5,Qv as b6,APe as b7,DPe as b8,zPe as b9,Dre as bA,zre as bB,qre as bC,Eje as bD,jx as bE,yVe as bF,fVe as bG,pVe as bH,eD as bI,mqe as bJ,Un as bK,c7 as bL,dVe as bM,lf as bN,v2 as bO,r1 as bP,__ as bQ,HPe as bR,VPe as bS,BPe as bT,FO as bU,FPe as bV,UPe as bW,mVe as bX,vVe as bY,kVe as bZ,gVe as b_,qPe as ba,TPe as bb,Lze as bc,HG as bd,NLe as be,FG as bf,zze as bg,qze as bh,Hze as bi,Nze as bj,Sze as bk,F_e as bl,U_e as bm,G_e as bn,Z_e as bo,W_e as bp,X_e as bq,Eze as br,Aze as bs,CLe as bt,LLe as bu,Y2 as bv,$De as bw,wN as bx,b7 as by,SN as bz,MDe as c,gDe as d,xDe as e,wDe as f,dLe as g,Nt as h,C$e as i,M as j,N$e as k,L$e as l,hP as m,Yw as n,Bf as o,vX as p,bje as q,qU as r,fc as s,Oqe as t,TP as u,wje as v,_je as w,s$e as x,l$e as y,m$e as z};
@@ -1 +1 @@
1
- import{aj as cn,u as an,ai as ln,j as c,T as dn,b as D,ak as un,I as G,al as gn,a as hn,E as fn,B as K,ah as W,L as pn,t as q}from"./app.js";import{Icon as T}from"./icon-FyVrxiPs.js";import{r as E}from"./handsontable-PxYdjN8c.js";import H from"./input-error-cgnQ235Q.js";import"./jsoneditor-De1FvcYu.js";import"./monaco-BhBYtg3d.js";const V=(n,t,e)=>{let r=1n,s=n%e;for(;t;)t&1n&&(r=r*s%e),s=s*s%e,t=t>>1n;return r};function M(n,t,e){return typeof n=="bigint"&&typeof t=="bigint"&&typeof e=="bigint"?V(n,t,e):Number(V(BigInt(n),BigInt(t),BigInt(e)))}const v=crypto,mn=new TextEncoder,yn=new TextDecoder("utf-8",{ignoreBOM:!0}),L={encode:n=>mn.encode(n),decode:n=>yn.decode(n)},nn=(()=>{const t=[..."0123456789abcdef"],e=new Array(256);for(let r=0;r<256;r++)e[r]=`${t[r>>>4&15]}${t[r&15]}`;return e})(),xn=(()=>{const n={};for(let t=0;t<256;t++){const e=nn[t],r=e[0],s=r.toUpperCase(),i=e[1],o=i.toUpperCase();n[e]=t,n[`${r}${o}`]=t,n[`${s}${i}`]=t,n[`${s}${o}`]=t}return n})(),wn=n=>!(n.length%2||!/^[a-fA-F0-9]*$/.test(n)),O={encode:n=>{let t="";for(let e=0,r=n.length;e<r;e++)t+=nn[n[e]];return t},encodeStr:n=>O.encode(L.encode(n)),decode:n=>{const t=n.length/2,e=new Uint8Array(t);for(let r=0;r<t;r++)e[r]=xn[n.slice(r*2,r*2+2)];return e},decodeStr:n=>L.decode(O.decode(n)),is:wn},en=n=>O.encode(n),X=new TextEncoder,U=n=>{const t=async o=>o instanceof Uint8Array?v.subtle.importKey("raw",o,{name:"PBKDF2"},!1,["deriveBits"]):typeof o=="string"?t(X.encode(o.normalize())):o,e=(o,a,l,d)=>(a=typeof a=="string"?X.encode(a):a,v.subtle.deriveBits({name:"PBKDF2",salt:a,iterations:l,hash:{name:n}},o,d)),r=async(o,a,l,d)=>{const g=await t(o);return await e(g,a,l,d*8)},s=async(o,a,l,d)=>new Uint8Array(await r(o,a,l,d)),i=async(o,a,l,d)=>en(await s(o,a,l,d));return i.buffer=r,i.hex=i,i.uint8=s,i},tn={sha1:U("SHA-1"),sha256:U("SHA-256"),sha384:U("SHA-384"),sha512:U("SHA-512")},z=n=>{const t=new Uint8Array(n);return v.getRandomValues(t),t},bn=new TextEncoder,R=n=>{const t=s=>(s=typeof s=="string"?bn.encode(s):s,v.subtle.digest(n,s)),e=async s=>new Uint8Array(await t(s)),r=async s=>en(await e(s));return r.buffer=t,r.hex=r,r.uint8=e,r};R("SHA-1");const rn=R("SHA-256");R("SHA-384");R("SHA-512");const x={encode:n=>{if(n!==n>>0)throw new Error("Invalid 32-bit integer");const t=n>>24&255,e=n>>16&255,r=n>>8&255,s=n>>0&255;return new Uint8Array([t,e,r,s])},decode:n=>{if(n.length!==4)throw new Error("Invalid 32-bit integer");const t=n[0],e=n[1],r=n[2],s=n[3];return(t<<24)+(e<<16)+(r<<8)+(s<<0)}},sn=n=>{const t=n.reduce((r,s)=>r+s.byteLength,0),e=new Uint8Array(t);for(let r=0,s=0,i=n.length;s<i;s++)e.set(n[s],r),r+=n[s].byteLength;return e},vn=async(n,t,e,r)=>{n=typeof n=="string"?L.encode(n):n,e=typeof e=="string"?L.encode(e):e||z(32),e=e.length===32?e:await rn.uint8(e);const s=new Uint8Array([1]),i=Math.max(1,r||0),o=await tn.sha256.uint8(t,e,i,32),a=await v.subtle.importKey("raw",o,"AES-GCM",!1,["encrypt"]),l=z(16),d=await v.subtle.encrypt({name:"AES-GCM",iv:l,length:256,tagLength:128},a,n),g=new Uint8Array(d);return sn([s,e,x.encode(i),l,g])},kn=async(n,t)=>{if(n[0]!==1)throw new Error("Unsupported encrypted archive version");const r=n.subarray(1,33),s=x.decode(n.subarray(33,37)),i=n.subarray(37,53),o=n.subarray(53),a=await tn.sha256.uint8(t,r,s,32),l=await v.subtle.importKey("raw",a,"AES-GCM",!1,["decrypt"]),d=await v.subtle.decrypt({name:"AES-GCM",iv:i,length:256,tagLength:128},l,o);return new Uint8Array(d)},Y=Object.freeze(Object.defineProperty({__proto__:null,decrypt:kn,encrypt:vn},Symbol.toStringTag,{value:"Module"}));function I(n){let t,e=0;return()=>((!t||e===t.length)&&(t=new n(65536/(n.BYTES_PER_ELEMENT*8)),e=0,v.getRandomValues(t)),t[e++])}function _n(n,t){let e=0,r=t;return()=>(r===t&&(e=n(),r=0),e&1<<r++?1:0)}const P={get1:_n(I(Uint8Array),8),get8:I(Uint8Array),get16:I(Uint16Array),get32:I(Uint32Array),get64:I(BigUint64Array)},jn=Object.assign(()=>BigInt(P.get1()),{BITS:1}),Cn=Object.assign(()=>BigInt(P.get8()),{BITS:8}),Nn=Object.assign(()=>BigInt(P.get16()),{BITS:16}),Sn=Object.assign(()=>BigInt(P.get32()),{BITS:32}),Bn=Object.assign(()=>P.get64(),{BITS:64}),u=n=>{const t=n<=1?jn:n<=8?Cn:n<=16?Nn:n<=32?Sn:Bn,e=t.BITS;if(n===e)return t();if(n===128)return t()<<64n|t();if(n===160)return u(128)<<32n|u(32);if(n===192)return u(128)<<64n|u(64);if(n===224)return u(160)<<64n|u(64);if(n===256)return u(128)<<128n|u(128);if(n===384)return u(256)<<128n|u(128);if(n===512)return u(256)<<256n|u(256);if(n===1024)return u(512)<<512n|u(512);if(n===2048)return u(1024)<<1024n|u(1024);let r=0,s=0n;for(;r<n;){const i=Math.min(e,n-r),o=2n**BigInt(i)-1n,l=t()&o;if(n===i)return l;s=r?s|l<<BigInt(r):l,r+=i}return s},on=(n,t)=>{if(n=BigInt(n),t=BigInt(t),n<0n||t<0n)throw new Error("Negative ranges are not supported");if(t<=n)throw new Error('"max" must be at least equal to "min" plus 1');const e=t-n-1n,r=e.toString(2).length;for(;;){const s=u(r);if(!(s>e))return s+n}},J=[2n,3n,5n,7n,11n,13n,17n,19n,23n,29n,31n,37n,41n,43n,47n,53n,59n,61n,67n,71n,73n,79n,83n,89n,97n,101n,103n,107n,109n,113n,127n,131n,137n,139n,149n,151n,157n,163n,167n,173n,179n,181n,191n,193n,197n,199n,211n,223n,227n,229n,233n,239n,241n,251n,257n,263n,269n,271n,277n,281n,283n,293n,307n,311n,313n,317n,331n,337n,347n,349n,353n,359n,367n,373n,379n,383n,389n,397n,401n,409n,419n,421n,431n,433n,439n,443n,449n,457n,461n,463n,467n,479n,487n,491n,499n,503n,509n,521n,523n,541n,547n,557n,563n,569n,571n,577n,587n,593n,599n,601n,607n,613n,617n,619n,631n,641n,643n,647n,653n,659n,661n,673n,677n,683n,691n,701n,709n,719n,727n,733n,739n,743n,751n,757n,761n,769n,773n,787n,797n,809n,811n,821n,823n,827n,829n,839n,853n,857n,859n,863n,877n,881n,883n,887n,907n,911n,919n,929n,937n,941n,947n,953n,967n,971n,977n,983n,991n,997n],An=(n,t=8)=>{if(n<=1n)return!1;for(let s=0,i=J.length;s<i;s++){const o=J[s];if(n%o===0n)return n===o}if(n<=1000n)return!1;let e=0n,r=n-1n;for(;(r&1n)===0n;)e+=1n,r>>=1n;for(let s=0;s<t;s++){const i=on(2n,n-2n);let o=M(i,r,n),a=0n;for(let l=0;l<e;l++){if(a=M(o,2n,n),a===1n&&o!==1n&&o!==n-1n)return!1;o=a}if(a!==1n)return!1}return!0},Q=(n,t=8)=>{let e=u(n);for((e&1n)===0n&&(e+=1n);;){if(An(e,t))return e;e+=2n}},w={encode:n=>{let t=0n;for(let e=0,r=n.length;e<r;e++)t|=BigInt(n[e])<<(BigInt(r)-BigInt(e)-1n)*8n;return t},decode:n=>{if(n<0n)throw new Error("Negative BigInts are not supported");const t=[];for(;n;)t.push(Number(n&0xffn)),n>>=8n;return new Uint8Array(t.reverse())}},Z={archive:n=>{const[t,e,r,s,i]=n,o=w.decode(t),a=x.encode(o.length),l=w.decode(e),d=x.encode(l.length),g=w.decode(r),p=x.encode(g.length),b=w.decode(s),h=x.encode(b.length);return sn([a,o,d,l,p,g,h,b,i])},unarchive:n=>{const e=n.slice(0,4),r=x.decode(e),s=4,i=n.slice(s,s+r),o=w.encode(i),a=s+r,l=n.slice(a,a+4),d=x.decode(l),g=a+4,p=n.slice(g,g+d),b=w.encode(p),h=g+d,N=n.slice(h,h+4),m=x.decode(N),k=h+4,S=n.slice(k,k+m),j=w.encode(S),f=k+m,B=n.slice(f,f+4),C=x.decode(B),y=f+4,F=n.slice(y,y+C),$=w.encode(F),_=y+C,A=n.slice(_);return[o,b,j,$,A]}},En=(n,t,e)=>{let r=n%e;if(t<=BigInt(Number.MAX_SAFE_INTEGER))for(let s=Number(t);s>0;s--)r=r*r%e;else for(let s=t;s>0n;s--)r=r*r%e;return r%e},In={generate:async n=>{const t=n.primeBits??100,e=n.primeRounds??20,r=n.opsPerSecond??33e5,s=n.duration??1e3,i=n.message,o=Q(t,e),a=Q(t,e),l=o*a,d=(o-1n)*(a-1n),g=r,p=s,b=BigInt(Math.round(Math.max(1,g/1e3)*p)),h=await rn.uint8(z(32)),N=i,m=await Y.encrypt(N,h),k=on(1n,l-1n),S=M(2n,b,d),j=M(k,S,l),f=w.encode(h)+j;return Z.archive([l,k,b,f,m])},solve:async n=>{const[t,e,r,s,i]=Z.unarchive(n),o=En(e,r,t),a=w.decode(s-o),l=await Y.decrypt(i,a);return L.decode(l)}};function Fn(){const[n,t]=E.useState(!1);E.useEffect(()=>{cn()},[]);const e=an(),r=Array.isArray(e.props.captchaTask)&&e.props.captchaTask.length>0,[s,i]=E.useState("I'm not a robot"),[o,a]=E.useState(!1),[l,d]=E.useState(!1),{post:g,data:p,setData:b,processing:h,transform:N,errors:m,clearErrors:k}=ln({login:"",password:"",captchaSolution:""}),S=f=>{if(f.preventDefault(),!r){g(e.props.submitLink,{onError:C=>{for(const y of Object.keys(C))q.error(C[y])}});return}t(!0),i("Solving CAPTCHA..."),a(!1),(async()=>{try{let y=function(_){return new Promise(A=>setTimeout(A,_))};var C=y;await y(100);const F=new Uint8Array(e.props.captchaTask),$=await In.solve(F);i("Verification complete!"),t(!1),a(!0),N(_=>({..._,captchaSolution:$})),g(e.props.submitLink,{onError:_=>{for(const A of Object.keys(_))q.error(_[A])}})}catch(y){console.error("Error solving CAPTCHA:",y),i("Error solving CAPTCHA. Try again.")}})()},j=(f,B)=>{k(),b(f,B)};return c.jsxs("div",{className:"bg-sidebar flex min-h-svh w-full justify-center",children:[c.jsx(dn,{position:"top-center",richColors:!0,closeButton:!0}),c.jsxs("div",{className:"rounded-xl border bg-card text-card-foreground shadow p-6 max-w-sm w-full h-fit mt-[15%]",children:[c.jsx("h1",{className:"font-medium mb-6 text-xl",children:e.props.title}),e.props.description&&c.jsx("p",{className:"font-thin mb-6 text-xs pb-10",children:e.props.description}),c.jsxs("form",{onSubmit:S,children:[c.jsxs("div",{className:"grid gap-5",children:[r&&c.jsx(H,{message:m.captchaSolution}),c.jsxs("div",{className:"grid gap-4",children:[c.jsx(D,{htmlFor:"login",children:e.props.login}),c.jsxs("div",{className:"relative",children:[c.jsx(T,{iconNode:un,className:"size-5 absolute inset-2 text-muted-foreground"}),c.jsx(G,{id:"login",className:`pl-10 ${m.login?"border-red-500":""}`,type:"text",required:!0,tabIndex:1,autoComplete:"username",value:p.login,disabled:h||n,onChange:f=>{j("login",f.target.value)},placeholder:e.props.login}),c.jsx(H,{message:m.login})]})]}),c.jsxs("div",{className:"grid gap-4",children:[c.jsx(D,{htmlFor:"password",children:e.props.password}),c.jsxs("div",{className:"relative",children:[c.jsx(T,{iconNode:gn,className:"size-5 absolute inset-2 text-muted-foreground"}),c.jsx(G,{id:"password",className:`pl-10 pr-10 ${m.password?"border-red-500":""}`,type:l?"text":"password",required:!0,disabled:h||n,tabIndex:1,autoComplete:"current-password",value:p.password,onChange:f=>{j("password",f.target.value)},placeholder:e.props.password}),c.jsx("button",{type:"button",onClick:()=>d(!l),className:"absolute right-2 top-1/2 -translate-y-1/2 text-muted-foreground hover:text-foreground transition-colors",tabIndex:-1,children:c.jsx(T,{iconNode:l?hn:fn,className:"size-5"})}),c.jsx(H,{message:m.password})]})]}),c.jsxs("div",{className:"flex gap-4",children:[c.jsx(K,{type:"submit",className:"w-fit",disabled:h||n,children:e.props.submitButton}),e.props.registerLink&&c.jsx(K,{asChild:!0,variant:"outline",children:c.jsx(W,{href:e.props.registerLink.link,className:`${h||n} ? 'pointer-events-none opacity-50' : ''`,children:e.props.registerLink.title})})]})]}),r&&c.jsxs("div",{className:"bg-card border rounded-lg shadow-lg p-4 mt-6 flex items-center space-x-4",children:[c.jsxs("div",{className:"relative",children:[c.jsx("div",{className:"w-10 h-10 bg-primary/10 rounded-full flex items-center justify-center",children:c.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",className:"h-6 w-6 text-primary",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:"2",children:c.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M12 2l3.09 6.26L22 9.27l-5 4.87L18.18 22 12 18.27 5.82 22 7 14.14l-5-4.87 6.91-1.01L12 2z"})})}),c.jsx("div",{className:`${n?"":"hidden"}`,children:c.jsx(T,{iconNode:pn,className:"animate-spin size-6 absolute inset-0 m-auto text-muted-foreground"})})]}),c.jsx("div",{className:"text-foreground font-semibold",children:s}),c.jsx("div",{className:`transition-opacity ${o?"opacity-100 visible":"opacity-0 invisible"}`,children:c.jsx("svg",{id:"checkmark",xmlns:"http://www.w3.org/2000/svg",className:"h-8 w-8 text-green-500",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"3",children:c.jsx("path",{className:"checkmark",strokeLinecap:"round",strokeLinejoin:"round",d:"M5 13l4 4L19 7"})})})]})]}),e.props.addishinalLoginPage&&c.jsx("div",{className:"mt-6 text-center",children:c.jsx(W,{href:e.props.addishinalLoginPage.link,className:"text-sm underline",target:e.props.addishinalLoginPage.link.startsWith("http://")||e.props.addishinalLoginPage.link.startsWith("https://")?"_blank":void 0,rel:e.props.addishinalLoginPage.link.startsWith("http://")||e.props.addishinalLoginPage.link.startsWith("https://")?"noopener noreferrer":void 0,children:e.props.addishinalLoginPage.title})})]})]})}export{Fn as default};
1
+ import{aj as cn,u as an,ai as ln,j as c,T as dn,b as D,ak as un,I as G,al as gn,a as hn,E as fn,B as K,ah as W,L as pn,t as q}from"./app.js";import{Icon as P}from"./icon-FyVrxiPs.js";import{r as E}from"./handsontable-PxYdjN8c.js";import H from"./input-error-cgnQ235Q.js";import"./jsoneditor-De1FvcYu.js";import"./monaco-BhBYtg3d.js";const V=(n,t,e)=>{let r=1n,s=n%e;for(;t;)t&1n&&(r=r*s%e),s=s*s%e,t=t>>1n;return r};function M(n,t,e){return typeof n=="bigint"&&typeof t=="bigint"&&typeof e=="bigint"?V(n,t,e):Number(V(BigInt(n),BigInt(t),BigInt(e)))}const v=crypto,mn=new TextEncoder,yn=new TextDecoder("utf-8",{ignoreBOM:!0}),T={encode:n=>mn.encode(n),decode:n=>yn.decode(n)},nn=(()=>{const t=[..."0123456789abcdef"],e=new Array(256);for(let r=0;r<256;r++)e[r]=`${t[r>>>4&15]}${t[r&15]}`;return e})(),xn=(()=>{const n={};for(let t=0;t<256;t++){const e=nn[t],r=e[0],s=r.toUpperCase(),i=e[1],o=i.toUpperCase();n[e]=t,n[`${r}${o}`]=t,n[`${s}${i}`]=t,n[`${s}${o}`]=t}return n})(),wn=n=>!(n.length%2||!/^[a-fA-F0-9]*$/.test(n)),O={encode:n=>{let t="";for(let e=0,r=n.length;e<r;e++)t+=nn[n[e]];return t},encodeStr:n=>O.encode(T.encode(n)),decode:n=>{const t=n.length/2,e=new Uint8Array(t);for(let r=0;r<t;r++)e[r]=xn[n.slice(r*2,r*2+2)];return e},decodeStr:n=>T.decode(O.decode(n)),is:wn},en=n=>O.encode(n),X=new TextEncoder,U=n=>{const t=async o=>o instanceof Uint8Array?v.subtle.importKey("raw",o,{name:"PBKDF2"},!1,["deriveBits"]):typeof o=="string"?t(X.encode(o.normalize())):o,e=(o,a,l,d)=>(a=typeof a=="string"?X.encode(a):a,v.subtle.deriveBits({name:"PBKDF2",salt:a,iterations:l,hash:{name:n}},o,d)),r=async(o,a,l,d)=>{const g=await t(o);return await e(g,a,l,d*8)},s=async(o,a,l,d)=>new Uint8Array(await r(o,a,l,d)),i=async(o,a,l,d)=>en(await s(o,a,l,d));return i.buffer=r,i.hex=i,i.uint8=s,i},tn={sha1:U("SHA-1"),sha256:U("SHA-256"),sha384:U("SHA-384"),sha512:U("SHA-512")},z=n=>{const t=new Uint8Array(n);return v.getRandomValues(t),t},bn=new TextEncoder,R=n=>{const t=s=>(s=typeof s=="string"?bn.encode(s):s,v.subtle.digest(n,s)),e=async s=>new Uint8Array(await t(s)),r=async s=>en(await e(s));return r.buffer=t,r.hex=r,r.uint8=e,r};R("SHA-1");const rn=R("SHA-256");R("SHA-384");R("SHA-512");const x={encode:n=>{if(n!==n>>0)throw new Error("Invalid 32-bit integer");const t=n>>24&255,e=n>>16&255,r=n>>8&255,s=n>>0&255;return new Uint8Array([t,e,r,s])},decode:n=>{if(n.length!==4)throw new Error("Invalid 32-bit integer");const t=n[0],e=n[1],r=n[2],s=n[3];return(t<<24)+(e<<16)+(r<<8)+(s<<0)}},sn=n=>{const t=n.reduce((r,s)=>r+s.byteLength,0),e=new Uint8Array(t);for(let r=0,s=0,i=n.length;s<i;s++)e.set(n[s],r),r+=n[s].byteLength;return e},vn=async(n,t,e,r)=>{n=typeof n=="string"?T.encode(n):n,e=typeof e=="string"?T.encode(e):e||z(32),e=e.length===32?e:await rn.uint8(e);const s=new Uint8Array([1]),i=Math.max(1,r||0),o=await tn.sha256.uint8(t,e,i,32),a=await v.subtle.importKey("raw",o,"AES-GCM",!1,["encrypt"]),l=z(16),d=await v.subtle.encrypt({name:"AES-GCM",iv:l,length:256,tagLength:128},a,n),g=new Uint8Array(d);return sn([s,e,x.encode(i),l,g])},kn=async(n,t)=>{if(n[0]!==1)throw new Error("Unsupported encrypted archive version");const r=n.subarray(1,33),s=x.decode(n.subarray(33,37)),i=n.subarray(37,53),o=n.subarray(53),a=await tn.sha256.uint8(t,r,s,32),l=await v.subtle.importKey("raw",a,"AES-GCM",!1,["decrypt"]),d=await v.subtle.decrypt({name:"AES-GCM",iv:i,length:256,tagLength:128},l,o);return new Uint8Array(d)},Y=Object.freeze(Object.defineProperty({__proto__:null,decrypt:kn,encrypt:vn},Symbol.toStringTag,{value:"Module"}));function I(n){let t,e=0;return()=>((!t||e===t.length)&&(t=new n(65536/(n.BYTES_PER_ELEMENT*8)),e=0,v.getRandomValues(t)),t[e++])}function _n(n,t){let e=0,r=t;return()=>(r===t&&(e=n(),r=0),e&1<<r++?1:0)}const L={get1:_n(I(Uint8Array),8),get8:I(Uint8Array),get16:I(Uint16Array),get32:I(Uint32Array),get64:I(BigUint64Array)},jn=Object.assign(()=>BigInt(L.get1()),{BITS:1}),Cn=Object.assign(()=>BigInt(L.get8()),{BITS:8}),Nn=Object.assign(()=>BigInt(L.get16()),{BITS:16}),Sn=Object.assign(()=>BigInt(L.get32()),{BITS:32}),Bn=Object.assign(()=>L.get64(),{BITS:64}),u=n=>{const t=n<=1?jn:n<=8?Cn:n<=16?Nn:n<=32?Sn:Bn,e=t.BITS;if(n===e)return t();if(n===128)return t()<<64n|t();if(n===160)return u(128)<<32n|u(32);if(n===192)return u(128)<<64n|u(64);if(n===224)return u(160)<<64n|u(64);if(n===256)return u(128)<<128n|u(128);if(n===384)return u(256)<<128n|u(128);if(n===512)return u(256)<<256n|u(256);if(n===1024)return u(512)<<512n|u(512);if(n===2048)return u(1024)<<1024n|u(1024);let r=0,s=0n;for(;r<n;){const i=Math.min(e,n-r),o=2n**BigInt(i)-1n,l=t()&o;if(n===i)return l;s=r?s|l<<BigInt(r):l,r+=i}return s},on=(n,t)=>{if(n=BigInt(n),t=BigInt(t),n<0n||t<0n)throw new Error("Negative ranges are not supported");if(t<=n)throw new Error('"max" must be at least equal to "min" plus 1');const e=t-n-1n,r=e.toString(2).length;for(;;){const s=u(r);if(!(s>e))return s+n}},J=[2n,3n,5n,7n,11n,13n,17n,19n,23n,29n,31n,37n,41n,43n,47n,53n,59n,61n,67n,71n,73n,79n,83n,89n,97n,101n,103n,107n,109n,113n,127n,131n,137n,139n,149n,151n,157n,163n,167n,173n,179n,181n,191n,193n,197n,199n,211n,223n,227n,229n,233n,239n,241n,251n,257n,263n,269n,271n,277n,281n,283n,293n,307n,311n,313n,317n,331n,337n,347n,349n,353n,359n,367n,373n,379n,383n,389n,397n,401n,409n,419n,421n,431n,433n,439n,443n,449n,457n,461n,463n,467n,479n,487n,491n,499n,503n,509n,521n,523n,541n,547n,557n,563n,569n,571n,577n,587n,593n,599n,601n,607n,613n,617n,619n,631n,641n,643n,647n,653n,659n,661n,673n,677n,683n,691n,701n,709n,719n,727n,733n,739n,743n,751n,757n,761n,769n,773n,787n,797n,809n,811n,821n,823n,827n,829n,839n,853n,857n,859n,863n,877n,881n,883n,887n,907n,911n,919n,929n,937n,941n,947n,953n,967n,971n,977n,983n,991n,997n],An=(n,t=8)=>{if(n<=1n)return!1;for(let s=0,i=J.length;s<i;s++){const o=J[s];if(n%o===0n)return n===o}if(n<=1000n)return!1;let e=0n,r=n-1n;for(;(r&1n)===0n;)e+=1n,r>>=1n;for(let s=0;s<t;s++){const i=on(2n,n-2n);let o=M(i,r,n),a=0n;for(let l=0;l<e;l++){if(a=M(o,2n,n),a===1n&&o!==1n&&o!==n-1n)return!1;o=a}if(a!==1n)return!1}return!0},Q=(n,t=8)=>{let e=u(n);for((e&1n)===0n&&(e+=1n);;){if(An(e,t))return e;e+=2n}},w={encode:n=>{let t=0n;for(let e=0,r=n.length;e<r;e++)t|=BigInt(n[e])<<(BigInt(r)-BigInt(e)-1n)*8n;return t},decode:n=>{if(n<0n)throw new Error("Negative BigInts are not supported");const t=[];for(;n;)t.push(Number(n&0xffn)),n>>=8n;return new Uint8Array(t.reverse())}},Z={archive:n=>{const[t,e,r,s,i]=n,o=w.decode(t),a=x.encode(o.length),l=w.decode(e),d=x.encode(l.length),g=w.decode(r),p=x.encode(g.length),b=w.decode(s),h=x.encode(b.length);return sn([a,o,d,l,p,g,h,b,i])},unarchive:n=>{const e=n.slice(0,4),r=x.decode(e),s=4,i=n.slice(s,s+r),o=w.encode(i),a=s+r,l=n.slice(a,a+4),d=x.decode(l),g=a+4,p=n.slice(g,g+d),b=w.encode(p),h=g+d,N=n.slice(h,h+4),m=x.decode(N),k=h+4,S=n.slice(k,k+m),j=w.encode(S),f=k+m,B=n.slice(f,f+4),C=x.decode(B),y=f+4,F=n.slice(y,y+C),$=w.encode(F),_=y+C,A=n.slice(_);return[o,b,j,$,A]}},En=(n,t,e)=>{let r=n%e;if(t<=BigInt(Number.MAX_SAFE_INTEGER))for(let s=Number(t);s>0;s--)r=r*r%e;else for(let s=t;s>0n;s--)r=r*r%e;return r%e},In={generate:async n=>{const t=n.primeBits??100,e=n.primeRounds??20,r=n.opsPerSecond??33e5,s=n.duration??1e3,i=n.message,o=Q(t,e),a=Q(t,e),l=o*a,d=(o-1n)*(a-1n),g=r,p=s,b=BigInt(Math.round(Math.max(1,g/1e3)*p)),h=await rn.uint8(z(32)),N=i,m=await Y.encrypt(N,h),k=on(1n,l-1n),S=M(2n,b,d),j=M(k,S,l),f=w.encode(h)+j;return Z.archive([l,k,b,f,m])},solve:async n=>{const[t,e,r,s,i]=Z.unarchive(n),o=En(e,r,t),a=w.decode(s-o),l=await Y.decrypt(i,a);return T.decode(l)}};function Fn(){const[n,t]=E.useState(!1);E.useEffect(()=>{cn()},[]);const e=an(),r=Array.isArray(e.props.captchaTask)&&e.props.captchaTask.length>0,[s,i]=E.useState("I'm not a robot"),[o,a]=E.useState(!1),[l,d]=E.useState(!1),{post:g,data:p,setData:b,processing:h,transform:N,errors:m,clearErrors:k}=ln({login:"",password:"",captchaSolution:"",redirectTo:e.props.redirectTo??""}),S=f=>{if(f.preventDefault(),!r){g(e.props.submitLink,{onError:C=>{for(const y of Object.keys(C))q.error(C[y])}});return}t(!0),i("Solving CAPTCHA..."),a(!1),(async()=>{try{let y=function(_){return new Promise(A=>setTimeout(A,_))};var C=y;await y(100);const F=new Uint8Array(e.props.captchaTask),$=await In.solve(F);i("Verification complete!"),t(!1),a(!0),N(_=>({..._,captchaSolution:$})),g(e.props.submitLink,{onError:_=>{for(const A of Object.keys(_))q.error(_[A])}})}catch(y){console.error("Error solving CAPTCHA:",y),i("Error solving CAPTCHA. Try again.")}})()},j=(f,B)=>{k(),b(f,B)};return c.jsxs("div",{className:"bg-sidebar flex min-h-svh w-full justify-center",children:[c.jsx(dn,{position:"top-center",richColors:!0,closeButton:!0}),c.jsxs("div",{className:"rounded-xl border bg-card text-card-foreground shadow p-6 max-w-sm w-full h-fit mt-[15%]",children:[c.jsx("h1",{className:"font-medium mb-6 text-xl",children:e.props.title}),e.props.description&&c.jsx("p",{className:"font-thin mb-6 text-xs pb-10",children:e.props.description}),c.jsxs("form",{onSubmit:S,children:[p.redirectTo&&c.jsx("input",{type:"hidden",name:"redirectTo",value:p.redirectTo}),c.jsxs("div",{className:"grid gap-5",children:[r&&c.jsx(H,{message:m.captchaSolution}),c.jsxs("div",{className:"grid gap-4",children:[c.jsx(D,{htmlFor:"login",children:e.props.login}),c.jsxs("div",{className:"relative",children:[c.jsx(P,{iconNode:un,className:"size-5 absolute inset-2 text-muted-foreground"}),c.jsx(G,{id:"login",className:`pl-10 ${m.login?"border-red-500":""}`,type:"text",required:!0,tabIndex:1,autoComplete:"username",value:p.login,disabled:h||n,onChange:f=>{j("login",f.target.value)},placeholder:e.props.login}),c.jsx(H,{message:m.login})]})]}),c.jsxs("div",{className:"grid gap-4",children:[c.jsx(D,{htmlFor:"password",children:e.props.password}),c.jsxs("div",{className:"relative",children:[c.jsx(P,{iconNode:gn,className:"size-5 absolute inset-2 text-muted-foreground"}),c.jsx(G,{id:"password",className:`pl-10 pr-10 ${m.password?"border-red-500":""}`,type:l?"text":"password",required:!0,disabled:h||n,tabIndex:1,autoComplete:"current-password",value:p.password,onChange:f=>{j("password",f.target.value)},placeholder:e.props.password}),c.jsx("button",{type:"button",onClick:()=>d(!l),className:"absolute right-2 top-1/2 -translate-y-1/2 text-muted-foreground hover:text-foreground transition-colors",tabIndex:-1,children:c.jsx(P,{iconNode:l?hn:fn,className:"size-5"})}),c.jsx(H,{message:m.password})]})]}),c.jsxs("div",{className:"flex gap-4",children:[c.jsx(K,{type:"submit",className:"w-fit",disabled:h||n,children:e.props.submitButton}),e.props.registerLink&&c.jsx(K,{asChild:!0,variant:"outline",children:c.jsx(W,{href:e.props.registerLink.link,className:`${h||n} ? 'pointer-events-none opacity-50' : ''`,children:e.props.registerLink.title})})]})]}),r&&c.jsxs("div",{className:"bg-card border rounded-lg shadow-lg p-4 mt-6 flex items-center space-x-4",children:[c.jsxs("div",{className:"relative",children:[c.jsx("div",{className:"w-10 h-10 bg-primary/10 rounded-full flex items-center justify-center",children:c.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",className:"h-6 w-6 text-primary",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:"2",children:c.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M12 2l3.09 6.26L22 9.27l-5 4.87L18.18 22 12 18.27 5.82 22 7 14.14l-5-4.87 6.91-1.01L12 2z"})})}),c.jsx("div",{className:`${n?"":"hidden"}`,children:c.jsx(P,{iconNode:pn,className:"animate-spin size-6 absolute inset-0 m-auto text-muted-foreground"})})]}),c.jsx("div",{className:"text-foreground font-semibold",children:s}),c.jsx("div",{className:`transition-opacity ${o?"opacity-100 visible":"opacity-0 invisible"}`,children:c.jsx("svg",{id:"checkmark",xmlns:"http://www.w3.org/2000/svg",className:"h-8 w-8 text-green-500",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"3",children:c.jsx("path",{className:"checkmark",strokeLinecap:"round",strokeLinejoin:"round",d:"M5 13l4 4L19 7"})})})]})]}),e.props.addishinalLoginPage&&c.jsx("div",{className:"mt-6 text-center",children:c.jsx(W,{href:e.props.addishinalLoginPage.link,className:"text-sm underline",target:e.props.addishinalLoginPage.link.startsWith("http://")||e.props.addishinalLoginPage.link.startsWith("https://")?"_blank":void 0,rel:e.props.addishinalLoginPage.link.startsWith("http://")||e.props.addishinalLoginPage.link.startsWith("https://")?"noopener noreferrer":void 0,children:e.props.addishinalLoginPage.title})})]})]})}export{Fn as default};
@@ -776,7 +776,7 @@
776
776
  ]
777
777
  },
778
778
  "src/assets/js/pages/login.tsx": {
779
- "file": "login-CyEIe-hN.js",
779
+ "file": "login-Cla-c7nv.js",
780
780
  "name": "login",
781
781
  "src": "src/assets/js/pages/login.tsx",
782
782
  "isDynamicEntry": true,
@@ -1 +1 @@
1
- export default function add(req: ReqType, res: ResType): Promise<import("express").Response<any, Record<string, any>>>;
1
+ export default function add(req: ReqType, res: ResType): Promise<void | import("express").Response<any, Record<string, any>>>;
@@ -5,6 +5,7 @@ import { detachMediaManagerField, saveRelationsMediaManager } from "../lib/media
5
5
  import { DataAccessor } from "../lib/DataAccessor.js";
6
6
  import { Adminizer } from "../lib/Adminizer.js";
7
7
  import inertiaAddHelper from "../helpers/inertiaAddHelper.js";
8
+ import { redirectToLogin } from '../helpers/inertiaAutHelper.js';
8
9
  export default async function add(req, res) {
9
10
  let entity = ControllerHelper.findEntityObject(req);
10
11
  if (!entity.model) {
@@ -15,7 +16,7 @@ export default async function add(req, res) {
15
16
  }
16
17
  if (req.adminizer.config.auth.enable) {
17
18
  if (!req.user) {
18
- return req.Inertia.redirect(`${req.adminizer.config.routePrefix}/model/userap/login`);
19
+ return redirectToLogin(req, res);
19
20
  }
20
21
  else if (!req.adminizer.accessRightsHelper.hasPermission(`create-${entity.name}-model`, req.user)) {
21
22
  return res.sendStatus(403);
@@ -1,11 +1,12 @@
1
1
  import { ControllerHelper } from "../helpers/controllerHelper.js";
2
2
  import { Adminizer } from "../lib/Adminizer.js";
3
3
  import { inertiaGroupHelper } from "../helpers/inertiaGroupHelper.js";
4
+ import { redirectToLogin } from '../helpers/inertiaAutHelper.js';
4
5
  export default async function addGroup(req, res) {
5
6
  let entity = ControllerHelper.findEntityObject(req);
6
7
  if (req.adminizer.config.auth.enable) {
7
8
  if (!req.user) {
8
- return res.redirect(`${req.adminizer.config.routePrefix}/model/userap/login`);
9
+ return redirectToLogin(req, res);
9
10
  }
10
11
  else if (!req.adminizer.accessRightsHelper.hasPermission(`create-${entity.name}-model`, req.user)) {
11
12
  return res.sendStatus(403);
@@ -2,11 +2,12 @@ import { ControllerHelper } from "../helpers/controllerHelper.js";
2
2
  import { Adminizer } from "../lib/Adminizer.js";
3
3
  import { generate } from 'password-hash';
4
4
  import { inertiaUserHelper } from "../helpers/inertiaUserHelper.js";
5
+ import { redirectToLogin } from '../helpers/inertiaAutHelper.js';
5
6
  export default async function (req, res) {
6
7
  let entity = ControllerHelper.findEntityObject(req);
7
8
  if (req.adminizer.config.auth.enable) {
8
9
  if (!req.user) {
9
- return res.redirect(`${req.adminizer.config.routePrefix}/model/userap/login`);
10
+ return redirectToLogin(req, res);
10
11
  }
11
12
  else if (!req.adminizer.accessRightsHelper.hasPermission(`create-${entity.name}-model`, req.user)) {
12
13
  return res.sendStatus(403);
@@ -1,12 +1,13 @@
1
1
  import { FrontendCatalog, FrontendCatalogUtils } from "./FrontendCatalogAdapter.js";
2
2
  import { Adminizer } from "../../lib/Adminizer.js";
3
+ import { redirectToLogin } from '../../helpers/inertiaAutHelper.js';
3
4
  export async function catalogController(req, res) {
4
5
  const slug = req.params.slug;
5
6
  let id = req.params.id ? req.params.id : '';
6
7
  const postfix = id ? `${slug}-${id}` : `${slug}`;
7
8
  if (req.adminizer.config.auth.enable) {
8
9
  if (!req.user) {
9
- return res.redirect(`${req.adminizer.config.routePrefix}/model/userap/login`);
10
+ return redirectToLogin(req, res);
10
11
  }
11
12
  else if (!req.adminizer.accessRightsHelper.hasPermission(`catalog-${postfix}`, req.user)) {
12
13
  return res.sendStatus(403);
@@ -1,11 +1,12 @@
1
1
  import { ControllerHelper } from "../helpers/controllerHelper.js";
2
2
  import * as fs from "fs";
3
3
  import multer from "multer";
4
+ import { redirectToLogin } from '../helpers/inertiaAutHelper.js';
4
5
  export async function ckEditorUpload(req, res) {
5
6
  let entity = ControllerHelper.findEntityObject(req);
6
7
  if (req.adminizer.config.auth.enable) {
7
8
  if (!req.user) {
8
- res.redirect(`${req.adminizer.config.routePrefix}/model/userap/login`);
9
+ redirectToLogin(req, res);
9
10
  return;
10
11
  }
11
12
  else if (!req.adminizer.accessRightsHelper.enoughPermissions([
@@ -1,6 +1,7 @@
1
+ import { redirectToLogin } from '../helpers/inertiaAutHelper.js';
1
2
  export default function (req, res) {
2
3
  if (req.adminizer.config.auth.enable && !req.user) {
3
- return res.redirect(`${req.adminizer.config.routePrefix}/model/userap/login`);
4
+ return redirectToLogin(req, res);
4
5
  }
5
6
  return req.Inertia.render({
6
7
  component: 'dashboard',
@@ -1,6 +1,7 @@
1
1
  import { ControllerHelper } from "../helpers/controllerHelper.js";
2
2
  import { RequestProcessor } from "../lib/requestProcessor.js";
3
3
  import { FieldsHelper } from "../helpers/fieldsHelper.js";
4
+ import { redirectToLogin } from '../helpers/inertiaAutHelper.js';
4
5
  import { detachMediaManagerField, getRelationsMediaManager, saveRelationsMediaManager } from "../lib/media-manager/helpers/MediaManagerHelper.js";
5
6
  import { DataAccessor } from "../lib/DataAccessor.js";
6
7
  import { Adminizer } from "../lib/Adminizer.js";
@@ -19,7 +20,7 @@ export default async function edit(req, res) {
19
20
  }
20
21
  if (req.adminizer.config.auth.enable) {
21
22
  if (!req.user) {
22
- return res.redirect(`${req.adminizer.config.routePrefix}/model/userap/login`);
23
+ return redirectToLogin(req, res);
23
24
  }
24
25
  else if (!req.adminizer.accessRightsHelper.hasPermission(`update-${entity.name}-model`, req.user)) {
25
26
  return res.sendStatus(403);
@@ -1,11 +1,12 @@
1
1
  import { ControllerHelper } from "../helpers/controllerHelper.js";
2
2
  import { Adminizer } from "../lib/Adminizer.js";
3
3
  import { inertiaGroupHelper } from "../helpers/inertiaGroupHelper.js";
4
+ import { redirectToLogin } from '../helpers/inertiaAutHelper.js';
4
5
  export default async function editGroup(req, res) {
5
6
  let entity = ControllerHelper.findEntityObject(req);
6
7
  if (req.adminizer.config.auth.enable) {
7
8
  if (!req.user) {
8
- return res.redirect(`${req.adminizer.config.routePrefix}/model/userap/login`);
9
+ return redirectToLogin(req, res);
9
10
  }
10
11
  else if (!req.adminizer.accessRightsHelper.hasPermission(`update-${entity.name}-model`, req.user)) {
11
12
  return res.sendStatus(403);
@@ -2,11 +2,12 @@ import { ControllerHelper } from "../helpers/controllerHelper.js";
2
2
  import { Adminizer } from "../lib/Adminizer.js";
3
3
  import { generate } from "password-hash";
4
4
  import { inertiaUserHelper } from "../helpers/inertiaUserHelper.js";
5
+ import { redirectToLogin } from '../helpers/inertiaAutHelper.js';
5
6
  export default async function (req, res) {
6
7
  let entity = ControllerHelper.findEntityObject(req);
7
8
  if (req.adminizer.config.auth.enable) {
8
9
  if (!req.user) {
9
- return res.redirect(`${req.adminizer.config.routePrefix}/model/userap/login`);
10
+ return redirectToLogin(req, res);
10
11
  }
11
12
  else if (!req.adminizer.accessRightsHelper.hasPermission(`update-${entity.name}-model`, req.user)) {
12
13
  return res.sendStatus(403);
@@ -2,6 +2,7 @@ import { FormHelper } from "../helpers/formHelper.js";
2
2
  import { Adminizer } from "../lib/Adminizer.js";
3
3
  import inertiaFormHelper from "../helpers/inertiaFromHelper.js";
4
4
  import { getRelationsMediaManager } from "../lib/media-manager/helpers/MediaManagerHelper.js";
5
+ import { redirectToLogin } from '../helpers/inertiaAutHelper.js';
5
6
  export default async function form(req, res) {
6
7
  let slug = req.params.slug;
7
8
  // Check slug
@@ -10,7 +11,7 @@ export default async function form(req, res) {
10
11
  }
11
12
  if (req.adminizer.config.auth.enable) {
12
13
  if (!req.user) {
13
- return res.redirect(`${req.adminizer.config.routePrefix}/model/userap/login`);
14
+ return redirectToLogin(req, res);
14
15
  }
15
16
  else if (!req.adminizer.accessRightsHelper.hasPermission(`update-${slug}-form`, req.user)) {
16
17
  return res.sendStatus(403);
@@ -1,7 +1,8 @@
1
+ import { redirectToLogin } from '../helpers/inertiaAutHelper.js';
1
2
  export default async function getAllWidgets(req, res) {
2
3
  if (req.adminizer.config.auth.enable) {
3
4
  if (!req.user) {
4
- return res.redirect(`${req.adminizer.config.routePrefix}/model/userap/login`);
5
+ return redirectToLogin(req, res);
5
6
  }
6
7
  else if (!req.adminizer.accessRightsHelper.hasPermission(`widgets`, req.user)) {
7
8
  return res.sendStatus(403);
@@ -1,4 +1,5 @@
1
1
  import { Adminizer } from "../../lib/Adminizer.js";
2
+ import { redirectToLogin } from '../../helpers/inertiaAutHelper.js';
2
3
  export class HistoryController {
3
4
  static async index(req, res) {
4
5
  const isUiRequest = req.method.toUpperCase() === 'GET';
@@ -124,7 +125,7 @@ export class HistoryController {
124
125
  if (req.adminizer.config.auth.enable) {
125
126
  if (!req.user) {
126
127
  if (shouldRedirectToLogin) {
127
- res.redirect(`${req.adminizer.config.routePrefix}/model/userap/login`);
128
+ redirectToLogin(req, res);
128
129
  }
129
130
  else {
130
131
  res.status(401).json({ error: 'Unauthorized' });
@@ -3,6 +3,7 @@ import { DataAccessor } from "../lib/DataAccessor.js";
3
3
  import { NodeTable } from "../lib/datatable/NodeTable.js";
4
4
  import { Adminizer } from "../lib/Adminizer.js";
5
5
  import { inertiaListHelper } from "../helpers/inertiaListHelper.js";
6
+ import { redirectToLogin } from '../helpers/inertiaAutHelper.js';
6
7
  export default async function list(req, res) {
7
8
  let entity = ControllerHelper.findEntityObject(req);
8
9
  if (!entity.model) {
@@ -10,7 +11,7 @@ export default async function list(req, res) {
10
11
  }
11
12
  if (req.adminizer.config.auth.enable) {
12
13
  if (!req.user) {
13
- return res.redirect(`${req.adminizer.config.routePrefix}/model/userap/login`);
14
+ return redirectToLogin(req, res);
14
15
  }
15
16
  else if (!req.adminizer.accessRightsHelper.hasPermission(`read-${entity.name}-model`, req.user)) {
16
17
  return res.sendStatus(403);
@@ -73,12 +73,13 @@ export default async function login(req, res) {
73
73
  path: '/',
74
74
  maxAge: 60 * 60 * 24 * 7 * 2,
75
75
  }));
76
+ const redirectTo = req.body.redirectTo;
77
+ const safeRedirect = redirectTo && redirectTo.startsWith('/') ? redirectTo : `${req.adminizer.config.routePrefix}/`;
76
78
  // Force full page reload after login to prevent iframe issues
77
79
  if (req.headers['x-inertia']) {
78
- // If it's an Inertia request, send 409 to force full page reload
79
- return res.writeHead(409, { 'x-inertia-location': `${req.adminizer.config.routePrefix}/` }).end();
80
+ return res.writeHead(409, { 'x-inertia-location': safeRedirect }).end();
80
81
  }
81
- return res.redirect(`${req.adminizer.config.routePrefix}/`);
82
+ return res.redirect(safeRedirect);
82
83
  }
83
84
  else {
84
85
  return inertiaAdminMessage(req, "Wrong password", 'password');
@@ -1,4 +1,5 @@
1
1
  import { MediaManagerAdapter } from "./mediaManagerAdapter.js";
2
+ import { redirectToLogin } from '../../helpers/inertiaAutHelper.js';
2
3
  export async function mediaManagerController(req, res) {
3
4
  const method = req.method.toUpperCase();
4
5
  let id = req.params.id ? req.params.id : '';
@@ -6,7 +7,7 @@ export async function mediaManagerController(req, res) {
6
7
  // await delay(1000);
7
8
  if (req.adminizer.config.auth.enable) {
8
9
  if (!req.user) {
9
- return res.redirect(`${req.adminizer.config.routePrefix}/model/userap/login`);
10
+ return redirectToLogin(req, res);
10
11
  }
11
12
  else if (!req.adminizer.accessRightsHelper.hasPermission(`mediaManager-${id}`, req.user)) {
12
13
  return res.sendStatus(403);
@@ -1,9 +1,10 @@
1
1
  import { ControllerHelper } from "../../helpers/controllerHelper.js";
2
2
  import { DataAccessor } from "../../lib/DataAccessor.js";
3
+ import { redirectToLogin } from '../../helpers/inertiaAutHelper.js';
3
4
  export default async function edit(req, res) {
4
5
  if (req.adminizer.config.auth.enable) {
5
6
  if (!req.user) {
6
- return res.redirect(`${req.adminizer.config.routePrefix}/model/userap/login`);
7
+ return redirectToLogin(req, res);
7
8
  }
8
9
  }
9
10
  let entity = ControllerHelper.findEntityObject(req);
@@ -1,4 +1,5 @@
1
1
  import { Adminizer } from '../../lib/Adminizer.js';
2
+ import { redirectToLogin } from '../../helpers/inertiaAutHelper.js';
2
3
  export class NotificationController {
3
4
  static async search(req, res) {
4
5
  if (!NotificationController.checkNotifPermission(req, res))
@@ -236,7 +237,7 @@ export class NotificationController {
236
237
  // We use the redirect only for UI pages; API requests receive 401.
237
238
  if (req.adminizer.config.auth.enable && !req.user) {
238
239
  if (shouldRedirectToLogin) {
239
- res.redirect(`${req.adminizer.config.routePrefix}/model/userap/login`);
240
+ redirectToLogin(req, res);
240
241
  }
241
242
  else {
242
243
  res.status(401).json({ error: 'Unauthorized' });
@@ -2,6 +2,7 @@ import { ControllerHelper } from "../helpers/controllerHelper.js";
2
2
  import { deleteRelationsMediaManager } from "../lib/media-manager/helpers/MediaManagerHelper.js";
3
3
  import { DataAccessor } from "../lib/DataAccessor.js";
4
4
  import { Adminizer } from "../lib/Adminizer.js";
5
+ import { redirectToLogin } from '../helpers/inertiaAutHelper.js';
5
6
  export default async function remove(req, res) {
6
7
  // Checking id of the record
7
8
  if (!req.params.id) {
@@ -19,7 +20,7 @@ export default async function remove(req, res) {
19
20
  }
20
21
  if (req.adminizer.config.auth.enable) {
21
22
  if (!req.user) {
22
- return res.redirect(`${req.adminizer.config.routePrefix}/model/userap/login`);
23
+ return redirectToLogin(req, res);
23
24
  }
24
25
  else if (!req.adminizer.accessRightsHelper.hasPermission(`delete-${entity.name}-model`, req.user)) {
25
26
  return res.sendStatus(403);
@@ -1,7 +1,8 @@
1
+ import { redirectToLogin } from '../helpers/inertiaAutHelper.js';
1
2
  export default async function timezones(req, res) {
2
3
  if (req.adminizer.config.auth.enable) {
3
4
  if (!req.user) {
4
- return res.redirect(`${req.adminizer.config.routePrefix}/model/userap/login`);
5
+ return redirectToLogin(req, res);
5
6
  }
6
7
  }
7
8
  let timezones = [];
@@ -6,6 +6,7 @@ import { inertiaGroupHelper } from "../helpers/inertiaGroupHelper.js";
6
6
  import inertiaAddHelper from "../helpers/inertiaAddHelper.js";
7
7
  import { FieldsHelper } from "../helpers/fieldsHelper.js";
8
8
  import { getRelationsMediaManager } from "../lib/media-manager/helpers/MediaManagerHelper.js";
9
+ import { redirectToLogin } from '../helpers/inertiaAutHelper.js';
9
10
  export default async function view(req, res) {
10
11
  // Check id
11
12
  if (!req.params.id) {
@@ -20,7 +21,7 @@ export default async function view(req, res) {
20
21
  }
21
22
  if (req.adminizer.config.auth.enable) {
22
23
  if (!req.user) {
23
- return res.redirect(`${req.adminizer.config.routePrefix}/model/userap/login`);
24
+ return redirectToLogin(req, res);
24
25
  }
25
26
  else if (!req.adminizer.accessRightsHelper.hasPermission(`read-${entity.name}-model`, req.user)) {
26
27
  return res.sendStatus(403);
@@ -1,9 +1,10 @@
1
+ import { redirectToLogin } from '../helpers/inertiaAutHelper.js';
1
2
  /**
2
3
  * Welcome text
3
4
  */
4
5
  export default function welcome(req, res) {
5
6
  if (!req.user) {
6
- return res.redirect(`${req.adminizer.config.routePrefix}/model/userap/login`);
7
+ return redirectToLogin(req, res);
7
8
  }
8
9
  let text = '';
9
10
  let title = '';
@@ -1,3 +1,4 @@
1
+ import { redirectToLogin } from '../../helpers/inertiaAutHelper.js';
1
2
  export async function widgetActionController(req, res) {
2
3
  let widgetId = req.params.widgetId;
3
4
  if (!widgetId) {
@@ -5,7 +6,7 @@ export async function widgetActionController(req, res) {
5
6
  }
6
7
  if (req.adminizer.config.auth.enable) {
7
8
  if (!req.user) {
8
- return res.redirect(`${req.adminizer.config.routePrefix}/model/userap/login`);
9
+ return redirectToLogin(req, res);
9
10
  }
10
11
  else if (!req.adminizer.accessRightsHelper.hasPermission(`widget-${widgetId}`, req.user)) {
11
12
  return res.sendStatus(403);
@@ -1,3 +1,4 @@
1
+ import { redirectToLogin } from '../../helpers/inertiaAutHelper.js';
1
2
  export async function widgetCustomController(req, res) {
2
3
  let widgetId = req.params.widgetId;
3
4
  if (!widgetId) {
@@ -5,7 +6,7 @@ export async function widgetCustomController(req, res) {
5
6
  }
6
7
  if (req.adminizer.config.auth.enable) {
7
8
  if (!req.user) {
8
- return res.redirect(`${req.adminizer.config.routePrefix}/model/userap/login`);
9
+ return redirectToLogin(req, res);
9
10
  }
10
11
  else if (!req.adminizer.accessRightsHelper.hasPermission(`widget-${widgetId}`, req.user)) {
11
12
  return res.sendStatus(403);
@@ -1,3 +1,4 @@
1
+ import { redirectToLogin } from '../../helpers/inertiaAutHelper.js';
1
2
  export async function widgetInfoController(req, res) {
2
3
  let widgetId = req.params.widgetId;
3
4
  if (!widgetId) {
@@ -5,7 +6,7 @@ export async function widgetInfoController(req, res) {
5
6
  }
6
7
  if (req.adminizer.config.auth.enable) {
7
8
  if (!req.user) {
8
- return res.redirect(`${req.adminizer.config.routePrefix}/model/userap/login`);
9
+ return redirectToLogin(req, res);
9
10
  }
10
11
  else if (!req.adminizer.accessRightsHelper.hasPermission(`widget-${widgetId}`, req.user)) {
11
12
  return res.sendStatus(403);
@@ -1,3 +1,4 @@
1
+ import { redirectToLogin } from '../../helpers/inertiaAutHelper.js';
1
2
  export async function widgetSwitchController(req, res) {
2
3
  let widgetId = req.params.widgetId;
3
4
  if (!widgetId) {
@@ -5,7 +6,7 @@ export async function widgetSwitchController(req, res) {
5
6
  }
6
7
  if (req.adminizer.config.auth.enable) {
7
8
  if (!req.user) {
8
- return res.redirect(`${req.adminizer.config.routePrefix}/model/userap/login`);
9
+ return redirectToLogin(req, res);
9
10
  }
10
11
  else if (!req.adminizer.accessRightsHelper.hasPermission(`widget-${widgetId}`, req.user)) {
11
12
  return res.sendStatus(403);
@@ -1,9 +1,10 @@
1
+ import { redirectToLogin } from '../helpers/inertiaAutHelper.js';
1
2
  export default async function widgetsDB(req, res) {
2
3
  let id = 0;
3
4
  let auth = req.adminizer.config.auth.enable;
4
5
  if (auth) {
5
6
  if (!req.user) {
6
- return res.redirect(`${req.adminizer.config.routePrefix}/model/userap/login`);
7
+ return redirectToLogin(req, res);
7
8
  }
8
9
  else if (!req.adminizer.accessRightsHelper.hasPermission(`widgets`, req.user)) {
9
10
  return res.sendStatus(403);
@@ -1,3 +1,4 @@
1
+ export declare function redirectToLogin(req: ReqType, res: ResType): void;
1
2
  export declare function inertiaLoginHelper(req: ReqType): Record<string, unknown>;
2
3
  export declare function inertiaRegisterHelper(req: ReqType): Record<string, unknown>;
3
4
  export declare function inertiaInitUserHelper(req: ReqType): Record<string, unknown>;
@@ -1,3 +1,8 @@
1
+ export function redirectToLogin(req, res) {
2
+ const loginUrl = `${req.adminizer.config.routePrefix}/model/userap/login`;
3
+ const redirectTo = encodeURIComponent(req.originalUrl);
4
+ res.redirect(`${loginUrl}?redirectTo=${redirectTo}`);
5
+ }
1
6
  export function inertiaLoginHelper(req) {
2
7
  let props = {};
3
8
  props.login = req.i18n.__('Login');
@@ -5,6 +10,7 @@ export function inertiaLoginHelper(req) {
5
10
  props.title = req.i18n.__("Welcome");
6
11
  props.submitButton = req.i18n.__("Log in");
7
12
  props.submitLink = `${req.adminizer.config.routePrefix}/model/userap/login`;
13
+ props.redirectTo = req.query?.redirectTo || '';
8
14
  if (req.adminizer.config.registration?.enable === true) {
9
15
  props.registerLink = {
10
16
  title: req.i18n.__("Register"),
@@ -12,6 +12,7 @@ export declare class StorageService {
12
12
  protected id: string;
13
13
  protected model: string;
14
14
  protected readonly adminizer: Adminizer;
15
+ readonly ready: Promise<void>;
15
16
  constructor(adminizer: Adminizer, id: string, model: string);
16
17
  initModel(): Promise<void>;
17
18
  getId(): string;
@@ -32,6 +33,8 @@ export declare class StorageServices {
32
33
  add(storage: StorageService): void;
33
34
  get(id: string): StorageService;
34
35
  getAll(): StorageService[];
36
+ /** Resolves when all sections have finished loading from the database */
37
+ ready(): Promise<void>;
35
38
  }
36
39
  export declare class Navigation extends AbstractCatalog {
37
40
  readonly name: string;
@@ -6,11 +6,12 @@ export class StorageService {
6
6
  id;
7
7
  model;
8
8
  adminizer;
9
+ ready;
9
10
  constructor(adminizer, id, model) {
10
11
  this.adminizer = adminizer;
11
12
  this.id = id;
12
13
  this.model = model.toLowerCase();
13
- this.initModel();
14
+ this.ready = this.initModel();
14
15
  }
15
16
  async initModel() {
16
17
  // Direct call by model adapter
@@ -152,6 +153,10 @@ export class StorageServices {
152
153
  getAll() {
153
154
  return this.storages;
154
155
  }
156
+ /** Resolves when all sections have finished loading from the database */
157
+ async ready() {
158
+ await Promise.all(this.storages.map(s => s.ready));
159
+ }
155
160
  }
156
161
  export class Navigation extends AbstractCatalog {
157
162
  name = 'Navigation';
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "adminizer",
3
3
  "type": "module",
4
- "version": "4.5.0-build.197",
4
+ "version": "4.5.0-build.199",
5
5
  "main": "index.js",
6
6
  "exports": {
7
7
  ".": "./index.js",