1var e=Object.defineProperty,s=Object.defineProperties,a=Object.getOwnPropertyDescriptors,l=Object.getOwnPropertySymbols,i=Object.prototype.hasOwnProperty,r=Object.prototype.propertyIsEnumerable,t=(s,a,l)=>a in s?e(s,a,{enumerable:!0,configurable:!0,writable:!0,value:l}):s[a]=l,o=(e,s)=>{for(var a in s||(s={}))i.call(s,a)&&t(e,a,s[a]);if(l)for(var a of l(s))r.call(s,a)&&t(e,a,s[a]);return e},d=(e,l)=>s(e,a(l)),n=(e,s)=>{var a={};for(var t in e)i.call(e,t)&&s.indexOf(t)<0&&(a[t]=e[t]);if(null!=e&&l)for(var t of l(e))s.indexOf(t)<0&&r.call(e,t)&&(a[t]=e[t]);return a};import{j as c,_ as m,$ as f,a0 as u,a1 as x,S as h,v as p,o as v,a2 as b,a3 as j,p as N,a as y,t as g,a4 as w,M as F,B as I}from"./index-7x3bK5Ju.js";import{r as k}from"./vendor-DXcmyjWw.js";import{u as P,a as C,b as O,c as S,d as R}from"./eventImagesQueries-DaLa8bXU.js";import{u as $}from"./router-Cp_nOgfT.js";import{B as _}from"./Button-DQXqdJ6b.js";import{S as V}from"./index-CMV6Fbd0.js";const z={type:f.string,tooltip:f.bool,as:f.elementType},L=k.forwardRef((e,s)=>{var a=e,{as:l="div",className:i,type:r="valid",tooltip:t=!1}=a,f=n(a,["as","className","type","tooltip"]);return c.jsx(l,d(o({},f),{ref:s,className:m(i,`${r}-${t?"tooltip":"feedback"}`)}))});L.displayName="Feedback",L.propTypes=z;const T=k.createContext({}),D=k.forwardRef((e,s)=>{var a=e,{id:l,bsPrefix:i,className:r,type:t="checkbox",isValid:f=!1,isInvalid:x=!1,as:h="input"}=a,p=n(a,["id","bsPrefix","className","type","isValid","isInvalid","as"]);const{controlId:v}=k.useContext(T);return i=u(i,"form-check-input"),c.jsx(h,d(o({},p),{ref:s,type:t,id:l||v,className:m(r,i,f&&"is-valid",x&&"is-invalid")}))});D.displayName="FormCheckInput";const B=k.forwardRef((e,s)=>{var a=e,{bsPrefix:l,className:i,htmlFor:r}=a,t=n(a,["bsPrefix","className","htmlFor"]);const{controlId:f}=k.useContext(T);return l=u(l,"form-check-label"),c.jsx("label",d(o({},t),{ref:s,htmlFor:r||f,className:m(i,l)}))});B.displayName="FormCheckLabel";const q=k.forwardRef((e,s)=>{var a=e,{id:l,bsPrefix:i,bsSwitchPrefix:r,inline:t=!1,reverse:f=!1,disabled:x=!1,isValid:h=!1,isInvalid:p=!1,feedbackTooltip:v=!1,feedback:b,feedbackType:j,className:N,style:y,title:g="",type:w="checkbox",label:F,children:I,as:P="input"}=a,C=n(a,["id","bsPrefix","bsSwitchPrefix","inline","reverse","disabled","isValid","isInvalid","feedbackTooltip","feedback","feedbackType","className","style","title","type","label","children","as"]);i=u(i,"form-check"),r=u(r,"form-switch");const{controlId:O}=k.useContext(T),S=k.useMemo(()=>({controlId:l||O}),[O,l]),R=!I&&null!=F&&!1!==F||function(e,s){return k.Children.toArray(e).some(e=>k.isValidElement(e)&&e.type===s)}(I,B),$=c.jsx(D,d(o({},C),{type:"switch"===w?"checkbox":w,ref:s,isValid:h,isInvalid:p,disabled:x,as:P}));return c.jsx(T.Provider,{value:S,children:c.jsx("div",{style:y,className:m(N,R&&i,t&&`${i}-inline`,f&&`${i}-reverse`,"switch"===w&&r),children:I||c.jsxs(c.Fragment,{children:[$,R&&c.jsx(B,{title:g,children:F}),b&&c.jsx(L,{type:j,tooltip:v,children:b})]})})})});q.displayName="FormCheck";const E=Object.assign(q,{Input:D,Label:B}),H=k.forwardRef((e,s)=>{var a=e,{bsPrefix:l,type:i,size:r,htmlSize:t,id:f,className:x,isValid:h=!1,isInvalid:p=!1,plaintext:v,readOnly:b,as:j="input"}=a,N=n(a,["bsPrefix","type","size","htmlSize","id","className","isValid","isInvalid","plaintext","readOnly","as"]);const{controlId:y}=k.useContext(T);return l=u(l,"form-control"),c.jsx(j,d(o({},N),{type:i,size:t,ref:s,readOnly:b,id:f||y,className:m(x,v?`${l}-plaintext`:l,r&&`${l}-${r}`,"color"===i&&`${l}-color`,h&&"is-valid",p&&"is-invalid")}))});H.displayName="FormControl";const M=Object.assign(H,{Feedback:L}),A=k.forwardRef((e,s)=>{var a=e,{className:l,bsPrefix:i,as:r="div"}=a,t=n(a,["className","bsPrefix","as"]);return i=u(i,"form-floating"),c.jsx(r,o({ref:s,className:m(l,i)},t))});A.displayName="FormFloating";const G=k.forwardRef((e,s)=>{var a=e,{controlId:l,as:i="div"}=a,r=n(a,["controlId","as"]);const t=k.useMemo(()=>({controlId:l}),[l]);return c.jsx(T.Provider,{value:t,children:c.jsx(i,d(o({},r),{ref:s}))})});G.displayName="FormGroup";const Q=k.forwardRef((e,s)=>
1{var a=e,{as:l="label",bsPrefix:i,column:r=!1,visuallyHidden:t=!1,className:d,htmlFor:f}=a,h=n(a,["as","bsPrefix","column","visuallyHidden","className","htmlFor"]);const{controlId:p}=k.useContext(T);i=u(i,"form-label");let v="col-form-label";"string"==typeof r&&(v=`${v} ${v}-${r}`);const b=m(d,i,t&&"visually-hidden",r&&v);return f=f||p,r?c.jsx(x,o({ref:s,as:"label",className:b,htmlFor:f},h)):c.jsx(l,o({ref:s,className:b,htmlFor:f},h))});Q.displayName="FormLabel";const U=k.forwardRef((e,s)=>{var a=e,{bsPrefix:l,className:i,id:r}=a,t=n(a,["bsPrefix","className","id"]);const{controlId:f}=k.useContext(T);return l=u(l,"form-range"),c.jsx("input",d(o({},t),{type:"range",ref:s,className:m(i,l),id:r||f}))});U.displayName="FormRange";const Y=k.forwardRef((e,s)=>{var a=e,{bsPrefix:l,size:i,htmlSize:r,className:t,isValid:f=!1,isInvalid:x=!1,id:h}=a,p=n(a,["bsPrefix","size","htmlSize","className","isValid","isInvalid","id"]);const{controlId:v}=k.useContext(T);return l=u(l,"form-select"),c.jsx("select",d(o({},p),{size:r,ref:s,className:m(t,l,i&&`${l}-${i}`,f&&"is-valid",x&&"is-invalid"),id:h||v}))});Y.displayName="FormSelect";const J=k.forwardRef((e,s)=>{var a=e,{bsPrefix:l,className:i,as:r="small",muted:t}=a,f=n(a,["bsPrefix","className","as","muted"]);return l=u(l,"form-text"),c.jsx(r,d(o({},f),{ref:s,className:m(i,l,t&&"text-muted")}))});J.displayName="FormText";const K=k.forwardRef((e,s)=>c.jsx(E,d(o({},e),{ref:s,type:"switch"})));K.displayName="Switch";const W=Object.assign(K,{Input:E.Input,Label:E.Label}),X=k.forwardRef((e,s)=>{var a=e,{bsPrefix:l,className:i,children:r,controlId:t,label:f}=a,x=n(a,["bsPrefix","className","children","controlId","label"]);return l=u(l,"form-floating"),c.jsxs(G,d(o({ref:s,className:m(i,l),controlId:t},x),{children:[r,c.jsx("label",{htmlFor:t,children:f})]}))});X.displayName="FloatingLabel";const Z={_ref:f.any,validated:f.bool,as:f.elementType},ee=k.forwardRef((e,s)=>{var a=e,{className:l,validated:i,as:r="form"}=a,t=n(a,["className","validated","as"]);return c.jsx(r,d(o({},t),{ref:s,className:m(l,i&&"was-validated")}))});ee.displayName="Form",ee.propTypes=Z;const se=Object.assign(ee,{Group:G,Control:M,Floating:A,Check:E,Switch:W,Label:Q,Text:J,Range:U,Select:Y,FloatingLabel:X}),ae=({name:e,files:s,id:a,status:l,modalOpen:i,image:r,setFolderId:t,setImage:o})=>{const d=$(),[n,m]=k.useState(!1),[f,u]=k.useState(!1),{mutate:x,isPending:v}=P(()=>{d(0)}),{mutate:b}=C(()=>{p("Status updated successfully","success"),d(0)});return c.jsxs("div",{className:"col-md-6 col-6",children:[c.jsxs("div",{className:"folder-box",children:[c.jsxs("div",{className:"dropdown",onClick:()=>{m(!n)},children:[c.jsx("i",{className:"fa fa-ellipsis-v"}),c.jsxs("div",{className:"dropdown-menu "+(n?"show":""),children:[c.jsx("button",{type:"button",className:"dropdown-item",onClick:()=>(i(),void o(r)),children:"View"}),c.jsx("button",{type:"button",className:"dropdown-item",onClick:()=>u(!0),children:"Delete"}),c.jsx("button",{type:"button",className:"dropdown-item",onClick:()=>{t()},children:"Rename"})]})]}),c.jsxs("div",{className:"folder-wrap",onClick:()=>d(`/event-images/${a}`),children:[c.jsx("i",{className:"fa-solid f-44 fa-folder txt-dark"}),c.jsxs("div",{className:"folder-text",children:[c.jsx("h6",{children:e}),c.jsx("p",{children:c.jsxs("span",{children:[s," files"]})}),c.jsx("br",{})]})]}),c.jsx("div",{style:{position:"absolute",right:"0",bottom:"10px"},children:c.jsx(se.Check,{type:"switch",checked:"1"===l,id:"custom-switch",onChange:()=>{b(a)}})})]}),f&&c.jsx(h,{setIsOpen:u,show:f,isPending:v,title:"Folder",handleDelete:()=>x(a)})]})},le=v({folder_name:N().min(1,{message:"Folder name is required"}),image:j(e=>e instanceof File,{message:"Image must be a valid file"})}),ie=v({folder_name:N().min(1,{message:"Folder name is required"}),image:j(e=>e instanceof File,{message:"Image must be a valid file"}),folderID:b().min(1,{message:"Folder Id is required"})}),re=({show:e,hide:s,view:a,image:l,folder:i})=>{var r,t;const d=$(),n=0!==Object.keys(i).length?ie:le,{register:m,setValue:f,formState:{errors:u},handleSubmit:x}
1=y({resolver:g(n)}),h=e=>{p(e,"success"),d(0)};0!==Object.keys(i).length&&f("folderID",i.id);const{mutate:v}=O(()=>{h("New folder created successfully")}),{mutate:b}=S(()=>{h("Folder updated successfully")}),j=w(l);return c.jsxs(F,{show:e,size:"sm",centered:!0,children:[c.jsxs(F.Header,{style:{display:"flex",justifyContent:"space-between"},children:[c.jsx("h5",{children:a?"Tapitag":0!==Object.keys(i).length?"Update Folder":"Create Folder"}),c.jsx("i",{className:"fa fa-close",onClick:()=>s()})]}),c.jsxs("form",{onSubmit:x(e=>{0!==Object.keys(i).length?b(e):v(e)}),children:[c.jsx(F.Body,{children:a?"image"===j?c.jsx("img",{src:`https://d1jl5s6mrwtj6x.cloudfront.net/${l}`,"max-width":300,"max-height":250,alt:"Event",loading:"lazy"}):"video"===j?c.jsx("video",{src:`https://d1jl5s6mrwtj6x.cloudfront.net/${l}`,width:270,height:270,controls:!0,children:"Your browser does not support the video tag."}):c.jsx("p",{children:"No media found"}):c.jsxs("div",{children:[c.jsx("input",o({className:"form-control "+((null==u?void 0:u.folder_name)?"is-invalid":""),placeholder:"Folder Name",defaultValue:i.name},m("folder_name"))),u.folder_name&&c.jsx("div",{className:"invalid-feedback",children:null==(r=null==u?void 0:u.folder_name)?void 0:r.message}),c.jsxs("div",{className:"file-input mt-2",children:[c.jsx("input",{className:"form-control "+((null==u?void 0:u.image)?"is-invalid":""),type:"file",id:"file-input__input",onChange:e=>{var s;const a=null==(s=e.target.files)?void 0:s[0];a&&f("image",a)}}),u.image&&c.jsx("div",{className:"invalid-feedback",children:null==(t=null==u?void 0:u.image)?void 0:t.message})]})]})}),c.jsxs(F.Footer,{children:[c.jsx(_,{className:"btn-secondary",onClick:()=>s(),children:"Close"}),!a&&c.jsx(_,{type:"submit",children:"Submit"})]})]})]})},te=()=>{const e=Array(4).fill(0);return c.jsxs("div",{children:[c.jsxs("div",{className:"text-center",children:[c.jsx("h4",{children:"Folder List"}),c.jsx("br",{}),c.jsx(V,{width:180,height:50,borderRadius:"10px"})]}),c.jsx("br",{}),c.jsx("div",{className:"row",children:null==e?void 0:e.map((e,s)=>c.jsx("div",{className:"col-md-5 m-3",children:c.jsx(V,{width:189,height:169})},s))})]})},oe=()=>{const[e,s]=k.useState(!1),[a,l]=k.useState(!1),[i,r]=k.useState({}),[t,o]=k.useState(""),{data:d,isPending:n}=R();if(n)return c.jsx(te,{});return c.jsxs("div",{children:[c.jsxs("div",{className:"text-center",children:[c.jsx("h4",{children:"Folder List"}),c.jsx("br",{}),c.jsx(I,{type:"button",disabled:!1,btnLabel:"Create Folder +",onClick:()=>s(!0)})]}),c.jsx("br",{}),c.jsx("div",{className:"row",children:(null==d?void 0:d.length)>0?null==d?void 0:d.map((e,a)=>c.jsx(ae,{name:null==e?void 0:e.folder_name,files:null==e?void 0:e.file_count,setImage:o,image:null==e?void 0:e.image,status:null==e?void 0:e.direct_share,id:null==e?void 0:e.id,setFolderId:()=>(e=>{r({id:null==e?void 0:e.id,image:null==e?void 0:e.image,name:null==e?void 0:e.folder_name}),s(!0)})(e),modalOpen:()=>(s(!0),void l(!0))},a)):c.jsx("div",{className:"text-center mt-4",children:c.jsx("h3",{children:"No folder found"})})}),e&&c.jsx(re,{show:e,view:a,folder:i,hide:()=>(s(!1),l(!1),o(""),void r({})),image:t})]})},de=()=>c.jsx("div",{children:c.jsx(oe,{})});export{de 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.