@fde-desktop/fde-core 0.4.10 → 0.4.11
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/AppEmptyState-Boej96TB.js +49 -0
- package/dist/AppEmptyState-CLc00OOG.cjs +1 -0
- package/dist/AppIcon-C8vHUVcb.cjs +1 -0
- package/dist/AppIcon-mtEoyzOb.js +22 -0
- package/dist/AppMenuBar-CAlkNHjj.cjs +1 -0
- package/dist/AppMenuBar-DmSfQRXU.js +197 -0
- package/dist/CalendarApp-DOmjWbpl.js +10 -0
- package/dist/CalendarApp-Z0bCCYsK.cjs +1 -0
- package/dist/ColorPicker-CQRRwY-y.cjs +1 -0
- package/dist/ColorPicker-WCeD3Wjf.js +35 -0
- package/dist/CreateItemApp-BkFFFdX1.cjs +1 -0
- package/dist/CreateItemApp-DR8Y4bwo.js +202 -0
- package/dist/DeviceInfoApp-BXQ9uOwF.cjs +1 -0
- package/dist/DeviceInfoApp-I63mJRWy.js +195 -0
- package/dist/DownloadProgress-CkTGTf0z.cjs +1 -0
- package/dist/DownloadProgress-DnVASsv5.js +39 -0
- package/dist/FilePickerApp-By6-vbag.cjs +1 -0
- package/dist/FilePickerApp-ClHuhm6Z.js +390 -0
- package/dist/FilesApp-BC4UPNuw.cjs +1 -0
- package/dist/FilesApp-D8MqvC5X.js +210 -0
- package/dist/ImageViewerApp-B1niWF75.cjs +1 -0
- package/dist/{ImageViewerApp-CWiP6zx-.js → ImageViewerApp-iojtyFEf.js} +18 -17
- package/dist/{ImageViewerMenuBar-BULkh_Ku.js → ImageViewerMenuBar-BIsUokxV.js} +15 -14
- package/dist/ImageViewerMenuBar-BgzgSF3v.cjs +1 -0
- package/dist/MenuEditApp-BHptoJbz.cjs +1 -0
- package/dist/MenuEditApp-CJUbJaqh.js +492 -0
- package/dist/MenuEditMenuBar-CCOSPAUe.cjs +1 -0
- package/dist/{MenuEditMenuBar-B94z4Umw.js → MenuEditMenuBar-DnCL-kaZ.js} +13 -12
- package/dist/NotesApp-BmQIBtJ2.cjs +1 -0
- package/dist/NotesApp-DJ2dGt4-.js +364 -0
- package/dist/NotesMenuBar-BzojwMtH.cjs +1 -0
- package/dist/{NotesMenuBar-BB4NkKGf.js → NotesMenuBar-DILZTjnT.js} +10 -9
- package/dist/PdfApp-IjY_GtnW.js +39 -0
- package/dist/PdfApp-krW8UI97.cjs +1 -0
- package/dist/PdfMenuBar-Bd5MTZcZ.js +39 -0
- package/dist/PdfMenuBar-DWD0Qa3F.cjs +1 -0
- package/dist/SettingsApp-BE22l5UP.cjs +1 -0
- package/dist/SettingsApp-BTFtTFY_.js +1228 -0
- package/dist/SettingsMenuBar-CZE2evG2.cjs +1 -0
- package/dist/SettingsMenuBar-ktC0viTd.js +42 -0
- package/dist/UploaderApp-CbypD538.js +263 -0
- package/dist/UploaderApp-D_qD3O70.cjs +1 -0
- package/dist/{VscIcon-DueRJVTe.js → VscIcon-AEENjKOE.js} +1 -1
- package/dist/VscIcon-BYb_Soyy.cjs +1 -0
- package/dist/buildBreadcrumbs-Ccd8i11b.cjs +1 -0
- package/dist/buildBreadcrumbs-noWhu8os.js +45 -0
- package/dist/{desktopStore-B0R1-BeA.js → desktopStore-8cSZlj7s.js} +342 -549
- package/dist/desktopStore-C1jR6Fdb.cjs +1 -0
- package/dist/{imageViewerStore-CJMRXaQh.js → imageViewerStore-COrD02Zu.js} +1 -1
- package/dist/imageViewerStore-Dfylg59V.cjs +1 -0
- package/dist/index.cjs +1 -53
- package/dist/index.css +1 -1
- package/dist/index.d.ts +16 -6
- package/dist/index.js +3024 -7513
- package/dist/menuEditStore-CYwtfD6H.cjs +1 -0
- package/dist/{menuEditStore-C8S_EedM.js → menuEditStore-CxsgLiQu.js} +1 -1
- package/dist/notesStore-CrWTO6oB.cjs +1 -0
- package/dist/{notesStore-DKRgTTFn.js → notesStore-Dgah46U5.js} +1 -1
- package/dist/rolldown-runtime-CAFD8bLK.js +11 -0
- package/dist/{settingsAppStore-KOeWRO6h.js → settingsAppStore-DHZhi6Rl.js} +1 -1
- package/dist/settingsAppStore-DuYZNeFf.cjs +1 -0
- package/dist/useAdaptiveDimensions-3Lz4X0Tc.cjs +1 -0
- package/dist/{useAdaptiveDimensions-CunsU0mn.js → useAdaptiveDimensions-DxNLJ7R5.js} +1 -1
- package/dist/{useCloseInterceptor-CuKAAFnj.js → useCloseInterceptor-CIxhOZx1.js} +12 -12
- package/dist/useCloseInterceptor-CdX-09Ib.cjs +1 -0
- package/dist/useDynamicIcon-CK6SjEv5.cjs +1 -0
- package/dist/{useDynamicIcon-GJg3vWsJ.js → useDynamicIcon-_wGeWu-b.js} +1 -1
- package/dist/useOpenApp-D-FOY88T.cjs +1 -0
- package/dist/{useOpenApp-BVpSfNrG.js → useOpenApp-DkZLFFCH.js} +51 -67
- package/dist/{useResolvedUrl-DFKXq598.js → useResolvedUrl-B6x4xy0x.js} +1 -2
- package/dist/useResolvedUrl-Bb39DpVy.cjs +1 -0
- package/package.json +3 -4
- package/dist/AccordionChevron-CJXAq5o5.js +0 -26
- package/dist/AccordionChevron-DBXp38Lm.cjs +0 -1
- package/dist/ActionIcon-C_SfdBfx.cjs +0 -1
- package/dist/ActionIcon-CtVbYlGY.js +0 -145
- package/dist/AppEmptyState-BTujnL_b.js +0 -4962
- package/dist/AppEmptyState-Dc4GaDfu.cjs +0 -1
- package/dist/AppIcon--qzR4sgf.cjs +0 -1
- package/dist/AppIcon-DCDuaU-t.js +0 -80
- package/dist/AppMenuBar-BiHbNg9V.cjs +0 -9
- package/dist/AppMenuBar-CHJy8OF0.js +0 -2639
- package/dist/Box-DRm8EabO.js +0 -1593
- package/dist/Box-D_64wv6n.cjs +0 -1
- package/dist/Button-D0FXpkur.cjs +0 -1
- package/dist/Button-k7SxX1Xl.js +0 -178
- package/dist/CalendarApp-C1HvuJoa.cjs +0 -1
- package/dist/CalendarApp-DBEQqsS_.js +0 -1721
- package/dist/Center-CyryG5zn.js +0 -25
- package/dist/Center-T4No_FAa.cjs +0 -1
- package/dist/CheckIcon-C3WjIR2i.js +0 -25
- package/dist/CheckIcon-CBMLR6Gc.cjs +0 -1
- package/dist/CodeServerApp-B3l5QPuG.cjs +0 -1
- package/dist/CodeServerApp-BpeALSaX.js +0 -2
- package/dist/CodeServerApp-CRjCngFv.cjs +0 -1
- package/dist/CodeServerApp-DY94cy1a.js +0 -149
- package/dist/ColorPicker-BL4UbKCV.cjs +0 -1
- package/dist/ColorPicker-DvRR-wlQ.js +0 -997
- package/dist/CreateItemApp-BU9wmjKM.cjs +0 -1
- package/dist/CreateItemApp-CtdH1K1g.js +0 -400
- package/dist/CreateItemApp-t9F-a6wD.cjs +0 -1
- package/dist/DeviceInfoApp-C306YvtZ.js +0 -223
- package/dist/DeviceInfoApp-Cdju_LIB.cjs +0 -1
- package/dist/DeviceInfoApp-CyB01v4D.cjs +0 -1
- package/dist/DownloadProgress-IRw1dzLX.cjs +0 -1
- package/dist/DownloadProgress-hdupSUBT.js +0 -174
- package/dist/FileIcon-BCpGMI5U.js +0 -88
- package/dist/FileIcon-BCrsxmtt.cjs +0 -1
- package/dist/FilePickerApp-DMGuvahM.js +0 -409
- package/dist/FilePickerApp-Eu0cr2Cm.cjs +0 -1
- package/dist/FilesApp-BQFVHkEn.js +0 -225
- package/dist/FilesApp-BZ_dzZnF.cjs +0 -1
- package/dist/FilesApp-SIWXFPXt.cjs +0 -1
- package/dist/Group-BzwlMeob.js +0 -48
- package/dist/Group-DhwePB84.cjs +0 -1
- package/dist/ImageViewerApp-BOz59TGc.cjs +0 -1
- package/dist/ImageViewerApp-BeqY6voE.cjs +0 -1
- package/dist/ImageViewerApp-DBAfJPSo.js +0 -2
- package/dist/ImageViewerMenuBar-Cb0Nr5-M.js +0 -2
- package/dist/ImageViewerMenuBar-CoEp0RxK.cjs +0 -1
- package/dist/ImageViewerMenuBar-zOkJtqKo.cjs +0 -1
- package/dist/MenuEditApp-BoKtj2GH.js +0 -2
- package/dist/MenuEditApp-D21sEp86.js +0 -2615
- package/dist/MenuEditApp-k3cPfTG9.cjs +0 -1
- package/dist/MenuEditApp-sz9GlLVH.cjs +0 -5
- package/dist/MenuEditMenuBar-6QxlIDpl.cjs +0 -1
- package/dist/MenuEditMenuBar-Bv6R42lf.js +0 -2
- package/dist/MenuEditMenuBar-CBsmH_-T.cjs +0 -1
- package/dist/NotesApp-BtR55Hva.cjs +0 -207
- package/dist/NotesApp-C59exz_9.js +0 -16154
- package/dist/NotesApp-D47I5LS_.js +0 -2
- package/dist/NotesApp-lOwsi2sg.cjs +0 -1
- package/dist/NotesMenuBar-BZITC74y.cjs +0 -1
- package/dist/NotesMenuBar-Bp0sPqyR.cjs +0 -1
- package/dist/NotesMenuBar-xlfODmMA.js +0 -2
- package/dist/Paper-DtUYKmYn.js +0 -30
- package/dist/Paper-DwCpwWwH.cjs +0 -1
- package/dist/PdfApp-1XbFGfoY.cjs +0 -1
- package/dist/PdfApp-BhIoJWeK.cjs +0 -1
- package/dist/PdfApp-C5Rt1Zaw.js +0 -2
- package/dist/PdfApp-C8Hwxxqh.js +0 -38
- package/dist/PdfMenuBar-BA9rKuMP.cjs +0 -1
- package/dist/PdfMenuBar-JXHqwxhZ.cjs +0 -1
- package/dist/PdfMenuBar-R0fu7oYF.js +0 -2
- package/dist/PdfMenuBar-sd-9Vk3h.js +0 -38
- package/dist/SettingsApp-7EhpjzUE.cjs +0 -1
- package/dist/SettingsApp-ByiPAj1I.cjs +0 -1
- package/dist/SettingsApp-d6fmBHxR.js +0 -1829
- package/dist/SettingsApp-qKJmC0lj.js +0 -2
- package/dist/SettingsMenuBar-BPwv8JQK.js +0 -41
- package/dist/SettingsMenuBar-D8R7hOik.js +0 -2
- package/dist/SettingsMenuBar-DDrjZLmg.cjs +0 -1
- package/dist/SettingsMenuBar-DQjUa8g1.cjs +0 -1
- package/dist/Slider-BNO-vDFn.js +0 -1175
- package/dist/Slider-Bg_EIBg6.cjs +0 -1
- package/dist/Stack-BOaJgV3N.cjs +0 -1
- package/dist/Stack-CuDEaP7e.js +0 -34
- package/dist/StorybookApp-Bkr-7mXp.cjs +0 -1
- package/dist/StorybookApp-WYninkJo.js +0 -10
- package/dist/TerminalApp-8XbsKAWa.js +0 -10041
- package/dist/TerminalApp-Bq2e7QQu.cjs +0 -1
- package/dist/TerminalApp-CVu3Axc9.js +0 -2
- package/dist/TerminalApp-b7_d0jRO.cjs +0 -36
- package/dist/TerminalMenuBar-Cb8x9laS.js +0 -2
- package/dist/TerminalMenuBar-De-FH5AE.cjs +0 -1
- package/dist/TerminalMenuBar-iKLydNda.js +0 -112
- package/dist/TerminalMenuBar-yOaWd-hn.cjs +0 -1
- package/dist/TextInput-C3qfxxWI.js +0 -980
- package/dist/TextInput-DcYns3hz.cjs +0 -1
- package/dist/Tooltip-CAOO-qdx.js +0 -3185
- package/dist/Tooltip-DDh_x-CB.cjs +0 -1
- package/dist/UnstyledButton-CI3kyRck.js +0 -25
- package/dist/UnstyledButton-Cl5RuIid.cjs +0 -1
- package/dist/UploaderApp-C76ydsd8.js +0 -487
- package/dist/UploaderApp-CHACW8Yr.js +0 -2
- package/dist/UploaderApp-Q_a3mBik.cjs +0 -1
- package/dist/UploaderApp-htj59ppo.cjs +0 -1
- package/dist/VscIcon-CxEmqD80.cjs +0 -1
- package/dist/chunk-BQCxAhux.js +0 -23
- package/dist/chunk-CiTBaPhY.cjs +0 -1
- package/dist/create-safe-context-95P-Bfg3.cjs +0 -1
- package/dist/create-safe-context-XT2cxc14.js +0 -12
- package/dist/desktopStore-Cox-Og1z.cjs +0 -1
- package/dist/fc-DejOsQyD.cjs +0 -1
- package/dist/fc-kd8WzIER.js +0 -20536
- package/dist/fc-xJ_v2ayq.cjs +0 -184
- package/dist/fi-BahYsbim.js +0 -9993
- package/dist/fi-BkhyTcZo.cjs +0 -1
- package/dist/getRuntime-BLXyQZBB.cjs +0 -1
- package/dist/getRuntime-CCRXVzJH.js +0 -63
- package/dist/iconBase-B4UCuSvv.cjs +0 -1
- package/dist/iconBase-D7iPes7B.js +0 -108
- package/dist/imageViewerStore-CH1qW6md.cjs +0 -1
- package/dist/is-element-BocgicRg.cjs +0 -1
- package/dist/is-element-Bu_JY8Qy.js +0 -7
- package/dist/menuEditStore-CU7IAg3L.cjs +0 -1
- package/dist/notesStore-zKmChTfF.cjs +0 -1
- package/dist/react-DYmzHD0X.js +0 -27
- package/dist/react-Dldg32sN.cjs +0 -1
- package/dist/settingsAppStore-BrlImdAH.cjs +0 -1
- package/dist/terminalStore-LWWjCvCe.js +0 -30
- package/dist/terminalStore-fZe5t7Ty.cjs +0 -1
- package/dist/use-merged-ref-BI9n1hUK.cjs +0 -1
- package/dist/use-merged-ref-BT8_u6vW.js +0 -25
- package/dist/use-resolved-styles-api-AVDygMKo.cjs +0 -1
- package/dist/use-resolved-styles-api-pEOi2wiK.js +0 -21
- package/dist/use-uncontrolled-A4hm9ATM.js +0 -23
- package/dist/use-uncontrolled-BPrfGv0W.cjs +0 -1
- package/dist/useAdaptiveDimensions-Btp0m5Pm.cjs +0 -1
- package/dist/useCloseInterceptor-a_6Lcuqj.cjs +0 -1
- package/dist/useDynamicIcon-SytdL1Tu.cjs +0 -1
- package/dist/useOpenApp-Br0jo4-y.cjs +0 -1
- package/dist/useResolvedUrl-Be5ZlCX7.cjs +0 -1
- package/dist/useTranslation-DMRGdqZi.js +0 -279
- package/dist/useTranslation-D_O7S4RJ.cjs +0 -1
- package/dist/vsc-Ciibqbxo.cjs +0 -1
- package/dist/vsc-DGKSpOAR.js +0 -9574
- /package/dist/{Colors-BxX4G8kX.cjs → Colors-CNJbU7oq.cjs} +0 -0
- /package/dist/{Colors-hca6raEG.js → Colors-CuABn2W4.js} +0 -0
- /package/dist/{useMenuBarUtils-ChmpZjwu.js → useMenuBarUtils-ChAfI7OA.js} +0 -0
- /package/dist/{useMenuBarUtils-Bp5PiztD.cjs → useMenuBarUtils-DAap0ukp.cjs} +0 -0
package/dist/index.cjs
CHANGED
|
@@ -1,53 +1 @@
|
|
|
1
|
-
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require(`./chunk-CiTBaPhY.cjs`),t=require(`./CalendarApp-C1HvuJoa.cjs`),n=require(`./Box-D_64wv6n.cjs`),r=require(`./ColorPicker-BL4UbKCV.cjs`),i=require(`./create-safe-context-95P-Bfg3.cjs`),a=require(`./AppMenuBar-BiHbNg9V.cjs`),o=require(`./Tooltip-DDh_x-CB.cjs`),s=require(`./TextInput-DcYns3hz.cjs`),c=require(`./SettingsApp-ByiPAj1I.cjs`),l=require(`./Slider-Bg_EIBg6.cjs`),u=require(`./CreateItemApp-BU9wmjKM.cjs`),d=require(`./DownloadProgress-IRw1dzLX.cjs`),f=require(`./UnstyledButton-Cl5RuIid.cjs`),p=require(`./Paper-DwCpwWwH.cjs`),m=require(`./ActionIcon-C_SfdBfx.cjs`),h=require(`./Group-DhwePB84.cjs`),g=require(`./getRuntime-BLXyQZBB.cjs`),_=require(`./FileIcon-BCrsxmtt.cjs`),v=require(`./Button-D0FXpkur.cjs`),y=require(`./AppIcon--qzR4sgf.cjs`),b=require(`./Center-T4No_FAa.cjs`),x=require(`./DeviceInfoApp-Cdju_LIB.cjs`),S=require(`./UploaderApp-Q_a3mBik.cjs`),C=require(`./Stack-BOaJgV3N.cjs`),w=require(`./desktopStore-Cox-Og1z.cjs`),T=require(`./AppEmptyState-Dc4GaDfu.cjs`),E=require(`./useOpenApp-Br0jo4-y.cjs`),D=require(`./useTranslation-D_O7S4RJ.cjs`),O=require(`./useDynamicIcon-SytdL1Tu.cjs`),k=require(`./useAdaptiveDimensions-Btp0m5Pm.cjs`),A=require(`./MenuEditApp-sz9GlLVH.cjs`),j=require(`./useCloseInterceptor-a_6Lcuqj.cjs`),M=require(`./VscIcon-CxEmqD80.cjs`),N=require(`./fc-xJ_v2ayq.cjs`),P=require(`./FilesApp-SIWXFPXt.cjs`),F=require(`./useResolvedUrl-Be5ZlCX7.cjs`),I=require(`./NotesApp-BtR55Hva.cjs`),L=require(`./FilePickerApp-Eu0cr2Cm.cjs`),ee=require(`./Colors-BxX4G8kX.cjs`),R=require(`./ImageViewerApp-BeqY6voE.cjs`),te=require(`./PdfApp-BhIoJWeK.cjs`),ne=require(`./StorybookApp-Bkr-7mXp.cjs`);require(`./TerminalApp-b7_d0jRO.cjs`),require(`./CodeServerApp-CRjCngFv.cjs`);const z=require(`./useMenuBarUtils-Bp5PiztD.cjs`),re=require(`./NotesMenuBar-Bp0sPqyR.cjs`);require(`./TerminalMenuBar-yOaWd-hn.cjs`);const ie=require(`./MenuEditMenuBar-6QxlIDpl.cjs`),ae=require(`./SettingsMenuBar-DQjUa8g1.cjs`),oe=require(`./PdfMenuBar-JXHqwxhZ.cjs`),se=require(`./ImageViewerMenuBar-zOkJtqKo.cjs`);let B=require(`react`);B=e.a(B);let V=require(`react/jsx-runtime`),ce=require(`react-dom`);var le=(0,B.createContext)(void 0),ue={borderRadius:`8px`,headerHeight:40,minWidth:400,minHeight:300,defaultWidth:800,defaultHeight:600,shadow:`0 8px 32px rgba(0, 0, 0, 0.2)`},de={height:48,position:`bottom`,background:`rgba(0, 0, 0, 0.8)`,blur:!0},fe={light:{mode:`light`,colors:{desktop:`#f0f4f8`,taskbar:`rgba(255, 255, 255, 0.9)`,window:`#ffffff`,accent:`#339af0`},window:ue,taskbar:de,desktop:{background:`linear-gradient(135deg, #667eea 0%, #764ba2 100%)`,iconSize:64,iconSpacing:16}},dark:{mode:`dark`,colors:{desktop:`#1a1b1e`,taskbar:`rgba(26, 27, 30, 0.9)`,window:`#25262b`,accent:`#4dabf7`},window:ue,taskbar:de,desktop:{background:`linear-gradient(135deg, #1a1b1e 0%, #2d1f3d 100%)`,iconSize:64,iconSpacing:16}}};function pe({children:e,initialMode:t=`light`,mode:n,theme:r}){let[i,a]=(0,B.useState)(n??t),o=(0,B.useRef)(null);(0,B.useEffect)(()=>{n!==void 0&&n!==i&&a(n)},[n,i]);let s=(0,B.useCallback)(()=>{a(e=>e===`light`?`dark`:`light`)},[]),c=(0,B.useCallback)(e=>{o.current=e},[]),l=(0,B.useCallback)(()=>{let e=fe[i],t=o.current;return t?{...e,colors:{desktop:r?.colors?.desktop??e.colors.desktop,taskbar:t.taskbar,window:t.window,accent:t.accent},window:{...e.window,...r?.window},taskbar:{...e.taskbar,...r?.taskbar},desktop:{...e.desktop,...r?.desktop}}:r?{mode:r.mode??e.mode,colors:{desktop:r.colors?.desktop??e.colors.desktop,taskbar:r.colors?.taskbar??e.colors.taskbar,window:r.colors?.window??e.colors.window,accent:r.colors?.accent??e.colors.accent},window:{...e.window,...r.window},taskbar:{...e.taskbar,...r.taskbar},desktop:{...e.desktop,...r.desktop}}:e},[i,r]);(0,B.useEffect)(()=>{document.documentElement.style.setProperty(`color-scheme`,i),document.documentElement.setAttribute(`data-mantine-color-scheme`,i)},[i]);let u=(0,B.useMemo)(()=>({getTheme:l,setMode:a,toggle:s,setCustomColors:c}),[l,a,s,c]);return(0,V.jsx)(le.Provider,{value:u,children:e})}function me(){let e=(0,B.useContext)(le);if(!e)throw Error(`useTheme must be used within a ThemeProvider`);return e.getTheme()}function he(){let e=(0,B.useContext)(le);if(!e)throw Error(`useThemeContext must be used within a ThemeProvider`);return e}function ge(e,t,n){let r=(0,B.useEffectEvent)(t);(0,B.useEffect)(()=>(window.addEventListener(e,r,n),()=>window.removeEventListener(e,r,n)),[e])}function _e(e){return e===`auto`||e===`dark`||e===`light`}function ve({key:e=`mantine-color-scheme-value`}={}){let t;return{get:t=>{if(typeof window>`u`)return t;try{let n=window.localStorage.getItem(e);return _e(n)?n:t}catch{return t}},set:t=>{try{window.localStorage.setItem(e,t)}catch(e){console.warn(`[@mantine/core] Local storage color scheme manager was unable to save color scheme.`,e)}},subscribe:n=>{t=t=>{t.storageArea===window.localStorage&&t.key===e&&_e(t.newValue)&&n(t.newValue)},window.addEventListener(`storage`,t)},unsubscribe:()=>{window.removeEventListener(`storage`,t)},clear:()=>{window.localStorage.removeItem(e)}}}function ye(e,t){let n=typeof window<`u`&&`matchMedia`in window&&window.matchMedia(`(prefers-color-scheme: dark)`)?.matches,r=e===`auto`?n?`dark`:`light`:e;t()?.setAttribute(`data-mantine-color-scheme`,r)}function be({manager:e,defaultColorScheme:t,getRootElement:n,forceColorScheme:r}){let i=(0,B.useRef)(null),[a,o]=(0,B.useState)(()=>e.get(t)),c=r||a,l=(0,B.useCallback)(t=>{r||(ye(t,n),o(t),e.set(t))},[e.set,c,r]),u=(0,B.useCallback)(()=>{o(t),ye(t,n),e.clear()},[e.clear,t]);return(0,B.useEffect)(()=>(e.subscribe(l),e.unsubscribe),[e.subscribe,e.unsubscribe]),s.f(()=>{ye(e.get(t),n)},[]),(0,B.useEffect)(()=>{if(r)return ye(r,n),()=>{};r===void 0&&ye(a,n),typeof window<`u`&&`matchMedia`in window&&(i.current=window.matchMedia(`(prefers-color-scheme: dark)`));let e=e=>{a===`auto`&&ye(e.matches?`dark`:`light`,n)};return i.current?.addEventListener(`change`,e),()=>i.current?.removeEventListener(`change`,e)},[a,r]),{colorScheme:c,setColorScheme:l,clearColorScheme:u}}function xe(e){return Object.entries(e).map(([e,t])=>`${e}: ${t};`).join(``)}function Se(e,t){let n=t?[t]:[`:root`,`:host`],r=xe(e.variables),i=r?`${n.join(`, `)}{${r}}`:``,a=xe(e.dark),o=xe(e.light),s=e=>n.map(t=>t===`:host`?`${t}([data-mantine-color-scheme="${e}"])`:`${t}[data-mantine-color-scheme="${e}"]`).join(`, `);return`${i}\n\n${a?`${s(`dark`)}{${a}}`:``}\n\n${o?`${s(`light`)}{${o}}`:``}`}function Ce({theme:e,color:t,colorScheme:r,name:i=t,withColorValues:a=!0}){if(!e.colors[t])return{};if(r===`light`){let r=n.w(e,`light`),o={[`--mantine-color-${i}-text`]:`var(--mantine-color-${i}-filled)`,[`--mantine-color-${i}-filled`]:`var(--mantine-color-${i}-${r})`,[`--mantine-color-${i}-filled-hover`]:`var(--mantine-color-${i}-${r===9?8:r+1})`,[`--mantine-color-${i}-light`]:`var(--mantine-color-${i}-1)`,[`--mantine-color-${i}-light-hover`]:`var(--mantine-color-${i}-2)`,[`--mantine-color-${i}-light-color`]:`var(--mantine-color-${i}-9)`,[`--mantine-color-${i}-outline`]:`var(--mantine-color-${i}-${r})`,[`--mantine-color-${i}-outline-hover`]:n._(e.colors[t][r],.05)};return a?{[`--mantine-color-${i}-0`]:e.colors[t][0],[`--mantine-color-${i}-1`]:e.colors[t][1],[`--mantine-color-${i}-2`]:e.colors[t][2],[`--mantine-color-${i}-3`]:e.colors[t][3],[`--mantine-color-${i}-4`]:e.colors[t][4],[`--mantine-color-${i}-5`]:e.colors[t][5],[`--mantine-color-${i}-6`]:e.colors[t][6],[`--mantine-color-${i}-7`]:e.colors[t][7],[`--mantine-color-${i}-8`]:e.colors[t][8],[`--mantine-color-${i}-9`]:e.colors[t][9],...o}:o}let o=n.w(e,`dark`),s={[`--mantine-color-${i}-text`]:`var(--mantine-color-${i}-4)`,[`--mantine-color-${i}-filled`]:`var(--mantine-color-${i}-${o})`,[`--mantine-color-${i}-filled-hover`]:`var(--mantine-color-${i}-${o===9?8:o+1})`,[`--mantine-color-${i}-light`]:n.b(e.colors[t][9],.5),[`--mantine-color-${i}-light-hover`]:n.b(e.colors[t][9],.3),[`--mantine-color-${i}-light-color`]:`var(--mantine-color-${i}-0)`,[`--mantine-color-${i}-outline`]:`var(--mantine-color-${i}-${Math.max(o-4,0)})`,[`--mantine-color-${i}-outline-hover`]:n._(e.colors[t][Math.max(o-4,0)],.05)};return a?{[`--mantine-color-${i}-0`]:e.colors[t][0],[`--mantine-color-${i}-1`]:e.colors[t][1],[`--mantine-color-${i}-2`]:e.colors[t][2],[`--mantine-color-${i}-3`]:e.colors[t][3],[`--mantine-color-${i}-4`]:e.colors[t][4],[`--mantine-color-${i}-5`]:e.colors[t][5],[`--mantine-color-${i}-6`]:e.colors[t][6],[`--mantine-color-${i}-7`]:e.colors[t][7],[`--mantine-color-${i}-8`]:e.colors[t][8],[`--mantine-color-${i}-9`]:e.colors[t][9],...s}:s}function we(e){return!!e&&typeof e==`object`&&`mantine-virtual-color`in e}function Te(e,t,r){n.z(t).forEach(n=>Object.assign(e,{[`--mantine-${r}-${n}`]:t[n]}))}var Ee=e=>{let t=n.w(e,`light`),r=e.defaultRadius in e.radius?e.radius[e.defaultRadius]:n.L(e.defaultRadius),i={variables:{"--mantine-z-index-app":`100`,"--mantine-z-index-modal":`200`,"--mantine-z-index-popover":`300`,"--mantine-z-index-overlay":`400`,"--mantine-z-index-max":`9999`,"--mantine-scale":e.scale.toString(),"--mantine-cursor-type":e.cursorType,"--mantine-webkit-font-smoothing":e.fontSmoothing?`antialiased`:`unset`,"--mantine-moz-font-smoothing":e.fontSmoothing?`grayscale`:`unset`,"--mantine-color-white":e.white,"--mantine-color-black":e.black,"--mantine-line-height":e.lineHeights.md,"--mantine-font-family":e.fontFamily,"--mantine-font-family-monospace":e.fontFamilyMonospace,"--mantine-font-family-headings":e.headings.fontFamily,"--mantine-heading-font-weight":e.headings.fontWeight,"--mantine-heading-text-wrap":e.headings.textWrap,"--mantine-radius-default":r,"--mantine-primary-color-filled":`var(--mantine-color-${e.primaryColor}-filled)`,"--mantine-primary-color-filled-hover":`var(--mantine-color-${e.primaryColor}-filled-hover)`,"--mantine-primary-color-light":`var(--mantine-color-${e.primaryColor}-light)`,"--mantine-primary-color-light-hover":`var(--mantine-color-${e.primaryColor}-light-hover)`,"--mantine-primary-color-light-color":`var(--mantine-color-${e.primaryColor}-light-color)`},light:{"--mantine-color-scheme":`light`,"--mantine-primary-color-contrast":d.a(e,`light`),"--mantine-color-bright":`var(--mantine-color-black)`,"--mantine-color-text":e.black,"--mantine-color-body":e.white,"--mantine-color-error":`var(--mantine-color-red-6)`,"--mantine-color-placeholder":`var(--mantine-color-gray-5)`,"--mantine-color-anchor":`var(--mantine-color-${e.primaryColor}-${t})`,"--mantine-color-default":`var(--mantine-color-white)`,"--mantine-color-default-hover":`var(--mantine-color-gray-0)`,"--mantine-color-default-color":`var(--mantine-color-black)`,"--mantine-color-default-border":`var(--mantine-color-gray-4)`,"--mantine-color-dimmed":`var(--mantine-color-gray-6)`,"--mantine-color-disabled":`var(--mantine-color-gray-2)`,"--mantine-color-disabled-color":`var(--mantine-color-gray-5)`,"--mantine-color-disabled-border":`var(--mantine-color-gray-3)`},dark:{"--mantine-color-scheme":`dark`,"--mantine-primary-color-contrast":d.a(e,`dark`),"--mantine-color-bright":`var(--mantine-color-white)`,"--mantine-color-text":`var(--mantine-color-dark-0)`,"--mantine-color-body":`var(--mantine-color-dark-7)`,"--mantine-color-error":`var(--mantine-color-red-8)`,"--mantine-color-placeholder":`var(--mantine-color-dark-3)`,"--mantine-color-anchor":`var(--mantine-color-${e.primaryColor}-4)`,"--mantine-color-default":`var(--mantine-color-dark-6)`,"--mantine-color-default-hover":`var(--mantine-color-dark-5)`,"--mantine-color-default-color":`var(--mantine-color-white)`,"--mantine-color-default-border":`var(--mantine-color-dark-4)`,"--mantine-color-dimmed":`var(--mantine-color-dark-2)`,"--mantine-color-disabled":`var(--mantine-color-dark-6)`,"--mantine-color-disabled-color":`var(--mantine-color-dark-3)`,"--mantine-color-disabled-border":`var(--mantine-color-dark-4)`}};Te(i.variables,e.breakpoints,`breakpoint`),Te(i.variables,e.spacing,`spacing`),Te(i.variables,e.fontSizes,`font-size`),Te(i.variables,e.lineHeights,`line-height`),Te(i.variables,e.shadows,`shadow`),Te(i.variables,e.radius,`radius`),Te(i.variables,e.fontWeights,`font-weight`),e.colors[e.primaryColor].forEach((t,n)=>{i.variables[`--mantine-primary-color-${n}`]=`var(--mantine-color-${e.primaryColor}-${n})`}),n.z(e.colors).forEach(t=>{let n=e.colors[t];if(we(n)){Object.assign(i.light,Ce({theme:e,name:n.name,color:n.light,colorScheme:`light`,withColorValues:!0})),Object.assign(i.dark,Ce({theme:e,name:n.name,color:n.dark,colorScheme:`dark`,withColorValues:!0}));return}n.forEach((e,n)=>{i.variables[`--mantine-color-${t}-${n}`]=e}),Object.assign(i.light,Ce({theme:e,color:t,colorScheme:`light`,withColorValues:!1})),Object.assign(i.dark,Ce({theme:e,color:t,colorScheme:`dark`,withColorValues:!1}))});let a=e.headings.sizes;return n.z(a).forEach(t=>{i.variables[`--mantine-${t}-font-size`]=a[t].fontSize,i.variables[`--mantine-${t}-line-height`]=a[t].lineHeight,i.variables[`--mantine-${t}-font-weight`]=a[t].fontWeight||e.headings.fontWeight}),i};function De(){let e=n.d(),t=n.g(),i=n.z(e.breakpoints).reduce((t,i)=>{let a=e.breakpoints[i].includes(`px`),o=r.r(e.breakpoints[i]);return`${t}@media (max-width: ${a?`${o-.1}px`:n.I(o-.1)}) {.mantine-visible-from-${i} {display: none !important;}}@media (min-width: ${a?`${o}px`:n.I(o)}) {.mantine-hidden-from-${i} {display: none !important;}}`},``);return(0,V.jsx)(`style`,{"data-mantine-styles":`classes`,nonce:t?.(),dangerouslySetInnerHTML:{__html:i}})}function Oe({theme:e,generator:t}){let r=Ee(e),i=t?.(e);return i?n.R(r,i):r}var ke=Ee(n.f);function Ae(e){let t={variables:{},light:{},dark:{}};return n.z(e.variables).forEach(n=>{ke.variables[n]!==e.variables[n]&&(t.variables[n]=e.variables[n])}),n.z(e.light).forEach(n=>{ke.light[n]!==e.light[n]&&(t.light[n]=e.light[n])}),n.z(e.dark).forEach(n=>{ke.dark[n]!==e.dark[n]&&(t.dark[n]=e.dark[n])}),t}function je(e){return Se({variables:{},dark:{"--mantine-color-scheme":`dark`},light:{"--mantine-color-scheme":`light`}},e)}function Me({cssVariablesSelector:e,deduplicateCssVariables:t}){let r=n.d(),i=n.g(),a=Oe({theme:r,generator:n.m()}),o=(e===void 0||e===`:root`||e===`:host`)&&t,s=Se(o?Ae(a):a,e);return s?(0,V.jsx)(`style`,{"data-mantine-styles":!0,nonce:i?.(),dangerouslySetInnerHTML:{__html:`${s}${o?``:je(e)}`}}):null}Me.displayName=`@mantine/CssVariables`;function Ne({respectReducedMotion:e,getRootElement:t}){s.f(()=>{e&&t()?.setAttribute(`data-respect-reduced-motion`,`true`)},[e])}function Pe({theme:e,children:t,getStyleNonce:r,withStaticClasses:i=!0,withGlobalClasses:a=!0,deduplicateCssVariables:o=!0,withCssVariables:s=!0,cssVariablesSelector:c,classNamesPrefix:l=`mantine`,colorSchemeManager:u=ve(),defaultColorScheme:d=`light`,getRootElement:f=()=>document.documentElement,cssVariablesResolver:p,forceColorScheme:m,stylesTransform:h,env:g}){let{colorScheme:_,setColorScheme:v,clearColorScheme:y}=be({defaultColorScheme:d,forceColorScheme:m,manager:u,getRootElement:f});return Ne({respectReducedMotion:e?.respectReducedMotion||!1,getRootElement:f}),(0,V.jsx)(n.p,{value:{colorScheme:_,setColorScheme:v,clearColorScheme:y,getRootElement:f,classNamesPrefix:l,getStyleNonce:r,cssVariablesResolver:p,cssVariablesSelector:c??`:root`,withStaticClasses:i,stylesTransform:h,env:g},children:(0,V.jsxs)(n.u,{theme:e,children:[s&&(0,V.jsx)(Me,{cssVariablesSelector:c,deduplicateCssVariables:o}),a&&(0,V.jsx)(De,{}),t]})})}Pe.displayName=`@mantine/core/MantineProvider`;function Fe({children:e,theme:t,env:r}){return(0,V.jsx)(n.p,{value:{colorScheme:`auto`,setColorScheme:()=>{},clearColorScheme:()=>{},getRootElement:()=>document.documentElement,classNamesPrefix:`mantine`,cssVariablesSelector:`:root`,withStaticClasses:!1,headless:!0,env:r},children:(0,V.jsx)(n.u,{theme:t,children:e})})}Fe.displayName=`@mantine/core/HeadlessMantineProvider`;function Ie(e){return e}var[Le,H]=i.t(`ModalBase component was not found in tree`);function Re({opened:e,transitionDuration:t}){let[n,r]=(0,B.useState)(e),i=(0,B.useRef)(-1),a=s.l()?0:t;return(0,B.useEffect)(()=>(e?(r(!0),window.clearTimeout(i.current)):a===0?r(!1):i.current=window.setTimeout(()=>r(!1),a),()=>window.clearTimeout(i.current)),[e,a]),n}function ze({id:e,transitionProps:t,opened:n,trapFocus:r,closeOnEscape:i,onClose:a,returnFocus:c}){let l=s.u(e),[u,d]=(0,B.useState)(!1),[f,p]=(0,B.useState)(!1),m=Re({opened:n,transitionDuration:typeof t?.duration==`number`?t?.duration:200});return ge(`keydown`,e=>{e.key===`Escape`&&i&&!e.isComposing&&n&&e.target?.getAttribute(`data-mantine-stop-propagation`)!==`true`&&a()},{capture:!0}),o.p({opened:n,shouldReturnFocus:r&&c}),{_id:l,titleMounted:u,bodyMounted:f,shouldLockScroll:m,setTitleMounted:d,setBodyMounted:p}}var U=function(){return U=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n],t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},U.apply(this,arguments)};function Be(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols==`function`)for(var i=0,r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]]);return n}function Ve(e,t,n){if(n||arguments.length===2)for(var r=0,i=t.length,a;r<i;r++)(a||!(r in t))&&(a||=Array.prototype.slice.call(t,0,r),a[r]=t[r]);return e.concat(a||Array.prototype.slice.call(t))}var He=`right-scroll-bar-position`,Ue=`width-before-scroll-bar`,We=`with-scroll-bars-hidden`,Ge=`--removed-body-scroll-bar-size`;function Ke(e,t){return typeof e==`function`?e(t):e&&(e.current=t),e}function qe(e,t){var n=(0,B.useState)(function(){return{value:e,callback:t,facade:{get current(){return n.value},set current(e){var t=n.value;t!==e&&(n.value=e,n.callback(e,t))}}}})[0];return n.callback=t,n.facade}var Je=typeof window<`u`?B.useLayoutEffect:B.useEffect,Ye=new WeakMap;function Xe(e,t){var n=qe(t||null,function(t){return e.forEach(function(e){return Ke(e,t)})});return Je(function(){var t=Ye.get(n);if(t){var r=new Set(t),i=new Set(e),a=n.current;r.forEach(function(e){i.has(e)||Ke(e,null)}),i.forEach(function(e){r.has(e)||Ke(e,a)})}Ye.set(n,e)},[e]),n}function Ze(e){return e}function Qe(e,t){t===void 0&&(t=Ze);var n=[],r=!1;return{read:function(){if(r)throw Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return n.length?n[n.length-1]:e},useMedium:function(e){var i=t(e,r);return n.push(i),function(){n=n.filter(function(e){return e!==i})}},assignSyncMedium:function(e){for(r=!0;n.length;){var t=n;n=[],t.forEach(e)}n={push:function(t){return e(t)},filter:function(){return n}}},assignMedium:function(e){r=!0;var t=[];if(n.length){var i=n;n=[],i.forEach(e),t=n}var a=function(){var n=t;t=[],n.forEach(e)},o=function(){return Promise.resolve().then(a)};o(),n={push:function(e){t.push(e),o()},filter:function(e){return t=t.filter(e),n}}}}}function $e(e){e===void 0&&(e={});var t=Qe(null);return t.options=U({async:!0,ssr:!1},e),t}var et=function(e){var t=e.sideCar,n=Be(e,[`sideCar`]);if(!t)throw Error("Sidecar: please provide `sideCar` property to import the right car");var r=t.read();if(!r)throw Error(`Sidecar medium not found`);return B.createElement(r,U({},n))};et.isSideCarExport=!0;function tt(e,t){return e.useMedium(t),et}var nt=$e(),rt=function(){},it=B.forwardRef(function(e,t){var n=B.useRef(null),r=B.useState({onScrollCapture:rt,onWheelCapture:rt,onTouchMoveCapture:rt}),i=r[0],a=r[1],o=e.forwardProps,s=e.children,c=e.className,l=e.removeScrollBar,u=e.enabled,d=e.shards,f=e.sideCar,p=e.noRelative,m=e.noIsolation,h=e.inert,g=e.allowPinchZoom,_=e.as,v=_===void 0?`div`:_,y=e.gapMode,b=Be(e,[`forwardProps`,`children`,`className`,`removeScrollBar`,`enabled`,`shards`,`sideCar`,`noRelative`,`noIsolation`,`inert`,`allowPinchZoom`,`as`,`gapMode`]),x=f,S=Xe([n,t]),C=U(U({},b),i);return B.createElement(B.Fragment,null,u&&B.createElement(x,{sideCar:nt,removeScrollBar:l,shards:d,noRelative:p,noIsolation:m,inert:h,setCallbacks:a,allowPinchZoom:!!g,lockRef:n,gapMode:y}),o?B.cloneElement(B.Children.only(s),U(U({},C),{ref:S})):B.createElement(v,U({},C,{className:c,ref:S}),s))});it.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1},it.classNames={fullWidth:Ue,zeroRight:He};var at,ot=function(){if(at)return at;if(typeof __webpack_nonce__<`u`)return __webpack_nonce__};function st(){if(!document)return null;var e=document.createElement(`style`);e.type=`text/css`;var t=ot();return t&&e.setAttribute(`nonce`,t),e}function ct(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function lt(e){(document.head||document.getElementsByTagName(`head`)[0]).appendChild(e)}var ut=function(){var e=0,t=null;return{add:function(n){e==0&&(t=st())&&(ct(t,n),lt(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},dt=function(){var e=ut();return function(t,n){B.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&n])}},ft=function(){var e=dt();return function(t){var n=t.styles,r=t.dynamic;return e(n,r),null}},pt={left:0,top:0,right:0,gap:0},mt=function(e){return parseInt(e||``,10)||0},ht=function(e){var t=window.getComputedStyle(document.body),n=t[e===`padding`?`paddingLeft`:`marginLeft`],r=t[e===`padding`?`paddingTop`:`marginTop`],i=t[e===`padding`?`paddingRight`:`marginRight`];return[mt(n),mt(r),mt(i)]},gt=function(e){if(e===void 0&&(e=`margin`),typeof window>`u`)return pt;var t=ht(e),n=document.documentElement.clientWidth,r=window.innerWidth;return{left:t[0],top:t[1],right:t[2],gap:Math.max(0,r-n+t[2]-t[0])}},_t=ft(),vt=`data-scroll-locked`,yt=function(e,t,n,r){var i=e.left,a=e.top,o=e.right,s=e.gap;return n===void 0&&(n=`margin`),`
|
|
2
|
-
.${We} {
|
|
3
|
-
overflow: hidden ${r};
|
|
4
|
-
padding-right: ${s}px ${r};
|
|
5
|
-
}
|
|
6
|
-
body[${vt}] {
|
|
7
|
-
overflow: hidden ${r};
|
|
8
|
-
overscroll-behavior: contain;
|
|
9
|
-
${[t&&`position: relative ${r};`,n===`margin`&&`
|
|
10
|
-
padding-left: ${i}px;
|
|
11
|
-
padding-top: ${a}px;
|
|
12
|
-
padding-right: ${o}px;
|
|
13
|
-
margin-left:0;
|
|
14
|
-
margin-top:0;
|
|
15
|
-
margin-right: ${s}px ${r};
|
|
16
|
-
`,n===`padding`&&`padding-right: ${s}px ${r};`].filter(Boolean).join(``)}
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
.${He} {
|
|
20
|
-
right: ${s}px ${r};
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
.${Ue} {
|
|
24
|
-
margin-right: ${s}px ${r};
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
.${He} .${He} {
|
|
28
|
-
right: 0 ${r};
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
.${Ue} .${Ue} {
|
|
32
|
-
margin-right: 0 ${r};
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
body[${vt}] {
|
|
36
|
-
${Ge}: ${s}px;
|
|
37
|
-
}
|
|
38
|
-
`},bt=function(){var e=parseInt(document.body.getAttribute(`data-scroll-locked`)||`0`,10);return isFinite(e)?e:0},xt=function(){B.useEffect(function(){return document.body.setAttribute(vt,(bt()+1).toString()),function(){var e=bt()-1;e<=0?document.body.removeAttribute(vt):document.body.setAttribute(vt,e.toString())}},[])},St=function(e){var t=e.noRelative,n=e.noImportant,r=e.gapMode,i=r===void 0?`margin`:r;xt();var a=B.useMemo(function(){return gt(i)},[i]);return B.createElement(_t,{styles:yt(a,!t,i,n?``:`!important`)})},Ct=!1;if(typeof window<`u`)try{var wt=Object.defineProperty({},`passive`,{get:function(){return Ct=!0,!0}});window.addEventListener(`test`,wt,wt),window.removeEventListener(`test`,wt,wt)}catch{Ct=!1}var Tt=Ct?{passive:!1}:!1,Et=function(e){return e.tagName===`TEXTAREA`},Dt=function(e,t){if(!(e instanceof Element))return!1;var n=window.getComputedStyle(e);return n[t]!==`hidden`&&!(n.overflowY===n.overflowX&&!Et(e)&&n[t]===`visible`)},Ot=function(e){return Dt(e,`overflowY`)},kt=function(e){return Dt(e,`overflowX`)},At=function(e,t){var n=t.ownerDocument,r=t;do{if(typeof ShadowRoot<`u`&&r instanceof ShadowRoot&&(r=r.host),Nt(e,r)){var i=Pt(e,r);if(i[1]>i[2])return!0}r=r.parentNode}while(r&&r!==n.body);return!1},jt=function(e){return[e.scrollTop,e.scrollHeight,e.clientHeight]},Mt=function(e){return[e.scrollLeft,e.scrollWidth,e.clientWidth]},Nt=function(e,t){return e===`v`?Ot(t):kt(t)},Pt=function(e,t){return e===`v`?jt(t):Mt(t)},Ft=function(e,t){return e===`h`&&t===`rtl`?-1:1},It=function(e,t,n,r,i){var a=Ft(e,window.getComputedStyle(t).direction),o=a*r,s=n.target,c=t.contains(s),l=!1,u=o>0,d=0,f=0;do{if(!s)break;var p=Pt(e,s),m=p[0],h=p[1]-p[2]-a*m;(m||h)&&Nt(e,s)&&(d+=h,f+=m);var g=s.parentNode;s=g&&g.nodeType===Node.DOCUMENT_FRAGMENT_NODE?g.host:g}while(!c&&s!==document.body||c&&(t.contains(s)||t===s));return(u&&(i&&Math.abs(d)<1||!i&&o>d)||!u&&(i&&Math.abs(f)<1||!i&&-o>f))&&(l=!0),l},Lt=function(e){return`changedTouches`in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},Rt=function(e){return[e.deltaX,e.deltaY]},zt=function(e){return e&&`current`in e?e.current:e},Bt=function(e,t){return e[0]===t[0]&&e[1]===t[1]},Vt=function(e){return`
|
|
39
|
-
.block-interactivity-${e} {pointer-events: none;}
|
|
40
|
-
.allow-interactivity-${e} {pointer-events: all;}
|
|
41
|
-
`},Ht=0,Ut=[];function Wt(e){var t=B.useRef([]),n=B.useRef([0,0]),r=B.useRef(),i=B.useState(Ht++)[0],a=B.useState(ft)[0],o=B.useRef(e);B.useEffect(function(){o.current=e},[e]),B.useEffect(function(){if(e.inert){document.body.classList.add(`block-interactivity-${i}`);var t=Ve([e.lockRef.current],(e.shards||[]).map(zt),!0).filter(Boolean);return t.forEach(function(e){return e.classList.add(`allow-interactivity-${i}`)}),function(){document.body.classList.remove(`block-interactivity-${i}`),t.forEach(function(e){return e.classList.remove(`allow-interactivity-${i}`)})}}},[e.inert,e.lockRef.current,e.shards]);var s=B.useCallback(function(e,t){if(`touches`in e&&e.touches.length===2||e.type===`wheel`&&e.ctrlKey)return!o.current.allowPinchZoom;var i=Lt(e),a=n.current,s=`deltaX`in e?e.deltaX:a[0]-i[0],c=`deltaY`in e?e.deltaY:a[1]-i[1],l,u=e.target,d=Math.abs(s)>Math.abs(c)?`h`:`v`;if(`touches`in e&&d===`h`&&u.type===`range`)return!1;var f=window.getSelection(),p=f&&f.anchorNode;if(p&&(p===u||p.contains(u)))return!1;var m=At(d,u);if(!m)return!0;if(m?l=d:(l=d===`v`?`h`:`v`,m=At(d,u)),!m)return!1;if(!r.current&&`changedTouches`in e&&(s||c)&&(r.current=l),!l)return!0;var h=r.current||l;return It(h,t,e,h===`h`?s:c,!0)},[]),c=B.useCallback(function(e){var n=e;if(!(!Ut.length||Ut[Ut.length-1]!==a)){var r=`deltaY`in n?Rt(n):Lt(n),i=t.current.filter(function(e){return e.name===n.type&&(e.target===n.target||n.target===e.shadowParent)&&Bt(e.delta,r)})[0];if(i&&i.should){n.cancelable&&n.preventDefault();return}if(!i){var c=(o.current.shards||[]).map(zt).filter(Boolean).filter(function(e){return e.contains(n.target)});(c.length>0?s(n,c[0]):!o.current.noIsolation)&&n.cancelable&&n.preventDefault()}}},[]),l=B.useCallback(function(e,n,r,i){var a={name:e,delta:n,target:r,should:i,shadowParent:Gt(r)};t.current.push(a),setTimeout(function(){t.current=t.current.filter(function(e){return e!==a})},1)},[]),u=B.useCallback(function(e){n.current=Lt(e),r.current=void 0},[]),d=B.useCallback(function(t){l(t.type,Rt(t),t.target,s(t,e.lockRef.current))},[]),f=B.useCallback(function(t){l(t.type,Lt(t),t.target,s(t,e.lockRef.current))},[]);B.useEffect(function(){return Ut.push(a),e.setCallbacks({onScrollCapture:d,onWheelCapture:d,onTouchMoveCapture:f}),document.addEventListener(`wheel`,c,Tt),document.addEventListener(`touchmove`,c,Tt),document.addEventListener(`touchstart`,u,Tt),function(){Ut=Ut.filter(function(e){return e!==a}),document.removeEventListener(`wheel`,c,Tt),document.removeEventListener(`touchmove`,c,Tt),document.removeEventListener(`touchstart`,u,Tt)}},[]);var p=e.removeScrollBar,m=e.inert;return B.createElement(B.Fragment,null,m?B.createElement(a,{styles:Vt(i)}):null,p?B.createElement(St,{noRelative:e.noRelative,gapMode:e.gapMode}):null)}function Gt(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}var Kt=tt(nt,Wt),qt=B.forwardRef(function(e,t){return B.createElement(it,U({},e,{ref:t,sideCar:Kt}))});qt.classNames=it.classNames;function Jt({keepMounted:e,opened:t,onClose:r,id:i,transitionProps:a,onExitTransitionEnd:s,onEnterTransitionEnd:c,trapFocus:l,closeOnEscape:u,returnFocus:d,closeOnClickOutside:f,withinPortal:p,portalProps:m,lockScroll:h,children:g,zIndex:_,shadow:v,padding:y,__vars:b,unstyled:x,removeScrollProps:S,...C}){let{_id:w,titleMounted:T,bodyMounted:E,shouldLockScroll:D,setTitleMounted:O,setBodyMounted:k}=ze({id:i,transitionProps:a,opened:t,trapFocus:l,closeOnEscape:u,onClose:r,returnFocus:d}),{key:A,...j}=S||{};return(0,V.jsx)(o.i,{...m,withinPortal:p,children:(0,V.jsx)(Le,{value:{opened:t,onClose:r,closeOnClickOutside:f,onExitTransitionEnd:s,onEnterTransitionEnd:c,transitionProps:{...a,keepMounted:e},getTitleId:()=>`${w}-title`,getBodyId:()=>`${w}-body`,titleMounted:T,bodyMounted:E,setTitleMounted:O,setBodyMounted:k,trapFocus:l,closeOnEscape:u,zIndex:_,unstyled:x},children:(0,V.jsx)(qt,{enabled:D&&h,...j,children:(0,V.jsx)(n.t,{...C,id:w,__vars:{...b,"--mb-z-index":(_||o.h(`modal`)).toString(),"--mb-shadow":n.M(v),"--mb-padding":n.P(y)},children:g})},A)})})}Jt.displayName=`@mantine/core/ModalBase`;function Yt(){let e=H();return(0,B.useEffect)(()=>(e.setBodyMounted(!0),()=>e.setBodyMounted(!1)),[]),e.getBodyId()}var Xt={title:`m_615af6c9`,header:`m_b5489c3c`,inner:`m_60c222c7`,content:`m_fd1ab0aa`,close:`m_606cb269`,body:`m_5df29311`};function Zt({className:e,...t}){let r=Yt(),i=H();return(0,V.jsx)(n.t,{id:r,className:n.D({[Xt.body]:!i.unstyled},e),...t})}Zt.displayName=`@mantine/core/ModalBaseBody`;function Qt({className:e,onClick:t,...r}){let i=H();return(0,V.jsx)(s.o,{...r,onClick:e=>{i.onClose(),t?.(e)},className:n.D({[Xt.close]:!i.unstyled},e),unstyled:i.unstyled})}Qt.displayName=`@mantine/core/ModalBaseCloseButton`;function $t({transitionProps:e,className:t,innerProps:r,onKeyDown:i,style:a,ref:c,...l}){let u=H();return(0,V.jsx)(s.c,{mounted:u.opened,transition:`pop`,...u.transitionProps,onExited:()=>{u.onExitTransitionEnd?.(),u.transitionProps?.onExited?.()},onEntered:()=>{u.onEnterTransitionEnd?.(),u.transitionProps?.onEntered?.()},...e,children:e=>(0,V.jsx)(`div`,{...r,className:n.D({[Xt.inner]:!u.unstyled},r.className),children:(0,V.jsx)(o.r,{active:u.opened&&u.trapFocus,innerRef:c,children:(0,V.jsx)(p.t,{...l,component:`section`,role:`dialog`,tabIndex:-1,"aria-modal":!0,"aria-describedby":u.bodyMounted?u.getBodyId():void 0,"aria-labelledby":u.titleMounted?u.getTitleId():void 0,style:[a,e],className:n.D({[Xt.content]:!u.unstyled},t),unstyled:u.unstyled,children:l.children})})})})}$t.displayName=`@mantine/core/ModalBaseContent`;function en({className:e,...t}){let r=H();return(0,V.jsx)(n.t,{component:`header`,className:n.D({[Xt.header]:!r.unstyled},e),...t})}en.displayName=`@mantine/core/ModalBaseHeader`;var tn={duration:200,timingFunction:`ease`,transition:`fade`};function nn(e){let t=H();return{...tn,...t.transitionProps,...e}}function rn({onClick:e,transitionProps:t,style:n,visible:r,...i}){let a=H(),c=nn(t);return(0,V.jsx)(s.c,{mounted:r===void 0?a.opened:r,...c,transition:`fade`,children:t=>(0,V.jsx)(o.a,{fixed:!0,style:[n,t],zIndex:a.zIndex,unstyled:a.unstyled,onClick:t=>{e?.(t),a.closeOnClickOutside&&a.onClose()},...i})})}rn.displayName=`@mantine/core/ModalBaseOverlay`;function an(){let e=H();return(0,B.useEffect)(()=>(e.setTitleMounted(!0),()=>e.setTitleMounted(!1)),[]),e.getTitleId()}function on({className:e,...t}){let r=an(),i=H();return(0,V.jsx)(n.t,{component:`h2`,className:n.D({[Xt.title]:!i.unstyled},e),id:r,...t})}on.displayName=`@mantine/core/ModalBaseTitle`;function sn({children:e}){return(0,V.jsx)(V.Fragment,{children:e})}var[cn,ln]=i.t(`Modal component was not found in tree`),W={root:`m_9df02822`,content:`m_54c44539`,inner:`m_1f958f16`,header:`m_d0e2b9cd`},un=n.r(e=>{let{classNames:t,className:r,style:i,styles:a,vars:o,...s}=n.l(`ModalBody`,null,e);return(0,V.jsx)(Zt,{...ln().getStyles(`body`,{classNames:t,style:i,styles:a,className:r}),...s})});un.classes=W,un.displayName=`@mantine/core/ModalBody`;var dn=n.r(e=>{let{classNames:t,className:r,style:i,styles:a,vars:o,...s}=n.l(`ModalCloseButton`,null,e);return(0,V.jsx)(Qt,{...ln().getStyles(`close`,{classNames:t,style:i,styles:a,className:r}),...s})});dn.classes=W,dn.displayName=`@mantine/core/ModalCloseButton`;var fn=n.r(e=>{let{classNames:t,className:r,style:i,styles:a,vars:o,children:s,__hidden:c,...l}=n.l(`ModalContent`,null,e),u=ln(),d=u.scrollAreaComponent||sn;return(0,V.jsx)($t,{...u.getStyles(`content`,{className:r,style:i,styles:a,classNames:t}),innerProps:u.getStyles(`inner`,{className:r,style:i,styles:a,classNames:t}),"data-full-screen":u.fullScreen||void 0,"data-modal-content":!0,"data-hidden":c||void 0,...l,children:(0,V.jsx)(d,{style:{maxHeight:u.fullScreen?`100dvh`:`calc(100dvh - (${n.L(u.yOffset)} * 2))`},children:s})})});fn.classes=W,fn.displayName=`@mantine/core/ModalContent`;var pn=n.r(e=>{let{classNames:t,className:r,style:i,styles:a,vars:o,...s}=n.l(`ModalHeader`,null,e);return(0,V.jsx)(en,{...ln().getStyles(`header`,{classNames:t,style:i,styles:a,className:r}),...s})});pn.classes=W,pn.displayName=`@mantine/core/ModalHeader`;var mn=n.r(e=>{let{classNames:t,className:r,style:i,styles:a,vars:o,...s}=n.l(`ModalOverlay`,null,e);return(0,V.jsx)(rn,{...ln().getStyles(`overlay`,{classNames:t,style:i,styles:a,className:r}),...s})});mn.classes=W,mn.displayName=`@mantine/core/ModalOverlay`;var hn={__staticSelector:`Modal`,closeOnClickOutside:!0,withinPortal:!0,lockScroll:!0,trapFocus:!0,returnFocus:!0,closeOnEscape:!0,keepMounted:!1,zIndex:o.h(`modal`),transitionProps:{duration:200,transition:`fade-down`},yOffset:`5dvh`},gn=n.O((e,{radius:t,size:r,yOffset:i,xOffset:a})=>({root:{"--modal-radius":t===void 0?void 0:n.j(t),"--modal-size":n.N(r,`modal-size`),"--modal-y-offset":n.L(i),"--modal-x-offset":n.L(a)}})),_n=n.r(e=>{let t=n.l(`ModalRoot`,hn,e),{classNames:r,className:i,style:a,styles:o,unstyled:s,vars:c,yOffset:u,scrollAreaComponent:d,radius:f,fullScreen:p,centered:m,xOffset:h,__staticSelector:g,attributes:_,...v}=t,y=n.c({name:g,classes:W,props:t,className:i,style:a,classNames:r,styles:o,unstyled:s,attributes:_,vars:c,varsResolver:gn});return(0,V.jsx)(cn,{value:{yOffset:u,scrollAreaComponent:d,getStyles:y,fullScreen:p},children:(0,V.jsx)(Jt,{...y(`root`),"data-full-screen":p||void 0,"data-centered":m||void 0,"data-offset-scrollbars":d===l.a.Autosize||void 0,unstyled:s,...v})})});_n.classes=W,_n.varsResolver=gn,_n.displayName=`@mantine/core/ModalRoot`;var vn=(0,B.createContext)(null);function yn({children:e}){let[t,n]=(0,B.useState)([]),[r,i]=(0,B.useState)(o.h(`modal`));return(0,V.jsx)(vn,{value:{stack:t,addModal:(e,t)=>{n(t=>[...new Set([...t,e])]),i(e=>typeof t==`number`&&typeof e==`number`?Math.max(e,t):e)},removeModal:e=>n(t=>t.filter(t=>t!==e)),getZIndex:e=>`calc(${r} + ${t.indexOf(e)} + 1)`,currentId:t[t.length-1],maxZIndex:r},children:e})}yn.displayName=`@mantine/core/ModalStack`;var bn=n.r(e=>{let{classNames:t,className:r,style:i,styles:a,vars:o,...s}=n.l(`ModalTitle`,null,e);return(0,V.jsx)(on,{...ln().getStyles(`title`,{classNames:t,style:i,styles:a,className:r}),...s})});bn.classes=W,bn.displayName=`@mantine/core/ModalTitle`;var xn={closeOnClickOutside:!0,withinPortal:!0,lockScroll:!0,trapFocus:!0,returnFocus:!0,closeOnEscape:!0,keepMounted:!1,zIndex:o.h(`modal`),transitionProps:{duration:200,transition:`fade-down`},withOverlay:!0,withCloseButton:!0},G=n.r(e=>{let{title:t,withOverlay:r,overlayProps:i,withCloseButton:a,closeButtonProps:s,children:c,radius:l,opened:u,stackId:d,zIndex:f,...p}=n.l(`Modal`,xn,e),m=(0,B.use)(vn),h=!!t||a,g=m&&d?{closeOnEscape:m.currentId===d,trapFocus:m.currentId===d,zIndex:m.getZIndex(d)}:{},_=r===!1?!1:d&&m?m.currentId===d:u;return(0,B.useEffect)(()=>{m&&d&&(u?m.addModal(d,f||o.h(`modal`)):m.removeModal(d))},[u,d,f]),(0,V.jsxs)(_n,{radius:l,opened:u,zIndex:m&&d?m.getZIndex(d):f,...p,...g,children:[r&&(0,V.jsx)(mn,{visible:_,transitionProps:m&&d?{duration:0}:void 0,...i}),(0,V.jsxs)(fn,{radius:l,__hidden:m&&d&&u?d!==m.currentId:!1,children:[h&&(0,V.jsxs)(pn,{children:[t&&(0,V.jsx)(bn,{children:t}),a&&(0,V.jsx)(dn,{...s})]}),(0,V.jsx)(un,{children:c})]})]})});G.classes=W,G.displayName=`@mantine/core/Modal`,G.Root=_n,G.Overlay=mn,G.Content=fn,G.Body=un,G.Header=pn,G.Title=bn,G.CloseButton=dn,G.Stack=yn;var Sn={root:`m_a513464`,icon:`m_a4ceffb`,loader:`m_b0920b15`,body:`m_a49ed24`,title:`m_3feedf16`,description:`m_3d733a3a`,closeButton:`m_919a4d88`},Cn={withCloseButton:!0},wn=n.O((e,{radius:t,color:r})=>({root:{"--notification-radius":t===void 0?void 0:n.j(t),"--notification-color":r?n.x(r,e):void 0}})),Tn=n.r(e=>{let t=n.l(`Notification`,Cn,e),{className:r,color:i,radius:a,loading:o,withCloseButton:c,withBorder:l,title:u,icon:d,children:f,onClose:p,closeButtonProps:m,classNames:h,style:g,styles:_,unstyled:v,vars:y,mod:b,loaderProps:x,role:S,attributes:C,...w}=t,T=n.c({name:`Notification`,classes:Sn,props:t,className:r,style:g,classNames:h,styles:_,unstyled:v,attributes:C,vars:y,varsResolver:wn});return(0,V.jsxs)(n.t,{...T(`root`),mod:[{"data-with-icon":!!d||o,"data-with-border":l},b],role:S||`alert`,...w,children:[d&&!o&&(0,V.jsx)(`div`,{...T(`icon`),children:d}),o&&(0,V.jsx)(s.s,{size:28,color:i,...T(`loader`),...x}),(0,V.jsxs)(`div`,{...T(`body`),children:[u&&(0,V.jsx)(`div`,{...T(`title`),children:u}),(0,V.jsx)(n.t,{...T(`description`),mod:{"data-with-title":!!u},children:f})]}),c&&(0,V.jsx)(s.o,{iconSize:16,color:`gray`,...m,unstyled:v,onClick:e=>{m?.onClick?.(e),p?.()},...T(`closeButton`)})]})});Tn.classes=Sn,Tn.varsResolver=wn,Tn.displayName=`@mantine/core/Notification`;var En={primaryColor:`blue`,other:{desktop:{backgroundColor:`#1a1a2e`},taskbar:{backgroundColor:`#16213e`,textColor:`#ffffff`},window:{backgroundColor:`#0f0f23`,textColor:`#ffffff`,borderRadius:`8px`},accent:`#339af0`}},Dn=(0,B.createContext)(void 0);function On({children:e,fileSystem:t,isReady:n,error:r}){let i=me(),a=c.h(e=>e.setThemeMode),o=c.h(e=>e.toggleTheme),s=(0,B.useMemo)(()=>({fs:n?t:null,isReady:n,error:r,theme:i,setThemeMode:a,toggleTheme:o}),[t,n,r,i,a,o]);return(0,V.jsx)(Dn.Provider,{value:s,children:e})}function kn({children:e,fileSystem:t,initialMode:n,theme:r,mantineTheme:i,fallback:a=null,onError:o}){let[s,l]=(0,B.useState)(!1),[u,d]=(0,B.useState)(null),f=c.h(e=>e.theme.mode),p=c.h(e=>e.setThemeMode);(0,B.useEffect)(()=>{n&&p(n)},[]),(0,B.useEffect)(()=>{let e=!0;return(async()=>{try{await t.initialize(),e&&l(!0)}catch(t){let n=t instanceof Error?t:Error(String(t));e&&(d(n),o?.(n))}})(),()=>{e=!1}},[t,o]);let m=(0,B.useMemo)(()=>Ie({...En,...i}),[i]);return u||!s?(0,V.jsx)(V.Fragment,{children:a}):(0,V.jsx)(Pe,{theme:m,forceColorScheme:f,children:(0,V.jsx)(pe,{mode:f,theme:r,children:(0,V.jsx)(On,{fileSystem:t,isReady:s,error:u,children:e})})})}function An(){let e=(0,B.useContext)(Dn);if(!e)throw Error(`useFdeContext must be used within an FdeProvider`);return e}function jn(e,t){if(typeof e==`function`)return e(t);e!=null&&(e.current=t)}function Mn(...e){return t=>{let n=!1,r=e.map(e=>{let r=jn(e,t);return!n&&typeof r==`function`&&(n=!0),r});if(n)return()=>{for(let t=0;t<r.length;t++){let n=r[t];typeof n==`function`?n():jn(e[t],null)}}}}function Nn(...e){return B.useCallback(Mn(...e),e)}var Pn=class extends B.Component{getSnapshotBeforeUpdate(e){let t=this.props.childRef.current;if(T.o(t)&&e.isPresent&&!this.props.isPresent&&this.props.pop!==!1){let e=t.offsetParent,n=T.o(e)&&e.offsetWidth||0,r=T.o(e)&&e.offsetHeight||0,i=getComputedStyle(t),a=this.props.sizeRef.current;a.height=parseFloat(i.height),a.width=parseFloat(i.width),a.top=t.offsetTop,a.left=t.offsetLeft,a.right=n-a.width-a.left,a.bottom=r-a.height-a.top}return null}componentDidUpdate(){}render(){return this.props.children}};function Fn({children:e,isPresent:t,anchorX:n,anchorY:r,root:i,pop:a}){let o=(0,B.useId)(),s=(0,B.useRef)(null),c=(0,B.useRef)({width:0,height:0,top:0,left:0,right:0,bottom:0}),{nonce:l}=(0,B.useContext)(T.a),u=Nn(s,e.props?.ref??e?.ref);return(0,B.useInsertionEffect)(()=>{let{width:e,height:u,top:d,left:f,right:p,bottom:m}=c.current;if(t||a===!1||!s.current||!e||!u)return;let h=n===`left`?`left: ${f}`:`right: ${p}`,g=r===`bottom`?`bottom: ${m}`:`top: ${d}`;s.current.dataset.motionPopId=o;let _=document.createElement(`style`);l&&(_.nonce=l);let v=i??document.head;return v.appendChild(_),_.sheet&&_.sheet.insertRule(`
|
|
42
|
-
[data-motion-pop-id="${o}"] {
|
|
43
|
-
position: absolute !important;
|
|
44
|
-
width: ${e}px !important;
|
|
45
|
-
height: ${u}px !important;
|
|
46
|
-
${h}px !important;
|
|
47
|
-
${g}px !important;
|
|
48
|
-
}
|
|
49
|
-
`),()=>{s.current?.removeAttribute(`data-motion-pop-id`),v.contains(_)&&v.removeChild(_)}},[t]),(0,V.jsx)(Pn,{isPresent:t,childRef:s,sizeRef:c,pop:a,children:a===!1?e:B.cloneElement(e,{ref:u})})}var In=({children:e,initial:t,isPresent:n,onExitComplete:r,custom:i,presenceAffectsLayout:a,mode:o,anchorX:s,anchorY:c,root:l})=>{let u=T.f(Ln),d=(0,B.useId)(),f=!0,p=(0,B.useMemo)(()=>(f=!1,{id:d,initial:t,isPresent:n,custom:i,onExitComplete:e=>{u.set(e,!0);for(let e of u.values())if(!e)return;r&&r()},register:e=>(u.set(e,!1),()=>u.delete(e))}),[n,u,r]);return a&&f&&(p={...p}),(0,B.useMemo)(()=>{u.forEach((e,t)=>u.set(t,!1))},[n]),B.useEffect(()=>{!n&&!u.size&&r&&r()},[n]),e=(0,V.jsx)(Fn,{pop:o===`popLayout`,isPresent:n,anchorX:s,anchorY:c,root:l,children:e}),(0,V.jsx)(T.u.Provider,{value:p,children:e})};function Ln(){return new Map}var Rn=e=>e.key||``;function zn(e){let t=[];return B.Children.forEach(e,e=>{(0,B.isValidElement)(e)&&t.push(e)}),t}var Bn=({children:e,custom:t,initial:n=!0,onExitComplete:r,presenceAffectsLayout:i=!0,mode:a=`sync`,propagate:o=!1,anchorX:s=`left`,anchorY:c=`top`,root:l})=>{let[u,d]=T.i(o),f=(0,B.useMemo)(()=>zn(e),[e]),p=o&&!u?[]:f.map(Rn),m=(0,B.useRef)(!0),h=(0,B.useRef)(f),g=T.f(()=>new Map),_=(0,B.useRef)(new Set),[v,y]=(0,B.useState)(f),[b,x]=(0,B.useState)(f);T.d(()=>{m.current=!1,h.current=f;for(let e=0;e<b.length;e++){let t=Rn(b[e]);p.includes(t)?(g.delete(t),_.current.delete(t)):g.get(t)!==!0&&g.set(t,!1)}},[b,p.length,p.join(`-`)]);let S=[];if(f!==v){let e=[...f];for(let t=0;t<b.length;t++){let n=b[t],r=Rn(n);p.includes(r)||(e.splice(t,0,n),S.push(n))}return a===`wait`&&S.length&&(e=S),x(zn(e)),y(f),null}process.env.NODE_ENV!==`production`&&a===`wait`&&b.length>1&&console.warn(`You're attempting to animate multiple children within AnimatePresence, but its mode is set to "wait". This will lead to odd visual behaviour.`);let{forceRender:C}=(0,B.useContext)(T.p);return(0,V.jsx)(V.Fragment,{children:b.map(e=>{let v=Rn(e),y=o&&!u?!1:f===b||p.includes(v);return(0,V.jsx)(In,{isPresent:y,initial:!m.current||n?void 0:!1,custom:t,presenceAffectsLayout:i,mode:a,root:l,onExitComplete:y?void 0:()=>{if(_.current.has(v))return;if(g.has(v))_.current.add(v),g.set(v,!0);else return;let e=!0;g.forEach(t=>{t||(e=!1)}),e&&(C?.(),x(h.current),o&&d?.(),r&&r())},anchorX:s,anchorY:c,children:e},v)})})};function Vn(e){e.values.forEach(e=>e.stop())}function Hn(e,t){[...t].reverse().forEach(n=>{let r=e.getVariant(n);r&&T.c(e,r),e.variantChildren&&e.variantChildren.forEach(e=>{Hn(e,t)})})}function Un(e,t){if(Array.isArray(t))return Hn(e,t);if(typeof t==`string`)return Hn(e,[t]);T.c(e,t)}function Wn(){let e=!1,t=new Set,n={subscribe(e){return t.add(e),()=>void t.delete(e)},start(n,r){T.l(e,`controls.start() should only be called after a component has mounted. Consider calling within a useEffect hook.`);let i=[];return t.forEach(e=>{i.push(T.s(e,n,{transitionOverride:r}))}),Promise.all(i)},set(n){return T.l(e,`controls.set() should only be called after a component has mounted. Consider calling within a useEffect hook.`),t.forEach(e=>{Un(e,n)})},stop(){t.forEach(e=>{Vn(e)})},mount(){return e=!0,()=>{e=!1,n.stop()}}};return n}function Gn(){let e=T.f(Wn);return T.d(e.mount,[]),e}var Kn=(0,B.createContext)(null),qn=({children:e})=>{let t=(0,B.useRef)(new Map);return(0,V.jsx)(Kn.Provider,{value:{register:(e,n)=>{t.current.set(e,n)},unregister:e=>{t.current.delete(e)},getRect:e=>t.current.get(e)},children:e})},Jn=()=>{let e=(0,B.useContext)(Kn);if(!e)throw Error(`useWindowButtonRegistry must be used within WindowButtonRegistryProvider`);return e},Yn={root:`_root_1z0nr_1`},Xn=`linear-gradient(90deg, rgba(42, 123, 155, 1) 0%, rgba(87, 199, 133, 1) 50%, rgba(237, 221, 83, 1) 100%)`,Zn=({children:e,onContextMenu:t,wallpaper:n,backgroundColor:r})=>{let i=w.o(e=>e.setViewportSize),a=(0,B.useRef)(null);(0,B.useEffect)(()=>{let e=a.current;if(!e)return;let t=new ResizeObserver(e=>{let{width:t,height:n}=e[0]?.contentRect??{};t&&t>0&&n&&n>0&&i(t,n)});return t.observe(e),()=>t.disconnect()},[i]);let o=n?`url(${n})`:Xn;return(0,V.jsx)(`div`,{ref:a,className:Yn.root,"data-testid":`desktop-area`,style:{"--taskbar-height":`48px`,backgroundColor:r??`transparent`,backgroundImage:o,backgroundSize:`cover`,backgroundPosition:`center`},onContextMenu:t,children:e})},K=e=>typeof e==`string`,Qn=()=>{let e,t,n=new Promise((n,r)=>{e=n,t=r});return n.resolve=e,n.reject=t,n},$n=e=>e==null?``:``+e,er=(e,t,n)=>{e.forEach(e=>{t[e]&&(n[e]=t[e])})},tr=/###/g,nr=e=>e&&e.indexOf(`###`)>-1?e.replace(tr,`.`):e,rr=e=>!e||K(e),ir=(e,t,n)=>{let r=K(t)?t.split(`.`):t,i=0;for(;i<r.length-1;){if(rr(e))return{};let t=nr(r[i]);!e[t]&&n&&(e[t]=new n),e=Object.prototype.hasOwnProperty.call(e,t)?e[t]:{},++i}return rr(e)?{}:{obj:e,k:nr(r[i])}},ar=(e,t,n)=>{let{obj:r,k:i}=ir(e,t,Object);if(r!==void 0||t.length===1){r[i]=n;return}let a=t[t.length-1],o=t.slice(0,t.length-1),s=ir(e,o,Object);for(;s.obj===void 0&&o.length;)a=`${o[o.length-1]}.${a}`,o=o.slice(0,o.length-1),s=ir(e,o,Object),s?.obj&&s.obj[`${s.k}.${a}`]!==void 0&&(s.obj=void 0);s.obj[`${s.k}.${a}`]=n},or=(e,t,n,r)=>{let{obj:i,k:a}=ir(e,t,Object);i[a]=i[a]||[],i[a].push(n)},sr=(e,t)=>{let{obj:n,k:r}=ir(e,t);if(n&&Object.prototype.hasOwnProperty.call(n,r))return n[r]},cr=(e,t,n)=>{let r=sr(e,n);return r===void 0?sr(t,n):r},lr=(e,t,n)=>{for(let r in t)r!==`__proto__`&&r!==`constructor`&&(r in e?K(e[r])||e[r]instanceof String||K(t[r])||t[r]instanceof String?n&&(e[r]=t[r]):lr(e[r],t[r],n):e[r]=t[r]);return e},ur=e=>e.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,`\\$&`),dr={"&":`&`,"<":`<`,">":`>`,'"':`"`,"'":`'`,"/":`/`},fr=e=>K(e)?e.replace(/[&<>"'\/]/g,e=>dr[e]):e,pr=class{constructor(e){this.capacity=e,this.regExpMap=new Map,this.regExpQueue=[]}getRegExp(e){let t=this.regExpMap.get(e);if(t!==void 0)return t;let n=new RegExp(e);return this.regExpQueue.length===this.capacity&&this.regExpMap.delete(this.regExpQueue.shift()),this.regExpMap.set(e,n),this.regExpQueue.push(e),n}},mr=[` `,`,`,`?`,`!`,`;`],hr=new pr(20),gr=(e,t,n)=>{t||=``,n||=``;let r=mr.filter(e=>t.indexOf(e)<0&&n.indexOf(e)<0);if(r.length===0)return!0;let i=hr.getRegExp(`(${r.map(e=>e===`?`?`\\?`:e).join(`|`)})`),a=!i.test(e);if(!a){let t=e.indexOf(n);t>0&&!i.test(e.substring(0,t))&&(a=!0)}return a},_r=(e,t,n=`.`)=>{if(!e)return;if(e[t])return Object.prototype.hasOwnProperty.call(e,t)?e[t]:void 0;let r=t.split(n),i=e;for(let e=0;e<r.length;){if(!i||typeof i!=`object`)return;let t,a=``;for(let o=e;o<r.length;++o)if(o!==e&&(a+=n),a+=r[o],t=i[a],t!==void 0){if([`string`,`number`,`boolean`].indexOf(typeof t)>-1&&o<r.length-1)continue;e+=o-e+1;break}i=t}return i},vr=e=>e?.replace(/_/g,`-`),yr={type:`logger`,log(e){this.output(`log`,e)},warn(e){this.output(`warn`,e)},error(e){this.output(`error`,e)},output(e,t){console?.[e]?.apply?.(console,t)}},q=new class e{constructor(e,t={}){this.init(e,t)}init(e,t={}){this.prefix=t.prefix||`i18next:`,this.logger=e||yr,this.options=t,this.debug=t.debug}log(...e){return this.forward(e,`log`,``,!0)}warn(...e){return this.forward(e,`warn`,``,!0)}error(...e){return this.forward(e,`error`,``)}deprecate(...e){return this.forward(e,`warn`,`WARNING DEPRECATED: `,!0)}forward(e,t,n,r){return r&&!this.debug?null:(K(e[0])&&(e[0]=`${n}${this.prefix} ${e[0]}`),this.logger[t](e))}create(t){return new e(this.logger,{prefix:`${this.prefix}:${t}:`,...this.options})}clone(t){return t||=this.options,t.prefix=t.prefix||this.prefix,new e(this.logger,t)}},br=class{constructor(){this.observers={}}on(e,t){return e.split(` `).forEach(e=>{this.observers[e]||(this.observers[e]=new Map);let n=this.observers[e].get(t)||0;this.observers[e].set(t,n+1)}),this}off(e,t){if(this.observers[e]){if(!t){delete this.observers[e];return}this.observers[e].delete(t)}}emit(e,...t){this.observers[e]&&Array.from(this.observers[e].entries()).forEach(([e,n])=>{for(let r=0;r<n;r++)e(...t)}),this.observers[`*`]&&Array.from(this.observers[`*`].entries()).forEach(([n,r])=>{for(let i=0;i<r;i++)n.apply(n,[e,...t])})}},xr=class extends br{constructor(e,t={ns:[`translation`],defaultNS:`translation`}){super(),this.data=e||{},this.options=t,this.options.keySeparator===void 0&&(this.options.keySeparator=`.`),this.options.ignoreJSONStructure===void 0&&(this.options.ignoreJSONStructure=!0)}addNamespaces(e){this.options.ns.indexOf(e)<0&&this.options.ns.push(e)}removeNamespaces(e){let t=this.options.ns.indexOf(e);t>-1&&this.options.ns.splice(t,1)}getResource(e,t,n,r={}){let i=r.keySeparator===void 0?this.options.keySeparator:r.keySeparator,a=r.ignoreJSONStructure===void 0?this.options.ignoreJSONStructure:r.ignoreJSONStructure,o;e.indexOf(`.`)>-1?o=e.split(`.`):(o=[e,t],n&&(Array.isArray(n)?o.push(...n):K(n)&&i?o.push(...n.split(i)):o.push(n)));let s=sr(this.data,o);return!s&&!t&&!n&&e.indexOf(`.`)>-1&&(e=o[0],t=o[1],n=o.slice(2).join(`.`)),s||!a||!K(n)?s:_r(this.data?.[e]?.[t],n,i)}addResource(e,t,n,r,i={silent:!1}){let a=i.keySeparator===void 0?this.options.keySeparator:i.keySeparator,o=[e,t];n&&(o=o.concat(a?n.split(a):n)),e.indexOf(`.`)>-1&&(o=e.split(`.`),r=t,t=o[1]),this.addNamespaces(t),ar(this.data,o,r),i.silent||this.emit(`added`,e,t,n,r)}addResources(e,t,n,r={silent:!1}){for(let r in n)(K(n[r])||Array.isArray(n[r]))&&this.addResource(e,t,r,n[r],{silent:!0});r.silent||this.emit(`added`,e,t,n)}addResourceBundle(e,t,n,r,i,a={silent:!1,skipCopy:!1}){let o=[e,t];e.indexOf(`.`)>-1&&(o=e.split(`.`),r=n,n=t,t=o[1]),this.addNamespaces(t);let s=sr(this.data,o)||{};a.skipCopy||(n=JSON.parse(JSON.stringify(n))),r?lr(s,n,i):s={...s,...n},ar(this.data,o,s),a.silent||this.emit(`added`,e,t,n)}removeResourceBundle(e,t){this.hasResourceBundle(e,t)&&delete this.data[e][t],this.removeNamespaces(t),this.emit(`removed`,e,t)}hasResourceBundle(e,t){return this.getResource(e,t)!==void 0}getResourceBundle(e,t){return t||=this.options.defaultNS,this.getResource(e,t)}getDataByLanguage(e){return this.data[e]}hasLanguageSomeTranslations(e){let t=this.getDataByLanguage(e);return!!(t&&Object.keys(t)||[]).find(e=>t[e]&&Object.keys(t[e]).length>0)}toJSON(){return this.data}},Sr={processors:{},addPostProcessor(e){this.processors[e.name]=e},handle(e,t,n,r,i){return e.forEach(e=>{t=this.processors[e]?.process(t,n,r,i)??t}),t}},Cr=Symbol(`i18next/PATH_KEY`);function wr(){let e=[],t=Object.create(null),n;return t.get=(r,i)=>(n?.revoke?.(),i===Cr?e:(e.push(i),n=Proxy.revocable(r,t),n.proxy)),Proxy.revocable(Object.create(null),t).proxy}function Tr(e,t){let{[Cr]:n}=e(wr()),r=t?.keySeparator??`.`,i=t?.nsSeparator??`:`;if(n.length>1&&i){let e=t?.ns,a=Array.isArray(e)?e:null;if(a&&a.length>1&&a.slice(1).includes(n[0]))return`${n[0]}${i}${n.slice(1).join(r)}`}return n.join(r)}var Er={},Dr=e=>!K(e)&&typeof e!=`boolean`&&typeof e!=`number`,Or=class e extends br{constructor(e,t={}){super(),er([`resourceStore`,`languageUtils`,`pluralResolver`,`interpolator`,`backendConnector`,`i18nFormat`,`utils`],e,this),this.options=t,this.options.keySeparator===void 0&&(this.options.keySeparator=`.`),this.logger=q.create(`translator`)}changeLanguage(e){e&&(this.language=e)}exists(e,t={interpolation:{}}){let n={...t};if(e==null)return!1;let r=this.resolve(e,n);if(r?.res===void 0)return!1;let i=Dr(r.res);return!(n.returnObjects===!1&&i)}extractFromKey(e,t){let n=t.nsSeparator===void 0?this.options.nsSeparator:t.nsSeparator;n===void 0&&(n=`:`);let r=t.keySeparator===void 0?this.options.keySeparator:t.keySeparator,i=t.ns||this.options.defaultNS||[],a=n&&e.indexOf(n)>-1,o=!this.options.userDefinedKeySeparator&&!t.keySeparator&&!this.options.userDefinedNsSeparator&&!t.nsSeparator&&!gr(e,n,r);if(a&&!o){let t=e.match(this.interpolator.nestingRegexp);if(t&&t.length>0)return{key:e,namespaces:K(i)?[i]:i};let a=e.split(n);(n!==r||n===r&&this.options.ns.indexOf(a[0])>-1)&&(i=a.shift()),e=a.join(r)}return{key:e,namespaces:K(i)?[i]:i}}translate(t,n,r){let i=typeof n==`object`?{...n}:n;if(typeof i!=`object`&&this.options.overloadTranslationOptionHandler&&(i=this.options.overloadTranslationOptionHandler(arguments)),typeof i==`object`&&(i={...i}),i||={},t==null)return``;typeof t==`function`&&(t=Tr(t,{...this.options,...i})),Array.isArray(t)||(t=[String(t)]),t=t.map(e=>typeof e==`function`?Tr(e,{...this.options,...i}):String(e));let a=i.returnDetails===void 0?this.options.returnDetails:i.returnDetails,o=i.keySeparator===void 0?this.options.keySeparator:i.keySeparator,{key:s,namespaces:c}=this.extractFromKey(t[t.length-1],i),l=c[c.length-1],u=i.nsSeparator===void 0?this.options.nsSeparator:i.nsSeparator;u===void 0&&(u=`:`);let d=i.lng||this.language,f=i.appendNamespaceToCIMode||this.options.appendNamespaceToCIMode;if(d?.toLowerCase()===`cimode`)return f?a?{res:`${l}${u}${s}`,usedKey:s,exactUsedKey:s,usedLng:d,usedNS:l,usedParams:this.getUsedParamsDetails(i)}:`${l}${u}${s}`:a?{res:s,usedKey:s,exactUsedKey:s,usedLng:d,usedNS:l,usedParams:this.getUsedParamsDetails(i)}:s;let p=this.resolve(t,i),m=p?.res,h=p?.usedKey||s,g=p?.exactUsedKey||s,_=[`[object Number]`,`[object Function]`,`[object RegExp]`],v=i.joinArrays===void 0?this.options.joinArrays:i.joinArrays,y=!this.i18nFormat||this.i18nFormat.handleAsObject,b=i.count!==void 0&&!K(i.count),x=e.hasDefaultValue(i),S=b?this.pluralResolver.getSuffix(d,i.count,i):``,C=i.ordinal&&b?this.pluralResolver.getSuffix(d,i.count,{ordinal:!1}):``,w=b&&!i.ordinal&&i.count===0,T=w&&i[`defaultValue${this.options.pluralSeparator}zero`]||i[`defaultValue${S}`]||i[`defaultValue${C}`]||i.defaultValue,E=m;y&&!m&&x&&(E=T);let D=Dr(E),O=Object.prototype.toString.apply(E);if(y&&E&&D&&_.indexOf(O)<0&&!(K(v)&&Array.isArray(E))){if(!i.returnObjects&&!this.options.returnObjects){this.options.returnedObjectHandler||this.logger.warn(`accessing an object - but returnObjects options is not enabled!`);let e=this.options.returnedObjectHandler?this.options.returnedObjectHandler(h,E,{...i,ns:c}):`key '${s} (${this.language})' returned an object instead of string.`;return a?(p.res=e,p.usedParams=this.getUsedParamsDetails(i),p):e}if(o){let e=Array.isArray(E),t=e?[]:{},n=e?g:h;for(let e in E)if(Object.prototype.hasOwnProperty.call(E,e)){let r=`${n}${o}${e}`;x&&!m?t[e]=this.translate(r,{...i,defaultValue:Dr(T)?T[e]:void 0,joinArrays:!1,ns:c}):t[e]=this.translate(r,{...i,joinArrays:!1,ns:c}),t[e]===r&&(t[e]=E[e])}m=t}}else if(y&&K(v)&&Array.isArray(m))m=m.join(v),m&&=this.extendTranslation(m,t,i,r);else{let e=!1,n=!1;!this.isValidLookup(m)&&x&&(e=!0,m=T),this.isValidLookup(m)||(n=!0,m=s);let a=(i.missingKeyNoValueFallbackToKey||this.options.missingKeyNoValueFallbackToKey)&&n?void 0:m,c=x&&T!==m&&this.options.updateMissing;if(n||e||c){if(this.logger.log(c?`updateKey`:`missingKey`,d,l,s,c?T:m),o){let e=this.resolve(s,{...i,keySeparator:!1});e&&e.res&&this.logger.warn(`Seems the loaded translations were in flat JSON format instead of nested. Either set keySeparator: false on init or make sure your translations are published in nested format.`)}let e=[],t=this.languageUtils.getFallbackCodes(this.options.fallbackLng,i.lng||this.language);if(this.options.saveMissingTo===`fallback`&&t&&t[0])for(let n=0;n<t.length;n++)e.push(t[n]);else this.options.saveMissingTo===`all`?e=this.languageUtils.toResolveHierarchy(i.lng||this.language):e.push(i.lng||this.language);let n=(e,t,n)=>{let r=x&&n!==m?n:a;this.options.missingKeyHandler?this.options.missingKeyHandler(e,l,t,r,c,i):this.backendConnector?.saveMissing&&this.backendConnector.saveMissing(e,l,t,r,c,i),this.emit(`missingKey`,e,l,t,m)};this.options.saveMissing&&(this.options.saveMissingPlurals&&b?e.forEach(e=>{let t=this.pluralResolver.getSuffixes(e,i);w&&i[`defaultValue${this.options.pluralSeparator}zero`]&&t.indexOf(`${this.options.pluralSeparator}zero`)<0&&t.push(`${this.options.pluralSeparator}zero`),t.forEach(t=>{n([e],s+t,i[`defaultValue${t}`]||T)})}):n(e,s,T))}m=this.extendTranslation(m,t,i,p,r),n&&m===s&&this.options.appendNamespaceToMissingKey&&(m=`${l}${u}${s}`),(n||e)&&this.options.parseMissingKeyHandler&&(m=this.options.parseMissingKeyHandler(this.options.appendNamespaceToMissingKey?`${l}${u}${s}`:s,e?m:void 0,i))}return a?(p.res=m,p.usedParams=this.getUsedParamsDetails(i),p):m}extendTranslation(e,t,n,r,i){if(this.i18nFormat?.parse)e=this.i18nFormat.parse(e,{...this.options.interpolation.defaultVariables,...n},n.lng||this.language||r.usedLng,r.usedNS,r.usedKey,{resolved:r});else if(!n.skipInterpolation){n.interpolation&&this.interpolator.init({...n,interpolation:{...this.options.interpolation,...n.interpolation}});let a=K(e)&&(n?.interpolation?.skipOnVariables===void 0?this.options.interpolation.skipOnVariables:n.interpolation.skipOnVariables),o;if(a){let t=e.match(this.interpolator.nestingRegexp);o=t&&t.length}let s=n.replace&&!K(n.replace)?n.replace:n;if(this.options.interpolation.defaultVariables&&(s={...this.options.interpolation.defaultVariables,...s}),e=this.interpolator.interpolate(e,s,n.lng||this.language||r.usedLng,n),a){let t=e.match(this.interpolator.nestingRegexp),r=t&&t.length;o<r&&(n.nest=!1)}!n.lng&&r&&r.res&&(n.lng=this.language||r.usedLng),n.nest!==!1&&(e=this.interpolator.nest(e,(...e)=>i?.[0]===e[0]&&!n.context?(this.logger.warn(`It seems you are nesting recursively key: ${e[0]} in key: ${t[0]}`),null):this.translate(...e,t),n)),n.interpolation&&this.interpolator.reset()}let a=n.postProcess||this.options.postProcess,o=K(a)?[a]:a;return e!=null&&o?.length&&n.applyPostProcessor!==!1&&(e=Sr.handle(o,e,t,this.options&&this.options.postProcessPassResolved?{i18nResolved:{...r,usedParams:this.getUsedParamsDetails(n)},...n}:n,this)),e}resolve(e,t={}){let n,r,i,a,o;return K(e)&&(e=[e]),Array.isArray(e)&&(e=e.map(e=>typeof e==`function`?Tr(e,{...this.options,...t}):e)),e.forEach(e=>{if(this.isValidLookup(n))return;let s=this.extractFromKey(e,t),c=s.key;r=c;let l=s.namespaces;this.options.fallbackNS&&(l=l.concat(this.options.fallbackNS));let u=t.count!==void 0&&!K(t.count),d=u&&!t.ordinal&&t.count===0,f=t.context!==void 0&&(K(t.context)||typeof t.context==`number`)&&t.context!==``,p=t.lngs?t.lngs:this.languageUtils.toResolveHierarchy(t.lng||this.language,t.fallbackLng);l.forEach(e=>{this.isValidLookup(n)||(o=e,!Er[`${p[0]}-${e}`]&&this.utils?.hasLoadedNamespace&&!this.utils?.hasLoadedNamespace(o)&&(Er[`${p[0]}-${e}`]=!0,this.logger.warn(`key "${r}" for languages "${p.join(`, `)}" won't get resolved as namespace "${o}" was not yet loaded`,`This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!`)),p.forEach(r=>{if(this.isValidLookup(n))return;a=r;let o=[c];if(this.i18nFormat?.addLookupKeys)this.i18nFormat.addLookupKeys(o,c,r,e,t);else{let e;u&&(e=this.pluralResolver.getSuffix(r,t.count,t));let n=`${this.options.pluralSeparator}zero`,i=`${this.options.pluralSeparator}ordinal${this.options.pluralSeparator}`;if(u&&(t.ordinal&&e.indexOf(i)===0&&o.push(c+e.replace(i,this.options.pluralSeparator)),o.push(c+e),d&&o.push(c+n)),f){let r=`${c}${this.options.contextSeparator||`_`}${t.context}`;o.push(r),u&&(t.ordinal&&e.indexOf(i)===0&&o.push(r+e.replace(i,this.options.pluralSeparator)),o.push(r+e),d&&o.push(r+n))}}let s;for(;s=o.pop();)this.isValidLookup(n)||(i=s,n=this.getResource(r,e,s,t))}))})}),{res:n,usedKey:r,exactUsedKey:i,usedLng:a,usedNS:o}}isValidLookup(e){return e!==void 0&&!(!this.options.returnNull&&e===null)&&!(!this.options.returnEmptyString&&e===``)}getResource(e,t,n,r={}){return this.i18nFormat?.getResource?this.i18nFormat.getResource(e,t,n,r):this.resourceStore.getResource(e,t,n,r)}getUsedParamsDetails(e={}){let t=[`defaultValue`,`ordinal`,`context`,`replace`,`lng`,`lngs`,`fallbackLng`,`ns`,`keySeparator`,`nsSeparator`,`returnObjects`,`returnDetails`,`joinArrays`,`postProcess`,`interpolation`],n=e.replace&&!K(e.replace),r=n?e.replace:e;if(n&&e.count!==void 0&&(r.count=e.count),this.options.interpolation.defaultVariables&&(r={...this.options.interpolation.defaultVariables,...r}),!n){r={...r};for(let e of t)delete r[e]}return r}static hasDefaultValue(e){for(let t in e)if(Object.prototype.hasOwnProperty.call(e,t)&&t.substring(0,12)===`defaultValue`&&e[t]!==void 0)return!0;return!1}},kr=class{constructor(e){this.options=e,this.supportedLngs=this.options.supportedLngs||!1,this.logger=q.create(`languageUtils`)}getScriptPartFromCode(e){if(e=vr(e),!e||e.indexOf(`-`)<0)return null;let t=e.split(`-`);return t.length===2||(t.pop(),t[t.length-1].toLowerCase()===`x`)?null:this.formatLanguageCode(t.join(`-`))}getLanguagePartFromCode(e){if(e=vr(e),!e||e.indexOf(`-`)<0)return e;let t=e.split(`-`);return this.formatLanguageCode(t[0])}formatLanguageCode(e){if(K(e)&&e.indexOf(`-`)>-1){let t;try{t=Intl.getCanonicalLocales(e)[0]}catch{}return t&&this.options.lowerCaseLng&&(t=t.toLowerCase()),t||(this.options.lowerCaseLng?e.toLowerCase():e)}return this.options.cleanCode||this.options.lowerCaseLng?e.toLowerCase():e}isSupportedCode(e){return(this.options.load===`languageOnly`||this.options.nonExplicitSupportedLngs)&&(e=this.getLanguagePartFromCode(e)),!this.supportedLngs||!this.supportedLngs.length||this.supportedLngs.indexOf(e)>-1}getBestMatchFromCodes(e){if(!e)return null;let t;return e.forEach(e=>{if(t)return;let n=this.formatLanguageCode(e);(!this.options.supportedLngs||this.isSupportedCode(n))&&(t=n)}),!t&&this.options.supportedLngs&&e.forEach(e=>{if(t)return;let n=this.getScriptPartFromCode(e);if(this.isSupportedCode(n))return t=n;let r=this.getLanguagePartFromCode(e);if(this.isSupportedCode(r))return t=r;t=this.options.supportedLngs.find(e=>{if(e===r||!(e.indexOf(`-`)<0&&r.indexOf(`-`)<0)&&(e.indexOf(`-`)>0&&r.indexOf(`-`)<0&&e.substring(0,e.indexOf(`-`))===r||e.indexOf(r)===0&&r.length>1))return e})}),t||=this.getFallbackCodes(this.options.fallbackLng)[0],t}getFallbackCodes(e,t){if(!e)return[];if(typeof e==`function`&&(e=e(t)),K(e)&&(e=[e]),Array.isArray(e))return e;if(!t)return e.default||[];let n=e[t];return n||=e[this.getScriptPartFromCode(t)],n||=e[this.formatLanguageCode(t)],n||=e[this.getLanguagePartFromCode(t)],n||=e.default,n||[]}toResolveHierarchy(e,t){let n=this.getFallbackCodes((t===!1?[]:t)||this.options.fallbackLng||[],e),r=[],i=e=>{e&&(this.isSupportedCode(e)?r.push(e):this.logger.warn(`rejecting language code not found in supportedLngs: ${e}`))};return K(e)&&(e.indexOf(`-`)>-1||e.indexOf(`_`)>-1)?(this.options.load!==`languageOnly`&&i(this.formatLanguageCode(e)),this.options.load!==`languageOnly`&&this.options.load!==`currentOnly`&&i(this.getScriptPartFromCode(e)),this.options.load!==`currentOnly`&&i(this.getLanguagePartFromCode(e))):K(e)&&i(this.formatLanguageCode(e)),n.forEach(e=>{r.indexOf(e)<0&&i(this.formatLanguageCode(e))}),r}},Ar={zero:0,one:1,two:2,few:3,many:4,other:5},jr={select:e=>e===1?`one`:`other`,resolvedOptions:()=>({pluralCategories:[`one`,`other`]})},Mr=class{constructor(e,t={}){this.languageUtils=e,this.options=t,this.logger=q.create(`pluralResolver`),this.pluralRulesCache={}}clearCache(){this.pluralRulesCache={}}getRule(e,t={}){let n=vr(e===`dev`?`en`:e),r=t.ordinal?`ordinal`:`cardinal`,i=JSON.stringify({cleanedCode:n,type:r});if(i in this.pluralRulesCache)return this.pluralRulesCache[i];let a;try{a=new Intl.PluralRules(n,{type:r})}catch{if(typeof Intl>`u`)return this.logger.error(`No Intl support, please use an Intl polyfill!`),jr;if(!e.match(/-|_/))return jr;let n=this.languageUtils.getLanguagePartFromCode(e);a=this.getRule(n,t)}return this.pluralRulesCache[i]=a,a}needsPlural(e,t={}){let n=this.getRule(e,t);return n||=this.getRule(`dev`,t),n?.resolvedOptions().pluralCategories.length>1}getPluralFormsOfKey(e,t,n={}){return this.getSuffixes(e,n).map(e=>`${t}${e}`)}getSuffixes(e,t={}){let n=this.getRule(e,t);return n||=this.getRule(`dev`,t),n?n.resolvedOptions().pluralCategories.sort((e,t)=>Ar[e]-Ar[t]).map(e=>`${this.options.prepend}${t.ordinal?`ordinal${this.options.prepend}`:``}${e}`):[]}getSuffix(e,t,n={}){let r=this.getRule(e,n);return r?`${this.options.prepend}${n.ordinal?`ordinal${this.options.prepend}`:``}${r.select(t)}`:(this.logger.warn(`no plural rule found for: ${e}`),this.getSuffix(`dev`,t,n))}},Nr=(e,t,n,r=`.`,i=!0)=>{let a=cr(e,t,n);return!a&&i&&K(n)&&(a=_r(e,n,r),a===void 0&&(a=_r(t,n,r))),a},Pr=e=>e.replace(/\$/g,`$$$$`),Fr=class{constructor(e={}){this.logger=q.create(`interpolator`),this.options=e,this.format=e?.interpolation?.format||(e=>e),this.init(e)}init(e={}){e.interpolation||={escapeValue:!0};let{escape:t,escapeValue:n,useRawValueToEscape:r,prefix:i,prefixEscaped:a,suffix:o,suffixEscaped:s,formatSeparator:c,unescapeSuffix:l,unescapePrefix:u,nestingPrefix:d,nestingPrefixEscaped:f,nestingSuffix:p,nestingSuffixEscaped:m,nestingOptionsSeparator:h,maxReplaces:g,alwaysFormat:_}=e.interpolation;this.escape=t===void 0?fr:t,this.escapeValue=n===void 0?!0:n,this.useRawValueToEscape=r===void 0?!1:r,this.prefix=i?ur(i):a||`{{`,this.suffix=o?ur(o):s||`}}`,this.formatSeparator=c||`,`,this.unescapePrefix=l?``:u||`-`,this.unescapeSuffix=this.unescapePrefix?``:l||``,this.nestingPrefix=d?ur(d):f||ur(`$t(`),this.nestingSuffix=p?ur(p):m||ur(`)`),this.nestingOptionsSeparator=h||`,`,this.maxReplaces=g||1e3,this.alwaysFormat=_===void 0?!1:_,this.resetRegExp()}reset(){this.options&&this.init(this.options)}resetRegExp(){let e=(e,t)=>e?.source===t?(e.lastIndex=0,e):new RegExp(t,`g`);this.regexp=e(this.regexp,`${this.prefix}(.+?)${this.suffix}`),this.regexpUnescape=e(this.regexpUnescape,`${this.prefix}${this.unescapePrefix}(.+?)${this.unescapeSuffix}${this.suffix}`),this.nestingRegexp=e(this.nestingRegexp,`${this.nestingPrefix}((?:[^()"']+|"[^"]*"|'[^']*'|\\((?:[^()]|"[^"]*"|'[^']*')*\\))*?)${this.nestingSuffix}`)}interpolate(e,t,n,r){let i,a,o,s=this.options&&this.options.interpolation&&this.options.interpolation.defaultVariables||{},c=e=>{if(e.indexOf(this.formatSeparator)<0){let i=Nr(t,s,e,this.options.keySeparator,this.options.ignoreJSONStructure);return this.alwaysFormat?this.format(i,void 0,n,{...r,...t,interpolationkey:e}):i}let i=e.split(this.formatSeparator),a=i.shift().trim(),o=i.join(this.formatSeparator).trim();return this.format(Nr(t,s,a,this.options.keySeparator,this.options.ignoreJSONStructure),o,n,{...r,...t,interpolationkey:a})};this.resetRegExp();let l=r?.missingInterpolationHandler||this.options.missingInterpolationHandler,u=r?.interpolation?.skipOnVariables===void 0?this.options.interpolation.skipOnVariables:r.interpolation.skipOnVariables;return[{regex:this.regexpUnescape,safeValue:e=>Pr(e)},{regex:this.regexp,safeValue:e=>this.escapeValue?Pr(this.escape(e)):Pr(e)}].forEach(t=>{for(o=0;i=t.regex.exec(e);){let n=i[1].trim();if(a=c(n),a===void 0)if(typeof l==`function`){let t=l(e,i,r);a=K(t)?t:``}else if(r&&Object.prototype.hasOwnProperty.call(r,n))a=``;else if(u){a=i[0];continue}else this.logger.warn(`missed to pass in variable ${n} for interpolating ${e}`),a=``;else !K(a)&&!this.useRawValueToEscape&&(a=$n(a));let s=t.safeValue(a);if(e=e.replace(i[0],s),u?(t.regex.lastIndex+=a.length,t.regex.lastIndex-=i[0].length):t.regex.lastIndex=0,o++,o>=this.maxReplaces)break}}),e}nest(e,t,n={}){let r,i,a,o=(e,t)=>{let n=this.nestingOptionsSeparator;if(e.indexOf(n)<0)return e;let r=e.split(RegExp(`${ur(n)}[ ]*{`)),i=`{${r[1]}`;e=r[0],i=this.interpolate(i,a);let o=i.match(/'/g),s=i.match(/"/g);((o?.length??0)%2==0&&!s||(s?.length??0)%2!=0)&&(i=i.replace(/'/g,`"`));try{a=JSON.parse(i),t&&(a={...t,...a})}catch(t){return this.logger.warn(`failed parsing options string in nesting for key ${e}`,t),`${e}${n}${i}`}return a.defaultValue&&a.defaultValue.indexOf(this.prefix)>-1&&delete a.defaultValue,e};for(;r=this.nestingRegexp.exec(e);){let s=[];a={...n},a=a.replace&&!K(a.replace)?a.replace:a,a.applyPostProcessor=!1,delete a.defaultValue;let c=/{.*}/.test(r[1])?r[1].lastIndexOf(`}`)+1:r[1].indexOf(this.formatSeparator);if(c!==-1&&(s=r[1].slice(c).split(this.formatSeparator).map(e=>e.trim()).filter(Boolean),r[1]=r[1].slice(0,c)),i=t(o.call(this,r[1].trim(),a),a),i&&r[0]===e&&!K(i))return i;K(i)||(i=$n(i)),i||=(this.logger.warn(`missed to resolve ${r[1]} for nesting ${e}`),``),s.length&&(i=s.reduce((e,t)=>this.format(e,t,n.lng,{...n,interpolationkey:r[1].trim()}),i.trim())),e=e.replace(r[0],i),this.regexp.lastIndex=0}return e}},Ir=e=>{let t=e.toLowerCase().trim(),n={};if(e.indexOf(`(`)>-1){let r=e.split(`(`);t=r[0].toLowerCase().trim();let i=r[1].substring(0,r[1].length-1);t===`currency`&&i.indexOf(`:`)<0?n.currency||=i.trim():t===`relativetime`&&i.indexOf(`:`)<0?n.range||=i.trim():i.split(`;`).forEach(e=>{if(e){let[t,...r]=e.split(`:`),i=r.join(`:`).trim().replace(/^'+|'+$/g,``),a=t.trim();n[a]||(n[a]=i),i===`false`&&(n[a]=!1),i===`true`&&(n[a]=!0),isNaN(i)||(n[a]=parseInt(i,10))}})}return{formatName:t,formatOptions:n}},Lr=e=>{let t={};return(n,r,i)=>{let a=i;i&&i.interpolationkey&&i.formatParams&&i.formatParams[i.interpolationkey]&&i[i.interpolationkey]&&(a={...a,[i.interpolationkey]:void 0});let o=r+JSON.stringify(a),s=t[o];return s||(s=e(vr(r),i),t[o]=s),s(n)}},Rr=e=>(t,n,r)=>e(vr(n),r)(t),zr=class{constructor(e={}){this.logger=q.create(`formatter`),this.options=e,this.init(e)}init(e,t={interpolation:{}}){this.formatSeparator=t.interpolation.formatSeparator||`,`;let n=t.cacheInBuiltFormats?Lr:Rr;this.formats={number:n((e,t)=>{let n=new Intl.NumberFormat(e,{...t});return e=>n.format(e)}),currency:n((e,t)=>{let n=new Intl.NumberFormat(e,{...t,style:`currency`});return e=>n.format(e)}),datetime:n((e,t)=>{let n=new Intl.DateTimeFormat(e,{...t});return e=>n.format(e)}),relativetime:n((e,t)=>{let n=new Intl.RelativeTimeFormat(e,{...t});return e=>n.format(e,t.range||`day`)}),list:n((e,t)=>{let n=new Intl.ListFormat(e,{...t});return e=>n.format(e)})}}add(e,t){this.formats[e.toLowerCase().trim()]=t}addCached(e,t){this.formats[e.toLowerCase().trim()]=Lr(t)}format(e,t,n,r={}){let i=t.split(this.formatSeparator);if(i.length>1&&i[0].indexOf(`(`)>1&&i[0].indexOf(`)`)<0&&i.find(e=>e.indexOf(`)`)>-1)){let e=i.findIndex(e=>e.indexOf(`)`)>-1);i[0]=[i[0],...i.splice(1,e)].join(this.formatSeparator)}return i.reduce((e,t)=>{let{formatName:i,formatOptions:a}=Ir(t);if(this.formats[i]){let t=e;try{let o=r?.formatParams?.[r.interpolationkey]||{},s=o.locale||o.lng||r.locale||r.lng||n;t=this.formats[i](e,s,{...a,...r,...o})}catch(e){this.logger.warn(e)}return t}else this.logger.warn(`there was no format function for ${i}`);return e},e)}},Br=(e,t)=>{e.pending[t]!==void 0&&(delete e.pending[t],e.pendingCount--)},Vr=class extends br{constructor(e,t,n,r={}){super(),this.backend=e,this.store=t,this.services=n,this.languageUtils=n.languageUtils,this.options=r,this.logger=q.create(`backendConnector`),this.waitingReads=[],this.maxParallelReads=r.maxParallelReads||10,this.readingCalls=0,this.maxRetries=r.maxRetries>=0?r.maxRetries:5,this.retryTimeout=r.retryTimeout>=1?r.retryTimeout:350,this.state={},this.queue=[],this.backend?.init?.(n,r.backend,r)}queueLoad(e,t,n,r){let i={},a={},o={},s={};return e.forEach(e=>{let r=!0;t.forEach(t=>{let o=`${e}|${t}`;!n.reload&&this.store.hasResourceBundle(e,t)?this.state[o]=2:this.state[o]<0||(this.state[o]===1?a[o]===void 0&&(a[o]=!0):(this.state[o]=1,r=!1,a[o]===void 0&&(a[o]=!0),i[o]===void 0&&(i[o]=!0),s[t]===void 0&&(s[t]=!0)))}),r||(o[e]=!0)}),(Object.keys(i).length||Object.keys(a).length)&&this.queue.push({pending:a,pendingCount:Object.keys(a).length,loaded:{},errors:[],callback:r}),{toLoad:Object.keys(i),pending:Object.keys(a),toLoadLanguages:Object.keys(o),toLoadNamespaces:Object.keys(s)}}loaded(e,t,n){let r=e.split(`|`),i=r[0],a=r[1];t&&this.emit(`failedLoading`,i,a,t),!t&&n&&this.store.addResourceBundle(i,a,n,void 0,void 0,{skipCopy:!0}),this.state[e]=t?-1:2,t&&n&&(this.state[e]=0);let o={};this.queue.forEach(n=>{or(n.loaded,[i],a),Br(n,e),t&&n.errors.push(t),n.pendingCount===0&&!n.done&&(Object.keys(n.loaded).forEach(e=>{o[e]||(o[e]={});let t=n.loaded[e];t.length&&t.forEach(t=>{o[e][t]===void 0&&(o[e][t]=!0)})}),n.done=!0,n.errors.length?n.callback(n.errors):n.callback())}),this.emit(`loaded`,o),this.queue=this.queue.filter(e=>!e.done)}read(e,t,n,r=0,i=this.retryTimeout,a){if(!e.length)return a(null,{});if(this.readingCalls>=this.maxParallelReads){this.waitingReads.push({lng:e,ns:t,fcName:n,tried:r,wait:i,callback:a});return}this.readingCalls++;let o=(o,s)=>{if(this.readingCalls--,this.waitingReads.length>0){let e=this.waitingReads.shift();this.read(e.lng,e.ns,e.fcName,e.tried,e.wait,e.callback)}if(o&&s&&r<this.maxRetries){setTimeout(()=>{this.read.call(this,e,t,n,r+1,i*2,a)},i);return}a(o,s)},s=this.backend[n].bind(this.backend);if(s.length===2){try{let n=s(e,t);n&&typeof n.then==`function`?n.then(e=>o(null,e)).catch(o):o(null,n)}catch(e){o(e)}return}return s(e,t,o)}prepareLoading(e,t,n={},r){if(!this.backend)return this.logger.warn(`No backend was added via i18next.use. Will not load resources.`),r&&r();K(e)&&(e=this.languageUtils.toResolveHierarchy(e)),K(t)&&(t=[t]);let i=this.queueLoad(e,t,n,r);if(!i.toLoad.length)return i.pending.length||r(),null;i.toLoad.forEach(e=>{this.loadOne(e)})}load(e,t,n){this.prepareLoading(e,t,{},n)}reload(e,t,n){this.prepareLoading(e,t,{reload:!0},n)}loadOne(e,t=``){let n=e.split(`|`),r=n[0],i=n[1];this.read(r,i,`read`,void 0,void 0,(n,a)=>{n&&this.logger.warn(`${t}loading namespace ${i} for language ${r} failed`,n),!n&&a&&this.logger.log(`${t}loaded namespace ${i} for language ${r}`,a),this.loaded(e,n,a)})}saveMissing(e,t,n,r,i,a={},o=()=>{}){if(this.services?.utils?.hasLoadedNamespace&&!this.services?.utils?.hasLoadedNamespace(t)){this.logger.warn(`did not save key "${n}" as the namespace "${t}" was not yet loaded`,`This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!`);return}if(!(n==null||n===``)){if(this.backend?.create){let s={...a,isUpdate:i},c=this.backend.create.bind(this.backend);if(c.length<6)try{let i;i=c.length===5?c(e,t,n,r,s):c(e,t,n,r),i&&typeof i.then==`function`?i.then(e=>o(null,e)).catch(o):o(null,i)}catch(e){o(e)}else c(e,t,n,r,o,s)}!e||!e[0]||this.store.addResource(e[0],t,n,r)}}},Hr=()=>({debug:!1,initAsync:!0,ns:[`translation`],defaultNS:[`translation`],fallbackLng:[`dev`],fallbackNS:!1,supportedLngs:!1,nonExplicitSupportedLngs:!1,load:`all`,preload:!1,simplifyPluralSuffix:!0,keySeparator:`.`,nsSeparator:`:`,pluralSeparator:`_`,contextSeparator:`_`,partialBundledLanguages:!1,saveMissing:!1,updateMissing:!1,saveMissingTo:`fallback`,saveMissingPlurals:!0,missingKeyHandler:!1,missingInterpolationHandler:!1,postProcess:!1,postProcessPassResolved:!1,returnNull:!1,returnEmptyString:!0,returnObjects:!1,joinArrays:!1,returnedObjectHandler:!1,parseMissingKeyHandler:!1,appendNamespaceToMissingKey:!1,appendNamespaceToCIMode:!1,overloadTranslationOptionHandler:e=>{let t={};if(typeof e[1]==`object`&&(t=e[1]),K(e[1])&&(t.defaultValue=e[1]),K(e[2])&&(t.tDescription=e[2]),typeof e[2]==`object`||typeof e[3]==`object`){let n=e[3]||e[2];Object.keys(n).forEach(e=>{t[e]=n[e]})}return t},interpolation:{escapeValue:!0,format:e=>e,prefix:`{{`,suffix:`}}`,formatSeparator:`,`,unescapePrefix:`-`,nestingPrefix:`$t(`,nestingSuffix:`)`,nestingOptionsSeparator:`,`,maxReplaces:1e3,skipOnVariables:!0},cacheInBuiltFormats:!0}),Ur=e=>(K(e.ns)&&(e.ns=[e.ns]),K(e.fallbackLng)&&(e.fallbackLng=[e.fallbackLng]),K(e.fallbackNS)&&(e.fallbackNS=[e.fallbackNS]),e.supportedLngs?.indexOf?.(`cimode`)<0&&(e.supportedLngs=e.supportedLngs.concat([`cimode`])),typeof e.initImmediate==`boolean`&&(e.initAsync=e.initImmediate),e),Wr=()=>{},Gr=e=>{Object.getOwnPropertyNames(Object.getPrototypeOf(e)).forEach(t=>{typeof e[t]==`function`&&(e[t]=e[t].bind(e))})},Kr=`__i18next_supportNoticeShown`,qr=()=>!!(typeof globalThis<`u`&&globalThis[Kr]||typeof process<`u`&&process.env&&process.env.I18NEXT_NO_SUPPORT_NOTICE||typeof process<`u`&&process.env&&process.env.NODE_ENV===`production`),Jr=()=>{typeof globalThis<`u`&&(globalThis[Kr]=!0)},Yr=e=>!!(e?.modules?.backend?.name?.indexOf(`Locize`)>0||e?.modules?.backend?.constructor?.name?.indexOf(`Locize`)>0||e?.options?.backend?.backends&&e.options.backend.backends.some(e=>e?.name?.indexOf(`Locize`)>0||e?.constructor?.name?.indexOf(`Locize`)>0)||e?.options?.backend?.projectId||e?.options?.backend?.backendOptions&&e.options.backend.backendOptions.some(e=>e?.projectId)),J=class e extends br{constructor(e={},t){if(super(),this.options=Ur(e),this.services={},this.logger=q,this.modules={external:[]},Gr(this),t&&!this.isInitialized&&!e.isClone){if(!this.options.initAsync)return this.init(e,t),this;setTimeout(()=>{this.init(e,t)},0)}}init(e={},t){this.isInitializing=!0,typeof e==`function`&&(t=e,e={}),e.defaultNS==null&&e.ns&&(K(e.ns)?e.defaultNS=e.ns:e.ns.indexOf(`translation`)<0&&(e.defaultNS=e.ns[0]));let n=Hr();this.options={...n,...this.options,...Ur(e)},this.options.interpolation={...n.interpolation,...this.options.interpolation},e.keySeparator!==void 0&&(this.options.userDefinedKeySeparator=e.keySeparator),e.nsSeparator!==void 0&&(this.options.userDefinedNsSeparator=e.nsSeparator),typeof this.options.overloadTranslationOptionHandler!=`function`&&(this.options.overloadTranslationOptionHandler=n.overloadTranslationOptionHandler),this.options.showSupportNotice!==!1&&!Yr(this)&&!qr()&&(typeof console<`u`&&console.info!==void 0&&console.info(`🌐 i18next is made possible by our own product, Locize — consider powering your project with managed localization (AI, CDN, integrations): https://locize.com 💙`),Jr());let r=e=>e?typeof e==`function`?new e:e:null;if(!this.options.isClone){this.modules.logger?q.init(r(this.modules.logger),this.options):q.init(null,this.options);let e;e=this.modules.formatter?this.modules.formatter:zr;let t=new kr(this.options);this.store=new xr(this.options.resources,this.options);let i=this.services;i.logger=q,i.resourceStore=this.store,i.languageUtils=t,i.pluralResolver=new Mr(t,{prepend:this.options.pluralSeparator,simplifyPluralSuffix:this.options.simplifyPluralSuffix}),this.options.interpolation.format&&this.options.interpolation.format!==n.interpolation.format&&this.logger.deprecate(`init: you are still using the legacy format function, please use the new approach: https://www.i18next.com/translation-function/formatting`),e&&(!this.options.interpolation.format||this.options.interpolation.format===n.interpolation.format)&&(i.formatter=r(e),i.formatter.init&&i.formatter.init(i,this.options),this.options.interpolation.format=i.formatter.format.bind(i.formatter)),i.interpolator=new Fr(this.options),i.utils={hasLoadedNamespace:this.hasLoadedNamespace.bind(this)},i.backendConnector=new Vr(r(this.modules.backend),i.resourceStore,i,this.options),i.backendConnector.on(`*`,(e,...t)=>{this.emit(e,...t)}),this.modules.languageDetector&&(i.languageDetector=r(this.modules.languageDetector),i.languageDetector.init&&i.languageDetector.init(i,this.options.detection,this.options)),this.modules.i18nFormat&&(i.i18nFormat=r(this.modules.i18nFormat),i.i18nFormat.init&&i.i18nFormat.init(this)),this.translator=new Or(this.services,this.options),this.translator.on(`*`,(e,...t)=>{this.emit(e,...t)}),this.modules.external.forEach(e=>{e.init&&e.init(this)})}if(this.format=this.options.interpolation.format,t||=Wr,this.options.fallbackLng&&!this.services.languageDetector&&!this.options.lng){let e=this.services.languageUtils.getFallbackCodes(this.options.fallbackLng);e.length>0&&e[0]!==`dev`&&(this.options.lng=e[0])}!this.services.languageDetector&&!this.options.lng&&this.logger.warn(`init: no languageDetector is used and no lng is defined`),[`getResource`,`hasResourceBundle`,`getResourceBundle`,`getDataByLanguage`].forEach(e=>{this[e]=(...t)=>this.store[e](...t)}),[`addResource`,`addResources`,`addResourceBundle`,`removeResourceBundle`].forEach(e=>{this[e]=(...t)=>(this.store[e](...t),this)});let i=Qn(),a=()=>{let e=(e,n)=>{this.isInitializing=!1,this.isInitialized&&!this.initializedStoreOnce&&this.logger.warn(`init: i18next is already initialized. You should call init just once!`),this.isInitialized=!0,this.options.isClone||this.logger.log(`initialized`,this.options),this.emit(`initialized`,this.options),i.resolve(n),t(e,n)};if(this.languages&&!this.isInitialized)return e(null,this.t.bind(this));this.changeLanguage(this.options.lng,e)};return this.options.resources||!this.options.initAsync?a():setTimeout(a,0),i}loadResources(e,t=Wr){let n=t,r=K(e)?e:this.language;if(typeof e==`function`&&(n=e),!this.options.resources||this.options.partialBundledLanguages){if(r?.toLowerCase()===`cimode`&&(!this.options.preload||this.options.preload.length===0))return n();let e=[],t=t=>{t&&t!==`cimode`&&this.services.languageUtils.toResolveHierarchy(t).forEach(t=>{t!==`cimode`&&e.indexOf(t)<0&&e.push(t)})};r?t(r):this.services.languageUtils.getFallbackCodes(this.options.fallbackLng).forEach(e=>t(e)),this.options.preload?.forEach?.(e=>t(e)),this.services.backendConnector.load(e,this.options.ns,e=>{!e&&!this.resolvedLanguage&&this.language&&this.setResolvedLanguage(this.language),n(e)})}else n(null)}reloadResources(e,t,n){let r=Qn();return typeof e==`function`&&(n=e,e=void 0),typeof t==`function`&&(n=t,t=void 0),e||=this.languages,t||=this.options.ns,n||=Wr,this.services.backendConnector.reload(e,t,e=>{r.resolve(),n(e)}),r}use(e){if(!e)throw Error(`You are passing an undefined module! Please check the object you are passing to i18next.use()`);if(!e.type)throw Error(`You are passing a wrong module! Please check the object you are passing to i18next.use()`);return e.type===`backend`&&(this.modules.backend=e),(e.type===`logger`||e.log&&e.warn&&e.error)&&(this.modules.logger=e),e.type===`languageDetector`&&(this.modules.languageDetector=e),e.type===`i18nFormat`&&(this.modules.i18nFormat=e),e.type===`postProcessor`&&Sr.addPostProcessor(e),e.type===`formatter`&&(this.modules.formatter=e),e.type===`3rdParty`&&this.modules.external.push(e),this}setResolvedLanguage(e){if(!(!e||!this.languages)&&!([`cimode`,`dev`].indexOf(e)>-1)){for(let e=0;e<this.languages.length;e++){let t=this.languages[e];if(!([`cimode`,`dev`].indexOf(t)>-1)&&this.store.hasLanguageSomeTranslations(t)){this.resolvedLanguage=t;break}}!this.resolvedLanguage&&this.languages.indexOf(e)<0&&this.store.hasLanguageSomeTranslations(e)&&(this.resolvedLanguage=e,this.languages.unshift(e))}}changeLanguage(e,t){this.isLanguageChangingTo=e;let n=Qn();this.emit(`languageChanging`,e);let r=e=>{this.language=e,this.languages=this.services.languageUtils.toResolveHierarchy(e),this.resolvedLanguage=void 0,this.setResolvedLanguage(e)},i=(i,a)=>{a?this.isLanguageChangingTo===e&&(r(a),this.translator.changeLanguage(a),this.isLanguageChangingTo=void 0,this.emit(`languageChanged`,a),this.logger.log(`languageChanged`,a)):this.isLanguageChangingTo=void 0,n.resolve((...e)=>this.t(...e)),t&&t(i,(...e)=>this.t(...e))},a=t=>{!e&&!t&&this.services.languageDetector&&(t=[]);let n=K(t)?t:t&&t[0],a=this.store.hasLanguageSomeTranslations(n)?n:this.services.languageUtils.getBestMatchFromCodes(K(t)?[t]:t);a&&(this.language||r(a),this.translator.language||this.translator.changeLanguage(a),this.services.languageDetector?.cacheUserLanguage?.(a)),this.loadResources(a,e=>{i(e,a)})};return!e&&this.services.languageDetector&&!this.services.languageDetector.async?a(this.services.languageDetector.detect()):!e&&this.services.languageDetector&&this.services.languageDetector.async?this.services.languageDetector.detect.length===0?this.services.languageDetector.detect().then(a):this.services.languageDetector.detect(a):a(e),n}getFixedT(e,t,n){let r=(e,t,...i)=>{let a;a=typeof t==`object`?{...t}:this.options.overloadTranslationOptionHandler([e,t].concat(i)),a.lng=a.lng||r.lng,a.lngs=a.lngs||r.lngs,a.ns=a.ns||r.ns,a.keyPrefix!==``&&(a.keyPrefix=a.keyPrefix||n||r.keyPrefix);let o={...this.options,...a};typeof a.keyPrefix==`function`&&(a.keyPrefix=Tr(a.keyPrefix,o));let s=this.options.keySeparator||`.`,c;return a.keyPrefix&&Array.isArray(e)?c=e.map(e=>(typeof e==`function`&&(e=Tr(e,o)),`${a.keyPrefix}${s}${e}`)):(typeof e==`function`&&(e=Tr(e,o)),c=a.keyPrefix?`${a.keyPrefix}${s}${e}`:e),this.t(c,a)};return K(e)?r.lng=e:r.lngs=e,r.ns=t,r.keyPrefix=n,r}t(...e){return this.translator?.translate(...e)}exists(...e){return this.translator?.exists(...e)}setDefaultNamespace(e){this.options.defaultNS=e}hasLoadedNamespace(e,t={}){if(!this.isInitialized)return this.logger.warn(`hasLoadedNamespace: i18next was not initialized`,this.languages),!1;if(!this.languages||!this.languages.length)return this.logger.warn(`hasLoadedNamespace: i18n.languages were undefined or empty`,this.languages),!1;let n=t.lng||this.resolvedLanguage||this.languages[0],r=this.options?this.options.fallbackLng:!1,i=this.languages[this.languages.length-1];if(n.toLowerCase()===`cimode`)return!0;let a=(e,t)=>{let n=this.services.backendConnector.state[`${e}|${t}`];return n===-1||n===0||n===2};if(t.precheck){let e=t.precheck(this,a);if(e!==void 0)return e}return!!(this.hasResourceBundle(n,e)||!this.services.backendConnector.backend||this.options.resources&&!this.options.partialBundledLanguages||a(n,e)&&(!r||a(i,e)))}loadNamespaces(e,t){let n=Qn();return this.options.ns?(K(e)&&(e=[e]),e.forEach(e=>{this.options.ns.indexOf(e)<0&&this.options.ns.push(e)}),this.loadResources(e=>{n.resolve(),t&&t(e)}),n):(t&&t(),Promise.resolve())}loadLanguages(e,t){let n=Qn();K(e)&&(e=[e]);let r=this.options.preload||[],i=e.filter(e=>r.indexOf(e)<0&&this.services.languageUtils.isSupportedCode(e));return i.length?(this.options.preload=r.concat(i),this.loadResources(e=>{n.resolve(),t&&t(e)}),n):(t&&t(),Promise.resolve())}dir(e){if(e||=this.resolvedLanguage||(this.languages?.length>0?this.languages[0]:this.language),!e)return`rtl`;try{let t=new Intl.Locale(e);if(t&&t.getTextInfo){let e=t.getTextInfo();if(e&&e.direction)return e.direction}}catch{}let t=`ar.shu.sqr.ssh.xaa.yhd.yud.aao.abh.abv.acm.acq.acw.acx.acy.adf.ads.aeb.aec.afb.ajp.apc.apd.arb.arq.ars.ary.arz.auz.avl.ayh.ayl.ayn.ayp.bbz.pga.he.iw.ps.pbt.pbu.pst.prp.prd.ug.ur.ydd.yds.yih.ji.yi.hbo.men.xmn.fa.jpr.peo.pes.prs.dv.sam.ckb`.split(`.`),n=this.services?.languageUtils||new kr(Hr());return e.toLowerCase().indexOf(`-latn`)>1?`ltr`:t.indexOf(n.getLanguagePartFromCode(e))>-1||e.toLowerCase().indexOf(`-arab`)>1?`rtl`:`ltr`}static createInstance(t={},n){let r=new e(t,n);return r.createInstance=e.createInstance,r}cloneInstance(t={},n=Wr){let r=t.forkResourceStore;r&&delete t.forkResourceStore;let i={...this.options,...t,isClone:!0},a=new e(i);if((t.debug!==void 0||t.prefix!==void 0)&&(a.logger=a.logger.clone(t)),[`store`,`services`,`language`].forEach(e=>{a[e]=this[e]}),a.services={...this.services},a.services.utils={hasLoadedNamespace:a.hasLoadedNamespace.bind(a)},r&&(a.store=new xr(Object.keys(this.store.data).reduce((e,t)=>(e[t]={...this.store.data[t]},e[t]=Object.keys(e[t]).reduce((n,r)=>(n[r]={...e[t][r]},n),e[t]),e),{}),i),a.services.resourceStore=a.store),t.interpolation){let e={...Hr().interpolation,...this.options.interpolation,...t.interpolation},n={...i,interpolation:e};a.services.interpolator=new Fr(n)}return a.translator=new Or(a.services,i),a.translator.on(`*`,(e,...t)=>{a.emit(e,...t)}),a.init(i,n),a.translator.options=i,a.translator.backendConnector.services.utils={hasLoadedNamespace:a.hasLoadedNamespace.bind(a)},a}toJSON(){return{options:this.options,store:this.store,language:this.language,languages:this.languages,resolvedLanguage:this.resolvedLanguage}}}.createInstance();J.createInstance,J.dir,J.init,J.loadResources,J.reloadResources,J.use,J.changeLanguage,J.getFixedT,J.t,J.exists,J.setDefaultNamespace,J.hasLoadedNamespace,J.loadNamespaces,J.loadLanguages;var Xr=e=>e.toLocaleTimeString([],{hour:`2-digit`,minute:`2-digit`}),Zr=()=>{let[e,t]=(0,B.useState)(()=>Xr(new Date));return(0,B.useEffect)(()=>{let e=setInterval(()=>t(Xr(new Date)),1e3);return()=>clearInterval(e)},[]),e},Qr=-8,$r=0,ei=()=>{let[e,t]=(0,B.useState)({activeMenu:null,position:{x:0,y:0},targetWindowId:null}),n=(0,B.useCallback)((e,n)=>{e.preventDefault(),e.stopPropagation(),t({activeMenu:`window`,position:{x:e.clientX,y:e.clientY+Qr},targetWindowId:n})},[]),r=(0,B.useCallback)(e=>{e.preventDefault(),t({activeMenu:`panel`,position:{x:e.clientX,y:e.clientY+Qr},targetWindowId:null})},[]),i=(0,B.useCallback)(e=>{e.preventDefault(),e.stopPropagation(),t({activeMenu:`launcher`,position:{x:e.clientX,y:e.clientY+$r},targetWindowId:null})},[]),a=(0,B.useCallback)(()=>{t(e=>({...e,activeMenu:null}))},[]);return{activeMenu:e.activeMenu,position:e.position,targetWindowId:e.targetWindowId,windowMenuOpened:e.activeMenu===`window`,panelMenuOpened:e.activeMenu===`panel`,launcherMenuOpened:e.activeMenu===`launcher`,openWindowMenu:n,openPanelMenu:r,openLauncherMenu:i,closeMenu:a}},ti=()=>{let e=c.h(e=>e.animationDuration);return{duration:e,windowVariants:E.f(e),panelVariants:E.u(e),minimizeVariant:E.l(.3),restoreVariant:E.d(.3),maximizeTransition:E.c(.25),easeIn:E.o(e),easeOut:E.s(e)}},Y={WELCOME:`welcome`,NOTEPAD:`notepad`,UPLOADER:`uploader`,FILES:`files`,SETTINGS:`settings`,PDF:`pdf`,CALENDAR:`calendar`,STORYBOOK:`storybook`,LINKEDIN:`linkedin`,GITHUB:`github`,IMAGE_VIEWER:`image-viewer`,DOS_EMULATOR:`dos-emulator`,DOOM:`doom`,TERMINAL:`terminal`,CODE_SERVER:`code-server`,DEVICE_INFO:`device-info`,MENUEDIT:`menuedit`},ni={[Y.FILES]:`filesApp`,[Y.PDF]:`pdfViewer`,[Y.IMAGE_VIEWER]:`imageViewer`,[Y.DOS_EMULATOR]:`dosEmulator`,[Y.CODE_SERVER]:`codeServer`,[Y.DEVICE_INFO]:`deviceInfo`},ri=[Y.WELCOME,Y.UPLOADER,Y.TERMINAL,Y.CODE_SERVER,Y.STORYBOOK,Y.SETTINGS,Y.NOTEPAD,Y.LINKEDIN,Y.GITHUB,Y.FILES,Y.DOOM];function ii(e){let{t}=D.t(`apps`);return e?t(`names.${ni[e]??e}`,e):``}function ai(e,t,n){return(0,B.useMemo)(()=>{if(!t.trim())return e;let r=t.toLowerCase().trim();return e.filter(e=>{let t=n(e);return Array.isArray(t)?t.some(e=>e.toLowerCase().includes(r)):t.toLowerCase().includes(r)})},[e,t,n])}function oi(e){let[t,n]=(0,B.useState)(e??new Set);return{expanded:t,toggle:(0,B.useCallback)(e=>{n(t=>{let n=new Set(t);return n.has(e)?n.delete(e):n.add(e),n})},[]),expand:(0,B.useCallback)(e=>{n(t=>{let n=new Set(t);return n.add(e),n})},[]),collapse:(0,B.useCallback)(e=>{n(t=>{let n=new Set(t);return n.delete(e),n})},[]),expandAll:(0,B.useCallback)(e=>{n(new Set(e))},[]),collapseAll:(0,B.useCallback)(()=>{n(new Set)},[]),reset:(0,B.useCallback)(()=>{n(new Set)},[]),isExpanded:(0,B.useCallback)(e=>t.has(e),[t])}}var si={header:`_header_2d0oy_1`,iconContainer:`_iconContainer_2d0oy_20`,expandIcon:`_expandIcon_2d0oy_28`,icon:`_icon_2d0oy_20`,title:`_title_2d0oy_42`,content:`_content_2d0oy_48`},ci=({title:e,fcIcon:t=`FcFolder`,expanded:n,onToggle:r,children:i,className:a,"aria-label":o})=>{let s=O.c(n?`VscRemove`:`VscAdd`,{size:14,className:si.expandIcon});return(0,V.jsxs)(`div`,{className:a,children:[(0,V.jsxs)(f.t,{className:si.header,onClick:r,"aria-expanded":n,"aria-label":o??e,children:[(0,V.jsx)(`span`,{className:si.iconContainer,children:s}),(0,V.jsx)(`span`,{className:si.icon,children:(0,V.jsx)(y.t,{fcIcon:t,size:16})}),(0,V.jsx)(g.o,{size:`sm`,fw:500,className:si.title,children:e})]}),n&&(0,V.jsx)(`div`,{className:si.content,children:i})]})},li={trigger:`_trigger_4gumo_1`,panel:`_panel_4gumo_23`,searchContainer:`_searchContainer_4gumo_39`,searchInput:`_searchInput_4gumo_43`,scrollContainer:`_scrollContainer_4gumo_47`,appsSection:`_appsSection_4gumo_56`,appButton:`_appButton_4gumo_62`,appIcon:`_appIcon_4gumo_82`};function ui(e){let t=e.icon,n=`fcIcon`in e?e.fcIcon:void 0,r=t?.startsWith(`Fc`)||t?.startsWith(`Fi`)||t?.startsWith(`Vsc`);return{id:e.id,name:e.name,fcIcon:n??(r?t:void 0),icon:r?void 0:t,iconUrl:`iconUrl`in e?e.iconUrl:void 0,iconColor:`iconColor`in e?e.iconColor:void 0}}var di=({app:e,onOpen:t})=>{let n=ii(e.id);return(0,V.jsxs)(`button`,{className:li.appButton,onClick:()=>t(e.id),role:`menuitem`,"aria-label":n,children:[(0,V.jsx)(`span`,{className:li.appIcon,children:(0,V.jsx)(y.t,{fcIcon:e.fcIcon,iconUrl:e.iconUrl,fallback:e.icon,color:e.iconColor})}),(0,V.jsx)(g.o,{size:`sm`,children:n})]},e.id)},fi=({folder:e,isExpanded:t,apps:n,onToggle:r,onOpen:i})=>(0,V.jsx)(ci,{title:A.o(e),fcIcon:e.fcIcon,expanded:t,onToggle:r,children:n.map(e=>(0,V.jsx)(di,{app:e,onOpen:i},e.id))},e.id),pi=({fcIcon:e=`FcDebian`,onContextMenu:t})=>{let n=O.i(e,{size:22,style:{display:`block`}}),[r,i]=(0,B.useState)(!1),[a,o]=(0,B.useState)(``),l=E.t(),u=c.h(e=>e.theme.colors.taskbar),d=w.o(e=>e.launcherFolders),f=w.o(e=>e.customApps),{panelVariants:p}=ti(),m=(0,B.useRef)(null),h=(0,B.useRef)(null),{expanded:_,toggle:v,reset:y}=oi(new Set),b=(0,B.useMemo)(()=>[...w.C].sort((e,t)=>e.name.localeCompare(t.name)),[]),x=(0,B.useMemo)(()=>new Set(d.flatMap(e=>e.appIds)),[d]),S=ai((0,B.useMemo)(()=>b.filter(e=>!x.has(e.id)),[b,x]),a,e=>[e.id,e.name]),C=(0,B.useMemo)(()=>{if(!a.trim())return[...d].sort((e,t)=>e.isPredefined===t.isPredefined?e.name.localeCompare(t.name):e.isPredefined?-1:1);let e=a.toLowerCase();return d.map(t=>({...t,appIds:t.appIds.filter(t=>{let n=b.find(e=>e.id===t);return n?n.id.toLowerCase().includes(e)||n.name.toLowerCase().includes(e):!1})})).filter(e=>e.appIds.length>0).sort((e,t)=>e.isPredefined===t.isPredefined?e.name.localeCompare(t.name):e.isPredefined?-1:1)},[d,a,b]),D=(0,B.useMemo)(()=>{if(!a.trim())return f;let e=a.toLowerCase();return f.filter(t=>t.id.toLowerCase().includes(e)||t.name.toLowerCase().includes(e))},[f,a]);(0,B.useEffect)(()=>{a.trim()&&r&&(C.map(e=>e.id).forEach(e=>{_.has(e)||v(e)}),D.length>0&&!_.has(`launcher-folder-custom-apps`)&&v(w.J))},[a,C,D,r,_,v]),(0,B.useEffect)(()=>{r||y()},[r,y]),(0,B.useEffect)(()=>{if(!r)return;let e=e=>{m.current&&!m.current.contains(e.target)&&(i(!1),o(``))},t=e=>{e.key===`Escape`&&(i(!1),o(``))};return document.addEventListener(`mousedown`,e),document.addEventListener(`keydown`,t),()=>{document.removeEventListener(`mousedown`,e),document.removeEventListener(`keydown`,t)}},[r]);let k=e=>{if(e.preventDefault(),e.stopPropagation(),r){i(!1),o(``);return}t?.(e)};(0,B.useEffect)(()=>{r&&h.current&&h.current.focus()},[r]);let A=(0,B.useCallback)(e=>{l(e),i(!1),o(``)},[l]),j=(0,B.useCallback)(e=>{v(e)},[v]),M=O.i(`FcSearch`,{size:16}),N=(0,B.useCallback)(()=>{r?(i(!1),o(``)):i(!0)},[r]);return(0,V.jsxs)(`div`,{ref:m,children:[(0,V.jsx)(`button`,{className:li.trigger,onClick:N,onContextMenu:k,"aria-label":`Launcher`,"aria-expanded":r,children:n}),(0,V.jsx)(Bn,{children:r&&(0,V.jsxs)(T.r.div,{className:li.panel,style:{background:u},role:`menu`,"aria-label":`App launcher`,initial:p.initial,animate:p.animate,exit:p.exit,children:[(0,V.jsx)(`div`,{className:li.searchContainer,children:(0,V.jsx)(s.t,{ref:h,placeholder:`Search apps...`,value:a,onChange:e=>o(e.target.value),leftSection:M,size:`xs`,classNames:{input:li.searchInput},"aria-label":`Search apps`})}),(0,V.jsxs)(`div`,{className:li.scrollContainer,children:[C.map(e=>{let t=_.has(e.id);return e.id===`launcher-folder-custom-apps`?D.length===0?null:(0,V.jsx)(fi,{folder:e,isExpanded:t,apps:D.map(ui),onToggle:()=>j(e.id),onOpen:A},e.id):(0,V.jsx)(fi,{folder:e,isExpanded:t,apps:e.appIds.map(e=>b.find(t=>t.id===e)).filter(e=>e!==void 0).sort((e,t)=>e.name.localeCompare(t.name)).map(ui),onToggle:()=>j(e.id),onOpen:A},e.id)}),S.length>0&&(0,V.jsx)(`div`,{className:li.appsSection,children:S.map(e=>(0,V.jsx)(di,{app:ui(e),onOpen:A},e.id))}),a&&S.length===0&&C.length===0&&D.length===0&&(0,V.jsx)(g.o,{size:`sm`,c:`dimmed`,ta:`center`,mt:`md`,children:`No apps found`})]})]})})]})},mi=({x:e,y:t})=>(0,V.jsx)(a.r.Target,{children:(0,V.jsx)(`div`,{"aria-hidden":`true`,style:{position:`fixed`,left:e,top:t,width:0,height:0,pointerEvents:`none`}})}),hi=e=>{let t=(0,B.useRef)(null),[n,r]=(0,B.useState)(0);return(0,B.useLayoutEffect)(()=>{if(t.current&&e){let e=t.current.offsetHeight;r(e)}},[e]),{menuRef:t,menuHeight:n}},gi={menuItem:`_menuItem_18vno_1`},_i=8,vi=({windowMenuOpened:e,panelMenuOpened:t,launcherMenuOpened:n,menuPosition:r,targetWindowId:i,targetWindowState:o,onCloseWindow:s,onMinimizeWindow:c,onMaximizeWindow:l,onRestoreWindow:u,onClose:d})=>{let{t:f}=D.t(`contextMenu`),p={size:14,style:{display:`block`}},m=()=>O.i(`FcCancel`,p),h=()=>O.i(`FcMinus`,p),g=()=>O.i(`FcTemplate`,p),_=()=>O.i(`FcUndo`,p),v=()=>O.i(`FcSettings`,p),y=()=>O.i(`FcFolder`,p),b=E.t(),x=ii(`menuedit`),S=w.o(e=>e.openWindow),C=o===`minimized`,T=o===`maximized`,{menuRef:k,menuHeight:A}=hi(e),{menuRef:j,menuHeight:M}=hi(t),{menuRef:N,menuHeight:P}=hi(n),[F,I]=(0,B.useState)(!1),[L,ee]=(0,B.useState)(!1),[R,te]=(0,B.useState)(!1);(0,B.useLayoutEffect)(()=>{e||I(!1),e&&A>0&&I(!0)},[e,A]),(0,B.useLayoutEffect)(()=>{t||ee(!1),t&&M>0&&ee(!0)},[t,M]),(0,B.useLayoutEffect)(()=>{n||te(!1),n&&P>0&&te(!0)},[n,P]);let ne=(0,B.useMemo)(()=>e?{height:A,ready:F}:t?{height:M,ready:L}:n?{height:P,ready:R}:{height:0,ready:!1},[e,t,n,A,M,P,F,L,R]),z=(0,B.useMemo)(()=>{let{x:e,y:t}=r,{height:n,ready:i}=ne,a=t-_i;return i&&n>0&&t>window.innerHeight-48-n-_i&&(a=t-n+_i),{x:e,y:a}},[r,ne]),re=()=>{d(),S({title:x,content:`menuedit`,fcIcon:`FcFolder`,x:Math.min(r.x+10,window.innerWidth-800),y:Math.min(r.y+10,window.innerHeight-600),width:700,height:500,minWidth:500,minHeight:400})},ie=()=>{d(),b(`settings`)},ae=e=>({opacity:e?1:0,transition:`opacity 0.05s ease`,zIndex:99999});return(0,V.jsxs)(V.Fragment,{children:[(0,V.jsxs)(a.r,{opened:e,onClose:d,closeOnClickOutside:!0,closeOnEscape:!0,closeOnItemClick:!0,withinPortal:!0,children:[(0,V.jsx)(mi,{x:z.x,y:z.y}),(0,V.jsxs)(a.r.Dropdown,{ref:k,style:ae(F),children:[!C&&(0,V.jsx)(a.r.Item,{onClick:()=>{i&&c(i)},children:(0,V.jsxs)(`div`,{className:gi.menuItem,children:[(0,V.jsx)(h,{}),` `,f(`window.minimize`)]})}),C||T?(0,V.jsx)(a.r.Item,{onClick:()=>{i&&u(i)},children:(0,V.jsxs)(`div`,{className:gi.menuItem,children:[(0,V.jsx)(_,{}),` `,f(`window.restore`)]})}):(0,V.jsx)(a.r.Item,{onClick:()=>{i&&l(i)},children:(0,V.jsxs)(`div`,{className:gi.menuItem,children:[(0,V.jsx)(g,{}),` `,f(`window.maximize`)]})}),(0,V.jsx)(a.r.Divider,{}),(0,V.jsx)(a.r.Item,{onClick:()=>{i&&s(i)},children:(0,V.jsxs)(`div`,{className:gi.menuItem,children:[(0,V.jsx)(m,{}),` `,f(`window.close`)]})})]})]}),(0,V.jsxs)(a.r,{opened:t,onClose:d,closeOnClickOutside:!0,closeOnEscape:!0,closeOnItemClick:!0,withinPortal:!0,children:[(0,V.jsx)(mi,{x:z.x,y:z.y}),(0,V.jsx)(a.r.Dropdown,{ref:j,style:ae(L),children:(0,V.jsx)(a.r.Item,{onClick:()=>{b(`settings`)},children:(0,V.jsxs)(`div`,{className:gi.menuItem,children:[(0,V.jsx)(v,{}),` `,f(`apps:names.settings`)]})})})]}),(0,V.jsxs)(a.r,{opened:n,onClose:d,closeOnClickOutside:!0,closeOnEscape:!0,closeOnItemClick:!0,withinPortal:!0,children:[(0,V.jsx)(mi,{x:z.x,y:z.y}),(0,V.jsxs)(a.r.Dropdown,{ref:N,style:ae(R),children:[(0,V.jsx)(a.r.Label,{children:f(`launcher.title`)}),(0,V.jsx)(a.r.Item,{leftSection:(0,V.jsx)(y,{}),onClick:re,children:f(`launcher.editLauncher`)}),(0,V.jsx)(a.r.Item,{leftSection:(0,V.jsx)(v,{}),onClick:ie,children:f(`apps:names.settings`)})]})]})]})},{slice:yi,forEach:bi}=[];function xi(e){return bi.call(yi.call(arguments,1),t=>{if(t)for(let n in t)e[n]===void 0&&(e[n]=t[n])}),e}function Si(e){return typeof e==`string`?[/<\s*script.*?>/i,/<\s*\/\s*script\s*>/i,/<\s*img.*?on\w+\s*=/i,/<\s*\w+\s*on\w+\s*=.*?>/i,/javascript\s*:/i,/vbscript\s*:/i,/expression\s*\(/i,/eval\s*\(/i,/alert\s*\(/i,/document\.cookie/i,/document\.write\s*\(/i,/window\.location/i,/innerHTML/i].some(t=>t.test(e)):!1}var Ci=/^[\u0009\u0020-\u007e\u0080-\u00ff]+$/,wi=function(e,t){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{path:`/`},r=`${e}=${encodeURIComponent(t)}`;if(n.maxAge>0){let e=n.maxAge-0;if(Number.isNaN(e))throw Error(`maxAge should be a Number`);r+=`; Max-Age=${Math.floor(e)}`}if(n.domain){if(!Ci.test(n.domain))throw TypeError(`option domain is invalid`);r+=`; Domain=${n.domain}`}if(n.path){if(!Ci.test(n.path))throw TypeError(`option path is invalid`);r+=`; Path=${n.path}`}if(n.expires){if(typeof n.expires.toUTCString!=`function`)throw TypeError(`option expires is invalid`);r+=`; Expires=${n.expires.toUTCString()}`}if(n.httpOnly&&(r+=`; HttpOnly`),n.secure&&(r+=`; Secure`),n.sameSite)switch(typeof n.sameSite==`string`?n.sameSite.toLowerCase():n.sameSite){case!0:r+=`; SameSite=Strict`;break;case`lax`:r+=`; SameSite=Lax`;break;case`strict`:r+=`; SameSite=Strict`;break;case`none`:r+=`; SameSite=None`;break;default:throw TypeError(`option sameSite is invalid`)}return n.partitioned&&(r+=`; Partitioned`),r},Ti={create(e,t,n,r){let i=arguments.length>4&&arguments[4]!==void 0?arguments[4]:{path:`/`,sameSite:`strict`};n&&(i.expires=new Date,i.expires.setTime(i.expires.getTime()+n*60*1e3)),r&&(i.domain=r),document.cookie=wi(e,t,i)},read(e){let t=`${e}=`,n=document.cookie.split(`;`);for(let e=0;e<n.length;e++){let r=n[e];for(;r.charAt(0)===` `;)r=r.substring(1,r.length);if(r.indexOf(t)===0)return r.substring(t.length,r.length)}return null},remove(e,t){this.create(e,``,-1,t)}},Ei={name:`cookie`,lookup(e){let{lookupCookie:t}=e;if(t&&typeof document<`u`)return Ti.read(t)||void 0},cacheUserLanguage(e,t){let{lookupCookie:n,cookieMinutes:r,cookieDomain:i,cookieOptions:a}=t;n&&typeof document<`u`&&Ti.create(n,e,r,i,a)}},Di={name:`querystring`,lookup(e){let{lookupQuerystring:t}=e,n;if(typeof window<`u`){let{search:e}=window.location;!window.location.search&&window.location.hash?.indexOf(`?`)>-1&&(e=window.location.hash.substring(window.location.hash.indexOf(`?`)));let r=e.substring(1).split(`&`);for(let e=0;e<r.length;e++){let i=r[e].indexOf(`=`);i>0&&r[e].substring(0,i)===t&&(n=r[e].substring(i+1))}}return n}},Oi={name:`hash`,lookup(e){let{lookupHash:t,lookupFromHashIndex:n}=e,r;if(typeof window<`u`){let{hash:e}=window.location;if(e&&e.length>2){let i=e.substring(1);if(t){let e=i.split(`&`);for(let n=0;n<e.length;n++){let i=e[n].indexOf(`=`);i>0&&e[n].substring(0,i)===t&&(r=e[n].substring(i+1))}}if(r)return r;if(!r&&n>-1){let t=e.match(/\/([a-zA-Z-]*)/g);return Array.isArray(t)?t[typeof n==`number`?n:0]?.replace(`/`,``):void 0}}}return r}},ki=null,Ai=()=>{if(ki!==null)return ki;try{if(ki=typeof window<`u`&&window.localStorage!==null,!ki)return!1;let e=`i18next.translate.boo`;window.localStorage.setItem(e,`foo`),window.localStorage.removeItem(e)}catch{ki=!1}return ki},ji={name:`localStorage`,lookup(e){let{lookupLocalStorage:t}=e;if(t&&Ai())return window.localStorage.getItem(t)||void 0},cacheUserLanguage(e,t){let{lookupLocalStorage:n}=t;n&&Ai()&&window.localStorage.setItem(n,e)}},Mi=null,Ni=()=>{if(Mi!==null)return Mi;try{if(Mi=typeof window<`u`&&window.sessionStorage!==null,!Mi)return!1;let e=`i18next.translate.boo`;window.sessionStorage.setItem(e,`foo`),window.sessionStorage.removeItem(e)}catch{Mi=!1}return Mi},Pi={name:`sessionStorage`,lookup(e){let{lookupSessionStorage:t}=e;if(t&&Ni())return window.sessionStorage.getItem(t)||void 0},cacheUserLanguage(e,t){let{lookupSessionStorage:n}=t;n&&Ni()&&window.sessionStorage.setItem(n,e)}},Fi={name:`navigator`,lookup(e){let t=[];if(typeof navigator<`u`){let{languages:e,userLanguage:n,language:r}=navigator;if(e)for(let n=0;n<e.length;n++)t.push(e[n]);n&&t.push(n),r&&t.push(r)}return t.length>0?t:void 0}},Ii={name:`htmlTag`,lookup(e){let{htmlTag:t}=e,n,r=t||(typeof document<`u`?document.documentElement:null);return r&&typeof r.getAttribute==`function`&&(n=r.getAttribute(`lang`)),n}},Li={name:`path`,lookup(e){let{lookupFromPathIndex:t}=e;if(typeof window>`u`)return;let n=window.location.pathname.match(/\/([a-zA-Z-]*)/g);if(Array.isArray(n))return n[typeof t==`number`?t:0]?.replace(`/`,``)}},Ri={name:`subdomain`,lookup(e){let{lookupFromSubdomainIndex:t}=e,n=typeof t==`number`?t+1:1,r=typeof window<`u`&&window.location?.hostname?.match(/^(\w{2,5})\.(([a-z0-9-]{1,63}\.[a-z]{2,6})|localhost)/i);if(r)return r[n]}},zi=!1;try{document.cookie,zi=!0}catch{}var Bi=[`querystring`,`cookie`,`localStorage`,`sessionStorage`,`navigator`,`htmlTag`];zi||Bi.splice(1,1);var Vi=()=>({order:Bi,lookupQuerystring:`lng`,lookupCookie:`i18next`,lookupLocalStorage:`i18nextLng`,lookupSessionStorage:`i18nextLng`,caches:[`localStorage`],excludeCacheFor:[`cimode`],convertDetectedLanguage:e=>e}),Hi=class{constructor(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};this.type=`languageDetector`,this.detectors={},this.init(e,t)}init(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{languageUtils:{}},t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};this.services=e,this.options=xi(t,this.options||{},Vi()),typeof this.options.convertDetectedLanguage==`string`&&this.options.convertDetectedLanguage.indexOf(`15897`)>-1&&(this.options.convertDetectedLanguage=e=>e.replace(`-`,`_`)),this.options.lookupFromUrlIndex&&(this.options.lookupFromPathIndex=this.options.lookupFromUrlIndex),this.i18nOptions=n,this.addDetector(Ei),this.addDetector(Di),this.addDetector(ji),this.addDetector(Pi),this.addDetector(Fi),this.addDetector(Ii),this.addDetector(Li),this.addDetector(Ri),this.addDetector(Oi)}addDetector(e){return this.detectors[e.name]=e,this}detect(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:this.options.order,t=[];return e.forEach(e=>{if(this.detectors[e]){let n=this.detectors[e].lookup(this.options);n&&typeof n==`string`&&(n=[n]),n&&(t=t.concat(n))}}),t=t.filter(e=>e!=null&&!Si(e)).map(e=>this.options.convertDetectedLanguage(e)),this.services&&this.services.languageUtils&&this.services.languageUtils.getBestMatchFromCodes?t:t.length>0?t[0]:null}cacheUserLanguage(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:this.options.caches;t&&(this.options.excludeCacheFor&&this.options.excludeCacheFor.indexOf(e)>-1||t.forEach(t=>{this.detectors[t]&&this.detectors[t].cacheUserLanguage(e,this.options)}))}};Hi.type=`languageDetector`;var Ui={actions:{save:`Save`,saveAs:`Save As`,cancel:`Cancel`,ok:`OK`,open:`Open`,close:`Close`,delete:`Delete`,create:`Create`,new:`New`,exit:`Exit`,apply:`Apply`,discard:`Discard`,reset:`Reset`,download:`Download`,upload:`Upload`,copy:`Copy`,cut:`Cut`,paste:`Paste`,undo:`Undo`,redo:`Redo`,createFolder:`Create folder`,createFile:`Create new file`,select:`Select`},buttons:{minimize:`Minimize`,maximize:`Maximize`,restore:`Restore`,close:`Close`,yes:`Yes`,no:`No`,confirm:`Confirm`,continue:`Continue`},labels:{name:`Name`,title:`Title`,filename:`Filename`,url:`URL`,file:`File`,folder:`Folder`,home:`Home`,type:`Type`,loading:`Loading...`,search:`Search`,searchIcons:`Search icons...`,unsavedChanges:`Unsaved Changes`,unsaved:`Unsaved changes`,workInProgress:`Work In Progress`},messages:{areYouSure:`Are you sure?`,cannotBeUndone:`This action cannot be undone.`,noFileSelected:`No file selected`,folderEmpty:`This folder is empty`,noMatchingFiles:`No matching files`,noSubfolders:`No subfolders`,replaceFile:`Replace file?`,replaceFileMessage:`A file named "{{name}}" already exists. Do you want to replace it?`,yesReplace:`Yes, replace`,forBetterExperience:`For a better experience use this app desktop OR horizontal mode`,turnYourDevice:`Turn your device`,continueVertically:`Continue vertically?`},theme:{light:`Light`,dark:`Dark`,system:`System`,custom:`Custom`,switchToLight:`Switch to light mode`,switchToDark:`Switch to dark mode`},status:{error:`error`,success:`success`},menu:{file:`File`,edit:`Edit`,view:`View`},filePicker:{folderTreeAria:`Folder tree`,filesAria:`Files`,foldersAria:`Folders`,cancelAria:`Cancel`,openSelectedAria:`Open selected file`,fileNameAria:`File name`},externalLink:{securityMessage:`blocks embedding in iframes for security reasons.`,goToProfile:`Click below to go to my {{name}} profile.`},taskbar:{ariaLabel:`Taskbar`},launcher:{label:`Launcher`,ariaLabel:`App launcher`,selectedIcon:`Selected: {{icon}}`}},Wi={names:{notepad:`Notepad`,terminal:`Terminal`,filesApp:`Files`,files:`Files`,uploader:`Uploader`,settings:`Settings`,pdfViewer:`PDF Viewer`,calendar:`Calendar`,storybook:`Storybook`,linkedin:`LinkedIn`,github:`GitHub`,imageViewer:`Image Viewer`,dosEmulator:`DOS Emulator`,doom:`DOOM`,deviceInfo:`Device Info`,welcome:`Welcome`,menuedit:`Edit Launcher`,codeServer:`VS Code`},folders:{socialLinks:`Social Links`,office:`Office and media`,programming:`Programming`,games:`Games`,customApps:`Custom Apps`},descriptions:{notepad:`Markdown editor with rich text toolbar`,terminal:`Terminal emulator`,filesApp:`File explorer`,settings:`System settings`,pdfViewer:`PDF document viewer`,calendar:`Calendar view`,storybook:`Storybook playground`,linkedin:`LinkedIn profile link`,github:`GitHub profile link`,imageViewer:`Image viewer with file picker`,dosEmulator:`DOS game and program emulator`,doom:`Play the classic DOOM game`},launcher:{label:`Launcher`,ariaLabel:`App launcher`},imageViewer:{noImage:`No image to display. Please open one.`,fitToWindow:`Fit to window`,zoom:`Zoom`},pdf:{viewer:`PDF viewer`},dosEmulator:{noBundle:`No DOS program loaded. Open a .jsdos bundle to start.`,loading:`Loading DOS emulator...`,controls:{pause:`Pause`,resume:`Resume`,restart:`Restart`,mute:`Mute`,unmute:`Unmute`,fullscreen:`Fullscreen`},menu:{file:`File`,open:`Open Bundle`,restart:`Restart`,exit:`Exit`,emulation:`Emulation`,pause:`Pause`,resume:`Resume`,audio:`Audio`,mute:`Mute`,unmute:`Unmute`,volume:`Volume`},errors:{failedToLoad:`Failed to load DOS bundle`,notSupported:`DOS emulation is not supported in this browser`}},uploader:{clickToUpload:`Click here to upload`,selectDestination:`Select destination folder`,fileInfo:`File: {{name}} ({{size}})`,uploading:`Uploading...`,uploadProgress:`Upload progress`,uploadComplete:`Upload complete!`,uploadFailed:`Upload wasn't successful for the following reason`,readyToUpload:`Ready to upload`,showFile:`Show in Files`,openFile:`Open file`,upload:`Upload`,stepSelect:`Select`,stepDestination:`Destination`,stepUpload:`Upload`,stepDone:`Done`,folderSelected:`Folder selected`,uploadTo:`Destination`,uploadToRoot:`Uploading to root folder`},terminal:{notAvailable:`Terminal Not Available`,notAvailableMessage:`The terminal cannot be used because this environment does not currently allow terminal access.`,dockerRequired:`Please run in Docker mode to use the terminal.`,offlineTitle:`Terminal Unavailable`,offlineMessage:`The terminal requires a Docker environment to function. It connects directly to the container's shell.`,offlineInstructions:`To use the terminal, run the application in Docker mode:`,dockerCommand:`docker compose up dev`,openWelcome:`Open Welcome App`,connecting:`Connecting...`,connected:`Connected`,disconnected:`Disconnected`,connectionError:`Connection error`,menu:{edit:`Edit`,copy:`Copy`,paste:`Paste`,clear:`Clear`,reset:`Reset`,reconnect:`Reconnect`,exit:`Exit`},scrollback:`Lines`,shell:`Shell`},codeServer:{notAvailable:`VS Code Not Available`,notAvailableMessage:`VS Code (code-server) cannot be used in browser mode.`,dockerRequired:`Please run in Docker to use VS Code.`}},Gi={sections:{wallpaper:{label:`Wallpaper`,description:`Change the desktop background image.`},appearance:{label:`Appearance`,description:`Switch between light and dark mode.`},launcher:{label:`Launcher`,description:`Choose the launcher button icon.`},font:{label:`Font`,description:`Select the system font family.`},reset:{label:`Reset to Default`,description:`Reset all settings and data to defaults.`},language:{label:`Language`,description:`Choose your preferred language.`}},wallpaper:{title:`Wallpaper`,wallpaperType:`Wallpaper Type`,staticImage:`Static Image`,chooseFromImages:`Choose from Images`,uploadFromDisk:`Upload from disk`,resetToDefault:`Reset to default`,orEnterUrl:`Or enter a URL`,wallpaperPreview:`Wallpaper preview`},appearance:{title:`Appearance`,description:`Choose whether the desktop uses a light or dark theme, or follows the system preference.`,taskbar:`Taskbar`,window:`Window`,accent:`Accent`,animationDuration:`Animation Duration`,animationDescription:`Controls the speed of window open/close animations (0.1s - 1.0s) must save to see changes.`},font:{title:`Font`,description:`Changes the font across the entire desktop interface. Fonts must be downloaded before use.`,download:`Download`,fontSize:`Font Size`,downloadByName:`Download a font by name`,fromGoogleFonts:`(From Google Fonts)`,downloadError:`Font didn't download successfully. Try again with the correct name`,downloadSuccess:`Downloaded successfully.`,systemDefault:`System Default`},reset:{title:`Reset to Default`,description:`Reset all settings and data to their default values. This action cannot be undone.`,resetButton:`⚠️ Reset app to defaults?`,modalTitle:`Are you sure?`,modalDescription:`This will erase all your data and settings.`,goBack:`Please go back! 🙏`,burnEverything:`Yes, burn everything! 🔥`,keepFiles:`Yes, but keep my files`},language:{title:`Language`,description:`Select your preferred language for the desktop interface.`,selectPlaceholder:`Select language`,english:`English`,spanish:`Español`},all:`All Settings`},Ki={window:{title:`Window`,minimize:`Minimize`,maximize:`Maximize`,restore:`Restore`,close:`Close`,ariaLabels:{minimize:`Minimize`,maximize:`Maximize`,restore:`Restore`,close:`Close`}},unsavedModal:{title:`Unsaved Changes`,message:`You have unsaved changes. What would you like to do?`,dontSave:`Don't Save`,save:`Save`},fileDialog:{openFile:`Open file`,saveFile:`Save file`,selectFile:`Select file {{name}}`,openFolder:`Open folder {{name}}`,selectFolder:`Select folder`,filename:`filename.md`}},qi={window:{minimize:`Minimize`,restore:`Restore`,maximize:`Maximize`,close:`Close window`},actions:{cut:`Cut`,copy:`Copy`,paste:`Paste`,pasteItems:`Paste ({{count}} items)`,delete:`Delete`,createFolder:`Create folder`,createFile:`Create new file`},createItem:{folderTitle:`Create Folder`,fileTitle:`Create File`,newFolder:`New Folder`,newFile:`New File`,nameError:`There is already a {{mode}} with that name`,clearNameAria:`Clear name`,customIcon:`Choose custom icon or color`,colorError:`Enter a valid hex color (e.g. #ff0000)`,changeLater:`You can change the icon later in folder properties.`},deleteConfirm:{title:`Delete "{{name}}"?`,message:`Are you sure you want to delete "{{name}}"? This action cannot be undone.`},app:{open:`Open {{name}}`,toggleTheme:`Toggle Theme`},sort:{title:`Sort Icons`,default:`Default`,nameAsc:`Name (A-Z)`,nameDesc:`Name (Z-A)`,byType:`By Type`},launcher:{title:`Launcher`,editLauncher:`Edit Launcher`}},Ji={empty:{title:`There are no new notifications`,message:`For now`},taskbar:{showNotifications:`Show notifications`,hideNotifications:`Hide notifications`,clock:`clock`}},Yi={toolbar:{formatting:`Text formatting`,bold:`Bold`,italic:`Italic`,strikethrough:`Strikethrough`,inlineCode:`Inline code`,heading1:`Heading 1`,heading2:`Heading 2`,bulletList:`Bullet list`,orderedList:`Ordered list`,blockquote:`Blockquote`,codeBlock:`Code block`,horizontalRule:`Horizontal rule`},untitled:`untitled.md`},Xi={hero:{title:`Fullstack Developer & DevOps`,downloadCV:`Download CV`,contactMe:`Contact Me`},skills:{technical:`Technical Skills`,soft:`Soft Skills`},experience:`Professional Experience`,techStack:`Tech Stack`,languages:`Languages`},Zi={title:`Edit Launcher`,newFolder:`New Folder`,predefined:`Predefined`,rename:`Rename`,delete:`Delete`,predefinedFolders:`Predefined Folders`,customFolders:`Custom Folders`,availableApps:`Available Apps (drag and drop to add to folder)`,clickToAdd:`Click to add to first custom folder`,addFolder:`Add folder`,instructions:`Right-click an app in a folder to remove it. Click an available app to add it to the first custom folder.`,canCreateNewFolder:`You can create new folders if needed.`},Qi={actions:{save:`Guardar`,saveAs:`Guardar como`,cancel:`Cancelar`,ok:`Aceptar`,open:`Abrir`,close:`Cerrar`,delete:`Eliminar`,create:`Crear`,new:`Nuevo`,exit:`Salir`,apply:`Aplicar`,discard:`Descartar`,reset:`Restablecer`,download:`Descargar`,upload:`Subir`,copy:`Copiar`,cut:`Cortar`,paste:`Pegar`,undo:`Deshacer`,redo:`Rehacer`,createFolder:`Crear carpeta`,createFile:`Crear nuevo archivo`,select:`Seleccionar`},buttons:{minimize:`Minimizar`,maximize:`Maximizar`,restore:`Restaurar`,close:`Cerrar`,yes:`Sí`,no:`No`,confirm:`Confirmar`,continue:`Continuar`},labels:{name:`Nombre`,title:`Título`,filename:`Nombre de archivo`,url:`URL`,file:`Archivo`,folder:`Carpeta`,home:`Inicio`,type:`Tipo`,loading:`Cargando...`,search:`Buscar`,searchIcons:`Buscar iconos...`,unsavedChanges:`Cambios sin guardar`,unsaved:`Cambios sin guardar`,workInProgress:`Trabajo en progreso`},messages:{areYouSure:`¿Estás seguro?`,cannotBeUndone:`Esta acción no se puede deshacer.`,noFileSelected:`Ningún archivo seleccionado`,folderEmpty:`Esta carpeta está vacía`,noMatchingFiles:`No hay archivos coincidentes`,noSubfolders:`Sin subcarpetas`,replaceFile:`¿Reemplazar archivo?`,replaceFileMessage:`Ya existe un archivo llamado "{{name}}". ¿Deseas reemplazarlo?`,yesReplace:`Sí, reemplazar`,forBetterExperience:`Para una mejor experiencia usa esta aplicación en modo escritorio u horizontal`,turnYourDevice:`Gira tu dispositivo`,continueVertically:`¿Continuar verticalmente?`},theme:{light:`Claro`,dark:`Oscuro`,system:`Sistema`,custom:`Personalizado`,switchToLight:`Cambiar a modo claro`,switchToDark:`Cambiar a modo oscuro`},status:{error:`error`,success:`éxito`},menu:{file:`Archivo`,edit:`Editar`,view:`Ver`},filePicker:{folderTreeAria:`Árbol de carpetas`,filesAria:`Archivos`,foldersAria:`Carpetas`,cancelAria:`Cancelar`,openSelectedAria:`Abrir archivo seleccionado`,fileNameAria:`Nombre de archivo`},externalLink:{securityMessage:`bloquea la incrustación en iframes por razones de seguridad.`,goToProfile:`Haz clic abajo para ir a mi perfil de {{name}}.`},taskbar:{ariaLabel:`Barra de tareas`},launcher:{label:`Lanzador`,ariaLabel:`Lanzador de aplicaciones`,selectedIcon:`Seleccionado: {{icon}}`}},$i={names:{notepad:`Bloc de notas`,terminal:`Terminal`,filesApp:`Archivos`,files:`Archivos`,uploader:`Subida de archivos`,settings:`Ajustes`,pdfViewer:`Visor PDF`,calendar:`Calendario`,storybook:`Storybook`,linkedin:`LinkedIn`,github:`GitHub`,imageViewer:`Visor de imágenes`,dosEmulator:`Emulador DOS`,doom:`DOOM`,deviceInfo:`Info del dispositivo`,welcome:`Bienvenido`,menuedit:`Editar lanzador`,codeServer:`VS Code`},folders:{socialLinks:`Enlaces sociales`,office:`Oficina y medios`,programming:`Programación`,games:`Juegos`,customApps:`Aplicaciones personalizadas`},descriptions:{notepad:`Editor Markdown con barra de herramientas`,terminal:`Emulador de terminal`,filesApp:`Explorador de archivos`,settings:`Ajustes del sistema`,pdfViewer:`Visor de documentos PDF`,calendar:`Vista de calendario`,storybook:`Zona de pruebas Storybook`,linkedin:`Enlace al perfil de LinkedIn`,github:`Enlace al perfil de GitHub`,imageViewer:`Visor de imágenes con selector de archivos`,dosEmulator:`Emulador de juegos y programas DOS`,doom:`Juega al clásico DOOM`},launcher:{label:`Lanzador`,ariaLabel:`Lanzador de aplicaciones`},imageViewer:{noImage:`Sin imagen para mostrar. Por favor, abre una.`,fitToWindow:`Ajustar a ventana`,zoom:`Zoom`},pdf:{viewer:`Visor PDF`},dosEmulator:{noBundle:`Ningún programa DOS cargado. Abre un bundle .jsdos para comenzar.`,loading:`Cargando emulador DOS...`,controls:{pause:`Pausar`,resume:`Reanudar`,restart:`Reiniciar`,mute:`Silenciar`,unmute:`Activar sonido`,fullscreen:`Pantalla completa`},menu:{file:`Archivo`,open:`Abrir Bundle`,restart:`Reiniciar`,exit:`Salir`,emulation:`Emulación`,pause:`Pausar`,resume:`Reanudar`,audio:`Audio`,mute:`Silenciar`,unmute:`Activar sonido`,volume:`Volumen`},errors:{failedToLoad:`Error al cargar el bundle DOS`,notSupported:`La emulación DOS no está soportada en este navegador`}},uploader:{clickToUpload:`Haz clic aquí para subir`,selectDestination:`Seleccionar carpeta destino`,fileInfo:`Archivo: {{name}} ({{size}})`,uploading:`Subiendo...`,uploadProgress:`Progreso de subida`,uploadComplete:`¡Subida completada!`,uploadFailed:`La subida no fue exitosa por la siguiente razón`,readyToUpload:`Listo para subir`,showFile:`Mostrar en Archivos`,openFile:`Abrir archivo`,upload:`Subir`,stepSelect:`Seleccionar`,stepDestination:`Destino`,stepUpload:`Subir`,stepDone:`Listo`,folderSelected:`Carpeta seleccionada`,uploadTo:`Destino`,uploadToRoot:`Subiendo a la carpeta raíz`},terminal:{notAvailable:`Terminal no disponible`,notAvailableMessage:`La terminal no puede usarse porque este entorno no permite actualmente el acceso a terminal.`,dockerRequired:`Por favor, ejecuta en modo Docker para usar la terminal.`,offlineTitle:`Terminal no disponible`,offlineMessage:`La terminal requiere un entorno Docker para funcionar. Se conecta directamente al shell del contenedor.`,offlineInstructions:`Para usar la terminal, ejecuta la aplicación en modo Docker:`,dockerCommand:`docker compose up dev`,openWelcome:`Abrir Bienvenida`,connecting:`Conectando...`,connected:`Conectado`,disconnected:`Desconectado`,connectionError:`Error de conexión`,menu:{edit:`Editar`,copy:`Copiar`,paste:`Pegar`,clear:`Limpiar`,reset:`Reiniciar`,reconnect:`Reconectar`,exit:`Salir`},scrollback:`Líneas`,shell:`Shell`},codeServer:{notAvailable:`VS Code no disponible`,notAvailableMessage:`VS Code (code-server) no puede usarse en modo navegador.`,dockerRequired:`Por favor, ejecuta la aplicación en Docker para usar VS Code.`}},ea={sections:{wallpaper:{label:`Fondo de pantalla`,description:`Cambia la imagen de fondo del escritorio.`},appearance:{label:`Apariencia`,description:`Cambia entre modo claro y oscuro.`},launcher:{label:`Lanzador`,description:`Elige el icono del botón del lanzador.`},font:{label:`Fuente`,description:`Selecciona la familia de fuentes del sistema.`},reset:{label:`Restablecer`,description:`Restaura todos los ajustes y datos a sus valores por defecto.`},language:{label:`Idioma`,description:`Elige tu idioma preferido.`}},wallpaper:{title:`Fondo de pantalla`,wallpaperType:`Tipo de fondo`,staticImage:`Imagen estática`,chooseFromImages:`Elegir de imágenes`,uploadFromDisk:`Subir desde disco`,resetToDefault:`Restablecer por defecto`,orEnterUrl:`O introduce una URL`,wallpaperPreview:`Vista previa del fondo`},appearance:{title:`Apariencia`,description:`Elige si el escritorio usa un tema claro u oscuro, o sigue la preferencia del sistema.`,taskbar:`Barra de tareas`,window:`Ventana`,accent:`Acento`,animationDuration:`Duración de animación`,animationDescription:`Controla la velocidad de las animaciones de abrir/cerrar ventanas (0.1s - 1.0s), debes guardar para ver los cambios.`},font:{title:`Fuente`,description:`Cambia la fuente en toda la interfaz del escritorio. Las fuentes deben descargarse antes de usar.`,download:`Descargar`,fontSize:`Tamaño de fuente`,downloadByName:`Descargar una fuente por nombre`,fromGoogleFonts:`(Desde Google Fonts)`,downloadError:`La fuente no se descargó correctamente. Intenta de nuevo con el nombre correcto`,downloadSuccess:`Descargada correctamente.`,systemDefault:`Sistema por defecto`},reset:{title:`Restablecer`,description:`Restaura todos los ajustes y datos a sus valores por defecto. Esta acción no se puede deshacer.`,resetButton:`⚠️ ¿Restablecer la app?`,modalTitle:`¿Estás seguro?`,modalDescription:`Esto borrará todos tus datos y ajustes.`,goBack:`¡Por favor vuelve atrás! 🙏`,burnEverything:`¡Sí, quémalo todo! 🔥`,keepFiles:`Sí, pero mantener mis archivos`},language:{title:`Idioma`,description:`Selecciona tu idioma preferido para la interfaz del escritorio.`,selectPlaceholder:`Selecciona idioma`,english:`English`,spanish:`Español`},all:`Todos los ajustes`},ta={window:{title:`Ventana`,minimize:`Minimizar`,maximize:`Maximizar`,restore:`Restaurar`,close:`Cerrar`,ariaLabels:{minimize:`Minimizar`,maximize:`Maximizar`,restore:`Restaurar`,close:`Cerrar`}},unsavedModal:{title:`Cambios sin guardar`,message:`Tienes cambios sin guardar. ¿Qué deseas hacer?`,dontSave:`No guardar`,save:`Guardar`},fileDialog:{openFile:`Abrir archivo`,saveFile:`Guardar archivo`,selectFile:`Seleccionar archivo {{name}}`,openFolder:`Abrir carpeta {{name}}`,selectFolder:`Seleccionar carpeta`,filename:`nombre.md`}},na={window:{minimize:`Minimizar`,restore:`Restaurar`,maximize:`Maximizar`,close:`Cerrar ventana`},actions:{cut:`Cortar`,copy:`Copiar`,paste:`Pegar`,pasteItems:`Pegar ({{count}} elementos)`,delete:`Eliminar`,createFolder:`Crear carpeta`,createFile:`Crear nuevo archivo`},createItem:{folderTitle:`Crear Carpeta`,fileTitle:`Crear Archivo`,newFolder:`Nueva Carpeta`,newFile:`Nuevo Archivo`,nameError:`Ya existe un {{mode}} con ese nombre`,clearNameAria:`Limpiar nombre`,customIcon:`Elige icono o color personalizado`,colorError:`Introduce un color hexadecimal válido (ej. #ff0000)`,changeLater:`Puedes cambiar el icono más tarde en las propiedades de la carpeta.`},deleteConfirm:{title:`¿Eliminar "{{name}}"?`,message:`¿Estás seguro de que quieres eliminar "{{name}}"? Esta acción no se puede deshacer.`},app:{open:`Abrir {{name}}`,toggleTheme:`Cambiar Tema`},sort:{title:`Ordenar Iconos`,default:`Por defecto`,nameAsc:`Nombre (A-Z)`,nameDesc:`Nombre (Z-A)`,byType:`Por Tipo`},launcher:{title:`Launcher`,editLauncher:`Editar Launcher`}},ra={empty:{title:`No hay notificaciones nuevas`,message:`Por ahora`},taskbar:{showNotifications:`Mostrar notificaciones`,hideNotifications:`Ocultar notificaciones`,clock:`reloj`}},ia={toolbar:{formatting:`Formato de texto`,bold:`Negrita`,italic:`Cursiva`,strikethrough:`Tachado`,inlineCode:`Código en línea`,heading1:`Título 1`,heading2:`Título 2`,bulletList:`Lista con viñetas`,orderedList:`Lista ordenada`,blockquote:`Cita`,codeBlock:`Bloque de código`,horizontalRule:`Línea horizontal`},untitled:`sin-titulo.md`},aa={hero:{title:`Fullstack Developer & DevOps`,downloadCV:`Descargar CV`,contactMe:`Contactar`},skills:{technical:`Habilidades Técnicas`,soft:`Habilidades Blandas`},experience:`Experiencia Profesional`,techStack:`Stack Tecnológico`,languages:`Idiomas`},oa={newFolder:`Nueva Carpeta`,predefined:`Predefinida`,rename:`Renombrar`,delete:`Eliminar`,predefinedFolders:`Carpetas Predefinidas`,customFolders:`Carpetas Personalizadas`,availableApps:`Apps Disponibles (arrastrar y soltar para añadir a carpetas)`,clickToAdd:`Clic para añadir a la primera carpeta personalizada`,addFolder:`Añadir carpeta`,instructions:`Clic derecho en una app dentro de una carpeta para eliminarla. Clic en una app disponible para añadirla a la primera carpeta personalizada.`,canCreateNewFolder:`Puedes crear una nueva carpeta si lo necesitas.`},sa=[`en`,`es`];J.use(Hi).use(D.r).init({resources:{en:{common:Ui,apps:Wi,settings:Gi,window:Ki,contextMenu:qi,notifications:Ji,notes:Yi,welcome:Xi,menuedit:Zi},es:{common:Qi,apps:$i,settings:ea,window:ta,contextMenu:na,notifications:ra,notes:ia,welcome:aa,menuedit:oa}},fallbackLng:`en`,supportedLngs:sa,ns:[`common`,`apps`,`settings`,`window`,`contextMenu`,`notifications`,`notes`,`welcome`,`menuedit`],defaultNS:`common`,interpolation:{escapeValue:!1},detection:{order:[`localStorage`,`navigator`],lookupLocalStorage:`fde-desktop:language`,caches:[`localStorage`]}});var ca=J,la={root:`_root_17um1_1`,windowButton:`_windowButton_17um1_15`,systemTray:`_systemTray_17um1_44`,themeToggle:`_themeToggle_17um1_51`,clock:`_clock_17um1_70`,notifButton:`_notifButton_17um1_88`,langButton:`_langButton_17um1_109`},ua={en:`English`,es:`Español`},da=()=>{let{t:e,i18n:t}=D.t(`settings`),n=c.h(e=>e.language),r=c.h(e=>e.setLanguage),[i,a]=(0,B.useState)(!1),s=(0,B.useCallback)(e=>{r(e),t.changeLanguage(e),localStorage.setItem(`fde-desktop:language`,e),a(!1)},[r,t]);return(0,V.jsxs)(o.n,{opened:i,onChange:a,position:`top-end`,shadow:`md`,withArrow:!0,children:[(0,V.jsx)(o.n.Target,{children:(0,V.jsx)(f.t,{className:la.langButton,onClick:()=>a(e=>!e),"aria-label":e(`language.selectPlaceholder`),"aria-expanded":i,children:(0,V.jsx)(c.p,{lang:n,size:16})})}),(0,V.jsx)(o.n.Dropdown,{children:(0,V.jsx)(C.t,{gap:`xs`,children:sa.map(e=>(0,V.jsx)(f.t,{onClick:()=>s(e),"aria-label":ua[e],"aria-pressed":e===n,style:{padding:`8px 12px`,borderRadius:6,width:`100%`,background:e===n?`var(--mantine-primary-color-light)`:`transparent`,cursor:`pointer`},children:(0,V.jsxs)(h.t,{gap:`sm`,children:[(0,V.jsx)(c.p,{lang:e,size:20}),(0,V.jsx)(g.o,{size:`sm`,fw:e===n?600:400,children:ua[e]})]})},e))})})]})},fa=({win:e,onClick:t,onContextMenu:n})=>{let r=(0,B.useRef)(null),{register:i,unregister:a}=Jn();return(0,B.useEffect)(()=>(r.current&&i(e.id,r.current.getBoundingClientRect()),()=>a(e.id)),[e.id,i,a]),(0,V.jsxs)(`button`,{ref:r,className:la.windowButton,"data-active":e.state===`minimized`?`false`:`true`,onClick:t,onContextMenu:n,"aria-label":e.title,children:[(0,V.jsx)(y.t,{fcIcon:e.fcIcon,iconUrl:e.iconUrl,fallback:e.icon,size:14,color:e.iconColor}),(0,V.jsx)(g.o,{size:`xs`,truncate:!0,children:e.title})]})},pa=({calendarSlot:e})=>{let{t}=D.t(`notifications`),n=c.h(e=>e.theme.colors.taskbar),r=c.h(e=>e.theme.mode),i=c.h(e=>e.toggleTheme),a=c.h(e=>e.launcherIcon),s=w.o(e=>e.notifications),l=w.o(e=>e.removeNotification),u=w.o(e=>e.windows),d=w.o(e=>e.restoreWindow),f=w.o(e=>e.minimizeWindow),p=w.o(e=>e.focusWindow),m=w.o(e=>e.closeWindow),h=w.o(e=>e.maximizeWindow),_=Zr(),[v,b]=(0,B.useState)(!1),[x,S]=(0,B.useState)(!1),{position:C,targetWindowId:T,windowMenuOpened:E,panelMenuOpened:O,launcherMenuOpened:k,openWindowMenu:A,openPanelMenu:j,openLauncherMenu:M,closeMenu:N}=ei(),P=T?u.find(e=>e.id===T)?.state??null:null,F=(0,B.useRef)(0);(0,B.useEffect)(()=>{s.length>F.current&&setTimeout(()=>S(!0),0),F.current=s.length},[s.length]);let I=u.filter(e=>e.isOpen),L=(e,t)=>{t===`minimized`?(d(e),p(e)):f(e)};return(0,V.jsxs)(V.Fragment,{children:[(0,V.jsxs)(`div`,{className:la.root,style:{background:n},role:`toolbar`,"aria-label":`Taskbar`,onContextMenu:j,children:[(0,V.jsx)(pi,{fcIcon:a,onContextMenu:M}),I.map(e=>(0,V.jsx)(fa,{win:e,onClick:()=>L(e.id,e.state),onContextMenu:t=>A(t,e.id)},e.id)),(0,V.jsxs)(`div`,{className:la.systemTray,"data-testid":`system-tray`,children:[(0,V.jsxs)(o.n,{opened:x,onChange:S,position:`top-end`,shadow:`md`,withArrow:!0,keepMounted:!0,children:[(0,V.jsx)(o.n.Target,{children:(0,V.jsx)(`button`,{className:la.notifButton,onClick:()=>S(e=>!e),"aria-label":t(x?`taskbar.hideNotifications`:`taskbar.showNotifications`),children:(0,V.jsx)(y.t,{fcIcon:x?`FcCollapse`:`FcExpand`,size:18})})}),(0,V.jsx)(o.n.Dropdown,{style:{background:`transparent`,border:`none`,padding:0},children:(0,V.jsx)(`div`,{style:{display:`flex`,flexDirection:`column`,gap:8,minWidth:300},children:s.length===0?(0,V.jsx)(Tn,{title:t(`empty.title`),onClose:()=>S(!1),children:t(`empty.message`)}):s.map(e=>(0,V.jsx)(Tn,{withBorder:!0,icon:e.fcIcon?(0,V.jsx)(y.t,{fcIcon:e.fcIcon,size:18}):void 0,title:e.title,onClose:()=>{l(e.id),e.onClose?.()},children:e.message},e.id))})})]}),(0,V.jsx)(da,{}),(0,V.jsx)(`button`,{className:la.themeToggle,onClick:i,"aria-label":t(r===`dark`?`theme.switchToLight`:`theme.switchToDark`,{ns:`common`}),title:t(r===`dark`?`theme.switchToLight`:`theme.switchToDark`,{ns:`common`}),children:r===`dark`?`☀️`:`🌙`}),(0,V.jsxs)(o.n,{opened:v,onChange:b,position:`top-end`,shadow:`md`,withArrow:!0,children:[(0,V.jsx)(o.n.Target,{children:(0,V.jsx)(`button`,{className:la.clock,onClick:()=>b(e=>!e),"aria-label":t(`taskbar.clock`),"aria-expanded":v,children:(0,V.jsx)(g.o,{size:`xs`,children:_})})}),(0,V.jsx)(o.n.Dropdown,{children:e})]})]})]}),(0,V.jsx)(vi,{windowMenuOpened:E,panelMenuOpened:O,launcherMenuOpened:k,menuPosition:C,targetWindowId:T,targetWindowState:P,onCloseWindow:m,onMinimizeWindow:f,onMaximizeWindow:h,onRestoreWindow:d,onClose:N})]})},ma=e.t((e=>{var t=typeof Symbol==`function`&&Symbol.for,n=t?Symbol.for(`react.element`):60103,r=t?Symbol.for(`react.portal`):60106,i=t?Symbol.for(`react.fragment`):60107,a=t?Symbol.for(`react.strict_mode`):60108,o=t?Symbol.for(`react.profiler`):60114,s=t?Symbol.for(`react.provider`):60109,c=t?Symbol.for(`react.context`):60110,l=t?Symbol.for(`react.async_mode`):60111,u=t?Symbol.for(`react.concurrent_mode`):60111,d=t?Symbol.for(`react.forward_ref`):60112,f=t?Symbol.for(`react.suspense`):60113,p=t?Symbol.for(`react.suspense_list`):60120,m=t?Symbol.for(`react.memo`):60115,h=t?Symbol.for(`react.lazy`):60116,g=t?Symbol.for(`react.block`):60121,_=t?Symbol.for(`react.fundamental`):60117,v=t?Symbol.for(`react.responder`):60118,y=t?Symbol.for(`react.scope`):60119;function b(e){if(typeof e==`object`&&e){var t=e.$$typeof;switch(t){case n:switch(e=e.type,e){case l:case u:case i:case o:case a:case f:return e;default:switch(e&&=e.$$typeof,e){case c:case d:case h:case m:case s:return e;default:return t}}case r:return t}}}function x(e){return b(e)===u}e.AsyncMode=l,e.ConcurrentMode=u,e.ContextConsumer=c,e.ContextProvider=s,e.Element=n,e.ForwardRef=d,e.Fragment=i,e.Lazy=h,e.Memo=m,e.Portal=r,e.Profiler=o,e.StrictMode=a,e.Suspense=f,e.isAsyncMode=function(e){return x(e)||b(e)===l},e.isConcurrentMode=x,e.isContextConsumer=function(e){return b(e)===c},e.isContextProvider=function(e){return b(e)===s},e.isElement=function(e){return typeof e==`object`&&!!e&&e.$$typeof===n},e.isForwardRef=function(e){return b(e)===d},e.isFragment=function(e){return b(e)===i},e.isLazy=function(e){return b(e)===h},e.isMemo=function(e){return b(e)===m},e.isPortal=function(e){return b(e)===r},e.isProfiler=function(e){return b(e)===o},e.isStrictMode=function(e){return b(e)===a},e.isSuspense=function(e){return b(e)===f},e.isValidElementType=function(e){return typeof e==`string`||typeof e==`function`||e===i||e===u||e===o||e===a||e===f||e===p||typeof e==`object`&&!!e&&(e.$$typeof===h||e.$$typeof===m||e.$$typeof===s||e.$$typeof===c||e.$$typeof===d||e.$$typeof===_||e.$$typeof===v||e.$$typeof===y||e.$$typeof===g)},e.typeOf=b})),ha=e.t((e=>{process.env.NODE_ENV!==`production`&&(function(){"use strict";var t=typeof Symbol==`function`&&Symbol.for,n=t?Symbol.for(`react.element`):60103,r=t?Symbol.for(`react.portal`):60106,i=t?Symbol.for(`react.fragment`):60107,a=t?Symbol.for(`react.strict_mode`):60108,o=t?Symbol.for(`react.profiler`):60114,s=t?Symbol.for(`react.provider`):60109,c=t?Symbol.for(`react.context`):60110,l=t?Symbol.for(`react.async_mode`):60111,u=t?Symbol.for(`react.concurrent_mode`):60111,d=t?Symbol.for(`react.forward_ref`):60112,f=t?Symbol.for(`react.suspense`):60113,p=t?Symbol.for(`react.suspense_list`):60120,m=t?Symbol.for(`react.memo`):60115,h=t?Symbol.for(`react.lazy`):60116,g=t?Symbol.for(`react.block`):60121,_=t?Symbol.for(`react.fundamental`):60117,v=t?Symbol.for(`react.responder`):60118,y=t?Symbol.for(`react.scope`):60119;function b(e){return typeof e==`string`||typeof e==`function`||e===i||e===u||e===o||e===a||e===f||e===p||typeof e==`object`&&!!e&&(e.$$typeof===h||e.$$typeof===m||e.$$typeof===s||e.$$typeof===c||e.$$typeof===d||e.$$typeof===_||e.$$typeof===v||e.$$typeof===y||e.$$typeof===g)}function x(e){if(typeof e==`object`&&e){var t=e.$$typeof;switch(t){case n:var p=e.type;switch(p){case l:case u:case i:case o:case a:case f:return p;default:var g=p&&p.$$typeof;switch(g){case c:case d:case h:case m:case s:return g;default:return t}}case r:return t}}}var S=l,C=u,w=c,T=s,E=n,D=d,O=i,k=h,A=m,j=r,M=o,N=a,P=f,F=!1;function I(e){return F||(F=!0,console.warn(`The ReactIs.isAsyncMode() alias has been deprecated, and will be removed in React 17+. Update your code to use ReactIs.isConcurrentMode() instead. It has the exact same API.`)),L(e)||x(e)===l}function L(e){return x(e)===u}function ee(e){return x(e)===c}function R(e){return x(e)===s}function te(e){return typeof e==`object`&&!!e&&e.$$typeof===n}function ne(e){return x(e)===d}function z(e){return x(e)===i}function re(e){return x(e)===h}function ie(e){return x(e)===m}function ae(e){return x(e)===r}function oe(e){return x(e)===o}function se(e){return x(e)===a}function B(e){return x(e)===f}e.AsyncMode=S,e.ConcurrentMode=C,e.ContextConsumer=w,e.ContextProvider=T,e.Element=E,e.ForwardRef=D,e.Fragment=O,e.Lazy=k,e.Memo=A,e.Portal=j,e.Profiler=M,e.StrictMode=N,e.Suspense=P,e.isAsyncMode=I,e.isConcurrentMode=L,e.isContextConsumer=ee,e.isContextProvider=R,e.isElement=te,e.isForwardRef=ne,e.isFragment=z,e.isLazy=re,e.isMemo=ie,e.isPortal=ae,e.isProfiler=oe,e.isStrictMode=se,e.isSuspense=B,e.isValidElementType=b,e.typeOf=x})()})),ga=e.t(((e,t)=>{process.env.NODE_ENV===`production`?t.exports=ma():t.exports=ha()})),_a=e.t(((e,t)=>{var n=Object.getOwnPropertySymbols,r=Object.prototype.hasOwnProperty,i=Object.prototype.propertyIsEnumerable;function a(e){if(e==null)throw TypeError(`Object.assign cannot be called with null or undefined`);return Object(e)}function o(){try{if(!Object.assign)return!1;var e=new String(`abc`);if(e[5]=`de`,Object.getOwnPropertyNames(e)[0]===`5`)return!1;for(var t={},n=0;n<10;n++)t[`_`+String.fromCharCode(n)]=n;if(Object.getOwnPropertyNames(t).map(function(e){return t[e]}).join(``)!==`0123456789`)return!1;var r={};return`abcdefghijklmnopqrst`.split(``).forEach(function(e){r[e]=e}),Object.keys(Object.assign({},r)).join(``)===`abcdefghijklmnopqrst`}catch{return!1}}t.exports=o()?Object.assign:function(e,t){for(var o,s=a(e),c,l=1;l<arguments.length;l++){for(var u in o=Object(arguments[l]),o)r.call(o,u)&&(s[u]=o[u]);if(n){c=n(o);for(var d=0;d<c.length;d++)i.call(o,c[d])&&(s[c[d]]=o[c[d]])}}return s}})),va=e.t(((e,t)=>{t.exports=`SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED`})),ya=e.t(((e,t)=>{t.exports=Function.call.bind(Object.prototype.hasOwnProperty)})),ba=e.t(((e,t)=>{var n=function(){};if(process.env.NODE_ENV!==`production`){var r=va(),i={},a=ya();n=function(e){var t=`Warning: `+e;typeof console<`u`&&console.error(t);try{throw Error(t)}catch{}}}function o(e,t,o,s,c){if(process.env.NODE_ENV!==`production`){for(var l in e)if(a(e,l)){var u;try{if(typeof e[l]!=`function`){var d=Error((s||`React class`)+`: `+o+" type `"+l+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof e[l]+"`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");throw d.name=`Invariant Violation`,d}u=e[l](t,l,s,o,null,r)}catch(e){u=e}if(u&&!(u instanceof Error)&&n((s||`React class`)+`: type specification of `+o+" `"+l+"` is invalid; the type checker function must return `null` or an `Error` but returned a "+typeof u+`. You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument).`),u instanceof Error&&!(u.message in i)){i[u.message]=!0;var f=c?c():``;n(`Failed `+o+` type: `+u.message+(f??``))}}}}o.resetWarningCache=function(){process.env.NODE_ENV!==`production`&&(i={})},t.exports=o})),xa=e.t(((e,t)=>{var n=ga(),r=_a(),i=va(),a=ya(),o=ba(),s=function(){};process.env.NODE_ENV!==`production`&&(s=function(e){var t=`Warning: `+e;typeof console<`u`&&console.error(t);try{throw Error(t)}catch{}});function c(){return null}t.exports=function(e,t){var l=typeof Symbol==`function`&&Symbol.iterator,u=`@@iterator`;function d(e){var t=e&&(l&&e[l]||e[u]);if(typeof t==`function`)return t}var f=`<<anonymous>>`,p={array:_(`array`),bigint:_(`bigint`),bool:_(`boolean`),func:_(`function`),number:_(`number`),object:_(`object`),string:_(`string`),symbol:_(`symbol`),any:v(),arrayOf:y,element:b(),elementType:x(),instanceOf:S,node:E(),objectOf:w,oneOf:C,oneOfType:T,shape:O,exact:k};function m(e,t){return e===t?e!==0||1/e==1/t:e!==e&&t!==t}function h(e,t){this.message=e,this.data=t&&typeof t==`object`?t:{},this.stack=``}h.prototype=Error.prototype;function g(e){if(process.env.NODE_ENV!==`production`)var n={},r=0;function a(a,o,c,l,u,d,p){if(l||=f,d||=c,p!==i){if(t){var m=Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use `PropTypes.checkPropTypes()` to call them. Read more at http://fb.me/use-check-prop-types");throw m.name=`Invariant Violation`,m}else if(process.env.NODE_ENV!==`production`&&typeof console<`u`){var g=l+`:`+c;!n[g]&&r<3&&(s("You are manually calling a React.PropTypes validation function for the `"+d+"` prop on `"+l+"`. This is deprecated and will throw in the standalone `prop-types` package. You may be seeing this warning due to a third-party PropTypes library. See https://fb.me/react-warning-dont-call-proptypes for details."),n[g]=!0,r++)}}return o[c]==null?a?o[c]===null?new h(`The `+u+" `"+d+"` is marked as required "+("in `"+l+"`, but its value is `null`.")):new h(`The `+u+" `"+d+"` is marked as required in "+("`"+l+"`, but its value is `undefined`.")):null:e(o,c,l,u,d)}var o=a.bind(null,!1);return o.isRequired=a.bind(null,!0),o}function _(e){function t(t,n,r,i,a,o){var s=t[n];if(M(s)!==e){var c=N(s);return new h(`Invalid `+i+" `"+a+"` of type "+("`"+c+"` supplied to `"+r+"`, expected ")+("`"+e+"`."),{expectedType:e})}return null}return g(t)}function v(){return g(c)}function y(e){function t(t,n,r,a,o){if(typeof e!=`function`)return new h("Property `"+o+"` of component `"+r+"` has invalid PropType notation inside arrayOf.");var s=t[n];if(!Array.isArray(s)){var c=M(s);return new h(`Invalid `+a+" `"+o+"` of type "+("`"+c+"` supplied to `"+r+"`, expected an array."))}for(var l=0;l<s.length;l++){var u=e(s,l,r,a,o+`[`+l+`]`,i);if(u instanceof Error)return u}return null}return g(t)}function b(){function t(t,n,r,i,a){var o=t[n];if(!e(o)){var s=M(o);return new h(`Invalid `+i+" `"+a+"` of type "+("`"+s+"` supplied to `"+r+"`, expected a single ReactElement."))}return null}return g(t)}function x(){function e(e,t,r,i,a){var o=e[t];if(!n.isValidElementType(o)){var s=M(o);return new h(`Invalid `+i+" `"+a+"` of type "+("`"+s+"` supplied to `"+r+"`, expected a single ReactElement type."))}return null}return g(e)}function S(e){function t(t,n,r,i,a){if(!(t[n]instanceof e)){var o=e.name||f,s=F(t[n]);return new h(`Invalid `+i+" `"+a+"` of type "+("`"+s+"` supplied to `"+r+"`, expected ")+("instance of `"+o+"`."))}return null}return g(t)}function C(e){if(!Array.isArray(e))return process.env.NODE_ENV!==`production`&&(arguments.length>1?s(`Invalid arguments supplied to oneOf, expected an array, got `+arguments.length+` arguments. A common mistake is to write oneOf(x, y, z) instead of oneOf([x, y, z]).`):s(`Invalid argument supplied to oneOf, expected an array.`)),c;function t(t,n,r,i,a){for(var o=t[n],s=0;s<e.length;s++)if(m(o,e[s]))return null;var c=JSON.stringify(e,function(e,t){return N(t)===`symbol`?String(t):t});return new h(`Invalid `+i+" `"+a+"` of value `"+String(o)+"` "+("supplied to `"+r+"`, expected one of "+c+`.`))}return g(t)}function w(e){function t(t,n,r,o,s){if(typeof e!=`function`)return new h("Property `"+s+"` of component `"+r+"` has invalid PropType notation inside objectOf.");var c=t[n],l=M(c);if(l!==`object`)return new h(`Invalid `+o+" `"+s+"` of type "+("`"+l+"` supplied to `"+r+"`, expected an object."));for(var u in c)if(a(c,u)){var d=e(c,u,r,o,s+`.`+u,i);if(d instanceof Error)return d}return null}return g(t)}function T(e){if(!Array.isArray(e))return process.env.NODE_ENV!==`production`&&s(`Invalid argument supplied to oneOfType, expected an instance of array.`),c;for(var t=0;t<e.length;t++){var n=e[t];if(typeof n!=`function`)return s(`Invalid argument supplied to oneOfType. Expected an array of check functions, but received `+P(n)+` at index `+t+`.`),c}function r(t,n,r,o,s){for(var c=[],l=0;l<e.length;l++){var u=e[l],d=u(t,n,r,o,s,i);if(d==null)return null;d.data&&a(d.data,`expectedType`)&&c.push(d.data.expectedType)}var f=c.length>0?`, expected one of type [`+c.join(`, `)+`]`:``;return new h(`Invalid `+o+" `"+s+"` supplied to "+("`"+r+"`"+f+`.`))}return g(r)}function E(){function e(e,t,n,r,i){return A(e[t])?null:new h(`Invalid `+r+" `"+i+"` supplied to "+("`"+n+"`, expected a ReactNode."))}return g(e)}function D(e,t,n,r,i){return new h((e||`React class`)+`: `+t+" type `"+n+`.`+r+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+i+"`.")}function O(e){function t(t,n,r,a,o){var s=t[n],c=M(s);if(c!==`object`)return new h(`Invalid `+a+" `"+o+"` of type `"+c+"` "+("supplied to `"+r+"`, expected `object`."));for(var l in e){var u=e[l];if(typeof u!=`function`)return D(r,a,o,l,N(u));var d=u(s,l,r,a,o+`.`+l,i);if(d)return d}return null}return g(t)}function k(e){function t(t,n,o,s,c){var l=t[n],u=M(l);if(u!==`object`)return new h(`Invalid `+s+" `"+c+"` of type `"+u+"` "+("supplied to `"+o+"`, expected `object`."));for(var d in r({},t[n],e)){var f=e[d];if(a(e,d)&&typeof f!=`function`)return D(o,s,c,d,N(f));if(!f)return new h(`Invalid `+s+" `"+c+"` key `"+d+"` supplied to `"+o+`\`.
|
|
50
|
-
Bad object: `+JSON.stringify(t[n],null,` `)+`
|
|
51
|
-
Valid keys: `+JSON.stringify(Object.keys(e),null,` `));var p=f(l,d,o,s,c+`.`+d,i);if(p)return p}return null}return g(t)}function A(t){switch(typeof t){case`number`:case`string`:case`undefined`:return!0;case`boolean`:return!t;case`object`:if(Array.isArray(t))return t.every(A);if(t===null||e(t))return!0;var n=d(t);if(n){var r=n.call(t),i;if(n!==t.entries){for(;!(i=r.next()).done;)if(!A(i.value))return!1}else for(;!(i=r.next()).done;){var a=i.value;if(a&&!A(a[1]))return!1}}else return!1;return!0;default:return!1}}function j(e,t){return e===`symbol`?!0:t?t[`@@toStringTag`]===`Symbol`||typeof Symbol==`function`&&t instanceof Symbol:!1}function M(e){var t=typeof e;return Array.isArray(e)?`array`:e instanceof RegExp?`object`:j(t,e)?`symbol`:t}function N(e){if(e==null)return``+e;var t=M(e);if(t===`object`){if(e instanceof Date)return`date`;if(e instanceof RegExp)return`regexp`}return t}function P(e){var t=N(e);switch(t){case`array`:case`object`:return`an `+t;case`boolean`:case`date`:case`regexp`:return`a `+t;default:return t}}function F(e){return!e.constructor||!e.constructor.name?f:e.constructor.name}return p.checkPropTypes=o,p.resetWarningCache=o.resetWarningCache,p.PropTypes=p,p}})),Sa=e.t(((e,t)=>{var n=va();function r(){}function i(){}i.resetWarningCache=r,t.exports=function(){function e(e,t,r,i,a,o){if(o!==n){var s=Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw s.name=`Invariant Violation`,s}}e.isRequired=e;function t(){return e}var a={array:e,bigint:e,bool:e,func:e,number:e,object:e,string:e,symbol:e,any:e,arrayOf:t,element:e,elementType:e,instanceOf:t,node:e,objectOf:t,oneOf:t,oneOfType:t,shape:t,exact:t,checkPropTypes:i,resetWarningCache:r};return a.PropTypes=a,a}})),Ca=e.t(((e,t)=>{if(process.env.NODE_ENV!==`production`){var n=ga();t.exports=xa()(n.isElement,!0)}else t.exports=Sa()()})),wa=e.t(((e,t)=>{function n(e){var t,r,i=``;if(typeof e==`string`||typeof e==`number`)i+=e;else if(typeof e==`object`)if(Array.isArray(e)){var a=e.length;for(t=0;t<a;t++)e[t]&&(r=n(e[t]))&&(i&&(i+=` `),i+=r)}else for(r in e)e[r]&&(i&&(i+=` `),i+=r);return i}function r(){for(var e,t,r=0,i=``,a=arguments.length;r<a;r++)(e=arguments[r])&&(t=n(e))&&(i&&(i+=` `),i+=t);return i}t.exports=r,t.exports.clsx=r})),Ta=e.t((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.dontSetMe=a,e.findInArray=t,e.int=i,e.isFunction=n,e.isNum=r;function t(e,t){for(let n=0,r=e.length;n<r;n++)if(t.apply(t,[e[n],n,e]))return e[n]}function n(e){return typeof e==`function`||Object.prototype.toString.call(e)===`[object Function]`}function r(e){return typeof e==`number`&&!isNaN(e)}function i(e){return parseInt(e,10)}function a(e,t,n){if(e[t])return Error(`Invalid prop ${t} passed to ${n} - do not set this, set it on the child.`)}})),Ea=e.t((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.browserPrefixToKey=r,e.browserPrefixToStyle=i,e.default=void 0,e.getPrefix=n;var t=[`Moz`,`Webkit`,`O`,`ms`];function n(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:`transform`;if(typeof window>`u`)return``;let n=window.document?.documentElement?.style;if(!n||e in n)return``;for(let i=0;i<t.length;i++)if(r(e,t[i])in n)return t[i];return``}function r(e,t){return t?`${t}${a(e)}`:e}function i(e,t){return t?`-${t.toLowerCase()}-${e}`:e}function a(e){let t=``,n=!0;for(let r=0;r<e.length;r++)n?(t+=e[r].toUpperCase(),n=!1):e[r]===`-`?n=!0:t+=e[r];return t}e.default=n()})),Da=e.t((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.addClassName=S,e.addEvent=s,e.addUserSelectStyles=y,e.createCSSTransform=m,e.createSVGTransform=h,e.getTouch=_,e.getTouchIdentifier=v,e.getTranslation=g,e.innerHeight=d,e.innerWidth=f,e.matchesSelector=a,e.matchesSelectorAndParentsTo=o,e.offsetXYFromParent=p,e.outerHeight=l,e.outerWidth=u,e.removeClassName=C,e.removeEvent=c,e.scheduleRemoveUserSelectStyles=b;var t=Ta(),n=r(Ea());function r(e,t){if(typeof WeakMap==`function`)var n=new WeakMap,i=new WeakMap;return(r=function(e,t){if(!t&&e&&e.__esModule)return e;var r,a,o={__proto__:null,default:e};if(e===null||typeof e!=`object`&&typeof e!=`function`)return o;if(r=t?i:n){if(r.has(e))return r.get(e);r.set(e,o)}for(let t in e)t!==`default`&&{}.hasOwnProperty.call(e,t)&&((a=(r=Object.defineProperty)&&Object.getOwnPropertyDescriptor(e,t))&&(a.get||a.set)?r(o,t,a):o[t]=e[t]);return o})(e,t)}var i=``;function a(e,n){return i||=(0,t.findInArray)([`matches`,`webkitMatchesSelector`,`mozMatchesSelector`,`msMatchesSelector`,`oMatchesSelector`],function(n){return(0,t.isFunction)(e[n])}),(0,t.isFunction)(e[i])?e[i](n):!1}function o(e,t,n){let r=e;do{if(a(r,t))return!0;if(r===n)return!1;r=r.parentNode}while(r);return!1}function s(e,t,n,r){if(!e)return;let i={capture:!0,...r};e.addEventListener?e.addEventListener(t,n,i):e.attachEvent?e.attachEvent(`on`+t,n):e[`on`+t]=n}function c(e,t,n,r){if(!e)return;let i={capture:!0,...r};e.removeEventListener?e.removeEventListener(t,n,i):e.detachEvent?e.detachEvent(`on`+t,n):e[`on`+t]=null}function l(e){let n=e.clientHeight,r=e.ownerDocument.defaultView.getComputedStyle(e);return n+=(0,t.int)(r.borderTopWidth),n+=(0,t.int)(r.borderBottomWidth),n}function u(e){let n=e.clientWidth,r=e.ownerDocument.defaultView.getComputedStyle(e);return n+=(0,t.int)(r.borderLeftWidth),n+=(0,t.int)(r.borderRightWidth),n}function d(e){let n=e.clientHeight,r=e.ownerDocument.defaultView.getComputedStyle(e);return n-=(0,t.int)(r.paddingTop),n-=(0,t.int)(r.paddingBottom),n}function f(e){let n=e.clientWidth,r=e.ownerDocument.defaultView.getComputedStyle(e);return n-=(0,t.int)(r.paddingLeft),n-=(0,t.int)(r.paddingRight),n}function p(e,t,n){let r=t===t.ownerDocument.body?{left:0,top:0}:t.getBoundingClientRect();return{x:(e.clientX+t.scrollLeft-r.left)/n,y:(e.clientY+t.scrollTop-r.top)/n}}function m(e,t){let r=g(e,t,`px`);return{[(0,n.browserPrefixToKey)(`transform`,n.default)]:r}}function h(e,t){return g(e,t,``)}function g(e,t,n){let{x:r,y:i}=e,a=`translate(${r}${n},${i}${n})`;return t&&(a=`translate(${`${typeof t.x==`string`?t.x:t.x+n}`}, ${`${typeof t.y==`string`?t.y:t.y+n}`})`+a),a}function _(e,n){return e.targetTouches&&(0,t.findInArray)(e.targetTouches,e=>n===e.identifier)||e.changedTouches&&(0,t.findInArray)(e.changedTouches,e=>n===e.identifier)}function v(e){if(e.targetTouches&&e.targetTouches[0])return e.targetTouches[0].identifier;if(e.changedTouches&&e.changedTouches[0])return e.changedTouches[0].identifier}function y(e){if(!e)return;let t=e.getElementById(`react-draggable-style-el`);t||(t=e.createElement(`style`),t.type=`text/css`,t.id=`react-draggable-style-el`,t.innerHTML=`.react-draggable-transparent-selection *::-moz-selection {all: inherit;}
|
|
52
|
-
`,t.innerHTML+=`.react-draggable-transparent-selection *::selection {all: inherit;}
|
|
53
|
-
`,e.getElementsByTagName(`head`)[0].appendChild(t)),e.body&&S(e.body,`react-draggable-transparent-selection`)}function b(e){window.requestAnimationFrame?window.requestAnimationFrame(()=>{x(e)}):x(e)}function x(e){if(e)try{if(e.body&&C(e.body,`react-draggable-transparent-selection`),e.selection)e.selection.empty();else{let t=(e.defaultView||window).getSelection();t&&t.type!==`Caret`&&t.removeAllRanges()}}catch{}}function S(e,t){e.classList?e.classList.add(t):e.className.match(RegExp(`(?:^|\\s)${t}(?!\\S)`))||(e.className+=` ${t}`)}function C(e,t){e.classList?e.classList.remove(t):e.className=e.className.replace(RegExp(`(?:^|\\s)${t}(?!\\S)`,`g`),``)}})),Oa=e.t((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.canDragX=a,e.canDragY=o,e.createCoreData=c,e.createDraggableData=l,e.getBoundPosition=r,e.getControlPosition=s,e.snapToGrid=i;var t=Ta(),n=Da();function r(e,r,i){if(!e.props.bounds)return[r,i];let{bounds:a}=e.props;a=typeof a==`string`?a:u(a);let o=d(e);if(typeof a==`string`){let{ownerDocument:e}=o,r=e.defaultView,i;if(i=a===`parent`?o.parentNode:o.getRootNode().querySelector(a),!(i instanceof r.HTMLElement))throw Error(`Bounds selector "`+a+`" could not find an element.`);let s=i,c=r.getComputedStyle(o),l=r.getComputedStyle(s);a={left:-o.offsetLeft+(0,t.int)(l.paddingLeft)+(0,t.int)(c.marginLeft),top:-o.offsetTop+(0,t.int)(l.paddingTop)+(0,t.int)(c.marginTop),right:(0,n.innerWidth)(s)-(0,n.outerWidth)(o)-o.offsetLeft+(0,t.int)(l.paddingRight)-(0,t.int)(c.marginRight),bottom:(0,n.innerHeight)(s)-(0,n.outerHeight)(o)-o.offsetTop+(0,t.int)(l.paddingBottom)-(0,t.int)(c.marginBottom)}}return(0,t.isNum)(a.right)&&(r=Math.min(r,a.right)),(0,t.isNum)(a.bottom)&&(i=Math.min(i,a.bottom)),(0,t.isNum)(a.left)&&(r=Math.max(r,a.left)),(0,t.isNum)(a.top)&&(i=Math.max(i,a.top)),[r,i]}function i(e,t,n){return[Math.round(t/e[0])*e[0],Math.round(n/e[1])*e[1]]}function a(e){return e.props.axis===`both`||e.props.axis===`x`}function o(e){return e.props.axis===`both`||e.props.axis===`y`}function s(e,t,r){let i=typeof t==`number`?(0,n.getTouch)(e,t):null;if(typeof t==`number`&&!i)return null;let a=d(r),o=r.props.offsetParent||a.offsetParent||a.ownerDocument.body;return(0,n.offsetXYFromParent)(i||e,o,r.props.scale)}function c(e,n,r){let i=!(0,t.isNum)(e.lastX),a=d(e);return i?{node:a,deltaX:0,deltaY:0,lastX:n,lastY:r,x:n,y:r}:{node:a,deltaX:n-e.lastX,deltaY:r-e.lastY,lastX:e.lastX,lastY:e.lastY,x:n,y:r}}function l(e,t){let n=e.props.scale;return{node:t.node,x:e.state.x+t.deltaX/n,y:e.state.y+t.deltaY/n,deltaX:t.deltaX/n,deltaY:t.deltaY/n,lastX:e.state.x,lastY:e.state.y}}function u(e){return{left:e.left,top:e.top,right:e.right,bottom:e.bottom}}function d(e){let t=e.findDOMNode();if(!t)throw Error(`<DraggableCore>: Unmounted during event!`);return t}})),ka=e.t((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.default=t;function t(){}})),Aa=e.t((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.default=void 0;var t=l(require(`react`)),n=c(Ca()),r=c(require(`react-dom`)),i=Da(),a=Oa(),o=Ta(),s=c(ka());function c(e){return e&&e.__esModule?e:{default:e}}function l(e,t){if(typeof WeakMap==`function`)var n=new WeakMap,r=new WeakMap;return(l=function(e,t){if(!t&&e&&e.__esModule)return e;var i,a,o={__proto__:null,default:e};if(e===null||typeof e!=`object`&&typeof e!=`function`)return o;if(i=t?r:n){if(i.has(e))return i.get(e);i.set(e,o)}for(let t in e)t!==`default`&&{}.hasOwnProperty.call(e,t)&&((a=(i=Object.defineProperty)&&Object.getOwnPropertyDescriptor(e,t))&&(a.get||a.set)?i(o,t,a):o[t]=e[t]);return o})(e,t)}function u(e,t,n){return(t=d(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function d(e){var t=f(e,`string`);return typeof t==`symbol`?t:t+``}function f(e,t){if(typeof e!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(typeof r!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}var p={touch:{start:`touchstart`,move:`touchmove`,stop:`touchend`},mouse:{start:`mousedown`,move:`mousemove`,stop:`mouseup`}},m=p.mouse,h=class extends t.Component{constructor(){super(...arguments),u(this,`dragging`,!1),u(this,`lastX`,NaN),u(this,`lastY`,NaN),u(this,`touchIdentifier`,null),u(this,`mounted`,!1),u(this,`handleDragStart`,e=>{if(this.props.onMouseDown(e),!this.props.allowAnyClick&&typeof e.button==`number`&&e.button!==0)return!1;let t=this.findDOMNode();if(!t||!t.ownerDocument||!t.ownerDocument.body)throw Error(`<DraggableCore> not mounted on DragStart!`);let{ownerDocument:n}=t;if(this.props.disabled||!(e.target instanceof n.defaultView.Node)||this.props.handle&&!(0,i.matchesSelectorAndParentsTo)(e.target,this.props.handle,t)||this.props.cancel&&(0,i.matchesSelectorAndParentsTo)(e.target,this.props.cancel,t))return;e.type===`touchstart`&&!this.props.allowMobileScroll&&e.preventDefault();let r=(0,i.getTouchIdentifier)(e);this.touchIdentifier=r;let o=(0,a.getControlPosition)(e,r,this);if(o==null)return;let{x:c,y:l}=o,u=(0,a.createCoreData)(this,c,l);(0,s.default)(`DraggableCore: handleDragStart: %j`,u),(0,s.default)(`calling`,this.props.onStart),!(this.props.onStart(e,u)===!1||this.mounted===!1)&&(this.props.enableUserSelectHack&&(0,i.addUserSelectStyles)(n),this.dragging=!0,this.lastX=c,this.lastY=l,(0,i.addEvent)(n,m.move,this.handleDrag),(0,i.addEvent)(n,m.stop,this.handleDragStop))}),u(this,`handleDrag`,e=>{let t=(0,a.getControlPosition)(e,this.touchIdentifier,this);if(t==null)return;let{x:n,y:r}=t;if(Array.isArray(this.props.grid)){let e=n-this.lastX,t=r-this.lastY;if([e,t]=(0,a.snapToGrid)(this.props.grid,e,t),!e&&!t)return;n=this.lastX+e,r=this.lastY+t}let i=(0,a.createCoreData)(this,n,r);if((0,s.default)(`DraggableCore: handleDrag: %j`,i),this.props.onDrag(e,i)===!1||this.mounted===!1){try{this.handleDragStop(new MouseEvent(`mouseup`))}catch{let e=document.createEvent(`MouseEvents`);e.initMouseEvent(`mouseup`,!0,!0,window,0,0,0,0,0,!1,!1,!1,!1,0,null),this.handleDragStop(e)}return}this.lastX=n,this.lastY=r}),u(this,`handleDragStop`,e=>{if(!this.dragging)return;let t=(0,a.getControlPosition)(e,this.touchIdentifier,this);if(t==null)return;let{x:n,y:r}=t;if(Array.isArray(this.props.grid)){let e=n-this.lastX||0,t=r-this.lastY||0;[e,t]=(0,a.snapToGrid)(this.props.grid,e,t),n=this.lastX+e,r=this.lastY+t}let o=(0,a.createCoreData)(this,n,r);if(this.props.onStop(e,o)===!1||this.mounted===!1)return!1;let c=this.findDOMNode();c&&this.props.enableUserSelectHack&&(0,i.scheduleRemoveUserSelectStyles)(c.ownerDocument),(0,s.default)(`DraggableCore: handleDragStop: %j`,o),this.dragging=!1,this.lastX=NaN,this.lastY=NaN,c&&((0,s.default)(`DraggableCore: Removing handlers`),(0,i.removeEvent)(c.ownerDocument,m.move,this.handleDrag),(0,i.removeEvent)(c.ownerDocument,m.stop,this.handleDragStop))}),u(this,`onMouseDown`,e=>(m=p.mouse,this.handleDragStart(e))),u(this,`onMouseUp`,e=>(m=p.mouse,this.handleDragStop(e))),u(this,`onTouchStart`,e=>(m=p.touch,this.handleDragStart(e))),u(this,`onTouchEnd`,e=>(m=p.touch,this.handleDragStop(e)))}componentDidMount(){this.mounted=!0;let e=this.findDOMNode();e&&(0,i.addEvent)(e,p.touch.start,this.onTouchStart,{passive:!1})}componentWillUnmount(){this.mounted=!1;let e=this.findDOMNode();if(e){let{ownerDocument:t}=e;(0,i.removeEvent)(t,p.mouse.move,this.handleDrag),(0,i.removeEvent)(t,p.touch.move,this.handleDrag),(0,i.removeEvent)(t,p.mouse.stop,this.handleDragStop),(0,i.removeEvent)(t,p.touch.stop,this.handleDragStop),(0,i.removeEvent)(e,p.touch.start,this.onTouchStart,{passive:!1}),this.props.enableUserSelectHack&&(0,i.scheduleRemoveUserSelectStyles)(t)}}findDOMNode(){return this.props?.nodeRef?this.props?.nodeRef?.current:r.default.findDOMNode(this)}render(){return t.cloneElement(t.Children.only(this.props.children),{onMouseDown:this.onMouseDown,onMouseUp:this.onMouseUp,onTouchEnd:this.onTouchEnd})}};e.default=h,u(h,`displayName`,`DraggableCore`),u(h,`propTypes`,{allowAnyClick:n.default.bool,allowMobileScroll:n.default.bool,children:n.default.node.isRequired,disabled:n.default.bool,enableUserSelectHack:n.default.bool,offsetParent:function(e,t){if(e[t]&&e[t].nodeType!==1)throw Error(`Draggable's offsetParent must be a DOM Node.`)},grid:n.default.arrayOf(n.default.number),handle:n.default.string,cancel:n.default.string,nodeRef:n.default.object,onStart:n.default.func,onDrag:n.default.func,onStop:n.default.func,onMouseDown:n.default.func,scale:n.default.number,className:o.dontSetMe,style:o.dontSetMe,transform:o.dontSetMe}),u(h,`defaultProps`,{allowAnyClick:!1,allowMobileScroll:!1,disabled:!1,enableUserSelectHack:!0,onStart:function(){},onDrag:function(){},onStop:function(){},onMouseDown:function(){},scale:1})})),ja=e.t((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),Object.defineProperty(e,`DraggableCore`,{enumerable:!0,get:function(){return c.default}}),e.default=void 0;var t=d(require(`react`)),n=u(Ca()),r=u(require(`react-dom`)),i=wa(),a=Da(),o=Oa(),s=Ta(),c=u(Aa()),l=u(ka());function u(e){return e&&e.__esModule?e:{default:e}}function d(e,t){if(typeof WeakMap==`function`)var n=new WeakMap,r=new WeakMap;return(d=function(e,t){if(!t&&e&&e.__esModule)return e;var i,a,o={__proto__:null,default:e};if(e===null||typeof e!=`object`&&typeof e!=`function`)return o;if(i=t?r:n){if(i.has(e))return i.get(e);i.set(e,o)}for(let t in e)t!==`default`&&{}.hasOwnProperty.call(e,t)&&((a=(i=Object.defineProperty)&&Object.getOwnPropertyDescriptor(e,t))&&(a.get||a.set)?i(o,t,a):o[t]=e[t]);return o})(e,t)}function f(){return f=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},f.apply(null,arguments)}function p(e,t,n){return(t=m(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function m(e){var t=h(e,`string`);return typeof t==`symbol`?t:t+``}function h(e,t){if(typeof e!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(typeof r!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}var g=class extends t.Component{static getDerivedStateFromProps(e,t){let{position:n}=e,{prevPropsPosition:r}=t;return n&&(!r||n.x!==r.x||n.y!==r.y)?((0,l.default)(`Draggable: getDerivedStateFromProps %j`,{position:n,prevPropsPosition:r}),{x:n.x,y:n.y,prevPropsPosition:{...n}}):null}constructor(e){super(e),p(this,`onDragStart`,(e,t)=>{if((0,l.default)(`Draggable: onDragStart: %j`,t),this.props.onStart(e,(0,o.createDraggableData)(this,t))===!1)return!1;this.setState({dragging:!0,dragged:!0})}),p(this,`onDrag`,(e,t)=>{if(!this.state.dragging)return!1;(0,l.default)(`Draggable: onDrag: %j`,t);let n=(0,o.createDraggableData)(this,t),r={x:n.x,y:n.y,slackX:0,slackY:0};if(this.props.bounds){let{x:e,y:t}=r;r.x+=this.state.slackX,r.y+=this.state.slackY;let[i,a]=(0,o.getBoundPosition)(this,r.x,r.y);r.x=i,r.y=a,r.slackX=this.state.slackX+(e-r.x),r.slackY=this.state.slackY+(t-r.y),n.x=r.x,n.y=r.y,n.deltaX=r.x-this.state.x,n.deltaY=r.y-this.state.y}if(this.props.onDrag(e,n)===!1)return!1;this.setState(r)}),p(this,`onDragStop`,(e,t)=>{if(!this.state.dragging||this.props.onStop(e,(0,o.createDraggableData)(this,t))===!1)return!1;(0,l.default)(`Draggable: onDragStop: %j`,t);let n={dragging:!1,slackX:0,slackY:0};if(this.props.position){let{x:e,y:t}=this.props.position;n.x=e,n.y=t}this.setState(n)}),this.state={dragging:!1,dragged:!1,x:e.position?e.position.x:e.defaultPosition.x,y:e.position?e.position.y:e.defaultPosition.y,prevPropsPosition:{...e.position},slackX:0,slackY:0,isElementSVG:!1},e.position&&!(e.onDrag||e.onStop)&&console.warn("A `position` was applied to this <Draggable>, without drag handlers. This will make this component effectively undraggable. Please attach `onDrag` or `onStop` handlers so you can adjust the `position` of this element.")}componentDidMount(){window.SVGElement!==void 0&&this.findDOMNode()instanceof window.SVGElement&&this.setState({isElementSVG:!0})}componentWillUnmount(){this.state.dragging&&this.setState({dragging:!1})}findDOMNode(){return this.props?.nodeRef?.current??r.default.findDOMNode(this)}render(){let{axis:e,bounds:n,children:r,defaultPosition:s,defaultClassName:l,defaultClassNameDragging:u,defaultClassNameDragged:d,position:p,positionOffset:m,scale:h,...g}=this.props,_={},v=null,y=!p||this.state.dragging,b=p||s,x={x:(0,o.canDragX)(this)&&y?this.state.x:b.x,y:(0,o.canDragY)(this)&&y?this.state.y:b.y};this.state.isElementSVG?v=(0,a.createSVGTransform)(x,m):_=(0,a.createCSSTransform)(x,m);let S=(0,i.clsx)(r.props.className||``,l,{[u]:this.state.dragging,[d]:this.state.dragged});return t.createElement(c.default,f({},g,{onStart:this.onDragStart,onDrag:this.onDrag,onStop:this.onDragStop}),t.cloneElement(t.Children.only(r),{className:S,style:{...r.props.style,..._},transform:v}))}};e.default=g,p(g,`displayName`,`Draggable`),p(g,`propTypes`,{...c.default.propTypes,axis:n.default.oneOf([`both`,`x`,`y`,`none`]),bounds:n.default.oneOfType([n.default.shape({left:n.default.number,right:n.default.number,top:n.default.number,bottom:n.default.number}),n.default.string,n.default.oneOf([!1])]),defaultClassName:n.default.string,defaultClassNameDragging:n.default.string,defaultClassNameDragged:n.default.string,defaultPosition:n.default.shape({x:n.default.number,y:n.default.number}),positionOffset:n.default.shape({x:n.default.oneOfType([n.default.number,n.default.string]),y:n.default.oneOfType([n.default.number,n.default.string])}),position:n.default.shape({x:n.default.number,y:n.default.number}),className:s.dontSetMe,style:s.dontSetMe,transform:s.dontSetMe}),p(g,`defaultProps`,{...c.default.defaultProps,axis:`both`,bounds:!1,defaultClassName:`react-draggable`,defaultClassNameDragging:`react-draggable-dragging`,defaultClassNameDragged:`react-draggable-dragged`,defaultPosition:{x:0,y:0},scale:1})})),Ma=e.t(((e,t)=>{var{default:n,DraggableCore:r}=ja();t.exports=n,t.exports.default=n,t.exports.DraggableCore=r})),Na=e.a(Ma()),X=function(){return X=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n],t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},X.apply(this,arguments)},Pa={width:`100%`,height:`10px`,top:`0px`,left:`0px`,cursor:`row-resize`},Fa={width:`10px`,height:`100%`,top:`0px`,left:`0px`,cursor:`col-resize`},Ia={width:`20px`,height:`20px`,position:`absolute`,zIndex:1},La={top:X(X({},Pa),{top:`-5px`}),right:X(X({},Fa),{left:void 0,right:`-5px`}),bottom:X(X({},Pa),{top:void 0,bottom:`-5px`}),left:X(X({},Fa),{left:`-5px`}),topRight:X(X({},Ia),{right:`-10px`,top:`-10px`,cursor:`ne-resize`}),bottomRight:X(X({},Ia),{right:`-10px`,bottom:`-10px`,cursor:`se-resize`}),bottomLeft:X(X({},Ia),{left:`-10px`,bottom:`-10px`,cursor:`sw-resize`}),topLeft:X(X({},Ia),{left:`-10px`,top:`-10px`,cursor:`nw-resize`})},Ra=(0,B.memo)(function(e){var t=e.onResizeStart,n=e.direction,r=e.children,i=e.replaceStyles,a=e.className,o=(0,B.useCallback)(function(e){t(e,n)},[t,n]),s=(0,B.useCallback)(function(e){t(e,n)},[t,n]),c=(0,B.useMemo)(function(){return X(X({position:`absolute`,userSelect:`none`},La[n]),i??{})},[i,n]);return(0,V.jsx)(`div`,{className:a||void 0,style:c,onMouseDown:o,onTouchStart:s,children:r})}),za=(function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},e(t,n)};return function(t,n){if(typeof n!=`function`&&n!==null)throw TypeError(`Class extends value `+String(n)+` is not a constructor or null`);e(t,n);function r(){this.constructor=t}t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}})(),Z=function(){return Z=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n],t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},Z.apply(this,arguments)},Ba={width:`auto`,height:`auto`},Va=function(e,t,n){return Math.max(Math.min(e,n),t)},Ha=function(e,t,n){var r=Math.round(e/t);return r*t+n*(r-1)},Ua=function(e,t){return new RegExp(e,`i`).test(t)},Wa=function(e){return!!(e.touches&&e.touches.length)},Ga=function(e){return!!((e.clientX||e.clientX===0)&&(e.clientY||e.clientY===0))},Ka=function(e,t,n){n===void 0&&(n=0);var r=t.reduce(function(n,r,i){return Math.abs(r-e)<Math.abs(t[n]-e)?i:n},0),i=Math.abs(t[r]-e);return n===0||i<n?t[r]:e},qa=function(e){return e=e.toString(),e===`auto`||e.endsWith(`px`)||e.endsWith(`%`)||e.endsWith(`vh`)||e.endsWith(`vw`)||e.endsWith(`vmax`)||e.endsWith(`vmin`)?e:`${e}px`},Ja=function(e,t,n,r){if(e&&typeof e==`string`){if(e.endsWith(`px`))return Number(e.replace(`px`,``));if(e.endsWith(`%`)){var i=Number(e.replace(`%`,``))/100;return t*i}if(e.endsWith(`vw`)){var i=Number(e.replace(`vw`,``))/100;return n*i}if(e.endsWith(`vh`)){var i=Number(e.replace(`vh`,``))/100;return r*i}}return e},Ya=function(e,t,n,r,i,a,o){return r=Ja(r,e.width,t,n),i=Ja(i,e.height,t,n),a=Ja(a,e.width,t,n),o=Ja(o,e.height,t,n),{maxWidth:r===void 0?void 0:Number(r),maxHeight:i===void 0?void 0:Number(i),minWidth:a===void 0?void 0:Number(a),minHeight:o===void 0?void 0:Number(o)}},Xa=function(e){return Array.isArray(e)?e:[e,e]},Za=`as.ref.style.className.grid.gridGap.snap.bounds.boundsByDirection.size.defaultSize.minWidth.minHeight.maxWidth.maxHeight.lockAspectRatio.lockAspectRatioExtraWidth.lockAspectRatioExtraHeight.enable.handleStyles.handleClasses.handleWrapperStyle.handleWrapperClass.children.onResizeStart.onResize.onResizeStop.handleComponent.scale.resizeRatio.snapGap`.split(`.`),Qa=`__resizable_base__`,$a=function(e){za(t,e);function t(t){var n=e.call(this,t)||this;return n.ratio=1,n.resizable=null,n.parentLeft=0,n.parentTop=0,n.resizableLeft=0,n.resizableRight=0,n.resizableTop=0,n.resizableBottom=0,n.targetLeft=0,n.targetTop=0,n.delta={width:0,height:0},n.appendBase=function(){if(!n.resizable||!n.window)return null;var e=n.parentNode;if(!e)return null;var t=n.window.document.createElement(`div`);return t.style.width=`100%`,t.style.height=`100%`,t.style.position=`absolute`,t.style.transform=`scale(0, 0)`,t.style.left=`0`,t.style.flex=`0 0 100%`,t.classList?t.classList.add(Qa):t.className+=Qa,e.appendChild(t),t},n.removeBase=function(e){var t=n.parentNode;t&&t.removeChild(e)},n.state={isResizing:!1,width:n.propsSize?.width??`auto`,height:n.propsSize?.height??`auto`,direction:`right`,original:{x:0,y:0,width:0,height:0},backgroundStyle:{height:`100%`,width:`100%`,backgroundColor:`rgba(0,0,0,0)`,cursor:`auto`,opacity:0,position:`fixed`,zIndex:9999,top:`0`,left:`0`,bottom:`0`,right:`0`},flexBasis:void 0},n.onResizeStart=n.onResizeStart.bind(n),n.onMouseMove=n.onMouseMove.bind(n),n.onMouseUp=n.onMouseUp.bind(n),n}return Object.defineProperty(t.prototype,`parentNode`,{get:function(){return this.resizable?this.resizable.parentNode:null},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,`window`,{get:function(){return!this.resizable||!this.resizable.ownerDocument?null:this.resizable.ownerDocument.defaultView},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,`propsSize`,{get:function(){return this.props.size||this.props.defaultSize||Ba},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,`size`,{get:function(){var e=0,t=0;if(this.resizable&&this.window){var n=this.resizable.offsetWidth,r=this.resizable.offsetHeight,i=this.resizable.style.position;i!==`relative`&&(this.resizable.style.position=`relative`),e=this.resizable.style.width===`auto`?n:this.resizable.offsetWidth,t=this.resizable.style.height===`auto`?r:this.resizable.offsetHeight,this.resizable.style.position=i}return{width:e,height:t}},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,`sizeStyle`,{get:function(){var e=this,t=this.props.size,n=function(t){if(e.state[t]===void 0||e.state[t]===`auto`)return`auto`;if(e.propsSize&&e.propsSize[t]&&e.propsSize[t]?.toString().endsWith(`%`)){if(e.state[t].toString().endsWith(`%`))return e.state[t].toString();var n=e.getParentSize();return`${Number(e.state[t].toString().replace(`px`,``))/n[t]*100}%`}return qa(e.state[t])};return{width:t&&t.width!==void 0&&!this.state.isResizing?qa(t.width):n(`width`),height:t&&t.height!==void 0&&!this.state.isResizing?qa(t.height):n(`height`)}},enumerable:!1,configurable:!0}),t.prototype.getParentSize=function(){if(!this.parentNode)return this.window?{width:this.window.innerWidth,height:this.window.innerHeight}:{width:0,height:0};var e=this.appendBase();if(!e)return{width:0,height:0};var t=!1,n=this.parentNode.style.flexWrap;n!==`wrap`&&(t=!0,this.parentNode.style.flexWrap=`wrap`),e.style.position=`relative`,e.style.minWidth=`100%`,e.style.minHeight=`100%`;var r={width:e.offsetWidth,height:e.offsetHeight};return t&&(this.parentNode.style.flexWrap=n),this.removeBase(e),r},t.prototype.bindEvents=function(){this.window&&(this.window.addEventListener(`mouseup`,this.onMouseUp),this.window.addEventListener(`mousemove`,this.onMouseMove),this.window.addEventListener(`mouseleave`,this.onMouseUp),this.window.addEventListener(`touchmove`,this.onMouseMove,{capture:!0,passive:!1}),this.window.addEventListener(`touchend`,this.onMouseUp))},t.prototype.unbindEvents=function(){this.window&&(this.window.removeEventListener(`mouseup`,this.onMouseUp),this.window.removeEventListener(`mousemove`,this.onMouseMove),this.window.removeEventListener(`mouseleave`,this.onMouseUp),this.window.removeEventListener(`touchmove`,this.onMouseMove,!0),this.window.removeEventListener(`touchend`,this.onMouseUp))},t.prototype.componentDidMount=function(){if(!(!this.resizable||!this.window)){var e=this.window.getComputedStyle(this.resizable);this.setState({width:this.state.width||this.size.width,height:this.state.height||this.size.height,flexBasis:e.flexBasis===`auto`?void 0:e.flexBasis})}},t.prototype.componentWillUnmount=function(){this.window&&this.unbindEvents()},t.prototype.createSizeForCssProperty=function(e,t){var n=this.propsSize&&this.propsSize[t];return this.state[t]===`auto`&&this.state.original[t]===e&&(n===void 0||n===`auto`)?`auto`:e},t.prototype.calculateNewMaxFromBoundary=function(e,t){var n=this.props.boundsByDirection,r=this.state.direction,i=n&&Ua(`left`,r),a=n&&Ua(`top`,r),o,s;if(this.props.bounds===`parent`){var c=this.parentNode;c&&(o=i?this.resizableRight-this.parentLeft:c.offsetWidth+(this.parentLeft-this.resizableLeft),s=a?this.resizableBottom-this.parentTop:c.offsetHeight+(this.parentTop-this.resizableTop))}else this.props.bounds===`window`?this.window&&(o=i?this.resizableRight:this.window.innerWidth-this.resizableLeft,s=a?this.resizableBottom:this.window.innerHeight-this.resizableTop):this.props.bounds&&(o=i?this.resizableRight-this.targetLeft:this.props.bounds.offsetWidth+(this.targetLeft-this.resizableLeft),s=a?this.resizableBottom-this.targetTop:this.props.bounds.offsetHeight+(this.targetTop-this.resizableTop));return o&&Number.isFinite(o)&&(e=e&&e<o?e:o),s&&Number.isFinite(s)&&(t=t&&t<s?t:s),{maxWidth:e,maxHeight:t}},t.prototype.calculateNewSizeFromDirection=function(e,t){var n=this.props.scale||1,r=Xa(this.props.resizeRatio||1),i=r[0],a=r[1],o=this.state,s=o.direction,c=o.original,l=this.props,u=l.lockAspectRatio,d=l.lockAspectRatioExtraHeight,f=l.lockAspectRatioExtraWidth,p=c.width,m=c.height,h=d||0,g=f||0;return Ua(`right`,s)&&(p=c.width+(e-c.x)*i/n,u&&(m=(p-g)/this.ratio+h)),Ua(`left`,s)&&(p=c.width-(e-c.x)*i/n,u&&(m=(p-g)/this.ratio+h)),Ua(`bottom`,s)&&(m=c.height+(t-c.y)*a/n,u&&(p=(m-h)*this.ratio+g)),Ua(`top`,s)&&(m=c.height-(t-c.y)*a/n,u&&(p=(m-h)*this.ratio+g)),{newWidth:p,newHeight:m}},t.prototype.calculateNewSizeFromAspectRatio=function(e,t,n,r){var i=this.props,a=i.lockAspectRatio,o=i.lockAspectRatioExtraHeight,s=i.lockAspectRatioExtraWidth,c=r.width===void 0?10:r.width,l=n.width===void 0||n.width<0?e:n.width,u=r.height===void 0?10:r.height,d=n.height===void 0||n.height<0?t:n.height,f=o||0,p=s||0;if(a){var m=(u-f)*this.ratio+p,h=(d-f)*this.ratio+p,g=(c-p)/this.ratio+f,_=(l-p)/this.ratio+f,v=Math.max(c,m),y=Math.min(l,h),b=Math.max(u,g),x=Math.min(d,_);e=Va(e,v,y),t=Va(t,b,x)}else e=Va(e,c,l),t=Va(t,u,d);return{newWidth:e,newHeight:t}},t.prototype.setBoundingClientRect=function(){var e=1/(this.props.scale||1);if(this.props.bounds===`parent`){var t=this.parentNode;if(t){var n=t.getBoundingClientRect();this.parentLeft=n.left*e,this.parentTop=n.top*e}}if(this.props.bounds&&typeof this.props.bounds!=`string`){var r=this.props.bounds.getBoundingClientRect();this.targetLeft=r.left*e,this.targetTop=r.top*e}if(this.resizable){var i=this.resizable.getBoundingClientRect(),a=i.left,o=i.top,s=i.right,c=i.bottom;this.resizableLeft=a*e,this.resizableRight=s*e,this.resizableTop=o*e,this.resizableBottom=c*e}},t.prototype.onResizeStart=function(e,t){if(!(!this.resizable||!this.window)){var n=0,r=0;if(e.nativeEvent&&Ga(e.nativeEvent)?(n=e.nativeEvent.clientX,r=e.nativeEvent.clientY):e.nativeEvent&&Wa(e.nativeEvent)&&(n=e.nativeEvent.touches[0].clientX,r=e.nativeEvent.touches[0].clientY),!(this.props.onResizeStart&&this.resizable&&this.props.onResizeStart(e,t,this.resizable)===!1)){this.props.size&&(this.props.size.height!==void 0&&this.props.size.height!==this.state.height&&this.setState({height:this.props.size.height}),this.props.size.width!==void 0&&this.props.size.width!==this.state.width&&this.setState({width:this.props.size.width})),this.ratio=typeof this.props.lockAspectRatio==`number`?this.props.lockAspectRatio:this.size.width/this.size.height;var i,a=this.window.getComputedStyle(this.resizable);if(a.flexBasis!==`auto`){var o=this.parentNode;o&&(this.flexDir=this.window.getComputedStyle(o).flexDirection.startsWith(`row`)?`row`:`column`,i=a.flexBasis)}this.setBoundingClientRect(),this.bindEvents();var s={original:{x:n,y:r,width:this.size.width,height:this.size.height},isResizing:!0,backgroundStyle:Z(Z({},this.state.backgroundStyle),{cursor:this.window.getComputedStyle(e.target).cursor||`auto`}),direction:t,flexBasis:i};this.setState(s)}}},t.prototype.onMouseMove=function(e){var t=this;if(!(!this.state.isResizing||!this.resizable||!this.window)){if(this.window.TouchEvent&&Wa(e))try{e.preventDefault(),e.stopPropagation()}catch{}var n=this.props,r=n.maxWidth,i=n.maxHeight,a=n.minWidth,o=n.minHeight,s=Wa(e)?e.touches[0].clientX:e.clientX,c=Wa(e)?e.touches[0].clientY:e.clientY,l=this.state,u=l.direction,d=l.original,f=l.width,p=l.height,m=this.getParentSize(),h=Ya(m,this.window.innerWidth,this.window.innerHeight,r,i,a,o);r=h.maxWidth,i=h.maxHeight,a=h.minWidth,o=h.minHeight;var g=this.calculateNewSizeFromDirection(s,c),_=g.newHeight,v=g.newWidth,y=this.calculateNewMaxFromBoundary(r,i);this.props.snap&&this.props.snap.x&&(v=Ka(v,this.props.snap.x,this.props.snapGap)),this.props.snap&&this.props.snap.y&&(_=Ka(_,this.props.snap.y,this.props.snapGap));var b=this.calculateNewSizeFromAspectRatio(v,_,{width:y.maxWidth,height:y.maxHeight},{width:a,height:o});if(v=b.newWidth,_=b.newHeight,this.props.grid){var x=Ha(v,this.props.grid[0],this.props.gridGap?this.props.gridGap[0]:0),S=Ha(_,this.props.grid[1],this.props.gridGap?this.props.gridGap[1]:0),C=this.props.snapGap||0,w=C===0||Math.abs(x-v)<=C?x:v,T=C===0||Math.abs(S-_)<=C?S:_;v=w,_=T}var E={width:v-d.width,height:_-d.height};if(this.delta=E,f&&typeof f==`string`){if(f.endsWith(`%`)){var D=v/m.width*100;v=`${D}%`}else if(f.endsWith(`vw`)){var O=v/this.window.innerWidth*100;v=`${O}vw`}else if(f.endsWith(`vh`)){var k=v/this.window.innerHeight*100;v=`${k}vh`}}if(p&&typeof p==`string`){if(p.endsWith(`%`)){var D=_/m.height*100;_=`${D}%`}else if(p.endsWith(`vw`)){var O=_/this.window.innerWidth*100;_=`${O}vw`}else if(p.endsWith(`vh`)){var k=_/this.window.innerHeight*100;_=`${k}vh`}}var A={width:this.createSizeForCssProperty(v,`width`),height:this.createSizeForCssProperty(_,`height`)};this.flexDir===`row`?A.flexBasis=A.width:this.flexDir===`column`&&(A.flexBasis=A.height);var j=this.state.width!==A.width,M=this.state.height!==A.height,N=this.state.flexBasis!==A.flexBasis,P=j||M||N;P&&(0,ce.flushSync)(function(){t.setState(A)}),this.props.onResize&&P&&this.props.onResize(e,u,this.resizable,E)}},t.prototype.onMouseUp=function(e){var t=this.state,n=t.isResizing,r=t.direction;t.original,!(!n||!this.resizable)&&(this.props.onResizeStop&&this.props.onResizeStop(e,r,this.resizable,this.delta),this.props.size&&this.setState({width:this.props.size.width??`auto`,height:this.props.size.height??`auto`}),this.unbindEvents(),this.setState({isResizing:!1,backgroundStyle:Z(Z({},this.state.backgroundStyle),{cursor:`auto`})}))},t.prototype.updateSize=function(e){this.setState({width:e.width??`auto`,height:e.height??`auto`})},t.prototype.renderResizer=function(){var e=this,t=this.props,n=t.enable,r=t.handleStyles,i=t.handleClasses,a=t.handleWrapperStyle,o=t.handleWrapperClass,s=t.handleComponent;return n?(0,V.jsx)(`div`,{className:o,style:a,children:Object.keys(n).map(function(t){return n[t]===!1?null:(0,V.jsx)(Ra,{direction:t,onResizeStart:e.onResizeStart,replaceStyles:r&&r[t],className:i&&i[t],children:s&&s[t]?s[t]:null},t)})}):null},t.prototype.render=function(){var e=this,t=Object.keys(this.props).reduce(function(t,n){return Za.indexOf(n)===-1&&(t[n]=e.props[n]),t},{}),n=Z(Z(Z({position:`relative`,userSelect:this.state.isResizing?`none`:`auto`},this.props.style),this.sizeStyle),{maxWidth:this.props.maxWidth,maxHeight:this.props.maxHeight,minWidth:this.props.minWidth,minHeight:this.props.minHeight,boxSizing:`border-box`,flexShrink:0});return this.state.flexBasis&&(n.flexBasis=this.state.flexBasis),(0,V.jsxs)(this.props.as||`div`,Z({style:n,className:this.props.className},t,{ref:function(t){t&&(e.resizable=t)},children:[this.state.isResizing&&(0,V.jsx)(`div`,{style:this.state.backgroundStyle}),this.props.children,this.renderResizer()]}))},t.defaultProps={as:`div`,onResizeStart:function(){},onResize:function(){},onResizeStop:function(){},enable:{top:!0,right:!0,bottom:!0,left:!0,topRight:!0,bottomRight:!0,bottomLeft:!0,topLeft:!0},style:{},grid:[1,1],gridGap:[0,0],lockAspectRatio:!1,lockAspectRatioExtraWidth:0,lockAspectRatioExtraHeight:0,scale:1,resizeRatio:1,snapGap:0},t}(B.PureComponent),eo=function(e,t){return eo=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])},eo(e,t)};function to(e,t){eo(e,t);function n(){this.constructor=e}e.prototype=t===null?Object.create(t):(n.prototype=t.prototype,new n)}var Q=function(){return Q=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n],t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},Q.apply(this,arguments)};function no(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols==`function`)for(var i=0,r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]]);return n}var ro={width:`auto`,height:`auto`,display:`inline-block`,position:`absolute`,top:0,left:0},io=function(e){return{bottom:e,bottomLeft:e,bottomRight:e,left:e,right:e,top:e,topLeft:e,topRight:e}},ao=function(e){to(t,e);function t(t){var n=e.call(this,t)||this;return n.resizingPosition={x:0,y:0},n.offsetFromParent={left:0,top:0},n.resizableElement={current:null},n.originalPosition={x:0,y:0},n.state={resizing:!1,bounds:{top:0,right:0,bottom:0,left:0},maxWidth:t.maxWidth,maxHeight:t.maxHeight},n.onResizeStart=n.onResizeStart.bind(n),n.onResize=n.onResize.bind(n),n.onResizeStop=n.onResizeStop.bind(n),n.onDragStart=n.onDragStart.bind(n),n.onDrag=n.onDrag.bind(n),n.onDragStop=n.onDragStop.bind(n),n.getMaxSizesFromProps=n.getMaxSizesFromProps.bind(n),n}return t.prototype.componentDidMount=function(){this.updateOffsetFromParent();var e=this.offsetFromParent,t=e.left,n=e.top,r=this.getDraggablePosition(),i=r.x,a=r.y;this.draggable.setState({x:i-t,y:a-n}),this.forceUpdate()},t.prototype.getDraggablePosition=function(){var e=this.draggable.state;return{x:e.x,y:e.y}},t.prototype.getParent=function(){return this.resizable&&this.resizable.parentNode},t.prototype.getParentSize=function(){return this.resizable.getParentSize()},t.prototype.getMaxSizesFromProps=function(){return{maxWidth:this.props.maxWidth===void 0?2**53-1:this.props.maxWidth,maxHeight:this.props.maxHeight===void 0?2**53-1:this.props.maxHeight}},t.prototype.getSelfElement=function(){return this.resizable&&this.resizable.resizable},t.prototype.getOffsetHeight=function(e){var t=this.props.scale;switch(this.props.bounds){case`window`:return window.innerHeight/t;case`body`:return document.body.offsetHeight/t;default:return e.offsetHeight}},t.prototype.getOffsetWidth=function(e){var t=this.props.scale;switch(this.props.bounds){case`window`:return window.innerWidth/t;case`body`:return document.body.offsetWidth/t;default:return e.offsetWidth}},t.prototype.onDragStart=function(e,t){if(this.props.onDragStart&&this.props.onDragStart(e,t)===!1)return!1;if(this.originalPosition=this.getDraggablePosition(),this.props.bounds){var n=this.getParent(),r=this.props.scale,i;if(this.props.bounds===`parent`)i=n;else if(this.props.bounds===`body`){var a=n.getBoundingClientRect(),o=a.left,s=a.top,c=document.body.getBoundingClientRect(),l=-(o-n.offsetLeft*r-c.left)/r,u=-(s-n.offsetTop*r-c.top)/r,d=(document.body.offsetWidth-this.resizable.size.width*r)/r+l,f=(document.body.offsetHeight-this.resizable.size.height*r)/r+u;return this.setState({bounds:{top:u,right:d,bottom:f,left:l}})}else if(this.props.bounds===`window`){if(!this.resizable)return;var p=n.getBoundingClientRect(),m=p.left,h=p.top,g=-(m-n.offsetLeft*r)/r,_=-(h-n.offsetTop*r)/r,d=(window.innerWidth-this.resizable.size.width*r)/r+g,f=(window.innerHeight-this.resizable.size.height*r)/r+_;return this.setState({bounds:{top:_,right:d,bottom:f,left:g}})}else typeof this.props.bounds==`string`?i=document.querySelector(this.props.bounds):this.props.bounds instanceof HTMLElement&&(i=this.props.bounds);if(!(!(i instanceof HTMLElement)||!(n instanceof HTMLElement))){var v=i.getBoundingClientRect(),y=v.left,b=v.top,x=n.getBoundingClientRect(),S=x.left,C=x.top,w=(y-S)/r,T=b-C;if(this.resizable){this.updateOffsetFromParent();var E=this.offsetFromParent;this.setState({bounds:{top:T-E.top,right:w+(i.offsetWidth-this.resizable.size.width)-E.left/r,bottom:T+(i.offsetHeight-this.resizable.size.height)-E.top,left:w-E.left/r}})}}}},t.prototype.onDrag=function(e,t){if(this.props.onDrag){var n=this.offsetFromParent,r=n.left,i=n.top;if(!this.props.dragAxis||this.props.dragAxis===`both`)return this.props.onDrag(e,Q(Q({},t),{x:t.x+r,y:t.y+i}));if(this.props.dragAxis===`x`)return this.props.onDrag(e,Q(Q({},t),{x:t.x+r,y:this.originalPosition.y+i,deltaY:0}));if(this.props.dragAxis===`y`)return this.props.onDrag(e,Q(Q({},t),{x:this.originalPosition.x+r,y:t.y+i,deltaX:0}))}},t.prototype.onDragStop=function(e,t){if(this.props.onDragStop){var n=this.offsetFromParent,r=n.left,i=n.top;if(!this.props.dragAxis||this.props.dragAxis===`both`)return this.props.onDragStop(e,Q(Q({},t),{x:t.x+r,y:t.y+i}));if(this.props.dragAxis===`x`)return this.props.onDragStop(e,Q(Q({},t),{x:t.x+r,y:this.originalPosition.y+i,deltaY:0}));if(this.props.dragAxis===`y`)return this.props.onDragStop(e,Q(Q({},t),{x:this.originalPosition.x+r,y:t.y+i,deltaX:0}))}},t.prototype.onResizeStart=function(e,t,n){if(this.props.onResizeStart&&this.props.onResizeStart(e,t,n)===!1)return!1;e.stopPropagation(),this.setState({resizing:!0});var r=this.props.scale,i=this.offsetFromParent,a=this.getDraggablePosition();if(this.resizingPosition={x:a.x+i.left,y:a.y+i.top},this.originalPosition=a,this.props.bounds){var o=this.getParent(),s=void 0;this.props.bounds===`parent`?s=o:this.props.bounds===`body`?s=document.body:this.props.bounds===`window`?s=window:typeof this.props.bounds==`string`?s=document.querySelector(this.props.bounds):this.props.bounds instanceof HTMLElement&&(s=this.props.bounds);var c=this.getSelfElement();if(c instanceof Element&&(s instanceof HTMLElement||s===window)&&o instanceof HTMLElement){var l=this.getMaxSizesFromProps(),u=l.maxWidth,d=l.maxHeight,f=this.getParentSize();if(u&&typeof u==`string`)if(u.endsWith(`%`)){var p=Number(u.replace(`%`,``))/100;u=f.width*p}else u.endsWith(`px`)&&(u=Number(u.replace(`px`,``)));if(d&&typeof d==`string`)if(d.endsWith(`%`)){var p=Number(d.replace(`%`,``))/100;d=f.height*p}else d.endsWith(`px`)&&(d=Number(d.replace(`px`,``)));var m=c.getBoundingClientRect(),h=m.left,g=m.top,_=this.props.bounds===`window`?{left:0,top:0}:s.getBoundingClientRect(),v=_.left,y=_.top,b=this.getOffsetWidth(s),x=this.getOffsetHeight(s),S=t.toLowerCase().endsWith(`left`),C=t.toLowerCase().endsWith(`right`),w=t.startsWith(`top`),T=t.startsWith(`bottom`);if((S||w)&&this.resizable){var E=(h-v)/r+this.resizable.size.width;this.setState({maxWidth:E>Number(u)?u:E})}if(C||this.props.lockAspectRatio&&!S&&!w){var E=b+(v-h)/r;this.setState({maxWidth:E>Number(u)?u:E})}if((w||S)&&this.resizable){var E=(g-y)/r+this.resizable.size.height;this.setState({maxHeight:E>Number(d)?d:E})}if(T||this.props.lockAspectRatio&&!w&&!S){var E=x+(y-g)/r;this.setState({maxHeight:E>Number(d)?d:E})}}}else this.setState({maxWidth:this.props.maxWidth,maxHeight:this.props.maxHeight})},t.prototype.onResize=function(e,t,n,r){var i=this,a={x:this.originalPosition.x,y:this.originalPosition.y},o=-r.width,s=-r.height;[`top`,`left`,`topLeft`,`bottomLeft`,`topRight`].includes(t)&&(t===`bottomLeft`?a.x+=o:(t===`topRight`||(a.x+=o),a.y+=s));var c=this.draggable.state;(a.x!==c.x||a.y!==c.y)&&(0,ce.flushSync)(function(){i.draggable.setState(a)}),this.updateOffsetFromParent();var l=this.offsetFromParent,u=this.getDraggablePosition().x+l.left,d=this.getDraggablePosition().y+l.top;this.resizingPosition={x:u,y:d},this.props.onResize&&this.props.onResize(e,t,n,r,{x:u,y:d})},t.prototype.onResizeStop=function(e,t,n,r){this.setState({resizing:!1});var i=this.getMaxSizesFromProps(),a=i.maxWidth,o=i.maxHeight;this.setState({maxWidth:a,maxHeight:o}),this.props.onResizeStop&&this.props.onResizeStop(e,t,n,r,this.resizingPosition)},t.prototype.updateSize=function(e){this.resizable&&this.resizable.updateSize({width:e.width,height:e.height})},t.prototype.updatePosition=function(e){this.draggable.setState(e)},t.prototype.updateOffsetFromParent=function(){var e=this.props.scale,t=this.getParent(),n=this.getSelfElement();if(!t||n===null)return{top:0,left:0};var r=t.getBoundingClientRect(),i=r.left,a=r.top,o=n.getBoundingClientRect(),s=this.getDraggablePosition(),c=t.scrollLeft,l=t.scrollTop;this.offsetFromParent={left:o.left-i+c-s.x*e,top:o.top-a+l-s.y*e}},t.prototype.render=function(){var e=this,t=this.props,n=t.disableDragging,r=t.style,i=t.dragHandleClassName,a=t.position,o=t.onMouseDown,s=t.onMouseUp,c=t.dragAxis,l=t.dragGrid,u=t.bounds,d=t.enableUserSelectHack,f=t.cancel,p=t.children;t.onResizeStart,t.onResize,t.onResizeStop,t.onDragStart,t.onDrag,t.onDragStop;var m=t.resizeHandleStyles,h=t.resizeHandleClasses,g=t.resizeHandleComponent,_=t.enableResizing,v=t.resizeGrid,y=t.resizeHandleWrapperClass,b=t.resizeHandleWrapperStyle,x=t.scale,S=t.allowAnyClick,C=t.dragPositionOffset,w=no(t,`disableDragging.style.dragHandleClassName.position.onMouseDown.onMouseUp.dragAxis.dragGrid.bounds.enableUserSelectHack.cancel.children.onResizeStart.onResize.onResizeStop.onDragStart.onDrag.onDragStop.resizeHandleStyles.resizeHandleClasses.resizeHandleComponent.enableResizing.resizeGrid.resizeHandleWrapperClass.resizeHandleWrapperStyle.scale.allowAnyClick.dragPositionOffset`.split(`.`)),T=this.props.default?Q({},this.props.default):void 0;delete w.default;var E=n||i?{cursor:`auto`}:{cursor:`move`},D=Q(Q(Q({},ro),E),r),O=this.offsetFromParent,k=O.left,A=O.top,j;a&&(j={x:a.x-k,y:a.y-A});var M=this.state.resizing?void 0:j,N=this.state.resizing?`both`:c;return(0,B.createElement)(Na.default,{ref:function(t){t&&(e.draggable=t)},handle:i?`.${i}`:void 0,defaultPosition:T,onMouseDown:o,onMouseUp:s,onStart:this.onDragStart,onDrag:this.onDrag,onStop:this.onDragStop,axis:N,disabled:n,grid:l,bounds:u?this.state.bounds:void 0,position:M,enableUserSelectHack:d,cancel:f,scale:x,allowAnyClick:S,nodeRef:this.resizableElement,positionOffset:C},(0,B.createElement)($a,Q({},w,{ref:function(t){t&&(e.resizable=t,e.resizableElement.current=t.resizable)},defaultSize:T,size:this.props.size,enable:typeof _==`boolean`?io(_):_,onResizeStart:this.onResizeStart,onResize:this.onResize,onResizeStop:this.onResizeStop,style:D,minWidth:this.props.minWidth,minHeight:this.props.minHeight,maxWidth:this.state.resizing?this.state.maxWidth:this.props.maxWidth,maxHeight:this.state.resizing?this.state.maxHeight:this.props.maxHeight,grid:v,handleWrapperClass:y,handleWrapperStyle:b,lockAspectRatio:this.props.lockAspectRatio,lockAspectRatioExtraWidth:this.props.lockAspectRatioExtraWidth,lockAspectRatioExtraHeight:this.props.lockAspectRatioExtraHeight,handleStyles:m,handleClasses:h,handleComponent:g,scale:this.props.scale}),p))},t.defaultProps={maxWidth:2**53-1,maxHeight:2**53-1,scale:1,onResizeStart:function(){},onResize:function(){},onResizeStop:function(){},onDragStart:function(){},onDrag:function(){},onDragStop:function(){}},t}(B.PureComponent),oo=e=>Symbol.iterator in e,so=e=>`entries`in e,co=(e,t)=>{let n=e instanceof Map?e:new Map(e.entries()),r=t instanceof Map?t:new Map(t.entries());if(n.size!==r.size)return!1;for(let[e,t]of n)if(!r.has(e)||!Object.is(t,r.get(e)))return!1;return!0},lo=(e,t)=>{let n=e[Symbol.iterator](),r=t[Symbol.iterator](),i=n.next(),a=r.next();for(;!i.done&&!a.done;){if(!Object.is(i.value,a.value))return!1;i=n.next(),a=r.next()}return!!i.done&&!!a.done};function uo(e,t){return Object.is(e,t)?!0:typeof e!=`object`||!e||typeof t!=`object`||!t||Object.getPrototypeOf(e)!==Object.getPrototypeOf(t)?!1:oo(e)&&oo(t)?so(e)&&so(t)?co(e,t):lo(e,t):co({entries:()=>Object.entries(e)},{entries:()=>Object.entries(t)})}function fo(e){let t=B.default.useRef(void 0);return n=>{let r=e(n);return uo(t.current,r)?t.current:t.current=r}}var po=({message:e=`Loading...`,size:t=`lg`})=>(0,V.jsx)(b.t,{style:{width:`100%`,height:`100%`},children:(0,V.jsxs)(C.t,{align:`center`,gap:`md`,children:[(0,V.jsx)(s.s,{size:t}),(0,V.jsx)(g.o,{c:`dimmed`,children:e})]})}),mo=({progress:e,windowIcon:t})=>{let r=n.d(),i=()=>{switch(e.state){case`fetching`:return`Fetching app info...`;case`compiling`:return`Compiling app...`;case`loading`:return`Loading app...`;case`ready`:return`Ready!`;case`error`:return`Error loading app`;default:return`Loading...`}},a=()=>e.state===`error`?`red`:e.state===`ready`?`green`:r.primaryColor;return(0,V.jsx)(b.t,{style:{width:`100%`,height:`100%`},"data-testid":`custom-app-loading`,children:(0,V.jsxs)(C.t,{align:`center`,gap:`lg`,p:`xl`,children:[t&&(0,V.jsx)(g.o,{size:`3rem`,children:t}),(0,V.jsx)(g.o,{size:`lg`,fw:700,children:e.appName||`App`}),(0,V.jsx)(d.n,{value:e.progress,size:`lg`,radius:`xl`,animated:e.state===`loading`||e.state===`compiling`,style:{minWidth:200},color:a()}),(0,V.jsx)(g.o,{size:`sm`,c:`dimmed`,children:i()}),e.state===`error`&&(0,V.jsx)(g.o,{size:`xs`,c:`red`,ta:`center`,children:e.error}),(0,V.jsxs)(g.o,{size:`xs`,c:`gray`,children:[e.progress,`%`]})]})})},ho=({appId:e})=>(0,V.jsx)(b.t,{style:{width:`100%`,height:`100%`},children:(0,V.jsxs)(C.t,{align:`center`,gap:`lg`,p:`xl`,maw:400,children:[(0,V.jsx)(g.o,{size:`3rem`,children:(0,V.jsx)(N.Kt,{})}),(0,V.jsx)(g.o,{size:`lg`,fw:700,ta:`center`,children:`Development Server Offline`}),(0,V.jsxs)(g.o,{size:`sm`,c:`dimmed`,ta:`center`,children:[`The app "`,e,`" cannot be loaded because the development server is offline.`]}),(0,V.jsx)(v.t,{variant:`light`,onClick:()=>{window.__FDE_API__?.openApp(`welcome`)},children:`Open Welcome App`}),(0,V.jsx)(_.i,{href:`https://github.com/frannunpal/frannunpal.github.io/issues`,target:`_blank`,rel:`noopener noreferrer`,size:`sm`,children:`File an issue on GitHub`})]})}),go=({appId:e})=>(0,V.jsx)(b.t,{style:{width:`100%`,height:`100%`},children:(0,V.jsxs)(C.t,{align:`center`,gap:`lg`,p:`xl`,maw:400,children:[(0,V.jsx)(g.o,{size:`3rem`,children:(0,V.jsx)(N.rr,{})}),(0,V.jsx)(g.o,{size:`lg`,fw:700,ta:`center`,children:`Custom Apps Not Available`}),(0,V.jsxs)(g.o,{size:`sm`,c:`dimmed`,ta:`center`,children:[`The app "`,e,`" cannot be loaded because this environment does not currently allow creating your own apps.`]}),(0,V.jsx)(g.o,{size:`sm`,c:`dimmed`,ta:`center`,children:`Please refer to the "Documentation" folder to learn more about it.`})]})}),_o=new Set,$=null,vo=null,yo=null,bo=!1,xo=0,So=null,Co=!1,wo=!1;function To(){_o.clear(),$=null,vo=null,yo=null,bo=!1,xo=0,So=null,Co=!1,wo=!1}var Eo=1e4,Do=2e3,Oo=5,ko=0;function Ao(){return`${window.location.protocol===`https:`?`wss:`:`ws:`}//${window.location.host}/api/hmr`}async function jo(){try{let e=await fetch(`/api/hmr`,{method:`HEAD`});return e.status===426||e.status===400}catch{return!1}}function Mo(){vo&&=(clearTimeout(vo),null),yo&&=(clearTimeout(yo),null),bo=!1}function No(e){typeof BroadcastChannel>`u`||(So=new BroadcastChannel(`fde-custom-apps`),So.onmessage=t=>{let n=t.data;n._fromBroadcast=!0,e(n)})}function Po(e){So?.postMessage(e)}async function Fo(){w.o.getState().isFsReady||await new Promise(e=>{let t=w.o.subscribe(n=>{n.isFsReady&&(t(),e())})});try{let e=w.v.getState().registeredApps,{added:t,removed:n}=await w.K(e);for(let e of t)w.v.getState().registerApp(e),w.o.getState().handleCustomAppRegistered?.(e);for(let e of n)w.v.getState().unregisterApp(e),w.o.getState().handleCustomAppUnregistered?.(e)}catch(e){console.warn(`[HMR] Failed to sync apps on connect:`,e)}}function Io(e,t,n){if(bo||$&&$.readyState===WebSocket.OPEN)return $;let r=Ao(),i=++xo;return bo=!0,$=new WebSocket(r),yo=setTimeout(()=>{$&&$.readyState!==WebSocket.OPEN&&i===xo&&(console.warn(`[HMR] Initial connection timeout`),ko++,ko>=Oo?(console.warn(`[HMR] Max initial retries reached, marking server as offline`),t()):($?.close(),vo=setTimeout(()=>{Io(e,t,n)},Do)))},Eo),$.onopen=()=>{if(i!==xo){$?.close();return}console.log(`[HMR] Connected to server`),ko=0,bo=!1,w.v.getState().resetHmrRetry(),w.v.getState().setHmrConnected(!0),w.v.getState().setHmrError(null),w.v.getState().devServerOffline&&n(),w.v.getState().setDevServerOffline(!1),Mo(),Fo().catch(e=>{console.warn(`[HMR] Failed to sync apps:`,e)})},$.onmessage=t=>{try{let n=JSON.parse(t.data);console.log(`[HMR] Received ${n.type} for ${n.appId}`),e(n)}catch(e){console.error(`[HMR] Failed to parse message:`,e)}},$.onclose=r=>{i===xo&&(console.log(`[HMR] Disconnected from server (code: ${r.code})`),$=null,bo=!1,w.v.getState().setHmrConnected(!1),Mo(),vo=setTimeout(()=>{Io(e,t,n)},Do))},$.onerror=e=>{i===xo&&(console.error(`[HMR] WebSocket error:`,e),w.v.getState().setHmrError(`Connection failed`))},$}function Lo(){Mo(),$&&=($.close(),null),So&&=(So.close(),null)}function Ro(e){let t=(0,B.useRef)(e),{notify:n}=P.n();(0,B.useEffect)(()=>{t.current=e},[e]);let r=(0,B.useCallback)(e=>{switch(e.type){case`reload`:{let t=e.appId,n=w.v.getState().mountedApps[t];if(n?.instance&&typeof n.instance.unmount==`function`)try{n.instance.unmount()}catch(e){console.warn(`[HMR] Error unmounting ${t}:`,e)}let r=document.getElementById(`app-container-${t}`);r&&(r.innerHTML=``),w.v.getState().setAppLoading(t),_o.forEach(e=>{try{e.onReload(t)}catch(e){console.error(`[HMR] Callback error:`,e)}});break}case`app-registered`:if(e.manifest){console.log(`[HMR] App registered: ${e.manifest.id}`);let t=!!w.v.getState().registeredApps[e.manifest.id];w.L(),w.q(e.manifest),w.v.getState().registerApp(e.manifest),w.o.getState().handleCustomAppRegistered?.(e.manifest),t||n(`New App Available`,`${e.manifest.name} is now available`,{fcIcon:`FcApproval`}),e._fromBroadcast||Po(e)}break;case`app-unregistered`:{let t=e.appId;console.log(`[HMR] App unregistered: ${t}`),w.L(),w.G(t),w.v.getState().unregisterApp(t),w.o.getState().handleCustomAppUnregistered?.(t),e._fromBroadcast||Po(e);break}case`app-error`:console.error(`[HMR] App error: ${e.appId} - ${e.error}`),n(`App Error`,e.error||`Unknown error`,{fcIcon:`FcCancel`});break}},[n]),i=(0,B.useCallback)(()=>{w.v.getState().setDevServerOffline(!0),n(`Development Server Offline`,`HMR is disabled. Changes will not be applied until the server reconnects.`,{fcIcon:`FcDoNotInsert`})},[n]),a=(0,B.useCallback)(()=>{n(`HMR Reconnected`,`Hot module replacement is now active`,{fcIcon:`FcApproval`})},[n]);(0,B.useEffect)(()=>{if(g.t()===`browser`){console.log(`[HMR] Skipping: not running in Docker`);return}if(!g.i()||!g.r())return;let e=!1;return _o.add(t.current),!wo&&!Co&&(Co=!0,jo().then(t=>{if(Co=!1,e||!t){t||console.warn(`[HMR] HMR endpoint not available, skipping WebSocket connection`);return}wo=!0,No(r),Io(r,i,a)}).catch(()=>{Co=!1})),()=>{e=!0,_o.delete(t.current),_o.size===0&&(wo=!1,Lo())}},[r,i,a])}function zo(){let{notify:e}=P.n();Ro({onReload:()=>{},onRegistered:(0,B.useCallback)(t=>{w.o.getState().handleCustomAppRegistered?.(t),e(`New App Available`,`${t.name} is now available`,{fcIcon:`FcApproval`})},[e]),onUnregistered:(0,B.useCallback)(e=>{w.o.getState().handleCustomAppUnregistered?.(e)},[])})}function Bo(e,t=5e3){return new Promise((n,r)=>{let i=Date.now(),a=null,o=null,s=()=>{o&&=(clearInterval(o),null),a&&=(clearTimeout(a),null)},c=()=>{let a=document.getElementById(e);if(a){s(),n(a);return}if(Date.now()-i>=t){s(),r(Error(`Container #${e} not found after ${t}ms`));return}};c(),o=setInterval(c,1e3),a=setTimeout(()=>{s(),r(Error(`Container #${e} not found after ${t}ms`))},t)})}var Vo={state:`idle`,progress:0,appName:``},Ho=1e4,Uo=({appId:e,windowIcon:t,notifyReady:n})=>{let[r,i]=(0,B.useState)({...Vo,appName:e}),[a,o]=(0,B.useState)(!1),[s,c]=(0,B.useState)(null),[l,u]=(0,B.useState)(!1),[d,f]=(0,B.useState)(0),p=(0,B.useRef)(null),m=(0,B.useRef)(!0),h=(0,B.useRef)(!1),_=(0,B.useRef)(null),v=(0,B.useRef)(null),y=w.v(e=>e.devServerOffline),b=w.v(t=>t.mountedApps[e]),x=w.v(e=>e.setAppLoading),S=w.v(e=>e.setAppLoaded),C=w.v(e=>e.setAppError),T=w.v(e=>e.clearApp),{notify:E}=P.n(),D=g.i(),O=(0,B.useCallback)(()=>{v.current&&=(clearTimeout(v.current),null)},[]),k=(0,B.useCallback)(()=>{_.current&&=(clearInterval(_.current),null)},[]),A=(0,B.useCallback)(()=>{let e=b?.instance;if(e&&typeof e.unmount==`function`)try{e.unmount()}catch{}},[b?.instance]),j=(0,B.useCallback)(async()=>{if(m.current&&!h.current){h.current=!0;try{i(e=>({...e,state:`fetching`,progress:10})),x(e),c(null),w.L();let t=await w.z(!0);if(!t)throw Error(`Apps manifest not found. Make sure apps are built.`);let r=t.apps.find(t=>t.id===e);if(!r)throw Error(`App '${e}' not found in manifest. Available apps: ${t.apps.map(e=>e.id).join(`, `)}`);i(e=>({...e,state:`loading`,progress:30,appName:r.name})),_.current=setInterval(()=>{if(!m.current){k();return}i(e=>({...e,progress:Math.min(e.progress+5,90)}))},100);try{await Bo(`app-container-${e}`,5e3)}catch{throw Error(`Container #app-container-${e} not found`)}if(await import(`/dist-apps/${r.entry}?t=${Date.now()}`),k(),S(e),await new Promise(t=>{O();let n=()=>{if(w.v.getState().mountedApps[e]?.isReady){t();return}v.current=setTimeout(n,500)};if(w.v.getState().mountedApps[e]?.isReady){t();return}v.current=setTimeout(()=>{console.warn(`[${e}] App did not call appReady() within ${Ho}ms`),E(`Warning`,`App ${e} took too long to initialize`,{fcIcon:`FcInfo`}),u(!0),w.v.getState().setAppReady(e),t()},Ho),n()}),i(e=>({...e,state:`ready`,progress:100})),o(!0),!m.current)return;setTimeout(()=>{n?.()},50)}catch(t){k(),O(),h.current=!1;let n=t instanceof Error?t.message:`Unknown error`;i(e=>({...e,state:`error`,error:n,progress:0})),C(e,n),c(n),console.error(`[CustomAppLoader] Error loading app ${e}:`,t)}}},[e,n,x,S,C,O,k,E]);if(Ro({onReload:(0,B.useCallback)(t=>{t===e&&(h.current=!1,A(),T(e),o(!1),i({...Vo,appName:e}),c(null),f(e=>e+1))},[e,T,A])}),(0,B.useEffect)(()=>{if(!h.current)return m.current=!0,j(),()=>{m.current=!1,k(),O()}},[j,d,k,O]),!D)return(0,V.jsx)(go,{appId:e});if(y&&!b?.isLoaded&&!s)return(0,V.jsx)(ho,{appId:e});let M=r.state===`error`,N=a&&b?.isReady&&!l,F=r.state===`ready`&&a&&l,I=F&&!b?.instance,L=M||I||!(N||F);return I?(0,V.jsx)(mo,{progress:{...r,state:`error`,error:`App '${e}' loaded but did not mount. Check the browser console for errors.`},windowIcon:t}):(0,V.jsxs)(V.Fragment,{children:[L&&(0,V.jsx)(mo,{progress:r,windowIcon:t}),(0,V.jsx)(`div`,{ref:p,id:`app-container-${e}`,"data-testid":`custom-app-container-${e}`,style:{all:`initial`,display:M?`none`:`block`,width:`100%`,height:`100%`,overflow:`auto`,visibility:N||F?`visible`:`hidden`,boxSizing:`border-box`,fontFamily:`sans-serif`}})]})},Wo=(0,B.createContext)({notifyReady:()=>{},getContentData:()=>void 0}),Go=()=>(0,B.useContext)(Wo),Ko=({children:e})=>{let t=(0,B.useRef)(void 0),n=(0,B.useCallback)(e=>{e!==void 0&&(t.current=e)},[]),r=(0,B.useCallback)(()=>t.current,[]);return(0,V.jsx)(Wo.Provider,{value:{notifyReady:n,getContentData:r},children:e})},qo={root:`_root_1vtes_1`,titleBar:`_titleBar_1vtes_12`,windowButtons:`_windowButtons_1vtes_31`,title:`_title_1vtes_12`,content:`_content_1vtes_41`,focusOverlay:`_focusOverlay_1vtes_48`},Jo=({win:e,isFocused:t,focusWindow:n})=>{let{notifyReady:r,getContentData:i}=Go(),o=w.v(t=>e.content in t.registeredApps),s=(0,B.useMemo)(()=>E.x(e.content),[e.content]),c=(0,B.useMemo)(()=>E.C(e.content),[e.content]),l=(0,B.useMemo)(()=>E.w(e.content),[e.content]),u=(0,B.useMemo)(()=>E.D(e.content),[e.content]),d=(0,B.useMemo)(()=>E.S(e.content),[e.content]),f=w.o(e=>e.closeWindow),p=i()??e.contentData,m={...e,contentData:p},h=c?c(m):void 0;if(o)return(0,V.jsx)(Uo,{appId:e.content,windowIcon:e.icon,notifyReady:r});let g=u?(0,V.jsx)(B.Suspense,{fallback:(0,V.jsx)(po,{message:d?`Loading ${d}...`:void 0}),children:(0,B.createElement)(s,{window:e,notifyReady:r})}):(0,B.createElement)(s,{window:e,notifyReady:r});return(0,V.jsxs)(V.Fragment,{children:[l?(0,V.jsx)(B.Suspense,{fallback:null,children:(0,B.createElement)(l,{windowId:e.id,contentData:p,onExit:()=>f(e.id)})}):h&&h.length>0?(0,V.jsx)(a.t,{elements:h}):null,(0,V.jsxs)(`div`,{className:qo.content,children:[!t&&(0,V.jsx)(`div`,{"data-testid":`focus-overlay`,className:qo.focusOverlay,onMouseDown:t=>{t.stopPropagation(),n(e.id)}}),g]})]})},Yo=({window:e})=>{let{t}=D.t(`window`),n=w.o(t=>t.windows.find(t=>t.id===e.id))??e,r=ii(n.content),{focusWindow:i,closeWindow:a,minimizeWindow:o,maximizeWindow:s,restoreWindow:l,moveWindow:u,resizeWindow:d}=w.o(fo(e=>({focusWindow:e.focusWindow,closeWindow:e.closeWindow,minimizeWindow:e.minimizeWindow,maximizeWindow:e.maximizeWindow,restoreWindow:e.restoreWindow,moveWindow:e.moveWindow,resizeWindow:e.resizeWindow}))),f=c.h(e=>e.theme.colors.window),p=j.a(e=>e.isOpen),_=j.a(e=>e.windowId),b=j.a(e=>e.onSave),x=j.a(e=>e.onDiscard),S=j.a(e=>e.closeModal),{windowVariants:C,easeIn:O}=ti(),k=w.o(e=>{let t=e.windows.find(e=>e.id===n.id);if(!t)return!0;let r=t.alwaysOnTop??!1,i=e.windows.filter(e=>e.isOpen&&e.state!==`minimized`&&(e.alwaysOnTop??!1)===r);return i.length===0?!0:Math.max(...i.map(e=>e.zIndex))===t.zIndex}),{getRect:A}=Jn(),N=Gn(),P=(0,B.useRef)(n.state);(0,B.useEffect)(()=>{N.start(`visible`)},[N]),(0,B.useEffect)(()=>{if(P.current===`minimized`&&n.state!==`minimized`){let e=A(n.id);if(e){let t=n.x+n.width/2,r=n.y+n.height/2,i=e.left+e.width/2,a=e.top+e.height/2;N.start(E.v(i-t,a-r))}else N.set({x:0,y:0,scale:1,opacity:1}),N.start(`visible`)}P.current=n.state},[n.state,N,A,n.id,n.x,n.y,n.width,n.height]);let F=(0,B.useCallback)(e=>{e.preventDefault(),w.C.find(e=>e.id===n.content)?.hasContextMenu||e.stopPropagation()},[n.content]);if(!n.isOpen)return null;let I=n.state===`minimized`,L=n.state===`maximized`,ee=n.canMaximize!==!1,R=p&&_===n.id,te=async()=>{let e=A(n.id);if(e){let t=n.x+n.width/2,r=n.y+n.height/2,i=e.left+e.width/2,a=e.top+e.height/2;await N.start(E.m(i-t,a-r))}else await N.start({...C.exit,transition:O});o(n.id)},ne=async()=>{let e=j.t(n.id);e&&!e()||(await N.start({...C.exit,transition:O}),a(n.id))},z=()=>{b?.(),S()},re=()=>{x?.(),S();let e=n.id;e&&a(e)},ie=()=>{S()};return(0,V.jsxs)(V.Fragment,{children:[(0,V.jsx)(ao,{position:L?{x:0,y:0}:{x:n.x,y:n.y},size:L?{width:`100vw`,height:`100vh`}:{width:n.width,height:n.height},minWidth:n.minWidth??0,minHeight:n.minHeight??0,style:{zIndex:n.zIndex,visibility:I?`hidden`:`visible`,pointerEvents:I?`none`:`auto`},dragHandleClassName:qo.titleBar,disableDragging:L||I,enableResizing:!L&&!I,onMouseDown:()=>i(n.id),onDragStop:(e,t)=>u(n.id,t.x,t.y),onResizeStop:(e,t,r,i,a)=>{d(n.id,r.offsetWidth,r.offsetHeight),u(n.id,a.x,a.y)},children:(0,V.jsxs)(T.r.div,{className:qo.root,"data-testid":`window-${n.content}`,style:{background:f},variants:C,initial:`hidden`,animate:N,exit:`exit`,layout:!0,transition:E.p,onContextMenu:F,children:[(0,V.jsxs)(`div`,{className:qo.titleBar,children:[(0,V.jsx)(y.t,{fcIcon:n.fcIcon,iconUrl:n.iconUrl,fallback:n.icon,size:14,color:n.iconColor}),(0,V.jsx)(g.o,{size:`sm`,fw:500,truncate:!0,className:qo.title,children:r}),(0,V.jsxs)(h.t,{gap:2,wrap:`nowrap`,className:qo.windowButtons,children:[(0,V.jsx)(m.t,{size:`lg`,variant:`subtle`,"aria-label":t(`window.ariaLabels.minimize`),onClick:te,children:(0,V.jsx)(M.t,{name:`VscChromeMinimize`})}),ee&&(0,V.jsx)(m.t,{size:`lg`,variant:`subtle`,"aria-label":t(L?`window.ariaLabels.restore`:`window.ariaLabels.maximize`),onClick:()=>L?l(n.id):s(n.id),children:L?(0,V.jsx)(M.t,{name:`VscChromeRestore`}):(0,V.jsx)(M.t,{name:`VscChromeMaximize`})}),(0,V.jsx)(m.t,{size:`lg`,variant:`subtle`,color:`red`,"aria-label":t(`window.ariaLabels.close`),onClick:ne,children:(0,V.jsx)(M.t,{name:`VscChromeClose`})})]})]}),(0,V.jsx)(Ko,{children:(0,V.jsx)(Jo,{win:n,isFocused:k,focusWindow:i})})]})}),(0,V.jsxs)(G,{opened:R,onClose:ie,title:t(`unsavedModal.title`),centered:!0,withinPortal:!0,children:[(0,V.jsx)(g.o,{size:`sm`,mb:`lg`,children:t(`unsavedModal.message`)}),(0,V.jsx)(v.t,{variant:`default`,onClick:re,children:t(`unsavedModal.dontSave`)}),(0,V.jsx)(v.t,{onClick:z,ml:`sm`,children:t(`unsavedModal.save`)})]})]})},Xo={root:`_root_1f7p3_1`,iconImage:`_iconImage_1f7p3_21`,label:`_label_1f7p3_26`},Zo=({icon:e,onDoubleClick:t,onContextMenu:n})=>{let r=w.C.find(t=>t.id===e.appId),i=e.iconName!==void 0,a=e.nodeId!==void 0,o=e.icon===`📁`,s=e.appId===`pdf`,c=(0,B.useRef)(0),l=ii(e.appId),u=e.appId&&!a&&r?l:e.name,d=(0,B.useCallback)(t=>{if(t.preventDefault(),e.nodeId){t.stopPropagation(),n?.(t,e.nodeId);return}e.appId&&!r?.hasContextMenu&&t.stopPropagation()},[e.nodeId,e.appId,r?.hasContextMenu,n]),f=()=>i?(0,V.jsx)(_.t,{type:`folder`,name:e.name,folderNode:{id:e.id,name:e.name,type:`folder`,parentId:null,children:[],iconName:e.iconName,iconColor:e.iconColor,createdAt:new Date,updatedAt:new Date},size:32}):o&&a?(0,V.jsx)(_.t,{type:`folder`,name:e.name,size:32}):a||s?(0,V.jsx)(_.t,{type:`file`,name:e.name,size:32}):(0,V.jsx)(y.t,{fcIcon:r?.fcIcon,iconUrl:r?.iconUrl,fallback:e.icon,size:32,color:r?.iconColor});return(0,V.jsxs)(`div`,{className:Xo.root,style:{left:e.x,top:e.y},onDoubleClick:()=>t(e.appId??``,e.nodeId),onTouchEnd:n=>{n.preventDefault();let r=Date.now();r-c.current<300&&t(e.appId??``,e.nodeId),c.current=r},onContextMenu:d,role:`button`,"aria-label":u,tabIndex:0,onKeyDown:n=>n.key===`Enter`&&t(e.appId??``,e.nodeId),children:[(0,V.jsx)(`span`,{className:Xo.iconImage,"aria-hidden":`true`,children:f()}),(0,V.jsx)(g.o,{size:`xs`,className:Xo.label,truncate:!0,children:u})]})},Qo=({x:e,y:t})=>(0,V.jsx)(a.r.Target,{children:(0,V.jsx)(`div`,{"aria-hidden":`true`,style:{position:`fixed`,left:e,top:t,width:0,height:0,pointerEvents:`none`}})}),$o=({owner:e,parentId:t,currentPath:n})=>{let{t:r}=D.t(`contextMenu`),i=w.o(e=>e.contextMenu),o=w.o(e=>e.closeContextMenu),s=w.o(e=>e.copyToClipboard),c=w.o(e=>e.cutToClipboard),l=w.o(e=>e.clipboard),u=w.o(e=>e.clearClipboard),d=w.o(e=>e.fsNodes),f=w.o(e=>e.addNotification),p=w.o(e=>e.openWindow),m=w.o(e=>e.desktopSortMode),_=w.o(e=>e.filesSortMode),b=w.o(e=>e.setDesktopSortMode),x=w.o(e=>e.setFilesSortMode),S=w.o(e=>e.setFsNodes),C=w.o(e=>e.syncIcons),T=e===`files`?_:m,O=e===`files`?x:b,[k,A]=(0,B.useState)({opened:!1,pending:null}),[j,N]=(0,B.useState)({opened:!1,nodeId:null,nodeName:``}),P=i.owner===e,F=i.targetNodeId,I=F?d.find(e=>e.id===F):void 0,L=e=>{o();let{x:i,y:a}=E._();p({title:r(e===`folder`?`createItem.folderTitle`:`createItem.fileTitle`),content:`createItem`,icon:e===`folder`?`📁`:`📄`,fcIcon:e===`folder`?`FcNewFolder`:`FcFile`,x:i,y:a,width:400,height:300,minWidth:350,minHeight:250,canMaximize:!1,alwaysOnTop:!0,contentData:{mode:e,parentId:t,currentPath:n}})},ee=()=>{F&&I&&N({opened:!0,nodeId:F,nodeName:I.name}),o()},R=async e=>{if(e&&j.nodeId)try{await w.n.delete(j.nodeId),S(w.n.getAllNodes()),C()}catch(e){f({id:`delete-error-${Date.now()}`,title:r(`common:errors.deleteFailed`),message:e instanceof Error?e.message:`Unknown error`,fcIcon:`FcHighPriority`})}N({opened:!1,nodeId:null,nodeName:``})},te=()=>{I&&c([I]),o()},ne=()=>{I&&s([I]),o()},z=(e,t)=>d.find(n=>n.name===e&&n.parentId===t),re=async(e,t)=>{let n=await w.n.createFolder(e.name,t,e.iconName,e.iconColor),r=w.n.getChildren(e.id);for(let e of r)e.type===`folder`?await re(e,n.id):await w.n.createFile(e.name,e.content||``,n.id)},ie=async(e,n)=>{if(t){if(l.action===`cut`)try{await w.n.move(e.id,t),S(w.n.getAllNodes()),C()}catch(e){f({id:`move-error-${Date.now()}`,title:`Move Failed`,message:e instanceof Error?e.message:`Unknown error`,fcIcon:`FcHighPriority`});return}else if(l.action===`copy`){if(e.type===`folder`){let r=z(e.name,t);r&&n&&await w.n.delete(r.id),(!r||n)&&(await re(e,t),S(w.n.getAllNodes()),C())}else if(e.type===`file`){let r=z(e.name,t);if(r&&n&&await w.n.delete(r.id),!r||n)try{await w.n.createFile(e.name,e.content||``,t),S(w.n.getAllNodes()),C()}catch(e){f({id:`create-error-${Date.now()}`,title:`Create File Failed`,message:e instanceof Error?e.message:`Unknown error`,fcIcon:`FcHighPriority`})}}}l.action===`cut`&&u()}},ae=async()=>{if(l.content.length===0||!t)return;let e=l.content[0];z(e.name,t)?A({opened:!0,pending:{node:e,originalName:e.name}}):(await ie(e,!1),o())},oe=e=>{k.pending&&ie(k.pending.node,e),A({opened:!1,pending:null}),o()},se=l.content.length>0&&t!==null,ce=l.content.length>1?r(`actions.pasteItems`,{count:l.content.length}):r(`actions.paste`),le=e=>{O(e),o()},ue=[{mode:`default`,icon:`FcDatabase`,label:r(`sort.default`)},{mode:`name-asc`,icon:`FcAlphabeticalSortingAz`,label:r(`sort.nameAsc`)},{mode:`name-desc`,icon:`FcAlphabeticalSortingZa`,label:r(`sort.nameDesc`)},{mode:`type`,icon:`FcFile`,label:r(`sort.byType`)}];return(0,V.jsxs)(V.Fragment,{children:[(0,V.jsxs)(a.r,{opened:P,onClose:o,closeOnClickOutside:!0,closeOnEscape:!0,closeOnItemClick:!0,withinPortal:!0,position:`bottom-start`,children:[(0,V.jsx)(Qo,{x:i.x,y:i.y}),(0,V.jsx)(a.r.Dropdown,{children:I?(0,V.jsxs)(V.Fragment,{children:[(0,V.jsx)(a.r.Label,{children:I.name}),(0,V.jsx)(a.r.Item,{leftSection:(0,V.jsx)(M.t,{name:`VscFiles`,size:14}),onClick:te,children:r(`actions.cut`)}),(0,V.jsx)(a.r.Item,{leftSection:(0,V.jsx)(M.t,{name:`VscClippy`,size:14}),onClick:ne,children:r(`actions.copy`)}),se&&(0,V.jsx)(a.r.Item,{leftSection:(0,V.jsx)(M.t,{name:`VscCopy`,size:14}),onClick:ae,children:ce}),(0,V.jsx)(a.r.Divider,{}),(0,V.jsx)(a.r.Item,{leftSection:(0,V.jsx)(M.t,{name:`VscTrash`,size:14}),color:`red`,onClick:ee,children:r(`actions.delete`)})]}):(0,V.jsxs)(V.Fragment,{children:[(0,V.jsx)(a.r.Item,{leftSection:(0,V.jsx)(M.t,{name:`VscNewFolder`,size:14}),onClick:()=>L(`folder`),children:r(`actions.createFolder`)}),(0,V.jsx)(a.r.Item,{leftSection:(0,V.jsx)(M.t,{name:`VscNewFile`,size:14}),onClick:()=>L(`file`),children:r(`actions.createFile`)}),se&&(0,V.jsxs)(V.Fragment,{children:[(0,V.jsx)(a.r.Divider,{}),(0,V.jsx)(a.r.Item,{leftSection:(0,V.jsx)(M.t,{name:`VscCopy`,size:14}),onClick:ae,children:ce})]}),e===`desktop`||e===`files`?(0,V.jsxs)(V.Fragment,{children:[(0,V.jsx)(a.r.Divider,{}),(0,V.jsx)(a.r.Label,{children:r(`sort.title`)}),ue.map(e=>(0,V.jsx)(a.r.Item,{leftSection:(0,V.jsx)(y.t,{fcIcon:e.icon,size:14}),onClick:()=>le(e.mode),style:T===e.mode?{fontWeight:600}:void 0,"data-testid":T===e.mode?`sort-option-selected`:void 0,children:e.label},e.mode))]}):null]})})]}),(0,V.jsxs)(G,{opened:k.opened,onClose:()=>oe(!1),title:(0,V.jsx)(g.o,{fw:600,children:r(`common:messages.replaceFile`)}),centered:!0,size:`sm`,children:[(0,V.jsx)(g.o,{size:`sm`,mb:`md`,children:r(`common:messages.replaceFileMessage`,{name:k.pending?.originalName})}),(0,V.jsxs)(h.t,{justify:`flex-end`,children:[(0,V.jsx)(v.t,{variant:`default`,size:`sm`,onClick:()=>oe(!1),leftSection:(0,V.jsx)(M.t,{name:`VscClose`,size:14}),children:r(`common:buttons.no`)}),(0,V.jsx)(v.t,{size:`sm`,onClick:()=>oe(!0),leftSection:(0,V.jsx)(M.t,{name:`VscCheck`,size:14}),children:r(`common:messages.yesReplace`)})]})]}),(0,V.jsxs)(G,{opened:j.opened,onClose:()=>R(!1),title:(0,V.jsx)(g.o,{fw:600,children:r(`deleteConfirm.title`,{name:j.nodeName})}),centered:!0,size:`sm`,children:[(0,V.jsx)(g.o,{size:`sm`,mb:`md`,children:r(`deleteConfirm.message`,{name:j.nodeName})}),(0,V.jsxs)(h.t,{justify:`flex-end`,children:[(0,V.jsx)(v.t,{variant:`default`,size:`sm`,onClick:()=>R(!1),leftSection:(0,V.jsx)(M.t,{name:`VscClose`,size:14}),children:r(`common:actions.cancel`)}),(0,V.jsx)(v.t,{color:`red`,size:`sm`,onClick:()=>R(!0),leftSection:(0,V.jsx)(M.t,{name:`VscTrash`,size:14}),children:r(`common:actions.delete`)})]})]})]})},es={overlay:`_overlay_34o9z_1`,content:`_content_34o9z_12`,phoneIcon:`_phoneIcon_34o9z_22`,rotatePhone:`_rotatePhone_34o9z_1`,title:`_title_34o9z_50`,message:`_message_34o9z_54`,button:`_button_34o9z_58`},ts=({onDismiss:e})=>{let{isPortrait:t,shouldShowWarning:n}=x.n();return!n||!t?null:(0,V.jsx)(`div`,{className:es.overlay,children:(0,V.jsxs)(`div`,{className:es.content,children:[(0,V.jsx)(`div`,{className:es.phoneIcon,children:(0,V.jsxs)(`svg`,{width:`64`,height:`64`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`1.5`,children:[(0,V.jsx)(`rect`,{x:`5`,y:`2`,width:`14`,height:`20`,rx:`2`}),(0,V.jsx)(`line`,{x1:`12`,y1:`18`,x2:`12`,y2:`18.01`,strokeWidth:`2`,strokeLinecap:`round`})]})}),(0,V.jsx)(g.o,{size:`lg`,fw:500,className:es.title,children:`Turn your device`}),(0,V.jsx)(g.o,{size:`sm`,c:`dimmed`,className:es.message,children:`For a better experience use this app desktop OR horizontal mode`}),(0,V.jsx)(v.t,{variant:`subtle`,onClick:e,className:es.button,children:`Continue vertically?`})]})})},ns=()=>typeof window<`u`&&window.matchMedia(`(prefers-color-scheme: dark)`).matches?`dark`:`light`,rs=()=>{let e=c.h(e=>e.applySystemTheme),t=c.h(e=>e.themeSetManually);(0,B.useEffect)(()=>{if(typeof window>`u`)return;t||e(ns());let n=window.matchMedia(`(prefers-color-scheme: dark)`),r=t=>{c.h.getState().themeSetManually||e(t.matches?`dark`:`light`)};return n.addEventListener(`change`,r),()=>n.removeEventListener(`change`,r)},[e,t])},is=(e,t)=>{let n=e=>e.replace(/^v/,``).split(`.`).map(Number),r=n(e),i=n(t),a=Math.max(r.length,i.length);for(let e=0;e<a;e++){let t=r[e]??0,n=i[e]??0;if(t>n)return!0;if(t<n)return!1}return!1},as=`frannunpal/frannunpal.github.io`,os=`https://api.github.com/repos/${as}/releases/latest`,ss=async()=>{let e=await fetch(os);if(!e.ok)throw Error(`GitHub API error: ${e.status}`);return e.json()},cs=`fde-desktop:version`,ls=!1,us=()=>{let e=w.o(e=>e.mergeSeed),t=w.o(e=>e.mergeDesktopApps),n=w.o(e=>e.reorderDesktopApps),{notify:r}=P.n();(0,B.useEffect)(()=>{typeof window>`u`||ls||(ls=!0,g.a()?ds(r):fs(e,t,n,r))},[e,t,n,r])},ds=async e=>{try{let t=await ss(),n=t.tag_name;if(!is(n,__APP_VERSION__))return;e(`Update ${n} available!`,`Click close to open the download page.`,{fcIcon:`FcEngineering`,onClose:()=>window.open(t.html_url,`_blank`)})}catch{ls=!1}},fs=async(e,t,n,r)=>{try{let i=localStorage.getItem(cs),a=i?JSON.parse(i):null,o=await fetch(w.g(`version.json`)).then(e=>e.json());if(a?.sha===o.sha)return;let s=await w.t();if(!s)return;e(s),t(w.w),n(w.w),localStorage.setItem(cs,JSON.stringify(o)),r(`New version available!`,`Close this notification to install it.`,{fcIcon:`FcEngineering`,onClose:()=>window.location.reload()})}catch{ls=!1}},ps=e=>`https://fonts.googleapis.com/css2?family=${e.replace(/\s+/g,`+`)}&display=swap`,ms=e=>{let t=c.f[e];if(!t||document.head.querySelector(`link[data-font="${e}"]`))return;let n=document.createElement(`link`);n.rel=`stylesheet`,n.href=t,n.setAttribute(`data-font`,e),document.head.appendChild(n)},hs=()=>{let e=c.h(e=>e.font),t=c.h(e=>e.fontSize),n=c.h(e=>e.downloadedFonts);(0,B.useEffect)(()=>{n.forEach(e=>{c.f[e]||(c.f[e]=ps(e)),ms(e)})},[n]),(0,B.useEffect)(()=>{let r=c.u.map(e=>e.value).includes(e);!r&&n.includes(e)&&(c.f[e]||(c.f[e]=ps(e)),ms(e));let i;i=r?c.d[e]??c.d[`system-ui`]:n.includes(e)?`"${e}", sans-serif`:c.d[`system-ui`],document.documentElement.style.setProperty(`font-family`,i),document.documentElement.style.setProperty(`--mantine-font-family`,i),document.documentElement.style.setProperty(`font-size`,`${t}px`)},[e,t,n])};function gs(){let{i18n:e}=D.t(),t=c.h(e=>e.language);(0,B.useEffect)(()=>{t&&e.language!==t&&(e.changeLanguage(t),localStorage.setItem(`fde-desktop:language`,t))},[t,e]),(0,B.useEffect)(()=>{let e=localStorage.getItem(`fde-desktop:language`);t&&!e&&localStorage.setItem(`fde-desktop:language`,t)},[t])}var _s=`fran-desktop`,vs=`fde-desktop`,ys=1,bs=`fde-desktop:migration-version`,xs=!1,Ss=null;async function Cs(e,t){return new Promise(n=>{let r=indexedDB.open(e);r.onerror=()=>{n(!1)},r.onsuccess=async()=>{let i=r.result,a=Array.from(i.objectStoreNames);if(a.length===0){i.close(),n(!1);return}let o=indexedDB.open(t,i.version);o.onerror=()=>{i.close(),n(!1)},o.onupgradeneeded=e=>{let t=e.target.result;for(let e of a)t.objectStoreNames.contains(e)||t.createObjectStore(e)},o.onsuccess=async()=>{let t=o.result;try{for(let e of a){let n=i.transaction(e,`readonly`).objectStore(e).getAll();await new Promise((r,i)=>{n.onsuccess=()=>{let a=n.result;if(a&&a.length>0){let n=t.transaction(e,`readwrite`),o=n.objectStore(e);for(let e of a)o.put(e);n.oncomplete=()=>r(),n.onerror=()=>i(n.error)}else r()},n.onerror=()=>i(n.error)})}i.close(),t.close(),await new Promise(t=>{let n=indexedDB.deleteDatabase(e);n.onsuccess=()=>t(),n.onerror=()=>t()}),n(!0)}catch{i.close(),t.close(),n(!1)}}}})}function ws(){let e=[];for(let t=0;t<localStorage.length;t++){let n=localStorage.key(t);n&&(n===_s||n.startsWith(`${_s}:`))&&e.push(n)}for(let t of e){let e=t.replace(_s,vs),n=localStorage.getItem(t);n!==null&&(localStorage.getItem(e)===null&&localStorage.setItem(e,n),localStorage.removeItem(t))}return{keysMigrated:e.length}}async function Ts(){return xs?{indexedDB:{fs:!1,blobs:!1},localStorage:{keysMigrated:0},version:ys}:Ss||(Ss=(async()=>{if(console.log(`[Migration] Starting storage migration...`),localStorage.getItem(bs)===String(ys))return console.log(`[Migration] Already migrated, skipping.`),xs=!0,{indexedDB:{fs:!1,blobs:!1},localStorage:{keysMigrated:0},version:ys};let e=!1,t=!1;try{e=await Cs(`fran-desktop-fs`,`fde-desktop-fs`),e&&console.log(`[Migration] Migrated IndexedDB: fran-desktop-fs → fde-desktop-fs`)}catch(e){console.warn(`[Migration] Failed to migrate fran-desktop-fs:`,e)}try{t=await Cs(`fran-desktop-blobs`,`fde-desktop-blobs`),t&&console.log(`[Migration] Migrated IndexedDB: fran-desktop-blobs → fde-desktop-blobs`)}catch(e){console.warn(`[Migration] Failed to migrate fran-desktop-blobs:`,e)}let{keysMigrated:n}=ws();return n>0&&console.log(`[Migration] Migrated ${n} localStorage keys`),localStorage.setItem(bs,String(ys)),console.log(`[Migration] Storage migration complete.`),xs=!0,{indexedDB:{fs:e,blobs:t},localStorage:{keysMigrated:n},version:ys}})(),Ss)}var Es=[],Ds=!1;function Os(){if(Es.length===0){Ds=!1;return}Ds=!0;let e=Es.shift();e&&e.loader().catch(()=>{}).finally(()=>{`requestIdleCallback`in window?requestIdleCallback(Os,{timeout:2e3}):setTimeout(Os,100)})}function ks(e,t){Es.some(t=>t.id===e)||(Es.push({id:e,loader:t}),As())}function As(){Ds||(`requestIdleCallback`in window?requestIdleCallback(Os,{timeout:2e3}):setTimeout(Os,100))}function js(e){e.forEach(e=>{ks(e.id,e.loader)})}var Ms=null,Ns=new Map;function Ps(){let{windows:e}=w.o.getState(),t=e.filter(e=>e.isOpen&&e.state!==`minimized`);return t.length===0?null:t.reduce((e,t)=>t.zIndex>(e?.zIndex??-1)?t:e,null)?.id??null}function Fs(e,t){let n=Ns.get(e);n&&n.forEach(n=>{try{n(t)}catch(t){console.error(`[FdeApi] Error in subscriber for ${e}:`,t)}})}var Is={width:800,height:600},Ls={x:100,y:100};function Rs(){if(Ms){console.warn(`[FdeApi] Already initialized`);return}Ms={openApp:(e,t)=>{let n=w.o.getState().openWindow,r=w.C.find(t=>t.id===e);n({content:e,title:t?.title??r?.name??e,icon:t?.icon??r?.icon??`📦`,fcIcon:r?.fcIcon,iconUrl:r?.iconUrl,iconColor:r?.iconColor,width:t?.size?.width??r?.defaultWidth??Is.width,height:t?.size?.height??r?.defaultHeight??Is.height,x:t?.position?.x??Ls.x,y:t?.position?.y??Ls.y,minWidth:r?.minWidth===!1?void 0:r?.minWidth,minHeight:r?.minHeight===!1?void 0:r?.minHeight,canMaximize:r?.canMaximize??!0,alwaysOnTop:r?.alwaysOnTop??!1,contentData:t?.contentData}),Fs(`window-opened`,{windowId:w.o.getState().windows[w.o.getState().windows.length-1]?.id??``,content:e})},closeWindow:e=>{let t=e??Ps();t&&(w.o.getState().closeWindow(t),Fs(`window-closed`,{windowId:t}))},minimizeWindow:e=>{let t=e??Ps();t&&(w.o.getState().minimizeWindow(t),Fs(`window-minimized`,{windowId:t}))},maximizeWindow:e=>{let t=e??Ps();t&&(w.o.getState().maximizeWindow(t),Fs(`window-maximized`,{windowId:t}))},restoreWindow:e=>{let t=e??Ps();t&&w.o.getState().restoreWindow(t)},focusWindow:e=>{let t=e??Ps();t&&(w.o.getState().focusWindow(t),Fs(`window-focused`,{windowId:t}))},openFile:(e,t)=>{w.o.getState().openWindow({content:`files`,contentData:{initialPath:e},title:`Files`,icon:`📁`,fcIcon:`FcOpenedFolder`,width:Is.width,height:Is.height,x:Ls.x,y:Ls.y}),Fs(`file-opened`,{path:e,appId:t})},openFileDialog:async()=>(console.warn(`[FdeApi] openFileDialog not yet implemented`),null),saveFile:async()=>(console.warn(`[FdeApi] saveFile not yet implemented`),!1),saveFileDialog:async()=>(console.warn(`[FdeApi] saveFileDialog not yet implemented`),null),getTheme:()=>c.h.getState().theme,setTheme:e=>{let t=e;t.taskbar&&t.window&&t.accent&&(c.h.getState().setCustomThemeColors(t),Fs(`theme-changed`,{theme:JSON.stringify(e)}))},showNotification:e=>{let t=w.ut();return w.o.getState().addNotification({id:t,title:e.title,message:e.message,fcIcon:e.type===`error`?`FcCancel`:e.type===`success`?`FcCheckmark`:`FcInfo`}),Fs(`notification-shown`,{notificationId:t}),t},hideNotification:e=>{w.o.getState().removeNotification(e)},getWindows:()=>w.o.getState().windows,getActiveWindow:()=>{let e=w.o.getState().windows,t=Ps();return t?e.find(e=>e.id===t)??null:null},getWindowById:e=>w.o.getState().windows.find(t=>t.id===e)??null,on:(e,t)=>(Ns.has(e)||Ns.set(e,new Set),Ns.get(e).add(t),()=>{Ns.get(e)?.delete(t)}),off:(e,t)=>{Ns.get(e)?.delete(t)},fs:w.n,appReady:e=>{w.v.getState().setAppReady(e)},registerAppInstance:(e,t)=>{w.v.getState().setAppReady(e,t)}},window.__FDE_API__=Ms,console.log(`[FdeApi] Initialized`)}function zs(){if(!Ms)throw Error(`[FdeApi] API not initialized. Call initializeFdeApi() first.`);return Ms}function Bs(){return Ms!==null}var Vs=!1;function Hs({defaultWallpaper:e,initialApp:t,prefetchLoaders:n}){let r=F.t(c.h(e=>e.wallpaper)??void 0),i=w.o(e=>e.windows),a=w.o(e=>e.icons),o=w.o(e=>e.initFs),s=w.o(e=>e.isFsReady),l=w.o(e=>e.fsNodes),u=w.o(e=>e.openContextMenu),d=w.o(e=>e.filesCurrentFolderId),f=w.o(e=>e.desktopFolderId),p=E.t(),{shouldShowWarning:m}=x.n(),{notify:h}=P.n(),[g,_]=(0,B.useState)(!1);rs(),us(),hs(),gs(),zo(),(0,B.useEffect)(()=>{Bs()||Rs()},[]),(0,B.useEffect)(()=>{if(!s)return;let e=document.getElementById(`initial-loader`);e&&(e.classList.add(`hidden`),setTimeout(()=>e.remove(),200))},[s]),(0,B.useEffect)(()=>{if(!n?.length)return;let e=setTimeout(()=>{js(n)},3e3);return()=>clearTimeout(e)},[n]),(0,B.useEffect)(()=>{Vs||(Vs=!0,Ts().finally(()=>{o(),t&&p(t)}))},[o,p,t]);let v=(0,B.useCallback)(e=>{e.preventDefault(),u(e.clientX,e.clientY,`desktop`)},[u]),y=(0,B.useCallback)((e,t)=>{e.preventDefault(),e.stopPropagation(),u(e.clientX,e.clientY,`desktop`,t)},[u]),b=(0,B.useCallback)((e,t)=>{let n;if(t){let r=l.find(e=>e.id===t);if(r?.type===`folder`)n={initialFolderId:t};else if(r?.type===`file`){let t=w.x(r);if(!t){h(`Unsupported file type`,`The type of file you are trying to open is not supported currently`,{fcIcon:`FcDeleteRow`});return}t.appId!==e&&h(`File type mismatch`,`Opening "${r.name}" as ${t.appId} instead of ${e}`,{fcIcon:`FcDeleteRow`}),p(t.appId,{contentData:t.contentData});return}}p(e,{contentData:n})},[p,l,h]);return s?(0,V.jsxs)(V.Fragment,{children:[m&&!g&&(0,V.jsx)(ts,{onDismiss:()=>_(!0)}),(0,V.jsxs)(Zn,{wallpaper:r??e,onContextMenu:v,children:[a.map(e=>(0,V.jsx)(Zo,{icon:e,onDoubleClick:b,onContextMenu:y},e.id)),(0,V.jsx)(Bn,{children:i.map(e=>(0,V.jsx)(Yo,{window:e},e.id))})]}),(0,V.jsx)(pa,{}),(0,V.jsx)($o,{owner:`desktop`,parentId:f,currentPath:`/home`}),(0,V.jsx)($o,{owner:`files`,parentId:d,currentPath:(()=>{let e=[`/home`],t=d,n=[];for(;t!==null;){let e=l.find(e=>e.id===t);if(!e)break;n.unshift(e.name),t=e.parentId}return[...e,...n].join(`/`)})()})]}):null}function Us({children:e,isReady:t,error:n,defaultWallpaper:r,initialApp:i,prefetchLoaders:a}){let o=me(),s=c.h(e=>e.setThemeMode),l=c.h(e=>e.toggleTheme),u=(0,B.useMemo)(()=>({fs:null,isReady:t,error:n,theme:o,setThemeMode:s,toggleTheme:l}),[t,n,o,s,l]);return e?(0,V.jsx)(qn,{children:(0,V.jsx)(Dn.Provider,{value:u,children:e})}):(0,V.jsx)(qn,{children:(0,V.jsx)(Dn.Provider,{value:u,children:(0,V.jsx)(Hs,{defaultWallpaper:r,initialApp:i,prefetchLoaders:a})})})}function Ws({children:e,fallback:t=null,theme:n,mantineTheme:r,fileSystem:i,initialMode:a,customApps:o,onError:s,defaultWallpaper:l,initialApp:u,prefetchLoaders:d}){let[f,p]=(0,B.useState)(!1),[m,h]=(0,B.useState)(null),g=c.h(e=>e.theme.mode),[_]=(0,B.useState)(a),v=_??g;(0,B.useEffect)(()=>{let e=!0;return(async()=>{try{E.T(),o&&E.O(o)}catch(e){console.error(`[FdeDesktop] Failed to initialize core registry:`,e)}if(!i){e&&p(!0);return}try{await i.initialize(),e&&p(!0)}catch(t){let n=t instanceof Error?t:Error(String(t));e&&(h(n),s?.(n))}})(),()=>{e=!1}},[i,o,s]);let y=(0,B.useMemo)(()=>Ie({...En,...r}),[r]);return m||!f?(0,V.jsx)(V.Fragment,{children:t}):(0,V.jsx)(Pe,{theme:y,forceColorScheme:v,children:(0,V.jsx)(pe,{mode:v,theme:n,children:(0,V.jsx)(Us,{isReady:f,error:m,defaultWallpaper:l,initialApp:u,prefetchLoaders:d,children:e})})})}var Gs=({component:e,windowId:t,contentData:n,onExit:r})=>e?(0,V.jsx)(e,{windowId:t,contentData:n,onExit:r}):null,Ks=w.C.filter(e=>e.id!==`settings`),qs=({opened:e,position:t,onClose:n,onOpenApp:r,onToggleTheme:i})=>(0,V.jsxs)(a.r,{opened:e,onClose:n,closeOnClickOutside:!0,closeOnEscape:!0,closeOnItemClick:!0,withinPortal:!0,children:[(0,V.jsx)(Qo,{x:t.x,y:t.y}),(0,V.jsxs)(a.r.Dropdown,{children:[Ks.map(e=>(0,V.jsxs)(a.r.Item,{onClick:()=>r(e.id),children:[`Open `,e.name]},e.id)),(0,V.jsx)(a.r.Divider,{}),(0,V.jsx)(a.r.Item,{onClick:i,children:`Toggle Theme`})]})]}),Js={container:`_container_1br66_1`},Ys=({notifyReady:e,window:t,config:n})=>{let r=(0,B.useRef)(!1),i=`${n.title} blocks embedding in iframes for security reasons.`;(0,B.useEffect)(()=>{r.current||(r.current=!0,e?.({...t?.contentData??{},openInBrowser:()=>{globalThis.window.open(n.url,`_blank`,`noopener,noreferrer`)}}))},[e,t,n.url]);let a=()=>{globalThis.window.open(n.url,`_blank`,`noopener,noreferrer`)},o=O.o(n.icon,{size:48,color:n.iconColor}),s=O.o(n.icon,{size:16,color:n.iconColor});return(0,V.jsx)(b.t,{className:Js.container,children:(0,V.jsxs)(C.t,{align:`center`,gap:`md`,children:[o,(0,V.jsx)(g.o,{size:`lg`,fw:500,children:n.title}),(0,V.jsxs)(g.o,{size:`sm`,c:`dimmed`,ta:`center`,children:[n.description??i,(0,V.jsx)(`br`,{}),`Click below to go to my `,n.title,` profile.`]}),(0,V.jsx)(v.t,{leftSection:s,onClick:a,children:n.buttonLabel})]})})},Xs=(e=0,t)=>{let[n,r]=(0,B.useState)(!1),[i,a]=(0,B.useState)({x:0,y:0});return{opened:n,position:i,open:(0,B.useCallback)((n,i)=>{if(n.preventDefault(),t&&!w.C.find(e=>e.id===t)?.hasContextMenu){n.stopPropagation();return}a({x:n.clientX,y:n.clientY+(i??e)}),r(!0)},[e,t]),close:(0,B.useCallback)(()=>r(!1),[])}};function Zs({snapshotRef:e,getCurrentState:t,initialSnapshot:n,onChange:r,appId:i}){let[a,o]=(0,B.useState)(!1),s=(0,B.useRef)(r);return(0,B.useEffect)(()=>{s.current=r},[r]),(0,B.useEffect)(()=>{if(e.current===null){if(i){let t=I.n.getState().getSnapshot(i);if(t!==null){e.current=t;return}}n!==void 0&&(e.current=n)}},[e,n,i]),(0,B.useEffect)(()=>{let n=t();if(e.current===null)return;let r=JSON.stringify(n)!==JSON.stringify(e.current);o(r),s.current&&s.current(r)},[t,e]),{isDirty:a,takeSnapshot:(0,B.useCallback)(()=>{let n=t();e.current=n,o(!1),i&&I.n.getState().setSnapshot(i,n),s.current&&s.current(!1)},[e,t,i]),reset:(0,B.useCallback)(()=>{o(!1),s.current&&s.current(!1)},[])}}function Qs(){return(0,B.useMemo)(()=>Bs()?zs():(console.warn(`[useFdeApi] API not initialized. Make sure initializeFdeApi() is called.`),null),[])}var $s={status:`idle`,loaded:0,total:null,percent:null,error:null},ec=()=>{let[e,t]=(0,B.useState)($s),n=(0,B.useCallback)(()=>t($s),[]),r=(0,B.useCallback)(async e=>{t({status:`downloading`,loaded:0,total:null,percent:null,error:null});try{let n=await fetch(e);if(!n.ok)return t(e=>({...e,status:`error`,error:`HTTP ${n.status}: ${n.statusText}`})),null;let r=n.headers.get(`Content-Length`),i=r?parseInt(r,10):null;if(!n.body){let e=await n.text();return t({status:`done`,loaded:e.length,total:e.length,percent:100,error:null}),e}let a=n.body.getReader(),o=[],s=0;for(;;){let{done:e,value:n}=await a.read();if(e)break;o.push(n),s+=n.byteLength;let r=i?Math.round(s/i*100):null;t({status:`downloading`,loaded:s,total:i,percent:r,error:null})}let c=new Uint8Array(s),l=0;for(let e of o)c.set(e,l),l+=e.byteLength;let u=new TextDecoder().decode(c);return t({status:`done`,loaded:s,total:i??s,percent:100,error:null}),u}catch(e){let n=e instanceof Error?e.message:`Unknown error`;return t(e=>({...e,status:`error`,error:n})),null}},[]);return{...e,download:r,reset:n}},tc={light:{mode:`light`,desktop:`#f0f4f8`,taskbar:`rgba(255, 255, 255, 0.9)`,window:`#ffffff`,accent:`#339af0`},dark:{mode:`dark`,desktop:`#1a1b1e`,taskbar:`rgba(26, 27, 30, 0.9)`,window:`#25262b`,accent:`#4dabf7`}},nc=typeof __APP_VERSION__==`string`?__APP_VERSION__:`0.4.0`,rc=()=>`${nc}-${typeof __PROD__==`boolean`&&__PROD__?`prod`:`dev`}-${typeof window<`u`&&window.__FDE_IN_DOCKER__?`docker`:`web`}`,ic=()=>typeof __PROD__==`boolean`&&__PROD__?`prod`:`dev`,ac=()=>typeof window>`u`?`web`:window.__FDE_IN_DOCKER__?`docker`:/Electron/i.test(navigator.userAgent)?`electron`:`web`,oc=e=>({primaryColor:`blue`,other:{desktop:e.desktop,taskbar:e.taskbar,window:e.window,accent:e.accent}});exports.ANIMATION_DURATION=E.n,exports.APPS=w.C,exports.APP_IDS=Y,exports.APP_ID_TO_TRANSLATION_KEY=ni,exports.APP_VERSION=nc,exports.AVAILABLE_FONTS=c.u,exports.AppEmptyState=T.t,exports.AppIcon=y.t,exports.AppLoading=po,exports.AppMenuBar=a.t,exports.AppReadyProvider=Ko,exports.BREAKPOINTS=w.p,exports.CORE_APPS=w.k,exports.CORE_APP_IDS=w.A,exports.CORE_REGISTRY=E.b,exports.CUSTOM_APPS_FOLDER_ID=w.J,exports.CalendarApp=t.t,exports.CalendarAppLazy=E.k,exports.CollapsibleSection=ci,exports.ColorPicker=r.t,exports.ContextMenu=qs,exports.ContextMenuAnchor=mi,exports.CreateItemApp=u.t,exports.CreateItemAppLazy=E.A,exports.CreateItemContextMenu=$o,exports.CustomAppLoader=Uo,exports.CustomAppLoadingScreen=mo,exports.CustomAppNotSupported=go,exports.CustomAppOffline=ho,exports.DEFAULT_FDE_THEME=fe,exports.DEFAULT_LANGUAGE=c.i,exports.DEFAULT_LAUNCHER_FOLDERS=w.Y,exports.DEFAULT_THEME_COLORS=tc,exports.DEFAULT_VIEWPORT_HEIGHT=w.s,exports.DEFAULT_VIEWPORT_WIDTH=w.c,exports.DEFAULT_WINDOW_DIMENSIONS=w.j,exports.DESKTOP_APPS=ri,exports.DESKTOP_APPS_ORDER=w.w,exports.DefaultThemeProvider=c.g,exports.Desktop=Zn,exports.DesktopIcon=Zo,exports.DeviceInfoApp=x.t,exports.DeviceInfoAppLazy=E.j,exports.DirtyIndicator=a.n,exports.DockerFileSystemAdapter=w.Z,exports.DownloadProgress=d.t,exports.DragDropProvider=A.a,exports.DynamicMenuBarRenderer=Gs,exports.EASE_IN=E.r,exports.EASE_OUT=E.i,exports.EXTRA_APPS=w.D,exports.EXTRA_APP_IDS=w.O,exports.ExternalLinkApp=Ys,exports.FONT_STACKS=c.d,exports.FdeDesktop=Ws,exports.FdeProvider=kn,exports.FileIcon=_.t,exports.FilePickerApp=L.t,exports.FilePickerModal=L.n,exports.FilesApp=P.t,exports.FilesAppLazy=E.M,exports.FolderPicker=L.a,exports.GITHUB_LATEST_RELEASE_URL=os,exports.GITHUB_RELEASES_REPO=as,exports.GOOGLE_FONTS_HREF=c.f,exports.ICON_COLUMN_WIDTH=w.l,exports.ICON_MARGIN=w.u,exports.ICON_ROW_HEIGHT=w.d,exports.IMAGE_MIME_TYPES=w.y,exports.IconColorPicker=u.n,exports.ImageViewerApp=R.t,exports.ImageViewerAppLazy=E.N,exports.ImageViewerMenuBar=se.t,exports.ImageViewerMenuBarLazy=E.P,exports.IndexedDBFileSystem=w.$,exports.LanguageFlag=c.p,exports.LanguageSelector=da,exports.Launcher=pi,exports.MenuEditApp=A.t,exports.MenuEditAppLazy=E.F,exports.MenuEditMenuBar=ie.t,exports.MenuEditMenuBarLazy=E.I,exports.NotesApp=I.t,exports.NotesAppLazy=E.L,exports.NotesMenuBar=re.t,exports.NotesMenuBarLazy=E.R,exports.PREDEFINED_LAUNCHER_FOLDERS=w.X,exports.PRESET_COLORS=ee.t,exports.PRESET_ICONS=u.r,exports.PROFILE=c.n,exports.PdfApp=te.t,exports.PdfAppLazy=E.z,exports.PdfMenuBar=oe.t,exports.PdfMenuBarLazy=E.B,exports.SETTINGS_SECTIONS=c.l,exports.SUPPORTED_LANGUAGES=c.a,exports.SettingsApp=c.t,exports.SettingsAppLazy=E.V,exports.SettingsMenuBar=ae.t,exports.SettingsMenuBarLazy=E.H,exports.SettingsSectionComponent=c.c,exports.SortOptions=w.M,exports.StorybookApp=ne.t,exports.TASKBAR_HEIGHT=w.f,exports.TEXT_MIME_TYPES=w.b,exports.Taskbar=pa,exports.TaskbarContextMenu=vi,exports.ThemeProvider=pe,exports.UploaderApp=S.t,exports.UploaderAppLazy=E.U,exports.VscIcon=M.t,exports.Window=Yo,exports.WindowButtonRegistryProvider=qn,exports.WindowManagerAdapter=w.nt,exports.appendDirtyIndicator=z.t,exports.buildBreadcrumbs=L.o,exports.centerWindowPosition=E.a,exports.checkHMREndpointExists=jo,exports.clearBrowserData=c.r,exports.clearManifestCache=w.L,exports.convertToAppEntry=w.R,exports.createDesktopIcon=w.ct,exports.createEaseIn=E.o,exports.createEaseOut=E.s,exports.createFile=w.rt,exports.createFolder=w.it,exports.createLauncherFolder=w.at,exports.createMaximizeTransition=E.c,exports.createMinimizeVariant=E.l,exports.createPanelVariants=E.u,exports.createPredefinedLauncherFolder=w.ot,exports.createRestoreVariant=E.d,exports.createWindow=w.lt,exports.createWindowVariants=E.f,exports.fetchAppManifest=w.z,exports.fileSystem=w.n,exports.formatBytes=S.n,exports.generateUUID=w.ut,exports.getAppComponent=E.x,exports.getAppIdForMime=w.x,exports.getAppName=E.S,exports.getBaseUrl=w.m,exports.getCachedManifest=w.B,exports.getCloseInterceptor=j.t,exports.getCustomAppById=w.V,exports.getCustomApps=w.H,exports.getEnvironment=ic,exports.getFdeApi=zs,exports.getFileExtension=_.n,exports.getFourRandomColors=T.n,exports.getMenuBarBuilder=E.C,exports.getMenuBarComponent=E.w,exports.getMimeTypeFromExtension=w.tt,exports.getPersistedThemeMode=c.m,exports.getReleaseType=ac,exports.getRuntime=g.t,exports.getVersionString=rc,exports.hashBlob=w.et,exports.i18n=ca,exports.initRegistry=E.E,exports.initializeFdeApi=Rs,exports.injectFontLink=c.s,exports.isBrowser=g.n,exports.isCustomApp=w.U,exports.isDev=g.r,exports.isDocker=g.i,exports.isElectron=g.a,exports.isFdeApiInitialized=Bs,exports.isLazyApp=E.D,exports.isNewerVersion=is,exports.maximizeTransition=E.p,exports.mergeAppsWithCustomApps=w.W,exports.migrateStorage=Ts,exports.minimizeVariant=E.m,exports.openVariants=E.h,exports.panelVariants=E.g,exports.prefetchApps=js,exports.randomWindowPosition=E._,exports.registerAppFileHandler=w.S,exports.registerCloseInterceptor=j.n,exports.registerComponents=E.O,exports.registerCustomApps=w.T,exports.registerDesktopApps=w.E,exports.removeFromManifestCache=w.G,exports.resetBaseUrlCache=w.h,exports.resetFileSystem=w.r,exports.resetHMRState=To,exports.resetWindowManager=w.i,exports.resolveFileUrl=w.a,exports.resolveUrl=w.g,exports.restoreVariant=E.v,exports.setApiBaseUrl=w.Q,exports.setTestBaseUrl=w._,exports.sortDesktopIcons=w.N,exports.sortDesktopIconsByMode=w.P,exports.sortNodes=w.F,exports.sortNodesByMode=w.I,exports.syncWithServer=w.K,exports.toMantineTheme=oc,exports.unregisterCloseInterceptor=j.r,exports.updateLauncherFolder=w.st,exports.updateManifestCache=w.q,exports.useAdaptiveDimensions=k.t,exports.useAnimationDuration=ti,exports.useAppName=ii,exports.useAppReady=Go,exports.useAppTempMemoryStore=I.n,exports.useAppUpdate=us,exports.useApplyFont=hs,exports.useClock=Zr,exports.useCloseInterceptor=j.i,exports.useCloseModalStore=j.a,exports.useCollapsible=oi,exports.useContextMenu=Xs,exports.useCustomAppHMR=Ro,exports.useCustomAppLifecycle=zo,exports.useCustomAppStore=w.v,exports.useDesktopStore=w.o,exports.useDeviceDetection=x.n,exports.useDownload=ec,exports.useDragDropState=A.n,exports.useDraggableItem=A.i,exports.useDroppableArea=A.r,exports.useDynamicIcon=O.t,exports.useDynamicIconElement=O.n,exports.useFcIcon=O.r,exports.useFcIconElement=O.i,exports.useFdeApi=Qs,exports.useFdeContext=An,exports.useFiIcon=O.a,exports.useFiIconElement=O.o,exports.useFolderName=A.o,exports.useFontDownload=c.o,exports.useIsDirty=Zs,exports.useLanguageSync=gs,exports.useNotifications=P.n,exports.useOpenApp=E.t,exports.useResolvedUrl=F.t,exports.useSearchFilter=ai,exports.useSettingsStore=c.h,exports.useSystemTheme=rs,exports.useTaskbarContextMenu=ei,exports.useTaskbarHeight=hi,exports.useTheme=me,exports.useThemeContext=he,exports.useVscIcon=O.s,exports.useVscIconElement=O.c,exports.useWindowButtonRegistry=Jn,exports.uuidv4=w.dt,exports.waitForContainer=Bo,exports.windowVariants=E.y;
|
|
1
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require(`./NotesApp-BmQIBtJ2.cjs`),t=require(`./SettingsApp-BE22l5UP.cjs`),n=require(`./useOpenApp-D-FOY88T.cjs`),r=require(`./desktopStore-C1jR6Fdb.cjs`),i=require(`./useDynamicIcon-CK6SjEv5.cjs`),a=require(`./useAdaptiveDimensions-3Lz4X0Tc.cjs`),o=require(`./MenuEditApp-BHptoJbz.cjs`),s=require(`./AppIcon-C8vHUVcb.cjs`),c=require(`./useCloseInterceptor-CdX-09Ib.cjs`),l=require(`./VscIcon-BYb_Soyy.cjs`),u=require(`./AppMenuBar-CAlkNHjj.cjs`),d=require(`./FilesApp-BC4UPNuw.cjs`),f=require(`./buildBreadcrumbs-Ccd8i11b.cjs`),p=require(`./DeviceInfoApp-BXQ9uOwF.cjs`),m=require(`./useResolvedUrl-Bb39DpVy.cjs`),h=require(`./CalendarApp-Z0bCCYsK.cjs`),g=require(`./FilePickerApp-By6-vbag.cjs`),_=require(`./AppEmptyState-CLc00OOG.cjs`),v=require(`./Colors-CNJbU7oq.cjs`),y=require(`./ImageViewerApp-B1niWF75.cjs`),b=require(`./PdfApp-krW8UI97.cjs`),x=require(`./DownloadProgress-CkTGTf0z.cjs`),S=require(`./UploaderApp-D_qD3O70.cjs`),C=require(`./ColorPicker-CQRRwY-y.cjs`),w=require(`./useMenuBarUtils-DAap0ukp.cjs`),T=require(`./NotesMenuBar-BzojwMtH.cjs`),E=require(`./MenuEditMenuBar-CCOSPAUe.cjs`),D=require(`./SettingsMenuBar-CZE2evG2.cjs`),O=require(`./PdfMenuBar-DWD0Qa3F.cjs`),k=require(`./ImageViewerMenuBar-BgzgSF3v.cjs`),A=require(`./CreateItemApp-BkFFFdX1.cjs`);require(`@mantine/core/styles.css`),require(`@mantine/dates/styles.css`);let j=require(`react`);j=e.a(j);let M=require(`react/jsx-runtime`),N=require(`@mantine/core`),P=require(`@tanstack/react-query`),F=require(`zustand`),I=require(`framer-motion`),L=require(`react-i18next`),R=require(`i18next`);R=e.a(R);let z=require(`i18next-browser-languagedetector`);z=e.a(z);let ee=require(`react-rnd`),B=require(`zustand/react/shallow`),V=require(`react-icons/fc`),te=require(`@xterm/xterm`),H=require(`@xterm/addon-fit`),U=require(`@xterm/addon-clipboard`);require(`@xterm/xterm/css/xterm.css`);let ne=require(`uuid`);var W=(0,j.createContext)(void 0),re={borderRadius:`8px`,headerHeight:40,minWidth:400,minHeight:300,defaultWidth:800,defaultHeight:600,shadow:`0 8px 32px rgba(0, 0, 0, 0.2)`},ie={height:48,position:`bottom`,background:`rgba(0, 0, 0, 0.8)`,blur:!0},ae={light:{mode:`light`,colors:{desktop:`#f0f4f8`,taskbar:`rgba(255, 255, 255, 0.9)`,window:`#ffffff`,accent:`#339af0`},window:re,taskbar:ie,desktop:{background:`linear-gradient(135deg, #667eea 0%, #764ba2 100%)`,iconSize:64,iconSpacing:16}},dark:{mode:`dark`,colors:{desktop:`#1a1b1e`,taskbar:`rgba(26, 27, 30, 0.9)`,window:`#25262b`,accent:`#4dabf7`},window:re,taskbar:ie,desktop:{background:`linear-gradient(135deg, #1a1b1e 0%, #2d1f3d 100%)`,iconSize:64,iconSpacing:16}}};function oe({children:e,initialMode:t=`light`,mode:n,theme:r}){let[i,a]=(0,j.useState)(n??t),o=(0,j.useRef)(null);(0,j.useEffect)(()=>{n!==void 0&&n!==i&&a(n)},[n,i]);let s=(0,j.useCallback)(()=>{a(e=>e===`light`?`dark`:`light`)},[]),c=(0,j.useCallback)(e=>{o.current=e},[]),l=(0,j.useCallback)(()=>{let e=ae[i],t=o.current;return t?{...e,colors:{desktop:r?.colors?.desktop??e.colors.desktop,taskbar:t.taskbar,window:t.window,accent:t.accent},window:{...e.window,...r?.window},taskbar:{...e.taskbar,...r?.taskbar},desktop:{...e.desktop,...r?.desktop}}:r?{mode:r.mode??e.mode,colors:{desktop:r.colors?.desktop??e.colors.desktop,taskbar:r.colors?.taskbar??e.colors.taskbar,window:r.colors?.window??e.colors.window,accent:r.colors?.accent??e.colors.accent},window:{...e.window,...r.window},taskbar:{...e.taskbar,...r.taskbar},desktop:{...e.desktop,...r.desktop}}:e},[i,r]);(0,j.useEffect)(()=>{document.documentElement.style.setProperty(`color-scheme`,i),document.documentElement.setAttribute(`data-mantine-color-scheme`,i)},[i]);let u=(0,j.useMemo)(()=>({getTheme:l,setMode:a,toggle:s,setCustomColors:c}),[l,a,s,c]);return(0,M.jsx)(W.Provider,{value:u,children:e})}function se(){let e=(0,j.useContext)(W);if(!e)throw Error(`useTheme must be used within a ThemeProvider`);return e.getTheme()}function ce(){let e=(0,j.useContext)(W);if(!e)throw Error(`useThemeContext must be used within a ThemeProvider`);return e}var le={primaryColor:`blue`,other:{desktop:{backgroundColor:`#1a1a2e`},taskbar:{backgroundColor:`#16213e`,textColor:`#ffffff`},window:{backgroundColor:`#0f0f23`,textColor:`#ffffff`,borderRadius:`8px`},accent:`#339af0`}},ue=(0,j.createContext)(void 0),de=new P.QueryClient({defaultOptions:{queries:{staleTime:1/0,gcTime:1/0}}});function fe({children:e,fileSystem:n,isReady:r,error:i}){let a=se(),o=t.g(e=>e.setThemeMode),s=t.g(e=>e.toggleTheme),c=(0,j.useMemo)(()=>({fs:r?n:null,isReady:r,error:i,theme:a,setThemeMode:o,toggleTheme:s}),[n,r,i,a,o,s]);return(0,M.jsx)(ue.Provider,{value:c,children:e})}function pe({children:e,fileSystem:n,initialMode:r,theme:i,mantineTheme:a,fallback:o=null,onError:s,queryClient:c=de}){let[l,u]=(0,j.useState)(!1),[d,f]=(0,j.useState)(null),p=t.g(e=>e.theme.mode),m=t.g(e=>e.setThemeMode);(0,j.useEffect)(()=>{r&&m(r)},[]),(0,j.useEffect)(()=>{let e=!0;return(async()=>{try{await n.initialize(),e&&u(!0)}catch(t){let n=t instanceof Error?t:Error(String(t));e&&(f(n),s?.(n))}})(),()=>{e=!1}},[n,s]);let h=(0,j.useMemo)(()=>(0,N.createTheme)({...le,...a}),[a]);return d||!l?(0,M.jsx)(M.Fragment,{children:o}):(0,M.jsx)(P.QueryClientProvider,{client:c,children:(0,M.jsx)(N.MantineProvider,{theme:h,forceColorScheme:p,children:(0,M.jsx)(oe,{mode:p,theme:i,children:(0,M.jsx)(fe,{fileSystem:n,isReady:l,error:d,children:e})})})})}function me(){let e=(0,j.useContext)(ue);if(!e)throw Error(`useFdeContext must be used within an FdeProvider`);return e}var he=(0,j.createContext)(null),ge=({children:e})=>{let t=(0,j.useRef)(new Map);return(0,M.jsx)(he.Provider,{value:{register:(e,n)=>{t.current.set(e,n)},unregister:e=>{t.current.delete(e)},getRect:e=>t.current.get(e)},children:e})},_e=()=>{let e=(0,j.useContext)(he);if(!e)throw Error(`useWindowButtonRegistry must be used within WindowButtonRegistryProvider`);return e},ve={root:`_root_1z0nr_1`},ye=`linear-gradient(90deg, rgba(42, 123, 155, 1) 0%, rgba(87, 199, 133, 1) 50%, rgba(237, 221, 83, 1) 100%)`,be=({children:e,onContextMenu:t,wallpaper:n,backgroundColor:i})=>{let a=r.o(e=>e.setViewportSize),o=(0,j.useRef)(null);(0,j.useEffect)(()=>{let e=o.current;if(!e)return;let t=new ResizeObserver(e=>{let{width:t,height:n}=e[0]?.contentRect??{};t&&t>0&&n&&n>0&&a(t,n)});return t.observe(e),()=>t.disconnect()},[a]);let s=n?`url(${n})`:ye;return(0,M.jsx)(`div`,{ref:o,className:ve.root,"data-testid":`desktop-area`,style:{"--taskbar-height":`48px`,backgroundColor:i??`transparent`,backgroundImage:s,backgroundSize:`cover`,backgroundPosition:`center`},onContextMenu:t,children:e})},xe=e=>e.toLocaleTimeString([],{hour:`2-digit`,minute:`2-digit`}),Se=()=>{let[e,t]=(0,j.useState)(()=>xe(new Date));return(0,j.useEffect)(()=>{let e=setInterval(()=>t(xe(new Date)),1e3);return()=>clearInterval(e)},[]),e},Ce=-8,we=0,Te=()=>{let[e,t]=(0,j.useState)({activeMenu:null,position:{x:0,y:0},targetWindowId:null}),n=(0,j.useCallback)((e,n)=>{e.preventDefault(),e.stopPropagation(),t({activeMenu:`window`,position:{x:e.clientX,y:e.clientY+Ce},targetWindowId:n})},[]),r=(0,j.useCallback)(e=>{e.preventDefault(),t({activeMenu:`panel`,position:{x:e.clientX,y:e.clientY+Ce},targetWindowId:null})},[]),i=(0,j.useCallback)(e=>{e.preventDefault(),e.stopPropagation(),t({activeMenu:`launcher`,position:{x:e.clientX,y:e.clientY+we},targetWindowId:null})},[]),a=(0,j.useCallback)(()=>{t(e=>({...e,activeMenu:null}))},[]);return{activeMenu:e.activeMenu,position:e.position,targetWindowId:e.targetWindowId,windowMenuOpened:e.activeMenu===`window`,panelMenuOpened:e.activeMenu===`panel`,launcherMenuOpened:e.activeMenu===`launcher`,openWindowMenu:n,openPanelMenu:r,openLauncherMenu:i,closeMenu:a}},Ee=()=>{let e=t.g(e=>e.animationDuration);return{duration:e,windowVariants:n.f(e),panelVariants:n.u(e),minimizeVariant:n.l(.3),restoreVariant:n.d(.3),maximizeTransition:n.c(.25),easeIn:n.o(e),easeOut:n.s(e)}},G={WELCOME:`welcome`,NOTEPAD:`notepad`,UPLOADER:`uploader`,FILES:`files`,SETTINGS:`settings`,PDF:`pdf`,CALENDAR:`calendar`,STORYBOOK:`storybook`,LINKEDIN:`linkedin`,GITHUB:`github`,IMAGE_VIEWER:`image-viewer`,DOS_EMULATOR:`dos-emulator`,DOOM:`doom`,TERMINAL:`terminal`,CODE_SERVER:`code-server`,DEVICE_INFO:`device-info`,MENUEDIT:`menuedit`},De={[G.FILES]:`filesApp`,[G.PDF]:`pdfViewer`,[G.IMAGE_VIEWER]:`imageViewer`,[G.DOS_EMULATOR]:`dosEmulator`,[G.CODE_SERVER]:`codeServer`,[G.DEVICE_INFO]:`deviceInfo`},Oe=[G.WELCOME,G.UPLOADER,G.TERMINAL,G.CODE_SERVER,G.STORYBOOK,G.SETTINGS,G.NOTEPAD,G.LINKEDIN,G.GITHUB,G.FILES,G.DOOM];function ke(e){let{t}=(0,L.useTranslation)(`apps`);return e?t(`names.${De[e]??e}`,e):``}function Ae(e,t,n){return(0,j.useMemo)(()=>{if(!t.trim())return e;let r=t.toLowerCase().trim();return e.filter(e=>{let t=n(e);return Array.isArray(t)?t.some(e=>e.toLowerCase().includes(r)):t.toLowerCase().includes(r)})},[e,t,n])}function je(e){let[t,n]=(0,j.useState)(e??new Set);return{expanded:t,toggle:(0,j.useCallback)(e=>{n(t=>{let n=new Set(t);return n.has(e)?n.delete(e):n.add(e),n})},[]),expand:(0,j.useCallback)(e=>{n(t=>{let n=new Set(t);return n.add(e),n})},[]),collapse:(0,j.useCallback)(e=>{n(t=>{let n=new Set(t);return n.delete(e),n})},[]),expandAll:(0,j.useCallback)(e=>{n(new Set(e))},[]),collapseAll:(0,j.useCallback)(()=>{n(new Set)},[]),reset:(0,j.useCallback)(()=>{n(new Set)},[]),isExpanded:(0,j.useCallback)(e=>t.has(e),[t])}}var Me={header:`_header_2d0oy_1`,iconContainer:`_iconContainer_2d0oy_20`,expandIcon:`_expandIcon_2d0oy_28`,icon:`_icon_2d0oy_20`,title:`_title_2d0oy_42`,content:`_content_2d0oy_48`},Ne=({title:e,fcIcon:t=`FcFolder`,expanded:n,onToggle:r,children:a,className:o,"aria-label":c})=>{let l=i.c(n?`VscRemove`:`VscAdd`,{size:14,className:Me.expandIcon});return(0,M.jsxs)(`div`,{className:o,children:[(0,M.jsxs)(N.UnstyledButton,{className:Me.header,onClick:r,"aria-expanded":n,"aria-label":c??e,children:[(0,M.jsx)(`span`,{className:Me.iconContainer,children:l}),(0,M.jsx)(`span`,{className:Me.icon,children:(0,M.jsx)(s.t,{fcIcon:t,size:16})}),(0,M.jsx)(N.Text,{size:`sm`,fw:500,className:Me.title,children:e})]}),n&&(0,M.jsx)(`div`,{className:Me.content,children:a})]})},K={trigger:`_trigger_4gumo_1`,panel:`_panel_4gumo_23`,searchContainer:`_searchContainer_4gumo_39`,searchInput:`_searchInput_4gumo_43`,scrollContainer:`_scrollContainer_4gumo_47`,appsSection:`_appsSection_4gumo_56`,appButton:`_appButton_4gumo_62`,appIcon:`_appIcon_4gumo_82`};function Pe(e){let t=e.icon,n=`fcIcon`in e?e.fcIcon:void 0,r=t?.startsWith(`Fc`)||t?.startsWith(`Fi`)||t?.startsWith(`Vsc`);return{id:e.id,name:e.name,fcIcon:n??(r?t:void 0),icon:r?void 0:t,iconUrl:`iconUrl`in e?e.iconUrl:void 0,iconColor:`iconColor`in e?e.iconColor:void 0}}var Fe=({app:e,onOpen:t})=>{let n=ke(e.id);return(0,M.jsxs)(`button`,{className:K.appButton,onClick:()=>t(e.id),role:`menuitem`,"aria-label":n,children:[(0,M.jsx)(`span`,{className:K.appIcon,children:(0,M.jsx)(s.t,{fcIcon:e.fcIcon,iconUrl:e.iconUrl,fallback:e.icon,color:e.iconColor})}),(0,M.jsx)(N.Text,{size:`sm`,children:n})]},e.id)},Ie=({folder:e,isExpanded:t,apps:n,onToggle:r,onOpen:i})=>(0,M.jsx)(Ne,{title:o.s(e),fcIcon:e.fcIcon,expanded:t,onToggle:r,children:n.map(e=>(0,M.jsx)(Fe,{app:e,onOpen:i},e.id))},e.id),Le=({fcIcon:e=`FcDebian`,onContextMenu:a})=>{let o=i.i(e,{size:22,style:{display:`block`}}),[s,c]=(0,j.useState)(!1),[l,u]=(0,j.useState)(``),d=n.t(),f=t.g(e=>e.theme.colors.taskbar),p=r.o(e=>e.launcherFolders),m=r.o(e=>e.customApps),{panelVariants:h}=Ee(),g=(0,j.useRef)(null),_=(0,j.useRef)(null),{expanded:v,toggle:y,reset:b}=je(new Set),x=(0,j.useMemo)(()=>[...r.st].sort((e,t)=>e.name.localeCompare(t.name)),[]),S=(0,j.useMemo)(()=>new Set(p.flatMap(e=>e.appIds)),[p]),C=Ae((0,j.useMemo)(()=>x.filter(e=>!S.has(e.id)),[x,S]),l,e=>[e.id,e.name]),w=(0,j.useMemo)(()=>{if(!l.trim())return[...p].sort((e,t)=>e.isPredefined===t.isPredefined?e.name.localeCompare(t.name):e.isPredefined?-1:1);let e=l.toLowerCase();return p.map(t=>({...t,appIds:t.appIds.filter(t=>{let n=x.find(e=>e.id===t);return n?n.id.toLowerCase().includes(e)||n.name.toLowerCase().includes(e):!1})})).filter(e=>e.appIds.length>0).sort((e,t)=>e.isPredefined===t.isPredefined?e.name.localeCompare(t.name):e.isPredefined?-1:1)},[p,l,x]),T=(0,j.useMemo)(()=>{if(!l.trim())return m;let e=l.toLowerCase();return m.filter(t=>t.id.toLowerCase().includes(e)||t.name.toLowerCase().includes(e))},[m,l]);(0,j.useEffect)(()=>{l.trim()&&s&&(w.map(e=>e.id).forEach(e=>{v.has(e)||y(e)}),T.length>0&&!v.has(`launcher-folder-custom-apps`)&&y(r.z))},[l,w,T,s,v,y]),(0,j.useEffect)(()=>{s||b()},[s,b]),(0,j.useEffect)(()=>{if(!s)return;let e=e=>{g.current&&!g.current.contains(e.target)&&(c(!1),u(``))},t=e=>{e.key===`Escape`&&(c(!1),u(``))};return document.addEventListener(`mousedown`,e),document.addEventListener(`keydown`,t),()=>{document.removeEventListener(`mousedown`,e),document.removeEventListener(`keydown`,t)}},[s]);let E=e=>{if(e.preventDefault(),e.stopPropagation(),s){c(!1),u(``);return}a?.(e)};(0,j.useEffect)(()=>{s&&_.current&&_.current.focus()},[s]);let D=(0,j.useCallback)(e=>{d(e),c(!1),u(``)},[d]),O=(0,j.useCallback)(e=>{y(e)},[y]),k=i.i(`FcSearch`,{size:16}),A=(0,j.useCallback)(()=>{s?(c(!1),u(``)):c(!0)},[s]);return(0,M.jsxs)(`div`,{ref:g,children:[(0,M.jsx)(`button`,{className:K.trigger,onClick:A,onContextMenu:E,"aria-label":`Launcher`,"aria-expanded":s,children:o}),(0,M.jsx)(I.AnimatePresence,{children:s&&(0,M.jsxs)(I.motion.div,{className:K.panel,style:{background:f},role:`menu`,"aria-label":`App launcher`,initial:h.initial,animate:h.animate,exit:h.exit,children:[(0,M.jsx)(`div`,{className:K.searchContainer,children:(0,M.jsx)(N.TextInput,{ref:_,placeholder:`Search apps...`,value:l,onChange:e=>u(e.target.value),leftSection:k,size:`xs`,classNames:{input:K.searchInput},"aria-label":`Search apps`})}),(0,M.jsxs)(`div`,{className:K.scrollContainer,children:[w.map(e=>{let t=v.has(e.id);return e.id===`launcher-folder-custom-apps`?T.length===0?null:(0,M.jsx)(Ie,{folder:e,isExpanded:t,apps:T.map(Pe),onToggle:()=>O(e.id),onOpen:D},e.id):(0,M.jsx)(Ie,{folder:e,isExpanded:t,apps:e.appIds.map(e=>x.find(t=>t.id===e)).filter(e=>e!==void 0).sort((e,t)=>e.name.localeCompare(t.name)).map(Pe),onToggle:()=>O(e.id),onOpen:D},e.id)}),C.length>0&&(0,M.jsx)(`div`,{className:K.appsSection,children:C.map(e=>(0,M.jsx)(Fe,{app:Pe(e),onOpen:D},e.id))}),l&&C.length===0&&w.length===0&&T.length===0&&(0,M.jsx)(N.Text,{size:`sm`,c:`dimmed`,ta:`center`,mt:`md`,children:`No apps found`})]})]})})]})},Re=({x:e,y:t})=>(0,M.jsx)(N.Menu.Target,{children:(0,M.jsx)(`div`,{"aria-hidden":`true`,style:{position:`fixed`,left:e,top:t,width:0,height:0,pointerEvents:`none`}})}),ze=e=>{let t=(0,j.useRef)(null),[n,r]=(0,j.useState)(0);return(0,j.useLayoutEffect)(()=>{if(t.current&&e){let e=t.current.offsetHeight;r(e)}},[e]),{menuRef:t,menuHeight:n}},Be={menuItem:`_menuItem_18vno_1`},Ve=8,He=({windowMenuOpened:e,panelMenuOpened:t,launcherMenuOpened:a,menuPosition:o,targetWindowId:s,targetWindowState:c,onCloseWindow:l,onMinimizeWindow:u,onMaximizeWindow:d,onRestoreWindow:f,onClose:p})=>{let{t:m}=(0,L.useTranslation)(`contextMenu`),h={size:14,style:{display:`block`}},g=()=>i.i(`FcCancel`,h),_=()=>i.i(`FcMinus`,h),v=()=>i.i(`FcTemplate`,h),y=()=>i.i(`FcUndo`,h),b=()=>i.i(`FcSettings`,h),x=()=>i.i(`FcFolder`,h),S=n.t(),C=ke(`menuedit`),w=r.o(e=>e.openWindow),T=c===`minimized`,E=c===`maximized`,{menuRef:D,menuHeight:O}=ze(e),{menuRef:k,menuHeight:A}=ze(t),{menuRef:P,menuHeight:F}=ze(a),[I,R]=(0,j.useState)(!1),[z,ee]=(0,j.useState)(!1),[B,V]=(0,j.useState)(!1);(0,j.useLayoutEffect)(()=>{e||R(!1),e&&O>0&&R(!0)},[e,O]),(0,j.useLayoutEffect)(()=>{t||ee(!1),t&&A>0&&ee(!0)},[t,A]),(0,j.useLayoutEffect)(()=>{a||V(!1),a&&F>0&&V(!0)},[a,F]);let te=(0,j.useMemo)(()=>e?{height:O,ready:I}:t?{height:A,ready:z}:a?{height:F,ready:B}:{height:0,ready:!1},[e,t,a,O,A,F,I,z,B]),H=(0,j.useMemo)(()=>{let{x:e,y:t}=o,{height:n,ready:r}=te,i=t-Ve;return r&&n>0&&t>window.innerHeight-48-n-Ve&&(i=t-n+Ve),{x:e,y:i}},[o,te]),U=()=>{p(),w({title:C,content:`menuedit`,fcIcon:`FcFolder`,x:Math.min(o.x+10,window.innerWidth-800),y:Math.min(o.y+10,window.innerHeight-600),width:700,height:500,minWidth:500,minHeight:400})},ne=()=>{p(),S(`settings`)},W=e=>({opacity:e?1:0,transition:`opacity 0.05s ease`,zIndex:99999});return(0,M.jsxs)(M.Fragment,{children:[(0,M.jsxs)(N.Menu,{opened:e,onClose:p,closeOnClickOutside:!0,closeOnEscape:!0,closeOnItemClick:!0,withinPortal:!0,children:[(0,M.jsx)(Re,{x:H.x,y:H.y}),(0,M.jsxs)(N.Menu.Dropdown,{ref:D,style:W(I),children:[!T&&(0,M.jsx)(N.Menu.Item,{onClick:()=>{s&&u(s)},children:(0,M.jsxs)(`div`,{className:Be.menuItem,children:[(0,M.jsx)(_,{}),` `,m(`window.minimize`)]})}),T||E?(0,M.jsx)(N.Menu.Item,{onClick:()=>{s&&f(s)},children:(0,M.jsxs)(`div`,{className:Be.menuItem,children:[(0,M.jsx)(y,{}),` `,m(`window.restore`)]})}):(0,M.jsx)(N.Menu.Item,{onClick:()=>{s&&d(s)},children:(0,M.jsxs)(`div`,{className:Be.menuItem,children:[(0,M.jsx)(v,{}),` `,m(`window.maximize`)]})}),(0,M.jsx)(N.Menu.Divider,{}),(0,M.jsx)(N.Menu.Item,{onClick:()=>{s&&l(s)},children:(0,M.jsxs)(`div`,{className:Be.menuItem,children:[(0,M.jsx)(g,{}),` `,m(`window.close`)]})})]})]}),(0,M.jsxs)(N.Menu,{opened:t,onClose:p,closeOnClickOutside:!0,closeOnEscape:!0,closeOnItemClick:!0,withinPortal:!0,children:[(0,M.jsx)(Re,{x:H.x,y:H.y}),(0,M.jsx)(N.Menu.Dropdown,{ref:k,style:W(z),children:(0,M.jsx)(N.Menu.Item,{onClick:()=>{S(`settings`)},children:(0,M.jsxs)(`div`,{className:Be.menuItem,children:[(0,M.jsx)(b,{}),` `,m(`apps:names.settings`)]})})})]}),(0,M.jsxs)(N.Menu,{opened:a,onClose:p,closeOnClickOutside:!0,closeOnEscape:!0,closeOnItemClick:!0,withinPortal:!0,children:[(0,M.jsx)(Re,{x:H.x,y:H.y}),(0,M.jsxs)(N.Menu.Dropdown,{ref:P,style:W(B),children:[(0,M.jsx)(N.Menu.Label,{children:m(`launcher.title`)}),(0,M.jsx)(N.Menu.Item,{leftSection:(0,M.jsx)(x,{}),onClick:U,children:m(`launcher.editLauncher`)}),(0,M.jsx)(N.Menu.Item,{leftSection:(0,M.jsx)(b,{}),onClick:ne,children:m(`apps:names.settings`)})]})]})]})},Ue={actions:{save:`Save`,saveAs:`Save As`,cancel:`Cancel`,ok:`OK`,open:`Open`,close:`Close`,delete:`Delete`,create:`Create`,new:`New`,exit:`Exit`,apply:`Apply`,discard:`Discard`,reset:`Reset`,download:`Download`,upload:`Upload`,copy:`Copy`,cut:`Cut`,paste:`Paste`,undo:`Undo`,redo:`Redo`,createFolder:`Create folder`,createFile:`Create new file`,select:`Select`},buttons:{minimize:`Minimize`,maximize:`Maximize`,restore:`Restore`,close:`Close`,yes:`Yes`,no:`No`,confirm:`Confirm`,continue:`Continue`},labels:{name:`Name`,title:`Title`,filename:`Filename`,url:`URL`,file:`File`,folder:`Folder`,home:`Home`,type:`Type`,loading:`Loading...`,search:`Search`,searchIcons:`Search icons...`,unsavedChanges:`Unsaved Changes`,unsaved:`Unsaved changes`,workInProgress:`Work In Progress`},messages:{areYouSure:`Are you sure?`,cannotBeUndone:`This action cannot be undone.`,noFileSelected:`No file selected`,folderEmpty:`This folder is empty`,noMatchingFiles:`No matching files`,noSubfolders:`No subfolders`,replaceFile:`Replace file?`,replaceFileMessage:`A file named "{{name}}" already exists. Do you want to replace it?`,yesReplace:`Yes, replace`,forBetterExperience:`For a better experience use this app desktop OR horizontal mode`,turnYourDevice:`Turn your device`,continueVertically:`Continue vertically?`},theme:{light:`Light`,dark:`Dark`,system:`System`,custom:`Custom`,switchToLight:`Switch to light mode`,switchToDark:`Switch to dark mode`},status:{error:`error`,success:`success`},menu:{file:`File`,edit:`Edit`,view:`View`},filePicker:{folderTreeAria:`Folder tree`,filesAria:`Files`,foldersAria:`Folders`,cancelAria:`Cancel`,openSelectedAria:`Open selected file`,fileNameAria:`File name`},externalLink:{securityMessage:`blocks embedding in iframes for security reasons.`,goToProfile:`Click below to go to my {{name}} profile.`},taskbar:{ariaLabel:`Taskbar`},launcher:{label:`Launcher`,ariaLabel:`App launcher`,selectedIcon:`Selected: {{icon}}`}},We={names:{notepad:`Notepad`,terminal:`Terminal`,filesApp:`Files`,files:`Files`,uploader:`Uploader`,settings:`Settings`,pdfViewer:`PDF Viewer`,calendar:`Calendar`,storybook:`Storybook`,linkedin:`LinkedIn`,github:`GitHub`,imageViewer:`Image Viewer`,dosEmulator:`DOS Emulator`,doom:`DOOM`,deviceInfo:`Device Info`,welcome:`Welcome`,menuedit:`Edit Launcher`,codeServer:`VS Code`},folders:{socialLinks:`Social Links`,office:`Office and media`,programming:`Programming`,games:`Games`,customApps:`Custom Apps`},descriptions:{notepad:`Markdown editor with rich text toolbar`,terminal:`Terminal emulator`,filesApp:`File explorer`,settings:`System settings`,pdfViewer:`PDF document viewer`,calendar:`Calendar view`,storybook:`Storybook playground`,linkedin:`LinkedIn profile link`,github:`GitHub profile link`,imageViewer:`Image viewer with file picker`,dosEmulator:`DOS game and program emulator`,doom:`Play the classic DOOM game`},launcher:{label:`Launcher`,ariaLabel:`App launcher`},imageViewer:{noImage:`No image to display. Please open one.`,fitToWindow:`Fit to window`,zoom:`Zoom`},pdf:{viewer:`PDF viewer`},dosEmulator:{noBundle:`No DOS program loaded. Open a .jsdos bundle to start.`,loading:`Loading DOS emulator...`,controls:{pause:`Pause`,resume:`Resume`,restart:`Restart`,mute:`Mute`,unmute:`Unmute`,fullscreen:`Fullscreen`},menu:{file:`File`,open:`Open Bundle`,restart:`Restart`,exit:`Exit`,emulation:`Emulation`,pause:`Pause`,resume:`Resume`,audio:`Audio`,mute:`Mute`,unmute:`Unmute`,volume:`Volume`},errors:{failedToLoad:`Failed to load DOS bundle`,notSupported:`DOS emulation is not supported in this browser`}},uploader:{clickToUpload:`Click here to upload`,selectDestination:`Select destination folder`,fileInfo:`File: {{name}} ({{size}})`,uploading:`Uploading...`,uploadProgress:`Upload progress`,uploadComplete:`Upload complete!`,uploadFailed:`Upload wasn't successful for the following reason`,readyToUpload:`Ready to upload`,showFile:`Show in Files`,openFile:`Open file`,upload:`Upload`,stepSelect:`Select`,stepDestination:`Destination`,stepUpload:`Upload`,stepDone:`Done`,folderSelected:`Folder selected`,uploadTo:`Destination`,uploadToRoot:`Uploading to root folder`},terminal:{notAvailable:`Terminal Not Available`,notAvailableMessage:`The terminal cannot be used because this environment does not currently allow terminal access.`,dockerRequired:`Please run in Docker mode to use the terminal.`,offlineTitle:`Terminal Unavailable`,offlineMessage:`The terminal requires a Docker environment to function. It connects directly to the container's shell.`,offlineInstructions:`To use the terminal, run the application in Docker mode:`,dockerCommand:`docker compose up dev`,openWelcome:`Open Welcome App`,connecting:`Connecting...`,connected:`Connected`,disconnected:`Disconnected`,connectionError:`Connection error`,menu:{edit:`Edit`,copy:`Copy`,paste:`Paste`,clear:`Clear`,reset:`Reset`,reconnect:`Reconnect`,exit:`Exit`},scrollback:`Lines`,shell:`Shell`},codeServer:{notAvailable:`VS Code Not Available`,notAvailableMessage:`VS Code (code-server) cannot be used in browser mode.`,dockerRequired:`Please run in Docker to use VS Code.`}},Ge={sections:{wallpaper:{label:`Wallpaper`,description:`Change the desktop background image.`},appearance:{label:`Appearance`,description:`Switch between light and dark mode.`},launcher:{label:`Launcher`,description:`Choose the launcher button icon.`},font:{label:`Font`,description:`Select the system font family.`},reset:{label:`Reset to Default`,description:`Reset all settings and data to defaults.`},language:{label:`Language`,description:`Choose your preferred language.`}},wallpaper:{title:`Wallpaper`,wallpaperType:`Wallpaper Type`,staticImage:`Static Image`,chooseFromImages:`Choose from Images`,uploadFromDisk:`Upload from disk`,resetToDefault:`Reset to default`,orEnterUrl:`Or enter a URL`,wallpaperPreview:`Wallpaper preview`},appearance:{title:`Appearance`,description:`Choose whether the desktop uses a light or dark theme, or follows the system preference.`,taskbar:`Taskbar`,window:`Window`,accent:`Accent`,animationDuration:`Animation Duration`,animationDescription:`Controls the speed of window open/close animations (0.1s - 1.0s) must save to see changes.`},font:{title:`Font`,description:`Changes the font across the entire desktop interface. Fonts must be downloaded before use.`,download:`Download`,fontSize:`Font Size`,downloadByName:`Download a font by name`,fromGoogleFonts:`(From Google Fonts)`,downloadError:`Font didn't download successfully. Try again with the correct name`,downloadSuccess:`Downloaded successfully.`,systemDefault:`System Default`},reset:{title:`Reset to Default`,description:`Reset all settings and data to their default values. This action cannot be undone.`,resetButton:`⚠️ Reset app to defaults?`,modalTitle:`Are you sure?`,modalDescription:`This will erase all your data and settings.`,goBack:`Please go back! 🙏`,burnEverything:`Yes, burn everything! 🔥`,keepFiles:`Yes, but keep my files`},language:{title:`Language`,description:`Select your preferred language for the desktop interface.`,selectPlaceholder:`Select language`,english:`English`,spanish:`Español`},all:`All Settings`},Ke={window:{title:`Window`,minimize:`Minimize`,maximize:`Maximize`,restore:`Restore`,close:`Close`,ariaLabels:{minimize:`Minimize`,maximize:`Maximize`,restore:`Restore`,close:`Close`}},unsavedModal:{title:`Unsaved Changes`,message:`You have unsaved changes. What would you like to do?`,dontSave:`Don't Save`,save:`Save`},fileDialog:{openFile:`Open file`,saveFile:`Save file`,selectFile:`Select file {{name}}`,openFolder:`Open folder {{name}}`,selectFolder:`Select folder`,filename:`filename.md`}},qe={window:{minimize:`Minimize`,restore:`Restore`,maximize:`Maximize`,close:`Close window`},actions:{cut:`Cut`,copy:`Copy`,paste:`Paste`,pasteItems:`Paste ({{count}} items)`,delete:`Delete`,createFolder:`Create folder`,createFile:`Create new file`},createItem:{folderTitle:`Create Folder`,fileTitle:`Create File`,newFolder:`New Folder`,newFile:`New File`,nameError:`There is already a {{mode}} with that name`,clearNameAria:`Clear name`,customIcon:`Choose custom icon or color`,colorError:`Enter a valid hex color (e.g. #ff0000)`,changeLater:`You can change the icon later in folder properties.`},deleteConfirm:{title:`Delete "{{name}}"?`,message:`Are you sure you want to delete "{{name}}"? This action cannot be undone.`},app:{open:`Open {{name}}`,toggleTheme:`Toggle Theme`},sort:{title:`Sort Icons`,default:`Default`,nameAsc:`Name (A-Z)`,nameDesc:`Name (Z-A)`,byType:`By Type`},launcher:{title:`Launcher`,editLauncher:`Edit Launcher`}},Je={empty:{title:`There are no new notifications`,message:`For now`},taskbar:{showNotifications:`Show notifications`,hideNotifications:`Hide notifications`,clock:`clock`}},Ye={toolbar:{formatting:`Text formatting`,bold:`Bold`,italic:`Italic`,strikethrough:`Strikethrough`,inlineCode:`Inline code`,heading1:`Heading 1`,heading2:`Heading 2`,bulletList:`Bullet list`,orderedList:`Ordered list`,blockquote:`Blockquote`,codeBlock:`Code block`,horizontalRule:`Horizontal rule`},untitled:`untitled.md`},Xe={hero:{title:`Fullstack Developer & DevOps`,downloadCV:`Download CV`,contactMe:`Contact Me`},skills:{technical:`Technical Skills`,soft:`Soft Skills`},experience:`Professional Experience`,techStack:`Tech Stack`,languages:`Languages`},Ze={title:`Edit Launcher`,newFolder:`New Folder`,predefined:`Predefined`,rename:`Rename`,delete:`Delete`,predefinedFolders:`Predefined Folders`,customFolders:`Custom Folders`,availableApps:`Available Apps (drag and drop to add to folder)`,clickToAdd:`Click to add to first custom folder`,addFolder:`Add folder`,instructions:`Right-click an app in a folder to remove it. Click an available app to add it to the first custom folder.`,canCreateNewFolder:`You can create new folders if needed.`},Qe={actions:{save:`Guardar`,saveAs:`Guardar como`,cancel:`Cancelar`,ok:`Aceptar`,open:`Abrir`,close:`Cerrar`,delete:`Eliminar`,create:`Crear`,new:`Nuevo`,exit:`Salir`,apply:`Aplicar`,discard:`Descartar`,reset:`Restablecer`,download:`Descargar`,upload:`Subir`,copy:`Copiar`,cut:`Cortar`,paste:`Pegar`,undo:`Deshacer`,redo:`Rehacer`,createFolder:`Crear carpeta`,createFile:`Crear nuevo archivo`,select:`Seleccionar`},buttons:{minimize:`Minimizar`,maximize:`Maximizar`,restore:`Restaurar`,close:`Cerrar`,yes:`Sí`,no:`No`,confirm:`Confirmar`,continue:`Continuar`},labels:{name:`Nombre`,title:`Título`,filename:`Nombre de archivo`,url:`URL`,file:`Archivo`,folder:`Carpeta`,home:`Inicio`,type:`Tipo`,loading:`Cargando...`,search:`Buscar`,searchIcons:`Buscar iconos...`,unsavedChanges:`Cambios sin guardar`,unsaved:`Cambios sin guardar`,workInProgress:`Trabajo en progreso`},messages:{areYouSure:`¿Estás seguro?`,cannotBeUndone:`Esta acción no se puede deshacer.`,noFileSelected:`Ningún archivo seleccionado`,folderEmpty:`Esta carpeta está vacía`,noMatchingFiles:`No hay archivos coincidentes`,noSubfolders:`Sin subcarpetas`,replaceFile:`¿Reemplazar archivo?`,replaceFileMessage:`Ya existe un archivo llamado "{{name}}". ¿Deseas reemplazarlo?`,yesReplace:`Sí, reemplazar`,forBetterExperience:`Para una mejor experiencia usa esta aplicación en modo escritorio u horizontal`,turnYourDevice:`Gira tu dispositivo`,continueVertically:`¿Continuar verticalmente?`},theme:{light:`Claro`,dark:`Oscuro`,system:`Sistema`,custom:`Personalizado`,switchToLight:`Cambiar a modo claro`,switchToDark:`Cambiar a modo oscuro`},status:{error:`error`,success:`éxito`},menu:{file:`Archivo`,edit:`Editar`,view:`Ver`},filePicker:{folderTreeAria:`Árbol de carpetas`,filesAria:`Archivos`,foldersAria:`Carpetas`,cancelAria:`Cancelar`,openSelectedAria:`Abrir archivo seleccionado`,fileNameAria:`Nombre de archivo`},externalLink:{securityMessage:`bloquea la incrustación en iframes por razones de seguridad.`,goToProfile:`Haz clic abajo para ir a mi perfil de {{name}}.`},taskbar:{ariaLabel:`Barra de tareas`},launcher:{label:`Lanzador`,ariaLabel:`Lanzador de aplicaciones`,selectedIcon:`Seleccionado: {{icon}}`}},$e={names:{notepad:`Bloc de notas`,terminal:`Terminal`,filesApp:`Archivos`,files:`Archivos`,uploader:`Subida de archivos`,settings:`Ajustes`,pdfViewer:`Visor PDF`,calendar:`Calendario`,storybook:`Storybook`,linkedin:`LinkedIn`,github:`GitHub`,imageViewer:`Visor de imágenes`,dosEmulator:`Emulador DOS`,doom:`DOOM`,deviceInfo:`Info del dispositivo`,welcome:`Bienvenido`,menuedit:`Editar lanzador`,codeServer:`VS Code`},folders:{socialLinks:`Enlaces sociales`,office:`Oficina y medios`,programming:`Programación`,games:`Juegos`,customApps:`Aplicaciones personalizadas`},descriptions:{notepad:`Editor Markdown con barra de herramientas`,terminal:`Emulador de terminal`,filesApp:`Explorador de archivos`,settings:`Ajustes del sistema`,pdfViewer:`Visor de documentos PDF`,calendar:`Vista de calendario`,storybook:`Zona de pruebas Storybook`,linkedin:`Enlace al perfil de LinkedIn`,github:`Enlace al perfil de GitHub`,imageViewer:`Visor de imágenes con selector de archivos`,dosEmulator:`Emulador de juegos y programas DOS`,doom:`Juega al clásico DOOM`},launcher:{label:`Lanzador`,ariaLabel:`Lanzador de aplicaciones`},imageViewer:{noImage:`Sin imagen para mostrar. Por favor, abre una.`,fitToWindow:`Ajustar a ventana`,zoom:`Zoom`},pdf:{viewer:`Visor PDF`},dosEmulator:{noBundle:`Ningún programa DOS cargado. Abre un bundle .jsdos para comenzar.`,loading:`Cargando emulador DOS...`,controls:{pause:`Pausar`,resume:`Reanudar`,restart:`Reiniciar`,mute:`Silenciar`,unmute:`Activar sonido`,fullscreen:`Pantalla completa`},menu:{file:`Archivo`,open:`Abrir Bundle`,restart:`Reiniciar`,exit:`Salir`,emulation:`Emulación`,pause:`Pausar`,resume:`Reanudar`,audio:`Audio`,mute:`Silenciar`,unmute:`Activar sonido`,volume:`Volumen`},errors:{failedToLoad:`Error al cargar el bundle DOS`,notSupported:`La emulación DOS no está soportada en este navegador`}},uploader:{clickToUpload:`Haz clic aquí para subir`,selectDestination:`Seleccionar carpeta destino`,fileInfo:`Archivo: {{name}} ({{size}})`,uploading:`Subiendo...`,uploadProgress:`Progreso de subida`,uploadComplete:`¡Subida completada!`,uploadFailed:`La subida no fue exitosa por la siguiente razón`,readyToUpload:`Listo para subir`,showFile:`Mostrar en Archivos`,openFile:`Abrir archivo`,upload:`Subir`,stepSelect:`Seleccionar`,stepDestination:`Destino`,stepUpload:`Subir`,stepDone:`Listo`,folderSelected:`Carpeta seleccionada`,uploadTo:`Destino`,uploadToRoot:`Subiendo a la carpeta raíz`},terminal:{notAvailable:`Terminal no disponible`,notAvailableMessage:`La terminal no puede usarse porque este entorno no permite actualmente el acceso a terminal.`,dockerRequired:`Por favor, ejecuta en modo Docker para usar la terminal.`,offlineTitle:`Terminal no disponible`,offlineMessage:`La terminal requiere un entorno Docker para funcionar. Se conecta directamente al shell del contenedor.`,offlineInstructions:`Para usar la terminal, ejecuta la aplicación en modo Docker:`,dockerCommand:`docker compose up dev`,openWelcome:`Abrir Bienvenida`,connecting:`Conectando...`,connected:`Conectado`,disconnected:`Desconectado`,connectionError:`Error de conexión`,menu:{edit:`Editar`,copy:`Copiar`,paste:`Pegar`,clear:`Limpiar`,reset:`Reiniciar`,reconnect:`Reconectar`,exit:`Salir`},scrollback:`Líneas`,shell:`Shell`},codeServer:{notAvailable:`VS Code no disponible`,notAvailableMessage:`VS Code (code-server) no puede usarse en modo navegador.`,dockerRequired:`Por favor, ejecuta la aplicación en Docker para usar VS Code.`}},et={sections:{wallpaper:{label:`Fondo de pantalla`,description:`Cambia la imagen de fondo del escritorio.`},appearance:{label:`Apariencia`,description:`Cambia entre modo claro y oscuro.`},launcher:{label:`Lanzador`,description:`Elige el icono del botón del lanzador.`},font:{label:`Fuente`,description:`Selecciona la familia de fuentes del sistema.`},reset:{label:`Restablecer`,description:`Restaura todos los ajustes y datos a sus valores por defecto.`},language:{label:`Idioma`,description:`Elige tu idioma preferido.`}},wallpaper:{title:`Fondo de pantalla`,wallpaperType:`Tipo de fondo`,staticImage:`Imagen estática`,chooseFromImages:`Elegir de imágenes`,uploadFromDisk:`Subir desde disco`,resetToDefault:`Restablecer por defecto`,orEnterUrl:`O introduce una URL`,wallpaperPreview:`Vista previa del fondo`},appearance:{title:`Apariencia`,description:`Elige si el escritorio usa un tema claro u oscuro, o sigue la preferencia del sistema.`,taskbar:`Barra de tareas`,window:`Ventana`,accent:`Acento`,animationDuration:`Duración de animación`,animationDescription:`Controla la velocidad de las animaciones de abrir/cerrar ventanas (0.1s - 1.0s), debes guardar para ver los cambios.`},font:{title:`Fuente`,description:`Cambia la fuente en toda la interfaz del escritorio. Las fuentes deben descargarse antes de usar.`,download:`Descargar`,fontSize:`Tamaño de fuente`,downloadByName:`Descargar una fuente por nombre`,fromGoogleFonts:`(Desde Google Fonts)`,downloadError:`La fuente no se descargó correctamente. Intenta de nuevo con el nombre correcto`,downloadSuccess:`Descargada correctamente.`,systemDefault:`Sistema por defecto`},reset:{title:`Restablecer`,description:`Restaura todos los ajustes y datos a sus valores por defecto. Esta acción no se puede deshacer.`,resetButton:`⚠️ ¿Restablecer la app?`,modalTitle:`¿Estás seguro?`,modalDescription:`Esto borrará todos tus datos y ajustes.`,goBack:`¡Por favor vuelve atrás! 🙏`,burnEverything:`¡Sí, quémalo todo! 🔥`,keepFiles:`Sí, pero mantener mis archivos`},language:{title:`Idioma`,description:`Selecciona tu idioma preferido para la interfaz del escritorio.`,selectPlaceholder:`Selecciona idioma`,english:`English`,spanish:`Español`},all:`Todos los ajustes`},tt={window:{title:`Ventana`,minimize:`Minimizar`,maximize:`Maximizar`,restore:`Restaurar`,close:`Cerrar`,ariaLabels:{minimize:`Minimizar`,maximize:`Maximizar`,restore:`Restaurar`,close:`Cerrar`}},unsavedModal:{title:`Cambios sin guardar`,message:`Tienes cambios sin guardar. ¿Qué deseas hacer?`,dontSave:`No guardar`,save:`Guardar`},fileDialog:{openFile:`Abrir archivo`,saveFile:`Guardar archivo`,selectFile:`Seleccionar archivo {{name}}`,openFolder:`Abrir carpeta {{name}}`,selectFolder:`Seleccionar carpeta`,filename:`nombre.md`}},nt={window:{minimize:`Minimizar`,restore:`Restaurar`,maximize:`Maximizar`,close:`Cerrar ventana`},actions:{cut:`Cortar`,copy:`Copiar`,paste:`Pegar`,pasteItems:`Pegar ({{count}} elementos)`,delete:`Eliminar`,createFolder:`Crear carpeta`,createFile:`Crear nuevo archivo`},createItem:{folderTitle:`Crear Carpeta`,fileTitle:`Crear Archivo`,newFolder:`Nueva Carpeta`,newFile:`Nuevo Archivo`,nameError:`Ya existe un {{mode}} con ese nombre`,clearNameAria:`Limpiar nombre`,customIcon:`Elige icono o color personalizado`,colorError:`Introduce un color hexadecimal válido (ej. #ff0000)`,changeLater:`Puedes cambiar el icono más tarde en las propiedades de la carpeta.`},deleteConfirm:{title:`¿Eliminar "{{name}}"?`,message:`¿Estás seguro de que quieres eliminar "{{name}}"? Esta acción no se puede deshacer.`},app:{open:`Abrir {{name}}`,toggleTheme:`Cambiar Tema`},sort:{title:`Ordenar Iconos`,default:`Por defecto`,nameAsc:`Nombre (A-Z)`,nameDesc:`Nombre (Z-A)`,byType:`Por Tipo`},launcher:{title:`Launcher`,editLauncher:`Editar Launcher`}},rt={empty:{title:`No hay notificaciones nuevas`,message:`Por ahora`},taskbar:{showNotifications:`Mostrar notificaciones`,hideNotifications:`Ocultar notificaciones`,clock:`reloj`}},it={toolbar:{formatting:`Formato de texto`,bold:`Negrita`,italic:`Cursiva`,strikethrough:`Tachado`,inlineCode:`Código en línea`,heading1:`Título 1`,heading2:`Título 2`,bulletList:`Lista con viñetas`,orderedList:`Lista ordenada`,blockquote:`Cita`,codeBlock:`Bloque de código`,horizontalRule:`Línea horizontal`},untitled:`sin-titulo.md`},at={hero:{title:`Fullstack Developer & DevOps`,downloadCV:`Descargar CV`,contactMe:`Contactar`},skills:{technical:`Habilidades Técnicas`,soft:`Habilidades Blandas`},experience:`Experiencia Profesional`,techStack:`Stack Tecnológico`,languages:`Idiomas`},ot={newFolder:`Nueva Carpeta`,predefined:`Predefinida`,rename:`Renombrar`,delete:`Eliminar`,predefinedFolders:`Carpetas Predefinidas`,customFolders:`Carpetas Personalizadas`,availableApps:`Apps Disponibles (arrastrar y soltar para añadir a carpetas)`,clickToAdd:`Clic para añadir a la primera carpeta personalizada`,addFolder:`Añadir carpeta`,instructions:`Clic derecho en una app dentro de una carpeta para eliminarla. Clic en una app disponible para añadirla a la primera carpeta personalizada.`,canCreateNewFolder:`Puedes crear una nueva carpeta si lo necesitas.`},st=[`en`,`es`];R.default.use(z.default).use(L.initReactI18next).init({resources:{en:{common:Ue,apps:We,settings:Ge,window:Ke,contextMenu:qe,notifications:Je,notes:Ye,welcome:Xe,menuedit:Ze},es:{common:Qe,apps:$e,settings:et,window:tt,contextMenu:nt,notifications:rt,notes:it,welcome:at,menuedit:ot}},fallbackLng:`en`,supportedLngs:st,ns:[`common`,`apps`,`settings`,`window`,`contextMenu`,`notifications`,`notes`,`welcome`,`menuedit`],defaultNS:`common`,interpolation:{escapeValue:!1},detection:{order:[`localStorage`,`navigator`],lookupLocalStorage:`fde-desktop:language`,caches:[`localStorage`]}});var ct=R.default,q={root:`_root_17um1_1`,windowButton:`_windowButton_17um1_15`,systemTray:`_systemTray_17um1_44`,themeToggle:`_themeToggle_17um1_51`,clock:`_clock_17um1_70`,notifButton:`_notifButton_17um1_88`,langButton:`_langButton_17um1_109`},lt={en:`English`,es:`Español`},ut=()=>{let{t:e,i18n:n}=(0,L.useTranslation)(`settings`),r=t.g(e=>e.language),i=t.g(e=>e.setLanguage),[a,o]=(0,j.useState)(!1),s=(0,j.useCallback)(e=>{i(e),n.changeLanguage(e),localStorage.setItem(`fde-desktop:language`,e),o(!1)},[i,n]);return(0,M.jsxs)(N.Popover,{opened:a,onChange:o,position:`top-end`,shadow:`md`,withArrow:!0,children:[(0,M.jsx)(N.Popover.Target,{children:(0,M.jsx)(N.UnstyledButton,{className:q.langButton,onClick:()=>o(e=>!e),"aria-label":e(`language.selectPlaceholder`),"aria-expanded":a,children:(0,M.jsx)(t.m,{lang:r,size:16})})}),(0,M.jsx)(N.Popover.Dropdown,{children:(0,M.jsx)(N.Stack,{gap:`xs`,children:st.map(e=>(0,M.jsx)(N.UnstyledButton,{onClick:()=>s(e),"aria-label":lt[e],"aria-pressed":e===r,style:{padding:`8px 12px`,borderRadius:6,width:`100%`,background:e===r?`var(--mantine-primary-color-light)`:`transparent`,cursor:`pointer`},children:(0,M.jsxs)(N.Group,{gap:`sm`,children:[(0,M.jsx)(t.m,{lang:e,size:20}),(0,M.jsx)(N.Text,{size:`sm`,fw:e===r?600:400,children:lt[e]})]})},e))})})]})},dt=({win:e,onClick:t,onContextMenu:n})=>{let r=(0,j.useRef)(null),{register:i,unregister:a}=_e();return(0,j.useEffect)(()=>(r.current&&i(e.id,r.current.getBoundingClientRect()),()=>a(e.id)),[e.id,i,a]),(0,M.jsxs)(`button`,{ref:r,className:q.windowButton,"data-active":e.state===`minimized`?`false`:`true`,onClick:t,onContextMenu:n,"aria-label":e.title,children:[(0,M.jsx)(s.t,{fcIcon:e.fcIcon,iconUrl:e.iconUrl,fallback:e.icon,size:14,color:e.iconColor}),(0,M.jsx)(N.Text,{size:`xs`,truncate:!0,children:e.title})]})},ft=({calendarSlot:e})=>{let{t:n}=(0,L.useTranslation)(`notifications`),i=t.g(e=>e.theme.colors.taskbar),a=t.g(e=>e.theme.mode),o=t.g(e=>e.toggleTheme),c=t.g(e=>e.launcherIcon),l=r.o(e=>e.notifications),u=r.o(e=>e.removeNotification),d=r.o(e=>e.windows),f=r.o(e=>e.restoreWindow),p=r.o(e=>e.minimizeWindow),m=r.o(e=>e.focusWindow),h=r.o(e=>e.closeWindow),g=r.o(e=>e.maximizeWindow),_=Se(),[v,y]=(0,j.useState)(!1),[b,x]=(0,j.useState)(!1),{position:S,targetWindowId:C,windowMenuOpened:w,panelMenuOpened:T,launcherMenuOpened:E,openWindowMenu:D,openPanelMenu:O,openLauncherMenu:k,closeMenu:A}=Te(),P=C?d.find(e=>e.id===C)?.state??null:null,F=(0,j.useRef)(0);(0,j.useEffect)(()=>{l.length>F.current&&setTimeout(()=>x(!0),0),F.current=l.length},[l.length]);let I=d.filter(e=>e.isOpen),R=(e,t)=>{t===`minimized`?(f(e),m(e)):p(e)};return(0,M.jsxs)(M.Fragment,{children:[(0,M.jsxs)(`div`,{className:q.root,style:{background:i},role:`toolbar`,"aria-label":`Taskbar`,onContextMenu:O,children:[(0,M.jsx)(Le,{fcIcon:c,onContextMenu:k}),I.map(e=>(0,M.jsx)(dt,{win:e,onClick:()=>R(e.id,e.state),onContextMenu:t=>D(t,e.id)},e.id)),(0,M.jsxs)(`div`,{className:q.systemTray,"data-testid":`system-tray`,children:[(0,M.jsxs)(N.Popover,{opened:b,onChange:x,position:`top-end`,shadow:`md`,withArrow:!0,keepMounted:!0,children:[(0,M.jsx)(N.Popover.Target,{children:(0,M.jsx)(`button`,{className:q.notifButton,onClick:()=>x(e=>!e),"aria-label":n(b?`taskbar.hideNotifications`:`taskbar.showNotifications`),children:(0,M.jsx)(s.t,{fcIcon:b?`FcCollapse`:`FcExpand`,size:18})})}),(0,M.jsx)(N.Popover.Dropdown,{style:{background:`transparent`,border:`none`,padding:0},children:(0,M.jsx)(`div`,{style:{display:`flex`,flexDirection:`column`,gap:8,minWidth:300},children:l.length===0?(0,M.jsx)(N.Notification,{title:n(`empty.title`),onClose:()=>x(!1),children:n(`empty.message`)}):l.map(e=>(0,M.jsx)(N.Notification,{withBorder:!0,icon:e.fcIcon?(0,M.jsx)(s.t,{fcIcon:e.fcIcon,size:18}):void 0,title:e.title,onClose:()=>{u(e.id),e.onClose?.()},children:e.message},e.id))})})]}),(0,M.jsx)(ut,{}),(0,M.jsx)(`button`,{className:q.themeToggle,onClick:o,"aria-label":n(a===`dark`?`theme.switchToLight`:`theme.switchToDark`,{ns:`common`}),title:n(a===`dark`?`theme.switchToLight`:`theme.switchToDark`,{ns:`common`}),children:a===`dark`?`☀️`:`🌙`}),(0,M.jsxs)(N.Popover,{opened:v,onChange:y,position:`top-end`,shadow:`md`,withArrow:!0,children:[(0,M.jsx)(N.Popover.Target,{children:(0,M.jsx)(`button`,{className:q.clock,onClick:()=>y(e=>!e),"aria-label":n(`taskbar.clock`),"aria-expanded":v,children:(0,M.jsx)(N.Text,{size:`xs`,children:_})})}),(0,M.jsx)(N.Popover.Dropdown,{children:e})]})]})]}),(0,M.jsx)(He,{windowMenuOpened:w,panelMenuOpened:T,launcherMenuOpened:E,menuPosition:S,targetWindowId:C,targetWindowState:P,onCloseWindow:h,onMinimizeWindow:p,onMaximizeWindow:g,onRestoreWindow:f,onClose:A})]})},pt=({message:e=`Loading...`,size:t=`lg`})=>(0,M.jsx)(N.Center,{style:{width:`100%`,height:`100%`},children:(0,M.jsxs)(N.Stack,{align:`center`,gap:`md`,children:[(0,M.jsx)(N.Loader,{size:t}),(0,M.jsx)(N.Text,{c:`dimmed`,children:e})]})}),mt=({progress:e,windowIcon:t})=>{let n=(0,N.useMantineTheme)(),r=()=>{switch(e.state){case`fetching`:return`Fetching app info...`;case`compiling`:return`Compiling app...`;case`loading`:return`Loading app...`;case`ready`:return`Ready!`;case`error`:return`Error loading app`;default:return`Loading...`}},i=()=>e.state===`error`?`red`:e.state===`ready`?`green`:n.primaryColor;return(0,M.jsx)(N.Center,{style:{width:`100%`,height:`100%`},"data-testid":`custom-app-loading`,children:(0,M.jsxs)(N.Stack,{align:`center`,gap:`lg`,p:`xl`,children:[t&&(0,M.jsx)(N.Text,{size:`3rem`,children:t}),(0,M.jsx)(N.Text,{size:`lg`,fw:700,children:e.appName||`App`}),(0,M.jsx)(N.Progress,{value:e.progress,size:`lg`,radius:`xl`,animated:e.state===`loading`||e.state===`compiling`,style:{minWidth:200},color:i()}),(0,M.jsx)(N.Text,{size:`sm`,c:`dimmed`,children:r()}),e.state===`error`&&(0,M.jsx)(N.Text,{size:`xs`,c:`red`,ta:`center`,children:e.error}),(0,M.jsxs)(N.Text,{size:`xs`,c:`gray`,children:[e.progress,`%`]})]})})},ht=({appId:e})=>(0,M.jsx)(N.Center,{style:{width:`100%`,height:`100%`},children:(0,M.jsxs)(N.Stack,{align:`center`,gap:`lg`,p:`xl`,maw:400,children:[(0,M.jsx)(N.Text,{size:`3rem`,children:(0,M.jsx)(V.FcDoNotInsert,{})}),(0,M.jsx)(N.Text,{size:`lg`,fw:700,ta:`center`,children:`Development Server Offline`}),(0,M.jsxs)(N.Text,{size:`sm`,c:`dimmed`,ta:`center`,children:[`The app "`,e,`" cannot be loaded because the development server is offline.`]}),(0,M.jsx)(N.Button,{variant:`light`,onClick:()=>{window.__FDE_API__?.openApp(`welcome`)},children:`Open Welcome App`}),(0,M.jsx)(N.Anchor,{href:`https://github.com/frannunpal/frannunpal.github.io/issues`,target:`_blank`,rel:`noopener noreferrer`,size:`sm`,children:`File an issue on GitHub`})]})}),gt=({appId:e})=>(0,M.jsx)(N.Center,{style:{width:`100%`,height:`100%`},children:(0,M.jsxs)(N.Stack,{align:`center`,gap:`lg`,p:`xl`,maw:400,children:[(0,M.jsx)(N.Text,{size:`3rem`,children:(0,M.jsx)(V.FcInfo,{})}),(0,M.jsx)(N.Text,{size:`lg`,fw:700,ta:`center`,children:`Custom Apps Not Available`}),(0,M.jsxs)(N.Text,{size:`sm`,c:`dimmed`,ta:`center`,children:[`The app "`,e,`" cannot be loaded because this environment does not currently allow creating your own apps.`]}),(0,M.jsx)(N.Text,{size:`sm`,c:`dimmed`,ta:`center`,children:`Please refer to the "Documentation" folder to learn more about it.`})]})}),_t=new Set,J=null,vt=null,yt=null,bt=!1,xt=0,St=null,Ct=!1,wt=!1;function Tt(){_t.clear(),J=null,vt=null,yt=null,bt=!1,xt=0,St=null,Ct=!1,wt=!1}var Et=1e4,Dt=2e3,Ot=5,kt=0;function At(){return`${window.location.protocol===`https:`?`wss:`:`ws:`}//${window.location.host}/api/hmr`}async function jt(){try{let e=await fetch(`/api/hmr`,{method:`HEAD`});return e.status===426||e.status===400}catch{return!1}}function Mt(){vt&&=(clearTimeout(vt),null),yt&&=(clearTimeout(yt),null),bt=!1}function Nt(e){typeof BroadcastChannel>`u`||(St=new BroadcastChannel(`fde-custom-apps`),St.onmessage=t=>{let n=t.data;n._fromBroadcast=!0,e(n)})}function Pt(e){St?.postMessage(e)}async function Ft(){r.o.getState().isFsReady||await new Promise(e=>{let t=r.o.subscribe(n=>{n.isFsReady&&(t(),e())})});try{let e=r.v.getState().registeredApps,{added:t,removed:n}=await r.L(e);for(let e of t)r.v.getState().registerApp(e),r.o.getState().handleCustomAppRegistered?.(e);for(let e of n)r.v.getState().unregisterApp(e),r.o.getState().handleCustomAppUnregistered?.(e)}catch(e){console.warn(`[HMR] Failed to sync apps on connect:`,e)}}function It(e,t,n){if(bt||J&&J.readyState===WebSocket.OPEN)return J;let i=At(),a=++xt;return bt=!0,J=new WebSocket(i),yt=setTimeout(()=>{J&&J.readyState!==WebSocket.OPEN&&a===xt&&(console.warn(`[HMR] Initial connection timeout`),kt++,kt>=Ot?(console.warn(`[HMR] Max initial retries reached, marking server as offline`),t()):(J?.close(),vt=setTimeout(()=>{It(e,t,n)},Dt)))},Et),J.onopen=()=>{if(a!==xt){J?.close();return}console.log(`[HMR] Connected to server`),kt=0,bt=!1,r.v.getState().resetHmrRetry(),r.v.getState().setHmrConnected(!0),r.v.getState().setHmrError(null),r.v.getState().devServerOffline&&n(),r.v.getState().setDevServerOffline(!1),Mt(),Ft().catch(e=>{console.warn(`[HMR] Failed to sync apps:`,e)})},J.onmessage=t=>{try{let n=JSON.parse(t.data);console.log(`[HMR] Received ${n.type} for ${n.appId}`),e(n)}catch(e){console.error(`[HMR] Failed to parse message:`,e)}},J.onclose=i=>{a===xt&&(console.log(`[HMR] Disconnected from server (code: ${i.code})`),J=null,bt=!1,r.v.getState().setHmrConnected(!1),Mt(),vt=setTimeout(()=>{It(e,t,n)},Dt))},J.onerror=e=>{a===xt&&(console.error(`[HMR] WebSocket error:`,e),r.v.getState().setHmrError(`Connection failed`))},J}function Lt(){Mt(),J&&=(J.close(),null),St&&=(St.close(),null)}function Rt(e){let t=(0,j.useRef)(e),{notify:n}=d.r();(0,j.useEffect)(()=>{t.current=e},[e]);let i=(0,j.useCallback)(e=>{switch(e.type){case`reload`:{let t=e.appId,n=r.v.getState().mountedApps[t];if(n?.instance&&typeof n.instance.unmount==`function`)try{n.instance.unmount()}catch(e){console.warn(`[HMR] Error unmounting ${t}:`,e)}let i=document.getElementById(`app-container-${t}`);i&&(i.innerHTML=``),r.v.getState().setAppLoading(t),_t.forEach(e=>{try{e.onReload(t)}catch(e){console.error(`[HMR] Callback error:`,e)}});break}case`app-registered`:if(e.manifest){console.log(`[HMR] App registered: ${e.manifest.id}`);let t=!!r.v.getState().registeredApps[e.manifest.id];r.O(),r.R(e.manifest),r.v.getState().registerApp(e.manifest),r.o.getState().handleCustomAppRegistered?.(e.manifest),t||n(`New App Available`,`${e.manifest.name} is now available`,{fcIcon:`FcApproval`}),e._fromBroadcast||Pt(e)}break;case`app-unregistered`:{let t=e.appId;console.log(`[HMR] App unregistered: ${t}`),r.O(),r.I(t),r.v.getState().unregisterApp(t),r.o.getState().handleCustomAppUnregistered?.(t),e._fromBroadcast||Pt(e);break}case`app-error`:console.error(`[HMR] App error: ${e.appId} - ${e.error}`),n(`App Error`,e.error||`Unknown error`,{fcIcon:`FcCancel`});break}},[n]),a=(0,j.useCallback)(()=>{r.v.getState().setDevServerOffline(!0),n(`Development Server Offline`,`HMR is disabled. Changes will not be applied until the server reconnects.`,{fcIcon:`FcDoNotInsert`})},[n]),o=(0,j.useCallback)(()=>{n(`HMR Reconnected`,`Hot module replacement is now active`,{fcIcon:`FcApproval`})},[n]);(0,j.useEffect)(()=>{if(r.H()===`browser`){console.log(`[HMR] Skipping: not running in Docker`);return}if(!r.G()||!r.W())return;let e=!1;return _t.add(t.current),!wt&&!Ct&&(Ct=!0,jt().then(t=>{if(Ct=!1,e||!t){t||console.warn(`[HMR] HMR endpoint not available, skipping WebSocket connection`);return}wt=!0,Nt(i),It(i,a,o)}).catch(()=>{Ct=!1})),()=>{e=!0,_t.delete(t.current),_t.size===0&&(wt=!1,Lt())}},[i,a,o])}function zt(){let{notify:e}=d.r();Rt({onReload:()=>{},onRegistered:(0,j.useCallback)(t=>{r.o.getState().handleCustomAppRegistered?.(t),e(`New App Available`,`${t.name} is now available`,{fcIcon:`FcApproval`})},[e]),onUnregistered:(0,j.useCallback)(e=>{r.o.getState().handleCustomAppUnregistered?.(e)},[])})}function Bt(e,t=5e3){return new Promise((n,r)=>{let i=Date.now(),a=null,o=null,s=()=>{o&&=(clearInterval(o),null),a&&=(clearTimeout(a),null)},c=()=>{let a=document.getElementById(e);if(a){s(),n(a);return}if(Date.now()-i>=t){s(),r(Error(`Container #${e} not found after ${t}ms`));return}};c(),o=setInterval(c,1e3),a=setTimeout(()=>{s(),r(Error(`Container #${e} not found after ${t}ms`))},t)})}var Vt={state:`idle`,progress:0,appName:``},Ht=1e4,Ut=({appId:e,windowIcon:t,notifyReady:n})=>{let[i,a]=(0,j.useState)({...Vt,appName:e}),[o,s]=(0,j.useState)(!1),[c,l]=(0,j.useState)(null),[u,f]=(0,j.useState)(!1),[p,m]=(0,j.useState)(0),h=(0,j.useRef)(null),g=(0,j.useRef)(!0),_=(0,j.useRef)(!1),v=(0,j.useRef)(null),y=(0,j.useRef)(null),b=r.v(e=>e.devServerOffline),x=r.v(t=>t.mountedApps[e]),S=r.v(e=>e.setAppLoading),C=r.v(e=>e.setAppLoaded),w=r.v(e=>e.setAppError),T=r.v(e=>e.clearApp),{notify:E}=d.r(),D=r.G(),O=(0,j.useCallback)(()=>{y.current&&=(clearTimeout(y.current),null)},[]),k=(0,j.useCallback)(()=>{v.current&&=(clearInterval(v.current),null)},[]),A=(0,j.useCallback)(()=>{let e=x?.instance;if(e&&typeof e.unmount==`function`)try{e.unmount()}catch{}},[x?.instance]),N=(0,j.useCallback)(async()=>{if(g.current&&!_.current){_.current=!0;try{a(e=>({...e,state:`fetching`,progress:10})),S(e),l(null),r.O();let t=await r.A(!0);if(!t)throw Error(`Apps manifest not found. Make sure apps are built.`);let i=t.apps.find(t=>t.id===e);if(!i)throw Error(`App '${e}' not found in manifest. Available apps: ${t.apps.map(e=>e.id).join(`, `)}`);a(e=>({...e,state:`loading`,progress:30,appName:i.name})),v.current=setInterval(()=>{if(!g.current){k();return}a(e=>({...e,progress:Math.min(e.progress+5,90)}))},100);try{await Bt(`app-container-${e}`,5e3)}catch{throw Error(`Container #app-container-${e} not found`)}if(await import(`/dist-apps/${i.entry}?t=${Date.now()}`),k(),C(e),await new Promise(t=>{O();let n=()=>{if(r.v.getState().mountedApps[e]?.isReady){t();return}y.current=setTimeout(n,500)};if(r.v.getState().mountedApps[e]?.isReady){t();return}y.current=setTimeout(()=>{console.warn(`[${e}] App did not call appReady() within ${Ht}ms`),E(`Warning`,`App ${e} took too long to initialize`,{fcIcon:`FcInfo`}),f(!0),r.v.getState().setAppReady(e),t()},Ht),n()}),a(e=>({...e,state:`ready`,progress:100})),s(!0),!g.current)return;setTimeout(()=>{n?.()},50)}catch(t){k(),O(),_.current=!1;let n=t instanceof Error?t.message:`Unknown error`;a(e=>({...e,state:`error`,error:n,progress:0})),w(e,n),l(n),console.error(`[CustomAppLoader] Error loading app ${e}:`,t)}}},[e,n,S,C,w,O,k,E]);if(Rt({onReload:(0,j.useCallback)(t=>{t===e&&(_.current=!1,A(),T(e),s(!1),a({...Vt,appName:e}),l(null),m(e=>e+1))},[e,T,A])}),(0,j.useEffect)(()=>{if(!_.current)return g.current=!0,N(),()=>{g.current=!1,k(),O()}},[N,p,k,O]),!D)return(0,M.jsx)(gt,{appId:e});if(b&&!x?.isLoaded&&!c)return(0,M.jsx)(ht,{appId:e});let P=i.state===`error`,F=o&&x?.isReady&&!u,I=i.state===`ready`&&o&&u,L=I&&!x?.instance,R=P||L||!(F||I);return L?(0,M.jsx)(mt,{progress:{...i,state:`error`,error:`App '${e}' loaded but did not mount. Check the browser console for errors.`},windowIcon:t}):(0,M.jsxs)(M.Fragment,{children:[R&&(0,M.jsx)(mt,{progress:i,windowIcon:t}),(0,M.jsx)(`div`,{ref:h,id:`app-container-${e}`,"data-testid":`custom-app-container-${e}`,style:{all:`initial`,display:P?`none`:`block`,width:`100%`,height:`100%`,overflow:`auto`,visibility:F||I?`visible`:`hidden`,boxSizing:`border-box`,fontFamily:`sans-serif`}})]})},Wt=(0,j.createContext)({notifyReady:()=>{},getContentData:()=>void 0}),Gt=()=>(0,j.useContext)(Wt),Kt=({children:e})=>{let t=(0,j.useRef)(void 0),n=(0,j.useCallback)(e=>{e!==void 0&&(t.current=e)},[]),r=(0,j.useCallback)(()=>t.current,[]);return(0,M.jsx)(Wt.Provider,{value:{notifyReady:n,getContentData:r},children:e})},Y={root:`_root_1vtes_1`,titleBar:`_titleBar_1vtes_12`,windowButtons:`_windowButtons_1vtes_31`,title:`_title_1vtes_12`,content:`_content_1vtes_41`,focusOverlay:`_focusOverlay_1vtes_48`},qt=({win:e,isFocused:t,focusWindow:i})=>{let{notifyReady:a,getContentData:o}=Gt(),s=r.v(t=>e.content in t.registeredApps),c=(0,j.useMemo)(()=>n.x(e.content),[e.content]),l=(0,j.useMemo)(()=>n.C(e.content),[e.content]),d=(0,j.useMemo)(()=>n.w(e.content),[e.content]),f=(0,j.useMemo)(()=>n.D(e.content),[e.content]),p=(0,j.useMemo)(()=>n.S(e.content),[e.content]),m=r.o(e=>e.closeWindow),h=o()??e.contentData,g={...e,contentData:h},_=l?l(g):void 0;if(s)return(0,M.jsx)(Ut,{appId:e.content,windowIcon:e.icon,notifyReady:a});let v=f?(0,M.jsx)(j.Suspense,{fallback:(0,M.jsx)(pt,{message:p?`Loading ${p}...`:void 0}),children:(0,j.createElement)(c,{window:e,notifyReady:a})}):(0,j.createElement)(c,{window:e,notifyReady:a});return(0,M.jsxs)(M.Fragment,{children:[d?(0,M.jsx)(j.Suspense,{fallback:null,children:(0,j.createElement)(d,{windowId:e.id,contentData:h,onExit:()=>m(e.id)})}):_&&_.length>0?(0,M.jsx)(u.t,{elements:_}):null,(0,M.jsxs)(`div`,{className:Y.content,children:[!t&&(0,M.jsx)(`div`,{"data-testid":`focus-overlay`,className:Y.focusOverlay,onMouseDown:t=>{t.stopPropagation(),i(e.id)}}),v]})]})},Jt=({window:e})=>{let{t:i}=(0,L.useTranslation)(`window`),a=r.o(t=>t.windows.find(t=>t.id===e.id))??e,o=ke(a.content),{focusWindow:u,closeWindow:d,minimizeWindow:f,maximizeWindow:p,restoreWindow:m,moveWindow:h,resizeWindow:g}=r.o((0,B.useShallow)(e=>({focusWindow:e.focusWindow,closeWindow:e.closeWindow,minimizeWindow:e.minimizeWindow,maximizeWindow:e.maximizeWindow,restoreWindow:e.restoreWindow,moveWindow:e.moveWindow,resizeWindow:e.resizeWindow}))),_=t.g(e=>e.theme.colors.window),v=c.a(e=>e.isOpen),y=c.a(e=>e.windowId),b=c.a(e=>e.onSave),x=c.a(e=>e.onDiscard),S=c.a(e=>e.closeModal),{windowVariants:C,easeIn:w}=Ee(),T=r.o(e=>{let t=e.windows.find(e=>e.id===a.id);if(!t)return!0;let n=t.alwaysOnTop??!1,r=e.windows.filter(e=>e.isOpen&&e.state!==`minimized`&&(e.alwaysOnTop??!1)===n);return r.length===0?!0:Math.max(...r.map(e=>e.zIndex))===t.zIndex}),{getRect:E}=_e(),D=(0,I.useAnimationControls)(),O=(0,j.useRef)(a.state);(0,j.useEffect)(()=>{D.start(`visible`)},[D]),(0,j.useEffect)(()=>{if(O.current===`minimized`&&a.state!==`minimized`){let e=E(a.id);if(e){let t=a.x+a.width/2,r=a.y+a.height/2,i=e.left+e.width/2,o=e.top+e.height/2;D.start(n.v(i-t,o-r))}else D.set({x:0,y:0,scale:1,opacity:1}),D.start(`visible`)}O.current=a.state},[a.state,D,E,a.id,a.x,a.y,a.width,a.height]);let k=(0,j.useCallback)(e=>{e.preventDefault(),r.st.find(e=>e.id===a.content)?.hasContextMenu||e.stopPropagation()},[a.content]);if(!a.isOpen)return null;let A=a.state===`minimized`,P=a.state===`maximized`,F=a.canMaximize!==!1,R=v&&y===a.id,z=async()=>{let e=E(a.id);if(e){let t=a.x+a.width/2,r=a.y+a.height/2,i=e.left+e.width/2,o=e.top+e.height/2;await D.start(n.m(i-t,o-r))}else await D.start({...C.exit,transition:w});f(a.id)},V=async()=>{let e=c.t(a.id);e&&!e()||(await D.start({...C.exit,transition:w}),d(a.id))},te=()=>{b?.(),S()},H=()=>{x?.(),S();let e=a.id;e&&d(e)},U=()=>{S()};return(0,M.jsxs)(M.Fragment,{children:[(0,M.jsx)(ee.Rnd,{position:P?{x:0,y:0}:{x:a.x,y:a.y},size:P?{width:`100vw`,height:`100vh`}:{width:a.width,height:a.height},minWidth:a.minWidth??0,minHeight:a.minHeight??0,style:{zIndex:a.zIndex,visibility:A?`hidden`:`visible`,pointerEvents:A?`none`:`auto`},dragHandleClassName:Y.titleBar,disableDragging:P||A,enableResizing:!P&&!A,onMouseDown:()=>u(a.id),onDragStop:(e,t)=>h(a.id,t.x,t.y),onResizeStop:(e,t,n,r,i)=>{g(a.id,n.offsetWidth,n.offsetHeight),h(a.id,i.x,i.y)},children:(0,M.jsxs)(I.motion.div,{className:Y.root,"data-testid":`window-${a.content}`,style:{background:_},variants:C,initial:`hidden`,animate:D,exit:`exit`,layout:!0,transition:n.p,onContextMenu:k,children:[(0,M.jsxs)(`div`,{className:Y.titleBar,children:[(0,M.jsx)(s.t,{fcIcon:a.fcIcon,iconUrl:a.iconUrl,fallback:a.icon,size:14,color:a.iconColor}),(0,M.jsx)(N.Text,{size:`sm`,fw:500,truncate:!0,className:Y.title,children:o}),(0,M.jsxs)(N.Group,{gap:2,wrap:`nowrap`,className:Y.windowButtons,children:[(0,M.jsx)(N.ActionIcon,{size:`lg`,variant:`subtle`,"aria-label":i(`window.ariaLabels.minimize`),onClick:z,children:(0,M.jsx)(l.t,{name:`VscChromeMinimize`})}),F&&(0,M.jsx)(N.ActionIcon,{size:`lg`,variant:`subtle`,"aria-label":i(P?`window.ariaLabels.restore`:`window.ariaLabels.maximize`),onClick:()=>P?m(a.id):p(a.id),children:P?(0,M.jsx)(l.t,{name:`VscChromeRestore`}):(0,M.jsx)(l.t,{name:`VscChromeMaximize`})}),(0,M.jsx)(N.ActionIcon,{size:`lg`,variant:`subtle`,color:`red`,"aria-label":i(`window.ariaLabels.close`),onClick:V,children:(0,M.jsx)(l.t,{name:`VscChromeClose`})})]})]}),(0,M.jsx)(Kt,{children:(0,M.jsx)(qt,{win:a,isFocused:T,focusWindow:u})})]})}),(0,M.jsxs)(N.Modal,{opened:R,onClose:U,title:i(`unsavedModal.title`),centered:!0,withinPortal:!0,children:[(0,M.jsx)(N.Text,{size:`sm`,mb:`lg`,children:i(`unsavedModal.message`)}),(0,M.jsx)(N.Button,{variant:`default`,onClick:H,children:i(`unsavedModal.dontSave`)}),(0,M.jsx)(N.Button,{onClick:te,ml:`sm`,children:i(`unsavedModal.save`)})]})]})},Yt={root:`_root_1f7p3_1`,iconImage:`_iconImage_1f7p3_21`,label:`_label_1f7p3_26`},Xt=({icon:e,onDoubleClick:t,onContextMenu:n})=>{let i=r.st.find(t=>t.id===e.appId),a=e.iconName!==void 0,o=e.nodeId!==void 0,c=e.icon===`📁`,l=e.appId===`pdf`,u=(0,j.useRef)(0),d=ke(e.appId),p=e.appId&&!o&&i?d:e.name,m=(0,j.useCallback)(t=>{if(t.preventDefault(),e.nodeId){t.stopPropagation(),n?.(t,e.nodeId);return}e.appId&&!i?.hasContextMenu&&t.stopPropagation()},[e.nodeId,e.appId,i?.hasContextMenu,n]),h=()=>a?(0,M.jsx)(f.n,{type:`folder`,name:e.name,folderNode:{id:e.id,name:e.name,type:`folder`,parentId:null,children:[],iconName:e.iconName,iconColor:e.iconColor,createdAt:new Date,updatedAt:new Date},size:32}):c&&o?(0,M.jsx)(f.n,{type:`folder`,name:e.name,size:32}):o||l?(0,M.jsx)(f.n,{type:`file`,name:e.name,size:32}):(0,M.jsx)(s.t,{fcIcon:i?.fcIcon,iconUrl:i?.iconUrl,fallback:e.icon,size:32,color:i?.iconColor});return(0,M.jsxs)(`div`,{className:Yt.root,style:{left:e.x,top:e.y},onDoubleClick:()=>t(e.appId??``,e.nodeId),onTouchEnd:n=>{n.preventDefault();let r=Date.now();r-u.current<300&&t(e.appId??``,e.nodeId),u.current=r},onContextMenu:m,role:`button`,"aria-label":p,tabIndex:0,onKeyDown:n=>n.key===`Enter`&&t(e.appId??``,e.nodeId),children:[(0,M.jsx)(`span`,{className:Yt.iconImage,"aria-hidden":`true`,children:h()}),(0,M.jsx)(N.Text,{size:`xs`,className:Yt.label,truncate:!0,children:p})]})},Zt=({x:e,y:t})=>(0,M.jsx)(N.Menu.Target,{children:(0,M.jsx)(`div`,{"aria-hidden":`true`,style:{position:`fixed`,left:e,top:t,width:0,height:0,pointerEvents:`none`}})}),Qt=({owner:e,parentId:t,currentPath:i})=>{let{t:a}=(0,L.useTranslation)(`contextMenu`),o=r.o(e=>e.contextMenu),c=r.o(e=>e.closeContextMenu),u=r.o(e=>e.copyToClipboard),d=r.o(e=>e.cutToClipboard),f=r.o(e=>e.clipboard),p=r.o(e=>e.clearClipboard),m=r.o(e=>e.fsNodes),h=r.o(e=>e.addNotification),g=r.o(e=>e.openWindow),_=r.o(e=>e.desktopSortMode),v=r.o(e=>e.filesSortMode),y=r.o(e=>e.setDesktopSortMode),b=r.o(e=>e.setFilesSortMode),x=r.o(e=>e.setFsNodes),S=r.o(e=>e.syncIcons),C=e===`files`?v:_,w=e===`files`?b:y,[T,E]=(0,j.useState)({opened:!1,pending:null}),[D,O]=(0,j.useState)({opened:!1,nodeId:null,nodeName:``}),k=o.owner===e,A=o.targetNodeId,P=A?m.find(e=>e.id===A):void 0,F=e=>{c();let{x:r,y:o}=n._();g({title:a(e===`folder`?`createItem.folderTitle`:`createItem.fileTitle`),content:`createItem`,icon:e===`folder`?`📁`:`📄`,fcIcon:e===`folder`?`FcNewFolder`:`FcFile`,x:r,y:o,width:400,height:300,minWidth:350,minHeight:250,canMaximize:!1,alwaysOnTop:!0,contentData:{mode:e,parentId:t,currentPath:i}})},I=()=>{A&&P&&O({opened:!0,nodeId:A,nodeName:P.name}),c()},R=async e=>{if(e&&D.nodeId)try{await r.n.delete(D.nodeId),x(r.n.getAllNodes()),S()}catch(e){h({id:`delete-error-${Date.now()}`,title:a(`common:errors.deleteFailed`),message:e instanceof Error?e.message:`Unknown error`,fcIcon:`FcHighPriority`})}O({opened:!1,nodeId:null,nodeName:``})},z=()=>{P&&d([P]),c()},ee=()=>{P&&u([P]),c()},B=(e,t)=>m.find(n=>n.name===e&&n.parentId===t),V=async(e,t)=>{let n=await r.n.createFolder(e.name,t,e.iconName,e.iconColor),i=r.n.getChildren(e.id);for(let e of i)e.type===`folder`?await V(e,n.id):await r.n.createFile(e.name,e.content||``,n.id)},te=async(e,n)=>{if(t){if(f.action===`cut`)try{await r.n.move(e.id,t),x(r.n.getAllNodes()),S()}catch(e){h({id:`move-error-${Date.now()}`,title:`Move Failed`,message:e instanceof Error?e.message:`Unknown error`,fcIcon:`FcHighPriority`});return}else if(f.action===`copy`){if(e.type===`folder`){let i=B(e.name,t);i&&n&&await r.n.delete(i.id),(!i||n)&&(await V(e,t),x(r.n.getAllNodes()),S())}else if(e.type===`file`){let i=B(e.name,t);if(i&&n&&await r.n.delete(i.id),!i||n)try{await r.n.createFile(e.name,e.content||``,t),x(r.n.getAllNodes()),S()}catch(e){h({id:`create-error-${Date.now()}`,title:`Create File Failed`,message:e instanceof Error?e.message:`Unknown error`,fcIcon:`FcHighPriority`})}}}f.action===`cut`&&p()}},H=async()=>{if(f.content.length===0||!t)return;let e=f.content[0];B(e.name,t)?E({opened:!0,pending:{node:e,originalName:e.name}}):(await te(e,!1),c())},U=e=>{T.pending&&te(T.pending.node,e),E({opened:!1,pending:null}),c()},ne=f.content.length>0&&t!==null,W=f.content.length>1?a(`actions.pasteItems`,{count:f.content.length}):a(`actions.paste`),re=e=>{w(e),c()},ie=[{mode:`default`,icon:`FcDatabase`,label:a(`sort.default`)},{mode:`name-asc`,icon:`FcAlphabeticalSortingAz`,label:a(`sort.nameAsc`)},{mode:`name-desc`,icon:`FcAlphabeticalSortingZa`,label:a(`sort.nameDesc`)},{mode:`type`,icon:`FcFile`,label:a(`sort.byType`)}];return(0,M.jsxs)(M.Fragment,{children:[(0,M.jsxs)(N.Menu,{opened:k,onClose:c,closeOnClickOutside:!0,closeOnEscape:!0,closeOnItemClick:!0,withinPortal:!0,position:`bottom-start`,children:[(0,M.jsx)(Zt,{x:o.x,y:o.y}),(0,M.jsx)(N.Menu.Dropdown,{children:P?(0,M.jsxs)(M.Fragment,{children:[(0,M.jsx)(N.Menu.Label,{children:P.name}),(0,M.jsx)(N.Menu.Item,{leftSection:(0,M.jsx)(l.t,{name:`VscFiles`,size:14}),onClick:z,children:a(`actions.cut`)}),(0,M.jsx)(N.Menu.Item,{leftSection:(0,M.jsx)(l.t,{name:`VscClippy`,size:14}),onClick:ee,children:a(`actions.copy`)}),ne&&(0,M.jsx)(N.Menu.Item,{leftSection:(0,M.jsx)(l.t,{name:`VscCopy`,size:14}),onClick:H,children:W}),(0,M.jsx)(N.Menu.Divider,{}),(0,M.jsx)(N.Menu.Item,{leftSection:(0,M.jsx)(l.t,{name:`VscTrash`,size:14}),color:`red`,onClick:I,children:a(`actions.delete`)})]}):(0,M.jsxs)(M.Fragment,{children:[(0,M.jsx)(N.Menu.Item,{leftSection:(0,M.jsx)(l.t,{name:`VscNewFolder`,size:14}),onClick:()=>F(`folder`),children:a(`actions.createFolder`)}),(0,M.jsx)(N.Menu.Item,{leftSection:(0,M.jsx)(l.t,{name:`VscNewFile`,size:14}),onClick:()=>F(`file`),children:a(`actions.createFile`)}),ne&&(0,M.jsxs)(M.Fragment,{children:[(0,M.jsx)(N.Menu.Divider,{}),(0,M.jsx)(N.Menu.Item,{leftSection:(0,M.jsx)(l.t,{name:`VscCopy`,size:14}),onClick:H,children:W})]}),e===`desktop`||e===`files`?(0,M.jsxs)(M.Fragment,{children:[(0,M.jsx)(N.Menu.Divider,{}),(0,M.jsx)(N.Menu.Label,{children:a(`sort.title`)}),ie.map(e=>(0,M.jsx)(N.Menu.Item,{leftSection:(0,M.jsx)(s.t,{fcIcon:e.icon,size:14}),onClick:()=>re(e.mode),style:C===e.mode?{fontWeight:600}:void 0,"data-testid":C===e.mode?`sort-option-selected`:void 0,children:e.label},e.mode))]}):null]})})]}),(0,M.jsxs)(N.Modal,{opened:T.opened,onClose:()=>U(!1),title:(0,M.jsx)(N.Text,{fw:600,children:a(`common:messages.replaceFile`)}),centered:!0,size:`sm`,children:[(0,M.jsx)(N.Text,{size:`sm`,mb:`md`,children:a(`common:messages.replaceFileMessage`,{name:T.pending?.originalName})}),(0,M.jsxs)(N.Group,{justify:`flex-end`,children:[(0,M.jsx)(N.Button,{variant:`default`,size:`sm`,onClick:()=>U(!1),leftSection:(0,M.jsx)(l.t,{name:`VscClose`,size:14}),children:a(`common:buttons.no`)}),(0,M.jsx)(N.Button,{size:`sm`,onClick:()=>U(!0),leftSection:(0,M.jsx)(l.t,{name:`VscCheck`,size:14}),children:a(`common:messages.yesReplace`)})]})]}),(0,M.jsxs)(N.Modal,{opened:D.opened,onClose:()=>R(!1),title:(0,M.jsx)(N.Text,{fw:600,children:a(`deleteConfirm.title`,{name:D.nodeName})}),centered:!0,size:`sm`,children:[(0,M.jsx)(N.Text,{size:`sm`,mb:`md`,children:a(`deleteConfirm.message`,{name:D.nodeName})}),(0,M.jsxs)(N.Group,{justify:`flex-end`,children:[(0,M.jsx)(N.Button,{variant:`default`,size:`sm`,onClick:()=>R(!1),leftSection:(0,M.jsx)(l.t,{name:`VscClose`,size:14}),children:a(`common:actions.cancel`)}),(0,M.jsx)(N.Button,{color:`red`,size:`sm`,onClick:()=>R(!0),leftSection:(0,M.jsx)(l.t,{name:`VscTrash`,size:14}),children:a(`common:actions.delete`)})]})]})]})},$t={overlay:`_overlay_34o9z_1`,content:`_content_34o9z_12`,phoneIcon:`_phoneIcon_34o9z_22`,rotatePhone:`_rotatePhone_34o9z_1`,title:`_title_34o9z_50`,message:`_message_34o9z_54`,button:`_button_34o9z_58`},en=({onDismiss:e})=>{let{isPortrait:t,shouldShowWarning:n}=p.r();return!n||!t?null:(0,M.jsx)(`div`,{className:$t.overlay,children:(0,M.jsxs)(`div`,{className:$t.content,children:[(0,M.jsx)(`div`,{className:$t.phoneIcon,children:(0,M.jsxs)(`svg`,{width:`64`,height:`64`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`1.5`,children:[(0,M.jsx)(`rect`,{x:`5`,y:`2`,width:`14`,height:`20`,rx:`2`}),(0,M.jsx)(`line`,{x1:`12`,y1:`18`,x2:`12`,y2:`18.01`,strokeWidth:`2`,strokeLinecap:`round`})]})}),(0,M.jsx)(N.Text,{size:`lg`,fw:500,className:$t.title,children:`Turn your device`}),(0,M.jsx)(N.Text,{size:`sm`,c:`dimmed`,className:$t.message,children:`For a better experience use this app desktop OR horizontal mode`}),(0,M.jsx)(N.Button,{variant:`subtle`,onClick:e,className:$t.button,children:`Continue vertically?`})]})})},tn=()=>typeof window<`u`&&window.matchMedia(`(prefers-color-scheme: dark)`).matches?`dark`:`light`,nn=()=>{let e=t.g(e=>e.applySystemTheme),n=t.g(e=>e.themeSetManually);(0,j.useEffect)(()=>{if(typeof window>`u`)return;n||e(tn());let r=window.matchMedia(`(prefers-color-scheme: dark)`),i=n=>{t.g.getState().themeSetManually||e(n.matches?`dark`:`light`)};return r.addEventListener(`change`,i),()=>r.removeEventListener(`change`,i)},[e,n])},rn=(e,t)=>{let n=e=>e.replace(/^v/,``).split(`.`).map(Number),r=n(e),i=n(t),a=Math.max(r.length,i.length);for(let e=0;e<a;e++){let t=r[e]??0,n=i[e]??0;if(t>n)return!0;if(t<n)return!1}return!1},an=`frannunpal/frannunpal.github.io`,on=`https://api.github.com/repos/${an}/releases/latest`,sn=async()=>{let e=await fetch(on);if(!e.ok)throw Error(`GitHub API error: ${e.status}`);return e.json()},cn=`fde-desktop:version`,ln=!1,un=()=>{let e=r.o(e=>e.mergeSeed),t=r.o(e=>e.mergeDesktopApps),n=r.o(e=>e.reorderDesktopApps),{notify:i}=d.r();(0,j.useEffect)(()=>{typeof window>`u`||ln||(ln=!0,r.K()?dn(i):fn(e,t,n,i))},[e,t,n,i])},dn=async e=>{try{let t=await sn(),n=t.tag_name;if(!rn(n,__APP_VERSION__))return;e(`Update ${n} available!`,`Click close to open the download page.`,{fcIcon:`FcEngineering`,onClose:()=>window.open(t.html_url,`_blank`)})}catch{ln=!1}},fn=async(e,t,n,i)=>{try{let a=localStorage.getItem(cn),o=a?JSON.parse(a):null,s=await fetch(r.g(`version.json`)).then(e=>e.json());if(o?.sha===s.sha)return;let c=await r.t();if(!c)return;e(c),t(r.ct),n(r.ct),localStorage.setItem(cn,JSON.stringify(s)),i(`New version available!`,`Close this notification to install it.`,{fcIcon:`FcEngineering`,onClose:()=>window.location.reload()})}catch{ln=!1}},pn=e=>`https://fonts.googleapis.com/css2?family=${e.replace(/\s+/g,`+`)}&display=swap`,mn=e=>{let n=t.p[e];if(!n||document.head.querySelector(`link[data-font="${e}"]`))return;let r=document.createElement(`link`);r.rel=`stylesheet`,r.href=n,r.setAttribute(`data-font`,e),document.head.appendChild(r)},hn=()=>{let e=t.g(e=>e.font),n=t.g(e=>e.fontSize),r=t.g(e=>e.downloadedFonts);(0,j.useEffect)(()=>{r.forEach(e=>{t.p[e]||(t.p[e]=pn(e)),mn(e)})},[r]),(0,j.useEffect)(()=>{let i=t.d.map(e=>e.value).includes(e);!i&&r.includes(e)&&(t.p[e]||(t.p[e]=pn(e)),mn(e));let a;a=i?t.f[e]??t.f[`system-ui`]:r.includes(e)?`"${e}", sans-serif`:t.f[`system-ui`],document.documentElement.style.setProperty(`font-family`,a),document.documentElement.style.setProperty(`--mantine-font-family`,a),document.documentElement.style.setProperty(`font-size`,`${n}px`)},[e,n,r])};function gn(){let{i18n:e}=(0,L.useTranslation)(),n=t.g(e=>e.language);(0,j.useEffect)(()=>{n&&e.language!==n&&(e.changeLanguage(n),localStorage.setItem(`fde-desktop:language`,n))},[n,e]),(0,j.useEffect)(()=>{let e=localStorage.getItem(`fde-desktop:language`);n&&!e&&localStorage.setItem(`fde-desktop:language`,n)},[n])}var _n=`fran-desktop`,vn=`fde-desktop`,yn=1,bn=`fde-desktop:migration-version`,xn=!1,Sn=null;async function Cn(e,t){return new Promise(n=>{let r=indexedDB.open(e);r.onerror=()=>{n(!1)},r.onsuccess=async()=>{let i=r.result,a=Array.from(i.objectStoreNames);if(a.length===0){i.close(),n(!1);return}let o=indexedDB.open(t,i.version);o.onerror=()=>{i.close(),n(!1)},o.onupgradeneeded=e=>{let t=e.target.result;for(let e of a)t.objectStoreNames.contains(e)||t.createObjectStore(e)},o.onsuccess=async()=>{let t=o.result;try{for(let e of a){let n=i.transaction(e,`readonly`).objectStore(e).getAll();await new Promise((r,i)=>{n.onsuccess=()=>{let a=n.result;if(a&&a.length>0){let n=t.transaction(e,`readwrite`),o=n.objectStore(e);for(let e of a)o.put(e);n.oncomplete=()=>r(),n.onerror=()=>i(n.error)}else r()},n.onerror=()=>i(n.error)})}i.close(),t.close(),await new Promise(t=>{let n=indexedDB.deleteDatabase(e);n.onsuccess=()=>t(),n.onerror=()=>t()}),n(!0)}catch{i.close(),t.close(),n(!1)}}}})}function wn(){let e=[];for(let t=0;t<localStorage.length;t++){let n=localStorage.key(t);n&&(n===_n||n.startsWith(`${_n}:`))&&e.push(n)}for(let t of e){let e=t.replace(_n,vn),n=localStorage.getItem(t);n!==null&&(localStorage.getItem(e)===null&&localStorage.setItem(e,n),localStorage.removeItem(t))}return{keysMigrated:e.length}}async function Tn(){return xn?{indexedDB:{fs:!1,blobs:!1},localStorage:{keysMigrated:0},version:yn}:Sn||(Sn=(async()=>{if(console.log(`[Migration] Starting storage migration...`),localStorage.getItem(bn)===String(yn))return console.log(`[Migration] Already migrated, skipping.`),xn=!0,{indexedDB:{fs:!1,blobs:!1},localStorage:{keysMigrated:0},version:yn};let e=!1,t=!1;try{e=await Cn(`fran-desktop-fs`,`fde-desktop-fs`),e&&console.log(`[Migration] Migrated IndexedDB: fran-desktop-fs → fde-desktop-fs`)}catch(e){console.warn(`[Migration] Failed to migrate fran-desktop-fs:`,e)}try{t=await Cn(`fran-desktop-blobs`,`fde-desktop-blobs`),t&&console.log(`[Migration] Migrated IndexedDB: fran-desktop-blobs → fde-desktop-blobs`)}catch(e){console.warn(`[Migration] Failed to migrate fran-desktop-blobs:`,e)}let{keysMigrated:n}=wn();return n>0&&console.log(`[Migration] Migrated ${n} localStorage keys`),localStorage.setItem(bn,String(yn)),console.log(`[Migration] Storage migration complete.`),xn=!0,{indexedDB:{fs:e,blobs:t},localStorage:{keysMigrated:n},version:yn}})(),Sn)}var En=[],Dn=!1;function On(){if(En.length===0){Dn=!1;return}Dn=!0;let e=En.shift();e&&e.loader().catch(()=>{}).finally(()=>{`requestIdleCallback`in window?requestIdleCallback(On,{timeout:2e3}):setTimeout(On,100)})}function kn(e,t){En.some(t=>t.id===e)||(En.push({id:e,loader:t}),An())}function An(){Dn||(`requestIdleCallback`in window?requestIdleCallback(On,{timeout:2e3}):setTimeout(On,100))}function jn(e){e.forEach(e=>{kn(e.id,e.loader)})}var Mn=null,Nn=new Map;function Pn(){let{windows:e}=r.o.getState(),t=e.filter(e=>e.isOpen&&e.state!==`minimized`);return t.length===0?null:t.reduce((e,t)=>t.zIndex>(e?.zIndex??-1)?t:e,null)?.id??null}function X(e,t){let n=Nn.get(e);n&&n.forEach(n=>{try{n(t)}catch(t){console.error(`[FdeApi] Error in subscriber for ${e}:`,t)}})}var Fn={width:800,height:600},In={x:100,y:100};function Ln(){if(Mn){console.warn(`[FdeApi] Already initialized`);return}Mn={openApp:(e,t)=>{let n=r.o.getState().openWindow,i=r.st.find(t=>t.id===e);n({content:e,title:t?.title??i?.name??e,icon:t?.icon??i?.icon??`📦`,fcIcon:i?.fcIcon,iconUrl:i?.iconUrl,iconColor:i?.iconColor,width:t?.size?.width??i?.defaultWidth??Fn.width,height:t?.size?.height??i?.defaultHeight??Fn.height,x:t?.position?.x??In.x,y:t?.position?.y??In.y,minWidth:i?.minWidth===!1?void 0:i?.minWidth,minHeight:i?.minHeight===!1?void 0:i?.minHeight,canMaximize:i?.canMaximize??!0,alwaysOnTop:i?.alwaysOnTop??!1,contentData:t?.contentData}),X(`window-opened`,{windowId:r.o.getState().windows[r.o.getState().windows.length-1]?.id??``,content:e})},closeWindow:e=>{let t=e??Pn();t&&(r.o.getState().closeWindow(t),X(`window-closed`,{windowId:t}))},minimizeWindow:e=>{let t=e??Pn();t&&(r.o.getState().minimizeWindow(t),X(`window-minimized`,{windowId:t}))},maximizeWindow:e=>{let t=e??Pn();t&&(r.o.getState().maximizeWindow(t),X(`window-maximized`,{windowId:t}))},restoreWindow:e=>{let t=e??Pn();t&&r.o.getState().restoreWindow(t)},focusWindow:e=>{let t=e??Pn();t&&(r.o.getState().focusWindow(t),X(`window-focused`,{windowId:t}))},openFile:(e,t)=>{r.o.getState().openWindow({content:`files`,contentData:{initialPath:e},title:`Files`,icon:`📁`,fcIcon:`FcOpenedFolder`,width:Fn.width,height:Fn.height,x:In.x,y:In.y}),X(`file-opened`,{path:e,appId:t})},openFileDialog:async()=>(console.warn(`[FdeApi] openFileDialog not yet implemented`),null),saveFile:async()=>(console.warn(`[FdeApi] saveFile not yet implemented`),!1),saveFileDialog:async()=>(console.warn(`[FdeApi] saveFileDialog not yet implemented`),null),getTheme:()=>t.g.getState().theme,setTheme:e=>{let n=e;n.taskbar&&n.window&&n.accent&&(t.g.getState().setCustomThemeColors(n),X(`theme-changed`,{theme:JSON.stringify(e)}))},showNotification:e=>{let t=r.ot();return r.o.getState().addNotification({id:t,title:e.title,message:e.message,fcIcon:e.type===`error`?`FcCancel`:e.type===`success`?`FcCheckmark`:`FcInfo`}),X(`notification-shown`,{notificationId:t}),t},hideNotification:e=>{r.o.getState().removeNotification(e)},getWindows:()=>r.o.getState().windows,getActiveWindow:()=>{let e=r.o.getState().windows,t=Pn();return t?e.find(e=>e.id===t)??null:null},getWindowById:e=>r.o.getState().windows.find(t=>t.id===e)??null,on:(e,t)=>(Nn.has(e)||Nn.set(e,new Set),Nn.get(e).add(t),()=>{Nn.get(e)?.delete(t)}),off:(e,t)=>{Nn.get(e)?.delete(t)},fs:r.n,appReady:e=>{r.v.getState().setAppReady(e)},registerAppInstance:(e,t)=>{r.v.getState().setAppReady(e,t)}},window.__FDE_API__=Mn,console.log(`[FdeApi] Initialized`)}function Rn(){if(!Mn)throw Error(`[FdeApi] API not initialized. Call initializeFdeApi() first.`);return Mn}function zn(){return Mn!==null}var Bn=new P.QueryClient({defaultOptions:{queries:{staleTime:1/0,gcTime:1/0}}}),Vn=!1;function Hn({defaultWallpaper:e,initialApp:i,prefetchLoaders:a}){let o=m.t(t.g(e=>e.wallpaper)??void 0),s=r.o(e=>e.windows),c=r.o(e=>e.icons),l=r.o(e=>e.initFs),u=r.o(e=>e.isFsReady),f=r.o(e=>e.fsNodes),h=r.o(e=>e.openContextMenu),g=r.o(e=>e.filesCurrentFolderId),_=r.o(e=>e.desktopFolderId),v=n.t(),{shouldShowWarning:y}=p.r(),{notify:b}=d.r(),[x,S]=(0,j.useState)(!1);nn(),un(),hn(),gn(),zt(),(0,j.useEffect)(()=>{zn()||Ln()},[]),(0,j.useEffect)(()=>{if(!u)return;let e=document.getElementById(`initial-loader`);e&&(e.classList.add(`hidden`),setTimeout(()=>e.remove(),200))},[u]),(0,j.useEffect)(()=>{if(!a?.length)return;let e=setTimeout(()=>{jn(a)},3e3);return()=>clearTimeout(e)},[a]),(0,j.useEffect)(()=>{Vn||(Vn=!0,Tn().finally(()=>{l(),i&&v(i)}))},[l,v,i]);let C=(0,j.useCallback)(e=>{e.preventDefault(),h(e.clientX,e.clientY,`desktop`)},[h]),w=(0,j.useCallback)((e,t)=>{e.preventDefault(),e.stopPropagation(),h(e.clientX,e.clientY,`desktop`,t)},[h]),T=(0,j.useCallback)((e,t)=>{let n;if(t){let i=f.find(e=>e.id===t);if(i?.type===`folder`)n={initialFolderId:t};else if(i?.type===`file`){let t=r.x(i);if(!t){b(`Unsupported file type`,`The type of file you are trying to open is not supported currently`,{fcIcon:`FcDeleteRow`});return}t.appId!==e&&b(`File type mismatch`,`Opening "${i.name}" as ${t.appId} instead of ${e}`,{fcIcon:`FcDeleteRow`}),v(t.appId,{contentData:t.contentData});return}}v(e,{contentData:n})},[v,f,b]);return u?(0,M.jsxs)(M.Fragment,{children:[y&&!x&&(0,M.jsx)(en,{onDismiss:()=>S(!0)}),(0,M.jsxs)(be,{wallpaper:o??e,onContextMenu:C,children:[c.map(e=>(0,M.jsx)(Xt,{icon:e,onDoubleClick:T,onContextMenu:w},e.id)),(0,M.jsx)(I.AnimatePresence,{children:s.map(e=>(0,M.jsx)(Jt,{window:e},e.id))})]}),(0,M.jsx)(ft,{}),(0,M.jsx)(Qt,{owner:`desktop`,parentId:_,currentPath:`/home`}),(0,M.jsx)(Qt,{owner:`files`,parentId:g,currentPath:(()=>{let e=[`/home`],t=g,n=[];for(;t!==null;){let e=f.find(e=>e.id===t);if(!e)break;n.unshift(e.name),t=e.parentId}return[...e,...n].join(`/`)})()})]}):null}function Un({children:e,isReady:n,error:r,defaultWallpaper:i,initialApp:a,prefetchLoaders:o}){let s=se(),c=t.g(e=>e.setThemeMode),l=t.g(e=>e.toggleTheme),u=(0,j.useMemo)(()=>({fs:null,isReady:n,error:r,theme:s,setThemeMode:c,toggleTheme:l}),[n,r,s,c,l]);return e?(0,M.jsx)(ge,{children:(0,M.jsx)(ue.Provider,{value:u,children:e})}):(0,M.jsx)(ge,{children:(0,M.jsx)(ue.Provider,{value:u,children:(0,M.jsx)(Hn,{defaultWallpaper:i,initialApp:a,prefetchLoaders:o})})})}function Wn({children:e,fallback:i=null,theme:a,mantineTheme:o,fileSystem:s,initialMode:c,customApps:l,appEntries:u,onError:d,defaultWallpaper:f,initialApp:p,prefetchLoaders:m,queryClient:h=Bn}){let[g,_]=(0,j.useState)(!1),[v,y]=(0,j.useState)(null),b=t.g(e=>e.theme.mode),[x]=(0,j.useState)(c),S=x??b;(0,j.useEffect)(()=>{let e=!0;return(async()=>{try{if(n.T(),u&&r.lt(u),l){let e={...l};if(u)for(let t of u){let n=e[t.id];n&&(e[t.id]={...n,appName:n.appName??t.name,singleWindow:n.singleWindow??t.singleWindow,defaultWidth:n.defaultWidth??t.defaultWidth,defaultHeight:n.defaultHeight??t.defaultHeight,minWidth:n.minWidth??t.minWidth,minHeight:n.minHeight??t.minHeight,canMaximize:n.canMaximize??t.canMaximize,alwaysOnTop:n.alwaysOnTop??t.alwaysOnTop,icon:n.icon??t.icon,fcIcon:n.fcIcon??t.fcIcon,iconUrl:n.iconUrl??t.iconUrl,iconColor:n.iconColor??t.iconColor})}n.O(e)}}catch(e){console.error(`[FdeDesktop] Failed to initialize core registry:`,e)}if(!s){e&&_(!0);return}try{await s.initialize(),e&&_(!0)}catch(t){let n=t instanceof Error?t:Error(String(t));e&&(y(n),d?.(n))}})(),()=>{e=!1}},[s,u,l,d]);let C=(0,j.useMemo)(()=>(0,N.createTheme)({...le,...o}),[o]);return v||!g?(0,M.jsx)(M.Fragment,{children:i}):(0,M.jsx)(P.QueryClientProvider,{client:h,children:(0,M.jsx)(N.MantineProvider,{theme:C,forceColorScheme:S,children:(0,M.jsx)(oe,{mode:S,theme:a,children:(0,M.jsx)(Un,{isReady:g,error:v,defaultWallpaper:f,initialApp:p,prefetchLoaders:m,children:e})})})})}var Gn=({component:e,windowId:t,contentData:n,onExit:r})=>e?(0,M.jsx)(e,{windowId:t,contentData:n,onExit:r}):null,Kn=r.st.filter(e=>e.id!==`settings`),qn=({opened:e,position:t,onClose:n,onOpenApp:r,onToggleTheme:i})=>(0,M.jsxs)(N.Menu,{opened:e,onClose:n,closeOnClickOutside:!0,closeOnEscape:!0,closeOnItemClick:!0,withinPortal:!0,children:[(0,M.jsx)(Zt,{x:t.x,y:t.y}),(0,M.jsxs)(N.Menu.Dropdown,{children:[Kn.map(e=>(0,M.jsxs)(N.Menu.Item,{onClick:()=>r(e.id),children:[`Open `,e.name]},e.id)),(0,M.jsx)(N.Menu.Divider,{}),(0,M.jsx)(N.Menu.Item,{onClick:i,children:`Toggle Theme`})]})]}),Jn={frame:`_frame_13ufi_1`},Yn=`https://frannunpal.github.io/storybook/`,Xn=()=>(0,M.jsx)(`iframe`,{src:Yn,className:Jn.frame,title:`Storybook`,"aria-label":`Storybook component explorer`}),Z={scrollback:5e3,shell:`/bin/zsh`},Zn=(0,F.create)((e,t)=>({states:{},getScrollback:e=>t().states[e]?.scrollback??Z.scrollback,getShell:e=>t().states[e]?.shell??Z.shell,setScrollback:(t,n)=>e(e=>({states:{...e.states,[t]:{...e.states[t]??Z,scrollback:n}}})),setShell:(t,n)=>e(e=>({states:{...e.states,[t]:{...e.states[t]??Z,shell:n}}})),reset:t=>e(e=>({states:{...e.states,[t]:{...Z}}}))})),Qn=e=>Zn(t=>t.states[e]?.scrollback??Z.scrollback),$n=e=>Zn(t=>t.states[e]?.shell??Z.shell),Q={terminalContainer:`_terminalContainer_15s96_1`,terminalWrapper:`_terminalWrapper_15s96_9`,terminal:`_terminal_15s96_1`,statusBar:`_statusBar_15s96_33`,statusIndicator:`_statusIndicator_15s96_45`,statusText:`_statusText_15s96_70`,reconnectButton:`_reconnectButton_15s96_74`},er=5,tr=1e3,nr=({shell:e,scrollback:t,onTerminalReady:n,onConnectionChange:r})=>{let i=(0,j.useRef)(null),a=(0,j.useRef)(null),o=(0,j.useRef)(null),s=(0,j.useRef)(null),c=(0,j.useRef)(null),l=(0,j.useRef)(0),u=(0,j.useRef)(!1),d=(0,j.useRef)(!1),f=(0,j.useRef)(e),p=(0,j.useRef)(null),m=(0,j.useRef)(!1),[h,g]=(0,j.useState)(`idle`),[_,v]=(0,j.useState)(!1),y=(0,j.useRef)(n),b=(0,j.useRef)(r);(0,j.useEffect)(()=>{y.current=n},[n]),(0,j.useEffect)(()=>{b.current=r},[r]),(0,j.useEffect)(()=>{f.current=e},[e]);let x=(0,j.useCallback)(e=>{u.current&&(g(e),b.current?.(e))},[]),S=(0,j.useCallback)(()=>{p.current?.abort(),p.current=null;let e=c.current;if(e&&(c.current=null,e.readyState===WebSocket.OPEN||e.readyState===WebSocket.CONNECTING)){try{e.send(JSON.stringify({type:`kill`}))}catch{}e.close()}d.current=!1},[]),C=(0,j.useCallback)(()=>{if(!u.current||d.current||c.current?.readyState===WebSocket.OPEN)return;d.current=!0;let e=new AbortController;p.current=e;let t=`${window.location.protocol===`https:`?`wss:`:`ws:`}//${window.location.host}/api/pty`;console.log(`[XTermTerminal] Connecting (attempt ${l.current+1}/${er})`),x(`connecting`);let n=new WebSocket(t);c.current=n,n.onopen=()=>{u.current&&console.log(`[XTermTerminal] WebSocket opened`)},n.onmessage=e=>{if(u.current&&typeof e.data==`string`)try{let t=JSON.parse(e.data);switch(t.type){case`ready`:console.log(`[XTermTerminal] Server ready, sending start`),n.send(JSON.stringify({type:`start`,shell:f.current,cwd:`/app/workspace`,cols:a.current?.cols||80,rows:a.current?.rows||24}));break;case`started`:console.log(`[XTermTerminal] PTY started`),l.current=0,d.current=!1,v(!1),x(`connected`);break;case`exit`:console.log(`[XTermTerminal] PTY exited:`,t.code),c.current=null,d.current=!1,x(`disconnected`),v(!0);break;case`error`:console.error(`[XTermTerminal] Server error:`,t.message),d.current=!1,x(`error`),v(!0);break}}catch{a.current&&a.current.write(e.data)}},n.onclose=()=>{if(!(!u.current||e.signal.aborted))if(console.log(`[XTermTerminal] WebSocket closed`),c.current=null,d.current=!1,l.current<er){l.current++;let t=tr*2**(l.current-1);console.log(`[XTermTerminal] Retrying in ${t}ms`),setTimeout(()=>{u.current&&!c.current&&!e.signal.aborted&&C()},t)}else x(`disconnected`),v(!0)},n.onerror=()=>{u.current&&(console.error(`[XTermTerminal] WebSocket error`),d.current=!1,n.close(),x(`error`),v(!0))}},[x]);(0,j.useEffect)(()=>{if(m.current||(m.current=!0,u.current=!0,!i.current))return;let e=new te.Terminal({fontFamily:`'Operator Mono', 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, monospace`,fontSize:14,theme:{background:`#1e1e1e`,foreground:`#d4d4d4`,cursor:`#ffffff`,selectionBackground:`#264f78`},cursorStyle:`underline`,cursorBlink:!0,scrollback:t}),n=new H.FitAddon,r=new U.ClipboardAddon;return e.loadAddon(n),e.loadAddon(r),e.open(i.current),n.fit(),a.current=e,o.current=n,s.current=r,e.onData(e=>{c.current?.readyState===WebSocket.OPEN&&c.current.send(JSON.stringify({type:`input`,data:e}))}),e.onResize(({cols:e,rows:t})=>{c.current?.readyState===WebSocket.OPEN&&c.current.send(JSON.stringify({type:`resize`,cols:e,rows:t}))}),y.current?.({clear:()=>e.clear(),reset:()=>e.reset(),write:t=>e.write(t),copy:async()=>{let t=e.getSelection();if(console.log(`[XTermTerminal] Copy called, selection length:`,t?.length??0),!t){console.log(`[XTermTerminal] No selection to copy`);return}try{if(!navigator.clipboard){console.warn(`[XTermTerminal] Clipboard API not available (non-secure context?)`),rr(t);return}await navigator.clipboard.writeText(t),console.log(`[XTermTerminal] Copied to clipboard successfully`)}catch(e){console.error(`[XTermTerminal] Clipboard write failed:`,e),rr(t)}},paste:async()=>{console.log(`[XTermTerminal] Paste called`);try{if(!navigator.clipboard){console.warn(`[XTermTerminal] Clipboard API not available`);return}let t=await navigator.clipboard.readText();console.log(`[XTermTerminal] Paste text length:`,t.length),e.paste(t)}catch(e){console.error(`[XTermTerminal] Paste failed:`,e)}},reconnect:w}),requestAnimationFrame(()=>{u.current&&C()}),()=>{console.log(`[XTermTerminal] Cleanup`),u.current=!1,p.current?.abort(),p.current=null,a.current&&a.current.clear(),S(),e.dispose(),a.current=null,o.current=null}},[]);let w=(0,j.useCallback)(()=>{console.log(`[XTermTerminal] Reconnect triggered`),l.current=0,v(!1),S(),setTimeout(()=>C(),100)},[S,C]);return(0,j.useEffect)(()=>{a.current&&(a.current.options.scrollback=t)},[t]),(0,j.useEffect)(()=>{if(!i.current)return;let e=new ResizeObserver(()=>{o.current?.fit()});return e.observe(i.current),()=>e.disconnect()},[]),(0,M.jsxs)(`div`,{className:Q.terminalContainer,children:[(0,M.jsx)(`div`,{className:Q.terminalWrapper,children:(0,M.jsx)(`div`,{ref:i,className:Q.terminal,"data-testid":`xterm-terminal`})}),(0,M.jsxs)(`div`,{className:Q.statusBar,children:[(0,M.jsxs)(`span`,{className:Q.statusIndicator,"data-status":h,children:[h===`idle`&&`○`,h===`connecting`&&`●`,h===`connected`&&`●`,h===`disconnected`&&`○`,h===`error`&&`●`]}),(0,M.jsxs)(`span`,{className:Q.statusText,children:[h===`idle`&&`Idle`,h===`connecting`&&`Connecting...`,h===`connected`&&`Connected`,h===`disconnected`&&`Disconnected`,h===`error`&&`Error`]}),_&&(0,M.jsx)(`button`,{onClick:w,className:Q.reconnectButton,children:`Reconnect`})]})]})};function rr(e){let t=document.createElement(`textarea`);t.value=e,t.style.position=`fixed`,t.style.left=`-9999px`,t.style.opacity=`0`,document.body.appendChild(t),t.select(),t.setSelectionRange(0,e.length);try{let e=document.execCommand(`copy`);console.log(`[XTermTerminal] Fallback copy result:`,e?`success`:`failed`)}catch(e){console.error(`[XTermTerminal] Fallback copy failed:`,e)}finally{document.body.removeChild(t)}}var ir=()=>{let{t:e}=(0,L.useTranslation)(`apps`);return(0,M.jsx)(N.Center,{"data-testid":`terminal-not-supported`,style:{width:`100%`,height:`100%`},children:(0,M.jsxs)(N.Stack,{align:`center`,gap:`lg`,p:`xl`,maw:400,children:[(0,M.jsx)(N.Text,{size:`3rem`,children:(0,M.jsx)(V.FcInfo,{})}),(0,M.jsx)(N.Text,{size:`lg`,fw:700,ta:`center`,children:e(`terminal.notAvailable`)}),(0,M.jsx)(N.Text,{size:`sm`,c:`dimmed`,ta:`center`,children:e(`terminal.notAvailableMessage`)}),(0,M.jsx)(N.Text,{size:`sm`,c:`dimmed`,ta:`center`,children:e(`terminal.dockerRequired`)})]})})},ar=({window:e,notifyReady:t})=>{let n=e,i=n?.id??``,a=r.H(),o=Qn(i),s=$n(i),{setScrollback:c,setShell:l,reset:u}=Zn(),d=(0,j.useRef)(null),f=(0,j.useRef)(!1),p=(0,j.useRef)(!1),[m,h]=(0,j.useState)(`idle`),[g,_]=(0,j.useState)(null);(0,j.useEffect)(()=>{a!==`docker`||p.current||(p.current=!0,(async()=>{try{let e=await fetch(`/api/shell`);if(e.ok){let t=await e.json();_(t),(!s||s===`/bin/zsh`)&&l(i,t.default)}}catch(e){console.error(`[TerminalApp] Failed to fetch shell info:`,e),s||l(i,`/bin/zsh`)}})())},[a,s,l,i]),(0,j.useEffect)(()=>{u(i)},[i,u]);let v=(0,j.useCallback)(e=>{d.current=e},[]),y=(0,j.useCallback)(e=>{h(e)},[]);return(0,j.useEffect)(()=>{!f.current&&t&&(f.current=!0,t({...n?.contentData??{},clear:()=>d.current?.clear(),reset:()=>d.current?.reset(),copy:()=>d.current?.copy(),paste:()=>d.current?.paste(),reconnect:()=>d.current?.reconnect(),setScrollback:e=>c(i,e),setShell:e=>l(i,e),connectionStatus:m}))},[t,c,l,i,n?.contentData,m]),(0,j.useEffect)(()=>{f.current&&t&&t({...n?.contentData??{},connectionStatus:m})},[m,t,n?.contentData]),a===`docker`?(0,M.jsx)(nr,{shell:s||g?.default||`/bin/zsh`,scrollback:o,onTerminalReady:v,onConnectionChange:y}):(0,M.jsx)(ir,{})},or=()=>{let{t:e}=(0,L.useTranslation)(`apps`);return(0,M.jsx)(N.Center,{"data-testid":`code-server-not-supported`,style:{width:`100%`,height:`100%`},children:(0,M.jsxs)(N.Stack,{align:`center`,gap:`lg`,p:`xl`,maw:400,children:[(0,M.jsx)(N.Text,{size:`3rem`,children:(0,M.jsx)(V.FcInfo,{})}),(0,M.jsx)(N.Text,{size:`lg`,fw:700,ta:`center`,children:e(`codeServer.notAvailable`)}),(0,M.jsx)(N.Text,{size:`sm`,c:`dimmed`,ta:`center`,children:e(`codeServer.notAvailableMessage`)}),(0,M.jsx)(N.Text,{size:`sm`,c:`dimmed`,ta:`center`,children:e(`codeServer.dockerRequired`)})]})})},$={container:`_container_1ypq1_1`,loading:`_loading_1ypq1_9`,spinner:`_spinner_1ypq1_19`,spin:`_spin_1ypq1_19`,error:`_error_1ypq1_39`,retryButton:`_retryButton_1ypq1_63`,iframe:`_iframe_1ypq1_79`},sr=({window:e,notifyReady:t})=>{let n=e,[r,i]=(0,j.useState)({status:`idle`,url:null,error:null}),a=(0,j.useRef)(!1),o=(0,j.useRef)(!1),s=(0,j.useCallback)(async()=>{if(!o.current){o.current=!0,i(e=>({...e,status:`starting`,error:null}));try{let e=await(await fetch(`/api/code-server/start`,{method:`POST`})).json();e.success&&e.url?i({status:`running`,url:e.url,error:null}):i({status:`error`,url:null,error:e.error||`Failed to start code-server`})}catch(e){i({status:`error`,url:null,error:e instanceof Error?e.message:`Failed to start code-server`})}finally{o.current=!1}}},[]),c=(0,j.useCallback)(async()=>{try{await fetch(`/api/code-server/stop`,{method:`POST`})}catch(e){console.error(`[CodeServerApp] Error stopping code-server:`,e)}},[]);return(0,j.useEffect)(()=>(s(),()=>{c()}),[s,c]),(0,j.useEffect)(()=>{!a.current&&t&&(a.current=!0,t({...n?.contentData??{},status:r.status,restart:s}))},[t,r.status,s,n?.contentData]),(0,j.useEffect)(()=>{a.current&&t&&t({...n?.contentData??{},status:r.status})},[r.status,t,n?.contentData]),r.status===`idle`||r.status===`starting`?(0,M.jsx)(`div`,{className:$.container,children:(0,M.jsxs)(`div`,{className:$.loading,children:[(0,M.jsx)(`div`,{className:$.spinner}),(0,M.jsx)(`p`,{children:`Starting VS Code...`})]})}):r.status===`error`?(0,M.jsx)(`div`,{className:$.container,children:(0,M.jsxs)(`div`,{className:$.error,children:[(0,M.jsx)(`h3`,{children:`Failed to start VS Code`}),(0,M.jsx)(`p`,{children:r.error}),(0,M.jsx)(`button`,{onClick:s,className:$.retryButton,children:`Retry`})]})}):(0,M.jsx)(`div`,{className:$.container,children:(0,M.jsx)(`iframe`,{src:r.url||``,className:$.iframe,title:`VS Code`,allow:`clipboard-read; clipboard-write`})})},cr=e=>r.G()?(0,M.jsx)(sr,{...e}):(0,M.jsx)(or,{}),lr=[{value:`/bin/sh`,label:`sh`},{value:`/bin/zsh`,label:`zsh`}];function ur(e){let{windowId:t,onExit:n,clear:r,reset:i,copy:a,paste:o,reconnect:s,connectionStatus:c=`idle`}=e,{t:l}=(0,L.useTranslation)(`common`),{t:u}=(0,L.useTranslation)(`apps`),d=Qn(t),f=$n(t),p=Zn(e=>e.setScrollback),m=Zn(e=>e.setShell),h=(0,j.useCallback)(e=>p(t,e),[t,p]),g=(0,j.useCallback)(e=>m(t,e),[t,m]),_=c===`connected`;return(0,j.useMemo)(()=>{let e=[{type:`item`,label:u(`terminal.menu.copy`),icon:`FcCopy`,onClick:a??(()=>{}),disabled:!_},{type:`item`,label:u(`terminal.menu.paste`),icon:`FcPaste`,onClick:o??(()=>{}),disabled:!_},{type:`divider`},{type:`item`,label:u(`terminal.menu.clear`),icon:`FcClear`,onClick:r??(()=>{}),disabled:!_},{type:`item`,label:u(`terminal.menu.reset`),icon:`FcSynchronize`,onClick:i??(()=>{}),disabled:!_}];return!_&&s&&(e.push({type:`divider`}),e.push({type:`item`,label:u(`terminal.menu.reconnect`),icon:`FcSynchronize`,onClick:s})),e.push({type:`divider`}),e.push({type:`item`,label:l(`actions.exit`),icon:`FcLeave`,onClick:n}),[{type:`menu`,label:l(`menu.edit`),items:e},{type:`number-input`,label:u(`terminal.scrollback`),value:d,onChange:h,min:100,max:5e4,step:100,placeholder:`5000`},{type:`select`,label:u(`terminal.shell`),options:lr,value:f,onChange:g}]},[l,u,n,r,i,a,o,s,_,d,f,h,g])}var dr=(0,j.memo)(({windowId:e,contentData:t,onExit:n})=>(0,M.jsx)(u.t,{elements:ur({windowId:e,onExit:n,clear:t?.clear,reset:t?.reset,copy:t?.copy,paste:t?.paste,reconnect:t?.reconnect,connectionStatus:t?.connectionStatus})}));dr.displayName=`TerminalMenuBar`;var fr={container:`_container_1br66_1`},pr=({notifyReady:e,window:t,config:n})=>{let r=(0,j.useRef)(!1),a=`${n.title} blocks embedding in iframes for security reasons.`;(0,j.useEffect)(()=>{r.current||(r.current=!0,e?.({...t?.contentData??{},openInBrowser:()=>{globalThis.window.open(n.url,`_blank`,`noopener,noreferrer`)}}))},[e,t,n.url]);let o=()=>{globalThis.window.open(n.url,`_blank`,`noopener,noreferrer`)},s=i.o(n.icon,{size:48,color:n.iconColor}),c=i.o(n.icon,{size:16,color:n.iconColor});return(0,M.jsx)(N.Center,{className:fr.container,children:(0,M.jsxs)(N.Stack,{align:`center`,gap:`md`,children:[s,(0,M.jsx)(N.Text,{size:`lg`,fw:500,children:n.title}),(0,M.jsxs)(N.Text,{size:`sm`,c:`dimmed`,ta:`center`,children:[n.description??a,(0,M.jsx)(`br`,{}),`Click below to go to my `,n.title,` profile.`]}),(0,M.jsx)(N.Button,{leftSection:c,onClick:o,children:n.buttonLabel})]})})},mr=(e=0,t)=>{let[n,i]=(0,j.useState)(!1),[a,o]=(0,j.useState)({x:0,y:0});return{opened:n,position:a,open:(0,j.useCallback)((n,a)=>{if(n.preventDefault(),t&&!r.st.find(e=>e.id===t)?.hasContextMenu){n.stopPropagation();return}o({x:n.clientX,y:n.clientY+(a??e)}),i(!0)},[e,t]),close:(0,j.useCallback)(()=>i(!1),[])}};function hr({snapshotRef:t,getCurrentState:n,initialSnapshot:r,onChange:i,appId:a}){let[o,s]=(0,j.useState)(!1),c=(0,j.useRef)(i);return(0,j.useEffect)(()=>{c.current=i},[i]),(0,j.useEffect)(()=>{if(t.current===null){if(a){let n=e.r.getState().getSnapshot(a);if(n!==null){t.current=n;return}}r!==void 0&&(t.current=r)}},[t,r,a]),(0,j.useEffect)(()=>{let e=n();if(t.current===null)return;let r=JSON.stringify(e)!==JSON.stringify(t.current);s(r),c.current&&c.current(r)},[n,t]),{isDirty:o,takeSnapshot:(0,j.useCallback)(()=>{let r=n();t.current=r,s(!1),a&&e.r.getState().setSnapshot(a,r),c.current&&c.current(!1)},[t,n,a]),reset:(0,j.useCallback)(()=>{s(!1),c.current&&c.current(!1)},[])}}function gr(){return(0,j.useMemo)(()=>zn()?Rn():(console.warn(`[useFdeApi] API not initialized. Make sure initializeFdeApi() is called.`),null),[])}var _r={status:`idle`,loaded:0,total:null,percent:null,error:null},vr=()=>{let[e,t]=(0,j.useState)(_r),n=(0,j.useCallback)(()=>t(_r),[]),r=(0,j.useCallback)(async e=>{t({status:`downloading`,loaded:0,total:null,percent:null,error:null});try{let n=await fetch(e);if(!n.ok)return t(e=>({...e,status:`error`,error:`HTTP ${n.status}: ${n.statusText}`})),null;let r=n.headers.get(`Content-Length`),i=r?parseInt(r,10):null;if(!n.body){let e=await n.text();return t({status:`done`,loaded:e.length,total:e.length,percent:100,error:null}),e}let a=n.body.getReader(),o=[],s=0;for(;;){let{done:e,value:n}=await a.read();if(e)break;o.push(n),s+=n.byteLength;let r=i?Math.round(s/i*100):null;t({status:`downloading`,loaded:s,total:i,percent:r,error:null})}let c=new Uint8Array(s),l=0;for(let e of o)c.set(e,l),l+=e.byteLength;let u=new TextDecoder().decode(c);return t({status:`done`,loaded:s,total:i??s,percent:100,error:null}),u}catch(e){let n=e instanceof Error?e.message:`Unknown error`;return t(e=>({...e,status:`error`,error:n})),null}},[]);return{...e,download:r,reset:n}},yr={light:{mode:`light`,desktop:`#f0f4f8`,taskbar:`rgba(255, 255, 255, 0.9)`,window:`#ffffff`,accent:`#339af0`},dark:{mode:`dark`,desktop:`#1a1b1e`,taskbar:`rgba(26, 27, 30, 0.9)`,window:`#25262b`,accent:`#4dabf7`}},br=typeof __APP_VERSION__==`string`?__APP_VERSION__:`0.4.0`,xr=()=>`${br}-${typeof __PROD__==`boolean`&&__PROD__?`prod`:`dev`}-${typeof window<`u`&&window.__FDE_IN_DOCKER__?`docker`:`web`}`,Sr=()=>typeof __PROD__==`boolean`&&__PROD__?`prod`:`dev`,Cr=()=>typeof window>`u`?`web`:window.__FDE_IN_DOCKER__?`docker`:/Electron/i.test(navigator.userAgent)?`electron`:`web`,wr=e=>({primaryColor:`blue`,other:{desktop:e.desktop,taskbar:e.taskbar,window:e.window,accent:e.accent}});exports.ANIMATION_DURATION=n.n,exports.APPS=r.st,exports.APP_IDS=G,exports.APP_ID_TO_TRANSLATION_KEY=De,exports.APP_VERSION=br,exports.AVAILABLE_FONTS=t.d,exports.AppEmptyState=_.t,exports.AppIcon=s.t,exports.AppLoading=pt,exports.AppMenuBar=u.t,exports.AppReadyProvider=Kt,exports.BREAKPOINTS=r.p,exports.CORE_APPS=r.dt,exports.CORE_APP_IDS=r.ft,exports.CORE_REGISTRY=n.b,exports.CUSTOM_APPS_FOLDER_ID=r.z,exports.CalendarApp=h.t,exports.CalendarAppLazy=n.k,exports.CodeServerApp=cr,exports.CollapsibleSection=Ne,exports.ColorPicker=C.t,exports.ContextMenu=qn,exports.ContextMenuAnchor=Re,exports.CreateItemApp=A.t,exports.CreateItemAppLazy=n.A,exports.CreateItemContextMenu=Qt,exports.CustomAppLoader=Ut,exports.CustomAppLoadingScreen=mt,exports.CustomAppNotSupported=gt,exports.CustomAppOffline=ht,exports.DEFAULT_FDE_THEME=ae,exports.DEFAULT_LANGUAGE=t.a,exports.DEFAULT_LAUNCHER_FOLDERS=r.B,exports.DEFAULT_THEME_COLORS=yr,exports.DEFAULT_VIEWPORT_HEIGHT=r.s,exports.DEFAULT_VIEWPORT_WIDTH=r.c,exports.DEFAULT_WINDOW_DIMENSIONS=r.pt,exports.DESKTOP_APPS=Oe,exports.DESKTOP_APPS_ORDER=r.ct,exports.DefaultThemeProvider=t._,exports.Desktop=be,exports.DesktopIcon=Xt,exports.DeviceInfoApp=p.t,exports.DeviceInfoAppLazy=n.j,exports.DirtyIndicator=u.n,exports.DockerFileSystemAdapter=r.q,exports.DownloadProgress=x.t,exports.DragDropProvider=o.o,exports.DynamicMenuBarRenderer=Gn,exports.EASE_IN=n.r,exports.EASE_OUT=n.i,exports.ExternalLinkApp=pr,exports.FONT_STACKS=t.f,exports.FdeDesktop=Wn,exports.FdeProvider=pe,exports.FileIcon=f.n,exports.FilePickerApp=g.t,exports.FilePickerModal=g.n,exports.FilesApp=d.t,exports.FilesAppLazy=n.M,exports.FolderPicker=g.a,exports.GITHUB_LATEST_RELEASE_URL=on,exports.GITHUB_RELEASES_REPO=an,exports.GOOGLE_FONTS_HREF=t.p,exports.ICON_COLUMN_WIDTH=r.l,exports.ICON_MARGIN=r.u,exports.ICON_ROW_HEIGHT=r.d,exports.IMAGE_MIME_TYPES=r.y,exports.IconColorPicker=A.r,exports.ImageViewerApp=y.t,exports.ImageViewerAppLazy=n.N,exports.ImageViewerMenuBar=k.t,exports.ImageViewerMenuBarLazy=n.P,exports.IndexedDBFileSystem=r.Y,exports.LanguageFlag=t.m,exports.LanguageSelector=ut,exports.Launcher=Le,exports.MenuEditApp=o.t,exports.MenuEditAppLazy=n.F,exports.MenuEditMenuBar=E.t,exports.MenuEditMenuBarLazy=n.I,exports.NotesApp=e.t,exports.NotesAppLazy=n.L,exports.NotesMenuBar=T.t,exports.NotesMenuBarLazy=n.R,exports.PREDEFINED_LAUNCHER_FOLDERS=r.V,exports.PRESET_COLORS=v.t,exports.PRESET_ICONS=A.i,exports.PROFILE=t.r,exports.PdfApp=b.t,exports.PdfAppLazy=n.z,exports.PdfMenuBar=O.t,exports.PdfMenuBarLazy=n.B,Object.defineProperty(exports,`QueryClient`,{enumerable:!0,get:function(){return P.QueryClient}}),exports.SETTINGS_SECTIONS=t.u,exports.SUPPORTED_LANGUAGES=t.o,exports.SettingsApp=t.t,exports.SettingsAppLazy=n.V,exports.SettingsMenuBar=D.t,exports.SettingsMenuBarLazy=n.H,exports.SettingsSectionComponent=t.l,exports.SortOptions=r.C,exports.StorybookApp=Xn,exports.TASKBAR_HEIGHT=r.f,exports.TEXT_MIME_TYPES=r.b,exports.Taskbar=ft,exports.TaskbarContextMenu=He,exports.TerminalApp=ar,exports.TerminalMenuBar=dr,exports.ThemeProvider=oe,exports.UploaderApp=S.t,exports.UploaderAppLazy=n.U,exports.VscIcon=l.t,exports.Window=Jt,exports.WindowButtonRegistryProvider=ge,exports.WindowManagerAdapter=r.Q,exports.appendDirtyIndicator=w.t,exports.buildBreadcrumbs=f.t,exports.centerWindowPosition=n.a,exports.checkHMREndpointExists=jt,exports.clearBrowserData=t.i,exports.clearManifestCache=r.O,exports.convertToAppEntry=r.k,exports.createDesktopIcon=r.it,exports.createEaseIn=n.o,exports.createEaseOut=n.s,exports.createFile=r.$,exports.createFolder=r.et,exports.createLauncherFolder=r.tt,exports.createMaximizeTransition=n.c,exports.createMinimizeVariant=n.l,exports.createPanelVariants=n.u,exports.createPredefinedLauncherFolder=r.nt,exports.createRestoreVariant=n.d,exports.createWindow=r.at,exports.createWindowVariants=n.f,exports.fetchAppManifest=r.A,exports.fileSystem=r.n,exports.formatBytes=S.r,exports.generateUUID=r.ot,exports.getAppComponent=n.x,exports.getAppIdForMime=r.x,exports.getAppName=n.S,exports.getBaseUrl=r.m,exports.getCachedManifest=r.j,exports.getCloseInterceptor=c.t,exports.getCustomAppById=r.M,exports.getCustomApps=r.N,exports.getEnvironment=Sr,exports.getFdeApi=Rn,exports.getFileExtension=f.r,exports.getFourRandomColors=_.n,exports.getMenuBarBuilder=n.C,exports.getMenuBarComponent=n.w,exports.getMimeTypeFromExtension=r.Z,exports.getPersistedThemeMode=t.h,exports.getReleaseType=Cr,exports.getRuntime=r.H,exports.getVersionString=xr,exports.hashBlob=r.X,exports.i18n=ct,exports.initRegistry=n.E,exports.initializeFdeApi=Ln,exports.injectFontLink=t.c,exports.isBrowser=r.U,exports.isCustomApp=r.P,exports.isDev=r.W,exports.isDocker=r.G,exports.isElectron=r.K,exports.isFdeApiInitialized=zn,exports.isLazyApp=n.D,exports.isNewerVersion=rn,exports.maximizeTransition=n.p,exports.mergeAppsWithCustomApps=r.F,exports.migrateStorage=Tn,exports.minimizeVariant=n.m,exports.openVariants=n.h,exports.panelVariants=n.g,exports.prefetchApps=jn,exports.randomWindowPosition=n._,exports.registerAppFileHandler=r.S,exports.registerCloseInterceptor=c.n,exports.registerComponents=n.O,exports.registerCustomApps=r.lt,exports.registerDesktopApps=r.ut,exports.removeFromManifestCache=r.I,exports.resetBaseUrlCache=r.h,exports.resetFileSystem=r.r,exports.resetHMRState=Tt,exports.resetWindowManager=r.i,exports.resolveFileUrl=r.a,exports.resolveUrl=r.g,exports.restoreVariant=n.v,exports.setApiBaseUrl=r.J,exports.setTestBaseUrl=r._,exports.sortDesktopIcons=r.w,exports.sortDesktopIconsByMode=r.T,exports.sortNodes=r.E,exports.sortNodesByMode=r.D,exports.syncWithServer=r.L,exports.toMantineTheme=wr,exports.unregisterCloseInterceptor=c.r,exports.updateLauncherFolder=r.rt,exports.updateManifestCache=r.R,exports.useAdaptiveDimensions=a.t,exports.useAnimationDuration=Ee,exports.useAppName=ke,exports.useAppReady=Gt,exports.useAppTempMemoryStore=e.r,exports.useAppUpdate=un,exports.useApplyFont=hn,exports.useClock=Se,exports.useCloseInterceptor=c.i,exports.useCloseModalStore=c.a,exports.useCollapsible=je,exports.useContextMenu=mr,exports.useCustomAppHMR=Rt,exports.useCustomAppLifecycle=zt,exports.useCustomAppStore=r.v,exports.useDesktopStore=r.o,exports.useDeviceDetection=p.r,exports.useDownload=vr,exports.useDragDropState=o.r,exports.useDraggableItem=o.a,exports.useDroppableArea=o.i,exports.useDynamicIcon=i.t,exports.useDynamicIconElement=i.n,exports.useFcIcon=i.r,exports.useFcIconElement=i.i,exports.useFdeApi=gr,exports.useFdeContext=me,exports.useFiIcon=i.a,exports.useFiIconElement=i.o,exports.useFolderName=o.s,exports.useFontDownload=t.s,exports.useIsDirty=hr,exports.useLanguageSync=gn,exports.useNotifications=d.r,exports.useOpenApp=n.t,exports.useResolvedUrl=m.t,exports.useSearchFilter=Ae,exports.useSettingsStore=t.g,exports.useSystemTheme=nn,exports.useTaskbarContextMenu=Te,exports.useTaskbarHeight=ze,exports.useTheme=se,exports.useThemeContext=ce,exports.useVscIcon=i.s,exports.useVscIconElement=i.c,exports.useWindowButtonRegistry=_e,Object.defineProperty(exports,`uuidv4`,{enumerable:!0,get:function(){return ne.v4}}),exports.waitForContainer=Bt,exports.windowVariants=n.y;
|