1import{a as f,r as m,j as t,M as C,T as M,A as h,m as E,B as g,C as S,D as T,E as A}from"./index-DY8EaXsZ.js";const v=[47.55,24.7],O=A.divIcon({className:"trail-vertex",html:'<span class="trail-vertex-dot"></span>',iconSize:[14,14],iconAnchor:[7,7]});function L({onAdd:s}){return T({click(e){s([e.latlng.lat,e.latlng.lng])}}),null}function $({value:s,onChange:e,color:x,contextTrails:o=[],contextPlaces:r=[]}){const{t:i}=f(),[d,j]=m.useState(!0),[p,u]=m.useState(!0),b=a=>e([...s,a]),w=(a,n)=>e(s.map((c,l)=>l===a?n:c)),N=()=>e(s.slice(0,-1)),y=()=>e([]),k=s[0]??v;return t.jsxs("div",{className:"trail-draw",children:[t.jsxs("div",{className:"trail-draw-toolbar",children:[t.jsx("span",{className:"trail-draw-hint",children:i("admin.trail.drawClickHint")}),t.jsxs("div",{className:"trail-draw-actions",children:[t.jsx("button",{type:"button",className:"btn-sec",onClick:N,disabled:s.length===0,children:i("admin.trail.drawUndo")}),t.jsx("button",{type:"button",className:"btn-sec",onClick:y,disabled:s.length===0,children:i("admin.trail.drawClear")}),t.jsx("span",{className:"trail-draw-count",children:i("admin.trail.drawPoints",{n:s.length})})]})]}),t.jsxs("div",{className:"pick-wrap",children:[t.jsxs(C,{center:k,zoom:12,scrollWheelZoom:!0,className:"trail-draw-map",children:[t.jsx(M,{url:"https://{s}.tile.opentopomap.org/{z}/{x}/{y}.png",attribution:"© OpenStreetMap, SRTM | © OpenTopoMap (CC-BY-SA)",maxZoom:17}),t.jsx(L,{onAdd:b}),d&&o.map(a=>a.path&&a.path.length>1?t.jsx(h,{positions:a.path,interactive:!1,pathOptions:{color:a.color||"#16a34a",weight:3,opacity:.4,dashArray:"5"}},`ctx-trail-${a.id}`):null),p&&r.map(a=>{const n=E(a.category);return t.jsx(g,{position:[a.lat,a.lng],icon:S((n==null?void 0:n.icon)??"ð",(n==null?void 0:n.color)??"#16a34a"),interactive:!1,opacity:.5},`ctx-place-${a.id}`)}),s.length>1&&t.jsx(h,{positions:s,pathOptions:{color:x,weight:4}}),s.map((a,n)=>t.jsx(g,{position:a,draggable:!0,icon:O,eventHandlers:{dragend:c=>{const l=c.target.getLatLng();w(n,[l.lat,l.lng])}}},n))]}),(o.length>0||r.length>0)&&t.jsxs("div",{className:"map-legend map-legend-sm",children:[o.length>0&&t.jsxs("button",{type:"button",className:`legend-item${d?"":" off"}`,onClick:()=>j(a=>!a),children:[t.jsx("span",{className:"legend-line",style:{background:"#16a34a"}}),i("admin.mapEdit.existingTrails")]}),r.length>0&&t.jsxs("button",{type:"button",className:`legend-item${p?"":" off"}`,onClick:()=>u(a=>!a),children:[t.jsx("span",{className:"legend-ico",style:{background:"#b45309"},children:"ð"}),i("admin.mapEdit.existingPoints")]})]})]})]})}export{$ 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.