Files
aula-manager/chunk-DKMcZRgE.js
T
2026-07-05 17:54:50 +07:00

2 lines
19 KiB
JavaScript

import{d as f,o as m,a as n,T as c,a6 as H,u as p,a7 as L,a8 as R,x as k,N as d,b,A as h,f as U}from"./app-CPb3bToC.js";import{b as O,m as S,a as g}from"./chunk-GGPowwzA.js";import{m as N}from"./chunk-C_9zYcUo.js";import{m as J}from"./chunk-DtbgphQc.js";const v=f("model_ms_sle_keys",{state:()=>({keys:[],macros:[],product_name:""}),actions:{load_profile(_){this.keys=JSON.parse(JSON.stringify(_.keys)),this.macros=JSON.parse(JSON.stringify(_.macros)),this.product_name=_.product_name},default(){let _=m(),s=[];const e=n();if(e.current_device){let r=e.current_device.product_name;return{keys:_,macros:s,product_name:r}}return{keys:_,macros:s,product_name:""}},setup_keys(){this.keys.length===0&&(this.keys=m())},_sync_macros(){let _=[];for(let s=0;s<this.keys.length;s++)this.keys[s].type===c.MACRO&&_.push(JSON.parse(JSON.stringify(this.keys[s].value)));_=H(_,"name"),this.macros=JSON.parse(JSON.stringify(_))},reset_key(_){let s=m();for(let e=0;e<s.length;e++)if(Number(s[e].pos)===Number(_)){this.keys[e]=JSON.parse(JSON.stringify(s[e]));break}this._sync_macros()},set_key(_,s){for(let e=0;e<this.keys.length;e++)this.keys[e].type===c.MACRO&&this.keys[e].name===s.name&&(this.keys[e].value=JSON.parse(JSON.stringify(s.value.data))),Number(this.keys[e].pos)===Number(_)&&(this.keys[e].type=s.type,this.keys[e].value=s.value,s.type===c.MACRO&&(this.keys[e].value=JSON.parse(JSON.stringify(s.value.data))),this.keys[e].name=s.name);this._sync_macros()},async sync(){try{let s=await p().controller;return this._sync_macros(),await s.set_keys(this)}catch{return!1}},async fetch(){try{const e=await(await p().controller).get_keys();if(e===null)return!1;for(let r=0;r<this.keys.length;r++){const t=Number(this.keys[r].pos);if(e[t+0]===3){let i=e[t+3];if(i>this.macros.length-1&&(i=0),this.macros.length===0){let o=get_keys_default(0,Number(this.keys[r].pos));this.keys[r].name=o.name,this.keys[r].value=o.value,this.keys[r].type=c.BASIC;continue}let l=JSON.parse(JSON.stringify(this.macros[i]));this.keys[r].name=l.name,this.keys[r].value=JSON.parse(JSON.stringify(l)),this.keys[r].type=c.MACRO}else{let i=0;i+=e[t+0]*Math.pow(256,3),i+=e[t+1]*Math.pow(256,2),i+=e[t+2]*Math.pow(256,1),i+=e[t+3]*Math.pow(256,0),this.keys[r].value="0x"+L(i,8);const l=R(this.keys[r].value);try{this.keys[r].name=l.name,this.keys[r].type=l.type}catch{continue}}}}catch{return!1}}},persist:!0}),A=f("model_profile_ms_sle_v1",{state:()=>({profile_idx:0,model_ms_sle_basic:{},model_ms_sle_keys:{},model_ms_sle_sensor:{}}),actions:{sync_to_profile(){let _=a();const s=O(),e=v(),r=k();return _.update_profile(this.profile_idx,{model_ms_sle_basic:{version:s.version,password:s.password,work_mode:s.work_mode,connect_status:s.connect_status,battery:s.battery,profile:s.profile,max_report:s.max_report,sensor_info:s.sensor_info,max_dpi:s.max_dpi,macro_size:s.macro_size},model_ms_sle_keys:{keys:JSON.parse(JSON.stringify(e.keys)),macros:JSON.parse(JSON.stringify(e.macros)),product_name:e.product_name},model_ms_sle_sensor:{sensor_info:r.sensor_info,xy_report_rate:r.xy_report_rate,dpi_profile:r.dpi_profile,lod_altitude:r.lod_altitude,line_correct:r.line_correct,surface_tuning:r.surface_tuning,angle_tuning:r.angle_tuning,mouse_lift_enable:r.mouse_lift_enable,ripple_control:r.ripple_control,motion_sync:r.motion_sync,work_speed_mode:r.work_speed_mode,current_dpi_x:JSON.parse(JSON.stringify(r.current_dpi_x)),light_custom_enable:r.light_custom_enable,light_custom_mode:r.light_custom_mode,light_custom_rgb:JSON.parse(JSON.stringify(r.light_custom_rgb)),dpi_color:JSON.parse(JSON.stringify(r.dpi_color))}})},async sync_to_device(_){let e=a().get_profile_idx(_);if(e===null)return!1;let r=e.profile.model_ms_sle_basic,t=e.profile.model_ms_sle_keys,i=e.profile.model_ms_sle_sensor,l=O();l.load_profile(r);let o=await l.sync();if(!o)return!1;let y=v();if(y.load_profile(t),o=await y.sync(),!o)return!1;let u=k();return u.load_profile(i),o=await u.sync(),!!o},load_from_profile(_){let e=a().get_profile_idx(_);if(e===null)return!1;this.model_ms_sle_basic=e.profile.model_ms_sle_basic,this.model_ms_sle_keys=e.profile.model_ms_sle_keys,this.model_ms_sle_sensor=e.profile.model_ms_sle_sensor,this.profile_idx=_,O();let r=v(),t=k();return r.keys=JSON.parse(JSON.stringify(this.model_ms_sle_keys.keys)),r.macros=JSON.parse(JSON.stringify(this.model_ms_sle_keys.macros)),t.dpi_profile=JSON.parse(JSON.stringify(this.model_ms_sle_sensor.dpi_profile)),t.lod_altitude=JSON.parse(JSON.stringify(this.model_ms_sle_sensor.lod_altitude)),t.line_correct=JSON.parse(JSON.stringify(this.model_ms_sle_sensor.line_correct)),t.angle_tuning=JSON.parse(JSON.stringify(this.model_ms_sle_sensor.angle_tuning)),t.surface_tuning=JSON.parse(JSON.stringify(this.model_ms_sle_sensor.surface_tuning)),t.mouse_lift_enable=JSON.parse(JSON.stringify(this.model_ms_sle_sensor.mouse_lift_enable)),t.ripple_control=JSON.parse(JSON.stringify(this.model_ms_sle_sensor.ripple_control)),t.motion_sync=JSON.parse(JSON.stringify(this.model_ms_sle_sensor.motion_sync)),t.work_speed_mode=JSON.parse(JSON.stringify(this.model_ms_sle_sensor.work_speed_mode)),t.current_dpi_x=JSON.parse(JSON.stringify(this.model_ms_sle_sensor.current_dpi_x)),t.dpi_color=JSON.parse(JSON.stringify(this.model_ms_sle_sensor.dpi_color)),t.light_custom_enable=JSON.parse(JSON.stringify(this.model_ms_sle_sensor.light_custom_enable)),t.light_custom_mode=JSON.parse(JSON.stringify(this.model_ms_sle_sensor.light_custom_mode)),t.light_custom_rgb=JSON.parse(JSON.stringify(this.model_ms_sle_sensor.light_custom_rgb)),!0},add(_){let s={};const e=O(),r=v(),t=k();return s.model_ms_sle_basic=e.default(),s.model_ms_sle_keys=r.default(),s.model_ms_sle_sensor=t.default(),a().add_profile(_,s)},get_default(){let _={};const s=O(),e=v(),r=k();return _.model_ms_sle_basic=s.default(),_.model_ms_sle_keys=e.default(),_.model_ms_sle_sensor=r.default(),_}}}),x=f("model_profile_kb_by_v2",{state:()=>({profile_idx:0,model_kb_by_v2_keys:{},model_kb_by_v2_basic:{}}),actions:{async sync_to_profile(){let _=a();const s=N(),e=S();let r={keys:JSON.parse(JSON.stringify(s.keys)),macros:JSON.parse(JSON.stringify(s.macros)),layers:JSON.parse(JSON.stringify(s.layers)),current_layer:s.current_layer,product_name:s.product_name},t={battery_status:e.battery_status,battery_level:e.battery_level,light_params:JSON.parse(JSON.stringify(e.light_params)),light_mode:e.light_mode,low_latency:e.low_latency,mac_mode:e.mac_mode,polling_level:e.polling_level,sleep_level:e.sleep_level,win_lock:e.win_lock};return _.update_profile(this.profile_idx,{model_kb_by_v2_keys:r,model_kb_by_v2_basic:t})},load_from_profile(_){let e=a().get_profile_idx(_);if(e===null)return!1;this.model_kb_by_v2_keys=e.profile.model_kb_by_v2_keys,this.model_kb_by_v2_basic=e.profile.model_kb_by_v2_basic;let r=N();r.keys=JSON.parse(JSON.stringify(e.profile.model_kb_by_v2_keys.keys)),r.layers=JSON.parse(JSON.stringify(e.profile.model_kb_by_v2_keys.layers)),r.macros=JSON.parse(JSON.stringify(e.profile.model_kb_by_v2_keys.macros)),r.product_name=JSON.parse(JSON.stringify(e.profile.model_kb_by_v2_keys.product_name));let t=S();return t.light_mode=JSON.parse(JSON.stringify(e.profile.model_kb_by_v2_basic.light_mode)),t.light_params=JSON.parse(JSON.stringify(e.profile.model_kb_by_v2_basic.light_params)),t.low_latency=JSON.parse(JSON.stringify(e.profile.model_kb_by_v2_basic.low_latency)),t.mac_mode=JSON.parse(JSON.stringify(e.profile.model_kb_by_v2_basic.mac_mode)),t.polling_level=JSON.parse(JSON.stringify(e.profile.model_kb_by_v2_basic.polling_level)),t.sleep_level=JSON.parse(JSON.stringify(e.profile.model_kb_by_v2_basic.sleep_level)),t.win_lock=JSON.parse(JSON.stringify(e.profile.model_kb_by_v2_basic.win_lock)),this.profile_idx=_,!0},async sync_to_device(_){let e=a().get_profile_idx(_);if(e===null)return!1;let r=e.profile.model_kb_by_v2_keys,t=e.profile.model_kb_by_v2_basic,i=N();i.load_profile(r);let l=await i.sync();if(!l)return!1;await d(100);let o=S();return o.load_profile(t),l=await o.sync(),!(!l||(await d(100),l=await o.sync_light_color(),!l)||Number(o.light_mode)===277&&(await d(100),l=await i.sync_custom_light(),!l))},add(_){let s={};const e=N(),r=S();return s.model_kb_by_v2_keys=e.default(),s.model_kb_by_v2_basic=r.default(),a().add_profile(_,s)},get_default(){let _={};const s=N(),e=S();return _.model_kb_by_v2_keys=s.default(),_.model_kb_by_v2_basic=e.default(),_}}}),E=f("model_profile_kb_by_v3",{state:()=>({profile_idx:0,model_kb_by_v3_keys:{},model_kb_by_v3_basic:{}}),actions:{sync_to_profile(){let _=a();const s=J(),e=b();let r={keys:JSON.parse(JSON.stringify(s.keys)),macros:JSON.parse(JSON.stringify(s.macros)),layers:JSON.parse(JSON.stringify(s.layers)),current_layer:s.current_layer,product_name:s.product_name},t={battery_status:e.battery_status,battery_level:e.battery_level,light_params:JSON.parse(JSON.stringify(e.light_params)),light_mode:e.light_mode,low_latency:e.low_latency,mac_mode:e.mac_mode,polling_level:e.polling_level,sleep_level:e.sleep_level,win_lock:e.win_lock};return _.update_profile(this.profile_idx,{model_kb_by_v3_keys:r,model_kb_by_v3_basic:t})},load_from_profile(_){let e=a().get_profile_idx(_);if(e===null)return!1;this.model_kb_by_v3_keys=e.profile.model_kb_by_v3_keys,this.model_kb_by_v3_basic=e.profile.model_kb_by_v3_basic;let r=J();r.keys=JSON.parse(JSON.stringify(e.profile.model_kb_by_v3_keys.keys)),r.layers=JSON.parse(JSON.stringify(e.profile.model_kb_by_v3_keys.layers)),r.macros=JSON.parse(JSON.stringify(e.profile.model_kb_by_v3_keys.macros)),r.product_name=JSON.parse(JSON.stringify(e.profile.model_kb_by_v3_keys.product_name));let t=b();return t.light_mode=JSON.parse(JSON.stringify(e.profile.model_kb_by_v3_basic.light_mode)),t.light_params=JSON.parse(JSON.stringify(e.profile.model_kb_by_v3_basic.light_params)),t.low_latency=JSON.parse(JSON.stringify(e.profile.model_kb_by_v3_basic.low_latency)),t.mac_mode=JSON.parse(JSON.stringify(e.profile.model_kb_by_v3_basic.mac_mode)),t.polling_level=JSON.parse(JSON.stringify(e.profile.model_kb_by_v3_basic.polling_level)),t.sleep_level=JSON.parse(JSON.stringify(e.profile.model_kb_by_v3_basic.sleep_level)),t.win_lock=JSON.parse(JSON.stringify(e.profile.model_kb_by_v3_basic.win_lock)),this.profile_idx=_,!0},async sync_to_device(_){let e=a().get_profile_idx(_);if(e===null)return!1;let r=e.profile.model_kb_by_v3_keys,t=e.profile.model_kb_by_v3_basic,i=J();i.load_profile(r);let l=await i.sync();if(!l)return!1;await d(100);let o=b();return o.load_profile(t),l=await o.sync(),!(!l||(await d(100),l=await o.sync_light_color(),!l)||Number(o.light_mode)===277&&(await d(100),l=await i.sync_custom_light(),!l))},add(_){let s={};const e=J(),r=b();return s.model_kb_by_v3_keys=e.default(),s.model_kb_by_v3_basic=r.default(),a().add_profile(_,s)},get_default(){let _={};const s=J(),e=b();return _.model_kb_by_v3_keys=s.default(),_.model_kb_by_v3_basic=e.default(),_}}}),w=f("model_ms_pix_keys",{state:()=>({keys:[],macros:[],product_name:""}),actions:{load_profile(_){this.keys=JSON.parse(JSON.stringify(_.keys)),this.macros=JSON.parse(JSON.stringify(_.macros)),this.product_name=_.product_name},default(){let _=m(),s=[];const e=n();if(e.current_device){let r=e.current_device.product_name;return{keys:_,macros:s,product_name:r}}return null},setup_keys(){this.keys.length===0&&(this.keys=m())},_set_macros(){let _=[];for(let s=0;s<this.keys.length;s++)this.keys[s].type===c.MACRO&&_.push(JSON.parse(JSON.stringify(this.keys[s].value)));_=H(_,"name"),this.macros=JSON.parse(JSON.stringify(_))},reset_key(_){let s=m();for(let e=0;e<s.length;e++)if(Number(s[e].pos)===Number(_)){this.keys[e]=JSON.parse(JSON.stringify(s[e]));break}this._set_macros()},async set_key(_,s){for(let e=0;e<this.keys.length;e++)this.keys[e].type===c.MACRO&&this.keys[e].name===s.name&&(this.keys[e].value=JSON.parse(JSON.stringify(s.value.data))),Number(this.keys[e].pos)===Number(_)&&(this.keys[e].type=s.type,this.keys[e].value=s.value,s.type===c.MACRO&&(this.keys[e].value=JSON.parse(JSON.stringify(s.value.data))),this.keys[e].name=s.name);this._set_macros();try{return s.type===c.MACRO?await(await p().controller).set_batch_keys(this):await(await p().controller).set_key(this,_)}catch{return!1}},async sync_batch_keys(){try{return await(await p().controller).set_batch_keys(this)}catch{return!1}},async sync(){try{return await(await p().controller).set_batch_keys(this)}catch{return!1}},async fetch(){try{return!0}catch{return!1}}},persist:!0}),M=f("model_profile_ms_pix_v1",{state:()=>({profile_idx:0,model_ms_pix_basic:{},model_ms_pix_keys:{},model_ms_pix_sensor:{}}),actions:{sync_to_profile(){let _=a();const s=g(),e=w(),r=h();return _.update_profile(this.profile_idx,{model_ms_pix_basic:{version:s.version,password:s.password,work_mode:s.work_mode,connect_status:s.connect_status,battery:s.battery,profile:s.profile,max_report:s.max_report,sensor_info:s.sensor_info,max_dpi:s.max_dpi,macro_size:s.macro_size},model_ms_pix_keys:{keys:JSON.parse(JSON.stringify(e.keys)),macros:JSON.parse(JSON.stringify(e.macros)),product_name:e.product_name},model_ms_pix_sensor:{sensor_info:r.sensor_info,xy_report_rate:r.xy_report_rate,dpi_profile:r.dpi_profile,lod_altitude:r.lod_altitude,line_correct:r.line_correct,angle_tuning:r.angle_tuning,ripple_control:r.ripple_control,motion_sync:r.motion_sync,work_speed_mode:r.work_speed_mode,sleep_level:r.sleep_level,current_dpi:JSON.parse(JSON.stringify(r.current_dpi)),dpi_color:JSON.parse(JSON.stringify(r.dpi_color))}})},async sync_to_device(_){let e=a().get_profile_idx(_);if(e===null)return!1;let r=e.profile.model_ms_pix_basic,t=e.profile.model_ms_pix_keys,i=e.profile.model_ms_pix_sensor,l=g();l.load_profile(r);let o=await l.sync();if(!o)return!1;let y=w();if(y.load_profile(t),o=await y.sync(),!o)return!1;let u=h();return u.load_profile(i),o=await u.sync(),!!o},load_from_profile(_){let e=a().get_profile_idx(_);if(e===null)return!1;this.model_ms_pix_basic=e.profile.model_ms_pix_basic,this.model_ms_pix_keys=e.profile.model_ms_pix_keys,this.model_ms_pix_sensor=e.profile.model_ms_pix_sensor,this.profile_idx=_,g();let r=w();r.keys=JSON.parse(JSON.stringify(this.model_ms_pix_keys.keys)),r.macros=JSON.parse(JSON.stringify(this.model_ms_pix_keys.macros));let t=h();return t.current_dpi=JSON.parse(JSON.stringify(this.model_ms_pix_sensor.current_dpi)),t.dpi_color=JSON.parse(JSON.stringify(this.model_ms_pix_sensor.dpi_color)),t.dpi_profile=JSON.parse(JSON.stringify(this.model_ms_pix_sensor.dpi_profile)),t.dpi_profile=JSON.parse(JSON.stringify(this.model_ms_pix_sensor.dpi_profile)),t.lod_altitude=JSON.parse(JSON.stringify(this.model_ms_pix_sensor.lod_altitude)),t.xy_report_rate=JSON.parse(JSON.stringify(this.model_ms_pix_sensor.xy_report_rate)),t.sleep_level=JSON.parse(JSON.stringify(this.model_ms_pix_sensor.sleep_level)),!0},add(_){let s={};const e=g(),r=w(),t=h();return s.model_ms_pix_basic=e.default(),s.model_ms_pix_keys=r.default(),s.model_ms_pix_sensor=t.default(),a().add_profile(_,s)},get_default(){let _={};const s=g(),e=w(),r=h();return _.model_ms_pix_basic=s.default(),_.model_ms_pix_keys=e.default(),_.model_ms_pix_sensor=r.default(),_}}});class C{static setup(){let e=a().get_profile();(e===null||e.length===0)&&C.add(U.global.t("default_profile"))}static async sync_to_device(s){const e=n();if(!e.current_device)return!1;switch(e.current_device.product_name){case"MCHOSE_G98":case"MCHOSE_GX87":case"AULA_F87":case"AULA_F75":case"MCHOSE_K87":case"MCHOSE_K99":case"MCHOSE_X75":case"MCHOSE_Z75":return await x().sync_to_device(s);case"SLE_06":case"IN10_PRO":case"SLE_05":return await A().sync_to_device(s);case"EWEADN_L1_PRO":case"MCHOSE_G3_MAX":return await M().sync_to_device(s)}return!1}static async sync_to_profile(){const s=n();if(!s.current_device)return!1;switch(s.current_device.product_name){case"MCHOSE_G98":case"MCHOSE_GX87":case"AULA_F87":case"AULA_F75":case"MCHOSE_K87":case"MCHOSE_K99":case"MCHOSE_X75":case"MCHOSE_Z75":return await x().sync_to_profile();case"ARM32_HID_68":case"ARM32_HID_68_JP":case"ARM32_HID_61":case"AULA_2829":case"AULA_2829_JP":case"AULA_2836":case"AULA_2837":case"AULA_2865":case"HUAMI_PMO65":case"ARM32_HID_104":return await E().sync_to_profile();case"SLE_06":case"IN10_PRO":case"SLE_05":return await A().sync_to_profile();case"EWEADN_L1_PRO":case"MCHOSE_G3_MAX":return await M().sync_to_profile()}return!1}static load_from_profile(s){const e=n();if(!e.current_device)return!1;switch(e.current_device.product_name){case"MCHOSE_G98":case"MCHOSE_GX87":case"AULA_F87":case"AULA_F75":case"MCHOSE_K87":case"MCHOSE_K99":case"MCHOSE_X75":case"MCHOSE_Z75":return x().load_from_profile(s);case"ARM32_HID_68":case"ARM32_HID_68_JP":case"ARM32_HID_61":case"HUAMI_PMO65":case"AULA_2829":case"AULA_2829_JP":case"AULA_2836":case"AULA_2837":case"AULA_2865":case"ARM32_HID_104":return E().load_from_profile(s);case"SLE_06":case"IN10_PRO":case"SLE_05":return A().load_from_profile(s);case"EWEADN_L1_PRO":case"MCHOSE_G3_MAX":return M().load_from_profile(s)}return!1}static add(s){const e=n();if(!e.current_device)return!1;switch(e.current_device.product_name){case"MCHOSE_G98":case"MCHOSE_GX87":case"AULA_F87":case"AULA_F75":case"MCHOSE_K87":case"MCHOSE_K99":case"MCHOSE_X75":case"MCHOSE_Z75":return x().add(s);case"ARM32_HID_68":case"ARM32_HID_68_JP":case"ARM32_HID_61":case"HUAMI_PMO65":case"AULA_2829":case"AULA_2829_JP":case"AULA_2836":case"AULA_2837":case"AULA_2865":case"ARM32_HID_104":return E().add(s);case"SLE_06":case"IN10_PRO":case"SLE_05":return A().add(s);case"EWEADN_L1_PRO":case"MCHOSE_G3_MAX":return M().add(s)}return!1}}function I(){let _=n();return _.current_device?_.current_device.type_protocol==="ms_sle_v1"?A().get_default():_.current_device.type_protocol==="kb_by_v2_wired"||_.current_device.type_protocol==="kb_by_v2_wireless"?x().get_default():_.current_device.type_protocol==="ms_pix_v1"?M().get_default():_.current_device.type_protocol==="kb_by_v3_wired"?E().get_default():null:null}const a=f("model_profile",{state:()=>({profiles:[]}),actions:{reset_profile(_,s=0){for(let e=0;e<this.profiles.length;e++)if(this.profiles[e].id===_){for(let r=0;r<this.profiles[e].profiles.length;r++)if(s===r){let t=JSON.parse(JSON.stringify(I()));return t===null?!1:(this.profiles[e].profiles[r].profile=t,!0)}}return!1},get_profile(){let _=n();if(!_.current_device)return null;let s=_.current_device.id;for(let e=0;e<this.profiles.length;e++)if(this.profiles[e].id===s)return this.profiles[e].profiles;return null},get_profile_idx(_){let s=n();if(!s.current_device)return null;let e=s.current_device.id;for(let r=0;r<this.profiles.length;r++)if(this.profiles[r].id===e){if(!this.profiles[r].profiles[_])return null;try{let t=JSON.parse(JSON.stringify(this.profiles[r].profiles[_]));return t??null}catch(t){return console.error(t),null}}return null},remove_profile(_){let s=n();if(!s.current_device)return null;let e=s.current_device.id;for(let r=0;r<this.profiles.length;r++)if(this.profiles[r].id===e)return this.profiles[r].profiles.splice(_,1),!0;return!1},update_name(_,s){let e=n();if(!e.current_device)return!1;let r=e.current_device.id;for(let t=0;t<this.profiles.length;t++)if(this.profiles[t].id===r)return this.profiles[t].profiles[_].name=s,!0;return!1},update_profile(_,s){let e=n();if(!e.current_device)return!1;let r=e.current_device.id;for(let t=0;t<this.profiles.length;t++)if(this.profiles[t].id===r)return this.profiles[t].profiles[_].profile=JSON.parse(JSON.stringify(s)),!0;return!1},add_profile(_,s){let e=n();if(!e.current_device)return!1;let r=e.current_device.id;for(let t=0;t<this.profiles.length;t++)if(this.profiles[t].id===r)return this.profiles[t].profiles.push({name:_,profile:s}),!0;return this.profiles.push({id:r,profiles:[{name:_,profile:s}]}),!1},set_profile(_){let s=n();if(!s.current_device)return!1;let e=s.current_device.id;for(let r=0;r<this.profiles.length;r++)if(this.profiles[r].id===e)return this.profiles[r].profiles=_,!0;return this.profiles.push({id:e,profiles:_}),!0}},persist:!0});export{a as M,C as P,w as a,v as m};