MWSDeviceHeadsetDefaultAppsTabTable.react",["fbt","GeoTable.react","GeoTableColumnAlignments","GeoTableWidth","GeoToast.react","MWSDeviceHeadsetDefaultAppsTabTable_apps.graphql","MWSDevicePresetCreationAppMASV1Utils","MWSDevicePresetManageDefaultAppConfigMutation","MWSDevicePresetsAppsTabEnum","MWSDevicesAppIconAddOn.react","MWSDevicesConfigurationMethodContext","MWSDevicesHeadsetAssetAssignedPresetCell.react","MWSDevicesPresetDetailsAppsConstants","MWSTableMainCell.react","MWSTableSwitchCell.react","Q4BAppManagementAdminCenterFalcoLogger","RelayHooks","createGeoTableDataSource","nullthrows","react","useGeoTableSortable","useGeoTableSortableState","useGeoToaster"],(function(a,b,c,d,e,f,g,h){"use strict";var i,j,k=j||(j=d("react"));e=j;var l=e.useContext,m=e.useMemo;function a(a){var b,e=a.appsFragment,f=a.itapCompanyID,g=d("RelayHooks").useFragment(n,e),i=r(g);a=l(d("MWSDevicesConfigurationMethodContext").MWSDevicesConfigurationMethodContext);e=a===d("MWSDevicesConfigurationMethodContext").MWSDeviceConfigurationMethod.INDIVIDUAL;a=c("useGeoTableSortableState")({direction:"ascending",sortKey:"name"});var j=a[0];a=a[1];a=c("useGeoTableSortable")({allowUnsortedState:!1,setSort:a,sort:j});var p=m(function(){var a=function(a){return a.toSorted(function(a,b){return(j==null?void 0:j.direction)==="ascending"?a.asset.app_name.localeCompare(b.asset.app_name):b.asset.app_name.localeCompare(a.asset.app_name)})};switch(j==null?void 0:j.sortKey){case"name":return a(i)}return i},[j,i]),q=m(function(){return c("createGeoTableDataSource")(p,{getStableUniqueID:function(a){var b;return a.asset.id+"_"+((b=(b=a.assignment)==null?void 0:b.preset.id)!=null?b:"#")+"_"+((a=(b=a.assignment)==null?void 0:b.entity.id)!=null?a:"#")}})},[p]),s=d("RelayHooks").useMutation(d("MWSDevicePresetManageDefaultAppConfigMutation").MUTATION),t=s[0];s=s[1];var u=c("useGeoToaster")(),v=u.add,w=c("nullthrows")(g==null||(b=g.management_info)==null?void 0:b.device_config);u=function(a,b,e){var h;t({onCompleted:function(){var h;v(k.jsx(c("GeoToast.react"),{heading:d("MWSDevicesPresetDetailsAppsConstants").getMWSDevicePresetAppsRemovedToastHeading(d("MWSDevicePresetsAppsTabEnum").MWSDevicePresetsAppsTabEnum.DEFAULT,"DeviceDetail",e,(h=g==null?void 0:g.serial)!=null?h:"",b)}));h=b?"APP_DEVICE_DEFAULT_APP_SET_TO_SHOWN":"APP_DEVICE_DEFAULT_APP_SET_TO_HIDDEN";d("Q4BAppManagementAdminCenterFalcoLogger").Q4BAppManagementAdminCenterFalcoLogger(h,{app_ids:[a],event_origin:"DEVICE_DETAIL",itap_company_id:f})},updater:function(c){var d=w.id;if(!d)return;c=c.get(d);if(!c)return;d=c.getLinkedRecords("default_apps_info");d&&d.forEach(function(c){c&&c.getValue("id")===a&&c.setValue(b,"shown")})},variables:{input:{device_config_id:(h=w.id)!=null?h:"",managed_default_app_to_is_shown:{id:a,is_shown:b}}}})};e=o(e,s,u);return k.jsx(c("GeoTable.react"),{columns:e,"data-testid":void 0,dataSource:q,label:h._(/*BTDS*/"Default apps"),plugins:{sortable:a}})}a.displayName=a.name+" [from "+f.id+"]";var n=i!==void 0?i:i=b("MWSDeviceHeadsetDefaultAppsTabTable_apps.graphql");function o(a,b,e){var f={alignHorizontal:d("GeoTableColumnAlignments").HorizontalAlignment.End,cell:function(d){var f=d.item.asset;return k.jsx(c("MWSTableSwitchCell.react"),{isDisabled:!a||b,label:"Change default app visiblity",onChange:function(a){e(f.id,a,f.app_name)},value:f.shown})},header:h._(/*BTDS*/"Hide/show"),key:"visibility",width:d("GeoTableWidth").proportional(1)};return[q,p,f]}var p={cell:function(a){a=a.item.assignment;return k.jsx(c("MWSDevicesHeadsetAssetAssignedPresetCell.react"),{assignment:a})},header:h._(/*BTDS*/"Assignment"),key:"configuredBy",width:d("GeoTableWidth").proportional(1)},q={cell:function(a){a=a.item.asset;return k.jsx(c("MWSTableMainCell.react"),{addOn:k.jsx(c("MWSDevicesAppIconAddOn.react"),{appIconUri:a.app_icon_image}),primary:a.app_name,primaryDisplay:"truncate",secondary:d("MWSDevicePresetCreationAppMASV1Utils").getDefaultAppDescription(a.id,a.requires_identity)})},header:h._(/*BTDS*/"Apps"),key:"name",sortable:[{sortKey:"name"}],width:d("GeoTableWidth").proportional(1.5)};function r(a){var b,c;b=(b=a==null?void 0:a.sorted_preset_assignments)!=null?b:[];var d=null;a=(a=a==null||(c=a.management_info)==null||(c=c.device_config)==null?void 0:c.default_apps_info)!=null?a:[];if(b.length>0){var e=b.filter(function(a){a=a.preset;return a.defined_fields.includes("DEVICE_MANAGED_DEFAULT_APPS")});e.length===0&&(e=Array.from(b));b=e[0];e=b.entity;b=b.preset;d={entity:{device_group_name:e.device_group_name,id:e.id,people_group_name:e.people_group_name},preset:{id:(e=b==null?void 0:b.id)!=null?e:"",mode:((e=b.device_config.kiosk_config)==null?void 0:e.is_enabled)===!0?"shared":"individual",name:b==null?void 0:b.name}}}return a.map(function(a){var b;return{asset:{app_icon_image:(b=(b=a.app_icon_image)==null?void 0:b.uri)!=null?b:"",app_name:(b=a.app_name)!=null?b:"",id:(b=a.id)!=null?b:"",requires_identity:(b=a.requires_identity)!=null?b:!1,shown:(b=a.shown)!=null?b:!1},assignment:d}})}g["default"]=a}),226);
-----
MWSDevicePresetManageDefaultAppConfigMutation",["MWSDevicePresetManageDefaultAppConfigMutation.graphql"],(function(a,b,c,d,e,f,g){"use strict";var h;a=h!==void 0?h:h=b("MWSDevicePresetManageDefaultAppConfigMutation.graphql");g.MUTATION=a}),98);
-----
MWSDevicePresetManageDefaultAppConfigMutation.graphql",["MWSDevicePresetManageDefaultAppConfigMutation_facebookRelayOperation"],(function(a,b,c,d,e,f){"use strict";a=function(){var a=[{defaultValue:null,kind:"LocalArgument",name:"input"}],c=[{kind:"Variable",name:"data",variableName:"input"}],d={alias:null,args:null,kind:"ScalarField",name:"id",storageKey:null};return{fragment:{argumentDefinitions:a,kind:"Fragment",metadata:null,name:"MWSDevicePresetManageDefaultAppConfigMutation",selections:[{alias:null,args:c,concreteType:"OculusDeviceManagedDefaultAppMutationResponse",kind:"LinkedField",name:"update_oculus_device_managed_default_app",plural:!1,selections:[{alias:null,args:null,concreteType:"HWMOculusDeviceConfig",kind:"LinkedField",name:"device_config",plural:!1,selections:[{args:null,kind:"FragmentSpread",name:"MWSDevicePresetDefaultAppsTabTableFragment"}],storageKey:null}],storageKey:null}],type:"Mutation",abstractKey:null},kind:"Request",operation:{argumentDefinitions:a,kind:"Operation",name:"MWSDevicePresetManageDefaultAppConfigMutation",selections:[{alias:null,args:c,concreteType:"OculusDeviceManagedDefaultAppMutationResponse",kind:"LinkedField",name:"update_oculus_device_managed_default_app",plural:!1,selections:[{alias:null,args:null,concreteType:"HWMOculusDeviceConfig",kind:"LinkedField",name:"device_config",plural:!1,selections:[d,{alias:null,args:null,concreteType:"XFBManagedDefaultAppsInfo",kind:"LinkedField",name:"default_apps_info",plural:!0,selections:[{alias:null,args:null,kind:"ScalarField",name:"shown",storageKey:null},d,{alias:null,args:null,kind:"ScalarField",name:"app_name",storageKey:null},{alias:null,args:null,concreteType:"Image",kind:"LinkedField",name:"app_icon_image",plural:!1,selections:[{alias:null,args:null,kind:"ScalarField",name:"uri",storageKey:null}],storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"requires_identity",storageKey:null}],storageKey:null}],storageKey:null}],storageKey:null}]},params:{id:b("MWSDevicePresetManageDefaultAppConfigMutation_facebookRelayOperation"),metadata:{},name:"MWSDevicePresetManageDefaultAppConfigMutation",operationKind:"mutation",text:null}}}();e.exports=a}),null);
-----
MWSDevicePresetManageDefaultAppConfigMutation_facebookRelayOperation",[],(function(a,b,c,d,e,f){e.exports="24164706389818011"}),null);
-----