{"version":3,"sources":["jsdelivr-header.js","/npm/@polymer/iron-validatable-behavior@3.0.1/iron-validatable-behavior.js"],"names":[],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;MCIO,4CAEC,aAAe,yCAKhB,IAAI,4BAA8B,YA6BlC,MAAM,wBAA0B,CAErC,WAAY,CAIV,UAAW,CAAC,KAAM,QAKlB,QAAS,CACP,QAAQ,EACR,oBAAoB,EACpB,KAAM,QACN,OAAO,EACP,SAAU,oBAId,WAAY,WACV,4BAA8B,IAAI,SAAS,CAAC,KAAM,aACpD,EAEA,gBAAiB,WACX,KAAK,QACP,KAAK,aAAa,eAAgB,QAElC,KAAK,gBAAgB,eAEzB,EAIA,cAAI,GACF,OAAO,6BACH,4BAA4B,MAAM,KAAK,UAC7C,EAKA,aAAc,WACZ,OAA0B,MAAnB,KAAK,UACd,EAcA,SAAU,SAAS,GAOjB,YAJc,IAAV,QAAsC,IAAf,KAAK,MAC9B,KAAK,SAAW,KAAK,aAAa,KAAK,OAEvC,KAAK,SAAW,KAAK,aAAa,IAC5B,KAAK,OACf,EAYA,aAAc,SAAS,GACrB,OAAI,KAAK,gBACA,KAAK,WAAW,SAAS,EAGpC","file":"/npm/@polymer/iron-validatable-behavior@3.0.1/iron-validatable-behavior.js","sourceRoot":"","sourcesContent":["/**\n * Minified by jsDelivr using Terser v5.37.0.\n * Original file: /npm/@polymer/iron-validatable-behavior@3.0.1/iron-validatable-behavior.js\n *\n * Do NOT use SRI with dynamically generated files! More information: https://www.jsdelivr.com/using-sri-with-dynamic-files\n */\n","/**\n@license\nCopyright (c) 2015 The Polymer Project Authors. All rights reserved.\nThis code may only be used under the BSD style license found at\nhttp://polymer.github.io/LICENSE.txt The complete set of authors may be found at\nhttp://polymer.github.io/AUTHORS.txt The complete set of contributors may be\nfound at http://polymer.github.io/CONTRIBUTORS.txt Code distributed by Google as\npart of the polymer project is also subject to an additional IP rights grant\nfound at http://polymer.github.io/PATENTS.txt\n*/\nimport '@polymer/polymer/polymer-legacy.js';\n\nimport {IronMeta} from '@polymer/iron-meta/iron-meta.js';\n\n/**\n * Singleton IronMeta instance.\n */\nexport let IronValidatableBehaviorMeta = null;\n\n/**\n * `Use IronValidatableBehavior` to implement an element that validates\n * user input. Use the related `IronValidatorBehavior` to add custom\n * validation logic to an iron-input.\n *\n * By default, an `<iron-form>` element validates its fields when the user\n * presses the submit button. To validate a form imperatively, call the form's\n * `validate()` method, which in turn will call `validate()` on all its\n * children. By using `IronValidatableBehavior`, your custom element\n * will get a public `validate()`, which will return the validity of the\n * element, and a corresponding `invalid` attribute, which can be used for\n * styling.\n *\n * To implement the custom validation logic of your element, you must override\n * the protected `_getValidity()` method of this behaviour, rather than\n * `validate()`. See\n * [this](https://github.com/PolymerElements/iron-form/blob/master/demo/simple-element.html)\n * for an example.\n *\n * ### Accessibility\n *\n * Changing the `invalid` property, either manually or by calling `validate()`\n * will update the `aria-invalid` attribute.\n *\n * @demo demo/index.html\n * @polymerBehavior\n */\nexport const IronValidatableBehavior = {\n\n  properties: {\n    /**\n     * Name of the validator to use.\n     */\n    validator: {type: String},\n\n    /**\n     * True if the last call to `validate` is invalid.\n     */\n    invalid: {\n      notify: true,\n      reflectToAttribute: true,\n      type: Boolean,\n      value: false,\n      observer: '_invalidChanged'\n    },\n  },\n\n  registered: function() {\n    IronValidatableBehaviorMeta = new IronMeta({type: 'validator'});\n  },\n\n  _invalidChanged: function() {\n    if (this.invalid) {\n      this.setAttribute('aria-invalid', 'true');\n    } else {\n      this.removeAttribute('aria-invalid');\n    }\n  },\n\n  /* Recompute this every time it's needed, because we don't know if the\n   * underlying IronValidatableBehaviorMeta has changed. */\n  get _validator() {\n    return IronValidatableBehaviorMeta &&\n        IronValidatableBehaviorMeta.byKey(this.validator);\n  },\n\n  /**\n   * @return {boolean} True if the validator `validator` exists.\n   */\n  hasValidator: function() {\n    return this._validator != null;\n  },\n\n  /**\n   * Returns true if the `value` is valid, and updates `invalid`. If you want\n   * your element to have custom validation logic, do not override this method;\n   * override `_getValidity(value)` instead.\n\n   * @param {Object} value Deprecated: The value to be validated. By default,\n   * it is passed to the validator's `validate()` function, if a validator is\n   set.\n   * If this argument is not specified, then the element's `value` property\n   * is used, if it exists.\n   * @return {boolean} True if `value` is valid.\n   */\n  validate: function(value) {\n    // If this is an element that also has a value property, and there was\n    // no explicit value argument passed, use the element's property instead.\n    if (value === undefined && this.value !== undefined)\n      this.invalid = !this._getValidity(this.value);\n    else\n      this.invalid = !this._getValidity(value);\n    return !this.invalid;\n  },\n\n  /**\n   * Returns true if `value` is valid.  By default, it is passed\n   * to the validator's `validate()` function, if a validator is set. You\n   * should override this method if you want to implement custom validity\n   * logic for your element.\n   *\n   * @param {Object} value The value to be validated.\n   * @return {boolean} True if `value` is valid.\n   */\n\n  _getValidity: function(value) {\n    if (this.hasValidator()) {\n      return this._validator.validate(value);\n    }\n    return true;\n  }\n};\n"]}