@fde-desktop/fde-core 0.4.8 → 0.4.10

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.
@@ -3,7 +3,7 @@ import { t } from "./UnstyledButton-CI3kyRck.js";
3
3
  import { o as n } from "./getRuntime-CCRXVzJH.js";
4
4
  import { i as r, r as i, t as a } from "./FileIcon-BCpGMI5U.js";
5
5
  import { I as o, o as s, ut as c, x as l } from "./desktopStore-B0R1-BeA.js";
6
- import { t as u } from "./useOpenApp-JHCPTBWa.js";
6
+ import { t as u } from "./useOpenApp-BVpSfNrG.js";
7
7
  import { useCallback as d, useEffect as f, useState as p } from "react";
8
8
  import { Fragment as m, jsx as h, jsxs as g } from "react/jsx-runtime";
9
9
  //#region src/hooks/useNotifications.ts
@@ -0,0 +1 @@
1
+ require(`./chunk-CiTBaPhY.cjs`);const e=require(`./FilesApp-SIWXFPXt.cjs`);exports.default=e.t;
@@ -1 +1 @@
1
- require(`./chunk-CiTBaPhY.cjs`);const e=require(`./UnstyledButton-Cl5RuIid.cjs`),t=require(`./getRuntime-BLXyQZBB.cjs`),n=require(`./FileIcon-BCrsxmtt.cjs`),r=require(`./desktopStore-Cox-Og1z.cjs`),i=require(`./useOpenApp-BdarhIgl.cjs`);let a=require(`react`),o=require(`react/jsx-runtime`);var s=()=>{let e=r.o(e=>e.notifications),t=r.o(e=>e.addNotification),n=r.o(e=>e.removeNotification);return{notifications:e,notify:(0,a.useCallback)((e,n,i)=>{let a={id:r.ut(),title:e,message:n,fcIcon:i?.fcIcon,onClose:i?.onClose};return t(a),a.id},[t]),dismiss:(0,a.useCallback)(e=>{n(e)},[n]),addNotification:t,removeNotification:n}},c={root:`_root_113j7_1`,item:`_item_113j7_9`},l=({node:r,allNodes:i,currentFolderId:a,depth:s,onNavigate:u})=>{let d=i.filter(e=>e.parentId===r.id&&e.type===`folder`);return(0,o.jsxs)(o.Fragment,{children:[(0,o.jsxs)(e.t,{className:c.item,"data-active":a===r.id||void 0,style:{paddingLeft:8+s*14},onClick:()=>u(r.id),"aria-label":r.name,"aria-current":a===r.id?`page`:void 0,children:[(0,o.jsx)(n.t,{type:`folder`,folderNode:r,size:14}),(0,o.jsx)(t.o,{size:`xs`,ml:6,truncate:!0,children:r.name})]}),d.map(e=>(0,o.jsx)(l,{node:e,allNodes:i,currentFolderId:a,depth:s+1,onNavigate:u},e.id))]})},u=({allNodes:r,currentFolderId:i,onNavigate:a})=>{let s=r.filter(e=>e.parentId===null&&e.type===`folder`);return(0,o.jsxs)(`nav`,{className:c.root,"aria-label":`Folder tree`,children:[(0,o.jsxs)(e.t,{className:c.item,"data-active":i===null||void 0,style:{paddingLeft:8},onClick:()=>a(null),"aria-label":`Home`,"aria-current":i===null?`page`:void 0,children:[(0,o.jsx)(n.t,{type:`folder`,size:14}),(0,o.jsx)(t.o,{size:`xs`,ml:6,fw:500,children:`Home`})]}),s.map(e=>(0,o.jsx)(l,{node:e,allNodes:r,currentFolderId:i,depth:1,onNavigate:a},e.id))]})},d={grid:`_grid_1cag6_1`,item:`_item_1cag6_9`,icon:`_icon_1cag6_26`,name:`_name_1cag6_34`,empty:`_empty_1cag6_46`},f=({node:r,onNavigate:i,onOpenFile:a,onContextMenu:s})=>{let c=()=>{r.type===`folder`?i(r.id):a(r)},l=r.type===`folder`?`Open folder ${r.name}`:`Open file ${r.name}`;return(0,o.jsxs)(e.t,{className:d.item,onDoubleClick:c,onContextMenu:e=>s(e,r.id),"aria-label":l,role:`option`,children:[(0,o.jsx)(`div`,{className:d.icon,children:(0,o.jsx)(n.t,{type:r.type,name:r.name,folderNode:r.type===`folder`?r:void 0,size:32})}),(0,o.jsx)(t.o,{size:`xs`,className:d.name,truncate:!0,children:r.name})]})},p=({nodes:e,onNavigate:n,onOpenFile:i,onNodeContextMenu:a})=>{let s=r.o(e=>e.filesSortMode);if(e.length===0)return(0,o.jsx)(`div`,{className:d.empty,children:(0,o.jsx)(t.o,{size:`sm`,c:`dimmed`,children:`This folder is empty`})});let c=r.I(e,s);return(0,o.jsx)(`div`,{className:d.grid,role:`listbox`,"aria-label":`Files`,children:c.map(e=>(0,o.jsx)(f,{node:e,onNavigate:n,onOpenFile:i,onContextMenu:a},e.id))})},m={root:`_root_13mxj_1`,breadcrumbBar:`_breadcrumbBar_13mxj_9`,breadcrumbSep:`_breadcrumbSep_13mxj_16`,body:`_body_13mxj_21`,sidebar:`_sidebar_13mxj_28`,content:`_content_13mxj_35`},h=({window:e})=>{let c=e?.contentData?.initialFolderId,l=r.o(e=>e.fsNodes),d=r.o(e=>e.openContextMenu),f=r.o(e=>e.setFilesCurrentFolderId),h=i.t(),{notify:g}=s(),[_,v]=(0,a.useState)(c??null),y=(0,a.useCallback)(e=>{v(e),f(e)},[f]);(0,a.useEffect)(()=>{f(c??null)},[c,f]);let b=_===null?l.filter(e=>e.parentId===null):l.filter(e=>e.parentId===_),x=()=>{let e=[{id:null,name:`Home`}],t=_,n=[];for(;t!==null;){let e=l.find(e=>e.id===t);if(!e)break;n.unshift({id:e.id,name:e.name}),t=e.parentId}return[...e,...n]},S=(0,a.useCallback)(e=>{e.preventDefault(),e.stopPropagation(),d(e.clientX,e.clientY,`files`)},[d]),C=(0,a.useCallback)((e,t)=>{e.preventDefault(),e.stopPropagation(),d(e.clientX,e.clientY,`files`,t)},[d]),w=(0,a.useCallback)(e=>{try{let t=r.x(e);if(t)h(t.appId,{contentData:t.contentData});else{let t=e.mimeType||`unknown`;console.warn(`[FilesApp] Unsupported file type: ${e.name} (${t})`),g(`Unsupported file type`,`Cannot open "${e.name}". File type "${t}" is not supported.`,{fcIcon:`FcDeleteRow`})}}catch(t){console.error(`[FilesApp] Error opening file:`,t),g(`Error opening file`,`An unexpected error occurred while opening "${e.name}".`,{fcIcon:`FcHighPriority`})}},[h,g]),T=x();return(0,o.jsxs)(`div`,{className:m.root,onContextMenu:S,children:[(0,o.jsx)(`div`,{className:m.breadcrumbBar,children:(0,o.jsx)(n.r,{separator:`›`,classNames:{separator:m.breadcrumbSep},children:T.map((e,r)=>r===T.length-1?(0,o.jsx)(t.o,{size:`xs`,fw:500,children:e.name},e.id??`root`):(0,o.jsx)(n.i,{size:`xs`,onClick:()=>y(e.id),children:e.name},e.id??`root`))})}),(0,o.jsxs)(`div`,{className:m.body,children:[(0,o.jsx)(`aside`,{className:m.sidebar,children:(0,o.jsx)(u,{allNodes:l,currentFolderId:_,onNavigate:y})}),(0,o.jsx)(`main`,{className:m.content,children:(0,o.jsx)(p,{nodes:b,onNavigate:y,onOpenFile:w,onNodeContextMenu:C})})]})]})};Object.defineProperty(exports,`n`,{enumerable:!0,get:function(){return s}}),Object.defineProperty(exports,`t`,{enumerable:!0,get:function(){return h}});
1
+ require(`./chunk-CiTBaPhY.cjs`);const e=require(`./UnstyledButton-Cl5RuIid.cjs`),t=require(`./getRuntime-BLXyQZBB.cjs`),n=require(`./FileIcon-BCrsxmtt.cjs`),r=require(`./desktopStore-Cox-Og1z.cjs`),i=require(`./useOpenApp-Br0jo4-y.cjs`);let a=require(`react`),o=require(`react/jsx-runtime`);var s=()=>{let e=r.o(e=>e.notifications),t=r.o(e=>e.addNotification),n=r.o(e=>e.removeNotification);return{notifications:e,notify:(0,a.useCallback)((e,n,i)=>{let a={id:r.ut(),title:e,message:n,fcIcon:i?.fcIcon,onClose:i?.onClose};return t(a),a.id},[t]),dismiss:(0,a.useCallback)(e=>{n(e)},[n]),addNotification:t,removeNotification:n}},c={root:`_root_113j7_1`,item:`_item_113j7_9`},l=({node:r,allNodes:i,currentFolderId:a,depth:s,onNavigate:u})=>{let d=i.filter(e=>e.parentId===r.id&&e.type===`folder`);return(0,o.jsxs)(o.Fragment,{children:[(0,o.jsxs)(e.t,{className:c.item,"data-active":a===r.id||void 0,style:{paddingLeft:8+s*14},onClick:()=>u(r.id),"aria-label":r.name,"aria-current":a===r.id?`page`:void 0,children:[(0,o.jsx)(n.t,{type:`folder`,folderNode:r,size:14}),(0,o.jsx)(t.o,{size:`xs`,ml:6,truncate:!0,children:r.name})]}),d.map(e=>(0,o.jsx)(l,{node:e,allNodes:i,currentFolderId:a,depth:s+1,onNavigate:u},e.id))]})},u=({allNodes:r,currentFolderId:i,onNavigate:a})=>{let s=r.filter(e=>e.parentId===null&&e.type===`folder`);return(0,o.jsxs)(`nav`,{className:c.root,"aria-label":`Folder tree`,children:[(0,o.jsxs)(e.t,{className:c.item,"data-active":i===null||void 0,style:{paddingLeft:8},onClick:()=>a(null),"aria-label":`Home`,"aria-current":i===null?`page`:void 0,children:[(0,o.jsx)(n.t,{type:`folder`,size:14}),(0,o.jsx)(t.o,{size:`xs`,ml:6,fw:500,children:`Home`})]}),s.map(e=>(0,o.jsx)(l,{node:e,allNodes:r,currentFolderId:i,depth:1,onNavigate:a},e.id))]})},d={grid:`_grid_1cag6_1`,item:`_item_1cag6_9`,icon:`_icon_1cag6_26`,name:`_name_1cag6_34`,empty:`_empty_1cag6_46`},f=({node:r,onNavigate:i,onOpenFile:a,onContextMenu:s})=>{let c=()=>{r.type===`folder`?i(r.id):a(r)},l=r.type===`folder`?`Open folder ${r.name}`:`Open file ${r.name}`;return(0,o.jsxs)(e.t,{className:d.item,onDoubleClick:c,onContextMenu:e=>s(e,r.id),"aria-label":l,role:`option`,children:[(0,o.jsx)(`div`,{className:d.icon,children:(0,o.jsx)(n.t,{type:r.type,name:r.name,folderNode:r.type===`folder`?r:void 0,size:32})}),(0,o.jsx)(t.o,{size:`xs`,className:d.name,truncate:!0,children:r.name})]})},p=({nodes:e,onNavigate:n,onOpenFile:i,onNodeContextMenu:a})=>{let s=r.o(e=>e.filesSortMode);if(e.length===0)return(0,o.jsx)(`div`,{className:d.empty,children:(0,o.jsx)(t.o,{size:`sm`,c:`dimmed`,children:`This folder is empty`})});let c=r.I(e,s);return(0,o.jsx)(`div`,{className:d.grid,role:`listbox`,"aria-label":`Files`,children:c.map(e=>(0,o.jsx)(f,{node:e,onNavigate:n,onOpenFile:i,onContextMenu:a},e.id))})},m={root:`_root_13mxj_1`,breadcrumbBar:`_breadcrumbBar_13mxj_9`,breadcrumbSep:`_breadcrumbSep_13mxj_16`,body:`_body_13mxj_21`,sidebar:`_sidebar_13mxj_28`,content:`_content_13mxj_35`},h=({window:e})=>{let c=e?.contentData?.initialFolderId,l=r.o(e=>e.fsNodes),d=r.o(e=>e.openContextMenu),f=r.o(e=>e.setFilesCurrentFolderId),h=i.t(),{notify:g}=s(),[_,v]=(0,a.useState)(c??null),y=(0,a.useCallback)(e=>{v(e),f(e)},[f]);(0,a.useEffect)(()=>{f(c??null)},[c,f]);let b=_===null?l.filter(e=>e.parentId===null):l.filter(e=>e.parentId===_),x=()=>{let e=[{id:null,name:`Home`}],t=_,n=[];for(;t!==null;){let e=l.find(e=>e.id===t);if(!e)break;n.unshift({id:e.id,name:e.name}),t=e.parentId}return[...e,...n]},S=(0,a.useCallback)(e=>{e.preventDefault(),e.stopPropagation(),d(e.clientX,e.clientY,`files`)},[d]),C=(0,a.useCallback)((e,t)=>{e.preventDefault(),e.stopPropagation(),d(e.clientX,e.clientY,`files`,t)},[d]),w=(0,a.useCallback)(e=>{try{let t=r.x(e);if(t)h(t.appId,{contentData:t.contentData});else{let t=e.mimeType||`unknown`;console.warn(`[FilesApp] Unsupported file type: ${e.name} (${t})`),g(`Unsupported file type`,`Cannot open "${e.name}". File type "${t}" is not supported.`,{fcIcon:`FcDeleteRow`})}}catch(t){console.error(`[FilesApp] Error opening file:`,t),g(`Error opening file`,`An unexpected error occurred while opening "${e.name}".`,{fcIcon:`FcHighPriority`})}},[h,g]),T=x();return(0,o.jsxs)(`div`,{className:m.root,onContextMenu:S,children:[(0,o.jsx)(`div`,{className:m.breadcrumbBar,children:(0,o.jsx)(n.r,{separator:`›`,classNames:{separator:m.breadcrumbSep},children:T.map((e,r)=>r===T.length-1?(0,o.jsx)(t.o,{size:`xs`,fw:500,children:e.name},e.id??`root`):(0,o.jsx)(n.i,{size:`xs`,onClick:()=>y(e.id),children:e.name},e.id??`root`))})}),(0,o.jsxs)(`div`,{className:m.body,children:[(0,o.jsx)(`aside`,{className:m.sidebar,children:(0,o.jsx)(u,{allNodes:l,currentFolderId:_,onNavigate:y})}),(0,o.jsx)(`main`,{className:m.content,children:(0,o.jsx)(p,{nodes:b,onNavigate:y,onOpenFile:w,onNodeContextMenu:C})})]})]})};Object.defineProperty(exports,`n`,{enumerable:!0,get:function(){return s}}),Object.defineProperty(exports,`t`,{enumerable:!0,get:function(){return h}});
@@ -1 +1 @@
1
- require(`./chunk-CiTBaPhY.cjs`);const e=require(`./SettingsApp-B_rev1xh.cjs`);exports.default=e.t;
1
+ require(`./chunk-CiTBaPhY.cjs`);const e=require(`./SettingsApp-ByiPAj1I.cjs`);exports.default=e.t;
@@ -0,0 +1 @@
1
+ require(`./chunk-CiTBaPhY.cjs`);const e=require(`./Box-D_64wv6n.cjs`),t=require(`./ColorPicker-BL4UbKCV.cjs`),n=require(`./Tooltip-DDh_x-CB.cjs`),r=require(`./use-uncontrolled-BPrfGv0W.cjs`),i=require(`./TextInput-DcYns3hz.cjs`),a=require(`./Slider-Bg_EIBg6.cjs`),o=require(`./use-merged-ref-BI9n1hUK.cjs`),s=require(`./DownloadProgress-IRw1dzLX.cjs`),c=require(`./UnstyledButton-Cl5RuIid.cjs`),l=require(`./Paper-DwCpwWwH.cjs`),u=require(`./Group-DhwePB84.cjs`),d=require(`./getRuntime-BLXyQZBB.cjs`),f=require(`./Button-D0FXpkur.cjs`),p=require(`./AppIcon--qzR4sgf.cjs`),m=require(`./Stack-BOaJgV3N.cjs`),h=require(`./react-Dldg32sN.cjs`),g=require(`./desktopStore-Cox-Og1z.cjs`),_=require(`./useTranslation-D_O7S4RJ.cjs`),v=require(`./useCloseInterceptor-a_6Lcuqj.cjs`),y=require(`./useResolvedUrl-Be5ZlCX7.cjs`),b=require(`./FilePickerApp-Eu0cr2Cm.cjs`),x=require(`./Colors-BxX4G8kX.cjs`),S=require(`./settingsAppStore-BrlImdAH.cjs`);let C=require(`react`),w=require(`react/jsx-runtime`),T=require(`@tanstack/react-query`);function E(e,t){if(e===t||Number.isNaN(e)&&Number.isNaN(t))return!0;if(!(e instanceof Object)||!(t instanceof Object))return!1;let n=Object.keys(e),{length:r}=n;if(r!==Object.keys(t).length)return!1;for(let i=0;i<r;i+=1){let r=n[i];if(!(r in t)||e[r]!==t[r]&&!(Number.isNaN(e[r])&&Number.isNaN(t[r])))return!1}return!0}function D(e,t){if(!e||!t)return!1;if(e===t)return!0;if(e.length!==t.length)return!1;for(let n=0;n<e.length;n+=1)if(!E(e[n],t[n]))return!1;return!0}function ee(e){let t=(0,C.useRef)([]),n=(0,C.useRef)(0);return D(t.current,e)||(t.current=e,n.current+=1),[n.current]}function O(e,t){(0,C.useEffect)(e,ee(t))}function k(e,t,n={autoInvoke:!1}){let r=(0,C.useRef)(null),i=(0,C.useCallback)((...n)=>{r.current||=window.setTimeout(()=>{e(n),r.current=null},t)},[t]),a=(0,C.useCallback)(()=>{r.current&&=(window.clearTimeout(r.current),null)},[]);return(0,C.useEffect)(()=>(n.autoInvoke&&i(),a),[a,i]),{start:i,clear:a}}function A(e,t,n){let r=(0,C.useRef)(null);(0,C.useEffect)(()=>{r.current&&=(r.current.disconnect(),null);let i=typeof n==`function`?n():n;return i&&(r.current=new MutationObserver(e),r.current.observe(i,t)),()=>{r.current&&=(r.current.disconnect(),null)}},[e,t,n])}function te(){let[e,t]=(0,C.useState)(!1);return(0,C.useEffect)(()=>t(!0),[]),e}function j(){return typeof process<`u`&&process.env,`development`}function M(e){return typeof e==`string`||typeof e==`number`||typeof e==`boolean`||typeof e==`bigint`}function N(e,t){if(!t||!e)return!1;let n=t.parentNode;for(;n!=null;){if(n===e)return!0;n=n.parentNode}return!1}function P({target:e,parent:t,ref:n,displayAfterTransitionEnd:r,onTransitionStart:i,onTransitionEnd:o}){let s=(0,C.useRef)(-1),c=(0,C.useRef)(e),[l,u]=(0,C.useState)(!1),[d,f]=(0,C.useState)(typeof r==`boolean`?r:!1),p=()=>{if(!e||!t||!n.current)return;let r=e.getBoundingClientRect(),i=t.getBoundingClientRect(),o=window.getComputedStyle(e),s=window.getComputedStyle(t),c=a.o(o.borderTopWidth)+a.o(s.borderTopWidth),l=a.o(o.borderLeftWidth)+a.o(s.borderLeftWidth),u={top:r.top-i.top-c,left:r.left-i.left-l,width:r.width,height:r.height};n.current.style.transform=`translateY(${u.top}px) translateX(${u.left}px)`,n.current.style.width=`${u.width}px`,n.current.style.height=`${u.height}px`},m=()=>{window.clearTimeout(s.current),n.current&&(n.current.style.transitionDuration=`0ms`),p(),s.current=window.setTimeout(()=>{n.current&&(n.current.style.transitionDuration=``)},30)},h=(0,C.useRef)(null),g=(0,C.useRef)(null);return(0,C.useEffect)(()=>{if(l&&c.current!==e&&i&&i(),c.current=e,p(),e)return h.current=new ResizeObserver(m),h.current.observe(e),t&&(g.current=new ResizeObserver(m),g.current.observe(t)),()=>{h.current?.disconnect(),g.current?.disconnect()}},[t,e]),(0,C.useEffect)(()=>{if(t){let e=e=>{N(e.target,t)&&(m(),f(!1))};return t.addEventListener(`transitionend`,e),()=>{t.removeEventListener(`transitionend`,e)}}},[t]),(0,C.useEffect)(()=>{if(n.current&&o){let e=e=>{e.propertyName===`transform`&&o()};return n.current.addEventListener(`transitionend`,e),()=>{n.current?.removeEventListener(`transitionend`,e)}}},[o]),k(()=>{j()!==`test`&&u(!0)},20,{autoInvoke:!0}),A(e=>{e.forEach(e=>{e.type===`attributes`&&e.attributeName===`dir`&&m()})},{attributes:!0,attributeFilter:[`dir`]},()=>document.documentElement),{initialized:l,hidden:d}}var F={root:`m_96b553a6`},I=e.O((e,{transitionDuration:t},{shouldReduceMotion:n})=>{let r=e.respectReducedMotion&&n?`0ms`:typeof t==`number`?`${t}ms`:t||`150ms`;return{root:{"--transition-duration":r}}}),L=e.r(t=>{let n=e.l(`FloatingIndicator`,null,t),{classNames:r,className:a,style:s,styles:c,unstyled:l,vars:u,target:d,parent:f,transitionDuration:p,mod:m,displayAfterTransitionEnd:h,onTransitionStart:g,onTransitionEnd:_,attributes:v,ref:y,...b}=n,x=e.c({name:`FloatingIndicator`,classes:F,props:n,className:a,style:s,classNames:r,styles:c,unstyled:l,attributes:v,vars:u,varsResolver:I,stylesCtx:{shouldReduceMotion:i.l()}}),S=(0,C.useRef)(null),{initialized:T,hidden:E}=P({target:d,parent:f,ref:S,displayAfterTransitionEnd:h,onTransitionStart:g,onTransitionEnd:_}),D=o.r(y,S);return!d||!f?null:(0,w.jsx)(e.t,{ref:D,mod:[{initialized:T,hidden:E},m],...x(`root`),...b})});L.displayName=`@mantine/core/FloatingIndicator`,L.classes=F,L.varsResolver=I;var R={root:`m_347db0ec`,"root--dot":`m_fbd81e3d`,label:`m_5add502a`,section:`m_91fdda9b`},z=e.O((t,{radius:n,color:r,gradient:i,variant:a,size:o,autoContrast:s,circle:c})=>{let l=t.variantColorResolver({color:r||t.primaryColor,theme:t,gradient:i,variant:a||`filled`,autoContrast:s});return{root:{"--badge-height":e.N(o,`badge-height`),"--badge-padding-x":e.N(o,`badge-padding-x`),"--badge-fz":e.N(o,`badge-fz`),"--badge-radius":c||n===void 0?void 0:e.j(n),"--badge-bg":r||a?l.background:void 0,"--badge-color":r||a?l.color:void 0,"--badge-bd":r||a?l.border:void 0,"--badge-dot-color":a===`dot`?e.x(r,t):void 0}}}),B=e.n(t=>{let n=e.l(`Badge`,null,t),{classNames:r,className:i,style:a,styles:o,unstyled:s,vars:c,radius:l,color:u,gradient:d,leftSection:f,rightSection:p,children:m,variant:h,fullWidth:g,autoContrast:_,circle:v,mod:y,attributes:b,...x}=n,S=e.c({name:`Badge`,props:n,classes:R,className:i,style:a,classNames:r,styles:o,unstyled:s,attributes:b,vars:c,varsResolver:z});return(0,w.jsxs)(e.t,{variant:h,mod:[{block:g,circle:v,"with-right-section":!!p,"with-left-section":!!f},y],...S(`root`,{variant:h}),...x,children:[f&&(0,w.jsx)(`span`,{...S(`section`),"data-position":`left`,children:f}),(0,w.jsx)(`span`,{...S(`label`),children:m}),p&&(0,w.jsx)(`span`,{...S(`section`),"data-position":`right`,children:p})]})});B.classes=R,B.varsResolver=z,B.displayName=`@mantine/core/Badge`;var ne=(0,C.createContext)(null),V=e.i((t=>{let{value:n,defaultValue:o,onChange:s,size:c,wrapperProps:l,children:u,name:d,readOnly:f,disabled:p,...m}=e.l(`RadioGroup`,null,t),h=i.u(d),[g,_]=r.t({value:n,defaultValue:o,finalValue:``,onChange:s});return(0,w.jsx)(ne,{value:{value:g,onChange:e=>!f&&_(typeof e==`string`?e:e.currentTarget.value),size:c,name:h,disabled:p},children:(0,w.jsx)(i.i.Wrapper,{size:c,...l,...m,labelElement:`div`,__staticSelector:`RadioGroup`,children:(0,w.jsx)(a.i,{role:`radiogroup`,children:u})})})}));V.classes=i.i.Wrapper.classes,V.displayName=`@mantine/core/RadioGroup`;var re={card:`m_9dc8ae12`},ie=(0,C.createContext)(null),ae={withBorder:!0},H=e.O((t,{radius:n})=>({card:{"--card-radius":e.j(n)}})),U=e.r(t=>{let r=e.l(`RadioCard`,ae,t),{classNames:i,className:a,style:o,styles:s,unstyled:l,vars:u,checked:d,mod:f,withBorder:p,value:m,onClick:h,name:g,onKeyDown:_,attributes:v,...y}=r,b=e.c({name:`RadioCard`,classes:re,props:r,className:a,style:o,classNames:i,styles:s,unstyled:l,attributes:v,vars:u,varsResolver:H,rootSelector:`card`}),{dir:x}=n.s(),S=(0,C.use)(ne),T=typeof d==`boolean`?d:S?.value===m||!1,E=g||S?.name,D=e=>{if(_?.(e),E&&[`ArrowDown`,`ArrowUp`,`ArrowLeft`,`ArrowRight`].includes(e.nativeEvent.code)){e.preventDefault();let t=Array.from(document.querySelectorAll(`[role="radio"][name="${E}"]`)),n=t.findIndex(t=>t===e.target),r=n+1>=t.length?0:n+1,i=n-1<0?t.length-1:n-1;e.nativeEvent.code===`ArrowDown`&&(t[r].focus(),t[r].click()),e.nativeEvent.code===`ArrowUp`&&(t[i].focus(),t[i].click()),e.nativeEvent.code===`ArrowLeft`&&(t[x===`ltr`?i:r].focus(),t[x===`ltr`?i:r].click()),e.nativeEvent.code===`ArrowRight`&&(t[x===`ltr`?r:i].focus(),t[x===`ltr`?r:i].click())}};return(0,w.jsx)(ie,{value:{checked:T},children:(0,w.jsx)(c.t,{mod:[{"with-border":p,checked:T},f],...b(`card`),...y,role:`radio`,"aria-checked":T,name:E,onClick:e=>{h?.(e),S?.onChange(m||``)},onKeyDown:D})})});U.displayName=`@mantine/core/RadioCard`,U.classes=re,U.varsResolver=H;function oe({size:t,style:n,...r}){return(0,w.jsx)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,fill:`none`,viewBox:`0 0 5 5`,style:{width:e.L(t),height:e.L(t),...n},"aria-hidden":!0,...r,children:(0,w.jsx)(`circle`,{cx:`2.5`,cy:`2.5`,r:`2.5`,fill:`currentColor`})})}var W={indicator:`m_717d7ff6`,icon:`m_3e4da632`,"indicator--outline":`m_2980836c`},se={icon:oe},G=e.O((t,{radius:n,color:r,size:i,iconColor:a,variant:o,autoContrast:c})=>{let l=e.S({color:r||t.primaryColor,theme:t}),u=l.isThemeColor&&l.shade===void 0?`var(--mantine-color-${l.color}-outline)`:l.color;return{indicator:{"--radio-size":e.N(i,`radio-size`),"--radio-radius":n===void 0?void 0:e.j(n),"--radio-color":o===`outline`?u:e.x(r,t),"--radio-icon-size":e.N(i,`radio-icon-size`),"--radio-icon-color":a?e.x(a,t):s.r(c,t)?s.i({color:r,theme:t,autoContrast:c}):void 0}}}),K=e.r(t=>{let n=e.l(`RadioIndicator`,se,t),{classNames:r,className:i,style:a,styles:o,unstyled:s,vars:c,icon:l,radius:u,color:d,iconColor:f,autoContrast:p,checked:m,mod:h,variant:g,disabled:_,attributes:v,...y}=n,b=e.c({name:`RadioIndicator`,classes:W,props:n,className:i,style:a,classNames:r,styles:o,unstyled:s,attributes:v,vars:c,varsResolver:G,rootSelector:`indicator`}),x=(0,C.use)(ie),S=typeof m==`boolean`?m:x?.checked||!1;return(0,w.jsx)(e.t,{...b(`indicator`,{variant:g}),variant:g,mod:[{checked:S,disabled:_},h],...y,children:(0,w.jsx)(l,{...b(`icon`)})})});K.displayName=`@mantine/core/RadioIndicator`,K.classes=W,K.varsResolver=G;var ce={root:`m_f3f1af94`,inner:`m_89c4f5e4`,icon:`m_f3ed6b2b`,radio:`m_8a3dbb89`,"radio--outline":`m_1bfe9d39`},le={labelPosition:`right`,withErrorStyles:!0},ue=e.O((t,{size:n,radius:r,color:i,iconColor:a,variant:o,autoContrast:c})=>{let l=e.S({color:i||t.primaryColor,theme:t}),u=l.isThemeColor&&l.shade===void 0?`var(--mantine-color-${l.color}-outline)`:l.color;return{root:{"--radio-size":e.N(n,`radio-size`),"--radio-radius":r===void 0?void 0:e.j(r),"--radio-color":o===`outline`?u:e.x(i,t),"--radio-icon-color":a?e.x(a,t):s.r(c,t)?s.i({color:i,theme:t,autoContrast:c}):void 0,"--radio-icon-size":e.N(n,`radio-icon-size`)}}}),q=e.r(t=>{let n=e.l(`Radio`,le,t),{classNames:r,className:o,style:s,styles:c,unstyled:l,vars:u,id:d,size:f,label:p,labelPosition:m,description:h,error:g,radius:_,color:v,variant:y,disabled:b,wrapperProps:x,icon:S=oe,rootRef:T,iconColor:E,onChange:D,mod:ee,attributes:O,withErrorStyles:k,checked:A,...te}=n,j=e.c({name:`Radio`,classes:ce,props:n,className:o,style:s,classNames:r,styles:c,unstyled:l,attributes:O,vars:u,varsResolver:ue}),M=(0,C.use)(ne),N=M?.size??f,P=n.size?f:N,{styleProps:F,rest:I}=e.o(te),L=i.u(d),R=M?M.value===I.value:void 0,z={checked:R??A,name:I.name??M?.name,onChange:e=>{M?.onChange(e),D?.(e)},disabled:M?.disabled??b};return(0,w.jsx)(a.n,{...j(`root`),__staticSelector:`Radio`,__stylesApiProps:n,id:L,size:P,labelPosition:m,label:p,description:h,error:g,disabled:z.disabled,classNames:r,styles:c,unstyled:l,"data-checked":(R??A)||void 0,variant:y,ref:T,mod:ee,attributes:O,...F,...x,children:(0,w.jsxs)(e.t,{...j(`inner`),mod:{"label-position":m},children:[(0,w.jsx)(e.t,{...j(`radio`,{focusable:!0,variant:y}),...I,...z,component:`input`,mod:{error:!!g,"with-error-styles":k},id:L,type:`radio`}),(0,w.jsx)(S,{...j(`icon`),"aria-hidden":!0})]})})});q.classes=ce,q.varsResolver=ue,q.displayName=`@mantine/core/Radio`,q.Group=V,q.Card=U,q.Indicator=K;var de={root:`m_cf365364`,indicator:`m_9e182ccd`,label:`m_1738fcb2`,input:`m_1714d588`,control:`m_69686b9b`,innerLabel:`m_78882f40`},fe={withItemsBorders:!0},pe=e.O((t,{radius:n,color:r,transitionDuration:i,size:a,transitionTimingFunction:o})=>({root:{"--sc-radius":n===void 0?void 0:e.j(n),"--sc-color":r?e.x(r,t):void 0,"--sc-shadow":r?void 0:`var(--mantine-shadow-xs)`,"--sc-transition-duration":i===void 0?void 0:`${i}ms`,"--sc-transition-timing-function":o,"--sc-padding":e.N(a,`sc-padding`),"--sc-font-size":e.k(a)}})),J=e.i(t=>{let n=e.l(`SegmentedControl`,fe,t),{classNames:a,className:c,style:l,styles:u,unstyled:d,vars:f,data:p,value:m,defaultValue:h,onChange:g,size:_,name:v,disabled:y,readOnly:b,fullWidth:x,orientation:S,radius:T,color:E,transitionDuration:D,transitionTimingFunction:ee,variant:k,autoContrast:A,withItemsBorders:j,mod:N,attributes:P,ref:F,...I}=n,R=e.c({name:`SegmentedControl`,props:n,classes:de,className:c,style:l,classNames:a,styles:u,unstyled:d,attributes:P,vars:f,varsResolver:pe}),z=e.d(),B=p.map(e=>M(e)?{label:`${e}`,value:e}:e),ne=te(),[V,re]=(0,C.useState)(i.p()),[ie,ae]=(0,C.useState)(null),[H,U]=(0,C.useState)({}),oe=(e,t)=>{H[t]=e,U(H)},[W,se]=r.t({value:m,defaultValue:h,finalValue:Array.isArray(p)?B.find(e=>!e.disabled)?.value??p[0]?.value??null:null,onChange:g}),G=i.u(v),K=B.map(t=>(0,C.createElement)(e.t,{...R(`control`),mod:{active:W===t.value,orientation:S},key:`${t.value}`},(0,C.createElement)(`input`,{...R(`input`),disabled:y||t.disabled,type:`radio`,name:G,value:`${t.value}`,id:`${G}-${t.value}`,checked:W===t.value,onChange:()=>!b&&se(t.value),"data-focus-ring":z.focusRing,key:`${t.value}-input`}),(0,C.createElement)(e.t,{component:`label`,...R(`label`),mod:{active:W===t.value&&!(y||t.disabled),disabled:y||t.disabled,"read-only":b},htmlFor:`${G}-${t.value}`,ref:e=>oe(e,`${t.value}`),__vars:{"--sc-label-color":E===void 0?void 0:s.i({color:E,theme:z,autoContrast:A})},key:`${t.value}-label`},(0,w.jsx)(`span`,{...R(`innerLabel`),children:t.label})))),ce=o.r(F,e=>ae(e));return O(()=>{re(i.p())},[p.length]),p.length===0?null:(0,w.jsxs)(e.t,{...R(`root`),variant:k,size:_,ref:ce,mod:[{"full-width":x,orientation:S,initialized:ne,"with-items-borders":j},N],...I,role:`radiogroup`,"data-disabled":y,children:[W!==void 0&&(0,w.jsx)(L,{target:H[`${W}`],parent:ie,component:`span`,transitionDuration:`var(--sc-transition-duration)`,...R(`indicator`)},V),K]})});J.classes=de,J.varsResolver=pe,J.displayName=`@mantine/core/SegmentedControl`;var me={mode:`light`,colors:{desktop:`#f0f4f8`,taskbar:`rgba(255, 255, 255, 0.9)`,window:`#ffffff`,accent:`#339af0`},window:{borderRadius:`8px`,headerHeight:40,minWidth:400,minHeight:300,defaultWidth:800,defaultHeight:600,shadow:`0 8px 32px rgba(0, 0, 0, 0.2)`},taskbar:{height:48,position:`bottom`,background:`rgba(0, 0, 0, 0.8)`,blur:!0},desktop:{background:`linear-gradient(135deg, #667eea 0%, #764ba2 100%)`,iconSize:64,iconSpacing:16}},he={mode:`dark`,colors:{desktop:`#1a1b1e`,taskbar:`rgba(26, 27, 30, 0.9)`,window:`#25262b`,accent:`#4dabf7`},window:{borderRadius:`8px`,headerHeight:40,minWidth:400,minHeight:300,defaultWidth:800,defaultHeight:600,shadow:`0 8px 32px rgba(0, 0, 0, 0.2)`},taskbar:{height:48,position:`bottom`,background:`rgba(0, 0, 0, 0.8)`,blur:!0},desktop:{background:`linear-gradient(135deg, #1a1b1e 0%, #2d1f3d 100%)`,iconSize:64,iconSpacing:16}},ge=class{mode;customColors=null;constructor(e=`light`){this.mode=e}getTheme(){let e=this.mode===`light`?me:he;return this.customColors?{...e,colors:{...e.colors,taskbar:this.customColors.taskbar,window:this.customColors.window,accent:this.customColors.accent}}:e}setMode(e){this.mode=e}setCustomColors(e){this.customColors=e}toggle(){this.mode=this.mode===`light`?`dark`:`light`}},_e=[`en`,`es`],ve=`en`,ye=()=>{try{let e=localStorage.getItem(`fde-desktop:settings`),t=localStorage.getItem(`fran-desktop:settings`);return JSON.parse(e??t??`{}`)?.state?.theme?.mode??null}catch{return null}},be=ye(),xe=()=>{if(typeof navigator>`u`||!navigator.language)return ve;let e=navigator.language.split(`-`)[0];return _e.includes(e)?e:ve},Se=(()=>{try{let e=localStorage.getItem(`fde-desktop:settings`),t=localStorage.getItem(`fran-desktop:settings`),n=JSON.parse(e??t??`{}`)?.state?.language;return n&&_e.includes(n)?n:xe()}catch{return xe()}})(),Ce=typeof window<`u`&&window.matchMedia?.(`(prefers-color-scheme: dark)`).matches?`dark`:`light`,Y=new ge(be??Ce),X=h.t()(g.pt(e=>({wallpaper:null,wallpaperModule:`default`,launcherIcon:`FcElectronics`,font:`system-ui`,downloadedFonts:[],fontSize:14,animationDuration:.3,theme:Y.getTheme(),themeSetManually:be!==null,customThemeColors:null,language:Se,setWallpaper:t=>e({wallpaper:t}),setWallpaperModule:t=>e({wallpaperModule:t}),setLauncherIcon:t=>e({launcherIcon:t}),setFont:t=>e({font:t}),markFontDownloaded:t=>e(e=>({downloadedFonts:e.downloadedFonts.includes(t)?e.downloadedFonts:[...e.downloadedFonts,t]})),setFontSize:t=>e({fontSize:t}),setAnimationDuration:t=>e({animationDuration:t}),setThemeMode:t=>{Y.setMode(t),e({theme:Y.getTheme(),themeSetManually:!0})},toggleTheme:()=>{Y.toggle(),e({theme:Y.getTheme(),themeSetManually:!0})},setThemeAutomatic:()=>e({themeSetManually:!1}),applySystemTheme:t=>{Y.setMode(t),e({theme:Y.getTheme()})},setCustomThemeColors:t=>{e({customThemeColors:t})},setLanguage:t=>e({language:t})}),{name:`fde-desktop:settings`,storage:g.ft(()=>localStorage)})),we={container:`_container_a0fjd_1`,flag:`_flag_a0fjd_8`},Te={en:(0,w.jsxs)(`svg`,{viewBox:`0 0 60 40`,className:we.flag,children:[(0,w.jsx)(`rect`,{fill:`#012169`,width:`60`,height:`40`}),(0,w.jsx)(`path`,{d:`M0,0 L60,40 M60,0 L0,40`,stroke:`#fff`,strokeWidth:`6`}),(0,w.jsx)(`path`,{d:`M0,0 L60,40 M60,0 L0,40`,stroke:`#C8102E`,strokeWidth:`4`}),(0,w.jsx)(`path`,{d:`M30,0 V40 M0,20 H60`,stroke:`#fff`,strokeWidth:`10`}),(0,w.jsx)(`path`,{d:`M30,0 V40 M0,20 H60`,stroke:`#C8102E`,strokeWidth:`6`})]}),es:(0,w.jsxs)(`svg`,{viewBox:`0 0 60 40`,className:we.flag,children:[(0,w.jsx)(`rect`,{fill:`#C60B1E`,width:`60`,height:`40`}),(0,w.jsx)(`rect`,{fill:`#FFC400`,y:`10`,width:`60`,height:`20`})]})},Ee=({lang:e,size:t=20})=>(0,w.jsx)(`div`,{style:{width:t*1.5,height:t},className:we.container,"aria-label":e===`en`?`English`:`Español`,"data-testid":`flag-${e}`,children:Te[e]}),De=[{value:`system-ui`,label:`System Default`,stack:`system-ui, Avenir, Helvetica, Arial, sans-serif`},{value:`Courier New`,label:`Courier New`,stack:`"Courier New", monospace`},{value:`Source Code Pro`,label:`Source Code Pro`,stack:`"Source Code Pro", monospace`},{value:`Open Sans`,label:`Open Sans`,stack:`"Open Sans", monospace`}],Oe=Object.fromEntries(De.map(e=>[e.value,e.stack])),Z={"Source Code Pro":`https://fonts.googleapis.com/css2?family=Source+Code+Pro&display=swap`,"Open Sans":`https://fonts.googleapis.com/css2?family=Open+Sans&display=swap`},ke=[{id:`wallpaper`,label:`Wallpaper`,fcIcon:`FcPicture`,description:`Change the desktop background image.`},{id:`appearance`,label:`Appearance`,fcIcon:`FcBinoculars`,description:`Switch between light and dark mode.`},{id:`launcher`,label:`Launcher`,fcIcon:`FcElectronics`,description:`Choose the launcher button icon.`},{id:`font`,label:`Font`,fcIcon:`FcEditImage`,description:`Select the system font family.`},{id:`language`,label:`Language`,fcIcon:`FcGlobe`,description:`Choose your preferred language.`},{id:`reset`,label:`Reset to Default`,fcIcon:`FcDisclaimer`,description:`Reset all settings and data to defaults.`}],Q=({title:e,description:t,children:n})=>(0,w.jsxs)(m.t,{gap:`md`,p:`md`,children:[(0,w.jsx)(d.o,{fw:600,size:`lg`,children:e}),t&&(0,w.jsx)(d.o,{size:`sm`,c:`dimmed`,children:t}),n]}),Ae=`/Images/wallpaper.jpg`,je=()=>{let{t:e}=_.t(`settings`),t=X(e=>e.wallpaper),n=X(e=>e.wallpaperModule),r=X(e=>e.setWallpaper),a=X(e=>e.setWallpaperModule),[o,s]=(0,C.useState)(``),[c,l]=(0,C.useState)(!1),d=(0,C.useRef)(null),p=y.t(t??void 0)??Ae,m=(0,C.useCallback)(e=>{let t=e.target.files?.[0];if(!t)return;let n=new FileReader;n.onload=e=>{let t=e.target?.result;typeof t==`string`&&r(t)},n.readAsDataURL(t)},[r]),h=(0,C.useCallback)(()=>{let e=o.trim();e&&r(e)},[o,r]),g=(0,C.useCallback)(()=>{r(null),s(``)},[r]),v=(0,C.useCallback)(e=>{let t=e.url?e.url.startsWith(`idb://`)?e.url:`/${e.url}`:null;t&&r(t),l(!1)},[r]);return(0,w.jsxs)(Q,{title:e(`wallpaper.title`),children:[(0,w.jsx)(`div`,{children:(0,w.jsx)(J,{value:n,onChange:a,data:[{value:`default`,label:e(`wallpaper.staticImage`)}],fullWidth:!0})}),(0,w.jsx)(`img`,{src:p,alt:e(`wallpaper.wallpaperPreview`),style:{width:`100%`,height:180,objectFit:`cover`,borderRadius:8}}),(0,w.jsxs)(u.t,{children:[(0,w.jsx)(`input`,{ref:d,type:`file`,accept:`image/*`,style:{display:`none`},onChange:m,"aria-label":e(`wallpaper.uploadAria`,{defaultValue:`Upload wallpaper file`})}),(0,w.jsx)(f.t,{variant:`light`,onClick:()=>l(!0),children:e(`wallpaper.chooseFromImages`)}),(0,w.jsx)(f.t,{variant:`light`,onClick:()=>d.current?.click(),children:e(`wallpaper.uploadFromDisk`)}),(0,w.jsx)(f.t,{variant:`subtle`,color:`red`,onClick:g,children:e(`wallpaper.resetToDefault`)})]}),(0,w.jsxs)(u.t,{align:`flex-end`,children:[(0,w.jsx)(i.t,{label:e(`wallpaper.orEnterUrl`),placeholder:`https://example.com/image.jpg`,value:o,onChange:e=>s(e.currentTarget.value),style:{flex:1}}),(0,w.jsx)(f.t,{onClick:h,disabled:!o.trim(),children:e(`common:actions.apply`)})]}),(0,w.jsx)(b.n,{opened:c,acceptedMimeTypes:[`image/*`],onConfirm:v,onCancel:()=>l(!1)})]})},Me=()=>{let{t:n}=_.t(`settings`),r=X(e=>e.theme.mode),i=X(e=>e.themeSetManually),o=X(e=>e.customThemeColors),s=X(e=>e.animationDuration),c=X(e=>e.setThemeMode),l=X(e=>e.setThemeAutomatic),f=X(e=>e.setCustomThemeColors),p=X(e=>e.setAnimationDuration),h=o?`custom`:i?r:`system`,g=(0,C.useCallback)(e=>{e===`system`?(l(),f(null)):e===`custom`?f({taskbar:`#339af0`,window:`#ffffff`,accent:`#339af0`}):(c(e),f(null))},[c,l,f]),v=(0,C.useCallback)(e=>t=>{o&&f({...o,[e]:t})},[o,f]),y=(0,C.useCallback)(e=>{p(e)},[p]),b=h===`custom`;return(0,w.jsxs)(m.t,{gap:`md`,p:`md`,children:[(0,w.jsx)(d.o,{fw:600,size:`lg`,children:n(`appearance.title`)}),(0,w.jsx)(d.o,{size:`sm`,c:`dimmed`,children:n(`appearance.description`)}),(0,w.jsx)(J,{value:h,onChange:g,data:[{label:n(`common:theme.light`),value:`light`},{label:n(`common:theme.dark`),value:`dark`},{label:n(`common:theme.system`),value:`system`},{label:n(`common:theme.custom`),value:`custom`}],"aria-label":n(`appearance.themeMode`,{defaultValue:`Theme mode`})}),(0,w.jsxs)(m.t,{gap:`sm`,mt:`md`,children:[(0,w.jsxs)(e.t,{children:[(0,w.jsx)(d.o,{size:`sm`,fw:500,mb:`xs`,c:b?`dark`:void 0,children:n(`appearance.taskbar`)}),(0,w.jsx)(t.t,{value:o?.taskbar??`#339af0`,onChange:v(`taskbar`),disabled:!b})]}),(0,w.jsxs)(e.t,{children:[(0,w.jsx)(d.o,{size:`sm`,fw:500,mb:`xs`,c:b?`dark`:void 0,children:n(`appearance.window`)}),(0,w.jsx)(t.t,{value:o?.window??`#ffffff`,onChange:v(`window`),disabled:!b})]}),(0,w.jsxs)(e.t,{children:[(0,w.jsx)(d.o,{size:`sm`,fw:500,mb:`xs`,c:b?`dark`:void 0,children:n(`appearance.accent`)}),(0,w.jsx)(t.t,{value:o?.accent??`#339af0`,onChange:v(`accent`),disabled:!b})]})]}),(0,w.jsxs)(e.t,{mt:`md`,children:[(0,w.jsx)(d.o,{size:`sm`,fw:500,mb:`xs`,children:n(`appearance.animationDuration`)}),(0,w.jsx)(d.o,{size:`xs`,c:`dimmed`,mb:`sm`,children:n(`appearance.animationDescription`)}),(0,w.jsxs)(u.t,{align:`center`,gap:`md`,children:[(0,w.jsx)(a.t,{value:s,onChange:y,min:.1,max:1,step:.1,style:{flex:1},marks:[{value:.1,label:`0.1s`},{value:.5,label:`0.5s`},{value:1,label:`1.0s`}],"aria-label":n(`appearance.animationDuration`)}),(0,w.jsxs)(d.o,{size:`sm`,fw:500,style:{minWidth:40},children:[s.toFixed(1),`s`]})]})]})]})},Ne=()=>{let e=X(e=>e.launcherIcon),r=X(e=>e.setLauncherIcon),[o,s]=(0,C.useState)([]),[l,u]=(0,C.useState)(``),d=(0,C.useDeferredValue)(l);(0,C.useEffect)(()=>{Promise.resolve().then(()=>require(`./fc-DejOsQyD.cjs`)).then(e=>{s(Object.keys(e).filter(e=>e.startsWith(`Fc`)).sort())})},[]);let f=d?o.filter(e=>e.toLowerCase().includes(d.toLowerCase())):o,m=(0,C.useCallback)(e=>{r(e)},[r]);return(0,w.jsxs)(Q,{title:`Launcher Icon`,description:`Selected: ${e}`,children:[(0,w.jsx)(i.t,{placeholder:`Search icons...`,value:l,onChange:e=>u(e.currentTarget.value),"aria-label":`Search icons`}),(0,w.jsx)(a.a,{style:{flex:1,height:300},children:(0,w.jsx)(t.n,{cols:8,spacing:4,children:f.map(t=>(0,w.jsx)(n.t,{label:t,withArrow:!0,openDelay:400,children:(0,w.jsx)(c.t,{onClick:()=>m(t),"aria-label":t,"aria-pressed":t===e,style:{padding:6,borderRadius:6,background:t===e?`var(--mantine-primary-color-light)`:`transparent`,display:`flex`,alignItems:`center`,justifyContent:`center`},children:(0,w.jsx)(p.t,{fcIcon:t,size:24})})},t))})})]})},Pe=e=>{let t=Z[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)},Fe=async e=>{let t=Z[e];if(!t)throw Error(`Font "${e}" not found in Google Fonts`);let n=await fetch(t);if(!n.ok)throw Error(`Failed to download font: HTTP ${n.status}`);return await n.text(),Pe(e),{font:e,success:!0}},Ie=e=>{let t=(0,T.useQueryClient)(),n=X(e=>e.markFontDownloaded),r=X(e=>e.downloadedFonts),i=e?r.includes(e):!1,a=e&&!i&&Z[e],o=(0,T.useQuery)({queryKey:[`font`,e??``],queryFn:async({queryKey:e})=>{let[,t]=e;if(!t||!Z[t])throw Error(`Font "${t}" not available`);let r=await Fe(t);return r.success&&n(t),r},enabled:!!a,staleTime:1/0,gcTime:1/0,retry:!1}),s=o.isFetching?{status:`downloading`,loaded:0,total:null,percent:null,error:null}:o.isError?{status:`error`,loaded:0,total:null,percent:null,error:o.error?.message??`Unknown error`}:o.isSuccess?{status:`done`,loaded:0,total:0,percent:100,error:null}:{status:`idle`,loaded:0,total:null,percent:null,error:null},c=()=>{e&&t.removeQueries({queryKey:[`font`,e]})};return{...o,progress:s,isDownloaded:i,reset:c}},Le=x.t[1],Re=({status:e,error:t,onDownload:n})=>{let{t:r}=_.t(`settings`);return t?(0,w.jsx)(B,{color:Le,variant:`filled`,size:`sm`,"aria-label":`Download error: ${t}`,children:r(`common:status.error`)}):(0,w.jsx)(f.t,{size:`xs`,variant:`light`,onClick:n,loading:e===`downloading`,"aria-label":r(`font.download`),children:r(`font.download`)})},ze=()=>{let{t:e}=_.t(`settings`),t=X(e=>e.font),n=X(e=>e.setFont),r=X(e=>e.fontSize),i=X(e=>e.setFontSize),o=X(e=>e.downloadedFonts),c=X(e=>e.markFontDownloaded),[f,p]=(0,C.useState)(null),h=Ie(f);(0,C.useEffect)(()=>{h.isSuccess&&h.data?.success&&f&&(o.includes(f)||c(f))},[h.isSuccess,h.data,f,o,c]);let g=(0,C.useCallback)(e=>{p(e)},[]),v=e=>o.includes(e)?`done`:f===e?h.progress.status:`idle`,y=e=>f===e?h.progress.error:null,b=(0,C.useCallback)(e=>{let t=e.trim();t&&(Z[t]=`https://fonts.googleapis.com/css2?family=${t.replace(/\s+/g,`+`)}&display=swap`,p(t))},[]),x=De.map(e=>e.value),S=o.filter(e=>!x.includes(e));return(0,w.jsxs)(m.t,{gap:`md`,p:`md`,children:[(0,w.jsx)(d.o,{fw:600,size:`lg`,children:e(`font.title`)}),(0,w.jsx)(d.o,{size:`sm`,c:`dimmed`,children:e(`font.description`)}),(0,w.jsx)(q.Group,{value:t,onChange:n,"aria-label":e(`font.selectionAria`,{defaultValue:`Font selection`}),children:(0,w.jsxs)(m.t,{gap:`xs`,children:[De.map(e=>{let t=!!Z[e.value],n=o.includes(e.value),r=v(e.value),i=y(e.value),a=!t||n||r===`done`;return(0,w.jsx)(l.t,{p:`sm`,withBorder:!0,radius:`md`,children:(0,w.jsxs)(m.t,{gap:`xs`,children:[(0,w.jsxs)(u.t,{justify:`space-between`,children:[(0,w.jsx)(q,{value:e.value,label:e.label,"aria-label":e.label,disabled:!a}),(0,w.jsxs)(u.t,{gap:`xs`,align:`center`,children:[a&&(0,w.jsx)(d.o,{size:`sm`,c:`dimmed`,style:{fontFamily:e.stack},children:`AaBbCcDd`}),t&&(0,w.jsx)(Re,{fontLabel:e.label,status:r,error:i,onDownload:()=>g(e.value),isDownloaded:n})]})]}),t&&r===`downloading`&&(0,w.jsx)(s.t,{state:h.progress})]})},e.value)}),S.map(e=>(0,w.jsx)(l.t,{p:`sm`,withBorder:!0,radius:`md`,children:(0,w.jsxs)(u.t,{justify:`space-between`,children:[(0,w.jsx)(q,{value:e,label:e,"aria-label":e}),(0,w.jsx)(d.o,{size:`sm`,c:`dimmed`,style:{fontFamily:`"${e}"`},children:`AaBbCcDd`})]})},e))]})}),(0,w.jsx)(l.t,{p:`sm`,withBorder:!0,radius:`md`,children:(0,w.jsxs)(m.t,{gap:`xs`,children:[(0,w.jsxs)(u.t,{justify:`space-between`,children:[(0,w.jsx)(d.o,{size:`sm`,fw:500,children:e(`font.fontSize`)}),(0,w.jsxs)(d.o,{size:`sm`,c:`dimmed`,children:[r,`px`]})]}),(0,w.jsx)(a.t,{value:r,onChange:i,min:10,max:24,step:1,marks:[{value:10},{value:14},{value:18},{value:20},{value:24}],"aria-label":e(`font.fontSizeAria`,{defaultValue:`Font size`})})]})}),(0,w.jsx)(Be,{onDownload:b,activeDownload:f,fontDownload:h})]})},Be=({onDownload:e,activeDownload:t,fontDownload:n})=>{let{t:r}=_.t(`settings`),[a,o]=(0,C.useState)(``),c=t===a.trim(),p=c?n.progress.status:`idle`,h=c&&n.progress.status===`error`,g=(0,C.useCallback)(e=>{o(e),h&&n.reset?.()},[h,n]),v=(0,C.useCallback)(()=>{e(a)},[a,e]),y=c&&p===`done`;return(0,w.jsx)(l.t,{p:`sm`,withBorder:!0,radius:`md`,children:(0,w.jsxs)(m.t,{gap:`xs`,children:[(0,w.jsxs)(d.o,{size:`sm`,fw:500,children:[r(`font.downloadByName`),` `,(0,w.jsx)(`a`,{href:`https://fonts.google.com/`,target:`_blank`,rel:`noreferrer`,children:r(`font.fromGoogleFonts`)})]}),(0,w.jsxs)(u.t,{gap:`xs`,align:`flex-start`,children:[(0,w.jsx)(i.t,{placeholder:r(`font.namePlaceholder`,{defaultValue:`e.g. Open Sans`}),value:a,onChange:e=>g(e.currentTarget.value),style:{flex:1},"aria-label":r(`font.customNameAria`,{defaultValue:`Custom font name`}),error:h?r(`font.downloadError`):void 0}),(0,w.jsx)(f.t,{onClick:v,disabled:!a.trim()||p===`downloading`,loading:p===`downloading`,"aria-label":r(`font.downloadCustomAria`,{defaultValue:`Download custom font`}),style:{marginTop:h?0:void 0},children:r(`font.download`)})]}),p===`downloading`&&(0,w.jsx)(s.t,{state:n.progress}),y&&(0,w.jsx)(d.o,{size:`xs`,c:`dimmed`,children:r(`font.downloadSuccess`)})]})})},Ve=[`en`,`es`],He=`en`,Ue={en:`English`,es:`Español`},We=()=>{let{t:e}=_.t(`settings`),t=X(e=>e.language),n=X(e=>e.setLanguage),r=(0,C.useCallback)(e=>{n(e)},[n]);return(0,w.jsx)(Q,{title:e(`language.title`),description:e(`language.description`),children:(0,w.jsx)(m.t,{gap:`xs`,children:Ve.map(e=>(0,w.jsx)(c.t,{onClick:()=>r(e),"aria-label":Ue[e],"aria-pressed":e===t,style:{padding:`12px 16px`,borderRadius:8,width:`100%`,background:e===t?`var(--mantine-primary-color-light)`:`transparent`,border:e===t?`1px solid var(--mantine-primary-color-filled)`:`1px solid transparent`,transition:`all 0.15s ease`,cursor:`pointer`},children:(0,w.jsxs)(u.t,{gap:`sm`,children:[(0,w.jsx)(Ee,{lang:e,size:24}),(0,w.jsx)(d.o,{fw:e===t?600:400,children:Ue[e]})]})},e))})})};async function Ge(e){let t=typeof globalThis<`u`?globalThis:typeof window<`u`?window:void 0;if(t){if(!e?.keepServiceWorker&&`serviceWorker`in t.navigator){let e=await t.navigator.serviceWorker.getRegistrations();for(let t of e)await t.unregister()}if(`caches`in t){let e=await t.caches.keys();for(let n of e)await t.caches.delete(n)}if(!e?.keepIndexedDB&&`indexedDB`in t){let e=await t.indexedDB.databases();for(let n of e)n.name&&t.indexedDB.deleteDatabase(n.name)}!e?.keepLocalStorage&&`localStorage`in t&&t.localStorage.clear(),!e?.keepSessionStorage&&`sessionStorage`in t&&t.sessionStorage.clear()}}async function Ke(){d.i()&&(await fetch(`/api/fs/reset`,{method:`POST`}),await fetch(`/api/fs/seed`,{method:`POST`}))}var qe=()=>{let{t}=_.t(`settings`),[n,r]=(0,C.useState)(!1),i=(0,C.useCallback)(()=>{r(!0)},[]),a=(0,C.useCallback)(()=>{r(!1)},[]),o=(0,C.useCallback)(async()=>{await Ke(),await Ge(),window.location.reload()},[]),s=(0,C.useCallback)(async()=>{await Ke(),await Ge({keepIndexedDB:!0}),window.location.reload()},[]);return(0,w.jsxs)(Q,{title:t(`reset.title`),description:t(`reset.description`),children:[(0,w.jsx)(f.t,{color:`red`,onClick:i,style:{alignSelf:`flex-start`},children:t(`reset.resetButton`)}),n&&(0,w.jsx)(e.t,{style:{position:`fixed`,top:0,left:0,right:0,bottom:0,background:`rgba(0,0,0,0.5)`,display:`flex`,alignItems:`center`,justifyContent:`center`,zIndex:1e3},role:`dialog`,"aria-label":`Confirm reset`,children:(0,w.jsx)(e.t,{style:{background:`var(--mantine-color-default)`,borderRadius:8,padding:24,maxWidth:400,width:`100%`},children:(0,w.jsxs)(m.t,{gap:`md`,children:[(0,w.jsx)(d.o,{fw:600,size:`lg`,ta:`center`,children:t(`reset.modalTitle`)}),(0,w.jsx)(d.o,{size:`sm`,c:`dimmed`,ta:`center`,children:t(`reset.modalDescription`)}),(0,w.jsxs)(u.t,{justify:`center`,gap:`xs`,mt:`md`,children:[(0,w.jsx)(f.t,{variant:`default`,onClick:a,children:t(`reset.goBack`)}),(0,w.jsx)(f.t,{color:`blue`,onClick:s,children:t(`reset.keepFiles`)}),(0,w.jsx)(f.t,{color:`red`,onClick:o,children:t(`reset.burnEverything`)})]})]})})})]})},$={root:`_root_77epl_1`,sidebar:`_sidebar_77epl_8`,navItem:`_navItem_77epl_16`,content:`_content_77epl_41`,overviewPadding:`_overviewPadding_77epl_47`,sectionCard:`_sectionCard_77epl_51`,toolbar:`_toolbar_77epl_60`,dirtyIndicator:`_dirtyIndicator_77epl_70`,versionFooter:`_versionFooter_77epl_77`},Je={name:`Francisco Núñez Palomares`,title:`Fullstack Developer & DevOps`,email:`frannunpal@gmail.com`,phone:`+34 600 275 210`,location:`Spain`,linkedin:`https://www.linkedin.com/in/francisco-núñez-palomares-74a484171/`,github:`https://github.com/frannunpal`,cvUrls:{en:`Desktop/CV_2026_English.pdf`,es:`Desktop/CV 2026.pdf`}},Ye=`0.4.0`,Xe=()=>Ye,Ze={wallpaper:je,appearance:Me,launcher:Ne,font:ze,language:We,reset:qe},Qe=({window:e,notifyReady:n})=>{let{t:r}=_.t(`settings`),[i,a]=(0,C.useState)(null),[o,s]=(0,C.useState)(!1),c=g.o(e=>e.windows),l=e?.id??c.find(e=>e.content===`settings`)?.id,u=X(e=>e.wallpaper),h=X(e=>e.wallpaperModule),y=X(e=>e.theme),b=X(e=>e.font),x=X(e=>e.fontSize),T=X(e=>e.launcherIcon),E=X(e=>e.customThemeColors),D=X(e=>e.animationDuration),ee=X(e=>e.setWallpaper),O=X(e=>e.setWallpaperModule),k=X(e=>e.setFont),A=X(e=>e.setFontSize),te=X(e=>e.setLauncherIcon),j=X(e=>e.setThemeMode),M=X(e=>e.setCustomThemeColors),N=X(e=>e.setThemeAutomatic),P=X(e=>e.setAnimationDuration),F=(0,C.useRef)(null);(0,C.useEffect)(()=>{F.current===null&&(F.current={wallpaper:u,wallpaperModule:h,themeMode:y.mode,font:b,fontSize:x,launcherIcon:T,customThemeColors:E,animationDuration:D})},[u,h,y.mode,b,x,T,E,D]),(0,C.useEffect)(()=>{if(!F.current)return;let e={wallpaper:u,wallpaperModule:h,themeMode:y.mode,font:b,fontSize:x,launcherIcon:T,customThemeColors:E,animationDuration:D};s(JSON.stringify(e)!==JSON.stringify(F.current))},[u,h,y.mode,b,x,T,E,D]);let I=(0,C.useCallback)(()=>{let e=F.current;e&&(ee(e.wallpaper),O(e.wallpaperModule),k(e.font),A(e.fontSize),te(e.launcherIcon),P(e.animationDuration),e.customThemeColors?M(e.customThemeColors):(M(null),N()),j(e.themeMode),s(!1))},[ee,O,k,A,te,P,j,M,N]);(0,C.useEffect)(()=>{l&&S.n.getState().reset(l)},[l]),(0,C.useEffect)(()=>{l&&S.n.getState().setIsDirty(l,o)},[l,o]),(0,C.useEffect)(()=>{n?.({...e?.contentData??{},discard:I})},[e,n,I]),v.i({isDirtyGetter:(0,C.useCallback)(()=>{if(!F.current)return!1;let e={wallpaper:X.getState().wallpaper,wallpaperModule:X.getState().wallpaperModule,themeMode:X.getState().theme.mode,font:X.getState().font,fontSize:X.getState().fontSize,launcherIcon:X.getState().launcherIcon,customThemeColors:X.getState().customThemeColors,animationDuration:X.getState().animationDuration};return JSON.stringify(e)!==JSON.stringify(F.current)},[]),windowId:l,onDiscard:I,onSave:()=>{}});let L=(0,C.useCallback)(e=>{a(e)},[]),R=(0,C.useCallback)(()=>{a(null)},[]),z=(0,C.useCallback)(()=>{globalThis.location.href=`mailto:${Je.email}`},[]),B=i?Ze[i]:null;return(0,w.jsxs)(`div`,{className:$.root,children:[(0,w.jsx)(`aside`,{className:$.sidebar,children:(0,w.jsxs)(`nav`,{"aria-label":`Settings sections`,children:[(0,w.jsxs)(`button`,{className:$.navItem,"data-active":i===null||void 0,onClick:R,"aria-label":`All Settings`,"aria-current":i===null?`page`:void 0,children:[(0,w.jsx)(p.t,{fcIcon:`FcList`,size:16}),(0,w.jsx)(d.o,{size:`xs`,ml:6,truncate:!0,children:r(`all`)})]}),ke.map(e=>(0,w.jsxs)(`button`,{className:$.navItem,"data-active":i===e.id||void 0,onClick:()=>L(e.id),"aria-label":e.label,"aria-current":i===e.id?`page`:void 0,children:[(0,w.jsx)(p.t,{fcIcon:e.fcIcon,size:16}),(0,w.jsx)(d.o,{size:`xs`,ml:6,truncate:!0,children:r(`sections.${e.id}.label`)})]},e.id))]})}),(0,w.jsx)(`main`,{className:$.content,children:B?(0,w.jsx)(B,{}):(0,w.jsxs)(m.t,{className:$.overviewPadding,h:`100%`,justify:`space-between`,gap:0,children:[(0,w.jsxs)(`div`,{children:[(0,w.jsx)(d.o,{fw:500,mb:`md`,size:`sm`,c:`dimmed`,children:r(`all`)}),(0,w.jsx)(t.n,{cols:2,spacing:`sm`,children:ke.map(e=>(0,w.jsx)(p.n,{withBorder:!0,padding:`md`,radius:`md`,className:$.sectionCard,onClick:()=>L(e.id),role:`button`,"aria-label":`Open ${e.label} settings`,children:(0,w.jsxs)(m.t,{gap:6,align:`flex-start`,children:[(0,w.jsx)(p.t,{fcIcon:e.fcIcon,size:28}),(0,w.jsx)(d.o,{size:`sm`,fw:500,children:r(`sections.${e.id}.label`)}),(0,w.jsx)(d.o,{size:`xs`,c:`dimmed`,children:r(`sections.${e.id}.description`)})]})},e.id))})]}),(0,w.jsx)(f.t,{gradient:{from:`blue`,to:`cyan`,deg:90},onClick:z,children:`FDE: Fran Desktop Environment`}),(0,w.jsx)(d.o,{size:`xs`,c:`dimmed`,ta:`center`,className:$.versionFooter,children:Xe()})]})})]})};Object.defineProperty(exports,`a`,{enumerable:!0,get:function(){return Ve}}),Object.defineProperty(exports,`c`,{enumerable:!0,get:function(){return Q}}),Object.defineProperty(exports,`d`,{enumerable:!0,get:function(){return Oe}}),Object.defineProperty(exports,`f`,{enumerable:!0,get:function(){return Z}}),Object.defineProperty(exports,`g`,{enumerable:!0,get:function(){return ge}}),Object.defineProperty(exports,`h`,{enumerable:!0,get:function(){return X}}),Object.defineProperty(exports,`i`,{enumerable:!0,get:function(){return He}}),Object.defineProperty(exports,`l`,{enumerable:!0,get:function(){return ke}}),Object.defineProperty(exports,`m`,{enumerable:!0,get:function(){return ye}}),Object.defineProperty(exports,`n`,{enumerable:!0,get:function(){return Je}}),Object.defineProperty(exports,`o`,{enumerable:!0,get:function(){return Ie}}),Object.defineProperty(exports,`p`,{enumerable:!0,get:function(){return Ee}}),Object.defineProperty(exports,`r`,{enumerable:!0,get:function(){return Ge}}),Object.defineProperty(exports,`s`,{enumerable:!0,get:function(){return Pe}}),Object.defineProperty(exports,`t`,{enumerable:!0,get:function(){return Qe}}),Object.defineProperty(exports,`u`,{enumerable:!0,get:function(){return De}});