@overmap-ai/blocks 0.0.5 → 0.0.6
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/Buttons/constants.d.ts +7 -0
- package/dist/Buttons/index.d.ts +1 -0
- package/dist/Dialogs/AlertDialog/hooks.d.ts +6 -0
- package/dist/MultiSelect/MultiSelect.d.ts +1 -0
- package/dist/blocks.js +622 -611
- package/dist/blocks.js.map +1 -1
- package/dist/blocks.umd.cjs +2 -2
- package/dist/blocks.umd.cjs.map +1 -1
- package/dist/style.css +1 -1
- package/package.json +1 -1
package/dist/blocks.umd.cjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
(function(a,
|
|
1
|
+
(function(a,L){typeof exports=="object"&&typeof module<"u"?L(exports,require("@radix-ui/themes/styles.css"),require("@radix-ui/colors"),require("@radix-ui/react-icons"),require("@radix-ui/themes"),require("react/jsx-runtime"),require("react"),require("@radix-ui/react-dialog"),require("re-resizable"),require("react-transition-group"),require("@radix-ui/react-toggle-group"),require("@radix-ui/react-toast")):typeof define=="function"&&define.amd?define(["exports","@radix-ui/themes/styles.css","@radix-ui/colors","@radix-ui/react-icons","@radix-ui/themes","react/jsx-runtime","react","@radix-ui/react-dialog","re-resizable","react-transition-group","@radix-ui/react-toggle-group","@radix-ui/react-toast"],L):(a=typeof globalThis<"u"?globalThis:a||self,L(a.blocks={},null,a.colors,a.reactIcons,a.themes,a.jsxRuntime,a.React,a.RadixDialogPrimitive,a.reResizable,a.reactTransitionGroup,a.reactToggleGroup,a.RadixToast))})(this,function(a,L,oe,z,n,e,t,Se,Q,ie,le,Y){"use strict";function ae(i){const c=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(i){for(const l in i)if(l!=="default"){const r=Object.getOwnPropertyDescriptor(i,l);Object.defineProperty(c,l,r.get?r:{enumerable:!0,get:()=>i[l]})}}return c.default=i,Object.freeze(c)}const F=ae(Se),W=ae(Y);function Pe(i){return i&&i.__esModule&&Object.prototype.hasOwnProperty.call(i,"default")?i.default:i}var ce={exports:{}};/*!
|
|
2
2
|
Copyright (c) 2018 Jed Watson.
|
|
3
3
|
Licensed under the MIT License (MIT), see
|
|
4
4
|
http://jedwatson.github.io/classnames
|
|
5
|
-
*/(function(l){(function(){var d={}.hasOwnProperty;function i(){for(var t=[],c=0;c<arguments.length;c++){var o=arguments[c];if(o){var u=typeof o;if(u==="string"||u==="number")t.push(o);else if(Array.isArray(o)){if(o.length){var s=i.apply(null,o);s&&t.push(s)}}else if(u==="object"){if(o.toString!==Object.prototype.toString&&!o.toString.toString().includes("[native code]")){t.push(o.toString());continue}for(var p in o)d.call(o,p)&&o[p]&&t.push(p)}}}return t.join(" ")}l.exports?(i.default=i,l.exports=i):window.classNames=i})()})(se);var Oe=se.exports;const m=Te(Oe);function I(l,d){return r.useMemo(()=>{if(l!==void 0)if(typeof l=="object"){if(!("initial"in l))throw new Error("Expected initial property to be set in Responsive object");return Object.fromEntries(Object.entries(l).map(([i,t])=>[i,d[t]]))}else return d[l]},[d,l])}const De={success:"green",danger:"red",info:"gray"},T=l=>{const d=n.useThemeContext();if(l)return l==="primary"?d.accentColor:De[l]},xe=r.forwardRef(function({className:d,severity:i="primary",color:t,children:c,...o},u){const s=T(i);return e.jsx(n.Badge,{className:m("overmap-badge",d),ref:u,color:t||s,...o,children:c})}),ze=r.memo(xe),F={fluid:"_fluid_r73gr_1",hoverSpin90Clockwise:"_hoverSpin90Clockwise_r73gr_15",hoverSpin180Clockwise:"_hoverSpin180Clockwise_r73gr_25",hoverSpin360Clockwise:"_hoverSpin360Clockwise_r73gr_35"},de={spin90Clockwise:F.hoverSpin90Clockwise,spin180Clockwise:F.hoverSpin180Clockwise,spin360Clockwise:F.hoverSpin360Clockwise},M={small:"1",medium:"2",large:"3"},ue=r.createContext({}),R=()=>r.useContext(ue),ke=r.forwardRef(function(d,i){const t=R(),{className:c,type:o="button",fluid:u=t.fluid??!1,size:s=t.size??"medium",severity:p=t.severity??"primary",hoverEffects:f=t.hoverEffects??[],variant:h=t.variant,...C}=d,b=T(p),y=f.map(g=>de[g]);return e.jsx(n.Button,{ref:i,type:o,className:m(c,y,{[F.fluid]:u}),color:b,size:I(s,M),variant:h,...C})}),V=r.memo(ke),je=r.forwardRef(function(d,i){const t=R(),{className:c,children:o,type:u="button",fluid:s=t.fluid??!1,size:p=t.size??"medium",severity:f=t.severity??"primary",hoverEffects:h=t.hoverEffects??[],variant:C=t.variant,...b}=d,y=T(f),g=(h==null?void 0:h.map(w=>de[w]))||[];return e.jsx(n.IconButton,{className:m(c,g,{[F.fluid]:s}),ref:i,color:y,size:I(p,M),variant:C,type:u,...b,children:o})}),ee=r.memo(je),Ie={merged:"_merged_2fzhq_1"},Ae={row:{small:"4",medium:"4",large:"5"},column:{small:"2",medium:"3",large:"4"}},$e=r.forwardRef(function({className:d,merged:i=!1,children:t,gap:c,direction:o="row",severity:u,size:s="medium",variant:p,hoverEffects:f,fluid:h,...C},b){const y=I(s,Ae[o]),g=p==="ghost"?y:"0";return e.jsx(n.Flex,{className:m("overmap-button-group",d,{[Ie.merged]:i}),ref:b,gap:i?c??g:c??"2",direction:o,"data-direction":o,...C,children:e.jsx(ue.Provider,{value:{size:s,severity:u,variant:p,hoverEffects:f,fluid:h},children:t})})}),ne=r.memo($e),Me=r.memo(r.forwardRef((l,d)=>{const{children:i,border:t,before:c,after:o,size:u}=l,s=t?"surface":"ghost",p=I(u,M),f=c&&o?e.jsx(n.Inset,{side:"x",pt:"current",pb:"current",children:i}):c?e.jsx(n.Inset,{side:"bottom",pt:"current",children:i}):o?e.jsx(n.Inset,{side:"top",pb:"current",children:i}):e.jsx(n.Inset,{children:i}),h=e.jsxs(n.Card,{ref:d,size:p,variant:s,children:[c,f,o]});return s==="ghost"?e.jsx(n.Box,{p:"3",children:h}):h})),Ne=r.memo(r.forwardRef((l,d)=>{const{children:i,variant:t="outline",size:c,className:o,...u}=l,s=r.Children.count(i),p=t==="outline"||t==="surface",f=t==="outline"?"ghost":t==="surface"?"soft":t;return e.jsx(Me,{...u,border:p,size:c,children:e.jsx(ne,{size:c,severity:"info",variant:f,className:o,merged:!0,gap:"0",direction:"column",ref:d,children:r.Children.map(i,(h,C)=>e.jsxs(n.Flex,{direction:"column",children:[h,C<s-1&&e.jsx(we,{size:"4"})]},C))})})})),Be=r.memo(r.forwardRef((l,d)=>{const{variant:i}=R(),t=e.jsx(V,{ref:d,...l,variant:i});return i==="ghost"?e.jsx(n.Flex,{px:"2",py:"1",children:e.jsx(n.Box,{grow:"1",width:"100%",asChild:!0,children:t})}):t})),Ee={Root:Ne,Item:Be},Fe=r.memo(function(d){const{title:i,description:t,content:c,closeDialog:o}=d;return e.jsxs(n.Flex,{direction:"column",gap:"2",children:[e.jsxs(n.Flex,{direction:"column",gap:"1",children:[e.jsxs(n.Flex,{justify:"between",children:[e.jsx(n.Dialog.Title,{mb:"0",children:i}),e.jsx(n.Dialog.Close,{children:e.jsx(n.IconButton,{color:"gray",variant:"ghost","aria-label":"Close",children:e.jsx(k.Cross1Icon,{})})})]}),t&&e.jsx(n.Dialog.Description,{children:t})]}),c(o)]})}),Le=r.memo(r.forwardRef((l,d)=>{const{children:i,content:t,title:c,description:o,onOpen:u,defaultOpen:s,onCloseInterrupt:p,...f}=l,[h,C]=r.useState(s??!1),b=r.useCallback(g=>{if(g&&u)u();else if(!g&&p)return p(()=>C(!1));C(g)},[u,p]),y=r.useCallback(g=>{if(g!=null&&g.force)return C(!1);b(!1)},[b]);return e.jsxs(n.Dialog.Root,{open:h,onOpenChange:b,children:[e.jsx(n.Dialog.Trigger,{children:i}),e.jsx(n.Dialog.Content,{ref:d,...f,children:e.jsx(Fe,{closeDialog:y,content:t,title:c,description:o})})]})})),fe=l=>e.jsx(n.AlertDialog.Title,{mb:"0",...l}),We=l=>{const{title:d,description:i,actionText:t="Confirm",cancelText:c="Cancel",onAction:o,onCancel:u,severity:s}=l;return e.jsxs(n.Flex,{direction:"column",gap:"2",children:[e.jsxs(n.Flex,{direction:"column",gap:"1",children:[e.jsx(fe,{children:d}),e.jsx(n.AlertDialog.Description,{children:i})]}),e.jsxs(n.Flex,{gap:"3",mt:"4",justify:"end",children:[e.jsx(n.AlertDialog.Cancel,{children:e.jsx(V,{variant:"soft",severity:"info",onClick:u,children:c})}),e.jsx(n.AlertDialog.Action,{children:e.jsx(V,{variant:"solid",severity:s,onClick:o,children:t})})]})]})},pe=r.memo(function(d){const{open:i,setOpen:t,children:c,...o}=d,u=r.useMemo(()=>({close:()=>t(!1),Title:fe,Description:n.AlertDialog.Description}),[t]);return e.jsxs(n.AlertDialog.Root,{open:i,onOpenChange:t,children:[e.jsx(n.AlertDialog.Content,{children:"content"in o?o.content(u):e.jsx(We,{...o})}),c]})}),re=r.createContext(()=>{throw new Error("No AlertDialogProvider found")}),He={content:()=>null},Ge=r.memo(function({children:d}){const[i,t]=r.useState(!1),[c,o]=r.useState(He),u=r.useCallback(s=>{if(i)throw new Error("AlertDialog is already open");o(s),t(!0)},[i]);return e.jsx(pe,{open:i,setOpen:t,...c,children:e.jsx(re.Provider,{value:u,children:d})})}),Ve=()=>r.useContext(re),qe=r.memo(function({severity:d,itemContent:i,closeOnSelect:t=!0,onSelect:c,...o}){const u=T(d),s=r.useCallback(p=>{t||p.preventDefault(),c&&c(p)},[t,c]);return e.jsx(n.DropdownMenu.Item,{onSelect:s,color:u,...o,children:i})}),Xe=r.memo(function({defaultOpen:d,open:i,onOpenChange:t,modal:c,trigger:o,label:u,severity:s="info",children:p,...f}){const h=T(s);return e.jsxs(n.DropdownMenu.Root,{defaultOpen:d,open:i,onOpenChange:t,modal:c,children:[e.jsx(n.DropdownMenu.Trigger,{children:o}),e.jsxs(n.DropdownMenu.Content,{color:h,...f,children:[u&&e.jsx(n.DropdownMenu.Label,{children:u}),p]})]})}),Ue=r.memo(function({separatorBelow:d=!1,separatorAbove:i=!1,children:t,...c}){return e.jsxs(e.Fragment,{children:[i&&e.jsx(n.DropdownMenu.Separator,{}),e.jsx(n.DropdownMenu.Group,{...c,children:t}),d&&e.jsx(n.DropdownMenu.Separator,{})]})}),Ke=r.memo(function({defaultOpen:d,open:i,onOpenChange:t,trigger:c,children:o,...u}){return e.jsxs(n.DropdownMenu.Sub,{defaultOpen:d,open:i,onOpenChange:t,children:[e.jsx(n.DropdownMenu.SubTrigger,{children:c}),e.jsx(n.DropdownMenu.SubContent,{...u,children:o})]})}),Qe={Root:Xe,ItemGroup:Ue,Item:qe,SubMenu:Ke},ge={fluid:"_fluid_7n1wr_1"},Je=r.forwardRef(function({className:d,fluid:i,size:t="medium",variant:c="surface",severity:o="primary",itemSeverity:u="info",placeholder:s="Select",side:p,items:f=[],value:h,id:C,...b},y){const g=I(t,M),w=T(o),v=T(u);return r.createElement(n.Select.Root,{size:g,...b,key:h===void 0?1:0,value:h},e.jsx(n.Select.Trigger,{className:m(d,{[ge.fluid]:i}),id:C,ref:y,variant:c,placeholder:s,color:w}),e.jsx(n.Select.Content,{side:p,className:ge.contentDefault,position:"popper",variant:c!=="surface"?"soft":"solid",color:v,children:f.map(({itemContent:P,value:$,...x})=>e.jsx(n.Select.Item,{className:"overmap-select-item",value:$,...x,children:P},$))}))}),Ye=r.memo(Je),he=r.memo(r.forwardRef((l,d)=>{const{checked:i,label:t,value:c,size:o="2"}=l;return e.jsx(n.Box,{asChild:!0,px:o,children:e.jsx(n.Select.Item,{value:c,ref:d,children:e.jsxs(n.Flex,{gap:o,align:"center",children:[e.jsx(n.Checkbox,{checked:i}),t]})})})})),q="__select_all__",Ze=r.memo(r.forwardRef((l,d)=>{const[i,t]=r.useState(!1),{placeholder:c,value:o,onValueChange:u,options:s,disabled:p,id:f,radius:h,variant:C,name:b}=l,y=I(l.size,M),g=T(l.severity),w=r.useMemo(()=>new Map(s.map(_=>[_.value,_.label])),[s]),v=o.length>4?`${o.length} options selected`:o.map(_=>w.get(_)).join(", "),P=r.useCallback(()=>t(!1),[]),$=r.useCallback(_=>{_&&t(!0)},[]),x=r.useCallback(_=>{let L;_===q?L=o.length===s.length?[]:s.map(E=>E.value):L=o.includes(_)?o.filter(X=>X!==_):[...o,_],u(L)},[u,s,o]);return r.useEffect(()=>{if(s.some(({value:_})=>_===q))throw new Error(`Cannot have an option with the value "${q}"`)},[s]),e.jsxs(n.Select.Root,{open:i,value:"",onOpenChange:$,onValueChange:x,disabled:p,size:y,name:b,autoComplete:"off",children:[e.jsx(n.Select.Trigger,{ref:d,id:f,radius:h,variant:C,color:g,placeholder:o.length>0?v:c,"data-placeholder":o.length>0?void 0:!0}),e.jsxs(n.Select.Content,{color:"gray",variant:"soft",position:"popper",onEscapeKeyDown:P,onPointerDownOutside:P,children:[e.jsx(he,{value:q,label:"Select all",checked:o.length===s.length,size:y}),s.map(_=>e.jsx(he,{..._,checked:o.includes(_.value),size:y},_.value))]})]})})),Re={default:"_default_u936h_1"},en=r.forwardRef(function({className:d,severity:i="primary",icon:t,defaultChecked:c=!1,onCheckedChange:o,...u},s){const p=r.useRef(null),[f,h]=r.useState(u.checked?u.checked:c),[C,b]=r.useState(),y=T(i);r.useLayoutEffect(()=>{var P;const v=s||p;"current"in v&&v.current&&b((P=v.current)==null?void 0:P.querySelector("span.rt-SwitchThumb"))},[s]);const g=r.useCallback(v=>{h(v),o&&o(v)},[o]),w=u.checked?u.checked:f;return e.jsxs(e.Fragment,{children:[e.jsx(n.Switch,{className:m("overmap-switch",d,Re.default),ref:s||p,color:y,radius:"full",defaultChecked:c,onCheckedChange:g,...u}),e.jsx(n.Portal,{container:C,asChild:!0,children:t&&"checked"in t?w?t.checked:t.unchecked:t})]})}),nn=r.memo(en),N={sidebarContent:"_sidebarContent_1onyo_1",right:"_right_1onyo_7",resizeHandle:"_resizeHandle_1onyo_10",left:"_left_1onyo_13",overlay:"_overlay_1onyo_33"},rn=r.forwardRef(function({side:d="left",modal:i=!0,children:t,open:c,containerSelector:o,overlay:u=!0,resizable:s=!0,minWidth:p="300px",maxWidth:f="500px",...h},C){const b=d==="right",y=d==="left",[g,w]=r.useState();return r.useEffect(()=>{const v=o??'[data-is-root-theme="true"]',P=document.querySelector(v);if(P===void 0)throw new Error(`Could not find a container element using the following selector ${v}`);w(P)},[o]),e.jsx(H.Root,{open:c,modal:i,children:e.jsxs(H.Portal,{container:g,children:[u&&e.jsx(H.Overlay,{className:m(N.overlay)}),e.jsx(H.Content,{className:m("overmap-sidebar","rt-DialogContent",N.sidebarContent,{[N.left]:y,[N.right]:b}),ref:C,asChild:!0,...h,children:e.jsx(n.Box,{width:"auto",children:e.jsx(Y.Resizable,{minWidth:p,maxWidth:f,defaultSize:{width:"300px",height:"100%"},enable:{right:s&&y,left:s&&b},handleClasses:{left:N.resizeHandle,right:N.resizeHandle},handleComponent:{right:e.jsx(k.DragHandleDots2Icon,{}),left:e.jsx(k.DragHandleDots2Icon,{})},children:t})})})]})})}),tn=r.memo(rn),B={accommodateCharCount:"_accommodateCharCount_sr18k_1",wrapper:"_wrapper_sr18k_5",default:"_default_sr18k_9",noLeftIcon:"_noLeftIcon_sr18k_13",noRightIcon:"_noRightIcon_sr18k_17",charCount:"_charCount_sr18k_21"},on=r.forwardRef(function({className:d,leftSlot:i,rightSlot:t,size:c="medium",showInputLength:o,value:u,variant:s,severity:p="primary",...f},h){const C=I(c,M),b=T(p),y=o||o===void 0&&f.maxLength!==void 0,g=u!==void 0?u.toString():void 0;return e.jsxs(n.TextField.Root,{className:m(B.wrapper,{[B.accommodateCharCount]:y}),size:C,variant:s,color:b,children:[i&&e.jsx(n.TextField.Slot,{children:i}),e.jsx(n.TextField.Input,{className:m(B.default,d,{[B.noLeftIcon]:!i,[B.noRightIcon]:!t}),ref:h,size:C,variant:s,color:b,...f}),t&&e.jsx(n.TextField.Slot,{children:t}),y&&e.jsx(n.Text,{as:"p",className:B.charCount,size:"1",color:"gray",children:f.maxLength!==void 0?`${g==null?void 0:g.length}/${f.maxLength}`:`${g==null?void 0:g.length}`})]})}),ln=r.memo(on),an={wrapper:"_wrapper_tmtz0_1"},cn=r.forwardRef(function({className:d,defaultOpen:i=!1,modal:t=!1,content:c,children:o,...u},s){return e.jsxs(n.Popover.Root,{defaultOpen:i,modal:t,children:[e.jsx(n.Popover.Trigger,{children:o}),e.jsx(n.Popover.Content,{ref:s,className:m("overmap-popover",d,an.wrapper),...u,children:c(n.Popover.Close)})]})}),sn=r.memo(cn),O={wrapper:"_wrapper_1mz2e_1",panelContent:"_panelContent_1mz2e_6",left:"_left_1mz2e_14",right:"_right_1mz2e_18",resizable:"_resizable_1mz2e_23",resizeHandle:"_resizeHandle_1mz2e_28",panelMainContent:"_panelMainContent_1mz2e_48"},Ce=200,A=150,dn=r.memo(function({children:d,showLeft:i,leftPanel:t,leftMinWidth:c=Ce,showRight:o,rightPanel:u,rightMinWidth:s=Ce,resizeable:p}){const f=r.useRef(null),h=r.useRef(null),[C,b]=r.useState(0),[y,g]=r.useState(),w=r.useRef(null),[v,P]=r.useState(0),[$,x]=r.useState(),_=r.useCallback((S,D,z)=>(j,me,Se,oe)=>{if(!f.current)return;const K=S+oe.width;z(f.current.clientWidth-K),D(()=>K)},[]),L=r.useCallback((S,D,z,j)=>_(C,b,x)(S,D,z,j),[_,C]),X=r.useCallback((S,D,z,j)=>_(v,P,g)(S,D,z,j),[_,v]),E=r.useCallback((S,D,z,j,me,Se,oe,K)=>{if(!f.current)return;let Q=S;if(Q===0&&(Q=D,z(Q)),Se){const J=f.current.clientWidth-Q;K(J),me>J&&(oe(J),j(f.current.clientWidth-J))}},[]),On=r.useCallback(()=>E(v,s,P,x,C,i,b,g),[E,C,s,v,i]),Dn=r.useCallback(()=>E(C,c,b,g,v,o,P,x),[E,c,C,v,o]),U=r.useCallback((S,D)=>{f.current&&S&&D(f.current.clientWidth)},[]),xn=r.useCallback(()=>U(i,g),[U,i]),zn=r.useCallback(()=>U(o,x),[U,o]),_e=r.useCallback(()=>{var S,D,z,j;f.current&&(g(f.current.clientWidth-(((S=w.current)==null?void 0:S.clientWidth)||0)),x(f.current.clientWidth-(((D=h.current)==null?void 0:D.clientWidth)||0)),b(((z=h.current)==null?void 0:z.clientWidth)||0),P(((j=w.current)==null?void 0:j.clientWidth)||0))},[]);r.useEffect(()=>{if(!f.current)return;const S=new ResizeObserver(_e);return S.observe(f.current),()=>{S.disconnect()}},[_e]);const kn=r.useMemo(()=>({entering:{transform:`translateX(-${C}px)`,marginRight:`-${C}px`,transitionProperty:"transform, margin-right",transitionDuration:`${A}ms`,transitionTimingFunction:"linear"},entered:{transform:"translateX(0)",marginRight:0,transitionProperty:"transform, margin-right",transitionDuration:`${A}ms`,transitionTimingFunction:"linear"},exiting:{transform:`translateX(-${C}px)`,marginRight:`-${C}px`,transitionProperty:"transform, margin-right",transitionDuration:`${A}ms`,transitionTimingFunction:"linear"},exited:{},unmounted:{}}),[C]),jn=r.useMemo(()=>({entering:{transform:`translateX(${v}px)`,marginLeft:`${-v}px`,transitionProperty:"transform, margin-left",transitionDuration:`${A}ms`,transitionTimingFunction:"linear"},entered:{transform:"translateX(0)",marginLeft:0,transitionProperty:"transform, margin-left",transitionDuration:`${A}ms`,transitionTimingFunction:"linear"},exiting:{transform:`translateX(${v}px)`,marginLeft:`${-v}px`,transitionProperty:"transform, margin-left",transitionDuration:`${A}ms`,transitionTimingFunction:"linear"},exited:{},unmounted:{}}),[v]);return e.jsxs(n.Flex,{className:O.wrapper,style:{minWidth:`${c+s}px`},ref:f,width:"100%",height:"100%",justify:"center",m:"0",p:"0",children:[e.jsx(le.Transition,{nodeRef:h,timeout:i?0:A,in:i,unmountOnExit:!0,onEntering:Dn,onExited:zn,children:S=>e.jsx(n.Box,{ref:h,className:m(O.panelContent,O.left),style:kn[S],width:"auto",height:"100%",m:"0",p:"0",children:e.jsx(Y.Resizable,{className:O.resizable,size:{width:C,height:"100%"},onResizeStop:L,enable:{right:(p==null?void 0:p.left)!==void 0?p.left:!0},minWidth:c,maxWidth:y,handleClasses:{right:m(O.resizeHandle,O.left)},handleComponent:{right:e.jsx(k.DragHandleDots2Icon,{height:"14px",width:"14px"})},children:t})})}),e.jsx(n.Box,{className:O.panelMainContent,width:"max-content",children:d}),e.jsx(le.Transition,{nodeRef:w,timeout:o?0:A,in:o,unmountOnExit:!0,onEntering:On,onExited:xn,children:S=>e.jsx(n.Box,{ref:w,className:m(O.panelContent,O.right),style:jn[S],width:"auto",height:"100%",m:"0",p:"0",children:e.jsx(Y.Resizable,{className:O.resizable,size:{width:v,height:"100%"},onResizeStop:X,enable:{left:(p==null?void 0:p.right)!==void 0?p.right:!0},minWidth:s,maxWidth:$,handleClasses:{left:m(O.resizeHandle,O.right)},handleComponent:{left:e.jsx(k.DragHandleDots2Icon,{height:"14px",width:"14px"})},children:u})})})]})}),un={charCount:"_charCount_17uut_1"},fn=r.forwardRef(function({className:d,showInputLength:i,inputLengthTemplate:t,value:c,severity:o="primary",resize:u,...s},p){const f=T(o),h=T("info"),C=i||i===void 0&&(s.maxLength!==void 0||s.minLength!==void 0),b=c!==void 0?c.toString():"",y=r.useMemo(()=>{if(t){let g=t.replace("{current}",b.length.toString());return s.minLength!==void 0&&(g=g.replace("{min}",s.minLength.toString())),s.maxLength!==void 0&&(g=g.replace("{max}",s.maxLength.toString())),g}return b.length},[t,s.maxLength,s.minLength,b.length]);return e.jsxs(e.Fragment,{children:[e.jsx(n.TextArea,{className:m("overmap-textarea",d),style:{resize:u},ref:p,value:c,color:f,...s}),C&&e.jsx(n.Text,{as:"p",className:un.charCount,color:h,align:"right",children:y})]})}),pn=r.memo(fn),gn=r.forwardRef(function({loop:d,type:i,rovingFocus:t,value:c,onValueChange:o,defaultValue:u,disabled:s,items:p,className:f,direction:h="row",...C},b){return e.jsx(ae.Root,{type:i,className:m("overmap-toggle-group",f),ref:b,value:c,onValueChange:o,disabled:s,orientation:h==="column"?"vertical":"horizontal",loop:d,rovingFocus:t,defaultValue:u,asChild:!0,children:e.jsx(ne,{direction:h,...C,children:p.map(({children:y,...g})=>r.createElement(ae.Item,{asChild:!0,...g,key:g.value},e.jsx(ee,{className:m("overmap-toggle-group-button"),"aria-label":g.value,variant:g.value===c?"solid":"soft",children:y})))})})}),hn=r.memo(gn),be={ToastViewport:"_ToastViewport_t8tlv_1",ToastRoot:"_ToastRoot_t8tlv_20",slideIn:"_slideIn_t8tlv_1",swipeOut:"_swipeOut_t8tlv_1"},Cn=r.forwardRef(function({title:d,description:i,icon:t,severity:c="primary",size:o,onClose:u,sensitivity:s,...p},f){const[h,C]=r.useState(!0),b=T(c),y=r.useCallback(g=>{!g&&u&&u(),C(g)},[u]);return e.jsx(G.Root,{asChild:!0,ref:f,...p,open:h,type:s,onOpenChange:y,children:e.jsx(n.Callout.Root,{className:be.ToastRoot,variant:"surface",color:b,size:o,children:e.jsxs(n.Flex,{width:"100%",align:"center",gap:"4",justify:"between",children:[e.jsxs(n.Flex,{align:"center",gap:"4",children:[e.jsx(n.Callout.Icon,{children:t||e.jsx(k.InfoCircledIcon,{})}),e.jsxs(n.Flex,{direction:"column",gap:"0",children:[e.jsx(G.Title,{asChild:!0,children:e.jsx(n.Callout.Text,{weight:"medium",children:d})}),e.jsx(G.Description,{asChild:!0,children:e.jsx(n.Callout.Text,{weight:"light",children:i})})]})]}),e.jsx(G.Close,{asChild:!0,children:e.jsx(ee,{"aria-label":"Close",variant:"ghost",size:"small",severity:c,children:e.jsx(k.Cross2Icon,{})})})]})})})}),ye=r.memo(Cn),te=r.createContext({}),bn=()=>{const l=r.useContext(te);if(!l)throw new Error("useToast must be used within a ToastProvider");return l},yn=240/60,ve=5e3,vn=l=>{if(l.duration&&l.duration>=ve)return l.duration;const d=l.severity==="danger"?1.5:1,i=l.description.split(" ").length+l.title.split(" ").length;return(ve+i/yn)*d};a.unsafeShowToast=void 0;const wn=r.memo(function({children:d,className:i,hotkey:t,...c}){const[o,u]=r.useState([]),s=r.useCallback((f,h,C)=>{u(b=>{const y=b.find(g=>g.id===f);return y&&h===0&&clearTimeout(y.timeout),b.filter(g=>g.id!==f)}),C&&C()},[]),p=r.useMemo(()=>{let f=0;const h=w=>{const v=vn(w),P=f.toString();f+=1;const $=setTimeout(()=>s(P,1,w.onClose),v);u(x=>[...x,{...w,timeout:$,duration:v,id:P}])},C=w=>h({...w,severity:"primary"}),b=w=>h({...w,severity:"success"}),y=w=>h({...w,severity:"danger"}),g=w=>h({...w,severity:"info"});return a.unsafeShowToast=h,{showToast:h,showPrimary:C,showSuccess:b,showError:y,showInfo:g}},[s]);return r.useEffect(()=>()=>{for(const{timeout:f}of o)clearTimeout(f)},[]),e.jsx(te.Provider,{value:p,children:e.jsxs(Z.ToastProvider,{...c,children:[d,e.jsx(Z.ToastViewport,{className:m(i,be.ToastViewport),hotkey:t}),o.map(({id:f,onClose:h,...C})=>e.jsx(ye,{...C,onClose:()=>s(f,0,h)},f))]})})}),_n={noWrap:"_noWrap_1wpa5_1"},mn=r.memo(r.forwardRef(({className:l,noWrap:d,severity:i,as:t,...c},o)=>{const u=T(i);return e.jsx(n.Text,{ref:o,as:t,className:m(l,{[_n.noWrap]:d}),color:u,...c})})),cr="",Sn=r.memo(r.forwardRef((l,d)=>{const{panelBackground:i="solid",radius:t="full",...c}=l;return e.jsx(n.Theme,{panelBackground:i,radius:t,ref:d,...c})})),Pn={1:"max-content",2:"max-content",3:"max-content",4:"100%"},Tn=r.forwardRef(function({severity:d="info",weight:i="light",gap:t="1",text:c,orientation:o="horizontal",size:u,...s}){const p=I(u,Pn),f=T(d);return e.jsx(e.Fragment,{children:e.jsxs(n.Flex,{width:o==="horizontal"?p:"max-content",height:o==="vertical"?p:"max-content",direction:o==="vertical"?"column":"row",align:"center",gap:t,children:[e.jsx(n.Separator,{size:u,orientation:o,color:f,...s}),c&&e.jsxs(e.Fragment,{children:[e.jsx(n.Text,{as:"span",size:"1",weight:i,color:f,children:c}),e.jsx(n.Separator,{size:u,orientation:o,color:f,...s})]})]})})}),we=r.memo(Tn);Object.defineProperty(a,"AccessibleIcon",{enumerable:!0,get:()=>n.AccessibleIcon}),Object.defineProperty(a,"AspectRatio",{enumerable:!0,get:()=>n.AspectRatio}),Object.defineProperty(a,"Avatar",{enumerable:!0,get:()=>n.Avatar}),Object.defineProperty(a,"Blockquote",{enumerable:!0,get:()=>n.Blockquote}),Object.defineProperty(a,"Box",{enumerable:!0,get:()=>n.Box}),Object.defineProperty(a,"Callout",{enumerable:!0,get:()=>n.Callout}),Object.defineProperty(a,"Card",{enumerable:!0,get:()=>n.Card}),Object.defineProperty(a,"Checkbox",{enumerable:!0,get:()=>n.Checkbox}),Object.defineProperty(a,"Code",{enumerable:!0,get:()=>n.Code}),Object.defineProperty(a,"Container",{enumerable:!0,get:()=>n.Container}),Object.defineProperty(a,"ContextMenu",{enumerable:!0,get:()=>n.ContextMenu}),Object.defineProperty(a,"Em",{enumerable:!0,get:()=>n.Em}),Object.defineProperty(a,"Flex",{enumerable:!0,get:()=>n.Flex}),Object.defineProperty(a,"Grid",{enumerable:!0,get:()=>n.Grid}),Object.defineProperty(a,"Heading",{enumerable:!0,get:()=>n.Heading}),Object.defineProperty(a,"HoverCard",{enumerable:!0,get:()=>n.HoverCard}),Object.defineProperty(a,"Inset",{enumerable:!0,get:()=>n.Inset}),Object.defineProperty(a,"Kbd",{enumerable:!0,get:()=>n.Kbd}),Object.defineProperty(a,"Link",{enumerable:!0,get:()=>n.Link}),Object.defineProperty(a,"Portal",{enumerable:!0,get:()=>n.Portal}),Object.defineProperty(a,"Quote",{enumerable:!0,get:()=>n.Quote}),Object.defineProperty(a,"RadioGroup",{enumerable:!0,get:()=>n.RadioGroup}),Object.defineProperty(a,"ScrollArea",{enumerable:!0,get:()=>n.ScrollArea}),Object.defineProperty(a,"Section",{enumerable:!0,get:()=>n.Section}),Object.defineProperty(a,"Slider",{enumerable:!0,get:()=>n.Slider}),Object.defineProperty(a,"Slot",{enumerable:!0,get:()=>n.Slot}),Object.defineProperty(a,"Strong",{enumerable:!0,get:()=>n.Strong}),Object.defineProperty(a,"Table",{enumerable:!0,get:()=>n.Table}),Object.defineProperty(a,"Tabs",{enumerable:!0,get:()=>n.Tabs}),Object.defineProperty(a,"TextField",{enumerable:!0,get:()=>n.TextField}),Object.defineProperty(a,"Theme",{enumerable:!0,get:()=>n.Theme}),Object.defineProperty(a,"Tooltip",{enumerable:!0,get:()=>n.Tooltip}),Object.defineProperty(a,"VisuallyHidden",{enumerable:!0,get:()=>n.VisuallyHidden}),Object.defineProperty(a,"updateThemeAppearanceClass",{enumerable:!0,get:()=>n.updateThemeAppearanceClass}),Object.defineProperty(a,"useThemeContext",{enumerable:!0,get:()=>n.useThemeContext}),a.AlertDialog=pe,a.AlertDialogContent=re,a.AlertDialogProvider=Ge,a.Badge=ze,a.Button=V,a.ButtonGroup=ne,a.ButtonList=Ee,a.DefaultTheme=Sn,a.Dialog=Le,a.DropdownMenu=Qe,a.IconButton=ee,a.Input=ln,a.LeftAndRightPanels=dn,a.MultiSelect=Ze,a.Popover=sn,a.Select=Ye,a.Separator=we,a.Sidebar=tn,a.Switch=nn,a.Text=mn,a.TextArea=pn,a.Toast=ye,a.ToastContext=te,a.ToastProvider=wn,a.ToggleGroup=hn,a.useAlertDialog=Ve,a.useSeverityColor=T,a.useToast=bn,Object.keys(ie).forEach(l=>{l!=="default"&&!Object.prototype.hasOwnProperty.call(a,l)&&Object.defineProperty(a,l,{enumerable:!0,get:()=>ie[l]})}),Object.keys(k).forEach(l=>{l!=="default"&&!Object.prototype.hasOwnProperty.call(a,l)&&Object.defineProperty(a,l,{enumerable:!0,get:()=>k[l]})}),Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})});
|
|
5
|
+
*/(function(i){(function(){var c={}.hasOwnProperty;function l(){for(var r=[],s=0;s<arguments.length;s++){var o=arguments[s];if(o){var u=typeof o;if(u==="string"||u==="number")r.push(o);else if(Array.isArray(o)){if(o.length){var d=l.apply(null,o);d&&r.push(d)}}else if(u==="object"){if(o.toString!==Object.prototype.toString&&!o.toString.toString().includes("[native code]")){r.push(o.toString());continue}for(var g in o)c.call(o,g)&&o[g]&&r.push(g)}}}return r.join(" ")}i.exports?(l.default=l,i.exports=l):window.classNames=l})()})(ce);var Te=ce.exports;const m=Pe(Te);function I(i,c){return t.useMemo(()=>{if(i!==void 0)if(typeof i=="object"){if(!("initial"in i))throw new Error("Expected initial property to be set in Responsive object");return Object.fromEntries(Object.entries(i).map(([l,r])=>[l,c[r]]))}else return c[i]},[c,i])}const Oe={success:"green",danger:"red",info:"gray"},T=i=>{const c=n.useThemeContext();if(i)return i==="primary"?c.accentColor:Oe[i]},De=t.forwardRef(function({className:c,severity:l="primary",color:r,children:s,...o},u){const d=T(l);return e.jsx(n.Badge,{className:m("overmap-badge",c),ref:u,color:r||d,...o,children:s})}),xe=t.memo(De),E={fluid:"_fluid_r73gr_1",hoverSpin90Clockwise:"_hoverSpin90Clockwise_r73gr_15",hoverSpin180Clockwise:"_hoverSpin180Clockwise_r73gr_25",hoverSpin360Clockwise:"_hoverSpin360Clockwise_r73gr_35"},se={spin90Clockwise:E.hoverSpin90Clockwise,spin180Clockwise:E.hoverSpin180Clockwise,spin360Clockwise:E.hoverSpin360Clockwise},ke={role:"button",tabIndex:0,onKeyDown:i=>{(i.key==="Enter"||i.key===" ")&&i.currentTarget.click()}},M={small:"1",medium:"2",large:"3"},de=t.createContext({}),J=()=>t.useContext(de),ze=t.forwardRef(function(c,l){const r=J(),{className:s,type:o="button",fluid:u=r.fluid??!1,size:d=r.size??"medium",severity:g=r.severity??"primary",hoverEffects:f=r.hoverEffects??[],variant:h=r.variant,...C}=c,b=T(g),y=f.map(p=>se[p]);return e.jsx(n.Button,{ref:l,type:o,className:m(s,y,{[E.fluid]:u}),color:b,size:I(d,M),variant:h,...C})}),H=t.memo(ze),je=t.forwardRef(function(c,l){const r=J(),{className:s,children:o,type:u="button",fluid:d=r.fluid??!1,size:g=r.size??"medium",severity:f=r.severity??"primary",hoverEffects:h=r.hoverEffects??[],variant:C=r.variant,...b}=c,y=T(f),p=(h==null?void 0:h.map(w=>se[w]))||[];return e.jsx(n.IconButton,{className:m(s,p,{[E.fluid]:d}),ref:l,color:y,size:I(g,M),variant:C,type:u,...b,children:o})}),Z=t.memo(je),Ie={merged:"_merged_wdgxo_1"},Ae={row:{small:"4",medium:"4",large:"5"},column:{small:"2",medium:"3",large:"4"}},$e=t.forwardRef(function({className:c,merged:l=!1,children:r,gap:s,direction:o="row",severity:u,size:d="medium",variant:g,hoverEffects:f,fluid:h,...C},b){const y=I(d,Ae[o]),p=g==="ghost"?y:"0";return e.jsx(n.Flex,{className:m("overmap-button-group",c,{[Ie.merged]:l}),ref:b,gap:l?s??p:s??"2",direction:o,"data-direction":o,...C,children:e.jsx(de.Provider,{value:{size:d,severity:u,variant:g,hoverEffects:f,fluid:h},children:r})})}),R=t.memo($e),Me={separators:"_separators_1f7v1_1"},Ne=t.memo(t.forwardRef((i,c)=>{const{children:l,border:r,before:s,after:o,size:u}=i,d=r?"surface":"ghost",g=I(u,M),f=s&&o?e.jsx(n.Inset,{side:"x",pt:"current",pb:"current",children:l}):s?e.jsx(n.Inset,{side:"bottom",pt:"current",children:l}):o?e.jsx(n.Inset,{side:"top",pb:"current",children:l}):e.jsx(n.Inset,{children:l}),h=e.jsxs(n.Card,{ref:c,size:g,variant:d,children:[s,f,o]});return d==="ghost"?e.jsx(n.Box,{p:"3",children:h}):h})),Be=t.memo(t.forwardRef((i,c)=>{const{children:l,variant:r="outline",size:s,className:o,...u}=i,d=r==="outline"||r==="surface",g=r==="outline"?"ghost":r==="surface"?"soft":r;return e.jsx(Ne,{...u,border:d,size:s,children:e.jsx(R,{size:s,severity:"info",variant:g,className:m(o,Me.separators),merged:!0,gap:"0",direction:"column",ref:c,children:l})})})),Ee=t.memo(t.forwardRef((i,c)=>{const{variant:l}=J(),r=e.jsx(H,{ref:c,...i,radius:"large",variant:l});return l==="ghost"?e.jsx(n.Box,{asChild:!0,my:"1",mx:"2",children:r}):r})),Le={Root:Be,Item:Ee},Fe=t.memo(function(c){const{title:l,description:r,content:s,closeDialog:o}=c;return e.jsxs(n.Flex,{direction:"column",gap:"2",children:[e.jsxs(n.Flex,{direction:"column",gap:"1",children:[e.jsxs(n.Flex,{justify:"between",children:[e.jsx(n.Dialog.Title,{mb:"0",children:l}),e.jsx(n.Dialog.Close,{children:e.jsx(n.IconButton,{color:"gray",variant:"ghost","aria-label":"Close",children:e.jsx(z.Cross1Icon,{})})})]}),r&&e.jsx(n.Dialog.Description,{children:r})]}),s(o)]})}),We=t.memo(t.forwardRef((i,c)=>{const{children:l,content:r,title:s,description:o,onOpen:u,defaultOpen:d,onCloseInterrupt:g,...f}=i,[h,C]=t.useState(d??!1),b=t.useCallback(p=>{if(p&&u)u();else if(!p&&g)return g(()=>C(!1));C(p)},[u,g]),y=t.useCallback(p=>{if(p!=null&&p.force)return C(!1);b(!1)},[b]);return e.jsxs(n.Dialog.Root,{open:h,onOpenChange:b,children:[e.jsx(n.Dialog.Trigger,{children:l}),e.jsx(n.Dialog.Content,{ref:c,...f,children:e.jsx(Fe,{closeDialog:y,content:r,title:s,description:o})})]})})),ue=i=>e.jsx(n.AlertDialog.Title,{mb:"0",...i}),He=i=>{const{title:c,description:l,actionText:r="Confirm",cancelText:s="Cancel",onAction:o,onCancel:u,severity:d}=i;return e.jsxs(n.Flex,{direction:"column",gap:"2",children:[e.jsxs(n.Flex,{direction:"column",gap:"1",children:[e.jsx(ue,{children:c}),e.jsx(n.AlertDialog.Description,{children:l})]}),e.jsxs(n.Flex,{gap:"3",mt:"4",justify:"end",children:[e.jsx(n.AlertDialog.Cancel,{children:e.jsx(H,{variant:"soft",severity:"info",onClick:u,children:s})}),e.jsx(n.AlertDialog.Action,{children:e.jsx(H,{variant:"solid",severity:d,onClick:o,children:r})})]})]})},fe=t.memo(function(c){const{open:l,setOpen:r,children:s,...o}=c,u=t.useMemo(()=>({close:()=>r(!1),Title:ue,Description:n.AlertDialog.Description}),[r]);return e.jsxs(n.AlertDialog.Root,{open:l,onOpenChange:r,children:[e.jsx(n.AlertDialog.Content,{children:"content"in o?o.content(u):e.jsx(He,{...o})}),s]})}),ee=t.createContext(()=>{throw new Error("No AlertDialogProvider found")}),Ge={content:()=>null},Ve=t.memo(function({children:c}){const[l,r]=t.useState(!1),[s,o]=t.useState(Ge),u=t.useCallback(d=>{if(l)throw new Error("AlertDialog is already open");o(d),r(!0)},[l]);return e.jsx(fe,{open:l,setOpen:r,...s,children:e.jsx(ee.Provider,{value:u,children:c})})}),pe=()=>t.useContext(ee),qe=()=>{const i=pe();return t.useCallback(c=>i({title:"Discard changes?",description:"You have unsaved changes. Are you sure you want to discard them?",actionText:"Discard",severity:"danger",onAction:c.onDiscard,onCancel:c.onCancel}),[i])},Xe=t.memo(function({severity:c,itemContent:l,closeOnSelect:r=!0,onSelect:s,...o}){const u=T(c),d=t.useCallback(g=>{r||g.preventDefault(),s&&s(g)},[r,s]);return e.jsx(n.DropdownMenu.Item,{onSelect:d,color:u,...o,children:l})}),Ke=t.memo(function({defaultOpen:c,open:l,onOpenChange:r,modal:s,trigger:o,label:u,severity:d="info",children:g,...f}){const h=T(d);return e.jsxs(n.DropdownMenu.Root,{defaultOpen:c,open:l,onOpenChange:r,modal:s,children:[e.jsx(n.DropdownMenu.Trigger,{children:o}),e.jsxs(n.DropdownMenu.Content,{color:h,...f,children:[u&&e.jsx(n.DropdownMenu.Label,{children:u}),g]})]})}),Ue=t.memo(function({separatorBelow:c=!1,separatorAbove:l=!1,children:r,...s}){return e.jsxs(e.Fragment,{children:[l&&e.jsx(n.DropdownMenu.Separator,{}),e.jsx(n.DropdownMenu.Group,{...s,children:r}),c&&e.jsx(n.DropdownMenu.Separator,{})]})}),Qe=t.memo(function({defaultOpen:c,open:l,onOpenChange:r,trigger:s,children:o,...u}){return e.jsxs(n.DropdownMenu.Sub,{defaultOpen:c,open:l,onOpenChange:r,children:[e.jsx(n.DropdownMenu.SubTrigger,{children:s}),e.jsx(n.DropdownMenu.SubContent,{...u,children:o})]})}),Ye={Root:Ke,ItemGroup:Ue,Item:Xe,SubMenu:Qe},ge={fluid:"_fluid_7n1wr_1"},Je=t.forwardRef(function({className:c,fluid:l,size:r="medium",variant:s="surface",severity:o="primary",itemSeverity:u="info",placeholder:d="Select",side:g,items:f=[],value:h,id:C,...b},y){const p=I(r,M),w=T(o),v=T(u);return t.createElement(n.Select.Root,{size:p,...b,key:h===void 0?1:0,value:h},e.jsx(n.Select.Trigger,{className:m(c,{[ge.fluid]:l}),id:C,ref:y,variant:s,placeholder:d,color:w}),e.jsx(n.Select.Content,{side:g,className:ge.contentDefault,position:"popper",variant:s!=="surface"?"soft":"solid",color:v,children:f.map(({itemContent:P,value:_,...O})=>e.jsx(n.Select.Item,{className:"overmap-select-item",value:_,...O,children:P},_))}))}),Ze=t.memo(Je),he=t.memo(t.forwardRef((i,c)=>{const{checked:l,label:r,value:s,size:o="2"}=i;return e.jsx(n.Box,{asChild:!0,px:o,children:e.jsx(n.Select.Item,{value:s,ref:c,children:e.jsxs(n.Flex,{gap:o,align:"center",children:[e.jsx(n.Checkbox,{checked:l}),r]})})})})),G="__select_all__",Re=t.memo(t.forwardRef((i,c)=>{const[l,r]=t.useState(!1),{placeholder:s,value:o,onValueChange:u,options:d,disabled:g,name:f,...h}=i,C=I(i.size,M),b=T(i.severity),y=t.useMemo(()=>new Map(d.map(_=>[_.value,_.label])),[d]),p=o.length>4?`${o.length} options selected`:e.jsx("span",{children:o.flatMap(_=>[y.get(_),", "]).slice(0,-1)}),w=t.useCallback(()=>r(!1),[]),v=t.useCallback(_=>{_&&r(!0)},[]),P=t.useCallback(_=>{let O;_===G?O=o.length===d.length?[]:d.map(te=>te.value):O=o.includes(_)?o.filter($=>$!==_):[...o,_],u(O)},[u,d,o]);return t.useEffect(()=>{if(d.some(({value:_})=>_===G))throw new Error(`Cannot have an option with the value "${G}"`)},[d]),e.jsxs(n.Select.Root,{open:l,value:"",onOpenChange:v,onValueChange:P,disabled:g,size:C,name:f,autoComplete:"off",children:[e.jsx(n.Select.Trigger,{ref:c,color:b,placeholder:o.length>0?p:s,"data-placeholder":o.length>0?void 0:!0,...h}),e.jsxs(n.Select.Content,{color:"gray",variant:"soft",position:"popper",onEscapeKeyDown:w,onPointerDownOutside:w,children:[e.jsx(he,{value:G,label:"Select all",checked:o.length===d.length,size:C}),d.map(_=>e.jsx(he,{..._,checked:o.includes(_.value),size:C},_.value))]})]})})),en={default:"_default_u936h_1"},nn=t.forwardRef(function({className:c,severity:l="primary",icon:r,defaultChecked:s=!1,onCheckedChange:o,...u},d){const g=t.useRef(null),[f,h]=t.useState(u.checked?u.checked:s),[C,b]=t.useState(),y=T(l);t.useLayoutEffect(()=>{var P;const v=d||g;"current"in v&&v.current&&b((P=v.current)==null?void 0:P.querySelector("span.rt-SwitchThumb"))},[d]);const p=t.useCallback(v=>{h(v),o&&o(v)},[o]),w=u.checked?u.checked:f;return e.jsxs(e.Fragment,{children:[e.jsx(n.Switch,{className:m("overmap-switch",c,en.default),ref:d||g,color:y,radius:"full",defaultChecked:s,onCheckedChange:p,...u}),e.jsx(n.Portal,{container:C,asChild:!0,children:r&&"checked"in r?w?r.checked:r.unchecked:r})]})}),tn=t.memo(nn),N={sidebarContent:"_sidebarContent_1onyo_1",right:"_right_1onyo_7",resizeHandle:"_resizeHandle_1onyo_10",left:"_left_1onyo_13",overlay:"_overlay_1onyo_33"},rn=t.forwardRef(function({side:c="left",modal:l=!0,children:r,open:s,containerSelector:o,overlay:u=!0,resizable:d=!0,minWidth:g="300px",maxWidth:f="500px",...h},C){const b=c==="right",y=c==="left",[p,w]=t.useState();return t.useEffect(()=>{const v=o??'[data-is-root-theme="true"]',P=document.querySelector(v);if(P===void 0)throw new Error(`Could not find a container element using the following selector ${v}`);w(P)},[o]),e.jsx(F.Root,{open:s,modal:l,children:e.jsxs(F.Portal,{container:p,children:[u&&e.jsx(F.Overlay,{className:m(N.overlay)}),e.jsx(F.Content,{className:m("overmap-sidebar","rt-DialogContent",N.sidebarContent,{[N.left]:y,[N.right]:b}),ref:C,asChild:!0,...h,children:e.jsx(n.Box,{width:"auto",children:e.jsx(Q.Resizable,{minWidth:g,maxWidth:f,defaultSize:{width:"300px",height:"100%"},enable:{right:d&&y,left:d&&b},handleClasses:{left:N.resizeHandle,right:N.resizeHandle},handleComponent:{right:e.jsx(z.DragHandleDots2Icon,{}),left:e.jsx(z.DragHandleDots2Icon,{})},children:r})})})]})})}),on=t.memo(rn),B={accommodateCharCount:"_accommodateCharCount_sr18k_1",wrapper:"_wrapper_sr18k_5",default:"_default_sr18k_9",noLeftIcon:"_noLeftIcon_sr18k_13",noRightIcon:"_noRightIcon_sr18k_17",charCount:"_charCount_sr18k_21"},ln=t.forwardRef(function({className:c,leftSlot:l,rightSlot:r,size:s="medium",showInputLength:o,value:u,variant:d,severity:g="primary",...f},h){const C=I(s,M),b=T(g),y=o||o===void 0&&f.maxLength!==void 0,p=u!==void 0?u.toString():void 0;return e.jsxs(n.TextField.Root,{className:m(B.wrapper,{[B.accommodateCharCount]:y}),size:C,variant:d,color:b,children:[l&&e.jsx(n.TextField.Slot,{children:l}),e.jsx(n.TextField.Input,{className:m(B.default,c,{[B.noLeftIcon]:!l,[B.noRightIcon]:!r}),ref:h,size:C,variant:d,color:b,...f}),r&&e.jsx(n.TextField.Slot,{children:r}),y&&e.jsx(n.Text,{as:"p",className:B.charCount,size:"1",color:"gray",children:f.maxLength!==void 0?`${p==null?void 0:p.length}/${f.maxLength}`:`${p==null?void 0:p.length}`})]})}),an=t.memo(ln),cn={wrapper:"_wrapper_tmtz0_1"},sn=t.forwardRef(function({className:c,defaultOpen:l=!1,modal:r=!1,content:s,children:o,...u},d){return e.jsxs(n.Popover.Root,{defaultOpen:l,modal:r,children:[e.jsx(n.Popover.Trigger,{children:o}),e.jsx(n.Popover.Content,{ref:d,className:m("overmap-popover",c,cn.wrapper),...u,children:s(n.Popover.Close)})]})}),dn=t.memo(sn),D={wrapper:"_wrapper_1mz2e_1",panelContent:"_panelContent_1mz2e_6",left:"_left_1mz2e_14",right:"_right_1mz2e_18",resizable:"_resizable_1mz2e_23",resizeHandle:"_resizeHandle_1mz2e_28",panelMainContent:"_panelMainContent_1mz2e_48"},Ce=200,A=150,un=t.memo(function({children:c,showLeft:l,leftPanel:r,leftMinWidth:s=Ce,showRight:o,rightPanel:u,rightMinWidth:d=Ce,resizeable:g}){const f=t.useRef(null),h=t.useRef(null),[C,b]=t.useState(0),[y,p]=t.useState(),w=t.useRef(null),[v,P]=t.useState(0),[_,O]=t.useState(),$=t.useCallback((S,x,k)=>(j,_e,me,re)=>{if(!f.current)return;const X=S+re.width;k(f.current.clientWidth-X),x(()=>X)},[]),te=t.useCallback((S,x,k,j)=>$(C,b,O)(S,x,k,j),[$,C]),xn=t.useCallback((S,x,k,j)=>$(v,P,p)(S,x,k,j),[$,v]),V=t.useCallback((S,x,k,j,_e,me,re,X)=>{if(!f.current)return;let K=S;if(K===0&&(K=x,k(K)),me){const U=f.current.clientWidth-K;X(U),_e>U&&(re(U),j(f.current.clientWidth-U))}},[]),kn=t.useCallback(()=>V(v,d,P,O,C,l,b,p),[V,C,d,v,l]),zn=t.useCallback(()=>V(C,s,b,p,v,o,P,O),[V,s,C,v,o]),q=t.useCallback((S,x)=>{f.current&&S&&x(f.current.clientWidth)},[]),jn=t.useCallback(()=>q(l,p),[q,l]),In=t.useCallback(()=>q(o,O),[q,o]),we=t.useCallback(()=>{var S,x,k,j;f.current&&(p(f.current.clientWidth-(((S=w.current)==null?void 0:S.clientWidth)||0)),O(f.current.clientWidth-(((x=h.current)==null?void 0:x.clientWidth)||0)),b(((k=h.current)==null?void 0:k.clientWidth)||0),P(((j=w.current)==null?void 0:j.clientWidth)||0))},[]);t.useEffect(()=>{if(!f.current)return;const S=new ResizeObserver(we);return S.observe(f.current),()=>{S.disconnect()}},[we]);const An=t.useMemo(()=>({entering:{transform:`translateX(-${C}px)`,marginRight:`-${C}px`,transitionProperty:"transform, margin-right",transitionDuration:`${A}ms`,transitionTimingFunction:"linear"},entered:{transform:"translateX(0)",marginRight:0,transitionProperty:"transform, margin-right",transitionDuration:`${A}ms`,transitionTimingFunction:"linear"},exiting:{transform:`translateX(-${C}px)`,marginRight:`-${C}px`,transitionProperty:"transform, margin-right",transitionDuration:`${A}ms`,transitionTimingFunction:"linear"},exited:{},unmounted:{}}),[C]),$n=t.useMemo(()=>({entering:{transform:`translateX(${v}px)`,marginLeft:`${-v}px`,transitionProperty:"transform, margin-left",transitionDuration:`${A}ms`,transitionTimingFunction:"linear"},entered:{transform:"translateX(0)",marginLeft:0,transitionProperty:"transform, margin-left",transitionDuration:`${A}ms`,transitionTimingFunction:"linear"},exiting:{transform:`translateX(${v}px)`,marginLeft:`${-v}px`,transitionProperty:"transform, margin-left",transitionDuration:`${A}ms`,transitionTimingFunction:"linear"},exited:{},unmounted:{}}),[v]);return e.jsxs(n.Flex,{className:D.wrapper,style:{minWidth:`${s+d}px`},ref:f,width:"100%",height:"100%",justify:"center",m:"0",p:"0",children:[e.jsx(ie.Transition,{nodeRef:h,timeout:l?0:A,in:l,unmountOnExit:!0,onEntering:zn,onExited:In,children:S=>e.jsx(n.Box,{ref:h,className:m(D.panelContent,D.left),style:An[S],width:"auto",height:"100%",m:"0",p:"0",children:e.jsx(Q.Resizable,{className:D.resizable,size:{width:C,height:"100%"},onResizeStop:te,enable:{right:(g==null?void 0:g.left)!==void 0?g.left:!0},minWidth:s,maxWidth:y,handleClasses:{right:m(D.resizeHandle,D.left)},handleComponent:{right:e.jsx(z.DragHandleDots2Icon,{height:"14px",width:"14px"})},children:r})})}),e.jsx(n.Box,{className:D.panelMainContent,width:"max-content",children:c}),e.jsx(ie.Transition,{nodeRef:w,timeout:o?0:A,in:o,unmountOnExit:!0,onEntering:kn,onExited:jn,children:S=>e.jsx(n.Box,{ref:w,className:m(D.panelContent,D.right),style:$n[S],width:"auto",height:"100%",m:"0",p:"0",children:e.jsx(Q.Resizable,{className:D.resizable,size:{width:v,height:"100%"},onResizeStop:xn,enable:{left:(g==null?void 0:g.right)!==void 0?g.right:!0},minWidth:d,maxWidth:_,handleClasses:{left:m(D.resizeHandle,D.right)},handleComponent:{left:e.jsx(z.DragHandleDots2Icon,{height:"14px",width:"14px"})},children:u})})})]})}),fn={charCount:"_charCount_17uut_1"},pn=t.forwardRef(function({className:c,showInputLength:l,inputLengthTemplate:r,value:s,severity:o="primary",resize:u,...d},g){const f=T(o),h=T("info"),C=l||l===void 0&&(d.maxLength!==void 0||d.minLength!==void 0),b=s!==void 0?s.toString():"",y=t.useMemo(()=>{if(r){let p=r.replace("{current}",b.length.toString());return d.minLength!==void 0&&(p=p.replace("{min}",d.minLength.toString())),d.maxLength!==void 0&&(p=p.replace("{max}",d.maxLength.toString())),p}return b.length},[r,d.maxLength,d.minLength,b.length]);return e.jsxs(e.Fragment,{children:[e.jsx(n.TextArea,{className:m("overmap-textarea",c),style:{resize:u},ref:g,value:s,color:f,...d}),C&&e.jsx(n.Text,{as:"p",className:fn.charCount,color:h,align:"right",children:y})]})}),gn=t.memo(pn),hn=t.forwardRef(function({loop:c,type:l,rovingFocus:r,value:s,onValueChange:o,defaultValue:u,disabled:d,items:g,className:f,direction:h="row",...C},b){return e.jsx(le.Root,{type:l,className:m("overmap-toggle-group",f),ref:b,value:s,onValueChange:o,disabled:d,orientation:h==="column"?"vertical":"horizontal",loop:c,rovingFocus:r,defaultValue:u,asChild:!0,children:e.jsx(R,{direction:h,...C,children:g.map(({children:y,...p})=>t.createElement(le.Item,{asChild:!0,...p,key:p.value},e.jsx(Z,{className:m("overmap-toggle-group-button"),"aria-label":p.value,variant:p.value===s?"solid":"soft",children:y})))})})}),Cn=t.memo(hn),be={ToastViewport:"_ToastViewport_t8tlv_1",ToastRoot:"_ToastRoot_t8tlv_20",slideIn:"_slideIn_t8tlv_1",swipeOut:"_swipeOut_t8tlv_1"},bn=t.forwardRef(function({title:c,description:l,icon:r,severity:s="primary",size:o,onClose:u,sensitivity:d,...g},f){const[h,C]=t.useState(!0),b=T(s),y=t.useCallback(p=>{!p&&u&&u(),C(p)},[u]);return e.jsx(W.Root,{asChild:!0,ref:f,...g,open:h,type:d,onOpenChange:y,children:e.jsx(n.Callout.Root,{className:be.ToastRoot,variant:"surface",color:b,size:o,children:e.jsxs(n.Flex,{width:"100%",align:"center",gap:"4",justify:"between",children:[e.jsxs(n.Flex,{align:"center",gap:"4",children:[e.jsx(n.Callout.Icon,{children:r||e.jsx(z.InfoCircledIcon,{})}),e.jsxs(n.Flex,{direction:"column",gap:"0",children:[e.jsx(W.Title,{asChild:!0,children:e.jsx(n.Callout.Text,{weight:"medium",children:c})}),e.jsx(W.Description,{asChild:!0,children:e.jsx(n.Callout.Text,{weight:"light",children:l})})]})]}),e.jsx(W.Close,{asChild:!0,children:e.jsx(Z,{"aria-label":"Close",variant:"ghost",size:"small",severity:s,children:e.jsx(z.Cross2Icon,{})})})]})})})}),ye=t.memo(bn),ne=t.createContext({}),yn=()=>{const i=t.useContext(ne);if(!i)throw new Error("useToast must be used within a ToastProvider");return i},vn=240/60,ve=5e3,wn=i=>{if(i.duration&&i.duration>=ve)return i.duration;const c=i.severity==="danger"?1.5:1,l=i.description.split(" ").length+i.title.split(" ").length;return(ve+l/vn)*c};a.unsafeShowToast=void 0;const _n=t.memo(function({children:c,className:l,hotkey:r,...s}){const[o,u]=t.useState([]),d=t.useCallback((f,h,C)=>{u(b=>{const y=b.find(p=>p.id===f);return y&&h===0&&clearTimeout(y.timeout),b.filter(p=>p.id!==f)}),C&&C()},[]),g=t.useMemo(()=>{let f=0;const h=w=>{const v=wn(w),P=f.toString();f+=1;const _=setTimeout(()=>d(P,1,w.onClose),v);u(O=>[...O,{...w,timeout:_,duration:v,id:P}])},C=w=>h({...w,severity:"primary"}),b=w=>h({...w,severity:"success"}),y=w=>h({...w,severity:"danger"}),p=w=>h({...w,severity:"info"});return a.unsafeShowToast=h,{showToast:h,showPrimary:C,showSuccess:b,showError:y,showInfo:p}},[d]);return t.useEffect(()=>()=>{for(const{timeout:f}of o)clearTimeout(f)},[]),e.jsx(ne.Provider,{value:g,children:e.jsxs(Y.ToastProvider,{...s,children:[c,e.jsx(Y.ToastViewport,{className:m(l,be.ToastViewport),hotkey:r}),o.map(({id:f,onClose:h,...C})=>e.jsx(ye,{...C,onClose:()=>d(f,0,h)},f))]})})}),mn={noWrap:"_noWrap_1wpa5_1"},Sn=t.memo(t.forwardRef(({className:i,noWrap:c,severity:l,as:r,...s},o)=>{const u=T(l);return e.jsx(n.Text,{ref:o,as:r,className:m(i,{[mn.noWrap]:c}),color:u,...s})})),pt="",Pn=t.memo(t.forwardRef((i,c)=>{const{panelBackground:l="solid",radius:r="full",...s}=i;return e.jsx(n.Theme,{panelBackground:l,radius:r,ref:c,...s})})),Tn={1:"max-content",2:"max-content",3:"max-content",4:"100%"},On=t.forwardRef(function({severity:c="info",weight:l="light",gap:r="1",text:s,orientation:o="horizontal",size:u,...d},g){const f=I(u,Tn),h=T(c);return e.jsxs(n.Flex,{ref:g,width:o==="horizontal"?f:"max-content",height:o==="vertical"?f:"max-content",direction:o==="vertical"?"column":"row",align:"center",gap:r,children:[e.jsx(n.Separator,{size:u,orientation:o,color:h,...d}),s&&e.jsxs(e.Fragment,{children:[e.jsx(n.Text,{as:"span",size:"1",weight:l,color:h,children:s}),e.jsx(n.Separator,{size:u,orientation:o,color:h,...d})]})]})}),Dn=t.memo(On);Object.defineProperty(a,"AccessibleIcon",{enumerable:!0,get:()=>n.AccessibleIcon}),Object.defineProperty(a,"AspectRatio",{enumerable:!0,get:()=>n.AspectRatio}),Object.defineProperty(a,"Avatar",{enumerable:!0,get:()=>n.Avatar}),Object.defineProperty(a,"Blockquote",{enumerable:!0,get:()=>n.Blockquote}),Object.defineProperty(a,"Box",{enumerable:!0,get:()=>n.Box}),Object.defineProperty(a,"Callout",{enumerable:!0,get:()=>n.Callout}),Object.defineProperty(a,"Card",{enumerable:!0,get:()=>n.Card}),Object.defineProperty(a,"Checkbox",{enumerable:!0,get:()=>n.Checkbox}),Object.defineProperty(a,"Code",{enumerable:!0,get:()=>n.Code}),Object.defineProperty(a,"Container",{enumerable:!0,get:()=>n.Container}),Object.defineProperty(a,"ContextMenu",{enumerable:!0,get:()=>n.ContextMenu}),Object.defineProperty(a,"Em",{enumerable:!0,get:()=>n.Em}),Object.defineProperty(a,"Flex",{enumerable:!0,get:()=>n.Flex}),Object.defineProperty(a,"Grid",{enumerable:!0,get:()=>n.Grid}),Object.defineProperty(a,"Heading",{enumerable:!0,get:()=>n.Heading}),Object.defineProperty(a,"HoverCard",{enumerable:!0,get:()=>n.HoverCard}),Object.defineProperty(a,"Inset",{enumerable:!0,get:()=>n.Inset}),Object.defineProperty(a,"Kbd",{enumerable:!0,get:()=>n.Kbd}),Object.defineProperty(a,"Link",{enumerable:!0,get:()=>n.Link}),Object.defineProperty(a,"Portal",{enumerable:!0,get:()=>n.Portal}),Object.defineProperty(a,"Quote",{enumerable:!0,get:()=>n.Quote}),Object.defineProperty(a,"RadioGroup",{enumerable:!0,get:()=>n.RadioGroup}),Object.defineProperty(a,"ScrollArea",{enumerable:!0,get:()=>n.ScrollArea}),Object.defineProperty(a,"Section",{enumerable:!0,get:()=>n.Section}),Object.defineProperty(a,"Slider",{enumerable:!0,get:()=>n.Slider}),Object.defineProperty(a,"Slot",{enumerable:!0,get:()=>n.Slot}),Object.defineProperty(a,"Strong",{enumerable:!0,get:()=>n.Strong}),Object.defineProperty(a,"Table",{enumerable:!0,get:()=>n.Table}),Object.defineProperty(a,"Tabs",{enumerable:!0,get:()=>n.Tabs}),Object.defineProperty(a,"TextField",{enumerable:!0,get:()=>n.TextField}),Object.defineProperty(a,"Theme",{enumerable:!0,get:()=>n.Theme}),Object.defineProperty(a,"Tooltip",{enumerable:!0,get:()=>n.Tooltip}),Object.defineProperty(a,"VisuallyHidden",{enumerable:!0,get:()=>n.VisuallyHidden}),Object.defineProperty(a,"updateThemeAppearanceClass",{enumerable:!0,get:()=>n.updateThemeAppearanceClass}),Object.defineProperty(a,"useThemeContext",{enumerable:!0,get:()=>n.useThemeContext}),a.AlertDialog=fe,a.AlertDialogContent=ee,a.AlertDialogProvider=Ve,a.Badge=xe,a.Button=H,a.ButtonGroup=R,a.ButtonList=Le,a.DefaultTheme=Pn,a.Dialog=We,a.DropdownMenu=Ye,a.IconButton=Z,a.Input=an,a.LeftAndRightPanels=un,a.MultiSelect=Re,a.Popover=dn,a.Select=Ze,a.Separator=Dn,a.Sidebar=on,a.Switch=tn,a.Text=Sn,a.TextArea=gn,a.Toast=ye,a.ToastContext=ne,a.ToastProvider=_n,a.ToggleGroup=Cn,a.divButtonProps=ke,a.useAlertDialog=pe,a.useDiscardAlertDialog=qe,a.useSeverityColor=T,a.useToast=yn,Object.keys(oe).forEach(i=>{i!=="default"&&!Object.prototype.hasOwnProperty.call(a,i)&&Object.defineProperty(a,i,{enumerable:!0,get:()=>oe[i]})}),Object.keys(z).forEach(i=>{i!=="default"&&!Object.prototype.hasOwnProperty.call(a,i)&&Object.defineProperty(a,i,{enumerable:!0,get:()=>z[i]})}),Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})});
|
|
6
6
|
//# sourceMappingURL=blocks.umd.cjs.map
|