PageSourceSearch

https://www.seanews.com.tr/assets/AdminVessels-Brkzib41.js

js seanews.com.tr collected 2026-10-02 11:17:53 UTC 23,470 bytes, 8 lines download raw bytes

1import{c as oe,a as Ne,r as u,b as Q,j as e,S as be,d as fe,I as n,B as m,X as W,t as y,e as we}from"./index-DvhEnGG3.js";import{u as Y}from"./useMutation-5Qt1sQt-.js";import{A as Ce}from"./AdminLayout-Zrrm2zl0.js";import{a as w}from"./adminAuth-DLSKqndo.js";import{T as Se,a as Te,b as O,c as G}from"./tabs-BQ2O5CL_.js";import{D as ie,b as ne,c as re,d as de}from"./dialog-g0Sakdt5.js";import{L as d}from"./label-DBJRttG9.js";import{T as $e}from"./textarea-BUxfkCtZ.js";import{F as H}from"./file-spreadsheet-BXRzKHy1.js";import{S as R}from"./square-pen-BDbEuy1P.js";import{T as _}from"./trash-2-DvlTil9x.js";import{S as ce}from"./save-DB7feI1a.js";import{A as ke}from"./arrow-up-down-vYNTzCbi.js";import{C as De}from"./chevron-left-DvroGTFD.js";import"./chart-column-DZJB8hAl.js";import"./file-text-DsmeFF5q.js";import"./folder-open-Dfep7Pji.js";import"./message-square-Dgp5wLTg.js";import"./video-Cp2pAFso.js";import"./book-open-BX1a14hQ.js";import"./trending-up-CmFiU1GD.js";import"./anchor-DHgUDgz1.js";import"./calendar-days-BeDpXHdp.js";import"./building-2-DUT4rmqF.js";import"./users-BdUbaTLb.js";import"./vote-oaa0C-Bt.js";const Fe=[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]],ze=oe("copy",Fe);const Pe=[["line",{x1:"4",x2:"20",y1:"9",y2:"9",key:"4lhtct"}],["line",{x1:"4",x2:"20",y1:"15",y2:"15",key:"vyu0kd"}],["line",{x1:"10",x2:"8",y1:"3",y2:"21",key:"1ggp8o"}],["line",{x1:"16",x2:"14",y1:"3",y2:"21",key:"weycgp"}]],Le=oe("hash",Pe),b=50;function Ie(l){const c="id,vesselName,vesselType,imoNumber,dwt,teu,cbm,buildYear,priceUsd,buyer",o=l.map(t=>`${t.id},${v(t.vesselName)},${v(t.vesselType)},${t.imoNumber||""},${t.dwt||""},${t.teu||""},${t.cbm||""},${t.buildYear||""},${t.priceUsd||""},${v(t.buyer||"")}`);return[c,...o].join(`
2`)}function Ue(l){const c="id,shipyard,vesselType,segment,subsegment,dwt,teu,cbm,sizeValue,sizeUnit,buyer,delivery,priceUsd,vesselCount",o=l.map(t=>`${t.id},${v(t.shipyard)},${v(t.vesselType)},${t.segment||""},${t.subsegment||""},${t.dwt||""},${t.teu||""},${t.cbm||""},${t.sizeValue||""},${t.sizeUnit||""},${v(t.buyer||"")},${t.delivery||""},${t.priceUsd||""},${t.vesselCount||1}`);return[c,...o].join(`
3`)}function Ve(l){const c="id,vesselName,vesselType,imoNumber,dwt,ldt,pricePerLdt,country",o=l.map(t=>`${t.id},${v(t.vesselName)},${v(t.vesselType)},${t.imoNumber||""},${t.dwt||""},${t.ldt||""},${t.pricePerLdt||""},${t.country||""}`);return[c,...o].join(`
4`)}function v(l){return l.includes(",")||l.includes('"')||l.includes(`
5`)?`"${l.replace(/"/g,'""')}"`:l}function J(l){const c=[];let o="",t=!1;for(let g=0;g<l.length;g++){const h=l[g];h==='"'?t&&l[g+1]==='"'?(o+='"',g++):t=!t:h===","&&!t?(c.push(o.trim()),o=""):o+=h}return c.push(o.trim()),c}function Ee(l){const c=l.trim().split(`
6`);return c.length<2?[]:c.slice(1).map(o=>{const t=J(o);return{id:t[0],vesselName:t[1],vesselType:t[2],imoNumber:t[3]||null,dwt:t[4]?parseInt(t[4]):null,teu:t[5]?parseInt(t[5]):null,cbm:t[6]?parseInt(t[6]):null,buildYear:t[7]?parseInt(t[7]):null,priceUsd:t[8]||null,buyer:t[9]||null}})}function Me(l){const c=l.trim().split(`
7`);return c.length<2?[]:c.slice(1).map(o=>{const t=J(o);return{id:t[0],shipyard:t[1],vesselType:t[2],segment:t[3]||null,subsegment:t[4]||null,dwt:t[5]?parseInt(t[5]):null,teu:t[6]?parseInt(t[6]):null,cbm:t[7]?parseInt(t[7]):null,sizeValue:t[8]?parseInt(t[8]):null,sizeUnit:t[9]||null,buyer:t[10]||null,delivery:t[11]||null,priceUsd:t[12]||null,vesselCount:t[13]?parseInt(t[13]):1}})}function qe(l){const c=l.trim().split(`
8`);return c.length<2?[]:c.slice(1).map(o=>{const t=J(o);return{id:t[0],vesselName:t[1],vesselType:t[2],imoNumber:t[3]||null,dwt:t[4]?parseInt(t[4]):null,ldt:t[5]?parseInt(t[5]):null,pricePerLdt:t[6]||null,country:t[7]||null}})}function xs(){const l=Ne(),[c,o]=u.useState("sales"),[t,g]=u.useState(""),[h,me]=u.useState("year"),[N,X]=u.useState("desc"),[x,U]=u.useState("none"),[a,i]=u.useState(null),[T,V]=u.useState(""),[E,$]=u.useState(1),[M,k]=u.useState(1),[q,D]=u.useState(1),[xe,F]=u.useState(!1),[z,C]=u.useState(""),[S,ue]=u.useState(""),pe=s=>{h===s?X(N==="asc"?"desc":"asc"):(me(s),X("asc")),$(1),k(1),D(1)},Z=s=>{U(x===s?"none":s),$(1),k(1),D(1)},{data:P,isLoading:he}=Q({queryKey:["/api/admin/vessels/sales",E,t,h,N,x],queryFn:async()=>{const s=new URLSearchParams({page:E.toString(),pageSize:b.toString()});t&&s.set("search",t),s.set("sortField",h),s.set("sortDir",N),x!=="none"&&s.set("duplicateFilter",x);const r=await w(`/api/admin/vessels/sales?${s}`);if(!r.ok)throw new Error("Failed to fetch");return r.json()}}),{data:L,isLoading:je}=Q({queryKey:["/api/admin/vessels/newbuildings",M,t,h,N,x],queryFn:async()=>{const s=new URLSearchParams({page:M.toString(),pageSize:b.toString()});t&&s.set("search",t),s.set("sortField",h),s.set("sortDir",N),x!=="none"&&s.set("duplicateFilter",x);const r=await w(`/api/admin/vessels/newbuildings?${s}`);if(!r.ok)throw new Error("Failed to fetch");return r.json()}}),{data:I,isLoading:ye}=Q({queryKey:["/api/admin/vessels/demolitions",q,t,h,N,x],queryFn:async()=>{const s=new URLSearchParams({page:q.toString(),pageSize:b.toString()});t&&s.set("search",t),s.set("sortField",h),s.set("sortDir",N),x!=="none"&&s.set("duplicateFilter",x);const r=await w(`/api/admin/vessels/demolitions?${s}`);if(!r.ok)throw new Error("Failed to fetch");return r.json()}}),ee=P?.data||[],se=L?.data||[],te=I?.data||[],K=Y({mutationFn:async({type:s,id:r})=>{if(!(await w(`/api/admin/vessels/${s}/${r}`,{method:"DELETE"})).ok)throw new Error("Failed to delete")},onSuccess:()=>
8{y.success("Silindi"),l.invalidateQueries({queryKey:["/api/admin/vessels/sales"]}),l.invalidateQueries({queryKey:["/api/admin/vessels/newbuildings"]}),l.invalidateQueries({queryKey:["/api/admin/vessels/demolitions"]})},onError:()=>y.error("Silme hatası")}),ae=Y({mutationFn:async({type:s,id:r,data:j})=>{if(!(await w(`/api/admin/vessels/${s}/${r}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(j)})).ok)throw new Error("Failed to update")},onSuccess:()=>{y.success("Güncellendi"),i(null),l.invalidateQueries({queryKey:["/api/admin/vessels/sales"]}),l.invalidateQueries({queryKey:["/api/admin/vessels/newbuildings"]}),l.invalidateQueries({queryKey:["/api/admin/vessels/demolitions"]})},onError:()=>y.error("Güncelleme hatası")}),le=Y({mutationFn:async({type:s,data:r})=>{const j=await w(`/api/admin/vessels/${s}/bulk`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({items:r})});if(!j.ok){const f=await j.json();throw new Error(f.error||"Failed to bulk update")}return j.json()},onSuccess:s=>{y.success(`${s.updated} kayıt güncellendi`),F(!1),C(""),l.invalidateQueries({queryKey:["/api/admin/vessels/sales"]}),l.invalidateQueries({queryKey:["/api/admin/vessels/newbuildings"]}),l.invalidateQueries({queryKey:["/api/admin/vessels/demolitions"]})},onError:s=>y.error(s.message||"Toplu güncelleme hatası")}),A=(s,r)=>{ue(s),C(s==="sales"?Ie(r):s==="newbuildings"?Ue(r):Ve(r)),F(!0)},ve=()=>{try{let s;if(S==="sales"?s=Ee(z):S==="newbuildings"?s=Me(z):s=qe(z),s.length===0){y.error("CSV boş veya geçersiz");return}le.mutate({type:S,data:s})}catch{y.error("Geçersiz CSV formatı")}},p=({field:s,label:r})=>e.jsx("th",{className:"px-3 py-2 text-left cursor-pointer hover:bg-gray-100 select-none",onClick:()=>pe(s),children:e.jsxs("div",{className:"flex items-center gap-1",children:[r,e.jsx(ke,{className:"w-3 h-3"})]})}),B=({page:s,totalPages:r,total:j,onPageChange:f})=>e.jsxs("div",{className:"flex items-center justify-between mt-4 px-2",children:[e.jsxs("span",{className:"text-sm text-gray-600",children:["Toplam ",j," kayıt, Sayfa ",s," / ",r||1]}),e.jsxs("div",{className:"flex gap-2",children:[e.jsx(m,{size:"sm",variant:"outline",disabled:s<=1,onClick:()=>f(s-1),children:e.jsx(De,{className:"w-4 h-4"})}),e.jsx(m,{size:"sm",variant:"outline",disabled:s>=r,onClick:()=>f(s+1),children:e.jsx(we,{className:"w-4 h-4"})})]})]});return e.jsx(Ce,{children:e.jsxs("div",{className:"p-6",children:[e.jsxs("div",{className:"flex items-center justify-between mb-4",children:[e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx(be,{className:"w-8 h-8 text-blue-600"}),e.jsx("h1",{className:"text-2xl font-bold",children:"Gemi Yönetimi"})]}),e.jsxs("div",{className:"relative",children:[e.jsx(fe,{className:"absolute left-3 top-1/2 -translate-y-1/2 w-4 h-4 text-gray-400"}),e.jsx(n,{placeholder:"Ara...",value:t,onChange:s=>{g(s.target.value),$(1),k(1),D(1)},className:"pl-10 w-64","data-testid":"input-search-vessels"})]})]}),e.jsxs("div",{className:"flex items-center gap-2 mb-4 p-3 bg-gray-50 rounded-lg border",children:[e.jsx("span",{className:"text-sm font-medium text-gray-700 mr-2",children:"Mükerrer Kayıt Filtresi:"}),e.jsxs(m,{size:"sm",variant:x==="name"?"default":"outline",onClick:()=>Z("name"),"data-testid":"button-duplicate-name",children:[e.jsx(ze,{className:"w-4 h-4 mr-1"}),"Aynı İsim"]}),e.jsxs(m,{size:"sm",variant:x==="imo"?"default":"outline",onClick:()=>Z("imo"),"data-testid":"button-duplicate-imo",children:[e.jsx(Le,{className:"w-4 h-4 mr-1"}),"Aynı IMO"]}),x!=="none"&&e.jsxs(m,{size:"sm",variant:"ghost",onClick:()=>U("none"),className:"text-red-500",children:[e.jsx(W,{className:"w-4 h-4 mr-1"}),"Filtreyi Kaldır"]})]}),e.jsxs(Se,{value:c,onValueChange:o,children:[e.jsxs(Te,{children:[e.jsxs(O,{value:"sales","data-testid":"tab-sales",children:["Second Hand (",P?.total||0,")"]}),e.jsxs(O,{value:"newbuildings","data-testid":"tab-newbuildings",children:["Newbuilding (",L?.total||0,")"]}),e.jsxs(O,{value:"demolitions","data-testid":"tab-demolitions",children:["Demolition (",I?.total||0,")"]})]}),e.jsxs(G,{value:"sales",className:"mt-4",children:[e.jsx("div",{className:"flex justify-end mb-2",children:e.jsxs(m,{variant:"outline",size:"sm",onClick:()=>A("sales",ee),"data-testid":"button-csv-sales",children:[e.jsx(H,{className:"w-4 h-4 mr-1"})," CSV Düzenle (",b,")"]})}),he?e.jsx("p",{children:"Yükleniyor..."}):e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"overflow-x-auto border rounded-lg",children:e.jsxs("table",{className:"w-full text-sm",children:[e.jsx("thead",{className:"bg-gray-50",children:e.jsxs("tr",{children:[e.jsx("th",{className:"px-3 py-2 text-left",children:"Week"}),e.jsx(p,{field:"vesselName",label:"Vessel Name"}),e.jsx(p,{field:"vesselType",label:"Type"}),e.jsx(p,{field:"imoNumber",label:"IMO"}),e.jsx(p,{field:"dwt",label:"DWT"}),e.jsx("th",{className:"px-3 py-2 text-left",children:"TEU"}),e.jsx("th",{className:"px-3 py-2 text-left",children:"CBM"}),e.jsx("th",{className:"px-3 py-2 text-left",children:"Built"}),e.jsx("th",{className:"px-3 py-2 text-left",children:"Price ($M)"}),e.jsx(p,{field:"buyer",label:"Buyer"}),e.jsx("th",{className:"px-3 py-2 text-center",children:"Actions"})]})}),e.jsx("tbody",{children:ee.map(s=>e.jsxs("tr",{className:"border-t hover:bg-gray-50","data-testid":`row-sale-${s.id}`,children:[e.jsx("td",{className:"px-3 py-2 text-xs text-gray-600",children:s.year&&s.weekNumber?`${s.year}-W${String(s.weekNumber).padStart(2,"0")}`:"-"}),e.jsx("td",{className:"px-3 py-2 font-medium","data-testid":`text-vessel-${s.id}`,children:s.vesselName}),e.jsx("td",{className:"px-3 py-2",children:s.vesselType}),e.jsx("td",{className:"px-3 py-2","data-testid":`text-imo-${s.id}`,children:s.imoNumber||"-"}
8),e.jsx("td",{className:"px-3 py-2",children:s.dwt?.toLocaleString()||"-"}),e.jsx("td",{className:"px-3 py-2",children:s.teu?.toLocaleString()||"-"}),e.jsx("td",{className:"px-3 py-2",children:s.cbm?.toLocaleString()||"-"}),e.jsx("td",{className:"px-3 py-2",children:s.buildYear||"-"}),e.jsx("td",{className:"px-3 py-2",children:s.priceUsd?(parseFloat(s.priceUsd)/1e6).toFixed(2):"-"}),e.jsx("td",{className:"px-3 py-2",children:s.buyer||"-"}),e.jsx("td",{className:"px-3 py-2 text-center",children:e.jsxs("div",{className:"flex justify-center gap-1",children:[e.jsx(m,{size:"sm",variant:"ghost","data-testid":`button-edit-sale-${s.id}`,onClick:()=>{i(s),V("sales")},children:e.jsx(R,{className:"w-4 h-4"})}),e.jsx(m,{size:"sm",variant:"ghost",className:"text-red-600 hover:text-red-700","data-testid":`button-delete-sale-${s.id}`,onClick:()=>{confirm(`${s.vesselName} silinsin mi?`)&&K.mutate({type:"sales",id:s.id})},children:e.jsx(_,{className:"w-4 h-4"})})]})})]},s.id))})]})}),e.jsx(B,{page:E,totalPages:P?.totalPages||1,total:P?.total||0,onPageChange:$})]})]}),e.jsxs(G,{value:"newbuildings",className:"mt-4",children:[e.jsx("div",{className:"flex justify-end mb-2",children:e.jsxs(m,{variant:"outline",size:"sm",onClick:()=>A("newbuildings",se),"data-testid":"button-csv-newbuildings",children:[e.jsx(H,{className:"w-4 h-4 mr-1"})," CSV Düzenle (",b,")"]})}),je?e.jsx("p",{children:"Yükleniyor..."}):e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"overflow-x-auto border rounded-lg",children:e.jsxs("table",{className:"w-full text-sm",children:[e.jsx("thead",{className:"bg-gray-50",children:e.jsxs("tr",{children:[e.jsx("th",{className:"px-3 py-2 text-left",children:"Week"}),e.jsx(p,{field:"shipyard",label:"Shipyard"}),e.jsx(p,{field:"vesselType",label:"Type"}),e.jsx("th",{className:"px-3 py-2 text-left",children:"Segment"}),e.jsx("th",{className:"px-3 py-2 text-left",children:"DWT"}),e.jsx("th",{className:"px-3 py-2 text-left",children:"TEU"}),e.jsx("th",{className:"px-3 py-2 text-left",children:"CBM"}),e.jsx(p,{field:"buyer",label:"Buyer"}),e.jsx("th",{className:"px-3 py-2 text-left",children:"Delivery"}),e.jsx("th",{className:"px-3 py-2 text-left",children:"Count"}),e.jsx("th",{className:"px-3 py-2 text-left",children:"Price ($M)"}),e.jsx("th",{className:"px-3 py-2 text-center",children:"Actions"})]})}),e.jsx("tbody",{children:se.map(s=>e.jsxs("tr",{className:"border-t hover:bg-gray-50","data-testid":`row-nb-${s.id}`,children:[e.jsx("td",{className:"px-3 py-2 text-xs text-gray-600",children:s.year&&s.weekNumber?`${s.year}-W${String(s.weekNumber).padStart(2,"0")}`:"-"}),e.jsx("td",{className:"px-3 py-2 font-medium",children:s.shipyard}),e.jsx("td",{className:"px-3 py-2",children:s.vesselType}),e.jsx("td",{className:"px-3 py-2",children:s.segment||"-"}),e.jsx("td",{className:"px-3 py-2",children:s.dwt?.toLocaleString()||"-"}),e.jsx("td",{className:"px-3 py-2",children:s.teu?.toLocaleString()||"-"}),e.jsx("td",{className:"px-3 py-2",children:s.cbm?.toLocaleString()||"-"}),e.jsx("td",{className:"px-3 py-2",children:s.buyer||"-"}),e.jsx("td",{className:"px-3 py-2",children:s.delivery||"-"}),e.jsx("td",{className:"px-3 py-2",children:s.vesselCount||1}),e.jsx("td",{className:"px-3 py-2",children:s.priceUsd?(parseFloat(s.priceUsd)/1e6).toFixed(2):"-"}),e.jsx("td",{className:"px-3 py-2 text-center",children:e.jsxs("div",{className:"flex justify-center gap-1",children:[e.jsx(m,{size:"sm",variant:"ghost","data-testid":`button-edit-nb-${s.id}`,onClick:()=>{i(s),V("newbuildings")},children:e.jsx(R,{className:"w-4 h-4"})}),e.jsx(m,{size:"sm",variant:"ghost",className:"text-red-600 hover:text-red-700","data-testid":`button-delete-nb-${s.id}`,onClick:()=>{confirm(`${s.shipyard} - ${s.vesselType} silinsin mi?`)&&K.mutate({type:"newbuildings",id:s.id})},children:e.jsx(_,{className:"w-4 h-4"})})]})})]},s.id))})]})}),e.jsx(B,{page:M,totalPages:L?.totalPages||1,total:L?.total||0,onPageChange:k})]})]}),e.jsxs(G,{value:"demolitions",className:"mt-4",children:[e.jsx("div",{className:"flex justify-end mb-2",children:e.jsxs(m,{variant:"outline",size:"sm",onClick:()=>A("demolitions",te),"data-testid":"button-csv-demolitions",children:[e.jsx(H,{className:"w-4 h-4 mr-1"})," CSV Düzenle (",b,")"]})}),ye?e.jsx("p",{children:"Yükleniyor..."}):e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"overflow-x-auto border rounded-lg",children:e.jsxs("table",{className:"w-full text-sm",children:[e.jsx("thead",{className:"bg-gray-50",children:e.jsxs("tr",{children:[e.jsx("th",{className:"px-3 py-2 text-left",children:"Week"}),e.jsx(p,{field:"vesselName",label:"Vessel Name"}),e.jsx(p,{field:"vesselType",label:"Type"}),e.jsx(p,{field:"imoNumber",label:"IMO"}),e.jsx(p,{field:"dwt",label:"DWT"}),e.jsx("th",{className:"px-3 py-2 text-left",children:"LDT"}),e.jsx("th",{className:"px-3 py-2 text-left",children:"$/LDT"}),e.jsx("th",{className:"px-3 py-2 text-left",children:"Country"}),e.jsx("th",{className:"px-3 py-2 text-center",children:"Actions"})]})}),e.jsx("tbody",{children:te.map(s=>e.jsxs("tr",{className:"border-t hover:bg-gray-50","data-testid":`row-demo-${s.id}`,children:[e.jsx("td",{className:"px-3 py-2 text-xs text-gray-600",children:s.year&&s.weekNumber?`${s.year}-W${String(s.weekNumber).padStart(2,"0")}`:"-"}),e.jsx("td",{className:"px-3 py-2 font-medium","data-testid":`text-vessel-${s.id}`,children:s.vesselName}),e.jsx("td",{className:"px-3 py-2",children:s.vesselType}),e.jsx("td",{className:"px-3 py-2","data-testid":`text-imo-${s.id}`,children:s.imoNumber||"-"}
8),e.jsx("td",{className:"px-3 py-2",children:s.dwt?.toLocaleString()||"-"}),e.jsx("td",{className:"px-3 py-2",children:s.ldt?.toLocaleString()||"-"}),e.jsx("td",{className:"px-3 py-2",children:s.pricePerLdt||"-"}),e.jsx("td",{className:"px-3 py-2",children:s.country||"-"}),e.jsx("td",{className:"px-3 py-2 text-center",children:e.jsxs("div",{className:"flex justify-center gap-1",children:[e.jsx(m,{size:"sm",variant:"ghost","data-testid":`button-edit-demo-${s.id}`,onClick:()=>{i(s),V("demolitions")},children:e.jsx(R,{className:"w-4 h-4"})}),e.jsx(m,{size:"sm",variant:"ghost",className:"text-red-600 hover:text-red-700","data-testid":`button-delete-demo-${s.id}`,onClick:()=>{confirm(`${s.vesselName} silinsin mi?`)&&K.mutate({type:"demolitions",id:s.id})},children:e.jsx(_,{className:"w-4 h-4"})})]})})]},s.id))})]})}),e.jsx(B,{page:q,totalPages:I?.totalPages||1,total:I?.total||0,onPageChange:D})]})]})]}),e.jsx(ie,{open:xe,onOpenChange:F,children:e.jsxs(ne,{className:"max-w-4xl max-h-[90vh] overflow-y-auto",children:[e.jsx(re,{children:e.jsxs(de,{children:["CSV Düzenle - ",S==="sales"?"Second Hand":S==="newbuildings"?"Newbuilding":"Demolition"]})}),e.jsxs("div",{className:"space-y-4",children:[e.jsxs("p",{className:"text-sm text-gray-500",children:["Bu sayfadaki ",b," kaydı CSV formatında düzenleyebilirsiniz. İlk satır başlıktır, değiştirmeyin."]}),e.jsx($e,{value:z,onChange:s=>C(s.target.value),className:"font-mono text-xs h-[400px]","data-testid":"textarea-csv-edit"}),e.jsxs("div",{className:"flex justify-end gap-2",children:[e.jsxs(m,{variant:"outline",onClick:()=>F(!1),children:[e.jsx(W,{className:"w-4 h-4 mr-1"})," İptal"]}),e.jsxs(m,{onClick:ve,disabled:le.isPending,children:[e.jsx(ce,{className:"w-4 h-4 mr-1"})," Kaydet"]})]})]})]})}),e.jsx(ie,{open:!!a,onOpenChange:()=>i(null),children:e.jsxs(ne,{children:[e.jsx(re,{children:e.jsx(de,{children:"Düzenle"})}),a&&e.jsxs("div",{className:"space-y-4",children:[T==="sales"&&e.jsxs(e.Fragment,{children:[e.jsxs("div",{children:[e.jsx(d,{children:"Vessel Name"}),e.jsx(n,{value:a.vesselName||"",onChange:s=>i({...a,vesselName:s.target.value})})]}),e.jsxs("div",{children:[e.jsx(d,{children:"Vessel Type"}),e.jsx(n,{value:a.vesselType||"",onChange:s=>i({...a,vesselType:s.target.value})})]}),e.jsxs("div",{className:"grid grid-cols-3 gap-2",children:[e.jsxs("div",{children:[e.jsx(d,{children:"DWT"}),e.jsx(n,{type:"number",value:a.dwt||"",onChange:s=>i({...a,dwt:s.target.value?parseInt(s.target.value):null})})]}),e.jsxs("div",{children:[e.jsx(d,{children:"TEU"}),e.jsx(n,{type:"number",value:a.teu||"",onChange:s=>i({...a,teu:s.target.value?parseInt(s.target.value):null})})]}),e.jsxs("div",{children:[e.jsx(d,{children:"CBM"}),e.jsx(n,{type:"number",value:a.cbm||"",onChange:s=>i({...a,cbm:s.target.value?parseInt(s.target.value):null})})]})]}),e.jsxs("div",{className:"grid grid-cols-2 gap-2",children:[e.jsxs("div",{children:[e.jsx(d,{children:"Price (USD)"}),e.jsx(n,{value:a.priceUsd||"",onChange:s=>i({...a,priceUsd:s.target.value})})]}),e.jsxs("div",{children:[e.jsx(d,{children:"Vessel Count"}),e.jsx(n,{type:"number",value:a.vesselCount||"",onChange:s=>i({...a,vesselCount:s.target.value?parseInt(s.target.value):1})})]})]}),e.jsxs("div",{children:[e.jsx(d,{children:"Buyer"}),e.jsx(n,{value:a.buyer||"",onChange:s=>i({...a,buyer:s.target.value})})]})]}),T==="newbuildings"&&e.jsxs(e.Fragment,{children:[e.jsxs("div",{children:[e.jsx(d,{children:"Shipyard"}),e.jsx(n,{value:a.shipyard||"",onChange:s=>i({...a,shipyard:s.target.value})})]}),e.jsxs("div",{children:[e.jsx(d,{children:"Vessel Type"}),e.jsx(n,{value:a.vesselType||"",onChange:s=>i({...a,vesselType:s.target.value})})]}),e.jsxs("div",{className:"grid grid-cols-2 gap-2",children:[e.jsxs("div",{children:[e.jsx(d,{children:"Segment"}),e.jsx(n,{value:a.segment||"",onChange:s=>i({...a,segment:s.target.value})})]}),e.jsxs("div",{children:[e.jsx(d,{children:"Subsegment"}),e.jsx(n,{value:a.subsegment||"",onChange:s=>i({...a,subsegment:s.target.value})})]})]}),e.jsxs("div",{className:"grid grid-cols-3 gap-2",children:[e.jsxs("div",{children:[e.jsx(d,{children:"DWT"}),e.jsx(n,{type:"number",value:a.dwt||"",onChange:s=>i({...a,dwt:s.target.value?parseInt(s.target.value):null})})]}),e.jsxs("div",{children:[e.jsx(d,{children:"TEU"}),e.jsx(n,{type:"number",value:a.teu||"",onChange:s=>i({...a,teu:s.target.value?parseInt(s.target.value):null})})]}),e.jsxs("div",{children:[e.jsx(d,{children:"CBM"}),e.jsx(n,{type:"number",value:a.cbm||"",onChange:s=>i({...a,cbm:s.target.value?parseInt(s.target.value):null})})]})]}),e.jsxs("div",{className:"grid grid-cols-2 gap-2",children:[e.jsxs("div",{children:[e.jsx(d,{children:"Price (USD)"}),e.jsx(n,{value:a.priceUsd||"",onChange:s=>i({...a,priceUsd:s.target.value})})]}),e.jsxs("div",{children:[e.jsx(d,{children:"Vessel Count"}),e.jsx(n,{type:"number",value:a.vesselCount||"",onChange:s=>i({...a,vesselCount:s.target.value?parseInt(s.target.value):1})})]})]}),e.jsxs("div",{children:[e.jsx(d,{children:"Buyer"}),e.jsx(n,{value:a.buyer||"",onChange:s=>i({...a,buyer:s.target.value})})]})]}),T==="demolitions"&&e.jsxs(e.Fragment,{children:[e.jsxs("div",{children:[e.jsx(d,{children:"Vessel Name"}),e.jsx(n,{value:a.vesselName||"",onChange:s=>i({...a,vesselName:s.target.value})})]}),e.jsxs("div",{children:[e.jsx(d,{children:"Vessel Type"}),e.jsx(n,{value:a.vesselType||"",onChange:s=>i({...a,vesselType:s.target.value})})]}),e.jsxs("div",{className:"grid grid-cols-2 gap-2",children:[e.jsxs("div",{children:[e.jsx(d,{children:"DWT"}),e.jsx(n,{type:"number",value:a.dwt||"",onChange:s=>i({...a,dwt:s.target.value?parseInt(s.target.value):null})})]}),e.jsxs("div",{children:[e.jsx(d,{children:"LDT"}),e.jsx(n,{type:"number",value:a.ldt||"",onChange:s=>i({...a,ldt:s.target.value?parseInt(s.target.value):null})})]})]}),e.jsxs("div",{className:"grid grid-cols-2 gap-2",children:[e.jsxs("div",{children:[e.jsx(d,{children:"$/LDT"}),e.jsx(n,{value:a.pricePerLdt||"",onChange:s=>i({...a,pricePerLdt:s.target.value})})]}),e.jsxs("div",{children:[e.jsx(d,{children:"Country"}),e.jsx(n,{value:a.country||"",onChange:s=>i({...a,country:s.target.value})})]})]})]}),e.jsxs("div",{className:"flex justify-end gap-2",children:[e.jsxs(m,{variant:"outline",onClick:()=>i(null),children:[e.jsx(W,{className:"w-4 h-4 mr-1"})," İptal"]}),e.jsxs(m,{onClick:()=>{const{id:s,reportId:r,year:j,weekNumber:f,...ge}=a;ae.mutate({type:T,id:s,data:ge})},disabled:ae.isPending,children:[e.jsx(ce,{className:"w-4 h-4 mr-1"})," Kaydet"]})]})]})]})})]})})}export{xs 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.