PageSourceSearch

https://plinth.dk/assets/SummaryTopDown2--VTzJNgc.js

js plinth.dk collected 2026-10-09 22:03:25 UTC 6,522 bytes, 1 lines download raw bytes

1import{j as a,m as E,v as W,r as A}from"./index-CaaAh96A.js";import{B}from"./button-BLYyAQOb.js";import{L as $}from"./LogoLink-Cm0BpZV4.js";import{A as _}from"./arrow-left-Cj0Uupg4.js";const S=(e,t)=>{if(!e)return t;const l=e.match(/(\d+)/);return l?parseInt(l[1])/10:t},I=e=>{var t;return((t=e.module_code)==null?void 0:t.includes("HJS-"))??!1},b=(e,t=60)=>e.module.custom_width&&e.module.custom_width>0?e.module.custom_width:S(e.module.width,t),k=(e,t=60)=>S(e.module.depth,t);function j(e,t=60){return!e||e.modules.length===0?t:Math.max(...e.modules.map(l=>k(l)))}function v(e,t=60){return e?Math.max(b(e.module,t),k(e.module,t)):t}function M(e,t,l){let r=t;return e.modules.map(o=>{const s=b(o),i=k(o),m={pm:o,x:r,y:l-i,w:s,h:i,rot:0,wCm:s,dCm:i};return r+=s,m})}function H(e,t,l){let r=l;return e.modules.map(o=>{const s=b(o),i=k(o),m={pm:o,x:t,y:r-s,w:i,h:s,rot:-90,wCm:s,dCm:i};return r-=s,m})}function T(e,t,l){let r=l;return e.modules.map(o=>{const s=b(o),i=k(o),m={pm:o,x:t-i,y:r-s,w:i,h:s,rot:90,wCm:s,dCm:i};return r-=s,m})}function L(e){var l,r,o,s,i,m,c,p,N,d;const t=[];if(e.shapeType==="String"||e.shapeType==="Island"){const n=e.single,u=j(n),w=n.lengthCm||n.modules.reduce((x,h)=>x+b(h),0);return t.push(...M(n,0,u)),{bboxW:Math.max(w,n.modules.reduce((x,h)=>x+b(h),0)),bboxH:u,placements:t}}if(e.shapeType==="L"){const n=v(e.corner1);j(e.sideA),j(e.sideB);const u=((l=e.sideA)==null?void 0:l.lengthCm)||((r=e.sideA)==null?void 0:r.modules.reduce((C,f)=>C+b(f),0))||0,w=((o=e.sideB)==null?void 0:o.lengthCm)||((s=e.sideB)==null?void 0:s.modules.reduce((C,f)=>C+b(f),0))||0,x=u+n,h=w+n;return e.sideA&&t.push(...M(e.sideA,0,h)),e.corner1&&t.push({pm:e.corner1.module,x:u,y:h-n,w:n,h:n,rot:0,wCm:n,dCm:n}),e.sideB&&t.push(...T(e.sideB,x,h-n)),{bboxW:x,bboxH:h,placements:t}}if(e.shapeType==="U"){const n=v(e.corner1),u=v(e.corner2);j(e.sideA),j(e.middle),j(e.sideB);const w=((i=e.sideA)==null?void 0:i.lengthCm)||((m=e.sideA)==null?void 0:m.modules.reduce((y,g)=>y+b(g),0))||0,x=((c=e.middle)==null?void 0:c.lengthCm)||((p=e.middle)==null?void 0:p.modules.reduce((y,g)=>y+b(g),0))||0,h=((N=e.sideB)==null?void 0:N.lengthCm)||((d=e.sideB)==null?void 0:d.modules.reduce((y,g)=>y+b(g),0))||0,C=n+x+u,f=Math.max(w,h)+Math.max(n,u);return e.corner1&&t.push({pm:e.corner1.module,x:0,y:f-n,w:n,h:n,rot:0,wCm:n,dCm:n}),e.middle&&t.push(...M(e.middle,n,f)),e.corner2&&t.push({pm:e.corner2.module,x:n+x,y:f-u,w:u,h:u,rot:0,wCm:u,dCm:u}),e.sideA&&t.push(...H(e.sideA,0,f-n)),e.sideB&&t.push(...T(e.sideB,C,f-u)),{bboxW:C,bboxH:f,placements:t}}return{bboxW:0,bboxH:0,placements:[]}}function P(e,t){const l={String:"Lige",L:"L-formet",U:"U-formet",Island:"Køkken-ø"},r=o=>o.reduce((s,i)=>s+b(i),0);return e.map((o,s)=>{const i=(t[s]||[]).slice().sort((d,n)=>d.position-n.position),m=i.filter(d=>I(d.module)),c=i.filter(d=>!I(d.module)),p=o.lengths||{},N={title:`Sektion ${s+1}`,shapeLabel:l[o.type]||o.type,shapeType:o.type};if(o.type==="L"){const d=m[0],n=d?v({module:d}):0,u=(d==null?void 0:d.position)??Number.POSITIVE_INFINITY,w=c.filter(h=>h.position<u),x=c.filter(h=>h.position>=u);return{...N,sideA:{modules:w,lengthCm:Math.max(0,(p.length1||0)-n)||r(w)},sideB:{modules:x,lengthCm:Math.max(0,(p.length2||0)-n)||r(x)},corner1:d?{module:d}:void 0}}if(o.type==="U"){const d=m[0],n=m[1],u=d?v({module:d}):0,w=n?v({module:n}):0,x=(d==null?void 0:d.position)??Number.POSITIVE_INFINITY,h=(n==null?void 0:n.position)??Number.POSITIVE_INFINITY,C=c.filter(g=>g.position<x),f=c.filter(g=>g.position>=x&&g.position<h),y=c.filter(g=>g.position>=h);return{...N,sideA:{modules:C,lengthCm:Math.max(0,(p.length2||0)-u)||r(C)},middle:{modules:f,lengthCm:Math.max(0,(p.length1||0)-u-w)||r(f)},sideB:{modules:y,lengthCm:Math.max(0,(p.length3||0)-w)||r(y)},corner1:d?{module:d}:void 0,corner2:n?{module:n}:void 0}}return{...N,single:{modules:c,lengthCm:p.length1||r(c)}}})}function V(e,t){let l=0;for(const s of e){const i=L(s);l=Math.max(l,i.bboxW)}if(l<=0)return 2;const o=Math.max(200,t-80)/l;return Math.max(.6,Math.min(o,4))}const z=({p:e,s:t})=>{var i;const l=((i=e.pm)==null?void 0:i.module.image_top_down)||null;let r="";if(e.rot===0)r=`translate(${e.x*t}, ${e.y*t})`;else if(e.rot===90){const m=(e.x+e.w)*t,c=e.y*t;r=`translate(${m}, ${c}) rotate(90)`}else if(e.rot===-90){const m=e.x*t,c=(e.y+e.h)*t;r=`translate(${m}, ${c}) rotate(-90)`}const o=e.wCm*t,s=e.dCm*t;return a.jsx("g",{transform:r,children:l&&a.jsx("image",{href:l,x:0,y:0,width:o,height:s,preserveAspectRatio:"xMidYMid meet"})})},R=({sections:e,pxPerCm:t})=>a.jsx("div",{className:"space-y-16",children:e.map((l,r)=>{const o=L(l),s=16,i=o.bboxW*t+s*2,m=o.bboxH*t+s*2;return a.jsxs("section",{className:"border border-black p-6 md:p-8 bg-white",children:[a.jsx("header",{className:"mb-6 pb-4 border-b border-black",children:a.jsxs("h2",{className:"text-lg font-light tracking-wider up
1percase",children:[l.title," — ",l.shapeLabel]})}),a.jsx("svg",{viewBox:`0 0 ${i} ${m}`,width:i,height:m,style:{display:"block",maxWidth:"100%",height:"auto"},children:a.jsx("g",{transform:`translate(${s}, ${s})`,children:o.placements.map((c,p)=>a.jsx(z,{p:c,s:t},p))})})]},r)})}),G=()=>{const e=E(),{shapes:t,shapeModules:l}=W(),r=A.useRef(null),[o,s]=A.useState(900);A.useEffect(()=>{const c=()=>{if(r.current){const p=r.current.clientWidth;s(Math.max(320,p-64))}};return c(),window.addEventListener("resize",c),()=>window.removeEventListener("resize",c)},[]);const i=P(t,l),m=V(i,o);return a.jsxs("div",{className:"min-h-screen bg-white",children:[a.jsx("header",{className:"border-b border-black",children:a.jsx("div",{className:"max-w-6xl mx-auto px-4 py-6",children:a.jsxs("div",{className:"flex flex-col items-center gap-4",children:[a.jsx($,{}),a.jsx("h1",{className:"text-2xl md:text-3xl font-light tracking-wide uppercase",children:"Teknisk planvisning"}),a.jsx("p",{className:"text-sm text-black font-light",children:"Top/down af alle sektioner — original SVG-skala"}),a.jsxs(B,{variant:"outline",onClick:()=>e("/designer/summary"),className:"mt-2 rounded-none border-black",children:[a.jsx(_,{className:"w-4 h-4 mr-2"}),"Tilbage til oversigt"]})]})})}),a.jsx("main",{className:"max-w-6xl mx-auto px-4 py-12",ref:r,children:i.length===0?a.jsxs("div",{className:"text-center py-16 text-black",children:[a.jsx("p",{children:"Ingen sektioner konfigureret endnu."}),a.jsx(B,{variant:"outline",onClick:()=>e("/designer/step2"),className:"mt-4 rounded-none border-black",children:"Gå til sektioner"})]}):a.jsx(R,{sections:i,pxPerCm:m})})]})};export{G 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.