if Mode=="\084\111\111\108"then AssignHotkey({"\076\101\102\116\067\111\110\116\114\111\108";"\076\101\102\116\066\114\097\099\107\101\116"},Support.Call(Targeting.SelectSiblings,false,false))AssignHotkey({"\082\105\103\104\116\067\111\110\116\114\111\108","\076\101\102\116\066\114\097\099\107\101\116"},Support.Call(Targeting.SelectSiblings,false,false))AssignHotkey({"\076\101\102\116\067\111\110\116\114\111\108","\082"},Support.Call(Selection.Clear,true))AssignHotkey({"\082\105\103\104\116\067\111\110\116\114\111\108";"\082"},Support.Call(Selection.Clear,true))end function IsSelectable(a)if not a or not a.Parent or not a:IsA("\066\097\115\101\080\097\114\116")or a.Locked or IsIgnored(a)then return false end if Security.AreAreasEnabled()then return not Security.ArePartsViolatingAreas({a},Player,true,{})end return a end function IsIgnored(a) end function SetParent(a) end function ExportSelection()if#Selection.Items==0 then return end local a=(Cheer(Tool.Interfaces.ExportDialog,UI)).Start();(((((Try(SyncAPI.Invoke,SyncAPI,"\069\120\112\111\114\116",Selection.Items)):Then(function(U)a.SetResult(U)PlayConfirmationSound()print("\091\066\117\105\108\100\105\110\103 \084\111\111\108\115 \098\121 \070\051\088\093 \085\112\108\111\097\100\101\100 \069\120\112\111\114\116\058",U)end)):Catch("\072\116\116\112 \114\101\113\117\101\115\116\115 \097\114\101 \110\111\116 \101\110\097\098\108\101\100",function()a.SetError("\080\108\101\097\115\101 \101\110\097\098\108\101 \072\084\084\080 \114\101\113\117\101\115\116\115")end)):Catch("\069\120\112\111\114\116 \102\097\105\108\101\100 \100\117\101 \116\111 \115\101\114\118\101\114-\115\105\100\101 \101\114\114\111\114",function()a.SetError("\065\110 \101\114\114\111\114 \111\099\099\117\114\114\101\100\044 \116\114\121 \097\103\097\105\110")end)):Catch("\080\111\115\116 \100\097\116\097 \116\111\111 \108\097\114\103\101",function()a.SetError("\084\114\121 \115\112\108\105\116\116\105\110\103 \117\112 \121\111\117\114 \098\117\105\108\100")end)):Catch(function(U,q,y)a.SetError("\065\110 \117\110\107\110\111\119\110 \101\114\114\111\114 \111\099\099\117\114\114\101\100\044 \116\114\121 \097\103\097\105\110")warn("\226\157\140 \091\066\117\105\108\100\105\110\103 \084\111\111\108\115 \098\121 \070\051\088\093 \070\097\105\108\101\100 \116\111 \101\120\112\111\114\116 \115\101\108\101\099\116\105\111\110","\n\n\069\114\114\111\114\058\n",U,"\n\n\083\116\097\099\107\058\n",q)end)end

if Mode == 'Tool' then
	AssignHotkey({ 'LeftControl', 'LeftBracket' }, Support.Call(Targeting.SelectSiblings, false, false));
	AssignHotkey({ 'RightControl', 'LeftBracket' }, Support.Call(Targeting.SelectSiblings, false, false));
	AssignHotkey({ 'LeftControl', 'R' }, Support.Call(Selection.Clear, true));
	AssignHotkey({ 'RightControl', 'R' }, Support.Call(Selection.Clear, true));
end;

function IsSelectable(Object)
	-- Returns whether `Object` can be selected

	-- Check if `Object` exists, is not locked, and is not ignored
	if not Object or not Object.Parent or not Object:IsA 'BasePart' or Object.Locked or IsIgnored(Object) then
		return false;
	end;

	-- If areas are enabled, check if `Object` violates any areas
	if Security.AreAreasEnabled() then
		return not Security.ArePartsViolatingAreas({ Object }, Player, true, {});
	end;

	-- If no checks fail, `Object` is selectable
	return Object;

end;

function IsIgnored(Object)
	-- TODO: Add ignoring capability
end;

function SetParent(Parent)
	-- Sets the current default parent for parts

end;

function ExportSelection()
	-- Exports the selected parts

	-- Make sure that there are items in the selection
	if #Selection.Items == 0 then
		return;
	end;

	-- Start an export dialog
	local Dialog = Cheer(Tool.Interfaces.ExportDialog, UI).Start();

	-- Send the exporting request to the server
	Try(SyncAPI.Invoke, SyncAPI, 'Export', Selection.Items)

	-- Display creation ID on success
	:Then(function (CreationId)
		Dialog.SetResult(CreationId);
		PlayConfirmationSound();
		print('[Building Tools by F3X] Uploaded Export:', CreationId);
	end)

	-- Display error messages on failure
	:Catch('Http requests are not enabled', function ()
		Dialog.SetError('Please enable HTTP requests');
	end)
	:Catch('Export failed due to server-side error', function ()
		Dialog.SetError('An error occurred, try again');
	end)
	:Catch('Post data too large', function ()
		Dialog.SetError('Try splitting up your build');
	end)
	:Catch(function (Error, Stack, Attempt)
		Dialog.SetError('An unknown error occurred, try again')
		warn('❌ [Building Tools by F3X] Failed to export selection', '\n\nError:\n', Error, '\n\nStack:\n', Stack);
	end);

end;
