1"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[18188],{18130:(e,t,r)=>{r.d(t,{S:()=>n});function n(e){if(!e)return null;try{let t=e;e.startsWith("http://")||e.startsWith("https://")||(t="https://"+e);let r=new URL(t).hostname;return r.startsWith("www.")&&(r=r.substring(4)),r}catch(t){try{let t=e.match(/(?:https?:\/\/)?(?:www\.)?([^\/\s]+)/i);if(t&&t[1])return t[1]}catch(e){}return null}}},21350:(e,t,r)=>{r.d(t,{A:()=>x});var n=r(95155),i=r(12115),a=r(20063),l=r(3998),o=r(65848),s=r(63892),d=r(80345),c=r(69542),g=r(94161),u=r(28807),p=r(48190);let h=(e,t,r)=>{var n,i;if(t){let e=t.toUpperCase();switch(e){case"POWERPOINT":return"PPT";case"EXCEL":return"XLS";case"WORD":case"DOCUMENT":return"DOC";default:return e}}if(e){let t=null==(n=e.split(".").pop())?void 0:n.toUpperCase();if(t)return t}return r&&(null==(i=r.split("/")[1])?void 0:i.toUpperCase())||"FILE"};function x(e){var t,r;let{resource:x,collection:m,collectionId:b}=e,[f,y]=(0,i.useState)(!1),v=(0,a.useRouter)(),{isSelectionMode:w,isSelected:k,toggleSelection:j}=(0,c.K)(),{buildResourceUrl:_}=(0,g.j)(),N=b||x.collection_id||(null==m?void 0:m.id)||62,C=_(x.id.toString()),{isAlertOpen:S,setIsAlertOpen:A,handleFavorite:M,handleUnfavorite:z,handleReadLater:D,handleUnreadLater:U,handleMarkRead:P,handleUnmarkRead:F,handleArchive:O,handleRestore:R,handleDelete:E,handlePinToHome:L,handlePinToCollection:I,handleUnpin:T}=(0,u.N)({resource:x,collectionId:N}),K="pdf"===x.sub_kind||(null==(t=x.file_name)?void 0:t.toLowerCase().endsWith(".pdf"))||(null==(r=x.url)?void 0:r.toLowerCase().endsWith(".pdf")),W=(0,p.Gt)(x),B=W&&x.readable_content?(0,p.eA)(x.readable_content,220):"",[G,H]=(0,i.useState)(!1),$=x.file_name||x.title||"Unknown file",J=(e=>{if(!e)return"Unknown size";let t=Math.floor(Math.log(e)/Math.log(1024));return Math.round(e/Math.pow(1024,t)*100)/100+" "+["B","KB","MB","GB"][t]})(x.file_size);((e,t)=>{var r;if(!e&&!t)return;let n=null==e||null==(r=e.split(".").pop())?void 0:r.toLowerCase(),i=null==t?void 0:t.toLowerCase();return"pdf"===n||(null==i?void 0:i.includes("pdf"))||["doc","docx"].includes(n)||(null==i?void 0:i.includes("word"))||["xls","xlsx"].includes(n)||(null==i?void 0:i.includes("excel"))||(null==i?void 0:i.includes("spreadsheet"))||["ppt","pptx"].includes(n)||(null==i?void 0:i.includes("presentation"))||["jpg","jpeg","png","gif","webp"].includes(n)||(null==i?void 0:i.includes("image"))||["mp4","avi","mov","mkv"].includes(n)||(null==i?void 0:i.includes("video"))||["mp3","wav","flac","aac"].includes(n)||(null==i?void 0:i.includes("audio"))||["zip","rar","7z","tar","gz"].includes(n)||(null==i?void 0:i.includes("archive"))||["txt","md"].includes(n)||null==i||i.includes("text")})(x.file_name,x.file_type);let X="bg-white dark:bg-gray-600 rounded-2xl overflow-hidden flex flex-col h-full transition-all duration-200 lg:hover:ring-3 lg:hover:ring-[#0D99FF] border border-gray-100 dark:border-gray-600 shadow-xs cursor-pointer group ".concat(w&&k(x.id.toString())?"ring-2 ring-blue-500":"");return(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)("div",{role:"link",tabIndex:0,className:X,onClick:e=>{if(w){e.preventDefault(),j(x.id.toString());return}v.push(C,{scroll:!1})},onKeyDown:e=>{("Enter"===e.key||" "===e.key)&&(e.preventDefault(),w?j(x.id.toString()):v.push(C,{scroll:!1}))},children:(0,n.jsxs)("div",{className:"flex flex-col h-full bg-gray-50 dark:bg-gray-700 pt-2",children:[(0,n.jsxs)("div",{className:"relative w-[90%] max-w-[360px] mx-auto flex-1 lg:max-w-none lg:h-[110px] lg:flex-initial flex items-center justify-center bg-gray-100 dark:bg-gray-700 rounded-t-lg overflow-hidden shadow-[0_-2px_4px_-1px_rgba(0,0,0,0.05),_-2px_0_4px_-1px_rgba(0,0,0,0.05),_2px_0_4px_-1px_rgba(0,0,0,0.05)]",children:[K&&x.thumbnail_url&&(0,n.jsx)("img",{src:x.thumbnail_url,alt:x.title||x.file_name||"PDF thumbnail",className:"w-full h-full object-cover absolute inset-0 ".concat(G?"z-10":"invisible"),onLoad:()=>H(!0),onError:e=>{e.currentTarget.style.display="none"}}),!G&&(W&&B?(0,n.jsx)("div",{className:"flex items-start justify-start w-full h-full px-3 py-2 overflow-hidden",children:(0,n.jsx)("p",{className:"text-[11px] leading-[1.45] text-gray-600 dark:text-gray-300 line-clamp-5 whitespace-pre-line text-left w-full",children:B})}):(0,n.jsx)("div",{className:"flex items-center justify-center w-full h-full",children:(0,n.jsx)("span",{className:"text-sm font-bold text-gray-400 dark:text-gray-500 tracking-wide",children:h(x.file_name,x.sub_kind,x.file_type)||"FILE"})})),(0,n.jsx)("div",{className:"hidden lg:block absolute inset-0 bg-black opacity-0 group-hover:opacity-40 transition-opacity duration-300 rounded-t-lg"}),w&&(0,n.jsx)("div",{className:"absolute top-3 left-3 z-50",children:(0,n.jsx)("div",{className:"w-6 h-6 rounded border-2 flex items-center justify-center cursor-pointer transition-all ".concat(k(x.id.toString())?"bg-blue-500 border-blue-500":"bg-white border-gray-300 hover:border-gray-400"),onClick:e=>{e.preventDefault(),e.stopPropagation(),j(x.id.toString())}
1,children:k(x.id.toString())&&(0,n.jsx)(s.A,{name:"Check",width:16,height:16,color:"white"})})}),!w&&(0,n.jsx)("div",{className:"absolute top-3 left-3 transition-opacity duration-300 z-10 ".concat(G?"opacity-100 lg:opacity-0 lg:group-hover:opacity-100":"opacity-0 lg:group-hover:opacity-100"),children:(0,n.jsx)(l.$,{variant:"ghost",size:"sm",className:"bg-white/90 backdrop-blur-md text-gray-900 ring-1 ring-black/5 shadow-sm rounded-lg p-1.5 lg:p-2 h-auto hover:bg-white dark:bg-gray-900/60 dark:text-white dark:ring-white/10",onClick:e=>{if(e.stopPropagation(),x.url&&x.url.startsWith("data:")){let e=document.createElement("a");e.href=x.url,e.download=$,document.body.appendChild(e),e.click(),document.body.removeChild(e)}else window.open(C,"_blank")},children:(0,n.jsx)(s.A,{name:"Download",className:"w-4 h-4 lg:w-5 lg:h-5"})})}),(0,n.jsx)("div",{className:"absolute top-3 right-3 transition-opacity duration-300 z-50 ".concat(w?"opacity-100":"opacity-100 lg:opacity-0 lg:group-hover:opacity-100"),children:(0,n.jsx)(o.A,{link:x,collection:m||{id:62,permission:"admin"},isMenuOpen:f,setIsMenuOpen:y,setIsAlertOpen:A,onEdit:()=>{},onFavorite:M,onUnfavorite:z,onReadLater:D,onUnreadLater:U,onMarkRead:P,onUnmarkRead:F,onMove:e=>{},onArchive:O,onRestore:R,onPinToHome:L,onPinToCollection:I,onUnpin:T,customTrigger:(0,n.jsx)("button",{type:"button",onClick:e=>{e.stopPropagation()},className:"bg-white/90 backdrop-blur-md text-gray-900 ring-1 ring-black/5 shadow-sm rounded-lg p-1.5 lg:p-2 hover:bg-white transition-colors cursor-pointer dark:bg-gray-900/60 dark:text-white dark:ring-white/10",children:(0,n.jsx)(s.A,{name:"Moremenu",className:"w-4 h-4 lg:w-5 lg:h-5"})})})})]}),(0,n.jsxs)("div",{className:"flex flex-col bg-white dark:bg-gray-600 px-2 pt-5 pb-2 relative flex-shrink-0 lg:grow",children:[(0,n.jsx)("div",{className:"absolute -top-[14px] left-4 bg-white dark:bg-gray-600 rounded p-1 shadow-[0_1px_2px_rgba(0,0,0,0.05)] w-6 h-6 flex items-center justify-center",children:(0,n.jsx)("span",{className:"text-[0.5rem] font-bold text-gray-500 dark:text-gray-400 leading-none",children:h(x.file_name,x.sub_kind,x.file_type)})}),(0,n.jsx)("h3",{className:"font-medium text-[14px] text-gray-900 dark:text-gray-100 truncate mb-1",title:$,children:$}),(0,n.jsx)("span",{className:"text-[12px] font-regular text-gray-500 dark:text-gray-400 truncate block mt-auto",children:J})]})]})}),(0,n.jsx)(d.A,{isOpen:S,onOpenChange:A,onDelete:E})]})}},27056:(e,t,r)=>{r.d(t,{A:()=>u});var n=r(95155),i=r(12115),a=r(20063),l=r(65848),o=r(63892),s=r(80345),d=r(69542),c=r(94161),g=r(28807);function u(e){var t,r;let{resource:u,collection:p}=e,[h,x]=(0,i.useState)(!1),m=(0,a.useRouter)(),{isSelectionMode:b,isSelected:f,toggleSelection:y}=(0,d.K)(),{buildResourceUrl:v}=(0,c.j)(),w=(null==p?void 0:p.id)||u.collection_id,{isAlertOpen:k,setIsAlertOpen:j,handleFavorite:_,handleUnfavorite:N,handleReadLater:C,handleUnreadLater:S,handleMarkRead:A,handleUnmarkRead:M,handleArchive:z,handleRestore:D,handleDelete:U,handlePinToHome:P,handlePinToCollection:F,handleUnpin:O}=(0,g.N)({resource:u,collectionId:w}),R=v(u.id.toString()),E=e=>e?"text"===e.type?e.text||"":Array.isArray(e.content)?e.content.map(e=>E(e)).join(" "):"":"",L="bg-white dark:bg-gray-600 rounded-2xl overflow-hidden flex flex-col w-full h-full transition-all duration-200 lg:hover:ring-3 lg:hover:ring-[#0D99FF] border border-gray-100 dark:border-gray-600 shadow-xs cursor-pointer group ".concat(b&&f(u.id.toString())?"ring-2 ring-blue-500":"");return(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)("div",{role:"link",tabIndex:0,className:L,onClick:e=>{if(b){e.preventDefault(),y(u.id.toString());return}m.push(R,{scroll:!1})},onKeyDown:e=>{("Enter"===e.key||" "===e.key)&&(e.preventDefault(),b?y(u.id.toString()):m.push(R,{scroll:!1}))},children:(0,n.jsxs)("div",{className:"flex flex-col h-full bg-white dark:bg-gray-600 relative",children:[b&&(0,n.jsx)("div",{className:"absolute top-2 left-2 z-50",children:(0,n.jsx)("div",{className:"w-6 h-6 rounded border-2 flex items-center justify-center cursor-pointer transition-all ".concat(f(u.id.toString())?"bg-blue-500 border-blue-500":"bg-white border-gray-300 hover:border-gray-400"),onClick:e=>{e.preventDefault(),e.stopPropagation(),y(u.id.toString())}
1,children:f(u.id.toString())&&(0,n.jsx)(o.A,{name:"Check",width:16,height:16,color:"white"})})}),(0,n.jsx)("div",{className:"absolute top-2 right-2 transition-opacity duration-300 z-50 ".concat(b?"opacity-100":"opacity-100 lg:opacity-0 lg:group-hover:opacity-100"),children:(0,n.jsx)(l.A,{link:u,collection:p||{id:62,permission:"admin"},isMenuOpen:h,setIsMenuOpen:x,setIsAlertOpen:j,onEdit:()=>{},onFavorite:_,onUnfavorite:N,onReadLater:C,onUnreadLater:S,onMarkRead:A,onUnmarkRead:M,onMove:e=>{},onArchive:z,onRestore:D,onPinToHome:P,onPinToCollection:F,onUnpin:O,customTrigger:(0,n.jsx)("button",{type:"button",className:"bg-white/90 backdrop-blur-md text-gray-900 ring-1 ring-black/5 shadow-sm rounded-lg p-1.5 lg:p-2 hover:bg-white transition-colors cursor-pointer dark:bg-gray-900/60 dark:text-white dark:ring-white/10",onClick:e=>{e.stopPropagation()},children:(0,n.jsx)(o.A,{name:"Moremenu",className:"w-4 h-4 lg:w-5 lg:h-5"})})})}),(0,n.jsxs)("div",{className:"flex-1 flex flex-col p-2 pt-5 overflow-hidden",children:[(0,n.jsx)("span",{className:"text-xs text-gray-400 dark:text-gray-500 mb-2 flex-shrink-0",children:new Date(u.created_at).toLocaleDateString(void 0,{year:"numeric",month:"short",day:"numeric"})}),(0,n.jsxs)("div",{className:"flex items-center gap-2 mb-2 flex-shrink-0",children:[(0,n.jsx)("span",{className:"text-gray-900 dark:text-gray-100",children:(0,n.jsx)(o.A,{name:"Note",width:12,height:12})}),(0,n.jsx)("span",{className:"font-semibold text-sm text-gray-900 dark:text-gray-100 truncate max-w-full",style:{lineHeight:"1.25"},title:u.title||(null==(t=u.note_content)?void 0:t.title)||"Untitled Note",children:u.title||(null==(r=u.note_content)?void 0:r.title)||"Untitled Note"})]}),(0,n.jsx)("p",{className:"text-xs text-gray-800 dark:text-gray-300 line-clamp-3 break-words flex-1 overflow-hidden",children:(()=>{var e;let t=null==(e=u.note_content)?void 0:e.content;if(t&&"object"==typeof t&&!Array.isArray(t)&&"doc"===t.type&&Array.isArray(t.content)){let e=E(t).trim();if(e)return e.slice(0,100)+(e.length>100?"...":"")}if(Array.isArray(t)){let e=t.map(e=>e.content||"").filter(e=>"string"==typeof e&&e.trim()).join(" ");if(e)return e.slice(0,100)+(e.length>100?"...":"")}if(Array.isArray(u.content)){let e=u.content.map(e=>e.content||"").filter(e=>"string"==typeof e&&e.trim()).join(" ");if(e)return e.slice(0,100)+(e.length>100?"...":"")}return"string"==typeof u.content&&u.content.trim()?u.content.slice(0,100)+(u.content.length>100?"...":""):"string"==typeof t&&t.trim()?t.slice(0,100)+(t.length>100?"...":""):"No content"})()})]})]})}),(0,n.jsx)(s.A,{isOpen:k,onOpenChange:j,onDelete:U})]})}},28649:(e,t,r)=>{r.d(t,{A:()=>x});var n=r(95155),i=r(12115),a=r(20063),l=r(3998),o=r(65848),s=r(63892),d=r(80345),c=r(69542),g=r(94161),u=r(28807),p=r(83804);function h(e){return e?e<1048576?"".concat((e/1024).toFixed(1)," KB"):"".concat((e/1048576).toFixed(1)," MB"):""}let x=(0,i.memo)(function(e){let{resource:t,collection:r}=e,[x,m]=(0,i.useState)("landscape"),[b,f]=(0,i.useState)(!1),[y,v]=(0,i.useState)(!1),w=(0,a.useRouter)(),{isSelectionMode:k,isSelected:j,toggleSelection:_}=(0,c.K)(),{buildResourceUrl:N}=(0,g.j)(),C=(null==r?void 0:r.id)||t.collection_id,{isAlertOpen:S,setIsAlertOpen:A,handleFavorite:M,handleUnfavorite:z,handleReadLater:D,handleUnreadLater:U,handleMarkRead:P,handleUnmarkRead:F,handleArchive:O,handleRestore:R,handleDelete:E,handlePinToHome:L,handlePinToCollection:I,handleUnpin:T}=(0,u.N)({resource:t,collectionId:C}),K=N(t.id.toString()),W="bg-white dark:bg-gray-600 rounded-2xl overflow-hidden flex flex-col h-full transition-all duration-200 lg:hover:ring-3 lg:hover:ring-[#0D99FF] border border-gray-100 dark:border-gray-600 shadow-xs cursor-pointer group ".concat(k&&j(t.id.toString())?"ring-2 ring-blue-500":"");return(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)("div",{role:"link",tabIndex:0,className:W,onClick:e=>{if(k){e.preventDefault(),_(t.id.toString());return}w.push(K,{scroll:!1})},onKeyDown:e=>{("Enter"===e.key||" "===e.key)&&(e.preventDefault(),k?_(t.id.toString()):w.push(K,{scroll:!1}))},children:(0,n.jsxs)("div",{className:"flex flex-col h-full bg-gray-50 dark:bg-gray-700 pt-2",children:[(0,n.jsxs)("div",{className:"relative w-[90%] max-w-[360px] mx-auto flex-1 lg:max-w-none lg:h-[110px] lg:flex-initial rounded-t-lg overflow-hidden bg-gray-50 shadow-[0_-2px_4px_-1px_rgba(0,0,0,0.05),_-2px_0_4px_-1px_rgba(0,0,0,0.05),_2px_0_4px_-1px_rgba(0,0,0,0.05)]",children:[t.url?(0,n.jsx)("img",{src:(0,p.HQ
1)(t.url),alt:t.title,className:"w-full h-full object-cover object-top transition-opacity duration-200 ".concat(b?"opacity-100":"opacity-0"),loading:"lazy",onLoad:()=>f(!0),onError:e=>{(0,p.Us)(e),f(!0)}}):(0,n.jsx)("div",{className:"w-full h-full bg-gray-200 flex items-center justify-center rounded-t-lg",children:(0,n.jsx)("div",{className:"text-gray-400 text-sm",children:"No Image"})}),t.url&&!b&&(0,n.jsx)("div",{className:"absolute inset-0 bg-gray-200 animate-pulse flex items-center justify-center rounded-t-lg",children:(0,n.jsx)("div",{className:"text-gray-400 text-sm",children:"Loading..."})}),(0,n.jsx)("div",{className:"hidden lg:block absolute inset-0 bg-black opacity-0 group-hover:opacity-40 transition-opacity duration-300 rounded-t-lg"}),k&&(0,n.jsx)("div",{className:"absolute top-3 left-3 z-50",children:(0,n.jsx)("div",{className:"w-6 h-6 rounded border-2 flex items-center justify-center cursor-pointer transition-all ".concat(j(t.id.toString())?"bg-blue-500 border-blue-500":"bg-white border-gray-300 hover:border-gray-400"),onClick:e=>{e.preventDefault(),e.stopPropagation(),_(t.id.toString())},children:j(t.id.toString())&&(0,n.jsx)(s.A,{name:"Check",width:16,height:16,color:"white"})})}),!k&&(0,n.jsx)("div",{className:"absolute top-3 left-3 opacity-100 lg:opacity-0 lg:group-hover:opacity-100 transition-opacity duration-300 z-10",children:(0,n.jsx)(l.$,{variant:"ghost",size:"sm",className:"bg-white/90 backdrop-blur-md text-gray-900 ring-1 ring-black/5 shadow-sm rounded-lg p-1.5 lg:p-2 h-auto hover:bg-white dark:bg-gray-900/60 dark:text-white dark:ring-white/10",onClick:e=>{var t,r;e.stopPropagation(),(null==(t=(r=window).matchMedia)?void 0:t.call(r,"(hover: hover)").matches)?window.open(K,"_blank","noopener,noreferrer"):window.location.assign(K)},children:(0,n.jsx)(s.A,{name:"Arrowuprightfilled",className:"w-4 h-4 lg:w-5 lg:h-5"})})}),(0,n.jsx)("div",{className:"absolute top-3 right-3 transition-opacity duration-300 z-50 ".concat(k?"opacity-100":"opacity-100 lg:opacity-0 lg:group-hover:opacity-100"),children:(0,n.jsx)(o.A,{link:t,collection:r||{id:62,permission:"admin"},isMenuOpen:y,setIsMenuOpen:v,setIsAlertOpen:A,onEdit:()=>{},onFavorite:M,onUnfavorite:z,onReadLater:D,onUnreadLater:U,onMarkRead:P,onUnmarkRead:F,onMove:e=>{},onArchive:O,onRestore:R,onPinToHome:L,onPinToCollection:I,onUnpin:T,customTrigger:(0,n.jsx)("button",{type:"button",className:"bg-white/90 backdrop-blur-md text-gray-900 ring-1 ring-black/5 shadow-sm rounded-lg p-1.5 lg:p-2 hover:bg-white transition-colors cursor-pointer dark:bg-gray-900/60 dark:text-white dark:ring-white/10",onClick:e=>{e.stopPropagation()},children:(0,n.jsx)(s.A,{name:"Moremenu",className:"w-4 h-4 lg:w-5 lg:h-5"})})})})]}),(0,n.jsxs)("div",{className:"flex flex-col bg-white dark:bg-gray-600 px-2 pt-5 pb-2 relative flex-shrink-0 lg:grow",children:[(0,n.jsx)("div",{className:"absolute -top-[14px] left-4 bg-white dark:bg-gray-600 rounded p-1 shadow-[0_1px_2px_rgba(0,0,0,0.05)] w-6 h-6 flex items-center justify-center",children:(0,n.jsx)("span",{className:"text-[0.5rem] font-bold text-gray-500 dark:text-gray-400 leading-none",children:(e=>{if(!e)return"IMG";let t=e.split("?")[0].split(".");if(t.length<=1)return"IMG";let r=t[t.length-1].toUpperCase();return"JPEG"===r?"JPG":(r.length>3&&(r=r.substring(0,3)),r||"IMG")})(t.url)})}),(0,n.jsx)("h3",{className:"font-medium text-[14px] text-gray-900 dark:text-gray-100 truncate mb-1",title:t.title,children:t.title}),h(t.file_size)&&(0,n.jsx)("span",{className:"text-[12px] font-regular text-gray-500 dark:text-gray-400 truncate block mt-auto",children:h(t.file_size)})]})]})}),(0,n.jsx)(d.A,{isOpen:S,onOpenChange:A,onDelete:E})]})},(e,t)=>e.resource.id===t.resource.id&&e.resource.fetching_status===t.resource.fetching_status&&e.resource.updated_at===t.resource.updated_at&&e.resource.title===t.resource.title&&e.resource.thumbnail_url===t.resource.thumbnail_url)},79858:(e,t,r)=>{r.d(t,{l:()=>a});var n=r(95155);r(12115);let i=/^(the|a|an)\s+/i;function a(e){let{title:t,size:r=20,fill:a=!1,letterSize:l,className:o=""}=e,s=(e=>{let t=(null!=e?e:"").trim();return t?((t.replace(i,"").trim()||t).charAt(0)||"?").toUpperCase():"?"})(t),d=null!=r?r:20;return(0,n.jsx)("div",{className:"flex items-center justify-center rounded bg-[#F3F4F6] overflow-hidden ".concat(a?"w-full h-full":""," ").concat(o),style:a?{}:{width:r,height:r},"aria-hidden":"true",children:(0,n.jsx)("span",{className:"font-sans font-semibold select-none text-gray-700",style:{fontSize:null!=l?l:.38*d,letterSpacing:"-0.02em",lineHeight:1},children:s})})}},97756:(e,t,r)=>{r.d(t,{A:()=>b});
1var n=r(95155),i=r(12115),a=r(20063),l=r(3998),o=r(65848),s=r(80345),d=r(63892),c=r(28807),g=r(69542),u=r(94161),p=r(20470),h=r(79858),x=r(18130);function m(e){return e?"".concat((e/1048576).toFixed(1)," MB"):""}let b=(0,i.memo)(function(e){let{resource:t,collection:r,collectionId:b}=e,[f,y]=(0,i.useState)(!1),[v,w]=(0,i.useState)(!1),[k,j]=(0,i.useState)(!1),_=(0,a.useRouter)(),{isSelectionMode:N,isSelected:C,toggleSelection:S}=(0,g.K)(),{buildResourceUrl:A}=(0,u.j)(),M=b||t.collection_id||(null==r?void 0:r.id)||null,{isAlertOpen:z,setIsAlertOpen:D,handleFavorite:U,handleUnfavorite:P,handleReadLater:F,handleUnreadLater:O,handleMarkRead:R,handleUnmarkRead:E,handleArchive:L,handleRestore:I,handleDelete:T,handlePinToHome:K,handlePinToCollection:W,handleUnpin:B}=(0,c.N)({resource:t,collectionId:M}),G="in_progress"===t.fetching_status,H=A(t.id.toString()),$=(0,i.useCallback)(e=>{var t,r;(null==(t=(r=window).matchMedia)?void 0:t.call(r,"(hover: hover)").matches)?window.open(e,"_blank","noopener,noreferrer"):window.location.assign(e)},[]),J=(0,i.useCallback)(()=>{},[]),X=(0,i.useCallback)(e=>{},[]),Q=(0,i.useCallback)(e=>{if(N)return void S(t.id.toString());_.push(H,{scroll:!1})},[N,t.id,S,_,H]),q=()=>{switch(t.kind){case"url":return(0,x.S)(t.url)||"";case"file":return m(t.file_size);case"note":case"voice_note":var e=t.created_at;if(!e)return"";return new Date(e).toLocaleDateString("en-US",{year:"numeric",month:"short",day:"numeric"});case"image":return m(t.file_size)||"";default:return""}},V="bg-white dark:bg-gray-600 rounded-2xl overflow-hidden flex flex-col w-full h-full transition-all duration-200 lg:hover:ring-3 lg:hover:ring-[#0D99FF] border border-gray-100 dark:border-gray-600 shadow-xs group relative cursor-pointer ".concat(N&&C(t.id.toString())?"ring-2 ring-blue-500":"");return(0,n.jsxs)(n.Fragment,{children:[(0,n.jsxs)("div",{role:"link",tabIndex:0,className:V,onClick:Q,onKeyDown:e=>{("Enter"===e.key||" "===e.key)&&(e.preventDefault(),Q(e))},children:[(0,n.jsxs)("div",{className:"flex flex-col h-full bg-gray-50 dark:bg-gray-700 pt-2",children:[(0,n.jsxs)("div",{className:"relative w-[90%] max-w-[360px] mx-auto flex-1 lg:max-w-none lg:h-[110px] lg:flex-initial rounded-t-lg overflow-hidden bg-gray-50 shadow-[0_-2px_4px_-1px_rgba(0,0,0,0.05),_-2px_0_4px_-1px_rgba(0,0,0,0.05),_2px_0_4px_-1px_rgba(0,0,0,0.05)]",children:[t.thumbnail_url&&!v?(0,n.jsx)("img",{src:t.thumbnail_url,alt:"",className:"w-full h-full object-cover object-top",loading:"lazy",onError:()=>w(!0)}):(0,n.jsx)(p.x,{fill:!0,title:t.title,source:t.url,letterSize:48,tldSize:11,className:"!rounded-none !border-0"}),(0,n.jsx)("div",{className:"hidden lg:block absolute inset-0 bg-black opacity-0 group-hover:opacity-40 transition-opacity duration-300 rounded-t-lg"}),(0,n.jsx)("div",{className:"absolute top-3 left-3 opacity-100 lg:opacity-0 lg:group-hover:opacity-100 transition-opacity duration-300 z-10",children:(0,n.jsx)(l.$,{variant:"ghost",size:"sm",className:"bg-white/90 backdrop-blur-md text-gray-900 ring-1 ring-black/5 shadow-sm rounded-lg p-1.5 lg:p-2 h-auto hover:bg-white dark:bg-gray-900/60 dark:text-white dark:ring-white/10",onClick:e=>{e.stopPropagation(),$(t.url||H)},children:(0,n.jsx)(d.A,{name:"Arrowuprightfilled",className:"w-4 h-4 lg:w-5 lg:h-5"})})}),N&&(0,n.jsx)("div",{className:"absolute top-3 left-3 z-50",children:(0,n.jsx)("div",{className:"w-6 h-6 rounded border-2 flex items-center justify-center cursor-pointer transition-all ".concat(C(t.id.toString())?"bg-blue-500 border-blue-500":"bg-white dark:bg-gray-800 border-gray-300 dark:border-gray-600 hover:border-gray-400 dark:hover:border-gray-500"),onClick:e=>{e.preventDefault(),e.stopPropagation(),S(t.id.toString())},children:C(t.id.toString())&&(0,n.jsx)(d.A,{name:"Check",width:16,height:16,color:"white"})})}),(0,n.jsx)("div",{className:"absolute top-3 right-3 transition-opacity duration-300 z-50 ".concat(N?"opacity-100":"opacity-100 lg:opacity-0 lg:group-hover:opacity-100"),children:(0,n.jsx)(o.A,{link:t,collection:r||{id:62,permission:"admin"},isMenuOpen:f,setIsMenuOpen:y,setIsAlertOpen:D,onEdit:J,onFavorite:U,onUnfavorite:P,onReadLater:F,onUnreadLater:O,onMarkRead:R,onUnmarkRead:E,onMove:X,onArchive:L,onRestore:I,onPinToHome:K,onPinToCollection:W,onUnpin:B,customTrigger:(0,n.jsx)("button",{type:"button",className:"bg-white/90 backdrop-blur-md text-gray-900 ring-1 ring-black/5 shadow-sm rounded-lg p-1.5 lg:p-2 hover:bg-white transition-colors cursor-pointer dark:bg-gray-900/60 dark:text-white dark:ring-white/10",onClick:e=>{e.stopPropagation()},children:(0,n.jsx)(d.A,{name:"Moremenu",className:"w-4 h-4 lg:w-5 lg:h-5"})})})})]}),(0,n.jsxs)("div",{className:"flex flex-col bg-white dark:bg-gray-600 px-2 pt-5 pb-2 relative flex-shrink-0 lg:grow",children:[(0,n.jsx)("div",{className:"absolute -top-[14px] left-4 bg-white dark:bg-gray-600 rounded p-1 shadow-[0_1px_2px_rgba(0,0,0,0.05)]",children:t.favicon_url&&!k?(0,n.jsx)("img",{src:t.favicon_url,alt:"",className:"w-5 h-5",loading:"lazy",onError:()=>j(!0)}):(0,n.jsx)(h.l,{title:t.title,size:20})}),(0,n.jsx)("h3",{className:"font-medium text-[14px] text-gray-900 dark:text-gray-100 truncate mb-1",title:t.title||"No Title",children:t.title||"No Title"}),q()&&(0,n.jsx)("span",{className:"text-[12px] font-regular text-gray-500 dark:text-gray-400 truncate block mt-auto",children:q()})]})]}),G&&(0,n.jsx)("div",{className:"absolute inset-0 bg-black/10 flex items-center justify-center rounded-2xl z-10",children:(0,n.jsx)("div",{className:"w-8 h-8 border-4 border-white border-t-transparent roun
1ded-full animate-spin"})})]}),(0,n.jsx)(s.A,{isOpen:z,onOpenChange:D,onDelete:T})]})})}}]);
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.