@ahrowe/ui 0.1.6 → 0.1.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.cjs CHANGED
@@ -2,5 +2,5 @@ Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});var e=Object.
2
2
  `),s=n.map(t=>{let n=e.points[t.wallIndex],r=e.points[(t.wallIndex+1)%e.points.length],i=$t(n,r,t);return i?` <path d="${i}" fill="none" />`:``}).filter(Boolean).join(`
3
3
  `),c=e.name?` <text fontSize="5" x="${a.x.toFixed(1)}" y="${a.y.toFixed(1)}">${Xt(e.name)}</text>`:``;return[` <g id="${e.id}">`,o,` <path id="background" d="${i}" />`,s,c,` </g>`].filter(Boolean).join(`
4
4
  `)});return[`<svg xmlns="http://www.w3.org/2000/svg" version="1.1" viewBox="${o}">`,` <g id="layer1">`,...s,` </g>`,` <use id="use" href="" />`,`</svg>`].join(`
5
- `)}function tn(e){let t=[];for(let n of e.matchAll(/[ML]\s*([-\d.]+)[,\s]+([-\d.]+)/gi))t.push({x:parseFloat(n[1]),y:parseFloat(n[2])});return t}function nn(e){let t=new DOMParser().parseFromString(e,`image/svg+xml`),n=[];return t.querySelectorAll(`[id^="room"]`).forEach(e=>{let t=e.querySelector(`[id="background"]`);if(!t)return;let r=t.getAttribute(`d`);if(!r)return;let i=tn(r);if(i.length<3)return;let a=e.querySelector(`text`)?.textContent?.trim()??``;n.push({id:e.id,name:a,points:i})}),n}function rn(e,t){let n=en(e,t),r=new Blob([n],{type:`image/svg+xml`}),i=URL.createObjectURL(r),a=document.createElement(`a`);a.href=i,a.download=`room-plan.svg`,a.click(),URL.revokeObjectURL(i)}var Z={roomDrawer:`roomDrawer_SJj4-`,"roomDrawer-toolbar":`roomDrawer-toolbar_55H5p`,roomDrawerToolbar:`roomDrawer-toolbar_55H5p`,"roomDrawer-toolbar-sep":`roomDrawer-toolbar-sep_nJeh8`,roomDrawerToolbarSep:`roomDrawer-toolbar-sep_nJeh8`,"roomDrawer-toolbar-btn":`roomDrawer-toolbar-btn_2qinY`,roomDrawerToolbarBtn:`roomDrawer-toolbar-btn_2qinY`,"roomDrawer-toolbar-btn-active":`roomDrawer-toolbar-btn-active_4XX25`,roomDrawerToolbarBtnActive:`roomDrawer-toolbar-btn-active_4XX25`,"roomDrawer-toolbar-zoomLabel":`roomDrawer-toolbar-zoomLabel_HMkb5`,roomDrawerToolbarZoomLabel:`roomDrawer-toolbar-zoomLabel_HMkb5`,"roomDrawer-canvas":`roomDrawer-canvas_Y18uD`,roomDrawerCanvas:`roomDrawer-canvas_Y18uD`,"roomDrawer-canvas-select":`roomDrawer-canvas-select_M43-x`,roomDrawerCanvasSelect:`roomDrawer-canvas-select_M43-x`,"roomDrawer-info":`roomDrawer-info_qwC6L`,roomDrawerInfo:`roomDrawer-info_qwC6L`,"roomDrawer-info-label":`roomDrawer-info-label_8I9hB`,roomDrawerInfoLabel:`roomDrawer-info-label_8I9hB`,"roomDrawer-info-input":`roomDrawer-info-input_YAl-K`,roomDrawerInfoInput:`roomDrawer-info-input_YAl-K`,"roomDrawer-info-spacer":`roomDrawer-info-spacer_cOj96`,roomDrawerInfoSpacer:`roomDrawer-info-spacer_cOj96`,"roomDrawer-info-delete":`roomDrawer-info-delete_TSBUN`,roomDrawerInfoDelete:`roomDrawer-info-delete_TSBUN`,"roomDrawer-hint":`roomDrawer-hint_3WTFa`,roomDrawerHint:`roomDrawer-hint_3WTFa`,"roomDrawer-info-doorsBtn":`roomDrawer-info-doorsBtn_oK5Uf`,roomDrawerInfoDoorsBtn:`roomDrawer-info-doorsBtn_oK5Uf`,"roomDrawer-doorPanel":`roomDrawer-doorPanel_e-Tl9`,roomDrawerDoorPanel:`roomDrawer-doorPanel_e-Tl9`,"roomDrawer-doorPanel-header":`roomDrawer-doorPanel-header_--iXz`,roomDrawerDoorPanelHeader:`roomDrawer-doorPanel-header_--iXz`,"roomDrawer-doorPanel-icon":`roomDrawer-doorPanel-icon_KxaVY`,roomDrawerDoorPanelIcon:`roomDrawer-doorPanel-icon_KxaVY`,"roomDrawer-doorPanel-title":`roomDrawer-doorPanel-title_8nOZS`,roomDrawerDoorPanelTitle:`roomDrawer-doorPanel-title_8nOZS`,"roomDrawer-doorPanel-done":`roomDrawer-doorPanel-done_ejQkx`,roomDrawerDoorPanelDone:`roomDrawer-doorPanel-done_ejQkx`,"roomDrawer-doorPanel-list":`roomDrawer-doorPanel-list_rDou7`,roomDrawerDoorPanelList:`roomDrawer-doorPanel-list_rDou7`,"roomDrawer-doorPanel-item":`roomDrawer-doorPanel-item_U-3-B`,roomDrawerDoorPanelItem:`roomDrawer-doorPanel-item_U-3-B`,"roomDrawer-doorPanel-label":`roomDrawer-doorPanel-label_qSYqY`,roomDrawerDoorPanelLabel:`roomDrawer-doorPanel-label_qSYqY`,"roomDrawer-doorPanel-widthLabel":`roomDrawer-doorPanel-widthLabel_jXv7D`,roomDrawerDoorPanelWidthLabel:`roomDrawer-doorPanel-widthLabel_jXv7D`,"roomDrawer-doorPanel-empty":`roomDrawer-doorPanel-empty_LcDw0`,roomDrawerDoorPanelEmpty:`roomDrawer-doorPanel-empty_LcDw0`,"roomDrawer-canvas-door":`roomDrawer-canvas-door_qzCIa`,roomDrawerCanvasDoor:`roomDrawer-canvas-door_qzCIa`,doorGap:`doorGap_KrIuB`,doorMarker:`doorMarker_-N63z`,gridLine:`gridLine_V-rxw`,roomFill:`roomFill_JnJ0J`,"roomFill-selected":`roomFill-selected_IfIRr`,roomFillSelected:`roomFill-selected_IfIRr`,roomStroke:`roomStroke_S18UH`,"roomStroke-selected":`roomStroke-selected_fm19u`,roomStrokeSelected:`roomStroke-selected_fm19u`,roomText:`roomText_6fIeU`,doorPanel:`doorPanel_raCv0`,"doorPanel-selected":`doorPanel-selected_5DG7g`,doorPanelSelected:`doorPanel-selected_5DG7g`,doorSwing:`doorSwing_Tbt9D`,"doorSwing-selected":`doorSwing-selected_fFte5`,doorSwingSelected:`doorSwing-selected_fFte5`,preview:`preview_seIZY`,polyCloseTarget:`polyCloseTarget_snjYx`,polyVertex:`polyVertex_fw0nX`,vertexHandle:`vertexHandle_-z7g5`},an=6,on=5,sn=1.25,cn=.25,ln=12,un=0;function dn(e){return un+=1,`${e}${un}`}var fn={select:`Drag inside to move · Drag corner to reshape · Click wall to add corner · Dbl-click corner to remove · Delete to erase`,rect:`Drag to draw a rectangular room`,polygon:`Click to place corners · Click first point or Enter to close · Esc to cancel`};function pn({className:e}){let[t,n]=(0,c.useState)([]),[r,i]=(0,c.useState)([]),[a,o]=(0,c.useState)(`rect`),[s,p]=(0,c.useState)(null),[m,h]=(0,c.useState)(null),[g,_]=(0,c.useState)(null),[v,y]=(0,c.useState)(null),[b,x]=(0,c.useState)([]),[S,C]=(0,c.useState)(null),[w,T]=(0,c.useState)(1),[E,D]=(0,c.useState)({x:0,y:0}),O=(0,c.useRef)(null),k=(0,c.useRef)(null),A=(0,c.useRef)(null),j=(0,c.useRef)(null),ee=(0,c.useRef)(null),M=(0,c.useRef)({rooms:t,doors:r,tool:a,selectedId:s,editingDoorsForRoomId:m,polyPoints:b,zoom:w,pan:E});(0,c.useLayoutEffect)(()=>{M.current={rooms:t,doors:r,tool:a,selectedId:s,editingDoorsForRoomId:m,polyPoints:b,zoom:w,pan:E}});function te(e){e.length<3||(n(t=>[...t,{id:dn(`room`),name:`Room ${t.length+1}`,points:e}]),x([]),C(null))}(0,c.useEffect)(()=>{let e=j.current;if(!e)return;function t(e){e.preventDefault();let{zoom:t,pan:n}=M.current,r=Ht(e.clientX,e.clientY,j.current);if(!r)return;let i=e.deltaY<0?sn:1/sn,a=Math.max(cn,Math.min(ln,t*i));D({x:r.x-(r.x-n.x)*(t/a),y:r.y-(r.y-n.y)*(t/a)}),T(a)}return e.addEventListener(`wheel`,t,{passive:!1}),()=>e.removeEventListener(`wheel`,t)},[]),(0,c.useEffect)(()=>{function e(e){let{tool:t,selectedId:r,editingDoorsForRoomId:a,polyPoints:o,zoom:s,pan:c}=M.current;if(e.key===`Escape`){if(a){h(null);return}t===`polygon`&&(x([]),C(null)),p(null);return}if(e.key===`Enter`&&t===`polygon`&&o.length>=3){te(o);return}if((e.key===`+`||e.key===`=`)&&!(e.target instanceof HTMLInputElement)){let e=Math.max(cn,Math.min(ln,s*sn)),t=c.x+400/s/2,n=c.y+300/s/2;T(e),D({x:t-400/e/2,y:n-300/e/2});return}if(e.key===`-`&&!(e.target instanceof HTMLInputElement)){let e=Math.max(cn,Math.min(ln,s/sn)),t=c.x+400/s/2,n=c.y+300/s/2;T(e),D({x:t-400/e/2,y:n-300/e/2});return}if(e.key===`0`&&!(e.target instanceof HTMLInputElement)){T(1),D({x:0,y:0});return}(e.key===`Delete`||e.key===`Backspace`)&&r&&!a&&!(e.target instanceof HTMLInputElement)&&(n(e=>e.filter(e=>e.id!==r)),i(e=>e.filter(e=>e.roomId!==r)),p(null))}return window.addEventListener(`keydown`,e),()=>window.removeEventListener(`keydown`,e)},[]);function N(e,t=w,n=E){let r=Math.max(cn,Math.min(ln,t*e)),i=n.x+400/t/2,a=n.y+300/t/2;D({x:i-400/r/2,y:a-300/r/2}),T(r)}function ne(e){return j.current?Ht(e.clientX,e.clientY,j.current):null}function re(e,t){let n=null;for(let r=0;r<t.points.length;r++){let i=Ut(e,t.points[r]);i<=an&&(!n||i<n.d)&&(n={index:r,d:i})}return n}function P(e,t){let n=null;for(let r=0;r<t.points.length;r++){let i=t.points[r],a=t.points[(r+1)%t.points.length],{dist:o,t:s}=Wt(e,i,a);o<=on&&(!n||o<n.d)&&(n={index:r,t:s,d:o})}return n}function ie(e,t,r,a){return n(n=>n.map(n=>{if(n.id!==e)return n;let r=[...n.points];return r.splice(t+1,0,a),{...n,points:r}})),i(n=>n.map(n=>n.roomId===e?n.wallIndex===t?n.t<=r?{...n,t:r>0?n.t/r:0}:{...n,wallIndex:t+1,t:(n.t-r)/(1-r)}:n.wallIndex>t?{...n,wallIndex:n.wallIndex+1}:n:n)),t+1}function ae(e,r){let a=t.find(t=>t.id===e);if(!a||a.points.length<=3)return;let o=a.points.length;n(t=>t.map(t=>t.id===e?{...t,points:t.points.filter((e,t)=>t!==r)}:t)),i(t=>t.map(t=>{if(t.roomId!==e)return t;let n=(r-1+o)%o;return t.wallIndex===n||t.wallIndex===r?{...t,wallIndex:-1}:t.wallIndex>r?{...t,wallIndex:t.wallIndex-1}:t}).filter(e=>e.wallIndex!==-1))}function F(e){if(e.button===1){e.preventDefault();let t=j.current;if(t){let n=t.getBoundingClientRect();A.current={startClient:{x:e.clientX,y:e.clientY},origPan:{...E},scaleX:400/w/n.width,scaleY:300/w/n.height}}return}if(e.button!==0)return;e.preventDefault();let n=ne(e);if(n){if(m){let e=t.find(e=>e.id===m);if(e){let t=Gt(n,[e]);t&&i(e=>[...e,{id:dn(`door`),roomId:t.roomId,wallIndex:t.wallIndex,t:t.t,width:12}])}return}if(a===`rect`){_(n),y(n);return}if(a===`polygon`){b.length>=3&&Ut(n,b[0])<=8?te(b):x(e=>[...e,n]);return}if(a===`select`){let e=t.find(e=>e.id===s)??null;if(e){let t=re(n,e);if(t){O.current={type:`vertex`,roomId:e.id,index:t.index,start:n,origPt:e.points[t.index]};return}}if(e){let t=P(n,e);if(t){let r=e.points[t.index],i=e.points[(t.index+1)%e.points.length],a=Vt({x:r.x+(i.x-r.x)*t.t,y:r.y+(i.y-r.y)*t.t}),o=ie(e.id,t.index,t.t,a);O.current={type:`vertex`,roomId:e.id,index:o,start:n,origPt:a};return}}let r=t.find(e=>Kt(n,e.points));if(r){p(r.id),O.current={type:`room`,roomId:r.id,start:n,origPoints:[...r.points]};return}p(null)}}}function I(e){if(a!==`select`||m)return;let n=ne(e);if(!n)return;let r=t.find(e=>e.id===s);if(!r)return;let i=re(n,r);i&&(e.preventDefault(),ae(r.id,i.index))}function L(e){if(A.current){let{startClient:t,origPan:n,scaleX:r,scaleY:i}=A.current;D({x:n.x-(e.clientX-t.x)*r,y:n.y-(e.clientY-t.y)*i});return}let r=ne(e);if(r){if(k.current&&m){let e=t.find(e=>e.id===m);if(e){let t=Gt(r,[e]);t&&i(e=>e.map(e=>e.id===k.current?{...e,wallIndex:t.wallIndex,t:t.t}:e))}return}if(a===`rect`&&g){y(r);return}if(a===`polygon`){C(r);return}if(a===`select`&&!m&&O.current){let e=O.current;if(e.type===`vertex`){let t=r.x-e.start.x,i=r.y-e.start.y,a=Vt({x:e.origPt.x+t,y:e.origPt.y+i});n(t=>t.map(t=>{if(t.id!==e.roomId)return t;let n=[...t.points];return n[e.index]=a,{...t,points:n}}))}else{let t=r.x-e.start.x,i=r.y-e.start.y;n(n=>n.map(n=>n.id===e.roomId?{...n,points:e.origPoints.map(e=>({x:e.x+t,y:e.y+i}))}:n))}}}}function R(e){if(A.current){A.current=null;return}let t=ne(e);if(t){if(a===`rect`&&g){let e=Math.min(g.x,t.x),r=Math.min(g.y,t.y),i=Math.abs(t.x-g.x),a=Math.abs(t.y-g.y);i>=10&&a>=10&&n(t=>[...t,{id:dn(`room`),name:`Room ${t.length+1}`,points:Jt(e,r,i,a)}]),_(null),y(null)}k.current=null,O.current=null}}function z(e){s&&n(t=>t.map(t=>t.id===s?{...t,name:e}:t))}function B(e,t){let n=parseFloat(t);isNaN(n)||n<=0||i(t=>t.map(t=>t.id===e?{...t,width:n}:t))}function oe(){s&&(n(e=>e.filter(e=>e.id!==s)),i(e=>e.filter(e=>e.roomId!==s)),h(null),p(null))}function se(e){i(t=>t.filter(t=>t.id!==e))}function ce(e){o(e),h(null),x([]),C(null),_(null),y(null)}function le(e){let t=e.target.files?.[0];if(!t)return;e.target.value=``;let r=new FileReader;r.onload=e=>{let t=e.target?.result;if(typeof t!=`string`)return;let r=nn(t);r.length!==0&&(n(r.map(e=>({...e,id:dn(`room`)}))),i([]),p(null),h(null),T(1),D({x:0,y:0}))},r.readAsText(t)}let V=a===`rect`&&g&&v?{x:Math.min(g.x,v.x),y:Math.min(g.y,v.y),w:Math.abs(v.x-g.x),h:Math.abs(v.y-g.y)}:null,H=s?t.find(e=>e.id===s)??null:null,U=m?t.find(e=>e.id===m)??null:null,W=m?r.filter(e=>e.roomId===m):[],ue=[{t:`select`,icon:d.faHandPointer,label:`Select & edit`},{t:`rect`,icon:d.faSquare,label:`Rectangle room`},{t:`polygon`,icon:d.faDrawPolygon,label:`Polygon room`}],de=400/w,G=300/w,fe=m?Z.roomDrawerCanvasDoor:a===`select`?Z.roomDrawerCanvasSelect:void 0;return(0,f.jsxs)(`div`,{className:(0,l.default)(Z.roomDrawer,e),children:[(0,f.jsxs)(`div`,{className:Z.roomDrawerToolbar,children:[ue.map(({t:e,icon:t,label:n})=>(0,f.jsx)(`button`,{title:n,className:(0,l.default)(Z.roomDrawerToolbarBtn,e===a&&!m&&Z.roomDrawerToolbarBtnActive),onClick:()=>ce(e),children:(0,f.jsx)(u.FontAwesomeIcon,{icon:t})},e)),(0,f.jsx)(`div`,{className:Z.roomDrawerToolbarSep}),(0,f.jsx)(`button`,{title:`Zoom in (+)`,className:Z.roomDrawerToolbarBtn,onClick:()=>N(sn),disabled:w>=ln,children:(0,f.jsx)(u.FontAwesomeIcon,{icon:d.faMagnifyingGlassPlus})}),(0,f.jsxs)(`button`,{title:`Reset zoom (0) — ${Math.round(w*100)}%`,className:Z.roomDrawerToolbarZoomLabel,onClick:()=>{T(1),D({x:0,y:0})},children:[Math.round(w*100),`%`]}),(0,f.jsx)(`button`,{title:`Zoom out (−)`,className:Z.roomDrawerToolbarBtn,onClick:()=>N(1/sn),disabled:w<=cn,children:(0,f.jsx)(u.FontAwesomeIcon,{icon:d.faMagnifyingGlassMinus})}),(0,f.jsx)(`div`,{className:Z.roomDrawerToolbarSep}),(0,f.jsx)(`button`,{title:`Upload SVG`,className:Z.roomDrawerToolbarBtn,onClick:()=>ee.current?.click(),children:(0,f.jsx)(u.FontAwesomeIcon,{icon:d.faUpload})}),(0,f.jsx)(`button`,{title:`Download SVG`,className:Z.roomDrawerToolbarBtn,onClick:()=>rn(t,r),disabled:t.length===0,children:(0,f.jsx)(u.FontAwesomeIcon,{icon:d.faDownload})}),(0,f.jsx)(`input`,{ref:ee,type:`file`,accept:`.svg,image/svg+xml`,style:{display:`none`},onChange:le})]}),(0,f.jsxs)(`svg`,{ref:j,className:(0,l.default)(Z.roomDrawerCanvas,fe),viewBox:`${E.x} ${E.y} ${de} ${G}`,onMouseDown:F,onMouseMove:L,onMouseUp:R,onDoubleClick:I,children:[(0,f.jsx)(`defs`,{children:(0,f.jsx)(`pattern`,{id:`rd-grid`,width:5,height:5,patternUnits:`userSpaceOnUse`,children:(0,f.jsx)(`path`,{d:`M 5 0 L 0 0 0 5`,fill:`none`,className:Z.gridLine})})}),(0,f.jsx)(`rect`,{x:E.x,y:E.y,width:de,height:G,fill:`url(#rd-grid)`}),t.map(e=>{let t=e.points,n=t.map((e,t)=>`${t===0?`M`:`L`} ${e.x},${e.y}`).join(` `)+` Z`,i=Qt(t,r.filter(t=>t.roomId===e.id)),a=qt(t),o=s===e.id,c=m===e.id;return(0,f.jsxs)(`g`,{children:[(0,f.jsx)(`path`,{d:n,className:(0,l.default)(Z.roomFill,(o||c)&&Z.roomFillSelected)}),i.map((e,t)=>(0,f.jsx)(`path`,{d:e,className:(0,l.default)(Z.roomStroke,(o||c)&&Z.roomStrokeSelected)},t)),e.name&&(0,f.jsx)(`text`,{x:a.x,y:a.y,className:Z.roomText,textAnchor:`middle`,dominantBaseline:`middle`,children:e.name})]},e.id)}),r.map(e=>{let n=t.find(t=>t.id===e.roomId);if(!n)return null;let r=n.points[e.wallIndex],i=n.points[(e.wallIndex+1)%n.points.length],a=Yt(r,i,e.t,e.width);return a?(0,f.jsx)(`line`,{x1:a.p1.x,y1:a.p1.y,x2:a.p2.x,y2:a.p2.y,className:Z.doorGap},e.id):null}),m&&W.map(e=>{let n=t.find(t=>t.id===e.roomId);if(!n)return null;let r=n.points[e.wallIndex],i=n.points[(e.wallIndex+1)%n.points.length],a=Yt(r,i,e.t,e.width);if(!a)return null;let o={x:(a.p1.x+a.p2.x)/2,y:(a.p1.y+a.p2.y)/2};return(0,f.jsx)(`circle`,{cx:o.x,cy:o.y,r:2.5,className:Z.doorMarker,onMouseDown:t=>{t.button===0&&(t.preventDefault(),t.stopPropagation(),k.current=e.id)}},e.id)}),a===`select`&&!m&&H&&H.points.map((e,t)=>(0,f.jsx)(`circle`,{cx:e.x,cy:e.y,r:3.5,className:Z.vertexHandle},t)),V&&(0,f.jsx)(`rect`,{x:V.x,y:V.y,width:V.w,height:V.h,className:Z.preview}),a===`polygon`&&b.length>0&&(0,f.jsxs)(f.Fragment,{children:[(0,f.jsx)(`polyline`,{points:[...b,S??b[b.length-1]].map(e=>`${e.x},${e.y}`).join(` `),className:Z.preview}),b.length>=3&&(0,f.jsx)(`circle`,{cx:b[0].x,cy:b[0].y,r:8/2,className:Z.polyCloseTarget}),b.map((e,t)=>(0,f.jsx)(`circle`,{cx:e.x,cy:e.y,r:2,className:Z.polyVertex},t))]})]}),H&&!m&&(0,f.jsxs)(`div`,{className:Z.roomDrawerInfo,children:[(0,f.jsx)(`span`,{className:Z.roomDrawerInfoLabel,children:`Name`}),(0,f.jsx)(`input`,{className:Z.roomDrawerInfoInput,value:H.name,onChange:e=>z(e.target.value),placeholder:`Room name`}),(0,f.jsxs)(`button`,{className:Z.roomDrawerInfoDoorsBtn,onClick:()=>h(H.id),title:`Edit doors`,children:[(0,f.jsx)(u.FontAwesomeIcon,{icon:d.faDoorOpen}),(0,f.jsx)(`span`,{children:r.filter(e=>e.roomId===H.id).length})]}),(0,f.jsx)(`button`,{className:Z.roomDrawerInfoDelete,onClick:oe,title:`Delete room`,children:(0,f.jsx)(u.FontAwesomeIcon,{icon:d.faTrash})})]}),m&&U&&(0,f.jsxs)(`div`,{className:Z.roomDrawerDoorPanel,children:[(0,f.jsxs)(`div`,{className:Z.roomDrawerDoorPanelHeader,children:[(0,f.jsx)(u.FontAwesomeIcon,{icon:d.faDoorOpen,className:Z.roomDrawerDoorPanelIcon}),(0,f.jsx)(`span`,{className:Z.roomDrawerDoorPanelTitle,children:U.name?`Doors · ${U.name}`:`Doors`}),(0,f.jsxs)(`button`,{className:Z.roomDrawerDoorPanelDone,onClick:()=>h(null),title:`Done (Esc)`,children:[(0,f.jsx)(u.FontAwesomeIcon,{icon:d.faCheck}),`Done`]})]}),(0,f.jsxs)(`div`,{className:Z.roomDrawerDoorPanelList,children:[W.length===0&&(0,f.jsx)(`span`,{className:Z.roomDrawerDoorPanelEmpty,children:`Click on a wall to add a door`}),W.map((e,t)=>(0,f.jsxs)(`div`,{className:Z.roomDrawerDoorPanelItem,children:[(0,f.jsxs)(`span`,{className:Z.roomDrawerDoorPanelLabel,children:[`Door `,t+1]}),(0,f.jsx)(`span`,{className:Z.roomDrawerDoorPanelWidthLabel,children:`Width`}),(0,f.jsx)(`input`,{className:Z.roomDrawerInfoInput,type:`number`,min:1,value:e.width,onChange:t=>B(e.id,t.target.value)}),(0,f.jsx)(`button`,{className:Z.roomDrawerInfoDelete,onClick:()=>se(e.id),title:`Delete door`,children:(0,f.jsx)(u.FontAwesomeIcon,{icon:d.faTrash})})]},e.id))]})]}),(0,f.jsx)(`div`,{className:Z.roomDrawerHint,children:m?`Click a wall to add a door · Adjust width or delete from the list · Done or Esc to finish`:`${fn[a]} · Scroll to zoom · Middle-drag to pan · 0 to reset`})]})}var mn={"roomViewer-containerLoading":`roomViewer-containerLoading_BL3M-`,roomViewerContainerLoading:`roomViewer-containerLoading_BL3M-`,"roomViewer-container":`roomViewer-container_YlmB8`,roomViewerContainer:`roomViewer-container_YlmB8`,"roomViewer-active":`roomViewer-active_gG6wf`,roomViewerActive:`roomViewer-active_gG6wf`,"roomViewer-selected":`roomViewer-selected_CpdMj`,roomViewerSelected:`roomViewer-selected_CpdMj`,"roomViewer-tint":`roomViewer-tint_O9JrM`,roomViewerTint:`roomViewer-tint_O9JrM`,"roomViewer-actions":`roomViewer-actions_4cA74`,roomViewerActions:`roomViewer-actions_4cA74`,"roomViewer-header":`roomViewer-header_XEHCO`,roomViewerHeader:`roomViewer-header_XEHCO`};function hn({data:e=[]}){let t=(0,c.useRef)(null),[,n]=(0,c.useState)(null),[r,i]=(0,c.useState)(0),[a,o]=(0,c.useState)(!0);(0,c.useEffect)(()=>{let i=new AbortController;n(null);let a=t.current;return r>e.length-1||!a?(o(!1),()=>i.abort()):(a.querySelectorAll(`[id^="room"]`).forEach(e=>{e.addEventListener(`click`,()=>s(e.id,a),{signal:i.signal})}),o(!1),()=>i.abort())},[e,r]);function s(e,t){let r=e.substring(4);n(n=>{if(r===n)return n;let[i]=t.querySelectorAll(`[id="use"]`);i?.setAttribute(`href`,`#${e}`);let[a]=t.querySelectorAll(`[id="${e}"]`);if(n){let[e]=t.querySelectorAll(`[id="room${n}"]`);if(e){e.classList.remove(mn.roomViewerSelected,mn.roomViewerTint);let[t]=e.querySelectorAll(`[id="background"]`);t&&t.classList.remove(mn.roomViewerTint)}}if(a){a.classList.add(mn.roomViewerSelected);let[e]=a.querySelectorAll(`[id="background"]`);(e??a).classList.add(mn.roomViewerTint)}return r})}function p(t){i(n=>{let r=n+t;return r<0||r>e.length-1?n:r})}let m=e[r]?.data??null;return(0,f.jsxs)(`div`,{className:mn.roomViewer,ref:t,children:[(0,f.jsx)(`h3`,{className:mn.roomViewerHeader,children:e[r]?.label??``}),(0,f.jsx)(`div`,{className:(0,l.default)(mn.roomViewerContainer,a&&mn.roomViewerContainerLoading),children:m},r),e.length>1&&(0,f.jsxs)(`div`,{className:mn.roomViewerActions,children:[(0,f.jsx)(u.FontAwesomeIcon,{icon:d.faChevronLeft,onClick:()=>p(-1)}),(0,f.jsx)(u.FontAwesomeIcon,{icon:d.faLayerGroup}),(0,f.jsx)(u.FontAwesomeIcon,{icon:d.faChevronRight,onClick:()=>p(1)})]})]})}var gn={scrollbarProvider:`scrollbarProvider_IMBFu`};function _n({className:e=void 0,children:t=void 0}){return(0,f.jsx)(`div`,{className:(0,l.default)(gn.scrollbarProvider,e),children:t})}var vn=_n,yn={resultCount:`resultCount_Sn48Q`};function bn({value:e,onChange:t,onDebounce:n,placeholder:r,label:i,debounceMs:a=500,totalAmount:o,showAmount:s=!0,className:l,width:u,...d}){let p=(0,c.useRef)(null);(0,c.useEffect)(()=>()=>{p.current!==null&&clearTimeout(p.current)},[]);function m(e){let r=e==null?``:String(e),i=r.trim()===``?``:r;t(i),p.current!==null&&clearTimeout(p.current),p.current=setTimeout(()=>{n?.(i)},a)}let h=s&&typeof o==`number`&&!Number.isNaN(o);return(0,f.jsxs)(`div`,{...d,className:l,style:u==null?void 0:{width:u},children:[(0,f.jsx)(_e,{type:q.Search,label:i,placeholder:r,value:e,onChange:m}),h&&(0,f.jsxs)(`p`,{className:yn.resultCount,children:[o,` `,o===1?`result`:`results`]})]})}var xn={stepper:`stepper_kiS2A`,"stepper-clickable":`stepper-clickable_Nm6fP`,stepperClickable:`stepper-clickable_Nm6fP`,"stepper-vertical":`stepper-vertical_2y9rg`,stepperVertical:`stepper-vertical_2y9rg`,"stepper-connector":`stepper-connector_J2FwZ`,stepperConnector:`stepper-connector_J2FwZ`,"stepper-connector-vertical":`stepper-connector-vertical_vwY38`,stepperConnectorVertical:`stepper-connector-vertical_vwY38`,"stepper-connector-filled":`stepper-connector-filled_W8UZS`,stepperConnectorFilled:`stepper-connector-filled_W8UZS`,"stepper-entry":`stepper-entry_KD4JJ`,stepperEntry:`stepper-entry_KD4JJ`,"stepper-entry-active":`stepper-entry-active_V1aRt`,stepperEntryActive:`stepper-entry-active_V1aRt`,"stepper-entry-done":`stepper-entry-done_M3wb5`,stepperEntryDone:`stepper-entry-done_M3wb5`,"stepper-entry-number":`stepper-entry-number_J168Q`,stepperEntryNumber:`stepper-entry-number_J168Q`,"stepper-entry-number-done":`stepper-entry-number-done_-m7sD`,stepperEntryNumberDone:`stepper-entry-number-done_-m7sD`,showCheckmark:`showCheckmark_Rd0oW`,"stepper-entry-label":`stepper-entry-label_b94eg`,stepperEntryLabel:`stepper-entry-label_b94eg`,"stepper-entry-label-vertical":`stepper-entry-label-vertical_Zm8i4`,stepperEntryLabelVertical:`stepper-entry-label-vertical_Zm8i4`};function Sn(){return(0,f.jsx)(`svg`,{strokeLinejoin:`round`,strokeLinecap:`round`,xmlns:`http://www.w3.org/2000/svg`,viewBox:`-0.2 -1.2 3.4 2`,height:`20px`,width:`20px`,children:(0,f.jsx)(`path`,{d:`M 0 0 l 1 1 l 2 -2`,stroke:`white`,strokeWidth:`0.4`,fill:`none`})})}function Cn({steps:e=[],currentStep:t=0,alignment:n=`horizontal`,onStepClicked:r=null,nonLinear:i=!1,hideLabels:a=!1,className:o,style:s,classNames:u,styles:d,...p}){let m=n===`vertical`;return(0,f.jsx)(`div`,{...p,className:(0,l.default)(xn.stepper,{[xn.stepperVertical]:m},u?.root,o),style:{...d?.root,...s},children:e.map((n,o)=>{let s=o<t,p=o<=t,h=!!r&&(i?o!==t:s),g=(0,l.default)(xn.stepperEntry,{[xn.stepperEntryActive]:p},{[xn.stepperEntryDone]:s},{[xn.stepperClickable]:h},u?.entry),_=(0,f.jsxs)(f.Fragment,{children:[(0,f.jsx)(`div`,{className:(0,l.default)(xn.stepperEntryNumber,{[xn.stepperEntryNumberDone]:s},u?.entryNumber),style:d?.entryNumber,children:s?(0,f.jsx)(Sn,{}):o+1}),!a&&(0,f.jsx)(`div`,{className:(0,l.default)(xn.stepperEntryLabel,{[xn.stepperEntryLabelVertical]:m},u?.entryLabel),style:d?.entryLabel,children:n.label})]});return(0,f.jsxs)(c.default.Fragment,{children:[h?(0,f.jsx)(I,{className:g,style:d?.entry,onClick:()=>r(o),"aria-current":o===t?`step`:void 0,children:_}):(0,f.jsx)(`div`,{className:g,style:d?.entry,"aria-current":o===t?`step`:void 0,children:_}),o<e.length-1&&(0,f.jsx)(`div`,{className:(0,l.default)(xn.stepperConnector,{[xn.stepperConnectorFilled]:s},{[xn.stepperConnectorVertical]:m},u?.connector),style:d?.connector})]},o)})})}var wn=`https://tenor.googleapis.com/v2`,Tn=class{constructor(e){this.key=e}async search(e,t={}){let n=new URLSearchParams({q:e,key:this.key});return t.limit!=null&&n.set(`limit`,String(t.limit)),t.contentfilter!=null&&n.set(`contentfilter`,t.contentfilter),t.pos!=null&&n.set(`pos`,t.pos),(await fetch(`${wn}/search?${n}`)).json()}async searchSuggestions(e){let t=new URLSearchParams({q:e,key:this.key});return(await fetch(`${wn}/search_suggestions?${t}`)).json()}registerShare(e,t){let n=new URLSearchParams({id:t,q:e,key:this.key});fetch(`${wn}/registershare?${n}`).catch(()=>null)}},En={gifPreview:`gifPreview_-ECUZ`,"gifPreview-image":`gifPreview-image_Aq7-a`,gifPreviewImage:`gifPreview-image_Aq7-a`,"gifPreview-image-container":`gifPreview-image-container_ycypL`,gifPreviewImageContainer:`gifPreview-image-container_ycypL`,gradientBottomLeftToTopRight:`gradientBottomLeftToTopRight_wo6HB`};function Dn({className:e,previewItems:t=[],onSelect:n,onLoadAdditional:r}){function i(e){let t=e.currentTarget,n=t.scrollHeight-t.clientHeight*1.5;t.scrollTop>=n&&r?.()}return(0,f.jsx)(f.Fragment,{children:t.length>0&&(0,f.jsx)(`div`,{className:(0,l.default)(En.gifPreview,e),onScroll:i,children:t.map((e,t)=>(0,f.jsx)(I,{className:En.gifPreviewImageContainer,onClick:()=>n?.(e),children:(0,f.jsx)(`div`,{className:En.gifPreviewImage,style:{backgroundImage:`url(${e.media_formats.tinygif.url})`}})},`${e.id}_${t}`))})})}var On={gifView:`gifView_Fa2zj`,"gifView-loading":`gifView-loading_LfNJr`,gifViewLoading:`gifView-loading_LfNJr`,gradientBottomLeftToTopRight:`gradientBottomLeftToTopRight_JR6aS`};function kn({className:e,src:t=``}){let[n,r]=(0,c.useState)(!0);return(0,c.useEffect)(()=>{r(!0)},[t]),(0,f.jsxs)(`div`,{className:(0,l.default)(On.gifView,e),children:[(0,f.jsx)(`img`,{className:On.tenorPickerSelected,src:t,onLoad:()=>r(!1)}),n&&(0,f.jsx)(`div`,{className:On.gifViewLoading})]})}var An={"tenorPicker-selected":`tenorPicker-selected_IfR2z`,tenorPickerSelected:`tenorPicker-selected_IfR2z`,"tenorPicker-modal-content":`tenorPicker-modal-content_Vkolf`,tenorPickerModalContent:`tenorPicker-modal-content_Vkolf`,"tenorPicker-suggestions-container":`tenorPicker-suggestions-container_kJCj5`,tenorPickerSuggestionsContainer:`tenorPicker-suggestions-container_kJCj5`,"tenorPicker-suggestions-item":`tenorPicker-suggestions-item_Rl99M`,tenorPickerSuggestionsItem:`tenorPicker-suggestions-item_Rl99M`};function jn({className:e,token:t=``,isModal:n=!1,onSelect:r=()=>void 0,selected:i=null}){let a=(0,c.useMemo)(()=>new Tn(t),[t]),[o,s]=(0,c.useState)(``),[u,d]=(0,c.useState)([]),[p,m]=(0,c.useState)([]),[h,g]=(0,c.useState)(null),[_,v]=(0,c.useState)(!1);async function y(e){if(s(e),!e.trim()){d([]),m([]),g(null);return}let[{results:t=[],next:n=null},{results:r=[]}]=await Promise.all([a.search(e,{limit:18,contentfilter:`medium`}),a.searchSuggestions(e)]);d(t),g(n),m(r)}async function b(){let{results:e=[],next:t=null}=await a.search(o,{limit:36,pos:h??void 0,contentfilter:`medium`});g(t),d(t=>[...t,...e])}async function x(e){await r(e),v(!1),e&&a.registerShare(o,e.id)}function S(){return(0,f.jsx)(de,{inline:!0,className:An.tenorPickerSuggestionsContainer,children:p.map(e=>(0,f.jsx)(ue,{className:An.tenorPickerSuggestionsItem,text:e,onClick:()=>y(e)},e))})}function C(){return(0,f.jsx)(Dn,{previewItems:u,onSelect:x,onLoadAdditional:b})}function w(){return(0,f.jsx)(bn,{label:`Pick gif`,value:o,onDebounce:y,onChange:s})}return n?(0,f.jsxs)(`div`,{className:(0,l.default)(An.tenorPicker,e),children:[(0,f.jsxs)(`div`,{className:E.actionButtons,children:[(0,f.jsx)(P,{onClick:()=>v(!0),children:`Pick gif`}),i&&(0,f.jsx)(P,{styleType:j.Delete,onClick:()=>x(null),children:`Remove gif`})]}),i&&(0,f.jsx)(kn,{className:An.tenorPickerSelected,src:i}),(0,f.jsx)(ke,{isOpen:_,onClose:()=>v(!1),children:(0,f.jsxs)(`div`,{className:An.tenorPickerModalContent,children:[w(),S(),C()]})})]}):(0,f.jsxs)(`div`,{className:(0,l.default)(An.tenorPicker,e),children:[(0,f.jsx)(me,{align:fe.Left,isOpen:u.length>0&&_,onOpenChange:v,content:(0,f.jsxs)(f.Fragment,{children:[S(),C()]}),children:w()}),i&&(0,f.jsx)(P,{styleType:j.Delete,onClick:()=>x(null),children:`Remove gif`}),i&&(0,f.jsx)(kn,{className:An.tenorPickerSelected,src:i})]})}function Mn(e){return(0,f.jsx)(_e,{...e,multiline:!0})}var Nn={id:`default`,variables:{"--grey":`#8A8A8A`,"--lightgrey":`#e0e0e0`,"--lightergrey":`#B1B1B1`,"--white":`#FFFFFF`,"--red":`#D6002A`,"--lighter-red":`#ffeae9`,"--green":`#287626`,"--lighter-green":`#C4FFC9`,"--blue":`#5873d5`,"--lighter-blue":`#C6DBFF`,"--black":`black`,"--orange":`#ff7f50`,"--lighter-orange":`#ffe5d9`,"--primary-color":`#8184d6`,"--primary-accent":`#90CAF9`,"--primary-lighter":`#9a9ce4`,"--accent-color":`var(--grey)`,"--accent-color-light":`var(--lightgrey)`,"--text-color":`var(--white)`,"--text-dark":`var(--lightergrey)`,"--text-light":`var(--lightergrey)`,"--text-on-primary":`var(--white)`,"--text-on-delete":`var(--white)`,"--border-color":`#656574`,"--background":`#393945`,"--background-accent":`#33333c`,"--background-accent-dark":`var(--grey)`,"--background-accent-light":`#484856`,"--background-modal":`#484856`,"--success-color":`var(--green)`,"--success-lighter":`var(--lighter-green)`,"--error-color":`var(--red)`,"--error-lighter":`var(--lighter-red)`,"--info-color":`var(--blue)`,"--info-lighter":`var(--lighter-blue)`,"--warn-color":`var(--orange)`,"--warn-lighter":`var(--lighter-orange)`,"--default-font-size":`14px`,"--text-small-font-size":`12px`,"--header-font-size":`24px`,"--header-medium-font-size":`18px`,"--header-small-font-size":`16px`,"--default-font-weight":`400`,"--header-font-weight":`600`,"--input-background":`transparent`,"--input-icon-color":`var(--text-color)`,"--error-border-color":`var(--red)`,"--default-border-radius":`8px`,"--padding-sides":`15px`,"--margin-top":`10px`,"--default-font":`'Inter', sans-serif`,"--themed-font":`'Inter', sans-serif`,"--card-shadow":`0 3px 1px -2px rgb(0 0 0 / 20%), 0 2px 2px 0 rgb(0 0 0 / 14%), 0 1px 5px 0 rgb(0 0 0 / 12%)`,"--spacing-s":`4px`,"--spacing-m":`8px`,"--spacing-l":`16px`}},Pn={colorFade:`colorFade_eLv2g`},Fn=class extends c.Component{constructor(...e){super(...e),this.state={resolvedVariables:{},colorFadeActive:!1,currentThemeColor:null},this.colorFadeTimeout=null,this.wrapperRef=c.default.createRef(),this.themeColorMeta=null,this.createdThemeColorMeta=!1,this.applyTheme=e=>{let t=this.props.themes??[Nn],n=t.find(e=>!e.baseThemeId)??t[0],r=n?n.variables:{},i=t.find(t=>t.id===e),a=i?this.resolveChain(i.id):[],o=Object.assign({},r,...a);this.setState({resolvedVariables:o,colorFadeActive:!0}),this.colorFadeTimeout&&clearTimeout(this.colorFadeTimeout),this.colorFadeTimeout=setTimeout(()=>{this.setState({colorFadeActive:!1}),this.colorFadeTimeout=null},500),setTimeout(()=>{this.wrapperRef.current&&this.setState({currentThemeColor:getComputedStyle(this.wrapperRef.current).getPropertyValue(`--primary-color`).trim()})},1)}}componentDidMount(){this.applyTheme(this.props.currentThemeId),this.syncThemeColorMeta(this.state.currentThemeColor??``)}componentDidUpdate(e,t){t.currentThemeColor!==this.state.currentThemeColor&&this.syncThemeColorMeta(this.state.currentThemeColor??``),(e.currentThemeId!==this.props.currentThemeId||e.themes!==this.props.themes)&&this.applyTheme(this.props.currentThemeId)}componentWillUnmount(){this.colorFadeTimeout&&clearTimeout(this.colorFadeTimeout),this.createdThemeColorMeta&&this.themeColorMeta?.remove()}syncThemeColorMeta(e){if(!(typeof document>`u`)){if(!this.themeColorMeta){let e=document.head.querySelector(`meta[name="theme-color"]`);if(e)this.themeColorMeta=e;else{let e=document.createElement(`meta`);e.setAttribute(`name`,`theme-color`),document.head.appendChild(e),this.themeColorMeta=e,this.createdThemeColorMeta=!0}}this.themeColorMeta.setAttribute(`content`,e)}}resolveChain(e){let t=(this.props.themes??[Nn]).find(t=>t.id===e);return t?[...t.baseThemeId?this.resolveChain(t.baseThemeId):[],t.variables]:[]}render(){let{children:e}=this.props,{resolvedVariables:t,colorFadeActive:n}=this.state;return(0,f.jsx)(`div`,{ref:this.wrapperRef,id:`themeProvider`,className:n?Pn.colorFade:void 0,style:t,children:e})}};function In(e=`default`){let[t,n]=(0,c.useState)(localStorage.getItem(`theme`)||e);return{currentThemeId:t,setCurrentThemeId:e=>{n(e),localStorage.setItem(`theme`,e)}}}var Ln={container:`container_krdsW`,"container-top-left":`container-top-left_zfDTO`,containerTopLeft:`container-top-left_zfDTO`,"container-top-center":`container-top-center_CUIGc`,containerTopCenter:`container-top-center_CUIGc`,"container-top-right":`container-top-right_sB0KU`,containerTopRight:`container-top-right_sB0KU`,"container-bottom-left":`container-bottom-left_toJdF`,containerBottomLeft:`container-bottom-left_toJdF`,"container-bottom-center":`container-bottom-center_Bkf9m`,containerBottomCenter:`container-bottom-center_Bkf9m`,"container-bottom-right":`container-bottom-right_oRSMc`,containerBottomRight:`container-bottom-right_oRSMc`,toast:`toast_qBi4o`,toastSlideDown:`toastSlideDown_4lKWq`,"toast-bottom":`toast-bottom_X8ZIe`,toastBottom:`toast-bottom_X8ZIe`,toastSlideUp:`toastSlideUp_SGR5X`,"toast-dismissing":`toast-dismissing_xKmB-`,toastDismissing:`toast-dismissing_xKmB-`,toastFadeOut:`toastFadeOut_cvHYp`,"toast-info":`toast-info_RlLli`,toastInfo:`toast-info_RlLli`,toastIcon:`toastIcon_xU1nA`,"toast-error":`toast-error_MloFO`,toastError:`toast-error_MloFO`,"toast-warn":`toast-warn_pP6HB`,toastWarn:`toast-warn_pP6HB`,"toast-default":`toast-default_RTt2L`,toastDefault:`toast-default_RTt2L`,toastContent:`toastContent_gvyIv`,toastCloseButton:`toastCloseButton_n-YST`,toastProgressBar:`toastProgressBar_6vBs6`,toastShrink:`toastShrink_h89HS`},Rn={info:d.faCircleInfo,error:d.faCircleXmark,warn:d.faTriangleExclamation,default:d.faBell};function zn({item:e,isBottom:t,onDismiss:n}){let{id:r,content:i,options:a,dismissing:o}=e,{duration:s,showRemainingTime:p,showCloseButton:m,type:h,classNames:g,styles:_}=a;return(0,c.useEffect)(()=>{if(s===0)return;let e=setTimeout(()=>n(r),s);return()=>clearTimeout(e)},[r,s,n]),(0,f.jsxs)(`div`,{className:(0,l.default)(Ln.toast,t?Ln.toastBottom:null,Ln[`toast-${h}`],o&&Ln.toastDismissing,g?.root),style:_?.root,children:[(0,f.jsx)(u.FontAwesomeIcon,{icon:Rn[h],className:(0,l.default)(Ln.toastIcon,g?.icon),style:_?.icon}),(0,f.jsx)(`div`,{className:(0,l.default)(Ln.toastContent,g?.content),style:_?.content,children:i}),m&&(0,f.jsx)(R,{icon:d.faXmark,onClick:()=>n(r),className:(0,l.default)(Ln.toastCloseButton,g?.closeButton),style:_?.closeButton,"aria-label":`Close`}),p&&s>0&&(0,f.jsx)(`div`,{className:(0,l.default)(Ln.toastProgressBar,g?.progressBar),style:{"--toast-duration":`${s}ms`,..._?.progressBar}})]})}var Bn=null;function Vn(e){Bn=e}function Hn(){Bn=null}function Un(e,t){if(!Bn){console.error(`[Toast] No ToastProvider found. Wrap your app with <ToastProvider>.`);return}Bn(e,t)}var Wn={position:`top-right`,duration:4e3,showRemainingTime:!0,showCloseButton:!0,allowStacking:!0},Gn=220;function Kn(e){return Ln[`container-${e}`]}function qn({children:e,position:t=Wn.position,duration:n=Wn.duration,showRemainingTime:r=Wn.showRemainingTime,showCloseButton:i=Wn.showCloseButton,allowStacking:a=Wn.allowStacking}){let[o,s]=(0,c.useState)([]),u=(0,c.useRef)(0),d=(0,c.useCallback)(e=>{s(t=>t.map(t=>t.id===e?{...t,dismissing:!0}:t)),setTimeout(()=>{s(t=>t.filter(t=>t.id!==e))},Gn)},[]),p=(0,c.useCallback)((e,o)=>{let c={position:o?.position??t,duration:o?.duration??n,showRemainingTime:o?.showRemainingTime??r,showCloseButton:o?.showCloseButton??i,type:o?.type??`default`,classNames:o?.classNames,styles:o?.styles};u.current+=1;let l={id:`toast-${u.current}`,content:e,options:c,dismissing:!1};s(e=>!a&&e.length>0?(setTimeout(()=>{s([l])},Gn),e.map(e=>({...e,dismissing:!0}))):[...e,l])},[t,n,r,i,a]);(0,c.useEffect)(()=>(Vn(p),()=>Hn()),[p]);let m=o.reduce((e,t)=>{let n=t.options.position;return e[n]||(e[n]=[]),e[n].push(t),e},{});return(0,f.jsxs)(f.Fragment,{children:[e,(0,f.jsx)(z,{children:Object.entries(m).map(([e,t])=>(0,f.jsx)(`div`,{className:(0,l.default)(Ln.container,Kn(e)),children:t.map(t=>(0,f.jsx)(zn,{item:t,isBottom:e.startsWith(`bottom`),onDismiss:d},t.id))},e))})]})}var Q={virtualList:`virtualList_qBPNc`,"virtualList-header":`virtualList-header_0Ellb`,virtualListHeader:`virtualList-header_0Ellb`,"virtualList-header-cell":`virtualList-header-cell_c8NGV`,virtualListHeaderCell:`virtualList-header-cell_c8NGV`,"virtualList-header-toggle":`virtualList-header-toggle_pYFxD`,virtualListHeaderToggle:`virtualList-header-toggle_pYFxD`,"virtualList-toggle-wrapper":`virtualList-toggle-wrapper_JP32M`,virtualListToggleWrapper:`virtualList-toggle-wrapper_JP32M`,"virtualList-toggle-popover":`virtualList-toggle-popover_gbpd7`,virtualListTogglePopover:`virtualList-toggle-popover_gbpd7`,"virtualList-toggle-item":`virtualList-toggle-item_5gu5d`,virtualListToggleItem:`virtualList-toggle-item_5gu5d`,"virtualList-select-cell":`virtualList-select-cell_s9kAy`,virtualListSelectCell:`virtualList-select-cell_s9kAy`,"virtualList-body":`virtualList-body_k-fRr`,virtualListBody:`virtualList-body_k-fRr`,"virtualList-row":`virtualList-row_TTY50`,virtualListRow:`virtualList-row_TTY50`,"virtualList-row-no-divider":`virtualList-row-no-divider_Ct0gV`,virtualListRowNoDivider:`virtualList-row-no-divider_Ct0gV`,"virtualList-row-selected":`virtualList-row-selected_hwEN-`,virtualListRowSelected:`virtualList-row-selected_hwEN-`,"virtualList-cell":`virtualList-cell_H0zBv`,virtualListCell:`virtualList-cell_H0zBv`,"virtualList-loading-full":`virtualList-loading-full_wzZNM`,virtualListLoadingFull:`virtualList-loading-full_wzZNM`,"virtualList-loading-indicator":`virtualList-loading-indicator_EJced`,virtualListLoadingIndicator:`virtualList-loading-indicator_EJced`,"virtualList-spinner":`virtualList-spinner_apClW`,virtualListSpinner:`virtualList-spinner_apClW`};function Jn(e,t,n,r=0){let i=Array(e+1);i[0]=0;for(let a=0;a<e;a++){let o=a<e-1?r:0;i[a+1]=i[a]+(t.get(a)??n)+o}return{offsets:i,totalHeight:i[e]}}function Yn(e,t,n,r,i){if(i===0)return{startIndex:0,endIndex:-1};let a=0,o=i-1;for(;a<o;){let n=a+o>>1;e[n+1]<=t?a=n+1:o=n}let s=a;for(;s<i&&e[s]<t+n;)s++;return{startIndex:Math.max(0,a-r),endIndex:Math.min(i-1,s+r-1)}}function Xn(e){return e.length===0?`1fr`:e.map(e=>{switch(e.width.type){case`fixed`:return`${e.width.px}px`;case`flex`:return`${e.width.weight??1}fr`;case`fit`:return`fit-content(100%)`}}).join(` `)}function Zn({index:e,top:t,columnTemplate:n,isSelected:r,showDivider:i,onClick:a,onHeightChange:o,rowClassName:s,rowStyle:u,children:d}){let p=(0,c.useRef)(null);return(0,c.useEffect)(()=>{let t=p.current;if(!t)return;let n=new ResizeObserver(()=>o(e,t.offsetHeight));return n.observe(t),()=>n.unobserve(t)},[e,o]),(0,f.jsx)(`div`,{ref:p,className:(0,l.default)(Q.virtualListRow,r&&Q.virtualListRowSelected,!i&&Q.virtualListRowNoDivider,s),style:{position:`absolute`,top:t,left:0,right:0,...n?{display:`grid`,gridTemplateColumns:n}:{},...u},onClick:a,"aria-selected":r,role:`row`,children:d})}function Qn({items:e,renderRow:t,columns:n,height:r=`100%`,estimatedRowHeight:i=40,overscan:a=3,rowGap:o=0,selectedKey:s,getItemKey:p,onRowClick:m,visibleColumnKeys:h,onVisibleColumnsChange:g,showColumnToggle:_,onLoadMore:v,loadMoreThreshold:y=100,isLoading:b=!1,multiSelect:x=!1,selectedKeys:S,onSelectionChange:C,showDivider:w=!0,className:T,style:E,classNames:D,styles:O,...k}){let[j,ee]=(0,c.useState)(0),[M,te]=(0,c.useState)(0),[N,ne]=(0,c.useState)(new Map),[re,P]=(0,c.useState)(!1),[ie,ae]=(0,c.useState)(!1),F=(0,c.useRef)(!1),I=S!==void 0,[L,R]=(0,c.useState)(new Set),z=I?S:L,B=h!==void 0,[oe,se]=(0,c.useState)(()=>new Set((n??[]).filter(e=>!e.defaultHidden).map(e=>e.key))),ce=B?new Set(h):oe,le=(0,c.useRef)(null),V=(0,c.useRef)(null),H=(0,c.useRef)(new Map),W=(0,c.useRef)([]);(0,c.useEffect)(()=>{let e=le.current;if(!e)return;let t=new ResizeObserver(()=>te(e.clientHeight));return t.observe(e),()=>t.unobserve(e)},[]),(0,c.useEffect)(()=>{if(!re)return;function e(e){V.current&&!V.current.contains(e.target)&&P(!1)}return document.addEventListener(`mousedown`,e),()=>document.removeEventListener(`mousedown`,e)},[re]);let ue=(0,c.useCallback)(e=>{let t=e.currentTarget;ee(t.scrollTop),v&&!F.current&&t.scrollTop+t.clientHeight>=t.scrollHeight-y&&(F.current=!0,ae(!0),v().finally(()=>{F.current=!1,ae(!1)}))},[v,y]),de=(0,c.useCallback)((e,t)=>{ne(n=>{if(n.get(e)===t)return n;let r=new Map(n);return r.set(e,t),r})},[]),{offsets:G,totalHeight:fe}=(0,c.useMemo)(()=>Jn(e.length,N,i,o),[e.length,N,i,o]);(0,c.useLayoutEffect)(()=>{let e=le.current,t=W.current;if(W.current=G,!e||e.scrollTop===0||t.length===0){H.current=N;return}let n=0;for(let[r,a]of N){let o=H.current.get(r)??i;a!==o&&t[r+1]!==void 0&&t[r+1]<=e.scrollTop&&(n+=a-o)}H.current=N,n!==0&&(e.scrollTop+=n)},[G,N,i]);let{startIndex:pe,endIndex:me}=(0,c.useMemo)(()=>Yn(G,j,M,a,e.length),[G,j,M,a,e.length]),he=!!n?.length,ge=he?n.filter(e=>ce.has(e.key)):[],K=he?`${x&&he?`40px `:``}${Xn(ge)}`:void 0,q=_!==!1&&he;function _e(e){let t=new Set(ce);if(t.has(e)){if(t.size<=1)return;t.delete(e)}else t.add(e);let n=[...t];B||se(t),g?.(n)}function J(e,t){return p?p(e,t):t}function ve(e){I||R(e),C?.(e)}function ye(e){let t=new Set(z);t.has(e)?t.delete(e):t.add(e),ve(t)}function be(){let t=e.map((e,t)=>J(e,t));ve(t.every(e=>z.has(e))?new Set:new Set(t))}let xe=e.length>0&&e.every((e,t)=>z.has(J(e,t))),Se=!xe&&e.some((e,t)=>z.has(J(e,t))),Ce=[];for(let n=pe;n<=me;n++){let r=e[n],i=J(r,n),a=s!=null&&i===s||z.has(i);Ce.push((0,f.jsx)(Zn,{index:n,top:G[n],columnTemplate:K,isSelected:a,showDivider:w,onClick:()=>m?.(r,n),onHeightChange:de,rowClassName:D?.row,rowStyle:O?.row,children:he?(0,f.jsxs)(f.Fragment,{children:[x&&(0,f.jsx)(`div`,{className:(0,l.default)(Q.virtualListSelectCell,D?.selectCell),style:O?.selectCell,role:`gridcell`,onClick:e=>e.stopPropagation(),children:(0,f.jsx)(U,{selected:z.has(i),onToggle:()=>ye(i),"aria-label":`Select row`})}),ge.map(e=>(0,f.jsx)(`div`,{className:(0,l.default)(Q.virtualListCell,D?.cell),style:O?.cell,role:`gridcell`,children:e.renderCell(r,n)},e.key))]}):t?.(r,n)},i))}return(0,f.jsxs)(`div`,{...k,ref:le,className:(0,l.default)(Q.virtualList,T,D?.root),style:{height:r,...E,...O?.root},onScroll:ue,role:he?`grid`:`list`,children:[he&&(0,f.jsxs)(`div`,{className:(0,l.default)(Q.virtualListHeader,D?.header),style:{gridTemplateColumns:K,...q?{paddingRight:32}:{},...O?.header},role:`row`,children:[x&&(0,f.jsx)(`div`,{className:(0,l.default)(Q.virtualListSelectCell,D?.selectCell),style:O?.selectCell,role:`columnheader`,children:(0,f.jsx)(U,{selected:xe||Se,onToggle:be,"aria-label":`Select all rows`})}),ge.map(e=>(0,f.jsx)(`div`,{className:(0,l.default)(Q.virtualListHeaderCell,D?.headerCell),style:O?.headerCell,role:`columnheader`,children:e.label},e.key)),q&&(0,f.jsxs)(`div`,{ref:V,className:Q.virtualListToggleWrapper,children:[(0,f.jsx)(`button`,{type:`button`,className:(0,l.default)(Q.virtualListHeaderToggle,D?.headerToggle),style:O?.headerToggle,onClick:()=>P(e=>!e),"aria-label":`Toggle column visibility`,children:(0,f.jsx)(u.FontAwesomeIcon,{icon:d.faGear,style:O?.headerToggle})}),re&&(0,f.jsx)(`div`,{className:(0,l.default)(Q.virtualListTogglePopover,D?.togglePopover),style:O?.togglePopover,children:n.map(e=>(0,f.jsx)(U,{className:(0,l.default)(Q.virtualListToggleItem,D?.toggleItem),style:O?.toggleItem,selected:ce.has(e.key),onToggle:()=>_e(e.key),cursorDefault:!1,children:e.label},e.key))})]})]}),b?(0,f.jsx)(`div`,{className:Q.virtualListLoadingFull,children:(0,f.jsx)(A,{className:Q.virtualListSpinner})}):(0,f.jsx)(`div`,{className:(0,l.default)(Q.virtualListBody,D?.body),style:{height:fe,...O?.body},children:Ce}),ie&&(0,f.jsx)(`div`,{className:(0,l.default)(Q.virtualListLoadingIndicator,D?.loadingIndicator),style:O?.loadingIndicator,children:(0,f.jsx)(A,{className:Q.virtualListSpinner})})]})}var $n={wizard:`wizard_uRBAN`,"wizard-content":`wizard-content_lcl4C`,wizardContent:`wizard-content_lcl4C`,"wizard-content-outOfFrame":`wizard-content-outOfFrame_Eks4Y`,wizardContentOutOfFrame:`wizard-content-outOfFrame_Eks4Y`,"wizard-content-container":`wizard-content-container_yxbCJ`,wizardContentContainer:`wizard-content-container_yxbCJ`};function er({currentStep:e=0,stepCount:t=0,renderStep:n=()=>null,className:r,style:i,classNames:a,styles:o,...s}){let[u,d]=(0,c.useState)(void 0),[p,m]=(0,c.useState)(!1),[h,g]=(0,c.useState)(e),_=(0,c.useRef)([]),v=(0,c.useRef)(null);e!==h&&(g(e),m(!0)),(0,c.useEffect)(()=>{if(!p)return;let e=setTimeout(()=>m(!1),400);return()=>clearTimeout(e)},[p]),(0,c.useEffect)(()=>{v.current?.disconnect();let t=_.current[e];if(t)return d(t.clientHeight),v.current=new ResizeObserver(()=>{d(t.clientHeight)}),v.current.observe(t),()=>v.current?.disconnect()},[e,t]);let y={...u===void 0?{}:{height:`${u}px`},...o?.root,...i};return(0,f.jsx)(`div`,{...s,className:(0,l.default)($n.wizard,a?.root,r),style:y,children:(0,f.jsx)(`div`,{className:(0,l.default)($n.wizardContentContainer,a?.container),style:{width:`${t*100}%`,marginLeft:`-${e*100}%`,...o?.container},children:Array.from({length:t},(r,i)=>(0,f.jsx)(`div`,{ref:e=>{_.current[i]=e},className:(0,l.default)($n.wizardContent,a?.step),style:{width:`${100/t}%`,marginLeft:`${100/t*i}%`,...o?.step},children:(0,f.jsx)(`div`,{className:(0,l.default)({[$n.wizardContentOutOfFrame]:e!==i&&!p},a?.stepContent),style:o?.stepContent,inert:e===i?void 0:!0,children:n(i)})},`wizardStep${i}`))})})}function tr(e){let t=e;return t?.errors&&Array.isArray(t.errors)?t.errors.flatMap(e=>Object.entries(e).map(([e,t])=>({id:e,message:t}))):[]}var nr=class{#e;#t;#n;#r;#i;constructor(e,t=null,{initialValues:n,onSubmit:r=()=>void 0,onValidate:i=()=>void 0,errorParser:a=tr,onSubmitError:o=()=>void 0}={}){this.#t=!1,this.#i=[],this.getFormError=()=>{let e=Object.keys(this.group);for(let t=0;t<e.length;t+=1){let n=e[t];if(this.group[n].errors.length>0)return this.group[n].errors[0]}return null},this.set=(e,t)=>(this.group[e].set(t),this),this.reset=(e={})=>{this.submitCount=0;let t=Object.keys(e);Object.keys(this.group).forEach(n=>{this.group[n].set(t.includes(n)?e[n]:this.#r[n],!1)}),this.resetDirtyAndTouched(),this.onReset&&this.onReset(this,this.#r,this.#e)},this.resetDirtyAndTouched=()=>{Object.keys(this.group).forEach(e=>{this.group[e].dirty=!1,this.group[e].touched=!1})},this.parseError=(e,t=!1)=>{let n=this.errorParser(e);n.length>0?(n.forEach(({id:e,message:t})=>{this.group[e]&&this.group[e].addError({id:e,message:t})}),t&&this.onSubmitError(n)):this.onSubmitError([{id:`generic`,message:`An error occurred`}])},this.#a=()=>{this.component&&this.component.forceUpdate(),this.#i.forEach(e=>e())},this.registerOnUpdateListener=e=>{this.#i.push(e)},this.removeOnUpdateListener=e=>{this.#i.splice(this.#i.indexOf(e),1)},this.setSubmitting=e=>{this.#t!==e&&(this.#t=e,this.#a())},this.submit=async e=>{e&&(e.preventDefault&&e.preventDefault(),e.stopPropagation&&e.stopPropagation()),this.setSubmitting(!0);let t=null;this.submitCount===0?t=await Promise.resolve(this.validate()):this.onValidateCallback&&(t=await Promise.resolve(this.onValidateCallback(this)));let n=this.getFormError()||t;if(n){this.setSubmitting(!1),this.submitCount>-1&&this.onSubmitError([n]),this.submitCount+=1,this.#a();return}try{await this.onSubmitCallback(this.getValues(),this),this.resetDirtyAndTouched()}catch(e){this.parseError(e,!0)}this.setSubmitting(!1),this.#a(),this.submitCount+=1},this.getValues=()=>{let e={};return Object.keys(this.group).forEach(t=>{e[t]=this.group[t].value}),{...this.#e,...e}},this.validate=()=>{if(Object.keys(this.group).forEach(e=>{this.group[e].validate(),this.group[e].touched=!0}),this.onValidateCallback)return this.onValidateCallback(this)},this.setValidator=(e,t)=>(this.group[e]=t,this),this.group=e,this.#e=n??{},this.#r={},this.submitCount=0,this.onDebounce=()=>{},this.onReset=()=>{},Object.keys(this.group).forEach(e=>{let t=this.group[e],n=this.#e;n[e]!==void 0&&t.set(n[e]),this.#r[e]=t.value,this.group[e].registerOnUpdateListener(()=>{this.#a(),this.submitCount=0,this.#n&&clearTimeout(this.#n),this.#n=setTimeout(()=>this.onDebounce(this.getValues()),500)})}),this.component=t,this.onSubmitCallback=r,this.onValidateCallback=i,this.errorParser=a,this.onSubmitError=o,this.setSubmitting(!1)}get isSubmitting(){return this.#t}get wasTouched(){return Object.keys(this.group).some(e=>this.group[e].touched)}get isDirty(){return Object.keys(this.group).some(e=>this.group[e].dirty)}get hasErrors(){return Object.keys(this.group).some(e=>this.group[e].errors.length>0)}get initialValues(){return{...this.#e}}#a};function rr(e){return function({children:t,...n}){return(0,f.jsx)(`form`,{onSubmit:e.submit,noValidate:!0,...n,children:t})}}var ir=e=>{Un(e[0].message,{type:`error`})},ar=class extends nr{constructor(e,t=null,n){super(e,t,{...n,onSubmitError:n?.onSubmitError??ir}),this.Form=rr(this)}},or=class{#e;#t;#n;#r;#i;constructor(e,t){this.addError=e=>{this.#r.push(e),this.onUpdate()},this.removeErrors=e=>{this.#r=this.#r.filter(t=>!e.includes(t.id)),this.onUpdate()},this.clearErrors=()=>{this.#r=[],this.onUpdate()},this.hasError=e=>!e&&this.errors.length>0?!0:!!this.errors.find(t=>t.id===e),this.getCurrentErrorMessage=()=>this.errors.length===0?null:this.errors[0].message,this.validate=()=>{this.clearErrors(),this.validators.forEach(e=>{let t=e(this.value,this.label);t&&this.addError(t)})},this.onUpdate=()=>{this.onUpdateCallbacks.forEach(e=>e(this))},this.registerOnUpdateListener=e=>{this.onUpdateCallbacks.push(e)},this.removeOnUpdateListener=e=>{this.onUpdateCallbacks.splice(this.onUpdateCallbacks.indexOf(e),1)},this.set=(e,t=!0)=>(this.value=e,t&&!this.dirty&&(this.dirty=!0),this.validate(),this),this.#e=e,this.validators=t??[],this.#t=!1,this.#n=!1,this.#r=[],this.#i=``,this.onUpdateCallbacks=[],this.validate()}get touched(){return this.#t}set touched(e){this.#t=e,this.onUpdate()}get label(){return this.#i}set label(e){this.#i=e}get dirty(){return this.#n}set dirty(e){this.#n=e,this.onUpdate()}get value(){return this.#e}set value(e){this.#e=e,this.onUpdate()}get errors(){return this.#r}};or.prototype.toString=function(){return`${this.value}`};function sr(e){return/^[0-9]+$/.test(e)}function cr(e){return/^[0-9]{2}.[0-9]{2}.[0-9]{4}$/.test(e)}function lr(e){return/^[0-9]{4}-[0-9]{2}-[0-9]{2}T[0-9]{2}:[0-9]{2}:[0-9]{2}.[0-9]{3}Z$/.test(e)}function ur(e){return/^(([^<>()[\]\\.,;:\s@"]+(\.[^<>()[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-ZöäüÜÖÄß\-0-9]+\.)+[a-zA-Z]{2,}))$/.test(e)}function dr(e){return/^[A-Z]{6}[A-Z\d]{2}([A-Z\d]{3})?$/.test(e)}function fr(e){return/[-a-zA-Z0-9@:%._+~#=]{2,256}\.[a-z]{2,63}(\/[-a-zA-Z0-9@:%_+.~#?&//=]*)?$/.test(e)}function pr(e){return/^[\w!@#$%^&*?±§~`'"/\\[\]{}\-,.();:><+=|öäüÖÄÜß €μ]{8,}$/.test(e)}function mr(e){return/^(?=.*[a-zöäüA-ZÖÄÜß])/.test(e)}function hr(e){return/^(?=.*\d)/.test(e)}function gr(e){return pr(e)&&mr(e)&&hr(e)}var $={t:(e,t)=>({"formValidators.minLength":`Must be at least ${t?.min} characters long`,"formValidators.maxLength":`Must be at most ${t?.max} characters long`,"formValidators.email":`Must be a valid email address`,"formValidators.required":`${t?.label||`Value`} is required`,"formValidators.value":`Value`,"formValidators.mustBeNumber":`Must be a number`,"formValidators.oneOf":`Must be one of the following values: ${t?.allowedValues}`,"formValidators.typeOf":`Must have type of ${t?.allowedTypes}`,"formValidators.multiEmail":`Must be a comma or semicolon separated list of valid email addresses`,"formValidators.date":`Must be a valid date`,"garages.errors.website":`Must be a valid URL`,"garages.errors.bic":`Must be a valid BIC`,"formValidators.minLetters":`Must contain at least ${t?.smart_count} letters`,"formValidators.minDigits":`Must contain at least ${t?.smart_count} digits`})[e]||e},_r=class e{static{this.minLength=(e,t)=>n=>!n||n.length<e?{id:`minLength`,message:t||$.t(`formValidators.minLength`,{min:e})}:null}static{this.maxLength=(e,t)=>n=>n&&n.length>e?{id:`maxLength`,message:t||$.t(`formValidators.maxLength`,{max:e})}:null}static{this.email=e=>t=>t&&!ur(t)?{id:`email`,message:e||$.t(`formValidators.email`)}:null}static{this.required=e=>{function t(t,n){return!t&&t!==0?{id:`required`,message:e||$.t(`formValidators.required`,{label:n||$.t(`formValidators.value`)})}:null}return t.validatorId=`required`,t}}static{this.mustBeNumber=e=>t=>t&&Number.isNaN(+t)?{id:`mustBeNumber`,message:e||$.t(`formValidators.mustBeNumber`)}:null}static{this.oneOf=(e,t)=>n=>n&&!e.includes(n)?{id:`oneOf`,message:t||$.t(`formValidators.oneOf`,{allowedValues:e})}:null}static{this.typeOf=(e,t)=>n=>{if(Array.isArray(e)){for(let t=0;t<e.length;t+=1)if(typeof n===e[t])return null}else if(typeof n===e)return null;return{id:`typeOf`,message:t||`Must have type of ${e}`}}}static{this.multiEmail=e=>t=>{if(t){let n=t.replace(/ /g,``).replace(/,/g,`;`).split(`;`);for(let t=0;t<n.length;t+=1)if(!ur(n[t]))return{id:`multiEmail`,message:e||$.t(`formValidators.multiEmail`)}}return null}}static{this.date=e=>t=>t&&!cr(t)&&!lr(t)?{id:`date`,message:e||$.t(`formValidators.date`)}:null}static{this.dateObject=e=>t=>t&&!t.isValid?{id:`date`,message:e||$.t(`formValidators.date`)}:null}static{this.website=e=>t=>t&&!fr(t)?{id:`website`,message:e||$.t(`garages.errors.website`)}:null}static{this.bic=e=>t=>t&&!dr(t)?{id:`bic`,message:e||$.t(`garages.errors.bic`)}:null}static{this.minLetters=(e,t)=>n=>n&&n.replace(/[^a-zöäüA-ZÖÄÜß]/g,``).length<e?{id:`minLetters`,message:t||$.t(`formValidators.minLetters`,{smart_count:e})}:null}static{this.minDigits=(e,t)=>n=>n&&n.replace(/[\D]/g,``).length<e?{id:`minDigits`,message:t||$.t(`formValidators.minDigits`,{smart_count:e})}:null}static{this.password=t=>n=>{let r=e.minLength(8)(n)||e.minLetters(1)(n)||e.minDigits(1)(n);return r?t?{id:`password`,message:t}:r:null}}},vr=class extends c.PureComponent{static{this.defaultProps={formValidator:null,onMouseEnter:null,onMouseLeave:null,onFocus:null,onBlur:null,onChange:null,errorMessage:``,isValid:!1,isRequired:!1,label:``}}constructor(e){super(e);let{formValidator:t}=e;t&&(t.label=e.label??``,t.validate(),t.registerOnUpdateListener(()=>{this.forceUpdate()})),this.state={isFocused:!1,isHovered:!1},this.onMouseEnter=this.onMouseEnter.bind(this),this.onMouseLeave=this.onMouseLeave.bind(this),this.onFocus=this.onFocus.bind(this),this.onBlur=this.onBlur.bind(this),this.hasError=this.hasError.bind(this),this.renderTooltip=this.renderTooltip.bind(this),this.onChange=this.onChange.bind(this)}componentDidMount(){setTimeout(()=>this.setState({isFocused:!1,isHovered:!1}),1)}componentDidUpdate(e){let{formValidator:t}=this.props;e.formValidator&&t&&e.formValidator!==t&&t.registerOnUpdateListener(()=>{this.forceUpdate()})}onMouseEnter(e){let{onMouseEnter:t}=this.props;this.setState({isHovered:!0}),t&&t(e)}onMouseLeave(e){let{onMouseLeave:t}=this.props;this.setState({isHovered:!1}),t&&t(e)}onFocus(e){let{onFocus:t}=this.props;this.setState({isFocused:!0}),t&&t(e)}onBlur(e){let{formValidator:t,onBlur:n}=this.props;t&&(t.touched=!0),this.setState({isFocused:!1}),n&&n(e)}hasError(){let{errorMessage:e,isValid:t,formValidator:n}=this.props;return n?n.touched&&n.hasError():!t||!!e}isRequired(){let{isRequired:e,formValidator:t}=this.props;return!!(e||t&&t.validators.find(e=>e.validatorId===`required`))}renderTooltip(){let{errorMessage:e,formValidator:t}=this.props,{isHovered:n,isFocused:r}=this.state;return(0,f.jsx)(ge,{variant:`error`,message:t?t.getCurrentErrorMessage():e||``,isVisible:this.hasError()&&(r||n)})}onChange(e){let{onChange:t,formValidator:n}=this.props;if(n){let t=e;e&&e.target&&(t=e.target.value),n.set(t)}t&&t(e)}};function yr(e){let[,t]=(0,c.useReducer)(e=>e+1,0);return(0,c.useEffect)(()=>{if(e)return e.registerOnUpdateListener(t),()=>e.removeOnUpdateListener(t)},[e]),e}function br(e,{initialValues:t,onSubmit:n,onValidate:r,errorParser:i,onSubmitError:a}={}){let[,o]=(0,c.useReducer)(e=>e+1,0),s=(0,c.useRef)(null);s.current||=new ar(e,null,{initialValues:t,errorParser:i,onSubmitError:a});let l=s.current,u=(0,c.useRef)(n),d=(0,c.useRef)(r);return u.current=n,d.current=r,(0,c.useEffect)(()=>(n!==void 0&&(l.onSubmitCallback=(...e)=>u.current?.(...e)),r!==void 0&&(l.onValidateCallback=(...e)=>d.current?.(...e)),l.registerOnUpdateListener(o),()=>l.removeOnUpdateListener(o)),[]),l}exports.Accordion=T,exports.AccordionStyleType=b,exports.ActionButtons=ie,exports.ActionIcon=R,exports.Align=fe,exports.BodyEnd=z,exports.Button=P,exports.ButtonSize=ee,exports.ButtonStyleType=j,exports.ButtonType=M,exports.Card=oe,exports.CardActions=V,exports.CardContent=le,exports.CardHeader=se,exports.CardMedia=ce,exports.Checkbox=U,exports.Chip=ue,exports.ChipContainer=de,exports.ColorPicker=De,exports.ConfirmModal=Ae,exports.DatePicker=it,exports.Dropdown=nt,exports.EmptyState=ot,exports.Fab=ut,exports.FloatingMenu=me,exports.FormValidator=or,exports.FormValidatorGroup=ar,exports.IconLoading=Dt,exports.IconPicker=mt,exports.IdleManager=gt,exports.InfiniteBlock=tt,exports.Input=_e,exports.InputDropdown=bt,exports.InputType=q,exports.InteractableDiv=I,exports.KanbanBoard=wt,exports.KanbanColumn=Ct,exports.Modal=ke,exports.NumberInput=At,exports.OptionPicker=Mt,exports.Overscroll=It,exports.ProgressBar=zt,exports.Ripple=N,exports.RoomDrawer=pn,exports.RoomViewer=hn,exports.ScrollbarProvider=vn,exports.SearchInput=bn,exports.SpinnerLoading=A,exports.Stepper=Cn,exports.TenorPicker=jn,exports.Textarea=Mn,exports.ThemeProvider=Fn,exports.Toast=qn,exports.Tooltip=ge,exports.ValidatableComponent=vr,exports.Validators=_r,exports.VirtualList=Qn,exports.Wizard=er,exports.defaultTheme=Nn,exports.getLocale=Re,exports.hasEightPasswordChars=pr,exports.hasOnePasswordDigit=hr,exports.hasOnePasswordLetter=mr,exports.isBic=dr,exports.isDate=cr,exports.isEmail=ur,exports.isISODate=lr,exports.isNumber=sr,exports.isPassword=gr,exports.isURL=fr,exports.mapLocale=Fe,exports.setLocale=Le,exports.showToast=Un,exports.useFormValidator=yr,exports.useFormValidatorGroup=br,exports.useTheme=In;
5
+ `)}function tn(e){let t=[];for(let n of e.matchAll(/[ML]\s*([-\d.]+)[,\s]+([-\d.]+)/gi))t.push({x:parseFloat(n[1]),y:parseFloat(n[2])});return t}function nn(e){let t=new DOMParser().parseFromString(e,`image/svg+xml`),n=[];return t.querySelectorAll(`[id^="room"]`).forEach(e=>{let t=e.querySelector(`[id="background"]`);if(!t)return;let r=t.getAttribute(`d`);if(!r)return;let i=tn(r);if(i.length<3)return;let a=e.querySelector(`text`)?.textContent?.trim()??``;n.push({id:e.id,name:a,points:i})}),n}function rn(e,t){let n=en(e,t),r=new Blob([n],{type:`image/svg+xml`}),i=URL.createObjectURL(r),a=document.createElement(`a`);a.href=i,a.download=`room-plan.svg`,a.click(),URL.revokeObjectURL(i)}var Z={roomDrawer:`roomDrawer_SJj4-`,"roomDrawer-toolbar":`roomDrawer-toolbar_55H5p`,roomDrawerToolbar:`roomDrawer-toolbar_55H5p`,"roomDrawer-toolbar-sep":`roomDrawer-toolbar-sep_nJeh8`,roomDrawerToolbarSep:`roomDrawer-toolbar-sep_nJeh8`,"roomDrawer-toolbar-btn":`roomDrawer-toolbar-btn_2qinY`,roomDrawerToolbarBtn:`roomDrawer-toolbar-btn_2qinY`,"roomDrawer-toolbar-btn-active":`roomDrawer-toolbar-btn-active_4XX25`,roomDrawerToolbarBtnActive:`roomDrawer-toolbar-btn-active_4XX25`,"roomDrawer-toolbar-zoomLabel":`roomDrawer-toolbar-zoomLabel_HMkb5`,roomDrawerToolbarZoomLabel:`roomDrawer-toolbar-zoomLabel_HMkb5`,"roomDrawer-canvas":`roomDrawer-canvas_Y18uD`,roomDrawerCanvas:`roomDrawer-canvas_Y18uD`,"roomDrawer-canvas-select":`roomDrawer-canvas-select_M43-x`,roomDrawerCanvasSelect:`roomDrawer-canvas-select_M43-x`,"roomDrawer-info":`roomDrawer-info_qwC6L`,roomDrawerInfo:`roomDrawer-info_qwC6L`,"roomDrawer-info-label":`roomDrawer-info-label_8I9hB`,roomDrawerInfoLabel:`roomDrawer-info-label_8I9hB`,"roomDrawer-info-input":`roomDrawer-info-input_YAl-K`,roomDrawerInfoInput:`roomDrawer-info-input_YAl-K`,"roomDrawer-info-spacer":`roomDrawer-info-spacer_cOj96`,roomDrawerInfoSpacer:`roomDrawer-info-spacer_cOj96`,"roomDrawer-info-delete":`roomDrawer-info-delete_TSBUN`,roomDrawerInfoDelete:`roomDrawer-info-delete_TSBUN`,"roomDrawer-hint":`roomDrawer-hint_3WTFa`,roomDrawerHint:`roomDrawer-hint_3WTFa`,"roomDrawer-info-doorsBtn":`roomDrawer-info-doorsBtn_oK5Uf`,roomDrawerInfoDoorsBtn:`roomDrawer-info-doorsBtn_oK5Uf`,"roomDrawer-doorPanel":`roomDrawer-doorPanel_e-Tl9`,roomDrawerDoorPanel:`roomDrawer-doorPanel_e-Tl9`,"roomDrawer-doorPanel-header":`roomDrawer-doorPanel-header_--iXz`,roomDrawerDoorPanelHeader:`roomDrawer-doorPanel-header_--iXz`,"roomDrawer-doorPanel-icon":`roomDrawer-doorPanel-icon_KxaVY`,roomDrawerDoorPanelIcon:`roomDrawer-doorPanel-icon_KxaVY`,"roomDrawer-doorPanel-title":`roomDrawer-doorPanel-title_8nOZS`,roomDrawerDoorPanelTitle:`roomDrawer-doorPanel-title_8nOZS`,"roomDrawer-doorPanel-done":`roomDrawer-doorPanel-done_ejQkx`,roomDrawerDoorPanelDone:`roomDrawer-doorPanel-done_ejQkx`,"roomDrawer-doorPanel-list":`roomDrawer-doorPanel-list_rDou7`,roomDrawerDoorPanelList:`roomDrawer-doorPanel-list_rDou7`,"roomDrawer-doorPanel-item":`roomDrawer-doorPanel-item_U-3-B`,roomDrawerDoorPanelItem:`roomDrawer-doorPanel-item_U-3-B`,"roomDrawer-doorPanel-label":`roomDrawer-doorPanel-label_qSYqY`,roomDrawerDoorPanelLabel:`roomDrawer-doorPanel-label_qSYqY`,"roomDrawer-doorPanel-widthLabel":`roomDrawer-doorPanel-widthLabel_jXv7D`,roomDrawerDoorPanelWidthLabel:`roomDrawer-doorPanel-widthLabel_jXv7D`,"roomDrawer-doorPanel-empty":`roomDrawer-doorPanel-empty_LcDw0`,roomDrawerDoorPanelEmpty:`roomDrawer-doorPanel-empty_LcDw0`,"roomDrawer-canvas-door":`roomDrawer-canvas-door_qzCIa`,roomDrawerCanvasDoor:`roomDrawer-canvas-door_qzCIa`,doorGap:`doorGap_KrIuB`,doorMarker:`doorMarker_-N63z`,gridLine:`gridLine_V-rxw`,roomFill:`roomFill_JnJ0J`,"roomFill-selected":`roomFill-selected_IfIRr`,roomFillSelected:`roomFill-selected_IfIRr`,roomStroke:`roomStroke_S18UH`,"roomStroke-selected":`roomStroke-selected_fm19u`,roomStrokeSelected:`roomStroke-selected_fm19u`,roomText:`roomText_6fIeU`,doorPanel:`doorPanel_raCv0`,"doorPanel-selected":`doorPanel-selected_5DG7g`,doorPanelSelected:`doorPanel-selected_5DG7g`,doorSwing:`doorSwing_Tbt9D`,"doorSwing-selected":`doorSwing-selected_fFte5`,doorSwingSelected:`doorSwing-selected_fFte5`,preview:`preview_seIZY`,polyCloseTarget:`polyCloseTarget_snjYx`,polyVertex:`polyVertex_fw0nX`,vertexHandle:`vertexHandle_-z7g5`},an=6,on=5,sn=1.25,cn=.25,ln=12,un=0;function dn(e){return un+=1,`${e}${un}`}var fn={select:`Drag inside to move · Drag corner to reshape · Click wall to add corner · Dbl-click corner to remove · Delete to erase`,rect:`Drag to draw a rectangular room`,polygon:`Click to place corners · Click first point or Enter to close · Esc to cancel`};function pn({className:e}){let[t,n]=(0,c.useState)([]),[r,i]=(0,c.useState)([]),[a,o]=(0,c.useState)(`rect`),[s,p]=(0,c.useState)(null),[m,h]=(0,c.useState)(null),[g,_]=(0,c.useState)(null),[v,y]=(0,c.useState)(null),[b,x]=(0,c.useState)([]),[S,C]=(0,c.useState)(null),[w,T]=(0,c.useState)(1),[E,D]=(0,c.useState)({x:0,y:0}),O=(0,c.useRef)(null),k=(0,c.useRef)(null),A=(0,c.useRef)(null),j=(0,c.useRef)(null),ee=(0,c.useRef)(null),M=(0,c.useRef)({rooms:t,doors:r,tool:a,selectedId:s,editingDoorsForRoomId:m,polyPoints:b,zoom:w,pan:E});(0,c.useLayoutEffect)(()=>{M.current={rooms:t,doors:r,tool:a,selectedId:s,editingDoorsForRoomId:m,polyPoints:b,zoom:w,pan:E}});function te(e){e.length<3||(n(t=>[...t,{id:dn(`room`),name:`Room ${t.length+1}`,points:e}]),x([]),C(null))}(0,c.useEffect)(()=>{let e=j.current;if(!e)return;function t(e){e.preventDefault();let{zoom:t,pan:n}=M.current,r=Ht(e.clientX,e.clientY,j.current);if(!r)return;let i=e.deltaY<0?sn:1/sn,a=Math.max(cn,Math.min(ln,t*i));D({x:r.x-(r.x-n.x)*(t/a),y:r.y-(r.y-n.y)*(t/a)}),T(a)}return e.addEventListener(`wheel`,t,{passive:!1}),()=>e.removeEventListener(`wheel`,t)},[]),(0,c.useEffect)(()=>{function e(e){let{tool:t,selectedId:r,editingDoorsForRoomId:a,polyPoints:o,zoom:s,pan:c}=M.current;if(e.key===`Escape`){if(a){h(null);return}t===`polygon`&&(x([]),C(null)),p(null);return}if(e.key===`Enter`&&t===`polygon`&&o.length>=3){te(o);return}if((e.key===`+`||e.key===`=`)&&!(e.target instanceof HTMLInputElement)){let e=Math.max(cn,Math.min(ln,s*sn)),t=c.x+400/s/2,n=c.y+300/s/2;T(e),D({x:t-400/e/2,y:n-300/e/2});return}if(e.key===`-`&&!(e.target instanceof HTMLInputElement)){let e=Math.max(cn,Math.min(ln,s/sn)),t=c.x+400/s/2,n=c.y+300/s/2;T(e),D({x:t-400/e/2,y:n-300/e/2});return}if(e.key===`0`&&!(e.target instanceof HTMLInputElement)){T(1),D({x:0,y:0});return}(e.key===`Delete`||e.key===`Backspace`)&&r&&!a&&!(e.target instanceof HTMLInputElement)&&(n(e=>e.filter(e=>e.id!==r)),i(e=>e.filter(e=>e.roomId!==r)),p(null))}return window.addEventListener(`keydown`,e),()=>window.removeEventListener(`keydown`,e)},[]);function N(e,t=w,n=E){let r=Math.max(cn,Math.min(ln,t*e)),i=n.x+400/t/2,a=n.y+300/t/2;D({x:i-400/r/2,y:a-300/r/2}),T(r)}function ne(e){return j.current?Ht(e.clientX,e.clientY,j.current):null}function re(e,t){let n=null;for(let r=0;r<t.points.length;r++){let i=Ut(e,t.points[r]);i<=an&&(!n||i<n.d)&&(n={index:r,d:i})}return n}function P(e,t){let n=null;for(let r=0;r<t.points.length;r++){let i=t.points[r],a=t.points[(r+1)%t.points.length],{dist:o,t:s}=Wt(e,i,a);o<=on&&(!n||o<n.d)&&(n={index:r,t:s,d:o})}return n}function ie(e,t,r,a){return n(n=>n.map(n=>{if(n.id!==e)return n;let r=[...n.points];return r.splice(t+1,0,a),{...n,points:r}})),i(n=>n.map(n=>n.roomId===e?n.wallIndex===t?n.t<=r?{...n,t:r>0?n.t/r:0}:{...n,wallIndex:t+1,t:(n.t-r)/(1-r)}:n.wallIndex>t?{...n,wallIndex:n.wallIndex+1}:n:n)),t+1}function ae(e,r){let a=t.find(t=>t.id===e);if(!a||a.points.length<=3)return;let o=a.points.length;n(t=>t.map(t=>t.id===e?{...t,points:t.points.filter((e,t)=>t!==r)}:t)),i(t=>t.map(t=>{if(t.roomId!==e)return t;let n=(r-1+o)%o;return t.wallIndex===n||t.wallIndex===r?{...t,wallIndex:-1}:t.wallIndex>r?{...t,wallIndex:t.wallIndex-1}:t}).filter(e=>e.wallIndex!==-1))}function F(e){if(e.button===1){e.preventDefault();let t=j.current;if(t){let n=t.getBoundingClientRect();A.current={startClient:{x:e.clientX,y:e.clientY},origPan:{...E},scaleX:400/w/n.width,scaleY:300/w/n.height}}return}if(e.button!==0)return;e.preventDefault();let n=ne(e);if(n){if(m){let e=t.find(e=>e.id===m);if(e){let t=Gt(n,[e]);t&&i(e=>[...e,{id:dn(`door`),roomId:t.roomId,wallIndex:t.wallIndex,t:t.t,width:12}])}return}if(a===`rect`){_(n),y(n);return}if(a===`polygon`){b.length>=3&&Ut(n,b[0])<=8?te(b):x(e=>[...e,n]);return}if(a===`select`){let e=t.find(e=>e.id===s)??null;if(e){let t=re(n,e);if(t){O.current={type:`vertex`,roomId:e.id,index:t.index,start:n,origPt:e.points[t.index]};return}}if(e){let t=P(n,e);if(t){let r=e.points[t.index],i=e.points[(t.index+1)%e.points.length],a=Vt({x:r.x+(i.x-r.x)*t.t,y:r.y+(i.y-r.y)*t.t}),o=ie(e.id,t.index,t.t,a);O.current={type:`vertex`,roomId:e.id,index:o,start:n,origPt:a};return}}let r=t.find(e=>Kt(n,e.points));if(r){p(r.id),O.current={type:`room`,roomId:r.id,start:n,origPoints:[...r.points]};return}p(null)}}}function I(e){if(a!==`select`||m)return;let n=ne(e);if(!n)return;let r=t.find(e=>e.id===s);if(!r)return;let i=re(n,r);i&&(e.preventDefault(),ae(r.id,i.index))}function L(e){if(A.current){let{startClient:t,origPan:n,scaleX:r,scaleY:i}=A.current;D({x:n.x-(e.clientX-t.x)*r,y:n.y-(e.clientY-t.y)*i});return}let r=ne(e);if(r){if(k.current&&m){let e=t.find(e=>e.id===m);if(e){let t=Gt(r,[e]);t&&i(e=>e.map(e=>e.id===k.current?{...e,wallIndex:t.wallIndex,t:t.t}:e))}return}if(a===`rect`&&g){y(r);return}if(a===`polygon`){C(r);return}if(a===`select`&&!m&&O.current){let e=O.current;if(e.type===`vertex`){let t=r.x-e.start.x,i=r.y-e.start.y,a=Vt({x:e.origPt.x+t,y:e.origPt.y+i});n(t=>t.map(t=>{if(t.id!==e.roomId)return t;let n=[...t.points];return n[e.index]=a,{...t,points:n}}))}else{let t=r.x-e.start.x,i=r.y-e.start.y;n(n=>n.map(n=>n.id===e.roomId?{...n,points:e.origPoints.map(e=>({x:e.x+t,y:e.y+i}))}:n))}}}}function R(e){if(A.current){A.current=null;return}let t=ne(e);if(t){if(a===`rect`&&g){let e=Math.min(g.x,t.x),r=Math.min(g.y,t.y),i=Math.abs(t.x-g.x),a=Math.abs(t.y-g.y);i>=10&&a>=10&&n(t=>[...t,{id:dn(`room`),name:`Room ${t.length+1}`,points:Jt(e,r,i,a)}]),_(null),y(null)}k.current=null,O.current=null}}function z(e){s&&n(t=>t.map(t=>t.id===s?{...t,name:e}:t))}function B(e,t){let n=parseFloat(t);isNaN(n)||n<=0||i(t=>t.map(t=>t.id===e?{...t,width:n}:t))}function oe(){s&&(n(e=>e.filter(e=>e.id!==s)),i(e=>e.filter(e=>e.roomId!==s)),h(null),p(null))}function se(e){i(t=>t.filter(t=>t.id!==e))}function ce(e){o(e),h(null),x([]),C(null),_(null),y(null)}function le(e){let t=e.target.files?.[0];if(!t)return;e.target.value=``;let r=new FileReader;r.onload=e=>{let t=e.target?.result;if(typeof t!=`string`)return;let r=nn(t);r.length!==0&&(n(r.map(e=>({...e,id:dn(`room`)}))),i([]),p(null),h(null),T(1),D({x:0,y:0}))},r.readAsText(t)}let V=a===`rect`&&g&&v?{x:Math.min(g.x,v.x),y:Math.min(g.y,v.y),w:Math.abs(v.x-g.x),h:Math.abs(v.y-g.y)}:null,H=s?t.find(e=>e.id===s)??null:null,U=m?t.find(e=>e.id===m)??null:null,W=m?r.filter(e=>e.roomId===m):[],ue=[{t:`select`,icon:d.faHandPointer,label:`Select & edit`},{t:`rect`,icon:d.faSquare,label:`Rectangle room`},{t:`polygon`,icon:d.faDrawPolygon,label:`Polygon room`}],de=400/w,G=300/w,fe=m?Z.roomDrawerCanvasDoor:a===`select`?Z.roomDrawerCanvasSelect:void 0;return(0,f.jsxs)(`div`,{className:(0,l.default)(Z.roomDrawer,e),children:[(0,f.jsxs)(`div`,{className:Z.roomDrawerToolbar,children:[ue.map(({t:e,icon:t,label:n})=>(0,f.jsx)(`button`,{title:n,className:(0,l.default)(Z.roomDrawerToolbarBtn,e===a&&!m&&Z.roomDrawerToolbarBtnActive),onClick:()=>ce(e),children:(0,f.jsx)(u.FontAwesomeIcon,{icon:t})},e)),(0,f.jsx)(`div`,{className:Z.roomDrawerToolbarSep}),(0,f.jsx)(`button`,{title:`Zoom in (+)`,className:Z.roomDrawerToolbarBtn,onClick:()=>N(sn),disabled:w>=ln,children:(0,f.jsx)(u.FontAwesomeIcon,{icon:d.faMagnifyingGlassPlus})}),(0,f.jsxs)(`button`,{title:`Reset zoom (0) — ${Math.round(w*100)}%`,className:Z.roomDrawerToolbarZoomLabel,onClick:()=>{T(1),D({x:0,y:0})},children:[Math.round(w*100),`%`]}),(0,f.jsx)(`button`,{title:`Zoom out (−)`,className:Z.roomDrawerToolbarBtn,onClick:()=>N(1/sn),disabled:w<=cn,children:(0,f.jsx)(u.FontAwesomeIcon,{icon:d.faMagnifyingGlassMinus})}),(0,f.jsx)(`div`,{className:Z.roomDrawerToolbarSep}),(0,f.jsx)(`button`,{title:`Upload SVG`,className:Z.roomDrawerToolbarBtn,onClick:()=>ee.current?.click(),children:(0,f.jsx)(u.FontAwesomeIcon,{icon:d.faUpload})}),(0,f.jsx)(`button`,{title:`Download SVG`,className:Z.roomDrawerToolbarBtn,onClick:()=>rn(t,r),disabled:t.length===0,children:(0,f.jsx)(u.FontAwesomeIcon,{icon:d.faDownload})}),(0,f.jsx)(`input`,{ref:ee,type:`file`,accept:`.svg,image/svg+xml`,style:{display:`none`},onChange:le})]}),(0,f.jsxs)(`svg`,{ref:j,className:(0,l.default)(Z.roomDrawerCanvas,fe),viewBox:`${E.x} ${E.y} ${de} ${G}`,onMouseDown:F,onMouseMove:L,onMouseUp:R,onDoubleClick:I,children:[(0,f.jsx)(`defs`,{children:(0,f.jsx)(`pattern`,{id:`rd-grid`,width:5,height:5,patternUnits:`userSpaceOnUse`,children:(0,f.jsx)(`path`,{d:`M 5 0 L 0 0 0 5`,fill:`none`,className:Z.gridLine})})}),(0,f.jsx)(`rect`,{x:E.x,y:E.y,width:de,height:G,fill:`url(#rd-grid)`}),t.map(e=>{let t=e.points,n=t.map((e,t)=>`${t===0?`M`:`L`} ${e.x},${e.y}`).join(` `)+` Z`,i=Qt(t,r.filter(t=>t.roomId===e.id)),a=qt(t),o=s===e.id,c=m===e.id;return(0,f.jsxs)(`g`,{children:[(0,f.jsx)(`path`,{d:n,className:(0,l.default)(Z.roomFill,(o||c)&&Z.roomFillSelected)}),i.map((e,t)=>(0,f.jsx)(`path`,{d:e,className:(0,l.default)(Z.roomStroke,(o||c)&&Z.roomStrokeSelected)},t)),e.name&&(0,f.jsx)(`text`,{x:a.x,y:a.y,className:Z.roomText,textAnchor:`middle`,dominantBaseline:`middle`,children:e.name})]},e.id)}),r.map(e=>{let n=t.find(t=>t.id===e.roomId);if(!n)return null;let r=n.points[e.wallIndex],i=n.points[(e.wallIndex+1)%n.points.length],a=Yt(r,i,e.t,e.width);return a?(0,f.jsx)(`line`,{x1:a.p1.x,y1:a.p1.y,x2:a.p2.x,y2:a.p2.y,className:Z.doorGap},e.id):null}),m&&W.map(e=>{let n=t.find(t=>t.id===e.roomId);if(!n)return null;let r=n.points[e.wallIndex],i=n.points[(e.wallIndex+1)%n.points.length],a=Yt(r,i,e.t,e.width);if(!a)return null;let o={x:(a.p1.x+a.p2.x)/2,y:(a.p1.y+a.p2.y)/2};return(0,f.jsx)(`circle`,{cx:o.x,cy:o.y,r:2.5,className:Z.doorMarker,onMouseDown:t=>{t.button===0&&(t.preventDefault(),t.stopPropagation(),k.current=e.id)}},e.id)}),a===`select`&&!m&&H&&H.points.map((e,t)=>(0,f.jsx)(`circle`,{cx:e.x,cy:e.y,r:3.5,className:Z.vertexHandle},t)),V&&(0,f.jsx)(`rect`,{x:V.x,y:V.y,width:V.w,height:V.h,className:Z.preview}),a===`polygon`&&b.length>0&&(0,f.jsxs)(f.Fragment,{children:[(0,f.jsx)(`polyline`,{points:[...b,S??b[b.length-1]].map(e=>`${e.x},${e.y}`).join(` `),className:Z.preview}),b.length>=3&&(0,f.jsx)(`circle`,{cx:b[0].x,cy:b[0].y,r:8/2,className:Z.polyCloseTarget}),b.map((e,t)=>(0,f.jsx)(`circle`,{cx:e.x,cy:e.y,r:2,className:Z.polyVertex},t))]})]}),H&&!m&&(0,f.jsxs)(`div`,{className:Z.roomDrawerInfo,children:[(0,f.jsx)(`span`,{className:Z.roomDrawerInfoLabel,children:`Name`}),(0,f.jsx)(`input`,{className:Z.roomDrawerInfoInput,value:H.name,onChange:e=>z(e.target.value),placeholder:`Room name`}),(0,f.jsxs)(`button`,{className:Z.roomDrawerInfoDoorsBtn,onClick:()=>h(H.id),title:`Edit doors`,children:[(0,f.jsx)(u.FontAwesomeIcon,{icon:d.faDoorOpen}),(0,f.jsx)(`span`,{children:r.filter(e=>e.roomId===H.id).length})]}),(0,f.jsx)(`button`,{className:Z.roomDrawerInfoDelete,onClick:oe,title:`Delete room`,children:(0,f.jsx)(u.FontAwesomeIcon,{icon:d.faTrash})})]}),m&&U&&(0,f.jsxs)(`div`,{className:Z.roomDrawerDoorPanel,children:[(0,f.jsxs)(`div`,{className:Z.roomDrawerDoorPanelHeader,children:[(0,f.jsx)(u.FontAwesomeIcon,{icon:d.faDoorOpen,className:Z.roomDrawerDoorPanelIcon}),(0,f.jsx)(`span`,{className:Z.roomDrawerDoorPanelTitle,children:U.name?`Doors · ${U.name}`:`Doors`}),(0,f.jsxs)(`button`,{className:Z.roomDrawerDoorPanelDone,onClick:()=>h(null),title:`Done (Esc)`,children:[(0,f.jsx)(u.FontAwesomeIcon,{icon:d.faCheck}),`Done`]})]}),(0,f.jsxs)(`div`,{className:Z.roomDrawerDoorPanelList,children:[W.length===0&&(0,f.jsx)(`span`,{className:Z.roomDrawerDoorPanelEmpty,children:`Click on a wall to add a door`}),W.map((e,t)=>(0,f.jsxs)(`div`,{className:Z.roomDrawerDoorPanelItem,children:[(0,f.jsxs)(`span`,{className:Z.roomDrawerDoorPanelLabel,children:[`Door `,t+1]}),(0,f.jsx)(`span`,{className:Z.roomDrawerDoorPanelWidthLabel,children:`Width`}),(0,f.jsx)(`input`,{className:Z.roomDrawerInfoInput,type:`number`,min:1,value:e.width,onChange:t=>B(e.id,t.target.value)}),(0,f.jsx)(`button`,{className:Z.roomDrawerInfoDelete,onClick:()=>se(e.id),title:`Delete door`,children:(0,f.jsx)(u.FontAwesomeIcon,{icon:d.faTrash})})]},e.id))]})]}),(0,f.jsx)(`div`,{className:Z.roomDrawerHint,children:m?`Click a wall to add a door · Adjust width or delete from the list · Done or Esc to finish`:`${fn[a]} · Scroll to zoom · Middle-drag to pan · 0 to reset`})]})}var mn={"roomViewer-containerLoading":`roomViewer-containerLoading_BL3M-`,roomViewerContainerLoading:`roomViewer-containerLoading_BL3M-`,"roomViewer-container":`roomViewer-container_YlmB8`,roomViewerContainer:`roomViewer-container_YlmB8`,"roomViewer-active":`roomViewer-active_gG6wf`,roomViewerActive:`roomViewer-active_gG6wf`,"roomViewer-selected":`roomViewer-selected_CpdMj`,roomViewerSelected:`roomViewer-selected_CpdMj`,"roomViewer-tint":`roomViewer-tint_O9JrM`,roomViewerTint:`roomViewer-tint_O9JrM`,"roomViewer-actions":`roomViewer-actions_4cA74`,roomViewerActions:`roomViewer-actions_4cA74`,"roomViewer-header":`roomViewer-header_XEHCO`,roomViewerHeader:`roomViewer-header_XEHCO`};function hn({data:e=[]}){let t=(0,c.useRef)(null),[,n]=(0,c.useState)(null),[r,i]=(0,c.useState)(0),[a,o]=(0,c.useState)(!0);(0,c.useEffect)(()=>{let i=new AbortController;n(null);let a=t.current;return r>e.length-1||!a?(o(!1),()=>i.abort()):(a.querySelectorAll(`[id^="room"]`).forEach(e=>{e.addEventListener(`click`,()=>s(e.id,a),{signal:i.signal})}),o(!1),()=>i.abort())},[e,r]);function s(e,t){let r=e.substring(4);n(n=>{if(r===n)return n;let[i]=t.querySelectorAll(`[id="use"]`);i?.setAttribute(`href`,`#${e}`);let[a]=t.querySelectorAll(`[id="${e}"]`);if(n){let[e]=t.querySelectorAll(`[id="room${n}"]`);if(e){e.classList.remove(mn.roomViewerSelected,mn.roomViewerTint);let[t]=e.querySelectorAll(`[id="background"]`);t&&t.classList.remove(mn.roomViewerTint)}}if(a){a.classList.add(mn.roomViewerSelected);let[e]=a.querySelectorAll(`[id="background"]`);(e??a).classList.add(mn.roomViewerTint)}return r})}function p(t){i(n=>{let r=n+t;return r<0||r>e.length-1?n:r})}let m=e[r]?.data??null;return(0,f.jsxs)(`div`,{className:mn.roomViewer,ref:t,children:[(0,f.jsx)(`h3`,{className:mn.roomViewerHeader,children:e[r]?.label??``}),(0,f.jsx)(`div`,{className:(0,l.default)(mn.roomViewerContainer,a&&mn.roomViewerContainerLoading),children:m},r),e.length>1&&(0,f.jsxs)(`div`,{className:mn.roomViewerActions,children:[(0,f.jsx)(u.FontAwesomeIcon,{icon:d.faChevronLeft,onClick:()=>p(-1)}),(0,f.jsx)(u.FontAwesomeIcon,{icon:d.faLayerGroup}),(0,f.jsx)(u.FontAwesomeIcon,{icon:d.faChevronRight,onClick:()=>p(1)})]})]})}var gn={scrollbarProvider:`scrollbarProvider_IMBFu`};function _n({className:e=void 0,children:t=void 0}){return(0,f.jsx)(`div`,{className:(0,l.default)(gn.scrollbarProvider,e),children:t})}var vn=_n,yn={resultCount:`resultCount_Sn48Q`};function bn({value:e,onChange:t,onDebounce:n,placeholder:r,label:i,debounceMs:a=500,totalAmount:o,showAmount:s=!0,className:l,width:u,...d}){let p=(0,c.useRef)(null);(0,c.useEffect)(()=>()=>{p.current!==null&&clearTimeout(p.current)},[]);function m(e){let r=e==null?``:String(e),i=r.trim()===``?``:r;t(i),p.current!==null&&clearTimeout(p.current),p.current=setTimeout(()=>{n?.(i)},a)}let h=s&&typeof o==`number`&&!Number.isNaN(o);return(0,f.jsxs)(`div`,{...d,className:l,style:u==null?void 0:{width:u},children:[(0,f.jsx)(_e,{type:q.Search,label:i,placeholder:r,value:e,onChange:m}),h&&(0,f.jsxs)(`p`,{className:yn.resultCount,children:[o,` `,o===1?`result`:`results`]})]})}var xn={stepper:`stepper_kiS2A`,"stepper-clickable":`stepper-clickable_Nm6fP`,stepperClickable:`stepper-clickable_Nm6fP`,"stepper-vertical":`stepper-vertical_2y9rg`,stepperVertical:`stepper-vertical_2y9rg`,"stepper-connector":`stepper-connector_J2FwZ`,stepperConnector:`stepper-connector_J2FwZ`,"stepper-connector-vertical":`stepper-connector-vertical_vwY38`,stepperConnectorVertical:`stepper-connector-vertical_vwY38`,"stepper-connector-filled":`stepper-connector-filled_W8UZS`,stepperConnectorFilled:`stepper-connector-filled_W8UZS`,"stepper-entry":`stepper-entry_KD4JJ`,stepperEntry:`stepper-entry_KD4JJ`,"stepper-entry-active":`stepper-entry-active_V1aRt`,stepperEntryActive:`stepper-entry-active_V1aRt`,"stepper-entry-done":`stepper-entry-done_M3wb5`,stepperEntryDone:`stepper-entry-done_M3wb5`,"stepper-entry-number":`stepper-entry-number_J168Q`,stepperEntryNumber:`stepper-entry-number_J168Q`,"stepper-entry-number-done":`stepper-entry-number-done_-m7sD`,stepperEntryNumberDone:`stepper-entry-number-done_-m7sD`,showCheckmark:`showCheckmark_Rd0oW`,"stepper-entry-label":`stepper-entry-label_b94eg`,stepperEntryLabel:`stepper-entry-label_b94eg`,"stepper-entry-label-vertical":`stepper-entry-label-vertical_Zm8i4`,stepperEntryLabelVertical:`stepper-entry-label-vertical_Zm8i4`};function Sn(){return(0,f.jsx)(`svg`,{strokeLinejoin:`round`,strokeLinecap:`round`,xmlns:`http://www.w3.org/2000/svg`,viewBox:`-0.2 -1.2 3.4 2`,height:`20px`,width:`20px`,children:(0,f.jsx)(`path`,{d:`M 0 0 l 1 1 l 2 -2`,stroke:`white`,strokeWidth:`0.4`,fill:`none`})})}function Cn({steps:e=[],currentStep:t=0,alignment:n=`horizontal`,onStepClicked:r=null,nonLinear:i=!1,hideLabels:a=!1,className:o,style:s,classNames:u,styles:d,...p}){let m=n===`vertical`;return(0,f.jsx)(`div`,{...p,className:(0,l.default)(xn.stepper,{[xn.stepperVertical]:m},u?.root,o),style:{...d?.root,...s},children:e.map((n,o)=>{let s=o<t,p=o<=t,h=!!r&&(i?o!==t:s),g=(0,l.default)(xn.stepperEntry,{[xn.stepperEntryActive]:p},{[xn.stepperEntryDone]:s},{[xn.stepperClickable]:h},u?.entry),_=(0,f.jsxs)(f.Fragment,{children:[(0,f.jsx)(`div`,{className:(0,l.default)(xn.stepperEntryNumber,{[xn.stepperEntryNumberDone]:s},u?.entryNumber),style:d?.entryNumber,children:s?(0,f.jsx)(Sn,{}):o+1}),!a&&(0,f.jsx)(`div`,{className:(0,l.default)(xn.stepperEntryLabel,{[xn.stepperEntryLabelVertical]:m},u?.entryLabel),style:d?.entryLabel,children:n.label})]});return(0,f.jsxs)(c.default.Fragment,{children:[h?(0,f.jsx)(I,{className:g,style:d?.entry,onClick:()=>r(o),"aria-current":o===t?`step`:void 0,children:_}):(0,f.jsx)(`div`,{className:g,style:d?.entry,"aria-current":o===t?`step`:void 0,children:_}),o<e.length-1&&(0,f.jsx)(`div`,{className:(0,l.default)(xn.stepperConnector,{[xn.stepperConnectorFilled]:s},{[xn.stepperConnectorVertical]:m},u?.connector),style:d?.connector})]},o)})})}var wn=`https://tenor.googleapis.com/v2`,Tn=class{constructor(e){this.key=e}async search(e,t={}){let n=new URLSearchParams({q:e,key:this.key});return t.limit!=null&&n.set(`limit`,String(t.limit)),t.contentfilter!=null&&n.set(`contentfilter`,t.contentfilter),t.pos!=null&&n.set(`pos`,t.pos),(await fetch(`${wn}/search?${n}`)).json()}async searchSuggestions(e){let t=new URLSearchParams({q:e,key:this.key});return(await fetch(`${wn}/search_suggestions?${t}`)).json()}registerShare(e,t){let n=new URLSearchParams({id:t,q:e,key:this.key});fetch(`${wn}/registershare?${n}`).catch(()=>null)}},En={gifPreview:`gifPreview_-ECUZ`,"gifPreview-image":`gifPreview-image_Aq7-a`,gifPreviewImage:`gifPreview-image_Aq7-a`,"gifPreview-image-container":`gifPreview-image-container_ycypL`,gifPreviewImageContainer:`gifPreview-image-container_ycypL`,gradientBottomLeftToTopRight:`gradientBottomLeftToTopRight_wo6HB`};function Dn({className:e,previewItems:t=[],onSelect:n,onLoadAdditional:r}){function i(e){let t=e.currentTarget,n=t.scrollHeight-t.clientHeight*1.5;t.scrollTop>=n&&r?.()}return(0,f.jsx)(f.Fragment,{children:t.length>0&&(0,f.jsx)(`div`,{className:(0,l.default)(En.gifPreview,e),onScroll:i,children:t.map((e,t)=>(0,f.jsx)(I,{className:En.gifPreviewImageContainer,onClick:()=>n?.(e),children:(0,f.jsx)(`div`,{className:En.gifPreviewImage,style:{backgroundImage:`url(${e.media_formats.tinygif.url})`}})},`${e.id}_${t}`))})})}var On={gifView:`gifView_Fa2zj`,"gifView-loading":`gifView-loading_LfNJr`,gifViewLoading:`gifView-loading_LfNJr`,gradientBottomLeftToTopRight:`gradientBottomLeftToTopRight_JR6aS`};function kn({className:e,src:t=``}){let[n,r]=(0,c.useState)(!0);return(0,c.useEffect)(()=>{r(!0)},[t]),(0,f.jsxs)(`div`,{className:(0,l.default)(On.gifView,e),children:[(0,f.jsx)(`img`,{className:On.tenorPickerSelected,src:t,onLoad:()=>r(!1)}),n&&(0,f.jsx)(`div`,{className:On.gifViewLoading})]})}var An={"tenorPicker-selected":`tenorPicker-selected_IfR2z`,tenorPickerSelected:`tenorPicker-selected_IfR2z`,"tenorPicker-modal-content":`tenorPicker-modal-content_Vkolf`,tenorPickerModalContent:`tenorPicker-modal-content_Vkolf`,"tenorPicker-suggestions-container":`tenorPicker-suggestions-container_kJCj5`,tenorPickerSuggestionsContainer:`tenorPicker-suggestions-container_kJCj5`,"tenorPicker-suggestions-item":`tenorPicker-suggestions-item_Rl99M`,tenorPickerSuggestionsItem:`tenorPicker-suggestions-item_Rl99M`};function jn({className:e,token:t=``,isModal:n=!1,onSelect:r=()=>void 0,selected:i=null}){let a=(0,c.useMemo)(()=>new Tn(t),[t]),[o,s]=(0,c.useState)(``),[u,d]=(0,c.useState)([]),[p,m]=(0,c.useState)([]),[h,g]=(0,c.useState)(null),[_,v]=(0,c.useState)(!1);async function y(e){if(s(e),!e.trim()){d([]),m([]),g(null);return}let[{results:t=[],next:n=null},{results:r=[]}]=await Promise.all([a.search(e,{limit:18,contentfilter:`medium`}),a.searchSuggestions(e)]);d(t),g(n),m(r)}async function b(){let{results:e=[],next:t=null}=await a.search(o,{limit:36,pos:h??void 0,contentfilter:`medium`});g(t),d(t=>[...t,...e])}async function x(e){await r(e),v(!1),e&&a.registerShare(o,e.id)}function S(){return(0,f.jsx)(de,{inline:!0,className:An.tenorPickerSuggestionsContainer,children:p.map(e=>(0,f.jsx)(ue,{className:An.tenorPickerSuggestionsItem,text:e,onClick:()=>y(e)},e))})}function C(){return(0,f.jsx)(Dn,{previewItems:u,onSelect:x,onLoadAdditional:b})}function w(){return(0,f.jsx)(bn,{label:`Pick gif`,value:o,onDebounce:y,onChange:s})}return n?(0,f.jsxs)(`div`,{className:(0,l.default)(An.tenorPicker,e),children:[(0,f.jsxs)(`div`,{className:E.actionButtons,children:[(0,f.jsx)(P,{onClick:()=>v(!0),children:`Pick gif`}),i&&(0,f.jsx)(P,{styleType:j.Delete,onClick:()=>x(null),children:`Remove gif`})]}),i&&(0,f.jsx)(kn,{className:An.tenorPickerSelected,src:i}),(0,f.jsx)(ke,{isOpen:_,onClose:()=>v(!1),children:(0,f.jsxs)(`div`,{className:An.tenorPickerModalContent,children:[w(),S(),C()]})})]}):(0,f.jsxs)(`div`,{className:(0,l.default)(An.tenorPicker,e),children:[(0,f.jsx)(me,{align:fe.Left,isOpen:u.length>0&&_,onOpenChange:v,content:(0,f.jsxs)(f.Fragment,{children:[S(),C()]}),children:w()}),i&&(0,f.jsx)(P,{styleType:j.Delete,onClick:()=>x(null),children:`Remove gif`}),i&&(0,f.jsx)(kn,{className:An.tenorPickerSelected,src:i})]})}function Mn(e){return(0,f.jsx)(_e,{...e,multiline:!0})}var Nn={id:`default`,variables:{"--grey":`#8A8A8A`,"--lightgrey":`#e0e0e0`,"--lightergrey":`#B1B1B1`,"--white":`#FFFFFF`,"--red":`#D6002A`,"--lighter-red":`#ffeae9`,"--green":`#287626`,"--lighter-green":`#C4FFC9`,"--blue":`#5873d5`,"--lighter-blue":`#C6DBFF`,"--black":`black`,"--orange":`#ff7f50`,"--lighter-orange":`#ffe5d9`,"--primary-color":`#8184d6`,"--primary-accent":`#90CAF9`,"--primary-lighter":`#9a9ce4`,"--accent-color":`var(--grey)`,"--accent-color-light":`var(--lightgrey)`,"--text-color":`var(--white)`,"--text-dark":`var(--lightergrey)`,"--text-light":`var(--lightergrey)`,"--text-on-primary":`var(--white)`,"--text-on-delete":`var(--white)`,"--border-color":`#656574`,"--background":`#393945`,"--background-accent":`#33333c`,"--background-accent-dark":`var(--grey)`,"--background-accent-light":`#484856`,"--background-modal":`#484856`,"--success-color":`var(--green)`,"--success-lighter":`var(--lighter-green)`,"--error-color":`var(--red)`,"--error-lighter":`var(--lighter-red)`,"--info-color":`var(--blue)`,"--info-lighter":`var(--lighter-blue)`,"--warn-color":`var(--orange)`,"--warn-lighter":`var(--lighter-orange)`,"--default-font-size":`14px`,"--text-small-font-size":`12px`,"--header-font-size":`24px`,"--header-medium-font-size":`18px`,"--header-small-font-size":`16px`,"--default-font-weight":`400`,"--header-font-weight":`600`,"--input-background":`transparent`,"--input-icon-color":`var(--text-color)`,"--error-border-color":`var(--red)`,"--default-border-radius":`8px`,"--padding-sides":`15px`,"--margin-top":`10px`,"--default-font":`'Inter', sans-serif`,"--themed-font":`'Inter', sans-serif`,"--card-shadow":`0 3px 1px -2px rgb(0 0 0 / 20%), 0 2px 2px 0 rgb(0 0 0 / 14%), 0 1px 5px 0 rgb(0 0 0 / 12%)`,"--spacing-s":`4px`,"--spacing-m":`8px`,"--spacing-l":`16px`}},Pn={colorFade:`colorFade_eLv2g`},Fn=class extends c.Component{constructor(...e){super(...e),this.state={resolvedVariables:{},colorFadeActive:!1,currentThemeColor:null},this.colorFadeTimeout=null,this.wrapperRef=c.default.createRef(),this.themeColorMeta=null,this.createdThemeColorMeta=!1,this.applyTheme=e=>{let t=this.props.themes??[Nn],n=t.find(e=>!e.baseThemeId)??t[0],r=n?n.variables:{},i=t.find(t=>t.id===e),a=i?this.resolveChain(i.id):[],o=Object.assign({},r,...a);this.setState({resolvedVariables:o,colorFadeActive:!0}),this.colorFadeTimeout&&clearTimeout(this.colorFadeTimeout),this.colorFadeTimeout=setTimeout(()=>{this.setState({colorFadeActive:!1}),this.colorFadeTimeout=null},500),setTimeout(()=>{this.wrapperRef.current&&this.setState({currentThemeColor:getComputedStyle(this.wrapperRef.current).getPropertyValue(`--primary-color`).trim()})},1)}}componentDidMount(){this.applyTheme(this.props.currentThemeId),this.syncThemeColorMeta(this.state.currentThemeColor??``)}componentDidUpdate(e,t){t.currentThemeColor!==this.state.currentThemeColor&&this.syncThemeColorMeta(this.state.currentThemeColor??``),(e.currentThemeId!==this.props.currentThemeId||e.themes!==this.props.themes)&&this.applyTheme(this.props.currentThemeId)}componentWillUnmount(){this.colorFadeTimeout&&clearTimeout(this.colorFadeTimeout),this.createdThemeColorMeta&&this.themeColorMeta?.remove()}syncThemeColorMeta(e){if(!(typeof document>`u`)){if(!this.themeColorMeta){let e=document.head.querySelector(`meta[name="theme-color"]`);if(e)this.themeColorMeta=e;else{let e=document.createElement(`meta`);e.setAttribute(`name`,`theme-color`),document.head.appendChild(e),this.themeColorMeta=e,this.createdThemeColorMeta=!0}}this.themeColorMeta.setAttribute(`content`,e)}}resolveChain(e){let t=(this.props.themes??[Nn]).find(t=>t.id===e);return t?[...t.baseThemeId?this.resolveChain(t.baseThemeId):[],t.variables]:[]}render(){let{children:e}=this.props,{resolvedVariables:t,colorFadeActive:n}=this.state;return(0,f.jsx)(`div`,{ref:this.wrapperRef,id:`themeProvider`,className:n?Pn.colorFade:void 0,style:t,children:e})}};function In(e=`default`){let[t,n]=(0,c.useState)(localStorage.getItem(`theme`)||e);return{currentThemeId:t,setCurrentThemeId:e=>{n(e),localStorage.setItem(`theme`,e)}}}var Ln={container:`container_krdsW`,"container-top-left":`container-top-left_zfDTO`,containerTopLeft:`container-top-left_zfDTO`,"container-top-center":`container-top-center_CUIGc`,containerTopCenter:`container-top-center_CUIGc`,"container-top-right":`container-top-right_sB0KU`,containerTopRight:`container-top-right_sB0KU`,"container-bottom-left":`container-bottom-left_toJdF`,containerBottomLeft:`container-bottom-left_toJdF`,"container-bottom-center":`container-bottom-center_Bkf9m`,containerBottomCenter:`container-bottom-center_Bkf9m`,"container-bottom-right":`container-bottom-right_oRSMc`,containerBottomRight:`container-bottom-right_oRSMc`,toast:`toast_qBi4o`,toastSlideDown:`toastSlideDown_4lKWq`,"toast-bottom":`toast-bottom_X8ZIe`,toastBottom:`toast-bottom_X8ZIe`,toastSlideUp:`toastSlideUp_SGR5X`,"toast-dismissing":`toast-dismissing_xKmB-`,toastDismissing:`toast-dismissing_xKmB-`,toastFadeOut:`toastFadeOut_cvHYp`,"toast-info":`toast-info_RlLli`,toastInfo:`toast-info_RlLli`,toastIcon:`toastIcon_xU1nA`,"toast-error":`toast-error_MloFO`,toastError:`toast-error_MloFO`,"toast-warn":`toast-warn_pP6HB`,toastWarn:`toast-warn_pP6HB`,"toast-default":`toast-default_RTt2L`,toastDefault:`toast-default_RTt2L`,toastContent:`toastContent_gvyIv`,toastCloseButton:`toastCloseButton_n-YST`,toastProgressBar:`toastProgressBar_6vBs6`,toastShrink:`toastShrink_h89HS`},Rn={info:d.faCircleInfo,error:d.faCircleXmark,warn:d.faTriangleExclamation,default:d.faBell};function zn({item:e,isBottom:t,onDismiss:n}){let{id:r,content:i,options:a,dismissing:o}=e,{duration:s,showRemainingTime:p,showCloseButton:m,type:h,classNames:g,styles:_}=a;return(0,c.useEffect)(()=>{if(s===0)return;let e=setTimeout(()=>n(r),s);return()=>clearTimeout(e)},[r,s,n]),(0,f.jsxs)(`div`,{className:(0,l.default)(Ln.toast,t?Ln.toastBottom:null,Ln[`toast-${h}`],o&&Ln.toastDismissing,g?.root),style:_?.root,children:[(0,f.jsx)(u.FontAwesomeIcon,{icon:Rn[h],className:(0,l.default)(Ln.toastIcon,g?.icon),style:_?.icon}),(0,f.jsx)(`div`,{className:(0,l.default)(Ln.toastContent,g?.content),style:_?.content,children:i}),m&&(0,f.jsx)(R,{icon:d.faXmark,onClick:()=>n(r),className:(0,l.default)(Ln.toastCloseButton,g?.closeButton),style:_?.closeButton,"aria-label":`Close`}),p&&s>0&&(0,f.jsx)(`div`,{className:(0,l.default)(Ln.toastProgressBar,g?.progressBar),style:{"--toast-duration":`${s}ms`,..._?.progressBar}})]})}var Bn=null;function Vn(e){Bn=e}function Hn(){Bn=null}function Un(e,t){if(!Bn){console.error(`[Toast] No ToastProvider found. Wrap your app with <ToastProvider>.`);return}Bn(e,t)}var Wn={position:`top-right`,duration:4e3,showRemainingTime:!0,showCloseButton:!0,allowStacking:!0},Gn=220;function Kn(e){return Ln[`container-${e}`]}function qn({children:e,position:t=Wn.position,duration:n=Wn.duration,showRemainingTime:r=Wn.showRemainingTime,showCloseButton:i=Wn.showCloseButton,allowStacking:a=Wn.allowStacking}){let[o,s]=(0,c.useState)([]),u=(0,c.useRef)(0),d=(0,c.useCallback)(e=>{s(t=>t.map(t=>t.id===e?{...t,dismissing:!0}:t)),setTimeout(()=>{s(t=>t.filter(t=>t.id!==e))},Gn)},[]),p=(0,c.useCallback)((e,o)=>{let c={position:o?.position??t,duration:o?.duration??n,showRemainingTime:o?.showRemainingTime??r,showCloseButton:o?.showCloseButton??i,type:o?.type??`default`,classNames:o?.classNames,styles:o?.styles};u.current+=1;let l={id:`toast-${u.current}`,content:e,options:c,dismissing:!1};s(e=>!a&&e.length>0?(setTimeout(()=>{s([l])},Gn),e.map(e=>({...e,dismissing:!0}))):[...e,l])},[t,n,r,i,a]);(0,c.useEffect)(()=>(Vn(p),()=>Hn()),[p]);let m=o.reduce((e,t)=>{let n=t.options.position;return e[n]||(e[n]=[]),e[n].push(t),e},{});return(0,f.jsxs)(f.Fragment,{children:[e,(0,f.jsx)(z,{children:Object.entries(m).map(([e,t])=>(0,f.jsx)(`div`,{className:(0,l.default)(Ln.container,Kn(e)),children:t.map(t=>(0,f.jsx)(zn,{item:t,isBottom:e.startsWith(`bottom`),onDismiss:d},t.id))},e))})]})}var Q={virtualList:`virtualList_qBPNc`,"virtualList-header":`virtualList-header_0Ellb`,virtualListHeader:`virtualList-header_0Ellb`,"virtualList-header-cell":`virtualList-header-cell_c8NGV`,virtualListHeaderCell:`virtualList-header-cell_c8NGV`,"virtualList-header-toggle":`virtualList-header-toggle_pYFxD`,virtualListHeaderToggle:`virtualList-header-toggle_pYFxD`,"virtualList-toggle-wrapper":`virtualList-toggle-wrapper_JP32M`,virtualListToggleWrapper:`virtualList-toggle-wrapper_JP32M`,"virtualList-toggle-popover":`virtualList-toggle-popover_gbpd7`,virtualListTogglePopover:`virtualList-toggle-popover_gbpd7`,"virtualList-toggle-item":`virtualList-toggle-item_5gu5d`,virtualListToggleItem:`virtualList-toggle-item_5gu5d`,"virtualList-select-cell":`virtualList-select-cell_s9kAy`,virtualListSelectCell:`virtualList-select-cell_s9kAy`,"virtualList-body":`virtualList-body_k-fRr`,virtualListBody:`virtualList-body_k-fRr`,"virtualList-row":`virtualList-row_TTY50`,virtualListRow:`virtualList-row_TTY50`,"virtualList-row-no-divider":`virtualList-row-no-divider_Ct0gV`,virtualListRowNoDivider:`virtualList-row-no-divider_Ct0gV`,"virtualList-row-selected":`virtualList-row-selected_hwEN-`,virtualListRowSelected:`virtualList-row-selected_hwEN-`,"virtualList-cell":`virtualList-cell_H0zBv`,virtualListCell:`virtualList-cell_H0zBv`,"virtualList-loading-full":`virtualList-loading-full_wzZNM`,virtualListLoadingFull:`virtualList-loading-full_wzZNM`,"virtualList-loading-indicator":`virtualList-loading-indicator_EJced`,virtualListLoadingIndicator:`virtualList-loading-indicator_EJced`,"virtualList-spinner":`virtualList-spinner_apClW`,virtualListSpinner:`virtualList-spinner_apClW`};function Jn(e,t,n,r=0){let i=Array(e+1);i[0]=0;for(let a=0;a<e;a++){let o=a<e-1?r:0;i[a+1]=i[a]+(t.get(a)??n)+o}return{offsets:i,totalHeight:i[e]}}function Yn(e,t,n,r,i){if(i===0)return{startIndex:0,endIndex:-1};let a=0,o=i-1;for(;a<o;){let n=a+o>>1;e[n+1]<=t?a=n+1:o=n}let s=a;for(;s<i&&e[s]<t+n;)s++;return{startIndex:Math.max(0,a-r),endIndex:Math.min(i-1,s+r-1)}}function Xn(e){return e.length===0?`1fr`:e.map(e=>{switch(e.width.type){case`fixed`:return`${e.width.px}px`;case`flex`:return`${e.width.weight??1}fr`;case`fit`:return`fit-content(100%)`}}).join(` `)}function Zn({index:e,top:t,columnTemplate:n,isSelected:r,showDivider:i,onClick:a,onHeightChange:o,rowClassName:s,rowStyle:u,children:d}){let p=(0,c.useRef)(null);return(0,c.useEffect)(()=>{let t=p.current;if(!t)return;let n=new ResizeObserver(()=>o(e,t.offsetHeight));return n.observe(t),()=>n.unobserve(t)},[e,o]),(0,f.jsx)(`div`,{ref:p,className:(0,l.default)(Q.virtualListRow,r&&Q.virtualListRowSelected,!i&&Q.virtualListRowNoDivider,s),style:{position:`absolute`,top:t,left:0,right:0,...n?{display:`grid`,gridTemplateColumns:n}:{},...u},onClick:a,"aria-selected":r,role:`row`,children:d})}function Qn({items:e,renderRow:t,columns:n,height:r=`100%`,estimatedRowHeight:i=40,overscan:a=3,rowGap:o=0,selectedKey:s,getItemKey:p,onRowClick:m,visibleColumnKeys:h,onVisibleColumnsChange:g,showColumnToggle:_,onLoadMore:v,loadMoreThreshold:y=100,isLoading:b=!1,multiSelect:x=!1,selectedKeys:S,onSelectionChange:C,showDivider:w=!0,className:T,style:E,classNames:D,styles:O,...k}){let[j,ee]=(0,c.useState)(0),[M,te]=(0,c.useState)(0),[N,ne]=(0,c.useState)(new Map),[re,P]=(0,c.useState)(!1),[ie,ae]=(0,c.useState)(!1),F=(0,c.useRef)(!1),I=S!==void 0,[L,R]=(0,c.useState)(new Set),z=I?S:L,B=h!==void 0,[oe,se]=(0,c.useState)(()=>new Set((n??[]).filter(e=>!e.defaultHidden).map(e=>e.key))),ce=B?new Set(h):oe,le=(0,c.useRef)(null),V=(0,c.useRef)(null),H=(0,c.useRef)(new Map),W=(0,c.useRef)([]);(0,c.useEffect)(()=>{let e=le.current;if(!e)return;let t=new ResizeObserver(()=>te(e.clientHeight));return t.observe(e),()=>t.unobserve(e)},[]),(0,c.useEffect)(()=>{if(!re)return;function e(e){V.current&&!V.current.contains(e.target)&&P(!1)}return document.addEventListener(`mousedown`,e),()=>document.removeEventListener(`mousedown`,e)},[re]);let ue=(0,c.useCallback)(e=>{let t=e.currentTarget;ee(t.scrollTop),v&&!F.current&&t.scrollTop+t.clientHeight>=t.scrollHeight-y&&(F.current=!0,ae(!0),v().finally(()=>{F.current=!1,ae(!1)}))},[v,y]),de=(0,c.useCallback)((e,t)=>{ne(n=>{if(n.get(e)===t)return n;let r=new Map(n);return r.set(e,t),r})},[]),{offsets:G,totalHeight:fe}=(0,c.useMemo)(()=>Jn(e.length,N,i,o),[e.length,N,i,o]);(0,c.useLayoutEffect)(()=>{let e=le.current,t=W.current;if(W.current=G,!e||e.scrollTop===0||t.length===0){H.current=N;return}let n=0;for(let[r,a]of N){let o=H.current.get(r)??i;a!==o&&t[r+1]!==void 0&&t[r+1]<=e.scrollTop&&(n+=a-o)}H.current=N,n!==0&&(e.scrollTop+=n)},[G,N,i]);let{startIndex:pe,endIndex:me}=(0,c.useMemo)(()=>Yn(G,j,M,a,e.length),[G,j,M,a,e.length]),he=!!n?.length,ge=he?n.filter(e=>ce.has(e.key)):[],K=he?`${x&&he?`40px `:``}${Xn(ge)}`:void 0,q=_!==!1&&he;function _e(e){let t=new Set(ce);if(t.has(e)){if(t.size<=1)return;t.delete(e)}else t.add(e);let n=[...t];B||se(t),g?.(n)}function J(e,t){return p?p(e,t):t}function ve(e){I||R(e),C?.(e)}function ye(e){let t=new Set(z);t.has(e)?t.delete(e):t.add(e),ve(t)}function be(){let t=e.map((e,t)=>J(e,t));ve(t.every(e=>z.has(e))?new Set:new Set(t))}let xe=e.length>0&&e.every((e,t)=>z.has(J(e,t))),Se=!xe&&e.some((e,t)=>z.has(J(e,t))),Ce=[];for(let n=pe;n<=me;n++){let r=e[n],i=J(r,n),a=s!=null&&i===s||z.has(i);Ce.push((0,f.jsx)(Zn,{index:n,top:G[n],columnTemplate:K,isSelected:a,showDivider:w,onClick:()=>m?.(r,n),onHeightChange:de,rowClassName:D?.row,rowStyle:O?.row,children:he?(0,f.jsxs)(f.Fragment,{children:[x&&(0,f.jsx)(`div`,{className:(0,l.default)(Q.virtualListSelectCell,D?.selectCell),style:O?.selectCell,role:`gridcell`,onClick:e=>e.stopPropagation(),children:(0,f.jsx)(U,{selected:z.has(i),onToggle:()=>ye(i),"aria-label":`Select row`})}),ge.map(e=>(0,f.jsx)(`div`,{className:(0,l.default)(Q.virtualListCell,D?.cell),style:O?.cell,role:`gridcell`,children:e.renderCell(r,n)},e.key))]}):t?.(r,n)},i))}return(0,f.jsxs)(`div`,{...k,ref:le,className:(0,l.default)(Q.virtualList,T,D?.root),style:{height:r,...E,...O?.root},onScroll:ue,role:he?`grid`:`list`,children:[he&&(0,f.jsxs)(`div`,{className:(0,l.default)(Q.virtualListHeader,D?.header),style:{gridTemplateColumns:K,...q?{paddingRight:32}:{},...O?.header},role:`row`,children:[x&&(0,f.jsx)(`div`,{className:(0,l.default)(Q.virtualListSelectCell,D?.selectCell),style:O?.selectCell,role:`columnheader`,children:(0,f.jsx)(U,{selected:xe||Se,onToggle:be,"aria-label":`Select all rows`})}),ge.map(e=>(0,f.jsx)(`div`,{className:(0,l.default)(Q.virtualListHeaderCell,D?.headerCell),style:O?.headerCell,role:`columnheader`,children:e.label},e.key)),q&&(0,f.jsxs)(`div`,{ref:V,className:Q.virtualListToggleWrapper,children:[(0,f.jsx)(`button`,{type:`button`,className:(0,l.default)(Q.virtualListHeaderToggle,D?.headerToggle),style:O?.headerToggle,onClick:()=>P(e=>!e),"aria-label":`Toggle column visibility`,children:(0,f.jsx)(u.FontAwesomeIcon,{icon:d.faGear,style:O?.headerToggle})}),re&&(0,f.jsx)(`div`,{className:(0,l.default)(Q.virtualListTogglePopover,D?.togglePopover),style:O?.togglePopover,children:n.map(e=>(0,f.jsx)(U,{className:(0,l.default)(Q.virtualListToggleItem,D?.toggleItem),style:O?.toggleItem,selected:ce.has(e.key),onToggle:()=>_e(e.key),cursorDefault:!1,children:e.label},e.key))})]})]}),b?(0,f.jsx)(`div`,{className:Q.virtualListLoadingFull,children:(0,f.jsx)(A,{className:Q.virtualListSpinner})}):(0,f.jsx)(`div`,{className:(0,l.default)(Q.virtualListBody,D?.body),style:{height:fe,...O?.body},children:Ce}),ie&&(0,f.jsx)(`div`,{className:(0,l.default)(Q.virtualListLoadingIndicator,D?.loadingIndicator),style:O?.loadingIndicator,children:(0,f.jsx)(A,{className:Q.virtualListSpinner})})]})}var $n={wizard:`wizard_uRBAN`,"wizard-content":`wizard-content_lcl4C`,wizardContent:`wizard-content_lcl4C`,"wizard-content-outOfFrame":`wizard-content-outOfFrame_Eks4Y`,wizardContentOutOfFrame:`wizard-content-outOfFrame_Eks4Y`,"wizard-content-container":`wizard-content-container_yxbCJ`,wizardContentContainer:`wizard-content-container_yxbCJ`};function er({currentStep:e=0,stepCount:t=0,renderStep:n=()=>null,className:r,style:i,classNames:a,styles:o,...s}){let[u,d]=(0,c.useState)(void 0),[p,m]=(0,c.useState)(!1),[h,g]=(0,c.useState)(e),_=(0,c.useRef)([]),v=(0,c.useRef)(null);e!==h&&(g(e),m(!0)),(0,c.useEffect)(()=>{if(!p)return;let e=setTimeout(()=>m(!1),400);return()=>clearTimeout(e)},[p]),(0,c.useEffect)(()=>{v.current?.disconnect();let t=_.current[e];if(t)return d(t.clientHeight),v.current=new ResizeObserver(()=>{d(t.clientHeight)}),v.current.observe(t),()=>v.current?.disconnect()},[e,t]);let y={...u===void 0?{}:{height:`${u}px`},...o?.root,...i};return(0,f.jsx)(`div`,{...s,className:(0,l.default)($n.wizard,a?.root,r),style:y,children:(0,f.jsx)(`div`,{className:(0,l.default)($n.wizardContentContainer,a?.container),style:{width:`${t*100}%`,marginLeft:`-${e*100}%`,...o?.container},children:Array.from({length:t},(r,i)=>(0,f.jsx)(`div`,{ref:e=>{_.current[i]=e},className:(0,l.default)($n.wizardContent,a?.step),style:{width:`${100/t}%`,marginLeft:`${100/t*i}%`,...o?.step},children:(0,f.jsx)(`div`,{className:(0,l.default)({[$n.wizardContentOutOfFrame]:e!==i&&!p},a?.stepContent),style:o?.stepContent,inert:e===i?void 0:!0,children:n(i)})},`wizardStep${i}`))})})}function tr(e){let t=e;return t?.errors&&Array.isArray(t.errors)?t.errors.flatMap(e=>Object.entries(e).map(([e,t])=>({id:e,message:t}))):[]}var nr=class{#e;#t;#n;#r;#i;constructor(e,t=null,{initialValues:n,onSubmit:r=()=>void 0,onValidate:i=()=>void 0,errorParser:a=tr,onSubmitError:o=()=>void 0}={}){this.#t=!1,this.#i=[],this.getFormError=()=>{let e=Object.keys(this.group);for(let t=0;t<e.length;t+=1){let n=e[t];if(this.group[n].errors.length>0)return this.group[n].errors[0]}return null},this.set=(e,t)=>(this.group[e].set(t),this),this.reset=(e={})=>{this.submitCount=0;let t=Object.keys(e);Object.keys(this.group).forEach(n=>{this.group[n].set(t.includes(n)?e[n]:this.#r[n],!1)}),this.resetDirtyAndTouched(),this.onReset&&this.onReset(this,this.#r,this.#e)},this.resetDirtyAndTouched=()=>{Object.keys(this.group).forEach(e=>{this.group[e].dirty=!1,this.group[e].touched=!1})},this.parseError=(e,t=!1)=>{let n=this.errorParser(e);n.length>0?(n.forEach(({id:e,message:t})=>{this.group[e]&&this.group[e].addError({id:e,message:t})}),t&&this.onSubmitError(n)):this.onSubmitError([{id:`generic`,message:`An error occurred`}])},this.#a=()=>{this.component&&this.component.forceUpdate(),this.#i.forEach(e=>e())},this.registerOnUpdateListener=e=>{this.#i.push(e)},this.removeOnUpdateListener=e=>{this.#i.splice(this.#i.indexOf(e),1)},this.setSubmitting=e=>{this.#t!==e&&(this.#t=e,this.#a())},this.submit=async e=>{e&&(e.preventDefault&&e.preventDefault(),e.stopPropagation&&e.stopPropagation()),this.setSubmitting(!0);let t=null;this.submitCount===0?t=await Promise.resolve(this.validate()):this.onValidateCallback&&(t=await Promise.resolve(this.onValidateCallback(this)));let n=this.getFormError()||t;if(n){this.setSubmitting(!1),this.submitCount>-1&&this.onSubmitError([n]),this.submitCount+=1,this.#a();return}try{await this.onSubmitCallback(this.getValues(),this),this.resetDirtyAndTouched()}catch(e){this.parseError(e,!0)}this.setSubmitting(!1),this.#a(),this.submitCount+=1},this.getValues=()=>{let e={};return Object.keys(this.group).forEach(t=>{e[t]=this.group[t].value}),{...this.#e,...e}},this.validate=()=>{if(Object.keys(this.group).forEach(e=>{this.group[e].validate(),this.group[e].touched=!0}),this.onValidateCallback)return this.onValidateCallback(this)},this.setValidator=(e,t)=>(this.group[e]=t,this),this.group=e,this.#e=n??{},this.#r={},this.submitCount=0,this.onDebounce=()=>{},this.onReset=()=>{},Object.keys(this.group).forEach(e=>{let t=this.group[e],n=this.#e;n[e]!==void 0&&t.set(n[e]),this.#r[e]=t.value,this.group[e].registerOnUpdateListener(()=>{this.#a(),this.submitCount=0,this.#n&&clearTimeout(this.#n),this.#n=setTimeout(()=>this.onDebounce(this.getValues()),500)})}),this.component=t,this.onSubmitCallback=r,this.onValidateCallback=i,this.errorParser=a,this.onSubmitError=o,this.setSubmitting(!1)}get isSubmitting(){return this.#t}get wasTouched(){return Object.keys(this.group).some(e=>this.group[e].touched)}get isDirty(){return Object.keys(this.group).some(e=>this.group[e].dirty)}get hasErrors(){return Object.keys(this.group).some(e=>this.group[e].errors.length>0)}get initialValues(){return{...this.#e}}#a};function rr(e){return function({children:t,...n}){return(0,f.jsx)(`form`,{onSubmit:e.submit,noValidate:!0,...n,children:t})}}var ir=e=>{Un(e[0].message,{type:`error`})},ar=class extends nr{constructor(e,t=null,n){super(e,t,{...n,onSubmitError:n?.onSubmitError??ir}),this.Form=rr(this)}},or=class{#e;#t;#n;#r;#i;constructor(e,t){this.addError=e=>{this.#r.push(e),this.onUpdate()},this.removeErrors=e=>{this.#r=this.#r.filter(t=>!e.includes(t.id)),this.onUpdate()},this.clearErrors=()=>{this.#r=[],this.onUpdate()},this.hasError=e=>!e&&this.errors.length>0?!0:!!this.errors.find(t=>t.id===e),this.getCurrentErrorMessage=()=>this.errors.length===0?null:this.errors[0].message,this.validate=()=>{this.clearErrors(),this.validators.forEach(e=>{let t=e(this.value,this.label);t&&this.addError(t)})},this.onUpdate=()=>{this.onUpdateCallbacks.forEach(e=>e(this))},this.registerOnUpdateListener=e=>{this.onUpdateCallbacks.push(e)},this.removeOnUpdateListener=e=>{this.onUpdateCallbacks.splice(this.onUpdateCallbacks.indexOf(e),1)},this.set=(e,t=!0)=>(this.value=e,t&&!this.dirty&&(this.dirty=!0),this.validate(),this),this.#e=e,this.validators=t??[],this.#t=!1,this.#n=!1,this.#r=[],this.#i=``,this.onUpdateCallbacks=[],this.validate()}get touched(){return this.#t}set touched(e){this.#t=e,this.onUpdate()}get label(){return this.#i}set label(e){this.#i=e}get dirty(){return this.#n}set dirty(e){this.#n=e,this.onUpdate()}get value(){return this.#e}set value(e){this.#e=e,this.onUpdate()}get errors(){return this.#r}};or.prototype.toString=function(){return`${this.value}`};function sr(e){return/^[0-9]+$/.test(e)}function cr(e){return/^[0-9]{2}.[0-9]{2}.[0-9]{4}$/.test(e)}function lr(e){return/^[0-9]{4}-[0-9]{2}-[0-9]{2}T[0-9]{2}:[0-9]{2}:[0-9]{2}.[0-9]{3}Z$/.test(e)}function ur(e){return/^(([^<>()[\]\\.,;:\s@"]+(\.[^<>()[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-ZöäüÜÖÄß\-0-9]+\.)+[a-zA-Z]{2,}))$/.test(e)}function dr(e){return/^[A-Z]{6}[A-Z\d]{2}([A-Z\d]{3})?$/.test(e)}function fr(e){return/[-a-zA-Z0-9@:%._+~#=]{2,256}\.[a-z]{2,63}(\/[-a-zA-Z0-9@:%_+.~#?&//=]*)?$/.test(e)}function pr(e){return/^[\w!@#$%^&*?±§~`'"/\\[\]{}\-,.();:><+=|öäüÖÄÜß €μ]{8,}$/.test(e)}function mr(e){return/^(?=.*[a-zöäüA-ZÖÄÜß])/.test(e)}function hr(e){return/^(?=.*\d)/.test(e)}function gr(e){return pr(e)&&mr(e)&&hr(e)}var $={t:(e,t)=>({"formValidators.minLength":`Must be at least ${t?.min} characters long`,"formValidators.maxLength":`Must be at most ${t?.max} characters long`,"formValidators.email":`Must be a valid email address`,"formValidators.required":`${t?.label||`Value`} is required`,"formValidators.value":`Value`,"formValidators.mustBeNumber":`Must be a number`,"formValidators.oneOf":`Must be one of the following values: ${t?.allowedValues}`,"formValidators.typeOf":`Must have type of ${t?.allowedTypes}`,"formValidators.multiEmail":`Must be a comma or semicolon separated list of valid email addresses`,"formValidators.date":`Must be a valid date`,"garages.errors.website":`Must be a valid URL`,"garages.errors.bic":`Must be a valid BIC`,"formValidators.minLetters":`Must contain at least ${t?.smart_count} letters`,"formValidators.minDigits":`Must contain at least ${t?.smart_count} digits`})[e]||e},_r=class e{static{this.minLength=(e,t)=>n=>!n||n.length<e?{id:`minLength`,message:t||$.t(`formValidators.minLength`,{min:e})}:null}static{this.maxLength=(e,t)=>n=>n&&n.length>e?{id:`maxLength`,message:t||$.t(`formValidators.maxLength`,{max:e})}:null}static{this.email=e=>t=>t&&!ur(t)?{id:`email`,message:e||$.t(`formValidators.email`)}:null}static{this.required=e=>{function t(t,n){return!t&&t!==0?{id:`required`,message:e||$.t(`formValidators.required`,{label:n||$.t(`formValidators.value`)})}:null}return t.validatorId=`required`,t}}static{this.mustBeNumber=e=>t=>t&&Number.isNaN(+t)?{id:`mustBeNumber`,message:e||$.t(`formValidators.mustBeNumber`)}:null}static{this.oneOf=(e,t)=>n=>n&&!e.includes(n)?{id:`oneOf`,message:t||$.t(`formValidators.oneOf`,{allowedValues:e})}:null}static{this.typeOf=(e,t)=>n=>{if(Array.isArray(e)){for(let t=0;t<e.length;t+=1)if(typeof n===e[t])return null}else if(typeof n===e)return null;return{id:`typeOf`,message:t||`Must have type of ${e}`}}}static{this.multiEmail=e=>t=>{if(t){let n=t.replace(/ /g,``).replace(/,/g,`;`).split(`;`);for(let t=0;t<n.length;t+=1)if(!ur(n[t]))return{id:`multiEmail`,message:e||$.t(`formValidators.multiEmail`)}}return null}}static{this.date=e=>t=>t&&!cr(t)&&!lr(t)?{id:`date`,message:e||$.t(`formValidators.date`)}:null}static{this.dateObject=e=>t=>t&&!t.isValid?{id:`date`,message:e||$.t(`formValidators.date`)}:null}static{this.website=e=>t=>t&&!fr(t)?{id:`website`,message:e||$.t(`garages.errors.website`)}:null}static{this.bic=e=>t=>t&&!dr(t)?{id:`bic`,message:e||$.t(`garages.errors.bic`)}:null}static{this.minLetters=(e,t)=>n=>n&&n.replace(/[^a-zöäüA-ZÖÄÜß]/g,``).length<e?{id:`minLetters`,message:t||$.t(`formValidators.minLetters`,{smart_count:e})}:null}static{this.minDigits=(e,t)=>n=>n&&n.replace(/[\D]/g,``).length<e?{id:`minDigits`,message:t||$.t(`formValidators.minDigits`,{smart_count:e})}:null}static{this.password=t=>n=>{let r=e.minLength(8)(n)||e.minLetters(1)(n)||e.minDigits(1)(n);return r?t?{id:`password`,message:t}:r:null}}},vr=class extends c.PureComponent{static{this.defaultProps={formValidator:null,onMouseEnter:null,onMouseLeave:null,onFocus:null,onBlur:null,onChange:null,errorMessage:``,isValid:!1,isRequired:!1,label:``}}constructor(e){super(e);let{formValidator:t}=e;t&&(t.label=e.label??``,t.validate(),t.registerOnUpdateListener(()=>{this.forceUpdate()})),this.state={isFocused:!1,isHovered:!1},this.onMouseEnter=this.onMouseEnter.bind(this),this.onMouseLeave=this.onMouseLeave.bind(this),this.onFocus=this.onFocus.bind(this),this.onBlur=this.onBlur.bind(this),this.hasError=this.hasError.bind(this),this.renderTooltip=this.renderTooltip.bind(this),this.onChange=this.onChange.bind(this)}componentDidMount(){setTimeout(()=>this.setState({isFocused:!1,isHovered:!1}),1)}componentDidUpdate(e){let{formValidator:t}=this.props;e.formValidator&&t&&e.formValidator!==t&&t.registerOnUpdateListener(()=>{this.forceUpdate()})}onMouseEnter(e){let{onMouseEnter:t}=this.props;this.setState({isHovered:!0}),t&&t(e)}onMouseLeave(e){let{onMouseLeave:t}=this.props;this.setState({isHovered:!1}),t&&t(e)}onFocus(e){let{onFocus:t}=this.props;this.setState({isFocused:!0}),t&&t(e)}onBlur(e){let{formValidator:t,onBlur:n}=this.props;t&&(t.touched=!0),this.setState({isFocused:!1}),n&&n(e)}hasError(){let{errorMessage:e,isValid:t,formValidator:n}=this.props;return n?n.touched&&n.hasError():!t||!!e}isRequired(){let{isRequired:e,formValidator:t}=this.props;return!!(e||t&&t.validators.find(e=>e.validatorId===`required`))}renderTooltip(){let{errorMessage:e,formValidator:t}=this.props,{isHovered:n,isFocused:r}=this.state;return(0,f.jsx)(ge,{variant:`error`,message:t?t.getCurrentErrorMessage():e||``,isVisible:this.hasError()&&(r||n)})}onChange(e){let{onChange:t,formValidator:n}=this.props;if(n){let t=e;e&&e.target&&(t=e.target.value),n.set(t)}t&&t(e)}};function yr(e){let[,t]=(0,c.useReducer)(e=>e+1,0);return(0,c.useEffect)(()=>{if(e)return e.registerOnUpdateListener(t),()=>e.removeOnUpdateListener(t)},[e]),e}function br(e,{initialValues:t,onSubmit:n,onValidate:r,errorParser:i,onSubmitError:a}={}){let[,o]=(0,c.useReducer)(e=>e+1,0),s=(0,c.useRef)(null);s.current||=new ar(e,null,{initialValues:t,errorParser:i,onSubmitError:a});let l=s.current,u=(0,c.useRef)(n),d=(0,c.useRef)(r);return u.current=n,d.current=r,(0,c.useEffect)(()=>(n!==void 0&&(l.onSubmitCallback=(...e)=>u.current?.(...e)),r!==void 0&&(l.onValidateCallback=(...e)=>d.current?.(...e)),l.registerOnUpdateListener(o),()=>l.removeOnUpdateListener(o)),[]),l}exports.Accordion=T,exports.AccordionStyleType=b,exports.ActionButtons=ie,exports.ActionIcon=R,exports.Align=fe,exports.BodyEnd=z,exports.Button=P,exports.ButtonSize=ee,exports.ButtonStyleType=j,exports.ButtonType=M,exports.Card=oe,exports.CardActions=V,exports.CardContent=le,exports.CardHeader=se,exports.CardMedia=ce,exports.Checkbox=U,exports.Chip=ue,exports.ChipContainer=de,exports.ColorPicker=De,exports.ConfirmModal=Ae,exports.DatePicker=it,exports.Dropdown=nt,exports.EmptyState=ot,exports.Fab=ut,exports.FloatingMenu=me,exports.FormValidator=or,exports.FormValidatorGroup=ar,exports.IconLoading=Dt,exports.IconPicker=mt,exports.IdleManager=gt,exports.InfiniteBlock=tt,exports.Input=_e,exports.InputDropdown=bt,exports.InputType=q,exports.InteractableDiv=I,exports.KanbanBoard=wt,exports.KanbanColumn=Ct,exports.Modal=ke,exports.NumberInput=At,exports.OptionPicker=Mt,exports.Overscroll=It,exports.ProgressBar=zt,exports.Ripple=N,exports.RoomDrawer=pn,exports.RoomViewer=hn,exports.ScrollbarProvider=vn,exports.SearchInput=bn,exports.SpinnerLoading=A,exports.Stepper=Cn,exports.TenorPicker=jn,exports.Textarea=Mn,exports.ThemeProvider=Fn,exports.ToastProvider=qn,exports.Tooltip=ge,exports.ValidatableComponent=vr,exports.Validators=_r,exports.VirtualList=Qn,exports.Wizard=er,exports.defaultTheme=Nn,exports.getLocale=Re,exports.hasEightPasswordChars=pr,exports.hasOnePasswordDigit=hr,exports.hasOnePasswordLetter=mr,exports.isBic=dr,exports.isDate=cr,exports.isEmail=ur,exports.isISODate=lr,exports.isNumber=sr,exports.isPassword=gr,exports.isURL=fr,exports.mapLocale=Fe,exports.setLocale=Le,exports.showToast=Un,exports.useFormValidator=yr,exports.useFormValidatorGroup=br,exports.useTheme=In;
6
6
  //# sourceMappingURL=index.cjs.map
package/dist/index.mjs CHANGED
@@ -5047,6 +5047,6 @@ function si(e, { initialValues: t, onSubmit: n, onValidate: r, errorParser: i, o
5047
5047
  return f.current = n, p.current = r, a(() => (n !== void 0 && (d.onSubmitCallback = (...e) => f.current?.(...e)), r !== void 0 && (d.onValidateCallback = (...e) => p.current?.(...e)), d.registerOnUpdateListener(s), () => d.removeOnUpdateListener(s)), []), d;
5048
5048
  }
5049
5049
  //#endregion
5050
- export { U as Accordion, ve as AccordionStyleType, Ne as ActionButtons, Re as ActionIcon, Qe as Align, ze as BodyEnd, K as Button, De as ButtonSize, G as ButtonStyleType, Oe as ButtonType, Ve as Card, Ge as CardActions, We as CardContent, He as CardHeader, Ue as CardMedia, qe as Checkbox, Ye as Chip, Xe as ChipContainer, mt as ColorPicker, _t as ConfirmModal, Gt as DatePicker, Ut as Dropdown, qt as EmptyState, Zt as Fab, et as FloatingMenu, qr as FormValidator, Kr as FormValidatorGroup, hn as IconLoading, tn as IconPicker, rn as IdleManager, Ht as InfiniteBlock, rt as Input, cn as InputDropdown, J as InputType, Ie as InteractableDiv, fn as KanbanBoard, dn as KanbanColumn, gt as Modal, vn as NumberInput, bn as OptionPicker, wn as Overscroll, Dn as ProgressBar, Ae as Ripple, er as RoomDrawer, nr as RoomViewer, ar as ScrollbarProvider, sr as SearchInput, Ee as SpinnerLoading, ur as Stepper, vr as TenorPicker, yr as Textarea, Sr as ThemeProvider, Pr as Toast, nt as Tooltip, ai as ValidatableComponent, ii as Validators, zr as VirtualList, Vr as Wizard, br as defaultTheme, Tt as getLocale, ei as hasEightPasswordChars, ni as hasOnePasswordDigit, ti as hasOnePasswordLetter, Qr as isBic, Yr as isDate, Zr as isEmail, Xr as isISODate, Jr as isNumber, ri as isPassword, $r as isURL, St as mapLocale, wt as setLocale, Ar as showToast, oi as useFormValidator, si as useFormValidatorGroup, Cr as useTheme };
5050
+ export { U as Accordion, ve as AccordionStyleType, Ne as ActionButtons, Re as ActionIcon, Qe as Align, ze as BodyEnd, K as Button, De as ButtonSize, G as ButtonStyleType, Oe as ButtonType, Ve as Card, Ge as CardActions, We as CardContent, He as CardHeader, Ue as CardMedia, qe as Checkbox, Ye as Chip, Xe as ChipContainer, mt as ColorPicker, _t as ConfirmModal, Gt as DatePicker, Ut as Dropdown, qt as EmptyState, Zt as Fab, et as FloatingMenu, qr as FormValidator, Kr as FormValidatorGroup, hn as IconLoading, tn as IconPicker, rn as IdleManager, Ht as InfiniteBlock, rt as Input, cn as InputDropdown, J as InputType, Ie as InteractableDiv, fn as KanbanBoard, dn as KanbanColumn, gt as Modal, vn as NumberInput, bn as OptionPicker, wn as Overscroll, Dn as ProgressBar, Ae as Ripple, er as RoomDrawer, nr as RoomViewer, ar as ScrollbarProvider, sr as SearchInput, Ee as SpinnerLoading, ur as Stepper, vr as TenorPicker, yr as Textarea, Sr as ThemeProvider, Pr as ToastProvider, nt as Tooltip, ai as ValidatableComponent, ii as Validators, zr as VirtualList, Vr as Wizard, br as defaultTheme, Tt as getLocale, ei as hasEightPasswordChars, ni as hasOnePasswordDigit, ti as hasOnePasswordLetter, Qr as isBic, Yr as isDate, Zr as isEmail, Xr as isISODate, Jr as isNumber, ri as isPassword, $r as isURL, St as mapLocale, wt as setLocale, Ar as showToast, oi as useFormValidator, si as useFormValidatorGroup, Cr as useTheme };
5051
5051
 
5052
5052
  //# sourceMappingURL=index.mjs.map
@@ -71,7 +71,7 @@ export * from './common/textarea';
71
71
  export { default as ThemeProvider } from './common/themeProvider';
72
72
  export * from './common/themeProvider';
73
73
  export { useTheme } from './common/themeProvider/useTheme';
74
- export { default as Toast } from './common/toast';
74
+ export { default as ToastProvider } from './common/toast';
75
75
  export * from './common/toast';
76
76
  export { default as Tooltip } from './common/tooltip';
77
77
  export * from './common/tooltip';
package/docs/CLAUDE.md CHANGED
@@ -111,14 +111,16 @@ Slot keys per component are documented in each component's doc file below.
111
111
  @Chip.md
112
112
  @ColorPicker.md
113
113
  @ConfirmModal.md
114
+ @DatePicker.md
114
115
  @Dropdown.md
115
116
  @EmptyState.md
116
117
  @Fab.md
117
118
  @FloatingMenu.md
118
- @Icon.md
119
+ @IconPicker.md
119
120
  @IdleManager.md
120
121
  @InfiniteBlock.md
121
122
  @Input.md
123
+ @InputDropdown.md
122
124
  @InteractableDiv.md
123
125
  @KanbanBoard.md
124
126
  @Loading.md
@@ -129,10 +131,14 @@ Slot keys per component are documented in each component's doc file below.
129
131
  @ProgressBar.md
130
132
  @Ripple.md
131
133
  @RoomDrawer.md
134
+ @RoomViewer.md
132
135
  @ScrollbarProvider.md
133
136
  @SearchInput.md
134
137
  @Stepper.md
135
138
  @TenorPicker.md
136
139
  @Textarea.md
140
+ @ThemeProvider.md
141
+ @Toast.md
137
142
  @Tooltip.md
143
+ @VirtualList.md
138
144
  @Wizard.md
@@ -0,0 +1,77 @@
1
+ # DatePicker
2
+
3
+ **When to use:** Date selection input — booking forms, birth date fields, date range pickers, deadline selectors. Renders as a text input with a floating label by default; can also be inline or modal.
4
+
5
+ **Import:** `import { DatePicker } from '@ahrowe/ui'`
6
+
7
+ ```tsx
8
+ import { DatePicker, FormValidator } from '@ahrowe/ui';
9
+
10
+ // Controlled input with floating label
11
+ <DatePicker
12
+ label="Date of birth"
13
+ selected={date}
14
+ onSelect={(date) => setDate(date)}
15
+ />
16
+
17
+ // With FormValidator
18
+ const dateValidator = new FormValidator<Date | null>(null);
19
+ <DatePicker label="Start date" formValidator={dateValidator} />
20
+
21
+ // Inline calendar (no input field)
22
+ <DatePicker
23
+ selected={date}
24
+ onSelect={setDate}
25
+ isInline
26
+ noInput
27
+ />
28
+
29
+ // Inside a modal (calendar opens in a Modal overlay)
30
+ <DatePicker
31
+ label="Schedule date"
32
+ selected={date}
33
+ onSelect={setDate}
34
+ isModal
35
+ />
36
+
37
+ // With min/max constraints and a clear button
38
+ <DatePicker
39
+ label="Appointment"
40
+ selected={date}
41
+ onSelect={setDate}
42
+ minDate={new Date()}
43
+ maxDate={endOfYear}
44
+ showClearButton
45
+ />
46
+
47
+ // Date range (highlight start–end)
48
+ <DatePicker
49
+ label="From"
50
+ selected={startDate}
51
+ onSelect={setStartDate}
52
+ startDate={startDate}
53
+ endDate={endDate}
54
+ />
55
+ ```
56
+
57
+ **Key props:**
58
+
59
+ | Prop | Type | Description |
60
+ |------|------|-------------|
61
+ | `label` | `string` | Floating label on the input |
62
+ | `selected` | `Date` | Currently selected date |
63
+ | `onSelect` | `(date: Date \| null) => void` | Called when a date is picked |
64
+ | `onChange` | `(date: Date \| null) => void` | Alternative change callback |
65
+ | `formValidator` | `FormValidator` | Connects to validation |
66
+ | `isRequired` | `boolean` | |
67
+ | `isValid` | `boolean` | Manual valid state |
68
+ | `errorMessage` | `string` | Manual error message |
69
+ | `noInput` | `boolean` | Hide the text input (show calendar only) |
70
+ | `noHeader` | `boolean` | Hide the month/year navigation header |
71
+ | `isModal` | `boolean` | Open calendar in a Modal overlay |
72
+ | `isInline` | `boolean` | Render calendar always-visible inline |
73
+ | `minDate` | `Date \| null` | Earliest selectable date |
74
+ | `maxDate` | `Date \| null` | Latest selectable date |
75
+ | `showClearButton` | `boolean` | Show a clear/reset button |
76
+ | `startDate` | `Date` | Range highlight start |
77
+ | `endDate` | `Date` | Range highlight end |
@@ -0,0 +1,55 @@
1
+ # IconPicker
2
+
3
+ **When to use:** Pick one item from a visual icon/image grid — category selectors, emoji-style pickers, avatar selectors, anything where each option is best represented by an icon or image rather than text alone.
4
+
5
+ **Import:** `import { IconPicker } from '@ahrowe/ui'`
6
+ **Types:** `import type { IconPickerItem, IconPickerProps } from '@ahrowe/ui'`
7
+
8
+ ```tsx
9
+ import { IconPicker, FormValidator } from '@ahrowe/ui';
10
+ import type { IconPickerItem } from '@ahrowe/ui';
11
+ import { faHouse, faCar, faTree } from '@fortawesome/free-solid-svg-icons';
12
+
13
+ const items: IconPickerItem[] = [
14
+ { id: 'house', label: 'House', icon: faHouse },
15
+ { id: 'car', label: 'Car', icon: faCar },
16
+ { id: 'tree', label: 'Tree', icon: faTree },
17
+ { id: 'custom', label: 'Custom', customIcon: <img src="/logo.png" alt="" /> },
18
+ ];
19
+
20
+ // Controlled
21
+ <IconPicker
22
+ label="Category"
23
+ data={items}
24
+ selectedId={selectedId}
25
+ onChange={(id) => setSelectedId(id)}
26
+ />
27
+
28
+ // With FormValidator
29
+ const categoryValidator = new FormValidator<string | null>(null);
30
+ <IconPicker label="Category" data={items} formValidator={categoryValidator} isRequired />
31
+ ```
32
+
33
+ **IconPickerItem:**
34
+
35
+ ```ts
36
+ interface IconPickerItem {
37
+ id: string;
38
+ label: string;
39
+ icon?: IconDefinition; // FontAwesome icon
40
+ customIcon?: React.ReactNode; // custom element (overrides icon)
41
+ }
42
+ ```
43
+
44
+ **Key props:**
45
+
46
+ | Prop | Type | Description |
47
+ |------|------|-------------|
48
+ | `data` | `IconPickerItem[]` | Items to display in the grid |
49
+ | `selectedId` | `string \| null` | Currently selected item id |
50
+ | `label` | `string` | Floating label |
51
+ | `onChange` | `(id: string) => void` | Called when selection changes |
52
+ | `formValidator` | `FormValidator` | Connects to validation |
53
+ | `isRequired` | `boolean` | |
54
+
55
+ **Slots:** `root` `label` `itemContainer` `item`
@@ -0,0 +1,52 @@
1
+ # InputDropdown
2
+
3
+ **When to use:** Combobox-style input — the user can type to filter and also pick from a dropdown list. Use over `Dropdown` when free-text entry or search-to-filter behaviour is needed.
4
+
5
+ **Import:** `import { InputDropdown } from '@ahrowe/ui'`
6
+ **Types:** `import type { InputDropdownItem, InputDropdownProps } from '@ahrowe/ui'`
7
+
8
+ ```tsx
9
+ import { InputDropdown } from '@ahrowe/ui';
10
+ import type { InputDropdownItem } from '@ahrowe/ui';
11
+
12
+ const items: InputDropdownItem[] = [
13
+ { value: 'react', label: 'React' },
14
+ { value: 'vue', label: 'Vue' },
15
+ { value: 'svelte', label: 'Svelte' },
16
+ ];
17
+
18
+ // Controlled
19
+ <InputDropdown
20
+ label="Framework"
21
+ value={selected}
22
+ items={items}
23
+ onSelect={(value) => setSelected(value)}
24
+ />
25
+
26
+ // With FormValidator
27
+ const frameworkValidator = new FormValidator('');
28
+ <InputDropdown label="Framework" items={items} formValidator={frameworkValidator} />
29
+ ```
30
+
31
+ **InputDropdownItem:**
32
+
33
+ ```ts
34
+ interface InputDropdownItem {
35
+ value: string;
36
+ label?: string; // displayed text — falls back to value if omitted
37
+ }
38
+ ```
39
+
40
+ **Key props:**
41
+
42
+ | Prop | Type | Description |
43
+ |------|------|-------------|
44
+ | `label` | `string` | Floating label |
45
+ | `value` | `string` | Controlled value |
46
+ | `items` | `InputDropdownItem[]` | Dropdown options |
47
+ | `onSelect` | `(value: string) => void` | Called when an item is picked from the list |
48
+ | `onChange` | `(value: unknown) => void` | Called on every text change |
49
+ | `placeholder` | `string` | |
50
+ | `formValidator` | `FormValidator` | Connects to validation |
51
+
52
+ **Slots:** `root` `dropdown` `item`
@@ -0,0 +1,39 @@
1
+ # RoomViewer
2
+
3
+ **When to use:** Display read-only SVG floor plans with a floor selector — venue maps, seating layouts, building directories. Pair with `RoomDrawer` when you also need editing capability.
4
+
5
+ **Import:** `import { RoomViewer } from '@ahrowe/ui'`
6
+ **Types:** `import type { RoomViewerFloor, RoomViewerProps } from '@ahrowe/ui'`
7
+
8
+ ```tsx
9
+ import { RoomViewer } from '@ahrowe/ui';
10
+ import type { RoomViewerFloor } from '@ahrowe/ui';
11
+
12
+ const floors: RoomViewerFloor[] = [
13
+ {
14
+ label: 'Ground Floor',
15
+ data: <GroundFloorSvg />,
16
+ },
17
+ {
18
+ label: 'First Floor',
19
+ data: <FirstFloorSvg />,
20
+ },
21
+ ];
22
+
23
+ <RoomViewer data={floors} />
24
+ ```
25
+
26
+ **RoomViewerFloor:**
27
+
28
+ ```ts
29
+ interface RoomViewerFloor {
30
+ label: string; // Tab/selector label shown above the plan
31
+ data: React.ReactNode; // SVG floor plan element
32
+ }
33
+ ```
34
+
35
+ **Key props:**
36
+
37
+ | Prop | Type | Description |
38
+ |------|------|-------------|
39
+ | `data` | `RoomViewerFloor[]` | Floor definitions to display |
@@ -0,0 +1,82 @@
1
+ # ThemeProvider
2
+
3
+ **When to use:** Required wrapper for the entire component library. Injects all CSS custom properties as inline styles so every component inside can use theme variables. Place it at or near the root of your app.
4
+
5
+ **Import:** `import { ThemeProvider } from '@ahrowe/ui'`
6
+ **Types:** `import type { Theme, ThemeVariables } from '@ahrowe/ui'`
7
+
8
+ ```tsx
9
+ import { ThemeProvider } from '@ahrowe/ui';
10
+ import '@ahrowe/ui/style.css'; // add once in your entry point
11
+
12
+ // Minimal — uses the built-in default theme
13
+ <ThemeProvider>
14
+ <App />
15
+ </ThemeProvider>
16
+
17
+ // With a custom theme
18
+ import type { Theme } from '@ahrowe/ui';
19
+
20
+ const brandTheme: Theme = {
21
+ id: 'brand',
22
+ variables: {
23
+ '--primary-color': '#6200ea',
24
+ '--primary-lighter': '#b388ff',
25
+ '--primary-accent': '#7c4dff',
26
+ '--background': '#ffffff',
27
+ '--text-color': '#212121',
28
+ },
29
+ };
30
+
31
+ <ThemeProvider themes={[brandTheme]} currentThemeId="brand">
32
+ <App />
33
+ </ThemeProvider>
34
+
35
+ // Extending the built-in theme (only override specific variables)
36
+ const darkTheme: Theme = {
37
+ id: 'dark',
38
+ baseThemeId: 'default', // inherit everything not listed here
39
+ variables: {
40
+ '--background': '#121212',
41
+ '--background-accent': '#1e1e1e',
42
+ '--text-color': '#ffffff',
43
+ },
44
+ };
45
+
46
+ <ThemeProvider themes={[darkTheme]} currentThemeId="dark">
47
+ <App />
48
+ </ThemeProvider>
49
+ ```
50
+
51
+ **Theme type:**
52
+
53
+ ```ts
54
+ interface Theme {
55
+ id: string;
56
+ baseThemeId?: string; // inherit from another theme before applying variables
57
+ variables: ThemeVariables;
58
+ }
59
+ ```
60
+
61
+ **Key CSS variables** (see `package/common/themeProvider/theme.types.ts` for the full list):
62
+
63
+ | Variable | Purpose |
64
+ |----------|---------|
65
+ | `--primary-color` / `--primary-lighter` / `--primary-accent` | Brand colours |
66
+ | `--background` | Page/surface background |
67
+ | `--background-accent` / `--background-accent-light` | Raised surfaces, cards |
68
+ | `--text-color` / `--text-dark` | Primary and secondary text |
69
+ | `--border-color` | Borders and dividers |
70
+ | `--error-color` / `--success-color` / `--warn-color` / `--info-color` | Semantic colours |
71
+ | `--default-border-radius` | Border radii |
72
+ | `--card-shadow` | Elevation shadows |
73
+
74
+ **Key props:**
75
+
76
+ | Prop | Type | Description |
77
+ |------|------|-------------|
78
+ | `children` | `ReactNode` | Your app content (required) |
79
+ | `themes` | `Theme[]` | Theme definitions — defaults to built-in default theme |
80
+ | `currentThemeId` | `string` | Active theme id — must match one of the `themes[].id` values |
81
+
82
+ **Note:** Without `ThemeProvider`, all CSS variables are undefined and components will be unstyled.
package/docs/Toast.md ADDED
@@ -0,0 +1,67 @@
1
+ # Toast
2
+
3
+ **When to use:** Non-blocking notifications — save confirmations, error alerts, info messages, warnings. Toasts appear in a corner of the screen and auto-dismiss after a configurable duration.
4
+
5
+ **Import:** `import { ToastProvider, showToast } from '@ahrowe/ui'`
6
+ **Types:** `import type { ToastOptions, ToastType, ToastPosition } from '@ahrowe/ui'`
7
+
8
+ **Setup:** Wrap your app with `ToastProvider` (inside `ThemeProvider`):
9
+
10
+ ```tsx
11
+ import { ThemeProvider, ToastProvider } from '@ahrowe/ui';
12
+
13
+ <ThemeProvider>
14
+ <ToastProvider position="bottom-right" duration={3000}>
15
+ <App />
16
+ </ToastProvider>
17
+ </ThemeProvider>
18
+ ```
19
+
20
+ **Usage:** Call `showToast` anywhere — no component hierarchy required:
21
+
22
+ ```tsx
23
+ import { showToast } from '@ahrowe/ui';
24
+
25
+ // Simple message
26
+ showToast('Profile saved!');
27
+
28
+ // With type
29
+ showToast('Something went wrong.', { type: 'error' });
30
+ showToast('3 items updated.', { type: 'info' });
31
+ showToast('Disk space is low.', { type: 'warn' });
32
+
33
+ // Persistent (no auto-dismiss)
34
+ showToast('Processing…', { duration: 0, showCloseButton: true });
35
+
36
+ // With progress bar showing remaining time
37
+ showToast('Uploading file…', {
38
+ duration: 5000,
39
+ showRemainingTime: true,
40
+ });
41
+
42
+ // Override position per-toast
43
+ showToast('Copied!', { position: 'top-center', duration: 1500 });
44
+
45
+ // With slot overrides
46
+ showToast('Done', {
47
+ type: 'info',
48
+ classNames: { root: 'my-toast' },
49
+ styles: { progressBar: { backgroundColor: '#6200ea' } },
50
+ });
51
+ ```
52
+
53
+ **ToastProviderProps** (default config for all toasts):
54
+
55
+ | Prop | Type | Default | Description |
56
+ |------|------|---------|-------------|
57
+ | `position` | `ToastPosition` | `'bottom-right'` | Screen position |
58
+ | `duration` | `number` | `3000` | Auto-dismiss delay in ms; `0` = persistent |
59
+ | `showRemainingTime` | `boolean` | `false` | Show a progress bar draining to zero |
60
+ | `showCloseButton` | `boolean` | `false` | Show × button |
61
+ | `allowStacking` | `boolean` | `true` | Allow multiple toasts simultaneously |
62
+
63
+ **ToastPosition:** `'top-left'` `'top-center'` `'top-right'` `'bottom-left'` `'bottom-center'` `'bottom-right'`
64
+
65
+ **ToastType:** `'default'` `'info'` `'error'` `'warn'`
66
+
67
+ **Slots:** `root` `icon` `content` `closeButton` `progressBar`
@@ -0,0 +1,108 @@
1
+ # VirtualList
2
+
3
+ **When to use:** Efficiently render large lists or tables — thousands of rows rendered with a virtualised scroll window so only visible rows are in the DOM. Supports column definitions, row selection, multi-select, column visibility toggling, and infinite scroll.
4
+
5
+ **Import:** `import { VirtualList } from '@ahrowe/ui'`
6
+ **Types:** `import type { VirtualListProps, VirtualListColumn } from '@ahrowe/ui'`
7
+
8
+ ```tsx
9
+ import { VirtualList } from '@ahrowe/ui';
10
+ import type { VirtualListColumn } from '@ahrowe/ui';
11
+
12
+ type User = { id: string; name: string; email: string; role: string };
13
+
14
+ // Simple list mode (no columns)
15
+ <VirtualList
16
+ items={users}
17
+ renderRow={(user) => (
18
+ <div className="row">{user.name} — {user.email}</div>
19
+ )}
20
+ height={500}
21
+ />
22
+
23
+ // Table mode with column definitions
24
+ const columns: VirtualListColumn<User>[] = [
25
+ {
26
+ key: 'name',
27
+ label: 'Name',
28
+ width: { type: 'flex', weight: 2 },
29
+ renderCell: (user) => <strong>{user.name}</strong>,
30
+ },
31
+ {
32
+ key: 'email',
33
+ label: 'Email',
34
+ width: { type: 'flex' },
35
+ renderCell: (user) => user.email,
36
+ },
37
+ {
38
+ key: 'role',
39
+ label: 'Role',
40
+ width: { type: 'fixed', px: 120 },
41
+ renderCell: (user) => user.role,
42
+ defaultHidden: true,
43
+ },
44
+ ];
45
+
46
+ <VirtualList
47
+ items={users}
48
+ columns={columns}
49
+ getItemKey={(user) => user.id}
50
+ selectedKey={selectedId}
51
+ onRowClick={(user) => setSelectedId(user.id)}
52
+ height={600}
53
+ />
54
+
55
+ // Infinite scroll
56
+ <VirtualList
57
+ items={items}
58
+ columns={columns}
59
+ onLoadMore={async () => { await fetchNextPage(); }}
60
+ isLoading={isInitialLoading}
61
+ height="100%"
62
+ />
63
+
64
+ // Multi-select
65
+ <VirtualList
66
+ items={items}
67
+ columns={columns}
68
+ multiSelect
69
+ selectedKeys={selectedKeys}
70
+ onSelectionChange={(keys) => setSelectedKeys(keys)}
71
+ height={500}
72
+ />
73
+ ```
74
+
75
+ **Column width types:**
76
+
77
+ ```ts
78
+ { type: 'fixed'; px: number } // fixed pixel width
79
+ { type: 'flex'; weight?: number } // flex, weight defaults to 1
80
+ { type: 'fit' } // shrink to content
81
+ ```
82
+
83
+ **Key props:**
84
+
85
+ | Prop | Type | Description |
86
+ |------|------|-------------|
87
+ | `items` | `T[]` | Data array (required) |
88
+ | `renderRow` | `(item, index) => ReactNode` | Row render fn — list mode (no columns) |
89
+ | `columns` | `VirtualListColumn<T>[]` | Column definitions — enables table/header mode |
90
+ | `height` | `number \| string` | Scroll viewport height (default `'100%'`) |
91
+ | `estimatedRowHeight` | `number` | Estimated row height before measurement (default `40`) |
92
+ | `overscan` | `number` | Extra rows rendered outside the viewport (default `3`) |
93
+ | `rowGap` | `number` | Gap in px between rows (default `0`) |
94
+ | `showDivider` | `boolean` | Row divider lines (default `true`) |
95
+ | `getItemKey` | `(item, index) => string \| number` | Stable key per item |
96
+ | `selectedKey` | `string \| number \| null` | Controlled single-select key |
97
+ | `onRowClick` | `(item, index) => void` | Row click handler |
98
+ | `multiSelect` | `boolean` | Enable checkbox multi-select column |
99
+ | `selectedKeys` | `Set<string \| number>` | Controlled multi-select keys |
100
+ | `onSelectionChange` | `(keys) => void` | Multi-select change callback |
101
+ | `showColumnToggle` | `boolean` | Show gear button to show/hide columns (default `true` when columns present) |
102
+ | `visibleColumnKeys` | `string[]` | Controlled visible column keys |
103
+ | `onVisibleColumnsChange` | `(keys) => void` | Column visibility change callback |
104
+ | `onLoadMore` | `() => Promise<void>` | Triggered near the bottom — append items in the handler |
105
+ | `loadMoreThreshold` | `number` | Distance from bottom that triggers `onLoadMore` (default `100`) |
106
+ | `isLoading` | `boolean` | Replaces list body with a full-height spinner |
107
+
108
+ **Slots:** `root` `header` `headerCell` `headerToggle` `togglePopover` `toggleItem` `body` `row` `cell` `selectCell` `loadingIndicator`
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ahrowe/ui",
3
- "version": "0.1.6",
3
+ "version": "0.1.7",
4
4
  "publishConfig": {
5
5
  "access": "public"
6
6
  },