1"use strict";(self.webpackChunkstudent_management_app=self.webpackChunkstudent_management_app||[]).push([[7239],{22177:(e,t,o)=>{o.d(t,{A:()=>l});var n=o(9950),a=o(91523),s=o(44414);function l(e){let{value:t="",documentName:o,onSave:l}=e;const[r,i]=(0,n.useState)(!1),[d,c]=(0,n.useState)(t),[u,m]=(0,n.useState)(!1),[b,g]=(0,n.useState)(""),p=async()=>{m(!0),g("");try{await l((0,a.vk)(d)),i(!1)}catch(e){g(e.message||"Unable to save tag. Please try again.")}finally{m(!1)}};return r?(0,s.jsxs)("div",{className:"mt-2",onClick:e=>e.stopPropagation(),children:[(0,s.jsxs)("label",{className:"block text-xs font-medium text-slate-700",children:["Tag for ",o,(0,s.jsx)("input",{autoFocus:!0,value:d,maxLength:a.zq,disabled:u,onChange:e=>c(e.target.value),onKeyDown:e=>{"Enter"===e.key&&(e.preventDefault(),u||p()),"Escape"!==e.key||u||i(!1)},placeholder:"e.g. Verified or Needs signature",className:"mt-1 block w-full max-w-sm rounded border border-slate-300 bg-white px-2 py-1.5 text-sm"})]}),(0,s.jsx)("p",{className:"mt-1 text-xs text-slate-500",children:"Leave empty to remove the tag."}),(0,s.jsxs)("div",{className:"mt-2 flex gap-2",children:[(0,s.jsx)("button",{type:"button",disabled:u,onClick:p,className:"rounded bg-blue-700 px-3 py-1.5 text-xs font-semibold text-white disabled:opacity-50",children:u?"Saving\u2026":"Save tag"}),(0,s.jsx)("button",{type:"button",disabled:u,onClick:()=>i(!1),className:"rounded border border-slate-300 px-3 py-1.5 text-xs font-semibold text-slate-700",children:"Cancel"})]}),b&&(0,s.jsx)("p",{role:"alert",className:"mt-1 text-xs text-red-700",children:b})]}):t||l?(0,s.jsxs)("div",{className:"mt-1.5 flex flex-wrap items-center gap-2 text-xs",children:[t&&(0,s.jsx)("span",{className:"max-w-full break-words rounded-full bg-blue-100 px-2.5 py-1 font-medium text-blue-800",children:t}),l&&(0,s.jsx)("button",{type:"button","aria-label":`${t?"Edit":"Add"} tag for ${o}`,onClick:()=>{c(t),g(""),i(!0)},className:"rounded px-1 py-1 font-semibold text-blue-700 underline hover:text-blue-900",children:t?"Edit tag":"Add tag"})]}):null}},62935:(e,t,o)=>{o.d(t,{Yp:()=>n,t3:()=>s});o(56600),o(39751);const n=async function(e,t){let o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;console.log("\ud83d\udce5 Starting download for:",t),console.log("\ud83d\udd17 URL:",e.substring(0,100)+"...");try{if(e.includes("firebasestorage.googleapis.com")||e.includes("storage.googleapis.com"))return console.log("\ud83d\udd25 Firebase Storage URL detected, using blob download method"),void await a(e,t);console.log("\ud83c\udf10 Non-Firebase URL, using fetch method");const o=await fetch(e);if(!o.ok)throw new Error(`Failed to fetch file: ${o.status} ${o.statusText}`);const n=await o.blob(),s=window.URL.createObjectURL(n),l=document.createElement("a");l.href=s,l.download=t||"download",l.style.display="none",document.body.appendChild(l),l.click(),document.body.removeChild(l),window.URL.revokeObjectURL(s),console.log("\u2705 Download completed successfully")}catch(n){throw console.error("\u274c Download failed:",n),console.error("\ud83d\udd27 Error details:",{message:n.message,code:n.code,name:n.name}),o&&o(n),n}},a=async(e,t)=>{console.log("\ud83d\udd25 Starting Firebase file download:",t);const o=encodeURIComponent(`attachment; filename="${t}"`),n=e.includes("?")?`${e}&response-content-disposition=${o}`:`${e}?response-content-disposition=${o}`;console.log("\ud83d\udce5 Download URL:",n.substring(0,150)+"...");const a=document.createElement("iframe");a.style.cssText="position:absolute;width:0;height:0;border:0;visibility:hidden;",a.src=n,document.body.appendChild(a),console.log("\u2705 Download iframe created"),setTimeout(()=>{document.body.contains(a)&&(document.body.removeChild(a),console.log("\ud83e\uddf9 Iframe removed"))},3e4)},s=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"pdf";if(!e)return`document.${t}`;let o=e.replace(/[^a-zA-Z0-9._-]/g,"_");return o.includes(".")||(o+=`.${t}`),o}},91523:(e,t,o)=>{o.d(t,{Nl:()=>l,ru:()=>s,vk:()=>a,zq:()=>n});const n=80,a=e=>{const t=String(null!==e&&void 0!==e?e:"").trim();if(t.length>n)throw new Error(`Tags must be ${n} characters or fewer.`);return t},s=(e,t,o)=>{const n=a(o);if(!Array.isArray(e)||!e.some(e=>e.id===t))throw new Error("This document no longer exists. Refresh the document list.");return e.map(e=>e.id===t?{...e,customTag:n}:e)},l=e=>{if(void 0===e||null===e||""===e)return"Upload time unavailable";try{if("string"===typeof e&&/^\d{4}-\d{2}-\d{2}$/.test(e)){const t=new Date(`${e}T00:00:00Z`);return`${new Intl.DateTimeFormat("en-US",{timeZone:"UTC",year:"numeric",month:"short",day:"numeric"}).format(t)} (time unavailable)`}let t;if("function"===typeof(null===e||void 0===e?void 0:e.toDate))t=e.toDate();else if("number"===typeof(null===e||void 0===e?void 0:e.seconds))t=new Date(1e3*e.seconds);else if("number"===typeof(null===e||void 0===e?void 0:e._seconds))t=new Date(1e3*e._seconds);else{if(!(e instanceof Date||"string"===typeof e||"number"===typeof e))return"Upload time unavailable";t=new Date(e)}return new Intl.DateTimeFormat("en-US",{timeZone:"America/Los_Angeles",year:"numeric",month:"short",day:"numeric",hour:"numeric",minute:"2-digit",second:"2-digit",hour12:!0,timeZoneName:"short"}).format(t)}catch{return"Upload time unavailable"}}}}]);
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.