PageSourceSearch

https://brandjitsu.com/assets/Resources-D1rwJqMS.js

js brandjitsu.com collected 2026-10-04 06:19:06 UTC 20,452 bytes, 1 lines download raw bytes

1import{aq as e,ap as s,ar as r,r as a,j as t,D as n,a1 as i,ad as l,ae as c,ag as o,as as d,ab as u,X as m,at as x,ak as h,a6 as j,z as f,ac as p}from"./vendor-DKpN-gn6.js";import{u as g,s as y,c as N,l as v,n as b,i as w,B as C}from"./index-CjqWG2Gu.js";import{C as S,b as F,c as R,d as _,a as E}from"./card-C0twyzQf.js";import{I as U}from"./input-BczSeZo5.js";import{b as k,c as D,T,d as A,e as P,a as q}from"./table-DbVpf6SP.js";import{B as L}from"./badge-BupusfKi.js";import{T as z,a as O,b as V,c as $}from"./tooltip-FmFdmcE2.js";import{t as I,v as K,F as M}from"./ui-DbiJ6HOd.js";import{S as B}from"./skeleton-CQZJIIqz.js";import{D as Q,a as J,c as W,d as G,e as H}from"./dialog-vWJa2GV8.js";import{u as X,t as Y,a as Z,b as ee,c as se,d as re,e as ae,g as te,F as ne}from"./form-gUyvjEUn.js";import{z as ie}from"./index-Cpv5ucUd.js";import{T as le}from"./textarea-DfQUl5Gc.js";import{S as ce,a as oe,b as de,c as ue,d as me}from"./select-CjMQhslo.js";import{S as xe}from"./switch-Du5qmcD4.js";import{A as he,a as je,b as fe,c as pe,d as ge,e as ye,f as Ne,g as ve}from"./alert-dialog-BdTOaT7i.js";import{A as be,a as we}from"./alert-CTiCasZu.js";import"./auth-D0Oxv0aP.js";import"./label-D75N5ztj.js";const Ce=a.forwardRef((({className:e,...s},r)=>t.jsx(I,{ref:r,className:N("relative flex h-10 w-10 shrink-0 overflow-hidden rounded-full",e),...s})));Ce.displayName=I.displayName;const Se=a.forwardRef((({className:e,...s},r)=>t.jsx(K,{ref:r,className:N("aspect-square h-full w-full object-cover",e),...s})));Se.displayName=K.displayName;const Fe=a.forwardRef((({className:e,...s},r)=>t.jsx(M,{ref:r,className:N("flex h-full w-full items-center justify-center rounded-full bg-muted",e),...s})));function Re({resources:e,onEdit:s,onDelete:r,onToggleFeatured:a}){return t.jsx("div",{className:"border rounded-md",children:t.jsxs(k,{children:[t.jsx(D,{children:t.jsxs(T,{children:[t.jsx(A,{className:"w-[50px]"}),t.jsx(A,{children:"Title"}),t.jsx(A,{children:"Type"}),t.jsx(A,{children:"Description"}),t.jsx(A,{children:"Downloads"}),t.jsx(A,{children:"Created"}),t.jsx(A,{className:"text-center",children:"Featured"}),t.jsx(A,{className:"text-right",children:"Actions"})]})}),t.jsxs(P,{children:[0===e.length&&t.jsx(T,{children:t.jsx(q,{colSpan:8,className:"text-center py-6 text-muted-foreground",children:"No resources found"})}),e.map((e=>{const o=v(e.file_type);return t.jsxs(T,{children:[t.jsx(q,{children:t.jsx(Ce,{className:"h-9 w-9",children:e.image_url?t.jsx(Se,{src:e.image_url,alt:e.title}):t.jsx(Fe,{children:t.jsx(o,{className:"h-4 w-4 text-brand-orange"})})})}),t.jsx(q,{className:"font-medium max-w-[200px] truncate",children:e.title}),t.jsx(q,{children:t.jsxs("div",{className:"flex items-center",children:[t.jsx(o,{className:"h-4 w-4 mr-2 text-brand-orange"}),t.jsx(L,{variant:"outline",children:e.file_type})]})}),t.jsx(q,{className:"max-w-[300px] truncate",children:e.description||"-"}),t.jsx(q,{children:t.jsxs("div",{className:"flex items-center",children:[t.jsx(n,{className:"h-4 w-4 mr-2 text-muted-foreground"}),b(e.download_count||0)]})}),t.jsx(q,{children:w(e.created_at)}),t.jsx(q,{className:"text-center",children:t.jsx("div",{className:"flex justify-center",children:t.jsx(C,{variant:"ghost",size:"icon",onClick:()=>a(e),className:e.featured?"text-yellow-500":"text-muted-foreground",children:t.jsx(i,{className:"h-5 w-5",fill:e.featured?"currentColor":"none"})})})}),t.jsx(q,{className:"text-right",children:t.jsxs("div",{className:"flex justify-end space-x-2",children:[t.jsx(z,{children:t.jsxs(O,{children:[t.jsx(V,{asChild:!0,children:t.jsxs(C,{variant:"ghost",size:"icon",onClick:()=>s(e),children:[t.jsx(l,{className:"h-4 w-4"}),t.jsx("span",{className:"sr-only",children:"Edit"})]})}),t.jsx($,{children:t.jsx("p",{children:"Edit"})})]})}),t.jsx(z,{children:t.jsxs(O,{children:[t.jsx(V,{asChild:!0,children:t.jsxs(C,{variant:"ghost",size:"icon",onClick:()=>r(e),children:[t.jsx(c,{className:"h-4 w-4"}),t.jsx("span",{className:"sr-only",children:"Delete"})]})}),t.jsx($,{children:t.jsx("p",{children:"Delete"})})]})})]})})]},e.id)}))]})]})})}function _e(){return t.jsx("div",{className:"border rounded-md",children:t.jsxs(k,{children:[t.jsx(D,{children:t.jsxs(T,{children:[t.jsx(A,{children:"Title"}),t.jsx(A,{children:"Type"}),t.jsx(A,{children:"Description"}),t.jsx(A,{children:"Downloads"}),t.jsx(A,{children:"Created"}),t.jsx(A,{children:"Featured"}),t.jsx(A,{className:"text-right",children:"Actions"})]})}),t.jsx(P,{children:Array(5).fill(0).map(((e,s)=>t.jsxs(T,{children:[t.jsx(q,{children:t.jsx(B,{className:"h-5 w-[200px]"})}),t.jsx(q,{children:t.jsx(B,{className:"h-5 w-16"})}),t.jsx(q,{children:t.jsx(B,{className:"h-5 w-[300px]"})}),t.jsx(q,{children:t.jsx(B,{className:"h-5 w-16"})}),t.jsx(q,{children:t.jsx(B,{className:"h-5 w-24"})}),t.jsx(q,{children:t.jsx(B,{className:"h-5 w-6"})}),t.jsx(q,{className:"text-right",children:t.jsxs("div",{className:"flex justify-end space-x-2",children:[t.jsx(B,{className:"h-9 w-9"}),t.jsx(B,{className:"h-9 w-9"})]})})]},s)))})]})})}Fe.displayName=M.displayName;const Ee=ie.object({title:ie.string().min(1,"Resource title is required"),description:ie.string().optional(),file_type:ie.string().min(1,"File type is required"),file_url:ie.string().min(1,"File URL is required"),featured:ie.boolean().optional(),image_url:ie.string().optional().nullable(),file:ie.instanceof(File).optional().nullable()});function Ue({form:e}){return t.jsxs("div",{className:"space-y-6",children:[t.jsx(Z,{control:e.control,name:"title",render:({field:e})=>t.jsxs(ee,{children:[t.jsx(se,{className:"text-base font-medium",children:"Resource Title"}),t.jsx(re,{children:t.jsx(U,{...e,className:"w-full"})}),t.jsx(ae,{})]})}),t.jsx(Z,{control:e.control,name:"description",render:({field:e})=>t.jsxs(ee,{children:[t.jsx(se,{className:"text-base font-medium",children:"Description"}),t.jsx(re,{children:t.jsx(le,{...e,rows:4,className:"w-full resize-none"})}),t.jsx(te,{children:"Provide a brief description of the resource"}),t.jsx(ae,{})]})})]})}const ke=["PDF","Excel","Word","Video","Audio"];function De({bucketName:e="resource-files",onFileChange:s,onUrlChange:r,initialUrl:t=""}){const{toast:n}
1=g(),[i,l]=a.useState(!1),[c,o]=a.useState(null);a.useEffect((()=>{if(t){const e=t.split("/");o(e[e.length-1])}else o(null)}),[t]);return{isUploading:i,fileName:c,uploadFile:async a=>{if(a)try{l(!0),o(a.name),s&&s(a);const t=a.name.split(".").pop(),i=`${Math.random().toString(36).substring(2)}-${Date.now()}.${t}`,{error:c,data:d}=await y.storage.from(e).upload(i,a,{cacheControl:"3600",upsert:!0});if(c)throw c;const{data:u}=y.storage.from(e).getPublicUrl(i);return r(u.publicUrl),n({title:"Success",description:"File uploaded successfully"}),u.publicUrl}catch(t){return n({variant:"destructive",title:"Upload failed",description:"There was a problem uploading your file."}),null}finally{l(!1)}},removeFile:()=>{r(""),o(null),s&&s(null)},fileUrl:t}}function Te({hasFile:e,isUploading:s,onClick:r}){return t.jsx(C,{type:"button",variant:e?"secondary":"default",disabled:s,onClick:r,className:"hover:border-brand-orange hover:text-brand-orange hover:bg-transparent",children:s?t.jsxs("span",{className:"flex items-center",children:[t.jsx(o,{className:"mr-2 h-4 w-4 animate-spin"}),"Uploading..."]}):t.jsxs("span",{className:"flex items-center",children:[e?t.jsx(d,{className:"mr-2 h-4 w-4"}):t.jsx(u,{className:"mr-2 h-4 w-4"}),e?"Change File":"Upload File"]})})}function Ae({fileName:e,onRemove:s,disabled:r=!1}){return t.jsxs("div",{className:"flex items-center gap-2 p-2 bg-gray-100 rounded-md",children:[t.jsx("span",{className:"text-sm truncate max-w-[200px]",children:e}),t.jsx(C,{type:"button",variant:"ghost",size:"icon",className:"h-5 w-5",onClick:s,disabled:r,children:t.jsx(m,{size:14})})]})}function Pe({fileUrl:e}){return e?t.jsx("div",{className:"text-sm text-gray-500",children:t.jsx("a",{href:e,target:"_blank",rel:"noopener noreferrer",className:"text-blue-500 hover:underline",children:"View uploaded file"})}):null}function qe({value:e,onChange:s,onFileChange:r,accept:n=".pdf,.doc,.docx,.xls,.xlsx,.mp3,.mp4"}){const i=a.useRef(null),{isUploading:l,fileName:c,uploadFile:o,removeFile:d}=De({onFileChange:r,onUrlChange:s,initialUrl:e});return t.jsxs("div",{className:"space-y-4",children:[t.jsxs("div",{className:"flex items-center gap-4",children:[t.jsx(Te,{hasFile:!!e,isUploading:l,onClick:()=>{i.current&&i.current.click()}}),t.jsx("input",{ref:i,type:"file",className:"hidden",onChange:async e=>{const s=e.target.files?.[0];s&&await o(s),i.current&&(i.current.value="")},accept:n}),c&&t.jsx(Ae,{fileName:c,onRemove:d,disabled:l})]}),t.jsx(Pe,{fileUrl:e})]})}function Le(e){switch(e){case"PDF":return".pdf";case"Excel":return".xls,.xlsx,.csv";case"Word":return".doc,.docx";case"Video":return".mp4,.mov,.avi";case"Audio":return".mp3,.wav";default:return".pdf,.doc,.docx,.xls,.xlsx,.mp3,.mp4"}}function ze({form:e}){return t.jsxs("div",{className:"grid grid-cols-2 gap-6",children:[t.jsx(Z,{control:e.control,name:"file_type",render:({field:e})=>t.jsxs(ee,{children:[t.jsx(se,{className:"text-base font-medium",children:"File Type"}),t.jsxs(ce,{onValueChange:e.onChange,defaultValue:e.value,value:e.value,children:[t.jsx(re,{children:t.jsx(oe,{children:t.jsx(de,{placeholder:"Select file type"})})}),t.jsx(ue,{children:ke.map((e=>t.jsx(me,{value:e,children:e},e)))})]}),t.jsx(ae,{})]})}),t.jsx(Z,{control:e.control,name:"file_url",render:({field:s})=>t.jsxs(ee,{children:[t.jsx(se,{className:"text-base font-medium",children:"File Upload"}),t.jsx(re,{children:t.jsx(qe,{value:s.value,onChange:s.onChange,onFileChange:s=>{s?e.setValue("file",s):e.setValue("file",null)},accept:Le(e.getValues().file_type)})}),t.jsx(te,{children:"Upload your resource file here"}),t.jsx(ae,{})]})})]})}function Oe({form:e}){return t.jsx(Z,{control:e.control,name:"featured",render:({field:e})=>t.jsxs(ee,{className:"flex flex-row items-center justify-between rounded-lg border p-4",children:[t.jsxs("div",{className:"space-y-0.5",children:[t.jsx(se,{className:"text-base font-medium",children:"Featured Resource"}),t.jsx(te,{children:"Featured resources will be highlighted on the resources page"})]}),t.jsx(re,{children:t.jsx(xe,{checked:e.value,onCheckedChange:e.onChange})})]})})}
1function Ve({value:e,onChange:s}){const r=a.useRef(null),{isUploading:n,uploadFile:i}=De({onUrlChange:s,initialUrl:e});return t.jsx("div",{children:t.jsxs("div",{className:"mb-4 flex items-center gap-4",children:[t.jsxs(C,{type:"button",onClick:()=>{r.current&&r.current.click()},disabled:n,variant:"secondary",className:"relative",children:[t.jsx("input",{ref:r,type:"file",className:"hidden",onChange:async e=>{const s=e.target.files?.[0];s&&await i(s),r.current&&(r.current.value="")},accept:"image/*"}),n?t.jsxs("span",{className:"flex items-center",children:[t.jsx(o,{className:"mr-2 h-4 w-4 animate-spin"}),"Uploading..."]}):t.jsxs("span",{className:"flex items-center",children:[e?t.jsx(x,{className:"mr-2 h-4 w-4"}):t.jsx(u,{className:"mr-2 h-4 w-4"}),e?"Change Image":"Upload Image"]})]}),e&&t.jsxs(C,{type:"button",onClick:()=>s(""),variant:"destructive",size:"sm",children:[t.jsx(m,{className:"mr-2 h-4 w-4"})," Remove"]})]})})}function $e({form:e}){const[s,r]=a.useState(!1),n=e.watch("image_url");return a.useEffect((()=>{if(n){r(!1);const e=new Image;e.onload=()=>{r(!1)},e.onerror=()=>{r(!0)},e.src=n}}),[n]),t.jsx(Z,{control:e.control,name:"image_url",render:({field:e})=>t.jsxs(ee,{children:[t.jsx(se,{className:"text-base font-medium",children:"Resource Image"}),t.jsx(re,{children:t.jsxs("div",{className:"space-y-4",children:[t.jsx(Ve,{value:e.value||"",onChange:s=>{e.onChange(s),r(!1)}}),e.value&&!s&&t.jsxs(S,{className:"p-2 overflow-hidden",children:[t.jsx("div",{className:"text-sm font-medium mb-2",children:"Image Preview:"}),t.jsx("div",{className:"relative h-40 w-full max-w-xs overflow-hidden rounded border border-border",children:t.jsx("img",{src:e.value,alt:"Resource preview",className:"h-full w-full object-cover object-center",onError:e=>{r(!0)}})})]}),s&&e.value&&t.jsx(S,{className:"p-2 bg-gray-50",children:t.jsxs("div",{className:"flex flex-col items-center justify-center h-40 text-center",children:[t.jsx(x,{className:"h-10 w-10 text-gray-300 mb-2"}),t.jsx("div",{className:"text-sm text-red-500",children:"Unable to load image preview. The image may not be accessible."}),t.jsxs("div",{className:"text-xs text-gray-500 mt-1",children:["URL: ",e.value]}),t.jsxs("a",{href:e.value,target:"_blank",rel:"noopener noreferrer",className:"text-xs text-blue-500 flex items-center mt-2 hover:underline",children:["Check direct link ",t.jsx(h,{className:"h-3 w-3 ml-1"})]})]})})]})}),t.jsx(te,{children:"Upload an image that represents this resource (optional)"}),t.jsx(ae,{})]})})}function Ie({onCancel:e,isSubmitting:s,isEditing:r}){return t.jsxs("div",{className:"flex justify-start space-x-4 mt-8",children:[t.jsx(C,{type:"button",variant:"outline",onClick:e,disabled:s,className:"hover:border-brand-orange hover:text-brand-orange hover:bg-transparent",children:"Cancel"}),t.jsx(C,{type:"submit",disabled:s,className:"bg-orange-500 hover:bg-orange-600",children:s?"Saving...":r?"Update Resource":"Add Resource"})]})}function Ke({initialData:e,onSubmit:s,onCancel:r,isSubmitting:n}){const{form:i,isEditing:l,handleSubmit:c}=((e,s)=>{const r=X({resolver:Y(Ee),defaultValues:{title:"",description:"",file_type:"PDF",file_url:"",featured:!1,image_url:null,file:null}});return a.useEffect((()=>{e&&r.reset({title:e.title||"",description:e.description||"",file_type:e.file_type||"PDF",file_url:e.file_url||"",featured:e.featured||!1,image_url:e.image_url||null,file:null})}),[e,r]),{form:r,isEditing:!!e,handleSubmit:async e=>{if(s){const a=await s(e);return a&&r.reset(),a}return!1},formState:r.formState}})(e,s);return t.jsx(ne,{...i,children:t.jsxs("form",{onSubmit:i.handleSubmit(c),className:"space-y-6",children:[t.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-2 gap-8",children:[t.jsxs("div",{className:"space-y-6",children:[t.jsx(Ue,{form:i}),t.jsx(ze,{form:i}),t.jsx(Oe,{form:i})]}),t.jsx("div",{children:t.jsx($e,{form:i})})]}),t.jsx(Ie,{onCancel:r,isSubmitting:n,isEditing:l})]})})}function Me({isOpen:e,onClose:s,onSubmit:r,isSubmitting:a}){return t.jsx(Q,{open:e,onOpenChange:e=>!e&&s(),children:t.jsxs(J,{className:"max-w-3xl",children:[t.jsx(W,{className:"pb-4",children:t.jsx(G,{className:"text-3xl font-bold",children:"Add New Resource"})}),t.jsx(Ke,{onSubmit:r,onCancel:s,isSubmitting:a})]})})}function Be({isOpen:e,onClose:s,onSubmit:r,resource:a,isSubmitting:n}){return t.jsx(Q,{open:e,onOpenChange:e=>!e&&s(),children:t.jsxs(J,{className:"max-w-3xl",children:[t.jsxs(W,{className:"pb-4",children:[t.jsx(G,{className:"text-3xl font-bold",children:"Edit Resource"}),t.jsx(H,{className:"text-base",children:"Make changes to your resource and save them when you're done."})]}),a&&t.jsx(Ke,{initialData:a,onSubmit:r,onCancel:s,isSubmitting:n})]})})}
1function Qe({isOpen:e,onClose:s,onConfirm:r,resource:n,isDeleting:i}){const[l,c]=a.useState(null);return t.jsx(he,{open:e,onOpenChange:e=>!e&&s(),children:t.jsxs(je,{children:[t.jsxs(fe,{children:[t.jsx(pe,{children:"Are you sure?"}),t.jsxs(ge,{children:['This will permanently delete the resource "',n?.title,'" and cannot be undone.']})]}),l&&t.jsxs(be,{variant:"destructive",className:"my-2",children:[t.jsx(j,{className:"h-4 w-4"}),t.jsx(we,{children:l})]}),t.jsxs(ye,{children:[t.jsx(Ne,{disabled:i,children:"Cancel"}),t.jsx(ve,{onClick:async()=>{c(null);try{await r()||c("Failed to delete resource. Please try again.")}catch(e){c(e.message||"An unexpected error occurred during deletion")}},disabled:i,className:"bg-red-600 hover:bg-red-700",children:i?"Deleting...":"Delete"})]})]})})}const Je=s=>{const[r,t]=a.useState(!1),{toast:n}=g(),i=e(),l=e=>{i.invalidateQueries({queryKey:["adminResources"]}),n({title:"Resource Deleted",description:"The resource has been successfully deleted."})},c=e=>{i.invalidateQueries({queryKey:["adminResources"]}),n({title:"Resource Removed from View",description:"The resource has been removed from the display but may still exist in the database."})};return{loading:r,deleteResource:async e=>{t(!0);try{try{return await async function(e){const{error:s}=await y.from("resources").delete().eq("id",e);if(s)throw s;return!0}(e),l(e),!0}catch(s){try{return await async function(e){try{const s=`${window.location.origin}/.netlify/functions/delete-resource?id=${e}&force=true`,r=await fetch(s,{method:"DELETE",headers:{"Content-Type":"application/json"}}),a=await r.json().catch((()=>({})));if(!r.ok)throw new Error(a.message||`Failed to delete resource - server responded with status ${r.status}`);return!0}catch(s){throw s}}(e),l(e),!0}catch(r){try{const s=`${window.location.origin}/.netlify/functions/delete-resource`;if((await fetch(`${s}?id=${e}&force=true`,{method:"DELETE"})).ok)return l(e),!0;throw new Error("API call failed")}catch(a){return c(e),!0}}}}catch(i){return n({variant:"destructive",title:"Error",description:"Failed to delete resource. Please try again."}),!1}finally{t(!1)}}}},We=()=>{const[n,i]=a.useState(""),[l,c]=a.useState(!1),[o,d]=a.useState(!1),[u,m]=a.useState(!1),[x,h]=a.useState(null);g();const{resources:j,isLoading:N,isSubmitting:v,addResource:b,updateResource:w,fetchResources:k}=(()=>{const{toast:a}=g(),t=e(),{data:n=[],isLoading:i,refetch:l}=s({queryKey:["adminResources"],queryFn:async()=>{try{const{data:e,error:s}=await y.from("resources").select("*").order("created_at",{ascending:!1});if(s)throw s;return(e||[]).map((e=>({...e,file_type:e.file_type})))}catch(e){return a({title:"Error",description:"Failed to load resources. Please try again.",variant:"destructive"}),[]}}}),{mutateAsync:c,isPending:o}=r({mutationFn:async e=>{const{file:s,...r}=e,a={...r,image_url:r.image_url||null},{data:t,error:n}=await y.from("resources").insert([a]).select();if(n)throw n;return{...t?.[0],file_type:t?.[0].file_type}},onSuccess:()=>{t.invalidateQueries({queryKey:["adminResources"]}),a({title:"Success",description:"Resource added successfully"})},onError:e=>{a({title:"Error",description:"Failed to add resource. Please try again.",variant:"destructive"})}}),{mutateAsync:d,isPending:u}=r({mutationFn:async({id:e,updates:s})=>{const{file:r,...a}=s,t={...a,image_url:a.image_url||null},{data:n,error:i}=await y.from("resources").update(t).eq("id",e).select();if(i)throw i;return{...n?.[0],file_type:n?.[0].file_type}},onSuccess:()=>{t.invalidateQueries({queryKey:["adminResources"]}),a({title:"Success",description:"Resource updated successfully"})},onError:e=>{a({title:"Error",description:"Failed to update resource. Please try again.",variant:"destructive"})}});return{resources:n,isLoading:i,isSubmitting:o||u,fetchResources:l,addResource:async e=>{try{return await c(e),!0}catch{return!1}},updateResource:async(e,s)=>{try{return await d({id:e,updates:s}),!0}catch{return!1}}}})(),{loading:D,deleteResource:T}=Je(),A=j.filter((e=>e.title.toLowerCase().includes(n.toLowerCase())||e.description&&e.description.toLowerCase().includes(n.toLowerCase())));return t.jsxs("div",{children:[t.jsxs(S,{className:"mb-6",children:[t.jsxs(F,{className:"flex flex-col sm:flex-row sm:items-center gap-4",children:[t.jsxs("div",{children:[t.jsx(R,{children:"Resources Management"}),t.jsx(_,{children:"Manage downloadable resources for BrandJitsu™"})]}),t.jsxs("div",{className:"ml-auto flex flex-col sm:flex-row gap-3",children:[t.jsxs("div",{className:"relative",children:[t.jsx(f,{className:"absolute left-2 top-1/2 transform -translate-y-1/2 text-gray-400",size:18}),t.jsx(U,{className:"pl-8 w-full",placeholder:"Search resources...",value:n,onChange:e=>i(e.target.value)})]}),t.jsxs(C,{onClick:()=>c(!0),children:[t.jsx(p,{size:16,className:"mr-2"})," Add Resource"]})]})]}),t.jsx(E,{children:N?t.jsx(_e,{}):t.jsx(Re,{resources:A,onEdit:e=>{h(e),d(!0)},onDelete:e=>{h(e),m(!0)},onToggleFeatured:async e=>{const s=!e.featured;await w(e.id,{featured:s})}})})]}),t.jsx(Me,{isOpen:l,onClose:()=>c(!1),onSubmit:async e=>{const s=await b(e);return s&&c(!1),s},isSubmitting:v}),t.jsx(Be,{isOpen:o,onClose:()=>d(!1),onSubmit:async e=>{if(!x)return!1;const s=await w(x.id,e);return s&&(d(!1),h(null)),s},resource:x,isSubmitting:v}),t.jsx(Qe,{isOpen:u,onClose:()=>m(!1),onConfirm:async()=>
1{if(!x)return!1;const e=x.id;try{return!!(await T(e))&&(m(!1),h(null),k(),!0)}catch(s){return!1}},resource:x,isDeleting:D})]})};export{We 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.