PageSourceSearch

https://www.ahrcm-srmo.org/build/assets/CreateModal.30ad7863.js

js ahrcm-srmo.org collected 2026-10-06 18:25:37 UTC 5,696 bytes, 1 lines download raw bytes

1import{d as m,c as I,w as U,o as d,a as t,t as u,l as B,C as L,h as s,e as c,f as p,n as z,i as P,F as V,K as A,M as y,k as E}from"./app.1c75f29f.js";import{_ as G}from"./Modal.f4449063.js";import"./download.b52da6e8.js";const q={class:"py-10 px-14"},N={class:"flex items-center justify-between border-b border-gray-30 pb-2"},O={class:"text-20-medium"},T={class:"flex flex-col gap-4 mt-4"},K=["placeholder"],R={key:0,class:"text-14-regular text-error-40 mt-1 mb-4"},Z=["placeholder"],H={key:1,class:"text-14-regular text-error-40 mt-1"},J={class:"flex flex-wrap -m-1 md:-m-2 p-2"},Q=["src"],W=["onClick"],X=t("svg",{class:"fill-gray-40",width:"32",height:"32",viewBox:"0 0 32 32",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[t("g",{opacity:"0.7",filter:"url(#filter0_b_2569_7432)"},[t("circle",{cx:"16",cy:"16",r:"16",fill:"white"})]),t("path",{d:"M21.09 11.9349L20.0646 10.9094L15.9991 14.9749L11.9337 10.9094L10.9082 11.9349L14.9737 16.0003L10.9082 20.0658L11.9337 21.0912L15.9991 17.0258L20.0646 21.0912L21.09 20.0658L17.0246 16.0003L21.09 11.9349Z",fill:"#0F1A2A"}),t("defs",null,[t("filter",{id:"filter0_b_2569_7432",x:"-36",y:"-36",width:"104",height:"104",filterUnits:"userSpaceOnUse","color-interpolation-filters":"sRGB"},[t("feFlood",{"flood-opacity":"0",result:"BackgroundImageFix"}),t("feGaussianBlur",{in:"BackgroundImageFix",stdDeviation:"18"}),t("feComposite",{in2:"SourceAlpha",operator:"in",result:"effect1_backgroundBlur_2569_7432"}),t("feBlend",{mode:"normal",in:"SourceGraphic",in2:"effect1_backgroundBlur_2569_7432",result:"shape"})])])],-1),Y=[X],ee={key:0,class:"pointer-events-none rounded-md absolute h-full w-full bg-[#0000008c] z-10 top-0 left-0 flex items-center justify-center text-white text-3xl"},te={key:2,class:"grid gap-4"},se={key:0,class:"text-14-regular text-error-40 mt-2"},le={key:1,class:"rounded-md border border-gray-40 relative"},oe=t("span",{class:"icon-image-1 text-indigo-60 text-2xl"},null,-1),ae={key:3,class:"text-14-regular text-error-40 mt-1"},ue={__name:"CreateModal",props:{show:{type:Boolean,required:!0}},emits:["close","submit"],setup(F,{emit:g}){const o=m({title:null,body:null,files:[],errors:{file:null}}),_=m(null),r=m([]),f=m(0),$=()=>{_.value.click()},j=a=>{let e=new FormData;e.append("file",a.target.files[0]),e.append("attachable_type","posts"),y.post("/attachments",e,{headers:{"Content-Type":"multipart/form-data"},onUploadProgress:l=>{f.value=Math.round(l.loaded/l.total*100)}}).then(l=>{r.value.push(l.data),form.attachments.push(l.data.id),f.value=0}).catch(l=>{var n;((n=l==null?void 0:l.response)==null?void 0:n.status)==422&&(o.value.errors.file=l.response.data.errors.file[0])})},M=(a,e)=>{let l=_.value;y.delete(`/attachments/${a}`).then(n=>{r.value.splice(e,1),l.value=null}).catch(n=>{})},S=()=>{o.value.title=null,o.value.body=null,o.value.files=[],o.value.errors={file:null},r.value=[]},D=()=>{const a={title:o.value.title,body:o.value.body,attachments:r.value.map(e=>e.id)};y.post("chat-room",a).then(e=>{g("submit",e.data),S()}).catch(e=>{var l,n,h;((l=e==null?void 0:e.response)==null?void 0:l.status)==422?o.value.errors=(h=(n=e.response)==null?void 0:n.data)==null?void 0:h.errors:E().props.value.jetstream.flash={type:"error",message:"Oops! Something went wrong!"}})};return(a,e)=>(d(),I(G,{show:F.show,onClose:e[5]||(e[5]=l=>g("close")),"max-width":"3xl"},{default:U(()=>{var l,n,h,b,x,w,k,C;return[t("div",q,[t("div",N,[t("span",O,u(a.__("posts.create.create_post")),1),t("span",{class:"icon icon-close-square text-lg cursor-pointer",onClick:e[0]||(e[0]=i=>g("close"))})]),t("div",T,[B(t("input",{class:"rounded-xl w-full p-4 bg-gray-20",placeholder:a.__("posts.create.title_placeholder"),"onUpdate:modelValue":e[1]||(e[1]=i=>s(o).title=i)},null,8,K),[[L,s(o).title]]),(n=(l=s(o))==null?void 0:l.errors)!=null&&n.title?(d(),c("p",R,u((b=(h=s(o))==null?void 0:h.errors)==null?void 0:b.title[0]),1)):p("",!0),B(t("textarea",{class:"rounded-xl w-full p-4 bg-gray-20 border-none",rows:"2",placeholder:a.__("posts.create.description_placeholder"),"onUpdate:modelValue":e[2]||(e[2]=i=>s(o).body=i)},null,8,Z),[[L,s(o).body]]),(w=(x=s(o))==null?void 0:x.errors)!=null&&w.body?(d(),c("p",H,u((C=(k=s(o))==null?void 0:k.errors)==null?void 0:C.body[0]),1)):p("",!0),t("div",J,[t("div",{class:z(["grid gap-2 justify-items-center w-full overflow-y-auto",s(r).length<4?"grid-cols-"+s(r).length:"grid-cols-3"])},[(d(!0),c(V,null,P(s(r).slice(0,6),(i,v)=>(d(),c("div",{class:"relative group",key:v},[t("img",{alt:"gallery",class:"block object-cover object-center rounded-md w-full h-52 mt
1-2",src:i.path},null,8,Q),t("div",{class:"absolute z-10 top-4 right-4 opacity-0 group-hover:opacity-100 transition-all duration-150 cursor-pointer",onClick:re=>M(i.id,v)},Y,8,W),s(r).length>6&&v==5?(d(),c("div",ee,u(`+${s(r).length-6}`),1)):p("",!0)]))),128))],2)]),s(r)?(d(),c("div",te,[a.$page.props.errors.attachments?(d(),c("p",se,u(a.$page.props.errors.attachments),1)):p("",!0),s(f)>0&&s(f)<100?(d(),c("div",le,[t("div",{class:"bg-indigo-20 px-6 py-4 rounded-md w-0 transition-all duration-200 animate-pulse",style:A(`width: ${s(f)}%`)},u(s(f))+"% ",5)])):p("",!0)])):p("",!0),t("div",{class:"flex flex-grow bg-gray-20 p-4 rounded-xl content-center items-center justify-center cursor-pointer",onClick:$},[t("input",{type:"file",ref_key:"file",ref:_,hidden:"",accept:"image/*",onChange:e[3]||(e[3]=i=>j(i)),multiple:""},null,544),oe,t("span",null,u(a.__("posts.photo")),1)]),s(o).errors.file?(d(),c("p",ae,u(s(o).errors.file),1)):p("",!0),t("button",{class:"bg-indigo-60 self-center w-full p-4 rounded-xl text-white",onClick:e[4]||(e[4]=i=>D())},u(a.__("posts.create.post")),1)])])]}),_:1},8,["show"]))}};export{ue 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.