 DifferentStackResourcesStore      = ['DifferentStackResourcesStore']
 ActiveStackStore                  = ['ActiveStackStore']
 TeamStackTemplatesStore           = ['TeamStackTemplatesStore']
+PrivateStackTemplatesStore        = ['PrivateStackTemplatesStore']
 
 
 workspacesWithChannels = [

  activeLeavingSharedMachineId: ActiveLeavingSharedMachineIdStore
  differentStackResourcesStore : DifferentStackResourcesStore
  teamStackTemplates
  inUseTeamStackTemplates
}

        .set 'isDefault', template.get('_id') in (getGroup().stackTemplates or [])
]

privateStackTemplates = [
  PrivateStackTemplatesStore
  stacks
  (templates, _stacks) ->
    baseStackIds = _stacks.toList().toArray().map (s) -> s.get 'baseStackId'
    templates.map (template) ->
      template
        .set 'inUse', template.get('_id') in baseStackIds
        .set 'isDefault', template.get('_id') in (getGroup().stackTemplates or [])
]

inUseTeamStackTemplates = [
  teamStackTemplates
  (templates) -> templates.filter (t) -> t.get('inUse')
]

inUsePrivateStackTemplates = [
  privateStackTemplates
  (templates) -> templates.filter (t) -> t.get('inUse')
]

