!function(e){var t={};function n(s){if(t[s])return t[s].exports;var i=t[s]={i:s,l:!1,exports:{}};return e[s].call(i.exports,i,i.exports,n),i.l=!0,i.exports}n.m=e,n.c=t,n.d=function(e,t,s){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:s})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var s=Object.create(null);if(n.r(s),Object.defineProperty(s,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var i in e)n.d(s,i,function(t){return e[t]}.bind(null,i));return s},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=10)}([,,,,,,,,,,function(e,t,n){"use strict";n.r(t);n(11),n(12),n(13),n(14),n(15),n(16),n(17)},function(e,n){!function(e){e.SystemTags={getDescriptiveTag:function(e){if(_.isUndefined(e.name)&&!_.isUndefined(e.toJSON)&&(e=e.toJSON()),_.isUndefined(e.name))return $("").addClass("non-existing-tag").text(t("core","Non-existing tag #{tag}",{tag:e}));var n,s=$("");if(s.append(escapeHTML(e.name)),e.userAssignable||(n=t("core","restricted")),e.userVisible||(n=t("core","invisible")),n){var i=$("").text(" "+t("core","({scope})",{scope:n}));s.append(i)}return s}}}(OC)},function(e,t){function n(e){return(n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}var s,i;s=Handlebars.template,(i=OC.SystemTags.Templates=OC.SystemTags.Templates||{}).result=s({1:function(e,t,n,s,i){return" new-item"},3:function(e,t,n,s,i){var a,o;return'\t\t'+(null!=(a="function"==typeof(o=null!=(o=n.tagMarkup||(null!=t?t.tagMarkup:t))?o:n.helperMissing)?o.call(null!=t?t:e.nullContext||{},{name:"tagMarkup",hash:{},data:i}):o)?a:"")+"\n"},5:function(e,t,n,s,i){var a;return'\t\t'+e.escapeExpression("function"==typeof(a=null!=(a=n.name||(null!=t?t.name:t))?a:n.helperMissing)?a.call(null!=t?t:e.nullContext||{},{name:"name",hash:{},data:i}):a)+"\n"},7:function(e,t,n,s,i){var a;return'\t\t\n\t\t\t\n\t\t\n'},compiler:[7,">= 4.0.0"],main:function(e,t,s,i,a){var o,l,r,c=null!=t?t:e.nullContext||{},u=s.helperMissing,d='\n\n'+(null!=(o=s.if.call(c,null!=t?t.isAdmin:t,{name:"if",hash:{},fn:e.program(3,a,0),inverse:e.program(5,a,0),data:a}))?o:"");return l=null!=(l=s.allowActions||(null!=t?t.allowActions:t))?l:u,r={name:"allowActions",hash:{},fn:e.program(7,a,0),inverse:e.noop,data:a},o="function"===n(l)?l.call(c,r):l,s.allowActions||(o=s.blockHelperMissing.call(t,o,r)),null!=o&&(d+=o),d+"\n"},useData:!0}),i.result_form=s({1:function(e,t,n,s,i){var a;return'\t\t\n'},compiler:[7,">= 4.0.0"],main:function(e,t,s,i,a){var o,l,r=null!=t?t:e.nullContext||{},c=s.helperMissing,u=e.escapeExpression;return'
\n\t \n\t\n'+(null!=(o=s.if.call(r,null!=t?t.isAdmin:t,{name:"if",hash:{},fn:e.program(1,a,0),inverse:e.noop,data:a}))?o:"")+"
\n"},useData:!0}),i.selection=s({1:function(e,t,n,s,i){var a,o;return'\t'+(null!=(a="function"==typeof(o=null!=(o=n.tagMarkup||(null!=t?t.tagMarkup:t))?o:n.helperMissing)?o.call(null!=t?t:e.nullContext||{},{name:"tagMarkup",hash:{},data:i}):o)?a:"")+"\n"},3:function(e,t,n,s,i){var a;return'\t'+e.escapeExpression("function"==typeof(a=null!=(a=n.name||(null!=t?t.name:t))?a:n.helperMissing)?a.call(null!=t?t:e.nullContext||{},{name:"name",hash:{},data:i}):a)+"\n"},compiler:[7,">= 4.0.0"],main:function(e,t,n,s,i){var a;return null!=(a=n.if.call(null!=t?t:e.nullContext||{},null!=t?t.isAdmin:t,{name:"if",hash:{},fn:e.program(1,i,0),inverse:e.program(3,i,0),data:i}))?a:""},useData:!0})},function(e,t){!function(e){_.extend(e.Files.Client,{PROPERTY_FILEID:"{"+e.Files.Client.NS_OWNCLOUD+"}id",PROPERTY_CAN_ASSIGN:"{"+e.Files.Client.NS_OWNCLOUD+"}can-assign",PROPERTY_DISPLAYNAME:"{"+e.Files.Client.NS_OWNCLOUD+"}display-name",PROPERTY_USERVISIBLE:"{"+e.Files.Client.NS_OWNCLOUD+"}user-visible",PROPERTY_USERASSIGNABLE:"{"+e.Files.Client.NS_OWNCLOUD+"}user-assignable"});var t=e.Backbone.Model.extend({sync:e.Backbone.davSync,defaults:{userVisible:!0,userAssignable:!0,canAssign:!0},davProperties:{id:e.Files.Client.PROPERTY_FILEID,name:e.Files.Client.PROPERTY_DISPLAYNAME,userVisible:e.Files.Client.PROPERTY_USERVISIBLE,userAssignable:e.Files.Client.PROPERTY_USERASSIGNABLE,canAssign:e.Files.Client.PROPERTY_CAN_ASSIGN},parse:function(e){return{id:e.id,name:e.name,userVisible:!0===e.userVisible||"true"===e.userVisible,userAssignable:!0===e.userAssignable||"true"===e.userAssignable,canAssign:!0===e.canAssign||"true"===e.canAssign}}});e.SystemTags=e.SystemTags||{},e.SystemTags.SystemTagModel=t}(OC)},function(e,t){!function(e){var t=e.Backbone.Collection.extend({sync:e.Backbone.davSync,usePUT:!0,_objectId:null,_objectType:"files",model:e.SystemTags.SystemTagModel,url:function(){return e.linkToRemote("dav")+"/systemtags-relations/"+this._objectType+"/"+this._objectId},setObjectId:function(e){this._objectId=e},setObjectType:function(e){this._objectType=e},initialize:function(e,t){t=t||{},_.isUndefined(t.objectId)||(this._objectId=t.objectId),_.isUndefined(t.objectType)||(this._objectType=t.objectType)},getTagIds:function(){return this.map(function(e){return e.id})}});e.SystemTags=e.SystemTags||{},e.SystemTags.SystemTagsMappingCollection=t}(OC)},function(e,t){!function(e){var t=e.Backbone.Collection.extend({sync:e.Backbone.davSync,model:e.SystemTags.SystemTagModel,url:function(){return e.linkToRemote("dav")+"/systemtags/"},filterByName:function(e){return this.filter(function(t){return function(e,t){return e.get("name").substr(0,t.length).toLowerCase()===t.toLowerCase()}(t,e)})},reset:function(){return this.fetched=!1,e.Backbone.Collection.prototype.reset.apply(this,arguments)},fetch:function(t){var n=this;if(t=t||{},this.fetched||t.force)return t.success&&t.success(this,null,t),this.trigger("sync",this,null,t),Promise.resolve();var s=t.success;return(t=_.extend({},t)).success=function(){if(n.fetched=!0,s)return s.apply(this,arguments)},e.Backbone.Collection.prototype.fetch.call(this,t)}});e.SystemTags=e.SystemTags||{},e.SystemTags.SystemTagsCollection=t,e.SystemTags.collection=new e.SystemTags.SystemTagsCollection}(OC)},function(e,n){!function(e){var n=e.Backbone.View.extend({_rendered:!1,_newTag:null,_lastUsedTags:[],className:"systemTagsInputFieldContainer",template:function(e){return''},initialize:function(t){t=t||{},this._multiple=!!t.multiple,this._allowActions=_.isUndefined(t.allowActions)||!!t.allowActions,this._allowCreate=_.isUndefined(t.allowCreate)||!!t.allowCreate,this._isAdmin=!!t.isAdmin,_.isFunction(t.initSelection)&&(this._initSelection=t.initSelection),this.collection=t.collection||e.SystemTags.collection;var n=this;this.collection.on("change:name remove",function(){_.defer(n._refreshSelection)}),_.defer(_.bind(this._getLastUsedTags,this)),_.bindAll(this,"_refreshSelection","_onClickRenameTag","_onClickDeleteTag","_onSelectTag","_onDeselectTag","_onSubmitRenameTag")},_getLastUsedTags:function(){var t=this;$.ajax({type:"GET",url:e.generateUrl("/apps/systemtags/lastused"),success:function(e){t._lastUsedTags=e}})},_refreshSelection:function(){this.$tagsField.select2("val",this.$tagsField.val())},_onClickRenameTag:function(n){var s=$(n.target).closest(".systemtags-item"),i=s.attr("data-id"),a=this.collection.get(i).get("name"),o=$(e.SystemTags.Templates.result_form({cid:this.cid,name:a,deleteTooltip:t("core","Delete"),renameLabel:t("core","Rename"),isAdmin:this._isAdmin}));return s.find(".label").after(o),s.find(".label, .systemtags-actions").addClass("hidden"),s.closest(".select2-result").addClass("has-form"),o.find("[title]").tooltip({placement:"bottom",container:"body"}),o.find("input").focus().selectRange(0,a.length),!1},_onSubmitRenameTag:function(e){e.preventDefault();var t=$(e.target),n=t.closest(".systemtags-item"),s=n.attr("data-id"),i=this.collection.get(s),a=$(e.target).find("input").val().trim();a&&a!==i.get("name")&&(i.save({name:a}),n.find(".label").text(a)),n.find(".label, .systemtags-actions").removeClass("hidden"),t.remove(),n.closest(".select2-result").removeClass("has-form")},_onClickDeleteTag:function(e){var t=$(e.target).closest(".systemtags-item"),n=t.attr("data-id");return this.collection.get(n).destroy(),$(e.target).tooltip("hide"),t.closest(".select2-result").remove(),!1},_addToSelect2Selection:function(e){var t=this.$tagsField.select2("data");t.push(e),this.$tagsField.select2("data",t)},_onSelectTag:function(e){var t,n=this;if(e.object&&e.object.isNew)return t=this.collection.create({name:e.object.name.trim(),userVisible:!0,userAssignable:!0,canAssign:!0},{success:function(e){n._addToSelect2Selection(e.toJSON()),n._lastUsedTags.unshift(e.id),n.trigger("select",e)},error:function(t,s){409===s.status&&(n.collection.reset(),n.collection.fetch({success:function(t){var s=t.where({name:e.object.name.trim(),userVisible:!0,userAssignable:!0});s.length&&(s=s[0],n._addToSelect2Selection(s.toJSON()),n.trigger("select",s))}}))}}),this.$tagsField.select2("close"),e.preventDefault(),!1;t=this.collection.get(e.object.id),this._lastUsedTags.unshift(t.id),this._newTag=null,this.trigger("select",t)},_onDeselectTag:function(e){this.trigger("deselect",e.choice.id)},_queryTagsAutocomplete:function(e){var t=this;this.collection.fetch({success:function(n){var s=n.filterByName(e.term.trim());t._isAdmin||(s=_.filter(s,function(e){return e.get("canAssign")})),e.callback({results:_.invoke(s,"toJSON")})}})},_preventDefault:function(e){e.stopPropagation()},_formatDropDownResult:function(n){return e.SystemTags.Templates.result(_.extend({renameTooltip:t("core","Rename"),allowActions:this._allowActions,tagMarkup:this._isAdmin?e.SystemTags.getDescriptiveTag(n)[0].innerHTML:null,isAdmin:this._isAdmin},n))},_formatSelection:function(t){return e.SystemTags.Templates.selection(_.extend({tagMarkup:this._isAdmin?e.SystemTags.getDescriptiveTag(t)[0].innerHTML:null,isAdmin:this._isAdmin},t))},_createSearchChoice:function(e){if(e=e.trim(),!this.collection.filter(function(t){return t.get("name")===e}).length)return this._newTag?this._newTag.name=e:this._newTag={id:-1,name:e,userAssignable:!0,userVisible:!0,canAssign:!0,isNew:!0},this._newTag},_initSelection:function(e,t){var n=this,s=$(e).val().split(",");function i(e){var t=e.toJSON();return n._isAdmin||t.canAssign||(t.locked=!0),t}this.collection.fetch({success:function(){t(function(e){var t=n.collection.filter(function(t){return e.indexOf(t.id)>=0&&(n._isAdmin||t.get("userVisible"))});return _.map(t,i)}(s))}})},render:function(){var n=this;this.$el.html(this.template()),this.$el.find("[title]").tooltip({placement:"bottom"}),this.$tagsField=this.$el.find("[name=tags]"),this.$tagsField.select2({placeholder:t("core","Collaborative tags"),containerCssClass:"systemtags-select2-container",dropdownCssClass:"systemtags-select2-dropdown",closeOnSelect:!1,allowClear:!1,multiple:this._multiple,toggleSelect:this._multiple,query:_.bind(this._queryTagsAutocomplete,this),id:function(e){return e.id},initSelection:_.bind(this._initSelection,this),formatResult:_.bind(this._formatDropDownResult,this),formatSelection:_.bind(this._formatSelection,this),createSearchChoice:this._allowCreate?_.bind(this._createSearchChoice,this):void 0,sortResults:function(t){var s=_.pluck(n.$tagsField.select2("data"),"id");return t.sort(function(t,i){var a=s.indexOf(t.id)>=0,o=s.indexOf(i.id)>=0;if(a===o){var l=n._lastUsedTags.indexOf(t.id),r=n._lastUsedTags.indexOf(i.id);return l!==r?-1===r?-1:-1===l?1:l\n * @copyright Copyright (c) 2016, Robin Appelman \n * @copyright Copyright (c) 2016, Jan-Christoph Borchardt \n * @copyright Copyright (c) 2016, Vincent Petry \n * @copyright Copyright (c) 2016, Erik Pellikka \n * @copyright Copyright (c) 2015, Vincent Petry \n *\n * @license GNU AGPL version 3 or any later version\n *\n */\n.systemtags-select2-dropdown .select2-result-label .checkmark {\n visibility: hidden;\n margin-left: -5px;\n margin-right: 5px;\n padding: 4px; }\n\n.systemtags-select2-dropdown .select2-result-label .new-item .systemtags-actions {\n display: none; }\n\n.systemtags-select2-dropdown .select2-selected .select2-result-label .checkmark {\n visibility: visible; }\n\n.systemtags-select2-dropdown .select2-result-label .icon {\n display: inline-block;\n opacity: .5; }\n .systemtags-select2-dropdown .select2-result-label .icon.rename {\n padding: 4px; }\n\n.systemtags-select2-dropdown .systemtags-actions {\n position: absolute;\n right: 5px; }\n\n.systemtags-select2-dropdown .systemtags-rename-form {\n display: inline-block;\n width: calc(100% - 20px);\n top: -6px;\n position: relative; }\n .systemtags-select2-dropdown .systemtags-rename-form input {\n display: inline-block;\n height: 30px;\n width: calc(100% - 40px); }\n\n.systemtags-select2-dropdown .label {\n width: 85%;\n display: inline-block;\n overflow: hidden;\n text-overflow: ellipsis; }\n .systemtags-select2-dropdown .label.hidden {\n display: none; }\n\n.systemtags-select2-dropdown span {\n line-height: 25px; }\n\n.systemtags-select2-dropdown .systemtags-item {\n display: inline-block;\n height: 25px;\n width: 100%; }\n\n.systemtags-select2-dropdown .select2-result-label {\n height: 25px; }\n\n.systemtags-select2-container {\n width: 100%; }\n .systemtags-select2-container .select2-choices .select2-search-choice.select2-locked .label {\n opacity: 0.5; }\n\n#select2-drop.systemtags-select2-dropdown .select2-results li.select2-result {\n padding: 5px; }\n',""])},function(e,t,n){"use strict";e.exports=function(e){var t=[];return t.toString=function(){return this.map(function(t){var n=function(e,t){var n=e[1]||"",s=e[3];if(!s)return n;if(t&&"function"==typeof btoa){var i=(o=s,"/*# sourceMappingURL=data:application/json;charset=utf-8;base64,"+btoa(unescape(encodeURIComponent(JSON.stringify(o))))+" */"),a=s.sources.map(function(e){return"/*# sourceURL="+s.sourceRoot+e+" */"});return[n].concat(a).concat([i]).join("\n")}var o;return[n].join("\n")}(t,e);return t[2]?"@media "+t[2]+"{"+n+"}":n}).join("")},t.i=function(e,n){"string"==typeof e&&(e=[[null,e,""]]);for(var s={},i=0;i=0&&u.splice(t,1)}function g(e){var t=document.createElement("style");if(void 0===e.attrs.type&&(e.attrs.type="text/css"),void 0===e.attrs.nonce){var s=function(){0;return n.nc}();s&&(e.attrs.nonce=s)}return y(t,e.attrs),m(e,t),t}function y(e,t){Object.keys(t).forEach(function(n){e.setAttribute(n,t[n])})}function b(e,t){var n,s,i,a;if(t.transform&&e.css){if(!(a="function"==typeof t.transform?t.transform(e.css):t.transform.default(e.css)))return function(){};e.css=a}if(t.singleton){var o=c++;n=r||(r=g(t)),s=T.bind(null,n,o,!1),i=T.bind(null,n,o,!0)}else e.sourceMap&&"function"==typeof URL&&"function"==typeof URL.createObjectURL&&"function"==typeof URL.revokeObjectURL&&"function"==typeof Blob&&"function"==typeof btoa?(n=function(e){var t=document.createElement("link");return void 0===e.attrs.type&&(e.attrs.type="text/css"),e.attrs.rel="stylesheet",y(t,e.attrs),m(e,t),t}(t),s=function(e,t,n){var s=n.css,i=n.sourceMap,a=void 0===t.convertToAbsoluteUrls&&i;(t.convertToAbsoluteUrls||a)&&(s=d(s));i&&(s+="\n/*# sourceMappingURL=data:application/json;base64,"+btoa(unescape(encodeURIComponent(JSON.stringify(i))))+" */");var o=new Blob([s],{type:"text/css"}),l=e.href;e.href=URL.createObjectURL(o),l&&URL.revokeObjectURL(l)}.bind(null,n,t),i=function(){h(n),n.href&&URL.revokeObjectURL(n.href)}):(n=g(t),s=function(e,t){var n=t.css,s=t.media;s&&e.setAttribute("media",s);if(e.styleSheet)e.styleSheet.cssText=n;else{for(;e.firstChild;)e.removeChild(e.firstChild);e.appendChild(document.createTextNode(n))}}.bind(null,n),i=function(){h(n)});return s(e),function(t){if(t){if(t.css===e.css&&t.media===e.media&&t.sourceMap===e.sourceMap)return;s(e=t)}else i()}}e.exports=function(e,t){if("undefined"!=typeof DEBUG&&DEBUG&&"object"!=typeof document)throw new Error("The style-loader cannot be used in a non-browser environment");(t=t||{}).attrs="object"==typeof t.attrs?t.attrs:{},t.singleton||"boolean"==typeof t.singleton||(t.singleton=o()),t.insertInto||(t.insertInto="head"),t.insertAt||(t.insertAt="bottom");var n=p(e,t);return f(n,t),function(e){for(var s=[],i=0;i