import{u as e}from"./index-BqyXv5bE.js";var t=e=>{let n=[];return e.forEach(e=>{let r={XMLType:`MENUITEM`,...e};e.children&&(r.children=t(e.children)),delete r.key,delete r.isLeaf,delete r.editable,n.push(r)}),n};function n(n){let r={settings:{XMLType:`SETTINGS`,children:[]}},i={XMLType:`PROFILE`};if(Object.entries(n).forEach(e=>{if(e[0]!==`auths`){let t=e[1];i[e[0]]=t}}),delete i.key,delete i.longFile,delete i.file,delete i.role,delete i.disabled_display,delete i.referentUsers,delete i.granted_modules,delete i.ctiusrdir_rule,delete i.ctisrvdir_rule,delete i.lastConnexion_token,delete i.lastConnexion_datetime,delete i.favorites,delete i.specialite,delete i.security_level_id,delete i.ctiusrdir_synchronize_force,Object.keys(i).forEach(e=>{e.startsWith(`FAVORIS_PARTAGES_`)&&delete i[e]}),r.settings.children.push(i),n.auths){let e=new Map;n.auths.forEach(t=>{if(!t)return;if(t.type===`module`){let n=`${t.module}|${t.name}`,i=e.get(n);if(i!==void 0){t.granted===`full`&&(r.settings.children[i].granted=`full`);return}e.set(n,r.settings.children.length)}let n={XMLType:`AUT`,...t};delete n.key,r.settings.children.push(n)})}if(n.favorites){let e={XMLType:`FAVORITE`,name:`Favoris`,label:`Mes favoris`,children:t(n.favorites)};r.settings.children.push(e)}return e(r,!0)}function r(){let e={profil:``,name:`Nouvel utilisateur`,password:``,description:``,mail:``,hasMailExploit:`false`,disabled:`false`,isadmin:`false`,isCTI:`false`,isdecideur:`false`,ismedecin:`false`,homeview:``,hidenames:`false`,referentUser:``,referentUser2:``,referentUser3:``,referentUser4:``,referentUser5:``,referentUser_withDashboard:`false`,referentUser_withFavorite:`false`,security_level_id:`-1`,default_ctiusrdir_synchronize_all:`false`,default_ctiusrdir_synchronize_name:`false`,default_ctiusrdir_synchronize_role:`false`,default_ctiusrdir_synchronize_password:`false`,default_ctiusrdir_synchronize_aut:`false`};return e.auths=[{type:`module`,module:`iCTI_eis`,name:`iCTI_eis`,granted:`none`,refProfile:`*user`},{type:`module`,module:`iCTI_qualite`,name:`iCTI_qualite`,granted:`none`,refProfile:`*user`},{type:`module`,module:`iCTI_pmsi`,name:`iCTI_pmsi`,granted:`none`,refProfile:`*user`},{type:`module`,module:`iCTI_pmsissr`,name:`iCTI_pmsissr`,granted:`none`,refProfile:`*user`},{type:`module`,module:`iCTI_pmsipsy`,name:`iCTI_pmsipsy`,granted:`none`,refProfile:`*user`},{type:`module`,module:`iCTI_pmsihad`,name:`iCTI_pmsihad`,granted:`none`,refProfile:`*user`},{type:`module`,module:`iCTI_ssae`,name:`iCTI_ssae`,granted:`none`,refProfile:`*user`},{type:`module`,module:`iCTI_dpi`,name:`iCTI_dpi`,granted:`none`,refProfile:`*user`},{type:`module`,module:`iCTI_activite`,name:`iCTI_activite`,granted:`none`,refProfile:`*user`},{type:`module`,module:`iCTI_compta`,name:`iCTI_compta`,granted:`none`,refProfile:`*user`},{type:`module`,module:`iCTI_rh`,name:`iCTI_rh`,granted:`none`,refProfile:`*user`,dataProfileGranted:`partial`,dataProfile:`NONE`},{type:`module`,module:`iCTI_eco`,name:`iCTI_eco`,granted:`none`,refProfile:`*user`,dataGranted:`partial`,dataRule1:`NONE`},{type:`module`,module:`iCTI_specifique`,name:`iCTI_specifique`,granted:`none`,refProfile:`*user`},{type:`module`,module:`iCTI_tools`,name:`iCTI_tools`,granted:`none`,refProfile:`*user`},{type:`module`,module:`FAVORIS_PARTAGES_ALL`,name:`FAVORIS_PARTAGES_ALL`,granted:`none`,refProfile:`*user`},{type:`module`,module:`FAVORIS_PARTAGES_PMSI`,name:`FAVORIS_PARTAGES_PMSI`,granted:`none`,refProfile:`*user`},{type:`module`,module:`FAVORIS_PARTAGES_PMSISSR`,name:`FAVORIS_PARTAGES_PMSISSR`,granted:`none`,refProfile:`*user`},{type:`module`,module:`FAVORIS_PARTAGES_PMSIPSY`,name:`FAVORIS_PARTAGES_PMSIPSY`,granted:`none`,refProfile:`*user`},{type:`module`,module:`FAVORIS_PARTAGES_ACTIVITE`,name:`FAVORIS_PARTAGES_ACTIVITE`,granted:`none`,refProfile:`*user`},{type:`module`,module:`FAVORIS_PARTAGES_RH`,name:`FAVORIS_PARTAGES_RH`,granted:`none`,refProfile:`*user`},{type:`module`,module:`FAVORIS_PARTAGES_COMPTA`,name:`FAVORIS_PARTAGES_COMPTA`,granted:`none`,refProfile:`*user`},{type:`module`,module:`FAVORIS_PARTAGES_EIS`,name:`FAVORIS_PARTAGES_EIS`,granted:`none`,refProfile:`*user`},{type:`module`,module:`FAVORIS_PARTAGES_PARTIAL`,name:`FAVORIS_PARTAGES_PARTIAL`,granted:`none`,refProfile:`*user`},{type:`token`,name:`*ALL`,granted:`full`}],e}var i=e=>({...e,code:``,profil:``,name:`Copie de ${e.name}`,password:``,auths:[...e.auths],favorites:[...e.favorites]});export{n as i,t as n,r,i as t};