
/* Smart UI v9.1.74 (2021-03-16) 
Copyright (c) 2011-2021 jQWidgets. 
License: https://htmlelements.com/license/ */ //

!function(e){var t={};function a(n){if(t[n])return t[n].exports;var r=t[n]={i:n,l:!1,exports:{}};return e[n].call(r.exports,r,r.exports,a),r.l=!0,r.exports}a.m=e,a.c=t,a.d=function(e,t,n){a.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},a.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},a.t=function(e,t){if(1&t&&(e=a(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(a.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var r in e)a.d(n,r,function(t){return e[t]}.bind(null,r));return n},a.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return a.d(t,"a",t),t},a.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},a.p="",a(a.s=19)}({19:function(e,t){Smart("smart-chip",class extends Smart.ContentElement{static get properties(){return{avatar:{value:null,type:"string?"},closeButton:{value:!1,type:"boolean"},itemTemplate:{value:null,type:"any?",reflectToAttribute:!1},value:{value:"",type:"string"}}}static get listeners(){return{click:"_clickHandler",keydown:"_keyDownHandler"}}static get styleUrls(){return["smart.chip.css"]}template(){return'<div id="container" role="presentation">\n                    <span id="avatar" class="smart-avatar">[[avatar]]</span>\x3c!--\n                --\x3e<span id="value" class="smart-value" inner-h-t-m-l="[[innerHTML]]"><content></content></span>\x3c!--\n                --\x3e<span id="closeButton" class="smart-close-button" role="button" aria-label="Close"></span>\n            </div>'}propertyChangedHandler(e,t,a){super.propertyChangedHandler(e,t,a);const n=this;switch(e){case"disabled":case"unfocusable":n._setFocusable();break;case"avatar":n.itemTemplate?n._setAvatar(n._customAvatar):n._setAvatar(n.$.avatar);break;case"itemTemplate":n._applyTemplate();break;case"value":n.itemTemplate?n._applyTemplate():n.$.value.innerHTML=a||""}}render(){this.value=this.value?this.value:this.innerHTML,this._applyTemplate(),this._setFocusable(),super.render()}close(){this.$.fireEvent("close",{value:this.value}),this.parentElement.removeChild(this)}_applyTemplate(){const e=this;let t=e.itemTemplate;if(!t)return e.$.value.innerHTML=e.value,void e._setAvatar(e.$.avatar);if(!("content"in document.createElement("template")))return void e.error(e.localize("htmlTemplateNotSuported",{elementType:e.nodeName.toLowerCase()}));if(t instanceof HTMLTemplateElement||(t=document.getElementById(t)),null===t||!("content"in t))return void e.error(e.localize("invalidTemplate",{elementType:e.nodeName.toLowerCase()}));let a=t.innerHTML;e.$.container.innerHTML=a.replace(/{{\s*value\s*}}/g,e.value),e._customAvatar=e.$.container.querySelector(".smart-avatar"),e._setAvatar(e._customAvatar)}_clickHandler(e){if(this.disabled)return;const t=this.enableShadowDOM?this.shadowRoot.elementFromPoint(e.pageX,e.pageY):e.target;t.closest&&t.closest(".smart-close-button")&&this.close()}_keyDownHandler(e){let t=e.key;this.disabled||this.readonly||"Delete"!==t||this.close()}_setAvatar(e){if(!e)return;const t=/\.(gif|jpg|jpeg|tiff|png)$/i.test(this.avatar);e.innerHTML=t?`<img src="${this.avatar}" aria-label="${this.value?"Avatar of "+this.value:"Avatar"}" />`:this.avatar||""}_setFocusable(){const e=this;e.disabled||e.unfocusable?e.removeAttribute("tabindex"):e.tabIndex=e.tabIndex>0?e.tabIndex:0}})}});