PageSourceSearch

https://boinspekt.se/static/js/5730.9a7da9f3.chunk.js

js boinspekt.se collected 2026-09-24 15:11:19 UTC 59,305 bytes, 1 lines download raw bytes

1"use strict";(self.webpackChunkKBPortal=self.webpackChunkKBPortal||[]).push([[5730],{87770(n,e,t){t.d(e,{A:()=>g});var i,r,o,a=t(57528),s=t(89379),d=t(53986),l=t(9950),c=t(42074),p=t(84127),x=t(44414);const h=["to","children","disabled","size"],f=l.forwardRef((n,e)=>{let t=n.to,i=n.children,r=n.disabled,o=n.size,a=void 0===o?"default":o,l=(0,d.A)(n,h);return t&&!r?(0,x.jsx)(b,(0,s.A)((0,s.A)({ref:e,to:t,$size:a},l),{},{children:i})):(0,x.jsx)(m,(0,s.A)((0,s.A)({ref:e,type:"button",disabled:r,$size:a},l),{},{children:i}))});f.displayName="ActionButton";const g=f,u=(0,p.AH)(i||(i=(0,a.A)(["\n  display: inline-flex;\n  align-items: center;\n  justify-content: center;\n  gap: ",";\n  padding: ",";\n  background: linear-gradient(135deg, #f5a623 0%, #e8960f 100%);\n  border: none;\n  border-radius: ",";\n  font-family: inherit;\n  font-weight: 500;\n  font-size: ",";\n  line-height: 1;\n  text-decoration: none;\n  box-shadow: 0 2px 8px rgba(245, 166, 35, 0.3);\n  transition: all 0.2s;\n  cursor: pointer;\n  white-space: nowrap;\n\n  /* The global stylesheet sets `a:link, a:visited { color: #000 }` on\n     every anchor (public/index.html). That rule has higher specificity\n     than a plain styled-component class, so the Link variant rendered\n     black text without these explicit pseudo-class overrides. */\n  &,\n  &:link,\n  &:visited {\n    color: white;\n  }\n\n  &:hover {\n    transform: translateY(-1px);\n    box-shadow: 0 4px 12px rgba(245, 166, 35, 0.4);\n    color: white;\n  }\n\n  &:active {\n    transform: translateY(0);\n  }\n\n  &:focus-visible {\n    outline: none;\n    box-shadow:\n      0 2px 8px rgba(245, 166, 35, 0.3),\n      0 0 0 3px rgba(245, 166, 35, 0.25);\n  }\n\n  &:disabled,\n  &[aria-disabled='true'] {\n    background: #ddd;\n    box-shadow: none;\n    cursor: not-allowed;\n    transform: none;\n  }\n\n  svg {\n    flex-shrink: 0;\n  }\n"],["\n  display: inline-flex;\n  align-items: center;\n  justify-content: center;\n  gap: ",";\n  padding: ",";\n  background: linear-gradient(135deg, #f5a623 0%, #e8960f 100%);\n  border: none;\n  border-radius: ",";\n  font-family: inherit;\n  font-weight: 500;\n  font-size: ",";\n  line-height: 1;\n  text-decoration: none;\n  box-shadow: 0 2px 8px rgba(245, 166, 35, 0.3);\n  transition: all 0.2s;\n  cursor: pointer;\n  white-space: nowrap;\n\n  /* The global stylesheet sets \\`a:link, a:visited { color: #000 }\\` on\n     every anchor (public/index.html). That rule has higher specificity\n     than a plain styled-component class, so the Link variant rendered\n     black text without these explicit pseudo-class overrides. */\n  &,\n  &:link,\n  &:visited {\n    color: white;\n  }\n\n  &:hover {\n    transform: translateY(-1px);\n    box-shadow: 0 4px 12px rgba(245, 166, 35, 0.4);\n    color: white;\n  }\n\n  &:active {\n    transform: translateY(0);\n  }\n\n  &:focus-visible {\n    outline: none;\n    box-shadow:\n      0 2px 8px rgba(245, 166, 35, 0.3),\n      0 0 0 3px rgba(245, 166, 35, 0.25);\n  }\n\n  &:disabled,\n  &[aria-disabled='true'] {\n    background: #ddd;\n    box-shadow: none;\n    cursor: not-allowed;\n    transform: none;\n  }\n\n  svg {\n    flex-shrink: 0;\n  }\n"])),n=>"compact"===n.$size?"6px":"8px",n=>"compact"===n.$size?"8px 16px":"11px 20px",n=>"compact"===n.$size?"8px":"10px",n=>"compact"===n.$size?"0.85rem":"14px"),m=p.Ay.button(r||(r=(0,a.A)(["\n  ","\n"])),u),b=(0,p.Ay)(c.N_)(o||(o=(0,a.A)(["\n  ","\n"])),u)},79879(n,e,t){t.d(e,{A:()=>y});var i,r,o,a,s,d,l=t(57528),c=t(5544),p=t(9950),x=t(84127),h=t(44414);const f=(0,x.i7)(i||(i=(0,l.A)(["\n  0% { background-position: -200% 0; }\n  100% { background-position: 200% 0; }\n"]))),g=(0,x.i7)(r||(r=(0,l.A)(["\n  from { opacity: 0; }\n  to { opacity: 1; }\n"]))),u=x.Ay.div(o||(o=(0,l.A)(["\n  position: relative;\n  width: 100%;\n  height: 100%;\n  overflow: hidden;\n"]))),m=x.Ay.div(a||(a=(0,l.A)(["\n  position: absolute;\n  inset: 0;\n  background: linear-gradient(\n    90deg,\n    #f0f0f0 25%,\n    #e0e0e0 50%,\n    #f0f0f0 75%\n  );\n  background-size: 200% 100%;\n  animation: "," 1.5s ease-in-out infinite;\n"])),f),b=x.Ay.div(s||(s=(0,l.A)(["\n  position: absolute;\n  inset: 0;\n  display: flex;\n  align-items: center;\n  justify-content: center;\n  background: #f5f5f5;\n  color: #bbb;\n  font-size: 0.75rem;\n"]))),A=x.Ay.img(d||(d=(0,l.A)(["\n  width: 100%;\n  height: 100%;\n  object-fit: cover;\n  opacity: ",";\n  animation: "," 0.25s ease-out;
1\n  cursor: ",";\n  transition: transform 0.2s ease;\n\n  &:hover {\n    transform: ",";\n  }\n"])),n=>n.$visible?1:0,n=>n.$visible?g:"none",n=>n.onClick?"pointer":"default",n=>n.onClick?"scale(1.05)":"none"),y=n=>{let e=n.src,t=n.alt,i=n.onClick,r=n.className,o=n.style;const a=(0,p.useState)(!1),s=(0,c.A)(a,2),d=s[0],l=s[1],x=(0,p.useState)(!1),f=(0,c.A)(x,2),g=f[0],y=f[1],v=(0,p.useRef)(null);return(0,p.useEffect)(()=>{l(!1),y(!1),v.current&&v.current.complete&&v.current.naturalWidth>0&&l(!0)},[e]),(0,h.jsxs)(u,{className:r,style:o,children:[!d&&!g&&(0,h.jsx)(m,{}),g&&(0,h.jsx)(b,{children:"!"}),(0,h.jsx)(A,{ref:v,src:e,alt:t,loading:"lazy",decoding:"async",$visible:d&&!g,onClick:i,onLoad:()=>l(!0),onError:()=>y(!0)})]})}},16098(n,e,t){t.d(e,{A:()=>g});var i,r,o,a=t(57528),s=t(89379),d=t(53986),l=t(9950),c=t(42074),p=t(84127),x=t(44414);const h=["to","children","disabled","size"],f=l.forwardRef((n,e)=>{let t=n.to,i=n.children,r=n.disabled,o=n.size,a=void 0===o?"default":o,l=(0,d.A)(n,h);return t&&!r?(0,x.jsx)(b,(0,s.A)((0,s.A)({ref:e,to:t,$size:a},l),{},{children:i})):(0,x.jsx)(m,(0,s.A)((0,s.A)({ref:e,type:"button",disabled:r,$size:a},l),{},{children:i}))});f.displayName="SecondaryButton";const g=f,u=(0,p.AH)(i||(i=(0,a.A)(["\n  display: inline-flex;\n  align-items: center;\n  justify-content: center;\n  gap: ",";\n  padding: ",";\n  background: transparent;\n  border: 1px solid #e0e0e0;\n  border-radius: ",";\n  font-family: inherit;\n  font-weight: 500;\n  font-size: ",";\n  line-height: 1;\n  text-decoration: none;\n  cursor: pointer;\n  transition: all 0.2s;\n  white-space: nowrap;\n\n  /* Global stylesheet pins anchor color to #000 via `a:link, a:visited`\n     (public/index.html). Override at matching specificity for the Link\n     variant. */\n  &,\n  &:link,\n  &:visited {\n    color: #666;\n  }\n\n  &:hover {\n    background: #f5f5f5;\n    border-color: #d0d0d0;\n    color: #333;\n  }\n\n  &:focus-visible {\n    outline: none;\n    box-shadow: 0 0 0 3px rgba(0, 0, 0, 0.06);\n  }\n\n  &:disabled,\n  &[aria-disabled='true'] {\n    opacity: 0.5;\n    cursor: not-allowed;\n  }\n\n  svg {\n    flex-shrink: 0;\n  }\n"],["\n  display: inline-flex;\n  align-items: center;\n  justify-content: center;\n  gap: ",";\n  padding: ",";\n  background: transparent;\n  border: 1px solid #e0e0e0;\n  border-radius: ",";\n  font-family: inherit;\n  font-weight: 500;\n  font-size: ",";\n  line-height: 1;\n  text-decoration: none;\n  cursor: pointer;\n  transition: all 0.2s;\n  white-space: nowrap;\n\n  /* Global stylesheet pins anchor color to #000 via \\`a:link, a:visited\\`\n     (public/index.html). Override at matching specificity for the Link\n     variant. */\n  &,\n  &:link,\n  &:visited {\n    color: #666;\n  }\n\n  &:hover {\n    background: #f5f5f5;\n    border-color: #d0d0d0;\n    color: #333;\n  }\n\n  &:focus-visible {\n    outline: none;\n    box-shadow: 0 0 0 3px rgba(0, 0, 0, 0.06);\n  }\n\n  &:disabled,\n  &[aria-disabled='true'] {\n    opacity: 0.5;\n    cursor: not-allowed;\n  }\n\n  svg {\n    flex-shrink: 0;\n  }\n"])),n=>"compact"===n.$size?"6px":"8px",n=>"compact"===n.$size?"8px 12px":"11px 18px",n=>"compact"===n.$size?"8px":"10px",n=>"compact"===n.$size?"13px":"14px"),m=p.Ay.button(r||(r=(0,a.A)(["\n  ","\n"])),u),b=(0,p.Ay)(c.N_)(o||(o=(0,a.A)(["\n  ","\n"])),u)},92502(n,e,t){t.d(e,{A:()=>H});var i,r,o,a,s,d,l,c,p,x,h,f,g,u,m,b,A,y,v,j,w,k,z,C,S,L,_,O,P,R,E,$,F,D,I=t(57528),W=t(5544),B=t(9950),N=t(84127),T=t(23271),K=t(42890),U=t(7540),G=t(79657),M=t(50282),Y=t(44414);const H=n=>{let e=n.prevFiles,t=n.onClose;n.inspectionItemId;const i=(0,B.useState)(e||[]),r=(0,W.A)(i,2),o=r[0],a=r[1],s=(0,B.useState)(!1),d=(0,W.A)(s,2),l=d[0],c=d[1],p=(0,B.useRef)(null),x=(0,B.useRef)(0),h=(0,B.useCallback)(async n=>{const e=Array.from(n).filter(n=>n.type.startsWith("image/"));if(0===e.length)return;const t=(await(0,M.R)(e)).map(n=>({name:n.name,type:n.type,size:n.size,data:n}));a(n=>{const e=new Set(n.map(n=>n.name)),i=t.filter(n=>!e.has(n.name));return[...n,...i]})},[]);return(0,Y.jsx)(Z,{onClick:()=>t(o),children:(0,Y.jsxs)(Q,{onClick:n=>n.stopPropagation(),children:[(0,Y.jsxs)(X,{children:[(0,Y.jsxs)(q,{children:[(0,Y.jsx)(nn,{children:(0,Y.jsx)(T.A,{width:20,height:20})}),(0,Y.jsxs)("div",{children:[(0,Y.jsx)(en,{children:"Ladda upp bilder"}),(0,Y.jsx)(tn,{children:"V\xe4lj en eller flera bilder att bifoga"})]})]}),(0,Y.jsx)(rn,{onClick:()=>t(o),children:(0,Y.jsx)(G.A,{width:18,height:18})})]}),(0,Y.jsxs)(on,{children:[(0,Y.jsx)(an,{$isDragging:l,$hasFiles:o.length>0,onDragEnter:n=>{n.preventDefault(),n.stopPropagation(),x.current+=1,c(!0)},onDragLeave:n=>{n.preventDefault(),n.stopPropagation(),x.current-=1,0===x.current&&c(!1)},onDragOver:n=>{n.preventDefault(),n.stopPropagation()},onDrop:n=>{var e;n.preventDefault(),n.stopPropagation(),c(!1),x.current=0,null!==(e=n.dataTransfer.files)&&void 0!==e&&e.length&&h(n.dataTransfer.files)},onClick:()=>{var n;return null===(n=p.current)||void 0===n?void 0:n.click()},children:(0,Y.jsxs)(sn,{children:[(0,Y.jsx)(dn,{$isDragging:l,children:(0,Y.jsx)(T.A,{width:26,height:26})}),(0,Y.jsx)(ln,{children:l?"Slapp bilderna har":"Dra och slapp bilder har"}),(0,Y.jsx)(cn,{children:"eller klicka f\xf6r att v\xe4lja"})]})}),(0,Y.jsx)(pn,{ref:p,type:"file",accept:"image/*",multiple:!0,onChange:n=>{var e;null!==(e=n.target.files)&&void 0!==e&&e.length&&(h(n.target.files),n.target.value="")}}),o.length>0&&(0,Y.jsxs)(xn,{children:[(0,Y.jsxs)(hn,{children:[(0,Y.jsxs)(fn,{children:[o.length," bild",1!==o.length?"er":""," valda"]}),(0,Y.jsxs)(gn,{onClick:()=>{var n;return null===(n=p.current)||void 0===n?void 0:n.click()},children:[(0,Y.jsx)(K.A,{width:14,height:14}),"L\xe4gg till fler"]})]}),(0,Y.jsx)(un,{children:o.map(n=>{const e=(n=>n.data instanceof File||n.data instanceof Blob?URL.createObjectURL(n.data):null)(n);return(0,Y.jsxs)(mn,{children:[(0,Y.jsxs)(bn,{children:[e?(0,Y.jsx)(An,{src:e,alt:n.name}):(0,Y.jsx)(yn,{children:(0,Y.jsx)(T.A,{width:20,height:20})}),(0,Y.jsx)(vn,{onClick:e=>{var t;e.stopPropagation(),t=n.name,a(n=>n.filter(n=>n.name!==t))},children:(0,Y.jsx)(U.A,{width:14,height:14})})]}),(0,Y.jsxs)(jn,{children:[(0,Y.jsx)(wn,{title:n.name,children:n.name}),(0,Y.jsx)(kn,{children:(t=n.size,t<1024?"".concat(t," B"):t<1048576?"".concat((t/1024).toFixed(1)," KB"):"".concat((t/1048576).toFixed(1)," MB"))})]})]},n.name);var t})})]}),(0,Y.jsx)(zn,{children:"JPG, PNG, GIF, HEIC, WebP"})]}),(0,Y.jsxs)(Cn,{children:[(0,Y.jsx)(Sn,{onClick:()=>t(e||[]),children:"Avbryt"}),(0,Y.jsxs)(Ln,{onClick:()=>t(o),children:["Spara ",o.length>0&&"(".concat(o.length,")")]})]})]})})},J=(0,N.i7)(i||(i=(0,I.A)(["\n  from { opacity: 0; }\n  to { opacity: 1; }\n"]))),V=(0,N.i7)(r||(r=(0,I.A)(["\n  from {\n    opacity: 0;\n    transform: translateY(16px) scale(0.98);\n  }\n  to {\n    opacity: 1;\n    transform: translateY(0) scale(1);\n  }\n"]))),Z=N.Ay.div(o||(o=(0,I.A)(["\n  position: fixed;\n  top: 0;\n  left: 0;\n  right: 0;\n  bottom: 0;\n  background: rgba(15, 23, 42, 0.5);\n  backdrop-filter: blur(4px);\n  display: flex;\n  align-items: center;\n  justify-content: center;\n  z-index: 1000;\n  animation: "," 0.15s ease;\n"])),J),Q=N.Ay.div(a||(a=(0,I.A)(["\n  position: relative;\n  z-index: 1001;\n  background: #fff;\n  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);\n  animation: "," 0.25s cubic-bezier(0.16, 1, 0.3, 1);\n  border-radius: 16px;\n  width: 520px;\n  max-width: 95%;\n  max-height: 90vh;\n  overflow: hidden;\n  display: flex;\n  flex-direction: column;\n\n  @media (max-width: 480px) {\n    width: 95%;\n  }\n"])),V),X=N.Ay.div(s||(s=(0,I.A)(["\n  display: flex;\n  justify-content: space-between;\n  align-items: flex-start;\n  padding: 24px 24px 20px;\n  background: linear-gradient(135deg, #f0f7f4 0%, #e8f5e9 100%);\n  border-bottom: 1px solid rgba(45, 114, 79, 0.1);\n  flex-shrink: 0;
1\n"]))),q=N.Ay.div(d||(d=(0,I.A)(["\n  display: flex;\n  align-items: flex-start;\n  gap: 14px;\n"]))),nn=N.Ay.div(l||(l=(0,I.A)(["\n  width: 44px;\n  height: 44px;\n  border-radius: 12px;\n  background: linear-gradient(135deg, #2d724f 0%, #245f41 100%);\n  display: flex;\n  align-items: center;\n  justify-content: center;\n  color: white;\n  flex-shrink: 0;\n  box-shadow: 0 4px 12px rgba(45, 114, 79, 0.3);\n"]))),en=N.Ay.h3(c||(c=(0,I.A)(["\n  margin: 0 0 2px;\n  font-size: 17px;\n  font-weight: 600;\n  color: #1a1a1a;\n  letter-spacing: -0.01em;\n"]))),tn=N.Ay.p(p||(p=(0,I.A)(["\n  margin: 0;\n  font-size: 13px;\n  color: #666;\n  line-height: 1.4;\n"]))),rn=N.Ay.button(x||(x=(0,I.A)(["\n  background: transparent;\n  border: none;\n  cursor: pointer;\n  color: #999;\n  height: 32px;\n  width: 32px;\n  display: flex;\n  align-items: center;\n  justify-content: center;\n  border-radius: 8px;\n  transition: all 0.15s;\n  margin: -4px -8px 0 0;\n\n  &:hover {\n    background: rgba(0, 0, 0, 0.05);\n    color: #666;\n  }\n"]))),on=N.Ay.div(h||(h=(0,I.A)(["\n  padding: 24px;\n  overflow-y: auto;\n  flex: 1;\n"]))),an=N.Ay.div(f||(f=(0,I.A)(["\n  border: 2px dashed ",";\n  border-radius: 12px;\n  padding: 32px 20px;\n  text-align: center;\n  cursor: pointer;\n  background: ",";\n  transition: all 0.2s;\n\n  &:hover {\n    border-color: #bbb;\n    background: #f5f5f5;\n  }\n"])),n=>n.$isDragging?"#2d724f":"#ddd",n=>n.$isDragging?"rgba(45, 114, 79, 0.04)":"#fafafa"),sn=N.Ay.div(g||(g=(0,I.A)(["\n  display: flex;\n  flex-direction: column;\n  align-items: center;\n  gap: 6px;\n"]))),dn=N.Ay.div(u||(u=(0,I.A)(["\n  width: 52px;\n  height: 52px;\n  border-radius: 50%;\n  background: ",";\n  display: flex;\n  align-items: center;\n  justify-content: center;\n  color: ",";\n  margin-bottom: 6px;\n  transition: all 0.2s;\n"])),n=>n.$isDragging?"rgba(45, 114, 79, 0.12)":"#f0f0f0",n=>n.$isDragging?"#2d724f":"#999"),ln=N.Ay.div(m||(m=(0,I.A)(["\n  font-size: 15px;\n  font-weight: 500;\n  color: #333;\n"]))),cn=N.Ay.div(b||(b=(0,I.A)(["\n  font-size: 13px;\n  color: #888;\n"]))),pn=N.Ay.input(A||(A=(0,I.A)(["\n  display: none;\n"]))),xn=N.Ay.div(y||(y=(0,I.A)(["\n  margin-top: 20px;\n"]))),hn=N.Ay.div(v||(v=(0,I.A)(["\n  display: flex;\n  align-items: center;\n  justify-content: space-between;\n  margin-bottom: 12px;\n"]))),fn=N.Ay.span(j||(j=(0,I.A)(["\n  font-size: 13px;\n  font-weight: 600;\n  color: #555;\n  text-transform: uppercase;\n  letter-spacing: 0.04em;\n"]))),gn=N.Ay.button(w||(w=(0,I.A)(["\n  display: inline-flex;\n  align-items: center;\n  gap: 4px;\n  background: none;\n  border: 1px solid #ddd;\n  border-radius: 6px;\n  padding: 5px 10px;\n  font-size: 12px;\n  font-weight: 500;\n  color: #666;\n  cursor: pointer;\n  transition: all 0.15s;\n\n  &:hover {\n    border-color: #2d724f;\n    color: #2d724f;\n    background: #f0f7f4;\n  }\n"]))),un=N.Ay.div(k||(k=(0,I.A)(["\n  display: grid;\n  grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));\n  gap: 10px;\n\n  @media (max-width: 480px) {\n    grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));\n    gap: 8px;\n  }\n"]))),mn=N.Ay.div(z||(z=(0,I.A)(["\n  display: flex;\n  flex-direction: column;\n  gap: 6px;\n"]))),bn=N.Ay.div(C||(C=(0,I.A)(["\n  position: relative;\n  aspect-ratio: 1;\n  border-radius: 10px;\n  overflow: hidden;\n  background: #f5f5f5;\n  border: 1px solid #eee;\n  transition: border-color 0.15s;\n\n  &:hover {\n    border-color: #ccc;\n  }\n\n  &:hover > button {\n    opacity: 1;\n  }\n"]))),An=N.Ay.img(S||(S=(0,I.A)(["\n  width: 100%;\n  height: 100%;\n  object-fit: cover;\n  display: block;\n"]))),yn=N.Ay.div(L||(L=(0,I.A)(["\n  width: 100%;\n  height: 100%;\n  display: flex;\n  align-items: center;\n  justify-content: center;\n  color: #ccc;\n"]))),vn=N.Ay.button(_||(_=(0,I.A)(["\n  position: absolute;\n  top: 6px;\n  right: 6px;\n  width: 28px;\n  height: 28px;\n  border-radius: 7px;\n  border: none;\n  background: rgba(0, 0, 0, 0.55);\n  color: white;\n  cursor: pointer;\n  display: flex;\n  align-items: center;\n  justify-content: center;\n  opacity: 0;\n  transition: all 0.15s;\n  backdrop-filter: blur(4px);\n\n  &:hover {\n    background: rgba(197, 48, 48, 0.85);\n  }\n\n  @media (hover: none) {\n    opacity: 1;\n  }\n"]))),jn=N.Ay.div(O||(O=(0,I.A)(["\n  padding: 0 2px;\n  min-width: 0;\n"]))),wn=N.Ay.div(P||(P=(0,I.A)(["\n  font-size: 11px;\n  font-weight: 500;\n  color: #444;\n  overflow: hidden;\n  text-overflow: ellipsis;\n  white-space: nowrap;
1\n"]))),kn=N.Ay.div(R||(R=(0,I.A)(["\n  font-size: 10px;\n  color: #999;\n  margin-top: 1px;\n"]))),zn=N.Ay.div(E||(E=(0,I.A)(["\n  margin-top: 14px;\n  font-size: 12px;\n  color: #999;\n  text-align: center;\n"]))),Cn=N.Ay.div($||($=(0,I.A)(["\n  padding: 16px 24px 20px;\n  display: flex;\n  justify-content: flex-end;\n  gap: 10px;\n  background: #fafafa;\n  border-top: 1px solid #f0f0f0;\n  flex-shrink: 0;\n"]))),Sn=N.Ay.button(F||(F=(0,I.A)(["\n  background: transparent;\n  color: #666;\n  border: 1px solid #e0e0e0;\n  padding: 11px 18px;\n  border-radius: 10px;\n  font-weight: 500;\n  font-size: 14px;\n  cursor: pointer;\n  transition: all 0.15s;\n\n  &:hover {\n    background: #f5f5f5;\n    border-color: #d0d0d0;\n  }\n"]))),Ln=N.Ay.button(D||(D=(0,I.A)(["\n  background: linear-gradient(135deg, #2d724f 0%, #245f41 100%);\n  color: white;\n  border: none;\n  padding: 11px 20px;\n  border-radius: 10px;\n  font-weight: 500;\n  font-size: 14px;\n  cursor: pointer;\n  transition: all 0.2s;\n  display: flex;\n  align-items: center;\n  justify-content: center;\n  min-width: 100px;\n  box-shadow: 0 2px 8px rgba(45, 114, 79, 0.3);\n\n  &:hover {\n    transform: translateY(-1px);\n    box-shadow: 0 4px 12px rgba(45, 114, 79, 0.4);\n  }\n\n  &:active {\n    transform: translateY(0);\n  }\n"])))},45730(n,e,t){t.r(e),t.d(e,{default:()=>bi});var i,r,o,a,s,d,l,c,p,x,h,f,g,u,m,b,A,y,v,j,w,k,z,C,S,L,_,O,P,R,E,$,F,D,I=t(57528),W=t(89379),B=t(5544),N=t(9950),T=t(89485),K=t(99122),U=t(65369),G=t(40430),M=t(6182),Y=t(42890),H=t(79657),J=t(62917),V=t(70978),Z=t(7458),Q=t(32090),X=t(23271),q=t(11442),nn=t(7907),en=t(24048),tn=t(17155),rn=t(42074),on=t(84127),an=t(92502),sn=t(82770),dn=t(43848),ln=t(82090),cn=t(49585),pn=t(34830),xn=t(20305),hn=t(12452),fn=t(50282),gn=t(87770),un=t(16098),mn=t(44414);const bn={FIRE:"Brandskydd",PROPERTY_CHECKUP:"Rondering",CLEANUP:"St\xe4d",GARDENING:"Gr\xf6nsk\xf6tsel"},An=n=>{if(!n)return!1;const e=n.replace(/[\s\-()]/g,"");return/^\+?\d{6,}$/.test(e)},yn=n=>n?new Date(n).toLocaleDateString("sv-SE",{day:"numeric",month:"short",year:"numeric"}):null,vn=n=>{let e=n.inspection,t=n.item,i=n.onClose,r=n.onCreated;const o=null===e||void 0===e?void 0:e.property,a="rejected"===(null===t||void 0===t?void 0:t.status),s=(0,N.useState)((null===o||void 0===o?void 0:o.street)||""),d=(0,B.A)(s,2),l=d[0],c=d[1],p=(0,N.useState)(""),x=(0,B.A)(p,2),h=x[0],f=x[1],g=(0,N.useState)(""),u=(0,B.A)(g,2),m=u[0],b=u[1],A=(0,N.useState)((null===t||void 0===t?void 0:t.title)||""),y=(0,B.A)(A,2),v=y[0],j=y[1],w=(0,N.useState)((null===t||void 0===t?void 0:t.comment)||""),k=(0,B.A)(w,2),z=k[0],C=k[1],S=(0,N.useState)([]),L=(0,B.A)(S,2),_=L[0],O=L[1],P=(0,N.useState)(!1),R=(0,B.A)(P,2),E=R[0],$=R[1],F=(0,N.useState)(null),D=(0,B.A)(F,2),I=D[0],W=D[1],T=bn[null===e||void 0===e?void 0:e.inspection_type]||"Protokoll",K=l.trim().length>0&&An(m)&&v.trim().length>0&&!E;return(0,mn.jsx)(kn,{onClick:i,children:(0,mn.jsxs)(zn,{onClick:n=>n.stopPropagation(),role:"dialog","aria-modal":"true","data-testid":"report-from-item-modal",children:[(0,mn.jsxs)(Cn,{children:[(0,mn.jsxs)(Sn,{children:[(0,mn.jsx)(Ln,{children:(0,mn.jsx)(V.A,{width:20,height:20})}),(0,mn.jsxs)("div",{children:[(0,mn.jsx)(_n,{children:"Ny felanm\xe4lan"}),(0,mn.jsx)(On,{children:"Skapad fr\xe5n en inspektionspunkt"})]})]}),(0,mn.jsx)(Pn,{onClick:i,"aria-label":"St\xe4ng",children:(0,mn.jsx)(H.A,{width:18,height:18})})]}),(0,mn.jsxs)(Rn,{children:[(0,mn.jsxs)(En,{children:[(0,mn.jsxs)($n,{children:[(0,mn.jsxs)(Fn,{$rejected:a,children:[a?(0,mn.jsx)(J.A,{width:13,height:13,strokeWidth:2.5}):(0,mn.jsx)(V.A,{width:13,height:13,strokeWidth:2.5}),a?"Underk\xe4nd":"Anm\xe4rkning"]}),(0,mn.jsx)(Dn,{children:null===t||void 0===t?void 0:t.title})]}),(0,mn.jsxs)(In,{children:[(0,mn.jsx)(Wn,{children:T}),yn(null===e||void 0===e?void 0:e.inspection_date)&&(0,mn.jsxs)(Wn,{children:[(0,mn.jsx)(dn.A,{width:12,height:12}),yn(null===e||void 0===e?void 0:e.inspection_date)]}),(null===o||void 0===o?void 0:o.name)&&(0,mn.jsxs)(Wn,{children:[(0,mn.jsx)(ln.A,{width:12,height:12}),o.name]})]})]}),(0,mn.jsxs)(Bn,{children:[(0,mn.jsxs)(Tn,{children:[(0,mn.jsx)(cn.A,{width:14,height:14}),"\xc4mne *"]}),(0,mn.jsx)(Yn,{type:"text",value:v,placeholder:"Kort beskrivning av \xe4rendet",onChange:n=>j(n.target.value)})]}),(0,mn.jsxs)(Bn,{children:[(0,mn.jsx)(Tn,{children:"Beskrivning"}),(0,mn.jsx)(Hn,{value:z,placeholder:"Beskriv felet mer i detalj...",onChange:n=>C(n.target.value)}),(0,mn.jsx)(Un,{children:"F\xf6rifylld fr\xe5n punktens kommentar \u2013 justera vid behov."})]}),(0,mn.jsxs)(Nn,{children:[(0,mn.jsxs)(Bn,{$flex:2,children:[(0,mn.jsx)(Tn,{children:"Adress *"}),(0,mn.jsx)(Yn,{type:"text",value:l,placeholder:"Gatuadress",onChange:n=>c(n.target.value)})]}),(0,mn.jsxs)(Bn,{$flex:1,children:[(0,mn.jsx)(Tn,{children:"L\xe4genhetsnr"}),(0,mn.jsx)(Yn,{type:"text",value:h,placeholder:"t.ex. 1201",onChange:n=>
1f(n.target.value)})]})]}),(0,mn.jsxs)(Bn,{children:[(0,mn.jsxs)(Tn,{children:[(0,mn.jsx)(pn.A,{width:14,height:14}),"Telefonnummer *"]}),(0,mn.jsx)(Yn,{type:"tel",value:m,placeholder:"070-123 45 67",onChange:n=>b(n.target.value)}),m.length>0&&!An(m)?(0,mn.jsx)(Gn,{children:"Ange ett giltigt telefonnummer"}):(0,mn.jsx)(Un,{children:"Kontaktnummer f\xf6r \xe4rendet"})]}),(0,mn.jsxs)(Bn,{children:[(0,mn.jsxs)(Tn,{children:[(0,mn.jsx)(xn.A,{width:14,height:14}),"Bilder ",(0,mn.jsx)(Kn,{children:"valfritt"})]}),(0,mn.jsxs)(Jn,{children:[(0,mn.jsxs)(Vn,{children:[(0,mn.jsx)(xn.A,{width:20,height:20}),(0,mn.jsx)(Zn,{children:"Klicka f\xf6r att v\xe4lja bilder"})]}),(0,mn.jsx)(Qn,{type:"file",accept:"image/*",multiple:!0,onChange:n=>{n.target.files.length>0&&(async n=>{const e=await(0,fn.R)(n),t=new DataTransfer;_.forEach(n=>t.items.add(n)),e.forEach(n=>t.items.add(n)),O(Array.from(t.files))})(n.target.files),n.target.value=""}})]}),_.length>0&&(0,mn.jsx)(Xn,{children:_.map((n,e)=>(0,mn.jsxs)(qn,{children:[(0,mn.jsx)("img",{src:URL.createObjectURL(n),alt:n.name}),(0,mn.jsx)(ne,{type:"button",onClick:()=>(n=>{O(e=>e.filter((e,t)=>t!==n))})(e),"aria-label":"Ta bort bild",children:(0,mn.jsx)(H.A,{width:12,height:12,strokeWidth:2.5})})]},"".concat(n.name,"-").concat(e)))})]}),I&&(0,mn.jsx)(ee,{children:I})]}),(0,mn.jsxs)(te,{children:[(0,mn.jsx)(un.A,{onClick:i,children:"Avbryt"}),(0,mn.jsx)(gn.A,{onClick:async()=>{if(!K)return;$(!0),W(null);const n={street:l,apartment_no:h,phone:m,subject:v,message:z,organisation_id:e.organisation_id,inspection_id:e.id,inspection_item_id:t.id},i=new FormData;i.append("data",JSON.stringify(n)),_.forEach(n=>i.append("files[]",n));const o=localStorage.getItem("sessionToken");try{const n=await sn.A.post("".concat(hn.JR,"/reports"),i,{headers:{"Content-Type":"multipart/form-data",Authorization:o,"X-App-Client":hn.I_}});r(n.data)}catch(a){W("Kunde inte skapa felanm\xe4lan. F\xf6rs\xf6k igen om en stund."),$(!1)}},disabled:!K,"data-testid":"report-from-item-submit",children:E?"Skickar\u2026":"Skicka felanm\xe4lan"})]})]})})},jn=(0,on.i7)(i||(i=(0,I.A)(["\n  from { opacity: 0; }\n  to { opacity: 1; }\n"]))),wn=(0,on.i7)(r||(r=(0,I.A)(["\n  from {\n    opacity: 0;\n    transform: translateY(16px) scale(0.98);\n  }\n  to {\n    opacity: 1;\n    transform: translateY(0) scale(1);\n  }\n"]))),kn=on.Ay.div(o||(o=(0,I.A)(["\n  position: fixed;\n  inset: 0;\n  background: rgba(15, 23, 42, 0.5);\n  backdrop-filter: blur(4px);\n  display: flex;\n  align-items: center;\n  justify-content: center;\n  z-index: 1000;\n  padding: 16px;\n  animation: "," 0.15s ease;\n"])),jn),zn=on.Ay.div(a||(a=(0,I.A)(["\n  position: relative;\n  z-index: 1001;\n  background: #fff;\n  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);\n  animation: "," 0.25s cubic-bezier(0.16, 1, 0.3, 1);\n  border-radius: 16px;\n  width: 540px;\n  max-width: 100%;\n  /* Account for the overlay's 16px top+bottom padding so the modal\n     always fits the viewport and is never clipped above the top. */\n  max-height: calc(100vh - 32px);\n  overflow: hidden;\n  display: flex;\n  flex-direction: column;\n"])),wn),Cn=on.Ay.div(s||(s=(0,I.A)(["\n  display: flex;\n  justify-content: space-between;\n  align-items: flex-start;\n  padding: 22px 24px 20px;\n  background: linear-gradient(135deg, #1a1a1a 0%, #2d2d2d 100%);\n  color: white;\n  flex-shrink: 0;\n"]))),Sn=on.Ay.div(d||(d=(0,I.A)(["\n  display: flex;\n  align-items: center;\n  gap: 14px;\n"]))),Ln=on.Ay.div(l||(l=(0,I.A)(["\n  width: 44px;\n  height: 44px;\n  border-radius: 12px;\n  background: rgba(245, 166, 35, 0.2);\n  display: flex;\n  align-items: center;\n  justify-content: center;\n  color: #f5a623;\n  flex-shrink: 0;\n"]))),_n=on.Ay.h3(c||(c=(0,I.A)(["\n  margin: 0 0 2px;\n  font-family: 'Ubuntu', sans-serif;\n  font-size: 18px;\n  font-weight: 700;\n  letter-spacing: -0.01em;\n"]))),On=on.Ay.p(p||(p=(0,I.A)(["\n  margin: 0;\n  font-size: 13px;\n  color: rgba(255, 255, 255, 0.6);\n"]))),Pn=on.Ay.button(x||(x=(0,I.A)(["\n  background: transparent;\n  border: none;\n  cursor: pointer;\n  color: rgba(255, 255, 255, 0.6);\n  height: 32px;\n  width: 32px;\n  display: flex;\n  align-items: center;\n  justify-content: center;\n  border-radius: 8px;\n  transition: all 0.15s;\n  margin: -2px -6px 0 0;\n\n  &:hover {\n    background: rgba(255, 255, 255, 0.1);\n    color: white;\n  }\n"]))),Rn=on.Ay.div(h||(h=(0,I.A)(["\n  padding: 20px 24px 24px;\n  overflow-y: auto;\n  flex: 1;\n  /* Flex children default to min-height: auto, which stops this body\n     from shrinking below its content \u2013 that pushes the modal past its\n     max-height and clips the header off the top. min-height: 0 lets it\n     shrink so overflow-y actually scrolls and the header/footer stay\n     pinned. (Vertical analog of the min-width: 0 grid/flex rule.) */\n  min-height: 0;\n  display: flex;\n  flex-direction: column;\n  gap: 16px;\n"]))),En=on.Ay.div(f||(f=(0,I.A)(["\n  background: #faf9f7;
1\n  border: 1px solid #efece6;\n  border-left: 3px solid #f5a623;\n  border-radius: 10px;\n  padding: 12px 14px;\n  display: flex;\n  flex-direction: column;\n  gap: 8px;\n"]))),$n=on.Ay.div(g||(g=(0,I.A)(["\n  display: flex;\n  align-items: center;\n  gap: 10px;\n  flex-wrap: wrap;\n"]))),Fn=on.Ay.span(u||(u=(0,I.A)(["\n  display: inline-flex;\n  align-items: center;\n  gap: 4px;\n  flex-shrink: 0;\n  font-size: 11px;\n  font-weight: 600;\n  text-transform: uppercase;\n  letter-spacing: 0.03em;\n  padding: 3px 8px;\n  border-radius: 6px;\n  background: ",";\n  color: ",";\n"])),n=>n.$rejected?"rgba(197, 48, 48, 0.1)":"rgba(245, 158, 11, 0.12)",n=>n.$rejected?"#9b2c2c":"#b45309"),Dn=on.Ay.span(m||(m=(0,I.A)(["\n  font-size: 14px;\n  font-weight: 600;\n  color: #1a1a1a;\n  min-width: 0;\n  overflow: hidden;\n  text-overflow: ellipsis;\n  white-space: nowrap;\n"]))),In=on.Ay.div(b||(b=(0,I.A)(["\n  display: flex;\n  flex-wrap: wrap;\n  gap: 12px;\n"]))),Wn=on.Ay.span(A||(A=(0,I.A)(["\n  display: inline-flex;\n  align-items: center;\n  gap: 4px;\n  font-size: 12px;\n  color: #888;\n\n  svg {\n    color: #aaa;\n  }\n"]))),Bn=on.Ay.div(y||(y=(0,I.A)(["\n  display: flex;\n  flex-direction: column;\n  gap: 6px;\n  flex: ",";\n  min-width: 0;\n"])),n=>n.$flex||1),Nn=on.Ay.div(v||(v=(0,I.A)(["\n  display: flex;\n  gap: 14px;\n\n  @media (max-width: 480px) {\n    flex-direction: column;\n  }\n"]))),Tn=on.Ay.label(j||(j=(0,I.A)(["\n  display: flex;\n  align-items: center;\n  gap: 5px;\n  font-size: 0.85rem;\n  font-weight: 600;\n  color: #333;\n\n  svg {\n    color: #bbb;\n  }\n"]))),Kn=on.Ay.span(w||(w=(0,I.A)(["\n  font-size: 0.72rem;\n  font-weight: 500;\n  color: #bbb;\n  text-transform: none;\n"]))),Un=on.Ay.span(k||(k=(0,I.A)(["\n  font-size: 0.78rem;\n  color: #aaa;\n"]))),Gn=on.Ay.span(z||(z=(0,I.A)(["\n  font-size: 0.78rem;\n  color: #c53030;\n"]))),Mn="\n  padding: 11px 14px;\n  border: 2px solid #e8e8e8;\n  border-radius: 10px;\n  font-size: 0.92rem;\n  color: #333;\n  background: #fafafa;\n  transition: all 0.2s ease;\n  font-family: inherit;\n  width: 100%;\n",Yn=on.Ay.input(C||(C=(0,I.A)(["\n  ","\n\n  &::placeholder {\n    color: #bbb;\n  }\n\n  &:focus {\n    outline: none;\n    border-color: #f5a623;\n    background: white;\n    box-shadow: 0 0 0 3px rgba(245, 166, 35, 0.1);\n  }\n"])),Mn),Hn=on.Ay.textarea(S||(S=(0,I.A)(["\n  ","\n  min-height: 84px;\n  resize: vertical;\n  line-height: 1.5;\n\n  &::placeholder {\n    color: #bbb;\n  }\n\n  &:focus {\n    outline: none;\n    border-color: #f5a623;\n    background: white;\n    box-shadow: 0 0 0 3px rgba(245, 166, 35, 0.1);\n  }\n"])),Mn),Jn=on.Ay.label(L||(L=(0,I.A)(["\n  display: block;\n  position: relative;\n  border: 2px dashed #ddd;\n  border-radius: 10px;\n  padding: 16px;\n  cursor: pointer;\n  transition: all 0.2s ease;\n  background: #fafafa;\n\n  &:hover {\n    border-color: #f5a623;\n    background: #fef7ec;\n  }\n"]))),Vn=on.Ay.div(_||(_=(0,I.A)(["\n  display: flex;\n  align-items: center;\n  justify-content: center;\n  gap: 8px;\n  color: #999;\n"]))),Zn=on.Ay.span(O||(O=(0,I.A)(["\n  font-size: 0.85rem;\n  font-weight: 500;\n  color: #666;\n"]))),Qn=on.Ay.input(P||(P=(0,I.A)(["\n  position: absolute;\n  inset: 0;\n  opacity: 0;\n  cursor: pointer;\n"]))),Xn=on.Ay.div(R||(R=(0,I.A)(["\n  display: flex;\n  flex-wrap: wrap;\n  gap: 8px;\n  margin-top: 4px;\n"]))),qn=on.Ay.div(E||(E=(0,I.A)(["\n  position: relative;\n  width: 56px;\n  height: 56px;\n  border-radius: 8px;\n  overflow: hidden;\n  background: #f5f5f5;\n  border: 1px solid #eee;\n\n  img {\n    width: 100%;\n    height: 100%;\n    object-fit: cover;\n    display: block;\n  }\n"]))),ne=on.Ay.button($||($=(0,I.A)(["\n  position: absolute;\n  top: 3px;\n  right: 3px;\n  width: 18px;\n  height: 18px;\n  border: none;\n  border-radius: 50%;\n  background: rgba(26, 26, 26, 0.75);\n  color: white;\n  cursor: pointer;\n  display: flex;\n  align-items: center;\n  justify-content: center;\n  padding: 0;\n  transition: background 0.15s;\n\n  &:hover {\n    background: #c53030;\n  }\n"]))),ee=on.Ay.div(F||(F=(0,I.A)(["\n  padding: 10px 14px;\n  background: #fef2f2;\n  border: 1px solid #fecaca;\n  border-radius: 10px;\n  color: #c53030;\n  font-size: 0.85rem;\n"]))),te=on.Ay.div(D||(D=(0,I.A)(["\n  padding: 16px 24px 20px;\n  display: flex;\n  justify-content: flex-end;\n  gap: 12px;\n  background: #fafafa;
1\n  border-top: 1px solid #f0f0f0;\n  flex-shrink: 0;\n\n  @media (max-width: 480px) {\n    flex-direction: column-reverse;\n\n    & > * {\n      width: 100%;\n    }\n  }\n"])));var ie,re,oe,ae,se,de,le,ce,pe,xe,he,fe,ge,ue,me,be,Ae,ye,ve,je,we,ke,ze,Ce,Se,Le,_e,Oe,Pe,Re,Ee,$e,Fe,De,Ie,We,Be,Ne,Te,Ke,Ue,Ge,Me,Ye,He,Je,Ve,Ze,Qe,Xe,qe,nt,et,tt,it,rt,ot,at,st,dt=t(31068),lt=t(8565),ct=t(79879),pt=t(24979);const xt={FIRE:"Brandskydd",PROPERTY_CHECKUP:"Rondering",CLEANUP:"Stad",GARDENING:"Gronskotsel"},ht=(0,dt.A)(n=>{let e=n.router;const t=e.navigate,i=e.params.id,r=(0,N.useState)(null),o=(0,B.A)(r,2),a=o[0],s=o[1],d=(0,N.useState)(!0),l=(0,B.A)(d,2),c=l[0],p=l[1],x=(0,N.useState)(!1),h=(0,B.A)(x,2),f=h[0],g=h[1],u=(0,N.useState)(""),m=(0,B.A)(u,2),b=m[0],A=m[1],y=(0,N.useState)(""),v=(0,B.A)(y,2),j=v[0],w=v[1],k=(0,N.useState)([]),z=(0,B.A)(k,2),C=z[0],S=z[1],L=(0,N.useState)({}),_=(0,B.A)(L,2),O=_[0],P=_[1],R=(0,N.useState)(!1),E=(0,B.A)(R,2),$=E[0],F=E[1],D=(0,N.useState)(null),I=(0,B.A)(D,2),K=I[0],U=I[1],rn=(0,N.useState)([]),on=(0,B.A)(rn,2),dn=(on[0],on[1],(0,N.useState)([])),ln=(0,B.A)(dn,2),cn=ln[0],pn=ln[1],xn=(0,N.useState)([]),fn=(0,B.A)(xn,2),un=fn[0],bn=fn[1],An=(0,N.useState)(!1),yn=(0,B.A)(An,2),jn=yn[0],wn=yn[1],kn=(0,N.useState)(null),zn=(0,B.A)(kn,2),Cn=zn[0],Sn=zn[1],Ln=T.Ay.useNotification(),_n=(0,B.A)(Ln,2),On=_n[0],Pn=_n[1],Rn=(0,lt.A)(n=>n),En=n=>{s(n),A(n.description||""),w(n.inspection_date?n.inspection_date.split("T")[0]:""),S(n.inspection_items.map(n=>(0,W.A)((0,W.A)({},n),{},{status:n.status,comment:n.comment||"",newFiles:[],removedDocIds:[]}))),pn(n.inspection_documents||[])};(0,N.useEffect)(()=>{var n,t;if(null!==(n=e.location)&&void 0!==n&&null!==(t=n.state)&&void 0!==t&&t.inspection)return En(e.location.state.inspection),void p(!1);(0,hn.Ay)({endpoint:"/inspections/".concat(i)}).then(n=>{En(n),p(!1)}).catch(()=>{alert("Kunde inte ladda protokollet. Prova igen om en liten stund."),p(!1)})},[i]);const $n=(n,e)=>{S(t=>t.map(t=>t.id===n?(0,W.A)((0,W.A)({},t),{},{status:e}):t)),"remark"!==e&&"rejected"!==e||P(e=>(0,W.A)((0,W.A)({},e),{},{[n]:!0}))},Fn=n=>{F(!$),U(n)},Dn=C,In=Dn.filter(n=>"approved"===n.status).length,Wn=Dn.filter(n=>"remark"===n.status).length,Bn=Dn.filter(n=>"rejected"===n.status).length,Nn=Dn.filter(n=>("remark"===n.status||"rejected"===n.status)&&!(n.comment&&n.comment.trim().length>0)).length,Tn=0===Nn,Kn=n=>{if("remark"!==n.status&&"rejected"!==n.status)return null;const e=n.conversations&&n.conversations[0];return e?(0,mn.jsx)(ii,{children:(0,mn.jsxs)(ri,{to:"/reports/".concat(e.conversation_number),children:[(0,mn.jsx)(G.A,{width:14,height:14,strokeWidth:2.5}),"Felanm\xe4lan skapad",(0,mn.jsx)(M.A,{width:14,height:14})]})}):Rn.current.property_manager?(0,mn.jsx)(ii,{children:(0,mn.jsxs)(gn.A,{size:"compact",onClick:()=>Sn(n),"data-testid":"create-report-from-item",children:[(0,mn.jsx)(Y.A,{width:16,height:16}),"Skapa felanm\xe4lan"]})}):null},Un=n=>{const e=(n.inspection_item_documents||[]).filter(e=>!(n.removedDocIds||[]).includes(e.id));return 0===e.length?null:(0,mn.jsxs)(oi,{children:[(0,mn.jsx)(Zt,{children:"Befintliga bilder"}),(0,mn.jsx)(ai,{children:e.map((e,t)=>{var i;return(0,mn.jsxs)(si,{children:[(0,mn.jsx)(ct.A,{src:e.thumb_url||(null===(i=e.file)||void 0===i?void 0:i.url),alt:e.file_name||"Bild ".concat(t+1)}),(0,mn.jsx)(di,{type:"button",title:"Ta bort bild",onClick:t=>{var i,r;t.stopPropagation(),i=n.id,r=e.id,S(n=>n.map(n=>n.id===i?(0,W.A)((0,W.A)({},n),{},{removedDocIds:[...n.removedDocIds||[],r]}):n))},children:(0,mn.jsx)(H.A,{width:14,height:14,strokeWidth:2.5})})]},e.id||t)})})]})},Gn=(n,e)=>{var t,i,r;const o=O[n.id],a=(n=>"approved"===n.status?"approved":"rejected"===n.status?"rejected":"remark"===n.status?"remark":"pending")(n),s=n.comment&&n.comment.trim().length>0,d="remark"===a||"rejected"===a,l=d&&!s,c=(n.inspection_item_documents||[]).filter(e=>!(n.removedDocIds||[]).includes(e.id)).length>0||(null===(t=n.newFiles)||void 0===t?void 0:t.length)>0;return(0,mn.jsxs)($t,{status:a,"data-testid":"inspection-item",children:[(0,mn.jsxs)(Ft,{onClick:()=>{return e=n.id,void P(n=>(0,W.A)((0,W.A)({},n),{},{[e]:!n[e]}));var e},children:[(0,mn.jsxs)(Dt,{children:[(0,mn.jsxs)(It,{status:a,children:["approved"===a&&(0,mn.jsx)(G.A,{width:18,height:18,strokeWidth:2.5}),"rejected"===a&&(0,mn.jsx)(J.A,{width:18,height:18,strokeWidth:2.5}),"remark"===a&&(0,mn.jsx)(V.A,{width:18,height:18,strokeWidth:2.5}),"pending"===a&&(0,mn.jsx)(Z.A,{width:18,height:18,strokeWidth:2.5})]}),(0,mn.jsx)(Wt,{children:n.title}),n.sub_category&&(0,mn.jsx)(Bt,{children:n.sub_category}
1),(s||c)&&(0,mn.jsxs)(Nt,{children:[s&&(0,mn.jsx)(Q.A,{width:14,height:14}),c&&(0,mn.jsx)(X.A,{width:14,height:14})]}),l&&(0,mn.jsxs)(Xt,{children:[(0,mn.jsx)(Z.A,{width:12,height:12,strokeWidth:2.5}),"Kommentar kr\xe4vs"]})]}),(0,mn.jsxs)(Tt,{children:[(0,mn.jsxs)(Kt,{children:[(0,mn.jsx)(Gt,{active:"approved"===n.status,onClick:e=>{e.stopPropagation(),$n(n.id,"approved")},children:(0,mn.jsx)(q.A,{width:20,height:20,strokeWidth:3})}),(0,mn.jsx)(Mt,{active:"remark"===n.status,onClick:e=>{e.stopPropagation(),$n(n.id,"remark")},children:(0,mn.jsx)(V.A,{width:18,height:18,strokeWidth:2.5})}),(0,mn.jsx)(Yt,{active:"rejected"===n.status,onClick:e=>{e.stopPropagation(),$n(n.id,"rejected")},children:(0,mn.jsx)(H.A,{width:20,height:20,strokeWidth:3})})]}),(0,mn.jsx)(Ht,{children:o?(0,mn.jsx)(nn.A,{width:20,height:20}):(0,mn.jsx)(en.A,{width:20,height:20})})]})]}),(0,mn.jsxs)(Jt,{expanded:o,children:[(0,mn.jsxs)(Vt,{children:[(0,mn.jsx)(Zt,{children:d?"Kommentar *":"Kommentar"}),(0,mn.jsx)(Qt,{$error:l,value:n.comment||"",onChange:e=>{return t=n.id,i=e.target.value,void S(n=>n.map(n=>n.id===t?(0,W.A)((0,W.A)({},n),{},{comment:i}):n));var t,i},placeholder:d?"Beskriv avvikelsen (obligatoriskt)...":"Lagg till anteckning...",autoSize:{minRows:2,maxRows:6}}),l&&(0,mn.jsx)(qt,{children:"Kommentar \xe4r obligatorisk f\xf6r anm\xe4rkning och underk\xe4nd."})]}),Un(n),(0,mn.jsxs)(Vt,{children:[(0,mn.jsx)(Zt,{children:"L\xe4gg till nya bilder"}),(null===(i=n.newFiles)||void 0===i?void 0:i.length)>0&&(0,mn.jsx)(ni,{children:n.newFiles.map((n,e)=>(0,mn.jsx)(ei,{children:(0,mn.jsx)("img",{src:URL.createObjectURL(n.data),alt:n.name})},n.name||e))}),(0,mn.jsxs)(ti,{onClick:()=>Fn(n.id),children:[(0,mn.jsx)(X.A,{width:16,height:16}),(0,mn.jsx)("span",{children:(null===(r=n.newFiles)||void 0===r?void 0:r.length)>0?"".concat(n.newFiles.length," ny bild").concat(n.newFiles.length>1?"er":""," - Redigera"):"L\xe4gg till"})]})]}),Kn(n)]})]},n.id||"item-".concat(e))};if(c)return(0,mn.jsx)(gt,{children:(0,mn.jsxs)(mi,{children:[(0,mn.jsx)(pt.A,{size:"large"}),(0,mn.jsx)("p",{children:"Laddar protokoll..."})]})});if(!a)return(0,mn.jsx)(gt,{children:(0,mn.jsxs)(mi,{children:[(0,mn.jsx)("p",{children:"Protokollet kunde inte hittas."}),(0,mn.jsxs)(At,{onClick:()=>t("/inspections"),children:[(0,mn.jsx)(tn.A,{width:16,height:16}),"Tillbaka"]})]})});if(f)return(0,mn.jsx)(gt,{children:(0,mn.jsxs)(mi,{children:[(0,mn.jsx)(pt.A,{size:"large"}),(0,mn.jsx)("p",{children:"Sparar \xe4ndringar..."})]})});const Mn=xt[a.inspection_type]||"Protokoll";return(0,mn.jsxs)(gt,{children:[Pn,(0,mn.jsx)(ut,{children:(0,mn.jsx)(mt,{children:(0,mn.jsxs)(bt,{children:[(0,mn.jsx)(At,{onClick:()=>t("/inspections"),children:(0,mn.jsx)(tn.A,{width:18,height:18})}),(0,mn.jsx)(yt,{children:"Redigera protokoll"})]})})}),(0,mn.jsx)(vt,{children:(0,mn.jsxs)(jt,{children:[(0,mn.jsxs)(wt,{children:[(0,mn.jsx)(kt,{children:"Typ"}),(0,mn.jsx)(zt,{children:Mn})]}),(0,mn.jsxs)(wt,{children:[(0,mn.jsx)(kt,{children:"Datum"}),(0,mn.jsx)(Ct,{type:"date",value:j,onChange:n=>w(n.target.value)})]}),a.user&&(0,mn.jsxs)(wt,{children:[(0,mn.jsx)(kt,{children:"Skapad av"}),(0,mn.jsx)(zt,{children:a.user.name})]})]})}),(0,mn.jsxs)(St,{children:[(0,mn.jsx)(Lt,{children:(0,mn.jsxs)(_t,{children:["Inspektionspunkter",(0,mn.jsxs)(Ot,{children:[C.length," punkter"]})]})}),(0,mn.jsx)(Pt,{children:(()=>{if("FIRE"===(null===a||void 0===a?void 0:a.inspection_type)){const n=C.reduce((n,e)=>{const t=e.sub_category||"Ovrigt";return n[t]||(n[t]=[]),n[t].push(e),n},{});return Object.entries(n).map((n,e)=>{let t=(0,B.A)(n,2),i=t[0],r=t[1];return(0,mn.jsxs)(Rt,{children:[(0,mn.jsx)(Et,{children:i}),r.map((n,e)=>Gn(n,e))]},"cat-".concat(e))})}return C.map((n,e)=>Gn(n,e))})()})]}),(0,mn.jsxs)(li,{children:[(0,mn.jsxs)(ci,{children:[(0,mn.jsx)(pi,{children:"Sammanfattning"}),(0,mn.jsxs)(xi,{children:[(0,mn.jsxs)(hi,{status:"approved",children:[(0,mn.jsx)(G.A,{width:18,height:18,strokeWidth:2.5}),(0,mn.jsxs)("span",{children:[In," godk\xe4nda"]})]}),(0,mn.jsxs)(hi,{status:"remark",children:[(0,mn.jsx)(V.A,{width:18,height:18,strokeWidth:2.5}),(0,mn.jsxs)("span",{children:[Wn," anm\xe4rkningar"]})]}),(0,mn.jsxs)(hi,{status:"rejected",children:[(0,mn.jsx)(J.A,{width:18,height:18,strokeWidth:2.5}),(0,mn.jsxs)("span",{children:[Bn," underk\xe4nda"]})]})]}),(0,mn.jsxs)(fi,{children:[(0,mn.jsx)(kt,{children:"\xd6vrig kommentar (valfritt)"}),(0,mn.jsx)(Qt,{value:b||"",onChange:n=>A(n.target.value),placeholder:"Overgripande noteringar om inspektionen...",autoSize:{minRows:2,maxRows:4}}),cn.length>0&&(0,mn.jsxs)(oi,{children:[(0,mn.jsx)(Zt,{children:"Befintliga bilder"}),(0,mn.jsx)(ai,{children:cn.map((n,e)=>{var t;return(0,mn.jsx)(si,{children:(0,mn.jsx)(ct.A,{src:n.thumb_url||(null===(t=n.file)||void 0===t?void 0:t.url),alt:n.file_name||"Bild ".concat(e+1)})},n.id||e)})})]}),un.length>0&&(0,mn.jsx)(ni,{children:un.map((n,e)=>(0,mn.jsx)(ei,{children:(0,mn.jsx)("img",{src:URL.createObjectURL(n.data),alt:n.name})},n.name||e))}),(0,mn.jsxs)(ti,{onClick:()=>wn(!0),children:[(0,mn.jsx)(X.A,{width:16,height:16}),(0,mn.jsx)("span",{children:un.length>0?"".concat(un.length," ny bild").concat(un.length>1?"er":""," - Redigera"):"L\xe4gg till bilder"})]})]})]}),(0,mn.jsx)(gi,{type:"primary",onClick:async()=>{g(!0);const n={description:b,inspection_date:j},e=C.map(n=>({id:n.id,status:n.status,comment:n.comment})),r=new FormData;r.append("inspection",JSON.stringify(n)),r.append("items",JSON.stringify(e));const o=[];for(const t of C)if(t.newFiles&&t.newFiles.length>0)for(const n of t.newFiles)r.append("new_files[]",n.data),o.push(t.id);o.length>0&&r.append("file_item_ids",JSON.stringify(o));for(const t of un)r.append("new_inspection_files[]",t.data);const s=C.flatMap(n=>n.removedDocIds||[]);s.length>0&&r.append("removed_item_document_ids",JSON.stringify(s));const d=localStorage.getItem("sessionToken");return sn.A.put("".concat(hn.JR,"/inspections/").concat(i),r,{headers:{"Content-Type":"multipart/form-data",Authorization:d}}).then(()=>{t("/inspections",{state:{organisationId:a.organisation_id,highlightInspectionId:a.id,actionStatus:"success",actionMessage:"Protokollet har uppdaterats"}})}).catch(()=>{g(!1),On.error({message:"Kunde inte spara \xe4ndringarna",duration:4})})},disabled:!Tn,children:"Spara \xe4ndringar"}),Nn>
10&&(0,mn.jsxs)(ui,{children:[Nn," punkt",1!==Nn?"er":""," ","saknar obligatorisk kommentar"]})]}),(()=>{if($){const n=C.find(n=>n.id===K);return(0,mn.jsx)(an.A,{prevFiles:(null===n||void 0===n?void 0:n.newFiles)||[],onClose:n=>{Fn(),S(e=>e.map(e=>e.id===K?(0,W.A)((0,W.A)({},e),{},{newFiles:n}):e))},inspectionItemId:K})}})(),(()=>{if(jn)return(0,mn.jsx)(an.A,{prevFiles:un,onClose:n=>{wn(!1),bn(n)},inspectionItemId:"inspection-general"})})(),Cn&&(0,mn.jsx)(vn,{inspection:a,item:Cn,onClose:()=>Sn(null),onCreated:n=>((n,e)=>{const t={id:e.id,conversation_number:e.conversation_number,subject:e.subject,status:e.status,open:e.open};S(e=>e.map(e=>e.id===n.id?(0,W.A)((0,W.A)({},e),{},{conversations:[...e.conversations||[],t]}):e)),Sn(null),On.success({message:"Felanm\xe4lan skapad",description:'\xc4rende skapat f\xf6r "'.concat(n.title,'"'),duration:3})})(Cn,n)})]})}),ft=(0,on.i7)(ie||(ie=(0,I.A)(["\n  from {\n    opacity: 0;\n    max-height: 0;\n  }\n  to {\n    opacity: 1;\n    max-height: 500px;\n  }\n"]))),gt=on.Ay.div(re||(re=(0,I.A)(["\n  min-height: 100vh;\n  background: #f7f6f3;\n"]))),ut=on.Ay.header(oe||(oe=(0,I.A)(["\n  background: #fffffe;\n  border-bottom: 1px solid #e8e6e1;\n  padding: 16px;\n  position: sticky;\n  top: 0;\n  z-index: 100;\n\n  @media (min-width: 768px) {\n    padding: 20px 32px;\n  }\n"]))),mt=on.Ay.div(ae||(ae=(0,I.A)(["\n  max-width: 800px;\n  margin: 0 auto;\n  display: flex;\n  align-items: center;\n  justify-content: space-between;\n"]))),bt=on.Ay.div(se||(se=(0,I.A)(["\n  display: flex;\n  align-items: center;\n  gap: 12px;\n"]))),At=on.Ay.button(de||(de=(0,I.A)(["\n  display: flex;\n  align-items: center;\n  gap: 6px;\n  background: none;\n  border: none;\n  color: #666;\n  cursor: pointer;\n  padding: 4px;\n  border-radius: 6px;\n  transition: all 0.15s ease;\n  font-size: 14px;\n\n  &:hover {\n    color: #1a1a1a;\n    background: #f0f0f0;\n  }\n"]))),yt=on.Ay.h1(le||(le=(0,I.A)(["\n  font-size: 20px;\n  font-weight: 600;\n  color: #1a1a1a;\n  margin: 0;\n  letter-spacing: -0.02em;\n\n  @media (min-width: 768px) {\n    font-size: 24px;\n  }\n"]))),vt=on.Ay.section(ce||(ce=(0,I.A)(["\n  background: #fffffe;\n  padding: 20px 16px;\n  border-bottom: 1px solid #e8e6e1;\n\n  @media (min-width: 768px) {\n    padding: 24px 32px;\n  }\n"]))),jt=on.Ay.div(pe||(pe=(0,I.A)(["\n  max-width: 800px;\n  margin: 0 auto;\n  display: grid;\n  gap: 16px;\n  grid-template-columns: 1fr;\n\n  @media (min-width: 640px) {\n    grid-template-columns: repeat(3, 1fr);\n  }\n"]))),wt=on.Ay.div(xe||(xe=(0,I.A)(["\n  display: flex;\n  flex-direction: column;\n  gap: 6px;\n"]))),kt=on.Ay.label(he||(he=(0,I.A)(["\n  font-size: 12px;\n  font-weight: 600;\n  color: #666;\n  text-transform: uppercase;\n  letter-spacing: 0.05em;\n"]))),zt=on.Ay.div(fe||(fe=(0,I.A)(["\n  height: 42px;\n  display: flex;\n  align-items: center;\n  padding: 0 12px;\n  background: #f7f6f3;\n  border-radius: 6px;\n  font-size: 15px;\n  color: #333;\n"]))),Ct=(0,on.Ay)(K.A)(ge||(ge=(0,I.A)(["\n  height: 42px;\n  border-radius: 6px;\n  border: 1px solid #d1cfc7;\n  font-size: 15px;\n\n  &:hover,\n  &:focus {\n    border-color: #2d724f;\n  }\n"]))),St=on.Ay.section(ue||(ue=(0,I.A)(["\n  padding: 20px 16px;\n  max-width: 800px;\n  margin: 0 auto;\n\n  @media (min-width: 768px) {\n    padding: 32px;\n  }\n"]))),Lt=on.Ay.div(me||(me=(0,I.A)(["\n  display: flex;\n  flex-direction: column;\n  gap: 12px;\n  margin-bottom: 20px;\n\n  @media (min-width: 640px) {\n    flex-direction: row;\n    align-items: center;\n    justify-content: space-between;\n  }\n"]))),_t=on.Ay.h2(be||(be=(0,I.A)(["\n  font-size: 16px;\n  font-weight: 600;\n  color: #1a1a1a;\n  margin: 0;\n  display: flex;\n  align-items: center;\n  gap: 12px;\n"]))),Ot=on.Ay.span(Ae||(Ae=(0,I.A)(["\n  font-size: 13px;\n  font-weight: 400;\n  color: #888;\n"]))),Pt=on.Ay.div(ye||(ye=(0,I.A)(["\n  display: flex;\n  flex-direction: column;\n  gap: 8px;\n"]))),Rt=on.Ay.div(ve||(ve=(0,I.A)(["\n  margin-bottom: 24px;\n\n  &:last-child {\n    margin-bottom: 0;\n  }\n"]))),Et=on.Ay.h3(je||(je=(0,I.A)(["\n  font-size: 13px;\n  font-weight: 600;\n  color: #888;\n  text-transform: uppercase;\n  letter-spacing: 0.05em;\n  margin: 0 0 12px 4px;\n"]))),$t=on.Ay.div(we||(we=(0,I.A)(["\n  background: #fffffe;\n  border-radius: 10px;\n  overflow: hidden;\n  transition: box-shadow 0.15s ease;\n  border-left: 3px solid\n    ",";\n\n  &:hover {\n    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);\n  }\n"])),n=>{switch(n.status){case"approved":return"#2d724f";case"remark":return"#f59e0b";
1case"rejected":return"#c53030";default:return"#d1cfc7"}}),Ft=on.Ay.div(ke||(ke=(0,I.A)(["\n  display: flex;\n  align-items: center;\n  justify-content: space-between;\n  padding: 14px 16px;\n  cursor: pointer;\n  gap: 12px;\n\n  @media (min-width: 768px) {\n    padding: 16px 20px;\n  }\n"]))),Dt=on.Ay.div(ze||(ze=(0,I.A)(["\n  display: flex;\n  align-items: center;\n  gap: 12px;\n  flex: 1;\n  min-width: 0;\n"]))),It=on.Ay.div(Ce||(Ce=(0,I.A)(["\n  flex-shrink: 0;\n  color: ",";\n"])),n=>{switch(n.status){case"approved":return"#2d724f";case"remark":return"#f59e0b";case"rejected":return"#c53030";default:return"#d1cfc7"}}),Wt=on.Ay.span(Se||(Se=(0,I.A)(["\n  font-size: 15px;\n  font-weight: 500;\n  color: #1a1a1a;\n  white-space: nowrap;\n  overflow: hidden;\n  text-overflow: ellipsis;\n"]))),Bt=on.Ay.span(Le||(Le=(0,I.A)(["\n  font-size: 12px;\n  color: #888;\n  background: #f5f5f5;\n  padding: 2px 8px;\n  border-radius: 4px;\n  flex-shrink: 0;\n"]))),Nt=on.Ay.div(_e||(_e=(0,I.A)(["\n  display: flex;\n  gap: 6px;\n  color: #888;\n  flex-shrink: 0;\n"]))),Tt=on.Ay.div(Oe||(Oe=(0,I.A)(["\n  display: flex;\n  align-items: center;\n  gap: 12px;\n  flex-shrink: 0;\n"]))),Kt=on.Ay.div(Pe||(Pe=(0,I.A)(["\n  display: flex;\n  gap: 4px;\n"]))),Ut=(0,on.AH)(Re||(Re=(0,I.A)(["\n  width: 40px;\n  height: 40px;\n  border-radius: 8px;\n  border: none;\n  display: flex;\n  align-items: center;\n  justify-content: center;\n  cursor: pointer;\n  transition: all 0.15s ease;\n\n  @media (min-width: 768px) {\n    width: 36px;\n    height: 36px;\n  }\n"]))),Gt=on.Ay.button(Ee||(Ee=(0,I.A)(["\n  ","\n  background: ",";\n  color: ",";\n  border: 2px solid #2d724f;\n\n  &:hover {\n    background: ",";\n  }\n\n  &:active {\n    transform: scale(0.95);\n  }\n"])),Ut,n=>n.active?"#2d724f":"#fff",n=>n.active?"white":"#2d724f",n=>n.active?"#245f41":"#e8f5e9"),Mt=on.Ay.button($e||($e=(0,I.A)(["\n  ","\n  background: ",";\n  color: ",";\n  border: 2px solid #f59e0b;\n\n  &:hover {\n    background: ",";\n  }\n\n  &:active {\n    transform: scale(0.95);\n  }\n"])),Ut,n=>n.active?"#f59e0b":"#fff",n=>n.active?"white":"#f59e0b",n=>n.active?"#d97706":"#fffbeb"),Yt=on.Ay.button(Fe||(Fe=(0,I.A)(["\n  ","\n  background: ",";\n  color: ",";\n  border: 2px solid #c53030;\n\n  &:hover {\n    background: ",";\n  }\n\n  &:active {\n    transform: scale(0.95);\n  }\n"])),Ut,n=>n.active?"#c53030":"#fff",n=>n.active?"white":"#c53030",n=>n.active?"#9b2c2c":"#ffebee"),Ht=on.Ay.div(De||(De=(0,I.A)(["\n  color: #888;\n  display: flex;\n  align-items: center;
1\n"]))),Jt=on.Ay.div(Ie||(Ie=(0,I.A)(["\n  display: ",";\n  padding: 0 16px 16px;\n  border-top: 1px solid #f0ede8;\n  animation: "," 0.2s ease;\n\n  @media (min-width: 768px) {\n    padding: 0 20px 20px;\n  }\n"])),n=>n.expanded?"block":"none",ft),Vt=on.Ay.div(We||(We=(0,I.A)(["\n  margin-top: 16px;\n"]))),Zt=on.Ay.label(Be||(Be=(0,I.A)(["\n  display: block;\n  font-size: 12px;\n  font-weight: 600;\n  color: #666;\n  text-transform: uppercase;\n  letter-spacing: 0.05em;\n  margin-bottom: 8px;\n"]))),Qt=(0,on.Ay)(K.A.TextArea)(Ne||(Ne=(0,I.A)(["\n  border-radius: 8px;\n  border: 1px solid ",";\n  font-size: 14px;\n  resize: none;\n\n  &:hover,\n  &:focus {\n    border-color: ",";\n  }\n"])),n=>n.$error?"#e5a3a3":"#e8e6e1",n=>n.$error?"#c53030":"#2d724f"),Xt=on.Ay.span(Te||(Te=(0,I.A)(["\n  display: inline-flex;\n  align-items: center;\n  gap: 4px;\n  flex-shrink: 0;\n  font-size: 11px;\n  font-weight: 600;\n  padding: 3px 8px;\n  border-radius: 6px;\n  background: rgba(197, 48, 48, 0.1);\n  color: #c53030;\n  white-space: nowrap;\n"]))),qt=on.Ay.p(Ke||(Ke=(0,I.A)(["\n  margin: 6px 0 0;\n  font-size: 12px;\n  color: #c53030;\n"]))),ni=on.Ay.div(Ue||(Ue=(0,I.A)(["\n  display: flex;\n  flex-wrap: wrap;\n  gap: 6px;\n  margin-bottom: 10px;\n"]))),ei=on.Ay.div(Ge||(Ge=(0,I.A)(["\n  width: 52px;\n  height: 52px;\n  border-radius: 8px;\n  overflow: hidden;\n  background: #f5f5f5;\n  border: 1px solid #eee;\n\n  img {\n    width: 100%;\n    height: 100%;\n    object-fit: cover;\n    display: block;\n  }\n"]))),ti=on.Ay.button(Me||(Me=(0,I.A)(["\n  display: flex;\n  align-items: center;\n  gap: 8px;\n  padding: 10px 16px;\n  background: #f7f6f3;\n  border: 1px dashed #d1cfc7;\n  border-radius: 8px;\n  color: #666;\n  font-size: 14px;\n  cursor: pointer;\n  transition: all 0.15s ease;\n\n  &:hover {\n    border-color: #2d724f;\n    color: #2d724f;\n    background: #f0f7f4;\n  }\n"]))),ii=on.Ay.div(Ye||(Ye=(0,I.A)(["\n  margin-top: 16px;\n  padding-top: 16px;\n  border-top: 1px solid #f0ede8;\n  display: flex;\n"]))),ri=(0,on.Ay)(rn.N_)(He||(He=(0,I.A)(["\n  display: inline-flex;\n  align-items: center;\n  gap: 6px;\n  padding: 8px 14px;\n  border-radius: 8px;\n  background: #f0f7f4;\n  font-size: 0.85rem;\n  font-weight: 600;\n  transition: background 0.15s ease;\n\n  &,\n  &:link,\n  &:visited {\n    color: #2d724f;\n  }\n\n  &:hover {\n    background: #e3f0ea;\n    color: #245f41;\n  }\n\n  svg:last-child {\n    opacity: 0.6;\n  }\n"]))),oi=on.Ay.div(Je||(Je=(0,I.A)(["\n  margin-top: 16px;\n"]))),ai=on.Ay.div(Ve||(Ve=(0,I.A)(["\n  display: flex;\n  flex-wrap: wrap;\n  gap: 8px;\n"]))),si=on.Ay.div(Ze||(Ze=(0,I.A)(["\n  position: relative;\n  width: 64px;\n  height: 64px;\n  border-radius: 8px;\n  overflow: hidden;\n  background: #f5f5f5;\n"]))),di=on.Ay.button(Qe||(Qe=(0,I.A)(["\n  position: absolute;\n  top: 4px;\n  right: 4px;\n  width: 20px;\n  height: 20px;\n  border: none;\n  border-radius: 50%;\n  background: rgba(26, 26, 26, 0.75);\n  color: white;\n  cursor: pointer;\n  display: flex;\n  align-items: center;\n  justify-content: center;\n  padding: 0;\n  transition: background 0.15s ease;\n\n  &:hover {\n    background: #c53030;\n  }\n"]))),li=(on.Ay.img(Xe||(Xe=(0,I.A)(["\n  width: 100%;\n  height: 100%;\n  object-fit: cover;\n"]))),on.Ay.section(qe||(qe=(0,I.A)(["\n  padding: 20px 16px 32px;\n  max-width: 800px;\n  margin: 0 auto;\n\n  @media (min-width: 768px) {\n    padding: 0 32px 48px;\n  }\n"])))),ci=on.Ay.div(nt||(nt=(0,I.A)(["\n  background: #fffffe;\n  border-radius: 12px;\n  padding: 20px;\n  margin-bottom: 20px;\n\n  @media (min-width: 768px) {\n    padding: 24px;\n  }\n"]))),pi=on.Ay.h3(et||(et=(0,I.A)(["\n  font-size: 14px;\n  font-weight: 600;\n  color: #666;\n  text-transform: uppercase;\n  letter-spacing: 0.05em;\n  margin: 0 0 16px;\n"]))),xi=on.Ay.div(tt||(tt=(0,I.A)(["\n  display: flex;\n  flex-wrap: wrap;\n  gap: 16px;\n  margin-bottom: 20px;\n"]))),hi=on.Ay.div(it||(it=(0,I.A)(["\n  display: flex;\n  align-items: center;\n  gap: 8px;\n  font-size: 14px;\n  color: ",";\n"])),n=>{switch(n.status){case"approved":return"#2d724f";case"remark":return"#f59e0b";
1case"rejected":return"#c53030";default:return"#666"}}),fi=on.Ay.div(rt||(rt=(0,I.A)(["\n  padding-top: 16px;\n  border-top: 1px solid #f0ede8;\n"]))),gi=(0,on.Ay)(U.Ay)(ot||(ot=(0,I.A)(["\n  width: 100%;\n  height: 52px;\n  font-size: 16px;\n  font-weight: 600;\n  border-radius: 10px;\n  background: #1a1a1a;\n  border: none;\n\n  &:hover:not(:disabled) {\n    background: #333;\n  }\n\n  &:disabled {\n    background: #d1cfc7;\n    color: #888;\n  }\n\n  @media (min-width: 768px) {\n    width: auto;\n    min-width: 200px;\n    height: 48px;\n  }\n"]))),ui=on.Ay.p(at||(at=(0,I.A)(["\n  text-align: center;\n  font-size: 13px;\n  color: #999;\n  margin-top: 8px;\n\n  @media (min-width: 768px) {\n    text-align: left;\n  }\n"]))),mi=on.Ay.div(st||(st=(0,I.A)(["\n  display: flex;\n  flex-direction: column;\n  align-items: center;\n  justify-content: center;\n  min-height: 60vh;\n  gap: 16px;\n  color: #666;\n\n  p {\n    margin: 0;\n    font-size: 15px;\n  }\n"]))),bi=ht},50282(n,e,t){t.d(e,{R:()=>a});var i=t(6890);let r;async function o(n){if(!n||!n.type||!n.type.startsWith("image/"))return n;if("image/gif"===n.type)return n;try{const e=(()=>{if(void 0===r)try{r=document.createElement("canvas").toDataURL("image/webp").startsWith("data:image/webp")}catch(n){r=!1}return r})()?"image/webp":"image/jpeg",t=await(0,i.A)(n,{maxWidthOrHeight:1920,maxSizeMB:1,fileType:e,initialQuality:.8,useWebWorker:!0});if(t.size>=n.size)return n;const o="image/webp"===e?".webp":".jpg",a=n.name.replace(/\.[^.]*$/,"")+o;return new File([t],a,{type:e})}catch(e){return n}}function a(n){return Promise.all(Array.from(n).map(o))}},31068(n,e,t){t.d(e,{A:()=>a});var i=t(89379),r=t(28429),o=t(44414);const a=function(n){return function(e){let t=(0,r.zy)(),a=(0,r.Zp)(),s=(0,r.g)();return(0,o.jsx)(n,(0,i.A)((0,i.A)({},e),{},{router:{location:t,navigate:a,params:s}}))}}},49585(n,e,t){t.d(e,{A:()=>p});var i=t(9950),r=t(9629),o=Object.defineProperty,a=Object.getOwnPropertySymbols,s=Object.prototype.hasOwnProperty,d=Object.prototype.propertyIsEnumerable,l=(n,e,t)=>e in n?o(n,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[e]=t,c=(n,e)=>{for(var t in e||(e={}))s.call(e,t)&&l(n,t,e[t]);if(a)for(var t of a(e))d.call(e,t)&&l(n,t,e[t]);return n};var p=(0,i.forwardRef)((n,e)=>{const t=i.useContext(r.h),o=c(c({},t),n);return i.createElement("svg",c({width:"1.5em",height:"1.5em",viewBox:"0 0 24 24",strokeWidth:1.5,fill:"none",xmlns:"http://www.w3.org/2000/svg",color:"currentColor",ref:e},o),i.createElement("path",{d:"M14.3632 5.65156L15.8431 4.17157C16.6242 3.39052 17.8905 3.39052 18.6716 4.17157L20.0858 5.58579C20.8668 6.36683 20.8668 7.63316 20.0858 8.41421L18.6058 9.8942M14.3632 5.65156L4.74749 15.2672C4.41542 15.5993 4.21079 16.0376 4.16947 16.5054L3.92738 19.2459C3.87261 19.8659 4.39148 20.3848 5.0115 20.33L7.75191 20.0879C8.21972 20.0466 8.65806 19.8419 8.99013 19.5099L18.6058 9.8942M14.3632 5.65156L18.6058 9.8942",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round"}))})},20305(n,e,t){t.d(e,{A:()=>p});var i=t(9950),r=t(9629),o=Object.defineProperty,a=Object.getOwnPropertySymbols,s=Object.prototype.hasOwnProperty,d=Object.prototype.propertyIsEnumerable,l=(n,e,t)=>e in n?o(n,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[e]=t,c=(n,e)=>{for(var t in e||(e={}))s.call(e,t)&&l(n,t,e[t]);if(a)for(var t of a(e))d.call(e,t)&&l(n,t,e[t]);return n};var p=(0,i.forwardRef)((n,e)=>{const t=i.useContext(r.h),o=c(c({},t),n);return i.createElement("svg",c({width:"1.5em",height:"1.5em",strokeWidth:1.5,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",color:"currentColor",ref:e},o),i.createElement("path",{d:"M21 3.6V20.4C21 20.7314 20.7314 21 20.4 21H3.6C3.26863 21 3 20.7314 3 20.4V3.6C3 3.26863 3.26863 3 3.6 3H20.4C20.7314 3 21 3.26863 21 3.6Z",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round"}),i.createElement("path",{d:"M3 16L10 13L21 18",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round"}),i.createElement("path",{d:"M16 10C14.8954 10 14 9.10457 14 8C14 6.89543 14.8954 6 16 6C17.1046 6 18 6.89543 18 8C18 9.10457 17.1046 10 16 10Z",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round"}))})},17155(n,e,t){t.d(e,{A:()=>p});var i=t(9950),r=t(9629),o=Object.defineProperty,a=Object.getOwnPropertySymbols,s=Object.prototype.hasOwnProperty,d=Object.prototype.propertyIsEnumerable,l=(n,e,t)=>e in n?o(n,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[e]=t,c=(n,e)=>{for(var t in e||(e={}))s.call(e,t)&&l(n,t,e[t]);if(a)for(var t of a(e))d.call(e,t)&&l(n,t,e[t]);return n};var p=(0,i.forwardRef)((n,e)=>{const t=i.useContext(r.h),o=c(c({},t),n);return i.createElement("svg",c({width:"1.5em",height:"1.5em",strokeWidth:1.5,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",color:"currentColor",ref:e},o),i.createElement("path",{d:"M15 6L9 12L15 18",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round"}))})},34830(n,e,t){t.d(e,{A:()=>p});var i=t(9950),r=t(9629),o=Object.defineProperty,a=Object.getOwnPropertySymbols,s=Object.prototype.hasOwnProperty,d=Object.prototype.propertyIsEnumerable,l=(n,e,t)=>e in n?o(n,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[e]=t,c=(n,e)=>{for(var t in e||(e={}))s.call(e,t)&&l(n,t,e[t]);if(a)for(var t of a(e))d.call(e,t)&&l(n,t,e[t]);return n};var p=(0,i.forwardRef)((n,e)=>{const t=i.useContext(r.h),o=c(c({},t),n);return i.createElement("svg",c({width:"1.5em",height:"1.5em",strokeWidth:1.5,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",color:"currentColor",ref:e},o),i.createElement("path",{d:"M18.1182 14.702L14 15.5C11.2183 14.1038 9.5 12.5 8.5 10L9.26995 5.8699L7.81452 2L4.0636 2C2.93605 2 2.04814 2.93178 2.21654 4.04668C2.63695 6.83 3.87653 11.8765 7.5 15.5C11.3052 19.3052 16.7857 20.9564 19.802 21.6127C20.9668 21.8662 22 20.9575 22 19.7655L22 16.1812L18.1182 14.702Z",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round"}))})}}]);

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.