PageSourceSearch

https://sp-arte.com/build/assets/Index-y_3wK5Xk.js

js sp-arte.com collected 2026-10-02 03:11:02 UTC 8,191 bytes, 3 lines download raw bytes

1import{r,j as e,S as G,x as P}from"./app-Dfd-ZCC0.js";import{A as q}from"./AdminLayout-D9qRAuev.js";import{d as A}from"./index-BZBPH04e.js";import{$ as W}from"./module-Dkq-KTKM.js";import{B as j}from"./Button-COCdFP5a.js";import{D as z}from"./DesktopLargeModal-DHa3kr17.js";import{F as v,a as J}from"./TrashIcon-34nfXBFf.js";import"./NavBarAdmin-DGc4kSag.js";import"./XMarkIcon-B_9sy9LS.js";import"./LogoBlack-D1o2WPhI.js";import"./transition-B13YxkUg.js";import"./keyboard-wOqzMbnR.js";function K({title:n,titleId:l,...c},o){return r.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:o,"aria-labelledby":l},c),n?r.createElement("title",{id:l},n):null,r.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"m16.862 4.487 1.687-1.688a1.875 1.875 0 1 1 2.652 2.652L6.832 19.82a4.5 4.5 0 0 1-1.897 1.13l-2.685.8.8-2.685a4.5 4.5 0 0 1 1.13-1.897L16.863 4.487Zm0 0L19.5 7.125"}))}const S=r.forwardRef(K);function V({title:n,titleId:l,...c},o){return r.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:o,"aria-labelledby":l},c),n?r.createElement("title",{id:l},n):null,r.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M12 4.5v15m7.5-7.5h-15"}))}const X=r.forwardRef(V),oe=({menus:n=[],successMsg:l})=>{const[c,o]=r.useState(!1),[k,b]=r.useState(!1),[g,D]=r.useState(!1),[u,E]=r.useState([]),[m,w]=r.useState(!1),[L,I]=r.useState(!1),[p,N]=r.useState(!1),[M,C]=r.useState(!1),[d,x]=r.useState({menus:[],draggingItem:null});r.useEffect(()=>{if(!L){if(n.length>0){var s=[];n.map(a=>{s.push(a)}),x(a=>({...a,menus:s}))}I(!0)}});const R=async()=>{if(w(!m),M){N(!0);try{(await fetch(route("menu.reorder"),{method:"POST",headers:{"X-CSRF-TOKEN":document.querySelector('meta[name="csrf-token"]').content,"Content-Type":"application/json"},body:JSON.stringify(d.menus)}).then(function(a){return a.json()}).then(function(a){return a})).success&&(window.location.href=route("menu.index"))}catch(s){console.log(s)}finally{w(!m),N(!1)}}},T=()=>{A.Inertia.delete(route("menu.destroy",g.id),{onSuccess:()=>{o(!1)},onError:s=>{console.error("Error deleting menu:",s)}})},_=s=>{s.submenu_group.length>0&&(E(s.submenu_group),b(!0))},$=(s,a)=>{x(t=>({...t,draggingItem:a})),s.dataTransfer.setData("text/plain","")},O=()=>{x(s=>({...s,draggingItem:null}))},F=(s,a)=>{var t=d.menus;if(!d.draggingItem)return;const h=t.findIndex(function(i,f){return i.id===d.draggingItem.id}),y=t.findIndex(function(i,f){return i.id===a.id});h!==-1&&y!==-1&&(t.splice(h,1),t.splice(y,0,d.draggingItem),t.map((i,f)=>{i.order=f+1}),C(!0),x(i=>({...i,menus:t})))},B=()=>{b(!1)};return e.jsxs(q,{children:[e.jsx(G,{title:"Gerenciar Menus"}),e.jsxs("div",{className:"container mx-auto p-4",children:[e.jsx("h1",{className:"text-2xl font-semibold mb-4",children:"Gerenciamento do Menu"}),l&&e.jsx("div",{className:"bg-green-100 border border-green-400 text-green-700 px-4 py-3 rounded mb-4",children:l}),e.jsxs("div",{className:"flex justify-between",children:[e.jsx(P,{href:route("menu.create"),className:`bg-black hover:bg-white hover:text-black hover:border-black border
2            text-white font-semibold py-2 px-4 rounded-3xl`,children:e.jsxs("div",{className:"flex align-middle pt-1",children:[e.jsx(X,{className:"h-5 w-5"}),e.jsx("span",{className:"ml-2",children:"Novo menu"})]})}),e.jsx(j,{onClick:()=>R(),className:`bg-white hover:bg-black hover:text-white border
3            text-black font-semibold py-2 px-4 rounded-3xl border-black !w-auto`,disabled:p,children:e.jsxs("div",{className:"flex align-middle",children:[p?e.jsx(W,{visible:p,height:"20",width:"20",color:"grey",ariaLabel:"tail-spin-loading",radius:"1",wrapperStyle:{},wrapperClass:""}):e.jsx(v,{className:"h-5 w-5"}),e.jsx("span",{className:"ml-2",children:m?"Salvar":"Editar ordem"})]})})]}),e.jsx("div",{className:"mt-8",children:e.jsx("div",{className:"flex flex-col",children:e.jsx("div",{className:"overflow-x-auto sm:-mx-6 lg:-mx-8",children:e.jsx("div",{className:"inline-block min-w-full py-2 sm:px-6 lg:px-8",children:e.jsx("div",{className:"overflow-hidden",children:e.jsxs("table",{className:"min-w-full text-left text-[13px] font-light text-surface dark:text-white",children:[e.jsx("thead",{className:"border-b border-neutral-200 font-medium dark:border-white/10",children:e.jsxs("tr",{children:[e.jsx("th",{scope:"col",className:"px-6 py-4",children:"Menu"}),e.jsx("th",{scope:"col",className:"px-6 py-4",children:"Redireciona para"}),e.jsx("th",{scope:"col",className:"px-6 py-4",children:"Ativo?"}),e.jsx("th",{scope:"col",className:"px-6 py-4",children:"Editar"}),e.jsx("th",{scope:"col",className:"px-6 py-4",children:"Excluir"})]})}),e.jsx("tbody",{children:d.menus.map((s,a)=>e.jsxs("tr",{className:"border-b border-neutral-200 transition duration-300 ease-in-out hover:bg-neutral-100 dar
3k:border-white/10 dark:hover:bg-neutral-600",draggable:m,onDragStart:t=>$(t,s),onDragOver:t=>t.preventDefault(),onDragEnd:()=>O(),onDrop:t=>F(t,s),children:[e.jsxs("td",{className:"whitespace-nowrap px-6 py-4 font-medium flex",children:[m&&e.jsx(v,{className:"h-5 w-5 mr-2 "}),s.name_pt]}),e.jsx("td",{className:"whitespace-nowrap px-6 py-4",children:s.page?s.page.slug:e.jsx("a",{href:"#",onClick:()=>{_(s)},children:"Ver submenu"})}),e.jsx("td",{className:"whitespace-nowrap px-6 py-4 font-medium flex",children:s.active?"Sim":"Não"}),e.jsx("td",{className:"whitespace-nowrap px-6 py-4",children:e.jsx("a",{href:route("menu.edit",s.id),children:e.jsx(S,{className:"w-6 h-6 "})})}),e.jsx("td",{className:"whitespace-nowrap px-6 py-4",children:e.jsx(J,{className:"w-6 h-6 text-red-600 cursor-pointer",onClick:()=>{D(s),o(!0)}})})]},a))})]})})})})})}),c&&e.jsx("div",{className:"fixed inset-0 flex items-center justify-center bg-gray-800 bg-opacity-50",children:e.jsxs("div",{className:"bg-white p-4 rounded shadow-md",children:[e.jsxs("p",{children:['Tem certeza que deseja excluir o menu "',g.name_pt,'"?']}),e.jsxs("div",{className:"mt-4 flex justify-end",children:[e.jsx(j,{onClick:()=>o(!1),className:"mr-2 px-4 py-2 bg-gray-300 hover:bg-gray-400 rounded",children:"Cancelar"}),e.jsx(j,{onClick:T,className:"px-4 py-2 bg-red-500 hover:bg-red-600 text-white rounded",children:"Excluir"})]})]})}),e.jsx(z,{show:k,onClose:B,width:"w-3/4",children:e.jsxs("div",{className:"p-4",children:[e.jsxs("div",{className:"inline-flex w-full justify-between",children:[e.jsx("h1",{className:"font-semibold text-2xl",children:"Submenus"}),u.length>0&&e.jsx("a",{href:route("menu.edit",u[0].menu_item_id),children:e.jsx(S,{className:"w-6 h-6 "})})]}),e.jsxs("table",{className:"min-w-full text-left text-[13px] font-light text-surface dark:text-white",children:[e.jsx("thead",{className:"border-b border-neutral-200 font-medium dark:border-white/10",children:e.jsxs("tr",{children:[e.jsx("th",{scope:"col",className:"px-6 py-4 w-1/5",children:"Grupo de menu"}),e.jsx("th",{scope:"col",className:"px-6 py-4 w-1/5",children:"Grupo ativo?"}),e.jsx("th",{scope:"col",className:"px-6 py-4 w-1/5",children:"Submenu"}),e.jsx("th",{scope:"col",className:"px-6 py-4 w-1/5",children:"Destino"}),e.jsx("th",{scope:"col",className:"px-6 py-4 w-1/5",children:"Submenu ativo?"})]})}),e.jsx("tbody",{children:u.map((s,a)=>e.jsxs("tr",{className:"transition duration-300 ease-in-out hover:bg-neutral-100 dark:hover:bg-neutral-600",children:[e.jsx("td",{className:"whitespace-nowrap px-6 py-4",children:s.name_pt}),e.jsx("td",{className:"whitespace-nowrap px-6 py-4",children:s.active?"Sim":"Não"}),e.jsx("td",{colSpan:3,children:e.jsx("table",{className:"min-w-full text-left text-[13px] font-light text-surface dark:text-white",children:e.jsx("tbody",{children:s.submenu.map((t,h)=>e.jsxs("tr",{children:[e.jsx("td",{className:"px-6 py-4 w-1/5",children:t.name_pt}),e.jsx("td",{className:"px-6 py-4 w-1/5",children:t.page.slug}),e.jsx("td",{className:"px-6 py-4 w-1/5",children:t.active?"Sim":"Não"})]},h))})})})]},`${a}-submenu`))})]})]})})]})]})};export{oe as default};

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.