1import{d as I,f as O,bP as T,bQ as Y,aN as A,C as F,S as R,r as m,D as U,j as Q,k as r,a as _,t as M,Q as z,s as n,n as x,E as v,z as B,o as s,l as e,I as g,K as k,w as K,p as L,v as W,m as J}from"./app-GC03Gq4U.js";import{_ as X}from"./Layout.vue_vue_type_script_setup_true_lang-OjQXUhnG.js";import{g as y}from"./get.service--rhiCGi_.js";import{h as Z}from"./moment-WSJ9un1t.js";import{_ as ee}from"./ButtonCreate.vue_vue_type_script_setup_true_lang-eO8c5Y5f.js";import{s as p}from"./show-error-zM9JovDt.js";import{s as te}from"./show-success--uwFjSj5.js";import"./index-7hMjYadJ.js";import"./index-423UCd14.js";import"./index-L_JWdKAj.js";import"./logo-VLooSubU.js";const se={class:"flex flex-col min-h-screen min-w-creen items-center justify-center animate__animated animate__slideInUp animate__faster duration-500"},ae={class:"flex flex-col items-center bg-secondary h-[500px] rounded-lg w-11/12 md:w-6/12 p-6 pb-5"},le=e("div",{class:"flex flex-row justify-between items-center"},[e("span",{class:"text-black font-semibold text-lg"},"Gerar Diário Oficial Extra")],-1),oe={class:"flex flex-col flex-grow w-full mt-4"},ie=e("span",{class:"font-medium text-xs text-black/80"},"Selecione as publicações que deseja para o Diário Oficial Extra:",-1),re={class:"flex-grow py-2 h-[350px] overflow-y-auto"},ne=["onClick"],de={class:"text-xs font-semibold text-black"},ce={class:"w-full flex flex-row justify-end items-center pt-3"},ue=e("span",{class:"text-xs text-black/50 duration-500 font-semibold"},"Cancelar",-1),me=[ue],fe={key:0,class:"animate-spin"},xe={key:1,class:"text-xs text-indigo-100 duration-500 font-semibold"},pe={class:"flex-grow flex flex-row flex-wrap"},be={class:"animate__animated animate__slideInUp animate__faster w-full bg-white rounded-md shadow-sm p-5 flex flex-col"},_e={class:"flex flex-col md:flex-row justify-between items-center"},ve={class:"group bg-dashbg border border-black/20 hover:border-primary duration-500 rounded-full flex flex-row items-center w-full md:w-[250px] md:hover:w-[280px] pl-5 pr-4 py-2 mb-2"},he={type:"submit"},we={key:1,class:"animate-spin"},ge=e("div",{class:"mt-3 border-b border-white/5 pb-2 hidden md:flex flex-row w-full"},[e("div",{class:"w-8/12"},[e("span",{class:"font-regular text-black/70 text-xs"},"Edição")]),e("div",{class:"w-3/12"},[e("span",{class:"font-regular text-black/70 text-xs"},"Gerado em")]),e("div",{class:"w-1/12"},[e("span",{class:"font-regular text-black/70 text-xs"},"Ações")])],-1),ke={class:"py-3 border-b border-black/5 flex flex-col md:flex-row w-full"},ye=e("div",{class:"w-full flex flex-row pb-2 md:pb-0 justify-between md:justify-start md:w-8/12"},[e("div",{class:"md:hidden"},[e("span",{class:"text-xs font-regular text-black/70"},"Edição")]),e("div",{class:"flex flex-row items-center w-11/12 animate-pulse bg-black/5"},[e("span",{class:"font-semibold text-black text-xs animate-pulse bg-black/5"}," ")])],-1),je=e("div",{class:"w-full flex flex-row pb-2 md:pb-0 justify-between md:justify-start md:w-3/12"},[e("div",{class:"md:hidden"},[e("span",{class:"text-xs font-regular text-black/70"},"Gerado em")]),e("div",{class:"flex flex-row items-center w-11/12 animate-pulse bg-black/5"},[e("span",{class:"font-semibold text-black text-xs animate-pulse bg-black/5"}," ")])],-1),Ee=e("div",{class:"w-full flex flex-row pb-2 md:pb-0 justify-between md:justify-start md:w-1/12"},[e("div",{class:"md:hidden"},[e("span",{class:"text-xs font-regular text-black/70"},"Ações")]),e("div",{class:"flex flex-row items-center w-10/12 animate-pulse bg-black/5"},[e("span",{class:"font-semibold text-black text-xs animate-pulse bg-black/5"}," ")])],-1),Se=[ye,je,Ee],De={class:"w-full flex flex-row pb-2 md:pb-0 justify-between md:justify-start md:w-8/12"},Ce=e("div",{class:"md:hidden"},[e("span",{class:"text-xs font-regular text-black/70"},"Edição")],-1),Me={class:"flex flex-row items-center"},Be={class:"font-semibold text-black text-xs truncate w-full"},Ge={class:"w-full flex flex-row pb-2 md:pb-0 justify-between md:justify-start md:w-3/12"},Ve=e("div",{class:"md:hidden"},[e("span",{class:"text-xs font-regular text-black/70"},"Gerado em")],-1),qe={class:"flex flex-row items-center"},Ne={class:"font-semibold text-black text-xs truncate w-full"},Pe={class:"w-full flex flex-row pb-2 md:pb-0 justify-between md:justify-start md:w-1/12"},$e=e("div",{class:"md:hidden"},[e("span",{class:"text-xs font-regular text-black/70"},"Ações")],-1),He={class:"flex flex-row items-center justify-end md:justify-start w-full"},Ie=["href"],Oe={key:2,class:"flex flex-row justify-center items-center w-full pt-4"},Te={key:0,class:"text-xs text-black/50 group-hover:text-dashbg font-semibold duration-500"},Ye={key:1,class:"animate-spin"},et=I({__name:"Editions",setup(Ae){O(R,F,A,Y,T);const l=m(""),h=m(""),o=m(),b=m(""),j=m([]),c=m([]),f=m(null),G=(t,a)=>{f.value===null?(f.value=a,c.value.push(t)):f.value===a?c.value.push(t):p(null,"Você não pode gerar Diário de entidades diferentes. Selecione da mesma")},V=(t,a)=>{if(f.value===null||f.value!==a){p("Não é possÃvel remover esse item");return}const d=c.value.indexOf(t);d!==-1?c.value.splice(d,1):p("Publicação não encontrada"),c.value.length===0&&(f.value=null)},q=async()=>{l.value="extra";try{(await B.post("edition-extra",{publication_ids:c.value})).status===200&&(l.value="",te("Diário Extra sendo gerado","Em instantes ele estará disponÃvel"),b.value="",await E())}catch(t){l.value="",p(t)}},N=async()=>{try{const t=await B.get("publications/day");t.status===200&&(j.value=t.data.data.items)}catch(t){p(t)}},P=async()=>{l.value="search";const t=await y("editions",{params:{page:1,search:h.value}});t&&(o.value=t),l.value=""},E=async()=>{const t=await y("editions",{params:{page:1}});t!=null&&t.items&&(console.log(t),o.value=t)},$=async()=>{var a;l.value="items";const t=await y("editions",{params:{page:(((a=o.value)==null?void 0:a.items.current_page)??1)+1}});t!=null&&t.items&&o.value&&(o.value.items.current_page=t.items.current_page,o.value.items.data.push(...t.items.data),setTimeout(H,100)),l.value=""},H=()=>{window.scrollTo({top:document.body.scrollHeight,behavior:"smooth"})};return U(()=>{E(),N()}),(t,a)=>{const d=Q("v-icon");return s(),r(v,null,[b.value==="extra"?(s(),_(z,{key:0},{default:M(()=>[e("div",se,[e("div",ae,[le,e("div",oe,[ie,e("div",re,[(s(!0),r(v,null,g(j.value,i=>(s(),r("div",{class:"w-full flex flex-row mb-2 cursor-pointer",onClick:w=>
1c.value.includes(i.id)?V(i.id,i.user_id):G(i.id,i.user_id)},[c.value.includes(i.id)?(s(),_(d,{key:0,name:"fa-regular-check-square",scale:"0.8",class:"mr-2"})):n("",!0),c.value.includes(i.id)?n("",!0):(s(),_(d,{key:1,name:"fa-regular-square",scale:"0.8",class:"mr-2"})),e("span",de,k(i.title),1)],8,ne))),256))]),e("div",ce,[e("button",{type:"button",onClick:a[0]||(a[0]=i=>b.value=""),class:"h-8 px-3 rounded-md bg-gray-300 border border-black/20 duration-500"},me),e("button",{onClick:q,class:"ml-3 h-8 w-24 rounded-md bg-primary border border-black/10 duration-500"},[l.value==="extra"?(s(),r("div",fe,[x(d,{name:"si-spinrilla",scale:"0.7",class:"text-white text-xs duration-500"})])):n("",!0),l.value!=="extra"?(s(),r("span",xe,"Gerar")):n("",!0)])])])])])]),_:1})):n("",!0),x(X,{title:"Edições"},{default:M(()=>{var i,w,S,D,C;return[e("div",pe,[e("div",be,[e("div",_e,[e("form",{onSubmit:K(P,["prevent"])},[e("div",ve,[L(e("input",{"onUpdate:modelValue":a[1]||(a[1]=u=>h.value=u),class:"text-xs flex-grow text-black outline-0 bg-transparent",placeholder:"Buscar edições"},null,512),[[W,h.value]]),e("button",he,[l.value!=="search"?(s(),_(d,{key:0,name:"md-search",scale:"1",class:"cursor-pointer text-black/30 hover:text-primary duration-500"})):n("",!0),l.value==="search"?(s(),r("div",we,[x(d,{name:"si-spinrilla",scale:"1",class:"cursor-pointer text-black/30 hover:text-primary duration-500"})])):n("",!0)])])],32),x(ee,{title:"Gerar Diário Oficial Extra",onClick:a[2]||(a[2]=u=>b.value="extra")})]),ge,o.value?n("",!0):(s(),r(v,{key:0},g([0,1,2,3,4,5,6],u=>e("div",ke,Se)),64)),o.value&&((w=(i=o.value.items)==null?void 0:i.data)==null?void 0:w.length)>0?(s(!0),r(v,{key:1},g(o.value.items.data,u=>(s(),r("div",{key:u.id,class:"py-3 border-b border-black/5 flex flex-col md:flex-row w-full"},[e("div",De,[Ce,e("div",Me,[e("span",Be,k(u.name),1)])]),e("div",Ge,[Ve,e("div",qe,[e("span",Ne,k(J(Z)(u.created_at).format("HH:mm DD/MM/YYYY")),1)])]),e("div",Pe,[$e,e("div",He,[e("a",{href:"/uploads/editions/"+u.user_id+"/"+u.file,target:"_blank"},[x(d,{name:"hi-eye",scale:"0.7",class:"ml-3 text-black/70 cursor-pointer hover:text-red-400 duration-500"})],8,Ie)])])]))),128)):n("",!0),(S=o.value)!=null&&S.items.last_page&&((D=o.value)==null?void 0:D.items.last_page)!==((C=o.value)==null?void 0:C.items.current_page)?(s(),r("div",Oe,[e("button",{onClick:$,class:"group h-7 w-48 rounded-md border border-white/50 bg-transparent hover:bg-white duration-500"},[l.value!=="items"?(s(),r("span",Te,"Ver mais")):n("",!0),l.value==="items"?(s(),r("div",Ye,[x(d,{name:"si-spinrilla",class:"text-xs text-black/50 group-hover:text-dashbg font-semibold duration-500 h-5"})])):n("",!0)])])):n("",!0)])])]}),_:1})],64)}}});export{et 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.