efficient-shell 11.11.0 → 11.12.0
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/{Browser-NRGJ53ST.js → Browser-LPGSKKLU.js} +14 -14
- package/dist/Calculator-XUV5JV3O.js +29 -0
- package/dist/{CurrencyConverter-CJQMDBQW.js → CurrencyConverter-N2HQT7IR.js} +9 -9
- package/dist/{Documents-FIGKS36O.js → Documents-IRPS3N5T.js} +23 -23
- package/dist/Files-VN2IOPHX.js +88 -0
- package/dist/{Notepad-2XW63REV.js → Notepad-JCWNOQET.js} +9 -9
- package/dist/{PomodoroTimer-Y5GQX37J.js → PomodoroTimer-356JUEM3.js} +21 -21
- package/dist/{Preview-K7KDM4XK.js → Preview-X7XNDI6X.js} +23 -23
- package/dist/Sidebar-OZMJNAXN.js +44 -0
- package/dist/{Spreadsheet-RQE4OCEK.js → Spreadsheet-YQOVGIU7.js} +33 -33
- package/dist/{Stock-IHAG62QV.js → Stock-2XOOZNRR.js} +3 -3
- package/dist/{Weather-EQDFEBIH.js → Weather-ZDU2722T.js} +16 -16
- package/dist/{WorldClock-VQG7G2Z2.js → WorldClock-PQGERFCH.js} +5 -5
- package/dist/ai/index.js +91 -91
- package/dist/apps/index.d.ts +21 -2
- package/dist/apps/index.js +1 -1
- package/dist/bin/media-host-check.js +1 -1
- package/dist/bin/ui-check.js +1 -1
- package/dist/charts/BoxPlotChart.js +1 -1
- package/dist/charts/CandlestickChart.js +1 -1
- package/dist/charts/CartesianPlot.js +1 -1
- package/dist/charts/ChartTooltip.js +1 -1
- package/dist/charts/ChordChart.js +1 -1
- package/dist/charts/ColumnChart.js +1 -1
- package/dist/charts/FunnelChart.js +1 -1
- package/dist/charts/HeatmapChart.js +1 -1
- package/dist/charts/HistogramChart.js +1 -1
- package/dist/charts/PieChart.js +1 -1
- package/dist/charts/RadarChart.js +1 -1
- package/dist/charts/RadialBarChart.js +1 -1
- package/dist/charts/RangeChart.js +1 -1
- package/dist/charts/SankeyChart.js +1 -1
- package/dist/charts/ScatterChart.js +1 -1
- package/dist/charts/SpecChart.js +1 -1
- package/dist/charts/SunburstChart.js +1 -1
- package/dist/charts/TimeSeriesChart.js +1 -1
- package/dist/charts/TreemapChart.js +1 -1
- package/dist/charts/WaterfallChart.js +1 -1
- package/dist/{chunk-QOJ2UNS5.js → chunk-34AHNPW7.js} +1 -1
- package/dist/{chunk-WDQI3FV6.js → chunk-36VIGB6J.js} +6 -6
- package/dist/{chunk-PDXOGPWH.js → chunk-3N2MNOV5.js} +1 -1
- package/dist/{chunk-3JCOD5L2.js → chunk-4APQHXLI.js} +2 -2
- package/dist/{chunk-IEOCUEJK.js → chunk-4EVYK6DR.js} +7 -7
- package/dist/{chunk-7IVTGOGM.js → chunk-4JJ5WT4D.js} +1 -1
- package/dist/{chunk-3ZRYKZGI.js → chunk-4TB4CSLB.js} +4 -4
- package/dist/{chunk-KZEIQO3V.js → chunk-5IESW4PM.js} +5 -5
- package/dist/{chunk-EYPKBJYG.js → chunk-5PP435FL.js} +1 -1
- package/dist/chunk-5W3U3EVG.js +7 -0
- package/dist/chunk-64KZ74CS.js +8 -0
- package/dist/{chunk-QAIMZN7M.js → chunk-6ETRVCMH.js} +13 -13
- package/dist/{chunk-SGBR443F.js → chunk-6S6FJJKP.js} +6 -6
- package/dist/{chunk-M57KX3OM.js → chunk-6UJYRGWY.js} +1 -1
- package/dist/{chunk-K6D7OSKZ.js → chunk-6WPKLF6G.js} +14 -14
- package/dist/{chunk-UWJNQH2X.js → chunk-7A2Y3W55.js} +1 -1
- package/dist/{chunk-ZOQXFS3R.js → chunk-7FCIFHO7.js} +1 -1
- package/dist/chunk-7TVGP2SX.js +8 -0
- package/dist/{chunk-2HAJ33HM.js → chunk-AD27M3ZH.js} +2 -2
- package/dist/{chunk-AQGIK2CV.js → chunk-AO7XAAGG.js} +1 -1
- package/dist/chunk-AQ7CNPEE.js +15 -0
- package/dist/chunk-BOJEZKYS.js +14 -0
- package/dist/{chunk-3X2W7R5B.js → chunk-BPJ3CQH7.js} +9 -9
- package/dist/chunk-CGA6RTVI.js +9 -0
- package/dist/{chunk-CT7AU2TA.js → chunk-CR3YDABU.js} +1 -1
- package/dist/{chunk-TXKTITMF.js → chunk-CR42APAY.js} +5 -5
- package/dist/{chunk-MQE2FBJU.js → chunk-CXZ7PHHF.js} +5 -5
- package/dist/{chunk-V64CJHMY.js → chunk-D5MN3LXC.js} +19 -19
- package/dist/{chunk-6LK2BBCC.js → chunk-DMBA6KYQ.js} +5 -5
- package/dist/{chunk-ALJS3SYS.js → chunk-DXKXETTT.js} +1 -1
- package/dist/chunk-EBGOENC3.js +3 -0
- package/dist/{chunk-6DQANKTL.js → chunk-ELIWGIR7.js} +7 -7
- package/dist/chunk-EOVXFXVV.js +2 -0
- package/dist/{chunk-CSLMWGFS.js → chunk-EQ72AP5E.js} +1 -1
- package/dist/chunk-ES2LUEPN.js +22 -0
- package/dist/{chunk-62BDGAML.js → chunk-F33L4J3P.js} +6 -6
- package/dist/{chunk-QEDVXD3L.js → chunk-FD6XZRWA.js} +1 -1
- package/dist/{chunk-X2DUOIJP.js → chunk-FEUTN4GK.js} +1 -1
- package/dist/{chunk-JPNAEN53.js → chunk-FZM3ZPW3.js} +1 -1
- package/dist/chunk-FZWSP7KJ.js +28 -0
- package/dist/chunk-G3FHFWC2.js +4 -0
- package/dist/{chunk-42TLGG33.js → chunk-GJFTO7D4.js} +1 -1
- package/dist/{chunk-VEGZVUHE.js → chunk-GJVGGYQ2.js} +1 -1
- package/dist/{chunk-LGTYPLJM.js → chunk-GS74BABV.js} +3 -3
- package/dist/{chunk-LXOX5FGH.js → chunk-HGMQOHMK.js} +2 -2
- package/dist/{chunk-CG5X5ZLV.js → chunk-HJM4LSMM.js} +1 -1
- package/dist/{chunk-E3EHHR73.js → chunk-HOEEFFE3.js} +9 -9
- package/dist/{chunk-32EKHIAZ.js → chunk-HT7SOOMD.js} +12 -12
- package/dist/{chunk-R72ZKZDP.js → chunk-I5GDAQYL.js} +2 -2
- package/dist/{chunk-TA4JGC5C.js → chunk-IFWXC323.js} +1 -1
- package/dist/{chunk-5B4GRLAA.js → chunk-IJ6HZXZY.js} +1 -1
- package/dist/{chunk-UG42KUCT.js → chunk-IKKR2TYY.js} +4 -4
- package/dist/{chunk-OXCFRH33.js → chunk-JFCCI5L2.js} +1 -1
- package/dist/{chunk-CLAKVFOB.js → chunk-JGWUSJDD.js} +31 -31
- package/dist/{chunk-I5XNADZ3.js → chunk-JJLAI6GL.js} +8 -8
- package/dist/{chunk-F636NDAU.js → chunk-K3IUUZO5.js} +7 -7
- package/dist/{chunk-ZOQVYSTB.js → chunk-KV4QPU6U.js} +18 -18
- package/dist/{chunk-RNBC6V2D.js → chunk-L2IPWMLI.js} +3 -3
- package/dist/chunk-L74WV4RJ.js +6 -0
- package/dist/{chunk-VCMHBUKI.js → chunk-LE5LWALR.js} +1 -1
- package/dist/chunk-LJJ7FDAQ.js +6 -0
- package/dist/{chunk-3OHADZYV.js → chunk-LLSLY6BT.js} +1 -1
- package/dist/{chunk-CDQUOCXO.js → chunk-LP45EML2.js} +1 -1
- package/dist/{chunk-HRG4FYVU.js → chunk-LWFH5QTJ.js} +1 -1
- package/dist/{chunk-Q7DVGUML.js → chunk-LXBBJNBQ.js} +1 -1
- package/dist/{chunk-SWJXWDKX.js → chunk-M4AOQYSP.js} +1 -1
- package/dist/{chunk-RQBQETXQ.js → chunk-MD6EPKOR.js} +8 -8
- package/dist/{chunk-S43DAIIB.js → chunk-MFP5KOQW.js} +5 -5
- package/dist/{chunk-RQDVAUXD.js → chunk-N5KO2IHG.js} +4 -4
- package/dist/{chunk-IUMFOSFJ.js → chunk-N75MPMLD.js} +3 -3
- package/dist/{chunk-QQ2LDC6C.js → chunk-NJN5IKWO.js} +1 -1
- package/dist/{chunk-C3UY34DC.js → chunk-NPT6EXHK.js} +4 -4
- package/dist/{chunk-57WQVUBX.js → chunk-OCWWEHNR.js} +2 -2
- package/dist/{chunk-PVOTOUJG.js → chunk-OMROEVOP.js} +1 -1
- package/dist/{chunk-VPEH3THH.js → chunk-P75N466Z.js} +3 -3
- package/dist/{chunk-AHITTM6W.js → chunk-PTVTNCD6.js} +1 -1
- package/dist/chunk-Q7UTGO73.js +11 -0
- package/dist/{chunk-3VR5BOD4.js → chunk-QDL2FNP7.js} +2 -2
- package/dist/{chunk-ATKFIHDP.js → chunk-RBAC26J7.js} +4 -4
- package/dist/{chunk-SYZLS2JA.js → chunk-RDKIYORS.js} +1 -1
- package/dist/{chunk-63545Z3N.js → chunk-RXVFAFEB.js} +1 -1
- package/dist/{chunk-JQBVSPF5.js → chunk-S4FPYCUU.js} +3 -3
- package/dist/chunk-SI33IE7G.js +2 -0
- package/dist/{chunk-ESWR7YNY.js → chunk-SPMD7UZO.js} +3 -3
- package/dist/{chunk-A4YTWDKD.js → chunk-SSM6P43S.js} +1 -1
- package/dist/{chunk-XWFLIGDQ.js → chunk-TE6R53YD.js} +1 -1
- package/dist/{chunk-EV7VAXMO.js → chunk-TTQJQKCE.js} +9 -9
- package/dist/chunk-UBQUXUD2.js +7 -0
- package/dist/{chunk-YUAF3FDE.js → chunk-UCAMOW53.js} +4 -4
- package/dist/{chunk-JG26ICX6.js → chunk-UEWB6IOD.js} +2 -2
- package/dist/{chunk-KKJ55GUZ.js → chunk-UHGAT5MH.js} +1 -1
- package/dist/{chunk-PZHO4FEN.js → chunk-UOGF37Z4.js} +1 -1
- package/dist/chunk-UZTKBA7Z.js +13 -0
- package/dist/{chunk-6LITLCVV.js → chunk-VEATEVMV.js} +3 -3
- package/dist/{chunk-K6LW2QLI.js → chunk-VIDT4JLR.js} +1 -1
- package/dist/{chunk-CJH2BGXY.js → chunk-WGLHB6WE.js} +1 -1
- package/dist/chunk-WZJPASST.js +6 -0
- package/dist/{chunk-B2SLXCMY.js → chunk-XOH6QERF.js} +8 -8
- package/dist/chunk-YXSGMPNW.js +1 -0
- package/dist/{chunk-7R23EKON.js → chunk-ZA2RBNRA.js} +1 -1
- package/dist/{chunk-BDUXF7BT.js → chunk-ZHS2VQU7.js} +3 -3
- package/dist/{chunk-7HLBVMMQ.js → chunk-ZMC25LRC.js} +1 -1
- package/dist/{chunk-DANLBFBD.js → chunk-ZRLWE3JM.js} +1 -1
- package/dist/data/DataTable.js +1 -1
- package/dist/data/EntityList.js +1 -1
- package/dist/data/ListLoadError.js +1 -1
- package/dist/data/ResizableTable.js +1 -1
- package/dist/forms/AlignmentGrid.js +1 -1
- package/dist/forms/BorderInput.js +1 -1
- package/dist/forms/BrandAssetEditor.js +1 -1
- package/dist/forms/Button.js +1 -1
- package/dist/forms/ColorPicker.js +1 -1
- package/dist/forms/ComposerAttachments.js +1 -1
- package/dist/forms/CornersInput.js +1 -1
- package/dist/forms/DateRangePicker.js +1 -1
- package/dist/forms/DisplayChips.js +1 -1
- package/dist/forms/FilePicker.js +1 -1
- package/dist/forms/IconButton.js +1 -1
- package/dist/forms/IconPicker.js +1 -1
- package/dist/forms/Input.js +1 -1
- package/dist/forms/InputNumber.js +1 -1
- package/dist/forms/LinkPicker.js +1 -1
- package/dist/forms/MediaLibrary.js +1 -1
- package/dist/forms/MediaUploadField.js +1 -1
- package/dist/forms/MediaUploadGrid.js +1 -1
- package/dist/forms/MediaUsedInList.js +1 -1
- package/dist/forms/NumericKeypad.js +1 -1
- package/dist/forms/PictureTiles.js +1 -1
- package/dist/forms/PositionInput.js +1 -1
- package/dist/forms/RenameField.js +1 -1
- package/dist/forms/Segmented.js +1 -1
- package/dist/forms/Select.js +1 -1
- package/dist/forms/SidesInput.js +1 -1
- package/dist/forms/Slider.js +1 -1
- package/dist/forms/Snippet.js +1 -1
- package/dist/forms/SplitButton.js +1 -1
- package/dist/forms/TagInput.js +1 -1
- package/dist/forms/TextToolbar.js +1 -1
- package/dist/forms/WidthsBar.js +1 -1
- package/dist/index.js +378 -378
- package/dist/map/index.js +3 -3
- package/dist/page-tabs/index.js +5 -5
- package/dist/shell/AppUpdateBanner.js +1 -1
- package/dist/shell/ColoredBadge.js +1 -1
- package/dist/shell/ContextMenu.js +1 -1
- package/dist/shell/DropdownMenu.js +1 -1
- package/dist/shell/EditableGrid.js +1 -1
- package/dist/shell/GlobalSearch.js +1 -1
- package/dist/shell/HelpCenter.js +1 -1
- package/dist/shell/IconRail.js +1 -1
- package/dist/shell/ImageLightbox.js +1 -1
- package/dist/shell/ItemCount.js +1 -1
- package/dist/shell/LanguageSelect.js +1 -1
- package/dist/shell/Markdown.js +1 -1
- package/dist/shell/PopupMenu.js +1 -1
- package/dist/shell/ResizeHandle.js +1 -1
- package/dist/shell/SearchableSelect.js +1 -1
- package/dist/shell/SettingReset.js +1 -1
- package/dist/shell/SidebarLayout.js +1 -1
- package/dist/shell/SidebarNav.js +1 -1
- package/dist/shell/SortableList.js +1 -1
- package/dist/shell/StatusBadge.js +1 -1
- package/dist/shell/Tabs.js +1 -1
- package/dist/shell/Tooltip.js +1 -1
- package/dist/shell/TopNav.js +1 -1
- package/dist/shell/TransferProgress.js +1 -1
- package/dist/shell/Tree.js +1 -1
- package/dist/telemetry/index.js +1 -1
- package/dist/templates/AuthScreen.js +1 -1
- package/dist/templates/ChatTemplate.js +1 -1
- package/dist/templates/CheckoutTemplate.js +1 -1
- package/dist/templates/DashboardTemplate.js +1 -1
- package/dist/templates/DataTablePage.js +1 -1
- package/dist/templates/EmailTemplate.js +1 -1
- package/dist/templates/ErrorBoundary.js +1 -1
- package/dist/templates/FormLayoutPage.js +1 -1
- package/dist/templates/GalleryTemplate.js +1 -1
- package/dist/ui/index.js +1 -1
- package/dist/version.js +1 -1
- package/package.json +1 -1
- package/dist/Calculator-YZEGVEQ7.js +0 -29
- package/dist/Files-FPNJ46XY.js +0 -88
- package/dist/Sidebar-QP5Y7RBV.js +0 -44
- package/dist/chunk-2EPAXWZZ.js +0 -14
- package/dist/chunk-6FIYG7IH.js +0 -28
- package/dist/chunk-6R32KKIS.js +0 -22
- package/dist/chunk-7DI3VQCF.js +0 -2
- package/dist/chunk-B2MD232O.js +0 -6
- package/dist/chunk-EC22ACQZ.js +0 -11
- package/dist/chunk-FJBJUFD7.js +0 -4
- package/dist/chunk-GO6HU2O3.js +0 -7
- package/dist/chunk-H56TNUV4.js +0 -1
- package/dist/chunk-IGQZANYE.js +0 -15
- package/dist/chunk-MQ445O4X.js +0 -6
- package/dist/chunk-NMTS2L2B.js +0 -8
- package/dist/chunk-ODQYWMDF.js +0 -3
- package/dist/chunk-OPZXVXX5.js +0 -7
- package/dist/chunk-OZM6DE7A.js +0 -8
- package/dist/chunk-PMA6DZ4Q.js +0 -6
- package/dist/chunk-SCZUDGRZ.js +0 -2
- package/dist/chunk-SUYQ7QYB.js +0 -13
- package/dist/chunk-VEZHFONL.js +0 -9
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import{computeMaximizedBox as e,isSidebarStripReserved as t,boxFillsWorkArea as n,readAlwaysMaximizedFlag as r,WORK_AREA_CHANGED_EVENT as o,scrollerIsFluid as i,growBoxToWidth as a,widthToFit as s,navIcons as l}from"./chunk-4LXCCZDM.js";import{ROW_HEIGHTS as c}from"./chunk-AW7TOB6N.js";import{reportBoundaryError as u}from"./chunk-KNUR2UEG.js";import{isStaleChunkError as d}from"./chunk-JDCM2VHG.js";import{Result as h}from"./chunk-PMKBWDXO.js";import{CMD_Z as m,CMD_SHIFT_Z as p}from"./chunk-ZDMZM7HD.js";import{CopyButton as f}from"./chunk-OLJUPBY4.js";import{confirm as w}from"./chunk-2XOH3NJZ.js";import{ItemCount as y}from"./chunk-
|
|
1
|
+
import{computeMaximizedBox as e,isSidebarStripReserved as t,boxFillsWorkArea as n,readAlwaysMaximizedFlag as r,WORK_AREA_CHANGED_EVENT as o,scrollerIsFluid as i,growBoxToWidth as a,widthToFit as s,navIcons as l}from"./chunk-4LXCCZDM.js";import{ROW_HEIGHTS as c}from"./chunk-AW7TOB6N.js";import{reportBoundaryError as u}from"./chunk-KNUR2UEG.js";import{isStaleChunkError as d}from"./chunk-JDCM2VHG.js";import{Result as h}from"./chunk-PMKBWDXO.js";import{CMD_Z as m,CMD_SHIFT_Z as p}from"./chunk-ZDMZM7HD.js";import{CopyButton as f}from"./chunk-OLJUPBY4.js";import{confirm as w}from"./chunk-2XOH3NJZ.js";import{ItemCount as y}from"./chunk-3N2MNOV5.js";import{isInOverlayOver as g}from"./chunk-3DVNXNTF.js";import{dialogA11y as b}from"./chunk-VWGWZY7A.js";import{ColoredBadge as v}from"./chunk-CR3YDABU.js";import{LoadingSpinner as x}from"./chunk-3PZI2C4R.js";import{useShellAuth as k}from"./chunk-2QY5BJLA.js";import{useIsMobile as E,useIsPhone as C}from"./chunk-UGTRSRIW.js";import{useShellPrefs as M}from"./chunk-KC3EX26K.js";import{activationOrder as N,activeListeners as S,ModalActionsContext as L,subscribeActive as T,getActiveModalId as z,KEY_ACTIVATED_SELECTOR as A}from"./chunk-F3ZOO23R.js";import{StatusBadge as D}from"./chunk-FZM3ZPW3.js";import{focusableIn as P}from"./chunk-CDAJKLGL.js";import{PopupMenu as I,PopupMenuItem as W,PopupMenuDivider as K,PopupMenuLabel as R}from"./chunk-4TB4CSLB.js";import{Button_default as O}from"./chunk-EOVXFXVV.js";import{Icon as $}from"./chunk-7V32O5NF.js";import{LoadingSpinner as j}from"./chunk-R2VKEMZH.js";import{Z_LAYERS as F}from"./chunk-62LW225J.js";import{shellHttp as q,isShellHttpConfigured as B}from"./chunk-STKJA4PV.js";import{runEscapeInterceptors as H}from"./chunk-TWVUQUUD.js";import{useShellStrings as U}from"./chunk-5YP7MFPK.js";import{createContext as Y,useContext as X,Component as V,useLayoutEffect as J,useRef as _,useEffect as G,useState as Z,useSyncExternalStore as Q,useCallback as ee,isValidElement as te,Fragment as ne,Children as re,cloneElement as oe,useMemo as ie,useId as ae,useReducer as se,Suspense as le}from"react";import{jsxs as ce,jsx as ue,Fragment as de}from"react/jsx-runtime";import{createPortal as he}from"react-dom";import{useLocation as me}from"react-router-dom";import{useQueryClient as pe,useQuery as fe}from"@tanstack/react-query";function we(e){return"component"in e}function ye(e){return"endpoint"in e}var ge={};function be(e){ge=e}var ve=new Proxy({},{get:(e,t)=>ge[t],has:(e,t)=>t in ge,ownKeys:()=>Object.keys(ge),getOwnPropertyDescriptor(e,t){if(t in ge)return{configurable:!0,enumerable:!0,value:ge[t]}}});function xe(){return B()}var ke=q,Ee=Y(null);function Ce(){return X(Ee)?.pageSearch??""}var Me=null,Ne=/* @__PURE__ */new Set;function Se(e){Me!==e&&(Me=e,Ne.forEach(e=>e()))}function Le(){return Me}function Te(e){return Ne.add(e),()=>{Ne.delete(e)}}var ze=null;function Ae(e){ze=e}function De({error:e,onReload:t}){const n=d(e);/* @__PURE__ */
|
|
2
2
|
return ce("div",{className:"flex-1 flex flex-col items-center justify-center gap-3 px-6 py-12 text-center",children:[
|
|
3
3
|
/* @__PURE__ */ue($,{name:"warning",className:"h-8 w-8 text-amber-500",strokeWidth:1.5}),
|
|
4
4
|
/* @__PURE__ */ce("div",{className:"min-w-0",children:[
|
|
5
5
|
/* @__PURE__ */ue("p",{className:"text-sm font-medium text-gray-700",children:n?"This window needs the latest version of the app":"This window crashed"}),
|
|
6
6
|
/* @__PURE__ */ue("p",{className:"mt-1 text-xs text-gray-400 max-w-sm break-words",children:n?"A new version was deployed while this tab was open. Reload the page to pick it up.":e.message||String(e)})]}),
|
|
7
|
-
/* @__PURE__ */ue("button",{type:"button",onClick:n?()=>window.location.reload():t,className:"bg-blue-600 hover:bg-blue-700 text-white px-4 py-2 text-sm font-medium rounded-lg",children:n?"Reload page":"Reload window"})]})}var Pe=class extends V{state={error:null};static getDerivedStateFromError(e){return{error:e instanceof Error?e:new Error(String(e))}}componentDidCatch(e,t){console.error("[efficient-shell] window content crashed:",e,t.componentStack),u(e)}reset=()=>this.setState({error:null});render(){const{error:e}=this.state;return e?this.props.fallback?this.props.fallback(e,this.reset):/* @__PURE__ */ue(De,{error:e,onReload:this.reset}):this.props.children}},Ie=Y(null),
|
|
7
|
+
/* @__PURE__ */ue("button",{type:"button",onClick:n?()=>window.location.reload():t,className:"bg-blue-600 hover:bg-blue-700 text-white px-4 py-2 text-sm font-medium rounded-lg",children:n?"Reload page":"Reload window"})]})}var Pe=class extends V{state={error:null};static getDerivedStateFromError(e){return{error:e instanceof Error?e:new Error(String(e))}}componentDidCatch(e,t){console.error("[efficient-shell] window content crashed:",e,t.componentStack),u(e)}reset=()=>this.setState({error:null});render(){const{error:e}=this.state;return e?this.props.fallback?this.props.fallback(e,this.reset):/* @__PURE__ */ue(De,{error:e,onReload:this.reset}):this.props.children}},Ie=Y(null),We="text-xs text-gray-500 hover:text-gray-700 disabled:opacity-40 disabled:hover:text-gray-500 disabled:cursor-default";function Ke({className:e="",auto:t=!1}){const n=X(Ie),r=U().undo,o=n?.claimOwnMount;if(J(()=>{if(!t&&o)return o(!0),()=>o(!1)},[t,o]),!n||!n.enabled)return null;const{undo:i,redo:a,canUndo:s,canRedo:l,undoLabel:c,redoLabel:u}=n;/* @__PURE__ */
|
|
8
8
|
return ce("div",{className:`flex items-center gap-2 ${e}`,"data-undo-controls":t?"shell":"form",children:[
|
|
9
|
-
/* @__PURE__ */ue("button",{type:"button",onClick:i,disabled:!s,title:s?r.undoStep(c??"",m):r.nothingToUndo,className:
|
|
10
|
-
/* @__PURE__ */ue("button",{type:"button",onClick:a,disabled:!l,title:l?r.redoStep(u??"",p):r.nothingToRedo,className:
|
|
9
|
+
/* @__PURE__ */ue("button",{type:"button",onClick:i,disabled:!s,title:s?r.undoStep(c??"",m):r.nothingToUndo,className:We,children:r.undo}),
|
|
10
|
+
/* @__PURE__ */ue("button",{type:"button",onClick:a,disabled:!l,title:l?r.redoStep(u??"",p):r.nothingToRedo,className:We,children:r.redo})]})}var Re=/* @__PURE__ */new Set([408,429]);function Oe(e){const t=e?.response?.status;return"number"==typeof t?t:void 0}function $e(e){const t=Oe(e);return null!=t&&(t>=400&&t<500&&!Re.has(t))}function je(e,t){return!$e(t)&&e<3}function Fe(e){if("page"!==e.type)return!0;const t=e.route?ve[e.route]:void 0;if(!t||!we(t))return!0;const n=t;return!n.widget&&!n.utility}function qe(e){const t=e.route?ve[e.route]:void 0;if(!t||!we(t))return;const n=t;return n.taskbarGroup?n.taskbarGroup:{key:e.route,label:n.label,icon:e.route}}var Be=(e,t)=>!!t&&"page"===e.type&&e.route===t;var He="flex-1 min-h-0";function Ue(){const e=U().record;/* @__PURE__ */
|
|
11
11
|
return ue(j,{label:e.loading,padding:"",className:He})}function Ye(e){return e??void 0}function Xe({isPending:e,isFetching:t,enabled:n=!0,error:r,onRetry:o}){const i=U().record;if(t||e&&n)/* @__PURE__ */return ue(Ue,{});if(r){const e=Oe(r);if(401===e)/* @__PURE__ */
|
|
12
12
|
return ue(h,{status:"warning",title:i.signInRequired,subTitle:i.signInBody,className:He});if(403===e)/* @__PURE__ */
|
|
13
13
|
return ue(h,{status:"403",className:He});if(404===e||410===e)/* @__PURE__ */
|
|
@@ -29,23 +29,23 @@ return ce("button",{onClick:()=>o(r.id),onMouseEnter:t=>{return n=e.items,r=t.cu
|
|
|
29
29
|
/* @__PURE__ */ue("div",{className:"flex-1"}),k.length>=2&&/* @__PURE__ */ce("button",{onClick:n,title:i.taskbar.expose,className:"flex items-center gap-1 rounded px-2 py-1 text-2xs font-medium text-blue-600 border border-blue-300 hover:bg-accent-tint transition-colors shrink-0",children:[
|
|
30
30
|
/* @__PURE__ */ue($,{name:"grid",className:"h-3 w-3",strokeWidth:2}),"Exposé"]}),g&&/* @__PURE__ */ce(I,{portal:!0,minWidth:200,style:Et(g.x,g.y),onClose:()=>b(null),children:[
|
|
31
31
|
/* @__PURE__ */ue(R,{children:g.label}),
|
|
32
|
-
/* @__PURE__ */ce(
|
|
32
|
+
/* @__PURE__ */ce(W,{onClick:()=>{b(null),g.items.forEach(e=>function(e){const t=On.get(e);t&&tr(t)}(e.id))},children:[
|
|
33
33
|
/* @__PURE__ */ue($,{name:"remove",className:"h-4 w-4",strokeWidth:1.5}),i.taskbar.minimizeAllWindows]}),
|
|
34
|
-
/* @__PURE__ */ce(
|
|
34
|
+
/* @__PURE__ */ce(W,{onClick:()=>{b(null),g.items.forEach(e=>o(e.id))},children:[
|
|
35
35
|
/* @__PURE__ */ue("svg",{className:"h-4 w-4 text-gray-400",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.5,children:/* @__PURE__ */ue("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M3.75 3.75h6.5v6.5h-6.5zM13.75 8.75h6.5v6.5h-6.5z"})}),i.taskbar.restoreAllWindows]}),
|
|
36
|
-
/* @__PURE__ */ue(
|
|
37
|
-
/* @__PURE__ */ce(
|
|
36
|
+
/* @__PURE__ */ue(K,{}),
|
|
37
|
+
/* @__PURE__ */ce(W,{danger:!0,onClick:()=>{b(null),g.items.forEach(e=>t(e.id))},children:[
|
|
38
38
|
/* @__PURE__ */ue($,{name:"close",className:"h-4 w-4",strokeWidth:2}),`${i.taskbar.closeAllWindows} (${g.items.length})`]})]}),m&&f&&/* @__PURE__ */ue(kt,{items:m,anchorEl:f,onActivate:e=>{o(e),p(null),w(null)},onClose:e=>{t(e),p(null),w(null)},onMouseEnter:()=>{v.current&&(clearTimeout(v.current),v.current=null)},onMouseLeave:x})]}),a)}var Mt=["/login","/forgot-password","/reset-password","/force-change-password"];function Nt({children:e,windowAccentForRoute:t}){const n=me(),r=Mt.some(e=>n.pathname.startsWith(e)),[o,i]=Z([]),a=_(o);J(()=>{a.current=o},[o]);const s=Q(Te,Le,Le),l=_(/* @__PURE__ */new Map),c=e=>{const t=Fe(e),n=!!s&&"page"===e.type&&e.route===s,r=e.pageSearch||void 0,o=l.current.get(e.id);if(o&&o.tab===t&&o.home===n&&o.pageSearch===r)return o;const i={key:e.id,tab:t,home:n,...r?{pageSearch:r}:{}};return l.current.set(e.id,i),i};G(()=>{mt.clear();for(const e of o)e.route&&mt.set(e.id,e.route)},[o]);const u=ee(e=>{i(t=>t.filter(t=>t.id!==e))},[]),d=ee(e=>{var t;ct(e)||ut(e)?(t=e,window.dispatchEvent(new CustomEvent(Mr,{detail:{windowKey:t}}))):u(e)},[u]),h=(e,t=!1)=>{const n=Pn;t&&at.add(e),setTimeout(()=>{const r=document.querySelector(`[data-modal-panel][data-window-key="${e}"]`),o=r?.getAttribute("data-modal-id");var i,a;!o||(i=o,a=n,(In.get(i)??-1)>a)||er(o),t&&at.delete(e)},50)},m=(e,t,n)=>{const r=ze;if(n||!r)return[...e,t];const o=function(e,t,n){if(!Fe(t))return e.length;if(t.shellOwned&&Be(t,n.home))return 0;const r=Be(t,n.home)?void 0:qe(t)?.key;if(r){let t=-1;if(e.forEach((e,o)=>{Fe(e)&&!Be(e,n.home)&&qe(e)?.key===r&&(t=o)}),t>=0)return t+1}if("page"===t.type&&t.route&&!Be(t,n.home)&&n.favorites.includes(t.route))return e.length>0&&Be(e[0],n.home)?1:0;const o=t.openedFrom?e.findIndex(e=>e.id===t.openedFrom):-1;if(o>=0){const t=/* @__PURE__ */new Set([e[o].id]);let r=o+1;for(;r<e.length&&e[r].openedFrom&&t.has(e[r].openedFrom);)t.add(e[r].id),r++;const i=t=>Fe(e[t])&&!Be(e[t],n.home)?qe(e[t])?.key:void 0;for(;r>0&&r<e.length&&void 0!==i(r)&&i(r)===i(r-1);)r++;return r}return e.length}(e,t,{home:Le(),favorites:r.favorites});return[...e.slice(0,o),t,...e.slice(o)]},p=ee(e=>{i(t=>function(e,t){const n=new Set(t),r=new Map(e.map(e=>[e.id,e])),o=t.map(e=>r.get(e)).filter(e=>!!e);if(o.length!==n.size)return e;let i=0;const a=e.map(e=>n.has(e.id)?o[i++]:e);return a.every((t,n)=>t===e[n])?e:a}(t,e))},[]),f=ee((e,t,n,r,o,a={})=>{if(!ve[e]||!ye(ve[e]))return;const s=`${e}:${t}`,l=ht();i(i=>{const c=i.find(n=>n.entityType===e&&String(n.entityId)===String(t));return c?(h(c.id),i):(h(s,!0),m(i,{id:s,type:"modal",label:r||t,route:o||window.location.pathname,entityType:e,entityId:t,entitySnapshot:Ye(n),openedFrom:l},!!a.append))})},[]),w=ee((e,t={})=>{if(!ve[e]||!we(ve[e]))return;const n=ve[e],{reuse:r=!1,background:o=!1,shellOwned:s,search:l,append:c=!1}=t,u=e=>{var t;o?(t=e,Bn.add(t)):h(e)};if(n.widget){const t=a.current.find(t=>"page"===t.type&&t.route===e);if(t)return void d(t.id)}const p=ht();i(t=>{if(n.multiInstance){const i=t.filter(t=>"page"===t.type&&t.route===e);if(r&&!l&&i.length>0)return o||h(i[i.length-1].id),t;const a=`page:${e}:${Math.random().toString(36).slice(2,8)}`;return u(a),m(t,{id:a,type:"page",label:n.label,route:e,openedFrom:p,...s?{shellOwned:s}:{},...l?{pageSearch:l}:{}},c)}const i=t.find(t=>"page"===t.type&&t.route===e);if(i)return n.widget?t:(o||h(i.id),l&&i.pageSearch!==l?t.map(e=>e===i?{...e,pageSearch:l}:e):t);const a=`page:${e}`;return u(a),m(t,{id:a,type:"page",label:n.label,route:e,openedFrom:p,...s?{shellOwned:s}:{},...l?{pageSearch:l}:{}},c)})},[d]),y=ee(()=>{},[]),g=ee(()=>{},[]),b=d,v=d;/* @__PURE__ */
|
|
39
39
|
return ce(Ze.Provider,{value:{openWindows:o,openEntity:f,openPage:w,reorderWindows:p,closeEntity:b,minimize:y,items:[],openItems:o,restore:g,remove:v,restoreIfMinimized:()=>!1},children:[e,
|
|
40
40
|
/* @__PURE__ */ue(Ct,{openWindows:o,onRemove:d,onSplitView:Ur,onActivate:e=>{document.querySelectorAll("[data-modal-panel]").forEach(t=>{const n=t.querySelector("[data-window-title]");if(n?.textContent?.includes(e)){const e=t.getAttribute("data-modal-id");e&&er(e)}})},onActivateById:dt}),
|
|
41
41
|
/* @__PURE__ */ue(Yr,{}),!r&&o.map(e=>{const n=e.route?t?.(e.route):void 0;
|
|
42
42
|
/* @__PURE__ */
|
|
43
|
-
return ue(Ee.Provider,{value:c(e),children:/* @__PURE__ */ue(Pe,{fallback:(t,n)=>/* @__PURE__ */ue(Xr,{open:!0,onClose:()=>u(e.id),title:e.label,size:"md",autoHeight:!0,windowKey:e.id,children:/* @__PURE__ */ue(De,{error:t,onReload:n})}),children:/* @__PURE__ */ue(nn,{spec:rt(e),children:/* @__PURE__ */ue(eo,{windowId:e.id,children:"page"===e.type?/* @__PURE__ */ue(ot,{item:e,onClose:()=>u(e.id),accentRgb:n}):/* @__PURE__ */ue(lt,{item:e,onClose:()=>u(e.id),onMinimize:()=>{},accentRgb:n})})})})},e.id)})]})}var St=400;function Lt({panelRef:e,bodyRef:t,open:n,widget:r,active:o,minimized:i}){const a=_(null),s=_(!1);n&&!s.current&&(a.current="undefined"==typeof document?null:document.activeElement),s.current=n;const l=_(!1),c=_(void 0),u=_(i),d=u.current&&!i;u.current=i;const h=()=>{l.current=!0,clearTimeout(c.current),c.current=setTimeout(()=>{l.current=!1},St)};G(()=>{n&&!r&&h()},[n,r]),G(()=>{d&&n&&!r&&h()},[d]),G(()=>()=>clearTimeout(c.current),[]),G(()=>{if(!n||r||!o||i||!l.current)return;l.current=!1;const a=e.current;if(!a||a.contains(document.activeElement))return;if(document.activeElement?.closest('[aria-modal="true"]'))return;const s=t.current?P(t.current)[0]:void 0;s?s.focus():(a.hasAttribute("tabindex")||a.setAttribute("tabindex","-1"),a.focus())},[n,r,o,i,e,t]),J(()=>{if(!n||r)return;const t=e.current;return()=>{const e=a.current,n=document.activeElement;(!n||n===document.body||!!t?.contains(n))&&e&&e.isConnected&&!t?.contains(e)&&e.focus?.()}},[n,r,e])}var Tt=null,zt=/* @__PURE__ */new Set;function At(){return Tt}function Dt(e){if(Tt!==e){Tt=e;for(const e of zt)e()}}function Pt(e){return zt.add(e),()=>{zt.delete(e)}}var It=!1,
|
|
43
|
+
return ue(Ee.Provider,{value:c(e),children:/* @__PURE__ */ue(Pe,{fallback:(t,n)=>/* @__PURE__ */ue(Xr,{open:!0,onClose:()=>u(e.id),title:e.label,size:"md",autoHeight:!0,windowKey:e.id,children:/* @__PURE__ */ue(De,{error:t,onReload:n})}),children:/* @__PURE__ */ue(nn,{spec:rt(e),children:/* @__PURE__ */ue(eo,{windowId:e.id,children:"page"===e.type?/* @__PURE__ */ue(ot,{item:e,onClose:()=>u(e.id),accentRgb:n}):/* @__PURE__ */ue(lt,{item:e,onClose:()=>u(e.id),onMinimize:()=>{},accentRgb:n})})})})},e.id)})]})}var St=400;function Lt({panelRef:e,bodyRef:t,open:n,widget:r,active:o,minimized:i}){const a=_(null),s=_(!1);n&&!s.current&&(a.current="undefined"==typeof document?null:document.activeElement),s.current=n;const l=_(!1),c=_(void 0),u=_(i),d=u.current&&!i;u.current=i;const h=()=>{l.current=!0,clearTimeout(c.current),c.current=setTimeout(()=>{l.current=!1},St)};G(()=>{n&&!r&&h()},[n,r]),G(()=>{d&&n&&!r&&h()},[d]),G(()=>()=>clearTimeout(c.current),[]),G(()=>{if(!n||r||!o||i||!l.current)return;l.current=!1;const a=e.current;if(!a||a.contains(document.activeElement))return;if(document.activeElement?.closest('[aria-modal="true"]'))return;const s=t.current?P(t.current)[0]:void 0;s?s.focus():(a.hasAttribute("tabindex")||a.setAttribute("tabindex","-1"),a.focus())},[n,r,o,i,e,t]),J(()=>{if(!n||r)return;const t=e.current;return()=>{const e=a.current,n=document.activeElement;(!n||n===document.body||!!t?.contains(n))&&e&&e.isConnected&&!t?.contains(e)&&e.focus?.()}},[n,r,e])}var Tt=null,zt=/* @__PURE__ */new Set;function At(){return Tt}function Dt(e){if(Tt!==e){Tt=e;for(const e of zt)e()}}function Pt(e){return zt.add(e),()=>{zt.delete(e)}}var It=!1,Wt={menus:0,submenus:0,menuKey:null,moveMs:0,resizeMs:0},Kt=()=>{};function Rt(e){It=e,Wt={menus:0,submenus:0,menuKey:null,moveMs:0,resizeMs:0}}function Ot(e,t){It&&("submenu"===e?Wt.submenus++:Wt.menus++,Wt.menuKey=t)}function $t(e){if(!It)return Kt;const t=performance.now();let n=!1;return()=>{if(n)return;if(n=!0,!It)return;const r=performance.now()-t;"move"===e?Wt.moveMs+=r:Wt.resizeMs+=r}}function jt(){const e=Wt;return Wt={menus:0,submenus:0,menuKey:null,moveMs:0,resizeMs:0},e}var Ft=/* @__PURE__ */new Set([D,v]),qt=e=>Ft.has(e)||"function"==typeof e&&"badge"===e.titleRole,Bt=/* @__PURE__ */new Set(["button","a","input","select","textarea","kbd"]),Ht=/* @__PURE__ */new Set(["svg"]);function Ut(e){const t=[],n={text:"",accessories:[],badges:[],actions:[]};return Yt(e,n,t),n.text=t.join("").replace(/\s+/g," ").trim(),n}function Yt(e,t,n){if(null==e||"boolean"==typeof e)return;if("string"==typeof e||"number"==typeof e)return void n.push(String(e));if(Array.isArray(e))return void e.forEach(e=>Yt(e,t,n));if(!te(e))return;const r=e;if(r.type===f)return void(void 0===t.copy&&"string"==typeof r.props.text&&r.props.text&&(t.copy=r.props.text));if(r.type===ne)return void re.toArray(r.props.children).forEach(e=>Yt(e,t,n));if("string"==typeof r.type){if(Ht.has(r.type))return;if(!Bt.has(r.type))return n.push(" "),re.toArray(r.props.children).forEach(e=>Yt(e,t,n)),void n.push(" ")}const o=oe(r,{key:`title-part-${t.accessories.length}`});t.accessories.push(o),(qt(r.type)?t.badges:t.actions).push(o)}var Xt=/* @__PURE__ */new Map,Vt=/* @__PURE__ */new Set,Jt=0;function _t(){Jt++,Vt.forEach(e=>e())}function Gt(e){return Xt.get(e)}function Zt(e){return Vt.add(e),()=>{Vt.delete(e)}}function Qt(){return Jt}var en=Y(""),tn=Y(null);function nn({spec:e,children:t}){/* @__PURE__ */
|
|
44
44
|
return ue(tn.Provider,{value:e,children:t})}var rn=/* @__PURE__ */new Set(["button","input","textarea","select","kbd","svg"]),on='button[type="submit"], button[data-submit], button.btn-submit, button.bg-green-600, button.bg-blue-600';function an(e){return sn(e).replace(/\s+/g," ").trim()}function sn(e){if(null==e||"boolean"==typeof e)return"";if("string"==typeof e)return e;if("number"==typeof e)return String(e);if(Array.isArray(e))return e.map(sn).join("");if(te(e)){const t=e,n="string"==typeof t.type?t.type:"";return rn.has(n)?"":` ${sn(t.props?.children)} `}return""}function ln(e){const t=X(en);G(()=>{if(!t)return;const n=n=>{n.detail===t&&e()};return window.addEventListener("widget-open-settings",n),()=>window.removeEventListener("widget-open-settings",n)},[e,t])}var cn={};function un(e,t,n){const r=X(en);G(()=>{if(!r)return;cn[r]||(cn[r]=[]);const o={label:e,icon:n,onClick:t};return cn[r].push(o),()=>{cn[r]=(cn[r]||[]).filter(e=>e!==o)}},[r,e,t,n])}function dn({title:e}){const t=_(null);return G(()=>{const n=setTimeout(()=>{const n=t.current?.closest("[data-modal-id]"),r=n?.getAttribute("data-modal-id");r&&window.dispatchEvent(new CustomEvent("window-title-update",{detail:{id:r,title:e}}))},0);return()=>clearTimeout(n)},[e]),/* @__PURE__ */ue("span",{ref:t,style:{display:"none"},"aria-hidden":"true"})}function hn(e){}function mn(){return X(en)}function pn({children:e,position:t="right",quiet:n=!1}){const r=X(L),[o,i]=Z(null);return G(()=>{if(!r)return;const e="left"===t?r.leftRef:r.rightRef,o=()=>!!e.current&&(i(e.current),n||r.notify(),!0);if(o())return;const a=setInterval(()=>{o()&&clearInterval(a)},50),s=setTimeout(()=>clearInterval(a),2e3);return()=>{clearInterval(a),clearTimeout(s)}},[r,t,n]),o?he(e,o):null}function fn({onClick:e,children:t,className:n}){const r=X(L);/* @__PURE__ */
|
|
45
|
-
return ue("button",{type:"button",onClick:async()=>{if(r?.isDirty){const{confirm:e}=await(import("./shell/ConfirmDialog.js"));if(!await e({title:"Discard changes?",message:"You have unsaved changes. Are you sure you want to cancel? All changes will be lost.",confirmLabel:"Discard",cancelLabel:"Keep Editing",variant:"warning"}))return}e()},className:n||"bg-white text-gray-700 border border-gray-300 px-4 py-2 text-sm font-medium rounded-lg hover:bg-gray-50",children:t||"Cancel"})}var wn="erp_window_positions",yn={};try{const e=localStorage.getItem(wn);e&&(yn=JSON.parse(e))}catch{}var gn=null;function bn(){gn&&clearTimeout(gn),gn=setTimeout(()=>{try{localStorage.setItem(wn,JSON.stringify(yn))}catch{}},500)}var vn="erp_activation_order",xn=[];try{const e=localStorage.getItem(vn),t=e?JSON.parse(e):null;Array.isArray(t)&&t.every(e=>"string"==typeof e)&&(xn=t)}catch{}var kn=null;function En(){kn&&clearTimeout(kn),kn=setTimeout(()=>{try{localStorage.setItem(vn,JSON.stringify(xn))}catch{}},500)}function Cn(e,t){yn[e]||(yn[e]=t,bn())}function Mn(e){return yn[e]?{...yn[e]}:null}function Nn(e,t){yn[e]=t,bn()}function Sn(){const r=e(),o=t();let i=!1;for(const e of Object.keys(yn))n(yn[e],r,o)&&(delete yn[e],i=!0);i&&bn()}var Ln={sm:384,md:512,lg:672,xl:896,"2xl":1152,"3xl":1408},Tn=4e3,zn=()=>{if("undefined"==typeof document)return"large";const e=getComputedStyle(document.documentElement).getPropertyValue("--default-window-size")?.trim();return"small"===e||"medium"===e||"maximized"===e?e:"large"},An={small:.8,medium:1,large:1.25,maximized:1.25},Dn=/* @__PURE__ */new Set,Pn=0,In=/* @__PURE__ */new Map;var
|
|
45
|
+
return ue("button",{type:"button",onClick:async()=>{if(r?.isDirty){const{confirm:e}=await(import("./shell/ConfirmDialog.js"));if(!await e({title:"Discard changes?",message:"You have unsaved changes. Are you sure you want to cancel? All changes will be lost.",confirmLabel:"Discard",cancelLabel:"Keep Editing",variant:"warning"}))return}e()},className:n||"bg-white text-gray-700 border border-gray-300 px-4 py-2 text-sm font-medium rounded-lg hover:bg-gray-50",children:t||"Cancel"})}var wn="erp_window_positions",yn={};try{const e=localStorage.getItem(wn);e&&(yn=JSON.parse(e))}catch{}var gn=null;function bn(){gn&&clearTimeout(gn),gn=setTimeout(()=>{try{localStorage.setItem(wn,JSON.stringify(yn))}catch{}},500)}var vn="erp_activation_order",xn=[];try{const e=localStorage.getItem(vn),t=e?JSON.parse(e):null;Array.isArray(t)&&t.every(e=>"string"==typeof e)&&(xn=t)}catch{}var kn=null;function En(){kn&&clearTimeout(kn),kn=setTimeout(()=>{try{localStorage.setItem(vn,JSON.stringify(xn))}catch{}},500)}function Cn(e,t){yn[e]||(yn[e]=t,bn())}function Mn(e){return yn[e]?{...yn[e]}:null}function Nn(e,t){yn[e]=t,bn()}function Sn(){const r=e(),o=t();let i=!1;for(const e of Object.keys(yn))n(yn[e],r,o)&&(delete yn[e],i=!0);i&&bn()}var Ln={sm:384,md:512,lg:672,xl:896,"2xl":1152,"3xl":1408},Tn=4e3,zn=()=>{if("undefined"==typeof document)return"large";const e=getComputedStyle(document.documentElement).getPropertyValue("--default-window-size")?.trim();return"small"===e||"medium"===e||"maximized"===e?e:"large"},An={small:.8,medium:1,large:1.25,maximized:1.25},Dn=/* @__PURE__ */new Set,Pn=0,In=/* @__PURE__ */new Map;var Wn=0;function Kn(){return Wn}function Rn(){Wn++,S.forEach(e=>e())}var On=/* @__PURE__ */new Map,$n=/* @__PURE__ */new Map,jn=/* @__PURE__ */new Map;function Fn(){for(let e=N.length-1;e>=0;e--){const t=jn.get(N[e]);if(t?.tab)return t.owner}return null}function qn(){return Q(T,Fn,()=>null)}var Bn=/* @__PURE__ */new Set;var Hn=null;function Un(e){Hn=null,er(e)}function Yn(e){Hn=e;const t=On.get(e);t&&Un(t)}var Xn=/* @__PURE__ */new Map;function Vn(e){return Xn.get(e)?.holdsChanges()??!1}function Jn(e){const t=Xn.get(e);return t?t.ask():Promise.resolve(!0)}function _n(e){Hn===e&&(Hn=null)}function Gn(e,t,n){if(n&&jn.set(e,n),t)if(On.set(t,e),$n.set(e,t),Bn.delete(t)){N.unshift(e);const n=xn.indexOf(t);-1!==n&&xn.splice(n,1),xn.unshift(t),En()}else!function(e,t){const n=xn.indexOf(t);if(-1===n)return void N.push(e);let r=N.length;for(let e=0;e<N.length;e++){const t=$n.get(N[e]);if(t&&xn.indexOf(t)>n){r=e;break}}N.splice(r,0,e)}(e,t),-1===xn.indexOf(t)&&(xn.push(t),En());else N.push(e);Rn(),window.dispatchEvent(new CustomEvent("modal-reorder")),t&&Hn===t&&Un(e)}function Zn(e){return e?jn.get(e)?.owner??$n.get(e)??null:null}var Qn=/* @__PURE__ */new Set;function er(e){const t=Zn(z()),n=N.indexOf(e);-1!==n&&N.splice(n,1),N.push(e);const r=jn.get(e);if(r?.root)for(const[e,t]of jn){if(t.root||t.owner!==r.owner||Dn.has(e))continue;const n=N.indexOf(e);-1!==n&&N.splice(n,1),N.push(e)}Dn.delete(e);const o=$n.get(e);if(o){const e=xn.indexOf(o);-1!==e&&xn.splice(e,1),xn.push(o),En(),Hn&&Hn!==o&&(Hn=null)}Rn(),window.dispatchEvent(new CustomEvent("modal-reorder"));const i=Zn(z());i&&i!==t&&Qn.forEach(e=>e(i))}function tr(e){const t=N.indexOf(e);-1!==t&&N.splice(t,1),Dn.add(e),In.set(e,++Pn);const n=$n.get(e);if(n){const e=xn.indexOf(n);-1!==e&&(xn.splice(e,1),En())}Rn(),window.dispatchEvent(new CustomEvent("modal-reorder"))}var nr=/* @__PURE__ */new Set;var rr=8,or=32;function ir(){return e()}var ar=c.windowBar,sr=80,lr=384,cr=400;function ur(e,t=ir()){const n=Math.min(Math.max(e.x,t.x+sr-e.w),t.x+t.w-sr),r=Math.min(Math.max(e.y,t.y),t.y+t.h-ar);return n===e.x&&r===e.y?e:{...e,x:n,y:r}}function dr(e){const t=e.getBoundingClientRect();if(0===t.width||0===t.height)return!0;const n=ir();return t.left>=n.x-1&&t.top>=n.y-1&&t.right<=n.x+n.w+1&&t.bottom<=n.y+n.h+1}function hr(e){const t=ir(),n=Math.floor(t.w/2),r=Math.floor(t.h/2);switch(e){case"top":return{x:t.x,y:t.y,w:t.w,h:t.h};case"left":return{x:t.x,y:t.y,w:n,h:t.h};case"right":return{x:t.x+n,y:t.y,w:t.w-n,h:t.h};case"tl":return{x:t.x,y:t.y,w:n,h:r};case"tr":return{x:t.x+n,y:t.y,w:t.w-n,h:r};case"bl":return{x:t.x,y:t.y+r,w:n,h:t.h-r};case"br":return{x:t.x+n,y:t.y+r,w:t.w-n,h:t.h-r}}}var mr=null;function pr(e){const t=(mr||((mr=document.createElement("div")).style.cssText=["position: fixed","pointer-events: none",`z-index: ${F.snapPreview}`,"border-radius: 8px","background: rgba(59, 130, 246, 0.18)","border: 2px solid rgb(59, 130, 246)","transition: left 120ms ease, top 120ms ease, width 120ms ease, height 120ms ease, opacity 120ms ease","opacity: 0","display: none"].join(";"),document.body.appendChild(mr)),mr);t.style.display="block",t.style.left=`${e.x}px`,t.style.top=`${e.y}px`,t.style.width=`${e.w}px`,t.style.height=`${e.h}px`,t.style.opacity="1"}function fr(){mr&&(mr.style.opacity="0",mr.style.display="none")}var wr=[{zone:"left",labelKey:"snapLeft",region:"inset-y-0 left-0 w-1/2"},{zone:"right",labelKey:"snapRight",region:"inset-y-0 right-0 w-1/2"},{zone:"tl",labelKey:"snapTopLeft",region:"top-0 left-0 h-1/2 w-1/2"},{zone:"tr",labelKey:"snapTopRight",region:"top-0 right-0 h-1/2 w-1/2"},{zone:"bl",labelKey:"snapBottomLeft",region:"bottom-0 left-0 h-1/2 w-1/2"},{zone:"br",labelKey:"snapBottomRight",region:"bottom-0 right-0 h-1/2 w-1/2"}],yr=350,gr=200;function br({maximized:e,onToggleMax:t,onSnap:n,buttonClassName:r,strings:o}){const[i,a]=Z(!1),s=_(void 0),l=_(void 0);G(()=>()=>{clearTimeout(s.current),clearTimeout(l.current)},[]);const c=()=>{clearTimeout(l.current),s.current=setTimeout(()=>a(!0),yr)},u=()=>{clearTimeout(s.current),l.current=setTimeout(()=>a(!1),gr)};/* @__PURE__ */
|
|
46
46
|
return ce("span",{className:"relative inline-flex",onMouseEnter:c,onMouseLeave:u,children:[
|
|
47
|
-
/* @__PURE__ */ue("button",{onClick:t,onFocus:c,onBlur:u,title:e?o.windowed:o.maximize,className:r,children:e?"❐":"⤢"}),i&&/* @__PURE__ */ue("div",{role:"group","aria-label":o.snapLayouts,onMouseEnter:()=>clearTimeout(l.current),onMouseLeave:u,className:"absolute right-0 top-full z-30 mt-1 grid w-max grid-cols-2 gap-1 rounded-lg border border-line bg-surface p-2 shadow-lg",children:wr.map(({zone:e,labelKey:t,region:r})=>/* @__PURE__ */ue("button",{type:"button","aria-label":o[t],title:o[t],onClick:()=>{a(!1),n(e)},onFocus:()=>clearTimeout(l.current),onBlur:u,className:"relative h-7 w-11 rounded border border-gray-300 bg-gray-50 hover:border-blue-400 focus:outline-none focus-visible:ring-2 focus-visible:ring-blue-400",children:/* @__PURE__ */ue("span",{"aria-hidden":"true",className:`absolute rounded-sm bg-blue-500/70 ${r}`,style:{margin:2}})},e))})]})}var vr="rosh-gesture-style";var xr={se:"nwse-resize",nw:"nwse-resize",sw:"nesw-resize",ne:"nesw-resize",n:"ns-resize",s:"ns-resize",e:"ew-resize",w:"ew-resize"},kr=4;function Er(e,t,n,r){!function(){if("undefined"==typeof document||document.getElementById(vr))return;const e=document.createElement("style");e.id=vr,e.textContent="body.rosh-gesturing [data-modal-panel]{will-change:transform}",document.head.appendChild(e)}();try{e.setPointerCapture(t)}catch{}document.body.classList.add("rosh-gesturing");const o=document.createElement("div");o.setAttribute("data-drag-shield",""),o.style.cssText=`position:fixed;inset:0;z-index:2147483647;cursor:${n};background:transparent;touch-action:none`,document.body.appendChild(o);const i=$t(r);let a=!1;return()=>{if(!a){a=!0,i();try{e.releasePointerCapture(t)}catch{}o.remove(),document.body.classList.remove("rosh-gesturing")}}}function Cr(e){const t=N.indexOf(e);if(-1===t)return-1;const n=F.window+t*F.windowStep,r=jn.get(e);if(!r||r.root)return n;let o=-1;for(const[e,t]of jn){if(!t.root||t.owner!==r.owner)continue;const n=N.indexOf(e);-1!==n&&(o=Math.max(o,F.window+n*F.windowStep))}return o>=n?o+2+Math.min(t,7):n}"undefined"!=typeof window&&window.addEventListener("deactivate-all-modals",function(){for(let e=N.length-1;e>=0;e--)nr.has(N[e])||N.splice(e,1);xn=xn.filter(e=>{const t=On.get(e);return null!=t&&nr.has(t)}),En(),Rn(),window.dispatchEvent(new CustomEvent("modal-reorder"))});var Mr="modal-close-request";function Nr(e){Q(T,
|
|
48
|
-
/* @__PURE__ */ue("div",{onMouseDown:e=>{e.stopPropagation(),Ar(!1)},style:{position:"fixed",inset:0,background:"rgba(0,0,0,0.55)",backdropFilter:"blur(2px)",WebkitBackdropFilter:"blur(2px)",zIndex:F.expose,cursor:"pointer",opacity:r?1:0,transition:"opacity 260ms cubic-bezier(0.2, 0.8, 0.2, 1)",pointerEvents:r?"auto":"none"}}),document.body):null}function Xr({open:t,onClose:l,title:c,icon:u,copyText:d,size:h="lg",dirty:m=!1,onNext:p,onPrev:f,footer:y,bodyScroll:v,onMinimize:x,initialBox:k,actions:S,actionsLeft:D,editing:P=!1,edit:R,allowPinOnTop:j,initialPosition:q,widget:B,compact:Y,appStyle:V,flushBody:ne,autoHeight:re,autoMinHeight:se,autoWidth:le,widgetMenu:me,dimensions:pe,windowKey:fe,openedFromKey:we,accentRgb:ye,children:ge}){const[be,ve]=Z(()=>r()),xe=E()&&!be,ke=C()&&!!B,[Ce,Me]=Z(0),[Ne,Se]=Z(!1),Le=_(null),Te=_(0);G(()=>{Te.current=Ce},[Ce]);const ze=ee(e=>{xe&&(Le.current={startX:e.clientX,startY:e.clientY,pointerId:e.pointerId},Se(!0),Dt(we??null))},[xe,we]),Ae=Q(Pt,At);G(()=>{if(!Ne)return;const e=e=>{if(!Le.current)return;const t=e.clientX-Le.current.startX;if(Math.abs(e.clientY-Le.current.startY)>Math.abs(t)+12)return Le.current=null,Se(!1),Me(0),void Dt(null);Me(Math.max(0,t))},t=()=>{if(!Le.current)return;const e=.3*window.innerWidth,t=Te.current>e;Le.current=null,Se(!1),t?(Me(window.innerWidth),setTimeout(()=>{l(),Me(0),Dt(null)},180)):(Me(0),Dt(null))};return window.addEventListener("pointermove",e),window.addEventListener("pointerup",t),window.addEventListener("pointercancel",t),()=>{window.removeEventListener("pointermove",e),window.removeEventListener("pointerup",t),window.removeEventListener("pointercancel",t)}},[Ne]);const[De,Ke]=Z(c),Re=U(),Oe=Re.window;G(()=>{Ke(c)},[c]);const $e=ie(()=>an(De).trim()||void 0,[De]),je=ae(),[Fe,qe]=Z(!1),Be=_(!1),[He,Ue]=Z(!1),[Ye,Xe]=Z(null),Ve=X(tn),Je=X(Ee),{prefs:_e,save:Ge}=M(),Ze=!!_e.window_accent_stripe,Qe=_e.favorite_documents||[],tt=!!Ve&&Qe.some(e=>e.entityType===Ve.entityType&&e.entityId===Ve.entityId),rt=ee(()=>{if(!Ve)return;const e=tt?Qe.filter(e=>!(e.entityType===Ve.entityType&&e.entityId===Ve.entityId)):[...Qe,{entityType:Ve.entityType,entityId:Ve.entityId,label:Ve.label}];Ge({favorite_documents:e})},[Ve,tt,Qe,Ge]),[ot,it]=Z(null),[at,st]=Z("top-right"===q?"right":"left"),lt=_(!1),ct=_(null);J(()=>{const e=ct.current;e&&(ye?e.style.setProperty("--window-accent-rgb",ye):e.style.removeProperty("--window-accent-rgb"))},[ye]);const ut=_(!1),dt=_(null),ht=_(null),mt=_(null),[pt,ft]=Z(!1),wt=_(null),yt=_(null),gt=_(null),[bt,vt]=Z(!1);J(()=>{const e=yt.current,t=gt.current;if(!e||!t)return;const n=()=>vt(function(e,t){return e.scrollWidth>t.clientWidth}(t,e));if(n(),"undefined"==typeof ResizeObserver)return;const r=new ResizeObserver(n);return r.observe(e),r.observe(t),()=>r.disconnect()},[null!=y&&!1!==y]);const xt=!!R&&!B&&!Y&&!V&&(R.editing||"hidden"!==R.state),kt=!!(y||S||D)||pt||xt,Et=X(Ie),Ct=""!==X(en),Mt=_(null);Mt.current=Je?{owner:Je.key,tab:Je.tab,root:!Ct}:null;const Nt=fe||(Je&&!Ct?Je.key:null),St=!!Et&&!Ct&&Et.enabled&&Et.hasState&&(P||Et.declaredEditable)&&!Et.handMounted&&kt&&!B&&!Y&&!V&&!xe,Tt=/* @__PURE__ */ue($,{name:"window",className:"h-4 w-4",strokeWidth:1.5}),zt=u&&te(u)?oe(u,{className:`h-4 w-4 ${u.props?.className??""}`.trim()}):u??Tt,It=()=>/* @__PURE__ */ue("button",{onPointerDown:e=>e.stopPropagation(),onClick:e=>{e.stopPropagation();const t=e.currentTarget.getBoundingClientRect();Xe(e=>e?null:{x:t.left,y:t.bottom+4})},className:"shrink-0 p-0.5 rounded hover:bg-gray-200/50 transition-colors",title:"Window menu",children:zt}),Kt=40,{minimize:Wt,items:Rt,restoreIfMinimized:Ot,openWindows:$t}=nt(),jt=_(`modal-${Math.random().toString(36).slice(2,8)}`).current;G(()=>{if(B)return nr.add(jt),()=>{nr.delete(jt)}},[B,jt]),G(()=>{const e=e=>{const t=e.detail;t?.id===jt&&Ke(t.title)};return window.addEventListener("window-title-update",e),()=>window.removeEventListener("window-title-update",e)},[jt]);const[Ft,qt]=Z(F.window),Bt=function(e){const t=Q(T,z);return N.length<=1||t===e}(jt),Ht=_(R);Ht.current=R;const Yt=!!R&&!R.editing&&"enabled"===R.state;G(()=>{if(!t||!Bt||!Yt)return;const e=e=>{("KeyE"===e.code||"E"===e.key||"e"===e.key)&&e.altKey&&e.shiftKey&&!e.metaKey&&!e.ctrlKey&&(g(e.target,ct.current)||(e.preventDefault(),e.stopPropagation(),Ht.current?.onEdit()))};return window.addEventListener("keydown",e,!0),()=>window.removeEventListener("keydown",e,!0)},[t,Bt,Yt]);const Vt=function(e){return Q(T,()=>Dn.has(e))}(jt);Lt({panelRef:ct,bodyRef:dt,open:t,widget:!!B,active:Bt,minimized:Vt});const Jt=Q(Tr,zr),Gt=Q(Wr,Rr),Zt=Q(Fr,qr),Qt=!j&&!B,nn=Jt&&Qt,[rn,sn]=Z(!1),ln=nn&&Zt===jt,[un,dn]=Z(!1),hn=un&&Qt&&Gt===jt?"picked":null,mn=_(nn);G(()=>{if(mn.current&&!nn){dn(!0);const e=setTimeout(()=>{dn(!1),Ir===jt&&Or(null)},700);return mn.current=nn,()=>clearTimeout(e)}mn.current=nn},[nn,jt]),G(()=>{nn||sn(!1)},[nn]),G(()=>{const e=ht.current,t=mt.current;if(!e&&!t)return;const n=e=>e?Array.from(e.children).filter(e=>"shell"!==e.dataset.undoControls).length:0,r=()=>ft(n(e)+n(t)>0);r();const o=new MutationObserver(r);return e&&o.observe(e,{childList:!0}),t&&o.observe(t,{childList:!0}),()=>o.disconnect()},[t]),G(()=>{const e=e=>{if(e.target.closest('button[type="submit"]')&&ct.current){const t=ct.current.querySelector("form");t&&(e.preventDefault(),t.requestSubmit())}},t=ht.current,n=mt.current;return t&&t.addEventListener("click",e),n&&n.addEventListener("click",e),()=>{t&&t.removeEventListener("click",e),n&&n.removeEventListener("click",e)}},[t]);const pn=_(!1),fn=ee(e,[]),wn=ee(()=>{const t=e(),n=pe?pe[0]:Ln[h]||672,o=t.w-80,i=t.h-80,a=Math.min(n,o),s=An[zn()],l=pe?Math.min(pe[1],i):(()=>{const e=("sm"===h?500:"md"===h?600:"lg"===h?700:"xl"===h?800:920)*s;return Math.max(320,Math.min(e,t.h-80))})(),c="cascade"!==(getComputedStyle(document.documentElement).getPropertyValue("--window-position")?.trim()||"cascade")||r()?0:30*(N.length-1),u=Math.max(Kt,(i-l)/2),d=(o-a)/2,m=t.h-Kt-l-u;return"top-right"===q?{x:t.x+t.w-a-Kt,y:t.y+Kt,w:a,h:l}:"top-left"===q?{x:t.x+Kt,y:t.y+Kt,w:a,h:l}:{x:t.x+Math.max(Kt,(o-a)/2+Kt)+Math.min(c,Math.max(0,d)),y:t.y+u+Math.min(c,Math.max(0,m)),w:a,h:l}},[h]),gn=_(!1);t||(gn.current=!1);const vn=fe||d||null;G(()=>{if(!t)return;Gn(jt,vn,Mt.current??void 0),fe||er(jt),pn.current=!1,qt(Cr(jt));const e=()=>{qt(Cr(jt))},n=()=>{},r=e=>{if(!e)return!1;if(e.windowKey)return e.windowKey===fe;if(!e.label)return!1;const t=ct.current?.querySelector("[data-window-title]");return!!t?.textContent?.includes(e.label)},o=e=>{if(!r(e.detail))return;if(er(jt),Wn.current)return;const t=ir(),n=Math.min(Vn.current.w,t.w-40),o=Math.min(Vn.current.h,t.h-40),i=t.x+(t.w-n)/2,a=t.y+(t.h-o)/2;En({x:i,y:a,w:n,h:o}),Yn(!1)},i=e=>{const t=e.detail;r(t)&&(er(jt),Xe({x:t.x,y:t.y}))},a=e=>{if(e.detail?.windowKey!==fe)return;er(jt);const t=Vn.current,n=function(e,t=ir()){const n=Math.min(e.w,t.w),r=Math.min(e.h,t.h);return{w:n,h:r,x:Math.min(Math.max(e.x,t.x),t.x+t.w-n),y:Math.min(Math.max(e.y,t.y),t.y+t.h-r)}}(t);if(n.x===t.x&&n.y===t.y&&n.w===t.w&&n.h===t.h)return;const r=ct.current,o="function"==typeof window.matchMedia&&window.matchMedia("(prefers-reduced-motion: reduce)").matches;if(r&&!o){let e=!1;const t=()=>{e||(e=!0,r.style.transition="",window.dispatchEvent(new CustomEvent("modal-geometry")))};r.style.transition="left .28s ease, top .28s ease, width .28s ease, height .28s ease",r.addEventListener("transitionend",t,{once:!0}),window.setTimeout(t,400)}En(n)};return window.addEventListener("modal-reorder",e),window.addEventListener("modal-split-view",n),window.addEventListener("modal-center",o),window.addEventListener("modal-reveal",a),window.addEventListener("modal-context-menu",i),()=>{!function(e){const t=N.indexOf(e);-1!==t&&(N.splice(t,1),Rn()),Dn.delete(e),In.delete(e),jn.delete(e);const n=$n.get(e);n&&($n.delete(e),On.delete(n))}(jt),window.removeEventListener("modal-reorder",e),window.removeEventListener("modal-split-view",n),window.removeEventListener("modal-center",o),window.removeEventListener("modal-reveal",a),window.removeEventListener("modal-context-menu",i),window.dispatchEvent(new CustomEvent("modal-reorder"))}},[t,jt,vn,fn]);const xn=!B&&"maximized"===zn(),[kn,En]=Z(()=>{if(vn&&yn[vn]){const e={...yn[vn]};return pe&&(e.w=pe[0],re||(e.h=pe[1])),ur(e)}return k?{x:k.x,y:k.y,w:k.w,h:k.h}:xn?fn():wn()}),[Cn,Mn]=Z(()=>!re),Nn=_(be),Sn=_(null);G(()=>{const e=()=>{const e=r();e!==Nn.current&&Sn.current?.(e),Nn.current=e,ve(e),qt(Cr(jt))};return window.addEventListener("react-os-shell:layout-mode-changed",e),()=>window.removeEventListener("react-os-shell:layout-mode-changed",e)},[jt]);const Pn=be&&!!Je?.tab&&!Ct&&!B&&!xe,Kn=Pn,Wn=_(Kn);Wn.current=Kn;const Fn=qn(),Bn=be&&!!Je?.tab&&!B&&!xe&&!Jt&&Fn!==Je.key,Hn=!!B&&be&&!Jt&&null!==Fn,[Un,Yn]=Z(()=>vn&&yn[vn]||k?Kn:Kn||xn),Vn=_(kn);Vn.current=kn;const Jn=_(Un);J(()=>{Jn.current=Un},[Un]),J(()=>{if(Cn||Pn)return;const e=ct.current,t=dt.current;if(!e||!t)return;const n=se??(B?0:240),r=parseInt(getComputedStyle(document.documentElement).getPropertyValue("--taskbar-height"))||0;let o=0,i=null,a=null;const s=()=>{const c=t.firstElementChild;if(!c||e.offsetHeight<=0)return;c!==a&&(a&&l.unobserve(a),l.observe(c),a=c);const u=e.offsetHeight-t.offsetHeight,d=t.style.flex,h=t.style.overflowY,m=t.style.height;t.style.flex="0 0 auto",t.style.height="auto",t.style.overflowY="visible";const p=t.offsetHeight,f=c.offsetHeight;t.style.flex=d,t.style.height=m,t.style.overflowY=h;const w=c.offsetHeight>f+4,y=Math.max(n,window.innerHeight-r-Math.max(0,Vn.current.y)-24),g=w?Math.min(Vn.current.h,y):Math.min(Math.max(n,u+p),y),b=Math.abs(g-o)>1;b&&(o=g,En(e=>Math.abs(e.h-g)>1?{...e,h:g}:e)),B||(g<=n?i&&(clearTimeout(i),i=null):(b||null===i)&&(i&&clearTimeout(i),i=setTimeout(()=>{const e=o;s(),o===e&&Mn(!0)},160)))},l=new ResizeObserver(s);s(),wt.current&&l.observe(wt.current);const c=new MutationObserver(s);return c.observe(t,{childList:!0,subtree:!0,characterData:!0}),()=>{l.disconnect(),c.disconnect(),i&&clearTimeout(i)}},[Cn,B,se,kt,Pn]),J(()=>{if(!re||!Cn||B||!t)return;const e=wt.current;if(!e)return;let n=e.offsetHeight;const r=new ResizeObserver(()=>{if(!e.isConnected)return;const t=e.offsetHeight,r=t-n,o=t>0!=n>0;if(n=t,!o||0===r||Un)return;if(document.body.classList.contains("rosh-gesturing"))return;const i=se??240,a=parseInt(getComputedStyle(document.documentElement).getPropertyValue("--taskbar-height"))||0,s=Math.max(i,window.innerHeight-a-Math.max(0,Vn.current.y)-24);En(e=>({...e,h:Math.min(Math.max(i,e.h+r),s)}))});return r.observe(e),()=>r.disconnect()},[re,Cn,B,t,Un,se]);const _n=!1!==le&&!B&&!V&&!xe,[Zn,Qn]=Z(()=>!_n);J(()=>{if(Zn||!t)return;if(!_n||Un)return void Qn(!0);const n=ct.current,r=dt.current;if(!n||!r)return;const o=/* @__PURE__ */new WeakSet;let l=Vn.current.w,c=0;const u=()=>Qn(!0),d=()=>{c=0;const t=Vn.current;if(Math.abs(t.w-l)>1||document.body.classList.contains("rosh-gesturing"))return void u();const d=e(),h=d.w-80;if(t.w>=h)return void u();const m=[],p=[];for(const e of[r,...Array.from(r.querySelectorAll("*"))]){const t=e.scrollWidth-e.clientWidth;if(t<=4||o.has(e))continue;const n=getComputedStyle(e).overflowX;"auto"!==n&&"scroll"!==n||(m.push(e),p.push(t))}if(!m.length)return;const f=Math.min(h,t.w+Math.max(...p)),w=f-t.w,y=n.style.width;n.style.width=`${f}px`;const g=m.map((e,t)=>({over:p[t],residual:e.scrollWidth-e.clientWidth}));n.style.width=y,g.forEach((e,t)=>{i(e,w)||o.add(m[t])});const b=a(t,s(t.w,w,g),d,Kt);b!==t&&(l=b.w,En(b))};d();const h=new MutationObserver(()=>{c||(c=requestAnimationFrame(d))});h.observe(r,{childList:!0,subtree:!0,characterData:!0,attributes:!0,attributeFilter:["style","class","hidden"]});const m=setTimeout(u,Tn);return()=>{h.disconnect(),c&&cancelAnimationFrame(c),clearTimeout(m)}},[Zn,t,_n,Un]);const ar=_(null),sr=!(!Je?.tab||Ct||B||xe);Sn.current=t=>{if(!sr)return;if(t)return ar.current||(ar.current={box:{...Vn.current},maximized:Jn.current}),void(Jn.current=!0);const r=ar.current;ar.current=null;const o=e();if(r?.maximized)return Jn.current=!0,Yn(!0),void En(o);const i=r?.box??(vn?yn[vn]:void 0);if(Jn.current=!1,Yn(!1),i&&!n(i,o,!1)){const e={...i};pe&&(e.w=pe[0],re||(e.h=pe[1])),En(ur(e))}else En(wn())},G(()=>{Kn&&(Jn.current=!0,Yn(!0),En(fn()))},[Kn,fn]),G(()=>{if(B)return;const e=()=>{const e=vn?yn[vn]:void 0;if(Jn.current=!1,Yn(!1),e){const t={...e};pe&&(t.w=pe[0],re||(t.h=pe[1])),En(ur(t))}else En(wn())};return window.addEventListener("react-os-shell:restore-windowed",e),()=>window.removeEventListener("react-os-shell:restore-windowed",e)},[B,wn,vn]),G(()=>{t&&vn&&!Pn&&(yn[vn]=kn,bn()),t&&window.dispatchEvent(new CustomEvent("modal-geometry"))},[kn,t,vn,Pn]),G(()=>{if(!t)return;const e=()=>{Jn.current?En(fn()):document.body.classList.contains("rosh-gesturing")||En(ur)};window.addEventListener("resize",e),window.addEventListener(o,e);let n=null;return Un&&(n=new MutationObserver(e),n.observe(document.body,{childList:!0,subtree:!1,attributes:!0,attributeFilter:["class"]})),()=>{window.removeEventListener("resize",e),window.removeEventListener(o,e),n?.disconnect()}},[t,Un,fn]),G(()=>{if(t&&(qe(!1),Be.current=!1,lt.current=!1,Qn(!_n),!Wn.current)){if(vn&&yn[vn]){const e=yn[vn];return void En(t=>ur({...e,...re?{h:t.h}:{},..._n?{x:t.x,w:t.w}:{}}))}k&&(En({x:k.x,y:k.y,w:k.w,h:k.h}),Yn(k.maximized))}},[t]),G(()=>{if(!t||"auto"!==m)return;let e;const n=t=>{ct.current?.contains(t.target)&&!Be.current&&(Be.current=!0,e=setTimeout(()=>qe(!0),0))};return document.addEventListener("input",n,!0),document.addEventListener("change",n,!0),()=>{clearTimeout(e),document.removeEventListener("input",n,!0),document.removeEventListener("change",n,!0)}},[t,m]);const dr="auto"===m?Fe:!0===m,mr=Je&&!Ct?Je.key:null,wr=ie(()=>Ut(De),[De]),yr=_({shortcutSpec:Ve,isOnDesktop:tt,toggleDesktopShortcut:rt,taskbarStrings:Re.taskbar});J(()=>{yr.current={shortcutSpec:Ve,isOnDesktop:tt,toggleDesktopShortcut:rt,taskbarStrings:Re.taskbar}});const gr=_(null);gr.current||(gr.current={open:(e,t)=>Xe({x:e,y:t}),items:()=>{const e=yr.current,t=[];e.shortcutSpec&&t.push({label:e.isOnDesktop?e.taskbarStrings.removeFromDesktop:e.taskbarStrings.addToDesktop,onSelect:e.toggleDesktopShortcut});for(const e of cn[jt]||[])t.push({label:e.label,icon:e.icon,onSelect:e.onClick});return t}}),G(()=>{if(t&&mr)return()=>{return e=mr,void(Xt.delete(e)&&_t());var e}},[t,mr]),et(!(fe||!t)&&dr);const vr=ee(()=>dr||"auto"===m&&Be.current,[dr,m]),Nr=ee(async e=>{if(lt.current)return!1;if(!vr())return!0;lt.current=!0;const t=$e,n="close"===e?"Are you sure you want to close?":"discard"===e?"Are you sure you want to stop editing?":"Are you sure you want to continue?",r=await w({title:"Discard changes?",message:t?`“${t}” has unsaved changes. ${n} All changes will be lost.`:`You have unsaved changes. ${n} All changes will be lost.`,confirmLabel:"Discard",cancelLabel:"Keep Editing",variant:"warning"});return lt.current=!1,r},[vr,$e]),Sr=ee(()=>lt.current?Promise.resolve():vr()?Nr("close").then(e=>{e&&l()}):(l(),Promise.resolve()),[vr,Nr,l]),Lr=ee(async()=>{await Nr("discard")&&(Be.current=!1,qe(!1),Ht.current?.onDiscard())},[Nr]),Dr=ee(async()=>{const e=await Nr("switch");return e&&(Be.current=!1,qe(!1)),e},[Nr]),Pr=_(()=>!1);J(()=>{Pr.current=vr}),J(()=>{if(!t||!fe)return;const e={holdsChanges:()=>Pr.current(),ask:Dr};return Xn.set(fe,e),()=>{Xn.get(fe)===e&&Xn.delete(fe)}},[t,fe,Dr]),J(()=>{if(!t||!Nt)return;const e=e=>{e.detail?.windowKey===Nt&&Sr()};return window.addEventListener(Mr,e),()=>window.removeEventListener(Mr,e)},[t,Nt,Sr]);const Kr=_(null),$r=ee(e=>{if(0!==e.button)return;if(e.target.closest("button, input, a, kbd, select, textarea"))return;if(Xe(null),er(jt),Wn.current)return void e.preventDefault();e.preventDefault();const t=e.currentTarget,n=e.pointerId;let r=null;const o=e.clientX,i=e.clientY,a=ct.current,s=a?.getBoundingClientRect();let l,c,u,d;if(Kr.current){const t=Kr.current;Kr.current=null,d=t.w,u=t.h;const n=s?Math.min(Math.max(20,e.clientX-s.left),t.w-20):t.w/2;l=e.clientX-n,c=e.clientY-12,a&&(a.style.width=`${d}px`,a.style.height=`${u}px`,a.style.left=`${l}px`,a.style.top=`${c}px`)}else l=s?s.left:Vn.current.x,c=s?s.top:Vn.current.y,u=s?s.height:Vn.current.h,d=s?s.width:Vn.current.w;Yn(!1),En(e=>({...e,x:l,y:c,w:d,h:u}));let h=null;const m=e=>{if(!r){if(Math.abs(e.clientX-o)<kr&&Math.abs(e.clientY-i)<kr)return;r=Er(t,n,"move","move"),a&&(a.style.transition="none")}const s=l+e.clientX-o,u=Math.max(0,c+e.clientY-i);if(a&&(a.style.transform=`translate(${s-l}px, ${u-c}px)`),Vn.current={...Vn.current,x:s,y:u},!B){const t=function(e,t){const n=ir(),r=e<=n.x+rr,o=e>=n.x+n.w-rr,i=t<=n.y+rr,a=t>=n.y+n.h-rr,s=e<=n.x+or,l=e>=n.x+n.w-or,c=t<=n.y+or,u=t>=n.y+n.h-or;return i&&s?"tl":i&&l?"tr":a&&s?"bl":a&&l?"br":c&&r?"tl":c&&o?"tr":u&&r?"bl":u&&o?"br":i?"top":r?"left":o?"right":null}(e.clientX,e.clientY);t!==h&&(h=t,t?pr(hr(t)):fr())}},p=()=>{window.removeEventListener("pointermove",m),window.removeEventListener("pointerup",p),r?.(),fr();const e=ur({...Vn.current});if(Vn.current=e,!B&&h){Kr.current={x:l,y:c,w:d,h:u};const e=hr(h);return a&&(a.style.left=`${e.x}px`,a.style.top=`${e.y}px`,a.style.width=`${e.w}px`,a.style.height=`${e.h}px`,a.style.transform="",a.style.transition=""),void En(e)}if(B){const t=e.x+e.w/2,n=window.innerWidth/2;st(t>n?"right":"left")}a&&(a.style.left=`${e.x}px`,a.style.top=`${e.y}px`,a.style.transform="",a.style.transition=""),En(e)};window.addEventListener("pointermove",m),window.addEventListener("pointerup",p)},[]),jr=ee((e,t)=>{if(0!==e.button)return;e.preventDefault(),e.stopPropagation();const n=e.currentTarget,r=e.pointerId;let o=null;const i=e.clientX,a=e.clientY,s=ct.current,l=s?.getBoundingClientRect(),c=l?l.left:Vn.current.x,u=l?l.top:Vn.current.y,d=l?l.width:Vn.current.w,h=l?l.height:Vn.current.h,m="sw"===t||"nw"===t||"w"===t,p="ne"===t||"nw"===t||"n"===t,f="se"===t||"ne"===t||"e"===t,w="se"===t||"sw"===t||"s"===t;Yn(!1),En({x:c,y:u,w:d,h:h}),Vn.current={x:c,y:u,w:d,h:h};let y=0,g=null;const b=()=>{if(y=0,!g)return;const e=g;g=null,Vn.current=e,s&&(s.style.left=`${e.x}px`,s.style.top=`${e.y}px`,s.style.width=`${e.w}px`,s.style.height=`${e.h}px`)},v=e=>{if(!o){if(Math.abs(e.clientX-i)<kr&&Math.abs(e.clientY-a)<kr)return;o=Er(n,r,xr[t],"resize")}g=((e,t)=>{let n=c,r=u,o=d,i=h;if(f&&(o=Math.max(lr,d+e)),w&&(i=Math.max(cr,h+t)),m){const t=Math.max(lr,d-e);n=c+d-t,o=t}if(p){const e=Math.max(cr,h-t);r=u+h-e,i=e}return{x:n,y:r,w:o,h:i}})(e.clientX-i,e.clientY-a),y||(y=requestAnimationFrame(b))},x=()=>{window.removeEventListener("pointermove",v),window.removeEventListener("pointerup",x),y&&cancelAnimationFrame(y),b(),o?.(),En({...Vn.current})};window.addEventListener("pointermove",v),window.addEventListener("pointerup",x)},[]),Br=ee(e=>{if(e.target.closest("button, input, a, kbd, select, textarea"))return;const t={ArrowLeft:[-1,0],ArrowRight:[1,0],ArrowUp:[0,-1],ArrowDown:[0,1]}[e.key];if(!t&&"Enter"!==e.key)return;if(e.preventDefault(),e.stopPropagation(),er(jt),"Enter"===e.key)return void(Un?(Yn(!1),En(wn())):(Yn(!0),En(fn())));const[n,r]=t;if(e.ctrlKey||e.metaKey){const e=()=>{Kr.current||(Kr.current={...Vn.current})};if(r<0)return e(),Yn(!0),void En(fn());if(r>0){if(Un)return Yn(!1),void En(wn());if(Kr.current){const e=ur(Kr.current);return Kr.current=null,Vn.current=e,void En(e)}return void tr(jt)}e(),Yn(!1);const t=hr(n<0?"left":"right");return Vn.current=t,void En(t)}if(Un)return;const o=Vn.current,i=e.shiftKey?{...o,w:Math.max(lr,o.w+24*n),h:Math.max(cr,o.h+24*r)}:ur({...o,x:o.x+24*n,y:Math.max(0,o.y+24*r)});Vn.current=i,En(i)},[jt,Un,wn,fn]),Hr=ee(e=>{Kr.current||(Kr.current={...Vn.current}),Yn(!1);const t=hr(e);Vn.current=t,En(t),er(jt)},[jt]),Ur=Kn||nn?{}:{tabIndex:0,role:"group","aria-label":$e?`${$e} — ${Oe.windowSuffix}`:Oe.windowSuffix,"aria-keyshortcuts":"ArrowUp ArrowDown ArrowLeft ArrowRight Shift+ArrowUp Shift+ArrowDown Shift+ArrowLeft Shift+ArrowRight Control+ArrowUp Control+ArrowDown Control+ArrowLeft Control+ArrowRight Enter",onKeyDown:Br},Yr=()=>{Yn(!0),En(fn())},Xr=ee(()=>{const e=ct.current;if(!e)return;const t=e.querySelector("form");if(t)t.requestSubmit();else{const t=e.querySelector(on);t&&!t.disabled&&t.click()}},[]);G(()=>{if(!t)return;if(B)return;const e=e=>{if(N[N.length-1]===jt&&!g(e.target,ct.current)&&"Enter"===e.key){const t=e.target;if("TEXTAREA"===t.tagName||t.isContentEditable)return;if(e.metaKey||e.ctrlKey)e.preventDefault(),Xr();else{if("INPUT"===t.tagName&&t.closest("form"))return;if(!(t instanceof Element&&ct.current?.contains(t)))return;if(t.closest(A))return;e.preventDefault()}}};return window.addEventListener("keydown",e,!0),()=>window.removeEventListener("keydown",e,!0)},[t,Xr,jt,B]),G(()=>{if(!t)return;const e=e=>{N[N.length-1]===jt&&(g(e.target,ct.current)||((e.metaKey||e.ctrlKey)&&"s"===e.key?(e.preventDefault(),document.dispatchEvent(new CustomEvent("modal-save",{detail:{modalId:jt}})),Be.current=!1,qe(!1)):e.altKey&&e.shiftKey&&("KeyD"===e.code||"D"===e.key||"d"===e.key)&&(e.preventDefault(),document.dispatchEvent(new CustomEvent("modal-duplicate",{detail:{modalId:jt}})))))};return window.addEventListener("keydown",e,!0),()=>window.removeEventListener("keydown",e,!0)},[t]),G(()=>{if(!t)return;if(B)return;const e=e=>{if("Escape"===e.key&&N[N.length-1]===jt){if(H(e))return e.preventDefault(),void e.stopPropagation();if(Pn&&!P)return;e.preventDefault(),e.stopPropagation(),Sr()}};return window.addEventListener("keydown",e,!0),()=>window.removeEventListener("keydown",e,!0)},[t,Sr,jt,B,Pn,P]);const Vr=t&&(void 0!==p||void 0!==f),[Jr]=Z(()=>{if("undefined"==typeof document)return null;const e=document.createElement("span");return e.className="flex shrink-0 items-center gap-2",e.setAttribute("data-tab-actions",""),e}),_r=Pn&&!Je?.home&&wr.actions.length>0;G(()=>{t&&mr&&function(e,t){const n=Xt.get(e);n&&n.title===t.title&&n.dirty===t.dirty&&n.copy===t.copy&&n.actions===t.actions&&n.menu===t.menu||(Xt.set(e,t),_t())}(mr,{title:wr.text||$e,dirty:dr,copy:wr.copy,actions:_r&&Jr?Jr:void 0,menu:gr.current??void 0})},[t,mr,$e,dr,wr.text,wr.copy,_r,Jr]);const Gr=ee(e=>{const t=document.getElementById("nav-boundary-toast");t&&t.remove();const n="bottom"===e?["That's the last one, chief.","You've hit rock bottom... of the list.","End of the line, buddy.","Nothing left. Go outside.","Congratulations, you scrolled to the void.","There's no more. I checked.","You've reached the edge of the known universe.","Plot twist: there is no next one.","Even scrolling has limits. Unlike your ambition.","Last one. Time to touch grass."]:["Already at the top. Overachiever.","There is no item above this. Trust me.","You're #1. Literally.","Can't go higher. You've peaked.","This is it. The summit. The top.","First item. No VIP lounge above this.","Going up? Nope. Elevator's broken.","You want negative indexes? Bold.","Top of the list. Top of the world.","The only way is down from here."],r=n[Math.floor(Math.random()*n.length)],o=document.createElement("div");o.id="nav-boundary-toast",o.className="fixed bottom-6 left-1/2 -translate-x-1/2 z-(--z-toast) bg-gray-900 text-on-accent flex min-h-10 items-center px-5 py-3 rounded-lg shadow-lg text-sm font-medium transition-opacity duration-300",o.textContent=r,document.body.appendChild(o),setTimeout(()=>{o.style.opacity="0",setTimeout(()=>o.remove(),300)},2e3)},[]);if(G(()=>{if(!t)return;const e=e=>{if(N[N.length-1]!==jt)return;if(g(e.target,ct.current))return;const t=e.target.tagName;"INPUT"!==t&&"TEXTAREA"!==t&&"SELECT"!==t&&(e.target.isContentEditable||("j"===e.key&&Vr&&(e.preventDefault(),p?p():Gr("bottom")),"k"===e.key&&Vr&&(e.preventDefault(),f?f():Gr("top"))))};return window.addEventListener("keydown",e),()=>window.removeEventListener("keydown",e)},[t,p,f,Vr,Gr,jt]),!t||gn.current)return null;const Zr=nn?function(e){if("undefined"==typeof document)return null;const t=Array.from(document.querySelectorAll("[data-modal-panel]")).filter(e=>{const t=e;return!t.hasAttribute("data-utility")&&!t.hasAttribute("data-widget")&&"none"!==t.style.display});t.sort((e,t)=>(e.getAttribute("data-modal-id")||"").localeCompare(t.getAttribute("data-modal-id")||""));const n=t.findIndex(t=>t.getAttribute("data-modal-id")===e),r=t.length;if(n<0||r<1)return null;const o=Math.ceil(Math.sqrt(r)),i=Math.ceil(r/o),a=Math.floor(n/o),s=n%o,l=r-o*(i-1),c=a===i-1&&l<o,u=ir(),d=(u.w-20*(o+1))/o,h=(u.h-14*(i+1)-22*i)/i,m=c?(o-l)*(d+20)/2:0;return{x:u.x+20+s*(d+20)+m,y:u.y+14+a*(h+14+22),w:d,h:h}}(jt):null,Qr=nn&&Zr?Math.min(Zr.w/kn.w,Zr.h/kn.h):1,eo=(()=>{if(nn&&Zr){const e=Qr,t=kn.w*e,n=kn.h*e,r=Zr.x+(Zr.w-t)/2-kn.x,o=Zr.y+(Zr.h-n)/2-kn.y,i=rn||ln;return{transform:`translate(${r}px, ${o}px) scale(${e})`,transformOrigin:"top left",transition:"transform 280ms cubic-bezier(0.2, 0.8, 0.2, 1), box-shadow 280ms",cursor:"pointer",zIndex:F.expose+(i?20:10),boxShadow:i?"0 24px 72px rgba(0,0,0,0.6), 0 0 0 2px rgba(255,255,255,0.55), 0 0 36px 12px rgba(96,165,250,0.85), 0 0 96px 28px rgba(96,165,250,0.55)":"0 16px 48px rgba(0,0,0,0.55)",pointerEvents:"auto"}}if(un&&Qt){const e="picked"===hn;return{transition:e?"transform 640ms cubic-bezier(0.34, 1.42, 0.64, 1), box-shadow 600ms":"transform 600ms cubic-bezier(0.2, 0.8, 0.2, 1), box-shadow 600ms",...e?{zIndex:F.expose+30}:{}}}return null})(),to=b({modal:!1,titleId:!B&&(Pn?!Je?.home:!xe)?je:void 0,label:wr.text||$e}),no=/* @__PURE__ */ce("div",{children:[
|
|
47
|
+
/* @__PURE__ */ue("button",{onClick:t,onFocus:c,onBlur:u,title:e?o.windowed:o.maximize,className:r,children:e?"❐":"⤢"}),i&&/* @__PURE__ */ue("div",{role:"group","aria-label":o.snapLayouts,onMouseEnter:()=>clearTimeout(l.current),onMouseLeave:u,className:"absolute right-0 top-full z-30 mt-1 grid w-max grid-cols-2 gap-1 rounded-lg border border-line bg-surface p-2 shadow-lg",children:wr.map(({zone:e,labelKey:t,region:r})=>/* @__PURE__ */ue("button",{type:"button","aria-label":o[t],title:o[t],onClick:()=>{a(!1),n(e)},onFocus:()=>clearTimeout(l.current),onBlur:u,className:"relative h-7 w-11 rounded border border-gray-300 bg-gray-50 hover:border-blue-400 focus:outline-none focus-visible:ring-2 focus-visible:ring-blue-400",children:/* @__PURE__ */ue("span",{"aria-hidden":"true",className:`absolute rounded-sm bg-blue-500/70 ${r}`,style:{margin:2}})},e))})]})}var vr="rosh-gesture-style";var xr={se:"nwse-resize",nw:"nwse-resize",sw:"nesw-resize",ne:"nesw-resize",n:"ns-resize",s:"ns-resize",e:"ew-resize",w:"ew-resize"},kr=4;function Er(e,t,n,r){!function(){if("undefined"==typeof document||document.getElementById(vr))return;const e=document.createElement("style");e.id=vr,e.textContent="body.rosh-gesturing [data-modal-panel]{will-change:transform}",document.head.appendChild(e)}();try{e.setPointerCapture(t)}catch{}document.body.classList.add("rosh-gesturing");const o=document.createElement("div");o.setAttribute("data-drag-shield",""),o.style.cssText=`position:fixed;inset:0;z-index:2147483647;cursor:${n};background:transparent;touch-action:none`,document.body.appendChild(o);const i=$t(r);let a=!1;return()=>{if(!a){a=!0,i();try{e.releasePointerCapture(t)}catch{}o.remove(),document.body.classList.remove("rosh-gesturing")}}}function Cr(e){const t=N.indexOf(e);if(-1===t)return-1;const n=F.window+t*F.windowStep,r=jn.get(e);if(!r||r.root)return n;let o=-1;for(const[e,t]of jn){if(!t.root||t.owner!==r.owner)continue;const n=N.indexOf(e);-1!==n&&(o=Math.max(o,F.window+n*F.windowStep))}return o>=n?o+2+Math.min(t,7):n}"undefined"!=typeof window&&window.addEventListener("deactivate-all-modals",function(){for(let e=N.length-1;e>=0;e--)nr.has(N[e])||N.splice(e,1);xn=xn.filter(e=>{const t=On.get(e);return null!=t&&nr.has(t)}),En(),Rn(),window.dispatchEvent(new CustomEvent("modal-reorder"))});var Mr="modal-close-request";function Nr(e){Q(T,Kn);const t=X(L);if(N.length<=1)return!0;if(e){const t=On.get(e);if(null!=t)return z()===t}return t?.active??null!=z()}var Sr=!1,Lr=/* @__PURE__ */new Set;function Tr(e){return Lr.add(e),()=>Lr.delete(e)}function zr(){return Sr}function Ar(e){Sr!==e&&(Sr=e,Lr.forEach(e=>e()))}function Dr(){Ar(!Sr)}function Pr(){Ar(!1)}var Ir=null,Wr=/* @__PURE__ */new Set;function Kr(e){return Wr.add(e),()=>Wr.delete(e)}function Rr(){return Ir}function Or(e){Ir!==e&&(Ir=e,Wr.forEach(e=>e()))}var $r=null,jr=/* @__PURE__ */new Set;function Fr(e){return jr.add(e),()=>jr.delete(e)}function qr(){return $r}function Br(e){$r!==e&&($r=e,jr.forEach(e=>e()))}function Hr(){if(!$r)return void Ar(!1);Or($r),Br(null),Ar(!1)}function Ur(){Ar(!Sr),window.dispatchEvent(new CustomEvent("modal-split-view"))}function Yr(){const e=Q(Tr,zr),[t,n]=Z(e),[r,o]=Z(e);return G(()=>{if(e){n(!0);const e=requestAnimationFrame(()=>o(!0));return()=>cancelAnimationFrame(e)}o(!1);const t=setTimeout(()=>n(!1),280);return()=>clearTimeout(t)},[e]),t&&"undefined"!=typeof document?he(
|
|
48
|
+
/* @__PURE__ */ue("div",{onMouseDown:e=>{e.stopPropagation(),Ar(!1)},style:{position:"fixed",inset:0,background:"rgba(0,0,0,0.55)",backdropFilter:"blur(2px)",WebkitBackdropFilter:"blur(2px)",zIndex:F.expose,cursor:"pointer",opacity:r?1:0,transition:"opacity 260ms cubic-bezier(0.2, 0.8, 0.2, 1)",pointerEvents:r?"auto":"none"}}),document.body):null}function Xr({open:t,onClose:l,title:c,icon:u,copyText:d,size:h="lg",dirty:m=!1,onNext:p,onPrev:f,footer:y,bodyScroll:v,onMinimize:x,initialBox:k,actions:S,actionsLeft:D,editing:P=!1,edit:R,allowPinOnTop:j,initialPosition:q,widget:B,compact:Y,appStyle:V,flushBody:ne,autoHeight:re,autoMinHeight:se,autoWidth:le,widgetMenu:me,dimensions:pe,windowKey:fe,openedFromKey:we,accentRgb:ye,children:ge}){const[be,ve]=Z(()=>r()),xe=E()&&!be,ke=C()&&!!B,[Ce,Me]=Z(0),[Ne,Se]=Z(!1),Le=_(null),Te=_(0);G(()=>{Te.current=Ce},[Ce]);const ze=ee(e=>{xe&&(Le.current={startX:e.clientX,startY:e.clientY,pointerId:e.pointerId},Se(!0),Dt(we??null))},[xe,we]),Ae=Q(Pt,At);G(()=>{if(!Ne)return;const e=e=>{if(!Le.current)return;const t=e.clientX-Le.current.startX;if(Math.abs(e.clientY-Le.current.startY)>Math.abs(t)+12)return Le.current=null,Se(!1),Me(0),void Dt(null);Me(Math.max(0,t))},t=()=>{if(!Le.current)return;const e=.3*window.innerWidth,t=Te.current>e;Le.current=null,Se(!1),t?(Me(window.innerWidth),setTimeout(()=>{l(),Me(0),Dt(null)},180)):(Me(0),Dt(null))};return window.addEventListener("pointermove",e),window.addEventListener("pointerup",t),window.addEventListener("pointercancel",t),()=>{window.removeEventListener("pointermove",e),window.removeEventListener("pointerup",t),window.removeEventListener("pointercancel",t)}},[Ne]);const[De,We]=Z(c),Re=U(),Oe=Re.window;G(()=>{We(c)},[c]);const $e=ie(()=>an(De).trim()||void 0,[De]),je=ae(),[Fe,qe]=Z(!1),Be=_(!1),[He,Ue]=Z(!1),[Ye,Xe]=Z(null),Ve=X(tn),Je=X(Ee),{prefs:_e,save:Ge}=M(),Ze=!!_e.window_accent_stripe,Qe=_e.favorite_documents||[],tt=!!Ve&&Qe.some(e=>e.entityType===Ve.entityType&&e.entityId===Ve.entityId),rt=ee(()=>{if(!Ve)return;const e=tt?Qe.filter(e=>!(e.entityType===Ve.entityType&&e.entityId===Ve.entityId)):[...Qe,{entityType:Ve.entityType,entityId:Ve.entityId,label:Ve.label}];Ge({favorite_documents:e})},[Ve,tt,Qe,Ge]),[ot,it]=Z(null),[at,st]=Z("top-right"===q?"right":"left"),lt=_(!1),ct=_(null);J(()=>{const e=ct.current;e&&(ye?e.style.setProperty("--window-accent-rgb",ye):e.style.removeProperty("--window-accent-rgb"))},[ye]);const ut=_(!1),dt=_(null),ht=_(null),mt=_(null),[pt,ft]=Z(!1),wt=_(null),yt=_(null),gt=_(null),[bt,vt]=Z(!1);J(()=>{const e=yt.current,t=gt.current;if(!e||!t)return;const n=()=>vt(function(e,t){return e.scrollWidth>t.clientWidth}(t,e));if(n(),"undefined"==typeof ResizeObserver)return;const r=new ResizeObserver(n);return r.observe(e),r.observe(t),()=>r.disconnect()},[null!=y&&!1!==y]);const xt=!!R&&!B&&!Y&&!V&&(R.editing||"hidden"!==R.state),kt=!!(y||S||D)||pt||xt,Et=X(Ie),Ct=""!==X(en),Mt=_(null);Mt.current=Je?{owner:Je.key,tab:Je.tab,root:!Ct}:null;const Nt=fe||(Je&&!Ct?Je.key:null),St=!!Et&&!Ct&&Et.enabled&&Et.hasState&&(P||Et.declaredEditable)&&!Et.handMounted&&kt&&!B&&!Y&&!V&&!xe,Tt=/* @__PURE__ */ue($,{name:"window",className:"h-4 w-4",strokeWidth:1.5}),zt=u&&te(u)?oe(u,{className:`h-4 w-4 ${u.props?.className??""}`.trim()}):u??Tt,It=()=>/* @__PURE__ */ue("button",{onPointerDown:e=>e.stopPropagation(),onClick:e=>{e.stopPropagation();const t=e.currentTarget.getBoundingClientRect();Xe(e=>e?null:{x:t.left,y:t.bottom+4})},className:"shrink-0 p-0.5 rounded hover:bg-gray-200/50 transition-colors",title:"Window menu",children:zt}),Wt=40,{minimize:Kt,items:Rt,restoreIfMinimized:Ot,openWindows:$t}=nt(),jt=_(`modal-${Math.random().toString(36).slice(2,8)}`).current;G(()=>{if(B)return nr.add(jt),()=>{nr.delete(jt)}},[B,jt]),G(()=>{const e=e=>{const t=e.detail;t?.id===jt&&We(t.title)};return window.addEventListener("window-title-update",e),()=>window.removeEventListener("window-title-update",e)},[jt]);const[Ft,qt]=Z(F.window),Bt=function(e){const t=Q(T,z);return N.length<=1||t===e}(jt),Ht=_(R);Ht.current=R;const Yt=!!R&&!R.editing&&"enabled"===R.state;G(()=>{if(!t||!Bt||!Yt)return;const e=e=>{("KeyE"===e.code||"E"===e.key||"e"===e.key)&&e.altKey&&e.shiftKey&&!e.metaKey&&!e.ctrlKey&&(g(e.target,ct.current)||(e.preventDefault(),e.stopPropagation(),Ht.current?.onEdit()))};return window.addEventListener("keydown",e,!0),()=>window.removeEventListener("keydown",e,!0)},[t,Bt,Yt]);const Vt=function(e){return Q(T,()=>Dn.has(e))}(jt);Lt({panelRef:ct,bodyRef:dt,open:t,widget:!!B,active:Bt,minimized:Vt});const Jt=Q(Tr,zr),Gt=Q(Kr,Rr),Zt=Q(Fr,qr),Qt=!j&&!B,nn=Jt&&Qt,[rn,sn]=Z(!1),ln=nn&&Zt===jt,[un,dn]=Z(!1),hn=un&&Qt&&Gt===jt?"picked":null,mn=_(nn);G(()=>{if(mn.current&&!nn){dn(!0);const e=setTimeout(()=>{dn(!1),Ir===jt&&Or(null)},700);return mn.current=nn,()=>clearTimeout(e)}mn.current=nn},[nn,jt]),G(()=>{nn||sn(!1)},[nn]),G(()=>{const e=ht.current,t=mt.current;if(!e&&!t)return;const n=e=>e?Array.from(e.children).filter(e=>"shell"!==e.dataset.undoControls).length:0,r=()=>ft(n(e)+n(t)>0);r();const o=new MutationObserver(r);return e&&o.observe(e,{childList:!0}),t&&o.observe(t,{childList:!0}),()=>o.disconnect()},[t]),G(()=>{const e=e=>{if(e.target.closest('button[type="submit"]')&&ct.current){const t=ct.current.querySelector("form");t&&(e.preventDefault(),t.requestSubmit())}},t=ht.current,n=mt.current;return t&&t.addEventListener("click",e),n&&n.addEventListener("click",e),()=>{t&&t.removeEventListener("click",e),n&&n.removeEventListener("click",e)}},[t]);const pn=_(!1),fn=ee(e,[]),wn=ee(()=>{const t=e(),n=pe?pe[0]:Ln[h]||672,o=t.w-80,i=t.h-80,a=Math.min(n,o),s=An[zn()],l=pe?Math.min(pe[1],i):(()=>{const e=("sm"===h?500:"md"===h?600:"lg"===h?700:"xl"===h?800:920)*s;return Math.max(320,Math.min(e,t.h-80))})(),c="cascade"!==(getComputedStyle(document.documentElement).getPropertyValue("--window-position")?.trim()||"cascade")||r()?0:30*(N.length-1),u=Math.max(Wt,(i-l)/2),d=(o-a)/2,m=t.h-Wt-l-u;return"top-right"===q?{x:t.x+t.w-a-Wt,y:t.y+Wt,w:a,h:l}:"top-left"===q?{x:t.x+Wt,y:t.y+Wt,w:a,h:l}:{x:t.x+Math.max(Wt,(o-a)/2+Wt)+Math.min(c,Math.max(0,d)),y:t.y+u+Math.min(c,Math.max(0,m)),w:a,h:l}},[h]),gn=_(!1);t||(gn.current=!1);const vn=fe||d||null;G(()=>{if(!t)return;Gn(jt,vn,Mt.current??void 0),fe||er(jt),pn.current=!1,qt(Cr(jt));const e=()=>{qt(Cr(jt))},n=()=>{},r=e=>{if(!e)return!1;if(e.windowKey)return e.windowKey===fe;if(!e.label)return!1;const t=ct.current?.querySelector("[data-window-title]");return!!t?.textContent?.includes(e.label)},o=e=>{if(!r(e.detail))return;if(er(jt),Kn.current)return;const t=ir(),n=Math.min(Vn.current.w,t.w-40),o=Math.min(Vn.current.h,t.h-40),i=t.x+(t.w-n)/2,a=t.y+(t.h-o)/2;En({x:i,y:a,w:n,h:o}),Yn(!1)},i=e=>{const t=e.detail;r(t)&&(er(jt),Xe({x:t.x,y:t.y}))},a=e=>{if(e.detail?.windowKey!==fe)return;er(jt);const t=Vn.current,n=function(e,t=ir()){const n=Math.min(e.w,t.w),r=Math.min(e.h,t.h);return{w:n,h:r,x:Math.min(Math.max(e.x,t.x),t.x+t.w-n),y:Math.min(Math.max(e.y,t.y),t.y+t.h-r)}}(t);if(n.x===t.x&&n.y===t.y&&n.w===t.w&&n.h===t.h)return;const r=ct.current,o="function"==typeof window.matchMedia&&window.matchMedia("(prefers-reduced-motion: reduce)").matches;if(r&&!o){let e=!1;const t=()=>{e||(e=!0,r.style.transition="",window.dispatchEvent(new CustomEvent("modal-geometry")))};r.style.transition="left .28s ease, top .28s ease, width .28s ease, height .28s ease",r.addEventListener("transitionend",t,{once:!0}),window.setTimeout(t,400)}En(n)};return window.addEventListener("modal-reorder",e),window.addEventListener("modal-split-view",n),window.addEventListener("modal-center",o),window.addEventListener("modal-reveal",a),window.addEventListener("modal-context-menu",i),()=>{!function(e){const t=N.indexOf(e);-1!==t&&(N.splice(t,1),Rn()),Dn.delete(e),In.delete(e),jn.delete(e);const n=$n.get(e);n&&($n.delete(e),On.delete(n))}(jt),window.removeEventListener("modal-reorder",e),window.removeEventListener("modal-split-view",n),window.removeEventListener("modal-center",o),window.removeEventListener("modal-reveal",a),window.removeEventListener("modal-context-menu",i),window.dispatchEvent(new CustomEvent("modal-reorder"))}},[t,jt,vn,fn]);const xn=!B&&"maximized"===zn(),[kn,En]=Z(()=>{if(vn&&yn[vn]){const e={...yn[vn]};return pe&&(e.w=pe[0],re||(e.h=pe[1])),ur(e)}return k?{x:k.x,y:k.y,w:k.w,h:k.h}:xn?fn():wn()}),[Cn,Mn]=Z(()=>!re),Nn=_(be),Sn=_(null);G(()=>{const e=()=>{const e=r();e!==Nn.current&&Sn.current?.(e),Nn.current=e,ve(e),qt(Cr(jt))};return window.addEventListener("react-os-shell:layout-mode-changed",e),()=>window.removeEventListener("react-os-shell:layout-mode-changed",e)},[jt]);const Pn=be&&!!Je?.tab&&!Ct&&!B&&!xe,Wn=Pn,Kn=_(Wn);Kn.current=Wn;const Fn=qn(),Bn=be&&!!Je?.tab&&!B&&!xe&&!Jt&&Fn!==Je.key,Hn=!!B&&be&&!Jt&&null!==Fn,[Un,Yn]=Z(()=>vn&&yn[vn]||k?Wn:Wn||xn),Vn=_(kn);Vn.current=kn;const Jn=_(Un);J(()=>{Jn.current=Un},[Un]),J(()=>{if(Cn||Pn)return;const e=ct.current,t=dt.current;if(!e||!t)return;const n=se??(B?0:240),r=parseInt(getComputedStyle(document.documentElement).getPropertyValue("--taskbar-height"))||0;let o=0,i=null,a=null;const s=()=>{const c=t.firstElementChild;if(!c||e.offsetHeight<=0)return;c!==a&&(a&&l.unobserve(a),l.observe(c),a=c);const u=e.offsetHeight-t.offsetHeight,d=t.style.flex,h=t.style.overflowY,m=t.style.height;t.style.flex="0 0 auto",t.style.height="auto",t.style.overflowY="visible";const p=t.offsetHeight,f=c.offsetHeight;t.style.flex=d,t.style.height=m,t.style.overflowY=h;const w=c.offsetHeight>f+4,y=Math.max(n,window.innerHeight-r-Math.max(0,Vn.current.y)-24),g=w?Math.min(Vn.current.h,y):Math.min(Math.max(n,u+p),y),b=Math.abs(g-o)>1;b&&(o=g,En(e=>Math.abs(e.h-g)>1?{...e,h:g}:e)),B||(g<=n?i&&(clearTimeout(i),i=null):(b||null===i)&&(i&&clearTimeout(i),i=setTimeout(()=>{const e=o;s(),o===e&&Mn(!0)},160)))},l=new ResizeObserver(s);s(),wt.current&&l.observe(wt.current);const c=new MutationObserver(s);return c.observe(t,{childList:!0,subtree:!0,characterData:!0}),()=>{l.disconnect(),c.disconnect(),i&&clearTimeout(i)}},[Cn,B,se,kt,Pn]),J(()=>{if(!re||!Cn||B||!t)return;const e=wt.current;if(!e)return;let n=e.offsetHeight;const r=new ResizeObserver(()=>{if(!e.isConnected)return;const t=e.offsetHeight,r=t-n,o=t>0!=n>0;if(n=t,!o||0===r||Un)return;if(document.body.classList.contains("rosh-gesturing"))return;const i=se??240,a=parseInt(getComputedStyle(document.documentElement).getPropertyValue("--taskbar-height"))||0,s=Math.max(i,window.innerHeight-a-Math.max(0,Vn.current.y)-24);En(e=>({...e,h:Math.min(Math.max(i,e.h+r),s)}))});return r.observe(e),()=>r.disconnect()},[re,Cn,B,t,Un,se]);const _n=!1!==le&&!B&&!V&&!xe,[Zn,Qn]=Z(()=>!_n);J(()=>{if(Zn||!t)return;if(!_n||Un)return void Qn(!0);const n=ct.current,r=dt.current;if(!n||!r)return;const o=/* @__PURE__ */new WeakSet;let l=Vn.current.w,c=0;const u=()=>Qn(!0),d=()=>{c=0;const t=Vn.current;if(Math.abs(t.w-l)>1||document.body.classList.contains("rosh-gesturing"))return void u();const d=e(),h=d.w-80;if(t.w>=h)return void u();const m=[],p=[];for(const e of[r,...Array.from(r.querySelectorAll("*"))]){const t=e.scrollWidth-e.clientWidth;if(t<=4||o.has(e))continue;const n=getComputedStyle(e).overflowX;"auto"!==n&&"scroll"!==n||(m.push(e),p.push(t))}if(!m.length)return;const f=Math.min(h,t.w+Math.max(...p)),w=f-t.w,y=n.style.width;n.style.width=`${f}px`;const g=m.map((e,t)=>({over:p[t],residual:e.scrollWidth-e.clientWidth}));n.style.width=y,g.forEach((e,t)=>{i(e,w)||o.add(m[t])});const b=a(t,s(t.w,w,g),d,Wt);b!==t&&(l=b.w,En(b))};d();const h=new MutationObserver(()=>{c||(c=requestAnimationFrame(d))});h.observe(r,{childList:!0,subtree:!0,characterData:!0,attributes:!0,attributeFilter:["style","class","hidden"]});const m=setTimeout(u,Tn);return()=>{h.disconnect(),c&&cancelAnimationFrame(c),clearTimeout(m)}},[Zn,t,_n,Un]);const ar=_(null),sr=!(!Je?.tab||Ct||B||xe);Sn.current=t=>{if(!sr)return;if(t)return ar.current||(ar.current={box:{...Vn.current},maximized:Jn.current}),void(Jn.current=!0);const r=ar.current;ar.current=null;const o=e();if(r?.maximized)return Jn.current=!0,Yn(!0),void En(o);const i=r?.box??(vn?yn[vn]:void 0);if(Jn.current=!1,Yn(!1),i&&!n(i,o,!1)){const e={...i};pe&&(e.w=pe[0],re||(e.h=pe[1])),En(ur(e))}else En(wn())},G(()=>{Wn&&(Jn.current=!0,Yn(!0),En(fn()))},[Wn,fn]),G(()=>{if(B)return;const e=()=>{const e=vn?yn[vn]:void 0;if(Jn.current=!1,Yn(!1),e){const t={...e};pe&&(t.w=pe[0],re||(t.h=pe[1])),En(ur(t))}else En(wn())};return window.addEventListener("react-os-shell:restore-windowed",e),()=>window.removeEventListener("react-os-shell:restore-windowed",e)},[B,wn,vn]),G(()=>{t&&vn&&!Pn&&(yn[vn]=kn,bn()),t&&window.dispatchEvent(new CustomEvent("modal-geometry"))},[kn,t,vn,Pn]),G(()=>{if(!t)return;const e=()=>{Jn.current?En(fn()):document.body.classList.contains("rosh-gesturing")||En(ur)};window.addEventListener("resize",e),window.addEventListener(o,e);let n=null;return Un&&(n=new MutationObserver(e),n.observe(document.body,{childList:!0,subtree:!1,attributes:!0,attributeFilter:["class"]})),()=>{window.removeEventListener("resize",e),window.removeEventListener(o,e),n?.disconnect()}},[t,Un,fn]),G(()=>{if(t&&(qe(!1),Be.current=!1,lt.current=!1,Qn(!_n),!Kn.current)){if(vn&&yn[vn]){const e=yn[vn];return void En(t=>ur({...e,...re?{h:t.h}:{},..._n?{x:t.x,w:t.w}:{}}))}k&&(En({x:k.x,y:k.y,w:k.w,h:k.h}),Yn(k.maximized))}},[t]),G(()=>{if(!t||"auto"!==m)return;let e;const n=t=>{ct.current?.contains(t.target)&&!Be.current&&(Be.current=!0,e=setTimeout(()=>qe(!0),0))};return document.addEventListener("input",n,!0),document.addEventListener("change",n,!0),()=>{clearTimeout(e),document.removeEventListener("input",n,!0),document.removeEventListener("change",n,!0)}},[t,m]);const dr="auto"===m?Fe:!0===m,mr=Je&&!Ct?Je.key:null,wr=ie(()=>Ut(De),[De]),yr=_({shortcutSpec:Ve,isOnDesktop:tt,toggleDesktopShortcut:rt,taskbarStrings:Re.taskbar});J(()=>{yr.current={shortcutSpec:Ve,isOnDesktop:tt,toggleDesktopShortcut:rt,taskbarStrings:Re.taskbar}});const gr=_(null);gr.current||(gr.current={open:(e,t)=>Xe({x:e,y:t}),items:()=>{const e=yr.current,t=[];e.shortcutSpec&&t.push({label:e.isOnDesktop?e.taskbarStrings.removeFromDesktop:e.taskbarStrings.addToDesktop,onSelect:e.toggleDesktopShortcut});for(const e of cn[jt]||[])t.push({label:e.label,icon:e.icon,onSelect:e.onClick});return t}}),G(()=>{if(t&&mr)return()=>{return e=mr,void(Xt.delete(e)&&_t());var e}},[t,mr]),et(!(fe||!t)&&dr);const vr=ee(()=>dr||"auto"===m&&Be.current,[dr,m]),Nr=ee(async e=>{if(lt.current)return!1;if(!vr())return!0;lt.current=!0;const t=$e,n="close"===e?"Are you sure you want to close?":"discard"===e?"Are you sure you want to stop editing?":"Are you sure you want to continue?",r=await w({title:"Discard changes?",message:t?`“${t}” has unsaved changes. ${n} All changes will be lost.`:`You have unsaved changes. ${n} All changes will be lost.`,confirmLabel:"Discard",cancelLabel:"Keep Editing",variant:"warning"});return lt.current=!1,r},[vr,$e]),Sr=ee(()=>lt.current?Promise.resolve():vr()?Nr("close").then(e=>{e&&l()}):(l(),Promise.resolve()),[vr,Nr,l]),Lr=ee(async()=>{await Nr("discard")&&(Be.current=!1,qe(!1),Ht.current?.onDiscard())},[Nr]),Dr=ee(async()=>{const e=await Nr("switch");return e&&(Be.current=!1,qe(!1)),e},[Nr]),Pr=_(()=>!1);J(()=>{Pr.current=vr}),J(()=>{if(!t||!fe)return;const e={holdsChanges:()=>Pr.current(),ask:Dr};return Xn.set(fe,e),()=>{Xn.get(fe)===e&&Xn.delete(fe)}},[t,fe,Dr]),J(()=>{if(!t||!Nt)return;const e=e=>{e.detail?.windowKey===Nt&&Sr()};return window.addEventListener(Mr,e),()=>window.removeEventListener(Mr,e)},[t,Nt,Sr]);const Wr=_(null),$r=ee(e=>{if(0!==e.button)return;if(e.target.closest("button, input, a, kbd, select, textarea"))return;if(Xe(null),er(jt),Kn.current)return void e.preventDefault();e.preventDefault();const t=e.currentTarget,n=e.pointerId;let r=null;const o=e.clientX,i=e.clientY,a=ct.current,s=a?.getBoundingClientRect();let l,c,u,d;if(Wr.current){const t=Wr.current;Wr.current=null,d=t.w,u=t.h;const n=s?Math.min(Math.max(20,e.clientX-s.left),t.w-20):t.w/2;l=e.clientX-n,c=e.clientY-12,a&&(a.style.width=`${d}px`,a.style.height=`${u}px`,a.style.left=`${l}px`,a.style.top=`${c}px`)}else l=s?s.left:Vn.current.x,c=s?s.top:Vn.current.y,u=s?s.height:Vn.current.h,d=s?s.width:Vn.current.w;Yn(!1),En(e=>({...e,x:l,y:c,w:d,h:u}));let h=null;const m=e=>{if(!r){if(Math.abs(e.clientX-o)<kr&&Math.abs(e.clientY-i)<kr)return;r=Er(t,n,"move","move"),a&&(a.style.transition="none")}const s=l+e.clientX-o,u=Math.max(0,c+e.clientY-i);if(a&&(a.style.transform=`translate(${s-l}px, ${u-c}px)`),Vn.current={...Vn.current,x:s,y:u},!B){const t=function(e,t){const n=ir(),r=e<=n.x+rr,o=e>=n.x+n.w-rr,i=t<=n.y+rr,a=t>=n.y+n.h-rr,s=e<=n.x+or,l=e>=n.x+n.w-or,c=t<=n.y+or,u=t>=n.y+n.h-or;return i&&s?"tl":i&&l?"tr":a&&s?"bl":a&&l?"br":c&&r?"tl":c&&o?"tr":u&&r?"bl":u&&o?"br":i?"top":r?"left":o?"right":null}(e.clientX,e.clientY);t!==h&&(h=t,t?pr(hr(t)):fr())}},p=()=>{window.removeEventListener("pointermove",m),window.removeEventListener("pointerup",p),r?.(),fr();const e=ur({...Vn.current});if(Vn.current=e,!B&&h){Wr.current={x:l,y:c,w:d,h:u};const e=hr(h);return a&&(a.style.left=`${e.x}px`,a.style.top=`${e.y}px`,a.style.width=`${e.w}px`,a.style.height=`${e.h}px`,a.style.transform="",a.style.transition=""),void En(e)}if(B){const t=e.x+e.w/2,n=window.innerWidth/2;st(t>n?"right":"left")}a&&(a.style.left=`${e.x}px`,a.style.top=`${e.y}px`,a.style.transform="",a.style.transition=""),En(e)};window.addEventListener("pointermove",m),window.addEventListener("pointerup",p)},[]),jr=ee((e,t)=>{if(0!==e.button)return;e.preventDefault(),e.stopPropagation();const n=e.currentTarget,r=e.pointerId;let o=null;const i=e.clientX,a=e.clientY,s=ct.current,l=s?.getBoundingClientRect(),c=l?l.left:Vn.current.x,u=l?l.top:Vn.current.y,d=l?l.width:Vn.current.w,h=l?l.height:Vn.current.h,m="sw"===t||"nw"===t||"w"===t,p="ne"===t||"nw"===t||"n"===t,f="se"===t||"ne"===t||"e"===t,w="se"===t||"sw"===t||"s"===t;Yn(!1),En({x:c,y:u,w:d,h:h}),Vn.current={x:c,y:u,w:d,h:h};let y=0,g=null;const b=()=>{if(y=0,!g)return;const e=g;g=null,Vn.current=e,s&&(s.style.left=`${e.x}px`,s.style.top=`${e.y}px`,s.style.width=`${e.w}px`,s.style.height=`${e.h}px`)},v=e=>{if(!o){if(Math.abs(e.clientX-i)<kr&&Math.abs(e.clientY-a)<kr)return;o=Er(n,r,xr[t],"resize")}g=((e,t)=>{let n=c,r=u,o=d,i=h;if(f&&(o=Math.max(lr,d+e)),w&&(i=Math.max(cr,h+t)),m){const t=Math.max(lr,d-e);n=c+d-t,o=t}if(p){const e=Math.max(cr,h-t);r=u+h-e,i=e}return{x:n,y:r,w:o,h:i}})(e.clientX-i,e.clientY-a),y||(y=requestAnimationFrame(b))},x=()=>{window.removeEventListener("pointermove",v),window.removeEventListener("pointerup",x),y&&cancelAnimationFrame(y),b(),o?.(),En({...Vn.current})};window.addEventListener("pointermove",v),window.addEventListener("pointerup",x)},[]),Br=ee(e=>{if(e.target.closest("button, input, a, kbd, select, textarea"))return;const t={ArrowLeft:[-1,0],ArrowRight:[1,0],ArrowUp:[0,-1],ArrowDown:[0,1]}[e.key];if(!t&&"Enter"!==e.key)return;if(e.preventDefault(),e.stopPropagation(),er(jt),"Enter"===e.key)return void(Un?(Yn(!1),En(wn())):(Yn(!0),En(fn())));const[n,r]=t;if(e.ctrlKey||e.metaKey){const e=()=>{Wr.current||(Wr.current={...Vn.current})};if(r<0)return e(),Yn(!0),void En(fn());if(r>0){if(Un)return Yn(!1),void En(wn());if(Wr.current){const e=ur(Wr.current);return Wr.current=null,Vn.current=e,void En(e)}return void tr(jt)}e(),Yn(!1);const t=hr(n<0?"left":"right");return Vn.current=t,void En(t)}if(Un)return;const o=Vn.current,i=e.shiftKey?{...o,w:Math.max(lr,o.w+24*n),h:Math.max(cr,o.h+24*r)}:ur({...o,x:o.x+24*n,y:Math.max(0,o.y+24*r)});Vn.current=i,En(i)},[jt,Un,wn,fn]),Hr=ee(e=>{Wr.current||(Wr.current={...Vn.current}),Yn(!1);const t=hr(e);Vn.current=t,En(t),er(jt)},[jt]),Ur=Wn||nn?{}:{tabIndex:0,role:"group","aria-label":$e?`${$e} — ${Oe.windowSuffix}`:Oe.windowSuffix,"aria-keyshortcuts":"ArrowUp ArrowDown ArrowLeft ArrowRight Shift+ArrowUp Shift+ArrowDown Shift+ArrowLeft Shift+ArrowRight Control+ArrowUp Control+ArrowDown Control+ArrowLeft Control+ArrowRight Enter",onKeyDown:Br},Yr=()=>{Yn(!0),En(fn())},Xr=ee(()=>{const e=ct.current;if(!e)return;const t=e.querySelector("form");if(t)t.requestSubmit();else{const t=e.querySelector(on);t&&!t.disabled&&t.click()}},[]);G(()=>{if(!t)return;if(B)return;const e=e=>{if(N[N.length-1]===jt&&!g(e.target,ct.current)&&"Enter"===e.key){const t=e.target;if("TEXTAREA"===t.tagName||t.isContentEditable)return;if(e.metaKey||e.ctrlKey)e.preventDefault(),Xr();else{if("INPUT"===t.tagName&&t.closest("form"))return;if(!(t instanceof Element&&ct.current?.contains(t)))return;if(t.closest(A))return;e.preventDefault()}}};return window.addEventListener("keydown",e,!0),()=>window.removeEventListener("keydown",e,!0)},[t,Xr,jt,B]),G(()=>{if(!t)return;const e=e=>{N[N.length-1]===jt&&(g(e.target,ct.current)||((e.metaKey||e.ctrlKey)&&"s"===e.key?(e.preventDefault(),document.dispatchEvent(new CustomEvent("modal-save",{detail:{modalId:jt}})),Be.current=!1,qe(!1)):e.altKey&&e.shiftKey&&("KeyD"===e.code||"D"===e.key||"d"===e.key)&&(e.preventDefault(),document.dispatchEvent(new CustomEvent("modal-duplicate",{detail:{modalId:jt}})))))};return window.addEventListener("keydown",e,!0),()=>window.removeEventListener("keydown",e,!0)},[t]),G(()=>{if(!t)return;if(B)return;const e=e=>{if("Escape"===e.key&&N[N.length-1]===jt){if(H(e))return e.preventDefault(),void e.stopPropagation();if(Pn&&!P)return;e.preventDefault(),e.stopPropagation(),Sr()}};return window.addEventListener("keydown",e,!0),()=>window.removeEventListener("keydown",e,!0)},[t,Sr,jt,B,Pn,P]);const Vr=t&&(void 0!==p||void 0!==f),[Jr]=Z(()=>{if("undefined"==typeof document)return null;const e=document.createElement("span");return e.className="flex shrink-0 items-center gap-2",e.setAttribute("data-tab-actions",""),e}),_r=Pn&&!Je?.home&&wr.actions.length>0;G(()=>{t&&mr&&function(e,t){const n=Xt.get(e);n&&n.title===t.title&&n.dirty===t.dirty&&n.copy===t.copy&&n.actions===t.actions&&n.menu===t.menu||(Xt.set(e,t),_t())}(mr,{title:wr.text||$e,dirty:dr,copy:wr.copy,actions:_r&&Jr?Jr:void 0,menu:gr.current??void 0})},[t,mr,$e,dr,wr.text,wr.copy,_r,Jr]);const Gr=ee(e=>{const t=document.getElementById("nav-boundary-toast");t&&t.remove();const n="bottom"===e?["That's the last one, chief.","You've hit rock bottom... of the list.","End of the line, buddy.","Nothing left. Go outside.","Congratulations, you scrolled to the void.","There's no more. I checked.","You've reached the edge of the known universe.","Plot twist: there is no next one.","Even scrolling has limits. Unlike your ambition.","Last one. Time to touch grass."]:["Already at the top. Overachiever.","There is no item above this. Trust me.","You're #1. Literally.","Can't go higher. You've peaked.","This is it. The summit. The top.","First item. No VIP lounge above this.","Going up? Nope. Elevator's broken.","You want negative indexes? Bold.","Top of the list. Top of the world.","The only way is down from here."],r=n[Math.floor(Math.random()*n.length)],o=document.createElement("div");o.id="nav-boundary-toast",o.className="fixed bottom-6 left-1/2 -translate-x-1/2 z-(--z-toast) bg-gray-900 text-on-accent flex min-h-10 items-center px-5 py-3 rounded-lg shadow-lg text-sm font-medium transition-opacity duration-300",o.textContent=r,document.body.appendChild(o),setTimeout(()=>{o.style.opacity="0",setTimeout(()=>o.remove(),300)},2e3)},[]);if(G(()=>{if(!t)return;const e=e=>{if(N[N.length-1]!==jt)return;if(g(e.target,ct.current))return;const t=e.target.tagName;"INPUT"!==t&&"TEXTAREA"!==t&&"SELECT"!==t&&(e.target.isContentEditable||("j"===e.key&&Vr&&(e.preventDefault(),p?p():Gr("bottom")),"k"===e.key&&Vr&&(e.preventDefault(),f?f():Gr("top"))))};return window.addEventListener("keydown",e),()=>window.removeEventListener("keydown",e)},[t,p,f,Vr,Gr,jt]),!t||gn.current)return null;const Zr=nn?function(e){if("undefined"==typeof document)return null;const t=Array.from(document.querySelectorAll("[data-modal-panel]")).filter(e=>{const t=e;return!t.hasAttribute("data-utility")&&!t.hasAttribute("data-widget")&&"none"!==t.style.display});t.sort((e,t)=>(e.getAttribute("data-modal-id")||"").localeCompare(t.getAttribute("data-modal-id")||""));const n=t.findIndex(t=>t.getAttribute("data-modal-id")===e),r=t.length;if(n<0||r<1)return null;const o=Math.ceil(Math.sqrt(r)),i=Math.ceil(r/o),a=Math.floor(n/o),s=n%o,l=r-o*(i-1),c=a===i-1&&l<o,u=ir(),d=(u.w-20*(o+1))/o,h=(u.h-14*(i+1)-22*i)/i,m=c?(o-l)*(d+20)/2:0;return{x:u.x+20+s*(d+20)+m,y:u.y+14+a*(h+14+22),w:d,h:h}}(jt):null,Qr=nn&&Zr?Math.min(Zr.w/kn.w,Zr.h/kn.h):1,eo=(()=>{if(nn&&Zr){const e=Qr,t=kn.w*e,n=kn.h*e,r=Zr.x+(Zr.w-t)/2-kn.x,o=Zr.y+(Zr.h-n)/2-kn.y,i=rn||ln;return{transform:`translate(${r}px, ${o}px) scale(${e})`,transformOrigin:"top left",transition:"transform 280ms cubic-bezier(0.2, 0.8, 0.2, 1), box-shadow 280ms",cursor:"pointer",zIndex:F.expose+(i?20:10),boxShadow:i?"0 24px 72px rgba(0,0,0,0.6), 0 0 0 2px rgba(255,255,255,0.55), 0 0 36px 12px rgba(96,165,250,0.85), 0 0 96px 28px rgba(96,165,250,0.55)":"0 16px 48px rgba(0,0,0,0.55)",pointerEvents:"auto"}}if(un&&Qt){const e="picked"===hn;return{transition:e?"transform 640ms cubic-bezier(0.34, 1.42, 0.64, 1), box-shadow 600ms":"transform 600ms cubic-bezier(0.2, 0.8, 0.2, 1), box-shadow 600ms",...e?{zIndex:F.expose+30}:{}}}return null})(),to=b({modal:!1,titleId:!B&&(Pn?!Je?.home:!xe)?je:void 0,label:wr.text||$e}),no=/* @__PURE__ */ce("div",{children:[
|
|
49
49
|
/* @__PURE__ */ce("div",{ref:ct,"data-modal-panel":!0,"data-modal-id":jt,"data-window-key":fe||void 0,...j?{"data-utility":""}:{},...He?{"data-pinned-top":""}:{},...B?{"data-widget":""}:{},...Je?{"data-window-owner":Je.key}:{},...Je&&!Ct?{"data-window-root":""}:{},...Pn?{"data-window-tab":""}:{},...to,className:Pn?"fixed flex flex-col overflow-hidden":"fixed rounded-(--radius-window) flex flex-col overflow-hidden "+(B?Bt?"shadow-xl":"shadow-lg":"border "+(Bt?"shadow-xl border-line":"shadow-lg border-line-strong")),onMouseDownCapture:e=>{if(ut.current=!1,nn){if(e.target.closest("[data-expose-close]"))return;return e.preventDefault(),e.stopPropagation(),Or(jt),Ar(!1),void er(jt)}if(!Bt&&!B&&!He&&0===e.button){const t=e.target;t.closest("[data-modal-panel]")===ct.current&&t.closest("button, input, a, select, textarea")&&!t.closest("[data-window-chrome]")&&(e.preventDefault(),e.stopPropagation(),ut.current=!0,Xe(null),er(jt),window.addEventListener("mouseup",()=>{setTimeout(()=>{ut.current=!1},0)},{once:!0}))}},onClickCapture:e=>{ut.current&&(ut.current=!1,e.preventDefault(),e.stopPropagation())},onMouseDown:e=>{if(nn)return;Xe(null);e.target.closest("[data-modal-panel]")===ct.current&&(e.target.closest("button, input, a, select, textarea")||er(jt))},style:xe?{zIndex:Ft+1,top:0,left:0,right:0,bottom:"var(--mobile-bottom-nav, 56px)",width:"auto",height:"auto",transform:`translateX(${Ce}px)`,transition:Ne?"none":"transform 180ms ease-out",...B?{display:"none"}:{},...Ft<0?{display:"none"}:{},...Bt||He||Ae&&fe===Ae?{}:{display:"none"}}:{zIndex:He?F.pinnedWindow:Ft+1,width:kn.w,height:kn.h,top:kn.y,...B&&"right"===at?{right:window.innerWidth-kn.x-kn.w}:{left:kn.x},...Ft<0&&!He?{display:"none"}:{},...ke?{display:"none"}:{},...Bn||Hn?{visibility:"hidden",pointerEvents:"none"}:{},...eo??{}},children:[xe&&!B&&/* @__PURE__ */ue("div",{onPointerDown:ze,className:"absolute top-0 bottom-0 left-0 w-[22px] z-[5]",style:{touchAction:"pan-y"},"aria-hidden":"true"}),B?null:Pn?Je?.home?null:/* @__PURE__ */ce(de,{children:[
|
|
50
50
|
/* @__PURE__ */ue("h2",{id:je,"data-window-title":!0,className:"sr-only",children:wr.text||$e}),_r&&Jr&&he(
|
|
51
51
|
/* @__PURE__ */ue(de,{children:wr.actions}),Jr),wr.badges.length>0&&/* @__PURE__ */ue("div",{"data-window-chrome":"","data-record-bar":"",className:"flex h-9 shrink-0 select-none items-center gap-2 overflow-hidden border-b border-gray-200 px-4",style:{backgroundColor:"rgb(var(--window-content-rgb))"},children:wr.badges})]}):xe?null:
|
|
@@ -55,26 +55,26 @@ return ce("span",{className:"relative inline-flex",onMouseEnter:c,onMouseLeave:u
|
|
|
55
55
|
/* @__PURE__ */ue("button",{type:"button",onClick:Sr,"aria-label":Oe.close,className:"rounded p-0.5 text-ink-faintest hover:text-gray-600 hover:bg-gray-200",children:/* @__PURE__ */ue($,{name:"close",className:"h-4 w-4"})})]})]}:V?{onPointerDown:$r,"data-window-chrome":"",...Ur,className:"flex items-center justify-between h-(--row-height-compact-bar) px-3 border-b border-line shrink-0 cursor-move select-none rounded-t-(--radius-window) focus:outline-none focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-blue-400 "+(Bt?"backdrop-blur-sm":""),style:{touchAction:"none",backgroundColor:Bt?"rgb(var(--window-header-rgb) / var(--active-header-opacity, 0.8))":"rgb(var(--window-header-rgb) / var(--inactive-header-opacity, 0.7))"},children:[
|
|
56
56
|
/* @__PURE__ */ce("div",{"data-window-title":!0,title:$e,className:"text-sm font-medium min-w-0 flex-1 truncate flex items-center gap-2",style:{color:Bt?"var(--window-title-active, rgb(17 24 39))":"var(--window-title-inactive, rgb(156 163 175))"},children:[!nn&&It(),
|
|
57
57
|
/* @__PURE__ */ue("span",{id:je,className:"truncate",children:nn?an(De):De})]}),!nn&&/* @__PURE__ */ce("div",{className:"flex items-center gap-2 shrink-0 ml-2",children:[j&&/* @__PURE__ */ue("button",{onClick:()=>Ue(e=>!e),title:He?Oe.unpin:Oe.pinOnTop,className:"p-0.5 rounded hover:bg-gray-200 "+(He?"text-blue-600":"text-gray-400 hover:text-gray-600"),children:/* @__PURE__ */ue($,{name:"bookmark-square",className:"h-3 w-3",fill:He?"currentColor":"none",strokeWidth:1.5})}),
|
|
58
|
-
/* @__PURE__ */ue("button",{onClick:()=>tr(jt),title:Oe.minimize,className:"text-gray-400 hover:text-gray-600 px-1 py-0.5 rounded hover:bg-gray-200 text-xs leading-none",children:"─"}),!
|
|
58
|
+
/* @__PURE__ */ue("button",{onClick:()=>tr(jt),title:Oe.minimize,className:"text-gray-400 hover:text-gray-600 px-1 py-0.5 rounded hover:bg-gray-200 text-xs leading-none",children:"─"}),!Wn&&/* @__PURE__ */ue(br,{maximized:Un,onToggleMax:()=>{Un?(Yn(!1),En(wn())):Yr()},onSnap:Hr,buttonClassName:"text-gray-400 hover:text-gray-600 px-1 py-0.5 rounded hover:bg-gray-200 text-xs leading-none",strings:Oe}),
|
|
59
59
|
/* @__PURE__ */ue("button",{type:"button",onClick:Sr,"aria-label":Oe.close,className:"rounded p-0.5 text-ink-faintest hover:text-gray-600 hover:bg-gray-200",children:/* @__PURE__ */ue($,{name:"close",className:"h-4 w-4"})})]})]}:{onPointerDown:$r,"data-window-chrome":"",...Ur,className:"flex items-center justify-between h-(--row-height-window-bar) px-3 border-b border-gray-200 shrink-0 cursor-move select-none rounded-t-(--radius-window) focus:outline-none focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-blue-400 "+(Bt?"backdrop-blur-sm":""),style:{touchAction:"none",backgroundColor:Bt?"rgb(var(--window-header-rgb) / var(--active-header-opacity, 0.8))":"rgb(var(--window-header-rgb) / var(--inactive-header-opacity, 0.7))"},children:[
|
|
60
60
|
/* @__PURE__ */ce("div",{"data-window-title":!0,title:$e,className:"text-sm font-medium min-w-0 flex-1 truncate flex items-center gap-2",style:{color:Bt?"var(--window-title-active, rgb(17 24 39))":"var(--window-title-inactive, rgb(156 163 175))"},children:[!nn&&It(),
|
|
61
61
|
/* @__PURE__ */ue("span",{id:je,className:"truncate",children:nn?an(De):De})]}),!nn&&/* @__PURE__ */ce("div",{className:"flex items-center gap-3 shrink-0 ml-4",children:[j&&/* @__PURE__ */ue("button",{onClick:()=>Ue(e=>!e),title:He?Oe.unpin:Oe.pinOnTop,className:"text-xs px-2 py-1 rounded hover:bg-gray-200 "+(He?"text-blue-600":"text-gray-400 hover:text-gray-600"),children:/* @__PURE__ */ue($,{name:"bookmark-square",className:"h-3.5 w-3.5",fill:He?"currentColor":"none",strokeWidth:1.5})}),
|
|
62
|
-
/* @__PURE__ */ue("button",{onClick:()=>tr(jt),title:Oe.minimize,className:"text-gray-400 hover:text-gray-600 text-xs px-2 py-1 rounded hover:bg-gray-200",children:"─"}),!
|
|
62
|
+
/* @__PURE__ */ue("button",{onClick:()=>tr(jt),title:Oe.minimize,className:"text-gray-400 hover:text-gray-600 text-xs px-2 py-1 rounded hover:bg-gray-200",children:"─"}),!Wn&&/* @__PURE__ */ue(br,{maximized:Un,onToggleMax:()=>{Un?(Yn(!1),En(wn())):Yr()},onSnap:Hr,buttonClassName:"text-gray-400 hover:text-gray-600 text-xs px-2 py-1 rounded hover:bg-gray-200",strings:Oe}),
|
|
63
63
|
/* @__PURE__ */ue("button",{type:"button",onClick:Sr,"aria-label":Oe.close,className:"rounded-(--radius-control) text-ink-faintest hover:text-gray-600",children:/* @__PURE__ */ue($,{name:"close",className:"h-5 w-5"})})]})]}),ye&&Ze&&!B&&!xe&&/* @__PURE__ */ue("div",{"aria-hidden":"true",className:"h-[3px] shrink-0 pointer-events-none",style:{backgroundColor:`rgb(var(--window-accent-rgb) / ${Bt?.9:.55})`}}),
|
|
64
64
|
/* @__PURE__ */ue(en.Provider,{value:jt,children:/* @__PURE__ */ue(L.Provider,{value:{rightRef:ht,leftRef:mt,notify:()=>ft(!0),active:Bt,isDirty:dr,footerOpen:kt&&!B&&!Y&&!V&&!xe},children:/* @__PURE__ */ue("div",{ref:dt,...B?{onPointerDown:$r,onContextMenu:e=>{e.preventDefault(),it({x:e.clientX,y:e.clientY})}}:{},className:`flex-1 min-h-0 flex flex-col ${B?"p-0 cursor-move":V||ne?"p-0":Y?"p-2":"p-4"} ${B||Pn?"":"backdrop-blur-sm"} ${!1===v||V||ne?"overflow-hidden":"overflow-y-auto overscroll-contain"} ${B?"rounded-2xl select-none":""}`,style:{...B?{touchAction:"none"}:{},backgroundColor:B?"transparent":Pn?"rgb(var(--window-content-rgb))":Bt?"rgb(var(--window-content-rgb) / var(--active-content-opacity, 0.9))":"rgb(var(--window-content-rgb) / var(--inactive-content-opacity, 0.8))"},children:/* @__PURE__ */ue(Pe,{children:ge})})})}),B&&ot&&/* @__PURE__ */ce(I,{minWidth:160,style:{left:ot.x,top:ot.y},onClose:()=>it(null),children:[
|
|
65
|
-
/* @__PURE__ */ue(
|
|
66
|
-
/* @__PURE__ */ue(
|
|
67
|
-
/* @__PURE__ */ue(
|
|
68
|
-
/* @__PURE__ */ce(
|
|
65
|
+
/* @__PURE__ */ue(W,{onClick:()=>{it(null),window.dispatchEvent(new CustomEvent("widget-open-settings",{detail:jt}))},children:"Settings"}),
|
|
66
|
+
/* @__PURE__ */ue(K,{}),me&&/* @__PURE__ */ce(de,{children:[me,
|
|
67
|
+
/* @__PURE__ */ue(K,{})]}),
|
|
68
|
+
/* @__PURE__ */ce(W,{onClick:()=>{it(null),Ue(e=>!e)},children:[
|
|
69
69
|
/* @__PURE__ */ue("span",{className:"flex-1",children:"Always on Top"}),He&&/* @__PURE__ */ue($,{name:"check",className:"h-4 w-4 text-blue-600 shrink-0",strokeWidth:2})]}),
|
|
70
|
-
/* @__PURE__ */ue(
|
|
71
|
-
/* @__PURE__ */ue(
|
|
70
|
+
/* @__PURE__ */ue(K,{}),
|
|
71
|
+
/* @__PURE__ */ue(W,{onClick:()=>{it(null),Sr()},children:"Close"})]}),
|
|
72
72
|
/* @__PURE__ */ce("div",{onPointerDown:$r,ref:wt,"data-modal-footer":"",className:`px-4 py-2 border-t border-gray-200 shrink-0 flex items-center justify-between text-xs select-none${Pn?"":" cursor-move"}${Bt&&!Pn?" backdrop-blur-sm":""}${B||Y||V||xe||!kt?" hidden":""}`,style:{touchAction:"none",backgroundColor:Pn?"rgb(var(--window-footer-rgb))":Bt?"rgb(var(--window-footer-rgb) / var(--active-header-opacity, 0.8))":"rgb(var(--window-footer-rgb) / var(--inactive-header-opacity, 0.7))"},children:[
|
|
73
|
-
/* @__PURE__ */ce("div",{className:"flex items-center gap-2 min-w-0 flex-1",children:[St&&/* @__PURE__ */ue(
|
|
73
|
+
/* @__PURE__ */ce("div",{className:"flex items-center gap-2 min-w-0 flex-1",children:[St&&/* @__PURE__ */ue(Ke,{auto:!0}),D,
|
|
74
74
|
/* @__PURE__ */ue("div",{ref:mt,"data-modal-actions-left":!0,className:"flex items-center gap-2 shrink-0"}),null!=y&&!1!==y&&
|
|
75
75
|
/* @__PURE__ */ue("div",{ref:yt,"data-modal-footer-facts":"",className:"min-w-0 flex-1 overflow-hidden",children:/* @__PURE__ */ue("div",{ref:gt,className:"inline-flex items-center gap-2 whitespace-nowrap"+(bt?" invisible":""),children:y})})]}),
|
|
76
76
|
/* @__PURE__ */ce("div",{"data-modal-footer-right":"",className:"flex items-center gap-2 ml-auto shrink-0",children:[xt&&R&&(R.editing?/* @__PURE__ */ue(O,{variant:"secondary",size:"sm","data-modal-discard":"",onClick:()=>{Lr()},children:Oe.discard}):"object"==typeof R.state?/* @__PURE__ */ue(O,{variant:"secondary",size:"sm","data-modal-edit":"","aria-disabled":!0,disabledReason:R.state.disabledReason,children:Oe.edit}):/* @__PURE__ */ue(O,{variant:"secondary",size:"sm","data-modal-edit":"",onClick:()=>R.onEdit(),children:Oe.edit})),
|
|
77
|
-
/* @__PURE__ */ue("div",{ref:ht,"data-modal-actions":!0,className:"flex items-center gap-2"}),S]})]}),!B&&!xe&&!nn&&Bt&&!
|
|
77
|
+
/* @__PURE__ */ue("div",{ref:ht,"data-modal-actions":!0,className:"flex items-center gap-2"}),S]})]}),!B&&!xe&&!nn&&Bt&&!Wn&&/* @__PURE__ */ce(de,{children:[
|
|
78
78
|
/* @__PURE__ */ue("div",{onPointerDown:e=>jr(e,"se"),className:"absolute bottom-0 right-0 w-3 h-3 cursor-nwse-resize z-10"}),
|
|
79
79
|
/* @__PURE__ */ue("div",{onPointerDown:e=>jr(e,"sw"),className:"absolute bottom-0 left-0 w-3 h-3 cursor-nesw-resize z-10"}),
|
|
80
80
|
/* @__PURE__ */ue("div",{onPointerDown:e=>jr(e,"ne"),className:"absolute top-0 right-0 w-3 h-3 cursor-nesw-resize z-10"}),
|
|
@@ -83,17 +83,17 @@ return ce("span",{className:"relative inline-flex",onMouseEnter:c,onMouseLeave:u
|
|
|
83
83
|
/* @__PURE__ */ue("div",{onPointerDown:e=>jr(e,"s"),className:"absolute bottom-0 left-3 right-3 h-1 cursor-ns-resize"}),
|
|
84
84
|
/* @__PURE__ */ue("div",{onPointerDown:e=>jr(e,"e"),className:"absolute top-3 bottom-3 right-0 w-1 cursor-ew-resize"}),
|
|
85
85
|
/* @__PURE__ */ue("div",{onPointerDown:e=>jr(e,"w"),className:"absolute top-3 bottom-3 left-0 w-1 cursor-ew-resize"})]}),nn&&/* @__PURE__ */ue("div",{className:"absolute inset-0",style:{zIndex:F.hint,cursor:"pointer",background:"transparent"},onMouseEnter:()=>sn(!0),onMouseLeave:()=>sn(!1),onMouseDown:e=>{e.stopPropagation(),e.preventDefault(),er(jt),Ar(!1)},onClick:e=>{e.stopPropagation(),e.preventDefault()},children:rn&&/* @__PURE__ */ue("button",{type:"button","data-expose-close":!0,"aria-label":Re.taskbar.closeWindow,title:"Close",className:"absolute flex items-center justify-center rounded-full bg-black/55 text-on-accent shadow-lg ring-1 ring-white/40 transition-colors hover:bg-red-500",style:{top:8,right:8,width:30,height:30,transform:`scale(${1/Qr})`,transformOrigin:"top right",zIndex:F.raised},onMouseDown:e=>{e.stopPropagation(),e.preventDefault()},onClick:e=>{e.stopPropagation(),e.preventDefault(),Sr()},children:/* @__PURE__ */ue($,{name:"close",className:"h-4 w-4",strokeWidth:2.2})})})]}),nn&&Zr&&/* @__PURE__ */ue("div",{className:"fixed pointer-events-none select-none truncate text-center",style:{left:Zr.x,top:Zr.y+Zr.h+4,width:Zr.w,zIndex:F.expose+(rn?21:11),color:"white",fontSize:"var(--text-xs)",fontWeight:500,textShadow:"0 1px 2px rgba(0,0,0,0.6)"},children:an(De)})]}),ro=Ye&&/* @__PURE__ */ce(I,{style:{left:Ye.x,top:Ye.y},onClose:()=>Xe(null),minWidth:160,children:[!B&&!Y&&!Pn&&/* @__PURE__ */ce(de,{children:[
|
|
86
|
-
/* @__PURE__ */ce(
|
|
87
|
-
/* @__PURE__ */ue($,{name:"remove",className:"h-4 w-4",strokeWidth:1.5}),Oe.minimize]}),!
|
|
86
|
+
/* @__PURE__ */ce(W,{onClick:()=>{tr(jt),Xe(null)},children:[
|
|
87
|
+
/* @__PURE__ */ue($,{name:"remove",className:"h-4 w-4",strokeWidth:1.5}),Oe.minimize]}),!Wn&&/* @__PURE__ */ce(W,Un?{onClick:()=>{Yn(!1),En(wn()),Xe(null)},children:[
|
|
88
88
|
/* @__PURE__ */ue($,{name:"collapse",className:"h-4 w-4",strokeWidth:1.5}),Oe.windowed]}:{onClick:()=>{Yr(),Xe(null)},children:[
|
|
89
|
-
/* @__PURE__ */ue($,{name:"expand",className:"h-4 w-4",strokeWidth:1.5}),Oe.maximize]})]}),j&&!Pn&&/* @__PURE__ */ce(
|
|
90
|
-
/* @__PURE__ */ue($,{name:"bookmark-square",className:"h-4 w-4 "+(He?"text-blue-600":""),fill:He?"currentColor":"none",strokeWidth:1.5}),He?Oe.unpin:Oe.pinOnTop]}),Ve&&/* @__PURE__ */ce(
|
|
91
|
-
/* @__PURE__ */ue($,{name:"star",className:"h-4 w-4",fill:tt?"currentColor":"none",strokeWidth:1.5}),tt?Re.taskbar.removeFromDesktop:Re.taskbar.addToDesktop]}),(cn[jt]||[]).length>0&&/* @__PURE__ */ue(de,{children:(cn[jt]||[]).map((e,t)=>/* @__PURE__ */ce(
|
|
92
|
-
/* @__PURE__ */ue(
|
|
93
|
-
/* @__PURE__ */ce(
|
|
89
|
+
/* @__PURE__ */ue($,{name:"expand",className:"h-4 w-4",strokeWidth:1.5}),Oe.maximize]})]}),j&&!Pn&&/* @__PURE__ */ce(W,{onClick:()=>{Ue(e=>!e),Xe(null)},children:[
|
|
90
|
+
/* @__PURE__ */ue($,{name:"bookmark-square",className:"h-4 w-4 "+(He?"text-blue-600":""),fill:He?"currentColor":"none",strokeWidth:1.5}),He?Oe.unpin:Oe.pinOnTop]}),Ve&&/* @__PURE__ */ce(W,{onClick:()=>{Xe(null),rt()},children:[
|
|
91
|
+
/* @__PURE__ */ue($,{name:"star",className:"h-4 w-4",fill:tt?"currentColor":"none",strokeWidth:1.5}),tt?Re.taskbar.removeFromDesktop:Re.taskbar.addToDesktop]}),(cn[jt]||[]).length>0&&/* @__PURE__ */ue(de,{children:(cn[jt]||[]).map((e,t)=>/* @__PURE__ */ce(W,{onClick:()=>{Xe(null),e.onClick()},children:[e.icon,e.label]},t))}),!(Pn&&Je?.home)&&/* @__PURE__ */ce(de,{children:[
|
|
92
|
+
/* @__PURE__ */ue(K,{}),
|
|
93
|
+
/* @__PURE__ */ce(W,{danger:!0,onClick:()=>{Xe(null),Sr()},children:[
|
|
94
94
|
/* @__PURE__ */ue($,{name:"close",className:"h-4 w-4"}),Oe.close]})]})]}),oo=!!fe&&$t.some(e=>e.id===fe),io=!Vt||oo||B?null:/* @__PURE__ */ce("div",{"data-modal-restore-tab":!0,"data-modal-id":jt,className:"fixed left-1/2 z-(--z-restore-tab) flex -translate-x-1/2 items-center gap-1 rounded-lg border border-line-strong bg-surface px-2 py-1 shadow-lg",style:{bottom:"calc(var(--taskbar-height, 0px) + 12px)"},children:[
|
|
95
95
|
/* @__PURE__ */ue("button",{type:"button",onClick:()=>er(jt),title:Oe.restore,className:"max-w-[16rem] truncate rounded px-2 py-0.5 text-sm font-medium text-gray-700 hover:bg-gray-100 hover:text-gray-900",children:$e||Oe.windowSuffix}),
|
|
96
96
|
/* @__PURE__ */ue("button",{type:"button",onClick:()=>er(jt),title:Oe.restore,"aria-label":Oe.restore,className:"rounded px-2 py-0.5 text-xs leading-none text-ink-faintest hover:bg-gray-100 hover:text-gray-600",children:"▴"}),
|
|
97
97
|
/* @__PURE__ */ue("button",{type:"button",onClick:()=>{Sr()},title:Oe.close,"aria-label":Oe.close,className:"rounded px-2 py-0.5 text-xs leading-none text-ink-faintest hover:bg-gray-100 hover:text-gray-600",children:"✕"})]});return he(
|
|
98
|
-
/* @__PURE__ */ce(tn.Provider,{value:null,children:[no,ro,io]}),document.body)}"undefined"!=typeof window&&window.addEventListener("keydown",e=>{Sr&&"Escape"===e.key&&(Br(null),Ar(!1))});var Vr=100,Jr={past:[],future:[]};function _r(e,t){switch(t.type){case"record":{const n=e.past[e.past.length-1];if(null!==t.step.coalesceKey&&n?.coalesceKey===t.step.coalesceKey)return 0===e.future.length?e:{...e,future:[]};const r=[...e.past,t.step];return{past:r.length>Vr?r.slice(r.length-Vr):r,future:[]}}case"undo":return 0===e.past.length?e:{past:e.past.slice(0,-1),future:[t.redoStep,...e.future]};case"redo":return 0===e.future.length?e:{past:[...e.past,t.undoStep],future:e.future.slice(1)};case"clear":return 0===e.past.length&&0===e.future.length?e:Jr}}var Gr=/* @__PURE__ */new Set(["INPUT","TEXTAREA","SELECT"]);var Zr=500,Qr=250;function eo({children:e,canEdit:t=!0,perms:n,windowId:r}){const[o,i]=se(_r,Jr),a=_(/* @__PURE__ */new Map),[s,l]=Z(0),c=s>0,[u,d]=Z(0),[h,m]=Z(0),p=h>0,{hasAnyPerm:f}=k(),w=t&&0===u&&(!(n&&n.length>0)||f(n)),y=_(null),g=_(!1),b=ee(()=>{const e={};for(const[t,n]of a.current)e[t]=n.getLast();return e},[]),v=ee((e,t)=>{a.current.has(e)||l(e=>e+1),a.current.set(e,t)},[]),x=ee(e=>{a.current.delete(e)&&l(e=>e-1)},[]),E=ee(e=>{d(t=>t+(e?1:-1))},[]),C=ee(e=>{m(t=>t+(e?1:-1))},[]),[M,N]=Z(0),S=M>0,T=ee(e=>{N(t=>t+(e?1:-1))},[]),z=X(Ie),A=z?.claimReadOnly;G(()=>{if(A&&!w)return A(!0),()=>A(!1)},[A,w]);const D=z?.claimOwnMount;G(()=>{if(D&&S)return D(!0),()=>D(!1)},[D,S]);const P=_({last:0,count:0,tripped:!1}),I=_(!1),
|
|
99
|
-
return ce(Ie.Provider,{value:re,children:[le&&/* @__PURE__ */ue(pn,{position:"left",quiet:!0,children:/* @__PURE__ */ue(
|
|
98
|
+
/* @__PURE__ */ce(tn.Provider,{value:null,children:[no,ro,io]}),document.body)}"undefined"!=typeof window&&window.addEventListener("keydown",e=>{Sr&&"Escape"===e.key&&(Br(null),Ar(!1))});var Vr=100,Jr={past:[],future:[]};function _r(e,t){switch(t.type){case"record":{const n=e.past[e.past.length-1];if(null!==t.step.coalesceKey&&n?.coalesceKey===t.step.coalesceKey)return 0===e.future.length?e:{...e,future:[]};const r=[...e.past,t.step];return{past:r.length>Vr?r.slice(r.length-Vr):r,future:[]}}case"undo":return 0===e.past.length?e:{past:e.past.slice(0,-1),future:[t.redoStep,...e.future]};case"redo":return 0===e.future.length?e:{past:[...e.past,t.undoStep],future:e.future.slice(1)};case"clear":return 0===e.past.length&&0===e.future.length?e:Jr}}var Gr=/* @__PURE__ */new Set(["INPUT","TEXTAREA","SELECT"]);var Zr=500,Qr=250;function eo({children:e,canEdit:t=!0,perms:n,windowId:r}){const[o,i]=se(_r,Jr),a=_(/* @__PURE__ */new Map),[s,l]=Z(0),c=s>0,[u,d]=Z(0),[h,m]=Z(0),p=h>0,{hasAnyPerm:f}=k(),w=t&&0===u&&(!(n&&n.length>0)||f(n)),y=_(null),g=_(!1),b=ee(()=>{const e={};for(const[t,n]of a.current)e[t]=n.getLast();return e},[]),v=ee((e,t)=>{a.current.has(e)||l(e=>e+1),a.current.set(e,t)},[]),x=ee(e=>{a.current.delete(e)&&l(e=>e-1)},[]),E=ee(e=>{d(t=>t+(e?1:-1))},[]),C=ee(e=>{m(t=>t+(e?1:-1))},[]),[M,N]=Z(0),S=M>0,T=ee(e=>{N(t=>t+(e?1:-1))},[]),z=X(Ie),A=z?.claimReadOnly;G(()=>{if(A&&!w)return A(!0),()=>A(!1)},[A,w]);const D=z?.claimOwnMount;G(()=>{if(D&&S)return D(!0),()=>D(!1)},[D,S]);const P=_({last:0,count:0,tripped:!1}),I=_(!1),W=ee((e,t,n)=>{if(g.current)return void(n&&function(e,t){if(Object.is(e,t))return!0;if("object"!=typeof e||"object"!=typeof t||null===e||null===t)return!1;if(Array.isArray(e)!==Array.isArray(t))return!1;try{return JSON.stringify(e)===JSON.stringify(t)}catch{return!1}}(n.prev,n.next)||(I.current=!0));if(!w||y.current)return;const r=P.current;if(r.tripped)return;const o=Date.now();if(o-r.last>Qr&&(r.count=0),r.last=o,++r.count>Zr)return r.tripped=!0,void console.error(`[efficient-shell] UndoProvider: "${e}" recorded ${Zr} undo steps with no pause between them, which no user action can do. The value passed to useUndoable for this slice is almost certainly rebuilt on every render (a .map/.filter/object literal in the call) rather than held in state, so it reads as changed every time — and since recording a step re-renders the form, that is a loop. Undo recording is now off for this form to keep the tab responsive.`);y.current={values:b(),label:e,coalesceKey:t},queueMicrotask(()=>{const e=y.current;y.current=null,e&&i({type:"record",step:e})})},[w,b]),K=ee(e=>{for(const[t,n]of Object.entries(e)){const e=a.current.get(t);e&&(e.setLast(n),e.apply(n))}},[]),R=ee(()=>{const e=o.past[o.past.length-1];if(!e)return;const t={values:b(),label:e.label,coalesceKey:null};K(e.values),i({type:"undo",redoStep:t})},[o.past,b,K]),O=ee(()=>{const e=o.future[0];if(!e)return;const t={values:b(),label:e.label,coalesceKey:null};K(e.values),i({type:"redo",undoStep:t})},[o.future,b,K]),[$,j]=Z(0),F=_(0),q=_(0),B=_(!1),H=ee(()=>{g.current=!0,I.current=!1,y.current=null,F.current+=1,q.current=F.current,j(F.current)},[]),U=_(void 0),Y=ee(e=>{void 0!==e&&(void 0!==U.current&&e!==U.current&&(B.current=!0),U.current=e),H()},[H]);G(()=>{g.current&&$===q.current&&(g.current=!1,y.current=null,(I.current||B.current)&&i({type:"clear"}),I.current=!1,B.current=!1)},[$]);const V=ee(()=>{B.current=!0,i({type:"clear"}),H()},[H]),J=w&&o.past.length>0,Q=w&&o.future.length>0,te=Nr(r),ne=_({undo:R,redo:O,canUndo:J,canRedo:Q});ne.current={undo:R,redo:O,canUndo:J,canRedo:Q},G(()=>{if(!te||!w)return;const e=e=>{const t=function(e){if(!e.metaKey&&!e.ctrlKey||e.altKey)return null;const t=e.key.toLowerCase(),n="z"===t?e.shiftKey?"redo":"undo":"y"!==t||!e.ctrlKey||e.metaKey||e.shiftKey?null:"redo";if(!n)return null;const r=e.target;return r?.isContentEditable||r?.tagName&&Gr.has(r.tagName.toUpperCase())?null:n}(e);if(!t)return;const n=ne.current;("undo"===t?n.canUndo:n.canRedo)&&(e.preventDefault(),"undo"===t?n.undo():n.redo())};return window.addEventListener("keydown",e),()=>window.removeEventListener("keydown",e)},[te,w]);const re=ie(()=>({register:v,unregister:x,record:W,undo:R,redo:O,clear:V,baseline:Y,canUndo:J,canRedo:Q,enabled:w,hasState:c,handMounted:S,claimOwnMount:T,claimReadOnly:E,declaredEditable:p,claimEditable:C,undoLabel:J?o.past[o.past.length-1].label:null,redoLabel:Q?o.future[0].label:null}),[v,x,W,R,O,V,Y,J,Q,w,c,S,T,E,p,C,o.past,o.future]),oe=""!==mn(),ae=X(L)?.footerOpen??!1,le=oe&&w&&c&&!S&&ae;/* @__PURE__ */
|
|
99
|
+
return ce(Ie.Provider,{value:re,children:[le&&/* @__PURE__ */ue(pn,{position:"left",quiet:!0,children:/* @__PURE__ */ue(Ke,{auto:!0})}),e]})}function to(){const e=X(Ie),t=ee(()=>{},[]);return{undo:e?.undo??t,redo:e?.redo??t,clear:e?.clear??t,baseline:e?.baseline??t,canUndo:e?.canUndo??!1,canRedo:e?.canRedo??!1,undoLabel:e?.undoLabel??null,redoLabel:e?.redoLabel??null,enabled:e?.enabled??!1,hasState:e?.hasState??!1}}function no(e){const t=X(Ie),n=t?.claimReadOnly,r=t?.claimEditable;G(()=>{const t=e?r:n;if(t)return t(!0),()=>t(!1)},[n,r,e])}function ro(e,t,n){const r=X(Ie),o=ae(),i=_(e),a=_(t);a.current=t,G(()=>{if(r)return r.register(o,{getLast:()=>i.current,setLast:e=>{i.current=e},apply:e=>a.current(e)}),()=>r.unregister(o)},[r,o]);const{label:s,coalesceKey:l=null}=n,c=_(r);c.current=r;const u=_({label:s,coalesceKey:l});u.current={label:s,coalesceKey:l},G(()=>{const t=c.current;t&&(Object.is(e,i.current)||(t.record(u.current.label,u.current.coalesceKey,{prev:i.current,next:e}),i.current=e))},[e])}function oo(e,t){const[n,r]=Z(e);return ro(n,e=>r(()=>e),t),[n,r]}export{fn as CancelButton,it as DocFavStar,Xe as EntityWindowFallback,Ue as EntityWindowLoading,Ve as EntityWindowState,on as MODAL_SUBMIT_SELECTOR,Xr as Modal,pn as ModalActions,Ke as UndoControls,eo as UndoProvider,ve as WINDOW_REGISTRY,De as WindowCrashedFallback,Pe as WindowErrorBoundary,Nt as WindowManagerProvider,dn as WindowTitle,dt as activateWindowById,$t as beginWindowGesture,_n as cancelWindowFront,ke as client_default,Hr as commitExposeHighlight,Jn as confirmWindowDiscard,jt as drainPerfEvents,Pr as exitExposeMode,Sn as forgetMaximizedWindowBoxes,pt as getActiveWindowRoute,qr as getExposeHighlight,Qt as getWindowChromeVersion,Mn as getWindowPosition,_e as isDraftEntityId,Ge as isDraftEntityWindow,ye as isEntityEntry,we as isPageEntry,xe as isShellApiClientConfigured,Fe as isTabWindow,Ot as markMenuOpen,Gt as readWindowChrome,Yn as requestWindowFront,Br as setExposeHighlight,Rt as setPerfCollecting,Se as setShellHomeRoute,Ae as setShellTabStrip,be as setShellWindowRegistry,Cn as setWindowDefaultPosition,Nn as setWindowPosition,Ut as splitTitle,Fr as subscribeExposeHighlight,Zt as subscribeWindowChrome,qe as tabGroupOf,Dr as toggleExposeMode,qn as useCurrentTabKey,mn as useEnclosingModalId,Nr as useIsActiveWindow,Ce as usePageSearch,to as useUndo,no as useUndoCanEdit,ro as useUndoable,oo as useUndoableState,ln as useWidgetSettings,et as useWindowDirty,nt as useWindowManager,un as useWindowMenuItem,hn as useWindowTitle,Vn as windowHoldsChanges};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{Markdown as e}from"./chunk-
|
|
1
|
+
import{Markdown as e}from"./chunk-RXVFAFEB.js";import{PLACEHOLDER_INK as t}from"./chunk-AYZY3YNC.js";import{Icon as l}from"./chunk-7V32O5NF.js";import{LoadingSpinner as r}from"./chunk-R2VKEMZH.js";import{useShellStrings as s}from"./chunk-5YP7MFPK.js";import{useState as a,useMemo as n}from"react";import{jsxs as i,jsx as o,Fragment as c}from"react/jsx-runtime";var d=({open:e})=>/* @__PURE__ */o(l,{name:"chevron-right",look:"mini",className:"h-3.5 w-3.5 shrink-0 transition-transform "+(e?"rotate-90":""),"aria-hidden":"true"});function h({docs:h,loading:m=!1,categoryOrder:p,canEdit:u=!1,onNew:g,onEdit:x,renderBody:f,emptyMessage:b}){const y=s(),[N,v]=a(""),[w,k]=a(null),[C,j]=a({}),M=N.trim().toLowerCase(),_=n(()=>{const e=/* @__PURE__ */new Map;for(const t of h){let l=e.get(t.category);l||(l={key:t.category,label:t.category_label||t.category,docs:[]},e.set(t.category,l)),l.docs.push(t)}if(!p?.length)return[...e.values()];const t=new Map(p.map((e,t)=>[e,t]));return[...e.values()].sort((e,l)=>(t.get(e.key)??1/0)-(t.get(l.key)??1/0))},[h,p]),A=e=>!M||e.title.toLowerCase().includes(M)||e.body.toLowerCase().includes(M)||e.category_label.toLowerCase().includes(M),E=n(()=>_.map(e=>({...e,docs:e.docs.filter(A)})).filter(e=>e.docs.length>0),[_,M]),F=n(()=>E.flatMap(e=>e.docs),[E]),L=(w?F.find(e=>e.slug===w):void 0)??F[0]??null,Y=e=>!!M||(C[e]??e===L?.category);/* @__PURE__ */
|
|
2
2
|
return i("div",{className:"flex h-full gap-4 px-4 py-3 min-h-0",children:[
|
|
3
3
|
/* @__PURE__ */i("aside",{className:"w-64 shrink-0 flex flex-col bg-white rounded-lg shadow overflow-hidden",children:[
|
|
4
4
|
/* @__PURE__ */i("div",{className:"flex items-center justify-between gap-2 px-3 py-2 border-b border-gray-200 bg-gray-50 shrink-0",children:[
|
|
@@ -6,16 +6,16 @@ return i("div",{className:"flex h-full gap-4 px-4 py-3 min-h-0",children:[
|
|
|
6
6
|
/* @__PURE__ */o("div",{className:"px-3 py-2 border-b border-line-subtle shrink-0",children:/* @__PURE__ */i("div",{className:"relative",children:[
|
|
7
7
|
/* @__PURE__ */o(l,{name:"search",look:"mini",className:`pointer-events-none absolute left-2.5 top-1/2 -translate-y-1/2 h-4 w-4 ${t}`,"aria-hidden":"true"}),
|
|
8
8
|
/* @__PURE__ */o("input",{type:"text",value:N,onChange:e=>v(e.target.value),placeholder:y.help.searchPlaceholder,className:"w-full rounded-md border border-line-strong bg-surface h-8 pl-8 pr-2 text-sm shadow-sm focus:border-blue-500 rosh-focus-ring focus-visible:ring-1 focus-visible:ring-[color:var(--rosh-focus-ring-accent)]"})]})}),
|
|
9
|
-
/* @__PURE__ */o("div",{className:"flex-1 overflow-y-auto py-1",children:m?/* @__PURE__ */o(r,{size:"sm",padding:"py-6",label:y.help.loading}):0===
|
|
9
|
+
/* @__PURE__ */o("div",{className:"flex-1 overflow-y-auto py-1",children:m?/* @__PURE__ */o(r,{size:"sm",padding:"py-6",label:y.help.loading}):0===E.length?/* @__PURE__ */o("p",{className:"px-3 py-6 text-center text-xs text-gray-500",children:M?y.help.noResults:b??y.help.empty}):E.map(e=>{const t=Y(e.key);/* @__PURE__ */
|
|
10
10
|
return i("div",{className:"py-0.5",children:[
|
|
11
|
-
/* @__PURE__ */i("button",{type:"button",onClick:()=>{return t=e.key,j(e=>({...e,[t]:!
|
|
11
|
+
/* @__PURE__ */i("button",{type:"button",onClick:()=>{return t=e.key,j(e=>({...e,[t]:!Y(t)}));var t},className:"w-full flex items-center gap-2 h-8 px-3 text-left text-3xs font-semibold uppercase tracking-wide text-ink-faintest hover:text-gray-600",children:[
|
|
12
12
|
/* @__PURE__ */o(d,{open:t}),
|
|
13
|
-
/* @__PURE__ */o("span",{className:"truncate",children:e.label})]}),t&&e.docs.map(e=>{const t=
|
|
13
|
+
/* @__PURE__ */o("span",{className:"truncate",children:e.label})]}),t&&e.docs.map(e=>{const t=L?.slug===e.slug;/* @__PURE__ */
|
|
14
14
|
return i("button",{type:"button",onClick:()=>k(e.slug),className:"w-full text-left pl-8 pr-3 min-h-(--row-height-menu) py-2 text-sm flex items-center gap-2 transition-colors "+(t?"bg-blue-50 text-blue-700 font-medium":"text-gray-700 hover:bg-gray-50"),children:[
|
|
15
15
|
/* @__PURE__ */o("span",{className:"truncate",children:e.title}),!1===e.is_published&&/* @__PURE__ */o("span",{className:"ml-auto shrink-0 text-2xs text-amber-600",children:y.help.draft})]},e.slug)})]},e.key)})})]}),
|
|
16
|
-
/* @__PURE__ */o("main",{className:"flex-1 min-w-0 bg-white rounded-lg shadow overflow-hidden flex flex-col",children:
|
|
16
|
+
/* @__PURE__ */o("main",{className:"flex-1 min-w-0 bg-white rounded-lg shadow overflow-hidden flex flex-col",children:L?/* @__PURE__ */i(c,{children:[
|
|
17
17
|
/* @__PURE__ */i("div",{className:"flex items-start justify-between gap-4 px-5 py-3 border-b border-gray-200 bg-gray-50 shrink-0",children:[
|
|
18
18
|
/* @__PURE__ */i("div",{className:"min-w-0",children:[
|
|
19
|
-
/* @__PURE__ */o("h1",{className:"text-lg font-semibold text-gray-900 truncate",children:
|
|
20
|
-
/* @__PURE__ */i("p",{className:"text-xs text-gray-500 mt-0.5",children:[
|
|
21
|
-
/* @__PURE__ */o("div",{className:"flex-1 overflow-auto px-5 py-4",children:f?f(
|
|
19
|
+
/* @__PURE__ */o("h1",{className:"text-lg font-semibold text-gray-900 truncate",children:L.title}),
|
|
20
|
+
/* @__PURE__ */i("p",{className:"text-xs text-gray-500 mt-0.5",children:[L.category_label,!1===L.is_published&&/* @__PURE__ */i("span",{className:"ml-2 text-amber-600",children:["· ",y.help.draft]})]})]}),u&&x&&/* @__PURE__ */o("button",{type:"button",onClick:()=>x(L),className:"shrink-0 text-sm text-blue-600 hover:underline",children:y.help.edit})]}),
|
|
21
|
+
/* @__PURE__ */o("div",{className:"flex-1 overflow-auto px-5 py-4",children:f?f(L):L.body?/* @__PURE__ */o(e,{children:L.body}):/* @__PURE__ */o("p",{className:"text-sm text-gray-500 italic",children:y.help.noBody})})]}):/* @__PURE__ */o("div",{className:"flex-1 flex items-center justify-center px-6 text-center",children:m?/* @__PURE__ */o(r,{size:"sm",padding:"",label:y.help.loading}):/* @__PURE__ */o("p",{className:"text-sm text-ink-faint",children:y.help.pickArticle})})})]})}export{h as HelpCenter};
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import{arcPath as e}from"./chunk-VFC6QUEN.js";import{MOTION as t,stagger as a}from"./chunk-465RRWBY.js";import{useHighlight as l}from"./chunk-CNYAHYE6.js";import{
|
|
1
|
+
import{arcPath as e}from"./chunk-VFC6QUEN.js";import{MOTION as t,stagger as a}from"./chunk-465RRWBY.js";import{useHighlight as l}from"./chunk-CNYAHYE6.js";import{ChartTooltip as r}from"./chunk-36VIGB6J.js";import{angleScale as n}from"./chunk-2JWPNR2U.js";import{resolveSeriesColor as o,CHART_INK as i}from"./chunk-TZFACUMR.js";import{useShellStrings as s,useShellLocale as c}from"./chunk-5YP7MFPK.js";import{formatPlain as m}from"./chunk-C3QOHMR6.js";import{useId as h,useState as u}from"react";import{jsx as p,jsxs as d}from"react/jsx-runtime";var f=300*Math.PI/180;function g({rows:g,variant:k="track",size:v=300,max:x,formatValue:y,animate:M=!0,className:N,emptyLabel:b,trackGap:j=6}){const C=s().charts,w=c(),P=y??(e=>m(e,w)),R=b??C.nothingToPlot,E=h(),[T,Y]=u(null),{highlighted:$}=l();if(0===g.length)/* @__PURE__ */return p("p",{className:`text-sm text-gray-500 ${N??""}`,children:R});const B=v/2,F=v/2,I=v/2-10,U=x??Math.max(...g.map(e=>e.value),1),V="track"===k?Math.max(6,(I-.16*v)/g.length):0,z=Math.max(1,Math.floor((I-.16*v)/V||1)),A="track"===k?g.slice(0,z):g,G=Math.min(j,Math.max(1,V-2)),H=n(A.length,.03),J=null!==T?A[T]:void 0;/* @__PURE__ */
|
|
2
2
|
return d("div",{className:`relative ${N??""}`,children:[
|
|
3
|
-
/* @__PURE__ */d("svg",{width:"100%",height:v,viewBox:`0 0 ${v} ${v}`,role:"img","aria-labelledby":E,onMouseLeave:()=>
|
|
4
|
-
/* @__PURE__ */p("title",{id:E,children:"track"===k?C.radialTrack(
|
|
5
|
-
return d("g",{opacity:c?.4:1,onMouseEnter:()=>
|
|
6
|
-
/* @__PURE__ */p("path",{d:e(
|
|
7
|
-
/* @__PURE__ */p("path",{d:e(
|
|
8
|
-
return p("g",{opacity:c?.4:1,onMouseEnter:()=>
|
|
3
|
+
/* @__PURE__ */d("svg",{width:"100%",height:v,viewBox:`0 0 ${v} ${v}`,role:"img","aria-labelledby":E,onMouseLeave:()=>Y(null),children:[
|
|
4
|
+
/* @__PURE__ */p("title",{id:E,children:"track"===k?C.radialTrack(A.length):C.radialCycle(A.length)}),A.map((l,r)=>{const n=o(r,l.color,l.tone),s=Math.max(0,Math.min(1,l.value/U)),c=((e,t)=>null!==T?T!==e:null!==$&&$!==t)(r,l.key);if("track"===k){const o=I-r*V,m=o-V+G,h=-Math.PI/2;/* @__PURE__ */
|
|
5
|
+
return d("g",{opacity:c?.4:1,onMouseEnter:()=>Y(r),className:M?t.sweep:void 0,style:M?a(r,70):void 0,children:[
|
|
6
|
+
/* @__PURE__ */p("path",{d:e(B,F,m,o,h,h+f),fill:i.grid}),
|
|
7
|
+
/* @__PURE__ */p("path",{d:e(B,F,m,o,h,h+f*s),fill:n})]},l.key)}const m=.14*v;/* @__PURE__ */
|
|
8
|
+
return p("g",{opacity:c?.4:1,onMouseEnter:()=>Y(r),children:/* @__PURE__ */p("path",{d:e(B,F,m,m+(I-m)*s,H(r),H(r)+H.step),fill:n})},l.key)})]}),J&&null!==T&&/* @__PURE__ */p("div",{className:"pointer-events-none absolute top-2 left-2 z-10",children:/* @__PURE__ */p(r,{title:J.label,rows:[{key:"value",label:C.value,color:o(T,J.color,J.tone),value:P(J.value)}]})}),
|
|
9
9
|
/* @__PURE__ */p("ul",{className:"m-0 mt-3 grid gap-1 p-0",style:{gridTemplateColumns:"repeat(auto-fit,minmax(150px,1fr))"},children:g.map((e,t)=>/* @__PURE__ */d("li",{className:"flex list-none items-center gap-2 text-xs text-gray-600",children:[
|
|
10
10
|
/* @__PURE__ */p("span",{className:"h-2.5 w-2.5 shrink-0 rounded-sm",style:{backgroundColor:o(t,e.color,e.tone)}}),
|
|
11
11
|
/* @__PURE__ */p("span",{className:"flex-1 truncate",children:e.label}),
|