$.widget("ui.containers-property",$.ui.SceneResourceProperty,{options:{category:"container"},_createSourceProperty:function(){this._super();var e=this,i=this.$sourceProperty;i.append("<div>"+i18n("background")+"</div><div class = 'fill'><div class = 'select-image'></div>"+i18n("or")+"<input class = 'select-color ui-widget-content ui-corner-all'/></div><div>"+i18n("background_repeat")+"</div><div class = 'background-repeat'></div>");i.find(".select-image").selectButton({allowEmpty:!0,callback:this.selectImageDialog.bind(this),emptyText:i18n("select_image"),select:function(i){if(e.fill()!==i){e.onchange("fill",{fill:i});i&&$.utils.getFileSize(i,function(i){e.onchange("size",{size:i})})}}});i.find(".select-color").minicolors({change:function(i){var t=e.fill();e.fill()!==i&&(!i&&$.utils.isColor(t)||$.utils.isColor(i))&&e.onchange("fill",{fill:i||""})}});i.find(".background-repeat").select({options:[{value:"no-repeat",label:i18n("no_repeat")},{value:"repeat",label:i18n("repeat")},{value:"repeat-x",label:i18n("repeat_x")},{value:"repeat-y",label:i18n("repeat_y")}],select:function(i){e.onchange("repeat",{repeat:i})}})},value:function(e){if(e){this._super(e);this.fill(e.fill||"");this.repeat(e.repeat||"no-repeat")}},fill:function(e){var i=this.element.find(".fill");if(void 0===e)return i.data("fill");"string"!=typeof e&&(e="");i.data("fill",e);if($.utils.isColor(e)){i.find(".select-color").minicolors("value",e);i.find(".select-image").selectButton("value","")}else{i.find(".select-color").minicolors("value","");i.find(".select-image").selectButton("value",e);e&&i.find(".select-image .ui-button-text").text(e.split("/").pop())}},repeat:function(e){var i=this.element.find(".background-repeat");if(void 0===e)return i.data("repeat");i.data("repeat",e).select("value",e);return void 0},selectImageDialog:function(e){$.utils.selectImage({fileType:"image",multiple:!1,callback:function(i){e&&e(i);return!0}})}});