           disabled = null
           if convsettings.selectedEntities.length <= 0 then disabled = disabled: 'disabled'
           button disabled, "Save", onclick:-> action 'saveconversation'
-
-


      ul ->
          convsettings.selectedEntities.forEach (r) ->
              li class: 'selected', ->
                  if r.properties.photo_url
                      img src: photoUrlProtocolFix r.properties.photo_url
                  else
                      img src: "images/photo.jpg"
                  p r.properties.display_name
              , onclick:(e) -> if not editing then action 'deselectentity', r 

          selected_ids = (unique(c) for c in convsettings.selectedEntities)

          convsettings.searchedEntities.forEach (r) ->
              if unique(r) in selected_ids then return
              li ->
                  if r.properties.photo_url
                      img src: r.properties.photo_url
                  else
                      img src: "images/photo.jpg"
                  p r.properties.display_name
              , onclick:(e) -> action 'selectentity', r



{throttle, nameof} = require '../util'
chilledaction = throttle 1500, action

unique = (obj) -> obj.id.chat_id or obj.id.gaia_id

photoUrlProtocolFix = (url) -> return "http:" + url if url?.indexOf('//') == 0

inputSetValue = (sel, val) ->
    setTimeout ->
