(function(){"use strict";var e=u8.Mobile.Widgets.MobileWidget;function t(e,t){this.MobileWidget(e,t);this._$select=$(e).find("select")}t.prototype={setValue:function(e){this._$select.val(e||"");if((this._$select.val()===""||this._$select.val()===null)&&e!=null&&e.length>0&&this._$select.length>0){for(var t=0;t<this._$select[0].children.length;t++){if(this._$select[0].children[t].text===e){this._$select.val(this._$select[0].children[t].value||"");break}}}},getValue:function(){return this._$select.val()},on:function(e,t){var n=this;var i=function(e){t(e,n)};$(this.element).on(e,i)},off:function(e,t){$(this.element).off(e,t)},"Parent.create":function(){var e=this.parent;var t=this.element.getAttribute("data-itemssource"),n=this.element.getAttribute("data-dependson"),i=e.getField(n);if(i){var l=this._$select;i.on("change",function(e,n){var i=n.getValue();u8.rest(t+"&parentValue="+encodeURIComponent(i)).then(function(e){l.html(e)})})}},_getInputElement:function(){return this.$element.find("select")}};t.makeClass({name:"CatalogField",deriveFrom:e})})();