define(["require","exports","./Errors"],function(e,r,n){"use strict";var i;function l(e,r){throw new n.ActivityInputError(e,r)}Object.defineProperty(r,"__esModule",{value:!0}),(i=r.validation||(r.validation={})).never={},i.fail=l,i.array=function(e,r,n){return null==r?(n===i.never&&l(e,"array"),2<arguments.length?n:void 0):r instanceof Array?r:[r]},i.exists=function(e,r,n){return null!=r?r:2<arguments.length?n:void l(e,"exists")},i.id=function(e,r,n){return null==r?(n===i.never&&l(e,"id"),2<arguments.length?n:void 0):"string"==typeof r||"number"==typeof r&&0*r==0?r:2<arguments.length?(n===i.never&&l(e,"id"),n):void l(e,"number")},i.number=function(e,r,n){if(null==r)return n===i.never&&l(e,"number"),2<arguments.length?n:void 0;var t=r.valueOf();if("number"==typeof t)return t;if("boolean"==typeof t)return t?1:0;if("string"==typeof t){r=parseFloat(r);if(!isNaN(r))return r}if(2<arguments.length)return n===i.never&&l(e,"number"),n;l(e,"number")},i.choice=function(e,r,n){if(null!=n){n=r[n.toString()];if(null==n)return n;l(e,"choice")}},i.boolean=function(e,r,n){return null==r?(n===i.never&&l(e,"boolean"),2<arguments.length?n:void 0):"boolean"==typeof r?r:2<arguments.length?(n===i.never&&l(e,"boolean"),n):void l(e,"boolean")},i.string=function(e,r,n){return null==r?(n===i.never&&l(e,"string"),2<arguments.length?n:void 0):"string"==typeof r?r:2<arguments.length?(n===i.never&&l(e,"string"),n):void l(e,"string")},i.urlOrLayer=function(e,r){if(null!=e){var n=e.url,e=e.layer;if(n=!n&&e&&e.url?!r&&void 0!==e.layerId&&null!==e.layerId?e.url+"/"+e.layerId:e.url:n)return n}l("url or layer","url or layer input is required. layer must have a valid url property.")}});