function showConfirmation(text, { ok, cancel, input = false } = {}) {
  return new Promise(resolve => {
    const hasInput = input !== false;
    const onCancel = () => resolve(hasInput ? null : false);
    const onOk = val => resolve(!hasInput || val);
    showMessage({
      input,
      text,
      buttons: [
        ok !== false && { text: i18n('buttonOK'), onClick: onOk, ...ok },
        cancel !== false && { text: i18n('buttonCancel'), onClick: onCancel, ...cancel },
      ].filter(Boolean),
      onBackdropClick: onCancel,
      onDismiss: onCancel, // Esc key
    });
  });
}
@param {string} text - the text to display in the modal
@param {Object} cfg
@param {string | false} [cfg.input=false] if not false, shows a text input with this string
@param {?Object|false} [cfg.ok] additional props for the Ok button or `false` to remove it
@param {?Object|false} [cfg.cancel] same for the Cancel button
@return {Promise<?string|boolean>}
  `input` is false: <boolean> i.e. true on Ok, false otherwise;
  `input` is string: <?string> i.e. string on Ok, null otherwise;