<div ng-if="visible">
  <div ng-if="param.info" class="text-muted m-b-8">
    <i c8y-icon="info-circle" class="pull-left text-info"></i>
    <p class="m-l-8"><em ng-bind-html="param.info | translate"></em></p>
  </div>

  <div ng-switch="param.type" ng-init="initialValue = currentValueOrTranslatedDefault(rule, param)">
    <div
      ng-switch-when="alarmSeverity"
      ng-init="rule.config[param.property] = currentValueOrDefault(rule, param)"
    >
      <smart-rule-param-input-alarm-severity
        rule="rule"
        param="param"
      ></smart-rule-param-input-alarm-severity>
    </div>
    <div
      ng-switch-when="alarmType"
      ng-init="rule.config[param.property] = currentValueOrDefault(rule, param)"
    >
      <smart-rule-param-input-alarm-type
        rule="rule"
        param="param"
      ></smart-rule-param-input-alarm-type>
    </div>
    <div
      ng-switch-when="alarmTypeMultiple"
      ng-init="rule.config[param.property] = currentValueOrDefault(rule, param)"
    >
      <smart-rule-param-input-alarm-type
        rule="rule"
        param="param"
        multiple="true"
      ></smart-rule-param-input-alarm-type>
    </div>
    <div ng-switch-when="textarea" ng-init="rule.config[param.property] = initialValue">
      <smart-rule-param-input-textarea rule="rule" param="param"></smart-rule-param-input-textarea>
    </div>
    <div ng-switch-when="email" ng-init="rule.config[param.property] = initialValue">
      <smart-rule-param-input-email rule="rule" param="param"></smart-rule-param-input-email>
    </div>
    <div ng-switch-when="phoneNumber" ng-init="rule.config[param.property] = initialValue">
      <smart-rule-param-input-phone-number
        rule="rule"
        param="param"
      ></smart-rule-param-input-phone-number>
    </div>
    <div ng-switch-when="escalationSteps" ng-init="rule.config[param.property] = initialValue">
      <smart-rule-param-input-escalation-steps
        rule="rule"
        param="param"
        rule-template="ruleTemplate"
      ></smart-rule-param-input-escalation-steps>
    </div>
    <div ng-switch-when="geofence" ng-init="rule.config[param.property] = initialValue">
      <smart-rule-param-input-geofence rule="rule" param="param"></smart-rule-param-input-geofence>
    </div>
    <div ng-switch-when="kpi" ng-init="rule.config[param.property] = initialValue">
      <smart-rule-param-input-kpi rule="rule" param="param" rule-template="ruleTemplate"> </smart-rule-param-input-kpi>
    </div>
    <div ng-switch-when="operation" ng-init="rule.config[param.property] = initialValue">
      <smart-rule-param-input-operation
        rule="rule"
        param="param"
      ></smart-rule-param-input-operation>
    </div>
    <div ng-switch-when="select" ng-init="rule.config[param.property] = initialValue">
      <smart-rule-param-input-select rule="rule" param="param"></smart-rule-param-input-select>
    </div>
    <div ng-switch-when="timeInterval" ng-init="rule.config[param.property] = initialValue">
      <smart-rule-param-input-time-interval
        rule="rule"
        param="param"
      ></smart-rule-param-input-time-interval>
    </div>
    <div ng-switch-when="checkbox" ng-init="rule.config[param.property] = initialValue">
      <smart-rule-param-input-checkbox rule="rule" param="param"></smart-rule-param-input-checkbox>
    </div>
    <div ng-switch-when="number" ng-init="rule.config[param.property] = initialValue">
      <smart-rule-param-input-number
        rule="rule"
        param="param"
        min="param.minNumber"
        max="param.maxNumber"
      ></smart-rule-param-input-number>
    </div>
    <div ng-switch-when="frequency" ng-init="rule.config[param.property] = initialValue">
      <smart-rule-param-frequency rule="rule" param="param"></smart-rule-param-frequency>
    </div>
    <div ng-switch-when="dashboard" ng-init="rule.config[param.property] = initialValue">
      <smart-rule-param-input-dashboard
        rule="rule"
        param="param"
      ></smart-rule-param-input-dashboard>
    </div>
    <div ng-switch-when="exportConfiguration" ng-init="rule.config[param.property] = initialValue">
      <smart-rule-param-input-export-configuration
        rule="rule"
        param="param"
      ></smart-rule-param-input-export-configuration>
    </div>
    <div ng-switch-default ng-init="rule.config[param.property] = initialValue">
      <smart-rule-param-input-default rule="rule" param="param"></smart-rule-param-input-default>
    </div>
    <div ng-if="param.warnMaxLength">
      <smart-rule-param-warn-max-length
        rule="rule"
        param="param"
      ></smart-rule-param-warn-max-length>
    </div>
  </div>
</div>
