import{_ as O,r as g,c as z,o as P,i as b,w as n,s as S,v as F,g as r,b as t,a as i,aW as R,d,e as u,k as m,t as o,af as $,aQ as U,n as W,j as Z,F as f,b9 as G}from"./index-BUdRbiwj.js";import{F as h}from"./FPBadge-BKY5dPnL.js";import{F as q,a as Q}from"./FPPageHeader-CTG2L28r.js";const X={class:"px-6 py-8"},Y={key:0,class:"flex items-center justify-center py-12"},J={key:1,class:"space-y-6"},K={class:"bg-white shadow rounded-lg p-6"},tt={class:"flex items-start space-x-4"},et={class:"w-16 h-16 bg-blue-100 rounded-lg flex items-center justify-center"},st={class:"flex items-center space-x-4 mb-2"},at={class:"text-sm text-gray-500"},ot={class:"text-gray-600"},rt={class:"grid grid-cols-1 md:grid-cols-4 gap-6"},nt={class:"bg-white shadow rounded-lg p-6"},it={class:"flex items-center"},lt={class:"ml-4"},dt={class:"text-2xl font-bold text-gray-900"},ct={class:"bg-white shadow rounded-lg p-6"},ut={class:"flex items-center"},mt={class:"ml-4"},vt={class:"text-lg font-semibold text-gray-900"},xt={class:"bg-white shadow rounded-lg p-6"},yt={class:"flex items-center"},pt={class:"ml-4"},gt={class:"text-lg font-semibold text-gray-900"},ft={class:"bg-white shadow rounded-lg p-6"},ht={class:"flex items-center"},wt={class:"ml-4"},kt={class:"text-lg font-semibold text-gray-900"},_t={class:"bg-white shadow rounded-lg"},bt={class:"border-b border-gray-200"},Ct={class:"-mb-px flex space-x-8 px-6","aria-label":"Tabs"},At=["onClick"],Mt={class:"p-6"},Nt={key:0},Ht={class:"grid grid-cols-1 lg:grid-cols-2 gap-6"},Lt={class:"space-y-3"},Vt={class:"flex justify-between"},It={class:"text-sm text-gray-900"},jt={class:"flex justify-between"},Dt={class:"text-sm text-gray-900"},Et={class:"flex justify-between"},Tt={class:"text-sm text-gray-900"},Bt={class:"flex justify-between"},Ot={class:"text-sm text-gray-900"},zt={class:"flex justify-between"},Pt={class:"text-sm text-gray-900"},St={class:"space-y-3"},Ft={class:"flex justify-between"},Rt={class:"text-sm text-gray-900"},$t={class:"flex justify-between"},Ut={class:"text-sm text-gray-900"},Wt={class:"flex justify-between"},Zt={class:"text-sm text-gray-900"},Gt={class:"flex justify-between"},qt={class:"text-sm text-gray-900"},Qt={key:1},Xt={key:2},Yt={key:3},Jt={key:4},Kt={key:2,class:"text-center py-12"},te={__name:"AssetDetailView",setup(ee){const w=F(),C=S(),x=g(!0),l=g("overview"),s=g(null),A=[{id:"overview",label:"Overview"},{id:"maintenance",label:"Maintenance"},{id:"parts",label:"Parts"},{id:"workorders",label:"Work Orders"},{id:"analytics",label:"Analytics"}],M=z(()=>s.value&&{HVAC:"fire",ELEVATOR:"arrow-up-down",SECURITY:"shield-check",ELECTRICAL:"bolt"}[s.value.category]||"cog"),N=async()=>{x.value=!0,setTimeout(()=>{const a=parseInt(C.params.id),e={1:{id:1,name:"Main HVAC Unit",category:"HVAC",model:"Carrier 30HXC",manufacturer:"Carrier",serialNumber:"HV001234",status:"OPERATIONAL",location:"Roof Level 3",criticality:"HIGH",value:45e3,installDate:"2020-03-15",lastMaintenance:"2024-01-15T10:00:00Z",nextMaintenance:"2024-04-15T10:00:00Z",description:"Primary heating and cooling system for floors 1-3",uptime:"99.2",operatingHours:12500,warrantyActive:!0},2:{id:2,name:"Passenger Elevator",category:"ELEVATOR",model:"Otis Gen2",manufacturer:"Otis",serialNumber:"EL002456",status:"MAINTENANCE",location:"Main Lobby",criticality:"CRITICAL",value:12e4,installDate:"2019-08-20",lastMaintenance:"2024-01-20T14:00:00Z",nextMaintenance:"2024-02-20T14:00:00Z",description:"Main passenger elevator serving all floors",uptime:"98.7",operatingHours:18500,warrantyActive:!1}};s.value=e[a]||null,x.value=!1},1e3)},H=()=>{w.push(`/assets?edit=${s.value.id}`)},L=()=>{w.push(`/work-orders?create=true&assetId=${s.value.id}`)},V=a=>({OPERATIONAL:"success",MAINTENANCE:"warning",DOWN:"error",DECOMMISSIONED:"secondary"})[a]||"default",I=a=>({LOW:"secondary",MEDIUM:"info",HIGH:"warning",CRITICAL:"error"})[a]||"default",j=a=>a.toLowerCase().replace(/\b\w/g,e=>e.toUpperCase()),D=a=>a.toLowerCase().replace(/\b\w/g,e=>e.toUpperCase()),E=a=>a.toLowerCase().replace(/\b\w/g,e=>e.toUpperCase()),y=a=>a?new Date(a).toLocaleDateString("en-US",{month:"short",day:"numeric",year:"numeric"}):"N/A",T=a=>a?new Intl.NumberFormat("en-US",{style:"currency",currency:"USD",minimumFractionDigits:0}).format(a):"N/A",B=a=>{if(!a)return"N/A";const e=new Date(a),k=Math.abs(new Date-e),_=Math.ceil(k/(1e3*60*60*24)),p=Math.floor(_/365),v=Math.floor(_%365/30);return p>0?`${p} year${p>1?"s":""}, ${v} month${v>1?"s":""}`:`${v} month${v>1?"s":""}`};return P(()=>{N()}),(a,e)=>(r(),b(q,null,{header:n(()=>[d(Q,{title:s.value?s.value.name:"Asset Details",description:s.value?s.value.description||"Asset information and details":"Loading asset details...",breadcrumbs:[{text:"Assets",to:"/assets"},{text:s.value?s.value.name:"Loading...",to:null}]},G({_:2},[s.value?{name:"actions",fn:n(()=>[d(u(f),{variant:"secondary",size:"sm",onClick:H},{default:n(()=>e[1]||(e[1]=[t("svg",{class:"w-4 h-4 mr-2",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor"},[t("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M11 5H6a2 2 0 00-2 2v11a2 2 0 002 2h11a2 2 0 002-2v-5m-1.414-9.414a2 2 0 112.828 2.828L11.828 15H9v-2.828l8.586-8.586z"})],-1),m(" Edit Asset ",-1)])),_:1,__:[1]}),d(u(f),{variant:"primary",size:"sm",onClick:L},{default:n(()=>e[2]||(e[2]=[t("svg",{class:"w-4 h-4 mr-2",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor"},[t("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M12 6v6m0 0v6m0-6h6m-6 0H6"})],-1),m(" Create Work Order ",-1)])),_:1,__:[2]})]),key:"0"}:void 0]),1032,["title","description","breadcrumbs"])]),default:n(()=>[t("div",X,[x.value?(r(),i("div",Y,e[3]||(e[3]=[t("div",{class:"flex items-center space-x-2 text-gray-500"},[t("svg",{class:"w-8 h-8 animate-spin",fill:"none",viewBox:"0 0 24 24"},[t("circle",{class:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor","stroke-width":"4"}),t("path",{class:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"})]),t("span",null,"Loading asset details...")],-1)]))):s.value?(r(),i("div",J,[t("div",K,[t("div",tt,[t("div",et,[(r(),b(R(M.value),{class:"w-8 h-8 text-blue-600"}))]),t("div",null,[t("div",st,[d(u(h),{variant:V(s.value.status)},{default:n(()=>[m(o(j(s.value.status)),1)]),_:1},8,["variant"]),d(u(h),{variant:I(s.value.criticality)},{default:n(()=>[m(o(D(s.value.criticality)),1)]),_:1},8,["variant"]),t("span",at,"Asset #"+o(s.value.id),1)]),t("p",ot,o(s.value.description||"No description available"),1)])])]),t("div",rt,[t("div",nt,[t("div",it,[e[5]||(e[5]=t("div",{class:"flex-shrink-0"},[t("svg",{class:"w-8 h-8 text-green-600",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor"},[t("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M9 12l2 2 4-4m6 2a9 9 0 11-18 0 9 9 0 0118 0z"})])],-1)),t("div",lt,[e[4]||(e[4]=t("p",{class:"text-sm font-medium text-gray-500"},"Uptime",-1)),t("p",dt,o(s.value.uptime||"99.2")+"%",1)])])]),t("div",ct,[t("div",ut,[e[7]||(e[7]=t("div",{class:"flex-shrink-0"},[t("svg",{class:"w-8 h-8 text-blue-600",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor"},[t("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M12 8v4l3 3m6-3a9 9 0 11-18 0 9 9 0 0118 0z"})])],-1)),t("div",mt,[e[6]||(e[6]=t("p",{class:"text-sm font-medium text-gray-500"},"Last Maintenance",-1)),t("p",vt,o(y(s.value.lastMaintenance)),1)])])]),t("div",xt,[t("div",yt,[e[9]||(e[9]=t("div",{class:"flex-shrink-0"},[t("svg",{class:"w-8 h-8 text-yellow-600",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor"},[t("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M8 7V3m8 4V3m-9 8h10M5 21h14a2 2 0 002-2V7a2 2 0 00-2-2H5a2 2 0 00-2 2v12a2 2 0 002 2z"})])],-1)),t("div",pt,[e[8]||(e[8]=t("p",{class:"text-sm font-medium text-gray-500"},"Next Maintenance",-1)),t("p",gt,o(y(s.value.nextMaintenance)),1)])])]),t("div",ft,[t("div",ht,[e[11]||(e[11]=t("div",{class:"flex-shrink-0"},[t("svg",{class:"w-8 h-8 text-purple-600",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor"},[t("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M12 8c-1.657 0-3 .895-3 2s1.343 2 3 2 3 .895 3 2-1.343 2-3 2m0-8c1.11 0 2.08.402 2.599 1M12 8V7m0 1v8m0 0v1m0-1c-1.11 0-2.08-.402-2.599-1"})])],-1)),t("div",wt,[e[10]||(e[10]=t("p",{class:"text-sm font-medium text-gray-500"},"Asset Value",-1)),t("p",kt,o(T(s.value.value)),1)])])])]),t("div",_t,[t("div",bt,[t("nav",Ct,[(r(),i($,null,U(A,c=>t("button",{key:c.id,onClick:k=>l.value=c.id,class:W(["py-4 px-1 border-b-2 font-medium text-sm",l.value===c.id?"border-blue-500 text-blue-600":"border-transparent text-gray-500 hover:text-gray-700 hover:border-gray-300"])},o(c.label),11,At)),64))])]),t("div",Mt,[l.value==="overview"?(r(),i("div",Nt,[t("div",Ht,[t("div",null,[e[17]||(e[17]=t("h3",{class:"text-lg font-medium text-gray-900 mb-4"},"Basic Information",-1)),t("dl",Lt,[t("div",Vt,[e[12]||(e[12]=t("dt",{class:"text-sm font-medium text-gray-500"},"Category",-1)),t("dd",It,o(E(s.value.category)),1)]),t("div",jt,[e[13]||(e[13]=t("dt",{class:"text-sm font-medium text-gray-500"},"Model",-1)),t("dd",Dt,o(s.value.model||"N/A"),1)]),t("div",Et,[e[14]||(e[14]=t("dt",{class:"text-sm font-medium text-gray-500"},"Serial Number",-1)),t("dd",Tt,o(s.value.serialNumber||"N/A"),1)]),t("div",Bt,[e[15]||(e[15]=t("dt",{class:"text-sm font-medium text-gray-500"},"Location",-1)),t("dd",Ot,o(s.value.location||"N/A"),1)]),t("div",zt,[e[16]||(e[16]=t("dt",{class:"text-sm font-medium text-gray-500"},"Installation Date",-1)),t("dd",Pt,o(y(s.value.installDate)),1)])])]),t("div",null,[e[22]||(e[22]=t("h3",{class:"text-lg font-medium text-gray-900 mb-4"},"Technical Details",-1)),t("dl",St,[t("div",Ft,[e[18]||(e[18]=t("dt",{class:"text-sm font-medium text-gray-500"},"Manufacturer",-1)),t("dd",Rt,o(s.value.manufacturer||"N/A"),1)]),t("div",$t,[e[19]||(e[19]=t("dt",{class:"text-sm font-medium text-gray-500"},"Operating Hours",-1)),t("dd",Ut,o(s.value.operatingHours||"0")+" hrs",1)]),t("div",Wt,[e[20]||(e[20]=t("dt",{class:"text-sm font-medium text-gray-500"},"Warranty Status",-1)),t("dd",Zt,[d(u(h),{variant:s.value.warrantyActive?"success":"secondary"},{default:n(()=>[m(o(s.value.warrantyActive?"Active":"Expired"),1)]),_:1},8,["variant"])])]),t("div",Gt,[e[21]||(e[21]=t("dt",{class:"text-sm font-medium text-gray-500"},"Asset Age",-1)),t("dd",qt,o(B(s.value.installDate)),1)])])])])])):l.value==="maintenance"?(r(),i("div",Qt,e[23]||(e[23]=[t("div",{class:"text-center py-8 text-gray-500"},[t("svg",{class:"w-12 h-12 mx-auto mb-4 text-gray-300",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor"},[t("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M11 5H6a2 2 0 00-2 2v11a2 2 0 002 2h11a2 2 0 002-2v-5m-1.414-9.414a2 2 0 112.828 2.828L11.828 15H9v-2.828l8.586-8.586z"})]),t("p",{class:"text-lg font-medium"},"Maintenance History"),t("p",{class:"text-sm mt-1"},"Maintenance records and schedules will be displayed here")],-1)]))):l.value==="parts"?(r(),i("div",Xt,e[24]||(e[24]=[t("div",{class:"text-center py-8 text-gray-500"},[t("svg",{class:"w-12 h-12 mx-auto mb-4 text-gray-300",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor"},[t("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M19 11H5m14 0a2 2 0 012 2v6a2 2 0 01-2 2H5a2 2 0 01-2-2v-6a2 2 0 012-2m14 0V9a2 2 0 00-2-2M5 9a2 2 0 012-2m0 0V5a2 2 0 012-2h6a2 2 0 012 2v2M7 7h10"})]),t("p",{class:"text-lg font-medium"},"Parts & Inventory"),t("p",{class:"text-sm mt-1"},"Associated parts and spare inventory will be displayed here")],-1)]))):l.value==="workorders"?(r(),i("div",Yt,e[25]||(e[25]=[t("div",{class:"text-center py-8 text-gray-500"},[t("svg",{class:"w-12 h-12 mx-auto mb-4 text-gray-300",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor"},[t("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M9 5H7a2 2 0 00-2 2v10a2 2 0 002 2h8a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2"})]),t("p",{class:"text-lg font-medium"},"Work Orders"),t("p",{class:"text-sm mt-1"},"Associated work orders and service history will be displayed here")],-1)]))):l.value==="analytics"?(r(),i("div",Jt,e[26]||(e[26]=[t("div",{class:"text-center py-8 text-gray-500"},[t("svg",{class:"w-12 h-12 mx-auto mb-4 text-gray-300",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor"},[t("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M9 19v-6a2 2 0 00-2-2H5a2 2 0 00-2 2v6a2 2 0 002 2h2a2 2 0 002-2zm0 0V9a2 2 0 012-2h2a2 2 0 012 2v10m-6 0a2 2 0 002 2h2a2 2 0 002-2m0 0V5a2 2 0 012-2h2a2 2 0 012 2v14a2 2 0 01-2 2h-2a2 2 0 01-2-2z"})]),t("p",{class:"text-lg font-medium"},"Performance Analytics"),t("p",{class:"text-sm mt-1"},"Performance metrics and analytics will be displayed here")],-1)]))):Z("",!0)])])])):(r(),i("div",Kt,[e[28]||(e[28]=t("svg",{class:"w-12 h-12 mx-auto mb-4 text-red-300",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor"},[t("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M12 8v4m0 4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z"})],-1)),e[29]||(e[29]=t("h3",{class:"text-lg font-medium text-gray-900 mb-2"},"Asset Not Found",-1)),e[30]||(e[30]=t("p",{class:"text-gray-500 mb-4"},"The requested asset could not be found.",-1)),d(u(f),{onClick:e[0]||(e[0]=c=>a.$router.push("/assets"))},{default:n(()=>e[27]||(e[27]=[m(" Back to Assets ",-1)])),_:1,__:[27]})]))])]),_:1}))}},re=O(te,[["__scopeId","data-v-81ab7b3a"]]);export{re as default};